@instructure/ui-form-field 8.12.1-snapshot.7 → 8.13.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 +6 -0
- package/es/FormField/index.js +2 -2
- package/es/FormField/props.js +1 -1
- package/es/FormFieldGroup/index.js +3 -3
- package/es/FormFieldGroup/props.js +1 -1
- package/es/FormFieldLabel/index.js +2 -2
- package/es/FormFieldLayout/index.js +3 -3
- package/es/FormFieldLayout/props.js +1 -1
- package/es/FormFieldMessage/index.js +2 -2
- package/es/FormFieldMessage/props.js +3 -3
- package/es/FormFieldMessages/index.js +2 -2
- package/es/FormFieldMessages/props.js +1 -1
- package/es/FormPropTypes.js +6 -4
- package/lib/FormField/index.js +3 -3
- package/lib/FormField/props.js +2 -2
- package/lib/FormFieldGroup/index.js +4 -4
- package/lib/FormFieldGroup/props.js +2 -2
- package/lib/FormFieldLabel/index.js +3 -3
- package/lib/FormFieldLabel/props.js +1 -1
- package/lib/FormFieldLayout/index.js +4 -4
- package/lib/FormFieldLayout/props.js +2 -2
- package/lib/FormFieldMessage/index.js +3 -3
- package/lib/FormFieldMessage/props.js +4 -6
- package/lib/FormFieldMessages/index.js +3 -3
- package/lib/FormFieldMessages/props.js +2 -2
- package/lib/FormPropTypes.js +8 -3
- package/lib/index.js +10 -10
- package/package.json +15 -16
- package/src/FormField/props.ts +1 -1
- package/src/FormFieldGroup/index.tsx +6 -3
- package/src/FormFieldGroup/props.ts +1 -1
- package/src/FormFieldLayout/index.tsx +3 -4
- package/src/FormFieldLayout/props.ts +1 -1
- package/src/FormFieldMessage/props.ts +8 -5
- package/src/FormFieldMessages/props.ts +1 -1
- package/src/FormPropTypes.ts +18 -7
- package/types/FormField/index.d.ts +2 -2
- package/types/FormFieldGroup/index.d.ts +2 -2
- package/types/FormFieldGroup/index.d.ts.map +1 -1
- package/types/FormFieldLayout/index.d.ts +2 -2
- package/types/FormFieldLayout/index.d.ts.map +1 -1
- package/types/FormFieldMessage/index.d.ts +2 -2
- package/types/FormFieldMessage/props.d.ts +2 -3
- package/types/FormFieldMessage/props.d.ts.map +1 -1
- package/types/FormPropTypes.d.ts +10 -5
- package/types/FormPropTypes.d.ts.map +1 -1
- package/LICENSE.md +0 -27
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
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
|
+
# [8.13.0](https://github.com/instructure/instructure-ui/compare/v8.12.0...v8.13.0) (2021-12-01)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **ui-form-field:** make FormField messages accept `ReactNode` text, not just `string` ([4d36973](https://github.com/instructure/instructure-ui/commit/4d369733414715a70bae0628378e8d82214eab3e))
|
|
11
|
+
|
|
6
12
|
# [8.12.0](https://github.com/instructure/instructure-ui/compare/v8.11.1...v8.12.0) (2021-11-17)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @instructure/ui-form-field
|
package/es/FormField/index.js
CHANGED
package/es/FormField/props.js
CHANGED
|
@@ -43,8 +43,8 @@ category: components
|
|
|
43
43
|
---
|
|
44
44
|
**/
|
|
45
45
|
let FormFieldGroup = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = class FormFieldGroup extends Component {
|
|
46
|
-
constructor(
|
|
47
|
-
super(...
|
|
46
|
+
constructor() {
|
|
47
|
+
super(...arguments);
|
|
48
48
|
this.ref = null;
|
|
49
49
|
|
|
50
50
|
this.handleRef = el => {
|
|
@@ -80,7 +80,7 @@ let FormFieldGroup = (_dec = withStyle(generateStyle, generateComponentTheme), _
|
|
|
80
80
|
renderColumns() {
|
|
81
81
|
return Children.map(this.props.children, (child, index) => {
|
|
82
82
|
return child ? jsx(Grid.Col, {
|
|
83
|
-
width: child.props && child.props.width ? 'auto' :
|
|
83
|
+
width: child.props && child.props.width ? 'auto' : void 0,
|
|
84
84
|
key: index
|
|
85
85
|
}, child) : null;
|
|
86
86
|
});
|
|
@@ -49,8 +49,8 @@ example: true
|
|
|
49
49
|
|
|
50
50
|
**/
|
|
51
51
|
let FormFieldLabel = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = class FormFieldLabel extends Component {
|
|
52
|
-
constructor(
|
|
53
|
-
super(...
|
|
52
|
+
constructor() {
|
|
53
|
+
super(...arguments);
|
|
54
54
|
this.ref = null;
|
|
55
55
|
|
|
56
56
|
this.handleRef = el => {
|
|
@@ -124,8 +124,8 @@ let FormFieldLayout = (_dec = withStyle(generateStyle, null), _dec(_class = (_te
|
|
|
124
124
|
|
|
125
125
|
renderVisibleMessages() {
|
|
126
126
|
return this.hasMessages ? jsx(Grid.Row, null, jsx(Grid.Col, {
|
|
127
|
-
offset: this.inlineContainerAndLabel ?
|
|
128
|
-
textAlign: this.inlineContainerAndLabel ? 'end' :
|
|
127
|
+
offset: this.inlineContainerAndLabel ? void 0 : 3,
|
|
128
|
+
textAlign: this.inlineContainerAndLabel ? 'end' : void 0
|
|
129
129
|
}, jsx(FormFieldMessages, {
|
|
130
130
|
id: this._messagesId,
|
|
131
131
|
messages: this.props.messages
|
|
@@ -155,7 +155,7 @@ let FormFieldLayout = (_dec = withStyle(generateStyle, null), _dec(_class = (_te
|
|
|
155
155
|
colSpacing: "small",
|
|
156
156
|
startAt: layout === 'inline' && this.hasVisibleLabel ? 'medium' : null
|
|
157
157
|
}, pickProps(props, Grid.allowedProps)), jsx(Grid.Row, null, this.renderLabel(), jsx(Grid.Col, {
|
|
158
|
-
width: this.inlineContainerAndLabel ? 'auto' :
|
|
158
|
+
width: this.inlineContainerAndLabel ? 'auto' : void 0,
|
|
159
159
|
elementRef: this.handleInputContainerRef
|
|
160
160
|
}, children)), this.renderVisibleMessages()));
|
|
161
161
|
}
|
|
@@ -48,8 +48,8 @@ example: true
|
|
|
48
48
|
```
|
|
49
49
|
**/
|
|
50
50
|
let FormFieldMessage = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = class FormFieldMessage extends Component {
|
|
51
|
-
constructor(
|
|
52
|
-
super(...
|
|
51
|
+
constructor() {
|
|
52
|
+
super(...arguments);
|
|
53
53
|
this.ref = null;
|
|
54
54
|
|
|
55
55
|
this.handleRef = el => {
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
|
-
import
|
|
24
|
+
import { formMessageTypePropType, formMessageChildPropType } from '../FormPropTypes';
|
|
25
25
|
const propTypes = {
|
|
26
|
-
variant:
|
|
27
|
-
children:
|
|
26
|
+
variant: formMessageTypePropType,
|
|
27
|
+
children: formMessageChildPropType
|
|
28
28
|
};
|
|
29
29
|
const allowedProps = ['variant', 'children'];
|
|
30
30
|
export { propTypes, allowedProps };
|
|
@@ -52,8 +52,8 @@ example: true
|
|
|
52
52
|
```
|
|
53
53
|
**/
|
|
54
54
|
let FormFieldMessages = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = class FormFieldMessages extends Component {
|
|
55
|
-
constructor(
|
|
56
|
-
super(...
|
|
55
|
+
constructor() {
|
|
56
|
+
super(...arguments);
|
|
57
57
|
this.ref = null;
|
|
58
58
|
|
|
59
59
|
this.handleRef = el => {
|
package/es/FormPropTypes.js
CHANGED
|
@@ -22,6 +22,9 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
import PropTypes from 'prop-types';
|
|
25
|
+
const formMessageTypePropType = PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only']);
|
|
26
|
+
const formMessageChildPropType = PropTypes.node;
|
|
27
|
+
|
|
25
28
|
/**
|
|
26
29
|
* ---
|
|
27
30
|
* category: utilities/form
|
|
@@ -29,12 +32,11 @@ import PropTypes from 'prop-types';
|
|
|
29
32
|
* Custom prop types for React components.
|
|
30
33
|
* @module FormPropTypes
|
|
31
34
|
*/
|
|
32
|
-
|
|
33
35
|
const FormPropTypes = {
|
|
34
36
|
message: PropTypes.shape({
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
type: formMessageTypePropType,
|
|
38
|
+
text: formMessageChildPropType
|
|
37
39
|
})
|
|
38
40
|
};
|
|
39
41
|
export default FormPropTypes;
|
|
40
|
-
export { FormPropTypes };
|
|
42
|
+
export { FormPropTypes, formMessageTypePropType, formMessageChildPropType };
|
package/lib/FormField/index.js
CHANGED
|
@@ -5,7 +5,7 @@ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWild
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.default = exports.FormField = void 0;
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
@@ -47,8 +47,8 @@ category: components
|
|
|
47
47
|
---
|
|
48
48
|
**/
|
|
49
49
|
class FormField extends _react.Component {
|
|
50
|
-
constructor(
|
|
51
|
-
super(...
|
|
50
|
+
constructor() {
|
|
51
|
+
super(...arguments);
|
|
52
52
|
this.ref = null;
|
|
53
53
|
|
|
54
54
|
this.handleRef = el => {
|
package/lib/FormField/props.js
CHANGED
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.propTypes = exports.allowedProps = void 0;
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
@@ -44,7 +44,7 @@ const propTypes = {
|
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* object with shape: `{
|
|
47
|
-
* text: PropTypes.
|
|
47
|
+
* text: PropTypes.node,
|
|
48
48
|
* type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
|
|
49
49
|
* }`
|
|
50
50
|
*/
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.default = exports.FormFieldGroup = void 0;
|
|
9
9
|
|
|
10
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
11
|
|
|
@@ -37,8 +37,8 @@ category: components
|
|
|
37
37
|
---
|
|
38
38
|
**/
|
|
39
39
|
let FormFieldGroup = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = class FormFieldGroup extends _react.Component {
|
|
40
|
-
constructor(
|
|
41
|
-
super(...
|
|
40
|
+
constructor() {
|
|
41
|
+
super(...arguments);
|
|
42
42
|
this.ref = null;
|
|
43
43
|
|
|
44
44
|
this.handleRef = el => {
|
|
@@ -74,7 +74,7 @@ let FormFieldGroup = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.def
|
|
|
74
74
|
renderColumns() {
|
|
75
75
|
return _react.Children.map(this.props.children, (child, index) => {
|
|
76
76
|
return child ? (0, _emotion.jsx)(_Grid.Grid.Col, {
|
|
77
|
-
width: child.props && child.props.width ? 'auto' :
|
|
77
|
+
width: child.props && child.props.width ? 'auto' : void 0,
|
|
78
78
|
key: index
|
|
79
79
|
}, child) : null;
|
|
80
80
|
});
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.propTypes = exports.allowedProps = void 0;
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
@@ -44,7 +44,7 @@ const propTypes = {
|
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* object with shape: `{
|
|
47
|
-
* text: PropTypes.
|
|
47
|
+
* text: PropTypes.node,
|
|
48
48
|
* type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
|
|
49
49
|
* }`
|
|
50
50
|
*/
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.default = exports.FormFieldLabel = void 0;
|
|
9
9
|
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
|
|
@@ -40,8 +40,8 @@ example: true
|
|
|
40
40
|
|
|
41
41
|
**/
|
|
42
42
|
let FormFieldLabel = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = class FormFieldLabel extends _react.Component {
|
|
43
|
-
constructor(
|
|
44
|
-
super(...
|
|
43
|
+
constructor() {
|
|
44
|
+
super(...arguments);
|
|
45
45
|
this.ref = null;
|
|
46
46
|
|
|
47
47
|
this.handleRef = el => {
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.propTypes = exports.allowedProps = void 0;
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.default = exports.FormFieldLayout = void 0;
|
|
9
9
|
|
|
10
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
11
|
|
|
@@ -124,8 +124,8 @@ let FormFieldLayout = (_dec = (0, _emotion.withStyle)(_styles.default, null), _d
|
|
|
124
124
|
|
|
125
125
|
renderVisibleMessages() {
|
|
126
126
|
return this.hasMessages ? (0, _emotion.jsx)(_Grid.Grid.Row, null, (0, _emotion.jsx)(_Grid.Grid.Col, {
|
|
127
|
-
offset: this.inlineContainerAndLabel ?
|
|
128
|
-
textAlign: this.inlineContainerAndLabel ? 'end' :
|
|
127
|
+
offset: this.inlineContainerAndLabel ? void 0 : 3,
|
|
128
|
+
textAlign: this.inlineContainerAndLabel ? 'end' : void 0
|
|
129
129
|
}, (0, _emotion.jsx)(_FormFieldMessages.FormFieldMessages, {
|
|
130
130
|
id: this._messagesId,
|
|
131
131
|
messages: this.props.messages
|
|
@@ -153,7 +153,7 @@ let FormFieldLayout = (_dec = (0, _emotion.withStyle)(_styles.default, null), _d
|
|
|
153
153
|
colSpacing: "small",
|
|
154
154
|
startAt: layout === 'inline' && this.hasVisibleLabel ? 'medium' : null
|
|
155
155
|
}, (0, _pickProps.pickProps)(props, _Grid.Grid.allowedProps)), (0, _emotion.jsx)(_Grid.Grid.Row, null, this.renderLabel(), (0, _emotion.jsx)(_Grid.Grid.Col, {
|
|
156
|
-
width: this.inlineContainerAndLabel ? 'auto' :
|
|
156
|
+
width: this.inlineContainerAndLabel ? 'auto' : void 0,
|
|
157
157
|
elementRef: this.handleInputContainerRef
|
|
158
158
|
}, children)), this.renderVisibleMessages()));
|
|
159
159
|
}
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.propTypes = exports.allowedProps = void 0;
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
@@ -49,7 +49,7 @@ const propTypes = {
|
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* object with shape: `{
|
|
52
|
-
* text: PropTypes.
|
|
52
|
+
* text: PropTypes.node,
|
|
53
53
|
* type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
|
|
54
54
|
* }`
|
|
55
55
|
*/
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.default = exports.FormFieldMessage = void 0;
|
|
9
9
|
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
|
|
@@ -37,8 +37,8 @@ example: true
|
|
|
37
37
|
```
|
|
38
38
|
**/
|
|
39
39
|
let FormFieldMessage = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = class FormFieldMessage extends _react.Component {
|
|
40
|
-
constructor(
|
|
41
|
-
super(...
|
|
40
|
+
constructor() {
|
|
41
|
+
super(...arguments);
|
|
42
42
|
this.ref = null;
|
|
43
43
|
|
|
44
44
|
this.handleRef = el => {
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
exports.
|
|
6
|
+
exports.propTypes = exports.allowedProps = void 0;
|
|
9
7
|
|
|
10
|
-
var
|
|
8
|
+
var _FormPropTypes = require("../FormPropTypes");
|
|
11
9
|
|
|
12
10
|
/*
|
|
13
11
|
* The MIT License (MIT)
|
|
@@ -33,8 +31,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
33
31
|
* SOFTWARE.
|
|
34
32
|
*/
|
|
35
33
|
const propTypes = {
|
|
36
|
-
variant:
|
|
37
|
-
children:
|
|
34
|
+
variant: _FormPropTypes.formMessageTypePropType,
|
|
35
|
+
children: _FormPropTypes.formMessageChildPropType
|
|
38
36
|
};
|
|
39
37
|
exports.propTypes = propTypes;
|
|
40
38
|
const allowedProps = ['variant', 'children'];
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.default = exports.FormFieldMessages = void 0;
|
|
9
9
|
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
|
|
@@ -42,8 +42,8 @@ example: true
|
|
|
42
42
|
```
|
|
43
43
|
**/
|
|
44
44
|
let FormFieldMessages = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = class FormFieldMessages extends _react.Component {
|
|
45
|
-
constructor(
|
|
46
|
-
super(...
|
|
45
|
+
constructor() {
|
|
46
|
+
super(...arguments);
|
|
47
47
|
this.ref = null;
|
|
48
48
|
|
|
49
49
|
this.handleRef = el => {
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.propTypes = exports.allowedProps = void 0;
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
@@ -37,7 +37,7 @@ var _FormPropTypes = require("../FormPropTypes");
|
|
|
37
37
|
const propTypes = {
|
|
38
38
|
/**
|
|
39
39
|
* object with shape: `{
|
|
40
|
-
* text: PropTypes.
|
|
40
|
+
* text: PropTypes.node,
|
|
41
41
|
* type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
|
|
42
42
|
* }`
|
|
43
43
|
*/
|
package/lib/FormPropTypes.js
CHANGED
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.formMessageTypePropType = exports.formMessageChildPropType = exports.default = exports.FormPropTypes = void 0;
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
|
@@ -32,6 +32,11 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
32
32
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
33
33
|
* SOFTWARE.
|
|
34
34
|
*/
|
|
35
|
+
const formMessageTypePropType = _propTypes.default.oneOf(['error', 'hint', 'success', 'screenreader-only']);
|
|
36
|
+
|
|
37
|
+
exports.formMessageTypePropType = formMessageTypePropType;
|
|
38
|
+
const formMessageChildPropType = _propTypes.default.node;
|
|
39
|
+
exports.formMessageChildPropType = formMessageChildPropType;
|
|
35
40
|
|
|
36
41
|
/**
|
|
37
42
|
* ---
|
|
@@ -42,8 +47,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
42
47
|
*/
|
|
43
48
|
const FormPropTypes = {
|
|
44
49
|
message: _propTypes.default.shape({
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
type: formMessageTypePropType,
|
|
51
|
+
text: formMessageChildPropType
|
|
47
52
|
})
|
|
48
53
|
};
|
|
49
54
|
exports.FormPropTypes = FormPropTypes;
|
package/lib/index.js
CHANGED
|
@@ -9,34 +9,34 @@ Object.defineProperty(exports, "FormField", {
|
|
|
9
9
|
return _FormField.FormField;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "FormFieldGroup", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function () {
|
|
15
|
-
return
|
|
15
|
+
return _FormFieldGroup.FormFieldGroup;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
Object.defineProperty(exports, "
|
|
18
|
+
Object.defineProperty(exports, "FormFieldLabel", {
|
|
19
19
|
enumerable: true,
|
|
20
20
|
get: function () {
|
|
21
|
-
return
|
|
21
|
+
return _FormFieldLabel.FormFieldLabel;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
Object.defineProperty(exports, "
|
|
24
|
+
Object.defineProperty(exports, "FormFieldLayout", {
|
|
25
25
|
enumerable: true,
|
|
26
26
|
get: function () {
|
|
27
|
-
return
|
|
27
|
+
return _FormFieldLayout.FormFieldLayout;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
Object.defineProperty(exports, "
|
|
30
|
+
Object.defineProperty(exports, "FormFieldMessage", {
|
|
31
31
|
enumerable: true,
|
|
32
32
|
get: function () {
|
|
33
|
-
return
|
|
33
|
+
return _FormFieldMessage.FormFieldMessage;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
-
Object.defineProperty(exports, "
|
|
36
|
+
Object.defineProperty(exports, "FormFieldMessages", {
|
|
37
37
|
enumerable: true,
|
|
38
38
|
get: function () {
|
|
39
|
-
return
|
|
39
|
+
return _FormFieldMessages.FormFieldMessages;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
Object.defineProperty(exports, "FormPropTypes", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-form-field",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.13.0",
|
|
4
4
|
"description": "Form layout components.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -24,22 +24,22 @@
|
|
|
24
24
|
},
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@instructure/ui-babel-preset": "8.
|
|
28
|
-
"@instructure/ui-test-utils": "8.
|
|
29
|
-
"@instructure/ui-themes": "8.
|
|
27
|
+
"@instructure/ui-babel-preset": "8.13.0",
|
|
28
|
+
"@instructure/ui-test-utils": "8.13.0",
|
|
29
|
+
"@instructure/ui-themes": "8.13.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@babel/runtime": "^7.13.10",
|
|
33
|
-
"@instructure/console": "8.
|
|
34
|
-
"@instructure/emotion": "8.
|
|
35
|
-
"@instructure/shared-types": "8.
|
|
36
|
-
"@instructure/ui-a11y-content": "8.
|
|
37
|
-
"@instructure/ui-a11y-utils": "8.
|
|
38
|
-
"@instructure/ui-grid": "8.
|
|
39
|
-
"@instructure/ui-icons": "8.
|
|
40
|
-
"@instructure/ui-react-utils": "8.
|
|
41
|
-
"@instructure/ui-utils": "8.
|
|
42
|
-
"@instructure/uid": "8.
|
|
33
|
+
"@instructure/console": "8.13.0",
|
|
34
|
+
"@instructure/emotion": "8.13.0",
|
|
35
|
+
"@instructure/shared-types": "8.13.0",
|
|
36
|
+
"@instructure/ui-a11y-content": "8.13.0",
|
|
37
|
+
"@instructure/ui-a11y-utils": "8.13.0",
|
|
38
|
+
"@instructure/ui-grid": "8.13.0",
|
|
39
|
+
"@instructure/ui-icons": "8.13.0",
|
|
40
|
+
"@instructure/ui-react-utils": "8.13.0",
|
|
41
|
+
"@instructure/ui-utils": "8.13.0",
|
|
42
|
+
"@instructure/uid": "8.13.0",
|
|
43
43
|
"prop-types": "^15"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
@@ -47,6 +47,5 @@
|
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
|
-
}
|
|
51
|
-
"gitHead": "1e7ac821932a91fe9ef761c96f747c7ea1f3925a"
|
|
50
|
+
}
|
|
52
51
|
}
|
package/src/FormField/props.ts
CHANGED
|
@@ -62,7 +62,7 @@ const propTypes: PropValidators<PropKeys> = {
|
|
|
62
62
|
id: PropTypes.string.isRequired,
|
|
63
63
|
/**
|
|
64
64
|
* object with shape: `{
|
|
65
|
-
* text: PropTypes.
|
|
65
|
+
* text: PropTypes.node,
|
|
66
66
|
* type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
|
|
67
67
|
* }`
|
|
68
68
|
*/
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
/** @jsx jsx */
|
|
26
|
-
import { Component, Children } from 'react'
|
|
26
|
+
import { Component, Children, ReactElement } from 'react'
|
|
27
27
|
|
|
28
28
|
import { Grid } from '@instructure/ui-grid'
|
|
29
29
|
import { pickProps, omitProps } from '@instructure/ui-react-utils'
|
|
@@ -97,8 +97,11 @@ class FormFieldGroup extends Component<FormFieldGroupProps> {
|
|
|
97
97
|
return Children.map(this.props.children, (child, index) => {
|
|
98
98
|
return child ? (
|
|
99
99
|
<Grid.Col
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
width={
|
|
101
|
+
(child as ReactElement).props && (child as ReactElement).props.width
|
|
102
|
+
? 'auto'
|
|
103
|
+
: undefined
|
|
104
|
+
}
|
|
102
105
|
key={index}
|
|
103
106
|
>
|
|
104
107
|
{child}
|
|
@@ -167,9 +167,8 @@ class FormFieldLayout extends Component<FormFieldLayoutProps> {
|
|
|
167
167
|
return this.hasMessages ? (
|
|
168
168
|
<Grid.Row>
|
|
169
169
|
<Grid.Col
|
|
170
|
-
offset={this.inlineContainerAndLabel ?
|
|
171
|
-
|
|
172
|
-
textAlign={this.inlineContainerAndLabel ? 'end' : null}
|
|
170
|
+
offset={this.inlineContainerAndLabel ? undefined : 3}
|
|
171
|
+
textAlign={this.inlineContainerAndLabel ? 'end' : undefined}
|
|
173
172
|
>
|
|
174
173
|
<FormFieldMessages
|
|
175
174
|
// @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call.
|
|
@@ -211,7 +210,7 @@ class FormFieldLayout extends Component<FormFieldLayoutProps> {
|
|
|
211
210
|
<Grid.Row>
|
|
212
211
|
{this.renderLabel()}
|
|
213
212
|
<Grid.Col
|
|
214
|
-
width={this.inlineContainerAndLabel ? 'auto' :
|
|
213
|
+
width={this.inlineContainerAndLabel ? 'auto' : undefined}
|
|
215
214
|
elementRef={this.handleInputContainerRef}
|
|
216
215
|
>
|
|
217
216
|
{children}
|
|
@@ -22,18 +22,21 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import
|
|
25
|
+
import {
|
|
26
|
+
formMessageTypePropType,
|
|
27
|
+
formMessageChildPropType
|
|
28
|
+
} from '../FormPropTypes'
|
|
26
29
|
|
|
27
30
|
import type {
|
|
28
31
|
PropValidators,
|
|
29
32
|
FormFieldMessageTheme
|
|
30
33
|
} from '@instructure/shared-types'
|
|
31
34
|
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
|
|
32
|
-
import type { FormMessageType } from '../FormPropTypes'
|
|
35
|
+
import type { FormMessageType, FormMessageChild } from '../FormPropTypes'
|
|
33
36
|
|
|
34
37
|
type FormFieldMessageOwnProps = {
|
|
35
38
|
variant?: FormMessageType
|
|
36
|
-
children?:
|
|
39
|
+
children?: FormMessageChild
|
|
37
40
|
}
|
|
38
41
|
|
|
39
42
|
type PropKeys = keyof FormFieldMessageOwnProps
|
|
@@ -46,8 +49,8 @@ type FormFieldMessageProps = FormFieldMessageOwnProps &
|
|
|
46
49
|
type FormFieldMessageStyle = ComponentStyle<'formFieldMessage'>
|
|
47
50
|
|
|
48
51
|
const propTypes: PropValidators<PropKeys> = {
|
|
49
|
-
variant:
|
|
50
|
-
children:
|
|
52
|
+
variant: formMessageTypePropType,
|
|
53
|
+
children: formMessageChildPropType
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
const allowedProps: AllowedPropKeys = ['variant', 'children']
|
|
@@ -51,7 +51,7 @@ type FormFieldMessagesStyle = ComponentStyle<'formFieldMessages' | 'message'>
|
|
|
51
51
|
const propTypes: PropValidators<PropKeys> = {
|
|
52
52
|
/**
|
|
53
53
|
* object with shape: `{
|
|
54
|
-
* text: PropTypes.
|
|
54
|
+
* text: PropTypes.node,
|
|
55
55
|
* type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
|
|
56
56
|
* }`
|
|
57
57
|
*/
|
package/src/FormPropTypes.ts
CHANGED
|
@@ -22,8 +22,20 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
+
import React from 'react'
|
|
25
26
|
import PropTypes from 'prop-types'
|
|
26
27
|
|
|
28
|
+
const formMessageTypePropType = PropTypes.oneOf([
|
|
29
|
+
'error',
|
|
30
|
+
'hint',
|
|
31
|
+
'success',
|
|
32
|
+
'screenreader-only'
|
|
33
|
+
])
|
|
34
|
+
const formMessageChildPropType = PropTypes.node
|
|
35
|
+
|
|
36
|
+
type FormMessageType = 'error' | 'hint' | 'success' | 'screenreader-only'
|
|
37
|
+
type FormMessageChild = React.ReactNode
|
|
38
|
+
|
|
27
39
|
/**
|
|
28
40
|
* ---
|
|
29
41
|
* category: utilities/form
|
|
@@ -33,17 +45,16 @@ import PropTypes from 'prop-types'
|
|
|
33
45
|
*/
|
|
34
46
|
const FormPropTypes = {
|
|
35
47
|
message: PropTypes.shape({
|
|
36
|
-
|
|
37
|
-
|
|
48
|
+
type: formMessageTypePropType,
|
|
49
|
+
text: formMessageChildPropType
|
|
38
50
|
})
|
|
39
51
|
}
|
|
40
52
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
export type FormMessage = {
|
|
44
|
-
text: string
|
|
53
|
+
type FormMessage = {
|
|
45
54
|
type: FormMessageType
|
|
55
|
+
text: FormMessageChild
|
|
46
56
|
}
|
|
47
57
|
|
|
48
58
|
export default FormPropTypes
|
|
49
|
-
export { FormPropTypes }
|
|
59
|
+
export { FormPropTypes, formMessageTypePropType, formMessageChildPropType }
|
|
60
|
+
export type { FormMessage, FormMessageType, FormMessageChild }
|
|
@@ -10,7 +10,7 @@ declare class FormField extends Component<FormFieldProps> {
|
|
|
10
10
|
static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
|
|
11
11
|
label: React.ReactNode;
|
|
12
12
|
id: string;
|
|
13
|
-
messages?: import("
|
|
13
|
+
messages?: import("../FormPropTypes").FormMessage[] | undefined;
|
|
14
14
|
messagesId?: string | undefined;
|
|
15
15
|
children?: React.ReactNode;
|
|
16
16
|
inline?: boolean | undefined;
|
|
@@ -24,7 +24,7 @@ declare class FormField extends Component<FormFieldProps> {
|
|
|
24
24
|
static allowedProps: readonly (keyof {
|
|
25
25
|
label: React.ReactNode;
|
|
26
26
|
id: string;
|
|
27
|
-
messages?: import("
|
|
27
|
+
messages?: import("../FormPropTypes").FormMessage[] | undefined;
|
|
28
28
|
messagesId?: string | undefined;
|
|
29
29
|
children?: React.ReactNode;
|
|
30
30
|
inline?: boolean | undefined;
|
|
@@ -12,7 +12,7 @@ declare class FormFieldGroup extends Component<FormFieldGroupProps> {
|
|
|
12
12
|
static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
|
|
13
13
|
description: import("react").ReactNode;
|
|
14
14
|
as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
|
|
15
|
-
messages?: import("
|
|
15
|
+
messages?: import("../FormPropTypes").FormMessage[] | undefined;
|
|
16
16
|
messagesId?: string | undefined;
|
|
17
17
|
disabled?: boolean | undefined;
|
|
18
18
|
children?: import("react").ReactNode;
|
|
@@ -26,7 +26,7 @@ declare class FormFieldGroup extends Component<FormFieldGroupProps> {
|
|
|
26
26
|
static allowedProps: readonly (keyof {
|
|
27
27
|
description: import("react").ReactNode;
|
|
28
28
|
as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
|
|
29
|
-
messages?: import("
|
|
29
|
+
messages?: import("../FormPropTypes").FormMessage[] | undefined;
|
|
30
30
|
messagesId?: string | undefined;
|
|
31
31
|
disabled?: boolean | undefined;
|
|
32
32
|
children?: import("react").ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/FormFieldGroup/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/FormFieldGroup/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAA0B,MAAM,OAAO,CAAA;AAIzD,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAQrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAE5E;;;;GAIG;AACH,cACM,cAAe,SAAQ,SAAS,CAAC,mBAAmB,CAAC;IACzD,MAAM,CAAC,QAAQ,CAAC,WAAW,oBAAmB;IAE9C,MAAM,CAAC,SAAS;;;;;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;;;MAOlB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAQ9B;IAED,iBAAiB;IAMjB,kBAAkB,CAAC,SAAS,KAAA,EAAE,SAAS,KAAA,EAAE,QAAQ,KAAA;IAKjD,IAAI,mBAAmB,IAAI,wBAAwB,CAElD;IAED,IAAI,OAAO,YAOV;IAED,aAAa;IAiBb,cAAc;IAgBd,YAAY;IAUZ,MAAM;CAmBP;AAED,eAAe,cAAc,CAAA;AAC7B,OAAO,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -13,7 +13,7 @@ declare class FormFieldLayout extends Component<FormFieldLayoutProps> {
|
|
|
13
13
|
label: import("react").ReactNode;
|
|
14
14
|
id?: string | undefined;
|
|
15
15
|
as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
|
|
16
|
-
messages?: import("
|
|
16
|
+
messages?: import("../FormPropTypes").FormMessage[] | undefined;
|
|
17
17
|
messagesId?: string | undefined;
|
|
18
18
|
children?: import("react").ReactNode;
|
|
19
19
|
inline?: boolean | undefined;
|
|
@@ -27,7 +27,7 @@ declare class FormFieldLayout extends Component<FormFieldLayoutProps> {
|
|
|
27
27
|
label: import("react").ReactNode;
|
|
28
28
|
id?: string | undefined;
|
|
29
29
|
as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
|
|
30
|
-
messages?: import("
|
|
30
|
+
messages?: import("../FormPropTypes").FormMessage[] | undefined;
|
|
31
31
|
messagesId?: string | undefined;
|
|
32
32
|
children?: import("react").ReactNode;
|
|
33
33
|
inline?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/FormFieldLayout/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAajC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAQrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEnD;;;;GAIG;AACH,cACM,eAAgB,SAAQ,SAAS,CAAC,oBAAoB,CAAC;IAC3D,MAAM,CAAC,QAAQ,CAAC,WAAW,qBAAoB;IAE/C,MAAM,CAAC,SAAS;;;;;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;;MAMT;gBAGE,KAAK,KAAA;IAejB,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAQ9B;IAED,iBAAiB;IAMjB,kBAAkB,CAAC,SAAS,KAAA,EAAE,SAAS,KAAA,EAAE,QAAQ,KAAA;IAKjD,IAAI,eAAe,wCAElB;IAED,IAAI,WAAW,wBAEd;IAED,IAAI,WAAW,wEAEd;IAED,IAAI,uBAAuB,wBAG1B;IAGD,uBAAuB,sBAItB;IAED,WAAW;IAsBX,YAAY;IAaZ,qBAAqB;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/FormFieldLayout/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAajC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAQrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEnD;;;;GAIG;AACH,cACM,eAAgB,SAAQ,SAAS,CAAC,oBAAoB,CAAC;IAC3D,MAAM,CAAC,QAAQ,CAAC,WAAW,qBAAoB;IAE/C,MAAM,CAAC,SAAS;;;;;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;;MAMT;gBAGE,KAAK,KAAA;IAejB,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAQ9B;IAED,iBAAiB;IAMjB,kBAAkB,CAAC,SAAS,KAAA,EAAE,SAAS,KAAA,EAAE,QAAQ,KAAA;IAKjD,IAAI,eAAe,wCAElB;IAED,IAAI,WAAW,wBAEd;IAED,IAAI,WAAW,wEAEd;IAED,IAAI,uBAAuB,wBAG1B;IAGD,uBAAuB,sBAItB;IAED,WAAW;IAsBX,YAAY;IAaZ,qBAAqB;IAiBrB,MAAM;CAyCP;AAED,eAAe,eAAe,CAAA;AAC9B,OAAO,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -20,11 +20,11 @@ example: true
|
|
|
20
20
|
declare class FormFieldMessage extends Component<FormFieldMessageProps> {
|
|
21
21
|
static readonly componentId = "FormFieldMessage";
|
|
22
22
|
static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
|
|
23
|
-
variant?: import("
|
|
23
|
+
variant?: import("../FormPropTypes").FormMessageType | undefined;
|
|
24
24
|
children?: import("react").ReactNode;
|
|
25
25
|
}>;
|
|
26
26
|
static allowedProps: readonly (keyof {
|
|
27
|
-
variant?: import("
|
|
27
|
+
variant?: import("../FormPropTypes").FormMessageType | undefined;
|
|
28
28
|
children?: import("react").ReactNode;
|
|
29
29
|
})[];
|
|
30
30
|
static defaultProps: {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { PropValidators, FormFieldMessageTheme } from '@instructure/shared-types';
|
|
3
2
|
import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
|
|
4
|
-
import type { FormMessageType } from '../FormPropTypes';
|
|
3
|
+
import type { FormMessageType, FormMessageChild } from '../FormPropTypes';
|
|
5
4
|
declare type FormFieldMessageOwnProps = {
|
|
6
5
|
variant?: FormMessageType;
|
|
7
|
-
children?:
|
|
6
|
+
children?: FormMessageChild;
|
|
8
7
|
};
|
|
9
8
|
declare type PropKeys = keyof FormFieldMessageOwnProps;
|
|
10
9
|
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/FormFieldMessage/props.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/FormFieldMessage/props.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACtB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAEzE,aAAK,wBAAwB,GAAG;IAC9B,OAAO,CAAC,EAAE,eAAe,CAAA;IACzB,QAAQ,CAAC,EAAE,gBAAgB,CAAA;CAC5B,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,wBAAwB,CAAA;AAE9C,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,qBAAqB,GAAG,wBAAwB,GACnD,cAAc,CAAC,qBAAqB,EAAE,qBAAqB,CAAC,CAAA;AAE9D,aAAK,qBAAqB,GAAG,cAAc,CAAC,kBAAkB,CAAC,CAAA;AAE/D,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAGvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAAyC,CAAA;AAE7D,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
package/types/FormPropTypes.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import PropTypes from 'prop-types';
|
|
3
|
+
declare const formMessageTypePropType: PropTypes.Requireable<string>;
|
|
4
|
+
declare const formMessageChildPropType: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
5
|
+
declare type FormMessageType = 'error' | 'hint' | 'success' | 'screenreader-only';
|
|
6
|
+
declare type FormMessageChild = React.ReactNode;
|
|
2
7
|
/**
|
|
3
8
|
* ---
|
|
4
9
|
* category: utilities/form
|
|
@@ -8,15 +13,15 @@ import PropTypes from 'prop-types';
|
|
|
8
13
|
*/
|
|
9
14
|
declare const FormPropTypes: {
|
|
10
15
|
message: PropTypes.Requireable<PropTypes.InferProps<{
|
|
11
|
-
text: PropTypes.Requireable<string>;
|
|
12
16
|
type: PropTypes.Requireable<string>;
|
|
17
|
+
text: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
13
18
|
}>>;
|
|
14
19
|
};
|
|
15
|
-
|
|
16
|
-
export declare type FormMessage = {
|
|
17
|
-
text: string;
|
|
20
|
+
declare type FormMessage = {
|
|
18
21
|
type: FormMessageType;
|
|
22
|
+
text: FormMessageChild;
|
|
19
23
|
};
|
|
20
24
|
export default FormPropTypes;
|
|
21
|
-
export { FormPropTypes };
|
|
25
|
+
export { FormPropTypes, formMessageTypePropType, formMessageChildPropType };
|
|
26
|
+
export type { FormMessage, FormMessageType, FormMessageChild };
|
|
22
27
|
//# sourceMappingURL=FormPropTypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormPropTypes.d.ts","sourceRoot":"","sources":["../src/FormPropTypes.ts"],"names":[],"mappings":"AAwBA,OAAO,SAAS,MAAM,YAAY,CAAA;AAElC
|
|
1
|
+
{"version":3,"file":"FormPropTypes.d.ts","sourceRoot":"","sources":["../src/FormPropTypes.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,SAAS,MAAM,YAAY,CAAA;AAElC,QAAA,MAAM,uBAAuB,+BAK3B,CAAA;AACF,QAAA,MAAM,wBAAwB,gDAAiB,CAAA;AAE/C,aAAK,eAAe,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,mBAAmB,CAAA;AACzE,aAAK,gBAAgB,GAAG,KAAK,CAAC,SAAS,CAAA;AAEvC;;;;;;GAMG;AACH,QAAA,MAAM,aAAa;;;;;CAKlB,CAAA;AAED,aAAK,WAAW,GAAG;IACjB,IAAI,EAAE,eAAe,CAAA;IACrB,IAAI,EAAE,gBAAgB,CAAA;CACvB,CAAA;AAED,eAAe,aAAa,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,CAAA;AAC3E,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,gBAAgB,EAAE,CAAA"}
|
package/LICENSE.md
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: The MIT License (MIT)
|
|
3
|
-
category: Getting Started
|
|
4
|
-
order: 9
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# The MIT License (MIT)
|
|
8
|
-
|
|
9
|
-
Copyright (c) 2015 Instructure, Inc.
|
|
10
|
-
|
|
11
|
-
**Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
-
in the Software without restriction, including without limitation the rights
|
|
14
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
-
furnished to do so, subject to the following conditions.**
|
|
17
|
-
|
|
18
|
-
The above copyright notice and this permission notice shall be included in all
|
|
19
|
-
copies or substantial portions of the Software.
|
|
20
|
-
|
|
21
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
-
SOFTWARE.
|