@workday/canvas-kit-react 9.0.12 → 9.0.14
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/common/lib/styles/accessibleHide.ts +1 -1
- package/dist/commonjs/common/lib/styles/accessibleHide.d.ts +1 -1
- package/dist/commonjs/common/lib/styles/accessibleHide.js +1 -1
- package/dist/commonjs/popup/lib/fallbackPlacements.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/fallbackPlacements.js +20 -1
- package/dist/es6/common/lib/styles/accessibleHide.d.ts +1 -1
- package/dist/es6/common/lib/styles/accessibleHide.js +1 -1
- package/dist/es6/popup/lib/fallbackPlacements.d.ts.map +1 -1
- package/dist/es6/popup/lib/fallbackPlacements.js +20 -1
- package/package.json +3 -3
- package/popup/lib/fallbackPlacements.ts +20 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {CSSProperties} from '@workday/canvas-kit-react/tokens';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* A utility to hide content
|
|
4
|
+
* A utility to visually hide content, while still making accessible to screenreaders
|
|
5
5
|
* See https://a11y-101.com/development/skip-link
|
|
6
6
|
*/
|
|
7
7
|
export const accessibleHide: CSSProperties = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSProperties } from '@workday/canvas-kit-react/tokens';
|
|
2
2
|
/**
|
|
3
|
-
* A utility to hide content
|
|
3
|
+
* A utility to visually hide content, while still making accessible to screenreaders
|
|
4
4
|
* See https://a11y-101.com/development/skip-link
|
|
5
5
|
*/
|
|
6
6
|
export declare const accessibleHide: CSSProperties;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.accessibleHide = void 0;
|
|
4
4
|
/**
|
|
5
|
-
* A utility to hide content
|
|
5
|
+
* A utility to visually hide content, while still making accessible to screenreaders
|
|
6
6
|
* See https://a11y-101.com/development/skip-link
|
|
7
7
|
*/
|
|
8
8
|
exports.accessibleHide = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fallbackPlacements.d.ts","sourceRoot":"","sources":["../../../../popup/lib/fallbackPlacements.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,IAAI,iBAAiB,
|
|
1
|
+
{"version":3,"file":"fallbackPlacements.d.ts","sourceRoot":"","sources":["../../../../popup/lib/fallbackPlacements.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,IAAI,iBAAiB,EAI9B,QAAQ,EAET,MAAM,gBAAgB,CAAC;AAExB,oBAAY,SAAS,GAAG,iBAAiB,CAAC;AA6E1C,oBAAY,OAAO,GAAG;IACpB,kBAAkB,EAAE,SAAS,EAAE,CAAC;CACjC,CAAC;AAEF,QAAA,MAAM,IAAI,qBAAqB,CAAC;AAEhC,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,OAAO,IAAI,EAAE,OAAO,CAwBrE,CAAC"}
|
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.fallbackPlacementsModifier = void 0;
|
|
4
4
|
const core_1 = require("@popperjs/core");
|
|
5
|
+
// We must use our own copy because the commonjs version of Popper doesn't export enums
|
|
6
|
+
// https://github.com/floating-ui/floating-ui/issues/1325
|
|
7
|
+
const placements = [
|
|
8
|
+
'top',
|
|
9
|
+
'top-start',
|
|
10
|
+
'top-end',
|
|
11
|
+
'bottom',
|
|
12
|
+
'bottom-start',
|
|
13
|
+
'bottom-end',
|
|
14
|
+
'right',
|
|
15
|
+
'right-start',
|
|
16
|
+
'right-end',
|
|
17
|
+
'left',
|
|
18
|
+
'left-start',
|
|
19
|
+
'left-end',
|
|
20
|
+
'auto',
|
|
21
|
+
'auto-start',
|
|
22
|
+
'auto-end'
|
|
23
|
+
];
|
|
5
24
|
const getOppositePlacement = (popperPlacement) => {
|
|
6
25
|
var _a;
|
|
7
26
|
const [first, second] = popperPlacement.split('-');
|
|
@@ -24,7 +43,7 @@ const getOppositePlacement = (popperPlacement) => {
|
|
|
24
43
|
}
|
|
25
44
|
if (second) {
|
|
26
45
|
oppositePlacement =
|
|
27
|
-
(_a =
|
|
46
|
+
(_a = placements.find(placement => placement.includes(`${oppositePlacement}-${second}`))) !== null && _a !== void 0 ? _a : oppositePlacement;
|
|
28
47
|
}
|
|
29
48
|
return oppositePlacement;
|
|
30
49
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSProperties } from '@workday/canvas-kit-react/tokens';
|
|
2
2
|
/**
|
|
3
|
-
* A utility to hide content
|
|
3
|
+
* A utility to visually hide content, while still making accessible to screenreaders
|
|
4
4
|
* See https://a11y-101.com/development/skip-link
|
|
5
5
|
*/
|
|
6
6
|
export declare const accessibleHide: CSSProperties;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A utility to hide content
|
|
2
|
+
* A utility to visually hide content, while still making accessible to screenreaders
|
|
3
3
|
* See https://a11y-101.com/development/skip-link
|
|
4
4
|
*/
|
|
5
5
|
export const accessibleHide = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fallbackPlacements.d.ts","sourceRoot":"","sources":["../../../../popup/lib/fallbackPlacements.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,IAAI,iBAAiB,
|
|
1
|
+
{"version":3,"file":"fallbackPlacements.d.ts","sourceRoot":"","sources":["../../../../popup/lib/fallbackPlacements.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,IAAI,iBAAiB,EAI9B,QAAQ,EAET,MAAM,gBAAgB,CAAC;AAExB,oBAAY,SAAS,GAAG,iBAAiB,CAAC;AA6E1C,oBAAY,OAAO,GAAG;IACpB,kBAAkB,EAAE,SAAS,EAAE,CAAC;CACjC,CAAC;AAEF,QAAA,MAAM,IAAI,qBAAqB,CAAC;AAEhC,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,OAAO,IAAI,EAAE,OAAO,CAwBrE,CAAC"}
|
|
@@ -1,4 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { detectOverflow, } from '@popperjs/core';
|
|
2
|
+
// We must use our own copy because the commonjs version of Popper doesn't export enums
|
|
3
|
+
// https://github.com/floating-ui/floating-ui/issues/1325
|
|
4
|
+
const placements = [
|
|
5
|
+
'top',
|
|
6
|
+
'top-start',
|
|
7
|
+
'top-end',
|
|
8
|
+
'bottom',
|
|
9
|
+
'bottom-start',
|
|
10
|
+
'bottom-end',
|
|
11
|
+
'right',
|
|
12
|
+
'right-start',
|
|
13
|
+
'right-end',
|
|
14
|
+
'left',
|
|
15
|
+
'left-start',
|
|
16
|
+
'left-end',
|
|
17
|
+
'auto',
|
|
18
|
+
'auto-start',
|
|
19
|
+
'auto-end'
|
|
20
|
+
];
|
|
2
21
|
const getOppositePlacement = (popperPlacement) => {
|
|
3
22
|
var _a;
|
|
4
23
|
const [first, second] = popperPlacement.split('-');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-react",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.14",
|
|
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.0.
|
|
52
|
+
"@workday/canvas-kit-popup-stack": "^9.0.14",
|
|
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": "
|
|
69
|
+
"gitHead": "424363fb5db513d5d38217f89afa6be739ae4a44"
|
|
70
70
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Placement as PopperJSPlacement,
|
|
3
|
-
placements,
|
|
4
3
|
State,
|
|
5
4
|
detectOverflow,
|
|
6
5
|
SideObject,
|
|
@@ -10,6 +9,26 @@ import {
|
|
|
10
9
|
|
|
11
10
|
export type Placement = PopperJSPlacement; // Use template literals to make documentation list them out
|
|
12
11
|
|
|
12
|
+
// We must use our own copy because the commonjs version of Popper doesn't export enums
|
|
13
|
+
// https://github.com/floating-ui/floating-ui/issues/1325
|
|
14
|
+
const placements: Placement[] = [
|
|
15
|
+
'top',
|
|
16
|
+
'top-start',
|
|
17
|
+
'top-end',
|
|
18
|
+
'bottom',
|
|
19
|
+
'bottom-start',
|
|
20
|
+
'bottom-end',
|
|
21
|
+
'right',
|
|
22
|
+
'right-start',
|
|
23
|
+
'right-end',
|
|
24
|
+
'left',
|
|
25
|
+
'left-start',
|
|
26
|
+
'left-end',
|
|
27
|
+
'auto',
|
|
28
|
+
'auto-start',
|
|
29
|
+
'auto-end'
|
|
30
|
+
];
|
|
31
|
+
|
|
13
32
|
const getOppositePlacement = (popperPlacement: Placement): Placement => {
|
|
14
33
|
const [first, second] = popperPlacement.split('-');
|
|
15
34
|
let oppositePlacement: Placement;
|