@workday/canvas-kit-preview-react 6.0.0-alpha.0-next.33 → 6.0.0-alpha.0-next.39

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 (262) hide show
  1. package/dist/commonjs/form-field/index.d.ts +3 -0
  2. package/dist/commonjs/form-field/index.d.ts.map +1 -0
  3. package/dist/commonjs/form-field/index.js +7 -0
  4. package/dist/commonjs/form-field/lib/FormField.d.ts +31 -0
  5. package/dist/commonjs/form-field/lib/FormField.d.ts.map +1 -0
  6. package/dist/commonjs/form-field/lib/FormField.js +51 -0
  7. package/dist/commonjs/form-field/lib/FormFieldHint.d.ts +13 -0
  8. package/dist/commonjs/form-field/lib/FormFieldHint.d.ts.map +1 -0
  9. package/dist/commonjs/form-field/lib/FormFieldHint.js +45 -0
  10. package/dist/commonjs/form-field/lib/FormFieldInput.d.ts +8 -0
  11. package/dist/commonjs/form-field/lib/FormFieldInput.d.ts.map +1 -0
  12. package/dist/commonjs/form-field/lib/FormFieldInput.js +41 -0
  13. package/dist/commonjs/form-field/lib/FormFieldLabel.d.ts +18 -0
  14. package/dist/commonjs/form-field/lib/FormFieldLabel.d.ts.map +1 -0
  15. package/dist/commonjs/form-field/lib/FormFieldLabel.js +51 -0
  16. package/dist/commonjs/form-field/lib/hooks/index.d.ts +6 -0
  17. package/dist/commonjs/form-field/lib/hooks/index.d.ts.map +1 -0
  18. package/dist/commonjs/form-field/lib/hooks/index.js +10 -0
  19. package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.d.ts +15 -0
  20. package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.d.ts.map +1 -0
  21. package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.js +13 -0
  22. package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.d.ts +18 -0
  23. package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.d.ts.map +1 -0
  24. package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.js +16 -0
  25. package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.d.ts +15 -0
  26. package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.d.ts.map +1 -0
  27. package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.js +13 -0
  28. package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.d.ts +36 -0
  29. package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.d.ts.map +1 -0
  30. package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.js +21 -0
  31. package/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.d.ts +9 -0
  32. package/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.d.ts.map +1 -0
  33. package/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.js +24 -0
  34. package/dist/commonjs/index.d.ts +3 -0
  35. package/dist/commonjs/index.d.ts.map +1 -1
  36. package/dist/commonjs/index.js +3 -0
  37. package/dist/commonjs/side-panel/lib/SidePanel.d.ts +24 -2
  38. package/dist/commonjs/side-panel/lib/SidePanel.d.ts.map +1 -1
  39. package/dist/commonjs/side-panel/lib/SidePanel.js +4 -3
  40. package/dist/commonjs/text-area/index.d.ts +2 -0
  41. package/dist/commonjs/text-area/index.d.ts.map +1 -0
  42. package/dist/commonjs/text-area/index.js +6 -0
  43. package/dist/commonjs/text-area/lib/TextArea.d.ts +22 -0
  44. package/dist/commonjs/text-area/lib/TextArea.d.ts.map +1 -0
  45. package/dist/commonjs/text-area/lib/TextArea.js +52 -0
  46. package/dist/commonjs/text-area/lib/TextAreaField.d.ts +8 -0
  47. package/dist/commonjs/text-area/lib/TextAreaField.d.ts.map +1 -0
  48. package/dist/commonjs/text-area/lib/TextAreaField.js +65 -0
  49. package/dist/commonjs/text-area/lib/TextAreaHint.d.ts +5 -0
  50. package/dist/commonjs/text-area/lib/TextAreaHint.d.ts.map +1 -0
  51. package/dist/commonjs/text-area/lib/TextAreaHint.js +4 -0
  52. package/dist/commonjs/text-area/lib/TextAreaLabel.d.ts +5 -0
  53. package/dist/commonjs/text-area/lib/TextAreaLabel.d.ts.map +1 -0
  54. package/dist/commonjs/text-area/lib/TextAreaLabel.js +4 -0
  55. package/dist/commonjs/text-area/lib/hooks/index.d.ts +2 -0
  56. package/dist/commonjs/text-area/lib/hooks/index.d.ts.map +1 -0
  57. package/dist/commonjs/text-area/lib/hooks/index.js +6 -0
  58. package/dist/commonjs/text-area/lib/hooks/useTextAreaModel.d.ts +8 -0
  59. package/dist/commonjs/text-area/lib/hooks/useTextAreaModel.d.ts.map +1 -0
  60. package/dist/commonjs/text-area/lib/hooks/useTextAreaModel.js +4 -0
  61. package/dist/commonjs/text-input/index.d.ts +3 -0
  62. package/dist/commonjs/text-input/index.d.ts.map +1 -0
  63. package/dist/commonjs/text-input/index.js +7 -0
  64. package/dist/commonjs/text-input/lib/TextInput.d.ts +22 -0
  65. package/dist/commonjs/text-input/lib/TextInput.d.ts.map +1 -0
  66. package/dist/commonjs/text-input/lib/TextInput.js +52 -0
  67. package/dist/commonjs/text-input/lib/TextInputField.d.ts +8 -0
  68. package/dist/commonjs/text-input/lib/TextInputField.d.ts.map +1 -0
  69. package/dist/commonjs/text-input/lib/TextInputField.js +67 -0
  70. package/dist/commonjs/text-input/lib/TextInputHint.d.ts +5 -0
  71. package/dist/commonjs/text-input/lib/TextInputHint.d.ts.map +1 -0
  72. package/dist/commonjs/text-input/lib/TextInputHint.js +4 -0
  73. package/dist/commonjs/text-input/lib/TextInputLabel.d.ts +5 -0
  74. package/dist/commonjs/text-input/lib/TextInputLabel.d.ts.map +1 -0
  75. package/dist/commonjs/text-input/lib/TextInputLabel.js +4 -0
  76. package/dist/commonjs/text-input/lib/hooks/index.d.ts +3 -0
  77. package/dist/commonjs/text-input/lib/hooks/index.d.ts.map +1 -0
  78. package/dist/commonjs/text-input/lib/hooks/index.js +7 -0
  79. package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +10 -0
  80. package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts.map +1 -0
  81. package/dist/commonjs/text-input/lib/hooks/useTextInputField.js +11 -0
  82. package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +8 -0
  83. package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -0
  84. package/dist/commonjs/text-input/lib/hooks/useTextInputModel.js +4 -0
  85. package/dist/es6/form-field/index.d.ts +3 -0
  86. package/dist/es6/form-field/index.d.ts.map +1 -0
  87. package/dist/es6/form-field/index.js +2 -0
  88. package/dist/es6/form-field/lib/FormField.d.ts +31 -0
  89. package/dist/es6/form-field/lib/FormField.d.ts.map +1 -0
  90. package/dist/es6/form-field/lib/FormField.js +46 -0
  91. package/dist/es6/form-field/lib/FormFieldHint.d.ts +13 -0
  92. package/dist/es6/form-field/lib/FormFieldHint.d.ts.map +1 -0
  93. package/dist/es6/form-field/lib/FormFieldHint.js +43 -0
  94. package/dist/es6/form-field/lib/FormFieldInput.d.ts +8 -0
  95. package/dist/es6/form-field/lib/FormFieldInput.d.ts.map +1 -0
  96. package/dist/es6/form-field/lib/FormFieldInput.js +36 -0
  97. package/dist/es6/form-field/lib/FormFieldLabel.d.ts +18 -0
  98. package/dist/es6/form-field/lib/FormFieldLabel.d.ts.map +1 -0
  99. package/dist/es6/form-field/lib/FormFieldLabel.js +49 -0
  100. package/dist/es6/form-field/lib/hooks/index.d.ts +6 -0
  101. package/dist/es6/form-field/lib/hooks/index.d.ts.map +1 -0
  102. package/dist/es6/form-field/lib/hooks/index.js +5 -0
  103. package/dist/es6/form-field/lib/hooks/useFormFieldHint.d.ts +15 -0
  104. package/dist/es6/form-field/lib/hooks/useFormFieldHint.d.ts.map +1 -0
  105. package/dist/es6/form-field/lib/hooks/useFormFieldHint.js +11 -0
  106. package/dist/es6/form-field/lib/hooks/useFormFieldInput.d.ts +18 -0
  107. package/dist/es6/form-field/lib/hooks/useFormFieldInput.d.ts.map +1 -0
  108. package/dist/es6/form-field/lib/hooks/useFormFieldInput.js +14 -0
  109. package/dist/es6/form-field/lib/hooks/useFormFieldLabel.d.ts +15 -0
  110. package/dist/es6/form-field/lib/hooks/useFormFieldLabel.d.ts.map +1 -0
  111. package/dist/es6/form-field/lib/hooks/useFormFieldLabel.js +11 -0
  112. package/dist/es6/form-field/lib/hooks/useFormFieldModel.d.ts +36 -0
  113. package/dist/es6/form-field/lib/hooks/useFormFieldModel.d.ts.map +1 -0
  114. package/dist/es6/form-field/lib/hooks/useFormFieldModel.js +19 -0
  115. package/dist/es6/form-field/lib/hooks/useFormFieldOrientation.d.ts +9 -0
  116. package/dist/es6/form-field/lib/hooks/useFormFieldOrientation.d.ts.map +1 -0
  117. package/dist/es6/form-field/lib/hooks/useFormFieldOrientation.js +22 -0
  118. package/dist/es6/index.d.ts +3 -0
  119. package/dist/es6/index.d.ts.map +1 -1
  120. package/dist/es6/index.js +3 -0
  121. package/dist/es6/side-panel/lib/SidePanel.d.ts +24 -2
  122. package/dist/es6/side-panel/lib/SidePanel.d.ts.map +1 -1
  123. package/dist/es6/side-panel/lib/SidePanel.js +4 -3
  124. package/dist/es6/text-area/index.d.ts +2 -0
  125. package/dist/es6/text-area/index.d.ts.map +1 -0
  126. package/dist/es6/text-area/index.js +1 -0
  127. package/dist/es6/text-area/lib/TextArea.d.ts +22 -0
  128. package/dist/es6/text-area/lib/TextArea.d.ts.map +1 -0
  129. package/dist/es6/text-area/lib/TextArea.js +47 -0
  130. package/dist/es6/text-area/lib/TextAreaField.d.ts +8 -0
  131. package/dist/es6/text-area/lib/TextAreaField.d.ts.map +1 -0
  132. package/dist/es6/text-area/lib/TextAreaField.js +63 -0
  133. package/dist/es6/text-area/lib/TextAreaHint.d.ts +5 -0
  134. package/dist/es6/text-area/lib/TextAreaHint.d.ts.map +1 -0
  135. package/dist/es6/text-area/lib/TextAreaHint.js +2 -0
  136. package/dist/es6/text-area/lib/TextAreaLabel.d.ts +5 -0
  137. package/dist/es6/text-area/lib/TextAreaLabel.d.ts.map +1 -0
  138. package/dist/es6/text-area/lib/TextAreaLabel.js +2 -0
  139. package/dist/es6/text-area/lib/hooks/index.d.ts +2 -0
  140. package/dist/es6/text-area/lib/hooks/index.d.ts.map +1 -0
  141. package/dist/es6/text-area/lib/hooks/index.js +1 -0
  142. package/dist/es6/text-area/lib/hooks/useTextAreaModel.d.ts +8 -0
  143. package/dist/es6/text-area/lib/hooks/useTextAreaModel.d.ts.map +1 -0
  144. package/dist/es6/text-area/lib/hooks/useTextAreaModel.js +2 -0
  145. package/dist/es6/text-input/index.d.ts +3 -0
  146. package/dist/es6/text-input/index.d.ts.map +1 -0
  147. package/dist/es6/text-input/index.js +2 -0
  148. package/dist/es6/text-input/lib/TextInput.d.ts +22 -0
  149. package/dist/es6/text-input/lib/TextInput.d.ts.map +1 -0
  150. package/dist/es6/text-input/lib/TextInput.js +47 -0
  151. package/dist/es6/text-input/lib/TextInputField.d.ts +8 -0
  152. package/dist/es6/text-input/lib/TextInputField.d.ts.map +1 -0
  153. package/dist/es6/text-input/lib/TextInputField.js +65 -0
  154. package/dist/es6/text-input/lib/TextInputHint.d.ts +5 -0
  155. package/dist/es6/text-input/lib/TextInputHint.d.ts.map +1 -0
  156. package/dist/es6/text-input/lib/TextInputHint.js +2 -0
  157. package/dist/es6/text-input/lib/TextInputLabel.d.ts +5 -0
  158. package/dist/es6/text-input/lib/TextInputLabel.d.ts.map +1 -0
  159. package/dist/es6/text-input/lib/TextInputLabel.js +2 -0
  160. package/dist/es6/text-input/lib/hooks/index.d.ts +3 -0
  161. package/dist/es6/text-input/lib/hooks/index.d.ts.map +1 -0
  162. package/dist/es6/text-input/lib/hooks/index.js +2 -0
  163. package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +10 -0
  164. package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts.map +1 -0
  165. package/dist/es6/text-input/lib/hooks/useTextInputField.js +9 -0
  166. package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +8 -0
  167. package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -0
  168. package/dist/es6/text-input/lib/hooks/useTextInputModel.js +2 -0
  169. package/form-field/LICENSE +52 -0
  170. package/form-field/README.md +8 -0
  171. package/form-field/index.ts +2 -0
  172. package/form-field/lib/FormField.tsx +56 -0
  173. package/form-field/lib/FormFieldHint.tsx +46 -0
  174. package/form-field/lib/FormFieldInput.tsx +21 -0
  175. package/form-field/lib/FormFieldLabel.tsx +70 -0
  176. package/form-field/lib/hooks/index.ts +5 -0
  177. package/form-field/lib/hooks/useFormFieldHint.tsx +12 -0
  178. package/form-field/lib/hooks/useFormFieldInput.tsx +15 -0
  179. package/form-field/lib/hooks/useFormFieldLabel.tsx +12 -0
  180. package/form-field/lib/hooks/useFormFieldModel.tsx +62 -0
  181. package/form-field/lib/hooks/useFormFieldOrientation.tsx +29 -0
  182. package/form-field/package.json +5 -0
  183. package/index.ts +3 -0
  184. package/package.json +8 -5
  185. package/side-panel/lib/SidePanel.tsx +20 -3
  186. package/text-area/LICENSE +52 -0
  187. package/text-area/README.md +7 -0
  188. package/text-area/index.ts +1 -0
  189. package/text-area/lib/TextArea.tsx +43 -0
  190. package/text-area/lib/TextAreaField.tsx +81 -0
  191. package/text-area/lib/TextAreaHint.tsx +6 -0
  192. package/text-area/lib/TextAreaLabel.tsx +6 -0
  193. package/text-area/lib/hooks/index.ts +1 -0
  194. package/text-area/lib/hooks/useTextAreaModel.ts +8 -0
  195. package/text-area/package.json +5 -0
  196. package/text-input/LICENSE +52 -0
  197. package/text-input/README.md +7 -0
  198. package/text-input/index.ts +2 -0
  199. package/text-input/lib/TextInput.tsx +43 -0
  200. package/text-input/lib/TextInputField.tsx +81 -0
  201. package/text-input/lib/TextInputHint.tsx +6 -0
  202. package/text-input/lib/TextInputLabel.tsx +6 -0
  203. package/text-input/lib/hooks/index.ts +2 -0
  204. package/text-input/lib/hooks/useTextInputField.tsx +10 -0
  205. package/text-input/lib/hooks/useTextInputModel.ts +8 -0
  206. package/text-input/package.json +5 -0
  207. package/ts3.5/dist/commonjs/form-field/index.d.ts +3 -0
  208. package/ts3.5/dist/commonjs/form-field/lib/FormField.d.ts +31 -0
  209. package/ts3.5/dist/commonjs/form-field/lib/FormFieldHint.d.ts +13 -0
  210. package/ts3.5/dist/commonjs/form-field/lib/FormFieldInput.d.ts +8 -0
  211. package/ts3.5/dist/commonjs/form-field/lib/FormFieldLabel.d.ts +18 -0
  212. package/ts3.5/dist/commonjs/form-field/lib/hooks/index.d.ts +6 -0
  213. package/ts3.5/dist/commonjs/form-field/lib/hooks/useFormFieldHint.d.ts +15 -0
  214. package/ts3.5/dist/commonjs/form-field/lib/hooks/useFormFieldInput.d.ts +18 -0
  215. package/ts3.5/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.d.ts +15 -0
  216. package/ts3.5/dist/commonjs/form-field/lib/hooks/useFormFieldModel.d.ts +36 -0
  217. package/ts3.5/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.d.ts +9 -0
  218. package/ts3.5/dist/commonjs/index.d.ts +3 -0
  219. package/ts3.5/dist/commonjs/side-panel/lib/SidePanel.d.ts +24 -2
  220. package/ts3.5/dist/commonjs/text-area/index.d.ts +2 -0
  221. package/ts3.5/dist/commonjs/text-area/lib/TextArea.d.ts +22 -0
  222. package/ts3.5/dist/commonjs/text-area/lib/TextAreaField.d.ts +8 -0
  223. package/ts3.5/dist/commonjs/text-area/lib/TextAreaHint.d.ts +5 -0
  224. package/ts3.5/dist/commonjs/text-area/lib/TextAreaLabel.d.ts +5 -0
  225. package/ts3.5/dist/commonjs/text-area/lib/hooks/index.d.ts +2 -0
  226. package/ts3.5/dist/commonjs/text-area/lib/hooks/useTextAreaModel.d.ts +8 -0
  227. package/ts3.5/dist/commonjs/text-input/index.d.ts +3 -0
  228. package/ts3.5/dist/commonjs/text-input/lib/TextInput.d.ts +22 -0
  229. package/ts3.5/dist/commonjs/text-input/lib/TextInputField.d.ts +8 -0
  230. package/ts3.5/dist/commonjs/text-input/lib/TextInputHint.d.ts +5 -0
  231. package/ts3.5/dist/commonjs/text-input/lib/TextInputLabel.d.ts +5 -0
  232. package/ts3.5/dist/commonjs/text-input/lib/hooks/index.d.ts +3 -0
  233. package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +10 -0
  234. package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +8 -0
  235. package/ts3.5/dist/es6/form-field/index.d.ts +3 -0
  236. package/ts3.5/dist/es6/form-field/lib/FormField.d.ts +31 -0
  237. package/ts3.5/dist/es6/form-field/lib/FormFieldHint.d.ts +13 -0
  238. package/ts3.5/dist/es6/form-field/lib/FormFieldInput.d.ts +8 -0
  239. package/ts3.5/dist/es6/form-field/lib/FormFieldLabel.d.ts +18 -0
  240. package/ts3.5/dist/es6/form-field/lib/hooks/index.d.ts +6 -0
  241. package/ts3.5/dist/es6/form-field/lib/hooks/useFormFieldHint.d.ts +15 -0
  242. package/ts3.5/dist/es6/form-field/lib/hooks/useFormFieldInput.d.ts +18 -0
  243. package/ts3.5/dist/es6/form-field/lib/hooks/useFormFieldLabel.d.ts +15 -0
  244. package/ts3.5/dist/es6/form-field/lib/hooks/useFormFieldModel.d.ts +36 -0
  245. package/ts3.5/dist/es6/form-field/lib/hooks/useFormFieldOrientation.d.ts +9 -0
  246. package/ts3.5/dist/es6/index.d.ts +3 -0
  247. package/ts3.5/dist/es6/side-panel/lib/SidePanel.d.ts +24 -2
  248. package/ts3.5/dist/es6/text-area/index.d.ts +2 -0
  249. package/ts3.5/dist/es6/text-area/lib/TextArea.d.ts +22 -0
  250. package/ts3.5/dist/es6/text-area/lib/TextAreaField.d.ts +8 -0
  251. package/ts3.5/dist/es6/text-area/lib/TextAreaHint.d.ts +5 -0
  252. package/ts3.5/dist/es6/text-area/lib/TextAreaLabel.d.ts +5 -0
  253. package/ts3.5/dist/es6/text-area/lib/hooks/index.d.ts +2 -0
  254. package/ts3.5/dist/es6/text-area/lib/hooks/useTextAreaModel.d.ts +8 -0
  255. package/ts3.5/dist/es6/text-input/index.d.ts +3 -0
  256. package/ts3.5/dist/es6/text-input/lib/TextInput.d.ts +22 -0
  257. package/ts3.5/dist/es6/text-input/lib/TextInputField.d.ts +8 -0
  258. package/ts3.5/dist/es6/text-input/lib/TextInputHint.d.ts +5 -0
  259. package/ts3.5/dist/es6/text-input/lib/TextInputLabel.d.ts +5 -0
  260. package/ts3.5/dist/es6/text-input/lib/hooks/index.d.ts +3 -0
  261. package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +10 -0
  262. package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +8 -0
@@ -0,0 +1,46 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import React from 'react';
24
+ import { createComponent, useDefaultModel } from '@workday/canvas-kit-react/common';
25
+ import { Stack } from '@workday/canvas-kit-labs-react/layout';
26
+ import { useFormFieldModel, useFormFieldOrientation } from './hooks';
27
+ import { FormFieldInput } from './FormFieldInput';
28
+ import { FormFieldLabel } from './FormFieldLabel';
29
+ import { FormFieldHint } from './FormFieldHint';
30
+ export var FormFieldModelContext = React.createContext({});
31
+ export var FormField = createComponent()({
32
+ displayName: 'FormField',
33
+ Component: function (_a, ref) {
34
+ var children = _a.children, model = _a.model, spacing = _a.spacing, orientation = _a.orientation, props = __rest(_a, ["children", "model", "spacing", "orientation"]);
35
+ var hasError = props.hasError, id = props.id, isRequired = props.isRequired, elemProps = __rest(props, ["hasError", "id", "isRequired"]);
36
+ var value = useDefaultModel(model, { hasError: hasError, id: id, isRequired: isRequired }, useFormFieldModel);
37
+ var layoutProps = useFormFieldOrientation(orientation);
38
+ return (React.createElement(FormFieldModelContext.Provider, { value: value },
39
+ React.createElement(Stack, __assign({ ref: ref }, layoutProps, elemProps), children)));
40
+ },
41
+ subComponents: {
42
+ Input: FormFieldInput,
43
+ Label: FormFieldLabel,
44
+ Hint: FormFieldHint,
45
+ },
46
+ });
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { ExtractProps } from '@workday/canvas-kit-react/common';
3
+ import { Box } from '@workday/canvas-kit-labs-react/common';
4
+ import { FormFieldModel } from './hooks';
5
+ export interface FormFieldHintProps extends ExtractProps<typeof Box, never> {
6
+ model?: FormFieldModel;
7
+ /**
8
+ * Hint text to show to the user regarding the Error/Alert
9
+ */
10
+ children?: React.ReactNode;
11
+ }
12
+ export declare const FormFieldHint: import("@workday/canvas-kit-react/common").ElementComponent<"p", FormFieldHintProps>;
13
+ //# sourceMappingURL=FormFieldHint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormFieldHint.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormFieldHint.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAkB,YAAY,EAA4B,MAAM,kCAAkC,CAAC;AAE1G,OAAO,EAAC,GAAG,EAAC,MAAM,uCAAuC,CAAC;AAG1D,OAAO,EAAC,cAAc,EAAmB,MAAM,SAAS,CAAC;AAEzD,MAAM,WAAW,kBAAmB,SAAQ,YAAY,CAAC,OAAO,GAAG,EAAE,KAAK,CAAC;IACzE,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,aAAa,sFA0BxB,CAAC"}
@@ -0,0 +1,43 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ /** @jsx jsx */
24
+ import { jsx } from '@emotion/core';
25
+ import { createComponent, useModelContext, useTheme } from '@workday/canvas-kit-react/common';
26
+ import { space, type } from '@workday/canvas-kit-react/tokens';
27
+ import { Box } from '@workday/canvas-kit-labs-react/common';
28
+ import { FormFieldModelContext } from './FormField';
29
+ import { useFormFieldHint } from './hooks';
30
+ export var FormFieldHint = createComponent('p')({
31
+ displayName: 'FormField.Hint',
32
+ Component: function (_a, ref, Element) {
33
+ var model = _a.model, children = _a.children, elemProps = __rest(_a, ["model", "children"]);
34
+ var localModel = useModelContext(FormFieldModelContext, model);
35
+ var props = useFormFieldHint(localModel, elemProps, ref);
36
+ var theme = useTheme();
37
+ if (!children) {
38
+ // If there is no hint text just skip rendering
39
+ return null;
40
+ }
41
+ return (jsx(Box, __assign({ as: Element, css: __assign({}, type.levels.subtext.medium), color: localModel.state.hasError ? theme.canvas.palette.error.main : undefined, marginY: space.xxs }, props), children));
42
+ },
43
+ });
@@ -0,0 +1,8 @@
1
+ import { ExtractProps } from '@workday/canvas-kit-react/common';
2
+ import { Box } from '@workday/canvas-kit-labs-react/common';
3
+ import { FormFieldModel } from './hooks';
4
+ export interface FormFieldInputProps extends ExtractProps<typeof Box, never> {
5
+ model?: FormFieldModel;
6
+ }
7
+ export declare const FormFieldInput: import("@workday/canvas-kit-react/common").ElementComponent<"input", FormFieldInputProps>;
8
+ //# sourceMappingURL=FormFieldInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormFieldInput.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormFieldInput.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,YAAY,EAAkB,MAAM,kCAAkC,CAAC;AAChG,OAAO,EAAC,GAAG,EAAC,MAAM,uCAAuC,CAAC;AAG1D,OAAO,EAAC,cAAc,EAAoB,MAAM,SAAS,CAAC;AAE1D,MAAM,WAAW,mBAAoB,SAAQ,YAAY,CAAC,OAAO,GAAG,EAAE,KAAK,CAAC;IAC1E,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB;AAED,eAAO,MAAM,cAAc,2FAQzB,CAAC"}
@@ -0,0 +1,36 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import React from 'react';
24
+ import { createComponent, useModelContext } from '@workday/canvas-kit-react/common';
25
+ import { Box } from '@workday/canvas-kit-labs-react/common';
26
+ import { FormFieldModelContext } from './FormField';
27
+ import { useFormFieldInput } from './hooks';
28
+ export var FormFieldInput = createComponent('input')({
29
+ displayName: 'FormField.Input',
30
+ Component: function (_a, ref, Element) {
31
+ var model = _a.model, elemProps = __rest(_a, ["model"]);
32
+ var localModel = useModelContext(FormFieldModelContext, model);
33
+ var props = useFormFieldInput(localModel, elemProps, ref);
34
+ return React.createElement(Box, __assign({ as: Element }, props));
35
+ },
36
+ });
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { ExtractProps } from '@workday/canvas-kit-react/common';
3
+ import { HStack, StackSpacing } from '@workday/canvas-kit-labs-react/layout';
4
+ import { FormFieldModel } from './hooks';
5
+ export interface FormFieldLabelProps extends Omit<ExtractProps<typeof HStack, never>, 'spacing'> {
6
+ model?: FormFieldModel;
7
+ /**
8
+ * The text of the label.
9
+ */
10
+ children: React.ReactNode;
11
+ /**
12
+ * When the input is required, this is spacing between label and asterisk.
13
+ * @default xxxs
14
+ */
15
+ spacing?: StackSpacing;
16
+ }
17
+ export declare const FormFieldLabel: import("@workday/canvas-kit-react/common").ElementComponent<"label", FormFieldLabelProps>;
18
+ //# sourceMappingURL=FormFieldLabel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormFieldLabel.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormFieldLabel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAEL,YAAY,EAGb,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAC,MAAM,EAAE,YAAY,EAAC,MAAM,uCAAuC,CAAC;AAG3E,OAAO,EAAC,cAAc,EAAoB,MAAM,SAAS,CAAC;AAE1D,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,YAAY,CAAC,OAAO,MAAM,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC;IAC9F,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;AAcD,eAAO,MAAM,cAAc,2FA2BzB,CAAC"}
@@ -0,0 +1,49 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ /** @jsx jsx */
24
+ import { jsx } from '@emotion/core';
25
+ import { createComponent, useModelContext, useTheme, } from '@workday/canvas-kit-react/common';
26
+ import { type } from '@workday/canvas-kit-react/tokens';
27
+ import { HStack } from '@workday/canvas-kit-labs-react/layout';
28
+ import { FormFieldModelContext } from './FormField';
29
+ import { useFormFieldLabel } from './hooks';
30
+ var styles = {
31
+ label: __assign(__assign({}, type.levels.subtext.large), { fontWeight: type.properties.fontWeights.medium }),
32
+ asterisk: {
33
+ fontSize: type.properties.fontSizes[16],
34
+ fontWeight: type.properties.fontWeights.regular,
35
+ textDecoration: 'unset',
36
+ },
37
+ };
38
+ export var FormFieldLabel = createComponent('label')({
39
+ displayName: 'FormField.Label',
40
+ Component: function (_a, ref) {
41
+ var _b = _a.spacing, spacing = _b === void 0 ? 'xxxs' : _b, model = _a.model, children = _a.children, elemProps = __rest(_a, ["spacing", "model", "children"]);
42
+ var localModel = useModelContext(FormFieldModelContext, model);
43
+ var props = useFormFieldLabel(localModel, elemProps, ref);
44
+ var theme = useTheme();
45
+ return (jsx(HStack, __assign({ as: "label", spacing: spacing, css: styles.label, minWidth: '180px' }, props),
46
+ jsx("span", null, children),
47
+ localModel.state.isRequired && (jsx("span", { css: [styles.asterisk, { color: theme.canvas.palette.error.main }], "aria-hidden": "true" }, "*"))));
48
+ },
49
+ });
@@ -0,0 +1,6 @@
1
+ export * from './useFormFieldOrientation';
2
+ export * from './useFormFieldHint';
3
+ export * from './useFormFieldInput';
4
+ export * from './useFormFieldModel';
5
+ export * from './useFormFieldLabel';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../form-field/lib/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './useFormFieldOrientation';
2
+ export * from './useFormFieldHint';
3
+ export * from './useFormFieldInput';
4
+ export * from './useFormFieldModel';
5
+ export * from './useFormFieldLabel';
@@ -0,0 +1,15 @@
1
+ /// <reference types="@emotion/core" />
2
+ /**
3
+ * Adds the necessary props to a `Hint` component.
4
+ * Used by the FormField.Hint subcomponent and other input type components
5
+ */
6
+ export declare const useFormFieldHint: <P extends {}, R>(model: import("@workday/canvas-kit-react/common").Model<{
7
+ hasError?: boolean | undefined;
8
+ id?: string | undefined;
9
+ isRequired?: boolean | undefined;
10
+ }, {}>, elemProps?: P | undefined, ref?: ((instance: R | null) => void) | import("react").RefObject<R> | null | undefined) => {
11
+ id: string;
12
+ } & P & (R extends HTMLOrSVGElement ? {
13
+ ref: import("react").Ref<R>;
14
+ } : {});
15
+ //# sourceMappingURL=useFormFieldHint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFormFieldHint.d.ts","sourceRoot":"","sources":["../../../../../form-field/lib/hooks/useFormFieldHint.tsx"],"names":[],"mappings":";AAGA;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;OAI3B,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { createHook } from '@workday/canvas-kit-react/common';
2
+ /**
3
+ * Adds the necessary props to a `Hint` component.
4
+ * Used by the FormField.Hint subcomponent and other input type components
5
+ */
6
+ export var useFormFieldHint = createHook(function (_a) {
7
+ var state = _a.state;
8
+ return {
9
+ id: "hint-" + state.id,
10
+ };
11
+ });
@@ -0,0 +1,18 @@
1
+ /// <reference types="@emotion/core" />
2
+ /**
3
+ * Adds the necessary props to an `Input` component.
4
+ * Used by the FormField.Input subcomponent and other input type components
5
+ */
6
+ export declare const useFormFieldInput: <P extends {}, R>(model: import("@workday/canvas-kit-react/common").Model<{
7
+ hasError?: boolean | undefined;
8
+ id?: string | undefined;
9
+ isRequired?: boolean | undefined;
10
+ }, {}>, elemProps?: P | undefined, ref?: ((instance: R | null) => void) | import("react").RefObject<R> | null | undefined) => {
11
+ required: boolean | undefined;
12
+ 'aria-invalid': boolean | undefined;
13
+ 'aria-describedby': string;
14
+ id: string;
15
+ } & P & (R extends HTMLOrSVGElement ? {
16
+ ref: import("react").Ref<R>;
17
+ } : {});
18
+ //# sourceMappingURL=useFormFieldInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFormFieldInput.d.ts","sourceRoot":"","sources":["../../../../../form-field/lib/hooks/useFormFieldInput.tsx"],"names":[],"mappings":";AAGA;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;OAO5B,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { createHook } from '@workday/canvas-kit-react/common';
2
+ /**
3
+ * Adds the necessary props to an `Input` component.
4
+ * Used by the FormField.Input subcomponent and other input type components
5
+ */
6
+ export var useFormFieldInput = createHook(function (_a) {
7
+ var state = _a.state;
8
+ return {
9
+ required: state.isRequired ? true : undefined,
10
+ 'aria-invalid': state.hasError ? true : undefined,
11
+ 'aria-describedby': "hint-" + state.id,
12
+ id: "input-" + state.id,
13
+ };
14
+ });
@@ -0,0 +1,15 @@
1
+ /// <reference types="@emotion/core" />
2
+ /**
3
+ * Adds the necessary props to a `Label` component.
4
+ * Used by the FormField.Label subcomponent and other input type components
5
+ */
6
+ export declare const useFormFieldLabel: <P extends {}, R>(model: import("@workday/canvas-kit-react/common").Model<{
7
+ hasError?: boolean | undefined;
8
+ id?: string | undefined;
9
+ isRequired?: boolean | undefined;
10
+ }, {}>, elemProps?: P | undefined, ref?: ((instance: R | null) => void) | import("react").RefObject<R> | null | undefined) => {
11
+ htmlFor: string;
12
+ } & P & (R extends HTMLOrSVGElement ? {
13
+ ref: import("react").Ref<R>;
14
+ } : {});
15
+ //# sourceMappingURL=useFormFieldLabel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFormFieldLabel.d.ts","sourceRoot":"","sources":["../../../../../form-field/lib/hooks/useFormFieldLabel.tsx"],"names":[],"mappings":";AAGA;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;OAI5B,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { createHook } from '@workday/canvas-kit-react/common';
2
+ /**
3
+ * Adds the necessary props to a `Label` component.
4
+ * Used by the FormField.Label subcomponent and other input type components
5
+ */
6
+ export var useFormFieldLabel = createHook(function (_a) {
7
+ var state = _a.state;
8
+ return {
9
+ htmlFor: "input-" + state.id,
10
+ };
11
+ });
@@ -0,0 +1,36 @@
1
+ import { Model, ToModelConfig } from '@workday/canvas-kit-react/common';
2
+ declare type FormFieldState = {
3
+ /**
4
+ * Optional flag to denote if this field has an error to display. When true the `FormField.Input` will have
5
+ * `required` set to true, and usually some subcomponents will have a error color applied.
6
+ * @default false
7
+ */
8
+ hasError?: boolean;
9
+ /**
10
+ * Optional `id` provided to `FormField`'s subcomponents as HTML attributes:
11
+ * - `FormField.Input` will set `aria-describedby` to `hint-${id}`
12
+ * - `FormField.Input` will set `id` to `input-${id}`
13
+ * - `FormField.Label` will set `htmlFor` to `input-${id}`
14
+ * - `FormField.Hint` will set `id` to `hint-${id}`
15
+ *
16
+ * If a value is not provided, a unique id will be automatically created by `useUniqueId()`.
17
+ * @default `useUniqueId()`
18
+ */
19
+ id?: string;
20
+ /**
21
+ * Optional flag to denote if this field is required. When true the `FormField.Input` will have
22
+ * `required` set to true, and an asterisk will be appended to the `FormField.Label`.
23
+ * @default false
24
+ */
25
+ isRequired?: boolean;
26
+ };
27
+ declare type FormFieldEvents = {};
28
+ export declare type FormFieldModel = Model<FormFieldState, FormFieldEvents>;
29
+ declare const formFieldEventMap: {
30
+ guards: {};
31
+ callbacks: {};
32
+ };
33
+ export declare type FormFieldModelConfig = FormFieldState & Partial<ToModelConfig<FormFieldState, FormFieldEvents, typeof formFieldEventMap>>;
34
+ export declare const useFormFieldModel: (config?: FormFieldModelConfig) => Model<FormFieldState, FormFieldEvents>;
35
+ export {};
36
+ //# sourceMappingURL=useFormFieldModel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFormFieldModel.d.ts","sourceRoot":"","sources":["../../../../../form-field/lib/hooks/useFormFieldModel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,EACL,aAAa,EAGd,MAAM,kCAAkC,CAAC;AAE1C,aAAK,cAAc,GAAG;IACpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;;;;OASG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,aAAK,eAAe,GAAG,EAAE,CAAC;AAE1B,oBAAY,cAAc,GAAG,KAAK,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC;AAEpE,QAAA,MAAM,iBAAiB;;;CAGrB,CAAC;AAEH,oBAAY,oBAAoB,GAAG,cAAc,GAC/C,OAAO,CAAC,aAAa,CAAC,cAAc,EAAE,eAAe,EAAE,OAAO,iBAAiB,CAAC,CAAC,CAAC;AAEpF,eAAO,MAAM,iBAAiB,2EAe7B,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { createEventMap, useEventMap, useUniqueId, } from '@workday/canvas-kit-react/common';
2
+ var formFieldEventMap = createEventMap()({
3
+ guards: {},
4
+ callbacks: {},
5
+ });
6
+ export var useFormFieldModel = function (config) {
7
+ if (config === void 0) { config = {}; }
8
+ var id = useUniqueId(config.id);
9
+ var state = {
10
+ hasError: config.hasError,
11
+ isRequired: config.isRequired,
12
+ id: id,
13
+ };
14
+ var events = useEventMap(formFieldEventMap, state, config, {});
15
+ return {
16
+ state: state,
17
+ events: events,
18
+ };
19
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Adds the necessary layout props to a `FormField` component.
3
+ */
4
+ export declare const useFormFieldOrientation: (orientation: "horizontal" | "vertical") => {
5
+ flexDirection: "column" | "column-reverse" | "row" | "row-reverse" | undefined;
6
+ alignItems: (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "stretch" | "center" | "end" | "flex-end" | "flex-start" | "start" | "baseline" | "normal" | "self-end" | "self-start" | undefined;
7
+ spacing: number | (string & {}) | "s" | "zero" | "m" | "l" | "xl" | "xxxs" | "xxs" | "xs" | "xxl" | "xxxl";
8
+ };
9
+ //# sourceMappingURL=useFormFieldOrientation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFormFieldOrientation.d.ts","sourceRoot":"","sources":["../../../../../form-field/lib/hooks/useFormFieldOrientation.tsx"],"names":[],"mappings":"AAGA;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;CAsBnC,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { space } from '@workday/canvas-kit-react/tokens';
2
+ /**
3
+ * Adds the necessary layout props to a `FormField` component.
4
+ */
5
+ export var useFormFieldOrientation = function (orientation) {
6
+ var layoutProps;
7
+ if (orientation === 'horizontal') {
8
+ layoutProps = {
9
+ flexDirection: 'row',
10
+ spacing: space.l,
11
+ alignItems: 'center',
12
+ };
13
+ }
14
+ else {
15
+ layoutProps = {
16
+ flexDirection: 'column',
17
+ spacing: space.xxxs,
18
+ alignItems: 'flex-start',
19
+ };
20
+ }
21
+ return layoutProps;
22
+ };
@@ -1,6 +1,9 @@
1
1
  export * from './breadcrumbs';
2
2
  export * from './color-picker';
3
+ export * from './form-field';
3
4
  export * from './menu';
4
5
  export * from './select';
5
6
  export * from './side-panel';
7
+ export * from './text-area';
8
+ export * from './text-input';
6
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
package/dist/es6/index.js CHANGED
@@ -1,5 +1,8 @@
1
1
  export * from './breadcrumbs';
2
2
  export * from './color-picker';
3
+ export * from './form-field';
3
4
  export * from './menu';
4
5
  export * from './select';
5
6
  export * from './side-panel';
7
+ export * from './text-area';
8
+ export * from './text-input';
@@ -66,8 +66,30 @@ export declare const SidePanelContext: React.Context<{
66
66
  }>;
67
67
  declare const SidePanel: {
68
68
  ({ as, children, collapsedWidth, expanded, expandedWidth, onAnimationEnd, onAnimationStart, onExpandedChange, onStateTransition, origin, variant, touched, ...elemProps }: SidePanelProps): JSX.Element;
69
- ToggleButton: ({ variant, icon, ...rest }: Pick<IconButtonProps, "size" | "icon" | "children" | "value" | "theme" | "shouldMirrorIcon" | "variant" | "onToggleChange" | "toggled"> & React.ButtonHTMLAttributes<HTMLButtonElement>) => JSX.Element;
69
+ ToggleButton: ({ variant, icon, tooltipTextExpand: expandLabel, tooltipTextCollapse: collapseLabel, ...rest }: IconButtonProps & {
70
+ /**
71
+ * The tooltip text to expand the side panel
72
+ * @default 'Expand'
73
+ */
74
+ tooltipTextExpand?: string | undefined;
75
+ /**
76
+ * The tooltip text to collapse the side panel
77
+ * @default 'Collapse'
78
+ */
79
+ tooltipTextCollapse?: string | undefined;
80
+ } & React.ButtonHTMLAttributes<HTMLButtonElement>) => JSX.Element;
81
+ };
82
+ export declare type ToggleButtonProps = IconButtonProps & {
83
+ /**
84
+ * The tooltip text to expand the side panel
85
+ * @default 'Expand'
86
+ */
87
+ tooltipTextExpand?: string;
88
+ /**
89
+ * The tooltip text to collapse the side panel
90
+ * @default 'Collapse'
91
+ */
92
+ tooltipTextCollapse?: string;
70
93
  };
71
- export declare type ToggleButtonProps = Omit<IconButtonProps, 'aria-label'>;
72
94
  export default SidePanel;
73
95
  //# sourceMappingURL=SidePanel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanel.tsx"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAa,eAAe,EAAC,MAAM,kCAAkC,CAAC;AAI7E,oBAAY,gBAAgB,GAAG,UAAU,GAAG,WAAW,CAAC;AACxD,oBAAY,yBAAyB,GAAG,WAAW,GAAG,YAAY,GAAG,UAAU,GAAG,WAAW,CAAC;AAE9F,MAAM,WAAW,cAAe,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC1E;;;;OAIG;IACH,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACvB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,yBAAyB,KAAK,IAAI,CAAC;IAChE;;;;OAIG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAsCD,eAAO,MAAM,gBAAgB;;;EAG3B,CAAC;AAEH,QAAA,MAAM,SAAS;;;CAgGd,CAAC;AAEF,oBAAY,iBAAiB,GAAG,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;AA2CpE,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanel.tsx"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAa,eAAe,EAAC,MAAM,kCAAkC,CAAC;AAK7E,oBAAY,gBAAgB,GAAG,UAAU,GAAG,WAAW,CAAC;AACxD,oBAAY,yBAAyB,GAAG,WAAW,GAAG,YAAY,GAAG,UAAU,GAAG,WAAW,CAAC;AAE9F,MAAM,WAAW,cAAe,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC1E;;;;OAIG;IACH,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACvB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,yBAAyB,KAAK,IAAI,CAAC;IAChE;;;;OAIG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAsCD,eAAO,MAAM,gBAAgB;;;EAG3B,CAAC;AAEH,QAAA,MAAM,SAAS;;;QAmGb;;;WAGG;;QAEH;;;WAGG;;;CAXJ,CAAC;AAEF,oBAAY,iBAAiB,GAAG,eAAe,GAAG;IAChD;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAgDF,eAAe,SAAS,CAAC"}
@@ -31,6 +31,7 @@ import { css, jsx, keyframes } from '@emotion/core';
31
31
  import { IconButton } from '@workday/canvas-kit-react/button';
32
32
  import { space, colors, depth } from '@workday/canvas-kit-react/tokens';
33
33
  import { transformationImportIcon } from '@workday/canvas-system-icons-web';
34
+ import { Tooltip } from '@workday/canvas-kit-react/tooltip';
34
35
  var createKeyframes = function (from, to) {
35
36
  var normalized = {
36
37
  from: typeof from === 'number' ? from + 'px' : from,
@@ -116,7 +117,7 @@ var SidePanel = function (_a) {
116
117
  * A toggle button styled specifically for the side panel container.
117
118
  */
118
119
  var ToggleButton = function (_a) {
119
- var _b = _a.variant, variant = _b === void 0 ? 'plain' : _b, _c = _a.icon, icon = _c === void 0 ? transformationImportIcon : _c, rest = __rest(_a, ["variant", "icon"]);
120
+ var _b = _a.variant, variant = _b === void 0 ? 'plain' : _b, _c = _a.icon, icon = _c === void 0 ? transformationImportIcon : _c, _d = _a.tooltipTextExpand, expandLabel = _d === void 0 ? 'Expand' : _d, _e = _a.tooltipTextCollapse, collapseLabel = _e === void 0 ? 'Collapse' : _e, rest = __rest(_a, ["variant", "icon", "tooltipTextExpand", "tooltipTextCollapse"]);
120
121
  var context = React.useContext(SidePanelContext);
121
122
  var useRTLOrigin = function () {
122
123
  var isRTL = useIsRTL();
@@ -140,8 +141,8 @@ var ToggleButton = function (_a) {
140
141
  ? "scaleX(" + (rtlOrigin === 'left' ? '1' : '-1') + ")"
141
142
  : "scaleX(" + (rtlOrigin === 'left' ? '-1' : '1') + ")",
142
143
  });
143
- // @ts-ignore aria-label type error here. The user will decide to use aria-label or aria-labelledby
144
- return jsx(IconButton, __assign({ type: "button", css: buttonStyle, icon: icon, variant: variant }, rest));
144
+ return (jsx(Tooltip, { title: context.state === 'collapsed' ? expandLabel : collapseLabel, type: "muted" },
145
+ jsx(IconButton, __assign({ type: "button", css: buttonStyle, icon: icon, variant: variant }, rest))));
145
146
  };
146
147
  SidePanel.ToggleButton = ToggleButton;
147
148
  export default SidePanel;
@@ -0,0 +1,2 @@
1
+ export * from './lib/TextArea';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../text-area/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './lib/TextArea';
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { ExtractProps } from '@workday/canvas-kit-react/common';
3
+ import { FormField } from '@workday/canvas-kit-preview-react/form-field';
4
+ import { TextAreaModel } from './hooks';
5
+ export declare const TextAreaModelContext: React.Context<import("@workday/canvas-kit-react/common").Model<{
6
+ hasError?: boolean | undefined;
7
+ id?: string | undefined;
8
+ isRequired?: boolean | undefined;
9
+ }, {}>>;
10
+ export interface TextAreaProps extends ExtractProps<typeof FormField, never> {
11
+ model?: TextAreaModel;
12
+ /**
13
+ * Children of the Text Input. Should contain a `<TextArea.Field>`, a `<TextArea.Label>` and an optional `<TextArea.Hint>`
14
+ */
15
+ children: React.ReactNode;
16
+ }
17
+ export declare const TextArea: import("@workday/canvas-kit-react/common").Component<TextAreaProps> & {
18
+ Field: import("@workday/canvas-kit-react/common").ElementComponent<"textarea", import("./TextAreaField").TextAreaFieldProps>;
19
+ Label: import("@workday/canvas-kit-react/common").ElementComponent<"label", import("../../form-field/lib/FormFieldLabel").FormFieldLabelProps>;
20
+ Hint: import("@workday/canvas-kit-react/common").ElementComponent<"p", import("../../form-field/lib/FormFieldHint").FormFieldHintProps>;
21
+ };
22
+ //# sourceMappingURL=TextArea.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../../../../text-area/lib/TextArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAkB,YAAY,EAAkB,MAAM,kCAAkC,CAAC;AAChG,OAAO,EAAC,SAAS,EAAiD,MAAM,8CAA8C,CAAC;AAGvH,OAAO,EAAE,aAAa,EAAoB,MAAM,SAAS,CAAC;AAK1D,eAAO,MAAM,oBAAoB;;;;OAAwB,CAAC;AAE1D,MAAM,WAAW,aAAc,SAAQ,YAAY,CAAC,OAAO,SAAS,EAAE,KAAK,CAAC;IAC1E,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,QAAQ;;;;CAqBnB,CAAC"}