@workday/canvas-kit-labs-react 6.0.0-beta.0-next.15 → 6.0.2
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
|
@@ -7,8 +7,11 @@ import {ComboBoxMenuItemGroup, getOptionId, listBoxIdPart, getTextFromElement} f
|
|
|
7
7
|
import uuid from 'uuid/v4';
|
|
8
8
|
|
|
9
9
|
const Autocomplete = styled('ul')({
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
margin: 0,
|
|
11
|
+
maxHeight: 200,
|
|
12
|
+
boxSizing: 'border-box',
|
|
13
|
+
overflowY: 'auto',
|
|
14
|
+
padding: `${space.xxs} 0`,
|
|
12
15
|
});
|
|
13
16
|
|
|
14
17
|
const AccessibleHide = styled('span')(accessibleHide);
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import {useThemeRTL} from './useThemeRTL';
|
|
2
|
+
import {CanvasThemePalette, EmotionCanvasTheme} from '@workday/canvas-kit-react/common';
|
|
3
|
+
import {colors, CSSProperties, inputColors} from '@workday/canvas-kit-react/tokens';
|
|
4
|
+
import chroma from 'chroma-js';
|
|
5
|
+
|
|
6
|
+
type paletteSelection = Exclude<keyof EmotionCanvasTheme['canvas']['palette'], 'common'>;
|
|
7
|
+
interface ContrastColors {
|
|
8
|
+
outer?: string;
|
|
9
|
+
inner?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const isAccessible = (foreground: string, background: string = colors.frenchVanilla100) => {
|
|
13
|
+
return chroma.contrast(foreground, background) >= 3;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const getPaletteColorsFromTheme = (
|
|
17
|
+
fallbackColors: ContrastColors,
|
|
18
|
+
palette?: CanvasThemePalette
|
|
19
|
+
): ContrastColors => {
|
|
20
|
+
return palette
|
|
21
|
+
? {
|
|
22
|
+
outer: isAccessible(palette?.main) ? palette?.main : palette?.darkest,
|
|
23
|
+
inner: palette?.main,
|
|
24
|
+
}
|
|
25
|
+
: fallbackColors;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export function getPaletteColors(
|
|
29
|
+
type: paletteSelection,
|
|
30
|
+
theme?: EmotionCanvasTheme
|
|
31
|
+
): ContrastColors {
|
|
32
|
+
const palette = theme?.canvas.palette[type];
|
|
33
|
+
|
|
34
|
+
switch (type) {
|
|
35
|
+
case 'error': {
|
|
36
|
+
return getPaletteColorsFromTheme(
|
|
37
|
+
{
|
|
38
|
+
outer: inputColors.error.border,
|
|
39
|
+
inner: inputColors.error.border,
|
|
40
|
+
},
|
|
41
|
+
palette
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
case 'alert': {
|
|
45
|
+
return getPaletteColorsFromTheme(
|
|
46
|
+
{
|
|
47
|
+
outer: colors.cantaloupe600,
|
|
48
|
+
inner: inputColors.alert.border,
|
|
49
|
+
},
|
|
50
|
+
palette
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
default: {
|
|
54
|
+
return getPaletteColorsFromTheme({}, palette);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export const useThemedRing = (type: paletteSelection): CSSProperties => {
|
|
60
|
+
const {themeRTL, theme} = useThemeRTL();
|
|
61
|
+
|
|
62
|
+
const paletteColors = getPaletteColors(type, theme);
|
|
63
|
+
if (!(paletteColors?.outer || paletteColors?.inner)) {
|
|
64
|
+
return {};
|
|
65
|
+
}
|
|
66
|
+
const errorBoxShadow = `inset 0 0 0 ${paletteColors.outer === paletteColors.inner ? 1 : 2}px ${
|
|
67
|
+
paletteColors.inner
|
|
68
|
+
}`;
|
|
69
|
+
|
|
70
|
+
return themeRTL({
|
|
71
|
+
borderColor: paletteColors.outer,
|
|
72
|
+
transition: '100ms box-shadow',
|
|
73
|
+
boxShadow: errorBoxShadow,
|
|
74
|
+
'&:hover, &:disabled': {
|
|
75
|
+
borderColor: paletteColors.outer,
|
|
76
|
+
},
|
|
77
|
+
'&:focus:not([disabled])': {
|
|
78
|
+
borderColor: paletteColors.outer,
|
|
79
|
+
boxShadow: `${errorBoxShadow},
|
|
80
|
+
0 0 0 2px ${colors.frenchVanilla100},
|
|
81
|
+
0 0 0 4px ${theme ? theme.canvas.palette.common.focusOutline : inputColors.focusBorder}`,
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutocompleteList.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/AutocompleteList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAIhD,OAAO,EAAC,aAAa,EAAC,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAC,qBAAqB,EAAiD,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"AutocompleteList.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/AutocompleteList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAIhD,OAAO,EAAC,aAAa,EAAC,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAC,qBAAqB,EAAiD,MAAM,YAAY,CAAC;AAajG,UAAU,qBAAqB;IAC7B;;OAEG;IACH,iBAAiB,EAAE,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,GAAG,qBAAqB,EAAE,CAAC;IACjF;;OAEG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;OAEG;IACH,uBAAuB,EAAE,CACvB,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,EAC3C,aAAa,EAAE,aAAa,KACzB,IAAI,CAAC;IACV;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,QAAA,MAAM,gBAAgB,mJAwFrB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -35,8 +35,11 @@ var common_1 = require("@workday/canvas-kit-react/common");
|
|
|
35
35
|
var Combobox_1 = require("./Combobox");
|
|
36
36
|
var v4_1 = __importDefault(require("uuid/v4"));
|
|
37
37
|
var Autocomplete = styled_1.default('ul')({
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
margin: 0,
|
|
39
|
+
maxHeight: 200,
|
|
40
|
+
boxSizing: 'border-box',
|
|
41
|
+
overflowY: 'auto',
|
|
42
|
+
padding: tokens_1.space.xxs + " 0",
|
|
40
43
|
});
|
|
41
44
|
var AccessibleHide = styled_1.default('span')(common_1.accessibleHide);
|
|
42
45
|
var AutocompleteList = function (_a) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/Combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkE,MAAM,OAAO,CAAC;AAEvF,OAAO,EAAC,cAAc,EAA+B,MAAM,kCAAkC,CAAC;AAE9F,OAAO,EAAC,aAAa,EAAC,MAAM,wCAAwC,CAAC;AAErE,OAAO,EAAa,eAAe,EAAC,MAAM,kCAAkC,CAAC;AAE7E,OAAO,EAAC,cAAc,EAAC,MAAM,sCAAsC,CAAC;AAMpE,MAAM,WAAW,qBAAqB;IAEpC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;IAE1C,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,CAAC;CAC5C;AAED,MAAM,WAAW,aAAc,SAAQ,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IACtF;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;IAC7C;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IAChD;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;OAEG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,GAAG,qBAAqB,EAAE,CAAC;IAClF;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC5D;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAClC;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACjC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;CAC/C;
|
|
1
|
+
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/Combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkE,MAAM,OAAO,CAAC;AAEvF,OAAO,EAAC,cAAc,EAA+B,MAAM,kCAAkC,CAAC;AAE9F,OAAO,EAAC,aAAa,EAAC,MAAM,wCAAwC,CAAC;AAErE,OAAO,EAAa,eAAe,EAAC,MAAM,kCAAkC,CAAC;AAE7E,OAAO,EAAC,cAAc,EAAC,MAAM,sCAAsC,CAAC;AAMpE,MAAM,WAAW,qBAAqB;IAEpC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;IAE1C,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,CAAC;CAC5C;AAED,MAAM,WAAW,aAAc,SAAQ,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IACtF;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;IAC7C;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IAChD;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;OAEG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,GAAG,qBAAqB,EAAE,CAAC;IAClF;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC5D;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAClC;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACjC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;CAC/C;AA6DD,eAAO,MAAM,aAAa,YAAY,CAAC;AAEvC,eAAO,MAAM,WAAW,qEACc,CAAC;AAEvC,eAAO,MAAM,kBAAkB,wCAc9B,CAAC;AAYF,QAAA,MAAM,QAAQ,qNAuUb,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EmotionCanvasTheme } from '@workday/canvas-kit-react/common';
|
|
2
|
+
import { CSSProperties } from '@workday/canvas-kit-react/tokens';
|
|
3
|
+
declare type paletteSelection = Exclude<keyof EmotionCanvasTheme['canvas']['palette'], 'common'>;
|
|
4
|
+
interface ContrastColors {
|
|
5
|
+
outer?: string;
|
|
6
|
+
inner?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function getPaletteColors(type: paletteSelection, theme?: EmotionCanvasTheme): ContrastColors;
|
|
9
|
+
export declare const useThemedRing: (type: "alert" | "error" | "primary" | "success" | "neutral") => CSSProperties;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=useThemedRing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useThemedRing.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/useThemedRing.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,kBAAkB,EAAC,MAAM,kCAAkC,CAAC;AACxF,OAAO,EAAS,aAAa,EAAc,MAAM,kCAAkC,CAAC;AAGpF,aAAK,gBAAgB,GAAG,OAAO,CAAC,MAAM,kBAAkB,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,CAAC;AACzF,UAAU,cAAc;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAkBD,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,gBAAgB,EACtB,KAAK,CAAC,EAAE,kBAAkB,GACzB,cAAc,CA0BhB;AAED,eAAO,MAAM,aAAa,gFAyBzB,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var useThemeRTL_1 = require("./useThemeRTL");
|
|
7
|
+
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
8
|
+
var chroma_js_1 = __importDefault(require("chroma-js"));
|
|
9
|
+
var isAccessible = function (foreground, background) {
|
|
10
|
+
if (background === void 0) { background = tokens_1.colors.frenchVanilla100; }
|
|
11
|
+
return chroma_js_1.default.contrast(foreground, background) >= 3;
|
|
12
|
+
};
|
|
13
|
+
var getPaletteColorsFromTheme = function (fallbackColors, palette) {
|
|
14
|
+
return palette
|
|
15
|
+
? {
|
|
16
|
+
outer: isAccessible(palette === null || palette === void 0 ? void 0 : palette.main) ? palette === null || palette === void 0 ? void 0 : palette.main : palette === null || palette === void 0 ? void 0 : palette.darkest,
|
|
17
|
+
inner: palette === null || palette === void 0 ? void 0 : palette.main,
|
|
18
|
+
}
|
|
19
|
+
: fallbackColors;
|
|
20
|
+
};
|
|
21
|
+
function getPaletteColors(type, theme) {
|
|
22
|
+
var palette = theme === null || theme === void 0 ? void 0 : theme.canvas.palette[type];
|
|
23
|
+
switch (type) {
|
|
24
|
+
case 'error': {
|
|
25
|
+
return getPaletteColorsFromTheme({
|
|
26
|
+
outer: tokens_1.inputColors.error.border,
|
|
27
|
+
inner: tokens_1.inputColors.error.border,
|
|
28
|
+
}, palette);
|
|
29
|
+
}
|
|
30
|
+
case 'alert': {
|
|
31
|
+
return getPaletteColorsFromTheme({
|
|
32
|
+
outer: tokens_1.colors.cantaloupe600,
|
|
33
|
+
inner: tokens_1.inputColors.alert.border,
|
|
34
|
+
}, palette);
|
|
35
|
+
}
|
|
36
|
+
default: {
|
|
37
|
+
return getPaletteColorsFromTheme({}, palette);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.getPaletteColors = getPaletteColors;
|
|
42
|
+
exports.useThemedRing = function (type) {
|
|
43
|
+
var _a = useThemeRTL_1.useThemeRTL(), themeRTL = _a.themeRTL, theme = _a.theme;
|
|
44
|
+
var paletteColors = getPaletteColors(type, theme);
|
|
45
|
+
if (!((paletteColors === null || paletteColors === void 0 ? void 0 : paletteColors.outer) || (paletteColors === null || paletteColors === void 0 ? void 0 : paletteColors.inner))) {
|
|
46
|
+
return {};
|
|
47
|
+
}
|
|
48
|
+
var errorBoxShadow = "inset 0 0 0 " + (paletteColors.outer === paletteColors.inner ? 1 : 2) + "px " + paletteColors.inner;
|
|
49
|
+
return themeRTL({
|
|
50
|
+
borderColor: paletteColors.outer,
|
|
51
|
+
transition: '100ms box-shadow',
|
|
52
|
+
boxShadow: errorBoxShadow,
|
|
53
|
+
'&:hover, &:disabled': {
|
|
54
|
+
borderColor: paletteColors.outer,
|
|
55
|
+
},
|
|
56
|
+
'&:focus:not([disabled])': {
|
|
57
|
+
borderColor: paletteColors.outer,
|
|
58
|
+
boxShadow: errorBoxShadow + ",\n 0 0 0 2px " + tokens_1.colors.frenchVanilla100 + ",\n 0 0 0 4px " + (theme ? theme.canvas.palette.common.focusOutline : tokens_1.inputColors.focusBorder),
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
export default
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
1
|
+
import DeprecatedHeader from './lib/Header';
|
|
2
|
+
import DeprecatedGlobalHeader from './lib/GlobalHeader';
|
|
3
|
+
export default DeprecatedHeader;
|
|
4
|
+
export { DeprecatedHeader };
|
|
5
|
+
export { DeprecatedGlobalHeader };
|
|
6
6
|
export * from './lib/parts';
|
|
7
7
|
export * from './lib/shared/themes';
|
|
8
8
|
export * from './lib/shared/types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../header/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../header/index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,cAAc,CAAC;AAC5C,OAAO,sBAAsB,MAAM,oBAAoB,CAAC;AAExD,eAAe,gBAAgB,CAAC;AAChC,OAAO,EAAC,gBAAgB,EAAC,CAAC;AAC1B,OAAO,EAAC,sBAAsB,EAAC,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
|
|
@@ -7,9 +7,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
var Header_1 = __importDefault(require("./lib/Header"));
|
|
10
|
-
exports.
|
|
10
|
+
exports.DeprecatedHeader = Header_1.default;
|
|
11
11
|
var GlobalHeader_1 = __importDefault(require("./lib/GlobalHeader"));
|
|
12
|
-
exports.
|
|
12
|
+
exports.DeprecatedGlobalHeader = GlobalHeader_1.default;
|
|
13
13
|
exports.default = Header_1.default;
|
|
14
14
|
__export(require("./lib/parts"));
|
|
15
15
|
__export(require("./lib/shared/themes"));
|
|
@@ -19,11 +19,20 @@ export interface GlobalHeaderProps {
|
|
|
19
19
|
*/
|
|
20
20
|
isCollapsed?: boolean;
|
|
21
21
|
/**
|
|
22
|
-
* The React element to render in the left slot of the GlobalHeader. This is typically a
|
|
22
|
+
* The React element to render in the left slot of the GlobalHeader. This is typically a SearchForm component.
|
|
23
23
|
*/
|
|
24
24
|
leftSlot?: React.ReactElement;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
/**
|
|
27
|
+
* ### Deprecated Global Header
|
|
28
|
+
*
|
|
29
|
+
* As of Canvas Kit v6, this component is being soft-deprecated.
|
|
30
|
+
* It will be hard-deprecated (completely removed) in v7. Please see the
|
|
31
|
+
* [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
|
|
32
|
+
* for more information.
|
|
33
|
+
*/
|
|
34
|
+
export default class DeprecatedGlobalHeader extends React.Component<GlobalHeaderProps> {
|
|
35
|
+
componentDidMount(): void;
|
|
27
36
|
render(): JSX.Element;
|
|
28
37
|
}
|
|
29
38
|
//# sourceMappingURL=GlobalHeader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalHeader.d.ts","sourceRoot":"","sources":["../../../../header/lib/GlobalHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC5C;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;CAC/B;AAED,MAAM,CAAC,OAAO,OAAO,
|
|
1
|
+
{"version":3,"file":"GlobalHeader.d.ts","sourceRoot":"","sources":["../../../../header/lib/GlobalHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC5C;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;CAC/B;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC;IACpF,iBAAiB;IASV,MAAM;CAwBd"}
|
|
@@ -49,15 +49,26 @@ var React = __importStar(require("react"));
|
|
|
49
49
|
var Header_1 = __importDefault(require("./Header"));
|
|
50
50
|
var types_1 = require("./shared/types");
|
|
51
51
|
var parts_1 = require("./parts");
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
/**
|
|
53
|
+
* ### Deprecated Global Header
|
|
54
|
+
*
|
|
55
|
+
* As of Canvas Kit v6, this component is being soft-deprecated.
|
|
56
|
+
* It will be hard-deprecated (completely removed) in v7. Please see the
|
|
57
|
+
* [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
|
|
58
|
+
* for more information.
|
|
59
|
+
*/
|
|
60
|
+
var DeprecatedGlobalHeader = /** @class */ (function (_super) {
|
|
61
|
+
__extends(DeprecatedGlobalHeader, _super);
|
|
62
|
+
function DeprecatedGlobalHeader() {
|
|
55
63
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
56
64
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return (React.createElement(Header_1.default, __assign({ brand: brand, menuToggle: menuToggle, leftSlot: leftSlot, onMenuClick: onMenuClick, variant: types_1.HeaderVariant.Global, isCollapsed: isCollapsed }, elemProps), children));
|
|
65
|
+
DeprecatedGlobalHeader.prototype.componentDidMount = function () {
|
|
66
|
+
console.warn("GlobalHeader is being deprecated and will be removed in Canvas Kit V7.\n\n For more information, please see the V6 migration guide:\n\n https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page\n ");
|
|
60
67
|
};
|
|
61
|
-
|
|
68
|
+
DeprecatedGlobalHeader.prototype.render = function () {
|
|
69
|
+
var _a = this.props, _b = _a.brand, brand = _b === void 0 ? React.createElement(parts_1.DeprecatedDubLogoTitle, null) : _b, menuToggle = _a.menuToggle, onMenuClick = _a.onMenuClick, isCollapsed = _a.isCollapsed, leftSlot = _a.leftSlot, children = _a.children, elemProps = __rest(_a, ["brand", "menuToggle", "onMenuClick", "isCollapsed", "leftSlot", "children"]);
|
|
70
|
+
return (React.createElement(Header_1.default, __assign({ brand: brand, menuToggle: menuToggle, leftSlot: leftSlot, onMenuClick: onMenuClick, variant: types_1.DeprecatedHeaderVariant.Global, isCollapsed: isCollapsed }, elemProps), children));
|
|
71
|
+
};
|
|
72
|
+
return DeprecatedGlobalHeader;
|
|
62
73
|
}(React.Component));
|
|
63
|
-
exports.default =
|
|
74
|
+
exports.default = DeprecatedGlobalHeader;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { DeprecatedHeaderTheme, DeprecatedHeaderVariant } from './shared/types';
|
|
3
3
|
export interface HeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
/**
|
|
5
5
|
* The custom menu toggle node of the Header. This React node replaces the default menu toggle.
|
|
@@ -7,14 +7,14 @@ export interface HeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
7
7
|
menuToggle?: React.ReactNode;
|
|
8
8
|
/**
|
|
9
9
|
* The theme of the Header. Accepts `White`, `Blue`, or `Transparent`.
|
|
10
|
-
* @default
|
|
10
|
+
* @default DeprecatedHeaderTheme.White
|
|
11
11
|
*/
|
|
12
|
-
themeColor?:
|
|
12
|
+
themeColor?: DeprecatedHeaderTheme;
|
|
13
13
|
/**
|
|
14
14
|
* The variant of the Header. Accepts `Dub` (small) or `Full` (large).
|
|
15
|
-
* @default
|
|
15
|
+
* @default DeprecatedHeaderVariant.Dub
|
|
16
16
|
*/
|
|
17
|
-
variant?:
|
|
17
|
+
variant?: DeprecatedHeaderVariant;
|
|
18
18
|
/**
|
|
19
19
|
* The text of the Header title. Not used if `brand` is provided.
|
|
20
20
|
*/
|
|
@@ -37,7 +37,7 @@ export interface HeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
37
37
|
*/
|
|
38
38
|
onMenuClick?: (e: React.MouseEvent) => void;
|
|
39
39
|
/**
|
|
40
|
-
* The React element to render in the left slot of the Header. This is typically a
|
|
40
|
+
* The React element to render in the left slot of the Header. This is typically a SearchForm component.
|
|
41
41
|
*/
|
|
42
42
|
leftSlot?: React.ReactElement;
|
|
43
43
|
/**
|
|
@@ -46,9 +46,18 @@ export interface HeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
46
46
|
*/
|
|
47
47
|
isCollapsed?: boolean;
|
|
48
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* ### Deprecated Header
|
|
51
|
+
*
|
|
52
|
+
* As of Canvas Kit v6, this component is being soft-deprecated.
|
|
53
|
+
* It will be hard-deprecated (completely removed) in v7. Please see the
|
|
54
|
+
* [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
|
|
55
|
+
* for more information.
|
|
56
|
+
*/
|
|
49
57
|
export default class Header extends React.Component<HeaderProps, {}> {
|
|
50
|
-
static Theme: typeof
|
|
51
|
-
static Variant: typeof
|
|
58
|
+
static Theme: typeof DeprecatedHeaderTheme;
|
|
59
|
+
static Variant: typeof DeprecatedHeaderVariant;
|
|
60
|
+
componentDidMount(): void;
|
|
52
61
|
/**
|
|
53
62
|
* Helper that recursively maps ReactNodes to their theme-based equivalent.
|
|
54
63
|
* Any children that are included in a Header may need to undergo transformation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../../header/lib/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../../header/lib/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAEL,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,gBAAgB,CAAC;AAMxB,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACvE;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B;;;OAGG;IACH,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC;;;OAGG;IACH,OAAO,CAAC,EAAE,uBAAuB,CAAC;IAClC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC5C;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC9B;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AA4ND;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC;IAClE,MAAM,CAAC,KAAK,+BAAyB;IACrC,MAAM,CAAC,OAAO,iCAA2B;IAEzC,iBAAiB;IASjB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,cAAc;IAwDtB,MAAM;CA0DP"}
|
|
@@ -60,7 +60,9 @@ var HeaderShell = styled_1.default('div')(__assign(__assign({ display: 'flex', a
|
|
|
60
60
|
var variant = _a.variant, themeColor = _a.themeColor;
|
|
61
61
|
return (__assign(__assign({
|
|
62
62
|
// Only the variant Full has a large header, all the other one (Dub, Global) have a small header height
|
|
63
|
-
height: variant === types_1.
|
|
63
|
+
height: variant === types_1.DeprecatedHeaderVariant.Full
|
|
64
|
+
? types_1.DeprecatedHeaderHeight.Large
|
|
65
|
+
: types_1.DeprecatedHeaderHeight.Small, background: themes_1.deprecatedHeaderThemes[themeColor].background }, themes_1.deprecatedHeaderThemes[themeColor].depth), { color: themes_1.deprecatedHeaderThemes[themeColor].color }));
|
|
64
66
|
});
|
|
65
67
|
var BrandSlot = styled_1.default('div')({
|
|
66
68
|
height: '100%',
|
|
@@ -77,7 +79,7 @@ var BrandLink = styled_1.default(button_1.Hyperlink)({
|
|
|
77
79
|
});
|
|
78
80
|
var navStyle = function (_a) {
|
|
79
81
|
var themeColor = _a.themeColor;
|
|
80
|
-
var theme = themes_1.
|
|
82
|
+
var theme = themes_1.deprecatedHeaderThemes[themeColor];
|
|
81
83
|
return core_1.css({
|
|
82
84
|
nav: {
|
|
83
85
|
display: 'flex',
|
|
@@ -185,17 +187,17 @@ var Brand = /** @class */ (function (_super) {
|
|
|
185
187
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
186
188
|
}
|
|
187
189
|
Brand.prototype.render = function () {
|
|
188
|
-
var _a = this.props, _b = _a.variant, variant = _b === void 0 ? types_1.
|
|
190
|
+
var _a = this.props, _b = _a.variant, variant = _b === void 0 ? types_1.DeprecatedHeaderVariant.Dub : _b, brand = _a.brand, _c = _a.themeColor, themeColor = _c === void 0 ? types_1.DeprecatedHeaderTheme.White : _c, title = _a.title;
|
|
189
191
|
switch (variant) {
|
|
190
|
-
case types_1.
|
|
192
|
+
case types_1.DeprecatedHeaderVariant.Global: {
|
|
191
193
|
return React.createElement("span", null, brand);
|
|
192
194
|
}
|
|
193
|
-
case types_1.
|
|
194
|
-
return (React.createElement("span", null, brand || React.createElement(parts_1.
|
|
195
|
+
case types_1.DeprecatedHeaderVariant.Full: {
|
|
196
|
+
return (React.createElement("span", null, brand || (React.createElement(parts_1.DeprecatedWorkdayLogoTitle, { title: title ? title : '', themeColor: themeColor }))));
|
|
195
197
|
}
|
|
196
|
-
//
|
|
198
|
+
// DeprecatedHeaderVariant.Dub is default
|
|
197
199
|
default: {
|
|
198
|
-
return (React.createElement("span", null, brand || React.createElement(parts_1.
|
|
200
|
+
return (React.createElement("span", null, brand || React.createElement(parts_1.DeprecatedDubLogoTitle, { title: title ? title : '', themeColor: themeColor })));
|
|
199
201
|
}
|
|
200
202
|
}
|
|
201
203
|
};
|
|
@@ -207,7 +209,7 @@ var MenuIconButton = /** @class */ (function (_super) {
|
|
|
207
209
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
208
210
|
}
|
|
209
211
|
MenuIconButton.prototype.render = function () {
|
|
210
|
-
var _a = this.props, _b = _a.themeColor, themeColor = _b === void 0 ? types_1.
|
|
212
|
+
var _a = this.props, _b = _a.themeColor, themeColor = _b === void 0 ? types_1.DeprecatedHeaderTheme.White : _b, menuToggle = _a.menuToggle, onMenuClick = _a.onMenuClick;
|
|
211
213
|
if (menuToggle) {
|
|
212
214
|
var menuToggleElement = menuToggle;
|
|
213
215
|
var onClick = menuToggleElement.props.onClick
|
|
@@ -218,15 +220,26 @@ var MenuIconButton = /** @class */ (function (_super) {
|
|
|
218
220
|
className: 'canvas-header--menu-icon',
|
|
219
221
|
});
|
|
220
222
|
}
|
|
221
|
-
return (React.createElement(button_1.IconButton, { variant: themeColor === types_1.
|
|
223
|
+
return (React.createElement(button_1.IconButton, { variant: themeColor === types_1.DeprecatedHeaderTheme.White ? 'circle' : 'inverse', icon: canvas_system_icons_web_1.justifyIcon, className: 'canvas-header--menu-icon', "aria-label": "Open Menu", onClick: onMenuClick }));
|
|
222
224
|
};
|
|
223
225
|
return MenuIconButton;
|
|
224
226
|
}(React.Component));
|
|
227
|
+
/**
|
|
228
|
+
* ### Deprecated Header
|
|
229
|
+
*
|
|
230
|
+
* As of Canvas Kit v6, this component is being soft-deprecated.
|
|
231
|
+
* It will be hard-deprecated (completely removed) in v7. Please see the
|
|
232
|
+
* [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
|
|
233
|
+
* for more information.
|
|
234
|
+
*/
|
|
225
235
|
var Header = /** @class */ (function (_super) {
|
|
226
236
|
__extends(Header, _super);
|
|
227
237
|
function Header() {
|
|
228
238
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
229
239
|
}
|
|
240
|
+
Header.prototype.componentDidMount = function () {
|
|
241
|
+
console.warn("Header is being deprecated and will be removed in Canvas Kit V7.\n\n For more information, please see the V6 migration guide:\n\n https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page\n ");
|
|
242
|
+
};
|
|
230
243
|
/**
|
|
231
244
|
* Helper that recursively maps ReactNodes to their theme-based equivalent.
|
|
232
245
|
* Any children that are included in a Header may need to undergo transformation
|
|
@@ -247,7 +260,7 @@ var Header = /** @class */ (function (_super) {
|
|
|
247
260
|
}
|
|
248
261
|
var propsChildren = child.props.children;
|
|
249
262
|
var singleChild = React.Children.count(propsChildren) === 1 && propsChildren;
|
|
250
|
-
var iconButtonVariant = _this.props.themeColor === types_1.
|
|
263
|
+
var iconButtonVariant = _this.props.themeColor === types_1.DeprecatedHeaderTheme.White ? 'circle' : 'inverse';
|
|
251
264
|
// Convert old method of SystemIcon into IconButton. If SystemIcon is within a link, make sure it's passed through
|
|
252
265
|
if (child.type === 'a' && singleChild && singleChild.type === icon_1.SystemIcon) {
|
|
253
266
|
var href_1 = child.props.href;
|
|
@@ -283,7 +296,7 @@ var Header = /** @class */ (function (_super) {
|
|
|
283
296
|
});
|
|
284
297
|
};
|
|
285
298
|
Header.prototype.render = function () {
|
|
286
|
-
var _a = this.props, menuToggle = _a.menuToggle, _b = _a.themeColor, themeColor = _b === void 0 ? types_1.
|
|
299
|
+
var _a = this.props, menuToggle = _a.menuToggle, _b = _a.themeColor, themeColor = _b === void 0 ? types_1.DeprecatedHeaderTheme.White : _b, _c = _a.variant, variant = _c === void 0 ? types_1.DeprecatedHeaderVariant.Dub : _c, centeredNav = _a.centeredNav, title = _a.title, brand = _a.brand, brandUrl = _a.brandUrl, onMenuClick = _a.onMenuClick, leftSlot = _a.leftSlot, isCollapsed = _a.isCollapsed, children = _a.children, elemProps = __rest(_a, ["menuToggle", "themeColor", "variant", "centeredNav", "title", "brand", "brandUrl", "onMenuClick", "leftSlot", "isCollapsed", "children"]);
|
|
287
300
|
/* Push everything to the right if:
|
|
288
301
|
- on tablet and mobile screens
|
|
289
302
|
- Search isn't enabled and the nav shouldn't be centered
|
|
@@ -301,8 +314,8 @@ var Header = /** @class */ (function (_super) {
|
|
|
301
314
|
// TODO: This needs to get changed to IconButton when we get it restyled for headers
|
|
302
315
|
React.createElement(MenuIconButton, { themeColor: themeColor, menuToggle: menuToggle, onMenuClick: onMenuClick })) : (this.renderChildren(children)))));
|
|
303
316
|
};
|
|
304
|
-
Header.Theme = types_1.
|
|
305
|
-
Header.Variant = types_1.
|
|
317
|
+
Header.Theme = types_1.DeprecatedHeaderTheme;
|
|
318
|
+
Header.Variant = types_1.DeprecatedHeaderVariant;
|
|
306
319
|
return Header;
|
|
307
320
|
}(React.Component));
|
|
308
321
|
exports.default = Header;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { DeprecatedHeaderTheme } from '../shared/types';
|
|
3
3
|
export declare type DubTitleProps = {
|
|
4
4
|
/**
|
|
5
5
|
* The theme of the DubLogoTitle. Accepts `White`, `Blue`, or `Transparent`.
|
|
6
|
-
* @default
|
|
6
|
+
* @default DeprecatedHeaderTheme.White
|
|
7
7
|
*/
|
|
8
|
-
themeColor?:
|
|
8
|
+
themeColor?: DeprecatedHeaderTheme;
|
|
9
9
|
/**
|
|
10
10
|
* The text of the DubLogoTitle. Not used if `brand` is provided.
|
|
11
11
|
*/
|
|
@@ -15,7 +15,16 @@ export declare type DubTitleProps = {
|
|
|
15
15
|
*/
|
|
16
16
|
bgColor?: string;
|
|
17
17
|
};
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* ### Deprecated Dub Logo Title
|
|
20
|
+
*
|
|
21
|
+
* As of Canvas Kit v6, this component is being soft-deprecated.
|
|
22
|
+
* It will be hard-deprecated (completely removed) in v7. Please see the
|
|
23
|
+
* [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
|
|
24
|
+
* for more information.
|
|
25
|
+
*/
|
|
26
|
+
export declare class DeprecatedDubLogoTitle extends React.Component<DubTitleProps> {
|
|
27
|
+
componentDidMount(): void;
|
|
19
28
|
render(): JSX.Element;
|
|
20
29
|
}
|
|
21
30
|
//# sourceMappingURL=DubLogoTitle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DubLogoTitle.d.ts","sourceRoot":"","sources":["../../../../../header/lib/parts/DubLogoTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,
|
|
1
|
+
{"version":3,"file":"DubLogoTitle.d.ts","sourceRoot":"","sources":["../../../../../header/lib/parts/DubLogoTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAyB,qBAAqB,EAAC,MAAM,iBAAiB,CAAC;AAI9E,oBAAY,aAAa,GAAG;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AA4CF;;;;;;;GAOG;AACH,qBAAa,sBAAuB,SAAQ,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC;IACxE,iBAAiB;IAQjB,MAAM;CAgBP"}
|
|
@@ -46,7 +46,7 @@ var LockupContainer = styled_1.default('div')({
|
|
|
46
46
|
var Lockup = styled_1.default('div')({
|
|
47
47
|
display: 'flex',
|
|
48
48
|
alignItems: 'center',
|
|
49
|
-
height: types_1.
|
|
49
|
+
height: types_1.DeprecatedHeaderHeight.Small,
|
|
50
50
|
paddingLeft: tokens_1.space.m,
|
|
51
51
|
}, function (_a) {
|
|
52
52
|
var bgColor = _a.bgColor;
|
|
@@ -64,8 +64,8 @@ var Title = styled_1.default('h3')({
|
|
|
64
64
|
}, function (_a) {
|
|
65
65
|
var themeColor = _a.themeColor;
|
|
66
66
|
return ({
|
|
67
|
-
color: themeColor === types_1.
|
|
68
|
-
borderLeft: "1px solid " + (themeColor === types_1.
|
|
67
|
+
color: themeColor === types_1.DeprecatedHeaderTheme.White ? tokens_1.colors.blueberry500 : tokens_1.colors.frenchVanilla100,
|
|
68
|
+
borderLeft: "1px solid " + (themeColor === types_1.DeprecatedHeaderTheme.White
|
|
69
69
|
? tokens_1.colors.soap400
|
|
70
70
|
: chroma_js_1.default(tokens_1.colors.frenchVanilla100)
|
|
71
71
|
.alpha(0.3)
|
|
@@ -75,20 +75,31 @@ var Title = styled_1.default('h3')({
|
|
|
75
75
|
var DubLogo = styled_1.default('div')({
|
|
76
76
|
lineHeight: 0,
|
|
77
77
|
});
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
/**
|
|
79
|
+
* ### Deprecated Dub Logo Title
|
|
80
|
+
*
|
|
81
|
+
* As of Canvas Kit v6, this component is being soft-deprecated.
|
|
82
|
+
* It will be hard-deprecated (completely removed) in v7. Please see the
|
|
83
|
+
* [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
|
|
84
|
+
* for more information.
|
|
85
|
+
*/
|
|
86
|
+
var DeprecatedDubLogoTitle = /** @class */ (function (_super) {
|
|
87
|
+
__extends(DeprecatedDubLogoTitle, _super);
|
|
88
|
+
function DeprecatedDubLogoTitle() {
|
|
81
89
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
82
90
|
}
|
|
83
|
-
|
|
84
|
-
|
|
91
|
+
DeprecatedDubLogoTitle.prototype.componentDidMount = function () {
|
|
92
|
+
console.warn("DubLogoTitle is being deprecated and will be removed in Canvas Kit V7.\n\n For more information, please see the V6 migration guide:\n\n https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page\n ");
|
|
93
|
+
};
|
|
94
|
+
DeprecatedDubLogoTitle.prototype.render = function () {
|
|
95
|
+
var _a = this.props, _b = _a.themeColor, themeColor = _b === void 0 ? types_1.DeprecatedHeaderTheme.White : _b, title = _a.title;
|
|
85
96
|
return (React.createElement(LockupContainer, null,
|
|
86
97
|
React.createElement(Lockup, __assign({}, this.props),
|
|
87
98
|
React.createElement(DubLogo, __assign({}, this.props, { dangerouslySetInnerHTML: {
|
|
88
|
-
__html: themeColor === types_1.
|
|
99
|
+
__html: themeColor === types_1.DeprecatedHeaderTheme.White ? common_1.dubLogoBlue : common_1.dubLogoWhite,
|
|
89
100
|
} })),
|
|
90
101
|
title && React.createElement(Title, __assign({}, this.props), title))));
|
|
91
102
|
};
|
|
92
|
-
return
|
|
103
|
+
return DeprecatedDubLogoTitle;
|
|
93
104
|
}(React.Component));
|
|
94
|
-
exports.
|
|
105
|
+
exports.DeprecatedDubLogoTitle = DeprecatedDubLogoTitle;
|