@workday/canvas-kit-react 10.0.0-alpha.444-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/popup/lib/Popper.d.ts +8 -0
- package/dist/commonjs/popup/lib/Popper.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/Popper.js +32 -8
- package/dist/commonjs/popup/lib/PopupPopper.d.ts +7 -0
- package/dist/commonjs/popup/lib/PopupPopper.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/fallbackPlacements.d.ts +9 -0
- package/dist/commonjs/popup/lib/fallbackPlacements.d.ts.map +1 -0
- package/dist/commonjs/popup/lib/fallbackPlacements.js +94 -0
- package/dist/commonjs/popup/lib/hooks/usePopupPopper.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/hooks/usePopupPopper.js +5 -2
- 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/OverflowTooltip.d.ts +8 -1
- package/dist/commonjs/tooltip/lib/OverflowTooltip.d.ts.map +1 -1
- package/dist/commonjs/tooltip/lib/OverflowTooltip.js +2 -2
- package/dist/commonjs/tooltip/lib/Tooltip.d.ts +7 -0
- package/dist/commonjs/tooltip/lib/Tooltip.d.ts.map +1 -1
- package/dist/commonjs/tooltip/lib/Tooltip.js +2 -2
- 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/popup/lib/Popper.d.ts +8 -0
- package/dist/es6/popup/lib/Popper.d.ts.map +1 -1
- package/dist/es6/popup/lib/Popper.js +31 -7
- package/dist/es6/popup/lib/PopupPopper.d.ts +7 -0
- package/dist/es6/popup/lib/PopupPopper.d.ts.map +1 -1
- package/dist/es6/popup/lib/fallbackPlacements.d.ts +9 -0
- package/dist/es6/popup/lib/fallbackPlacements.d.ts.map +1 -0
- package/dist/es6/popup/lib/fallbackPlacements.js +72 -0
- package/dist/es6/popup/lib/hooks/usePopupPopper.d.ts.map +1 -1
- package/dist/es6/popup/lib/hooks/usePopupPopper.js +5 -2
- 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/OverflowTooltip.d.ts +8 -1
- package/dist/es6/tooltip/lib/OverflowTooltip.d.ts.map +1 -1
- package/dist/es6/tooltip/lib/OverflowTooltip.js +3 -3
- package/dist/es6/tooltip/lib/Tooltip.d.ts +7 -0
- package/dist/es6/tooltip/lib/Tooltip.d.ts.map +1 -1
- package/dist/es6/tooltip/lib/Tooltip.js +3 -3
- package/dist/es6/tooltip/lib/TooltipContainer.js +8 -8
- package/package.json +3 -3
- package/popup/lib/Popper.tsx +39 -6
- package/popup/lib/PopupPopper.tsx +7 -0
- package/popup/lib/fallbackPlacements.ts +90 -0
- package/popup/lib/hooks/usePopupPopper.ts +6 -2
- 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/OverflowTooltip.tsx +15 -2
- package/tooltip/lib/Tooltip.tsx +15 -2
- package/tooltip/lib/TooltipContainer.tsx +8 -8
|
@@ -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"}
|
|
@@ -1,35 +1,73 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.spaceNumbers = exports.space = void 0;
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* An object of space keys and rem values (strings)
|
|
6
|
+
*
|
|
7
|
+
* Below is a table to show the equivalent values from `px` to `rem`.
|
|
8
|
+
* This is based on the default browser font size which is `16px`.
|
|
9
|
+
*
|
|
10
|
+
* | px Value | rem Value | space token |
|
|
11
|
+
* | --------- | --------- | ----------- |
|
|
12
|
+
* | 0 | 0 | zero |
|
|
13
|
+
* | 4px | 0.25rem | xxxs |
|
|
14
|
+
* | 8px | 0.5rem | xxs |
|
|
15
|
+
* | 12px | 0.75rem | xs |
|
|
16
|
+
* | 16px | 1rem | s |
|
|
17
|
+
* | 24px | 1.5rem | m |
|
|
18
|
+
* | 32px | 2rem | l |
|
|
19
|
+
* | 40px | 2.5rem | xl |
|
|
20
|
+
* | 64px | 4rem | xxl |
|
|
21
|
+
* | 80px | 5rem | xxxl |
|
|
22
|
+
*
|
|
23
|
+
* */
|
|
5
24
|
exports.space = {
|
|
6
|
-
zero: '
|
|
7
|
-
xxxs: '
|
|
8
|
-
xxs: '
|
|
9
|
-
xs: '
|
|
10
|
-
s: '
|
|
11
|
-
m: '
|
|
12
|
-
l: '
|
|
13
|
-
xl: '
|
|
14
|
-
xxl: '
|
|
15
|
-
xxxl: '
|
|
25
|
+
zero: '0',
|
|
26
|
+
xxxs: '0.25rem',
|
|
27
|
+
xxs: '0.5rem',
|
|
28
|
+
xs: '0.75rem',
|
|
29
|
+
s: '1rem',
|
|
30
|
+
m: '1.5rem',
|
|
31
|
+
l: '2rem',
|
|
32
|
+
xl: '2.5rem',
|
|
33
|
+
xxl: '4rem',
|
|
34
|
+
xxxl: '5rem',
|
|
16
35
|
};
|
|
17
36
|
/**
|
|
18
|
-
* An object of space keys and their numeric
|
|
19
|
-
* - These are helpful when you need a raw numeric
|
|
37
|
+
* An object of space keys and their numeric rem values (numbers)
|
|
38
|
+
* - These are helpful when you need a raw numeric rem value.
|
|
20
39
|
* - Here's an example usage to perform calculations:
|
|
21
40
|
* @example
|
|
22
|
-
*
|
|
41
|
+
* ```tsx
|
|
42
|
+
* const buttonPaddingLeft = `${spaceNumbers.s + iconSize}rem`;
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
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 |
|
|
60
|
+
*
|
|
23
61
|
*/
|
|
24
62
|
exports.spaceNumbers = {
|
|
25
63
|
zero: 0,
|
|
26
|
-
xxxs:
|
|
27
|
-
xxs:
|
|
28
|
-
xs:
|
|
29
|
-
s:
|
|
30
|
-
m:
|
|
31
|
-
l:
|
|
32
|
-
xl:
|
|
33
|
-
xxl:
|
|
34
|
-
xxxl:
|
|
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,
|
|
35
73
|
};
|
|
@@ -25,6 +25,13 @@ export interface OverflowTooltipProps extends Omit<React.HTMLAttributes<HTMLDivE
|
|
|
25
25
|
* @default 'top'
|
|
26
26
|
*/
|
|
27
27
|
placement?: Placement;
|
|
28
|
+
/**
|
|
29
|
+
* Define fallback placements by providing a list of {@link Placement} in array (in order of preference).
|
|
30
|
+
* The default preference is following the order of `top`, `right`, `bottom`, and `left`. Once the initial
|
|
31
|
+
* and opposite placements are not available, the fallback placements will be in use. Use an empty array to
|
|
32
|
+
* disable the fallback placements.
|
|
33
|
+
*/
|
|
34
|
+
fallbackPlacements?: Placement[];
|
|
28
35
|
}
|
|
29
|
-
export declare const OverflowTooltip: ({ placement, children, ...elemProps }: OverflowTooltipProps) => JSX.Element;
|
|
36
|
+
export declare const OverflowTooltip: ({ placement, fallbackPlacements, children, ...elemProps }: OverflowTooltipProps) => JSX.Element;
|
|
30
37
|
//# sourceMappingURL=OverflowTooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverflowTooltip.d.ts","sourceRoot":"","sources":["../../../../tooltip/lib/OverflowTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,
|
|
1
|
+
{"version":3,"file":"OverflowTooltip.d.ts","sourceRoot":"","sources":["../../../../tooltip/lib/OverflowTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAEL,SAAS,EAGV,MAAM,iCAAiC,CAAC;AAMzC;;;GAGG;AACH,eAAO,MAAM,mBAAmB,YAAa,OAAO,KAAG,OAAO,GAAG,IAmBhE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,YAAa,OAAO,KAAG,OAAO,GAAG,IAahE,CAAC;AAcF,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAC/F;;;;;;;OAOG;IACH,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAClC;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,SAAS,EAAE,CAAC;CAClC;AAiBD,eAAO,MAAM,eAAe,8DAKzB,oBAAoB,gBAwCtB,CAAC"}
|
|
@@ -88,7 +88,7 @@ function mergeCallbacks(elemProps, componentProps, keys = Object.keys(componentP
|
|
|
88
88
|
return mergedProps;
|
|
89
89
|
}, {});
|
|
90
90
|
}
|
|
91
|
-
const OverflowTooltip = ({ placement = 'top', children, ...elemProps }) => {
|
|
91
|
+
const OverflowTooltip = ({ placement = 'top', fallbackPlacements = popup_1.defaultFallbackPlacements, children, ...elemProps }) => {
|
|
92
92
|
const [titleText, setTitleText] = React.useState('');
|
|
93
93
|
const { targetProps, popperProps, tooltipProps } = useTooltip_1.useTooltip({ type: 'muted' });
|
|
94
94
|
const onMouseEnter = (event) => {
|
|
@@ -113,7 +113,7 @@ const OverflowTooltip = ({ placement = 'top', children, ...elemProps }) => {
|
|
|
113
113
|
'aria-label': undefined,
|
|
114
114
|
...mergeCallbacks({ ...targetProps, onMouseEnter, onFocus }, children.props),
|
|
115
115
|
}),
|
|
116
|
-
React.createElement(popup_1.Popper, Object.assign({ placement: placement }, popperProps), ({ placement }) => {
|
|
116
|
+
React.createElement(popup_1.Popper, Object.assign({ placement: placement, fallbackPlacements: fallbackPlacements }, popperProps), ({ placement }) => {
|
|
117
117
|
const transformOrigin = popup_1.getTransformFromPlacement(placement);
|
|
118
118
|
return (React.createElement(TooltipContainer_1.TooltipContainer, Object.assign({ transformOrigin: transformOrigin }, tooltipProps, elemProps), titleText));
|
|
119
119
|
})));
|
|
@@ -20,6 +20,13 @@ export interface TooltipProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
|
|
|
20
20
|
* @default 'top'
|
|
21
21
|
*/
|
|
22
22
|
placement?: Placement;
|
|
23
|
+
/**
|
|
24
|
+
* Define fallback placements by providing a list of {@link Placement} in array (in order of preference).
|
|
25
|
+
* The default preference is following the order of `top`, `right`, `bottom`, and `left`. Once the initial
|
|
26
|
+
* and opposite placements are not available, the fallback placements will be in use. Use an empty array to
|
|
27
|
+
* disable the fallback placements.
|
|
28
|
+
*/
|
|
29
|
+
fallbackPlacements?: Placement[];
|
|
23
30
|
/**
|
|
24
31
|
* Determines the tooltip type for accessibility.
|
|
25
32
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../tooltip/lib/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../tooltip/lib/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAEL,SAAS,EAGV,MAAM,iCAAiC,CAAC;AAMzC,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IACvF;;;OAGG;IACH,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;;;;;;OAOG;IACH,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAClC;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,SAAS,EAAE,CAAC;IACjC;;;;;;;;;;;;;;;OAeG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,OAAO,CAAC;IACtC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAiBD,eAAO,MAAM,OAAO,kFA0ClB,CAAC"}
|
|
@@ -42,7 +42,7 @@ function mergeCallbacks(elemProps, componentProps, keys = Object.keys(componentP
|
|
|
42
42
|
}
|
|
43
43
|
exports.Tooltip = common_1.createComponent('div')({
|
|
44
44
|
displayName: 'Tooltip',
|
|
45
|
-
Component({ type = 'label', placement = 'top', title, children, showDelay = 300, hideDelay = 100, ...elemProps }) {
|
|
45
|
+
Component({ type = 'label', placement = 'top', title, children, showDelay = 300, hideDelay = 100, fallbackPlacements = popup_1.defaultFallbackPlacements, ...elemProps }) {
|
|
46
46
|
const titleText = react_innertext_1.default(title);
|
|
47
47
|
const { targetProps, popperProps, tooltipProps } = useTooltip_1.useTooltip({
|
|
48
48
|
type,
|
|
@@ -58,7 +58,7 @@ exports.Tooltip = common_1.createComponent('div')({
|
|
|
58
58
|
? { 'aria-label': children.props['aria-label'] }
|
|
59
59
|
: {}),
|
|
60
60
|
}),
|
|
61
|
-
React.createElement(popup_1.Popper, Object.assign({ placement: placement }, popperProps), ({ placement }) => {
|
|
61
|
+
React.createElement(popup_1.Popper, Object.assign({ placement: placement, fallbackPlacements: fallbackPlacements }, popperProps), ({ placement }) => {
|
|
62
62
|
const transformOrigin = popup_1.getTransformFromPlacement(placement);
|
|
63
63
|
return (React.createElement(TooltipContainer_1.TooltipContainer, Object.assign({ transformOrigin: transformOrigin }, elemProps, tooltipProps), title));
|
|
64
64
|
})));
|
|
@@ -29,7 +29,7 @@ exports.TooltipContainer = styled_1.default('div')({
|
|
|
29
29
|
...tokens_1.type.levels.subtext.medium,
|
|
30
30
|
display: 'inline-flex',
|
|
31
31
|
position: 'relative',
|
|
32
|
-
padding: tokens_1.
|
|
32
|
+
padding: tokens_1.space.xs,
|
|
33
33
|
color: tokens_1.colors.frenchVanilla100,
|
|
34
34
|
a: {
|
|
35
35
|
color: tokens_1.colors.frenchVanilla100,
|
|
@@ -40,7 +40,7 @@ exports.TooltipContainer = styled_1.default('div')({
|
|
|
40
40
|
content: '""',
|
|
41
41
|
borderRadius: tokens_1.borderRadius.m,
|
|
42
42
|
zIndex: -1,
|
|
43
|
-
margin: tokens_1.
|
|
43
|
+
margin: tokens_1.space.xxxs,
|
|
44
44
|
backgroundColor: 'rgba(0,0,0,.85)',
|
|
45
45
|
position: 'absolute',
|
|
46
46
|
top: 0,
|
|
@@ -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.
|
|
53
|
+
padding: `${tokens_1.spaceNumbers.s - 0.125}rem`,
|
|
54
54
|
':before': {
|
|
55
|
-
margin: tokens_1.spaceNumbers.xxxs +
|
|
55
|
+
margin: `${tokens_1.spaceNumbers.xxxs + 0.125}rem`,
|
|
56
56
|
},
|
|
57
57
|
},
|
|
58
58
|
// Hide tooltip when the reference element is either clipped or fully hidden
|
|
@@ -62,16 +62,16 @@ exports.TooltipContainer = styled_1.default('div')({
|
|
|
62
62
|
},
|
|
63
63
|
// Fix offsets based on placement
|
|
64
64
|
'[data-popper-placement="top-start"] &, [data-popper-placement="bottom-start"] &': {
|
|
65
|
-
left:
|
|
65
|
+
left: `-${tokens_1.space.xxxs}`,
|
|
66
66
|
},
|
|
67
67
|
'[data-popper-placement="top-end"] &, [data-popper-placement="bottom-end"] &': {
|
|
68
|
-
right:
|
|
68
|
+
right: `-${tokens_1.space.xxxs}`,
|
|
69
69
|
},
|
|
70
70
|
'[data-popper-placement="left-start"] &, [data-popper-placement="right-start"] &': {
|
|
71
|
-
top:
|
|
71
|
+
top: `-${tokens_1.space.xxxs}`,
|
|
72
72
|
},
|
|
73
73
|
'[data-popper-placement="left-end"] &, [data-popper-placement="right-end"] &': {
|
|
74
|
-
bottom:
|
|
74
|
+
bottom: `-${tokens_1.space.xxxs}`,
|
|
75
75
|
},
|
|
76
76
|
}, ({ transformOrigin = defaultTransformOrigin }) => {
|
|
77
77
|
if (transformOrigin === null) {
|
|
@@ -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"}
|
|
@@ -64,7 +64,7 @@ const ButtonContainer = styled('button')({
|
|
|
64
64
|
fontWeight: type.properties.fontWeights.bold,
|
|
65
65
|
height: '48px',
|
|
66
66
|
'& > * ': {
|
|
67
|
-
margin: `0 ${
|
|
67
|
+
margin: `0 ${space.xxxs}`,
|
|
68
68
|
},
|
|
69
69
|
};
|
|
70
70
|
case 'medium':
|
|
@@ -72,14 +72,14 @@ const ButtonContainer = styled('button')({
|
|
|
72
72
|
return {
|
|
73
73
|
height: space.xl,
|
|
74
74
|
'& > * ': {
|
|
75
|
-
margin: `0 ${
|
|
75
|
+
margin: `0 ${space.xxxs}`,
|
|
76
76
|
},
|
|
77
77
|
};
|
|
78
78
|
case 'small':
|
|
79
79
|
return {
|
|
80
80
|
height: space.l,
|
|
81
81
|
'& > * ': {
|
|
82
|
-
margin: `0 ${spaceNumbers.xxxs / 2}
|
|
82
|
+
margin: `0 ${spaceNumbers.xxxs / 2}rem`,
|
|
83
83
|
},
|
|
84
84
|
};
|
|
85
85
|
case 'extraSmall':
|
|
@@ -88,7 +88,7 @@ const ButtonContainer = styled('button')({
|
|
|
88
88
|
fontWeight: type.properties.fontWeights.bold,
|
|
89
89
|
height: space.m,
|
|
90
90
|
'& > * ': {
|
|
91
|
-
margin: `0 ${spaceNumbers.xxxs / 2}
|
|
91
|
+
margin: `0 ${spaceNumbers.xxxs / 2}rem`,
|
|
92
92
|
},
|
|
93
93
|
};
|
|
94
94
|
}
|
|
@@ -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"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { createComponent, ErrorType, useUniqueId, focusRing, mouseFocusBehavior, getErrorColors, styled, useTheme, } from '@workday/canvas-kit-react/common';
|
|
3
|
-
import { borderRadius, colors, inputColors, spaceNumbers } from '@workday/canvas-kit-react/tokens';
|
|
3
|
+
import { borderRadius, colors, inputColors, space, spaceNumbers, } 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 =
|
|
8
|
-
const checkboxTapArea =
|
|
7
|
+
const checkboxHeight = (spaceNumbers.xl - spaceNumbers.xxxs) / 2;
|
|
8
|
+
const checkboxTapArea = space.m;
|
|
9
9
|
const checkboxContainerHeight = checkboxTapArea;
|
|
10
|
-
const checkboxLabelDistance = spaceNumbers.xs
|
|
11
|
-
const checkboxWidth =
|
|
10
|
+
const checkboxLabelDistance = `${spaceNumbers.xs}rem`;
|
|
11
|
+
const checkboxWidth = checkboxHeight;
|
|
12
12
|
const rippleRadius = (spaceNumbers.l - checkboxWidth) / 2;
|
|
13
13
|
const CheckboxContainer = styled('div')({
|
|
14
14
|
display: 'flex',
|
|
@@ -23,17 +23,17 @@ const CheckboxContainer = styled('div')({
|
|
|
23
23
|
*/
|
|
24
24
|
const CheckboxInputWrapper = styled('div')({
|
|
25
25
|
display: 'flex',
|
|
26
|
-
height: checkboxHeight
|
|
27
|
-
minWidth: checkboxWidth
|
|
26
|
+
height: `${checkboxHeight}rem`,
|
|
27
|
+
minWidth: `${checkboxWidth}rem`,
|
|
28
28
|
marginTop: '3px',
|
|
29
29
|
alignSelf: 'flex-start',
|
|
30
30
|
});
|
|
31
31
|
const CheckboxRipple = styled('span')({
|
|
32
32
|
borderRadius: borderRadius.circle,
|
|
33
33
|
boxShadow: `0 0 0 0 ${colors.soap200}`,
|
|
34
|
-
height: checkboxHeight
|
|
34
|
+
height: `${checkboxHeight}rem`,
|
|
35
35
|
transition: 'box-shadow 150ms ease-out',
|
|
36
|
-
width: checkboxWidth
|
|
36
|
+
width: `${checkboxWidth}rem`,
|
|
37
37
|
position: 'absolute',
|
|
38
38
|
pointerEvents: 'none', // This is a decorative element we don't want it to block clicks to input
|
|
39
39
|
}, ({ variant }) => ({
|
|
@@ -124,7 +124,7 @@ const CheckboxInput = styled('input')(({ theme: { canvas: { palette: { primary:
|
|
|
124
124
|
}),
|
|
125
125
|
}), ({ disabled }) => ({
|
|
126
126
|
'&:hover ~ span:first-of-type': {
|
|
127
|
-
boxShadow: disabled ? undefined : `0 0 0 ${rippleRadius}
|
|
127
|
+
boxShadow: disabled ? undefined : `0 0 0 ${rippleRadius}rem ${colors.soap200}`,
|
|
128
128
|
},
|
|
129
129
|
}), ({ theme, error, variant }) => {
|
|
130
130
|
const errorColors = getErrorColors(error, theme);
|
|
@@ -167,13 +167,13 @@ const CheckboxBackground = styled('div')({
|
|
|
167
167
|
borderRadius: borderRadius.s,
|
|
168
168
|
boxSizing: 'border-box',
|
|
169
169
|
display: 'flex',
|
|
170
|
-
height: checkboxHeight
|
|
170
|
+
height: `${checkboxHeight}rem`,
|
|
171
171
|
justifyContent: 'center',
|
|
172
172
|
padding: '0px 2px',
|
|
173
173
|
pointerEvents: 'none',
|
|
174
174
|
position: 'absolute',
|
|
175
175
|
transition: 'border 200ms ease, background 200ms',
|
|
176
|
-
width: checkboxWidth
|
|
176
|
+
width: `${checkboxWidth}rem`,
|
|
177
177
|
}, ({ variant }) => ({
|
|
178
178
|
border: `1px solid ${variant === 'inverse' ? colors.soap300 : inputColors.border}`,
|
|
179
179
|
}));
|
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import * as PopperJS from '@popperjs/core';
|
|
3
3
|
export declare type Placement = `${PopperJS.Placement}`;
|
|
4
4
|
export declare type PopperOptions = PopperJS.Options;
|
|
5
|
+
export declare const defaultFallbackPlacements: Placement[];
|
|
5
6
|
export interface PopperProps {
|
|
6
7
|
/**
|
|
7
8
|
* The reference element used to position the Popper. Popper content will try to follow the
|
|
@@ -39,6 +40,13 @@ export interface PopperProps {
|
|
|
39
40
|
* @default bottom
|
|
40
41
|
*/
|
|
41
42
|
placement?: Placement;
|
|
43
|
+
/**
|
|
44
|
+
* Define fallback placements by providing a list of {@link Placement} in array (in order of preference).
|
|
45
|
+
* The default preference is following the order of `top`, `right`, `bottom`, and `left`. Once the initial
|
|
46
|
+
* and opposite placements are not available, the fallback placements will be in use. Use an empty array to
|
|
47
|
+
* disable the fallback placements.
|
|
48
|
+
*/
|
|
49
|
+
fallbackPlacements?: Placement[];
|
|
42
50
|
/**
|
|
43
51
|
* A callback function that will be called whenever PopperJS chooses a placement that is different
|
|
44
52
|
* from the provided `placement` preference. If a `placement` preference doesn't fit, PopperJS
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popper.d.ts","sourceRoot":"","sources":["../../../../popup/lib/Popper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,oBAAY,SAAS,GAAG,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC;AAChD,oBAAY,aAAa,GAAG,QAAQ,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Popper.d.ts","sourceRoot":"","sources":["../../../../popup/lib/Popper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,oBAAY,SAAS,GAAG,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC;AAChD,oBAAY,aAAa,GAAG,QAAQ,CAAC,OAAO,CAAC;AAC7C,eAAO,MAAM,yBAAyB,EAAE,SAAS,EAAuC,CAAC;AAMzF,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC;IAC1D;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAE;QAAC,SAAS,EAAE,SAAS,CAAA;KAAC,KAAK,KAAK,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC;IACjF;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,MAAM,OAAO,CAAC;IACpC;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;;OAKG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,SAAS,EAAE,CAAC;IACjC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;IACnD;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IACvC;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;CAClD;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,MAAM,oFAQlB,CAAC"}
|