@workday/canvas-kit-labs-react 6.0.0-beta.0-next.16 → 6.0.3

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 (233) hide show
  1. package/combobox/lib/AutocompleteList.tsx +5 -2
  2. package/combobox/lib/Combobox.tsx +0 -1
  3. package/common/lib/theming/index.ts +1 -0
  4. package/common/lib/theming/useThemedRing.ts +84 -0
  5. package/dist/commonjs/combobox/lib/AutocompleteList.d.ts.map +1 -1
  6. package/dist/commonjs/combobox/lib/AutocompleteList.js +5 -2
  7. package/dist/commonjs/combobox/lib/Combobox.d.ts.map +1 -1
  8. package/dist/commonjs/combobox/lib/Combobox.js +0 -1
  9. package/dist/commonjs/common/lib/theming/index.d.ts +1 -0
  10. package/dist/commonjs/common/lib/theming/index.d.ts.map +1 -1
  11. package/dist/commonjs/common/lib/theming/index.js +1 -0
  12. package/dist/commonjs/common/lib/theming/useThemedRing.d.ts +11 -0
  13. package/dist/commonjs/common/lib/theming/useThemedRing.d.ts.map +1 -0
  14. package/dist/commonjs/common/lib/theming/useThemedRing.js +61 -0
  15. package/dist/commonjs/header/index.d.ts +5 -5
  16. package/dist/commonjs/header/index.d.ts.map +1 -1
  17. package/dist/commonjs/header/index.js +2 -2
  18. package/dist/commonjs/header/lib/GlobalHeader.d.ts +11 -2
  19. package/dist/commonjs/header/lib/GlobalHeader.d.ts.map +1 -1
  20. package/dist/commonjs/header/lib/GlobalHeader.js +19 -8
  21. package/dist/commonjs/header/lib/Header.d.ts +17 -8
  22. package/dist/commonjs/header/lib/Header.d.ts.map +1 -1
  23. package/dist/commonjs/header/lib/Header.js +27 -14
  24. package/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts +13 -4
  25. package/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts.map +1 -1
  26. package/dist/commonjs/header/lib/parts/DubLogoTitle.js +22 -11
  27. package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts +14 -5
  28. package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts.map +1 -1
  29. package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.js +25 -12
  30. package/dist/commonjs/header/lib/parts/index.d.ts +2 -3
  31. package/dist/commonjs/header/lib/parts/index.d.ts.map +1 -1
  32. package/dist/commonjs/header/lib/parts/index.js +2 -4
  33. package/dist/commonjs/header/lib/shared/themes.d.ts +28 -19
  34. package/dist/commonjs/header/lib/shared/themes.d.ts.map +1 -1
  35. package/dist/commonjs/header/lib/shared/themes.js +13 -36
  36. package/dist/commonjs/header/lib/shared/types.d.ts +3 -8
  37. package/dist/commonjs/header/lib/shared/types.d.ts.map +1 -1
  38. package/dist/commonjs/header/lib/shared/types.js +17 -23
  39. package/dist/commonjs/index.d.ts +2 -0
  40. package/dist/commonjs/index.d.ts.map +1 -1
  41. package/dist/commonjs/index.js +2 -0
  42. package/dist/commonjs/layout/lib/utils/getValidChildren.d.ts +1 -1
  43. package/dist/commonjs/layout/lib/utils/getValidChildren.d.ts.map +1 -1
  44. package/dist/commonjs/search-form/index.d.ts +3 -0
  45. package/dist/commonjs/search-form/index.d.ts.map +1 -0
  46. package/dist/commonjs/search-form/index.js +7 -0
  47. package/dist/commonjs/{header/lib/parts/SearchBar.d.ts → search-form/lib/SearchForm.d.ts} +22 -23
  48. package/dist/commonjs/search-form/lib/SearchForm.d.ts.map +1 -0
  49. package/dist/commonjs/{header/lib/parts/SearchBar.js → search-form/lib/SearchForm.js} +13 -14
  50. package/dist/commonjs/search-form/lib/themes.d.ts +21 -0
  51. package/dist/commonjs/search-form/lib/themes.d.ts.map +1 -0
  52. package/dist/commonjs/search-form/lib/themes.js +41 -0
  53. package/dist/commonjs/text-input/index.d.ts +7 -0
  54. package/dist/commonjs/text-input/index.d.ts.map +1 -0
  55. package/dist/commonjs/text-input/index.js +11 -0
  56. package/dist/commonjs/text-input/lib/TextInput.d.ts +21 -0
  57. package/dist/commonjs/text-input/lib/TextInput.d.ts.map +1 -0
  58. package/dist/commonjs/text-input/lib/TextInput.js +36 -0
  59. package/dist/commonjs/text-input/lib/TextInputField.d.ts +8 -0
  60. package/dist/commonjs/text-input/lib/TextInputField.d.ts.map +1 -0
  61. package/dist/commonjs/text-input/lib/TextInputField.js +66 -0
  62. package/dist/commonjs/text-input/lib/TextInputHint.d.ts +13 -0
  63. package/dist/commonjs/text-input/lib/TextInputHint.d.ts.map +1 -0
  64. package/dist/commonjs/text-input/lib/TextInputHint.js +46 -0
  65. package/dist/commonjs/text-input/lib/TextInputLabel.d.ts +17 -0
  66. package/dist/commonjs/text-input/lib/TextInputLabel.d.ts.map +1 -0
  67. package/dist/commonjs/text-input/lib/TextInputLabel.js +54 -0
  68. package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +19 -0
  69. package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts.map +1 -0
  70. package/dist/commonjs/text-input/lib/hooks/useTextInputField.js +16 -0
  71. package/dist/commonjs/text-input/lib/hooks/useTextInputHint.d.ts +15 -0
  72. package/dist/commonjs/text-input/lib/hooks/useTextInputHint.d.ts.map +1 -0
  73. package/dist/commonjs/text-input/lib/hooks/useTextInputHint.js +12 -0
  74. package/dist/commonjs/text-input/lib/hooks/useTextInputLabel.d.ts +15 -0
  75. package/dist/commonjs/text-input/lib/hooks/useTextInputLabel.d.ts.map +1 -0
  76. package/dist/commonjs/text-input/lib/hooks/useTextInputLabel.js +12 -0
  77. package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +17 -0
  78. package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -0
  79. package/dist/commonjs/text-input/lib/hooks/useTextInputModel.js +23 -0
  80. package/dist/es6/combobox/lib/AutocompleteList.d.ts.map +1 -1
  81. package/dist/es6/combobox/lib/AutocompleteList.js +5 -2
  82. package/dist/es6/combobox/lib/Combobox.d.ts.map +1 -1
  83. package/dist/es6/combobox/lib/Combobox.js +0 -1
  84. package/dist/es6/common/lib/theming/index.d.ts +1 -0
  85. package/dist/es6/common/lib/theming/index.d.ts.map +1 -1
  86. package/dist/es6/common/lib/theming/index.js +1 -0
  87. package/dist/es6/common/lib/theming/useThemedRing.d.ts +11 -0
  88. package/dist/es6/common/lib/theming/useThemedRing.d.ts.map +1 -0
  89. package/dist/es6/common/lib/theming/useThemedRing.js +55 -0
  90. package/dist/es6/header/index.d.ts +5 -5
  91. package/dist/es6/header/index.d.ts.map +1 -1
  92. package/dist/es6/header/index.js +5 -5
  93. package/dist/es6/header/lib/GlobalHeader.d.ts +11 -2
  94. package/dist/es6/header/lib/GlobalHeader.d.ts.map +1 -1
  95. package/dist/es6/header/lib/GlobalHeader.js +22 -11
  96. package/dist/es6/header/lib/Header.d.ts +17 -8
  97. package/dist/es6/header/lib/Header.d.ts.map +1 -1
  98. package/dist/es6/header/lib/Header.js +30 -17
  99. package/dist/es6/header/lib/parts/DubLogoTitle.d.ts +13 -4
  100. package/dist/es6/header/lib/parts/DubLogoTitle.d.ts.map +1 -1
  101. package/dist/es6/header/lib/parts/DubLogoTitle.js +23 -12
  102. package/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts +14 -5
  103. package/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts.map +1 -1
  104. package/dist/es6/header/lib/parts/WorkdayLogoTitle.js +26 -13
  105. package/dist/es6/header/lib/parts/index.d.ts +2 -3
  106. package/dist/es6/header/lib/parts/index.d.ts.map +1 -1
  107. package/dist/es6/header/lib/parts/index.js +2 -3
  108. package/dist/es6/header/lib/shared/themes.d.ts +28 -19
  109. package/dist/es6/header/lib/shared/themes.d.ts.map +1 -1
  110. package/dist/es6/header/lib/shared/themes.js +14 -37
  111. package/dist/es6/header/lib/shared/types.d.ts +3 -8
  112. package/dist/es6/header/lib/shared/types.d.ts.map +1 -1
  113. package/dist/es6/header/lib/shared/types.js +17 -23
  114. package/dist/es6/index.d.ts +2 -0
  115. package/dist/es6/index.d.ts.map +1 -1
  116. package/dist/es6/index.js +2 -0
  117. package/dist/es6/layout/lib/utils/getValidChildren.d.ts +1 -1
  118. package/dist/es6/layout/lib/utils/getValidChildren.d.ts.map +1 -1
  119. package/dist/es6/search-form/index.d.ts +3 -0
  120. package/dist/es6/search-form/index.d.ts.map +1 -0
  121. package/dist/es6/search-form/index.js +2 -0
  122. package/dist/es6/{header/lib/parts/SearchBar.d.ts → search-form/lib/SearchForm.d.ts} +22 -23
  123. package/dist/es6/search-form/lib/SearchForm.d.ts.map +1 -0
  124. package/dist/es6/{header/lib/parts/SearchBar.js → search-form/lib/SearchForm.js} +11 -12
  125. package/dist/es6/search-form/lib/themes.d.ts +21 -0
  126. package/dist/es6/search-form/lib/themes.d.ts.map +1 -0
  127. package/dist/es6/search-form/lib/themes.js +39 -0
  128. package/dist/es6/text-input/index.d.ts +7 -0
  129. package/dist/es6/text-input/index.d.ts.map +1 -0
  130. package/dist/es6/text-input/index.js +6 -0
  131. package/dist/es6/text-input/lib/TextInput.d.ts +21 -0
  132. package/dist/es6/text-input/lib/TextInput.d.ts.map +1 -0
  133. package/dist/es6/text-input/lib/TextInput.js +31 -0
  134. package/dist/es6/text-input/lib/TextInputField.d.ts +8 -0
  135. package/dist/es6/text-input/lib/TextInputField.d.ts.map +1 -0
  136. package/dist/es6/text-input/lib/TextInputField.js +64 -0
  137. package/dist/es6/text-input/lib/TextInputHint.d.ts +13 -0
  138. package/dist/es6/text-input/lib/TextInputHint.d.ts.map +1 -0
  139. package/dist/es6/text-input/lib/TextInputHint.js +44 -0
  140. package/dist/es6/text-input/lib/TextInputLabel.d.ts +17 -0
  141. package/dist/es6/text-input/lib/TextInputLabel.d.ts.map +1 -0
  142. package/dist/es6/text-input/lib/TextInputLabel.js +52 -0
  143. package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +19 -0
  144. package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts.map +1 -0
  145. package/dist/es6/text-input/lib/hooks/useTextInputField.js +14 -0
  146. package/dist/es6/text-input/lib/hooks/useTextInputHint.d.ts +15 -0
  147. package/dist/es6/text-input/lib/hooks/useTextInputHint.d.ts.map +1 -0
  148. package/dist/es6/text-input/lib/hooks/useTextInputHint.js +10 -0
  149. package/dist/es6/text-input/lib/hooks/useTextInputLabel.d.ts +15 -0
  150. package/dist/es6/text-input/lib/hooks/useTextInputLabel.d.ts.map +1 -0
  151. package/dist/es6/text-input/lib/hooks/useTextInputLabel.js +10 -0
  152. package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +17 -0
  153. package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -0
  154. package/dist/es6/text-input/lib/hooks/useTextInputModel.js +21 -0
  155. package/header/README.md +37 -181
  156. package/header/index.ts +5 -5
  157. package/header/lib/GlobalHeader.tsx +26 -9
  158. package/header/lib/Header.tsx +58 -26
  159. package/header/lib/parts/DubLogoTitle.tsx +26 -9
  160. package/header/lib/parts/WorkdayLogoTitle.tsx +40 -11
  161. package/header/lib/parts/index.ts +2 -3
  162. package/header/lib/shared/themes.tsx +32 -56
  163. package/header/lib/shared/types.tsx +3 -9
  164. package/index.ts +2 -0
  165. package/package.json +7 -5
  166. package/search-form/LICENSE +52 -0
  167. package/search-form/README.md +6 -0
  168. package/search-form/index.ts +2 -0
  169. package/{header/lib/parts/SearchBar.tsx → search-form/lib/SearchForm.tsx} +30 -31
  170. package/search-form/lib/themes.ts +54 -0
  171. package/search-form/package.json +5 -0
  172. package/text-input/LICENSE +52 -0
  173. package/text-input/README.md +11 -0
  174. package/text-input/index.ts +6 -0
  175. package/text-input/lib/TextInput.tsx +34 -0
  176. package/text-input/lib/TextInputField.tsx +75 -0
  177. package/text-input/lib/TextInputHint.tsx +52 -0
  178. package/text-input/lib/TextInputLabel.tsx +74 -0
  179. package/text-input/lib/hooks/useTextInputField.tsx +15 -0
  180. package/text-input/lib/hooks/useTextInputHint.tsx +11 -0
  181. package/text-input/lib/hooks/useTextInputLabel.tsx +11 -0
  182. package/text-input/lib/hooks/useTextInputModel.tsx +45 -0
  183. package/text-input/package.json +5 -0
  184. package/ts3.5/dist/commonjs/common/lib/theming/index.d.ts +1 -0
  185. package/ts3.5/dist/commonjs/common/lib/theming/useThemedRing.d.ts +11 -0
  186. package/ts3.5/dist/commonjs/header/index.d.ts +5 -5
  187. package/ts3.5/dist/commonjs/header/lib/GlobalHeader.d.ts +11 -2
  188. package/ts3.5/dist/commonjs/header/lib/Header.d.ts +17 -8
  189. package/ts3.5/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts +13 -4
  190. package/ts3.5/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts +14 -5
  191. package/ts3.5/dist/commonjs/header/lib/parts/index.d.ts +2 -3
  192. package/ts3.5/dist/commonjs/header/lib/shared/themes.d.ts +28 -19
  193. package/ts3.5/dist/commonjs/header/lib/shared/types.d.ts +3 -8
  194. package/ts3.5/dist/commonjs/index.d.ts +2 -0
  195. package/ts3.5/dist/commonjs/layout/lib/utils/getValidChildren.d.ts +1 -1
  196. package/ts3.5/dist/commonjs/search-form/index.d.ts +3 -0
  197. package/ts3.5/dist/commonjs/{header/lib/parts/SearchBar.d.ts → search-form/lib/SearchForm.d.ts} +22 -23
  198. package/ts3.5/dist/commonjs/search-form/lib/themes.d.ts +21 -0
  199. package/ts3.5/dist/commonjs/text-input/index.d.ts +7 -0
  200. package/ts3.5/dist/commonjs/text-input/lib/TextInput.d.ts +21 -0
  201. package/ts3.5/dist/commonjs/text-input/lib/TextInputField.d.ts +8 -0
  202. package/ts3.5/dist/commonjs/text-input/lib/TextInputHint.d.ts +13 -0
  203. package/ts3.5/dist/commonjs/text-input/lib/TextInputLabel.d.ts +17 -0
  204. package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +19 -0
  205. package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputHint.d.ts +15 -0
  206. package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputLabel.d.ts +15 -0
  207. package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +17 -0
  208. package/ts3.5/dist/es6/common/lib/theming/index.d.ts +1 -0
  209. package/ts3.5/dist/es6/common/lib/theming/useThemedRing.d.ts +11 -0
  210. package/ts3.5/dist/es6/header/index.d.ts +5 -5
  211. package/ts3.5/dist/es6/header/lib/GlobalHeader.d.ts +11 -2
  212. package/ts3.5/dist/es6/header/lib/Header.d.ts +17 -8
  213. package/ts3.5/dist/es6/header/lib/parts/DubLogoTitle.d.ts +13 -4
  214. package/ts3.5/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts +14 -5
  215. package/ts3.5/dist/es6/header/lib/parts/index.d.ts +2 -3
  216. package/ts3.5/dist/es6/header/lib/shared/themes.d.ts +28 -19
  217. package/ts3.5/dist/es6/header/lib/shared/types.d.ts +3 -8
  218. package/ts3.5/dist/es6/index.d.ts +2 -0
  219. package/ts3.5/dist/es6/layout/lib/utils/getValidChildren.d.ts +1 -1
  220. package/ts3.5/dist/es6/search-form/index.d.ts +3 -0
  221. package/ts3.5/dist/es6/{header/lib/parts/SearchBar.d.ts → search-form/lib/SearchForm.d.ts} +22 -23
  222. package/ts3.5/dist/es6/search-form/lib/themes.d.ts +21 -0
  223. package/ts3.5/dist/es6/text-input/index.d.ts +7 -0
  224. package/ts3.5/dist/es6/text-input/lib/TextInput.d.ts +21 -0
  225. package/ts3.5/dist/es6/text-input/lib/TextInputField.d.ts +8 -0
  226. package/ts3.5/dist/es6/text-input/lib/TextInputHint.d.ts +13 -0
  227. package/ts3.5/dist/es6/text-input/lib/TextInputLabel.d.ts +17 -0
  228. package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +19 -0
  229. package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputHint.d.ts +15 -0
  230. package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputLabel.d.ts +15 -0
  231. package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +17 -0
  232. package/dist/commonjs/header/lib/parts/SearchBar.d.ts.map +0 -1
  233. package/dist/es6/header/lib/parts/SearchBar.d.ts.map +0 -1
@@ -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 {HeaderHeight, HeaderTheme} from '../shared/types';
4
+ import {DeprecatedHeaderHeight, DeprecatedHeaderTheme} 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 HeaderTheme.White
11
+ * @default DeprecatedHeaderTheme.White
12
12
  */
13
- themeColor?: HeaderTheme;
13
+ themeColor?: DeprecatedHeaderTheme;
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: HeaderHeight.Small,
32
+ height: DeprecatedHeaderHeight.Small,
33
33
  paddingLeft: space.m,
34
34
  },
35
35
  ({bgColor}) => ({
@@ -47,9 +47,10 @@ const Title = styled('h3')<DubTitleProps>(
47
47
  whiteSpace: 'nowrap',
48
48
  },
49
49
  ({themeColor}) => ({
50
- color: themeColor === HeaderTheme.White ? colors.blueberry500 : colors.frenchVanilla100,
50
+ color:
51
+ themeColor === DeprecatedHeaderTheme.White ? colors.blueberry500 : colors.frenchVanilla100,
51
52
  borderLeft: `1px solid ${
52
- themeColor === HeaderTheme.White
53
+ themeColor === DeprecatedHeaderTheme.White
53
54
  ? colors.soap400
54
55
  : chroma(colors.frenchVanilla100)
55
56
  .alpha(0.3)
@@ -62,16 +63,32 @@ const DubLogo = styled('div')<DubTitleProps>({
62
63
  lineHeight: 0,
63
64
  });
64
65
 
65
- export class DubLogoTitle extends React.Component<DubTitleProps> {
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
+ }
66
83
  render() {
67
- const {themeColor = HeaderTheme.White, title} = this.props;
84
+ const {themeColor = DeprecatedHeaderTheme.White, title} = this.props;
68
85
  return (
69
86
  <LockupContainer>
70
87
  <Lockup {...this.props}>
71
88
  <DubLogo
72
89
  {...this.props}
73
90
  dangerouslySetInnerHTML={{
74
- __html: themeColor === HeaderTheme.White ? dubLogoBlue : dubLogoWhite,
91
+ __html: themeColor === DeprecatedHeaderTheme.White ? dubLogoBlue : dubLogoWhite,
75
92
  }}
76
93
  />
77
94
  {title && <Title {...this.props}>{title}</Title>}
@@ -1,6 +1,10 @@
1
1
  import * as React from 'react';
2
2
  import styled from '@emotion/styled';
3
- import {HeaderHeight, HeaderTheme, HeaderVariant} from '../shared/types';
3
+ import {
4
+ DeprecatedHeaderHeight,
5
+ DeprecatedHeaderTheme,
6
+ DeprecatedHeaderVariant,
7
+ } from '../shared/types';
4
8
  import {miniWdayLogoBlue, wdayLogoWhite, wdayLogoBlue} from '@workday/canvas-kit-react/common';
5
9
  import {colors, space} from '@workday/canvas-kit-react/tokens';
6
10
  import chroma from 'chroma-js';
@@ -8,9 +12,9 @@ import chroma from 'chroma-js';
8
12
  export type WorkdayLogoTitleProps = {
9
13
  /**
10
14
  * The theme of the WorkdayLogoTitle. Accepts `White`, `Blue`, or `Transparent`.
11
- * @default HeaderTheme.White
15
+ * @default DeprecatedHeaderTheme.White
12
16
  */
13
- themeColor?: HeaderTheme;
17
+ themeColor?: DeprecatedHeaderTheme;
14
18
  /**
15
19
  * The text of the WorkdayLogoTitle. Not used if `brand` is provided.
16
20
  * @default ''
@@ -19,7 +23,7 @@ export type WorkdayLogoTitleProps = {
19
23
  /**
20
24
  * The variant of the WorkdayLogoTitle.
21
25
  */
22
- variant?: HeaderVariant;
26
+ variant?: DeprecatedHeaderVariant;
23
27
  };
24
28
 
25
29
  const LockupContainer = styled('div')({
@@ -33,7 +37,10 @@ const Lockup = styled('div')<WorkdayLogoTitleProps>(
33
37
  justifyContent: 'center',
34
38
  },
35
39
  ({variant}) => ({
36
- height: variant === HeaderVariant.Global ? HeaderHeight.Small : HeaderHeight.Large,
40
+ height:
41
+ variant === DeprecatedHeaderVariant.Global
42
+ ? DeprecatedHeaderHeight.Small
43
+ : DeprecatedHeaderHeight.Large,
37
44
  })
38
45
  );
39
46
 
@@ -49,9 +56,10 @@ const Title = styled('h3')<WorkdayLogoTitleProps>(
49
56
  display: 'initial',
50
57
  },
51
58
  ({themeColor}) => ({
52
- color: themeColor === HeaderTheme.White ? colors.blueberry500 : colors.frenchVanilla100,
59
+ color:
60
+ themeColor === DeprecatedHeaderTheme.White ? colors.blueberry500 : colors.frenchVanilla100,
53
61
  borderLeft: `1px solid ${
54
- themeColor === HeaderTheme.White
62
+ themeColor === DeprecatedHeaderTheme.White
55
63
  ? colors.soap400
56
64
  : chroma(colors.soap400)
57
65
  .alpha(0.4)
@@ -65,9 +73,30 @@ const WorkdayLogo = styled('span')<WorkdayLogoTitleProps>({
65
73
  lineHeight: 0,
66
74
  });
67
75
 
68
- export class WorkdayLogoTitle extends React.Component<WorkdayLogoTitleProps> {
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
+ }
69
93
  public render() {
70
- const {themeColor = HeaderTheme.White, title = '', variant, ...elemProps} = this.props;
94
+ const {
95
+ themeColor = DeprecatedHeaderTheme.White,
96
+ title = '',
97
+ variant,
98
+ ...elemProps
99
+ } = this.props;
71
100
 
72
101
  return (
73
102
  <LockupContainer>
@@ -76,8 +105,8 @@ export class WorkdayLogoTitle extends React.Component<WorkdayLogoTitleProps> {
76
105
  {...this.props}
77
106
  dangerouslySetInnerHTML={{
78
107
  __html:
79
- themeColor === HeaderTheme.White
80
- ? variant === HeaderVariant.Global
108
+ themeColor === DeprecatedHeaderTheme.White
109
+ ? variant === DeprecatedHeaderVariant.Global
81
110
  ? miniWdayLogoBlue
82
111
  : wdayLogoBlue
83
112
  : wdayLogoWhite,
@@ -1,3 +1,2 @@
1
- export {DubLogoTitle} from './DubLogoTitle';
2
- export {SearchBar, SearchBarProps} from './SearchBar';
3
- export {WorkdayLogoTitle} from './WorkdayLogoTitle';
1
+ export {DeprecatedDubLogoTitle} from './DubLogoTitle';
2
+ export {DeprecatedWorkdayLogoTitle} from './WorkdayLogoTitle';
@@ -1,4 +1,3 @@
1
- import {focusRing} from '@workday/canvas-kit-react/common';
2
1
  import {
3
2
  colors,
4
3
  gradients,
@@ -7,9 +6,17 @@ import {
7
6
  CSSProperties,
8
7
  } from '@workday/canvas-kit-react/tokens';
9
8
  import chroma from 'chroma-js';
10
- import {HeaderTheme, SearchTheme} from './types';
9
+ import {DeprecatedHeaderTheme} from './types';
11
10
 
12
- export interface ThemeAttributes {
11
+ /**
12
+ * ### Deprecated Header Theme Attributes Interface
13
+ *
14
+ * As of Canvas Kit v6, this type interface is being soft-deprecated along with the rest of the labs/header package.
15
+ * It will be hard-deprecated (completely removed) in v7. Please see the
16
+ * [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
17
+ * for more information.
18
+ */
19
+ export interface DeprecatedHeaderThemeAttributes {
13
20
  color: string;
14
21
  background: string;
15
22
  depth: CSSProperties;
@@ -23,12 +30,28 @@ export interface ThemeAttributes {
23
30
  chipColor: string;
24
31
  }
25
32
 
26
- export interface Themes {
27
- [key: string]: ThemeAttributes;
33
+ /**
34
+ * ### Deprecated Header Themes Interface
35
+ *
36
+ * As of Canvas Kit v6, this type interface is being soft-deprecated along with the rest of the labs/header package.
37
+ * It will be hard-deprecated (completely removed) in v7. Please see the
38
+ * [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
39
+ * for more information.
40
+ */
41
+ export interface DeprecatedHeaderThemes {
42
+ [key: string]: DeprecatedHeaderThemeAttributes;
28
43
  }
29
44
 
30
- export const themes: Themes = {
31
- [HeaderTheme.White]: {
45
+ /**
46
+ * ### Deprecated Header Themes
47
+ *
48
+ * As of Canvas Kit v6, this theme object is being soft-deprecated along with the rest of the labs/header package.
49
+ * It will be hard-deprecated (completely removed) in v7. Please see the
50
+ * [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
51
+ * for more information.
52
+ */
53
+ export const deprecatedHeaderThemes: DeprecatedHeaderThemes = {
54
+ [DeprecatedHeaderTheme.White]: {
32
55
  color: colors.blackPepper400,
33
56
  background: colors.frenchVanilla100,
34
57
  depth: depth['1'],
@@ -41,7 +64,7 @@ export const themes: Themes = {
41
64
  currentLinkColor: colors.blueberry500,
42
65
  chipColor: colors.blueberry400,
43
66
  },
44
- [HeaderTheme.Blue]: {
67
+ [DeprecatedHeaderTheme.Blue]: {
45
68
  color: colors.frenchVanilla100,
46
69
  background: gradients.blueberry,
47
70
  depth: depth['3'],
@@ -56,7 +79,7 @@ export const themes: Themes = {
56
79
  currentLinkColor: colors.frenchVanilla100,
57
80
  chipColor: colors.frenchVanilla100,
58
81
  },
59
- [HeaderTheme.Transparent]: {
82
+ [DeprecatedHeaderTheme.Transparent]: {
60
83
  color: colors.frenchVanilla100,
61
84
  background: 'transparent',
62
85
  depth: {boxShadow: 'none'},
@@ -72,50 +95,3 @@ export const themes: Themes = {
72
95
  chipColor: colors.frenchVanilla100,
73
96
  },
74
97
  };
75
-
76
- export interface SearchThemeAttributes {
77
- background?: string;
78
- backgroundFocus?: string;
79
- backgroundHover?: string;
80
- color?: string;
81
- colorFocus?: string;
82
- placeholderColor?: string;
83
- placeholderColorFocus?: string;
84
- boxShadow?: string | string[];
85
- boxShadowFocus?: string | string[];
86
- }
87
-
88
- export interface SearchThemes {
89
- [key: string]: SearchThemeAttributes;
90
- }
91
-
92
- export const searchThemes: SearchThemes = {
93
- [SearchTheme.Transparent]: {
94
- background: 'rgba(0, 0, 0, 0)',
95
- backgroundFocus: 'rgba(0, 0, 0, 0)',
96
- color: colors.blackPepper300,
97
- colorFocus: colors.blackPepper300,
98
- placeholderColor: colors.licorice300,
99
- placeholderColorFocus: colors.licorice300,
100
- boxShadow: 'none',
101
- boxShadowFocus: 'none',
102
- },
103
- [SearchTheme.Light]: {
104
- background: colors.soap200,
105
- backgroundFocus: colors.soap200,
106
- backgroundHover: colors.soap300,
107
- color: colors.blackPepper300,
108
- placeholderColor: colors.licorice300,
109
- boxShadow: 'none',
110
- boxShadowFocus: focusRing().boxShadow,
111
- },
112
- [SearchTheme.Dark]: {
113
- background: 'rgba(0, 0, 0, 0.2)',
114
- backgroundFocus: colors.frenchVanilla100,
115
- color: colors.frenchVanilla100,
116
- colorFocus: colors.blackPepper300,
117
- placeholderColor: colors.frenchVanilla100,
118
- placeholderColorFocus: colors.licorice300,
119
- boxShadow: 'none',
120
- },
121
- };
@@ -1,22 +1,16 @@
1
- export enum HeaderTheme {
1
+ export enum DeprecatedHeaderTheme {
2
2
  White,
3
3
  Blue,
4
4
  Transparent,
5
5
  }
6
6
 
7
- export enum HeaderVariant {
7
+ export enum DeprecatedHeaderVariant {
8
8
  Dub,
9
9
  Full,
10
10
  Global,
11
11
  }
12
12
 
13
- export enum HeaderHeight {
13
+ export enum DeprecatedHeaderHeight {
14
14
  Small = '64px',
15
15
  Large = '80px',
16
16
  }
17
-
18
- export enum SearchTheme {
19
- Light,
20
- Dark,
21
- Transparent,
22
- }
package/index.ts CHANGED
@@ -3,3 +3,5 @@ export * from './common';
3
3
  export * from './drawer';
4
4
  export * from './header';
5
5
  export * from './layout';
6
+ export * from './text-input';
7
+ export * from './search-form';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-labs-react",
3
- "version": "6.0.0-beta.0-next.16+2c70e470",
3
+ "version": "6.0.3",
4
4
  "description": "Canvas Kit Labs is an incubator for new and experimental components. Since we have a rather rigorous process for getting components in at a production level, it can be valuable to make them available earlier while we continuously iterate on the API/functionality. The Labs modules allow us to do that as needed.",
5
5
  "author": "Workday, Inc. (https://www.workday.com)",
6
6
  "license": "Apache-2.0",
@@ -55,8 +55,8 @@
55
55
  "@emotion/is-prop-valid": "^0.8.2",
56
56
  "@emotion/styled": "^10.0.27",
57
57
  "@types/uuid": "^3.4.4",
58
- "@workday/canvas-kit-preview-react": "^6.0.0-beta.0-next.16+2c70e470",
59
- "@workday/canvas-kit-react": "^6.0.0-beta.0-next.16+2c70e470",
58
+ "@workday/canvas-kit-preview-react": "^6.0.3",
59
+ "@workday/canvas-kit-react": "^6.0.3",
60
60
  "@workday/canvas-system-icons-web": "1.0.41",
61
61
  "chroma-js": "^2.1.0",
62
62
  "csstype": "^2.6.17",
@@ -65,7 +65,9 @@
65
65
  "uuid": "^3.3.3"
66
66
  },
67
67
  "devDependencies": {
68
- "@types/lodash.flatten": "^4.4.6"
68
+ "@types/lodash.flatten": "^4.4.6",
69
+ "formik": "^2.2.9",
70
+ "yup": "^0.31.1"
69
71
  },
70
- "gitHead": "2c70e470ff0afecfdd18ea96837ab7f19f812128"
72
+ "gitHead": "735c60ddf52268f643c72ceb915e896906f74bcc"
71
73
  }
@@ -0,0 +1,52 @@
1
+ Apache License, Version 2.0 Apache License Version 2.0, January 2004
2
+
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
9
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
10
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
11
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
12
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
13
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
14
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
15
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
16
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
17
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
18
+
19
+ 2. Grant of Copyright License.
20
+ Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
21
+
22
+ 3. Grant of Patent License.
23
+ Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
24
+
25
+ 4. Redistribution.
26
+ You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
27
+ You must give any other recipients of the Work or Derivative Works a copy of this License; and You must cause any modified files to carry prominent notices stating that You changed the files; and You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
28
+
29
+ 5. Submission of Contributions.
30
+ Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
31
+
32
+ 6. Trademarks.
33
+ This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
34
+
35
+ 7. Disclaimer of Warranty.
36
+ Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
37
+
38
+ 8. Limitation of Liability.
39
+ In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
40
+
41
+ 9. Accepting Warranty or Additional Liability.
42
+ While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
43
+
44
+ END OF TERMS AND CONDITIONS
45
+
46
+ ©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders.
47
+
48
+
49
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
50
+ http://www.apache.org/licenses/LICENSE-2.0
51
+
52
+ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
@@ -0,0 +1,6 @@
1
+ # Canvas Kit React Search Form
2
+
3
+ A search form that contains a combobox for rendering search results
4
+
5
+ For more detailed information on this component, please refer to the
6
+ [storybook documentation](https://workday.github.io/canvas-kit/?path=/docs/labs-search-form)
@@ -0,0 +1,2 @@
1
+ export * from './lib/SearchForm';
2
+ export * from './lib/themes';
@@ -8,27 +8,26 @@ 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} from '../shared/themes';
12
- import {SearchTheme} from '../shared/types';
11
+ import {SearchThemeAttributes, searchThemes, SearchTheme} from './themes';
13
12
  import chroma from 'chroma-js';
14
13
  import uuid from 'uuid/v4';
15
14
 
16
- export interface SearchBarProps extends GrowthBehavior, React.FormHTMLAttributes<HTMLFormElement> {
15
+ export interface SearchFormProps extends GrowthBehavior, React.FormHTMLAttributes<HTMLFormElement> {
17
16
  /**
18
- * The function called when the SearchBar form is submitted. The current input value is passed to the callback function.
17
+ * The function called when the SearchForm form is submitted. The current input value is passed to the callback function.
19
18
  */
20
19
  onSubmit: React.FormEventHandler<HTMLFormElement>;
21
20
  /**
22
- * If true, collapse the SearchBar text input into a toggle icon. Useful for responsive layouts.
21
+ * If true, collapse the SearchForm text input into a toggle icon. Useful for responsive layouts.
23
22
  * @default false
24
23
  */
25
24
  isCollapsed?: boolean;
26
25
  /**
27
- * The function called when the SearchBar text input changes.
26
+ * The function called when the SearchForm text input changes.
28
27
  */
29
28
  onInputChange?: React.ChangeEventHandler<HTMLInputElement>;
30
29
  /**
31
- * The autocomplete items of the SearchBar. This array of menu items is shown under the search bar.
30
+ * The autocomplete items of the SearchForm. This array of menu items is shown under the search bar.
32
31
  */
33
32
  autocompleteItems?: React.ReactElement<MenuItemProps>[];
34
33
  /**
@@ -36,57 +35,57 @@ export interface SearchBarProps extends GrowthBehavior, React.FormHTMLAttributes
36
35
  */
37
36
  searchTheme?: SearchTheme | SearchThemeAttributes;
38
37
  /**
39
- * The placeholder text of the SearchBar text input.
38
+ * The placeholder text of the SearchForm text input.
40
39
  * @default Search
41
40
  */
42
41
  placeholder?: string;
43
42
  /**
44
- * The initial value of the SearchBar text input.
43
+ * The initial value of the SearchForm text input.
45
44
  */
46
45
  initialValue?: string;
47
46
  /**
48
- * If true, right-align the SearchBar. If false, the text input should grow to left-align the SearchBar.
47
+ * If true, right-align the SearchForm. If false, the text input should grow to left-align the SearchForm.
49
48
  * @default false
50
49
  */
51
50
  rightAlign?: boolean;
52
51
  /**
53
- * The screenreader label text for the SearchBar text input.
52
+ * The screenreader label text for the SearchForm text input.
54
53
  * @default Search
55
54
  */
56
55
  inputLabel?: string;
57
56
  /**
58
- * The screenreader label text for the SearchBar submit button.
57
+ * The screenreader label text for the SearchForm submit button.
59
58
  * @default Search
60
59
  */
61
60
  submitAriaLabel?: string;
62
61
  /**
63
- * The screenreader label text for the SearchBar clear button.
62
+ * The screenreader label text for the SearchForm clear button.
64
63
  * @default Reset Search Form
65
64
  */
66
65
  clearButtonAriaLabel?: string;
67
66
  /**
68
- * The screenreader label text for the button to open the collapsed SearchBar.
67
+ * The screenreader label text for the button to open the collapsed SearchForm.
69
68
  * @default Open Search
70
69
  */
71
70
  openButtonAriaLabel?: string;
72
71
  /**
73
- * The screenreader label text for the button to close the open SearchBar.
72
+ * The screenreader label text for the button to close the open SearchForm.
74
73
  * @default Cancel
75
74
  */
76
75
  closeButtonAriaLabel?: string;
77
76
  /**
78
- * If true, render the SearchBar with a button to clear the text input.
77
+ * If true, render the SearchForm with a button to clear the text input.
79
78
  * @default true
80
79
  */
81
80
  showClearButton?: boolean;
82
81
  /**
83
- * Height of the Search Bar in pixels
84
- * @default: 40
82
+ * Height of the Search Form in pixels
83
+ * @default 40
85
84
  */
86
85
  height?: number;
87
86
  }
88
87
 
89
- export interface SearchBarState {
88
+ export interface SearchFormState {
90
89
  showForm: boolean;
91
90
  searchQuery: string;
92
91
  isFocused: boolean;
@@ -110,8 +109,8 @@ const formCollapsedBackground = colors.frenchVanilla100;
110
109
  const maxWidth = 480;
111
110
  const minWidth = 120;
112
111
 
113
- const SearchForm = styled('form')<
114
- Pick<SearchBarProps, 'isCollapsed' | 'rightAlign' | 'grow'> & Pick<SearchBarState, 'showForm'>
112
+ const StyledSearchForm = styled('form')<
113
+ Pick<SearchFormProps, 'isCollapsed' | 'rightAlign' | 'grow'> & Pick<SearchFormState, 'showForm'>
115
114
  >(
116
115
  {
117
116
  position: 'relative',
@@ -148,7 +147,7 @@ const SearchForm = styled('form')<
148
147
  }
149
148
  );
150
149
 
151
- const SearchContainer = styled('div')<Pick<SearchBarProps, 'height'>>(
150
+ const SearchContainer = styled('div')<Pick<SearchFormProps, 'height'>>(
152
151
  {
153
152
  position: `relative`,
154
153
  display: 'flex',
@@ -166,7 +165,7 @@ const SearchCombobox = styled(Combobox)({
166
165
  width: `100%`,
167
166
  });
168
167
 
169
- const SearchIcon = styled(IconButton)<Pick<SearchBarProps, 'isCollapsed'> & {isHidden: boolean}>(
168
+ const SearchIcon = styled(IconButton)<Pick<SearchFormProps, 'isCollapsed'> & {isHidden: boolean}>(
170
169
  ({isCollapsed, isHidden}) => {
171
170
  const collapsedSize = 40;
172
171
  const size = 32;
@@ -199,7 +198,7 @@ const SearchIcon = styled(IconButton)<Pick<SearchBarProps, 'isCollapsed'> & {isH
199
198
  );
200
199
 
201
200
  const CloseButton = styled(IconButton)<
202
- Pick<SearchBarProps, 'isCollapsed'> & Pick<SearchBarState, 'showForm'>
201
+ Pick<SearchFormProps, 'isCollapsed'> & Pick<SearchFormState, 'showForm'>
203
202
  >(({isCollapsed, showForm}) => {
204
203
  const collapseStyles: CSSObject =
205
204
  isCollapsed && showForm
@@ -222,7 +221,7 @@ const CloseButton = styled(IconButton)<
222
221
  });
223
222
 
224
223
  const SearchField = styled(FormField)<
225
- Pick<SearchBarProps, 'isCollapsed' | 'grow' | 'height'> & Pick<SearchBarState, 'showForm'>
224
+ Pick<SearchFormProps, 'isCollapsed' | 'grow' | 'height'> & Pick<SearchFormState, 'showForm'>
226
225
  >(({isCollapsed, showForm, grow, height}) => {
227
226
  return {
228
227
  display: (isCollapsed && showForm) || !isCollapsed ? 'inline-block' : 'none',
@@ -237,7 +236,7 @@ const SearchField = styled(FormField)<
237
236
  });
238
237
 
239
238
  const SearchInput = styled(TextInput)<
240
- Pick<SearchBarProps, 'isCollapsed' | 'grow' | 'height'> & {
239
+ Pick<SearchFormProps, 'isCollapsed' | 'grow' | 'height'> & {
241
240
  inputColors: ReturnType<typeof getInputColors>;
242
241
  }
243
242
  >(({isCollapsed, inputColors, grow, height}) => {
@@ -289,14 +288,14 @@ const SearchInput = styled(TextInput)<
289
288
  };
290
289
  });
291
290
 
292
- export class SearchBar extends React.Component<SearchBarProps, SearchBarState> {
291
+ export class SearchForm extends React.Component<SearchFormProps, SearchFormState> {
293
292
  static Theme = SearchTheme;
294
293
 
295
294
  private inputRef = React.createRef<HTMLInputElement>();
296
295
  private openRef = React.createRef<HTMLButtonElement>();
297
296
  private labelId = uuid();
298
297
 
299
- state: Readonly<SearchBarState> = {
298
+ state: Readonly<SearchFormState> = {
300
299
  showForm: false,
301
300
  searchQuery: '',
302
301
  isFocused: false,
@@ -352,7 +351,7 @@ export class SearchBar extends React.Component<SearchBarProps, SearchBarState> {
352
351
  }
353
352
  };
354
353
 
355
- componentDidUpdate(prevProps: SearchBarProps, prevState: SearchBarState) {
354
+ componentDidUpdate(prevProps: SearchFormProps, prevState: SearchFormState) {
356
355
  const showFormToggled = this.state.showForm !== prevState.showForm;
357
356
  if (showFormToggled) {
358
357
  if (this.state.showForm) {
@@ -413,7 +412,7 @@ export class SearchBar extends React.Component<SearchBarProps, SearchBarState> {
413
412
  } = this.props;
414
413
 
415
414
  return (
416
- <SearchForm
415
+ <StyledSearchForm
417
416
  role="search"
418
417
  action="."
419
418
  rightAlign={rightAlign}
@@ -486,7 +485,7 @@ export class SearchBar extends React.Component<SearchBarProps, SearchBarState> {
486
485
  type="button"
487
486
  />
488
487
  </SearchContainer>
489
- </SearchForm>
488
+ </StyledSearchForm>
490
489
  );
491
490
  }
492
491
  }