@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
@@ -10,110 +10,10 @@ import {
10
10
  } from '@workday/canvas-kit-react/common';
11
11
  import {colors} from '@workday/canvas-kit-react/tokens';
12
12
  import {CanvasSystemIcon} from '@workday/design-assets-types';
13
-
14
- import {ButtonContainer, ButtonLabel, ButtonLabelData, ButtonLabelIcon} from './parts';
15
13
  import {ButtonSizes, IconPositions} from './types';
14
+ import {BaseButton, getMinWidthStyles, getPaddingStyles} from './BaseButton';
16
15
 
17
- export interface PrimaryButtonProps extends Themeable, GrowthBehavior {
18
- /**
19
- * The variant of the PrimaryButton.
20
- * @default undefined
21
- */
22
- variant?: 'inverse';
23
- /**
24
- * There are four button sizes: `extraSmall`, `small`, `medium`, and `large`.
25
- * If no size is provided, it will default to `medium`.
26
- *
27
- * @default 'medium'
28
- */
29
- size?: ButtonSizes;
30
- /**
31
- * The data label of the Button.
32
- * Note: not displayed at `small` size
33
- */
34
- dataLabel?: String;
35
- /**
36
- * The icon of the Button.
37
- * Note: not displayed at `small` size
38
- */
39
- icon?: CanvasSystemIcon;
40
- /**
41
- * Button icon positions can either be `left` or `right`.
42
- * If no value is provided, it defaults to `left`.
43
- * @default 'left'
44
- */
45
- iconPosition?: IconPositions;
46
- /**
47
- * If set to `true`, transform the icon's x-axis to mirror the graphic
48
- * @default false
49
- */
50
- shouldMirrorIcon?: boolean;
51
- children?: React.ReactNode;
52
- }
53
-
54
- // Button sizes where data labels are enabled
55
- const dataLabelSizes = ['medium', 'large'];
56
- // All disabled buttons are set to 40% opacity.
57
- // This will eventually live in the ButtonContainer styles, but for now we're scoping it to Primary, Secondary, and Tertiary buttons.
58
- const disabledButtonOpacity = {
59
- '&:disabled, &:disabled:active': {
60
- opacity: 0.4,
61
- },
62
- };
63
-
64
- export const PrimaryButton = createComponent('button')({
65
- displayName: 'PrimaryButton',
66
- Component: (
67
- {
68
- // TODO: Fix useTheme and make it a real hook
69
- // eslint-disable-next-line react-hooks/rules-of-hooks
70
- theme = useTheme(),
71
- size = 'medium',
72
- iconPosition = 'left',
73
- variant,
74
- dataLabel,
75
- icon,
76
- shouldMirrorIcon = false,
77
- children,
78
- ...elemProps
79
- }: PrimaryButtonProps,
80
- ref,
81
- Element
82
- ) => (
83
- <ButtonContainer
84
- ref={ref}
85
- as={Element}
86
- colors={getPrimaryButtonColors(variant, theme)}
87
- size={size}
88
- extraStyles={disabledButtonOpacity}
89
- {...elemProps}
90
- >
91
- {icon && iconPosition === 'left' && (
92
- <ButtonLabelIcon
93
- size={size}
94
- iconPosition={iconPosition}
95
- icon={icon}
96
- shouldMirrorIcon={shouldMirrorIcon}
97
- />
98
- )}
99
- <ButtonLabel>{children}</ButtonLabel>
100
- {dataLabel && dataLabelSizes.includes(size) && <ButtonLabelData>{dataLabel}</ButtonLabelData>}
101
- {icon && iconPosition === 'right' && (
102
- <ButtonLabelIcon
103
- size={size}
104
- iconPosition={iconPosition}
105
- icon={icon}
106
- shouldMirrorIcon={shouldMirrorIcon}
107
- />
108
- )}
109
- </ButtonContainer>
110
- ),
111
- });
112
-
113
- export const getPrimaryButtonColors = (
114
- variant: 'inverse' | undefined,
115
- theme: EmotionCanvasTheme
116
- ) => {
16
+ const getPrimaryButtonColors = (variant: 'inverse' | undefined, theme: EmotionCanvasTheme) => {
117
17
  const {
118
18
  canvas: {
119
19
  palette: {primary: themePrimary},
@@ -149,30 +49,27 @@ export const getPrimaryButtonColors = (
149
49
  background: colors.frenchVanilla100,
150
50
  icon: colors.blackPepper400,
151
51
  label: colors.blackPepper400,
152
- labelData: colors.blackPepper400,
153
52
  },
154
53
  hover: {
155
54
  background: colors.soap300,
156
55
  icon: colors.blackPepper500,
157
56
  label: colors.blackPepper500,
158
- labelData: colors.blackPepper500,
159
57
  },
160
58
  active: {
161
- background: colors.soap300,
59
+ background: colors.soap400,
162
60
  icon: colors.blackPepper500,
163
61
  label: colors.blackPepper500,
164
- labelData: colors.blackPepper500,
165
62
  },
166
63
  focus: {
167
64
  background: colors.frenchVanilla100,
168
65
  border: colors.blackPepper400,
169
66
  icon: colors.blackPepper400,
170
67
  label: colors.blackPepper400,
171
- labelData: colors.blackPepper400,
68
+
172
69
  focusRing: focusRing(
173
70
  {
174
71
  separation: 1,
175
- innerColor: colors.blackPepper500,
72
+ innerColor: colors.blackPepper400,
176
73
  outerColor: colors.frenchVanilla100,
177
74
  },
178
75
  theme
@@ -183,8 +80,88 @@ export const getPrimaryButtonColors = (
183
80
  background: colors.frenchVanilla100,
184
81
  icon: colors.blackPepper400,
185
82
  label: colors.blackPepper400,
186
- labelData: colors.blackPepper400,
187
83
  },
188
84
  };
189
85
  }
190
86
  };
87
+
88
+ export interface PrimaryButtonProps extends Themeable, GrowthBehavior {
89
+ /**
90
+ * The variant of the PrimaryButton.
91
+ * @default undefined
92
+ */
93
+ variant?: 'inverse';
94
+ /**
95
+ * There are four button sizes: `extraSmall`, `small`, `medium`, and `large`.
96
+ * If no size is provided, it will default to `medium`.
97
+ *
98
+ * @default 'medium'
99
+ */
100
+ size?: ButtonSizes;
101
+ /**
102
+ * The icon of the Button.
103
+ * Note: not displayed at `small` size
104
+ */
105
+ icon?: CanvasSystemIcon;
106
+ /**
107
+ * Button icon positions can either be `start` or `end`.
108
+ * If no value is provided, it defaults to `start`.
109
+ * @default 'start'
110
+ */
111
+ iconPosition?: IconPositions;
112
+ /**
113
+ * If set to `true`, transform the icon's x-axis to mirror the graphic
114
+ * @default false
115
+ */
116
+ shouldMirrorIcon?: boolean;
117
+ children?: React.ReactNode;
118
+ }
119
+
120
+ export const PrimaryButton = createComponent('button')({
121
+ displayName: 'PrimaryButton',
122
+ Component: (
123
+ {
124
+ size = 'medium',
125
+ iconPosition = 'start',
126
+ variant,
127
+ icon,
128
+ shouldMirrorIcon = false,
129
+ children,
130
+ ...elemProps
131
+ }: PrimaryButtonProps,
132
+ ref,
133
+ Element
134
+ ) => {
135
+ const theme = useTheme();
136
+ return (
137
+ <BaseButton
138
+ ref={ref}
139
+ size={size}
140
+ colors={getPrimaryButtonColors(variant, theme)}
141
+ padding={getPaddingStyles(children, size, icon, iconPosition)}
142
+ minWidth={getMinWidthStyles(children, size)}
143
+ as={Element}
144
+ {...elemProps}
145
+ >
146
+ {icon && iconPosition === 'start' && (
147
+ <BaseButton.Icon
148
+ size={size}
149
+ iconPosition={iconPosition}
150
+ icon={icon}
151
+ shouldMirrorIcon={shouldMirrorIcon}
152
+ />
153
+ )}
154
+ {children && <BaseButton.Label>{children}</BaseButton.Label>}
155
+
156
+ {icon && iconPosition === 'end' && (
157
+ <BaseButton.Icon
158
+ size={size}
159
+ iconPosition={iconPosition}
160
+ icon={icon}
161
+ shouldMirrorIcon={shouldMirrorIcon}
162
+ />
163
+ )}
164
+ </BaseButton>
165
+ );
166
+ },
167
+ });
@@ -11,7 +11,7 @@ import {
11
11
  } from '@workday/canvas-kit-react/common';
12
12
  import {CanvasSystemIcon} from '@workday/design-assets-types';
13
13
  import {ButtonColors, ButtonSizes, IconPositions} from './types';
14
- import {ButtonContainer, ButtonLabel, ButtonLabelData, ButtonLabelIcon} from './parts';
14
+ import {BaseButton, getMinWidthStyles, getPaddingStyles} from './BaseButton';
15
15
 
16
16
  export interface SecondaryButtonProps extends Themeable, GrowthBehavior {
17
17
  /**
@@ -26,11 +26,6 @@ export interface SecondaryButtonProps extends Themeable, GrowthBehavior {
26
26
  * @default 'medium'
27
27
  */
28
28
  size?: ButtonSizes;
29
- /**
30
- * The data label of the Button.
31
- * Note: not displayed at `small` size
32
- */
33
- dataLabel?: String;
34
29
  /**
35
30
  * The icon of the Button.
36
31
  * Note: not displayed at `small` size
@@ -50,27 +45,13 @@ export interface SecondaryButtonProps extends Themeable, GrowthBehavior {
50
45
  children?: React.ReactNode;
51
46
  }
52
47
 
53
- // Button sizes where data labels are enabled
54
- const dataLabelSizes = ['medium', 'large'];
55
- // All disabled buttons are set to 40% opacity.
56
- // This will eventually live in the ButtonContainer styles, but for now we're scoping it to Primary, Secondary, and Tertiary buttons.
57
- const disabledButtonOpacity = {
58
- '&:disabled, &:disabled:active': {
59
- opacity: 0.4,
60
- },
61
- };
62
-
63
48
  export const SecondaryButton = createComponent('button')({
64
49
  displayName: 'SecondaryButton',
65
50
  Component: (
66
51
  {
67
- // TODO: Fix useTheme and make it a real hook
68
- // eslint-disable-next-line react-hooks/rules-of-hooks
69
- theme = useTheme(),
70
52
  size = 'medium',
71
- iconPosition = 'left',
53
+ iconPosition = 'start',
72
54
  variant,
73
- dataLabel,
74
55
  icon,
75
56
  shouldMirrorIcon = false,
76
57
  children,
@@ -78,35 +59,39 @@ export const SecondaryButton = createComponent('button')({
78
59
  }: SecondaryButtonProps,
79
60
  ref,
80
61
  Element
81
- ) => (
82
- <ButtonContainer
83
- ref={ref}
84
- as={Element}
85
- colors={getSecondaryButtonColors(variant, theme)}
86
- size={size}
87
- extraStyles={disabledButtonOpacity}
88
- {...elemProps}
89
- >
90
- {icon && iconPosition === 'left' && (
91
- <ButtonLabelIcon
92
- size={size}
93
- iconPosition={iconPosition}
94
- icon={icon}
95
- shouldMirrorIcon={shouldMirrorIcon}
96
- />
97
- )}
98
- <ButtonLabel>{children}</ButtonLabel>
99
- {dataLabel && dataLabelSizes.includes(size) && <ButtonLabelData>{dataLabel}</ButtonLabelData>}
100
- {icon && iconPosition === 'right' && (
101
- <ButtonLabelIcon
102
- size={size}
103
- iconPosition={iconPosition}
104
- icon={icon}
105
- shouldMirrorIcon={shouldMirrorIcon}
106
- />
107
- )}
108
- </ButtonContainer>
109
- ),
62
+ ) => {
63
+ const theme = useTheme();
64
+
65
+ return (
66
+ <BaseButton
67
+ ref={ref}
68
+ size={size}
69
+ colors={getSecondaryButtonColors(variant, theme)}
70
+ padding={getPaddingStyles(children, size, icon, iconPosition)}
71
+ minWidth={getMinWidthStyles(children, size)}
72
+ as={Element}
73
+ {...elemProps}
74
+ >
75
+ {icon && iconPosition === 'start' && (
76
+ <BaseButton.Icon
77
+ size={size}
78
+ iconPosition={iconPosition}
79
+ icon={icon}
80
+ shouldMirrorIcon={shouldMirrorIcon}
81
+ />
82
+ )}
83
+ {children && <BaseButton.Label>{children}</BaseButton.Label>}
84
+ {icon && iconPosition === 'end' && (
85
+ <BaseButton.Icon
86
+ size={size}
87
+ iconPosition={iconPosition}
88
+ icon={icon}
89
+ shouldMirrorIcon={shouldMirrorIcon}
90
+ />
91
+ )}
92
+ </BaseButton>
93
+ );
94
+ },
110
95
  });
111
96
 
112
97
  export const getSecondaryButtonColors = (
@@ -128,27 +113,23 @@ export const getSecondaryButtonColors = (
128
113
  border: colors.blackPepper400,
129
114
  icon: colors.blackPepper400,
130
115
  label: colors.blackPepper400,
131
- labelData: colors.blackPepper400,
132
116
  },
133
117
  hover: {
134
118
  background: colors.blackPepper400,
135
119
  border: colors.blackPepper400,
136
120
  icon: themePrimary.contrast,
137
121
  label: themePrimary.contrast,
138
- labelData: themePrimary.contrast,
139
122
  },
140
123
  active: {
141
124
  background: colors.blackPepper500,
142
125
  border: colors.blackPepper500,
143
126
  icon: themePrimary.contrast,
144
127
  label: themePrimary.contrast,
145
- labelData: themePrimary.contrast,
146
128
  },
147
129
  focus: {
148
130
  border: colors.blackPepper400,
149
131
  icon: colors.blackPepper400,
150
132
  label: colors.blackPepper400,
151
- labelData: colors.blackPepper400,
152
133
  },
153
134
  // Identical to 'default' styles. ButtonContainer will set opacity to 40%
154
135
  disabled: {
@@ -156,7 +137,6 @@ export const getSecondaryButtonColors = (
156
137
  border: colors.blackPepper400,
157
138
  icon: colors.blackPepper400,
158
139
  label: colors.blackPepper400,
159
- labelData: colors.blackPepper400,
160
140
  },
161
141
  };
162
142
  case 'inverse':
@@ -170,26 +150,24 @@ export const getSecondaryButtonColors = (
170
150
  hover: {
171
151
  background: colors.soap300,
172
152
  border: colors.soap300,
173
- icon: colors.blackPepper400,
174
- label: colors.blackPepper400,
175
- labelData: colors.blackPepper400,
153
+ icon: colors.blackPepper500,
154
+ label: colors.blackPepper500,
176
155
  },
177
156
  active: {
178
157
  background: colors.soap400,
179
158
  border: colors.soap400,
180
- icon: colors.blackPepper400,
181
- label: colors.blackPepper400,
182
- labelData: colors.blackPepper400,
159
+ icon: colors.blackPepper500,
160
+ label: colors.blackPepper500,
183
161
  },
184
162
  focus: {
185
163
  background: colors.frenchVanilla100,
186
- icon: colors.blackPepper400,
187
- label: colors.blackPepper400,
188
- labelData: colors.blackPepper400,
164
+ icon: colors.blackPepper500,
165
+ border: colors.blackPepper400,
166
+ label: colors.blackPepper500,
189
167
  focusRing: focusRing(
190
168
  {
191
- separation: 2,
192
- innerColor: 'currentColor',
169
+ separation: 1,
170
+ innerColor: colors.blackPepper400,
193
171
  outerColor: colors.frenchVanilla100,
194
172
  },
195
173
  theme
@@ -1,16 +1,17 @@
1
1
  import * as React from 'react';
2
- import {CSSObject} from '@emotion/styled';
3
2
  import {
4
3
  focusRing,
5
4
  useTheme,
6
5
  Themeable,
7
6
  EmotionCanvasTheme,
8
7
  createComponent,
8
+ styled,
9
+ StyledType,
9
10
  } from '@workday/canvas-kit-react/common';
10
- import {colors, space, borderRadius} from '@workday/canvas-kit-react/tokens';
11
+ import {borderRadius, colors, space} from '@workday/canvas-kit-react/tokens';
11
12
  import {CanvasSystemIcon} from '@workday/design-assets-types';
12
- import {ButtonColors, TertiaryButtonSizes, IconPositions} from './types';
13
- import {ButtonContainer, ButtonLabelIcon, ButtonLabel} from './parts';
13
+ import {ButtonColors, IconPositions, ButtonSizes} from './types';
14
+ import {BaseButton} from './BaseButton';
14
15
 
15
16
  export interface TertiaryButtonProps extends Themeable {
16
17
  /**
@@ -24,7 +25,7 @@ export interface TertiaryButtonProps extends Themeable {
24
25
  *
25
26
  * @default 'medium'
26
27
  */
27
- size?: TertiaryButtonSizes;
28
+ size?: ButtonSizes;
28
29
  /**
29
30
  * Button icon positions can either be `left` or `right`.
30
31
  * If no value is provided, it defaults to `left`.
@@ -49,7 +50,8 @@ export interface TertiaryButtonProps extends Themeable {
49
50
 
50
51
  const getTertiaryButtonColors = (
51
52
  variant: 'inverse' | undefined,
52
- theme: EmotionCanvasTheme
53
+ theme: EmotionCanvasTheme,
54
+ children: React.ReactNode
53
55
  ): ButtonColors => {
54
56
  const {
55
57
  canvas: {
@@ -97,65 +99,103 @@ const getTertiaryButtonColors = (
97
99
  } else {
98
100
  return {
99
101
  default: {
100
- icon: themePrimary.main,
102
+ icon: children ? themePrimary.main : colors.blackPepper400,
101
103
  label: themePrimary.main,
102
104
  },
103
105
  hover: {
104
106
  background: colors.soap200,
105
- icon: themePrimary.dark,
107
+ icon: children ? themePrimary.dark : colors.blackPepper500,
106
108
  label: themePrimary.dark,
107
109
  },
108
110
  active: {
109
111
  background: colors.soap300,
110
- icon: themePrimary.dark,
112
+ icon: children ? themePrimary.dark : colors.blackPepper500,
111
113
  label: themePrimary.dark,
112
114
  },
113
115
  focus: {
114
- icon: themePrimary.dark,
115
- label: themePrimary.dark,
116
- focusRing: focusRing({}, theme),
116
+ icon: children ? themePrimary.main : colors.blackPepper500,
117
+ label: themePrimary.main,
118
+ focusRing: focusRing({innerColor: colors.blueberry400}, theme),
117
119
  },
118
120
  disabled: {
119
- icon: themePrimary.main,
121
+ icon: children ? themePrimary.main : colors.blackPepper400,
120
122
  label: themePrimary.main,
121
123
  },
122
124
  };
123
125
  }
124
126
  };
125
127
 
128
+ const StyledButtonLabel = styled(BaseButton.Label)({
129
+ textDecoration: 'underline',
130
+ });
131
+
132
+ const StyledTertiaryButtonContainer = styled(BaseButton)<
133
+ StyledType & Pick<TertiaryButtonProps, 'allCaps'>
134
+ >(
135
+ {
136
+ border: '0',
137
+ },
138
+ ({allCaps}) => ({
139
+ textTransform: allCaps ? 'uppercase' : undefined,
140
+ })
141
+ );
142
+
126
143
  const getPaddingStyles = (
127
144
  icon: CanvasSystemIcon | undefined,
128
- iconPosition: 'left' | 'right'
145
+ iconPosition: 'start' | 'end',
146
+ children: React.ReactNode,
147
+ size: ButtonSizes
129
148
  ): string => {
130
- // if there is an icon on the left, add 4px extra padding to the right for visual balance
131
- if (icon && iconPosition === 'left') {
132
- return `0 ${space.xs} 0 ${space.xxs}`;
133
- }
134
- // if there is an icon on the right, add 4px extra padding to the left for visual balance
135
- if (icon && iconPosition === 'right') {
136
- return `0 ${space.xxs} 0 ${space.xs}`;
149
+ if (children) {
150
+ // if there is an icon on the left, add 4px extra padding to the right for visual balance
151
+ if (icon && iconPosition === 'start') {
152
+ if (size === 'extraSmall') {
153
+ return `0 ${space.xxs} 0 ${space.xxxs}`;
154
+ }
155
+ return `0 ${space.xs} 0 ${space.xxs}`;
156
+ }
157
+ // if there is an icon on the right, add 4px extra padding to the left for visual balance
158
+ if (icon && iconPosition === 'end') {
159
+ if (size === 'extraSmall') {
160
+ return `0 ${space.xxxs} 0 ${space.xxs}`;
161
+ }
162
+ return `0 ${space.xxs} 0 ${space.xs}`;
163
+ }
164
+ // if there is no icon, return the default padding
165
+ return `0 ${space.xxs}`;
166
+ } else {
167
+ return '0';
137
168
  }
138
- // if there is no icon, return the default padding
139
- return `0 ${space.xxs}`;
140
169
  };
141
170
 
142
- // All disabled buttons are set to 40% opacity.
143
- // This will eventually live in the ButtonContainer styles, but for now we're scoping it to Primary, Secondary, and Tertiary buttons.
144
- const disabledButtonOpacity = {
145
- '&:disabled, &:disabled:active': {
146
- opacity: 0.4,
147
- },
171
+ const getMinWidthStyles = (children: React.ReactNode, size: ButtonSizes): string => {
172
+ let minWidthNum;
173
+ switch (size) {
174
+ case 'large':
175
+ minWidthNum = '48px';
176
+ break;
177
+ case 'medium':
178
+ minWidthNum = space.xl;
179
+ break;
180
+ case 'small':
181
+ minWidthNum = space.l;
182
+ break;
183
+ case 'extraSmall':
184
+ minWidthNum = space.m;
185
+ break;
186
+ default:
187
+ minWidthNum = space.xl;
188
+ break;
189
+ }
190
+ return children ? 'auto' : minWidthNum;
148
191
  };
149
192
 
150
193
  export const TertiaryButton = createComponent('button')({
151
194
  displayName: 'TertiaryButton',
152
195
  Component: (
153
196
  {
154
- // TODO: Fix useTheme and make it a real hook
155
- // eslint-disable-next-line react-hooks/rules-of-hooks
156
- theme = useTheme(),
157
197
  size = 'medium',
158
- iconPosition = 'left',
198
+ iconPosition = 'start',
159
199
  variant,
160
200
  children,
161
201
  icon,
@@ -166,45 +206,38 @@ export const TertiaryButton = createComponent('button')({
166
206
  ref,
167
207
  Element
168
208
  ) => {
169
- const allContainerStyles: CSSObject = {
170
- borderRadius: borderRadius.m,
171
- border: '0',
172
- padding: getPaddingStyles(icon, iconPosition),
173
- minWidth: 'auto',
174
- textTransform: allCaps ? 'uppercase' : undefined,
175
- '.wdc-text-button-label': {
176
- textDecoration: 'underline',
177
- },
178
- ...disabledButtonOpacity,
179
- };
209
+ const theme = useTheme();
180
210
 
181
211
  return (
182
- <ButtonContainer
212
+ <StyledTertiaryButtonContainer
183
213
  ref={ref}
184
214
  as={Element}
185
- colors={getTertiaryButtonColors(variant, theme)}
215
+ allCaps={allCaps}
216
+ colors={getTertiaryButtonColors(variant, theme, children)}
186
217
  size={size}
187
- extraStyles={allContainerStyles}
218
+ padding={getPaddingStyles(icon, iconPosition, children, size)}
219
+ minWidth={getMinWidthStyles(children, size)}
220
+ style={{borderRadius: children ? borderRadius.m : borderRadius.circle}}
188
221
  {...elemProps}
189
222
  >
190
- {icon && iconPosition === 'left' && (
191
- <ButtonLabelIcon
223
+ {icon && iconPosition === 'start' && (
224
+ <BaseButton.Icon
192
225
  size={size}
193
226
  iconPosition={iconPosition}
194
227
  icon={icon}
195
228
  shouldMirrorIcon={shouldMirrorIcon}
196
229
  />
197
230
  )}
198
- <ButtonLabel className="wdc-text-button-label">{children}</ButtonLabel>
199
- {icon && iconPosition === 'right' && (
200
- <ButtonLabelIcon
231
+ {children && <StyledButtonLabel>{children}</StyledButtonLabel>}
232
+ {icon && iconPosition === 'end' && (
233
+ <BaseButton.Icon
201
234
  size={size}
202
235
  iconPosition={iconPosition}
203
236
  icon={icon}
204
237
  shouldMirrorIcon={shouldMirrorIcon}
205
238
  />
206
239
  )}
207
- </ButtonContainer>
240
+ </StyledTertiaryButtonContainer>
208
241
  );
209
242
  },
210
243
  });