@workday/canvas-kit-preview-react 6.0.0-beta.0-next.16 → 6.0.3

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.
@@ -15,8 +15,8 @@ export const useCollapse = <E extends HTMLElement>(listEl: React.RefObject<E>, m
15
15
  };
16
16
 
17
17
  const getBreadcrumbLink = (breadcrumb: React.ReactElement) => {
18
- return Children.toArray(breadcrumb.props.children).filter((child: React.ReactElement) => {
19
- return child.type === BreadcrumbLink;
18
+ return Children.toArray(breadcrumb.props.children).filter(child => {
19
+ return React.isValidElement(child) && child.type === BreadcrumbLink;
20
20
  })[0] as React.ReactElement;
21
21
  };
22
22
 
@@ -58,7 +58,7 @@ export const useBuildCollapsedList = <E extends HTMLElement>(
58
58
  // We should make this match work better
59
59
  const listItemNode = listItemNodes[index];
60
60
 
61
- // We might need to allow folks to spead more props from the link
61
+ // We might need to allow folks to spread more props from the link
62
62
  listItems.push({
63
63
  index: index, // TODO: use unique identifiers instead of indices
64
64
  link: breadcrumbLink?.props?.href || '',
@@ -70,8 +70,8 @@ export const useBuildCollapsedList = <E extends HTMLElement>(
70
70
 
71
71
  // don't collapse the root breadcrumb
72
72
  const collapsibleListItems = listItems.slice(1);
73
- const collaspedList = buildCollapsedList(collapsibleListItems, containerWidth, maxWidth);
74
- setCollapsedItems(collaspedList);
73
+ const collapsedList = buildCollapsedList(collapsibleListItems, containerWidth, maxWidth);
74
+ setCollapsedItems(collapsedList);
75
75
  // eslint-disable-next-line react-hooks/exhaustive-deps
76
76
  }, [maxWidth]);
77
77
 
@@ -9,7 +9,7 @@ export declare const useBuildCollapsedList: <E extends HTMLElement>(listEl: Reac
9
9
  };
10
10
  export declare const useTruncateTooltip: (ref?: React.RefObject<HTMLSpanElement> | undefined) => {
11
11
  isTooltipOpen: boolean;
12
- openTooltip: (event: React.MouseEvent<Element, MouseEvent> | React.FocusEvent<Element>) => void;
12
+ openTooltip: (event: React.MouseEvent<Element, MouseEvent> | React.FocusEvent<Element, Element>) => void;
13
13
  closeTooltip: () => void;
14
14
  shouldShowTooltip: boolean;
15
15
  tooltipProps: {
@@ -21,7 +21,7 @@ exports.useCollapse = function (listEl, maxWidth) {
21
21
  };
22
22
  var getBreadcrumbLink = function (breadcrumb) {
23
23
  return react_1.Children.toArray(breadcrumb.props.children).filter(function (child) {
24
- return child.type === Link_1.BreadcrumbLink;
24
+ return react_1.default.isValidElement(child) && child.type === Link_1.BreadcrumbLink;
25
25
  })[0];
26
26
  };
27
27
  var buildCollapsedList = function (list, containerWidth, maxWidth, collapsedList) {
@@ -51,7 +51,7 @@ exports.useBuildCollapsedList = function (listEl, children, maxWidth) {
51
51
  var breadcrumbLink = getBreadcrumbLink(child);
52
52
  // We should make this match work better
53
53
  var listItemNode = listItemNodes[index];
54
- // We might need to allow folks to spead more props from the link
54
+ // We might need to allow folks to spread more props from the link
55
55
  listItems.push({
56
56
  index: index,
57
57
  link: ((_a = breadcrumbLink === null || breadcrumbLink === void 0 ? void 0 : breadcrumbLink.props) === null || _a === void 0 ? void 0 : _a.href) || '',
@@ -62,8 +62,8 @@ exports.useBuildCollapsedList = function (listEl, children, maxWidth) {
62
62
  });
63
63
  // don't collapse the root breadcrumb
64
64
  var collapsibleListItems = listItems.slice(1);
65
- var collaspedList = buildCollapsedList(collapsibleListItems, containerWidth, maxWidth);
66
- setCollapsedItems(collaspedList);
65
+ var collapsedList = buildCollapsedList(collapsibleListItems, containerWidth, maxWidth);
66
+ setCollapsedItems(collapsedList);
67
67
  // eslint-disable-next-line react-hooks/exhaustive-deps
68
68
  }, [maxWidth]);
69
69
  var collapsedItemIndices = collapsedItems.map(function (child) { return child.index; });
@@ -9,7 +9,7 @@ export declare const useBuildCollapsedList: <E extends HTMLElement>(listEl: Reac
9
9
  };
10
10
  export declare const useTruncateTooltip: (ref?: React.RefObject<HTMLSpanElement> | undefined) => {
11
11
  isTooltipOpen: boolean;
12
- openTooltip: (event: React.MouseEvent<Element, MouseEvent> | React.FocusEvent<Element>) => void;
12
+ openTooltip: (event: React.MouseEvent<Element, MouseEvent> | React.FocusEvent<Element, Element>) => void;
13
13
  closeTooltip: () => void;
14
14
  shouldShowTooltip: boolean;
15
15
  tooltipProps: {
@@ -12,7 +12,7 @@ export var useCollapse = function (listEl, maxWidth) {
12
12
  };
13
13
  var getBreadcrumbLink = function (breadcrumb) {
14
14
  return Children.toArray(breadcrumb.props.children).filter(function (child) {
15
- return child.type === BreadcrumbLink;
15
+ return React.isValidElement(child) && child.type === BreadcrumbLink;
16
16
  })[0];
17
17
  };
18
18
  var buildCollapsedList = function (list, containerWidth, maxWidth, collapsedList) {
@@ -42,7 +42,7 @@ export var useBuildCollapsedList = function (listEl, children, maxWidth) {
42
42
  var breadcrumbLink = getBreadcrumbLink(child);
43
43
  // We should make this match work better
44
44
  var listItemNode = listItemNodes[index];
45
- // We might need to allow folks to spead more props from the link
45
+ // We might need to allow folks to spread more props from the link
46
46
  listItems.push({
47
47
  index: index,
48
48
  link: ((_a = breadcrumbLink === null || breadcrumbLink === void 0 ? void 0 : breadcrumbLink.props) === null || _a === void 0 ? void 0 : _a.href) || '',
@@ -53,8 +53,8 @@ export var useBuildCollapsedList = function (listEl, children, maxWidth) {
53
53
  });
54
54
  // don't collapse the root breadcrumb
55
55
  var collapsibleListItems = listItems.slice(1);
56
- var collaspedList = buildCollapsedList(collapsibleListItems, containerWidth, maxWidth);
57
- setCollapsedItems(collaspedList);
56
+ var collapsedList = buildCollapsedList(collapsibleListItems, containerWidth, maxWidth);
57
+ setCollapsedItems(collapsedList);
58
58
  // eslint-disable-next-line react-hooks/exhaustive-deps
59
59
  }, [maxWidth]);
60
60
  var collapsedItemIndices = collapsedItems.map(function (child) { return child.index; });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-preview-react",
3
- "version": "6.0.0-beta.0-next.16+2c70e470",
3
+ "version": "6.0.3",
4
4
  "description": "Canvas Kit Preview is made up of components that have the full design and a11y review, are part of the DS ecosystem and are approved for use in product. The API's could be subject to change, but not without strong communication and migration strategies.",
5
5
  "author": "Workday, Inc. (https://www.workday.com)",
6
6
  "license": "Apache-2.0",
@@ -54,15 +54,14 @@
54
54
  "@emotion/core": "^10.0.28",
55
55
  "@emotion/styled": "^10.0.27",
56
56
  "@types/uuid": "^3.4.4",
57
- "@workday/canvas-kit-react": "^6.0.0-beta.0-next.16+2c70e470",
57
+ "@workday/canvas-kit-react": "^6.0.3",
58
58
  "@workday/canvas-system-icons-web": "1.0.41",
59
59
  "@workday/design-assets-types": "^0.2.4",
60
60
  "uuid": "^3.3.3"
61
61
  },
62
62
  "devDependencies": {
63
- "@material-ui/core": "^4.9.7",
64
63
  "@workday/canvas-accent-icons-web": "^1.0.0",
65
- "@workday/canvas-kit-labs-react": "^6.0.0-beta.0-next.16+2c70e470"
64
+ "@workday/canvas-kit-labs-react": "^6.0.3"
66
65
  },
67
- "gitHead": "2c70e470ff0afecfdd18ea96837ab7f19f812128"
66
+ "gitHead": "735c60ddf52268f643c72ceb915e896906f74bcc"
68
67
  }
@@ -9,7 +9,7 @@ export declare const useBuildCollapsedList: <E extends HTMLElement>(listEl: Reac
9
9
  };
10
10
  export declare const useTruncateTooltip: (ref?: React.RefObject<HTMLSpanElement> | undefined) => {
11
11
  isTooltipOpen: boolean;
12
- openTooltip: (event: React.MouseEvent<Element, MouseEvent> | React.FocusEvent<Element>) => void;
12
+ openTooltip: (event: React.MouseEvent<Element, MouseEvent> | React.FocusEvent<Element, Element>) => void;
13
13
  closeTooltip: () => void;
14
14
  shouldShowTooltip: boolean;
15
15
  tooltipProps: {
@@ -9,7 +9,7 @@ export declare const useBuildCollapsedList: <E extends HTMLElement>(listEl: Reac
9
9
  };
10
10
  export declare const useTruncateTooltip: (ref?: React.RefObject<HTMLSpanElement> | undefined) => {
11
11
  isTooltipOpen: boolean;
12
- openTooltip: (event: React.MouseEvent<Element, MouseEvent> | React.FocusEvent<Element>) => void;
12
+ openTooltip: (event: React.MouseEvent<Element, MouseEvent> | React.FocusEvent<Element, Element>) => void;
13
13
  closeTooltip: () => void;
14
14
  shouldShowTooltip: boolean;
15
15
  tooltipProps: {