@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.
Files changed (56) hide show
  1. package/button/lib/BaseButton.tsx +2 -2
  2. package/button/lib/SecondaryButton.tsx +2 -3
  3. package/card/lib/Card.tsx +1 -1
  4. package/dist/commonjs/button/lib/BaseButton.js +2 -2
  5. package/dist/commonjs/button/lib/SecondaryButton.d.ts.map +1 -1
  6. package/dist/commonjs/button/lib/SecondaryButton.js +2 -3
  7. package/dist/commonjs/card/lib/Card.js +1 -1
  8. package/dist/commonjs/layout/lib/Box.d.ts +1 -1
  9. package/dist/commonjs/layout/lib/Box.js +1 -1
  10. package/dist/commonjs/layout/lib/Flex.d.ts +1 -1
  11. package/dist/commonjs/layout/lib/Flex.js +1 -1
  12. package/dist/commonjs/modal/lib/ModalCard.js +1 -1
  13. package/dist/commonjs/popup/lib/Popper.d.ts +1 -9
  14. package/dist/commonjs/popup/lib/Popper.d.ts.map +1 -1
  15. package/dist/commonjs/popup/lib/Popper.js +2 -2
  16. package/dist/commonjs/popup/lib/PopupCard.js +1 -1
  17. package/dist/commonjs/toast/lib/Toast.d.ts.map +1 -1
  18. package/dist/commonjs/toast/lib/Toast.js +1 -1
  19. package/dist/commonjs/tokens/lib/depth.d.ts +48 -17
  20. package/dist/commonjs/tokens/lib/depth.d.ts.map +1 -1
  21. package/dist/commonjs/tokens/lib/depth.js +14 -9
  22. package/dist/es6/button/lib/BaseButton.js +2 -2
  23. package/dist/es6/button/lib/SecondaryButton.d.ts.map +1 -1
  24. package/dist/es6/button/lib/SecondaryButton.js +2 -3
  25. package/dist/es6/card/lib/Card.js +1 -1
  26. package/dist/es6/layout/lib/Box.d.ts +1 -1
  27. package/dist/es6/layout/lib/Box.js +1 -1
  28. package/dist/es6/layout/lib/Flex.d.ts +1 -1
  29. package/dist/es6/layout/lib/Flex.js +1 -1
  30. package/dist/es6/modal/lib/ModalCard.js +1 -1
  31. package/dist/es6/popup/lib/Popper.d.ts +1 -9
  32. package/dist/es6/popup/lib/Popper.d.ts.map +1 -1
  33. package/dist/es6/popup/lib/Popper.js +2 -2
  34. package/dist/es6/popup/lib/PopupCard.js +1 -1
  35. package/dist/es6/toast/lib/Toast.d.ts.map +1 -1
  36. package/dist/es6/toast/lib/Toast.js +1 -1
  37. package/dist/es6/tokens/lib/depth.d.ts +48 -17
  38. package/dist/es6/tokens/lib/depth.d.ts.map +1 -1
  39. package/dist/es6/tokens/lib/depth.js +14 -9
  40. package/layout/lib/Box.tsx +1 -1
  41. package/layout/lib/Flex.tsx +1 -1
  42. package/modal/lib/ModalCard.tsx +1 -1
  43. package/package.json +5 -5
  44. package/popup/lib/Popper.tsx +2 -11
  45. package/popup/lib/PopupCard.tsx +1 -1
  46. package/toast/lib/Toast.tsx +1 -0
  47. package/tokens/README.md +11 -8
  48. package/tokens/lib/depth.ts +60 -24
  49. package/ts3.5/dist/commonjs/layout/lib/Box.d.ts +1 -1
  50. package/ts3.5/dist/commonjs/layout/lib/Flex.d.ts +1 -1
  51. package/ts3.5/dist/commonjs/popup/lib/Popper.d.ts +1 -9
  52. package/ts3.5/dist/commonjs/tokens/lib/depth.d.ts +48 -17
  53. package/ts3.5/dist/es6/layout/lib/Box.d.ts +1 -1
  54. package/ts3.5/dist/es6/layout/lib/Flex.d.ts +1 -1
  55. package/ts3.5/dist/es6/popup/lib/Popper.d.ts +1 -9
  56. 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 Inset
4
- * Used for inset containers
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 insetCardStyles = {
11
- * ...depth.inset,
10
+ * const noDepthCardStyles = {
11
+ * ...depth.none,
12
12
  * };
13
13
  * ```
14
14
  */
15
- inset: {
16
- boxShadow: 'inset 0px 0px 8px 0 rgba(82, 97, 115, 0.09)';
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 2px 4px 0 rgba(0, 0, 0, 0.08)';
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 Cards, Popups, and Menus — our most common depth
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 4px 8px 0 rgba(0, 0, 0, 0.1)';
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 interactive Cards on hover
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 8px 16px 0 rgba(0, 0, 0, 0.12)';
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
- * Used for Cards on white backgrounds — adds border styles for more contrast
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
- border: '1px solid rgba(218, 226, 230, 1)';
81
- boxShadow: '0px 8px 16px 0 rgba(0, 0, 0, 0.12)';
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 five depth levels, `inset`, `1`, `2`, `3`, and `4`.
92
- * Most levels only apply box-shadow styles, but `depth[4]` also applies border styles.
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={2} padding="m" borderRadius="l" {...props}>Hello, Card!</Box>
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={2} space="m" {...props}>
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 true, attach the Popper to the `containerElement`. If false, render the Popper within the
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 Inset
4
- * Used for inset containers
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 insetCardStyles = {
11
- * ...depth.inset,
10
+ * const noDepthCardStyles = {
11
+ * ...depth.none,
12
12
  * };
13
13
  * ```
14
14
  */
15
- inset: {
16
- boxShadow: 'inset 0px 0px 8px 0 rgba(82, 97, 115, 0.09)';
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 2px 4px 0 rgba(0, 0, 0, 0.08)';
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 Cards, Popups, and Menus — our most common depth
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 4px 8px 0 rgba(0, 0, 0, 0.1)';
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 interactive Cards on hover
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 8px 16px 0 rgba(0, 0, 0, 0.12)';
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
- * Used for Cards on white backgrounds — adds border styles for more contrast
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
- border: '1px solid rgba(218, 226, 230, 1)';
81
- boxShadow: '0px 8px 16px 0 rgba(0, 0, 0, 0.12)';
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 five depth levels, `inset`, `1`, `2`, `3`, and `4`.
92
- * Most levels only apply box-shadow styles, but `depth[4]` also applies border styles.
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