@workday/canvas-kit-labs-react 7.0.0-alpha.140-next.6 → 7.0.0-alpha.256-next.2
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/lib/AutocompleteList.tsx +4 -5
- package/combobox/lib/Combobox.tsx +10 -14
- package/common/index.ts +0 -2
- package/common/lib/theming/useThemeRTL.ts +11 -13
- package/dist/commonjs/combobox/lib/AutocompleteList.d.ts +2 -3
- package/dist/commonjs/combobox/lib/AutocompleteList.d.ts.map +1 -1
- package/dist/commonjs/combobox/lib/Combobox.d.ts +3 -4
- package/dist/commonjs/combobox/lib/Combobox.d.ts.map +1 -1
- package/dist/commonjs/combobox/lib/Combobox.js +1 -5
- 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 -1
- package/dist/commonjs/drawer/index.d.ts.map +1 -1
- package/dist/commonjs/drawer/index.js +2 -2
- 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 -15
- 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/lib/AutocompleteList.d.ts +2 -3
- package/dist/es6/combobox/lib/AutocompleteList.d.ts.map +1 -1
- package/dist/es6/combobox/lib/Combobox.d.ts +3 -4
- package/dist/es6/combobox/lib/Combobox.d.ts.map +1 -1
- package/dist/es6/combobox/lib/Combobox.js +1 -5
- 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 -1
- package/dist/es6/drawer/index.d.ts.map +1 -1
- package/dist/es6/drawer/index.js +1 -1
- 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 -1
- 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 +4 -4
- 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,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,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.ToastLink = void 0;
|
|
29
|
+
var react_1 = __importDefault(require("react"));
|
|
30
|
+
var common_1 = require("@workday/canvas-kit-react/common");
|
|
31
|
+
var button_1 = require("@workday/canvas-kit-react/button");
|
|
32
|
+
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
33
|
+
var StyledHyperLink = common_1.styled(button_1.Hyperlink)({
|
|
34
|
+
marginTop: tokens_1.space.xxxs,
|
|
35
|
+
});
|
|
36
|
+
exports.ToastLink = common_1.createComponent('a')({
|
|
37
|
+
displayName: 'Toast.Link',
|
|
38
|
+
Component: function (_a, ref, Element) {
|
|
39
|
+
var children = _a.children, href = _a.href, elemProps = __rest(_a, ["children", "href"]);
|
|
40
|
+
return (react_1.default.createElement(StyledHyperLink, __assign({ ref: ref, href: href, as: Element }, elemProps), children));
|
|
41
|
+
},
|
|
42
|
+
});
|
|
@@ -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,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.ToastMessage = void 0;
|
|
29
|
+
var react_1 = __importDefault(require("react"));
|
|
30
|
+
var common_1 = require("@workday/canvas-kit-react/common");
|
|
31
|
+
var layout_1 = require("@workday/canvas-kit-react/layout");
|
|
32
|
+
var useToastModel_1 = require("./hooks/useToastModel");
|
|
33
|
+
var StyledMessage = common_1.styled(layout_1.Flex)({
|
|
34
|
+
wordBreak: 'break-word',
|
|
35
|
+
});
|
|
36
|
+
exports.ToastMessage = common_1.createSubcomponent('div')({
|
|
37
|
+
modelHook: useToastModel_1.useToastModel,
|
|
38
|
+
})(function (_a, Element, model) {
|
|
39
|
+
var children = _a.children, elemProps = __rest(_a, ["children"]);
|
|
40
|
+
return (react_1.default.createElement(StyledMessage, __assign({ flexDirection: "column", id: model.state.id, as: Element }, elemProps), children));
|
|
41
|
+
});
|
|
@@ -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,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.useToastModel = void 0;
|
|
15
|
+
var common_1 = require("@workday/canvas-kit-react/common");
|
|
16
|
+
exports.useToastModel = common_1.createModelHook({
|
|
17
|
+
defaultConfig: {
|
|
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: 'status',
|
|
26
|
+
/**
|
|
27
|
+
* When the Toast has a `mode="dialog"` this adds a unique id to type the `Toast.Message` to the dialog.
|
|
28
|
+
*/
|
|
29
|
+
id: '',
|
|
30
|
+
},
|
|
31
|
+
})(function (config) {
|
|
32
|
+
var id = common_1.useUniqueId(config.id);
|
|
33
|
+
var state = __assign(__assign({}, config), { id: id });
|
|
34
|
+
return { state: state, events: {} };
|
|
35
|
+
});
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { MenuItemProps } from '@workday/canvas-kit-preview-react/menu';
|
|
3
2
|
import { ComboBoxMenuItemGroup } from './Combobox';
|
|
4
3
|
interface AutocompleteListProps {
|
|
5
4
|
/**
|
|
6
5
|
* The autocomplete items of the Combobox. This array of menu items is shown under the text input.
|
|
7
6
|
*/
|
|
8
|
-
autocompleteItems: React.ReactElement<
|
|
7
|
+
autocompleteItems: React.ReactElement<any>[] | ComboBoxMenuItemGroup[];
|
|
9
8
|
/**
|
|
10
9
|
* Index of the active autocomplete item
|
|
11
10
|
*/
|
|
@@ -13,7 +12,7 @@ interface AutocompleteListProps {
|
|
|
13
12
|
/**
|
|
14
13
|
* The function called when an autocomplete item is selected
|
|
15
14
|
*/
|
|
16
|
-
handleAutocompleteClick: (event: React.SyntheticEvent<Element, Event>, menuItemProps:
|
|
15
|
+
handleAutocompleteClick: (event: React.SyntheticEvent<Element, Event>, menuItemProps: any) => void;
|
|
17
16
|
/**
|
|
18
17
|
* The id of the form field.
|
|
19
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutocompleteList.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/AutocompleteList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAIhD,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"AutocompleteList.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/AutocompleteList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAIhD,OAAO,EAAC,qBAAqB,EAAiD,MAAM,YAAY,CAAC;AAYjG,UAAU,qBAAqB;IAC7B;;OAEG;IACH,iBAAiB,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,GAAG,qBAAqB,EAAE,CAAC;IACvE;;OAEG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B;;OAEG;IACH,uBAAuB,EAAE,CACvB,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,EAC3C,aAAa,EAAE,GAAG,KACf,IAAI,CAAC;IACV;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,eAAO,MAAM,gBAAgB,uGAO1B,qBAAqB,uBAiFvB,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { GrowthBehavior } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import { MenuItemProps } from '@workday/canvas-kit-preview-react/menu';
|
|
4
3
|
import { TertiaryButtonProps } from '@workday/canvas-kit-react/button';
|
|
5
4
|
import { TextInputProps } from '@workday/canvas-kit-react/text-input';
|
|
6
5
|
export interface ComboBoxMenuItemGroup {
|
|
7
|
-
header: React.ReactElement<
|
|
8
|
-
items: React.ReactElement<
|
|
6
|
+
header: React.ReactElement<any>;
|
|
7
|
+
items: React.ReactElement<any>[];
|
|
9
8
|
}
|
|
10
9
|
export interface ComboboxProps extends GrowthBehavior, React.HTMLAttributes<HTMLElement> {
|
|
11
10
|
/**
|
|
@@ -33,7 +32,7 @@ export interface ComboboxProps extends GrowthBehavior, React.HTMLAttributes<HTML
|
|
|
33
32
|
/**
|
|
34
33
|
* The autocomplete items of the Combobox. This array of menu items is shown under the text input.
|
|
35
34
|
*/
|
|
36
|
-
autocompleteItems?: React.ReactElement<
|
|
35
|
+
autocompleteItems?: React.ReactElement<any>[] | ComboBoxMenuItemGroup[];
|
|
37
36
|
/**
|
|
38
37
|
* The function called when the Combobox text input changes.
|
|
39
38
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/Combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkE,MAAM,OAAO,CAAC;AAEvF,OAAO,EACL,cAAc,EAKf,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../../../combobox/lib/Combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkE,MAAM,OAAO,CAAC;AAEvF,OAAO,EACL,cAAc,EAKf,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAiB,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AAErF,OAAO,EAAC,cAAc,EAAC,MAAM,sCAAsC,CAAC;AAKpE,MAAM,WAAW,qBAAqB;IAEpC,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAEhC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;CAClC;AAED,MAAM,WAAW,aAAc,SAAQ,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IACtF;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;IAC7C;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,kBAAkB,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,CAAC;IACpD;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;OAEG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,GAAG,qBAAqB,EAAE,CAAC;IACxE;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC5D;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAClC;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACjC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;CAC/C;AA2DD,eAAO,MAAM,aAAa,YAAY,CAAC;AAEvC,eAAO,MAAM,WAAW,qEACc,CAAC;AAEvC,eAAO,MAAM,kBAAkB,cAAe,MAAM,SAAS,WAc5D,CAAC;AAYF,eAAO,MAAM,QAAQ,wLAelB,aAAa,gBAuTf,CAAC"}
|
|
@@ -217,10 +217,6 @@ export var Combobox = function (_a) {
|
|
|
217
217
|
var handleBlur = function (event) {
|
|
218
218
|
if (comboboxRef.current) {
|
|
219
219
|
var target = event.relatedTarget;
|
|
220
|
-
if (target === null) {
|
|
221
|
-
// IE11 swaps related and active target before it fires the blur event
|
|
222
|
-
target = document.activeElement;
|
|
223
|
-
}
|
|
224
220
|
if (target && comboboxRef.current.contains(target)) {
|
|
225
221
|
return;
|
|
226
222
|
}
|
|
@@ -303,7 +299,7 @@ export var Combobox = function (_a) {
|
|
|
303
299
|
};
|
|
304
300
|
var renderChildren = function (inputElement) {
|
|
305
301
|
var _a;
|
|
306
|
-
var cssOverride = { zIndex: 2 };
|
|
302
|
+
var cssOverride = { ':focus': { zIndex: 2 } };
|
|
307
303
|
if (showClearButton) {
|
|
308
304
|
var paddingDirection = isRTL ? 'paddingLeft' : 'paddingRight';
|
|
309
305
|
cssOverride = __assign(__assign({}, cssOverride), (_a = {}, _a[paddingDirection] = space.xl, _a));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../common/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../common/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
package/dist/es6/common/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThemeRTL.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/useThemeRTL.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useThemeRTL.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/useThemeRTL.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,aAAa,EAAC,MAAM,kCAAkC,CAAC;AAI/D,oBAAY,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAc5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,WAAW;6BAMD,aAAa,EAAE;;EAYxC"}
|
|
@@ -16,7 +16,7 @@ var __spreadArrays = (this && this.__spreadArrays) || function () {
|
|
|
16
16
|
r[k] = a[j];
|
|
17
17
|
return r;
|
|
18
18
|
};
|
|
19
|
-
import {
|
|
19
|
+
import { useIsRTL, useTheme } from '@workday/canvas-kit-react/common';
|
|
20
20
|
import { useMemo } from 'react';
|
|
21
21
|
import rtlCSSJS from 'rtl-css-js';
|
|
22
22
|
var getDirectionalStyles = function (isRTL) {
|
|
@@ -26,9 +26,8 @@ var getDirectionalStyles = function (isRTL) {
|
|
|
26
26
|
}
|
|
27
27
|
return isRTL ? rtlCSSJS(styles) : styles;
|
|
28
28
|
};
|
|
29
|
-
var getConvertedStyles = function (
|
|
30
|
-
|
|
31
|
-
return shouldConvert ? (_a = convertToStaticStates(styles)) !== null && _a !== void 0 ? _a : styles : styles;
|
|
29
|
+
var getConvertedStyles = function (styles, convertFunc) {
|
|
30
|
+
return convertFunc ? convertFunc(styles) : styles;
|
|
32
31
|
};
|
|
33
32
|
/**
|
|
34
33
|
* A helpful hook for supporting bidirectional styles.
|
|
@@ -60,10 +59,9 @@ var getConvertedStyles = function (shouldConvert, styles) {
|
|
|
60
59
|
* }
|
|
61
60
|
*/
|
|
62
61
|
export function useThemeRTL() {
|
|
63
|
-
var _a;
|
|
64
62
|
var theme = useTheme();
|
|
65
63
|
var direction = useIsRTL(theme);
|
|
66
|
-
var
|
|
64
|
+
var convertFunc = theme.canvas._styleRewriteFn;
|
|
67
65
|
var themeRTL = useMemo(function () {
|
|
68
66
|
return function () {
|
|
69
67
|
var cssObject = [];
|
|
@@ -72,11 +70,11 @@ export function useThemeRTL() {
|
|
|
72
70
|
}
|
|
73
71
|
var styles = getDirectionalStyles.apply(void 0, __spreadArrays([direction], cssObject));
|
|
74
72
|
return styles.reduce(function (first, second) {
|
|
75
|
-
var convertedFirst =
|
|
76
|
-
var convertedSecond =
|
|
73
|
+
var convertedFirst = getConvertedStyles(first, convertFunc);
|
|
74
|
+
var convertedSecond = getConvertedStyles(second, convertFunc);
|
|
77
75
|
return __assign(__assign({}, convertedFirst), convertedSecond);
|
|
78
76
|
}, {});
|
|
79
77
|
};
|
|
80
|
-
}, [direction,
|
|
78
|
+
}, [direction, convertFunc]);
|
|
81
79
|
return { themeRTL: themeRTL, theme: theme };
|
|
82
80
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,sBAAsB,EAAC,MAAM,oBAAoB,CAAC;AAC1D,cAAc,cAAc,CAAC"}
|
package/dist/es6/drawer/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
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
|
-
|
|
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
|
|
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
|
|
11
|
-
* @default
|
|
18
|
+
* The direction from which the DeprecatedDrawer opens. Accepts `Left` or `Right`.
|
|
19
|
+
* @default DeprecatedDrawerDirection.Right
|
|
12
20
|
*/
|
|
13
|
-
openDirection?:
|
|
21
|
+
openDirection?: DeprecatedDrawerDirection;
|
|
14
22
|
/**
|
|
15
|
-
* The width of the
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
46
|
-
|
|
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,
|
|
1
|
+
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../../drawer/lib/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAgB,iBAAiB,EAAC,MAAM,kCAAkC,CAAC;AAElF;;;;;;;GAOG;AAEH,MAAM,WAAW,qBAAsB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACjF;;;OAGG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;;OAGG;IACH,aAAa,CAAC,EAAE,yBAAyB,CAAC;IAC1C;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC5B;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;GAOG;AAEH,oBAAY,yBAAyB;IACnC,IAAI,IAAA;IACJ,KAAK,IAAA;CACN;AA6CD;;;;;;;GAOG;AAEH,qBAAa,gBAAiB,SAAQ,KAAK,CAAC,SAAS,CAAC,qBAAqB,EAAE,EAAE,CAAC;IAC9E,MAAM,CAAC,aAAa,mCAA6B;IAEjD,iBAAiB;IASV,MAAM;CAyBd"}
|
|
@@ -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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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,26 +63,25 @@ var DrawerContainer = styled('div')({
|
|
|
55
63
|
}, function (_a) {
|
|
56
64
|
var showDropShadow = _a.showDropShadow, openDirection = _a.openDirection;
|
|
57
65
|
return ({
|
|
58
|
-
boxShadow: openDirection ===
|
|
66
|
+
boxShadow: openDirection === DeprecatedDrawerDirection.Right && showDropShadow
|
|
59
67
|
? '-8px 0px 16px 0 rgba(0,0,0,0.12)'
|
|
60
|
-
: openDirection ===
|
|
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 ===
|
|
68
|
-
borderRight: openDirection ===
|
|
69
|
-
right: openDirection ===
|
|
70
|
-
left: openDirection ===
|
|
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')({
|
|
74
82
|
height: '100%',
|
|
75
83
|
overflowY: 'auto',
|
|
76
84
|
wordBreak: 'break-word',
|
|
77
|
-
wordWrap: 'break-word',
|
|
78
85
|
position: 'relative',
|
|
79
86
|
}, function (_a) {
|
|
80
87
|
var padding = _a.padding;
|
|
@@ -82,18 +89,29 @@ var ChildrenContainer = styled('div')({
|
|
|
82
89
|
padding: padding,
|
|
83
90
|
});
|
|
84
91
|
});
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
92
|
+
/**
|
|
93
|
+
* ### Deprecated Drawer
|
|
94
|
+
*
|
|
95
|
+
* As of Canvas Kit v8, this component is being soft-deprecated.
|
|
96
|
+
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
97
|
+
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
98
|
+
* for more information.
|
|
99
|
+
*/
|
|
100
|
+
var DeprecatedDrawer = /** @class */ (function (_super) {
|
|
101
|
+
__extends(DeprecatedDrawer, _super);
|
|
102
|
+
function DeprecatedDrawer() {
|
|
88
103
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
89
104
|
}
|
|
90
|
-
|
|
91
|
-
|
|
105
|
+
DeprecatedDrawer.prototype.componentDidMount = function () {
|
|
106
|
+
console.warn("This component is being deprecated and will be removed in Canvas Kit V9.\n\n For more information, please see the V8 upgrade guide:\n\n https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page\n ");
|
|
107
|
+
};
|
|
108
|
+
DeprecatedDrawer.prototype.render = function () {
|
|
109
|
+
var _a = this.props, _b = _a.padding, padding = _b === void 0 ? space.s : _b, _c = _a.width, width = _c === void 0 ? 360 : _c, _d = _a.openDirection, openDirection = _d === void 0 ? DeprecatedDrawerDirection.Right : _d, _e = _a.showDropShadow, showDropShadow = _e === void 0 ? false : _e, children = _a.children, header = _a.header, role = _a.role, elemProps = __rest(_a, ["padding", "width", "openDirection", "showDropShadow", "children", "header", "role"]);
|
|
92
110
|
return (React.createElement(DrawerContainer, __assign({ role: role }, elemProps, { showDropShadow: showDropShadow, width: width, openDirection: openDirection }),
|
|
93
111
|
header,
|
|
94
112
|
React.createElement(ChildrenContainer, { padding: padding }, children)));
|
|
95
113
|
};
|
|
96
|
-
|
|
97
|
-
return
|
|
114
|
+
DeprecatedDrawer.OpenDirection = DeprecatedDrawerDirection;
|
|
115
|
+
return DeprecatedDrawer;
|
|
98
116
|
}(React.Component));
|
|
99
|
-
export {
|
|
117
|
+
export { DeprecatedDrawer };
|