@instructure/ui-form-field 8.16.1-snapshot.2 → 8.17.1-snapshot.14

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 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.17.0](https://github.com/instructure/instructure-ui/compare/v8.16.0...v8.17.0) (2022-02-07)
7
+
8
+ ### Bug Fixes
9
+
10
+ - remove type:"commonjs" from package.json files ([0b243be](https://github.com/instructure/instructure-ui/commit/0b243bee389ee14493e6b3dbb30a8b660c295d3d))
11
+
6
12
  # [8.16.0](https://github.com/instructure/instructure-ui/compare/v8.15.0...v8.16.0) (2022-02-03)
7
13
 
8
14
  **Note:** Version bump only for package @instructure/ui-form-field
@@ -76,7 +76,7 @@ let FormFieldLabel = (_dec = withStyle(generateStyle, generateComponentTheme), _
76
76
  const _this$props3 = this.props,
77
77
  styles = _this$props3.styles,
78
78
  children = _this$props3.children;
79
- return jsx(ElementType // @ts-expect-error TODO: `ref` prop causes: "Expression produces a union type that is too complex to represent.ts(2590)"
79
+ return jsx(ElementType //@ts-expect-error too complex union type
80
80
  , Object.assign({}, omitProps(this.props, FormFieldLabel.allowedProps), {
81
81
  css: styles === null || styles === void 0 ? void 0 : styles.formFieldLabel,
82
82
  ref: this.handleRef
@@ -1,7 +1,7 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  const _excluded = ["makeStyles", "styles"];
3
3
 
4
- var _dec, _class, _class2, _temp;
4
+ var _dec, _dec2, _class, _class2, _temp;
5
5
 
6
6
  /*
7
7
  * The MIT License (MIT)
@@ -33,8 +33,7 @@ import { hasVisibleChildren } from '@instructure/ui-a11y-utils';
33
33
  import { ScreenReaderContent } from '@instructure/ui-a11y-content';
34
34
  import { Grid } from '@instructure/ui-grid';
35
35
  import { logError as error } from '@instructure/console';
36
- import { omitProps, pickProps, getElementType } from '@instructure/ui-react-utils';
37
- import { uid } from '@instructure/uid';
36
+ import { omitProps, pickProps, getElementType, withDeterministicId } from '@instructure/ui-react-utils';
38
37
  import { withStyle, jsx } from '@instructure/emotion';
39
38
  import { FormFieldLabel } from '../FormFieldLabel';
40
39
  import { FormFieldMessages } from '../FormFieldMessages';
@@ -47,7 +46,7 @@ parent: FormField
47
46
  ---
48
47
  @tsProps
49
48
  **/
50
- let FormFieldLayout = (_dec = withStyle(generateStyle, null), _dec(_class = (_temp = _class2 = class FormFieldLayout extends Component {
49
+ let FormFieldLayout = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, null), _dec(_class = _dec2(_class = (_temp = _class2 = class FormFieldLayout extends Component {
51
50
  constructor(props) {
52
51
  super(props);
53
52
  this._messagesId = void 0;
@@ -68,7 +67,7 @@ let FormFieldLayout = (_dec = withStyle(generateStyle, null), _dec(_class = (_te
68
67
  }
69
68
  };
70
69
 
71
- this._messagesId = props.messagesId || uid('FormFieldLayout-messages');
70
+ this._messagesId = props.messagesId || props.deterministicId();
72
71
  error(typeof props.width !== 'undefined' || !props.inline || props.layout !== 'inline', `[FormFieldLayout] The 'inline' prop is true, and the 'layout' is set to 'inline'.
73
72
  This will cause a layout issue in Internet Explorer 11 unless you also add a value for the 'width' prop.`);
74
73
  }
@@ -139,6 +138,7 @@ let FormFieldLayout = (_dec = withStyle(generateStyle, null), _dec(_class = (_te
139
138
  }
140
139
 
141
140
  render() {
141
+ // any cast is needed to prevent Expression produces a union type that is too complex to represent errors
142
142
  const ElementType = this.elementType;
143
143
 
144
144
  const _this$props3 = this.props,
@@ -171,6 +171,6 @@ let FormFieldLayout = (_dec = withStyle(generateStyle, null), _dec(_class = (_te
171
171
  layout: 'stacked',
172
172
  as: 'label',
173
173
  labelAlign: 'end'
174
- }, _temp)) || _class);
174
+ }, _temp)) || _class) || _class);
175
175
  export default FormFieldLayout;
176
176
  export { FormFieldLayout };
@@ -67,7 +67,7 @@ let FormFieldLabel = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.def
67
67
  const _this$props3 = this.props,
68
68
  styles = _this$props3.styles,
69
69
  children = _this$props3.children;
70
- return (0, _emotion.jsx)(ElementType // @ts-expect-error TODO: `ref` prop causes: "Expression produces a union type that is too complex to represent.ts(2590)"
70
+ return (0, _emotion.jsx)(ElementType //@ts-expect-error too complex union type
71
71
  , Object.assign({}, (0, _omitProps.omitProps)(this.props, FormFieldLabel.allowedProps), {
72
72
  css: styles === null || styles === void 0 ? void 0 : styles.formFieldLabel,
73
73
  ref: this.handleRef
@@ -25,7 +25,7 @@ var _pickProps = require("@instructure/ui-react-utils/lib/pickProps.js");
25
25
 
26
26
  var _getElementType = require("@instructure/ui-react-utils/lib/getElementType.js");
27
27
 
28
- var _uid = require("@instructure/uid");
28
+ var _withDeterministicId = require("@instructure/ui-react-utils/lib/DeterministicIdContext/withDeterministicId.js");
29
29
 
30
30
  var _emotion = require("@instructure/emotion");
31
31
 
@@ -39,7 +39,7 @@ var _props = require("./props");
39
39
 
40
40
  const _excluded = ["makeStyles", "styles"];
41
41
 
42
- var _dec, _class, _class2, _temp;
42
+ var _dec, _dec2, _class, _class2, _temp;
43
43
 
44
44
  /**
45
45
  ---
@@ -47,7 +47,7 @@ parent: FormField
47
47
  ---
48
48
  @tsProps
49
49
  **/
50
- let FormFieldLayout = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec(_class = (_temp = _class2 = class FormFieldLayout extends _react.Component {
50
+ let FormFieldLayout = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, null), _dec(_class = _dec2(_class = (_temp = _class2 = class FormFieldLayout extends _react.Component {
51
51
  constructor(props) {
52
52
  super(props);
53
53
  this._messagesId = void 0;
@@ -68,7 +68,7 @@ let FormFieldLayout = (_dec = (0, _emotion.withStyle)(_styles.default, null), _d
68
68
  }
69
69
  };
70
70
 
71
- this._messagesId = props.messagesId || (0, _uid.uid)('FormFieldLayout-messages');
71
+ this._messagesId = props.messagesId || props.deterministicId();
72
72
  (0, _console.logError)(typeof props.width !== 'undefined' || !props.inline || props.layout !== 'inline', `[FormFieldLayout] The 'inline' prop is true, and the 'layout' is set to 'inline'.
73
73
  This will cause a layout issue in Internet Explorer 11 unless you also add a value for the 'width' prop.`);
74
74
  }
@@ -139,6 +139,7 @@ let FormFieldLayout = (_dec = (0, _emotion.withStyle)(_styles.default, null), _d
139
139
  }
140
140
 
141
141
  render() {
142
+ // any cast is needed to prevent Expression produces a union type that is too complex to represent errors
142
143
  const ElementType = this.elementType;
143
144
  const _this$props3 = this.props,
144
145
  makeStyles = _this$props3.makeStyles,
@@ -169,7 +170,7 @@ let FormFieldLayout = (_dec = (0, _emotion.withStyle)(_styles.default, null), _d
169
170
  layout: 'stacked',
170
171
  as: 'label',
171
172
  labelAlign: 'end'
172
- }, _temp)) || _class);
173
+ }, _temp)) || _class) || _class);
173
174
  exports.FormFieldLayout = FormFieldLayout;
174
175
  var _default = FormFieldLayout;
175
176
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-form-field",
3
- "version": "8.16.1-snapshot.2+25359e770",
3
+ "version": "8.17.1-snapshot.14+f0b03679c",
4
4
  "description": "Form layout components.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -23,22 +23,22 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-babel-preset": "8.16.1-snapshot.2+25359e770",
27
- "@instructure/ui-test-utils": "8.16.1-snapshot.2+25359e770",
28
- "@instructure/ui-themes": "8.16.1-snapshot.2+25359e770"
26
+ "@instructure/ui-babel-preset": "8.17.1-snapshot.14+f0b03679c",
27
+ "@instructure/ui-test-utils": "8.17.1-snapshot.14+f0b03679c",
28
+ "@instructure/ui-themes": "8.17.1-snapshot.14+f0b03679c"
29
29
  },
30
30
  "dependencies": {
31
31
  "@babel/runtime": "^7.13.10",
32
- "@instructure/console": "8.16.1-snapshot.2+25359e770",
33
- "@instructure/emotion": "8.16.1-snapshot.2+25359e770",
34
- "@instructure/shared-types": "8.16.1-snapshot.2+25359e770",
35
- "@instructure/ui-a11y-content": "8.16.1-snapshot.2+25359e770",
36
- "@instructure/ui-a11y-utils": "8.16.1-snapshot.2+25359e770",
37
- "@instructure/ui-grid": "8.16.1-snapshot.2+25359e770",
38
- "@instructure/ui-icons": "8.16.1-snapshot.2+25359e770",
39
- "@instructure/ui-react-utils": "8.16.1-snapshot.2+25359e770",
40
- "@instructure/ui-utils": "8.16.1-snapshot.2+25359e770",
41
- "@instructure/uid": "8.16.1-snapshot.2+25359e770",
32
+ "@instructure/console": "8.17.1-snapshot.14+f0b03679c",
33
+ "@instructure/emotion": "8.17.1-snapshot.14+f0b03679c",
34
+ "@instructure/shared-types": "8.17.1-snapshot.14+f0b03679c",
35
+ "@instructure/ui-a11y-content": "8.17.1-snapshot.14+f0b03679c",
36
+ "@instructure/ui-a11y-utils": "8.17.1-snapshot.14+f0b03679c",
37
+ "@instructure/ui-grid": "8.17.1-snapshot.14+f0b03679c",
38
+ "@instructure/ui-icons": "8.17.1-snapshot.14+f0b03679c",
39
+ "@instructure/ui-react-utils": "8.17.1-snapshot.14+f0b03679c",
40
+ "@instructure/ui-utils": "8.17.1-snapshot.14+f0b03679c",
41
+ "@instructure/uid": "8.17.1-snapshot.14+f0b03679c",
42
42
  "prop-types": "^15"
43
43
  },
44
44
  "peerDependencies": {
@@ -47,5 +47,5 @@
47
47
  "publishConfig": {
48
48
  "access": "public"
49
49
  },
50
- "gitHead": "25359e77043270cf26e92b14f396b498f1540c62"
50
+ "gitHead": "f0b03679c4c4d05d4d650d22646ac1dc6791e935"
51
51
  }
@@ -82,7 +82,7 @@ class FormFieldLabel extends Component<FormFieldLabelProps> {
82
82
 
83
83
  return (
84
84
  <ElementType
85
- // @ts-expect-error TODO: `ref` prop causes: "Expression produces a union type that is too complex to represent.ts(2590)"
85
+ //@ts-expect-error too complex union type
86
86
  {...omitProps(this.props, FormFieldLabel.allowedProps)}
87
87
  css={styles?.formFieldLabel}
88
88
  ref={this.handleRef}
@@ -32,9 +32,9 @@ import { logError as error } from '@instructure/console'
32
32
  import {
33
33
  omitProps,
34
34
  pickProps,
35
- getElementType
35
+ getElementType,
36
+ withDeterministicId
36
37
  } from '@instructure/ui-react-utils'
37
- import { uid } from '@instructure/uid'
38
38
 
39
39
  import { withStyle, jsx } from '@instructure/emotion'
40
40
 
@@ -52,6 +52,7 @@ parent: FormField
52
52
  ---
53
53
  @tsProps
54
54
  **/
55
+ @withDeterministicId()
55
56
  @withStyle(generateStyle, null)
56
57
  class FormFieldLayout extends Component<FormFieldLayoutProps> {
57
58
  static readonly componentId = 'FormFieldLayout'
@@ -68,7 +69,7 @@ class FormFieldLayout extends Component<FormFieldLayoutProps> {
68
69
  constructor(props: FormFieldLayoutProps) {
69
70
  super(props)
70
71
 
71
- this._messagesId = props.messagesId || uid('FormFieldLayout-messages')
72
+ this._messagesId = props.messagesId || props.deterministicId!()
72
73
 
73
74
  error(
74
75
  typeof props.width !== 'undefined' ||
@@ -176,7 +177,8 @@ class FormFieldLayout extends Component<FormFieldLayoutProps> {
176
177
  }
177
178
 
178
179
  render() {
179
- const ElementType = this.elementType
180
+ // any cast is needed to prevent Expression produces a union type that is too complex to represent errors
181
+ const ElementType = this.elementType as any
180
182
 
181
183
  const { makeStyles, styles, ...props } = this.props
182
184
 
@@ -33,6 +33,7 @@ import type {
33
33
  } from '@instructure/shared-types'
34
34
  import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
35
35
  import type { FormMessage } from '../FormPropTypes'
36
+ import type { WithDeterministicIdProps } from '@instructure/ui-react-utils'
36
37
 
37
38
  type FormFieldLayoutOwnProps = {
38
39
  label: React.ReactNode
@@ -74,7 +75,7 @@ type AllowedPropKeys = Readonly<Array<PropKeys>>
74
75
 
75
76
  type FormFieldLayoutProps = FormFieldLayoutOwnProps &
76
77
  WithStyleProps<null, FormFieldLayoutStyle> &
77
- OtherHTMLAttributes<FormFieldLayoutOwnProps>
78
+ OtherHTMLAttributes<FormFieldLayoutOwnProps> & WithDeterministicIdProps
78
79
 
79
80
  type FormFieldLayoutStyle = ComponentStyle<'formFieldLayout'>
80
81