@workday/canvas-kit-preview-react 7.0.0-alpha.0-next.7 → 7.0.0-alpha.80-next.8
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/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.tsx +51 -22
- package/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.tsx +1 -1
- package/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.tsx +1 -0
- package/breadcrumbs/lib/Breadcrumbs/List/ListItem.tsx +4 -0
- package/color-picker/lib/ColorPicker.tsx +3 -3
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.d.ts +3 -3
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.d.ts.map +1 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.js +33 -5
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.js +1 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.d.ts.map +1 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.js +1 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/ListItem.d.ts.map +1 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/ListItem.js +1 -1
- package/dist/commonjs/color-picker/lib/ColorPicker.js +2 -2
- package/dist/commonjs/menu/lib/Menu.js +1 -1
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts +4 -4
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/SidePanel.js +24 -9
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.d.ts +3 -3
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.d.ts.map +1 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.js +35 -7
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.js +1 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.d.ts.map +1 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/CurrentItem.js +1 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/ListItem.d.ts.map +1 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/ListItem.js +1 -1
- package/dist/es6/color-picker/lib/ColorPicker.js +3 -3
- package/dist/es6/menu/lib/Menu.js +1 -1
- package/dist/es6/side-panel/lib/SidePanel.d.ts +4 -4
- package/dist/es6/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/es6/side-panel/lib/SidePanel.js +26 -11
- package/menu/lib/Menu.tsx +1 -1
- package/package.json +4 -4
- package/side-panel/lib/SidePanel.tsx +36 -21
- package/ts3.5/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.d.ts +3 -3
- package/ts3.5/dist/commonjs/side-panel/lib/SidePanel.d.ts +4 -4
- package/ts3.5/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.d.ts +3 -3
- package/ts3.5/dist/es6/side-panel/lib/SidePanel.d.ts +4 -4
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {BaseButton} from '@workday/canvas-kit-react/button';
|
|
3
3
|
import {relatedActionsIcon} from '@workday/canvas-system-icons-web';
|
|
4
4
|
import {CanvasSystemIcon} from '@workday/design-assets-types';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import {createComponent, EmotionCanvasTheme, useTheme} from '@workday/canvas-kit-react/common';
|
|
6
|
+
import {colors, space} from '@workday/canvas-kit-react/tokens';
|
|
7
7
|
|
|
8
|
-
export interface DropdownButtonProps extends
|
|
8
|
+
export interface DropdownButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
9
9
|
/**
|
|
10
10
|
* The accessibility label for the button
|
|
11
11
|
*/
|
|
@@ -22,35 +22,64 @@ export interface DropdownButtonProps extends IconButtonProps {
|
|
|
22
22
|
toggled: boolean;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
export const DropdownButton = createComponent(
|
|
25
|
+
export const DropdownButton = createComponent('button')({
|
|
26
26
|
displayName: 'DropdownButton',
|
|
27
27
|
Component: (
|
|
28
|
-
{
|
|
29
|
-
buttonIcon = relatedActionsIcon,
|
|
30
|
-
toggled,
|
|
31
|
-
variant = 'plain',
|
|
32
|
-
...elemProps
|
|
33
|
-
}: DropdownButtonProps,
|
|
28
|
+
{buttonIcon = relatedActionsIcon, toggled, ...elemProps}: DropdownButtonProps,
|
|
34
29
|
ref,
|
|
35
30
|
Element
|
|
36
31
|
) => {
|
|
37
|
-
const
|
|
38
|
-
|
|
32
|
+
const theme = useTheme();
|
|
39
33
|
return (
|
|
40
|
-
<
|
|
34
|
+
<BaseButton
|
|
35
|
+
as={Element}
|
|
41
36
|
ref={ref}
|
|
42
|
-
|
|
43
|
-
style={hasPlainVariant ? {margin: '0 1px'} : {}}
|
|
44
|
-
variant={variant}
|
|
45
|
-
icon={buttonIcon}
|
|
46
|
-
color={colors.licorice200}
|
|
47
|
-
toggled={toggled}
|
|
48
|
-
aria-pressed={undefined} // removing aria-pressed from IconButton and opting for aria-expanded
|
|
37
|
+
aria-pressed={undefined} // removing aria-pressed from button and opting for aria-expanded
|
|
49
38
|
aria-expanded={toggled}
|
|
50
39
|
aria-haspopup
|
|
51
40
|
aria-controls="menu"
|
|
41
|
+
size="small"
|
|
42
|
+
height={space.l}
|
|
43
|
+
width={space.l}
|
|
44
|
+
padding={space.zero}
|
|
45
|
+
colors={getDropdownColors(toggled, theme)}
|
|
52
46
|
{...elemProps}
|
|
53
|
-
|
|
47
|
+
>
|
|
48
|
+
<BaseButton.Icon icon={buttonIcon} />
|
|
49
|
+
</BaseButton>
|
|
54
50
|
);
|
|
55
51
|
},
|
|
56
52
|
});
|
|
53
|
+
|
|
54
|
+
const getDropdownColors = (toggled: boolean, theme: EmotionCanvasTheme) => {
|
|
55
|
+
const {
|
|
56
|
+
canvas: {
|
|
57
|
+
palette: {primary: themePrimary},
|
|
58
|
+
},
|
|
59
|
+
} = theme;
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
default: {
|
|
63
|
+
icon: toggled ? themePrimary.main : colors.blackPepper400,
|
|
64
|
+
label: themePrimary.main,
|
|
65
|
+
},
|
|
66
|
+
hover: {
|
|
67
|
+
background: colors.soap200,
|
|
68
|
+
icon: toggled ? themePrimary.dark : colors.blackPepper500,
|
|
69
|
+
label: themePrimary.dark,
|
|
70
|
+
},
|
|
71
|
+
active: {
|
|
72
|
+
background: colors.soap300,
|
|
73
|
+
icon: toggled ? themePrimary.dark : colors.blackPepper500,
|
|
74
|
+
label: themePrimary.dark,
|
|
75
|
+
},
|
|
76
|
+
focus: {
|
|
77
|
+
icon: toggled ? themePrimary.main : colors.blackPepper500,
|
|
78
|
+
label: themePrimary.main,
|
|
79
|
+
},
|
|
80
|
+
disabled: {
|
|
81
|
+
icon: toggled ? themePrimary.main : colors.blackPepper400,
|
|
82
|
+
label: themePrimary.main,
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
};
|
|
@@ -52,7 +52,7 @@ export interface DropdownMenuProps {
|
|
|
52
52
|
|
|
53
53
|
const StyledDropdownMenu = styled(Box)<BoxProps>({
|
|
54
54
|
...type.levels.subtext.large,
|
|
55
|
-
...depth[
|
|
55
|
+
...depth[3],
|
|
56
56
|
backgroundColor: commonColors.background,
|
|
57
57
|
border: `1px solid ${colors.soap500}`,
|
|
58
58
|
borderRadius: borderRadius.m,
|
|
@@ -19,6 +19,10 @@ export const BreadcrumbsListItem = ({children, ...props}: ListItemProps) => {
|
|
|
19
19
|
icon={icon}
|
|
20
20
|
color={colors.licorice200}
|
|
21
21
|
colorHover={colors.licorice200}
|
|
22
|
+
size={20}
|
|
23
|
+
height={32}
|
|
24
|
+
width={32}
|
|
25
|
+
styles={{justifyContent: 'center', alignItems: 'center', display: 'inline-flex'}}
|
|
22
26
|
aria-hidden
|
|
23
27
|
/>
|
|
24
28
|
</Flex>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {colors, space} from '@workday/canvas-kit-react/tokens';
|
|
2
2
|
import {checkIcon} from '@workday/canvas-system-icons-web';
|
|
3
3
|
import {ColorInput} from '@workday/canvas-kit-react/color-picker';
|
|
4
|
-
import {
|
|
4
|
+
import {SecondaryButton} from '@workday/canvas-kit-react/button';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import FormField from '@workday/canvas-kit-react/form-field';
|
|
7
7
|
import styled from '@emotion/styled';
|
|
@@ -141,7 +141,7 @@ const ColorInputAndLabel = styled(FormField)({
|
|
|
141
141
|
margin: 0,
|
|
142
142
|
});
|
|
143
143
|
|
|
144
|
-
const CheckButton = styled(
|
|
144
|
+
const CheckButton = styled(SecondaryButton)({
|
|
145
145
|
alignSelf: 'flex-end',
|
|
146
146
|
});
|
|
147
147
|
|
|
@@ -207,7 +207,7 @@ const ColorPicker = ({
|
|
|
207
207
|
showCheck={value === validHexValue || value === customHexValue}
|
|
208
208
|
/>
|
|
209
209
|
</ColorInputAndLabel>
|
|
210
|
-
<CheckButton aria-label={submitLabel}
|
|
210
|
+
<CheckButton aria-label={submitLabel} icon={checkIcon} />
|
|
211
211
|
</ColorInputWrapper>
|
|
212
212
|
)}
|
|
213
213
|
</ColorPickerContainer>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { CanvasSystemIcon } from '@workday/design-assets-types';
|
|
3
|
-
export interface DropdownButtonProps extends
|
|
3
|
+
export interface DropdownButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
4
4
|
/**
|
|
5
5
|
* The accessibility label for the button
|
|
6
6
|
*/
|
|
@@ -16,5 +16,5 @@ export interface DropdownButtonProps extends IconButtonProps {
|
|
|
16
16
|
*/
|
|
17
17
|
toggled: boolean;
|
|
18
18
|
}
|
|
19
|
-
export declare const DropdownButton: import("@workday/canvas-kit-react/common").ElementComponent<
|
|
19
|
+
export declare const DropdownButton: import("@workday/canvas-kit-react/common").ElementComponent<"button", DropdownButtonProps>;
|
|
20
20
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../../breadcrumbs/lib/Breadcrumbs/Dropdown/Button.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../../breadcrumbs/lib/Breadcrumbs/Dropdown/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAI9D,MAAM,WAAW,mBAAoB,SAAQ,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC;IAClF;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,cAAc,4FA2BzB,CAAC"}
|
|
@@ -29,13 +29,41 @@ exports.DropdownButton = void 0;
|
|
|
29
29
|
var react_1 = __importDefault(require("react"));
|
|
30
30
|
var button_1 = require("@workday/canvas-kit-react/button");
|
|
31
31
|
var canvas_system_icons_web_1 = require("@workday/canvas-system-icons-web");
|
|
32
|
-
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
33
32
|
var common_1 = require("@workday/canvas-kit-react/common");
|
|
34
|
-
|
|
33
|
+
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
34
|
+
exports.DropdownButton = common_1.createComponent('button')({
|
|
35
35
|
displayName: 'DropdownButton',
|
|
36
36
|
Component: function (_a, ref, Element) {
|
|
37
|
-
var _b = _a.buttonIcon, buttonIcon = _b === void 0 ? canvas_system_icons_web_1.relatedActionsIcon : _b, toggled = _a.toggled,
|
|
38
|
-
var
|
|
39
|
-
return (react_1.default.createElement(
|
|
37
|
+
var _b = _a.buttonIcon, buttonIcon = _b === void 0 ? canvas_system_icons_web_1.relatedActionsIcon : _b, toggled = _a.toggled, elemProps = __rest(_a, ["buttonIcon", "toggled"]);
|
|
38
|
+
var theme = common_1.useTheme();
|
|
39
|
+
return (react_1.default.createElement(button_1.BaseButton, __assign({ as: Element, ref: ref, "aria-pressed": undefined, "aria-expanded": toggled, "aria-haspopup": true, "aria-controls": "menu", size: "small", height: tokens_1.space.l, width: tokens_1.space.l, padding: tokens_1.space.zero, colors: getDropdownColors(toggled, theme) }, elemProps),
|
|
40
|
+
react_1.default.createElement(button_1.BaseButton.Icon, { icon: buttonIcon })));
|
|
40
41
|
},
|
|
41
42
|
});
|
|
43
|
+
var getDropdownColors = function (toggled, theme) {
|
|
44
|
+
var themePrimary = theme.canvas.palette.primary;
|
|
45
|
+
return {
|
|
46
|
+
default: {
|
|
47
|
+
icon: toggled ? themePrimary.main : tokens_1.colors.blackPepper400,
|
|
48
|
+
label: themePrimary.main,
|
|
49
|
+
},
|
|
50
|
+
hover: {
|
|
51
|
+
background: tokens_1.colors.soap200,
|
|
52
|
+
icon: toggled ? themePrimary.dark : tokens_1.colors.blackPepper500,
|
|
53
|
+
label: themePrimary.dark,
|
|
54
|
+
},
|
|
55
|
+
active: {
|
|
56
|
+
background: tokens_1.colors.soap300,
|
|
57
|
+
icon: toggled ? themePrimary.dark : tokens_1.colors.blackPepper500,
|
|
58
|
+
label: themePrimary.dark,
|
|
59
|
+
},
|
|
60
|
+
focus: {
|
|
61
|
+
icon: toggled ? themePrimary.main : tokens_1.colors.blackPepper500,
|
|
62
|
+
label: themePrimary.main,
|
|
63
|
+
},
|
|
64
|
+
disabled: {
|
|
65
|
+
icon: toggled ? themePrimary.main : tokens_1.colors.blackPepper400,
|
|
66
|
+
label: themePrimary.main,
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
};
|
|
@@ -32,7 +32,7 @@ var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
|
32
32
|
// local components
|
|
33
33
|
var MenuItemLink_1 = require("./MenuItemLink");
|
|
34
34
|
var layout_1 = require("@workday/canvas-kit-react/layout");
|
|
35
|
-
var StyledDropdownMenu = common_1.styled(layout_1.Box)(__assign(__assign(__assign({}, tokens_1.type.levels.subtext.large), tokens_1.depth[
|
|
35
|
+
var StyledDropdownMenu = common_1.styled(layout_1.Box)(__assign(__assign(__assign({}, tokens_1.type.levels.subtext.large), tokens_1.depth[3]), { backgroundColor: tokens_1.commonColors.background, border: "1px solid " + tokens_1.colors.soap500, borderRadius: tokens_1.borderRadius.m, boxSizing: 'border-box', display: 'inline-block', marginTop: tokens_1.space.xxxs, maxHeight: 200, outline: 'none', overflowY: 'auto', position: 'relative', width: 'max-content' }));
|
|
36
36
|
var StyledMenuList = common_1.styled('ul')({
|
|
37
37
|
boxSizing: 'border-box',
|
|
38
38
|
listStyle: 'none',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurrentItem.d.ts","sourceRoot":"","sources":["../../../../../../breadcrumbs/lib/Breadcrumbs/List/CurrentItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC;IAC3E;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;
|
|
1
|
+
{"version":3,"file":"CurrentItem.d.ts","sourceRoot":"","sources":["../../../../../../breadcrumbs/lib/Breadcrumbs/List/CurrentItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC;IAC3E;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAiBD,eAAO,MAAM,WAAW,yCAAwC,gBAAgB,gBA8B/E,CAAC"}
|
|
@@ -33,7 +33,7 @@ var tooltip_1 = require("@workday/canvas-kit-react/tooltip");
|
|
|
33
33
|
var popup_1 = require("@workday/canvas-kit-react/popup");
|
|
34
34
|
var hooks_1 = require("./hooks");
|
|
35
35
|
var styles_1 = require("./styles");
|
|
36
|
-
var ListItem = common_1.styled('li')(__assign({ display: 'flex', alignItems: 'center', flexDirection: 'column', textAlign: 'left' }, tokens_1.type.levels.subtext.large), function (_a) {
|
|
36
|
+
var ListItem = common_1.styled('li')(__assign(__assign({ display: 'flex', alignItems: 'center', flexDirection: 'column', textAlign: 'left' }, tokens_1.type.levels.subtext.large), { fontWeight: 500 }), function (_a) {
|
|
37
37
|
var maxWidth = _a.maxWidth;
|
|
38
38
|
return (__assign({}, styles_1.truncateStyles(maxWidth)));
|
|
39
39
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../../../../breadcrumbs/lib/Breadcrumbs/List/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,oBAAY,aAAa,GAAG,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;AAEhE,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../../../../breadcrumbs/lib/Breadcrumbs/List/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,oBAAY,aAAa,GAAG,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;AAEhE,eAAO,MAAM,mBAAmB,wDAmB/B,CAAC"}
|
|
@@ -38,6 +38,6 @@ var BreadcrumbsListItem = function (_a) {
|
|
|
38
38
|
var icon = shouldUseRTL ? canvas_system_icons_web_1.chevronLeftSmallIcon : canvas_system_icons_web_1.chevronRightSmallIcon;
|
|
39
39
|
return (react_1.default.createElement(layout_1.Flex, __assign({ as: "li", alignItems: "center" }, props),
|
|
40
40
|
children,
|
|
41
|
-
react_1.default.createElement(icon_1.SystemIcon, { icon: icon, color: tokens_1.colors.licorice200, colorHover: tokens_1.colors.licorice200, "aria-hidden": true })));
|
|
41
|
+
react_1.default.createElement(icon_1.SystemIcon, { icon: icon, color: tokens_1.colors.licorice200, colorHover: tokens_1.colors.licorice200, size: 20, height: 32, width: 32, styles: { justifyContent: 'center', alignItems: 'center', display: 'inline-flex' }, "aria-hidden": true })));
|
|
42
42
|
};
|
|
43
43
|
exports.BreadcrumbsListItem = BreadcrumbsListItem;
|
|
@@ -126,7 +126,7 @@ var ColorInputAndLabel = styled_1.default(form_field_1.default)({
|
|
|
126
126
|
flexDirection: 'column',
|
|
127
127
|
margin: 0,
|
|
128
128
|
});
|
|
129
|
-
var CheckButton = styled_1.default(button_1.
|
|
129
|
+
var CheckButton = styled_1.default(button_1.SecondaryButton)({
|
|
130
130
|
alignSelf: 'flex-end',
|
|
131
131
|
});
|
|
132
132
|
var HexColorInput = styled_1.default(color_picker_1.ColorInput)({
|
|
@@ -161,7 +161,7 @@ var ColorPicker = function (_a) {
|
|
|
161
161
|
showCustomHexInput && (React.createElement(ColorInputWrapper, { onSubmit: onSubmit },
|
|
162
162
|
React.createElement(ColorInputAndLabel, { label: customHexInputLabel },
|
|
163
163
|
React.createElement(HexColorInput, { onChange: onCustomHexChange, onValidColorChange: onValidCustomHexChange, value: customHexValue, showCheck: value === validHexValue || value === customHexValue })),
|
|
164
|
-
React.createElement(CheckButton, { "aria-label": submitLabel,
|
|
164
|
+
React.createElement(CheckButton, { "aria-label": submitLabel, icon: canvas_system_icons_web_1.checkIcon })))));
|
|
165
165
|
};
|
|
166
166
|
ColorPicker.defaultColorSet = defaultColorSet;
|
|
167
167
|
exports.default = ColorPicker;
|
|
@@ -268,7 +268,7 @@ var Menu = /** @class */ (function (_super) {
|
|
|
268
268
|
var _a = this.props, _b = _a.id, id = _b === void 0 ? this.id : _b, _c = _a.isOpen, isOpen = _c === void 0 ? true : _c, children = _a.children, ariaLabelledby = _a["aria-labelledby"], grow = _a.grow, width = _a.width, onSelect = _a.onSelect, onClose = _a.onClose, initialSelectedItem = _a.initialSelectedItem, elemProps = __rest(_a, ["id", "isOpen", "children", 'aria-labelledby', "grow", "width", "onSelect", "onClose", "initialSelectedItem"]);
|
|
269
269
|
var selectedItemIndex = this.state.selectedItemIndex;
|
|
270
270
|
var cardWidth = grow ? '100%' : width;
|
|
271
|
-
return (React.createElement(card_1.Card, { style: { display: 'inline-block' }, padding: tokens_1.space.zero, width: cardWidth },
|
|
271
|
+
return (React.createElement(card_1.Card, { style: { display: 'inline-block' }, padding: tokens_1.space.zero, width: cardWidth, depth: 3 },
|
|
272
272
|
React.createElement(card_1.Card.Body, null,
|
|
273
273
|
React.createElement(List, __assign({ role: "menu", tabIndex: 0, id: id, "aria-labelledby": ariaLabelledby, "aria-activedescendant": id + "-" + selectedItemIndex, onKeyDown: this.handleKeyboardShortcuts, ref: this.menuRef }, elemProps), React.Children.map(children, function (menuItem, index) {
|
|
274
274
|
if (!React.isValidElement(menuItem)) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { jsx } from '@emotion/react';
|
|
5
|
-
import {
|
|
5
|
+
import { TertiaryButtonProps } from '@workday/canvas-kit-react/button';
|
|
6
6
|
export declare type SidePanelVariant = 'standard' | 'alternate';
|
|
7
7
|
export declare type SidePanelTransitionStates = 'collapsed' | 'collapsing' | 'expanded' | 'expanding';
|
|
8
8
|
export interface SidePanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -50,7 +50,7 @@ export interface SidePanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
50
50
|
*/
|
|
51
51
|
onStateTransition?: (state?: SidePanelTransitionStates) => void;
|
|
52
52
|
/**
|
|
53
|
-
* The style variant of the side panel. 'standard' is with a `soap100` background, no depth. 'alternate' is a `frenchVanilla100` background with a level
|
|
53
|
+
* The style variant of the side panel. 'standard' is with a `soap100` background, no depth. 'alternate' is a `frenchVanilla100` background with a level 6 depth.
|
|
54
54
|
*
|
|
55
55
|
* @default 'standard'
|
|
56
56
|
*/
|
|
@@ -67,10 +67,10 @@ export declare const SidePanelContext: React.Context<{
|
|
|
67
67
|
origin: string;
|
|
68
68
|
}>;
|
|
69
69
|
declare const SidePanel: {
|
|
70
|
-
({ as, children, collapsedWidth, expanded, expandedWidth, onAnimationEnd, onAnimationStart, onExpandedChange, onStateTransition, origin, touched, ...elemProps }: SidePanelProps): jsx.JSX.Element;
|
|
70
|
+
({ as, children, collapsedWidth, expanded, expandedWidth, onAnimationEnd, onAnimationStart, onExpandedChange, onStateTransition, origin, variant, touched, ...elemProps }: SidePanelProps): jsx.JSX.Element;
|
|
71
71
|
ToggleButton: ({ variant, icon, tooltipTextExpand: expandLabel, tooltipTextCollapse: collapseLabel, ...rest }: ToggleButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>) => jsx.JSX.Element;
|
|
72
72
|
};
|
|
73
|
-
export declare type ToggleButtonProps =
|
|
73
|
+
export declare type ToggleButtonProps = TertiaryButtonProps & {
|
|
74
74
|
/**
|
|
75
75
|
* The tooltip text to expand the side panel
|
|
76
76
|
* @default 'Expand'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanel.tsx"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,eAAe;AACf,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanel.tsx"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,eAAe;AACf,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAM,GAAG,EAAuB,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAiB,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AAKrF,oBAAY,gBAAgB,GAAG,UAAU,GAAG,WAAW,CAAC;AACxD,oBAAY,yBAAyB,GAAG,WAAW,GAAG,YAAY,GAAG,UAAU,GAAG,WAAW,CAAC;AAE9F,MAAM,WAAW,cAAe,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC1E;;;;OAIG;IACH,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACvB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,yBAAyB,KAAK,IAAI,CAAC;IAChE;;;;OAIG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAsCD,eAAO,MAAM,gBAAgB;;;EAG3B,CAAC;AAEH,QAAA,MAAM,SAAS;+KAcZ,cAAc;mHA0Gd,iBAAiB,GAAG,MAAM,oBAAoB,CAAC,iBAAiB,CAAC;CAxBnE,CAAC;AAEF,oBAAY,iBAAiB,GAAG,mBAAmB,GAAG;IACpD;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAgDF,eAAe,SAAS,CAAC"}
|
|
@@ -55,7 +55,6 @@ var button_1 = require("@workday/canvas-kit-react/button");
|
|
|
55
55
|
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
56
56
|
var canvas_system_icons_web_1 = require("@workday/canvas-system-icons-web");
|
|
57
57
|
var tooltip_1 = require("@workday/canvas-kit-react/tooltip");
|
|
58
|
-
var layout_1 = require("@workday/canvas-kit-react/layout");
|
|
59
58
|
var createKeyframes = function (from, to) {
|
|
60
59
|
var normalized = {
|
|
61
60
|
from: typeof from === 'number' ? from + 'px' : from,
|
|
@@ -63,7 +62,13 @@ var createKeyframes = function (from, to) {
|
|
|
63
62
|
};
|
|
64
63
|
return react_1.keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n from {\n width: ", ";\n min-width: ", ";\n max-width: ", ";\n } to {\n width: ", ";\n min-width: ", ";\n max-width: ", ";\n }\n "], ["\n from {\n width: ", ";\n min-width: ", ";\n max-width: ", ";\n } to {\n width: ", ";\n min-width: ", ";\n max-width: ", ";\n }\n "])), normalized.from, normalized.from, normalized.from, normalized.to, normalized.to, normalized.to);
|
|
65
64
|
};
|
|
66
|
-
var
|
|
65
|
+
var containerVariantStyle = {
|
|
66
|
+
alternate: __assign({ backgroundColor: tokens_1.colors.frenchVanilla100 }, tokens_1.depth[5]),
|
|
67
|
+
standard: {
|
|
68
|
+
backgroundColor: tokens_1.colors.soap100,
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
var Panel = common_1.styled('section')({
|
|
67
72
|
overflow: 'hidden',
|
|
68
73
|
position: 'relative',
|
|
69
74
|
boxSizing: 'border-box',
|
|
@@ -74,10 +79,8 @@ exports.SidePanelContext = React.createContext({
|
|
|
74
79
|
origin: 'left',
|
|
75
80
|
});
|
|
76
81
|
var SidePanel = function (_a) {
|
|
77
|
-
var _b = _a.as, as = _b === void 0 ? 'section' : _b, children = _a.children, _c = _a.collapsedWidth, collapsedWidth = _c === void 0 ? 64 : _c, _d = _a.expanded, expanded = _d === void 0 ? true : _d, _e = _a.expandedWidth, expandedWidth = _e === void 0 ? 320 : _e, onAnimationEnd = _a.onAnimationEnd, onAnimationStart = _a.onAnimationStart, onExpandedChange = _a.onExpandedChange, onStateTransition = _a.onStateTransition, _f = _a.origin, origin = _f === void 0 ? 'left' : _f,
|
|
78
|
-
|
|
79
|
-
touched = _a.touched, elemProps = __rest(_a, ["as", "children", "collapsedWidth", "expanded", "expandedWidth", "onAnimationEnd", "onAnimationStart", "onExpandedChange", "onStateTransition", "origin", "touched"]);
|
|
80
|
-
var _g = React.useState(expanded ? 'expanded' : 'collapsed'), state = _g[0], setState = _g[1];
|
|
82
|
+
var _b = _a.as, as = _b === void 0 ? 'section' : _b, children = _a.children, _c = _a.collapsedWidth, collapsedWidth = _c === void 0 ? 64 : _c, _d = _a.expanded, expanded = _d === void 0 ? true : _d, _e = _a.expandedWidth, expandedWidth = _e === void 0 ? 320 : _e, onAnimationEnd = _a.onAnimationEnd, onAnimationStart = _a.onAnimationStart, onExpandedChange = _a.onExpandedChange, onStateTransition = _a.onStateTransition, _f = _a.origin, origin = _f === void 0 ? 'left' : _f, _g = _a.variant, variant = _g === void 0 ? 'standard' : _g, touched = _a.touched, elemProps = __rest(_a, ["as", "children", "collapsedWidth", "expanded", "expandedWidth", "onAnimationEnd", "onAnimationStart", "onExpandedChange", "onStateTransition", "origin", "variant", "touched"]);
|
|
83
|
+
var _h = React.useState(expanded ? 'expanded' : 'collapsed'), state = _h[0], setState = _h[1];
|
|
81
84
|
React.useEffect(function () {
|
|
82
85
|
if (typeof onExpandedChange !== 'undefined') {
|
|
83
86
|
onExpandedChange(expanded);
|
|
@@ -116,7 +119,18 @@ var SidePanel = function (_a) {
|
|
|
116
119
|
onAnimationStart(event);
|
|
117
120
|
}
|
|
118
121
|
};
|
|
119
|
-
return (react_1.jsx(
|
|
122
|
+
return (react_1.jsx(Panel, __assign({ as: as, css: [
|
|
123
|
+
{
|
|
124
|
+
width: expanded ? expandedWidth : collapsedWidth,
|
|
125
|
+
maxWidth: expanded ? expandedWidth : collapsedWidth,
|
|
126
|
+
// mounted.current will be false on the first render, thus you won't get an unwanted animation here
|
|
127
|
+
// Will animate again if you force a re-render (like in Storybook)
|
|
128
|
+
animation: touched
|
|
129
|
+
? (expanded ? motion.expand : motion.collapse) + " 200ms ease-out"
|
|
130
|
+
: undefined,
|
|
131
|
+
},
|
|
132
|
+
containerVariantStyle[variant],
|
|
133
|
+
], onAnimationEnd: handleAnimationEnd, onAnimationStart: handleAnimationStart }, elemProps),
|
|
120
134
|
react_1.jsx(exports.SidePanelContext.Provider, { value: {
|
|
121
135
|
state: state,
|
|
122
136
|
origin: origin,
|
|
@@ -126,7 +140,7 @@ var SidePanel = function (_a) {
|
|
|
126
140
|
* A toggle button styled specifically for the side panel container.
|
|
127
141
|
*/
|
|
128
142
|
var ToggleButton = function (_a) {
|
|
129
|
-
var _b = _a.variant, variant = _b === void 0 ?
|
|
143
|
+
var _b = _a.variant, variant = _b === void 0 ? undefined : _b, _c = _a.icon, icon = _c === void 0 ? canvas_system_icons_web_1.transformationImportIcon : _c, _d = _a.tooltipTextExpand, expandLabel = _d === void 0 ? 'Expand' : _d, _e = _a.tooltipTextCollapse, collapseLabel = _e === void 0 ? 'Collapse' : _e, rest = __rest(_a, ["variant", "icon", "tooltipTextExpand", "tooltipTextCollapse"]);
|
|
130
144
|
var context = React.useContext(exports.SidePanelContext);
|
|
131
145
|
var useRTLOrigin = function () {
|
|
132
146
|
var isRTL = common_1.useIsRTL();
|
|
@@ -142,6 +156,7 @@ var ToggleButton = function (_a) {
|
|
|
142
156
|
var buttonStyle = react_1.css({
|
|
143
157
|
position: 'absolute',
|
|
144
158
|
top: tokens_1.space.m,
|
|
159
|
+
width: tokens_1.space.l,
|
|
145
160
|
right: context.state === 'collapsed' ? 0 : rtlOrigin === 'left' ? tokens_1.space.s : undefined,
|
|
146
161
|
left: context.state === 'collapsed' ? 0 : rtlOrigin === 'right' ? tokens_1.space.s : undefined,
|
|
147
162
|
margin: context.state === 'collapsed' ? 'auto' : 0,
|
|
@@ -150,7 +165,7 @@ var ToggleButton = function (_a) {
|
|
|
150
165
|
: "scaleX(" + (rtlOrigin === 'left' ? '-1' : '1') + ")",
|
|
151
166
|
});
|
|
152
167
|
return (react_1.jsx(tooltip_1.Tooltip, { title: context.state === 'collapsed' ? expandLabel : collapseLabel, type: "muted" },
|
|
153
|
-
react_1.jsx(button_1.
|
|
168
|
+
react_1.jsx(button_1.TertiaryButton, __assign({ type: "button", css: buttonStyle, icon: icon, variant: variant }, rest))));
|
|
154
169
|
};
|
|
155
170
|
SidePanel.ToggleButton = ToggleButton;
|
|
156
171
|
exports.default = SidePanel;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { CanvasSystemIcon } from '@workday/design-assets-types';
|
|
3
|
-
export interface DropdownButtonProps extends
|
|
3
|
+
export interface DropdownButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
4
4
|
/**
|
|
5
5
|
* The accessibility label for the button
|
|
6
6
|
*/
|
|
@@ -16,5 +16,5 @@ export interface DropdownButtonProps extends IconButtonProps {
|
|
|
16
16
|
*/
|
|
17
17
|
toggled: boolean;
|
|
18
18
|
}
|
|
19
|
-
export declare const DropdownButton: import("@workday/canvas-kit-react/common").ElementComponent<
|
|
19
|
+
export declare const DropdownButton: import("@workday/canvas-kit-react/common").ElementComponent<"button", DropdownButtonProps>;
|
|
20
20
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../../breadcrumbs/lib/Breadcrumbs/Dropdown/Button.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../../breadcrumbs/lib/Breadcrumbs/Dropdown/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAI9D,MAAM,WAAW,mBAAoB,SAAQ,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC;IAClF;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,cAAc,4FA2BzB,CAAC"}
|
|
@@ -21,15 +21,43 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import React from 'react';
|
|
24
|
-
import {
|
|
24
|
+
import { BaseButton } from '@workday/canvas-kit-react/button';
|
|
25
25
|
import { relatedActionsIcon } from '@workday/canvas-system-icons-web';
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
export var DropdownButton = createComponent(
|
|
26
|
+
import { createComponent, useTheme } from '@workday/canvas-kit-react/common';
|
|
27
|
+
import { colors, space } from '@workday/canvas-kit-react/tokens';
|
|
28
|
+
export var DropdownButton = createComponent('button')({
|
|
29
29
|
displayName: 'DropdownButton',
|
|
30
30
|
Component: function (_a, ref, Element) {
|
|
31
|
-
var _b = _a.buttonIcon, buttonIcon = _b === void 0 ? relatedActionsIcon : _b, toggled = _a.toggled,
|
|
32
|
-
var
|
|
33
|
-
return (React.createElement(
|
|
31
|
+
var _b = _a.buttonIcon, buttonIcon = _b === void 0 ? relatedActionsIcon : _b, toggled = _a.toggled, elemProps = __rest(_a, ["buttonIcon", "toggled"]);
|
|
32
|
+
var theme = useTheme();
|
|
33
|
+
return (React.createElement(BaseButton, __assign({ as: Element, ref: ref, "aria-pressed": undefined, "aria-expanded": toggled, "aria-haspopup": true, "aria-controls": "menu", size: "small", height: space.l, width: space.l, padding: space.zero, colors: getDropdownColors(toggled, theme) }, elemProps),
|
|
34
|
+
React.createElement(BaseButton.Icon, { icon: buttonIcon })));
|
|
34
35
|
},
|
|
35
36
|
});
|
|
37
|
+
var getDropdownColors = function (toggled, theme) {
|
|
38
|
+
var themePrimary = theme.canvas.palette.primary;
|
|
39
|
+
return {
|
|
40
|
+
default: {
|
|
41
|
+
icon: toggled ? themePrimary.main : colors.blackPepper400,
|
|
42
|
+
label: themePrimary.main,
|
|
43
|
+
},
|
|
44
|
+
hover: {
|
|
45
|
+
background: colors.soap200,
|
|
46
|
+
icon: toggled ? themePrimary.dark : colors.blackPepper500,
|
|
47
|
+
label: themePrimary.dark,
|
|
48
|
+
},
|
|
49
|
+
active: {
|
|
50
|
+
background: colors.soap300,
|
|
51
|
+
icon: toggled ? themePrimary.dark : colors.blackPepper500,
|
|
52
|
+
label: themePrimary.dark,
|
|
53
|
+
},
|
|
54
|
+
focus: {
|
|
55
|
+
icon: toggled ? themePrimary.main : colors.blackPepper500,
|
|
56
|
+
label: themePrimary.main,
|
|
57
|
+
},
|
|
58
|
+
disabled: {
|
|
59
|
+
icon: toggled ? themePrimary.main : colors.blackPepper400,
|
|
60
|
+
label: themePrimary.main,
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
};
|
|
@@ -26,7 +26,7 @@ import { borderRadius, colors, commonColors, depth, space, type, } from '@workda
|
|
|
26
26
|
// local components
|
|
27
27
|
import { DropdownMenuItemLink } from './MenuItemLink';
|
|
28
28
|
import { Box } from '@workday/canvas-kit-react/layout';
|
|
29
|
-
var StyledDropdownMenu = styled(Box)(__assign(__assign(__assign({}, type.levels.subtext.large), depth[
|
|
29
|
+
var StyledDropdownMenu = styled(Box)(__assign(__assign(__assign({}, type.levels.subtext.large), depth[3]), { backgroundColor: commonColors.background, border: "1px solid " + colors.soap500, borderRadius: borderRadius.m, boxSizing: 'border-box', display: 'inline-block', marginTop: space.xxxs, maxHeight: 200, outline: 'none', overflowY: 'auto', position: 'relative', width: 'max-content' }));
|
|
30
30
|
var StyledMenuList = styled('ul')({
|
|
31
31
|
boxSizing: 'border-box',
|
|
32
32
|
listStyle: 'none',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurrentItem.d.ts","sourceRoot":"","sources":["../../../../../../breadcrumbs/lib/Breadcrumbs/List/CurrentItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC;IAC3E;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;
|
|
1
|
+
{"version":3,"file":"CurrentItem.d.ts","sourceRoot":"","sources":["../../../../../../breadcrumbs/lib/Breadcrumbs/List/CurrentItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC;IAC3E;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAiBD,eAAO,MAAM,WAAW,yCAAwC,gBAAgB,gBA8B/E,CAAC"}
|
|
@@ -27,7 +27,7 @@ import { TooltipContainer } from '@workday/canvas-kit-react/tooltip';
|
|
|
27
27
|
import { Popper } from '@workday/canvas-kit-react/popup';
|
|
28
28
|
import { useTruncateTooltip } from './hooks';
|
|
29
29
|
import { truncateStyles } from './styles';
|
|
30
|
-
var ListItem = styled('li')(__assign({ display: 'flex', alignItems: 'center', flexDirection: 'column', textAlign: 'left' }, type.levels.subtext.large), function (_a) {
|
|
30
|
+
var ListItem = styled('li')(__assign(__assign({ display: 'flex', alignItems: 'center', flexDirection: 'column', textAlign: 'left' }, type.levels.subtext.large), { fontWeight: 500 }), function (_a) {
|
|
31
31
|
var maxWidth = _a.maxWidth;
|
|
32
32
|
return (__assign({}, truncateStyles(maxWidth)));
|
|
33
33
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../../../../breadcrumbs/lib/Breadcrumbs/List/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,oBAAY,aAAa,GAAG,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;AAEhE,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../../../../breadcrumbs/lib/Breadcrumbs/List/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,oBAAY,aAAa,GAAG,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;AAEhE,eAAO,MAAM,mBAAmB,wDAmB/B,CAAC"}
|
|
@@ -32,5 +32,5 @@ export var BreadcrumbsListItem = function (_a) {
|
|
|
32
32
|
var icon = shouldUseRTL ? chevronLeftSmallIcon : chevronRightSmallIcon;
|
|
33
33
|
return (React.createElement(Flex, __assign({ as: "li", alignItems: "center" }, props),
|
|
34
34
|
children,
|
|
35
|
-
React.createElement(SystemIcon, { icon: icon, color: colors.licorice200, colorHover: colors.licorice200, "aria-hidden": true })));
|
|
35
|
+
React.createElement(SystemIcon, { icon: icon, color: colors.licorice200, colorHover: colors.licorice200, size: 20, height: 32, width: 32, styles: { justifyContent: 'center', alignItems: 'center', display: 'inline-flex' }, "aria-hidden": true })));
|
|
36
36
|
};
|
|
@@ -23,7 +23,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
23
23
|
import { colors, space } from '@workday/canvas-kit-react/tokens';
|
|
24
24
|
import { checkIcon } from '@workday/canvas-system-icons-web';
|
|
25
25
|
import { ColorInput } from '@workday/canvas-kit-react/color-picker';
|
|
26
|
-
import {
|
|
26
|
+
import { SecondaryButton } from '@workday/canvas-kit-react/button';
|
|
27
27
|
import * as React from 'react';
|
|
28
28
|
import FormField from '@workday/canvas-kit-react/form-field';
|
|
29
29
|
import styled from '@emotion/styled';
|
|
@@ -102,7 +102,7 @@ var ColorInputAndLabel = styled(FormField)({
|
|
|
102
102
|
flexDirection: 'column',
|
|
103
103
|
margin: 0,
|
|
104
104
|
});
|
|
105
|
-
var CheckButton = styled(
|
|
105
|
+
var CheckButton = styled(SecondaryButton)({
|
|
106
106
|
alignSelf: 'flex-end',
|
|
107
107
|
});
|
|
108
108
|
var HexColorInput = styled(ColorInput)({
|
|
@@ -137,7 +137,7 @@ var ColorPicker = function (_a) {
|
|
|
137
137
|
showCustomHexInput && (React.createElement(ColorInputWrapper, { onSubmit: onSubmit },
|
|
138
138
|
React.createElement(ColorInputAndLabel, { label: customHexInputLabel },
|
|
139
139
|
React.createElement(HexColorInput, { onChange: onCustomHexChange, onValidColorChange: onValidCustomHexChange, value: customHexValue, showCheck: value === validHexValue || value === customHexValue })),
|
|
140
|
-
React.createElement(CheckButton, { "aria-label": submitLabel,
|
|
140
|
+
React.createElement(CheckButton, { "aria-label": submitLabel, icon: checkIcon })))));
|
|
141
141
|
};
|
|
142
142
|
ColorPicker.defaultColorSet = defaultColorSet;
|
|
143
143
|
export default ColorPicker;
|
|
@@ -244,7 +244,7 @@ var Menu = /** @class */ (function (_super) {
|
|
|
244
244
|
var _a = this.props, _b = _a.id, id = _b === void 0 ? this.id : _b, _c = _a.isOpen, isOpen = _c === void 0 ? true : _c, children = _a.children, ariaLabelledby = _a["aria-labelledby"], grow = _a.grow, width = _a.width, onSelect = _a.onSelect, onClose = _a.onClose, initialSelectedItem = _a.initialSelectedItem, elemProps = __rest(_a, ["id", "isOpen", "children", 'aria-labelledby', "grow", "width", "onSelect", "onClose", "initialSelectedItem"]);
|
|
245
245
|
var selectedItemIndex = this.state.selectedItemIndex;
|
|
246
246
|
var cardWidth = grow ? '100%' : width;
|
|
247
|
-
return (React.createElement(Card, { style: { display: 'inline-block' }, padding: space.zero, width: cardWidth },
|
|
247
|
+
return (React.createElement(Card, { style: { display: 'inline-block' }, padding: space.zero, width: cardWidth, depth: 3 },
|
|
248
248
|
React.createElement(Card.Body, null,
|
|
249
249
|
React.createElement(List, __assign({ role: "menu", tabIndex: 0, id: id, "aria-labelledby": ariaLabelledby, "aria-activedescendant": id + "-" + selectedItemIndex, onKeyDown: this.handleKeyboardShortcuts, ref: this.menuRef }, elemProps), React.Children.map(children, function (menuItem, index) {
|
|
250
250
|
if (!React.isValidElement(menuItem)) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { jsx } from '@emotion/react';
|
|
5
|
-
import {
|
|
5
|
+
import { TertiaryButtonProps } from '@workday/canvas-kit-react/button';
|
|
6
6
|
export declare type SidePanelVariant = 'standard' | 'alternate';
|
|
7
7
|
export declare type SidePanelTransitionStates = 'collapsed' | 'collapsing' | 'expanded' | 'expanding';
|
|
8
8
|
export interface SidePanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -50,7 +50,7 @@ export interface SidePanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
50
50
|
*/
|
|
51
51
|
onStateTransition?: (state?: SidePanelTransitionStates) => void;
|
|
52
52
|
/**
|
|
53
|
-
* The style variant of the side panel. 'standard' is with a `soap100` background, no depth. 'alternate' is a `frenchVanilla100` background with a level
|
|
53
|
+
* The style variant of the side panel. 'standard' is with a `soap100` background, no depth. 'alternate' is a `frenchVanilla100` background with a level 6 depth.
|
|
54
54
|
*
|
|
55
55
|
* @default 'standard'
|
|
56
56
|
*/
|
|
@@ -67,10 +67,10 @@ export declare const SidePanelContext: React.Context<{
|
|
|
67
67
|
origin: string;
|
|
68
68
|
}>;
|
|
69
69
|
declare const SidePanel: {
|
|
70
|
-
({ as, children, collapsedWidth, expanded, expandedWidth, onAnimationEnd, onAnimationStart, onExpandedChange, onStateTransition, origin, touched, ...elemProps }: SidePanelProps): jsx.JSX.Element;
|
|
70
|
+
({ as, children, collapsedWidth, expanded, expandedWidth, onAnimationEnd, onAnimationStart, onExpandedChange, onStateTransition, origin, variant, touched, ...elemProps }: SidePanelProps): jsx.JSX.Element;
|
|
71
71
|
ToggleButton: ({ variant, icon, tooltipTextExpand: expandLabel, tooltipTextCollapse: collapseLabel, ...rest }: ToggleButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>) => jsx.JSX.Element;
|
|
72
72
|
};
|
|
73
|
-
export declare type ToggleButtonProps =
|
|
73
|
+
export declare type ToggleButtonProps = TertiaryButtonProps & {
|
|
74
74
|
/**
|
|
75
75
|
* The tooltip text to expand the side panel
|
|
76
76
|
* @default 'Expand'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanel.tsx"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,eAAe;AACf,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanel.tsx"],"names":[],"mappings":"AAAA,0BAA0B;AAC1B,eAAe;AACf,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAM,GAAG,EAAuB,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAiB,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AAKrF,oBAAY,gBAAgB,GAAG,UAAU,GAAG,WAAW,CAAC;AACxD,oBAAY,yBAAyB,GAAG,WAAW,GAAG,YAAY,GAAG,UAAU,GAAG,WAAW,CAAC;AAE9F,MAAM,WAAW,cAAe,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC1E;;;;OAIG;IACH,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACvB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,yBAAyB,KAAK,IAAI,CAAC;IAChE;;;;OAIG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B;;;;OAIG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAsCD,eAAO,MAAM,gBAAgB;;;EAG3B,CAAC;AAEH,QAAA,MAAM,SAAS;+KAcZ,cAAc;mHA0Gd,iBAAiB,GAAG,MAAM,oBAAoB,CAAC,iBAAiB,CAAC;CAxBnE,CAAC;AAEF,oBAAY,iBAAiB,GAAG,mBAAmB,GAAG;IACpD;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAgDF,eAAe,SAAS,CAAC"}
|
|
@@ -29,11 +29,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
29
29
|
import * as React from 'react';
|
|
30
30
|
import { styled, useIsRTL } from '@workday/canvas-kit-react/common';
|
|
31
31
|
import { css, jsx, keyframes } from '@emotion/react';
|
|
32
|
-
import {
|
|
33
|
-
import { space, colors } from '@workday/canvas-kit-react/tokens';
|
|
32
|
+
import { TertiaryButton } from '@workday/canvas-kit-react/button';
|
|
33
|
+
import { space, colors, depth } from '@workday/canvas-kit-react/tokens';
|
|
34
34
|
import { transformationImportIcon } from '@workday/canvas-system-icons-web';
|
|
35
35
|
import { Tooltip } from '@workday/canvas-kit-react/tooltip';
|
|
36
|
-
import { Box } from '@workday/canvas-kit-react/layout';
|
|
37
36
|
var createKeyframes = function (from, to) {
|
|
38
37
|
var normalized = {
|
|
39
38
|
from: typeof from === 'number' ? from + 'px' : from,
|
|
@@ -41,7 +40,13 @@ var createKeyframes = function (from, to) {
|
|
|
41
40
|
};
|
|
42
41
|
return keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n from {\n width: ", ";\n min-width: ", ";\n max-width: ", ";\n } to {\n width: ", ";\n min-width: ", ";\n max-width: ", ";\n }\n "], ["\n from {\n width: ", ";\n min-width: ", ";\n max-width: ", ";\n } to {\n width: ", ";\n min-width: ", ";\n max-width: ", ";\n }\n "])), normalized.from, normalized.from, normalized.from, normalized.to, normalized.to, normalized.to);
|
|
43
42
|
};
|
|
44
|
-
var
|
|
43
|
+
var containerVariantStyle = {
|
|
44
|
+
alternate: __assign({ backgroundColor: colors.frenchVanilla100 }, depth[5]),
|
|
45
|
+
standard: {
|
|
46
|
+
backgroundColor: colors.soap100,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
var Panel = styled('section')({
|
|
45
50
|
overflow: 'hidden',
|
|
46
51
|
position: 'relative',
|
|
47
52
|
boxSizing: 'border-box',
|
|
@@ -52,10 +57,8 @@ export var SidePanelContext = React.createContext({
|
|
|
52
57
|
origin: 'left',
|
|
53
58
|
});
|
|
54
59
|
var SidePanel = function (_a) {
|
|
55
|
-
var _b = _a.as, as = _b === void 0 ? 'section' : _b, children = _a.children, _c = _a.collapsedWidth, collapsedWidth = _c === void 0 ? 64 : _c, _d = _a.expanded, expanded = _d === void 0 ? true : _d, _e = _a.expandedWidth, expandedWidth = _e === void 0 ? 320 : _e, onAnimationEnd = _a.onAnimationEnd, onAnimationStart = _a.onAnimationStart, onExpandedChange = _a.onExpandedChange, onStateTransition = _a.onStateTransition, _f = _a.origin, origin = _f === void 0 ? 'left' : _f,
|
|
56
|
-
|
|
57
|
-
touched = _a.touched, elemProps = __rest(_a, ["as", "children", "collapsedWidth", "expanded", "expandedWidth", "onAnimationEnd", "onAnimationStart", "onExpandedChange", "onStateTransition", "origin", "touched"]);
|
|
58
|
-
var _g = React.useState(expanded ? 'expanded' : 'collapsed'), state = _g[0], setState = _g[1];
|
|
60
|
+
var _b = _a.as, as = _b === void 0 ? 'section' : _b, children = _a.children, _c = _a.collapsedWidth, collapsedWidth = _c === void 0 ? 64 : _c, _d = _a.expanded, expanded = _d === void 0 ? true : _d, _e = _a.expandedWidth, expandedWidth = _e === void 0 ? 320 : _e, onAnimationEnd = _a.onAnimationEnd, onAnimationStart = _a.onAnimationStart, onExpandedChange = _a.onExpandedChange, onStateTransition = _a.onStateTransition, _f = _a.origin, origin = _f === void 0 ? 'left' : _f, _g = _a.variant, variant = _g === void 0 ? 'standard' : _g, touched = _a.touched, elemProps = __rest(_a, ["as", "children", "collapsedWidth", "expanded", "expandedWidth", "onAnimationEnd", "onAnimationStart", "onExpandedChange", "onStateTransition", "origin", "variant", "touched"]);
|
|
61
|
+
var _h = React.useState(expanded ? 'expanded' : 'collapsed'), state = _h[0], setState = _h[1];
|
|
59
62
|
React.useEffect(function () {
|
|
60
63
|
if (typeof onExpandedChange !== 'undefined') {
|
|
61
64
|
onExpandedChange(expanded);
|
|
@@ -94,7 +97,18 @@ var SidePanel = function (_a) {
|
|
|
94
97
|
onAnimationStart(event);
|
|
95
98
|
}
|
|
96
99
|
};
|
|
97
|
-
return (jsx(
|
|
100
|
+
return (jsx(Panel, __assign({ as: as, css: [
|
|
101
|
+
{
|
|
102
|
+
width: expanded ? expandedWidth : collapsedWidth,
|
|
103
|
+
maxWidth: expanded ? expandedWidth : collapsedWidth,
|
|
104
|
+
// mounted.current will be false on the first render, thus you won't get an unwanted animation here
|
|
105
|
+
// Will animate again if you force a re-render (like in Storybook)
|
|
106
|
+
animation: touched
|
|
107
|
+
? (expanded ? motion.expand : motion.collapse) + " 200ms ease-out"
|
|
108
|
+
: undefined,
|
|
109
|
+
},
|
|
110
|
+
containerVariantStyle[variant],
|
|
111
|
+
], onAnimationEnd: handleAnimationEnd, onAnimationStart: handleAnimationStart }, elemProps),
|
|
98
112
|
jsx(SidePanelContext.Provider, { value: {
|
|
99
113
|
state: state,
|
|
100
114
|
origin: origin,
|
|
@@ -104,7 +118,7 @@ var SidePanel = function (_a) {
|
|
|
104
118
|
* A toggle button styled specifically for the side panel container.
|
|
105
119
|
*/
|
|
106
120
|
var ToggleButton = function (_a) {
|
|
107
|
-
var _b = _a.variant, variant = _b === void 0 ?
|
|
121
|
+
var _b = _a.variant, variant = _b === void 0 ? undefined : _b, _c = _a.icon, icon = _c === void 0 ? transformationImportIcon : _c, _d = _a.tooltipTextExpand, expandLabel = _d === void 0 ? 'Expand' : _d, _e = _a.tooltipTextCollapse, collapseLabel = _e === void 0 ? 'Collapse' : _e, rest = __rest(_a, ["variant", "icon", "tooltipTextExpand", "tooltipTextCollapse"]);
|
|
108
122
|
var context = React.useContext(SidePanelContext);
|
|
109
123
|
var useRTLOrigin = function () {
|
|
110
124
|
var isRTL = useIsRTL();
|
|
@@ -120,6 +134,7 @@ var ToggleButton = function (_a) {
|
|
|
120
134
|
var buttonStyle = css({
|
|
121
135
|
position: 'absolute',
|
|
122
136
|
top: space.m,
|
|
137
|
+
width: space.l,
|
|
123
138
|
right: context.state === 'collapsed' ? 0 : rtlOrigin === 'left' ? space.s : undefined,
|
|
124
139
|
left: context.state === 'collapsed' ? 0 : rtlOrigin === 'right' ? space.s : undefined,
|
|
125
140
|
margin: context.state === 'collapsed' ? 'auto' : 0,
|
|
@@ -128,7 +143,7 @@ var ToggleButton = function (_a) {
|
|
|
128
143
|
: "scaleX(" + (rtlOrigin === 'left' ? '-1' : '1') + ")",
|
|
129
144
|
});
|
|
130
145
|
return (jsx(Tooltip, { title: context.state === 'collapsed' ? expandLabel : collapseLabel, type: "muted" },
|
|
131
|
-
jsx(
|
|
146
|
+
jsx(TertiaryButton, __assign({ type: "button", css: buttonStyle, icon: icon, variant: variant }, rest))));
|
|
132
147
|
};
|
|
133
148
|
SidePanel.ToggleButton = ToggleButton;
|
|
134
149
|
export default SidePanel;
|
package/menu/lib/Menu.tsx
CHANGED
|
@@ -121,7 +121,7 @@ export default class Menu extends React.Component<MenuProps, MenuState> {
|
|
|
121
121
|
const cardWidth = grow ? '100%' : width;
|
|
122
122
|
|
|
123
123
|
return (
|
|
124
|
-
<Card style={{display: 'inline-block'}} padding={space.zero} width={cardWidth}>
|
|
124
|
+
<Card style={{display: 'inline-block'}} padding={space.zero} width={cardWidth} depth={3}>
|
|
125
125
|
<Card.Body>
|
|
126
126
|
<List
|
|
127
127
|
role="menu"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-preview-react",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.80-next.8+3b8329ea",
|
|
4
4
|
"description": "Canvas Kit Preview is made up of components that have the full design and a11y review, are part of the DS ecosystem and are approved for use in product. The API's could be subject to change, but not without strong communication and migration strategies.",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -54,15 +54,15 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@emotion/react": "^11.7.1",
|
|
56
56
|
"@emotion/styled": "^11.6.0",
|
|
57
|
-
"@workday/canvas-kit-react": "^7.0.0-alpha.
|
|
57
|
+
"@workday/canvas-kit-react": "^7.0.0-alpha.80-next.8+3b8329ea",
|
|
58
58
|
"@workday/canvas-system-icons-web": "1.0.41",
|
|
59
59
|
"@workday/design-assets-types": "^0.2.4"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@workday/canvas-accent-icons-web": "^1.0.0",
|
|
63
|
-
"@workday/canvas-kit-labs-react": "^7.0.0-alpha.
|
|
63
|
+
"@workday/canvas-kit-labs-react": "^7.0.0-alpha.80-next.8+3b8329ea",
|
|
64
64
|
"formik": "^2.2.9",
|
|
65
65
|
"yup": "^0.31.1"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "3b8329ea5b2bf21433f650155898b5b15c36a675"
|
|
68
68
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import {styled, useIsRTL
|
|
5
|
-
import {css, jsx, keyframes} from '@emotion/react';
|
|
6
|
-
import {
|
|
7
|
-
import {space, colors} from '@workday/canvas-kit-react/tokens';
|
|
4
|
+
import {styled, useIsRTL} from '@workday/canvas-kit-react/common';
|
|
5
|
+
import {css, jsx, keyframes, CSSObject} from '@emotion/react';
|
|
6
|
+
import {TertiaryButton, TertiaryButtonProps} from '@workday/canvas-kit-react/button';
|
|
7
|
+
import {space, colors, depth} from '@workday/canvas-kit-react/tokens';
|
|
8
8
|
import {transformationImportIcon} from '@workday/canvas-system-icons-web';
|
|
9
9
|
import {Tooltip} from '@workday/canvas-kit-react/tooltip';
|
|
10
|
-
import {Box} from '@workday/canvas-kit-react/layout';
|
|
11
10
|
|
|
12
11
|
export type SidePanelVariant = 'standard' | 'alternate';
|
|
13
12
|
export type SidePanelTransitionStates = 'collapsed' | 'collapsing' | 'expanded' | 'expanding';
|
|
@@ -57,7 +56,7 @@ export interface SidePanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
57
56
|
*/
|
|
58
57
|
onStateTransition?: (state?: SidePanelTransitionStates) => void;
|
|
59
58
|
/**
|
|
60
|
-
* The style variant of the side panel. 'standard' is with a `soap100` background, no depth. 'alternate' is a `frenchVanilla100` background with a level
|
|
59
|
+
* The style variant of the side panel. 'standard' is with a `soap100` background, no depth. 'alternate' is a `frenchVanilla100` background with a level 6 depth.
|
|
61
60
|
*
|
|
62
61
|
* @default 'standard'
|
|
63
62
|
*/
|
|
@@ -89,7 +88,17 @@ const createKeyframes = (from: number | string, to: number | string) => {
|
|
|
89
88
|
`;
|
|
90
89
|
};
|
|
91
90
|
|
|
92
|
-
const
|
|
91
|
+
const containerVariantStyle: Record<SidePanelVariant, CSSObject> = {
|
|
92
|
+
alternate: {
|
|
93
|
+
backgroundColor: colors.frenchVanilla100,
|
|
94
|
+
...depth[5],
|
|
95
|
+
},
|
|
96
|
+
standard: {
|
|
97
|
+
backgroundColor: colors.soap100,
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const Panel = styled('section')<Pick<SidePanelProps, 'as'>>({
|
|
93
102
|
overflow: 'hidden',
|
|
94
103
|
position: 'relative',
|
|
95
104
|
boxSizing: 'border-box',
|
|
@@ -112,7 +121,7 @@ const SidePanel = ({
|
|
|
112
121
|
onExpandedChange,
|
|
113
122
|
onStateTransition,
|
|
114
123
|
origin = 'left',
|
|
115
|
-
|
|
124
|
+
variant = 'standard',
|
|
116
125
|
touched,
|
|
117
126
|
...elemProps
|
|
118
127
|
}: SidePanelProps) => {
|
|
@@ -169,15 +178,20 @@ const SidePanel = ({
|
|
|
169
178
|
};
|
|
170
179
|
|
|
171
180
|
return (
|
|
172
|
-
<
|
|
181
|
+
<Panel
|
|
173
182
|
as={as}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
183
|
+
css={[
|
|
184
|
+
{
|
|
185
|
+
width: expanded ? expandedWidth : collapsedWidth,
|
|
186
|
+
maxWidth: expanded ? expandedWidth : collapsedWidth,
|
|
187
|
+
// mounted.current will be false on the first render, thus you won't get an unwanted animation here
|
|
188
|
+
// Will animate again if you force a re-render (like in Storybook)
|
|
189
|
+
animation: touched
|
|
190
|
+
? `${expanded ? motion.expand : motion.collapse} 200ms ease-out`
|
|
191
|
+
: undefined,
|
|
192
|
+
},
|
|
193
|
+
containerVariantStyle[variant],
|
|
194
|
+
]}
|
|
181
195
|
onAnimationEnd={handleAnimationEnd}
|
|
182
196
|
onAnimationStart={handleAnimationStart}
|
|
183
197
|
{...elemProps}
|
|
@@ -190,11 +204,11 @@ const SidePanel = ({
|
|
|
190
204
|
>
|
|
191
205
|
{children}
|
|
192
206
|
</SidePanelContext.Provider>
|
|
193
|
-
</
|
|
207
|
+
</Panel>
|
|
194
208
|
);
|
|
195
209
|
};
|
|
196
210
|
|
|
197
|
-
export type ToggleButtonProps =
|
|
211
|
+
export type ToggleButtonProps = TertiaryButtonProps & {
|
|
198
212
|
/**
|
|
199
213
|
* The tooltip text to expand the side panel
|
|
200
214
|
* @default 'Expand'
|
|
@@ -211,7 +225,7 @@ export type ToggleButtonProps = IconButtonProps & {
|
|
|
211
225
|
* A toggle button styled specifically for the side panel container.
|
|
212
226
|
*/
|
|
213
227
|
const ToggleButton = ({
|
|
214
|
-
variant =
|
|
228
|
+
variant = undefined,
|
|
215
229
|
icon = transformationImportIcon,
|
|
216
230
|
tooltipTextExpand: expandLabel = 'Expand',
|
|
217
231
|
tooltipTextCollapse: collapseLabel = 'Collapse',
|
|
@@ -235,9 +249,10 @@ const ToggleButton = ({
|
|
|
235
249
|
const buttonStyle = css({
|
|
236
250
|
position: 'absolute',
|
|
237
251
|
top: space.m,
|
|
252
|
+
width: space.l,
|
|
238
253
|
right: context.state === 'collapsed' ? 0 : rtlOrigin === 'left' ? space.s : undefined,
|
|
239
254
|
left: context.state === 'collapsed' ? 0 : rtlOrigin === 'right' ? space.s : undefined,
|
|
240
|
-
margin: context.state === 'collapsed' ? 'auto' : 0, // to override the -8px margin for
|
|
255
|
+
margin: context.state === 'collapsed' ? 'auto' : 0, // to override the -8px margin for TertiaryButton.Plain
|
|
241
256
|
transform:
|
|
242
257
|
context.state === 'collapsed' || context.state === 'collapsing'
|
|
243
258
|
? `scaleX(${rtlOrigin === 'left' ? '1' : '-1'})`
|
|
@@ -246,7 +261,7 @@ const ToggleButton = ({
|
|
|
246
261
|
|
|
247
262
|
return (
|
|
248
263
|
<Tooltip title={context.state === 'collapsed' ? expandLabel : collapseLabel} type="muted">
|
|
249
|
-
<
|
|
264
|
+
<TertiaryButton type="button" css={buttonStyle} icon={icon} variant={variant} {...rest} />
|
|
250
265
|
</Tooltip>
|
|
251
266
|
);
|
|
252
267
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { CanvasSystemIcon } from '@workday/design-assets-types';
|
|
3
|
-
export interface DropdownButtonProps extends
|
|
3
|
+
export interface DropdownButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
4
4
|
/**
|
|
5
5
|
* The accessibility label for the button
|
|
6
6
|
*/
|
|
@@ -16,5 +16,5 @@ export interface DropdownButtonProps extends IconButtonProps {
|
|
|
16
16
|
*/
|
|
17
17
|
toggled: boolean;
|
|
18
18
|
}
|
|
19
|
-
export declare const DropdownButton: import("@workday/canvas-kit-react/common").ElementComponent<
|
|
19
|
+
export declare const DropdownButton: import("@workday/canvas-kit-react/common").ElementComponent<"button", DropdownButtonProps>;
|
|
20
20
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { jsx } from '@emotion/react';
|
|
5
|
-
import {
|
|
5
|
+
import { TertiaryButtonProps } from '@workday/canvas-kit-react/button';
|
|
6
6
|
export declare type SidePanelVariant = 'standard' | 'alternate';
|
|
7
7
|
export declare type SidePanelTransitionStates = 'collapsed' | 'collapsing' | 'expanded' | 'expanding';
|
|
8
8
|
export interface SidePanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -50,7 +50,7 @@ export interface SidePanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
50
50
|
*/
|
|
51
51
|
onStateTransition?: (state?: SidePanelTransitionStates) => void;
|
|
52
52
|
/**
|
|
53
|
-
* The style variant of the side panel. 'standard' is with a `soap100` background, no depth. 'alternate' is a `frenchVanilla100` background with a level
|
|
53
|
+
* The style variant of the side panel. 'standard' is with a `soap100` background, no depth. 'alternate' is a `frenchVanilla100` background with a level 6 depth.
|
|
54
54
|
*
|
|
55
55
|
* @default 'standard'
|
|
56
56
|
*/
|
|
@@ -67,10 +67,10 @@ export declare const SidePanelContext: React.Context<{
|
|
|
67
67
|
origin: string;
|
|
68
68
|
}>;
|
|
69
69
|
declare const SidePanel: {
|
|
70
|
-
({ as, children, collapsedWidth, expanded, expandedWidth, onAnimationEnd, onAnimationStart, onExpandedChange, onStateTransition, origin, touched, ...elemProps }: SidePanelProps): jsx.JSX.Element;
|
|
70
|
+
({ as, children, collapsedWidth, expanded, expandedWidth, onAnimationEnd, onAnimationStart, onExpandedChange, onStateTransition, origin, variant, touched, ...elemProps }: SidePanelProps): jsx.JSX.Element;
|
|
71
71
|
ToggleButton: ({ variant, icon, tooltipTextExpand: expandLabel, tooltipTextCollapse: collapseLabel, ...rest }: ToggleButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>) => jsx.JSX.Element;
|
|
72
72
|
};
|
|
73
|
-
export declare type ToggleButtonProps =
|
|
73
|
+
export declare type ToggleButtonProps = TertiaryButtonProps & {
|
|
74
74
|
/**
|
|
75
75
|
* The tooltip text to expand the side panel
|
|
76
76
|
* @default 'Expand'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { CanvasSystemIcon } from '@workday/design-assets-types';
|
|
3
|
-
export interface DropdownButtonProps extends
|
|
3
|
+
export interface DropdownButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
4
4
|
/**
|
|
5
5
|
* The accessibility label for the button
|
|
6
6
|
*/
|
|
@@ -16,5 +16,5 @@ export interface DropdownButtonProps extends IconButtonProps {
|
|
|
16
16
|
*/
|
|
17
17
|
toggled: boolean;
|
|
18
18
|
}
|
|
19
|
-
export declare const DropdownButton: import("@workday/canvas-kit-react/common").ElementComponent<
|
|
19
|
+
export declare const DropdownButton: import("@workday/canvas-kit-react/common").ElementComponent<"button", DropdownButtonProps>;
|
|
20
20
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { jsx } from '@emotion/react';
|
|
5
|
-
import {
|
|
5
|
+
import { TertiaryButtonProps } from '@workday/canvas-kit-react/button';
|
|
6
6
|
export declare type SidePanelVariant = 'standard' | 'alternate';
|
|
7
7
|
export declare type SidePanelTransitionStates = 'collapsed' | 'collapsing' | 'expanded' | 'expanding';
|
|
8
8
|
export interface SidePanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -50,7 +50,7 @@ export interface SidePanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
50
50
|
*/
|
|
51
51
|
onStateTransition?: (state?: SidePanelTransitionStates) => void;
|
|
52
52
|
/**
|
|
53
|
-
* The style variant of the side panel. 'standard' is with a `soap100` background, no depth. 'alternate' is a `frenchVanilla100` background with a level
|
|
53
|
+
* The style variant of the side panel. 'standard' is with a `soap100` background, no depth. 'alternate' is a `frenchVanilla100` background with a level 6 depth.
|
|
54
54
|
*
|
|
55
55
|
* @default 'standard'
|
|
56
56
|
*/
|
|
@@ -67,10 +67,10 @@ export declare const SidePanelContext: React.Context<{
|
|
|
67
67
|
origin: string;
|
|
68
68
|
}>;
|
|
69
69
|
declare const SidePanel: {
|
|
70
|
-
({ as, children, collapsedWidth, expanded, expandedWidth, onAnimationEnd, onAnimationStart, onExpandedChange, onStateTransition, origin, touched, ...elemProps }: SidePanelProps): jsx.JSX.Element;
|
|
70
|
+
({ as, children, collapsedWidth, expanded, expandedWidth, onAnimationEnd, onAnimationStart, onExpandedChange, onStateTransition, origin, variant, touched, ...elemProps }: SidePanelProps): jsx.JSX.Element;
|
|
71
71
|
ToggleButton: ({ variant, icon, tooltipTextExpand: expandLabel, tooltipTextCollapse: collapseLabel, ...rest }: ToggleButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>) => jsx.JSX.Element;
|
|
72
72
|
};
|
|
73
|
-
export declare type ToggleButtonProps =
|
|
73
|
+
export declare type ToggleButtonProps = TertiaryButtonProps & {
|
|
74
74
|
/**
|
|
75
75
|
* The tooltip text to expand the side panel
|
|
76
76
|
* @default 'Expand'
|