@workday/canvas-kit-react 6.0.0-alpha.0-next.27 → 6.0.0-alpha.0-next.31
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/lib/PrimaryButton.tsx +110 -32
- package/button/lib/SecondaryButton.tsx +31 -16
- package/button/lib/TertiaryButton.tsx +45 -36
- package/button/lib/parts/ButtonContainer.tsx +18 -5
- package/button/lib/parts/ButtonLabelIcon.tsx +34 -14
- package/button/lib/types.ts +11 -0
- package/dist/commonjs/button/lib/PrimaryButton.d.ts +80 -6
- package/dist/commonjs/button/lib/PrimaryButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/PrimaryButton.js +80 -26
- package/dist/commonjs/button/lib/SecondaryButton.d.ts +8 -5
- package/dist/commonjs/button/lib/SecondaryButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/SecondaryButton.js +22 -12
- package/dist/commonjs/button/lib/TertiaryButton.d.ts +8 -4
- package/dist/commonjs/button/lib/TertiaryButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/TertiaryButton.js +24 -20
- package/dist/commonjs/button/lib/parts/ButtonContainer.d.ts +5 -3
- package/dist/commonjs/button/lib/parts/ButtonContainer.d.ts.map +1 -1
- package/dist/commonjs/button/lib/parts/ButtonContainer.js +7 -9
- package/dist/commonjs/button/lib/parts/ButtonLabelIcon.d.ts +7 -4
- package/dist/commonjs/button/lib/parts/ButtonLabelIcon.d.ts.map +1 -1
- package/dist/commonjs/button/lib/parts/ButtonLabelIcon.js +28 -13
- package/dist/commonjs/button/lib/types.d.ts +9 -0
- package/dist/commonjs/button/lib/types.d.ts.map +1 -1
- package/dist/es6/button/lib/PrimaryButton.d.ts +80 -6
- package/dist/es6/button/lib/PrimaryButton.d.ts.map +1 -1
- package/dist/es6/button/lib/PrimaryButton.js +81 -27
- package/dist/es6/button/lib/SecondaryButton.d.ts +8 -5
- package/dist/es6/button/lib/SecondaryButton.d.ts.map +1 -1
- package/dist/es6/button/lib/SecondaryButton.js +22 -12
- package/dist/es6/button/lib/TertiaryButton.d.ts +8 -4
- package/dist/es6/button/lib/TertiaryButton.d.ts.map +1 -1
- package/dist/es6/button/lib/TertiaryButton.js +25 -21
- package/dist/es6/button/lib/parts/ButtonContainer.d.ts +5 -3
- package/dist/es6/button/lib/parts/ButtonContainer.d.ts.map +1 -1
- package/dist/es6/button/lib/parts/ButtonContainer.js +7 -9
- package/dist/es6/button/lib/parts/ButtonLabelIcon.d.ts +7 -4
- package/dist/es6/button/lib/parts/ButtonLabelIcon.d.ts.map +1 -1
- package/dist/es6/button/lib/parts/ButtonLabelIcon.js +28 -13
- package/dist/es6/button/lib/types.d.ts +9 -0
- package/dist/es6/button/lib/types.d.ts.map +1 -1
- package/package.json +5 -5
- package/ts3.5/dist/commonjs/button/lib/PrimaryButton.d.ts +80 -6
- package/ts3.5/dist/commonjs/button/lib/SecondaryButton.d.ts +8 -5
- package/ts3.5/dist/commonjs/button/lib/TertiaryButton.d.ts +8 -4
- package/ts3.5/dist/commonjs/button/lib/parts/ButtonContainer.d.ts +5 -3
- package/ts3.5/dist/commonjs/button/lib/parts/ButtonLabelIcon.d.ts +7 -4
- package/ts3.5/dist/commonjs/button/lib/types.d.ts +9 -0
- package/ts3.5/dist/es6/button/lib/PrimaryButton.d.ts +80 -6
- package/ts3.5/dist/es6/button/lib/SecondaryButton.d.ts +8 -5
- package/ts3.5/dist/es6/button/lib/TertiaryButton.d.ts +8 -4
- package/ts3.5/dist/es6/button/lib/parts/ButtonContainer.d.ts +5 -3
- package/ts3.5/dist/es6/button/lib/parts/ButtonLabelIcon.d.ts +7 -4
- package/ts3.5/dist/es6/button/lib/types.d.ts +9 -0
|
@@ -19,4 +19,13 @@ export interface ButtonColors {
|
|
|
19
19
|
};
|
|
20
20
|
disabled: ButtonStateColors;
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* There are four button sizes: `extraSmall`, `small`, `medium`, and `large`.
|
|
24
|
+
* If no size is provided, it will default to `medium`.
|
|
25
|
+
*
|
|
26
|
+
* @default 'medium'
|
|
27
|
+
*/
|
|
28
|
+
export declare type ButtonSizes = 'extraSmall' | 'small' | 'medium' | 'large';
|
|
29
|
+
export declare type TertiaryButtonSizes = 'extraSmall' | 'small' | 'medium';
|
|
30
|
+
export declare type IconPositions = 'left' | 'right';
|
|
22
31
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../button/lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAExC;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AACD,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,KAAK,EAAE,iBAAiB,CAAC;IACzB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,KAAK,EAAE,iBAAiB,GAAG;QACzB,SAAS,CAAC,EAAE,SAAS,CAAC;KACvB,CAAC;IACF,QAAQ,EAAE,iBAAiB,CAAC;CAC7B"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../button/lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAExC;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AACD,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,KAAK,EAAE,iBAAiB,CAAC;IACzB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,KAAK,EAAE,iBAAiB,GAAG;QACzB,SAAS,CAAC,EAAE,SAAS,CAAC;KACvB,CAAC;IACF,QAAQ,EAAE,iBAAiB,CAAC;CAC7B;AAED;;;;;GAKG;AACH,oBAAY,WAAW,GAAG,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEtE,oBAAY,mBAAmB,GAAG,YAAY,GAAG,OAAO,GAAG,QAAQ,CAAC;AACpE,oBAAY,aAAa,GAAG,MAAM,GAAG,OAAO,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-react",
|
|
3
|
-
"version": "6.0.0-alpha.0-next.
|
|
3
|
+
"version": "6.0.0-alpha.0-next.31+17cf46c1",
|
|
4
4
|
"description": "The parent module that contains all Workday Canvas Kit React components",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -56,9 +56,9 @@
|
|
|
56
56
|
"@emotion/styled": "^10.0.27",
|
|
57
57
|
"@popperjs/core": "^2.5.4",
|
|
58
58
|
"@workday/canvas-colors-web": "^2.0.0",
|
|
59
|
-
"@workday/canvas-kit-labs-react": "^6.0.0-alpha.0-next.
|
|
60
|
-
"@workday/canvas-kit-popup-stack": "^6.0.0-alpha.0-next.
|
|
61
|
-
"@workday/canvas-kit-preview-react": "^6.0.0-alpha.0-next.
|
|
59
|
+
"@workday/canvas-kit-labs-react": "^6.0.0-alpha.0-next.31+17cf46c1",
|
|
60
|
+
"@workday/canvas-kit-popup-stack": "^6.0.0-alpha.0-next.31+17cf46c1",
|
|
61
|
+
"@workday/canvas-kit-preview-react": "^6.0.0-alpha.0-next.31+17cf46c1",
|
|
62
62
|
"@workday/canvas-system-icons-web": "1.0.41",
|
|
63
63
|
"@workday/design-assets-types": "^0.2.4",
|
|
64
64
|
"chroma-js": "^2.1.0",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"@workday/canvas-accent-icons-web": "^1.0.0",
|
|
75
75
|
"@workday/canvas-applet-icons-web": "^0.17.50"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "17cf46c147e4ccad22b84011924c73456d63e252"
|
|
78
78
|
}
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
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
|
-
import {
|
|
4
|
+
import { ButtonSizes, IconPositions } from './types';
|
|
5
5
|
export interface PrimaryButtonProps extends Themeable, GrowthBehavior {
|
|
6
6
|
/**
|
|
7
|
-
* The
|
|
7
|
+
* The variant of the PrimaryButton.
|
|
8
|
+
* @default undefined
|
|
9
|
+
*/
|
|
10
|
+
variant?: 'inverse';
|
|
11
|
+
/**
|
|
12
|
+
* There are four button sizes: `extraSmall`, `small`, `medium`, and `large`.
|
|
13
|
+
* If no size is provided, it will default to `medium`.
|
|
14
|
+
*
|
|
8
15
|
* @default 'medium'
|
|
9
16
|
*/
|
|
10
|
-
size?:
|
|
17
|
+
size?: ButtonSizes;
|
|
11
18
|
/**
|
|
12
19
|
* The data label of the Button.
|
|
13
20
|
* Note: not displayed at `small` size
|
|
@@ -19,10 +26,11 @@ export interface PrimaryButtonProps extends Themeable, GrowthBehavior {
|
|
|
19
26
|
*/
|
|
20
27
|
icon?: CanvasSystemIcon;
|
|
21
28
|
/**
|
|
22
|
-
*
|
|
29
|
+
* Button icon positions can either be `left` or `right`.
|
|
30
|
+
* If no value is provided, it defaults to `left`.
|
|
23
31
|
* @default 'left'
|
|
24
32
|
*/
|
|
25
|
-
iconPosition?:
|
|
33
|
+
iconPosition?: IconPositions;
|
|
26
34
|
/**
|
|
27
35
|
* If set to `true`, transform the icon's x-axis to mirror the graphic
|
|
28
36
|
* @default false
|
|
@@ -31,5 +39,71 @@ export interface PrimaryButtonProps extends Themeable, GrowthBehavior {
|
|
|
31
39
|
children?: React.ReactNode;
|
|
32
40
|
}
|
|
33
41
|
export declare const PrimaryButton: import("../../common").ElementComponent<"button", PrimaryButtonProps>;
|
|
34
|
-
export declare const getPrimaryButtonColors: (
|
|
42
|
+
export declare const getPrimaryButtonColors: (variant: "inverse" | undefined, theme: EmotionCanvasTheme) => {
|
|
43
|
+
default: {
|
|
44
|
+
background: string;
|
|
45
|
+
icon: string;
|
|
46
|
+
label: string;
|
|
47
|
+
labelData?: undefined;
|
|
48
|
+
};
|
|
49
|
+
hover: {
|
|
50
|
+
background: string;
|
|
51
|
+
icon?: undefined;
|
|
52
|
+
label?: undefined;
|
|
53
|
+
labelData?: undefined;
|
|
54
|
+
};
|
|
55
|
+
active: {
|
|
56
|
+
background: string;
|
|
57
|
+
icon?: undefined;
|
|
58
|
+
label?: undefined;
|
|
59
|
+
labelData?: undefined;
|
|
60
|
+
};
|
|
61
|
+
focus: {
|
|
62
|
+
background: string;
|
|
63
|
+
border?: undefined;
|
|
64
|
+
icon?: undefined;
|
|
65
|
+
label?: undefined;
|
|
66
|
+
labelData?: undefined;
|
|
67
|
+
focusRing?: undefined;
|
|
68
|
+
};
|
|
69
|
+
disabled: {
|
|
70
|
+
background: string;
|
|
71
|
+
icon?: undefined;
|
|
72
|
+
label?: undefined;
|
|
73
|
+
labelData?: undefined;
|
|
74
|
+
};
|
|
75
|
+
} | {
|
|
76
|
+
default: {
|
|
77
|
+
background: string;
|
|
78
|
+
icon: string;
|
|
79
|
+
label: string;
|
|
80
|
+
labelData: string;
|
|
81
|
+
};
|
|
82
|
+
hover: {
|
|
83
|
+
background: string;
|
|
84
|
+
icon: string;
|
|
85
|
+
label: string;
|
|
86
|
+
labelData: string;
|
|
87
|
+
};
|
|
88
|
+
active: {
|
|
89
|
+
background: string;
|
|
90
|
+
icon: string;
|
|
91
|
+
label: string;
|
|
92
|
+
labelData: string;
|
|
93
|
+
};
|
|
94
|
+
focus: {
|
|
95
|
+
background: string;
|
|
96
|
+
border: string;
|
|
97
|
+
icon: string;
|
|
98
|
+
label: string;
|
|
99
|
+
labelData: string;
|
|
100
|
+
focusRing: import("@emotion/serialize").CSSObject;
|
|
101
|
+
};
|
|
102
|
+
disabled: {
|
|
103
|
+
background: string;
|
|
104
|
+
icon: string;
|
|
105
|
+
label: string;
|
|
106
|
+
labelData: string;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
35
109
|
//# sourceMappingURL=PrimaryButton.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
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
|
-
import { ButtonColors } from './types';
|
|
4
|
+
import { ButtonColors, ButtonSizes, IconPositions } from './types';
|
|
5
5
|
export interface SecondaryButtonProps extends Themeable, GrowthBehavior {
|
|
6
6
|
/**
|
|
7
7
|
* The variant of the SecondaryButton.
|
|
@@ -9,10 +9,12 @@ export interface SecondaryButtonProps extends Themeable, GrowthBehavior {
|
|
|
9
9
|
*/
|
|
10
10
|
variant?: 'inverse' | undefined;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* There are four button sizes: `extraSmall`, `small`, `medium`, and `large`.
|
|
13
|
+
* If no size is provided, it will default to `medium`.
|
|
14
|
+
*
|
|
13
15
|
* @default 'medium'
|
|
14
16
|
*/
|
|
15
|
-
size?:
|
|
17
|
+
size?: ButtonSizes;
|
|
16
18
|
/**
|
|
17
19
|
* The data label of the Button.
|
|
18
20
|
* Note: not displayed at `small` size
|
|
@@ -24,10 +26,11 @@ export interface SecondaryButtonProps extends Themeable, GrowthBehavior {
|
|
|
24
26
|
*/
|
|
25
27
|
icon?: CanvasSystemIcon;
|
|
26
28
|
/**
|
|
27
|
-
*
|
|
29
|
+
* Button icon positions can either be `left` or `right`.
|
|
30
|
+
* If no value is provided, it defaults to `left`.
|
|
28
31
|
* @default 'left'
|
|
29
32
|
*/
|
|
30
|
-
iconPosition?:
|
|
33
|
+
iconPosition?: IconPositions;
|
|
31
34
|
/**
|
|
32
35
|
* If set to `true`, transform the icon's x-axis to mirror the graphic
|
|
33
36
|
* @default false
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
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
|
+
import { TertiaryButtonSizes, IconPositions } from './types';
|
|
4
5
|
export interface TertiaryButtonProps extends Themeable {
|
|
5
6
|
/**
|
|
6
7
|
* The variant of the TertiaryButton.
|
|
@@ -8,15 +9,18 @@ export interface TertiaryButtonProps extends Themeable {
|
|
|
8
9
|
*/
|
|
9
10
|
variant?: 'inverse' | undefined;
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
+
* There are three button sizes: `extraSmall`, `small`, and `medium`.
|
|
13
|
+
* If no size is provided, it will default to `medium`.
|
|
14
|
+
*
|
|
12
15
|
* @default 'medium'
|
|
13
16
|
*/
|
|
14
|
-
size?:
|
|
17
|
+
size?: TertiaryButtonSizes;
|
|
15
18
|
/**
|
|
16
|
-
*
|
|
19
|
+
* Button icon positions can either be `left` or `right`.
|
|
20
|
+
* If no value is provided, it defaults to `left`.
|
|
17
21
|
* @default 'left'
|
|
18
22
|
*/
|
|
19
|
-
iconPosition?:
|
|
23
|
+
iconPosition?: IconPositions;
|
|
20
24
|
/**
|
|
21
25
|
* The icon of the TertiaryButton.
|
|
22
26
|
*/
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { CSSObject } from '@emotion/core';
|
|
3
3
|
import { GrowthBehavior, EmotionCanvasTheme, StyledType } from '@workday/canvas-kit-react/common';
|
|
4
|
-
import { ButtonColors } from '../types';
|
|
4
|
+
import { ButtonColors, ButtonSizes } from '../types';
|
|
5
5
|
export interface ButtonContainerProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, GrowthBehavior {
|
|
6
6
|
colors?: ButtonColors;
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* There are four button sizes: `extraSmall`, `small`, `medium`, and `large`.
|
|
9
|
+
* If no size is provided, it will default to `medium`.
|
|
10
|
+
*
|
|
9
11
|
* @default 'medium'
|
|
10
12
|
*/
|
|
11
|
-
size?:
|
|
13
|
+
size?: ButtonSizes;
|
|
12
14
|
/**
|
|
13
15
|
* The ref to the button that the styled component renders.
|
|
14
16
|
*/
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import { CanvasSystemIcon } from '@workday/design-assets-types';
|
|
2
|
+
import { ButtonSizes, IconPositions } from '../types';
|
|
2
3
|
export interface ButtonLabelIconProps {
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
+
* There are four button sizes: `extraSmall`, `small`, `medium`, and `large`.
|
|
6
|
+
*
|
|
5
7
|
* @default 'medium'
|
|
6
8
|
*/
|
|
7
|
-
size?:
|
|
9
|
+
size?: ButtonSizes;
|
|
8
10
|
/**
|
|
9
11
|
* The icon of the Button.
|
|
10
12
|
* Note: not displayed at `small` size
|
|
11
13
|
*/
|
|
12
14
|
icon?: CanvasSystemIcon;
|
|
13
15
|
/**
|
|
14
|
-
*
|
|
16
|
+
* Button icon positions can either be `left` or `right`.
|
|
17
|
+
* If no value is provided, it defaults to `left`.
|
|
15
18
|
* @default 'left'
|
|
16
19
|
*/
|
|
17
|
-
iconPosition?:
|
|
20
|
+
iconPosition?: IconPositions;
|
|
18
21
|
/**
|
|
19
22
|
* If set to `true`, transform the icon's x-axis to mirror the graphic
|
|
20
23
|
* @default false
|
|
@@ -19,4 +19,13 @@ export interface ButtonColors {
|
|
|
19
19
|
};
|
|
20
20
|
disabled: ButtonStateColors;
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* There are four button sizes: `extraSmall`, `small`, `medium`, and `large`.
|
|
24
|
+
* If no size is provided, it will default to `medium`.
|
|
25
|
+
*
|
|
26
|
+
* @default 'medium'
|
|
27
|
+
*/
|
|
28
|
+
export declare type ButtonSizes = 'extraSmall' | 'small' | 'medium' | 'large';
|
|
29
|
+
export declare type TertiaryButtonSizes = 'extraSmall' | 'small' | 'medium';
|
|
30
|
+
export declare type IconPositions = 'left' | 'right';
|
|
22
31
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
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
|
-
import {
|
|
4
|
+
import { ButtonSizes, IconPositions } from './types';
|
|
5
5
|
export interface PrimaryButtonProps extends Themeable, GrowthBehavior {
|
|
6
6
|
/**
|
|
7
|
-
* The
|
|
7
|
+
* The variant of the PrimaryButton.
|
|
8
|
+
* @default undefined
|
|
9
|
+
*/
|
|
10
|
+
variant?: 'inverse';
|
|
11
|
+
/**
|
|
12
|
+
* There are four button sizes: `extraSmall`, `small`, `medium`, and `large`.
|
|
13
|
+
* If no size is provided, it will default to `medium`.
|
|
14
|
+
*
|
|
8
15
|
* @default 'medium'
|
|
9
16
|
*/
|
|
10
|
-
size?:
|
|
17
|
+
size?: ButtonSizes;
|
|
11
18
|
/**
|
|
12
19
|
* The data label of the Button.
|
|
13
20
|
* Note: not displayed at `small` size
|
|
@@ -19,10 +26,11 @@ export interface PrimaryButtonProps extends Themeable, GrowthBehavior {
|
|
|
19
26
|
*/
|
|
20
27
|
icon?: CanvasSystemIcon;
|
|
21
28
|
/**
|
|
22
|
-
*
|
|
29
|
+
* Button icon positions can either be `left` or `right`.
|
|
30
|
+
* If no value is provided, it defaults to `left`.
|
|
23
31
|
* @default 'left'
|
|
24
32
|
*/
|
|
25
|
-
iconPosition?:
|
|
33
|
+
iconPosition?: IconPositions;
|
|
26
34
|
/**
|
|
27
35
|
* If set to `true`, transform the icon's x-axis to mirror the graphic
|
|
28
36
|
* @default false
|
|
@@ -31,5 +39,71 @@ export interface PrimaryButtonProps extends Themeable, GrowthBehavior {
|
|
|
31
39
|
children?: React.ReactNode;
|
|
32
40
|
}
|
|
33
41
|
export declare const PrimaryButton: import("../../common").ElementComponent<"button", PrimaryButtonProps>;
|
|
34
|
-
export declare const getPrimaryButtonColors: (
|
|
42
|
+
export declare const getPrimaryButtonColors: (variant: "inverse" | undefined, theme: EmotionCanvasTheme) => {
|
|
43
|
+
default: {
|
|
44
|
+
background: string;
|
|
45
|
+
icon: string;
|
|
46
|
+
label: string;
|
|
47
|
+
labelData?: undefined;
|
|
48
|
+
};
|
|
49
|
+
hover: {
|
|
50
|
+
background: string;
|
|
51
|
+
icon?: undefined;
|
|
52
|
+
label?: undefined;
|
|
53
|
+
labelData?: undefined;
|
|
54
|
+
};
|
|
55
|
+
active: {
|
|
56
|
+
background: string;
|
|
57
|
+
icon?: undefined;
|
|
58
|
+
label?: undefined;
|
|
59
|
+
labelData?: undefined;
|
|
60
|
+
};
|
|
61
|
+
focus: {
|
|
62
|
+
background: string;
|
|
63
|
+
border?: undefined;
|
|
64
|
+
icon?: undefined;
|
|
65
|
+
label?: undefined;
|
|
66
|
+
labelData?: undefined;
|
|
67
|
+
focusRing?: undefined;
|
|
68
|
+
};
|
|
69
|
+
disabled: {
|
|
70
|
+
background: string;
|
|
71
|
+
icon?: undefined;
|
|
72
|
+
label?: undefined;
|
|
73
|
+
labelData?: undefined;
|
|
74
|
+
};
|
|
75
|
+
} | {
|
|
76
|
+
default: {
|
|
77
|
+
background: string;
|
|
78
|
+
icon: string;
|
|
79
|
+
label: string;
|
|
80
|
+
labelData: string;
|
|
81
|
+
};
|
|
82
|
+
hover: {
|
|
83
|
+
background: string;
|
|
84
|
+
icon: string;
|
|
85
|
+
label: string;
|
|
86
|
+
labelData: string;
|
|
87
|
+
};
|
|
88
|
+
active: {
|
|
89
|
+
background: string;
|
|
90
|
+
icon: string;
|
|
91
|
+
label: string;
|
|
92
|
+
labelData: string;
|
|
93
|
+
};
|
|
94
|
+
focus: {
|
|
95
|
+
background: string;
|
|
96
|
+
border: string;
|
|
97
|
+
icon: string;
|
|
98
|
+
label: string;
|
|
99
|
+
labelData: string;
|
|
100
|
+
focusRing: import("@emotion/serialize").CSSObject;
|
|
101
|
+
};
|
|
102
|
+
disabled: {
|
|
103
|
+
background: string;
|
|
104
|
+
icon: string;
|
|
105
|
+
label: string;
|
|
106
|
+
labelData: string;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
35
109
|
//# sourceMappingURL=PrimaryButton.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
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
|
-
import { ButtonColors } from './types';
|
|
4
|
+
import { ButtonColors, ButtonSizes, IconPositions } from './types';
|
|
5
5
|
export interface SecondaryButtonProps extends Themeable, GrowthBehavior {
|
|
6
6
|
/**
|
|
7
7
|
* The variant of the SecondaryButton.
|
|
@@ -9,10 +9,12 @@ export interface SecondaryButtonProps extends Themeable, GrowthBehavior {
|
|
|
9
9
|
*/
|
|
10
10
|
variant?: 'inverse' | undefined;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* There are four button sizes: `extraSmall`, `small`, `medium`, and `large`.
|
|
13
|
+
* If no size is provided, it will default to `medium`.
|
|
14
|
+
*
|
|
13
15
|
* @default 'medium'
|
|
14
16
|
*/
|
|
15
|
-
size?:
|
|
17
|
+
size?: ButtonSizes;
|
|
16
18
|
/**
|
|
17
19
|
* The data label of the Button.
|
|
18
20
|
* Note: not displayed at `small` size
|
|
@@ -24,10 +26,11 @@ export interface SecondaryButtonProps extends Themeable, GrowthBehavior {
|
|
|
24
26
|
*/
|
|
25
27
|
icon?: CanvasSystemIcon;
|
|
26
28
|
/**
|
|
27
|
-
*
|
|
29
|
+
* Button icon positions can either be `left` or `right`.
|
|
30
|
+
* If no value is provided, it defaults to `left`.
|
|
28
31
|
* @default 'left'
|
|
29
32
|
*/
|
|
30
|
-
iconPosition?:
|
|
33
|
+
iconPosition?: IconPositions;
|
|
31
34
|
/**
|
|
32
35
|
* If set to `true`, transform the icon's x-axis to mirror the graphic
|
|
33
36
|
* @default false
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
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
|
+
import { TertiaryButtonSizes, IconPositions } from './types';
|
|
4
5
|
export interface TertiaryButtonProps extends Themeable {
|
|
5
6
|
/**
|
|
6
7
|
* The variant of the TertiaryButton.
|
|
@@ -8,15 +9,18 @@ export interface TertiaryButtonProps extends Themeable {
|
|
|
8
9
|
*/
|
|
9
10
|
variant?: 'inverse' | undefined;
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
+
* There are three button sizes: `extraSmall`, `small`, and `medium`.
|
|
13
|
+
* If no size is provided, it will default to `medium`.
|
|
14
|
+
*
|
|
12
15
|
* @default 'medium'
|
|
13
16
|
*/
|
|
14
|
-
size?:
|
|
17
|
+
size?: TertiaryButtonSizes;
|
|
15
18
|
/**
|
|
16
|
-
*
|
|
19
|
+
* Button icon positions can either be `left` or `right`.
|
|
20
|
+
* If no value is provided, it defaults to `left`.
|
|
17
21
|
* @default 'left'
|
|
18
22
|
*/
|
|
19
|
-
iconPosition?:
|
|
23
|
+
iconPosition?: IconPositions;
|
|
20
24
|
/**
|
|
21
25
|
* The icon of the TertiaryButton.
|
|
22
26
|
*/
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { CSSObject } from '@emotion/core';
|
|
3
3
|
import { GrowthBehavior, EmotionCanvasTheme, StyledType } from '@workday/canvas-kit-react/common';
|
|
4
|
-
import { ButtonColors } from '../types';
|
|
4
|
+
import { ButtonColors, ButtonSizes } from '../types';
|
|
5
5
|
export interface ButtonContainerProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, GrowthBehavior {
|
|
6
6
|
colors?: ButtonColors;
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* There are four button sizes: `extraSmall`, `small`, `medium`, and `large`.
|
|
9
|
+
* If no size is provided, it will default to `medium`.
|
|
10
|
+
*
|
|
9
11
|
* @default 'medium'
|
|
10
12
|
*/
|
|
11
|
-
size?:
|
|
13
|
+
size?: ButtonSizes;
|
|
12
14
|
/**
|
|
13
15
|
* The ref to the button that the styled component renders.
|
|
14
16
|
*/
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import { CanvasSystemIcon } from '@workday/design-assets-types';
|
|
2
|
+
import { ButtonSizes, IconPositions } from '../types';
|
|
2
3
|
export interface ButtonLabelIconProps {
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
+
* There are four button sizes: `extraSmall`, `small`, `medium`, and `large`.
|
|
6
|
+
*
|
|
5
7
|
* @default 'medium'
|
|
6
8
|
*/
|
|
7
|
-
size?:
|
|
9
|
+
size?: ButtonSizes;
|
|
8
10
|
/**
|
|
9
11
|
* The icon of the Button.
|
|
10
12
|
* Note: not displayed at `small` size
|
|
11
13
|
*/
|
|
12
14
|
icon?: CanvasSystemIcon;
|
|
13
15
|
/**
|
|
14
|
-
*
|
|
16
|
+
* Button icon positions can either be `left` or `right`.
|
|
17
|
+
* If no value is provided, it defaults to `left`.
|
|
15
18
|
* @default 'left'
|
|
16
19
|
*/
|
|
17
|
-
iconPosition?:
|
|
20
|
+
iconPosition?: IconPositions;
|
|
18
21
|
/**
|
|
19
22
|
* If set to `true`, transform the icon's x-axis to mirror the graphic
|
|
20
23
|
* @default false
|
|
@@ -19,4 +19,13 @@ export interface ButtonColors {
|
|
|
19
19
|
};
|
|
20
20
|
disabled: ButtonStateColors;
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* There are four button sizes: `extraSmall`, `small`, `medium`, and `large`.
|
|
24
|
+
* If no size is provided, it will default to `medium`.
|
|
25
|
+
*
|
|
26
|
+
* @default 'medium'
|
|
27
|
+
*/
|
|
28
|
+
export declare type ButtonSizes = 'extraSmall' | 'small' | 'medium' | 'large';
|
|
29
|
+
export declare type TertiaryButtonSizes = 'extraSmall' | 'small' | 'medium';
|
|
30
|
+
export declare type IconPositions = 'left' | 'right';
|
|
22
31
|
//# sourceMappingURL=types.d.ts.map
|