@workday/canvas-kit-labs-react 8.0.0-alpha.192-next.1 → 8.0.0-alpha.198-next.0

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.
@@ -1,3 +1,3 @@
1
- export { DrawerHeader } from './lib/DrawerHeader';
1
+ export { DeprecatedDrawerHeader } from './lib/DrawerHeader';
2
2
  export * from './lib/Drawer';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAChD,cAAc,cAAc,CAAC"}
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"}
@@ -10,7 +10,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.DrawerHeader = void 0;
13
+ exports.DeprecatedDrawerHeader = void 0;
14
14
  var DrawerHeader_1 = require("./lib/DrawerHeader");
15
- Object.defineProperty(exports, "DrawerHeader", { enumerable: true, get: function () { return DrawerHeader_1.DrawerHeader; } });
15
+ Object.defineProperty(exports, "DeprecatedDrawerHeader", { enumerable: true, get: function () { return DrawerHeader_1.DeprecatedDrawerHeader; } });
16
16
  __exportStar(require("./lib/Drawer"), exports);
@@ -1,49 +1,74 @@
1
1
  import * as React from 'react';
2
2
  import { CanvasSpaceValues } from '@workday/canvas-kit-react/tokens';
3
- export interface DrawerProps extends React.HTMLAttributes<HTMLDivElement> {
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> {
4
12
  /**
5
- * The padding of the Drawer contents.
13
+ * The padding of the DeprecatedDrawer contents.
6
14
  * @default space.s
7
15
  */
8
16
  padding?: CanvasSpaceValues;
9
17
  /**
10
- * The direction from which the Drawer opens. Accepts `Left` or `Right`.
11
- * @default DrawerDirection.Right
18
+ * The direction from which the DeprecatedDrawer opens. Accepts `Left` or `Right`.
19
+ * @default DeprecatedDrawerDirection.Right
12
20
  */
13
- openDirection?: DrawerDirection;
21
+ openDirection?: DeprecatedDrawerDirection;
14
22
  /**
15
- * The width of the Drawer in `px`.
23
+ * The width of the DeprecatedDrawer in `px`.
16
24
  * @default 360
17
25
  */
18
26
  width?: number;
19
27
  /**
20
- * If true, render the Drawer with a drop shadow.
28
+ * If true, render the DeprecatedDrawer with a drop shadow.
21
29
  * @default false
22
30
  */
23
31
  showDropShadow?: boolean;
24
32
  /**
25
- * The optional DrawerHeader component of the Drawer. Shows an optional string and close button.
33
+ * The optional DeprecatedDrawerHeader component of the DeprecatedDrawer. Shows an optional string and close button.
26
34
  */
27
35
  header?: React.ReactElement;
28
36
  /**
29
- * The `aria-labelledby` of the Drawer. 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.
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.
30
38
  */
31
39
  'aria-labelledby'?: string;
32
40
  /**
33
- * The `aria-label` for the Drawer. Set this when there is NO `header` for accessibility.
41
+ * The `aria-label` for the DeprecatedDrawer. Set this when there is NO `header` for accessibility.
34
42
  */
35
43
  'aria-label'?: string;
36
44
  /**
37
- * The role of the Drawer. If `role` is provided, you must also set `aria-labelledby` to link `header` to the `role`.
45
+ * The role of the DeprecatedDrawer. If `role` is provided, you must also set `aria-labelledby` to link `header` to the `role`.
38
46
  */
39
47
  role?: string;
40
48
  }
41
- export declare enum DrawerDirection {
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 {
42
58
  Left = 0,
43
59
  Right = 1
44
60
  }
45
- export declare class Drawer extends React.Component<DrawerProps, {}> {
46
- static OpenDirection: typeof DrawerDirection;
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;
47
72
  render(): JSX.Element;
48
73
  }
49
74
  //# sourceMappingURL=Drawer.d.ts.map
@@ -1 +1 @@
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,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACvE;;;OAGG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;;OAGG;IACH,aAAa,CAAC,EAAE,eAAe,CAAC;IAChC;;;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,oBAAY,eAAe;IACzB,IAAI,IAAA;IACJ,KAAK,IAAA;CACN;AA4CD,qBAAa,MAAO,SAAQ,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC;IAC1D,MAAM,CAAC,aAAa,yBAAmB;IAEhC,MAAM;CAyBd"}
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;AA8CD;;;;;;;GAOG;AAEH,qBAAa,gBAAiB,SAAQ,KAAK,CAAC,SAAS,CAAC,qBAAqB,EAAE,EAAE,CAAC;IAC9E,MAAM,CAAC,aAAa,mCAA6B;IAEjD,iBAAiB;IASV,MAAM;CAyBd"}
@@ -57,15 +57,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
57
57
  return (mod && mod.__esModule) ? mod : { "default": mod };
58
58
  };
59
59
  Object.defineProperty(exports, "__esModule", { value: true });
60
- exports.Drawer = exports.DrawerDirection = void 0;
60
+ exports.DeprecatedDrawer = exports.DeprecatedDrawerDirection = void 0;
61
61
  var React = __importStar(require("react"));
62
62
  var styled_1 = __importDefault(require("@emotion/styled"));
63
63
  var tokens_1 = require("@workday/canvas-kit-react/tokens");
64
- var DrawerDirection;
65
- (function (DrawerDirection) {
66
- DrawerDirection[DrawerDirection["Left"] = 0] = "Left";
67
- DrawerDirection[DrawerDirection["Right"] = 1] = "Right";
68
- })(DrawerDirection = exports.DrawerDirection || (exports.DrawerDirection = {}));
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 = {}));
69
77
  var DrawerContainer = styled_1.default('div')({
70
78
  height: '100%',
71
79
  backgroundColor: 'white',
@@ -80,19 +88,19 @@ var DrawerContainer = styled_1.default('div')({
80
88
  }, function (_a) {
81
89
  var showDropShadow = _a.showDropShadow, openDirection = _a.openDirection;
82
90
  return ({
83
- boxShadow: openDirection === DrawerDirection.Right && showDropShadow
91
+ boxShadow: openDirection === DeprecatedDrawerDirection.Right && showDropShadow
84
92
  ? '-8px 0px 16px 0 rgba(0,0,0,0.12)'
85
- : openDirection === DrawerDirection.Left && showDropShadow
93
+ : openDirection === DeprecatedDrawerDirection.Left && showDropShadow
86
94
  ? '8px 0px 16px 0 rgba(0,0,0,0.12)'
87
95
  : undefined,
88
96
  });
89
97
  }, function (_a) {
90
98
  var openDirection = _a.openDirection;
91
99
  return ({
92
- borderLeft: openDirection === DrawerDirection.Right ? "1px solid " + tokens_1.colors.soap400 : undefined,
93
- borderRight: openDirection === DrawerDirection.Left ? "1px solid " + tokens_1.colors.soap400 : undefined,
94
- right: openDirection === DrawerDirection.Right ? tokens_1.space.zero : undefined,
95
- left: openDirection === DrawerDirection.Left ? tokens_1.space.zero : undefined,
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,
96
104
  });
97
105
  });
98
106
  var ChildrenContainer = styled_1.default('div')({
@@ -107,18 +115,29 @@ var ChildrenContainer = styled_1.default('div')({
107
115
  padding: padding,
108
116
  });
109
117
  });
110
- var Drawer = /** @class */ (function (_super) {
111
- __extends(Drawer, _super);
112
- function Drawer() {
118
+ /**
119
+ * ### Deprecated Drawer
120
+ *
121
+ * As of Canvas Kit v8, this component is being soft-deprecated.
122
+ * It will be hard-deprecated (completely removed) in v9. Please see the
123
+ * [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
124
+ * for more information.
125
+ */
126
+ var DeprecatedDrawer = /** @class */ (function (_super) {
127
+ __extends(DeprecatedDrawer, _super);
128
+ function DeprecatedDrawer() {
113
129
  return _super !== null && _super.apply(this, arguments) || this;
114
130
  }
115
- Drawer.prototype.render = function () {
116
- 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 ? DrawerDirection.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"]);
131
+ DeprecatedDrawer.prototype.componentDidMount = function () {
132
+ 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 ");
133
+ };
134
+ DeprecatedDrawer.prototype.render = function () {
135
+ 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"]);
117
136
  return (React.createElement(DrawerContainer, __assign({ role: role }, elemProps, { showDropShadow: showDropShadow, width: width, openDirection: openDirection }),
118
137
  header,
119
138
  React.createElement(ChildrenContainer, { padding: padding }, children)));
120
139
  };
121
- Drawer.OpenDirection = DrawerDirection;
122
- return Drawer;
140
+ DeprecatedDrawer.OpenDirection = DeprecatedDrawerDirection;
141
+ return DeprecatedDrawer;
123
142
  }(React.Component));
124
- exports.Drawer = Drawer;
143
+ exports.DeprecatedDrawer = DeprecatedDrawer;
@@ -1,12 +1,20 @@
1
1
  import * as React from 'react';
2
2
  import { CanvasColor } from '@workday/canvas-kit-react/tokens';
3
- export interface DrawerHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
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> {
4
12
  /**
5
- * The text of the DrawerHeader. This text will also be applied as the `title` attribute of the header element.
13
+ * The text of the DeprecatedDrawerHeader. This text will also be applied as the `title` attribute of the header element.
6
14
  */
7
15
  title?: string;
8
16
  /**
9
- * The function called when the DrawerHeader close button is clicked.
17
+ * The function called when the DeprecatedDrawerHeader close button is clicked.
10
18
  */
11
19
  onClose?: React.MouseEventHandler<HTMLButtonElement>;
12
20
  /**
@@ -15,11 +23,11 @@ export interface DrawerHeaderProps extends React.HTMLAttributes<HTMLDivElement>
15
23
  */
16
24
  closeIconAriaLabel?: string;
17
25
  /**
18
- * The background color of the DrawerHeader.
26
+ * The background color of the DeprecatedDrawerHeader.
19
27
  */
20
28
  headerColor?: CanvasColor | string;
21
29
  /**
22
- * The border color of the DrawerHeader. This should match something close to `headerColor`.
30
+ * The border color of the DeprecatedDrawerHeader. This should match something close to `headerColor`.
23
31
  */
24
32
  borderColor?: CanvasColor | string;
25
33
  /**
@@ -28,11 +36,20 @@ export interface DrawerHeaderProps extends React.HTMLAttributes<HTMLDivElement>
28
36
  */
29
37
  inverse?: boolean;
30
38
  /**
31
- * The unique id of the DrawerHeader for accessibility.
39
+ * The unique id of the DeprecatedDrawerHeader for accessibility.
32
40
  */
33
41
  id?: string;
34
42
  }
35
- export declare class DrawerHeader extends React.Component<DrawerHeaderProps, {}> {
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;
36
53
  render(): JSX.Element;
37
54
  }
38
55
  //# sourceMappingURL=DrawerHeader.d.ts.map
@@ -1 +1 @@
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,MAAM,WAAW,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC7E;;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;AAwBD,qBAAa,YAAa,SAAQ,KAAK,CAAC,SAAS,CAAC,iBAAiB,EAAE,EAAE,CAAC;IAC/D,MAAM;CAwCd"}
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"}
@@ -57,7 +57,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
57
57
  return (mod && mod.__esModule) ? mod : { "default": mod };
58
58
  };
59
59
  Object.defineProperty(exports, "__esModule", { value: true });
60
- exports.DrawerHeader = void 0;
60
+ exports.DeprecatedDrawerHeader = void 0;
61
61
  var React = __importStar(require("react"));
62
62
  var styled_1 = __importDefault(require("@emotion/styled"));
63
63
  var tokens_1 = require("@workday/canvas-kit-react/tokens");
@@ -85,18 +85,29 @@ var HeaderContainer = styled_1.default('div')({
85
85
  var CloseButton = styled_1.default(button_1.TertiaryButton)({
86
86
  margin: '-8px',
87
87
  });
88
- var DrawerHeader = /** @class */ (function (_super) {
89
- __extends(DrawerHeader, _super);
90
- function DrawerHeader() {
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() {
91
99
  return _super !== null && _super.apply(this, arguments) || this;
92
100
  }
93
- DrawerHeader.prototype.render = function () {
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 () {
94
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"]);
95
106
  var variant = inverse ? 'inverse' : undefined;
96
107
  return (React.createElement(HeaderContainer, __assign({ borderColor: borderColor }, elemProps, { headerColor: headerColor }),
97
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),
98
109
  onClose && closeIconAriaLabel && (React.createElement(CloseButton, { variant: variant, onClick: onClose, "aria-label": closeIconAriaLabel, icon: canvas_system_icons_web_1.xIcon }))));
99
110
  };
100
- return DrawerHeader;
111
+ return DeprecatedDrawerHeader;
101
112
  }(React.Component));
102
- exports.DrawerHeader = DrawerHeader;
113
+ exports.DeprecatedDrawerHeader = DeprecatedDrawerHeader;
@@ -1,3 +1,3 @@
1
- export { DrawerHeader } from './lib/DrawerHeader';
1
+ export { DeprecatedDrawerHeader } from './lib/DrawerHeader';
2
2
  export * from './lib/Drawer';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAChD,cAAc,cAAc,CAAC"}
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,2 +1,2 @@
1
- export { DrawerHeader } from './lib/DrawerHeader';
1
+ export { DeprecatedDrawerHeader } from './lib/DrawerHeader';
2
2
  export * from './lib/Drawer';
@@ -1,49 +1,74 @@
1
1
  import * as React from 'react';
2
2
  import { CanvasSpaceValues } from '@workday/canvas-kit-react/tokens';
3
- export interface DrawerProps extends React.HTMLAttributes<HTMLDivElement> {
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> {
4
12
  /**
5
- * The padding of the Drawer contents.
13
+ * The padding of the DeprecatedDrawer contents.
6
14
  * @default space.s
7
15
  */
8
16
  padding?: CanvasSpaceValues;
9
17
  /**
10
- * The direction from which the Drawer opens. Accepts `Left` or `Right`.
11
- * @default DrawerDirection.Right
18
+ * The direction from which the DeprecatedDrawer opens. Accepts `Left` or `Right`.
19
+ * @default DeprecatedDrawerDirection.Right
12
20
  */
13
- openDirection?: DrawerDirection;
21
+ openDirection?: DeprecatedDrawerDirection;
14
22
  /**
15
- * The width of the Drawer in `px`.
23
+ * The width of the DeprecatedDrawer in `px`.
16
24
  * @default 360
17
25
  */
18
26
  width?: number;
19
27
  /**
20
- * If true, render the Drawer with a drop shadow.
28
+ * If true, render the DeprecatedDrawer with a drop shadow.
21
29
  * @default false
22
30
  */
23
31
  showDropShadow?: boolean;
24
32
  /**
25
- * The optional DrawerHeader component of the Drawer. Shows an optional string and close button.
33
+ * The optional DeprecatedDrawerHeader component of the DeprecatedDrawer. Shows an optional string and close button.
26
34
  */
27
35
  header?: React.ReactElement;
28
36
  /**
29
- * The `aria-labelledby` of the Drawer. 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.
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.
30
38
  */
31
39
  'aria-labelledby'?: string;
32
40
  /**
33
- * The `aria-label` for the Drawer. Set this when there is NO `header` for accessibility.
41
+ * The `aria-label` for the DeprecatedDrawer. Set this when there is NO `header` for accessibility.
34
42
  */
35
43
  'aria-label'?: string;
36
44
  /**
37
- * The role of the Drawer. If `role` is provided, you must also set `aria-labelledby` to link `header` to the `role`.
45
+ * The role of the DeprecatedDrawer. If `role` is provided, you must also set `aria-labelledby` to link `header` to the `role`.
38
46
  */
39
47
  role?: string;
40
48
  }
41
- export declare enum DrawerDirection {
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 {
42
58
  Left = 0,
43
59
  Right = 1
44
60
  }
45
- export declare class Drawer extends React.Component<DrawerProps, {}> {
46
- static OpenDirection: typeof DrawerDirection;
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;
47
72
  render(): JSX.Element;
48
73
  }
49
74
  //# sourceMappingURL=Drawer.d.ts.map
@@ -1 +1 @@
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,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACvE;;;OAGG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;;OAGG;IACH,aAAa,CAAC,EAAE,eAAe,CAAC;IAChC;;;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,oBAAY,eAAe;IACzB,IAAI,IAAA;IACJ,KAAK,IAAA;CACN;AA4CD,qBAAa,MAAO,SAAQ,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC;IAC1D,MAAM,CAAC,aAAa,yBAAmB;IAEhC,MAAM;CAyBd"}
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;AA8CD;;;;;;;GAOG;AAEH,qBAAa,gBAAiB,SAAQ,KAAK,CAAC,SAAS,CAAC,qBAAqB,EAAE,EAAE,CAAC;IAC9E,MAAM,CAAC,aAAa,mCAA6B;IAEjD,iBAAiB;IASV,MAAM;CAyBd"}
@@ -36,11 +36,19 @@ var __rest = (this && this.__rest) || function (s, e) {
36
36
  import * as React from 'react';
37
37
  import styled from '@emotion/styled';
38
38
  import { colors, space } from '@workday/canvas-kit-react/tokens';
39
- export var DrawerDirection;
40
- (function (DrawerDirection) {
41
- DrawerDirection[DrawerDirection["Left"] = 0] = "Left";
42
- DrawerDirection[DrawerDirection["Right"] = 1] = "Right";
43
- })(DrawerDirection || (DrawerDirection = {}));
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 = {}));
44
52
  var DrawerContainer = styled('div')({
45
53
  height: '100%',
46
54
  backgroundColor: 'white',
@@ -55,19 +63,19 @@ var DrawerContainer = styled('div')({
55
63
  }, function (_a) {
56
64
  var showDropShadow = _a.showDropShadow, openDirection = _a.openDirection;
57
65
  return ({
58
- boxShadow: openDirection === DrawerDirection.Right && showDropShadow
66
+ boxShadow: openDirection === DeprecatedDrawerDirection.Right && showDropShadow
59
67
  ? '-8px 0px 16px 0 rgba(0,0,0,0.12)'
60
- : openDirection === DrawerDirection.Left && showDropShadow
68
+ : openDirection === DeprecatedDrawerDirection.Left && showDropShadow
61
69
  ? '8px 0px 16px 0 rgba(0,0,0,0.12)'
62
70
  : undefined,
63
71
  });
64
72
  }, function (_a) {
65
73
  var openDirection = _a.openDirection;
66
74
  return ({
67
- borderLeft: openDirection === DrawerDirection.Right ? "1px solid " + colors.soap400 : undefined,
68
- borderRight: openDirection === DrawerDirection.Left ? "1px solid " + colors.soap400 : undefined,
69
- right: openDirection === DrawerDirection.Right ? space.zero : undefined,
70
- left: openDirection === DrawerDirection.Left ? space.zero : undefined,
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,
71
79
  });
72
80
  });
73
81
  var ChildrenContainer = styled('div')({
@@ -82,18 +90,29 @@ var ChildrenContainer = styled('div')({
82
90
  padding: padding,
83
91
  });
84
92
  });
85
- var Drawer = /** @class */ (function (_super) {
86
- __extends(Drawer, _super);
87
- function Drawer() {
93
+ /**
94
+ * ### Deprecated Drawer
95
+ *
96
+ * As of Canvas Kit v8, this component is being soft-deprecated.
97
+ * It will be hard-deprecated (completely removed) in v9. Please see the
98
+ * [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
99
+ * for more information.
100
+ */
101
+ var DeprecatedDrawer = /** @class */ (function (_super) {
102
+ __extends(DeprecatedDrawer, _super);
103
+ function DeprecatedDrawer() {
88
104
  return _super !== null && _super.apply(this, arguments) || this;
89
105
  }
90
- Drawer.prototype.render = function () {
91
- 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 ? DrawerDirection.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"]);
106
+ DeprecatedDrawer.prototype.componentDidMount = function () {
107
+ 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 ");
108
+ };
109
+ DeprecatedDrawer.prototype.render = function () {
110
+ 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"]);
92
111
  return (React.createElement(DrawerContainer, __assign({ role: role }, elemProps, { showDropShadow: showDropShadow, width: width, openDirection: openDirection }),
93
112
  header,
94
113
  React.createElement(ChildrenContainer, { padding: padding }, children)));
95
114
  };
96
- Drawer.OpenDirection = DrawerDirection;
97
- return Drawer;
115
+ DeprecatedDrawer.OpenDirection = DeprecatedDrawerDirection;
116
+ return DeprecatedDrawer;
98
117
  }(React.Component));
99
- export { Drawer };
118
+ export { DeprecatedDrawer };
@@ -1,12 +1,20 @@
1
1
  import * as React from 'react';
2
2
  import { CanvasColor } from '@workday/canvas-kit-react/tokens';
3
- export interface DrawerHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
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> {
4
12
  /**
5
- * The text of the DrawerHeader. This text will also be applied as the `title` attribute of the header element.
13
+ * The text of the DeprecatedDrawerHeader. This text will also be applied as the `title` attribute of the header element.
6
14
  */
7
15
  title?: string;
8
16
  /**
9
- * The function called when the DrawerHeader close button is clicked.
17
+ * The function called when the DeprecatedDrawerHeader close button is clicked.
10
18
  */
11
19
  onClose?: React.MouseEventHandler<HTMLButtonElement>;
12
20
  /**
@@ -15,11 +23,11 @@ export interface DrawerHeaderProps extends React.HTMLAttributes<HTMLDivElement>
15
23
  */
16
24
  closeIconAriaLabel?: string;
17
25
  /**
18
- * The background color of the DrawerHeader.
26
+ * The background color of the DeprecatedDrawerHeader.
19
27
  */
20
28
  headerColor?: CanvasColor | string;
21
29
  /**
22
- * The border color of the DrawerHeader. This should match something close to `headerColor`.
30
+ * The border color of the DeprecatedDrawerHeader. This should match something close to `headerColor`.
23
31
  */
24
32
  borderColor?: CanvasColor | string;
25
33
  /**
@@ -28,11 +36,20 @@ export interface DrawerHeaderProps extends React.HTMLAttributes<HTMLDivElement>
28
36
  */
29
37
  inverse?: boolean;
30
38
  /**
31
- * The unique id of the DrawerHeader for accessibility.
39
+ * The unique id of the DeprecatedDrawerHeader for accessibility.
32
40
  */
33
41
  id?: string;
34
42
  }
35
- export declare class DrawerHeader extends React.Component<DrawerHeaderProps, {}> {
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;
36
53
  render(): JSX.Element;
37
54
  }
38
55
  //# sourceMappingURL=DrawerHeader.d.ts.map
@@ -1 +1 @@
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,MAAM,WAAW,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC7E;;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;AAwBD,qBAAa,YAAa,SAAQ,KAAK,CAAC,SAAS,CAAC,iBAAiB,EAAE,EAAE,CAAC;IAC/D,MAAM;CAwCd"}
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"}
@@ -60,18 +60,29 @@ var HeaderContainer = styled('div')({
60
60
  var CloseButton = styled(TertiaryButton)({
61
61
  margin: '-8px',
62
62
  });
63
- var DrawerHeader = /** @class */ (function (_super) {
64
- __extends(DrawerHeader, _super);
65
- function DrawerHeader() {
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() {
66
74
  return _super !== null && _super.apply(this, arguments) || this;
67
75
  }
68
- DrawerHeader.prototype.render = function () {
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 () {
69
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"]);
70
81
  var variant = inverse ? 'inverse' : undefined;
71
82
  return (React.createElement(HeaderContainer, __assign({ borderColor: borderColor }, elemProps, { headerColor: headerColor }),
72
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),
73
84
  onClose && closeIconAriaLabel && (React.createElement(CloseButton, { variant: variant, onClick: onClose, "aria-label": closeIconAriaLabel, icon: xIcon }))));
74
85
  };
75
- return DrawerHeader;
86
+ return DeprecatedDrawerHeader;
76
87
  }(React.Component));
77
- export { DrawerHeader };
88
+ export { DeprecatedDrawerHeader };
package/drawer/index.ts CHANGED
@@ -1,2 +1,2 @@
1
- export {DrawerHeader} from './lib/DrawerHeader';
1
+ export {DeprecatedDrawerHeader} from './lib/DrawerHeader';
2
2
  export * from './lib/Drawer';
@@ -2,52 +2,70 @@ import * as React from 'react';
2
2
  import styled from '@emotion/styled';
3
3
  import {colors, space, CanvasSpaceValues} from '@workday/canvas-kit-react/tokens';
4
4
 
5
- export interface DrawerProps extends React.HTMLAttributes<HTMLDivElement> {
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> {
6
15
  /**
7
- * The padding of the Drawer contents.
16
+ * The padding of the DeprecatedDrawer contents.
8
17
  * @default space.s
9
18
  */
10
19
  padding?: CanvasSpaceValues;
11
20
  /**
12
- * The direction from which the Drawer opens. Accepts `Left` or `Right`.
13
- * @default DrawerDirection.Right
21
+ * The direction from which the DeprecatedDrawer opens. Accepts `Left` or `Right`.
22
+ * @default DeprecatedDrawerDirection.Right
14
23
  */
15
- openDirection?: DrawerDirection;
24
+ openDirection?: DeprecatedDrawerDirection;
16
25
  /**
17
- * The width of the Drawer in `px`.
26
+ * The width of the DeprecatedDrawer in `px`.
18
27
  * @default 360
19
28
  */
20
29
  width?: number;
21
30
  /**
22
- * If true, render the Drawer with a drop shadow.
31
+ * If true, render the DeprecatedDrawer with a drop shadow.
23
32
  * @default false
24
33
  */
25
34
  showDropShadow?: boolean;
26
35
  /**
27
- * The optional DrawerHeader component of the Drawer. Shows an optional string and close button.
36
+ * The optional DeprecatedDrawerHeader component of the DeprecatedDrawer. Shows an optional string and close button.
28
37
  */
29
38
  header?: React.ReactElement;
30
39
  /**
31
- * The `aria-labelledby` of the Drawer. 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.
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.
32
41
  */
33
42
  'aria-labelledby'?: string;
34
43
  /**
35
- * The `aria-label` for the Drawer. Set this when there is NO `header` for accessibility.
44
+ * The `aria-label` for the DeprecatedDrawer. Set this when there is NO `header` for accessibility.
36
45
  */
37
46
  'aria-label'?: string;
38
47
  /**
39
- * The role of the Drawer. If `role` is provided, you must also set `aria-labelledby` to link `header` to the `role`.
48
+ * The role of the DeprecatedDrawer. If `role` is provided, you must also set `aria-labelledby` to link `header` to the `role`.
40
49
  */
41
50
  role?: string;
42
51
  }
43
52
 
44
- export enum DrawerDirection {
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 {
45
63
  Left,
46
64
  Right,
47
65
  }
48
66
 
49
67
  const DrawerContainer = styled('div')<
50
- Pick<DrawerProps, 'width' | 'showDropShadow' | 'openDirection'>
68
+ Pick<DeprecatedDrawerProps, 'width' | 'showDropShadow' | 'openDirection'>
51
69
  >(
52
70
  {
53
71
  height: '100%',
@@ -61,21 +79,23 @@ const DrawerContainer = styled('div')<
61
79
  }),
62
80
  ({showDropShadow, openDirection}) => ({
63
81
  boxShadow:
64
- openDirection === DrawerDirection.Right && showDropShadow
82
+ openDirection === DeprecatedDrawerDirection.Right && showDropShadow
65
83
  ? '-8px 0px 16px 0 rgba(0,0,0,0.12)'
66
- : openDirection === DrawerDirection.Left && showDropShadow
84
+ : openDirection === DeprecatedDrawerDirection.Left && showDropShadow
67
85
  ? '8px 0px 16px 0 rgba(0,0,0,0.12)'
68
86
  : undefined,
69
87
  }),
70
88
  ({openDirection}) => ({
71
- borderLeft: openDirection === DrawerDirection.Right ? `1px solid ${colors.soap400}` : undefined,
72
- borderRight: openDirection === DrawerDirection.Left ? `1px solid ${colors.soap400}` : undefined,
73
- right: openDirection === DrawerDirection.Right ? space.zero : undefined,
74
- left: openDirection === DrawerDirection.Left ? space.zero : undefined,
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,
75
95
  })
76
96
  );
77
97
 
78
- const ChildrenContainer = styled('div')<Pick<DrawerProps, 'padding'>>(
98
+ const ChildrenContainer = styled('div')<Pick<DeprecatedDrawerProps, 'padding'>>(
79
99
  {
80
100
  height: '100%',
81
101
  overflowY: 'auto',
@@ -88,14 +108,32 @@ const ChildrenContainer = styled('div')<Pick<DrawerProps, 'padding'>>(
88
108
  })
89
109
  );
90
110
 
91
- export class Drawer extends React.Component<DrawerProps, {}> {
92
- static OpenDirection = DrawerDirection;
111
+ /**
112
+ * ### Deprecated Drawer
113
+ *
114
+ * As of Canvas Kit v8, this component is being soft-deprecated.
115
+ * It will be hard-deprecated (completely removed) in v9. Please see the
116
+ * [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
117
+ * for more information.
118
+ */
119
+
120
+ export class DeprecatedDrawer extends React.Component<DeprecatedDrawerProps, {}> {
121
+ static OpenDirection = DeprecatedDrawerDirection;
122
+
123
+ componentDidMount() {
124
+ console.warn(
125
+ `This component is being deprecated and will be removed in Canvas Kit V9.\n
126
+ For more information, please see the V8 upgrade guide:\n
127
+ https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page
128
+ `
129
+ );
130
+ }
93
131
 
94
132
  public render() {
95
133
  const {
96
134
  padding = space.s,
97
135
  width = 360,
98
- openDirection = DrawerDirection.Right,
136
+ openDirection = DeprecatedDrawerDirection.Right,
99
137
  showDropShadow = false,
100
138
  children,
101
139
  header,
@@ -5,13 +5,22 @@ import {TertiaryButton} from '@workday/canvas-kit-react/button';
5
5
  import {Text} from '@workday/canvas-kit-react/text';
6
6
  import {xIcon} from '@workday/canvas-system-icons-web';
7
7
 
8
- export interface DrawerHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
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> {
9
18
  /**
10
- * The text of the DrawerHeader. This text will also be applied as the `title` attribute of the header element.
19
+ * The text of the DeprecatedDrawerHeader. This text will also be applied as the `title` attribute of the header element.
11
20
  */
12
21
  title?: string;
13
22
  /**
14
- * The function called when the DrawerHeader close button is clicked.
23
+ * The function called when the DeprecatedDrawerHeader close button is clicked.
15
24
  */
16
25
  onClose?: React.MouseEventHandler<HTMLButtonElement>;
17
26
  /**
@@ -20,11 +29,11 @@ export interface DrawerHeaderProps extends React.HTMLAttributes<HTMLDivElement>
20
29
  */
21
30
  closeIconAriaLabel?: string;
22
31
  /**
23
- * The background color of the DrawerHeader.
32
+ * The background color of the DeprecatedDrawerHeader.
24
33
  */
25
34
  headerColor?: CanvasColor | string;
26
35
  /**
27
- * The border color of the DrawerHeader. This should match something close to `headerColor`.
36
+ * The border color of the DeprecatedDrawerHeader. This should match something close to `headerColor`.
28
37
  */
29
38
  borderColor?: CanvasColor | string;
30
39
  /**
@@ -33,14 +42,16 @@ export interface DrawerHeaderProps extends React.HTMLAttributes<HTMLDivElement>
33
42
  */
34
43
  inverse?: boolean;
35
44
  /**
36
- * The unique id of the DrawerHeader for accessibility.
45
+ * The unique id of the DeprecatedDrawerHeader for accessibility.
37
46
  */
38
47
  id?: string;
39
48
  }
40
49
 
41
50
  const headerHeight = 56;
42
51
 
43
- const HeaderContainer = styled('div')<Pick<DrawerHeaderProps, 'headerColor' | 'borderColor'>>(
52
+ const HeaderContainer = styled('div')<
53
+ Pick<DeprecatedDrawerHeaderProps, 'headerColor' | 'borderColor'>
54
+ >(
44
55
  {
45
56
  height: headerHeight,
46
57
  display: 'flex',
@@ -60,7 +71,25 @@ const CloseButton = styled(TertiaryButton)({
60
71
  margin: '-8px', // for inverse and plain button, we always want this margin
61
72
  });
62
73
 
63
- export class DrawerHeader extends React.Component<DrawerHeaderProps, {}> {
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
+
64
93
  public render() {
65
94
  const {
66
95
  closeIconAriaLabel = 'Close',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-labs-react",
3
- "version": "8.0.0-alpha.192-next.1+f60e379b",
3
+ "version": "8.0.0-alpha.198-next.0+ff5616e1",
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": "^8.0.0-alpha.192-next.1+f60e379b",
49
+ "@workday/canvas-kit-react": "^8.0.0-alpha.198-next.0+ff5616e1",
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": "f60e379b0083b092707830478248ba5d78b2c96e"
59
+ "gitHead": "ff5616e10b2d5d7cceccaea1c6f9d9b742ef1779"
60
60
  }