@instructure/ui-form-field 10.26.1 → 11.0.1-snapshot-0
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 +30 -1
- package/es/FormField/index.js +1 -2
- package/es/FormField/props.js +1 -18
- package/es/FormFieldGroup/index.js +2 -2
- package/es/FormFieldGroup/props.js +1 -17
- package/es/FormFieldLabel/index.js +6 -6
- package/es/FormFieldLabel/props.js +1 -6
- package/es/FormFieldLayout/index.js +2 -2
- package/es/FormFieldLayout/props.js +1 -20
- package/es/FormFieldMessage/index.js +2 -2
- package/es/FormFieldMessage/props.js +1 -6
- package/es/FormFieldMessages/index.js +2 -2
- package/es/FormFieldMessages/props.js +1 -7
- package/es/FormPropTypes.js +1 -41
- package/es/index.js +1 -2
- package/lib/FormField/index.js +0 -1
- package/lib/FormField/props.js +1 -19
- package/lib/FormFieldGroup/index.js +1 -1
- package/lib/FormFieldGroup/props.js +1 -18
- package/lib/FormFieldLabel/index.js +4 -5
- package/lib/FormFieldLabel/props.js +1 -7
- package/lib/FormFieldLayout/index.js +1 -1
- package/lib/FormFieldLayout/props.js +1 -21
- package/lib/FormFieldMessage/index.js +1 -1
- package/lib/FormFieldMessage/props.js +1 -6
- package/lib/FormFieldMessages/index.js +1 -1
- package/lib/FormFieldMessages/props.js +1 -8
- package/lib/FormPropTypes.js +1 -43
- package/lib/index.js +1 -8
- package/package.json +16 -17
- package/src/FormField/index.tsx +1 -2
- package/src/FormField/props.ts +2 -25
- package/src/FormFieldGroup/index.tsx +3 -3
- package/src/FormFieldGroup/props.ts +1 -22
- package/src/FormFieldLabel/index.tsx +2 -8
- package/src/FormFieldLabel/props.ts +1 -10
- package/src/FormFieldLayout/index.tsx +1 -2
- package/src/FormFieldLayout/props.ts +2 -26
- package/src/FormFieldMessage/index.tsx +1 -2
- package/src/FormFieldMessage/props.ts +2 -16
- package/src/FormFieldMessages/index.tsx +1 -2
- package/src/FormFieldMessages/props.ts +1 -12
- package/src/FormPropTypes.ts +0 -19
- package/src/index.ts +0 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/FormField/index.d.ts +0 -1
- package/types/FormField/index.d.ts.map +1 -1
- package/types/FormField/props.d.ts +2 -3
- package/types/FormField/props.d.ts.map +1 -1
- package/types/FormFieldGroup/index.d.ts +0 -14
- package/types/FormFieldGroup/index.d.ts.map +1 -1
- package/types/FormFieldGroup/props.d.ts +2 -3
- package/types/FormFieldGroup/props.d.ts.map +1 -1
- package/types/FormFieldLabel/index.d.ts +0 -4
- package/types/FormFieldLabel/index.d.ts.map +1 -1
- package/types/FormFieldLabel/props.d.ts +2 -3
- package/types/FormFieldLabel/props.d.ts.map +1 -1
- package/types/FormFieldLayout/index.d.ts +1 -2
- package/types/FormFieldLayout/index.d.ts.map +1 -1
- package/types/FormFieldLayout/props.d.ts +2 -3
- package/types/FormFieldLayout/props.d.ts.map +1 -1
- package/types/FormFieldMessage/index.d.ts +0 -4
- package/types/FormFieldMessage/index.d.ts.map +1 -1
- package/types/FormFieldMessage/props.d.ts +2 -3
- package/types/FormFieldMessage/props.d.ts.map +1 -1
- package/types/FormFieldMessages/index.d.ts +0 -4
- package/types/FormFieldMessages/index.d.ts.map +1 -1
- package/types/FormFieldMessages/props.d.ts +2 -3
- package/types/FormFieldMessages/props.d.ts.map +1 -1
- package/types/FormPropTypes.d.ts +0 -11
- package/types/FormPropTypes.d.ts.map +1 -1
- package/types/index.d.ts +0 -1
- package/types/index.d.ts.map +1 -1
package/lib/index.js
CHANGED
|
@@ -39,16 +39,9 @@ Object.defineProperty(exports, "FormFieldMessages", {
|
|
|
39
39
|
return _FormFieldMessages.FormFieldMessages;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
-
Object.defineProperty(exports, "FormPropTypes", {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: function () {
|
|
45
|
-
return _FormPropTypes.FormPropTypes;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
42
|
var _FormField = require("./FormField");
|
|
49
43
|
var _FormFieldLabel = require("./FormFieldLabel");
|
|
50
44
|
var _FormFieldMessage = require("./FormFieldMessage");
|
|
51
45
|
var _FormFieldMessages = require("./FormFieldMessages");
|
|
52
46
|
var _FormFieldLayout = require("./FormFieldLayout");
|
|
53
|
-
var _FormFieldGroup = require("./FormFieldGroup");
|
|
54
|
-
var _FormPropTypes = require("./FormPropTypes");
|
|
47
|
+
var _FormFieldGroup = require("./FormFieldGroup");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-form-field",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.1-snapshot-0",
|
|
4
4
|
"description": "Form layout components.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,29 +23,28 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-axe-check": "
|
|
27
|
-
"@instructure/ui-babel-preset": "
|
|
28
|
-
"@instructure/ui-themes": "
|
|
26
|
+
"@instructure/ui-axe-check": "11.0.1-snapshot-0",
|
|
27
|
+
"@instructure/ui-babel-preset": "11.0.1-snapshot-0",
|
|
28
|
+
"@instructure/ui-themes": "11.0.1-snapshot-0",
|
|
29
29
|
"@testing-library/jest-dom": "^6.6.3",
|
|
30
|
-
"@testing-library/react": "
|
|
30
|
+
"@testing-library/react": "15.0.7",
|
|
31
31
|
"vitest": "^3.2.2"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.27.6",
|
|
35
|
-
"@instructure/console": "
|
|
36
|
-
"@instructure/emotion": "
|
|
37
|
-
"@instructure/shared-types": "
|
|
38
|
-
"@instructure/ui-a11y-content": "
|
|
39
|
-
"@instructure/ui-a11y-utils": "
|
|
40
|
-
"@instructure/ui-grid": "
|
|
41
|
-
"@instructure/ui-icons": "
|
|
42
|
-
"@instructure/ui-react-utils": "
|
|
43
|
-
"@instructure/ui-utils": "
|
|
44
|
-
"@instructure/uid": "
|
|
45
|
-
"prop-types": "^15.8.1"
|
|
35
|
+
"@instructure/console": "11.0.1-snapshot-0",
|
|
36
|
+
"@instructure/emotion": "11.0.1-snapshot-0",
|
|
37
|
+
"@instructure/shared-types": "11.0.1-snapshot-0",
|
|
38
|
+
"@instructure/ui-a11y-content": "11.0.1-snapshot-0",
|
|
39
|
+
"@instructure/ui-a11y-utils": "11.0.1-snapshot-0",
|
|
40
|
+
"@instructure/ui-grid": "11.0.1-snapshot-0",
|
|
41
|
+
"@instructure/ui-icons": "11.0.1-snapshot-0",
|
|
42
|
+
"@instructure/ui-react-utils": "11.0.1-snapshot-0",
|
|
43
|
+
"@instructure/ui-utils": "11.0.1-snapshot-0",
|
|
44
|
+
"@instructure/uid": "11.0.1-snapshot-0"
|
|
46
45
|
},
|
|
47
46
|
"peerDependencies": {
|
|
48
|
-
"react": ">=
|
|
47
|
+
"react": ">=18 <=19"
|
|
49
48
|
},
|
|
50
49
|
"publishConfig": {
|
|
51
50
|
"access": "public"
|
package/src/FormField/index.tsx
CHANGED
|
@@ -28,7 +28,7 @@ import { omitProps, pickProps } from '@instructure/ui-react-utils'
|
|
|
28
28
|
|
|
29
29
|
import { FormFieldLayout } from '../FormFieldLayout'
|
|
30
30
|
|
|
31
|
-
import {
|
|
31
|
+
import { allowedProps } from './props'
|
|
32
32
|
import type { FormFieldProps } from './props'
|
|
33
33
|
|
|
34
34
|
/**
|
|
@@ -39,7 +39,6 @@ category: components
|
|
|
39
39
|
class FormField extends Component<FormFieldProps> {
|
|
40
40
|
static readonly componentId = 'FormField'
|
|
41
41
|
|
|
42
|
-
static propTypes = propTypes
|
|
43
42
|
static allowedProps = allowedProps
|
|
44
43
|
static defaultProps = {
|
|
45
44
|
inline: false,
|
package/src/FormField/props.ts
CHANGED
|
@@ -23,14 +23,8 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import React from 'react'
|
|
26
|
-
import PropTypes from 'prop-types'
|
|
27
26
|
|
|
28
|
-
import {
|
|
29
|
-
|
|
30
|
-
import type {
|
|
31
|
-
OtherHTMLAttributes,
|
|
32
|
-
PropValidators
|
|
33
|
-
} from '@instructure/shared-types'
|
|
27
|
+
import type { OtherHTMLAttributes } from '@instructure/shared-types'
|
|
34
28
|
import type { FormMessage } from '../FormPropTypes'
|
|
35
29
|
import type { Spacing } from '@instructure/emotion'
|
|
36
30
|
|
|
@@ -75,23 +69,6 @@ type PropKeys = keyof FormFieldOwnProps
|
|
|
75
69
|
type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
76
70
|
|
|
77
71
|
type FormFieldProps = FormFieldOwnProps & OtherHTMLAttributes<FormFieldOwnProps>
|
|
78
|
-
|
|
79
|
-
const propTypes: PropValidators<PropKeys> = {
|
|
80
|
-
label: PropTypes.node.isRequired,
|
|
81
|
-
id: PropTypes.string.isRequired,
|
|
82
|
-
messages: PropTypes.arrayOf(FormPropTypes.message),
|
|
83
|
-
messagesId: PropTypes.string,
|
|
84
|
-
children: PropTypes.node,
|
|
85
|
-
inline: PropTypes.bool,
|
|
86
|
-
layout: PropTypes.oneOf(['stacked', 'inline']),
|
|
87
|
-
labelAlign: PropTypes.oneOf(['start', 'end']),
|
|
88
|
-
vAlign: PropTypes.oneOf(['top', 'middle', 'bottom']),
|
|
89
|
-
width: PropTypes.string,
|
|
90
|
-
inputContainerRef: PropTypes.func,
|
|
91
|
-
elementRef: PropTypes.func,
|
|
92
|
-
margin: PropTypes.string
|
|
93
|
-
}
|
|
94
|
-
|
|
95
72
|
const allowedProps: AllowedPropKeys = [
|
|
96
73
|
'label',
|
|
97
74
|
'id',
|
|
@@ -109,4 +86,4 @@ const allowedProps: AllowedPropKeys = [
|
|
|
109
86
|
]
|
|
110
87
|
|
|
111
88
|
export type { FormFieldOwnProps, FormFieldProps }
|
|
112
|
-
export {
|
|
89
|
+
export { allowedProps }
|
|
@@ -33,7 +33,7 @@ import { FormFieldLayout } from '../FormFieldLayout'
|
|
|
33
33
|
import generateStyle from './styles'
|
|
34
34
|
import generateComponentTheme from './theme'
|
|
35
35
|
|
|
36
|
-
import {
|
|
36
|
+
import { allowedProps } from './props'
|
|
37
37
|
import type { FormFieldGroupProps, FormFieldGroupStyleProps } from './props'
|
|
38
38
|
|
|
39
39
|
/**
|
|
@@ -45,7 +45,6 @@ category: components
|
|
|
45
45
|
class FormFieldGroup extends Component<FormFieldGroupProps> {
|
|
46
46
|
static readonly componentId = 'FormFieldGroup'
|
|
47
47
|
|
|
48
|
-
static propTypes = propTypes
|
|
49
48
|
static allowedProps = allowedProps
|
|
50
49
|
static defaultProps = {
|
|
51
50
|
as: 'fieldset',
|
|
@@ -100,7 +99,8 @@ class FormFieldGroup extends Component<FormFieldGroupProps> {
|
|
|
100
99
|
return child ? (
|
|
101
100
|
<Grid.Col
|
|
102
101
|
width={
|
|
103
|
-
(child as ReactElement).props &&
|
|
102
|
+
(child as ReactElement).props &&
|
|
103
|
+
(child as ReactElement<any>).props.width
|
|
104
104
|
? 'auto'
|
|
105
105
|
: undefined
|
|
106
106
|
}
|
|
@@ -22,13 +22,8 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import PropTypes from 'prop-types'
|
|
26
|
-
|
|
27
|
-
import { FormPropTypes } from '../FormPropTypes'
|
|
28
|
-
|
|
29
25
|
import type {
|
|
30
26
|
AsElementType,
|
|
31
|
-
PropValidators,
|
|
32
27
|
FormFieldGroupTheme,
|
|
33
28
|
OtherHTMLAttributes
|
|
34
29
|
} from '@instructure/shared-types'
|
|
@@ -85,22 +80,6 @@ type FormFieldGroupProps = FormFieldGroupOwnProps &
|
|
|
85
80
|
>
|
|
86
81
|
|
|
87
82
|
type FormFieldGroupStyle = ComponentStyle<'formFieldGroup'>
|
|
88
|
-
|
|
89
|
-
const propTypes: PropValidators<PropKeys> = {
|
|
90
|
-
description: PropTypes.node.isRequired,
|
|
91
|
-
as: PropTypes.elementType,
|
|
92
|
-
messages: PropTypes.arrayOf(FormPropTypes.message),
|
|
93
|
-
messagesId: PropTypes.string,
|
|
94
|
-
disabled: PropTypes.bool,
|
|
95
|
-
children: PropTypes.node,
|
|
96
|
-
layout: PropTypes.oneOf(['stacked', 'columns', 'inline']),
|
|
97
|
-
rowSpacing: PropTypes.oneOf(['none', 'small', 'medium', 'large']),
|
|
98
|
-
colSpacing: PropTypes.oneOf(['none', 'small', 'medium', 'large']),
|
|
99
|
-
vAlign: PropTypes.oneOf(['top', 'middle', 'bottom']),
|
|
100
|
-
startAt: PropTypes.oneOf(['small', 'medium', 'large', 'x-large', null]),
|
|
101
|
-
elementRef: PropTypes.func
|
|
102
|
-
}
|
|
103
|
-
|
|
104
83
|
const allowedProps: AllowedPropKeys = [
|
|
105
84
|
'description',
|
|
106
85
|
'as',
|
|
@@ -121,4 +100,4 @@ export type {
|
|
|
121
100
|
FormFieldGroupStyleProps,
|
|
122
101
|
FormFieldGroupStyle
|
|
123
102
|
}
|
|
124
|
-
export {
|
|
103
|
+
export { allowedProps }
|
|
@@ -24,17 +24,13 @@
|
|
|
24
24
|
|
|
25
25
|
import { Component } from 'react'
|
|
26
26
|
|
|
27
|
-
import {
|
|
28
|
-
omitProps,
|
|
29
|
-
getElementType,
|
|
30
|
-
deprecated
|
|
31
|
-
} from '@instructure/ui-react-utils'
|
|
27
|
+
import { omitProps, getElementType } from '@instructure/ui-react-utils'
|
|
32
28
|
import { withStyle } from '@instructure/emotion'
|
|
33
29
|
|
|
34
30
|
import generateStyle from './styles'
|
|
35
31
|
import generateComponentTheme from './theme'
|
|
36
32
|
|
|
37
|
-
import {
|
|
33
|
+
import { allowedProps } from './props'
|
|
38
34
|
import type { FormFieldLabelProps } from './props'
|
|
39
35
|
|
|
40
36
|
/**
|
|
@@ -56,11 +52,9 @@ type: example
|
|
|
56
52
|
removed in the future
|
|
57
53
|
**/
|
|
58
54
|
@withStyle(generateStyle, generateComponentTheme)
|
|
59
|
-
@deprecated('10', null, 'This component will be removed in a future version')
|
|
60
55
|
class FormFieldLabel extends Component<FormFieldLabelProps> {
|
|
61
56
|
static readonly componentId = 'FormFieldLabel'
|
|
62
57
|
|
|
63
|
-
static propTypes = propTypes
|
|
64
58
|
static allowedProps = allowedProps
|
|
65
59
|
static defaultProps = {
|
|
66
60
|
as: 'span'
|
|
@@ -22,11 +22,8 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import PropTypes from 'prop-types'
|
|
26
|
-
|
|
27
25
|
import type {
|
|
28
26
|
AsElementType,
|
|
29
|
-
PropValidators,
|
|
30
27
|
FormFieldLabelTheme,
|
|
31
28
|
OtherHTMLAttributes
|
|
32
29
|
} from '@instructure/shared-types'
|
|
@@ -46,13 +43,7 @@ type FormFieldLabelProps = FormFieldLabelOwnProps &
|
|
|
46
43
|
OtherHTMLAttributes<FormFieldLabelOwnProps>
|
|
47
44
|
|
|
48
45
|
type FormFieldLabelStyle = ComponentStyle<'formFieldLabel'>
|
|
49
|
-
|
|
50
|
-
const propTypes: PropValidators<PropKeys> = {
|
|
51
|
-
children: PropTypes.node.isRequired,
|
|
52
|
-
as: PropTypes.elementType
|
|
53
|
-
}
|
|
54
|
-
|
|
55
46
|
const allowedProps: AllowedPropKeys = ['as', 'children']
|
|
56
47
|
|
|
57
48
|
export type { FormFieldLabelProps, FormFieldLabelStyle }
|
|
58
|
-
export {
|
|
49
|
+
export { allowedProps }
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
import { withStyle } from '@instructure/emotion'
|
|
34
34
|
import { FormFieldMessages } from '../FormFieldMessages'
|
|
35
35
|
import generateStyle from './styles'
|
|
36
|
-
import {
|
|
36
|
+
import { allowedProps, FormFieldStyleProps } from './props'
|
|
37
37
|
import type { FormFieldLayoutProps } from './props'
|
|
38
38
|
import generateComponentTheme from './theme'
|
|
39
39
|
|
|
@@ -47,7 +47,6 @@ parent: FormField
|
|
|
47
47
|
class FormFieldLayout extends Component<FormFieldLayoutProps> {
|
|
48
48
|
static readonly componentId = 'FormFieldLayout'
|
|
49
49
|
|
|
50
|
-
static propTypes = propTypes
|
|
51
50
|
static allowedProps = allowedProps
|
|
52
51
|
static defaultProps = {
|
|
53
52
|
inline: false,
|
|
@@ -22,14 +22,9 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import PropTypes from 'prop-types'
|
|
26
|
-
|
|
27
|
-
import { FormPropTypes } from '../FormPropTypes'
|
|
28
|
-
|
|
29
25
|
import type {
|
|
30
26
|
AsElementType,
|
|
31
|
-
OtherHTMLAttributes
|
|
32
|
-
PropValidators
|
|
27
|
+
OtherHTMLAttributes
|
|
33
28
|
} from '@instructure/shared-types'
|
|
34
29
|
import type {
|
|
35
30
|
WithStyleProps,
|
|
@@ -110,25 +105,6 @@ type FormFieldLayoutProps = FormFieldLayoutOwnProps &
|
|
|
110
105
|
type FormFieldLayoutStyle = ComponentStyle<
|
|
111
106
|
'formFieldLayout' | 'formFieldLabel' | 'formFieldChildren'
|
|
112
107
|
>
|
|
113
|
-
|
|
114
|
-
const propTypes: PropValidators<PropKeys> = {
|
|
115
|
-
label: PropTypes.node.isRequired,
|
|
116
|
-
id: PropTypes.string,
|
|
117
|
-
as: PropTypes.elementType,
|
|
118
|
-
messages: PropTypes.arrayOf(FormPropTypes.message),
|
|
119
|
-
messagesId: PropTypes.string,
|
|
120
|
-
children: PropTypes.node,
|
|
121
|
-
inline: PropTypes.bool,
|
|
122
|
-
layout: PropTypes.oneOf(['stacked', 'inline']),
|
|
123
|
-
labelAlign: PropTypes.oneOf(['start', 'end']),
|
|
124
|
-
vAlign: PropTypes.oneOf(['top', 'middle', 'bottom']),
|
|
125
|
-
width: PropTypes.string,
|
|
126
|
-
inputContainerRef: PropTypes.func,
|
|
127
|
-
elementRef: PropTypes.func,
|
|
128
|
-
isGroup: PropTypes.bool,
|
|
129
|
-
margin: PropTypes.string
|
|
130
|
-
}
|
|
131
|
-
|
|
132
108
|
const allowedProps: AllowedPropKeys = [
|
|
133
109
|
'label',
|
|
134
110
|
'id',
|
|
@@ -158,4 +134,4 @@ export type {
|
|
|
158
134
|
FormFieldLayoutStyle,
|
|
159
135
|
FormFieldLayoutOwnProps
|
|
160
136
|
}
|
|
161
|
-
export {
|
|
137
|
+
export { allowedProps }
|
|
@@ -33,7 +33,7 @@ import { withStyle } from '@instructure/emotion'
|
|
|
33
33
|
import generateStyle from './styles'
|
|
34
34
|
import generateComponentTheme from './theme'
|
|
35
35
|
|
|
36
|
-
import {
|
|
36
|
+
import { allowedProps } from './props'
|
|
37
37
|
import type { FormFieldMessageProps } from './props'
|
|
38
38
|
|
|
39
39
|
/**
|
|
@@ -55,7 +55,6 @@ type: example
|
|
|
55
55
|
class FormFieldMessage extends Component<FormFieldMessageProps> {
|
|
56
56
|
static readonly componentId = 'FormFieldMessage'
|
|
57
57
|
|
|
58
|
-
static propTypes = propTypes
|
|
59
58
|
static allowedProps = allowedProps
|
|
60
59
|
static defaultProps = {
|
|
61
60
|
variant: 'hint'
|
|
@@ -22,15 +22,7 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import {
|
|
26
|
-
formMessageTypePropType,
|
|
27
|
-
formMessageChildPropType
|
|
28
|
-
} from '../FormPropTypes'
|
|
29
|
-
|
|
30
|
-
import type {
|
|
31
|
-
PropValidators,
|
|
32
|
-
FormFieldMessageTheme
|
|
33
|
-
} from '@instructure/shared-types'
|
|
25
|
+
import type { FormFieldMessageTheme } from '@instructure/shared-types'
|
|
34
26
|
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
|
|
35
27
|
import type { FormMessageType, FormMessageChild } from '../FormPropTypes'
|
|
36
28
|
|
|
@@ -47,13 +39,7 @@ type FormFieldMessageProps = FormFieldMessageOwnProps &
|
|
|
47
39
|
WithStyleProps<FormFieldMessageTheme, FormFieldMessageStyle>
|
|
48
40
|
|
|
49
41
|
type FormFieldMessageStyle = ComponentStyle<'formFieldMessage' | 'errorIcon'>
|
|
50
|
-
|
|
51
|
-
const propTypes: PropValidators<PropKeys> = {
|
|
52
|
-
variant: formMessageTypePropType,
|
|
53
|
-
children: formMessageChildPropType
|
|
54
|
-
}
|
|
55
|
-
|
|
56
42
|
const allowedProps: AllowedPropKeys = ['variant', 'children']
|
|
57
43
|
|
|
58
44
|
export type { FormFieldMessageProps, FormFieldMessageStyle }
|
|
59
|
-
export {
|
|
45
|
+
export { allowedProps }
|
|
@@ -33,7 +33,7 @@ import { FormFieldMessage } from '../FormFieldMessage'
|
|
|
33
33
|
import generateStyle from './styles'
|
|
34
34
|
import generateComponentTheme from './theme'
|
|
35
35
|
|
|
36
|
-
import {
|
|
36
|
+
import { allowedProps } from './props'
|
|
37
37
|
import type { FormFieldMessagesProps } from './props'
|
|
38
38
|
|
|
39
39
|
/**
|
|
@@ -58,7 +58,6 @@ type: example
|
|
|
58
58
|
class FormFieldMessages extends Component<FormFieldMessagesProps> {
|
|
59
59
|
static readonly componentId = 'FormFieldMessages'
|
|
60
60
|
|
|
61
|
-
static propTypes = propTypes
|
|
62
61
|
static allowedProps = allowedProps
|
|
63
62
|
static defaultProps = {}
|
|
64
63
|
|
|
@@ -22,12 +22,7 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import PropTypes from 'prop-types'
|
|
26
|
-
|
|
27
|
-
import { FormPropTypes } from '../FormPropTypes'
|
|
28
|
-
|
|
29
25
|
import type {
|
|
30
|
-
PropValidators,
|
|
31
26
|
FormFieldMessagesTheme,
|
|
32
27
|
OtherHTMLAttributes
|
|
33
28
|
} from '@instructure/shared-types'
|
|
@@ -58,13 +53,7 @@ type FormFieldMessagesProps = FormFieldMessagesOwnProps &
|
|
|
58
53
|
OtherHTMLAttributes<FormFieldMessagesOwnProps>
|
|
59
54
|
|
|
60
55
|
type FormFieldMessagesStyle = ComponentStyle<'formFieldMessages' | 'message'>
|
|
61
|
-
|
|
62
|
-
const propTypes: PropValidators<PropKeys> = {
|
|
63
|
-
messages: PropTypes.arrayOf(FormPropTypes.message),
|
|
64
|
-
gridArea: PropTypes.string
|
|
65
|
-
}
|
|
66
|
-
|
|
67
56
|
const allowedProps: AllowedPropKeys = ['messages', 'gridArea']
|
|
68
57
|
|
|
69
58
|
export type { FormFieldMessagesProps, FormFieldMessagesStyle }
|
|
70
|
-
export {
|
|
59
|
+
export { allowedProps }
|
package/src/FormPropTypes.ts
CHANGED
|
@@ -23,16 +23,6 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import React from 'react'
|
|
26
|
-
import PropTypes from 'prop-types'
|
|
27
|
-
|
|
28
|
-
const formMessageTypePropType = PropTypes.oneOf([
|
|
29
|
-
'error',
|
|
30
|
-
'newError',
|
|
31
|
-
'hint',
|
|
32
|
-
'success',
|
|
33
|
-
'screenreader-only'
|
|
34
|
-
])
|
|
35
|
-
const formMessageChildPropType = PropTypes.node
|
|
36
26
|
|
|
37
27
|
type FormMessageType =
|
|
38
28
|
| 'newError'
|
|
@@ -46,18 +36,9 @@ type FormMessageType =
|
|
|
46
36
|
*/
|
|
47
37
|
type FormMessageChild = React.ReactNode
|
|
48
38
|
|
|
49
|
-
const FormPropTypes = {
|
|
50
|
-
message: PropTypes.shape({
|
|
51
|
-
type: formMessageTypePropType,
|
|
52
|
-
text: formMessageChildPropType
|
|
53
|
-
})
|
|
54
|
-
}
|
|
55
|
-
|
|
56
39
|
type FormMessage = {
|
|
57
40
|
type: FormMessageType
|
|
58
41
|
text: FormMessageChild
|
|
59
42
|
}
|
|
60
43
|
|
|
61
|
-
export default FormPropTypes
|
|
62
|
-
export { FormPropTypes, formMessageTypePropType, formMessageChildPropType }
|
|
63
44
|
export type { FormMessage, FormMessageType, FormMessageChild }
|
package/src/index.ts
CHANGED
|
@@ -29,7 +29,6 @@ export { FormFieldMessages } from './FormFieldMessages'
|
|
|
29
29
|
export { FormFieldLayout } from './FormFieldLayout'
|
|
30
30
|
export { FormFieldGroup } from './FormFieldGroup'
|
|
31
31
|
|
|
32
|
-
export { FormPropTypes } from './FormPropTypes'
|
|
33
32
|
export type { FormMessageType, FormMessage } from './FormPropTypes'
|
|
34
33
|
|
|
35
34
|
export type { FormFieldOwnProps, FormFieldProps } from './FormField/props'
|