@servicetitan/navigation 11.0.0-canary.237.64cfcfe.0 → 11.0.0-canary.237.7e21f65.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/badge-tag.d.ts +1 -1
- package/dist/components/badge-tag.d.ts.map +1 -1
- package/dist/components/header-navigation/header-navigation-stacked.stories.js +1 -1
- package/dist/components/header-navigation/header-navigation-stacked.stories.js.map +1 -1
- package/dist/components/header-navigation/header-navigation.stories.js +1 -1
- package/dist/components/header-navigation/header-navigation.stories.js.map +1 -1
- package/dist/components/left-navigation/header-navigation-tiny.stories.js +2 -2
- package/dist/components/left-navigation/header-navigation-tiny.stories.js.map +1 -1
- package/dist/components/logo/logo-titan-text.d.ts +1 -1
- package/dist/components/logo/logo-titan-text.d.ts.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown.d.ts +10 -7
- package/dist/components/profile-dropdown/profile-dropdown.d.ts.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown.js +2 -2
- package/dist/components/profile-dropdown/profile-dropdown.js.map +1 -1
- package/dist/components/titan-layout/layout-header.d.ts +2 -0
- package/dist/components/titan-layout/layout-header.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-header.js +3 -4
- package/dist/components/titan-layout/layout-header.js.map +1 -1
- package/dist/components/titan-layout/layout-header.module.less +44 -6
- package/dist/components/titan-layout/layout-logo.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-logo.js +2 -1
- package/dist/components/titan-layout/layout-logo.js.map +1 -1
- package/dist/components/titan-layout/layout-profile.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-profile.js +32 -8
- package/dist/components/titan-layout/layout-profile.js.map +1 -1
- package/dist/components/titan-layout/layout-profile.stories.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-profile.stories.js +1 -1
- package/dist/components/titan-layout/layout-profile.stories.js.map +1 -1
- package/dist/components/titan-layout/layout-sidebar-links-internal.d.ts +2 -2
- package/dist/components/titan-layout/layout-sidebar-links-internal.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-sidebar-links-internal.js +4 -4
- package/dist/components/titan-layout/layout-sidebar-links-internal.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 +9 -2
- package/dist/components/titan-layout/layout-sidebar-links.js.map +1 -1
- package/dist/components/titan-layout/layout-sidebar.d.ts +2 -0
- package/dist/components/titan-layout/layout-sidebar.d.ts.map +1 -1
- package/dist/components/titan-layout/layout-sidebar.js +6 -4
- package/dist/components/titan-layout/layout-sidebar.js.map +1 -1
- package/dist/components/titan-layout/layout-sidebar.module.less +16 -3
- package/dist/components/titan-layout/notifications-context.d.ts +13 -0
- package/dist/components/titan-layout/notifications-context.d.ts.map +1 -0
- package/dist/components/titan-layout/notifications-context.js +23 -0
- package/dist/components/titan-layout/notifications-context.js.map +1 -0
- package/dist/components/titan-layout/titan-layout.d.ts +6 -3
- package/dist/components/titan-layout/titan-layout.d.ts.map +1 -1
- package/dist/components/titan-layout/titan-layout.js +42 -18
- package/dist/components/titan-layout/titan-layout.js.map +1 -1
- package/dist/components/titan-layout/titan-layout.module.less +43 -20
- package/dist/components/titan-layout/titan-layout.stories.d.ts +5 -0
- package/dist/components/titan-layout/titan-layout.stories.d.ts.map +1 -1
- package/dist/components/titan-layout/titan-layout.stories.js +18 -7
- package/dist/components/titan-layout/titan-layout.stories.js.map +1 -1
- package/dist/test/data.d.ts +4 -1
- package/dist/test/data.d.ts.map +1 -1
- package/dist/test/data.js +2 -3
- package/dist/test/data.js.map +1 -1
- package/package.json +2 -2
- package/src/components/badge-tag.tsx +1 -1
- package/src/components/header-navigation/header-navigation-stacked.stories.tsx +1 -1
- package/src/components/header-navigation/header-navigation.stories.tsx +1 -1
- package/src/components/left-navigation/header-navigation-tiny.stories.tsx +2 -2
- package/src/components/logo/logo-titan-text.tsx +1 -1
- package/src/components/profile-dropdown/profile-dropdown.tsx +13 -6
- package/src/components/titan-layout/layout-header.module.less +44 -6
- package/src/components/titan-layout/layout-header.tsx +7 -4
- package/src/components/titan-layout/layout-logo.tsx +13 -6
- package/src/components/titan-layout/layout-profile.stories.tsx +10 -1
- package/src/components/titan-layout/layout-profile.tsx +60 -25
- package/src/components/titan-layout/layout-sidebar-links-internal.tsx +18 -5
- package/src/components/titan-layout/layout-sidebar-links.tsx +11 -2
- package/src/components/titan-layout/layout-sidebar.module.less +16 -3
- package/src/components/titan-layout/layout-sidebar.module.less.d.ts +1 -0
- package/src/components/titan-layout/layout-sidebar.tsx +14 -5
- package/src/components/titan-layout/notifications-context.tsx +44 -0
- package/src/components/titan-layout/titan-layout.module.less +43 -20
- package/src/components/titan-layout/titan-layout.module.less.d.ts +2 -1
- package/src/components/titan-layout/titan-layout.stories.tsx +118 -7
- package/src/components/titan-layout/titan-layout.tsx +132 -75
- package/src/test/data.tsx +2 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Announcement, Page as Anvil2Page, Button, Popover } from '@servicetitan/anvil2';
|
|
2
|
+
import { Announcement, Page as Anvil2Page, Button, Popover, TextField } from '@servicetitan/anvil2';
|
|
3
3
|
import SvgSearch from '@servicetitan/anvil2/assets/icons/material/round/search.svg';
|
|
4
4
|
import SvgAtlas from '@servicetitan/anvil2/assets/icons/st/atlas_logo.svg';
|
|
5
5
|
import SvgSettingsActive from '@servicetitan/anvil2/assets/icons/st/gnav_settings_active.svg';
|
|
@@ -20,6 +20,11 @@ export default {
|
|
|
20
20
|
header: true,
|
|
21
21
|
sideTop: true,
|
|
22
22
|
extraText: true,
|
|
23
|
+
search: true,
|
|
24
|
+
longContent: true,
|
|
25
|
+
wideContent: false,
|
|
26
|
+
minWidth: false,
|
|
27
|
+
emptyNav: false,
|
|
23
28
|
},
|
|
24
29
|
};
|
|
25
30
|
const mainNavItems = [
|
|
@@ -36,7 +41,7 @@ const mainNavItems = [
|
|
|
36
41
|
items.pointOfSale,
|
|
37
42
|
items.reports,
|
|
38
43
|
];
|
|
39
|
-
const profile = (_jsxs(ProfileDropdown, { children: [_jsx(ProfileDropdown.Link, { id: "first", to: "https://google.com", tooltip: "Google it", target: "_blank", 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", 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, {})] }));
|
|
40
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 })] }));
|
|
41
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 }));
|
|
42
47
|
const SideLinkPopoverWrapper = ({ children, context }) => {
|
|
@@ -51,22 +56,28 @@ const ContentHeader = () => {
|
|
|
51
56
|
const [longInfo, setLongInfo] = useState(false);
|
|
52
57
|
return (_jsxs(Fragment, { children: [_jsx(Announcement, { title: "Some info", status: "info" }), _jsx(Announcement, { title: "Some warning", status: "warning" }), _jsx("div", { className: "d-f justify-content-center align-items-center bg-purple-100-i", style: { height: longInfo ? '120px' : '48px' }, children: _jsxs("div", { className: "d-f align-items-center gap-1", children: ["custom content", ' ', _jsx(Button, { onClick: () => setLongInfo(!longInfo), size: "small", "aria-label": "test", children: longInfo ? '↑' : '↓' })] }) })] }));
|
|
53
58
|
};
|
|
59
|
+
const SearchBar = () => (_jsx(TextField, { size: "small", placeholder: "Search", className: "w-100-i m-x-half-i" }));
|
|
54
60
|
const useLayoutProps = (args) => {
|
|
55
61
|
const [state, setState] = useState(undefined);
|
|
56
62
|
return {
|
|
57
63
|
state,
|
|
58
64
|
onStateChange: setState,
|
|
59
65
|
navigationComponent: NavLinkMock,
|
|
60
|
-
navigationMainItems: mainNavItems,
|
|
66
|
+
navigationMainItems: args.emptyNav ? [] : mainNavItems,
|
|
61
67
|
profile,
|
|
68
|
+
top: args.search ? _jsx(SearchBar, {}) : undefined,
|
|
62
69
|
header: args.header ? _jsx(ContentHeader, {}) : undefined,
|
|
63
70
|
extraLinks,
|
|
64
71
|
extraLinksTop,
|
|
65
72
|
extraText: args.extraText ? 'EST (-8 hrs)' : undefined,
|
|
66
|
-
sideTop: args.sideTop ? sidebarTop() : undefined,
|
|
73
|
+
sideTop: args.sideTop && !args.emptyNav ? sidebarTop() : undefined,
|
|
74
|
+
minContentWidth: args.minWidth ? 900 : undefined,
|
|
67
75
|
};
|
|
68
76
|
};
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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." })] }))] }));
|
|
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 }) }) })] }));
|
|
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
|
+
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 }) }) }) })] }));
|
|
72
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,MAAM,sBAAsB,CAAC;
|
|
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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I,CAAC,EAAE,UAAU,EAAC,QAAQ,aACtD,KAAC,WAAW,CAAC,IAAI,IAAC,KAAK,SAAG,EAC1B,KAAC,WAAW,CAAC,OAAO,cAChB,KAAC,UAAU,cACP,KAAC,OAAO,OAAK,IAAI,GAAI,GACZ,GACK,IACZ,CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,IAAuB,EAAE,EAAE,CAAC,CAC1D,MAAC,WAAW,OAAK,cAAc,CAAC,IAAI,CAAC,EAAE,UAAU,EAAC,QAAQ,aACtD,KAAC,WAAW,CAAC,IAAI,IAAC,KAAK,SAAG,EAC1B,KAAC,WAAW,CAAC,OAAO,cAChB,KAAC,UAAU,cACP,KAAC,UAAU,CAAC,OAAO,cACf,KAAC,OAAO,OAAK,IAAI,GAAI,GACJ,GACZ,GACK,IACZ,CACjB,CAAC"}
|
package/dist/test/data.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
1
2
|
import { NavLinkComponentProps } from '../utils/navigation-context';
|
|
2
3
|
import { HeaderNavigationItemData } from '../utils/navigation-legacy';
|
|
3
4
|
export declare const NavLinkMock: import("react").ForwardRefExoticComponent<Omit<NavLinkComponentProps, "ref"> & import("react").RefAttributes<any>>;
|
|
4
|
-
export declare const LocationInfo:
|
|
5
|
+
export declare const LocationInfo: FC<{
|
|
6
|
+
className?: string;
|
|
7
|
+
}>;
|
|
5
8
|
export declare const withMemoryRouter: (Story: any) => import("react/jsx-runtime").JSX.Element;
|
|
6
9
|
export declare const withAnvil: (Story: any) => import("react/jsx-runtime").JSX.Element;
|
|
7
10
|
export declare const InventoryIcon: () => import("react/jsx-runtime").JSX.Element;
|
package/dist/test/data.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src/test/data.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src/test/data.tsx"],"names":[],"mappings":"AAmCA,OAAO,EAAE,EAAE,EAA2C,MAAM,OAAO,CAAC;AAapE,OAAO,EACH,qBAAqB,EAIxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAGtE,eAAO,MAAM,WAAW,oHAwBvB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAInD,CAAC;AAkBF,eAAO,MAAM,gBAAgB,GAAI,OAAO,GAAG,4CAQ1C,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,OAAO,GAAG,4CAInC,CAAC;AAEF,eAAO,MAAM,aAAa,+CAKzB,CAAC;AAEF,eAAO,MAAM,UAAU,+CAetB,CAAC;AA6CF,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;CAyIjB,CAAC;AAEF,eAAO,MAAM,sBAAsB,+CAwBlC,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,OAAO,GAAG,4CAS9C,CAAC"}
|
package/dist/test/data.js
CHANGED
|
@@ -45,15 +45,14 @@ export const NavLinkMock = forwardRef(({ to, children, activeClassName, classNam
|
|
|
45
45
|
const linkActive = location.pathname.startsWith(to);
|
|
46
46
|
return (_jsx("a", { ...rest, onClick: e => {
|
|
47
47
|
e.preventDefault();
|
|
48
|
-
e.stopPropagation();
|
|
49
48
|
if (!to.startsWith('http')) {
|
|
50
49
|
history.replace(to);
|
|
51
50
|
}
|
|
52
51
|
}, className: classNames(className, linkActive ? activeClassName : ''), href: to, ref: ref, children: children }));
|
|
53
52
|
});
|
|
54
|
-
export const LocationInfo = () => {
|
|
53
|
+
export const LocationInfo = ({ className }) => {
|
|
55
54
|
const location = useLocation();
|
|
56
|
-
return _jsxs(BodyText, { children: ["current location - ", location.pathname] });
|
|
55
|
+
return _jsxs(BodyText, { className: className, children: ["current location - ", location.pathname] });
|
|
57
56
|
};
|
|
58
57
|
const LocationProvider = ({ children }) => {
|
|
59
58
|
const location = useLocation();
|
package/dist/test/data.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.js","sourceRoot":"","sources":["../../src/test/data.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,QAAQ,MAAM,qEAAqE,CAAC;AAC3F,OAAO,cAAc,MAAM,oEAAoE,CAAC;AAChG,OAAO,mBAAmB,MAAM,iEAAiE,CAAC;AAClG,OAAO,aAAa,MAAM,mEAAmE,CAAC;AAC9F,OAAO,cAAc,MAAM,4DAA4D,CAAC;AACxF,OAAO,QAAQ,MAAM,8DAA8D,CAAC;AACpF,OAAO,kBAAkB,MAAM,gEAAgE,CAAC;AAChG,OAAO,YAAY,MAAM,kEAAkE,CAAC;AAC5F,OAAO,iBAAiB,MAAM,+DAA+D,CAAC;AAC9F,OAAO,WAAW,MAAM,iEAAiE,CAAC;AAC1F,OAAO,iBAAiB,MAAM,gEAAgE,CAAC;AAC/F,OAAO,WAAW,MAAM,kEAAkE,CAAC;AAC3F,OAAO,iBAAiB,MAAM,gEAAgE,CAAC;AAC/F,OAAO,WAAW,MAAM,kEAAkE,CAAC;AAC3F,OAAO,kBAAkB,MAAM,gEAAgE,CAAC;AAChG,OAAO,YAAY,MAAM,kEAAkE,CAAC;AAC5F,OAAO,kBAAkB,MAAM,gEAAgE,CAAC;AAChG,OAAO,YAAY,MAAM,kEAAkE,CAAC;AAC5F,OAAO,YAAY,MAAM,0DAA0D,CAAC;AACpF,OAAO,MAAM,MAAM,4DAA4D,CAAC;AAChF,OAAO,kBAAkB,MAAM,gEAAgE,CAAC;AAChG,OAAO,YAAY,MAAM,kEAAkE,CAAC;AAC5F,OAAO,iBAAiB,MAAM,+DAA+D,CAAC;AAC9F,OAAO,WAAW,MAAM,iEAAiE,CAAC;AAC1F,OAAO,gBAAgB,MAAM,8DAA8D,CAAC;AA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ACpB,EAAE,EAAC,SAAS,EACZ,QAAQ,EAAC,OAAO,EAChB,OAAO,EAAE,CAAC,EACV,KAAK,EAAC,OAAO,EACb,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,cAAc,EAC1B,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,EAC7B,QAAQ,EAAE,IAAI,GAChB,8BAIA,CACb,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,KAAU,EAAE,EAAE,CAAC,CAChD,MAAC,QAAQ,eACL,MAAC,MAAM,eACH,KAAC,QAAQ,IAAC,IAAI,EAAC,aAAa,EAAC,KAAK,QAAC,EAAE,EAAC,oBAAoB,GAAG,EAC7D,KAAC,QAAQ,IAAC,IAAI,EAAC,aAAa,EAAC,KAAK,QAAC,EAAE,EAAC,kBAAkB,GAAG,EAC3D,KAAC,QAAQ,IAAC,IAAI,EAAC,YAAY,EAAC,KAAK,QAAC,EAAE,EAAC,iBAAiB,GAAG,IACpD,EACT,KAAC,KAAK,KAAG,IACF,CACd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/navigation",
|
|
3
|
-
"version": "11.0.0-canary.237.
|
|
3
|
+
"version": "11.0.0-canary.237.7e21f65.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": "7e21f659803d6fd1ff2e5a324f21e5f8cf0f79dd"
|
|
46
46
|
}
|
|
@@ -130,7 +130,7 @@ export const WithAllMonolithData = () => (
|
|
|
130
130
|
Task Management
|
|
131
131
|
</ProfileDropdown.Link>
|
|
132
132
|
<ProfileDropdown.Divider />
|
|
133
|
-
<ProfileDropdown.Link id="sign-out" to="https://googgle.com">
|
|
133
|
+
<ProfileDropdown.Link id="sign-out" to="https://googgle.com" text="Sign Out">
|
|
134
134
|
Sign Out{' '}
|
|
135
135
|
<span className="c-neutral-100 m-l-half t-truncate">James Bond</span>
|
|
136
136
|
</ProfileDropdown.Link>
|
|
@@ -154,7 +154,7 @@ export const WithAllMonolithData = () => (
|
|
|
154
154
|
Task Management
|
|
155
155
|
</ProfileDropdown.Link>
|
|
156
156
|
<ProfileDropdown.Divider />
|
|
157
|
-
<ProfileDropdown.Link id="sign-out" to="https://googgle.com">
|
|
157
|
+
<ProfileDropdown.Link id="sign-out" to="https://googgle.com" text="Sign Out">
|
|
158
158
|
Sign Out <span className="c-neutral-100 m-l-half t-truncate">James Bond</span>
|
|
159
159
|
</ProfileDropdown.Link>
|
|
160
160
|
<ProfileDropdown.Section id="userid" className="c-neutral-100 fs-1">
|
|
@@ -93,7 +93,7 @@ export const WithAllMonolithData = () => (
|
|
|
93
93
|
Task Management
|
|
94
94
|
</ProfileDropdown.Link>
|
|
95
95
|
<ProfileDropdown.Divider />
|
|
96
|
-
<ProfileDropdown.Link id="sign-out" to="https://googgle.com">
|
|
96
|
+
<ProfileDropdown.Link id="sign-out" to="https://googgle.com" text="Sign Out">
|
|
97
97
|
Sign Out{' '}
|
|
98
98
|
<span className="c-neutral-100 m-l-half t-truncate">James Bond</span>
|
|
99
99
|
</ProfileDropdown.Link>
|
|
@@ -162,7 +162,7 @@ export const WithAllMonolithDataCommercial = () => (
|
|
|
162
162
|
Task Management
|
|
163
163
|
</ProfileDropdown.Link>
|
|
164
164
|
<ProfileDropdown.Divider />
|
|
165
|
-
<ProfileDropdown.Link id="sign-out" to="https://googgle.com">
|
|
165
|
+
<ProfileDropdown.Link id="sign-out" to="https://googgle.com" text="Sign Out">
|
|
166
166
|
Sign Out{' '}
|
|
167
167
|
<span className="c-neutral-100 m-l-half t-truncate">James Bond</span>
|
|
168
168
|
</ProfileDropdown.Link>
|
|
@@ -3,7 +3,7 @@ import { CSSProperties, FC, ReactNode } from 'react';
|
|
|
3
3
|
import { LogoTitanSvg } from './logo-titan';
|
|
4
4
|
import * as Styles from './logo-titan-text.module.less';
|
|
5
5
|
|
|
6
|
-
export type WrapperProps = FC<{ className
|
|
6
|
+
export type WrapperProps = FC<{ className?: string; children: ReactNode; style?: CSSProperties }>;
|
|
7
7
|
|
|
8
8
|
export interface LogoTitanProps {
|
|
9
9
|
mantleFill?: string;
|
|
@@ -6,6 +6,7 @@ import SvgAccountInactive from '@servicetitan/anvil2/assets/icons/st/gnav_accoun
|
|
|
6
6
|
import { BodyText, Popover, PopoverPropsStrict } from '@servicetitan/design-system';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import {
|
|
9
|
+
ComponentPropsWithoutRef,
|
|
9
10
|
FC,
|
|
10
11
|
HTMLAttributeAnchorTarget,
|
|
11
12
|
MouseEvent,
|
|
@@ -147,6 +148,10 @@ const ProfileDropdownTrigger: FC<ProfileDropdownTriggerProps> = ({
|
|
|
147
148
|
);
|
|
148
149
|
};
|
|
149
150
|
|
|
151
|
+
export type ProfileItemContent =
|
|
152
|
+
| { children: string; text?: string }
|
|
153
|
+
| { children: ReactNode; text: string };
|
|
154
|
+
|
|
150
155
|
export interface ProfileDropdownSectionPropsStrict {
|
|
151
156
|
children: ReactNode;
|
|
152
157
|
id: string;
|
|
@@ -155,14 +160,15 @@ export interface ProfileDropdownSectionPropsStrict {
|
|
|
155
160
|
onClick?(e: MouseEvent): void;
|
|
156
161
|
}
|
|
157
162
|
|
|
158
|
-
export
|
|
159
|
-
|
|
160
|
-
|
|
163
|
+
export type ProfileDropdownSectionProps = Omit<ComponentPropsWithoutRef<'div'>, 'children'> &
|
|
164
|
+
ProfileDropdownSectionPropsStrict &
|
|
165
|
+
ProfileItemContent;
|
|
161
166
|
|
|
162
167
|
export const ProfileDropdownSection: FC<ProfileDropdownSectionProps> = ({
|
|
163
168
|
children,
|
|
164
169
|
className,
|
|
165
170
|
id,
|
|
171
|
+
text,
|
|
166
172
|
tooltip,
|
|
167
173
|
onClick,
|
|
168
174
|
...rest
|
|
@@ -206,9 +212,9 @@ export interface ProfileDropdownLinkPropsStrict {
|
|
|
206
212
|
counter?: CounterTagValue;
|
|
207
213
|
}
|
|
208
214
|
|
|
209
|
-
export
|
|
210
|
-
|
|
211
|
-
|
|
215
|
+
export type ProfileDropdownLinkProps = Omit<ComponentPropsWithoutRef<'a'>, 'children'> &
|
|
216
|
+
ProfileDropdownLinkPropsStrict &
|
|
217
|
+
ProfileItemContent;
|
|
212
218
|
|
|
213
219
|
export const ProfileDropdownLink: FC<ProfileDropdownLinkProps> = ({
|
|
214
220
|
children,
|
|
@@ -218,6 +224,7 @@ export const ProfileDropdownLink: FC<ProfileDropdownLinkProps> = ({
|
|
|
218
224
|
counter,
|
|
219
225
|
tag,
|
|
220
226
|
target,
|
|
227
|
+
text,
|
|
221
228
|
to,
|
|
222
229
|
tooltip,
|
|
223
230
|
onClick,
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
background-color: @color-white;
|
|
11
11
|
color: @color-black;
|
|
12
12
|
border-bottom: 1px solid @color-neutral-60;
|
|
13
|
+
box-sizing: border-box;
|
|
13
14
|
|
|
14
15
|
& > * {
|
|
15
16
|
overflow-y: hidden;
|
|
@@ -20,6 +21,10 @@
|
|
|
20
21
|
align-items: center;
|
|
21
22
|
}
|
|
22
23
|
|
|
24
|
+
.he-top-center {
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
}
|
|
27
|
+
|
|
23
28
|
.he-top-right {
|
|
24
29
|
& > * {
|
|
25
30
|
color: @color-black;
|
|
@@ -87,6 +92,7 @@
|
|
|
87
92
|
// desktop
|
|
88
93
|
@media only screen and (min-width: 768px) {
|
|
89
94
|
.header {
|
|
95
|
+
height: var(--nav-offset-top);
|
|
90
96
|
.navigation-link {
|
|
91
97
|
margin: 6px 2px;
|
|
92
98
|
padding: 6px 6px;
|
|
@@ -95,6 +101,12 @@
|
|
|
95
101
|
.he-top-left {
|
|
96
102
|
padding-left: @spacing-1;
|
|
97
103
|
}
|
|
104
|
+
.he-top-center {
|
|
105
|
+
flex: 1;
|
|
106
|
+
margin-left: @spacing-2;
|
|
107
|
+
margin-right: @spacing-2;
|
|
108
|
+
max-width: 400px;
|
|
109
|
+
}
|
|
98
110
|
}
|
|
99
111
|
}
|
|
100
112
|
// desktop wide
|
|
@@ -109,21 +121,37 @@
|
|
|
109
121
|
.he-top-right {
|
|
110
122
|
grid-column: span 1;
|
|
111
123
|
}
|
|
124
|
+
|
|
125
|
+
.he-top-center {
|
|
126
|
+
max-width: unset;
|
|
127
|
+
}
|
|
112
128
|
}
|
|
113
129
|
}
|
|
114
130
|
|
|
115
131
|
// mobile
|
|
116
132
|
@media only screen and (max-width: 768px) {
|
|
117
133
|
.header {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
grid-template-rows: 44px;
|
|
121
|
-
|
|
122
|
-
padding: @spacing-1 @spacing-half;
|
|
134
|
+
padding: @spacing-2 @spacing-0;
|
|
135
|
+
height: var(--nav-offset-top);
|
|
123
136
|
|
|
124
137
|
.navigation-link {
|
|
125
138
|
padding: 10px;
|
|
126
139
|
}
|
|
140
|
+
|
|
141
|
+
.he-top-center {
|
|
142
|
+
max-width: unset;
|
|
143
|
+
flex: 1;
|
|
144
|
+
margin-left: @spacing-3;
|
|
145
|
+
margin-right: @spacing-3;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.he-top-left {
|
|
149
|
+
margin-left: @spacing-half;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.he-top-right {
|
|
153
|
+
margin-right: @spacing-half;
|
|
154
|
+
}
|
|
127
155
|
}
|
|
128
156
|
}
|
|
129
157
|
|
|
@@ -140,7 +168,8 @@
|
|
|
140
168
|
color: @color-white;
|
|
141
169
|
font-weight: @font-weight-semibold;
|
|
142
170
|
font-size: 8px !important;
|
|
143
|
-
min-width:
|
|
171
|
+
min-width: 16px !important;
|
|
172
|
+
height: 16px !important;
|
|
144
173
|
position: absolute;
|
|
145
174
|
top: 4px;
|
|
146
175
|
right: -2px;
|
|
@@ -158,3 +187,12 @@
|
|
|
158
187
|
right: -8px;
|
|
159
188
|
}
|
|
160
189
|
}
|
|
190
|
+
|
|
191
|
+
@media only screen and (min-width: 768px) {
|
|
192
|
+
.navigation-link {
|
|
193
|
+
.navigation-item-counter {
|
|
194
|
+
min-width: 12px !important;
|
|
195
|
+
height: 12px !important;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import SvgBurgerMenu from '@servicetitan/anvil2/assets/icons/material/round/menu.svg';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { ComponentPropsWithoutRef, FC, ReactElement, ReactNode } from 'react';
|
|
4
|
-
import { LayoutPlacementContext
|
|
4
|
+
import { LayoutPlacementContext } from './layout-context';
|
|
5
5
|
import { LayoutHeaderNavigationTrigger } from './layout-header-links';
|
|
6
6
|
import * as Styles from './layout-header.module.less';
|
|
7
7
|
import { TitanLayoutLogoProps } from './layout-logo';
|
|
@@ -25,6 +25,8 @@ export type LayoutHeaderProps = Omit<ComponentPropsWithoutRef<'div'>, 'children'
|
|
|
25
25
|
logo: ReactElement<TitanLayoutLogoProps>;
|
|
26
26
|
profile?: ReactElement;
|
|
27
27
|
|
|
28
|
+
isMobile: boolean;
|
|
29
|
+
hasNotifications: boolean;
|
|
28
30
|
onBurgerClick?: (e: MouseEvent) => void;
|
|
29
31
|
};
|
|
30
32
|
|
|
@@ -35,13 +37,13 @@ export const LayoutHeader: FC<LayoutHeaderProps> = ({
|
|
|
35
37
|
rightClassName,
|
|
36
38
|
center,
|
|
37
39
|
centerClassName,
|
|
40
|
+
isMobile,
|
|
41
|
+
hasNotifications,
|
|
38
42
|
logo,
|
|
39
43
|
profile,
|
|
40
44
|
onBurgerClick,
|
|
41
45
|
...rest
|
|
42
46
|
}) => {
|
|
43
|
-
const { breakpoint } = useTitanLayoutContext();
|
|
44
|
-
|
|
45
47
|
return (
|
|
46
48
|
<LayoutPlacementContext.Provider value="top">
|
|
47
49
|
<div
|
|
@@ -50,7 +52,7 @@ export const LayoutHeader: FC<LayoutHeaderProps> = ({
|
|
|
50
52
|
data-cy="header-navigation"
|
|
51
53
|
>
|
|
52
54
|
<div className={classNames(Styles.heTopLeft)} data-cy="navigation-left">
|
|
53
|
-
{
|
|
55
|
+
{isMobile && (
|
|
54
56
|
<LayoutHeaderNavigationTrigger
|
|
55
57
|
id="burger"
|
|
56
58
|
title=""
|
|
@@ -58,6 +60,7 @@ export const LayoutHeader: FC<LayoutHeaderProps> = ({
|
|
|
58
60
|
iconActive={SvgBurgerMenu}
|
|
59
61
|
className="m-r-1"
|
|
60
62
|
onClick={onBurgerClick}
|
|
63
|
+
tag={{ value: hasNotifications }}
|
|
61
64
|
/>
|
|
62
65
|
)}
|
|
63
66
|
{logo}
|
|
@@ -33,20 +33,27 @@ export const TitanLayoutLogo: FC<TitanLayoutLogoProps> = ({
|
|
|
33
33
|
const Wrapper = logoWrapper;
|
|
34
34
|
const logoSize = isMobile ? 44 : 56;
|
|
35
35
|
const logoCompanySize = 48;
|
|
36
|
+
const showCompanyTitle = title === true && !isMobile;
|
|
36
37
|
|
|
37
38
|
return (
|
|
38
|
-
<div
|
|
39
|
-
{
|
|
39
|
+
<div
|
|
40
|
+
className={classNames(
|
|
41
|
+
'd-f align-items-center',
|
|
42
|
+
{ 'p-t-half': showCompanyTitle },
|
|
43
|
+
className
|
|
44
|
+
)}
|
|
45
|
+
>
|
|
46
|
+
{showCompanyTitle ? (
|
|
47
|
+
<Wrapper>
|
|
48
|
+
<LogoCompanyTitle height={logoCompanySize} />
|
|
49
|
+
</Wrapper>
|
|
50
|
+
) : typeof title === 'string' ? (
|
|
40
51
|
<Fragment>
|
|
41
52
|
<LogoTitan size={logoSize} mantleFill={mantleFill} logoWrapper={Wrapper} />
|
|
42
53
|
{!isMobile && (
|
|
43
54
|
<LogoTitanTitle className="c-inherit m-l-1">{title}</LogoTitanTitle>
|
|
44
55
|
)}
|
|
45
56
|
</Fragment>
|
|
46
|
-
) : title === true && !isMobile ? (
|
|
47
|
-
<Wrapper className="">
|
|
48
|
-
<LogoCompanyTitle height={logoCompanySize} />
|
|
49
|
-
</Wrapper>
|
|
50
57
|
) : (
|
|
51
58
|
<LogoTitan size={logoSize} mantleFill={mantleFill} logoWrapper={Wrapper} />
|
|
52
59
|
)}
|
|
@@ -18,7 +18,7 @@ export default {
|
|
|
18
18
|
|
|
19
19
|
export const ProfileDefault = withTitanLayout(
|
|
20
20
|
<ProfileDropdown>
|
|
21
|
-
<ProfileDropdown.Link id="first" to="https://google.com">
|
|
21
|
+
<ProfileDropdown.Link id="first" to="https://google.com" external>
|
|
22
22
|
first link
|
|
23
23
|
</ProfileDropdown.Link>
|
|
24
24
|
<ProfileDropdown.Section id="second" onClick={() => alert('second click')}>
|
|
@@ -33,5 +33,14 @@ export const ProfileDefault = withTitanLayout(
|
|
|
33
33
|
third link
|
|
34
34
|
</ProfileDropdown.Link>
|
|
35
35
|
<ProfileDropdown.Divider />
|
|
36
|
+
<ProfileDropdown.Section
|
|
37
|
+
id="forth"
|
|
38
|
+
onClick={() => alert('forth click')}
|
|
39
|
+
text="Sign Out user"
|
|
40
|
+
>
|
|
41
|
+
Sign Out
|
|
42
|
+
<span className="c-neutral-60 m-l-1">user</span>
|
|
43
|
+
</ProfileDropdown.Section>
|
|
44
|
+
<ProfileDropdown.Divider />
|
|
36
45
|
</ProfileDropdown>
|
|
37
46
|
);
|