@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.
- package/combobox/lib/AutocompleteList.tsx +5 -2
- package/combobox/lib/Combobox.tsx +0 -1
- package/common/lib/theming/index.ts +1 -0
- package/common/lib/theming/useThemedRing.ts +84 -0
- package/dist/commonjs/combobox/lib/AutocompleteList.d.ts.map +1 -1
- package/dist/commonjs/combobox/lib/AutocompleteList.js +5 -2
- package/dist/commonjs/combobox/lib/Combobox.d.ts.map +1 -1
- package/dist/commonjs/combobox/lib/Combobox.js +0 -1
- package/dist/commonjs/common/lib/theming/index.d.ts +1 -0
- package/dist/commonjs/common/lib/theming/index.d.ts.map +1 -1
- package/dist/commonjs/common/lib/theming/index.js +1 -0
- package/dist/commonjs/common/lib/theming/useThemedRing.d.ts +11 -0
- package/dist/commonjs/common/lib/theming/useThemedRing.d.ts.map +1 -0
- package/dist/commonjs/common/lib/theming/useThemedRing.js +61 -0
- package/dist/commonjs/header/index.d.ts +5 -5
- package/dist/commonjs/header/index.d.ts.map +1 -1
- package/dist/commonjs/header/index.js +2 -2
- package/dist/commonjs/header/lib/GlobalHeader.d.ts +11 -2
- package/dist/commonjs/header/lib/GlobalHeader.d.ts.map +1 -1
- package/dist/commonjs/header/lib/GlobalHeader.js +19 -8
- package/dist/commonjs/header/lib/Header.d.ts +17 -8
- package/dist/commonjs/header/lib/Header.d.ts.map +1 -1
- package/dist/commonjs/header/lib/Header.js +27 -14
- package/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts +13 -4
- package/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts.map +1 -1
- package/dist/commonjs/header/lib/parts/DubLogoTitle.js +22 -11
- package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts +14 -5
- package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts.map +1 -1
- package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.js +25 -12
- package/dist/commonjs/header/lib/parts/index.d.ts +2 -3
- package/dist/commonjs/header/lib/parts/index.d.ts.map +1 -1
- package/dist/commonjs/header/lib/parts/index.js +2 -4
- package/dist/commonjs/header/lib/shared/themes.d.ts +28 -19
- package/dist/commonjs/header/lib/shared/themes.d.ts.map +1 -1
- package/dist/commonjs/header/lib/shared/themes.js +13 -36
- package/dist/commonjs/header/lib/shared/types.d.ts +3 -8
- package/dist/commonjs/header/lib/shared/types.d.ts.map +1 -1
- package/dist/commonjs/header/lib/shared/types.js +17 -23
- package/dist/commonjs/index.d.ts +2 -0
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +2 -0
- package/dist/commonjs/layout/lib/utils/getValidChildren.d.ts +1 -1
- package/dist/commonjs/layout/lib/utils/getValidChildren.d.ts.map +1 -1
- package/dist/commonjs/search-form/index.d.ts +3 -0
- package/dist/commonjs/search-form/index.d.ts.map +1 -0
- package/dist/commonjs/search-form/index.js +7 -0
- package/dist/commonjs/{header/lib/parts/SearchBar.d.ts → search-form/lib/SearchForm.d.ts} +22 -23
- package/dist/commonjs/search-form/lib/SearchForm.d.ts.map +1 -0
- package/dist/commonjs/{header/lib/parts/SearchBar.js → search-form/lib/SearchForm.js} +13 -14
- package/dist/commonjs/search-form/lib/themes.d.ts +21 -0
- package/dist/commonjs/search-form/lib/themes.d.ts.map +1 -0
- package/dist/commonjs/search-form/lib/themes.js +41 -0
- package/dist/commonjs/text-input/index.d.ts +7 -0
- package/dist/commonjs/text-input/index.d.ts.map +1 -0
- package/dist/commonjs/text-input/index.js +11 -0
- package/dist/commonjs/text-input/lib/TextInput.d.ts +21 -0
- package/dist/commonjs/text-input/lib/TextInput.d.ts.map +1 -0
- package/dist/commonjs/text-input/lib/TextInput.js +36 -0
- package/dist/commonjs/text-input/lib/TextInputField.d.ts +8 -0
- package/dist/commonjs/text-input/lib/TextInputField.d.ts.map +1 -0
- package/dist/commonjs/text-input/lib/TextInputField.js +66 -0
- package/dist/commonjs/text-input/lib/TextInputHint.d.ts +13 -0
- package/dist/commonjs/text-input/lib/TextInputHint.d.ts.map +1 -0
- package/dist/commonjs/text-input/lib/TextInputHint.js +46 -0
- package/dist/commonjs/text-input/lib/TextInputLabel.d.ts +17 -0
- package/dist/commonjs/text-input/lib/TextInputLabel.d.ts.map +1 -0
- package/dist/commonjs/text-input/lib/TextInputLabel.js +54 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +19 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts.map +1 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputField.js +16 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputHint.d.ts +15 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputHint.d.ts.map +1 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputHint.js +12 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputLabel.d.ts +15 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputLabel.d.ts.map +1 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputLabel.js +12 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +17 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.js +23 -0
- package/dist/es6/combobox/lib/AutocompleteList.d.ts.map +1 -1
- package/dist/es6/combobox/lib/AutocompleteList.js +5 -2
- package/dist/es6/combobox/lib/Combobox.d.ts.map +1 -1
- package/dist/es6/combobox/lib/Combobox.js +0 -1
- package/dist/es6/common/lib/theming/index.d.ts +1 -0
- package/dist/es6/common/lib/theming/index.d.ts.map +1 -1
- package/dist/es6/common/lib/theming/index.js +1 -0
- package/dist/es6/common/lib/theming/useThemedRing.d.ts +11 -0
- package/dist/es6/common/lib/theming/useThemedRing.d.ts.map +1 -0
- package/dist/es6/common/lib/theming/useThemedRing.js +55 -0
- package/dist/es6/header/index.d.ts +5 -5
- package/dist/es6/header/index.d.ts.map +1 -1
- package/dist/es6/header/index.js +5 -5
- package/dist/es6/header/lib/GlobalHeader.d.ts +11 -2
- package/dist/es6/header/lib/GlobalHeader.d.ts.map +1 -1
- package/dist/es6/header/lib/GlobalHeader.js +22 -11
- package/dist/es6/header/lib/Header.d.ts +17 -8
- package/dist/es6/header/lib/Header.d.ts.map +1 -1
- package/dist/es6/header/lib/Header.js +30 -17
- package/dist/es6/header/lib/parts/DubLogoTitle.d.ts +13 -4
- package/dist/es6/header/lib/parts/DubLogoTitle.d.ts.map +1 -1
- package/dist/es6/header/lib/parts/DubLogoTitle.js +23 -12
- package/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts +14 -5
- package/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts.map +1 -1
- package/dist/es6/header/lib/parts/WorkdayLogoTitle.js +26 -13
- package/dist/es6/header/lib/parts/index.d.ts +2 -3
- package/dist/es6/header/lib/parts/index.d.ts.map +1 -1
- package/dist/es6/header/lib/parts/index.js +2 -3
- package/dist/es6/header/lib/shared/themes.d.ts +28 -19
- package/dist/es6/header/lib/shared/themes.d.ts.map +1 -1
- package/dist/es6/header/lib/shared/themes.js +14 -37
- package/dist/es6/header/lib/shared/types.d.ts +3 -8
- package/dist/es6/header/lib/shared/types.d.ts.map +1 -1
- package/dist/es6/header/lib/shared/types.js +17 -23
- package/dist/es6/index.d.ts +2 -0
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +2 -0
- package/dist/es6/layout/lib/utils/getValidChildren.d.ts +1 -1
- package/dist/es6/layout/lib/utils/getValidChildren.d.ts.map +1 -1
- package/dist/es6/search-form/index.d.ts +3 -0
- package/dist/es6/search-form/index.d.ts.map +1 -0
- package/dist/es6/search-form/index.js +2 -0
- package/dist/es6/{header/lib/parts/SearchBar.d.ts → search-form/lib/SearchForm.d.ts} +22 -23
- package/dist/es6/search-form/lib/SearchForm.d.ts.map +1 -0
- package/dist/es6/{header/lib/parts/SearchBar.js → search-form/lib/SearchForm.js} +11 -12
- package/dist/es6/search-form/lib/themes.d.ts +21 -0
- package/dist/es6/search-form/lib/themes.d.ts.map +1 -0
- package/dist/es6/search-form/lib/themes.js +39 -0
- package/dist/es6/text-input/index.d.ts +7 -0
- package/dist/es6/text-input/index.d.ts.map +1 -0
- package/dist/es6/text-input/index.js +6 -0
- package/dist/es6/text-input/lib/TextInput.d.ts +21 -0
- package/dist/es6/text-input/lib/TextInput.d.ts.map +1 -0
- package/dist/es6/text-input/lib/TextInput.js +31 -0
- package/dist/es6/text-input/lib/TextInputField.d.ts +8 -0
- package/dist/es6/text-input/lib/TextInputField.d.ts.map +1 -0
- package/dist/es6/text-input/lib/TextInputField.js +64 -0
- package/dist/es6/text-input/lib/TextInputHint.d.ts +13 -0
- package/dist/es6/text-input/lib/TextInputHint.d.ts.map +1 -0
- package/dist/es6/text-input/lib/TextInputHint.js +44 -0
- package/dist/es6/text-input/lib/TextInputLabel.d.ts +17 -0
- package/dist/es6/text-input/lib/TextInputLabel.d.ts.map +1 -0
- package/dist/es6/text-input/lib/TextInputLabel.js +52 -0
- package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +19 -0
- package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts.map +1 -0
- package/dist/es6/text-input/lib/hooks/useTextInputField.js +14 -0
- package/dist/es6/text-input/lib/hooks/useTextInputHint.d.ts +15 -0
- package/dist/es6/text-input/lib/hooks/useTextInputHint.d.ts.map +1 -0
- package/dist/es6/text-input/lib/hooks/useTextInputHint.js +10 -0
- package/dist/es6/text-input/lib/hooks/useTextInputLabel.d.ts +15 -0
- package/dist/es6/text-input/lib/hooks/useTextInputLabel.d.ts.map +1 -0
- package/dist/es6/text-input/lib/hooks/useTextInputLabel.js +10 -0
- package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +17 -0
- package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -0
- package/dist/es6/text-input/lib/hooks/useTextInputModel.js +21 -0
- package/header/README.md +37 -181
- package/header/index.ts +5 -5
- package/header/lib/GlobalHeader.tsx +26 -9
- package/header/lib/Header.tsx +58 -26
- package/header/lib/parts/DubLogoTitle.tsx +26 -9
- package/header/lib/parts/WorkdayLogoTitle.tsx +40 -11
- package/header/lib/parts/index.ts +2 -3
- package/header/lib/shared/themes.tsx +32 -56
- package/header/lib/shared/types.tsx +3 -9
- package/index.ts +2 -0
- package/package.json +7 -5
- package/search-form/LICENSE +52 -0
- package/search-form/README.md +6 -0
- package/search-form/index.ts +2 -0
- package/{header/lib/parts/SearchBar.tsx → search-form/lib/SearchForm.tsx} +30 -31
- package/search-form/lib/themes.ts +54 -0
- package/search-form/package.json +5 -0
- package/text-input/LICENSE +52 -0
- package/text-input/README.md +11 -0
- package/text-input/index.ts +6 -0
- package/text-input/lib/TextInput.tsx +34 -0
- package/text-input/lib/TextInputField.tsx +75 -0
- package/text-input/lib/TextInputHint.tsx +52 -0
- package/text-input/lib/TextInputLabel.tsx +74 -0
- package/text-input/lib/hooks/useTextInputField.tsx +15 -0
- package/text-input/lib/hooks/useTextInputHint.tsx +11 -0
- package/text-input/lib/hooks/useTextInputLabel.tsx +11 -0
- package/text-input/lib/hooks/useTextInputModel.tsx +45 -0
- package/text-input/package.json +5 -0
- package/ts3.5/dist/commonjs/common/lib/theming/index.d.ts +1 -0
- package/ts3.5/dist/commonjs/common/lib/theming/useThemedRing.d.ts +11 -0
- package/ts3.5/dist/commonjs/header/index.d.ts +5 -5
- package/ts3.5/dist/commonjs/header/lib/GlobalHeader.d.ts +11 -2
- package/ts3.5/dist/commonjs/header/lib/Header.d.ts +17 -8
- package/ts3.5/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts +13 -4
- package/ts3.5/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts +14 -5
- package/ts3.5/dist/commonjs/header/lib/parts/index.d.ts +2 -3
- package/ts3.5/dist/commonjs/header/lib/shared/themes.d.ts +28 -19
- package/ts3.5/dist/commonjs/header/lib/shared/types.d.ts +3 -8
- package/ts3.5/dist/commonjs/index.d.ts +2 -0
- package/ts3.5/dist/commonjs/layout/lib/utils/getValidChildren.d.ts +1 -1
- package/ts3.5/dist/commonjs/search-form/index.d.ts +3 -0
- package/ts3.5/dist/commonjs/{header/lib/parts/SearchBar.d.ts → search-form/lib/SearchForm.d.ts} +22 -23
- package/ts3.5/dist/commonjs/search-form/lib/themes.d.ts +21 -0
- package/ts3.5/dist/commonjs/text-input/index.d.ts +7 -0
- package/ts3.5/dist/commonjs/text-input/lib/TextInput.d.ts +21 -0
- package/ts3.5/dist/commonjs/text-input/lib/TextInputField.d.ts +8 -0
- package/ts3.5/dist/commonjs/text-input/lib/TextInputHint.d.ts +13 -0
- package/ts3.5/dist/commonjs/text-input/lib/TextInputLabel.d.ts +17 -0
- package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +19 -0
- package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputHint.d.ts +15 -0
- package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputLabel.d.ts +15 -0
- package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +17 -0
- package/ts3.5/dist/es6/common/lib/theming/index.d.ts +1 -0
- package/ts3.5/dist/es6/common/lib/theming/useThemedRing.d.ts +11 -0
- package/ts3.5/dist/es6/header/index.d.ts +5 -5
- package/ts3.5/dist/es6/header/lib/GlobalHeader.d.ts +11 -2
- package/ts3.5/dist/es6/header/lib/Header.d.ts +17 -8
- package/ts3.5/dist/es6/header/lib/parts/DubLogoTitle.d.ts +13 -4
- package/ts3.5/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts +14 -5
- package/ts3.5/dist/es6/header/lib/parts/index.d.ts +2 -3
- package/ts3.5/dist/es6/header/lib/shared/themes.d.ts +28 -19
- package/ts3.5/dist/es6/header/lib/shared/types.d.ts +3 -8
- package/ts3.5/dist/es6/index.d.ts +2 -0
- package/ts3.5/dist/es6/layout/lib/utils/getValidChildren.d.ts +1 -1
- package/ts3.5/dist/es6/search-form/index.d.ts +3 -0
- package/ts3.5/dist/es6/{header/lib/parts/SearchBar.d.ts → search-form/lib/SearchForm.d.ts} +22 -23
- package/ts3.5/dist/es6/search-form/lib/themes.d.ts +21 -0
- package/ts3.5/dist/es6/text-input/index.d.ts +7 -0
- package/ts3.5/dist/es6/text-input/lib/TextInput.d.ts +21 -0
- package/ts3.5/dist/es6/text-input/lib/TextInputField.d.ts +8 -0
- package/ts3.5/dist/es6/text-input/lib/TextInputHint.d.ts +13 -0
- package/ts3.5/dist/es6/text-input/lib/TextInputLabel.d.ts +17 -0
- package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +19 -0
- package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputHint.d.ts +15 -0
- package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputLabel.d.ts +15 -0
- package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +17 -0
- package/dist/commonjs/header/lib/parts/SearchBar.d.ts.map +0 -1
- package/dist/es6/header/lib/parts/SearchBar.d.ts.map +0 -1
package/header/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Canvas Kit Labs React Header
|
|
1
|
+
# Canvas Kit Labs React Header (Deprecated)
|
|
2
2
|
|
|
3
3
|
<a href="https://github.com/Workday/canvas-kit/tree/master/modules/labs-react/README.md">
|
|
4
4
|
<img src="https://img.shields.io/badge/LABS-alpha-orange" alt="LABS: Alpha" />
|
|
@@ -8,10 +8,6 @@ A set of components to create headers for various Workday applications and sites
|
|
|
8
8
|
|
|
9
9
|
For a full suite of examples, have a look at the [Header Stories](./stories.tsx).
|
|
10
10
|
|
|
11
|
-
## Coming Soon
|
|
12
|
-
|
|
13
|
-
- Mobile Expanded Nav
|
|
14
|
-
|
|
15
11
|
## Installation
|
|
16
12
|
|
|
17
13
|
```sh
|
|
@@ -26,13 +22,13 @@ This component renders a responsive, Canvas-style header.
|
|
|
26
22
|
|
|
27
23
|
```tsx
|
|
28
24
|
import * as React from 'react';
|
|
29
|
-
import {
|
|
25
|
+
import {DeprecatedHeader} from '@workday/canvas-kit-labs-react/header';
|
|
30
26
|
import {IconButton} from '@workday/canvas-kit-react/button';
|
|
31
27
|
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
32
28
|
import {notificationsIcon} from '@workday/canvas-system-icons-web';
|
|
33
29
|
import {PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
34
30
|
|
|
35
|
-
<
|
|
31
|
+
<DeprecatedHeader title="Header" brandUrl="#">
|
|
36
32
|
<nav>
|
|
37
33
|
<ul>
|
|
38
34
|
<li className="current">
|
|
@@ -62,7 +58,7 @@ import {PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
|
62
58
|
altText="Profile"
|
|
63
59
|
/>
|
|
64
60
|
<PrimaryButton>Sign Up</PrimaryButton>
|
|
65
|
-
</
|
|
61
|
+
</DeprecatedHeader>;
|
|
66
62
|
```
|
|
67
63
|
|
|
68
64
|
## Special Children
|
|
@@ -88,18 +84,18 @@ _Deprecated (but supported) - please use `IconButton` instead._
|
|
|
88
84
|
|
|
89
85
|
## Static Properties
|
|
90
86
|
|
|
91
|
-
#### `Theme:
|
|
87
|
+
#### `Theme: DeprecatedHeaderTheme`
|
|
92
88
|
|
|
93
89
|
```tsx
|
|
94
|
-
<
|
|
90
|
+
<DeprecatedHeader title="Blue Header" themeColor={DeprecatedHeader.Theme.Blue} />
|
|
95
91
|
```
|
|
96
92
|
|
|
97
93
|
---
|
|
98
94
|
|
|
99
|
-
#### `Variant:
|
|
95
|
+
#### `Variant: DeprecatedHeaderVariant`
|
|
100
96
|
|
|
101
97
|
```tsx
|
|
102
|
-
<
|
|
98
|
+
<DeprecatedHeader title="Marketing Header" variant={DeprecatedHeader.Variant.Full} />
|
|
103
99
|
```
|
|
104
100
|
|
|
105
101
|
## Component Props
|
|
@@ -118,7 +114,7 @@ Default: `''`
|
|
|
118
114
|
|
|
119
115
|
---
|
|
120
116
|
|
|
121
|
-
#### `themeColor:
|
|
117
|
+
#### `themeColor: DeprecatedHeaderTheme`
|
|
122
118
|
|
|
123
119
|
> The theme of the header (White, Blue, or Transparent).
|
|
124
120
|
|
|
@@ -128,11 +124,11 @@ Default: `''`
|
|
|
128
124
|
| Blue | Dark blue gradient background with white text, white system icons. |
|
|
129
125
|
| Transparent | Transparent background (intended for dark-colored overlays) with white text, white system icons. |
|
|
130
126
|
|
|
131
|
-
Default: `
|
|
127
|
+
Default: `DeprecatedHeaderTheme.White`
|
|
132
128
|
|
|
133
129
|
---
|
|
134
130
|
|
|
135
|
-
#### `variant:
|
|
131
|
+
#### `variant: DeprecatedHeaderVariant`
|
|
136
132
|
|
|
137
133
|
> Specifies the variation of the header.
|
|
138
134
|
|
|
@@ -141,7 +137,7 @@ Default: `HeaderTheme.White`
|
|
|
141
137
|
| Dub | "Dub" headers have a singular "Dub" logo and a title, separated by a equivalent-height divider. It is shorter in height (64px) than the "Full" variant. |
|
|
142
138
|
| Full | "Full" headers have the full Workday logo and an optional title at minimum, separated by an equivalent-height divider (when a title is defined). It is taller in height (80px) than the "Dub" variant. |
|
|
143
139
|
|
|
144
|
-
Default: `
|
|
140
|
+
Default: `DeprecatedHeaderVariant.Dub`
|
|
145
141
|
|
|
146
142
|
---
|
|
147
143
|
|
|
@@ -156,7 +152,7 @@ Default: `HeaderVariant.Dub`
|
|
|
156
152
|
> If specified, this replaces the contents of the Dub logo and title. Used for replacing Dub + title
|
|
157
153
|
> with a `contained lockup` and/or for adding custon design elements next to the Dub + title lockup.
|
|
158
154
|
|
|
159
|
-
Default: `
|
|
155
|
+
Default: `DeprecatedDubLogoTitle` (for "Dub" variants) or `DeprecatedWorkdayLogoTitle` (for "Full" variants)
|
|
160
156
|
|
|
161
157
|
---
|
|
162
158
|
|
|
@@ -183,7 +179,7 @@ Default: `DubLogoTitle` (for "Dub" variants) or `WorkdayLogoTitle` (for "Full" v
|
|
|
183
179
|
|
|
184
180
|
> A React element for the left of the header, this is typically a search bar component
|
|
185
181
|
|
|
186
|
-
# Global Header
|
|
182
|
+
# Global Header (Deprecated)
|
|
187
183
|
|
|
188
184
|
The Global Header (or App Header) is used for Workday applications.
|
|
189
185
|
|
|
@@ -191,12 +187,13 @@ The Global Header (or App Header) is used for Workday applications.
|
|
|
191
187
|
|
|
192
188
|
```tsx
|
|
193
189
|
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
194
|
-
import {
|
|
190
|
+
import {DeprecatedGlobalHeader, DeprecatedDubLogoTitle} from '@workday/canvas-kit-labs-react/header';
|
|
191
|
+
import {SearchForm} from '@workday/canvas-kit-labs-react/search-form';
|
|
195
192
|
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
196
193
|
import {IconButton} from '@workday/canvas-kit-react/button';
|
|
197
194
|
import {notificationsIcon, inboxIcon} from '@workday/canvas-system-icons-web';
|
|
198
195
|
|
|
199
|
-
const HeaderBrand = () => <
|
|
196
|
+
const HeaderBrand = () => <DeprecatedDubLogoTitle themeColor={Header.Theme.White} />
|
|
200
197
|
const HeaderAvatar = () => <Avatar onClick={handleMenuClick} url="https://my.cdn.amazonaws.com/assets/avatar_pic.png" />
|
|
201
198
|
const handleSearchSubmit = event => {
|
|
202
199
|
const query = (event.target as HTMLFormElement).getElementsByTagName('input')[0].value;
|
|
@@ -205,15 +202,15 @@ const handleSearchSubmit = event => {
|
|
|
205
202
|
const openMenu = e => console.log("Menu opened")
|
|
206
203
|
|
|
207
204
|
/**
|
|
208
|
-
* In this instance, the right-most child will be an Avatar component, when the
|
|
205
|
+
* In this instance, the right-most child will be an Avatar component, when the DeprecatedGlobalHeader
|
|
209
206
|
* shrinks below the specified breakpoint (720 in this case), the children get replaced by a menuToggle.
|
|
210
|
-
* For most
|
|
207
|
+
* For most DeprecatedGlobalHeader implementations, the menuToggle is also the Avatar component.
|
|
211
208
|
*/
|
|
212
|
-
<
|
|
209
|
+
<DeprecatedGlobalHeader
|
|
213
210
|
brand={<HeaderBrand />}
|
|
214
211
|
menuToggle={<HeaderAvatar />}
|
|
215
212
|
onMenuClick={openMenu}
|
|
216
|
-
leftSlot={<
|
|
213
|
+
leftSlot={<SearchForm
|
|
217
214
|
isCollapsed={false}
|
|
218
215
|
grow={true}
|
|
219
216
|
onSubmit={handleSearchSubmit}
|
|
@@ -223,7 +220,7 @@ const openMenu = e => console.log("Menu opened")
|
|
|
223
220
|
<IconButton icon={notificationsIcon} variant={IconButton.Variant.Circle} />
|
|
224
221
|
<IconButton icon={inboxIcon} variant={IconButton.Variant.Circle} />
|
|
225
222
|
<HeaderAvatar />
|
|
226
|
-
</
|
|
223
|
+
</DeprecatedGlobalHeader>
|
|
227
224
|
```
|
|
228
225
|
|
|
229
226
|
## Static Properties
|
|
@@ -243,13 +240,13 @@ const openMenu = e => console.log("Menu opened")
|
|
|
243
240
|
> If specified, this replaces the contents of the Dub logo and title. Used for replacing Dub + title
|
|
244
241
|
> with a branded element and/or for adding custon design elements next to the Dub + title lockup.
|
|
245
242
|
|
|
246
|
-
Default: `<
|
|
243
|
+
Default: `<DeprecatedDubLogoTitle />`
|
|
247
244
|
|
|
248
245
|
#### `menuToggle: React.ReactNode`
|
|
249
246
|
|
|
250
247
|
> _Note: This `menuToggle` slot only appears when the screen size shrinks below the `breakpoint`._
|
|
251
248
|
>
|
|
252
|
-
> For most `
|
|
249
|
+
> For most `DeprecatedGlobalHeader` implementations, this is generally the same as the users' `Avatar`. If not
|
|
253
250
|
> specified, `menuToggle` defaults to a "hamburger" menu icon or "justify" icon.
|
|
254
251
|
|
|
255
252
|
Default: `justifyIcon` from `@workday/canvas-system-icons-web`
|
|
@@ -258,7 +255,7 @@ Default: `justifyIcon` from `@workday/canvas-system-icons-web`
|
|
|
258
255
|
|
|
259
256
|
> A click handler for when the user clicks the `menuToggle` element.
|
|
260
257
|
|
|
261
|
-
Default: `<
|
|
258
|
+
Default: `<DeprecatedDubLogoTitle />`
|
|
262
259
|
|
|
263
260
|
#### `leftSlot: React.ReactElement`
|
|
264
261
|
|
|
@@ -270,7 +267,7 @@ Default: `<DubLogoTitle />`
|
|
|
270
267
|
|
|
271
268
|
# "Dub" Logo and Title
|
|
272
269
|
|
|
273
|
-
_Intended to be used in conjunction with the `
|
|
270
|
+
_Intended to be used in conjunction with the `DeprecatedHeader` component_
|
|
274
271
|
|
|
275
272
|
A component that encapsulates the 'Dub' logo and a title (we call this the contained lockup). This
|
|
276
273
|
is used whenever you want to override the contained lockup that comes default with a header, or if
|
|
@@ -280,11 +277,11 @@ background color of the contained lockup
|
|
|
280
277
|
## Usage
|
|
281
278
|
|
|
282
279
|
```tsx
|
|
283
|
-
import {
|
|
280
|
+
import {DeprecatedHeader, DeprecatedDubLogoTitle} from '@workday/canvas-kit-labs-react/header';
|
|
284
281
|
import {colors} from '@workday/canvas-kit-react/tokens';
|
|
285
282
|
|
|
286
|
-
<
|
|
287
|
-
brand={<
|
|
283
|
+
<DeprecatedHeader
|
|
284
|
+
brand={<DeprecatedDubLogoTitle title="This title will show up instead" bgColor={colors.blueberry600} />}
|
|
288
285
|
/>;
|
|
289
286
|
```
|
|
290
287
|
|
|
@@ -304,11 +301,11 @@ Default: `''`
|
|
|
304
301
|
|
|
305
302
|
### Optional
|
|
306
303
|
|
|
307
|
-
#### `themeColor:
|
|
304
|
+
#### `themeColor: DeprecatedHeaderTheme`
|
|
308
305
|
|
|
309
306
|
> The theme of the header (White, Blue, or Transparent).
|
|
310
307
|
|
|
311
|
-
Default: `
|
|
308
|
+
Default: `DeprecatedHeaderTheme.White`
|
|
312
309
|
|
|
313
310
|
---
|
|
314
311
|
|
|
@@ -320,7 +317,7 @@ Default: `'none'`
|
|
|
320
317
|
|
|
321
318
|
# Workday Logo and Title
|
|
322
319
|
|
|
323
|
-
_Intended to be used in conjunction with the `
|
|
320
|
+
_Intended to be used in conjunction with the `DeprecatedHeader` component_
|
|
324
321
|
|
|
325
322
|
A component that contains the full Workday logo and a title. This is used whenever you want to
|
|
326
323
|
override the contained lockup that comes default with a header, or if you want to add more elements
|
|
@@ -329,9 +326,9 @@ next to the title with custom components or markup.
|
|
|
329
326
|
## Usage
|
|
330
327
|
|
|
331
328
|
```tsx
|
|
332
|
-
import {
|
|
329
|
+
import {DeprecatedHeader, DeprecatedWorkdayLogoTitle} from '@workday/canvas-kit-labs-react/header';
|
|
333
330
|
|
|
334
|
-
<
|
|
331
|
+
<DeprecatedHeader brand={<DeprecatedWorkdayLogoTitle title="Display Title" />} />;
|
|
335
332
|
```
|
|
336
333
|
|
|
337
334
|
## Static Properties
|
|
@@ -346,12 +343,12 @@ import {Header, WorkdayLogoTitle} from '@workday/canvas-kit-labs-react/header';
|
|
|
346
343
|
|
|
347
344
|
### Optional
|
|
348
345
|
|
|
349
|
-
#### `themeColor:
|
|
346
|
+
#### `themeColor: DeprecatedHeaderTheme`
|
|
350
347
|
|
|
351
348
|
> The theme of the header (White, Blue, or Transparent). See the
|
|
352
|
-
> [`themeColor`](#themecolor-headertheme) prop on the `
|
|
349
|
+
> [`themeColor`](#themecolor-headertheme) prop on the `DeprecatedHeader` component.
|
|
353
350
|
|
|
354
|
-
Default: `
|
|
351
|
+
Default: `DeprecatedHeaderTheme.White`
|
|
355
352
|
|
|
356
353
|
---
|
|
357
354
|
|
|
@@ -360,144 +357,3 @@ Default: `HeaderTheme.White`
|
|
|
360
357
|
> The title displayed on the header next to the logo.
|
|
361
358
|
|
|
362
359
|
Default `''`
|
|
363
|
-
|
|
364
|
-
# Search Bar
|
|
365
|
-
|
|
366
|
-
_Intended to be used in conjunction with the `Header` component_
|
|
367
|
-
|
|
368
|
-
A component that contains a search bar with autocomplete functionality.
|
|
369
|
-
|
|
370
|
-
## Usage
|
|
371
|
-
|
|
372
|
-
```tsx
|
|
373
|
-
import {SearchBar} from '@workday/canvas-kit-labs-react/header';
|
|
374
|
-
import {MenuItem} from '@workday/canvas-kit-labs-react/menu';
|
|
375
|
-
|
|
376
|
-
const handleInputChange = event => console.log('Adjust menu items here');
|
|
377
|
-
const handleSearchSubmit = event => {
|
|
378
|
-
const query = (event.target as HTMLFormElement).getElementsByTagName('input')[0].value;
|
|
379
|
-
console.log('Submitted query: ', query);
|
|
380
|
-
};
|
|
381
|
-
|
|
382
|
-
<SearchBar
|
|
383
|
-
autocompleteItems={[<MenuItem>Item 1</MenuItem>]}
|
|
384
|
-
isCollapsed={false}
|
|
385
|
-
onInputChange={this.autocompleteCallback}
|
|
386
|
-
placeholder={`Search with Autocomplete`}
|
|
387
|
-
grow={true}
|
|
388
|
-
searchTheme={SearchBar.Theme.Dark}
|
|
389
|
-
onSubmit={handleSearchSubmit}
|
|
390
|
-
/>;
|
|
391
|
-
```
|
|
392
|
-
|
|
393
|
-
## Static Properties
|
|
394
|
-
|
|
395
|
-
> None
|
|
396
|
-
|
|
397
|
-
## Component Props
|
|
398
|
-
|
|
399
|
-
### Required
|
|
400
|
-
|
|
401
|
-
#### `onSubmit: React.FormEventHandler<HTMLFormElement>`
|
|
402
|
-
|
|
403
|
-
> An function that gets called and passed the current input value when the search form is submitted.
|
|
404
|
-
|
|
405
|
-
### Optional
|
|
406
|
-
|
|
407
|
-
#### `isCollapsed: boolean`
|
|
408
|
-
|
|
409
|
-
> True if the search input should be collapsed into a toggle icon (for responsive).
|
|
410
|
-
|
|
411
|
-
---
|
|
412
|
-
|
|
413
|
-
#### `onInputChange: React.ChangeEventHandler<HTMLInputElement>`
|
|
414
|
-
|
|
415
|
-
> Callback to listen when the TextInput changes. This is usually used to update the autocomplete
|
|
416
|
-
> items.
|
|
417
|
-
|
|
418
|
-
---
|
|
419
|
-
|
|
420
|
-
#### `autocompleteItems: React.ReactElement<MenuItemProps>[]`
|
|
421
|
-
|
|
422
|
-
> An array of MenuItems to show under the search bar.
|
|
423
|
-
|
|
424
|
-
---
|
|
425
|
-
|
|
426
|
-
#### `searchTheme?: SearchTheme | SearchThemeAttributes`
|
|
427
|
-
|
|
428
|
-
> The theme of the header the search input is being rendered in. There are 3 build in themes, but
|
|
429
|
-
> the styles are customizable via SearchThemeAttributes.
|
|
430
|
-
|
|
431
|
-
| Theme | Description |
|
|
432
|
-
| ----------- | -------------------------------------------------------------------------------------------------------- |
|
|
433
|
-
| Light | White background with dark-colored text, blue focus ring. |
|
|
434
|
-
| Dark | Dark semi transparent background with white text. Inverts on focus. |
|
|
435
|
-
| Transparent | Transparent background (intended for light-colored header) with dark text. Also used in collapsed state. |
|
|
436
|
-
|
|
437
|
-
Default: `SearchTheme.Light`
|
|
438
|
-
|
|
439
|
-
---
|
|
440
|
-
|
|
441
|
-
#### `placeholder: string`
|
|
442
|
-
|
|
443
|
-
> Placeholder for search input.
|
|
444
|
-
|
|
445
|
-
Default: `'Search'`
|
|
446
|
-
|
|
447
|
-
---
|
|
448
|
-
|
|
449
|
-
#### `initialValue: string;`
|
|
450
|
-
|
|
451
|
-
> Initial value to set the input to.
|
|
452
|
-
|
|
453
|
-
---
|
|
454
|
-
|
|
455
|
-
#### `rightAlign: boolean;`
|
|
456
|
-
|
|
457
|
-
> False if the search input should grow to left align it. True if it should right align.
|
|
458
|
-
|
|
459
|
-
---
|
|
460
|
-
|
|
461
|
-
#### `inputLabel: string`
|
|
462
|
-
|
|
463
|
-
> Screenreader label for text input.
|
|
464
|
-
|
|
465
|
-
Default: `'Search'`
|
|
466
|
-
|
|
467
|
-
---
|
|
468
|
-
|
|
469
|
-
#### `submitLabel: string`
|
|
470
|
-
|
|
471
|
-
> Screenreader label for submit button
|
|
472
|
-
|
|
473
|
-
Default: `'Search'`
|
|
474
|
-
|
|
475
|
-
---
|
|
476
|
-
|
|
477
|
-
#### `clearButtonAriaLabel: string`
|
|
478
|
-
|
|
479
|
-
> Screenreader Label for clear button
|
|
480
|
-
|
|
481
|
-
---
|
|
482
|
-
|
|
483
|
-
#### `openButtonLabel: string`
|
|
484
|
-
|
|
485
|
-
> Screenreader Label to open collapsed search bar
|
|
486
|
-
|
|
487
|
-
Default: `'Open Search'`
|
|
488
|
-
|
|
489
|
-
---
|
|
490
|
-
|
|
491
|
-
#### `closeButtonLabel: string`
|
|
492
|
-
|
|
493
|
-
> Screenreader Label to close collapsed search bar
|
|
494
|
-
|
|
495
|
-
Default: `'Cancel'`
|
|
496
|
-
|
|
497
|
-
---
|
|
498
|
-
|
|
499
|
-
#### `showClearButton: string`
|
|
500
|
-
|
|
501
|
-
> Show button to clear input field
|
|
502
|
-
|
|
503
|
-
Default: `true`
|
package/header/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import DeprecatedHeader from './lib/Header';
|
|
2
|
+
import DeprecatedGlobalHeader from './lib/GlobalHeader';
|
|
3
3
|
|
|
4
|
-
export default
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
4
|
+
export default DeprecatedHeader;
|
|
5
|
+
export {DeprecatedHeader};
|
|
6
|
+
export {DeprecatedGlobalHeader};
|
|
7
7
|
export * from './lib/parts';
|
|
8
8
|
export * from './lib/shared/themes';
|
|
9
9
|
export * from './lib/shared/types';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import DeprecatedHeader from './Header';
|
|
3
|
+
import {DeprecatedHeaderVariant} from './shared/types';
|
|
4
|
+
import {DeprecatedDubLogoTitle} from './parts';
|
|
5
5
|
|
|
6
6
|
export interface GlobalHeaderProps {
|
|
7
7
|
/**
|
|
@@ -23,15 +23,32 @@ export interface GlobalHeaderProps {
|
|
|
23
23
|
*/
|
|
24
24
|
isCollapsed?: boolean;
|
|
25
25
|
/**
|
|
26
|
-
* The React element to render in the left slot of the GlobalHeader. This is typically a
|
|
26
|
+
* The React element to render in the left slot of the GlobalHeader. This is typically a SearchForm component.
|
|
27
27
|
*/
|
|
28
28
|
leftSlot?: React.ReactElement;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
/**
|
|
32
|
+
* ### Deprecated Global Header
|
|
33
|
+
*
|
|
34
|
+
* As of Canvas Kit v6, this component is being soft-deprecated.
|
|
35
|
+
* It will be hard-deprecated (completely removed) in v7. Please see the
|
|
36
|
+
* [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
|
|
37
|
+
* for more information.
|
|
38
|
+
*/
|
|
39
|
+
export default class DeprecatedGlobalHeader extends React.Component<GlobalHeaderProps> {
|
|
40
|
+
componentDidMount() {
|
|
41
|
+
console.warn(
|
|
42
|
+
`GlobalHeader is being deprecated and will be removed in Canvas Kit V7.\n
|
|
43
|
+
For more information, please see the V6 migration guide:\n
|
|
44
|
+
https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page
|
|
45
|
+
`
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
32
49
|
public render() {
|
|
33
50
|
const {
|
|
34
|
-
brand = <
|
|
51
|
+
brand = <DeprecatedDubLogoTitle />,
|
|
35
52
|
menuToggle,
|
|
36
53
|
onMenuClick,
|
|
37
54
|
isCollapsed,
|
|
@@ -40,17 +57,17 @@ export default class GlobalHeader extends React.Component<GlobalHeaderProps> {
|
|
|
40
57
|
...elemProps
|
|
41
58
|
} = this.props;
|
|
42
59
|
return (
|
|
43
|
-
<
|
|
60
|
+
<DeprecatedHeader
|
|
44
61
|
brand={brand}
|
|
45
62
|
menuToggle={menuToggle}
|
|
46
63
|
leftSlot={leftSlot}
|
|
47
64
|
onMenuClick={onMenuClick}
|
|
48
|
-
variant={
|
|
65
|
+
variant={DeprecatedHeaderVariant.Global}
|
|
49
66
|
isCollapsed={isCollapsed}
|
|
50
67
|
{...elemProps}
|
|
51
68
|
>
|
|
52
69
|
{children}
|
|
53
|
-
</
|
|
70
|
+
</DeprecatedHeader>
|
|
54
71
|
);
|
|
55
72
|
}
|
|
56
73
|
}
|
package/header/lib/Header.tsx
CHANGED
|
@@ -2,9 +2,13 @@ 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 {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import {DeprecatedDubLogoTitle, DeprecatedWorkdayLogoTitle} from './parts';
|
|
6
|
+
import {deprecatedHeaderThemes} from './shared/themes';
|
|
7
|
+
import {
|
|
8
|
+
DeprecatedHeaderHeight,
|
|
9
|
+
DeprecatedHeaderTheme,
|
|
10
|
+
DeprecatedHeaderVariant,
|
|
11
|
+
} from './shared/types';
|
|
8
12
|
import {Hyperlink, IconButton, IconButtonProps} from '@workday/canvas-kit-react/button';
|
|
9
13
|
import {SystemIcon, SystemIconProps} from '@workday/canvas-kit-react/icon';
|
|
10
14
|
import {justifyIcon} from '@workday/canvas-system-icons-web';
|
|
@@ -17,14 +21,14 @@ export interface HeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
17
21
|
menuToggle?: React.ReactNode;
|
|
18
22
|
/**
|
|
19
23
|
* The theme of the Header. Accepts `White`, `Blue`, or `Transparent`.
|
|
20
|
-
* @default
|
|
24
|
+
* @default DeprecatedHeaderTheme.White
|
|
21
25
|
*/
|
|
22
|
-
themeColor?:
|
|
26
|
+
themeColor?: DeprecatedHeaderTheme;
|
|
23
27
|
/**
|
|
24
28
|
* The variant of the Header. Accepts `Dub` (small) or `Full` (large).
|
|
25
|
-
* @default
|
|
29
|
+
* @default DeprecatedHeaderVariant.Dub
|
|
26
30
|
*/
|
|
27
|
-
variant?:
|
|
31
|
+
variant?: DeprecatedHeaderVariant;
|
|
28
32
|
/**
|
|
29
33
|
* The text of the Header title. Not used if `brand` is provided.
|
|
30
34
|
*/
|
|
@@ -47,7 +51,7 @@ export interface HeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
47
51
|
*/
|
|
48
52
|
onMenuClick?: (e: React.MouseEvent) => void;
|
|
49
53
|
/**
|
|
50
|
-
* The React element to render in the left slot of the Header. This is typically a
|
|
54
|
+
* The React element to render in the left slot of the Header. This is typically a SearchForm component.
|
|
51
55
|
*/
|
|
52
56
|
leftSlot?: React.ReactElement;
|
|
53
57
|
/**
|
|
@@ -71,10 +75,13 @@ const HeaderShell = styled('div')<PickRequired<HeaderProps, 'themeColor', 'varia
|
|
|
71
75
|
},
|
|
72
76
|
({variant, themeColor}) => ({
|
|
73
77
|
// Only the variant Full has a large header, all the other one (Dub, Global) have a small header height
|
|
74
|
-
height:
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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,
|
|
78
85
|
})
|
|
79
86
|
);
|
|
80
87
|
|
|
@@ -98,7 +105,7 @@ const BrandLink = styled(Hyperlink)({
|
|
|
98
105
|
});
|
|
99
106
|
|
|
100
107
|
const navStyle = ({themeColor}: PickRequired<HeaderProps, 'themeColor', 'css'>) => {
|
|
101
|
-
const theme =
|
|
108
|
+
const theme = deprecatedHeaderThemes[themeColor];
|
|
102
109
|
|
|
103
110
|
return css({
|
|
104
111
|
nav: {
|
|
@@ -211,24 +218,31 @@ class Brand extends React.Component<
|
|
|
211
218
|
Pick<HeaderProps, 'variant' | 'brand' | 'title' | 'themeColor'>
|
|
212
219
|
> {
|
|
213
220
|
render() {
|
|
214
|
-
const {
|
|
221
|
+
const {
|
|
222
|
+
variant = DeprecatedHeaderVariant.Dub,
|
|
223
|
+
brand,
|
|
224
|
+
themeColor = DeprecatedHeaderTheme.White,
|
|
225
|
+
title,
|
|
226
|
+
} = this.props;
|
|
215
227
|
|
|
216
228
|
switch (variant) {
|
|
217
|
-
case
|
|
229
|
+
case DeprecatedHeaderVariant.Global: {
|
|
218
230
|
return <span>{brand}</span>;
|
|
219
231
|
}
|
|
220
|
-
case
|
|
232
|
+
case DeprecatedHeaderVariant.Full: {
|
|
221
233
|
return (
|
|
222
234
|
<span>
|
|
223
|
-
{brand ||
|
|
235
|
+
{brand || (
|
|
236
|
+
<DeprecatedWorkdayLogoTitle title={title ? title : ''} themeColor={themeColor} />
|
|
237
|
+
)}
|
|
224
238
|
</span>
|
|
225
239
|
);
|
|
226
240
|
}
|
|
227
|
-
//
|
|
241
|
+
// DeprecatedHeaderVariant.Dub is default
|
|
228
242
|
default: {
|
|
229
243
|
return (
|
|
230
244
|
<span>
|
|
231
|
-
{brand || <
|
|
245
|
+
{brand || <DeprecatedDubLogoTitle title={title ? title : ''} themeColor={themeColor} />}
|
|
232
246
|
</span>
|
|
233
247
|
);
|
|
234
248
|
}
|
|
@@ -240,7 +254,7 @@ class MenuIconButton extends React.Component<
|
|
|
240
254
|
Pick<HeaderProps, 'themeColor' | 'menuToggle' | 'onMenuClick'>
|
|
241
255
|
> {
|
|
242
256
|
render() {
|
|
243
|
-
const {themeColor =
|
|
257
|
+
const {themeColor = DeprecatedHeaderTheme.White, menuToggle, onMenuClick} = this.props;
|
|
244
258
|
if (menuToggle) {
|
|
245
259
|
const menuToggleElement = menuToggle as React.ReactElement<any>;
|
|
246
260
|
const onClick = menuToggleElement.props.onClick
|
|
@@ -255,7 +269,7 @@ class MenuIconButton extends React.Component<
|
|
|
255
269
|
|
|
256
270
|
return (
|
|
257
271
|
<IconButton
|
|
258
|
-
variant={themeColor ===
|
|
272
|
+
variant={themeColor === DeprecatedHeaderTheme.White ? 'circle' : 'inverse'}
|
|
259
273
|
icon={justifyIcon}
|
|
260
274
|
className={'canvas-header--menu-icon'}
|
|
261
275
|
aria-label="Open Menu"
|
|
@@ -265,9 +279,26 @@ class MenuIconButton extends React.Component<
|
|
|
265
279
|
}
|
|
266
280
|
}
|
|
267
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
|
+
*/
|
|
268
290
|
export default class Header extends React.Component<HeaderProps, {}> {
|
|
269
|
-
static Theme =
|
|
270
|
-
static Variant =
|
|
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
|
+
}
|
|
271
302
|
|
|
272
303
|
/**
|
|
273
304
|
* Helper that recursively maps ReactNodes to their theme-based equivalent.
|
|
@@ -293,7 +324,8 @@ export default class Header extends React.Component<HeaderProps, {}> {
|
|
|
293
324
|
const propsChildren = (child as React.ReactElement<Props>).props.children;
|
|
294
325
|
const singleChild =
|
|
295
326
|
React.Children.count(propsChildren) === 1 && (propsChildren as React.ReactElement<any>);
|
|
296
|
-
const iconButtonVariant =
|
|
327
|
+
const iconButtonVariant =
|
|
328
|
+
this.props.themeColor === DeprecatedHeaderTheme.White ? 'circle' : 'inverse';
|
|
297
329
|
|
|
298
330
|
// Convert old method of SystemIcon into IconButton. If SystemIcon is within a link, make sure it's passed through
|
|
299
331
|
if (child.type === 'a' && singleChild && singleChild.type === SystemIcon) {
|
|
@@ -339,8 +371,8 @@ export default class Header extends React.Component<HeaderProps, {}> {
|
|
|
339
371
|
render() {
|
|
340
372
|
const {
|
|
341
373
|
menuToggle,
|
|
342
|
-
themeColor =
|
|
343
|
-
variant =
|
|
374
|
+
themeColor = DeprecatedHeaderTheme.White,
|
|
375
|
+
variant = DeprecatedHeaderVariant.Dub,
|
|
344
376
|
centeredNav,
|
|
345
377
|
title,
|
|
346
378
|
brand,
|