@workday/canvas-kit-labs-react 7.0.0-alpha.0-next.3 → 7.0.0-alpha.0-next.7

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 (299) hide show
  1. package/combobox/lib/Combobox.tsx +5 -3
  2. package/common/index.ts +0 -8
  3. package/dist/commonjs/combobox/index.js +12 -4
  4. package/dist/commonjs/combobox/lib/AutocompleteList.d.ts.map +1 -1
  5. package/dist/commonjs/combobox/lib/AutocompleteList.js +19 -7
  6. package/dist/commonjs/combobox/lib/Combobox.d.ts.map +1 -1
  7. package/dist/commonjs/combobox/lib/Combobox.js +27 -12
  8. package/dist/commonjs/combobox/lib/Status.d.ts.map +1 -1
  9. package/dist/commonjs/combobox/lib/Status.js +14 -2
  10. package/dist/commonjs/common/index.d.ts +0 -8
  11. package/dist/commonjs/common/index.d.ts.map +1 -1
  12. package/dist/commonjs/common/index.js +14 -7
  13. package/dist/commonjs/common/lib/storybook-utils/ComponentStatesTable.d.ts.map +1 -1
  14. package/dist/commonjs/common/lib/storybook-utils/ComponentStatesTable.js +3 -1
  15. package/dist/commonjs/common/lib/storybook-utils/permutateProps.d.ts.map +1 -1
  16. package/dist/commonjs/common/lib/storybook-utils/permutateProps.js +3 -1
  17. package/dist/commonjs/common/lib/theming/index.js +12 -5
  18. package/dist/commonjs/common/lib/theming/useThemeRTL.d.ts.map +1 -1
  19. package/dist/commonjs/common/lib/theming/useThemeRTL.js +1 -0
  20. package/dist/commonjs/common/lib/theming/useThemedRing.d.ts +1 -1
  21. package/dist/commonjs/common/lib/theming/useThemedRing.d.ts.map +1 -1
  22. package/dist/commonjs/common/lib/theming/useThemedRing.js +3 -1
  23. package/dist/commonjs/drawer/index.js +12 -4
  24. package/dist/commonjs/drawer/lib/Drawer.js +21 -8
  25. package/dist/commonjs/drawer/lib/DrawerHeader.js +20 -8
  26. package/dist/commonjs/index.d.ts +0 -2
  27. package/dist/commonjs/index.d.ts.map +1 -1
  28. package/dist/commonjs/index.js +14 -9
  29. package/dist/commonjs/search-form/index.js +12 -5
  30. package/dist/commonjs/search-form/lib/SearchForm.d.ts +3 -2
  31. package/dist/commonjs/search-form/lib/SearchForm.d.ts.map +1 -1
  32. package/dist/commonjs/search-form/lib/SearchForm.js +21 -8
  33. package/dist/commonjs/search-form/lib/themes.d.ts.map +1 -1
  34. package/dist/commonjs/search-form/lib/themes.js +1 -0
  35. package/dist/es6/combobox/lib/AutocompleteList.d.ts.map +1 -1
  36. package/dist/es6/combobox/lib/Combobox.d.ts.map +1 -1
  37. package/dist/es6/combobox/lib/Combobox.js +1 -1
  38. package/dist/es6/combobox/lib/Status.d.ts.map +1 -1
  39. package/dist/es6/common/index.d.ts +0 -8
  40. package/dist/es6/common/index.d.ts.map +1 -1
  41. package/dist/es6/common/index.js +0 -1
  42. package/dist/es6/common/lib/storybook-utils/ComponentStatesTable.d.ts.map +1 -1
  43. package/dist/es6/common/lib/storybook-utils/permutateProps.d.ts.map +1 -1
  44. package/dist/es6/common/lib/storybook-utils/propTypes.js +1 -0
  45. package/dist/es6/common/lib/theming/useThemeRTL.d.ts.map +1 -1
  46. package/dist/es6/common/lib/theming/useThemedRing.d.ts +1 -1
  47. package/dist/es6/common/lib/theming/useThemedRing.d.ts.map +1 -1
  48. package/dist/es6/drawer/lib/Drawer.js +1 -1
  49. package/dist/es6/drawer/lib/DrawerHeader.js +1 -1
  50. package/dist/es6/index.d.ts +0 -2
  51. package/dist/es6/index.d.ts.map +1 -1
  52. package/dist/es6/index.js +0 -2
  53. package/dist/es6/search-form/lib/SearchForm.d.ts +3 -2
  54. package/dist/es6/search-form/lib/SearchForm.d.ts.map +1 -1
  55. package/dist/es6/search-form/lib/SearchForm.js +1 -1
  56. package/dist/es6/search-form/lib/themes.d.ts.map +1 -1
  57. package/index.ts +0 -2
  58. package/package.json +6 -8
  59. package/search-form/lib/SearchForm.tsx +3 -3
  60. package/search-form/lib/themes.ts +2 -1
  61. package/ts3.5/dist/commonjs/common/index.d.ts +0 -8
  62. package/ts3.5/dist/commonjs/common/lib/theming/useThemedRing.d.ts +1 -1
  63. package/ts3.5/dist/commonjs/index.d.ts +0 -2
  64. package/ts3.5/dist/commonjs/search-form/lib/SearchForm.d.ts +3 -2
  65. package/ts3.5/dist/es6/common/index.d.ts +0 -8
  66. package/ts3.5/dist/es6/common/lib/theming/useThemedRing.d.ts +1 -1
  67. package/ts3.5/dist/es6/index.d.ts +0 -2
  68. package/ts3.5/dist/es6/search-form/lib/SearchForm.d.ts +3 -2
  69. package/common/lib/Box.tsx +0 -73
  70. package/common/lib/utils/border.ts +0 -263
  71. package/common/lib/utils/color.ts +0 -62
  72. package/common/lib/utils/depth.ts +0 -37
  73. package/common/lib/utils/flexItem.ts +0 -56
  74. package/common/lib/utils/layout.ts +0 -77
  75. package/common/lib/utils/other.ts +0 -20
  76. package/common/lib/utils/position.ts +0 -96
  77. package/common/lib/utils/space.ts +0 -207
  78. package/common/lib/utils/types.ts +0 -105
  79. package/dist/commonjs/common/lib/Box.d.ts +0 -31
  80. package/dist/commonjs/common/lib/Box.d.ts.map +0 -1
  81. package/dist/commonjs/common/lib/Box.js +0 -78
  82. package/dist/commonjs/common/lib/utils/border.d.ts +0 -103
  83. package/dist/commonjs/common/lib/utils/border.d.ts.map +0 -1
  84. package/dist/commonjs/common/lib/utils/border.js +0 -152
  85. package/dist/commonjs/common/lib/utils/color.d.ts +0 -26
  86. package/dist/commonjs/common/lib/utils/color.d.ts.map +0 -1
  87. package/dist/commonjs/common/lib/utils/color.js +0 -56
  88. package/dist/commonjs/common/lib/utils/depth.d.ts +0 -22
  89. package/dist/commonjs/common/lib/utils/depth.d.ts.map +0 -1
  90. package/dist/commonjs/common/lib/utils/depth.js +0 -28
  91. package/dist/commonjs/common/lib/utils/flexItem.d.ts +0 -33
  92. package/dist/commonjs/common/lib/utils/flexItem.d.ts.map +0 -1
  93. package/dist/commonjs/common/lib/utils/flexItem.js +0 -38
  94. package/dist/commonjs/common/lib/utils/layout.d.ts +0 -43
  95. package/dist/commonjs/common/lib/utils/layout.d.ts.map +0 -1
  96. package/dist/commonjs/common/lib/utils/layout.js +0 -42
  97. package/dist/commonjs/common/lib/utils/other.d.ts +0 -5
  98. package/dist/commonjs/common/lib/utils/other.d.ts.map +0 -1
  99. package/dist/commonjs/common/lib/utils/other.js +0 -18
  100. package/dist/commonjs/common/lib/utils/position.d.ts +0 -41
  101. package/dist/commonjs/common/lib/utils/position.d.ts.map +0 -1
  102. package/dist/commonjs/common/lib/utils/position.js +0 -77
  103. package/dist/commonjs/common/lib/utils/space.d.ts +0 -64
  104. package/dist/commonjs/common/lib/utils/space.d.ts.map +0 -1
  105. package/dist/commonjs/common/lib/utils/space.js +0 -160
  106. package/dist/commonjs/common/lib/utils/types.d.ts +0 -14
  107. package/dist/commonjs/common/lib/utils/types.d.ts.map +0 -1
  108. package/dist/commonjs/common/lib/utils/types.js +0 -2
  109. package/dist/commonjs/header/index.d.ts +0 -9
  110. package/dist/commonjs/header/index.d.ts.map +0 -1
  111. package/dist/commonjs/header/index.js +0 -16
  112. package/dist/commonjs/header/lib/GlobalHeader.d.ts +0 -38
  113. package/dist/commonjs/header/lib/GlobalHeader.d.ts.map +0 -1
  114. package/dist/commonjs/header/lib/GlobalHeader.js +0 -74
  115. package/dist/commonjs/header/lib/Header.d.ts +0 -76
  116. package/dist/commonjs/header/lib/Header.d.ts.map +0 -1
  117. package/dist/commonjs/header/lib/Header.js +0 -321
  118. package/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts +0 -30
  119. package/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts.map +0 -1
  120. package/dist/commonjs/header/lib/parts/DubLogoTitle.js +0 -105
  121. package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts +0 -31
  122. package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts.map +0 -1
  123. package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.js +0 -124
  124. package/dist/commonjs/header/lib/parts/index.d.ts +0 -3
  125. package/dist/commonjs/header/lib/parts/index.d.ts.map +0 -1
  126. package/dist/commonjs/header/lib/parts/index.js +0 -6
  127. package/dist/commonjs/header/lib/shared/themes.d.ts +0 -43
  128. package/dist/commonjs/header/lib/shared/themes.d.ts.map +0 -1
  129. package/dist/commonjs/header/lib/shared/themes.js +0 -62
  130. package/dist/commonjs/header/lib/shared/types.d.ts +0 -15
  131. package/dist/commonjs/header/lib/shared/types.d.ts.map +0 -1
  132. package/dist/commonjs/header/lib/shared/types.js +0 -19
  133. package/dist/commonjs/layout/index.d.ts +0 -5
  134. package/dist/commonjs/layout/index.d.ts.map +0 -1
  135. package/dist/commonjs/layout/index.js +0 -7
  136. package/dist/commonjs/layout/lib/Flex.d.ts +0 -26
  137. package/dist/commonjs/layout/lib/Flex.d.ts.map +0 -1
  138. package/dist/commonjs/layout/lib/Flex.js +0 -70
  139. package/dist/commonjs/layout/lib/Stack.d.ts +0 -27
  140. package/dist/commonjs/layout/lib/Stack.d.ts.map +0 -1
  141. package/dist/commonjs/layout/lib/Stack.js +0 -86
  142. package/dist/commonjs/layout/lib/utils/flex.d.ts +0 -36
  143. package/dist/commonjs/layout/lib/utils/flex.d.ts.map +0 -1
  144. package/dist/commonjs/layout/lib/utils/flex.js +0 -37
  145. package/dist/commonjs/layout/lib/utils/getValidChildren.d.ts +0 -3
  146. package/dist/commonjs/layout/lib/utils/getValidChildren.d.ts.map +0 -1
  147. package/dist/commonjs/layout/lib/utils/getValidChildren.js +0 -16
  148. package/dist/commonjs/layout/lib/utils/stack.d.ts +0 -26
  149. package/dist/commonjs/layout/lib/utils/stack.d.ts.map +0 -1
  150. package/dist/commonjs/layout/lib/utils/stack.js +0 -54
  151. package/dist/commonjs/layout/lib/utils/types.d.ts +0 -8
  152. package/dist/commonjs/layout/lib/utils/types.d.ts.map +0 -1
  153. package/dist/commonjs/layout/lib/utils/types.js +0 -2
  154. package/dist/es6/common/lib/Box.d.ts +0 -31
  155. package/dist/es6/common/lib/Box.d.ts.map +0 -1
  156. package/dist/es6/common/lib/Box.js +0 -66
  157. package/dist/es6/common/lib/utils/border.d.ts +0 -103
  158. package/dist/es6/common/lib/utils/border.d.ts.map +0 -1
  159. package/dist/es6/common/lib/utils/border.js +0 -149
  160. package/dist/es6/common/lib/utils/color.d.ts +0 -26
  161. package/dist/es6/common/lib/utils/color.d.ts.map +0 -1
  162. package/dist/es6/common/lib/utils/color.js +0 -53
  163. package/dist/es6/common/lib/utils/depth.d.ts +0 -22
  164. package/dist/es6/common/lib/utils/depth.d.ts.map +0 -1
  165. package/dist/es6/common/lib/utils/depth.js +0 -25
  166. package/dist/es6/common/lib/utils/flexItem.d.ts +0 -33
  167. package/dist/es6/common/lib/utils/flexItem.d.ts.map +0 -1
  168. package/dist/es6/common/lib/utils/flexItem.js +0 -35
  169. package/dist/es6/common/lib/utils/layout.d.ts +0 -43
  170. package/dist/es6/common/lib/utils/layout.d.ts.map +0 -1
  171. package/dist/es6/common/lib/utils/layout.js +0 -39
  172. package/dist/es6/common/lib/utils/other.d.ts +0 -5
  173. package/dist/es6/common/lib/utils/other.d.ts.map +0 -1
  174. package/dist/es6/common/lib/utils/other.js +0 -15
  175. package/dist/es6/common/lib/utils/position.d.ts +0 -41
  176. package/dist/es6/common/lib/utils/position.d.ts.map +0 -1
  177. package/dist/es6/common/lib/utils/position.js +0 -74
  178. package/dist/es6/common/lib/utils/space.d.ts +0 -64
  179. package/dist/es6/common/lib/utils/space.d.ts.map +0 -1
  180. package/dist/es6/common/lib/utils/space.js +0 -157
  181. package/dist/es6/common/lib/utils/types.d.ts +0 -14
  182. package/dist/es6/common/lib/utils/types.d.ts.map +0 -1
  183. package/dist/es6/common/lib/utils/types.js +0 -0
  184. package/dist/es6/header/index.d.ts +0 -9
  185. package/dist/es6/header/index.d.ts.map +0 -1
  186. package/dist/es6/header/index.js +0 -8
  187. package/dist/es6/header/lib/GlobalHeader.d.ts +0 -38
  188. package/dist/es6/header/lib/GlobalHeader.d.ts.map +0 -1
  189. package/dist/es6/header/lib/GlobalHeader.js +0 -62
  190. package/dist/es6/header/lib/Header.d.ts +0 -76
  191. package/dist/es6/header/lib/Header.d.ts.map +0 -1
  192. package/dist/es6/header/lib/Header.js +0 -309
  193. package/dist/es6/header/lib/parts/DubLogoTitle.d.ts +0 -30
  194. package/dist/es6/header/lib/parts/DubLogoTitle.d.ts.map +0 -1
  195. package/dist/es6/header/lib/parts/DubLogoTitle.js +0 -93
  196. package/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts +0 -31
  197. package/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts.map +0 -1
  198. package/dist/es6/header/lib/parts/WorkdayLogoTitle.js +0 -112
  199. package/dist/es6/header/lib/parts/index.d.ts +0 -3
  200. package/dist/es6/header/lib/parts/index.d.ts.map +0 -1
  201. package/dist/es6/header/lib/parts/index.js +0 -2
  202. package/dist/es6/header/lib/shared/themes.d.ts +0 -43
  203. package/dist/es6/header/lib/shared/themes.d.ts.map +0 -1
  204. package/dist/es6/header/lib/shared/themes.js +0 -57
  205. package/dist/es6/header/lib/shared/types.d.ts +0 -15
  206. package/dist/es6/header/lib/shared/types.d.ts.map +0 -1
  207. package/dist/es6/header/lib/shared/types.js +0 -17
  208. package/dist/es6/layout/index.d.ts +0 -5
  209. package/dist/es6/layout/index.d.ts.map +0 -1
  210. package/dist/es6/layout/index.js +0 -2
  211. package/dist/es6/layout/lib/Flex.d.ts +0 -26
  212. package/dist/es6/layout/lib/Flex.d.ts.map +0 -1
  213. package/dist/es6/layout/lib/Flex.js +0 -58
  214. package/dist/es6/layout/lib/Stack.d.ts +0 -27
  215. package/dist/es6/layout/lib/Stack.d.ts.map +0 -1
  216. package/dist/es6/layout/lib/Stack.js +0 -74
  217. package/dist/es6/layout/lib/utils/flex.d.ts +0 -36
  218. package/dist/es6/layout/lib/utils/flex.d.ts.map +0 -1
  219. package/dist/es6/layout/lib/utils/flex.js +0 -34
  220. package/dist/es6/layout/lib/utils/getValidChildren.d.ts +0 -3
  221. package/dist/es6/layout/lib/utils/getValidChildren.d.ts.map +0 -1
  222. package/dist/es6/layout/lib/utils/getValidChildren.js +0 -6
  223. package/dist/es6/layout/lib/utils/stack.d.ts +0 -26
  224. package/dist/es6/layout/lib/utils/stack.d.ts.map +0 -1
  225. package/dist/es6/layout/lib/utils/stack.js +0 -51
  226. package/dist/es6/layout/lib/utils/types.d.ts +0 -8
  227. package/dist/es6/layout/lib/utils/types.d.ts.map +0 -1
  228. package/dist/es6/layout/lib/utils/types.js +0 -0
  229. package/header/LICENSE +0 -51
  230. package/header/README.md +0 -359
  231. package/header/index.ts +0 -9
  232. package/header/lib/GlobalHeader.tsx +0 -73
  233. package/header/lib/Header.tsx +0 -429
  234. package/header/lib/parts/DubLogoTitle.tsx +0 -99
  235. package/header/lib/parts/WorkdayLogoTitle.tsx +0 -120
  236. package/header/lib/parts/index.ts +0 -2
  237. package/header/lib/shared/themes.tsx +0 -97
  238. package/header/lib/shared/types.tsx +0 -16
  239. package/header/package.json +0 -5
  240. package/layout/LICENSE +0 -52
  241. package/layout/README.md +0 -16
  242. package/layout/index.ts +0 -4
  243. package/layout/lib/Flex.tsx +0 -47
  244. package/layout/lib/Stack.tsx +0 -111
  245. package/layout/lib/utils/flex.ts +0 -65
  246. package/layout/lib/utils/getValidChildren.ts +0 -7
  247. package/layout/lib/utils/stack.ts +0 -78
  248. package/layout/lib/utils/types.ts +0 -45
  249. package/layout/package.json +0 -5
  250. package/ts3.5/dist/commonjs/common/lib/Box.d.ts +0 -31
  251. package/ts3.5/dist/commonjs/common/lib/utils/border.d.ts +0 -103
  252. package/ts3.5/dist/commonjs/common/lib/utils/color.d.ts +0 -26
  253. package/ts3.5/dist/commonjs/common/lib/utils/depth.d.ts +0 -22
  254. package/ts3.5/dist/commonjs/common/lib/utils/flexItem.d.ts +0 -33
  255. package/ts3.5/dist/commonjs/common/lib/utils/layout.d.ts +0 -43
  256. package/ts3.5/dist/commonjs/common/lib/utils/other.d.ts +0 -5
  257. package/ts3.5/dist/commonjs/common/lib/utils/position.d.ts +0 -41
  258. package/ts3.5/dist/commonjs/common/lib/utils/space.d.ts +0 -64
  259. package/ts3.5/dist/commonjs/common/lib/utils/types.d.ts +0 -14
  260. package/ts3.5/dist/commonjs/header/index.d.ts +0 -9
  261. package/ts3.5/dist/commonjs/header/lib/GlobalHeader.d.ts +0 -38
  262. package/ts3.5/dist/commonjs/header/lib/Header.d.ts +0 -76
  263. package/ts3.5/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts +0 -30
  264. package/ts3.5/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts +0 -31
  265. package/ts3.5/dist/commonjs/header/lib/parts/index.d.ts +0 -3
  266. package/ts3.5/dist/commonjs/header/lib/shared/themes.d.ts +0 -43
  267. package/ts3.5/dist/commonjs/header/lib/shared/types.d.ts +0 -15
  268. package/ts3.5/dist/commonjs/layout/index.d.ts +0 -5
  269. package/ts3.5/dist/commonjs/layout/lib/Flex.d.ts +0 -26
  270. package/ts3.5/dist/commonjs/layout/lib/Stack.d.ts +0 -27
  271. package/ts3.5/dist/commonjs/layout/lib/utils/flex.d.ts +0 -36
  272. package/ts3.5/dist/commonjs/layout/lib/utils/getValidChildren.d.ts +0 -3
  273. package/ts3.5/dist/commonjs/layout/lib/utils/stack.d.ts +0 -26
  274. package/ts3.5/dist/commonjs/layout/lib/utils/types.d.ts +0 -8
  275. package/ts3.5/dist/es6/common/lib/Box.d.ts +0 -31
  276. package/ts3.5/dist/es6/common/lib/utils/border.d.ts +0 -103
  277. package/ts3.5/dist/es6/common/lib/utils/color.d.ts +0 -26
  278. package/ts3.5/dist/es6/common/lib/utils/depth.d.ts +0 -22
  279. package/ts3.5/dist/es6/common/lib/utils/flexItem.d.ts +0 -33
  280. package/ts3.5/dist/es6/common/lib/utils/layout.d.ts +0 -43
  281. package/ts3.5/dist/es6/common/lib/utils/other.d.ts +0 -5
  282. package/ts3.5/dist/es6/common/lib/utils/position.d.ts +0 -41
  283. package/ts3.5/dist/es6/common/lib/utils/space.d.ts +0 -64
  284. package/ts3.5/dist/es6/common/lib/utils/types.d.ts +0 -14
  285. package/ts3.5/dist/es6/header/index.d.ts +0 -9
  286. package/ts3.5/dist/es6/header/lib/GlobalHeader.d.ts +0 -38
  287. package/ts3.5/dist/es6/header/lib/Header.d.ts +0 -76
  288. package/ts3.5/dist/es6/header/lib/parts/DubLogoTitle.d.ts +0 -30
  289. package/ts3.5/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts +0 -31
  290. package/ts3.5/dist/es6/header/lib/parts/index.d.ts +0 -3
  291. package/ts3.5/dist/es6/header/lib/shared/themes.d.ts +0 -43
  292. package/ts3.5/dist/es6/header/lib/shared/types.d.ts +0 -15
  293. package/ts3.5/dist/es6/layout/index.d.ts +0 -5
  294. package/ts3.5/dist/es6/layout/lib/Flex.d.ts +0 -26
  295. package/ts3.5/dist/es6/layout/lib/Stack.d.ts +0 -27
  296. package/ts3.5/dist/es6/layout/lib/utils/flex.d.ts +0 -36
  297. package/ts3.5/dist/es6/layout/lib/utils/getValidChildren.d.ts +0 -3
  298. package/ts3.5/dist/es6/layout/lib/utils/stack.d.ts +0 -26
  299. package/ts3.5/dist/es6/layout/lib/utils/types.d.ts +0 -8
@@ -1,429 +0,0 @@
1
- import * as React from 'react';
2
- import {css} from '@emotion/core';
3
- import styled from '@emotion/styled';
4
- import {borderRadius, space, type} from '@workday/canvas-kit-react/tokens';
5
- import {DeprecatedDubLogoTitle, DeprecatedWorkdayLogoTitle} from './parts';
6
- import {deprecatedHeaderThemes} from './shared/themes';
7
- import {
8
- DeprecatedHeaderHeight,
9
- DeprecatedHeaderTheme,
10
- DeprecatedHeaderVariant,
11
- } from './shared/types';
12
- import {Hyperlink, IconButton, IconButtonProps} from '@workday/canvas-kit-react/button';
13
- import {SystemIcon, SystemIconProps} from '@workday/canvas-kit-react/icon';
14
- import {justifyIcon} from '@workday/canvas-system-icons-web';
15
- import {PickRequired} from '@workday/canvas-kit-react/common';
16
-
17
- export interface HeaderProps extends React.HTMLAttributes<HTMLDivElement> {
18
- /**
19
- * The custom menu toggle node of the Header. This React node replaces the default menu toggle.
20
- */
21
- menuToggle?: React.ReactNode;
22
- /**
23
- * The theme of the Header. Accepts `White`, `Blue`, or `Transparent`.
24
- * @default DeprecatedHeaderTheme.White
25
- */
26
- themeColor?: DeprecatedHeaderTheme;
27
- /**
28
- * The variant of the Header. Accepts `Dub` (small) or `Full` (large).
29
- * @default DeprecatedHeaderVariant.Dub
30
- */
31
- variant?: DeprecatedHeaderVariant;
32
- /**
33
- * The text of the Header title. Not used if `brand` is provided.
34
- */
35
- title?: string;
36
- /**
37
- * The custom brand node of the Header. This React node replaces the dub logo and title.
38
- */
39
- brand?: React.ReactNode;
40
- /**
41
- * The url of the Header logo link.
42
- */
43
- brandUrl?: string;
44
- /**
45
- * If true, center the Header navigation. If false, right-align the Header navigation.
46
- * @default false
47
- */
48
- centeredNav?: boolean;
49
- /**
50
- * The function called when the responsive menu icon is clicked.
51
- */
52
- onMenuClick?: (e: React.MouseEvent) => void;
53
- /**
54
- * The React element to render in the left slot of the Header. This is typically a SearchForm component.
55
- */
56
- leftSlot?: React.ReactElement;
57
- /**
58
- * If true, render the Header in collapsed mode.
59
- * @default false
60
- */
61
- isCollapsed?: boolean;
62
- }
63
-
64
- const childrenSpacing = space.s;
65
-
66
- const HeaderShell = styled('div')<PickRequired<HeaderProps, 'themeColor', 'variant'>>(
67
- {
68
- display: 'flex',
69
- alignItems: 'center',
70
- boxSizing: 'border-box',
71
- ...type.levels.subtext.large,
72
- WebkitFontSmoothing: 'antialiased',
73
- MozOsxFontSmoothing: 'grayscale',
74
- position: 'relative',
75
- },
76
- ({variant, themeColor}) => ({
77
- // Only the variant Full has a large header, all the other one (Dub, Global) have a small header height
78
- height:
79
- variant === DeprecatedHeaderVariant.Full
80
- ? DeprecatedHeaderHeight.Large
81
- : DeprecatedHeaderHeight.Small,
82
- background: deprecatedHeaderThemes[themeColor].background,
83
- ...deprecatedHeaderThemes[themeColor].depth,
84
- color: deprecatedHeaderThemes[themeColor].color,
85
- })
86
- );
87
-
88
- const BrandSlot = styled('div')(
89
- {
90
- height: '100%',
91
- },
92
- (props: {grow?: boolean}) => ({
93
- flex: props.grow ? `1 0 auto` : 'unset',
94
- })
95
- );
96
-
97
- const BrandLink = styled(Hyperlink)({
98
- '&:hover': {
99
- textDecoration: 'none',
100
- },
101
-
102
- '&:focus': {
103
- textDecoration: 'none',
104
- },
105
- });
106
-
107
- const navStyle = ({themeColor}: PickRequired<HeaderProps, 'themeColor', 'css'>) => {
108
- const theme = deprecatedHeaderThemes[themeColor];
109
-
110
- return css({
111
- nav: {
112
- display: 'flex',
113
- flex: `1 0 auto`, // Instead of just flex-grow: 1 for IE11, see https://github.com/philipwalton/flexbugs#flexbug-1
114
- justifyContent: 'center',
115
- height: 'inherit',
116
- marginLeft: space.xl,
117
-
118
- '& ul': {
119
- color: theme.linkColor,
120
- display: 'flex',
121
- alignItems: 'center',
122
- justifyContent: 'center',
123
- listStyleType: 'none',
124
- padding: 0,
125
- margin: 0,
126
- height: 'inherit',
127
- '&:hover': {
128
- // De-emphasizes all color on hover, this allows us to create an illusion that hovering over a specific element
129
- // fades out the rest
130
- color: theme.linkFadeOutColor,
131
- },
132
- '& li': {
133
- boxSizing: 'border-box',
134
- position: 'relative',
135
- display: 'flex',
136
- alignItems: 'center',
137
- fontSize: '14px',
138
- fontWeight: 700,
139
- height: 'inherit',
140
- transition: `color 150ms ease-out 0s`,
141
- cursor: 'pointer',
142
- '&:first-of-type > *': {
143
- marginLeft: 0,
144
- },
145
- '&:last-child > *': {
146
- marginRight: 0,
147
- },
148
- '& > *': {
149
- color: 'inherit',
150
- textDecoration: 'none',
151
- padding: `0px ${space.s}`,
152
- margin: `0 ${space.xxxs}`,
153
- display: 'flex',
154
- alignItems: 'center',
155
- height: 'inherit',
156
- '&:visited': {
157
- color: 'inherit', // Keeps visited links from becoming default purple
158
- },
159
- },
160
- '&:hover, &:active': {
161
- color: theme.linkColor, // Completes the illusion of sibling elements fading into the background on hover
162
- },
163
- '&.current': {
164
- color: theme.currentLinkColor,
165
- '& a': {
166
- cursor: 'default',
167
- },
168
- '&:hover, &:active': {
169
- color: theme.currentLinkColor,
170
- },
171
- '&:after': {
172
- position: 'absolute',
173
- bottom: 0,
174
- left: 0,
175
- content: `''`,
176
- height: 4,
177
- width: '100%',
178
- backgroundColor: theme.chipColor,
179
- borderRadius: `${borderRadius.m} ${borderRadius.m} 0 0`,
180
- },
181
- },
182
- },
183
- },
184
- },
185
- });
186
- };
187
-
188
- const ChildrenSlot = styled('div')<
189
- PickRequired<HeaderProps, 'themeColor', 'isCollapsed' | 'centeredNav'>
190
- >(
191
- {
192
- marginRight: space.m,
193
- // TODO: remove this when we get real icon buttons
194
- '> .canvas-header--menu-icon': {
195
- cursor: 'pointer',
196
- },
197
- display: 'flex',
198
- alignItems: 'center',
199
- justifyContent: 'flex-end',
200
- height: '100%',
201
- '> *': {
202
- marginLeft: childrenSpacing,
203
- },
204
- },
205
- ({centeredNav, isCollapsed}) => ({
206
- '> *:not(.canvas-header--menu-icon)': {
207
- display: isCollapsed ? 'none' : 'flex',
208
- },
209
- '> *:last-child': {
210
- marginRight: isCollapsed ? '' : 0,
211
- },
212
- flex: !isCollapsed && centeredNav ? `1 0 auto` : 'unset',
213
- }),
214
- navStyle
215
- );
216
-
217
- class Brand extends React.Component<
218
- Pick<HeaderProps, 'variant' | 'brand' | 'title' | 'themeColor'>
219
- > {
220
- render() {
221
- const {
222
- variant = DeprecatedHeaderVariant.Dub,
223
- brand,
224
- themeColor = DeprecatedHeaderTheme.White,
225
- title,
226
- } = this.props;
227
-
228
- switch (variant) {
229
- case DeprecatedHeaderVariant.Global: {
230
- return <span>{brand}</span>;
231
- }
232
- case DeprecatedHeaderVariant.Full: {
233
- return (
234
- <span>
235
- {brand || (
236
- <DeprecatedWorkdayLogoTitle title={title ? title : ''} themeColor={themeColor} />
237
- )}
238
- </span>
239
- );
240
- }
241
- // DeprecatedHeaderVariant.Dub is default
242
- default: {
243
- return (
244
- <span>
245
- {brand || <DeprecatedDubLogoTitle title={title ? title : ''} themeColor={themeColor} />}
246
- </span>
247
- );
248
- }
249
- }
250
- }
251
- }
252
-
253
- class MenuIconButton extends React.Component<
254
- Pick<HeaderProps, 'themeColor' | 'menuToggle' | 'onMenuClick'>
255
- > {
256
- render() {
257
- const {themeColor = DeprecatedHeaderTheme.White, menuToggle, onMenuClick} = this.props;
258
- if (menuToggle) {
259
- const menuToggleElement = menuToggle as React.ReactElement<any>;
260
- const onClick = menuToggleElement.props.onClick
261
- ? menuToggleElement.props.onClick
262
- : onMenuClick;
263
-
264
- return React.cloneElement(menuToggleElement, {
265
- onClick,
266
- className: 'canvas-header--menu-icon',
267
- });
268
- }
269
-
270
- return (
271
- <IconButton
272
- variant={themeColor === DeprecatedHeaderTheme.White ? 'circle' : 'inverse'}
273
- icon={justifyIcon}
274
- className={'canvas-header--menu-icon'}
275
- aria-label="Open Menu"
276
- onClick={onMenuClick}
277
- />
278
- );
279
- }
280
- }
281
-
282
- /**
283
- * ### Deprecated Header
284
- *
285
- * As of Canvas Kit v6, this component is being soft-deprecated.
286
- * It will be hard-deprecated (completely removed) in v7. Please see the
287
- * [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
288
- * for more information.
289
- */
290
- export default class Header extends React.Component<HeaderProps, {}> {
291
- static Theme = DeprecatedHeaderTheme;
292
- static Variant = DeprecatedHeaderVariant;
293
-
294
- componentDidMount() {
295
- console.warn(
296
- `Header is being deprecated and will be removed in Canvas Kit V7.\n
297
- For more information, please see the V6 migration guide:\n
298
- https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page
299
- `
300
- );
301
- }
302
-
303
- /**
304
- * Helper that recursively maps ReactNodes to their theme-based equivalent.
305
- * Any children that are included in a Header may need to undergo transformation
306
- * before stamped out in render().
307
- *
308
- * E.g. <SystemIcon> components need to have the appropriate `color` and `colorHover`
309
- * props set based on the theme.
310
- *
311
- * @param children From props.children of a React component
312
- *
313
- * @returns {React.ReactNode} The child/children to be rendered
314
- */
315
- private renderChildren(children: React.ReactNode): React.ReactNode {
316
- return React.Children.map(children, child => {
317
- if (!React.isValidElement(child)) {
318
- return child;
319
- }
320
-
321
- // child is now guaranteed to be a valid ReactElement from the check above
322
-
323
- type Props = {children: React.ReactNode};
324
- const propsChildren = (child as React.ReactElement<Props>).props.children;
325
- const singleChild =
326
- React.Children.count(propsChildren) === 1 && (propsChildren as React.ReactElement<any>);
327
- const iconButtonVariant =
328
- this.props.themeColor === DeprecatedHeaderTheme.White ? 'circle' : 'inverse';
329
-
330
- // Convert old method of SystemIcon into IconButton. If SystemIcon is within a link, make sure it's passed through
331
- if (child.type === 'a' && singleChild && singleChild.type === SystemIcon) {
332
- const href = (child.props as React.AnchorHTMLAttributes<HTMLAnchorElement>).href;
333
- const iconButtonProps = {
334
- onClick: () => {
335
- if (href) {
336
- window.location.href = href;
337
- }
338
- },
339
- variant: iconButtonVariant,
340
- icon: (singleChild.props as SystemIconProps).icon,
341
- } as const;
342
-
343
- return <IconButton {...iconButtonProps} aria-label="" />;
344
- }
345
-
346
- // If child has children, render them
347
- if (React.Children.count(propsChildren)) {
348
- return React.cloneElement(child as React.ReactElement<Props>, {
349
- children: this.renderChildren(propsChildren),
350
- });
351
- }
352
-
353
- // Convert old method of SystemIcon into IconButton
354
- if (child.type === SystemIcon) {
355
- const icon = (child.props as SystemIconProps).icon;
356
-
357
- return <IconButton variant={iconButtonVariant} icon={icon} aria-label={icon.name} />;
358
- }
359
-
360
- // Plain icon buttons have negative margin that we need to negate.
361
- if (child.type === IconButton && (child.props as IconButtonProps).variant === 'plain') {
362
- return React.cloneElement(child as React.ReactElement, {
363
- style: {margin: `0 0 0 ${childrenSpacing}`},
364
- });
365
- }
366
-
367
- return child;
368
- });
369
- }
370
-
371
- render() {
372
- const {
373
- menuToggle,
374
- themeColor = DeprecatedHeaderTheme.White,
375
- variant = DeprecatedHeaderVariant.Dub,
376
- centeredNav,
377
- title,
378
- brand,
379
- brandUrl,
380
- onMenuClick,
381
- leftSlot,
382
- isCollapsed,
383
- children,
384
- ...elemProps
385
- } = this.props;
386
-
387
- /* Push everything to the right if:
388
- - on tablet and mobile screens
389
- - Search isn't enabled and the nav shouldn't be centered
390
- - Search is enabled, and there aren't any children
391
- */
392
- const growBrand = isCollapsed || (!leftSlot && !centeredNav) || (leftSlot && !children);
393
-
394
- // Ignore centeredNav if search is enabled
395
- const shouldCenteredNav = leftSlot ? false : centeredNav;
396
-
397
- return (
398
- <HeaderShell variant={variant} themeColor={themeColor} {...elemProps}>
399
- <BrandSlot grow={growBrand}>
400
- {brandUrl ? (
401
- <BrandLink href={brandUrl}>
402
- <Brand variant={variant} brand={brand} title={title} themeColor={themeColor} />
403
- </BrandLink>
404
- ) : (
405
- <Brand variant={variant} brand={brand} title={title} themeColor={themeColor} />
406
- )}
407
- </BrandSlot>
408
- {leftSlot}
409
- <ChildrenSlot
410
- themeColor={themeColor}
411
- centeredNav={shouldCenteredNav}
412
- isCollapsed={isCollapsed}
413
- >
414
- {isCollapsed ? (
415
- // Screen size is smaller than our largest breakpoint so turn nav into a hamburger
416
- // TODO: This needs to get changed to IconButton when we get it restyled for headers
417
- <MenuIconButton
418
- themeColor={themeColor}
419
- menuToggle={menuToggle}
420
- onMenuClick={onMenuClick}
421
- />
422
- ) : (
423
- this.renderChildren(children)
424
- )}
425
- </ChildrenSlot>
426
- </HeaderShell>
427
- );
428
- }
429
- }
@@ -1,99 +0,0 @@
1
- import * as React from 'react';
2
- import styled from '@emotion/styled';
3
- import {colors, space} from '@workday/canvas-kit-react/tokens';
4
- import {DeprecatedHeaderHeight, DeprecatedHeaderTheme} from '../shared/types';
5
- import chroma from 'chroma-js';
6
- import {dubLogoWhite, dubLogoBlue} from '@workday/canvas-kit-react/common';
7
-
8
- export type DubTitleProps = {
9
- /**
10
- * The theme of the DubLogoTitle. Accepts `White`, `Blue`, or `Transparent`.
11
- * @default DeprecatedHeaderTheme.White
12
- */
13
- themeColor?: DeprecatedHeaderTheme;
14
- /**
15
- * The text of the DubLogoTitle. Not used if `brand` is provided.
16
- */
17
- title?: string;
18
- /**
19
- * The background color/gradient behind the DubLogoTitle logo.
20
- */
21
- bgColor?: string;
22
- };
23
-
24
- const LockupContainer = styled('div')({
25
- display: 'inline-block',
26
- });
27
-
28
- const Lockup = styled('div')<DubTitleProps>(
29
- {
30
- display: 'flex',
31
- alignItems: 'center',
32
- height: DeprecatedHeaderHeight.Small,
33
- paddingLeft: space.m,
34
- },
35
- ({bgColor}) => ({
36
- background: bgColor ? bgColor : 'none',
37
- })
38
- );
39
-
40
- const Title = styled('h3')<DubTitleProps>(
41
- {
42
- fontSize: '20px',
43
- fontWeight: 400,
44
- padding: `${space.xxs} ${space.s}`,
45
- paddingRight: space.l,
46
- marginLeft: space.s,
47
- whiteSpace: 'nowrap',
48
- },
49
- ({themeColor}) => ({
50
- color:
51
- themeColor === DeprecatedHeaderTheme.White ? colors.blueberry500 : colors.frenchVanilla100,
52
- borderLeft: `1px solid ${
53
- themeColor === DeprecatedHeaderTheme.White
54
- ? colors.soap400
55
- : chroma(colors.frenchVanilla100)
56
- .alpha(0.3)
57
- .css()
58
- }`,
59
- })
60
- );
61
-
62
- const DubLogo = styled('div')<DubTitleProps>({
63
- lineHeight: 0,
64
- });
65
-
66
- /**
67
- * ### Deprecated Dub Logo Title
68
- *
69
- * As of Canvas Kit v6, this component is being soft-deprecated.
70
- * It will be hard-deprecated (completely removed) in v7. Please see the
71
- * [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
72
- * for more information.
73
- */
74
- export class DeprecatedDubLogoTitle extends React.Component<DubTitleProps> {
75
- componentDidMount() {
76
- console.warn(
77
- `DubLogoTitle is being deprecated and will be removed in Canvas Kit V7.\n
78
- For more information, please see the V6 migration guide:\n
79
- https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page
80
- `
81
- );
82
- }
83
- render() {
84
- const {themeColor = DeprecatedHeaderTheme.White, title} = this.props;
85
- return (
86
- <LockupContainer>
87
- <Lockup {...this.props}>
88
- <DubLogo
89
- {...this.props}
90
- dangerouslySetInnerHTML={{
91
- __html: themeColor === DeprecatedHeaderTheme.White ? dubLogoBlue : dubLogoWhite,
92
- }}
93
- />
94
- {title && <Title {...this.props}>{title}</Title>}
95
- </Lockup>
96
- </LockupContainer>
97
- );
98
- }
99
- }
@@ -1,120 +0,0 @@
1
- import * as React from 'react';
2
- import styled from '@emotion/styled';
3
- import {
4
- DeprecatedHeaderHeight,
5
- DeprecatedHeaderTheme,
6
- DeprecatedHeaderVariant,
7
- } from '../shared/types';
8
- import {miniWdayLogoBlue, wdayLogoWhite, wdayLogoBlue} from '@workday/canvas-kit-react/common';
9
- import {colors, space} from '@workday/canvas-kit-react/tokens';
10
- import chroma from 'chroma-js';
11
-
12
- export type WorkdayLogoTitleProps = {
13
- /**
14
- * The theme of the WorkdayLogoTitle. Accepts `White`, `Blue`, or `Transparent`.
15
- * @default DeprecatedHeaderTheme.White
16
- */
17
- themeColor?: DeprecatedHeaderTheme;
18
- /**
19
- * The text of the WorkdayLogoTitle. Not used if `brand` is provided.
20
- * @default ''
21
- */
22
- title?: string;
23
- /**
24
- * The variant of the WorkdayLogoTitle.
25
- */
26
- variant?: DeprecatedHeaderVariant;
27
- };
28
-
29
- const LockupContainer = styled('div')({
30
- display: 'inline-block',
31
- });
32
-
33
- const Lockup = styled('div')<WorkdayLogoTitleProps>(
34
- {
35
- display: 'flex',
36
- alignItems: 'center',
37
- justifyContent: 'center',
38
- },
39
- ({variant}) => ({
40
- height:
41
- variant === DeprecatedHeaderVariant.Global
42
- ? DeprecatedHeaderHeight.Small
43
- : DeprecatedHeaderHeight.Large,
44
- })
45
- );
46
-
47
- const Title = styled('h3')<WorkdayLogoTitleProps>(
48
- {
49
- fontSize: '20px',
50
- fontWeight: 400,
51
- marginLeft: space.l,
52
- padding: space.s,
53
- paddingLeft: space.m,
54
- paddingRight: space.l,
55
- whiteSpace: 'nowrap',
56
- display: 'initial',
57
- },
58
- ({themeColor}) => ({
59
- color:
60
- themeColor === DeprecatedHeaderTheme.White ? colors.blueberry500 : colors.frenchVanilla100,
61
- borderLeft: `1px solid ${
62
- themeColor === DeprecatedHeaderTheme.White
63
- ? colors.soap400
64
- : chroma(colors.soap400)
65
- .alpha(0.4)
66
- .css()
67
- }`,
68
- })
69
- );
70
-
71
- const WorkdayLogo = styled('span')<WorkdayLogoTitleProps>({
72
- paddingLeft: space.m,
73
- lineHeight: 0,
74
- });
75
-
76
- /**
77
- * ### Deprecated Workday Logo Title
78
- *
79
- * As of Canvas Kit v6, this component is being soft-deprecated.
80
- * It will be hard-deprecated (completely removed) in v7. Please see the
81
- * [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
82
- * for more information.
83
- */
84
- export class DeprecatedWorkdayLogoTitle extends React.Component<WorkdayLogoTitleProps> {
85
- componentDidMount() {
86
- console.warn(
87
- `WorkdayLogoTitle is being deprecated and will be removed in Canvas Kit V7.\n
88
- For more information, please see the V6 migration guide:\n
89
- https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page
90
- `
91
- );
92
- }
93
- public render() {
94
- const {
95
- themeColor = DeprecatedHeaderTheme.White,
96
- title = '',
97
- variant,
98
- ...elemProps
99
- } = this.props;
100
-
101
- return (
102
- <LockupContainer>
103
- <Lockup {...this.props} {...elemProps}>
104
- <WorkdayLogo
105
- {...this.props}
106
- dangerouslySetInnerHTML={{
107
- __html:
108
- themeColor === DeprecatedHeaderTheme.White
109
- ? variant === DeprecatedHeaderVariant.Global
110
- ? miniWdayLogoBlue
111
- : wdayLogoBlue
112
- : wdayLogoWhite,
113
- }}
114
- />
115
- {title && <Title {...this.props}>{title}</Title>}
116
- </Lockup>
117
- </LockupContainer>
118
- );
119
- }
120
- }
@@ -1,2 +0,0 @@
1
- export {DeprecatedDubLogoTitle} from './DubLogoTitle';
2
- export {DeprecatedWorkdayLogoTitle} from './WorkdayLogoTitle';