@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.
Files changed (100) hide show
  1. package/avatar/avatar.js +1 -1
  2. package/button/button.types.d.ts +4 -4
  3. package/button/consts.js +2 -2
  4. package/footer/consts.d.ts +105 -8
  5. package/footer/consts.js +18 -9
  6. package/footer/footerColumn.d.ts +1 -1
  7. package/footer/helpers.d.ts +2 -3
  8. package/footer/helpers.js +16 -16
  9. package/header/consts.d.ts +58 -0
  10. package/header/consts.js +76 -0
  11. package/header/context.d.ts +2 -2
  12. package/header/context.js +3 -3
  13. package/header/header.d.ts +7 -7
  14. package/header/header.js +30 -15
  15. package/header/header.types.d.ts +41 -22
  16. package/header/headerAccount.d.ts +4 -0
  17. package/header/{headerProfile.js → headerAccount.js} +17 -9
  18. package/header/headerAccount.types.d.ts +35 -0
  19. package/header/headerContent.js +1 -1
  20. package/header/headerCreateAccount.js +7 -4
  21. package/header/headerDivider.js +2 -2
  22. package/header/headerLinkItem.d.ts +4 -0
  23. package/header/headerLinkItem.js +53 -0
  24. package/header/headerLinksList.d.ts +4 -0
  25. package/header/{headerLinks.js → headerLinksList.js} +10 -7
  26. package/header/headerLogo.js +5 -9
  27. package/header/headerMobileContent.js +4 -3
  28. package/header/headerMobileToggle.d.ts +2 -2
  29. package/header/headerMobileToggle.js +6 -7
  30. package/header/headerNotifications.js +5 -6
  31. package/header/headerServices.js +15 -11
  32. package/header/headerSignIn.js +1 -1
  33. package/header/helpers.d.ts +17 -0
  34. package/header/helpers.js +66 -0
  35. package/header/index.d.ts +7 -3
  36. package/header/index.js +7 -3
  37. package/header/loggedInHeader.d.ts +1 -1
  38. package/header/loggedInHeader.js +12 -8
  39. package/header/loggedOutHeader.js +13 -10
  40. package/header/theme.d.ts +60 -7
  41. package/header/theme.js +49 -12
  42. package/icons/baseIcons/fas/fasCalendarAlt.js +1 -1
  43. package/index.d.ts +2 -0
  44. package/index.js +2 -0
  45. package/input/consts.js +2 -2
  46. package/input/input.types.d.ts +3 -3
  47. package/link/link.types.d.ts +4 -4
  48. package/list/listItem.js +1 -1
  49. package/menu/menuItem.js +7 -22
  50. package/menu/menuList.js +1 -1
  51. package/modal/context.d.ts +4 -0
  52. package/modal/context.js +23 -0
  53. package/modal/focusLock.d.ts +9 -0
  54. package/modal/focusLock.js +47 -0
  55. package/modal/focusLock.types.d.ts +28 -0
  56. package/modal/focusLock.types.js +2 -0
  57. package/modal/index.d.ts +7 -0
  58. package/modal/index.js +24 -0
  59. package/modal/modal.d.ts +10 -0
  60. package/modal/modal.js +109 -0
  61. package/modal/modal.types.d.ts +40 -0
  62. package/modal/modal.types.js +2 -0
  63. package/modal/modalBackdrop.d.ts +4 -0
  64. package/modal/modalBackdrop.js +38 -0
  65. package/modal/modalManager.d.ts +12 -0
  66. package/modal/modalManager.js +33 -0
  67. package/modal/theme.d.ts +7 -0
  68. package/modal/theme.js +12 -0
  69. package/notification/consts.js +2 -2
  70. package/notification/notification.types.d.ts +1 -2
  71. package/package.json +3 -1
  72. package/popover/popover.d.ts +1 -1
  73. package/popover/popover.js +5 -4
  74. package/popover/popoverContent.js +1 -1
  75. package/popover/usePopover.js +7 -9
  76. package/popover/usePopover.types.d.ts +1 -1
  77. package/portal/index.d.ts +3 -0
  78. package/portal/index.js +20 -0
  79. package/portal/portal.d.ts +5 -0
  80. package/portal/portal.js +56 -0
  81. package/portal/portal.types.d.ts +7 -0
  82. package/portal/portal.types.js +2 -0
  83. package/svg/svg.js +9 -7
  84. package/svg/svg.types.d.ts +2 -2
  85. package/tag/tag.types.d.ts +3 -4
  86. package/theme/components.d.ts +60 -7
  87. package/theme/defaultTheme.d.ts +60 -7
  88. package/utils/index.d.ts +1 -0
  89. package/utils/index.js +1 -0
  90. package/utils/react.d.ts +10 -5
  91. package/utils/react.js +64 -9
  92. package/utils/string.d.ts +5 -0
  93. package/utils/string.js +19 -0
  94. package/utils/types.d.ts +4 -2
  95. package/header/headerLink.d.ts +0 -4
  96. package/header/headerLink.js +0 -43
  97. package/header/headerLinks.d.ts +0 -4
  98. package/header/headerProfile.d.ts +0 -4
  99. package/header/headerProfile.types.d.ts +0 -35
  100. /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
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
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(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t& > path:nth-child(1) {\n\t\tfill: ", ";\n\t}\n\n\t& > path:nth-child(2) {\n\t\tfill: ", ";\n\t}\n"], ["\n\t& > path:nth-child(1) {\n\t\tfill: ", ";\n\t}\n\n\t& > path:nth-child(2) {\n\t\tfill: ", ";\n\t}\n"
110
- /**
111
- * Displays an svg element based on provided children or 'src' prop.
112
- * When using src, it loads the content from the given URL and saves in in cache.
113
- * Then, renders the svg by parsing loaded content (Review potential for XSS due to innerHTML).
114
- */
115
- ])), function (p) { var _a, _b, _c; return core_1.th.color((_c = (_b = (_a = p.fill) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : p.fill) !== null && _c !== void 0 ? _c : '')(p); }, function (p) { var _a, _b, _c; return core_1.th.color((_c = (_b = (_a = p.fill) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : p.fill) !== null && _c !== void 0 ? _c : '')(p); });
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.
@@ -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
- /** Color or aray of colors used for first and second path elements. */
5
- fill?: ColorGetter | ColorGetter[];
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
  };
@@ -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 | AnyElement;
13
+ icon?: IconProp | JSX.Element;
15
14
  /** Socket displaying icon on the left side. */
16
- iconLeft?: IconProp | AnyElement;
15
+ iconLeft?: IconProp | JSX.Element;
17
16
  /** Socket displaying icon on the right side. */
18
- iconRight?: IconProp | AnyElement;
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. */
@@ -230,20 +230,73 @@ declare const _default: {
230
230
  parts: string[];
231
231
  sizes: {};
232
232
  variants: {
233
- test: {
233
+ dark: {
234
234
  container: {
235
235
  bg: string;
236
- color: string;
236
+ borderBottom: number;
237
237
  };
238
- profile: {
239
- content: {
240
- color: string;
241
- };
238
+ account: {
242
239
  trigger: {
240
+ bg: string;
243
241
  color: string;
244
- name: string;
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;
@@ -398,20 +398,73 @@ declare const defaultTheme: {
398
398
  parts: string[];
399
399
  sizes: {};
400
400
  variants: {
401
- test: {
401
+ dark: {
402
402
  container: {
403
403
  bg: string;
404
- color: string;
404
+ borderBottom: number;
405
405
  };
406
- profile: {
407
- content: {
408
- color: string;
409
- };
406
+ account: {
410
407
  trigger: {
408
+ bg: string;
411
409
  color: string;
412
- name: string;
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
@@ -2,5 +2,6 @@ export * from './assertion';
2
2
  export * from './function';
3
3
  export * from './object';
4
4
  export * from './react';
5
+ export * from './string';
5
6
  export * from './styles';
6
7
  export * from './types';
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
- * Saves given function in a ref to ensure stable exported reference.
15
- * When input function changes, ref is updated.
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 useFnRef(fn?: Function): React.MutableRefObject<Function | undefined>;
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.useFnRef = exports.mergeRefs = exports.createContext = exports.assignRef = void 0;
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
- * Saves given function in a ref to ensure stable exported reference.
74
- * When input function changes, ref is updated.
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 useFnRef(fn) {
77
- var fnRef = (0, react_1.useRef)(fn);
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
- fnRef.current = fn;
80
- }, [fn]);
81
- return fnRef;
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.useFnRef = useFnRef;
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;
@@ -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 any React element without breaking autocompletion. */
3
- export declare type AnyElement = React.ReactNode & {};
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 */
@@ -1,4 +0,0 @@
1
- import { HeaderLinkProps } from './header.types';
2
- /** Individual link item of the Header. */
3
- export declare const HeaderLink: import("../core").VuiComponent<"a", HeaderLinkProps>;
4
- export default HeaderLink;
@@ -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;
@@ -1,4 +0,0 @@
1
- import { HeaderLinksProps } from './header.types';
2
- /** List of Header Links. */
3
- export declare const HeaderLinks: import("../core").VuiComponent<"ul", HeaderLinksProps>;
4
- export default HeaderLinks;
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import { HeaderProfileProps } from './headerProfile.types';
3
- /** Displays user profile information and helpful links, like settings or logout. */
4
- export default function HeaderProfile(props: HeaderProfileProps): JSX.Element;
@@ -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;