@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.
- package/checkbox/lib/Checkbox.tsx +24 -33
- package/dist/commonjs/checkbox/lib/Checkbox.d.ts.map +1 -1
- package/dist/commonjs/checkbox/lib/Checkbox.js +13 -17
- package/dist/commonjs/radio/lib/Radio.d.ts.map +1 -1
- package/dist/commonjs/radio/lib/Radio.js +17 -22
- package/dist/commonjs/table/lib/Table.d.ts +1 -2
- package/dist/commonjs/table/lib/Table.d.ts.map +1 -1
- package/dist/commonjs/table/lib/Table.js +1 -2
- package/dist/commonjs/table/lib/TableRow.d.ts +3 -6
- package/dist/commonjs/table/lib/TableRow.d.ts.map +1 -1
- package/dist/commonjs/table/lib/TableRow.js +3 -5
- package/dist/commonjs/text-area/lib/TextArea.d.ts.map +1 -1
- package/dist/commonjs/text-area/lib/TextArea.js +1 -1
- package/dist/commonjs/text-input/lib/TextInput.js +1 -1
- package/dist/commonjs/tokens/lib/space.d.ts +44 -31
- package/dist/commonjs/tokens/lib/space.d.ts.map +1 -1
- package/dist/commonjs/tokens/lib/space.js +22 -29
- package/dist/commonjs/tooltip/lib/TooltipContainer.js +2 -2
- package/dist/es6/checkbox/lib/Checkbox.d.ts.map +1 -1
- package/dist/es6/checkbox/lib/Checkbox.js +14 -18
- package/dist/es6/radio/lib/Radio.d.ts.map +1 -1
- package/dist/es6/radio/lib/Radio.js +18 -23
- package/dist/es6/table/lib/Table.d.ts +1 -2
- package/dist/es6/table/lib/Table.d.ts.map +1 -1
- package/dist/es6/table/lib/Table.js +1 -2
- package/dist/es6/table/lib/TableRow.d.ts +3 -6
- package/dist/es6/table/lib/TableRow.d.ts.map +1 -1
- package/dist/es6/table/lib/TableRow.js +4 -6
- package/dist/es6/text-area/lib/TextArea.d.ts.map +1 -1
- package/dist/es6/text-area/lib/TextArea.js +2 -2
- package/dist/es6/text-input/lib/TextInput.js +2 -2
- package/dist/es6/tokens/lib/space.d.ts +44 -31
- package/dist/es6/tokens/lib/space.d.ts.map +1 -1
- package/dist/es6/tokens/lib/space.js +22 -29
- package/dist/es6/tooltip/lib/TooltipContainer.js +3 -3
- package/package.json +4 -4
- package/radio/lib/Radio.tsx +18 -34
- package/table/lib/Table.tsx +1 -2
- package/table/lib/TableRow.tsx +5 -8
- package/text-area/lib/TextArea.tsx +2 -8
- package/text-input/lib/TextInput.tsx +2 -2
- package/tokens/README.md +25 -28
- package/tokens/lib/space.ts +53 -40
- package/tooltip/lib/TooltipContainer.tsx +3 -3
|
@@ -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;
|
|
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"}
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { createComponent, ErrorType, useUniqueId, focusRing, mouseFocusBehavior, getErrorColors, styled, useTheme, useLocalRef, } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import { borderRadius, colors, inputColors, space
|
|
3
|
+
import { borderRadius, colors, inputColors, space } from '@workday/canvas-kit-react/tokens';
|
|
4
4
|
import { SystemIcon } from '@workday/canvas-kit-react/icon';
|
|
5
5
|
import { checkSmallIcon } from '@workday/canvas-system-icons-web';
|
|
6
6
|
import { LabelText } from '@workday/canvas-kit-react/text';
|
|
7
|
-
const checkboxHeight = (spaceNumbers.xl - spaceNumbers.xxxs) / 2;
|
|
8
|
-
const checkboxTapArea = space.m;
|
|
9
|
-
const checkboxContainerHeight = checkboxTapArea;
|
|
10
|
-
const checkboxLabelDistance = `${spaceNumbers.xs}rem`;
|
|
11
|
-
const checkboxWidth = checkboxHeight;
|
|
12
|
-
const rippleRadius = (spaceNumbers.l - checkboxWidth) / 2;
|
|
13
7
|
const CheckboxContainer = styled('div')({
|
|
14
8
|
display: 'flex',
|
|
15
9
|
alignItems: 'center',
|
|
16
|
-
minHeight:
|
|
10
|
+
minHeight: space.m,
|
|
17
11
|
position: 'relative',
|
|
18
12
|
});
|
|
19
13
|
/**
|
|
@@ -23,17 +17,17 @@ const CheckboxContainer = styled('div')({
|
|
|
23
17
|
*/
|
|
24
18
|
const CheckboxInputWrapper = styled('div')({
|
|
25
19
|
display: 'flex',
|
|
26
|
-
height:
|
|
27
|
-
minWidth:
|
|
20
|
+
height: `calc(${space.s} + 2px)`,
|
|
21
|
+
minWidth: `calc(${space.s} + 2px)`,
|
|
28
22
|
marginTop: '3px',
|
|
29
23
|
alignSelf: 'flex-start',
|
|
30
24
|
});
|
|
31
25
|
const CheckboxRipple = styled('span')({
|
|
32
26
|
borderRadius: borderRadius.circle,
|
|
33
27
|
boxShadow: `0 0 0 0 ${colors.soap200}`,
|
|
34
|
-
height:
|
|
28
|
+
height: `calc(${space.s} + 2px)`,
|
|
35
29
|
transition: 'box-shadow 150ms ease-out',
|
|
36
|
-
width:
|
|
30
|
+
width: `calc(${space.s} + 2px)`,
|
|
37
31
|
position: 'absolute',
|
|
38
32
|
pointerEvents: 'none', // This is a decorative element we don't want it to block clicks to input
|
|
39
33
|
}, ({ variant }) => ({
|
|
@@ -45,8 +39,8 @@ const CheckboxRipple = styled('span')({
|
|
|
45
39
|
*/
|
|
46
40
|
const CheckboxInput = styled('input')(({ theme: { canvas: { palette: { primary: themePrimary, common: { focusOutline: themeFocusOutline }, }, }, }, variant, }) => ({
|
|
47
41
|
borderRadius: borderRadius.s,
|
|
48
|
-
width:
|
|
49
|
-
height:
|
|
42
|
+
width: space.m,
|
|
43
|
+
height: space.m,
|
|
50
44
|
margin: 0,
|
|
51
45
|
marginTop: '-3px',
|
|
52
46
|
marginLeft: '-3px',
|
|
@@ -124,7 +118,9 @@ const CheckboxInput = styled('input')(({ theme: { canvas: { palette: { primary:
|
|
|
124
118
|
}),
|
|
125
119
|
}), ({ disabled }) => ({
|
|
126
120
|
'&:hover ~ span:first-of-type': {
|
|
127
|
-
boxShadow: disabled
|
|
121
|
+
boxShadow: disabled
|
|
122
|
+
? undefined
|
|
123
|
+
: `0 0 0 calc((${space.l} - (${space.s} + 2px)) / 2) ${colors.soap200}`,
|
|
128
124
|
},
|
|
129
125
|
}), ({ theme, error, variant }) => {
|
|
130
126
|
const errorColors = getErrorColors(error, theme);
|
|
@@ -167,13 +163,13 @@ const CheckboxBackground = styled('div')({
|
|
|
167
163
|
borderRadius: borderRadius.s,
|
|
168
164
|
boxSizing: 'border-box',
|
|
169
165
|
display: 'flex',
|
|
170
|
-
height:
|
|
166
|
+
height: `calc(${space.s} + 2px)`,
|
|
171
167
|
justifyContent: 'center',
|
|
172
168
|
padding: '0px 2px',
|
|
173
169
|
pointerEvents: 'none',
|
|
174
170
|
position: 'absolute',
|
|
175
171
|
transition: 'border 200ms ease, background 200ms',
|
|
176
|
-
width:
|
|
172
|
+
width: `calc(${space.s} + 2px)`,
|
|
177
173
|
}, ({ variant }) => ({
|
|
178
174
|
border: `1px solid ${variant === 'inverse' ? colors.soap300 : inputColors.border}`,
|
|
179
175
|
}));
|
|
@@ -226,7 +222,7 @@ export const Checkbox = createComponent('input')({
|
|
|
226
222
|
React.createElement(CheckboxCheck, { checked: checked, indeterminate: indeterminate }, indeterminate ? (React.createElement(IndeterminateBox, { variant: variant })) : checked ? (React.createElement(SystemIcon, { icon: checkSmallIcon, color: variant === 'inverse'
|
|
227
223
|
? theme.canvas.palette.primary.main
|
|
228
224
|
: theme.canvas.palette.primary.contrast })) : null))),
|
|
229
|
-
label && (React.createElement(LabelText, { htmlFor: inputId, disabled: disabled, variant: variant, paddingInlineStart:
|
|
225
|
+
label && (React.createElement(LabelText, { htmlFor: inputId, disabled: disabled, variant: variant, paddingInlineStart: space.xs, cursor: "pointer" }, label))));
|
|
230
226
|
},
|
|
231
227
|
subComponents: {
|
|
232
228
|
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;
|
|
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"}
|
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { createComponent, focusRing, mouseFocusBehavior, styled, useUniqueId, } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import { borderRadius, colors, inputColors, space
|
|
3
|
+
import { borderRadius, colors, inputColors, space } from '@workday/canvas-kit-react/tokens';
|
|
4
4
|
import { LabelText } from '@workday/canvas-kit-react/text';
|
|
5
|
-
const radioBorderRadius =
|
|
6
|
-
const radioDot = space.xxs;
|
|
7
|
-
const radioHeight = (spaceNumbers.xl - spaceNumbers.xxxs) / 2;
|
|
8
|
-
const radioTapArea = space.m;
|
|
9
|
-
const radioContainerHeight = radioTapArea;
|
|
10
|
-
const radioLabelDistance = space.xs;
|
|
11
|
-
const radioWidth = radioHeight;
|
|
12
|
-
const rippleRadius = (spaceNumbers.l - radioWidth) / 2;
|
|
5
|
+
const radioBorderRadius = 9;
|
|
13
6
|
const RadioContainer = styled('div')({
|
|
14
7
|
display: 'flex',
|
|
15
8
|
alignItems: 'center',
|
|
16
|
-
minHeight:
|
|
9
|
+
minHeight: space.m,
|
|
17
10
|
position: 'relative',
|
|
18
11
|
});
|
|
19
12
|
/**
|
|
@@ -23,24 +16,24 @@ const RadioContainer = styled('div')({
|
|
|
23
16
|
*/
|
|
24
17
|
const RadioInputWrapper = styled('div')({
|
|
25
18
|
display: 'flex',
|
|
26
|
-
height:
|
|
27
|
-
width:
|
|
19
|
+
height: `calc(${space.s} + 2px)`,
|
|
20
|
+
width: `calc(${space.s} + 2px)`,
|
|
28
21
|
});
|
|
29
22
|
const RadioRipple = styled('span')({
|
|
30
23
|
borderRadius: borderRadius.circle,
|
|
31
24
|
boxShadow: `0 0 0 0 ${colors.soap200}`,
|
|
32
|
-
height:
|
|
25
|
+
height: `calc(${space.s} + 2px)`,
|
|
33
26
|
transition: 'box-shadow 150ms ease-out',
|
|
34
|
-
width:
|
|
27
|
+
width: `calc(${space.s} + 2px)`,
|
|
35
28
|
position: 'absolute',
|
|
36
29
|
pointerEvents: 'none', // This is a decorative element we don't want it to block clicks to input
|
|
37
30
|
}, ({ variant }) => ({
|
|
38
31
|
opacity: variant === 'inverse' ? '0.4' : '1',
|
|
39
32
|
}));
|
|
40
33
|
const RadioInput = styled('input')({
|
|
41
|
-
borderRadius:
|
|
42
|
-
width:
|
|
43
|
-
height:
|
|
34
|
+
borderRadius: `calc(${space.xxs} + 1px)`,
|
|
35
|
+
width: space.m,
|
|
36
|
+
height: space.m,
|
|
44
37
|
margin: 0,
|
|
45
38
|
marginTop: '-3px',
|
|
46
39
|
marginLeft: '-3px',
|
|
@@ -62,7 +55,9 @@ const RadioInput = styled('input')({
|
|
|
62
55
|
// `span:first-of-type` refers to `RadioRipple`, the light grey
|
|
63
56
|
// element that animates around the component on hover
|
|
64
57
|
'&:hover ~ span:first-of-type': {
|
|
65
|
-
boxShadow: disabled
|
|
58
|
+
boxShadow: disabled
|
|
59
|
+
? undefined
|
|
60
|
+
: `0 0 0 calc((${space.l} - (${space.s} + 2px)) / 2) ${colors.soap200}`,
|
|
66
61
|
},
|
|
67
62
|
// `div:first-of-type` refers to the `RadioBackground`, the visual facade of the
|
|
68
63
|
// input (which is visually hidden)
|
|
@@ -141,13 +136,13 @@ const RadioBackground = styled('div')({
|
|
|
141
136
|
borderWidth: '1px',
|
|
142
137
|
boxSizing: 'border-box',
|
|
143
138
|
display: 'flex',
|
|
144
|
-
height:
|
|
139
|
+
height: `calc(${space.s} + 2px)`,
|
|
145
140
|
justifyContent: 'center',
|
|
146
141
|
padding: '0px 2px',
|
|
147
142
|
pointerEvents: 'none',
|
|
148
143
|
position: 'absolute',
|
|
149
144
|
transition: 'border 200ms ease, background 200ms',
|
|
150
|
-
width:
|
|
145
|
+
width: `calc(${space.s} + 2px)`,
|
|
151
146
|
}, ({ checked, disabled, variant, theme: { canvas: { palette: { primary: themePrimary }, }, }, }) => ({
|
|
152
147
|
borderColor: checked
|
|
153
148
|
? variant === 'inverse'
|
|
@@ -171,10 +166,10 @@ const RadioCheck = styled('div')({
|
|
|
171
166
|
borderRadius: radioBorderRadius,
|
|
172
167
|
display: 'flex',
|
|
173
168
|
flexDirection: 'column',
|
|
174
|
-
height:
|
|
169
|
+
height: space.xxs,
|
|
175
170
|
pointerEvents: 'none',
|
|
176
171
|
transition: 'transform 200ms ease, opacity 200ms ease',
|
|
177
|
-
width:
|
|
172
|
+
width: space.xxs,
|
|
178
173
|
}, ({ theme, variant }) => ({
|
|
179
174
|
backgroundColor: variant === 'inverse'
|
|
180
175
|
? theme.canvas.palette.primary.main
|
|
@@ -193,6 +188,6 @@ export const Radio = createComponent('input')({
|
|
|
193
188
|
React.createElement(RadioRipple, { variant: variant }),
|
|
194
189
|
React.createElement(RadioBackground, { checked: checked, disabled: disabled, variant: variant },
|
|
195
190
|
React.createElement(RadioCheck, { checked: checked, variant: variant }))),
|
|
196
|
-
label && (React.createElement(LabelText, { paddingLeft:
|
|
191
|
+
label && (React.createElement(LabelText, { paddingLeft: space.xs, htmlFor: inputId, disabled: disabled, variant: variant }, label))));
|
|
197
192
|
},
|
|
198
193
|
});
|
|
@@ -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
|
|
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"}
|
|
@@ -14,8 +14,7 @@ const TableComponent = styled('table')(type.levels.subtext.large, {
|
|
|
14
14
|
},
|
|
15
15
|
});
|
|
16
16
|
/**
|
|
17
|
-
* @deprecated ⚠️ `Table` has been deprecated and will be removed in a future major version.
|
|
18
|
-
* Please consider using [`Table in Preview`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) instead.
|
|
17
|
+
* @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.
|
|
19
18
|
*/
|
|
20
19
|
export class Table extends React.Component {
|
|
21
20
|
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
|
|
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"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
3
|
import { rgba } from 'polished';
|
|
4
|
-
import { colors, space,
|
|
4
|
+
import { colors, space, statusColors } from '@workday/canvas-kit-react/tokens';
|
|
5
5
|
import { createComponent } from '@workday/canvas-kit-react/common';
|
|
6
6
|
import { borderColor, borderWidth, cellBorder } from './Table';
|
|
7
7
|
/**
|
|
8
|
-
* @deprecated ⚠️ `Table` has been deprecated and will be removed in a future major version.
|
|
9
|
-
* Please consider using [`Table in Preview`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) instead.
|
|
8
|
+
* @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.
|
|
10
9
|
*/
|
|
11
10
|
export var TableRowState;
|
|
12
11
|
(function (TableRowState) {
|
|
@@ -81,7 +80,7 @@ const StyledTableRow = styled('tr')({
|
|
|
81
80
|
fontSize: 13,
|
|
82
81
|
borderRight: cellBorder,
|
|
83
82
|
borderBottom: cellBorder,
|
|
84
|
-
height:
|
|
83
|
+
height: `calc(${space.xl} + ${space.xxs})`,
|
|
85
84
|
boxSizing: 'border-box',
|
|
86
85
|
transition: 'background-color 0.2s',
|
|
87
86
|
},
|
|
@@ -169,8 +168,7 @@ const StyledTableRow = styled('tr')({
|
|
|
169
168
|
}
|
|
170
169
|
});
|
|
171
170
|
/**
|
|
172
|
-
* @deprecated ⚠️ `Table` has been deprecated and will be removed in a future major version.
|
|
173
|
-
* Please consider using [`Table in Preview`](https://workday.github.io/canvas-kit/?path=/docs/preview-table--basic) instead.
|
|
171
|
+
* @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.
|
|
174
172
|
*/
|
|
175
173
|
export const TableRow = createComponent('tr')({
|
|
176
174
|
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;
|
|
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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { createComponent, ErrorType, errorRing, styled, } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import { borderRadius, inputColors, space,
|
|
3
|
+
import { borderRadius, inputColors, space, type } from '@workday/canvas-kit-react/tokens';
|
|
4
4
|
export var TextAreaResizeDirection;
|
|
5
5
|
(function (TextAreaResizeDirection) {
|
|
6
6
|
TextAreaResizeDirection["None"] = "none";
|
|
@@ -16,7 +16,7 @@ const StyledTextArea = styled('textarea')(({ theme, error }) => ({
|
|
|
16
16
|
borderRadius: borderRadius.m,
|
|
17
17
|
boxSizing: 'border-box',
|
|
18
18
|
minHeight: space.xxl,
|
|
19
|
-
minWidth:
|
|
19
|
+
minWidth: `calc((${space.xxxl} * 3) + ${space.xl})`,
|
|
20
20
|
transition: '0.2s box-shadow, 0.2s border-color',
|
|
21
21
|
padding: space.xxs,
|
|
22
22
|
margin: 0,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { createComponent, ErrorType, errorRing, styled, } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import { borderRadius, inputColors,
|
|
3
|
+
import { borderRadius, inputColors, space, type } from '@workday/canvas-kit-react/tokens';
|
|
4
4
|
const StyledTextInput = styled('input')({
|
|
5
5
|
...type.levels.subtext.large,
|
|
6
6
|
border: `1px solid ${inputColors.border}`,
|
|
@@ -10,7 +10,7 @@ const StyledTextInput = styled('input')({
|
|
|
10
10
|
boxSizing: 'border-box',
|
|
11
11
|
height: 40,
|
|
12
12
|
transition: '0.2s box-shadow, 0.2s border-color',
|
|
13
|
-
padding:
|
|
13
|
+
padding: space.xxs,
|
|
14
14
|
margin: 0,
|
|
15
15
|
'&::placeholder': {
|
|
16
16
|
color: inputColors.placeholder,
|
|
@@ -37,46 +37,59 @@ export declare type CanvasSpaceValues = ValueOf<CanvasSpace>;
|
|
|
37
37
|
*
|
|
38
38
|
* */
|
|
39
39
|
export declare const space: CanvasSpace;
|
|
40
|
-
/**
|
|
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:
|
|
44
|
-
xxs:
|
|
45
|
-
xs:
|
|
46
|
-
s:
|
|
47
|
-
m:
|
|
48
|
-
l:
|
|
49
|
-
xl:
|
|
50
|
-
xxl:
|
|
51
|
-
xxxl:
|
|
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
|
-
*
|
|
57
|
-
*
|
|
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
|
-
*
|
|
79
|
+
* // With deprecated `spaceNumbers`
|
|
80
|
+
* {
|
|
81
|
+
* paddingLeft: spaceNumbers.xl + 2 // 42px
|
|
82
|
+
* }
|
|
62
83
|
* ```
|
|
63
84
|
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
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
|
|
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"}
|
|
@@ -31,40 +31,33 @@ export const space = {
|
|
|
31
31
|
xxxl: '5rem',
|
|
32
32
|
};
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* - Here's an example usage to perform calculations:
|
|
37
|
-
* @example
|
|
34
|
+
* Example using `space` with calc instead of deprecated `spaceNumbers`.
|
|
35
|
+
*
|
|
38
36
|
* ```tsx
|
|
39
|
-
*
|
|
37
|
+
* // With deprecated `spaceNumbers`
|
|
38
|
+
* {
|
|
39
|
+
* paddingLeft: spaceNumbers.xl + 2 // 42px
|
|
40
|
+
* }
|
|
40
41
|
* ```
|
|
41
42
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
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 |
|
|
43
|
+
* ```tsx
|
|
44
|
+
* // With `rem` based `space` tokens
|
|
45
|
+
* {
|
|
46
|
+
* padding: `calc(${space.xl} + 2px)` // 42px
|
|
47
|
+
* }
|
|
48
|
+
* ```
|
|
57
49
|
*
|
|
50
|
+
* @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
51
|
*/
|
|
59
52
|
export const spaceNumbers = {
|
|
60
53
|
zero: 0,
|
|
61
|
-
xxxs:
|
|
62
|
-
xxs:
|
|
63
|
-
xs:
|
|
64
|
-
s:
|
|
65
|
-
m:
|
|
66
|
-
l:
|
|
67
|
-
xl:
|
|
68
|
-
xxl:
|
|
69
|
-
xxxl:
|
|
54
|
+
xxxs: 4,
|
|
55
|
+
xxs: 8,
|
|
56
|
+
xs: 12,
|
|
57
|
+
s: 16,
|
|
58
|
+
m: 24,
|
|
59
|
+
l: 32,
|
|
60
|
+
xl: 40,
|
|
61
|
+
xxl: 64,
|
|
62
|
+
xxxl: 80,
|
|
70
63
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { keyframes } from '@emotion/react';
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
|
-
import { borderRadius, colors, space,
|
|
3
|
+
import { borderRadius, colors, space, type } from '@workday/canvas-kit-react/tokens';
|
|
4
4
|
import { getTranslateFromOrigin } from '@workday/canvas-kit-react/common';
|
|
5
5
|
const tooltipAnimation = (transformOrigin) => {
|
|
6
6
|
const translate = getTranslateFromOrigin(transformOrigin, space.xxxs);
|
|
@@ -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:
|
|
47
|
+
padding: `calc(${space.s} - 0.125rem)`,
|
|
48
48
|
':before': {
|
|
49
|
-
margin:
|
|
49
|
+
margin: `calc(${space.xxxs} + 0.125rem)`,
|
|
50
50
|
},
|
|
51
51
|
},
|
|
52
52
|
// Hide tooltip when the reference element is either clipped or fully hidden
|
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.540-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,8 +49,8 @@
|
|
|
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.
|
|
53
|
-
"@workday/canvas-kit-styling": "^10.0.0-alpha.
|
|
52
|
+
"@workday/canvas-kit-popup-stack": "^10.0.0-alpha.540-next.0",
|
|
53
|
+
"@workday/canvas-kit-styling": "^10.0.0-alpha.540-next.0",
|
|
54
54
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
55
55
|
"@workday/canvas-tokens-web": "0.1.6",
|
|
56
56
|
"@workday/design-assets-types": "^0.2.8",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"@workday/canvas-accent-icons-web": "^3.0.0",
|
|
69
69
|
"@workday/canvas-applet-icons-web": "^2.0.0"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "fc8abdabca2c55aad11f09a8f05570bd55aa3478"
|
|
72
72
|
}
|