@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
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react';
2
- import { SystemIcon } from '@workday/canvas-kit-react/icon';
3
2
  import { MenuModel } from './useMenuModel';
4
3
  export interface MenuItemProps<T = unknown> {
5
4
  /**
@@ -38,7 +37,7 @@ export interface MenuItemProps<T = unknown> {
38
37
  hasIcon?: boolean;
39
38
  }
40
39
  export declare const MenuItem: import("../../../common").ElementComponent<"button", MenuItemProps<unknown>> & {
41
- Icon: typeof SystemIcon;
40
+ Icon: import("../../../common").ElementComponent<"span", import("../../../icon").SystemIconProps>;
42
41
  Text: import("@emotion/styled").StyledComponent<{
43
42
  theme?: import("@emotion/react").Theme | undefined;
44
43
  as?: "symbol" | "object" | "button" | "meter" | "textarea" | "style" | "progress" | "text" | "ruby" | "table" | "small" | "sub" | "circle" | "embed" | "pre" | "caption" | "menu" | "menuitem" | "clipPath" | "filter" | "mask" | "marker" | "big" | "link" | "sup" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "canvas" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "map" | "mark" | "meta" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "q" | "rp" | "rt" | "s" | "samp" | "slot" | "script" | "section" | "select" | "source" | "span" | "strong" | "summary" | "template" | "tbody" | "td" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "textPath" | "tspan" | "use" | "view" | React.ComponentClass<any, any> | React.FunctionComponent<any> | undefined;
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { GrowthBehavior } from '@workday/canvas-kit-react/common';
3
3
  import { SystemIcon } from '@workday/canvas-kit-react/icon';
4
4
  export interface InputIconContainerProps extends GrowthBehavior {
5
- icon?: React.ReactElement<SystemIcon>;
5
+ icon?: React.ReactElement<typeof SystemIcon>;
6
6
  }
7
7
  declare const InputIconContainer: React.FunctionComponent<InputIconContainerProps>;
8
8
  export default InputIconContainer;
@@ -24,7 +24,7 @@ export interface TooltipProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
24
24
  * Determines the tooltip type for accessibility.
25
25
  *
26
26
  * - `label`: Sets the accessible name for the wrapped element. Use for icons or if tooltip
27
- * `title` prop is the same as the text content of the wrapped element. E.g. IconButtons or
27
+ * `title` prop is the same as the text content of the wrapped element. E.g. TertiaryButtons that render an icon or
28
28
  * Ellipsis tooltips.
29
29
  * - `describe`: Sets `aria-describedby` of the wrapped element. Use if the tooltip has additional
30
30
  * information about the target.
@@ -8,7 +8,7 @@ export declare function useTooltip<T extends Element = Element>({ type, titleTex
8
8
  * Determines the tooltip type for accessibility.
9
9
  *
10
10
  * - `label`: Sets the accessible name for the wrapped element. Use for icons or if tooltip
11
- * `title` prop is the same as the text content of the wrapped element. E.g. IconButtons or
11
+ * `title` prop is the same as the text content of the wrapped element. E.g. TertiaryButton that renders an icon or
12
12
  * Ellipsis tooltips.
13
13
  * - `describe`: Sets `aria-describedby` of the wrapped element. Use if the tooltip has additional
14
14
  * information about the target.
@@ -1,279 +0,0 @@
1
- import * as React from 'react';
2
- import {colors, space, borderRadius} from '@workday/canvas-kit-react/tokens';
3
- import {
4
- focusRing,
5
- useTheme,
6
- Themeable,
7
- EmotionCanvasTheme,
8
- createComponent,
9
- } from '@workday/canvas-kit-react/common';
10
- import {SystemIcon} from '@workday/canvas-kit-react/icon';
11
- import {CanvasSystemIcon} from '@workday/design-assets-types';
12
- import {ButtonColors} from './types';
13
- import {ButtonContainer} from './parts';
14
-
15
- export interface IconButtonProps extends Themeable {
16
- /**
17
- * The accessibility label to indicate the action triggered by clicking the IconButton. This is optional because there are
18
- * instances where an Icon Button might already have an `aria-labelledby`. In a case where an `aria-labelledby` is provided
19
- * it will take precedence over the `aria-label` as explained here: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-labelledby_attribute
20
- * We highly encourage consumers to either provide an `aria-label` OR an `aria-labelledby`
21
- */
22
- 'aria-label'?: string;
23
- /**
24
- * The type of the IconButton.
25
- * @default 'circle'
26
- */
27
- variant?:
28
- | 'square'
29
- | 'squareFilled'
30
- | 'plain'
31
- | 'circle'
32
- | 'circleFilled'
33
- | 'inverse'
34
- | 'inverseFilled';
35
- /**
36
- * The size of the IconButton.
37
- * @default 'medium'
38
- */
39
- size?: 'small' | 'medium';
40
- /**
41
- * The toggled state of the button. If defined as a boolean, then it manages the toggled state: on (`true`) or off (`false`).
42
- * @default undefined
43
- */
44
- toggled?: boolean;
45
- /**
46
- * The icon of the IconButton.
47
- */
48
- icon?: CanvasSystemIcon;
49
- /**
50
- * If set to `true`, transform the icon's x-axis to mirror the graphic
51
- * @default false
52
- */
53
- shouldMirrorIcon?: boolean;
54
- /**
55
- * The function called when the IconButton toggled state changes.
56
- */
57
- onToggleChange?: (toggled: boolean | undefined) => void;
58
- value?: string | string[] | number;
59
- children?: React.ReactNode;
60
- }
61
-
62
- export const IconButton = createComponent('button')({
63
- displayName: 'IconButton',
64
- Component: (
65
- {
66
- // TODO: Fix useTheme and make it a real hook
67
- // eslint-disable-next-line react-hooks/rules-of-hooks
68
- theme = useTheme(),
69
- variant = 'circle',
70
- size = 'medium',
71
- onToggleChange,
72
- icon,
73
- shouldMirrorIcon = false,
74
- toggled,
75
- children,
76
- ...elemProps
77
- }: IconButtonProps,
78
- ref,
79
- Element
80
- ) => {
81
- const isInitialMount = React.useRef(true);
82
-
83
- // Only call onToggleChange on update - not on first mount
84
- React.useEffect(() => {
85
- if (isInitialMount.current) {
86
- isInitialMount.current = false;
87
- } else {
88
- if (toggled && typeof onToggleChange === 'function') {
89
- onToggleChange(toggled);
90
- }
91
- }
92
- }, [toggled, onToggleChange]);
93
-
94
- const containerStyles = {
95
- padding: 0,
96
- margin: variant === 'plain' ? '-8px' : undefined,
97
- minWidth: size === 'small' ? space.l : space.xl, // min-width is set so buttons don't collapse in IE11
98
- width: size === 'small' ? space.l : space.xl,
99
- height: size === 'small' ? space.l : space.xl,
100
- ...getIconButtonBorderRadius(variant),
101
- ['& .wd-icon']: {
102
- display: 'inline-block',
103
- verticalAlign: 'middle',
104
- width: size === 'small' ? '20px' : undefined,
105
- height: size === 'small' ? '20px' : undefined,
106
- },
107
- };
108
-
109
- return (
110
- <ButtonContainer
111
- ref={ref}
112
- as={Element}
113
- colors={getIconButtonColors(variant, theme, toggled)}
114
- size={size}
115
- fillIcon={toggled}
116
- extraStyles={containerStyles}
117
- aria-pressed={toggled}
118
- {...elemProps}
119
- >
120
- {icon ? <SystemIcon icon={icon} shouldMirror={shouldMirrorIcon} /> : children}
121
- </ButtonContainer>
122
- );
123
- },
124
- });
125
-
126
- const getIconButtonBorderRadius = (variant: IconButtonProps['variant']) => {
127
- switch (variant) {
128
- case 'square':
129
- case 'squareFilled':
130
- return {borderRadius: borderRadius.m};
131
- default:
132
- return {borderRadius: borderRadius.circle};
133
- }
134
- };
135
-
136
- const getIconButtonColors = (
137
- variant: IconButtonProps['variant'],
138
- theme: EmotionCanvasTheme,
139
- toggled?: boolean
140
- ): ButtonColors => {
141
- const {
142
- canvas: {
143
- palette: {primary: themePrimary},
144
- },
145
- } = theme;
146
-
147
- switch (variant) {
148
- case 'square':
149
- case 'circle':
150
- default:
151
- return {
152
- default: {
153
- background: toggled ? themePrimary.main : undefined,
154
- icon: toggled ? themePrimary.contrast : colors.licorice200,
155
- },
156
- hover: {
157
- background: toggled ? themePrimary.dark : colors.soap300,
158
- icon: toggled ? themePrimary.contrast : colors.licorice500,
159
- },
160
- active: {
161
- background: toggled ? themePrimary.dark : colors.soap500,
162
- icon: toggled ? themePrimary.contrast : colors.licorice500,
163
- },
164
- focus: {
165
- background: toggled ? themePrimary.main : undefined,
166
- icon: toggled ? themePrimary.contrast : colors.licorice500,
167
- },
168
- disabled: {
169
- background: toggled ? themePrimary.lightest : 'transparent',
170
- icon: toggled ? themePrimary.light : colors.soap600,
171
- },
172
- };
173
- case 'squareFilled':
174
- case 'circleFilled':
175
- return {
176
- default: {
177
- background: toggled ? themePrimary.main : colors.soap200,
178
- icon: toggled ? themePrimary.contrast : colors.licorice200,
179
- },
180
- hover: {
181
- background: toggled ? themePrimary.dark : colors.soap400,
182
- icon: toggled ? themePrimary.contrast : colors.licorice500,
183
- },
184
- active: {
185
- background: toggled ? themePrimary.dark : colors.soap500,
186
- icon: toggled ? themePrimary.contrast : colors.licorice500,
187
- },
188
- focus: {
189
- background: toggled ? themePrimary.main : colors.soap200,
190
- icon: toggled ? themePrimary.contrast : colors.licorice500,
191
- },
192
- disabled: {
193
- background: toggled ? themePrimary.lightest : colors.soap100,
194
- icon: toggled ? themePrimary.light : colors.soap600,
195
- },
196
- };
197
- case 'plain':
198
- return {
199
- default: {
200
- icon: toggled ? themePrimary.main : colors.licorice200,
201
- },
202
- hover: {
203
- icon: toggled ? themePrimary.main : colors.licorice500,
204
- },
205
- active: {
206
- icon: toggled ? themePrimary.main : colors.licorice500,
207
- },
208
- focus: {
209
- icon: toggled ? themePrimary.main : colors.licorice500,
210
- focusRing: focusRing({}, theme),
211
- },
212
- disabled: {
213
- icon: toggled ? themePrimary.light : colors.soap600,
214
- },
215
- };
216
- case 'inverse':
217
- return {
218
- default: {
219
- background: toggled ? themePrimary.contrast : undefined,
220
- icon: toggled ? themePrimary.main : themePrimary.contrast,
221
- },
222
- hover: {
223
- background: toggled ? themePrimary.contrast : 'rgba(0, 0, 0, 0.2)',
224
- icon: toggled ? themePrimary.main : themePrimary.contrast,
225
- },
226
- active: {
227
- background: toggled ? themePrimary.contrast : 'rgba(0, 0, 0, 0.3)',
228
- icon: toggled ? themePrimary.main : themePrimary.contrast,
229
- },
230
- focus: {
231
- background: toggled ? themePrimary.contrast : undefined,
232
- icon: toggled ? themePrimary.main : themePrimary.contrast,
233
- focusRing: focusRing(
234
- {
235
- separation: 2,
236
- innerColor: 'currentColor',
237
- outerColor: themePrimary.contrast,
238
- },
239
- theme
240
- ),
241
- },
242
- disabled: {
243
- background: toggled ? 'rgba(255,255,255,0.75)' : 'transparent',
244
- icon: toggled ? themePrimary.main : 'rgba(255, 255, 255, 0.75)',
245
- },
246
- };
247
- case 'inverseFilled':
248
- return {
249
- default: {
250
- background: toggled ? themePrimary.contrast : 'rgba(0, 0, 0, 0.2)',
251
- icon: toggled ? themePrimary.main : themePrimary.contrast,
252
- },
253
- hover: {
254
- background: toggled ? themePrimary.contrast : 'rgba(0, 0, 0, 0.3)',
255
- icon: toggled ? themePrimary.main : themePrimary.contrast,
256
- },
257
- active: {
258
- background: toggled ? themePrimary.contrast : 'rgba(0, 0, 0, 0.4)',
259
- icon: toggled ? themePrimary.main : themePrimary.contrast,
260
- },
261
- focus: {
262
- background: toggled ? themePrimary.contrast : 'rgba(0, 0, 0, 0.2)',
263
- icon: toggled ? themePrimary.main : themePrimary.contrast,
264
- focusRing: focusRing(
265
- {
266
- separation: 2,
267
- innerColor: 'currentColor',
268
- outerColor: themePrimary.contrast,
269
- },
270
- theme
271
- ),
272
- },
273
- disabled: {
274
- background: toggled ? 'rgba(255,255,255,0.75)' : 'rgba(0, 0, 0, 0.2)',
275
- icon: toggled ? themePrimary.main : 'rgba(255, 255, 255, 0.75)',
276
- },
277
- };
278
- }
279
- };
@@ -1,16 +0,0 @@
1
- import * as React from 'react';
2
- import {styled} from '@workday/canvas-kit-react/common';
3
-
4
- export const buttonLabelDataClassName = 'button-label-data';
5
-
6
- const Container = styled('span')({
7
- position: 'relative', // Fixes an IE issue with text within button moving on click
8
- textOverflow: 'ellipsis',
9
- overflow: 'hidden',
10
- whiteSpace: 'nowrap',
11
- fontWeight: 400,
12
- });
13
-
14
- export const ButtonLabelData = (props: any) => (
15
- <Container className={buttonLabelDataClassName} {...props} />
16
- );
@@ -1,44 +0,0 @@
1
- import * as React from 'react';
2
- import { Themeable } from '@workday/canvas-kit-react/common';
3
- import { CanvasSystemIcon } from '@workday/design-assets-types';
4
- export interface IconButtonProps extends Themeable {
5
- /**
6
- * The accessibility label to indicate the action triggered by clicking the IconButton. This is optional because there are
7
- * instances where an Icon Button might already have an `aria-labelledby`. In a case where an `aria-labelledby` is provided
8
- * it will take precedence over the `aria-label` as explained here: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-labelledby_attribute
9
- * We highly encourage consumers to either provide an `aria-label` OR an `aria-labelledby`
10
- */
11
- 'aria-label'?: string;
12
- /**
13
- * The type of the IconButton.
14
- * @default 'circle'
15
- */
16
- variant?: 'square' | 'squareFilled' | 'plain' | 'circle' | 'circleFilled' | 'inverse' | 'inverseFilled';
17
- /**
18
- * The size of the IconButton.
19
- * @default 'medium'
20
- */
21
- size?: 'small' | 'medium';
22
- /**
23
- * The toggled state of the button. If defined as a boolean, then it manages the toggled state: on (`true`) or off (`false`).
24
- * @default undefined
25
- */
26
- toggled?: boolean;
27
- /**
28
- * The icon of the IconButton.
29
- */
30
- icon?: CanvasSystemIcon;
31
- /**
32
- * If set to `true`, transform the icon's x-axis to mirror the graphic
33
- * @default false
34
- */
35
- shouldMirrorIcon?: boolean;
36
- /**
37
- * The function called when the IconButton toggled state changes.
38
- */
39
- onToggleChange?: (toggled: boolean | undefined) => void;
40
- value?: string | string[] | number;
41
- children?: React.ReactNode;
42
- }
43
- export declare const IconButton: import("../../common").ElementComponent<"button", IconButtonProps>;
44
- //# sourceMappingURL=IconButton.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAGL,SAAS,EAGV,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAI9D,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,OAAO,CAAC,EACJ,QAAQ,GACR,cAAc,GACd,OAAO,GACP,QAAQ,GACR,cAAc,GACd,SAAS,GACT,eAAe,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,KAAK,IAAI,CAAC;IACxD,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC;IACnC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,UAAU,oEA8DrB,CAAC"}
@@ -1,219 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
- Object.defineProperty(o, "default", { enumerable: true, value: v });
22
- }) : function(o, v) {
23
- o["default"] = v;
24
- });
25
- var __importStar = (this && this.__importStar) || function (mod) {
26
- if (mod && mod.__esModule) return mod;
27
- var result = {};
28
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
29
- __setModuleDefault(result, mod);
30
- return result;
31
- };
32
- var __rest = (this && this.__rest) || function (s, e) {
33
- var t = {};
34
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
35
- t[p] = s[p];
36
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
37
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
38
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
39
- t[p[i]] = s[p[i]];
40
- }
41
- return t;
42
- };
43
- Object.defineProperty(exports, "__esModule", { value: true });
44
- exports.IconButton = void 0;
45
- var React = __importStar(require("react"));
46
- var tokens_1 = require("@workday/canvas-kit-react/tokens");
47
- var common_1 = require("@workday/canvas-kit-react/common");
48
- var icon_1 = require("@workday/canvas-kit-react/icon");
49
- var parts_1 = require("./parts");
50
- exports.IconButton = common_1.createComponent('button')({
51
- displayName: 'IconButton',
52
- Component: function (_a, ref, Element) {
53
- var _b;
54
- var
55
- // TODO: Fix useTheme and make it a real hook
56
- // eslint-disable-next-line react-hooks/rules-of-hooks
57
- _c = _a.theme,
58
- // TODO: Fix useTheme and make it a real hook
59
- // eslint-disable-next-line react-hooks/rules-of-hooks
60
- theme = _c === void 0 ? common_1.useTheme() : _c, _d = _a.variant, variant = _d === void 0 ? 'circle' : _d, _e = _a.size, size = _e === void 0 ? 'medium' : _e, onToggleChange = _a.onToggleChange, icon = _a.icon, _f = _a.shouldMirrorIcon, shouldMirrorIcon = _f === void 0 ? false : _f, toggled = _a.toggled, children = _a.children, elemProps = __rest(_a, ["theme", "variant", "size", "onToggleChange", "icon", "shouldMirrorIcon", "toggled", "children"]);
61
- var isInitialMount = React.useRef(true);
62
- // Only call onToggleChange on update - not on first mount
63
- React.useEffect(function () {
64
- if (isInitialMount.current) {
65
- isInitialMount.current = false;
66
- }
67
- else {
68
- if (toggled && typeof onToggleChange === 'function') {
69
- onToggleChange(toggled);
70
- }
71
- }
72
- }, [toggled, onToggleChange]);
73
- var containerStyles = __assign(__assign({ padding: 0, margin: variant === 'plain' ? '-8px' : undefined, minWidth: size === 'small' ? tokens_1.space.l : tokens_1.space.xl, width: size === 'small' ? tokens_1.space.l : tokens_1.space.xl, height: size === 'small' ? tokens_1.space.l : tokens_1.space.xl }, getIconButtonBorderRadius(variant)), (_b = {}, _b['& .wd-icon'] = {
74
- display: 'inline-block',
75
- verticalAlign: 'middle',
76
- width: size === 'small' ? '20px' : undefined,
77
- height: size === 'small' ? '20px' : undefined,
78
- }, _b));
79
- return (React.createElement(parts_1.ButtonContainer, __assign({ ref: ref, as: Element, colors: getIconButtonColors(variant, theme, toggled), size: size, fillIcon: toggled, extraStyles: containerStyles, "aria-pressed": toggled }, elemProps), icon ? React.createElement(icon_1.SystemIcon, { icon: icon, shouldMirror: shouldMirrorIcon }) : children));
80
- },
81
- });
82
- var getIconButtonBorderRadius = function (variant) {
83
- switch (variant) {
84
- case 'square':
85
- case 'squareFilled':
86
- return { borderRadius: tokens_1.borderRadius.m };
87
- default:
88
- return { borderRadius: tokens_1.borderRadius.circle };
89
- }
90
- };
91
- var getIconButtonColors = function (variant, theme, toggled) {
92
- var themePrimary = theme.canvas.palette.primary;
93
- switch (variant) {
94
- case 'square':
95
- case 'circle':
96
- default:
97
- return {
98
- default: {
99
- background: toggled ? themePrimary.main : undefined,
100
- icon: toggled ? themePrimary.contrast : tokens_1.colors.licorice200,
101
- },
102
- hover: {
103
- background: toggled ? themePrimary.dark : tokens_1.colors.soap300,
104
- icon: toggled ? themePrimary.contrast : tokens_1.colors.licorice500,
105
- },
106
- active: {
107
- background: toggled ? themePrimary.dark : tokens_1.colors.soap500,
108
- icon: toggled ? themePrimary.contrast : tokens_1.colors.licorice500,
109
- },
110
- focus: {
111
- background: toggled ? themePrimary.main : undefined,
112
- icon: toggled ? themePrimary.contrast : tokens_1.colors.licorice500,
113
- },
114
- disabled: {
115
- background: toggled ? themePrimary.lightest : 'transparent',
116
- icon: toggled ? themePrimary.light : tokens_1.colors.soap600,
117
- },
118
- };
119
- case 'squareFilled':
120
- case 'circleFilled':
121
- return {
122
- default: {
123
- background: toggled ? themePrimary.main : tokens_1.colors.soap200,
124
- icon: toggled ? themePrimary.contrast : tokens_1.colors.licorice200,
125
- },
126
- hover: {
127
- background: toggled ? themePrimary.dark : tokens_1.colors.soap400,
128
- icon: toggled ? themePrimary.contrast : tokens_1.colors.licorice500,
129
- },
130
- active: {
131
- background: toggled ? themePrimary.dark : tokens_1.colors.soap500,
132
- icon: toggled ? themePrimary.contrast : tokens_1.colors.licorice500,
133
- },
134
- focus: {
135
- background: toggled ? themePrimary.main : tokens_1.colors.soap200,
136
- icon: toggled ? themePrimary.contrast : tokens_1.colors.licorice500,
137
- },
138
- disabled: {
139
- background: toggled ? themePrimary.lightest : tokens_1.colors.soap100,
140
- icon: toggled ? themePrimary.light : tokens_1.colors.soap600,
141
- },
142
- };
143
- case 'plain':
144
- return {
145
- default: {
146
- icon: toggled ? themePrimary.main : tokens_1.colors.licorice200,
147
- },
148
- hover: {
149
- icon: toggled ? themePrimary.main : tokens_1.colors.licorice500,
150
- },
151
- active: {
152
- icon: toggled ? themePrimary.main : tokens_1.colors.licorice500,
153
- },
154
- focus: {
155
- icon: toggled ? themePrimary.main : tokens_1.colors.licorice500,
156
- focusRing: common_1.focusRing({}, theme),
157
- },
158
- disabled: {
159
- icon: toggled ? themePrimary.light : tokens_1.colors.soap600,
160
- },
161
- };
162
- case 'inverse':
163
- return {
164
- default: {
165
- background: toggled ? themePrimary.contrast : undefined,
166
- icon: toggled ? themePrimary.main : themePrimary.contrast,
167
- },
168
- hover: {
169
- background: toggled ? themePrimary.contrast : 'rgba(0, 0, 0, 0.2)',
170
- icon: toggled ? themePrimary.main : themePrimary.contrast,
171
- },
172
- active: {
173
- background: toggled ? themePrimary.contrast : 'rgba(0, 0, 0, 0.3)',
174
- icon: toggled ? themePrimary.main : themePrimary.contrast,
175
- },
176
- focus: {
177
- background: toggled ? themePrimary.contrast : undefined,
178
- icon: toggled ? themePrimary.main : themePrimary.contrast,
179
- focusRing: common_1.focusRing({
180
- separation: 2,
181
- innerColor: 'currentColor',
182
- outerColor: themePrimary.contrast,
183
- }, theme),
184
- },
185
- disabled: {
186
- background: toggled ? 'rgba(255,255,255,0.75)' : 'transparent',
187
- icon: toggled ? themePrimary.main : 'rgba(255, 255, 255, 0.75)',
188
- },
189
- };
190
- case 'inverseFilled':
191
- return {
192
- default: {
193
- background: toggled ? themePrimary.contrast : 'rgba(0, 0, 0, 0.2)',
194
- icon: toggled ? themePrimary.main : themePrimary.contrast,
195
- },
196
- hover: {
197
- background: toggled ? themePrimary.contrast : 'rgba(0, 0, 0, 0.3)',
198
- icon: toggled ? themePrimary.main : themePrimary.contrast,
199
- },
200
- active: {
201
- background: toggled ? themePrimary.contrast : 'rgba(0, 0, 0, 0.4)',
202
- icon: toggled ? themePrimary.main : themePrimary.contrast,
203
- },
204
- focus: {
205
- background: toggled ? themePrimary.contrast : 'rgba(0, 0, 0, 0.2)',
206
- icon: toggled ? themePrimary.main : themePrimary.contrast,
207
- focusRing: common_1.focusRing({
208
- separation: 2,
209
- innerColor: 'currentColor',
210
- outerColor: themePrimary.contrast,
211
- }, theme),
212
- },
213
- disabled: {
214
- background: toggled ? 'rgba(255,255,255,0.75)' : 'rgba(0, 0, 0, 0.2)',
215
- icon: toggled ? themePrimary.main : 'rgba(255, 255, 255, 0.75)',
216
- },
217
- };
218
- }
219
- };
@@ -1,33 +0,0 @@
1
- import * as React from 'react';
2
- import { CSSObject } from '@emotion/styled';
3
- import { GrowthBehavior } from '@workday/canvas-kit-react/common';
4
- import { ButtonColors, ButtonSizes } from '../types';
5
- export interface ButtonContainerProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, GrowthBehavior {
6
- colors?: ButtonColors;
7
- /**
8
- * There are four button sizes: `extraSmall`, `small`, `medium`, and `large`.
9
- * If no size is provided, it will default to `medium`.
10
- *
11
- * @default 'medium'
12
- */
13
- size?: ButtonSizes;
14
- /**
15
- * The ref to the button that the styled component renders.
16
- */
17
- ref?: React.Ref<HTMLButtonElement>;
18
- /**
19
- * Whether the icon should received filled (colored background layer) or regular styles.
20
- * Corresponds to `toggled` in IconButton
21
- */
22
- fillIcon?: boolean;
23
- /**
24
- * Any extra styles necessary for a given parent component.
25
- * This avoids using the inline `style` attribute when the shape needs to be customized (e.g. for IconButton)
26
- */
27
- extraStyles?: CSSObject;
28
- }
29
- export declare const ButtonContainer: import("@emotion/styled").StyledComponent<{
30
- theme?: import("@emotion/react").Theme | undefined;
31
- as?: "symbol" | "object" | "s" | "big" | "link" | "small" | "sub" | "sup" | "circle" | "stop" | "path" | "style" | "map" | "filter" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "main" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "samp" | "slot" | "script" | "section" | "select" | "source" | "span" | "strong" | "summary" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | React.ComponentClass<any, any> | React.FunctionComponent<any> | undefined;
32
- } & ButtonContainerProps, React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
33
- //# sourceMappingURL=ButtonContainer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ButtonContainer.d.ts","sourceRoot":"","sources":["../../../../../button/lib/parts/ButtonContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EACL,cAAc,EAKf,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,YAAY,EAAE,WAAW,EAAC,MAAM,UAAU,CAAC;AAGnD,MAAM,WAAW,oBACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,cAAc;IAChB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;OAEG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB;AA8BD,eAAO,MAAM,eAAe;;;wHAgL3B,CAAC"}