@servicetitan/navigation 11.0.0-canary.237.ff793b3.0 → 11.0.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/profile-dropdown/profile-dropdown.d.ts +2 -0
- package/dist/components/profile-dropdown/profile-dropdown.d.ts.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown.js +9 -6
- package/dist/components/profile-dropdown/profile-dropdown.js.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown.module.less +20 -8
- package/dist/components/titan-layout/layout-header-links.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-header-links.js +1 -1
- package/dist/components/titan-layout/layout-header-links.js.map +1 -1
- package/dist/components/titan-layout/layout-header.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-header.js +1 -1
- package/dist/components/titan-layout/layout-header.js.map +1 -1
- package/dist/components/titan-layout/layout-header.module.less +47 -55
- package/dist/components/titan-layout/layout-profile.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-profile.js +20 -16
- package/dist/components/titan-layout/layout-profile.js.map +1 -1
- package/dist/components/titan-layout/layout-sidebar-links.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-sidebar-links.js +1 -1
- package/dist/components/titan-layout/layout-sidebar-links.js.map +1 -1
- package/dist/components/titan-layout/titan-layout.d.ts.map +1 -1
- package/dist/components/titan-layout/titan-layout.js +14 -14
- package/dist/components/titan-layout/titan-layout.js.map +1 -1
- package/dist/components/titan-layout/titan-layout.module.less +2 -0
- package/dist/components/titan-layout/titan-layout.stories.d.ts.map +1 -1
- package/dist/components/titan-layout/titan-layout.stories.js +3 -3
- package/dist/components/titan-layout/titan-layout.stories.js.map +1 -1
- package/dist/utils/use-breakpoint.js +1 -1
- package/dist/utils/use-breakpoint.js.map +1 -1
- package/package.json +2 -2
- package/src/components/profile-dropdown/profile-dropdown.module.less +20 -8
- package/src/components/profile-dropdown/profile-dropdown.module.less.d.ts +2 -0
- package/src/components/profile-dropdown/profile-dropdown.tsx +37 -9
- package/src/components/titan-layout/layout-header-links.tsx +2 -1
- package/src/components/titan-layout/layout-header.module.less +47 -55
- package/src/components/titan-layout/layout-header.module.less.d.ts +2 -0
- package/src/components/titan-layout/layout-header.tsx +5 -1
- package/src/components/titan-layout/layout-profile.tsx +46 -17
- package/src/components/titan-layout/layout-sidebar-links.tsx +5 -1
- package/src/components/titan-layout/titan-layout.module.less +2 -0
- package/src/components/titan-layout/titan-layout.stories.tsx +6 -1
- package/src/components/titan-layout/titan-layout.tsx +22 -43
- package/src/utils/use-breakpoint.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"titan-layout.stories.d.ts","sourceRoot":"","sources":["../../../src/components/titan-layout/titan-layout.stories.tsx"],"names":[],"mappings":"AAsBA,UAAU,iBAAiB;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACrB;;;;;;UAgBQ,iBAAiB;;AAd1B,wBAeE;
|
|
1
|
+
{"version":3,"file":"titan-layout.stories.d.ts","sourceRoot":"","sources":["../../../src/components/titan-layout/titan-layout.stories.tsx"],"names":[],"mappings":"AAsBA,UAAU,iBAAiB;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACrB;;;;;;UAgBQ,iBAAiB;;AAd1B,wBAeE;AAqQF,eAAO,MAAM,iBAAiB,GAAI,MAAM,iBAAiB,4CAYxD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,MAAM,iBAAiB,4CASxD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,MAAM,iBAAiB,4CAWxD,CAAC"}
|
|
@@ -41,7 +41,7 @@ const mainNavItems = [
|
|
|
41
41
|
items.pointOfSale,
|
|
42
42
|
items.reports,
|
|
43
43
|
];
|
|
44
|
-
const profile = (_jsxs(ProfileDropdown, { children: [_jsx(ProfileDropdown.Link, { id: "first", to: "https://google.com", tooltip: "Google it", target: "_blank", tag: { value: true }, children: "first link" }), _jsx(ProfileDropdown.Section, { id: "second", onClick: () => alert('second click'), tooltip: "Second hint", 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: "/third", children: "third link" }), _jsx(ProfileDropdown.Divider, {})] }));
|
|
44
|
+
const profile = (_jsxs(ProfileDropdown, { children: [_jsx(ProfileDropdown.Link, { id: "first", to: "https://google.com", tooltip: "Google it", target: "_blank", tag: { value: true }, children: "first link" }), _jsx(ProfileDropdown.Section, { id: "second", onClick: () => alert('second click'), tooltip: "Second hint", counter: true, 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: "/third", children: "third link" }), _jsx(ProfileDropdown.Divider, {})] }));
|
|
45
45
|
const extraLinks = (_jsxs(Fragment, { children: [_jsx(HeaderNavigationLink, { id: "search", to: "https://google.com", target: "_blank", title: "Search", hint: "Search: for all the questions", tooltip: "Search", icon: SvgSearch, iconActive: SvgSearch }), _jsx(CallsNavigationTrigger, {}), _jsx(HeaderNavigationLink, { id: "titanAdvisor", to: "/titanAdvisor", title: "Titan Advisor", icon: SvgRocket, iconActive: SvgRocketActive }), _jsx(HeaderNavigationLink, { id: "settings", to: "/settings", title: "Settings", target: "_blank", "aria-label": "search", hint: "Settings", icon: SvgSettings, iconActive: SvgSettingsActive })] }));
|
|
46
46
|
const extraLinksTop = (_jsx(HeaderNavigationTrigger, { id: "atlas", title: "Atlas", icon: SvgAtlas, iconActive: SvgAtlas, "data-pendo": "atlas-chat-button", "data-cy": "atlas-chat-button", "data-atlas-chat-button": true }));
|
|
47
47
|
const SideLinkPopoverWrapper = ({ children, context }) => {
|
|
@@ -75,9 +75,9 @@ const useLayoutProps = (args) => {
|
|
|
75
75
|
};
|
|
76
76
|
};
|
|
77
77
|
const Content = (args) => {
|
|
78
|
-
return (_jsxs(Fragment, { children: [_jsx(LocationInfo, { className: "m-b-3" }), args.wideContent && (_jsx("div", { style: { width: '1200px' }, children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." })), args.longContent && (_jsxs("div", { children: [_jsx("p", { children: "Lorem" }), _jsx("p", { children: "ipsum" }), _jsx("p", { children: "dolor" }), _jsx("p", { children: "sit" }), _jsx("p", { children: "amet," }), _jsx("p", { children: "consectetur" }), _jsx("p", { children: "adipiscing" }), _jsx("p", { children: "elit," }), _jsx("p", { children: "sed" }), _jsx("p", { children: "do" }), _jsx("p", { children: "eiusmod" }), _jsx("p", { children: "tempor" }), _jsx("p", { children: "incididunt" }), _jsx("p", { children: "ut" }), _jsx("p", { children: "labore" }), _jsx("p", { children: "et" }), _jsx("p", { children: "dolore" }), _jsx("p", { children: "magna" }), _jsx("p", { children: "aliqua." }), _jsx("p", { children: "Ut" }), _jsx("p", { children: "enim" }), _jsx("p", { children: "ad" }), _jsx("p", { children: "minim" }), _jsx("p", { children: "veniam," }), _jsx("p", { children: "quis" }), _jsx("p", { children: "nostrud" }), _jsx("p", { children: "exercitation" }), _jsx("p", { children: "ullamco" }), _jsx("p", { children: "laboris" }), _jsx("p", { children: "nisi" }), _jsx("p", { children: "ut" }), _jsx("p", { children: "aliquip" }), _jsx("p", { children: "ex" }), _jsx("p", { children: "ea" }), _jsx("p", { children: "commodo" }), _jsx("p", { children: "consequat." }), _jsx("p", { children: "Duis" }), _jsx("p", { children: "aute" }), _jsx("p", { children: "irure" }), _jsx("p", { children: "dolor" }), _jsx("p", { children: "in" }), _jsx("p", { children: "reprehenderit" }), _jsx("p", { children: "in" }), _jsx("p", { children: "voluptate" }), _jsx("p", { children: "velit" }), _jsx("p", { children: "esse" }), _jsx("p", { children: "cillum" }), _jsx("p", { children: "dolore" }), _jsx("p", { children: "eu" }), _jsx("p", { children: "fugiat" }), _jsx("p", { children: "nulla" }), _jsx("p", { children: "pariatur." }), _jsx("p", { children: "Excepteur" }), _jsx("p", { children: "sint" }), _jsx("p", { children: "occaecat" }), _jsx("p", { children: "cupidatat" }), _jsx("p", { children: "non" }), _jsx("p", { children: "proident," }), _jsx("p", { children: "sunt" }), _jsx("p", { children: "in" }), _jsx("p", { children: "culpa" }), _jsx("p", { children: "qui" }), _jsx("p", { children: "officia" }), _jsx("p", { children: "deserunt" }), _jsx("p", { children: "mollit" }), _jsx("p", { children: "anim" }), _jsx("p", { children: "id" }), _jsx("p", { children: "est" }), _jsx("p", { children: "laborum." })] }))] }));
|
|
78
|
+
return (_jsxs(Fragment, { children: [_jsx(LocationInfo, { className: "m-b-3" }), _jsxs("div", { className: "m-b-3", children: ["rendered - ", new Date().toLocaleTimeString()] }), args.wideContent && (_jsx("div", { style: { width: '1200px' }, children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." })), args.longContent && (_jsxs("div", { children: [_jsx("p", { children: "Lorem" }), _jsx("p", { children: "ipsum" }), _jsx("p", { children: "dolor" }), _jsx("p", { children: "sit" }), _jsx("p", { children: "amet," }), _jsx("p", { children: "consectetur" }), _jsx("p", { children: "adipiscing" }), _jsx("p", { children: "elit," }), _jsx("p", { children: "sed" }), _jsx("p", { children: "do" }), _jsx("p", { children: "eiusmod" }), _jsx("p", { children: "tempor" }), _jsx("p", { children: "incididunt" }), _jsx("p", { children: "ut" }), _jsx("p", { children: "labore" }), _jsx("p", { children: "et" }), _jsx("p", { children: "dolore" }), _jsx("p", { children: "magna" }), _jsx("p", { children: "aliqua." }), _jsx("p", { children: "Ut" }), _jsx("p", { children: "enim" }), _jsx("p", { children: "ad" }), _jsx("p", { children: "minim" }), _jsx("p", { children: "veniam," }), _jsx("p", { children: "quis" }), _jsx("p", { children: "nostrud" }), _jsx("p", { children: "exercitation" }), _jsx("p", { children: "ullamco" }), _jsx("p", { children: "laboris" }), _jsx("p", { children: "nisi" }), _jsx("p", { children: "ut" }), _jsx("p", { children: "aliquip" }), _jsx("p", { children: "ex" }), _jsx("p", { children: "ea" }), _jsx("p", { children: "commodo" }), _jsx("p", { children: "consequat." }), _jsx("p", { children: "Duis" }), _jsx("p", { children: "aute" }), _jsx("p", { children: "irure" }), _jsx("p", { children: "dolor" }), _jsx("p", { children: "in" }), _jsx("p", { children: "reprehenderit" }), _jsx("p", { children: "in" }), _jsx("p", { children: "voluptate" }), _jsx("p", { children: "velit" }), _jsx("p", { children: "esse" }), _jsx("p", { children: "cillum" }), _jsx("p", { children: "dolore" }), _jsx("p", { children: "eu" }), _jsx("p", { children: "fugiat" }), _jsx("p", { children: "nulla" }), _jsx("p", { children: "pariatur." }), _jsx("p", { children: "Excepteur" }), _jsx("p", { children: "sint" }), _jsx("p", { children: "occaecat" }), _jsx("p", { children: "cupidatat" }), _jsx("p", { children: "non" }), _jsx("p", { children: "proident," }), _jsx("p", { children: "sunt" }), _jsx("p", { children: "in" }), _jsx("p", { children: "culpa" }), _jsx("p", { children: "qui" }), _jsx("p", { children: "officia" }), _jsx("p", { children: "deserunt" }), _jsx("p", { children: "mollit" }), _jsx("p", { children: "anim" }), _jsx("p", { children: "id" }), _jsx("p", { children: "est" }), _jsx("p", { children: "laborum." })] }))] }));
|
|
79
79
|
};
|
|
80
|
-
export const TitanLayoutLegacy = (args) => (_jsxs(TitanLayout, { ...useLayoutProps(args), appearance: "legacy", children: [_jsx(TitanLayout.Logo, { title: true }), _jsx(TitanLayout.Content, { children: _jsx("div", { className: "p-3", children: _jsx(Content, { ...args }) }) })] }));
|
|
80
|
+
export const TitanLayoutLegacy = (args) => (_jsxs(TitanLayout, { ...useLayoutProps(args), appearance: "legacy", children: [_jsx(TitanLayout.Logo, { title: true }), _jsx(TitanLayout.Content, { children: _jsx("div", { className: "p-3", style: { position: 'absolute', width: 'calc(100% - var(--nav-offset-left));' }, children: _jsx(Content, { ...args }) }) })] }));
|
|
81
81
|
export const TitanLayoutAnvil1 = (args) => (_jsxs(TitanLayout, { ...useLayoutProps(args), appearance: "anvil1", children: [_jsx(TitanLayout.Logo, { title: true }), _jsx(TitanLayout.Content, { children: _jsx(Anvil1Page, { children: _jsx(Content, { ...args }) }) })] }));
|
|
82
82
|
export const TitanLayoutAnvil2 = (args) => (_jsxs(TitanLayout, { ...useLayoutProps(args), appearance: "anvil2", children: [_jsx(TitanLayout.Logo, { title: true }), _jsx(TitanLayout.Content, { children: _jsx(Anvil2Page, { children: _jsx(Anvil2Page.Content, { children: _jsx(Content, { ...args }) }) }) })] }));
|
|
83
83
|
//# sourceMappingURL=titan-layout.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"titan-layout.stories.js","sourceRoot":"","sources":["../../../src/components/titan-layout/titan-layout.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACpG,OAAO,SAAS,MAAM,6DAA6D,CAAC;AACpF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,iBAAiB,MAAM,+DAA+D,CAAC;AAC9F,OAAO,WAAW,MAAM,iEAAiE,CAAC;AAC1F,OAAO,eAAe,MAAM,oEAAoE,CAAC;AACjG,OAAO,SAAS,MAAM,sEAAsE,CAAC;AAC7F,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAM,QAAQ,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EACH,sBAAsB,EACtB,YAAY,EACZ,WAAW,EACX,KAAK,EACL,SAAS,EACT,oBAAoB,EACpB,gBAAgB,GACnB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAsC,MAAM,IAAI,CAAC;AAatF,eAAe;IACX,KAAK,EAAE,wBAAwB;IAC/B,UAAU,EAAE,CAAC,oBAAoB,EAAE,gBAAgB,EAAE,SAAS,CAAC;IAC/D,UAAU,EAAE,EAAE;IACd,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE;QACF,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,IAAI;QACb,SAAS,EAAE,IAAI;QACf,MAAM,EAAE,IAAI;QACZ,WAAW,EAAE,IAAI;QACjB,WAAW,EAAE,KAAK;QAClB,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,KAAK;KACG;CACzB,CAAC;AAEF,MAAM,YAAY,GAAG;IACjB,KAAK,CAAC,SAAS;IACf,KAAK,CAAC,QAAQ;IACd,KAAK,CAAC,KAAK;IACX,KAAK,CAAC,qBAAqB;IAC3B,KAAK,CAAC,QAAQ;IAEd,KAAK,CAAC,KAAK;IACX,KAAK,CAAC,SAAS;IACf,KAAK,CAAC,SAAS;IAEf,KAAK,CAAC,SAAS;IACf,KAAK,CAAC,SAAS;IACf,KAAK,CAAC,WAAW;IACjB,KAAK,CAAC,OAAO;CAChB,CAAC;AAEF,MAAM,OAAO,GAAG,CACZ,MAAC,eAAe,eACZ,KAAC,eAAe,CAAC,IAAI,IACjB,EAAE,EAAC,OAAO,EACV,EAAE,EAAC,oBAAoB,EACvB,OAAO,EAAC,WAAW,EACnB,MAAM,EAAC,QAAQ,EACf,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,2BAGD,EACvB,KAAC,eAAe,CAAC,OAAO,IACpB,EAAE,EAAC,QAAQ,EACX,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,EACpC,OAAO,EAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"titan-layout.stories.js","sourceRoot":"","sources":["../../../src/components/titan-layout/titan-layout.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACpG,OAAO,SAAS,MAAM,6DAA6D,CAAC;AACpF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,iBAAiB,MAAM,+DAA+D,CAAC;AAC9F,OAAO,WAAW,MAAM,iEAAiE,CAAC;AAC1F,OAAO,eAAe,MAAM,oEAAoE,CAAC;AACjG,OAAO,SAAS,MAAM,sEAAsE,CAAC;AAC7F,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAM,QAAQ,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC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;
|
|
7
7
|
return ({
|
|
8
8
|
name: (_a = breakpoint === null || breakpoint === void 0 ? void 0 : breakpoint.name) !== null && _a !== void 0 ? _a : 'xl',
|
|
9
|
-
isMobile: breakpoint ? breakpoint.innerWidth
|
|
9
|
+
isMobile: breakpoint ? breakpoint.innerWidth < 768 : false,
|
|
10
10
|
width: (_b = breakpoint === null || breakpoint === void 0 ? void 0 : breakpoint.innerWidth) !== null && _b !== void 0 ? _b : 0,
|
|
11
11
|
});
|
|
12
12
|
}, [breakpoint]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-breakpoint.js","sourceRoot":"","sources":["../../src/utils/use-breakpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAQhC,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAoB,EAAE;IACpD,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IAEnC,OAAO,OAAO,CACV,GAAG,EAAE;;QAAC,OAAA,CAAC;YACH,IAAI,EAAE,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,mCAAI,IAAI;YAC9B,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"use-breakpoint.js","sourceRoot":"","sources":["../../src/utils/use-breakpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAQhC,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAoB,EAAE;IACpD,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IAEnC,OAAO,OAAO,CACV,GAAG,EAAE;;QAAC,OAAA,CAAC;YACH,IAAI,EAAE,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,mCAAI,IAAI;YAC9B,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK;YAC1D,KAAK,EAAE,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,UAAU,mCAAI,CAAC;SACrC,CAAC,CAAA;KAAA,EACF,CAAC,UAAU,CAAC,CACf,CAAC;AACN,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/navigation",
|
|
3
|
-
"version": "11.0.0
|
|
3
|
+
"version": "11.0.0",
|
|
4
4
|
"description": "Navigation components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"less": true,
|
|
43
43
|
"webpack": false
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "3d64834ce8f40a41b7cfc00e44110050e67bed5a"
|
|
46
46
|
}
|
|
@@ -123,6 +123,11 @@
|
|
|
123
123
|
|
|
124
124
|
.dropdown-section {
|
|
125
125
|
padding: @spacing-1 @spacing-2;
|
|
126
|
+
position: relative;
|
|
127
|
+
|
|
128
|
+
&.dropdown-section-with-counter {
|
|
129
|
+
padding-right: @spacing-3;
|
|
130
|
+
}
|
|
126
131
|
}
|
|
127
132
|
|
|
128
133
|
.dropdown-link {
|
|
@@ -136,15 +141,22 @@
|
|
|
136
141
|
}
|
|
137
142
|
}
|
|
138
143
|
|
|
139
|
-
.counter {
|
|
140
|
-
color: @color-white;
|
|
141
|
-
font-size: @typescale-0;
|
|
142
|
-
font-weight: @font-weight-semibold;
|
|
144
|
+
.counter-wrapper {
|
|
143
145
|
position: absolute;
|
|
144
|
-
top:
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
top: 0;
|
|
147
|
+
bottom: 0;
|
|
148
|
+
right: @spacing-1;
|
|
149
|
+
|
|
150
|
+
display: flex;
|
|
151
|
+
align-items: center;
|
|
152
|
+
|
|
153
|
+
.counter {
|
|
154
|
+
color: @color-white;
|
|
155
|
+
font-size: @typescale-0;
|
|
156
|
+
font-weight: @font-weight-semibold;
|
|
157
|
+
min-width: 12px !important;
|
|
158
|
+
min-height: 12px !important;
|
|
159
|
+
}
|
|
148
160
|
}
|
|
149
161
|
}
|
|
150
162
|
|
|
@@ -4,12 +4,14 @@ export const badge: string;
|
|
|
4
4
|
export const badgeNoContent: string;
|
|
5
5
|
export const badgeWithContent: string;
|
|
6
6
|
export const counter: string;
|
|
7
|
+
export const counterWrapper: string;
|
|
7
8
|
export const dropdown: string;
|
|
8
9
|
export const dropdownContent: string;
|
|
9
10
|
export const dropdownContentBottomLeft: string;
|
|
10
11
|
export const dropdownContentWrapper: string;
|
|
11
12
|
export const dropdownLink: string;
|
|
12
13
|
export const dropdownSection: string;
|
|
14
|
+
export const dropdownSectionWithCounter: string;
|
|
13
15
|
export const expandIcon: string;
|
|
14
16
|
export const hint: string;
|
|
15
17
|
export const hintContent: string;
|
|
@@ -148,6 +148,17 @@ const ProfileDropdownTrigger: FC<ProfileDropdownTriggerProps> = ({
|
|
|
148
148
|
);
|
|
149
149
|
};
|
|
150
150
|
|
|
151
|
+
const useTag = (counter?: CounterTagValue, tag?: CounterTagData) =>
|
|
152
|
+
useMemo(() => {
|
|
153
|
+
const data = getCounterTag(counter, tag);
|
|
154
|
+
|
|
155
|
+
return data ? (
|
|
156
|
+
<div className={Styles.counterWrapper}>
|
|
157
|
+
<CounterTag className={Styles.counter} data={data} />
|
|
158
|
+
</div>
|
|
159
|
+
) : undefined;
|
|
160
|
+
}, [counter, tag]);
|
|
161
|
+
|
|
151
162
|
export type ProfileItemContent =
|
|
152
163
|
| { children: string; text?: string }
|
|
153
164
|
| { children: ReactNode; text: string };
|
|
@@ -157,6 +168,8 @@ export interface ProfileDropdownSectionPropsStrict {
|
|
|
157
168
|
id: string;
|
|
158
169
|
tooltip?: string;
|
|
159
170
|
className?: string;
|
|
171
|
+
tag?: CounterTagData;
|
|
172
|
+
counter?: CounterTagValue;
|
|
160
173
|
onClick?(e: MouseEvent): void;
|
|
161
174
|
}
|
|
162
175
|
|
|
@@ -167,7 +180,9 @@ export type ProfileDropdownSectionProps = Omit<ComponentPropsWithoutRef<'div'>,
|
|
|
167
180
|
export const ProfileDropdownSection: FC<ProfileDropdownSectionProps> = ({
|
|
168
181
|
children,
|
|
169
182
|
className,
|
|
183
|
+
counter,
|
|
170
184
|
id,
|
|
185
|
+
tag,
|
|
171
186
|
text,
|
|
172
187
|
tooltip,
|
|
173
188
|
onClick,
|
|
@@ -181,17 +196,23 @@ export const ProfileDropdownSection: FC<ProfileDropdownSectionProps> = ({
|
|
|
181
196
|
}
|
|
182
197
|
};
|
|
183
198
|
|
|
199
|
+
const tagElement = useTag(counter, tag);
|
|
200
|
+
|
|
184
201
|
return withTooltip(
|
|
185
202
|
<div
|
|
186
|
-
className={classNames(
|
|
187
|
-
|
|
188
|
-
|
|
203
|
+
className={classNames(
|
|
204
|
+
Styles.dropdownSection,
|
|
205
|
+
tagElement && Styles.dropdownSectionWithCounter,
|
|
206
|
+
!!onClick && Styles.dropdownLink,
|
|
207
|
+
className
|
|
208
|
+
)}
|
|
189
209
|
onClick={clickHandler}
|
|
190
210
|
data-cy={`profile-dropdown-section-${id}`}
|
|
191
211
|
data-pendo={`profile-dropdown-section-${id}`}
|
|
192
212
|
{...rest}
|
|
193
213
|
>
|
|
194
214
|
{children}
|
|
215
|
+
{tagElement}
|
|
195
216
|
</div>,
|
|
196
217
|
tooltip,
|
|
197
218
|
'left'
|
|
@@ -234,15 +255,17 @@ export const ProfileDropdownLink: FC<ProfileDropdownLinkProps> = ({
|
|
|
234
255
|
|
|
235
256
|
const isExternalLink = external ?? to?.startsWith('http');
|
|
236
257
|
|
|
237
|
-
const tagElement =
|
|
238
|
-
() => <CounterTag data={getCounterTag(counter, tag)} className={Styles.counter} />,
|
|
239
|
-
[counter, tag]
|
|
240
|
-
);
|
|
258
|
+
const tagElement = useTag(counter, tag);
|
|
241
259
|
|
|
242
260
|
return withTooltip(
|
|
243
261
|
isExternalLink ? (
|
|
244
262
|
<a
|
|
245
|
-
className={classNames(
|
|
263
|
+
className={classNames(
|
|
264
|
+
Styles.dropdownSection,
|
|
265
|
+
tagElement && Styles.dropdownSectionWithCounter,
|
|
266
|
+
Styles.dropdownLink,
|
|
267
|
+
className
|
|
268
|
+
)}
|
|
246
269
|
href={to}
|
|
247
270
|
target={target}
|
|
248
271
|
data-cy={`profile-dropdown-link-${id}`}
|
|
@@ -254,7 +277,12 @@ export const ProfileDropdownLink: FC<ProfileDropdownLinkProps> = ({
|
|
|
254
277
|
</a>
|
|
255
278
|
) : (
|
|
256
279
|
<NavigationComponent
|
|
257
|
-
className={classNames(
|
|
280
|
+
className={classNames(
|
|
281
|
+
Styles.dropdownSection,
|
|
282
|
+
Styles.dropdownLink,
|
|
283
|
+
{ [Styles.dropdownSectionWithCounter]: !!tagElement },
|
|
284
|
+
className
|
|
285
|
+
)}
|
|
258
286
|
target={target}
|
|
259
287
|
to={to}
|
|
260
288
|
data-cy={`profile-dropdown-link-${id}`}
|
|
@@ -134,7 +134,8 @@ export const LayoutHeaderNavigationTrigger: FC<HeaderNavigationTriggerProps> = (
|
|
|
134
134
|
>
|
|
135
135
|
<HeaderNavigationItemContent
|
|
136
136
|
tag={getCounterTag(counter, tag)}
|
|
137
|
-
icon={
|
|
137
|
+
icon={icon}
|
|
138
|
+
iconActive={iconActive}
|
|
138
139
|
label={label}
|
|
139
140
|
labelClassName={labelClassName}
|
|
140
141
|
/>
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
&.navigation-item-icon-state.navigation-item-active {
|
|
66
|
-
.navigation-icon:not(.navigation-icon-active) {
|
|
66
|
+
.navigation-icon[data-anv][data-anv]:not(.navigation-icon-active) {
|
|
67
67
|
display: none;
|
|
68
68
|
}
|
|
69
69
|
|
|
@@ -90,29 +90,59 @@
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
.header-mobile {
|
|
94
|
+
padding: @spacing-2 @spacing-0;
|
|
95
|
+
height: var(--nav-offset-top);
|
|
96
|
+
|
|
97
|
+
--nav-top-content-height: 40px;
|
|
98
|
+
|
|
99
|
+
.navigation-link {
|
|
100
|
+
padding: 10px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.he-top-center {
|
|
104
|
+
max-width: unset;
|
|
105
|
+
flex: 1;
|
|
106
|
+
margin-left: @spacing-3;
|
|
107
|
+
margin-right: @spacing-3;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.he-top-left {
|
|
111
|
+
margin-left: @spacing-half;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.he-top-right {
|
|
115
|
+
margin-right: @spacing-half;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
93
119
|
// desktop
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
padding: 6px 6px;
|
|
100
|
-
}
|
|
120
|
+
.header-desktop {
|
|
121
|
+
height: var(--nav-offset-top);
|
|
122
|
+
.navigation-link {
|
|
123
|
+
margin: 6px 2px;
|
|
124
|
+
padding: 6px 6px;
|
|
101
125
|
|
|
102
|
-
.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
.he-top-center {
|
|
106
|
-
flex: 1;
|
|
107
|
-
margin-left: @spacing-2;
|
|
108
|
-
margin-right: @spacing-2;
|
|
109
|
-
max-width: 400px;
|
|
126
|
+
.navigation-item-counter {
|
|
127
|
+
min-width: 12px !important;
|
|
128
|
+
height: 12px !important;
|
|
110
129
|
}
|
|
111
130
|
}
|
|
131
|
+
|
|
132
|
+
.he-top-left {
|
|
133
|
+
padding-left: @spacing-1;
|
|
134
|
+
}
|
|
135
|
+
.he-top-center {
|
|
136
|
+
flex: 1;
|
|
137
|
+
margin-left: @spacing-2;
|
|
138
|
+
margin-right: @spacing-2;
|
|
139
|
+
max-width: 400px;
|
|
140
|
+
}
|
|
112
141
|
}
|
|
142
|
+
|
|
113
143
|
// desktop wide
|
|
114
144
|
@media only screen and (min-width: 1200px) {
|
|
115
|
-
.header {
|
|
145
|
+
.header-desktop {
|
|
116
146
|
display: grid;
|
|
117
147
|
grid-template-columns: repeat(3, 1fr);
|
|
118
148
|
grid-template-rows: 48px;
|
|
@@ -129,35 +159,6 @@
|
|
|
129
159
|
}
|
|
130
160
|
}
|
|
131
161
|
|
|
132
|
-
// mobile
|
|
133
|
-
@media only screen and (max-width: 768px) {
|
|
134
|
-
.header {
|
|
135
|
-
padding: @spacing-2 @spacing-0;
|
|
136
|
-
height: var(--nav-offset-top);
|
|
137
|
-
|
|
138
|
-
--nav-top-content-height: 40px;
|
|
139
|
-
|
|
140
|
-
.navigation-link {
|
|
141
|
-
padding: 10px;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.he-top-center {
|
|
145
|
-
max-width: unset;
|
|
146
|
-
flex: 1;
|
|
147
|
-
margin-left: @spacing-3;
|
|
148
|
-
margin-right: @spacing-3;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.he-top-left {
|
|
152
|
-
margin-left: @spacing-half;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.he-top-right {
|
|
156
|
-
margin-right: @spacing-half;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
162
|
.navigation-link {
|
|
162
163
|
// styles specific to extra nav links
|
|
163
164
|
color: @color-black;
|
|
@@ -190,12 +191,3 @@
|
|
|
190
191
|
right: -8px;
|
|
191
192
|
}
|
|
192
193
|
}
|
|
193
|
-
|
|
194
|
-
@media only screen and (min-width: 768px) {
|
|
195
|
-
.navigation-link {
|
|
196
|
-
.navigation-item-counter {
|
|
197
|
-
min-width: 12px !important;
|
|
198
|
-
height: 12px !important;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
@@ -4,6 +4,8 @@ export const heTopLeft: string;
|
|
|
4
4
|
export const heTopRight: string;
|
|
5
5
|
export const heTopRightText: string;
|
|
6
6
|
export const header: string;
|
|
7
|
+
export const headerDesktop: string;
|
|
8
|
+
export const headerMobile: string;
|
|
7
9
|
export const navigationIcon: string;
|
|
8
10
|
export const navigationIconActive: string;
|
|
9
11
|
export const navigationItemActive: string;
|
|
@@ -47,7 +47,11 @@ export const LayoutHeader: FC<LayoutHeaderProps> = ({
|
|
|
47
47
|
return (
|
|
48
48
|
<LayoutPlacementContext.Provider value="top">
|
|
49
49
|
<div
|
|
50
|
-
className={classNames(
|
|
50
|
+
className={classNames(
|
|
51
|
+
Styles.header,
|
|
52
|
+
isMobile ? Styles.headerMobile : Styles.headerDesktop,
|
|
53
|
+
className
|
|
54
|
+
)}
|
|
51
55
|
{...rest}
|
|
52
56
|
data-cy="header-navigation"
|
|
53
57
|
>
|
|
@@ -25,18 +25,28 @@ export type {
|
|
|
25
25
|
ProfileDropdownLinkProps,
|
|
26
26
|
} from '../profile-dropdown/profile-dropdown';
|
|
27
27
|
|
|
28
|
-
const ExternalNavComponent: FC<NavLinkComponentProps> = ({
|
|
29
|
-
|
|
28
|
+
const ExternalNavComponent: FC<NavLinkComponentProps> = ({
|
|
29
|
+
children,
|
|
30
|
+
isActive,
|
|
31
|
+
to,
|
|
32
|
+
activeClassName,
|
|
33
|
+
...props
|
|
34
|
+
}) => (
|
|
35
|
+
<a {...props} href={to}>
|
|
36
|
+
{children}
|
|
37
|
+
</a>
|
|
30
38
|
);
|
|
31
39
|
|
|
32
40
|
const ProfileDropdownContent: FC<ProfileDropdownProps> = props => {
|
|
33
|
-
const { breakpoint, NavigationComponent } = useTitanLayoutContext();
|
|
41
|
+
const { isTitanLayout, breakpoint, NavigationComponent } = useTitanLayoutContext();
|
|
34
42
|
return breakpoint.isMobile ? (
|
|
35
43
|
<MobileProfileDropdown {...props} navigationComponent={NavigationComponent} />
|
|
36
|
-
) : (
|
|
44
|
+
) : isTitanLayout ? (
|
|
37
45
|
<NavigationComponentContext.Provider value={NavigationComponent}>
|
|
38
46
|
<DesktopProfileDropdown {...props} />
|
|
39
47
|
</NavigationComponentContext.Provider>
|
|
48
|
+
) : (
|
|
49
|
+
<DesktopProfileDropdown {...props} />
|
|
40
50
|
);
|
|
41
51
|
};
|
|
42
52
|
ProfileDropdownContent.displayName = 'ProfileDropdown';
|
|
@@ -88,18 +98,25 @@ const ProfileDropdownDivider: FC = () => {
|
|
|
88
98
|
);
|
|
89
99
|
};
|
|
90
100
|
|
|
91
|
-
const getText = (
|
|
92
|
-
if (typeof
|
|
93
|
-
return
|
|
101
|
+
const getText = (children: any, text: any): string | undefined => {
|
|
102
|
+
if (typeof children === 'string') {
|
|
103
|
+
return children;
|
|
94
104
|
}
|
|
95
105
|
|
|
96
|
-
if (typeof
|
|
97
|
-
return
|
|
106
|
+
if (typeof text === 'string') {
|
|
107
|
+
return text;
|
|
98
108
|
}
|
|
99
109
|
|
|
100
110
|
return undefined;
|
|
101
111
|
};
|
|
102
112
|
|
|
113
|
+
const getTag = (
|
|
114
|
+
tag: ProfileDropdownLinkProps['tag'],
|
|
115
|
+
counter: ProfileDropdownLinkProps['counter']
|
|
116
|
+
): boolean => {
|
|
117
|
+
return !!tag?.value || !!counter;
|
|
118
|
+
};
|
|
119
|
+
|
|
103
120
|
const ProfileDropdownSection: FC<ProfileDropdownSectionProps> = props => {
|
|
104
121
|
const { breakpoint } = useTitanLayoutContext();
|
|
105
122
|
return breakpoint.isMobile ? (
|
|
@@ -108,10 +125,19 @@ const ProfileDropdownSection: FC<ProfileDropdownSectionProps> = props => {
|
|
|
108
125
|
<DesktopProfileDropdown.Section {...props} />
|
|
109
126
|
);
|
|
110
127
|
};
|
|
111
|
-
const MobileProfileDropdownSection: FC<ProfileDropdownSectionProps> =
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
128
|
+
const MobileProfileDropdownSection: FC<ProfileDropdownSectionProps> = ({
|
|
129
|
+
children,
|
|
130
|
+
text,
|
|
131
|
+
tooltip,
|
|
132
|
+
title,
|
|
133
|
+
...props
|
|
134
|
+
}) => {
|
|
135
|
+
const sectionText = getText(children, text);
|
|
136
|
+
const { onNotificationsUpdate } = useNotificationsContext();
|
|
137
|
+
onNotificationsUpdate(props.id, getTag(props.tag, props.counter));
|
|
138
|
+
|
|
139
|
+
return sectionText ? (
|
|
140
|
+
<InternalSideNavigationGroupTrigger {...props} title={sectionText} />
|
|
115
141
|
) : null;
|
|
116
142
|
};
|
|
117
143
|
|
|
@@ -126,19 +152,22 @@ const ProfileDropdownLink: FC<ProfileDropdownLinkProps> = props => {
|
|
|
126
152
|
const MobileProfileDropdownLink: FC<ProfileDropdownLinkProps & NavigationComponentProps> = ({
|
|
127
153
|
external,
|
|
128
154
|
to,
|
|
155
|
+
tooltip,
|
|
156
|
+
text,
|
|
157
|
+
children,
|
|
129
158
|
navigationComponent,
|
|
130
159
|
...props
|
|
131
160
|
}) => {
|
|
132
161
|
const { onNotificationsUpdate } = useNotificationsContext();
|
|
133
|
-
const
|
|
162
|
+
const linkText = getText(children, text);
|
|
134
163
|
const isExternalLink = external ?? to?.startsWith('http');
|
|
135
|
-
onNotificationsUpdate(props.id,
|
|
164
|
+
onNotificationsUpdate(props.id, getTag(props.tag, props.counter));
|
|
136
165
|
|
|
137
|
-
return
|
|
166
|
+
return linkText ? (
|
|
138
167
|
<InternalSideNavigationGroupLink
|
|
139
168
|
{...props}
|
|
140
169
|
to={to}
|
|
141
|
-
title={
|
|
170
|
+
title={linkText}
|
|
142
171
|
navigationComponent={isExternalLink ? ExternalNavComponent : navigationComponent}
|
|
143
172
|
/>
|
|
144
173
|
) : null;
|
|
@@ -64,5 +64,9 @@ export function TitanLayoutSidebarTrigger({
|
|
|
64
64
|
onClick={isMobile && !!onMobileClick ? onMobileClick : onClick}
|
|
65
65
|
/>
|
|
66
66
|
);
|
|
67
|
-
return wrapper && !isMobile
|
|
67
|
+
return wrapper && (!isMobile || !onMobileClick) ? (
|
|
68
|
+
<WrappedLink wrapper={wrapper}>{element}</WrappedLink>
|
|
69
|
+
) : (
|
|
70
|
+
element
|
|
71
|
+
);
|
|
68
72
|
}
|
|
@@ -80,6 +80,7 @@ const profile = (
|
|
|
80
80
|
id="second"
|
|
81
81
|
onClick={() => alert('second click')}
|
|
82
82
|
tooltip="Second hint"
|
|
83
|
+
counter
|
|
83
84
|
>
|
|
84
85
|
second link
|
|
85
86
|
</ProfileDropdown.Section>
|
|
@@ -217,6 +218,7 @@ const Content = (args: LayoutContentArgs) => {
|
|
|
217
218
|
return (
|
|
218
219
|
<Fragment>
|
|
219
220
|
<LocationInfo className="m-b-3" />
|
|
221
|
+
<div className="m-b-3">rendered - {new Date().toLocaleTimeString()}</div>
|
|
220
222
|
{args.wideContent && (
|
|
221
223
|
<div style={{ width: '1200px' }}>
|
|
222
224
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
|
|
@@ -309,7 +311,10 @@ export const TitanLayoutLegacy = (args: LayoutContentArgs) => (
|
|
|
309
311
|
<TitanLayout {...useLayoutProps(args)} appearance="legacy">
|
|
310
312
|
<TitanLayout.Logo title />
|
|
311
313
|
<TitanLayout.Content>
|
|
312
|
-
<div
|
|
314
|
+
<div
|
|
315
|
+
className="p-3"
|
|
316
|
+
style={{ position: 'absolute', width: 'calc(100% - var(--nav-offset-left));' }}
|
|
317
|
+
>
|
|
313
318
|
<Content {...args} />
|
|
314
319
|
</div>
|
|
315
320
|
</TitanLayout.Content>
|