@workday/canvas-kit-preview-react 8.0.0-alpha.254-next.23 → 8.0.0-alpha.428-next.2

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 (315) hide show
  1. package/color-picker/lib/ColorPicker.tsx +1 -1
  2. package/dist/commonjs/color-picker/lib/ColorPicker.js +25 -48
  3. package/dist/commonjs/color-picker/lib/parts/ColorReset.js +32 -23
  4. package/dist/commonjs/color-picker/lib/parts/SwatchBook.js +26 -39
  5. package/dist/commonjs/form-field/lib/FormField.d.ts +4 -10
  6. package/dist/commonjs/form-field/lib/FormField.d.ts.map +1 -1
  7. package/dist/commonjs/form-field/lib/FormField.js +10 -33
  8. package/dist/commonjs/form-field/lib/FormFieldHint.d.ts +1 -1
  9. package/dist/commonjs/form-field/lib/FormFieldHint.js +8 -31
  10. package/dist/commonjs/form-field/lib/FormFieldInput.d.ts +1 -1
  11. package/dist/commonjs/form-field/lib/FormFieldInput.js +6 -17
  12. package/dist/commonjs/form-field/lib/FormFieldLabel.d.ts +2 -8
  13. package/dist/commonjs/form-field/lib/FormFieldLabel.d.ts.map +1 -1
  14. package/dist/commonjs/form-field/lib/FormFieldLabel.js +8 -31
  15. package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.d.ts +3 -5
  16. package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.d.ts.map +1 -1
  17. package/dist/commonjs/form-field/lib/hooks/useFormFieldHint.js +4 -5
  18. package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.d.ts +3 -5
  19. package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.d.ts.map +1 -1
  20. package/dist/commonjs/form-field/lib/hooks/useFormFieldInput.js +5 -6
  21. package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.d.ts +3 -5
  22. package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.d.ts.map +1 -1
  23. package/dist/commonjs/form-field/lib/hooks/useFormFieldLabel.js +4 -5
  24. package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.d.ts +2 -12
  25. package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.d.ts.map +1 -1
  26. package/dist/commonjs/form-field/lib/hooks/useFormFieldModel.js +9 -19
  27. package/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.d.ts +4 -4
  28. package/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.d.ts.map +1 -1
  29. package/dist/commonjs/form-field/lib/hooks/useFormFieldOrientation.js +5 -5
  30. package/dist/commonjs/menu/lib/Menu.d.ts +16 -9
  31. package/dist/commonjs/menu/lib/Menu.d.ts.map +1 -1
  32. package/dist/commonjs/menu/lib/Menu.js +108 -132
  33. package/dist/commonjs/menu/lib/MenuItem.d.ts +17 -7
  34. package/dist/commonjs/menu/lib/MenuItem.d.ts.map +1 -1
  35. package/dist/commonjs/menu/lib/MenuItem.js +111 -114
  36. package/dist/commonjs/pill/lib/Pill.d.ts +103 -5
  37. package/dist/commonjs/pill/lib/Pill.d.ts.map +1 -1
  38. package/dist/commonjs/pill/lib/Pill.js +158 -64
  39. package/dist/commonjs/pill/lib/PillAvatar.js +6 -17
  40. package/dist/commonjs/pill/lib/PillCount.js +7 -30
  41. package/dist/commonjs/pill/lib/PillIcon.js +8 -31
  42. package/dist/commonjs/pill/lib/PillIconButton.js +13 -36
  43. package/dist/commonjs/pill/lib/PillLabel.js +10 -33
  44. package/dist/commonjs/pill/lib/usePillModel.js +8 -16
  45. package/dist/commonjs/segmented-control/index.d.ts +2 -0
  46. package/dist/commonjs/segmented-control/index.d.ts.map +1 -1
  47. package/dist/commonjs/segmented-control/index.js +4 -0
  48. package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts +267 -82
  49. package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts.map +1 -1
  50. package/dist/commonjs/segmented-control/lib/SegmentedControl.js +42 -7
  51. package/dist/commonjs/segmented-control/lib/SegmentedControlItem.d.ts +9 -5
  52. package/dist/commonjs/segmented-control/lib/SegmentedControlItem.d.ts.map +1 -1
  53. package/dist/commonjs/segmented-control/lib/SegmentedControlItem.js +24 -49
  54. package/dist/commonjs/segmented-control/lib/SegmentedControlList.d.ts +71 -2
  55. package/dist/commonjs/segmented-control/lib/SegmentedControlList.d.ts.map +1 -1
  56. package/dist/commonjs/segmented-control/lib/SegmentedControlList.js +15 -40
  57. package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.d.ts +28 -9
  58. package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.d.ts.map +1 -1
  59. package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.js +8 -10
  60. package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.d.ts +233 -83
  61. package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.d.ts.map +1 -1
  62. package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.js +33 -32
  63. package/dist/commonjs/select/lib/Select.js +147 -187
  64. package/dist/commonjs/select/lib/SelectBase.js +106 -101
  65. package/dist/commonjs/select/lib/SelectMenu.js +53 -84
  66. package/dist/commonjs/select/lib/SelectOption.js +33 -47
  67. package/dist/commonjs/select/lib/scrolling.js +6 -7
  68. package/dist/commonjs/select/lib/utils.js +4 -4
  69. package/dist/commonjs/side-panel/lib/SidePanel.d.ts +13 -26
  70. package/dist/commonjs/side-panel/lib/SidePanel.d.ts.map +1 -1
  71. package/dist/commonjs/side-panel/lib/SidePanel.js +95 -133
  72. package/dist/commonjs/side-panel/lib/SidePanelToggleButton.d.ts +17 -0
  73. package/dist/commonjs/side-panel/lib/SidePanelToggleButton.d.ts.map +1 -0
  74. package/dist/commonjs/side-panel/lib/SidePanelToggleButton.js +65 -0
  75. package/dist/commonjs/side-panel/lib/hooks.d.ts +20 -0
  76. package/dist/commonjs/side-panel/lib/hooks.d.ts.map +1 -1
  77. package/dist/commonjs/side-panel/lib/hooks.js +40 -21
  78. package/dist/commonjs/status-indicator/index.d.ts +2 -0
  79. package/dist/commonjs/status-indicator/index.d.ts.map +1 -1
  80. package/dist/commonjs/status-indicator/index.js +4 -0
  81. package/dist/commonjs/status-indicator/lib/StatusIndicator.d.ts +32 -8
  82. package/dist/commonjs/status-indicator/lib/StatusIndicator.d.ts.map +1 -1
  83. package/dist/commonjs/status-indicator/lib/StatusIndicator.js +37 -35
  84. package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.d.ts +10 -0
  85. package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.d.ts.map +1 -1
  86. package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.js +11 -23
  87. package/dist/commonjs/status-indicator/lib/StatusIndicatorLabel.js +5 -28
  88. package/dist/commonjs/status-indicator/lib/hooks/useStatusIndicatorModel.js +6 -15
  89. package/dist/commonjs/table/index.d.ts +2 -0
  90. package/dist/commonjs/table/index.d.ts.map +1 -0
  91. package/dist/commonjs/{text-area/lib/hooks → table}/index.js +1 -1
  92. package/dist/commonjs/table/lib/Table.d.ts +207 -0
  93. package/dist/commonjs/table/lib/Table.d.ts.map +1 -0
  94. package/dist/commonjs/table/lib/Table.js +229 -0
  95. package/dist/commonjs/table/lib/TableBody.d.ts +2 -0
  96. package/dist/commonjs/table/lib/TableBody.d.ts.map +1 -0
  97. package/dist/commonjs/table/lib/TableBody.js +35 -0
  98. package/dist/commonjs/table/lib/TableCaption.d.ts +2 -0
  99. package/dist/commonjs/table/lib/TableCaption.d.ts.map +1 -0
  100. package/dist/commonjs/table/lib/TableCaption.js +16 -0
  101. package/dist/commonjs/table/lib/TableCell.d.ts +2 -0
  102. package/dist/commonjs/table/lib/TableCell.d.ts.map +1 -0
  103. package/dist/commonjs/table/lib/TableCell.js +16 -0
  104. package/dist/commonjs/table/lib/TableFooter.d.ts +2 -0
  105. package/dist/commonjs/table/lib/TableFooter.d.ts.map +1 -0
  106. package/dist/commonjs/table/lib/TableFooter.js +15 -0
  107. package/dist/commonjs/table/lib/TableHead.d.ts +2 -0
  108. package/dist/commonjs/table/lib/TableHead.d.ts.map +1 -0
  109. package/dist/commonjs/table/lib/TableHead.js +23 -0
  110. package/dist/commonjs/table/lib/TableHeader.d.ts +2 -0
  111. package/dist/commonjs/table/lib/TableHeader.d.ts.map +1 -0
  112. package/dist/commonjs/table/lib/TableHeader.js +16 -0
  113. package/dist/commonjs/table/lib/TableRow.d.ts +2 -0
  114. package/dist/commonjs/table/lib/TableRow.d.ts.map +1 -0
  115. package/dist/commonjs/table/lib/TableRow.js +19 -0
  116. package/dist/commonjs/text-area/lib/TextArea.d.ts +2 -2
  117. package/dist/commonjs/text-area/lib/TextArea.d.ts.map +1 -1
  118. package/dist/commonjs/text-area/lib/TextArea.js +9 -33
  119. package/dist/commonjs/text-area/lib/TextAreaField.d.ts +1 -1
  120. package/dist/commonjs/text-area/lib/TextAreaField.d.ts.map +1 -1
  121. package/dist/commonjs/text-area/lib/TextAreaField.js +12 -36
  122. package/dist/commonjs/text-input/lib/TextInput.d.ts +4 -4
  123. package/dist/commonjs/text-input/lib/TextInput.d.ts.map +1 -1
  124. package/dist/commonjs/text-input/lib/TextInput.js +9 -33
  125. package/dist/commonjs/text-input/lib/TextInputField.d.ts +1 -1
  126. package/dist/commonjs/text-input/lib/TextInputField.d.ts.map +1 -1
  127. package/dist/commonjs/text-input/lib/TextInputField.js +13 -25
  128. package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +3 -5
  129. package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts.map +1 -1
  130. package/dist/commonjs/text-input/lib/hooks/useTextInputField.js +3 -3
  131. package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +1 -0
  132. package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -1
  133. package/dist/commonjs/text-input/lib/hooks/useTextInputModel.js +2 -1
  134. package/dist/es6/color-picker/lib/ColorPicker.js +16 -39
  135. package/dist/es6/color-picker/lib/parts/ColorReset.js +27 -18
  136. package/dist/es6/color-picker/lib/parts/SwatchBook.js +21 -34
  137. package/dist/es6/form-field/lib/FormField.d.ts +4 -10
  138. package/dist/es6/form-field/lib/FormField.d.ts.map +1 -1
  139. package/dist/es6/form-field/lib/FormField.js +5 -28
  140. package/dist/es6/form-field/lib/FormFieldHint.d.ts +1 -1
  141. package/dist/es6/form-field/lib/FormFieldHint.js +4 -27
  142. package/dist/es6/form-field/lib/FormFieldInput.d.ts +1 -1
  143. package/dist/es6/form-field/lib/FormFieldInput.js +3 -14
  144. package/dist/es6/form-field/lib/FormFieldLabel.d.ts +2 -8
  145. package/dist/es6/form-field/lib/FormFieldLabel.d.ts.map +1 -1
  146. package/dist/es6/form-field/lib/FormFieldLabel.js +5 -28
  147. package/dist/es6/form-field/lib/hooks/useFormFieldHint.d.ts +3 -5
  148. package/dist/es6/form-field/lib/hooks/useFormFieldHint.d.ts.map +1 -1
  149. package/dist/es6/form-field/lib/hooks/useFormFieldHint.js +2 -3
  150. package/dist/es6/form-field/lib/hooks/useFormFieldInput.d.ts +3 -5
  151. package/dist/es6/form-field/lib/hooks/useFormFieldInput.d.ts.map +1 -1
  152. package/dist/es6/form-field/lib/hooks/useFormFieldInput.js +3 -4
  153. package/dist/es6/form-field/lib/hooks/useFormFieldLabel.d.ts +3 -5
  154. package/dist/es6/form-field/lib/hooks/useFormFieldLabel.d.ts.map +1 -1
  155. package/dist/es6/form-field/lib/hooks/useFormFieldLabel.js +2 -3
  156. package/dist/es6/form-field/lib/hooks/useFormFieldModel.d.ts +2 -12
  157. package/dist/es6/form-field/lib/hooks/useFormFieldModel.d.ts.map +1 -1
  158. package/dist/es6/form-field/lib/hooks/useFormFieldModel.js +9 -19
  159. package/dist/es6/form-field/lib/hooks/useFormFieldOrientation.d.ts +4 -4
  160. package/dist/es6/form-field/lib/hooks/useFormFieldOrientation.d.ts.map +1 -1
  161. package/dist/es6/form-field/lib/hooks/useFormFieldOrientation.js +4 -4
  162. package/dist/es6/menu/lib/Menu.d.ts +16 -9
  163. package/dist/es6/menu/lib/Menu.d.ts.map +1 -1
  164. package/dist/es6/menu/lib/Menu.js +103 -128
  165. package/dist/es6/menu/lib/MenuItem.d.ts +17 -7
  166. package/dist/es6/menu/lib/MenuItem.d.ts.map +1 -1
  167. package/dist/es6/menu/lib/MenuItem.js +107 -111
  168. package/dist/es6/pill/lib/Pill.d.ts +103 -5
  169. package/dist/es6/pill/lib/Pill.d.ts.map +1 -1
  170. package/dist/es6/pill/lib/Pill.js +149 -55
  171. package/dist/es6/pill/lib/PillAvatar.js +3 -14
  172. package/dist/es6/pill/lib/PillCount.js +4 -27
  173. package/dist/es6/pill/lib/PillIcon.js +3 -26
  174. package/dist/es6/pill/lib/PillIconButton.js +7 -30
  175. package/dist/es6/pill/lib/PillLabel.js +5 -28
  176. package/dist/es6/pill/lib/usePillModel.js +8 -16
  177. package/dist/es6/segmented-control/index.d.ts +2 -0
  178. package/dist/es6/segmented-control/index.d.ts.map +1 -1
  179. package/dist/es6/segmented-control/index.js +2 -0
  180. package/dist/es6/segmented-control/lib/SegmentedControl.d.ts +267 -82
  181. package/dist/es6/segmented-control/lib/SegmentedControl.d.ts.map +1 -1
  182. package/dist/es6/segmented-control/lib/SegmentedControl.js +38 -3
  183. package/dist/es6/segmented-control/lib/SegmentedControlItem.d.ts +9 -5
  184. package/dist/es6/segmented-control/lib/SegmentedControlItem.d.ts.map +1 -1
  185. package/dist/es6/segmented-control/lib/SegmentedControlItem.js +17 -42
  186. package/dist/es6/segmented-control/lib/SegmentedControlList.d.ts +71 -2
  187. package/dist/es6/segmented-control/lib/SegmentedControlList.d.ts.map +1 -1
  188. package/dist/es6/segmented-control/lib/SegmentedControlList.js +9 -34
  189. package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.d.ts +28 -9
  190. package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.d.ts.map +1 -1
  191. package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.js +5 -7
  192. package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.d.ts +233 -83
  193. package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.d.ts.map +1 -1
  194. package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.js +31 -30
  195. package/dist/es6/select/lib/Select.js +144 -184
  196. package/dist/es6/select/lib/SelectBase.js +99 -94
  197. package/dist/es6/select/lib/SelectMenu.js +49 -80
  198. package/dist/es6/select/lib/SelectOption.js +30 -44
  199. package/dist/es6/select/lib/scrolling.js +6 -7
  200. package/dist/es6/select/lib/utils.js +4 -4
  201. package/dist/es6/side-panel/lib/SidePanel.d.ts +13 -26
  202. package/dist/es6/side-panel/lib/SidePanel.d.ts.map +1 -1
  203. package/dist/es6/side-panel/lib/SidePanel.js +93 -130
  204. package/dist/es6/side-panel/lib/SidePanelToggleButton.d.ts +17 -0
  205. package/dist/es6/side-panel/lib/SidePanelToggleButton.d.ts.map +1 -0
  206. package/dist/es6/side-panel/lib/SidePanelToggleButton.js +43 -0
  207. package/dist/es6/side-panel/lib/hooks.d.ts +20 -0
  208. package/dist/es6/side-panel/lib/hooks.d.ts.map +1 -1
  209. package/dist/es6/side-panel/lib/hooks.js +37 -18
  210. package/dist/es6/status-indicator/index.d.ts +2 -0
  211. package/dist/es6/status-indicator/index.d.ts.map +1 -1
  212. package/dist/es6/status-indicator/index.js +2 -0
  213. package/dist/es6/status-indicator/lib/StatusIndicator.d.ts +32 -8
  214. package/dist/es6/status-indicator/lib/StatusIndicator.d.ts.map +1 -1
  215. package/dist/es6/status-indicator/lib/StatusIndicator.js +33 -31
  216. package/dist/es6/status-indicator/lib/StatusIndicatorIcon.d.ts +10 -0
  217. package/dist/es6/status-indicator/lib/StatusIndicatorIcon.d.ts.map +1 -1
  218. package/dist/es6/status-indicator/lib/StatusIndicatorIcon.js +6 -18
  219. package/dist/es6/status-indicator/lib/StatusIndicatorLabel.js +3 -26
  220. package/dist/es6/status-indicator/lib/hooks/useStatusIndicatorModel.js +6 -15
  221. package/dist/es6/table/index.d.ts +2 -0
  222. package/dist/es6/table/index.d.ts.map +1 -0
  223. package/dist/es6/table/index.js +1 -0
  224. package/dist/es6/table/lib/Table.d.ts +207 -0
  225. package/dist/es6/table/lib/Table.d.ts.map +1 -0
  226. package/dist/es6/table/lib/Table.js +223 -0
  227. package/dist/es6/table/lib/TableBody.d.ts +2 -0
  228. package/dist/es6/table/lib/TableBody.d.ts.map +1 -0
  229. package/dist/es6/table/lib/TableBody.js +29 -0
  230. package/dist/es6/table/lib/TableCaption.d.ts +2 -0
  231. package/dist/es6/table/lib/TableCaption.d.ts.map +1 -0
  232. package/dist/es6/table/lib/TableCaption.js +10 -0
  233. package/dist/es6/table/lib/TableCell.d.ts +2 -0
  234. package/dist/es6/table/lib/TableCell.d.ts.map +1 -0
  235. package/dist/es6/table/lib/TableCell.js +10 -0
  236. package/dist/es6/table/lib/TableFooter.d.ts +2 -0
  237. package/dist/es6/table/lib/TableFooter.d.ts.map +1 -0
  238. package/dist/es6/table/lib/TableFooter.js +9 -0
  239. package/dist/es6/table/lib/TableHead.d.ts +2 -0
  240. package/dist/es6/table/lib/TableHead.d.ts.map +1 -0
  241. package/dist/es6/table/lib/TableHead.js +17 -0
  242. package/dist/es6/table/lib/TableHeader.d.ts +2 -0
  243. package/dist/es6/table/lib/TableHeader.d.ts.map +1 -0
  244. package/dist/es6/table/lib/TableHeader.js +10 -0
  245. package/dist/es6/table/lib/TableRow.d.ts +2 -0
  246. package/dist/es6/table/lib/TableRow.d.ts.map +1 -0
  247. package/dist/es6/table/lib/TableRow.js +13 -0
  248. package/dist/es6/text-area/lib/TextArea.d.ts +2 -2
  249. package/dist/es6/text-area/lib/TextArea.d.ts.map +1 -1
  250. package/dist/es6/text-area/lib/TextArea.js +7 -31
  251. package/dist/es6/text-area/lib/TextAreaField.d.ts +1 -1
  252. package/dist/es6/text-area/lib/TextAreaField.d.ts.map +1 -1
  253. package/dist/es6/text-area/lib/TextAreaField.js +9 -33
  254. package/dist/es6/text-input/lib/TextInput.d.ts +4 -4
  255. package/dist/es6/text-input/lib/TextInput.d.ts.map +1 -1
  256. package/dist/es6/text-input/lib/TextInput.js +7 -31
  257. package/dist/es6/text-input/lib/TextInputField.d.ts +1 -1
  258. package/dist/es6/text-input/lib/TextInputField.d.ts.map +1 -1
  259. package/dist/es6/text-input/lib/TextInputField.js +12 -24
  260. package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +3 -5
  261. package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts.map +1 -1
  262. package/dist/es6/text-input/lib/hooks/useTextInputField.js +1 -1
  263. package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +1 -0
  264. package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -1
  265. package/dist/es6/text-input/lib/hooks/useTextInputModel.js +2 -1
  266. package/form-field/lib/FormField.tsx +5 -10
  267. package/form-field/lib/FormFieldLabel.tsx +6 -11
  268. package/form-field/lib/hooks/useFormFieldModel.tsx +1 -3
  269. package/form-field/lib/hooks/useFormFieldOrientation.tsx +6 -6
  270. package/menu/lib/Menu.tsx +16 -9
  271. package/menu/lib/MenuItem.tsx +19 -8
  272. package/package.json +4 -5
  273. package/pill/lib/Pill.tsx +109 -10
  274. package/pill/lib/PillCount.tsx +1 -1
  275. package/pill/lib/PillIcon.tsx +1 -1
  276. package/segmented-control/index.ts +2 -0
  277. package/segmented-control/lib/SegmentedControl.tsx +36 -0
  278. package/segmented-control/lib/SegmentedControlList.tsx +1 -1
  279. package/segmented-control/lib/hooks/useSegmentedControlItem.tsx +1 -5
  280. package/side-panel/lib/SidePanel.tsx +119 -169
  281. package/side-panel/lib/SidePanelToggleButton.tsx +78 -0
  282. package/side-panel/lib/hooks.ts +20 -0
  283. package/status-indicator/index.ts +2 -0
  284. package/status-indicator/lib/StatusIndicator.tsx +32 -6
  285. package/status-indicator/lib/StatusIndicatorIcon.tsx +1 -1
  286. package/table/LICENSE +51 -0
  287. package/table/README.md +5 -0
  288. package/table/index.ts +1 -0
  289. package/table/lib/Table.tsx +236 -0
  290. package/table/lib/TableBody.tsx +35 -0
  291. package/table/lib/TableCaption.tsx +22 -0
  292. package/table/lib/TableCell.tsx +27 -0
  293. package/table/lib/TableFooter.tsx +14 -0
  294. package/table/lib/TableHead.tsx +23 -0
  295. package/table/lib/TableHeader.tsx +28 -0
  296. package/table/lib/TableRow.tsx +26 -0
  297. package/table/package.json +6 -0
  298. package/text-area/lib/TextArea.tsx +9 -6
  299. package/text-area/lib/TextAreaField.tsx +6 -2
  300. package/text-input/lib/TextInput.tsx +9 -6
  301. package/text-input/lib/TextInputField.tsx +9 -5
  302. package/text-input/lib/hooks/useTextInputModel.ts +1 -0
  303. package/dist/commonjs/text-area/lib/hooks/index.d.ts +0 -2
  304. package/dist/commonjs/text-area/lib/hooks/index.d.ts.map +0 -1
  305. package/dist/commonjs/text-area/lib/hooks/useTextAreaModel.d.ts +0 -28
  306. package/dist/commonjs/text-area/lib/hooks/useTextAreaModel.d.ts.map +0 -1
  307. package/dist/commonjs/text-area/lib/hooks/useTextAreaModel.js +0 -5
  308. package/dist/es6/text-area/lib/hooks/index.d.ts +0 -2
  309. package/dist/es6/text-area/lib/hooks/index.d.ts.map +0 -1
  310. package/dist/es6/text-area/lib/hooks/index.js +0 -1
  311. package/dist/es6/text-area/lib/hooks/useTextAreaModel.d.ts +0 -28
  312. package/dist/es6/text-area/lib/hooks/useTextAreaModel.d.ts.map +0 -1
  313. package/dist/es6/text-area/lib/hooks/useTextAreaModel.js +0 -2
  314. package/text-area/lib/hooks/index.ts +0 -1
  315. package/text-area/lib/hooks/useTextAreaModel.ts +0 -3
@@ -1,10 +1,10 @@
1
- import { StackSpacing, StackProps } from '@workday/canvas-kit-react/layout';
1
+ import { FlexProps } from '@workday/canvas-kit-react/layout';
2
2
  /**
3
3
  * Adds the necessary layout props to a `FormField` component.
4
4
  */
5
5
  export declare const useFormFieldOrientation: (orientation: 'horizontal' | 'vertical') => {
6
- flexDirection: StackProps['flexDirection'];
7
- alignItems: StackProps['alignItems'];
8
- spacing: StackSpacing;
6
+ flexDirection: FlexProps['flexDirection'];
7
+ alignItems: FlexProps['alignItems'];
8
+ gap: FlexProps['gap'];
9
9
  };
10
10
  //# sourceMappingURL=useFormFieldOrientation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFormFieldOrientation.d.ts","sourceRoot":"","sources":["../../../../../form-field/lib/hooks/useFormFieldOrientation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,UAAU,EAAC,MAAM,kCAAkC,CAAC;AAG1E;;GAEG;AACH,eAAO,MAAM,uBAAuB,gBAAiB,YAAY,GAAG,UAAU;mBAE3D,UAAU,CAAC,eAAe,CAAC;gBAC9B,UAAU,CAAC,YAAY,CAAC;aAC3B,YAAY;CAkBxB,CAAC"}
1
+ {"version":3,"file":"useFormFieldOrientation.d.ts","sourceRoot":"","sources":["../../../../../form-field/lib/hooks/useFormFieldOrientation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,kCAAkC,CAAC;AAG3D;;GAEG;AACH,eAAO,MAAM,uBAAuB,gBAAiB,YAAY,GAAG,UAAU;mBAE3D,SAAS,CAAC,eAAe,CAAC;gBAC7B,SAAS,CAAC,YAAY,CAAC;SAC9B,SAAS,CAAC,KAAK,CAAC;CAkBxB,CAAC"}
@@ -2,19 +2,19 @@ import { space } from '@workday/canvas-kit-react/tokens';
2
2
  /**
3
3
  * Adds the necessary layout props to a `FormField` component.
4
4
  */
5
- export var useFormFieldOrientation = function (orientation) {
6
- var layoutProps;
5
+ export const useFormFieldOrientation = (orientation) => {
6
+ let layoutProps;
7
7
  if (orientation === 'horizontal') {
8
8
  layoutProps = {
9
9
  flexDirection: 'row',
10
- spacing: space.l,
10
+ gap: space.l,
11
11
  alignItems: 'center',
12
12
  };
13
13
  }
14
14
  else {
15
15
  layoutProps = {
16
16
  flexDirection: 'column',
17
- spacing: space.xxxs,
17
+ gap: space.xxxs,
18
18
  alignItems: 'flex-start',
19
19
  };
20
20
  }
@@ -4,8 +4,8 @@ import { GrowthBehavior } from '@workday/canvas-kit-react/common';
4
4
  /**
5
5
  * ### Deprecated Menu
6
6
  *
7
- * As of Canvas Kit v8, Menu is being soft-deprecated.
8
- * It will be hard-deprecated (completely removed) in v9. Please see the
7
+ * As of Canvas Kit v8, Menu is being deprecated.
8
+ * It will be removed in v10. Please see the
9
9
  * [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
10
10
  * for more information.
11
11
  */
@@ -47,8 +47,8 @@ export interface DeprecatedMenuProps extends GrowthBehavior, React.HTMLAttribute
47
47
  /**
48
48
  * ### Deprecated Menu State
49
49
  *
50
- * As of Canvas Kit v8, Menu is being soft-deprecated.
51
- * It will be hard-deprecated (completely removed) in v9. Please see the
50
+ * As of Canvas Kit v8, Menu is being deprecated.
51
+ * It will be removed in v10. Please see the
52
52
  * [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
53
53
  * for more information.
54
54
  */
@@ -56,12 +56,19 @@ export interface DeprecatedMenuState {
56
56
  selectedItemIndex: number;
57
57
  }
58
58
  /**
59
- * ### Deprecated Menu
59
+ * As of Canvas Kit v8, Menu is being deprecated.
60
+ * It will be removed in v10. Please see the [upgrade
61
+ * guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page) for
62
+ * more information.
60
63
  *
61
- * As of Canvas Kit v8, this component is being soft-deprecated.
62
- * It will be hard-deprecated (completely removed) in v9. Please see the
63
- * [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
64
- * for more information.
64
+ * `DeprecatedMenu` renders a styled `<ul role="menu">` element within a {@link Card} and follows
65
+ * the [Active Menu
66
+ * pattern](https://www.w3.org/TR/wai-aria-practices/examples/menu-button/menu-button-actions-active-descendant.html)
67
+ * using `aria-activedescendant`.
68
+ *
69
+ * Undocumented props are spread to the underlying `<ul>` element.
70
+ *
71
+ * @deprecated
65
72
  */
66
73
  export declare class DeprecatedMenu extends React.Component<DeprecatedMenuProps, DeprecatedMenuState> {
67
74
  private id;
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../menu/lib/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,uBAAuB,EAAC,MAAM,YAAY,CAAC;AAGnD,OAAO,EAAiB,cAAc,EAAmB,MAAM,kCAAkC,CAAC;AAElG;;;;;;;GAOG;AACH,MAAM,WAAW,mBACf,SAAQ,cAAc,EACpB,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC;IACxC;;OAEG;IACH,QAAQ,CAAC,EACL,KAAK,CAAC,YAAY,CAAC,uBAAuB,CAAC,GAC3C,KAAK,CAAC,YAAY,CAAC,uBAAuB,CAAC,EAAE,CAAC;IAClD;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAaD;;;;;;;GAOG;AACH,qBAAa,cAAe,SAAQ,KAAK,CAAC,SAAS,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;IAC3F,OAAO,CAAC,EAAE,CAAsB;IAChC,OAAO,CAAC,SAAS,CAAU;IAE3B,OAAO,CAAC,OAAO,CAAoC;IACnD,OAAO,CAAC,eAAe,CAAY;gBAEvB,KAAK,EAAE,mBAAmB;IAetC,kBAAkB,CAAC,SAAS,EAAE,mBAAmB;IAejD,iBAAiB;IAYjB,oBAAoB;IAIb,MAAM;IAyDN,sBAAsB,UAAW,MAAM,GAAG,SAAS,KAAG,MAAM,CAQjE;IAEK,sBAAsB,UAAW,MAAM,GAAG,SAAS,KAAG,IAAI,CAE/D;IAEF,OAAO,CAAC,uBAAuB,CA+E7B;IAEF,OAAO,CAAC,WAAW,CAoBjB;IAEF,OAAO,CAAC,kBAAkB,CAWxB;IAEF,OAAO,CAAC,kBAAkB,CAkCxB;IAEF,OAAO,CAAC,sBAAsB,CAU5B;IAEF,OAAO,CAAC,sBAAsB,CAG5B;CACH"}
1
+ {"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../menu/lib/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,uBAAuB,EAAC,MAAM,YAAY,CAAC;AAGnD,OAAO,EAAiB,cAAc,EAAmB,MAAM,kCAAkC,CAAC;AAElG;;;;;;;GAOG;AACH,MAAM,WAAW,mBACf,SAAQ,cAAc,EACpB,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC;IACxC;;OAEG;IACH,QAAQ,CAAC,EACL,KAAK,CAAC,YAAY,CAAC,uBAAuB,CAAC,GAC3C,KAAK,CAAC,YAAY,CAAC,uBAAuB,CAAC,EAAE,CAAC;IAClD;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAaD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,cAAe,SAAQ,KAAK,CAAC,SAAS,CAAC,mBAAmB,EAAE,mBAAmB,CAAC;IAC3F,OAAO,CAAC,EAAE,CAAsB;IAChC,OAAO,CAAC,SAAS,CAAU;IAE3B,OAAO,CAAC,OAAO,CAAoC;IACnD,OAAO,CAAC,eAAe,CAAY;gBAEvB,KAAK,EAAE,mBAAmB;IAetC,kBAAkB,CAAC,SAAS,EAAE,mBAAmB;IAejD,iBAAiB;IAYjB,oBAAoB;IAIb,MAAM;IAyDN,sBAAsB,UAAW,MAAM,GAAG,SAAS,KAAG,MAAM,CAQjE;IAEK,sBAAsB,UAAW,MAAM,GAAG,SAAS,KAAG,IAAI,CAE/D;IAEF,OAAO,CAAC,uBAAuB,CA+E7B;IAEF,OAAO,CAAC,WAAW,CAoBjB;IAEF,OAAO,CAAC,kBAAkB,CAWxB;IAEF,OAAO,CAAC,kBAAkB,CAkCxB;IAEF,OAAO,CAAC,sBAAsB,CAU5B;IAEF,OAAO,CAAC,sBAAsB,CAG5B;CACH"}
@@ -1,94 +1,72 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- extendStatics(d, b);
10
- function __() { this.constructor = d; }
11
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
- };
13
- })();
14
- var __assign = (this && this.__assign) || function () {
15
- __assign = Object.assign || function(t) {
16
- for (var s, i = 1, n = arguments.length; i < n; i++) {
17
- s = arguments[i];
18
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
19
- t[p] = s[p];
20
- }
21
- return t;
22
- };
23
- return __assign.apply(this, arguments);
24
- };
25
- var __rest = (this && this.__rest) || function (s, e) {
26
- var t = {};
27
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
28
- t[p] = s[p];
29
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
30
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
31
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
32
- t[p[i]] = s[p[i]];
33
- }
34
- return t;
35
- };
36
1
  import * as React from 'react';
37
2
  import styled from '@emotion/styled';
38
3
  import { Card } from '@workday/canvas-kit-react/card';
39
4
  import { commonColors, space, borderRadius } from '@workday/canvas-kit-react/tokens';
40
5
  import { hideMouseFocus, generateUniqueId } from '@workday/canvas-kit-react/common';
41
- var List = styled('ul')(__assign({ background: commonColors.background, borderRadius: borderRadius.m, padding: 0, margin: space.xxs + " 0", '&:focus': {
6
+ const List = styled('ul')({
7
+ background: commonColors.background,
8
+ borderRadius: borderRadius.m,
9
+ padding: 0,
10
+ margin: `${space.xxs} 0`,
11
+ '&:focus': {
42
12
  outline: 'none',
43
- } }, hideMouseFocus));
13
+ },
14
+ ...hideMouseFocus,
15
+ });
44
16
  /**
45
- * ### Deprecated Menu
17
+ * As of Canvas Kit v8, Menu is being deprecated.
18
+ * It will be removed in v10. Please see the [upgrade
19
+ * guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page) for
20
+ * more information.
21
+ *
22
+ * `DeprecatedMenu` renders a styled `<ul role="menu">` element within a {@link Card} and follows
23
+ * the [Active Menu
24
+ * pattern](https://www.w3.org/TR/wai-aria-practices/examples/menu-button/menu-button-actions-active-descendant.html)
25
+ * using `aria-activedescendant`.
26
+ *
27
+ * Undocumented props are spread to the underlying `<ul>` element.
46
28
  *
47
- * As of Canvas Kit v8, this component is being soft-deprecated.
48
- * It will be hard-deprecated (completely removed) in v9. Please see the
49
- * [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
50
- * for more information.
29
+ * @deprecated
51
30
  */
52
- var DeprecatedMenu = /** @class */ (function (_super) {
53
- __extends(DeprecatedMenu, _super);
54
- function DeprecatedMenu(props) {
55
- var _this = _super.call(this, props) || this;
56
- _this.id = generateUniqueId();
57
- _this.getNormalizedItemIndex = function (index) {
58
- var itemCount = React.Children.count(_this.props.children);
59
- var firstItem = 0;
60
- var lastItem = itemCount - 1;
31
+ export class DeprecatedMenu extends React.Component {
32
+ constructor(props) {
33
+ super(props);
34
+ this.id = generateUniqueId();
35
+ this.getNormalizedItemIndex = (index) => {
36
+ const itemCount = React.Children.count(this.props.children);
37
+ const firstItem = 0;
38
+ const lastItem = itemCount - 1;
61
39
  if (!index) {
62
40
  return firstItem;
63
41
  }
64
42
  return index < 0 ? firstItem : index >= itemCount ? lastItem : index;
65
43
  };
66
- _this.setNormalizedItemIndex = function (index) {
67
- _this.setState({ selectedItemIndex: _this.getNormalizedItemIndex(index) });
44
+ this.setNormalizedItemIndex = (index) => {
45
+ this.setState({ selectedItemIndex: this.getNormalizedItemIndex(index) });
68
46
  };
69
- _this.handleKeyboardShortcuts = function (event) {
47
+ this.handleKeyboardShortcuts = (event) => {
70
48
  if (event.ctrlKey || event.altKey || event.metaKey) {
71
49
  return;
72
50
  }
73
- var children = React.Children.toArray(_this.props.children);
74
- var nextSelectedIndex = 0;
75
- var isShortcut = false;
76
- var interactiveItems = children.filter(function (child) {
51
+ const children = React.Children.toArray(this.props.children);
52
+ let nextSelectedIndex = 0;
53
+ let isShortcut = false;
54
+ const interactiveItems = children.filter(child => {
77
55
  var _a, _b;
78
56
  return !((_b = (_a = child) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.isHeader);
79
57
  });
80
- var interactiveItemCount = interactiveItems.length;
81
- var firstIndex = 0;
82
- var lastIndex = interactiveItemCount - 1;
58
+ const interactiveItemCount = interactiveItems.length;
59
+ const firstIndex = 0;
60
+ const lastIndex = interactiveItemCount - 1;
83
61
  if (event.key.length === 1 && event.key.match(/\S/)) {
84
- var start = _this.state.selectedItemIndex + 1;
85
- var searchIndex = void 0;
62
+ let start = this.state.selectedItemIndex + 1;
63
+ let searchIndex;
86
64
  if (start === children.length) {
87
65
  start = 0;
88
66
  }
89
- searchIndex = _this.getIndexFirstChars(start, event.key.toLowerCase());
67
+ searchIndex = this.getIndexFirstChars(start, event.key.toLowerCase());
90
68
  if (searchIndex === -1) {
91
- searchIndex = _this.getIndexFirstChars(0, event.key.toLowerCase(), start);
69
+ searchIndex = this.getIndexFirstChars(0, event.key.toLowerCase(), start);
92
70
  }
93
71
  if (searchIndex > -1) {
94
72
  isShortcut = true;
@@ -99,48 +77,48 @@ var DeprecatedMenu = /** @class */ (function (_super) {
99
77
  switch (event.key) {
100
78
  case 'ArrowUp':
101
79
  case 'ArrowDown':
102
- var direction = event.key === 'ArrowUp' ? -1 : 1;
80
+ const direction = event.key === 'ArrowUp' ? -1 : 1;
103
81
  isShortcut = true;
104
- var nextIndex = _this.state.selectedItemIndex + direction;
82
+ const nextIndex = this.state.selectedItemIndex + direction;
105
83
  nextSelectedIndex =
106
84
  nextIndex < 0 ? lastIndex : nextIndex >= interactiveItemCount ? firstIndex : nextIndex;
107
85
  break;
108
86
  case 'Home':
109
87
  case 'End':
110
- var skipTo = event.key === 'Home' ? firstIndex : lastIndex;
88
+ const skipTo = event.key === 'Home' ? firstIndex : lastIndex;
111
89
  isShortcut = true;
112
90
  nextSelectedIndex = skipTo;
113
91
  break;
114
92
  case 'Tab':
115
- if (_this.props.onClose) {
116
- _this.props.onClose();
93
+ if (this.props.onClose) {
94
+ this.props.onClose();
117
95
  }
118
96
  break;
119
97
  case 'Escape':
120
98
  case 'Esc': // IE/Edge specific value
121
99
  isShortcut = true;
122
- if (_this.props.onClose) {
123
- _this.props.onClose();
100
+ if (this.props.onClose) {
101
+ this.props.onClose();
124
102
  }
125
103
  break;
126
104
  case 'Spacebar':
127
105
  case ' ':
128
106
  case 'Enter':
129
- nextSelectedIndex = _this.state.selectedItemIndex;
130
- var child = interactiveItems[_this.state.selectedItemIndex];
131
- _this.handleClick(event, child.props);
107
+ nextSelectedIndex = this.state.selectedItemIndex;
108
+ const child = interactiveItems[this.state.selectedItemIndex];
109
+ this.handleClick(event, child.props);
132
110
  isShortcut = true;
133
111
  break;
134
112
  default:
135
113
  }
136
114
  }
137
115
  if (isShortcut) {
138
- _this.setNormalizedItemIndex(nextSelectedIndex);
116
+ this.setNormalizedItemIndex(nextSelectedIndex);
139
117
  event.stopPropagation();
140
118
  event.preventDefault();
141
119
  }
142
120
  };
143
- _this.handleClick = function (event, menuItemProps) {
121
+ this.handleClick = (event, menuItemProps) => {
144
122
  /* istanbul ignore next line for coverage */
145
123
  if (menuItemProps.isDisabled) {
146
124
  // You should only hit this point if you are using a custom DeprecatedMenuItem implementation.
@@ -149,27 +127,26 @@ var DeprecatedMenu = /** @class */ (function (_super) {
149
127
  if (menuItemProps.onClick) {
150
128
  menuItemProps.onClick(event);
151
129
  }
152
- if (_this.props.onSelect) {
153
- _this.props.onSelect();
130
+ if (this.props.onSelect) {
131
+ this.props.onSelect();
154
132
  }
155
- if (_this.props.onClose) {
133
+ if (this.props.onClose) {
156
134
  if (menuItemProps.shouldClose) {
157
- _this.props.onClose();
135
+ this.props.onClose();
158
136
  }
159
137
  }
160
138
  };
161
- _this.getIndexFirstChars = function (startIndex, character, lastIndex) {
162
- if (lastIndex === void 0) { lastIndex = _this.firstCharacters.length; }
163
- for (var i = startIndex; i < lastIndex; i++) {
164
- if (character === _this.firstCharacters[i]) {
139
+ this.getIndexFirstChars = (startIndex, character, lastIndex = this.firstCharacters.length) => {
140
+ for (let i = startIndex; i < lastIndex; i++) {
141
+ if (character === this.firstCharacters[i]) {
165
142
  return i;
166
143
  }
167
144
  }
168
145
  return -1;
169
146
  };
170
- _this.setFirstCharacters = function () {
171
- var getFirstCharacter = function (child) {
172
- var character = '';
147
+ this.setFirstCharacters = () => {
148
+ const getFirstCharacter = (child) => {
149
+ let character = '';
173
150
  if (!child || typeof child === 'boolean') {
174
151
  character = '';
175
152
  }
@@ -185,7 +162,7 @@ var DeprecatedMenu = /** @class */ (function (_super) {
185
162
  character = getFirstCharacter(child[0]);
186
163
  }
187
164
  else if ('props' in child) {
188
- var children = child.props.children;
165
+ const { children } = child.props;
189
166
  if (Array.isArray(children)) {
190
167
  character = getFirstCharacter(children[0]);
191
168
  }
@@ -195,43 +172,41 @@ var DeprecatedMenu = /** @class */ (function (_super) {
195
172
  }
196
173
  return character;
197
174
  };
198
- var firstCharacters = React.Children.map(_this.props.children, function (child) {
175
+ const firstCharacters = React.Children.map(this.props.children, child => {
199
176
  var _a, _b;
200
177
  if ((_b = (_a = child) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.isHeader) {
201
178
  return;
202
179
  }
203
180
  return getFirstCharacter(child);
204
181
  });
205
- _this.firstCharacters = firstCharacters;
182
+ this.firstCharacters = firstCharacters;
206
183
  };
207
- _this.getInitialSelectedItem = function () {
208
- var selected = _this.props.initialSelectedItem || 0;
209
- selected = selected < 0 ? React.Children.count(_this.props.children) + selected : selected;
184
+ this.getInitialSelectedItem = () => {
185
+ let selected = this.props.initialSelectedItem || 0;
186
+ selected = selected < 0 ? React.Children.count(this.props.children) + selected : selected;
210
187
  if (selected < 0) {
211
188
  selected = 0;
212
189
  }
213
- else if (selected > React.Children.count(_this.props.children) - 1) {
214
- selected = React.Children.count(_this.props.children) - 1;
190
+ else if (selected > React.Children.count(this.props.children) - 1) {
191
+ selected = React.Children.count(this.props.children) - 1;
215
192
  }
216
193
  return selected;
217
194
  };
218
- _this.setInitialSelectedItem = function () {
219
- var selected = _this.getInitialSelectedItem();
220
- _this.setState({ selectedItemIndex: selected });
195
+ this.setInitialSelectedItem = () => {
196
+ const selected = this.getInitialSelectedItem();
197
+ this.setState({ selectedItemIndex: selected });
221
198
  };
222
- _this.menuRef = React.createRef();
223
- var selected = _this.getInitialSelectedItem();
199
+ this.menuRef = React.createRef();
200
+ const selected = this.getInitialSelectedItem();
224
201
  // We track the active menu item by index so we can avoid setting a bunch of refs
225
202
  // for doing things like selecting an item by first character (or really calling .focus() at all)
226
203
  // It allows us to use the activedescendant design pattern
227
204
  // https://www.w3.org/TR/wai-aria-practices/examples/menu-button/menu-button-actions-active-descendant.html
228
- _this.state = {
205
+ this.state = {
229
206
  selectedItemIndex: selected,
230
207
  };
231
- return _this;
232
208
  }
233
- DeprecatedMenu.prototype.componentDidUpdate = function (prevProps) {
234
- var _this = this;
209
+ componentDidUpdate(prevProps) {
235
210
  if (this.props.children !== prevProps.children) {
236
211
  this.setFirstCharacters();
237
212
  this.setInitialSelectedItem();
@@ -239,45 +214,45 @@ var DeprecatedMenu = /** @class */ (function (_super) {
239
214
  if (this.props.isOpen && !prevProps.isOpen) {
240
215
  this.setInitialSelectedItem();
241
216
  }
242
- this.animateId = requestAnimationFrame(function () {
243
- if (_this.props.isOpen && _this.menuRef.current) {
244
- _this.menuRef.current.focus();
217
+ this.animateId = requestAnimationFrame(() => {
218
+ if (this.props.isOpen && this.menuRef.current) {
219
+ this.menuRef.current.focus();
245
220
  }
246
221
  });
247
- };
248
- DeprecatedMenu.prototype.componentDidMount = function () {
249
- console.warn("This component is being deprecated and will be removed in Canvas Kit V9.\n\n For more information, please see the V8 upgrade guide:\n\n https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page\n ");
222
+ }
223
+ componentDidMount() {
224
+ console.warn(`This component is being deprecated and will be removed in Canvas Kit V9.\n
225
+ For more information, please see the V8 upgrade guide:\n
226
+ https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page
227
+ `);
250
228
  this.setFirstCharacters();
251
229
  this.setInitialSelectedItem();
252
- };
253
- DeprecatedMenu.prototype.componentWillUnmount = function () {
230
+ }
231
+ componentWillUnmount() {
254
232
  cancelAnimationFrame(this.animateId);
255
- };
256
- DeprecatedMenu.prototype.render = function () {
257
- var _this = this;
233
+ }
234
+ render() {
258
235
  // TODO: Standardize on prop spread location (see #150)
259
- var _a = this.props, _b = _a.id, id = _b === void 0 ? this.id : _b, _c = _a.isOpen, isOpen = _c === void 0 ? true : _c, children = _a.children, ariaLabelledby = _a["aria-labelledby"], grow = _a.grow, width = _a.width, onSelect = _a.onSelect, onClose = _a.onClose, initialSelectedItem = _a.initialSelectedItem, elemProps = __rest(_a, ["id", "isOpen", "children", 'aria-labelledby', "grow", "width", "onSelect", "onClose", "initialSelectedItem"]);
260
- var selectedItemIndex = this.state.selectedItemIndex;
261
- var cardWidth = grow ? '100%' : width;
262
- var interactiveItemIndex = null;
236
+ const { id = this.id, isOpen = true, children, 'aria-labelledby': ariaLabelledby, grow, width, onSelect, onClose, initialSelectedItem, ...elemProps } = this.props;
237
+ const { selectedItemIndex } = this.state;
238
+ const cardWidth = grow ? '100%' : width;
239
+ let interactiveItemIndex = null;
263
240
  return (React.createElement(Card, { display: "inline-block", padding: space.zero, width: cardWidth, depth: 3 },
264
241
  React.createElement(Card.Body, null,
265
- React.createElement(List, __assign({ role: "menu", tabIndex: 0, id: id, "aria-labelledby": ariaLabelledby, "aria-activedescendant": id + "-" + selectedItemIndex, onKeyDown: this.handleKeyboardShortcuts, ref: this.menuRef }, elemProps), React.Children.map(children, function (menuItem) {
242
+ React.createElement(List, Object.assign({ role: "menu", tabIndex: 0, id: id, "aria-labelledby": ariaLabelledby, "aria-activedescendant": `${id}-${selectedItemIndex}`, onKeyDown: this.handleKeyboardShortcuts, ref: this.menuRef }, elemProps), React.Children.map(children, menuItem => {
266
243
  if (!React.isValidElement(menuItem)) {
267
244
  return;
268
245
  }
269
- var itemId;
246
+ let itemId;
270
247
  if (!menuItem.props.isHeader) {
271
248
  interactiveItemIndex = (interactiveItemIndex !== null && interactiveItemIndex !== void 0 ? interactiveItemIndex : -1) + 1;
272
- itemId = id + "-" + interactiveItemIndex;
249
+ itemId = `${id}-${interactiveItemIndex}`;
273
250
  }
274
251
  return (React.createElement(React.Fragment, { key: itemId }, React.cloneElement(menuItem, {
275
- onClick: function (event) { return _this.handleClick(event, menuItem.props); },
252
+ onClick: (event) => this.handleClick(event, menuItem.props),
276
253
  id: itemId,
277
254
  isFocused: selectedItemIndex === interactiveItemIndex && !menuItem.props.isHeader,
278
255
  })));
279
256
  })))));
280
- };
281
- return DeprecatedMenu;
282
- }(React.Component));
283
- export { DeprecatedMenu };
257
+ }
258
+ }
@@ -3,8 +3,8 @@ import { CanvasSystemIcon } from '@workday/design-assets-types';
3
3
  /**
4
4
  * ### Deprecated Menu Item Props
5
5
  *
6
- * As of Canvas Kit v8, Menu is being soft-deprecated.
7
- * It will be hard-deprecated (completely removed) in v9. Please see the
6
+ * As of Canvas Kit v8, Menu is being deprecated.
7
+ * It will be removed in v10. Please see the
8
8
  * [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
9
9
  * for more information.
10
10
  */
@@ -57,12 +57,22 @@ export interface DeprecatedMenuItemProps extends React.LiHTMLAttributes<HTMLLIEl
57
57
  shouldClose?: boolean;
58
58
  }
59
59
  /**
60
- * ### Deprecated Menu Item
60
+ * `DeprecatedMenuItem` renders an `<li>` element with the correct attributes to ensure it is
61
+ * accessible. If you choose to implement your own custom menu items, be sure to use semantic `<li>`
62
+ * elements with the following attributes:
61
63
  *
62
- * As of Canvas Kit v8, Menu is being soft-deprecated.
63
- * It will be hard-deprecated (completely removed) in v9. Please see the
64
- * [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
65
- * for more information.
64
+ * - `role="menuitem"`
65
+ * - `tabindex={-1}`
66
+ * - `id`s following this pattern: `${MenuId}-${index}`
67
+ *
68
+ * As of Canvas Kit v8, Menu is being deprecated.
69
+ * It will be removed in v10. Please see the [upgrade
70
+ * guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page) for
71
+ * more information.
72
+ *
73
+ * Undocumented props are spread to the underlying `<li>` element.
74
+ *
75
+ * @deprecated
66
76
  */
67
77
  export declare class DeprecatedMenuItem extends React.Component<DeprecatedMenuItemProps> {
68
78
  ref: React.RefObject<HTMLLIElement>;
@@ -1 +1 @@
1
- {"version":3,"file":"MenuItem.d.ts","sourceRoot":"","sources":["../../../../menu/lib/MenuItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAG9D;;;;;;;GAOG;AACH,MAAM,WAAW,uBAAwB,SAAQ,KAAK,CAAC,gBAAgB,CAAC,aAAa,CAAC;IACpF;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC5C;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;OAEG;IACH,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AA2LD;;;;;;;GAOG;AACH,qBAAa,kBAAmB,SAAQ,KAAK,CAAC,SAAS,CAAC,uBAAuB,CAAC;IAC9E,GAAG,iCAAoC;IAEvC,iBAAiB;IASjB,kBAAkB,cAAe,uBAAuB,UAMtD;IAEF,MAAM;IA2CN,OAAO,CAAC,WAAW,CAOjB;CACH"}
1
+ {"version":3,"file":"MenuItem.d.ts","sourceRoot":"","sources":["../../../../menu/lib/MenuItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAG9D;;;;;;;GAOG;AACH,MAAM,WAAW,uBAAwB,SAAQ,KAAK,CAAC,gBAAgB,CAAC,aAAa,CAAC;IACpF;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC5C;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;OAEG;IACH,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AA2LD;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,kBAAmB,SAAQ,KAAK,CAAC,SAAS,CAAC,uBAAuB,CAAC;IAC9E,GAAG,iCAAoC;IAEvC,iBAAiB;IASjB,kBAAkB,cAAe,uBAAuB,UAMtD;IAEF,MAAM;IA4CN,OAAO,CAAC,WAAW,CAOjB;CACH"}