@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
@@ -1 +1 @@
1
- {"version":3,"file":"depth.d.ts","sourceRoot":"","sources":["../../../../tokens/lib/depth.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW,GAAG;IACxB;;;;;;;;;;;;OAYG;IACH,KAAK,EAAE;QACL,SAAS,EAAE,6CAA6C,CAAC;KAC1D,CAAC;IACF;;;;;;;;;;;;OAYG;IACH,CAAC,EAAE;QACD,SAAS,EAAE,mCAAmC,CAAC;KAChD,CAAC;IACF;;;;;;;;;;;;OAYG;IACH,CAAC,EAAE;QACD,SAAS,EAAE,kCAAkC,CAAC;KAC/C,CAAC;IACF;;;;;;;;;;;;OAYG;IACH,CAAC,EAAE;QACD,SAAS,EAAE,oCAAoC,CAAC;KACjD,CAAC;IACF;;;;;;;;;;;;OAYG;IACH,CAAC,EAAE;QACD,MAAM,EAAE,kCAAkC,CAAC;QAC3C,SAAS,EAAE,oCAAoC,CAAC;KACjD,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;AACH,eAAO,MAAM,KAAK,EAAE,WAiBnB,CAAC"}
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,iEAAiE,CAAC;KAC9E,CAAC;IACF;;;;;;;;;;;;OAYG;IACH,CAAC,EAAE;QACD,SAAS,EAAE,kEAAkE,CAAC;KAC/E,CAAC;IACF;;;;;;;;;;;;OAYG;IACH,CAAC,EAAE;QACD,SAAS,EAAE,mEAAmE,CAAC;KAChF,CAAC;IACF;;;;;;;;;;;;OAYG;IACH,CAAC,EAAE;QACD,SAAS,EAAE,mEAAmE,CAAC;KAChF,CAAC;IACF;;;;;;;;;;;;OAYG;IACH,CAAC,EAAE;QACD,SAAS,EAAE,oEAAoE,CAAC;KACjF,CAAC;IACF;;;;;;;;;;;;OAYG;IACH,CAAC,EAAE;QACD,SAAS,EAAE,oEAAoE,CAAC;KACjF,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;AACH,eAAO,MAAM,KAAK,EAAE,WAsBnB,CAAC"}
@@ -3,8 +3,8 @@
3
3
  *
4
4
  * Depth is the relative distance between surfaces in the z-axis.
5
5
  * It provides delineation, focus, and priority with shadows and layering.
6
- * There are five depth levels, `inset`, `1`, `2`, `3`, and `4`.
7
- * Most levels only apply box-shadow styles, but `depth[4]` also applies border styles.
6
+ * There are seven depth levels, `none`, `1`, `2`, `3`, `4`, `5` and `6`.
7
+ * `none` is a special value to remove depth styles. All other levels only apply box-shadow styles.
8
8
  *
9
9
  * @example
10
10
  * ```tsx
@@ -21,20 +21,25 @@
21
21
  *
22
22
  */
23
23
  export var depth = {
24
- inset: {
25
- boxShadow: 'inset 0px 0px 8px 0 rgba(82, 97, 115, 0.09)',
24
+ none: {
25
+ boxShadow: 'none',
26
26
  },
27
27
  1: {
28
- boxShadow: '0px 2px 4px 0 rgba(0, 0, 0, 0.08)',
28
+ boxShadow: '0px 1px 4px rgba(0, 0, 0, 0.2), 0px 2px 8px rgba(0, 0, 0, 0.16)',
29
29
  },
30
30
  2: {
31
- boxShadow: '0px 4px 8px 0 rgba(0, 0, 0, 0.1)',
31
+ boxShadow: '0px 2px 8px rgba(0, 0, 0, 0.2), 0px 4px 16px rgba(0, 0, 0, 0.16)',
32
32
  },
33
33
  3: {
34
- boxShadow: '0px 8px 16px 0 rgba(0, 0, 0, 0.12)',
34
+ boxShadow: '0px 3px 12px rgba(0, 0, 0, 0.2), 0px 6px 24px rgba(0, 0, 0, 0.16)',
35
35
  },
36
36
  4: {
37
- border: '1px solid rgba(218, 226, 230, 1)',
38
- boxShadow: '0px 8px 16px 0 rgba(0, 0, 0, 0.12)',
37
+ boxShadow: '0px 4px 16px rgba(0, 0, 0, 0.2), 0px 8px 32px rgba(0, 0, 0, 0.16)',
38
+ },
39
+ 5: {
40
+ boxShadow: '0px 5px 20px rgba(0, 0, 0, 0.2), 0px 10px 40px rgba(0, 0, 0, 0.16)',
41
+ },
42
+ 6: {
43
+ boxShadow: '0px 6px 24px rgba(0, 0, 0, 0.2), 0px 12px 48px rgba(0, 0, 0, 0.16)',
39
44
  },
40
45
  };
@@ -112,7 +112,7 @@ const StyledBoxComponent = styled('div')<StyledType & BoxProps>(
112
112
  *
113
113
  * // `Card`'s default values are set using `BoxProps`
114
114
  * const Card = (props: CardProps) => (
115
- * <Box depth={2} padding="m" borderRadius="l" {...props}>Hello, Card!</Box>
115
+ * <Box depth={1} padding="m" borderRadius="l" {...props}>Hello, Card!</Box>
116
116
  * );
117
117
  *
118
118
  */
@@ -28,7 +28,7 @@ const StyledFlex = styled(Box)<StyledType & FlexProps>(
28
28
  *
29
29
  * // `Card`'s default values are set using `FlexProps`
30
30
  * const Card = (props: CardProps) => (
31
- * <Flex flexDirection="column" alignItems="flex-start" depth={2} space="m" {...props}>
31
+ * <Flex flexDirection="column" alignItems="flex-start" depth={1} space="m" {...props}>
32
32
  * <h1>Hello, Card!</h1>
33
33
  * <p>This card uses flexbox to set its layout.</p>
34
34
  * </Flex>
@@ -14,7 +14,7 @@ export const ModalCard = createComponent('div')({
14
14
 
15
15
  const props = useModalCard(localModel, elemProps, ref);
16
16
  return (
17
- <Popup.Card as={Element} width={440} borderWidth={0} margin="xl" {...props}>
17
+ <Popup.Card as={Element} width={440} borderWidth={0} margin="xl" depth={6} {...props}>
18
18
  {children}
19
19
  </Popup.Card>
20
20
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-react",
3
- "version": "7.0.0-alpha.78-next.6+400ffc0b",
3
+ "version": "7.0.0-alpha.81-next.9+5f4eca7e",
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",
@@ -57,9 +57,9 @@
57
57
  "@emotion/styled": "^11.6.0",
58
58
  "@popperjs/core": "^2.5.4",
59
59
  "@workday/canvas-colors-web": "^2.0.0",
60
- "@workday/canvas-kit-labs-react": "^7.0.0-alpha.78-next.6+400ffc0b",
61
- "@workday/canvas-kit-popup-stack": "^7.0.0-alpha.78-next.6+400ffc0b",
62
- "@workday/canvas-kit-preview-react": "^7.0.0-alpha.78-next.6+400ffc0b",
60
+ "@workday/canvas-kit-labs-react": "^7.0.0-alpha.81-next.9+5f4eca7e",
61
+ "@workday/canvas-kit-popup-stack": "^7.0.0-alpha.81-next.9+5f4eca7e",
62
+ "@workday/canvas-kit-preview-react": "^7.0.0-alpha.81-next.9+5f4eca7e",
63
63
  "@workday/canvas-system-icons-web": "1.0.41",
64
64
  "@workday/design-assets-types": "^0.2.4",
65
65
  "chroma-js": "^2.1.0",
@@ -77,5 +77,5 @@
77
77
  "@workday/canvas-accent-icons-web": "^1.0.0",
78
78
  "@workday/canvas-applet-icons-web": "^0.17.50"
79
79
  },
80
- "gitHead": "400ffc0b29c2762180758d9b7c1bdc0562cb01e4"
80
+ "gitHead": "5f4eca7e47351f920cb283c1a1fa16b9ef76b6e5"
81
81
  }
@@ -22,14 +22,6 @@ export interface PopperProps {
22
22
  * `anchorElement`.
23
23
  */
24
24
  children: ((props: {placement: Placement}) => React.ReactNode) | React.ReactNode;
25
- /**
26
- * The element that contains the portal children when `portal` is true. It is best to not define
27
- * this unless you know what you're doing. Popper works with a PopupStack and in order for
28
- * z-indexes to work correctly, all Popups on your page should live on the same root element
29
- * otherwise you risk running into rendering issues:
30
- * https://philipwalton.com/articles/what-no-one-told-you-about-z-index/
31
- */
32
- containerElement?: Element | null;
33
25
  /**
34
26
  * When provided, this optional callback will be used to determine positioning for the Popper element
35
27
  * instead of calling `getBoundingClientRect` on the `anchorElement` prop. Use this when you need
@@ -62,7 +54,7 @@ export interface PopperProps {
62
54
  */
63
55
  popperOptions?: Partial<PopperOptions>;
64
56
  /**
65
- * If true, attach the Popper to the `containerElement`. If false, render the Popper within the
57
+ * If false, render the Popper within the
66
58
  * DOM hierarchy of its parent. A non-portal Popper will constrained by the parent container
67
59
  * overflows. If you set this to `false`, you may experience issues where you content gets cut off
68
60
  * by scrollbars or `overflow: hidden`
@@ -113,7 +105,6 @@ const OpenPopper = React.forwardRef<HTMLDivElement, PopperProps>(
113
105
  onPlacementChange,
114
106
  children,
115
107
  portal,
116
- containerElement,
117
108
  popperInstanceRef,
118
109
  }: PopperProps,
119
110
  ref
@@ -185,7 +176,7 @@ const OpenPopper = React.forwardRef<HTMLDivElement, PopperProps>(
185
176
  return contents;
186
177
  }
187
178
 
188
- return ReactDOM.createPortal(contents, containerElement || stackRef.current!);
179
+ return ReactDOM.createPortal(contents, stackRef.current!);
189
180
  }
190
181
  );
191
182
 
@@ -78,7 +78,7 @@ export const PopupCard = createComponent('div')({
78
78
  transformOrigin={transformOrigin}
79
79
  position="relative"
80
80
  padding="l"
81
- depth={2}
81
+ depth={5}
82
82
  maxWidth={`calc(100vw - ${space.l})`}
83
83
  spacing={0}
84
84
  flexDirection="column"
@@ -92,6 +92,7 @@ export const Toast = createComponent('div')({
92
92
  as={Element}
93
93
  width={toastWidth}
94
94
  padding="s"
95
+ depth={5}
95
96
  role={isInteractive ? 'dialog' : 'status'}
96
97
  aria-live={isInteractive ? 'off' : 'polite'}
97
98
  aria-atomic={!isInteractive}
package/tokens/README.md CHANGED
@@ -174,16 +174,19 @@ const buttonSyles = {
174
174
 
175
175
  ## Depth
176
176
 
177
- Depth is the relative distance between surfaces in the z-axis. It provides delineation, focus, and priority with shadows and layering. There are five depth levels, `inset`, `1`, `2`, `3`, and `4`. Most levels only apply box-shadow styles, but `depth[4]` also applies border styles.
177
+ Depth is the relative distance between surfaces in the z-axis. It provides delineation, focus, and
178
+ priority with shadows and layering. There are seven depth levels, `none`, `1`, `2`, `3`, `4`, `5`
179
+ and `6`. `none` is a special value to remove depth styles. All other levels only apply box-shadow
180
+ styles.
178
181
 
179
182
  ### Usage
180
183
 
181
184
  ```tsx
182
- import { depth } from '@workday/canvas-kit-react/tokens';
185
+ import {depth} from '@workday/canvas-kit-react/tokens';
183
186
 
184
187
  const CustomCard = () => {
185
- return <div css={depth[2]}>A standard-depth card</div>;
186
- }
188
+ return <div css={depth[1]}>A standard-depth card</div>;
189
+ };
187
190
  ```
188
191
 
189
192
  ## Type
@@ -211,8 +214,8 @@ To use the Canvas Kit font
211
214
 
212
215
  Canvas Kit v5 introduced `rem` units (instead of `px`) to our type tokens. This update follows the
213
216
  guidance [from the WCAG spec](https://www.w3.org/TR/WCAG21/#resize-text) and provides better support
214
- for users who change their browser's default font size. If you'd like to learn more about `rem` and relative units, you can
215
- review this
217
+ for users who change their browser's default font size. If you'd like to learn more about `rem` and
218
+ relative units, you can review this
216
219
  [documentation](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units#ems_and_rems).
217
220
 
218
221
  > **Note:** We are using `16px` as our base font-size for these values. This is a browser standard
@@ -299,8 +302,8 @@ _Intended for standard body text_
299
302
 
300
303
  _Intended for small subtext content or in tight spaces_
301
304
 
302
- | Size | Properties |
303
- | -------- | ----------------------------------------------------- |
305
+ | Size | Properties |
306
+ | -------- | ------------------------------------------------------------ |
304
307
  | `large` | fontSize: `14px` (`0.875rem`), fontWeight: `regular` (`400`) |
305
308
  | `medium` | fontSize: `12px` (`0.75rem`), fontWeight: `regular` (`400`) |
306
309
  | `small` | fontSize: `10px` (`0.625rem`), fontWeight: `regular` (`400`) |
@@ -1,23 +1,23 @@
1
1
  export 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 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 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 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 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
 
@@ -90,8 +121,8 @@ export type CanvasDepthValues = ValueOf<CanvasDepth>;
90
121
  *
91
122
  * Depth is the relative distance between surfaces in the z-axis.
92
123
  * It provides delineation, focus, and priority with shadows and layering.
93
- * There are five depth levels, `inset`, `1`, `2`, `3`, and `4`.
94
- * Most levels only apply box-shadow styles, but `depth[4]` also applies border styles.
124
+ * There are seven depth levels, `none`, `1`, `2`, `3`, `4`, `5` and `6`.
125
+ * `none` is a special value to remove depth styles. All other levels only apply box-shadow styles.
95
126
  *
96
127
  * @example
97
128
  * ```tsx
@@ -108,20 +139,25 @@ export type CanvasDepthValues = ValueOf<CanvasDepth>;
108
139
  *
109
140
  */
110
141
  export const depth: CanvasDepth = {
111
- inset: {
112
- boxShadow: 'inset 0px 0px 8px 0 rgba(82, 97, 115, 0.09)',
142
+ none: {
143
+ boxShadow: 'none',
113
144
  },
114
145
  1: {
115
- boxShadow: '0px 2px 4px 0 rgba(0, 0, 0, 0.08)',
146
+ boxShadow: '0px 1px 4px rgba(0, 0, 0, 0.2), 0px 2px 8px rgba(0, 0, 0, 0.16)',
116
147
  },
117
148
  2: {
118
- boxShadow: '0px 4px 8px 0 rgba(0, 0, 0, 0.1)',
149
+ boxShadow: '0px 2px 8px rgba(0, 0, 0, 0.2), 0px 4px 16px rgba(0, 0, 0, 0.16)',
119
150
  },
120
151
  3: {
121
- boxShadow: '0px 8px 16px 0 rgba(0, 0, 0, 0.12)',
152
+ boxShadow: '0px 3px 12px rgba(0, 0, 0, 0.2), 0px 6px 24px rgba(0, 0, 0, 0.16)',
122
153
  },
123
154
  4: {
124
- border: '1px solid rgba(218, 226, 230, 1)',
125
- boxShadow: '0px 8px 16px 0 rgba(0, 0, 0, 0.12)',
155
+ boxShadow: '0px 4px 16px rgba(0, 0, 0, 0.2), 0px 8px 32px rgba(0, 0, 0, 0.16)',
156
+ },
157
+ 5: {
158
+ boxShadow: '0px 5px 20px rgba(0, 0, 0, 0.2), 0px 10px 40px rgba(0, 0, 0, 0.16)',
159
+ },
160
+ 6: {
161
+ boxShadow: '0px 6px 24px rgba(0, 0, 0, 0.2), 0px 12px 48px rgba(0, 0, 0, 0.16)',
126
162
  },
127
163
  };
@@ -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`