@workday/canvas-kit-react 8.0.0-alpha.192-next.1 → 8.0.0-alpha.198-next.0
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/button/index.ts +7 -1
- package/button/lib/BaseButton.tsx +7 -4
- package/button/lib/DeleteButton.tsx +2 -2
- package/button/lib/PrimaryButton.tsx +2 -2
- package/button/lib/SecondaryButton.tsx +2 -2
- package/button/lib/TertiaryButton.tsx +3 -3
- package/common/lib/utils/components.ts +5 -0
- package/dist/commonjs/button/index.d.ts +1 -1
- package/dist/commonjs/button/index.d.ts.map +1 -1
- package/dist/commonjs/button/index.js +3 -1
- package/dist/commonjs/button/lib/BaseButton.d.ts +7 -4
- package/dist/commonjs/button/lib/BaseButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/DeleteButton.d.ts +2 -1
- package/dist/commonjs/button/lib/DeleteButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/PrimaryButton.d.ts +2 -1
- package/dist/commonjs/button/lib/PrimaryButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/SecondaryButton.d.ts +2 -1
- package/dist/commonjs/button/lib/SecondaryButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/TertiaryButton.d.ts +2 -1
- package/dist/commonjs/button/lib/TertiaryButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/TertiaryButton.js +1 -1
- package/dist/commonjs/common/lib/utils/components.d.ts +2 -1
- package/dist/commonjs/common/lib/utils/components.d.ts.map +1 -1
- package/dist/commonjs/layout/index.d.ts +3 -3
- package/dist/commonjs/layout/index.d.ts.map +1 -1
- package/dist/commonjs/layout/index.js +3 -3
- package/dist/commonjs/layout/lib/Column.d.ts +13 -4
- package/dist/commonjs/layout/lib/Column.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/Column.js +10 -7
- package/dist/commonjs/layout/lib/Layout.d.ts +26 -9
- package/dist/commonjs/layout/lib/Layout.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/Layout.js +21 -10
- package/dist/commonjs/segmented-control/lib/SegmentedControlButton.d.ts +3 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControlButton.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControlButton.js +11 -2
- package/dist/es6/button/index.d.ts +1 -1
- package/dist/es6/button/index.d.ts.map +1 -1
- package/dist/es6/button/index.js +1 -1
- package/dist/es6/button/lib/BaseButton.d.ts +7 -4
- package/dist/es6/button/lib/BaseButton.d.ts.map +1 -1
- package/dist/es6/button/lib/DeleteButton.d.ts +2 -1
- package/dist/es6/button/lib/DeleteButton.d.ts.map +1 -1
- package/dist/es6/button/lib/PrimaryButton.d.ts +2 -1
- package/dist/es6/button/lib/PrimaryButton.d.ts.map +1 -1
- package/dist/es6/button/lib/SecondaryButton.d.ts +2 -1
- package/dist/es6/button/lib/SecondaryButton.d.ts.map +1 -1
- package/dist/es6/button/lib/TertiaryButton.d.ts +2 -1
- package/dist/es6/button/lib/TertiaryButton.d.ts.map +1 -1
- package/dist/es6/button/lib/TertiaryButton.js +1 -1
- package/dist/es6/common/lib/utils/components.d.ts +2 -1
- package/dist/es6/common/lib/utils/components.d.ts.map +1 -1
- package/dist/es6/layout/index.d.ts +3 -3
- package/dist/es6/layout/index.d.ts.map +1 -1
- package/dist/es6/layout/index.js +3 -3
- package/dist/es6/layout/lib/Column.d.ts +13 -4
- package/dist/es6/layout/lib/Column.d.ts.map +1 -1
- package/dist/es6/layout/lib/Column.js +9 -6
- package/dist/es6/layout/lib/Layout.d.ts +26 -9
- package/dist/es6/layout/lib/Layout.d.ts.map +1 -1
- package/dist/es6/layout/lib/Layout.js +21 -10
- package/dist/es6/segmented-control/lib/SegmentedControlButton.d.ts +3 -1
- package/dist/es6/segmented-control/lib/SegmentedControlButton.d.ts.map +1 -1
- package/dist/es6/segmented-control/lib/SegmentedControlButton.js +12 -3
- package/layout/README.md +28 -27
- package/layout/index.ts +3 -3
- package/layout/lib/Column.tsx +22 -5
- package/layout/lib/Layout.tsx +37 -12
- package/package.json +3 -3
- package/segmented-control/lib/SegmentedControlButton.tsx +24 -5
|
@@ -55,11 +55,17 @@ var getIconButtonColors = function (toggled) {
|
|
|
55
55
|
},
|
|
56
56
|
};
|
|
57
57
|
};
|
|
58
|
+
var getSizeStyles = function (size) {
|
|
59
|
+
var sizeValue = size === 'large' ? "calc(" + tokens_1.space.xl + " + " + tokens_1.space.xxs + ")" : size === 'small' ? tokens_1.space.l : tokens_1.space.xl;
|
|
60
|
+
return {
|
|
61
|
+
width: sizeValue,
|
|
62
|
+
height: sizeValue,
|
|
63
|
+
};
|
|
64
|
+
};
|
|
58
65
|
var StyledButton = common_1.styled(button_1.BaseButton)({
|
|
59
66
|
borderRadius: tokens_1.borderRadius.zero,
|
|
60
67
|
border: "1px solid " + tokens_1.colors.soap500,
|
|
61
68
|
borderLeft: 'none',
|
|
62
|
-
minWidth: tokens_1.space.xl,
|
|
63
69
|
'&:first-of-type': {
|
|
64
70
|
borderRadius: tokens_1.borderRadius.m + " 0 0 " + tokens_1.borderRadius.m,
|
|
65
71
|
borderLeft: "1px solid " + tokens_1.colors.soap500,
|
|
@@ -94,12 +100,15 @@ var StyledButton = common_1.styled(button_1.BaseButton)({
|
|
|
94
100
|
},
|
|
95
101
|
},
|
|
96
102
|
});
|
|
103
|
+
}, function (_a) {
|
|
104
|
+
var size = _a.size;
|
|
105
|
+
return (__assign({}, getSizeStyles(size)));
|
|
97
106
|
});
|
|
98
107
|
exports.SegmentedControlButton = common_1.createComponent('button')({
|
|
99
108
|
displayName: 'Button',
|
|
100
109
|
Component: function (_a, ref, Element) {
|
|
101
110
|
var value = _a.value, icon = _a.icon, toggled = _a.toggled, props = __rest(_a, ["value", "icon", "toggled"]);
|
|
102
111
|
return (react_1.default.createElement(StyledButton, __assign({ as: Element, "aria-pressed": toggled, value: value, colors: getIconButtonColors(toggled), fillIcon: toggled, ref: ref }, props),
|
|
103
|
-
react_1.default.createElement(button_1.BaseButton.Icon, { size:
|
|
112
|
+
react_1.default.createElement(button_1.BaseButton.Icon, { size: props.size || 'large', icon: icon })));
|
|
104
113
|
},
|
|
105
114
|
});
|
|
@@ -6,7 +6,7 @@ export { DeprecatedButton as deprecated_Button, DeprecatedButtonProps, } from '.
|
|
|
6
6
|
export { ToolbarIconButton, ToolbarIconButtonProps } from './lib/ToolbarIconButton';
|
|
7
7
|
export { ToolbarDropdownButton, ToolbarDropdownButtonProps } from './lib/ToolbarDropdownButton';
|
|
8
8
|
export { Hyperlink, HyperlinkProps } from './lib/Hyperlink';
|
|
9
|
-
export { BaseButton, ButtonContainerProps } from './lib/BaseButton';
|
|
9
|
+
export { BaseButton, ButtonContainerProps, BaseButtonProps, getMinWidthStyles, getPaddingStyles, } from './lib/BaseButton';
|
|
10
10
|
export { ExternalHyperlink, ExternalHyperlinkProps } from './lib/ExternalHyperlink';
|
|
11
11
|
export * from './lib/types';
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAC,eAAe,EAAE,oBAAoB,EAAC,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAC,cAAc,EAAE,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAC,YAAY,EAAE,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AACnE,OAAO,EACL,gBAAgB,IAAI,iBAAiB,EACrC,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,iBAAiB,EAAE,sBAAsB,EAAC,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAC,qBAAqB,EAAE,0BAA0B,EAAC,MAAM,6BAA6B,CAAC;AAC9F,OAAO,EAAC,SAAS,EAAE,cAAc,EAAC,MAAM,iBAAiB,CAAC;AAC1D,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAC,eAAe,EAAE,oBAAoB,EAAC,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAC,cAAc,EAAE,mBAAmB,EAAC,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAC,YAAY,EAAE,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AACnE,OAAO,EACL,gBAAgB,IAAI,iBAAiB,EACrC,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,iBAAiB,EAAE,sBAAsB,EAAC,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAC,qBAAqB,EAAE,0BAA0B,EAAC,MAAM,6BAA6B,CAAC;AAC9F,OAAO,EAAC,SAAS,EAAE,cAAc,EAAC,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAC,iBAAiB,EAAE,sBAAsB,EAAC,MAAM,yBAAyB,CAAC;AAClF,cAAc,aAAa,CAAC"}
|
package/dist/es6/button/index.js
CHANGED
|
@@ -6,6 +6,6 @@ export { DeprecatedButton as deprecated_Button, } from './lib/deprecated_Button'
|
|
|
6
6
|
export { ToolbarIconButton } from './lib/ToolbarIconButton';
|
|
7
7
|
export { ToolbarDropdownButton } from './lib/ToolbarDropdownButton';
|
|
8
8
|
export { Hyperlink } from './lib/Hyperlink';
|
|
9
|
-
export { BaseButton } from './lib/BaseButton';
|
|
9
|
+
export { BaseButton, getMinWidthStyles, getPaddingStyles, } from './lib/BaseButton';
|
|
10
10
|
export { ExternalHyperlink } from './lib/ExternalHyperlink';
|
|
11
11
|
export * from './lib/types';
|
|
@@ -12,16 +12,19 @@ export interface ButtonContainerProps extends BoxProps, GrowthBehavior {
|
|
|
12
12
|
* @default 'medium'
|
|
13
13
|
*/
|
|
14
14
|
size?: ButtonSizes;
|
|
15
|
-
/**
|
|
16
|
-
* The ref to the button that the styled component renders.
|
|
17
|
-
*/
|
|
18
|
-
ref?: React.Ref<HTMLButtonElement>;
|
|
19
15
|
/**
|
|
20
16
|
* Whether the icon should received filled (colored background layer) or regular styles.
|
|
21
17
|
* Corresponds to `toggled` in ToolbarIconButton
|
|
22
18
|
*/
|
|
23
19
|
fillIcon?: boolean;
|
|
24
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Extends all the style properties from Box to our buttons as well as props from ButtonContainerProps.
|
|
23
|
+
* We omit `ref` since all of our buttons use `createComponent` and already give access to `ref`.
|
|
24
|
+
* Use this type to extend and customize any one off buttons that you want full control over styling.
|
|
25
|
+
*/
|
|
26
|
+
export interface BaseButtonProps extends Omit<ButtonContainerProps, 'ref'> {
|
|
27
|
+
}
|
|
25
28
|
export declare const getMinWidthStyles: (children: React.ReactNode, size: ButtonSizes | TertiaryButtonSizes) => "24px" | "32px" | "40px" | "80px" | "auto" | "48px" | "112px" | "96px";
|
|
26
29
|
export declare const getPaddingStyles: (children: React.ReactNode, size: ButtonSizes | TertiaryButtonSizes, icon: CanvasSystemIcon | undefined, iconPosition: IconPositions | undefined) => string | 0;
|
|
27
30
|
export declare const BaseButton: import("../../common").ElementComponent<"button", ButtonContainerProps> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/BaseButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAEL,cAAc,EAMf,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,QAAQ,EAAa,MAAM,kCAAkC,CAAC;AAGtE,OAAO,EAAC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAGtF,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAE9D,MAAM,WAAW,oBAAqB,SAAQ,QAAQ,EAAE,cAAc;IACpE,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB
|
|
1
|
+
{"version":3,"file":"BaseButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/BaseButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAEL,cAAc,EAMf,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,QAAQ,EAAa,MAAM,kCAAkC,CAAC;AAGtE,OAAO,EAAC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAGtF,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAE9D,MAAM,WAAW,oBAAqB,SAAQ,QAAQ,EAAE,cAAc;IACpE,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,KAAK,CAAC;CAAG;AAgL7E,eAAO,MAAM,iBAAiB,aAClB,MAAM,SAAS,QACnB,WAAW,GAAG,mBAAmB,2EAcxC,CAAC;AAEF,eAAO,MAAM,gBAAgB,aACjB,MAAM,SAAS,QACnB,WAAW,GAAG,mBAAmB,QACjC,gBAAgB,GAAG,SAAS,gBACpB,aAAa,GAAG,SAAS,eAiDxC,CAAC;AAEF,eAAO,MAAM,UAAU;;;CAarB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { BaseButtonProps } from './BaseButton';
|
|
2
3
|
import { GrowthBehavior, Themeable } from '@workday/canvas-kit-react/common';
|
|
3
|
-
export interface DeleteButtonProps extends Themeable, GrowthBehavior {
|
|
4
|
+
export interface DeleteButtonProps extends Themeable, GrowthBehavior, BaseButtonProps {
|
|
4
5
|
/**
|
|
5
6
|
* The size of the Button.
|
|
6
7
|
* @default 'medium'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/DeleteButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DeleteButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/DeleteButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAa,eAAe,EAAsC,MAAM,cAAc,CAAC;AAC9F,OAAO,EACL,cAAc,EAEd,SAAS,EAGV,MAAM,kCAAkC,CAAC;AAE1C,MAAM,WAAW,iBAAkB,SAAQ,SAAS,EAAE,cAAc,EAAE,eAAe;IACnF;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AA0BD,eAAO,MAAM,YAAY,sEA0BvB,CAAC"}
|
|
@@ -2,7 +2,8 @@ import * as React from 'react';
|
|
|
2
2
|
import { GrowthBehavior, Themeable } from '@workday/canvas-kit-react/common';
|
|
3
3
|
import { CanvasSystemIcon } from '@workday/design-assets-types';
|
|
4
4
|
import { ButtonSizes, IconPositions } from './types';
|
|
5
|
-
|
|
5
|
+
import { BaseButtonProps } from './BaseButton';
|
|
6
|
+
export interface PrimaryButtonProps extends Themeable, GrowthBehavior, BaseButtonProps {
|
|
6
7
|
/**
|
|
7
8
|
* The variant of the PrimaryButton.
|
|
8
9
|
* @default undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimaryButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/PrimaryButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,cAAc,EAEd,SAAS,EAIV,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAC,WAAW,EAAE,aAAa,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"PrimaryButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/PrimaryButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,cAAc,EAEd,SAAS,EAIV,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAC,WAAW,EAAE,aAAa,EAAC,MAAM,SAAS,CAAC;AACnD,OAAO,EAAa,eAAe,EAAsC,MAAM,cAAc,CAAC;AA0E9F,MAAM,WAAW,kBAAmB,SAAQ,SAAS,EAAE,cAAc,EAAE,eAAe;IACpF;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;;OAIG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,aAAa,uEA+CxB,CAAC"}
|
|
@@ -2,7 +2,8 @@ import * as React from 'react';
|
|
|
2
2
|
import { GrowthBehavior, Themeable, EmotionCanvasTheme } from '@workday/canvas-kit-react/common';
|
|
3
3
|
import { CanvasSystemIcon } from '@workday/design-assets-types';
|
|
4
4
|
import { ButtonColors, ButtonSizes, IconPositions } from './types';
|
|
5
|
-
|
|
5
|
+
import { BaseButtonProps } from './BaseButton';
|
|
6
|
+
export interface SecondaryButtonProps extends Themeable, GrowthBehavior, BaseButtonProps {
|
|
6
7
|
/**
|
|
7
8
|
* The variant of the SecondaryButton.
|
|
8
9
|
* @default undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecondaryButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/SecondaryButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EACL,cAAc,EAEd,SAAS,EACT,kBAAkB,EAGnB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"SecondaryButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/SecondaryButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EACL,cAAc,EAEd,SAAS,EACT,kBAAkB,EAGnB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAC,MAAM,SAAS,CAAC;AACjE,OAAO,EAAa,eAAe,EAAsC,MAAM,cAAc,CAAC;AAE9F,MAAM,WAAW,oBAAqB,SAAQ,SAAS,EAAE,cAAc,EAAE,eAAe;IACtF;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;;OAIG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,eAAO,MAAM,eAAe,yEA+C1B,CAAC;AAEH,eAAO,MAAM,wBAAwB,YAC1B,SAAS,GAAG,SAAS,SACvB,kBAAkB,KACxB,YAoFF,CAAC"}
|
|
@@ -2,7 +2,8 @@ import * as React from 'react';
|
|
|
2
2
|
import { Themeable } from '@workday/canvas-kit-react/common';
|
|
3
3
|
import { CanvasSystemIcon } from '@workday/design-assets-types';
|
|
4
4
|
import { IconPositions, ButtonSizes } from './types';
|
|
5
|
-
|
|
5
|
+
import { BaseButtonProps } from './BaseButton';
|
|
6
|
+
export interface TertiaryButtonProps extends Themeable, BaseButtonProps {
|
|
6
7
|
/**
|
|
7
8
|
* The variant of the TertiaryButton.
|
|
8
9
|
* @default undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TertiaryButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/TertiaryButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGL,SAAS,EAKV,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAe,aAAa,EAAE,WAAW,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"TertiaryButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/TertiaryButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGL,SAAS,EAKV,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAe,aAAa,EAAE,WAAW,EAAC,MAAM,SAAS,CAAC;AACjE,OAAO,EAAa,eAAe,EAAC,MAAM,cAAc,CAAC;AAEzD,MAAM,WAAW,mBAAoB,SAAQ,SAAS,EAAE,eAAe;IACrE;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;;OAIG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B;;OAEG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;OAEG;IACH;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAiJD,eAAO,MAAM,cAAc,wEAoDzB,CAAC"}
|
|
@@ -151,7 +151,7 @@ export var TertiaryButton = createComponent('button')({
|
|
|
151
151
|
var _b = _a.size, size = _b === void 0 ? 'medium' : _b, _c = _a.iconPosition, iconPosition = _c === void 0 ? 'start' : _c, _d = _a.isThemeable, isThemeable = _d === void 0 ? false : _d, variant = _a.variant, children = _a.children, icon = _a.icon, _e = _a.shouldMirrorIcon, shouldMirrorIcon = _e === void 0 ? false : _e, allCaps = _a.allCaps, elemProps = __rest(_a, ["size", "iconPosition", "isThemeable", "variant", "children", "icon", "shouldMirrorIcon", "allCaps"]);
|
|
152
152
|
var theme = useTheme();
|
|
153
153
|
var hasThemeStyles = !!children || isThemeable;
|
|
154
|
-
return (React.createElement(StyledTertiaryButtonContainer, __assign({ ref: ref, as: Element, allCaps: allCaps, colors: getTertiaryButtonColors(variant, theme, hasThemeStyles), size: size, padding: getPaddingStyles(icon, iconPosition, children, size), minWidth: getMinWidthStyles(children, size),
|
|
154
|
+
return (React.createElement(StyledTertiaryButtonContainer, __assign({ ref: ref, as: Element, allCaps: allCaps, colors: getTertiaryButtonColors(variant, theme, hasThemeStyles), size: size, padding: getPaddingStyles(icon, iconPosition, children, size), minWidth: getMinWidthStyles(children, size), borderRadius: children ? borderRadius.m : borderRadius.circle }, elemProps),
|
|
155
155
|
icon && iconPosition === 'start' && (React.createElement(BaseButton.Icon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon })),
|
|
156
156
|
children && React.createElement(StyledButtonLabel, null, children),
|
|
157
157
|
icon && iconPosition === 'end' && (React.createElement(BaseButton.Icon, { size: size, iconPosition: iconPosition, icon: icon, shouldMirrorIcon: shouldMirrorIcon }))));
|
|
@@ -6,6 +6,7 @@ import { Model } from './models';
|
|
|
6
6
|
export declare type StyledType = {
|
|
7
7
|
as?: React.ElementType;
|
|
8
8
|
};
|
|
9
|
+
declare type Constructor<T> = new (...args: any[]) => T;
|
|
9
10
|
/**
|
|
10
11
|
* Extract a Ref from T if it exists
|
|
11
12
|
* This will return the following:
|
|
@@ -14,7 +15,7 @@ export declare type StyledType = {
|
|
|
14
15
|
* - `'button'` => `React.Ref<HTMLButtonElement>`
|
|
15
16
|
* - `ElementComponent<'button', ButtonProps>` => `React.Ref<HTMLButtonElement>`
|
|
16
17
|
*/
|
|
17
|
-
declare type ExtractRef<T> = T extends undefined ? never : React.Ref<T extends keyof ElementTagNameMap ? ElementTagNameMap[T] : T extends ElementComponent<infer U, any> ? U extends keyof ElementTagNameMap ? ElementTagNameMap[U] : U : T>;
|
|
18
|
+
declare type ExtractRef<T> = T extends undefined ? never : T extends Constructor<infer C> ? React.LegacyRef<C> : React.Ref<T extends keyof ElementTagNameMap ? ElementTagNameMap[T] : T extends ElementComponent<infer U, any> ? U extends keyof ElementTagNameMap ? ElementTagNameMap[U] : U : T>;
|
|
18
19
|
/**
|
|
19
20
|
* Generic component props with "as" prop
|
|
20
21
|
* @template P Additional props
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../../../common/lib/utils/components.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAC,KAAK,EAAC,MAAM,UAAU,CAAC;AAE/B;;GAEG;AACH,oBAAY,UAAU,GAAG;IACvB,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;CACxB,CAAC;
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../../../common/lib/utils/components.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAC,KAAK,EAAC,MAAM,UAAU,CAAC;AAE/B;;GAEG;AACH,oBAAY,UAAU,GAAG;IACvB,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;CACxB,CAAC;AAGF,aAAK,WAAW,CAAC,CAAC,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAEhD;;;;;;;GAOG;AACH,aAAK,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GACpC,KAAK,GACL,CAAC,SAAS,WAAW,CAAC,MAAM,CAAC,CAAC,GAC9B,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,GAClB,KAAK,CAAC,GAAG,CACP,CAAC,SAAS,MAAM,iBAAiB,GAC7B,iBAAiB,CAAC,CAAC,CAAC,GACpB,CAAC,SAAS,gBAAgB,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,GACxC,CAAC,SAAS,MAAM,iBAAiB,GAC/B,iBAAiB,CAAC,CAAC,CAAC,GACpB,CAAC,GACH,CAAC,CACN,CAAC;AAEN;;;;GAIG;AACH,oBAAY,cAAc,CAAC,CAAC,EAAE,WAAW,SAAS,KAAK,CAAC,WAAW,IAAI,CAAC,GACtE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,CAAC,GAAG;IACxD;;;;;OAKG;IACH,G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,EACZ,EAAE,SAAS,EAAE,EACb,EAAE,SAAS,EAAE,EACb,EAAE,SAAS,EAAE,EACb,EAAE,SAAS,EAAE,EAEb,KAAK,EAAE,YAAY,CAAC,CAAC,EAAE,EAAE,CAAC,EAC1B,KAAK,EAAE,YAAY,CAAC,CAAC,EAAE,EAAE,CAAC,EAC1B,KAAK,EAAE,YAAY,CAAC,CAAC,EAAE,EAAE,CAAC,EAC1B,KAAK,EAAE,YAAY,CAAC,CAAC,EAAE,EAAE,CAAC,GACzB,YAAY,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;AACtC,wBAAgB,iBAAiB,CAC/B,CAAC,SAAS,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,EACzB,CAAC,EACD,CAAC,SAAS,EAAE,EACZ,EAAE,SAAS,EAAE,EACb,EAAE,SAAS,EAAE,EACb,EAAE,SAAS,EAAE,EACb,EAAE,SAAS,EAAE,EACb,EAAE,SAAS,EAAE,EAEb,KAAK,EAAE,YAAY,CAAC,CAAC,EAAE,EAAE,CAAC,EAC1B,KAAK,EAAE,YAAY,CAAC,CAAC,EAAE,EAAE,CAAC,EAC1B,KAAK,EAAE,YAAY,CAAC,CAAC,EAAE,EAAE,CAAC,EAC1B,KAAK,EAAE,YAAY,CAAC,CAAC,EAAE,EAAE,CAAC,EAC1B,KAAK,EAAE,YAAY,CAAC,CAAC,EAAE,EAAE,CAAC,GACzB,YAAY,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
1
|
+
import { DeprecatedLayout } from './lib/Layout';
|
|
2
|
+
import { DeprecatedColumn } from './lib/Column';
|
|
3
|
+
export { DeprecatedLayout, DeprecatedColumn };
|
|
4
4
|
export * from './lib/Box';
|
|
5
5
|
export * from './lib/utils/border';
|
|
6
6
|
export * from './lib/utils/color';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAC,CAAC;AAC7C,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/es6/layout/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
1
|
+
import { DeprecatedLayout } from './lib/Layout';
|
|
2
|
+
import { DeprecatedColumn } from './lib/Column';
|
|
3
|
+
export { DeprecatedLayout, DeprecatedColumn };
|
|
4
4
|
export * from './lib/Box';
|
|
5
5
|
export * from './lib/utils/border';
|
|
6
6
|
export * from './lib/utils/color';
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* ### Deprecated Layout Column Props
|
|
4
|
+
*
|
|
5
|
+
* As of Canvas Kit v8, Layout is being soft-deprecated.
|
|
6
|
+
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
7
|
+
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
8
|
+
* for more information.
|
|
9
|
+
*/
|
|
10
|
+
export interface DeprecatedColumnProps {
|
|
3
11
|
/**
|
|
4
|
-
* The children of the
|
|
12
|
+
* The children of the DeprecatedColumn (cannot be empty).
|
|
5
13
|
*/
|
|
6
14
|
children?: React.ReactNode;
|
|
7
15
|
/**
|
|
8
|
-
* The left and right padding of the
|
|
16
|
+
* The left and right padding of the DeprecatedColumn (inherits from Layout prop).
|
|
9
17
|
* @default 12
|
|
10
18
|
*/
|
|
11
19
|
spacing?: number;
|
|
@@ -18,7 +26,8 @@ export interface ColumnProps {
|
|
|
18
26
|
*/
|
|
19
27
|
width?: number | string;
|
|
20
28
|
}
|
|
21
|
-
export declare class
|
|
29
|
+
export declare class DeprecatedColumn extends React.Component<DeprecatedColumnProps> {
|
|
30
|
+
componentDidMount(): void;
|
|
22
31
|
render(): JSX.Element;
|
|
23
32
|
}
|
|
24
33
|
//# sourceMappingURL=Column.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Column.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Column.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"Column.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Column.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;IAC3D;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAsCD,qBAAa,gBAAiB,SAAQ,KAAK,CAAC,SAAS,CAAC,qBAAqB,CAAC;IAC1E,iBAAiB;IASV,MAAM;CASd"}
|
|
@@ -67,15 +67,18 @@ var ColumnContainer = styled('div', {
|
|
|
67
67
|
}
|
|
68
68
|
return { flex: 1 };
|
|
69
69
|
});
|
|
70
|
-
var
|
|
71
|
-
__extends(
|
|
72
|
-
function
|
|
70
|
+
var DeprecatedColumn = /** @class */ (function (_super) {
|
|
71
|
+
__extends(DeprecatedColumn, _super);
|
|
72
|
+
function DeprecatedColumn() {
|
|
73
73
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
74
74
|
}
|
|
75
|
-
|
|
75
|
+
DeprecatedColumn.prototype.componentDidMount = function () {
|
|
76
|
+
console.warn("This component is being deprecated and will be removed in Canvas Kit V9.\n\n For more information, please see the V8 upgrade guide:\n\n https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page\n ");
|
|
77
|
+
};
|
|
78
|
+
DeprecatedColumn.prototype.render = function () {
|
|
76
79
|
var _a = this.props, children = _a.children, spacing = _a.spacing, columns = _a.columns, width = _a.width, elemProps = __rest(_a, ["children", "spacing", "columns", "width"]);
|
|
77
80
|
return (React.createElement(ColumnContainer, __assign({ spacing: spacing, columns: columns, width: width }, elemProps), children));
|
|
78
81
|
};
|
|
79
|
-
return
|
|
82
|
+
return DeprecatedColumn;
|
|
80
83
|
}(React.Component));
|
|
81
|
-
export {
|
|
84
|
+
export { DeprecatedColumn };
|
|
@@ -1,27 +1,44 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { DeprecatedColumn, DeprecatedColumnProps } from './Column';
|
|
3
|
+
/**
|
|
4
|
+
* ### Deprecated Layout Props
|
|
5
|
+
*
|
|
6
|
+
* As of Canvas Kit v8, Layout is being soft-deprecated.
|
|
7
|
+
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
8
|
+
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
9
|
+
* for more information.
|
|
10
|
+
*/
|
|
11
|
+
export interface DeprecatedLayoutProps {
|
|
4
12
|
/**
|
|
5
|
-
* The children of the
|
|
13
|
+
* The children of the DeprecatedLayout (cannot be empty).
|
|
6
14
|
*/
|
|
7
|
-
children: React.ReactElement<
|
|
15
|
+
children: React.ReactElement<DeprecatedColumnProps>[] | React.ReactNode;
|
|
8
16
|
/**
|
|
9
|
-
* The spacing of the
|
|
17
|
+
* The spacing of the DeprecatedLayout children.
|
|
10
18
|
*/
|
|
11
19
|
spacing?: number;
|
|
12
20
|
/**
|
|
13
|
-
* The padding of the
|
|
21
|
+
* The padding of the DeprecatedLayout's outside container.
|
|
14
22
|
* @default 12
|
|
15
23
|
*/
|
|
16
24
|
gutter?: number | string;
|
|
17
25
|
/**
|
|
18
|
-
* If true, set the max width of the
|
|
26
|
+
* If true, set the max width of the DeprecatedLayout container to `1280px`.
|
|
19
27
|
* @default false
|
|
20
28
|
*/
|
|
21
29
|
capWidth?: boolean;
|
|
22
30
|
}
|
|
23
|
-
|
|
24
|
-
|
|
31
|
+
/**
|
|
32
|
+
* ### Deprecated Layout
|
|
33
|
+
*
|
|
34
|
+
* As of Canvas Kit v8, Layout is being soft-deprecated.
|
|
35
|
+
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
36
|
+
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
37
|
+
* for more information.
|
|
38
|
+
*/
|
|
39
|
+
export declare class DeprecatedLayout extends React.Component<DeprecatedLayoutProps> {
|
|
40
|
+
componentDidMount(): void;
|
|
41
|
+
static Column: typeof DeprecatedColumn;
|
|
25
42
|
private renderChild;
|
|
26
43
|
render(): JSX.Element;
|
|
27
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAC,gBAAgB,EAAE,qBAAqB,EAAC,MAAM,UAAU,CAAC;AAIjE;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,qBAAqB,CAAC,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC;IACxE;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAkCD;;;;;;;GAOG;AACH,qBAAa,gBAAiB,SAAQ,KAAK,CAAC,SAAS,CAAC,qBAAqB,CAAC;IAC1E,iBAAiB;IASjB,OAAc,MAAM,0BAAoB;IAExC,OAAO,CAAC,WAAW,CAgBjB;IAEK,MAAM;CAed"}
|
|
@@ -35,7 +35,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
35
35
|
};
|
|
36
36
|
import * as React from 'react';
|
|
37
37
|
import styled from '@emotion/styled';
|
|
38
|
-
import {
|
|
38
|
+
import { DeprecatedColumn } from './Column';
|
|
39
39
|
import { canvas, spaceNumbers } from '@workday/canvas-kit-react/tokens';
|
|
40
40
|
import isPropValid from '@emotion/is-prop-valid';
|
|
41
41
|
var LayoutStyles = {
|
|
@@ -64,15 +64,23 @@ var LayoutContainer = styled('div', {
|
|
|
64
64
|
margin: '0 auto',
|
|
65
65
|
};
|
|
66
66
|
});
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
/**
|
|
68
|
+
* ### Deprecated Layout
|
|
69
|
+
*
|
|
70
|
+
* As of Canvas Kit v8, Layout is being soft-deprecated.
|
|
71
|
+
* It will be hard-deprecated (completely removed) in v9. Please see the
|
|
72
|
+
* [upgrade guide](https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page)
|
|
73
|
+
* for more information.
|
|
74
|
+
*/
|
|
75
|
+
var DeprecatedLayout = /** @class */ (function (_super) {
|
|
76
|
+
__extends(DeprecatedLayout, _super);
|
|
77
|
+
function DeprecatedLayout() {
|
|
70
78
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
71
79
|
_this.renderChild = function (child, spacing) {
|
|
72
80
|
if (!React.isValidElement(child)) {
|
|
73
81
|
return;
|
|
74
82
|
}
|
|
75
|
-
if (child.type ===
|
|
83
|
+
if (child.type === DeprecatedColumn) {
|
|
76
84
|
var childProps = child.props;
|
|
77
85
|
if (childProps.spacing || childProps.spacing === 0) {
|
|
78
86
|
return child;
|
|
@@ -83,13 +91,16 @@ var Layout = /** @class */ (function (_super) {
|
|
|
83
91
|
};
|
|
84
92
|
return _this;
|
|
85
93
|
}
|
|
86
|
-
|
|
94
|
+
DeprecatedLayout.prototype.componentDidMount = function () {
|
|
95
|
+
console.warn("This component is being deprecated and will be removed in Canvas Kit V9.\n\n For more information, please see the V8 upgrade guide:\n\n https://workday.github.io/canvas-kit/?path=/story/welcome-upgrade-guides-v8-0--page\n ");
|
|
96
|
+
};
|
|
97
|
+
DeprecatedLayout.prototype.render = function () {
|
|
87
98
|
var _this = this;
|
|
88
99
|
var _a = this.props, _b = _a.gutter, gutter = _b === void 0 ? canvas.space.xs : _b, _c = _a.spacing, spacing = _c === void 0 ? spaceNumbers.xs : _c, children = _a.children, capWidth = _a.capWidth, elemProps = __rest(_a, ["gutter", "spacing", "children", "capWidth"]);
|
|
89
100
|
return (React.createElement(LayoutContainer, __assign({ spacing: spacing, gutter: gutter, capWidth: capWidth }, elemProps), React.Children.map(children, function (child) { return _this.renderChild(child, spacing); })));
|
|
90
101
|
};
|
|
91
|
-
|
|
92
|
-
return
|
|
102
|
+
DeprecatedLayout.Column = DeprecatedColumn;
|
|
103
|
+
return DeprecatedLayout;
|
|
93
104
|
}(React.Component));
|
|
94
|
-
export {
|
|
95
|
-
|
|
105
|
+
export { DeprecatedLayout };
|
|
106
|
+
DeprecatedLayout.Column = DeprecatedColumn;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { ButtonContainerProps } from '@workday/canvas-kit-react/button';
|
|
1
2
|
import { CanvasSystemIcon } from '@workday/design-assets-types';
|
|
2
|
-
export interface SegmentedControlButtonProps {
|
|
3
|
+
export interface SegmentedControlButtonProps extends ButtonContainerProps {
|
|
3
4
|
toggled?: boolean;
|
|
4
5
|
icon: CanvasSystemIcon;
|
|
5
6
|
value?: string | number;
|
|
7
|
+
size?: 'small' | 'medium' | 'large';
|
|
6
8
|
}
|
|
7
9
|
export declare const SegmentedControlButton: import("../../common").ElementComponent<"button", SegmentedControlButtonProps>;
|
|
8
10
|
//# sourceMappingURL=SegmentedControlButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SegmentedControlButton.d.ts","sourceRoot":"","sources":["../../../../segmented-control/lib/SegmentedControlButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SegmentedControlButton.d.ts","sourceRoot":"","sources":["../../../../segmented-control/lib/SegmentedControlButton.tsx"],"names":[],"mappings":"AACA,OAAO,EAIL,oBAAoB,EACrB,MAAM,kCAAkC,CAAC;AAO1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAyF9D,MAAM,WAAW,2BAA4B,SAAQ,oBAAoB;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;CACrC;AAED,eAAO,MAAM,sBAAsB,gFAiBjC,CAAC"}
|
|
@@ -21,7 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import React from 'react';
|
|
24
|
-
import { BaseButton } from '@workday/canvas-kit-react/button';
|
|
24
|
+
import { BaseButton, } from '@workday/canvas-kit-react/button';
|
|
25
25
|
import { createComponent, mouseFocusBehavior, styled, } from '@workday/canvas-kit-react/common';
|
|
26
26
|
import { colors, borderRadius, space } from '@workday/canvas-kit-react/tokens';
|
|
27
27
|
var getIconButtonColors = function (toggled) {
|
|
@@ -49,11 +49,17 @@ var getIconButtonColors = function (toggled) {
|
|
|
49
49
|
},
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
|
+
var getSizeStyles = function (size) {
|
|
53
|
+
var sizeValue = size === 'large' ? "calc(" + space.xl + " + " + space.xxs + ")" : size === 'small' ? space.l : space.xl;
|
|
54
|
+
return {
|
|
55
|
+
width: sizeValue,
|
|
56
|
+
height: sizeValue,
|
|
57
|
+
};
|
|
58
|
+
};
|
|
52
59
|
var StyledButton = styled(BaseButton)({
|
|
53
60
|
borderRadius: borderRadius.zero,
|
|
54
61
|
border: "1px solid " + colors.soap500,
|
|
55
62
|
borderLeft: 'none',
|
|
56
|
-
minWidth: space.xl,
|
|
57
63
|
'&:first-of-type': {
|
|
58
64
|
borderRadius: borderRadius.m + " 0 0 " + borderRadius.m,
|
|
59
65
|
borderLeft: "1px solid " + colors.soap500,
|
|
@@ -88,12 +94,15 @@ var StyledButton = styled(BaseButton)({
|
|
|
88
94
|
},
|
|
89
95
|
},
|
|
90
96
|
});
|
|
97
|
+
}, function (_a) {
|
|
98
|
+
var size = _a.size;
|
|
99
|
+
return (__assign({}, getSizeStyles(size)));
|
|
91
100
|
});
|
|
92
101
|
export var SegmentedControlButton = createComponent('button')({
|
|
93
102
|
displayName: 'Button',
|
|
94
103
|
Component: function (_a, ref, Element) {
|
|
95
104
|
var value = _a.value, icon = _a.icon, toggled = _a.toggled, props = __rest(_a, ["value", "icon", "toggled"]);
|
|
96
105
|
return (React.createElement(StyledButton, __assign({ as: Element, "aria-pressed": toggled, value: value, colors: getIconButtonColors(toggled), fillIcon: toggled, ref: ref }, props),
|
|
97
|
-
React.createElement(BaseButton.Icon, { size:
|
|
106
|
+
React.createElement(BaseButton.Icon, { size: props.size || 'large', icon: icon })));
|
|
98
107
|
},
|
|
99
108
|
});
|
package/layout/README.md
CHANGED
|
@@ -14,26 +14,27 @@ For more detailed information on this component, please refer to the
|
|
|
14
14
|
# Canvas Kit Layout
|
|
15
15
|
|
|
16
16
|
The layout component is used to create layouts for your application. The component comes with the
|
|
17
|
-
`
|
|
18
|
-
different workday specific layouts. Layouts should be used to create the main layout
|
|
17
|
+
`DeprecatedLayout` and `DeprecatedColumn` component. Layout and Columns can be utilized to create a
|
|
18
|
+
combination of different workday specific layouts. Layouts should be used to create the main layout
|
|
19
|
+
on the page.
|
|
19
20
|
|
|
20
|
-
# Layout
|
|
21
|
+
# Layout (deprecated)
|
|
21
22
|
|
|
22
23
|
> Layout Container
|
|
23
24
|
|
|
24
25
|
## Usage
|
|
25
26
|
|
|
26
27
|
```tsx
|
|
27
|
-
import {
|
|
28
|
+
import {DeprecatedLayout} from '@workday/canvas-kit-react/layout';
|
|
28
29
|
|
|
29
30
|
// Basic
|
|
30
|
-
<
|
|
31
|
+
<DeprecatedLayout>...</DeprecatedLayout>
|
|
31
32
|
|
|
32
33
|
// No spacing and no gutter
|
|
33
|
-
<
|
|
34
|
+
<DeprecatedLayout gutter={0} spacing={0}>...</DeprecatedLayout>
|
|
34
35
|
|
|
35
36
|
// Layout with a max container width
|
|
36
|
-
<
|
|
37
|
+
<DeprecatedLayout capWidth={true}>...</DeprecatedLayout>
|
|
37
38
|
```
|
|
38
39
|
|
|
39
40
|
## Static Properties
|
|
@@ -70,39 +71,39 @@ Default: `12`
|
|
|
70
71
|
|
|
71
72
|
---
|
|
72
73
|
|
|
73
|
-
# Column
|
|
74
|
+
# Column (deprecated)
|
|
74
75
|
|
|
75
76
|
> The column acts as a pillar for building layouts. Columns widths can be fluid, 12 columns, or a
|
|
76
|
-
> fixed. Columns should be used exclusively with `
|
|
77
|
-
> and `columns` props are mutually exclusive. The `width` prop will take precedence over the
|
|
77
|
+
> fixed. Columns should be used exclusively with `DeprecatedLayout` to build the main page layouts.
|
|
78
|
+
> `width` and `columns` props are mutually exclusive. The `width` prop will take precedence over the
|
|
78
79
|
> `columns` prop.
|
|
79
80
|
|
|
80
81
|
```tsx
|
|
81
|
-
import {
|
|
82
|
+
import {DeprecatedLayout} from '@workday/canvas-kit-react/layout';
|
|
82
83
|
|
|
83
84
|
// Fluid layouts
|
|
84
|
-
<
|
|
85
|
-
<
|
|
86
|
-
<
|
|
87
|
-
</
|
|
85
|
+
<DeprecatedLayout>
|
|
86
|
+
<DeprecatedLayout.Column />
|
|
87
|
+
<DeprecatedLayout.Column />
|
|
88
|
+
</DeprecatedLayout>
|
|
88
89
|
|
|
89
90
|
// 12 column layouts
|
|
90
|
-
<
|
|
91
|
-
<
|
|
92
|
-
<
|
|
93
|
-
</
|
|
91
|
+
<DeprecatedLayout>
|
|
92
|
+
<DeprecatedLayout.Column columns={4}/>
|
|
93
|
+
<DeprecatedLayout.Column columns={8}/>
|
|
94
|
+
</DeprecatedLayout>
|
|
94
95
|
|
|
95
96
|
// Fixed column width
|
|
96
|
-
<
|
|
97
|
-
<
|
|
98
|
-
<
|
|
99
|
-
</
|
|
97
|
+
<DeprecatedLayout>
|
|
98
|
+
<DeprecatedLayout.Column width={'400px'}/>
|
|
99
|
+
<DeprecatedLayout.Column columns={8}/>
|
|
100
|
+
</DeprecatedLayout>
|
|
100
101
|
|
|
101
102
|
// Custom spacing
|
|
102
|
-
<
|
|
103
|
-
<
|
|
104
|
-
<
|
|
105
|
-
</
|
|
103
|
+
<DeprecatedLayout>
|
|
104
|
+
<DeprecatedLayout.Column spacing={0}/>
|
|
105
|
+
<DeprecatedLayout.Column />
|
|
106
|
+
</DeprecatedLayout>
|
|
106
107
|
```
|
|
107
108
|
|
|
108
109
|
## Static Properties
|