@servicetitan/navigation 11.0.0 → 11.1.1

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 (179) hide show
  1. package/dist/components/badge-tag.js +7 -2
  2. package/dist/components/badge-tag.js.map +1 -1
  3. package/dist/components/counter-tag.js +10 -2
  4. package/dist/components/counter-tag.js.map +1 -1
  5. package/dist/components/header-navigation/header-navigation-content.js +44 -8
  6. package/dist/components/header-navigation/header-navigation-content.js.map +1 -1
  7. package/dist/components/header-navigation/header-navigation-links.js +49 -13
  8. package/dist/components/header-navigation/header-navigation-links.js.map +1 -1
  9. package/dist/components/header-navigation/header-navigation-stories.module.less.d.ts +3 -0
  10. package/dist/components/header-navigation/header-navigation.js +178 -46
  11. package/dist/components/header-navigation/header-navigation.js.map +1 -1
  12. package/dist/components/header-navigation/header-navigation.module.less.d.ts +22 -0
  13. package/dist/components/header-navigation/index.js +1 -0
  14. package/dist/components/header-navigation/index.js.map +1 -1
  15. package/dist/components/header-navigation/with-tooltip.js +7 -1
  16. package/dist/components/header-navigation/with-tooltip.js.map +1 -1
  17. package/dist/components/left-navigation/header-navigation-tiny-links.js +62 -15
  18. package/dist/components/left-navigation/header-navigation-tiny-links.js.map +1 -1
  19. package/dist/components/left-navigation/header-navigation-tiny.js +27 -2
  20. package/dist/components/left-navigation/header-navigation-tiny.js.map +1 -1
  21. package/dist/components/left-navigation/header-navigation-tiny.module.less.d.ts +15 -0
  22. package/dist/components/left-navigation/index.d.ts +1 -1
  23. package/dist/components/left-navigation/index.d.ts.map +1 -1
  24. package/dist/components/left-navigation/index.js +1 -1
  25. package/dist/components/left-navigation/index.js.map +1 -1
  26. package/dist/components/left-navigation/interface-internal.js +2 -1
  27. package/dist/components/left-navigation/interface-internal.js.map +1 -1
  28. package/dist/components/left-navigation/interface.js +2 -1
  29. package/dist/components/left-navigation/interface.js.map +1 -1
  30. package/dist/components/left-navigation/side-navigation-context.js +4 -3
  31. package/dist/components/left-navigation/side-navigation-context.js.map +1 -1
  32. package/dist/components/left-navigation/side-navigation-links-internal.js +76 -16
  33. package/dist/components/left-navigation/side-navigation-links-internal.js.map +1 -1
  34. package/dist/components/left-navigation/side-navigation-links.js +34 -13
  35. package/dist/components/left-navigation/side-navigation-links.js.map +1 -1
  36. package/dist/components/left-navigation/side-navigation.js +314 -85
  37. package/dist/components/left-navigation/side-navigation.js.map +1 -1
  38. package/dist/components/left-navigation/side-navigation.module.less.d.ts +48 -0
  39. package/dist/components/left-navigation/with-tooltip.js +12 -1
  40. package/dist/components/left-navigation/with-tooltip.js.map +1 -1
  41. package/dist/components/links.js +28 -7
  42. package/dist/components/links.js.map +1 -1
  43. package/dist/components/logo/logo-company-title.js +19 -3
  44. package/dist/components/logo/logo-company-title.js.map +1 -1
  45. package/dist/components/logo/logo-titan-text.js +50 -6
  46. package/dist/components/logo/logo-titan-text.js.map +1 -1
  47. package/dist/components/logo/logo-titan-text.module.less.d.ts +6 -0
  48. package/dist/components/logo/logo-titan.d.ts +1 -0
  49. package/dist/components/logo/logo-titan.d.ts.map +1 -1
  50. package/dist/components/logo/logo-titan.js +53 -8
  51. package/dist/components/logo/logo-titan.js.map +1 -1
  52. package/dist/components/profile-dropdown/profile-dropdown.d.ts.map +1 -1
  53. package/dist/components/profile-dropdown/profile-dropdown.js +174 -33
  54. package/dist/components/profile-dropdown/profile-dropdown.js.map +1 -1
  55. package/dist/components/profile-dropdown/profile-dropdown.module.less.d.ts +23 -0
  56. package/dist/components/profile-dropdown/profile-icon.js +49 -3
  57. package/dist/components/profile-dropdown/profile-icon.js.map +1 -1
  58. package/dist/components/titan-layout/index.d.ts +2 -2
  59. package/dist/components/titan-layout/index.d.ts.map +1 -1
  60. package/dist/components/titan-layout/index.js +1 -2
  61. package/dist/components/titan-layout/index.js.map +1 -1
  62. package/dist/components/titan-layout/interface-internal.js +2 -1
  63. package/dist/components/titan-layout/interface-internal.js.map +1 -1
  64. package/dist/components/titan-layout/interface.js +2 -1
  65. package/dist/components/titan-layout/interface.js.map +1 -1
  66. package/dist/components/titan-layout/layout-context.js +15 -6
  67. package/dist/components/titan-layout/layout-context.js.map +1 -1
  68. package/dist/components/titan-layout/layout-header-dark.d.ts +10 -0
  69. package/dist/components/titan-layout/layout-header-dark.d.ts.map +1 -0
  70. package/dist/components/titan-layout/layout-header-dark.js +146 -0
  71. package/dist/components/titan-layout/layout-header-dark.js.map +1 -0
  72. package/dist/components/titan-layout/layout-header-links.js +61 -15
  73. package/dist/components/titan-layout/layout-header-links.js.map +1 -1
  74. package/dist/components/titan-layout/layout-header.d.ts +2 -6
  75. package/dist/components/titan-layout/layout-header.d.ts.map +1 -1
  76. package/dist/components/titan-layout/layout-header.js +46 -2
  77. package/dist/components/titan-layout/layout-header.js.map +1 -1
  78. package/dist/components/titan-layout/layout-header.module.less +337 -83
  79. package/dist/components/titan-layout/layout-header.module.less.d.ts +35 -0
  80. package/dist/components/titan-layout/layout-logo.d.ts +5 -3
  81. package/dist/components/titan-layout/layout-logo.d.ts.map +1 -1
  82. package/dist/components/titan-layout/layout-logo.js +47 -9
  83. package/dist/components/titan-layout/layout-logo.js.map +1 -1
  84. package/dist/components/titan-layout/layout-logo.stories.d.ts +15 -4
  85. package/dist/components/titan-layout/layout-logo.stories.d.ts.map +1 -1
  86. package/dist/components/titan-layout/layout-profile.js +75 -23
  87. package/dist/components/titan-layout/layout-profile.js.map +1 -1
  88. package/dist/components/titan-layout/layout-sidebar-links-internal.js +162 -36
  89. package/dist/components/titan-layout/layout-sidebar-links-internal.js.map +1 -1
  90. package/dist/components/titan-layout/layout-sidebar-links.js +33 -13
  91. package/dist/components/titan-layout/layout-sidebar-links.js.map +1 -1
  92. package/dist/components/titan-layout/layout-sidebar.js +198 -34
  93. package/dist/components/titan-layout/layout-sidebar.js.map +1 -1
  94. package/dist/components/titan-layout/layout-sidebar.module.less +6 -2
  95. package/dist/components/titan-layout/layout-sidebar.module.less.d.ts +49 -0
  96. package/dist/components/titan-layout/notifications-context.js +20 -10
  97. package/dist/components/titan-layout/notifications-context.js.map +1 -1
  98. package/dist/components/titan-layout/titan-layout.d.ts +7 -8
  99. package/dist/components/titan-layout/titan-layout.d.ts.map +1 -1
  100. package/dist/components/titan-layout/titan-layout.js +271 -117
  101. package/dist/components/titan-layout/titan-layout.js.map +1 -1
  102. package/dist/components/titan-layout/titan-layout.module.less +7 -2
  103. package/dist/components/titan-layout/titan-layout.module.less.d.ts +17 -0
  104. package/dist/components/titan-layout/titan-layout.stories.d.ts +6 -0
  105. package/dist/components/titan-layout/titan-layout.stories.d.ts.map +1 -1
  106. package/dist/components/titan-layout/with-tooltip.d.ts +4 -1
  107. package/dist/components/titan-layout/with-tooltip.d.ts.map +1 -1
  108. package/dist/components/titan-layout/with-tooltip.js +13 -1
  109. package/dist/components/titan-layout/with-tooltip.js.map +1 -1
  110. package/dist/index.d.ts +4 -3
  111. package/dist/index.d.ts.map +1 -1
  112. package/dist/index.js +2 -3
  113. package/dist/index.js.map +1 -1
  114. package/dist/test/data-stories.module.less.d.ts +3 -0
  115. package/dist/test/data.js +223 -90
  116. package/dist/test/data.js.map +1 -1
  117. package/dist/utils/counter-tag.js +2 -1
  118. package/dist/utils/counter-tag.js.map +1 -1
  119. package/dist/utils/navigation-context.js +12 -6
  120. package/dist/utils/navigation-context.js.map +1 -1
  121. package/dist/utils/navigation-legacy.js +2 -1
  122. package/dist/utils/navigation-legacy.js.map +1 -1
  123. package/dist/utils/navigation.js +2 -1
  124. package/dist/utils/navigation.js.map +1 -1
  125. package/dist/utils/side-nav.js +9 -6
  126. package/dist/utils/side-nav.js.map +1 -1
  127. package/dist/utils/use-breakpoint.js +11 -8
  128. package/dist/utils/use-breakpoint.js.map +1 -1
  129. package/package.json +4 -4
  130. package/src/components/left-navigation/index.ts +1 -1
  131. package/src/components/logo/logo-titan.tsx +3 -1
  132. package/src/components/profile-dropdown/profile-dropdown.tsx +8 -4
  133. package/src/components/titan-layout/index.ts +2 -2
  134. package/src/components/titan-layout/layout-header-dark.tsx +186 -0
  135. package/src/components/titan-layout/layout-header-links.tsx +1 -1
  136. package/src/components/titan-layout/layout-header.module.less +337 -83
  137. package/src/components/titan-layout/layout-header.module.less.d.ts +19 -2
  138. package/src/components/titan-layout/layout-header.tsx +13 -16
  139. package/src/components/titan-layout/layout-logo.stories.tsx +103 -15
  140. package/src/components/titan-layout/layout-logo.tsx +33 -36
  141. package/src/components/titan-layout/layout-profile.stories.tsx +1 -1
  142. package/src/components/titan-layout/layout-sidebar.module.less +6 -2
  143. package/src/components/titan-layout/layout-sidebar.tsx +1 -1
  144. package/src/components/titan-layout/titan-layout.module.less +7 -2
  145. package/src/components/titan-layout/titan-layout.module.less.d.ts +2 -1
  146. package/src/components/titan-layout/titan-layout.stories.tsx +80 -23
  147. package/src/components/titan-layout/titan-layout.tsx +96 -85
  148. package/src/components/titan-layout/with-tooltip.tsx +5 -2
  149. package/src/index.ts +4 -5
  150. package/dist/components/header-navigation/header-navigation-extra-stacked.stories.js +0 -13
  151. package/dist/components/header-navigation/header-navigation-extra-stacked.stories.js.map +0 -1
  152. package/dist/components/header-navigation/header-navigation-extra.stories.js +0 -29
  153. package/dist/components/header-navigation/header-navigation-extra.stories.js.map +0 -1
  154. package/dist/components/header-navigation/header-navigation-stacked.stories.js +0 -50
  155. package/dist/components/header-navigation/header-navigation-stacked.stories.js.map +0 -1
  156. package/dist/components/header-navigation/header-navigation.stories.js +0 -54
  157. package/dist/components/header-navigation/header-navigation.stories.js.map +0 -1
  158. package/dist/components/layout.stories.js +0 -29
  159. package/dist/components/layout.stories.js.map +0 -1
  160. package/dist/components/left-navigation/header-navigation-extra-tiny.stories.js +0 -13
  161. package/dist/components/left-navigation/header-navigation-extra-tiny.stories.js.map +0 -1
  162. package/dist/components/left-navigation/header-navigation-tiny.stories.js +0 -30
  163. package/dist/components/left-navigation/header-navigation-tiny.stories.js.map +0 -1
  164. package/dist/components/left-navigation/side-navigation.stories.js +0 -115
  165. package/dist/components/left-navigation/side-navigation.stories.js.map +0 -1
  166. package/dist/components/logo/logo.stories.js +0 -20
  167. package/dist/components/logo/logo.stories.js.map +0 -1
  168. package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.js +0 -13
  169. package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.js.map +0 -1
  170. package/dist/components/profile-dropdown/profile-dropdown-tiny.stories.js +0 -13
  171. package/dist/components/profile-dropdown/profile-dropdown-tiny.stories.js.map +0 -1
  172. package/dist/components/profile-dropdown/profile-dropdown.stories.js +0 -51
  173. package/dist/components/profile-dropdown/profile-dropdown.stories.js.map +0 -1
  174. package/dist/components/titan-layout/layout-logo.stories.js +0 -17
  175. package/dist/components/titan-layout/layout-logo.stories.js.map +0 -1
  176. package/dist/components/titan-layout/layout-profile.stories.js +0 -13
  177. package/dist/components/titan-layout/layout-profile.stories.js.map +0 -1
  178. package/dist/components/titan-layout/titan-layout.stories.js +0 -83
  179. package/dist/components/titan-layout/titan-layout.stories.js.map +0 -1
@@ -6,83 +6,224 @@ import SvgAccountActive from '@servicetitan/anvil2/assets/icons/st/gnav_account_
6
6
  import SvgAccountInactive from '@servicetitan/anvil2/assets/icons/st/gnav_account_inactive.svg';
7
7
  import { BodyText, Popover } from '@servicetitan/design-system';
8
8
  import classNames from 'classnames';
9
- import { useCallback, useContext, useEffect, useMemo, useState, } from 'react';
10
- import { NavigationComponentContext, NavigationLegacyContext, } from '../../utils/navigation-context';
9
+ import { useCallback, useContext, useEffect, useMemo, useState } from 'react';
10
+ import { NavigationComponentContext, NavigationLegacyContext } from '../../utils/navigation-context';
11
11
  import { getCounterTag } from '../../utils/side-nav';
12
12
  import { CounterTag } from '../counter-tag';
13
13
  import { withTooltip } from '../titan-layout/with-tooltip';
14
14
  import * as Styles from './profile-dropdown.module.less';
15
15
  import { ProfileLogo } from './profile-icon';
16
- const ProfileDropdownTrigger = ({ avatarBadge, badge, className, hintArrow, imageSrc, info, onClick, open, }) => {
16
+ const ProfileDropdownTrigger = ({ avatarBadge, badge, className, hintArrow, imageSrc, info, onClick, open })=>{
17
17
  const [avatarSource, setAvatarSource] = useState(imageSrc !== null && imageSrc !== void 0 ? imageSrc : '');
18
18
  const [avatarSourceError, setAvatarSourceError] = useState(false);
19
19
  const isLegacy = useContext(NavigationLegacyContext);
20
- useEffect(() => {
20
+ useEffect(()=>{
21
21
  const src = imageSrc !== null && imageSrc !== void 0 ? imageSrc : '';
22
22
  if (src === avatarSource) {
23
23
  return;
24
24
  }
25
25
  setAvatarSource(src);
26
26
  setAvatarSourceError(false);
27
- }, [imageSrc, avatarSource]);
28
- const onAvatarError = useCallback(() => {
27
+ }, [
28
+ imageSrc,
29
+ avatarSource
30
+ ]);
31
+ const onAvatarError = useCallback(()=>{
29
32
  setAvatarSourceError(true);
30
33
  }, []);
31
- return (_jsxs("div", { className: classNames('d-f align-items-center cursor-pointer position-relative p-x-1 p-y-half', 'profile-dropdown-trigger', Styles.triggerContainer, {
34
+ return /*#__PURE__*/ _jsxs("div", {
35
+ className: classNames('d-f align-items-center cursor-pointer position-relative p-x-1 p-y-half', 'profile-dropdown-trigger', Styles.triggerContainer, {
32
36
  [Styles.triggerContainerHintArrow]: hintArrow,
33
- [Styles.triggerContainerLegacy]: isLegacy,
34
- }, className), onClick: onClick, "data-cy": "profile-dropdown-trigger", "data-pendo": "profile-dropdown-trigger", children: [avatarSource && !avatarSourceError ? (_jsx("img", { src: avatarSource, className: classNames(Styles.profileImage, 'profile-dropdown-image'), onError: onAvatarError, alt: "user dropdown menu" })) : isLegacy ? (_jsx(ProfileLogo, {})) : (_jsx(Icon, { size: "large", svg: open ? SvgAccountActive : SvgAccountInactive })), !!info && (_jsxs("div", { className: Styles.info, children: [_jsx(BodyText, { bold: true, title: info.title, className: "t-truncate c-inherit", size: "xsmall", children: info.title }), _jsx(BodyText, { title: info.text, className: "t-truncate c-neutral-70 tt-uppercase", size: "xsmall", children: info.text })] })), _jsx(Icon, { svg: open ? SvgExpandLess : SvgExpandMore, className: classNames(Styles.expandIcon), size: "small" }), !!avatarBadge && (_jsx("div", { className: classNames(Styles.avatarBadge, avatarBadge === true ? 'bg-blue-500' : `bg-${avatarBadge}`) })), !!badge && (_jsx("span", { className: classNames(Styles.badge, badge.content ? Styles.badgeWithContent : Styles.badgeNoContent, badge.className), children: badge.content }))] }));
37
+ [Styles.triggerContainerLegacy]: isLegacy
38
+ }, className),
39
+ onClick: onClick,
40
+ "data-cy": "profile-dropdown-trigger",
41
+ "data-pendo": "profile-dropdown-trigger",
42
+ children: [
43
+ avatarSource && !avatarSourceError ? /*#__PURE__*/ _jsx("img", {
44
+ src: avatarSource,
45
+ className: classNames(Styles.profileImage, 'profile-dropdown-image'),
46
+ onError: onAvatarError,
47
+ alt: "user dropdown menu"
48
+ }) : isLegacy ? /*#__PURE__*/ _jsx(ProfileLogo, {}) : /*#__PURE__*/ _jsx(Icon, {
49
+ className: "c-inherit-i",
50
+ size: "large",
51
+ svg: open ? SvgAccountActive : SvgAccountInactive
52
+ }),
53
+ !!info && /*#__PURE__*/ _jsxs("div", {
54
+ className: Styles.info,
55
+ children: [
56
+ /*#__PURE__*/ _jsx(BodyText, {
57
+ bold: true,
58
+ title: info.title,
59
+ className: "t-truncate c-inherit",
60
+ size: "xsmall",
61
+ children: info.title
62
+ }),
63
+ /*#__PURE__*/ _jsx(BodyText, {
64
+ title: info.text,
65
+ className: "t-truncate c-neutral-70 tt-uppercase",
66
+ size: "xsmall",
67
+ children: info.text
68
+ })
69
+ ]
70
+ }),
71
+ /*#__PURE__*/ _jsx(Icon, {
72
+ svg: open ? SvgExpandLess : SvgExpandMore,
73
+ className: classNames(Styles.expandIcon, 'c-inherit-i'),
74
+ size: "small"
75
+ }),
76
+ !!avatarBadge && /*#__PURE__*/ _jsx("div", {
77
+ className: classNames(Styles.avatarBadge, avatarBadge === true ? 'bg-blue-500' : `bg-${avatarBadge}`)
78
+ }),
79
+ !!badge && /*#__PURE__*/ _jsx("span", {
80
+ className: classNames(Styles.badge, badge.content ? Styles.badgeWithContent : Styles.badgeNoContent, badge.className),
81
+ children: badge.content
82
+ })
83
+ ]
84
+ });
35
85
  };
36
- const useTag = (counter, tag) => useMemo(() => {
37
- const data = getCounterTag(counter, tag);
38
- return data ? (_jsx("div", { className: Styles.counterWrapper, children: _jsx(CounterTag, { className: Styles.counter, data: data }) })) : undefined;
39
- }, [counter, tag]);
40
- export const ProfileDropdownSection = ({ children, className, counter, id, tag, text, tooltip, onClick, ...rest }) => {
41
- const clickHandler = e => {
86
+ const useTag = (counter, tag)=>useMemo(()=>{
87
+ const data = getCounterTag(counter, tag);
88
+ return data ? /*#__PURE__*/ _jsx("div", {
89
+ className: Styles.counterWrapper,
90
+ children: /*#__PURE__*/ _jsx(CounterTag, {
91
+ className: Styles.counter,
92
+ data: data
93
+ })
94
+ }) : undefined;
95
+ }, [
96
+ counter,
97
+ tag
98
+ ]);
99
+ export const ProfileDropdownSection = ({ children, className, counter, id, tag, text, tooltip, onClick, ...rest })=>{
100
+ const clickHandler = (e)=>{
42
101
  if (onClick) {
43
102
  onClick(e);
44
- }
45
- else {
103
+ } else {
46
104
  e.stopPropagation();
47
105
  }
48
106
  };
49
107
  const tagElement = useTag(counter, tag);
50
- return withTooltip(_jsxs("div", { className: classNames(Styles.dropdownSection, tagElement && Styles.dropdownSectionWithCounter, !!onClick && Styles.dropdownLink, className), onClick: clickHandler, "data-cy": `profile-dropdown-section-${id}`, "data-pendo": `profile-dropdown-section-${id}`, ...rest, children: [children, tagElement] }), tooltip, 'left');
108
+ return withTooltip(/*#__PURE__*/ _jsxs("div", {
109
+ className: classNames(Styles.dropdownSection, tagElement && Styles.dropdownSectionWithCounter, !!onClick && Styles.dropdownLink, className),
110
+ onClick: clickHandler,
111
+ "data-cy": `profile-dropdown-section-${id}`,
112
+ "data-pendo": `profile-dropdown-section-${id}`,
113
+ ...rest,
114
+ children: [
115
+ children,
116
+ tagElement
117
+ ]
118
+ }), tooltip, {
119
+ placement: 'left'
120
+ });
51
121
  };
52
122
  export const ProfileDropdownDivider = Popover.Divider;
53
- export const ProfileDropdownLink = ({ children, className, external, id, counter, tag, target, text, to, tooltip, onClick, ...rest }) => {
123
+ export const ProfileDropdownLink = ({ children, className, external, id, counter, tag, target, text, to, tooltip, onClick, ...rest })=>{
54
124
  const NavigationComponent = useContext(NavigationComponentContext);
55
125
  const isExternalLink = external !== null && external !== void 0 ? external : to === null || to === void 0 ? void 0 : to.startsWith('http');
56
126
  const tagElement = useTag(counter, tag);
57
- return withTooltip(isExternalLink ? (_jsxs("a", { className: classNames(Styles.dropdownSection, tagElement && Styles.dropdownSectionWithCounter, Styles.dropdownLink, className), href: to, target: target, "data-cy": `profile-dropdown-link-${id}`, "data-pendo": `profile-dropdown-link-${id}`, ...rest, children: [children, tagElement] })) : (_jsxs(NavigationComponent, { className: classNames(Styles.dropdownSection, Styles.dropdownLink, { [Styles.dropdownSectionWithCounter]: !!tagElement }, className), target: target, to: to, "data-cy": `profile-dropdown-link-${id}`, "data-pendo": `profile-dropdown-link-${id}`, ...rest, children: [children, tagElement] })), tooltip, 'left');
127
+ return withTooltip(isExternalLink ? /*#__PURE__*/ _jsxs("a", {
128
+ className: classNames(Styles.dropdownSection, tagElement && Styles.dropdownSectionWithCounter, Styles.dropdownLink, className),
129
+ href: to,
130
+ target: target,
131
+ "data-cy": `profile-dropdown-link-${id}`,
132
+ "data-pendo": `profile-dropdown-link-${id}`,
133
+ ...rest,
134
+ children: [
135
+ children,
136
+ tagElement
137
+ ]
138
+ }) : /*#__PURE__*/ _jsxs(NavigationComponent, {
139
+ className: classNames(Styles.dropdownSection, Styles.dropdownLink, {
140
+ [Styles.dropdownSectionWithCounter]: !!tagElement
141
+ }, className),
142
+ target: target,
143
+ to: to,
144
+ "data-cy": `profile-dropdown-link-${id}`,
145
+ "data-pendo": `profile-dropdown-link-${id}`,
146
+ ...rest,
147
+ children: [
148
+ children,
149
+ tagElement
150
+ ]
151
+ }), tooltip, {
152
+ placement: 'left'
153
+ });
58
154
  };
59
- export const ProfileDropdown = (({ children, className, direction, hintPopup, onClose, onOpen, portal, trigger, width, }) => {
60
- var _a;
155
+ export const ProfileDropdown = ({ children, className, direction, hintPopup, onClose, onOpen, portal, trigger, width })=>{
61
156
  const [open, setOpen] = useState(false);
62
- const handleClose = useCallback(() => {
157
+ const handleClose = useCallback(()=>{
63
158
  setOpen(false);
64
159
  onClose === null || onClose === void 0 ? void 0 : onClose();
65
- }, [onClose]);
66
- const handleOpen = useCallback(() => {
160
+ }, [
161
+ onClose
162
+ ]);
163
+ const handleOpen = useCallback(()=>{
67
164
  setOpen(true);
68
165
  onOpen === null || onOpen === void 0 ? void 0 : onOpen();
69
- }, [onOpen]);
70
- const onTriggerClick = useCallback((e) => {
166
+ }, [
167
+ onOpen
168
+ ]);
169
+ const onTriggerClick = useCallback((e)=>{
71
170
  e.stopPropagation();
72
171
  setOpen(!open);
73
172
  if (open) {
74
173
  onClose === null || onClose === void 0 ? void 0 : onClose();
75
- }
76
- else {
174
+ } else {
77
175
  onOpen === null || onOpen === void 0 ? void 0 : onOpen();
78
176
  }
79
- }, [open, onOpen, onClose]);
177
+ }, [
178
+ open,
179
+ onOpen,
180
+ onClose
181
+ ]);
80
182
  const hintShown = !!hintPopup && !open;
81
183
  const HintComponent = hintPopup === null || hintPopup === void 0 ? void 0 : hintPopup.content;
82
- const triggerElement = (_jsx(ProfileDropdownTrigger, { ...trigger, onClick: children ? onTriggerClick : undefined, hintArrow: hintShown, open: open }));
83
- return (_jsx("div", { className: className, "data-cy": "profile-dropdown", children: !!hintPopup && hintShown && HintComponent ? (_jsx(Popover, { direction: direction !== null && direction !== void 0 ? direction : 'bl', width: (_a = hintPopup.width) !== null && _a !== void 0 ? _a : 'xs', trigger: triggerElement, popoverContentClassName: Styles.hint, onClickOutside: hintPopup === null || hintPopup === void 0 ? void 0 : hintPopup.onClose, open: true, children: _jsx("div", { className: classNames(Styles.hintContent, hintPopup.className), children: _jsx(HintComponent, { openProfile: handleOpen }) }) })) : (_jsx(Popover, { direction: direction !== null && direction !== void 0 ? direction : 'bl', width: width !== null && width !== void 0 ? width : 'xs', trigger: triggerElement, open: open, portal: portal, onClickOutside: handleClose, className: Styles.dropdown, popoverContentClassName: classNames(Styles.dropdownContent, Styles.dropdownContentBottomLeft), children: _jsx("div", { className: Styles.dropdownContentWrapper, onClick: handleClose, "data-cy": "profile-dropdown-content", children: children }) })) }));
84
- });
184
+ const triggerElement = /*#__PURE__*/ _jsx(ProfileDropdownTrigger, {
185
+ ...trigger,
186
+ onClick: children ? onTriggerClick : undefined,
187
+ hintArrow: hintShown,
188
+ open: open
189
+ });
190
+ var _hintPopup_width;
191
+ return /*#__PURE__*/ _jsx("div", {
192
+ className: className,
193
+ "data-cy": "profile-dropdown",
194
+ children: !!hintPopup && hintShown && HintComponent ? /*#__PURE__*/ _jsx(Popover, {
195
+ direction: direction !== null && direction !== void 0 ? direction : 'bl',
196
+ width: (_hintPopup_width = hintPopup.width) !== null && _hintPopup_width !== void 0 ? _hintPopup_width : 'xs',
197
+ trigger: triggerElement,
198
+ popoverContentClassName: Styles.hint,
199
+ onClickOutside: hintPopup === null || hintPopup === void 0 ? void 0 : hintPopup.onClose,
200
+ open: true,
201
+ children: /*#__PURE__*/ _jsx("div", {
202
+ className: classNames(Styles.hintContent, hintPopup.className),
203
+ children: /*#__PURE__*/ _jsx(HintComponent, {
204
+ openProfile: handleOpen
205
+ })
206
+ })
207
+ }) : /*#__PURE__*/ _jsx(Popover, {
208
+ direction: direction !== null && direction !== void 0 ? direction : 'bl',
209
+ width: width !== null && width !== void 0 ? width : 'xs',
210
+ trigger: triggerElement,
211
+ open: open,
212
+ portal: portal,
213
+ onClickOutside: handleClose,
214
+ className: Styles.dropdown,
215
+ popoverContentClassName: classNames(Styles.dropdownContent, Styles.dropdownContentBottomLeft),
216
+ children: /*#__PURE__*/ _jsx("div", {
217
+ className: Styles.dropdownContentWrapper,
218
+ onClick: handleClose,
219
+ "data-cy": "profile-dropdown-content",
220
+ children: children
221
+ })
222
+ })
223
+ });
224
+ };
85
225
  ProfileDropdown.Divider = ProfileDropdownDivider;
86
226
  ProfileDropdown.Link = ProfileDropdownLink;
87
227
  ProfileDropdown.Section = ProfileDropdownSection;
228
+
88
229
  //# sourceMappingURL=profile-dropdown.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"profile-dropdown.js","sourceRoot":"","sources":["../../../src/components/profile-dropdown/profile-dropdown.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,aAAa,MAAM,kEAAkE,CAAC;AAC7F,OAAO,aAAa,MAAM,kEAAkE,CAAC;AAC7F,OAAO,gBAAgB,MAAM,8DAA8D,CAAC;AAC5F,OAAO,kBAAkB,MAAM,gEAAgE,CAAC;AAChG,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAsB,MAAM,6BAA6B,CAAC;AACpF,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAOH,WAAW,EACX,UAAU,EACV,SAAS,EACT,OAAO,EACP,QAAQ,GACX,MAAM,OAAO,CAAC;AAGf,OAAO,EACH,0BAA0B,EAC1B,uBAAuB,GAC1B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAa7C,MAAM,sBAAsB,GAAoC,CAAC,EAC7D,WAAW,EACX,KAAK,EACL,SAAS,EACT,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,IAAI,GACP,EAAE,EAAE;IACD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,EAAE,CAA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C,CAAC,CAAC,CACzC,KAAC,OAAO,IACJ,SAAS,EAAE,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,IAAI,EAC5B,KAAK,EAAE,MAAA,SAAS,CAAC,KAAK,mCAAI,IAAI,EAC9B,OAAO,EAAE,cAAc,EACvB,uBAAuB,EAAE,MAAM,CAAC,IAAI,EACpC,cAAc,EAAE,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,OAAO,EAClC,IAAI,kBAEJ,cAAK,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,SAAS,CAAC,YAC/D,KAAC,aAAa,IAAC,WAAW,EAAE,UAAU,GAAI,GACxC,GACA,CACb,CAAC,CAAC,CAAC,CACA,KAAC,OAAO,IACJ,SAAS,EAAE,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,IAAI,EAC5B,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,IAAI,EACpB,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,WAAW,EAC3B,SAAS,EAAE,MAAM,CAAC,QAAQ,EAC1B,uBAAuB,EAAE,UAAU,CAC/B,MAAM,CAAC,eAAe,EACtB,MAAM,CAAC,yBAAyB,CACnC,YAED,cACI,SAAS,EAAE,MAAM,CAAC,sBAAsB,EACxC,OAAO,EAAE,WAAW,aACZ,0BAA0B,YAEjC,QAAQ,GACP,GACA,CACb,GACC,CACT,CAAC;AACN,CAAC,CAAwB,CAAC;AAE1B,eAAe,CAAC,OAAO,GAAG,sBAAsB,CAAC;AACjD,eAAe,CAAC,IAAI,GAAG,mBAAmB,CAAC;AAC3C,eAAe,CAAC,OAAO,GAAG,sBAAsB,CAAC"}
1
+ {"version":3,"sources":["../../../src/components/profile-dropdown/profile-dropdown.tsx"],"sourcesContent":["import { Icon } from '@servicetitan/anvil2';\nimport SvgExpandLess from '@servicetitan/anvil2/assets/icons/material/round/expand_less.svg';\nimport SvgExpandMore from '@servicetitan/anvil2/assets/icons/material/round/expand_more.svg';\nimport SvgAccountActive from '@servicetitan/anvil2/assets/icons/st/gnav_account_active.svg';\nimport SvgAccountInactive from '@servicetitan/anvil2/assets/icons/st/gnav_account_inactive.svg';\nimport { BodyText, Popover, PopoverPropsStrict } from '@servicetitan/design-system';\nimport classNames from 'classnames';\nimport {\n ComponentPropsWithoutRef,\n FC,\n HTMLAttributeAnchorTarget,\n MouseEvent,\n MouseEventHandler,\n ReactNode,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\n\nimport { CounterTagData, CounterTagValue } from '../../utils/counter-tag';\nimport {\n NavigationComponentContext,\n NavigationLegacyContext,\n} from '../../utils/navigation-context';\nimport { getCounterTag } from '../../utils/side-nav';\nimport { CounterTag } from '../counter-tag';\nimport { withTooltip } from '../titan-layout/with-tooltip';\nimport * as Styles from './profile-dropdown.module.less';\nimport { ProfileLogo } from './profile-icon';\n\nexport interface ProfileDropdownTriggerProps {\n className?: string;\n info?: { title: string; text: string };\n imageSrc?: string | null;\n avatarBadge?: boolean | string;\n badge?: { content?: number | string; className: string };\n hintArrow?: boolean;\n open: boolean;\n onClick?(e: MouseEvent): void;\n}\n\nconst ProfileDropdownTrigger: FC<ProfileDropdownTriggerProps> = ({\n avatarBadge,\n badge,\n className,\n hintArrow,\n imageSrc,\n info,\n onClick,\n open,\n}) => {\n const [avatarSource, setAvatarSource] = useState(imageSrc ?? '');\n const [avatarSourceError, setAvatarSourceError] = useState(false);\n const isLegacy = useContext(NavigationLegacyContext);\n\n useEffect(() => {\n const src = imageSrc ?? '';\n\n if (src === avatarSource) {\n return;\n }\n\n setAvatarSource(src);\n setAvatarSourceError(false);\n }, [imageSrc, avatarSource]);\n\n const onAvatarError = useCallback(() => {\n setAvatarSourceError(true);\n }, []);\n\n return (\n <div\n className={classNames(\n 'd-f align-items-center cursor-pointer position-relative p-x-1 p-y-half',\n 'profile-dropdown-trigger',\n Styles.triggerContainer,\n {\n [Styles.triggerContainerHintArrow]: hintArrow,\n [Styles.triggerContainerLegacy]: isLegacy,\n },\n className\n )}\n onClick={onClick}\n data-cy=\"profile-dropdown-trigger\"\n data-pendo=\"profile-dropdown-trigger\"\n >\n {avatarSource && !avatarSourceError ? (\n <img\n src={avatarSource}\n className={classNames(Styles.profileImage, 'profile-dropdown-image')}\n onError={onAvatarError}\n alt=\"user dropdown menu\"\n />\n ) : isLegacy ? (\n <ProfileLogo />\n ) : (\n <Icon\n className=\"c-inherit-i\"\n size=\"large\"\n svg={open ? SvgAccountActive : SvgAccountInactive}\n />\n )}\n\n {!!info && (\n <div className={Styles.info}>\n <BodyText\n bold\n title={info.title}\n className=\"t-truncate c-inherit\"\n size=\"xsmall\"\n >\n {info.title}\n </BodyText>\n <BodyText\n title={info.text}\n className=\"t-truncate c-neutral-70 tt-uppercase\"\n size=\"xsmall\"\n >\n {info.text}\n </BodyText>\n </div>\n )}\n\n <Icon\n svg={open ? SvgExpandLess : SvgExpandMore}\n className={classNames(Styles.expandIcon, 'c-inherit-i')}\n size=\"small\"\n />\n\n {!!avatarBadge && (\n <div\n className={classNames(\n Styles.avatarBadge,\n avatarBadge === true ? 'bg-blue-500' : `bg-${avatarBadge}`\n )}\n />\n )}\n {!!badge && (\n <span\n className={classNames(\n Styles.badge,\n badge.content ? Styles.badgeWithContent : Styles.badgeNoContent,\n badge.className\n )}\n >\n {badge.content}\n </span>\n )}\n </div>\n );\n};\n\nconst useTag = (counter?: CounterTagValue, tag?: CounterTagData) =>\n useMemo(() => {\n const data = getCounterTag(counter, tag);\n\n return data ? (\n <div className={Styles.counterWrapper}>\n <CounterTag className={Styles.counter} data={data} />\n </div>\n ) : undefined;\n }, [counter, tag]);\n\nexport type ProfileItemContent =\n | { children: string; text?: string }\n | { children: ReactNode; text: string };\n\nexport interface ProfileDropdownSectionPropsStrict {\n children: ReactNode;\n id: string;\n tooltip?: string;\n className?: string;\n tag?: CounterTagData;\n counter?: CounterTagValue;\n onClick?(e: MouseEvent): void;\n}\n\nexport type ProfileDropdownSectionProps = Omit<ComponentPropsWithoutRef<'div'>, 'children'> &\n ProfileDropdownSectionPropsStrict &\n ProfileItemContent;\n\nexport const ProfileDropdownSection: FC<ProfileDropdownSectionProps> = ({\n children,\n className,\n counter,\n id,\n tag,\n text,\n tooltip,\n onClick,\n ...rest\n}) => {\n const clickHandler: MouseEventHandler<never> = e => {\n if (onClick) {\n onClick(e);\n } else {\n e.stopPropagation();\n }\n };\n\n const tagElement = useTag(counter, tag);\n\n return withTooltip(\n <div\n className={classNames(\n Styles.dropdownSection,\n tagElement && Styles.dropdownSectionWithCounter,\n !!onClick && Styles.dropdownLink,\n className\n )}\n onClick={clickHandler}\n data-cy={`profile-dropdown-section-${id}`}\n data-pendo={`profile-dropdown-section-${id}`}\n {...rest}\n >\n {children}\n {tagElement}\n </div>,\n tooltip,\n { placement: 'left' }\n );\n};\n\nexport const ProfileDropdownDivider: FC = Popover.Divider;\n\nexport interface ProfileDropdownLinkPropsStrict {\n id: string;\n children: ReactNode;\n className?: string;\n external?: boolean;\n target?: HTMLAttributeAnchorTarget;\n tooltip?: string;\n to: string;\n tag?: CounterTagData;\n counter?: CounterTagValue;\n}\n\nexport type ProfileDropdownLinkProps = Omit<ComponentPropsWithoutRef<'a'>, 'children'> &\n ProfileDropdownLinkPropsStrict &\n ProfileItemContent;\n\nexport const ProfileDropdownLink: FC<ProfileDropdownLinkProps> = ({\n children,\n className,\n external,\n id,\n counter,\n tag,\n target,\n text,\n to,\n tooltip,\n onClick,\n ...rest\n}: ProfileDropdownLinkProps) => {\n const NavigationComponent = useContext(NavigationComponentContext);\n\n const isExternalLink = external ?? to?.startsWith('http');\n\n const tagElement = useTag(counter, tag);\n\n return withTooltip(\n isExternalLink ? (\n <a\n className={classNames(\n Styles.dropdownSection,\n tagElement && Styles.dropdownSectionWithCounter,\n Styles.dropdownLink,\n className\n )}\n href={to}\n target={target}\n data-cy={`profile-dropdown-link-${id}`}\n data-pendo={`profile-dropdown-link-${id}`}\n {...rest}\n >\n {children}\n {tagElement}\n </a>\n ) : (\n <NavigationComponent\n className={classNames(\n Styles.dropdownSection,\n Styles.dropdownLink,\n { [Styles.dropdownSectionWithCounter]: !!tagElement },\n className\n )}\n target={target}\n to={to}\n data-cy={`profile-dropdown-link-${id}`}\n data-pendo={`profile-dropdown-link-${id}`}\n {...rest}\n >\n {children}\n {tagElement}\n </NavigationComponent>\n ),\n tooltip,\n { placement: 'left' }\n );\n};\n\nexport interface ProfileDropdownPropsStrict {\n children?: ReactNode;\n className?: string;\n direction?: PopoverPropsStrict['direction'];\n trigger?: Omit<ProfileDropdownTriggerProps, 'onClick' | 'open' | 'hintArrow'>;\n hintPopup?: {\n className?: string;\n content: FC<{ openProfile(): void }>;\n width?: PopoverPropsStrict['width'];\n onClose?: () => void;\n };\n portal?: boolean;\n width?: PopoverPropsStrict['width'];\n onClose?(): void;\n onOpen?(): void;\n}\n\nexport interface ProfileDropdownProps extends ProfileDropdownPropsStrict {\n [key: string]: any;\n}\n\nexport interface ProfileDropdownType extends FC<ProfileDropdownProps> {\n Divider: typeof ProfileDropdownDivider;\n Link: typeof ProfileDropdownLink;\n Trigger: typeof ProfileDropdownTrigger;\n Section: typeof ProfileDropdownSection;\n}\n\nexport const ProfileDropdown: ProfileDropdownType = (({\n children,\n className,\n direction,\n hintPopup,\n onClose,\n onOpen,\n portal,\n trigger,\n width,\n}) => {\n const [open, setOpen] = useState(false);\n const handleClose = useCallback(() => {\n setOpen(false);\n onClose?.();\n }, [onClose]);\n const handleOpen = useCallback(() => {\n setOpen(true);\n onOpen?.();\n }, [onOpen]);\n const onTriggerClick = useCallback(\n (e: MouseEvent) => {\n e.stopPropagation();\n setOpen(!open);\n\n if (open) {\n onClose?.();\n } else {\n onOpen?.();\n }\n },\n [open, onOpen, onClose]\n );\n const hintShown = !!hintPopup && !open;\n const HintComponent = hintPopup?.content;\n\n const triggerElement = (\n <ProfileDropdownTrigger\n {...trigger}\n onClick={children ? onTriggerClick : undefined}\n hintArrow={hintShown}\n open={open}\n />\n );\n\n return (\n <div className={className} data-cy=\"profile-dropdown\">\n {!!hintPopup && hintShown && HintComponent ? (\n <Popover\n direction={direction ?? 'bl'}\n width={hintPopup.width ?? 'xs'}\n trigger={triggerElement}\n popoverContentClassName={Styles.hint}\n onClickOutside={hintPopup?.onClose}\n open\n >\n <div className={classNames(Styles.hintContent, hintPopup.className)}>\n <HintComponent openProfile={handleOpen} />\n </div>\n </Popover>\n ) : (\n <Popover\n direction={direction ?? 'bl'}\n width={width ?? 'xs'}\n trigger={triggerElement}\n open={open}\n portal={portal}\n onClickOutside={handleClose}\n className={Styles.dropdown}\n popoverContentClassName={classNames(\n Styles.dropdownContent,\n Styles.dropdownContentBottomLeft\n )}\n >\n <div\n className={Styles.dropdownContentWrapper}\n onClick={handleClose}\n data-cy=\"profile-dropdown-content\"\n >\n {children}\n </div>\n </Popover>\n )}\n </div>\n );\n}) as ProfileDropdownType;\n\nProfileDropdown.Divider = ProfileDropdownDivider;\nProfileDropdown.Link = ProfileDropdownLink;\nProfileDropdown.Section = ProfileDropdownSection;\n"],"names":["Icon","SvgExpandLess","SvgExpandMore","SvgAccountActive","SvgAccountInactive","BodyText","Popover","classNames","useCallback","useContext","useEffect","useMemo","useState","NavigationComponentContext","NavigationLegacyContext","getCounterTag","CounterTag","withTooltip","Styles","ProfileLogo","ProfileDropdownTrigger","avatarBadge","badge","className","hintArrow","imageSrc","info","onClick","open","avatarSource","setAvatarSource","avatarSourceError","setAvatarSourceError","isLegacy","src","onAvatarError","div","triggerContainer","triggerContainerHintArrow","triggerContainerLegacy","data-cy","data-pendo","img","profileImage","onError","alt","size","svg","bold","title","text","expandIcon","span","content","badgeWithContent","badgeNoContent","useTag","counter","tag","data","counterWrapper","undefined","ProfileDropdownSection","children","id","tooltip","rest","clickHandler","e","stopPropagation","tagElement","dropdownSection","dropdownSectionWithCounter","dropdownLink","placement","ProfileDropdownDivider","Divider","ProfileDropdownLink","external","target","to","NavigationComponent","isExternalLink","startsWith","a","href","ProfileDropdown","direction","hintPopup","onClose","onOpen","portal","trigger","width","setOpen","handleClose","handleOpen","onTriggerClick","hintShown","HintComponent","triggerElement","popoverContentClassName","hint","onClickOutside","hintContent","openProfile","dropdown","dropdownContent","dropdownContentBottomLeft","dropdownContentWrapper","Link","Section"],"mappings":";AAAA,SAASA,IAAI,QAAQ,uBAAuB;AAC5C,OAAOC,mBAAmB,mEAAmE;AAC7F,OAAOC,mBAAmB,mEAAmE;AAC7F,OAAOC,sBAAsB,+DAA+D;AAC5F,OAAOC,wBAAwB,iEAAiE;AAChG,SAASC,QAAQ,EAAEC,OAAO,QAA4B,8BAA8B;AACpF,OAAOC,gBAAgB,aAAa;AACpC,SAOIC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,QAAQ,QACL,QAAQ;AAGf,SACIC,0BAA0B,EAC1BC,uBAAuB,QACpB,iCAAiC;AACxC,SAASC,aAAa,QAAQ,uBAAuB;AACrD,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,WAAW,QAAQ,+BAA+B;AAC3D,YAAYC,YAAY,iCAAiC;AACzD,SAASC,WAAW,QAAQ,iBAAiB;AAa7C,MAAMC,yBAA0D,CAAC,EAC7DC,WAAW,EACXC,KAAK,EACLC,SAAS,EACTC,SAAS,EACTC,QAAQ,EACRC,IAAI,EACJC,OAAO,EACPC,IAAI,EACP;IACG,MAAM,CAACC,cAAcC,gBAAgB,GAAGlB,SAASa,qBAAAA,sBAAAA,WAAY;IAC7D,MAAM,CAACM,mBAAmBC,qBAAqB,GAAGpB,SAAS;IAC3D,MAAMqB,WAAWxB,WAAWK;IAE5BJ,UAAU;QACN,MAAMwB,MAAMT,qBAAAA,sBAAAA,WAAY;QAExB,IAAIS,QAAQL,cAAc;YACtB;QACJ;QAEAC,gBAAgBI;QAChBF,qBAAqB;IACzB,GAAG;QAACP;QAAUI;KAAa;IAE3B,MAAMM,gBAAgB3B,YA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CAACV,aAAa,CAAC5D;IAClC,MAAMuE,gBAAgBX,sBAAAA,gCAAAA,UAAWnC,OAAO;IAExC,MAAM+C,+BACF,KAAChF;QACI,GAAGwE,OAAO;QACXjE,SAASoC,WAAWkC,iBAAiBpC;QACrCrC,WAAW0E;QACXtE,MAAMA;;QASS4D;IALvB,qBACI,KAACpD;QAAIb,WAAWA;QAAWiB,WAAQ;kBAC9B,CAAC,CAACgD,aAAaU,aAAaC,8BACzB,KAAC7F;YACGiF,WAAWA,sBAAAA,uBAAAA,YAAa;YACxBM,OAAOL,CAAAA,mBAAAA,UAAUK,KAAK,cAAfL,8BAAAA,mBAAmB;YAC1BI,SAASQ;YACTC,yBAAyBnF,OAAOoF,IAAI;YACpCC,cAAc,EAAEf,sBAAAA,gCAAAA,UAAWC,OAAO;YAClC7D,IAAI;sBAEJ,cAAA,KAACQ;gBAAIb,WAAWhB,WAAWW,OAAOsF,WAAW,EAAEhB,UAAUjE,SAAS;0BAC9D,cAAA,KAAC4E;oBAAcM,aAAaT;;;2BAIpC,KAAC1F;YACGiF,WAAWA,sBAAAA,uBAAAA,YAAa;YACxBM,OAAOA,kBAAAA,mBAAAA,QAAS;YAChBD,SAASQ;YACTxE,MAAMA;YACN+D,QAAQA;YACRY,gBAAgBR;YAChBxE,WAAWL,OAAOwF,QAAQ;YAC1BL,yBAAyB9F,WACrBW,OAAOyF,eAAe,EACtBzF,OAAO0F,yBAAyB;sBAGpC,cAAA,KAACxE;gBACGb,WAAWL,OAAO2F,sBAAsB;gBACxClF,SAASoE;gBACTvD,WAAQ;0BAEPuB;;;;AAMzB,EAA0B;AAE1BuB,gBAAgBV,OAAO,GAAGD;AAC1BW,gBAAgBwB,IAAI,GAAGjC;AACvBS,gBAAgByB,OAAO,GAAGjD"}
@@ -0,0 +1,23 @@
1
+ export const __esModule: true;
2
+ export const avatarBadge: string;
3
+ export const badge: string;
4
+ export const badgeNoContent: string;
5
+ export const badgeWithContent: string;
6
+ export const counter: string;
7
+ export const counterWrapper: string;
8
+ export const dropdown: string;
9
+ export const dropdownContent: string;
10
+ export const dropdownContentBottomLeft: string;
11
+ export const dropdownContentWrapper: string;
12
+ export const dropdownLink: string;
13
+ export const dropdownSection: string;
14
+ export const dropdownSectionWithCounter: string;
15
+ export const expandIcon: string;
16
+ export const hint: string;
17
+ export const hintContent: string;
18
+ export const info: string;
19
+ export const profileImage: string;
20
+ export const triggerContainer: string;
21
+ export const triggerContainerHintArrow: string;
22
+ export const triggerContainerLegacy: string;
23
+
@@ -1,5 +1,51 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- export const ProfileLogo = () => (_jsx("svg", { className: "profile-dropdown-svg", xmlns: "http://www.w3.org/2000/svg", version: "1.1", width: "1em", height: "1em", viewBox: "0 0 256 256", children: _jsxs("g", { stroke: "none", strokeWidth: "0", strokeDasharray: "none", strokeLinecap: "butt", strokeLinejoin: "miter", strokeMiterlimit: "10", fill: "currentColor", fillRule: "nonzero", opacity: "1", transform: "translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)", children: [_jsx("path", { d: "M 45 53.718 c -10.022 0 -18.175 -8.153 -18.175 -18.175 S 34.978 17.368 45 17.368 c 10.021 0 18.175 8.153 18.175 18.175 S 55.021 53.718 45 53.718 z", stroke: "none", strokeWidth: "1", strokeDasharray: "none", strokeLinecap: "round", strokeLinejoin: "miter", strokeMiterlimit: "10",
3
- // fill="currentColor"
4
- fillRule: "nonzero", opacity: "1", transform: " matrix(1 0 0 1 0 0) " }), _jsx("path", { d: "M 45 0 C 20.187 0 0 20.187 0 45 c 0 24.813 20.187 45 45 45 c 24.813 0 45 -20.187 45 -45 C 90 20.187 69.813 0 45 0 z M 74.821 70.096 c -3.543 -5.253 -8.457 -9.568 -14.159 -12.333 c -2.261 -1.096 -4.901 -1.08 -7.247 0.047 c -2.638 1.268 -5.47 1.91 -8.415 1.91 c -2.945 0 -5.776 -0.643 -8.415 -1.91 c -2.343 -1.125 -4.984 -1.143 -7.247 -0.047 c -5.702 2.765 -10.616 7.08 -14.16 12.333 C 9.457 63.308 6 54.552 6 45 C 6 23.495 23.495 6 45 6 s 39 17.495 39 39 C 84 54.552 80.543 63.308 74.821 70.096 z", stroke: "none", strokeWidth: "1", strokeDasharray: "none", strokeLinecap: "round", strokeLinejoin: "miter", strokeMiterlimit: "10", fill: "currentColor", fillRule: "nonzero", opacity: "1", transform: " matrix(1 0 0 1 0 0) " })] }) }));
2
+ export const ProfileLogo = ()=>/*#__PURE__*/ _jsx("svg", {
3
+ className: "profile-dropdown-svg",
4
+ xmlns: "http://www.w3.org/2000/svg",
5
+ version: "1.1",
6
+ width: "1em",
7
+ height: "1em",
8
+ viewBox: "0 0 256 256",
9
+ children: /*#__PURE__*/ _jsxs("g", {
10
+ stroke: "none",
11
+ strokeWidth: "0",
12
+ strokeDasharray: "none",
13
+ strokeLinecap: "butt",
14
+ strokeLinejoin: "miter",
15
+ strokeMiterlimit: "10",
16
+ fill: "currentColor",
17
+ fillRule: "nonzero",
18
+ opacity: "1",
19
+ transform: "translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)",
20
+ children: [
21
+ /*#__PURE__*/ _jsx("path", {
22
+ d: "M 45 53.718 c -10.022 0 -18.175 -8.153 -18.175 -18.175 S 34.978 17.368 45 17.368 c 10.021 0 18.175 8.153 18.175 18.175 S 55.021 53.718 45 53.718 z",
23
+ stroke: "none",
24
+ strokeWidth: "1",
25
+ strokeDasharray: "none",
26
+ strokeLinecap: "round",
27
+ strokeLinejoin: "miter",
28
+ strokeMiterlimit: "10",
29
+ // fill="currentColor"
30
+ fillRule: "nonzero",
31
+ opacity: "1",
32
+ transform: " matrix(1 0 0 1 0 0) "
33
+ }),
34
+ /*#__PURE__*/ _jsx("path", {
35
+ d: "M 45 0 C 20.187 0 0 20.187 0 45 c 0 24.813 20.187 45 45 45 c 24.813 0 45 -20.187 45 -45 C 90 20.187 69.813 0 45 0 z M 74.821 70.096 c -3.543 -5.253 -8.457 -9.568 -14.159 -12.333 c -2.261 -1.096 -4.901 -1.08 -7.247 0.047 c -2.638 1.268 -5.47 1.91 -8.415 1.91 c -2.945 0 -5.776 -0.643 -8.415 -1.91 c -2.343 -1.125 -4.984 -1.143 -7.247 -0.047 c -5.702 2.765 -10.616 7.08 -14.16 12.333 C 9.457 63.308 6 54.552 6 45 C 6 23.495 23.495 6 45 6 s 39 17.495 39 39 C 84 54.552 80.543 63.308 74.821 70.096 z",
36
+ stroke: "none",
37
+ strokeWidth: "1",
38
+ strokeDasharray: "none",
39
+ strokeLinecap: "round",
40
+ strokeLinejoin: "miter",
41
+ strokeMiterlimit: "10",
42
+ fill: "currentColor",
43
+ fillRule: "nonzero",
44
+ opacity: "1",
45
+ transform: " matrix(1 0 0 1 0 0) "
46
+ })
47
+ ]
48
+ })
49
+ });
50
+
5
51
  //# sourceMappingURL=profile-icon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"profile-icon.js","sourceRoot":"","sources":["../../../src/components/profile-dropdown/profile-icon.tsx"],"names":[],"mappings":";AAEA,MAAM,CAAC,MAAM,WAAW,GAAO,GAAG,EAAE,CAAC,CACjC,cACI,SAAS,EAAC,sBAAsB,EAChC,KAAK,EAAC,4BAA4B,EAClC,OAAO,EAAC,KAAK,EACb,KAAK,EAAC,KAAK,EACX,MAAM,EAAC,KAAK,EACZ,OAAO,EAAC,aAAa,YAErB,aACI,MAAM,EAAC,MAAM,EACb,WAAW,EAAC,GAAG,EACf,eAAe,EAAC,MAAM,EACtB,aAAa,EAAC,MAAM,EACpB,cAAc,EAAC,OAAO,EACtB,gBAAgB,EAAC,IAAI,EACrB,IAAI,EAAC,cAAc,EACnB,QAAQ,EAAC,SAAS,EAClB,OAAO,EAAC,GAAG,EACX,SAAS,EAAC,mEAAmE,aAE7E,eACI,CAAC,EAAC,oJAAoJ,EACtJ,MAAM,EAAC,MAAM,EACb,WAAW,EAAC,GAAG,EACf,eAAe,EAAC,MAAM,EACtB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,gBAAgB,EAAC,IAAI;gBACrB,sBAAsB;gBACtB,QAAQ,EAAC,SAAS,EAClB,OAAO,EAAC,GAAG,EACX,SAAS,EAAC,uBAAuB,GACnC,EAEF,eACI,CAAC,EAAC,ifAAif,EACnf,MAAM,EAAC,MAAM,EACb,WAAW,EAAC,GAAG,EACf,eAAe,EAAC,MAAM,EACtB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,gBAAgB,EAAC,IAAI,EACrB,IAAI,EAAC,cAAc,EACnB,QAAQ,EAAC,SAAS,EAClB,OAAO,EAAC,GAAG,EACX,SAAS,EAAC,uBAAuB,GACnC,IACF,GACF,CACT,CAAC"}
1
+ {"version":3,"sources":["../../../src/components/profile-dropdown/profile-icon.tsx"],"sourcesContent":["import { FC } from 'react';\n\nexport const ProfileLogo: FC = () => (\n <svg\n className=\"profile-dropdown-svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n version=\"1.1\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 256 256\"\n >\n <g\n stroke=\"none\"\n strokeWidth=\"0\"\n strokeDasharray=\"none\"\n strokeLinecap=\"butt\"\n strokeLinejoin=\"miter\"\n strokeMiterlimit=\"10\"\n fill=\"currentColor\"\n fillRule=\"nonzero\"\n opacity=\"1\"\n transform=\"translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)\"\n >\n <path\n d=\"M 45 53.718 c -10.022 0 -18.175 -8.153 -18.175 -18.175 S 34.978 17.368 45 17.368 c 10.021 0 18.175 8.153 18.175 18.175 S 55.021 53.718 45 53.718 z\"\n stroke=\"none\"\n strokeWidth=\"1\"\n strokeDasharray=\"none\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"miter\"\n strokeMiterlimit=\"10\"\n // fill=\"currentColor\"\n fillRule=\"nonzero\"\n opacity=\"1\"\n transform=\" matrix(1 0 0 1 0 0) \"\n />\n\n <path\n d=\"M 45 0 C 20.187 0 0 20.187 0 45 c 0 24.813 20.187 45 45 45 c 24.813 0 45 -20.187 45 -45 C 90 20.187 69.813 0 45 0 z M 74.821 70.096 c -3.543 -5.253 -8.457 -9.568 -14.159 -12.333 c -2.261 -1.096 -4.901 -1.08 -7.247 0.047 c -2.638 1.268 -5.47 1.91 -8.415 1.91 c -2.945 0 -5.776 -0.643 -8.415 -1.91 c -2.343 -1.125 -4.984 -1.143 -7.247 -0.047 c -5.702 2.765 -10.616 7.08 -14.16 12.333 C 9.457 63.308 6 54.552 6 45 C 6 23.495 23.495 6 45 6 s 39 17.495 39 39 C 84 54.552 80.543 63.308 74.821 70.096 z\"\n stroke=\"none\"\n strokeWidth=\"1\"\n strokeDasharray=\"none\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"miter\"\n strokeMiterlimit=\"10\"\n fill=\"currentColor\"\n fillRule=\"nonzero\"\n opacity=\"1\"\n transform=\" matrix(1 0 0 1 0 0) \"\n />\n </g>\n </svg>\n);\n"],"names":["ProfileLogo","svg","className","xmlns","version","width","height","viewBox","g","stroke","strokeWidth","strokeDasharray","strokeLinecap","strokeLinejoin","strokeMiterlimit","fill","fillRule","opacity","transform","path","d"],"mappings":";AAEA,OAAO,MAAMA,cAAkB,kBAC3B,KAACC;QACGC,WAAU;QACVC,OAAM;QACNC,SAAQ;QACRC,OAAM;QACNC,QAAO;QACPC,SAAQ;kBAER,cAAA,MAACC;YACGC,QAAO;YACPC,aAAY;YACZC,iBAAgB;YAChBC,eAAc;YACdC,gBAAe;YACfC,kBAAiB;YACjBC,MAAK;YACLC,UAAS;YACTC,SAAQ;YACRC,WAAU;;8BAEV,KAACC;oBACGC,GAAE;oBACFX,QAAO;oBACPC,aAAY;oBACZC,iBAAgB;oBAChBC,eAAc;oBACdC,gBAAe;oBACfC,kBAAiB;oBACjB,sBAAsB;oBACtBE,UAAS;oBACTC,SAAQ;oBACRC,WAAU;;8BAGd,KAACC;oBACGC,GAAE;oBACFX,QAAO;oBACPC,aAAY;oBACZC,iBAAgB;oBAChBC,eAAc;oBACdC,gBAAe;oBACfC,kBAAiB;oBACjBC,MAAK;oBACLC,UAAS;oBACTC,SAAQ;oBACRC,WAAU;;;;OAIxB"}
@@ -1,6 +1,6 @@
1
1
  export * from './titan-layout';
2
2
  export * from './layout-profile';
3
3
  export * from './layout-context';
4
- export * from './layout-logo';
5
- export * from './interface';
4
+ export type { TitanLayoutLogoProps } from './layout-logo';
5
+ export type * from './interface';
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/titan-layout/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/titan-layout/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,YAAY,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1D,mBAAmB,aAAa,CAAC"}
@@ -1,6 +1,5 @@
1
1
  export * from './titan-layout';
2
2
  export * from './layout-profile';
3
3
  export * from './layout-context';
4
- export * from './layout-logo';
5
- export * from './interface';
4
+
6
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/titan-layout/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"sources":["../../../src/components/titan-layout/index.ts"],"sourcesContent":["export * from './titan-layout';\nexport * from './layout-profile';\nexport * from './layout-context';\nexport type { TitanLayoutLogoProps } from './layout-logo';\nexport type * from './interface';\n"],"names":[],"mappings":"AAAA,cAAc,iBAAiB;AAC/B,cAAc,mBAAmB;AACjC,cAAc,mBAAmB"}
@@ -1,2 +1,3 @@
1
- export {};
1
+ export { };
2
+
2
3
  //# sourceMappingURL=interface-internal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"interface-internal.js","sourceRoot":"","sources":["../../../src/components/titan-layout/interface-internal.ts"],"names":[],"mappings":""}
1
+ {"version":3,"sources":["../../../src/components/titan-layout/interface-internal.ts"],"sourcesContent":["import { FC } from 'react';\nimport { NavLinkComponentProps } from '../../utils/navigation-context';\n\nexport interface NavigationComponentProps {\n navigationComponent: FC<NavLinkComponentProps>;\n}\n"],"names":[],"mappings":"AAGA,WAEC"}
@@ -1,2 +1,3 @@
1
- export {};
1
+ export { };
2
+
2
3
  //# sourceMappingURL=interface.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../src/components/titan-layout/interface.ts"],"names":[],"mappings":""}
1
+ {"version":3,"sources":["../../../src/components/titan-layout/interface.ts"],"sourcesContent":["import { FC, ReactElement } from 'react';\nimport { NavigationItemData } from '../../utils/navigation';\nimport { TitanLayoutSidebarContextType } from './layout-context';\n\nexport interface TitanLayoutSidebarLinkWrapperProps {\n children:\n | ReactElement<TitanLayoutSidebarLinkProps>\n | ReactElement<TitanLayoutSidebarTriggerProps>;\n context: TitanLayoutSidebarContextType;\n}\n\nexport interface TitanLayoutSidebarLinkProps extends Omit<NavigationItemData, 'submenu'> {\n wrapper?: FC<TitanLayoutSidebarLinkWrapperProps>;\n}\nexport interface TitanLayoutSidebarTriggerProps\n extends Omit<TitanLayoutSidebarLinkProps, 'to' | 'isActive'> {\n isActive?: boolean;\n wrapper?: FC<TitanLayoutSidebarLinkWrapperProps>;\n onClick?: () => void;\n onMobileClick?: () => void;\n}\n\nexport interface TitanLayoutState {\n navCollapsed: boolean;\n submenuExpanded?: string;\n}\n"],"names":[],"mappings":"AAsBA,WAGC"}
@@ -1,12 +1,21 @@
1
1
  import { createContext, useContext } from 'react';
2
2
  import { DefaultNavLinkComponent } from '../../utils/navigation-context';
3
- export const LayoutContext = createContext({
3
+ export const LayoutContext = /*#__PURE__*/ createContext({
4
4
  NavigationComponent: DefaultNavLinkComponent,
5
- breakpoint: { name: 'lg', isMobile: false, width: 0 },
5
+ breakpoint: {
6
+ name: 'lg',
7
+ isMobile: false,
8
+ width: 0
9
+ },
6
10
  isTitanLayout: false,
7
- sidebar: { styles: { popoverContent: {} } },
11
+ sidebar: {
12
+ styles: {
13
+ popoverContent: {}
14
+ }
15
+ }
8
16
  });
9
- export const useTitanLayoutContext = () => useContext(LayoutContext);
10
- export const LayoutPlacementContext = createContext(undefined);
11
- export const useTitanLayoutPlacementContext = () => useContext(LayoutPlacementContext);
17
+ export const useTitanLayoutContext = ()=>useContext(LayoutContext);
18
+ export const LayoutPlacementContext = /*#__PURE__*/ createContext(undefined);
19
+ export const useTitanLayoutPlacementContext = ()=>useContext(LayoutPlacementContext);
20
+
12
21
  //# sourceMappingURL=layout-context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layout-context.js","sourceRoot":"","sources":["../../../src/components/titan-layout/layout-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAyB,MAAM,gCAAgC,CAAC;AAkBhG,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAyB;IAC/D,mBAAmB,EAAE,uBAAuB;IAC5C,UAAU,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE;IACrD,aAAa,EAAE,KAAK;IACpB,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,EAAE;CAC9C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAErE,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAa,CAAmC,SAAS,CAAC,CAAC;AACjG,MAAM,CAAC,MAAM,8BAA8B,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAC"}
1
+ {"version":3,"sources":["../../../src/components/titan-layout/layout-context.tsx"],"sourcesContent":["import { CSSProperties, FC, createContext, useContext } from 'react';\nimport { DefaultNavLinkComponent, NavLinkComponentProps } from '../../utils/navigation-context';\nimport { TitanBreakpoint } from '../../utils/use-breakpoint';\n\nexport interface TitanLayoutSidebarContextType {\n styles: {\n popoverContent: CSSProperties;\n };\n}\n\nexport type TitanLayoutPlacement = 'top' | 'side' | 'unset';\n\nexport interface TitanLayoutContextType {\n NavigationComponent: FC<NavLinkComponentProps>;\n breakpoint: TitanBreakpoint;\n isTitanLayout: boolean;\n sidebar: TitanLayoutSidebarContextType;\n}\n\nexport const LayoutContext = createContext<TitanLayoutContextType>({\n NavigationComponent: DefaultNavLinkComponent,\n breakpoint: { name: 'lg', isMobile: false, width: 0 },\n isTitanLayout: false,\n sidebar: { styles: { popoverContent: {} } },\n});\n\nexport const useTitanLayoutContext = () => useContext(LayoutContext);\n\nexport const LayoutPlacementContext = createContext<TitanLayoutPlacement | undefined>(undefined);\nexport const useTitanLayoutPlacementContext = () => useContext(LayoutPlacementContext);\n"],"names":["createContext","useContext","DefaultNavLinkComponent","LayoutContext","NavigationComponent","breakpoint","name","isMobile","width","isTitanLayout","sidebar","styles","popoverContent","useTitanLayoutContext","LayoutPlacementContext","undefined","useTitanLayoutPlacementContext"],"mappings":"AAAA,SAA4BA,aAAa,EAAEC,UAAU,QAAQ,QAAQ;AACrE,SAASC,uBAAuB,QAA+B,iCAAiC;AAkBhG,OAAO,MAAMC,8BAAgBH,cAAsC;IAC/DI,qBAAqBF;IACrBG,YAAY;QAAEC,MAAM;QAAMC,UAAU;QAAOC,OAAO;IAAE;IACpDC,eAAe;IACfC,SAAS;QAAEC,QAAQ;YAAEC,gBAAgB,CAAC;QAAE;IAAE;AAC9C,GAAG;AAEH,OAAO,MAAMC,wBAAwB,IAAMZ,WAAWE,eAAe;AAErE,OAAO,MAAMW,uCAAyBd,cAAgDe,WAAW;AACjG,OAAO,MAAMC,iCAAiC,IAAMf,WAAWa,wBAAwB"}
@@ -0,0 +1,10 @@
1
+ import { FC } from 'react';
2
+ import { NavigationItemData } from '../../utils/navigation';
3
+ import { LayoutHeaderProps } from './layout-header';
4
+ interface LayoutHeaderStackedProps extends Omit<LayoutHeaderProps, 'variant'> {
5
+ navigationMainItems?: NavigationItemData[];
6
+ navigationOverflowItems?: NavigationItemData[];
7
+ }
8
+ export declare const LayoutHeaderDark: FC<LayoutHeaderStackedProps>;
9
+ export {};
10
+ //# sourceMappingURL=layout-header-dark.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout-header-dark.d.ts","sourceRoot":"","sources":["../../../src/components/titan-layout/layout-header-dark.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,EAAE,EAA4C,MAAM,OAAO,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAgB,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAkBlE,UAAU,wBAAyB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,SAAS,CAAC;IACzE,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC3C,uBAAuB,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAClD;AAED,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,wBAAwB,CAqEzD,CAAC"}