@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.
- package/common/lib/theming/index.ts +0 -1
- package/dist/commonjs/common/lib/theming/index.d.ts +0 -1
- package/dist/commonjs/common/lib/theming/index.d.ts.map +1 -1
- package/dist/commonjs/common/lib/theming/index.js +0 -1
- 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 +2 -11
- package/dist/commonjs/header/lib/GlobalHeader.d.ts.map +1 -1
- package/dist/commonjs/header/lib/GlobalHeader.js +8 -19
- package/dist/commonjs/header/lib/Header.d.ts +8 -17
- package/dist/commonjs/header/lib/Header.d.ts.map +1 -1
- package/dist/commonjs/header/lib/Header.js +14 -27
- package/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts +4 -13
- package/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts.map +1 -1
- package/dist/commonjs/header/lib/parts/DubLogoTitle.js +11 -22
- package/dist/commonjs/{search-form/lib/SearchForm.d.ts → header/lib/parts/SearchBar.d.ts} +23 -22
- package/dist/commonjs/header/lib/parts/SearchBar.d.ts.map +1 -0
- package/dist/commonjs/{search-form/lib/SearchForm.js → header/lib/parts/SearchBar.js} +14 -13
- package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts +5 -14
- package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts.map +1 -1
- package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.js +12 -25
- package/dist/commonjs/header/lib/parts/index.d.ts +3 -2
- package/dist/commonjs/header/lib/parts/index.d.ts.map +1 -1
- package/dist/commonjs/header/lib/parts/index.js +4 -2
- package/dist/commonjs/header/lib/shared/themes.d.ts +19 -28
- package/dist/commonjs/header/lib/shared/themes.d.ts.map +1 -1
- package/dist/commonjs/header/lib/shared/themes.js +36 -13
- package/dist/commonjs/header/lib/shared/types.d.ts +8 -3
- package/dist/commonjs/header/lib/shared/types.d.ts.map +1 -1
- package/dist/commonjs/header/lib/shared/types.js +23 -17
- package/dist/commonjs/index.d.ts +0 -2
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +0 -2
- 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/es6/common/lib/theming/index.d.ts +0 -1
- package/dist/es6/common/lib/theming/index.d.ts.map +1 -1
- package/dist/es6/common/lib/theming/index.js +0 -1
- 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 +2 -11
- package/dist/es6/header/lib/GlobalHeader.d.ts.map +1 -1
- package/dist/es6/header/lib/GlobalHeader.js +11 -22
- package/dist/es6/header/lib/Header.d.ts +8 -17
- package/dist/es6/header/lib/Header.d.ts.map +1 -1
- package/dist/es6/header/lib/Header.js +17 -30
- package/dist/es6/header/lib/parts/DubLogoTitle.d.ts +4 -13
- package/dist/es6/header/lib/parts/DubLogoTitle.d.ts.map +1 -1
- package/dist/es6/header/lib/parts/DubLogoTitle.js +12 -23
- package/dist/es6/{search-form/lib/SearchForm.d.ts → header/lib/parts/SearchBar.d.ts} +23 -22
- package/dist/es6/header/lib/parts/SearchBar.d.ts.map +1 -0
- package/dist/es6/{search-form/lib/SearchForm.js → header/lib/parts/SearchBar.js} +12 -11
- package/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts +5 -14
- package/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts.map +1 -1
- package/dist/es6/header/lib/parts/WorkdayLogoTitle.js +13 -26
- package/dist/es6/header/lib/parts/index.d.ts +3 -2
- package/dist/es6/header/lib/parts/index.d.ts.map +1 -1
- package/dist/es6/header/lib/parts/index.js +3 -2
- package/dist/es6/header/lib/shared/themes.d.ts +19 -28
- package/dist/es6/header/lib/shared/themes.d.ts.map +1 -1
- package/dist/es6/header/lib/shared/themes.js +37 -14
- package/dist/es6/header/lib/shared/types.d.ts +8 -3
- package/dist/es6/header/lib/shared/types.d.ts.map +1 -1
- package/dist/es6/header/lib/shared/types.js +23 -17
- package/dist/es6/index.d.ts +0 -2
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +0 -2
- package/dist/es6/layout/lib/utils/getValidChildren.d.ts +1 -1
- package/dist/es6/layout/lib/utils/getValidChildren.d.ts.map +1 -1
- package/header/README.md +181 -37
- package/header/index.ts +5 -5
- package/header/lib/GlobalHeader.tsx +9 -26
- package/header/lib/Header.tsx +26 -58
- package/header/lib/parts/DubLogoTitle.tsx +9 -26
- package/{search-form/lib/SearchForm.tsx → header/lib/parts/SearchBar.tsx} +31 -30
- package/header/lib/parts/WorkdayLogoTitle.tsx +11 -40
- package/header/lib/parts/index.ts +3 -2
- package/header/lib/shared/themes.tsx +56 -32
- package/header/lib/shared/types.tsx +9 -3
- package/index.ts +0 -2
- package/package.json +5 -7
- package/ts3.5/dist/commonjs/common/lib/theming/index.d.ts +0 -1
- package/ts3.5/dist/commonjs/header/index.d.ts +5 -5
- package/ts3.5/dist/commonjs/header/lib/GlobalHeader.d.ts +2 -11
- package/ts3.5/dist/commonjs/header/lib/Header.d.ts +8 -17
- package/ts3.5/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts +4 -13
- package/ts3.5/dist/{es6/search-form/lib/SearchForm.d.ts → commonjs/header/lib/parts/SearchBar.d.ts} +23 -22
- package/ts3.5/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts +5 -14
- package/ts3.5/dist/commonjs/header/lib/parts/index.d.ts +3 -2
- package/ts3.5/dist/commonjs/header/lib/shared/themes.d.ts +19 -28
- package/ts3.5/dist/commonjs/header/lib/shared/types.d.ts +8 -3
- package/ts3.5/dist/commonjs/index.d.ts +0 -2
- package/ts3.5/dist/commonjs/layout/lib/utils/getValidChildren.d.ts +1 -1
- package/ts3.5/dist/es6/common/lib/theming/index.d.ts +0 -1
- package/ts3.5/dist/es6/header/index.d.ts +5 -5
- package/ts3.5/dist/es6/header/lib/GlobalHeader.d.ts +2 -11
- package/ts3.5/dist/es6/header/lib/Header.d.ts +8 -17
- package/ts3.5/dist/es6/header/lib/parts/DubLogoTitle.d.ts +4 -13
- package/ts3.5/dist/{commonjs/search-form/lib/SearchForm.d.ts → es6/header/lib/parts/SearchBar.d.ts} +23 -22
- package/ts3.5/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts +5 -14
- package/ts3.5/dist/es6/header/lib/parts/index.d.ts +3 -2
- package/ts3.5/dist/es6/header/lib/shared/themes.d.ts +19 -28
- package/ts3.5/dist/es6/header/lib/shared/types.d.ts +8 -3
- package/ts3.5/dist/es6/index.d.ts +0 -2
- package/ts3.5/dist/es6/layout/lib/utils/getValidChildren.d.ts +1 -1
- package/common/lib/theming/useThemedRing.ts +0 -84
- package/dist/commonjs/common/lib/theming/useThemedRing.d.ts +0 -11
- package/dist/commonjs/common/lib/theming/useThemedRing.d.ts.map +0 -1
- package/dist/commonjs/common/lib/theming/useThemedRing.js +0 -61
- package/dist/commonjs/search-form/index.d.ts +0 -3
- package/dist/commonjs/search-form/index.d.ts.map +0 -1
- package/dist/commonjs/search-form/index.js +0 -7
- package/dist/commonjs/search-form/lib/SearchForm.d.ts.map +0 -1
- package/dist/commonjs/search-form/lib/themes.d.ts +0 -21
- package/dist/commonjs/search-form/lib/themes.d.ts.map +0 -1
- package/dist/commonjs/search-form/lib/themes.js +0 -41
- package/dist/commonjs/text-input/index.d.ts +0 -7
- package/dist/commonjs/text-input/index.d.ts.map +0 -1
- package/dist/commonjs/text-input/index.js +0 -11
- package/dist/commonjs/text-input/lib/TextInput.d.ts +0 -21
- package/dist/commonjs/text-input/lib/TextInput.d.ts.map +0 -1
- package/dist/commonjs/text-input/lib/TextInput.js +0 -36
- package/dist/commonjs/text-input/lib/TextInputField.d.ts +0 -8
- package/dist/commonjs/text-input/lib/TextInputField.d.ts.map +0 -1
- package/dist/commonjs/text-input/lib/TextInputField.js +0 -66
- package/dist/commonjs/text-input/lib/TextInputHint.d.ts +0 -13
- package/dist/commonjs/text-input/lib/TextInputHint.d.ts.map +0 -1
- package/dist/commonjs/text-input/lib/TextInputHint.js +0 -46
- package/dist/commonjs/text-input/lib/TextInputLabel.d.ts +0 -17
- package/dist/commonjs/text-input/lib/TextInputLabel.d.ts.map +0 -1
- package/dist/commonjs/text-input/lib/TextInputLabel.js +0 -54
- package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +0 -19
- package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts.map +0 -1
- package/dist/commonjs/text-input/lib/hooks/useTextInputField.js +0 -16
- package/dist/commonjs/text-input/lib/hooks/useTextInputHint.d.ts +0 -15
- package/dist/commonjs/text-input/lib/hooks/useTextInputHint.d.ts.map +0 -1
- package/dist/commonjs/text-input/lib/hooks/useTextInputHint.js +0 -12
- package/dist/commonjs/text-input/lib/hooks/useTextInputLabel.d.ts +0 -15
- package/dist/commonjs/text-input/lib/hooks/useTextInputLabel.d.ts.map +0 -1
- package/dist/commonjs/text-input/lib/hooks/useTextInputLabel.js +0 -12
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +0 -17
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts.map +0 -1
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.js +0 -23
- package/dist/es6/common/lib/theming/useThemedRing.d.ts +0 -11
- package/dist/es6/common/lib/theming/useThemedRing.d.ts.map +0 -1
- package/dist/es6/common/lib/theming/useThemedRing.js +0 -55
- package/dist/es6/search-form/index.d.ts +0 -3
- package/dist/es6/search-form/index.d.ts.map +0 -1
- package/dist/es6/search-form/index.js +0 -2
- package/dist/es6/search-form/lib/SearchForm.d.ts.map +0 -1
- package/dist/es6/search-form/lib/themes.d.ts +0 -21
- package/dist/es6/search-form/lib/themes.d.ts.map +0 -1
- package/dist/es6/search-form/lib/themes.js +0 -39
- package/dist/es6/text-input/index.d.ts +0 -7
- package/dist/es6/text-input/index.d.ts.map +0 -1
- package/dist/es6/text-input/index.js +0 -6
- package/dist/es6/text-input/lib/TextInput.d.ts +0 -21
- package/dist/es6/text-input/lib/TextInput.d.ts.map +0 -1
- package/dist/es6/text-input/lib/TextInput.js +0 -31
- package/dist/es6/text-input/lib/TextInputField.d.ts +0 -8
- package/dist/es6/text-input/lib/TextInputField.d.ts.map +0 -1
- package/dist/es6/text-input/lib/TextInputField.js +0 -64
- package/dist/es6/text-input/lib/TextInputHint.d.ts +0 -13
- package/dist/es6/text-input/lib/TextInputHint.d.ts.map +0 -1
- package/dist/es6/text-input/lib/TextInputHint.js +0 -44
- package/dist/es6/text-input/lib/TextInputLabel.d.ts +0 -17
- package/dist/es6/text-input/lib/TextInputLabel.d.ts.map +0 -1
- package/dist/es6/text-input/lib/TextInputLabel.js +0 -52
- package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +0 -19
- package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts.map +0 -1
- package/dist/es6/text-input/lib/hooks/useTextInputField.js +0 -14
- package/dist/es6/text-input/lib/hooks/useTextInputHint.d.ts +0 -15
- package/dist/es6/text-input/lib/hooks/useTextInputHint.d.ts.map +0 -1
- package/dist/es6/text-input/lib/hooks/useTextInputHint.js +0 -10
- package/dist/es6/text-input/lib/hooks/useTextInputLabel.d.ts +0 -15
- package/dist/es6/text-input/lib/hooks/useTextInputLabel.d.ts.map +0 -1
- package/dist/es6/text-input/lib/hooks/useTextInputLabel.js +0 -10
- package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +0 -17
- package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts.map +0 -1
- package/dist/es6/text-input/lib/hooks/useTextInputModel.js +0 -21
- package/search-form/LICENSE +0 -52
- package/search-form/README.md +0 -6
- package/search-form/index.ts +0 -2
- package/search-form/lib/themes.ts +0 -54
- package/search-form/package.json +0 -5
- package/text-input/LICENSE +0 -52
- package/text-input/README.md +0 -11
- package/text-input/index.ts +0 -6
- package/text-input/lib/TextInput.tsx +0 -34
- package/text-input/lib/TextInputField.tsx +0 -75
- package/text-input/lib/TextInputHint.tsx +0 -52
- package/text-input/lib/TextInputLabel.tsx +0 -74
- package/text-input/lib/hooks/useTextInputField.tsx +0 -15
- package/text-input/lib/hooks/useTextInputHint.tsx +0 -11
- package/text-input/lib/hooks/useTextInputLabel.tsx +0 -11
- package/text-input/lib/hooks/useTextInputModel.tsx +0 -45
- package/text-input/package.json +0 -5
- package/ts3.5/dist/commonjs/common/lib/theming/useThemedRing.d.ts +0 -11
- package/ts3.5/dist/commonjs/search-form/index.d.ts +0 -3
- package/ts3.5/dist/commonjs/search-form/lib/themes.d.ts +0 -21
- package/ts3.5/dist/commonjs/text-input/index.d.ts +0 -7
- package/ts3.5/dist/commonjs/text-input/lib/TextInput.d.ts +0 -21
- package/ts3.5/dist/commonjs/text-input/lib/TextInputField.d.ts +0 -8
- package/ts3.5/dist/commonjs/text-input/lib/TextInputHint.d.ts +0 -13
- package/ts3.5/dist/commonjs/text-input/lib/TextInputLabel.d.ts +0 -17
- package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +0 -19
- package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputHint.d.ts +0 -15
- package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputLabel.d.ts +0 -15
- package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +0 -17
- package/ts3.5/dist/es6/common/lib/theming/useThemedRing.d.ts +0 -11
- package/ts3.5/dist/es6/search-form/index.d.ts +0 -3
- package/ts3.5/dist/es6/search-form/lib/themes.d.ts +0 -21
- package/ts3.5/dist/es6/text-input/index.d.ts +0 -7
- package/ts3.5/dist/es6/text-input/lib/TextInput.d.ts +0 -21
- package/ts3.5/dist/es6/text-input/lib/TextInputField.d.ts +0 -8
- package/ts3.5/dist/es6/text-input/lib/TextInputHint.d.ts +0 -13
- package/ts3.5/dist/es6/text-input/lib/TextInputLabel.d.ts +0 -17
- package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +0 -19
- package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputHint.d.ts +0 -15
- package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputLabel.d.ts +0 -15
- package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +0 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../../../../header/lib/shared/themes.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../../../../header/lib/shared/themes.tsx"],"names":[],"mappings":"AACA,OAAO,EAKL,aAAa,EACd,MAAM,kCAAkC,CAAC;AAI1C,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,aAAa,CAAC;IACrB,UAAU,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,MAAM;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC;CAChC;AAED,eAAO,MAAM,MAAM,EAAE,MA4CpB,CAAC;AAEF,MAAM,WAAW,qBAAqB;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACpC;AAED,MAAM,WAAW,YAAY;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,qBAAqB,CAAC;CACtC;AAED,eAAO,MAAM,YAAY,EAAE,YA6B1B,CAAC"}
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
var _a;
|
|
1
|
+
var _a, _b;
|
|
2
|
+
import { focusRing } from '@workday/canvas-kit-react/common';
|
|
2
3
|
import { colors, gradients, iconColors, depth, } from '@workday/canvas-kit-react/tokens';
|
|
3
4
|
import chroma from 'chroma-js';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
* As of Canvas Kit v6, this theme object is being soft-deprecated along with the rest of the labs/header package.
|
|
9
|
-
* It will be hard-deprecated (completely removed) in v7. Please see the
|
|
10
|
-
* [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
|
|
11
|
-
* for more information.
|
|
12
|
-
*/
|
|
13
|
-
export var deprecatedHeaderThemes = (_a = {},
|
|
14
|
-
_a[DeprecatedHeaderTheme.White] = {
|
|
5
|
+
import { HeaderTheme, SearchTheme } from './types';
|
|
6
|
+
export var themes = (_a = {},
|
|
7
|
+
_a[HeaderTheme.White] = {
|
|
15
8
|
color: colors.blackPepper400,
|
|
16
9
|
background: colors.frenchVanilla100,
|
|
17
10
|
depth: depth['1'],
|
|
@@ -24,7 +17,7 @@ export var deprecatedHeaderThemes = (_a = {},
|
|
|
24
17
|
currentLinkColor: colors.blueberry500,
|
|
25
18
|
chipColor: colors.blueberry400,
|
|
26
19
|
},
|
|
27
|
-
_a[
|
|
20
|
+
_a[HeaderTheme.Blue] = {
|
|
28
21
|
color: colors.frenchVanilla100,
|
|
29
22
|
background: gradients.blueberry,
|
|
30
23
|
depth: depth['3'],
|
|
@@ -39,7 +32,7 @@ export var deprecatedHeaderThemes = (_a = {},
|
|
|
39
32
|
currentLinkColor: colors.frenchVanilla100,
|
|
40
33
|
chipColor: colors.frenchVanilla100,
|
|
41
34
|
},
|
|
42
|
-
_a[
|
|
35
|
+
_a[HeaderTheme.Transparent] = {
|
|
43
36
|
color: colors.frenchVanilla100,
|
|
44
37
|
background: 'transparent',
|
|
45
38
|
depth: { boxShadow: 'none' },
|
|
@@ -55,3 +48,33 @@ export var deprecatedHeaderThemes = (_a = {},
|
|
|
55
48
|
chipColor: colors.frenchVanilla100,
|
|
56
49
|
},
|
|
57
50
|
_a);
|
|
51
|
+
export var searchThemes = (_b = {},
|
|
52
|
+
_b[SearchTheme.Transparent] = {
|
|
53
|
+
background: 'rgba(0, 0, 0, 0)',
|
|
54
|
+
backgroundFocus: 'rgba(0, 0, 0, 0)',
|
|
55
|
+
color: colors.blackPepper300,
|
|
56
|
+
colorFocus: colors.blackPepper300,
|
|
57
|
+
placeholderColor: colors.licorice300,
|
|
58
|
+
placeholderColorFocus: colors.licorice300,
|
|
59
|
+
boxShadow: 'none',
|
|
60
|
+
boxShadowFocus: 'none',
|
|
61
|
+
},
|
|
62
|
+
_b[SearchTheme.Light] = {
|
|
63
|
+
background: colors.soap200,
|
|
64
|
+
backgroundFocus: colors.soap200,
|
|
65
|
+
backgroundHover: colors.soap300,
|
|
66
|
+
color: colors.blackPepper300,
|
|
67
|
+
placeholderColor: colors.licorice300,
|
|
68
|
+
boxShadow: 'none',
|
|
69
|
+
boxShadowFocus: focusRing().boxShadow,
|
|
70
|
+
},
|
|
71
|
+
_b[SearchTheme.Dark] = {
|
|
72
|
+
background: 'rgba(0, 0, 0, 0.2)',
|
|
73
|
+
backgroundFocus: colors.frenchVanilla100,
|
|
74
|
+
color: colors.frenchVanilla100,
|
|
75
|
+
colorFocus: colors.blackPepper300,
|
|
76
|
+
placeholderColor: colors.frenchVanilla100,
|
|
77
|
+
placeholderColorFocus: colors.licorice300,
|
|
78
|
+
boxShadow: 'none',
|
|
79
|
+
},
|
|
80
|
+
_b);
|
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
export declare enum
|
|
1
|
+
export declare enum HeaderTheme {
|
|
2
2
|
White = 0,
|
|
3
3
|
Blue = 1,
|
|
4
4
|
Transparent = 2
|
|
5
5
|
}
|
|
6
|
-
export declare enum
|
|
6
|
+
export declare enum HeaderVariant {
|
|
7
7
|
Dub = 0,
|
|
8
8
|
Full = 1,
|
|
9
9
|
Global = 2
|
|
10
10
|
}
|
|
11
|
-
export declare enum
|
|
11
|
+
export declare enum HeaderHeight {
|
|
12
12
|
Small = "64px",
|
|
13
13
|
Large = "80px"
|
|
14
14
|
}
|
|
15
|
+
export declare enum SearchTheme {
|
|
16
|
+
Light = 0,
|
|
17
|
+
Dark = 1,
|
|
18
|
+
Transparent = 2
|
|
19
|
+
}
|
|
15
20
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../header/lib/shared/types.tsx"],"names":[],"mappings":"AAAA,oBAAY,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../header/lib/shared/types.tsx"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACrB,KAAK,IAAA;IACL,IAAI,IAAA;IACJ,WAAW,IAAA;CACZ;AAED,oBAAY,aAAa;IACvB,GAAG,IAAA;IACH,IAAI,IAAA;IACJ,MAAM,IAAA;CACP;AAED,oBAAY,YAAY;IACtB,KAAK,SAAS;IACd,KAAK,SAAS;CACf;AAED,oBAAY,WAAW;IACrB,KAAK,IAAA;IACL,IAAI,IAAA;IACJ,WAAW,IAAA;CACZ"}
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
export var
|
|
2
|
-
(function (
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
})(
|
|
7
|
-
export var
|
|
8
|
-
(function (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
})(
|
|
13
|
-
export var
|
|
14
|
-
(function (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
})(
|
|
1
|
+
export var HeaderTheme;
|
|
2
|
+
(function (HeaderTheme) {
|
|
3
|
+
HeaderTheme[HeaderTheme["White"] = 0] = "White";
|
|
4
|
+
HeaderTheme[HeaderTheme["Blue"] = 1] = "Blue";
|
|
5
|
+
HeaderTheme[HeaderTheme["Transparent"] = 2] = "Transparent";
|
|
6
|
+
})(HeaderTheme || (HeaderTheme = {}));
|
|
7
|
+
export var HeaderVariant;
|
|
8
|
+
(function (HeaderVariant) {
|
|
9
|
+
HeaderVariant[HeaderVariant["Dub"] = 0] = "Dub";
|
|
10
|
+
HeaderVariant[HeaderVariant["Full"] = 1] = "Full";
|
|
11
|
+
HeaderVariant[HeaderVariant["Global"] = 2] = "Global";
|
|
12
|
+
})(HeaderVariant || (HeaderVariant = {}));
|
|
13
|
+
export var HeaderHeight;
|
|
14
|
+
(function (HeaderHeight) {
|
|
15
|
+
HeaderHeight["Small"] = "64px";
|
|
16
|
+
HeaderHeight["Large"] = "80px";
|
|
17
|
+
})(HeaderHeight || (HeaderHeight = {}));
|
|
18
|
+
export var SearchTheme;
|
|
19
|
+
(function (SearchTheme) {
|
|
20
|
+
SearchTheme[SearchTheme["Light"] = 0] = "Light";
|
|
21
|
+
SearchTheme[SearchTheme["Dark"] = 1] = "Dark";
|
|
22
|
+
SearchTheme[SearchTheme["Transparent"] = 2] = "Transparent";
|
|
23
|
+
})(SearchTheme || (SearchTheme = {}));
|
package/dist/es6/index.d.ts
CHANGED
package/dist/es6/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
|
package/dist/es6/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export declare function getValidChildren(children: React.ReactNode): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>[];
|
|
2
|
+
export declare function getValidChildren(children: React.ReactNode): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>[];
|
|
3
3
|
//# sourceMappingURL=getValidChildren.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getValidChildren.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/getValidChildren.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"getValidChildren.d.ts","sourceRoot":"","sources":["../../../../../layout/lib/utils/getValidChildren.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,oNAIzD"}
|
package/header/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Canvas Kit Labs React Header
|
|
1
|
+
# Canvas Kit Labs React Header
|
|
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,6 +8,10 @@ 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
|
+
|
|
11
15
|
## Installation
|
|
12
16
|
|
|
13
17
|
```sh
|
|
@@ -22,13 +26,13 @@ This component renders a responsive, Canvas-style header.
|
|
|
22
26
|
|
|
23
27
|
```tsx
|
|
24
28
|
import * as React from 'react';
|
|
25
|
-
import {
|
|
29
|
+
import {Header} from '@workday/canvas-kit-labs-react/header';
|
|
26
30
|
import {IconButton} from '@workday/canvas-kit-react/button';
|
|
27
31
|
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
28
32
|
import {notificationsIcon} from '@workday/canvas-system-icons-web';
|
|
29
33
|
import {PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
30
34
|
|
|
31
|
-
<
|
|
35
|
+
<Header title="Header" brandUrl="#">
|
|
32
36
|
<nav>
|
|
33
37
|
<ul>
|
|
34
38
|
<li className="current">
|
|
@@ -58,7 +62,7 @@ import {PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
|
58
62
|
altText="Profile"
|
|
59
63
|
/>
|
|
60
64
|
<PrimaryButton>Sign Up</PrimaryButton>
|
|
61
|
-
</
|
|
65
|
+
</Header>;
|
|
62
66
|
```
|
|
63
67
|
|
|
64
68
|
## Special Children
|
|
@@ -84,18 +88,18 @@ _Deprecated (but supported) - please use `IconButton` instead._
|
|
|
84
88
|
|
|
85
89
|
## Static Properties
|
|
86
90
|
|
|
87
|
-
#### `Theme:
|
|
91
|
+
#### `Theme: HeaderTheme`
|
|
88
92
|
|
|
89
93
|
```tsx
|
|
90
|
-
<
|
|
94
|
+
<Header title="Blue Header" themeColor={Header.Theme.Blue} />
|
|
91
95
|
```
|
|
92
96
|
|
|
93
97
|
---
|
|
94
98
|
|
|
95
|
-
#### `Variant:
|
|
99
|
+
#### `Variant: HeaderVariant`
|
|
96
100
|
|
|
97
101
|
```tsx
|
|
98
|
-
<
|
|
102
|
+
<Header title="Marketing Header" variant={Header.Variant.Full} />
|
|
99
103
|
```
|
|
100
104
|
|
|
101
105
|
## Component Props
|
|
@@ -114,7 +118,7 @@ Default: `''`
|
|
|
114
118
|
|
|
115
119
|
---
|
|
116
120
|
|
|
117
|
-
#### `themeColor:
|
|
121
|
+
#### `themeColor: HeaderTheme`
|
|
118
122
|
|
|
119
123
|
> The theme of the header (White, Blue, or Transparent).
|
|
120
124
|
|
|
@@ -124,11 +128,11 @@ Default: `''`
|
|
|
124
128
|
| Blue | Dark blue gradient background with white text, white system icons. |
|
|
125
129
|
| Transparent | Transparent background (intended for dark-colored overlays) with white text, white system icons. |
|
|
126
130
|
|
|
127
|
-
Default: `
|
|
131
|
+
Default: `HeaderTheme.White`
|
|
128
132
|
|
|
129
133
|
---
|
|
130
134
|
|
|
131
|
-
#### `variant:
|
|
135
|
+
#### `variant: HeaderVariant`
|
|
132
136
|
|
|
133
137
|
> Specifies the variation of the header.
|
|
134
138
|
|
|
@@ -137,7 +141,7 @@ Default: `DeprecatedHeaderTheme.White`
|
|
|
137
141
|
| 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. |
|
|
138
142
|
| 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. |
|
|
139
143
|
|
|
140
|
-
Default: `
|
|
144
|
+
Default: `HeaderVariant.Dub`
|
|
141
145
|
|
|
142
146
|
---
|
|
143
147
|
|
|
@@ -152,7 +156,7 @@ Default: `DeprecatedHeaderVariant.Dub`
|
|
|
152
156
|
> If specified, this replaces the contents of the Dub logo and title. Used for replacing Dub + title
|
|
153
157
|
> with a `contained lockup` and/or for adding custon design elements next to the Dub + title lockup.
|
|
154
158
|
|
|
155
|
-
Default: `
|
|
159
|
+
Default: `DubLogoTitle` (for "Dub" variants) or `WorkdayLogoTitle` (for "Full" variants)
|
|
156
160
|
|
|
157
161
|
---
|
|
158
162
|
|
|
@@ -179,7 +183,7 @@ Default: `DeprecatedDubLogoTitle` (for "Dub" variants) or `DeprecatedWorkdayLogo
|
|
|
179
183
|
|
|
180
184
|
> A React element for the left of the header, this is typically a search bar component
|
|
181
185
|
|
|
182
|
-
# Global Header
|
|
186
|
+
# Global Header
|
|
183
187
|
|
|
184
188
|
The Global Header (or App Header) is used for Workday applications.
|
|
185
189
|
|
|
@@ -187,13 +191,12 @@ The Global Header (or App Header) is used for Workday applications.
|
|
|
187
191
|
|
|
188
192
|
```tsx
|
|
189
193
|
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
190
|
-
import {
|
|
191
|
-
import {SearchForm} from '@workday/canvas-kit-labs-react/search-form';
|
|
194
|
+
import {GlobalHeader, DubLogoTitle} from '@workday/canvas-kit-labs-react/header';
|
|
192
195
|
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
193
196
|
import {IconButton} from '@workday/canvas-kit-react/button';
|
|
194
197
|
import {notificationsIcon, inboxIcon} from '@workday/canvas-system-icons-web';
|
|
195
198
|
|
|
196
|
-
const HeaderBrand = () => <
|
|
199
|
+
const HeaderBrand = () => <DubLogoTitle themeColor={Header.Theme.White} />
|
|
197
200
|
const HeaderAvatar = () => <Avatar onClick={handleMenuClick} url="https://my.cdn.amazonaws.com/assets/avatar_pic.png" />
|
|
198
201
|
const handleSearchSubmit = event => {
|
|
199
202
|
const query = (event.target as HTMLFormElement).getElementsByTagName('input')[0].value;
|
|
@@ -202,15 +205,15 @@ const handleSearchSubmit = event => {
|
|
|
202
205
|
const openMenu = e => console.log("Menu opened")
|
|
203
206
|
|
|
204
207
|
/**
|
|
205
|
-
* In this instance, the right-most child will be an Avatar component, when the
|
|
208
|
+
* In this instance, the right-most child will be an Avatar component, when the GlobalHeader
|
|
206
209
|
* shrinks below the specified breakpoint (720 in this case), the children get replaced by a menuToggle.
|
|
207
|
-
* For most
|
|
210
|
+
* For most GlobalHeader implementations, the menuToggle is also the Avatar component.
|
|
208
211
|
*/
|
|
209
|
-
<
|
|
212
|
+
<GlobalHeader
|
|
210
213
|
brand={<HeaderBrand />}
|
|
211
214
|
menuToggle={<HeaderAvatar />}
|
|
212
215
|
onMenuClick={openMenu}
|
|
213
|
-
leftSlot={<
|
|
216
|
+
leftSlot={<SearchBar
|
|
214
217
|
isCollapsed={false}
|
|
215
218
|
grow={true}
|
|
216
219
|
onSubmit={handleSearchSubmit}
|
|
@@ -220,7 +223,7 @@ const openMenu = e => console.log("Menu opened")
|
|
|
220
223
|
<IconButton icon={notificationsIcon} variant={IconButton.Variant.Circle} />
|
|
221
224
|
<IconButton icon={inboxIcon} variant={IconButton.Variant.Circle} />
|
|
222
225
|
<HeaderAvatar />
|
|
223
|
-
</
|
|
226
|
+
</GlobalHeader>
|
|
224
227
|
```
|
|
225
228
|
|
|
226
229
|
## Static Properties
|
|
@@ -240,13 +243,13 @@ const openMenu = e => console.log("Menu opened")
|
|
|
240
243
|
> If specified, this replaces the contents of the Dub logo and title. Used for replacing Dub + title
|
|
241
244
|
> with a branded element and/or for adding custon design elements next to the Dub + title lockup.
|
|
242
245
|
|
|
243
|
-
Default: `<
|
|
246
|
+
Default: `<DubLogoTitle />`
|
|
244
247
|
|
|
245
248
|
#### `menuToggle: React.ReactNode`
|
|
246
249
|
|
|
247
250
|
> _Note: This `menuToggle` slot only appears when the screen size shrinks below the `breakpoint`._
|
|
248
251
|
>
|
|
249
|
-
> For most `
|
|
252
|
+
> For most `GlobalHeader` implementations, this is generally the same as the users' `Avatar`. If not
|
|
250
253
|
> specified, `menuToggle` defaults to a "hamburger" menu icon or "justify" icon.
|
|
251
254
|
|
|
252
255
|
Default: `justifyIcon` from `@workday/canvas-system-icons-web`
|
|
@@ -255,7 +258,7 @@ Default: `justifyIcon` from `@workday/canvas-system-icons-web`
|
|
|
255
258
|
|
|
256
259
|
> A click handler for when the user clicks the `menuToggle` element.
|
|
257
260
|
|
|
258
|
-
Default: `<
|
|
261
|
+
Default: `<DubLogoTitle />`
|
|
259
262
|
|
|
260
263
|
#### `leftSlot: React.ReactElement`
|
|
261
264
|
|
|
@@ -267,7 +270,7 @@ Default: `<DeprecatedDubLogoTitle />`
|
|
|
267
270
|
|
|
268
271
|
# "Dub" Logo and Title
|
|
269
272
|
|
|
270
|
-
_Intended to be used in conjunction with the `
|
|
273
|
+
_Intended to be used in conjunction with the `Header` component_
|
|
271
274
|
|
|
272
275
|
A component that encapsulates the 'Dub' logo and a title (we call this the contained lockup). This
|
|
273
276
|
is used whenever you want to override the contained lockup that comes default with a header, or if
|
|
@@ -277,11 +280,11 @@ background color of the contained lockup
|
|
|
277
280
|
## Usage
|
|
278
281
|
|
|
279
282
|
```tsx
|
|
280
|
-
import {
|
|
283
|
+
import {Header, DubLogoTitle} from '@workday/canvas-kit-labs-react/header';
|
|
281
284
|
import {colors} from '@workday/canvas-kit-react/tokens';
|
|
282
285
|
|
|
283
|
-
<
|
|
284
|
-
brand={<
|
|
286
|
+
<Header
|
|
287
|
+
brand={<DubLogoTitle title="This title will show up instead" bgColor={colors.blueberry600} />}
|
|
285
288
|
/>;
|
|
286
289
|
```
|
|
287
290
|
|
|
@@ -301,11 +304,11 @@ Default: `''`
|
|
|
301
304
|
|
|
302
305
|
### Optional
|
|
303
306
|
|
|
304
|
-
#### `themeColor:
|
|
307
|
+
#### `themeColor: HeaderTheme`
|
|
305
308
|
|
|
306
309
|
> The theme of the header (White, Blue, or Transparent).
|
|
307
310
|
|
|
308
|
-
Default: `
|
|
311
|
+
Default: `HeaderTheme.White`
|
|
309
312
|
|
|
310
313
|
---
|
|
311
314
|
|
|
@@ -317,7 +320,7 @@ Default: `'none'`
|
|
|
317
320
|
|
|
318
321
|
# Workday Logo and Title
|
|
319
322
|
|
|
320
|
-
_Intended to be used in conjunction with the `
|
|
323
|
+
_Intended to be used in conjunction with the `Header` component_
|
|
321
324
|
|
|
322
325
|
A component that contains the full Workday logo and a title. This is used whenever you want to
|
|
323
326
|
override the contained lockup that comes default with a header, or if you want to add more elements
|
|
@@ -326,9 +329,9 @@ next to the title with custom components or markup.
|
|
|
326
329
|
## Usage
|
|
327
330
|
|
|
328
331
|
```tsx
|
|
329
|
-
import {
|
|
332
|
+
import {Header, WorkdayLogoTitle} from '@workday/canvas-kit-labs-react/header';
|
|
330
333
|
|
|
331
|
-
<
|
|
334
|
+
<Header brand={<WorkdayLogoTitle title="Display Title" />} />;
|
|
332
335
|
```
|
|
333
336
|
|
|
334
337
|
## Static Properties
|
|
@@ -343,12 +346,12 @@ import {DeprecatedHeader, DeprecatedWorkdayLogoTitle} from '@workday/canvas-kit-
|
|
|
343
346
|
|
|
344
347
|
### Optional
|
|
345
348
|
|
|
346
|
-
#### `themeColor:
|
|
349
|
+
#### `themeColor: HeaderTheme`
|
|
347
350
|
|
|
348
351
|
> The theme of the header (White, Blue, or Transparent). See the
|
|
349
|
-
> [`themeColor`](#themecolor-headertheme) prop on the `
|
|
352
|
+
> [`themeColor`](#themecolor-headertheme) prop on the `Header` component.
|
|
350
353
|
|
|
351
|
-
Default: `
|
|
354
|
+
Default: `HeaderTheme.White`
|
|
352
355
|
|
|
353
356
|
---
|
|
354
357
|
|
|
@@ -357,3 +360,144 @@ Default: `DeprecatedHeaderTheme.White`
|
|
|
357
360
|
> The title displayed on the header next to the logo.
|
|
358
361
|
|
|
359
362
|
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 Header from './lib/Header';
|
|
2
|
+
import GlobalHeader from './lib/GlobalHeader';
|
|
3
3
|
|
|
4
|
-
export default
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
4
|
+
export default Header;
|
|
5
|
+
export {Header};
|
|
6
|
+
export {GlobalHeader};
|
|
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 Header from './Header';
|
|
3
|
+
import {HeaderVariant} from './shared/types';
|
|
4
|
+
import {DubLogoTitle} from './parts';
|
|
5
5
|
|
|
6
6
|
export interface GlobalHeaderProps {
|
|
7
7
|
/**
|
|
@@ -23,32 +23,15 @@ 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 SearchBar component.
|
|
27
27
|
*/
|
|
28
28
|
leftSlot?: React.ReactElement;
|
|
29
29
|
}
|
|
30
30
|
|
|
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
|
-
|
|
31
|
+
export default class GlobalHeader extends React.Component<GlobalHeaderProps> {
|
|
49
32
|
public render() {
|
|
50
33
|
const {
|
|
51
|
-
brand = <
|
|
34
|
+
brand = <DubLogoTitle />,
|
|
52
35
|
menuToggle,
|
|
53
36
|
onMenuClick,
|
|
54
37
|
isCollapsed,
|
|
@@ -57,17 +40,17 @@ export default class DeprecatedGlobalHeader extends React.Component<GlobalHeader
|
|
|
57
40
|
...elemProps
|
|
58
41
|
} = this.props;
|
|
59
42
|
return (
|
|
60
|
-
<
|
|
43
|
+
<Header
|
|
61
44
|
brand={brand}
|
|
62
45
|
menuToggle={menuToggle}
|
|
63
46
|
leftSlot={leftSlot}
|
|
64
47
|
onMenuClick={onMenuClick}
|
|
65
|
-
variant={
|
|
48
|
+
variant={HeaderVariant.Global}
|
|
66
49
|
isCollapsed={isCollapsed}
|
|
67
50
|
{...elemProps}
|
|
68
51
|
>
|
|
69
52
|
{children}
|
|
70
|
-
</
|
|
53
|
+
</Header>
|
|
71
54
|
);
|
|
72
55
|
}
|
|
73
56
|
}
|