@workday/canvas-kit-react 7.0.0-alpha.0-next.7 → 7.0.0-alpha.78-next.6

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 (321) hide show
  1. package/badge/README.md +2 -3
  2. package/banner/lib/BannerIcon.tsx +2 -2
  3. package/button/README.md +68 -1
  4. package/button/index.ts +1 -1
  5. package/button/lib/{parts/ButtonContainer.tsx → BaseButton.tsx} +123 -66
  6. package/button/lib/DeleteButton.tsx +7 -4
  7. package/button/lib/PrimaryButton.tsx +86 -109
  8. package/button/lib/SecondaryButton.tsx +44 -66
  9. package/button/lib/TertiaryButton.tsx +86 -53
  10. package/button/lib/ToolbarDropdownButton.tsx +12 -11
  11. package/button/lib/ToolbarIconButton.tsx +22 -17
  12. package/button/lib/parts/ButtonLabel.tsx +17 -2
  13. package/button/lib/parts/ButtonLabelIcon.tsx +30 -54
  14. package/button/lib/parts/index.tsx +0 -2
  15. package/button/lib/types.ts +2 -2
  16. package/common/lib/parts/_brand-assets.ts +5 -5
  17. package/common/lib/utils/StaticStates.tsx +6 -5
  18. package/dist/commonjs/banner/lib/BannerIcon.js +2 -2
  19. package/dist/commonjs/button/index.d.ts +1 -1
  20. package/dist/commonjs/button/index.d.ts.map +1 -1
  21. package/dist/commonjs/button/index.js +3 -3
  22. package/dist/commonjs/button/lib/BaseButton.d.ts +31 -0
  23. package/dist/commonjs/button/lib/BaseButton.d.ts.map +1 -0
  24. package/dist/commonjs/button/lib/BaseButton.js +198 -0
  25. package/dist/commonjs/button/lib/DeleteButton.d.ts.map +1 -1
  26. package/dist/commonjs/button/lib/DeleteButton.js +4 -3
  27. package/dist/commonjs/button/lib/PrimaryButton.d.ts +4 -76
  28. package/dist/commonjs/button/lib/PrimaryButton.d.ts.map +1 -1
  29. package/dist/commonjs/button/lib/PrimaryButton.js +15 -36
  30. package/dist/commonjs/button/lib/SecondaryButton.d.ts +0 -5
  31. package/dist/commonjs/button/lib/SecondaryButton.d.ts.map +1 -1
  32. package/dist/commonjs/button/lib/SecondaryButton.js +16 -38
  33. package/dist/commonjs/button/lib/TertiaryButton.d.ts +2 -2
  34. package/dist/commonjs/button/lib/TertiaryButton.d.ts.map +1 -1
  35. package/dist/commonjs/button/lib/TertiaryButton.js +66 -38
  36. package/dist/commonjs/button/lib/ToolbarDropdownButton.d.ts.map +1 -1
  37. package/dist/commonjs/button/lib/ToolbarDropdownButton.js +7 -7
  38. package/dist/commonjs/button/lib/ToolbarIconButton.d.ts +5 -2
  39. package/dist/commonjs/button/lib/ToolbarIconButton.d.ts.map +1 -1
  40. package/dist/commonjs/button/lib/ToolbarIconButton.js +5 -11
  41. package/dist/commonjs/button/lib/parts/ButtonLabel.d.ts +4 -4
  42. package/dist/commonjs/button/lib/parts/ButtonLabel.d.ts.map +1 -1
  43. package/dist/commonjs/button/lib/parts/ButtonLabel.js +35 -1
  44. package/dist/commonjs/button/lib/parts/ButtonLabelIcon.d.ts +4 -3
  45. package/dist/commonjs/button/lib/parts/ButtonLabelIcon.d.ts.map +1 -1
  46. package/dist/commonjs/button/lib/parts/ButtonLabelIcon.js +13 -62
  47. package/dist/commonjs/button/lib/parts/index.d.ts +0 -2
  48. package/dist/commonjs/button/lib/parts/index.d.ts.map +1 -1
  49. package/dist/commonjs/button/lib/parts/index.js +1 -5
  50. package/dist/commonjs/button/lib/types.d.ts +2 -2
  51. package/dist/commonjs/button/lib/types.d.ts.map +1 -1
  52. package/dist/commonjs/common/lib/parts/_brand-assets.d.ts.map +1 -1
  53. package/dist/commonjs/common/lib/parts/_brand-assets.js +5 -5
  54. package/dist/commonjs/common/lib/utils/StaticStates.d.ts.map +1 -1
  55. package/dist/commonjs/common/lib/utils/StaticStates.js +5 -2
  56. package/dist/commonjs/icon/lib/AccentIcon.d.ts +3 -5
  57. package/dist/commonjs/icon/lib/AccentIcon.d.ts.map +1 -1
  58. package/dist/commonjs/icon/lib/AccentIcon.js +8 -24
  59. package/dist/commonjs/icon/lib/AppletIcon.d.ts +5 -6
  60. package/dist/commonjs/icon/lib/AppletIcon.d.ts.map +1 -1
  61. package/dist/commonjs/icon/lib/AppletIcon.js +13 -27
  62. package/dist/commonjs/icon/lib/Graphic.d.ts +3 -5
  63. package/dist/commonjs/icon/lib/Graphic.d.ts.map +1 -1
  64. package/dist/commonjs/icon/lib/Graphic.js +8 -24
  65. package/dist/commonjs/icon/lib/Icon.d.ts +2 -5
  66. package/dist/commonjs/icon/lib/Icon.d.ts.map +1 -1
  67. package/dist/commonjs/icon/lib/Icon.js +10 -25
  68. package/dist/commonjs/icon/lib/Svg.d.ts +4 -6
  69. package/dist/commonjs/icon/lib/Svg.d.ts.map +1 -1
  70. package/dist/commonjs/icon/lib/Svg.js +11 -27
  71. package/dist/commonjs/icon/lib/SystemIcon.d.ts +5 -6
  72. package/dist/commonjs/icon/lib/SystemIcon.d.ts.map +1 -1
  73. package/dist/commonjs/icon/lib/SystemIcon.js +8 -24
  74. package/dist/commonjs/icon/lib/SystemIconCircle.d.ts +3 -6
  75. package/dist/commonjs/icon/lib/SystemIconCircle.d.ts.map +1 -1
  76. package/dist/commonjs/icon/lib/SystemIconCircle.js +7 -25
  77. package/dist/commonjs/layout/lib/Box.d.ts +17 -0
  78. package/dist/commonjs/layout/lib/Box.d.ts.map +1 -1
  79. package/dist/commonjs/layout/lib/Box.js +41 -1
  80. package/dist/commonjs/modal/lib/ModalOverflowOverlay.js +1 -1
  81. package/dist/commonjs/pagination/lib/Pagination/Controls.d.ts +2 -2
  82. package/dist/commonjs/pagination/lib/Pagination/Controls.d.ts.map +1 -1
  83. package/dist/commonjs/pagination/lib/Pagination/Controls.js +4 -4
  84. package/dist/commonjs/pagination/lib/Pagination/PageButton.d.ts +1 -2
  85. package/dist/commonjs/pagination/lib/Pagination/PageButton.d.ts.map +1 -1
  86. package/dist/commonjs/pagination/lib/Pagination/PageButton.js +34 -9
  87. package/dist/commonjs/pagination/lib/Pagination/Pagination.d.ts +5 -5
  88. package/dist/commonjs/pagination/lib/Pagination/Pagination.d.ts.map +1 -1
  89. package/dist/commonjs/popup/lib/PopupCloseIcon.d.ts +2 -2
  90. package/dist/commonjs/popup/lib/PopupCloseIcon.d.ts.map +1 -1
  91. package/dist/commonjs/popup/lib/PopupCloseIcon.js +5 -6
  92. package/dist/commonjs/popup/lib/hooks/useDisableBodyScroll.d.ts.map +1 -1
  93. package/dist/commonjs/popup/lib/hooks/useDisableBodyScroll.js +4 -0
  94. package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts +9 -7
  95. package/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts.map +1 -1
  96. package/dist/commonjs/segmented-control/lib/SegmentedControl.js +21 -57
  97. package/dist/commonjs/segmented-control/lib/SegmentedControlButton.d.ts +8 -0
  98. package/dist/commonjs/segmented-control/lib/SegmentedControlButton.d.ts.map +1 -0
  99. package/dist/commonjs/segmented-control/lib/SegmentedControlButton.js +106 -0
  100. package/dist/commonjs/side-panel/lib/SidePanel.d.ts.map +1 -1
  101. package/dist/commonjs/side-panel/lib/SidePanel.js +2 -2
  102. package/dist/commonjs/tabs/lib/Tabs.d.ts +2 -2
  103. package/dist/commonjs/tabs/lib/TabsItem.d.ts +1 -2
  104. package/dist/commonjs/tabs/lib/TabsItem.d.ts.map +1 -1
  105. package/dist/commonjs/tabs/lib/TabsList.js +1 -1
  106. package/dist/commonjs/tabs/lib/menu/Menu.d.ts +1 -1
  107. package/dist/commonjs/tabs/lib/menu/MenuItem.d.ts +1 -2
  108. package/dist/commonjs/tabs/lib/menu/MenuItem.d.ts.map +1 -1
  109. package/dist/commonjs/text-input/lib/InputIconContainer.d.ts +1 -1
  110. package/dist/commonjs/text-input/lib/InputIconContainer.d.ts.map +1 -1
  111. package/dist/commonjs/tooltip/lib/Tooltip.d.ts +1 -1
  112. package/dist/commonjs/tooltip/lib/useTooltip.d.ts +1 -1
  113. package/dist/es6/banner/lib/BannerIcon.js +2 -2
  114. package/dist/es6/button/index.d.ts +1 -1
  115. package/dist/es6/button/index.d.ts.map +1 -1
  116. package/dist/es6/button/index.js +1 -1
  117. package/dist/es6/button/lib/BaseButton.d.ts +31 -0
  118. package/dist/es6/button/lib/BaseButton.d.ts.map +1 -0
  119. package/dist/es6/button/lib/BaseButton.js +174 -0
  120. package/dist/es6/button/lib/DeleteButton.d.ts.map +1 -1
  121. package/dist/es6/button/lib/DeleteButton.js +4 -3
  122. package/dist/es6/button/lib/PrimaryButton.d.ts +4 -76
  123. package/dist/es6/button/lib/PrimaryButton.d.ts.map +1 -1
  124. package/dist/es6/button/lib/PrimaryButton.js +15 -35
  125. package/dist/es6/button/lib/SecondaryButton.d.ts +0 -5
  126. package/dist/es6/button/lib/SecondaryButton.d.ts.map +1 -1
  127. package/dist/es6/button/lib/SecondaryButton.js +16 -38
  128. package/dist/es6/button/lib/TertiaryButton.d.ts +2 -2
  129. package/dist/es6/button/lib/TertiaryButton.d.ts.map +1 -1
  130. package/dist/es6/button/lib/TertiaryButton.js +68 -40
  131. package/dist/es6/button/lib/ToolbarDropdownButton.d.ts.map +1 -1
  132. package/dist/es6/button/lib/ToolbarDropdownButton.js +8 -8
  133. package/dist/es6/button/lib/ToolbarIconButton.d.ts +5 -2
  134. package/dist/es6/button/lib/ToolbarIconButton.d.ts.map +1 -1
  135. package/dist/es6/button/lib/ToolbarIconButton.js +7 -13
  136. package/dist/es6/button/lib/parts/ButtonLabel.d.ts +4 -4
  137. package/dist/es6/button/lib/parts/ButtonLabel.d.ts.map +1 -1
  138. package/dist/es6/button/lib/parts/ButtonLabel.js +33 -2
  139. package/dist/es6/button/lib/parts/ButtonLabelIcon.d.ts +4 -3
  140. package/dist/es6/button/lib/parts/ButtonLabelIcon.d.ts.map +1 -1
  141. package/dist/es6/button/lib/parts/ButtonLabelIcon.js +13 -42
  142. package/dist/es6/button/lib/parts/index.d.ts +0 -2
  143. package/dist/es6/button/lib/parts/index.d.ts.map +1 -1
  144. package/dist/es6/button/lib/parts/index.js +0 -2
  145. package/dist/es6/button/lib/types.d.ts +2 -2
  146. package/dist/es6/button/lib/types.d.ts.map +1 -1
  147. package/dist/es6/common/lib/parts/_brand-assets.d.ts.map +1 -1
  148. package/dist/es6/common/lib/parts/_brand-assets.js +5 -5
  149. package/dist/es6/common/lib/utils/StaticStates.d.ts.map +1 -1
  150. package/dist/es6/common/lib/utils/StaticStates.js +5 -2
  151. package/dist/es6/icon/lib/AccentIcon.d.ts +3 -5
  152. package/dist/es6/icon/lib/AccentIcon.d.ts.map +1 -1
  153. package/dist/es6/icon/lib/AccentIcon.js +8 -24
  154. package/dist/es6/icon/lib/AppletIcon.d.ts +5 -6
  155. package/dist/es6/icon/lib/AppletIcon.d.ts.map +1 -1
  156. package/dist/es6/icon/lib/AppletIcon.js +11 -25
  157. package/dist/es6/icon/lib/Graphic.d.ts +3 -5
  158. package/dist/es6/icon/lib/Graphic.d.ts.map +1 -1
  159. package/dist/es6/icon/lib/Graphic.js +8 -24
  160. package/dist/es6/icon/lib/Icon.d.ts +2 -5
  161. package/dist/es6/icon/lib/Icon.d.ts.map +1 -1
  162. package/dist/es6/icon/lib/Icon.js +8 -24
  163. package/dist/es6/icon/lib/Svg.d.ts +4 -6
  164. package/dist/es6/icon/lib/Svg.d.ts.map +1 -1
  165. package/dist/es6/icon/lib/Svg.js +10 -27
  166. package/dist/es6/icon/lib/SystemIcon.d.ts +5 -6
  167. package/dist/es6/icon/lib/SystemIcon.d.ts.map +1 -1
  168. package/dist/es6/icon/lib/SystemIcon.js +8 -24
  169. package/dist/es6/icon/lib/SystemIconCircle.d.ts +3 -6
  170. package/dist/es6/icon/lib/SystemIconCircle.d.ts.map +1 -1
  171. package/dist/es6/icon/lib/SystemIconCircle.js +8 -26
  172. package/dist/es6/layout/lib/Box.d.ts +17 -0
  173. package/dist/es6/layout/lib/Box.d.ts.map +1 -1
  174. package/dist/es6/layout/lib/Box.js +39 -0
  175. package/dist/es6/modal/lib/ModalOverflowOverlay.js +1 -1
  176. package/dist/es6/pagination/lib/Pagination/Controls.d.ts +2 -2
  177. package/dist/es6/pagination/lib/Pagination/Controls.d.ts.map +1 -1
  178. package/dist/es6/pagination/lib/Pagination/Controls.js +5 -5
  179. package/dist/es6/pagination/lib/Pagination/PageButton.d.ts +1 -2
  180. package/dist/es6/pagination/lib/Pagination/PageButton.d.ts.map +1 -1
  181. package/dist/es6/pagination/lib/Pagination/PageButton.js +35 -10
  182. package/dist/es6/pagination/lib/Pagination/Pagination.d.ts +5 -5
  183. package/dist/es6/pagination/lib/Pagination/Pagination.d.ts.map +1 -1
  184. package/dist/es6/popup/lib/PopupCloseIcon.d.ts +2 -2
  185. package/dist/es6/popup/lib/PopupCloseIcon.d.ts.map +1 -1
  186. package/dist/es6/popup/lib/PopupCloseIcon.js +6 -7
  187. package/dist/es6/popup/lib/hooks/useDisableBodyScroll.d.ts.map +1 -1
  188. package/dist/es6/popup/lib/hooks/useDisableBodyScroll.js +4 -0
  189. package/dist/es6/segmented-control/lib/SegmentedControl.d.ts +9 -7
  190. package/dist/es6/segmented-control/lib/SegmentedControl.d.ts.map +1 -1
  191. package/dist/es6/segmented-control/lib/SegmentedControl.js +20 -57
  192. package/dist/es6/segmented-control/lib/SegmentedControlButton.d.ts +8 -0
  193. package/dist/es6/segmented-control/lib/SegmentedControlButton.d.ts.map +1 -0
  194. package/dist/es6/segmented-control/lib/SegmentedControlButton.js +100 -0
  195. package/dist/es6/side-panel/lib/SidePanel.d.ts.map +1 -1
  196. package/dist/es6/side-panel/lib/SidePanel.js +3 -3
  197. package/dist/es6/tabs/lib/Tabs.d.ts +2 -2
  198. package/dist/es6/tabs/lib/TabsItem.d.ts +1 -2
  199. package/dist/es6/tabs/lib/TabsItem.d.ts.map +1 -1
  200. package/dist/es6/tabs/lib/TabsList.js +1 -1
  201. package/dist/es6/tabs/lib/menu/Menu.d.ts +1 -1
  202. package/dist/es6/tabs/lib/menu/MenuItem.d.ts +1 -2
  203. package/dist/es6/tabs/lib/menu/MenuItem.d.ts.map +1 -1
  204. package/dist/es6/text-input/lib/InputIconContainer.d.ts +1 -1
  205. package/dist/es6/text-input/lib/InputIconContainer.d.ts.map +1 -1
  206. package/dist/es6/tooltip/lib/Tooltip.d.ts +1 -1
  207. package/dist/es6/tooltip/lib/useTooltip.d.ts +1 -1
  208. package/icon/README.md +0 -30
  209. package/icon/lib/AccentIcon.tsx +17 -16
  210. package/icon/lib/AppletIcon.tsx +18 -12
  211. package/icon/lib/Graphic.tsx +15 -8
  212. package/icon/lib/Icon.tsx +10 -8
  213. package/icon/lib/Svg.tsx +12 -14
  214. package/icon/lib/SystemIcon.tsx +21 -12
  215. package/icon/lib/SystemIconCircle.tsx +17 -14
  216. package/layout/lib/Box.tsx +40 -0
  217. package/modal/lib/ModalOverflowOverlay.tsx +1 -1
  218. package/package.json +5 -5
  219. package/pagination/lib/Pagination/Controls.tsx +6 -10
  220. package/pagination/lib/Pagination/PageButton.tsx +38 -17
  221. package/pagination/lib/Pagination/Pagination.tsx +5 -5
  222. package/popup/lib/PopupCloseIcon.tsx +7 -8
  223. package/popup/lib/hooks/useDisableBodyScroll.ts +6 -0
  224. package/segmented-control/README.md +8 -9
  225. package/segmented-control/lib/SegmentedControl.tsx +39 -78
  226. package/segmented-control/lib/SegmentedControlButton.tsx +109 -0
  227. package/side-panel/README.md +3 -3
  228. package/side-panel/lib/SidePanel.tsx +4 -5
  229. package/tabs/lib/TabsList.tsx +1 -1
  230. package/text-input/lib/InputIconContainer.tsx +1 -1
  231. package/tooltip/README.md +6 -5
  232. package/tooltip/lib/Tooltip.tsx +1 -1
  233. package/tooltip/lib/useTooltip.tsx +1 -1
  234. package/ts3.5/dist/commonjs/button/index.d.ts +1 -1
  235. package/ts3.5/dist/commonjs/button/lib/BaseButton.d.ts +31 -0
  236. package/ts3.5/dist/commonjs/button/lib/PrimaryButton.d.ts +4 -76
  237. package/ts3.5/dist/commonjs/button/lib/SecondaryButton.d.ts +0 -5
  238. package/ts3.5/dist/commonjs/button/lib/TertiaryButton.d.ts +2 -2
  239. package/ts3.5/dist/commonjs/button/lib/ToolbarIconButton.d.ts +5 -2
  240. package/ts3.5/dist/commonjs/button/lib/parts/ButtonLabel.d.ts +4 -4
  241. package/ts3.5/dist/commonjs/button/lib/parts/ButtonLabelIcon.d.ts +4 -3
  242. package/ts3.5/dist/commonjs/button/lib/parts/index.d.ts +0 -2
  243. package/ts3.5/dist/commonjs/button/lib/types.d.ts +2 -2
  244. package/ts3.5/dist/commonjs/icon/lib/AccentIcon.d.ts +3 -5
  245. package/ts3.5/dist/commonjs/icon/lib/AppletIcon.d.ts +5 -6
  246. package/ts3.5/dist/commonjs/icon/lib/Graphic.d.ts +3 -5
  247. package/ts3.5/dist/commonjs/icon/lib/Icon.d.ts +2 -5
  248. package/ts3.5/dist/commonjs/icon/lib/Svg.d.ts +4 -6
  249. package/ts3.5/dist/commonjs/icon/lib/SystemIcon.d.ts +5 -6
  250. package/ts3.5/dist/commonjs/icon/lib/SystemIconCircle.d.ts +3 -6
  251. package/ts3.5/dist/commonjs/layout/lib/Box.d.ts +17 -0
  252. package/ts3.5/dist/commonjs/pagination/lib/Pagination/Controls.d.ts +2 -2
  253. package/ts3.5/dist/commonjs/pagination/lib/Pagination/PageButton.d.ts +1 -2
  254. package/ts3.5/dist/commonjs/pagination/lib/Pagination/Pagination.d.ts +5 -5
  255. package/ts3.5/dist/commonjs/popup/lib/PopupCloseIcon.d.ts +2 -2
  256. package/ts3.5/dist/commonjs/segmented-control/lib/SegmentedControl.d.ts +9 -7
  257. package/ts3.5/dist/commonjs/segmented-control/lib/SegmentedControlButton.d.ts +8 -0
  258. package/ts3.5/dist/commonjs/tabs/lib/Tabs.d.ts +2 -2
  259. package/ts3.5/dist/commonjs/tabs/lib/TabsItem.d.ts +1 -2
  260. package/ts3.5/dist/commonjs/tabs/lib/menu/Menu.d.ts +1 -1
  261. package/ts3.5/dist/commonjs/tabs/lib/menu/MenuItem.d.ts +1 -2
  262. package/ts3.5/dist/commonjs/text-input/lib/InputIconContainer.d.ts +1 -1
  263. package/ts3.5/dist/commonjs/tooltip/lib/Tooltip.d.ts +1 -1
  264. package/ts3.5/dist/commonjs/tooltip/lib/useTooltip.d.ts +1 -1
  265. package/ts3.5/dist/es6/button/index.d.ts +1 -1
  266. package/ts3.5/dist/es6/button/lib/BaseButton.d.ts +31 -0
  267. package/ts3.5/dist/es6/button/lib/PrimaryButton.d.ts +4 -76
  268. package/ts3.5/dist/es6/button/lib/SecondaryButton.d.ts +0 -5
  269. package/ts3.5/dist/es6/button/lib/TertiaryButton.d.ts +2 -2
  270. package/ts3.5/dist/es6/button/lib/ToolbarIconButton.d.ts +5 -2
  271. package/ts3.5/dist/es6/button/lib/parts/ButtonLabel.d.ts +4 -4
  272. package/ts3.5/dist/es6/button/lib/parts/ButtonLabelIcon.d.ts +4 -3
  273. package/ts3.5/dist/es6/button/lib/parts/index.d.ts +0 -2
  274. package/ts3.5/dist/es6/button/lib/types.d.ts +2 -2
  275. package/ts3.5/dist/es6/icon/lib/AccentIcon.d.ts +3 -5
  276. package/ts3.5/dist/es6/icon/lib/AppletIcon.d.ts +5 -6
  277. package/ts3.5/dist/es6/icon/lib/Graphic.d.ts +3 -5
  278. package/ts3.5/dist/es6/icon/lib/Icon.d.ts +2 -5
  279. package/ts3.5/dist/es6/icon/lib/Svg.d.ts +4 -6
  280. package/ts3.5/dist/es6/icon/lib/SystemIcon.d.ts +5 -6
  281. package/ts3.5/dist/es6/icon/lib/SystemIconCircle.d.ts +3 -6
  282. package/ts3.5/dist/es6/layout/lib/Box.d.ts +17 -0
  283. package/ts3.5/dist/es6/pagination/lib/Pagination/Controls.d.ts +2 -2
  284. package/ts3.5/dist/es6/pagination/lib/Pagination/PageButton.d.ts +1 -2
  285. package/ts3.5/dist/es6/pagination/lib/Pagination/Pagination.d.ts +5 -5
  286. package/ts3.5/dist/es6/popup/lib/PopupCloseIcon.d.ts +2 -2
  287. package/ts3.5/dist/es6/segmented-control/lib/SegmentedControl.d.ts +9 -7
  288. package/ts3.5/dist/es6/segmented-control/lib/SegmentedControlButton.d.ts +8 -0
  289. package/ts3.5/dist/es6/tabs/lib/Tabs.d.ts +2 -2
  290. package/ts3.5/dist/es6/tabs/lib/TabsItem.d.ts +1 -2
  291. package/ts3.5/dist/es6/tabs/lib/menu/Menu.d.ts +1 -1
  292. package/ts3.5/dist/es6/tabs/lib/menu/MenuItem.d.ts +1 -2
  293. package/ts3.5/dist/es6/text-input/lib/InputIconContainer.d.ts +1 -1
  294. package/ts3.5/dist/es6/tooltip/lib/Tooltip.d.ts +1 -1
  295. package/ts3.5/dist/es6/tooltip/lib/useTooltip.d.ts +1 -1
  296. package/button/lib/IconButton.tsx +0 -279
  297. package/button/lib/parts/ButtonLabelData.tsx +0 -16
  298. package/dist/commonjs/button/lib/IconButton.d.ts +0 -44
  299. package/dist/commonjs/button/lib/IconButton.d.ts.map +0 -1
  300. package/dist/commonjs/button/lib/IconButton.js +0 -219
  301. package/dist/commonjs/button/lib/parts/ButtonContainer.d.ts +0 -33
  302. package/dist/commonjs/button/lib/parts/ButtonContainer.d.ts.map +0 -1
  303. package/dist/commonjs/button/lib/parts/ButtonContainer.js +0 -126
  304. package/dist/commonjs/button/lib/parts/ButtonLabelData.d.ts +0 -3
  305. package/dist/commonjs/button/lib/parts/ButtonLabelData.d.ts.map +0 -1
  306. package/dist/commonjs/button/lib/parts/ButtonLabelData.js +0 -45
  307. package/dist/es6/button/lib/IconButton.d.ts +0 -44
  308. package/dist/es6/button/lib/IconButton.d.ts.map +0 -1
  309. package/dist/es6/button/lib/IconButton.js +0 -197
  310. package/dist/es6/button/lib/parts/ButtonContainer.d.ts +0 -33
  311. package/dist/es6/button/lib/parts/ButtonContainer.d.ts.map +0 -1
  312. package/dist/es6/button/lib/parts/ButtonContainer.js +0 -120
  313. package/dist/es6/button/lib/parts/ButtonLabelData.d.ts +0 -3
  314. package/dist/es6/button/lib/parts/ButtonLabelData.d.ts.map +0 -1
  315. package/dist/es6/button/lib/parts/ButtonLabelData.js +0 -22
  316. package/ts3.5/dist/commonjs/button/lib/IconButton.d.ts +0 -44
  317. package/ts3.5/dist/commonjs/button/lib/parts/ButtonContainer.d.ts +0 -33
  318. package/ts3.5/dist/commonjs/button/lib/parts/ButtonLabelData.d.ts +0 -3
  319. package/ts3.5/dist/es6/button/lib/IconButton.d.ts +0 -44
  320. package/ts3.5/dist/es6/button/lib/parts/ButtonContainer.d.ts +0 -33
  321. package/ts3.5/dist/es6/button/lib/parts/ButtonLabelData.d.ts +0 -3
package/badge/README.md CHANGED
@@ -32,15 +32,14 @@ const AccessibleHide = styled('div')({
32
32
 
33
33
  ...
34
34
 
35
- <IconButton
35
+ <TertiaryButton
36
36
  style={{ position: "relative" }}
37
37
  aria-label={`Alerts ${count} new notifications`}
38
38
  size="medium"
39
- variant="circle"
40
39
  >
41
40
  <SystemIcon icon={notificationsIcon} aria-hidden="true" />
42
41
  <Badge count={count} aria-hidden="true" />
43
- </IconButton>
42
+ </TertiaryButton>
44
43
  <AccessibleHide role="status" aria-live="polite" aria-atomic="true">
45
44
  New notifications
46
45
  </AccessibleHide>
@@ -32,8 +32,8 @@ export const BannerIcon = createComponent('span')({
32
32
  const localModel = useModelContext(BannerModelContext, model);
33
33
 
34
34
  // SystemIcon is still a class based component so we need to set ref manually.
35
- const {ref: iconRef, icon: defaultIcon, ...props} = useBannerIcon(localModel, elemProps, ref);
35
+ const {icon: defaultIcon, ...props} = useBannerIcon(localModel, elemProps);
36
36
 
37
- return <StyledBannerIcon icon={icon ?? defaultIcon} iconRef={iconRef} {...props} />;
37
+ return <StyledBannerIcon icon={icon ?? defaultIcon} ref={ref} {...props} />;
38
38
  },
39
39
  });
package/button/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Clickable button elements that extend the native `<button>` element with Canvas styling.
4
4
 
5
- For `PrimaryButton`, `SecondaryButton`, `TertiaryButton`, `DeleteButton`, or `IconButton`, view the
5
+ For `PrimaryButton`, `SecondaryButton`, `TertiaryButton` or `DeleteButton`, view the
6
6
  [documentation on Storybook](https://workday.github.io/canvas-kit/?path=/docs/components-buttons-button-react--primary).
7
7
 
8
8
  [> Workday Design Reference](https://design.workday.com/components/buttons/buttons)
@@ -182,6 +182,73 @@ Default: `false`
182
182
 
183
183
  ---
184
184
 
185
+ # BaseButton
186
+
187
+ As part of the restructure of our Buttons, we've created a low level `BaseButton` component. This
188
+ component isn't intended to be used outside of Canvas Kit, but we do export it for very specific use
189
+ cases which we'll outline below. The `BaseButton` is a styled `button` element which extends our
190
+ style properties which allow us to customize a buttons `colors`, `padding`, `width` and other style
191
+ properties.
192
+
193
+ Basic example:
194
+
195
+ ```tsx
196
+ import * as React from 'react';
197
+ import {colors} from '@workday/canvas-kit-react/tokens';
198
+ import {BaseButton} from '@workday/canvas-kit-react/button';
199
+ import {plusIcon} from '@workday/canvas-system-icons-web';
200
+
201
+ const getBasicButtonColors = () => {
202
+ return {
203
+ default: {
204
+ background: colors.blueberry400,
205
+ label: colors.frenchVanilla100,
206
+ icon: colors.frenchVanilla100,
207
+ },
208
+ hover: {
209
+ background: colors.blueberry500,
210
+ label: colors.frenchVanilla100,
211
+ icon: colors.frenchVanilla100,
212
+ },
213
+ active: {
214
+ background: colors.blueberry500,
215
+ label: colors.frenchVanilla100,
216
+ icon: colors.frenchVanilla100,
217
+ },
218
+ focus: {
219
+ background: colors.blueberry400,
220
+ label: colors.frenchVanilla100,
221
+ icon: colors.frenchVanilla100,
222
+ },
223
+ disabled: {
224
+ background: colors.blueberry400,
225
+ },
226
+ };
227
+ };
228
+
229
+ export type BasicButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {};
230
+
231
+ export const BasicButton = ({children, ...elemProps}: BasicButtonProps) => {
232
+ return (
233
+ <BaseButton
234
+ colors={getPaginationButtonColors(toggled)}
235
+ {...elemProps}
236
+ >
237
+ <BaseButton.Label>{children}</BaseButton.Label>
238
+ <BaseButton.Icon icon={plusIcon}>
239
+ </StyledToggleButton>
240
+ );
241
+ };
242
+ ```
243
+
244
+ **Note:** Under the hood, `BaseButton` uses our `Box` component which allows `BaseButton` to accept
245
+ style properties. Because of the flexibility of this component, consumers can use this to create
246
+ toggled buttons or a specific button that doesn't fall under the main use case you see in our design
247
+ system.
248
+
249
+ **Disclaimer** We strongly advise consumers not to use this component if possible and to rely on our
250
+ `PrimaryButton`, `SecondaryButton` and `TertiaryButton` when possible.
251
+
185
252
  ### Deprecated Buttons
186
253
 
187
254
  > We have rolled out our next iteration of our buttons and will be deprecating the old style (orange
package/button/index.ts CHANGED
@@ -6,8 +6,8 @@ export {
6
6
  DeprecatedButton as deprecated_Button,
7
7
  DeprecatedButtonProps,
8
8
  } from './lib/deprecated_Button';
9
- export {IconButton, IconButtonProps} from './lib/IconButton';
10
9
  export {ToolbarIconButton, ToolbarIconButtonProps} from './lib/ToolbarIconButton';
11
10
  export {ToolbarDropdownButton, ToolbarDropdownButtonProps} from './lib/ToolbarDropdownButton';
12
11
  export {Hyperlink, HyperlinkProps} from './lib/Hyperlink';
12
+ export {BaseButton, ButtonContainerProps} from './lib/BaseButton';
13
13
  export * from './lib/types';
@@ -1,20 +1,26 @@
1
1
  import * as React from 'react';
2
- import isPropValid from '@emotion/is-prop-valid';
3
- import {CSSObject} from '@emotion/styled';
4
- import {borderRadius, space, spaceNumbers, type} from '@workday/canvas-kit-react/tokens';
2
+
3
+ import {ButtonLabelIcon} from './parts/ButtonLabelIcon';
4
+ import {ButtonLabel} from './parts/ButtonLabel';
5
+
5
6
  import {
7
+ createComponent,
6
8
  GrowthBehavior,
7
9
  mouseFocusBehavior,
8
10
  focusRing,
9
11
  styled,
10
12
  EmotionCanvasTheme,
13
+ StyledType,
11
14
  } from '@workday/canvas-kit-react/common';
12
- import {ButtonColors, ButtonSizes} from '../types';
13
- import {buttonLabelDataClassName} from './ButtonLabelData';
15
+ import {BoxProps, boxStyleFn} from '@workday/canvas-kit-react/layout';
16
+ import {borderRadius, space, spaceNumbers, type} from '@workday/canvas-kit-react/tokens';
17
+
18
+ import {ButtonColors, ButtonSizes, IconPositions, TertiaryButtonSizes} from './types';
14
19
 
15
- export interface ButtonContainerProps
16
- extends React.ButtonHTMLAttributes<HTMLButtonElement>,
17
- GrowthBehavior {
20
+ import {CSSObject} from '@emotion/styled';
21
+ import {CanvasSystemIcon} from '@workday/design-assets-types';
22
+
23
+ export interface ButtonContainerProps extends BoxProps, GrowthBehavior {
18
24
  colors?: ButtonColors;
19
25
  /**
20
26
  * There are four button sizes: `extraSmall`, `small`, `medium`, and `large`.
@@ -29,14 +35,9 @@ export interface ButtonContainerProps
29
35
  ref?: React.Ref<HTMLButtonElement>;
30
36
  /**
31
37
  * Whether the icon should received filled (colored background layer) or regular styles.
32
- * Corresponds to `toggled` in IconButton
38
+ * Corresponds to `toggled` in ToolbarIconButton
33
39
  */
34
40
  fillIcon?: boolean;
35
- /**
36
- * Any extra styles necessary for a given parent component.
37
- * This avoids using the inline `style` attribute when the shape needs to be customized (e.g. for IconButton)
38
- */
39
- extraStyles?: CSSObject;
40
41
  }
41
42
 
42
43
  function getIconColorSelectors(
@@ -67,40 +68,39 @@ function getIconColorSelectors(
67
68
  };
68
69
  }
69
70
 
70
- export const ButtonContainer = styled('button', {
71
- shouldForwardProp: prop => isPropValid(prop) && prop !== 'size',
72
- })<ButtonContainerProps>(
71
+ const ButtonContainer = styled('button')<StyledType & ButtonContainerProps>(
73
72
  {
74
73
  ...type.levels.subtext.large,
75
- fontWeight: type.properties.fontWeights.bold,
76
- lineHeight: 'normal',
77
- boxSizing: 'border-box',
74
+ cursor: 'pointer',
78
75
  display: 'inline-flex',
79
76
  alignItems: 'center',
80
77
  justifyContent: 'center',
81
- background: 'none',
82
- borderRadius: borderRadius.circle,
78
+ boxSizing: 'border-box',
83
79
  boxShadow: 'none',
84
- position: 'relative',
85
- cursor: 'pointer',
86
80
  outline: 'none',
87
- verticalAlign: 'middle',
88
- border: '1px solid transparent',
89
- overflow: 'hidden',
81
+ fontWeight: type.properties.fontWeights.bold,
82
+ lineHeight: 'normal',
90
83
  whiteSpace: 'nowrap',
91
84
  WebkitFontSmoothing: 'antialiased',
92
85
  MozOsxFontSmoothing: 'grayscale',
93
-
86
+ borderRadius: borderRadius.circle,
87
+ position: 'relative',
88
+ verticalAlign: 'middle',
89
+ overflow: 'hidden',
90
+ border: '1px solid transparent',
91
+ background: 'transparent',
94
92
  transition:
95
93
  'box-shadow 120ms linear, border 120ms linear, background-color 120ms linear, color 120ms linear',
94
+ '&:disabled, &:disabled:active': {
95
+ cursor: 'default',
96
+ boxShadow: 'none',
97
+ opacity: 0.4,
98
+ },
96
99
 
97
- // Makes the "down" state of the button happens faster than the hover state, so it animates in correctly.
98
100
  '&:hover:active': {transitionDuration: '40ms'},
99
101
 
100
- '&:disabled, &:disabled:active': {cursor: 'default', boxShadow: 'none'},
101
-
102
102
  '& > *:first-of-type': {
103
- marginLeft: 0,
103
+ marginLeft: '0',
104
104
  },
105
105
 
106
106
  '& > *:last-of-type': {
@@ -113,9 +113,7 @@ export const ButtonContainer = styled('button', {
113
113
  return {
114
114
  ...type.levels.body.small,
115
115
  fontWeight: type.properties.fontWeights.bold,
116
- minWidth: '112px',
117
116
  height: '48px',
118
- padding: `0 ${space.l}`,
119
117
  '& > * ': {
120
118
  margin: `0 ${spaceNumbers.xxs / 2}px`,
121
119
  },
@@ -123,18 +121,14 @@ export const ButtonContainer = styled('button', {
123
121
  case 'medium':
124
122
  default:
125
123
  return {
126
- minWidth: '96px',
127
124
  height: space.xl,
128
- padding: `0 ${space.m}`,
129
125
  '& > * ': {
130
126
  margin: `0 ${spaceNumbers.xxs / 2}px`,
131
127
  },
132
128
  };
133
129
  case 'small':
134
130
  return {
135
- minWidth: '80px',
136
131
  height: space.l,
137
- padding: `0 ${space.s}`,
138
132
  '& > * ': {
139
133
  margin: `0 ${spaceNumbers.xxxs / 2}px`,
140
134
  },
@@ -144,7 +138,6 @@ export const ButtonContainer = styled('button', {
144
138
  ...type.levels.subtext.medium,
145
139
  fontWeight: type.properties.fontWeights.bold,
146
140
  height: space.m,
147
- padding: `0 ${space.xs}`,
148
141
  '& > * ': {
149
142
  margin: `0 ${spaceNumbers.xxxs / 2}px`,
150
143
  },
@@ -156,6 +149,7 @@ export const ButtonContainer = styled('button', {
156
149
  if (!colors) {
157
150
  return;
158
151
  }
152
+
159
153
  const baseStyles = {
160
154
  backgroundColor: colors.default.background,
161
155
  borderColor: colors.default.border,
@@ -166,11 +160,6 @@ export const ButtonContainer = styled('button', {
166
160
  },
167
161
  ...getIconColorSelectors(theme, colors.default.icon, fillIcon),
168
162
  }),
169
- ...(colors.default.labelData && {
170
- ['.' + buttonLabelDataClassName]: {
171
- color: colors.default.labelData,
172
- },
173
- }),
174
163
  };
175
164
 
176
165
  const hoverStyles = {
@@ -178,12 +167,6 @@ export const ButtonContainer = styled('button', {
178
167
  backgroundColor: colors.hover.background,
179
168
  borderColor: colors.hover.border,
180
169
  color: colors.hover.label,
181
- ...(colors.hover.labelData && {
182
- ['.' + buttonLabelDataClassName]: {
183
- transition: 'color 120ms ease-in',
184
- color: colors.hover.labelData,
185
- },
186
- }),
187
170
  ...(colors.hover.icon && getIconColorSelectors(theme, colors.hover.icon, fillIcon)),
188
171
  },
189
172
  };
@@ -193,11 +176,6 @@ export const ButtonContainer = styled('button', {
193
176
  backgroundColor: colors.active.background,
194
177
  borderColor: colors.active.border,
195
178
  color: colors.active.label,
196
- ...(colors.active.labelData && {
197
- ['.' + buttonLabelDataClassName]: {
198
- color: colors.active.labelData,
199
- },
200
- }),
201
179
  ...(colors.active.icon && getIconColorSelectors(theme, colors.active.icon, fillIcon)),
202
180
  },
203
181
  };
@@ -209,11 +187,6 @@ export const ButtonContainer = styled('button', {
209
187
  borderColor: colors.focus.border,
210
188
  color: colors.focus.label,
211
189
  ...(colors.focus.focusRing || focusRing({separation: 2}, theme)),
212
- ...(colors.focus.labelData && {
213
- ['.' + buttonLabelDataClassName]: {
214
- color: colors.focus.labelData,
215
- },
216
- }),
217
190
  ...(colors.focus.icon && getIconColorSelectors(theme, colors.focus.icon, fillIcon)),
218
191
  },
219
192
 
@@ -223,12 +196,8 @@ export const ButtonContainer = styled('button', {
223
196
  backgroundColor: colors.disabled.background,
224
197
  borderColor: colors.disabled.border,
225
198
  color: colors.disabled.label,
199
+ opacity: colors.disabled.opacity,
226
200
  ...(colors.disabled.icon && getIconColorSelectors(theme, colors.disabled.icon, fillIcon)),
227
- ...(colors.disabled.labelData && {
228
- ['.' + buttonLabelDataClassName]: {
229
- color: colors.disabled.labelData,
230
- },
231
- }),
232
201
  },
233
202
  ...mouseFocusBehavior({
234
203
  '&:focus': {
@@ -242,5 +211,93 @@ export const ButtonContainer = styled('button', {
242
211
  }),
243
212
  };
244
213
  },
245
- ({extraStyles}) => extraStyles
214
+ boxStyleFn
246
215
  );
216
+
217
+ export const getMinWidthStyles = (
218
+ children: React.ReactNode,
219
+ size: ButtonSizes | TertiaryButtonSizes
220
+ ) => {
221
+ switch (size) {
222
+ case 'large':
223
+ return children ? '112px' : '48px';
224
+ case 'medium':
225
+ return children ? '96px' : space.xl;
226
+ case 'small':
227
+ return children ? space.xxxl : space.l;
228
+ case 'extraSmall':
229
+ return children ? 'auto' : space.m;
230
+ default:
231
+ return children ? '96px' : space.xl;
232
+ }
233
+ };
234
+
235
+ export const getPaddingStyles = (
236
+ children: React.ReactNode,
237
+ size: ButtonSizes | TertiaryButtonSizes,
238
+ icon: CanvasSystemIcon | undefined,
239
+ iconPosition: IconPositions | undefined
240
+ ) => {
241
+ // In order to calculate the correct padding, we need to know its children
242
+ // and what side the icon is on and if there's an icon provided
243
+ if (!children) {
244
+ // icon buttons do not have any padding
245
+ return 0;
246
+ }
247
+ // If there are children AND an icon
248
+ // 1. We check what side the icon is in
249
+ // 2. Adjust padding to visually center the icon and text
250
+ // If there is children (most likely just text)
251
+ // 1. We keep the padding the same on both side
252
+ switch (size) {
253
+ case 'large':
254
+ return icon
255
+ ? iconPosition === 'start'
256
+ ? `0 ${space.l} 0 ${space.m}`
257
+ : `0 ${space.m} 0 ${space.l}`
258
+ : `0 ${space.l}`;
259
+
260
+ case 'medium':
261
+ return icon
262
+ ? iconPosition === 'start'
263
+ ? `0 ${space.m} 0 20px`
264
+ : `0 20px 0 ${space.m}`
265
+ : `0 ${space.m}`;
266
+
267
+ case 'small':
268
+ return icon
269
+ ? iconPosition === 'start'
270
+ ? `0 20px 0 ${space.s}`
271
+ : `0 ${space.s} 0 20px`
272
+ : `0 ${space.s}`;
273
+
274
+ case 'extraSmall':
275
+ return icon
276
+ ? iconPosition === 'start'
277
+ ? `0 ${space.xs} 0 ${space.xxs}`
278
+ : `0 ${space.xxs} 0 ${space.xs}`
279
+ : `0 ${space.xs}`;
280
+
281
+ default:
282
+ return icon
283
+ ? iconPosition === 'start'
284
+ ? `0 ${space.m} 0 20px`
285
+ : `0 20px 0 ${space.m}`
286
+ : `0 ${space.m}`;
287
+ }
288
+ };
289
+
290
+ export const BaseButton = createComponent('button')({
291
+ displayName: 'Button',
292
+ Component: ({children, ...elemProps}: ButtonContainerProps, ref, Element) => {
293
+ return (
294
+ <ButtonContainer as={Element} ref={ref} {...elemProps}>
295
+ {children}
296
+ </ButtonContainer>
297
+ );
298
+ },
299
+ subComponents: {
300
+ Icon: ButtonLabelIcon,
301
+ Label: ButtonLabel,
302
+ },
303
+ });
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import {ButtonColors} from './types';
3
- import {ButtonContainer, ButtonLabel} from './parts';
3
+ import {BaseButton, getMinWidthStyles, getPaddingStyles} from './BaseButton';
4
4
  import {
5
5
  GrowthBehavior,
6
6
  useTheme,
@@ -38,6 +38,7 @@ const getDeleteButtonColors = ({
38
38
  },
39
39
  disabled: {
40
40
  background: themeError.light,
41
+ opacity: '1', // allows for overriding the default opacity of 0.4
41
42
  },
42
43
  });
43
44
 
@@ -55,14 +56,16 @@ export const DeleteButton = createComponent('button')({
55
56
  ref,
56
57
  Element
57
58
  ) => (
58
- <ButtonContainer
59
+ <BaseButton
60
+ padding={getPaddingStyles(children, size, undefined, undefined)}
61
+ minWidth={getMinWidthStyles(children, size)}
59
62
  ref={ref}
60
63
  as={Element}
61
64
  colors={getDeleteButtonColors(theme)}
62
65
  size={size}
63
66
  {...elemProps}
64
67
  >
65
- <ButtonLabel>{children}</ButtonLabel>
66
- </ButtonContainer>
68
+ <BaseButton.Label>{children}</BaseButton.Label>
69
+ </BaseButton>
67
70
  ),
68
71
  });