@workday/canvas-kit-react 7.0.0-alpha.78-next.6 → 7.0.0-alpha.81-next.9
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 +2 -2
- package/button/lib/SecondaryButton.tsx +2 -3
- package/card/lib/Card.tsx +1 -1
- package/dist/commonjs/button/lib/BaseButton.js +2 -2
- package/dist/commonjs/button/lib/SecondaryButton.d.ts.map +1 -1
- package/dist/commonjs/button/lib/SecondaryButton.js +2 -3
- package/dist/commonjs/card/lib/Card.js +1 -1
- package/dist/commonjs/layout/lib/Box.d.ts +1 -1
- package/dist/commonjs/layout/lib/Box.js +1 -1
- package/dist/commonjs/layout/lib/Flex.d.ts +1 -1
- package/dist/commonjs/layout/lib/Flex.js +1 -1
- package/dist/commonjs/modal/lib/ModalCard.js +1 -1
- package/dist/commonjs/popup/lib/Popper.d.ts +1 -9
- package/dist/commonjs/popup/lib/Popper.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/Popper.js +2 -2
- package/dist/commonjs/popup/lib/PopupCard.js +1 -1
- package/dist/commonjs/toast/lib/Toast.d.ts.map +1 -1
- package/dist/commonjs/toast/lib/Toast.js +1 -1
- package/dist/commonjs/tokens/lib/depth.d.ts +48 -17
- package/dist/commonjs/tokens/lib/depth.d.ts.map +1 -1
- package/dist/commonjs/tokens/lib/depth.js +14 -9
- package/dist/es6/button/lib/BaseButton.js +2 -2
- package/dist/es6/button/lib/SecondaryButton.d.ts.map +1 -1
- package/dist/es6/button/lib/SecondaryButton.js +2 -3
- package/dist/es6/card/lib/Card.js +1 -1
- package/dist/es6/layout/lib/Box.d.ts +1 -1
- package/dist/es6/layout/lib/Box.js +1 -1
- package/dist/es6/layout/lib/Flex.d.ts +1 -1
- package/dist/es6/layout/lib/Flex.js +1 -1
- package/dist/es6/modal/lib/ModalCard.js +1 -1
- package/dist/es6/popup/lib/Popper.d.ts +1 -9
- package/dist/es6/popup/lib/Popper.d.ts.map +1 -1
- package/dist/es6/popup/lib/Popper.js +2 -2
- package/dist/es6/popup/lib/PopupCard.js +1 -1
- package/dist/es6/toast/lib/Toast.d.ts.map +1 -1
- package/dist/es6/toast/lib/Toast.js +1 -1
- package/dist/es6/tokens/lib/depth.d.ts +48 -17
- package/dist/es6/tokens/lib/depth.d.ts.map +1 -1
- package/dist/es6/tokens/lib/depth.js +14 -9
- package/layout/lib/Box.tsx +1 -1
- package/layout/lib/Flex.tsx +1 -1
- package/modal/lib/ModalCard.tsx +1 -1
- package/package.json +5 -5
- package/popup/lib/Popper.tsx +2 -11
- package/popup/lib/PopupCard.tsx +1 -1
- package/toast/lib/Toast.tsx +1 -0
- package/tokens/README.md +11 -8
- package/tokens/lib/depth.ts +60 -24
- package/ts3.5/dist/commonjs/layout/lib/Box.d.ts +1 -1
- package/ts3.5/dist/commonjs/layout/lib/Flex.d.ts +1 -1
- package/ts3.5/dist/commonjs/popup/lib/Popper.d.ts +1 -9
- package/ts3.5/dist/commonjs/tokens/lib/depth.d.ts +48 -17
- package/ts3.5/dist/es6/layout/lib/Box.d.ts +1 -1
- package/ts3.5/dist/es6/layout/lib/Flex.d.ts +1 -1
- package/ts3.5/dist/es6/popup/lib/Popper.d.ts +1 -9
- package/ts3.5/dist/es6/tokens/lib/depth.d.ts +48 -17
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
export declare type CanvasDepth = {
|
|
2
2
|
/**
|
|
3
|
-
* ### Depth
|
|
4
|
-
* Used for
|
|
3
|
+
* ### Depth None
|
|
4
|
+
* Used for removing existing depth
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
7
7
|
* ```ts
|
|
8
8
|
* import { depth } from '@workday/canvas-kit-react/tokens';
|
|
9
9
|
*
|
|
10
|
-
* const
|
|
11
|
-
* ...depth.
|
|
10
|
+
* const noDepthCardStyles = {
|
|
11
|
+
* ...depth.none,
|
|
12
12
|
* };
|
|
13
13
|
* ```
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
|
-
boxShadow: '
|
|
15
|
+
none: {
|
|
16
|
+
boxShadow: 'none';
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
19
|
* ### Depth 1
|
|
20
|
-
* Used for minimal offset
|
|
20
|
+
* Used for minimal offset and Cards
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* ```ts
|
|
@@ -29,11 +29,11 @@ export declare type CanvasDepth = {
|
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
31
|
1: {
|
|
32
|
-
boxShadow: '0px
|
|
32
|
+
boxShadow: '0px 1px 4px rgba(0, 0, 0, 0.2), 0px 2px 8px rgba(0, 0, 0, 0.16)';
|
|
33
33
|
};
|
|
34
34
|
/**
|
|
35
35
|
* ### Depth 2
|
|
36
|
-
* Used for
|
|
36
|
+
* Used for Top navigation, Bottom navigation
|
|
37
37
|
*
|
|
38
38
|
* @example
|
|
39
39
|
* ```ts
|
|
@@ -45,11 +45,11 @@ export declare type CanvasDepth = {
|
|
|
45
45
|
* ```
|
|
46
46
|
*/
|
|
47
47
|
2: {
|
|
48
|
-
boxShadow: '0px
|
|
48
|
+
boxShadow: '0px 2px 8px rgba(0, 0, 0, 0.2), 0px 4px 16px rgba(0, 0, 0, 0.16)';
|
|
49
49
|
};
|
|
50
50
|
/**
|
|
51
51
|
* ### Depth 3
|
|
52
|
-
* Used for
|
|
52
|
+
* Used for FABs, Menus
|
|
53
53
|
*
|
|
54
54
|
* @example
|
|
55
55
|
* ```ts
|
|
@@ -61,11 +61,11 @@ export declare type CanvasDepth = {
|
|
|
61
61
|
* ```
|
|
62
62
|
*/
|
|
63
63
|
3: {
|
|
64
|
-
boxShadow: '0px
|
|
64
|
+
boxShadow: '0px 3px 12px rgba(0, 0, 0, 0.2), 0px 6px 24px rgba(0, 0, 0, 0.16)';
|
|
65
65
|
};
|
|
66
66
|
/**
|
|
67
67
|
* ### Depth 4
|
|
68
|
-
*
|
|
68
|
+
*
|
|
69
69
|
*
|
|
70
70
|
* @example
|
|
71
71
|
* ```ts
|
|
@@ -77,8 +77,39 @@ export declare type CanvasDepth = {
|
|
|
77
77
|
* ```
|
|
78
78
|
*/
|
|
79
79
|
4: {
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
boxShadow: '0px 4px 16px rgba(0, 0, 0, 0.2), 0px 8px 32px rgba(0, 0, 0, 0.16)';
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* ### Depth 5
|
|
84
|
+
* Used for Popups, Toast Messages, Dialogs, Side Panels without opacity overlay behavior
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* import { depth } from '@workday/canvas-kit-react/tokens';
|
|
89
|
+
*
|
|
90
|
+
* const cardStyles = {
|
|
91
|
+
* ...depth[5],
|
|
92
|
+
* };
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
5: {
|
|
96
|
+
boxShadow: '0px 5px 20px rgba(0, 0, 0, 0.2), 0px 10px 40px rgba(0, 0, 0, 0.16)';
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* ### Depth 6
|
|
100
|
+
* Used for components with opacity overlay behavior such as Modal or Side Panels
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* import { depth } from '@workday/canvas-kit-react/tokens';
|
|
105
|
+
*
|
|
106
|
+
* const cardStyles = {
|
|
107
|
+
* ...depth[6],
|
|
108
|
+
* };
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
6: {
|
|
112
|
+
boxShadow: '0px 6px 24px rgba(0, 0, 0, 0.2), 0px 12px 48px rgba(0, 0, 0, 0.16)';
|
|
82
113
|
};
|
|
83
114
|
};
|
|
84
115
|
declare type ValueOf<T> = T[keyof T];
|
|
@@ -88,8 +119,8 @@ export declare type CanvasDepthValues = ValueOf<CanvasDepth>;
|
|
|
88
119
|
*
|
|
89
120
|
* Depth is the relative distance between surfaces in the z-axis.
|
|
90
121
|
* It provides delineation, focus, and priority with shadows and layering.
|
|
91
|
-
* There are
|
|
92
|
-
*
|
|
122
|
+
* There are seven depth levels, `none`, `1`, `2`, `3`, `4`, `5` and `6`.
|
|
123
|
+
* `none` is a special value to remove depth styles. All other levels only apply box-shadow styles.
|
|
93
124
|
*
|
|
94
125
|
* @example
|
|
95
126
|
* ```tsx
|
|
@@ -40,7 +40,7 @@ export declare const boxStyleFn: <P extends BoxProps>(props: P) => {};
|
|
|
40
40
|
*
|
|
41
41
|
* // `Card`'s default values are set using `BoxProps`
|
|
42
42
|
* const Card = (props: CardProps) => (
|
|
43
|
-
* <Box depth={
|
|
43
|
+
* <Box depth={1} padding="m" borderRadius="l" {...props}>Hello, Card!</Box>
|
|
44
44
|
* );
|
|
45
45
|
*
|
|
46
46
|
*/
|
|
@@ -15,7 +15,7 @@ export declare type FlexProps = BoxProps & FlexStyleProps;
|
|
|
15
15
|
*
|
|
16
16
|
* // `Card`'s default values are set using `FlexProps`
|
|
17
17
|
* const Card = (props: CardProps) => (
|
|
18
|
-
* <Flex flexDirection="column" alignItems="flex-start" depth={
|
|
18
|
+
* <Flex flexDirection="column" alignItems="flex-start" depth={1} space="m" {...props}>
|
|
19
19
|
* <h1>Hello, Card!</h1>
|
|
20
20
|
* <p>This card uses flexbox to set its layout.</p>
|
|
21
21
|
* </Flex>
|
|
@@ -18,14 +18,6 @@ export interface PopperProps {
|
|
|
18
18
|
children: ((props: {
|
|
19
19
|
placement: Placement;
|
|
20
20
|
}) => React.ReactNode) | React.ReactNode;
|
|
21
|
-
/**
|
|
22
|
-
* The element that contains the portal children when `portal` is true. It is best to not define
|
|
23
|
-
* this unless you know what you're doing. Popper works with a PopupStack and in order for
|
|
24
|
-
* z-indexes to work correctly, all Popups on your page should live on the same root element
|
|
25
|
-
* otherwise you risk running into rendering issues:
|
|
26
|
-
* https://philipwalton.com/articles/what-no-one-told-you-about-z-index/
|
|
27
|
-
*/
|
|
28
|
-
containerElement?: Element | null;
|
|
29
21
|
/**
|
|
30
22
|
* When provided, this optional callback will be used to determine positioning for the Popper element
|
|
31
23
|
* instead of calling `getBoundingClientRect` on the `anchorElement` prop. Use this when you need
|
|
@@ -58,7 +50,7 @@ export interface PopperProps {
|
|
|
58
50
|
*/
|
|
59
51
|
popperOptions?: Partial<PopperOptions>;
|
|
60
52
|
/**
|
|
61
|
-
* If
|
|
53
|
+
* If false, render the Popper within the
|
|
62
54
|
* DOM hierarchy of its parent. A non-portal Popper will constrained by the parent container
|
|
63
55
|
* overflows. If you set this to `false`, you may experience issues where you content gets cut off
|
|
64
56
|
* by scrollbars or `overflow: hidden`
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
export declare type CanvasDepth = {
|
|
2
2
|
/**
|
|
3
|
-
* ### Depth
|
|
4
|
-
* Used for
|
|
3
|
+
* ### Depth None
|
|
4
|
+
* Used for removing existing depth
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
7
7
|
* ```ts
|
|
8
8
|
* import { depth } from '@workday/canvas-kit-react/tokens';
|
|
9
9
|
*
|
|
10
|
-
* const
|
|
11
|
-
* ...depth.
|
|
10
|
+
* const noDepthCardStyles = {
|
|
11
|
+
* ...depth.none,
|
|
12
12
|
* };
|
|
13
13
|
* ```
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
|
-
boxShadow: '
|
|
15
|
+
none: {
|
|
16
|
+
boxShadow: 'none';
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
19
|
* ### Depth 1
|
|
20
|
-
* Used for minimal offset
|
|
20
|
+
* Used for minimal offset and Cards
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* ```ts
|
|
@@ -29,11 +29,11 @@ export declare type CanvasDepth = {
|
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
31
|
1: {
|
|
32
|
-
boxShadow: '0px
|
|
32
|
+
boxShadow: '0px 1px 4px rgba(0, 0, 0, 0.2), 0px 2px 8px rgba(0, 0, 0, 0.16)';
|
|
33
33
|
};
|
|
34
34
|
/**
|
|
35
35
|
* ### Depth 2
|
|
36
|
-
* Used for
|
|
36
|
+
* Used for Top navigation, Bottom navigation
|
|
37
37
|
*
|
|
38
38
|
* @example
|
|
39
39
|
* ```ts
|
|
@@ -45,11 +45,11 @@ export declare type CanvasDepth = {
|
|
|
45
45
|
* ```
|
|
46
46
|
*/
|
|
47
47
|
2: {
|
|
48
|
-
boxShadow: '0px
|
|
48
|
+
boxShadow: '0px 2px 8px rgba(0, 0, 0, 0.2), 0px 4px 16px rgba(0, 0, 0, 0.16)';
|
|
49
49
|
};
|
|
50
50
|
/**
|
|
51
51
|
* ### Depth 3
|
|
52
|
-
* Used for
|
|
52
|
+
* Used for FABs, Menus
|
|
53
53
|
*
|
|
54
54
|
* @example
|
|
55
55
|
* ```ts
|
|
@@ -61,11 +61,11 @@ export declare type CanvasDepth = {
|
|
|
61
61
|
* ```
|
|
62
62
|
*/
|
|
63
63
|
3: {
|
|
64
|
-
boxShadow: '0px
|
|
64
|
+
boxShadow: '0px 3px 12px rgba(0, 0, 0, 0.2), 0px 6px 24px rgba(0, 0, 0, 0.16)';
|
|
65
65
|
};
|
|
66
66
|
/**
|
|
67
67
|
* ### Depth 4
|
|
68
|
-
*
|
|
68
|
+
*
|
|
69
69
|
*
|
|
70
70
|
* @example
|
|
71
71
|
* ```ts
|
|
@@ -77,8 +77,39 @@ export declare type CanvasDepth = {
|
|
|
77
77
|
* ```
|
|
78
78
|
*/
|
|
79
79
|
4: {
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
boxShadow: '0px 4px 16px rgba(0, 0, 0, 0.2), 0px 8px 32px rgba(0, 0, 0, 0.16)';
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* ### Depth 5
|
|
84
|
+
* Used for Popups, Toast Messages, Dialogs, Side Panels without opacity overlay behavior
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* import { depth } from '@workday/canvas-kit-react/tokens';
|
|
89
|
+
*
|
|
90
|
+
* const cardStyles = {
|
|
91
|
+
* ...depth[5],
|
|
92
|
+
* };
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
5: {
|
|
96
|
+
boxShadow: '0px 5px 20px rgba(0, 0, 0, 0.2), 0px 10px 40px rgba(0, 0, 0, 0.16)';
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* ### Depth 6
|
|
100
|
+
* Used for components with opacity overlay behavior such as Modal or Side Panels
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* import { depth } from '@workday/canvas-kit-react/tokens';
|
|
105
|
+
*
|
|
106
|
+
* const cardStyles = {
|
|
107
|
+
* ...depth[6],
|
|
108
|
+
* };
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
6: {
|
|
112
|
+
boxShadow: '0px 6px 24px rgba(0, 0, 0, 0.2), 0px 12px 48px rgba(0, 0, 0, 0.16)';
|
|
82
113
|
};
|
|
83
114
|
};
|
|
84
115
|
declare type ValueOf<T> = T[keyof T];
|
|
@@ -88,8 +119,8 @@ export declare type CanvasDepthValues = ValueOf<CanvasDepth>;
|
|
|
88
119
|
*
|
|
89
120
|
* Depth is the relative distance between surfaces in the z-axis.
|
|
90
121
|
* It provides delineation, focus, and priority with shadows and layering.
|
|
91
|
-
* There are
|
|
92
|
-
*
|
|
122
|
+
* There are seven depth levels, `none`, `1`, `2`, `3`, `4`, `5` and `6`.
|
|
123
|
+
* `none` is a special value to remove depth styles. All other levels only apply box-shadow styles.
|
|
93
124
|
*
|
|
94
125
|
* @example
|
|
95
126
|
* ```tsx
|