@workday/canvas-kit-preview-react 8.0.0 → 8.0.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 (354) hide show
  1. package/color-picker/README.md +1 -1
  2. package/color-picker/index.ts +1 -1
  3. package/color-picker/lib/ColorPicker.tsx +2 -3
  4. package/dist/commonjs/color-picker/index.d.ts +1 -1
  5. package/dist/commonjs/color-picker/index.d.ts.map +1 -1
  6. package/dist/commonjs/color-picker/index.js +2 -6
  7. package/dist/commonjs/color-picker/lib/ColorPicker.d.ts +1 -2
  8. package/dist/commonjs/color-picker/lib/ColorPicker.d.ts.map +1 -1
  9. package/dist/commonjs/color-picker/lib/ColorPicker.js +5 -4
  10. package/dist/commonjs/form-field/lib/FormField.d.ts +2 -11
  11. package/dist/commonjs/form-field/lib/FormField.d.ts.map +1 -1
  12. package/dist/commonjs/form-field/lib/FormFieldHint.d.ts +1 -1
  13. package/dist/commonjs/form-field/lib/FormFieldHint.d.ts.map +1 -1
  14. package/dist/commonjs/form-field/lib/FormFieldHint.js +2 -3
  15. package/dist/commonjs/form-field/lib/FormFieldInput.d.ts +1 -1
  16. package/dist/commonjs/form-field/lib/FormFieldLabel.d.ts.map +1 -1
  17. package/dist/commonjs/form-field/lib/FormFieldLabel.js +3 -9
  18. package/dist/commonjs/index.d.ts +2 -1
  19. package/dist/commonjs/index.d.ts.map +1 -1
  20. package/dist/commonjs/index.js +2 -2
  21. package/dist/commonjs/menu/index.d.ts +1 -4
  22. package/dist/commonjs/menu/index.d.ts.map +1 -1
  23. package/dist/commonjs/menu/index.js +1 -9
  24. package/dist/commonjs/menu/lib/Menu.d.ts +37 -13
  25. package/dist/commonjs/menu/lib/Menu.d.ts.map +1 -1
  26. package/dist/commonjs/menu/lib/Menu.js +43 -22
  27. package/dist/commonjs/menu/lib/MenuItem.d.ts +35 -14
  28. package/dist/commonjs/menu/lib/MenuItem.d.ts.map +1 -1
  29. package/dist/commonjs/menu/lib/MenuItem.js +24 -9
  30. package/dist/commonjs/pill/lib/Pill.d.ts +0 -10
  31. package/dist/commonjs/pill/lib/Pill.d.ts.map +1 -1
  32. package/dist/commonjs/segmented-control/index.d.ts +3 -0
  33. package/dist/commonjs/segmented-control/index.d.ts.map +1 -0
  34. package/dist/commonjs/{breadcrumbs → segmented-control}/index.js +2 -5
  35. package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts +1004 -0
  36. package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts.map +1 -0
  37. package/dist/commonjs/segmented-control/lib/SegmentedControl.js +22 -0
  38. package/dist/commonjs/segmented-control/lib/SegmentedControlItem.d.ts +103 -0
  39. package/dist/commonjs/segmented-control/lib/SegmentedControlItem.d.ts.map +1 -0
  40. package/dist/commonjs/segmented-control/lib/SegmentedControlItem.js +130 -0
  41. package/dist/commonjs/segmented-control/lib/SegmentedControlList.d.ts +66 -0
  42. package/dist/commonjs/segmented-control/lib/SegmentedControlList.d.ts.map +1 -0
  43. package/dist/commonjs/{breadcrumbs/lib/Breadcrumbs/Dropdown/MenuItemLink.js → segmented-control/lib/SegmentedControlList.js} +21 -28
  44. package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.d.ts +60 -0
  45. package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.d.ts.map +1 -0
  46. package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlItem.js +23 -0
  47. package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.d.ts +1052 -0
  48. package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.d.ts.map +1 -0
  49. package/dist/commonjs/segmented-control/lib/hooks/useSegmentedControlModel.js +74 -0
  50. package/dist/commonjs/select/index.d.ts +0 -3
  51. package/dist/commonjs/select/index.d.ts.map +1 -1
  52. package/dist/commonjs/select/index.js +0 -7
  53. package/dist/commonjs/select/lib/Select.d.ts +0 -1
  54. package/dist/commonjs/select/lib/Select.d.ts.map +1 -1
  55. package/dist/commonjs/select/lib/Select.js +2 -6
  56. package/dist/commonjs/select/lib/SelectBase.d.ts +2 -2
  57. package/dist/commonjs/select/lib/SelectBase.d.ts.map +1 -1
  58. package/dist/commonjs/select/lib/SelectBase.js +6 -9
  59. package/dist/commonjs/select/lib/SelectMenu.d.ts +2 -2
  60. package/dist/commonjs/select/lib/SelectMenu.d.ts.map +1 -1
  61. package/dist/commonjs/select/lib/SelectMenu.js +2 -2
  62. package/dist/commonjs/select/lib/SelectOption.d.ts +1 -2
  63. package/dist/commonjs/select/lib/SelectOption.d.ts.map +1 -1
  64. package/dist/commonjs/select/lib/SelectOption.js +2 -1
  65. package/dist/commonjs/side-panel/index.d.ts +0 -3
  66. package/dist/commonjs/side-panel/index.d.ts.map +1 -1
  67. package/dist/commonjs/side-panel/index.js +0 -7
  68. package/dist/commonjs/side-panel/lib/SidePanel.d.ts +1 -2
  69. package/dist/commonjs/side-panel/lib/SidePanel.d.ts.map +1 -1
  70. package/dist/commonjs/side-panel/lib/SidePanel.js +3 -3
  71. package/dist/commonjs/status-indicator/index.d.ts +2 -0
  72. package/dist/commonjs/status-indicator/index.d.ts.map +1 -0
  73. package/dist/commonjs/status-indicator/index.js +13 -0
  74. package/dist/commonjs/status-indicator/lib/StatusIndicator.d.ts +42 -0
  75. package/dist/commonjs/status-indicator/lib/StatusIndicator.d.ts.map +1 -0
  76. package/dist/commonjs/status-indicator/lib/StatusIndicator.js +55 -0
  77. package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.d.ts +73 -0
  78. package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.d.ts.map +1 -0
  79. package/dist/commonjs/status-indicator/lib/StatusIndicatorIcon.js +98 -0
  80. package/dist/commonjs/status-indicator/lib/StatusIndicatorLabel.d.ts +5 -0
  81. package/dist/commonjs/status-indicator/lib/StatusIndicatorLabel.d.ts.map +1 -0
  82. package/dist/commonjs/{breadcrumbs/lib/Breadcrumbs/List/index.js → status-indicator/lib/StatusIndicatorLabel.js} +6 -6
  83. package/dist/commonjs/status-indicator/lib/hooks/index.d.ts +2 -0
  84. package/dist/commonjs/status-indicator/lib/hooks/index.d.ts.map +1 -0
  85. package/dist/commonjs/status-indicator/lib/hooks/index.js +13 -0
  86. package/dist/commonjs/status-indicator/lib/hooks/useStatusIndicatorModel.d.ts +75 -0
  87. package/dist/commonjs/status-indicator/lib/hooks/useStatusIndicatorModel.d.ts.map +1 -0
  88. package/dist/commonjs/status-indicator/lib/hooks/useStatusIndicatorModel.js +34 -0
  89. package/dist/commonjs/text-area/lib/TextArea.d.ts +2 -11
  90. package/dist/commonjs/text-area/lib/TextArea.d.ts.map +1 -1
  91. package/dist/commonjs/text-area/lib/TextAreaField.d.ts +1 -1
  92. package/dist/commonjs/text-area/lib/TextAreaField.d.ts.map +1 -1
  93. package/dist/commonjs/text-area/lib/TextAreaField.js +15 -7
  94. package/dist/commonjs/text-input/lib/TextInput.d.ts +2 -11
  95. package/dist/commonjs/text-input/lib/TextInput.d.ts.map +1 -1
  96. package/dist/commonjs/text-input/lib/TextInputField.d.ts +1 -1
  97. package/dist/commonjs/text-input/lib/TextInputField.d.ts.map +1 -1
  98. package/dist/commonjs/text-input/lib/TextInputField.js +14 -7
  99. package/dist/es6/color-picker/index.d.ts +1 -1
  100. package/dist/es6/color-picker/index.d.ts.map +1 -1
  101. package/dist/es6/color-picker/index.js +1 -1
  102. package/dist/es6/color-picker/lib/ColorPicker.d.ts +1 -2
  103. package/dist/es6/color-picker/lib/ColorPicker.d.ts.map +1 -1
  104. package/dist/es6/color-picker/lib/ColorPicker.js +2 -3
  105. package/dist/es6/form-field/lib/FormField.d.ts +2 -11
  106. package/dist/es6/form-field/lib/FormField.d.ts.map +1 -1
  107. package/dist/es6/form-field/lib/FormFieldHint.d.ts +1 -1
  108. package/dist/es6/form-field/lib/FormFieldHint.d.ts.map +1 -1
  109. package/dist/es6/form-field/lib/FormFieldHint.js +4 -5
  110. package/dist/es6/form-field/lib/FormFieldInput.d.ts +1 -1
  111. package/dist/es6/form-field/lib/FormFieldLabel.d.ts.map +1 -1
  112. package/dist/es6/form-field/lib/FormFieldLabel.js +5 -11
  113. package/dist/es6/index.d.ts +2 -1
  114. package/dist/es6/index.d.ts.map +1 -1
  115. package/dist/es6/index.js +2 -2
  116. package/dist/es6/menu/index.d.ts +1 -4
  117. package/dist/es6/menu/index.d.ts.map +1 -1
  118. package/dist/es6/menu/index.js +1 -4
  119. package/dist/es6/menu/lib/Menu.d.ts +37 -13
  120. package/dist/es6/menu/lib/Menu.d.ts.map +1 -1
  121. package/dist/es6/menu/lib/Menu.js +42 -22
  122. package/dist/es6/menu/lib/MenuItem.d.ts +35 -14
  123. package/dist/es6/menu/lib/MenuItem.d.ts.map +1 -1
  124. package/dist/es6/menu/lib/MenuItem.js +23 -9
  125. package/dist/es6/pill/lib/Pill.d.ts +6 -16
  126. package/dist/es6/pill/lib/Pill.d.ts.map +1 -1
  127. package/dist/es6/pill/lib/PillAvatar.d.ts +1 -2
  128. package/dist/es6/pill/lib/PillAvatar.d.ts.map +1 -1
  129. package/dist/es6/pill/lib/PillIcon.d.ts +1 -2
  130. package/dist/es6/pill/lib/PillIcon.d.ts.map +1 -1
  131. package/dist/es6/pill/lib/PillIconButton.d.ts +1 -2
  132. package/dist/es6/pill/lib/PillIconButton.d.ts.map +1 -1
  133. package/dist/es6/pill/lib/PillLabel.d.ts +1 -2
  134. package/dist/es6/pill/lib/PillLabel.d.ts.map +1 -1
  135. package/dist/es6/pill/lib/usePillModel.d.ts +5 -5
  136. package/dist/es6/segmented-control/index.d.ts +3 -0
  137. package/dist/es6/segmented-control/index.d.ts.map +1 -0
  138. package/dist/es6/segmented-control/index.js +2 -0
  139. package/dist/es6/segmented-control/lib/SegmentedControl.d.ts +1004 -0
  140. package/dist/es6/segmented-control/lib/SegmentedControl.d.ts.map +1 -0
  141. package/dist/es6/segmented-control/lib/SegmentedControl.js +16 -0
  142. package/dist/es6/segmented-control/lib/SegmentedControlItem.d.ts +103 -0
  143. package/dist/es6/segmented-control/lib/SegmentedControlItem.d.ts.map +1 -0
  144. package/dist/es6/segmented-control/lib/SegmentedControlItem.js +108 -0
  145. package/dist/es6/segmented-control/lib/SegmentedControlList.d.ts +66 -0
  146. package/dist/es6/segmented-control/lib/SegmentedControlList.d.ts.map +1 -0
  147. package/dist/es6/segmented-control/lib/SegmentedControlList.js +44 -0
  148. package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.d.ts +60 -0
  149. package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.d.ts.map +1 -0
  150. package/dist/es6/segmented-control/lib/hooks/useSegmentedControlItem.js +20 -0
  151. package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.d.ts +1052 -0
  152. package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.d.ts.map +1 -0
  153. package/dist/es6/segmented-control/lib/hooks/useSegmentedControlModel.js +68 -0
  154. package/dist/es6/select/index.d.ts +0 -3
  155. package/dist/es6/select/index.d.ts.map +1 -1
  156. package/dist/es6/select/index.js +0 -3
  157. package/dist/es6/select/lib/Select.d.ts +0 -1
  158. package/dist/es6/select/lib/Select.d.ts.map +1 -1
  159. package/dist/es6/select/lib/Select.js +1 -2
  160. package/dist/es6/select/lib/SelectBase.d.ts +2 -2
  161. package/dist/es6/select/lib/SelectBase.d.ts.map +1 -1
  162. package/dist/es6/select/lib/SelectBase.js +3 -4
  163. package/dist/es6/select/lib/SelectMenu.d.ts +2 -2
  164. package/dist/es6/select/lib/SelectMenu.d.ts.map +1 -1
  165. package/dist/es6/select/lib/SelectMenu.js +1 -2
  166. package/dist/es6/select/lib/SelectOption.d.ts +1 -2
  167. package/dist/es6/select/lib/SelectOption.d.ts.map +1 -1
  168. package/dist/es6/select/lib/SelectOption.js +1 -2
  169. package/dist/es6/side-panel/index.d.ts +0 -3
  170. package/dist/es6/side-panel/index.d.ts.map +1 -1
  171. package/dist/es6/side-panel/index.js +0 -3
  172. package/dist/es6/side-panel/lib/SidePanel.d.ts +1 -2
  173. package/dist/es6/side-panel/lib/SidePanel.d.ts.map +1 -1
  174. package/dist/es6/side-panel/lib/SidePanel.js +1 -2
  175. package/dist/es6/status-indicator/index.d.ts +2 -0
  176. package/dist/es6/status-indicator/index.d.ts.map +1 -0
  177. package/dist/es6/status-indicator/index.js +1 -0
  178. package/dist/es6/status-indicator/lib/StatusIndicator.d.ts +42 -0
  179. package/dist/es6/status-indicator/lib/StatusIndicator.d.ts.map +1 -0
  180. package/dist/es6/status-indicator/lib/StatusIndicator.js +49 -0
  181. package/dist/es6/status-indicator/lib/StatusIndicatorIcon.d.ts +73 -0
  182. package/dist/es6/status-indicator/lib/StatusIndicatorIcon.d.ts.map +1 -0
  183. package/dist/es6/status-indicator/lib/StatusIndicatorIcon.js +92 -0
  184. package/dist/es6/status-indicator/lib/StatusIndicatorLabel.d.ts +5 -0
  185. package/dist/es6/status-indicator/lib/StatusIndicatorLabel.d.ts.map +1 -0
  186. package/dist/es6/{breadcrumbs/lib/Breadcrumbs/List/index.js → status-indicator/lib/StatusIndicatorLabel.js} +5 -5
  187. package/dist/es6/status-indicator/lib/hooks/index.d.ts +2 -0
  188. package/dist/es6/status-indicator/lib/hooks/index.d.ts.map +1 -0
  189. package/dist/es6/status-indicator/lib/hooks/index.js +1 -0
  190. package/dist/es6/status-indicator/lib/hooks/useStatusIndicatorModel.d.ts +75 -0
  191. package/dist/es6/status-indicator/lib/hooks/useStatusIndicatorModel.d.ts.map +1 -0
  192. package/dist/es6/status-indicator/lib/hooks/useStatusIndicatorModel.js +31 -0
  193. package/dist/es6/text-area/lib/TextArea.d.ts +2 -11
  194. package/dist/es6/text-area/lib/TextArea.d.ts.map +1 -1
  195. package/dist/es6/text-area/lib/TextAreaField.d.ts +1 -1
  196. package/dist/es6/text-area/lib/TextAreaField.d.ts.map +1 -1
  197. package/dist/es6/text-area/lib/TextAreaField.js +15 -7
  198. package/dist/es6/text-input/lib/TextInput.d.ts +2 -11
  199. package/dist/es6/text-input/lib/TextInput.d.ts.map +1 -1
  200. package/dist/es6/text-input/lib/TextInputField.d.ts +1 -1
  201. package/dist/es6/text-input/lib/TextInputField.d.ts.map +1 -1
  202. package/dist/es6/text-input/lib/TextInputField.js +14 -7
  203. package/form-field/lib/FormFieldHint.tsx +23 -30
  204. package/form-field/lib/FormFieldLabel.tsx +14 -24
  205. package/index.ts +2 -3
  206. package/menu/index.ts +1 -6
  207. package/menu/lib/Menu.tsx +74 -27
  208. package/menu/lib/MenuItem.tsx +51 -18
  209. package/package.json +7 -6
  210. package/segmented-control/LICENSE +126 -0
  211. package/segmented-control/README.md +6 -0
  212. package/segmented-control/index.ts +2 -0
  213. package/segmented-control/lib/SegmentedControl.tsx +21 -0
  214. package/segmented-control/lib/SegmentedControlItem.tsx +175 -0
  215. package/segmented-control/lib/SegmentedControlList.tsx +49 -0
  216. package/segmented-control/lib/hooks/useSegmentedControlItem.tsx +37 -0
  217. package/segmented-control/lib/hooks/useSegmentedControlModel.tsx +75 -0
  218. package/segmented-control/package.json +6 -0
  219. package/select/README.md +7 -7
  220. package/select/index.ts +0 -4
  221. package/select/lib/Select.tsx +1 -3
  222. package/select/lib/SelectBase.tsx +3 -5
  223. package/select/lib/SelectMenu.tsx +1 -3
  224. package/select/lib/SelectOption.tsx +1 -3
  225. package/side-panel/index.ts +0 -4
  226. package/side-panel/lib/SidePanel.tsx +1 -2
  227. package/{breadcrumbs → status-indicator}/LICENSE +1 -1
  228. package/status-indicator/README.md +12 -0
  229. package/status-indicator/index.ts +1 -0
  230. package/status-indicator/lib/StatusIndicator.tsx +49 -0
  231. package/status-indicator/lib/StatusIndicatorIcon.tsx +88 -0
  232. package/status-indicator/lib/StatusIndicatorLabel.tsx +28 -0
  233. package/status-indicator/lib/hooks/index.ts +1 -0
  234. package/status-indicator/lib/hooks/useStatusIndicatorModel.tsx +29 -0
  235. package/status-indicator/package.json +6 -0
  236. package/text-area/lib/TextAreaField.tsx +1 -1
  237. package/text-input/lib/TextInputField.tsx +1 -1
  238. package/breadcrumbs/README.md +0 -7
  239. package/breadcrumbs/index.ts +0 -5
  240. package/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.tsx +0 -85
  241. package/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.tsx +0 -152
  242. package/breadcrumbs/lib/Breadcrumbs/Dropdown/MenuItemLink.tsx +0 -63
  243. package/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.ts +0 -109
  244. package/breadcrumbs/lib/Breadcrumbs/Dropdown/index.tsx +0 -38
  245. package/breadcrumbs/lib/Breadcrumbs/List/Collapsible.tsx +0 -66
  246. package/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.tsx +0 -64
  247. package/breadcrumbs/lib/Breadcrumbs/List/Link.tsx +0 -88
  248. package/breadcrumbs/lib/Breadcrumbs/List/ListItem.tsx +0 -30
  249. package/breadcrumbs/lib/Breadcrumbs/List/hooks.ts +0 -114
  250. package/breadcrumbs/lib/Breadcrumbs/List/index.tsx +0 -28
  251. package/breadcrumbs/lib/Breadcrumbs/List/styles.ts +0 -12
  252. package/breadcrumbs/lib/Breadcrumbs/Nav.tsx +0 -14
  253. package/breadcrumbs/lib/Breadcrumbs/hooks.ts +0 -13
  254. package/breadcrumbs/lib/Breadcrumbs/index.tsx +0 -15
  255. package/breadcrumbs/lib/Breadcrumbs/types.ts +0 -7
  256. package/breadcrumbs/package.json +0 -6
  257. package/dist/commonjs/breadcrumbs/index.d.ts +0 -5
  258. package/dist/commonjs/breadcrumbs/index.d.ts.map +0 -1
  259. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.d.ts +0 -20
  260. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.d.ts.map +0 -1
  261. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.js +0 -69
  262. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.d.ts +0 -38
  263. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.d.ts.map +0 -1
  264. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.js +0 -94
  265. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/MenuItemLink.d.ts +0 -14
  266. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/MenuItemLink.d.ts.map +0 -1
  267. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.d.ts +0 -13
  268. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.d.ts.map +0 -1
  269. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.js +0 -77
  270. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/index.d.ts +0 -8
  271. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/index.d.ts.map +0 -1
  272. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/index.js +0 -37
  273. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/Collapsible.d.ts +0 -16
  274. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/Collapsible.d.ts.map +0 -1
  275. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/Collapsible.js +0 -78
  276. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.d.ts +0 -11
  277. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.d.ts.map +0 -1
  278. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.js +0 -49
  279. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/Link.d.ts +0 -19
  280. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/Link.d.ts.map +0 -1
  281. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/Link.js +0 -66
  282. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/ListItem.d.ts +0 -4
  283. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/ListItem.d.ts.map +0 -1
  284. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/ListItem.js +0 -43
  285. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/hooks.d.ts +0 -19
  286. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/hooks.d.ts.map +0 -1
  287. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/hooks.js +0 -116
  288. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/index.d.ts +0 -4
  289. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/index.d.ts.map +0 -1
  290. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/styles.d.ts +0 -3
  291. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/styles.d.ts.map +0 -1
  292. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/styles.js +0 -16
  293. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Nav.d.ts +0 -11
  294. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Nav.d.ts.map +0 -1
  295. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Nav.js +0 -34
  296. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/hooks.d.ts +0 -5
  297. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/hooks.d.ts.map +0 -1
  298. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/hooks.js +0 -12
  299. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/index.d.ts +0 -9
  300. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/index.d.ts.map +0 -1
  301. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/index.js +0 -17
  302. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/types.d.ts +0 -8
  303. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/types.d.ts.map +0 -1
  304. package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/types.js +0 -2
  305. package/dist/es6/breadcrumbs/index.d.ts +0 -5
  306. package/dist/es6/breadcrumbs/index.d.ts.map +0 -1
  307. package/dist/es6/breadcrumbs/index.js +0 -4
  308. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.d.ts +0 -20
  309. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.d.ts.map +0 -1
  310. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.js +0 -63
  311. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.d.ts +0 -38
  312. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.d.ts.map +0 -1
  313. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.js +0 -87
  314. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/MenuItemLink.d.ts +0 -14
  315. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/MenuItemLink.d.ts.map +0 -1
  316. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/MenuItemLink.js +0 -51
  317. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.d.ts +0 -13
  318. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.d.ts.map +0 -1
  319. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/hooks.js +0 -72
  320. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/index.d.ts +0 -8
  321. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/index.d.ts.map +0 -1
  322. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/index.js +0 -30
  323. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/Collapsible.d.ts +0 -16
  324. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/Collapsible.d.ts.map +0 -1
  325. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/Collapsible.js +0 -55
  326. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.d.ts +0 -11
  327. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.d.ts.map +0 -1
  328. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.js +0 -42
  329. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/Link.d.ts +0 -19
  330. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/Link.d.ts.map +0 -1
  331. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/Link.js +0 -59
  332. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/ListItem.d.ts +0 -4
  333. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/ListItem.d.ts.map +0 -1
  334. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/ListItem.js +0 -36
  335. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/hooks.d.ts +0 -19
  336. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/hooks.d.ts.map +0 -1
  337. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/hooks.js +0 -91
  338. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/index.d.ts +0 -4
  339. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/index.d.ts.map +0 -1
  340. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/styles.d.ts +0 -3
  341. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/styles.d.ts.map +0 -1
  342. package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/styles.js +0 -12
  343. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Nav.d.ts +0 -11
  344. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Nav.d.ts.map +0 -1
  345. package/dist/es6/breadcrumbs/lib/Breadcrumbs/Nav.js +0 -27
  346. package/dist/es6/breadcrumbs/lib/Breadcrumbs/hooks.d.ts +0 -5
  347. package/dist/es6/breadcrumbs/lib/Breadcrumbs/hooks.d.ts.map +0 -1
  348. package/dist/es6/breadcrumbs/lib/Breadcrumbs/hooks.js +0 -8
  349. package/dist/es6/breadcrumbs/lib/Breadcrumbs/index.d.ts +0 -9
  350. package/dist/es6/breadcrumbs/lib/Breadcrumbs/index.d.ts.map +0 -1
  351. package/dist/es6/breadcrumbs/lib/Breadcrumbs/index.js +0 -14
  352. package/dist/es6/breadcrumbs/lib/Breadcrumbs/types.d.ts +0 -8
  353. package/dist/es6/breadcrumbs/lib/Breadcrumbs/types.d.ts.map +0 -1
  354. package/dist/es6/breadcrumbs/lib/Breadcrumbs/types.js +0 -1
package/menu/lib/Menu.tsx CHANGED
@@ -1,23 +1,35 @@
1
1
  import * as React from 'react';
2
2
  import styled from '@emotion/styled';
3
3
 
4
- import {MenuItemProps} from './MenuItem';
4
+ import {DeprecatedMenuItemProps} 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
7
  import {hideMouseFocus, GrowthBehavior, generateUniqueId} from '@workday/canvas-kit-react/common';
8
8
 
9
- export interface MenuProps extends GrowthBehavior, React.HTMLAttributes<HTMLUListElement> {
9
+ /**
10
+ * ### Deprecated Menu
11
+ *
12
+ * As of Canvas Kit v8, Menu is being soft-deprecated.
13
+ * It will be hard-deprecated (completely removed) in v9. Please see the
14
+ * [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
15
+ * for more information.
16
+ */
17
+ export interface DeprecatedMenuProps
18
+ extends GrowthBehavior,
19
+ React.HTMLAttributes<HTMLUListElement> {
10
20
  /**
11
- * The MenuItem children of the Menu (must be at least one). Also accepts other components which share the same interface as `MenuItem`.
21
+ * The DeprecatedMenuItem children of the DeprecatedMenu (must be at least one). Also accepts other components which share the same interface as `DeprecatedMenuItem`.
12
22
  */
13
- children?: React.ReactElement<MenuItemProps> | React.ReactElement<MenuItemProps>[];
23
+ children?:
24
+ | React.ReactElement<DeprecatedMenuItemProps>
25
+ | React.ReactElement<DeprecatedMenuItemProps>[];
14
26
  /**
15
- * If true, set the Menu to the open state. Useful for showing and hiding the Menu from a parent component such as a menu button.
27
+ * If true, set the DeprecatedMenu to the open state. Useful for showing and hiding the DeprecatedMenu from a parent component such as a menu button.
16
28
  * @default true
17
29
  */
18
30
  isOpen?: boolean;
19
31
  /**
20
- * The width of the Menu. If no value is provided, the Menu will collapse around its content.
32
+ * The width of the DeprecatedMenu. If no value is provided, the DeprecatedMenu will collapse around its content.
21
33
  */
22
34
  width?: number | string;
23
35
  /**
@@ -25,7 +37,7 @@ export interface MenuProps extends GrowthBehavior, React.HTMLAttributes<HTMLULis
25
37
  */
26
38
  onSelect?: () => void;
27
39
  /**
28
- * The function called when the Menu should close. This is called after a menu item is selected or if the escape shortcut key is used. This will not fire if the menu item sets `shouldClose` to false.
40
+ * The function called when the DeprecatedMenu should close. This is called after a menu item is selected or if the escape shortcut key is used. This will not fire if the menu item sets `shouldClose` to false.
29
41
  */
30
42
  onClose?: () => void;
31
43
  /**
@@ -33,16 +45,24 @@ export interface MenuProps extends GrowthBehavior, React.HTMLAttributes<HTMLULis
33
45
  */
34
46
  initialSelectedItem?: number;
35
47
  /**
36
- * The unique id of the Menu used for ARIA and HTML `id` attributes.
48
+ * The unique id of the DeprecatedMenu used for ARIA and HTML `id` attributes.
37
49
  */
38
50
  id?: string;
39
51
  /**
40
- * The HTML `id` of the element that labels the Menu. Often used with menu buttons.
52
+ * The HTML `id` of the element that labels the DeprecatedMenu. Often used with menu buttons.
41
53
  */
42
54
  'aria-labelledby'?: string;
43
55
  }
44
56
 
45
- export interface MenuState {
57
+ /**
58
+ * ### Deprecated Menu State
59
+ *
60
+ * As of Canvas Kit v8, Menu is being soft-deprecated.
61
+ * It will be hard-deprecated (completely removed) in v9. Please see the
62
+ * [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
63
+ * for more information.
64
+ */
65
+ export interface DeprecatedMenuState {
46
66
  selectedItemIndex: number;
47
67
  }
48
68
 
@@ -57,14 +77,22 @@ const List = styled('ul')({
57
77
  ...hideMouseFocus,
58
78
  });
59
79
 
60
- export default class Menu extends React.Component<MenuProps, MenuState> {
80
+ /**
81
+ * ### Deprecated Menu
82
+ *
83
+ * As of Canvas Kit v8, this component is being soft-deprecated.
84
+ * It will be hard-deprecated (completely removed) in v9. Please see the
85
+ * [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
86
+ * for more information.
87
+ */
88
+ export class DeprecatedMenu extends React.Component<DeprecatedMenuProps, DeprecatedMenuState> {
61
89
  private id = generateUniqueId();
62
90
  private animateId!: number;
63
91
 
64
92
  private menuRef: React.RefObject<HTMLUListElement>;
65
93
  private firstCharacters!: string[];
66
94
 
67
- constructor(props: MenuProps) {
95
+ constructor(props: DeprecatedMenuProps) {
68
96
  super(props);
69
97
  this.menuRef = React.createRef();
70
98
 
@@ -79,7 +107,7 @@ export default class Menu extends React.Component<MenuProps, MenuState> {
79
107
  };
80
108
  }
81
109
 
82
- componentDidUpdate(prevProps: MenuProps) {
110
+ componentDidUpdate(prevProps: DeprecatedMenuProps) {
83
111
  if (this.props.children !== prevProps.children) {
84
112
  this.setFirstCharacters();
85
113
  this.setInitialSelectedItem();
@@ -95,6 +123,13 @@ export default class Menu extends React.Component<MenuProps, MenuState> {
95
123
  }
96
124
 
97
125
  componentDidMount() {
126
+ console.warn(
127
+ `This component is being deprecated and will be removed in Canvas Kit V9.\n
128
+ For more information, please see the V8 upgrade guide:\n
129
+ https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page
130
+ `
131
+ );
132
+
98
133
  this.setFirstCharacters();
99
134
  this.setInitialSelectedItem();
100
135
  }
@@ -119,6 +154,7 @@ export default class Menu extends React.Component<MenuProps, MenuState> {
119
154
  } = this.props;
120
155
  const {selectedItemIndex} = this.state;
121
156
  const cardWidth = grow ? '100%' : width;
157
+ let interactiveItemIndex: number | null = null;
122
158
 
123
159
  return (
124
160
  <Card display="inline-block" padding={space.zero} width={cardWidth} depth={3}>
@@ -133,17 +169,22 @@ export default class Menu extends React.Component<MenuProps, MenuState> {
133
169
  ref={this.menuRef}
134
170
  {...elemProps}
135
171
  >
136
- {React.Children.map(children, (menuItem, index) => {
172
+ {React.Children.map(children, menuItem => {
137
173
  if (!React.isValidElement(menuItem)) {
138
174
  return;
139
175
  }
140
- const itemId = `${id}-${index}`;
176
+ let itemId;
177
+ if (!menuItem.props.isHeader) {
178
+ interactiveItemIndex = (interactiveItemIndex ?? -1) + 1;
179
+ itemId = `${id}-${interactiveItemIndex}`;
180
+ }
141
181
  return (
142
182
  <React.Fragment key={itemId}>
143
183
  {React.cloneElement(menuItem, {
144
184
  onClick: (event: React.MouseEvent) => this.handleClick(event, menuItem.props),
145
185
  id: itemId,
146
- isFocused: selectedItemIndex === index,
186
+ isFocused:
187
+ selectedItemIndex === interactiveItemIndex && !menuItem.props.isHeader,
147
188
  })}
148
189
  </React.Fragment>
149
190
  );
@@ -175,9 +216,12 @@ export default class Menu extends React.Component<MenuProps, MenuState> {
175
216
  const children = React.Children.toArray(this.props.children);
176
217
  let nextSelectedIndex = 0;
177
218
  let isShortcut = false;
178
- const itemCount = children.length;
179
- const firstItem = 0;
180
- const lastItem = itemCount - 1;
219
+ const interactiveItems = children.filter(child => {
220
+ return !(child as React.ReactElement<DeprecatedMenuItemProps>)?.props?.isHeader;
221
+ });
222
+ const interactiveItemCount = interactiveItems.length;
223
+ const firstIndex = 0;
224
+ const lastIndex = interactiveItemCount - 1;
181
225
 
182
226
  if (event.key.length === 1 && event.key.match(/\S/)) {
183
227
  let start = this.state.selectedItemIndex + 1;
@@ -197,18 +241,16 @@ export default class Menu extends React.Component<MenuProps, MenuState> {
197
241
  switch (event.key) {
198
242
  case 'ArrowUp':
199
243
  case 'ArrowDown':
200
- case 'Down': // IE/Edge specific value
201
- case 'Up': // IE/Edge specific value
202
244
  const direction = event.key === 'ArrowUp' ? -1 : 1;
203
245
  isShortcut = true;
204
246
  const nextIndex = this.state.selectedItemIndex + direction;
205
247
  nextSelectedIndex =
206
- nextIndex < 0 ? lastItem : nextIndex >= itemCount ? firstItem : nextIndex;
248
+ nextIndex < 0 ? lastIndex : nextIndex >= interactiveItemCount ? firstIndex : nextIndex;
207
249
  break;
208
250
 
209
251
  case 'Home':
210
252
  case 'End':
211
- const skipTo = event.key === 'Home' ? firstItem : lastItem;
253
+ const skipTo = event.key === 'Home' ? firstIndex : lastIndex;
212
254
  isShortcut = true;
213
255
  nextSelectedIndex = skipTo;
214
256
  break;
@@ -231,7 +273,9 @@ export default class Menu extends React.Component<MenuProps, MenuState> {
231
273
  case ' ':
232
274
  case 'Enter':
233
275
  nextSelectedIndex = this.state.selectedItemIndex;
234
- const child = children[this.state.selectedItemIndex] as React.ReactElement<MenuItemProps>;
276
+ const child = interactiveItems[this.state.selectedItemIndex] as React.ReactElement<
277
+ DeprecatedMenuItemProps
278
+ >;
235
279
  this.handleClick(event, child.props);
236
280
  isShortcut = true;
237
281
  break;
@@ -248,11 +292,11 @@ export default class Menu extends React.Component<MenuProps, MenuState> {
248
292
 
249
293
  private handleClick = (
250
294
  event: React.MouseEvent | React.KeyboardEvent,
251
- menuItemProps: MenuItemProps
295
+ menuItemProps: DeprecatedMenuItemProps
252
296
  ): void => {
253
297
  /* istanbul ignore next line for coverage */
254
298
  if (menuItemProps.isDisabled) {
255
- // You should only hit this point if you are using a custom MenuItem implementation.
299
+ // You should only hit this point if you are using a custom DeprecatedMenuItem implementation.
256
300
  return;
257
301
  }
258
302
  if (menuItemProps.onClick) {
@@ -284,7 +328,7 @@ export default class Menu extends React.Component<MenuProps, MenuState> {
284
328
  private setFirstCharacters = (): void => {
285
329
  const getFirstCharacter = (child: React.ReactNode): string => {
286
330
  let character = '';
287
- if (!child || typeof child === 'boolean' || child === {}) {
331
+ if (!child || typeof child === 'boolean') {
288
332
  character = '';
289
333
  } else if (typeof child === 'string' || typeof child === 'number') {
290
334
  character = child
@@ -308,6 +352,9 @@ export default class Menu extends React.Component<MenuProps, MenuState> {
308
352
  };
309
353
 
310
354
  const firstCharacters = React.Children.map(this.props.children, child => {
355
+ if ((child as React.ReactElement<DeprecatedMenuItemProps>)?.props?.isHeader) {
356
+ return;
357
+ }
311
358
  return getFirstCharacter(child);
312
359
  });
313
360
 
@@ -11,51 +11,64 @@ import {
11
11
  import {CanvasSystemIcon} from '@workday/design-assets-types';
12
12
  import {SystemIcon, SystemIconProps} from '@workday/canvas-kit-react/icon';
13
13
 
14
- export interface MenuItemProps extends React.LiHTMLAttributes<HTMLLIElement> {
14
+ /**
15
+ * ### Deprecated Menu Item Props
16
+ *
17
+ * As of Canvas Kit v8, Menu is being soft-deprecated.
18
+ * It will be hard-deprecated (completely removed) in v9. Please see the
19
+ * [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
20
+ * for more information.
21
+ */
22
+ export interface DeprecatedMenuItemProps extends React.LiHTMLAttributes<HTMLLIElement> {
15
23
  /**
16
- * The function called when the MenuItem is clicked. If the item is a child of the Menu component, this callback will be decorated with the onSelect and onClose Menu callbacks. This callback will not fire if the item is disabled (see below).
24
+ * The function called when the DeprecatedMenuItem is clicked. If the item is a child of the DeprecatedMenu component, this callback will be decorated with the onSelect and onClose DeprecatedMenu callbacks. This callback will not fire if the item is disabled (see below).
17
25
  */
18
26
  onClick?: (event: React.MouseEvent) => void;
19
27
  /**
20
- * The unique id for the MenuItem used for ARIA attributes. If the item is a child of the `Menu` component, this property will be generated and overridden.
28
+ * The unique id for the DeprecatedMenuItem used for ARIA attributes. If the item is a child of the `DeprecatedMenu` component, this property will be generated and overridden.
21
29
  */
22
30
  id?: string;
23
31
  /**
24
- * The icon of the MenuItem. This icon is displayed before what you supplied for the children.
32
+ * The icon of the DeprecatedMenuItem. This icon is displayed before what you supplied for the children.
25
33
  */
26
34
  icon?: CanvasSystemIcon;
27
35
  /**
28
- * The secondary icon of the MenuItem. This icon is displayed after what you supplied for the children.
36
+ * The secondary icon of the DeprecatedMenuItem. This icon is displayed after what you supplied for the children.
29
37
  */
30
38
  secondaryIcon?: CanvasSystemIcon;
31
39
  /**
32
- * If true, render a top border on the MenuItem.
40
+ * If true, render a top border on the DeprecatedMenuItem.
33
41
  * @default false
34
42
  */
35
43
  hasDivider?: boolean;
36
44
  /**
37
- * If true, set the MenuItem to the disabled state so it is not clickable.
45
+ * If true, render a header to group data, this menu item will not be intractable.
46
+ * @default false
47
+ */
48
+ isHeader?: boolean;
49
+ /**
50
+ * If true, set the DeprecatedMenuItem to the disabled state so it is not clickable.
38
51
  * @default false
39
52
  */
40
53
  isDisabled?: boolean;
41
54
  /**
42
- * If true, set the MenuItem to be the currently selected item. If the item is a child of the Menu component, this property will be generated and overridden.
55
+ * If true, set the DeprecatedMenuItem to be the currently selected item. If the item is a child of the DeprecatedMenu component, this property will be generated and overridden.
43
56
  * @default false
44
57
  */
45
58
  isFocused?: boolean;
46
59
  /**
47
- * The role of the MenuItem. Use this to override the role of the item (e.g. you can use this element as an option in a Combobox).
60
+ * The role of the DeprecatedMenuItem. Use this to override the role of the item (e.g. you can use this element as an option in a Combobox).
48
61
  * @default menuItem
49
62
  */
50
63
  role?: string;
51
64
  /**
52
- * If true, allow the onClose Menu callback to be fired after the MenuItem has been clicked.
65
+ * If true, allow the onClose DeprecatedMenu callback to be fired after the DeprecatedMenuItem has been clicked.
53
66
  * @default true
54
67
  */
55
68
  shouldClose?: boolean;
56
69
  }
57
70
 
58
- const Item = styled('li')<Pick<MenuItemProps, 'isDisabled' | 'isFocused'>>(
71
+ const Item = styled('li')<Pick<DeprecatedMenuItemProps, 'isDisabled' | 'isFocused' | 'isHeader'>>(
59
72
  {
60
73
  ...type.levels.subtext.large,
61
74
  padding: `${space.xxs} ${space.s}`,
@@ -71,6 +84,9 @@ const Item = styled('li')<Pick<MenuItemProps, 'isDisabled' | 'isFocused'>>(
71
84
  outline: 'none',
72
85
  },
73
86
  },
87
+ ({isHeader}) => {
88
+ return {pointerEvents: isHeader ? 'none' : 'all'};
89
+ },
74
90
  ({isFocused, isDisabled}) => {
75
91
  if (!isFocused && !isDisabled) {
76
92
  return {
@@ -237,10 +253,27 @@ const scrollIntoViewIfNeeded = (elem: HTMLElement, centerIfNeeded = true): void
237
253
  }
238
254
  };
239
255
 
240
- class MenuItem extends React.Component<MenuItemProps> {
256
+ /**
257
+ * ### Deprecated Menu Item
258
+ *
259
+ * As of Canvas Kit v8, Menu is being soft-deprecated.
260
+ * It will be hard-deprecated (completely removed) in v9. Please see the
261
+ * [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
262
+ * for more information.
263
+ */
264
+ export class DeprecatedMenuItem extends React.Component<DeprecatedMenuItemProps> {
241
265
  ref = React.createRef<HTMLLIElement>();
242
266
 
243
- componentDidUpdate = (prevProps: MenuItemProps) => {
267
+ componentDidMount() {
268
+ console.warn(
269
+ `This component is being deprecated and will be removed in Canvas Kit V9.\n
270
+ For more information, please see the V8 upgrade guide:\n
271
+ https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page
272
+ `
273
+ );
274
+ }
275
+
276
+ componentDidUpdate = (prevProps: DeprecatedMenuItemProps) => {
244
277
  if (!prevProps.isFocused && this.props.isFocused) {
245
278
  if (this.ref.current) {
246
279
  scrollIntoViewIfNeeded(this.ref.current);
@@ -248,7 +281,7 @@ class MenuItem extends React.Component<MenuItemProps> {
248
281
  }
249
282
  };
250
283
 
251
- render(): React.ReactNode {
284
+ render() {
252
285
  const {
253
286
  onClick,
254
287
  children,
@@ -258,6 +291,7 @@ class MenuItem extends React.Component<MenuItemProps> {
258
291
  hasDivider,
259
292
  isDisabled,
260
293
  isFocused,
294
+ isHeader,
261
295
  role,
262
296
  ...elemProps
263
297
  } = this.props;
@@ -272,11 +306,12 @@ class MenuItem extends React.Component<MenuItemProps> {
272
306
  ref={this.ref}
273
307
  tabIndex={-1}
274
308
  id={id}
275
- role={role}
309
+ role={isHeader ? 'presentation' : role}
276
310
  onClick={this.handleClick}
277
311
  aria-disabled={isDisabled ? true : undefined}
278
312
  isDisabled={!!isDisabled}
279
313
  isFocused={!!isFocused}
314
+ isHeader={!!isHeader}
280
315
  {...elemProps}
281
316
  >
282
317
  {icon && iconProps && <StyledSystemIcon {...iconProps} />}
@@ -306,9 +341,7 @@ class MenuItem extends React.Component<MenuItemProps> {
306
341
  */
307
342
  // TODO: Remove this ts-ignore when we convert to a functional component
308
343
  // @ts-ignore
309
- MenuItem.defaultProps = {
344
+ DeprecatedMenuItem.defaultProps = {
310
345
  shouldClose: true,
311
346
  role: 'menuitem',
312
347
  };
313
-
314
- export default MenuItem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-preview-react",
3
- "version": "8.0.0",
3
+ "version": "8.0.2",
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",
@@ -41,20 +41,21 @@
41
41
  "workday"
42
42
  ],
43
43
  "peerDependencies": {
44
- "react": "^16.8 || ^17.0"
44
+ "react": "^17.0 || ^18.0"
45
45
  },
46
46
  "dependencies": {
47
47
  "@emotion/react": "^11.7.1",
48
48
  "@emotion/styled": "^11.6.0",
49
- "@workday/canvas-kit-react": "^8.0.0",
49
+ "@workday/canvas-kit-react": "^8.0.2",
50
50
  "@workday/canvas-system-icons-web": "^3.0.0",
51
51
  "@workday/design-assets-types": "^0.2.8"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@workday/canvas-accent-icons-web": "^3.0.0",
55
- "@workday/canvas-kit-labs-react": "^8.0.0",
55
+ "@workday/canvas-kit-labs-react": "^8.0.2",
56
56
  "formik": "^2.2.9",
57
- "yup": "^0.31.1"
57
+ "react-hook-form": "7.36.1",
58
+ "yup": "^0.32.11"
58
59
  },
59
- "gitHead": "433a9d272804ceed26191ac1ef629d61fab4dcb4"
60
+ "gitHead": "0f1b4cb0314b4ff02e2c81fdcc7986fac582ae9e"
60
61
  }
@@ -0,0 +1,126 @@
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. "License" shall mean the terms and conditions for use, reproduction, and
8
+ distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the
9
+ copyright owner or entity authorized by the copyright owner that is granting the License. "Legal
10
+ Entity" shall mean the union of the acting entity and all other entities that control, are
11
+ controlled by, or are under common control with that entity. For the purposes of this definition,
12
+ "control" means (i) the power, direct or indirect, to cause the direction or management of such
13
+ entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
14
+ outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an
15
+ individual or Legal Entity exercising permissions granted by this License. "Source" form shall
16
+ mean the preferred form for making modifications, including but not limited to software source
17
+ code, documentation source, and configuration files. "Object" form shall mean any form resulting
18
+ from mechanical transformation or translation of a Source form, including but not limited to
19
+ compiled object code, generated documentation, and conversions to other media types. "Work" shall
20
+ mean the work of authorship, whether in Source or Object form, made available under the License,
21
+ as indicated by a copyright notice that is included in or attached to the work (an example is
22
+ provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or
23
+ Object form, that is based on (or derived from) the Work and for which the editorial revisions,
24
+ annotations, elaborations, or other modifications represent, as a whole, an original work of
25
+ authorship. For the purposes of this License, Derivative Works shall not include works that
26
+ remain separable from, or merely link (or bind by name) to the interfaces of, the Work and
27
+ Derivative Works thereof. "Contribution" shall mean any work of authorship, including the
28
+ original version of the Work and any modifications or additions to that Work or Derivative Works
29
+ thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright
30
+ owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner.
31
+ For the purposes of this definition, "submitted" means any form of electronic, verbal, or written
32
+ communication sent to the Licensor or its representatives, including but not limited to
33
+ communication on electronic mailing lists, source code control systems, and issue tracking
34
+ systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and
35
+ improving the Work, but excluding communication that is conspicuously marked or otherwise
36
+ designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean
37
+ Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by
38
+ Licensor and subsequently incorporated within the Work.
39
+
40
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor
41
+ hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable
42
+ copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform,
43
+ sublicense, and distribute the Work and such Derivative Works in Source or Object form.
44
+
45
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor
46
+ hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable
47
+ (except as stated in this section) patent license to make, have made, use, offer to sell, sell,
48
+ import, and otherwise transfer the Work, where such license applies only to those patent claims
49
+ licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or
50
+ by combination of their Contribution(s) with the Work to which such Contribution(s) was
51
+ submitted. If You institute patent litigation against any entity (including a cross-claim or
52
+ counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work
53
+ constitutes direct or contributory patent infringement, then any patent licenses granted to You
54
+ under this License for that Work shall terminate as of the date such litigation is filed.
55
+
56
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof
57
+ in any medium, with or without modifications, and in Source or Object form, provided that You
58
+ meet the following conditions: You must give any other recipients of the Work or Derivative Works
59
+ a copy of this License; and You must cause any modified files to carry prominent notices stating
60
+ that You changed the files; and You must retain, in the Source form of any Derivative Works that
61
+ You distribute, all copyright, patent, trademark, and attribution notices from the Source form of
62
+ the Work, excluding those notices that do not pertain to any part of the Derivative Works; and If
63
+ the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works
64
+ that You distribute must include a readable copy of the attribution notices contained within such
65
+ NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in
66
+ at least one of the following places: within a NOTICE text file distributed as part of the
67
+ Derivative Works; within the Source form or documentation, if provided along with the Derivative
68
+ Works; or, within a display generated by the Derivative Works, if and wherever such third-party
69
+ notices normally appear. The contents of the NOTICE file are for informational purposes only and
70
+ do not modify the License. You may add Your own attribution notices within Derivative Works that
71
+ You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such
72
+ additional attribution notices cannot be construed as modifying the License. You may add Your own
73
+ copyright statement to Your modifications and may provide additional or different license terms
74
+ and conditions for use, reproduction, or distribution of Your modifications, or for any such
75
+ Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work
76
+ otherwise complies with the conditions stated in this License.
77
+
78
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution
79
+ intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms
80
+ and conditions of this License, without any additional terms or conditions. Notwithstanding the
81
+ above, nothing herein shall supersede or modify the terms of any separate license agreement you
82
+ may have executed with Licensor regarding such Contributions.
83
+
84
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service
85
+ marks, or product names of the Licensor, except as required for reasonable and customary use in
86
+ describing the origin of the Work and reproducing the content of the NOTICE file.
87
+
88
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor
89
+ provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT
90
+ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation,
91
+ any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
92
+ PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or
93
+ redistributing the Work and assume any risks associated with Your exercise of permissions under
94
+ this License.
95
+
96
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including
97
+ negligence), contract, or otherwise, unless required by applicable law (such as deliberate and
98
+ grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for
99
+ damages, including any direct, indirect, special, incidental, or consequential damages of any
100
+ character arising as a result of this License or out of the use or inability to use the Work
101
+ (including but not limited to damages for loss of goodwill, work stoppage, computer failure or
102
+ malfunction, or any and all other commercial damages or losses), even if such Contributor has
103
+ been advised of the possibility of such damages.
104
+
105
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works
106
+ thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty,
107
+ indemnity, or other liability obligations and/or rights consistent with this License. However, in
108
+ accepting such obligations, You may act only on Your own behalf and on Your sole responsibility,
109
+ not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each
110
+ Contributor harmless for any liability incurred by, or claims asserted against, such Contributor
111
+ by reason of your accepting any such warranty or additional liability.
112
+
113
+ END OF TERMS AND CONDITIONS
114
+
115
+ ©2022 Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of
116
+ Workday, Inc. All other brand and product names are trademarks or registered trademarks of their
117
+ respective holders.
118
+
119
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
120
+ compliance with the License. You may obtain a copy of the License at
121
+ http://www.apache.org/licenses/LICENSE-2.0
122
+
123
+ Unless required by applicable law or agreed to in writing, software distributed under the License is
124
+ distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
125
+ implied. See the License for the specific language governing permissions and limitations under the
126
+ License.
@@ -0,0 +1,6 @@
1
+ # Canvas Kit React Segmented Control
2
+
3
+ `SegmentedControl` contains primary and secondary actions related to a page or task.
4
+
5
+ For more detailed information on this component, please refer to the
6
+ [storybook documentation](https://workday.github.io/canvas-kit/?path=/docs/preview-segmented-control-react--basic)
@@ -0,0 +1,2 @@
1
+ export * from './lib/SegmentedControl';
2
+ export * from './lib/hooks/useSegmentedControlModel';
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import {createContainer} from '@workday/canvas-kit-react/common';
3
+
4
+ import {useSegmentedControlModel} from './hooks/useSegmentedControlModel';
5
+ import {SegmentedControlList} from './SegmentedControlList';
6
+ import {SegmentedControlItem} from './SegmentedControlItem';
7
+
8
+ export interface SegmentedControlProps {
9
+ children: React.ReactNode;
10
+ }
11
+
12
+ export const SegmentedControl = createContainer()({
13
+ displayName: 'SegmentedControl',
14
+ modelHook: useSegmentedControlModel,
15
+ subComponents: {
16
+ List: SegmentedControlList,
17
+ Item: SegmentedControlItem,
18
+ },
19
+ })<SegmentedControlProps>(({children}) => {
20
+ return <>{children}</>;
21
+ });