@workday/canvas-kit-labs-react 6.0.0-beta.0-next.16 → 6.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/combobox/lib/AutocompleteList.tsx +5 -2
- package/combobox/lib/Combobox.tsx +0 -1
- package/common/lib/theming/index.ts +1 -0
- package/common/lib/theming/useThemedRing.ts +84 -0
- package/dist/commonjs/combobox/lib/AutocompleteList.d.ts.map +1 -1
- package/dist/commonjs/combobox/lib/AutocompleteList.js +5 -2
- package/dist/commonjs/combobox/lib/Combobox.d.ts.map +1 -1
- package/dist/commonjs/combobox/lib/Combobox.js +0 -1
- package/dist/commonjs/common/lib/theming/index.d.ts +1 -0
- package/dist/commonjs/common/lib/theming/index.d.ts.map +1 -1
- package/dist/commonjs/common/lib/theming/index.js +1 -0
- package/dist/commonjs/common/lib/theming/useThemedRing.d.ts +11 -0
- package/dist/commonjs/common/lib/theming/useThemedRing.d.ts.map +1 -0
- package/dist/commonjs/common/lib/theming/useThemedRing.js +61 -0
- package/dist/commonjs/header/index.d.ts +5 -5
- package/dist/commonjs/header/index.d.ts.map +1 -1
- package/dist/commonjs/header/index.js +2 -2
- package/dist/commonjs/header/lib/GlobalHeader.d.ts +11 -2
- package/dist/commonjs/header/lib/GlobalHeader.d.ts.map +1 -1
- package/dist/commonjs/header/lib/GlobalHeader.js +19 -8
- package/dist/commonjs/header/lib/Header.d.ts +17 -8
- package/dist/commonjs/header/lib/Header.d.ts.map +1 -1
- package/dist/commonjs/header/lib/Header.js +27 -14
- package/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts +13 -4
- package/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts.map +1 -1
- package/dist/commonjs/header/lib/parts/DubLogoTitle.js +22 -11
- package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts +14 -5
- package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts.map +1 -1
- package/dist/commonjs/header/lib/parts/WorkdayLogoTitle.js +25 -12
- package/dist/commonjs/header/lib/parts/index.d.ts +2 -3
- package/dist/commonjs/header/lib/parts/index.d.ts.map +1 -1
- package/dist/commonjs/header/lib/parts/index.js +2 -4
- package/dist/commonjs/header/lib/shared/themes.d.ts +28 -19
- package/dist/commonjs/header/lib/shared/themes.d.ts.map +1 -1
- package/dist/commonjs/header/lib/shared/themes.js +13 -36
- package/dist/commonjs/header/lib/shared/types.d.ts +3 -8
- package/dist/commonjs/header/lib/shared/types.d.ts.map +1 -1
- package/dist/commonjs/header/lib/shared/types.js +17 -23
- package/dist/commonjs/index.d.ts +2 -0
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +2 -0
- package/dist/commonjs/layout/lib/utils/getValidChildren.d.ts +1 -1
- package/dist/commonjs/layout/lib/utils/getValidChildren.d.ts.map +1 -1
- package/dist/commonjs/search-form/index.d.ts +3 -0
- package/dist/commonjs/search-form/index.d.ts.map +1 -0
- package/dist/commonjs/search-form/index.js +7 -0
- package/dist/commonjs/{header/lib/parts/SearchBar.d.ts → search-form/lib/SearchForm.d.ts} +22 -23
- package/dist/commonjs/search-form/lib/SearchForm.d.ts.map +1 -0
- package/dist/commonjs/{header/lib/parts/SearchBar.js → search-form/lib/SearchForm.js} +13 -14
- package/dist/commonjs/search-form/lib/themes.d.ts +21 -0
- package/dist/commonjs/search-form/lib/themes.d.ts.map +1 -0
- package/dist/commonjs/search-form/lib/themes.js +41 -0
- package/dist/commonjs/text-input/index.d.ts +7 -0
- package/dist/commonjs/text-input/index.d.ts.map +1 -0
- package/dist/commonjs/text-input/index.js +11 -0
- package/dist/commonjs/text-input/lib/TextInput.d.ts +21 -0
- package/dist/commonjs/text-input/lib/TextInput.d.ts.map +1 -0
- package/dist/commonjs/text-input/lib/TextInput.js +36 -0
- package/dist/commonjs/text-input/lib/TextInputField.d.ts +8 -0
- package/dist/commonjs/text-input/lib/TextInputField.d.ts.map +1 -0
- package/dist/commonjs/text-input/lib/TextInputField.js +66 -0
- package/dist/commonjs/text-input/lib/TextInputHint.d.ts +13 -0
- package/dist/commonjs/text-input/lib/TextInputHint.d.ts.map +1 -0
- package/dist/commonjs/text-input/lib/TextInputHint.js +46 -0
- package/dist/commonjs/text-input/lib/TextInputLabel.d.ts +17 -0
- package/dist/commonjs/text-input/lib/TextInputLabel.d.ts.map +1 -0
- package/dist/commonjs/text-input/lib/TextInputLabel.js +54 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +19 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts.map +1 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputField.js +16 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputHint.d.ts +15 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputHint.d.ts.map +1 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputHint.js +12 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputLabel.d.ts +15 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputLabel.d.ts.map +1 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputLabel.js +12 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +17 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -0
- package/dist/commonjs/text-input/lib/hooks/useTextInputModel.js +23 -0
- package/dist/es6/combobox/lib/AutocompleteList.d.ts.map +1 -1
- package/dist/es6/combobox/lib/AutocompleteList.js +5 -2
- package/dist/es6/combobox/lib/Combobox.d.ts.map +1 -1
- package/dist/es6/combobox/lib/Combobox.js +0 -1
- package/dist/es6/common/lib/theming/index.d.ts +1 -0
- package/dist/es6/common/lib/theming/index.d.ts.map +1 -1
- package/dist/es6/common/lib/theming/index.js +1 -0
- package/dist/es6/common/lib/theming/useThemedRing.d.ts +11 -0
- package/dist/es6/common/lib/theming/useThemedRing.d.ts.map +1 -0
- package/dist/es6/common/lib/theming/useThemedRing.js +55 -0
- package/dist/es6/header/index.d.ts +5 -5
- package/dist/es6/header/index.d.ts.map +1 -1
- package/dist/es6/header/index.js +5 -5
- package/dist/es6/header/lib/GlobalHeader.d.ts +11 -2
- package/dist/es6/header/lib/GlobalHeader.d.ts.map +1 -1
- package/dist/es6/header/lib/GlobalHeader.js +22 -11
- package/dist/es6/header/lib/Header.d.ts +17 -8
- package/dist/es6/header/lib/Header.d.ts.map +1 -1
- package/dist/es6/header/lib/Header.js +30 -17
- package/dist/es6/header/lib/parts/DubLogoTitle.d.ts +13 -4
- package/dist/es6/header/lib/parts/DubLogoTitle.d.ts.map +1 -1
- package/dist/es6/header/lib/parts/DubLogoTitle.js +23 -12
- package/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts +14 -5
- package/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts.map +1 -1
- package/dist/es6/header/lib/parts/WorkdayLogoTitle.js +26 -13
- package/dist/es6/header/lib/parts/index.d.ts +2 -3
- package/dist/es6/header/lib/parts/index.d.ts.map +1 -1
- package/dist/es6/header/lib/parts/index.js +2 -3
- package/dist/es6/header/lib/shared/themes.d.ts +28 -19
- package/dist/es6/header/lib/shared/themes.d.ts.map +1 -1
- package/dist/es6/header/lib/shared/themes.js +14 -37
- package/dist/es6/header/lib/shared/types.d.ts +3 -8
- package/dist/es6/header/lib/shared/types.d.ts.map +1 -1
- package/dist/es6/header/lib/shared/types.js +17 -23
- package/dist/es6/index.d.ts +2 -0
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +2 -0
- package/dist/es6/layout/lib/utils/getValidChildren.d.ts +1 -1
- package/dist/es6/layout/lib/utils/getValidChildren.d.ts.map +1 -1
- package/dist/es6/search-form/index.d.ts +3 -0
- package/dist/es6/search-form/index.d.ts.map +1 -0
- package/dist/es6/search-form/index.js +2 -0
- package/dist/es6/{header/lib/parts/SearchBar.d.ts → search-form/lib/SearchForm.d.ts} +22 -23
- package/dist/es6/search-form/lib/SearchForm.d.ts.map +1 -0
- package/dist/es6/{header/lib/parts/SearchBar.js → search-form/lib/SearchForm.js} +11 -12
- package/dist/es6/search-form/lib/themes.d.ts +21 -0
- package/dist/es6/search-form/lib/themes.d.ts.map +1 -0
- package/dist/es6/search-form/lib/themes.js +39 -0
- package/dist/es6/text-input/index.d.ts +7 -0
- package/dist/es6/text-input/index.d.ts.map +1 -0
- package/dist/es6/text-input/index.js +6 -0
- package/dist/es6/text-input/lib/TextInput.d.ts +21 -0
- package/dist/es6/text-input/lib/TextInput.d.ts.map +1 -0
- package/dist/es6/text-input/lib/TextInput.js +31 -0
- package/dist/es6/text-input/lib/TextInputField.d.ts +8 -0
- package/dist/es6/text-input/lib/TextInputField.d.ts.map +1 -0
- package/dist/es6/text-input/lib/TextInputField.js +64 -0
- package/dist/es6/text-input/lib/TextInputHint.d.ts +13 -0
- package/dist/es6/text-input/lib/TextInputHint.d.ts.map +1 -0
- package/dist/es6/text-input/lib/TextInputHint.js +44 -0
- package/dist/es6/text-input/lib/TextInputLabel.d.ts +17 -0
- package/dist/es6/text-input/lib/TextInputLabel.d.ts.map +1 -0
- package/dist/es6/text-input/lib/TextInputLabel.js +52 -0
- package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +19 -0
- package/dist/es6/text-input/lib/hooks/useTextInputField.d.ts.map +1 -0
- package/dist/es6/text-input/lib/hooks/useTextInputField.js +14 -0
- package/dist/es6/text-input/lib/hooks/useTextInputHint.d.ts +15 -0
- package/dist/es6/text-input/lib/hooks/useTextInputHint.d.ts.map +1 -0
- package/dist/es6/text-input/lib/hooks/useTextInputHint.js +10 -0
- package/dist/es6/text-input/lib/hooks/useTextInputLabel.d.ts +15 -0
- package/dist/es6/text-input/lib/hooks/useTextInputLabel.d.ts.map +1 -0
- package/dist/es6/text-input/lib/hooks/useTextInputLabel.js +10 -0
- package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +17 -0
- package/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts.map +1 -0
- package/dist/es6/text-input/lib/hooks/useTextInputModel.js +21 -0
- package/header/README.md +37 -181
- package/header/index.ts +5 -5
- package/header/lib/GlobalHeader.tsx +26 -9
- package/header/lib/Header.tsx +58 -26
- package/header/lib/parts/DubLogoTitle.tsx +26 -9
- package/header/lib/parts/WorkdayLogoTitle.tsx +40 -11
- package/header/lib/parts/index.ts +2 -3
- package/header/lib/shared/themes.tsx +32 -56
- package/header/lib/shared/types.tsx +3 -9
- package/index.ts +2 -0
- package/package.json +7 -5
- package/search-form/LICENSE +52 -0
- package/search-form/README.md +6 -0
- package/search-form/index.ts +2 -0
- package/{header/lib/parts/SearchBar.tsx → search-form/lib/SearchForm.tsx} +30 -31
- package/search-form/lib/themes.ts +54 -0
- package/search-form/package.json +5 -0
- package/text-input/LICENSE +52 -0
- package/text-input/README.md +11 -0
- package/text-input/index.ts +6 -0
- package/text-input/lib/TextInput.tsx +34 -0
- package/text-input/lib/TextInputField.tsx +75 -0
- package/text-input/lib/TextInputHint.tsx +52 -0
- package/text-input/lib/TextInputLabel.tsx +74 -0
- package/text-input/lib/hooks/useTextInputField.tsx +15 -0
- package/text-input/lib/hooks/useTextInputHint.tsx +11 -0
- package/text-input/lib/hooks/useTextInputLabel.tsx +11 -0
- package/text-input/lib/hooks/useTextInputModel.tsx +45 -0
- package/text-input/package.json +5 -0
- package/ts3.5/dist/commonjs/common/lib/theming/index.d.ts +1 -0
- package/ts3.5/dist/commonjs/common/lib/theming/useThemedRing.d.ts +11 -0
- package/ts3.5/dist/commonjs/header/index.d.ts +5 -5
- package/ts3.5/dist/commonjs/header/lib/GlobalHeader.d.ts +11 -2
- package/ts3.5/dist/commonjs/header/lib/Header.d.ts +17 -8
- package/ts3.5/dist/commonjs/header/lib/parts/DubLogoTitle.d.ts +13 -4
- package/ts3.5/dist/commonjs/header/lib/parts/WorkdayLogoTitle.d.ts +14 -5
- package/ts3.5/dist/commonjs/header/lib/parts/index.d.ts +2 -3
- package/ts3.5/dist/commonjs/header/lib/shared/themes.d.ts +28 -19
- package/ts3.5/dist/commonjs/header/lib/shared/types.d.ts +3 -8
- package/ts3.5/dist/commonjs/index.d.ts +2 -0
- package/ts3.5/dist/commonjs/layout/lib/utils/getValidChildren.d.ts +1 -1
- package/ts3.5/dist/commonjs/search-form/index.d.ts +3 -0
- package/ts3.5/dist/commonjs/{header/lib/parts/SearchBar.d.ts → search-form/lib/SearchForm.d.ts} +22 -23
- package/ts3.5/dist/commonjs/search-form/lib/themes.d.ts +21 -0
- package/ts3.5/dist/commonjs/text-input/index.d.ts +7 -0
- package/ts3.5/dist/commonjs/text-input/lib/TextInput.d.ts +21 -0
- package/ts3.5/dist/commonjs/text-input/lib/TextInputField.d.ts +8 -0
- package/ts3.5/dist/commonjs/text-input/lib/TextInputHint.d.ts +13 -0
- package/ts3.5/dist/commonjs/text-input/lib/TextInputLabel.d.ts +17 -0
- package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputField.d.ts +19 -0
- package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputHint.d.ts +15 -0
- package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputLabel.d.ts +15 -0
- package/ts3.5/dist/commonjs/text-input/lib/hooks/useTextInputModel.d.ts +17 -0
- package/ts3.5/dist/es6/common/lib/theming/index.d.ts +1 -0
- package/ts3.5/dist/es6/common/lib/theming/useThemedRing.d.ts +11 -0
- package/ts3.5/dist/es6/header/index.d.ts +5 -5
- package/ts3.5/dist/es6/header/lib/GlobalHeader.d.ts +11 -2
- package/ts3.5/dist/es6/header/lib/Header.d.ts +17 -8
- package/ts3.5/dist/es6/header/lib/parts/DubLogoTitle.d.ts +13 -4
- package/ts3.5/dist/es6/header/lib/parts/WorkdayLogoTitle.d.ts +14 -5
- package/ts3.5/dist/es6/header/lib/parts/index.d.ts +2 -3
- package/ts3.5/dist/es6/header/lib/shared/themes.d.ts +28 -19
- package/ts3.5/dist/es6/header/lib/shared/types.d.ts +3 -8
- package/ts3.5/dist/es6/index.d.ts +2 -0
- package/ts3.5/dist/es6/layout/lib/utils/getValidChildren.d.ts +1 -1
- package/ts3.5/dist/es6/search-form/index.d.ts +3 -0
- package/ts3.5/dist/es6/{header/lib/parts/SearchBar.d.ts → search-form/lib/SearchForm.d.ts} +22 -23
- package/ts3.5/dist/es6/search-form/lib/themes.d.ts +21 -0
- package/ts3.5/dist/es6/text-input/index.d.ts +7 -0
- package/ts3.5/dist/es6/text-input/lib/TextInput.d.ts +21 -0
- package/ts3.5/dist/es6/text-input/lib/TextInputField.d.ts +8 -0
- package/ts3.5/dist/es6/text-input/lib/TextInputHint.d.ts +13 -0
- package/ts3.5/dist/es6/text-input/lib/TextInputLabel.d.ts +17 -0
- package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputField.d.ts +19 -0
- package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputHint.d.ts +15 -0
- package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputLabel.d.ts +15 -0
- package/ts3.5/dist/es6/text-input/lib/hooks/useTextInputModel.d.ts +17 -0
- package/dist/commonjs/header/lib/parts/SearchBar.d.ts.map +0 -1
- package/dist/es6/header/lib/parts/SearchBar.d.ts.map +0 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { useThemeRTL } from './useThemeRTL';
|
|
2
|
+
import { colors, inputColors } from '@workday/canvas-kit-react/tokens';
|
|
3
|
+
import chroma from 'chroma-js';
|
|
4
|
+
var isAccessible = function (foreground, background) {
|
|
5
|
+
if (background === void 0) { background = colors.frenchVanilla100; }
|
|
6
|
+
return chroma.contrast(foreground, background) >= 3;
|
|
7
|
+
};
|
|
8
|
+
var getPaletteColorsFromTheme = function (fallbackColors, palette) {
|
|
9
|
+
return palette
|
|
10
|
+
? {
|
|
11
|
+
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,
|
|
12
|
+
inner: palette === null || palette === void 0 ? void 0 : palette.main,
|
|
13
|
+
}
|
|
14
|
+
: fallbackColors;
|
|
15
|
+
};
|
|
16
|
+
export function getPaletteColors(type, theme) {
|
|
17
|
+
var palette = theme === null || theme === void 0 ? void 0 : theme.canvas.palette[type];
|
|
18
|
+
switch (type) {
|
|
19
|
+
case 'error': {
|
|
20
|
+
return getPaletteColorsFromTheme({
|
|
21
|
+
outer: inputColors.error.border,
|
|
22
|
+
inner: inputColors.error.border,
|
|
23
|
+
}, palette);
|
|
24
|
+
}
|
|
25
|
+
case 'alert': {
|
|
26
|
+
return getPaletteColorsFromTheme({
|
|
27
|
+
outer: colors.cantaloupe600,
|
|
28
|
+
inner: inputColors.alert.border,
|
|
29
|
+
}, palette);
|
|
30
|
+
}
|
|
31
|
+
default: {
|
|
32
|
+
return getPaletteColorsFromTheme({}, palette);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export var useThemedRing = function (type) {
|
|
37
|
+
var _a = useThemeRTL(), themeRTL = _a.themeRTL, theme = _a.theme;
|
|
38
|
+
var paletteColors = getPaletteColors(type, theme);
|
|
39
|
+
if (!((paletteColors === null || paletteColors === void 0 ? void 0 : paletteColors.outer) || (paletteColors === null || paletteColors === void 0 ? void 0 : paletteColors.inner))) {
|
|
40
|
+
return {};
|
|
41
|
+
}
|
|
42
|
+
var errorBoxShadow = "inset 0 0 0 " + (paletteColors.outer === paletteColors.inner ? 1 : 2) + "px " + paletteColors.inner;
|
|
43
|
+
return themeRTL({
|
|
44
|
+
borderColor: paletteColors.outer,
|
|
45
|
+
transition: '100ms box-shadow',
|
|
46
|
+
boxShadow: errorBoxShadow,
|
|
47
|
+
'&:hover, &:disabled': {
|
|
48
|
+
borderColor: paletteColors.outer,
|
|
49
|
+
},
|
|
50
|
+
'&:focus:not([disabled])': {
|
|
51
|
+
borderColor: paletteColors.outer,
|
|
52
|
+
boxShadow: errorBoxShadow + ",\n 0 0 0 2px " + colors.frenchVanilla100 + ",\n 0 0 0 4px " + (theme ? theme.canvas.palette.common.focusOutline : inputColors.focusBorder),
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
};
|
|
@@ -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"}
|
package/dist/es6/header/index.js
CHANGED
|
@@ -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';
|
|
@@ -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"}
|
|
@@ -34,18 +34,29 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
34
34
|
return t;
|
|
35
35
|
};
|
|
36
36
|
import * as React from 'react';
|
|
37
|
-
import
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
import DeprecatedHeader from './Header';
|
|
38
|
+
import { DeprecatedHeaderVariant } from './shared/types';
|
|
39
|
+
import { DeprecatedDubLogoTitle } from './parts';
|
|
40
|
+
/**
|
|
41
|
+
* ### Deprecated Global Header
|
|
42
|
+
*
|
|
43
|
+
* As of Canvas Kit v6, this component is being soft-deprecated.
|
|
44
|
+
* It will be hard-deprecated (completely removed) in v7. Please see the
|
|
45
|
+
* [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
|
|
46
|
+
* for more information.
|
|
47
|
+
*/
|
|
48
|
+
var DeprecatedGlobalHeader = /** @class */ (function (_super) {
|
|
49
|
+
__extends(DeprecatedGlobalHeader, _super);
|
|
50
|
+
function DeprecatedGlobalHeader() {
|
|
43
51
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
44
52
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return (React.createElement(Header, __assign({ brand: brand, menuToggle: menuToggle, leftSlot: leftSlot, onMenuClick: onMenuClick, variant: HeaderVariant.Global, isCollapsed: isCollapsed }, elemProps), children));
|
|
53
|
+
DeprecatedGlobalHeader.prototype.componentDidMount = function () {
|
|
54
|
+
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 ");
|
|
48
55
|
};
|
|
49
|
-
|
|
56
|
+
DeprecatedGlobalHeader.prototype.render = function () {
|
|
57
|
+
var _a = this.props, _b = _a.brand, brand = _b === void 0 ? React.createElement(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"]);
|
|
58
|
+
return (React.createElement(DeprecatedHeader, __assign({ brand: brand, menuToggle: menuToggle, leftSlot: leftSlot, onMenuClick: onMenuClick, variant: DeprecatedHeaderVariant.Global, isCollapsed: isCollapsed }, elemProps), children));
|
|
59
|
+
};
|
|
60
|
+
return DeprecatedGlobalHeader;
|
|
50
61
|
}(React.Component));
|
|
51
|
-
export default
|
|
62
|
+
export 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"}
|
|
@@ -37,9 +37,9 @@ import * as React from 'react';
|
|
|
37
37
|
import { css } from '@emotion/core';
|
|
38
38
|
import styled from '@emotion/styled';
|
|
39
39
|
import { borderRadius, space, type } from '@workday/canvas-kit-react/tokens';
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
40
|
+
import { DeprecatedDubLogoTitle, DeprecatedWorkdayLogoTitle } from './parts';
|
|
41
|
+
import { deprecatedHeaderThemes } from './shared/themes';
|
|
42
|
+
import { DeprecatedHeaderHeight, DeprecatedHeaderTheme, DeprecatedHeaderVariant, } from './shared/types';
|
|
43
43
|
import { Hyperlink, IconButton } from '@workday/canvas-kit-react/button';
|
|
44
44
|
import { SystemIcon } from '@workday/canvas-kit-react/icon';
|
|
45
45
|
import { justifyIcon } from '@workday/canvas-system-icons-web';
|
|
@@ -48,7 +48,9 @@ var HeaderShell = styled('div')(__assign(__assign({ display: 'flex', alignItems:
|
|
|
48
48
|
var variant = _a.variant, themeColor = _a.themeColor;
|
|
49
49
|
return (__assign(__assign({
|
|
50
50
|
// Only the variant Full has a large header, all the other one (Dub, Global) have a small header height
|
|
51
|
-
height: variant ===
|
|
51
|
+
height: variant === DeprecatedHeaderVariant.Full
|
|
52
|
+
? DeprecatedHeaderHeight.Large
|
|
53
|
+
: DeprecatedHeaderHeight.Small, background: deprecatedHeaderThemes[themeColor].background }, deprecatedHeaderThemes[themeColor].depth), { color: deprecatedHeaderThemes[themeColor].color }));
|
|
52
54
|
});
|
|
53
55
|
var BrandSlot = styled('div')({
|
|
54
56
|
height: '100%',
|
|
@@ -65,7 +67,7 @@ var BrandLink = styled(Hyperlink)({
|
|
|
65
67
|
});
|
|
66
68
|
var navStyle = function (_a) {
|
|
67
69
|
var themeColor = _a.themeColor;
|
|
68
|
-
var theme =
|
|
70
|
+
var theme = deprecatedHeaderThemes[themeColor];
|
|
69
71
|
return css({
|
|
70
72
|
nav: {
|
|
71
73
|
display: 'flex',
|
|
@@ -173,17 +175,17 @@ var Brand = /** @class */ (function (_super) {
|
|
|
173
175
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
174
176
|
}
|
|
175
177
|
Brand.prototype.render = function () {
|
|
176
|
-
var _a = this.props, _b = _a.variant, variant = _b === void 0 ?
|
|
178
|
+
var _a = this.props, _b = _a.variant, variant = _b === void 0 ? DeprecatedHeaderVariant.Dub : _b, brand = _a.brand, _c = _a.themeColor, themeColor = _c === void 0 ? DeprecatedHeaderTheme.White : _c, title = _a.title;
|
|
177
179
|
switch (variant) {
|
|
178
|
-
case
|
|
180
|
+
case DeprecatedHeaderVariant.Global: {
|
|
179
181
|
return React.createElement("span", null, brand);
|
|
180
182
|
}
|
|
181
|
-
case
|
|
182
|
-
return (React.createElement("span", null, brand || React.createElement(
|
|
183
|
+
case DeprecatedHeaderVariant.Full: {
|
|
184
|
+
return (React.createElement("span", null, brand || (React.createElement(DeprecatedWorkdayLogoTitle, { title: title ? title : '', themeColor: themeColor }))));
|
|
183
185
|
}
|
|
184
|
-
//
|
|
186
|
+
// DeprecatedHeaderVariant.Dub is default
|
|
185
187
|
default: {
|
|
186
|
-
return (React.createElement("span", null, brand || React.createElement(
|
|
188
|
+
return (React.createElement("span", null, brand || React.createElement(DeprecatedDubLogoTitle, { title: title ? title : '', themeColor: themeColor })));
|
|
187
189
|
}
|
|
188
190
|
}
|
|
189
191
|
};
|
|
@@ -195,7 +197,7 @@ var MenuIconButton = /** @class */ (function (_super) {
|
|
|
195
197
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
196
198
|
}
|
|
197
199
|
MenuIconButton.prototype.render = function () {
|
|
198
|
-
var _a = this.props, _b = _a.themeColor, themeColor = _b === void 0 ?
|
|
200
|
+
var _a = this.props, _b = _a.themeColor, themeColor = _b === void 0 ? DeprecatedHeaderTheme.White : _b, menuToggle = _a.menuToggle, onMenuClick = _a.onMenuClick;
|
|
199
201
|
if (menuToggle) {
|
|
200
202
|
var menuToggleElement = menuToggle;
|
|
201
203
|
var onClick = menuToggleElement.props.onClick
|
|
@@ -206,15 +208,26 @@ var MenuIconButton = /** @class */ (function (_super) {
|
|
|
206
208
|
className: 'canvas-header--menu-icon',
|
|
207
209
|
});
|
|
208
210
|
}
|
|
209
|
-
return (React.createElement(IconButton, { variant: themeColor ===
|
|
211
|
+
return (React.createElement(IconButton, { variant: themeColor === DeprecatedHeaderTheme.White ? 'circle' : 'inverse', icon: justifyIcon, className: 'canvas-header--menu-icon', "aria-label": "Open Menu", onClick: onMenuClick }));
|
|
210
212
|
};
|
|
211
213
|
return MenuIconButton;
|
|
212
214
|
}(React.Component));
|
|
215
|
+
/**
|
|
216
|
+
* ### Deprecated Header
|
|
217
|
+
*
|
|
218
|
+
* As of Canvas Kit v6, this component is being soft-deprecated.
|
|
219
|
+
* It will be hard-deprecated (completely removed) in v7. Please see the
|
|
220
|
+
* [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
|
|
221
|
+
* for more information.
|
|
222
|
+
*/
|
|
213
223
|
var Header = /** @class */ (function (_super) {
|
|
214
224
|
__extends(Header, _super);
|
|
215
225
|
function Header() {
|
|
216
226
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
217
227
|
}
|
|
228
|
+
Header.prototype.componentDidMount = function () {
|
|
229
|
+
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 ");
|
|
230
|
+
};
|
|
218
231
|
/**
|
|
219
232
|
* Helper that recursively maps ReactNodes to their theme-based equivalent.
|
|
220
233
|
* Any children that are included in a Header may need to undergo transformation
|
|
@@ -235,7 +248,7 @@ var Header = /** @class */ (function (_super) {
|
|
|
235
248
|
}
|
|
236
249
|
var propsChildren = child.props.children;
|
|
237
250
|
var singleChild = React.Children.count(propsChildren) === 1 && propsChildren;
|
|
238
|
-
var iconButtonVariant = _this.props.themeColor ===
|
|
251
|
+
var iconButtonVariant = _this.props.themeColor === DeprecatedHeaderTheme.White ? 'circle' : 'inverse';
|
|
239
252
|
// Convert old method of SystemIcon into IconButton. If SystemIcon is within a link, make sure it's passed through
|
|
240
253
|
if (child.type === 'a' && singleChild && singleChild.type === SystemIcon) {
|
|
241
254
|
var href_1 = child.props.href;
|
|
@@ -271,7 +284,7 @@ var Header = /** @class */ (function (_super) {
|
|
|
271
284
|
});
|
|
272
285
|
};
|
|
273
286
|
Header.prototype.render = function () {
|
|
274
|
-
var _a = this.props, menuToggle = _a.menuToggle, _b = _a.themeColor, themeColor = _b === void 0 ?
|
|
287
|
+
var _a = this.props, menuToggle = _a.menuToggle, _b = _a.themeColor, themeColor = _b === void 0 ? DeprecatedHeaderTheme.White : _b, _c = _a.variant, variant = _c === void 0 ? 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"]);
|
|
275
288
|
/* Push everything to the right if:
|
|
276
289
|
- on tablet and mobile screens
|
|
277
290
|
- Search isn't enabled and the nav shouldn't be centered
|
|
@@ -289,8 +302,8 @@ var Header = /** @class */ (function (_super) {
|
|
|
289
302
|
// TODO: This needs to get changed to IconButton when we get it restyled for headers
|
|
290
303
|
React.createElement(MenuIconButton, { themeColor: themeColor, menuToggle: menuToggle, onMenuClick: onMenuClick })) : (this.renderChildren(children)))));
|
|
291
304
|
};
|
|
292
|
-
Header.Theme =
|
|
293
|
-
Header.Variant =
|
|
305
|
+
Header.Theme = DeprecatedHeaderTheme;
|
|
306
|
+
Header.Variant = DeprecatedHeaderVariant;
|
|
294
307
|
return Header;
|
|
295
308
|
}(React.Component));
|
|
296
309
|
export 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"}
|
|
@@ -25,7 +25,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
25
25
|
import * as React from 'react';
|
|
26
26
|
import styled from '@emotion/styled';
|
|
27
27
|
import { colors, space } from '@workday/canvas-kit-react/tokens';
|
|
28
|
-
import {
|
|
28
|
+
import { DeprecatedHeaderHeight, DeprecatedHeaderTheme } from '../shared/types';
|
|
29
29
|
import chroma from 'chroma-js';
|
|
30
30
|
import { dubLogoWhite, dubLogoBlue } from '@workday/canvas-kit-react/common';
|
|
31
31
|
var LockupContainer = styled('div')({
|
|
@@ -34,7 +34,7 @@ var LockupContainer = styled('div')({
|
|
|
34
34
|
var Lockup = styled('div')({
|
|
35
35
|
display: 'flex',
|
|
36
36
|
alignItems: 'center',
|
|
37
|
-
height:
|
|
37
|
+
height: DeprecatedHeaderHeight.Small,
|
|
38
38
|
paddingLeft: space.m,
|
|
39
39
|
}, function (_a) {
|
|
40
40
|
var bgColor = _a.bgColor;
|
|
@@ -52,8 +52,8 @@ var Title = styled('h3')({
|
|
|
52
52
|
}, function (_a) {
|
|
53
53
|
var themeColor = _a.themeColor;
|
|
54
54
|
return ({
|
|
55
|
-
color: themeColor ===
|
|
56
|
-
borderLeft: "1px solid " + (themeColor ===
|
|
55
|
+
color: themeColor === DeprecatedHeaderTheme.White ? colors.blueberry500 : colors.frenchVanilla100,
|
|
56
|
+
borderLeft: "1px solid " + (themeColor === DeprecatedHeaderTheme.White
|
|
57
57
|
? colors.soap400
|
|
58
58
|
: chroma(colors.frenchVanilla100)
|
|
59
59
|
.alpha(0.3)
|
|
@@ -63,20 +63,31 @@ var Title = styled('h3')({
|
|
|
63
63
|
var DubLogo = styled('div')({
|
|
64
64
|
lineHeight: 0,
|
|
65
65
|
});
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
+
var DeprecatedDubLogoTitle = /** @class */ (function (_super) {
|
|
75
|
+
__extends(DeprecatedDubLogoTitle, _super);
|
|
76
|
+
function DeprecatedDubLogoTitle() {
|
|
69
77
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
70
78
|
}
|
|
71
|
-
|
|
72
|
-
|
|
79
|
+
DeprecatedDubLogoTitle.prototype.componentDidMount = function () {
|
|
80
|
+
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 ");
|
|
81
|
+
};
|
|
82
|
+
DeprecatedDubLogoTitle.prototype.render = function () {
|
|
83
|
+
var _a = this.props, _b = _a.themeColor, themeColor = _b === void 0 ? DeprecatedHeaderTheme.White : _b, title = _a.title;
|
|
73
84
|
return (React.createElement(LockupContainer, null,
|
|
74
85
|
React.createElement(Lockup, __assign({}, this.props),
|
|
75
86
|
React.createElement(DubLogo, __assign({}, this.props, { dangerouslySetInnerHTML: {
|
|
76
|
-
__html: themeColor ===
|
|
87
|
+
__html: themeColor === DeprecatedHeaderTheme.White ? dubLogoBlue : dubLogoWhite,
|
|
77
88
|
} })),
|
|
78
89
|
title && React.createElement(Title, __assign({}, this.props), title))));
|
|
79
90
|
};
|
|
80
|
-
return
|
|
91
|
+
return DeprecatedDubLogoTitle;
|
|
81
92
|
}(React.Component));
|
|
82
|
-
export {
|
|
93
|
+
export { DeprecatedDubLogoTitle };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { DeprecatedHeaderTheme, DeprecatedHeaderVariant } from '../shared/types';
|
|
3
3
|
export declare type WorkdayLogoTitleProps = {
|
|
4
4
|
/**
|
|
5
5
|
* The theme of the WorkdayLogoTitle. 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 WorkdayLogoTitle. Not used if `brand` is provided.
|
|
11
11
|
* @default ''
|
|
@@ -14,9 +14,18 @@ export declare type WorkdayLogoTitleProps = {
|
|
|
14
14
|
/**
|
|
15
15
|
* The variant of the WorkdayLogoTitle.
|
|
16
16
|
*/
|
|
17
|
-
variant?:
|
|
17
|
+
variant?: DeprecatedHeaderVariant;
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
/**
|
|
20
|
+
* ### Deprecated Workday Logo Title
|
|
21
|
+
*
|
|
22
|
+
* As of Canvas Kit v6, this component is being soft-deprecated.
|
|
23
|
+
* It will be hard-deprecated (completely removed) in v7. Please see the
|
|
24
|
+
* [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
|
|
25
|
+
* for more information.
|
|
26
|
+
*/
|
|
27
|
+
export declare class DeprecatedWorkdayLogoTitle extends React.Component<WorkdayLogoTitleProps> {
|
|
28
|
+
componentDidMount(): void;
|
|
20
29
|
render(): JSX.Element;
|
|
21
30
|
}
|
|
22
31
|
//# sourceMappingURL=WorkdayLogoTitle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkdayLogoTitle.d.ts","sourceRoot":"","sources":["../../../../../header/lib/parts/WorkdayLogoTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,
|
|
1
|
+
{"version":3,"file":"WorkdayLogoTitle.d.ts","sourceRoot":"","sources":["../../../../../header/lib/parts/WorkdayLogoTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAEL,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,iBAAiB,CAAC;AAKzB,oBAAY,qBAAqB,GAAG;IAClC;;;OAGG;IACH,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,uBAAuB,CAAC;CACnC,CAAC;AAiDF;;;;;;;GAOG;AACH,qBAAa,0BAA2B,SAAQ,KAAK,CAAC,SAAS,CAAC,qBAAqB,CAAC;IACpF,iBAAiB;IAQV,MAAM;CA2Bd"}
|
|
@@ -35,7 +35,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
35
35
|
};
|
|
36
36
|
import * as React from 'react';
|
|
37
37
|
import styled from '@emotion/styled';
|
|
38
|
-
import {
|
|
38
|
+
import { DeprecatedHeaderHeight, DeprecatedHeaderTheme, DeprecatedHeaderVariant, } from '../shared/types';
|
|
39
39
|
import { miniWdayLogoBlue, wdayLogoWhite, wdayLogoBlue } from '@workday/canvas-kit-react/common';
|
|
40
40
|
import { colors, space } from '@workday/canvas-kit-react/tokens';
|
|
41
41
|
import chroma from 'chroma-js';
|
|
@@ -49,7 +49,9 @@ var Lockup = styled('div')({
|
|
|
49
49
|
}, function (_a) {
|
|
50
50
|
var variant = _a.variant;
|
|
51
51
|
return ({
|
|
52
|
-
height: variant ===
|
|
52
|
+
height: variant === DeprecatedHeaderVariant.Global
|
|
53
|
+
? DeprecatedHeaderHeight.Small
|
|
54
|
+
: DeprecatedHeaderHeight.Large,
|
|
53
55
|
});
|
|
54
56
|
});
|
|
55
57
|
var Title = styled('h3')({
|
|
@@ -64,8 +66,8 @@ var Title = styled('h3')({
|
|
|
64
66
|
}, function (_a) {
|
|
65
67
|
var themeColor = _a.themeColor;
|
|
66
68
|
return ({
|
|
67
|
-
color: themeColor ===
|
|
68
|
-
borderLeft: "1px solid " + (themeColor ===
|
|
69
|
+
color: themeColor === DeprecatedHeaderTheme.White ? colors.blueberry500 : colors.frenchVanilla100,
|
|
70
|
+
borderLeft: "1px solid " + (themeColor === DeprecatedHeaderTheme.White
|
|
69
71
|
? colors.soap400
|
|
70
72
|
: chroma(colors.soap400)
|
|
71
73
|
.alpha(0.4)
|
|
@@ -76,24 +78,35 @@ var WorkdayLogo = styled('span')({
|
|
|
76
78
|
paddingLeft: space.m,
|
|
77
79
|
lineHeight: 0,
|
|
78
80
|
});
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
/**
|
|
82
|
+
* ### Deprecated Workday Logo Title
|
|
83
|
+
*
|
|
84
|
+
* As of Canvas Kit v6, this component is being soft-deprecated.
|
|
85
|
+
* It will be hard-deprecated (completely removed) in v7. Please see the
|
|
86
|
+
* [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
|
|
87
|
+
* for more information.
|
|
88
|
+
*/
|
|
89
|
+
var DeprecatedWorkdayLogoTitle = /** @class */ (function (_super) {
|
|
90
|
+
__extends(DeprecatedWorkdayLogoTitle, _super);
|
|
91
|
+
function DeprecatedWorkdayLogoTitle() {
|
|
82
92
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
83
93
|
}
|
|
84
|
-
|
|
85
|
-
|
|
94
|
+
DeprecatedWorkdayLogoTitle.prototype.componentDidMount = function () {
|
|
95
|
+
console.warn("WorkdayLogoTitle 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 ");
|
|
96
|
+
};
|
|
97
|
+
DeprecatedWorkdayLogoTitle.prototype.render = function () {
|
|
98
|
+
var _a = this.props, _b = _a.themeColor, themeColor = _b === void 0 ? DeprecatedHeaderTheme.White : _b, _c = _a.title, title = _c === void 0 ? '' : _c, variant = _a.variant, elemProps = __rest(_a, ["themeColor", "title", "variant"]);
|
|
86
99
|
return (React.createElement(LockupContainer, null,
|
|
87
100
|
React.createElement(Lockup, __assign({}, this.props, elemProps),
|
|
88
101
|
React.createElement(WorkdayLogo, __assign({}, this.props, { dangerouslySetInnerHTML: {
|
|
89
|
-
__html: themeColor ===
|
|
90
|
-
? variant ===
|
|
102
|
+
__html: themeColor === DeprecatedHeaderTheme.White
|
|
103
|
+
? variant === DeprecatedHeaderVariant.Global
|
|
91
104
|
? miniWdayLogoBlue
|
|
92
105
|
: wdayLogoBlue
|
|
93
106
|
: wdayLogoWhite,
|
|
94
107
|
} })),
|
|
95
108
|
title && React.createElement(Title, __assign({}, this.props), title))));
|
|
96
109
|
};
|
|
97
|
-
return
|
|
110
|
+
return DeprecatedWorkdayLogoTitle;
|
|
98
111
|
}(React.Component));
|
|
99
|
-
export {
|
|
112
|
+
export { DeprecatedWorkdayLogoTitle };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export { WorkdayLogoTitle } from './WorkdayLogoTitle';
|
|
1
|
+
export { DeprecatedDubLogoTitle } from './DubLogoTitle';
|
|
2
|
+
export { DeprecatedWorkdayLogoTitle } from './WorkdayLogoTitle';
|
|
4
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../header/lib/parts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../header/lib/parts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,sBAAsB,EAAC,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAC,0BAA0B,EAAC,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export { WorkdayLogoTitle } from './WorkdayLogoTitle';
|
|
1
|
+
export { DeprecatedDubLogoTitle } from './DubLogoTitle';
|
|
2
|
+
export { DeprecatedWorkdayLogoTitle } from './WorkdayLogoTitle';
|