@workday/canvas-kit-react 10.0.0-alpha.538-next.0 → 10.0.0-alpha.540-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 +8 -11
- package/button/lib/BaseButton.tsx +274 -256
- package/button/lib/Button.tsx +67 -0
- package/button/lib/DeleteButton.tsx +42 -58
- package/button/lib/PrimaryButton.tsx +82 -149
- package/button/lib/SecondaryButton.tsx +87 -173
- package/button/lib/TertiaryButton.tsx +158 -223
- package/button/lib/ToolbarDropdownButton.tsx +11 -2
- package/button/lib/ToolbarIconButton.tsx +10 -2
- package/button/lib/parts/ButtonLabelIcon.tsx +1 -7
- package/button/lib/types.ts +6 -8
- package/checkbox/lib/Checkbox.tsx +24 -33
- package/common/lib/CanvasProvider.tsx +50 -24
- package/dist/commonjs/button/index.d.ts +8 -5
- package/dist/commonjs/button/index.d.ts.map +1 -1
- package/dist/commonjs/button/index.js +9 -13
- package/dist/commonjs/button/lib/BaseButton.d.ts +69 -5
- package/dist/commonjs/button/lib/BaseButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/BaseButton.js +199 -192
- package/dist/commonjs/button/lib/Button.d.ts +17 -0
- package/dist/commonjs/button/lib/Button.d.ts.map +1 -0
- package/dist/commonjs/button/lib/Button.js +42 -0
- package/dist/commonjs/button/lib/DeleteButton.d.ts +7 -9
- package/dist/commonjs/button/lib/DeleteButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/DeleteButton.js +29 -19
- package/dist/commonjs/button/lib/PrimaryButton.d.ts +15 -36
- package/dist/commonjs/button/lib/PrimaryButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/PrimaryButton.js +67 -79
- package/dist/commonjs/button/lib/SecondaryButton.d.ts +16 -43
- package/dist/commonjs/button/lib/SecondaryButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/SecondaryButton.js +71 -96
- package/dist/commonjs/button/lib/TertiaryButton.d.ts +35 -47
- package/dist/commonjs/button/lib/TertiaryButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/TertiaryButton.js +136 -134
- package/dist/commonjs/button/lib/ToolbarDropdownButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/ToolbarDropdownButton.js +11 -2
- package/dist/commonjs/button/lib/ToolbarIconButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/ToolbarIconButton.js +10 -2
- package/dist/commonjs/button/lib/parts/ButtonLabelIcon.d.ts +1 -7
- package/dist/commonjs/button/lib/parts/ButtonLabelIcon.d.ts.map +1 -1
- package/dist/commonjs/button/lib/types.d.ts +6 -7
- package/dist/commonjs/button/lib/types.d.ts.map +1 -1
- package/dist/commonjs/card/lib/Card.d.ts +1 -1
- package/dist/commonjs/card/lib/CardBody.d.ts +1 -1
- package/dist/commonjs/card/lib/CardBody.d.ts.map +1 -1
- package/dist/commonjs/checkbox/lib/Checkbox.d.ts.map +1 -1
- package/dist/commonjs/checkbox/lib/Checkbox.js +13 -17
- package/dist/commonjs/common/lib/CanvasProvider.d.ts +1 -8
- package/dist/commonjs/common/lib/CanvasProvider.d.ts.map +1 -1
- package/dist/commonjs/common/lib/CanvasProvider.js +31 -13
- package/dist/commonjs/dialog/lib/Dialog.d.ts +1 -1
- package/dist/commonjs/layout/lib/Box.d.ts +3 -2
- package/dist/commonjs/layout/lib/Box.d.ts.map +1 -1
- package/dist/commonjs/layout/lib/Box.js +2 -1
- package/dist/commonjs/layout/lib/Flex.d.ts +1 -1
- package/dist/commonjs/layout/lib/Grid.d.ts +1 -1
- package/dist/commonjs/menu/lib/MenuItem.d.ts +1 -1
- package/dist/commonjs/popup/lib/Popup.d.ts +1 -1
- package/dist/commonjs/popup/lib/PopupBody.d.ts +1 -1
- package/dist/commonjs/popup/lib/PopupCloseIcon.js +1 -1
- package/dist/commonjs/radio/lib/Radio.d.ts.map +1 -1
- package/dist/commonjs/radio/lib/Radio.js +17 -22
- package/dist/commonjs/segmented-control/lib/SegmentedControlButton.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControlButton.js +3 -1
- package/dist/commonjs/table/lib/Table.d.ts +1 -2
- package/dist/commonjs/table/lib/Table.d.ts.map +1 -1
- package/dist/commonjs/table/lib/Table.js +1 -2
- package/dist/commonjs/table/lib/TableRow.d.ts +3 -6
- package/dist/commonjs/table/lib/TableRow.d.ts.map +1 -1
- package/dist/commonjs/table/lib/TableRow.js +3 -5
- package/dist/commonjs/tabs/lib/TabsItem.d.ts +1 -1
- package/dist/commonjs/text-area/lib/TextArea.d.ts.map +1 -1
- package/dist/commonjs/text-area/lib/TextArea.js +1 -1
- package/dist/commonjs/text-input/lib/TextInput.js +1 -1
- package/dist/commonjs/tokens/lib/space.d.ts +44 -31
- package/dist/commonjs/tokens/lib/space.d.ts.map +1 -1
- package/dist/commonjs/tokens/lib/space.js +22 -29
- package/dist/commonjs/tooltip/lib/TooltipContainer.js +2 -2
- package/dist/es6/button/index.d.ts +8 -5
- package/dist/es6/button/index.d.ts.map +1 -1
- package/dist/es6/button/index.js +8 -5
- package/dist/es6/button/lib/BaseButton.d.ts +69 -5
- package/dist/es6/button/lib/BaseButton.d.ts.map +1 -1
- package/dist/es6/button/lib/BaseButton.js +199 -192
- package/dist/es6/button/lib/Button.d.ts +17 -0
- package/dist/es6/button/lib/Button.d.ts.map +1 -0
- package/dist/es6/button/lib/Button.js +20 -0
- package/dist/es6/button/lib/DeleteButton.d.ts +7 -9
- package/dist/es6/button/lib/DeleteButton.d.ts.map +1 -1
- package/dist/es6/button/lib/DeleteButton.js +31 -21
- package/dist/es6/button/lib/PrimaryButton.d.ts +15 -36
- package/dist/es6/button/lib/PrimaryButton.d.ts.map +1 -1
- package/dist/es6/button/lib/PrimaryButton.js +67 -79
- package/dist/es6/button/lib/SecondaryButton.d.ts +16 -43
- package/dist/es6/button/lib/SecondaryButton.d.ts.map +1 -1
- package/dist/es6/button/lib/SecondaryButton.js +71 -95
- package/dist/es6/button/lib/TertiaryButton.d.ts +35 -47
- package/dist/es6/button/lib/TertiaryButton.d.ts.map +1 -1
- package/dist/es6/button/lib/TertiaryButton.js +137 -135
- package/dist/es6/button/lib/ToolbarDropdownButton.d.ts.map +1 -1
- package/dist/es6/button/lib/ToolbarDropdownButton.js +11 -2
- package/dist/es6/button/lib/ToolbarIconButton.d.ts.map +1 -1
- package/dist/es6/button/lib/ToolbarIconButton.js +10 -2
- package/dist/es6/button/lib/parts/ButtonLabelIcon.d.ts +1 -7
- package/dist/es6/button/lib/parts/ButtonLabelIcon.d.ts.map +1 -1
- package/dist/es6/button/lib/types.d.ts +6 -7
- package/dist/es6/button/lib/types.d.ts.map +1 -1
- package/dist/es6/card/lib/Card.d.ts +1 -1
- package/dist/es6/card/lib/CardBody.d.ts +1 -1
- package/dist/es6/card/lib/CardBody.d.ts.map +1 -1
- package/dist/es6/checkbox/lib/Checkbox.d.ts.map +1 -1
- package/dist/es6/checkbox/lib/Checkbox.js +14 -18
- package/dist/es6/common/lib/CanvasProvider.d.ts +1 -8
- package/dist/es6/common/lib/CanvasProvider.d.ts.map +1 -1
- package/dist/es6/common/lib/CanvasProvider.js +31 -13
- package/dist/es6/dialog/lib/Dialog.d.ts +1 -1
- package/dist/es6/layout/lib/Box.d.ts +3 -2
- package/dist/es6/layout/lib/Box.d.ts.map +1 -1
- package/dist/es6/layout/lib/Box.js +2 -1
- package/dist/es6/layout/lib/Flex.d.ts +1 -1
- package/dist/es6/layout/lib/Grid.d.ts +1 -1
- package/dist/es6/menu/lib/MenuItem.d.ts +1 -1
- package/dist/es6/popup/lib/Popup.d.ts +1 -1
- package/dist/es6/popup/lib/PopupBody.d.ts +1 -1
- package/dist/es6/popup/lib/PopupCloseIcon.js +1 -1
- package/dist/es6/radio/lib/Radio.d.ts.map +1 -1
- package/dist/es6/radio/lib/Radio.js +18 -23
- package/dist/es6/segmented-control/lib/SegmentedControlButton.d.ts.map +1 -1
- package/dist/es6/segmented-control/lib/SegmentedControlButton.js +3 -1
- package/dist/es6/table/lib/Table.d.ts +1 -2
- package/dist/es6/table/lib/Table.d.ts.map +1 -1
- package/dist/es6/table/lib/Table.js +1 -2
- package/dist/es6/table/lib/TableRow.d.ts +3 -6
- package/dist/es6/table/lib/TableRow.d.ts.map +1 -1
- package/dist/es6/table/lib/TableRow.js +4 -6
- package/dist/es6/tabs/lib/TabsItem.d.ts +1 -1
- package/dist/es6/text-area/lib/TextArea.d.ts.map +1 -1
- package/dist/es6/text-area/lib/TextArea.js +2 -2
- package/dist/es6/text-input/lib/TextInput.js +2 -2
- package/dist/es6/tokens/lib/space.d.ts +44 -31
- package/dist/es6/tokens/lib/space.d.ts.map +1 -1
- package/dist/es6/tokens/lib/space.js +22 -29
- package/dist/es6/tooltip/lib/TooltipContainer.js +3 -3
- package/layout/lib/Box.tsx +6 -4
- package/package.json +5 -3
- package/popup/lib/PopupCloseIcon.tsx +1 -1
- package/radio/lib/Radio.tsx +18 -34
- package/segmented-control/lib/SegmentedControlButton.tsx +3 -1
- package/table/lib/Table.tsx +1 -2
- package/table/lib/TableRow.tsx +5 -8
- package/text-area/lib/TextArea.tsx +2 -8
- package/text-input/lib/TextInput.tsx +2 -2
- package/tokens/README.md +25 -28
- package/tokens/lib/space.ts +53 -40
- package/tooltip/lib/TooltipContainer.tsx +3 -3
|
@@ -50,9 +50,9 @@ exports.TooltipContainer = styled_1.default('div')({
|
|
|
50
50
|
},
|
|
51
51
|
// offset tooltips by 2 pixels when a keyboard focus ring is detected
|
|
52
52
|
'[data-whatinput=keyboard] &': {
|
|
53
|
-
padding:
|
|
53
|
+
padding: `calc(${tokens_1.space.s} - 0.125rem)`,
|
|
54
54
|
':before': {
|
|
55
|
-
margin:
|
|
55
|
+
margin: `calc(${tokens_1.space.xxxs} + 0.125rem)`,
|
|
56
56
|
},
|
|
57
57
|
},
|
|
58
58
|
// Hide tooltip when the reference element is either clipped or fully hidden
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
export { PrimaryButton, PrimaryButtonProps } from './lib/PrimaryButton';
|
|
2
|
-
export { SecondaryButton, SecondaryButtonProps } from './lib/SecondaryButton';
|
|
3
|
-
export { TertiaryButton, TertiaryButtonProps } from './lib/TertiaryButton';
|
|
4
|
-
export { DeleteButton, DeleteButtonProps } from './lib/DeleteButton';
|
|
5
1
|
export { DeprecatedButton as deprecated_Button, DeprecatedButtonProps, } from './lib/deprecated_Button';
|
|
6
2
|
export { ToolbarIconButton, ToolbarIconButtonProps } from './lib/ToolbarIconButton';
|
|
7
3
|
export { ToolbarDropdownButton, ToolbarDropdownButtonProps } from './lib/ToolbarDropdownButton';
|
|
8
4
|
export { Hyperlink, HyperlinkProps } from './lib/Hyperlink';
|
|
9
|
-
export { BaseButton, ButtonContainerProps, BaseButtonProps, getMinWidthStyles, getPaddingStyles, } from './lib/BaseButton';
|
|
10
5
|
export { ExternalHyperlink, ExternalHyperlinkProps } from './lib/ExternalHyperlink';
|
|
11
6
|
export * from './lib/types';
|
|
7
|
+
export * from './lib/PrimaryButton';
|
|
8
|
+
export * from './lib/SecondaryButton';
|
|
9
|
+
export * from './lib/TertiaryButton';
|
|
10
|
+
export * from './lib/DeleteButton';
|
|
11
|
+
export * from './lib/BaseButton';
|
|
12
|
+
export * from './lib/ToolbarDropdownButton';
|
|
13
|
+
export * from './lib/ToolbarIconButton';
|
|
14
|
+
export * from './lib/types';
|
|
12
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../button/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../button/index.ts"],"names":[],"mappings":"AAAA,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,EAAC,iBAAiB,EAAE,sBAAsB,EAAC,MAAM,yBAAyB,CAAC;AAClF,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC"}
|
package/dist/es6/button/index.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
export { PrimaryButton } from './lib/PrimaryButton';
|
|
2
|
-
export { SecondaryButton } from './lib/SecondaryButton';
|
|
3
|
-
export { TertiaryButton } from './lib/TertiaryButton';
|
|
4
|
-
export { DeleteButton } from './lib/DeleteButton';
|
|
5
1
|
export { DeprecatedButton as deprecated_Button, } from './lib/deprecated_Button';
|
|
6
2
|
export { ToolbarIconButton } from './lib/ToolbarIconButton';
|
|
7
3
|
export { ToolbarDropdownButton } from './lib/ToolbarDropdownButton';
|
|
8
4
|
export { Hyperlink } from './lib/Hyperlink';
|
|
9
|
-
export { BaseButton, getMinWidthStyles, getPaddingStyles, } from './lib/BaseButton';
|
|
10
5
|
export { ExternalHyperlink } from './lib/ExternalHyperlink';
|
|
11
6
|
export * from './lib/types';
|
|
7
|
+
export * from './lib/PrimaryButton';
|
|
8
|
+
export * from './lib/SecondaryButton';
|
|
9
|
+
export * from './lib/TertiaryButton';
|
|
10
|
+
export * from './lib/DeleteButton';
|
|
11
|
+
export * from './lib/BaseButton';
|
|
12
|
+
export * from './lib/ToolbarDropdownButton';
|
|
13
|
+
export * from './lib/ToolbarIconButton';
|
|
14
|
+
export * from './lib/types';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GrowthBehavior } from '@workday/canvas-kit-react/common';
|
|
3
3
|
import { SystemIconProps } from '@workday/canvas-kit-react/icon';
|
|
4
|
-
import { ButtonColors, ButtonSizes, IconPositions
|
|
4
|
+
import { ButtonColors, ButtonSizes, IconPositions } from './types';
|
|
5
5
|
import { CanvasSystemIcon } from '@workday/design-assets-types';
|
|
6
6
|
export interface ButtonContainerProps extends Partial<SystemIconProps>, GrowthBehavior {
|
|
7
7
|
/**
|
|
@@ -11,13 +11,33 @@ export interface ButtonContainerProps extends Partial<SystemIconProps>, GrowthBe
|
|
|
11
11
|
/**
|
|
12
12
|
* There are four button sizes: `extraSmall`, `small`, `medium`, and `large`.
|
|
13
13
|
* If no size is provided, it will default to `medium`.
|
|
14
|
+
*
|
|
15
|
+
* @default 'medium
|
|
14
16
|
*/
|
|
15
17
|
size?: ButtonSizes;
|
|
18
|
+
/**
|
|
19
|
+
* The icon of the Button.
|
|
20
|
+
* Note: not displayed at `small` size
|
|
21
|
+
*/
|
|
22
|
+
icon?: CanvasSystemIcon;
|
|
16
23
|
/**
|
|
17
24
|
* Whether the icon should received filled (colored background layer) or regular styles.
|
|
18
25
|
* Corresponds to `toggled` in ToolbarIconButton
|
|
19
26
|
*/
|
|
20
27
|
fillIcon?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Button icon positions can either be `start` or `end`.
|
|
30
|
+
* If no value is provided, it defaults to `start`.
|
|
31
|
+
*
|
|
32
|
+
* @default 'start'
|
|
33
|
+
*/
|
|
34
|
+
iconPosition?: IconPositions;
|
|
35
|
+
/**
|
|
36
|
+
* If set to `true`, transform the icon's x-axis to mirror the graphic
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
shouldMirrorIcon?: boolean;
|
|
40
|
+
children?: React.ReactNode;
|
|
21
41
|
}
|
|
22
42
|
/**
|
|
23
43
|
* Extends all the style properties from Box to our buttons as well as props from ButtonContainerProps.
|
|
@@ -26,10 +46,54 @@ export interface ButtonContainerProps extends Partial<SystemIconProps>, GrowthBe
|
|
|
26
46
|
*/
|
|
27
47
|
export interface BaseButtonProps extends Omit<ButtonContainerProps, 'ref'> {
|
|
28
48
|
}
|
|
29
|
-
|
|
30
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Temporary css variables to be used across all Buttons.
|
|
51
|
+
*/
|
|
52
|
+
export declare const buttonVars: {
|
|
53
|
+
default: import("@workday/canvas-kit-styling").CsVars<"label" | "opacity" | "background" | "border" | "borderRadius" | "icon" | "boxShadowInner" | "boxShadowOuter", never>;
|
|
54
|
+
hover: import("@workday/canvas-kit-styling").CsVars<"label" | "opacity" | "background" | "border" | "borderRadius" | "icon" | "boxShadowInner" | "boxShadowOuter", never>;
|
|
55
|
+
active: import("@workday/canvas-kit-styling").CsVars<"label" | "opacity" | "background" | "border" | "borderRadius" | "icon" | "boxShadowInner" | "boxShadowOuter", never>;
|
|
56
|
+
focus: import("@workday/canvas-kit-styling").CsVars<"label" | "opacity" | "background" | "border" | "borderRadius" | "icon" | "boxShadowInner" | "boxShadowOuter", never>;
|
|
57
|
+
disabled: import("@workday/canvas-kit-styling").CsVars<"label" | "opacity" | "background" | "border" | "borderRadius" | "icon" | "boxShadowInner" | "boxShadowOuter", never>;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Button modifiers that will overwrite the base styles of Buttons.
|
|
61
|
+
* - `Size`: These modifiers will dictate a size of a Button and has a set of styles to associated with it.
|
|
62
|
+
* - `iconPosition`: These modifiers will override the existing `Size` styles. These are specific to icon locations
|
|
63
|
+
* within a button or if there is only an icon and no text.
|
|
64
|
+
*/
|
|
65
|
+
export declare const buttonModifiers: {
|
|
66
|
+
size: {
|
|
67
|
+
large: string;
|
|
68
|
+
medium: string;
|
|
69
|
+
small: string;
|
|
70
|
+
extraSmall: string;
|
|
71
|
+
};
|
|
72
|
+
iconPosition: {
|
|
73
|
+
largeOnly: string;
|
|
74
|
+
largeStart: string;
|
|
75
|
+
largeEnd: string;
|
|
76
|
+
mediumOnly: string;
|
|
77
|
+
mediumStart: string;
|
|
78
|
+
mediumEnd: string;
|
|
79
|
+
smallOnly: string;
|
|
80
|
+
smallStart: string;
|
|
81
|
+
smallEnd: string;
|
|
82
|
+
extraSmallOnly: string;
|
|
83
|
+
extraSmallStart: string;
|
|
84
|
+
extraSmallEnd: string;
|
|
85
|
+
};
|
|
86
|
+
} & ((modifiers: Partial<{
|
|
87
|
+
size: "small" | "medium" | "large" | "extraSmall";
|
|
88
|
+
iconPosition: "largeOnly" | "largeStart" | "largeEnd" | "mediumOnly" | "mediumStart" | "mediumEnd" | "smallOnly" | "smallStart" | "smallEnd" | "extraSmallOnly" | "extraSmallStart" | "extraSmallEnd";
|
|
89
|
+
}>) => string);
|
|
90
|
+
export declare function capitalize(string?: string): string;
|
|
91
|
+
export declare function getIconPosition(size?: keyof typeof buttonModifiers.size, iconPosition?: IconPositions, children?: React.ReactNode): keyof typeof buttonModifiers.iconPosition;
|
|
92
|
+
/**
|
|
93
|
+
* The base button which all other buttons are built.
|
|
94
|
+
*/
|
|
31
95
|
export declare const BaseButton: import("@workday/canvas-kit-react/common").ElementComponent<"button", ButtonContainerProps> & {
|
|
32
|
-
Icon: import("@workday/canvas-kit-react/common").ElementComponent<"span", import("
|
|
33
|
-
Label: import("@workday/canvas-kit-react/common").ElementComponent<"span", import("
|
|
96
|
+
Icon: import("@workday/canvas-kit-react/common").ElementComponent<"span", import("../lib/parts/ButtonLabelIcon").ButtonLabelIconProps>;
|
|
97
|
+
Label: import("@workday/canvas-kit-react/common").ElementComponent<"span", import("../lib/parts/ButtonLabel").ButtonLabelProps>;
|
|
34
98
|
};
|
|
35
99
|
//# sourceMappingURL=BaseButton.d.ts.map
|
|
@@ -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,
|
|
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,EAAkB,cAAc,EAAY,MAAM,kCAAkC,CAAC;AAE5F,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAI/D,OAAO,EAAC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAC,MAAM,SAAS,CAAC;AACjE,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAE9D,MAAM,WAAW,oBAAqB,SAAQ,OAAO,CAAC,eAAe,CAAC,EAAE,cAAc;IACpF;;OAEG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,KAAK,CAAC;CAAG;AAiB7E;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;CAMtB,CAAC;AAkGF;;;;;GAKG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;cA4E1B,CAAC;AAEH,wBAAgB,UAAU,CAAC,MAAM,GAAE,MAAW,UAE7C;AAED,wBAAgB,eAAe,CAC7B,IAAI,CAAC,EAAE,MAAM,OAAO,eAAe,CAAC,IAAI,EACxC,YAAY,CAAC,EAAE,aAAa,EAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GACzB,MAAM,OAAO,eAAe,CAAC,YAAY,CAE3C;AAED;;GAEG;AACH,eAAO,MAAM,UAAU;;;CA8CrB,CAAC"}
|
|
@@ -1,221 +1,228 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ButtonLabelIcon } from '
|
|
3
|
-
import { ButtonLabel } from '
|
|
4
|
-
import { createComponent,
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
2
|
+
import { ButtonLabelIcon } from '../lib/parts/ButtonLabelIcon';
|
|
3
|
+
import { ButtonLabel } from '../lib/parts/ButtonLabel';
|
|
4
|
+
import { createComponent, focusRing } from '@workday/canvas-kit-react/common';
|
|
5
|
+
import { createStyles, createVars, cssVar, createModifiers } from '@workday/canvas-kit-styling';
|
|
6
|
+
import { Box } from '@workday/canvas-kit-react/layout';
|
|
7
|
+
import { space } from '@workday/canvas-kit-react/tokens';
|
|
8
|
+
import { base, brand, system } from '@workday/canvas-tokens-web';
|
|
9
|
+
/**
|
|
10
|
+
* Factory function for creating Button vars.
|
|
11
|
+
*/
|
|
12
|
+
const createButtonVars = () => createVars('background', 'border', 'boxShadowInner', 'boxShadowOuter', 'icon', 'label', 'opacity', 'borderRadius');
|
|
13
|
+
/**
|
|
14
|
+
* Temporary css variables to be used across all Buttons.
|
|
15
|
+
*/
|
|
16
|
+
export const buttonVars = {
|
|
17
|
+
default: createButtonVars(),
|
|
18
|
+
hover: createButtonVars(),
|
|
19
|
+
active: createButtonVars(),
|
|
20
|
+
focus: createButtonVars(),
|
|
21
|
+
disabled: createButtonVars(),
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Base styles for Buttons.
|
|
25
|
+
*/
|
|
26
|
+
const baseButtonStyles = createStyles({
|
|
27
|
+
fontFamily: '"Roboto", "Helvetica Neue", "Helvetica", Arial, sans-serif',
|
|
28
|
+
fontSize: '0.875rem',
|
|
29
|
+
lineHeight: 'normal',
|
|
30
|
+
letterSpacing: '0.015rem',
|
|
31
|
+
fontWeight: 'bold',
|
|
32
|
+
backgroundColor: cssVar(buttonVars.default.background, 'transparent'),
|
|
33
|
+
color: cssVar(buttonVars.default.label, cssVar(base.blackPepper400)),
|
|
34
|
+
borderWidth: '1px',
|
|
35
|
+
borderStyle: 'solid',
|
|
36
|
+
gap: cssVar(system.space.x2, space.xxs),
|
|
37
|
+
borderColor: cssVar(buttonVars.default.border, 'transparent'),
|
|
28
38
|
cursor: 'pointer',
|
|
29
39
|
display: 'inline-flex',
|
|
40
|
+
boxShadow: 'none',
|
|
30
41
|
alignItems: 'center',
|
|
31
42
|
justifyContent: 'center',
|
|
32
43
|
boxSizing: 'border-box',
|
|
33
|
-
|
|
34
|
-
outline: 'none',
|
|
35
|
-
fontWeight: type.properties.fontWeights.bold,
|
|
36
|
-
lineHeight: 'normal',
|
|
44
|
+
outline: '2px transparent',
|
|
37
45
|
whiteSpace: 'nowrap',
|
|
38
46
|
WebkitFontSmoothing: 'antialiased',
|
|
39
47
|
MozOsxFontSmoothing: 'grayscale',
|
|
40
|
-
borderRadius: borderRadius.circle,
|
|
48
|
+
borderRadius: cssVar(buttonVars.default.borderRadius, system.shape.circle),
|
|
41
49
|
position: 'relative',
|
|
42
50
|
verticalAlign: 'middle',
|
|
43
51
|
overflow: 'hidden',
|
|
44
|
-
border: '1px solid transparent',
|
|
45
|
-
background: 'transparent',
|
|
46
52
|
transition: 'box-shadow 120ms linear, border 120ms linear, background-color 120ms linear, color 120ms linear',
|
|
47
53
|
'&:disabled, &:disabled:active': {
|
|
48
54
|
cursor: 'default',
|
|
49
55
|
boxShadow: 'none',
|
|
50
|
-
opacity:
|
|
56
|
+
opacity: cssVar(buttonVars.disabled.opacity, '1'),
|
|
51
57
|
},
|
|
52
|
-
'
|
|
53
|
-
|
|
54
|
-
|
|
58
|
+
'& span .wd-icon-fill': {
|
|
59
|
+
transitionDuration: '40ms',
|
|
60
|
+
fill: cssVar(buttonVars.default.icon, cssVar(base.blackPepper400)),
|
|
55
61
|
},
|
|
56
|
-
'
|
|
57
|
-
|
|
62
|
+
'.wd-icon-background ~ .wd-icon-accent, .wd-icon-background ~ .wd-icon-accent2': {
|
|
63
|
+
fill: cssVar(buttonVars.default.icon, cssVar(base.blackPepper400)),
|
|
58
64
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
'& > * ': {
|
|
75
|
-
margin: `0 ${space.xxxs}`,
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
case 'small':
|
|
79
|
-
return {
|
|
80
|
-
height: space.l,
|
|
81
|
-
'& > * ': {
|
|
82
|
-
margin: `0 ${spaceNumbers.xxxs / 2}rem`,
|
|
83
|
-
},
|
|
84
|
-
};
|
|
85
|
-
case 'extraSmall':
|
|
86
|
-
return {
|
|
87
|
-
...type.levels.subtext.medium,
|
|
88
|
-
fontWeight: type.properties.fontWeights.bold,
|
|
89
|
-
height: space.m,
|
|
90
|
-
'& > * ': {
|
|
91
|
-
margin: `0 ${spaceNumbers.xxxs / 2}rem`,
|
|
92
|
-
},
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
}, ({ grow }) => grow && { width: '100%', maxWidth: '100%' }, ({ colors, fillIcon, theme }) => {
|
|
96
|
-
if (!colors) {
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
const baseStyles = {
|
|
100
|
-
...(colors.default.icon && {
|
|
101
|
-
'.wd-icon-fill, .wd-icon-accent, .wd-icon-accent2, .wd-icon-background': {
|
|
102
|
-
transition: 'fill 120ms ease-in',
|
|
103
|
-
},
|
|
104
|
-
...getIconColorSelectors(theme, colors.default.icon, fillIcon),
|
|
65
|
+
'&:focus-visible, &.focus': {
|
|
66
|
+
backgroundColor: cssVar(buttonVars.focus.background, 'transparent'),
|
|
67
|
+
borderColor: cssVar(buttonVars.focus.border, 'transparent'),
|
|
68
|
+
color: cssVar(buttonVars.focus.label, cssVar(base.blackPepper400)),
|
|
69
|
+
'& span .wd-icon-fill': {
|
|
70
|
+
fill: cssVar(buttonVars.focus.icon, cssVar(base.blackPepper400)),
|
|
71
|
+
},
|
|
72
|
+
'.wd-icon-background ~ .wd-icon-accent, .wd-icon-background ~ .wd-icon-accent2': {
|
|
73
|
+
fill: cssVar(buttonVars.focus.icon, cssVar(base.blackPepper400)),
|
|
74
|
+
},
|
|
75
|
+
...focusRing({
|
|
76
|
+
width: 2,
|
|
77
|
+
separation: 2,
|
|
78
|
+
innerColor: cssVar(buttonVars.focus.boxShadowInner, cssVar(base.frenchVanilla100)),
|
|
79
|
+
outerColor: cssVar(buttonVars.focus.boxShadowOuter, cssVar(brand.primary.base)),
|
|
105
80
|
}),
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
'
|
|
112
|
-
|
|
113
|
-
backgroundColor: colors.hover.background,
|
|
114
|
-
borderColor: colors.hover.border,
|
|
115
|
-
color: colors.hover.label,
|
|
81
|
+
},
|
|
82
|
+
'&:hover, &.hover': {
|
|
83
|
+
backgroundColor: cssVar(buttonVars.hover.background, cssVar(base.blackPepper500)),
|
|
84
|
+
borderColor: cssVar(buttonVars.hover.border, 'transparent'),
|
|
85
|
+
color: cssVar(buttonVars.hover.label, cssVar(base.blackPepper500)),
|
|
86
|
+
'& span .wd-icon-fill': {
|
|
87
|
+
fill: cssVar(buttonVars.hover.icon, cssVar(base.blackPepper500)),
|
|
116
88
|
},
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
'&:active, &:focus:active, &:hover:active': {
|
|
120
|
-
...(colors.active.icon && getIconColorSelectors(theme, colors.active.icon, fillIcon)),
|
|
121
|
-
backgroundColor: colors.active.background,
|
|
122
|
-
borderColor: colors.active.border,
|
|
123
|
-
color: colors.active.label,
|
|
89
|
+
'.wd-icon-background ~ .wd-icon-accent, .wd-icon-background ~ .wd-icon-accent2': {
|
|
90
|
+
fill: cssVar(buttonVars.hover.icon, cssVar(base.blackPepper500)),
|
|
124
91
|
},
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
'
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
color: colors.focus.label,
|
|
92
|
+
},
|
|
93
|
+
'&:hover:active': { transitionDuration: '40ms' },
|
|
94
|
+
'&:active, &.active': {
|
|
95
|
+
backgroundColor: cssVar(buttonVars.active.background, 'transparent'),
|
|
96
|
+
borderColor: cssVar(buttonVars.active.border, 'transparent'),
|
|
97
|
+
color: cssVar(buttonVars.active.label, cssVar(base.blackPepper400)),
|
|
98
|
+
'& span .wd-icon-fill': {
|
|
99
|
+
fill: cssVar(buttonVars.active.icon, cssVar(base.blackPepper400)),
|
|
134
100
|
},
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
101
|
+
'.wd-icon-background ~ .wd-icon-accent, .wd-icon-background ~ .wd-icon-accent2': {
|
|
102
|
+
fill: cssVar(buttonVars.active.icon),
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
'&:disabled': {
|
|
106
|
+
backgroundColor: cssVar(buttonVars.disabled.background, 'transparent'),
|
|
107
|
+
borderColor: cssVar(buttonVars.disabled.border, 'transparent'),
|
|
108
|
+
color: cssVar(buttonVars.disabled.label, cssVar(base.blackPepper400)),
|
|
109
|
+
'& span .wd-icon-fill': {
|
|
110
|
+
fill: cssVar(buttonVars.disabled.icon, cssVar(base.blackPepper400)),
|
|
143
111
|
},
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
112
|
+
'.wd-icon-background ~ .wd-icon-accent, .wd-icon-background ~ .wd-icon-accent2': {
|
|
113
|
+
fill: cssVar(buttonVars.disabled.icon, cssVar(base.blackPepper400)),
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
/**
|
|
118
|
+
* Button modifiers that will overwrite the base styles of Buttons.
|
|
119
|
+
* - `Size`: These modifiers will dictate a size of a Button and has a set of styles to associated with it.
|
|
120
|
+
* - `iconPosition`: These modifiers will override the existing `Size` styles. These are specific to icon locations
|
|
121
|
+
* within a button or if there is only an icon and no text.
|
|
122
|
+
*/
|
|
123
|
+
export const buttonModifiers = createModifiers({
|
|
124
|
+
size: {
|
|
125
|
+
large: createStyles({
|
|
126
|
+
fontSize: cssVar(system.space.x4),
|
|
127
|
+
lineHeight: cssVar(system.space.x6),
|
|
128
|
+
letterSpacing: '0.01rem',
|
|
129
|
+
height: '48px',
|
|
130
|
+
paddingInline: cssVar(system.space.x8),
|
|
131
|
+
minWidth: '112px',
|
|
153
132
|
}),
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
}
|
|
133
|
+
medium: createStyles({
|
|
134
|
+
fontSize: '0.875rem',
|
|
135
|
+
letterSpacing: '0.015rem',
|
|
136
|
+
minWidth: '96px',
|
|
137
|
+
paddingInline: cssVar(system.space.x6),
|
|
138
|
+
height: cssVar(system.space.x10),
|
|
139
|
+
}),
|
|
140
|
+
small: createStyles({
|
|
141
|
+
fontSize: '0.875rem',
|
|
142
|
+
letterSpacing: '0.015rem',
|
|
143
|
+
height: cssVar(system.space.x8),
|
|
144
|
+
minWidth: cssVar(system.space.x20),
|
|
145
|
+
paddingInline: cssVar(system.space.x4),
|
|
146
|
+
gap: cssVar(system.space.x1),
|
|
147
|
+
}),
|
|
148
|
+
extraSmall: createStyles({
|
|
149
|
+
fontSize: '0.75rem',
|
|
150
|
+
lineHeight: cssVar(system.space.x4),
|
|
151
|
+
letterSpacing: '0.02rem',
|
|
152
|
+
height: cssVar(system.space.x6),
|
|
153
|
+
minWidth: 'auto',
|
|
154
|
+
paddingInline: cssVar(system.space.x3),
|
|
155
|
+
gap: cssVar(system.space.x1),
|
|
156
|
+
}),
|
|
157
|
+
},
|
|
158
|
+
iconPosition: {
|
|
159
|
+
largeOnly: createStyles({
|
|
160
|
+
padding: '0',
|
|
161
|
+
minWidth: cssVar(system.space.x12),
|
|
162
|
+
}),
|
|
163
|
+
largeStart: createStyles({
|
|
164
|
+
paddingInlineStart: cssVar(system.space.x6),
|
|
165
|
+
paddingInlineEnd: cssVar(system.space.x8),
|
|
166
|
+
}),
|
|
167
|
+
largeEnd: createStyles({
|
|
168
|
+
paddingInlineStart: cssVar(system.space.x8),
|
|
169
|
+
paddingInlineEnd: cssVar(system.space.x6),
|
|
170
|
+
}),
|
|
171
|
+
mediumOnly: createStyles({ padding: '0', minWidth: cssVar(system.space.x10, space.xl) }),
|
|
172
|
+
mediumStart: createStyles({
|
|
173
|
+
paddingInlineStart: cssVar(system.space.x5),
|
|
174
|
+
paddingInlineEnd: cssVar(system.space.x6),
|
|
175
|
+
}),
|
|
176
|
+
mediumEnd: createStyles({
|
|
177
|
+
paddingInlineStart: cssVar(system.space.x6),
|
|
178
|
+
paddingInlineEnd: cssVar(system.space.x5),
|
|
179
|
+
}),
|
|
180
|
+
smallOnly: createStyles({ padding: '0', minWidth: cssVar(system.space.x8, space.l) }),
|
|
181
|
+
smallStart: createStyles({
|
|
182
|
+
paddingInlineStart: cssVar(system.space.x3),
|
|
183
|
+
paddingInlineEnd: cssVar(system.space.x4),
|
|
184
|
+
}),
|
|
185
|
+
smallEnd: createStyles({
|
|
186
|
+
paddingInlineStart: cssVar(system.space.x4),
|
|
187
|
+
paddingInlineEnd: cssVar(system.space.x3),
|
|
188
|
+
}),
|
|
189
|
+
extraSmallOnly: createStyles({ padding: '0', minWidth: cssVar(system.space.x6, space.m) }),
|
|
190
|
+
extraSmallStart: createStyles({
|
|
191
|
+
paddingInlineStart: cssVar(system.space.x2),
|
|
192
|
+
paddingInlineEnd: cssVar(system.space.x3),
|
|
193
|
+
}),
|
|
194
|
+
extraSmallEnd: createStyles({
|
|
195
|
+
paddingInlineStart: cssVar(system.space.x3),
|
|
196
|
+
paddingInlineEnd: cssVar(system.space.x2),
|
|
197
|
+
}),
|
|
198
|
+
},
|
|
199
|
+
});
|
|
200
|
+
export function capitalize(string = '') {
|
|
201
|
+
return string.charAt(0).toUpperCase() + string.substring(1);
|
|
202
|
+
}
|
|
203
|
+
export function getIconPosition(size, iconPosition, children) {
|
|
204
|
+
return `${size}${capitalize(iconPosition)}`;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* The base button which all other buttons are built.
|
|
208
|
+
*/
|
|
215
209
|
export const BaseButton = createComponent('button')({
|
|
216
|
-
displayName: '
|
|
217
|
-
Component: ({ children, ...elemProps }, ref, Element) => {
|
|
218
|
-
|
|
210
|
+
displayName: 'BaseButton',
|
|
211
|
+
Component: ({ children, cs, size, fillIcon, iconPosition, icon, colors, shouldMirrorIcon = false, ...elemProps }, ref, Element) => {
|
|
212
|
+
// console.log('iconPosition', children, getIconPosition(size, iconPosition));
|
|
213
|
+
return (React.createElement(Box, Object.assign({ as: Element, ref: ref, type: "button", cs: [
|
|
214
|
+
baseButtonStyles,
|
|
215
|
+
buttonModifiers({
|
|
216
|
+
size: size,
|
|
217
|
+
iconPosition: getIconPosition(size, iconPosition, children),
|
|
218
|
+
}),
|
|
219
|
+
buttonVars.default((colors === null || colors === void 0 ? void 0 : colors.default) || {}),
|
|
220
|
+
buttonVars.focus((colors === null || colors === void 0 ? void 0 : colors.focus) || {}),
|
|
221
|
+
buttonVars.hover((colors === null || colors === void 0 ? void 0 : colors.hover) || {}),
|
|
222
|
+
buttonVars.active((colors === null || colors === void 0 ? void 0 : colors.active) || {}),
|
|
223
|
+
buttonVars.disabled((colors === null || colors === void 0 ? void 0 : colors.disabled) || {}),
|
|
224
|
+
cs,
|
|
225
|
+
] }, elemProps), children));
|
|
219
226
|
},
|
|
220
227
|
subComponents: {
|
|
221
228
|
Icon: ButtonLabelIcon,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ButtonContainerProps } from './BaseButton';
|
|
2
|
+
/**
|
|
3
|
+
* Extends all the style properties from Box to our buttons as well as props from ButtonContainerProps.
|
|
4
|
+
* We omit `ref` since all of our buttons use `createComponent` and already give access to `ref`.
|
|
5
|
+
* Use this type to extend and customize any one off buttons that you want full control over styling.
|
|
6
|
+
*/
|
|
7
|
+
export interface ButtonProps extends Omit<ButtonContainerProps, 'ref'> {
|
|
8
|
+
/**
|
|
9
|
+
* Button icon positions can either be `start` or `end`.
|
|
10
|
+
* If no value is provided, it defaults to `start`.
|
|
11
|
+
*
|
|
12
|
+
* @default 'start'
|
|
13
|
+
*/
|
|
14
|
+
iconPosition?: 'start' | 'end';
|
|
15
|
+
}
|
|
16
|
+
export declare const Button: import("@workday/canvas-kit-react/common").ElementComponent<"button", ButtonProps>;
|
|
17
|
+
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../button/lib/Button.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAa,oBAAoB,EAAC,MAAM,cAAc,CAAC;AAG9D;;;;GAIG;AACH,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,oBAAoB,EAAE,KAAK,CAAC;IACpE;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;CAChC;AAED,eAAO,MAAM,MAAM,oFA8CjB,CAAC"}
|