@workday/canvas-kit-labs-react 5.3.0 → 5.3.4

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 (223) hide show
  1. package/common/lib/theming/index.ts +0 -1
  2. package/dist/commonjs/common/lib/theming/index.d.ts +0 -1
  3. package/dist/commonjs/common/lib/theming/index.d.ts.map +1 -1
  4. package/dist/commonjs/common/lib/theming/index.js +0 -1
  5. package/dist/commonjs/header/index.d.ts +5 -5
  6. package/dist/commonjs/header/index.d.ts.map +1 -1
  7. package/dist/commonjs/header/index.js +2 -2
  8. package/dist/commonjs/header/lib/GlobalHeader.d.ts +2 -11
  9. package/dist/commonjs/header/lib/GlobalHeader.d.ts.map +1 -1
  10. package/dist/commonjs/header/lib/GlobalHeader.js +8 -19
  11. package/dist/commonjs/header/lib/Header.d.ts +8 -17
  12. package/dist/commonjs/header/lib/Header.d.ts.map +1 -1
  13. package/dist/commonjs/header/lib/Header.js +14 -27
  14. package/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts +4 -13
  15. package/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts.map +1 -1
  16. package/dist/commonjs/header/lib/parts/DubLogoTitle.js +11 -22
  17. package/dist/commonjs/{search-form/lib/SearchForm.d.ts → header/lib/parts/SearchBar.d.ts} +23 -22
  18. package/dist/commonjs/header/lib/parts/SearchBar.d.ts.map +1 -0
  19. package/dist/commonjs/{search-form/lib/SearchForm.js → header/lib/parts/SearchBar.js} +14 -13
  20. package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts +5 -14
  21. package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts.map +1 -1
  22. package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.js +12 -25
  23. package/dist/commonjs/header/lib/parts/index.d.ts +3 -2
  24. package/dist/commonjs/header/lib/parts/index.d.ts.map +1 -1
  25. package/dist/commonjs/header/lib/parts/index.js +4 -2
  26. package/dist/commonjs/header/lib/shared/themes.d.ts +19 -28
  27. package/dist/commonjs/header/lib/shared/themes.d.ts.map +1 -1
  28. package/dist/commonjs/header/lib/shared/themes.js +36 -13
  29. package/dist/commonjs/header/lib/shared/types.d.ts +8 -3
  30. package/dist/commonjs/header/lib/shared/types.d.ts.map +1 -1
  31. package/dist/commonjs/header/lib/shared/types.js +23 -17
  32. package/dist/commonjs/index.d.ts +0 -2
  33. package/dist/commonjs/index.d.ts.map +1 -1
  34. package/dist/commonjs/index.js +0 -2
  35. package/dist/commonjs/layout/lib/utils/getValidChildren.d.ts +1 -1
  36. package/dist/commonjs/layout/lib/utils/getValidChildren.d.ts.map +1 -1
  37. package/dist/es6/common/lib/theming/index.d.ts +0 -1
  38. package/dist/es6/common/lib/theming/index.d.ts.map +1 -1
  39. package/dist/es6/common/lib/theming/index.js +0 -1
  40. package/dist/es6/header/index.d.ts +5 -5
  41. package/dist/es6/header/index.d.ts.map +1 -1
  42. package/dist/es6/header/index.js +5 -5
  43. package/dist/es6/header/lib/GlobalHeader.d.ts +2 -11
  44. package/dist/es6/header/lib/GlobalHeader.d.ts.map +1 -1
  45. package/dist/es6/header/lib/GlobalHeader.js +11 -22
  46. package/dist/es6/header/lib/Header.d.ts +8 -17
  47. package/dist/es6/header/lib/Header.d.ts.map +1 -1
  48. package/dist/es6/header/lib/Header.js +17 -30
  49. package/dist/es6/header/lib/parts/DubLogoTitle.d.ts +4 -13
  50. package/dist/es6/header/lib/parts/DubLogoTitle.d.ts.map +1 -1
  51. package/dist/es6/header/lib/parts/DubLogoTitle.js +12 -23
  52. package/dist/es6/{search-form/lib/SearchForm.d.ts → header/lib/parts/SearchBar.d.ts} +23 -22
  53. package/dist/es6/header/lib/parts/SearchBar.d.ts.map +1 -0
  54. package/dist/es6/{search-form/lib/SearchForm.js → header/lib/parts/SearchBar.js} +12 -11
  55. package/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts +5 -14
  56. package/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts.map +1 -1
  57. package/dist/es6/header/lib/parts/WorkdayLogoTitle.js +13 -26
  58. package/dist/es6/header/lib/parts/index.d.ts +3 -2
  59. package/dist/es6/header/lib/parts/index.d.ts.map +1 -1
  60. package/dist/es6/header/lib/parts/index.js +3 -2
  61. package/dist/es6/header/lib/shared/themes.d.ts +19 -28
  62. package/dist/es6/header/lib/shared/themes.d.ts.map +1 -1
  63. package/dist/es6/header/lib/shared/themes.js +37 -14
  64. package/dist/es6/header/lib/shared/types.d.ts +8 -3
  65. package/dist/es6/header/lib/shared/types.d.ts.map +1 -1
  66. package/dist/es6/header/lib/shared/types.js +23 -17
  67. package/dist/es6/index.d.ts +0 -2
  68. package/dist/es6/index.d.ts.map +1 -1
  69. package/dist/es6/index.js +0 -2
  70. package/dist/es6/layout/lib/utils/getValidChildren.d.ts +1 -1
  71. package/dist/es6/layout/lib/utils/getValidChildren.d.ts.map +1 -1
  72. package/header/README.md +181 -37
  73. package/header/index.ts +5 -5
  74. package/header/lib/GlobalHeader.tsx +9 -26
  75. package/header/lib/Header.tsx +26 -58
  76. package/header/lib/parts/DubLogoTitle.tsx +9 -26
  77. package/{search-form/lib/SearchForm.tsx → header/lib/parts/SearchBar.tsx} +31 -30
  78. package/header/lib/parts/WorkdayLogoTitle.tsx +11 -40
  79. package/header/lib/parts/index.ts +3 -2
  80. package/header/lib/shared/themes.tsx +56 -32
  81. package/header/lib/shared/types.tsx +9 -3
  82. package/index.ts +0 -2
  83. package/package.json +5 -7
  84. package/ts3.5/dist/commonjs/common/lib/theming/index.d.ts +0 -1
  85. package/ts3.5/dist/commonjs/header/index.d.ts +5 -5
  86. package/ts3.5/dist/commonjs/header/lib/GlobalHeader.d.ts +2 -11
  87. package/ts3.5/dist/commonjs/header/lib/Header.d.ts +8 -17
  88. package/ts3.5/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts +4 -13
  89. package/ts3.5/dist/{es6/search-form/lib/SearchForm.d.ts → commonjs/header/lib/parts/SearchBar.d.ts} +23 -22
  90. package/ts3.5/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts +5 -14
  91. package/ts3.5/dist/commonjs/header/lib/parts/index.d.ts +3 -2
  92. package/ts3.5/dist/commonjs/header/lib/shared/themes.d.ts +19 -28
  93. package/ts3.5/dist/commonjs/header/lib/shared/types.d.ts +8 -3
  94. package/ts3.5/dist/commonjs/index.d.ts +0 -2
  95. package/ts3.5/dist/commonjs/layout/lib/utils/getValidChildren.d.ts +1 -1
  96. package/ts3.5/dist/es6/common/lib/theming/index.d.ts +0 -1
  97. package/ts3.5/dist/es6/header/index.d.ts +5 -5
  98. package/ts3.5/dist/es6/header/lib/GlobalHeader.d.ts +2 -11
  99. package/ts3.5/dist/es6/header/lib/Header.d.ts +8 -17
  100. package/ts3.5/dist/es6/header/lib/parts/DubLogoTitle.d.ts +4 -13
  101. package/ts3.5/dist/{commonjs/search-form/lib/SearchForm.d.ts → es6/header/lib/parts/SearchBar.d.ts} +23 -22
  102. package/ts3.5/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts +5 -14
  103. package/ts3.5/dist/es6/header/lib/parts/index.d.ts +3 -2
  104. package/ts3.5/dist/es6/header/lib/shared/themes.d.ts +19 -28
  105. package/ts3.5/dist/es6/header/lib/shared/types.d.ts +8 -3
  106. package/ts3.5/dist/es6/index.d.ts +0 -2
  107. package/ts3.5/dist/es6/layout/lib/utils/getValidChildren.d.ts +1 -1
  108. package/common/lib/theming/useThemedRing.ts +0 -84
  109. package/dist/commonjs/common/lib/theming/useThemedRing.d.ts +0 -11
  110. package/dist/commonjs/common/lib/theming/useThemedRing.d.ts.map +0 -1
  111. package/dist/commonjs/common/lib/theming/useThemedRing.js +0 -61
  112. package/dist/commonjs/search-form/index.d.ts +0 -3
  113. package/dist/commonjs/search-form/index.d.ts.map +0 -1
  114. package/dist/commonjs/search-form/index.js +0 -7
  115. package/dist/commonjs/search-form/lib/SearchForm.d.ts.map +0 -1
  116. package/dist/commonjs/search-form/lib/themes.d.ts +0 -21
  117. package/dist/commonjs/search-form/lib/themes.d.ts.map +0 -1
  118. package/dist/commonjs/search-form/lib/themes.js +0 -41
  119. package/dist/commonjs/text-input/index.d.ts +0 -7
  120. package/dist/commonjs/text-input/index.d.ts.map +0 -1
  121. package/dist/commonjs/text-input/index.js +0 -11
  122. package/dist/commonjs/text-input/lib/TextInput.d.ts +0 -21
  123. package/dist/commonjs/text-input/lib/TextInput.d.ts.map +0 -1
  124. package/dist/commonjs/text-input/lib/TextInput.js +0 -36
  125. package/dist/commonjs/text-input/lib/TextInputField.d.ts +0 -8
  126. package/dist/commonjs/text-input/lib/TextInputField.d.ts.map +0 -1
  127. package/dist/commonjs/text-input/lib/TextInputField.js +0 -66
  128. package/dist/commonjs/text-input/lib/TextInputHint.d.ts +0 -13
  129. package/dist/commonjs/text-input/lib/TextInputHint.d.ts.map +0 -1
  130. package/dist/commonjs/text-input/lib/TextInputHint.js +0 -46
  131. package/dist/commonjs/text-input/lib/TextInputLabel.d.ts +0 -17
  132. package/dist/commonjs/text-input/lib/TextInputLabel.d.ts.map +0 -1
  133. package/dist/commonjs/text-input/lib/TextInputLabel.js +0 -54
  134. package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +0 -19
  135. package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts.map +0 -1
  136. package/dist/commonjs/text-input/lib/hooks/useTextInputField.js +0 -16
  137. package/dist/commonjs/text-input/lib/hooks/useTextInputHint.d.ts +0 -15
  138. package/dist/commonjs/text-input/lib/hooks/useTextInputHint.d.ts.map +0 -1
  139. package/dist/commonjs/text-input/lib/hooks/useTextInputHint.js +0 -12
  140. package/dist/commonjs/text-input/lib/hooks/useTextInputLabel.d.ts +0 -15
  141. package/dist/commonjs/text-input/lib/hooks/useTextInputLabel.d.ts.map +0 -1
  142. package/dist/commonjs/text-input/lib/hooks/useTextInputLabel.js +0 -12
  143. package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +0 -17
  144. package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts.map +0 -1
  145. package/dist/commonjs/text-input/lib/hooks/useTextInputModel.js +0 -23
  146. package/dist/es6/common/lib/theming/useThemedRing.d.ts +0 -11
  147. package/dist/es6/common/lib/theming/useThemedRing.d.ts.map +0 -1
  148. package/dist/es6/common/lib/theming/useThemedRing.js +0 -55
  149. package/dist/es6/search-form/index.d.ts +0 -3
  150. package/dist/es6/search-form/index.d.ts.map +0 -1
  151. package/dist/es6/search-form/index.js +0 -2
  152. package/dist/es6/search-form/lib/SearchForm.d.ts.map +0 -1
  153. package/dist/es6/search-form/lib/themes.d.ts +0 -21
  154. package/dist/es6/search-form/lib/themes.d.ts.map +0 -1
  155. package/dist/es6/search-form/lib/themes.js +0 -39
  156. package/dist/es6/text-input/index.d.ts +0 -7
  157. package/dist/es6/text-input/index.d.ts.map +0 -1
  158. package/dist/es6/text-input/index.js +0 -6
  159. package/dist/es6/text-input/lib/TextInput.d.ts +0 -21
  160. package/dist/es6/text-input/lib/TextInput.d.ts.map +0 -1
  161. package/dist/es6/text-input/lib/TextInput.js +0 -31
  162. package/dist/es6/text-input/lib/TextInputField.d.ts +0 -8
  163. package/dist/es6/text-input/lib/TextInputField.d.ts.map +0 -1
  164. package/dist/es6/text-input/lib/TextInputField.js +0 -64
  165. package/dist/es6/text-input/lib/TextInputHint.d.ts +0 -13
  166. package/dist/es6/text-input/lib/TextInputHint.d.ts.map +0 -1
  167. package/dist/es6/text-input/lib/TextInputHint.js +0 -44
  168. package/dist/es6/text-input/lib/TextInputLabel.d.ts +0 -17
  169. package/dist/es6/text-input/lib/TextInputLabel.d.ts.map +0 -1
  170. package/dist/es6/text-input/lib/TextInputLabel.js +0 -52
  171. package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +0 -19
  172. package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts.map +0 -1
  173. package/dist/es6/text-input/lib/hooks/useTextInputField.js +0 -14
  174. package/dist/es6/text-input/lib/hooks/useTextInputHint.d.ts +0 -15
  175. package/dist/es6/text-input/lib/hooks/useTextInputHint.d.ts.map +0 -1
  176. package/dist/es6/text-input/lib/hooks/useTextInputHint.js +0 -10
  177. package/dist/es6/text-input/lib/hooks/useTextInputLabel.d.ts +0 -15
  178. package/dist/es6/text-input/lib/hooks/useTextInputLabel.d.ts.map +0 -1
  179. package/dist/es6/text-input/lib/hooks/useTextInputLabel.js +0 -10
  180. package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +0 -17
  181. package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts.map +0 -1
  182. package/dist/es6/text-input/lib/hooks/useTextInputModel.js +0 -21
  183. package/search-form/LICENSE +0 -52
  184. package/search-form/README.md +0 -6
  185. package/search-form/index.ts +0 -2
  186. package/search-form/lib/themes.ts +0 -54
  187. package/search-form/package.json +0 -5
  188. package/text-input/LICENSE +0 -52
  189. package/text-input/README.md +0 -11
  190. package/text-input/index.ts +0 -6
  191. package/text-input/lib/TextInput.tsx +0 -34
  192. package/text-input/lib/TextInputField.tsx +0 -75
  193. package/text-input/lib/TextInputHint.tsx +0 -52
  194. package/text-input/lib/TextInputLabel.tsx +0 -74
  195. package/text-input/lib/hooks/useTextInputField.tsx +0 -15
  196. package/text-input/lib/hooks/useTextInputHint.tsx +0 -11
  197. package/text-input/lib/hooks/useTextInputLabel.tsx +0 -11
  198. package/text-input/lib/hooks/useTextInputModel.tsx +0 -45
  199. package/text-input/package.json +0 -5
  200. package/ts3.5/dist/commonjs/common/lib/theming/useThemedRing.d.ts +0 -11
  201. package/ts3.5/dist/commonjs/search-form/index.d.ts +0 -3
  202. package/ts3.5/dist/commonjs/search-form/lib/themes.d.ts +0 -21
  203. package/ts3.5/dist/commonjs/text-input/index.d.ts +0 -7
  204. package/ts3.5/dist/commonjs/text-input/lib/TextInput.d.ts +0 -21
  205. package/ts3.5/dist/commonjs/text-input/lib/TextInputField.d.ts +0 -8
  206. package/ts3.5/dist/commonjs/text-input/lib/TextInputHint.d.ts +0 -13
  207. package/ts3.5/dist/commonjs/text-input/lib/TextInputLabel.d.ts +0 -17
  208. package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +0 -19
  209. package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputHint.d.ts +0 -15
  210. package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputLabel.d.ts +0 -15
  211. package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +0 -17
  212. package/ts3.5/dist/es6/common/lib/theming/useThemedRing.d.ts +0 -11
  213. package/ts3.5/dist/es6/search-form/index.d.ts +0 -3
  214. package/ts3.5/dist/es6/search-form/lib/themes.d.ts +0 -21
  215. package/ts3.5/dist/es6/text-input/index.d.ts +0 -7
  216. package/ts3.5/dist/es6/text-input/lib/TextInput.d.ts +0 -21
  217. package/ts3.5/dist/es6/text-input/lib/TextInputField.d.ts +0 -8
  218. package/ts3.5/dist/es6/text-input/lib/TextInputHint.d.ts +0 -13
  219. package/ts3.5/dist/es6/text-input/lib/TextInputLabel.d.ts +0 -17
  220. package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +0 -19
  221. package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputHint.d.ts +0 -15
  222. package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputLabel.d.ts +0 -15
  223. package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +0 -17
@@ -2,13 +2,9 @@ import * as React from 'react';
2
2
  import {css} from '@emotion/core';
3
3
  import styled from '@emotion/styled';
4
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';
5
+ import {DubLogoTitle, WorkdayLogoTitle} from './parts';
6
+ import {themes} from './shared/themes';
7
+ import {HeaderHeight, HeaderTheme, HeaderVariant} from './shared/types';
12
8
  import {Hyperlink, IconButton, IconButtonProps} from '@workday/canvas-kit-react/button';
13
9
  import {SystemIcon, SystemIconProps} from '@workday/canvas-kit-react/icon';
14
10
  import {justifyIcon} from '@workday/canvas-system-icons-web';
@@ -21,14 +17,14 @@ export interface HeaderProps extends React.HTMLAttributes<HTMLDivElement> {
21
17
  menuToggle?: React.ReactNode;
22
18
  /**
23
19
  * The theme of the Header. Accepts `White`, `Blue`, or `Transparent`.
24
- * @default DeprecatedHeaderTheme.White
20
+ * @default HeaderTheme.White
25
21
  */
26
- themeColor?: DeprecatedHeaderTheme;
22
+ themeColor?: HeaderTheme;
27
23
  /**
28
24
  * The variant of the Header. Accepts `Dub` (small) or `Full` (large).
29
- * @default DeprecatedHeaderVariant.Dub
25
+ * @default HeaderVariant.Dub
30
26
  */
31
- variant?: DeprecatedHeaderVariant;
27
+ variant?: HeaderVariant;
32
28
  /**
33
29
  * The text of the Header title. Not used if `brand` is provided.
34
30
  */
@@ -51,7 +47,7 @@ export interface HeaderProps extends React.HTMLAttributes<HTMLDivElement> {
51
47
  */
52
48
  onMenuClick?: (e: React.MouseEvent) => void;
53
49
  /**
54
- * The React element to render in the left slot of the Header. This is typically a SearchForm component.
50
+ * The React element to render in the left slot of the Header. This is typically a SearchBar component.
55
51
  */
56
52
  leftSlot?: React.ReactElement;
57
53
  /**
@@ -75,13 +71,10 @@ const HeaderShell = styled('div')<PickRequired<HeaderProps, 'themeColor', 'varia
75
71
  },
76
72
  ({variant, themeColor}) => ({
77
73
  // 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,
74
+ height: variant === HeaderVariant.Full ? HeaderHeight.Large : HeaderHeight.Small,
75
+ background: themes[themeColor].background,
76
+ ...themes[themeColor].depth,
77
+ color: themes[themeColor].color,
85
78
  })
86
79
  );
87
80
 
@@ -105,7 +98,7 @@ const BrandLink = styled(Hyperlink)({
105
98
  });
106
99
 
107
100
  const navStyle = ({themeColor}: PickRequired<HeaderProps, 'themeColor', 'css'>) => {
108
- const theme = deprecatedHeaderThemes[themeColor];
101
+ const theme = themes[themeColor];
109
102
 
110
103
  return css({
111
104
  nav: {
@@ -218,31 +211,24 @@ class Brand extends React.Component<
218
211
  Pick<HeaderProps, 'variant' | 'brand' | 'title' | 'themeColor'>
219
212
  > {
220
213
  render() {
221
- const {
222
- variant = DeprecatedHeaderVariant.Dub,
223
- brand,
224
- themeColor = DeprecatedHeaderTheme.White,
225
- title,
226
- } = this.props;
214
+ const {variant = HeaderVariant.Dub, brand, themeColor = HeaderTheme.White, title} = this.props;
227
215
 
228
216
  switch (variant) {
229
- case DeprecatedHeaderVariant.Global: {
217
+ case HeaderVariant.Global: {
230
218
  return <span>{brand}</span>;
231
219
  }
232
- case DeprecatedHeaderVariant.Full: {
220
+ case HeaderVariant.Full: {
233
221
  return (
234
222
  <span>
235
- {brand || (
236
- <DeprecatedWorkdayLogoTitle title={title ? title : ''} themeColor={themeColor} />
237
- )}
223
+ {brand || <WorkdayLogoTitle title={title ? title : ''} themeColor={themeColor} />}
238
224
  </span>
239
225
  );
240
226
  }
241
- // DeprecatedHeaderVariant.Dub is default
227
+ // HeaderVariant.Dub is default
242
228
  default: {
243
229
  return (
244
230
  <span>
245
- {brand || <DeprecatedDubLogoTitle title={title ? title : ''} themeColor={themeColor} />}
231
+ {brand || <DubLogoTitle title={title ? title : ''} themeColor={themeColor} />}
246
232
  </span>
247
233
  );
248
234
  }
@@ -254,7 +240,7 @@ class MenuIconButton extends React.Component<
254
240
  Pick<HeaderProps, 'themeColor' | 'menuToggle' | 'onMenuClick'>
255
241
  > {
256
242
  render() {
257
- const {themeColor = DeprecatedHeaderTheme.White, menuToggle, onMenuClick} = this.props;
243
+ const {themeColor = HeaderTheme.White, menuToggle, onMenuClick} = this.props;
258
244
  if (menuToggle) {
259
245
  const menuToggleElement = menuToggle as React.ReactElement<any>;
260
246
  const onClick = menuToggleElement.props.onClick
@@ -269,7 +255,7 @@ class MenuIconButton extends React.Component<
269
255
 
270
256
  return (
271
257
  <IconButton
272
- variant={themeColor === DeprecatedHeaderTheme.White ? 'circle' : 'inverse'}
258
+ variant={themeColor === HeaderTheme.White ? 'circle' : 'inverse'}
273
259
  icon={justifyIcon}
274
260
  className={'canvas-header--menu-icon'}
275
261
  aria-label="Open Menu"
@@ -279,26 +265,9 @@ class MenuIconButton extends React.Component<
279
265
  }
280
266
  }
281
267
 
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
268
  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
- }
269
+ static Theme = HeaderTheme;
270
+ static Variant = HeaderVariant;
302
271
 
303
272
  /**
304
273
  * Helper that recursively maps ReactNodes to their theme-based equivalent.
@@ -324,8 +293,7 @@ export default class Header extends React.Component<HeaderProps, {}> {
324
293
  const propsChildren = (child as React.ReactElement<Props>).props.children;
325
294
  const singleChild =
326
295
  React.Children.count(propsChildren) === 1 && (propsChildren as React.ReactElement<any>);
327
- const iconButtonVariant =
328
- this.props.themeColor === DeprecatedHeaderTheme.White ? 'circle' : 'inverse';
296
+ const iconButtonVariant = this.props.themeColor === HeaderTheme.White ? 'circle' : 'inverse';
329
297
 
330
298
  // Convert old method of SystemIcon into IconButton. If SystemIcon is within a link, make sure it's passed through
331
299
  if (child.type === 'a' && singleChild && singleChild.type === SystemIcon) {
@@ -371,8 +339,8 @@ export default class Header extends React.Component<HeaderProps, {}> {
371
339
  render() {
372
340
  const {
373
341
  menuToggle,
374
- themeColor = DeprecatedHeaderTheme.White,
375
- variant = DeprecatedHeaderVariant.Dub,
342
+ themeColor = HeaderTheme.White,
343
+ variant = HeaderVariant.Dub,
376
344
  centeredNav,
377
345
  title,
378
346
  brand,
@@ -1,16 +1,16 @@
1
1
  import * as React from 'react';
2
2
  import styled from '@emotion/styled';
3
3
  import {colors, space} from '@workday/canvas-kit-react/tokens';
4
- import {DeprecatedHeaderHeight, DeprecatedHeaderTheme} from '../shared/types';
4
+ import {HeaderHeight, HeaderTheme} from '../shared/types';
5
5
  import chroma from 'chroma-js';
6
6
  import {dubLogoWhite, dubLogoBlue} from '@workday/canvas-kit-react/common';
7
7
 
8
8
  export type DubTitleProps = {
9
9
  /**
10
10
  * The theme of the DubLogoTitle. Accepts `White`, `Blue`, or `Transparent`.
11
- * @default DeprecatedHeaderTheme.White
11
+ * @default HeaderTheme.White
12
12
  */
13
- themeColor?: DeprecatedHeaderTheme;
13
+ themeColor?: HeaderTheme;
14
14
  /**
15
15
  * The text of the DubLogoTitle. Not used if `brand` is provided.
16
16
  */
@@ -29,7 +29,7 @@ const Lockup = styled('div')<DubTitleProps>(
29
29
  {
30
30
  display: 'flex',
31
31
  alignItems: 'center',
32
- height: DeprecatedHeaderHeight.Small,
32
+ height: HeaderHeight.Small,
33
33
  paddingLeft: space.m,
34
34
  },
35
35
  ({bgColor}) => ({
@@ -47,10 +47,9 @@ const Title = styled('h3')<DubTitleProps>(
47
47
  whiteSpace: 'nowrap',
48
48
  },
49
49
  ({themeColor}) => ({
50
- color:
51
- themeColor === DeprecatedHeaderTheme.White ? colors.blueberry500 : colors.frenchVanilla100,
50
+ color: themeColor === HeaderTheme.White ? colors.blueberry500 : colors.frenchVanilla100,
52
51
  borderLeft: `1px solid ${
53
- themeColor === DeprecatedHeaderTheme.White
52
+ themeColor === HeaderTheme.White
54
53
  ? colors.soap400
55
54
  : chroma(colors.frenchVanilla100)
56
55
  .alpha(0.3)
@@ -63,32 +62,16 @@ const DubLogo = styled('div')<DubTitleProps>({
63
62
  lineHeight: 0,
64
63
  });
65
64
 
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
- }
65
+ export class DubLogoTitle extends React.Component<DubTitleProps> {
83
66
  render() {
84
- const {themeColor = DeprecatedHeaderTheme.White, title} = this.props;
67
+ const {themeColor = HeaderTheme.White, title} = this.props;
85
68
  return (
86
69
  <LockupContainer>
87
70
  <Lockup {...this.props}>
88
71
  <DubLogo
89
72
  {...this.props}
90
73
  dangerouslySetInnerHTML={{
91
- __html: themeColor === DeprecatedHeaderTheme.White ? dubLogoBlue : dubLogoWhite,
74
+ __html: themeColor === HeaderTheme.White ? dubLogoBlue : dubLogoWhite,
92
75
  }}
93
76
  />
94
77
  {title && <Title {...this.props}>{title}</Title>}
@@ -8,26 +8,27 @@ import {FormField, FormFieldLabelPosition} from '@workday/canvas-kit-react/form-
8
8
  import {Combobox} from '@workday/canvas-kit-labs-react/combobox';
9
9
  import {TextInput} from '@workday/canvas-kit-react/text-input';
10
10
  import {MenuItemProps} from '@workday/canvas-kit-preview-react/menu';
11
- import {SearchThemeAttributes, searchThemes, SearchTheme} from './themes';
11
+ import {SearchThemeAttributes, searchThemes} from '../shared/themes';
12
+ import {SearchTheme} from '../shared/types';
12
13
  import chroma from 'chroma-js';
13
14
  import uuid from 'uuid/v4';
14
15
 
15
- export interface SearchFormProps extends GrowthBehavior, React.FormHTMLAttributes<HTMLFormElement> {
16
+ export interface SearchBarProps extends GrowthBehavior, React.FormHTMLAttributes<HTMLFormElement> {
16
17
  /**
17
- * The function called when the SearchForm form is submitted. The current input value is passed to the callback function.
18
+ * The function called when the SearchBar form is submitted. The current input value is passed to the callback function.
18
19
  */
19
20
  onSubmit: React.FormEventHandler<HTMLFormElement>;
20
21
  /**
21
- * If true, collapse the SearchForm text input into a toggle icon. Useful for responsive layouts.
22
+ * If true, collapse the SearchBar text input into a toggle icon. Useful for responsive layouts.
22
23
  * @default false
23
24
  */
24
25
  isCollapsed?: boolean;
25
26
  /**
26
- * The function called when the SearchForm text input changes.
27
+ * The function called when the SearchBar text input changes.
27
28
  */
28
29
  onInputChange?: React.ChangeEventHandler<HTMLInputElement>;
29
30
  /**
30
- * The autocomplete items of the SearchForm. This array of menu items is shown under the search bar.
31
+ * The autocomplete items of the SearchBar. This array of menu items is shown under the search bar.
31
32
  */
32
33
  autocompleteItems?: React.ReactElement<MenuItemProps>[];
33
34
  /**
@@ -35,57 +36,57 @@ export interface SearchFormProps extends GrowthBehavior, React.FormHTMLAttribute
35
36
  */
36
37
  searchTheme?: SearchTheme | SearchThemeAttributes;
37
38
  /**
38
- * The placeholder text of the SearchForm text input.
39
+ * The placeholder text of the SearchBar text input.
39
40
  * @default Search
40
41
  */
41
42
  placeholder?: string;
42
43
  /**
43
- * The initial value of the SearchForm text input.
44
+ * The initial value of the SearchBar text input.
44
45
  */
45
46
  initialValue?: string;
46
47
  /**
47
- * If true, right-align the SearchForm. If false, the text input should grow to left-align the SearchForm.
48
+ * If true, right-align the SearchBar. If false, the text input should grow to left-align the SearchBar.
48
49
  * @default false
49
50
  */
50
51
  rightAlign?: boolean;
51
52
  /**
52
- * The screenreader label text for the SearchForm text input.
53
+ * The screenreader label text for the SearchBar text input.
53
54
  * @default Search
54
55
  */
55
56
  inputLabel?: string;
56
57
  /**
57
- * The screenreader label text for the SearchForm submit button.
58
+ * The screenreader label text for the SearchBar submit button.
58
59
  * @default Search
59
60
  */
60
61
  submitAriaLabel?: string;
61
62
  /**
62
- * The screenreader label text for the SearchForm clear button.
63
+ * The screenreader label text for the SearchBar clear button.
63
64
  * @default Reset Search Form
64
65
  */
65
66
  clearButtonAriaLabel?: string;
66
67
  /**
67
- * The screenreader label text for the button to open the collapsed SearchForm.
68
+ * The screenreader label text for the button to open the collapsed SearchBar.
68
69
  * @default Open Search
69
70
  */
70
71
  openButtonAriaLabel?: string;
71
72
  /**
72
- * The screenreader label text for the button to close the open SearchForm.
73
+ * The screenreader label text for the button to close the open SearchBar.
73
74
  * @default Cancel
74
75
  */
75
76
  closeButtonAriaLabel?: string;
76
77
  /**
77
- * If true, render the SearchForm with a button to clear the text input.
78
+ * If true, render the SearchBar with a button to clear the text input.
78
79
  * @default true
79
80
  */
80
81
  showClearButton?: boolean;
81
82
  /**
82
- * Height of the Search Form in pixels
83
- * @default 40
83
+ * Height of the Search Bar in pixels
84
+ * @default: 40
84
85
  */
85
86
  height?: number;
86
87
  }
87
88
 
88
- export interface SearchFormState {
89
+ export interface SearchBarState {
89
90
  showForm: boolean;
90
91
  searchQuery: string;
91
92
  isFocused: boolean;
@@ -109,8 +110,8 @@ const formCollapsedBackground = colors.frenchVanilla100;
109
110
  const maxWidth = 480;
110
111
  const minWidth = 120;
111
112
 
112
- const StyledSearchForm = styled('form')<
113
- Pick<SearchFormProps, 'isCollapsed' | 'rightAlign' | 'grow'> & Pick<SearchFormState, 'showForm'>
113
+ const SearchForm = styled('form')<
114
+ Pick<SearchBarProps, 'isCollapsed' | 'rightAlign' | 'grow'> & Pick<SearchBarState, 'showForm'>
114
115
  >(
115
116
  {
116
117
  position: 'relative',
@@ -147,7 +148,7 @@ const StyledSearchForm = styled('form')<
147
148
  }
148
149
  );
149
150
 
150
- const SearchContainer = styled('div')<Pick<SearchFormProps, 'height'>>(
151
+ const SearchContainer = styled('div')<Pick<SearchBarProps, 'height'>>(
151
152
  {
152
153
  position: `relative`,
153
154
  display: 'flex',
@@ -165,7 +166,7 @@ const SearchCombobox = styled(Combobox)({
165
166
  width: `100%`,
166
167
  });
167
168
 
168
- const SearchIcon = styled(IconButton)<Pick<SearchFormProps, 'isCollapsed'> & {isHidden: boolean}>(
169
+ const SearchIcon = styled(IconButton)<Pick<SearchBarProps, 'isCollapsed'> & {isHidden: boolean}>(
169
170
  ({isCollapsed, isHidden}) => {
170
171
  const collapsedSize = 40;
171
172
  const size = 32;
@@ -198,7 +199,7 @@ const SearchIcon = styled(IconButton)<Pick<SearchFormProps, 'isCollapsed'> & {is
198
199
  );
199
200
 
200
201
  const CloseButton = styled(IconButton)<
201
- Pick<SearchFormProps, 'isCollapsed'> & Pick<SearchFormState, 'showForm'>
202
+ Pick<SearchBarProps, 'isCollapsed'> & Pick<SearchBarState, 'showForm'>
202
203
  >(({isCollapsed, showForm}) => {
203
204
  const collapseStyles: CSSObject =
204
205
  isCollapsed && showForm
@@ -221,7 +222,7 @@ const CloseButton = styled(IconButton)<
221
222
  });
222
223
 
223
224
  const SearchField = styled(FormField)<
224
- Pick<SearchFormProps, 'isCollapsed' | 'grow' | 'height'> & Pick<SearchFormState, 'showForm'>
225
+ Pick<SearchBarProps, 'isCollapsed' | 'grow' | 'height'> & Pick<SearchBarState, 'showForm'>
225
226
  >(({isCollapsed, showForm, grow, height}) => {
226
227
  return {
227
228
  display: (isCollapsed && showForm) || !isCollapsed ? 'inline-block' : 'none',
@@ -236,7 +237,7 @@ const SearchField = styled(FormField)<
236
237
  });
237
238
 
238
239
  const SearchInput = styled(TextInput)<
239
- Pick<SearchFormProps, 'isCollapsed' | 'grow' | 'height'> & {
240
+ Pick<SearchBarProps, 'isCollapsed' | 'grow' | 'height'> & {
240
241
  inputColors: ReturnType<typeof getInputColors>;
241
242
  }
242
243
  >(({isCollapsed, inputColors, grow, height}) => {
@@ -288,14 +289,14 @@ const SearchInput = styled(TextInput)<
288
289
  };
289
290
  });
290
291
 
291
- export class SearchForm extends React.Component<SearchFormProps, SearchFormState> {
292
+ export class SearchBar extends React.Component<SearchBarProps, SearchBarState> {
292
293
  static Theme = SearchTheme;
293
294
 
294
295
  private inputRef = React.createRef<HTMLInputElement>();
295
296
  private openRef = React.createRef<HTMLButtonElement>();
296
297
  private labelId = uuid();
297
298
 
298
- state: Readonly<SearchFormState> = {
299
+ state: Readonly<SearchBarState> = {
299
300
  showForm: false,
300
301
  searchQuery: '',
301
302
  isFocused: false,
@@ -351,7 +352,7 @@ export class SearchForm extends React.Component<SearchFormProps, SearchFormState
351
352
  }
352
353
  };
353
354
 
354
- componentDidUpdate(prevProps: SearchFormProps, prevState: SearchFormState) {
355
+ componentDidUpdate(prevProps: SearchBarProps, prevState: SearchBarState) {
355
356
  const showFormToggled = this.state.showForm !== prevState.showForm;
356
357
  if (showFormToggled) {
357
358
  if (this.state.showForm) {
@@ -412,7 +413,7 @@ export class SearchForm extends React.Component<SearchFormProps, SearchFormState
412
413
  } = this.props;
413
414
 
414
415
  return (
415
- <StyledSearchForm
416
+ <SearchForm
416
417
  role="search"
417
418
  action="."
418
419
  rightAlign={rightAlign}
@@ -485,7 +486,7 @@ export class SearchForm extends React.Component<SearchFormProps, SearchFormState
485
486
  type="button"
486
487
  />
487
488
  </SearchContainer>
488
- </StyledSearchForm>
489
+ </SearchForm>
489
490
  );
490
491
  }
491
492
  }
@@ -1,10 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import styled from '@emotion/styled';
3
- import {
4
- DeprecatedHeaderHeight,
5
- DeprecatedHeaderTheme,
6
- DeprecatedHeaderVariant,
7
- } from '../shared/types';
3
+ import {HeaderHeight, HeaderTheme, HeaderVariant} from '../shared/types';
8
4
  import {miniWdayLogoBlue, wdayLogoWhite, wdayLogoBlue} from '@workday/canvas-kit-react/common';
9
5
  import {colors, space} from '@workday/canvas-kit-react/tokens';
10
6
  import chroma from 'chroma-js';
@@ -12,9 +8,9 @@ import chroma from 'chroma-js';
12
8
  export type WorkdayLogoTitleProps = {
13
9
  /**
14
10
  * The theme of the WorkdayLogoTitle. Accepts `White`, `Blue`, or `Transparent`.
15
- * @default DeprecatedHeaderTheme.White
11
+ * @default HeaderTheme.White
16
12
  */
17
- themeColor?: DeprecatedHeaderTheme;
13
+ themeColor?: HeaderTheme;
18
14
  /**
19
15
  * The text of the WorkdayLogoTitle. Not used if `brand` is provided.
20
16
  * @default ''
@@ -23,7 +19,7 @@ export type WorkdayLogoTitleProps = {
23
19
  /**
24
20
  * The variant of the WorkdayLogoTitle.
25
21
  */
26
- variant?: DeprecatedHeaderVariant;
22
+ variant?: HeaderVariant;
27
23
  };
28
24
 
29
25
  const LockupContainer = styled('div')({
@@ -37,10 +33,7 @@ const Lockup = styled('div')<WorkdayLogoTitleProps>(
37
33
  justifyContent: 'center',
38
34
  },
39
35
  ({variant}) => ({
40
- height:
41
- variant === DeprecatedHeaderVariant.Global
42
- ? DeprecatedHeaderHeight.Small
43
- : DeprecatedHeaderHeight.Large,
36
+ height: variant === HeaderVariant.Global ? HeaderHeight.Small : HeaderHeight.Large,
44
37
  })
45
38
  );
46
39
 
@@ -56,10 +49,9 @@ const Title = styled('h3')<WorkdayLogoTitleProps>(
56
49
  display: 'initial',
57
50
  },
58
51
  ({themeColor}) => ({
59
- color:
60
- themeColor === DeprecatedHeaderTheme.White ? colors.blueberry500 : colors.frenchVanilla100,
52
+ color: themeColor === HeaderTheme.White ? colors.blueberry500 : colors.frenchVanilla100,
61
53
  borderLeft: `1px solid ${
62
- themeColor === DeprecatedHeaderTheme.White
54
+ themeColor === HeaderTheme.White
63
55
  ? colors.soap400
64
56
  : chroma(colors.soap400)
65
57
  .alpha(0.4)
@@ -73,30 +65,9 @@ const WorkdayLogo = styled('span')<WorkdayLogoTitleProps>({
73
65
  lineHeight: 0,
74
66
  });
75
67
 
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
- }
68
+ export class WorkdayLogoTitle extends React.Component<WorkdayLogoTitleProps> {
93
69
  public render() {
94
- const {
95
- themeColor = DeprecatedHeaderTheme.White,
96
- title = '',
97
- variant,
98
- ...elemProps
99
- } = this.props;
70
+ const {themeColor = HeaderTheme.White, title = '', variant, ...elemProps} = this.props;
100
71
 
101
72
  return (
102
73
  <LockupContainer>
@@ -105,8 +76,8 @@ export class DeprecatedWorkdayLogoTitle extends React.Component<WorkdayLogoTitle
105
76
  {...this.props}
106
77
  dangerouslySetInnerHTML={{
107
78
  __html:
108
- themeColor === DeprecatedHeaderTheme.White
109
- ? variant === DeprecatedHeaderVariant.Global
79
+ themeColor === HeaderTheme.White
80
+ ? variant === HeaderVariant.Global
110
81
  ? miniWdayLogoBlue
111
82
  : wdayLogoBlue
112
83
  : wdayLogoWhite,
@@ -1,2 +1,3 @@
1
- export {DeprecatedDubLogoTitle} from './DubLogoTitle';
2
- export {DeprecatedWorkdayLogoTitle} from './WorkdayLogoTitle';
1
+ export {DubLogoTitle} from './DubLogoTitle';
2
+ export {SearchBar, SearchBarProps} from './SearchBar';
3
+ export {WorkdayLogoTitle} from './WorkdayLogoTitle';