@workday/canvas-kit-labs-react 9.0.0-alpha.301-next.2 → 9.0.0-alpha.302-next.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/dist/commonjs/index.d.ts +0 -1
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +0 -1
- package/dist/es6/index.d.ts +0 -1
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +0 -1
- package/index.ts +0 -1
- package/package.json +3 -3
- package/dist/commonjs/drawer/index.d.ts +0 -3
- package/dist/commonjs/drawer/index.d.ts.map +0 -1
- package/dist/commonjs/drawer/index.js +0 -16
- package/dist/commonjs/drawer/lib/Drawer.d.ts +0 -74
- package/dist/commonjs/drawer/lib/Drawer.d.ts.map +0 -1
- package/dist/commonjs/drawer/lib/Drawer.js +0 -142
- package/dist/commonjs/drawer/lib/DrawerHeader.d.ts +0 -55
- package/dist/commonjs/drawer/lib/DrawerHeader.d.ts.map +0 -1
- package/dist/commonjs/drawer/lib/DrawerHeader.js +0 -113
- package/dist/es6/drawer/index.d.ts +0 -3
- package/dist/es6/drawer/index.d.ts.map +0 -1
- package/dist/es6/drawer/index.js +0 -2
- package/dist/es6/drawer/lib/Drawer.d.ts +0 -74
- package/dist/es6/drawer/lib/Drawer.d.ts.map +0 -1
- package/dist/es6/drawer/lib/Drawer.js +0 -117
- package/dist/es6/drawer/lib/DrawerHeader.d.ts +0 -55
- package/dist/es6/drawer/lib/DrawerHeader.d.ts.map +0 -1
- package/dist/es6/drawer/lib/DrawerHeader.js +0 -88
- package/drawer/LICENSE +0 -51
- package/drawer/README.md +0 -35
- package/drawer/index.ts +0 -2
- package/drawer/lib/Drawer.tsx +0 -156
- package/drawer/lib/DrawerHeader.tsx +0 -133
- package/drawer/package.json +0 -6
package/dist/commonjs/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
|
package/dist/commonjs/index.js
CHANGED
|
@@ -12,7 +12,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./combobox"), exports);
|
|
14
14
|
__exportStar(require("./common"), exports);
|
|
15
|
-
__exportStar(require("./drawer"), exports);
|
|
16
15
|
__exportStar(require("./expandable"), exports);
|
|
17
16
|
__exportStar(require("./search-form"), exports);
|
|
18
17
|
__exportStar(require("./toast"), exports);
|
package/dist/es6/index.d.ts
CHANGED
package/dist/es6/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
|
package/dist/es6/index.js
CHANGED
package/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-labs-react",
|
|
3
|
-
"version": "9.0.0-alpha.
|
|
3
|
+
"version": "9.0.0-alpha.302-next.3+57b5a775",
|
|
4
4
|
"description": "Canvas Kit Labs is an incubator for new and experimental components. Since we have a rather rigorous process for getting components in at a production level, it can be valuable to make them available earlier while we continuously iterate on the API/functionality. The Labs modules allow us to do that as needed.",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@emotion/react": "^11.7.1",
|
|
48
48
|
"@emotion/styled": "^11.6.0",
|
|
49
|
-
"@workday/canvas-kit-react": "^9.0.0-alpha.
|
|
49
|
+
"@workday/canvas-kit-react": "^9.0.0-alpha.302-next.3+57b5a775",
|
|
50
50
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
51
51
|
"@workday/design-assets-types": "^0.2.8",
|
|
52
52
|
"chroma-js": "^2.1.0",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@types/lodash.flatten": "^4.4.6"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "57b5a775ec04f7a25f7ece27b35735e18ba62d65"
|
|
60
60
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,sBAAsB,EAAC,MAAM,oBAAoB,CAAC;AAC1D,cAAc,cAAc,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.DeprecatedDrawerHeader = void 0;
|
|
14
|
-
var DrawerHeader_1 = require("./lib/DrawerHeader");
|
|
15
|
-
Object.defineProperty(exports, "DeprecatedDrawerHeader", { enumerable: true, get: function () { return DrawerHeader_1.DeprecatedDrawerHeader; } });
|
|
16
|
-
__exportStar(require("./lib/Drawer"), exports);
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CanvasSpaceValues } from '@workday/canvas-kit-react/tokens';
|
|
3
|
-
/**
|
|
4
|
-
* ### Deprecated Drawer Props
|
|
5
|
-
*
|
|
6
|
-
* As of Canvas Kit v8, Drawer is being soft-deprecated.
|
|
7
|
-
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
8
|
-
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
9
|
-
* for more information.
|
|
10
|
-
*/
|
|
11
|
-
export interface DeprecatedDrawerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
12
|
-
/**
|
|
13
|
-
* The padding of the DeprecatedDrawer contents.
|
|
14
|
-
* @default space.s
|
|
15
|
-
*/
|
|
16
|
-
padding?: CanvasSpaceValues;
|
|
17
|
-
/**
|
|
18
|
-
* The direction from which the DeprecatedDrawer opens. Accepts `Left` or `Right`.
|
|
19
|
-
* @default DeprecatedDrawerDirection.Right
|
|
20
|
-
*/
|
|
21
|
-
openDirection?: DeprecatedDrawerDirection;
|
|
22
|
-
/**
|
|
23
|
-
* The width of the DeprecatedDrawer in `px`.
|
|
24
|
-
* @default 360
|
|
25
|
-
*/
|
|
26
|
-
width?: number;
|
|
27
|
-
/**
|
|
28
|
-
* If true, render the DeprecatedDrawer with a drop shadow.
|
|
29
|
-
* @default false
|
|
30
|
-
*/
|
|
31
|
-
showDropShadow?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* The optional DeprecatedDrawerHeader component of the DeprecatedDrawer. Shows an optional string and close button.
|
|
34
|
-
*/
|
|
35
|
-
header?: React.ReactElement;
|
|
36
|
-
/**
|
|
37
|
-
* The `aria-labelledby` of the DeprecatedDrawer. Set this when there is a `header` for accessibility. The `role` attribute should also be used when this attribute is present. This value should be the same as the `id` attribute of the `header` element.
|
|
38
|
-
*/
|
|
39
|
-
'aria-labelledby'?: string;
|
|
40
|
-
/**
|
|
41
|
-
* The `aria-label` for the DeprecatedDrawer. Set this when there is NO `header` for accessibility.
|
|
42
|
-
*/
|
|
43
|
-
'aria-label'?: string;
|
|
44
|
-
/**
|
|
45
|
-
* The role of the DeprecatedDrawer. If `role` is provided, you must also set `aria-labelledby` to link `header` to the `role`.
|
|
46
|
-
*/
|
|
47
|
-
role?: string;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* ### Deprecated Drawer Direction
|
|
51
|
-
*
|
|
52
|
-
* As of Canvas Kit v8, Drawer is being soft-deprecated.
|
|
53
|
-
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
54
|
-
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
55
|
-
* for more information.
|
|
56
|
-
*/
|
|
57
|
-
export declare enum DeprecatedDrawerDirection {
|
|
58
|
-
Left = 0,
|
|
59
|
-
Right = 1
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* ### Deprecated Drawer
|
|
63
|
-
*
|
|
64
|
-
* As of Canvas Kit v8, this component is being soft-deprecated.
|
|
65
|
-
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
66
|
-
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
67
|
-
* for more information.
|
|
68
|
-
*/
|
|
69
|
-
export declare class DeprecatedDrawer extends React.Component<DeprecatedDrawerProps, {}> {
|
|
70
|
-
static OpenDirection: typeof DeprecatedDrawerDirection;
|
|
71
|
-
componentDidMount(): void;
|
|
72
|
-
render(): JSX.Element;
|
|
73
|
-
}
|
|
74
|
-
//# sourceMappingURL=Drawer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../../drawer/lib/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAgB,iBAAiB,EAAC,MAAM,kCAAkC,CAAC;AAElF;;;;;;;GAOG;AAEH,MAAM,WAAW,qBAAsB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACjF;;;OAGG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;;OAGG;IACH,aAAa,CAAC,EAAE,yBAAyB,CAAC;IAC1C;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC5B;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;GAOG;AAEH,oBAAY,yBAAyB;IACnC,IAAI,IAAA;IACJ,KAAK,IAAA;CACN;AA6CD;;;;;;;GAOG;AAEH,qBAAa,gBAAiB,SAAQ,KAAK,CAAC,SAAS,CAAC,qBAAqB,EAAE,EAAE,CAAC;IAC9E,MAAM,CAAC,aAAa,mCAA6B;IAEjD,iBAAiB;IASV,MAAM;CAyBd"}
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __assign = (this && this.__assign) || function () {
|
|
16
|
-
__assign = Object.assign || function(t) {
|
|
17
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
18
|
-
s = arguments[i];
|
|
19
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
20
|
-
t[p] = s[p];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
return __assign.apply(this, arguments);
|
|
25
|
-
};
|
|
26
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
27
|
-
if (k2 === undefined) k2 = k;
|
|
28
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
29
|
-
}) : (function(o, m, k, k2) {
|
|
30
|
-
if (k2 === undefined) k2 = k;
|
|
31
|
-
o[k2] = m[k];
|
|
32
|
-
}));
|
|
33
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
34
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
35
|
-
}) : function(o, v) {
|
|
36
|
-
o["default"] = v;
|
|
37
|
-
});
|
|
38
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
39
|
-
if (mod && mod.__esModule) return mod;
|
|
40
|
-
var result = {};
|
|
41
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
42
|
-
__setModuleDefault(result, mod);
|
|
43
|
-
return result;
|
|
44
|
-
};
|
|
45
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
46
|
-
var t = {};
|
|
47
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
48
|
-
t[p] = s[p];
|
|
49
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
50
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
51
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
52
|
-
t[p[i]] = s[p[i]];
|
|
53
|
-
}
|
|
54
|
-
return t;
|
|
55
|
-
};
|
|
56
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
57
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
58
|
-
};
|
|
59
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60
|
-
exports.DeprecatedDrawer = exports.DeprecatedDrawerDirection = void 0;
|
|
61
|
-
var React = __importStar(require("react"));
|
|
62
|
-
var styled_1 = __importDefault(require("@emotion/styled"));
|
|
63
|
-
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
64
|
-
/**
|
|
65
|
-
* ### Deprecated Drawer Direction
|
|
66
|
-
*
|
|
67
|
-
* As of Canvas Kit v8, Drawer is being soft-deprecated.
|
|
68
|
-
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
69
|
-
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
70
|
-
* for more information.
|
|
71
|
-
*/
|
|
72
|
-
var DeprecatedDrawerDirection;
|
|
73
|
-
(function (DeprecatedDrawerDirection) {
|
|
74
|
-
DeprecatedDrawerDirection[DeprecatedDrawerDirection["Left"] = 0] = "Left";
|
|
75
|
-
DeprecatedDrawerDirection[DeprecatedDrawerDirection["Right"] = 1] = "Right";
|
|
76
|
-
})(DeprecatedDrawerDirection = exports.DeprecatedDrawerDirection || (exports.DeprecatedDrawerDirection = {}));
|
|
77
|
-
var DrawerContainer = styled_1.default('div')({
|
|
78
|
-
height: '100%',
|
|
79
|
-
backgroundColor: 'white',
|
|
80
|
-
display: 'flex',
|
|
81
|
-
flexDirection: 'column',
|
|
82
|
-
position: 'absolute',
|
|
83
|
-
}, function (_a) {
|
|
84
|
-
var width = _a.width;
|
|
85
|
-
return ({
|
|
86
|
-
width: width,
|
|
87
|
-
});
|
|
88
|
-
}, function (_a) {
|
|
89
|
-
var showDropShadow = _a.showDropShadow, openDirection = _a.openDirection;
|
|
90
|
-
return ({
|
|
91
|
-
boxShadow: openDirection === DeprecatedDrawerDirection.Right && showDropShadow
|
|
92
|
-
? '-8px 0px 16px 0 rgba(0,0,0,0.12)'
|
|
93
|
-
: openDirection === DeprecatedDrawerDirection.Left && showDropShadow
|
|
94
|
-
? '8px 0px 16px 0 rgba(0,0,0,0.12)'
|
|
95
|
-
: undefined,
|
|
96
|
-
});
|
|
97
|
-
}, function (_a) {
|
|
98
|
-
var openDirection = _a.openDirection;
|
|
99
|
-
return ({
|
|
100
|
-
borderLeft: openDirection === DeprecatedDrawerDirection.Right ? "1px solid " + tokens_1.colors.soap400 : undefined,
|
|
101
|
-
borderRight: openDirection === DeprecatedDrawerDirection.Left ? "1px solid " + tokens_1.colors.soap400 : undefined,
|
|
102
|
-
right: openDirection === DeprecatedDrawerDirection.Right ? tokens_1.space.zero : undefined,
|
|
103
|
-
left: openDirection === DeprecatedDrawerDirection.Left ? tokens_1.space.zero : undefined,
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
var ChildrenContainer = styled_1.default('div')({
|
|
107
|
-
height: '100%',
|
|
108
|
-
overflowY: 'auto',
|
|
109
|
-
wordBreak: 'break-word',
|
|
110
|
-
position: 'relative',
|
|
111
|
-
}, function (_a) {
|
|
112
|
-
var padding = _a.padding;
|
|
113
|
-
return ({
|
|
114
|
-
padding: padding,
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
/**
|
|
118
|
-
* ### Deprecated Drawer
|
|
119
|
-
*
|
|
120
|
-
* As of Canvas Kit v8, this component is being soft-deprecated.
|
|
121
|
-
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
122
|
-
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
123
|
-
* for more information.
|
|
124
|
-
*/
|
|
125
|
-
var DeprecatedDrawer = /** @class */ (function (_super) {
|
|
126
|
-
__extends(DeprecatedDrawer, _super);
|
|
127
|
-
function DeprecatedDrawer() {
|
|
128
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
129
|
-
}
|
|
130
|
-
DeprecatedDrawer.prototype.componentDidMount = function () {
|
|
131
|
-
console.warn("This component is being deprecated and will be removed in Canvas Kit V9.\n\n For more information, please see the V8 upgrade guide:\n\n https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page\n ");
|
|
132
|
-
};
|
|
133
|
-
DeprecatedDrawer.prototype.render = function () {
|
|
134
|
-
var _a = this.props, _b = _a.padding, padding = _b === void 0 ? tokens_1.space.s : _b, _c = _a.width, width = _c === void 0 ? 360 : _c, _d = _a.openDirection, openDirection = _d === void 0 ? DeprecatedDrawerDirection.Right : _d, _e = _a.showDropShadow, showDropShadow = _e === void 0 ? false : _e, children = _a.children, header = _a.header, role = _a.role, elemProps = __rest(_a, ["padding", "width", "openDirection", "showDropShadow", "children", "header", "role"]);
|
|
135
|
-
return (React.createElement(DrawerContainer, __assign({ role: role }, elemProps, { showDropShadow: showDropShadow, width: width, openDirection: openDirection }),
|
|
136
|
-
header,
|
|
137
|
-
React.createElement(ChildrenContainer, { padding: padding }, children)));
|
|
138
|
-
};
|
|
139
|
-
DeprecatedDrawer.OpenDirection = DeprecatedDrawerDirection;
|
|
140
|
-
return DeprecatedDrawer;
|
|
141
|
-
}(React.Component));
|
|
142
|
-
exports.DeprecatedDrawer = DeprecatedDrawer;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CanvasColor } from '@workday/canvas-kit-react/tokens';
|
|
3
|
-
/**
|
|
4
|
-
* ### Deprecated Drawer Header Props
|
|
5
|
-
*
|
|
6
|
-
* As of Canvas Kit v8, this component is being soft-deprecated.
|
|
7
|
-
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
8
|
-
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
9
|
-
* for more information.
|
|
10
|
-
*/
|
|
11
|
-
export interface DeprecatedDrawerHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
12
|
-
/**
|
|
13
|
-
* The text of the DeprecatedDrawerHeader. This text will also be applied as the `title` attribute of the header element.
|
|
14
|
-
*/
|
|
15
|
-
title?: string;
|
|
16
|
-
/**
|
|
17
|
-
* The function called when the DeprecatedDrawerHeader close button is clicked.
|
|
18
|
-
*/
|
|
19
|
-
onClose?: React.MouseEventHandler<HTMLButtonElement>;
|
|
20
|
-
/**
|
|
21
|
-
* The `aria-label` for the DrawHeader close button. Useful for i18n.
|
|
22
|
-
* @default Close
|
|
23
|
-
*/
|
|
24
|
-
closeIconAriaLabel?: string;
|
|
25
|
-
/**
|
|
26
|
-
* The background color of the DeprecatedDrawerHeader.
|
|
27
|
-
*/
|
|
28
|
-
headerColor?: CanvasColor | string;
|
|
29
|
-
/**
|
|
30
|
-
* The border color of the DeprecatedDrawerHeader. This should match something close to `headerColor`.
|
|
31
|
-
*/
|
|
32
|
-
borderColor?: CanvasColor | string;
|
|
33
|
-
/**
|
|
34
|
-
* If true, render the icon and header in white. Useful for preserving contrast with a dark `headerColor`.
|
|
35
|
-
* @default false
|
|
36
|
-
*/
|
|
37
|
-
inverse?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* The unique id of the DeprecatedDrawerHeader for accessibility.
|
|
40
|
-
*/
|
|
41
|
-
id?: string;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* ### Deprecated Drawer Header
|
|
45
|
-
*
|
|
46
|
-
* As of Canvas Kit v8, this component is being soft-deprecated.
|
|
47
|
-
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
48
|
-
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
49
|
-
* for more information.
|
|
50
|
-
*/
|
|
51
|
-
export declare class DeprecatedDrawerHeader extends React.Component<DeprecatedDrawerHeaderProps, {}> {
|
|
52
|
-
componentDidMount(): void;
|
|
53
|
-
render(): JSX.Element;
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=DrawerHeader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerHeader.d.ts","sourceRoot":"","sources":["../../../../drawer/lib/DrawerHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAgB,WAAW,EAAa,MAAM,kCAAkC,CAAC;AAKxF;;;;;;;GAOG;AAEH,MAAM,WAAW,2BAA4B,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACvF;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACrD;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IACnC;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IACnC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AA0BD;;;;;;;GAOG;AAEH,qBAAa,sBAAuB,SAAQ,KAAK,CAAC,SAAS,CAAC,2BAA2B,EAAE,EAAE,CAAC;IAC1F,iBAAiB;IASV,MAAM;CAwCd"}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __assign = (this && this.__assign) || function () {
|
|
16
|
-
__assign = Object.assign || function(t) {
|
|
17
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
18
|
-
s = arguments[i];
|
|
19
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
20
|
-
t[p] = s[p];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
return __assign.apply(this, arguments);
|
|
25
|
-
};
|
|
26
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
27
|
-
if (k2 === undefined) k2 = k;
|
|
28
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
29
|
-
}) : (function(o, m, k, k2) {
|
|
30
|
-
if (k2 === undefined) k2 = k;
|
|
31
|
-
o[k2] = m[k];
|
|
32
|
-
}));
|
|
33
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
34
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
35
|
-
}) : function(o, v) {
|
|
36
|
-
o["default"] = v;
|
|
37
|
-
});
|
|
38
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
39
|
-
if (mod && mod.__esModule) return mod;
|
|
40
|
-
var result = {};
|
|
41
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
42
|
-
__setModuleDefault(result, mod);
|
|
43
|
-
return result;
|
|
44
|
-
};
|
|
45
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
46
|
-
var t = {};
|
|
47
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
48
|
-
t[p] = s[p];
|
|
49
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
50
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
51
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
52
|
-
t[p[i]] = s[p[i]];
|
|
53
|
-
}
|
|
54
|
-
return t;
|
|
55
|
-
};
|
|
56
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
57
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
58
|
-
};
|
|
59
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60
|
-
exports.DeprecatedDrawerHeader = void 0;
|
|
61
|
-
var React = __importStar(require("react"));
|
|
62
|
-
var styled_1 = __importDefault(require("@emotion/styled"));
|
|
63
|
-
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
64
|
-
var button_1 = require("@workday/canvas-kit-react/button");
|
|
65
|
-
var text_1 = require("@workday/canvas-kit-react/text");
|
|
66
|
-
var canvas_system_icons_web_1 = require("@workday/canvas-system-icons-web");
|
|
67
|
-
var headerHeight = 56;
|
|
68
|
-
var HeaderContainer = styled_1.default('div')({
|
|
69
|
-
height: headerHeight,
|
|
70
|
-
display: 'flex',
|
|
71
|
-
alignItems: 'center',
|
|
72
|
-
padding: "0 " + tokens_1.space.s,
|
|
73
|
-
justifyContent: 'space-between',
|
|
74
|
-
}, function (_a) {
|
|
75
|
-
var borderColor = _a.borderColor;
|
|
76
|
-
return ({
|
|
77
|
-
borderBottom: "1px solid " + borderColor,
|
|
78
|
-
});
|
|
79
|
-
}, function (_a) {
|
|
80
|
-
var headerColor = _a.headerColor;
|
|
81
|
-
return ({
|
|
82
|
-
backgroundColor: headerColor,
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
var CloseButton = styled_1.default(button_1.TertiaryButton)({
|
|
86
|
-
margin: '-8px',
|
|
87
|
-
});
|
|
88
|
-
/**
|
|
89
|
-
* ### Deprecated Drawer Header
|
|
90
|
-
*
|
|
91
|
-
* As of Canvas Kit v8, this component is being soft-deprecated.
|
|
92
|
-
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
93
|
-
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
94
|
-
* for more information.
|
|
95
|
-
*/
|
|
96
|
-
var DeprecatedDrawerHeader = /** @class */ (function (_super) {
|
|
97
|
-
__extends(DeprecatedDrawerHeader, _super);
|
|
98
|
-
function DeprecatedDrawerHeader() {
|
|
99
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
100
|
-
}
|
|
101
|
-
DeprecatedDrawerHeader.prototype.componentDidMount = function () {
|
|
102
|
-
console.warn("This component is being deprecated and will be removed in Canvas Kit V9.\n\n For more information, please see the V8 upgrade guide:\n\n https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page\n ");
|
|
103
|
-
};
|
|
104
|
-
DeprecatedDrawerHeader.prototype.render = function () {
|
|
105
|
-
var _a = this.props, _b = _a.closeIconAriaLabel, closeIconAriaLabel = _b === void 0 ? 'Close' : _b, _c = _a.headerColor, headerColor = _c === void 0 ? tokens_1.colors.soap100 : _c, _d = _a.borderColor, borderColor = _d === void 0 ? tokens_1.colors.soap500 : _d, _e = _a.inverse, inverse = _e === void 0 ? false : _e, onClose = _a.onClose, title = _a.title, id = _a.id, elemProps = __rest(_a, ["closeIconAriaLabel", "headerColor", "borderColor", "inverse", "onClose", "title", "id"]);
|
|
106
|
-
var variant = inverse ? 'inverse' : undefined;
|
|
107
|
-
return (React.createElement(HeaderContainer, __assign({ borderColor: borderColor }, elemProps, { headerColor: headerColor }),
|
|
108
|
-
React.createElement(text_1.Text, { as: "h4", typeLevel: "body.small", title: title, fontWeight: "bold", color: tokens_1.typeColors.heading, variant: variant, paddingInlineEnd: "xxxs", whiteSpace: "nowrap", textOverflow: "ellipsis", overflow: "hidden" }, title),
|
|
109
|
-
onClose && closeIconAriaLabel && (React.createElement(CloseButton, { variant: variant, onClick: onClose, "aria-label": closeIconAriaLabel, icon: canvas_system_icons_web_1.xIcon }))));
|
|
110
|
-
};
|
|
111
|
-
return DeprecatedDrawerHeader;
|
|
112
|
-
}(React.Component));
|
|
113
|
-
exports.DeprecatedDrawerHeader = DeprecatedDrawerHeader;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,sBAAsB,EAAC,MAAM,oBAAoB,CAAC;AAC1D,cAAc,cAAc,CAAC"}
|
package/dist/es6/drawer/index.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CanvasSpaceValues } from '@workday/canvas-kit-react/tokens';
|
|
3
|
-
/**
|
|
4
|
-
* ### Deprecated Drawer Props
|
|
5
|
-
*
|
|
6
|
-
* As of Canvas Kit v8, Drawer is being soft-deprecated.
|
|
7
|
-
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
8
|
-
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
9
|
-
* for more information.
|
|
10
|
-
*/
|
|
11
|
-
export interface DeprecatedDrawerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
12
|
-
/**
|
|
13
|
-
* The padding of the DeprecatedDrawer contents.
|
|
14
|
-
* @default space.s
|
|
15
|
-
*/
|
|
16
|
-
padding?: CanvasSpaceValues;
|
|
17
|
-
/**
|
|
18
|
-
* The direction from which the DeprecatedDrawer opens. Accepts `Left` or `Right`.
|
|
19
|
-
* @default DeprecatedDrawerDirection.Right
|
|
20
|
-
*/
|
|
21
|
-
openDirection?: DeprecatedDrawerDirection;
|
|
22
|
-
/**
|
|
23
|
-
* The width of the DeprecatedDrawer in `px`.
|
|
24
|
-
* @default 360
|
|
25
|
-
*/
|
|
26
|
-
width?: number;
|
|
27
|
-
/**
|
|
28
|
-
* If true, render the DeprecatedDrawer with a drop shadow.
|
|
29
|
-
* @default false
|
|
30
|
-
*/
|
|
31
|
-
showDropShadow?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* The optional DeprecatedDrawerHeader component of the DeprecatedDrawer. Shows an optional string and close button.
|
|
34
|
-
*/
|
|
35
|
-
header?: React.ReactElement;
|
|
36
|
-
/**
|
|
37
|
-
* The `aria-labelledby` of the DeprecatedDrawer. Set this when there is a `header` for accessibility. The `role` attribute should also be used when this attribute is present. This value should be the same as the `id` attribute of the `header` element.
|
|
38
|
-
*/
|
|
39
|
-
'aria-labelledby'?: string;
|
|
40
|
-
/**
|
|
41
|
-
* The `aria-label` for the DeprecatedDrawer. Set this when there is NO `header` for accessibility.
|
|
42
|
-
*/
|
|
43
|
-
'aria-label'?: string;
|
|
44
|
-
/**
|
|
45
|
-
* The role of the DeprecatedDrawer. If `role` is provided, you must also set `aria-labelledby` to link `header` to the `role`.
|
|
46
|
-
*/
|
|
47
|
-
role?: string;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* ### Deprecated Drawer Direction
|
|
51
|
-
*
|
|
52
|
-
* As of Canvas Kit v8, Drawer is being soft-deprecated.
|
|
53
|
-
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
54
|
-
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
55
|
-
* for more information.
|
|
56
|
-
*/
|
|
57
|
-
export declare enum DeprecatedDrawerDirection {
|
|
58
|
-
Left = 0,
|
|
59
|
-
Right = 1
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* ### Deprecated Drawer
|
|
63
|
-
*
|
|
64
|
-
* As of Canvas Kit v8, this component is being soft-deprecated.
|
|
65
|
-
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
66
|
-
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
67
|
-
* for more information.
|
|
68
|
-
*/
|
|
69
|
-
export declare class DeprecatedDrawer extends React.Component<DeprecatedDrawerProps, {}> {
|
|
70
|
-
static OpenDirection: typeof DeprecatedDrawerDirection;
|
|
71
|
-
componentDidMount(): void;
|
|
72
|
-
render(): JSX.Element;
|
|
73
|
-
}
|
|
74
|
-
//# sourceMappingURL=Drawer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../../drawer/lib/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAgB,iBAAiB,EAAC,MAAM,kCAAkC,CAAC;AAElF;;;;;;;GAOG;AAEH,MAAM,WAAW,qBAAsB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACjF;;;OAGG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;;OAGG;IACH,aAAa,CAAC,EAAE,yBAAyB,CAAC;IAC1C;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC5B;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;GAOG;AAEH,oBAAY,yBAAyB;IACnC,IAAI,IAAA;IACJ,KAAK,IAAA;CACN;AA6CD;;;;;;;GAOG;AAEH,qBAAa,gBAAiB,SAAQ,KAAK,CAAC,SAAS,CAAC,qBAAqB,EAAE,EAAE,CAAC;IAC9E,MAAM,CAAC,aAAa,mCAA6B;IAEjD,iBAAiB;IASV,MAAM;CAyBd"}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
extendStatics(d, b);
|
|
10
|
-
function __() { this.constructor = d; }
|
|
11
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
-
};
|
|
13
|
-
})();
|
|
14
|
-
var __assign = (this && this.__assign) || function () {
|
|
15
|
-
__assign = Object.assign || function(t) {
|
|
16
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
17
|
-
s = arguments[i];
|
|
18
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
19
|
-
t[p] = s[p];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
return __assign.apply(this, arguments);
|
|
24
|
-
};
|
|
25
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
-
var t = {};
|
|
27
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
-
t[p] = s[p];
|
|
29
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
-
t[p[i]] = s[p[i]];
|
|
33
|
-
}
|
|
34
|
-
return t;
|
|
35
|
-
};
|
|
36
|
-
import * as React from 'react';
|
|
37
|
-
import styled from '@emotion/styled';
|
|
38
|
-
import { colors, space } from '@workday/canvas-kit-react/tokens';
|
|
39
|
-
/**
|
|
40
|
-
* ### Deprecated Drawer Direction
|
|
41
|
-
*
|
|
42
|
-
* As of Canvas Kit v8, Drawer is being soft-deprecated.
|
|
43
|
-
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
44
|
-
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
45
|
-
* for more information.
|
|
46
|
-
*/
|
|
47
|
-
export var DeprecatedDrawerDirection;
|
|
48
|
-
(function (DeprecatedDrawerDirection) {
|
|
49
|
-
DeprecatedDrawerDirection[DeprecatedDrawerDirection["Left"] = 0] = "Left";
|
|
50
|
-
DeprecatedDrawerDirection[DeprecatedDrawerDirection["Right"] = 1] = "Right";
|
|
51
|
-
})(DeprecatedDrawerDirection || (DeprecatedDrawerDirection = {}));
|
|
52
|
-
var DrawerContainer = styled('div')({
|
|
53
|
-
height: '100%',
|
|
54
|
-
backgroundColor: 'white',
|
|
55
|
-
display: 'flex',
|
|
56
|
-
flexDirection: 'column',
|
|
57
|
-
position: 'absolute',
|
|
58
|
-
}, function (_a) {
|
|
59
|
-
var width = _a.width;
|
|
60
|
-
return ({
|
|
61
|
-
width: width,
|
|
62
|
-
});
|
|
63
|
-
}, function (_a) {
|
|
64
|
-
var showDropShadow = _a.showDropShadow, openDirection = _a.openDirection;
|
|
65
|
-
return ({
|
|
66
|
-
boxShadow: openDirection === DeprecatedDrawerDirection.Right && showDropShadow
|
|
67
|
-
? '-8px 0px 16px 0 rgba(0,0,0,0.12)'
|
|
68
|
-
: openDirection === DeprecatedDrawerDirection.Left && showDropShadow
|
|
69
|
-
? '8px 0px 16px 0 rgba(0,0,0,0.12)'
|
|
70
|
-
: undefined,
|
|
71
|
-
});
|
|
72
|
-
}, function (_a) {
|
|
73
|
-
var openDirection = _a.openDirection;
|
|
74
|
-
return ({
|
|
75
|
-
borderLeft: openDirection === DeprecatedDrawerDirection.Right ? "1px solid " + colors.soap400 : undefined,
|
|
76
|
-
borderRight: openDirection === DeprecatedDrawerDirection.Left ? "1px solid " + colors.soap400 : undefined,
|
|
77
|
-
right: openDirection === DeprecatedDrawerDirection.Right ? space.zero : undefined,
|
|
78
|
-
left: openDirection === DeprecatedDrawerDirection.Left ? space.zero : undefined,
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
var ChildrenContainer = styled('div')({
|
|
82
|
-
height: '100%',
|
|
83
|
-
overflowY: 'auto',
|
|
84
|
-
wordBreak: 'break-word',
|
|
85
|
-
position: 'relative',
|
|
86
|
-
}, function (_a) {
|
|
87
|
-
var padding = _a.padding;
|
|
88
|
-
return ({
|
|
89
|
-
padding: padding,
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
/**
|
|
93
|
-
* ### Deprecated Drawer
|
|
94
|
-
*
|
|
95
|
-
* As of Canvas Kit v8, this component is being soft-deprecated.
|
|
96
|
-
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
97
|
-
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
98
|
-
* for more information.
|
|
99
|
-
*/
|
|
100
|
-
var DeprecatedDrawer = /** @class */ (function (_super) {
|
|
101
|
-
__extends(DeprecatedDrawer, _super);
|
|
102
|
-
function DeprecatedDrawer() {
|
|
103
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
104
|
-
}
|
|
105
|
-
DeprecatedDrawer.prototype.componentDidMount = function () {
|
|
106
|
-
console.warn("This component is being deprecated and will be removed in Canvas Kit V9.\n\n For more information, please see the V8 upgrade guide:\n\n https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page\n ");
|
|
107
|
-
};
|
|
108
|
-
DeprecatedDrawer.prototype.render = function () {
|
|
109
|
-
var _a = this.props, _b = _a.padding, padding = _b === void 0 ? space.s : _b, _c = _a.width, width = _c === void 0 ? 360 : _c, _d = _a.openDirection, openDirection = _d === void 0 ? DeprecatedDrawerDirection.Right : _d, _e = _a.showDropShadow, showDropShadow = _e === void 0 ? false : _e, children = _a.children, header = _a.header, role = _a.role, elemProps = __rest(_a, ["padding", "width", "openDirection", "showDropShadow", "children", "header", "role"]);
|
|
110
|
-
return (React.createElement(DrawerContainer, __assign({ role: role }, elemProps, { showDropShadow: showDropShadow, width: width, openDirection: openDirection }),
|
|
111
|
-
header,
|
|
112
|
-
React.createElement(ChildrenContainer, { padding: padding }, children)));
|
|
113
|
-
};
|
|
114
|
-
DeprecatedDrawer.OpenDirection = DeprecatedDrawerDirection;
|
|
115
|
-
return DeprecatedDrawer;
|
|
116
|
-
}(React.Component));
|
|
117
|
-
export { DeprecatedDrawer };
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CanvasColor } from '@workday/canvas-kit-react/tokens';
|
|
3
|
-
/**
|
|
4
|
-
* ### Deprecated Drawer Header Props
|
|
5
|
-
*
|
|
6
|
-
* As of Canvas Kit v8, this component is being soft-deprecated.
|
|
7
|
-
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
8
|
-
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
9
|
-
* for more information.
|
|
10
|
-
*/
|
|
11
|
-
export interface DeprecatedDrawerHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
12
|
-
/**
|
|
13
|
-
* The text of the DeprecatedDrawerHeader. This text will also be applied as the `title` attribute of the header element.
|
|
14
|
-
*/
|
|
15
|
-
title?: string;
|
|
16
|
-
/**
|
|
17
|
-
* The function called when the DeprecatedDrawerHeader close button is clicked.
|
|
18
|
-
*/
|
|
19
|
-
onClose?: React.MouseEventHandler<HTMLButtonElement>;
|
|
20
|
-
/**
|
|
21
|
-
* The `aria-label` for the DrawHeader close button. Useful for i18n.
|
|
22
|
-
* @default Close
|
|
23
|
-
*/
|
|
24
|
-
closeIconAriaLabel?: string;
|
|
25
|
-
/**
|
|
26
|
-
* The background color of the DeprecatedDrawerHeader.
|
|
27
|
-
*/
|
|
28
|
-
headerColor?: CanvasColor | string;
|
|
29
|
-
/**
|
|
30
|
-
* The border color of the DeprecatedDrawerHeader. This should match something close to `headerColor`.
|
|
31
|
-
*/
|
|
32
|
-
borderColor?: CanvasColor | string;
|
|
33
|
-
/**
|
|
34
|
-
* If true, render the icon and header in white. Useful for preserving contrast with a dark `headerColor`.
|
|
35
|
-
* @default false
|
|
36
|
-
*/
|
|
37
|
-
inverse?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* The unique id of the DeprecatedDrawerHeader for accessibility.
|
|
40
|
-
*/
|
|
41
|
-
id?: string;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* ### Deprecated Drawer Header
|
|
45
|
-
*
|
|
46
|
-
* As of Canvas Kit v8, this component is being soft-deprecated.
|
|
47
|
-
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
48
|
-
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
49
|
-
* for more information.
|
|
50
|
-
*/
|
|
51
|
-
export declare class DeprecatedDrawerHeader extends React.Component<DeprecatedDrawerHeaderProps, {}> {
|
|
52
|
-
componentDidMount(): void;
|
|
53
|
-
render(): JSX.Element;
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=DrawerHeader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerHeader.d.ts","sourceRoot":"","sources":["../../../../drawer/lib/DrawerHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAgB,WAAW,EAAa,MAAM,kCAAkC,CAAC;AAKxF;;;;;;;GAOG;AAEH,MAAM,WAAW,2BAA4B,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACvF;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACrD;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IACnC;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IACnC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AA0BD;;;;;;;GAOG;AAEH,qBAAa,sBAAuB,SAAQ,KAAK,CAAC,SAAS,CAAC,2BAA2B,EAAE,EAAE,CAAC;IAC1F,iBAAiB;IASV,MAAM;CAwCd"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
extendStatics(d, b);
|
|
10
|
-
function __() { this.constructor = d; }
|
|
11
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12
|
-
};
|
|
13
|
-
})();
|
|
14
|
-
var __assign = (this && this.__assign) || function () {
|
|
15
|
-
__assign = Object.assign || function(t) {
|
|
16
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
17
|
-
s = arguments[i];
|
|
18
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
19
|
-
t[p] = s[p];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
return __assign.apply(this, arguments);
|
|
24
|
-
};
|
|
25
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
-
var t = {};
|
|
27
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
-
t[p] = s[p];
|
|
29
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
-
t[p[i]] = s[p[i]];
|
|
33
|
-
}
|
|
34
|
-
return t;
|
|
35
|
-
};
|
|
36
|
-
import * as React from 'react';
|
|
37
|
-
import styled from '@emotion/styled';
|
|
38
|
-
import { colors, space, typeColors } from '@workday/canvas-kit-react/tokens';
|
|
39
|
-
import { TertiaryButton } from '@workday/canvas-kit-react/button';
|
|
40
|
-
import { Text } from '@workday/canvas-kit-react/text';
|
|
41
|
-
import { xIcon } from '@workday/canvas-system-icons-web';
|
|
42
|
-
var headerHeight = 56;
|
|
43
|
-
var HeaderContainer = styled('div')({
|
|
44
|
-
height: headerHeight,
|
|
45
|
-
display: 'flex',
|
|
46
|
-
alignItems: 'center',
|
|
47
|
-
padding: "0 " + space.s,
|
|
48
|
-
justifyContent: 'space-between',
|
|
49
|
-
}, function (_a) {
|
|
50
|
-
var borderColor = _a.borderColor;
|
|
51
|
-
return ({
|
|
52
|
-
borderBottom: "1px solid " + borderColor,
|
|
53
|
-
});
|
|
54
|
-
}, function (_a) {
|
|
55
|
-
var headerColor = _a.headerColor;
|
|
56
|
-
return ({
|
|
57
|
-
backgroundColor: headerColor,
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
var CloseButton = styled(TertiaryButton)({
|
|
61
|
-
margin: '-8px',
|
|
62
|
-
});
|
|
63
|
-
/**
|
|
64
|
-
* ### Deprecated Drawer Header
|
|
65
|
-
*
|
|
66
|
-
* As of Canvas Kit v8, this component is being soft-deprecated.
|
|
67
|
-
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
68
|
-
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
69
|
-
* for more information.
|
|
70
|
-
*/
|
|
71
|
-
var DeprecatedDrawerHeader = /** @class */ (function (_super) {
|
|
72
|
-
__extends(DeprecatedDrawerHeader, _super);
|
|
73
|
-
function DeprecatedDrawerHeader() {
|
|
74
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
75
|
-
}
|
|
76
|
-
DeprecatedDrawerHeader.prototype.componentDidMount = function () {
|
|
77
|
-
console.warn("This component is being deprecated and will be removed in Canvas Kit V9.\n\n For more information, please see the V8 upgrade guide:\n\n https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page\n ");
|
|
78
|
-
};
|
|
79
|
-
DeprecatedDrawerHeader.prototype.render = function () {
|
|
80
|
-
var _a = this.props, _b = _a.closeIconAriaLabel, closeIconAriaLabel = _b === void 0 ? 'Close' : _b, _c = _a.headerColor, headerColor = _c === void 0 ? colors.soap100 : _c, _d = _a.borderColor, borderColor = _d === void 0 ? colors.soap500 : _d, _e = _a.inverse, inverse = _e === void 0 ? false : _e, onClose = _a.onClose, title = _a.title, id = _a.id, elemProps = __rest(_a, ["closeIconAriaLabel", "headerColor", "borderColor", "inverse", "onClose", "title", "id"]);
|
|
81
|
-
var variant = inverse ? 'inverse' : undefined;
|
|
82
|
-
return (React.createElement(HeaderContainer, __assign({ borderColor: borderColor }, elemProps, { headerColor: headerColor }),
|
|
83
|
-
React.createElement(Text, { as: "h4", typeLevel: "body.small", title: title, fontWeight: "bold", color: typeColors.heading, variant: variant, paddingInlineEnd: "xxxs", whiteSpace: "nowrap", textOverflow: "ellipsis", overflow: "hidden" }, title),
|
|
84
|
-
onClose && closeIconAriaLabel && (React.createElement(CloseButton, { variant: variant, onClick: onClose, "aria-label": closeIconAriaLabel, icon: xIcon }))));
|
|
85
|
-
};
|
|
86
|
-
return DeprecatedDrawerHeader;
|
|
87
|
-
}(React.Component));
|
|
88
|
-
export { DeprecatedDrawerHeader };
|
package/drawer/LICENSE
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
Apache License, Version 2.0 Apache License Version 2.0, January 2004
|
|
2
|
-
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
|
9
|
-
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
|
10
|
-
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
|
11
|
-
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
|
12
|
-
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
|
13
|
-
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
|
14
|
-
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
|
15
|
-
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
|
16
|
-
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
|
17
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
|
18
|
-
|
|
19
|
-
2. Grant of Copyright License.
|
|
20
|
-
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
|
21
|
-
|
|
22
|
-
3. Grant of Patent License.
|
|
23
|
-
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
|
24
|
-
|
|
25
|
-
4. Redistribution.
|
|
26
|
-
You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
|
27
|
-
You must give any other recipients of the Work or Derivative Works a copy of this License; and You must cause any modified files to carry prominent notices stating that You changed the files; and You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
|
28
|
-
|
|
29
|
-
5. Submission of Contributions.
|
|
30
|
-
Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
|
31
|
-
|
|
32
|
-
6. Trademarks.
|
|
33
|
-
This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
|
34
|
-
|
|
35
|
-
7. Disclaimer of Warranty.
|
|
36
|
-
Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
|
37
|
-
|
|
38
|
-
8. Limitation of Liability.
|
|
39
|
-
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
|
40
|
-
|
|
41
|
-
9. Accepting Warranty or Additional Liability.
|
|
42
|
-
While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
|
43
|
-
|
|
44
|
-
END OF TERMS AND CONDITIONS
|
|
45
|
-
|
|
46
|
-
©2020. Workday, Inc. All rights reserved. Workday and the Workday logo are registered trademarks of Workday, Inc. All other brand and product names are trademarks or registered trademarks of their respective holders.
|
|
47
|
-
|
|
48
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
|
|
49
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
50
|
-
|
|
51
|
-
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
package/drawer/README.md
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# Canvas Kit React Drawer
|
|
2
|
-
|
|
3
|
-
<a href="https://github.com/Workday/canvas-kit/tree/master/modules/labs-react/README.md">
|
|
4
|
-
<img src="https://img.shields.io/badge/LABS-alpha-orange" alt="LABS: Alpha" />
|
|
5
|
-
</a> This component is work in progress and currently in pre-release.
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
|
|
9
|
-
```sh
|
|
10
|
-
yarn add @workday/canvas-kit-labs-react
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
```tsx
|
|
16
|
-
import * as React from 'react';
|
|
17
|
-
import {Drawer, DrawerDirection, DrawerHeader} from '@workday/canvas-kit-labs-react/drawer';
|
|
18
|
-
import {space} from '@workday/canvas-kit-react/tokens';
|
|
19
|
-
|
|
20
|
-
<div style={{height: '100vh', position: 'relative'}}>
|
|
21
|
-
<Drawer
|
|
22
|
-
header={
|
|
23
|
-
<DrawerHeader
|
|
24
|
-
onClose={() => {
|
|
25
|
-
window.alert('onClose Clicked');
|
|
26
|
-
}}
|
|
27
|
-
headerTitle={'Drawer Header'}
|
|
28
|
-
/>
|
|
29
|
-
}
|
|
30
|
-
openDirection={DrawerDirection.Left}
|
|
31
|
-
padding={space.l}
|
|
32
|
-
showDropShadow={true}
|
|
33
|
-
></Drawer>
|
|
34
|
-
</div>;
|
|
35
|
-
```
|
package/drawer/index.ts
DELETED
package/drawer/lib/Drawer.tsx
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import styled from '@emotion/styled';
|
|
3
|
-
import {colors, space, CanvasSpaceValues} from '@workday/canvas-kit-react/tokens';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* ### Deprecated Drawer Props
|
|
7
|
-
*
|
|
8
|
-
* As of Canvas Kit v8, Drawer is being soft-deprecated.
|
|
9
|
-
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
10
|
-
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
11
|
-
* for more information.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
export interface DeprecatedDrawerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
15
|
-
/**
|
|
16
|
-
* The padding of the DeprecatedDrawer contents.
|
|
17
|
-
* @default space.s
|
|
18
|
-
*/
|
|
19
|
-
padding?: CanvasSpaceValues;
|
|
20
|
-
/**
|
|
21
|
-
* The direction from which the DeprecatedDrawer opens. Accepts `Left` or `Right`.
|
|
22
|
-
* @default DeprecatedDrawerDirection.Right
|
|
23
|
-
*/
|
|
24
|
-
openDirection?: DeprecatedDrawerDirection;
|
|
25
|
-
/**
|
|
26
|
-
* The width of the DeprecatedDrawer in `px`.
|
|
27
|
-
* @default 360
|
|
28
|
-
*/
|
|
29
|
-
width?: number;
|
|
30
|
-
/**
|
|
31
|
-
* If true, render the DeprecatedDrawer with a drop shadow.
|
|
32
|
-
* @default false
|
|
33
|
-
*/
|
|
34
|
-
showDropShadow?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* The optional DeprecatedDrawerHeader component of the DeprecatedDrawer. Shows an optional string and close button.
|
|
37
|
-
*/
|
|
38
|
-
header?: React.ReactElement;
|
|
39
|
-
/**
|
|
40
|
-
* The `aria-labelledby` of the DeprecatedDrawer. Set this when there is a `header` for accessibility. The `role` attribute should also be used when this attribute is present. This value should be the same as the `id` attribute of the `header` element.
|
|
41
|
-
*/
|
|
42
|
-
'aria-labelledby'?: string;
|
|
43
|
-
/**
|
|
44
|
-
* The `aria-label` for the DeprecatedDrawer. Set this when there is NO `header` for accessibility.
|
|
45
|
-
*/
|
|
46
|
-
'aria-label'?: string;
|
|
47
|
-
/**
|
|
48
|
-
* The role of the DeprecatedDrawer. If `role` is provided, you must also set `aria-labelledby` to link `header` to the `role`.
|
|
49
|
-
*/
|
|
50
|
-
role?: string;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* ### Deprecated Drawer Direction
|
|
55
|
-
*
|
|
56
|
-
* As of Canvas Kit v8, Drawer is being soft-deprecated.
|
|
57
|
-
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
58
|
-
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
59
|
-
* for more information.
|
|
60
|
-
*/
|
|
61
|
-
|
|
62
|
-
export enum DeprecatedDrawerDirection {
|
|
63
|
-
Left,
|
|
64
|
-
Right,
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const DrawerContainer = styled('div')<
|
|
68
|
-
Pick<DeprecatedDrawerProps, 'width' | 'showDropShadow' | 'openDirection'>
|
|
69
|
-
>(
|
|
70
|
-
{
|
|
71
|
-
height: '100%',
|
|
72
|
-
backgroundColor: 'white',
|
|
73
|
-
display: 'flex',
|
|
74
|
-
flexDirection: 'column',
|
|
75
|
-
position: 'absolute',
|
|
76
|
-
},
|
|
77
|
-
({width}) => ({
|
|
78
|
-
width: width,
|
|
79
|
-
}),
|
|
80
|
-
({showDropShadow, openDirection}) => ({
|
|
81
|
-
boxShadow:
|
|
82
|
-
openDirection === DeprecatedDrawerDirection.Right && showDropShadow
|
|
83
|
-
? '-8px 0px 16px 0 rgba(0,0,0,0.12)'
|
|
84
|
-
: openDirection === DeprecatedDrawerDirection.Left && showDropShadow
|
|
85
|
-
? '8px 0px 16px 0 rgba(0,0,0,0.12)'
|
|
86
|
-
: undefined,
|
|
87
|
-
}),
|
|
88
|
-
({openDirection}) => ({
|
|
89
|
-
borderLeft:
|
|
90
|
-
openDirection === DeprecatedDrawerDirection.Right ? `1px solid ${colors.soap400}` : undefined,
|
|
91
|
-
borderRight:
|
|
92
|
-
openDirection === DeprecatedDrawerDirection.Left ? `1px solid ${colors.soap400}` : undefined,
|
|
93
|
-
right: openDirection === DeprecatedDrawerDirection.Right ? space.zero : undefined,
|
|
94
|
-
left: openDirection === DeprecatedDrawerDirection.Left ? space.zero : undefined,
|
|
95
|
-
})
|
|
96
|
-
);
|
|
97
|
-
|
|
98
|
-
const ChildrenContainer = styled('div')<Pick<DeprecatedDrawerProps, 'padding'>>(
|
|
99
|
-
{
|
|
100
|
-
height: '100%',
|
|
101
|
-
overflowY: 'auto',
|
|
102
|
-
wordBreak: 'break-word',
|
|
103
|
-
position: 'relative',
|
|
104
|
-
},
|
|
105
|
-
({padding}) => ({
|
|
106
|
-
padding: padding,
|
|
107
|
-
})
|
|
108
|
-
);
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* ### Deprecated Drawer
|
|
112
|
-
*
|
|
113
|
-
* As of Canvas Kit v8, this component is being soft-deprecated.
|
|
114
|
-
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
115
|
-
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
116
|
-
* for more information.
|
|
117
|
-
*/
|
|
118
|
-
|
|
119
|
-
export class DeprecatedDrawer extends React.Component<DeprecatedDrawerProps, {}> {
|
|
120
|
-
static OpenDirection = DeprecatedDrawerDirection;
|
|
121
|
-
|
|
122
|
-
componentDidMount() {
|
|
123
|
-
console.warn(
|
|
124
|
-
`This component is being deprecated and will be removed in Canvas Kit V9.\n
|
|
125
|
-
For more information, please see the V8 upgrade guide:\n
|
|
126
|
-
https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page
|
|
127
|
-
`
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
public render() {
|
|
132
|
-
const {
|
|
133
|
-
padding = space.s,
|
|
134
|
-
width = 360,
|
|
135
|
-
openDirection = DeprecatedDrawerDirection.Right,
|
|
136
|
-
showDropShadow = false,
|
|
137
|
-
children,
|
|
138
|
-
header,
|
|
139
|
-
role,
|
|
140
|
-
...elemProps
|
|
141
|
-
} = this.props;
|
|
142
|
-
|
|
143
|
-
return (
|
|
144
|
-
<DrawerContainer
|
|
145
|
-
role={role}
|
|
146
|
-
{...elemProps}
|
|
147
|
-
showDropShadow={showDropShadow}
|
|
148
|
-
width={width}
|
|
149
|
-
openDirection={openDirection}
|
|
150
|
-
>
|
|
151
|
-
{header}
|
|
152
|
-
<ChildrenContainer padding={padding}>{children}</ChildrenContainer>
|
|
153
|
-
</DrawerContainer>
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import styled from '@emotion/styled';
|
|
3
|
-
import {colors, space, CanvasColor, typeColors} from '@workday/canvas-kit-react/tokens';
|
|
4
|
-
import {TertiaryButton} from '@workday/canvas-kit-react/button';
|
|
5
|
-
import {Text} from '@workday/canvas-kit-react/text';
|
|
6
|
-
import {xIcon} from '@workday/canvas-system-icons-web';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* ### Deprecated Drawer Header Props
|
|
10
|
-
*
|
|
11
|
-
* As of Canvas Kit v8, this component is being soft-deprecated.
|
|
12
|
-
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
13
|
-
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
14
|
-
* for more information.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
export interface DeprecatedDrawerHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
18
|
-
/**
|
|
19
|
-
* The text of the DeprecatedDrawerHeader. This text will also be applied as the `title` attribute of the header element.
|
|
20
|
-
*/
|
|
21
|
-
title?: string;
|
|
22
|
-
/**
|
|
23
|
-
* The function called when the DeprecatedDrawerHeader close button is clicked.
|
|
24
|
-
*/
|
|
25
|
-
onClose?: React.MouseEventHandler<HTMLButtonElement>;
|
|
26
|
-
/**
|
|
27
|
-
* The `aria-label` for the DrawHeader close button. Useful for i18n.
|
|
28
|
-
* @default Close
|
|
29
|
-
*/
|
|
30
|
-
closeIconAriaLabel?: string;
|
|
31
|
-
/**
|
|
32
|
-
* The background color of the DeprecatedDrawerHeader.
|
|
33
|
-
*/
|
|
34
|
-
headerColor?: CanvasColor | string;
|
|
35
|
-
/**
|
|
36
|
-
* The border color of the DeprecatedDrawerHeader. This should match something close to `headerColor`.
|
|
37
|
-
*/
|
|
38
|
-
borderColor?: CanvasColor | string;
|
|
39
|
-
/**
|
|
40
|
-
* If true, render the icon and header in white. Useful for preserving contrast with a dark `headerColor`.
|
|
41
|
-
* @default false
|
|
42
|
-
*/
|
|
43
|
-
inverse?: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* The unique id of the DeprecatedDrawerHeader for accessibility.
|
|
46
|
-
*/
|
|
47
|
-
id?: string;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const headerHeight = 56;
|
|
51
|
-
|
|
52
|
-
const HeaderContainer = styled('div')<
|
|
53
|
-
Pick<DeprecatedDrawerHeaderProps, 'headerColor' | 'borderColor'>
|
|
54
|
-
>(
|
|
55
|
-
{
|
|
56
|
-
height: headerHeight,
|
|
57
|
-
display: 'flex',
|
|
58
|
-
alignItems: 'center',
|
|
59
|
-
padding: `0 ${space.s}`,
|
|
60
|
-
justifyContent: 'space-between',
|
|
61
|
-
},
|
|
62
|
-
({borderColor}) => ({
|
|
63
|
-
borderBottom: `1px solid ${borderColor}`,
|
|
64
|
-
}),
|
|
65
|
-
({headerColor}) => ({
|
|
66
|
-
backgroundColor: headerColor,
|
|
67
|
-
})
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
const CloseButton = styled(TertiaryButton)({
|
|
71
|
-
margin: '-8px', // for inverse and plain button, we always want this margin
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* ### Deprecated Drawer Header
|
|
76
|
-
*
|
|
77
|
-
* As of Canvas Kit v8, this component is being soft-deprecated.
|
|
78
|
-
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
79
|
-
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
80
|
-
* for more information.
|
|
81
|
-
*/
|
|
82
|
-
|
|
83
|
-
export class DeprecatedDrawerHeader extends React.Component<DeprecatedDrawerHeaderProps, {}> {
|
|
84
|
-
componentDidMount() {
|
|
85
|
-
console.warn(
|
|
86
|
-
`This component is being deprecated and will be removed in Canvas Kit V9.\n
|
|
87
|
-
For more information, please see the V8 upgrade guide:\n
|
|
88
|
-
https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page
|
|
89
|
-
`
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
public render() {
|
|
94
|
-
const {
|
|
95
|
-
closeIconAriaLabel = 'Close',
|
|
96
|
-
headerColor = colors.soap100,
|
|
97
|
-
borderColor = colors.soap500,
|
|
98
|
-
inverse = false,
|
|
99
|
-
onClose,
|
|
100
|
-
title,
|
|
101
|
-
id,
|
|
102
|
-
...elemProps
|
|
103
|
-
} = this.props;
|
|
104
|
-
const variant = inverse ? 'inverse' : undefined;
|
|
105
|
-
|
|
106
|
-
return (
|
|
107
|
-
<HeaderContainer borderColor={borderColor} {...elemProps} headerColor={headerColor}>
|
|
108
|
-
<Text
|
|
109
|
-
as="h4"
|
|
110
|
-
typeLevel="body.small"
|
|
111
|
-
title={title}
|
|
112
|
-
fontWeight="bold"
|
|
113
|
-
color={typeColors.heading}
|
|
114
|
-
variant={variant}
|
|
115
|
-
paddingInlineEnd="xxxs"
|
|
116
|
-
whiteSpace="nowrap"
|
|
117
|
-
textOverflow="ellipsis"
|
|
118
|
-
overflow="hidden"
|
|
119
|
-
>
|
|
120
|
-
{title}
|
|
121
|
-
</Text>
|
|
122
|
-
{onClose && closeIconAriaLabel && (
|
|
123
|
-
<CloseButton
|
|
124
|
-
variant={variant}
|
|
125
|
-
onClick={onClose}
|
|
126
|
-
aria-label={closeIconAriaLabel}
|
|
127
|
-
icon={xIcon}
|
|
128
|
-
/>
|
|
129
|
-
)}
|
|
130
|
-
</HeaderContainer>
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
}
|