@workday/canvas-kit-preview-react 6.3.5 → 7.0.0-alpha.0-next.3
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 +2 -5
- package/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.tsx +5 -6
- package/breadcrumbs/lib/Breadcrumbs/List/ListItem.tsx +3 -9
- package/breadcrumbs/lib/Breadcrumbs/List/index.tsx +22 -20
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.d.ts.map +1 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.js +5 -5
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.d.ts +0 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.d.ts.map +1 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.js +11 -7
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/ListItem.d.ts +0 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/ListItem.d.ts.map +1 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/ListItem.js +7 -7
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/index.d.ts +1 -2
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/index.d.ts.map +1 -1
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/index.js +12 -16
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/index.d.ts +1 -2
- package/dist/commonjs/breadcrumbs/lib/Breadcrumbs/index.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/FormFieldHint.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/FormFieldHint.js +6 -3
- package/dist/commonjs/form-field/lib/FormFieldLabel.d.ts.map +1 -1
- package/dist/commonjs/form-field/lib/FormFieldLabel.js +14 -13
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts +26 -3
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/SidePanel.js +12 -24
- package/dist/commonjs/text-area/lib/TextAreaField.d.ts.map +1 -1
- package/dist/commonjs/text-area/lib/TextAreaField.js +1 -0
- package/dist/commonjs/text-input/lib/TextInputField.d.ts.map +1 -1
- package/dist/commonjs/text-input/lib/TextInputField.js +1 -0
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.d.ts.map +1 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Button.js +2 -5
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.d.ts +0 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.d.ts.map +1 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.js +8 -7
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/ListItem.d.ts +0 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/ListItem.d.ts.map +1 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/ListItem.js +4 -7
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/index.d.ts +1 -2
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/index.d.ts.map +1 -1
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/List/index.js +9 -16
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/index.d.ts +1 -2
- package/dist/es6/breadcrumbs/lib/Breadcrumbs/index.d.ts.map +1 -1
- package/dist/es6/form-field/lib/FormFieldHint.d.ts.map +1 -1
- package/dist/es6/form-field/lib/FormFieldHint.js +4 -4
- package/dist/es6/form-field/lib/FormFieldLabel.d.ts.map +1 -1
- package/dist/es6/form-field/lib/FormFieldLabel.js +12 -14
- package/dist/es6/side-panel/lib/SidePanel.d.ts +26 -3
- package/dist/es6/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/es6/side-panel/lib/SidePanel.js +13 -25
- package/dist/es6/text-area/lib/TextAreaField.d.ts.map +1 -1
- package/dist/es6/text-area/lib/TextAreaField.js +1 -0
- package/dist/es6/text-input/lib/TextInputField.d.ts.map +1 -1
- package/dist/es6/text-input/lib/TextInputField.js +1 -0
- package/form-field/lib/FormFieldHint.tsx +9 -9
- package/form-field/lib/FormFieldLabel.tsx +17 -21
- package/package.json +4 -4
- package/side-panel/lib/SidePanel.tsx +36 -32
- package/text-area/lib/TextAreaField.tsx +1 -0
- package/text-input/lib/TextInputField.tsx +1 -0
- package/ts3.5/dist/commonjs/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.d.ts +0 -1
- package/ts3.5/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/ListItem.d.ts +0 -1
- package/ts3.5/dist/commonjs/breadcrumbs/lib/Breadcrumbs/List/index.d.ts +1 -2
- package/ts3.5/dist/commonjs/breadcrumbs/lib/Breadcrumbs/index.d.ts +1 -2
- package/ts3.5/dist/commonjs/side-panel/lib/SidePanel.d.ts +26 -3
- package/ts3.5/dist/es6/breadcrumbs/lib/Breadcrumbs/Dropdown/Menu.d.ts +0 -1
- package/ts3.5/dist/es6/breadcrumbs/lib/Breadcrumbs/List/ListItem.d.ts +0 -1
- package/ts3.5/dist/es6/breadcrumbs/lib/Breadcrumbs/List/index.d.ts +1 -2
- package/ts3.5/dist/es6/breadcrumbs/lib/Breadcrumbs/index.d.ts +1 -2
- package/ts3.5/dist/es6/side-panel/lib/SidePanel.d.ts +26 -3
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
/** @jsxRuntime classic */
|
|
1
2
|
/** @jsx jsx */
|
|
2
3
|
import * as React from 'react';
|
|
3
|
-
import {styled, useIsRTL} from '@workday/canvas-kit-react/common';
|
|
4
|
-
import {css,
|
|
4
|
+
import {styled, useIsRTL, StyledType} from '@workday/canvas-kit-react/common';
|
|
5
|
+
import {css, jsx, keyframes} from '@emotion/core';
|
|
5
6
|
import {IconButton, IconButtonProps} from '@workday/canvas-kit-react/button';
|
|
6
|
-
import {space, colors
|
|
7
|
+
import {space, colors} from '@workday/canvas-kit-react/tokens';
|
|
7
8
|
import {transformationImportIcon} from '@workday/canvas-system-icons-web';
|
|
9
|
+
import {Tooltip} from '@workday/canvas-kit-react/tooltip';
|
|
10
|
+
import {Box} from '@workday/canvas-kit-labs-react/common';
|
|
8
11
|
|
|
9
12
|
export type SidePanelVariant = 'standard' | 'alternate';
|
|
10
13
|
export type SidePanelTransitionStates = 'collapsed' | 'collapsing' | 'expanded' | 'expanding';
|
|
@@ -86,17 +89,7 @@ const createKeyframes = (from: number | string, to: number | string) => {
|
|
|
86
89
|
`;
|
|
87
90
|
};
|
|
88
91
|
|
|
89
|
-
const
|
|
90
|
-
alternate: {
|
|
91
|
-
backgroundColor: colors.frenchVanilla100,
|
|
92
|
-
...depth[3],
|
|
93
|
-
},
|
|
94
|
-
standard: {
|
|
95
|
-
backgroundColor: colors.soap100,
|
|
96
|
-
},
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
const Panel = styled('section')<Pick<SidePanelProps, 'as'>>({
|
|
92
|
+
const StyledPanel = styled(Box)<StyledType & Pick<SidePanelProps, 'as'>>({
|
|
100
93
|
overflow: 'hidden',
|
|
101
94
|
position: 'relative',
|
|
102
95
|
boxSizing: 'border-box',
|
|
@@ -119,7 +112,7 @@ const SidePanel = ({
|
|
|
119
112
|
onExpandedChange,
|
|
120
113
|
onStateTransition,
|
|
121
114
|
origin = 'left',
|
|
122
|
-
variant = 'standard',
|
|
115
|
+
// variant = 'standard',
|
|
123
116
|
touched,
|
|
124
117
|
...elemProps
|
|
125
118
|
}: SidePanelProps) => {
|
|
@@ -176,20 +169,15 @@ const SidePanel = ({
|
|
|
176
169
|
};
|
|
177
170
|
|
|
178
171
|
return (
|
|
179
|
-
<
|
|
172
|
+
<StyledPanel
|
|
180
173
|
as={as}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
? `${expanded ? motion.expand : motion.collapse} 200ms ease-out`
|
|
189
|
-
: undefined,
|
|
190
|
-
},
|
|
191
|
-
containerVariantStyle[variant],
|
|
192
|
-
]}
|
|
174
|
+
width={expanded ? expandedWidth : collapsedWidth}
|
|
175
|
+
maxWidth={expanded ? expandedWidth : collapsedWidth}
|
|
176
|
+
backgroundColor={elemProps.variant === 'alternate' ? colors.frenchVanilla100 : colors.soap100}
|
|
177
|
+
depth={elemProps.variant === 'alternate' ? 3 : undefined}
|
|
178
|
+
animation={
|
|
179
|
+
touched ? `${expanded ? motion.expand : motion.collapse} 200ms ease-out` : undefined
|
|
180
|
+
}
|
|
193
181
|
onAnimationEnd={handleAnimationEnd}
|
|
194
182
|
onAnimationStart={handleAnimationStart}
|
|
195
183
|
{...elemProps}
|
|
@@ -202,11 +190,22 @@ const SidePanel = ({
|
|
|
202
190
|
>
|
|
203
191
|
{children}
|
|
204
192
|
</SidePanelContext.Provider>
|
|
205
|
-
</
|
|
193
|
+
</StyledPanel>
|
|
206
194
|
);
|
|
207
195
|
};
|
|
208
196
|
|
|
209
|
-
export type ToggleButtonProps =
|
|
197
|
+
export type ToggleButtonProps = IconButtonProps & {
|
|
198
|
+
/**
|
|
199
|
+
* The tooltip text to expand the side panel
|
|
200
|
+
* @default 'Expand'
|
|
201
|
+
*/
|
|
202
|
+
tooltipTextExpand?: string;
|
|
203
|
+
/**
|
|
204
|
+
* The tooltip text to collapse the side panel
|
|
205
|
+
* @default 'Collapse'
|
|
206
|
+
*/
|
|
207
|
+
tooltipTextCollapse?: string;
|
|
208
|
+
};
|
|
210
209
|
|
|
211
210
|
/**
|
|
212
211
|
* A toggle button styled specifically for the side panel container.
|
|
@@ -214,6 +213,8 @@ export type ToggleButtonProps = Omit<IconButtonProps, 'aria-label'>;
|
|
|
214
213
|
const ToggleButton = ({
|
|
215
214
|
variant = 'plain',
|
|
216
215
|
icon = transformationImportIcon,
|
|
216
|
+
tooltipTextExpand: expandLabel = 'Expand',
|
|
217
|
+
tooltipTextCollapse: collapseLabel = 'Collapse',
|
|
217
218
|
...rest
|
|
218
219
|
}: ToggleButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>) => {
|
|
219
220
|
const context = React.useContext(SidePanelContext);
|
|
@@ -243,8 +244,11 @@ const ToggleButton = ({
|
|
|
243
244
|
: `scaleX(${rtlOrigin === 'left' ? '-1' : '1'})`,
|
|
244
245
|
});
|
|
245
246
|
|
|
246
|
-
|
|
247
|
-
|
|
247
|
+
return (
|
|
248
|
+
<Tooltip title={context.state === 'collapsed' ? expandLabel : collapseLabel} type="muted">
|
|
249
|
+
<IconButton type="button" css={buttonStyle} icon={icon} variant={variant} {...rest} />
|
|
250
|
+
</Tooltip>
|
|
251
|
+
);
|
|
248
252
|
};
|
|
249
253
|
|
|
250
254
|
SidePanel.ToggleButton = ToggleButton;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
1
|
import React from 'react';
|
|
3
2
|
export declare type BreadcrumbsListProps = React.HTMLAttributes<HTMLUListElement>;
|
|
4
|
-
export declare const BreadcrumbsList:
|
|
3
|
+
export declare const BreadcrumbsList: import("@workday/canvas-kit-react/common").ElementComponent<"ul", BreadcrumbsListProps>;
|
|
5
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/// <reference types="@emotion/core" />
|
|
2
1
|
export declare const Breadcrumbs: {
|
|
3
2
|
Nav: ({ "aria-label": ariaLabel, ...elemProps }: import("./Nav").BreadcrumbsNavProps) => JSX.Element;
|
|
4
3
|
CollapsibleList: ({ children, buttonIcon, buttonAriaLabel, maxWidth, ...props }: import("./List/Collapsible").CollapsibleListProps) => JSX.Element;
|
|
5
|
-
List: import("react").
|
|
4
|
+
List: import("@workday/canvas-kit-react/common").ElementComponent<"ul", import("./List").BreadcrumbsListProps>;
|
|
6
5
|
ListItem: ({ children, ...props }: import("./List/ListItem").ListItemProps) => JSX.Element;
|
|
7
6
|
Link: ({ maxWidth, onAction, onClick, href, children, ...props }: import("./List/Link").BreadcrumbLinkProps) => JSX.Element;
|
|
8
7
|
CurrentItem: ({ children, maxWidth, ...elemProps }: import("./List/CurrentItem").CurrentItemProps) => JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @jsxRuntime classic */
|
|
1
2
|
/** @jsx jsx */
|
|
2
3
|
import * as React from 'react';
|
|
3
4
|
import { IconButtonProps } from '@workday/canvas-kit-react/button';
|
|
@@ -65,9 +66,31 @@ export declare const SidePanelContext: React.Context<{
|
|
|
65
66
|
origin: string;
|
|
66
67
|
}>;
|
|
67
68
|
declare const SidePanel: {
|
|
68
|
-
({ as, children, collapsedWidth, expanded, expandedWidth, onAnimationEnd, onAnimationStart, onExpandedChange, onStateTransition, origin,
|
|
69
|
-
ToggleButton: ({ variant, icon,
|
|
69
|
+
({ as, children, collapsedWidth, expanded, expandedWidth, onAnimationEnd, onAnimationStart, onExpandedChange, onStateTransition, origin, touched, ...elemProps }: SidePanelProps): JSX.Element;
|
|
70
|
+
ToggleButton: ({ variant, icon, tooltipTextExpand: expandLabel, tooltipTextCollapse: collapseLabel, ...rest }: IconButtonProps & {
|
|
71
|
+
/**
|
|
72
|
+
* The tooltip text to expand the side panel
|
|
73
|
+
* @default 'Expand'
|
|
74
|
+
*/
|
|
75
|
+
tooltipTextExpand?: string | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* The tooltip text to collapse the side panel
|
|
78
|
+
* @default 'Collapse'
|
|
79
|
+
*/
|
|
80
|
+
tooltipTextCollapse?: string | undefined;
|
|
81
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement>) => JSX.Element;
|
|
82
|
+
};
|
|
83
|
+
export declare type ToggleButtonProps = IconButtonProps & {
|
|
84
|
+
/**
|
|
85
|
+
* The tooltip text to expand the side panel
|
|
86
|
+
* @default 'Expand'
|
|
87
|
+
*/
|
|
88
|
+
tooltipTextExpand?: string;
|
|
89
|
+
/**
|
|
90
|
+
* The tooltip text to collapse the side panel
|
|
91
|
+
* @default 'Collapse'
|
|
92
|
+
*/
|
|
93
|
+
tooltipTextCollapse?: string;
|
|
70
94
|
};
|
|
71
|
-
export declare type ToggleButtonProps = Pick<IconButtonProps, Exclude<keyof IconButtonProps, 'aria-label'>>;
|
|
72
95
|
export default SidePanel;
|
|
73
96
|
//# sourceMappingURL=SidePanel.d.ts.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
1
|
import React from 'react';
|
|
3
2
|
export declare type BreadcrumbsListProps = React.HTMLAttributes<HTMLUListElement>;
|
|
4
|
-
export declare const BreadcrumbsList:
|
|
3
|
+
export declare const BreadcrumbsList: import("@workday/canvas-kit-react/common").ElementComponent<"ul", BreadcrumbsListProps>;
|
|
5
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/// <reference types="@emotion/core" />
|
|
2
1
|
export declare const Breadcrumbs: {
|
|
3
2
|
Nav: ({ "aria-label": ariaLabel, ...elemProps }: import("./Nav").BreadcrumbsNavProps) => JSX.Element;
|
|
4
3
|
CollapsibleList: ({ children, buttonIcon, buttonAriaLabel, maxWidth, ...props }: import("./List/Collapsible").CollapsibleListProps) => JSX.Element;
|
|
5
|
-
List: import("react").
|
|
4
|
+
List: import("@workday/canvas-kit-react/common").ElementComponent<"ul", import("./List").BreadcrumbsListProps>;
|
|
6
5
|
ListItem: ({ children, ...props }: import("./List/ListItem").ListItemProps) => JSX.Element;
|
|
7
6
|
Link: ({ maxWidth, onAction, onClick, href, children, ...props }: import("./List/Link").BreadcrumbLinkProps) => JSX.Element;
|
|
8
7
|
CurrentItem: ({ children, maxWidth, ...elemProps }: import("./List/CurrentItem").CurrentItemProps) => JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @jsxRuntime classic */
|
|
1
2
|
/** @jsx jsx */
|
|
2
3
|
import * as React from 'react';
|
|
3
4
|
import { IconButtonProps } from '@workday/canvas-kit-react/button';
|
|
@@ -65,9 +66,31 @@ export declare const SidePanelContext: React.Context<{
|
|
|
65
66
|
origin: string;
|
|
66
67
|
}>;
|
|
67
68
|
declare const SidePanel: {
|
|
68
|
-
({ as, children, collapsedWidth, expanded, expandedWidth, onAnimationEnd, onAnimationStart, onExpandedChange, onStateTransition, origin,
|
|
69
|
-
ToggleButton: ({ variant, icon,
|
|
69
|
+
({ as, children, collapsedWidth, expanded, expandedWidth, onAnimationEnd, onAnimationStart, onExpandedChange, onStateTransition, origin, touched, ...elemProps }: SidePanelProps): JSX.Element;
|
|
70
|
+
ToggleButton: ({ variant, icon, tooltipTextExpand: expandLabel, tooltipTextCollapse: collapseLabel, ...rest }: IconButtonProps & {
|
|
71
|
+
/**
|
|
72
|
+
* The tooltip text to expand the side panel
|
|
73
|
+
* @default 'Expand'
|
|
74
|
+
*/
|
|
75
|
+
tooltipTextExpand?: string | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* The tooltip text to collapse the side panel
|
|
78
|
+
* @default 'Collapse'
|
|
79
|
+
*/
|
|
80
|
+
tooltipTextCollapse?: string | undefined;
|
|
81
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement>) => JSX.Element;
|
|
82
|
+
};
|
|
83
|
+
export declare type ToggleButtonProps = IconButtonProps & {
|
|
84
|
+
/**
|
|
85
|
+
* The tooltip text to expand the side panel
|
|
86
|
+
* @default 'Expand'
|
|
87
|
+
*/
|
|
88
|
+
tooltipTextExpand?: string;
|
|
89
|
+
/**
|
|
90
|
+
* The tooltip text to collapse the side panel
|
|
91
|
+
* @default 'Collapse'
|
|
92
|
+
*/
|
|
93
|
+
tooltipTextCollapse?: string;
|
|
70
94
|
};
|
|
71
|
-
export declare type ToggleButtonProps = Pick<IconButtonProps, Exclude<keyof IconButtonProps, 'aria-label'>>;
|
|
72
95
|
export default SidePanel;
|
|
73
96
|
//# sourceMappingURL=SidePanel.d.ts.map
|