@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.
Files changed (47) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/es/FormField/index.js +2 -2
  3. package/es/FormField/props.js +1 -1
  4. package/es/FormFieldGroup/index.js +3 -3
  5. package/es/FormFieldGroup/props.js +1 -1
  6. package/es/FormFieldLabel/index.js +2 -2
  7. package/es/FormFieldLayout/index.js +3 -3
  8. package/es/FormFieldLayout/props.js +1 -1
  9. package/es/FormFieldMessage/index.js +2 -2
  10. package/es/FormFieldMessage/props.js +3 -3
  11. package/es/FormFieldMessages/index.js +2 -2
  12. package/es/FormFieldMessages/props.js +1 -1
  13. package/es/FormPropTypes.js +6 -4
  14. package/lib/FormField/index.js +3 -3
  15. package/lib/FormField/props.js +2 -2
  16. package/lib/FormFieldGroup/index.js +4 -4
  17. package/lib/FormFieldGroup/props.js +2 -2
  18. package/lib/FormFieldLabel/index.js +3 -3
  19. package/lib/FormFieldLabel/props.js +1 -1
  20. package/lib/FormFieldLayout/index.js +4 -4
  21. package/lib/FormFieldLayout/props.js +2 -2
  22. package/lib/FormFieldMessage/index.js +3 -3
  23. package/lib/FormFieldMessage/props.js +4 -6
  24. package/lib/FormFieldMessages/index.js +3 -3
  25. package/lib/FormFieldMessages/props.js +2 -2
  26. package/lib/FormPropTypes.js +8 -3
  27. package/lib/index.js +10 -10
  28. package/package.json +15 -16
  29. package/src/FormField/props.ts +1 -1
  30. package/src/FormFieldGroup/index.tsx +6 -3
  31. package/src/FormFieldGroup/props.ts +1 -1
  32. package/src/FormFieldLayout/index.tsx +3 -4
  33. package/src/FormFieldLayout/props.ts +1 -1
  34. package/src/FormFieldMessage/props.ts +8 -5
  35. package/src/FormFieldMessages/props.ts +1 -1
  36. package/src/FormPropTypes.ts +18 -7
  37. package/types/FormField/index.d.ts +2 -2
  38. package/types/FormFieldGroup/index.d.ts +2 -2
  39. package/types/FormFieldGroup/index.d.ts.map +1 -1
  40. package/types/FormFieldLayout/index.d.ts +2 -2
  41. package/types/FormFieldLayout/index.d.ts.map +1 -1
  42. package/types/FormFieldMessage/index.d.ts +2 -2
  43. package/types/FormFieldMessage/props.d.ts +2 -3
  44. package/types/FormFieldMessage/props.d.ts.map +1 -1
  45. package/types/FormPropTypes.d.ts +10 -5
  46. package/types/FormPropTypes.d.ts.map +1 -1
  47. 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
@@ -32,8 +32,8 @@ category: components
32
32
  ---
33
33
  **/
34
34
  class FormField extends Component {
35
- constructor(...args) {
36
- super(...args);
35
+ constructor() {
36
+ super(...arguments);
37
37
  this.ref = null;
38
38
 
39
39
  this.handleRef = el => {
@@ -33,7 +33,7 @@ const propTypes = {
33
33
 
34
34
  /**
35
35
  * object with shape: `{
36
- * text: PropTypes.string,
36
+ * text: PropTypes.node,
37
37
  * type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
38
38
  * }`
39
39
  */
@@ -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(...args) {
47
- super(...args);
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' : null,
83
+ width: child.props && child.props.width ? 'auto' : void 0,
84
84
  key: index
85
85
  }, child) : null;
86
86
  });
@@ -33,7 +33,7 @@ const propTypes = {
33
33
 
34
34
  /**
35
35
  * object with shape: `{
36
- * text: PropTypes.string,
36
+ * text: PropTypes.node,
37
37
  * type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
38
38
  * }`
39
39
  */
@@ -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(...args) {
53
- super(...args);
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 ? null : 3,
128
- textAlign: this.inlineContainerAndLabel ? 'end' : null
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' : null,
158
+ width: this.inlineContainerAndLabel ? 'auto' : void 0,
159
159
  elementRef: this.handleInputContainerRef
160
160
  }, children)), this.renderVisibleMessages()));
161
161
  }
@@ -38,7 +38,7 @@ const propTypes = {
38
38
 
39
39
  /**
40
40
  * object with shape: `{
41
- * text: PropTypes.string,
41
+ * text: PropTypes.node,
42
42
  * type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
43
43
  * }`
44
44
  */
@@ -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(...args) {
52
- super(...args);
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 PropTypes from 'prop-types';
24
+ import { formMessageTypePropType, formMessageChildPropType } from '../FormPropTypes';
25
25
  const propTypes = {
26
- variant: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only']),
27
- children: PropTypes.node
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(...args) {
56
- super(...args);
55
+ constructor() {
56
+ super(...arguments);
57
57
  this.ref = null;
58
58
 
59
59
  this.handleRef = el => {
@@ -26,7 +26,7 @@ import { FormPropTypes } from '../FormPropTypes';
26
26
  const propTypes = {
27
27
  /**
28
28
  * object with shape: `{
29
- * text: PropTypes.string,
29
+ * text: PropTypes.node,
30
30
  * type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
31
31
  * }`
32
32
  */
@@ -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
- text: PropTypes.string,
36
- type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
37
+ type: formMessageTypePropType,
38
+ text: formMessageChildPropType
37
39
  })
38
40
  };
39
41
  export default FormPropTypes;
40
- export { FormPropTypes };
42
+ export { FormPropTypes, formMessageTypePropType, formMessageChildPropType };
@@ -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.FormField = exports.default = void 0;
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(...args) {
51
- super(...args);
50
+ constructor() {
51
+ super(...arguments);
52
52
  this.ref = null;
53
53
 
54
54
  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.allowedProps = exports.propTypes = void 0;
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.string,
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.FormFieldGroup = exports.default = void 0;
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(...args) {
41
- super(...args);
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' : null,
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.allowedProps = exports.propTypes = void 0;
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.string,
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.FormFieldLabel = exports.default = void 0;
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(...args) {
44
- super(...args);
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.allowedProps = exports.propTypes = void 0;
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.FormFieldLayout = exports.default = void 0;
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 ? null : 3,
128
- textAlign: this.inlineContainerAndLabel ? 'end' : null
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' : null,
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.allowedProps = exports.propTypes = void 0;
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.string,
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.FormFieldMessage = exports.default = void 0;
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(...args) {
41
- super(...args);
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.allowedProps = exports.propTypes = void 0;
6
+ exports.propTypes = exports.allowedProps = void 0;
9
7
 
10
- var _propTypes = _interopRequireDefault(require("prop-types"));
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: _propTypes.default.oneOf(['error', 'hint', 'success', 'screenreader-only']),
37
- children: _propTypes.default.node
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.FormFieldMessages = exports.default = void 0;
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(...args) {
46
- super(...args);
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.allowedProps = exports.propTypes = void 0;
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.string,
40
+ * text: PropTypes.node,
41
41
  * type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
42
42
  * }`
43
43
  */
@@ -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.FormPropTypes = exports.default = void 0;
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
- text: _propTypes.default.string,
46
- type: _propTypes.default.oneOf(['error', 'hint', 'success', 'screenreader-only'])
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, "FormFieldLabel", {
12
+ Object.defineProperty(exports, "FormFieldGroup", {
13
13
  enumerable: true,
14
14
  get: function () {
15
- return _FormFieldLabel.FormFieldLabel;
15
+ return _FormFieldGroup.FormFieldGroup;
16
16
  }
17
17
  });
18
- Object.defineProperty(exports, "FormFieldMessage", {
18
+ Object.defineProperty(exports, "FormFieldLabel", {
19
19
  enumerable: true,
20
20
  get: function () {
21
- return _FormFieldMessage.FormFieldMessage;
21
+ return _FormFieldLabel.FormFieldLabel;
22
22
  }
23
23
  });
24
- Object.defineProperty(exports, "FormFieldMessages", {
24
+ Object.defineProperty(exports, "FormFieldLayout", {
25
25
  enumerable: true,
26
26
  get: function () {
27
- return _FormFieldMessages.FormFieldMessages;
27
+ return _FormFieldLayout.FormFieldLayout;
28
28
  }
29
29
  });
30
- Object.defineProperty(exports, "FormFieldLayout", {
30
+ Object.defineProperty(exports, "FormFieldMessage", {
31
31
  enumerable: true,
32
32
  get: function () {
33
- return _FormFieldLayout.FormFieldLayout;
33
+ return _FormFieldMessage.FormFieldMessage;
34
34
  }
35
35
  });
36
- Object.defineProperty(exports, "FormFieldGroup", {
36
+ Object.defineProperty(exports, "FormFieldMessages", {
37
37
  enumerable: true,
38
38
  get: function () {
39
- return _FormFieldGroup.FormFieldGroup;
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.12.1-snapshot.7+1e7ac8219",
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.12.1-snapshot.7+1e7ac8219",
28
- "@instructure/ui-test-utils": "8.12.1-snapshot.7+1e7ac8219",
29
- "@instructure/ui-themes": "8.12.1-snapshot.7+1e7ac8219"
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.12.1-snapshot.7+1e7ac8219",
34
- "@instructure/emotion": "8.12.1-snapshot.7+1e7ac8219",
35
- "@instructure/shared-types": "8.12.1-snapshot.7+1e7ac8219",
36
- "@instructure/ui-a11y-content": "8.12.1-snapshot.7+1e7ac8219",
37
- "@instructure/ui-a11y-utils": "8.12.1-snapshot.7+1e7ac8219",
38
- "@instructure/ui-grid": "8.12.1-snapshot.7+1e7ac8219",
39
- "@instructure/ui-icons": "8.12.1-snapshot.7+1e7ac8219",
40
- "@instructure/ui-react-utils": "8.12.1-snapshot.7+1e7ac8219",
41
- "@instructure/ui-utils": "8.12.1-snapshot.7+1e7ac8219",
42
- "@instructure/uid": "8.12.1-snapshot.7+1e7ac8219",
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
  }
@@ -62,7 +62,7 @@ const propTypes: PropValidators<PropKeys> = {
62
62
  id: PropTypes.string.isRequired,
63
63
  /**
64
64
  * object with shape: `{
65
- * text: PropTypes.string,
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
- // @ts-expect-error ts-migrate(2339) FIXME: Property 'props' does not exist on type 'string | ... Remove this comment to see the full error message
101
- width={child.props && child.props.width ? 'auto' : null}
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}
@@ -72,7 +72,7 @@ const propTypes: PropValidators<PropKeys> = {
72
72
  as: PropTypes.elementType,
73
73
  /**
74
74
  * object with shape: `{
75
- * text: PropTypes.string,
75
+ * text: PropTypes.node,
76
76
  * type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
77
77
  * }`
78
78
  */
@@ -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 ? null : 3}
171
- // @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call.
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' : null}
213
+ width={this.inlineContainerAndLabel ? 'auto' : undefined}
215
214
  elementRef={this.handleInputContainerRef}
216
215
  >
217
216
  {children}
@@ -71,7 +71,7 @@ const propTypes: PropValidators<PropKeys> = {
71
71
  as: PropTypes.elementType,
72
72
  /**
73
73
  * object with shape: `{
74
- * text: PropTypes.string,
74
+ * text: PropTypes.node,
75
75
  * type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
76
76
  * }`
77
77
  */
@@ -22,18 +22,21 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import PropTypes from 'prop-types'
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?: React.ReactNode
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: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only']),
50
- children: PropTypes.node
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.string,
54
+ * text: PropTypes.node,
55
55
  * type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
56
56
  * }`
57
57
  */
@@ -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
- text: PropTypes.string,
37
- type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
48
+ type: formMessageTypePropType,
49
+ text: formMessageChildPropType
38
50
  })
39
51
  }
40
52
 
41
- export type FormMessageType = 'error' | 'hint' | 'success' | 'screenreader-only'
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("..").FormMessage[] | undefined;
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("..").FormMessage[] | undefined;
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("..").FormMessage[] | undefined;
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("..").FormMessage[] | undefined;
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,EAAY,MAAM,OAAO,CAAA;AAI3C,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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,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("..").FormMessage[] | undefined;
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("..").FormMessage[] | undefined;
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;IAMj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E,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("..").FormMessageType | undefined;
23
+ variant?: import("../FormPropTypes").FormMessageType | undefined;
24
24
  children?: import("react").ReactNode;
25
25
  }>;
26
26
  static allowedProps: readonly (keyof {
27
- variant?: import("..").FormMessageType | undefined;
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?: React.ReactNode;
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":";AA0BA,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,MAAM,kBAAkB,CAAA;AAEvD,aAAK,wBAAwB,GAAG;IAC9B,OAAO,CAAC,EAAE,eAAe,CAAA;IACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,wBAAwB,CAAA;AAE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,qBAAqB,EAAE,qBAAqB,EAAE,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
@@ -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
- export declare type FormMessageType = 'error' | 'hint' | 'success' | 'screenreader-only';
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;;;;;;GAMG;AACH,QAAA,MAAM,aAAa;;;;;CAKlB,CAAA;AAED,oBAAY,eAAe,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,mBAAmB,CAAA;AAEhF,oBAAY,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,eAAe,CAAA;CACtB,CAAA;AAED,eAAe,aAAa,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,CAAA"}
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.