@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,177 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _emotion = require("@instructure/emotion");
8
+ /*
9
+ * The MIT License (MIT)
10
+ *
11
+ * Copyright (c) 2015 - present Instructure, Inc.
12
+ *
13
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ * of this software and associated documentation files (the "Software"), to deal
15
+ * in the Software without restriction, including without limitation the rights
16
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ * copies of the Software, and to permit persons to whom the Software is
18
+ * furnished to do so, subject to the following conditions:
19
+ *
20
+ * The above copyright notice and this permission notice shall be included in all
21
+ * copies or substantial portions of the Software.
22
+ *
23
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ * SOFTWARE.
30
+ */
31
+
32
+ const generateGridLayout = (isInlineLayout, hasErrorMsgAndIsGroup, hasVisibleLabel, hasMessages) => {
33
+ if (isInlineLayout) {
34
+ if (hasErrorMsgAndIsGroup) {
35
+ if (hasMessages) {
36
+ return `${hasVisibleLabel ? ' "label messages"' : '. messages'}
37
+ ". controls"`;
38
+ } else {
39
+ return `${hasVisibleLabel ? ' "label controls"' : '. controls'}`;
40
+ }
41
+ } else {
42
+ return `${hasVisibleLabel ? ' "label controls"' : '. controls'}
43
+ ${hasMessages ? ' ". messages"' : ''}`;
44
+ }
45
+ }
46
+ // stacked layout -- in this case we could use a simple `Flex`
47
+ if (hasErrorMsgAndIsGroup) {
48
+ return `${hasVisibleLabel ? ' "label"' : ''}
49
+ ${hasMessages ? ' "messages"' : ''}
50
+ "controls"`;
51
+ } else {
52
+ return `${hasVisibleLabel ? ' "label"' : ''}
53
+ "controls"
54
+ ${hasMessages ? ' "messages"' : ''}`;
55
+ }
56
+ };
57
+ /**
58
+ * ---
59
+ * private: true
60
+ * ---
61
+ * Generates the style object from the theme and provided additional information
62
+ * @param componentTheme The theme variable object.
63
+ * @param params Additional parameters to customize the style.
64
+ * @param sharedTokens Shared token object that stores common values for the theme.
65
+ * @return The final style object, which will be used in the component
66
+ */
67
+ const generateStyle = (componentTheme, params, sharedTokens) => {
68
+ const inline = params.inline,
69
+ layout = params.layout,
70
+ vAlign = params.vAlign,
71
+ labelAlign = params.labelAlign,
72
+ margin = params.margin,
73
+ messages = params.messages;
74
+ const hasMessages = params.hasMessages,
75
+ hasVisibleLabel = params.hasVisibleLabel,
76
+ hasErrorMsgAndIsGroup = params.hasErrorMsgAndIsGroup;
77
+ const cssMargin = (0, _emotion.calcSpacingFromShorthand)(margin, {
78
+ ...sharedTokens.spacing,
79
+ ...sharedTokens.legacy.spacing
80
+ });
81
+ const isInlineLayout = layout === 'inline';
82
+ const hasNonEmptyMessages = messages === null || messages === void 0 ? void 0 : messages.reduce((acc, message) => acc || message.type !== 'screenreader-only', false);
83
+
84
+ // This is quite ugly, we should simplify it
85
+ const gridTemplateAreas = generateGridLayout(isInlineLayout, hasErrorMsgAndIsGroup, hasVisibleLabel, hasMessages);
86
+ let gridTemplateColumns = '100%'; // stacked layout
87
+ if (isInlineLayout) {
88
+ gridTemplateColumns = '1fr 3fr';
89
+ if (inline) {
90
+ gridTemplateColumns = 'auto 3fr';
91
+ }
92
+ }
93
+ const labelStyles = {
94
+ all: 'initial',
95
+ display: 'block',
96
+ gridArea: 'label',
97
+ color: componentTheme.textColor,
98
+ fontFamily: componentTheme.fontFamily,
99
+ fontWeight: componentTheme.fontWeight,
100
+ fontSize: componentTheme.fontSize,
101
+ lineHeight: componentTheme.lineHeight,
102
+ ...(isInlineLayout && {
103
+ margin: '0',
104
+ // when inline add a small padding between the label and the control
105
+ paddingRight: componentTheme.gapPrimitives,
106
+ // and use the horizontal alignment prop
107
+ [`@media screen and (width >= ${componentTheme.stackedOrInlineBreakpoint})`]: {
108
+ textAlign: labelAlign
109
+ }
110
+ })
111
+ };
112
+ let alignItems = 'start';
113
+ if (vAlign == 'top') {
114
+ alignItems = 'start';
115
+ } else if (vAlign == 'middle') {
116
+ alignItems = 'center';
117
+ } else if (vAlign == 'bottom') {
118
+ alignItems = 'end';
119
+ }
120
+ return {
121
+ formFieldLayout: {
122
+ label: 'formFieldLayout',
123
+ all: 'initial',
124
+ border: '0',
125
+ padding: '0',
126
+ margin: cssMargin,
127
+ minWidth: '0',
128
+ direction: 'inherit',
129
+ textAlign: 'start',
130
+ opacity: 'inherit',
131
+ display: 'grid',
132
+ alignItems: alignItems,
133
+ verticalAlign: 'middle',
134
+ // removes margin in inline layouts
135
+ gridTemplateColumns: gridTemplateColumns,
136
+ gridTemplateAreas: gridTemplateAreas,
137
+ [`@media screen and (width < ${componentTheme.stackedOrInlineBreakpoint})`]: {
138
+ // for small screens use the stacked layout
139
+ gridTemplateColumns: '100%',
140
+ gridTemplateAreas: generateGridLayout(false, hasErrorMsgAndIsGroup, hasVisibleLabel, hasMessages)
141
+ },
142
+ columnGap: '0.375rem',
143
+ rowGap: hasNonEmptyMessages ? componentTheme.gapPrimitives : '0',
144
+ width: '100%',
145
+ ...(inline && {
146
+ display: 'inline-grid',
147
+ width: 'auto'
148
+ })
149
+ },
150
+ formFieldLabel: {
151
+ label: 'formFieldLayout__label',
152
+ ...labelStyles,
153
+ // NOTE: needs separate groups for `:is()` and `:-webkit-any()` because of css selector group validation (see https://www.w3.org/TR/selectors-3/#grouping)
154
+ '&:is(label)': labelStyles,
155
+ '&:-webkit-any(label)': labelStyles,
156
+ paddingBottom: hasNonEmptyMessages ? '0' : componentTheme.gapPrimitives
157
+ },
158
+ formFieldChildren: {
159
+ label: 'formFieldLayout__children',
160
+ gridArea: 'controls',
161
+ // add a small margin between the message and the controls
162
+ ...(hasMessages && hasErrorMsgAndIsGroup && {
163
+ marginTop: '0.375rem'
164
+ }),
165
+ ...(isInlineLayout && inline && {
166
+ [`@media screen and (width >= ${componentTheme.stackedOrInlineBreakpoint})`]: {
167
+ justifySelf: 'start'
168
+ }
169
+ })
170
+ },
171
+ requiredAsterisk: {
172
+ label: 'formFieldLayout__requiredAsterisk',
173
+ color: componentTheme.asteriskColor
174
+ }
175
+ };
176
+ };
177
+ var _default = exports.default = generateStyle;
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = exports.FormFieldMessage = void 0;
8
8
  var _react = require("react");
9
9
  var _ScreenReaderContent = require("@instructure/ui-a11y-content/lib/ScreenReaderContent");
10
- var _IconWarningSolid2 = require("@instructure/ui-icons/lib/IconWarningSolid.js");
10
+ var _IconWarningSolid2 = require("@instructure/ui-icons/lib/generated/IconWarningSolid.js");
11
11
  var _emotion = require("@instructure/emotion");
12
12
  var _styles = _interopRequireDefault(require("./styles"));
13
13
  var _theme = _interopRequireDefault(require("./theme"));
@@ -52,7 +52,7 @@ type: example
52
52
  <FormFieldMessage variant="error">Invalid value</FormFieldMessage>
53
53
  ```
54
54
  **/
55
- let FormFieldMessage = exports.FormFieldMessage = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_FormFieldMessage = class FormFieldMessage extends _react.Component {
55
+ let FormFieldMessage = exports.FormFieldMessage = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = (_FormFieldMessage = class FormFieldMessage extends _react.Component {
56
56
  constructor(...args) {
57
57
  super(...args);
58
58
  this.ref = null;
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = exports.FormFieldMessage = void 0;
8
+ var _react = require("react");
9
+ var _ScreenReaderContent = require("@instructure/ui-a11y-content/lib/ScreenReaderContent");
10
+ var _uiIcons = require("@instructure/ui-icons");
11
+ var _emotion = require("@instructure/emotion");
12
+ var _styles = _interopRequireDefault(require("./styles"));
13
+ var _jsxRuntime = require("@emotion/react/jsx-runtime");
14
+ var _AlertCircleInstUIIco, _CheckCircle2InstUIIc;
15
+ /*
16
+ * The MIT License (MIT)
17
+ *
18
+ * Copyright (c) 2015 - present Instructure, Inc.
19
+ *
20
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
21
+ * of this software and associated documentation files (the "Software"), to deal
22
+ * in the Software without restriction, including without limitation the rights
23
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
24
+ * copies of the Software, and to permit persons to whom the Software is
25
+ * furnished to do so, subject to the following conditions:
26
+ *
27
+ * The above copyright notice and this permission notice shall be included in all
28
+ * copies or substantial portions of the Software.
29
+ *
30
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
31
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
32
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
33
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
34
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
35
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
36
+ * SOFTWARE.
37
+ */
38
+ /**
39
+ ---
40
+ parent: FormField
41
+ ---
42
+
43
+ This is a helper component that is used by most of the custom form
44
+ components. In most cases it shouldn't be used directly.
45
+
46
+ ```js
47
+ ---
48
+ type: example
49
+ ---
50
+ <FormFieldMessage variant="error">Invalid value</FormFieldMessage>
51
+ ```
52
+ **/
53
+ const FormFieldMessage = exports.FormFieldMessage = /*#__PURE__*/(0, _react.forwardRef)(({
54
+ variant = 'hint',
55
+ children,
56
+ themeOverride
57
+ }, ref) => {
58
+ const styles = (0, _emotion.useStyle)({
59
+ generateStyle: _styles.default,
60
+ themeOverride,
61
+ params: {
62
+ variant
63
+ },
64
+ componentId: 'FormFieldMessage',
65
+ displayName: 'FormFieldMessage'
66
+ });
67
+ const handleRef = el => {
68
+ if (typeof ref === 'function') {
69
+ ref(el);
70
+ } else if (ref) {
71
+ const refObject = ref;
72
+ refObject.current = el;
73
+ }
74
+ };
75
+ const isErrorVariant = variant === 'error' || variant === 'newError';
76
+ const shouldShowIcon = (isErrorVariant || variant === 'success') && children;
77
+ return variant !== 'screenreader-only' ? (0, _jsxRuntime.jsxs)("span", {
78
+ css: {
79
+ display: 'flex'
80
+ },
81
+ children: [shouldShowIcon && (0, _jsxRuntime.jsx)("span", {
82
+ css: styles === null || styles === void 0 ? void 0 : styles.icon,
83
+ children: isErrorVariant ? _AlertCircleInstUIIco || (_AlertCircleInstUIIco = (0, _jsxRuntime.jsx)(_uiIcons.AlertCircleInstUIIcon, {
84
+ size: "sm",
85
+ color: "errorColor"
86
+ })) : _CheckCircle2InstUIIc || (_CheckCircle2InstUIIc = (0, _jsxRuntime.jsx)(_uiIcons.CheckCircle2InstUIIcon, {
87
+ size: "sm",
88
+ color: "successColor"
89
+ }))
90
+ }), (0, _jsxRuntime.jsx)("span", {
91
+ css: styles === null || styles === void 0 ? void 0 : styles.formFieldMessage,
92
+ ref: handleRef,
93
+ children: children
94
+ })]
95
+ }) : (0, _jsxRuntime.jsx)(_ScreenReaderContent.ScreenReaderContent, {
96
+ elementRef: handleRef,
97
+ children: children
98
+ });
99
+ });
100
+ FormFieldMessage.displayName = 'FormFieldMessage';
101
+ var _default = exports.default = FormFieldMessage;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.allowedProps = void 0;
7
+ /*
8
+ * The MIT License (MIT)
9
+ *
10
+ * Copyright (c) 2015 - present Instructure, Inc.
11
+ *
12
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ * of this software and associated documentation files (the "Software"), to deal
14
+ * in the Software without restriction, including without limitation the rights
15
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ * copies of the Software, and to permit persons to whom the Software is
17
+ * furnished to do so, subject to the following conditions:
18
+ *
19
+ * The above copyright notice and this permission notice shall be included in all
20
+ * copies or substantial portions of the Software.
21
+ *
22
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ * SOFTWARE.
29
+ */
30
+
31
+ const allowedProps = exports.allowedProps = ['variant', 'children'];
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ /*
8
+ * The MIT License (MIT)
9
+ *
10
+ * Copyright (c) 2015 - present Instructure, Inc.
11
+ *
12
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ * of this software and associated documentation files (the "Software"), to deal
14
+ * in the Software without restriction, including without limitation the rights
15
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ * copies of the Software, and to permit persons to whom the Software is
17
+ * furnished to do so, subject to the following conditions:
18
+ *
19
+ * The above copyright notice and this permission notice shall be included in all
20
+ * copies or substantial portions of the Software.
21
+ *
22
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ * SOFTWARE.
29
+ */
30
+
31
+ /**
32
+ * ---
33
+ * private: true
34
+ * ---
35
+ * Generates the style object from the theme and provided additional information
36
+ * @param {Object} componentTheme The theme variable object.
37
+ * @param {Object} props the props of the component, the style is applied to
38
+ * @param {Object} state the state of the component, the style is applied to
39
+ * @return {Object} The final style object, which will be used in the component
40
+ */
41
+ const generateStyle = (componentTheme, params, sharedTokens) => {
42
+ const variant = params.variant;
43
+ const variants = {
44
+ hint: {
45
+ color: componentTheme.hintTextColor
46
+ },
47
+ error: {
48
+ color: componentTheme.errorTextColor
49
+ },
50
+ newError: {
51
+ color: componentTheme.errorTextColor
52
+ },
53
+ success: {
54
+ color: componentTheme.successTextColor
55
+ },
56
+ 'screenreader-only': {}
57
+ };
58
+ return {
59
+ icon: {
60
+ fontSize: componentTheme.fontSize,
61
+ marginRight: sharedTokens.spacing.general.spaceXs,
62
+ lineHeight: 1.25
63
+ },
64
+ formFieldMessage: {
65
+ label: 'formFieldMessage',
66
+ fontFamily: componentTheme.fontFamily,
67
+ fontWeight: componentTheme.fontWeight,
68
+ fontSize: componentTheme.fontSize,
69
+ lineHeight: componentTheme.lineHeight,
70
+ display: 'block',
71
+ ...variants[variant]
72
+ }
73
+ };
74
+ };
75
+ var _default = exports.default = generateStyle;
@@ -8,7 +8,7 @@ exports.default = exports.FormFieldMessages = void 0;
8
8
  var _react = require("react");
9
9
  var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
10
10
  var _emotion = require("@instructure/emotion");
11
- var _FormFieldMessage = require("../FormFieldMessage");
11
+ var _v = require("../../FormFieldMessage/v1");
12
12
  var _styles = _interopRequireDefault(require("./styles"));
13
13
  var _theme = _interopRequireDefault(require("./theme"));
14
14
  var _props = require("./props");
@@ -55,7 +55,7 @@ type: example
55
55
  ]} />
56
56
  ```
57
57
  **/
58
- let FormFieldMessages = exports.FormFieldMessages = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_FormFieldMessages = class FormFieldMessages extends _react.Component {
58
+ let FormFieldMessages = exports.FormFieldMessages = (_dec = (0, _emotion.withStyleLegacy)(_styles.default, _theme.default), _dec(_class = (_FormFieldMessages = class FormFieldMessages extends _react.Component {
59
59
  constructor(...args) {
60
60
  super(...args);
61
61
  this.ref = null;
@@ -82,7 +82,7 @@ let FormFieldMessages = exports.FormFieldMessages = (_dec = (0, _emotion.withSty
82
82
  children: messages.map((msg, i) => {
83
83
  return (0, _jsxRuntime.jsx)("span", {
84
84
  css: styles === null || styles === void 0 ? void 0 : styles.message,
85
- children: (0, _jsxRuntime.jsx)(_FormFieldMessage.FormFieldMessage, {
85
+ children: (0, _jsxRuntime.jsx)(_v.FormFieldMessage, {
86
86
  variant: msg.type,
87
87
  children: msg.text
88
88
  })
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = exports.FormFieldMessages = void 0;
8
+ var _react = require("react");
9
+ var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
10
+ var _emotion = require("@instructure/emotion");
11
+ var _v = require("../../FormFieldMessage/v2");
12
+ var _styles = _interopRequireDefault(require("./styles"));
13
+ var _props = require("./props");
14
+ var _jsxRuntime = require("@emotion/react/jsx-runtime");
15
+ var _dec, _class, _FormFieldMessages;
16
+ /*
17
+ * The MIT License (MIT)
18
+ *
19
+ * Copyright (c) 2015 - present Instructure, Inc.
20
+ *
21
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
22
+ * of this software and associated documentation files (the "Software"), to deal
23
+ * in the Software without restriction, including without limitation the rights
24
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25
+ * copies of the Software, and to permit persons to whom the Software is
26
+ * furnished to do so, subject to the following conditions:
27
+ *
28
+ * The above copyright notice and this permission notice shall be included in all
29
+ * copies or substantial portions of the Software.
30
+ *
31
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37
+ * SOFTWARE.
38
+ */
39
+ /**
40
+ ---
41
+ parent: FormField
42
+ ---
43
+
44
+ A FormFieldMessages component
45
+
46
+ ```js
47
+ ---
48
+ type: example
49
+ ---
50
+ <FormFieldMessages messages={[
51
+ { text: 'Invalid name', type: 'error' },
52
+ { text: 'Good job!', type: 'success' },
53
+ { text: 'Full name, first and last', type: 'hint' },
54
+ ]} />
55
+ ```
56
+ **/
57
+ let FormFieldMessages = exports.FormFieldMessages = (_dec = (0, _emotion.withStyle)(_styles.default), _dec(_class = (_FormFieldMessages = class FormFieldMessages extends _react.Component {
58
+ constructor(...args) {
59
+ super(...args);
60
+ this.ref = null;
61
+ this.handleRef = el => {
62
+ this.ref = el;
63
+ };
64
+ }
65
+ componentDidMount() {
66
+ var _this$props$makeStyle, _this$props;
67
+ (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
68
+ }
69
+ componentDidUpdate() {
70
+ var _this$props$makeStyle2, _this$props2;
71
+ (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
72
+ }
73
+ render() {
74
+ const _this$props3 = this.props,
75
+ messages = _this$props3.messages,
76
+ styles = _this$props3.styles;
77
+ return messages && messages.length > 0 ? (0, _jsxRuntime.jsx)("div", {
78
+ css: styles === null || styles === void 0 ? void 0 : styles.formFieldMessages,
79
+ ...(0, _omitProps.omitProps)(this.props, FormFieldMessages.allowedProps),
80
+ ref: this.handleRef,
81
+ children: messages.map((msg, i) => {
82
+ return (0, _jsxRuntime.jsx)("span", {
83
+ css: styles === null || styles === void 0 ? void 0 : styles.message,
84
+ children: (0, _jsxRuntime.jsx)(_v.FormFieldMessage, {
85
+ variant: msg.type,
86
+ children: msg.text
87
+ })
88
+ }, `error${i}`);
89
+ })
90
+ }) : null;
91
+ }
92
+ }, _FormFieldMessages.displayName = "FormFieldMessages", _FormFieldMessages.componentId = 'FormFieldMessages', _FormFieldMessages.allowedProps = _props.allowedProps, _FormFieldMessages.defaultProps = {}, _FormFieldMessages)) || _class);
93
+ var _default = exports.default = FormFieldMessages;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.allowedProps = void 0;
7
+ /*
8
+ * The MIT License (MIT)
9
+ *
10
+ * Copyright (c) 2015 - present Instructure, Inc.
11
+ *
12
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ * of this software and associated documentation files (the "Software"), to deal
14
+ * in the Software without restriction, including without limitation the rights
15
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ * copies of the Software, and to permit persons to whom the Software is
17
+ * furnished to do so, subject to the following conditions:
18
+ *
19
+ * The above copyright notice and this permission notice shall be included in all
20
+ * copies or substantial portions of the Software.
21
+ *
22
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ * SOFTWARE.
29
+ */
30
+
31
+ const allowedProps = exports.allowedProps = ['messages', 'gridArea'];
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ /*
8
+ * The MIT License (MIT)
9
+ *
10
+ * Copyright (c) 2015 - present Instructure, Inc.
11
+ *
12
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ * of this software and associated documentation files (the "Software"), to deal
14
+ * in the Software without restriction, including without limitation the rights
15
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ * copies of the Software, and to permit persons to whom the Software is
17
+ * furnished to do so, subject to the following conditions:
18
+ *
19
+ * The above copyright notice and this permission notice shall be included in all
20
+ * copies or substantial portions of the Software.
21
+ *
22
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ * SOFTWARE.
29
+ */
30
+
31
+ /**
32
+ * ---
33
+ * private: true
34
+ * ---
35
+ * Generates the style object from the theme and provided additional information
36
+ * @param {Object} componentTheme The theme variable object.
37
+ * @param {Object} props the props of the component, the style is applied to
38
+ * @return {Object} The final style object, which will be used in the component
39
+ */
40
+ const generateStyle = (_componentTheme, props) => {
41
+ return {
42
+ formFieldMessages: {
43
+ label: 'formFieldMessages',
44
+ padding: 0,
45
+ display: 'block',
46
+ ...(props.gridArea && {
47
+ gridArea: props.gridArea
48
+ })
49
+ },
50
+ message: {
51
+ label: 'formFieldMessages__message',
52
+ display: 'block'
53
+ }
54
+ };
55
+ };
56
+ var _default = exports.default = generateStyle;
@@ -6,42 +6,42 @@ Object.defineProperty(exports, "__esModule", {
6
6
  Object.defineProperty(exports, "FormField", {
7
7
  enumerable: true,
8
8
  get: function () {
9
- return _FormField.FormField;
9
+ return _v.FormField;
10
10
  }
11
11
  });
12
12
  Object.defineProperty(exports, "FormFieldGroup", {
13
13
  enumerable: true,
14
14
  get: function () {
15
- return _FormFieldGroup.FormFieldGroup;
15
+ return _v6.FormFieldGroup;
16
16
  }
17
17
  });
18
18
  Object.defineProperty(exports, "FormFieldLabel", {
19
19
  enumerable: true,
20
20
  get: function () {
21
- return _FormFieldLabel.FormFieldLabel;
21
+ return _v2.FormFieldLabel;
22
22
  }
23
23
  });
24
24
  Object.defineProperty(exports, "FormFieldLayout", {
25
25
  enumerable: true,
26
26
  get: function () {
27
- return _FormFieldLayout.FormFieldLayout;
27
+ return _v5.FormFieldLayout;
28
28
  }
29
29
  });
30
30
  Object.defineProperty(exports, "FormFieldMessage", {
31
31
  enumerable: true,
32
32
  get: function () {
33
- return _FormFieldMessage.FormFieldMessage;
33
+ return _v3.FormFieldMessage;
34
34
  }
35
35
  });
36
36
  Object.defineProperty(exports, "FormFieldMessages", {
37
37
  enumerable: true,
38
38
  get: function () {
39
- return _FormFieldMessages.FormFieldMessages;
39
+ return _v4.FormFieldMessages;
40
40
  }
41
41
  });
42
- var _FormField = require("./FormField");
43
- var _FormFieldLabel = require("./FormFieldLabel");
44
- var _FormFieldMessage = require("./FormFieldMessage");
45
- var _FormFieldMessages = require("./FormFieldMessages");
46
- var _FormFieldLayout = require("./FormFieldLayout");
47
- var _FormFieldGroup = require("./FormFieldGroup");
42
+ var _v = require("../FormField/v1");
43
+ var _v2 = require("../FormFieldLabel/v1");
44
+ var _v3 = require("../FormFieldMessage/v1");
45
+ var _v4 = require("../FormFieldMessages/v1");
46
+ var _v5 = require("../FormFieldLayout/v1");
47
+ var _v6 = require("../FormFieldGroup/v1");