@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
|
@@ -120,7 +120,7 @@ const ButtonContainer = styled('button')<StyledType & ButtonContainerProps>(
|
|
|
120
120
|
fontWeight: type.properties.fontWeights.bold,
|
|
121
121
|
height: '48px',
|
|
122
122
|
'& > * ': {
|
|
123
|
-
margin: `0 ${
|
|
123
|
+
margin: `0 ${space.xxxs}`,
|
|
124
124
|
},
|
|
125
125
|
};
|
|
126
126
|
case 'medium':
|
|
@@ -128,14 +128,14 @@ const ButtonContainer = styled('button')<StyledType & ButtonContainerProps>(
|
|
|
128
128
|
return {
|
|
129
129
|
height: space.xl,
|
|
130
130
|
'& > * ': {
|
|
131
|
-
margin: `0 ${
|
|
131
|
+
margin: `0 ${space.xxxs}`,
|
|
132
132
|
},
|
|
133
133
|
};
|
|
134
134
|
case 'small':
|
|
135
135
|
return {
|
|
136
136
|
height: space.l,
|
|
137
137
|
'& > * ': {
|
|
138
|
-
margin: `0 ${spaceNumbers.xxxs / 2}
|
|
138
|
+
margin: `0 ${spaceNumbers.xxxs / 2}rem`,
|
|
139
139
|
},
|
|
140
140
|
};
|
|
141
141
|
case 'extraSmall':
|
|
@@ -144,7 +144,7 @@ const ButtonContainer = styled('button')<StyledType & ButtonContainerProps>(
|
|
|
144
144
|
fontWeight: type.properties.fontWeights.bold,
|
|
145
145
|
height: space.m,
|
|
146
146
|
'& > * ': {
|
|
147
|
-
margin: `0 ${spaceNumbers.xxxs / 2}
|
|
147
|
+
margin: `0 ${spaceNumbers.xxxs / 2}rem`,
|
|
148
148
|
},
|
|
149
149
|
};
|
|
150
150
|
}
|
|
@@ -11,7 +11,13 @@ import {
|
|
|
11
11
|
useTheme,
|
|
12
12
|
Themeable,
|
|
13
13
|
} from '@workday/canvas-kit-react/common';
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
borderRadius,
|
|
16
|
+
colors,
|
|
17
|
+
inputColors,
|
|
18
|
+
space,
|
|
19
|
+
spaceNumbers,
|
|
20
|
+
} from '@workday/canvas-kit-react/tokens';
|
|
15
21
|
import {SystemIcon} from '@workday/canvas-kit-react/icon';
|
|
16
22
|
import {checkSmallIcon} from '@workday/canvas-system-icons-web';
|
|
17
23
|
import {LabelText} from '@workday/canvas-kit-react/text';
|
|
@@ -60,11 +66,11 @@ export interface CheckboxProps extends Themeable {
|
|
|
60
66
|
variant?: 'inverse' | undefined;
|
|
61
67
|
}
|
|
62
68
|
|
|
63
|
-
const checkboxHeight =
|
|
64
|
-
const checkboxTapArea =
|
|
69
|
+
const checkboxHeight = (spaceNumbers.xl - spaceNumbers.xxxs) / 2;
|
|
70
|
+
const checkboxTapArea = space.m;
|
|
65
71
|
const checkboxContainerHeight = checkboxTapArea;
|
|
66
|
-
const checkboxLabelDistance = spaceNumbers.xs
|
|
67
|
-
const checkboxWidth =
|
|
72
|
+
const checkboxLabelDistance = `${spaceNumbers.xs}rem`;
|
|
73
|
+
const checkboxWidth = checkboxHeight;
|
|
68
74
|
const rippleRadius = (spaceNumbers.l - checkboxWidth) / 2;
|
|
69
75
|
|
|
70
76
|
const CheckboxContainer = styled('div')({
|
|
@@ -81,8 +87,8 @@ const CheckboxContainer = styled('div')({
|
|
|
81
87
|
*/
|
|
82
88
|
const CheckboxInputWrapper = styled('div')<Pick<CheckboxProps, 'disabled'>>({
|
|
83
89
|
display: 'flex',
|
|
84
|
-
height: checkboxHeight
|
|
85
|
-
minWidth: checkboxWidth
|
|
90
|
+
height: `${checkboxHeight}rem`,
|
|
91
|
+
minWidth: `${checkboxWidth}rem`,
|
|
86
92
|
marginTop: '3px',
|
|
87
93
|
alignSelf: 'flex-start',
|
|
88
94
|
});
|
|
@@ -91,9 +97,9 @@ const CheckboxRipple = styled('span')<Pick<CheckboxProps, 'disabled' | 'variant'
|
|
|
91
97
|
{
|
|
92
98
|
borderRadius: borderRadius.circle,
|
|
93
99
|
boxShadow: `0 0 0 0 ${colors.soap200}`,
|
|
94
|
-
height: checkboxHeight
|
|
100
|
+
height: `${checkboxHeight}rem`,
|
|
95
101
|
transition: 'box-shadow 150ms ease-out',
|
|
96
|
-
width: checkboxWidth
|
|
102
|
+
width: `${checkboxWidth}rem`,
|
|
97
103
|
position: 'absolute',
|
|
98
104
|
pointerEvents: 'none', // This is a decorative element we don't want it to block clicks to input
|
|
99
105
|
},
|
|
@@ -203,7 +209,7 @@ const CheckboxInput = styled('input')<CheckboxProps & StyledType>(
|
|
|
203
209
|
}),
|
|
204
210
|
({disabled}) => ({
|
|
205
211
|
'&:hover ~ span:first-of-type': {
|
|
206
|
-
boxShadow: disabled ? undefined : `0 0 0 ${rippleRadius}
|
|
212
|
+
boxShadow: disabled ? undefined : `0 0 0 ${rippleRadius}rem ${colors.soap200}`,
|
|
207
213
|
},
|
|
208
214
|
}),
|
|
209
215
|
({theme, error, variant}) => {
|
|
@@ -253,13 +259,13 @@ const CheckboxBackground = styled('div')<CheckboxProps>(
|
|
|
253
259
|
borderRadius: borderRadius.s,
|
|
254
260
|
boxSizing: 'border-box',
|
|
255
261
|
display: 'flex',
|
|
256
|
-
height: checkboxHeight
|
|
262
|
+
height: `${checkboxHeight}rem`,
|
|
257
263
|
justifyContent: 'center',
|
|
258
264
|
padding: '0px 2px',
|
|
259
265
|
pointerEvents: 'none',
|
|
260
266
|
position: 'absolute',
|
|
261
267
|
transition: 'border 200ms ease, background 200ms',
|
|
262
|
-
width: checkboxWidth
|
|
268
|
+
width: `${checkboxWidth}rem`,
|
|
263
269
|
},
|
|
264
270
|
({variant}) => ({
|
|
265
271
|
border: `1px solid ${variant === 'inverse' ? colors.soap300 : inputColors.border}`,
|
|
@@ -26,7 +26,7 @@ export interface ButtonContainerProps extends Partial<SystemIconProps>, GrowthBe
|
|
|
26
26
|
*/
|
|
27
27
|
export interface BaseButtonProps extends Omit<ButtonContainerProps, 'ref'> {
|
|
28
28
|
}
|
|
29
|
-
export declare const getMinWidthStyles: (children: React.ReactNode, size: ButtonSizes | TertiaryButtonSizes) => "
|
|
29
|
+
export declare const getMinWidthStyles: (children: React.ReactNode, size: ButtonSizes | TertiaryButtonSizes) => "1.5rem" | "2rem" | "2.5rem" | "5rem" | "auto" | "48px" | "112px" | "96px";
|
|
30
30
|
export declare const getPaddingStyles: (children: React.ReactNode, size: ButtonSizes | TertiaryButtonSizes, icon: CanvasSystemIcon | undefined, iconPosition: IconPositions | undefined) => string | 0;
|
|
31
31
|
export declare const BaseButton: import("@workday/canvas-kit-react/common").ElementComponent<"button", ButtonContainerProps> & {
|
|
32
32
|
Icon: import("@workday/canvas-kit-react/common").ElementComponent<"span", import("./parts/ButtonLabelIcon").ButtonLabelIconProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/BaseButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAEL,cAAc,EAMf,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAI/D,OAAO,EAAC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAGtF,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAE9D,MAAM,WAAW,oBAAqB,SAAQ,OAAO,CAAC,eAAe,CAAC,EAAE,cAAc;IACpF;;OAEG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB;;;OAGG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,KAAK,CAAC;CAAG;AAgL7E,eAAO,MAAM,iBAAiB,aAClB,MAAM,SAAS,QACnB,WAAW,GAAG,mBAAmB,
|
|
1
|
+
{"version":3,"file":"BaseButton.d.ts","sourceRoot":"","sources":["../../../../button/lib/BaseButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAEL,cAAc,EAMf,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAI/D,OAAO,EAAC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAGtF,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAE9D,MAAM,WAAW,oBAAqB,SAAQ,OAAO,CAAC,eAAe,CAAC,EAAE,cAAc;IACpF;;OAEG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB;;;OAGG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,KAAK,CAAC;CAAG;AAgL7E,eAAO,MAAM,iBAAiB,aAClB,MAAM,SAAS,QACnB,WAAW,GAAG,mBAAmB,+EAcxC,CAAC;AAEF,eAAO,MAAM,gBAAgB,aACjB,MAAM,SAAS,QACnB,WAAW,GAAG,mBAAmB,QACjC,gBAAgB,GAAG,SAAS,gBACpB,aAAa,GAAG,SAAS,eAiDxC,CAAC;AAEF,eAAO,MAAM,UAAU;;;CAarB,CAAC"}
|
|
@@ -86,7 +86,7 @@ const ButtonContainer = common_1.styled('button')({
|
|
|
86
86
|
fontWeight: tokens_1.type.properties.fontWeights.bold,
|
|
87
87
|
height: '48px',
|
|
88
88
|
'& > * ': {
|
|
89
|
-
margin: `0 ${tokens_1.
|
|
89
|
+
margin: `0 ${tokens_1.space.xxxs}`,
|
|
90
90
|
},
|
|
91
91
|
};
|
|
92
92
|
case 'medium':
|
|
@@ -94,14 +94,14 @@ const ButtonContainer = common_1.styled('button')({
|
|
|
94
94
|
return {
|
|
95
95
|
height: tokens_1.space.xl,
|
|
96
96
|
'& > * ': {
|
|
97
|
-
margin: `0 ${tokens_1.
|
|
97
|
+
margin: `0 ${tokens_1.space.xxxs}`,
|
|
98
98
|
},
|
|
99
99
|
};
|
|
100
100
|
case 'small':
|
|
101
101
|
return {
|
|
102
102
|
height: tokens_1.space.l,
|
|
103
103
|
'& > * ': {
|
|
104
|
-
margin: `0 ${tokens_1.spaceNumbers.xxxs / 2}
|
|
104
|
+
margin: `0 ${tokens_1.spaceNumbers.xxxs / 2}rem`,
|
|
105
105
|
},
|
|
106
106
|
};
|
|
107
107
|
case 'extraSmall':
|
|
@@ -110,7 +110,7 @@ const ButtonContainer = common_1.styled('button')({
|
|
|
110
110
|
fontWeight: tokens_1.type.properties.fontWeights.bold,
|
|
111
111
|
height: tokens_1.space.m,
|
|
112
112
|
'& > * ': {
|
|
113
|
-
margin: `0 ${tokens_1.spaceNumbers.xxxs / 2}
|
|
113
|
+
margin: `0 ${tokens_1.spaceNumbers.xxxs / 2}rem`,
|
|
114
114
|
},
|
|
115
115
|
};
|
|
116
116
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../checkbox/lib/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGL,SAAS,EAOT,SAAS,EACV,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../checkbox/lib/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGL,SAAS,EAOT,SAAS,EACV,MAAM,kCAAkC,CAAC;AAY1C,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC5D;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACjC;AAqPD,eAAO,MAAM,QAAQ;;CAmEnB,CAAC"}
|
|
@@ -26,11 +26,11 @@ const tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
|
26
26
|
const icon_1 = require("@workday/canvas-kit-react/icon");
|
|
27
27
|
const canvas_system_icons_web_1 = require("@workday/canvas-system-icons-web");
|
|
28
28
|
const text_1 = require("@workday/canvas-kit-react/text");
|
|
29
|
-
const checkboxHeight =
|
|
30
|
-
const checkboxTapArea = tokens_1.
|
|
29
|
+
const checkboxHeight = (tokens_1.spaceNumbers.xl - tokens_1.spaceNumbers.xxxs) / 2;
|
|
30
|
+
const checkboxTapArea = tokens_1.space.m;
|
|
31
31
|
const checkboxContainerHeight = checkboxTapArea;
|
|
32
|
-
const checkboxLabelDistance = tokens_1.spaceNumbers.xs
|
|
33
|
-
const checkboxWidth =
|
|
32
|
+
const checkboxLabelDistance = `${tokens_1.spaceNumbers.xs}rem`;
|
|
33
|
+
const checkboxWidth = checkboxHeight;
|
|
34
34
|
const rippleRadius = (tokens_1.spaceNumbers.l - checkboxWidth) / 2;
|
|
35
35
|
const CheckboxContainer = common_1.styled('div')({
|
|
36
36
|
display: 'flex',
|
|
@@ -45,17 +45,17 @@ const CheckboxContainer = common_1.styled('div')({
|
|
|
45
45
|
*/
|
|
46
46
|
const CheckboxInputWrapper = common_1.styled('div')({
|
|
47
47
|
display: 'flex',
|
|
48
|
-
height: checkboxHeight
|
|
49
|
-
minWidth: checkboxWidth
|
|
48
|
+
height: `${checkboxHeight}rem`,
|
|
49
|
+
minWidth: `${checkboxWidth}rem`,
|
|
50
50
|
marginTop: '3px',
|
|
51
51
|
alignSelf: 'flex-start',
|
|
52
52
|
});
|
|
53
53
|
const CheckboxRipple = common_1.styled('span')({
|
|
54
54
|
borderRadius: tokens_1.borderRadius.circle,
|
|
55
55
|
boxShadow: `0 0 0 0 ${tokens_1.colors.soap200}`,
|
|
56
|
-
height: checkboxHeight
|
|
56
|
+
height: `${checkboxHeight}rem`,
|
|
57
57
|
transition: 'box-shadow 150ms ease-out',
|
|
58
|
-
width: checkboxWidth
|
|
58
|
+
width: `${checkboxWidth}rem`,
|
|
59
59
|
position: 'absolute',
|
|
60
60
|
pointerEvents: 'none', // This is a decorative element we don't want it to block clicks to input
|
|
61
61
|
}, ({ variant }) => ({
|
|
@@ -146,7 +146,7 @@ const CheckboxInput = common_1.styled('input')(({ theme: { canvas: { palette: {
|
|
|
146
146
|
}),
|
|
147
147
|
}), ({ disabled }) => ({
|
|
148
148
|
'&:hover ~ span:first-of-type': {
|
|
149
|
-
boxShadow: disabled ? undefined : `0 0 0 ${rippleRadius}
|
|
149
|
+
boxShadow: disabled ? undefined : `0 0 0 ${rippleRadius}rem ${tokens_1.colors.soap200}`,
|
|
150
150
|
},
|
|
151
151
|
}), ({ theme, error, variant }) => {
|
|
152
152
|
const errorColors = common_1.getErrorColors(error, theme);
|
|
@@ -189,13 +189,13 @@ const CheckboxBackground = common_1.styled('div')({
|
|
|
189
189
|
borderRadius: tokens_1.borderRadius.s,
|
|
190
190
|
boxSizing: 'border-box',
|
|
191
191
|
display: 'flex',
|
|
192
|
-
height: checkboxHeight
|
|
192
|
+
height: `${checkboxHeight}rem`,
|
|
193
193
|
justifyContent: 'center',
|
|
194
194
|
padding: '0px 2px',
|
|
195
195
|
pointerEvents: 'none',
|
|
196
196
|
position: 'absolute',
|
|
197
197
|
transition: 'border 200ms ease, background 200ms',
|
|
198
|
-
width: checkboxWidth
|
|
198
|
+
width: `${checkboxWidth}rem`,
|
|
199
199
|
}, ({ variant }) => ({
|
|
200
200
|
border: `1px solid ${variant === 'inverse' ? tokens_1.colors.soap300 : tokens_1.inputColors.border}`,
|
|
201
201
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../../radio/lib/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAML,SAAS,EAEV,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../../radio/lib/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAML,SAAS,EAEV,MAAM,kCAAkC,CAAC;AAU1C,MAAM,WAAW,UAAW,SAAQ,SAAS;IAC3C;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC5D;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACjC;AAmOD,eAAO,MAAM,KAAK,kFAqDhB,CAAC"}
|
|
@@ -24,13 +24,13 @@ const React = __importStar(require("react"));
|
|
|
24
24
|
const common_1 = require("@workday/canvas-kit-react/common");
|
|
25
25
|
const tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
26
26
|
const text_1 = require("@workday/canvas-kit-react/text");
|
|
27
|
-
const radioBorderRadius =
|
|
28
|
-
const radioDot =
|
|
29
|
-
const radioHeight =
|
|
30
|
-
const radioTapArea = tokens_1.
|
|
27
|
+
const radioBorderRadius = `${tokens_1.spaceNumbers.xxs + 0.0625}rem`;
|
|
28
|
+
const radioDot = tokens_1.space.xxs;
|
|
29
|
+
const radioHeight = (tokens_1.spaceNumbers.xl - tokens_1.spaceNumbers.xxxs) / 2;
|
|
30
|
+
const radioTapArea = tokens_1.space.m;
|
|
31
31
|
const radioContainerHeight = radioTapArea;
|
|
32
|
-
const radioLabelDistance = tokens_1.
|
|
33
|
-
const radioWidth =
|
|
32
|
+
const radioLabelDistance = tokens_1.space.xs;
|
|
33
|
+
const radioWidth = radioHeight;
|
|
34
34
|
const rippleRadius = (tokens_1.spaceNumbers.l - radioWidth) / 2;
|
|
35
35
|
const RadioContainer = common_1.styled('div')({
|
|
36
36
|
display: 'flex',
|
|
@@ -45,15 +45,15 @@ const RadioContainer = common_1.styled('div')({
|
|
|
45
45
|
*/
|
|
46
46
|
const RadioInputWrapper = common_1.styled('div')({
|
|
47
47
|
display: 'flex',
|
|
48
|
-
height: radioHeight
|
|
49
|
-
width: radioWidth
|
|
48
|
+
height: `${radioHeight}rem`,
|
|
49
|
+
width: `${radioWidth}rem`,
|
|
50
50
|
});
|
|
51
51
|
const RadioRipple = common_1.styled('span')({
|
|
52
52
|
borderRadius: tokens_1.borderRadius.circle,
|
|
53
53
|
boxShadow: `0 0 0 0 ${tokens_1.colors.soap200}`,
|
|
54
|
-
height: radioHeight
|
|
54
|
+
height: `${radioHeight}rem`,
|
|
55
55
|
transition: 'box-shadow 150ms ease-out',
|
|
56
|
-
width: radioWidth
|
|
56
|
+
width: `${radioWidth}rem`,
|
|
57
57
|
position: 'absolute',
|
|
58
58
|
pointerEvents: 'none', // This is a decorative element we don't want it to block clicks to input
|
|
59
59
|
}, ({ variant }) => ({
|
|
@@ -84,7 +84,7 @@ const RadioInput = common_1.styled('input')({
|
|
|
84
84
|
// `span:first-of-type` refers to `RadioRipple`, the light grey
|
|
85
85
|
// element that animates around the component on hover
|
|
86
86
|
'&:hover ~ span:first-of-type': {
|
|
87
|
-
boxShadow: disabled ? undefined : `0 0 0 ${rippleRadius}
|
|
87
|
+
boxShadow: disabled ? undefined : `0 0 0 ${rippleRadius}rem ${tokens_1.colors.soap200}`,
|
|
88
88
|
},
|
|
89
89
|
// `div:first-of-type` refers to the `RadioBackground`, the visual facade of the
|
|
90
90
|
// input (which is visually hidden)
|
|
@@ -163,13 +163,13 @@ const RadioBackground = common_1.styled('div')({
|
|
|
163
163
|
borderWidth: '1px',
|
|
164
164
|
boxSizing: 'border-box',
|
|
165
165
|
display: 'flex',
|
|
166
|
-
height: radioHeight
|
|
166
|
+
height: `${radioHeight}rem`,
|
|
167
167
|
justifyContent: 'center',
|
|
168
168
|
padding: '0px 2px',
|
|
169
169
|
pointerEvents: 'none',
|
|
170
170
|
position: 'absolute',
|
|
171
171
|
transition: 'border 200ms ease, background 200ms',
|
|
172
|
-
width: radioWidth
|
|
172
|
+
width: `${radioWidth}rem`,
|
|
173
173
|
}, ({ checked, disabled, variant, theme: { canvas: { palette: { primary: themePrimary }, }, }, }) => ({
|
|
174
174
|
borderColor: checked
|
|
175
175
|
? variant === 'inverse'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../select/lib/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGL,cAAc,EACd,SAAS,EAGT,SAAS,EACV,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../select/lib/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGL,cAAc,EACd,SAAS,EAGT,SAAS,EACV,MAAM,kCAAkC,CAAC;AAI1C,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAE5C,MAAM,WAAW,WAAY,SAAQ,SAAS,EAAE,cAAc;IAC5D;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE,CAAC;IAChF;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC7D;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA0ED,eAAO,MAAM,MAAM;;CAiBjB,CAAC"}
|
|
@@ -35,7 +35,7 @@ const StyledSelect = common_1.styled('select')({
|
|
|
35
35
|
height: tokens_1.space.xl,
|
|
36
36
|
minWidth: 280,
|
|
37
37
|
transition: '0.2s box-shadow, 0.2s border-color',
|
|
38
|
-
padding: tokens_1.
|
|
38
|
+
padding: tokens_1.space.xxs,
|
|
39
39
|
margin: 0,
|
|
40
40
|
MozAppearance: 'none',
|
|
41
41
|
WebkitAppearance: 'none',
|
|
@@ -102,7 +102,7 @@ const StyledTableRow = styled_1.default('tr')({
|
|
|
102
102
|
fontSize: 13,
|
|
103
103
|
borderRight: Table_1.cellBorder,
|
|
104
104
|
borderBottom: Table_1.cellBorder,
|
|
105
|
-
height: tokens_1.spaceNumbers.xl + tokens_1.spaceNumbers.xxs
|
|
105
|
+
height: `${tokens_1.spaceNumbers.xl + tokens_1.spaceNumbers.xxs}rem`,
|
|
106
106
|
boxSizing: 'border-box',
|
|
107
107
|
transition: 'background-color 0.2s',
|
|
108
108
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../../../../text-area/lib/TextArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGL,cAAc,EACd,SAAS,EAGT,SAAS,EACV,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../../../../text-area/lib/TextArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGL,cAAc,EACd,SAAS,EAGT,SAAS,EACV,MAAM,kCAAkC,CAAC;AAS1C,MAAM,WAAW,aAAc,SAAQ,SAAS,EAAE,cAAc;IAC9D;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IAC/D;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC;;OAEG;IACH,KAAK,CAAC,EAAE,GAAG,CAAC;CACb;AAED,oBAAY,uBAAuB;IACjC,IAAI,SAAS;IACb,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,QAAQ,aAAa;CACtB;AA8CD,eAAO,MAAM,QAAQ;;;CAWnB,CAAC"}
|
|
@@ -37,10 +37,10 @@ const StyledTextArea = common_1.styled('textarea')(({ theme, error }) => ({
|
|
|
37
37
|
backgroundColor: tokens_1.inputColors.background,
|
|
38
38
|
borderRadius: tokens_1.borderRadius.m,
|
|
39
39
|
boxSizing: 'border-box',
|
|
40
|
-
minHeight:
|
|
41
|
-
minWidth:
|
|
40
|
+
minHeight: tokens_1.space.xxl,
|
|
41
|
+
minWidth: `${tokens_1.spaceNumbers.xxxl * 3 + tokens_1.spaceNumbers.xl}rem`,
|
|
42
42
|
transition: '0.2s box-shadow, 0.2s border-color',
|
|
43
|
-
padding: tokens_1.
|
|
43
|
+
padding: tokens_1.space.xxs,
|
|
44
44
|
margin: 0,
|
|
45
45
|
'&::webkit-resizer': {
|
|
46
46
|
display: 'none',
|
|
@@ -32,7 +32,7 @@ const StyledTextInput = common_1.styled('input')({
|
|
|
32
32
|
boxSizing: 'border-box',
|
|
33
33
|
height: 40,
|
|
34
34
|
transition: '0.2s box-shadow, 0.2s border-color',
|
|
35
|
-
padding: tokens_1.spaceNumbers.xxs
|
|
35
|
+
padding: `${tokens_1.spaceNumbers.xxs}rem`,
|
|
36
36
|
margin: 0,
|
|
37
37
|
'&::placeholder': {
|
|
38
38
|
color: tokens_1.inputColors.placeholder,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../tokens/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,MAAM,EAEN,SAAS,EAKV,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAC,YAAY,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,wBAAwB,EAAC,MAAM,cAAc,CAAC;AAChH,OAAO,EAAC,aAAa,EAAE,WAAW,EAAC,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAC,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAC,MAAM,aAAa,CAAC;AAClE,OAAO,EACL,KAAK,EACL,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EACvB,kBAAkB,EAClB,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../tokens/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,MAAM,EAEN,SAAS,EAKV,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAC,YAAY,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,wBAAwB,EAAC,MAAM,cAAc,CAAC;AAChH,OAAO,EAAC,aAAa,EAAE,WAAW,EAAC,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAC,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAC,MAAM,aAAa,CAAC;AAClE,OAAO,EACL,KAAK,EACL,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EACvB,kBAAkB,EAClB,YAAY,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EAAC,IAAI,EACV,UAAU,EACV,cAAc,EACd,UAAU,EACV,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAE1C,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBlB,CAAC;AAEF,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EACL,YAAY,EACZ,MAAM,EACN,SAAS,EACT,KAAK,EACL,KAAK,EACL,YAAY,EACZ,IAAI,EACJ,UAAU,EACV,cAAc,EACd,aAAa,GACd,CAAC;AAEF,YAAY,EACV,kBAAkB,EAClB,sBAAsB,EACtB,wBAAwB,EACxB,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EACvB,kBAAkB,EAClB,UAAU,EACV,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,GACd,CAAA"}
|
|
@@ -29,7 +29,7 @@ export declare 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 declare 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 declare 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 declare 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 declare 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 declare 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
|
declare type ValueOf<T> = T[keyof T];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"depth.d.ts","sourceRoot":"","sources":["../../../../tokens/lib/depth.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW,GAAG;IACxB;;;;;;;;;;;;OAYG;IACH,IAAI,EAAE;QACJ,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF;;;;;;;;;;;;OAYG;IACH,CAAC,EAAE;QACD,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"depth.d.ts","sourceRoot":"","sources":["../../../../tokens/lib/depth.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW,GAAG;IACxB;;;;;;;;;;;;OAYG;IACH,IAAI,EAAE;QACJ,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF;;;;;;;;;;;;OAYG;IACH,CAAC,EAAE;QACD,SAAS,EAAE,sFAAsF,CAAC;KACnG,CAAC;IACF;;;;;;;;;;;;OAYG;IACH,CAAC,EAAE;QACD,SAAS,EAAE,iFAAiF,CAAC;KAC9F,CAAC;IACF;;;;;;;;;;;;OAYG;IACH,CAAC,EAAE;QACD,SAAS,EAAE,sFAAsF,CAAC;KACnG,CAAC;IACF;;;;;;;;;;;OAWG;IACH,CAAC,EAAE;QACD,SAAS,EAAE,6EAA6E,CAAC;KAC1F,CAAC;IACF;;;;;;;;;;;;OAYG;IACH,CAAC,EAAE;QACD,SAAS,EAAE,sFAAsF,CAAC;KACnG,CAAC;IACF;;;;;;;;;;;;OAYG;IACH,CAAC,EAAE;QACD,SAAS,EAAE,iFAAiF,CAAC;KAC9F,CAAC;CACH,CAAC;AAEF,aAAK,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAC7B,oBAAY,iBAAiB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,eAAO,MAAM,KAAK,EAAE,WAyBnB,CAAC"}
|
|
@@ -28,21 +28,21 @@ exports.depth = {
|
|
|
28
28
|
boxShadow: 'none',
|
|
29
29
|
},
|
|
30
30
|
1: {
|
|
31
|
-
boxShadow: '
|
|
31
|
+
boxShadow: '0 0.0625rem 0.25rem rgba(31, 38, 46, 0.12), 0 0.125rem 0.5rem rgba(31, 38, 46, 0.08)',
|
|
32
32
|
},
|
|
33
33
|
2: {
|
|
34
|
-
boxShadow: '
|
|
34
|
+
boxShadow: '0 0.125rem 0.5rem rgba(31, 38, 46, 0.12), 0 0.25rem 1rem rgba(31, 38, 46, 0.08)',
|
|
35
35
|
},
|
|
36
36
|
3: {
|
|
37
|
-
boxShadow: '
|
|
37
|
+
boxShadow: '0 0.1875rem 0.75rem rgba(31, 38, 46, 0.12), 0 0.375rem 1.5rem rgba(31, 38, 46, 0.08)',
|
|
38
38
|
},
|
|
39
39
|
4: {
|
|
40
|
-
boxShadow: '
|
|
40
|
+
boxShadow: '0 0.25rem 1rem rgba(31, 38, 46, 0.12), 0 0.5rem 2rem rgba(31, 38, 46, 0.08)',
|
|
41
41
|
},
|
|
42
42
|
5: {
|
|
43
|
-
boxShadow: '
|
|
43
|
+
boxShadow: '0 0.3125rem 1.25rem rgba(31, 38, 46, 0.12), 0 0.625rem 2.5rem rgba(31, 38, 46, 0.08)',
|
|
44
44
|
},
|
|
45
45
|
6: {
|
|
46
|
-
boxShadow: '
|
|
46
|
+
boxShadow: '0 0.375rem 1.5rem rgba(31, 38, 46, 0.12), 0 0.75rem 3rem rgba(31, 38, 46, 0.08)',
|
|
47
47
|
},
|
|
48
48
|
};
|
|
@@ -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"}
|