@workday/canvas-kit-labs-react 7.1.5 → 7.2.0-427-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/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/index.ts +0 -1
- package/common/lib/theming/useThemeRTL.ts +14 -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 +33 -53
- 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 +110 -142
- 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 +11 -11
- 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/index.d.ts +0 -1
- package/dist/commonjs/common/lib/theming/index.d.ts.map +1 -1
- package/dist/commonjs/common/lib/theming/index.js +0 -1
- package/dist/commonjs/common/lib/theming/useThemeRTL.d.ts +3 -0
- package/dist/commonjs/common/lib/theming/useThemeRTL.d.ts.map +1 -1
- package/dist/commonjs/common/lib/theming/useThemeRTL.js +21 -46
- package/dist/commonjs/expandable/index.d.ts +3 -0
- package/dist/commonjs/expandable/index.d.ts.map +1 -0
- package/dist/commonjs/{drawer → expandable}/index.js +2 -10
- package/dist/commonjs/expandable/lib/Expandable.d.ts +108 -0
- package/dist/commonjs/expandable/lib/Expandable.d.ts.map +1 -0
- package/dist/commonjs/expandable/lib/Expandable.js +59 -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 +23 -0
- package/dist/commonjs/expandable/lib/ExpandableContent.d.ts +21 -0
- package/dist/commonjs/expandable/lib/ExpandableContent.d.ts.map +1 -0
- package/dist/commonjs/expandable/lib/ExpandableContent.js +18 -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 +31 -0
- package/dist/commonjs/expandable/lib/ExpandableTarget.d.ts +33 -0
- package/dist/commonjs/expandable/lib/ExpandableTarget.d.ts.map +1 -0
- package/dist/commonjs/expandable/lib/ExpandableTarget.js +32 -0
- package/dist/commonjs/expandable/lib/ExpandableTitle.d.ts +11 -0
- package/dist/commonjs/expandable/lib/ExpandableTitle.d.ts.map +1 -0
- package/dist/commonjs/expandable/lib/ExpandableTitle.js +16 -0
- package/dist/commonjs/expandable/lib/hooks/index.d.ts +5 -0
- package/dist/commonjs/expandable/lib/hooks/index.d.ts.map +1 -0
- package/dist/commonjs/expandable/lib/hooks/index.js +16 -0
- package/dist/commonjs/expandable/lib/hooks/useExpandableContent.d.ts +18 -0
- package/dist/commonjs/expandable/lib/hooks/useExpandableContent.d.ts.map +1 -0
- package/dist/commonjs/expandable/lib/hooks/useExpandableContent.js +11 -0
- package/dist/commonjs/expandable/lib/hooks/useExpandableIcon.d.ts +13 -0
- package/dist/commonjs/expandable/lib/hooks/useExpandableIcon.d.ts.map +1 -0
- package/dist/commonjs/expandable/lib/hooks/useExpandableIcon.js +10 -0
- package/dist/commonjs/expandable/lib/hooks/useExpandableModel.d.ts +53 -0
- package/dist/commonjs/expandable/lib/hooks/useExpandableModel.d.ts.map +1 -0
- package/dist/commonjs/expandable/lib/hooks/useExpandableModel.js +22 -0
- package/dist/commonjs/expandable/lib/hooks/useExpandableTarget.d.ts +15 -0
- package/dist/commonjs/expandable/lib/hooks/useExpandableTarget.d.ts.map +1 -0
- package/dist/commonjs/expandable/lib/hooks/useExpandableTarget.js +19 -0
- package/dist/commonjs/index.d.ts +1 -2
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +1 -2
- package/dist/commonjs/search-form/lib/SearchForm.d.ts +7 -3
- package/dist/commonjs/search-form/lib/SearchForm.d.ts.map +1 -1
- package/dist/commonjs/search-form/lib/SearchForm.js +118 -145
- package/dist/commonjs/search-form/lib/themes.js +7 -8
- 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 +26 -48
- 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 +98 -131
- 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 +6 -8
- 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/index.d.ts +0 -1
- package/dist/es6/common/lib/theming/index.d.ts.map +1 -1
- package/dist/es6/common/lib/theming/index.js +0 -1
- package/dist/es6/common/lib/theming/useThemeRTL.d.ts +3 -0
- package/dist/es6/common/lib/theming/useThemeRTL.d.ts.map +1 -1
- package/dist/es6/common/lib/theming/useThemeRTL.js +19 -44
- 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 +108 -0
- package/dist/es6/expandable/lib/Expandable.d.ts.map +1 -0
- package/dist/es6/expandable/lib/Expandable.js +53 -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 +17 -0
- package/dist/es6/expandable/lib/ExpandableContent.d.ts +21 -0
- package/dist/es6/expandable/lib/ExpandableContent.d.ts.map +1 -0
- package/dist/es6/expandable/lib/ExpandableContent.js +12 -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 +25 -0
- package/dist/es6/expandable/lib/ExpandableTarget.d.ts +33 -0
- package/dist/es6/expandable/lib/ExpandableTarget.d.ts.map +1 -0
- package/dist/es6/expandable/lib/ExpandableTarget.js +26 -0
- package/dist/es6/expandable/lib/ExpandableTitle.d.ts +11 -0
- package/dist/es6/expandable/lib/ExpandableTitle.d.ts.map +1 -0
- package/dist/es6/expandable/lib/ExpandableTitle.js +10 -0
- package/dist/es6/expandable/lib/hooks/index.d.ts +5 -0
- package/dist/es6/expandable/lib/hooks/index.d.ts.map +1 -0
- package/dist/es6/expandable/lib/hooks/index.js +4 -0
- package/dist/es6/expandable/lib/hooks/useExpandableContent.d.ts +18 -0
- package/dist/es6/expandable/lib/hooks/useExpandableContent.d.ts.map +1 -0
- package/dist/es6/expandable/lib/hooks/useExpandableContent.js +8 -0
- package/dist/es6/expandable/lib/hooks/useExpandableIcon.d.ts +13 -0
- package/dist/es6/expandable/lib/hooks/useExpandableIcon.d.ts.map +1 -0
- package/dist/es6/expandable/lib/hooks/useExpandableIcon.js +7 -0
- package/dist/es6/expandable/lib/hooks/useExpandableModel.d.ts +53 -0
- package/dist/es6/expandable/lib/hooks/useExpandableModel.d.ts.map +1 -0
- package/dist/es6/expandable/lib/hooks/useExpandableModel.js +19 -0
- package/dist/es6/expandable/lib/hooks/useExpandableTarget.d.ts +15 -0
- package/dist/es6/expandable/lib/hooks/useExpandableTarget.d.ts.map +1 -0
- package/dist/es6/expandable/lib/hooks/useExpandableTarget.js +16 -0
- package/dist/es6/index.d.ts +1 -2
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +1 -2
- package/dist/es6/search-form/lib/SearchForm.d.ts +7 -3
- package/dist/es6/search-form/lib/SearchForm.d.ts.map +1 -1
- package/dist/es6/search-form/lib/SearchForm.js +108 -136
- package/dist/es6/search-form/lib/themes.js +5 -6
- package/{drawer → expandable}/LICENSE +2 -1
- package/expandable/README.md +11 -0
- package/expandable/index.ts +2 -0
- package/expandable/lib/Expandable.tsx +68 -0
- package/expandable/lib/ExpandableAvatar.tsx +26 -0
- package/expandable/lib/ExpandableContent.tsx +32 -0
- package/expandable/lib/ExpandableIcon.tsx +75 -0
- package/expandable/lib/ExpandableTarget.tsx +67 -0
- package/expandable/lib/ExpandableTitle.tsx +32 -0
- package/expandable/lib/hooks/index.ts +4 -0
- package/expandable/lib/hooks/useExpandableContent.ts +9 -0
- package/expandable/lib/hooks/useExpandableIcon.ts +8 -0
- package/expandable/lib/hooks/useExpandableModel.tsx +20 -0
- package/expandable/lib/hooks/useExpandableTarget.ts +16 -0
- package/expandable/package.json +6 -0
- package/index.ts +1 -2
- package/package.json +5 -5
- package/search-form/lib/SearchForm.tsx +13 -11
- 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/common/lib/theming/useThemedRing.ts +0 -82
- 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/commonjs/common/lib/theming/useThemedRing.d.ts +0 -11
- package/dist/commonjs/common/lib/theming/useThemedRing.d.ts.map +0 -1
- package/dist/commonjs/common/lib/theming/useThemedRing.js +0 -67
- package/dist/commonjs/drawer/index.d.ts +0 -6
- package/dist/commonjs/drawer/index.d.ts.map +0 -1
- package/dist/commonjs/drawer/lib/Drawer.d.ts +0 -49
- package/dist/commonjs/drawer/lib/Drawer.d.ts.map +0 -1
- package/dist/commonjs/drawer/lib/Drawer.js +0 -124
- package/dist/commonjs/drawer/lib/DrawerHeader.d.ts +0 -38
- package/dist/commonjs/drawer/lib/DrawerHeader.d.ts.map +0 -1
- package/dist/commonjs/drawer/lib/DrawerHeader.js +0 -105
- 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
- package/dist/es6/common/lib/theming/useThemedRing.d.ts +0 -11
- package/dist/es6/common/lib/theming/useThemedRing.d.ts.map +0 -1
- package/dist/es6/common/lib/theming/useThemedRing.js +0 -59
- package/dist/es6/drawer/index.d.ts +0 -6
- package/dist/es6/drawer/index.d.ts.map +0 -1
- package/dist/es6/drawer/index.js +0 -5
- package/dist/es6/drawer/lib/Drawer.d.ts +0 -49
- package/dist/es6/drawer/lib/Drawer.d.ts.map +0 -1
- package/dist/es6/drawer/lib/Drawer.js +0 -99
- package/dist/es6/drawer/lib/DrawerHeader.d.ts +0 -38
- package/dist/es6/drawer/lib/DrawerHeader.d.ts.map +0 -1
- package/dist/es6/drawer/lib/DrawerHeader.js +0 -81
- package/drawer/README.md +0 -35
- package/drawer/index.ts +0 -5
- package/drawer/lib/Drawer.tsx +0 -119
- package/drawer/lib/DrawerHeader.tsx +0 -105
- package/drawer/package.json +0 -6
|
@@ -1,48 +0,0 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.ComponentStatesTable = void 0;
|
|
18
|
-
var react_1 = __importDefault(require("react"));
|
|
19
|
-
var common_1 = require("@workday/canvas-kit-react/common");
|
|
20
|
-
var Table = common_1.styled('table')({
|
|
21
|
-
width: '100%',
|
|
22
|
-
thead: {
|
|
23
|
-
textAlign: 'left',
|
|
24
|
-
paddingBottom: 16,
|
|
25
|
-
},
|
|
26
|
-
'td, th': {
|
|
27
|
-
minWidth: 100,
|
|
28
|
-
paddingBottom: 16,
|
|
29
|
-
paddingRight: 16,
|
|
30
|
-
textAlign: 'left',
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
var ComponentStatesTable = function (_a) {
|
|
34
|
-
var rowProps = _a.rowProps, columnProps = _a.columnProps, children = _a.children;
|
|
35
|
-
return (react_1.default.createElement(Table, null,
|
|
36
|
-
react_1.default.createElement("thead", null,
|
|
37
|
-
react_1.default.createElement("tr", null,
|
|
38
|
-
react_1.default.createElement("th", null, "Variants"),
|
|
39
|
-
columnProps.map(function (col) { return (react_1.default.createElement("th", { key: "component-table-heading-" + col.label.toLowerCase().replace(' ', ',') }, col.label)); }))),
|
|
40
|
-
react_1.default.createElement("tbody", null, rowProps.map(function (row) {
|
|
41
|
-
return (react_1.default.createElement("tr", { key: row.label.toLowerCase().replace(' ', '-') },
|
|
42
|
-
react_1.default.createElement("td", null, row.label),
|
|
43
|
-
columnProps.map(function (col) {
|
|
44
|
-
return (react_1.default.createElement("td", { key: col.label.toLowerCase().replace(' ', '-') }, children(__assign(__assign({}, row.props), col.props))));
|
|
45
|
-
})));
|
|
46
|
-
}))));
|
|
47
|
-
};
|
|
48
|
-
exports.ComponentStatesTable = ComponentStatesTable;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { PropCombination, PropDeclaration, Props, PropsDeclaration } from './propTypes';
|
|
2
|
-
export declare const permutateProps: (allProps: PropsDeclaration, filter?: ((props: Props) => boolean) | undefined, remainingProps?: string[], values?: {
|
|
3
|
-
[key: string]: PropDeclaration;
|
|
4
|
-
}) => PropCombination[];
|
|
5
|
-
//# sourceMappingURL=permutateProps.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"permutateProps.d.ts","sourceRoot":"","sources":["../../../../../common/lib/storybook-utils/permutateProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAE,eAAe,EAAE,KAAK,EAAE,gBAAgB,EAAC,MAAM,aAAa,CAAC;AAEtF,eAAO,MAAM,cAAc,aACf,gBAAgB,oBACT,KAAK,KAAK,OAAO,gCAClB,MAAM,EAAE;;MAEvB,eAAe,EAuCjB,CAAC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
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.permutateProps = void 0;
|
|
15
|
-
var permutateProps = function (allProps, filter, remainingProps, values) {
|
|
16
|
-
if (remainingProps === void 0) { remainingProps = Object.keys(allProps); }
|
|
17
|
-
if (values === void 0) { values = {}; }
|
|
18
|
-
// When there are no more props to combine with, return result
|
|
19
|
-
var prop = remainingProps[0];
|
|
20
|
-
if (!prop) {
|
|
21
|
-
var props_1 = {};
|
|
22
|
-
Object.keys(values).forEach(function (prop) {
|
|
23
|
-
var _a;
|
|
24
|
-
props_1[prop] = (_a = values === null || values === void 0 ? void 0 : values[prop]) === null || _a === void 0 ? void 0 : _a.value;
|
|
25
|
-
});
|
|
26
|
-
if (filter && !filter(props_1)) {
|
|
27
|
-
return [];
|
|
28
|
-
}
|
|
29
|
-
var label = Object.keys(values)
|
|
30
|
-
.map(function (prop) { var _a; return (_a = values === null || values === void 0 ? void 0 : values[prop]) === null || _a === void 0 ? void 0 : _a.label; })
|
|
31
|
-
.join(' ');
|
|
32
|
-
return [
|
|
33
|
-
{
|
|
34
|
-
label: label,
|
|
35
|
-
props: props_1,
|
|
36
|
-
},
|
|
37
|
-
];
|
|
38
|
-
}
|
|
39
|
-
var possiblePropValues = allProps[prop];
|
|
40
|
-
var permutations = possiblePropValues === null || possiblePropValues === void 0 ? void 0 : possiblePropValues.map(function (value) {
|
|
41
|
-
var newValues = __assign({}, values); // Required so we don't overwrite previous references
|
|
42
|
-
newValues[prop] = value;
|
|
43
|
-
return exports.permutateProps(allProps, filter, remainingProps.slice(1, remainingProps.length), newValues);
|
|
44
|
-
});
|
|
45
|
-
return permutations.flat();
|
|
46
|
-
};
|
|
47
|
-
exports.permutateProps = permutateProps;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare type PropDeclaration = {
|
|
2
|
-
value: any;
|
|
3
|
-
label: string;
|
|
4
|
-
};
|
|
5
|
-
export declare type PropsDeclaration = {
|
|
6
|
-
[key: string]: PropDeclaration[];
|
|
7
|
-
};
|
|
8
|
-
export declare type Props = {
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
};
|
|
11
|
-
export declare type PropCombination = {
|
|
12
|
-
label: string;
|
|
13
|
-
props: Props;
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=propTypes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"propTypes.d.ts","sourceRoot":"","sources":["../../../../../common/lib/storybook-utils/propTypes.ts"],"names":[],"mappings":"AAAA,oBAAY,eAAe,GAAG;IAC5B,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,EAAE,CAAA;CAAC,CAAC;AAElE,oBAAY,KAAK,GAAG;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,KAAK,CAAC;CACd,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { EmotionCanvasTheme } from '@workday/canvas-kit-react/common';
|
|
2
|
-
import { CSSProperties } from '@workday/canvas-kit-react/tokens';
|
|
3
|
-
declare type paletteSelection = Exclude<keyof EmotionCanvasTheme['canvas']['palette'], 'common'>;
|
|
4
|
-
interface ContrastColors {
|
|
5
|
-
outer?: string;
|
|
6
|
-
inner?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function getPaletteColors(type: paletteSelection, theme: EmotionCanvasTheme): ContrastColors;
|
|
9
|
-
export declare const useThemedRing: (type: paletteSelection) => CSSProperties;
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=useThemedRing.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useThemedRing.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/useThemedRing.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,kBAAkB,EAAC,MAAM,kCAAkC,CAAC;AACxF,OAAO,EAAS,aAAa,EAA4B,MAAM,kCAAkC,CAAC;AAGlG,aAAK,gBAAgB,GAAG,OAAO,CAAC,MAAM,kBAAkB,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,CAAC;AACzF,UAAU,cAAc;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAoBD,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,gBAAgB,EACtB,KAAK,EAAE,kBAAkB,GACxB,cAAc,CAsBhB;AAED,eAAO,MAAM,aAAa,SAAU,gBAAgB,KAAG,aAyBtD,CAAC"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useThemedRing = exports.getPaletteColors = void 0;
|
|
7
|
-
var useThemeRTL_1 = require("./useThemeRTL");
|
|
8
|
-
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
9
|
-
var chroma_js_1 = __importDefault(require("chroma-js"));
|
|
10
|
-
var isAccessible = function (foreground, background) {
|
|
11
|
-
if (background === void 0) { background = tokens_1.colors.frenchVanilla100; }
|
|
12
|
-
return chroma_js_1.default.contrast(foreground, background) >= 3;
|
|
13
|
-
};
|
|
14
|
-
var getPaletteColorsFromTheme = function (palette, fallbackColors) {
|
|
15
|
-
return {
|
|
16
|
-
outer: isAccessible(palette.main)
|
|
17
|
-
? palette.main
|
|
18
|
-
: isAccessible(palette.darkest)
|
|
19
|
-
? palette.darkest
|
|
20
|
-
: fallbackColors === null || fallbackColors === void 0 ? void 0 : fallbackColors.outer,
|
|
21
|
-
inner: (fallbackColors === null || fallbackColors === void 0 ? void 0 : fallbackColors.inner) ? fallbackColors.inner : palette.main,
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
function getPaletteColors(type, theme) {
|
|
25
|
-
var palette = theme.canvas.palette[type];
|
|
26
|
-
switch (type) {
|
|
27
|
-
case 'error': {
|
|
28
|
-
return getPaletteColorsFromTheme(palette, { outer: tokens_1.inputColors.error.border });
|
|
29
|
-
}
|
|
30
|
-
case 'alert': {
|
|
31
|
-
return getPaletteColorsFromTheme(palette, { outer: tokens_1.colors.cantaloupe600 });
|
|
32
|
-
}
|
|
33
|
-
case 'success': {
|
|
34
|
-
return getPaletteColorsFromTheme(palette, {
|
|
35
|
-
outer: tokens_1.colors.greenApple600,
|
|
36
|
-
// The theme default for success.main is set to the darkest GreenApple
|
|
37
|
-
// For our default ring, we need to override it so the inner ring is a bit lighter
|
|
38
|
-
inner: palette.main === tokens_1.colors.greenApple600 ? tokens_1.statusColors.success : palette.main,
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
default: {
|
|
42
|
-
return getPaletteColorsFromTheme(palette);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
exports.getPaletteColors = getPaletteColors;
|
|
47
|
-
var useThemedRing = function (type) {
|
|
48
|
-
var _a = useThemeRTL_1.useThemeRTL(), themeRTL = _a.themeRTL, theme = _a.theme;
|
|
49
|
-
var paletteColors = getPaletteColors(type, theme);
|
|
50
|
-
if (!((paletteColors === null || paletteColors === void 0 ? void 0 : paletteColors.outer) || (paletteColors === null || paletteColors === void 0 ? void 0 : paletteColors.inner))) {
|
|
51
|
-
return {};
|
|
52
|
-
}
|
|
53
|
-
var errorBoxShadow = "inset 0 0 0 " + (paletteColors.outer === paletteColors.inner ? 1 : 2) + "px " + paletteColors.inner;
|
|
54
|
-
return themeRTL({
|
|
55
|
-
borderColor: paletteColors.outer,
|
|
56
|
-
transition: '100ms box-shadow',
|
|
57
|
-
boxShadow: errorBoxShadow,
|
|
58
|
-
'&:hover, &:disabled': {
|
|
59
|
-
borderColor: paletteColors.outer,
|
|
60
|
-
},
|
|
61
|
-
'&:focus:not([disabled])': {
|
|
62
|
-
borderColor: paletteColors.outer,
|
|
63
|
-
boxShadow: errorBoxShadow + ",\n 0 0 0 2px " + tokens_1.colors.frenchVanilla100 + ",\n 0 0 0 4px " + (theme ? theme.canvas.palette.common.focusOutline : tokens_1.inputColors.focusBorder),
|
|
64
|
-
},
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
exports.useThemedRing = useThemedRing;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAC,MAAM,EAAE,YAAY,EAAC,CAAC;AAC9B,eAAe,MAAM,CAAC;AACtB,cAAc,cAAc,CAAC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CanvasSpaceValues } from '@workday/canvas-kit-react/tokens';
|
|
3
|
-
export interface DrawerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
/**
|
|
5
|
-
* The padding of the Drawer contents.
|
|
6
|
-
* @default space.s
|
|
7
|
-
*/
|
|
8
|
-
padding?: CanvasSpaceValues;
|
|
9
|
-
/**
|
|
10
|
-
* The direction from which the Drawer opens. Accepts `Left` or `Right`.
|
|
11
|
-
* @default DrawerDirection.Right
|
|
12
|
-
*/
|
|
13
|
-
openDirection?: DrawerDirection;
|
|
14
|
-
/**
|
|
15
|
-
* The width of the Drawer in `px`.
|
|
16
|
-
* @default 360
|
|
17
|
-
*/
|
|
18
|
-
width?: number;
|
|
19
|
-
/**
|
|
20
|
-
* If true, render the Drawer with a drop shadow.
|
|
21
|
-
* @default false
|
|
22
|
-
*/
|
|
23
|
-
showDropShadow?: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* The optional DrawerHeader component of the Drawer. Shows an optional string and close button.
|
|
26
|
-
*/
|
|
27
|
-
header?: React.ReactElement;
|
|
28
|
-
/**
|
|
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.
|
|
30
|
-
*/
|
|
31
|
-
'aria-labelledby'?: string;
|
|
32
|
-
/**
|
|
33
|
-
* The `aria-label` for the Drawer. Set this when there is NO `header` for accessibility.
|
|
34
|
-
*/
|
|
35
|
-
'aria-label'?: string;
|
|
36
|
-
/**
|
|
37
|
-
* The role of the Drawer. If `role` is provided, you must also set `aria-labelledby` to link `header` to the `role`.
|
|
38
|
-
*/
|
|
39
|
-
role?: string;
|
|
40
|
-
}
|
|
41
|
-
export declare enum DrawerDirection {
|
|
42
|
-
Left = 0,
|
|
43
|
-
Right = 1
|
|
44
|
-
}
|
|
45
|
-
export default class Drawer extends React.Component<DrawerProps, {}> {
|
|
46
|
-
static OpenDirection: typeof DrawerDirection;
|
|
47
|
-
render(): JSX.Element;
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=Drawer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../../drawer/lib/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAgB,iBAAiB,EAAC,MAAM,kCAAkC,CAAC;AAElF,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,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,KAAK,CAAC,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC;IAClE,MAAM,CAAC,aAAa,yBAAmB;IAEhC,MAAM;CAyBd"}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __assign = (this && this.__assign) || function () {
|
|
16
|
-
__assign = Object.assign || function(t) {
|
|
17
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
18
|
-
s = arguments[i];
|
|
19
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
20
|
-
t[p] = s[p];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
return __assign.apply(this, arguments);
|
|
25
|
-
};
|
|
26
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
27
|
-
if (k2 === undefined) k2 = k;
|
|
28
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
29
|
-
}) : (function(o, m, k, k2) {
|
|
30
|
-
if (k2 === undefined) k2 = k;
|
|
31
|
-
o[k2] = m[k];
|
|
32
|
-
}));
|
|
33
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
34
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
35
|
-
}) : function(o, v) {
|
|
36
|
-
o["default"] = v;
|
|
37
|
-
});
|
|
38
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
39
|
-
if (mod && mod.__esModule) return mod;
|
|
40
|
-
var result = {};
|
|
41
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
42
|
-
__setModuleDefault(result, mod);
|
|
43
|
-
return result;
|
|
44
|
-
};
|
|
45
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
46
|
-
var t = {};
|
|
47
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
48
|
-
t[p] = s[p];
|
|
49
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
50
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
51
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
52
|
-
t[p[i]] = s[p[i]];
|
|
53
|
-
}
|
|
54
|
-
return t;
|
|
55
|
-
};
|
|
56
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
57
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
58
|
-
};
|
|
59
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60
|
-
exports.DrawerDirection = void 0;
|
|
61
|
-
var React = __importStar(require("react"));
|
|
62
|
-
var styled_1 = __importDefault(require("@emotion/styled"));
|
|
63
|
-
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
64
|
-
var DrawerDirection;
|
|
65
|
-
(function (DrawerDirection) {
|
|
66
|
-
DrawerDirection[DrawerDirection["Left"] = 0] = "Left";
|
|
67
|
-
DrawerDirection[DrawerDirection["Right"] = 1] = "Right";
|
|
68
|
-
})(DrawerDirection = exports.DrawerDirection || (exports.DrawerDirection = {}));
|
|
69
|
-
var DrawerContainer = styled_1.default('div')({
|
|
70
|
-
height: '100%',
|
|
71
|
-
backgroundColor: 'white',
|
|
72
|
-
display: 'flex',
|
|
73
|
-
flexDirection: 'column',
|
|
74
|
-
position: 'absolute',
|
|
75
|
-
}, function (_a) {
|
|
76
|
-
var width = _a.width;
|
|
77
|
-
return ({
|
|
78
|
-
width: width,
|
|
79
|
-
});
|
|
80
|
-
}, function (_a) {
|
|
81
|
-
var showDropShadow = _a.showDropShadow, openDirection = _a.openDirection;
|
|
82
|
-
return ({
|
|
83
|
-
boxShadow: openDirection === DrawerDirection.Right && showDropShadow
|
|
84
|
-
? '-8px 0px 16px 0 rgba(0,0,0,0.12)'
|
|
85
|
-
: openDirection === DrawerDirection.Left && showDropShadow
|
|
86
|
-
? '8px 0px 16px 0 rgba(0,0,0,0.12)'
|
|
87
|
-
: undefined,
|
|
88
|
-
});
|
|
89
|
-
}, function (_a) {
|
|
90
|
-
var openDirection = _a.openDirection;
|
|
91
|
-
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,
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
var ChildrenContainer = styled_1.default('div')({
|
|
99
|
-
height: '100%',
|
|
100
|
-
overflowY: 'auto',
|
|
101
|
-
wordBreak: 'break-word',
|
|
102
|
-
wordWrap: 'break-word',
|
|
103
|
-
position: 'relative',
|
|
104
|
-
}, function (_a) {
|
|
105
|
-
var padding = _a.padding;
|
|
106
|
-
return ({
|
|
107
|
-
padding: padding,
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
var Drawer = /** @class */ (function (_super) {
|
|
111
|
-
__extends(Drawer, _super);
|
|
112
|
-
function Drawer() {
|
|
113
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
114
|
-
}
|
|
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"]);
|
|
117
|
-
return (React.createElement(DrawerContainer, __assign({ role: role }, elemProps, { showDropShadow: showDropShadow, width: width, openDirection: openDirection }),
|
|
118
|
-
header,
|
|
119
|
-
React.createElement(ChildrenContainer, { padding: padding }, children)));
|
|
120
|
-
};
|
|
121
|
-
Drawer.OpenDirection = DrawerDirection;
|
|
122
|
-
return Drawer;
|
|
123
|
-
}(React.Component));
|
|
124
|
-
exports.default = Drawer;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CanvasColor } from '@workday/canvas-kit-react/tokens';
|
|
3
|
-
export interface DrawerHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
/**
|
|
5
|
-
* The text of the DrawerHeader. This text will also be applied as the `title` attribute of the header element.
|
|
6
|
-
*/
|
|
7
|
-
title?: string;
|
|
8
|
-
/**
|
|
9
|
-
* The function called when the DrawerHeader close button is clicked.
|
|
10
|
-
*/
|
|
11
|
-
onClose?: React.MouseEventHandler<HTMLButtonElement>;
|
|
12
|
-
/**
|
|
13
|
-
* The `aria-label` for the DrawHeader close button. Useful for i18n.
|
|
14
|
-
* @default Close
|
|
15
|
-
*/
|
|
16
|
-
closeIconAriaLabel?: string;
|
|
17
|
-
/**
|
|
18
|
-
* The background color of the DrawerHeader.
|
|
19
|
-
*/
|
|
20
|
-
headerColor?: CanvasColor | string;
|
|
21
|
-
/**
|
|
22
|
-
* The border color of the DrawerHeader. This should match something close to `headerColor`.
|
|
23
|
-
*/
|
|
24
|
-
borderColor?: CanvasColor | string;
|
|
25
|
-
/**
|
|
26
|
-
* If true, render the icon and header in white. Useful for preserving contrast with a dark `headerColor`.
|
|
27
|
-
* @default false
|
|
28
|
-
*/
|
|
29
|
-
inverse?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* The unique id of the DrawerHeader for accessibility.
|
|
32
|
-
*/
|
|
33
|
-
id?: string;
|
|
34
|
-
}
|
|
35
|
-
export default class DrawerHeader extends React.Component<DrawerHeaderProps, {}> {
|
|
36
|
-
render(): JSX.Element;
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=DrawerHeader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerHeader.d.ts","sourceRoot":"","sources":["../../../../drawer/lib/DrawerHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAsB,WAAW,EAAa,MAAM,kCAAkC,CAAC;AAI9F,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;AAsCD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,KAAK,CAAC,SAAS,CAAC,iBAAiB,EAAE,EAAE,CAAC;IACvE,MAAM;CA4Bd"}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
|
-
var __assign = (this && this.__assign) || function () {
|
|
16
|
-
__assign = Object.assign || function(t) {
|
|
17
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
18
|
-
s = arguments[i];
|
|
19
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
20
|
-
t[p] = s[p];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
return __assign.apply(this, arguments);
|
|
25
|
-
};
|
|
26
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
27
|
-
if (k2 === undefined) k2 = k;
|
|
28
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
29
|
-
}) : (function(o, m, k, k2) {
|
|
30
|
-
if (k2 === undefined) k2 = k;
|
|
31
|
-
o[k2] = m[k];
|
|
32
|
-
}));
|
|
33
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
34
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
35
|
-
}) : function(o, v) {
|
|
36
|
-
o["default"] = v;
|
|
37
|
-
});
|
|
38
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
39
|
-
if (mod && mod.__esModule) return mod;
|
|
40
|
-
var result = {};
|
|
41
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
42
|
-
__setModuleDefault(result, mod);
|
|
43
|
-
return result;
|
|
44
|
-
};
|
|
45
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
46
|
-
var t = {};
|
|
47
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
48
|
-
t[p] = s[p];
|
|
49
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
50
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
51
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
52
|
-
t[p[i]] = s[p[i]];
|
|
53
|
-
}
|
|
54
|
-
return t;
|
|
55
|
-
};
|
|
56
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
57
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
58
|
-
};
|
|
59
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60
|
-
var React = __importStar(require("react"));
|
|
61
|
-
var styled_1 = __importDefault(require("@emotion/styled"));
|
|
62
|
-
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
63
|
-
var button_1 = require("@workday/canvas-kit-react/button");
|
|
64
|
-
var canvas_system_icons_web_1 = require("@workday/canvas-system-icons-web");
|
|
65
|
-
var headerHeight = 56;
|
|
66
|
-
var HeaderContainer = styled_1.default('div')({
|
|
67
|
-
height: headerHeight,
|
|
68
|
-
display: 'flex',
|
|
69
|
-
alignItems: 'center',
|
|
70
|
-
padding: "0 " + tokens_1.space.s,
|
|
71
|
-
justifyContent: 'space-between',
|
|
72
|
-
}, function (_a) {
|
|
73
|
-
var borderColor = _a.borderColor;
|
|
74
|
-
return ({
|
|
75
|
-
borderBottom: "1px solid " + borderColor,
|
|
76
|
-
});
|
|
77
|
-
}, function (_a) {
|
|
78
|
-
var headerColor = _a.headerColor;
|
|
79
|
-
return ({
|
|
80
|
-
backgroundColor: headerColor,
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
var HeaderTitle = styled_1.default('h4')(__assign(__assign({}, tokens_1.type.levels.body.small), { fontWeight: tokens_1.type.properties.fontWeights.bold, whiteSpace: 'nowrap', textOverflow: 'ellipsis', overflow: 'hidden', paddingRight: tokens_1.space.xxxs }), function (_a) {
|
|
84
|
-
var inverse = _a.inverse;
|
|
85
|
-
return ({
|
|
86
|
-
color: inverse ? tokens_1.colors.frenchVanilla100 : tokens_1.typeColors.heading,
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
var CloseButton = styled_1.default(button_1.TertiaryButton)({
|
|
90
|
-
margin: '-8px',
|
|
91
|
-
});
|
|
92
|
-
var DrawerHeader = /** @class */ (function (_super) {
|
|
93
|
-
__extends(DrawerHeader, _super);
|
|
94
|
-
function DrawerHeader() {
|
|
95
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
96
|
-
}
|
|
97
|
-
DrawerHeader.prototype.render = function () {
|
|
98
|
-
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"]);
|
|
99
|
-
return (React.createElement(HeaderContainer, __assign({ borderColor: borderColor }, elemProps, { headerColor: headerColor }),
|
|
100
|
-
React.createElement(HeaderTitle, { id: id, inverse: inverse, title: title }, title),
|
|
101
|
-
onClose && closeIconAriaLabel && (React.createElement(CloseButton, { variant: inverse ? 'inverse' : undefined, onClick: onClose, "aria-label": closeIconAriaLabel, icon: canvas_system_icons_web_1.xIcon }))));
|
|
102
|
-
};
|
|
103
|
-
return DrawerHeader;
|
|
104
|
-
}(React.Component));
|
|
105
|
-
exports.default = DrawerHeader;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { PropCombination, Props } from './propTypes';
|
|
3
|
-
/**
|
|
4
|
-
* A helper to generate a table of all possible states for component visual testing.
|
|
5
|
-
*/
|
|
6
|
-
export interface ComponentStatesTableProps {
|
|
7
|
-
/**
|
|
8
|
-
* The props that will be passed to the component when it is rendered and the corresponding
|
|
9
|
-
* row label for that permutation. It is encouraged to use the result of permutateProps()
|
|
10
|
-
* rather than passing in a list so we don't miss any combinations.
|
|
11
|
-
*/
|
|
12
|
-
rowProps: PropCombination[];
|
|
13
|
-
/**
|
|
14
|
-
* The props that will be passed to the component when it is rendered and the corresponding
|
|
15
|
-
* column label for that permutation. It is encouraged to use the result of permutateProps()
|
|
16
|
-
* rather than passing in a list so we don't miss any combinations.
|
|
17
|
-
*/
|
|
18
|
-
columnProps: PropCombination[];
|
|
19
|
-
/**
|
|
20
|
-
* The render function called to render the component in each cell of the table. This gives you
|
|
21
|
-
* the ability to add extra styling or markup (a blue background for an inverse variant, for example).
|
|
22
|
-
*/
|
|
23
|
-
children(props: Props): React.ReactNode;
|
|
24
|
-
}
|
|
25
|
-
export declare const ComponentStatesTable: ({ rowProps, columnProps, children, }: ComponentStatesTableProps) => JSX.Element;
|
|
26
|
-
//# sourceMappingURL=ComponentStatesTable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentStatesTable.d.ts","sourceRoot":"","sources":["../../../../../common/lib/storybook-utils/ComponentStatesTable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAC,eAAe,EAAE,KAAK,EAAC,MAAM,aAAa,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B;;;;OAIG;IACH,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC;CACzC;AAgBD,eAAO,MAAM,oBAAoB,yCAI9B,yBAAyB,gBAkC3B,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
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 { styled } from '@workday/canvas-kit-react/common';
|
|
14
|
-
var Table = styled('table')({
|
|
15
|
-
width: '100%',
|
|
16
|
-
thead: {
|
|
17
|
-
textAlign: 'left',
|
|
18
|
-
paddingBottom: 16,
|
|
19
|
-
},
|
|
20
|
-
'td, th': {
|
|
21
|
-
minWidth: 100,
|
|
22
|
-
paddingBottom: 16,
|
|
23
|
-
paddingRight: 16,
|
|
24
|
-
textAlign: 'left',
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
export var ComponentStatesTable = function (_a) {
|
|
28
|
-
var rowProps = _a.rowProps, columnProps = _a.columnProps, children = _a.children;
|
|
29
|
-
return (React.createElement(Table, null,
|
|
30
|
-
React.createElement("thead", null,
|
|
31
|
-
React.createElement("tr", null,
|
|
32
|
-
React.createElement("th", null, "Variants"),
|
|
33
|
-
columnProps.map(function (col) { return (React.createElement("th", { key: "component-table-heading-" + col.label.toLowerCase().replace(' ', ',') }, col.label)); }))),
|
|
34
|
-
React.createElement("tbody", null, rowProps.map(function (row) {
|
|
35
|
-
return (React.createElement("tr", { key: row.label.toLowerCase().replace(' ', '-') },
|
|
36
|
-
React.createElement("td", null, row.label),
|
|
37
|
-
columnProps.map(function (col) {
|
|
38
|
-
return (React.createElement("td", { key: col.label.toLowerCase().replace(' ', '-') }, children(__assign(__assign({}, row.props), col.props))));
|
|
39
|
-
})));
|
|
40
|
-
}))));
|
|
41
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { PropCombination, PropDeclaration, Props, PropsDeclaration } from './propTypes';
|
|
2
|
-
export declare const permutateProps: (allProps: PropsDeclaration, filter?: ((props: Props) => boolean) | undefined, remainingProps?: string[], values?: {
|
|
3
|
-
[key: string]: PropDeclaration;
|
|
4
|
-
}) => PropCombination[];
|
|
5
|
-
//# sourceMappingURL=permutateProps.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"permutateProps.d.ts","sourceRoot":"","sources":["../../../../../common/lib/storybook-utils/permutateProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAE,eAAe,EAAE,KAAK,EAAE,gBAAgB,EAAC,MAAM,aAAa,CAAC;AAEtF,eAAO,MAAM,cAAc,aACf,gBAAgB,oBACT,KAAK,KAAK,OAAO,gCAClB,MAAM,EAAE;;MAEvB,eAAe,EAuCjB,CAAC"}
|