@workday/canvas-kit-labs-react 8.0.0 → 8.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/combobox/README.md +4 -4
- package/combobox/index.ts +0 -4
- package/combobox/lib/AutocompleteList.tsx +5 -8
- package/combobox/lib/Combobox.tsx +14 -20
- package/combobox/lib/Status.tsx +1 -3
- package/common/index.ts +0 -2
- package/common/lib/theming/useThemeRTL.ts +11 -13
- package/dist/commonjs/combobox/index.d.ts +0 -3
- package/dist/commonjs/combobox/index.d.ts.map +1 -1
- package/dist/commonjs/combobox/index.js +0 -7
- package/dist/commonjs/combobox/lib/AutocompleteList.d.ts +4 -5
- package/dist/commonjs/combobox/lib/AutocompleteList.d.ts.map +1 -1
- package/dist/commonjs/combobox/lib/AutocompleteList.js +2 -1
- package/dist/commonjs/combobox/lib/Combobox.d.ts +4 -6
- package/dist/commonjs/combobox/lib/Combobox.d.ts.map +1 -1
- package/dist/commonjs/combobox/lib/Combobox.js +8 -12
- package/dist/commonjs/combobox/lib/Status.d.ts +1 -2
- package/dist/commonjs/combobox/lib/Status.d.ts.map +1 -1
- package/dist/commonjs/combobox/lib/Status.js +2 -1
- package/dist/commonjs/common/index.d.ts +0 -2
- package/dist/commonjs/common/index.d.ts.map +1 -1
- package/dist/commonjs/common/index.js +0 -5
- package/dist/commonjs/common/lib/theming/useThemeRTL.d.ts.map +1 -1
- package/dist/commonjs/common/lib/theming/useThemeRTL.js +6 -8
- package/dist/commonjs/drawer/index.d.ts +1 -4
- package/dist/commonjs/drawer/index.d.ts.map +1 -1
- package/dist/commonjs/drawer/index.js +3 -9
- package/dist/commonjs/drawer/lib/Drawer.d.ts +39 -14
- package/dist/commonjs/drawer/lib/Drawer.d.ts.map +1 -1
- package/dist/commonjs/drawer/lib/Drawer.js +39 -21
- package/dist/commonjs/drawer/lib/DrawerHeader.d.ts +24 -7
- package/dist/commonjs/drawer/lib/DrawerHeader.d.ts.map +1 -1
- package/dist/commonjs/drawer/lib/DrawerHeader.js +22 -14
- package/dist/commonjs/expandable/index.d.ts +3 -0
- package/dist/commonjs/expandable/index.d.ts.map +1 -0
- package/dist/commonjs/expandable/index.js +14 -0
- package/dist/commonjs/expandable/lib/Expandable.d.ts +75 -0
- package/dist/commonjs/expandable/lib/Expandable.d.ts.map +1 -0
- package/dist/commonjs/expandable/lib/Expandable.js +50 -0
- package/dist/commonjs/expandable/lib/ExpandableAvatar.d.ts +7 -0
- package/dist/commonjs/expandable/lib/ExpandableAvatar.d.ts.map +1 -0
- package/dist/commonjs/expandable/lib/ExpandableAvatar.js +46 -0
- package/dist/commonjs/expandable/lib/ExpandableContent.d.ts +19 -0
- package/dist/commonjs/expandable/lib/ExpandableContent.d.ts.map +1 -0
- package/dist/commonjs/expandable/lib/ExpandableContent.js +41 -0
- package/dist/commonjs/expandable/lib/ExpandableIcon.d.ts +29 -0
- package/dist/commonjs/expandable/lib/ExpandableIcon.d.ts.map +1 -0
- package/dist/commonjs/expandable/lib/ExpandableIcon.js +62 -0
- package/dist/commonjs/expandable/lib/ExpandableTarget.d.ts +28 -0
- package/dist/commonjs/expandable/lib/ExpandableTarget.d.ts.map +1 -0
- package/dist/commonjs/expandable/lib/ExpandableTarget.js +48 -0
- package/dist/commonjs/expandable/lib/ExpandableTitle.d.ts +9 -0
- package/dist/commonjs/expandable/lib/ExpandableTitle.d.ts.map +1 -0
- package/dist/commonjs/expandable/lib/ExpandableTitle.js +39 -0
- package/dist/commonjs/expandable/lib/hooks/index.d.ts +4 -0
- package/dist/commonjs/expandable/lib/hooks/index.d.ts.map +1 -0
- package/dist/commonjs/expandable/lib/hooks/index.js +15 -0
- package/dist/commonjs/expandable/lib/hooks/useExpandableContent.d.ts +20 -0
- package/dist/commonjs/expandable/lib/hooks/useExpandableContent.d.ts.map +1 -0
- package/dist/commonjs/expandable/lib/hooks/useExpandableContent.js +12 -0
- package/dist/commonjs/expandable/lib/hooks/useExpandableIcon.d.ts +15 -0
- package/dist/commonjs/expandable/lib/hooks/useExpandableIcon.d.ts.map +1 -0
- package/dist/commonjs/expandable/lib/hooks/useExpandableIcon.js +11 -0
- package/dist/commonjs/expandable/lib/hooks/useExpandableTarget.d.ts +17 -0
- package/dist/commonjs/expandable/lib/hooks/useExpandableTarget.d.ts.map +1 -0
- package/dist/commonjs/expandable/lib/hooks/useExpandableTarget.js +20 -0
- package/dist/commonjs/expandable/lib/useExpandableModel.d.ts +50 -0
- package/dist/commonjs/expandable/lib/useExpandableModel.d.ts.map +1 -0
- package/dist/commonjs/expandable/lib/useExpandableModel.js +24 -0
- package/dist/commonjs/index.d.ts +2 -0
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +2 -0
- package/dist/commonjs/search-form/lib/SearchForm.d.ts +1 -2
- package/dist/commonjs/search-form/lib/SearchForm.d.ts.map +1 -1
- package/dist/commonjs/search-form/lib/SearchForm.js +2 -4
- package/dist/commonjs/toast/index.d.ts +3 -0
- package/dist/commonjs/toast/index.d.ts.map +1 -0
- package/dist/commonjs/toast/index.js +14 -0
- package/dist/commonjs/toast/lib/Toast.d.ts +27 -0
- package/dist/commonjs/toast/lib/Toast.d.ts.map +1 -0
- package/dist/commonjs/toast/lib/Toast.js +78 -0
- package/dist/commonjs/toast/lib/ToastBody.d.ts +6 -0
- package/dist/commonjs/toast/lib/ToastBody.d.ts.map +1 -0
- package/dist/commonjs/toast/lib/ToastBody.js +40 -0
- package/dist/commonjs/toast/lib/ToastCloseIcon.d.ts +6 -0
- package/dist/commonjs/toast/lib/ToastCloseIcon.d.ts.map +1 -0
- package/dist/commonjs/toast/lib/ToastCloseIcon.js +43 -0
- package/dist/commonjs/toast/lib/ToastIcon.d.ts +5 -0
- package/dist/commonjs/toast/lib/ToastIcon.d.ts.map +1 -0
- package/dist/commonjs/toast/lib/ToastIcon.js +26 -0
- package/dist/commonjs/toast/lib/ToastLink.d.ts +9 -0
- package/dist/commonjs/toast/lib/ToastLink.d.ts.map +1 -0
- package/dist/commonjs/toast/lib/ToastLink.js +42 -0
- package/dist/commonjs/toast/lib/ToastMessage.d.ts +11 -0
- package/dist/commonjs/toast/lib/ToastMessage.d.ts.map +1 -0
- package/dist/commonjs/toast/lib/ToastMessage.js +41 -0
- package/dist/commonjs/toast/lib/hooks/useToastModel.d.ts +65 -0
- package/dist/commonjs/toast/lib/hooks/useToastModel.d.ts.map +1 -0
- package/dist/commonjs/toast/lib/hooks/useToastModel.js +35 -0
- package/dist/es6/combobox/index.d.ts +0 -3
- package/dist/es6/combobox/index.d.ts.map +1 -1
- package/dist/es6/combobox/index.js +0 -3
- package/dist/es6/combobox/lib/AutocompleteList.d.ts +4 -5
- package/dist/es6/combobox/lib/AutocompleteList.d.ts.map +1 -1
- package/dist/es6/combobox/lib/AutocompleteList.js +1 -2
- package/dist/es6/combobox/lib/Combobox.d.ts +4 -6
- package/dist/es6/combobox/lib/Combobox.d.ts.map +1 -1
- package/dist/es6/combobox/lib/Combobox.js +5 -10
- package/dist/es6/combobox/lib/Status.d.ts +1 -2
- package/dist/es6/combobox/lib/Status.d.ts.map +1 -1
- package/dist/es6/combobox/lib/Status.js +1 -2
- package/dist/es6/common/index.d.ts +0 -2
- package/dist/es6/common/index.d.ts.map +1 -1
- package/dist/es6/common/index.js +0 -2
- package/dist/es6/common/lib/theming/useThemeRTL.d.ts.map +1 -1
- package/dist/es6/common/lib/theming/useThemeRTL.js +7 -9
- package/dist/es6/drawer/index.d.ts +1 -4
- package/dist/es6/drawer/index.d.ts.map +1 -1
- package/dist/es6/drawer/index.js +1 -4
- package/dist/es6/drawer/lib/Drawer.d.ts +39 -14
- package/dist/es6/drawer/lib/Drawer.d.ts.map +1 -1
- package/dist/es6/drawer/lib/Drawer.js +38 -20
- package/dist/es6/drawer/lib/DrawerHeader.d.ts +24 -7
- package/dist/es6/drawer/lib/DrawerHeader.d.ts.map +1 -1
- package/dist/es6/drawer/lib/DrawerHeader.js +22 -15
- package/dist/es6/expandable/index.d.ts +3 -0
- package/dist/es6/expandable/index.d.ts.map +1 -0
- package/dist/es6/expandable/index.js +2 -0
- package/dist/es6/expandable/lib/Expandable.d.ts +75 -0
- package/dist/es6/expandable/lib/Expandable.d.ts.map +1 -0
- package/dist/es6/expandable/lib/Expandable.js +44 -0
- package/dist/es6/expandable/lib/ExpandableAvatar.d.ts +7 -0
- package/dist/es6/expandable/lib/ExpandableAvatar.d.ts.map +1 -0
- package/dist/es6/expandable/lib/ExpandableAvatar.js +40 -0
- package/dist/es6/expandable/lib/ExpandableContent.d.ts +19 -0
- package/dist/es6/expandable/lib/ExpandableContent.d.ts.map +1 -0
- package/dist/es6/expandable/lib/ExpandableContent.js +35 -0
- package/dist/es6/expandable/lib/ExpandableIcon.d.ts +29 -0
- package/dist/es6/expandable/lib/ExpandableIcon.d.ts.map +1 -0
- package/dist/es6/expandable/lib/ExpandableIcon.js +56 -0
- package/dist/es6/expandable/lib/ExpandableTarget.d.ts +28 -0
- package/dist/es6/expandable/lib/ExpandableTarget.d.ts.map +1 -0
- package/dist/es6/expandable/lib/ExpandableTarget.js +42 -0
- package/dist/es6/expandable/lib/ExpandableTitle.d.ts +9 -0
- package/dist/es6/expandable/lib/ExpandableTitle.d.ts.map +1 -0
- package/dist/es6/expandable/lib/ExpandableTitle.js +33 -0
- package/dist/es6/expandable/lib/hooks/index.d.ts +4 -0
- package/dist/es6/expandable/lib/hooks/index.d.ts.map +1 -0
- package/dist/es6/expandable/lib/hooks/index.js +3 -0
- package/dist/es6/expandable/lib/hooks/useExpandableContent.d.ts +20 -0
- package/dist/es6/expandable/lib/hooks/useExpandableContent.d.ts.map +1 -0
- package/dist/es6/expandable/lib/hooks/useExpandableContent.js +9 -0
- package/dist/es6/expandable/lib/hooks/useExpandableIcon.d.ts +15 -0
- package/dist/es6/expandable/lib/hooks/useExpandableIcon.d.ts.map +1 -0
- package/dist/es6/expandable/lib/hooks/useExpandableIcon.js +8 -0
- package/dist/es6/expandable/lib/hooks/useExpandableTarget.d.ts +17 -0
- package/dist/es6/expandable/lib/hooks/useExpandableTarget.d.ts.map +1 -0
- package/dist/es6/expandable/lib/hooks/useExpandableTarget.js +17 -0
- package/dist/es6/expandable/lib/useExpandableModel.d.ts +50 -0
- package/dist/es6/expandable/lib/useExpandableModel.d.ts.map +1 -0
- package/dist/es6/expandable/lib/useExpandableModel.js +21 -0
- package/dist/es6/index.d.ts +2 -0
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +2 -0
- package/dist/es6/search-form/lib/SearchForm.d.ts +1 -2
- package/dist/es6/search-form/lib/SearchForm.d.ts.map +1 -1
- package/dist/es6/search-form/lib/SearchForm.js +2 -4
- package/dist/es6/toast/index.d.ts +3 -0
- package/dist/es6/toast/index.d.ts.map +1 -0
- package/dist/es6/toast/index.js +2 -0
- package/dist/es6/toast/lib/Toast.d.ts +27 -0
- package/dist/es6/toast/lib/Toast.d.ts.map +1 -0
- package/dist/es6/toast/lib/Toast.js +72 -0
- package/dist/es6/toast/lib/ToastBody.d.ts +6 -0
- package/dist/es6/toast/lib/ToastBody.d.ts.map +1 -0
- package/dist/es6/toast/lib/ToastBody.js +34 -0
- package/dist/es6/toast/lib/ToastCloseIcon.d.ts +6 -0
- package/dist/es6/toast/lib/ToastCloseIcon.d.ts.map +1 -0
- package/dist/es6/toast/lib/ToastCloseIcon.js +37 -0
- package/dist/es6/toast/lib/ToastIcon.d.ts +5 -0
- package/dist/es6/toast/lib/ToastIcon.d.ts.map +1 -0
- package/dist/es6/toast/lib/ToastIcon.js +20 -0
- package/dist/es6/toast/lib/ToastLink.d.ts +9 -0
- package/dist/es6/toast/lib/ToastLink.d.ts.map +1 -0
- package/dist/es6/toast/lib/ToastLink.js +36 -0
- package/dist/es6/toast/lib/ToastMessage.d.ts +11 -0
- package/dist/es6/toast/lib/ToastMessage.d.ts.map +1 -0
- package/dist/es6/toast/lib/ToastMessage.js +35 -0
- package/dist/es6/toast/lib/hooks/useToastModel.d.ts +65 -0
- package/dist/es6/toast/lib/hooks/useToastModel.d.ts.map +1 -0
- package/dist/es6/toast/lib/hooks/useToastModel.js +32 -0
- package/drawer/index.ts +1 -4
- package/drawer/lib/Drawer.tsx +61 -24
- package/drawer/lib/DrawerHeader.tsx +54 -26
- package/expandable/LICENSE +52 -0
- package/expandable/README.md +11 -0
- package/expandable/index.ts +2 -0
- package/expandable/lib/Expandable.tsx +34 -0
- package/expandable/lib/ExpandableAvatar.tsx +26 -0
- package/expandable/lib/ExpandableContent.tsx +32 -0
- package/expandable/lib/ExpandableIcon.tsx +74 -0
- package/expandable/lib/ExpandableTarget.tsx +67 -0
- package/expandable/lib/ExpandableTitle.tsx +34 -0
- package/expandable/lib/hooks/index.ts +3 -0
- package/expandable/lib/hooks/useExpandableContent.ts +9 -0
- package/expandable/lib/hooks/useExpandableIcon.ts +8 -0
- package/expandable/lib/hooks/useExpandableTarget.ts +16 -0
- package/expandable/lib/useExpandableModel.tsx +17 -0
- package/expandable/package.json +6 -0
- package/index.ts +2 -0
- package/package.json +5 -5
- package/search-form/lib/SearchForm.tsx +2 -6
- package/toast/LICENSE +52 -0
- package/toast/README.md +5 -0
- package/toast/index.ts +2 -0
- package/toast/lib/Toast.tsx +63 -0
- package/toast/lib/ToastBody.tsx +34 -0
- package/toast/lib/ToastCloseIcon.tsx +18 -0
- package/toast/lib/ToastIcon.tsx +24 -0
- package/toast/lib/ToastLink.tsx +27 -0
- package/toast/lib/ToastMessage.tsx +21 -0
- package/toast/lib/hooks/useToastModel.tsx +27 -0
- package/toast/package.json +6 -0
- package/common/lib/storybook-utils/ComponentStatesTable.tsx +0 -80
- package/common/lib/storybook-utils/permutateProps.ts +0 -47
- package/common/lib/storybook-utils/propTypes.ts +0 -15
- package/dist/commonjs/common/lib/storybook-utils/ComponentStatesTable.d.ts +0 -26
- package/dist/commonjs/common/lib/storybook-utils/ComponentStatesTable.d.ts.map +0 -1
- package/dist/commonjs/common/lib/storybook-utils/ComponentStatesTable.js +0 -48
- package/dist/commonjs/common/lib/storybook-utils/permutateProps.d.ts +0 -5
- package/dist/commonjs/common/lib/storybook-utils/permutateProps.d.ts.map +0 -1
- package/dist/commonjs/common/lib/storybook-utils/permutateProps.js +0 -47
- package/dist/commonjs/common/lib/storybook-utils/propTypes.d.ts +0 -15
- package/dist/commonjs/common/lib/storybook-utils/propTypes.d.ts.map +0 -1
- package/dist/commonjs/common/lib/storybook-utils/propTypes.js +0 -2
- package/dist/es6/common/lib/storybook-utils/ComponentStatesTable.d.ts +0 -26
- package/dist/es6/common/lib/storybook-utils/ComponentStatesTable.d.ts.map +0 -1
- package/dist/es6/common/lib/storybook-utils/ComponentStatesTable.js +0 -41
- package/dist/es6/common/lib/storybook-utils/permutateProps.d.ts +0 -5
- package/dist/es6/common/lib/storybook-utils/permutateProps.d.ts.map +0 -1
- package/dist/es6/common/lib/storybook-utils/permutateProps.js +0 -43
- package/dist/es6/common/lib/storybook-utils/propTypes.d.ts +0 -15
- package/dist/es6/common/lib/storybook-utils/propTypes.d.ts.map +0 -1
- package/dist/es6/common/lib/storybook-utils/propTypes.js +0 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import { createContainer } from '@workday/canvas-kit-react/common';
|
|
25
|
+
import { Flex } from '@workday/canvas-kit-react/layout';
|
|
26
|
+
import { Popup } from '@workday/canvas-kit-react/popup';
|
|
27
|
+
import { ToastCloseIcon } from './ToastCloseIcon';
|
|
28
|
+
import { ToastIcon } from './ToastIcon';
|
|
29
|
+
import { ToastMessage } from './ToastMessage';
|
|
30
|
+
import { ToastLink } from './ToastLink';
|
|
31
|
+
import { ToastBody } from './ToastBody';
|
|
32
|
+
import { useToastModel } from './hooks/useToastModel';
|
|
33
|
+
export var Toast = createContainer('div')({
|
|
34
|
+
displayName: 'Toast',
|
|
35
|
+
modelHook: useToastModel,
|
|
36
|
+
subComponents: {
|
|
37
|
+
Body: ToastBody,
|
|
38
|
+
CloseIcon: ToastCloseIcon,
|
|
39
|
+
Icon: ToastIcon,
|
|
40
|
+
Message: ToastMessage,
|
|
41
|
+
Link: ToastLink,
|
|
42
|
+
},
|
|
43
|
+
})(function (_a, Element, model) {
|
|
44
|
+
var children = _a.children, elemProps = __rest(_a, ["children"]);
|
|
45
|
+
var getAriaAttributes = function (mode) {
|
|
46
|
+
switch (mode) {
|
|
47
|
+
case 'dialog':
|
|
48
|
+
return {
|
|
49
|
+
'aria-describedby': model.state.id,
|
|
50
|
+
'aria-label': 'notification',
|
|
51
|
+
role: 'dialog',
|
|
52
|
+
};
|
|
53
|
+
case 'alert':
|
|
54
|
+
return {
|
|
55
|
+
role: 'alert',
|
|
56
|
+
'aria-live': 'assertive',
|
|
57
|
+
'aria-atomic': true,
|
|
58
|
+
};
|
|
59
|
+
case 'status':
|
|
60
|
+
return {
|
|
61
|
+
role: 'status',
|
|
62
|
+
'aria-live': 'polite',
|
|
63
|
+
'aria-atomic': true,
|
|
64
|
+
};
|
|
65
|
+
default: {
|
|
66
|
+
return {};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
return (React.createElement(Popup.Card, __assign({ as: Element, width: 360, padding: "0" }, getAriaAttributes(model.state.mode), elemProps),
|
|
71
|
+
React.createElement(Flex, null, children)));
|
|
72
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
2
|
+
import { Popup } from '@workday/canvas-kit-react/popup';
|
|
3
|
+
export interface ToastBodyProps extends ExtractProps<typeof Popup.Body> {
|
|
4
|
+
}
|
|
5
|
+
export declare const ToastBody: import("@workday/canvas-kit-react/common").ElementComponent<"div", ToastBodyProps>;
|
|
6
|
+
//# sourceMappingURL=ToastBody.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastBody.d.ts","sourceRoot":"","sources":["../../../../toast/lib/ToastBody.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,YAAY,EAAqB,MAAM,kCAAkC,CAAC;AACnG,OAAO,EAAC,KAAK,EAAC,MAAM,iCAAiC,CAAC;AAGtD,MAAM,WAAW,cAAe,SAAQ,YAAY,CAAC,OAAO,KAAK,CAAC,IAAI,CAAC;CAAG;AAW1E,eAAO,MAAM,SAAS,oFAgBpB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import { createComponent, styled } from '@workday/canvas-kit-react/common';
|
|
25
|
+
import { Popup } from '@workday/canvas-kit-react/popup';
|
|
26
|
+
import { type } from '@workday/canvas-kit-react/tokens';
|
|
27
|
+
var StyledToastBody = styled(Popup.Body)(__assign({ display: 'flex', alignItems: 'flex-start', flexDirection: 'column', justifyContent: 'center' }, type.levels.subtext.large));
|
|
28
|
+
export var ToastBody = createComponent('div')({
|
|
29
|
+
displayName: 'Toast.Body',
|
|
30
|
+
Component: function (_a, ref, Element) {
|
|
31
|
+
var children = _a.children, elemProps = __rest(_a, ["children"]);
|
|
32
|
+
return (React.createElement(StyledToastBody, __assign({ paddingInlineStart: "xxxs", paddingY: "s", paddingInlineEnd: "s", ref: ref, as: Element }, elemProps), children));
|
|
33
|
+
},
|
|
34
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ExtractProps } from '@workday/canvas-kit-react/common';
|
|
2
|
+
import { Popup } from '@workday/canvas-kit-react/popup';
|
|
3
|
+
export interface ToastCloseIconProps extends ExtractProps<typeof Popup.CloseIcon, never> {
|
|
4
|
+
}
|
|
5
|
+
export declare const ToastCloseIcon: import("@workday/canvas-kit-react/common").ElementComponent<"button", ToastCloseIconProps>;
|
|
6
|
+
//# sourceMappingURL=ToastCloseIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastCloseIcon.d.ts","sourceRoot":"","sources":["../../../../toast/lib/ToastCloseIcon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,YAAY,EAAa,MAAM,kCAAkC,CAAC;AAC3F,OAAO,EAAC,KAAK,EAAC,MAAM,iCAAiC,CAAC;AAGtD,MAAM,WAAW,mBAAoB,SAAQ,YAAY,CAAC,OAAO,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC;CAAG;AAO3F,eAAO,MAAM,cAAc,4FAKzB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
25
|
+
import { Popup } from '@workday/canvas-kit-react/popup';
|
|
26
|
+
import styled from '@emotion/styled';
|
|
27
|
+
// TODO Remove this once we extend style properties for buttons https://github.com/Workday/canvas-kit/issues/1746
|
|
28
|
+
var StyledCloseIcon = styled(Popup.CloseIcon)({
|
|
29
|
+
position: 'relative',
|
|
30
|
+
});
|
|
31
|
+
export var ToastCloseIcon = createComponent('button')({
|
|
32
|
+
displayName: 'Toast.CloseIcon',
|
|
33
|
+
Component: function (_a, ref, Element) {
|
|
34
|
+
var elemProps = __rest(_a, []);
|
|
35
|
+
return React.createElement(StyledCloseIcon, __assign({ as: Element, ref: ref, size: "small" }, elemProps));
|
|
36
|
+
},
|
|
37
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SystemIconProps } from '@workday/canvas-kit-react/icon';
|
|
2
|
+
export interface ToastIconProps extends Omit<SystemIconProps, 'colorHover'> {
|
|
3
|
+
}
|
|
4
|
+
export declare const ToastIcon: import("@workday/canvas-kit-react/common").ElementComponent<"div", ToastIconProps>;
|
|
5
|
+
//# sourceMappingURL=ToastIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastIcon.d.ts","sourceRoot":"","sources":["../../../../toast/lib/ToastIcon.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAa,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAE3E,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC;CAAG;AAE9E,eAAO,MAAM,SAAS,oFAgBpB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
14
|
+
import { SystemIcon } from '@workday/canvas-kit-react/icon';
|
|
15
|
+
export var ToastIcon = createComponent('div')({
|
|
16
|
+
displayName: 'Toast.Icon',
|
|
17
|
+
Component: function (elemProps, ref, Element) {
|
|
18
|
+
return (React.createElement(SystemIcon, __assign({ colorHover: elemProps.color, marginY: "s", marginInlineEnd: "xs", marginInlineStart: "xs", alignSelf: "start", ref: ref, as: Element }, elemProps)));
|
|
19
|
+
},
|
|
20
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HyperlinkProps } from '@workday/canvas-kit-react/button';
|
|
2
|
+
export interface ToastLinkProps extends HyperlinkProps {
|
|
3
|
+
/**
|
|
4
|
+
* attribute for the hyperlink URL
|
|
5
|
+
*/
|
|
6
|
+
href: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const ToastLink: import("@workday/canvas-kit-react/common").ElementComponent<"a", ToastLinkProps>;
|
|
9
|
+
//# sourceMappingURL=ToastLink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastLink.d.ts","sourceRoot":"","sources":["../../../../toast/lib/ToastLink.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAY,cAAc,EAAC,MAAM,kCAAkC,CAAC;AAG3E,MAAM,WAAW,cAAe,SAAQ,cAAc;IACpD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAMD,eAAO,MAAM,SAAS,kFASpB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import { createComponent, styled } from '@workday/canvas-kit-react/common';
|
|
25
|
+
import { Hyperlink } from '@workday/canvas-kit-react/button';
|
|
26
|
+
import { space } from '@workday/canvas-kit-react/tokens';
|
|
27
|
+
var StyledHyperLink = styled(Hyperlink)({
|
|
28
|
+
marginTop: space.xxxs,
|
|
29
|
+
});
|
|
30
|
+
export var ToastLink = createComponent('a')({
|
|
31
|
+
displayName: 'Toast.Link',
|
|
32
|
+
Component: function (_a, ref, Element) {
|
|
33
|
+
var children = _a.children, href = _a.href, elemProps = __rest(_a, ["children", "href"]);
|
|
34
|
+
return (React.createElement(StyledHyperLink, __assign({ ref: ref, href: href, as: Element }, elemProps), children));
|
|
35
|
+
},
|
|
36
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FlexProps } from '@workday/canvas-kit-react/layout';
|
|
2
|
+
export interface ToastMessageProps extends FlexProps {
|
|
3
|
+
}
|
|
4
|
+
export declare const ToastMessage: import("@workday/canvas-kit-react/common").ElementComponentM<"div", ToastMessageProps, {
|
|
5
|
+
state: {
|
|
6
|
+
id: string;
|
|
7
|
+
mode: import("./hooks/useToastModel").AriaRoleMode;
|
|
8
|
+
};
|
|
9
|
+
events: {};
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=ToastMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToastMessage.d.ts","sourceRoot":"","sources":["../../../../toast/lib/ToastMessage.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAO,SAAS,EAAC,MAAM,kCAAkC,CAAC;AAGjE,MAAM,WAAW,iBAAkB,SAAQ,SAAS;CAAG;AAMvD,eAAO,MAAM,YAAY;;;;;;EAQvB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import React from 'react';
|
|
24
|
+
import { createSubcomponent, styled } from '@workday/canvas-kit-react/common';
|
|
25
|
+
import { Flex } from '@workday/canvas-kit-react/layout';
|
|
26
|
+
import { useToastModel } from './hooks/useToastModel';
|
|
27
|
+
var StyledMessage = styled(Flex)({
|
|
28
|
+
wordBreak: 'break-word',
|
|
29
|
+
});
|
|
30
|
+
export var ToastMessage = createSubcomponent('div')({
|
|
31
|
+
modelHook: useToastModel,
|
|
32
|
+
})(function (_a, Element, model) {
|
|
33
|
+
var children = _a.children, elemProps = __rest(_a, ["children"]);
|
|
34
|
+
return (React.createElement(StyledMessage, __assign({ flexDirection: "column", id: model.state.id, as: Element }, elemProps), children));
|
|
35
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export declare type AriaRoleMode = 'dialog' | 'status' | 'alert';
|
|
2
|
+
export declare const useToastModel: (<TT_Special_Generic>(config?: (Partial<{
|
|
3
|
+
/**
|
|
4
|
+
* Sets the correct aria attributes for the Toast.
|
|
5
|
+
* Alert toasts are used to convey urgency and important information. The `role` is set to `alert`
|
|
6
|
+
* Status toasts are used to convey a message or a successful action. The `role` is set to `status`
|
|
7
|
+
* Dialog toasts are used when there's an action to be taken. The `role` is set to `dialog`
|
|
8
|
+
* @default 'status'
|
|
9
|
+
*/
|
|
10
|
+
mode: AriaRoleMode;
|
|
11
|
+
/**
|
|
12
|
+
* When the Toast has a `mode="dialog"` this adds a unique id to type the `Toast.Message` to the dialog.
|
|
13
|
+
*/
|
|
14
|
+
id: string;
|
|
15
|
+
}> & {} & {}) | undefined) => {
|
|
16
|
+
state: {
|
|
17
|
+
id: string;
|
|
18
|
+
/**
|
|
19
|
+
* Sets the correct aria attributes for the Toast.
|
|
20
|
+
* Alert toasts are used to convey urgency and important information. The `role` is set to `alert`
|
|
21
|
+
* Status toasts are used to convey a message or a successful action. The `role` is set to `status`
|
|
22
|
+
* Dialog toasts are used when there's an action to be taken. The `role` is set to `dialog`
|
|
23
|
+
* @default 'status'
|
|
24
|
+
*/
|
|
25
|
+
mode: AriaRoleMode;
|
|
26
|
+
};
|
|
27
|
+
events: {};
|
|
28
|
+
}) & import("@workday/canvas-kit-react/common").ModelExtras<{
|
|
29
|
+
/**
|
|
30
|
+
* Sets the correct aria attributes for the Toast.
|
|
31
|
+
* Alert toasts are used to convey urgency and important information. The `role` is set to `alert`
|
|
32
|
+
* Status toasts are used to convey a message or a successful action. The `role` is set to `status`
|
|
33
|
+
* Dialog toasts are used when there's an action to be taken. The `role` is set to `dialog`
|
|
34
|
+
* @default 'status'
|
|
35
|
+
*/
|
|
36
|
+
mode: AriaRoleMode;
|
|
37
|
+
/**
|
|
38
|
+
* When the Toast has a `mode="dialog"` this adds a unique id to type the `Toast.Message` to the dialog.
|
|
39
|
+
*/
|
|
40
|
+
id: string;
|
|
41
|
+
}, {}, {
|
|
42
|
+
id: string;
|
|
43
|
+
/**
|
|
44
|
+
* Sets the correct aria attributes for the Toast.
|
|
45
|
+
* Alert toasts are used to convey urgency and important information. The `role` is set to `alert`
|
|
46
|
+
* Status toasts are used to convey a message or a successful action. The `role` is set to `status`
|
|
47
|
+
* Dialog toasts are used when there's an action to be taken. The `role` is set to `dialog`
|
|
48
|
+
* @default 'status'
|
|
49
|
+
*/
|
|
50
|
+
mode: AriaRoleMode;
|
|
51
|
+
}, {}, {
|
|
52
|
+
state: {
|
|
53
|
+
id: string;
|
|
54
|
+
/**
|
|
55
|
+
* Sets the correct aria attributes for the Toast.
|
|
56
|
+
* Alert toasts are used to convey urgency and important information. The `role` is set to `alert`
|
|
57
|
+
* Status toasts are used to convey a message or a successful action. The `role` is set to `status`
|
|
58
|
+
* Dialog toasts are used when there's an action to be taken. The `role` is set to `dialog`
|
|
59
|
+
* @default 'status'
|
|
60
|
+
*/
|
|
61
|
+
mode: AriaRoleMode;
|
|
62
|
+
};
|
|
63
|
+
events: {};
|
|
64
|
+
}>;
|
|
65
|
+
//# sourceMappingURL=useToastModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useToastModel.d.ts","sourceRoot":"","sources":["../../../../../toast/lib/hooks/useToastModel.tsx"],"names":[],"mappings":"AACA,oBAAY,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEzD,eAAO,MAAM,aAAa;IAEtB;;;;;;OAMG;;IAEH;;OAEG;;;;;QAVH;;;;;;WAMG;;;;;IANH;;;;;;OAMG;;IAEH;;OAEG;;;;IAVH;;;;;;OAMG;;;;;QANH;;;;;;WAMG;;;;EAeL,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { createModelHook, useUniqueId } from '@workday/canvas-kit-react/common';
|
|
13
|
+
export var useToastModel = createModelHook({
|
|
14
|
+
defaultConfig: {
|
|
15
|
+
/**
|
|
16
|
+
* Sets the correct aria attributes for the Toast.
|
|
17
|
+
* Alert toasts are used to convey urgency and important information. The `role` is set to `alert`
|
|
18
|
+
* Status toasts are used to convey a message or a successful action. The `role` is set to `status`
|
|
19
|
+
* Dialog toasts are used when there's an action to be taken. The `role` is set to `dialog`
|
|
20
|
+
* @default 'status'
|
|
21
|
+
*/
|
|
22
|
+
mode: 'status',
|
|
23
|
+
/**
|
|
24
|
+
* When the Toast has a `mode="dialog"` this adds a unique id to type the `Toast.Message` to the dialog.
|
|
25
|
+
*/
|
|
26
|
+
id: '',
|
|
27
|
+
},
|
|
28
|
+
})(function (config) {
|
|
29
|
+
var id = useUniqueId(config.id);
|
|
30
|
+
var state = __assign(__assign({}, config), { id: id });
|
|
31
|
+
return { state: state, events: {} };
|
|
32
|
+
});
|
package/drawer/index.ts
CHANGED
package/drawer/lib/Drawer.tsx
CHANGED
|
@@ -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
|
-
|
|
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
|
|
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
|
|
13
|
-
* @default
|
|
21
|
+
* The direction from which the DeprecatedDrawer opens. Accepts `Left` or `Right`.
|
|
22
|
+
* @default DeprecatedDrawerDirection.Right
|
|
14
23
|
*/
|
|
15
|
-
openDirection?:
|
|
24
|
+
openDirection?: DeprecatedDrawerDirection;
|
|
16
25
|
/**
|
|
17
|
-
* The width of the
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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<
|
|
68
|
+
Pick<DeprecatedDrawerProps, 'width' | 'showDropShadow' | 'openDirection'>
|
|
51
69
|
>(
|
|
52
70
|
{
|
|
53
71
|
height: '100%',
|
|
@@ -61,26 +79,27 @@ const DrawerContainer = styled('div')<
|
|
|
61
79
|
}),
|
|
62
80
|
({showDropShadow, openDirection}) => ({
|
|
63
81
|
boxShadow:
|
|
64
|
-
openDirection ===
|
|
82
|
+
openDirection === DeprecatedDrawerDirection.Right && showDropShadow
|
|
65
83
|
? '-8px 0px 16px 0 rgba(0,0,0,0.12)'
|
|
66
|
-
: openDirection ===
|
|
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:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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<
|
|
98
|
+
const ChildrenContainer = styled('div')<Pick<DeprecatedDrawerProps, 'padding'>>(
|
|
79
99
|
{
|
|
80
100
|
height: '100%',
|
|
81
101
|
overflowY: 'auto',
|
|
82
102
|
wordBreak: 'break-word',
|
|
83
|
-
wordWrap: 'break-word', // Needed for IE11
|
|
84
103
|
position: 'relative',
|
|
85
104
|
},
|
|
86
105
|
({padding}) => ({
|
|
@@ -88,14 +107,32 @@ const ChildrenContainer = styled('div')<Pick<DrawerProps, 'padding'>>(
|
|
|
88
107
|
})
|
|
89
108
|
);
|
|
90
109
|
|
|
91
|
-
|
|
92
|
-
|
|
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
|
+
}
|
|
93
130
|
|
|
94
131
|
public render() {
|
|
95
132
|
const {
|
|
96
133
|
padding = space.s,
|
|
97
134
|
width = 360,
|
|
98
|
-
openDirection =
|
|
135
|
+
openDirection = DeprecatedDrawerDirection.Right,
|
|
99
136
|
showDropShadow = false,
|
|
100
137
|
children,
|
|
101
138
|
header,
|