@workday/canvas-kit-preview-react 7.0.0-alpha.88-next.15 → 7.0.0-alpha.91-next.18

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 (257) hide show
  1. package/dist/commonjs/form-field/lib/FormField.d.ts +46 -12
  2. package/dist/commonjs/form-field/lib/FormField.d.ts.map +1 -1
  3. package/dist/commonjs/form-field/lib/FormField.js +7 -11
  4. package/dist/commonjs/form-field/lib/FormFieldHint.d.ts +8 -12
  5. package/dist/commonjs/form-field/lib/FormFieldHint.d.ts.map +1 -1
  6. package/dist/commonjs/form-field/lib/FormFieldHint.js +11 -13
  7. package/dist/commonjs/form-field/lib/FormFieldInput.d.ts +8 -7
  8. package/dist/commonjs/form-field/lib/FormFieldInput.d.ts.map +1 -1
  9. package/dist/commonjs/form-field/lib/FormFieldInput.js +5 -19
  10. package/dist/commonjs/form-field/lib/FormFieldLabel.d.ts +8 -3
  11. package/dist/commonjs/form-field/lib/FormFieldLabel.d.ts.map +1 -1
  12. package/dist/commonjs/form-field/lib/FormFieldLabel.js +9 -11
  13. package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.d.ts +8 -5
  14. package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.d.ts.map +1 -1
  15. package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.js +2 -1
  16. package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.d.ts +8 -5
  17. package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.d.ts.map +1 -1
  18. package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.js +2 -1
  19. package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.d.ts +8 -5
  20. package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.d.ts.map +1 -1
  21. package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.js +2 -1
  22. package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.d.ts +77 -15
  23. package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.d.ts.map +1 -1
  24. package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.js +41 -15
  25. package/dist/commonjs/menu/lib/Menu.js +1 -1
  26. package/dist/commonjs/text-area/lib/TextArea.d.ts +52 -11
  27. package/dist/commonjs/text-area/lib/TextArea.d.ts.map +1 -1
  28. package/dist/commonjs/text-area/lib/TextArea.js +9 -15
  29. package/dist/commonjs/text-area/lib/TextAreaField.d.ts +15 -7
  30. package/dist/commonjs/text-area/lib/TextAreaField.d.ts.map +1 -1
  31. package/dist/commonjs/text-area/lib/TextAreaField.js +16 -17
  32. package/dist/commonjs/text-area/lib/hooks/useTextAreaModel.d.ts +27 -7
  33. package/dist/commonjs/text-area/lib/hooks/useTextAreaModel.d.ts.map +1 -1
  34. package/dist/commonjs/text-input/lib/TextInput.d.ts +59 -11
  35. package/dist/commonjs/text-input/lib/TextInput.d.ts.map +1 -1
  36. package/dist/commonjs/text-input/lib/TextInput.js +9 -15
  37. package/dist/commonjs/text-input/lib/TextInputField.d.ts +15 -7
  38. package/dist/commonjs/text-input/lib/TextInputField.d.ts.map +1 -1
  39. package/dist/commonjs/text-input/lib/TextInputField.js +15 -29
  40. package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +8 -1
  41. package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts.map +1 -1
  42. package/dist/commonjs/text-input/lib/hooks/useTextInputField.js +2 -1
  43. package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +27 -7
  44. package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -1
  45. package/dist/es6/form-field/lib/FormField.d.ts +46 -12
  46. package/dist/es6/form-field/lib/FormField.d.ts.map +1 -1
  47. package/dist/es6/form-field/lib/FormField.js +8 -12
  48. package/dist/es6/form-field/lib/FormFieldHint.d.ts +8 -12
  49. package/dist/es6/form-field/lib/FormFieldHint.d.ts.map +1 -1
  50. package/dist/es6/form-field/lib/FormFieldHint.js +13 -15
  51. package/dist/es6/form-field/lib/FormFieldInput.d.ts +8 -7
  52. package/dist/es6/form-field/lib/FormFieldInput.d.ts.map +1 -1
  53. package/dist/es6/form-field/lib/FormFieldInput.js +7 -21
  54. package/dist/es6/form-field/lib/FormFieldLabel.d.ts +8 -3
  55. package/dist/es6/form-field/lib/FormFieldLabel.d.ts.map +1 -1
  56. package/dist/es6/form-field/lib/FormFieldLabel.js +11 -13
  57. package/dist/es6/form-field/lib/hooks/useFormFieldHint.d.ts +8 -5
  58. package/dist/es6/form-field/lib/hooks/useFormFieldHint.d.ts.map +1 -1
  59. package/dist/es6/form-field/lib/hooks/useFormFieldHint.js +3 -2
  60. package/dist/es6/form-field/lib/hooks/useFormFieldInput.d.ts +8 -5
  61. package/dist/es6/form-field/lib/hooks/useFormFieldInput.d.ts.map +1 -1
  62. package/dist/es6/form-field/lib/hooks/useFormFieldInput.js +3 -2
  63. package/dist/es6/form-field/lib/hooks/useFormFieldLabel.d.ts +8 -5
  64. package/dist/es6/form-field/lib/hooks/useFormFieldLabel.d.ts.map +1 -1
  65. package/dist/es6/form-field/lib/hooks/useFormFieldLabel.js +3 -2
  66. package/dist/es6/form-field/lib/hooks/useFormFieldModel.d.ts +77 -15
  67. package/dist/es6/form-field/lib/hooks/useFormFieldModel.d.ts.map +1 -1
  68. package/dist/es6/form-field/lib/hooks/useFormFieldModel.js +42 -15
  69. package/dist/es6/menu/lib/Menu.js +1 -1
  70. package/dist/es6/text-area/lib/TextArea.d.ts +52 -11
  71. package/dist/es6/text-area/lib/TextArea.d.ts.map +1 -1
  72. package/dist/es6/text-area/lib/TextArea.js +10 -16
  73. package/dist/es6/text-area/lib/TextAreaField.d.ts +15 -7
  74. package/dist/es6/text-area/lib/TextAreaField.d.ts.map +1 -1
  75. package/dist/es6/text-area/lib/TextAreaField.js +17 -18
  76. package/dist/es6/text-area/lib/hooks/useTextAreaModel.d.ts +27 -7
  77. package/dist/es6/text-area/lib/hooks/useTextAreaModel.d.ts.map +1 -1
  78. package/dist/es6/text-input/lib/TextInput.d.ts +59 -11
  79. package/dist/es6/text-input/lib/TextInput.d.ts.map +1 -1
  80. package/dist/es6/text-input/lib/TextInput.js +10 -16
  81. package/dist/es6/text-input/lib/TextInputField.d.ts +15 -7
  82. package/dist/es6/text-input/lib/TextInputField.d.ts.map +1 -1
  83. package/dist/es6/text-input/lib/TextInputField.js +17 -31
  84. package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +8 -1
  85. package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts.map +1 -1
  86. package/dist/es6/text-input/lib/hooks/useTextInputField.js +3 -2
  87. package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +27 -7
  88. package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -1
  89. package/form-field/lib/FormField.tsx +13 -28
  90. package/form-field/lib/FormFieldHint.tsx +21 -32
  91. package/form-field/lib/FormFieldInput.tsx +7 -14
  92. package/form-field/lib/FormFieldLabel.tsx +17 -21
  93. package/form-field/lib/hooks/useFormFieldHint.tsx +3 -3
  94. package/form-field/lib/hooks/useFormFieldInput.tsx +3 -3
  95. package/form-field/lib/hooks/useFormFieldLabel.tsx +3 -3
  96. package/form-field/lib/hooks/useFormFieldModel.tsx +32 -53
  97. package/menu/lib/Menu.tsx +1 -1
  98. package/package.json +7 -16
  99. package/text-area/lib/TextArea.tsx +15 -29
  100. package/text-area/lib/TextAreaField.tsx +30 -44
  101. package/text-area/lib/hooks/useTextAreaModel.ts +1 -3
  102. package/text-input/lib/TextInput.tsx +15 -29
  103. package/text-input/lib/TextInputField.tsx +31 -43
  104. package/text-input/lib/hooks/useTextInputField.tsx +3 -2
  105. package/text-input/lib/hooks/useTextInputModel.ts +1 -3
  106. package/dist/commonjs/text-area/lib/TextAreaHint.d.ts +0 -5
  107. package/dist/commonjs/text-area/lib/TextAreaHint.d.ts.map +0 -1
  108. package/dist/commonjs/text-area/lib/TextAreaHint.js +0 -5
  109. package/dist/commonjs/text-area/lib/TextAreaLabel.d.ts +0 -5
  110. package/dist/commonjs/text-area/lib/TextAreaLabel.d.ts.map +0 -1
  111. package/dist/commonjs/text-area/lib/TextAreaLabel.js +0 -5
  112. package/dist/commonjs/text-input/lib/TextInputHint.d.ts +0 -5
  113. package/dist/commonjs/text-input/lib/TextInputHint.d.ts.map +0 -1
  114. package/dist/commonjs/text-input/lib/TextInputHint.js +0 -5
  115. package/dist/commonjs/text-input/lib/TextInputLabel.d.ts +0 -5
  116. package/dist/commonjs/text-input/lib/TextInputLabel.d.ts.map +0 -1
  117. package/dist/commonjs/text-input/lib/TextInputLabel.js +0 -5
  118. package/dist/es6/text-area/lib/TextAreaHint.d.ts +0 -5
  119. package/dist/es6/text-area/lib/TextAreaHint.d.ts.map +0 -1
  120. package/dist/es6/text-area/lib/TextAreaHint.js +0 -2
  121. package/dist/es6/text-area/lib/TextAreaLabel.d.ts +0 -5
  122. package/dist/es6/text-area/lib/TextAreaLabel.d.ts.map +0 -1
  123. package/dist/es6/text-area/lib/TextAreaLabel.js +0 -2
  124. package/dist/es6/text-input/lib/TextInputHint.d.ts +0 -5
  125. package/dist/es6/text-input/lib/TextInputHint.d.ts.map +0 -1
  126. package/dist/es6/text-input/lib/TextInputHint.js +0 -2
  127. package/dist/es6/text-input/lib/TextInputLabel.d.ts +0 -5
  128. package/dist/es6/text-input/lib/TextInputLabel.d.ts.map +0 -1
  129. package/dist/es6/text-input/lib/TextInputLabel.js +0 -2
  130. package/text-area/lib/TextAreaHint.tsx +0 -6
  131. package/text-area/lib/TextAreaLabel.tsx +0 -6
  132. package/text-input/lib/TextInputHint.tsx +0 -6
  133. package/text-input/lib/TextInputLabel.tsx +0 -6
  134. package/ts3.5/dist/commonjs/breadcrumbs/index.d.ts +0 -5
  135. package/ts3.5/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.d.ts +0 -20
  136. package/ts3.5/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.d.ts +0 -38
  137. package/ts3.5/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/MenuItemLink.d.ts +0 -14
  138. package/ts3.5/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.d.ts +0 -13
  139. package/ts3.5/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/index.d.ts +0 -8
  140. package/ts3.5/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/Collapsible.d.ts +0 -16
  141. package/ts3.5/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.d.ts +0 -11
  142. package/ts3.5/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/Link.d.ts +0 -19
  143. package/ts3.5/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/ListItem.d.ts +0 -4
  144. package/ts3.5/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/hooks.d.ts +0 -19
  145. package/ts3.5/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/index.d.ts +0 -4
  146. package/ts3.5/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/styles.d.ts +0 -3
  147. package/ts3.5/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Nav.d.ts +0 -11
  148. package/ts3.5/dist/commonjs/breadcrumbs/lib/Breadcrumbs/hooks.d.ts +0 -5
  149. package/ts3.5/dist/commonjs/breadcrumbs/lib/Breadcrumbs/index.d.ts +0 -9
  150. package/ts3.5/dist/commonjs/breadcrumbs/lib/Breadcrumbs/types.d.ts +0 -8
  151. package/ts3.5/dist/commonjs/color-picker/index.d.ts +0 -2
  152. package/ts3.5/dist/commonjs/color-picker/lib/ColorPicker.d.ts +0 -55
  153. package/ts3.5/dist/commonjs/color-picker/lib/parts/ColorReset.d.ts +0 -7
  154. package/ts3.5/dist/commonjs/color-picker/lib/parts/SwatchBook.d.ts +0 -7
  155. package/ts3.5/dist/commonjs/form-field/index.d.ts +0 -3
  156. package/ts3.5/dist/commonjs/form-field/lib/FormField.d.ts +0 -31
  157. package/ts3.5/dist/commonjs/form-field/lib/FormFieldHint.d.ts +0 -13
  158. package/ts3.5/dist/commonjs/form-field/lib/FormFieldInput.d.ts +0 -8
  159. package/ts3.5/dist/commonjs/form-field/lib/FormFieldLabel.d.ts +0 -18
  160. package/ts3.5/dist/commonjs/form-field/lib/hooks/index.d.ts +0 -6
  161. package/ts3.5/dist/commonjs/form-field/lib/hooks/useFormFieldHint.d.ts +0 -14
  162. package/ts3.5/dist/commonjs/form-field/lib/hooks/useFormFieldInput.d.ts +0 -17
  163. package/ts3.5/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.d.ts +0 -14
  164. package/ts3.5/dist/commonjs/form-field/lib/hooks/useFormFieldModel.d.ts +0 -36
  165. package/ts3.5/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.d.ts +0 -10
  166. package/ts3.5/dist/commonjs/index.d.ts +0 -9
  167. package/ts3.5/dist/commonjs/menu/index.d.ts +0 -6
  168. package/ts3.5/dist/commonjs/menu/lib/Menu.d.ts +0 -61
  169. package/ts3.5/dist/commonjs/menu/lib/MenuItem.d.ts +0 -53
  170. package/ts3.5/dist/commonjs/select/index.d.ts +0 -6
  171. package/ts3.5/dist/commonjs/select/lib/Select.d.ts +0 -25
  172. package/ts3.5/dist/commonjs/select/lib/SelectBase.d.ts +0 -123
  173. package/ts3.5/dist/commonjs/select/lib/SelectMenu.d.ts +0 -42
  174. package/ts3.5/dist/commonjs/select/lib/SelectOption.d.ts +0 -33
  175. package/ts3.5/dist/commonjs/select/lib/scrolling.d.ts +0 -2
  176. package/ts3.5/dist/commonjs/select/lib/types.d.ts +0 -33
  177. package/ts3.5/dist/commonjs/select/lib/utils.d.ts +0 -4
  178. package/ts3.5/dist/commonjs/side-panel/index.d.ts +0 -6
  179. package/ts3.5/dist/commonjs/side-panel/lib/SidePanel.d.ts +0 -86
  180. package/ts3.5/dist/commonjs/side-panel/lib/hooks.d.ts +0 -80
  181. package/ts3.5/dist/commonjs/text-area/index.d.ts +0 -2
  182. package/ts3.5/dist/commonjs/text-area/lib/TextArea.d.ts +0 -22
  183. package/ts3.5/dist/commonjs/text-area/lib/TextAreaField.d.ts +0 -8
  184. package/ts3.5/dist/commonjs/text-area/lib/TextAreaHint.d.ts +0 -5
  185. package/ts3.5/dist/commonjs/text-area/lib/TextAreaLabel.d.ts +0 -5
  186. package/ts3.5/dist/commonjs/text-area/lib/hooks/index.d.ts +0 -2
  187. package/ts3.5/dist/commonjs/text-area/lib/hooks/useTextAreaModel.d.ts +0 -8
  188. package/ts3.5/dist/commonjs/text-input/index.d.ts +0 -3
  189. package/ts3.5/dist/commonjs/text-input/lib/TextInput.d.ts +0 -22
  190. package/ts3.5/dist/commonjs/text-input/lib/TextInputField.d.ts +0 -8
  191. package/ts3.5/dist/commonjs/text-input/lib/TextInputHint.d.ts +0 -5
  192. package/ts3.5/dist/commonjs/text-input/lib/TextInputLabel.d.ts +0 -5
  193. package/ts3.5/dist/commonjs/text-input/lib/hooks/index.d.ts +0 -3
  194. package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +0 -9
  195. package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +0 -8
  196. package/ts3.5/dist/es6/breadcrumbs/index.d.ts +0 -5
  197. package/ts3.5/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.d.ts +0 -20
  198. package/ts3.5/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.d.ts +0 -38
  199. package/ts3.5/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/MenuItemLink.d.ts +0 -14
  200. package/ts3.5/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.d.ts +0 -13
  201. package/ts3.5/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/index.d.ts +0 -8
  202. package/ts3.5/dist/es6/breadcrumbs/lib/Breadcrumbs/List/Collapsible.d.ts +0 -16
  203. package/ts3.5/dist/es6/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.d.ts +0 -11
  204. package/ts3.5/dist/es6/breadcrumbs/lib/Breadcrumbs/List/Link.d.ts +0 -19
  205. package/ts3.5/dist/es6/breadcrumbs/lib/Breadcrumbs/List/ListItem.d.ts +0 -4
  206. package/ts3.5/dist/es6/breadcrumbs/lib/Breadcrumbs/List/hooks.d.ts +0 -19
  207. package/ts3.5/dist/es6/breadcrumbs/lib/Breadcrumbs/List/index.d.ts +0 -4
  208. package/ts3.5/dist/es6/breadcrumbs/lib/Breadcrumbs/List/styles.d.ts +0 -3
  209. package/ts3.5/dist/es6/breadcrumbs/lib/Breadcrumbs/Nav.d.ts +0 -11
  210. package/ts3.5/dist/es6/breadcrumbs/lib/Breadcrumbs/hooks.d.ts +0 -5
  211. package/ts3.5/dist/es6/breadcrumbs/lib/Breadcrumbs/index.d.ts +0 -9
  212. package/ts3.5/dist/es6/breadcrumbs/lib/Breadcrumbs/types.d.ts +0 -8
  213. package/ts3.5/dist/es6/color-picker/index.d.ts +0 -2
  214. package/ts3.5/dist/es6/color-picker/lib/ColorPicker.d.ts +0 -55
  215. package/ts3.5/dist/es6/color-picker/lib/parts/ColorReset.d.ts +0 -7
  216. package/ts3.5/dist/es6/color-picker/lib/parts/SwatchBook.d.ts +0 -7
  217. package/ts3.5/dist/es6/form-field/index.d.ts +0 -3
  218. package/ts3.5/dist/es6/form-field/lib/FormField.d.ts +0 -31
  219. package/ts3.5/dist/es6/form-field/lib/FormFieldHint.d.ts +0 -13
  220. package/ts3.5/dist/es6/form-field/lib/FormFieldInput.d.ts +0 -8
  221. package/ts3.5/dist/es6/form-field/lib/FormFieldLabel.d.ts +0 -18
  222. package/ts3.5/dist/es6/form-field/lib/hooks/index.d.ts +0 -6
  223. package/ts3.5/dist/es6/form-field/lib/hooks/useFormFieldHint.d.ts +0 -14
  224. package/ts3.5/dist/es6/form-field/lib/hooks/useFormFieldInput.d.ts +0 -17
  225. package/ts3.5/dist/es6/form-field/lib/hooks/useFormFieldLabel.d.ts +0 -14
  226. package/ts3.5/dist/es6/form-field/lib/hooks/useFormFieldModel.d.ts +0 -36
  227. package/ts3.5/dist/es6/form-field/lib/hooks/useFormFieldOrientation.d.ts +0 -10
  228. package/ts3.5/dist/es6/index.d.ts +0 -9
  229. package/ts3.5/dist/es6/menu/index.d.ts +0 -6
  230. package/ts3.5/dist/es6/menu/lib/Menu.d.ts +0 -61
  231. package/ts3.5/dist/es6/menu/lib/MenuItem.d.ts +0 -53
  232. package/ts3.5/dist/es6/select/index.d.ts +0 -6
  233. package/ts3.5/dist/es6/select/lib/Select.d.ts +0 -25
  234. package/ts3.5/dist/es6/select/lib/SelectBase.d.ts +0 -123
  235. package/ts3.5/dist/es6/select/lib/SelectMenu.d.ts +0 -42
  236. package/ts3.5/dist/es6/select/lib/SelectOption.d.ts +0 -33
  237. package/ts3.5/dist/es6/select/lib/scrolling.d.ts +0 -2
  238. package/ts3.5/dist/es6/select/lib/types.d.ts +0 -33
  239. package/ts3.5/dist/es6/select/lib/utils.d.ts +0 -4
  240. package/ts3.5/dist/es6/side-panel/index.d.ts +0 -6
  241. package/ts3.5/dist/es6/side-panel/lib/SidePanel.d.ts +0 -86
  242. package/ts3.5/dist/es6/side-panel/lib/hooks.d.ts +0 -80
  243. package/ts3.5/dist/es6/text-area/index.d.ts +0 -2
  244. package/ts3.5/dist/es6/text-area/lib/TextArea.d.ts +0 -22
  245. package/ts3.5/dist/es6/text-area/lib/TextAreaField.d.ts +0 -8
  246. package/ts3.5/dist/es6/text-area/lib/TextAreaHint.d.ts +0 -5
  247. package/ts3.5/dist/es6/text-area/lib/TextAreaLabel.d.ts +0 -5
  248. package/ts3.5/dist/es6/text-area/lib/hooks/index.d.ts +0 -2
  249. package/ts3.5/dist/es6/text-area/lib/hooks/useTextAreaModel.d.ts +0 -8
  250. package/ts3.5/dist/es6/text-input/index.d.ts +0 -3
  251. package/ts3.5/dist/es6/text-input/lib/TextInput.d.ts +0 -22
  252. package/ts3.5/dist/es6/text-input/lib/TextInputField.d.ts +0 -8
  253. package/ts3.5/dist/es6/text-input/lib/TextInputHint.d.ts +0 -5
  254. package/ts3.5/dist/es6/text-input/lib/TextInputLabel.d.ts +0 -5
  255. package/ts3.5/dist/es6/text-input/lib/hooks/index.d.ts +0 -3
  256. package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +0 -9
  257. package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +0 -8
@@ -1,14 +1,7 @@
1
1
  import React from 'react';
2
2
  import { ExtractProps } from '@workday/canvas-kit-react/common';
3
3
  import { Stack, StackSpacing } from '@workday/canvas-kit-react/layout';
4
- import { FormFieldModel, FormFieldModelConfig } from './hooks';
5
- export declare const FormFieldModelContext: 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 FormFieldProps extends FormFieldModelConfig, Omit<ExtractProps<typeof Stack, never>, 'spacing'> {
11
- model?: FormFieldModel;
4
+ export interface FormFieldProps extends Omit<ExtractProps<typeof Stack, never>, 'spacing'> {
12
5
  /**
13
6
  * Children of the Text Input. Should contain a `<FormField.Input>`, a `<FormField.Label>` and an optional `<FormField.Hint>`
14
7
  */
@@ -23,9 +16,50 @@ export interface FormFieldProps extends FormFieldModelConfig, Omit<ExtractProps<
23
16
  */
24
17
  spacing?: StackSpacing;
25
18
  }
26
- export declare const FormField: import("@workday/canvas-kit-react/common").Component<FormFieldProps> & {
27
- Input: import("@workday/canvas-kit-react/common").ElementComponent<"input", import("./FormFieldInput").FormFieldInputProps>;
28
- Label: import("@workday/canvas-kit-react/common").ElementComponent<"label", import("./FormFieldLabel").FormFieldLabelProps>;
29
- Hint: import("@workday/canvas-kit-react/common").ElementComponent<"p", import("./FormFieldHint").FormFieldHintProps>;
19
+ export declare const FormField: import("@workday/canvas-kit-react/common").ElementComponentM<"div", FormFieldProps & Partial<{
20
+ hasError: boolean;
21
+ id: string;
22
+ isRequired: boolean;
23
+ }> & {} & {}, {
24
+ state: {
25
+ id: string;
26
+ hasError: boolean;
27
+ isRequired: boolean;
28
+ };
29
+ events: {};
30
+ }> & {
31
+ Context: React.Context<{
32
+ state: {
33
+ id: string;
34
+ hasError: boolean;
35
+ isRequired: boolean;
36
+ };
37
+ events: {};
38
+ }>;
39
+ } & {
40
+ Input: import("@workday/canvas-kit-react/common").ElementComponentM<"input", import("@workday/canvas-kit-react/layout").BorderShorthandStyleProps & import("@workday/canvas-kit-react/layout").BorderColorStyleProps & import("@workday/canvas-kit-react/layout").BorderRadiusStyleProps & import("@workday/canvas-kit-react/layout").BorderLineStyleProps & import("@workday/canvas-kit-react/layout").BorderWidthStyleProps & import("@workday/canvas-kit-react/layout").BorderLogicalStyleProps & import("@workday/canvas-kit-react/layout").ColorStyleProps & import("@workday/canvas-kit-react/layout").DepthStyleProps & import("@workday/canvas-kit-react/layout").FlexItemStyleProps & import("@workday/canvas-kit-react/layout").LayoutStyleProps & import("@workday/canvas-kit-react/layout/lib/utils/other").OtherStyleProps & import("@workday/canvas-kit-react/layout").PositionStandardProps & import("@workday/canvas-kit-react/layout").PositionLogicalProps & import("@workday/canvas-kit-react/layout/lib/utils/space").SpaceStandardProps & import("@workday/canvas-kit-react/layout/lib/utils/space").SpaceLogicalProps, {
41
+ state: {
42
+ id: string;
43
+ hasError: boolean;
44
+ isRequired: boolean;
45
+ };
46
+ events: {};
47
+ }>;
48
+ Label: import("@workday/canvas-kit-react/common").ElementComponentM<"label", import("./FormFieldLabel").FormFieldLabelProps, {
49
+ state: {
50
+ id: string;
51
+ hasError: boolean;
52
+ isRequired: boolean;
53
+ };
54
+ events: {};
55
+ }>;
56
+ Hint: import("@workday/canvas-kit-react/common").ElementComponentM<"p", import("@workday/canvas-kit-react/layout").BorderShorthandStyleProps & import("@workday/canvas-kit-react/layout").BorderColorStyleProps & import("@workday/canvas-kit-react/layout").BorderRadiusStyleProps & import("@workday/canvas-kit-react/layout").BorderLineStyleProps & import("@workday/canvas-kit-react/layout").BorderWidthStyleProps & import("@workday/canvas-kit-react/layout").BorderLogicalStyleProps & import("@workday/canvas-kit-react/layout").ColorStyleProps & import("@workday/canvas-kit-react/layout").DepthStyleProps & import("@workday/canvas-kit-react/layout").FlexItemStyleProps & import("@workday/canvas-kit-react/layout").LayoutStyleProps & import("@workday/canvas-kit-react/layout/lib/utils/other").OtherStyleProps & import("@workday/canvas-kit-react/layout").PositionStandardProps & import("@workday/canvas-kit-react/layout").PositionLogicalProps & import("@workday/canvas-kit-react/layout/lib/utils/space").SpaceStandardProps & import("@workday/canvas-kit-react/layout/lib/utils/space").SpaceLogicalProps, {
57
+ state: {
58
+ id: string;
59
+ hasError: boolean;
60
+ isRequired: boolean;
61
+ };
62
+ events: {};
63
+ }>;
30
64
  };
31
65
  //# sourceMappingURL=FormField.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormField.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAkB,YAAY,EAAkB,MAAM,kCAAkC,CAAC;AAChG,OAAO,EAAC,KAAK,EAAE,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAErE,OAAO,EAEL,cAAc,EACd,oBAAoB,EAErB,MAAM,SAAS,CAAC;AAKjB,eAAO,MAAM,qBAAqB;;;;OAAiD,CAAC;AAEpF,MAAM,WAAW,cACf,SAAQ,oBAAoB,EAC1B,IAAI,CAAC,YAAY,CAAC,OAAO,KAAK,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC;IACpD,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,WAAW,EAAE,UAAU,GAAG,YAAY,CAAC;IACvC;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;AAED,eAAO,MAAM,SAAS;;;;CAqBpB,CAAC"}
1
+ {"version":3,"file":"FormField.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAkB,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAC,KAAK,EAAE,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAOrE,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,YAAY,CAAC,OAAO,KAAK,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC;IACxF;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,WAAW,EAAE,UAAU,GAAG,YAAY,CAAC;IACvC;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;AAED,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBpB,CAAC"}
@@ -25,7 +25,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
25
25
  return (mod && mod.__esModule) ? mod : { "default": mod };
26
26
  };
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.FormField = exports.FormFieldModelContext = void 0;
28
+ exports.FormField = void 0;
29
29
  var react_1 = __importDefault(require("react"));
30
30
  var common_1 = require("@workday/canvas-kit-react/common");
31
31
  var layout_1 = require("@workday/canvas-kit-react/layout");
@@ -33,20 +33,16 @@ var hooks_1 = require("./hooks");
33
33
  var FormFieldInput_1 = require("./FormFieldInput");
34
34
  var FormFieldLabel_1 = require("./FormFieldLabel");
35
35
  var FormFieldHint_1 = require("./FormFieldHint");
36
- exports.FormFieldModelContext = react_1.default.createContext({});
37
- exports.FormField = common_1.createComponent()({
36
+ exports.FormField = common_1.createContainer('div')({
38
37
  displayName: 'FormField',
39
- Component: function (_a, ref) {
40
- var children = _a.children, model = _a.model, spacing = _a.spacing, orientation = _a.orientation, props = __rest(_a, ["children", "model", "spacing", "orientation"]);
41
- var hasError = props.hasError, id = props.id, isRequired = props.isRequired, elemProps = __rest(props, ["hasError", "id", "isRequired"]);
42
- var value = common_1.useDefaultModel(model, { hasError: hasError, id: id, isRequired: isRequired }, hooks_1.useFormFieldModel);
43
- var layoutProps = hooks_1.useFormFieldOrientation(orientation);
44
- return (react_1.default.createElement(exports.FormFieldModelContext.Provider, { value: value },
45
- react_1.default.createElement(layout_1.Stack, __assign({ ref: ref }, layoutProps, elemProps), children)));
46
- },
38
+ modelHook: hooks_1.useFormFieldModel,
47
39
  subComponents: {
48
40
  Input: FormFieldInput_1.FormFieldInput,
49
41
  Label: FormFieldLabel_1.FormFieldLabel,
50
42
  Hint: FormFieldHint_1.FormFieldHint,
51
43
  },
44
+ })(function (_a, Element) {
45
+ var children = _a.children, orientation = _a.orientation, elemProps = __rest(_a, ["children", "orientation"]);
46
+ var layoutProps = hooks_1.useFormFieldOrientation(orientation);
47
+ return (react_1.default.createElement(layout_1.Stack, __assign({ as: Element }, layoutProps, elemProps), children));
52
48
  });
@@ -1,13 +1,9 @@
1
- import React from 'react';
2
- import { ExtractProps } from '@workday/canvas-kit-react/common';
3
- import { Box } from '@workday/canvas-kit-react/layout';
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>;
1
+ export declare const FormFieldHint: import("@workday/canvas-kit-react/common").ElementComponentM<"p", import("@workday/canvas-kit-react/layout").BorderShorthandStyleProps & import("@workday/canvas-kit-react/layout").BorderColorStyleProps & import("@workday/canvas-kit-react/layout").BorderRadiusStyleProps & import("@workday/canvas-kit-react/layout").BorderLineStyleProps & import("@workday/canvas-kit-react/layout").BorderWidthStyleProps & import("@workday/canvas-kit-react/layout").BorderLogicalStyleProps & import("@workday/canvas-kit-react/layout").ColorStyleProps & import("@workday/canvas-kit-react/layout").DepthStyleProps & import("@workday/canvas-kit-react/layout").FlexItemStyleProps & import("@workday/canvas-kit-react/layout").LayoutStyleProps & import("@workday/canvas-kit-react/layout/lib/utils/other").OtherStyleProps & import("@workday/canvas-kit-react/layout").PositionStandardProps & import("@workday/canvas-kit-react/layout").PositionLogicalProps & import("@workday/canvas-kit-react/layout/lib/utils/space").SpaceStandardProps & import("@workday/canvas-kit-react/layout/lib/utils/space").SpaceLogicalProps, {
2
+ state: {
3
+ id: string;
4
+ hasError: boolean;
5
+ isRequired: boolean;
6
+ };
7
+ events: {};
8
+ }>;
13
9
  //# sourceMappingURL=FormFieldHint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormFieldHint.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormFieldHint.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,YAAY,EAKb,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAC,GAAG,EAAW,MAAM,kCAAkC,CAAC;AAG/D,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;AAMD,eAAO,MAAM,aAAa,sFAuBxB,CAAC"}
1
+ {"version":3,"file":"FormFieldHint.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormFieldHint.tsx"],"names":[],"mappings":"AAiBA,eAAO,MAAM,aAAa;;;;;;;EAsBxB,CAAC"}
@@ -30,20 +30,18 @@ var react_1 = __importDefault(require("react"));
30
30
  var common_1 = require("@workday/canvas-kit-react/common");
31
31
  var tokens_1 = require("@workday/canvas-kit-react/tokens");
32
32
  var layout_1 = require("@workday/canvas-kit-react/layout");
33
- var FormField_1 = require("./FormField");
34
33
  var hooks_1 = require("./hooks");
35
34
  var StyledHint = common_1.styled(layout_1.Box)(__assign({}, tokens_1.type.levels.subtext.medium));
36
- exports.FormFieldHint = common_1.createComponent('p')({
35
+ exports.FormFieldHint = common_1.createSubcomponent('p')({
37
36
  displayName: 'FormField.Hint',
38
- Component: function (_a, ref, Element) {
39
- var model = _a.model, children = _a.children, elemProps = __rest(_a, ["model", "children"]);
40
- var localModel = common_1.useModelContext(FormField_1.FormFieldModelContext, model);
41
- var props = hooks_1.useFormFieldHint(localModel, elemProps, ref);
42
- var theme = common_1.useTheme();
43
- if (!children) {
44
- // If there is no hint text just skip rendering
45
- return null;
46
- }
47
- return (react_1.default.createElement(StyledHint, __assign({ as: Element, color: localModel.state.hasError ? theme.canvas.palette.error.main : undefined, marginY: tokens_1.space.xxs }, props), children));
48
- },
37
+ modelHook: hooks_1.useFormFieldModel,
38
+ elemPropsHook: hooks_1.useFormFieldHint,
39
+ })(function (_a, Element, model) {
40
+ var children = _a.children, elemProps = __rest(_a, ["children"]);
41
+ var theme = common_1.useTheme();
42
+ if (!children) {
43
+ // If there is no hint text just skip rendering
44
+ return null;
45
+ }
46
+ return (react_1.default.createElement(StyledHint, __assign({ as: Element, color: model.state.hasError ? theme.canvas.palette.error.main : undefined, marginY: tokens_1.space.xxs }, elemProps), children));
49
47
  });
@@ -1,8 +1,9 @@
1
- import { ExtractProps } from '@workday/canvas-kit-react/common';
2
- import { Box } from '@workday/canvas-kit-react/layout';
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>;
1
+ export declare const FormFieldInput: import("@workday/canvas-kit-react/common").ElementComponentM<"input", import("@workday/canvas-kit-react/layout").BorderShorthandStyleProps & import("@workday/canvas-kit-react/layout").BorderColorStyleProps & import("@workday/canvas-kit-react/layout").BorderRadiusStyleProps & import("@workday/canvas-kit-react/layout").BorderLineStyleProps & import("@workday/canvas-kit-react/layout").BorderWidthStyleProps & import("@workday/canvas-kit-react/layout").BorderLogicalStyleProps & import("@workday/canvas-kit-react/layout").ColorStyleProps & import("@workday/canvas-kit-react/layout").DepthStyleProps & import("@workday/canvas-kit-react/layout").FlexItemStyleProps & import("@workday/canvas-kit-react/layout").LayoutStyleProps & import("@workday/canvas-kit-react/layout/lib/utils/other").OtherStyleProps & import("@workday/canvas-kit-react/layout").PositionStandardProps & import("@workday/canvas-kit-react/layout").PositionLogicalProps & import("@workday/canvas-kit-react/layout/lib/utils/space").SpaceStandardProps & import("@workday/canvas-kit-react/layout/lib/utils/space").SpaceLogicalProps, {
2
+ state: {
3
+ id: string;
4
+ hasError: boolean;
5
+ isRequired: boolean;
6
+ };
7
+ events: {};
8
+ }>;
8
9
  //# sourceMappingURL=FormFieldInput.d.ts.map
@@ -1 +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,kCAAkC,CAAC;AAGrD,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"}
1
+ {"version":3,"file":"FormFieldInput.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormFieldInput.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,cAAc;;;;;;;EAMzB,CAAC"}
@@ -10,17 +10,6 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- var __rest = (this && this.__rest) || function (s, e) {
14
- var t = {};
15
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
- t[p] = s[p];
17
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
- t[p[i]] = s[p[i]];
21
- }
22
- return t;
23
- };
24
13
  var __importDefault = (this && this.__importDefault) || function (mod) {
25
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
26
15
  };
@@ -29,14 +18,11 @@ exports.FormFieldInput = void 0;
29
18
  var react_1 = __importDefault(require("react"));
30
19
  var common_1 = require("@workday/canvas-kit-react/common");
31
20
  var layout_1 = require("@workday/canvas-kit-react/layout");
32
- var FormField_1 = require("./FormField");
33
21
  var hooks_1 = require("./hooks");
34
- exports.FormFieldInput = common_1.createComponent('input')({
22
+ exports.FormFieldInput = common_1.createSubcomponent('input')({
35
23
  displayName: 'FormField.Input',
36
- Component: function (_a, ref, Element) {
37
- var model = _a.model, elemProps = __rest(_a, ["model"]);
38
- var localModel = common_1.useModelContext(FormField_1.FormFieldModelContext, model);
39
- var props = hooks_1.useFormFieldInput(localModel, elemProps, ref);
40
- return react_1.default.createElement(layout_1.Box, __assign({ as: Element }, props));
41
- },
24
+ modelHook: hooks_1.useFormFieldModel,
25
+ elemPropsHook: hooks_1.useFormFieldInput,
26
+ })(function (elemProps, Element) {
27
+ return react_1.default.createElement(layout_1.Box, __assign({ as: Element }, elemProps));
42
28
  });
@@ -1,9 +1,7 @@
1
1
  import React from 'react';
2
2
  import { ExtractProps } from '@workday/canvas-kit-react/common';
3
3
  import { HStack, StackSpacing } from '@workday/canvas-kit-react/layout';
4
- import { FormFieldModel } from './hooks';
5
4
  export interface FormFieldLabelProps extends Omit<ExtractProps<typeof HStack, never>, 'spacing'> {
6
- model?: FormFieldModel;
7
5
  /**
8
6
  * The text of the label.
9
7
  */
@@ -14,5 +12,12 @@ export interface FormFieldLabelProps extends Omit<ExtractProps<typeof HStack, ne
14
12
  */
15
13
  spacing?: StackSpacing;
16
14
  }
17
- export declare const FormFieldLabel: import("@workday/canvas-kit-react/common").ElementComponent<"label", FormFieldLabelProps>;
15
+ export declare const FormFieldLabel: import("@workday/canvas-kit-react/common").ElementComponentM<"label", FormFieldLabelProps, {
16
+ state: {
17
+ id: string;
18
+ hasError: boolean;
19
+ isRequired: boolean;
20
+ };
21
+ events: {};
22
+ }>;
18
23
  //# sourceMappingURL=FormFieldLabel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormFieldLabel.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormFieldLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAEL,YAAY,EAKb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAM,MAAM,EAAE,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAI3E,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;AAaD,eAAO,MAAM,cAAc,2FAkBzB,CAAC"}
1
+ {"version":3,"file":"FormFieldLabel.d.ts","sourceRoot":"","sources":["../../../../form-field/lib/FormFieldLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAEL,YAAY,EAIb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAM,MAAM,EAAE,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAK3E,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,YAAY,CAAC,OAAO,MAAM,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC;IAC9F;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;AAaD,eAAO,MAAM,cAAc;;;;;;;EAiBzB,CAAC"}
@@ -30,7 +30,6 @@ var react_1 = __importDefault(require("react"));
30
30
  var common_1 = require("@workday/canvas-kit-react/common");
31
31
  var layout_1 = require("@workday/canvas-kit-react/layout");
32
32
  var tokens_1 = require("@workday/canvas-kit-react/tokens");
33
- var FormField_1 = require("./FormField");
34
33
  var hooks_1 = require("./hooks");
35
34
  var StyledFormFieldLabel = common_1.styled('span')(__assign(__assign({}, tokens_1.type.levels.subtext.large), { fontWeight: tokens_1.type.properties.fontWeights.medium }));
36
35
  var StyledAsterisk = common_1.styled(layout_1.Box)({
@@ -38,15 +37,14 @@ var StyledAsterisk = common_1.styled(layout_1.Box)({
38
37
  fontWeight: tokens_1.type.properties.fontWeights.regular,
39
38
  textDecoration: 'unset',
40
39
  });
41
- exports.FormFieldLabel = common_1.createComponent('label')({
40
+ exports.FormFieldLabel = common_1.createSubcomponent('label')({
42
41
  displayName: 'FormField.Label',
43
- Component: function (_a, ref) {
44
- var _b = _a.spacing, spacing = _b === void 0 ? 'xxxs' : _b, model = _a.model, children = _a.children, elemProps = __rest(_a, ["spacing", "model", "children"]);
45
- var localModel = common_1.useModelContext(FormField_1.FormFieldModelContext, model);
46
- var props = hooks_1.useFormFieldLabel(localModel, elemProps, ref);
47
- var theme = common_1.useTheme();
48
- return (react_1.default.createElement(layout_1.HStack, __assign({ as: "label", spacing: spacing, minWidth: "180px" }, props),
49
- react_1.default.createElement(StyledFormFieldLabel, null, children),
50
- localModel.state.isRequired && (react_1.default.createElement(StyledAsterisk, { as: "span", color: theme.canvas.palette.error.main, "aria-hidden": "true" }, "*"))));
51
- },
42
+ modelHook: hooks_1.useFormFieldModel,
43
+ elemPropsHook: hooks_1.useFormFieldLabel,
44
+ })(function (_a, Element, model) {
45
+ var _b = _a.spacing, spacing = _b === void 0 ? 'xxxs' : _b, children = _a.children, elemProps = __rest(_a, ["spacing", "children"]);
46
+ var theme = common_1.useTheme();
47
+ return (react_1.default.createElement(layout_1.HStack, __assign({ as: Element, spacing: spacing, minWidth: "180px" }, elemProps),
48
+ react_1.default.createElement(StyledFormFieldLabel, null, children),
49
+ model.state.isRequired && (react_1.default.createElement(StyledAsterisk, { as: "span", color: theme.canvas.palette.error.main, "aria-hidden": "true" }, "*"))));
52
50
  });
@@ -2,11 +2,14 @@
2
2
  * Adds the necessary props to a `Hint` component.
3
3
  * Used by the FormField.Hint subcomponent and other input type components
4
4
  */
5
- export declare const useFormFieldHint: <P extends {}, R>(model: import("@workday/canvas-kit-react/common").Model<{
6
- hasError?: boolean | undefined;
7
- id?: string | undefined;
8
- isRequired?: boolean | undefined;
9
- }, {}>, elemProps?: P | undefined, ref?: ((instance: R | null) => void) | import("react").RefObject<R> | null | undefined) => {
5
+ export declare const useFormFieldHint: <P extends {}, R>(model: {
6
+ state: {
7
+ id: string;
8
+ hasError: boolean;
9
+ isRequired: boolean;
10
+ };
11
+ events: {};
12
+ }, elemProps?: P | undefined, ref?: ((instance: R | null) => void) | import("react").RefObject<R> | null | undefined) => {
10
13
  id: string;
11
14
  } & P & (R extends HTMLOrSVGElement ? {
12
15
  ref: import("react").Ref<R>;
@@ -1 +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"}
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"}
@@ -2,11 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useFormFieldHint = void 0;
4
4
  var common_1 = require("@workday/canvas-kit-react/common");
5
+ var useFormFieldModel_1 = require("./useFormFieldModel");
5
6
  /**
6
7
  * Adds the necessary props to a `Hint` component.
7
8
  * Used by the FormField.Hint subcomponent and other input type components
8
9
  */
9
- exports.useFormFieldHint = common_1.createHook(function (_a) {
10
+ exports.useFormFieldHint = common_1.createElemPropsHook(useFormFieldModel_1.useFormFieldModel)(function (_a) {
10
11
  var state = _a.state;
11
12
  return {
12
13
  id: "hint-" + state.id,
@@ -2,11 +2,14 @@
2
2
  * Adds the necessary props to an `Input` component.
3
3
  * Used by the FormField.Input subcomponent and other input type components
4
4
  */
5
- export declare const useFormFieldInput: <P extends {}, R>(model: import("@workday/canvas-kit-react/common").Model<{
6
- hasError?: boolean | undefined;
7
- id?: string | undefined;
8
- isRequired?: boolean | undefined;
9
- }, {}>, elemProps?: P | undefined, ref?: ((instance: R | null) => void) | import("react").RefObject<R> | null | undefined) => {
5
+ export declare const useFormFieldInput: <P extends {}, R>(model: {
6
+ state: {
7
+ id: string;
8
+ hasError: boolean;
9
+ isRequired: boolean;
10
+ };
11
+ events: {};
12
+ }, elemProps?: P | undefined, ref?: ((instance: R | null) => void) | import("react").RefObject<R> | null | undefined) => {
10
13
  required: boolean | undefined;
11
14
  'aria-invalid': boolean | undefined;
12
15
  'aria-describedby': string;
@@ -1 +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"}
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"}
@@ -2,11 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useFormFieldInput = void 0;
4
4
  var common_1 = require("@workday/canvas-kit-react/common");
5
+ var useFormFieldModel_1 = require("./useFormFieldModel");
5
6
  /**
6
7
  * Adds the necessary props to an `Input` component.
7
8
  * Used by the FormField.Input subcomponent and other input type components
8
9
  */
9
- exports.useFormFieldInput = common_1.createHook(function (_a) {
10
+ exports.useFormFieldInput = common_1.createElemPropsHook(useFormFieldModel_1.useFormFieldModel)(function (_a) {
10
11
  var state = _a.state;
11
12
  return {
12
13
  required: state.isRequired ? true : undefined,
@@ -2,11 +2,14 @@
2
2
  * Adds the necessary props to a `Label` component.
3
3
  * Used by the FormField.Label subcomponent and other input type components
4
4
  */
5
- export declare const useFormFieldLabel: <P extends {}, R>(model: import("@workday/canvas-kit-react/common").Model<{
6
- hasError?: boolean | undefined;
7
- id?: string | undefined;
8
- isRequired?: boolean | undefined;
9
- }, {}>, elemProps?: P | undefined, ref?: ((instance: R | null) => void) | import("react").RefObject<R> | null | undefined) => {
5
+ export declare const useFormFieldLabel: <P extends {}, R>(model: {
6
+ state: {
7
+ id: string;
8
+ hasError: boolean;
9
+ isRequired: boolean;
10
+ };
11
+ events: {};
12
+ }, elemProps?: P | undefined, ref?: ((instance: R | null) => void) | import("react").RefObject<R> | null | undefined) => {
10
13
  htmlFor: string;
11
14
  } & P & (R extends HTMLOrSVGElement ? {
12
15
  ref: import("react").Ref<R>;
@@ -1 +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"}
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"}
@@ -2,11 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useFormFieldLabel = void 0;
4
4
  var common_1 = require("@workday/canvas-kit-react/common");
5
+ var useFormFieldModel_1 = require("./useFormFieldModel");
5
6
  /**
6
7
  * Adds the necessary props to a `Label` component.
7
8
  * Used by the FormField.Label subcomponent and other input type components
8
9
  */
9
- exports.useFormFieldLabel = common_1.createHook(function (_a) {
10
+ exports.useFormFieldLabel = common_1.createElemPropsHook(useFormFieldModel_1.useFormFieldModel)(function (_a) {
10
11
  var state = _a.state;
11
12
  return {
12
13
  htmlFor: "input-" + state.id,
@@ -1,11 +1,10 @@
1
- import { Model, ToModelConfig } from '@workday/canvas-kit-react/common';
2
- declare type FormFieldState = {
1
+ export declare const useFormFieldModel: (<TT_Special_Generic>(config?: (Partial<{
3
2
  /**
4
3
  * Optional flag to denote if this field has an error to display. When true the `FormField.Input` will have
5
4
  * `required` set to true, and usually some subcomponents will have a error color applied.
6
5
  * @default false
7
6
  */
8
- hasError?: boolean;
7
+ hasError: boolean;
9
8
  /**
10
9
  * Optional `id` provided to `FormField`'s subcomponents as HTML attributes:
11
10
  * - `FormField.Input` will set `aria-describedby` to `hint-${id}`
@@ -16,21 +15,84 @@ declare type FormFieldState = {
16
15
  * If a value is not provided, a unique id will be automatically created by `useUniqueId()`.
17
16
  * @default `useUniqueId()`
18
17
  */
19
- id?: string;
18
+ id: string;
20
19
  /**
21
20
  * Optional flag to denote if this field is required. When true the `FormField.Input` will have
22
21
  * `required` set to true, and an asterisk will be appended to the `FormField.Label`.
23
22
  * @default false
24
23
  */
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) => FormFieldModel;
35
- export {};
24
+ isRequired: boolean;
25
+ }> & {} & {}) | undefined) => {
26
+ state: {
27
+ id: string;
28
+ /**
29
+ * Optional flag to denote if this field has an error to display. When true the `FormField.Input` will have
30
+ * `required` set to true, and usually some subcomponents will have a error color applied.
31
+ * @default false
32
+ */
33
+ hasError: boolean;
34
+ /**
35
+ * Optional flag to denote if this field is required. When true the `FormField.Input` will have
36
+ * `required` set to true, and an asterisk will be appended to the `FormField.Label`.
37
+ * @default false
38
+ */
39
+ isRequired: boolean;
40
+ };
41
+ events: {};
42
+ }) & import("@workday/canvas-kit-react/common").ModelExtras<{
43
+ /**
44
+ * Optional flag to denote if this field has an error to display. When true the `FormField.Input` will have
45
+ * `required` set to true, and usually some subcomponents will have a error color applied.
46
+ * @default false
47
+ */
48
+ hasError: boolean;
49
+ /**
50
+ * Optional `id` provided to `FormField`'s subcomponents as HTML attributes:
51
+ * - `FormField.Input` will set `aria-describedby` to `hint-${id}`
52
+ * - `FormField.Input` will set `id` to `input-${id}`
53
+ * - `FormField.Label` will set `htmlFor` to `input-${id}`
54
+ * - `FormField.Hint` will set `id` to `hint-${id}`
55
+ *
56
+ * If a value is not provided, a unique id will be automatically created by `useUniqueId()`.
57
+ * @default `useUniqueId()`
58
+ */
59
+ id: string;
60
+ /**
61
+ * Optional flag to denote if this field is required. When true the `FormField.Input` will have
62
+ * `required` set to true, and an asterisk will be appended to the `FormField.Label`.
63
+ * @default false
64
+ */
65
+ isRequired: boolean;
66
+ }, {}, {
67
+ id: string;
68
+ /**
69
+ * Optional flag to denote if this field has an error to display. When true the `FormField.Input` will have
70
+ * `required` set to true, and usually some subcomponents will have a error color applied.
71
+ * @default false
72
+ */
73
+ hasError: boolean;
74
+ /**
75
+ * Optional flag to denote if this field is required. When true the `FormField.Input` will have
76
+ * `required` set to true, and an asterisk will be appended to the `FormField.Label`.
77
+ * @default false
78
+ */
79
+ isRequired: boolean;
80
+ }, {}, {
81
+ state: {
82
+ id: string;
83
+ /**
84
+ * Optional flag to denote if this field has an error to display. When true the `FormField.Input` will have
85
+ * `required` set to true, and usually some subcomponents will have a error color applied.
86
+ * @default false
87
+ */
88
+ hasError: boolean;
89
+ /**
90
+ * Optional flag to denote if this field is required. When true the `FormField.Input` will have
91
+ * `required` set to true, and an asterisk will be appended to the `FormField.Label`.
92
+ * @default false
93
+ */
94
+ isRequired: boolean;
95
+ };
96
+ events: {};
97
+ }>;
36
98
  //# sourceMappingURL=useFormFieldModel.d.ts.map
@@ -1 +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,YAAY,oBAAoB,KAAQ,cAerE,CAAC"}
1
+ {"version":3,"file":"useFormFieldModel.d.ts","sourceRoot":"","sources":["../../../../../form-field/lib/hooks/useFormFieldModel.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB;IAE1B;;;;OAIG;;IAEH;;;;;;;;;OASG;;IAEH;;;;OAIG;;;;;QArBH;;;;WAIG;;QAaH;;;;WAIG;;;;;IArBH;;;;OAIG;;IAEH;;;;;;;;;OASG;;IAEH;;;;OAIG;;;;IArBH;;;;OAIG;;IAaH;;;;OAIG;;;;;QArBH;;;;WAIG;;QAaH;;;;WAIG;;;;EAeL,CAAC"}
@@ -1,23 +1,49 @@
1
1
  "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
2
13
  Object.defineProperty(exports, "__esModule", { value: true });
3
14
  exports.useFormFieldModel = void 0;
4
15
  var common_1 = require("@workday/canvas-kit-react/common");
5
- var formFieldEventMap = common_1.createEventMap()({
6
- guards: {},
7
- callbacks: {},
8
- });
9
- var useFormFieldModel = function (config) {
10
- if (config === void 0) { config = {}; }
16
+ exports.useFormFieldModel = common_1.createModelHook({
17
+ defaultConfig: {
18
+ /**
19
+ * Optional flag to denote if this field has an error to display. When true the `FormField.Input` will have
20
+ * `required` set to true, and usually some subcomponents will have a error color applied.
21
+ * @default false
22
+ */
23
+ hasError: false,
24
+ /**
25
+ * Optional `id` provided to `FormField`'s subcomponents as HTML attributes:
26
+ * - `FormField.Input` will set `aria-describedby` to `hint-${id}`
27
+ * - `FormField.Input` will set `id` to `input-${id}`
28
+ * - `FormField.Label` will set `htmlFor` to `input-${id}`
29
+ * - `FormField.Hint` will set `id` to `hint-${id}`
30
+ *
31
+ * If a value is not provided, a unique id will be automatically created by `useUniqueId()`.
32
+ * @default `useUniqueId()`
33
+ */
34
+ id: '',
35
+ /**
36
+ * Optional flag to denote if this field is required. When true the `FormField.Input` will have
37
+ * `required` set to true, and an asterisk will be appended to the `FormField.Label`.
38
+ * @default false
39
+ */
40
+ isRequired: false,
41
+ },
42
+ })(function (config) {
11
43
  var id = common_1.useUniqueId(config.id);
12
- var state = {
13
- hasError: config.hasError,
14
- isRequired: config.isRequired,
15
- id: id,
16
- };
17
- var events = common_1.useEventMap(formFieldEventMap, state, config, {});
44
+ var state = __assign(__assign({}, config), { id: id });
18
45
  return {
19
46
  state: state,
20
- events: events,
47
+ events: {},
21
48
  };
22
- };
23
- exports.useFormFieldModel = useFormFieldModel;
49
+ });