@workday/canvas-kit-react 9.1.9 → 9.1.11

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.
@@ -7,10 +7,10 @@ export const reorganizeHiddenItems = (
7
7
  const totalSize = items.length;
8
8
  const itemSpace = totalSize - hiddenIds.length;
9
9
 
10
- if (itemSpace <= 2) {
10
+ if (totalSize > 2 && itemSpace <= 2) {
11
11
  // Keep only last items if there is place for two or less items
12
12
  updatedHiddenIds = items.slice(0, totalSize - 1).map(getId);
13
- } else if (itemSpace === 3) {
13
+ } else if (totalSize > 3 && itemSpace === 3) {
14
14
  // Always keep first and last item if there is place for 3 items
15
15
  updatedHiddenIds = items.slice(1, totalSize - 1).map(getId);
16
16
  } else if (itemSpace > 3 && itemSpace < totalSize) {
@@ -32,7 +32,7 @@ const colorPriority = [
32
32
 
33
33
  /**
34
34
  *
35
- * Chooses foreground color with accesible contrast against background. If contrast ratio
35
+ * Chooses foreground color with accessible contrast against background. If contrast ratio
36
36
  * is greater than 4.5:1, chooses provided light or dark color (favoring light color). If neither
37
37
  * have a high enough contrast ratio, picks the first color of the following that meets 4.5:1 or higher:
38
38
  * [frenchVanilla100, blackPepper300, blackPepper400, blackPepper500, blackPepper600]
@@ -5,11 +5,11 @@ const reorganizeHiddenItems = (items, hiddenIds, getId) => {
5
5
  let updatedHiddenIds = hiddenIds;
6
6
  const totalSize = items.length;
7
7
  const itemSpace = totalSize - hiddenIds.length;
8
- if (itemSpace <= 2) {
8
+ if (totalSize > 2 && itemSpace <= 2) {
9
9
  // Keep only last items if there is place for two or less items
10
10
  updatedHiddenIds = items.slice(0, totalSize - 1).map(getId);
11
11
  }
12
- else if (itemSpace === 3) {
12
+ else if (totalSize > 3 && itemSpace === 3) {
13
13
  // Always keep first and last item if there is place for 3 items
14
14
  updatedHiddenIds = items.slice(1, totalSize - 1).map(getId);
15
15
  }
@@ -8,7 +8,7 @@ export declare function getColor(value?: CanvasColor | string): string | undefin
8
8
  export declare const expandHex: (hex: string) => string;
9
9
  /**
10
10
  *
11
- * Chooses foreground color with accesible contrast against background. If contrast ratio
11
+ * Chooses foreground color with accessible contrast against background. If contrast ratio
12
12
  * is greater than 4.5:1, chooses provided light or dark color (favoring light color). If neither
13
13
  * have a high enough contrast ratio, picks the first color of the following that meets 4.5:1 or higher:
14
14
  * [frenchVanilla100, blackPepper300, blackPepper400, blackPepper500, blackPepper600]
@@ -36,7 +36,7 @@ const colorPriority = [
36
36
  ];
37
37
  /**
38
38
  *
39
- * Chooses foreground color with accesible contrast against background. If contrast ratio
39
+ * Chooses foreground color with accessible contrast against background. If contrast ratio
40
40
  * is greater than 4.5:1, chooses provided light or dark color (favoring light color). If neither
41
41
  * have a high enough contrast ratio, picks the first color of the following that meets 4.5:1 or higher:
42
42
  * [frenchVanilla100, blackPepper300, blackPepper400, blackPepper500, blackPepper600]
@@ -2,11 +2,11 @@ export const reorganizeHiddenItems = (items, hiddenIds, getId) => {
2
2
  let updatedHiddenIds = hiddenIds;
3
3
  const totalSize = items.length;
4
4
  const itemSpace = totalSize - hiddenIds.length;
5
- if (itemSpace <= 2) {
5
+ if (totalSize > 2 && itemSpace <= 2) {
6
6
  // Keep only last items if there is place for two or less items
7
7
  updatedHiddenIds = items.slice(0, totalSize - 1).map(getId);
8
8
  }
9
- else if (itemSpace === 3) {
9
+ else if (totalSize > 3 && itemSpace === 3) {
10
10
  // Always keep first and last item if there is place for 3 items
11
11
  updatedHiddenIds = items.slice(1, totalSize - 1).map(getId);
12
12
  }
@@ -8,7 +8,7 @@ export declare function getColor(value?: CanvasColor | string): string | undefin
8
8
  export declare const expandHex: (hex: string) => string;
9
9
  /**
10
10
  *
11
- * Chooses foreground color with accesible contrast against background. If contrast ratio
11
+ * Chooses foreground color with accessible contrast against background. If contrast ratio
12
12
  * is greater than 4.5:1, chooses provided light or dark color (favoring light color). If neither
13
13
  * have a high enough contrast ratio, picks the first color of the following that meets 4.5:1 or higher:
14
14
  * [frenchVanilla100, blackPepper300, blackPepper400, blackPepper500, blackPepper600]
@@ -28,7 +28,7 @@ const colorPriority = [
28
28
  ];
29
29
  /**
30
30
  *
31
- * Chooses foreground color with accesible contrast against background. If contrast ratio
31
+ * Chooses foreground color with accessible contrast against background. If contrast ratio
32
32
  * is greater than 4.5:1, chooses provided light or dark color (favoring light color). If neither
33
33
  * have a high enough contrast ratio, picks the first color of the following that meets 4.5:1 or higher:
34
34
  * [frenchVanilla100, blackPepper300, blackPepper400, blackPepper500, blackPepper600]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-react",
3
- "version": "9.1.9",
3
+ "version": "9.1.11",
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",
@@ -49,7 +49,7 @@
49
49
  "@emotion/styled": "^11.6.0",
50
50
  "@popperjs/core": "^2.5.4",
51
51
  "@workday/canvas-colors-web": "^2.0.0",
52
- "@workday/canvas-kit-popup-stack": "^9.1.9",
52
+ "@workday/canvas-kit-popup-stack": "^9.1.11",
53
53
  "@workday/canvas-system-icons-web": "^3.0.0",
54
54
  "@workday/design-assets-types": "^0.2.8",
55
55
  "chroma-js": "^2.1.0",
@@ -66,5 +66,5 @@
66
66
  "@workday/canvas-accent-icons-web": "^3.0.0",
67
67
  "@workday/canvas-applet-icons-web": "^2.0.0"
68
68
  },
69
- "gitHead": "f610f6c7b52360efa6252ce5d16f6a732b1e5722"
69
+ "gitHead": "59071fde7d7166dd786144435c1263551ed88e1f"
70
70
  }