@workday/canvas-kit-react 10.0.0-alpha.446-next.0 → 10.0.0-alpha.447-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/lib/BaseButton.tsx +4 -4
- package/checkbox/lib/Checkbox.tsx +18 -12
- package/dist/commonjs/button/lib/BaseButton.d.ts +1 -1
- package/dist/commonjs/button/lib/BaseButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/BaseButton.js +4 -4
- package/dist/commonjs/checkbox/lib/Checkbox.d.ts.map +1 -1
- package/dist/commonjs/checkbox/lib/Checkbox.js +11 -11
- package/dist/commonjs/radio/lib/Radio.d.ts.map +1 -1
- package/dist/commonjs/radio/lib/Radio.js +13 -13
- package/dist/commonjs/select/lib/Select.d.ts.map +1 -1
- package/dist/commonjs/select/lib/Select.js +1 -1
- package/dist/commonjs/table/lib/TableRow.js +1 -1
- package/dist/commonjs/text-area/lib/TextArea.d.ts.map +1 -1
- package/dist/commonjs/text-area/lib/TextArea.js +3 -3
- package/dist/commonjs/text-input/lib/TextInput.js +1 -1
- package/dist/commonjs/tokens/index.d.ts.map +1 -1
- package/dist/commonjs/tokens/lib/depth.d.ts +6 -6
- package/dist/commonjs/tokens/lib/depth.d.ts.map +1 -1
- package/dist/commonjs/tokens/lib/depth.js +6 -6
- package/dist/commonjs/tokens/lib/space.d.ts +65 -27
- package/dist/commonjs/tokens/lib/space.d.ts.map +1 -1
- package/dist/commonjs/tokens/lib/space.js +61 -23
- package/dist/commonjs/tooltip/lib/TooltipContainer.js +8 -8
- package/dist/es6/button/lib/BaseButton.d.ts +1 -1
- package/dist/es6/button/lib/BaseButton.d.ts.map +1 -1
- package/dist/es6/button/lib/BaseButton.js +4 -4
- package/dist/es6/checkbox/lib/Checkbox.d.ts.map +1 -1
- package/dist/es6/checkbox/lib/Checkbox.js +12 -12
- package/dist/es6/radio/lib/Radio.d.ts.map +1 -1
- package/dist/es6/radio/lib/Radio.js +14 -14
- package/dist/es6/select/lib/Select.d.ts.map +1 -1
- package/dist/es6/select/lib/Select.js +2 -2
- package/dist/es6/table/lib/TableRow.js +1 -1
- package/dist/es6/text-area/lib/TextArea.d.ts.map +1 -1
- package/dist/es6/text-area/lib/TextArea.js +4 -4
- package/dist/es6/text-input/lib/TextInput.js +1 -1
- package/dist/es6/tokens/index.d.ts.map +1 -1
- package/dist/es6/tokens/index.js +1 -1
- package/dist/es6/tokens/lib/depth.d.ts +6 -6
- package/dist/es6/tokens/lib/depth.d.ts.map +1 -1
- package/dist/es6/tokens/lib/depth.js +6 -6
- package/dist/es6/tokens/lib/space.d.ts +65 -27
- package/dist/es6/tokens/lib/space.d.ts.map +1 -1
- package/dist/es6/tokens/lib/space.js +61 -23
- package/dist/es6/tooltip/lib/TooltipContainer.js +8 -8
- package/package.json +3 -3
- package/radio/lib/Radio.tsx +20 -14
- package/select/lib/Select.tsx +2 -9
- package/table/lib/TableRow.tsx +1 -1
- package/text-area/lib/TextArea.tsx +10 -4
- package/text-input/lib/TextInput.tsx +1 -1
- package/tokens/README.md +19 -19
- package/tokens/index.ts +1 -2
- package/tokens/lib/depth.ts +16 -12
- package/tokens/lib/space.ts +84 -46
- package/tooltip/lib/TooltipContainer.tsx +8 -8
|
@@ -1,44 +1,82 @@
|
|
|
1
1
|
declare type ValueOf<T> = T[keyof T];
|
|
2
|
-
/** Type for the `space` object with keys and
|
|
2
|
+
/** Type for the `space` object with keys and rem values (strings) */
|
|
3
3
|
export declare type CanvasSpace = {
|
|
4
|
-
zero: '
|
|
5
|
-
xxxs: '
|
|
6
|
-
xxs: '
|
|
7
|
-
xs: '
|
|
8
|
-
s: '
|
|
9
|
-
m: '
|
|
10
|
-
l: '
|
|
11
|
-
xl: '
|
|
12
|
-
xxl: '
|
|
13
|
-
xxxl: '
|
|
4
|
+
zero: '0';
|
|
5
|
+
xxxs: '0.25rem';
|
|
6
|
+
xxs: '0.5rem';
|
|
7
|
+
xs: '0.75rem';
|
|
8
|
+
s: '1rem';
|
|
9
|
+
m: '1.5rem';
|
|
10
|
+
l: '2rem';
|
|
11
|
+
xl: '2.5rem';
|
|
12
|
+
xxl: '4rem';
|
|
13
|
+
xxxl: '5rem';
|
|
14
14
|
};
|
|
15
15
|
/** Type for `CanvasSpace` keys */
|
|
16
16
|
export declare type CanvasSpaceKeys = keyof CanvasSpace;
|
|
17
|
-
/** The
|
|
17
|
+
/** The rem values for CanvasSpace (strings) */
|
|
18
18
|
export declare type CanvasSpaceValues = ValueOf<CanvasSpace>;
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* An object of space keys and rem values (strings)
|
|
21
|
+
*
|
|
22
|
+
* Below is a table to show the equivalent values from `px` to `rem`.
|
|
23
|
+
* This is based on the default browser font size which is `16px`.
|
|
24
|
+
*
|
|
25
|
+
* | px Value | rem Value | space token |
|
|
26
|
+
* | --------- | --------- | ----------- |
|
|
27
|
+
* | 0 | 0 | zero |
|
|
28
|
+
* | 4px | 0.25rem | xxxs |
|
|
29
|
+
* | 8px | 0.5rem | xxs |
|
|
30
|
+
* | 12px | 0.75rem | xs |
|
|
31
|
+
* | 16px | 1rem | s |
|
|
32
|
+
* | 24px | 1.5rem | m |
|
|
33
|
+
* | 32px | 2rem | l |
|
|
34
|
+
* | 40px | 2.5rem | xl |
|
|
35
|
+
* | 64px | 4rem | xxl |
|
|
36
|
+
* | 80px | 5rem | xxxl |
|
|
37
|
+
*
|
|
38
|
+
* */
|
|
20
39
|
export declare const space: CanvasSpace;
|
|
21
|
-
/** Type for the `spaceNumbers` object with keys and numeric
|
|
40
|
+
/** Type for the `spaceNumbers` object with keys and numeric rem values (numbers) */
|
|
22
41
|
export declare type CanvasSpaceNumbers = {
|
|
23
42
|
zero: 0;
|
|
24
|
-
xxxs:
|
|
25
|
-
xxs:
|
|
26
|
-
xs:
|
|
27
|
-
s:
|
|
28
|
-
m:
|
|
29
|
-
l:
|
|
30
|
-
xl:
|
|
31
|
-
xxl:
|
|
32
|
-
xxxl:
|
|
43
|
+
xxxs: 0.25;
|
|
44
|
+
xxs: 0.5;
|
|
45
|
+
xs: 0.75;
|
|
46
|
+
s: 1;
|
|
47
|
+
m: 1.5;
|
|
48
|
+
l: 2;
|
|
49
|
+
xl: 2.5;
|
|
50
|
+
xxl: 4;
|
|
51
|
+
xxxl: 5;
|
|
33
52
|
};
|
|
34
|
-
/** The numeric
|
|
53
|
+
/** The numeric rem values for CanvasSpaceNumbers (numbers) */
|
|
35
54
|
export declare type CanvasSpaceNumberValues = ValueOf<CanvasSpaceNumbers>;
|
|
36
55
|
/**
|
|
37
|
-
* An object of space keys and their numeric
|
|
38
|
-
* - These are helpful when you need a raw numeric
|
|
56
|
+
* An object of space keys and their numeric rem values (numbers)
|
|
57
|
+
* - These are helpful when you need a raw numeric rem value.
|
|
39
58
|
* - Here's an example usage to perform calculations:
|
|
40
59
|
* @example
|
|
41
|
-
*
|
|
60
|
+
* ```tsx
|
|
61
|
+
* const buttonPaddingLeft = `${spaceNumbers.s + iconSize}rem`;
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* Below is a table to show the equivalent values from `px` to `rem`.
|
|
65
|
+
* This is based on the default browser font size which is `16px`.
|
|
66
|
+
*
|
|
67
|
+
* | px Value | rem Value | space token |
|
|
68
|
+
* | --------- | --------- | ----------- |
|
|
69
|
+
* | 0 | 0 | zero |
|
|
70
|
+
* | 4px | 0.25rem | xxxs |
|
|
71
|
+
* | 8px | 0.5rem | xxs |
|
|
72
|
+
* | 12px | 0.75rem | xs |
|
|
73
|
+
* | 16px | 1rem | s |
|
|
74
|
+
* | 24px | 1.5rem | m |
|
|
75
|
+
* | 32px | 2rem | l |
|
|
76
|
+
* | 40px | 2.5rem | xl |
|
|
77
|
+
* | 64px | 4rem | xxl |
|
|
78
|
+
* | 80px | 5rem | xxxl |
|
|
79
|
+
*
|
|
42
80
|
*/
|
|
43
81
|
export declare const spaceNumbers: CanvasSpaceNumbers;
|
|
44
82
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../../../../tokens/lib/space.ts"],"names":[],"mappings":"AAAA,aAAK,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAO7B,
|
|
1
|
+
{"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../../../../tokens/lib/space.ts"],"names":[],"mappings":"AAAA,aAAK,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAO7B,qEAAqE;AACrE,oBAAY,WAAW,GAAG;IACxB,IAAI,EAAE,GAAG,CAAC;IACV,IAAI,EAAE,SAAS,CAAC;IAChB,GAAG,EAAE,QAAQ,CAAC;IACd,EAAE,EAAE,SAAS,CAAC;IACd,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,QAAQ,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC;IACV,EAAE,EAAE,QAAQ,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,kCAAkC;AAClC,oBAAY,eAAe,GAAG,MAAM,WAAW,CAAC;AAEhD,+CAA+C;AAC/C,oBAAY,iBAAiB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAErD;;;;;;;;;;;;;;;;;;;KAmBK;AACL,eAAO,MAAM,KAAK,EAAE,WAWnB,CAAC;AAEF,oFAAoF;AACpF,oBAAY,kBAAkB,GAAG;IAC/B,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,EAAE,IAAI,CAAC;IACX,GAAG,EAAE,GAAG,CAAC;IACT,EAAE,EAAE,IAAI,CAAC;IACT,CAAC,EAAE,CAAC,CAAC;IACL,CAAC,EAAE,GAAG,CAAC;IACP,CAAC,EAAE,CAAC,CAAC;IACL,EAAE,EAAE,GAAG,CAAC;IACR,GAAG,EAAE,CAAC,CAAC;IACP,IAAI,EAAE,CAAC,CAAC;CACT,CAAC;AAEF,8DAA8D;AAC9D,oBAAY,uBAAuB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,YAAY,EAAE,kBAW1B,CAAC"}
|
|
@@ -1,32 +1,70 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* An object of space keys and rem values (strings)
|
|
3
|
+
*
|
|
4
|
+
* Below is a table to show the equivalent values from `px` to `rem`.
|
|
5
|
+
* This is based on the default browser font size which is `16px`.
|
|
6
|
+
*
|
|
7
|
+
* | px Value | rem Value | space token |
|
|
8
|
+
* | --------- | --------- | ----------- |
|
|
9
|
+
* | 0 | 0 | zero |
|
|
10
|
+
* | 4px | 0.25rem | xxxs |
|
|
11
|
+
* | 8px | 0.5rem | xxs |
|
|
12
|
+
* | 12px | 0.75rem | xs |
|
|
13
|
+
* | 16px | 1rem | s |
|
|
14
|
+
* | 24px | 1.5rem | m |
|
|
15
|
+
* | 32px | 2rem | l |
|
|
16
|
+
* | 40px | 2.5rem | xl |
|
|
17
|
+
* | 64px | 4rem | xxl |
|
|
18
|
+
* | 80px | 5rem | xxxl |
|
|
19
|
+
*
|
|
20
|
+
* */
|
|
2
21
|
export const space = {
|
|
3
|
-
zero: '
|
|
4
|
-
xxxs: '
|
|
5
|
-
xxs: '
|
|
6
|
-
xs: '
|
|
7
|
-
s: '
|
|
8
|
-
m: '
|
|
9
|
-
l: '
|
|
10
|
-
xl: '
|
|
11
|
-
xxl: '
|
|
12
|
-
xxxl: '
|
|
22
|
+
zero: '0',
|
|
23
|
+
xxxs: '0.25rem',
|
|
24
|
+
xxs: '0.5rem',
|
|
25
|
+
xs: '0.75rem',
|
|
26
|
+
s: '1rem',
|
|
27
|
+
m: '1.5rem',
|
|
28
|
+
l: '2rem',
|
|
29
|
+
xl: '2.5rem',
|
|
30
|
+
xxl: '4rem',
|
|
31
|
+
xxxl: '5rem',
|
|
13
32
|
};
|
|
14
33
|
/**
|
|
15
|
-
* An object of space keys and their numeric
|
|
16
|
-
* - These are helpful when you need a raw numeric
|
|
34
|
+
* An object of space keys and their numeric rem values (numbers)
|
|
35
|
+
* - These are helpful when you need a raw numeric rem value.
|
|
17
36
|
* - Here's an example usage to perform calculations:
|
|
18
37
|
* @example
|
|
19
|
-
*
|
|
38
|
+
* ```tsx
|
|
39
|
+
* const buttonPaddingLeft = `${spaceNumbers.s + iconSize}rem`;
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* Below is a table to show the equivalent values from `px` to `rem`.
|
|
43
|
+
* This is based on the default browser font size which is `16px`.
|
|
44
|
+
*
|
|
45
|
+
* | px Value | rem Value | space token |
|
|
46
|
+
* | --------- | --------- | ----------- |
|
|
47
|
+
* | 0 | 0 | zero |
|
|
48
|
+
* | 4px | 0.25rem | xxxs |
|
|
49
|
+
* | 8px | 0.5rem | xxs |
|
|
50
|
+
* | 12px | 0.75rem | xs |
|
|
51
|
+
* | 16px | 1rem | s |
|
|
52
|
+
* | 24px | 1.5rem | m |
|
|
53
|
+
* | 32px | 2rem | l |
|
|
54
|
+
* | 40px | 2.5rem | xl |
|
|
55
|
+
* | 64px | 4rem | xxl |
|
|
56
|
+
* | 80px | 5rem | xxxl |
|
|
57
|
+
*
|
|
20
58
|
*/
|
|
21
59
|
export const spaceNumbers = {
|
|
22
60
|
zero: 0,
|
|
23
|
-
xxxs:
|
|
24
|
-
xxs:
|
|
25
|
-
xs:
|
|
26
|
-
s:
|
|
27
|
-
m:
|
|
28
|
-
l:
|
|
29
|
-
xl:
|
|
30
|
-
xxl:
|
|
31
|
-
xxxl:
|
|
61
|
+
xxxs: 0.25,
|
|
62
|
+
xxs: 0.5,
|
|
63
|
+
xs: 0.75,
|
|
64
|
+
s: 1,
|
|
65
|
+
m: 1.5,
|
|
66
|
+
l: 2,
|
|
67
|
+
xl: 2.5,
|
|
68
|
+
xxl: 4,
|
|
69
|
+
xxxl: 5,
|
|
32
70
|
};
|
|
@@ -23,7 +23,7 @@ export const TooltipContainer = styled('div')({
|
|
|
23
23
|
...type.levels.subtext.medium,
|
|
24
24
|
display: 'inline-flex',
|
|
25
25
|
position: 'relative',
|
|
26
|
-
padding:
|
|
26
|
+
padding: space.xs,
|
|
27
27
|
color: colors.frenchVanilla100,
|
|
28
28
|
a: {
|
|
29
29
|
color: colors.frenchVanilla100,
|
|
@@ -34,7 +34,7 @@ export const TooltipContainer = styled('div')({
|
|
|
34
34
|
content: '""',
|
|
35
35
|
borderRadius: borderRadius.m,
|
|
36
36
|
zIndex: -1,
|
|
37
|
-
margin:
|
|
37
|
+
margin: space.xxxs,
|
|
38
38
|
backgroundColor: 'rgba(0,0,0,.85)',
|
|
39
39
|
position: 'absolute',
|
|
40
40
|
top: 0,
|
|
@@ -44,9 +44,9 @@ export const TooltipContainer = styled('div')({
|
|
|
44
44
|
},
|
|
45
45
|
// offset tooltips by 2 pixels when a keyboard focus ring is detected
|
|
46
46
|
'[data-whatinput=keyboard] &': {
|
|
47
|
-
padding: spaceNumbers.
|
|
47
|
+
padding: `${spaceNumbers.s - 0.125}rem`,
|
|
48
48
|
':before': {
|
|
49
|
-
margin: spaceNumbers.xxxs +
|
|
49
|
+
margin: `${spaceNumbers.xxxs + 0.125}rem`,
|
|
50
50
|
},
|
|
51
51
|
},
|
|
52
52
|
// Hide tooltip when the reference element is either clipped or fully hidden
|
|
@@ -56,16 +56,16 @@ export const TooltipContainer = styled('div')({
|
|
|
56
56
|
},
|
|
57
57
|
// Fix offsets based on placement
|
|
58
58
|
'[data-popper-placement="top-start"] &, [data-popper-placement="bottom-start"] &': {
|
|
59
|
-
left:
|
|
59
|
+
left: `-${space.xxxs}`,
|
|
60
60
|
},
|
|
61
61
|
'[data-popper-placement="top-end"] &, [data-popper-placement="bottom-end"] &': {
|
|
62
|
-
right:
|
|
62
|
+
right: `-${space.xxxs}`,
|
|
63
63
|
},
|
|
64
64
|
'[data-popper-placement="left-start"] &, [data-popper-placement="right-start"] &': {
|
|
65
|
-
top:
|
|
65
|
+
top: `-${space.xxxs}`,
|
|
66
66
|
},
|
|
67
67
|
'[data-popper-placement="left-end"] &, [data-popper-placement="right-end"] &': {
|
|
68
|
-
bottom:
|
|
68
|
+
bottom: `-${space.xxxs}`,
|
|
69
69
|
},
|
|
70
70
|
}, ({ transformOrigin = defaultTransformOrigin }) => {
|
|
71
71
|
if (transformOrigin === null) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-react",
|
|
3
|
-
"version": "10.0.0-alpha.
|
|
3
|
+
"version": "10.0.0-alpha.447-next.0",
|
|
4
4
|
"description": "The parent module that contains all Workday Canvas Kit React components",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@emotion/styled": "^11.6.0",
|
|
50
50
|
"@popperjs/core": "^2.5.4",
|
|
51
51
|
"@workday/canvas-colors-web": "^2.0.0",
|
|
52
|
-
"@workday/canvas-kit-popup-stack": "^10.0.0-alpha.
|
|
52
|
+
"@workday/canvas-kit-popup-stack": "^10.0.0-alpha.447-next.0",
|
|
53
53
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
54
54
|
"@workday/design-assets-types": "^0.2.8",
|
|
55
55
|
"chroma-js": "^2.1.0",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"@workday/canvas-accent-icons-web": "^3.0.0",
|
|
67
67
|
"@workday/canvas-applet-icons-web": "^2.0.0"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "7fc0c577c5f944eabe967840a78fc77f781833ce"
|
|
70
70
|
}
|
package/radio/lib/Radio.tsx
CHANGED
|
@@ -8,7 +8,13 @@ import {
|
|
|
8
8
|
Themeable,
|
|
9
9
|
useUniqueId,
|
|
10
10
|
} from '@workday/canvas-kit-react/common';
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
borderRadius,
|
|
13
|
+
colors,
|
|
14
|
+
inputColors,
|
|
15
|
+
space,
|
|
16
|
+
spaceNumbers,
|
|
17
|
+
} from '@workday/canvas-kit-react/tokens';
|
|
12
18
|
import {LabelText} from '@workday/canvas-kit-react/text';
|
|
13
19
|
|
|
14
20
|
export interface RadioProps extends Themeable {
|
|
@@ -47,13 +53,13 @@ export interface RadioProps extends Themeable {
|
|
|
47
53
|
variant?: 'inverse' | undefined;
|
|
48
54
|
}
|
|
49
55
|
|
|
50
|
-
const radioBorderRadius =
|
|
51
|
-
const radioDot =
|
|
52
|
-
const radioHeight =
|
|
53
|
-
const radioTapArea =
|
|
56
|
+
const radioBorderRadius = `${spaceNumbers.xxs + 0.0625}rem`;
|
|
57
|
+
const radioDot = space.xxs;
|
|
58
|
+
const radioHeight = (spaceNumbers.xl - spaceNumbers.xxxs) / 2;
|
|
59
|
+
const radioTapArea = space.m;
|
|
54
60
|
const radioContainerHeight = radioTapArea;
|
|
55
|
-
const radioLabelDistance =
|
|
56
|
-
const radioWidth =
|
|
61
|
+
const radioLabelDistance = space.xs;
|
|
62
|
+
const radioWidth = radioHeight;
|
|
57
63
|
const rippleRadius = (spaceNumbers.l - radioWidth) / 2;
|
|
58
64
|
|
|
59
65
|
const RadioContainer = styled('div')({
|
|
@@ -70,17 +76,17 @@ const RadioContainer = styled('div')({
|
|
|
70
76
|
*/
|
|
71
77
|
const RadioInputWrapper = styled('div')<Pick<RadioProps, 'disabled'>>({
|
|
72
78
|
display: 'flex',
|
|
73
|
-
height: radioHeight
|
|
74
|
-
width: radioWidth
|
|
79
|
+
height: `${radioHeight}rem`,
|
|
80
|
+
width: `${radioWidth}rem`,
|
|
75
81
|
});
|
|
76
82
|
|
|
77
83
|
const RadioRipple = styled('span')<Pick<RadioProps, 'disabled' | 'variant'>>(
|
|
78
84
|
{
|
|
79
85
|
borderRadius: borderRadius.circle,
|
|
80
86
|
boxShadow: `0 0 0 0 ${colors.soap200}`,
|
|
81
|
-
height: radioHeight
|
|
87
|
+
height: `${radioHeight}rem`,
|
|
82
88
|
transition: 'box-shadow 150ms ease-out',
|
|
83
|
-
width: radioWidth
|
|
89
|
+
width: `${radioWidth}rem`,
|
|
84
90
|
position: 'absolute',
|
|
85
91
|
pointerEvents: 'none', // This is a decorative element we don't want it to block clicks to input
|
|
86
92
|
},
|
|
@@ -129,7 +135,7 @@ const RadioInput = styled('input')<RadioProps & StyledType>(
|
|
|
129
135
|
// `span:first-of-type` refers to `RadioRipple`, the light grey
|
|
130
136
|
// element that animates around the component on hover
|
|
131
137
|
'&:hover ~ span:first-of-type': {
|
|
132
|
-
boxShadow: disabled ? undefined : `0 0 0 ${rippleRadius}
|
|
138
|
+
boxShadow: disabled ? undefined : `0 0 0 ${rippleRadius}rem ${colors.soap200}`,
|
|
133
139
|
},
|
|
134
140
|
|
|
135
141
|
// `div:first-of-type` refers to the `RadioBackground`, the visual facade of the
|
|
@@ -212,13 +218,13 @@ const RadioBackground = styled('div')<RadioProps>(
|
|
|
212
218
|
borderWidth: '1px',
|
|
213
219
|
boxSizing: 'border-box',
|
|
214
220
|
display: 'flex',
|
|
215
|
-
height: radioHeight
|
|
221
|
+
height: `${radioHeight}rem`,
|
|
216
222
|
justifyContent: 'center',
|
|
217
223
|
padding: '0px 2px',
|
|
218
224
|
pointerEvents: 'none',
|
|
219
225
|
position: 'absolute',
|
|
220
226
|
transition: 'border 200ms ease, background 200ms',
|
|
221
|
-
width: radioWidth
|
|
227
|
+
width: `${radioWidth}rem`,
|
|
222
228
|
},
|
|
223
229
|
({
|
|
224
230
|
checked,
|
package/select/lib/Select.tsx
CHANGED
|
@@ -8,14 +8,7 @@ import {
|
|
|
8
8
|
styled,
|
|
9
9
|
Themeable,
|
|
10
10
|
} from '@workday/canvas-kit-react/common';
|
|
11
|
-
import {
|
|
12
|
-
colors,
|
|
13
|
-
borderRadius,
|
|
14
|
-
inputColors,
|
|
15
|
-
spaceNumbers,
|
|
16
|
-
type,
|
|
17
|
-
space,
|
|
18
|
-
} from '@workday/canvas-kit-react/tokens';
|
|
11
|
+
import {colors, borderRadius, inputColors, type, space} from '@workday/canvas-kit-react/tokens';
|
|
19
12
|
import {caretDownSmallIcon} from '@workday/canvas-system-icons-web';
|
|
20
13
|
import {SystemIcon} from '@workday/canvas-kit-react/icon';
|
|
21
14
|
import {SelectOption} from './SelectOption';
|
|
@@ -55,7 +48,7 @@ const StyledSelect = styled('select')<SelectProps & StyledType>(
|
|
|
55
48
|
height: space.xl,
|
|
56
49
|
minWidth: 280,
|
|
57
50
|
transition: '0.2s box-shadow, 0.2s border-color',
|
|
58
|
-
padding:
|
|
51
|
+
padding: space.xxs,
|
|
59
52
|
margin: 0, // Fix Safari
|
|
60
53
|
MozAppearance: 'none', // FF bugfix: hide arrow so it doesn't show under ours
|
|
61
54
|
WebkitAppearance: 'none',
|
package/table/lib/TableRow.tsx
CHANGED
|
@@ -100,7 +100,7 @@ const StyledTableRow = styled('tr')<TableRowProps>(
|
|
|
100
100
|
fontSize: 13,
|
|
101
101
|
borderRight: cellBorder,
|
|
102
102
|
borderBottom: cellBorder,
|
|
103
|
-
height: spaceNumbers.xl + spaceNumbers.xxs
|
|
103
|
+
height: `${spaceNumbers.xl + spaceNumbers.xxs}rem`,
|
|
104
104
|
boxSizing: 'border-box',
|
|
105
105
|
transition: 'background-color 0.2s',
|
|
106
106
|
},
|
|
@@ -8,7 +8,13 @@ import {
|
|
|
8
8
|
styled,
|
|
9
9
|
Themeable,
|
|
10
10
|
} from '@workday/canvas-kit-react/common';
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
borderRadius,
|
|
13
|
+
inputColors,
|
|
14
|
+
space,
|
|
15
|
+
spaceNumbers,
|
|
16
|
+
type,
|
|
17
|
+
} from '@workday/canvas-kit-react/tokens';
|
|
12
18
|
|
|
13
19
|
export interface TextAreaProps extends Themeable, GrowthBehavior {
|
|
14
20
|
/**
|
|
@@ -59,10 +65,10 @@ const StyledTextArea = styled('textarea')<TextAreaProps & StyledType>(
|
|
|
59
65
|
backgroundColor: inputColors.background,
|
|
60
66
|
borderRadius: borderRadius.m,
|
|
61
67
|
boxSizing: 'border-box',
|
|
62
|
-
minHeight:
|
|
63
|
-
minWidth:
|
|
68
|
+
minHeight: space.xxl,
|
|
69
|
+
minWidth: `${spaceNumbers.xxxl * 3 + spaceNumbers.xl}rem`,
|
|
64
70
|
transition: '0.2s box-shadow, 0.2s border-color',
|
|
65
|
-
padding:
|
|
71
|
+
padding: space.xxs, // Compensate for border
|
|
66
72
|
margin: 0, // Fix Safari
|
|
67
73
|
'&::webkit-resizer': {
|
|
68
74
|
display: 'none',
|
|
@@ -33,7 +33,7 @@ const StyledTextInput = styled('input')<
|
|
|
33
33
|
boxSizing: 'border-box',
|
|
34
34
|
height: 40,
|
|
35
35
|
transition: '0.2s box-shadow, 0.2s border-color',
|
|
36
|
-
padding: spaceNumbers.xxs
|
|
36
|
+
padding: `${spaceNumbers.xxs}rem`, // Compensate for border
|
|
37
37
|
margin: 0, // Fix Safari
|
|
38
38
|
'&::placeholder': {
|
|
39
39
|
color: inputColors.placeholder,
|
package/tokens/README.md
CHANGED
|
@@ -133,42 +133,42 @@ Border Radius variables are in a "t-shirt size" format. Border Radius values are
|
|
|
133
133
|
Space variables are in a "t-shirt size" format. Space values are in `px` format (`space`) or number
|
|
134
134
|
format (`spaceNumbers`).
|
|
135
135
|
|
|
136
|
-
| Variable | Size (
|
|
137
|
-
| -------- |
|
|
138
|
-
| `xxxs` | `'
|
|
139
|
-
| `xxs` | `'
|
|
140
|
-
| `xs` | `'
|
|
141
|
-
| `s` | `'
|
|
142
|
-
| `m` | `'
|
|
143
|
-
| `l` | `'
|
|
144
|
-
| `xl` | `'
|
|
145
|
-
| `xxl` | `'
|
|
146
|
-
| `xxxl` | `'
|
|
136
|
+
| Variable | Size (rem) | Size (number) |
|
|
137
|
+
| -------- | ----------- | ------------- |
|
|
138
|
+
| `xxxs` | `'0.25rem'` | `0.25` |
|
|
139
|
+
| `xxs` | `'0.5rem'` | `0.5` |
|
|
140
|
+
| `xs` | `'0.75rem'` | `0.75` |
|
|
141
|
+
| `s` | `'1rem'` | `1` |
|
|
142
|
+
| `m` | `'1.5rem'` | `1.5` |
|
|
143
|
+
| `l` | `'2rem'` | `2` |
|
|
144
|
+
| `xl` | `'2.5rem'` | `2.5` |
|
|
145
|
+
| `xxl` | `'4rem'` | `4` |
|
|
146
|
+
| `xxxl` | `'5rem'` | `5` |
|
|
147
147
|
|
|
148
148
|
The following space types are also provided: `CanvasSpace`, `CanvasSpaceValues`,
|
|
149
149
|
`CanvasSpaceNumbers`, `CanvasSpaceNumberValues`
|
|
150
150
|
|
|
151
151
|
Below are descriptions of these types:
|
|
152
152
|
|
|
153
|
-
| Name | Description
|
|
154
|
-
| ------------------------- |
|
|
155
|
-
| `CanvasSpace` | `space` object with string
|
|
156
|
-
| `CanvasSpaceValues` | string
|
|
157
|
-
| `CanvasSpaceNumbers` | `spaceNumbers` object with numeric
|
|
158
|
-
| `CanvasSpaceNumberValues` | numeric
|
|
153
|
+
| Name | Description |
|
|
154
|
+
| ------------------------- | --------------------------------------------- |
|
|
155
|
+
| `CanvasSpace` | `space` object with string rem values |
|
|
156
|
+
| `CanvasSpaceValues` | string rem values for CanvasSpace |
|
|
157
|
+
| `CanvasSpaceNumbers` | `spaceNumbers` object with numeric rem values |
|
|
158
|
+
| `CanvasSpaceNumberValues` | numeric rem values for CanvasSpaceNumbers |
|
|
159
159
|
|
|
160
160
|
### Usage
|
|
161
161
|
|
|
162
162
|
```tsx
|
|
163
163
|
import {space, spaceNumbers} from '@workday/canvas-kit-react/tokens';
|
|
164
164
|
|
|
165
|
-
const iconSize =
|
|
165
|
+
const iconSize = 1.25;
|
|
166
166
|
|
|
167
167
|
const buttonSyles = {
|
|
168
168
|
paddingTop: space.xs,
|
|
169
169
|
paddingRight: space.s,
|
|
170
170
|
paddingBottom: space.xs,
|
|
171
|
-
paddingLeft: spaceNumbers.s + iconSize
|
|
171
|
+
paddingLeft: `${spaceNumbers.s + iconSize}rem`,
|
|
172
172
|
};
|
|
173
173
|
```
|
|
174
174
|
|
package/tokens/index.ts
CHANGED
package/tokens/lib/depth.ts
CHANGED
|
@@ -29,7 +29,7 @@ export type CanvasDepth = {
|
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
31
|
1: {
|
|
32
|
-
boxShadow: '
|
|
32
|
+
boxShadow: '0 0.0625rem 0.25rem rgba(31, 38, 46, 0.12), 0 0.125rem 0.5rem rgba(31, 38, 46, 0.08)';
|
|
33
33
|
};
|
|
34
34
|
/**
|
|
35
35
|
* ### Depth 2
|
|
@@ -45,7 +45,7 @@ export type CanvasDepth = {
|
|
|
45
45
|
* ```
|
|
46
46
|
*/
|
|
47
47
|
2: {
|
|
48
|
-
boxShadow: '
|
|
48
|
+
boxShadow: '0 0.125rem 0.5rem rgba(31, 38, 46, 0.12), 0 0.25rem 1rem rgba(31, 38, 46, 0.08)';
|
|
49
49
|
};
|
|
50
50
|
/**
|
|
51
51
|
* ### Depth 3
|
|
@@ -61,7 +61,7 @@ export type CanvasDepth = {
|
|
|
61
61
|
* ```
|
|
62
62
|
*/
|
|
63
63
|
3: {
|
|
64
|
-
boxShadow: '
|
|
64
|
+
boxShadow: '0 0.1875rem 0.75rem rgba(31, 38, 46, 0.12), 0 0.375rem 1.5rem rgba(31, 38, 46, 0.08)';
|
|
65
65
|
};
|
|
66
66
|
/**
|
|
67
67
|
* ### Depth 4
|
|
@@ -76,7 +76,7 @@ export type CanvasDepth = {
|
|
|
76
76
|
* ```
|
|
77
77
|
*/
|
|
78
78
|
4: {
|
|
79
|
-
boxShadow: '
|
|
79
|
+
boxShadow: '0 0.25rem 1rem rgba(31, 38, 46, 0.12), 0 0.5rem 2rem rgba(31, 38, 46, 0.08)';
|
|
80
80
|
};
|
|
81
81
|
/**
|
|
82
82
|
* ### Depth 5
|
|
@@ -92,7 +92,7 @@ export type CanvasDepth = {
|
|
|
92
92
|
* ```
|
|
93
93
|
*/
|
|
94
94
|
5: {
|
|
95
|
-
boxShadow: '
|
|
95
|
+
boxShadow: '0 0.3125rem 1.25rem rgba(31, 38, 46, 0.12), 0 0.625rem 2.5rem rgba(31, 38, 46, 0.08)';
|
|
96
96
|
};
|
|
97
97
|
/**
|
|
98
98
|
* ### Depth 6
|
|
@@ -108,7 +108,7 @@ export type CanvasDepth = {
|
|
|
108
108
|
* ```
|
|
109
109
|
*/
|
|
110
110
|
6: {
|
|
111
|
-
boxShadow: '
|
|
111
|
+
boxShadow: '0 0.375rem 1.5rem rgba(31, 38, 46, 0.12), 0 0.75rem 3rem rgba(31, 38, 46, 0.08)';
|
|
112
112
|
};
|
|
113
113
|
};
|
|
114
114
|
|
|
@@ -137,26 +137,30 @@ export type CanvasDepthValues = ValueOf<CanvasDepth>;
|
|
|
137
137
|
* ```
|
|
138
138
|
*
|
|
139
139
|
*/
|
|
140
|
+
|
|
140
141
|
export const depth: CanvasDepth = {
|
|
141
142
|
none: {
|
|
142
143
|
boxShadow: 'none',
|
|
143
144
|
},
|
|
144
145
|
1: {
|
|
145
|
-
boxShadow:
|
|
146
|
+
boxShadow:
|
|
147
|
+
'0 0.0625rem 0.25rem rgba(31, 38, 46, 0.12), 0 0.125rem 0.5rem rgba(31, 38, 46, 0.08)',
|
|
146
148
|
},
|
|
147
149
|
2: {
|
|
148
|
-
boxShadow: '
|
|
150
|
+
boxShadow: '0 0.125rem 0.5rem rgba(31, 38, 46, 0.12), 0 0.25rem 1rem rgba(31, 38, 46, 0.08)',
|
|
149
151
|
},
|
|
150
152
|
3: {
|
|
151
|
-
boxShadow:
|
|
153
|
+
boxShadow:
|
|
154
|
+
'0 0.1875rem 0.75rem rgba(31, 38, 46, 0.12), 0 0.375rem 1.5rem rgba(31, 38, 46, 0.08)',
|
|
152
155
|
},
|
|
153
156
|
4: {
|
|
154
|
-
boxShadow: '
|
|
157
|
+
boxShadow: '0 0.25rem 1rem rgba(31, 38, 46, 0.12), 0 0.5rem 2rem rgba(31, 38, 46, 0.08)',
|
|
155
158
|
},
|
|
156
159
|
5: {
|
|
157
|
-
boxShadow:
|
|
160
|
+
boxShadow:
|
|
161
|
+
'0 0.3125rem 1.25rem rgba(31, 38, 46, 0.12), 0 0.625rem 2.5rem rgba(31, 38, 46, 0.08)',
|
|
158
162
|
},
|
|
159
163
|
6: {
|
|
160
|
-
boxShadow: '
|
|
164
|
+
boxShadow: '0 0.375rem 1.5rem rgba(31, 38, 46, 0.12), 0 0.75rem 3rem rgba(31, 38, 46, 0.08)',
|
|
161
165
|
},
|
|
162
166
|
};
|