@servicetitan/navigation 2.0.0 → 2.1.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/dist/components/header-navigation/header-navigation-content.d.ts +30 -0
- package/dist/components/header-navigation/header-navigation-content.d.ts.map +1 -0
- package/dist/components/header-navigation/header-navigation-content.js +21 -0
- package/dist/components/header-navigation/header-navigation-content.js.map +1 -0
- package/dist/components/header-navigation/header-navigation-extra.stories.d.ts +1 -1
- package/dist/components/header-navigation/header-navigation-extra.stories.d.ts.map +1 -1
- package/dist/components/header-navigation/header-navigation-extra.stories.js +6 -6
- package/dist/components/header-navigation/header-navigation-extra.stories.js.map +1 -1
- package/dist/components/header-navigation/header-navigation-links.d.ts +38 -0
- package/dist/components/header-navigation/header-navigation-links.d.ts.map +1 -0
- package/dist/components/header-navigation/header-navigation-links.js +38 -0
- package/dist/components/header-navigation/header-navigation-links.js.map +1 -0
- package/dist/components/header-navigation/header-navigation-stacked.stories.d.ts +11 -0
- package/dist/components/header-navigation/header-navigation-stacked.stories.d.ts.map +1 -0
- package/dist/components/header-navigation/header-navigation-stacked.stories.js +66 -0
- package/dist/components/header-navigation/header-navigation-stacked.stories.js.map +1 -0
- package/dist/components/header-navigation/header-navigation.d.ts +32 -55
- package/dist/components/header-navigation/header-navigation.d.ts.map +1 -1
- package/dist/components/header-navigation/header-navigation.js +41 -48
- package/dist/components/header-navigation/header-navigation.js.map +1 -1
- package/dist/components/header-navigation/header-navigation.module.less +172 -95
- package/dist/components/header-navigation/header-navigation.stories.d.ts.map +1 -1
- package/dist/components/header-navigation/header-navigation.stories.js +7 -7
- package/dist/components/header-navigation/header-navigation.stories.js.map +1 -1
- package/dist/components/header-navigation/index.d.ts +3 -0
- package/dist/components/header-navigation/index.d.ts.map +1 -0
- package/dist/components/header-navigation/index.js +3 -0
- package/dist/components/header-navigation/index.js.map +1 -0
- package/dist/components/logo/logo-titan-text.d.ts +21 -5
- package/dist/components/logo/logo-titan-text.d.ts.map +1 -1
- package/dist/components/logo/logo-titan-text.js +9 -3
- package/dist/components/logo/logo-titan-text.js.map +1 -1
- package/dist/components/logo/logo-titan-text.module.less +12 -9
- package/dist/components/logo/logo-titan.d.ts +2 -2
- package/dist/components/logo/logo-titan.d.ts.map +1 -1
- package/dist/components/logo/logo-titan.js +1 -1
- package/dist/components/logo/logo-titan.js.map +1 -1
- package/dist/components/logo/logo.stories.d.ts +2 -1
- package/dist/components/logo/logo.stories.d.ts.map +1 -1
- package/dist/components/logo/logo.stories.js +7 -5
- package/dist/components/logo/logo.stories.js.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.d.ts +15 -0
- package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.d.ts.map +1 -0
- package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.js +51 -0
- package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.js.map +1 -0
- package/dist/components/profile-dropdown/profile-dropdown.d.ts +1 -0
- package/dist/components/profile-dropdown/profile-dropdown.d.ts.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown.js +3 -3
- package/dist/components/profile-dropdown/profile-dropdown.js.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown.module.less +0 -2
- package/dist/components/profile-dropdown/profile-dropdown.stories.js +1 -1
- package/dist/components/profile-dropdown/profile-dropdown.stories.js.map +1 -1
- package/dist/components/profile-dropdown/profile-icon.d.ts +1 -1
- package/dist/components/profile-dropdown/profile-icon.d.ts.map +1 -1
- package/dist/components/profile-dropdown/profile-icon.js +1 -1
- package/dist/components/profile-dropdown/profile-icon.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/with-tooltip.d.ts +3 -0
- package/dist/utils/with-tooltip.d.ts.map +1 -0
- package/dist/utils/with-tooltip.js +4 -0
- package/dist/utils/with-tooltip.js.map +1 -0
- package/package.json +2 -2
- package/src/components/header-navigation/header-navigation-content.tsx +118 -0
- package/src/components/header-navigation/header-navigation-extra.stories.tsx +12 -12
- package/src/components/header-navigation/header-navigation-links.tsx +143 -0
- package/src/components/header-navigation/header-navigation-stacked.stories.tsx +172 -0
- package/src/components/header-navigation/header-navigation.module.less +172 -95
- package/src/components/header-navigation/header-navigation.module.less.d.ts +14 -9
- package/src/components/header-navigation/header-navigation.stories.tsx +11 -17
- package/src/components/header-navigation/header-navigation.tsx +151 -266
- package/src/components/header-navigation/index.ts +2 -0
- package/src/components/logo/logo-titan-text.module.less +12 -9
- package/src/components/logo/logo-titan-text.tsx +62 -20
- package/src/components/logo/logo-titan.tsx +2 -2
- package/src/components/logo/logo.stories.tsx +13 -4
- package/src/components/profile-dropdown/profile-dropdown-stacked.stories.tsx +178 -0
- package/src/components/profile-dropdown/profile-dropdown.module.less +0 -2
- package/src/components/profile-dropdown/profile-dropdown.stories.tsx +1 -1
- package/src/components/profile-dropdown/profile-dropdown.tsx +5 -3
- package/src/components/profile-dropdown/profile-icon.tsx +2 -1
- package/src/index.ts +2 -1
- package/src/utils/with-tooltip.tsx +11 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logo.stories.d.ts","sourceRoot":"","sources":["../../../src/components/logo/logo.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logo.stories.d.ts","sourceRoot":"","sources":["../../../src/components/logo/logo.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAa,MAAM,OAAO,CAAC;;;;;;AAKtC,wBAIE;AAEF,eAAO,MAAM,SAAS,+CAAyB,CAAC;AAChD,eAAO,MAAM,mBAAmB,+CAA8C,CAAC;AAC/E,eAAO,MAAM,gBAAgB,+CAA6B,CAAC;AAC3D,eAAO,MAAM,aAAa,+CAOzB,CAAC;AAcF,eAAO,MAAM,qBAAqB,+CAQjC,CAAC;AAEF,eAAO,MAAM,iBAAiB,+CAM7B,CAAC"}
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Stack, Tag } from '@servicetitan/design-system';
|
|
2
3
|
import { LogoCompanyTitle } from './logo-company-title';
|
|
3
|
-
import {
|
|
4
|
-
import { LogoTitanText } from './logo-titan-text';
|
|
4
|
+
import { LogoTitanSvg } from './logo-titan';
|
|
5
|
+
import { LogoTitan, LogoTitanText, LogoTitanTitle } from './logo-titan-text';
|
|
5
6
|
export default {
|
|
6
7
|
title: 'Navigation/Logo',
|
|
7
8
|
component: LogoTitan,
|
|
8
9
|
parameters: {},
|
|
9
10
|
};
|
|
10
|
-
export const logoTitan = () => _jsx(
|
|
11
|
-
export const logoTitanBlueMantle = () => _jsx(
|
|
11
|
+
export const logoTitan = () => _jsx(LogoTitanSvg, {});
|
|
12
|
+
export const logoTitanBlueMantle = () => _jsx(LogoTitanSvg, { mantleFill: "#2270EE" });
|
|
12
13
|
export const logoCompanyTitle = () => _jsx(LogoCompanyTitle, {});
|
|
13
14
|
export const logoTitanText = () => (_jsx(LogoTitanText, { className: "bg-neutral-300 border", mantleFill: "#2270EE", title: "Widgets", description: "tenant tenant tenant tenant tenant" }));
|
|
14
15
|
const NavLinkMock = ({ className, children }) => (_jsx("a", { href: "/", onClick: e => {
|
|
15
16
|
e.preventDefault();
|
|
16
17
|
}, className: className, children: children }));
|
|
17
18
|
export const logoTitanTextWithLink = () => (_jsx(LogoTitanText, { className: "bg-neutral-300 border", mantleFill: "#2270EE", title: "Commercial", description: "tenant tenant tenant tenant tenant", logoWrapper: NavLinkMock }));
|
|
19
|
+
export const logoTitanWithText = () => (_jsxs(Stack, { className: "border bg-neutral-300", alignItems: "center", children: [_jsx(LogoTitan, { className: "border-left m-r-1", mantleFill: "#2270EE" }), _jsx(LogoTitanTitle, { className: "m-x-1 p-b-half c-white", children: "Contact Center" }), _jsx(Tag, { color: "info", children: "pro" })] }));
|
|
18
20
|
//# sourceMappingURL=logo.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logo.stories.js","sourceRoot":"","sources":["../../../src/components/logo/logo.stories.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"logo.stories.js","sourceRoot":"","sources":["../../../src/components/logo/logo.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,6BAA6B,CAAC;AAEzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE7E,eAAe;IACX,KAAK,EAAE,iBAAiB;IACxB,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE,EAAE;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,KAAC,YAAY,KAAG,CAAC;AAChD,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE,CAAC,KAAC,YAAY,IAAC,UAAU,EAAC,SAAS,GAAG,CAAC;AAC/E,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,KAAC,gBAAgB,KAAG,CAAC;AAC3D,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,CAC/B,KAAC,aAAa,IACV,SAAS,EAAC,uBAAuB,EACjC,UAAU,EAAC,SAAS,EACpB,KAAK,EAAC,SAAS,EACf,WAAW,EAAC,oCAAoC,GAClD,CACL,CAAC;AAEF,MAAM,WAAW,GAAmD,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAC7F,YACI,IAAI,EAAC,GAAG,EACR,OAAO,EAAE,CAAC,CAAC,EAAE;QACT,CAAC,CAAC,cAAc,EAAE,CAAC;IACvB,CAAC,EACD,SAAS,EAAE,SAAS,YAEnB,QAAQ,GACT,CACP,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE,CAAC,CACvC,KAAC,aAAa,IACV,SAAS,EAAC,uBAAuB,EACjC,UAAU,EAAC,SAAS,EACpB,KAAK,EAAC,YAAY,EAClB,WAAW,EAAC,oCAAoC,EAChD,WAAW,EAAE,WAAW,GAC1B,CACL,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC,CACnC,MAAC,KAAK,IAAC,SAAS,EAAC,uBAAuB,EAAC,UAAU,EAAC,QAAQ,aACxD,KAAC,SAAS,IAAC,SAAS,EAAC,mBAAmB,EAAC,UAAU,EAAC,SAAS,GAAG,EAChE,KAAC,cAAc,IAAC,SAAS,EAAC,wBAAwB,+BAAgC,EAClF,KAAC,GAAG,IAAC,KAAK,EAAC,MAAM,oBAAU,IACvB,CACX,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
title: string;
|
|
3
|
+
component: import("./profile-dropdown").ProfileDropdownType;
|
|
4
|
+
parameters: {};
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
7
|
+
export declare const profileDropdownDefault: () => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const profileDropdownWithLogo: () => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const profileDropdownWithErrorLogo: () => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const profileDropdownWithInfo: () => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const profileDropdownWithCounter: () => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const profileDropdownWithBothBadges: () => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const profileDropdownWithHintPopup: () => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const profileDropdownWithHintAndInfoPopup: () => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=profile-dropdown-stacked.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-dropdown-stacked.stories.d.ts","sourceRoot":"","sources":["../../../src/components/profile-dropdown/profile-dropdown-stacked.stories.tsx"],"names":[],"mappings":";;;;;AAMA,wBAIE;AAeF,eAAO,MAAM,sBAAsB,+CAuBlC,CAAC;AAEF,eAAO,MAAM,uBAAuB,+CAmBnC,CAAC;AAEF,eAAO,MAAM,4BAA4B,+CAUxC,CAAC;AAEF,eAAO,MAAM,uBAAuB,+CAWnC,CAAC;AAEF,eAAO,MAAM,0BAA0B,+CAYtC,CAAC;AAEF,eAAO,MAAM,6BAA6B,+CAWzC,CAAC;AAKF,eAAO,MAAM,4BAA4B,+CAiCxC,CAAC;AAEF,eAAO,MAAM,mCAAmC,+CAgB/C,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from '@servicetitan/design-system';
|
|
3
|
+
import { HeaderNavigationStacked } from '../header-navigation';
|
|
4
|
+
import { ProfileDropdown } from './profile-dropdown';
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Navigation/ProfileDropdownStacked',
|
|
7
|
+
component: ProfileDropdown,
|
|
8
|
+
parameters: {},
|
|
9
|
+
};
|
|
10
|
+
const NavLinkMock = props => (_jsx("a", { href: props.to, target: props.target, onClick: e => {
|
|
11
|
+
e.preventDefault();
|
|
12
|
+
}, className: props.className, children: props.children }));
|
|
13
|
+
export const profileDropdownDefault = () => (_jsx(HeaderNavigationStacked, { navigationComponent: NavLinkMock, right: _jsxs(ProfileDropdown, { children: [_jsx(ProfileDropdown.Link, { id: "first", to: "https://google.com", children: "first link" }), _jsx(ProfileDropdown.Link, { id: "second", onClick: () => alert('second click'), children: "second link" }), _jsx(ProfileDropdown.Divider, {}), _jsx(ProfileDropdown.Section, { id: "content", children: "some content" }), _jsx(ProfileDropdown.Divider, {}), _jsx(ProfileDropdown.Divider, {}), _jsx(ProfileDropdown.Divider, {}), _jsx(ProfileDropdown.Link, { id: "third", to: "https://google.com", children: "third link" }), _jsx(ProfileDropdown.Divider, {})] }) }));
|
|
14
|
+
export const profileDropdownWithLogo = () => (_jsx(HeaderNavigationStacked, { navigationComponent: NavLinkMock, right: _jsxs(ProfileDropdown, { trigger: {
|
|
15
|
+
imageSrc: 'https://upload.wikimedia.org/wikipedia/en/1/11/Milhouse_Van_Houten.png',
|
|
16
|
+
}, children: [_jsx(ProfileDropdown.Link, { id: "first", to: "https://google.com", children: "first link" }), _jsx(ProfileDropdown.Link, { id: "second", onClick: () => alert('second click'), children: "second link" })] }) }));
|
|
17
|
+
export const profileDropdownWithErrorLogo = () => (_jsx(HeaderNavigationStacked, { right: _jsx(ProfileDropdown, { trigger: {
|
|
18
|
+
imageSrc: 'https://some.incorrect.url/logo.png',
|
|
19
|
+
} }) }));
|
|
20
|
+
export const profileDropdownWithInfo = () => (_jsx(HeaderNavigationStacked, { right: _jsx(ProfileDropdown, { trigger: {
|
|
21
|
+
info: { text: 'first', title: 'tenant user' },
|
|
22
|
+
avatarBadge: true,
|
|
23
|
+
} }) }));
|
|
24
|
+
export const profileDropdownWithCounter = () => (_jsx(HeaderNavigationStacked, { right: _jsx(ProfileDropdown, { trigger: {
|
|
25
|
+
info: { text: 'first', title: 'tenant user' },
|
|
26
|
+
avatarBadge: true,
|
|
27
|
+
badge: { content: 3, className: 'bg-red-500' },
|
|
28
|
+
} }) }));
|
|
29
|
+
export const profileDropdownWithBothBadges = () => (_jsx(HeaderNavigationStacked, { right: _jsx(ProfileDropdown, { trigger: {
|
|
30
|
+
avatarBadge: 'yellow-500',
|
|
31
|
+
badge: { className: 'bg-red-400' },
|
|
32
|
+
} }) }));
|
|
33
|
+
// eslint-disable-next-line no-console
|
|
34
|
+
const log = (text) => console.log(text);
|
|
35
|
+
export const profileDropdownWithHintPopup = () => (_jsx(HeaderNavigationStacked, { navigationComponent: NavLinkMock, right: _jsxs(ProfileDropdown, { trigger: {
|
|
36
|
+
avatarBadge: 'yellow-500',
|
|
37
|
+
badge: { className: 'bg-red-400' },
|
|
38
|
+
}, hintPopup: {
|
|
39
|
+
className: 'bg-blue-500-i c-white',
|
|
40
|
+
content: ({ openProfile }) => (_jsxs("div", { children: ["hello", ' ', _jsx(Button, { onClick: openProfile, size: "xsmall", children: "show me" })] })),
|
|
41
|
+
width: 's',
|
|
42
|
+
onClose: () => log('close profile dropdown hint'),
|
|
43
|
+
}, onOpen: () => log('open profile dropdown'), onClose: () => log('close profile dropdown'), children: [_jsx(ProfileDropdown.Link, { id: "first", to: "https://google.com", children: "first item" }), _jsx(ProfileDropdown.Divider, {}), _jsx(ProfileDropdown.Section, { id: "second", children: "second item" })] }) }));
|
|
44
|
+
export const profileDropdownWithHintAndInfoPopup = () => (_jsx(HeaderNavigationStacked, { navigationComponent: NavLinkMock, right: _jsx(ProfileDropdown, { trigger: {
|
|
45
|
+
avatarBadge: 'yellow-500',
|
|
46
|
+
badge: { className: 'bg-red-400' },
|
|
47
|
+
info: { title: 'some text', text: 'qq' },
|
|
48
|
+
}, hintPopup: {
|
|
49
|
+
content: () => _jsx("div", { children: "hello" }),
|
|
50
|
+
} }) }));
|
|
51
|
+
//# sourceMappingURL=profile-dropdown-stacked.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-dropdown-stacked.stories.js","sourceRoot":"","sources":["../../../src/components/profile-dropdown/profile-dropdown-stacked.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAGrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,eAAe;IACX,KAAK,EAAE,mCAAmC;IAC1C,SAAS,EAAE,eAAe;IAC1B,UAAU,EAAE,EAAE;CACjB,CAAC;AAE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AC,kCAAgB;SAClC,GACH,GAER,CACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-dropdown.d.ts","sourceRoot":"","sources":["../../../src/components/profile-dropdown/profile-dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA2B,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAE1F,OAAO,EACH,EAAE,EACF,yBAAyB,EACzB,UAAU,EAEV,SAAS,EAKZ,MAAM,OAAO,CAAC;AAGf,OAAO,EAAc,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIjE,MAAM,WAAW,2BAA2B;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC/B,KAAK,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IACzD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;CACjC;
|
|
1
|
+
{"version":3,"file":"profile-dropdown.d.ts","sourceRoot":"","sources":["../../../src/components/profile-dropdown/profile-dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA2B,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAE1F,OAAO,EACH,EAAE,EACF,yBAAyB,EACzB,UAAU,EAEV,SAAS,EAKZ,MAAM,OAAO,CAAC;AAGf,OAAO,EAAc,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIjE,MAAM,WAAW,2BAA2B;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE;QAAE,KAAK,E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O,MAAM,mBAAmB,EAAE,EAAE,CAAC,wBAAwB,CA6D5D,CAAC;AAEF,MAAM,WAAW,0BAA0B;IACvC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAC5C,OAAO,CAAC,EAAE,IAAI,CAAC,2BAA2B,EAAE,SAAS,GAAG,WAAW,CAAC,CAAC;IACrE,SAAS,CAAC,EAAE;QACR,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,EAAE,CAAC;YAAE,WAAW,IAAI,IAAI,CAAA;SAAE,CAAC,CAAC;QACrC,KAAK,CAAC,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;QACpC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;KACxB,CAAC;IACF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACpC,OAAO,CAAC,IAAI,IAAI,CAAC;IACjB,MAAM,CAAC,IAAI,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,oBAAqB,SAAQ,0BAA0B;IACpE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;AAED,MAAM,WAAW,mBAAoB,SAAQ,EAAE,CAAC,oBAAoB,CAAC;IACjE,OAAO,EAAE,OAAO,sBAAsB,CAAC;IACvC,IAAI,EAAE,OAAO,mBAAmB,CAAC;IACjC,OAAO,EAAE,OAAO,sBAAsB,CAAC;CAC1C;AAED,eAAO,MAAM,eAAe,EAAE,mBAoFL,CAAC"}
|
|
@@ -17,7 +17,7 @@ import { useNavLink } from '../../utils/navigation-context';
|
|
|
17
17
|
import { CounterTag } from '../counter-tag';
|
|
18
18
|
import * as Styles from './profile-dropdown.module.less';
|
|
19
19
|
import { ProfileLogo } from './profile-icon';
|
|
20
|
-
const ProfileDropdownTrigger = ({ avatarBadge, badge, className, hintArrow, imageSrc, info, onClick, }) => {
|
|
20
|
+
const ProfileDropdownTrigger = ({ avatarBadge, badge, className, hintArrow, imageSrc, info, onClick, size, }) => {
|
|
21
21
|
const [avatarSource, setAvatarSource] = useState(imageSrc !== null && imageSrc !== void 0 ? imageSrc : '');
|
|
22
22
|
const [avatarSourceError, setAvatarSourceError] = useState(false);
|
|
23
23
|
useEffect(() => {
|
|
@@ -31,7 +31,7 @@ const ProfileDropdownTrigger = ({ avatarBadge, badge, className, hintArrow, imag
|
|
|
31
31
|
const onAvatarError = useCallback(() => {
|
|
32
32
|
setAvatarSourceError(true);
|
|
33
33
|
}, []);
|
|
34
|
-
return (_jsxs("div", { className: classNames('d-f align-items-center cursor-pointer position-relative p-x-1 p-y-half', Styles.triggerContainer, { [Styles.triggerContainerHintArrow]: hintArrow }, className), onClick: onClick, "data-cy": "profile-dropdown-trigger", "data-pendo": "profile-dropdown-trigger", children: [avatarSource && !avatarSourceError ? (_jsx("img", { src: avatarSource, className: Styles.profileImage, onError: onAvatarError, alt: "user dropdown menu" })) : (_jsx(ProfileLogo, { size:
|
|
34
|
+
return (_jsxs("div", { className: classNames('d-f align-items-center cursor-pointer position-relative p-x-1 p-y-half', Styles.triggerContainer, { [Styles.triggerContainerHintArrow]: hintArrow }, 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" })) : (_jsx(ProfileLogo, { size: size })), !!info && (_jsxs("div", { className: Styles.info, children: [_jsx(BodyText, { bold: true, title: info.title, className: "t-truncate c-white", 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, { className: "m-l-half", name: "expand_more", size: 12 }), !!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 }))] }));
|
|
35
35
|
};
|
|
36
36
|
export const ProfileDropdownSection = (_a) => {
|
|
37
37
|
var { children, className, id, onClick } = _a, rest = __rest(_a, ["children", "className", "id", "onClick"]);
|
|
@@ -81,7 +81,7 @@ export const ProfileDropdown = (({ children, className, direction, hintPopup, on
|
|
|
81
81
|
const hintShown = !!hintPopup && !open;
|
|
82
82
|
const HintComponent = hintPopup === null || hintPopup === void 0 ? void 0 : hintPopup.content;
|
|
83
83
|
const triggerElement = (_jsx(ProfileDropdownTrigger, Object.assign({}, trigger, { onClick: children ? onTriggerClick : undefined, hintArrow: hintShown })));
|
|
84
|
-
return (_jsx("div", { className:
|
|
84
|
+
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 }) })) }));
|
|
85
85
|
});
|
|
86
86
|
ProfileDropdown.Divider = ProfileDropdownDivider;
|
|
87
87
|
ProfileDropdown.Link = ProfileDropdownLink;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-dropdown.js","sourceRoot":"","sources":["../../../src/components/profile-dropdown/profile-dropdown.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAsB,MAAM,6BAA6B,CAAC;AAC1F,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAMH,WAAW,EACX,SAAS,EACT,OAAO,EACP,QAAQ,GACX,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAuB,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"profile-dropdown.js","sourceRoot":"","sources":["../../../src/components/profile-dropdown/profile-dropdown.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAsB,MAAM,6BAA6B,CAAC;AAC1F,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAMH,WAAW,EACX,SAAS,EACT,OAAO,EACP,QAAQ,GACX,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAuB,MAAM,gBAAgB,CAAC;AACjE,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,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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,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button } from '@servicetitan/design-system';
|
|
3
|
-
import { HeaderNavigation } from '../header-navigation
|
|
3
|
+
import { HeaderNavigation } from '../header-navigation';
|
|
4
4
|
import { ProfileDropdown } from './profile-dropdown';
|
|
5
5
|
export default {
|
|
6
6
|
title: 'Navigation/ProfileDropdown',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-dropdown.stories.js","sourceRoot":"","sources":["../../../src/components/profile-dropdown/profile-dropdown.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAGrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"profile-dropdown.stories.js","sourceRoot":"","sources":["../../../src/components/profile-dropdown/profile-dropdown.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAGrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,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E;YACP,OAAO,EAAE,GAAG,EAAE,CAAC,kCAAgB;SAClC,GACH,GACa,CACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-icon.d.ts","sourceRoot":"","sources":["../../../src/components/profile-dropdown/profile-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAE3B,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"profile-icon.d.ts","sourceRoot":"","sources":["../../../src/components/profile-dropdown/profile-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAE3B,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAkD7C,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
export const ProfileLogo = ({ size }) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", version: "1.1", width: size, height: size, 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", fill: "rgb(255,255,255)", 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: "rgb(255,255,255)", fillRule: "nonzero", opacity: "1", transform: " matrix(1 0 0 1 0 0) " })] }) }));
|
|
2
|
+
export const ProfileLogo = ({ size }) => (_jsx("svg", { className: "profile-dropdown-svg", xmlns: "http://www.w3.org/2000/svg", version: "1.1", width: size, height: size, 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", fill: "rgb(255,255,255)", 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: "rgb(255,255,255)", fillRule: "nonzero", opacity: "1", transform: " matrix(1 0 0 1 0 0) " })] }) }));
|
|
3
3
|
//# 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,
|
|
1
|
+
{"version":3,"file":"profile-icon.js","sourceRoot":"","sources":["../../../src/components/profile-dropdown/profile-icon.tsx"],"names":[],"mappings":";AAEA,MAAM,CAAC,MAAM,WAAW,GAA0B,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAC5D,cACI,SAAS,EAAC,sBAAsB,EAChC,KAAK,EAAC,4BAA4B,EAClC,OAAO,EAAC,KAAK,EACb,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,IAAI,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,EACrB,IAAI,EAAC,kBAAkB,EACvB,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,kBAAkB,EACvB,QAAQ,EAAC,SAAS,EAClB,OAAO,EAAC,GAAG,EACX,SAAS,EAAC,uBAAuB,GACnC,IACF,GACF,CACT,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export * from './components/header-navigation
|
|
1
|
+
export * from './components/header-navigation';
|
|
2
2
|
export * from './components/profile-dropdown/profile-dropdown';
|
|
3
3
|
export * from './components/logo/logo-company-title';
|
|
4
4
|
export * from './components/logo/logo-titan';
|
|
5
5
|
export * from './components/logo/logo-titan-text';
|
|
6
6
|
export * from './components/counter-tag';
|
|
7
7
|
export * from './utils/navigation';
|
|
8
|
+
export * from './utils/with-tooltip';
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gDAAgD,CAAC;AAC/D,cAAc,sCAAsC,CAAC;AACrD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export * from './components/header-navigation
|
|
1
|
+
export * from './components/header-navigation';
|
|
2
2
|
export * from './components/profile-dropdown/profile-dropdown';
|
|
3
3
|
export * from './components/logo/logo-company-title';
|
|
4
4
|
export * from './components/logo/logo-titan';
|
|
5
5
|
export * from './components/logo/logo-titan-text';
|
|
6
6
|
export * from './components/counter-tag';
|
|
7
7
|
export * from './utils/navigation';
|
|
8
|
+
export * from './utils/with-tooltip';
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gDAAgD,CAAC;AAC/D,cAAc,sCAAsC,CAAC;AACrD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-tooltip.d.ts","sourceRoot":"","sources":["../../src/utils/with-tooltip.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,eAAO,MAAM,WAAW,YAAa,SAAS,YAAY,MAAM,iHAO3D,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Tooltip } from '@servicetitan/design-system';
|
|
3
|
+
export const withTooltip = (element, tooltip) => tooltip ? (_jsx(Tooltip, { el: "div", direction: "b", text: tooltip, children: element })) : (element);
|
|
4
|
+
//# sourceMappingURL=with-tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-tooltip.js","sourceRoot":"","sources":["../../src/utils/with-tooltip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAGtD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,OAAkB,EAAE,OAAgB,EAAE,EAAE,CAChE,OAAO,CAAC,CAAC,CAAC,CACN,KAAC,OAAO,IAAC,EAAE,EAAC,KAAK,EAAC,SAAS,EAAC,GAAG,EAAC,IAAI,EAAE,OAAO,YACxC,OAAO,GACF,CACb,CAAC,CAAC,CAAC,CACA,OAAO,CACV,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/navigation",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Navigation components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"less": true,
|
|
44
44
|
"webpack": false
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "9f5902e88d22018cf1a53935aa5433940b6ca251"
|
|
47
47
|
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { Icon, IconPropsStrict } from '@servicetitan/design-system';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { FC, Fragment } from 'react';
|
|
4
|
+
import { HeaderNavigationItemData } from '../../utils/navigation';
|
|
5
|
+
import { useNavLink } from '../../utils/navigation-context';
|
|
6
|
+
import { withTooltip } from '../../utils/with-tooltip';
|
|
7
|
+
import { CounterTag, CounterTagPropsType } from '../counter-tag';
|
|
8
|
+
import * as Styles from './header-navigation.module.less';
|
|
9
|
+
|
|
10
|
+
export interface HeaderNavigationItemContentPropsStrict {
|
|
11
|
+
/** item text */
|
|
12
|
+
title?: string;
|
|
13
|
+
/** text component class name */
|
|
14
|
+
titleClassName?: string;
|
|
15
|
+
/** counter shown for item */
|
|
16
|
+
counter?: CounterTagPropsType;
|
|
17
|
+
/** counter component class name */
|
|
18
|
+
counterClassName?: string;
|
|
19
|
+
/** icon component class name */
|
|
20
|
+
iconClassName?: string;
|
|
21
|
+
/** IconComponent custom icon component */
|
|
22
|
+
iconComponent?: FC;
|
|
23
|
+
/** iconName name of anvil icon */
|
|
24
|
+
iconName?: IconPropsStrict['name'];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Content for navigation items */
|
|
28
|
+
export const HeaderNavigationItemContent: FC<HeaderNavigationItemContentPropsStrict> = ({
|
|
29
|
+
title,
|
|
30
|
+
titleClassName,
|
|
31
|
+
counter,
|
|
32
|
+
counterClassName,
|
|
33
|
+
iconClassName,
|
|
34
|
+
iconComponent: IconComponent,
|
|
35
|
+
iconName,
|
|
36
|
+
}) => {
|
|
37
|
+
const iconClass = classNames(Styles.navigationIcon, iconClassName);
|
|
38
|
+
return (
|
|
39
|
+
<Fragment>
|
|
40
|
+
{IconComponent ? (
|
|
41
|
+
<i className={iconClass}>
|
|
42
|
+
<IconComponent />
|
|
43
|
+
</i>
|
|
44
|
+
) : iconName ? (
|
|
45
|
+
<Icon name={iconName} className={iconClass} />
|
|
46
|
+
) : (
|
|
47
|
+
<i className={iconClass} />
|
|
48
|
+
)}
|
|
49
|
+
|
|
50
|
+
{!!title && (
|
|
51
|
+
<span className={classNames(Styles.navigationItemTitle, titleClassName)}>
|
|
52
|
+
{title}
|
|
53
|
+
</span>
|
|
54
|
+
)}
|
|
55
|
+
|
|
56
|
+
{!!counter && (
|
|
57
|
+
<CounterTag
|
|
58
|
+
data={counter}
|
|
59
|
+
className={classNames(Styles.navigationItemCounter, counterClassName)}
|
|
60
|
+
longClassName={Styles.navigationItemCounterLong}
|
|
61
|
+
/>
|
|
62
|
+
)}
|
|
63
|
+
</Fragment>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
interface HeaderNavigationItemPropsStrict extends HeaderNavigationItemData {
|
|
68
|
+
minimized: boolean;
|
|
69
|
+
main: boolean;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** Navigation main menu item */
|
|
73
|
+
export const HeaderNavigationItem: FC<HeaderNavigationItemPropsStrict> = ({
|
|
74
|
+
id,
|
|
75
|
+
to,
|
|
76
|
+
title,
|
|
77
|
+
hint,
|
|
78
|
+
counter,
|
|
79
|
+
className,
|
|
80
|
+
iconClassName,
|
|
81
|
+
iconComponent,
|
|
82
|
+
iconName,
|
|
83
|
+
isActive,
|
|
84
|
+
main,
|
|
85
|
+
minimized,
|
|
86
|
+
}) => {
|
|
87
|
+
const NavigationComponent = useNavLink();
|
|
88
|
+
|
|
89
|
+
return withTooltip(
|
|
90
|
+
<NavigationComponent
|
|
91
|
+
data-cy={`navigation-item-${id}`}
|
|
92
|
+
data-pendo={`navigation-item-${id}`}
|
|
93
|
+
key={id}
|
|
94
|
+
to={to}
|
|
95
|
+
title={hint}
|
|
96
|
+
className={classNames(
|
|
97
|
+
Styles.navigationItem,
|
|
98
|
+
main ? Styles.navigationItemMain : Styles.navigationItemOverflow,
|
|
99
|
+
className,
|
|
100
|
+
{
|
|
101
|
+
[Styles.navigationItemActive]: isActive === true,
|
|
102
|
+
}
|
|
103
|
+
)}
|
|
104
|
+
isActive={typeof isActive === 'function' ? isActive : undefined}
|
|
105
|
+
activeClassName={Styles.navigationItemActive}
|
|
106
|
+
>
|
|
107
|
+
<HeaderNavigationItemContent
|
|
108
|
+
title={minimized ? undefined : title}
|
|
109
|
+
titleClassName={main ? '' : 'm-l-half'}
|
|
110
|
+
counter={counter}
|
|
111
|
+
iconComponent={iconComponent}
|
|
112
|
+
iconClassName={iconClassName}
|
|
113
|
+
iconName={iconName}
|
|
114
|
+
/>
|
|
115
|
+
</NavigationComponent>,
|
|
116
|
+
minimized ? title : undefined
|
|
117
|
+
);
|
|
118
|
+
};
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { Popover } from '@servicetitan/design-system';
|
|
1
|
+
import { Button, Popover } from '@servicetitan/design-system';
|
|
2
2
|
import { FC, useState } from 'react';
|
|
3
3
|
import { NavLinkComponentProps } from '../../utils/navigation';
|
|
4
4
|
import {
|
|
5
5
|
HeaderNavigation,
|
|
6
|
-
HeaderNavigationItemContent,
|
|
7
6
|
HeaderNavigationLink,
|
|
8
7
|
HeaderNavigationTrigger,
|
|
9
8
|
HeaderNavigationTriggerCustom,
|
|
10
|
-
} from './
|
|
9
|
+
} from './';
|
|
11
10
|
|
|
12
11
|
export default {
|
|
13
12
|
title: 'Navigation/HeaderNavigationExtra',
|
|
@@ -34,7 +33,7 @@ const NavLinkMock: FC<NavLinkComponentProps> = ({
|
|
|
34
33
|
);
|
|
35
34
|
|
|
36
35
|
export const extraLink = () => (
|
|
37
|
-
<HeaderNavigation items={[]} navigationComponent={NavLinkMock}
|
|
36
|
+
<HeaderNavigation items={[]} navigationComponent={NavLinkMock} rightClassName="m-r-1">
|
|
38
37
|
<HeaderNavigationLink
|
|
39
38
|
id="search"
|
|
40
39
|
to="https://google.com"
|
|
@@ -46,7 +45,7 @@ export const extraLink = () => (
|
|
|
46
45
|
);
|
|
47
46
|
|
|
48
47
|
export const extraTrigger = () => (
|
|
49
|
-
<HeaderNavigation items={[]} navigationComponent={NavLinkMock}
|
|
48
|
+
<HeaderNavigation items={[]} navigationComponent={NavLinkMock} rightClassName="m-r-1">
|
|
50
49
|
<HeaderNavigationTrigger id="dialpad" iconName="phone" counter={2} tooltip="Phones pro" />
|
|
51
50
|
</HeaderNavigation>
|
|
52
51
|
);
|
|
@@ -60,7 +59,7 @@ export const extraCustomTrigger = () => (
|
|
|
60
59
|
);
|
|
61
60
|
|
|
62
61
|
export const extraWithTooltip = () => (
|
|
63
|
-
<HeaderNavigation items={[]} navigationComponent={NavLinkMock}
|
|
62
|
+
<HeaderNavigation items={[]} navigationComponent={NavLinkMock} rightClassName="m-r-1">
|
|
64
63
|
<HeaderNavigationLink
|
|
65
64
|
id="search"
|
|
66
65
|
to="https://google.com"
|
|
@@ -72,9 +71,7 @@ export const extraWithTooltip = () => (
|
|
|
72
71
|
|
|
73
72
|
<HeaderNavigationTrigger id="dialpad" iconName="phone" title="Dialpad" counter={2} />
|
|
74
73
|
|
|
75
|
-
<
|
|
76
|
-
<HelpCenterButton />
|
|
77
|
-
</HeaderNavigationTriggerCustom>
|
|
74
|
+
<HelpCenterButton />
|
|
78
75
|
</HeaderNavigation>
|
|
79
76
|
);
|
|
80
77
|
|
|
@@ -88,9 +85,12 @@ const HelpCenterButton = () => {
|
|
|
88
85
|
direction="bl"
|
|
89
86
|
width="xs"
|
|
90
87
|
trigger={
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
<Button
|
|
89
|
+
className="c-white"
|
|
90
|
+
iconName="help_outline"
|
|
91
|
+
fill="subtle"
|
|
92
|
+
onClick={() => setOpen(true)}
|
|
93
|
+
/>
|
|
94
94
|
}
|
|
95
95
|
portal
|
|
96
96
|
>
|