@instructure/ui-form-field 8.13.0 → 8.13.1-snapshot.10

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 (62) hide show
  1. package/LICENSE.md +27 -0
  2. package/es/FormField/index.js +3 -2
  3. package/es/FormField/props.js +0 -15
  4. package/es/FormFieldGroup/index.js +14 -10
  5. package/es/FormFieldGroup/props.js +0 -19
  6. package/es/FormFieldLabel/index.js +13 -7
  7. package/es/FormFieldLabel/props.js +2 -2
  8. package/es/FormFieldLayout/index.js +15 -10
  9. package/es/FormFieldLayout/props.js +5 -24
  10. package/es/FormFieldLayout/styles.js +1 -1
  11. package/es/FormFieldMessage/index.js +12 -8
  12. package/es/FormFieldMessages/index.js +11 -6
  13. package/es/FormFieldMessages/props.js +0 -6
  14. package/lib/FormField/index.js +3 -2
  15. package/lib/FormField/props.js +0 -15
  16. package/lib/FormFieldGroup/index.js +14 -10
  17. package/lib/FormFieldGroup/props.js +0 -19
  18. package/lib/FormFieldLabel/index.js +13 -7
  19. package/lib/FormFieldLabel/props.js +2 -2
  20. package/lib/FormFieldLayout/index.js +15 -10
  21. package/lib/FormFieldLayout/props.js +5 -24
  22. package/lib/FormFieldLayout/styles.js +1 -1
  23. package/lib/FormFieldMessage/index.js +12 -8
  24. package/lib/FormFieldMessages/index.js +11 -6
  25. package/lib/FormFieldMessages/props.js +0 -6
  26. package/package.json +16 -15
  27. package/src/FormField/index.tsx +3 -3
  28. package/src/FormField/props.ts +16 -14
  29. package/src/FormFieldGroup/index.tsx +6 -10
  30. package/src/FormFieldGroup/props.ts +24 -17
  31. package/src/FormFieldLabel/index.tsx +4 -6
  32. package/src/FormFieldLabel/props.ts +3 -3
  33. package/src/FormFieldLayout/index.tsx +10 -16
  34. package/src/FormFieldLayout/props.ts +30 -20
  35. package/src/FormFieldLayout/styles.ts +1 -2
  36. package/src/FormFieldMessage/index.tsx +5 -8
  37. package/src/FormFieldMessages/index.tsx +4 -6
  38. package/src/FormFieldMessages/props.ts +6 -6
  39. package/types/FormField/index.d.ts +3 -3
  40. package/types/FormField/index.d.ts.map +1 -1
  41. package/types/FormField/props.d.ts +17 -2
  42. package/types/FormField/props.d.ts.map +1 -1
  43. package/types/FormFieldGroup/index.d.ts +4 -4
  44. package/types/FormFieldGroup/index.d.ts.map +1 -1
  45. package/types/FormFieldGroup/props.d.ts +18 -2
  46. package/types/FormFieldGroup/props.d.ts.map +1 -1
  47. package/types/FormFieldLabel/index.d.ts +4 -3
  48. package/types/FormFieldLabel/index.d.ts.map +1 -1
  49. package/types/FormFieldLabel/props.d.ts +1 -1
  50. package/types/FormFieldLabel/props.d.ts.map +1 -1
  51. package/types/FormFieldLayout/index.d.ts +7 -32
  52. package/types/FormFieldLayout/index.d.ts.map +1 -1
  53. package/types/FormFieldLayout/props.d.ts +21 -2
  54. package/types/FormFieldLayout/props.d.ts.map +1 -1
  55. package/types/FormFieldLayout/styles.d.ts +1 -1
  56. package/types/FormFieldLayout/styles.d.ts.map +1 -1
  57. package/types/FormFieldMessage/index.d.ts +2 -2
  58. package/types/FormFieldMessage/index.d.ts.map +1 -1
  59. package/types/FormFieldMessages/index.d.ts +2 -1
  60. package/types/FormFieldMessages/index.d.ts.map +1 -1
  61. package/types/FormFieldMessages/props.d.ts +6 -0
  62. package/types/FormFieldMessages/props.d.ts.map +1 -1
@@ -36,16 +36,35 @@ import type { FormMessage } from '../FormPropTypes'
36
36
 
37
37
  type FormFieldLayoutOwnProps = {
38
38
  label: React.ReactNode
39
+ /**
40
+ * the id of the input (to link it to its label for a11y)
41
+ */
39
42
  id?: string
43
+ /**
44
+ * the element type to render as
45
+ */
40
46
  as?: AsElementType
47
+ /**
48
+ * Array of objects with shape: `{
49
+ * text: React.ReactNode,
50
+ * type: One of: ['error', 'hint', 'success', 'screenreader-only']
51
+ * }`
52
+ */
41
53
  messages?: FormMessage[]
54
+ /**
55
+ * id for the form field messages
56
+ */
42
57
  messagesId?: string
43
58
  children?: React.ReactNode
44
59
  inline?: boolean
45
60
  layout?: 'stacked' | 'inline'
46
61
  labelAlign?: 'start' | 'end'
62
+ vAlign?: 'top' | 'middle' | 'bottom'
47
63
  width?: string
48
- inputContainerRef?: (...args: any[]) => any
64
+ inputContainerRef?: (element: Element | null) => void
65
+ /**
66
+ * provides a reference to the underlying html root element
67
+ */
49
68
  elementRef?: (element: Element | null) => void
50
69
  }
51
70
 
@@ -61,34 +80,17 @@ type FormFieldLayoutStyle = ComponentStyle<'formFieldLayout'>
61
80
 
62
81
  const propTypes: PropValidators<PropKeys> = {
63
82
  label: PropTypes.node.isRequired,
64
- /**
65
- * the id of the input (to link it to its label for a11y)
66
- */
67
83
  id: PropTypes.string,
68
- /**
69
- * the element type to render as
70
- */
71
84
  as: PropTypes.elementType,
72
- /**
73
- * object with shape: `{
74
- * text: PropTypes.node,
75
- * type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
76
- * }`
77
- */
78
85
  messages: PropTypes.arrayOf(FormPropTypes.message),
79
- /**
80
- * id for the form field messages
81
- */
82
86
  messagesId: PropTypes.string,
83
87
  children: PropTypes.node,
84
88
  inline: PropTypes.bool,
85
89
  layout: PropTypes.oneOf(['stacked', 'inline']),
86
90
  labelAlign: PropTypes.oneOf(['start', 'end']),
91
+ vAlign: PropTypes.oneOf(['top', 'middle', 'bottom']),
87
92
  width: PropTypes.string,
88
93
  inputContainerRef: PropTypes.func,
89
- /**
90
- * provides a reference to the underlying html root element
91
- */
92
94
  elementRef: PropTypes.func
93
95
  }
94
96
 
@@ -105,7 +107,15 @@ const allowedProps: AllowedPropKeys = [
105
107
  'width',
106
108
  'inputContainerRef',
107
109
  'elementRef'
110
+
111
+ // added vAlign because FormField and FormFieldGroup passes it, but not adding
112
+ // it to allowedProps to prevent it from getting passed through accidentally
113
+ //'vAlign'
108
114
  ]
109
115
 
110
- export type { FormFieldLayoutProps, FormFieldLayoutStyle }
116
+ export type {
117
+ FormFieldLayoutProps,
118
+ FormFieldLayoutStyle,
119
+ FormFieldLayoutOwnProps
120
+ }
111
121
  export { propTypes, allowedProps }
@@ -35,8 +35,7 @@ import type { FormFieldLayoutProps, FormFieldLayoutStyle } from './props'
35
35
  * @return {Object} The final style object, which will be used in the component
36
36
  */
37
37
  const generateStyle = (
38
- // @ts-expect-error no theme used here
39
- componentTheme,
38
+ _componentTheme: null,
40
39
  props: FormFieldLayoutProps
41
40
  ): FormFieldLayoutStyle => {
42
41
  const { inline } = props
@@ -39,6 +39,7 @@ import type { FormFieldMessageProps } from './props'
39
39
  ---
40
40
  parent: FormField
41
41
  ---
42
+ @tsProps
42
43
 
43
44
  This is a helper component that is used by most of the custom form
44
45
  components. In most cases it shouldn't be used directly.
@@ -57,8 +58,7 @@ class FormFieldMessage extends Component<FormFieldMessageProps> {
57
58
  static propTypes = propTypes
58
59
  static allowedProps = allowedProps
59
60
  static defaultProps = {
60
- variant: 'hint',
61
- children: null
61
+ variant: 'hint'
62
62
  }
63
63
 
64
64
  ref: Element | null = null
@@ -68,14 +68,11 @@ class FormFieldMessage extends Component<FormFieldMessageProps> {
68
68
  }
69
69
 
70
70
  componentDidMount() {
71
- // @ts-expect-error ts-migrate(2722) FIXME: Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message
72
- this.props.makeStyles()
71
+ this.props.makeStyles?.()
73
72
  }
74
73
 
75
- // @ts-expect-error ts-migrate(6133) FIXME: 'prevProps' is declared but its value is never rea... Remove this comment to see the full error message
76
- componentDidUpdate(prevProps, prevState, snapshot) {
77
- // @ts-expect-error ts-migrate(2722) FIXME: Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message
78
- this.props.makeStyles()
74
+ componentDidUpdate() {
75
+ this.props.makeStyles?.()
79
76
  }
80
77
 
81
78
  render() {
@@ -41,6 +41,7 @@ import type { FormFieldMessagesProps } from './props'
41
41
  ---
42
42
  parent: FormField
43
43
  ---
44
+ @tsProps
44
45
 
45
46
  A FormFieldMessages component
46
47
 
@@ -70,14 +71,11 @@ class FormFieldMessages extends Component<FormFieldMessagesProps> {
70
71
  }
71
72
 
72
73
  componentDidMount() {
73
- // @ts-expect-error ts-migrate(2722) FIXME: Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message
74
- this.props.makeStyles()
74
+ this.props.makeStyles?.()
75
75
  }
76
76
 
77
- // @ts-expect-error ts-migrate(6133) FIXME: 'prevProps' is declared but its value is never rea... Remove this comment to see the full error message
78
- componentDidUpdate(prevProps, prevState, snapshot) {
79
- // @ts-expect-error ts-migrate(2722) FIXME: Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message
80
- this.props.makeStyles()
77
+ componentDidUpdate() {
78
+ this.props.makeStyles?.()
81
79
  }
82
80
 
83
81
  render() {
@@ -35,6 +35,12 @@ import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
35
35
  import type { FormMessage } from '../FormPropTypes'
36
36
 
37
37
  type FormFieldMessagesOwnProps = {
38
+ /**
39
+ * Array of objects with shape: `{
40
+ * text: React.ReactNode,
41
+ * type: One of: ['error', 'hint', 'success', 'screenreader-only']
42
+ * }`
43
+ */
38
44
  messages?: FormMessage[]
39
45
  }
40
46
 
@@ -49,12 +55,6 @@ type FormFieldMessagesProps = FormFieldMessagesOwnProps &
49
55
  type FormFieldMessagesStyle = ComponentStyle<'formFieldMessages' | 'message'>
50
56
 
51
57
  const propTypes: PropValidators<PropKeys> = {
52
- /**
53
- * object with shape: `{
54
- * text: PropTypes.node,
55
- * type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
56
- * }`
57
- */
58
58
  messages: PropTypes.arrayOf(FormPropTypes.message)
59
59
  }
60
60
 
@@ -4,6 +4,7 @@ import type { FormFieldProps } from './props';
4
4
  ---
5
5
  category: components
6
6
  ---
7
+ @tsProps
7
8
  **/
8
9
  declare class FormField extends Component<FormFieldProps> {
9
10
  static readonly componentId = "FormField";
@@ -18,7 +19,7 @@ declare class FormField extends Component<FormFieldProps> {
18
19
  labelAlign?: "start" | "end" | undefined;
19
20
  vAlign?: "middle" | "bottom" | "top" | undefined;
20
21
  width?: string | undefined;
21
- inputContainerRef?: ((...args: any[]) => any) | undefined;
22
+ inputContainerRef?: ((element: Element | null) => void) | undefined;
22
23
  elementRef?: ((element: Element | null) => void) | undefined;
23
24
  }>;
24
25
  static allowedProps: readonly (keyof {
@@ -32,7 +33,7 @@ declare class FormField extends Component<FormFieldProps> {
32
33
  labelAlign?: "start" | "end" | undefined;
33
34
  vAlign?: "middle" | "bottom" | "top" | undefined;
34
35
  width?: string | undefined;
35
- inputContainerRef?: ((...args: any[]) => any) | undefined;
36
+ inputContainerRef?: ((element: Element | null) => void) | undefined;
36
37
  elementRef?: ((element: Element | null) => void) | undefined;
37
38
  })[];
38
39
  static defaultProps: {
@@ -40,7 +41,6 @@ declare class FormField extends Component<FormFieldProps> {
40
41
  layout: string;
41
42
  labelAlign: string;
42
43
  vAlign: string;
43
- children: null;
44
44
  };
45
45
  ref: Element | null;
46
46
  handleRef: (el: Element | null) => void;
@@ -1 +1 @@
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,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAQ9B;IAED,MAAM;CAaP;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;;;;;GAKG;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;;;;;MAKlB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAQ9B;IAED,MAAM;CAaP;AAED,eAAe,SAAS,CAAA;AACxB,OAAO,EAAE,SAAS,EAAE,CAAA"}
@@ -1,10 +1,22 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import type { OtherHTMLAttributes, PropValidators } from '@instructure/shared-types';
3
3
  import type { FormMessage } from '../FormPropTypes';
4
4
  declare type FormFieldOwnProps = {
5
5
  label: React.ReactNode;
6
+ /**
7
+ * the id of the input (to link it to its label for a11y)
8
+ */
6
9
  id: string;
10
+ /**
11
+ * Array of objects with shape: `{
12
+ * text: React.ReactNode,
13
+ * type: One of: ['error', 'hint', 'success', 'screenreader-only']
14
+ * }`
15
+ */
7
16
  messages?: FormMessage[];
17
+ /**
18
+ * id for the form field messages
19
+ */
8
20
  messagesId?: string;
9
21
  children?: React.ReactNode;
10
22
  inline?: boolean;
@@ -12,7 +24,10 @@ declare type FormFieldOwnProps = {
12
24
  labelAlign?: 'start' | 'end';
13
25
  vAlign?: 'top' | 'middle' | 'bottom';
14
26
  width?: string;
15
- inputContainerRef?: (...args: any[]) => any;
27
+ inputContainerRef?: (element: Element | null) => void;
28
+ /**
29
+ * provides a reference to the underlying html root element
30
+ */
16
31
  elementRef?: (element: Element | null) => void;
17
32
  };
18
33
  declare type PropKeys = keyof FormFieldOwnProps;
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/FormField/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACf,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEnD,aAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;IAC7B,UAAU,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;IAC5B,MAAM,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAA;IACpC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iBAAiB,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IAC3C,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAA;CAC/C,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,iBAAiB,CAAA;AAEvC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,cAAc,GAAG,iBAAiB,GAAG,mBAAmB,CAAC,iBAAiB,CAAC,CAAA;AAEhF,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAyBvC,CAAA;AAED,QAAA,MAAM,YAAY,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,CAavC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAanB,CAAA;AAED,YAAY,EAAE,cAAc,EAAE,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
@@ -6,6 +6,7 @@ import type { FormFieldGroupProps, FormFieldGroupStyleProps } from './props';
6
6
  ---
7
7
  category: components
8
8
  ---
9
+ @tsProps
9
10
  **/
10
11
  declare class FormFieldGroup extends Component<FormFieldGroupProps> {
11
12
  static readonly componentId = "FormFieldGroup";
@@ -20,7 +21,7 @@ declare class FormFieldGroup extends Component<FormFieldGroupProps> {
20
21
  rowSpacing?: "small" | "none" | "medium" | "large" | undefined;
21
22
  colSpacing?: "small" | "none" | "medium" | "large" | undefined;
22
23
  vAlign?: "middle" | "bottom" | "top" | undefined;
23
- startAt?: any;
24
+ startAt?: "small" | "medium" | "large" | "x-large" | null | undefined;
24
25
  elementRef?: ((element: Element | null) => void) | undefined;
25
26
  }>;
26
27
  static allowedProps: readonly (keyof {
@@ -34,11 +35,10 @@ declare class FormFieldGroup extends Component<FormFieldGroupProps> {
34
35
  rowSpacing?: "small" | "none" | "medium" | "large" | undefined;
35
36
  colSpacing?: "small" | "none" | "medium" | "large" | undefined;
36
37
  vAlign?: "middle" | "bottom" | "top" | undefined;
37
- startAt?: any;
38
+ startAt?: "small" | "medium" | "large" | "x-large" | null | undefined;
38
39
  elementRef?: ((element: Element | null) => void) | undefined;
39
40
  })[];
40
41
  static defaultProps: {
41
- children: null;
42
42
  as: string;
43
43
  disabled: boolean;
44
44
  rowSpacing: string;
@@ -48,7 +48,7 @@ declare class FormFieldGroup extends Component<FormFieldGroupProps> {
48
48
  ref: Element | null;
49
49
  handleRef: (el: Element | null) => void;
50
50
  componentDidMount(): void;
51
- componentDidUpdate(prevProps: any, prevState: any, snapshot: any): void;
51
+ componentDidUpdate(): void;
52
52
  get makeStylesVariables(): FormFieldGroupStyleProps;
53
53
  get invalid(): boolean;
54
54
  renderColumns(): jsx.JSX.Element[] | null | undefined;
@@ -1 +1 @@
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"}
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;;;;;GAKG;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;;;;;;MAMlB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAQ9B;IAED,iBAAiB;IAIjB,kBAAkB;IAIlB,IAAI,mBAAmB,IAAI,wBAAwB,CAElD;IAED,IAAI,OAAO,YAOV;IAED,aAAa;IAiBb,cAAc;IAgBd,YAAY;IAUZ,MAAM;CAkBP;AAED,eAAe,cAAc,CAAA;AAC7B,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -1,11 +1,24 @@
1
1
  /// <reference types="react" />
2
2
  import type { AsElementType, PropValidators, FormFieldGroupTheme, OtherHTMLAttributes } from '@instructure/shared-types';
3
3
  import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
4
+ import type { FormFieldLayoutOwnProps } from '../FormFieldLayout/props';
4
5
  import type { FormMessage } from '../FormPropTypes';
5
6
  declare type FormFieldGroupOwnProps = {
6
7
  description: React.ReactNode;
8
+ /**
9
+ * the element type to render as
10
+ */
7
11
  as?: AsElementType;
12
+ /**
13
+ * Array of objects with shape: `{
14
+ * text: React.ReactNode,
15
+ * type: One of: ['error', 'hint', 'success', 'screenreader-only']
16
+ * }`
17
+ */
8
18
  messages?: FormMessage[];
19
+ /**
20
+ * id for the form field messages
21
+ */
9
22
  messagesId?: string;
10
23
  disabled?: boolean;
11
24
  children?: React.ReactNode;
@@ -13,7 +26,10 @@ declare type FormFieldGroupOwnProps = {
13
26
  rowSpacing?: 'none' | 'small' | 'medium' | 'large';
14
27
  colSpacing?: 'none' | 'small' | 'medium' | 'large';
15
28
  vAlign?: 'top' | 'middle' | 'bottom';
16
- startAt?: any;
29
+ startAt?: 'small' | 'medium' | 'large' | 'x-large' | null;
30
+ /**
31
+ * provides a reference to the underlying html root element
32
+ */
17
33
  elementRef?: (element: Element | null) => void;
18
34
  };
19
35
  declare type FormFieldGroupStyleProps = {
@@ -21,7 +37,7 @@ declare type FormFieldGroupStyleProps = {
21
37
  };
22
38
  declare type PropKeys = keyof FormFieldGroupOwnProps;
23
39
  declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
24
- declare type FormFieldGroupProps = FormFieldGroupOwnProps & WithStyleProps<FormFieldGroupTheme, FormFieldGroupStyle> & OtherHTMLAttributes<FormFieldGroupOwnProps>;
40
+ declare type FormFieldGroupProps = FormFieldGroupOwnProps & WithStyleProps<FormFieldGroupTheme, FormFieldGroupStyle> & OtherHTMLAttributes<FormFieldGroupOwnProps> & Omit<FormFieldLayoutOwnProps, 'messages' | 'messagesId' | 'vAlign' | 'layout' | 'label' | 'children'>;
25
41
  declare type FormFieldGroupStyle = ComponentStyle<'formFieldGroup'>;
26
42
  declare const propTypes: PropValidators<PropKeys>;
27
43
  declare const allowedProps: AllowedPropKeys;
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/FormFieldGroup/props.ts"],"names":[],"mappings":";AA4BA,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEnD,aAAK,sBAAsB,GAAG;IAC5B,WAAW,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,MAAM,CAAC,EAAE,SAA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Q,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CACvE,CAAA;AAEH,aAAK,mBAAmB,GAAG,cAAc,CAAC,gBAAgB,CAAC,CAAA;AAE3D,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAavC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAanB,CAAA;AAED,YAAY,EACV,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACpB,CAAA;AACD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
@@ -6,6 +6,7 @@ import type { FormFieldLabelProps } from './props';
6
6
  ---
7
7
  parent: FormField
8
8
  ---
9
+ @tsProps
9
10
 
10
11
  This is a helper component that is used by most of the custom form
11
12
  components. In most cases it shouldn't be used directly.
@@ -21,12 +22,12 @@ example: true
21
22
  declare class FormFieldLabel extends Component<FormFieldLabelProps> {
22
23
  static readonly componentId = "FormFieldLabel";
23
24
  static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
24
- as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
25
25
  children: import("react").ReactNode;
26
+ as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
26
27
  }>;
27
28
  static allowedProps: readonly (keyof {
28
- as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
29
29
  children: import("react").ReactNode;
30
+ as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
30
31
  })[];
31
32
  static defaultProps: {
32
33
  readonly as: "span";
@@ -34,7 +35,7 @@ declare class FormFieldLabel extends Component<FormFieldLabelProps> {
34
35
  ref: Element | null;
35
36
  handleRef: (el: Element | null) => void;
36
37
  componentDidMount(): void;
37
- componentDidUpdate(prevProps: any, prevState: any, snapshot: any): void;
38
+ componentDidUpdate(): void;
38
39
  render(): jsx.JSX.Element;
39
40
  }
40
41
  export default FormFieldLabel;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/FormFieldLabel/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iBAAiB;IAIjB,kBAAkB;IAIlB,MAAM;CAgBP;AAED,eAAe,cAAc,CAAA;AAC7B,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -2,8 +2,8 @@
2
2
  import type { AsElementType, PropValidators, FormFieldLabelTheme, OtherHTMLAttributes } from '@instructure/shared-types';
3
3
  import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
4
4
  declare type FormFieldLabelOwnProps = {
5
- as?: AsElementType;
6
5
  children: React.ReactNode;
6
+ as?: AsElementType;
7
7
  };
8
8
  declare type PropKeys = keyof FormFieldLabelOwnProps;
9
9
  declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/FormFieldLabel/props.ts"],"names":[],"mappings":";AA0BA,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1E,aAAK,sBAAsB,GAAG;IAC5B,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,sBAAsB,CAAA;AAE5C,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,mBAAmB,GAAG,sBAAsB,GAC/C,cAAc,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,GACxD,mBAAmB,CAAC,sBAAsB,CAAC,CAAA;AAE7C,aAAK,mBAAmB,GAAG,cAAc,CAAC,gBAAgB,CAAC,CAAA;AAE3D,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAGvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAAoC,CAAA;AAExD,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/FormFieldLabel/props.ts"],"names":[],"mappings":";AA0BA,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1E,aAAK,sBAAsB,GAAG;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,EAAE,CAAC,EAAE,aAAa,CAAA;CACnB,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,sBAAsB,CAAA;AAE5C,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,mBAAmB,GAAG,sBAAsB,GAC/C,cAAc,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,GACxD,mBAAmB,CAAC,sBAAsB,CAAC,CAAA;AAE7C,aAAK,mBAAmB,GAAG,cAAc,CAAC,gBAAgB,CAAC,CAAA;AAE3D,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAGvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAAoC,CAAA;AAExD,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
@@ -6,54 +6,29 @@ import type { FormFieldLayoutProps } from './props';
6
6
  ---
7
7
  parent: FormField
8
8
  ---
9
+ @tsProps
9
10
  **/
10
11
  declare class FormFieldLayout extends Component<FormFieldLayoutProps> {
11
12
  static readonly componentId = "FormFieldLayout";
12
- static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
13
- label: import("react").ReactNode;
14
- id?: string | undefined;
15
- as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
16
- messages?: import("../FormPropTypes").FormMessage[] | undefined;
17
- messagesId?: string | undefined;
18
- children?: import("react").ReactNode;
19
- inline?: boolean | undefined;
20
- layout?: "inline" | "stacked" | undefined;
21
- labelAlign?: "start" | "end" | undefined;
22
- width?: string | undefined;
23
- inputContainerRef?: ((...args: any[]) => any) | undefined;
24
- elementRef?: ((element: Element | null) => void) | undefined;
25
- }>;
26
- static allowedProps: readonly (keyof {
27
- label: import("react").ReactNode;
28
- id?: string | undefined;
29
- as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
30
- messages?: import("../FormPropTypes").FormMessage[] | undefined;
31
- messagesId?: string | undefined;
32
- children?: import("react").ReactNode;
33
- inline?: boolean | undefined;
34
- layout?: "inline" | "stacked" | undefined;
35
- labelAlign?: "start" | "end" | undefined;
36
- width?: string | undefined;
37
- inputContainerRef?: ((...args: any[]) => any) | undefined;
38
- elementRef?: ((element: Element | null) => void) | undefined;
39
- })[];
13
+ static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof import("./props").FormFieldLayoutOwnProps>;
14
+ static allowedProps: readonly (keyof import("./props").FormFieldLayoutOwnProps)[];
40
15
  static defaultProps: {
41
- readonly children: null;
42
16
  readonly inline: false;
43
17
  readonly layout: "stacked";
44
18
  readonly as: "label";
45
19
  readonly labelAlign: "end";
46
20
  };
47
- constructor(props: any);
21
+ constructor(props: FormFieldLayoutProps);
22
+ private _messagesId;
48
23
  ref: Element | null;
49
24
  handleRef: (el: Element | null) => void;
50
25
  componentDidMount(): void;
51
- componentDidUpdate(prevProps: any, prevState: any, snapshot: any): void;
26
+ componentDidUpdate(): void;
52
27
  get hasVisibleLabel(): boolean | "" | 0 | null | undefined;
53
28
  get hasMessages(): boolean | undefined;
54
29
  get elementType(): import("@instructure/shared-types/types/CommonProps").AsElementType;
55
30
  get inlineContainerAndLabel(): boolean | undefined;
56
- handleInputContainerRef: (node: any) => void;
31
+ handleInputContainerRef: (node: Element | null) => void;
57
32
  renderLabel(): import("react").ReactNode;
58
33
  renderLegend(): jsx.JSX.Element;
59
34
  renderVisibleMessages(): jsx.JSX.Element | null;
@@ -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;IAiBrB,MAAM;CAyCP;AAED,eAAe,eAAe,CAAA;AAC9B,OAAO,EAAE,eAAe,EAAE,CAAA"}
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;;;;;GAKG;AACH,cACM,eAAgB,SAAQ,SAAS,CAAC,oBAAoB,CAAC;IAC3D,MAAM,CAAC,QAAQ,CAAC,WAAW,qBAAoB;IAE/C,MAAM,CAAC,SAAS,yHAAY;IAC5B,MAAM,CAAC,YAAY,+DAAe;IAClC,MAAM,CAAC,YAAY;;;;;MAKT;gBAEE,KAAK,EAAE,oBAAoB;IAcvC,OAAO,CAAC,WAAW,CAAQ;IAE3B,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAQ9B;IAED,iBAAiB;IAIjB,kBAAkB;IAIlB,IAAI,eAAe,wCAElB;IAED,IAAI,WAAW,wBAEd;IAED,IAAI,WAAW,wEAEd;IAED,IAAI,uBAAuB,wBAG1B;IAED,uBAAuB,SAAU,OAAO,GAAG,IAAI,UAI9C;IAED,WAAW;IAsBX,YAAY;IAaZ,qBAAqB;IAgBrB,MAAM;CAwCP;AAED,eAAe,eAAe,CAAA;AAC9B,OAAO,EAAE,eAAe,EAAE,CAAA"}
@@ -4,16 +4,35 @@ import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
4
4
  import type { FormMessage } from '../FormPropTypes';
5
5
  declare type FormFieldLayoutOwnProps = {
6
6
  label: React.ReactNode;
7
+ /**
8
+ * the id of the input (to link it to its label for a11y)
9
+ */
7
10
  id?: string;
11
+ /**
12
+ * the element type to render as
13
+ */
8
14
  as?: AsElementType;
15
+ /**
16
+ * Array of objects with shape: `{
17
+ * text: React.ReactNode,
18
+ * type: One of: ['error', 'hint', 'success', 'screenreader-only']
19
+ * }`
20
+ */
9
21
  messages?: FormMessage[];
22
+ /**
23
+ * id for the form field messages
24
+ */
10
25
  messagesId?: string;
11
26
  children?: React.ReactNode;
12
27
  inline?: boolean;
13
28
  layout?: 'stacked' | 'inline';
14
29
  labelAlign?: 'start' | 'end';
30
+ vAlign?: 'top' | 'middle' | 'bottom';
15
31
  width?: string;
16
- inputContainerRef?: (...args: any[]) => any;
32
+ inputContainerRef?: (element: Element | null) => void;
33
+ /**
34
+ * provides a reference to the underlying html root element
35
+ */
17
36
  elementRef?: (element: Element | null) => void;
18
37
  };
19
38
  declare type PropKeys = keyof FormFieldLayoutOwnProps;
@@ -22,6 +41,6 @@ declare type FormFieldLayoutProps = FormFieldLayoutOwnProps & WithStyleProps<nul
22
41
  declare type FormFieldLayoutStyle = ComponentStyle<'formFieldLayout'>;
23
42
  declare const propTypes: PropValidators<PropKeys>;
24
43
  declare const allowedProps: AllowedPropKeys;
25
- export type { FormFieldLayoutProps, FormFieldLayoutStyle };
44
+ export type { FormFieldLayoutProps, FormFieldLayoutStyle, FormFieldLayoutOwnProps };
26
45
  export { propTypes, allowedProps };
27
46
  //# sourceMappingURL=props.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/FormFieldLayout/props.ts"],"names":[],"mappings":";AA4BA,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,cAAc,EACf,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEnD,aAAK,uBAAuB,GAAG;IAC7B,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;IAC7B,UAAU,CAAC,EAAE,OAAO,GAAG,KAAK,C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AA;IACxB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;IAC7B,UAAU,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;IAC5B,MAAM,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAA;IACpC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAA;IACrD;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAA;CAC/C,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,uBAAuB,CAAA;AAE7C,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,oBAAoB,GAAG,uBAAuB,GACjD,cAAc,CAAC,IAAI,EAAE,oBAAoB,CAAC,GAC1C,mBAAmB,CAAC,uBAAuB,CAAC,CAAA;AAE9C,aAAK,oBAAoB,GAAG,cAAc,CAAC,iBAAiB,CAAC,CAAA;AAE7D,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAcvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAiBnB,CAAA;AAED,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACxB,CAAA;AACD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
@@ -9,6 +9,6 @@ import type { FormFieldLayoutProps, FormFieldLayoutStyle } from './props';
9
9
  * @param {Object} state the state of the component, the style is applied to
10
10
  * @return {Object} The final style object, which will be used in the component
11
11
  */
12
- declare const generateStyle: (componentTheme: any, props: FormFieldLayoutProps) => FormFieldLayoutStyle;
12
+ declare const generateStyle: (_componentTheme: null, props: FormFieldLayoutProps) => FormFieldLayoutStyle;
13
13
  export default generateStyle;
14
14
  //# sourceMappingURL=styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/FormFieldLayout/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEzE;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,+BAGV,oBAAoB,KAC1B,oBAwBF,CAAA;AAED,eAAe,aAAa,CAAA"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/FormFieldLayout/styles.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEzE;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,oBACA,IAAI,SACd,oBAAoB,KAC1B,oBAwBF,CAAA;AAED,eAAe,aAAa,CAAA"}
@@ -6,6 +6,7 @@ import type { FormFieldMessageProps } from './props';
6
6
  ---
7
7
  parent: FormField
8
8
  ---
9
+ @tsProps
9
10
 
10
11
  This is a helper component that is used by most of the custom form
11
12
  components. In most cases it shouldn't be used directly.
@@ -29,12 +30,11 @@ declare class FormFieldMessage extends Component<FormFieldMessageProps> {
29
30
  })[];
30
31
  static defaultProps: {
31
32
  variant: string;
32
- children: null;
33
33
  };
34
34
  ref: Element | null;
35
35
  handleRef: (el: Element | null) => void;
36
36
  componentDidMount(): void;
37
- componentDidUpdate(prevProps: any, prevState: any, snapshot: any): void;
37
+ componentDidUpdate(): void;
38
38
  render(): jsx.JSX.Element;
39
39
  }
40
40
  export default FormFieldMessage;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/FormFieldMessage/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,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AgB,CAAA;AAC/B,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
@@ -6,6 +6,7 @@ import type { FormFieldMessagesProps } from './props';
6
6
  ---
7
7
  parent: FormField
8
8
  ---
9
+ @tsProps
9
10
 
10
11
  A FormFieldMessages component
11
12
 
@@ -28,7 +29,7 @@ declare class FormFieldMessages extends Component<FormFieldMessagesProps> {
28
29
  ref: Element | null;
29
30
  handleRef: (el: Element | null) => void;
30
31
  componentDidMount(): void;
31
- componentDidUpdate(prevProps: any, prevState: any, snapshot: any): void;
32
+ componentDidUpdate(): void;
32
33
  render(): jsx.JSX.Element | null;
33
34
  }
34
35
  export default FormFieldMessages;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/FormFieldMessages/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAQrD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAErD;;;;;;;;;;;;;;;;;GAiBG;AACH,cACM,iBAAkB,SAAQ,SAAS,CAAC,sBAAsB,CAAC;IAC/D,MAAM,CAAC,QAAQ,CAAC,WAAW,uBAAsB;IAEjD,MAAM,CAAC,SAAS,oFAAY;IAC5B,MAAM,CAAC,YAAY,wBAAe;IAClC,MAAM,CAAC,YAAY,KAAK;IAExB,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAE9B;IAED,iBAAiB;IAMjB,kBAAkB,CAAC,SAAS,KAAA,EAAE,SAAS,KAAA,EAAE,QAAQ,KAAA;IAKjD,MAAM;CAmBP;AAED,eAAe,iBAAiB,CAAA;AAChC,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/FormFieldMessages/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAQrD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAErD;;;;;;;;;;;;;;;;;;GAkBG;AACH,cACM,iBAAkB,SAAQ,SAAS,CAAC,sBAAsB,CAAC;IAC/D,MAAM,CAAC,QAAQ,CAAC,WAAW,uBAAsB;IAEjD,MAAM,CAAC,SAAS,oFAAY;IAC5B,MAAM,CAAC,YAAY,wBAAe;IAClC,MAAM,CAAC,YAAY,KAAK;IAExB,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAE9B;IAED,iBAAiB;IAIjB,kBAAkB;IAIlB,MAAM;CAmBP;AAED,eAAe,iBAAiB,CAAA;AAChC,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
@@ -2,6 +2,12 @@ import type { PropValidators, FormFieldMessagesTheme, OtherHTMLAttributes } from
2
2
  import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
3
3
  import type { FormMessage } from '../FormPropTypes';
4
4
  declare type FormFieldMessagesOwnProps = {
5
+ /**
6
+ * Array of objects with shape: `{
7
+ * text: React.ReactNode,
8
+ * type: One of: ['error', 'hint', 'success', 'screenreader-only']
9
+ * }`
10
+ */
5
11
  messages?: FormMessage[];
6
12
  };
7
13
  declare type PropKeys = keyof FormFieldMessagesOwnProps;