@workday/canvas-kit-labs-react 5.3.0-next.3 → 5.3.0-next.32
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 +7 -5
- package/combobox/lib/Combobox.tsx +9 -5
- 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 +6 -4
- package/dist/commonjs/combobox/lib/Combobox.d.ts.map +1 -1
- package/dist/commonjs/combobox/lib/Combobox.js +2 -4
- 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} +15 -17
- 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 +7 -5
- package/dist/es6/combobox/lib/Combobox.d.ts.map +1 -1
- package/dist/es6/combobox/lib/Combobox.js +3 -5
- 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} +14 -16
- 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 +7 -8
- 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} +33 -34
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchForm.d.ts","sourceRoot":"","sources":["../../../../search-form/lib/SearchForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,cAAc,EAA2B,MAAM,kCAAkC,CAAC;AAM1F,OAAO,EAAC,aAAa,EAAC,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAC,qBAAqB,EAAgB,WAAW,EAAC,MAAM,UAAU,CAAC;AAG1E,MAAM,WAAW,eAAgB,SAAQ,cAAc,EAAE,KAAK,CAAC,kBAAkB,CAAC,eAAe,CAAC;IAChG;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC;IAClD;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IAC3D;;OAEG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,CAAC;IACxD;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,GAAG,qBAAqB,CAAC;IAClD;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACpB;AAuMD,qBAAa,UAAW,SAAQ,KAAK,CAAC,SAAS,CAAC,eAAe,EAAE,eAAe,CAAC;IAC/E,MAAM,CAAC,KAAK,qBAAe;IAE3B,OAAO,CAAC,QAAQ,CAAuC;IACvD,OAAO,CAAC,OAAO,CAAwC;IACvD,OAAO,CAAC,OAAO,CAAsB;IAErC,KAAK,EAAE,QAAQ,CAAC,eAAe,CAAC,CAI9B;IAEF,OAAO,CAAC,QAAQ,CAUd;IAEF,OAAO,CAAC,cAAc,CAMpB;IAEF,iBAAiB,kHAOf;IAEF,YAAY,oDAOV;IAEF,mBAAmB,aAIjB;IAEF,oBAAoB,aAIlB;IAEF,kBAAkB,CAAC,SAAS,EAAE,eAAe,EAAE,SAAS,EAAE,eAAe;IAWzE,UAAU,aAIR;IAEF,SAAS,aAIP;IAEF,WAAW,aAET;IAEF,UAAU,aAER;IAEF,uBAAuB,uDAMrB;IAEF,MAAM;CAmGP"}
|
|
@@ -35,16 +35,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
35
35
|
};
|
|
36
36
|
import * as React from 'react';
|
|
37
37
|
import { colors, space, spaceNumbers } from '@workday/canvas-kit-react/tokens';
|
|
38
|
-
import { styled } from '@workday/canvas-kit-react/common';
|
|
38
|
+
import { styled, generateUniqueId } from '@workday/canvas-kit-react/common';
|
|
39
39
|
import { IconButton } from '@workday/canvas-kit-react/button';
|
|
40
40
|
import { searchIcon, xIcon } from '@workday/canvas-system-icons-web';
|
|
41
41
|
import { FormField, FormFieldLabelPosition } from '@workday/canvas-kit-react/form-field';
|
|
42
42
|
import { Combobox } from '@workday/canvas-kit-labs-react/combobox';
|
|
43
43
|
import { TextInput } from '@workday/canvas-kit-react/text-input';
|
|
44
|
-
import { searchThemes } from '
|
|
45
|
-
import { SearchTheme } from '../shared/types';
|
|
44
|
+
import { searchThemes, SearchTheme } from './themes';
|
|
46
45
|
import chroma from 'chroma-js';
|
|
47
|
-
import uuid from 'uuid/v4';
|
|
48
46
|
function getInputColors(theme, isFocused) {
|
|
49
47
|
return {
|
|
50
48
|
background: isFocused && theme.backgroundFocus ? theme.backgroundFocus : theme.background,
|
|
@@ -59,7 +57,7 @@ function getInputColors(theme, isFocused) {
|
|
|
59
57
|
var formCollapsedBackground = colors.frenchVanilla100;
|
|
60
58
|
var maxWidth = 480;
|
|
61
59
|
var minWidth = 120;
|
|
62
|
-
var
|
|
60
|
+
var StyledSearchForm = styled('form')({
|
|
63
61
|
position: 'relative',
|
|
64
62
|
flex: "1 1 auto",
|
|
65
63
|
display: 'flex',
|
|
@@ -186,13 +184,13 @@ var SearchInput = styled(TextInput)(function (_a) {
|
|
|
186
184
|
},
|
|
187
185
|
} }, collapseStyles);
|
|
188
186
|
});
|
|
189
|
-
var
|
|
190
|
-
__extends(
|
|
191
|
-
function
|
|
187
|
+
var SearchForm = /** @class */ (function (_super) {
|
|
188
|
+
__extends(SearchForm, _super);
|
|
189
|
+
function SearchForm() {
|
|
192
190
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
193
191
|
_this.inputRef = React.createRef();
|
|
194
192
|
_this.openRef = React.createRef();
|
|
195
|
-
_this.labelId =
|
|
193
|
+
_this.labelId = generateUniqueId();
|
|
196
194
|
_this.state = {
|
|
197
195
|
showForm: false,
|
|
198
196
|
searchQuery: '',
|
|
@@ -269,7 +267,7 @@ var SearchBar = /** @class */ (function (_super) {
|
|
|
269
267
|
};
|
|
270
268
|
return _this;
|
|
271
269
|
}
|
|
272
|
-
|
|
270
|
+
SearchForm.prototype.componentDidUpdate = function (prevProps, prevState) {
|
|
273
271
|
var showFormToggled = this.state.showForm !== prevState.showForm;
|
|
274
272
|
if (showFormToggled) {
|
|
275
273
|
if (this.state.showForm) {
|
|
@@ -280,18 +278,18 @@ var SearchBar = /** @class */ (function (_super) {
|
|
|
280
278
|
}
|
|
281
279
|
}
|
|
282
280
|
};
|
|
283
|
-
|
|
281
|
+
SearchForm.prototype.render = function () {
|
|
284
282
|
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"]);
|
|
285
|
-
return (React.createElement(
|
|
283
|
+
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),
|
|
286
284
|
React.createElement(SearchContainer, { height: height },
|
|
287
285
|
React.createElement(SearchIcon, { "aria-label": submitAriaLabel, icon: searchIcon, isCollapsed: isCollapsed, variant: this.getIconButtonType(), type: "submit", isHidden: !!isCollapsed && !this.state.showForm }),
|
|
288
286
|
React.createElement(SearchIcon, { "aria-label": openButtonAriaLabel, icon: searchIcon, isCollapsed: isCollapsed, variant: this.getIconButtonType(), onClick: this.openCollapsedSearch, ref: this.openRef, type: "button", isHidden: !isCollapsed || (!!isCollapsed && this.state.showForm) }),
|
|
289
287
|
React.createElement(SearchField, { grow: grow, id: this.labelId, inputId: "input-" + this.labelId, label: inputLabel, labelPosition: FormFieldLabelPosition.Hidden, useFieldset: false, isCollapsed: isCollapsed, showForm: this.state.showForm, height: height },
|
|
290
288
|
React.createElement(SearchCombobox, { initialValue: initialValue, clearButtonVariant: this.getIconButtonType(), autocompleteItems: autocompleteItems, onChange: this.handleSearchInputChange, onFocus: this.handleFocus, onBlur: this.handleBlur, showClearButton: !isCollapsed && showClearButton, clearButtonAriaLabel: clearButtonAriaLabel, labelId: this.labelId },
|
|
291
|
-
React.createElement(SearchInput, { ref: this.inputRef, value: this.state.searchQuery, placeholder: placeholder, isCollapsed: isCollapsed, inputColors: this.getThemeColors(), height: height, name: "search" }))),
|
|
289
|
+
React.createElement(SearchInput, { ref: this.inputRef, value: this.state.searchQuery, placeholder: placeholder, isCollapsed: isCollapsed, inputColors: this.getThemeColors(), height: height, name: "search", autoComplete: "off" }))),
|
|
292
290
|
React.createElement(CloseButton, { "aria-label": closeButtonAriaLabel, icon: xIcon, isCollapsed: isCollapsed, variant: "plain", showForm: this.state.showForm, onClick: this.closeCollapsedSearch, type: "button" }))));
|
|
293
291
|
};
|
|
294
|
-
|
|
295
|
-
return
|
|
292
|
+
SearchForm.Theme = SearchTheme;
|
|
293
|
+
return SearchForm;
|
|
296
294
|
}(React.Component));
|
|
297
|
-
export {
|
|
295
|
+
export { 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,39 @@
|
|
|
1
|
+
var _a;
|
|
2
|
+
import { focusRing } from '@workday/canvas-kit-react/common';
|
|
3
|
+
import { colors } from '@workday/canvas-kit-react/tokens';
|
|
4
|
+
export var SearchTheme;
|
|
5
|
+
(function (SearchTheme) {
|
|
6
|
+
SearchTheme[SearchTheme["Light"] = 0] = "Light";
|
|
7
|
+
SearchTheme[SearchTheme["Dark"] = 1] = "Dark";
|
|
8
|
+
SearchTheme[SearchTheme["Transparent"] = 2] = "Transparent";
|
|
9
|
+
})(SearchTheme || (SearchTheme = {}));
|
|
10
|
+
export var searchThemes = (_a = {},
|
|
11
|
+
_a[SearchTheme.Transparent] = {
|
|
12
|
+
background: 'rgba(0, 0, 0, 0)',
|
|
13
|
+
backgroundFocus: 'rgba(0, 0, 0, 0)',
|
|
14
|
+
color: colors.blackPepper300,
|
|
15
|
+
colorFocus: colors.blackPepper300,
|
|
16
|
+
placeholderColor: colors.licorice300,
|
|
17
|
+
placeholderColorFocus: colors.licorice300,
|
|
18
|
+
boxShadow: 'none',
|
|
19
|
+
boxShadowFocus: 'none',
|
|
20
|
+
},
|
|
21
|
+
_a[SearchTheme.Light] = {
|
|
22
|
+
background: colors.soap200,
|
|
23
|
+
backgroundFocus: colors.soap200,
|
|
24
|
+
backgroundHover: colors.soap300,
|
|
25
|
+
color: colors.blackPepper300,
|
|
26
|
+
placeholderColor: colors.licorice300,
|
|
27
|
+
boxShadow: 'none',
|
|
28
|
+
boxShadowFocus: focusRing().boxShadow,
|
|
29
|
+
},
|
|
30
|
+
_a[SearchTheme.Dark] = {
|
|
31
|
+
background: 'rgba(0, 0, 0, 0.2)',
|
|
32
|
+
backgroundFocus: colors.frenchVanilla100,
|
|
33
|
+
color: colors.frenchVanilla100,
|
|
34
|
+
colorFocus: colors.blackPepper300,
|
|
35
|
+
placeholderColor: colors.frenchVanilla100,
|
|
36
|
+
placeholderColorFocus: colors.licorice300,
|
|
37
|
+
boxShadow: 'none',
|
|
38
|
+
},
|
|
39
|
+
_a);
|
package/header/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Canvas Kit Labs React Header
|
|
1
|
+
# Canvas Kit Labs React Header (Deprecated)
|
|
2
2
|
|
|
3
3
|
<a href="https://github.com/Workday/canvas-kit/tree/master/modules/labs-react/README.md">
|
|
4
4
|
<img src="https://img.shields.io/badge/LABS-alpha-orange" alt="LABS: Alpha" />
|
|
@@ -8,10 +8,6 @@ A set of components to create headers for various Workday applications and sites
|
|
|
8
8
|
|
|
9
9
|
For a full suite of examples, have a look at the [Header Stories](./stories.tsx).
|
|
10
10
|
|
|
11
|
-
## Coming Soon
|
|
12
|
-
|
|
13
|
-
- Mobile Expanded Nav
|
|
14
|
-
|
|
15
11
|
## Installation
|
|
16
12
|
|
|
17
13
|
```sh
|
|
@@ -26,13 +22,13 @@ This component renders a responsive, Canvas-style header.
|
|
|
26
22
|
|
|
27
23
|
```tsx
|
|
28
24
|
import * as React from 'react';
|
|
29
|
-
import {
|
|
25
|
+
import {DeprecatedHeader} from '@workday/canvas-kit-labs-react/header';
|
|
30
26
|
import {IconButton} from '@workday/canvas-kit-react/button';
|
|
31
27
|
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
32
28
|
import {notificationsIcon} from '@workday/canvas-system-icons-web';
|
|
33
29
|
import {PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
34
30
|
|
|
35
|
-
<
|
|
31
|
+
<DeprecatedHeader title="Header" brandUrl="#">
|
|
36
32
|
<nav>
|
|
37
33
|
<ul>
|
|
38
34
|
<li className="current">
|
|
@@ -62,7 +58,7 @@ import {PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
|
62
58
|
altText="Profile"
|
|
63
59
|
/>
|
|
64
60
|
<PrimaryButton>Sign Up</PrimaryButton>
|
|
65
|
-
</
|
|
61
|
+
</DeprecatedHeader>;
|
|
66
62
|
```
|
|
67
63
|
|
|
68
64
|
## Special Children
|
|
@@ -88,18 +84,18 @@ _Deprecated (but supported) - please use `IconButton` instead._
|
|
|
88
84
|
|
|
89
85
|
## Static Properties
|
|
90
86
|
|
|
91
|
-
#### `Theme:
|
|
87
|
+
#### `Theme: DeprecatedHeaderTheme`
|
|
92
88
|
|
|
93
89
|
```tsx
|
|
94
|
-
<
|
|
90
|
+
<DeprecatedHeader title="Blue Header" themeColor={DeprecatedHeader.Theme.Blue} />
|
|
95
91
|
```
|
|
96
92
|
|
|
97
93
|
---
|
|
98
94
|
|
|
99
|
-
#### `Variant:
|
|
95
|
+
#### `Variant: DeprecatedHeaderVariant`
|
|
100
96
|
|
|
101
97
|
```tsx
|
|
102
|
-
<
|
|
98
|
+
<DeprecatedHeader title="Marketing Header" variant={DeprecatedHeader.Variant.Full} />
|
|
103
99
|
```
|
|
104
100
|
|
|
105
101
|
## Component Props
|
|
@@ -118,7 +114,7 @@ Default: `''`
|
|
|
118
114
|
|
|
119
115
|
---
|
|
120
116
|
|
|
121
|
-
#### `themeColor:
|
|
117
|
+
#### `themeColor: DeprecatedHeaderTheme`
|
|
122
118
|
|
|
123
119
|
> The theme of the header (White, Blue, or Transparent).
|
|
124
120
|
|
|
@@ -128,11 +124,11 @@ Default: `''`
|
|
|
128
124
|
| Blue | Dark blue gradient background with white text, white system icons. |
|
|
129
125
|
| Transparent | Transparent background (intended for dark-colored overlays) with white text, white system icons. |
|
|
130
126
|
|
|
131
|
-
Default: `
|
|
127
|
+
Default: `DeprecatedHeaderTheme.White`
|
|
132
128
|
|
|
133
129
|
---
|
|
134
130
|
|
|
135
|
-
#### `variant:
|
|
131
|
+
#### `variant: DeprecatedHeaderVariant`
|
|
136
132
|
|
|
137
133
|
> Specifies the variation of the header.
|
|
138
134
|
|
|
@@ -141,7 +137,7 @@ Default: `HeaderTheme.White`
|
|
|
141
137
|
| Dub | "Dub" headers have a singular "Dub" logo and a title, separated by a equivalent-height divider. It is shorter in height (64px) than the "Full" variant. |
|
|
142
138
|
| Full | "Full" headers have the full Workday logo and an optional title at minimum, separated by an equivalent-height divider (when a title is defined). It is taller in height (80px) than the "Dub" variant. |
|
|
143
139
|
|
|
144
|
-
Default: `
|
|
140
|
+
Default: `DeprecatedHeaderVariant.Dub`
|
|
145
141
|
|
|
146
142
|
---
|
|
147
143
|
|
|
@@ -156,7 +152,7 @@ Default: `HeaderVariant.Dub`
|
|
|
156
152
|
> If specified, this replaces the contents of the Dub logo and title. Used for replacing Dub + title
|
|
157
153
|
> with a `contained lockup` and/or for adding custon design elements next to the Dub + title lockup.
|
|
158
154
|
|
|
159
|
-
Default: `
|
|
155
|
+
Default: `DeprecatedDubLogoTitle` (for "Dub" variants) or `DeprecatedWorkdayLogoTitle` (for "Full" variants)
|
|
160
156
|
|
|
161
157
|
---
|
|
162
158
|
|
|
@@ -183,7 +179,7 @@ Default: `DubLogoTitle` (for "Dub" variants) or `WorkdayLogoTitle` (for "Full" v
|
|
|
183
179
|
|
|
184
180
|
> A React element for the left of the header, this is typically a search bar component
|
|
185
181
|
|
|
186
|
-
# Global Header
|
|
182
|
+
# Global Header (Deprecated)
|
|
187
183
|
|
|
188
184
|
The Global Header (or App Header) is used for Workday applications.
|
|
189
185
|
|
|
@@ -191,12 +187,13 @@ The Global Header (or App Header) is used for Workday applications.
|
|
|
191
187
|
|
|
192
188
|
```tsx
|
|
193
189
|
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
194
|
-
import {
|
|
190
|
+
import {DeprecatedGlobalHeader, DeprecatedDubLogoTitle} from '@workday/canvas-kit-labs-react/header';
|
|
191
|
+
import {SearchForm} from '@workday/canvas-kit-labs-react/search-form';
|
|
195
192
|
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
196
193
|
import {IconButton} from '@workday/canvas-kit-react/button';
|
|
197
194
|
import {notificationsIcon, inboxIcon} from '@workday/canvas-system-icons-web';
|
|
198
195
|
|
|
199
|
-
const HeaderBrand = () => <
|
|
196
|
+
const HeaderBrand = () => <DeprecatedDubLogoTitle themeColor={Header.Theme.White} />
|
|
200
197
|
const HeaderAvatar = () => <Avatar onClick={handleMenuClick} url="https://my.cdn.amazonaws.com/assets/avatar_pic.png" />
|
|
201
198
|
const handleSearchSubmit = event => {
|
|
202
199
|
const query = (event.target as HTMLFormElement).getElementsByTagName('input')[0].value;
|
|
@@ -205,15 +202,15 @@ const handleSearchSubmit = event => {
|
|
|
205
202
|
const openMenu = e => console.log("Menu opened")
|
|
206
203
|
|
|
207
204
|
/**
|
|
208
|
-
* In this instance, the right-most child will be an Avatar component, when the
|
|
205
|
+
* In this instance, the right-most child will be an Avatar component, when the DeprecatedGlobalHeader
|
|
209
206
|
* shrinks below the specified breakpoint (720 in this case), the children get replaced by a menuToggle.
|
|
210
|
-
* For most
|
|
207
|
+
* For most DeprecatedGlobalHeader implementations, the menuToggle is also the Avatar component.
|
|
211
208
|
*/
|
|
212
|
-
<
|
|
209
|
+
<DeprecatedGlobalHeader
|
|
213
210
|
brand={<HeaderBrand />}
|
|
214
211
|
menuToggle={<HeaderAvatar />}
|
|
215
212
|
onMenuClick={openMenu}
|
|
216
|
-
leftSlot={<
|
|
213
|
+
leftSlot={<SearchForm
|
|
217
214
|
isCollapsed={false}
|
|
218
215
|
grow={true}
|
|
219
216
|
onSubmit={handleSearchSubmit}
|
|
@@ -223,7 +220,7 @@ const openMenu = e => console.log("Menu opened")
|
|
|
223
220
|
<IconButton icon={notificationsIcon} variant={IconButton.Variant.Circle} />
|
|
224
221
|
<IconButton icon={inboxIcon} variant={IconButton.Variant.Circle} />
|
|
225
222
|
<HeaderAvatar />
|
|
226
|
-
</
|
|
223
|
+
</DeprecatedGlobalHeader>
|
|
227
224
|
```
|
|
228
225
|
|
|
229
226
|
## Static Properties
|
|
@@ -243,13 +240,13 @@ const openMenu = e => console.log("Menu opened")
|
|
|
243
240
|
> If specified, this replaces the contents of the Dub logo and title. Used for replacing Dub + title
|
|
244
241
|
> with a branded element and/or for adding custon design elements next to the Dub + title lockup.
|
|
245
242
|
|
|
246
|
-
Default: `<
|
|
243
|
+
Default: `<DeprecatedDubLogoTitle />`
|
|
247
244
|
|
|
248
245
|
#### `menuToggle: React.ReactNode`
|
|
249
246
|
|
|
250
247
|
> _Note: This `menuToggle` slot only appears when the screen size shrinks below the `breakpoint`._
|
|
251
248
|
>
|
|
252
|
-
> For most `
|
|
249
|
+
> For most `DeprecatedGlobalHeader` implementations, this is generally the same as the users' `Avatar`. If not
|
|
253
250
|
> specified, `menuToggle` defaults to a "hamburger" menu icon or "justify" icon.
|
|
254
251
|
|
|
255
252
|
Default: `justifyIcon` from `@workday/canvas-system-icons-web`
|
|
@@ -258,7 +255,7 @@ Default: `justifyIcon` from `@workday/canvas-system-icons-web`
|
|
|
258
255
|
|
|
259
256
|
> A click handler for when the user clicks the `menuToggle` element.
|
|
260
257
|
|
|
261
|
-
Default: `<
|
|
258
|
+
Default: `<DeprecatedDubLogoTitle />`
|
|
262
259
|
|
|
263
260
|
#### `leftSlot: React.ReactElement`
|
|
264
261
|
|
|
@@ -270,7 +267,7 @@ Default: `<DubLogoTitle />`
|
|
|
270
267
|
|
|
271
268
|
# "Dub" Logo and Title
|
|
272
269
|
|
|
273
|
-
_Intended to be used in conjunction with the `
|
|
270
|
+
_Intended to be used in conjunction with the `DeprecatedHeader` component_
|
|
274
271
|
|
|
275
272
|
A component that encapsulates the 'Dub' logo and a title (we call this the contained lockup). This
|
|
276
273
|
is used whenever you want to override the contained lockup that comes default with a header, or if
|
|
@@ -280,11 +277,11 @@ background color of the contained lockup
|
|
|
280
277
|
## Usage
|
|
281
278
|
|
|
282
279
|
```tsx
|
|
283
|
-
import {
|
|
280
|
+
import {DeprecatedHeader, DeprecatedDubLogoTitle} from '@workday/canvas-kit-labs-react/header';
|
|
284
281
|
import {colors} from '@workday/canvas-kit-react/tokens';
|
|
285
282
|
|
|
286
|
-
<
|
|
287
|
-
brand={<
|
|
283
|
+
<DeprecatedHeader
|
|
284
|
+
brand={<DeprecatedDubLogoTitle title="This title will show up instead" bgColor={colors.blueberry600} />}
|
|
288
285
|
/>;
|
|
289
286
|
```
|
|
290
287
|
|
|
@@ -304,11 +301,11 @@ Default: `''`
|
|
|
304
301
|
|
|
305
302
|
### Optional
|
|
306
303
|
|
|
307
|
-
#### `themeColor:
|
|
304
|
+
#### `themeColor: DeprecatedHeaderTheme`
|
|
308
305
|
|
|
309
306
|
> The theme of the header (White, Blue, or Transparent).
|
|
310
307
|
|
|
311
|
-
Default: `
|
|
308
|
+
Default: `DeprecatedHeaderTheme.White`
|
|
312
309
|
|
|
313
310
|
---
|
|
314
311
|
|
|
@@ -320,7 +317,7 @@ Default: `'none'`
|
|
|
320
317
|
|
|
321
318
|
# Workday Logo and Title
|
|
322
319
|
|
|
323
|
-
_Intended to be used in conjunction with the `
|
|
320
|
+
_Intended to be used in conjunction with the `DeprecatedHeader` component_
|
|
324
321
|
|
|
325
322
|
A component that contains the full Workday logo and a title. This is used whenever you want to
|
|
326
323
|
override the contained lockup that comes default with a header, or if you want to add more elements
|
|
@@ -329,9 +326,9 @@ next to the title with custom components or markup.
|
|
|
329
326
|
## Usage
|
|
330
327
|
|
|
331
328
|
```tsx
|
|
332
|
-
import {
|
|
329
|
+
import {DeprecatedHeader, DeprecatedWorkdayLogoTitle} from '@workday/canvas-kit-labs-react/header';
|
|
333
330
|
|
|
334
|
-
<
|
|
331
|
+
<DeprecatedHeader brand={<DeprecatedWorkdayLogoTitle title="Display Title" />} />;
|
|
335
332
|
```
|
|
336
333
|
|
|
337
334
|
## Static Properties
|
|
@@ -346,12 +343,12 @@ import {Header, WorkdayLogoTitle} from '@workday/canvas-kit-labs-react/header';
|
|
|
346
343
|
|
|
347
344
|
### Optional
|
|
348
345
|
|
|
349
|
-
#### `themeColor:
|
|
346
|
+
#### `themeColor: DeprecatedHeaderTheme`
|
|
350
347
|
|
|
351
348
|
> The theme of the header (White, Blue, or Transparent). See the
|
|
352
|
-
> [`themeColor`](#themecolor-headertheme) prop on the `
|
|
349
|
+
> [`themeColor`](#themecolor-headertheme) prop on the `DeprecatedHeader` component.
|
|
353
350
|
|
|
354
|
-
Default: `
|
|
351
|
+
Default: `DeprecatedHeaderTheme.White`
|
|
355
352
|
|
|
356
353
|
---
|
|
357
354
|
|
|
@@ -360,144 +357,3 @@ Default: `HeaderTheme.White`
|
|
|
360
357
|
> The title displayed on the header next to the logo.
|
|
361
358
|
|
|
362
359
|
Default `''`
|
|
363
|
-
|
|
364
|
-
# Search Bar
|
|
365
|
-
|
|
366
|
-
_Intended to be used in conjunction with the `Header` component_
|
|
367
|
-
|
|
368
|
-
A component that contains a search bar with autocomplete functionality.
|
|
369
|
-
|
|
370
|
-
## Usage
|
|
371
|
-
|
|
372
|
-
```tsx
|
|
373
|
-
import {SearchBar} from '@workday/canvas-kit-labs-react/header';
|
|
374
|
-
import {MenuItem} from '@workday/canvas-kit-labs-react/menu';
|
|
375
|
-
|
|
376
|
-
const handleInputChange = event => console.log('Adjust menu items here');
|
|
377
|
-
const handleSearchSubmit = event => {
|
|
378
|
-
const query = (event.target as HTMLFormElement).getElementsByTagName('input')[0].value;
|
|
379
|
-
console.log('Submitted query: ', query);
|
|
380
|
-
};
|
|
381
|
-
|
|
382
|
-
<SearchBar
|
|
383
|
-
autocompleteItems={[<MenuItem>Item 1</MenuItem>]}
|
|
384
|
-
isCollapsed={false}
|
|
385
|
-
onInputChange={this.autocompleteCallback}
|
|
386
|
-
placeholder={`Search with Autocomplete`}
|
|
387
|
-
grow={true}
|
|
388
|
-
searchTheme={SearchBar.Theme.Dark}
|
|
389
|
-
onSubmit={handleSearchSubmit}
|
|
390
|
-
/>;
|
|
391
|
-
```
|
|
392
|
-
|
|
393
|
-
## Static Properties
|
|
394
|
-
|
|
395
|
-
> None
|
|
396
|
-
|
|
397
|
-
## Component Props
|
|
398
|
-
|
|
399
|
-
### Required
|
|
400
|
-
|
|
401
|
-
#### `onSubmit: React.FormEventHandler<HTMLFormElement>`
|
|
402
|
-
|
|
403
|
-
> An function that gets called and passed the current input value when the search form is submitted.
|
|
404
|
-
|
|
405
|
-
### Optional
|
|
406
|
-
|
|
407
|
-
#### `isCollapsed: boolean`
|
|
408
|
-
|
|
409
|
-
> True if the search input should be collapsed into a toggle icon (for responsive).
|
|
410
|
-
|
|
411
|
-
---
|
|
412
|
-
|
|
413
|
-
#### `onInputChange: React.ChangeEventHandler<HTMLInputElement>`
|
|
414
|
-
|
|
415
|
-
> Callback to listen when the TextInput changes. This is usually used to update the autocomplete
|
|
416
|
-
> items.
|
|
417
|
-
|
|
418
|
-
---
|
|
419
|
-
|
|
420
|
-
#### `autocompleteItems: React.ReactElement<MenuItemProps>[]`
|
|
421
|
-
|
|
422
|
-
> An array of MenuItems to show under the search bar.
|
|
423
|
-
|
|
424
|
-
---
|
|
425
|
-
|
|
426
|
-
#### `searchTheme?: SearchTheme | SearchThemeAttributes`
|
|
427
|
-
|
|
428
|
-
> The theme of the header the search input is being rendered in. There are 3 build in themes, but
|
|
429
|
-
> the styles are customizable via SearchThemeAttributes.
|
|
430
|
-
|
|
431
|
-
| Theme | Description |
|
|
432
|
-
| ----------- | -------------------------------------------------------------------------------------------------------- |
|
|
433
|
-
| Light | White background with dark-colored text, blue focus ring. |
|
|
434
|
-
| Dark | Dark semi transparent background with white text. Inverts on focus. |
|
|
435
|
-
| Transparent | Transparent background (intended for light-colored header) with dark text. Also used in collapsed state. |
|
|
436
|
-
|
|
437
|
-
Default: `SearchTheme.Light`
|
|
438
|
-
|
|
439
|
-
---
|
|
440
|
-
|
|
441
|
-
#### `placeholder: string`
|
|
442
|
-
|
|
443
|
-
> Placeholder for search input.
|
|
444
|
-
|
|
445
|
-
Default: `'Search'`
|
|
446
|
-
|
|
447
|
-
---
|
|
448
|
-
|
|
449
|
-
#### `initialValue: string;`
|
|
450
|
-
|
|
451
|
-
> Initial value to set the input to.
|
|
452
|
-
|
|
453
|
-
---
|
|
454
|
-
|
|
455
|
-
#### `rightAlign: boolean;`
|
|
456
|
-
|
|
457
|
-
> False if the search input should grow to left align it. True if it should right align.
|
|
458
|
-
|
|
459
|
-
---
|
|
460
|
-
|
|
461
|
-
#### `inputLabel: string`
|
|
462
|
-
|
|
463
|
-
> Screenreader label for text input.
|
|
464
|
-
|
|
465
|
-
Default: `'Search'`
|
|
466
|
-
|
|
467
|
-
---
|
|
468
|
-
|
|
469
|
-
#### `submitLabel: string`
|
|
470
|
-
|
|
471
|
-
> Screenreader label for submit button
|
|
472
|
-
|
|
473
|
-
Default: `'Search'`
|
|
474
|
-
|
|
475
|
-
---
|
|
476
|
-
|
|
477
|
-
#### `clearButtonAriaLabel: string`
|
|
478
|
-
|
|
479
|
-
> Screenreader Label for clear button
|
|
480
|
-
|
|
481
|
-
---
|
|
482
|
-
|
|
483
|
-
#### `openButtonLabel: string`
|
|
484
|
-
|
|
485
|
-
> Screenreader Label to open collapsed search bar
|
|
486
|
-
|
|
487
|
-
Default: `'Open Search'`
|
|
488
|
-
|
|
489
|
-
---
|
|
490
|
-
|
|
491
|
-
#### `closeButtonLabel: string`
|
|
492
|
-
|
|
493
|
-
> Screenreader Label to close collapsed search bar
|
|
494
|
-
|
|
495
|
-
Default: `'Cancel'`
|
|
496
|
-
|
|
497
|
-
---
|
|
498
|
-
|
|
499
|
-
#### `showClearButton: string`
|
|
500
|
-
|
|
501
|
-
> Show button to clear input field
|
|
502
|
-
|
|
503
|
-
Default: `true`
|
package/header/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import DeprecatedHeader from './lib/Header';
|
|
2
|
+
import DeprecatedGlobalHeader from './lib/GlobalHeader';
|
|
3
3
|
|
|
4
|
-
export default
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
4
|
+
export default DeprecatedHeader;
|
|
5
|
+
export {DeprecatedHeader};
|
|
6
|
+
export {DeprecatedGlobalHeader};
|
|
7
7
|
export * from './lib/parts';
|
|
8
8
|
export * from './lib/shared/themes';
|
|
9
9
|
export * from './lib/shared/types';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import DeprecatedHeader from './Header';
|
|
3
|
+
import {DeprecatedHeaderVariant} from './shared/types';
|
|
4
|
+
import {DeprecatedDubLogoTitle} from './parts';
|
|
5
5
|
|
|
6
6
|
export interface GlobalHeaderProps {
|
|
7
7
|
/**
|
|
@@ -23,15 +23,32 @@ export interface GlobalHeaderProps {
|
|
|
23
23
|
*/
|
|
24
24
|
isCollapsed?: boolean;
|
|
25
25
|
/**
|
|
26
|
-
* The React element to render in the left slot of the GlobalHeader. This is typically a
|
|
26
|
+
* The React element to render in the left slot of the GlobalHeader. This is typically a SearchForm component.
|
|
27
27
|
*/
|
|
28
28
|
leftSlot?: React.ReactElement;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
/**
|
|
32
|
+
* ### Deprecated Global Header
|
|
33
|
+
*
|
|
34
|
+
* As of Canvas Kit v6, this component is being soft-deprecated.
|
|
35
|
+
* It will be hard-deprecated (completely removed) in v7. Please see the
|
|
36
|
+
* [migration guide](https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page)
|
|
37
|
+
* for more information.
|
|
38
|
+
*/
|
|
39
|
+
export default class DeprecatedGlobalHeader extends React.Component<GlobalHeaderProps> {
|
|
40
|
+
componentDidMount() {
|
|
41
|
+
console.warn(
|
|
42
|
+
`GlobalHeader is being deprecated and will be removed in Canvas Kit V7.\n
|
|
43
|
+
For more information, please see the V6 migration guide:\n
|
|
44
|
+
https://workday.github.io/canvas-kit/?path=/story/welcome-migration-guides-v6-0--page
|
|
45
|
+
`
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
32
49
|
public render() {
|
|
33
50
|
const {
|
|
34
|
-
brand = <
|
|
51
|
+
brand = <DeprecatedDubLogoTitle />,
|
|
35
52
|
menuToggle,
|
|
36
53
|
onMenuClick,
|
|
37
54
|
isCollapsed,
|
|
@@ -40,17 +57,17 @@ export default class GlobalHeader extends React.Component<GlobalHeaderProps> {
|
|
|
40
57
|
...elemProps
|
|
41
58
|
} = this.props;
|
|
42
59
|
return (
|
|
43
|
-
<
|
|
60
|
+
<DeprecatedHeader
|
|
44
61
|
brand={brand}
|
|
45
62
|
menuToggle={menuToggle}
|
|
46
63
|
leftSlot={leftSlot}
|
|
47
64
|
onMenuClick={onMenuClick}
|
|
48
|
-
variant={
|
|
65
|
+
variant={DeprecatedHeaderVariant.Global}
|
|
49
66
|
isCollapsed={isCollapsed}
|
|
50
67
|
{...elemProps}
|
|
51
68
|
>
|
|
52
69
|
{children}
|
|
53
|
-
</
|
|
70
|
+
</DeprecatedHeader>
|
|
54
71
|
);
|
|
55
72
|
}
|
|
56
73
|
}
|