@workday/canvas-kit-react 10.0.0-alpha.539-next.0 → 10.0.0-alpha.540-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/checkbox/lib/Checkbox.tsx +24 -33
  2. package/dist/commonjs/checkbox/lib/Checkbox.d.ts.map +1 -1
  3. package/dist/commonjs/checkbox/lib/Checkbox.js +13 -17
  4. package/dist/commonjs/radio/lib/Radio.d.ts.map +1 -1
  5. package/dist/commonjs/radio/lib/Radio.js +17 -22
  6. package/dist/commonjs/table/lib/Table.d.ts +1 -2
  7. package/dist/commonjs/table/lib/Table.d.ts.map +1 -1
  8. package/dist/commonjs/table/lib/Table.js +1 -2
  9. package/dist/commonjs/table/lib/TableRow.d.ts +3 -6
  10. package/dist/commonjs/table/lib/TableRow.d.ts.map +1 -1
  11. package/dist/commonjs/table/lib/TableRow.js +3 -5
  12. package/dist/commonjs/text-area/lib/TextArea.d.ts.map +1 -1
  13. package/dist/commonjs/text-area/lib/TextArea.js +1 -1
  14. package/dist/commonjs/text-input/lib/TextInput.js +1 -1
  15. package/dist/commonjs/tokens/lib/space.d.ts +44 -31
  16. package/dist/commonjs/tokens/lib/space.d.ts.map +1 -1
  17. package/dist/commonjs/tokens/lib/space.js +22 -29
  18. package/dist/commonjs/tooltip/lib/TooltipContainer.js +2 -2
  19. package/dist/es6/checkbox/lib/Checkbox.d.ts.map +1 -1
  20. package/dist/es6/checkbox/lib/Checkbox.js +14 -18
  21. package/dist/es6/radio/lib/Radio.d.ts.map +1 -1
  22. package/dist/es6/radio/lib/Radio.js +18 -23
  23. package/dist/es6/table/lib/Table.d.ts +1 -2
  24. package/dist/es6/table/lib/Table.d.ts.map +1 -1
  25. package/dist/es6/table/lib/Table.js +1 -2
  26. package/dist/es6/table/lib/TableRow.d.ts +3 -6
  27. package/dist/es6/table/lib/TableRow.d.ts.map +1 -1
  28. package/dist/es6/table/lib/TableRow.js +4 -6
  29. package/dist/es6/text-area/lib/TextArea.d.ts.map +1 -1
  30. package/dist/es6/text-area/lib/TextArea.js +2 -2
  31. package/dist/es6/text-input/lib/TextInput.js +2 -2
  32. package/dist/es6/tokens/lib/space.d.ts +44 -31
  33. package/dist/es6/tokens/lib/space.d.ts.map +1 -1
  34. package/dist/es6/tokens/lib/space.js +22 -29
  35. package/dist/es6/tooltip/lib/TooltipContainer.js +3 -3
  36. package/package.json +4 -4
  37. package/radio/lib/Radio.tsx +18 -34
  38. package/table/lib/Table.tsx +1 -2
  39. package/table/lib/TableRow.tsx +5 -8
  40. package/text-area/lib/TextArea.tsx +2 -8
  41. package/text-input/lib/TextInput.tsx +2 -2
  42. package/tokens/README.md +25 -28
  43. package/tokens/lib/space.ts +53 -40
  44. package/tooltip/lib/TooltipContainer.tsx +3 -3
@@ -12,13 +12,7 @@ import {
12
12
  Themeable,
13
13
  useLocalRef,
14
14
  } from '@workday/canvas-kit-react/common';
15
- import {
16
- borderRadius,
17
- colors,
18
- inputColors,
19
- space,
20
- spaceNumbers,
21
- } from '@workday/canvas-kit-react/tokens';
15
+ import {borderRadius, colors, inputColors, space} from '@workday/canvas-kit-react/tokens';
22
16
  import {SystemIcon} from '@workday/canvas-kit-react/icon';
23
17
  import {checkSmallIcon} from '@workday/canvas-system-icons-web';
24
18
  import {LabelText} from '@workday/canvas-kit-react/text';
@@ -67,17 +61,10 @@ export interface CheckboxProps extends Themeable {
67
61
  variant?: 'inverse' | undefined;
68
62
  }
69
63
 
70
- const checkboxHeight = (spaceNumbers.xl - spaceNumbers.xxxs) / 2;
71
- const checkboxTapArea = space.m;
72
- const checkboxContainerHeight = checkboxTapArea;
73
- const checkboxLabelDistance = `${spaceNumbers.xs}rem`;
74
- const checkboxWidth = checkboxHeight;
75
- const rippleRadius = (spaceNumbers.l - checkboxWidth) / 2;
76
-
77
64
  const CheckboxContainer = styled('div')({
78
65
  display: 'flex',
79
66
  alignItems: 'center',
80
- minHeight: checkboxContainerHeight,
67
+ minHeight: space.m,
81
68
  position: 'relative',
82
69
  });
83
70
 
@@ -88,8 +75,8 @@ const CheckboxContainer = styled('div')({
88
75
  */
89
76
  const CheckboxInputWrapper = styled('div')<Pick<CheckboxProps, 'disabled'>>({
90
77
  display: 'flex',
91
- height: `${checkboxHeight}rem`,
92
- minWidth: `${checkboxWidth}rem`,
78
+ height: `calc(${space.s} + 2px)`,
79
+ minWidth: `calc(${space.s} + 2px)`,
93
80
  marginTop: '3px',
94
81
  alignSelf: 'flex-start',
95
82
  });
@@ -98,9 +85,9 @@ const CheckboxRipple = styled('span')<Pick<CheckboxProps, 'disabled' | 'variant'
98
85
  {
99
86
  borderRadius: borderRadius.circle,
100
87
  boxShadow: `0 0 0 0 ${colors.soap200}`,
101
- height: `${checkboxHeight}rem`,
88
+ height: `calc(${space.s} + 2px)`,
102
89
  transition: 'box-shadow 150ms ease-out',
103
- width: `${checkboxWidth}rem`,
90
+ width: `calc(${space.s} + 2px)`,
104
91
  position: 'absolute',
105
92
  pointerEvents: 'none', // This is a decorative element we don't want it to block clicks to input
106
93
  },
@@ -126,8 +113,8 @@ const CheckboxInput = styled('input')<CheckboxProps & StyledType>(
126
113
  variant,
127
114
  }) => ({
128
115
  borderRadius: borderRadius.s,
129
- width: checkboxTapArea,
130
- height: checkboxTapArea,
116
+ width: space.m,
117
+ height: space.m,
131
118
  margin: 0,
132
119
  marginTop: '-3px',
133
120
  marginLeft: '-3px',
@@ -139,11 +126,12 @@ const CheckboxInput = styled('input')<CheckboxProps & StyledType>(
139
126
  },
140
127
 
141
128
  // States
142
- '&:not(:checked):not(:indeterminate):not(:disabled):not(:focus):hover, &:not(:checked):not(:indeterminate):not(:disabled):active': {
143
- '~ div:first-of-type': {
144
- borderColor: variant === 'inverse' ? colors.soap300 : inputColors.hoverBorder,
129
+ '&:not(:checked):not(:indeterminate):not(:disabled):not(:focus):hover, &:not(:checked):not(:indeterminate):not(:disabled):active':
130
+ {
131
+ '~ div:first-of-type': {
132
+ borderColor: variant === 'inverse' ? colors.soap300 : inputColors.hoverBorder,
133
+ },
145
134
  },
146
- },
147
135
  '&:checked ~ div:first-of-type, &:indeterminate ~ div:first-of-type': {
148
136
  borderColor: variant === 'inverse' ? colors.soap300 : themePrimary.main,
149
137
  backgroundColor: variant === 'inverse' ? colors.frenchVanilla100 : themePrimary.main,
@@ -210,7 +198,9 @@ const CheckboxInput = styled('input')<CheckboxProps & StyledType>(
210
198
  }),
211
199
  ({disabled}) => ({
212
200
  '&:hover ~ span:first-of-type': {
213
- boxShadow: disabled ? undefined : `0 0 0 ${rippleRadius}rem ${colors.soap200}`,
201
+ boxShadow: disabled
202
+ ? undefined
203
+ : `0 0 0 calc((${space.l} - (${space.s} + 2px)) / 2) ${colors.soap200}`,
214
204
  },
215
205
  }),
216
206
  ({theme, error, variant}) => {
@@ -226,11 +216,12 @@ const CheckboxInput = styled('input')<CheckboxProps & StyledType>(
226
216
  variant === 'inverse' ? `1px solid ${colors.soap300}` : `1px solid ${errorColors.inner}`,
227
217
  boxShadow: `0 0 0 1px ${errorColors.inner}, 0 0 0 2px ${errorColors.outer}`,
228
218
  },
229
- '&:not(:checked):not(:indeterminate):not(:disabled):not(:focus):hover, &:not(:checked):not(:indeterminate):not(:disabled):active': {
230
- '~ div:first-of-type': {
231
- borderColor: variant === 'inverse' ? `1px solid ${colors.soap300}` : errorColors.inner,
219
+ '&:not(:checked):not(:indeterminate):not(:disabled):not(:focus):hover, &:not(:checked):not(:indeterminate):not(:disabled):active':
220
+ {
221
+ '~ div:first-of-type': {
222
+ borderColor: variant === 'inverse' ? `1px solid ${colors.soap300}` : errorColors.inner,
223
+ },
232
224
  },
233
- },
234
225
  '&:checked ~ div:first-of-type, &:indeterminate ~ div:first-of-type': {
235
226
  borderColor: variant === 'inverse' ? colors.soap300 : theme.canvas.palette.primary.main,
236
227
  boxShadow: `
@@ -260,13 +251,13 @@ const CheckboxBackground = styled('div')<CheckboxProps>(
260
251
  borderRadius: borderRadius.s,
261
252
  boxSizing: 'border-box',
262
253
  display: 'flex',
263
- height: `${checkboxHeight}rem`,
254
+ height: `calc(${space.s} + 2px)`,
264
255
  justifyContent: 'center',
265
256
  padding: '0px 2px',
266
257
  pointerEvents: 'none',
267
258
  position: 'absolute',
268
259
  transition: 'border 200ms ease, background 200ms',
269
- width: `${checkboxWidth}rem`,
260
+ width: `calc(${space.s} + 2px)`,
270
261
  },
271
262
  ({variant}) => ({
272
263
  border: `1px solid ${variant === 'inverse' ? colors.soap300 : inputColors.border}`,
@@ -373,7 +364,7 @@ export const Checkbox = createComponent('input')({
373
364
  htmlFor={inputId}
374
365
  disabled={disabled}
375
366
  variant={variant}
376
- paddingInlineStart={checkboxLabelDistance}
367
+ paddingInlineStart={space.xs}
377
368
  cursor="pointer"
378
369
  >
379
370
  {label}
@@ -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,EAEV,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;;CA2EnB,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,EAEV,MAAM,kCAAkC,CAAC;AAM1C,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;AAkPD,eAAO,MAAM,QAAQ;;CA2EnB,CAAC"}
@@ -26,16 +26,10 @@ 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 = (tokens_1.spaceNumbers.xl - tokens_1.spaceNumbers.xxxs) / 2;
30
- const checkboxTapArea = tokens_1.space.m;
31
- const checkboxContainerHeight = checkboxTapArea;
32
- const checkboxLabelDistance = `${tokens_1.spaceNumbers.xs}rem`;
33
- const checkboxWidth = checkboxHeight;
34
- const rippleRadius = (tokens_1.spaceNumbers.l - checkboxWidth) / 2;
35
29
  const CheckboxContainer = common_1.styled('div')({
36
30
  display: 'flex',
37
31
  alignItems: 'center',
38
- minHeight: checkboxContainerHeight,
32
+ minHeight: tokens_1.space.m,
39
33
  position: 'relative',
40
34
  });
41
35
  /**
@@ -45,17 +39,17 @@ const CheckboxContainer = common_1.styled('div')({
45
39
  */
46
40
  const CheckboxInputWrapper = common_1.styled('div')({
47
41
  display: 'flex',
48
- height: `${checkboxHeight}rem`,
49
- minWidth: `${checkboxWidth}rem`,
42
+ height: `calc(${tokens_1.space.s} + 2px)`,
43
+ minWidth: `calc(${tokens_1.space.s} + 2px)`,
50
44
  marginTop: '3px',
51
45
  alignSelf: 'flex-start',
52
46
  });
53
47
  const CheckboxRipple = common_1.styled('span')({
54
48
  borderRadius: tokens_1.borderRadius.circle,
55
49
  boxShadow: `0 0 0 0 ${tokens_1.colors.soap200}`,
56
- height: `${checkboxHeight}rem`,
50
+ height: `calc(${tokens_1.space.s} + 2px)`,
57
51
  transition: 'box-shadow 150ms ease-out',
58
- width: `${checkboxWidth}rem`,
52
+ width: `calc(${tokens_1.space.s} + 2px)`,
59
53
  position: 'absolute',
60
54
  pointerEvents: 'none', // This is a decorative element we don't want it to block clicks to input
61
55
  }, ({ variant }) => ({
@@ -67,8 +61,8 @@ const CheckboxRipple = common_1.styled('span')({
67
61
  */
68
62
  const CheckboxInput = common_1.styled('input')(({ theme: { canvas: { palette: { primary: themePrimary, common: { focusOutline: themeFocusOutline }, }, }, }, variant, }) => ({
69
63
  borderRadius: tokens_1.borderRadius.s,
70
- width: checkboxTapArea,
71
- height: checkboxTapArea,
64
+ width: tokens_1.space.m,
65
+ height: tokens_1.space.m,
72
66
  margin: 0,
73
67
  marginTop: '-3px',
74
68
  marginLeft: '-3px',
@@ -146,7 +140,9 @@ const CheckboxInput = common_1.styled('input')(({ theme: { canvas: { palette: {
146
140
  }),
147
141
  }), ({ disabled }) => ({
148
142
  '&:hover ~ span:first-of-type': {
149
- boxShadow: disabled ? undefined : `0 0 0 ${rippleRadius}rem ${tokens_1.colors.soap200}`,
143
+ boxShadow: disabled
144
+ ? undefined
145
+ : `0 0 0 calc((${tokens_1.space.l} - (${tokens_1.space.s} + 2px)) / 2) ${tokens_1.colors.soap200}`,
150
146
  },
151
147
  }), ({ theme, error, variant }) => {
152
148
  const errorColors = common_1.getErrorColors(error, theme);
@@ -189,13 +185,13 @@ const CheckboxBackground = common_1.styled('div')({
189
185
  borderRadius: tokens_1.borderRadius.s,
190
186
  boxSizing: 'border-box',
191
187
  display: 'flex',
192
- height: `${checkboxHeight}rem`,
188
+ height: `calc(${tokens_1.space.s} + 2px)`,
193
189
  justifyContent: 'center',
194
190
  padding: '0px 2px',
195
191
  pointerEvents: 'none',
196
192
  position: 'absolute',
197
193
  transition: 'border 200ms ease, background 200ms',
198
- width: `${checkboxWidth}rem`,
194
+ width: `calc(${tokens_1.space.s} + 2px)`,
199
195
  }, ({ variant }) => ({
200
196
  border: `1px solid ${variant === 'inverse' ? tokens_1.colors.soap300 : tokens_1.inputColors.border}`,
201
197
  }));
@@ -248,7 +244,7 @@ exports.Checkbox = common_1.createComponent('input')({
248
244
  React.createElement(CheckboxCheck, { checked: checked, indeterminate: indeterminate }, indeterminate ? (React.createElement(IndeterminateBox, { variant: variant })) : checked ? (React.createElement(icon_1.SystemIcon, { icon: canvas_system_icons_web_1.checkSmallIcon, color: variant === 'inverse'
249
245
  ? theme.canvas.palette.primary.main
250
246
  : theme.canvas.palette.primary.contrast })) : null))),
251
- label && (React.createElement(text_1.LabelText, { htmlFor: inputId, disabled: disabled, variant: variant, paddingInlineStart: checkboxLabelDistance, cursor: "pointer" }, label))));
247
+ label && (React.createElement(text_1.LabelText, { htmlFor: inputId, disabled: disabled, variant: variant, paddingInlineStart: tokens_1.space.xs, cursor: "pointer" }, label))));
252
248
  },
253
249
  subComponents: {
254
250
  ErrorType: common_1.ErrorType,
@@ -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;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"}
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;AAI1C,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;AA8ND,eAAO,MAAM,KAAK,kFAgDhB,CAAC"}
@@ -24,18 +24,11 @@ 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 = `${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
- const radioContainerHeight = radioTapArea;
32
- const radioLabelDistance = tokens_1.space.xs;
33
- const radioWidth = radioHeight;
34
- const rippleRadius = (tokens_1.spaceNumbers.l - radioWidth) / 2;
27
+ const radioBorderRadius = 9;
35
28
  const RadioContainer = common_1.styled('div')({
36
29
  display: 'flex',
37
30
  alignItems: 'center',
38
- minHeight: radioContainerHeight,
31
+ minHeight: tokens_1.space.m,
39
32
  position: 'relative',
40
33
  });
41
34
  /**
@@ -45,24 +38,24 @@ const RadioContainer = common_1.styled('div')({
45
38
  */
46
39
  const RadioInputWrapper = common_1.styled('div')({
47
40
  display: 'flex',
48
- height: `${radioHeight}rem`,
49
- width: `${radioWidth}rem`,
41
+ height: `calc(${tokens_1.space.s} + 2px)`,
42
+ width: `calc(${tokens_1.space.s} + 2px)`,
50
43
  });
51
44
  const RadioRipple = common_1.styled('span')({
52
45
  borderRadius: tokens_1.borderRadius.circle,
53
46
  boxShadow: `0 0 0 0 ${tokens_1.colors.soap200}`,
54
- height: `${radioHeight}rem`,
47
+ height: `calc(${tokens_1.space.s} + 2px)`,
55
48
  transition: 'box-shadow 150ms ease-out',
56
- width: `${radioWidth}rem`,
49
+ width: `calc(${tokens_1.space.s} + 2px)`,
57
50
  position: 'absolute',
58
51
  pointerEvents: 'none', // This is a decorative element we don't want it to block clicks to input
59
52
  }, ({ variant }) => ({
60
53
  opacity: variant === 'inverse' ? '0.4' : '1',
61
54
  }));
62
55
  const RadioInput = common_1.styled('input')({
63
- borderRadius: radioBorderRadius,
64
- width: radioTapArea,
65
- height: radioTapArea,
56
+ borderRadius: `calc(${tokens_1.space.xxs} + 1px)`,
57
+ width: tokens_1.space.m,
58
+ height: tokens_1.space.m,
66
59
  margin: 0,
67
60
  marginTop: '-3px',
68
61
  marginLeft: '-3px',
@@ -84,7 +77,9 @@ const RadioInput = common_1.styled('input')({
84
77
  // `span:first-of-type` refers to `RadioRipple`, the light grey
85
78
  // element that animates around the component on hover
86
79
  '&:hover ~ span:first-of-type': {
87
- boxShadow: disabled ? undefined : `0 0 0 ${rippleRadius}rem ${tokens_1.colors.soap200}`,
80
+ boxShadow: disabled
81
+ ? undefined
82
+ : `0 0 0 calc((${tokens_1.space.l} - (${tokens_1.space.s} + 2px)) / 2) ${tokens_1.colors.soap200}`,
88
83
  },
89
84
  // `div:first-of-type` refers to the `RadioBackground`, the visual facade of the
90
85
  // input (which is visually hidden)
@@ -163,13 +158,13 @@ const RadioBackground = common_1.styled('div')({
163
158
  borderWidth: '1px',
164
159
  boxSizing: 'border-box',
165
160
  display: 'flex',
166
- height: `${radioHeight}rem`,
161
+ height: `calc(${tokens_1.space.s} + 2px)`,
167
162
  justifyContent: 'center',
168
163
  padding: '0px 2px',
169
164
  pointerEvents: 'none',
170
165
  position: 'absolute',
171
166
  transition: 'border 200ms ease, background 200ms',
172
- width: `${radioWidth}rem`,
167
+ width: `calc(${tokens_1.space.s} + 2px)`,
173
168
  }, ({ checked, disabled, variant, theme: { canvas: { palette: { primary: themePrimary }, }, }, }) => ({
174
169
  borderColor: checked
175
170
  ? variant === 'inverse'
@@ -193,10 +188,10 @@ const RadioCheck = common_1.styled('div')({
193
188
  borderRadius: radioBorderRadius,
194
189
  display: 'flex',
195
190
  flexDirection: 'column',
196
- height: radioDot,
191
+ height: tokens_1.space.xxs,
197
192
  pointerEvents: 'none',
198
193
  transition: 'transform 200ms ease, opacity 200ms ease',
199
- width: radioDot,
194
+ width: tokens_1.space.xxs,
200
195
  }, ({ theme, variant }) => ({
201
196
  backgroundColor: variant === 'inverse'
202
197
  ? theme.canvas.palette.primary.main
@@ -215,6 +210,6 @@ exports.Radio = common_1.createComponent('input')({
215
210
  React.createElement(RadioRipple, { variant: variant }),
216
211
  React.createElement(RadioBackground, { checked: checked, disabled: disabled, variant: variant },
217
212
  React.createElement(RadioCheck, { checked: checked, variant: variant }))),
218
- label && (React.createElement(text_1.LabelText, { paddingLeft: radioLabelDistance, htmlFor: inputId, disabled: disabled, variant: variant }, label))));
213
+ label && (React.createElement(text_1.LabelText, { paddingLeft: tokens_1.space.xs, htmlFor: inputId, disabled: disabled, variant: variant }, label))));
219
214
  },
220
215
  });
@@ -3,8 +3,7 @@ export declare const borderWidth = 1;
3
3
  export declare const borderColor: string;
4
4
  export declare const cellBorder: string;
5
5
  /**
6
- * @deprecated ⚠️ `Table` has been deprecated and will be removed in a future major version.
7
- * Please consider using [`Table in Preview`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) instead.
6
+ * @deprecated ⚠️ `Table` has been deprecated and will be removed in a future major version. Please use [`Table`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) in Preview instead.
8
7
  */
9
8
  export declare class Table extends React.Component<React.TableHTMLAttributes<HTMLTableElement>> {
10
9
  render(): JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../../table/lib/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,WAAW,QAAiB,CAAC;AAC1C,eAAO,MAAM,UAAU,QAA0C,CAAC;AAYlE;;;GAGG;AACH,qBAAa,KAAM,SAAQ,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAC9E,MAAM;CAKd"}
1
+ {"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../../table/lib/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,WAAW,QAAiB,CAAC;AAC1C,eAAO,MAAM,UAAU,QAA0C,CAAC;AAYlE;;GAEG;AACH,qBAAa,KAAM,SAAQ,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAC9E,MAAM;CAKd"}
@@ -39,8 +39,7 @@ const TableComponent = styled_1.default('table')(tokens_1.type.levels.subtext.la
39
39
  },
40
40
  });
41
41
  /**
42
- * @deprecated ⚠️ `Table` has been deprecated and will be removed in a future major version.
43
- * Please consider using [`Table in Preview`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) instead.
42
+ * @deprecated ⚠️ `Table` has been deprecated and will be removed in a future major version. Please use [`Table`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) in Preview instead.
44
43
  */
45
44
  class Table extends React.Component {
46
45
  render() {
@@ -1,8 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { StyledType } from '@workday/canvas-kit-react/common';
3
3
  /**
4
- * @deprecated ⚠️ `Table` has been deprecated and will be removed in a future major version.
5
- * Please consider using [`Table in Preview`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) instead.
4
+ * @deprecated ⚠️ `Table` has been deprecated and will be removed in a future major version. Please use [`Table`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) in Preview instead.
6
5
  */
7
6
  export declare enum TableRowState {
8
7
  Error = 0,
@@ -13,8 +12,7 @@ export declare enum TableRowState {
13
12
  Selected = 5
14
13
  }
15
14
  /**
16
- * @deprecated ⚠️ `Table` has been deprecated and will be removed in a future major version.
17
- * Please consider using [`Table in Preview`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) instead.
15
+ * @deprecated ⚠️ `Table` has been deprecated and will be removed in a future major version. Please use [`Table`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) in Preview instead.
18
16
  */
19
17
  export interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement> {
20
18
  /**
@@ -28,8 +26,7 @@ export interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement>
28
26
  header?: boolean;
29
27
  }
30
28
  /**
31
- * @deprecated ⚠️ `Table` has been deprecated and will be removed in a future major version.
32
- * Please consider using [`Table in Preview`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) instead.
29
+ * @deprecated ⚠️ `Table` has been deprecated and will be removed in a future major version. Please use [`Table`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) in Preview instead.
33
30
  */
34
31
  export declare const TableRow: import("@workday/canvas-kit-react/common").ElementComponent<"tr", TableRowProps & StyledType> & {
35
32
  State: typeof TableRowState;
@@ -1 +1 @@
1
- {"version":3,"file":"TableRow.d.ts","sourceRoot":"","sources":["../../../../table/lib/TableRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAkB,UAAU,EAAC,MAAM,kCAAkC,CAAC;AAG7E;;;GAGG;AACH,oBAAY,aAAa;IACvB,KAAK,IAAA;IACL,KAAK,IAAA;IACL,UAAU,IAAA;IACV,UAAU,IAAA;IACV,KAAK,IAAA;IACL,QAAQ,IAAA;CACT;AAED;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,KAAK,CAAC,cAAc,CAAC,mBAAmB,CAAC;IAC9E;;OAEG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IAEtB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAuKD;;;GAGG;AACH,eAAO,MAAM,QAAQ;;CAgBnB,CAAC"}
1
+ {"version":3,"file":"TableRow.d.ts","sourceRoot":"","sources":["../../../../table/lib/TableRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAkB,UAAU,EAAC,MAAM,kCAAkC,CAAC;AAG7E;;GAEG;AACH,oBAAY,aAAa;IACvB,KAAK,IAAA;IACL,KAAK,IAAA;IACL,UAAU,IAAA;IACV,UAAU,IAAA;IACV,KAAK,IAAA;IACL,QAAQ,IAAA;CACT;AAED;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,KAAK,CAAC,cAAc,CAAC,mBAAmB,CAAC;IAC9E;;OAEG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;IAEtB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAuKD;;GAEG;AACH,eAAO,MAAM,QAAQ;;CAgBnB,CAAC"}
@@ -30,8 +30,7 @@ const tokens_1 = require("@workday/canvas-kit-react/tokens");
30
30
  const common_1 = require("@workday/canvas-kit-react/common");
31
31
  const Table_1 = require("./Table");
32
32
  /**
33
- * @deprecated ⚠️ `Table` has been deprecated and will be removed in a future major version.
34
- * Please consider using [`Table in Preview`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) instead.
33
+ * @deprecated ⚠️ `Table` has been deprecated and will be removed in a future major version. Please use [`Table`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) in Preview instead.
35
34
  */
36
35
  var TableRowState;
37
36
  (function (TableRowState) {
@@ -106,7 +105,7 @@ const StyledTableRow = styled_1.default('tr')({
106
105
  fontSize: 13,
107
106
  borderRight: Table_1.cellBorder,
108
107
  borderBottom: Table_1.cellBorder,
109
- height: `${tokens_1.spaceNumbers.xl + tokens_1.spaceNumbers.xxs}rem`,
108
+ height: `calc(${tokens_1.space.xl} + ${tokens_1.space.xxs})`,
110
109
  boxSizing: 'border-box',
111
110
  transition: 'background-color 0.2s',
112
111
  },
@@ -194,8 +193,7 @@ const StyledTableRow = styled_1.default('tr')({
194
193
  }
195
194
  });
196
195
  /**
197
- * @deprecated ⚠️ `Table` has been deprecated and will be removed in a future major version.
198
- * Please consider using [`Table in Preview`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) instead.
196
+ * @deprecated ⚠️ `Table` has been deprecated and will be removed in a future major version. Please use [`Table`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) in Preview instead.
199
197
  */
200
198
  exports.TableRow = common_1.createComponent('tr')({
201
199
  displayName: 'TableRow',
@@ -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;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"}
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;AAG1C,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"}
@@ -38,7 +38,7 @@ const StyledTextArea = common_1.styled('textarea')(({ theme, error }) => ({
38
38
  borderRadius: tokens_1.borderRadius.m,
39
39
  boxSizing: 'border-box',
40
40
  minHeight: tokens_1.space.xxl,
41
- minWidth: `${tokens_1.spaceNumbers.xxxl * 3 + tokens_1.spaceNumbers.xl}rem`,
41
+ minWidth: `calc((${tokens_1.space.xxxl} * 3) + ${tokens_1.space.xl})`,
42
42
  transition: '0.2s box-shadow, 0.2s border-color',
43
43
  padding: tokens_1.space.xxs,
44
44
  margin: 0,
@@ -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}rem`,
35
+ padding: tokens_1.space.xxs,
36
36
  margin: 0,
37
37
  '&::placeholder': {
38
38
  color: tokens_1.inputColors.placeholder,
@@ -37,46 +37,59 @@ export declare type CanvasSpaceValues = ValueOf<CanvasSpace>;
37
37
  *
38
38
  * */
39
39
  export declare const space: CanvasSpace;
40
- /** Type for the `spaceNumbers` object with keys and numeric rem values (numbers) */
40
+ /**
41
+ * Example using `space` with calc instead of deprecated `spaceNumbers`.
42
+ *
43
+ * ```tsx
44
+ * // With deprecated `spaceNumbers`
45
+ * {
46
+ * paddingLeft: spaceNumbers.xl + 2 // 42px
47
+ * }
48
+ * ```
49
+ *
50
+ * ```tsx
51
+ * // With `rem` based `space` tokens
52
+ * {
53
+ * padding: `calc(${space.xl} + 2px)` // 42px
54
+ * }
55
+ * ```
56
+ *
57
+ * @deprecated ⚠️ `spaceNumbers` has been deprecated in a future major version. Please use our `rem` based [`space`](https://workday.github.io/canvas-kit/?path=/docs/tokens--space) tokens. In the case where you need to calculate a value, use [CSS calc()](https://developer.mozilla.org/en-US/docs/Web/CSS/calc).
58
+ */
41
59
  export declare type CanvasSpaceNumbers = {
42
60
  zero: 0;
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;
61
+ xxxs: 4;
62
+ xxs: 8;
63
+ xs: 12;
64
+ s: 16;
65
+ m: 24;
66
+ l: 32;
67
+ xl: 40;
68
+ xxl: 64;
69
+ xxxl: 80;
52
70
  };
53
- /** The numeric rem values for CanvasSpaceNumbers (numbers) */
71
+ /** The numeric rem values for CanvasSpaceNumbers (numbers)
72
+ * @deprecated ⚠️ `CanvasSpaceNumberValues` has been deprecated in a future major version. Please use our `rem` based [`space`](https://workday.github.io/canvas-kit/?path=/docs/tokens--space) tokens. In the case where you need to calculate a value, use [CSS calc()](https://developer.mozilla.org/en-US/docs/Web/CSS/calc).
73
+ */
54
74
  export declare type CanvasSpaceNumberValues = ValueOf<CanvasSpaceNumbers>;
55
75
  /**
56
- * An object of space keys and their numeric rem values (numbers)
57
- * - These are helpful when you need a raw numeric rem value.
58
- * - Here's an example usage to perform calculations:
59
- * @example
76
+ * Example using `space` with calc instead of deprecated `spaceNumbers`.
77
+ *
60
78
  * ```tsx
61
- * const buttonPaddingLeft = `${spaceNumbers.s + iconSize}rem`;
79
+ * // With deprecated `spaceNumbers`
80
+ * {
81
+ * paddingLeft: spaceNumbers.xl + 2 // 42px
82
+ * }
62
83
  * ```
63
84
  *
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 |
85
+ * ```tsx
86
+ * // With `rem` based `space` tokens
87
+ * {
88
+ * padding: `calc(${space.xl} + 2px)` // 42px
89
+ * }
90
+ * ```
79
91
  *
92
+ * @deprecated ⚠️ `spaceNumbers` has been deprecated in a future major version. Please use our `rem` based [`space`](https://workday.github.io/canvas-kit/?path=/docs/tokens--space) tokens. In the case where you need to calculate a value, use [CSS calc()](https://developer.mozilla.org/en-US/docs/Web/CSS/calc).
80
93
  */
81
94
  export declare const spaceNumbers: CanvasSpaceNumbers;
82
95
  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,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
+ {"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;;;;;;;;;;;;;;;;;;GAkBG;AACH,oBAAY,kBAAkB,GAAG;IAC/B,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,EAAE,CAAC,CAAC;IACR,GAAG,EAAE,CAAC,CAAC;IACP,EAAE,EAAE,EAAE,CAAC;IACP,CAAC,EAAE,EAAE,CAAC;IACN,CAAC,EAAE,EAAE,CAAC;IACN,CAAC,EAAE,EAAE,CAAC;IACN,EAAE,EAAE,EAAE,CAAC;IACP,GAAG,EAAE,EAAE,CAAC;IACR,IAAI,EAAE,EAAE,CAAC;CACV,CAAC;AAEF;;GAEG;AACH,oBAAY,uBAAuB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAElE;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,YAAY,EAAE,kBAW1B,CAAC"}
@@ -34,40 +34,33 @@ exports.space = {
34
34
  xxxl: '5rem',
35
35
  };
36
36
  /**
37
- * An object of space keys and their numeric rem values (numbers)
38
- * - These are helpful when you need a raw numeric rem value.
39
- * - Here's an example usage to perform calculations:
40
- * @example
37
+ * Example using `space` with calc instead of deprecated `spaceNumbers`.
38
+ *
41
39
  * ```tsx
42
- * const buttonPaddingLeft = `${spaceNumbers.s + iconSize}rem`;
40
+ * // With deprecated `spaceNumbers`
41
+ * {
42
+ * paddingLeft: spaceNumbers.xl + 2 // 42px
43
+ * }
43
44
  * ```
44
45
  *
45
- * Below is a table to show the equivalent values from `px` to `rem`.
46
- * This is based on the default browser font size which is `16px`.
47
- *
48
- * | px Value | rem Value | space token |
49
- * | --------- | --------- | ----------- |
50
- * | 0 | 0 | zero |
51
- * | 4px | 0.25rem | xxxs |
52
- * | 8px | 0.5rem | xxs |
53
- * | 12px | 0.75rem | xs |
54
- * | 16px | 1rem | s |
55
- * | 24px | 1.5rem | m |
56
- * | 32px | 2rem | l |
57
- * | 40px | 2.5rem | xl |
58
- * | 64px | 4rem | xxl |
59
- * | 80px | 5rem | xxxl |
46
+ * ```tsx
47
+ * // With `rem` based `space` tokens
48
+ * {
49
+ * padding: `calc(${space.xl} + 2px)` // 42px
50
+ * }
51
+ * ```
60
52
  *
53
+ * @deprecated ⚠️ `spaceNumbers` has been deprecated in a future major version. Please use our `rem` based [`space`](https://workday.github.io/canvas-kit/?path=/docs/tokens--space) tokens. In the case where you need to calculate a value, use [CSS calc()](https://developer.mozilla.org/en-US/docs/Web/CSS/calc).
61
54
  */
62
55
  exports.spaceNumbers = {
63
56
  zero: 0,
64
- xxxs: 0.25,
65
- xxs: 0.5,
66
- xs: 0.75,
67
- s: 1,
68
- m: 1.5,
69
- l: 2,
70
- xl: 2.5,
71
- xxl: 4,
72
- xxxl: 5,
57
+ xxxs: 4,
58
+ xxs: 8,
59
+ xs: 12,
60
+ s: 16,
61
+ m: 24,
62
+ l: 32,
63
+ xl: 40,
64
+ xxl: 64,
65
+ xxxl: 80,
73
66
  };
@@ -50,9 +50,9 @@ exports.TooltipContainer = styled_1.default('div')({
50
50
  },
51
51
  // offset tooltips by 2 pixels when a keyboard focus ring is detected
52
52
  '[data-whatinput=keyboard] &': {
53
- padding: `${tokens_1.spaceNumbers.s - 0.125}rem`,
53
+ padding: `calc(${tokens_1.space.s} - 0.125rem)`,
54
54
  ':before': {
55
- margin: `${tokens_1.spaceNumbers.xxxs + 0.125}rem`,
55
+ margin: `calc(${tokens_1.space.xxxs} + 0.125rem)`,
56
56
  },
57
57
  },
58
58
  // Hide tooltip when the reference element is either clipped or fully hidden