@workday/canvas-kit-react 10.0.0-alpha.537-next.0 → 10.0.0-alpha.539-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/common/lib/CanvasProvider.tsx +50 -24
- package/common/lib/utils/slugify.ts +4 -1
- 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/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/common/lib/utils/slugify.d.ts.map +1 -1
- package/dist/commonjs/common/lib/utils/slugify.js +4 -1
- 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/segmented-control/lib/SegmentedControlButton.d.ts.map +1 -1
- package/dist/commonjs/segmented-control/lib/SegmentedControlButton.js +3 -1
- package/dist/commonjs/tabs/lib/TabsItem.d.ts +1 -1
- 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/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/common/lib/utils/slugify.d.ts.map +1 -1
- package/dist/es6/common/lib/utils/slugify.js +4 -1
- 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/segmented-control/lib/SegmentedControlButton.d.ts.map +1 -1
- package/dist/es6/segmented-control/lib/SegmentedControlButton.js +3 -1
- package/dist/es6/tabs/lib/TabsItem.d.ts +1 -1
- package/layout/lib/Box.tsx +6 -4
- package/package.json +5 -3
- package/popup/lib/PopupCloseIcon.tsx +1 -1
- package/segmented-control/lib/SegmentedControlButton.tsx +3 -1
|
@@ -1,143 +1,145 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
2
|
+
import { buttonVars, getIconPosition } from './BaseButton';
|
|
3
|
+
import { createComponent, focusRing } from '@workday/canvas-kit-react/common';
|
|
4
|
+
import { createStyles, cssVar, createModifiers } from '@workday/canvas-kit-styling';
|
|
5
|
+
import { system, brand, base } from '@workday/canvas-tokens-web';
|
|
6
|
+
import { borderRadius, space } from '@workday/canvas-kit-react/tokens';
|
|
7
|
+
import { Button } from './Button';
|
|
8
|
+
const tertiaryStyles = createStyles({
|
|
9
|
+
paddingInline: cssVar(system.space.x2, space.xxs),
|
|
10
|
+
minWidth: 'auto',
|
|
11
|
+
textDecoration: 'underline',
|
|
12
|
+
border: 0,
|
|
13
|
+
// Default Styles
|
|
14
|
+
[buttonVars.default.background]: 'transparent',
|
|
15
|
+
[buttonVars.default.border]: 'transparent',
|
|
16
|
+
[buttonVars.default.borderRadius]: cssVar(system.shape.medium),
|
|
17
|
+
[buttonVars.default.label]: cssVar(brand.primary.base),
|
|
18
|
+
[buttonVars.default.icon]: cssVar(base.blackPepper400),
|
|
19
|
+
// Hover Styles
|
|
20
|
+
[buttonVars.hover.background]: cssVar(base.soap200),
|
|
21
|
+
[buttonVars.hover.border]: 'transparent',
|
|
22
|
+
[buttonVars.hover.label]: cssVar(brand.primary.dark),
|
|
23
|
+
[buttonVars.hover.icon]: cssVar(base.blackPepper500),
|
|
24
|
+
// Focus Styles
|
|
25
|
+
[buttonVars.focus.background]: 'transparent',
|
|
26
|
+
[buttonVars.focus.border]: 'transparent',
|
|
27
|
+
[buttonVars.focus.label]: cssVar(brand.primary.base),
|
|
28
|
+
[buttonVars.focus.icon]: cssVar(base.blackPepper500),
|
|
29
|
+
[buttonVars.focus.boxShadowInner]: cssVar(brand.common.focusOutline),
|
|
30
|
+
[buttonVars.focus.boxShadowOuter]: cssVar(brand.common.focusOutline),
|
|
31
|
+
// Active Styles
|
|
32
|
+
[buttonVars.active.background]: cssVar(base.soap300),
|
|
33
|
+
[buttonVars.active.border]: 'transparent',
|
|
34
|
+
[buttonVars.active.label]: cssVar(brand.primary.dark),
|
|
35
|
+
[buttonVars.active.icon]: cssVar(base.blackPepper500),
|
|
36
|
+
// Disabled Styles
|
|
37
|
+
[buttonVars.disabled.background]: 'transparent',
|
|
38
|
+
[buttonVars.disabled.border]: cssVar(base.frenchVanilla100),
|
|
39
|
+
[buttonVars.disabled.label]: cssVar(brand.primary.base),
|
|
40
|
+
[buttonVars.disabled.icon]: cssVar(base.blackPepper400),
|
|
41
|
+
[buttonVars.disabled.opacity]: '0.4',
|
|
42
|
+
'&:focus-visible, &.focus': {
|
|
43
|
+
...focusRing({
|
|
44
|
+
width: 2,
|
|
45
|
+
separation: 0,
|
|
46
|
+
innerColor: cssVar(base.frenchVanilla100, cssVar(buttonVars.focus.boxShadowInner)),
|
|
47
|
+
outerColor: cssVar(brand.common.focusOutline, cssVar(buttonVars.focus.boxShadowOuter)),
|
|
48
|
+
}),
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
export const tertiaryButtonModifiers = createModifiers({
|
|
52
|
+
isThemeable: {
|
|
53
|
+
true: createStyles({
|
|
54
|
+
[buttonVars.default.icon]: cssVar(brand.primary.base),
|
|
55
|
+
[buttonVars.hover.icon]: cssVar(brand.primary.dark),
|
|
56
|
+
[buttonVars.focus.icon]: cssVar(brand.primary.base),
|
|
57
|
+
[buttonVars.active.icon]: cssVar(brand.primary.dark),
|
|
58
|
+
[buttonVars.disabled.icon]: cssVar(brand.primary.base),
|
|
59
|
+
}),
|
|
60
|
+
},
|
|
61
|
+
variant: {
|
|
62
|
+
inverse: createStyles({
|
|
63
|
+
// Default Styles
|
|
64
|
+
[buttonVars.default.background]: 'transparent',
|
|
65
|
+
[buttonVars.default.border]: 'transparent',
|
|
66
|
+
[buttonVars.default.label]: cssVar(base.frenchVanilla100),
|
|
67
|
+
[buttonVars.default.icon]: cssVar(base.frenchVanilla100),
|
|
68
|
+
// Hover Styles
|
|
69
|
+
[buttonVars.hover.background]: cssVar(base.frenchVanilla100),
|
|
70
|
+
[buttonVars.hover.border]: 'transparent',
|
|
71
|
+
[buttonVars.hover.label]: cssVar(base.blackPepper400),
|
|
72
|
+
[buttonVars.hover.icon]: cssVar(base.blackPepper400),
|
|
73
|
+
// Focus Styles
|
|
74
|
+
[buttonVars.focus.background]: cssVar(base.frenchVanilla100),
|
|
75
|
+
[buttonVars.focus.border]: 'transparent',
|
|
76
|
+
[buttonVars.focus.label]: cssVar(base.blackPepper400),
|
|
77
|
+
[buttonVars.focus.icon]: cssVar(base.blackPepper400),
|
|
78
|
+
// Active Styles
|
|
79
|
+
[buttonVars.active.background]: cssVar(base.soap200),
|
|
80
|
+
[buttonVars.active.border]: 'transparent',
|
|
81
|
+
[buttonVars.active.label]: cssVar(base.blackPepper400),
|
|
82
|
+
[buttonVars.active.icon]: cssVar(base.blackPepper400),
|
|
83
|
+
// Disabled Styles
|
|
84
|
+
[buttonVars.disabled.background]: 'transparent',
|
|
85
|
+
[buttonVars.disabled.border]: cssVar(base.frenchVanilla100),
|
|
86
|
+
[buttonVars.disabled.label]: cssVar(base.frenchVanilla100),
|
|
87
|
+
[buttonVars.disabled.icon]: cssVar(base.frenchVanilla100),
|
|
88
|
+
'&:focus-visible, &.focus': {
|
|
89
|
+
...focusRing({
|
|
30
90
|
inset: 'inner',
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
background: 'transparent',
|
|
37
|
-
icon: colors.frenchVanilla100,
|
|
38
|
-
label: colors.frenchVanilla100,
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
return {
|
|
44
|
-
default: {
|
|
45
|
-
icon: hasThemeStyles ? themePrimary.main : colors.blackPepper400,
|
|
46
|
-
label: themePrimary.main,
|
|
47
|
-
},
|
|
48
|
-
hover: {
|
|
49
|
-
background: colors.soap200,
|
|
50
|
-
icon: hasThemeStyles ? themePrimary.dark : colors.blackPepper500,
|
|
51
|
-
label: themePrimary.dark,
|
|
52
|
-
},
|
|
53
|
-
active: {
|
|
54
|
-
background: colors.soap300,
|
|
55
|
-
icon: hasThemeStyles ? themePrimary.dark : colors.blackPepper500,
|
|
56
|
-
label: themePrimary.dark,
|
|
57
|
-
},
|
|
58
|
-
focus: {
|
|
59
|
-
icon: hasThemeStyles ? themePrimary.main : colors.blackPepper500,
|
|
60
|
-
label: themePrimary.main,
|
|
61
|
-
focusRing: focusRing({ innerColor: colors.blueberry400 }, theme),
|
|
62
|
-
},
|
|
63
|
-
disabled: {
|
|
64
|
-
background: 'transparent',
|
|
65
|
-
icon: hasThemeStyles ? themePrimary.main : colors.blackPepper400,
|
|
66
|
-
label: themePrimary.main,
|
|
91
|
+
width: 2,
|
|
92
|
+
separation: 2,
|
|
93
|
+
innerColor: cssVar(base.blackPepper400, cssVar(buttonVars.focus.boxShadowInner)),
|
|
94
|
+
outerColor: cssVar(base.frenchVanilla100, cssVar(buttonVars.focus.boxShadowOuter)),
|
|
95
|
+
}),
|
|
67
96
|
},
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
97
|
+
}),
|
|
98
|
+
},
|
|
99
|
+
iconPosition: {
|
|
100
|
+
largeOnly: createStyles({
|
|
101
|
+
borderRadius: borderRadius.circle,
|
|
102
|
+
padding: '0',
|
|
103
|
+
minWidth: cssVar(system.space.x12),
|
|
104
|
+
}),
|
|
105
|
+
largeStart: createStyles({
|
|
106
|
+
paddingInlineStart: space.xxs,
|
|
107
|
+
paddingInlineEnd: space.xs,
|
|
108
|
+
}),
|
|
109
|
+
largeEnd: createStyles({ paddingInlineStart: space.xs, paddingInlineEnd: space.xxs }),
|
|
110
|
+
mediumOnly: createStyles({ padding: '0', minWidth: space.xl, borderRadius: borderRadius.circle }),
|
|
111
|
+
mediumStart: createStyles({ paddingInlineStart: space.xxs, paddingInlineEnd: space.xs }),
|
|
112
|
+
mediumEnd: createStyles({ paddingInlineStart: space.xs, paddingInlineEnd: space.xxs }),
|
|
113
|
+
smallOnly: createStyles({ padding: '0', minWidth: space.l, borderRadius: borderRadius.circle }),
|
|
114
|
+
smallStart: createStyles({ paddingInlineStart: space.xxs, paddingInlineEnd: space.xs }),
|
|
115
|
+
smallEnd: createStyles({ paddingInlineStart: space.xs, paddingInlineEnd: space.xxs }),
|
|
116
|
+
extraSmallOnly: createStyles({
|
|
117
|
+
padding: '0',
|
|
118
|
+
minWidth: space.m,
|
|
119
|
+
borderRadius: borderRadius.circle,
|
|
120
|
+
}),
|
|
121
|
+
extraSmallStart: createStyles({ paddingInlineStart: space.xxxs, paddingInlineEnd: space.xxs }),
|
|
122
|
+
extraSmallEnd: createStyles({ paddingInlineStart: space.xxs, paddingInlineEnd: space.xxxs }),
|
|
123
|
+
},
|
|
73
124
|
});
|
|
74
|
-
const StyledTertiaryButtonContainer = styled(BaseButton)({
|
|
75
|
-
border: '0',
|
|
76
|
-
}, ({ allCaps }) => ({
|
|
77
|
-
textTransform: allCaps ? 'uppercase' : undefined,
|
|
78
|
-
}));
|
|
79
|
-
const getPaddingStyles = (icon, iconPosition, children, size) => {
|
|
80
|
-
if (children) {
|
|
81
|
-
// if there is an icon on the left, add 4px extra padding to the right for visual balance
|
|
82
|
-
if (icon && iconPosition === 'start') {
|
|
83
|
-
if (size === 'extraSmall') {
|
|
84
|
-
return `0 ${space.xxs} 0 ${space.xxxs}`;
|
|
85
|
-
}
|
|
86
|
-
return `0 ${space.xs} 0 ${space.xxs}`;
|
|
87
|
-
}
|
|
88
|
-
// if there is an icon on the right, add 4px extra padding to the left for visual balance
|
|
89
|
-
if (icon && iconPosition === 'end') {
|
|
90
|
-
if (size === 'extraSmall') {
|
|
91
|
-
return `0 ${space.xxxs} 0 ${space.xxs}`;
|
|
92
|
-
}
|
|
93
|
-
return `0 ${space.xxs} 0 ${space.xs}`;
|
|
94
|
-
}
|
|
95
|
-
// if there is no icon, return the default padding
|
|
96
|
-
return `0 ${space.xxs}`;
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
return '0';
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
const getMinWidthStyles = (children, size) => {
|
|
103
|
-
let minWidthNum;
|
|
104
|
-
switch (size) {
|
|
105
|
-
case 'large':
|
|
106
|
-
minWidthNum = '48px';
|
|
107
|
-
break;
|
|
108
|
-
case 'medium':
|
|
109
|
-
minWidthNum = space.xl;
|
|
110
|
-
break;
|
|
111
|
-
case 'small':
|
|
112
|
-
minWidthNum = space.l;
|
|
113
|
-
break;
|
|
114
|
-
case 'extraSmall':
|
|
115
|
-
minWidthNum = space.m;
|
|
116
|
-
break;
|
|
117
|
-
default:
|
|
118
|
-
minWidthNum = space.xl;
|
|
119
|
-
break;
|
|
120
|
-
}
|
|
121
|
-
return children ? 'auto' : minWidthNum;
|
|
122
|
-
};
|
|
123
|
-
/**
|
|
124
|
-
* Tertiary Buttons have the lowest emphasis. Use for less important actions that the user may not
|
|
125
|
-
* often be looking to do. Tertiary Buttons have lower prominence as its container is not visible
|
|
126
|
-
* until it is interacted with. Use Tertiary Buttons for supplemental actions such as “View More”,
|
|
127
|
-
* “Read More” or “Select a File”. Tertiary Buttons are frequently used on Cards.
|
|
128
|
-
*
|
|
129
|
-
* Tertiary Buttons have four sizes: `extraSmall`, `small`, `medium` and `large`. Icons are
|
|
130
|
-
* supported for every size and can be positioned at the `start` or `end` with the `iconPosition`
|
|
131
|
-
* prop.
|
|
132
|
-
*/
|
|
133
125
|
export const TertiaryButton = createComponent('button')({
|
|
134
126
|
displayName: 'TertiaryButton',
|
|
135
|
-
Component: ({
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
127
|
+
Component: ({ children, icon, colors, size = 'medium', isThemeable, variant, iconPosition, cs, ...elemProps }, ref, Element) => {
|
|
128
|
+
const baseIconPosition = iconPosition
|
|
129
|
+
? iconPosition
|
|
130
|
+
: icon
|
|
131
|
+
? children
|
|
132
|
+
? 'start'
|
|
133
|
+
: 'only'
|
|
134
|
+
: undefined;
|
|
135
|
+
return (React.createElement(Button, Object.assign({ as: Element, ref: ref, icon: icon, iconPosition: iconPosition, size: size, cs: [
|
|
136
|
+
tertiaryStyles,
|
|
137
|
+
tertiaryButtonModifiers({
|
|
138
|
+
isThemeable: (isThemeable || baseIconPosition !== 'only'),
|
|
139
|
+
variant: variant,
|
|
140
|
+
iconPosition: getIconPosition(size, baseIconPosition),
|
|
141
|
+
}),
|
|
142
|
+
cs,
|
|
143
|
+
] }, elemProps), children));
|
|
142
144
|
},
|
|
143
145
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarDropdownButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/ToolbarDropdownButton.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,SAAS,EAKV,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"ToolbarDropdownButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/ToolbarDropdownButton.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,SAAS,EAKV,MAAM,kCAAkC,CAAC;AAK1C,OAAO,EAAC,sBAAsB,EAAC,MAAM,qBAAqB,CAAC;AAG3D,MAAM,WAAW,0BACf,SAAQ,IAAI,CAAC,sBAAsB,EAAE,SAAS,GAAG,gBAAgB,CAAC,EAChE,SAAS;CAAG;AAgChB,eAAO,MAAM,qBAAqB,mGAuChC,CAAC"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { colors, space, borderRadius } from '@workday/canvas-kit-react/tokens';
|
|
3
3
|
import { focusRing, useTheme, createComponent, styled, } from '@workday/canvas-kit-react/common';
|
|
4
|
+
import { cssVar } from '@workday/canvas-kit-styling';
|
|
4
5
|
import { BaseButton } from './BaseButton';
|
|
5
6
|
import { chevronDownSmallIcon } from '@workday/canvas-system-icons-web';
|
|
7
|
+
import { brand } from '@workday/canvas-tokens-web';
|
|
6
8
|
const StyledToolbarDropdownButton = styled(BaseButton)({
|
|
7
9
|
padding: space.zero,
|
|
8
10
|
minWidth: space.l,
|
|
9
11
|
width: 'auto',
|
|
10
12
|
height: space.l,
|
|
11
13
|
borderRadius: borderRadius.m,
|
|
14
|
+
gap: space.zero,
|
|
12
15
|
'& .wd-icon': {
|
|
13
16
|
display: 'inline-block',
|
|
14
|
-
verticalAlign: 'middle',
|
|
15
17
|
width: 20,
|
|
16
18
|
height: 20,
|
|
17
19
|
},
|
|
@@ -23,6 +25,14 @@ const StyledToolbarDropdownButton = styled(BaseButton)({
|
|
|
23
25
|
marginRight: 0,
|
|
24
26
|
width: 18, // decrease the space between a custom icon and the chevron per design
|
|
25
27
|
},
|
|
28
|
+
'&:focus-visible, &.focus': {
|
|
29
|
+
...focusRing({
|
|
30
|
+
width: 2,
|
|
31
|
+
separation: 0,
|
|
32
|
+
innerColor: 'transparent',
|
|
33
|
+
outerColor: cssVar(brand.common.focusOutline),
|
|
34
|
+
}),
|
|
35
|
+
},
|
|
26
36
|
});
|
|
27
37
|
export const ToolbarDropdownButton = createComponent('button')({
|
|
28
38
|
displayName: 'ToolbarDropdownButton',
|
|
@@ -50,7 +60,6 @@ const getToolbarDropdownButtonColors = (theme) => {
|
|
|
50
60
|
},
|
|
51
61
|
focus: {
|
|
52
62
|
icon: colors.licorice200,
|
|
53
|
-
focusRing: focusRing({ width: 2, separation: 0 }, theme),
|
|
54
63
|
background: 'transparent',
|
|
55
64
|
},
|
|
56
65
|
disabled: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarIconButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/ToolbarIconButton.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,SAAS,EAKV,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"ToolbarIconButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/ToolbarIconButton.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,SAAS,EAKV,MAAM,kCAAkC,CAAC;AAI1C,OAAO,EAAC,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAGrD,MAAM,WAAW,sBACf,SAAQ,IAAI,CAAC,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC,EACnD,SAAS;IACX,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,KAAK,IAAI,CAAC;IACxD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAkBD,eAAO,MAAM,iBAAiB,+FAiD5B,CAAC"}
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { borderRadius, colors, space } from '@workday/canvas-kit-react/tokens';
|
|
3
3
|
import { focusRing, useTheme, createComponent, styled, } from '@workday/canvas-kit-react/common';
|
|
4
|
+
import { cssVar } from '@workday/canvas-kit-styling';
|
|
4
5
|
import { BaseButton } from './BaseButton';
|
|
6
|
+
import { brand } from '@workday/canvas-tokens-web';
|
|
5
7
|
const StyledToolbarIconButton = styled(BaseButton)({
|
|
6
8
|
['& .wd-icon']: {
|
|
7
9
|
display: 'inline-block',
|
|
8
|
-
verticalAlign: 'middle',
|
|
9
10
|
width: 20,
|
|
10
11
|
height: 20,
|
|
11
12
|
},
|
|
13
|
+
'&:focus-visible, &.focus': {
|
|
14
|
+
...focusRing({
|
|
15
|
+
width: 2,
|
|
16
|
+
separation: 0,
|
|
17
|
+
innerColor: 'transparent',
|
|
18
|
+
outerColor: cssVar(brand.common.focusOutline),
|
|
19
|
+
}),
|
|
20
|
+
},
|
|
12
21
|
});
|
|
13
22
|
export const ToolbarIconButton = createComponent('button')({
|
|
14
23
|
displayName: 'ToolbarIconButton',
|
|
@@ -48,7 +57,6 @@ const getToolbarIconButtonColors = (theme, toggled) => {
|
|
|
48
57
|
},
|
|
49
58
|
focus: {
|
|
50
59
|
icon: toggled ? themePrimary.main : colors.licorice200,
|
|
51
|
-
focusRing: focusRing({ width: 2, separation: 0 }, theme),
|
|
52
60
|
background: toggled ? themePrimary.lightest : 'transparent',
|
|
53
61
|
},
|
|
54
62
|
disabled: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ButtonSizes
|
|
1
|
+
import { ButtonSizes } from '../types';
|
|
2
2
|
import { SystemIconProps } from '@workday/canvas-kit-react/icon';
|
|
3
3
|
export interface ButtonLabelIconProps extends Partial<SystemIconProps> {
|
|
4
4
|
/**
|
|
@@ -7,12 +7,6 @@ export interface ButtonLabelIconProps extends Partial<SystemIconProps> {
|
|
|
7
7
|
* @default 'medium'
|
|
8
8
|
*/
|
|
9
9
|
size?: ButtonSizes;
|
|
10
|
-
/**
|
|
11
|
-
* Button icon positions can either be `left` or `right`.
|
|
12
|
-
* If no value is provided, it defaults to `left`.
|
|
13
|
-
* @default 'start'
|
|
14
|
-
*/
|
|
15
|
-
iconPosition?: IconPositions;
|
|
16
10
|
/**
|
|
17
11
|
* If set to `true`, transform the icon's x-axis to mirror the graphic
|
|
18
12
|
* @default false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonLabelIcon.d.ts","sourceRoot":"","sources":["../../../../../button/lib/parts/ButtonLabelIcon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"ButtonLabelIcon.d.ts","sourceRoot":"","sources":["../../../../../button/lib/parts/ButtonLabelIcon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAC,MAAM,UAAU,CAAC;AAErC,OAAO,EAAa,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAE3E,MAAM,WAAW,oBAAqB,SAAQ,OAAO,CAAC,eAAe,CAAC;IACpE;;;;OAIG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AASD,eAAO,MAAM,eAAe,2FAyB1B,CAAC"}
|
|
@@ -11,13 +11,13 @@ export interface ButtonStateColors {
|
|
|
11
11
|
opacity?: string;
|
|
12
12
|
}
|
|
13
13
|
export interface ButtonColors {
|
|
14
|
-
default
|
|
15
|
-
hover
|
|
16
|
-
active
|
|
17
|
-
focus
|
|
14
|
+
default?: ButtonStateColors;
|
|
15
|
+
hover?: ButtonStateColors;
|
|
16
|
+
active?: ButtonStateColors;
|
|
17
|
+
focus?: ButtonStateColors & {
|
|
18
18
|
focusRing?: CSSObject;
|
|
19
19
|
};
|
|
20
|
-
disabled
|
|
20
|
+
disabled?: ButtonStateColors;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* There are four button sizes: `extraSmall`, `small`, `medium`, and `large`.
|
|
@@ -26,6 +26,5 @@ export interface ButtonColors {
|
|
|
26
26
|
* @default 'medium'
|
|
27
27
|
*/
|
|
28
28
|
export declare type ButtonSizes = 'extraSmall' | 'small' | 'medium' | 'large';
|
|
29
|
-
export declare type
|
|
30
|
-
export declare type IconPositions = 'start' | 'end';
|
|
29
|
+
export declare type IconPositions = 'start' | 'end' | 'only';
|
|
31
30
|
//# 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,iBAAiB,CAAC;AAE1C;;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,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../button/lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAE1C;;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,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,KAAK,CAAC,EAAE,iBAAiB,GAAG;QAC1B,SAAS,CAAC,EAAE,SAAS,CAAC;KACvB,CAAC;IACF,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED;;;;;GAKG;AACH,oBAAY,WAAW,GAAG,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AACtE,oBAAY,aAAa,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC"}
|
|
@@ -44,6 +44,6 @@ export declare const Card: import("@workday/canvas-kit-react/common").ElementCom
|
|
|
44
44
|
* dialog), it may be helpful to add an `aria-describedby` referencing the `id` of the
|
|
45
45
|
* `Card.Body` to the `Card` container.
|
|
46
46
|
*/
|
|
47
|
-
Body: import("@workday/canvas-kit-react/common").ElementComponent<"div", import("@workday/canvas-kit-react/layout").BackgroundStyleProps & import("../../layout/lib/utils/border/color").BorderColorStyleProps & import("../../layout/lib/utils/border/lineStyle").BorderLineStyleProps & import("../../layout/lib/utils/border/radius").BorderRadiusStyleProps & import("../../layout/lib/utils/border/shorthand").BorderShorthandStyleProps & import("../../layout/lib/utils/border/width").BorderWidthStyleProps & import("@workday/canvas-kit-react/layout").ColorStyleProps & import("@workday/canvas-kit-react/layout").DepthStyleProps & import("@workday/canvas-kit-react/layout").FlexItemStyleProps & import("@workday/canvas-kit-react/layout").GridItemStyleProps & import("@workday/canvas-kit-react/layout").LayoutStyleProps & import("@workday/canvas-kit-react/layout").OtherStyleProps & import("@workday/canvas-kit-react/layout").PositionStyleProps & import("@workday/canvas-kit-react/layout").SpaceStyleProps & import("@workday/canvas-kit-react/layout").TextStyleProps>;
|
|
47
|
+
Body: import("@workday/canvas-kit-react/common").ElementComponent<"div", import("@workday/canvas-kit-react/layout").BackgroundStyleProps & import("../../layout/lib/utils/border/color").BorderColorStyleProps & import("../../layout/lib/utils/border/lineStyle").BorderLineStyleProps & import("../../layout/lib/utils/border/radius").BorderRadiusStyleProps & import("../../layout/lib/utils/border/shorthand").BorderShorthandStyleProps & import("../../layout/lib/utils/border/width").BorderWidthStyleProps & import("@workday/canvas-kit-react/layout").ColorStyleProps & import("@workday/canvas-kit-react/layout").DepthStyleProps & import("@workday/canvas-kit-react/layout").FlexItemStyleProps & import("@workday/canvas-kit-react/layout").GridItemStyleProps & import("@workday/canvas-kit-react/layout").LayoutStyleProps & import("@workday/canvas-kit-react/layout").OtherStyleProps & import("@workday/canvas-kit-react/layout").PositionStyleProps & import("@workday/canvas-kit-react/layout").SpaceStyleProps & import("@workday/canvas-kit-react/layout").TextStyleProps & import("@workday/canvas-kit-styling").CSProps>;
|
|
48
48
|
};
|
|
49
49
|
//# sourceMappingURL=Card.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const CardBody: import("@workday/canvas-kit-react/common").ElementComponent<"div", import("@workday/canvas-kit-react/layout").BackgroundStyleProps & import("../../layout/lib/utils/border/color").BorderColorStyleProps & import("../../layout/lib/utils/border/lineStyle").BorderLineStyleProps & import("../../layout/lib/utils/border/radius").BorderRadiusStyleProps & import("../../layout/lib/utils/border/shorthand").BorderShorthandStyleProps & import("../../layout/lib/utils/border/width").BorderWidthStyleProps & import("@workday/canvas-kit-react/layout").ColorStyleProps & import("@workday/canvas-kit-react/layout").DepthStyleProps & import("@workday/canvas-kit-react/layout").FlexItemStyleProps & import("@workday/canvas-kit-react/layout").GridItemStyleProps & import("@workday/canvas-kit-react/layout").LayoutStyleProps & import("@workday/canvas-kit-react/layout").OtherStyleProps & import("@workday/canvas-kit-react/layout").PositionStyleProps & import("@workday/canvas-kit-react/layout").SpaceStyleProps & import("@workday/canvas-kit-react/layout").TextStyleProps>;
|
|
1
|
+
export declare const CardBody: import("@workday/canvas-kit-react/common").ElementComponent<"div", import("@workday/canvas-kit-react/layout").BackgroundStyleProps & import("../../layout/lib/utils/border/color").BorderColorStyleProps & import("../../layout/lib/utils/border/lineStyle").BorderLineStyleProps & import("../../layout/lib/utils/border/radius").BorderRadiusStyleProps & import("../../layout/lib/utils/border/shorthand").BorderShorthandStyleProps & import("../../layout/lib/utils/border/width").BorderWidthStyleProps & import("@workday/canvas-kit-react/layout").ColorStyleProps & import("@workday/canvas-kit-react/layout").DepthStyleProps & import("@workday/canvas-kit-react/layout").FlexItemStyleProps & import("@workday/canvas-kit-react/layout").GridItemStyleProps & import("@workday/canvas-kit-react/layout").LayoutStyleProps & import("@workday/canvas-kit-react/layout").OtherStyleProps & import("@workday/canvas-kit-react/layout").PositionStyleProps & import("@workday/canvas-kit-react/layout").SpaceStyleProps & import("@workday/canvas-kit-react/layout").TextStyleProps & import("@workday/canvas-kit-styling").CSProps>;
|
|
2
2
|
//# sourceMappingURL=CardBody.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardBody.d.ts","sourceRoot":"","sources":["../../../../card/lib/CardBody.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"CardBody.d.ts","sourceRoot":"","sources":["../../../../card/lib/CardBody.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ,8kCASnB,CAAC"}
|
|
@@ -3,12 +3,5 @@ import { PartialEmotionCanvasTheme } from './theming';
|
|
|
3
3
|
export interface CanvasProviderProps {
|
|
4
4
|
theme: PartialEmotionCanvasTheme;
|
|
5
5
|
}
|
|
6
|
-
export declare
|
|
7
|
-
static defaultProps: {
|
|
8
|
-
theme: {
|
|
9
|
-
canvas: import("./theming").CanvasTheme;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
render(): JSX.Element;
|
|
13
|
-
}
|
|
6
|
+
export declare const CanvasProvider: ({ children, theme, ...props }: CanvasProviderProps & React.HTMLAttributes<HTMLElement>) => JSX.Element;
|
|
14
7
|
//# sourceMappingURL=CanvasProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CanvasProvider.d.ts","sourceRoot":"","sources":["../../../../common/lib/CanvasProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAqB,yBAAyB,
|
|
1
|
+
{"version":3,"file":"CanvasProvider.d.ts","sourceRoot":"","sources":["../../../../common/lib/CanvasProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAqB,yBAAyB,EAAW,MAAM,WAAW,CAAC;AAGlF,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,yBAAyB,CAAC;CAClC;AAkCD,eAAO,MAAM,cAAc,kCAIxB,mBAAmB,GAAG,MAAM,cAAc,CAAC,WAAW,CAAC,gBAazD,CAAC"}
|
|
@@ -1,17 +1,35 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ThemeProvider } from '@emotion/react';
|
|
3
3
|
import { InputProvider } from './InputProvider';
|
|
4
|
-
import { defaultCanvasTheme } from './theming';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
4
|
+
import { defaultCanvasTheme, useTheme } from './theming';
|
|
5
|
+
import { brand } from '@workday/canvas-tokens-web';
|
|
6
|
+
const mappedKeys = {
|
|
7
|
+
lightest: 'lightest',
|
|
8
|
+
light: 'light',
|
|
9
|
+
main: 'base',
|
|
10
|
+
dark: 'dark',
|
|
11
|
+
darkest: 'darkest',
|
|
12
|
+
contrast: 'accent',
|
|
13
|
+
};
|
|
14
|
+
const useCanvasThemeToCssVars = (theme, elemProps) => {
|
|
15
|
+
const filledTheme = useTheme(theme);
|
|
16
|
+
const { palette } = filledTheme.canvas;
|
|
17
|
+
const style = ['common', 'primary', 'error', 'alert', 'success', 'neutral'].reduce((result, color) => {
|
|
18
|
+
if (color === 'common') {
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
result[brand.common.focusOutline] = palette.common.focusOutline;
|
|
21
|
+
}
|
|
22
|
+
['lightest', 'light', 'main', 'dark', 'darkest', 'contrast'].forEach(key => {
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
result[brand[color][mappedKeys[key]]] = palette[color][key];
|
|
25
|
+
});
|
|
26
|
+
return result;
|
|
27
|
+
}, elemProps.style || {});
|
|
28
|
+
return { ...elemProps, style };
|
|
29
|
+
};
|
|
30
|
+
export const CanvasProvider = ({ children, theme, ...props }) => {
|
|
31
|
+
const elemProps = useCanvasThemeToCssVars(theme, props);
|
|
32
|
+
return (React.createElement(ThemeProvider, { theme: theme },
|
|
33
|
+
React.createElement(InputProvider, null),
|
|
34
|
+
React.createElement("div", Object.assign({ dir: (theme.canvas && theme.canvas.direction) || defaultCanvasTheme.direction }, elemProps), children)));
|
|
17
35
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slugify.d.ts","sourceRoot":"","sources":["../../../../../common/lib/utils/slugify.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"slugify.d.ts","sourceRoot":"","sources":["../../../../../common/lib/utils/slugify.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAU7C"}
|
|
@@ -4,8 +4,11 @@
|
|
|
4
4
|
export function slugify(input) {
|
|
5
5
|
return input
|
|
6
6
|
.trim()
|
|
7
|
+
.replace(/[\.\s_-]+/g, '-')
|
|
7
8
|
.replace(/[^\w\s-]/g, '')
|
|
8
|
-
.replace(/[
|
|
9
|
+
.replace(/([A-Z])/g, m => {
|
|
10
|
+
return '-' + m.toLowerCase();
|
|
11
|
+
})
|
|
9
12
|
.replace(/^-+|-+$/g, '')
|
|
10
13
|
.toLowerCase();
|
|
11
14
|
}
|
|
@@ -99,7 +99,7 @@ export declare const Dialog: import("@workday/canvas-kit-react/common").Componen
|
|
|
99
99
|
* A `Dialog.Body` is a thin wrapper around {@link CardBody Card.Body} and doesn't actually take
|
|
100
100
|
* a model. It adds `body` styling and nothing else.
|
|
101
101
|
*/
|
|
102
|
-
Body: import("@workday/canvas-kit-react/common").ElementComponentM<"div", import("../..").BackgroundStyleProps & import("../../layout/lib/utils/border/color").BorderColorStyleProps & import("../../layout/lib/utils/border/lineStyle").BorderLineStyleProps & import("../../layout/lib/utils/border/radius").BorderRadiusStyleProps & import("../../layout/lib/utils/border/shorthand").BorderShorthandStyleProps & import("../../layout/lib/utils/border/width").BorderWidthStyleProps & import("../..").ColorStyleProps & import("../..").DepthStyleProps & import("../..").FlexItemStyleProps & import("../..").GridItemStyleProps & import("../..").LayoutStyleProps & import("../..").OtherStyleProps & import("../..").PositionStyleProps & import("../..").SpaceStyleProps & import("../..").TextStyleProps & React.HTMLAttributes<HTMLDivElement>, {
|
|
102
|
+
Body: import("@workday/canvas-kit-react/common").ElementComponentM<"div", import("../..").BackgroundStyleProps & import("../../layout/lib/utils/border/color").BorderColorStyleProps & import("../../layout/lib/utils/border/lineStyle").BorderLineStyleProps & import("../../layout/lib/utils/border/radius").BorderRadiusStyleProps & import("../../layout/lib/utils/border/shorthand").BorderShorthandStyleProps & import("../../layout/lib/utils/border/width").BorderWidthStyleProps & import("../..").ColorStyleProps & import("../..").DepthStyleProps & import("../..").FlexItemStyleProps & import("../..").GridItemStyleProps & import("../..").LayoutStyleProps & import("../..").OtherStyleProps & import("../..").PositionStyleProps & import("../..").SpaceStyleProps & import("../..").TextStyleProps & import("@workday/canvas-kit-styling").CSProps & React.HTMLAttributes<HTMLDivElement>, {
|
|
103
103
|
state: {
|
|
104
104
|
stackRef: React.RefObject<HTMLDivElement>;
|
|
105
105
|
targetRef: React.RefObject<HTMLButtonElement>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { CSProps } from '@workday/canvas-kit-styling';
|
|
2
3
|
import { CommonStyleProps } from './utils/styleProps';
|
|
3
4
|
/**
|
|
4
5
|
* Box Props
|
|
@@ -17,7 +18,7 @@ import { CommonStyleProps } from './utils/styleProps';
|
|
|
17
18
|
* - space
|
|
18
19
|
* - text
|
|
19
20
|
*/
|
|
20
|
-
export declare type BoxProps = CommonStyleProps & {
|
|
21
|
+
export declare type BoxProps = CommonStyleProps & CSProps & {
|
|
21
22
|
children?: React.ReactNode;
|
|
22
23
|
};
|
|
23
24
|
/**
|
|
@@ -56,5 +57,5 @@ export declare const boxStyleFn: <P extends BoxProps>(props: P) => {};
|
|
|
56
57
|
* );
|
|
57
58
|
*
|
|
58
59
|
*/
|
|
59
|
-
export declare const Box: import("@workday/canvas-kit-react/common").ElementComponent<"div", import("./utils/background").BackgroundStyleProps & import("./utils/border/color").BorderColorStyleProps & import("./utils/border/lineStyle").BorderLineStyleProps & import("./utils/border/radius").BorderRadiusStyleProps & import("./utils/border/shorthand").BorderShorthandStyleProps & import("./utils/border/width").BorderWidthStyleProps & import("./utils/color").ColorStyleProps & import("./utils/depth").DepthStyleProps & import("./utils/flexItem").FlexItemStyleProps & import("./utils/gridItem").GridItemStyleProps & import("./utils/layout").LayoutStyleProps & import("./utils/other").OtherStyleProps & import("./utils/position").PositionStyleProps & import("./utils/space").SpaceStyleProps & import("./utils/text").TextStyleProps>;
|
|
60
|
+
export declare const Box: import("@workday/canvas-kit-react/common").ElementComponent<"div", import("./utils/background").BackgroundStyleProps & import("./utils/border/color").BorderColorStyleProps & import("./utils/border/lineStyle").BorderLineStyleProps & import("./utils/border/radius").BorderRadiusStyleProps & import("./utils/border/shorthand").BorderShorthandStyleProps & import("./utils/border/width").BorderWidthStyleProps & import("./utils/color").ColorStyleProps & import("./utils/depth").DepthStyleProps & import("./utils/flexItem").FlexItemStyleProps & import("./utils/gridItem").GridItemStyleProps & import("./utils/layout").LayoutStyleProps & import("./utils/other").OtherStyleProps & import("./utils/position").PositionStyleProps & import("./utils/space").SpaceStyleProps & import("./utils/text").TextStyleProps & CSProps>;
|
|
60
61
|
//# sourceMappingURL=Box.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../../layout/lib/Box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAC,OAAO,EAAe,MAAM,6BAA6B,CAAC;AAclE,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAEpD;;;;;;;;;;;;;;;;GAgBG;AACH,oBAAY,QAAQ,GAAG,gBAAgB,GACrC,OAAO,GAAG;IACR,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AA6BJ;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,UAAU,sCA0BtB,CAAC;AAQF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,GAAG,6yBAad,CAAC"}
|
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
3
|
import isPropValid from '@emotion/is-prop-valid';
|
|
4
4
|
import { createComponent, useConstant } from '@workday/canvas-kit-react/common';
|
|
5
|
+
import { handleCsProp } from '@workday/canvas-kit-styling';
|
|
5
6
|
// style props
|
|
6
7
|
import { background } from './utils/background';
|
|
7
8
|
import { border } from './utils/border';
|
|
@@ -109,6 +110,6 @@ export const Box = createComponent('div')({
|
|
|
109
110
|
displayName: 'Box',
|
|
110
111
|
Component: ({ children, ...elemProps }, ref, Element) => {
|
|
111
112
|
const BoxComponent = useConstant(() => typeof Element === 'string' ? StyledBoxElement : StyledBoxComponent);
|
|
112
|
-
return (React.createElement(BoxComponent, Object.assign({ as: Element, ref: ref }, elemProps), children));
|
|
113
|
+
return (React.createElement(BoxComponent, Object.assign({ as: Element, ref: ref }, handleCsProp(elemProps)), children));
|
|
113
114
|
},
|
|
114
115
|
});
|
|
@@ -24,6 +24,6 @@ export declare type FlexProps = Omit<BoxProps, 'display'> & FlexStyleProps;
|
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
26
|
export declare const Flex: import("@workday/canvas-kit-react/common").ElementComponent<"div", Omit<BoxProps, "display"> & FlexStyleProps> & {
|
|
27
|
-
Item: import("@workday/canvas-kit-react/common").ElementComponent<"div", import("..").BackgroundStyleProps & import("./utils/border/color").BorderColorStyleProps & import("./utils/border/lineStyle").BorderLineStyleProps & import("./utils/border/radius").BorderRadiusStyleProps & import("./utils/border/shorthand").BorderShorthandStyleProps & import("./utils/border/width").BorderWidthStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").GridItemStyleProps & import("..").LayoutStyleProps & import("..").OtherStyleProps & import("..").PositionStyleProps & import("..").SpaceStyleProps & import("..").TextStyleProps>;
|
|
27
|
+
Item: import("@workday/canvas-kit-react/common").ElementComponent<"div", import("..").BackgroundStyleProps & import("./utils/border/color").BorderColorStyleProps & import("./utils/border/lineStyle").BorderLineStyleProps & import("./utils/border/radius").BorderRadiusStyleProps & import("./utils/border/shorthand").BorderShorthandStyleProps & import("./utils/border/width").BorderWidthStyleProps & import("..").ColorStyleProps & import("..").DepthStyleProps & import("..").FlexItemStyleProps & import("..").GridItemStyleProps & import("..").LayoutStyleProps & import("..").OtherStyleProps & import("..").PositionStyleProps & import("..").SpaceStyleProps & import("..").TextStyleProps & import("@workday/canvas-kit-styling").CSProps>;
|
|
28
28
|
};
|
|
29
29
|
//# sourceMappingURL=Flex.d.ts.map
|