@instructure/ui-form-field 11.6.0 → 11.6.1-snapshot-129

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 (248) hide show
  1. package/CHANGELOG.md +46 -300
  2. package/es/FormField/{index.js → v1/index.js} +1 -1
  3. package/es/FormField/v2/index.js +78 -0
  4. package/es/FormField/v2/props.js +26 -0
  5. package/es/FormFieldGroup/{index.js → v1/index.js} +5 -4
  6. package/es/FormFieldGroup/v2/index.js +130 -0
  7. package/es/FormFieldGroup/v2/props.js +26 -0
  8. package/es/FormFieldGroup/v2/styles.js +49 -0
  9. package/es/FormFieldLabel/{index.js → v1/index.js} +1 -1
  10. package/es/FormFieldLabel/v2/index.js +83 -0
  11. package/es/FormFieldLabel/v2/props.js +26 -0
  12. package/es/FormFieldLabel/v2/styles.js +62 -0
  13. package/es/FormFieldLabel/v2/theme.js +52 -0
  14. package/es/FormFieldLayout/{index.js → v1/index.js} +2 -2
  15. package/es/FormFieldLayout/{styles.js → v1/styles.js} +2 -2
  16. package/es/FormFieldLayout/v2/index.js +207 -0
  17. package/es/FormFieldLayout/v2/props.js +26 -0
  18. package/es/FormFieldLayout/v2/styles.js +171 -0
  19. package/es/FormFieldMessage/{index.js → v1/index.js} +1 -1
  20. package/es/FormFieldMessage/v2/index.js +96 -0
  21. package/es/FormFieldMessage/v2/props.js +26 -0
  22. package/es/FormFieldMessage/v2/styles.js +69 -0
  23. package/es/FormFieldMessages/{index.js → v1/index.js} +2 -2
  24. package/es/FormFieldMessages/v2/index.js +88 -0
  25. package/es/FormFieldMessages/v2/props.js +26 -0
  26. package/es/FormFieldMessages/v2/styles.js +50 -0
  27. package/es/{index.js → exports/a.js} +6 -6
  28. package/es/exports/b.js +29 -0
  29. package/lib/FormField/{index.js → v1/index.js} +3 -3
  30. package/lib/FormField/v2/index.js +85 -0
  31. package/lib/FormField/v2/props.js +31 -0
  32. package/lib/FormFieldGroup/{index.js → v1/index.js} +11 -10
  33. package/lib/FormFieldGroup/v2/index.js +136 -0
  34. package/lib/FormFieldGroup/v2/props.js +31 -0
  35. package/lib/FormFieldGroup/v2/styles.js +55 -0
  36. package/lib/FormFieldLabel/{index.js → v1/index.js} +1 -1
  37. package/lib/FormFieldLabel/v2/index.js +89 -0
  38. package/lib/FormFieldLabel/v2/props.js +31 -0
  39. package/lib/FormFieldLabel/v2/styles.js +68 -0
  40. package/lib/FormFieldLabel/v2/theme.js +58 -0
  41. package/lib/FormFieldLayout/{index.js → v1/index.js} +3 -3
  42. package/lib/FormFieldLayout/{styles.js → v1/styles.js} +1 -1
  43. package/lib/FormFieldLayout/v2/index.js +220 -0
  44. package/lib/FormFieldLayout/v2/props.js +31 -0
  45. package/lib/FormFieldLayout/v2/styles.js +177 -0
  46. package/lib/FormFieldMessage/{index.js → v1/index.js} +2 -2
  47. package/lib/FormFieldMessage/v2/index.js +101 -0
  48. package/lib/FormFieldMessage/v2/props.js +31 -0
  49. package/lib/FormFieldMessage/v2/styles.js +75 -0
  50. package/lib/FormFieldMessages/{index.js → v1/index.js} +3 -3
  51. package/lib/FormFieldMessages/v2/index.js +93 -0
  52. package/lib/FormFieldMessages/v2/props.js +31 -0
  53. package/lib/FormFieldMessages/v2/styles.js +56 -0
  54. package/lib/{index.js → exports/a.js} +12 -12
  55. package/lib/exports/b.js +47 -0
  56. package/package.json +43 -21
  57. package/src/FormField/{index.tsx → v1/index.tsx} +1 -1
  58. package/src/FormField/{props.ts → v1/props.ts} +1 -1
  59. package/src/FormField/v2/README.md +43 -0
  60. package/src/FormField/v2/index.tsx +87 -0
  61. package/src/FormField/v2/props.ts +104 -0
  62. package/src/FormFieldGroup/{index.tsx → v1/index.tsx} +6 -4
  63. package/src/FormFieldGroup/{props.ts → v1/props.ts} +2 -2
  64. package/src/FormFieldGroup/v2/README.md +114 -0
  65. package/src/FormFieldGroup/v2/index.tsx +182 -0
  66. package/src/FormFieldGroup/v2/props.ts +103 -0
  67. package/src/FormFieldGroup/v2/styles.ts +58 -0
  68. package/src/FormFieldLabel/{index.tsx → v1/index.tsx} +1 -1
  69. package/src/FormFieldLabel/v2/index.tsx +95 -0
  70. package/src/FormFieldLabel/v2/props.ts +49 -0
  71. package/src/FormFieldLabel/v2/styles.ts +74 -0
  72. package/src/FormFieldLabel/v2/theme.ts +56 -0
  73. package/src/FormFieldLayout/{index.tsx → v1/index.tsx} +2 -2
  74. package/src/FormFieldLayout/{props.ts → v1/props.ts} +1 -1
  75. package/src/FormFieldLayout/{styles.ts → v1/styles.ts} +2 -2
  76. package/src/FormFieldLayout/v2/index.tsx +237 -0
  77. package/src/FormFieldLayout/v2/props.ts +157 -0
  78. package/src/FormFieldLayout/v2/styles.ts +209 -0
  79. package/src/FormFieldMessage/{index.tsx → v1/index.tsx} +1 -1
  80. package/src/FormFieldMessage/{props.ts → v1/props.ts} +4 -1
  81. package/src/FormFieldMessage/{styles.ts → v1/styles.ts} +2 -3
  82. package/src/FormFieldMessage/v2/index.tsx +104 -0
  83. package/src/FormFieldMessage/v2/props.ts +48 -0
  84. package/src/FormFieldMessage/v2/styles.ts +76 -0
  85. package/src/FormFieldMessages/{index.tsx → v1/index.tsx} +2 -2
  86. package/src/FormFieldMessages/{props.ts → v1/props.ts} +1 -1
  87. package/src/FormFieldMessages/v2/index.tsx +99 -0
  88. package/src/FormFieldMessages/v2/props.ts +59 -0
  89. package/src/FormFieldMessages/v2/styles.ts +55 -0
  90. package/src/{index.ts → exports/a.ts} +17 -13
  91. package/src/exports/b.ts +43 -0
  92. package/tsconfig.build.json +1 -0
  93. package/tsconfig.build.tsbuildinfo +1 -1
  94. package/types/FormField/v1/index.d.ts.map +1 -0
  95. package/types/FormField/{props.d.ts → v1/props.d.ts} +1 -1
  96. package/types/FormField/v1/props.d.ts.map +1 -0
  97. package/types/FormField/v2/index.d.ts +23 -0
  98. package/types/FormField/v2/index.d.ts.map +1 -0
  99. package/types/FormField/v2/props.d.ts +57 -0
  100. package/types/FormField/v2/props.d.ts.map +1 -0
  101. package/types/FormFieldGroup/{index.d.ts → v1/index.d.ts} +1 -1
  102. package/types/FormFieldGroup/v1/index.d.ts.map +1 -0
  103. package/types/FormFieldGroup/{props.d.ts → v1/props.d.ts} +2 -2
  104. package/types/FormFieldGroup/v1/props.d.ts.map +1 -0
  105. package/types/FormFieldGroup/v1/styles.d.ts.map +1 -0
  106. package/types/FormFieldGroup/v1/theme.d.ts.map +1 -0
  107. package/types/FormFieldGroup/v2/index.d.ts +45 -0
  108. package/types/FormFieldGroup/v2/index.d.ts.map +1 -0
  109. package/types/FormFieldGroup/v2/props.d.ts +48 -0
  110. package/types/FormFieldGroup/v2/props.d.ts.map +1 -0
  111. package/types/FormFieldGroup/v2/styles.d.ts +14 -0
  112. package/types/FormFieldGroup/v2/styles.d.ts.map +1 -0
  113. package/types/FormFieldLabel/v1/index.d.ts.map +1 -0
  114. package/types/FormFieldLabel/v1/props.d.ts.map +1 -0
  115. package/types/FormFieldLabel/v1/styles.d.ts.map +1 -0
  116. package/types/FormFieldLabel/v1/theme.d.ts.map +1 -0
  117. package/types/FormFieldLabel/v2/index.d.ts +38 -0
  118. package/types/FormFieldLabel/v2/index.d.ts.map +1 -0
  119. package/types/FormFieldLabel/v2/props.d.ts +14 -0
  120. package/types/FormFieldLabel/v2/props.d.ts.map +1 -0
  121. package/types/FormFieldLabel/v2/styles.d.ts +15 -0
  122. package/types/FormFieldLabel/v2/styles.d.ts.map +1 -0
  123. package/types/FormFieldLabel/v2/theme.d.ts +10 -0
  124. package/types/FormFieldLabel/v2/theme.d.ts.map +1 -0
  125. package/types/FormFieldLayout/v1/index.d.ts.map +1 -0
  126. package/types/FormFieldLayout/{props.d.ts → v1/props.d.ts} +1 -1
  127. package/types/FormFieldLayout/v1/props.d.ts.map +1 -0
  128. package/types/FormFieldLayout/v1/styles.d.ts.map +1 -0
  129. package/types/FormFieldLayout/v1/theme.d.ts.map +1 -0
  130. package/types/FormFieldLayout/v2/index.d.ts +14 -0
  131. package/types/FormFieldLayout/v2/index.d.ts.map +1 -0
  132. package/types/FormFieldLayout/v2/props.d.ts +90 -0
  133. package/types/FormFieldLayout/v2/props.d.ts.map +1 -0
  134. package/types/FormFieldLayout/v2/styles.d.ts +25 -0
  135. package/types/FormFieldLayout/v2/styles.d.ts.map +1 -0
  136. package/types/FormFieldMessage/{index.d.ts → v1/index.d.ts} +2 -2
  137. package/types/FormFieldMessage/v1/index.d.ts.map +1 -0
  138. package/types/FormFieldMessage/{props.d.ts → v1/props.d.ts} +1 -1
  139. package/types/FormFieldMessage/v1/props.d.ts.map +1 -0
  140. package/types/FormFieldMessage/v1/styles.d.ts.map +1 -0
  141. package/types/FormFieldMessage/v1/theme.d.ts.map +1 -0
  142. package/types/FormFieldMessage/v2/index.d.ts +24 -0
  143. package/types/FormFieldMessage/v2/index.d.ts.map +1 -0
  144. package/types/FormFieldMessage/v2/props.d.ts +16 -0
  145. package/types/FormFieldMessage/v2/props.d.ts.map +1 -0
  146. package/types/FormFieldMessage/v2/styles.d.ts +18 -0
  147. package/types/FormFieldMessage/v2/styles.d.ts.map +1 -0
  148. package/types/FormFieldMessages/{index.d.ts → v1/index.d.ts} +1 -1
  149. package/types/FormFieldMessages/v1/index.d.ts.map +1 -0
  150. package/types/FormFieldMessages/{props.d.ts → v1/props.d.ts} +1 -1
  151. package/types/FormFieldMessages/v1/props.d.ts.map +1 -0
  152. package/types/FormFieldMessages/v1/styles.d.ts.map +1 -0
  153. package/types/FormFieldMessages/v1/theme.d.ts.map +1 -0
  154. package/types/FormFieldMessages/v2/index.d.ts +36 -0
  155. package/types/FormFieldMessages/v2/index.d.ts.map +1 -0
  156. package/types/FormFieldMessages/v2/props.d.ts +25 -0
  157. package/types/FormFieldMessages/v2/props.d.ts.map +1 -0
  158. package/types/FormFieldMessages/v2/styles.d.ts +14 -0
  159. package/types/FormFieldMessages/v2/styles.d.ts.map +1 -0
  160. package/types/exports/a.d.ts +14 -0
  161. package/types/exports/a.d.ts.map +1 -0
  162. package/types/exports/b.d.ts +14 -0
  163. package/types/exports/b.d.ts.map +1 -0
  164. package/types/utils/v1/FormPropTypes.d.ts.map +1 -0
  165. package/types/FormField/index.d.ts.map +0 -1
  166. package/types/FormField/props.d.ts.map +0 -1
  167. package/types/FormFieldGroup/index.d.ts.map +0 -1
  168. package/types/FormFieldGroup/props.d.ts.map +0 -1
  169. package/types/FormFieldGroup/styles.d.ts.map +0 -1
  170. package/types/FormFieldGroup/theme.d.ts.map +0 -1
  171. package/types/FormFieldLabel/index.d.ts.map +0 -1
  172. package/types/FormFieldLabel/props.d.ts.map +0 -1
  173. package/types/FormFieldLabel/styles.d.ts.map +0 -1
  174. package/types/FormFieldLabel/theme.d.ts.map +0 -1
  175. package/types/FormFieldLayout/index.d.ts.map +0 -1
  176. package/types/FormFieldLayout/props.d.ts.map +0 -1
  177. package/types/FormFieldLayout/styles.d.ts.map +0 -1
  178. package/types/FormFieldLayout/theme.d.ts.map +0 -1
  179. package/types/FormFieldMessage/index.d.ts.map +0 -1
  180. package/types/FormFieldMessage/props.d.ts.map +0 -1
  181. package/types/FormFieldMessage/styles.d.ts.map +0 -1
  182. package/types/FormFieldMessage/theme.d.ts.map +0 -1
  183. package/types/FormFieldMessages/index.d.ts.map +0 -1
  184. package/types/FormFieldMessages/props.d.ts.map +0 -1
  185. package/types/FormFieldMessages/styles.d.ts.map +0 -1
  186. package/types/FormFieldMessages/theme.d.ts.map +0 -1
  187. package/types/FormPropTypes.d.ts.map +0 -1
  188. package/types/index.d.ts +0 -14
  189. package/types/index.d.ts.map +0 -1
  190. /package/es/FormField/{props.js → v1/props.js} +0 -0
  191. /package/es/FormFieldGroup/{props.js → v1/props.js} +0 -0
  192. /package/es/FormFieldGroup/{styles.js → v1/styles.js} +0 -0
  193. /package/es/FormFieldGroup/{theme.js → v1/theme.js} +0 -0
  194. /package/es/FormFieldLabel/{props.js → v1/props.js} +0 -0
  195. /package/es/FormFieldLabel/{styles.js → v1/styles.js} +0 -0
  196. /package/es/FormFieldLabel/{theme.js → v1/theme.js} +0 -0
  197. /package/es/FormFieldLayout/{props.js → v1/props.js} +0 -0
  198. /package/es/FormFieldLayout/{theme.js → v1/theme.js} +0 -0
  199. /package/es/FormFieldMessage/{props.js → v1/props.js} +0 -0
  200. /package/es/FormFieldMessage/{styles.js → v1/styles.js} +0 -0
  201. /package/es/FormFieldMessage/{theme.js → v1/theme.js} +0 -0
  202. /package/es/FormFieldMessages/{props.js → v1/props.js} +0 -0
  203. /package/es/FormFieldMessages/{styles.js → v1/styles.js} +0 -0
  204. /package/es/FormFieldMessages/{theme.js → v1/theme.js} +0 -0
  205. /package/es/{FormPropTypes.js → utils/v1/FormPropTypes.js} +0 -0
  206. /package/lib/FormField/{props.js → v1/props.js} +0 -0
  207. /package/lib/FormFieldGroup/{props.js → v1/props.js} +0 -0
  208. /package/lib/FormFieldGroup/{styles.js → v1/styles.js} +0 -0
  209. /package/lib/FormFieldGroup/{theme.js → v1/theme.js} +0 -0
  210. /package/lib/FormFieldLabel/{props.js → v1/props.js} +0 -0
  211. /package/lib/FormFieldLabel/{styles.js → v1/styles.js} +0 -0
  212. /package/lib/FormFieldLabel/{theme.js → v1/theme.js} +0 -0
  213. /package/lib/FormFieldLayout/{props.js → v1/props.js} +0 -0
  214. /package/lib/FormFieldLayout/{theme.js → v1/theme.js} +0 -0
  215. /package/lib/FormFieldMessage/{props.js → v1/props.js} +0 -0
  216. /package/lib/FormFieldMessage/{styles.js → v1/styles.js} +0 -0
  217. /package/lib/FormFieldMessage/{theme.js → v1/theme.js} +0 -0
  218. /package/lib/FormFieldMessages/{props.js → v1/props.js} +0 -0
  219. /package/lib/FormFieldMessages/{styles.js → v1/styles.js} +0 -0
  220. /package/lib/FormFieldMessages/{theme.js → v1/theme.js} +0 -0
  221. /package/lib/{FormPropTypes.js → utils/v1/FormPropTypes.js} +0 -0
  222. /package/src/FormField/{README.md → v1/README.md} +0 -0
  223. /package/src/FormFieldGroup/{README.md → v1/README.md} +0 -0
  224. /package/src/FormFieldGroup/{styles.ts → v1/styles.ts} +0 -0
  225. /package/src/FormFieldGroup/{theme.ts → v1/theme.ts} +0 -0
  226. /package/src/FormFieldLabel/{props.ts → v1/props.ts} +0 -0
  227. /package/src/FormFieldLabel/{styles.ts → v1/styles.ts} +0 -0
  228. /package/src/FormFieldLabel/{theme.ts → v1/theme.ts} +0 -0
  229. /package/src/FormFieldLayout/{theme.ts → v1/theme.ts} +0 -0
  230. /package/src/FormFieldMessage/{theme.ts → v1/theme.ts} +0 -0
  231. /package/src/FormFieldMessages/{styles.ts → v1/styles.ts} +0 -0
  232. /package/src/FormFieldMessages/{theme.ts → v1/theme.ts} +0 -0
  233. /package/src/{FormPropTypes.ts → utils/v1/FormPropTypes.ts} +0 -0
  234. /package/types/FormField/{index.d.ts → v1/index.d.ts} +0 -0
  235. /package/types/FormFieldGroup/{styles.d.ts → v1/styles.d.ts} +0 -0
  236. /package/types/FormFieldGroup/{theme.d.ts → v1/theme.d.ts} +0 -0
  237. /package/types/FormFieldLabel/{index.d.ts → v1/index.d.ts} +0 -0
  238. /package/types/FormFieldLabel/{props.d.ts → v1/props.d.ts} +0 -0
  239. /package/types/FormFieldLabel/{styles.d.ts → v1/styles.d.ts} +0 -0
  240. /package/types/FormFieldLabel/{theme.d.ts → v1/theme.d.ts} +0 -0
  241. /package/types/FormFieldLayout/{index.d.ts → v1/index.d.ts} +0 -0
  242. /package/types/FormFieldLayout/{styles.d.ts → v1/styles.d.ts} +0 -0
  243. /package/types/FormFieldLayout/{theme.d.ts → v1/theme.d.ts} +0 -0
  244. /package/types/FormFieldMessage/{styles.d.ts → v1/styles.d.ts} +0 -0
  245. /package/types/FormFieldMessage/{theme.d.ts → v1/theme.d.ts} +0 -0
  246. /package/types/FormFieldMessages/{styles.d.ts → v1/styles.d.ts} +0 -0
  247. /package/types/FormFieldMessages/{theme.d.ts → v1/theme.d.ts} +0 -0
  248. /package/types/{FormPropTypes.d.ts → utils/v1/FormPropTypes.d.ts} +0 -0
@@ -0,0 +1,207 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ const _excluded = ["inline", "layout", "as", "labelAlign", "vAlign", "label", "messages", "messagesId", "children", "width", "elementRef", "inputContainerRef", "isGroup", "isRequired", "margin", "disabled", "readOnly", "themeOverride"];
4
+ /*
5
+ * The MIT License (MIT)
6
+ *
7
+ * Copyright (c) 2015 - present Instructure, Inc.
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in all
17
+ * copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ * SOFTWARE.
26
+ */
27
+
28
+ import { forwardRef, useEffect, useState, useCallback } from 'react';
29
+ import { hasVisibleChildren } from '@instructure/ui-a11y-utils';
30
+ import { omitProps, useDeterministicId } from '@instructure/ui-react-utils';
31
+ import { useStyle } from '@instructure/emotion';
32
+ import { FormFieldMessages } from "../../FormFieldMessages/v2/index.js";
33
+ import generateStyle from "./styles.js";
34
+ import { allowedProps } from "./props.js";
35
+ import { jsxs as _jsxs, Fragment as _Fragment, jsx as _jsx } from "@emotion/react/jsx-runtime";
36
+ /**
37
+ ---
38
+ parent: FormField
39
+ ---
40
+ **/
41
+ const FormFieldLayout = /*#__PURE__*/forwardRef((props, ref) => {
42
+ var _FormFieldMessages;
43
+ const _props$inline = props.inline,
44
+ inline = _props$inline === void 0 ? false : _props$inline,
45
+ _props$layout = props.layout,
46
+ layout = _props$layout === void 0 ? 'stacked' : _props$layout,
47
+ _props$as = props.as,
48
+ as = _props$as === void 0 ? 'label' : _props$as,
49
+ _props$labelAlign = props.labelAlign,
50
+ labelAlign = _props$labelAlign === void 0 ? 'end' : _props$labelAlign,
51
+ vAlign = props.vAlign,
52
+ label = props.label,
53
+ messages = props.messages,
54
+ messagesIdProp = props.messagesId,
55
+ children = props.children,
56
+ width = props.width,
57
+ elementRef = props.elementRef,
58
+ inputContainerRef = props.inputContainerRef,
59
+ isGroup = props.isGroup,
60
+ _props$isRequired = props.isRequired,
61
+ isRequired = _props$isRequired === void 0 ? false : _props$isRequired,
62
+ margin = props.margin,
63
+ _props$disabled = props.disabled,
64
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
65
+ _props$readOnly = props.readOnly,
66
+ readOnly = _props$readOnly === void 0 ? false : _props$readOnly,
67
+ themeOverride = props.themeOverride,
68
+ rest = _objectWithoutProperties(props, _excluded);
69
+
70
+ // Deterministic ID generation
71
+ const _useState = useState(),
72
+ _useState2 = _slicedToArray(_useState, 2),
73
+ deterministicId = _useState2[0],
74
+ setDeterministicId = _useState2[1];
75
+ const getId = useDeterministicId('FormFieldLayout');
76
+ useEffect(() => {
77
+ setDeterministicId(getId());
78
+ }, []);
79
+ const messagesId = messagesIdProp || deterministicId;
80
+ const labelId = deterministicId ? `${deterministicId}-Label` : void 0;
81
+
82
+ // Filter out error and success messages when disabled or readOnly
83
+ const filteredMessages = disabled || readOnly ? messages === null || messages === void 0 ? void 0 : messages.filter(msg => msg.type !== 'error' && msg.type !== 'newError' && msg.type !== 'success') : messages;
84
+
85
+ // Compute style props
86
+ const hasMessages = filteredMessages && filteredMessages.length > 0 ? filteredMessages.some(msg => {
87
+ if (msg.text) {
88
+ if (typeof msg.text === 'string') {
89
+ return msg.text.length > 0;
90
+ }
91
+ return true;
92
+ }
93
+ return false;
94
+ }) : false;
95
+ const hasVisibleLabel = label ? hasVisibleChildren(label) : false;
96
+ const hasErrorMsgAndIsGroup = !!(filteredMessages !== null && filteredMessages !== void 0 && filteredMessages.find(m => m.type === 'error' || m.type === 'newError')) && !!isGroup;
97
+ const invalid = !!(filteredMessages !== null && filteredMessages !== void 0 && filteredMessages.find(m => m.type === 'error' || m.type === 'newError'));
98
+
99
+ // Styles
100
+ const styles = useStyle({
101
+ generateStyle,
102
+ themeOverride,
103
+ params: {
104
+ hasMessages,
105
+ hasVisibleLabel,
106
+ hasErrorMsgAndIsGroup,
107
+ inline,
108
+ layout,
109
+ vAlign,
110
+ labelAlign,
111
+ margin,
112
+ messages: filteredMessages,
113
+ isRequired,
114
+ invalid
115
+ },
116
+ componentId: 'FormFieldLayout',
117
+ displayName: 'FormFieldLayout'
118
+ });
119
+ const ElementType = as;
120
+ const handleRef = useCallback(el => {
121
+ if (typeof ref === 'function') {
122
+ ref(el);
123
+ } else if (ref) {
124
+ const refObject = ref;
125
+ refObject.current = el;
126
+ }
127
+ if (typeof elementRef === 'function') {
128
+ elementRef(el);
129
+ }
130
+ }, [ref, elementRef]);
131
+ const handleInputContainerRef = useCallback(node => {
132
+ if (typeof inputContainerRef === 'function') {
133
+ inputContainerRef(node);
134
+ }
135
+ }, [inputContainerRef]);
136
+ const renderLabel = () => {
137
+ const labelContent = hasVisibleLabel ? _jsxs(_Fragment, {
138
+ children: [label, isRequired && _jsxs("span", {
139
+ css: invalid ? styles === null || styles === void 0 ? void 0 : styles.requiredAsterisk : {},
140
+ "aria-hidden": true,
141
+ children: [' ', "*"]
142
+ })]
143
+ }) : label;
144
+ if (hasVisibleLabel) {
145
+ if (ElementType === 'fieldset') {
146
+ // `legend` has some special built in CSS, this can only be reset
147
+ // this way https://stackoverflow.com/a/65866981/319473
148
+ return _jsx("legend", {
149
+ style: {
150
+ display: 'contents'
151
+ },
152
+ children: _jsx("span", {
153
+ css: styles === null || styles === void 0 ? void 0 : styles.formFieldLabel,
154
+ children: labelContent
155
+ })
156
+ });
157
+ }
158
+ return _jsx("span", {
159
+ css: styles === null || styles === void 0 ? void 0 : styles.formFieldLabel,
160
+ children: labelContent
161
+ });
162
+ } else if (label) {
163
+ if (ElementType === 'fieldset') {
164
+ return _jsx("legend", {
165
+ id: labelId,
166
+ style: {
167
+ display: 'contents'
168
+ },
169
+ children: label
170
+ });
171
+ }
172
+ // needs to be wrapped because it needs an `id`
173
+ return _jsx("div", {
174
+ id: labelId,
175
+ style: {
176
+ display: 'contents'
177
+ },
178
+ children: label
179
+ });
180
+ } else return null;
181
+ };
182
+ const renderVisibleMessages = () => {
183
+ return hasMessages ? _FormFieldMessages || (_FormFieldMessages = _jsx(FormFieldMessages, {
184
+ id: messagesId,
185
+ messages: filteredMessages,
186
+ gridArea: "messages"
187
+ })) : null;
188
+ };
189
+ return _jsxs(ElementType, {
190
+ ...omitProps(rest, [...allowedProps]),
191
+ css: styles === null || styles === void 0 ? void 0 : styles.formFieldLayout,
192
+ "aria-describedby": hasMessages ? messagesId : void 0,
193
+ "aria-errormessage": rest['aria-invalid'] ? messagesId : void 0,
194
+ style: {
195
+ width
196
+ },
197
+ ref: handleRef,
198
+ children: [renderLabel(), hasErrorMsgAndIsGroup && renderVisibleMessages(), _jsx("span", {
199
+ css: styles === null || styles === void 0 ? void 0 : styles.formFieldChildren,
200
+ ref: handleInputContainerRef,
201
+ children: children
202
+ }), !hasErrorMsgAndIsGroup && renderVisibleMessages()]
203
+ });
204
+ });
205
+ FormFieldLayout.displayName = 'FormFieldLayout';
206
+ export default FormFieldLayout;
207
+ export { FormFieldLayout, allowedProps };
@@ -0,0 +1,26 @@
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
+ const allowedProps = ['label', 'id', 'as', 'messages', 'messagesId', 'children', 'inline', 'layout', 'labelAlign', 'width', 'inputContainerRef', 'elementRef', 'margin', 'vAlign', 'isRequired', 'disabled', 'readOnly'];
26
+ export { allowedProps };
@@ -0,0 +1,171 @@
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 { calcSpacingFromShorthand } from '@instructure/emotion';
26
+ const generateGridLayout = (isInlineLayout, hasErrorMsgAndIsGroup, hasVisibleLabel, hasMessages) => {
27
+ if (isInlineLayout) {
28
+ if (hasErrorMsgAndIsGroup) {
29
+ if (hasMessages) {
30
+ return `${hasVisibleLabel ? ' "label messages"' : '. messages'}
31
+ ". controls"`;
32
+ } else {
33
+ return `${hasVisibleLabel ? ' "label controls"' : '. controls'}`;
34
+ }
35
+ } else {
36
+ return `${hasVisibleLabel ? ' "label controls"' : '. controls'}
37
+ ${hasMessages ? ' ". messages"' : ''}`;
38
+ }
39
+ }
40
+ // stacked layout -- in this case we could use a simple `Flex`
41
+ if (hasErrorMsgAndIsGroup) {
42
+ return `${hasVisibleLabel ? ' "label"' : ''}
43
+ ${hasMessages ? ' "messages"' : ''}
44
+ "controls"`;
45
+ } else {
46
+ return `${hasVisibleLabel ? ' "label"' : ''}
47
+ "controls"
48
+ ${hasMessages ? ' "messages"' : ''}`;
49
+ }
50
+ };
51
+ /**
52
+ * ---
53
+ * private: true
54
+ * ---
55
+ * Generates the style object from the theme and provided additional information
56
+ * @param componentTheme The theme variable object.
57
+ * @param params Additional parameters to customize the style.
58
+ * @param sharedTokens Shared token object that stores common values for the theme.
59
+ * @return The final style object, which will be used in the component
60
+ */
61
+ const generateStyle = (componentTheme, params, sharedTokens) => {
62
+ const inline = params.inline,
63
+ layout = params.layout,
64
+ vAlign = params.vAlign,
65
+ labelAlign = params.labelAlign,
66
+ margin = params.margin,
67
+ messages = params.messages;
68
+ const hasMessages = params.hasMessages,
69
+ hasVisibleLabel = params.hasVisibleLabel,
70
+ hasErrorMsgAndIsGroup = params.hasErrorMsgAndIsGroup;
71
+ const cssMargin = calcSpacingFromShorthand(margin, {
72
+ ...sharedTokens.spacing,
73
+ ...sharedTokens.legacy.spacing
74
+ });
75
+ const isInlineLayout = layout === 'inline';
76
+ const hasNonEmptyMessages = messages === null || messages === void 0 ? void 0 : messages.reduce((acc, message) => acc || message.type !== 'screenreader-only', false);
77
+
78
+ // This is quite ugly, we should simplify it
79
+ const gridTemplateAreas = generateGridLayout(isInlineLayout, hasErrorMsgAndIsGroup, hasVisibleLabel, hasMessages);
80
+ let gridTemplateColumns = '100%'; // stacked layout
81
+ if (isInlineLayout) {
82
+ gridTemplateColumns = '1fr 3fr';
83
+ if (inline) {
84
+ gridTemplateColumns = 'auto 3fr';
85
+ }
86
+ }
87
+ const labelStyles = {
88
+ all: 'initial',
89
+ display: 'block',
90
+ gridArea: 'label',
91
+ color: componentTheme.textColor,
92
+ fontFamily: componentTheme.fontFamily,
93
+ fontWeight: componentTheme.fontWeight,
94
+ fontSize: componentTheme.fontSize,
95
+ lineHeight: componentTheme.lineHeight,
96
+ ...(isInlineLayout && {
97
+ margin: '0',
98
+ // when inline add a small padding between the label and the control
99
+ paddingRight: componentTheme.gapPrimitives,
100
+ // and use the horizontal alignment prop
101
+ [`@media screen and (width >= ${componentTheme.stackedOrInlineBreakpoint})`]: {
102
+ textAlign: labelAlign
103
+ }
104
+ })
105
+ };
106
+ let alignItems = 'start';
107
+ if (vAlign == 'top') {
108
+ alignItems = 'start';
109
+ } else if (vAlign == 'middle') {
110
+ alignItems = 'center';
111
+ } else if (vAlign == 'bottom') {
112
+ alignItems = 'end';
113
+ }
114
+ return {
115
+ formFieldLayout: {
116
+ label: 'formFieldLayout',
117
+ all: 'initial',
118
+ border: '0',
119
+ padding: '0',
120
+ margin: cssMargin,
121
+ minWidth: '0',
122
+ direction: 'inherit',
123
+ textAlign: 'start',
124
+ opacity: 'inherit',
125
+ display: 'grid',
126
+ alignItems: alignItems,
127
+ verticalAlign: 'middle',
128
+ // removes margin in inline layouts
129
+ gridTemplateColumns: gridTemplateColumns,
130
+ gridTemplateAreas: gridTemplateAreas,
131
+ [`@media screen and (width < ${componentTheme.stackedOrInlineBreakpoint})`]: {
132
+ // for small screens use the stacked layout
133
+ gridTemplateColumns: '100%',
134
+ gridTemplateAreas: generateGridLayout(false, hasErrorMsgAndIsGroup, hasVisibleLabel, hasMessages)
135
+ },
136
+ columnGap: '0.375rem',
137
+ rowGap: hasNonEmptyMessages ? componentTheme.gapPrimitives : '0',
138
+ width: '100%',
139
+ ...(inline && {
140
+ display: 'inline-grid',
141
+ width: 'auto'
142
+ })
143
+ },
144
+ formFieldLabel: {
145
+ label: 'formFieldLayout__label',
146
+ ...labelStyles,
147
+ // NOTE: needs separate groups for `:is()` and `:-webkit-any()` because of css selector group validation (see https://www.w3.org/TR/selectors-3/#grouping)
148
+ '&:is(label)': labelStyles,
149
+ '&:-webkit-any(label)': labelStyles,
150
+ paddingBottom: hasNonEmptyMessages ? '0' : componentTheme.gapPrimitives
151
+ },
152
+ formFieldChildren: {
153
+ label: 'formFieldLayout__children',
154
+ gridArea: 'controls',
155
+ // add a small margin between the message and the controls
156
+ ...(hasMessages && hasErrorMsgAndIsGroup && {
157
+ marginTop: '0.375rem'
158
+ }),
159
+ ...(isInlineLayout && inline && {
160
+ [`@media screen and (width >= ${componentTheme.stackedOrInlineBreakpoint})`]: {
161
+ justifySelf: 'start'
162
+ }
163
+ })
164
+ },
165
+ requiredAsterisk: {
166
+ label: 'formFieldLayout__requiredAsterisk',
167
+ color: componentTheme.asteriskColor
168
+ }
169
+ };
170
+ };
171
+ export default generateStyle;
@@ -26,7 +26,7 @@ var _dec, _class, _FormFieldMessage, _IconWarningSolid;
26
26
  import { Component } from 'react';
27
27
  import { ScreenReaderContent } from '@instructure/ui-a11y-content';
28
28
  import { IconWarningSolid } from '@instructure/ui-icons';
29
- import { withStyle } from '@instructure/emotion';
29
+ import { withStyleLegacy as withStyle } from '@instructure/emotion';
30
30
  import generateStyle from "./styles.js";
31
31
  import generateComponentTheme from "./theme.js";
32
32
  import { allowedProps } from "./props.js";
@@ -0,0 +1,96 @@
1
+ var _AlertCircleInstUIIco, _CheckCircle2InstUIIc;
2
+ /*
3
+ * The MIT License (MIT)
4
+ *
5
+ * Copyright (c) 2015 - present Instructure, Inc.
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in all
15
+ * copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ * SOFTWARE.
24
+ */
25
+
26
+ import { forwardRef } from 'react';
27
+ import { ScreenReaderContent } from '@instructure/ui-a11y-content';
28
+ import { AlertCircleInstUIIcon, CheckCircle2InstUIIcon } from '@instructure/ui-icons';
29
+ import { useStyle } from '@instructure/emotion';
30
+ import generateStyle from "./styles.js";
31
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
32
+ /**
33
+ ---
34
+ parent: FormField
35
+ ---
36
+
37
+ This is a helper component that is used by most of the custom form
38
+ components. In most cases it shouldn't be used directly.
39
+
40
+ ```js
41
+ ---
42
+ type: example
43
+ ---
44
+ <FormFieldMessage variant="error">Invalid value</FormFieldMessage>
45
+ ```
46
+ **/
47
+ const FormFieldMessage = /*#__PURE__*/forwardRef(({
48
+ variant = 'hint',
49
+ children,
50
+ themeOverride
51
+ }, ref) => {
52
+ const styles = useStyle({
53
+ generateStyle,
54
+ themeOverride,
55
+ params: {
56
+ variant
57
+ },
58
+ componentId: 'FormFieldMessage',
59
+ displayName: 'FormFieldMessage'
60
+ });
61
+ const handleRef = el => {
62
+ if (typeof ref === 'function') {
63
+ ref(el);
64
+ } else if (ref) {
65
+ const refObject = ref;
66
+ refObject.current = el;
67
+ }
68
+ };
69
+ const isErrorVariant = variant === 'error' || variant === 'newError';
70
+ const shouldShowIcon = (isErrorVariant || variant === 'success') && children;
71
+ return variant !== 'screenreader-only' ? _jsxs("span", {
72
+ css: {
73
+ display: 'flex'
74
+ },
75
+ children: [shouldShowIcon && _jsx("span", {
76
+ css: styles === null || styles === void 0 ? void 0 : styles.icon,
77
+ children: isErrorVariant ? _AlertCircleInstUIIco || (_AlertCircleInstUIIco = _jsx(AlertCircleInstUIIcon, {
78
+ size: "sm",
79
+ color: "errorColor"
80
+ })) : _CheckCircle2InstUIIc || (_CheckCircle2InstUIIc = _jsx(CheckCircle2InstUIIcon, {
81
+ size: "sm",
82
+ color: "successColor"
83
+ }))
84
+ }), _jsx("span", {
85
+ css: styles === null || styles === void 0 ? void 0 : styles.formFieldMessage,
86
+ ref: handleRef,
87
+ children: children
88
+ })]
89
+ }) : _jsx(ScreenReaderContent, {
90
+ elementRef: handleRef,
91
+ children: children
92
+ });
93
+ });
94
+ FormFieldMessage.displayName = 'FormFieldMessage';
95
+ export default FormFieldMessage;
96
+ export { FormFieldMessage };
@@ -0,0 +1,26 @@
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
+ const allowedProps = ['variant', 'children'];
26
+ export { allowedProps };
@@ -0,0 +1,69 @@
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
+ /**
26
+ * ---
27
+ * private: true
28
+ * ---
29
+ * Generates the style object from the theme and provided additional information
30
+ * @param {Object} componentTheme The theme variable object.
31
+ * @param {Object} props the props of the component, the style is applied to
32
+ * @param {Object} state the state of the component, the style is applied to
33
+ * @return {Object} The final style object, which will be used in the component
34
+ */
35
+ const generateStyle = (componentTheme, params, sharedTokens) => {
36
+ const variant = params.variant;
37
+ const variants = {
38
+ hint: {
39
+ color: componentTheme.hintTextColor
40
+ },
41
+ error: {
42
+ color: componentTheme.errorTextColor
43
+ },
44
+ newError: {
45
+ color: componentTheme.errorTextColor
46
+ },
47
+ success: {
48
+ color: componentTheme.successTextColor
49
+ },
50
+ 'screenreader-only': {}
51
+ };
52
+ return {
53
+ icon: {
54
+ fontSize: componentTheme.fontSize,
55
+ marginRight: sharedTokens.spacing.general.spaceXs,
56
+ lineHeight: 1.25
57
+ },
58
+ formFieldMessage: {
59
+ label: 'formFieldMessage',
60
+ fontFamily: componentTheme.fontFamily,
61
+ fontWeight: componentTheme.fontWeight,
62
+ fontSize: componentTheme.fontSize,
63
+ lineHeight: componentTheme.lineHeight,
64
+ display: 'block',
65
+ ...variants[variant]
66
+ }
67
+ };
68
+ };
69
+ export default generateStyle;
@@ -25,8 +25,8 @@ var _dec, _class, _FormFieldMessages;
25
25
 
26
26
  import { Component } from 'react';
27
27
  import { omitProps } from '@instructure/ui-react-utils';
28
- import { withStyle } from '@instructure/emotion';
29
- import { FormFieldMessage } from "../FormFieldMessage/index.js";
28
+ import { withStyleLegacy as withStyle } from '@instructure/emotion';
29
+ import { FormFieldMessage } from "../../FormFieldMessage/v1/index.js";
30
30
  import generateStyle from "./styles.js";
31
31
  import generateComponentTheme from "./theme.js";
32
32
  import { allowedProps } from "./props.js";