@workday/canvas-kit-react 11.0.0-alpha.643-next.0 → 11.0.0-alpha.656-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/badge/lib/CountBadge.tsx +9 -13
- package/button/lib/BaseButton.tsx +53 -56
- package/button/lib/DeleteButton.tsx +19 -19
- package/button/lib/PrimaryButton.tsx +37 -37
- package/button/lib/SecondaryButton.tsx +41 -41
- package/button/lib/TertiaryButton.tsx +42 -42
- package/button/lib/ToolbarDropdownButton.tsx +1 -2
- package/button/lib/ToolbarIconButton.tsx +1 -2
- package/card/lib/Card.tsx +13 -13
- package/card/lib/CardBody.tsx +8 -5
- package/card/lib/CardHeading.tsx +15 -10
- package/common/lib/styles/focusRing.ts +9 -0
- package/dist/commonjs/avatar/lib/Avatar.js +1 -1
- package/dist/commonjs/badge/lib/CountBadge.d.ts.map +1 -1
- package/dist/commonjs/badge/lib/CountBadge.js +5 -38
- package/dist/commonjs/banner/lib/Banner.js +1 -1
- package/dist/commonjs/button/lib/BaseButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/BaseButton.js +22 -22
- package/dist/commonjs/button/lib/DeleteButton.js +1 -1
- package/dist/commonjs/button/lib/PrimaryButton.js +2 -2
- package/dist/commonjs/button/lib/SecondaryButton.js +2 -2
- package/dist/commonjs/button/lib/TertiaryButton.js +15 -15
- package/dist/commonjs/button/lib/ToolbarDropdownButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/ToolbarDropdownButton.js +1 -7
- package/dist/commonjs/button/lib/ToolbarIconButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/ToolbarIconButton.js +1 -7
- package/dist/commonjs/button/lib/deprecated_Button.js +2 -2
- package/dist/commonjs/card/lib/Card.d.ts +1 -1
- package/dist/commonjs/card/lib/Card.d.ts.map +1 -1
- package/dist/commonjs/card/lib/Card.js +4 -2
- package/dist/commonjs/card/lib/CardBody.d.ts +4 -1
- package/dist/commonjs/card/lib/CardBody.d.ts.map +1 -1
- package/dist/commonjs/card/lib/CardBody.js +2 -3
- package/dist/commonjs/card/lib/CardHeading.d.ts.map +1 -1
- package/dist/commonjs/card/lib/CardHeading.js +5 -1
- package/dist/commonjs/checkbox/lib/Checkbox.js +2 -14
- package/dist/commonjs/common/lib/CanvasProvider.js +1 -1
- package/dist/commonjs/common/lib/styles/focusRing.d.ts.map +1 -1
- package/dist/commonjs/common/lib/styles/focusRing.js +9 -0
- package/dist/commonjs/dialog/lib/Dialog.d.ts +1 -1
- package/dist/commonjs/pagination/lib/Pagination/GoTo/Label.js +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/radio/lib/Radio.js +3 -17
- package/dist/commonjs/select/lib/Select.js +1 -1
- package/dist/commonjs/switch/lib/Switch.js +2 -2
- package/dist/commonjs/tabs/lib/TabsItem.js +1 -1
- package/dist/commonjs/text/lib/LabelText.d.ts +26 -7
- package/dist/commonjs/text/lib/LabelText.d.ts.map +1 -1
- package/dist/commonjs/text/lib/LabelText.js +46 -7
- package/dist/commonjs/text/lib/Text.d.ts +14 -11
- package/dist/commonjs/text/lib/Text.d.ts.map +1 -1
- package/dist/commonjs/text/lib/Text.js +36 -42
- package/dist/commonjs/text/lib/TypeLevelComponents.d.ts +3 -1
- package/dist/commonjs/text/lib/TypeLevelComponents.d.ts.map +1 -1
- package/dist/commonjs/text/lib/TypeLevelComponents.js +5 -4
- package/dist/es6/avatar/lib/Avatar.js +1 -1
- package/dist/es6/badge/lib/CountBadge.d.ts.map +1 -1
- package/dist/es6/badge/lib/CountBadge.js +6 -39
- package/dist/es6/banner/lib/Banner.js +1 -1
- package/dist/es6/button/lib/BaseButton.d.ts.map +1 -1
- package/dist/es6/button/lib/BaseButton.js +22 -22
- package/dist/es6/button/lib/DeleteButton.js +2 -2
- package/dist/es6/button/lib/PrimaryButton.js +3 -3
- package/dist/es6/button/lib/SecondaryButton.js +3 -3
- package/dist/es6/button/lib/TertiaryButton.js +16 -16
- package/dist/es6/button/lib/ToolbarDropdownButton.d.ts.map +1 -1
- package/dist/es6/button/lib/ToolbarDropdownButton.js +1 -7
- package/dist/es6/button/lib/ToolbarIconButton.d.ts.map +1 -1
- package/dist/es6/button/lib/ToolbarIconButton.js +1 -7
- package/dist/es6/button/lib/deprecated_Button.js +2 -2
- package/dist/es6/card/lib/Card.d.ts +1 -1
- package/dist/es6/card/lib/Card.d.ts.map +1 -1
- package/dist/es6/card/lib/Card.js +5 -3
- package/dist/es6/card/lib/CardBody.d.ts +4 -1
- package/dist/es6/card/lib/CardBody.d.ts.map +1 -1
- package/dist/es6/card/lib/CardBody.js +2 -3
- package/dist/es6/card/lib/CardHeading.d.ts.map +1 -1
- package/dist/es6/card/lib/CardHeading.js +6 -2
- package/dist/es6/checkbox/lib/Checkbox.js +2 -14
- package/dist/es6/common/lib/CanvasProvider.js +1 -1
- package/dist/es6/common/lib/styles/focusRing.d.ts.map +1 -1
- package/dist/es6/common/lib/styles/focusRing.js +9 -0
- package/dist/es6/dialog/lib/Dialog.d.ts +1 -1
- package/dist/es6/pagination/lib/Pagination/GoTo/Label.js +2 -2
- package/dist/es6/popup/lib/Popup.d.ts +1 -1
- package/dist/es6/popup/lib/PopupBody.d.ts +1 -1
- package/dist/es6/radio/lib/Radio.js +3 -17
- package/dist/es6/select/lib/Select.js +1 -1
- package/dist/es6/switch/lib/Switch.js +2 -2
- package/dist/es6/tabs/lib/TabsItem.js +1 -1
- package/dist/es6/text/lib/LabelText.d.ts +26 -7
- package/dist/es6/text/lib/LabelText.d.ts.map +1 -1
- package/dist/es6/text/lib/LabelText.js +46 -7
- package/dist/es6/text/lib/Text.d.ts +14 -11
- package/dist/es6/text/lib/Text.d.ts.map +1 -1
- package/dist/es6/text/lib/Text.js +37 -43
- package/dist/es6/text/lib/TypeLevelComponents.d.ts +3 -1
- package/dist/es6/text/lib/TypeLevelComponents.d.ts.map +1 -1
- package/dist/es6/text/lib/TypeLevelComponents.js +5 -4
- package/package.json +5 -5
- package/pagination/lib/Pagination/GoTo/Label.tsx +4 -4
- package/text/lib/LabelText.tsx +113 -17
- package/text/lib/Text.tsx +84 -58
- package/text/lib/TypeLevelComponents.tsx +8 -5
package/badge/lib/CountBadge.tsx
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
// eslint-disable-next-line @emotion/no-vanilla
|
|
3
|
-
import {keyframes} from '@emotion/css';
|
|
4
2
|
import {createComponent} from '@workday/canvas-kit-react/common';
|
|
5
|
-
import {handleCsProp, CSProps, createStencil, px2rem} from '@workday/canvas-kit-styling';
|
|
3
|
+
import {handleCsProp, CSProps, createStencil, px2rem, keyframes} from '@workday/canvas-kit-styling';
|
|
6
4
|
import {base, system} from '@workday/canvas-tokens-web';
|
|
7
5
|
|
|
8
|
-
const grow = keyframes
|
|
9
|
-
from {
|
|
10
|
-
transform: scale(0.85)
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
`;
|
|
6
|
+
const grow = keyframes({
|
|
7
|
+
from: {
|
|
8
|
+
transform: 'scale(0.85)',
|
|
9
|
+
},
|
|
10
|
+
to: {
|
|
11
|
+
transform: 'scale(1.0)',
|
|
12
|
+
},
|
|
13
|
+
});
|
|
17
14
|
|
|
18
15
|
export interface CountBadgeProps extends CSProps {
|
|
19
16
|
/**
|
|
@@ -46,7 +43,6 @@ const countBadgeStencil = createStencil({
|
|
|
46
43
|
display: 'inline-flex',
|
|
47
44
|
fontFamily: system.fontFamily.default,
|
|
48
45
|
fontSize: system.fontSize.subtext.medium,
|
|
49
|
-
//@ts-ignore
|
|
50
46
|
fontWeight: system.fontWeight.bold,
|
|
51
47
|
height: px2rem(20),
|
|
52
48
|
justifyContent: 'center',
|
|
@@ -121,10 +121,10 @@ const baseButtonStyles = createStyles({
|
|
|
121
121
|
letterSpacing: '0.015rem',
|
|
122
122
|
fontWeight: 'bold',
|
|
123
123
|
backgroundColor: cssVar(buttonVars.default.background, 'transparent'),
|
|
124
|
-
color: cssVar(buttonVars.default.label,
|
|
124
|
+
color: cssVar(buttonVars.default.label, base.blackPepper400),
|
|
125
125
|
borderWidth: '1px',
|
|
126
126
|
borderStyle: 'solid',
|
|
127
|
-
gap:
|
|
127
|
+
gap: system.space.x2,
|
|
128
128
|
borderColor: cssVar(buttonVars.default.border, 'transparent'),
|
|
129
129
|
cursor: 'pointer',
|
|
130
130
|
display: 'inline-flex',
|
|
@@ -136,7 +136,7 @@ const baseButtonStyles = createStyles({
|
|
|
136
136
|
whiteSpace: 'nowrap',
|
|
137
137
|
WebkitFontSmoothing: 'antialiased',
|
|
138
138
|
MozOsxFontSmoothing: 'grayscale',
|
|
139
|
-
borderRadius: cssVar(buttonVars.default.borderRadius,
|
|
139
|
+
borderRadius: cssVar(buttonVars.default.borderRadius, system.shape.round),
|
|
140
140
|
position: 'relative',
|
|
141
141
|
verticalAlign: 'middle',
|
|
142
142
|
overflow: 'hidden',
|
|
@@ -149,63 +149,60 @@ const baseButtonStyles = createStyles({
|
|
|
149
149
|
},
|
|
150
150
|
'& span .wd-icon-fill': {
|
|
151
151
|
transitionDuration: '40ms',
|
|
152
|
-
fill: cssVar(buttonVars.default.icon,
|
|
152
|
+
fill: cssVar(buttonVars.default.icon, base.blackPepper400),
|
|
153
153
|
},
|
|
154
154
|
'.wd-icon-background ~ .wd-icon-accent, .wd-icon-background ~ .wd-icon-accent2': {
|
|
155
|
-
fill: cssVar(buttonVars.default.icon,
|
|
155
|
+
fill: cssVar(buttonVars.default.icon, base.blackPepper400),
|
|
156
156
|
},
|
|
157
157
|
'&:focus-visible, &.focus': {
|
|
158
158
|
backgroundColor: cssVar(buttonVars.focus.background, 'transparent'),
|
|
159
159
|
borderColor: cssVar(buttonVars.focus.border, 'transparent'),
|
|
160
|
-
color: cssVar(buttonVars.focus.label,
|
|
160
|
+
color: cssVar(buttonVars.focus.label, base.blackPepper400),
|
|
161
161
|
'& span .wd-icon-fill': {
|
|
162
|
-
fill: cssVar(buttonVars.focus.icon,
|
|
162
|
+
fill: cssVar(buttonVars.focus.icon, base.blackPepper400),
|
|
163
163
|
},
|
|
164
164
|
'.wd-icon-background ~ .wd-icon-accent, .wd-icon-background ~ .wd-icon-accent2': {
|
|
165
|
-
fill: cssVar(buttonVars.focus.icon,
|
|
165
|
+
fill: cssVar(buttonVars.focus.icon, base.blackPepper400),
|
|
166
166
|
},
|
|
167
167
|
...focusRing({
|
|
168
168
|
width: 2,
|
|
169
169
|
separation: 2,
|
|
170
|
-
innerColor: cssVar(buttonVars.focus.boxShadowInner,
|
|
171
|
-
outerColor: cssVar(
|
|
172
|
-
buttonVars.focus.boxShadowOuter,
|
|
173
|
-
cssVar(brand.primary.base, 'rgba(0,92,184,1)')
|
|
174
|
-
),
|
|
170
|
+
innerColor: cssVar(buttonVars.focus.boxShadowInner, base.frenchVanilla100),
|
|
171
|
+
outerColor: cssVar(buttonVars.focus.boxShadowOuter, brand.primary.base),
|
|
175
172
|
}),
|
|
176
173
|
},
|
|
177
174
|
'&:hover, &.hover': {
|
|
178
|
-
backgroundColor: cssVar(buttonVars.hover.background,
|
|
175
|
+
backgroundColor: cssVar(buttonVars.hover.background, base.blackPepper500),
|
|
179
176
|
borderColor: cssVar(buttonVars.hover.border, 'transparent'),
|
|
180
|
-
color: cssVar(buttonVars.hover.label,
|
|
177
|
+
color: cssVar(buttonVars.hover.label, base.blackPepper500),
|
|
181
178
|
'& span .wd-icon-fill': {
|
|
182
|
-
fill: cssVar(buttonVars.hover.icon,
|
|
179
|
+
fill: cssVar(buttonVars.hover.icon, base.blackPepper500),
|
|
183
180
|
},
|
|
184
181
|
'.wd-icon-background ~ .wd-icon-accent, .wd-icon-background ~ .wd-icon-accent2': {
|
|
185
|
-
fill: cssVar(buttonVars.hover.icon,
|
|
182
|
+
fill: cssVar(buttonVars.hover.icon, base.blackPepper500),
|
|
186
183
|
},
|
|
187
184
|
},
|
|
188
185
|
'&:hover:active': {transitionDuration: '40ms'},
|
|
189
186
|
'&:active, &.active': {
|
|
190
187
|
backgroundColor: cssVar(buttonVars.active.background, 'transparent'),
|
|
191
188
|
borderColor: cssVar(buttonVars.active.border, 'transparent'),
|
|
192
|
-
color: cssVar(buttonVars.active.label,
|
|
189
|
+
color: cssVar(buttonVars.active.label, base.blackPepper400),
|
|
193
190
|
'& span .wd-icon-fill': {
|
|
194
|
-
fill: cssVar(buttonVars.active.icon,
|
|
191
|
+
fill: cssVar(buttonVars.active.icon, base.blackPepper400),
|
|
195
192
|
},
|
|
196
193
|
'.wd-icon-background ~ .wd-icon-accent, .wd-icon-background ~ .wd-icon-accent2': {
|
|
197
|
-
fill: cssVar(buttonVars.active.icon),
|
|
194
|
+
fill: cssVar(buttonVars.active.icon, base.blackPepper400),
|
|
198
195
|
},
|
|
199
196
|
},
|
|
200
197
|
'&:disabled, &.disabled': {
|
|
201
198
|
backgroundColor: cssVar(buttonVars.disabled.background, 'transparent'),
|
|
202
199
|
borderColor: cssVar(buttonVars.disabled.border, 'transparent'),
|
|
203
|
-
color: cssVar(buttonVars.disabled.label,
|
|
200
|
+
color: cssVar(buttonVars.disabled.label, base.blackPepper400),
|
|
204
201
|
'& span .wd-icon-fill': {
|
|
205
|
-
fill: cssVar(buttonVars.disabled.icon,
|
|
202
|
+
fill: cssVar(buttonVars.disabled.icon, base.blackPepper400),
|
|
206
203
|
},
|
|
207
204
|
'.wd-icon-background ~ .wd-icon-accent, .wd-icon-background ~ .wd-icon-accent2': {
|
|
208
|
-
fill: cssVar(buttonVars.disabled.icon,
|
|
205
|
+
fill: cssVar(buttonVars.disabled.icon, base.blackPepper400),
|
|
209
206
|
},
|
|
210
207
|
},
|
|
211
208
|
});
|
|
@@ -219,77 +216,77 @@ const baseButtonStyles = createStyles({
|
|
|
219
216
|
export const buttonModifiers = createModifiers({
|
|
220
217
|
size: {
|
|
221
218
|
large: createStyles({
|
|
222
|
-
fontSize:
|
|
223
|
-
lineHeight:
|
|
219
|
+
fontSize: system.space.x4,
|
|
220
|
+
lineHeight: system.space.x6,
|
|
224
221
|
letterSpacing: '0.01rem',
|
|
225
222
|
height: '48px',
|
|
226
|
-
paddingInline:
|
|
223
|
+
paddingInline: system.space.x8,
|
|
227
224
|
minWidth: '112px',
|
|
228
225
|
}),
|
|
229
226
|
medium: createStyles({
|
|
230
227
|
fontSize: '0.875rem',
|
|
231
228
|
letterSpacing: '0.015rem',
|
|
232
229
|
minWidth: '96px',
|
|
233
|
-
paddingInline:
|
|
234
|
-
height:
|
|
230
|
+
paddingInline: system.space.x6,
|
|
231
|
+
height: system.space.x10,
|
|
235
232
|
}),
|
|
236
233
|
small: createStyles({
|
|
237
234
|
fontSize: '0.875rem',
|
|
238
235
|
letterSpacing: '0.015rem',
|
|
239
|
-
height:
|
|
240
|
-
minWidth:
|
|
241
|
-
paddingInline:
|
|
242
|
-
gap:
|
|
236
|
+
height: system.space.x8,
|
|
237
|
+
minWidth: system.space.x20,
|
|
238
|
+
paddingInline: system.space.x4,
|
|
239
|
+
gap: system.space.x1,
|
|
243
240
|
}),
|
|
244
241
|
extraSmall: createStyles({
|
|
245
242
|
fontSize: '0.75rem',
|
|
246
|
-
lineHeight:
|
|
243
|
+
lineHeight: system.space.x4,
|
|
247
244
|
letterSpacing: '0.02rem',
|
|
248
|
-
height:
|
|
245
|
+
height: system.space.x6,
|
|
249
246
|
minWidth: 'auto',
|
|
250
|
-
paddingInline:
|
|
251
|
-
gap:
|
|
247
|
+
paddingInline: system.space.x3,
|
|
248
|
+
gap: system.space.x1,
|
|
252
249
|
}),
|
|
253
250
|
},
|
|
254
251
|
iconPosition: {
|
|
255
252
|
largeOnly: createStyles({
|
|
256
253
|
padding: '0',
|
|
257
|
-
minWidth: `calc(${
|
|
254
|
+
minWidth: `calc(${system.space.x4} * 3)`,
|
|
258
255
|
}),
|
|
259
256
|
largeStart: createStyles({
|
|
260
|
-
paddingInlineStart:
|
|
261
|
-
paddingInlineEnd:
|
|
257
|
+
paddingInlineStart: system.space.x6,
|
|
258
|
+
paddingInlineEnd: system.space.x8,
|
|
262
259
|
}),
|
|
263
260
|
largeEnd: createStyles({
|
|
264
|
-
paddingInlineStart:
|
|
265
|
-
paddingInlineEnd:
|
|
261
|
+
paddingInlineStart: system.space.x8,
|
|
262
|
+
paddingInlineEnd: system.space.x6,
|
|
266
263
|
}),
|
|
267
|
-
mediumOnly: createStyles({padding: '0', minWidth:
|
|
264
|
+
mediumOnly: createStyles({padding: '0', minWidth: system.space.x10}),
|
|
268
265
|
mediumStart: createStyles({
|
|
269
|
-
paddingInlineStart: `calc(${
|
|
270
|
-
paddingInlineEnd:
|
|
266
|
+
paddingInlineStart: `calc(${system.space.x1} * 5)`,
|
|
267
|
+
paddingInlineEnd: system.space.x6,
|
|
271
268
|
}),
|
|
272
269
|
mediumEnd: createStyles({
|
|
273
|
-
paddingInlineStart:
|
|
274
|
-
paddingInlineEnd: `calc(${
|
|
270
|
+
paddingInlineStart: system.space.x6,
|
|
271
|
+
paddingInlineEnd: `calc(${system.space.x1} * 5)`,
|
|
275
272
|
}),
|
|
276
|
-
smallOnly: createStyles({padding: '0', minWidth:
|
|
273
|
+
smallOnly: createStyles({padding: '0', minWidth: system.space.x8}),
|
|
277
274
|
smallStart: createStyles({
|
|
278
|
-
paddingInlineStart:
|
|
279
|
-
paddingInlineEnd:
|
|
275
|
+
paddingInlineStart: system.space.x3,
|
|
276
|
+
paddingInlineEnd: system.space.x4,
|
|
280
277
|
}),
|
|
281
278
|
smallEnd: createStyles({
|
|
282
|
-
paddingInlineStart:
|
|
283
|
-
paddingInlineEnd:
|
|
279
|
+
paddingInlineStart: system.space.x4,
|
|
280
|
+
paddingInlineEnd: system.space.x3,
|
|
284
281
|
}),
|
|
285
|
-
extraSmallOnly: createStyles({padding: '0', minWidth:
|
|
282
|
+
extraSmallOnly: createStyles({padding: '0', minWidth: system.space.x6}),
|
|
286
283
|
extraSmallStart: createStyles({
|
|
287
|
-
paddingInlineStart:
|
|
288
|
-
paddingInlineEnd:
|
|
284
|
+
paddingInlineStart: system.space.x2,
|
|
285
|
+
paddingInlineEnd: system.space.x3,
|
|
289
286
|
}),
|
|
290
287
|
extraSmallEnd: createStyles({
|
|
291
|
-
paddingInlineStart:
|
|
292
|
-
paddingInlineEnd:
|
|
288
|
+
paddingInlineStart: system.space.x3,
|
|
289
|
+
paddingInlineEnd: system.space.x2,
|
|
293
290
|
}),
|
|
294
291
|
},
|
|
295
292
|
});
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import {buttonVars} from './BaseButton';
|
|
4
4
|
import {createComponent} from '@workday/canvas-kit-react/common';
|
|
5
|
-
import {createStyles
|
|
5
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
6
6
|
import {mergeStyles} from '@workday/canvas-kit-react/layout';
|
|
7
7
|
import {base, brand, system} from '@workday/canvas-tokens-web';
|
|
8
8
|
import {Button, ButtonProps} from './Button';
|
|
@@ -15,35 +15,35 @@ import {Button, ButtonProps} from './Button';
|
|
|
15
15
|
export interface DeleteButtonProps extends ButtonProps {}
|
|
16
16
|
|
|
17
17
|
const deleteStyles = createStyles({
|
|
18
|
-
[buttonVars.default.background]:
|
|
18
|
+
[buttonVars.default.background]: brand.error.base,
|
|
19
19
|
[buttonVars.default.border]: 'transparent',
|
|
20
|
-
[buttonVars.default.borderRadius]:
|
|
21
|
-
[buttonVars.default.label]:
|
|
22
|
-
[buttonVars.default.icon]:
|
|
20
|
+
[buttonVars.default.borderRadius]: system.shape.round,
|
|
21
|
+
[buttonVars.default.label]: brand.error.accent,
|
|
22
|
+
[buttonVars.default.icon]: brand.error.accent,
|
|
23
23
|
'&:hover, &.hover': {
|
|
24
|
-
[buttonVars.hover.background]:
|
|
24
|
+
[buttonVars.hover.background]: brand.error.dark,
|
|
25
25
|
[buttonVars.hover.border]: 'transparent',
|
|
26
|
-
[buttonVars.hover.label]:
|
|
27
|
-
[buttonVars.hover.icon]:
|
|
26
|
+
[buttonVars.hover.label]: brand.error.accent,
|
|
27
|
+
[buttonVars.hover.icon]: brand.error.accent,
|
|
28
28
|
},
|
|
29
29
|
'&:focus-visible, &.focus': {
|
|
30
|
-
[buttonVars.focus.background]:
|
|
30
|
+
[buttonVars.focus.background]: brand.error.base,
|
|
31
31
|
[buttonVars.focus.border]: 'transparent',
|
|
32
|
-
[buttonVars.focus.label]:
|
|
33
|
-
[buttonVars.focus.icon]:
|
|
34
|
-
[buttonVars.focus.boxShadowInner]:
|
|
35
|
-
[buttonVars.focus.boxShadowOuter]:
|
|
32
|
+
[buttonVars.focus.label]: brand.error.accent,
|
|
33
|
+
[buttonVars.focus.icon]: brand.error.accent,
|
|
34
|
+
[buttonVars.focus.boxShadowInner]: base.frenchVanilla100,
|
|
35
|
+
[buttonVars.focus.boxShadowOuter]: brand.common.focusOutline,
|
|
36
36
|
},
|
|
37
37
|
'&:active, &.active': {
|
|
38
|
-
[buttonVars.active.background]:
|
|
38
|
+
[buttonVars.active.background]: brand.error.darkest,
|
|
39
39
|
[buttonVars.active.border]: 'transparent',
|
|
40
|
-
[buttonVars.active.label]:
|
|
41
|
-
[buttonVars.active.icon]:
|
|
40
|
+
[buttonVars.active.label]: brand.error.accent,
|
|
41
|
+
[buttonVars.active.icon]: brand.error.accent,
|
|
42
42
|
},
|
|
43
43
|
'&:disabled, &:active:disabled, &:focus:disabled, &:hover:disabled': {
|
|
44
|
-
[buttonVars.disabled.background]:
|
|
45
|
-
[buttonVars.disabled.label]:
|
|
46
|
-
[buttonVars.disabled.icon]:
|
|
44
|
+
[buttonVars.disabled.background]: brand.error.light,
|
|
45
|
+
[buttonVars.disabled.label]: brand.error.accent,
|
|
46
|
+
[buttonVars.disabled.icon]: brand.error.accent,
|
|
47
47
|
opacity: 1,
|
|
48
48
|
},
|
|
49
49
|
});
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import {buttonVars} from './BaseButton';
|
|
4
4
|
import {createComponent} from '@workday/canvas-kit-react/common';
|
|
5
5
|
import {mergeStyles} from '@workday/canvas-kit-react/layout';
|
|
6
|
-
import {createStyles,
|
|
6
|
+
import {createStyles, createModifiers} from '@workday/canvas-kit-styling';
|
|
7
7
|
import {base, brand, system} from '@workday/canvas-tokens-web';
|
|
8
8
|
import {Button, ButtonProps} from './Button';
|
|
9
9
|
|
|
@@ -21,62 +21,62 @@ export interface PrimaryButtonProps extends ButtonProps {
|
|
|
21
21
|
|
|
22
22
|
const primaryStyles = createStyles({
|
|
23
23
|
// Default Styles
|
|
24
|
-
[buttonVars.default.background]:
|
|
24
|
+
[buttonVars.default.background]: brand.primary.base,
|
|
25
25
|
[buttonVars.default.border]: 'transparent',
|
|
26
|
-
[buttonVars.default.borderRadius]:
|
|
27
|
-
[buttonVars.default.label]:
|
|
28
|
-
[buttonVars.default.icon]:
|
|
26
|
+
[buttonVars.default.borderRadius]: system.shape.round,
|
|
27
|
+
[buttonVars.default.label]: brand.primary.accent,
|
|
28
|
+
[buttonVars.default.icon]: brand.primary.accent,
|
|
29
29
|
// Hover Styles
|
|
30
|
-
[buttonVars.hover.background]:
|
|
30
|
+
[buttonVars.hover.background]: brand.primary.dark,
|
|
31
31
|
[buttonVars.hover.border]: 'transparent',
|
|
32
|
-
[buttonVars.hover.label]:
|
|
33
|
-
[buttonVars.hover.icon]:
|
|
32
|
+
[buttonVars.hover.label]: brand.primary.accent,
|
|
33
|
+
[buttonVars.hover.icon]: brand.primary.accent,
|
|
34
34
|
// Focus Styles
|
|
35
|
-
[buttonVars.focus.background]:
|
|
35
|
+
[buttonVars.focus.background]: brand.primary.base,
|
|
36
36
|
[buttonVars.focus.border]: 'transparent',
|
|
37
|
-
[buttonVars.focus.label]:
|
|
38
|
-
[buttonVars.focus.icon]:
|
|
39
|
-
[buttonVars.focus.boxShadowInner]:
|
|
40
|
-
[buttonVars.focus.boxShadowOuter]:
|
|
37
|
+
[buttonVars.focus.label]: brand.primary.accent,
|
|
38
|
+
[buttonVars.focus.icon]: brand.primary.accent,
|
|
39
|
+
[buttonVars.focus.boxShadowInner]: base.frenchVanilla100,
|
|
40
|
+
[buttonVars.focus.boxShadowOuter]: brand.common.focusOutline,
|
|
41
41
|
// Active Styles
|
|
42
|
-
[buttonVars.active.background]:
|
|
42
|
+
[buttonVars.active.background]: brand.primary.darkest,
|
|
43
43
|
[buttonVars.active.border]: 'transparent',
|
|
44
|
-
[buttonVars.active.label]:
|
|
45
|
-
[buttonVars.active.icon]:
|
|
44
|
+
[buttonVars.active.label]: brand.primary.accent,
|
|
45
|
+
[buttonVars.active.icon]: brand.primary.accent,
|
|
46
46
|
// Disabled Styles
|
|
47
|
-
[buttonVars.disabled.background]:
|
|
47
|
+
[buttonVars.disabled.background]: brand.primary.base,
|
|
48
48
|
[buttonVars.disabled.border]: 'transparent',
|
|
49
|
-
[buttonVars.disabled.label]:
|
|
49
|
+
[buttonVars.disabled.label]: brand.primary.accent,
|
|
50
50
|
[buttonVars.disabled.opacity]: '0.4',
|
|
51
|
-
[buttonVars.disabled.icon]:
|
|
51
|
+
[buttonVars.disabled.icon]: brand.primary.accent,
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
export const primaryButtonModifiers = createModifiers({
|
|
55
55
|
variant: {
|
|
56
56
|
inverse: createStyles({
|
|
57
57
|
// Default Styles
|
|
58
|
-
[buttonVars.default.background]:
|
|
59
|
-
[buttonVars.default.borderRadius]:
|
|
60
|
-
[buttonVars.default.label]:
|
|
61
|
-
[buttonVars.default.icon]:
|
|
58
|
+
[buttonVars.default.background]: base.frenchVanilla100,
|
|
59
|
+
[buttonVars.default.borderRadius]: system.shape.round,
|
|
60
|
+
[buttonVars.default.label]: base.blackPepper400,
|
|
61
|
+
[buttonVars.default.icon]: base.blackPepper400,
|
|
62
62
|
// Hover Styles
|
|
63
|
-
[buttonVars.hover.background]:
|
|
64
|
-
[buttonVars.hover.label]:
|
|
65
|
-
[buttonVars.hover.icon]:
|
|
63
|
+
[buttonVars.hover.background]: base.soap300,
|
|
64
|
+
[buttonVars.hover.label]: base.blackPepper500,
|
|
65
|
+
[buttonVars.hover.icon]: base.blackPepper500,
|
|
66
66
|
// Focus Styles
|
|
67
|
-
[buttonVars.focus.background]:
|
|
68
|
-
[buttonVars.focus.label]:
|
|
69
|
-
[buttonVars.focus.icon]:
|
|
70
|
-
[buttonVars.focus.boxShadowInner]:
|
|
71
|
-
[buttonVars.focus.boxShadowOuter]:
|
|
67
|
+
[buttonVars.focus.background]: base.frenchVanilla100,
|
|
68
|
+
[buttonVars.focus.label]: base.blackPepper400,
|
|
69
|
+
[buttonVars.focus.icon]: base.blackPepper400,
|
|
70
|
+
[buttonVars.focus.boxShadowInner]: base.blackPepper400,
|
|
71
|
+
[buttonVars.focus.boxShadowOuter]: base.frenchVanilla100,
|
|
72
72
|
// Active Styles
|
|
73
|
-
[buttonVars.active.background]:
|
|
74
|
-
[buttonVars.active.label]:
|
|
75
|
-
[buttonVars.active.icon]:
|
|
73
|
+
[buttonVars.active.background]: base.soap400,
|
|
74
|
+
[buttonVars.active.label]: base.blackPepper500,
|
|
75
|
+
[buttonVars.active.icon]: base.blackPepper500,
|
|
76
76
|
// Disabled Styles
|
|
77
|
-
[buttonVars.disabled.background]:
|
|
78
|
-
[buttonVars.disabled.label]:
|
|
79
|
-
[buttonVars.disabled.icon]:
|
|
77
|
+
[buttonVars.disabled.background]: base.frenchVanilla100,
|
|
78
|
+
[buttonVars.disabled.label]: base.blackPepper400,
|
|
79
|
+
[buttonVars.disabled.icon]: base.blackPepper400,
|
|
80
80
|
}),
|
|
81
81
|
},
|
|
82
82
|
});
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import {buttonVars} from './BaseButton';
|
|
4
4
|
import {createComponent} from '@workday/canvas-kit-react/common';
|
|
5
5
|
import {mergeStyles} from '@workday/canvas-kit-react/layout';
|
|
6
|
-
import {createStyles,
|
|
6
|
+
import {createStyles, createModifiers} from '@workday/canvas-kit-styling';
|
|
7
7
|
import {base, brand, system} from '@workday/canvas-tokens-web';
|
|
8
8
|
import {Button, ButtonProps} from './Button';
|
|
9
9
|
|
|
@@ -22,33 +22,33 @@ export interface SecondaryButtonProps extends ButtonProps {
|
|
|
22
22
|
const secondaryStyles = createStyles({
|
|
23
23
|
// Default Styles
|
|
24
24
|
[buttonVars.default.background]: 'transparent',
|
|
25
|
-
[buttonVars.default.border]:
|
|
26
|
-
[buttonVars.default.borderRadius]:
|
|
27
|
-
[buttonVars.default.label]:
|
|
28
|
-
[buttonVars.default.icon]:
|
|
25
|
+
[buttonVars.default.border]: base.blackPepper400,
|
|
26
|
+
[buttonVars.default.borderRadius]: system.shape.round,
|
|
27
|
+
[buttonVars.default.label]: base.blackPepper400,
|
|
28
|
+
[buttonVars.default.icon]: base.blackPepper400,
|
|
29
29
|
// Hover Styles
|
|
30
|
-
[buttonVars.hover.background]:
|
|
31
|
-
[buttonVars.hover.border]:
|
|
32
|
-
[buttonVars.hover.label]:
|
|
33
|
-
[buttonVars.hover.icon]:
|
|
30
|
+
[buttonVars.hover.background]: base.blackPepper400,
|
|
31
|
+
[buttonVars.hover.border]: base.blackPepper400,
|
|
32
|
+
[buttonVars.hover.label]: brand.primary.accent,
|
|
33
|
+
[buttonVars.hover.icon]: brand.primary.accent,
|
|
34
34
|
// Focus Styles
|
|
35
35
|
[buttonVars.focus.background]: 'transparent',
|
|
36
|
-
[buttonVars.focus.border]:
|
|
37
|
-
[buttonVars.focus.label]:
|
|
38
|
-
[buttonVars.focus.icon]:
|
|
39
|
-
[buttonVars.focus.boxShadowInner]:
|
|
40
|
-
[buttonVars.focus.boxShadowOuter]:
|
|
36
|
+
[buttonVars.focus.border]: base.blackPepper400,
|
|
37
|
+
[buttonVars.focus.label]: base.blackPepper400,
|
|
38
|
+
[buttonVars.focus.icon]: base.blackPepper400,
|
|
39
|
+
[buttonVars.focus.boxShadowInner]: base.frenchVanilla100,
|
|
40
|
+
[buttonVars.focus.boxShadowOuter]: brand.common.focusOutline,
|
|
41
41
|
// Active Styles
|
|
42
|
-
[buttonVars.active.background]:
|
|
43
|
-
[buttonVars.active.border]:
|
|
44
|
-
[buttonVars.active.label]:
|
|
45
|
-
[buttonVars.active.icon]:
|
|
42
|
+
[buttonVars.active.background]: base.blackPepper500,
|
|
43
|
+
[buttonVars.active.border]: base.blackPepper500,
|
|
44
|
+
[buttonVars.active.label]: brand.primary.accent,
|
|
45
|
+
[buttonVars.active.icon]: brand.primary.accent,
|
|
46
46
|
// Disabled Styles
|
|
47
47
|
[buttonVars.disabled.background]: 'transparent',
|
|
48
|
-
[buttonVars.disabled.border]:
|
|
49
|
-
[buttonVars.disabled.label]:
|
|
48
|
+
[buttonVars.disabled.border]: base.blackPepper400,
|
|
49
|
+
[buttonVars.disabled.label]: base.blackPepper400,
|
|
50
50
|
[buttonVars.disabled.opacity]: '0.4',
|
|
51
|
-
[buttonVars.disabled.icon]:
|
|
51
|
+
[buttonVars.disabled.icon]: base.blackPepper400,
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
export const secondaryButtonModifiers = createModifiers({
|
|
@@ -56,31 +56,31 @@ export const secondaryButtonModifiers = createModifiers({
|
|
|
56
56
|
inverse: createStyles({
|
|
57
57
|
// Default Styles
|
|
58
58
|
[buttonVars.default.background]: 'transparent',
|
|
59
|
-
[buttonVars.default.border]:
|
|
60
|
-
[buttonVars.default.label]:
|
|
61
|
-
[buttonVars.default.icon]:
|
|
59
|
+
[buttonVars.default.border]: base.frenchVanilla100,
|
|
60
|
+
[buttonVars.default.label]: base.frenchVanilla100,
|
|
61
|
+
[buttonVars.default.icon]: base.frenchVanilla100,
|
|
62
62
|
// Hover Styles
|
|
63
|
-
[buttonVars.hover.background]:
|
|
64
|
-
[buttonVars.hover.border]:
|
|
65
|
-
[buttonVars.hover.label]:
|
|
66
|
-
[buttonVars.hover.icon]:
|
|
63
|
+
[buttonVars.hover.background]: base.soap300,
|
|
64
|
+
[buttonVars.hover.border]: base.soap300,
|
|
65
|
+
[buttonVars.hover.label]: base.blackPepper500,
|
|
66
|
+
[buttonVars.hover.icon]: base.blackPepper500,
|
|
67
67
|
// Focus Styles
|
|
68
|
-
[buttonVars.focus.background]:
|
|
69
|
-
[buttonVars.focus.border]:
|
|
70
|
-
[buttonVars.focus.label]:
|
|
71
|
-
[buttonVars.focus.icon]:
|
|
72
|
-
[buttonVars.focus.boxShadowInner]:
|
|
73
|
-
[buttonVars.focus.boxShadowOuter]:
|
|
68
|
+
[buttonVars.focus.background]: base.frenchVanilla100,
|
|
69
|
+
[buttonVars.focus.border]: base.frenchVanilla100,
|
|
70
|
+
[buttonVars.focus.label]: base.blackPepper500,
|
|
71
|
+
[buttonVars.focus.icon]: base.blackPepper500,
|
|
72
|
+
[buttonVars.focus.boxShadowInner]: base.blackPepper500,
|
|
73
|
+
[buttonVars.focus.boxShadowOuter]: base.frenchVanilla100,
|
|
74
74
|
// Active Styles
|
|
75
|
-
[buttonVars.active.background]:
|
|
76
|
-
[buttonVars.active.border]:
|
|
77
|
-
[buttonVars.active.label]:
|
|
78
|
-
[buttonVars.active.icon]:
|
|
75
|
+
[buttonVars.active.background]: base.soap400,
|
|
76
|
+
[buttonVars.active.border]: base.soap400,
|
|
77
|
+
[buttonVars.active.label]: base.blackPepper500,
|
|
78
|
+
[buttonVars.active.icon]: base.blackPepper500,
|
|
79
79
|
// Disabled Styles
|
|
80
80
|
[buttonVars.disabled.background]: 'transparent',
|
|
81
|
-
[buttonVars.disabled.border]:
|
|
82
|
-
[buttonVars.disabled.label]:
|
|
83
|
-
[buttonVars.disabled.icon]:
|
|
81
|
+
[buttonVars.disabled.border]: base.frenchVanilla100,
|
|
82
|
+
[buttonVars.disabled.label]: base.frenchVanilla100,
|
|
83
|
+
[buttonVars.disabled.icon]: base.frenchVanilla100,
|
|
84
84
|
}),
|
|
85
85
|
},
|
|
86
86
|
});
|