@veracity/vui 0.3.2 → 0.4.0
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/avatar/avatar.js +1 -1
- package/button/button.types.d.ts +4 -4
- package/button/consts.js +2 -2
- package/footer/consts.d.ts +105 -8
- package/footer/consts.js +18 -9
- package/footer/footerColumn.d.ts +1 -1
- package/footer/helpers.d.ts +2 -3
- package/footer/helpers.js +16 -16
- package/header/consts.d.ts +58 -0
- package/header/consts.js +76 -0
- package/header/context.d.ts +2 -2
- package/header/context.js +3 -3
- package/header/header.d.ts +7 -7
- package/header/header.js +30 -15
- package/header/header.types.d.ts +41 -22
- package/header/headerAccount.d.ts +4 -0
- package/header/{headerProfile.js → headerAccount.js} +17 -9
- package/header/headerAccount.types.d.ts +35 -0
- package/header/headerContent.js +1 -1
- package/header/headerCreateAccount.js +7 -4
- package/header/headerDivider.js +2 -2
- package/header/headerLinkItem.d.ts +4 -0
- package/header/headerLinkItem.js +53 -0
- package/header/headerLinksList.d.ts +4 -0
- package/header/{headerLinks.js → headerLinksList.js} +10 -7
- package/header/headerLogo.js +5 -9
- package/header/headerMobileContent.js +4 -3
- package/header/headerMobileToggle.d.ts +2 -2
- package/header/headerMobileToggle.js +6 -7
- package/header/headerNotifications.js +5 -6
- package/header/headerServices.js +15 -11
- package/header/headerSignIn.js +1 -1
- package/header/helpers.d.ts +17 -0
- package/header/helpers.js +66 -0
- package/header/index.d.ts +7 -3
- package/header/index.js +7 -3
- package/header/loggedInHeader.d.ts +1 -1
- package/header/loggedInHeader.js +12 -8
- package/header/loggedOutHeader.js +13 -10
- package/header/theme.d.ts +60 -7
- package/header/theme.js +49 -12
- package/icons/baseIcons/fas/fasCalendarAlt.js +1 -1
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/input/consts.js +2 -2
- package/input/input.types.d.ts +3 -3
- package/link/link.types.d.ts +4 -4
- package/list/listItem.js +1 -1
- package/menu/menuItem.js +7 -22
- package/menu/menuList.js +1 -1
- package/modal/context.d.ts +4 -0
- package/modal/context.js +23 -0
- package/modal/focusLock.d.ts +9 -0
- package/modal/focusLock.js +47 -0
- package/modal/focusLock.types.d.ts +28 -0
- package/modal/focusLock.types.js +2 -0
- package/modal/index.d.ts +7 -0
- package/modal/index.js +24 -0
- package/modal/modal.d.ts +10 -0
- package/modal/modal.js +109 -0
- package/modal/modal.types.d.ts +40 -0
- package/modal/modal.types.js +2 -0
- package/modal/modalBackdrop.d.ts +4 -0
- package/modal/modalBackdrop.js +38 -0
- package/modal/modalManager.d.ts +12 -0
- package/modal/modalManager.js +33 -0
- package/modal/theme.d.ts +7 -0
- package/modal/theme.js +12 -0
- package/notification/consts.js +2 -2
- package/notification/notification.types.d.ts +1 -2
- package/package.json +3 -1
- package/popover/popover.d.ts +1 -1
- package/popover/popover.js +5 -4
- package/popover/popoverContent.js +1 -1
- package/popover/usePopover.js +7 -9
- package/popover/usePopover.types.d.ts +1 -1
- package/portal/index.d.ts +3 -0
- package/portal/index.js +20 -0
- package/portal/portal.d.ts +5 -0
- package/portal/portal.js +56 -0
- package/portal/portal.types.d.ts +7 -0
- package/portal/portal.types.js +2 -0
- package/svg/svg.js +9 -7
- package/svg/svg.types.d.ts +2 -2
- package/tag/tag.types.d.ts +3 -4
- package/theme/components.d.ts +60 -7
- package/theme/defaultTheme.d.ts +60 -7
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/utils/react.d.ts +10 -5
- package/utils/react.js +64 -9
- package/utils/string.d.ts +5 -0
- package/utils/string.js +19 -0
- package/utils/types.d.ts +4 -2
- package/header/headerLink.d.ts +0 -4
- package/header/headerLink.js +0 -43
- package/header/headerLinks.d.ts +0 -4
- package/header/headerProfile.d.ts +0 -4
- package/header/headerProfile.types.d.ts +0 -35
- /package/header/{headerProfile.types.js → headerAccount.types.js} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
export declare type PortalProps = {
|
|
3
|
+
/** Ref of a custom container that will be used instead of document.body. */
|
|
4
|
+
containerRef?: RefObject<HTMLElement | null>;
|
|
5
|
+
/** Content will be rendered as usual, without portaling. */
|
|
6
|
+
disablePortal?: boolean;
|
|
7
|
+
};
|
package/svg/svg.js
CHANGED
|
@@ -106,13 +106,15 @@ var core_1 = require("../core");
|
|
|
106
106
|
var utils_1 = require("../utils");
|
|
107
107
|
var cache_1 = __importDefault(require("./cache"));
|
|
108
108
|
var helpers_1 = require("./helpers");
|
|
109
|
-
exports.SvgBase = core_1.styled.svgBox(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
109
|
+
exports.SvgBase = core_1.styled.svgBox(function (_a) {
|
|
110
|
+
var pathFill = _a.pathFill;
|
|
111
|
+
return (0, core_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t\t", "\n\t"], ["\n\t\t", "\n\t"])), pathFill !== undefined &&
|
|
112
|
+
(Array.isArray(pathFill)
|
|
113
|
+
? pathFill
|
|
114
|
+
.map(function (fill, index) { return "\n\t\t\t\t\t& > path:nth-child(" + (index + 1) + ") {\n\t\t\t\t\t\tfill: " + fill + ";\n\t\t\t\t\t}\n\t\t\t\t"; })
|
|
115
|
+
.join()
|
|
116
|
+
: "\n\t\t\t\t& > path {\n\t\t\t\t\tfill: " + pathFill + ";\n\t\t\t\t}\n\t\t\t"));
|
|
117
|
+
});
|
|
116
118
|
/**
|
|
117
119
|
* Displays an svg element based on provided children or 'src' prop.
|
|
118
120
|
* When using src, it loads the content from the given URL and saves in in cache.
|
package/svg/svg.types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ColorGetter, SystemProps } from '../system';
|
|
2
2
|
import { Dict } from '../utils';
|
|
3
3
|
export declare type SvgProps = SystemProps & {
|
|
4
|
-
/**
|
|
5
|
-
|
|
4
|
+
/** If string, adds fill color to all paths. If array, adds fill color to consecutive path elements. */
|
|
5
|
+
pathFill?: ColorGetter | ColorGetter[];
|
|
6
6
|
/** If provided, loads an svg file from this URL and displays parsed content. */
|
|
7
7
|
src?: string;
|
|
8
8
|
};
|
package/tag/tag.types.d.ts
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { IconProp } from '../icon';
|
|
3
3
|
import { SystemProps, TypographyProps } from '../system';
|
|
4
4
|
import { ThemingProps } from '../theme';
|
|
5
|
-
import { AnyElement } from '../utils';
|
|
6
5
|
export declare type TagProps = SystemProps & ThemingProps<'Tag'> & {
|
|
7
6
|
/** Alias for textTransform prop. @deprecated */
|
|
8
7
|
casing?: TypographyProps['textTransform'];
|
|
@@ -11,11 +10,11 @@ export declare type TagProps = SystemProps & ThemingProps<'Tag'> & {
|
|
|
11
10
|
/** Displays tag and its content in disabled state with appropriate styling. */
|
|
12
11
|
disabled?: boolean;
|
|
13
12
|
/** Icon that replaces any other content. */
|
|
14
|
-
icon?: IconProp |
|
|
13
|
+
icon?: IconProp | JSX.Element;
|
|
15
14
|
/** Socket displaying icon on the left side. */
|
|
16
|
-
iconLeft?: IconProp |
|
|
15
|
+
iconLeft?: IconProp | JSX.Element;
|
|
17
16
|
/** Socket displaying icon on the right side. */
|
|
18
|
-
iconRight?: IconProp |
|
|
17
|
+
iconRight?: IconProp | JSX.Element;
|
|
19
18
|
/** Makes the button take full width of the container. @deprecated */
|
|
20
19
|
isFullWidth?: boolean;
|
|
21
20
|
/** Makes item clickable and focusable with appropriate styling. */
|
package/theme/components.d.ts
CHANGED
|
@@ -230,20 +230,73 @@ declare const _default: {
|
|
|
230
230
|
parts: string[];
|
|
231
231
|
sizes: {};
|
|
232
232
|
variants: {
|
|
233
|
-
|
|
233
|
+
dark: {
|
|
234
234
|
container: {
|
|
235
235
|
bg: string;
|
|
236
|
-
|
|
236
|
+
borderBottom: number;
|
|
237
237
|
};
|
|
238
|
-
|
|
239
|
-
content: {
|
|
240
|
-
color: string;
|
|
241
|
-
};
|
|
238
|
+
account: {
|
|
242
239
|
trigger: {
|
|
240
|
+
bg: string;
|
|
243
241
|
color: string;
|
|
244
|
-
|
|
242
|
+
hoverBg: string;
|
|
243
|
+
activeBg: string;
|
|
244
|
+
};
|
|
245
|
+
};
|
|
246
|
+
createAccount: {
|
|
247
|
+
link: {
|
|
248
|
+
color: {
|
|
249
|
+
xs: string;
|
|
250
|
+
md: string;
|
|
251
|
+
};
|
|
252
|
+
hoverColor: {
|
|
253
|
+
xs: string;
|
|
254
|
+
md: string;
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
text: {
|
|
258
|
+
color: {
|
|
259
|
+
md: string;
|
|
260
|
+
};
|
|
245
261
|
};
|
|
246
262
|
};
|
|
263
|
+
divider: {
|
|
264
|
+
borderColor: string;
|
|
265
|
+
};
|
|
266
|
+
linkItem: {
|
|
267
|
+
container: {
|
|
268
|
+
hoverBg: {
|
|
269
|
+
xs: string;
|
|
270
|
+
md: string;
|
|
271
|
+
};
|
|
272
|
+
activeBg: {
|
|
273
|
+
xs: string;
|
|
274
|
+
md: string;
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
link: {
|
|
278
|
+
borderColor: string;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
linksList: {
|
|
282
|
+
color: {
|
|
283
|
+
md: string;
|
|
284
|
+
};
|
|
285
|
+
};
|
|
286
|
+
logo: {
|
|
287
|
+
svg: {
|
|
288
|
+
pathFill: string;
|
|
289
|
+
};
|
|
290
|
+
};
|
|
291
|
+
mobileContent: {
|
|
292
|
+
top: string;
|
|
293
|
+
};
|
|
294
|
+
mobileToggle: {
|
|
295
|
+
variant: string;
|
|
296
|
+
};
|
|
297
|
+
notifications: {
|
|
298
|
+
variant: string;
|
|
299
|
+
};
|
|
247
300
|
services: {
|
|
248
301
|
button: {
|
|
249
302
|
variant: string;
|
package/theme/defaultTheme.d.ts
CHANGED
|
@@ -398,20 +398,73 @@ declare const defaultTheme: {
|
|
|
398
398
|
parts: string[];
|
|
399
399
|
sizes: {};
|
|
400
400
|
variants: {
|
|
401
|
-
|
|
401
|
+
dark: {
|
|
402
402
|
container: {
|
|
403
403
|
bg: string;
|
|
404
|
-
|
|
404
|
+
borderBottom: number;
|
|
405
405
|
};
|
|
406
|
-
|
|
407
|
-
content: {
|
|
408
|
-
color: string;
|
|
409
|
-
};
|
|
406
|
+
account: {
|
|
410
407
|
trigger: {
|
|
408
|
+
bg: string;
|
|
411
409
|
color: string;
|
|
412
|
-
|
|
410
|
+
hoverBg: string;
|
|
411
|
+
activeBg: string;
|
|
412
|
+
};
|
|
413
|
+
};
|
|
414
|
+
createAccount: {
|
|
415
|
+
link: {
|
|
416
|
+
color: {
|
|
417
|
+
xs: string;
|
|
418
|
+
md: string;
|
|
419
|
+
};
|
|
420
|
+
hoverColor: {
|
|
421
|
+
xs: string;
|
|
422
|
+
md: string;
|
|
423
|
+
};
|
|
424
|
+
};
|
|
425
|
+
text: {
|
|
426
|
+
color: {
|
|
427
|
+
md: string;
|
|
428
|
+
};
|
|
413
429
|
};
|
|
414
430
|
};
|
|
431
|
+
divider: {
|
|
432
|
+
borderColor: string;
|
|
433
|
+
};
|
|
434
|
+
linkItem: {
|
|
435
|
+
container: {
|
|
436
|
+
hoverBg: {
|
|
437
|
+
xs: string;
|
|
438
|
+
md: string;
|
|
439
|
+
};
|
|
440
|
+
activeBg: {
|
|
441
|
+
xs: string;
|
|
442
|
+
md: string;
|
|
443
|
+
};
|
|
444
|
+
};
|
|
445
|
+
link: {
|
|
446
|
+
borderColor: string;
|
|
447
|
+
};
|
|
448
|
+
};
|
|
449
|
+
linksList: {
|
|
450
|
+
color: {
|
|
451
|
+
md: string;
|
|
452
|
+
};
|
|
453
|
+
};
|
|
454
|
+
logo: {
|
|
455
|
+
svg: {
|
|
456
|
+
pathFill: string;
|
|
457
|
+
};
|
|
458
|
+
};
|
|
459
|
+
mobileContent: {
|
|
460
|
+
top: string;
|
|
461
|
+
};
|
|
462
|
+
mobileToggle: {
|
|
463
|
+
variant: string;
|
|
464
|
+
};
|
|
465
|
+
notifications: {
|
|
466
|
+
variant: string;
|
|
467
|
+
};
|
|
415
468
|
services: {
|
|
416
469
|
button: {
|
|
417
470
|
variant: string;
|
package/utils/index.d.ts
CHANGED
package/utils/index.js
CHANGED
|
@@ -14,5 +14,6 @@ __exportStar(require("./assertion"), exports);
|
|
|
14
14
|
__exportStar(require("./function"), exports);
|
|
15
15
|
__exportStar(require("./object"), exports);
|
|
16
16
|
__exportStar(require("./react"), exports);
|
|
17
|
+
__exportStar(require("./string"), exports);
|
|
17
18
|
__exportStar(require("./styles"), exports);
|
|
18
19
|
__exportStar(require("./types"), exports);
|
package/utils/react.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { CreateContextOptions, CreateContextReturn } from './types';
|
|
1
|
+
import React, { RefObject } from 'react';
|
|
2
|
+
import { AnyFunction, CreateContextOptions, CreateContextReturn } from './types';
|
|
3
3
|
declare type ReactRef<T> = React.Ref<T> | React.RefObject<T> | React.MutableRefObject<T>;
|
|
4
4
|
/**
|
|
5
5
|
* Assigns given value to the provided ref.
|
|
@@ -10,9 +10,14 @@ export declare function assignRef<T = any>(ref: ReactRef<T> | undefined, value:
|
|
|
10
10
|
export declare function createContext<ContextType>(options?: CreateContextOptions): CreateContextReturn<ContextType>;
|
|
11
11
|
/** Assigns a node to all provided refs. */
|
|
12
12
|
export declare function mergeRefs<T>(...refs: (ReactRef<T> | undefined)[]): (node: T | null) => void;
|
|
13
|
+
/** Returns given callback with a stable reference, but keeps it updated internally. */
|
|
14
|
+
export declare function useCallbackRef<T extends AnyFunction>(callback?: T): T;
|
|
13
15
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
+
* Triggers given callback when an event happens outside of a given element.
|
|
17
|
+
* Event listeners are attached to the window object.
|
|
18
|
+
* @param ref - element to check click position for
|
|
19
|
+
* @param callback - function triggered on outside click
|
|
20
|
+
* @param events - array of events listened for (default: ['mousedown', 'touchstart'])
|
|
16
21
|
*/
|
|
17
|
-
export declare function
|
|
22
|
+
export declare function useClickOutside(ref: RefObject<HTMLElement | null> | RefObject<HTMLElement | null>[], callback?: (event: Event) => void, events?: string[]): void;
|
|
18
23
|
export {};
|
package/utils/react.js
CHANGED
|
@@ -19,8 +19,33 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
19
|
__setModuleDefault(result, mod);
|
|
20
20
|
return result;
|
|
21
21
|
};
|
|
22
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
23
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
24
|
+
if (!m) return o;
|
|
25
|
+
var i = m.call(o), r, ar = [], e;
|
|
26
|
+
try {
|
|
27
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
28
|
+
}
|
|
29
|
+
catch (error) { e = { error: error }; }
|
|
30
|
+
finally {
|
|
31
|
+
try {
|
|
32
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
33
|
+
}
|
|
34
|
+
finally { if (e) throw e.error; }
|
|
35
|
+
}
|
|
36
|
+
return ar;
|
|
37
|
+
};
|
|
38
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
39
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
40
|
+
if (ar || !(i in from)) {
|
|
41
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
42
|
+
ar[i] = from[i];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
46
|
+
};
|
|
22
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.
|
|
48
|
+
exports.useClickOutside = exports.useCallbackRef = exports.mergeRefs = exports.createContext = exports.assignRef = void 0;
|
|
24
49
|
var react_1 = __importStar(require("react"));
|
|
25
50
|
var assertion_1 = require("./assertion");
|
|
26
51
|
/**
|
|
@@ -69,15 +94,45 @@ function mergeRefs() {
|
|
|
69
94
|
};
|
|
70
95
|
}
|
|
71
96
|
exports.mergeRefs = mergeRefs;
|
|
97
|
+
// TODO: Bring it from UI-Utils
|
|
98
|
+
/** Returns given callback with a stable reference, but keeps it updated internally. */
|
|
99
|
+
function useCallbackRef(callback) {
|
|
100
|
+
var ref = (0, react_1.useRef)(callback);
|
|
101
|
+
ref.current = callback;
|
|
102
|
+
return (0, react_1.useCallback)((function () {
|
|
103
|
+
var _a;
|
|
104
|
+
var args = [];
|
|
105
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
106
|
+
args[_i] = arguments[_i];
|
|
107
|
+
}
|
|
108
|
+
return (_a = ref.current) === null || _a === void 0 ? void 0 : _a.call.apply(_a, __spreadArray([ref], __read(args), false));
|
|
109
|
+
}), []);
|
|
110
|
+
}
|
|
111
|
+
exports.useCallbackRef = useCallbackRef;
|
|
112
|
+
var defaultEvents = ['mousedown', 'touchstart'];
|
|
113
|
+
// TODO: Bring it from UI-Utils
|
|
72
114
|
/**
|
|
73
|
-
*
|
|
74
|
-
*
|
|
115
|
+
* Triggers given callback when an event happens outside of a given element.
|
|
116
|
+
* Event listeners are attached to the window object.
|
|
117
|
+
* @param ref - element to check click position for
|
|
118
|
+
* @param callback - function triggered on outside click
|
|
119
|
+
* @param events - array of events listened for (default: ['mousedown', 'touchstart'])
|
|
75
120
|
*/
|
|
76
|
-
function
|
|
77
|
-
|
|
121
|
+
function useClickOutside(ref, callback, events) {
|
|
122
|
+
if (events === void 0) { events = defaultEvents; }
|
|
123
|
+
var eventsString = JSON.stringify(events);
|
|
124
|
+
var listener = useCallbackRef(function (ev) {
|
|
125
|
+
var refs = (0, assertion_1.isArray)(ref) ? ref : [ref];
|
|
126
|
+
var target = ev.target;
|
|
127
|
+
var isClickOutside = refs.every(function (ref) { return ref.current && !ref.current.contains(target); });
|
|
128
|
+
isClickOutside && (callback === null || callback === void 0 ? void 0 : callback(ev));
|
|
129
|
+
});
|
|
78
130
|
(0, react_1.useEffect)(function () {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
131
|
+
var events = JSON.parse(eventsString);
|
|
132
|
+
events.forEach(function (event) { return window.addEventListener(event, listener); });
|
|
133
|
+
return function () {
|
|
134
|
+
events.forEach(function (event) { return window.removeEventListener(event, listener); });
|
|
135
|
+
};
|
|
136
|
+
}, [eventsString, ref]);
|
|
82
137
|
}
|
|
83
|
-
exports.
|
|
138
|
+
exports.useClickOutside = useClickOutside;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adds loggedIn=1 parameter to the URL if isLoggedIn flag is true, which means the user is logged in.
|
|
3
|
+
* This is supposed to aid login flow when navigating between Veracity applications.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getLoggedInLink(link: string, isLoggedIn?: boolean): string;
|
package/utils/string.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLoggedInLink = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Adds loggedIn=1 parameter to the URL if isLoggedIn flag is true, which means the user is logged in.
|
|
6
|
+
* This is supposed to aid login flow when navigating between Veracity applications.
|
|
7
|
+
*/
|
|
8
|
+
function getLoggedInLink(link, isLoggedIn) {
|
|
9
|
+
try {
|
|
10
|
+
var url = new URL(link);
|
|
11
|
+
if (isLoggedIn)
|
|
12
|
+
url.searchParams.append('loggedin', '1');
|
|
13
|
+
return url.toString();
|
|
14
|
+
}
|
|
15
|
+
catch (_a) {
|
|
16
|
+
return link;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.getLoggedInLink = getLoggedInLink;
|
package/utils/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ComponentPropsWithoutRef, ComponentPropsWithRef, ElementType } from 'react';
|
|
2
|
-
/** Type for
|
|
3
|
-
export declare type
|
|
2
|
+
/** Type for a a no-op function stub. */
|
|
3
|
+
export declare type AnyFunction = (...args: any[]) => any;
|
|
4
4
|
/** Type for any number without breaking autocompletion. */
|
|
5
5
|
export declare type AnyNumber = number & {};
|
|
6
6
|
/** Type for any string without breaking autocompletion. */
|
|
@@ -21,6 +21,8 @@ export declare type CreateContextOptions = {
|
|
|
21
21
|
export declare type CreateContextReturn<T> = [React.Provider<T>, () => T];
|
|
22
22
|
/** Basic dictionary typing. */
|
|
23
23
|
export declare type Dict<T = any> = Record<string, T>;
|
|
24
|
+
/** Classic application's environment names. */
|
|
25
|
+
export declare type Environment = 'Prod' | 'Stag' | 'Test';
|
|
24
26
|
/** Type of blur/focus event defaulted to any html element */
|
|
25
27
|
export declare type FocusEvent<T = HTMLElement> = React.FocusEvent<T>;
|
|
26
28
|
/** Type of blur/focus event handler defaulted to any html element */
|
package/header/headerLink.d.ts
DELETED
package/header/headerLink.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
-
var t = {};
|
|
15
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
-
t[p] = s[p];
|
|
17
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
-
t[p[i]] = s[p[i]];
|
|
21
|
-
}
|
|
22
|
-
return t;
|
|
23
|
-
};
|
|
24
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.HeaderLink = void 0;
|
|
29
|
-
var react_1 = __importDefault(require("react"));
|
|
30
|
-
var core_1 = require("../core");
|
|
31
|
-
var list_1 = __importDefault(require("../list"));
|
|
32
|
-
var context_1 = require("./context");
|
|
33
|
-
/** Individual link item of the Header. */
|
|
34
|
-
exports.HeaderLink = (0, core_1.vui)(function (props, ref) {
|
|
35
|
-
var _a;
|
|
36
|
-
var url = props.url, rest = __rest(props, ["url"]);
|
|
37
|
-
var isMobile = ((_a = (0, context_1.useHeader)()) !== null && _a !== void 0 ? _a : {}).isMobile;
|
|
38
|
-
var styles = (0, core_1.useStyleConfig)('Header', (0, context_1.useHeader)());
|
|
39
|
-
var screenStyles = isMobile ? {} : { display: 'inline-flex' };
|
|
40
|
-
return (react_1.default.createElement(list_1.default.Item, __assign({ className: "vui-headerLink", linkProps: { href: url }, ref: ref }, screenStyles, styles.link, rest)));
|
|
41
|
-
});
|
|
42
|
-
exports.HeaderLink.displayName = 'HeaderLink';
|
|
43
|
-
exports.default = exports.HeaderLink;
|
package/header/headerLinks.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { AvatarProps } from '../avatar';
|
|
2
|
-
import { BoxProps } from '../box';
|
|
3
|
-
import { PopoverProps } from '../popover';
|
|
4
|
-
import { AnyElement } from '../utils';
|
|
5
|
-
import { HeaderLinkData } from './header.types';
|
|
6
|
-
export declare type HeaderProfileProps = PopoverProps & {
|
|
7
|
-
/** Props object passed to the PopoverContent component. */
|
|
8
|
-
contentProps?: BoxProps;
|
|
9
|
-
/** Socket displaying a set of link sections below user information. */
|
|
10
|
-
sections?: HeaderProfileData['sections'] | AnyElement;
|
|
11
|
-
/** Props object passed to the PopoverTrigger component. */
|
|
12
|
-
triggerProps?: AvatarProps;
|
|
13
|
-
/** Socket displaying user information on top of the profile popover. */
|
|
14
|
-
userInfo?: HeaderProfileData['userInfo'] | AnyElement;
|
|
15
|
-
};
|
|
16
|
-
/** Defines profile link sections and user information. */
|
|
17
|
-
export declare type HeaderProfileData = {
|
|
18
|
-
sections?: HeaderProfileSectionsData;
|
|
19
|
-
userInfo?: HeaderProfileUserInfoData;
|
|
20
|
-
};
|
|
21
|
-
/** Defines heading and an array of links within one section. */
|
|
22
|
-
export declare type HeaderProfileSectionData = {
|
|
23
|
-
heading?: string;
|
|
24
|
-
links?: HeaderLinkData[];
|
|
25
|
-
};
|
|
26
|
-
/** Defines a set of link sections within the profile popover. */
|
|
27
|
-
export declare type HeaderProfileSectionsData = {
|
|
28
|
-
[sectionName: string]: HeaderProfileSectionData;
|
|
29
|
-
};
|
|
30
|
-
/** Defines user information within the profile. */
|
|
31
|
-
export declare type HeaderProfileUserInfoData = {
|
|
32
|
-
companyName?: string;
|
|
33
|
-
userName?: string;
|
|
34
|
-
};
|
|
35
|
-
export declare type HeaderProfileUserInfoProps = HeaderProfileUserInfoData;
|
|
File without changes
|