@instructure/ui-form-field 8.8.1-snapshot.8 → 8.9.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 (97) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/es/FormField/index.js +4 -31
  3. package/es/FormField/props.js +51 -0
  4. package/es/FormFieldGroup/index.js +3 -39
  5. package/es/FormFieldGroup/props.js +55 -0
  6. package/es/FormFieldLabel/index.js +3 -10
  7. package/{src/FormFieldMessage/types.ts → es/FormFieldLabel/props.js} +7 -8
  8. package/es/FormFieldLayout/index.js +4 -45
  9. package/es/FormFieldLayout/props.js +59 -0
  10. package/es/FormFieldMessage/index.js +3 -10
  11. package/{src/FormFieldLabel/types.ts → es/FormFieldMessage/props.js} +7 -10
  12. package/es/FormFieldMessages/index.js +4 -20
  13. package/{src/FormField/types.ts → es/FormFieldMessages/props.js} +13 -16
  14. package/lib/FormField/index.js +5 -35
  15. package/lib/FormField/props.js +63 -0
  16. package/lib/FormFieldGroup/index.js +4 -41
  17. package/lib/FormFieldGroup/props.js +67 -0
  18. package/lib/FormFieldLabel/index.js +4 -11
  19. package/{src/FormFieldMessages/types.ts → lib/FormFieldLabel/props.js} +18 -8
  20. package/lib/FormFieldLayout/index.js +5 -47
  21. package/lib/FormFieldLayout/props.js +71 -0
  22. package/lib/FormFieldMessage/index.js +4 -11
  23. package/{src/FormFieldLayout/types.ts → lib/FormFieldMessage/props.js} +18 -20
  24. package/lib/FormFieldMessages/index.js +5 -22
  25. package/lib/FormFieldMessages/props.js +48 -0
  26. package/package.json +15 -16
  27. package/src/FormField/index.tsx +6 -31
  28. package/src/FormField/props.ts +91 -0
  29. package/src/FormFieldGroup/index.tsx +6 -38
  30. package/src/FormFieldGroup/props.ts +98 -0
  31. package/src/FormFieldGroup/styles.ts +1 -1
  32. package/src/FormFieldLabel/index.tsx +6 -12
  33. package/src/{FormFieldGroup/types.ts → FormFieldLabel/props.ts} +20 -16
  34. package/src/FormFieldLabel/styles.ts +1 -1
  35. package/src/FormFieldLayout/index.tsx +7 -43
  36. package/src/FormFieldLayout/props.ts +97 -0
  37. package/src/FormFieldLayout/styles.ts +1 -1
  38. package/src/FormFieldMessage/index.tsx +6 -12
  39. package/src/FormFieldMessage/props.ts +50 -0
  40. package/src/FormFieldMessage/styles.ts +1 -1
  41. package/src/FormFieldMessages/index.tsx +8 -22
  42. package/src/FormFieldMessages/props.ts +56 -0
  43. package/src/index.ts +6 -6
  44. package/types/FormField/index.d.ts +28 -32
  45. package/types/FormField/index.d.ts.map +1 -1
  46. package/types/FormField/props.d.ts +24 -0
  47. package/types/FormField/props.d.ts.map +1 -0
  48. package/types/FormFieldGroup/index.d.ts +27 -36
  49. package/types/FormFieldGroup/index.d.ts.map +1 -1
  50. package/types/FormFieldGroup/props.d.ts +28 -0
  51. package/types/FormFieldGroup/props.d.ts.map +1 -0
  52. package/types/FormFieldGroup/styles.d.ts +1 -1
  53. package/types/FormFieldLabel/index.d.ts +9 -8
  54. package/types/FormFieldLabel/index.d.ts.map +1 -1
  55. package/types/FormFieldLabel/props.d.ts +15 -0
  56. package/types/FormFieldLabel/props.d.ts.map +1 -0
  57. package/types/FormFieldLabel/styles.d.ts +1 -1
  58. package/types/FormFieldLayout/index.d.ts +27 -40
  59. package/types/FormFieldLayout/index.d.ts.map +1 -1
  60. package/types/FormFieldLayout/props.d.ts +25 -0
  61. package/types/FormFieldLayout/props.d.ts.map +1 -0
  62. package/types/FormFieldLayout/styles.d.ts +1 -1
  63. package/types/FormFieldMessage/index.d.ts +9 -8
  64. package/types/FormFieldMessage/index.d.ts.map +1 -1
  65. package/types/FormFieldMessage/props.d.ts +16 -0
  66. package/types/FormFieldMessage/props.d.ts.map +1 -0
  67. package/types/FormFieldMessage/styles.d.ts +1 -1
  68. package/types/FormFieldMessages/index.d.ts +4 -19
  69. package/types/FormFieldMessages/index.d.ts.map +1 -1
  70. package/types/FormFieldMessages/props.d.ts +14 -0
  71. package/types/FormFieldMessages/props.d.ts.map +1 -0
  72. package/types/index.d.ts +6 -6
  73. package/LICENSE.md +0 -27
  74. package/es/FormField/types.js +0 -1
  75. package/es/FormFieldGroup/types.js +0 -1
  76. package/es/FormFieldLabel/types.js +0 -1
  77. package/es/FormFieldLayout/types.js +0 -1
  78. package/es/FormFieldMessage/types.js +0 -1
  79. package/es/FormFieldMessages/types.js +0 -1
  80. package/lib/FormField/types.js +0 -1
  81. package/lib/FormFieldGroup/types.js +0 -1
  82. package/lib/FormFieldLabel/types.js +0 -1
  83. package/lib/FormFieldLayout/types.js +0 -1
  84. package/lib/FormFieldMessage/types.js +0 -1
  85. package/lib/FormFieldMessages/types.js +0 -1
  86. package/types/FormField/types.d.ts +0 -15
  87. package/types/FormField/types.d.ts.map +0 -1
  88. package/types/FormFieldGroup/types.d.ts +0 -21
  89. package/types/FormFieldGroup/types.d.ts.map +0 -1
  90. package/types/FormFieldLabel/types.d.ts +0 -9
  91. package/types/FormFieldLabel/types.d.ts.map +0 -1
  92. package/types/FormFieldLayout/types.d.ts +0 -19
  93. package/types/FormFieldLayout/types.d.ts.map +0 -1
  94. package/types/FormFieldMessage/types.d.ts +0 -7
  95. package/types/FormFieldMessage/types.d.ts.map +0 -1
  96. package/types/FormFieldMessages/types.d.ts +0 -7
  97. package/types/FormFieldMessages/types.d.ts.map +0 -1
@@ -0,0 +1,97 @@
1
+ /*
2
+ * The MIT License (MIT)
3
+ *
4
+ * Copyright (c) 2015 - present Instructure, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ import PropTypes from 'prop-types'
26
+
27
+ import { FormPropTypes } from '../FormPropTypes'
28
+
29
+ import type { AsElementType, PropValidators } from '@instructure/shared-types'
30
+ import type { WithStyleProps } from '@instructure/emotion'
31
+ import type { FormMessage } from '../FormPropTypes'
32
+
33
+ type FormFieldLayoutOwnProps = {
34
+ label: React.ReactNode
35
+ id?: string
36
+ as?: AsElementType
37
+ messages?: FormMessage[]
38
+ messagesId?: string
39
+ children?: React.ReactNode
40
+ inline?: boolean
41
+ layout?: 'stacked' | 'inline'
42
+ labelAlign?: 'start' | 'end'
43
+ width?: string
44
+ inputContainerRef?: (...args: any[]) => any
45
+ }
46
+
47
+ type PropKeys = keyof FormFieldLayoutOwnProps
48
+
49
+ type AllowedPropKeys = Readonly<Array<PropKeys>>
50
+
51
+ type FormFieldLayoutProps = FormFieldLayoutOwnProps & WithStyleProps
52
+
53
+ const propTypes: PropValidators<PropKeys> = {
54
+ label: PropTypes.node.isRequired,
55
+ /**
56
+ * the id of the input (to link it to its label for a11y)
57
+ */
58
+ id: PropTypes.string,
59
+ /**
60
+ * the element type to render as
61
+ */
62
+ as: PropTypes.elementType,
63
+ /**
64
+ * object with shape: `{
65
+ * text: PropTypes.string,
66
+ * type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
67
+ * }`
68
+ */
69
+ messages: PropTypes.arrayOf(FormPropTypes.message),
70
+ /**
71
+ * id for the form field messages
72
+ */
73
+ messagesId: PropTypes.string,
74
+ children: PropTypes.node,
75
+ inline: PropTypes.bool,
76
+ layout: PropTypes.oneOf(['stacked', 'inline']),
77
+ labelAlign: PropTypes.oneOf(['start', 'end']),
78
+ width: PropTypes.string,
79
+ inputContainerRef: PropTypes.func
80
+ }
81
+
82
+ const allowedProps: AllowedPropKeys = [
83
+ 'label',
84
+ 'id',
85
+ 'as',
86
+ 'messages',
87
+ 'messagesId',
88
+ 'children',
89
+ 'inline',
90
+ 'layout',
91
+ 'labelAlign',
92
+ 'width',
93
+ 'inputContainerRef'
94
+ ]
95
+
96
+ export type { FormFieldLayoutProps }
97
+ export { propTypes, allowedProps }
@@ -22,7 +22,7 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import { FormFieldLayoutProps } from './types'
25
+ import { FormFieldLayoutProps } from './props'
26
26
 
27
27
  /**
28
28
  * ---
@@ -24,7 +24,6 @@
24
24
 
25
25
  /** @jsx jsx */
26
26
  import { Component } from 'react'
27
- import PropTypes from 'prop-types'
28
27
 
29
28
  import { ScreenReaderContent } from '@instructure/ui-a11y-content'
30
29
 
@@ -32,7 +31,9 @@ import { withStyle, jsx } from '@instructure/emotion'
32
31
 
33
32
  import generateStyle from './styles'
34
33
  import generateComponentTheme from './theme'
35
- import { FormFieldMessageProps } from './types'
34
+
35
+ import { propTypes, allowedProps } from './props'
36
+ import type { FormFieldMessageProps } from './props'
36
37
 
37
38
  /**
38
39
  ---
@@ -53,15 +54,8 @@ example: true
53
54
  class FormFieldMessage extends Component<FormFieldMessageProps> {
54
55
  static readonly componentId = 'FormFieldMessage'
55
56
 
56
- static propTypes = {
57
- // eslint-disable-next-line react/require-default-props
58
- makeStyles: PropTypes.func,
59
- // eslint-disable-next-line react/require-default-props
60
- styles: PropTypes.object,
61
- variant: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only']),
62
- children: PropTypes.node
63
- }
64
-
57
+ static propTypes = propTypes
58
+ static allowedProps = allowedProps
65
59
  static defaultProps = {
66
60
  variant: 'hint',
67
61
  children: null
@@ -82,7 +76,7 @@ class FormFieldMessage extends Component<FormFieldMessageProps> {
82
76
  const { children, styles } = this.props
83
77
 
84
78
  return this.props.variant !== 'screenreader-only' ? (
85
- <span css={styles.formFieldMessage}>{children}</span>
79
+ <span css={styles?.formFieldMessage}>{children}</span>
86
80
  ) : (
87
81
  <ScreenReaderContent>{children}</ScreenReaderContent>
88
82
  )
@@ -0,0 +1,50 @@
1
+ /*
2
+ * The MIT License (MIT)
3
+ *
4
+ * Copyright (c) 2015 - present Instructure, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ import PropTypes from 'prop-types'
26
+
27
+ import type { PropValidators } from '@instructure/shared-types'
28
+ import type { WithStyleProps } from '@instructure/emotion'
29
+ import type { FormMessageType } from '../FormPropTypes'
30
+
31
+ type FormFieldMessageOwnProps = {
32
+ variant?: FormMessageType
33
+ children?: React.ReactNode
34
+ }
35
+
36
+ type PropKeys = keyof FormFieldMessageOwnProps
37
+
38
+ type AllowedPropKeys = Readonly<Array<PropKeys>>
39
+
40
+ type FormFieldMessageProps = FormFieldMessageOwnProps & WithStyleProps
41
+
42
+ const propTypes: PropValidators<PropKeys> = {
43
+ variant: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only']),
44
+ children: PropTypes.node
45
+ }
46
+
47
+ const allowedProps: AllowedPropKeys = ['variant', 'children']
48
+
49
+ export type { FormFieldMessageProps }
50
+ export { propTypes, allowedProps }
@@ -23,7 +23,7 @@
23
23
  */
24
24
 
25
25
  import { FormFieldMessageTheme } from '@instructure/shared-types'
26
- import { FormFieldMessageProps } from './types'
26
+ import { FormFieldMessageProps } from './props'
27
27
  import { FormMessageType } from '../FormPropTypes'
28
28
 
29
29
  /**
@@ -24,18 +24,18 @@
24
24
 
25
25
  /** @jsx jsx */
26
26
  import { Component } from 'react'
27
- import PropTypes from 'prop-types'
28
27
 
29
28
  import { omitProps } from '@instructure/ui-react-utils'
30
29
 
31
30
  import { withStyle, jsx } from '@instructure/emotion'
32
31
 
33
- import { FormPropTypes } from '../FormPropTypes'
34
32
  import { FormFieldMessage } from '../FormFieldMessage'
35
33
 
36
34
  import generateStyle from './styles'
37
35
  import generateComponentTheme from './theme'
38
- import { FormFieldMessagesProps } from './types'
36
+
37
+ import { propTypes, allowedProps } from './props'
38
+ import type { FormFieldMessagesProps } from './props'
39
39
 
40
40
  /**
41
41
  ---
@@ -59,23 +59,9 @@ example: true
59
59
  class FormFieldMessages extends Component<FormFieldMessagesProps> {
60
60
  static readonly componentId = 'FormFieldMessages'
61
61
 
62
- static propTypes = {
63
- // eslint-disable-next-line react/require-default-props
64
- makeStyles: PropTypes.func,
65
- // eslint-disable-next-line react/require-default-props
66
- styles: PropTypes.object,
67
- /**
68
- * object with shape: `{
69
- * text: PropTypes.string,
70
- * type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
71
- * }`
72
- */
73
- messages: PropTypes.arrayOf(FormPropTypes.message)
74
- }
75
-
76
- static defaultProps = {
77
- messages: undefined
78
- }
62
+ static propTypes = propTypes
63
+ static allowedProps = allowedProps
64
+ static defaultProps = {}
79
65
 
80
66
  componentDidMount() {
81
67
  // @ts-expect-error ts-migrate(2722) FIXME: Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message
@@ -93,12 +79,12 @@ class FormFieldMessages extends Component<FormFieldMessagesProps> {
93
79
 
94
80
  return messages && messages.length > 0 ? (
95
81
  <span
96
- css={styles.formFieldMessages}
82
+ css={styles?.formFieldMessages}
97
83
  {...omitProps(this.props, FormFieldMessages.propTypes)}
98
84
  >
99
85
  {messages.map((msg, i) => {
100
86
  return (
101
- <span key={`error${i}`} css={styles.message}>
87
+ <span key={`error${i}`} css={styles?.message}>
102
88
  <FormFieldMessage variant={msg.type}>{msg.text}</FormFieldMessage>
103
89
  </span>
104
90
  )
@@ -0,0 +1,56 @@
1
+ /*
2
+ * The MIT License (MIT)
3
+ *
4
+ * Copyright (c) 2015 - present Instructure, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ import PropTypes from 'prop-types'
26
+
27
+ import { FormPropTypes } from '../FormPropTypes'
28
+
29
+ import type { PropValidators } from '@instructure/shared-types'
30
+ import type { WithStyleProps } from '@instructure/emotion'
31
+ import type { FormMessage } from '../FormPropTypes'
32
+
33
+ type FormFieldMessagesOwnProps = {
34
+ messages?: FormMessage[]
35
+ }
36
+
37
+ type PropKeys = keyof FormFieldMessagesOwnProps
38
+
39
+ type AllowedPropKeys = Readonly<Array<PropKeys>>
40
+
41
+ type FormFieldMessagesProps = FormFieldMessagesOwnProps & WithStyleProps
42
+
43
+ const propTypes: PropValidators<PropKeys> = {
44
+ /**
45
+ * object with shape: `{
46
+ * text: PropTypes.string,
47
+ * type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
48
+ * }`
49
+ */
50
+ messages: PropTypes.arrayOf(FormPropTypes.message)
51
+ }
52
+
53
+ const allowedProps: AllowedPropKeys = ['messages']
54
+
55
+ export type { FormFieldMessagesProps }
56
+ export { propTypes, allowedProps }
package/src/index.ts CHANGED
@@ -32,9 +32,9 @@ export { FormFieldGroup } from './FormFieldGroup'
32
32
  export { FormPropTypes } from './FormPropTypes'
33
33
  export type { FormMessageType, FormMessage } from './FormPropTypes'
34
34
 
35
- export type { FormFieldProps } from './FormField/types'
36
- export type { FormFieldLabelProps } from './FormFieldLabel/types'
37
- export type { FormFieldMessageProps } from './FormFieldMessage/types'
38
- export type { FormFieldMessagesProps } from './FormFieldMessages/types'
39
- export type { FormFieldLayoutProps } from './FormFieldLayout/types'
40
- export type { FormFieldGroupProps } from './FormFieldGroup/types'
35
+ export type { FormFieldProps } from './FormField/props'
36
+ export type { FormFieldLabelProps } from './FormFieldLabel/props'
37
+ export type { FormFieldMessageProps } from './FormFieldMessage/props'
38
+ export type { FormFieldMessagesProps } from './FormFieldMessages/props'
39
+ export type { FormFieldLayoutProps } from './FormFieldLayout/props'
40
+ export type { FormFieldGroupProps } from './FormFieldGroup/props'
@@ -1,6 +1,5 @@
1
- import { Component } from 'react';
2
- import PropTypes from 'prop-types';
3
- import { FormFieldProps } from './types';
1
+ import React, { Component } from 'react';
2
+ import type { FormFieldProps } from './props';
4
3
  /**
5
4
  ---
6
5
  category: components
@@ -8,41 +7,38 @@ category: components
8
7
  **/
9
8
  declare class FormField extends Component<FormFieldProps> {
10
9
  static readonly componentId = "FormField";
11
- static propTypes: {
12
- label: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
13
- /**
14
- * the id of the input (to link it to its label for a11y)
15
- */
16
- id: PropTypes.Validator<string>;
17
- /**
18
- * object with shape: `{
19
- * text: PropTypes.string,
20
- * type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
21
- * }`
22
- */
23
- messages: PropTypes.Requireable<(PropTypes.InferProps<{
24
- text: PropTypes.Requireable<string>;
25
- type: PropTypes.Requireable<string>;
26
- }> | null | undefined)[]>;
27
- messagesId: PropTypes.Requireable<string>;
28
- children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
29
- inline: PropTypes.Requireable<boolean>;
30
- layout: PropTypes.Requireable<string>;
31
- labelAlign: PropTypes.Requireable<string>;
32
- vAlign: PropTypes.Requireable<string>;
33
- width: PropTypes.Requireable<string>;
34
- inputContainerRef: PropTypes.Requireable<(...args: any[]) => any>;
35
- };
10
+ static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
11
+ label: React.ReactNode;
12
+ id: string;
13
+ messages?: import("..").FormMessage[] | undefined;
14
+ messagesId?: string | undefined;
15
+ children?: React.ReactNode;
16
+ inline?: boolean | undefined;
17
+ layout?: "inline" | "stacked" | undefined;
18
+ labelAlign?: "end" | "start" | undefined;
19
+ vAlign?: "middle" | "bottom" | "top" | undefined;
20
+ width?: string | undefined;
21
+ inputContainerRef?: ((...args: any[]) => any) | undefined;
22
+ }>;
23
+ static allowedProps: readonly (keyof {
24
+ label: React.ReactNode;
25
+ id: string;
26
+ messages?: import("..").FormMessage[] | undefined;
27
+ messagesId?: string | undefined;
28
+ children?: React.ReactNode;
29
+ inline?: boolean | undefined;
30
+ layout?: "inline" | "stacked" | undefined;
31
+ labelAlign?: "end" | "start" | undefined;
32
+ vAlign?: "middle" | "bottom" | "top" | undefined;
33
+ width?: string | undefined;
34
+ inputContainerRef?: ((...args: any[]) => any) | undefined;
35
+ })[];
36
36
  static defaultProps: {
37
37
  inline: boolean;
38
38
  layout: string;
39
39
  labelAlign: string;
40
40
  vAlign: string;
41
- messages: undefined;
42
- messagesId: undefined;
43
41
  children: null;
44
- width: undefined;
45
- inputContainerRef: undefined;
46
42
  };
47
43
  render(): JSX.Element;
48
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/FormField/index.tsx"],"names":[],"mappings":"AAwBA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,SAAS,MAAM,YAAY,CAAA;AAMlC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAExC;;;;GAIG;AACH,cAAM,SAAU,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC/C,MAAM,CAAC,QAAQ,CAAC,WAAW,eAAc;IAEzC,MAAM,CAAC,SAAS;;QAEd;;WAEG;;QAEH;;;;;WAKG;;;;;;;;;;;;;MAUJ;IAED,MAAM,CAAC,YAAY;;;;;;;;;;MAUlB;IAED,MAAM;CAYP;AAED,eAAe,SAAS,CAAA;AACxB,OAAO,EAAE,SAAS,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/FormField/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C;;;;GAIG;AACH,cAAM,SAAU,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC/C,MAAM,CAAC,QAAQ,CAAC,WAAW,eAAc;IAEzC,MAAM,CAAC,SAAS;;;;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;;MAMlB;IAED,MAAM;CAYP;AAED,eAAe,SAAS,CAAA;AACxB,OAAO,EAAE,SAAS,EAAE,CAAA"}
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ import type { PropValidators } from '@instructure/shared-types';
3
+ import type { FormMessage } from '../FormPropTypes';
4
+ declare type FormFieldOwnProps = {
5
+ label: React.ReactNode;
6
+ id: string;
7
+ messages?: FormMessage[];
8
+ messagesId?: string;
9
+ children?: React.ReactNode;
10
+ inline?: boolean;
11
+ layout?: 'stacked' | 'inline';
12
+ labelAlign?: 'start' | 'end';
13
+ vAlign?: 'top' | 'middle' | 'bottom';
14
+ width?: string;
15
+ inputContainerRef?: (...args: any[]) => any;
16
+ };
17
+ declare type PropKeys = keyof FormFieldOwnProps;
18
+ declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
19
+ declare type FormFieldProps = FormFieldOwnProps;
20
+ declare const propTypes: PropValidators<PropKeys>;
21
+ declare const allowedProps: AllowedPropKeys;
22
+ export type { FormFieldProps };
23
+ export { propTypes, allowedProps };
24
+ //# sourceMappingURL=props.d.ts.map