@workday/canvas-kit-preview-react 5.3.0-next.3 → 5.3.0-next.32

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 (295) hide show
  1. package/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.tsx +0 -2
  2. package/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.ts +0 -1
  3. package/breadcrumbs/lib/Breadcrumbs/List/Collapsible.tsx +0 -1
  4. package/breadcrumbs/lib/Breadcrumbs/List/hooks.ts +5 -5
  5. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.d.ts.map +1 -1
  6. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.js +0 -1
  7. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.d.ts.map +1 -1
  8. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.js +0 -1
  9. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/Collapsible.d.ts.map +1 -1
  10. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/Collapsible.js +0 -1
  11. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/hooks.d.ts +1 -1
  12. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/hooks.js +4 -4
  13. package/dist/commonjs/form-field/index.d.ts +3 -0
  14. package/dist/commonjs/form-field/index.d.ts.map +1 -0
  15. package/dist/commonjs/form-field/index.js +7 -0
  16. package/dist/commonjs/form-field/lib/FormField.d.ts +31 -0
  17. package/dist/commonjs/form-field/lib/FormField.d.ts.map +1 -0
  18. package/dist/commonjs/form-field/lib/FormField.js +51 -0
  19. package/dist/commonjs/form-field/lib/FormFieldHint.d.ts +13 -0
  20. package/dist/commonjs/form-field/lib/FormFieldHint.d.ts.map +1 -0
  21. package/dist/commonjs/form-field/lib/FormFieldHint.js +45 -0
  22. package/dist/commonjs/form-field/lib/FormFieldInput.d.ts +8 -0
  23. package/dist/commonjs/form-field/lib/FormFieldInput.d.ts.map +1 -0
  24. package/dist/commonjs/form-field/lib/FormFieldInput.js +41 -0
  25. package/dist/commonjs/form-field/lib/FormFieldLabel.d.ts +18 -0
  26. package/dist/commonjs/form-field/lib/FormFieldLabel.d.ts.map +1 -0
  27. package/dist/commonjs/form-field/lib/FormFieldLabel.js +51 -0
  28. package/dist/commonjs/form-field/lib/hooks/index.d.ts +6 -0
  29. package/dist/commonjs/form-field/lib/hooks/index.d.ts.map +1 -0
  30. package/dist/commonjs/form-field/lib/hooks/index.js +10 -0
  31. package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.d.ts +15 -0
  32. package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.d.ts.map +1 -0
  33. package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.js +13 -0
  34. package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.d.ts +18 -0
  35. package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.d.ts.map +1 -0
  36. package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.js +16 -0
  37. package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.d.ts +15 -0
  38. package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.d.ts.map +1 -0
  39. package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.js +13 -0
  40. package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.d.ts +36 -0
  41. package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.d.ts.map +1 -0
  42. package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.js +21 -0
  43. package/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.d.ts +9 -0
  44. package/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.d.ts.map +1 -0
  45. package/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.js +24 -0
  46. package/dist/commonjs/index.d.ts +3 -0
  47. package/dist/commonjs/index.d.ts.map +1 -1
  48. package/dist/commonjs/index.js +4 -0
  49. package/dist/commonjs/menu/lib/Menu.d.ts.map +1 -1
  50. package/dist/commonjs/menu/lib/Menu.js +1 -2
  51. package/dist/commonjs/select/lib/Select.d.ts.map +1 -1
  52. package/dist/commonjs/select/lib/Select.js +2 -3
  53. package/dist/commonjs/select/lib/SelectMenu.d.ts.map +1 -1
  54. package/dist/commonjs/select/lib/SelectMenu.js +1 -0
  55. package/dist/commonjs/side-panel/lib/hooks.d.ts +7 -7
  56. package/dist/commonjs/text-area/index.d.ts +2 -0
  57. package/dist/commonjs/text-area/index.d.ts.map +1 -0
  58. package/dist/commonjs/text-area/index.js +6 -0
  59. package/dist/commonjs/text-area/lib/TextArea.d.ts +22 -0
  60. package/dist/commonjs/text-area/lib/TextArea.d.ts.map +1 -0
  61. package/dist/commonjs/text-area/lib/TextArea.js +52 -0
  62. package/dist/commonjs/text-area/lib/TextAreaField.d.ts +8 -0
  63. package/dist/commonjs/text-area/lib/TextAreaField.d.ts.map +1 -0
  64. package/dist/commonjs/text-area/lib/TextAreaField.js +65 -0
  65. package/dist/commonjs/text-area/lib/TextAreaHint.d.ts +5 -0
  66. package/dist/commonjs/text-area/lib/TextAreaHint.d.ts.map +1 -0
  67. package/dist/commonjs/text-area/lib/TextAreaHint.js +4 -0
  68. package/dist/commonjs/text-area/lib/TextAreaLabel.d.ts +5 -0
  69. package/dist/commonjs/text-area/lib/TextAreaLabel.d.ts.map +1 -0
  70. package/dist/commonjs/text-area/lib/TextAreaLabel.js +4 -0
  71. package/dist/commonjs/text-area/lib/hooks/index.d.ts +2 -0
  72. package/dist/commonjs/text-area/lib/hooks/index.d.ts.map +1 -0
  73. package/dist/commonjs/text-area/lib/hooks/index.js +6 -0
  74. package/dist/commonjs/text-area/lib/hooks/useTextAreaModel.d.ts +8 -0
  75. package/dist/commonjs/text-area/lib/hooks/useTextAreaModel.d.ts.map +1 -0
  76. package/dist/commonjs/text-area/lib/hooks/useTextAreaModel.js +4 -0
  77. package/dist/commonjs/text-input/index.d.ts +3 -0
  78. package/dist/commonjs/text-input/index.d.ts.map +1 -0
  79. package/dist/commonjs/text-input/index.js +7 -0
  80. package/dist/commonjs/text-input/lib/TextInput.d.ts +22 -0
  81. package/dist/commonjs/text-input/lib/TextInput.d.ts.map +1 -0
  82. package/dist/commonjs/text-input/lib/TextInput.js +52 -0
  83. package/dist/commonjs/text-input/lib/TextInputField.d.ts +8 -0
  84. package/dist/commonjs/text-input/lib/TextInputField.d.ts.map +1 -0
  85. package/dist/commonjs/text-input/lib/TextInputField.js +67 -0
  86. package/dist/commonjs/text-input/lib/TextInputHint.d.ts +5 -0
  87. package/dist/commonjs/text-input/lib/TextInputHint.d.ts.map +1 -0
  88. package/dist/commonjs/text-input/lib/TextInputHint.js +4 -0
  89. package/dist/commonjs/text-input/lib/TextInputLabel.d.ts +5 -0
  90. package/dist/commonjs/text-input/lib/TextInputLabel.d.ts.map +1 -0
  91. package/dist/commonjs/text-input/lib/TextInputLabel.js +4 -0
  92. package/dist/commonjs/text-input/lib/hooks/index.d.ts +3 -0
  93. package/dist/commonjs/text-input/lib/hooks/index.d.ts.map +1 -0
  94. package/dist/commonjs/text-input/lib/hooks/index.js +7 -0
  95. package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +10 -0
  96. package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts.map +1 -0
  97. package/dist/commonjs/text-input/lib/hooks/useTextInputField.js +11 -0
  98. package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +8 -0
  99. package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -0
  100. package/dist/commonjs/text-input/lib/hooks/useTextInputModel.js +4 -0
  101. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.d.ts.map +1 -1
  102. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.js +0 -1
  103. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.d.ts.map +1 -1
  104. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.js +0 -1
  105. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/Collapsible.d.ts.map +1 -1
  106. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/Collapsible.js +0 -1
  107. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/hooks.d.ts +1 -1
  108. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/hooks.js +4 -4
  109. package/dist/es6/form-field/index.d.ts +3 -0
  110. package/dist/es6/form-field/index.d.ts.map +1 -0
  111. package/dist/es6/form-field/index.js +2 -0
  112. package/dist/es6/form-field/lib/FormField.d.ts +31 -0
  113. package/dist/es6/form-field/lib/FormField.d.ts.map +1 -0
  114. package/dist/es6/form-field/lib/FormField.js +46 -0
  115. package/dist/es6/form-field/lib/FormFieldHint.d.ts +13 -0
  116. package/dist/es6/form-field/lib/FormFieldHint.d.ts.map +1 -0
  117. package/dist/es6/form-field/lib/FormFieldHint.js +43 -0
  118. package/dist/es6/form-field/lib/FormFieldInput.d.ts +8 -0
  119. package/dist/es6/form-field/lib/FormFieldInput.d.ts.map +1 -0
  120. package/dist/es6/form-field/lib/FormFieldInput.js +36 -0
  121. package/dist/es6/form-field/lib/FormFieldLabel.d.ts +18 -0
  122. package/dist/es6/form-field/lib/FormFieldLabel.d.ts.map +1 -0
  123. package/dist/es6/form-field/lib/FormFieldLabel.js +49 -0
  124. package/dist/es6/form-field/lib/hooks/index.d.ts +6 -0
  125. package/dist/es6/form-field/lib/hooks/index.d.ts.map +1 -0
  126. package/dist/es6/form-field/lib/hooks/index.js +5 -0
  127. package/dist/es6/form-field/lib/hooks/useFormFieldHint.d.ts +15 -0
  128. package/dist/es6/form-field/lib/hooks/useFormFieldHint.d.ts.map +1 -0
  129. package/dist/es6/form-field/lib/hooks/useFormFieldHint.js +11 -0
  130. package/dist/es6/form-field/lib/hooks/useFormFieldInput.d.ts +18 -0
  131. package/dist/es6/form-field/lib/hooks/useFormFieldInput.d.ts.map +1 -0
  132. package/dist/es6/form-field/lib/hooks/useFormFieldInput.js +14 -0
  133. package/dist/es6/form-field/lib/hooks/useFormFieldLabel.d.ts +15 -0
  134. package/dist/es6/form-field/lib/hooks/useFormFieldLabel.d.ts.map +1 -0
  135. package/dist/es6/form-field/lib/hooks/useFormFieldLabel.js +11 -0
  136. package/dist/es6/form-field/lib/hooks/useFormFieldModel.d.ts +36 -0
  137. package/dist/es6/form-field/lib/hooks/useFormFieldModel.d.ts.map +1 -0
  138. package/dist/es6/form-field/lib/hooks/useFormFieldModel.js +19 -0
  139. package/dist/es6/form-field/lib/hooks/useFormFieldOrientation.d.ts +9 -0
  140. package/dist/es6/form-field/lib/hooks/useFormFieldOrientation.d.ts.map +1 -0
  141. package/dist/es6/form-field/lib/hooks/useFormFieldOrientation.js +22 -0
  142. package/dist/es6/index.d.ts +3 -0
  143. package/dist/es6/index.d.ts.map +1 -1
  144. package/dist/es6/index.js +4 -0
  145. package/dist/es6/menu/lib/Menu.d.ts.map +1 -1
  146. package/dist/es6/menu/lib/Menu.js +2 -3
  147. package/dist/es6/select/lib/Select.d.ts.map +1 -1
  148. package/dist/es6/select/lib/Select.js +3 -4
  149. package/dist/es6/select/lib/SelectMenu.d.ts.map +1 -1
  150. package/dist/es6/select/lib/SelectMenu.js +2 -1
  151. package/dist/es6/side-panel/lib/hooks.d.ts +7 -7
  152. package/dist/es6/text-area/index.d.ts +2 -0
  153. package/dist/es6/text-area/index.d.ts.map +1 -0
  154. package/dist/es6/text-area/index.js +1 -0
  155. package/dist/es6/text-area/lib/TextArea.d.ts +22 -0
  156. package/dist/es6/text-area/lib/TextArea.d.ts.map +1 -0
  157. package/dist/es6/text-area/lib/TextArea.js +47 -0
  158. package/dist/es6/text-area/lib/TextAreaField.d.ts +8 -0
  159. package/dist/es6/text-area/lib/TextAreaField.d.ts.map +1 -0
  160. package/dist/es6/text-area/lib/TextAreaField.js +63 -0
  161. package/dist/es6/text-area/lib/TextAreaHint.d.ts +5 -0
  162. package/dist/es6/text-area/lib/TextAreaHint.d.ts.map +1 -0
  163. package/dist/es6/text-area/lib/TextAreaHint.js +2 -0
  164. package/dist/es6/text-area/lib/TextAreaLabel.d.ts +5 -0
  165. package/dist/es6/text-area/lib/TextAreaLabel.d.ts.map +1 -0
  166. package/dist/es6/text-area/lib/TextAreaLabel.js +2 -0
  167. package/dist/es6/text-area/lib/hooks/index.d.ts +2 -0
  168. package/dist/es6/text-area/lib/hooks/index.d.ts.map +1 -0
  169. package/dist/es6/text-area/lib/hooks/index.js +1 -0
  170. package/dist/es6/text-area/lib/hooks/useTextAreaModel.d.ts +8 -0
  171. package/dist/es6/text-area/lib/hooks/useTextAreaModel.d.ts.map +1 -0
  172. package/dist/es6/text-area/lib/hooks/useTextAreaModel.js +2 -0
  173. package/dist/es6/text-input/index.d.ts +3 -0
  174. package/dist/es6/text-input/index.d.ts.map +1 -0
  175. package/dist/es6/text-input/index.js +2 -0
  176. package/dist/es6/text-input/lib/TextInput.d.ts +22 -0
  177. package/dist/es6/text-input/lib/TextInput.d.ts.map +1 -0
  178. package/dist/es6/text-input/lib/TextInput.js +47 -0
  179. package/dist/es6/text-input/lib/TextInputField.d.ts +8 -0
  180. package/dist/es6/text-input/lib/TextInputField.d.ts.map +1 -0
  181. package/dist/es6/text-input/lib/TextInputField.js +65 -0
  182. package/dist/es6/text-input/lib/TextInputHint.d.ts +5 -0
  183. package/dist/es6/text-input/lib/TextInputHint.d.ts.map +1 -0
  184. package/dist/es6/text-input/lib/TextInputHint.js +2 -0
  185. package/dist/es6/text-input/lib/TextInputLabel.d.ts +5 -0
  186. package/dist/es6/text-input/lib/TextInputLabel.d.ts.map +1 -0
  187. package/dist/es6/text-input/lib/TextInputLabel.js +2 -0
  188. package/dist/es6/text-input/lib/hooks/index.d.ts +3 -0
  189. package/dist/es6/text-input/lib/hooks/index.d.ts.map +1 -0
  190. package/dist/es6/text-input/lib/hooks/index.js +2 -0
  191. package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +10 -0
  192. package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts.map +1 -0
  193. package/dist/es6/text-input/lib/hooks/useTextInputField.js +9 -0
  194. package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +8 -0
  195. package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -0
  196. package/dist/es6/text-input/lib/hooks/useTextInputModel.js +2 -0
  197. package/form-field/LICENSE +52 -0
  198. package/form-field/README.md +8 -0
  199. package/form-field/index.ts +2 -0
  200. package/form-field/lib/FormField.tsx +56 -0
  201. package/form-field/lib/FormFieldHint.tsx +46 -0
  202. package/form-field/lib/FormFieldInput.tsx +21 -0
  203. package/form-field/lib/FormFieldLabel.tsx +70 -0
  204. package/form-field/lib/hooks/index.ts +5 -0
  205. package/form-field/lib/hooks/useFormFieldHint.tsx +12 -0
  206. package/form-field/lib/hooks/useFormFieldInput.tsx +15 -0
  207. package/form-field/lib/hooks/useFormFieldLabel.tsx +12 -0
  208. package/form-field/lib/hooks/useFormFieldModel.tsx +62 -0
  209. package/form-field/lib/hooks/useFormFieldOrientation.tsx +29 -0
  210. package/form-field/package.json +5 -0
  211. package/index.ts +5 -0
  212. package/menu/lib/Menu.tsx +3 -3
  213. package/package.json +9 -9
  214. package/select/lib/Select.tsx +9 -4
  215. package/select/lib/SelectMenu.tsx +2 -0
  216. package/side-panel/lib/hooks.ts +7 -7
  217. package/text-area/LICENSE +52 -0
  218. package/text-area/README.md +7 -0
  219. package/text-area/index.ts +1 -0
  220. package/text-area/lib/TextArea.tsx +43 -0
  221. package/text-area/lib/TextAreaField.tsx +81 -0
  222. package/text-area/lib/TextAreaHint.tsx +6 -0
  223. package/text-area/lib/TextAreaLabel.tsx +6 -0
  224. package/text-area/lib/hooks/index.ts +1 -0
  225. package/text-area/lib/hooks/useTextAreaModel.ts +8 -0
  226. package/text-area/package.json +5 -0
  227. package/text-input/LICENSE +52 -0
  228. package/text-input/README.md +7 -0
  229. package/text-input/index.ts +2 -0
  230. package/text-input/lib/TextInput.tsx +43 -0
  231. package/text-input/lib/TextInputField.tsx +81 -0
  232. package/text-input/lib/TextInputHint.tsx +6 -0
  233. package/text-input/lib/TextInputLabel.tsx +6 -0
  234. package/text-input/lib/hooks/index.ts +2 -0
  235. package/text-input/lib/hooks/useTextInputField.tsx +10 -0
  236. package/text-input/lib/hooks/useTextInputModel.ts +8 -0
  237. package/text-input/package.json +5 -0
  238. package/ts3.5/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/hooks.d.ts +1 -1
  239. package/ts3.5/dist/commonjs/form-field/index.d.ts +3 -0
  240. package/ts3.5/dist/commonjs/form-field/lib/FormField.d.ts +31 -0
  241. package/ts3.5/dist/commonjs/form-field/lib/FormFieldHint.d.ts +13 -0
  242. package/ts3.5/dist/commonjs/form-field/lib/FormFieldInput.d.ts +8 -0
  243. package/ts3.5/dist/commonjs/form-field/lib/FormFieldLabel.d.ts +18 -0
  244. package/ts3.5/dist/commonjs/form-field/lib/hooks/index.d.ts +6 -0
  245. package/ts3.5/dist/commonjs/form-field/lib/hooks/useFormFieldHint.d.ts +15 -0
  246. package/ts3.5/dist/commonjs/form-field/lib/hooks/useFormFieldInput.d.ts +18 -0
  247. package/ts3.5/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.d.ts +15 -0
  248. package/ts3.5/dist/commonjs/form-field/lib/hooks/useFormFieldModel.d.ts +36 -0
  249. package/ts3.5/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.d.ts +9 -0
  250. package/ts3.5/dist/commonjs/index.d.ts +3 -0
  251. package/ts3.5/dist/commonjs/side-panel/lib/hooks.d.ts +7 -7
  252. package/ts3.5/dist/commonjs/text-area/index.d.ts +2 -0
  253. package/ts3.5/dist/commonjs/text-area/lib/TextArea.d.ts +22 -0
  254. package/ts3.5/dist/commonjs/text-area/lib/TextAreaField.d.ts +8 -0
  255. package/ts3.5/dist/commonjs/text-area/lib/TextAreaHint.d.ts +5 -0
  256. package/ts3.5/dist/commonjs/text-area/lib/TextAreaLabel.d.ts +5 -0
  257. package/ts3.5/dist/commonjs/text-area/lib/hooks/index.d.ts +2 -0
  258. package/ts3.5/dist/commonjs/text-area/lib/hooks/useTextAreaModel.d.ts +8 -0
  259. package/ts3.5/dist/commonjs/text-input/index.d.ts +3 -0
  260. package/ts3.5/dist/commonjs/text-input/lib/TextInput.d.ts +22 -0
  261. package/ts3.5/dist/commonjs/text-input/lib/TextInputField.d.ts +8 -0
  262. package/ts3.5/dist/commonjs/text-input/lib/TextInputHint.d.ts +5 -0
  263. package/ts3.5/dist/commonjs/text-input/lib/TextInputLabel.d.ts +5 -0
  264. package/ts3.5/dist/commonjs/text-input/lib/hooks/index.d.ts +3 -0
  265. package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +10 -0
  266. package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +8 -0
  267. package/ts3.5/dist/es6/breadcrumbs/lib/Breadcrumbs/List/hooks.d.ts +1 -1
  268. package/ts3.5/dist/es6/form-field/index.d.ts +3 -0
  269. package/ts3.5/dist/es6/form-field/lib/FormField.d.ts +31 -0
  270. package/ts3.5/dist/es6/form-field/lib/FormFieldHint.d.ts +13 -0
  271. package/ts3.5/dist/es6/form-field/lib/FormFieldInput.d.ts +8 -0
  272. package/ts3.5/dist/es6/form-field/lib/FormFieldLabel.d.ts +18 -0
  273. package/ts3.5/dist/es6/form-field/lib/hooks/index.d.ts +6 -0
  274. package/ts3.5/dist/es6/form-field/lib/hooks/useFormFieldHint.d.ts +15 -0
  275. package/ts3.5/dist/es6/form-field/lib/hooks/useFormFieldInput.d.ts +18 -0
  276. package/ts3.5/dist/es6/form-field/lib/hooks/useFormFieldLabel.d.ts +15 -0
  277. package/ts3.5/dist/es6/form-field/lib/hooks/useFormFieldModel.d.ts +36 -0
  278. package/ts3.5/dist/es6/form-field/lib/hooks/useFormFieldOrientation.d.ts +9 -0
  279. package/ts3.5/dist/es6/index.d.ts +3 -0
  280. package/ts3.5/dist/es6/side-panel/lib/hooks.d.ts +7 -7
  281. package/ts3.5/dist/es6/text-area/index.d.ts +2 -0
  282. package/ts3.5/dist/es6/text-area/lib/TextArea.d.ts +22 -0
  283. package/ts3.5/dist/es6/text-area/lib/TextAreaField.d.ts +8 -0
  284. package/ts3.5/dist/es6/text-area/lib/TextAreaHint.d.ts +5 -0
  285. package/ts3.5/dist/es6/text-area/lib/TextAreaLabel.d.ts +5 -0
  286. package/ts3.5/dist/es6/text-area/lib/hooks/index.d.ts +2 -0
  287. package/ts3.5/dist/es6/text-area/lib/hooks/useTextAreaModel.d.ts +8 -0
  288. package/ts3.5/dist/es6/text-input/index.d.ts +3 -0
  289. package/ts3.5/dist/es6/text-input/lib/TextInput.d.ts +22 -0
  290. package/ts3.5/dist/es6/text-input/lib/TextInputField.d.ts +8 -0
  291. package/ts3.5/dist/es6/text-input/lib/TextInputHint.d.ts +5 -0
  292. package/ts3.5/dist/es6/text-input/lib/TextInputLabel.d.ts +5 -0
  293. package/ts3.5/dist/es6/text-input/lib/hooks/index.d.ts +3 -0
  294. package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +10 -0
  295. package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +8 -0
package/index.ts CHANGED
@@ -1,5 +1,10 @@
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';
9
+
10
+ /// <reference types="@types/node" />
package/menu/lib/Menu.tsx CHANGED
@@ -1,10 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import styled from '@emotion/styled';
3
- import uuid from 'uuid/v4';
3
+
4
4
  import {MenuItemProps} from './MenuItem';
5
5
  import {Card} from '@workday/canvas-kit-react/card';
6
6
  import {commonColors, space, borderRadius} from '@workday/canvas-kit-react/tokens';
7
- import {hideMouseFocus, GrowthBehavior} from '@workday/canvas-kit-react/common';
7
+ import {hideMouseFocus, GrowthBehavior, generateUniqueId} from '@workday/canvas-kit-react/common';
8
8
 
9
9
  export interface MenuProps extends GrowthBehavior, React.HTMLAttributes<HTMLUListElement> {
10
10
  /**
@@ -58,7 +58,7 @@ const List = styled('ul')({
58
58
  });
59
59
 
60
60
  export default class Menu extends React.Component<MenuProps, MenuState> {
61
- private id = uuid();
61
+ private id = generateUniqueId();
62
62
  private animateId!: number;
63
63
 
64
64
  private menuRef: React.RefObject<HTMLUListElement>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-preview-react",
3
- "version": "5.3.0-next.3+6f698ff2",
3
+ "version": "5.3.0-next.32+a02de5eb",
4
4
  "description": "Canvas Kit Preview is made up of components that have the full design and a11y review, are part of the DS ecosystem and are approved for use in product. The API's could be subject to change, but not without strong communication and migration strategies.",
5
5
  "author": "Workday, Inc. (https://www.workday.com)",
6
6
  "license": "Apache-2.0",
@@ -38,7 +38,8 @@
38
38
  "build": "npm-run-all --parallel build:cjs build:es6 --sequential build:downlevel-dts",
39
39
  "prepack": "node ../../utils/publish.js pre preview-react",
40
40
  "postpack": "node ../../utils/publish.js post preview-react",
41
- "depcheck": "node ../../utils/check-dependencies-exist.js"
41
+ "depcheck": "node ../../utils/check-dependencies-exist.js",
42
+ "typecheck:src": "tsc -p . --noEmit --incremental false"
42
43
  },
43
44
  "keywords": [
44
45
  "canvas",
@@ -53,16 +54,15 @@
53
54
  "dependencies": {
54
55
  "@emotion/core": "^10.0.28",
55
56
  "@emotion/styled": "^10.0.27",
56
- "@types/uuid": "^3.4.4",
57
- "@workday/canvas-kit-react": "^5.3.0-next.3+6f698ff2",
57
+ "@workday/canvas-kit-react": "^5.3.0-next.32+a02de5eb",
58
58
  "@workday/canvas-system-icons-web": "1.0.41",
59
- "@workday/design-assets-types": "^0.2.4",
60
- "uuid": "^3.3.3"
59
+ "@workday/design-assets-types": "^0.2.4"
61
60
  },
62
61
  "devDependencies": {
63
- "@material-ui/core": "^4.9.7",
64
62
  "@workday/canvas-accent-icons-web": "^1.0.0",
65
- "@workday/canvas-kit-labs-react": "^5.3.0-next.3+6f698ff2"
63
+ "@workday/canvas-kit-labs-react": "^5.3.0-next.32+a02de5eb",
64
+ "formik": "^2.2.9",
65
+ "yup": "^0.31.1"
66
66
  },
67
- "gitHead": "6f698ff217cb6ab7bf9aecd86e326eb60a85edbc"
67
+ "gitHead": "a02de5eb284c706211aa55ef3554b11f52668b28"
68
68
  }
@@ -1,10 +1,15 @@
1
1
  import * as React from 'react';
2
- import {ErrorType, StyledType, createComponent, useForkRef} from '@workday/canvas-kit-react/common';
2
+ import {
3
+ ErrorType,
4
+ StyledType,
5
+ createComponent,
6
+ useForkRef,
7
+ generateUniqueId,
8
+ } from '@workday/canvas-kit-react/common';
3
9
  import {menuAnimationDuration} from './SelectMenu';
4
10
  import SelectBase, {CoreSelectBaseProps, Option, NormalizedOption} from './SelectBase';
5
11
  import {MenuVisibility} from './types';
6
12
  import {getCorrectedIndexByValue} from './utils';
7
- import uuid from 'uuid/v4';
8
13
 
9
14
  export interface SelectProps extends CoreSelectBaseProps {
10
15
  /**
@@ -87,13 +92,13 @@ class SelectContainer extends React.Component<SelectContainerProps, SelectContai
87
92
 
88
93
  if (typeof option === 'string') {
89
94
  disabled = false;
90
- id = uuid();
95
+ id = generateUniqueId();
91
96
  value = option;
92
97
  label = option;
93
98
  } else {
94
99
  data = option.data || data;
95
100
  disabled = !!option.disabled;
96
- id = option.id || uuid();
101
+ id = option.id || generateUniqueId();
97
102
  value = option.value;
98
103
  label = option.label || option.value;
99
104
  }
@@ -9,6 +9,7 @@ import {
9
9
  useCloseOnOutsideClick,
10
10
  usePopupModel,
11
11
  useReturnFocus,
12
+ useTransferOnFullscreenExit,
12
13
  } from '@workday/canvas-kit-react/popup';
13
14
  import {colors, borderRadius, inputColors} from '@workday/canvas-kit-react/tokens';
14
15
 
@@ -271,6 +272,7 @@ const SelectMenu = ({
271
272
  useCloseOnEscape(model);
272
273
  useCloseOnOutsideClick(model);
273
274
  useReturnFocus(model);
275
+ useTransferOnFullscreenExit(model);
274
276
 
275
277
  return (
276
278
  <Popper
@@ -12,12 +12,12 @@ export interface UseSidePanelProps {
12
12
  initialExpanded?: boolean;
13
13
  /**
14
14
  * sets the `id` for the panel
15
- * @default `uuid`-generated string
15
+ * @default unique identifier
16
16
  */
17
17
  panelId?: string;
18
18
  /**
19
19
  * sets the `id` for the label
20
- * @default `uuid`-generated string
20
+ * @default unique identifier
21
21
  */
22
22
  labelId?: string;
23
23
  }
@@ -32,12 +32,12 @@ export interface PanelProps {
32
32
  expanded: boolean;
33
33
  /**
34
34
  * the accessible `id`
35
- * - this will either be a `uuid`-generated value or the `panelId` provided in the config
35
+ * - this will either be a unique identifier value or the `panelId` provided in the config
36
36
  */
37
37
  id: string;
38
38
  /**
39
39
  * the accessible label `id`
40
- * - this will either be a `uuid`-generated value or the `labelId` provided in the config
40
+ * - this will either be a unique identifier value or the `labelId` provided in the config
41
41
  */
42
42
  'aria-labelledby': string;
43
43
  /**
@@ -50,7 +50,7 @@ export interface PanelProps {
50
50
  export interface LabelProps {
51
51
  /**
52
52
  * the accessible `id`
53
- * - this will either be a `uuid`-generated value or the `labelId` provided in the config
53
+ * - this will either be a unique identifier value or the `labelId` provided in the config
54
54
  */
55
55
  id: string;
56
56
  }
@@ -58,7 +58,7 @@ export interface LabelProps {
58
58
  export interface ControlProps {
59
59
  /**
60
60
  * the accessible `id` that connects the panel to this control
61
- * - this will either be a `uuid`-generated value or the `panelId` provided in the config
61
+ * - this will either be a unique identifier value or the `panelId` provided in the config
62
62
  */
63
63
  'aria-controls': string;
64
64
  /**
@@ -68,7 +68,7 @@ export interface ControlProps {
68
68
  'aria-expanded': boolean;
69
69
  /**
70
70
  * the accessible label `id`
71
- * - this will either be a `uuid`-generated value or the `labelId` provided in the config
71
+ * - this will either be a unique identifier value or the `labelId` provided in the config
72
72
  */
73
73
  'aria-labelledby': string;
74
74
  /**
@@ -0,0 +1,52 @@
1
+ Apache License, Version 2.0 Apache License Version 2.0, January 2004
2
+
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
9
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
10
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
11
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
12
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
13
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
14
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
15
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
16
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
17
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
18
+
19
+ 2. Grant of Copyright License.
20
+ Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
21
+
22
+ 3. Grant of Patent License.
23
+ Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
24
+
25
+ 4. Redistribution.
26
+ You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
27
+ You must give any other recipients of the Work or Derivative Works a copy of this License; and You must cause any modified files to carry prominent notices stating that You changed the files; and You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
28
+
29
+ 5. Submission of Contributions.
30
+ Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
31
+
32
+ 6. Trademarks.
33
+ This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
34
+
35
+ 7. Disclaimer of Warranty.
36
+ Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
37
+
38
+ 8. Limitation of Liability.
39
+ In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
40
+
41
+ 9. Accepting Warranty or Additional Liability.
42
+ While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
43
+
44
+ END OF TERMS AND CONDITIONS
45
+
46
+ ©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders.
47
+
48
+
49
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
50
+ http://www.apache.org/licenses/LICENSE-2.0
51
+
52
+ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
@@ -0,0 +1,7 @@
1
+ # Canvas Kit React Text Area
2
+
3
+ View the
4
+ [documentation for Text Area](https://workday.github.io/canvas-kit/?path=/docs/preview-inputs-text-area-react--basic)
5
+ on Storybook.
6
+
7
+ [> Workday Design Reference: Text Area](https://design.workday.com/components/inputs/text-area)
@@ -0,0 +1 @@
1
+ export * from './lib/TextArea';
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+
3
+ import {createComponent, ExtractProps, useDefaultModel} from '@workday/canvas-kit-react/common';
4
+ import {FormField, FormFieldModelContext, useFormFieldOrientation} from '@workday/canvas-kit-preview-react/form-field';
5
+ import {Stack} from '@workday/canvas-kit-labs-react/layout';
6
+
7
+ import { TextAreaModel, useTextAreaModel } from './hooks';
8
+ import {TextAreaField} from './TextAreaField';
9
+ import {TextAreaLabel} from './TextAreaLabel';
10
+ import {TextAreaHint} from './TextAreaHint';
11
+
12
+ export const TextAreaModelContext = FormFieldModelContext;
13
+
14
+ export interface TextAreaProps extends ExtractProps<typeof FormField, never> {
15
+ model?: TextAreaModel;
16
+ /**
17
+ * Children of the Text Input. Should contain a `<TextArea.Field>`, a `<TextArea.Label>` and an optional `<TextArea.Hint>`
18
+ */
19
+ children: React.ReactNode;
20
+ }
21
+
22
+ export const TextArea = createComponent()({
23
+ displayName: 'TextArea',
24
+ Component: ({children, model, orientation, ...props}: TextAreaProps, ref) => {
25
+ const {hasError, id, isRequired, ...elemProps} = props
26
+ const value = useDefaultModel(model, {hasError, id, isRequired}, useTextAreaModel);
27
+
28
+ const layoutProps = useFormFieldOrientation(orientation)
29
+
30
+ return (
31
+ <TextAreaModelContext.Provider value={value}>
32
+ <Stack ref={ref} {...layoutProps} {...elemProps}>
33
+ {children}
34
+ </Stack>
35
+ </TextAreaModelContext.Provider>
36
+ );
37
+ },
38
+ subComponents: {
39
+ Field: TextAreaField,
40
+ Label: TextAreaLabel,
41
+ Hint: TextAreaHint,
42
+ },
43
+ });
@@ -0,0 +1,81 @@
1
+ /** @jsx jsx */
2
+ import {jsx} from '@emotion/core';
3
+
4
+ import {
5
+ borderRadius,
6
+ CSSProperties,
7
+ inputColors,
8
+ spaceNumbers,
9
+ type,
10
+ } from '@workday/canvas-kit-react/tokens';
11
+ import {createComponent, ExtractProps, useModelContext, useTheme} from '@workday/canvas-kit-react/common';
12
+ import {useThemedRing} from '@workday/canvas-kit-labs-react/common';
13
+ import {FormField} from '@workday/canvas-kit-preview-react/form-field';
14
+
15
+ import {TextAreaModelContext} from './TextArea';
16
+ import { TextAreaModel } from './hooks';
17
+
18
+ export interface TextAreaFieldProps extends ExtractProps<typeof FormField.Input, never> {
19
+ model?: TextAreaModel;
20
+ }
21
+
22
+ const baseStyles: CSSProperties = {
23
+ ...type.levels.subtext.large,
24
+ transition: '0.2s box-shadow, 0.2s border-color',
25
+ resize: 'both',
26
+ '&::webkit-resizer': {
27
+ display: 'none',
28
+ },
29
+ '&::placeholder': {
30
+ color: inputColors.placeholder,
31
+ },
32
+ '&:hover': {
33
+ borderColor: inputColors.hoverBorder,
34
+ },
35
+ '&:focus:not([disabled])': {
36
+ outline: 'none',
37
+ },
38
+ '&:disabled': {
39
+ backgroundColor: inputColors.disabled.background,
40
+ borderColor: inputColors.disabled.border,
41
+ color: inputColors.disabled.text,
42
+ '&::placeholder': {
43
+ color: inputColors.disabled.text,
44
+ },
45
+ },
46
+ };
47
+
48
+ export const TextAreaField = createComponent('textarea')({
49
+ displayName: 'TextArea.Field',
50
+ Component: ({model, ...elemProps}: TextAreaFieldProps, ref) => {
51
+ const localModel = useModelContext(TextAreaModelContext, model);
52
+
53
+ const theme = useTheme();
54
+ const errorRing = useThemedRing('error');
55
+
56
+ const focusStyles = localModel.state.hasError
57
+ ? errorRing
58
+ : {
59
+ '&:focus:not([disabled])': {
60
+ borderColor: theme.canvas.palette.common.focusOutline,
61
+ boxShadow: `inset 0 0 0 1px ${theme.canvas.palette.common.focusOutline}`,
62
+ },
63
+ };
64
+
65
+ return (
66
+ <FormField.Input
67
+ as="textarea"
68
+ ref={ref}
69
+ css={[baseStyles, focusStyles]} {...elemProps}
70
+ border={`1px solid ${inputColors.border}`}
71
+ display='block'
72
+ backgroundColor={inputColors.background}
73
+ borderRadius={borderRadius.m}
74
+ minHeight={64}
75
+ minWidth={280}
76
+ padding={spaceNumbers.xxs} // Compensate for border
77
+ margin={0} // Fix Safari
78
+ />
79
+ );
80
+ },
81
+ });
@@ -0,0 +1,6 @@
1
+ import {ExtractProps} from '@workday/canvas-kit-react/common';
2
+ import {FormField} from '@workday/canvas-kit-preview-react/form-field';
3
+
4
+ export type TextAreaHintProps = ExtractProps<typeof FormField.Hint, never>;
5
+
6
+ export const TextAreaHint = FormField.Hint;
@@ -0,0 +1,6 @@
1
+ import {ExtractProps} from '@workday/canvas-kit-react/common';
2
+ import {FormField} from '@workday/canvas-kit-preview-react/form-field';
3
+
4
+ export type TextAreaLabelProps = ExtractProps<typeof FormField.Label, never>;
5
+
6
+ export const TextAreaLabel = FormField.Label;
@@ -0,0 +1 @@
1
+ export * from './useTextAreaModel';
@@ -0,0 +1,8 @@
1
+ import {
2
+ useFormFieldModel,
3
+ FormFieldModel,
4
+ } from '@workday/canvas-kit-preview-react/form-field';
5
+
6
+ export const useTextAreaModel = useFormFieldModel;
7
+
8
+ export type TextAreaModel = FormFieldModel;
@@ -0,0 +1,5 @@
1
+ {
2
+ "main": "../dist/commonjs/text-area",
3
+ "module": "../dist/es6/text-area",
4
+ "sideEffects": false
5
+ }
@@ -0,0 +1,52 @@
1
+ Apache License, Version 2.0 Apache License Version 2.0, January 2004
2
+
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
9
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
10
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
11
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
12
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
13
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
14
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
15
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
16
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
17
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
18
+
19
+ 2. Grant of Copyright License.
20
+ Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
21
+
22
+ 3. Grant of Patent License.
23
+ Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
24
+
25
+ 4. Redistribution.
26
+ You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
27
+ You must give any other recipients of the Work or Derivative Works a copy of this License; and You must cause any modified files to carry prominent notices stating that You changed the files; and You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
28
+
29
+ 5. Submission of Contributions.
30
+ Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
31
+
32
+ 6. Trademarks.
33
+ This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
34
+
35
+ 7. Disclaimer of Warranty.
36
+ Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
37
+
38
+ 8. Limitation of Liability.
39
+ In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
40
+
41
+ 9. Accepting Warranty or Additional Liability.
42
+ While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
43
+
44
+ END OF TERMS AND CONDITIONS
45
+
46
+ ©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders.
47
+
48
+
49
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
50
+ http://www.apache.org/licenses/LICENSE-2.0
51
+
52
+ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
@@ -0,0 +1,7 @@
1
+ # Canvas Kit React Text Input
2
+
3
+ View the
4
+ [documentation for Text Input](https://workday.github.io/canvas-kit/?path=/docs/preview-inputs-text-input-react--basic)
5
+ on Storybook.
6
+
7
+ [> Workday Design Reference: Text Input](https://design.workday.com/components/inputs/text-input)
@@ -0,0 +1,2 @@
1
+ export * from './lib/TextInput';
2
+ export * from './lib/hooks';
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+
3
+ import {createComponent, ExtractProps, useDefaultModel} from '@workday/canvas-kit-react/common';
4
+ import {FormField, FormFieldModelContext, useFormFieldOrientation} from '@workday/canvas-kit-preview-react/form-field';
5
+ import {Stack} from '@workday/canvas-kit-labs-react/layout';
6
+
7
+ import {useTextInputModel, TextInputModel} from './hooks';
8
+ import {TextInputField} from './TextInputField';
9
+ import {TextInputLabel} from './TextInputLabel';
10
+ import {TextInputHint} from './TextInputHint';
11
+
12
+ export const TextInputModelContext = FormFieldModelContext;
13
+
14
+ export interface TextInputProps extends ExtractProps<typeof FormField, never> {
15
+ model?: TextInputModel;
16
+ /**
17
+ * Children of the Text Input. Should contain a `<TextInput.Field>`, a `<TextInput.Label>` and an optional `<TextInput.Hint>`
18
+ */
19
+ children: React.ReactNode;
20
+ }
21
+
22
+ export const TextInput = createComponent()({
23
+ displayName: 'TextInput',
24
+ Component: ({children, model, orientation, ...props}: TextInputProps, ref) => {
25
+ const {hasError, id, isRequired, ...elemProps} = props
26
+ const value = useDefaultModel(model, {hasError, id, isRequired}, useTextInputModel);
27
+
28
+ const layoutProps = useFormFieldOrientation(orientation)
29
+
30
+ return (
31
+ <TextInputModelContext.Provider value={value}>
32
+ <Stack ref={ref} {...layoutProps} {...elemProps}>
33
+ {children}
34
+ </Stack>
35
+ </TextInputModelContext.Provider>
36
+ );
37
+ },
38
+ subComponents: {
39
+ Field: TextInputField,
40
+ Label: TextInputLabel,
41
+ Hint: TextInputHint,
42
+ },
43
+ });
@@ -0,0 +1,81 @@
1
+ /** @jsx jsx */
2
+ import {jsx} from '@emotion/core';
3
+
4
+ import {
5
+ borderRadius,
6
+ CSSProperties,
7
+ inputColors,
8
+ space,
9
+ type,
10
+ } from '@workday/canvas-kit-react/tokens';
11
+ import {createComponent, ExtractProps, useModelContext, useTheme} from '@workday/canvas-kit-react/common';
12
+ import {useThemedRing} from '@workday/canvas-kit-labs-react/common';
13
+ import {FormField} from '@workday/canvas-kit-preview-react/form-field';
14
+
15
+ import {TextInputModelContext} from './TextInput';
16
+ import {useTextInputField, TextInputModel} from './hooks';
17
+
18
+ export interface TextInputFieldProps extends ExtractProps<typeof FormField.Input, never> {
19
+ model?: TextInputModel;
20
+ }
21
+
22
+ const baseStyles: CSSProperties = {
23
+ ...type.levels.subtext.large,
24
+ transition: '0.2s box-shadow, 0.2s border-color',
25
+ '&::placeholder': {
26
+ color: inputColors.placeholder,
27
+ },
28
+ '&:hover': {
29
+ borderColor: inputColors.hoverBorder,
30
+ },
31
+ '&:focus:not([disabled])': {
32
+ outline: 'none',
33
+ },
34
+ '&:disabled': {
35
+ backgroundColor: inputColors.disabled.background,
36
+ borderColor: inputColors.disabled.border,
37
+ color: inputColors.disabled.text,
38
+ '&::placeholder': {
39
+ color: inputColors.disabled.text,
40
+ },
41
+ },
42
+ '::-ms-clear': {
43
+ display: 'none',
44
+ },
45
+ };
46
+
47
+ export const TextInputField = createComponent('input')({
48
+ displayName: 'TextInput.Field',
49
+ Component: ({model, ...elemProps}: TextInputFieldProps, ref) => {
50
+ const localModel = useModelContext(TextInputModelContext, model);
51
+ const props = useTextInputField(localModel, elemProps, ref);
52
+
53
+ const theme = useTheme();
54
+ const errorRing = useThemedRing('error');
55
+
56
+ const focusStyles = localModel.state.hasError
57
+ ? errorRing
58
+ : {
59
+ '&:focus:not([disabled])': {
60
+ borderColor: theme.canvas.palette.common.focusOutline,
61
+ boxShadow: `inset 0 0 0 1px ${theme.canvas.palette.common.focusOutline}`,
62
+ },
63
+ };
64
+
65
+ return (
66
+ <FormField.Input
67
+ as="input"
68
+ css={[baseStyles, focusStyles]}
69
+ padding={space.xxs}
70
+ margin={0}
71
+ display='block'
72
+ height='40px'
73
+ minWidth='280px'
74
+ border={`1px solid ${inputColors.border}`}
75
+ backgroundColor={inputColors.background}
76
+ borderRadius={borderRadius.m}
77
+ {...props}
78
+ />
79
+ );
80
+ },
81
+ });
@@ -0,0 +1,6 @@
1
+ import {ExtractProps} from '@workday/canvas-kit-react/common';
2
+ import {FormField} from '@workday/canvas-kit-preview-react/form-field';
3
+
4
+ export type TextInputHintProps = ExtractProps<typeof FormField.Hint, never>;
5
+
6
+ export const TextInputHint = FormField.Hint;
@@ -0,0 +1,6 @@
1
+ import {ExtractProps} from '@workday/canvas-kit-react/common';
2
+ import {FormField} from '@workday/canvas-kit-preview-react/form-field';
3
+
4
+ export type TextInputLabelProps = ExtractProps<typeof FormField.Label, never>;
5
+
6
+ export const TextInputLabel = FormField.Label;
@@ -0,0 +1,2 @@
1
+ export * from './useTextInputField';
2
+ export * from './useTextInputModel';