@workday/canvas-kit-labs-react 5.3.0-next.2 → 5.3.0-next.24
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/README.md +32 -0
- package/common/lib/theming/index.ts +1 -0
- package/common/lib/theming/useThemedRing.ts +78 -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 +1 -0
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +1 -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/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 +1 -0
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +1 -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/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 +1 -0
- package/package.json +6 -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/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 +1 -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/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 +1 -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/dist/commonjs/header/lib/parts/SearchBar.d.ts.map +0 -1
- package/dist/es6/header/lib/parts/SearchBar.d.ts.map +0 -1
|
@@ -53,8 +53,7 @@ var canvas_system_icons_web_1 = require("@workday/canvas-system-icons-web");
|
|
|
53
53
|
var form_field_1 = require("@workday/canvas-kit-react/form-field");
|
|
54
54
|
var combobox_1 = require("@workday/canvas-kit-labs-react/combobox");
|
|
55
55
|
var text_input_1 = require("@workday/canvas-kit-react/text-input");
|
|
56
|
-
var themes_1 = require("
|
|
57
|
-
var types_1 = require("../shared/types");
|
|
56
|
+
var themes_1 = require("./themes");
|
|
58
57
|
var chroma_js_1 = __importDefault(require("chroma-js"));
|
|
59
58
|
var v4_1 = __importDefault(require("uuid/v4"));
|
|
60
59
|
function getInputColors(theme, isFocused) {
|
|
@@ -71,7 +70,7 @@ function getInputColors(theme, isFocused) {
|
|
|
71
70
|
var formCollapsedBackground = tokens_1.colors.frenchVanilla100;
|
|
72
71
|
var maxWidth = 480;
|
|
73
72
|
var minWidth = 120;
|
|
74
|
-
var
|
|
73
|
+
var StyledSearchForm = common_1.styled('form')({
|
|
75
74
|
position: 'relative',
|
|
76
75
|
flex: "1 1 auto",
|
|
77
76
|
display: 'flex',
|
|
@@ -198,9 +197,9 @@ var SearchInput = common_1.styled(text_input_1.TextInput)(function (_a) {
|
|
|
198
197
|
},
|
|
199
198
|
} }, collapseStyles);
|
|
200
199
|
});
|
|
201
|
-
var
|
|
202
|
-
__extends(
|
|
203
|
-
function
|
|
200
|
+
var SearchForm = /** @class */ (function (_super) {
|
|
201
|
+
__extends(SearchForm, _super);
|
|
202
|
+
function SearchForm() {
|
|
204
203
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
205
204
|
_this.inputRef = React.createRef();
|
|
206
205
|
_this.openRef = React.createRef();
|
|
@@ -219,13 +218,13 @@ var SearchBar = /** @class */ (function (_super) {
|
|
|
219
218
|
theme = _this.props.searchTheme;
|
|
220
219
|
}
|
|
221
220
|
else {
|
|
222
|
-
theme = themes_1.searchThemes[
|
|
221
|
+
theme = themes_1.searchThemes[themes_1.SearchTheme.Light];
|
|
223
222
|
}
|
|
224
223
|
return theme;
|
|
225
224
|
};
|
|
226
225
|
_this.getThemeColors = function () {
|
|
227
226
|
var theme = _this.props.isCollapsed && _this.state.showForm
|
|
228
|
-
? themes_1.searchThemes[
|
|
227
|
+
? themes_1.searchThemes[themes_1.SearchTheme.Transparent]
|
|
229
228
|
: _this.getTheme();
|
|
230
229
|
return getInputColors(theme, _this.state.isFocused);
|
|
231
230
|
};
|
|
@@ -281,7 +280,7 @@ var SearchBar = /** @class */ (function (_super) {
|
|
|
281
280
|
};
|
|
282
281
|
return _this;
|
|
283
282
|
}
|
|
284
|
-
|
|
283
|
+
SearchForm.prototype.componentDidUpdate = function (prevProps, prevState) {
|
|
285
284
|
var showFormToggled = this.state.showForm !== prevState.showForm;
|
|
286
285
|
if (showFormToggled) {
|
|
287
286
|
if (this.state.showForm) {
|
|
@@ -292,9 +291,9 @@ var SearchBar = /** @class */ (function (_super) {
|
|
|
292
291
|
}
|
|
293
292
|
}
|
|
294
293
|
};
|
|
295
|
-
|
|
294
|
+
SearchForm.prototype.render = function () {
|
|
296
295
|
var _a = this.props, _b = _a.clearButtonAriaLabel, clearButtonAriaLabel = _b === void 0 ? 'Reset Search Form' : _b, _c = _a.placeholder, placeholder = _c === void 0 ? 'Search' : _c, _d = _a.inputLabel, inputLabel = _d === void 0 ? 'Search' : _d, _e = _a.submitAriaLabel, submitAriaLabel = _e === void 0 ? 'Search' : _e, _f = _a.openButtonAriaLabel, openButtonAriaLabel = _f === void 0 ? 'Open Search' : _f, _g = _a.closeButtonAriaLabel, closeButtonAriaLabel = _g === void 0 ? 'Cancel' : _g, _h = _a.showClearButton, showClearButton = _h === void 0 ? true : _h, _j = _a.height, height = _j === void 0 ? 40 : _j, grow = _a.grow, onSubmit = _a.onSubmit, isCollapsed = _a.isCollapsed, onInputChange = _a.onInputChange, autocompleteItems = _a.autocompleteItems, initialValue = _a.initialValue, searchTheme = _a.searchTheme, rightAlign = _a.rightAlign, elemProps = __rest(_a, ["clearButtonAriaLabel", "placeholder", "inputLabel", "submitAriaLabel", "openButtonAriaLabel", "closeButtonAriaLabel", "showClearButton", "height", "grow", "onSubmit", "isCollapsed", "onInputChange", "autocompleteItems", "initialValue", "searchTheme", "rightAlign"]);
|
|
297
|
-
return (React.createElement(
|
|
296
|
+
return (React.createElement(StyledSearchForm, __assign({ role: "search", action: ".", rightAlign: rightAlign, grow: grow, "aria-labelledby": this.labelId, isCollapsed: isCollapsed, onSubmit: this.handleSubmit, showForm: this.state.showForm }, elemProps),
|
|
298
297
|
React.createElement(SearchContainer, { height: height },
|
|
299
298
|
React.createElement(SearchIcon, { "aria-label": submitAriaLabel, icon: canvas_system_icons_web_1.searchIcon, isCollapsed: isCollapsed, variant: this.getIconButtonType(), type: "submit", isHidden: !!isCollapsed && !this.state.showForm }),
|
|
300
299
|
React.createElement(SearchIcon, { "aria-label": openButtonAriaLabel, icon: canvas_system_icons_web_1.searchIcon, isCollapsed: isCollapsed, variant: this.getIconButtonType(), onClick: this.openCollapsedSearch, ref: this.openRef, type: "button", isHidden: !isCollapsed || (!!isCollapsed && this.state.showForm) }),
|
|
@@ -303,7 +302,7 @@ var SearchBar = /** @class */ (function (_super) {
|
|
|
303
302
|
React.createElement(SearchInput, { ref: this.inputRef, value: this.state.searchQuery, placeholder: placeholder, isCollapsed: isCollapsed, inputColors: this.getThemeColors(), height: height, name: "search" }))),
|
|
304
303
|
React.createElement(CloseButton, { "aria-label": closeButtonAriaLabel, icon: canvas_system_icons_web_1.xIcon, isCollapsed: isCollapsed, variant: "plain", showForm: this.state.showForm, onClick: this.closeCollapsedSearch, type: "button" }))));
|
|
305
304
|
};
|
|
306
|
-
|
|
307
|
-
return
|
|
305
|
+
SearchForm.Theme = themes_1.SearchTheme;
|
|
306
|
+
return SearchForm;
|
|
308
307
|
}(React.Component));
|
|
309
|
-
exports.
|
|
308
|
+
exports.SearchForm = SearchForm;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare enum SearchTheme {
|
|
2
|
+
Light = 0,
|
|
3
|
+
Dark = 1,
|
|
4
|
+
Transparent = 2
|
|
5
|
+
}
|
|
6
|
+
export interface SearchThemeAttributes {
|
|
7
|
+
background?: string;
|
|
8
|
+
backgroundFocus?: string;
|
|
9
|
+
backgroundHover?: string;
|
|
10
|
+
color?: string;
|
|
11
|
+
colorFocus?: string;
|
|
12
|
+
placeholderColor?: string;
|
|
13
|
+
placeholderColorFocus?: string;
|
|
14
|
+
boxShadow?: string | string[];
|
|
15
|
+
boxShadowFocus?: string | string[];
|
|
16
|
+
}
|
|
17
|
+
export interface SearchThemes {
|
|
18
|
+
[key: string]: SearchThemeAttributes;
|
|
19
|
+
}
|
|
20
|
+
export declare const searchThemes: SearchThemes;
|
|
21
|
+
//# sourceMappingURL=themes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../../../search-form/lib/themes.ts"],"names":[],"mappings":"AAGA,oBAAY,WAAW;IACrB,KAAK,IAAA;IACL,IAAI,IAAA;IACJ,WAAW,IAAA;CACZ;AACD,MAAM,WAAW,qBAAqB;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CACpC;AAED,MAAM,WAAW,YAAY;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,qBAAqB,CAAC;CACtC;AAED,eAAO,MAAM,YAAY,EAAE,YA6B1B,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
var common_1 = require("@workday/canvas-kit-react/common");
|
|
5
|
+
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
6
|
+
var SearchTheme;
|
|
7
|
+
(function (SearchTheme) {
|
|
8
|
+
SearchTheme[SearchTheme["Light"] = 0] = "Light";
|
|
9
|
+
SearchTheme[SearchTheme["Dark"] = 1] = "Dark";
|
|
10
|
+
SearchTheme[SearchTheme["Transparent"] = 2] = "Transparent";
|
|
11
|
+
})(SearchTheme = exports.SearchTheme || (exports.SearchTheme = {}));
|
|
12
|
+
exports.searchThemes = (_a = {},
|
|
13
|
+
_a[SearchTheme.Transparent] = {
|
|
14
|
+
background: 'rgba(0, 0, 0, 0)',
|
|
15
|
+
backgroundFocus: 'rgba(0, 0, 0, 0)',
|
|
16
|
+
color: tokens_1.colors.blackPepper300,
|
|
17
|
+
colorFocus: tokens_1.colors.blackPepper300,
|
|
18
|
+
placeholderColor: tokens_1.colors.licorice300,
|
|
19
|
+
placeholderColorFocus: tokens_1.colors.licorice300,
|
|
20
|
+
boxShadow: 'none',
|
|
21
|
+
boxShadowFocus: 'none',
|
|
22
|
+
},
|
|
23
|
+
_a[SearchTheme.Light] = {
|
|
24
|
+
background: tokens_1.colors.soap200,
|
|
25
|
+
backgroundFocus: tokens_1.colors.soap200,
|
|
26
|
+
backgroundHover: tokens_1.colors.soap300,
|
|
27
|
+
color: tokens_1.colors.blackPepper300,
|
|
28
|
+
placeholderColor: tokens_1.colors.licorice300,
|
|
29
|
+
boxShadow: 'none',
|
|
30
|
+
boxShadowFocus: common_1.focusRing().boxShadow,
|
|
31
|
+
},
|
|
32
|
+
_a[SearchTheme.Dark] = {
|
|
33
|
+
background: 'rgba(0, 0, 0, 0.2)',
|
|
34
|
+
backgroundFocus: tokens_1.colors.frenchVanilla100,
|
|
35
|
+
color: tokens_1.colors.frenchVanilla100,
|
|
36
|
+
colorFocus: tokens_1.colors.blackPepper300,
|
|
37
|
+
placeholderColor: tokens_1.colors.frenchVanilla100,
|
|
38
|
+
placeholderColorFocus: tokens_1.colors.licorice300,
|
|
39
|
+
boxShadow: 'none',
|
|
40
|
+
},
|
|
41
|
+
_a);
|
|
@@ -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"}
|
|
@@ -23,8 +23,11 @@ import { accessibleHide } from '@workday/canvas-kit-react/common';
|
|
|
23
23
|
import { getOptionId, listBoxIdPart, getTextFromElement } from './Combobox';
|
|
24
24
|
import uuid from 'uuid/v4';
|
|
25
25
|
var Autocomplete = styled('ul')({
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
margin: 0,
|
|
27
|
+
maxHeight: 200,
|
|
28
|
+
boxSizing: 'border-box',
|
|
29
|
+
overflowY: 'auto',
|
|
30
|
+
padding: space.xxs + " 0",
|
|
28
31
|
});
|
|
29
32
|
var AccessibleHide = styled('span')(accessibleHide);
|
|
30
33
|
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,EAA4B,MAAM,kCAAkC,CAAC;AAGlG,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;AAgBD,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,gBAAgB,EACtB,KAAK,EAAE,kBAAkB,GACxB,cAAc,CAsBhB;AAED,eAAO,MAAM,aAAa,gFAyBzB,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { useThemeRTL } from './useThemeRTL';
|
|
2
|
+
import { colors, inputColors, statusColors } 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 (palette, fallbackColors) {
|
|
9
|
+
return {
|
|
10
|
+
outer: isAccessible(palette.main) ? palette.main : isAccessible(palette.darkest) ? palette.darkest : fallbackColors === null || fallbackColors === void 0 ? void 0 : fallbackColors.outer,
|
|
11
|
+
inner: (fallbackColors === null || fallbackColors === void 0 ? void 0 : fallbackColors.inner) ? fallbackColors.inner : palette.main,
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export function getPaletteColors(type, theme) {
|
|
15
|
+
var palette = theme.canvas.palette[type];
|
|
16
|
+
switch (type) {
|
|
17
|
+
case 'error': {
|
|
18
|
+
return getPaletteColorsFromTheme(palette, { outer: inputColors.error.border });
|
|
19
|
+
}
|
|
20
|
+
case 'alert': {
|
|
21
|
+
return getPaletteColorsFromTheme(palette, { outer: colors.cantaloupe600 });
|
|
22
|
+
}
|
|
23
|
+
case 'success': {
|
|
24
|
+
return getPaletteColorsFromTheme(palette, {
|
|
25
|
+
outer: colors.greenApple600,
|
|
26
|
+
// The theme default for success.main is set to the darkest GreenApple
|
|
27
|
+
// For our default ring, we need to override it so the inner ring is a bit lighter
|
|
28
|
+
inner: palette.main === colors.greenApple600 ? statusColors.success : palette.main,
|
|
29
|
+
});
|
|
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"}
|