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