@workday/canvas-kit-react 9.0.0-alpha.344-next.3 → 9.0.0-alpha.350-next.4
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/focusRing.ts +0 -9
- package/common/lib/theming/createCanvasTheme.ts +39 -42
- package/common/lib/theming/getObjectProxy.ts +31 -19
- package/common/lib/theming/useTheme.ts +1 -2
- package/common/lib/utils/deepMerge.ts +21 -0
- package/common/lib/utils/memoize.ts +23 -0
- package/dist/commonjs/common/lib/styles/focusRing.d.ts +0 -3
- package/dist/commonjs/common/lib/styles/focusRing.d.ts.map +1 -1
- package/dist/commonjs/common/lib/styles/focusRing.js +2 -16
- package/dist/commonjs/common/lib/theming/createCanvasTheme.d.ts +7 -6
- package/dist/commonjs/common/lib/theming/createCanvasTheme.d.ts.map +1 -1
- package/dist/commonjs/common/lib/theming/createCanvasTheme.js +34 -30
- package/dist/commonjs/common/lib/theming/getObjectProxy.d.ts +9 -3
- package/dist/commonjs/common/lib/theming/getObjectProxy.d.ts.map +1 -1
- package/dist/commonjs/common/lib/theming/getObjectProxy.js +20 -20
- package/dist/commonjs/common/lib/theming/useTheme.d.ts.map +1 -1
- package/dist/commonjs/common/lib/theming/useTheme.js +2 -5
- package/dist/commonjs/common/lib/utils/deepMerge.d.ts +2 -0
- package/dist/commonjs/common/lib/utils/deepMerge.d.ts.map +1 -0
- package/dist/commonjs/common/lib/utils/deepMerge.js +24 -0
- package/dist/commonjs/common/lib/utils/memoize.d.ts +6 -0
- package/dist/commonjs/common/lib/utils/memoize.d.ts.map +1 -0
- package/dist/commonjs/common/lib/utils/memoize.js +24 -0
- package/dist/commonjs/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/commonjs/side-panel/lib/SidePanel.js +1 -2
- package/dist/commonjs/tokens/lib/type/fontFamilies.d.ts.map +1 -1
- package/dist/commonjs/tokens/lib/type/fontFamilies.js +5 -6
- package/dist/commonjs/tooltip/lib/useTooltip.d.ts.map +1 -1
- package/dist/commonjs/tooltip/lib/useTooltip.js +16 -11
- package/dist/es6/common/lib/styles/focusRing.d.ts +0 -3
- package/dist/es6/common/lib/styles/focusRing.d.ts.map +1 -1
- package/dist/es6/common/lib/styles/focusRing.js +1 -12
- package/dist/es6/common/lib/theming/createCanvasTheme.d.ts +7 -6
- package/dist/es6/common/lib/theming/createCanvasTheme.d.ts.map +1 -1
- package/dist/es6/common/lib/theming/createCanvasTheme.js +32 -27
- package/dist/es6/common/lib/theming/getObjectProxy.d.ts +9 -3
- package/dist/es6/common/lib/theming/getObjectProxy.d.ts.map +1 -1
- package/dist/es6/common/lib/theming/getObjectProxy.js +20 -20
- package/dist/es6/common/lib/theming/useTheme.d.ts.map +1 -1
- package/dist/es6/common/lib/theming/useTheme.js +2 -2
- package/dist/es6/common/lib/utils/deepMerge.d.ts +2 -0
- package/dist/es6/common/lib/utils/deepMerge.d.ts.map +1 -0
- package/dist/es6/common/lib/utils/deepMerge.js +20 -0
- package/dist/es6/common/lib/utils/memoize.d.ts +6 -0
- package/dist/es6/common/lib/utils/memoize.d.ts.map +1 -0
- package/dist/es6/common/lib/utils/memoize.js +20 -0
- package/dist/es6/side-panel/lib/SidePanel.d.ts.map +1 -1
- package/dist/es6/side-panel/lib/SidePanel.js +1 -2
- package/dist/es6/tokens/lib/type/fontFamilies.d.ts.map +1 -1
- package/dist/es6/tokens/lib/type/fontFamilies.js +5 -3
- package/dist/es6/tooltip/lib/useTooltip.d.ts.map +1 -1
- package/dist/es6/tooltip/lib/useTooltip.js +16 -11
- package/package.json +3 -4
- package/side-panel/lib/SidePanel.tsx +1 -2
- package/tokens/lib/type/fontFamilies.ts +5 -4
- package/tooltip/lib/useTooltip.tsx +18 -11
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.memoize = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Simple memoize function. It takes a function and a resolver function to generate a
|
|
6
|
+
* cache key
|
|
7
|
+
*/
|
|
8
|
+
function memoize(func, resolver) {
|
|
9
|
+
var cache = new Map();
|
|
10
|
+
return function () {
|
|
11
|
+
var args = [];
|
|
12
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
13
|
+
args[_i] = arguments[_i];
|
|
14
|
+
}
|
|
15
|
+
var key = resolver.apply(void 0, args);
|
|
16
|
+
if (cache.has(key)) {
|
|
17
|
+
return cache.get(key);
|
|
18
|
+
}
|
|
19
|
+
var result = func.apply(void 0, args);
|
|
20
|
+
cache.set(key, result);
|
|
21
|
+
return result;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
exports.memoize = memoize;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAgB,iBAAiB,EAAC,MAAM,kCAAkC,CAAC;AAKlF,MAAM,WAAW,cAAe,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC1E;;;OAGG;IACH,IAAI,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAClC;;;OAGG;IACH,aAAa,CAAC,EAAE,sBAAsB,CAAC;IACvC;;OAEG;IACH,kBAAkB,CAAC,EAAE,CAAC,eAAe,EAAE,OAAO,KAAK,IAAI,CAAC;IACxD;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,eAAe,CAAC,EAAE,wBAAwB,CAAC;IAC3C;;;OAGG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC;;;OAGG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,oBAAY,sBAAsB;IAChC,IAAI,IAAA;IACJ,KAAK,IAAA;CACN;AAED,oBAAY,wBAAwB;IAClC,KAAK,IAAA;IACL,WAAW,IAAA;IACX,IAAI,IAAA;CACL;AAwFD,qBAAa,SAAU,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,EAAE,cAAc,CAAC;IAC5E,MAAM,CAAC,aAAa,gCAA0B;IAC9C,MAAM,CAAC,eAAe,kCAA4B;gBAEtC,KAAK,EAAE,cAAc;IAKjC,KAAK;;MAEH;IAEK,iBAAiB;IAGjB,oBAAoB;IAIpB,MAAM;IAgDb,OAAO,CAAC,YAAY,CAWlB;IAEF,OAAO,CAAC,aAAa,CAInB;IAEF,OAAO,CAAC,qBAAqB,CAS3B;CACH"}
|
|
@@ -62,7 +62,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
62
62
|
exports.SidePanel = exports.SidePanelBackgroundColor = exports.SidePanelOpenDirection = void 0;
|
|
63
63
|
var React = __importStar(require("react"));
|
|
64
64
|
var styled_1 = __importDefault(require("@emotion/styled"));
|
|
65
|
-
var throttle_1 = __importDefault(require("lodash/throttle"));
|
|
66
65
|
var tokens_1 = require("@workday/canvas-kit-react/tokens");
|
|
67
66
|
var button_1 = require("@workday/canvas-kit-react/button");
|
|
68
67
|
var canvas_system_icons_web_1 = require("@workday/canvas-system-icons-web");
|
|
@@ -190,7 +189,7 @@ var SidePanel = /** @class */ (function (_super) {
|
|
|
190
189
|
return open ? canvas_system_icons_web_1.chevronRightIcon : canvas_system_icons_web_1.chevronLeftIcon;
|
|
191
190
|
}
|
|
192
191
|
};
|
|
193
|
-
_this.handleResize =
|
|
192
|
+
_this.handleResize = _this.handleResize.bind(_this);
|
|
194
193
|
return _this;
|
|
195
194
|
}
|
|
196
195
|
SidePanel.prototype.componentDidMount = function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fontFamilies.d.ts","sourceRoot":"","sources":["../../../../../tokens/lib/type/fontFamilies.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fontFamilies.d.ts","sourceRoot":"","sources":["../../../../../tokens/lib/type/fontFamilies.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,UAAU,QAEyC,CAAC;AACjE,eAAO,MAAM,cAAc,QAGgD,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,YAAY,EAAE,kBAG1B,CAAC;AAEF,oBAAY,kBAAkB,GAAG;IAC/B;;;SAGK;IACL,OAAO,EAAE,OAAO,UAAU,CAAC;IAC3B;;;SAGK;IACL,SAAS,EAAE,OAAO,cAAc,CAAC;CAClC,CAAC"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.fontFamilies = exports.monoFontFamily = exports.fontFamily = void 0;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var
|
|
4
|
+
// prettier-ignore
|
|
5
|
+
//@ts-ignore
|
|
6
|
+
var canvasObject = typeof window !== 'undefined' && window.workday && window.workday.canvas && window.workday.canvas;
|
|
7
|
+
var inheritFont = typeof canvasObject !== 'undefined' && canvasObject.inheritFontFamily;
|
|
8
|
+
var inheritMonoFont = typeof canvasObject !== 'undefined' && canvasObject.inheritMonoFontFamily;
|
|
10
9
|
exports.fontFamily = inheritFont
|
|
11
10
|
? 'inherit'
|
|
12
11
|
: '"Roboto", "Helvetica Neue", "Helvetica", Arial, sans-serif';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTooltip.d.ts","sourceRoot":"","sources":["../../../../tooltip/lib/useTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAmD/B;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,EAAE,EACtD,IAAc,EACd,SAAc,EACd,SAAe,EACf,SAAe,GAChB,GAAE;IACD;;;;;;;;;;;;;;;OAeG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,OAAO,CAAC;IACtC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACf;
|
|
1
|
+
{"version":3,"file":"useTooltip.d.ts","sourceRoot":"","sources":["../../../../tooltip/lib/useTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAmD/B;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,EAAE,EACtD,IAAc,EACd,SAAc,EACd,SAAe,EACf,SAAe,GAChB,GAAE;IACD;;;;;;;;;;;;;;;OAeG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,OAAO,CAAC;IACtC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACf;IA+DF,2EAA2E;;;;8BA7C5C,MAAM,cAAc;;6BAazB,gBAAgB;yBARpB,gBAAgB;;;IA0CtC,uDAAuD;;;;;;IAMvD,iEAAiE;;;;;;;EAQpE"}
|
|
@@ -99,19 +99,24 @@ function useTooltip(_a) {
|
|
|
99
99
|
popup_1.useCloseOnFullscreenExit(popupModel);
|
|
100
100
|
popup_1.useCloseOnTargetHidden(popupModel);
|
|
101
101
|
var visible = popupModel.state.visibility !== 'hidden';
|
|
102
|
+
var targetProps = {
|
|
103
|
+
// extra description of the target element for assistive technology
|
|
104
|
+
'aria-describedby': type === 'describe' && visible ? id : undefined,
|
|
105
|
+
// This will replace the accessible name of the target element
|
|
106
|
+
'aria-label': type === 'label' ? titleText : undefined,
|
|
107
|
+
onMouseEnter: onOpenFromTarget,
|
|
108
|
+
onMouseLeave: onHide,
|
|
109
|
+
onMouseDown: onMouseDown,
|
|
110
|
+
onFocus: onFocus,
|
|
111
|
+
onBlur: onHide,
|
|
112
|
+
};
|
|
113
|
+
// remove `aria-describedby` if undefined to not override what's provided
|
|
114
|
+
if (targetProps['aria-describedby'] === undefined) {
|
|
115
|
+
delete targetProps['aria-describedby'];
|
|
116
|
+
}
|
|
102
117
|
return {
|
|
103
118
|
/** Mix these properties into the target element. **Must be an Element** */
|
|
104
|
-
targetProps:
|
|
105
|
-
// extra description of the target element for assistive technology
|
|
106
|
-
'aria-describedby': type === 'describe' && visible ? id : undefined,
|
|
107
|
-
// This will replace the accessible name of the target element
|
|
108
|
-
'aria-label': type === 'label' ? titleText : undefined,
|
|
109
|
-
onMouseEnter: onOpenFromTarget,
|
|
110
|
-
onMouseLeave: onHide,
|
|
111
|
-
onMouseDown: onMouseDown,
|
|
112
|
-
onFocus: onFocus,
|
|
113
|
-
onBlur: onHide,
|
|
114
|
-
},
|
|
119
|
+
targetProps: targetProps,
|
|
115
120
|
/** Mix these properties into the `Popper` component */
|
|
116
121
|
popperProps: {
|
|
117
122
|
open: visible,
|
|
@@ -12,10 +12,7 @@ interface FocusRingOptions {
|
|
|
12
12
|
inset?: 'inner' | 'outer';
|
|
13
13
|
innerColor?: string;
|
|
14
14
|
outerColor?: string;
|
|
15
|
-
memoize?: boolean;
|
|
16
15
|
}
|
|
17
|
-
declare function calculateFocusRing({ width, separation, animate, inset, innerColor, outerColor, }: Required<Omit<FocusRingOptions, 'memoize' | 'inset'>> & Pick<FocusRingOptions, 'inset'>): CSSObject;
|
|
18
|
-
export declare const memoizedFocusRing: typeof calculateFocusRing & import("lodash").MemoizedFunction;
|
|
19
16
|
/**
|
|
20
17
|
* A utility to create a canvas style focus ring around your widget.
|
|
21
18
|
* By default, this mixin will create a 2px focus ring tightly wrapped
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focusRing.d.ts","sourceRoot":"","sources":["../../../../../common/lib/styles/focusRing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"focusRing.d.ts","sourceRoot":"","sources":["../../../../../common/lib/styles/focusRing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAI3D,UAAU,gBAAgB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AA6CD;;;;;;;;;;;;;;GAcG;AAEH;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE,gBAAqB,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,SAAS,CAsBlF"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { keyframes } from '@emotion/react';
|
|
2
2
|
import { canvas } from '@workday/canvas-kit-react/tokens';
|
|
3
3
|
import { defaultCanvasTheme } from '../theming/index';
|
|
4
|
-
import memoize from 'lodash/memoize';
|
|
5
4
|
function calculateFocusRing(_a) {
|
|
6
5
|
var width = _a.width, separation = _a.separation, animate = _a.animate, inset = _a.inset, innerColor = _a.innerColor, outerColor = _a.outerColor;
|
|
7
6
|
var boxShadow, innerWidth, outerWidth;
|
|
@@ -31,13 +30,6 @@ function calculateFocusRing(_a) {
|
|
|
31
30
|
}
|
|
32
31
|
return { boxShadow: boxShadow };
|
|
33
32
|
}
|
|
34
|
-
export var memoizedFocusRing = memoize(calculateFocusRing, function () {
|
|
35
|
-
var args = [];
|
|
36
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
37
|
-
args[_i] = arguments[_i];
|
|
38
|
-
}
|
|
39
|
-
return JSON.stringify(args);
|
|
40
|
-
});
|
|
41
33
|
/**
|
|
42
34
|
* A utility to create a canvas style focus ring around your widget.
|
|
43
35
|
* By default, this mixin will create a 2px focus ring tightly wrapped
|
|
@@ -64,7 +56,7 @@ export function focusRing(options, theme) {
|
|
|
64
56
|
if (options === void 0) { options = {}; }
|
|
65
57
|
var _a = options.width, width = _a === void 0 ? 2 : _a, _b = options.separation, separation = _b === void 0 ? 0 : _b, _c = options.animate, animate = _c === void 0 ? true : _c, _d = options.innerColor, innerColor = _d === void 0 ? canvas.colors.frenchVanilla100 : _d, _e = options.outerColor, outerColor = _e === void 0 ? theme && theme.canvas
|
|
66
58
|
? theme.canvas.palette.common.focusOutline
|
|
67
|
-
: defaultCanvasTheme.palette.common.focusOutline : _e,
|
|
59
|
+
: defaultCanvasTheme.palette.common.focusOutline : _e, inset = options.inset;
|
|
68
60
|
var args = {
|
|
69
61
|
width: width,
|
|
70
62
|
separation: separation,
|
|
@@ -73,8 +65,5 @@ export function focusRing(options, theme) {
|
|
|
73
65
|
animate: animate,
|
|
74
66
|
inset: inset,
|
|
75
67
|
};
|
|
76
|
-
if (memoize) {
|
|
77
|
-
return memoizedFocusRing(args);
|
|
78
|
-
}
|
|
79
68
|
return calculateFocusRing(args);
|
|
80
69
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { CanvasTheme, PartialCanvasTheme } from './types';
|
|
2
|
-
export declare
|
|
3
|
-
Darken = 0,
|
|
4
|
-
Brighten = 1
|
|
5
|
-
}
|
|
6
|
-
export declare function shiftColor(hexColor: string, direction: ColorDirection): string;
|
|
2
|
+
export declare const shiftColor: (hexColor: string, amount?: any) => string;
|
|
7
3
|
declare function calculateCanvasTheme(partialTheme: PartialCanvasTheme): CanvasTheme;
|
|
8
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Creates a full {@link CanvasTheme} from any partial theme by deeply merging with the
|
|
6
|
+
* `defaultCanvasTheme` object. The function is memoized, but it is best to run this function
|
|
7
|
+
* only once and save the result.
|
|
8
|
+
*/
|
|
9
|
+
export declare const createCanvasTheme: typeof calculateCanvasTheme;
|
|
9
10
|
export {};
|
|
10
11
|
//# sourceMappingURL=createCanvasTheme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCanvasTheme.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/createCanvasTheme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createCanvasTheme.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/createCanvasTheme.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,WAAW,EACX,kBAAkB,EAInB,MAAM,SAAS,CAAC;AAQjB,eAAO,MAAM,UAAU,aACV,MAAM,yBA+BlB,CAAC;AA+BF,iBAAS,oBAAoB,CAAC,YAAY,EAAE,kBAAkB,GAAG,WAAW,CAkB3E;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,6BAAmE,CAAC"}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
1
12
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
13
|
var t = {};
|
|
3
14
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -10,59 +21,48 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
21
|
return t;
|
|
11
22
|
};
|
|
12
23
|
import chroma from 'chroma-js';
|
|
13
|
-
import merge from 'lodash/merge';
|
|
14
|
-
import memoize from 'lodash/memoize';
|
|
15
|
-
import findKey from 'lodash/findKey';
|
|
16
24
|
import colors from '@workday/canvas-colors-web';
|
|
17
25
|
import { defaultCanvasTheme } from './theme';
|
|
18
26
|
import { ContentDirection, } from './types';
|
|
19
27
|
import { pickForegroundColor } from '../utils';
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var canvasColor = findKey(colors, function (color) { return color === hexColor; });
|
|
27
|
-
var darken = direction === ColorDirection.Darken;
|
|
28
|
+
// Should these be exported?
|
|
29
|
+
import { deepMerge } from '../utils/deepMerge';
|
|
30
|
+
import { memoize } from '../utils/memoize';
|
|
31
|
+
export var shiftColor = memoize(function (hexColor, amount) {
|
|
32
|
+
if (amount === void 0) { amount = 100; }
|
|
33
|
+
var canvasColor = Object.keys(colors).find(function (color) { return colors[color] === hexColor; });
|
|
28
34
|
if (canvasColor) {
|
|
29
35
|
var colorRegex = /([a-zAz]*)(\d{3})/g;
|
|
30
36
|
var match = colorRegex.exec(canvasColor);
|
|
31
37
|
if (match) {
|
|
32
38
|
var baseColor = match[1];
|
|
33
39
|
var shadeNumber = parseInt(match[2], 10);
|
|
34
|
-
var newShade =
|
|
40
|
+
var newShade = shadeNumber + amount;
|
|
35
41
|
if (newShade >= 100 && newShade <= 600) {
|
|
36
42
|
return colors[(baseColor + newShade)];
|
|
37
43
|
}
|
|
38
44
|
}
|
|
39
45
|
}
|
|
40
46
|
try {
|
|
41
|
-
var newColor =
|
|
47
|
+
var newColor = amount > 0
|
|
48
|
+
? chroma(hexColor).darken(amount / 100)
|
|
49
|
+
: chroma(hexColor).brighten(-amount / 100);
|
|
42
50
|
return newColor.hex();
|
|
43
51
|
}
|
|
44
52
|
catch (e) {
|
|
45
53
|
console.warn("Invalid color '" + hexColor + "' used in theme");
|
|
46
54
|
return hexColor;
|
|
47
55
|
}
|
|
48
|
-
}
|
|
56
|
+
}, function (color, value) { return color + "." + value; });
|
|
49
57
|
function fillPalette(defaultPalette, palette) {
|
|
50
58
|
if (!palette) {
|
|
51
59
|
return {};
|
|
52
60
|
}
|
|
53
61
|
var main = palette.main || defaultPalette.main;
|
|
54
|
-
var dark = palette.dark ||
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
var
|
|
58
|
-
(palette.main && shiftColor(dark, ColorDirection.Darken)) ||
|
|
59
|
-
defaultPalette.darkest;
|
|
60
|
-
var light = palette.light ||
|
|
61
|
-
(palette.main && shiftColor(palette.main, ColorDirection.Brighten)) ||
|
|
62
|
-
defaultPalette.light;
|
|
63
|
-
var lightest = palette.lightest ||
|
|
64
|
-
(palette.main && shiftColor(light, ColorDirection.Brighten)) ||
|
|
65
|
-
defaultPalette.lightest;
|
|
62
|
+
var dark = palette.dark || (palette.main && shiftColor(palette.main, 100)) || defaultPalette.dark;
|
|
63
|
+
var darkest = palette.darkest || (palette.main && shiftColor(palette.main, 200)) || defaultPalette.darkest;
|
|
64
|
+
var light = palette.light || (palette.main && shiftColor(palette.main, -100)) || defaultPalette.light;
|
|
65
|
+
var lightest = palette.lightest || (palette.main && shiftColor(palette.main, -200)) || defaultPalette.lightest;
|
|
66
66
|
var contrast = palette.contrast || pickForegroundColor(main) || defaultPalette.contrast;
|
|
67
67
|
return {
|
|
68
68
|
lightest: lightest,
|
|
@@ -88,8 +88,13 @@ function calculateCanvasTheme(partialTheme) {
|
|
|
88
88
|
breakpoints: breakpoints,
|
|
89
89
|
direction: direction === ContentDirection.RTL ? direction : ContentDirection.LTR,
|
|
90
90
|
};
|
|
91
|
-
return
|
|
91
|
+
return deepMerge(deepMerge({}, defaultCanvasTheme), __assign(__assign({}, mergeable), extraFields));
|
|
92
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Creates a full {@link CanvasTheme} from any partial theme by deeply merging with the
|
|
95
|
+
* `defaultCanvasTheme` object. The function is memoized, but it is best to run this function
|
|
96
|
+
* only once and save the result.
|
|
97
|
+
*/
|
|
93
98
|
export var createCanvasTheme = memoize(calculateCanvasTheme, function () {
|
|
94
99
|
var args = [];
|
|
95
100
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* For custom themes that do not overwrite every default.
|
|
3
|
+
*/
|
|
4
|
+
export declare type RecursivePartial<T> = {
|
|
5
|
+
[P in keyof T]?: RecursivePartial<T[P]>;
|
|
6
|
+
};
|
|
1
7
|
/**
|
|
2
8
|
* The functions gets a new object proxy. This is used for theme to ensure regardless of a partial theme object
|
|
3
9
|
* there will be a fallback theme object so that properties aren't undefined regardless of the `target` object.
|
|
4
10
|
* This function will also handle nested properties.
|
|
5
|
-
* @param target
|
|
6
|
-
* @param fallback A fallback
|
|
11
|
+
* @param target A partial object with up to the same shape as the `fallback` object
|
|
12
|
+
* @param fallback A fallback object. If a property to be accessed from the proxy is not available on the target object, the fallback object will be used
|
|
7
13
|
*/
|
|
8
|
-
export declare function getObjectProxy<T extends {}>(target:
|
|
14
|
+
export declare function getObjectProxy<T extends {}>(target: RecursivePartial<T> | undefined, fallback: T): T;
|
|
9
15
|
//# sourceMappingURL=getObjectProxy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getObjectProxy.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/getObjectProxy.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"getObjectProxy.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/getObjectProxy.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,gBAAgB,CAAC,CAAC,IAAI;KAC/B,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACxC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,EAAE,EACzC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,SAAS,EACvC,QAAQ,EAAE,CAAC,GACV,CAAC,CAmBH"}
|
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
* The functions gets a new object proxy. This is used for theme to ensure regardless of a partial theme object
|
|
3
3
|
* there will be a fallback theme object so that properties aren't undefined regardless of the `target` object.
|
|
4
4
|
* This function will also handle nested properties.
|
|
5
|
-
* @param target
|
|
6
|
-
* @param fallback A fallback
|
|
5
|
+
* @param target A partial object with up to the same shape as the `fallback` object
|
|
6
|
+
* @param fallback A fallback object. If a property to be accessed from the proxy is not available on the target object, the fallback object will be used
|
|
7
7
|
*/
|
|
8
|
-
/* eslint-disable compat/compat */
|
|
9
8
|
export function getObjectProxy(target, fallback) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return fallback
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
}
|
|
9
|
+
if (target) {
|
|
10
|
+
return new Proxy(target, {
|
|
11
|
+
get: function (target, prop, receiver) {
|
|
12
|
+
if (typeof fallback[prop] === 'object') {
|
|
13
|
+
return getObjectProxy(target[prop], fallback[prop]);
|
|
14
|
+
}
|
|
15
|
+
var targetProp = target[prop];
|
|
16
|
+
if (targetProp !== undefined) {
|
|
17
|
+
return targetProp;
|
|
18
|
+
}
|
|
19
|
+
return Reflect.get(fallback, prop, receiver);
|
|
20
|
+
},
|
|
21
|
+
ownKeys: function () {
|
|
22
|
+
return Reflect.ownKeys(fallback);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return fallback;
|
|
27
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/useTheme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../../../common/lib/theming/useTheme.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,kBAAkB,EAClB,yBAAyB,EAC1B,MAAM,SAAS,CAAC;AAOjB;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,QAAQ,CAAC,KAAK,CAAC,EAAE,yBAAyB,GAAG,kBAAkB,CAqB9E"}
|
|
@@ -9,7 +9,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import get from 'lodash/get';
|
|
13
12
|
import { useTheme as useEmotionTheme } from '@emotion/react';
|
|
14
13
|
import { defaultCanvasTheme, createCanvasTheme, } from './index';
|
|
15
14
|
var getFilledTheme = function (theme) { return (__assign(__assign({}, theme), { canvas: createCanvasTheme(theme.canvas) })); };
|
|
@@ -32,6 +31,7 @@ var getFilledTheme = function (theme) { return (__assign(__assign({}, theme), {
|
|
|
32
31
|
* Tracked on https://github.com/emotion-js/emotion/issues/1193.
|
|
33
32
|
*/
|
|
34
33
|
export function useTheme(theme) {
|
|
34
|
+
var _a, _b, _c;
|
|
35
35
|
if (theme && theme.canvas) {
|
|
36
36
|
return getFilledTheme(theme);
|
|
37
37
|
}
|
|
@@ -45,7 +45,7 @@ export function useTheme(theme) {
|
|
|
45
45
|
catch (e) {
|
|
46
46
|
// Context not supported or invalid (probably called from within a class component)
|
|
47
47
|
}
|
|
48
|
-
var windowTheme = typeof window !== 'undefined' &&
|
|
48
|
+
var windowTheme = typeof window !== 'undefined' && ((_c = (_b = (_a = window) === null || _a === void 0 ? void 0 : _a.workday) === null || _b === void 0 ? void 0 : _b.canvas) === null || _c === void 0 ? void 0 : _c.theme);
|
|
49
49
|
if (windowTheme) {
|
|
50
50
|
return getFilledTheme({ canvas: windowTheme });
|
|
51
51
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deepMerge.d.ts","sourceRoot":"","sources":["../../../../../common/lib/utils/deepMerge.ts"],"names":[],"mappings":"AACA,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAmB3D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var isObject = function (obj) { return obj && typeof obj === 'object'; };
|
|
2
|
+
export function deepMerge(target, source) {
|
|
3
|
+
if (!isObject(target) || !isObject(source)) {
|
|
4
|
+
return source;
|
|
5
|
+
}
|
|
6
|
+
Object.keys(source).forEach(function (key) {
|
|
7
|
+
var targetValue = target[key];
|
|
8
|
+
var sourceValue = source[key];
|
|
9
|
+
if (Array.isArray(targetValue) && Array.isArray(sourceValue)) {
|
|
10
|
+
target[key] = targetValue.concat(sourceValue);
|
|
11
|
+
}
|
|
12
|
+
else if (isObject(targetValue) && isObject(sourceValue)) {
|
|
13
|
+
target[key] = deepMerge(Object.assign({}, targetValue), sourceValue);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
target[key] = sourceValue;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
return target;
|
|
20
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple memoize function. It takes a function and a resolver function to generate a
|
|
3
|
+
* cache key
|
|
4
|
+
*/
|
|
5
|
+
export declare function memoize<T extends (...args: any) => any>(func: T, resolver: (...args: Parameters<T>) => string): T;
|
|
6
|
+
//# sourceMappingURL=memoize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memoize.d.ts","sourceRoot":"","sources":["../../../../../common/lib/utils/memoize.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,EACrD,IAAI,EAAE,CAAC,EACP,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,MAAM,GAC3C,CAAC,CAeH"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple memoize function. It takes a function and a resolver function to generate a
|
|
3
|
+
* cache key
|
|
4
|
+
*/
|
|
5
|
+
export function memoize(func, resolver) {
|
|
6
|
+
var cache = new Map();
|
|
7
|
+
return function () {
|
|
8
|
+
var args = [];
|
|
9
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
10
|
+
args[_i] = arguments[_i];
|
|
11
|
+
}
|
|
12
|
+
var key = resolver.apply(void 0, args);
|
|
13
|
+
if (cache.has(key)) {
|
|
14
|
+
return cache.get(key);
|
|
15
|
+
}
|
|
16
|
+
var result = func.apply(void 0, args);
|
|
17
|
+
cache.set(key, result);
|
|
18
|
+
return result;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../../../side-panel/lib/SidePanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAgB,iBAAiB,EAAC,MAAM,kCAAkC,CAAC;AAKlF,MAAM,WAAW,cAAe,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC1E;;;OAGG;IACH,IAAI,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAClC;;;OAGG;IACH,aAAa,CAAC,EAAE,sBAAsB,CAAC;IACvC;;OAEG;IACH,kBAAkB,CAAC,EAAE,CAAC,eAAe,EAAE,OAAO,KAAK,IAAI,CAAC;IACxD;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,eAAe,CAAC,EAAE,wBAAwB,CAAC;IAC3C;;;OAGG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC;;;OAGG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,oBAAY,sBAAsB;IAChC,IAAI,IAAA;IACJ,KAAK,IAAA;CACN;AAED,oBAAY,wBAAwB;IAClC,KAAK,IAAA;IACL,WAAW,IAAA;IACX,IAAI,IAAA;CACL;AAwFD,qBAAa,SAAU,SAAQ,KAAK,CAAC,SAAS,CAAC,cAAc,EAAE,cAAc,CAAC;IAC5E,MAAM,CAAC,aAAa,gCAA0B;IAC9C,MAAM,CAAC,eAAe,kCAA4B;gBAEtC,KAAK,EAAE,cAAc;IAKjC,KAAK;;MAEH;IAEK,iBAAiB;IAGjB,oBAAoB;IAIpB,MAAM;IAgDb,OAAO,CAAC,YAAY,CAWlB;IAEF,OAAO,CAAC,aAAa,CAInB;IAEF,OAAO,CAAC,qBAAqB,CAS3B;CACH"}
|
|
@@ -37,7 +37,6 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
37
37
|
};
|
|
38
38
|
import * as React from 'react';
|
|
39
39
|
import styled from '@emotion/styled';
|
|
40
|
-
import throttle from 'lodash/throttle';
|
|
41
40
|
import { colors, space } from '@workday/canvas-kit-react/tokens';
|
|
42
41
|
import { TertiaryButton } from '@workday/canvas-kit-react/button';
|
|
43
42
|
import { chevronLeftIcon, chevronRightIcon } from '@workday/canvas-system-icons-web';
|
|
@@ -165,7 +164,7 @@ var SidePanel = /** @class */ (function (_super) {
|
|
|
165
164
|
return open ? chevronRightIcon : chevronLeftIcon;
|
|
166
165
|
}
|
|
167
166
|
};
|
|
168
|
-
_this.handleResize =
|
|
167
|
+
_this.handleResize = _this.handleResize.bind(_this);
|
|
169
168
|
return _this;
|
|
170
169
|
}
|
|
171
170
|
SidePanel.prototype.componentDidMount = function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fontFamilies.d.ts","sourceRoot":"","sources":["../../../../../tokens/lib/type/fontFamilies.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fontFamilies.d.ts","sourceRoot":"","sources":["../../../../../tokens/lib/type/fontFamilies.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,UAAU,QAEyC,CAAC;AACjE,eAAO,MAAM,cAAc,QAGgD,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,YAAY,EAAE,kBAG1B,CAAC;AAEF,oBAAY,kBAAkB,GAAG;IAC/B;;;SAGK;IACL,OAAO,EAAE,OAAO,UAAU,CAAC;IAC3B;;;SAGK;IACL,SAAS,EAAE,OAAO,cAAc,CAAC;CAClC,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
1
|
+
// prettier-ignore
|
|
2
|
+
//@ts-ignore
|
|
3
|
+
var canvasObject = typeof window !== 'undefined' && window.workday && window.workday.canvas && window.workday.canvas;
|
|
4
|
+
var inheritFont = typeof canvasObject !== 'undefined' && canvasObject.inheritFontFamily;
|
|
5
|
+
var inheritMonoFont = typeof canvasObject !== 'undefined' && canvasObject.inheritMonoFontFamily;
|
|
4
6
|
export var fontFamily = inheritFont
|
|
5
7
|
? 'inherit'
|
|
6
8
|
: '"Roboto", "Helvetica Neue", "Helvetica", Arial, sans-serif';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTooltip.d.ts","sourceRoot":"","sources":["../../../../tooltip/lib/useTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAmD/B;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,EAAE,EACtD,IAAc,EACd,SAAc,EACd,SAAe,EACf,SAAe,GAChB,GAAE;IACD;;;;;;;;;;;;;;;OAeG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,OAAO,CAAC;IACtC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACf;
|
|
1
|
+
{"version":3,"file":"useTooltip.d.ts","sourceRoot":"","sources":["../../../../tooltip/lib/useTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAmD/B;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,EAAE,EACtD,IAAc,EACd,SAAc,EACd,SAAe,EACf,SAAe,GAChB,GAAE;IACD;;;;;;;;;;;;;;;OAeG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,OAAO,CAAC;IACtC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACf;IA+DF,2EAA2E;;;;8BA7C5C,MAAM,cAAc;;6BAazB,gBAAgB;yBARpB,gBAAgB;;;IA0CtC,uDAAuD;;;;;;IAMvD,iEAAiE;;;;;;;EAQpE"}
|
|
@@ -77,19 +77,24 @@ export function useTooltip(_a) {
|
|
|
77
77
|
useCloseOnFullscreenExit(popupModel);
|
|
78
78
|
useCloseOnTargetHidden(popupModel);
|
|
79
79
|
var visible = popupModel.state.visibility !== 'hidden';
|
|
80
|
+
var targetProps = {
|
|
81
|
+
// extra description of the target element for assistive technology
|
|
82
|
+
'aria-describedby': type === 'describe' && visible ? id : undefined,
|
|
83
|
+
// This will replace the accessible name of the target element
|
|
84
|
+
'aria-label': type === 'label' ? titleText : undefined,
|
|
85
|
+
onMouseEnter: onOpenFromTarget,
|
|
86
|
+
onMouseLeave: onHide,
|
|
87
|
+
onMouseDown: onMouseDown,
|
|
88
|
+
onFocus: onFocus,
|
|
89
|
+
onBlur: onHide,
|
|
90
|
+
};
|
|
91
|
+
// remove `aria-describedby` if undefined to not override what's provided
|
|
92
|
+
if (targetProps['aria-describedby'] === undefined) {
|
|
93
|
+
delete targetProps['aria-describedby'];
|
|
94
|
+
}
|
|
80
95
|
return {
|
|
81
96
|
/** Mix these properties into the target element. **Must be an Element** */
|
|
82
|
-
targetProps:
|
|
83
|
-
// extra description of the target element for assistive technology
|
|
84
|
-
'aria-describedby': type === 'describe' && visible ? id : undefined,
|
|
85
|
-
// This will replace the accessible name of the target element
|
|
86
|
-
'aria-label': type === 'label' ? titleText : undefined,
|
|
87
|
-
onMouseEnter: onOpenFromTarget,
|
|
88
|
-
onMouseLeave: onHide,
|
|
89
|
-
onMouseDown: onMouseDown,
|
|
90
|
-
onFocus: onFocus,
|
|
91
|
-
onBlur: onHide,
|
|
92
|
-
},
|
|
97
|
+
targetProps: targetProps,
|
|
93
98
|
/** Mix these properties into the `Popper` component */
|
|
94
99
|
popperProps: {
|
|
95
100
|
open: visible,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-react",
|
|
3
|
-
"version": "9.0.0-alpha.
|
|
3
|
+
"version": "9.0.0-alpha.350-next.4+832dc1ee",
|
|
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,12 +49,11 @@
|
|
|
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.0-alpha.
|
|
52
|
+
"@workday/canvas-kit-popup-stack": "^9.0.0-alpha.350-next.4+832dc1ee",
|
|
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",
|
|
56
56
|
"csstype": "^3.0.2",
|
|
57
|
-
"lodash": "^4.17.14",
|
|
58
57
|
"polished": "^4.1.3",
|
|
59
58
|
"react-innertext": "^1.1.5",
|
|
60
59
|
"react-virtual": "^2.10.4",
|
|
@@ -67,5 +66,5 @@
|
|
|
67
66
|
"@workday/canvas-accent-icons-web": "^3.0.0",
|
|
68
67
|
"@workday/canvas-applet-icons-web": "^2.0.0"
|
|
69
68
|
},
|
|
70
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "832dc1ee25b3e7f7bbd551e7566829c823b73aa8"
|
|
71
70
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
|
-
import throttle from 'lodash/throttle';
|
|
4
3
|
|
|
5
4
|
import {CanvasSystemIcon} from '@workday/design-assets-types';
|
|
6
5
|
import {colors, space, CanvasSpaceValues} from '@workday/canvas-kit-react/tokens';
|
|
@@ -169,7 +168,7 @@ export class SidePanel extends React.Component<SidePanelProps, SidePanelState> {
|
|
|
169
168
|
|
|
170
169
|
constructor(props: SidePanelProps) {
|
|
171
170
|
super(props);
|
|
172
|
-
this.handleResize =
|
|
171
|
+
this.handleResize = this.handleResize.bind(this);
|
|
173
172
|
}
|
|
174
173
|
|
|
175
174
|
state = {
|