@servicetitan/navigation 3.3.0 → 4.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.map +1 -1
- package/dist/components/header-navigation/header-navigation-content.js +3 -3
- package/dist/components/header-navigation/header-navigation-content.js.map +1 -1
- package/dist/components/header-navigation/header-navigation-extra.stories.d.ts +3 -3
- package/dist/components/header-navigation/header-navigation-extra.stories.d.ts.map +1 -1
- package/dist/components/header-navigation/header-navigation-extra.stories.js +8 -22
- package/dist/components/header-navigation/header-navigation-extra.stories.js.map +1 -1
- package/dist/components/header-navigation/header-navigation-links.d.ts +3 -30
- package/dist/components/header-navigation/header-navigation-links.d.ts.map +1 -1
- package/dist/components/header-navigation/header-navigation-links.js +8 -5
- package/dist/components/header-navigation/header-navigation-links.js.map +1 -1
- package/dist/components/header-navigation/header-navigation-stacked.stories.d.ts +1 -0
- package/dist/components/header-navigation/header-navigation-stacked.stories.d.ts.map +1 -1
- package/dist/components/header-navigation/header-navigation-stacked.stories.js +8 -26
- package/dist/components/header-navigation/header-navigation-stacked.stories.js.map +1 -1
- package/dist/components/header-navigation/header-navigation.d.ts +1 -28
- package/dist/components/header-navigation/header-navigation.d.ts.map +1 -1
- package/dist/components/header-navigation/header-navigation.js +5 -8
- package/dist/components/header-navigation/header-navigation.js.map +1 -1
- package/dist/components/header-navigation/header-navigation.module.less +13 -70
- package/dist/components/header-navigation/header-navigation.stories.d.ts +1 -0
- package/dist/components/header-navigation/header-navigation.stories.d.ts.map +1 -1
- package/dist/components/header-navigation/header-navigation.stories.js +9 -27
- package/dist/components/header-navigation/header-navigation.stories.js.map +1 -1
- package/dist/components/header-navigation/index.d.ts +0 -1
- package/dist/components/header-navigation/index.d.ts.map +1 -1
- package/dist/components/header-navigation/index.js +0 -1
- package/dist/components/header-navigation/index.js.map +1 -1
- package/dist/components/layout.stories.d.ts +1 -0
- package/dist/components/layout.stories.d.ts.map +1 -1
- package/dist/components/layout.stories.js +4 -2
- package/dist/components/layout.stories.js.map +1 -1
- package/dist/components/left-navigation/header-navigation-tiny-links.d.ts +16 -0
- package/dist/components/left-navigation/header-navigation-tiny-links.d.ts.map +1 -0
- package/dist/components/left-navigation/header-navigation-tiny-links.js +43 -0
- package/dist/components/left-navigation/header-navigation-tiny-links.js.map +1 -0
- package/dist/components/left-navigation/header-navigation-tiny.d.ts +23 -0
- package/dist/components/left-navigation/header-navigation-tiny.d.ts.map +1 -0
- package/dist/components/left-navigation/header-navigation-tiny.js +7 -0
- package/dist/components/left-navigation/header-navigation-tiny.js.map +1 -0
- package/dist/components/left-navigation/header-navigation-tiny.module.less +109 -0
- package/dist/components/{header-navigation → left-navigation}/header-navigation-tiny.stories.d.ts +2 -2
- package/dist/components/left-navigation/header-navigation-tiny.stories.d.ts.map +1 -0
- package/dist/components/left-navigation/header-navigation-tiny.stories.js +30 -0
- package/dist/components/left-navigation/header-navigation-tiny.stories.js.map +1 -0
- package/dist/components/left-navigation/index.d.ts +3 -0
- package/dist/components/left-navigation/index.d.ts.map +1 -0
- package/dist/components/left-navigation/index.js +3 -0
- package/dist/components/left-navigation/index.js.map +1 -0
- package/dist/components/{side-navigation → left-navigation}/side-navigation.d.ts +1 -12
- package/dist/components/left-navigation/side-navigation.d.ts.map +1 -0
- package/dist/components/left-navigation/side-navigation.js +23 -0
- package/dist/components/left-navigation/side-navigation.js.map +1 -0
- package/dist/components/{side-navigation → left-navigation}/side-navigation.module.less +28 -22
- package/dist/components/left-navigation/side-navigation.stories.d.ts +10 -0
- package/dist/components/left-navigation/side-navigation.stories.d.ts.map +1 -0
- package/dist/components/left-navigation/side-navigation.stories.js +31 -0
- package/dist/components/left-navigation/side-navigation.stories.js.map +1 -0
- package/dist/components/links.d.ts +5 -0
- package/dist/components/links.d.ts.map +1 -0
- package/dist/components/links.js +14 -0
- package/dist/components/links.js.map +1 -0
- package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.d.ts +2 -8
- package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.d.ts.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.js +5 -43
- package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.js.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown-tiny.stories.d.ts +9 -0
- package/dist/components/profile-dropdown/profile-dropdown-tiny.stories.d.ts.map +1 -0
- package/dist/components/profile-dropdown/profile-dropdown-tiny.stories.js +13 -0
- package/dist/components/profile-dropdown/profile-dropdown-tiny.stories.js.map +1 -0
- package/dist/components/profile-dropdown/profile-dropdown.d.ts +2 -1
- package/dist/components/profile-dropdown/profile-dropdown.d.ts.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown.js +16 -7
- package/dist/components/profile-dropdown/profile-dropdown.js.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown.module.less +7 -1
- package/dist/components/profile-dropdown/profile-dropdown.stories.d.ts +9 -8
- package/dist/components/profile-dropdown/profile-dropdown.stories.d.ts.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown.stories.js +39 -39
- package/dist/components/profile-dropdown/profile-dropdown.stories.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/test/data-stories.module.less +8 -0
- package/dist/test/data.stories.d.ts +26 -0
- package/dist/test/data.stories.d.ts.map +1 -0
- package/dist/test/data.stories.js +151 -0
- package/dist/test/data.stories.js.map +1 -0
- package/dist/utils/navigation-context.d.ts +2 -2
- package/dist/utils/navigation-context.d.ts.map +1 -1
- package/dist/utils/navigation-context.js +18 -5
- package/dist/utils/navigation-context.js.map +1 -1
- package/dist/utils/navigation.d.ts +47 -0
- package/dist/utils/navigation.d.ts.map +1 -1
- package/package.json +11 -11
- package/src/components/header-navigation/header-navigation-content.tsx +3 -3
- package/src/components/header-navigation/header-navigation-extra.stories.tsx +29 -38
- package/src/components/header-navigation/header-navigation-links.tsx +19 -41
- package/src/components/header-navigation/header-navigation-stacked.stories.tsx +18 -70
- package/src/components/header-navigation/header-navigation.module.less +13 -70
- package/src/components/header-navigation/header-navigation.module.less.d.ts +0 -1
- package/src/components/header-navigation/header-navigation.stories.tsx +20 -71
- package/src/components/header-navigation/header-navigation.tsx +6 -82
- package/src/components/header-navigation/index.ts +0 -1
- package/src/components/layout.stories.tsx +4 -2
- package/src/components/left-navigation/header-navigation-tiny-links.tsx +110 -0
- package/src/components/left-navigation/header-navigation-tiny.module.less +109 -0
- package/src/components/left-navigation/header-navigation-tiny.module.less.d.ts +14 -0
- package/src/components/{header-navigation → left-navigation}/header-navigation-tiny.stories.tsx +39 -46
- package/src/components/left-navigation/header-navigation-tiny.tsx +65 -0
- package/src/components/left-navigation/index.ts +2 -0
- package/src/components/{side-navigation → left-navigation}/side-navigation.module.less +28 -22
- package/src/components/{side-navigation → left-navigation}/side-navigation.module.less.d.ts +3 -3
- package/src/components/left-navigation/side-navigation.stories.tsx +46 -0
- package/src/components/left-navigation/side-navigation.tsx +171 -0
- package/src/components/links.tsx +31 -0
- package/src/components/profile-dropdown/profile-dropdown-stacked.stories.tsx +5 -170
- package/src/components/profile-dropdown/profile-dropdown-tiny.stories.tsx +15 -0
- package/src/components/profile-dropdown/profile-dropdown.module.less +7 -1
- package/src/components/profile-dropdown/profile-dropdown.module.less.d.ts +1 -0
- package/src/components/profile-dropdown/profile-dropdown.stories.tsx +106 -129
- package/src/components/profile-dropdown/profile-dropdown.tsx +35 -8
- package/src/index.ts +2 -1
- package/src/test/data-stories.module.less +8 -0
- package/src/test/data-stories.module.less.d.ts +3 -0
- package/src/test/data.stories.tsx +223 -0
- package/src/utils/navigation-context.tsx +10 -10
- package/src/utils/navigation.ts +54 -0
- package/dist/components/header-navigation/header-navigation-tiny.stories.d.ts.map +0 -1
- package/dist/components/header-navigation/header-navigation-tiny.stories.js +0 -25
- package/dist/components/header-navigation/header-navigation-tiny.stories.js.map +0 -1
- package/dist/components/side-navigation/icons.d.ts +0 -7
- package/dist/components/side-navigation/icons.d.ts.map +0 -1
- package/dist/components/side-navigation/icons.js +0 -5
- package/dist/components/side-navigation/icons.js.map +0 -1
- package/dist/components/side-navigation/index.d.ts +0 -2
- package/dist/components/side-navigation/index.d.ts.map +0 -1
- package/dist/components/side-navigation/index.js +0 -2
- package/dist/components/side-navigation/index.js.map +0 -1
- package/dist/components/side-navigation/side-navigation.d.ts.map +0 -1
- package/dist/components/side-navigation/side-navigation.js +0 -37
- package/dist/components/side-navigation/side-navigation.js.map +0 -1
- package/dist/components/side-navigation/side-navigation.stories.d.ts +0 -10
- package/dist/components/side-navigation/side-navigation.stories.d.ts.map +0 -1
- package/dist/components/side-navigation/side-navigation.stories.js +0 -52
- package/dist/components/side-navigation/side-navigation.stories.js.map +0 -1
- package/src/components/side-navigation/icons.tsx +0 -74
- package/src/components/side-navigation/index.ts +0 -1
- package/src/components/side-navigation/side-navigation.stories.tsx +0 -95
- package/src/components/side-navigation/side-navigation.tsx +0 -224
|
@@ -3,6 +3,7 @@ declare const _default: {
|
|
|
3
3
|
title: string;
|
|
4
4
|
component: FC<import("./header-navigation").HeaderNavigationProps>;
|
|
5
5
|
parameters: {};
|
|
6
|
+
decorators: ((Story: any) => import("react/jsx-runtime").JSX.Element)[];
|
|
6
7
|
};
|
|
7
8
|
export default _default;
|
|
8
9
|
export declare const defaultNavigation: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header-navigation.stories.d.ts","sourceRoot":"","sources":["../../../src/components/header-navigation/header-navigation.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC
|
|
1
|
+
{"version":3,"file":"header-navigation.stories.d.ts","sourceRoot":"","sources":["../../../src/components/header-navigation/header-navigation.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;;;;;;;AASrC,wBAKE;AAGF,eAAO,MAAM,iBAAiB,+CAY7B,CAAC;AAEF,eAAO,MAAM,uBAAuB,+CAoBnC,CAAC;AAiCF,eAAO,MAAM,mBAAmB,+CA0E/B,CAAC"}
|
|
@@ -1,38 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Popover } from '@servicetitan/design-system';
|
|
3
3
|
import { useState } from 'react';
|
|
4
|
+
import { SearchIcon, items, withMemoryRouter } from '../../test/data.stories';
|
|
4
5
|
import { LogoCompanyTitle } from '../logo/logo-company-title';
|
|
5
6
|
import { LogoTitanText } from '../logo/logo-titan-text';
|
|
6
7
|
import { ProfileDropdown } from '../profile-dropdown/profile-dropdown';
|
|
8
|
+
import { HeaderNavigationLink, HeaderNavigationTrigger } from './header-navigation-links';
|
|
7
9
|
import * as Styles from './header-navigation-stories.module.less';
|
|
8
|
-
import { HeaderNavigation
|
|
10
|
+
import { HeaderNavigation } from './';
|
|
9
11
|
export default {
|
|
10
12
|
title: 'Navigation/HeaderNavigation',
|
|
11
13
|
component: HeaderNavigation,
|
|
12
14
|
parameters: {},
|
|
15
|
+
decorators: [withMemoryRouter],
|
|
13
16
|
};
|
|
14
|
-
const
|
|
15
|
-
const InventoryIcon = () => (_jsxs("svg", { width: "20", xmlns: "http://www.w3.org/2000/svg", viewBox: "-293 385 24 24", fill: "currentColor", children: [_jsx("polyline", { points: "-288,400.9 -282,404.3 -282,397.6 -288,394.2 -288,400.9 " }), _jsx("path", { d: "M-272,401.5c0,0.4-0.2,0.7-0.5,0.9l-7.9,4.4c-0.2,0.1-0.4,0.2-0.6,0.2s-0.4-0.1-0.6-0.2l-7.9-4.4c-0.3-0.2-0.5-0.5-0.5-0.9v-9c0-0.4,0.2-0.7,0.5-0.9l7.9-4.4c0.2-0.1,0.4-0.2,0.6-0.2s0.4,0.1,0.6,0.2l7.9,4.4c0.3,0.2,0.5,0.5,0.5,0.9V401.5 M-287,392.5 l6,3.4l5.9-3.3l-5.9-3.4L-287,392.5 M-274,400.9v-6.7l-6,3.4v6.7L-274,400.9z" })] }));
|
|
16
|
-
const SearchIcon = () => (_jsx("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("g", { transform: "translate(0,4)", children: _jsx("path", { d: "M0 15.7992V13.9992H12V15.7992H0ZM0 9.49922V7.69922H6V9.49922H0ZM0 3.19922V1.39922H6V3.19922H0ZM22.74 15.7992L17.94 10.9992C17.42 11.3992 16.86 11.6992 16.26 11.8992C15.66 12.0992 15.04 12.1992 14.4 12.1992C12.74 12.1992 11.325 11.6142 10.155 10.4442C8.985 9.27422 8.4 7.85922 8.4 6.19922C8.4 4.53922 8.985 3.12422 10.155 1.95422C11.325 0.784219 12.74 0.199219 14.4 0.199219C16.06 0.199219 17.475 0.784219 18.645 1.95422C19.815 3.12422 20.4 4.53922 20.4 6.19922C20.4 6.83922 20.3 7.45922 20.1 8.05922C19.9 8.65922 19.6 9.21922 19.2 9.73922L24 14.5392L22.74 15.7992ZM14.393 10.3992C15.5577 10.3992 16.55 9.99157 17.37 9.17627C18.19 8.36099 18.6 7.37099 18.6 6.20627C18.6 5.04157 18.1923 4.04922 17.377 3.22922C16.5618 2.40922 15.5718 1.99922 14.407 1.99922C13.2423 1.99922 12.25 2.40687 11.43 3.22217C10.61 4.03745 10.2 5.02745 10.2 6.19217C10.2 7.35687 10.6077 8.34922 11.423 9.16922C12.2382 9.98922 13.2282 10.3992 14.393 10.3992Z", fill: "white" }) }) }));
|
|
17
|
-
const items = {
|
|
18
|
-
calendar: getItem('calendar', { iconName: 'event' }),
|
|
19
|
-
calls: getItem('calls', { iconName: 'local_phone', isActive: true, counter: 12 }),
|
|
20
|
-
dashboard: getItem('dashboard', { iconName: 'odometer', isActive: true }),
|
|
21
|
-
dispatch: getItem('dispatch', { iconName: 'location_disabled', counter: 1 }),
|
|
22
|
-
fleet: getItem('fleet', { iconName: 'fleet-pro', title: 'Fleet Pro' }),
|
|
23
|
-
followUps: getItem('followUps', { iconName: 'flag', title: 'Follow Ups' }),
|
|
24
|
-
inventory: getItem('inventory', { iconName: 'toys' }),
|
|
25
|
-
purchasing: getItem('purchasing', { iconComponent: InventoryIcon }),
|
|
26
|
-
accounting: getItem('accounting', { iconName: 'assignment' }),
|
|
27
|
-
marketing: getItem('marketing', { iconName: 'bullhorn' }),
|
|
28
|
-
priceBook: getItem('priceBook', { iconName: 'book' }),
|
|
29
|
-
pointOfSale: getItem('pointOfSale', { iconName: 'cash-register' }),
|
|
30
|
-
projects: getItem('projects', { iconName: 'folder_special' }),
|
|
31
|
-
reports: getItem('reports', { iconName: 'poll' }),
|
|
32
|
-
};
|
|
33
|
-
const NavLinkMock = props => (_jsx("a", { href: props.to, target: props.target, onClick: e => {
|
|
34
|
-
e.preventDefault();
|
|
35
|
-
}, className: props.className, children: props.children }));
|
|
17
|
+
const SvgIcon = undefined;
|
|
36
18
|
export const defaultNavigation = () => (_jsx(HeaderNavigation, { left: _jsx(LogoCompanyTitle, { className: "m-l-1", fill: "#fff" }), items: [
|
|
37
19
|
items.dashboard,
|
|
38
20
|
items.calendar,
|
|
@@ -40,7 +22,7 @@ export const defaultNavigation = () => (_jsx(HeaderNavigation, { left: _jsx(Logo
|
|
|
40
22
|
items.accounting,
|
|
41
23
|
items.dispatch,
|
|
42
24
|
items.fleet,
|
|
43
|
-
]
|
|
25
|
+
] }));
|
|
44
26
|
export const withLogoTextAndOverflow = () => (_jsx(HeaderNavigation, { left: _jsx(LogoTitanText, { mantleFill: "#2270EE", title: "Commercial", description: "tenant tenant tenant tenant tenant" }), items: [
|
|
45
27
|
items.dashboard,
|
|
46
28
|
items.calendar,
|
|
@@ -49,10 +31,10 @@ export const withLogoTextAndOverflow = () => (_jsx(HeaderNavigation, { left: _js
|
|
|
49
31
|
items.dispatch,
|
|
50
32
|
items.purchasing,
|
|
51
33
|
items.fleet,
|
|
52
|
-
], itemsOverflow: [items.calls, items.accounting, items.purchasing, items.dispatch]
|
|
34
|
+
], itemsOverflow: [items.calls, items.accounting, items.purchasing, items.dispatch] }));
|
|
53
35
|
const HelpCenterButton = () => {
|
|
54
36
|
const [open, setOpen] = useState(false);
|
|
55
|
-
return (_jsx(Popover, { onClickOutside: () => setOpen(false), open: open, direction: "bl", width: "xs", trigger: _jsx(HeaderNavigationTrigger, { id: "help", iconName: "help_outline", onClick: () => setOpen(true) }), portal: true, children: "help center" }));
|
|
37
|
+
return (_jsx(Popover, { onClickOutside: () => setOpen(false), open: open, direction: "bl", width: "xs", trigger: _jsx(HeaderNavigationTrigger, { id: "help", iconName: "help_outline", onClick: () => setOpen(true), icon: SvgIcon, iconActive: SvgIcon }), portal: true, children: "help center" }));
|
|
56
38
|
};
|
|
57
39
|
const TimeZoneOffset = () => (_jsx("div", { className: "fs-2 ff-default p-r-2", children: _jsx("span", { children: "EST (-9 hrs)" }) }));
|
|
58
40
|
export const withAllMonolithData = () => (_jsxs(HeaderNavigation, { left: _jsx(LogoCompanyTitle, { className: "m-l-1", fill: "#fff" }), items: [
|
|
@@ -68,5 +50,5 @@ export const withAllMonolithData = () => (_jsxs(HeaderNavigation, { left: _jsx(L
|
|
|
68
50
|
items.priceBook,
|
|
69
51
|
items.pointOfSale,
|
|
70
52
|
items.reports,
|
|
71
|
-
],
|
|
53
|
+
], children: [_jsx(TimeZoneOffset, {}), _jsx(HeaderNavigationTrigger, { id: "dialpad", iconName: "phone", counter: 2, icon: SvgIcon, iconActive: SvgIcon }), _jsx(HeaderNavigationLink, { id: "search", to: "https://google.com", target: "_blank", iconComponent: SearchIcon, hint: "Search: for all the questions", icon: SvgIcon, iconActive: SvgIcon }), _jsx(HelpCenterButton, {}), _jsx(HeaderNavigationTrigger, { id: "titanAdvisor", iconName: "rocket", iconClassName: Styles.rocketIcon, icon: SvgIcon, iconActive: SvgIcon }), _jsx(HeaderNavigationLink, { id: "settings", to: "https://google.com", target: "_blank", iconName: "settings", "aria-label": "search", hint: "Settings", isActive: true, icon: SvgIcon, iconActive: SvgIcon }), _jsxs(ProfileDropdown, { children: [_jsx(ProfileDropdown.Link, { id: "tasks", to: "https://googgle.com", counter: 10, children: "Task Management" }), _jsx(ProfileDropdown.Divider, {}), _jsxs(ProfileDropdown.Link, { id: "sign-out", to: "https://googgle.com", children: ["Sign Out ", _jsx("span", { className: "c-neutral-100 m-l-half t-truncate", children: "James Bond" })] }), _jsx(ProfileDropdown.Section, { id: "userid", className: "c-neutral-100 fs-1", children: "User ID: 007" })] })] }));
|
|
72
54
|
//# sourceMappingURL=header-navigation.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header-navigation.stories.js","sourceRoot":"","sources":["../../../src/components/header-navigation/header-navigation.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"header-navigation.stories.js","sourceRoot":"","sources":["../../../src/components/header-navigation/header-navigation.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC1F,OAAO,KAAK,MAAM,MAAM,yCAAyC,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAC;AAEtC,eAAe;IACX,KAAK,EAAE,6BAA6B;IACpC,SAAS,EAAE,gBA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,uBAAuB,IACpB,EAAE,EAAC,cAAc,EACjB,QAAQ,EAAC,QAAQ,EACjB,aAAa,EAAE,MAAM,CAAC,UAAU,EAChC,IAAI,EAAE,OAAO,EACb,UAAU,EAAE,OAAO,GACrB,EAEF,KAAC,oBAAoB,IACjB,EAAE,EAAC,UAAU,EACb,EAAE,EAAC,oBAAoB,EACvB,MAAM,EAAC,QAAQ,EACf,QAAQ,EAAC,UAAU,gBACR,QAAQ,EACnB,IAAI,EAAC,UAAU,EACf,QAAQ,QACR,IAAI,EAAE,OAAO,EACb,UAAU,EAAE,OAAO,GACrB,EAEF,MAAC,eAAe,eACZ,KAAC,eAAe,CAAC,IAAI,IAAC,EAAE,EAAC,OAAO,EAAC,EAAE,EAAC,qBAAqB,EAAC,OAAO,EAAE,EAAE,gCAE9C,EACvB,KAAC,eAAe,CAAC,OAAO,KAAG,EAC3B,MAAC,eAAe,CAAC,IAAI,IAAC,EAAE,EAAC,UAAU,EAAC,EAAE,EAAC,qBAAqB,0BAC/C,eAAM,SAAS,EAAC,mCAAmC,2BAAkB,IAC3D,EACvB,KAAC,eAAe,CAAC,OAAO,IAAC,EAAE,EAAC,QAAQ,EAAC,SAAS,EAAC,oBAAoB,6BAEzC,IACZ,IACH,CACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/header-navigation/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/header-navigation/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/header-navigation/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/header-navigation/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.stories.d.ts","sourceRoot":"","sources":["../../src/components/layout.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"layout.stories.d.ts","sourceRoot":"","sources":["../../src/components/layout.stories.tsx"],"names":[],"mappings":";;;;;AAOA,wBAIE;AAEF,eAAO,MAAM,aAAa,+CAUzB,CAAC;AAEF,eAAO,MAAM,uBAAuB,+CAUnC,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { withAnvil, withMemoryRouter } from '../test/data.stories';
|
|
3
|
+
import { WithAllMonolithData, WithAllMonolithDataCommercial, } from './left-navigation/header-navigation-tiny.stories';
|
|
4
|
+
import { DefaultSideNavigation } from './left-navigation/side-navigation.stories';
|
|
4
5
|
export default {
|
|
5
6
|
title: 'Navigation/Layout',
|
|
6
7
|
parameters: {},
|
|
8
|
+
decorators: [withMemoryRouter, withAnvil],
|
|
7
9
|
};
|
|
8
10
|
export const LeftNavLayout = () => {
|
|
9
11
|
return (_jsxs("div", { className: "d-f border flex-column", style: { height: '800px' }, children: [_jsx(WithAllMonolithData, {}), _jsxs("div", { className: "flex-grow-1 flex-basis-0 d-f", children: [_jsx(DefaultSideNavigation, {}), _jsx("div", { className: "flex-grow-1 flex-basis-0" })] })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.stories.js","sourceRoot":"","sources":["../../src/components/layout.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EACH,mBAAmB,EACnB,6BAA6B,GAChC,MAAM,
|
|
1
|
+
{"version":3,"file":"layout.stories.js","sourceRoot":"","sources":["../../src/components/layout.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EACH,mBAAmB,EACnB,6BAA6B,GAChC,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAElF,eAAe;IACX,KAAK,EAAE,mBAAmB;IAC1B,UAAU,EAAE,EAAE;IACd,UAAU,EAAE,CAAC,gBAAgB,EAAE,SAAS,CAAC;CAC5C,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAC9B,OAAO,CACH,eAAK,SAAS,EAAC,wBAAwB,EAAC,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,aAC9D,KAAC,mBAAmB,KAAG,EACvB,eAAK,SAAS,EAAC,8BAA8B,aACzC,KAAC,qBAAqB,KAAG,EACzB,cAAK,SAAS,EAAC,0BAA0B,GAAG,IAC1C,IACJ,CACT,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,EAAE;IACxC,OAAO,CACH,eAAK,SAAS,EAAC,wBAAwB,EAAC,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,aAC9D,KAAC,6BAA6B,KAAG,EACjC,eAAK,SAAS,EAAC,8BAA8B,aACzC,KAAC,qBAAqB,KAAG,EACzB,cAAK,SAAS,EAAC,0BAA0B,GAAG,IAC1C,IACJ,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IconProps } from '@servicetitan/anvil2';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
import { HeaderNavigationLinkProps, HeaderNavigationTriggerProps } from '../../utils/navigation';
|
|
4
|
+
import { CounterTagPropsType } from '../counter-tag';
|
|
5
|
+
/** Content for navigation items */
|
|
6
|
+
export declare const HeaderNavigationItemContent: FC<{
|
|
7
|
+
counter?: CounterTagPropsType;
|
|
8
|
+
counterClassName?: string;
|
|
9
|
+
icon: IconProps['svg'] | undefined;
|
|
10
|
+
iconActive: IconProps['svg'] | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
/** Navigation extra item with link */
|
|
13
|
+
export declare const HeaderNavigationLink: FC<HeaderNavigationLinkProps>;
|
|
14
|
+
/** Navigation extra item with icon button */
|
|
15
|
+
export declare const HeaderNavigationTrigger: FC<HeaderNavigationTriggerProps>;
|
|
16
|
+
//# sourceMappingURL=header-navigation-tiny-links.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header-navigation-tiny-links.d.ts","sourceRoot":"","sources":["../../../src/components/left-navigation/header-navigation-tiny-links.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,EAAE,EAAwB,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,yBAAyB,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAGjG,OAAO,EAAc,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAGjE,mCAAmC;AACnC,eAAO,MAAM,2BAA2B,EAAE,EAAE,CAAC;IACzC,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;IACnC,UAAU,EAAE,SAAS,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;CAC5C,CAoBA,CAAC;AAEF,sCAAsC;AACtC,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CAmC9D,CAAC;AAEF,6CAA6C;AAC7C,eAAO,MAAM,uBAAuB,EAAE,EAAE,CAAC,4BAA4B,CAiCpE,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { createElement as _createElement } from "react";
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { Icon } from '@servicetitan/anvil2';
|
|
15
|
+
import classNames from 'classnames';
|
|
16
|
+
import { Fragment, useContext } from 'react';
|
|
17
|
+
import { NavigationComponentContext } from '../../utils/navigation-context';
|
|
18
|
+
import { withTooltip } from '../../utils/with-tooltip';
|
|
19
|
+
import { CounterTag } from '../counter-tag';
|
|
20
|
+
import * as Styles from './header-navigation-tiny.module.less';
|
|
21
|
+
/** Content for navigation items */
|
|
22
|
+
export const HeaderNavigationItemContent = ({ counter, counterClassName, icon, iconActive }) => {
|
|
23
|
+
return (_jsxs(Fragment, { children: [!!icon && _jsx(Icon, { svg: icon, className: Styles.navigationIcon }), !!iconActive && (_jsx(Icon, { svg: iconActive, className: classNames(Styles.navigationIcon, Styles.navigationIconActive) })), !!counter && (_jsx(CounterTag, { data: counter, className: classNames(Styles.navigationItemCounter, counterClassName), longClassName: Styles.navigationItemCounterLong }))] }));
|
|
24
|
+
};
|
|
25
|
+
/** Navigation extra item with link */
|
|
26
|
+
export const HeaderNavigationLink = (_a) => {
|
|
27
|
+
var { id, to, hint, tooltip, counter, className, icon, iconActive, isActive, target } = _a, rest = __rest(_a, ["id", "to", "hint", "tooltip", "counter", "className", "icon", "iconActive", "isActive", "target"]);
|
|
28
|
+
const NavigationComponent = useContext(NavigationComponentContext);
|
|
29
|
+
return withTooltip(_createElement(NavigationComponent, Object.assign({ "data-cy": `navigation-link-${id}`, "data-pendo": `navigation-link-${id}` }, rest, { key: id, to: to, title: hint, className: classNames(Styles.navigationLink, className, {
|
|
30
|
+
[Styles.navigationItemActive]: isActive === true,
|
|
31
|
+
[Styles.navigationItemIconState]: !!icon && !!iconActive,
|
|
32
|
+
}), isActive: typeof isActive === 'function' ? isActive : undefined, activeClassName: Styles.navigationItemActive, target: target }),
|
|
33
|
+
_jsx(HeaderNavigationItemContent, { counter: counter, icon: icon, iconActive: iconActive })), tooltip);
|
|
34
|
+
};
|
|
35
|
+
/** Navigation extra item with icon button */
|
|
36
|
+
export const HeaderNavigationTrigger = (_a) => {
|
|
37
|
+
var { id, className, counter, icon, iconActive, isActive, hint, tooltip, title, titleClassName } = _a, rest = __rest(_a, ["id", "className", "counter", "icon", "iconActive", "isActive", "hint", "tooltip", "title", "titleClassName"]);
|
|
38
|
+
return withTooltip(_jsx("div", Object.assign({ "data-cy": `navigation-trigger-${id}`, "data-pendo": `navigation-trigger-${id}` }, rest, { title: hint, className: classNames(Styles.navigationLink, {
|
|
39
|
+
[Styles.navigationItemActive]: isActive === true,
|
|
40
|
+
[Styles.navigationItemIconState]: !!icon && !!iconActive,
|
|
41
|
+
}, 'cursor-pointer', className), children: _jsx(HeaderNavigationItemContent, { counter: counter, icon: icon, iconActive: iconActive }) })), tooltip);
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=header-navigation-tiny-links.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header-navigation-tiny-links.js","sourceRoot":"","sources":["../../../src/components/left-navigation/header-navigation-tiny-links.tsx"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAa,MAAM,sBAAsB,CAAC;AACvD,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAM,QAAQ,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MA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ACN,OAAO,CACV,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FC, ReactElement, ReactNode } from 'react';
|
|
2
|
+
export interface HeaderNavigationTinyProps {
|
|
3
|
+
/** container class name */
|
|
4
|
+
className?: string;
|
|
5
|
+
/** extra navigation */
|
|
6
|
+
right?: ReactNode;
|
|
7
|
+
/** extra navigation container class name */
|
|
8
|
+
rightClassName?: string;
|
|
9
|
+
/** container id */
|
|
10
|
+
id?: string;
|
|
11
|
+
/** left content (usually used for logo) */
|
|
12
|
+
left?: ReactElement;
|
|
13
|
+
/** left container class name */
|
|
14
|
+
leftClassName?: string;
|
|
15
|
+
/** center content */
|
|
16
|
+
center?: ReactElement;
|
|
17
|
+
/** center container class name */
|
|
18
|
+
centerClassName?: string;
|
|
19
|
+
/** minimal width for navigation bar */
|
|
20
|
+
minWidth?: number;
|
|
21
|
+
}
|
|
22
|
+
export declare const HeaderNavigationTiny: FC<HeaderNavigationTinyProps>;
|
|
23
|
+
//# sourceMappingURL=header-navigation-tiny.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header-navigation-tiny.d.ts","sourceRoot":"","sources":["../../../src/components/left-navigation/header-navigation-tiny.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGpD,MAAM,WAAW,yBAAyB;IACtC,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uBAAuB;IACvB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,4CAA4C;IAC5C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,2CAA2C;IAC3C,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,gCAAgC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qBAAqB;IACrB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,kCAAkC;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CAuC9D,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import * as Styles from './header-navigation-tiny.module.less';
|
|
4
|
+
export const HeaderNavigationTiny = ({ className, id, left, leftClassName, right, rightClassName, center, centerClassName, minWidth = 800, }) => {
|
|
5
|
+
return (_jsxs("div", { className: classNames(Styles.headerTiny, className), style: { minWidth: `${minWidth}px` }, id: id, "data-cy": "header-navigation", children: [_jsx("div", { className: classNames(Styles.heTopLeft, leftClassName), "data-cy": "navigation-left", children: left }), _jsx("div", { className: classNames(Styles.heTopCenter, centerClassName), "data-cy": "navigation-center", children: center }), _jsx("div", { className: classNames('d-f flex-row justify-content-end align-items-center', Styles.heTopRight, rightClassName), "data-cy": "navigation-right", children: right })] }));
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=header-navigation-tiny.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header-navigation-tiny.js","sourceRoot":"","sources":["../../../src/components/left-navigation/header-navigation-tiny.tsx"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,KAAK,MAAM,MAAM,sCAAsC,CAAC;AAuB/D,MAAM,CAAC,MAAM,oBAAoB,GAAkC,CAAC,EAChE,SAAS,EACT,EAAE,EACF,IAAI,EACJ,aAAa,EACb,KAAK,EACL,cAAc,EACd,MAAM,EACN,eAAe,EACf,QAAQ,GAAG,GAAG,GACjB,EAAE,EAAE;IACD,OAAO,CACH,eACI,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,UAAU,EAAE,SAAS,CAAC,EACnD,KAAK,EAAE,EAAE,QAAQ,EAAE,GAAG,QAAQ,IAAI,EAAE,EACpC,EAAE,EAAE,EAAE,aACE,mBAAmB,aAE3B,cAAK,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,SAAS,EAAE,aAAa,CAAC,aAAU,iBAAiB,YACjF,IAAI,GACH,EACN,cACI,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,WAAW,EAAE,eAAe,CAAC,aAClD,mBAAmB,YAE1B,MAAM,GACL,EACN,cACI,SAAS,EAAE,UAAU,CACjB,qDAAqD,EACrD,MAAM,CAAC,UAAU,EACjB,cAAc,CACjB,aACO,kBAAkB,YAEzB,KAAK,GACJ,IACJ,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/* stylelint-disable no-descending-specificity */
|
|
2
|
+
@import (reference) '@servicetitan/tokens/core/tokens.less';
|
|
3
|
+
|
|
4
|
+
@size-links-tiny: 24px;
|
|
5
|
+
|
|
6
|
+
.header-tiny {
|
|
7
|
+
display: grid;
|
|
8
|
+
grid-template-columns: repeat(3, 1fr);
|
|
9
|
+
grid-template-rows: 48px;
|
|
10
|
+
|
|
11
|
+
background-color: @color-white;
|
|
12
|
+
color: @color-black;
|
|
13
|
+
|
|
14
|
+
& > * {
|
|
15
|
+
overflow-y: hidden;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.he-top-left {
|
|
19
|
+
grid-column: span 1;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.he-top-center {
|
|
23
|
+
grid-column: span 1;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.he-top-right {
|
|
27
|
+
grid-column: span 1;
|
|
28
|
+
|
|
29
|
+
& > * {
|
|
30
|
+
color: @color-black;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:global(.profile-dropdown-image) {
|
|
35
|
+
height: 24px;
|
|
36
|
+
width: 24px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
:global(.profile-dropdown-trigger) {
|
|
40
|
+
height: 32px;
|
|
41
|
+
font-size: @size-links-tiny;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.navigation-link {
|
|
45
|
+
margin: 6px 2px;
|
|
46
|
+
padding: 6px 6px;
|
|
47
|
+
border-radius: 12px;
|
|
48
|
+
font-size: @size-links-tiny;
|
|
49
|
+
color: inherit;
|
|
50
|
+
|
|
51
|
+
&.navigation-item-active:not(.navigation-item-overflow) {
|
|
52
|
+
background-color: @color-blue-100 !important;
|
|
53
|
+
color: @color-blue-500 !important;
|
|
54
|
+
}
|
|
55
|
+
&:hover:not(.navigation-item-active):not(.navigation-item-overflow) {
|
|
56
|
+
background-color: rgba(0, 0, 0, 0.12) !important;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&.navigation-item-icon-state.navigation-item-active {
|
|
60
|
+
.navigation-icon:not(.navigation-icon-active) {
|
|
61
|
+
display: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.navigation-icon.navigation-icon-active[data-anv][data-anv] {
|
|
65
|
+
display: block;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.navigation-icon[data-anv][data-anv] {
|
|
71
|
+
display: inline-block;
|
|
72
|
+
color: inherit;
|
|
73
|
+
height: 24px;
|
|
74
|
+
width: 24px;
|
|
75
|
+
|
|
76
|
+
> svg {
|
|
77
|
+
height: @size-links-tiny;
|
|
78
|
+
width: @size-links-tiny;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&.navigation-icon-active {
|
|
82
|
+
display: none;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.navigation-link {
|
|
88
|
+
// styles specific to extra nav links
|
|
89
|
+
color: @color-black;
|
|
90
|
+
position: relative;
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
flex-wrap: nowrap;
|
|
94
|
+
text-wrap: nowrap;
|
|
95
|
+
|
|
96
|
+
.navigation-item-counter {
|
|
97
|
+
color: @color-white;
|
|
98
|
+
font-weight: @font-weight-semibold;
|
|
99
|
+
font-size: 8px !important;
|
|
100
|
+
min-width: 12px;
|
|
101
|
+
position: absolute;
|
|
102
|
+
top: 4px;
|
|
103
|
+
right: -2px;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&.navigation-item-counter-long {
|
|
107
|
+
right: -8px;
|
|
108
|
+
}
|
|
109
|
+
}
|
package/dist/components/{header-navigation → left-navigation}/header-navigation-tiny.stories.d.ts
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: FC<import("./header-navigation").HeaderNavigationTinyProps>;
|
|
4
|
+
component: FC<import("./header-navigation-tiny").HeaderNavigationTinyProps>;
|
|
5
5
|
parameters: {};
|
|
6
6
|
decorators: ((Story: any) => import("react/jsx-runtime").JSX.Element)[];
|
|
7
7
|
};
|
|
8
8
|
export default _default;
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const DefaultTinyNavigation: () => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export declare const WithAllMonolithData: () => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export declare const WithAllMonolithDataCommercial: () => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
//# sourceMappingURL=header-navigation-tiny.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header-navigation-tiny.stories.d.ts","sourceRoot":"","sources":["../../../src/components/left-navigation/header-navigation-tiny.stories.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;;;;;;;AAcrC,wBAaE;AAEF,eAAO,MAAM,qBAAqB,+CAMjC,CAAC;AAQF,eAAO,MAAM,mBAAmB,+CA4D/B,CAAC;AAEF,eAAO,MAAM,6BAA6B,+CA+DzC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import SvgSearch from '@servicetitan/anvil2/assets/icons/material/round/search.svg';
|
|
3
|
+
import SvgSettingsActive from '@servicetitan/anvil2/assets/icons/st/gnav_settings_active.svg';
|
|
4
|
+
import SvgSettings from '@servicetitan/anvil2/assets/icons/st/gnav_settings_inactive.svg';
|
|
5
|
+
import SvgRocketActive from '@servicetitan/anvil2/assets/icons/st/gnav_titan_advisor_active.svg';
|
|
6
|
+
import SvgRocket from '@servicetitan/anvil2/assets/icons/st/gnav_titan_advisor_inactive.svg';
|
|
7
|
+
import { Input, Stack } from '@servicetitan/design-system';
|
|
8
|
+
import { Fragment } from 'react';
|
|
9
|
+
import { CallsNavigationTrigger, SearchIcon, withAnvil, withMemoryRouter, } from '../../test/data.stories';
|
|
10
|
+
import * as Styles from '../header-navigation/header-navigation-stories.module.less';
|
|
11
|
+
import { LogoCompanyTitle } from '../logo/logo-company-title';
|
|
12
|
+
import { LogoTitan, LogoTitanTitle } from '../logo/logo-titan-text';
|
|
13
|
+
import { ProfileDropdown } from '../profile-dropdown/profile-dropdown';
|
|
14
|
+
import { HeaderNavigationTiny } from './header-navigation-tiny';
|
|
15
|
+
import { HeaderNavigationLink } from './header-navigation-tiny-links';
|
|
16
|
+
export default {
|
|
17
|
+
title: 'Navigation/HeaderNavigationTiny',
|
|
18
|
+
component: HeaderNavigationTiny,
|
|
19
|
+
parameters: {},
|
|
20
|
+
decorators: [
|
|
21
|
+
withMemoryRouter,
|
|
22
|
+
withAnvil,
|
|
23
|
+
(Story) => (_jsx("div", { className: "border", style: { height: '500px' }, children: _jsx(Story, {}) })),
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
export const DefaultTinyNavigation = () => (_jsx(HeaderNavigationTiny, { className: "border-bottom", left: _jsx(LogoCompanyTitle, { className: "m-l-1", size: "150" }), leftClassName: "d-f align-items-center" }));
|
|
27
|
+
const TimeZoneOffset = () => (_jsx("div", { className: "fs-2 ff-default p-r-1", children: _jsx("span", { children: "EST (-9 hrs)" }) }));
|
|
28
|
+
export const WithAllMonolithData = () => (_jsx(HeaderNavigationTiny, { className: "border-bottom", left: _jsx(LogoCompanyTitle, { className: "m-l-1", size: "150" }), leftClassName: "d-f align-items-center", right: _jsxs(Fragment, { children: [_jsx(TimeZoneOffset, {}), _jsx(HeaderNavigationLink, { id: "search", to: "https://google.com", target: "_blank", iconComponent: SearchIcon, hint: "Search: for all the questions", tooltip: "Search", icon: SvgSearch, iconActive: SvgSearch }), _jsx(CallsNavigationTrigger, {}), _jsx(HeaderNavigationLink, { id: "titanAdvisor", to: "titanAdvisor", iconName: "rocket", iconClassName: Styles.rocketIcon, icon: SvgRocket, iconActive: SvgRocketActive }), _jsx(HeaderNavigationLink, { id: "settings", to: "settings", target: "_blank", iconName: "settings", "aria-label": "search", hint: "Settings", icon: SvgSettings, iconActive: SvgSettingsActive }), _jsxs(ProfileDropdown, { children: [_jsx(ProfileDropdown.Link, { id: "tasks", to: "https://googgle.com", counter: 10, children: "Task Management" }), _jsx(ProfileDropdown.Divider, {}), _jsxs(ProfileDropdown.Link, { id: "sign-out", to: "https://googgle.com", children: ["Sign Out", ' ', _jsx("span", { className: "c-neutral-100 m-l-half t-truncate", children: "James Bond" })] }), _jsx(ProfileDropdown.Section, { id: "userid", className: "c-neutral-100 fs-1", children: "User ID: 007" })] })] }), center: _jsx(Input, { placeholder: "Search smth", size: "xsmall", className: "w-100" }), centerClassName: "d-f align-items-center" }));
|
|
29
|
+
export const WithAllMonolithDataCommercial = () => (_jsx(HeaderNavigationTiny, { className: "border-bottom", left: _jsxs(Stack, { alignItems: "center", children: [_jsx(LogoTitan, { mantleFill: "#2270EE", className: "p-x-half", size: 48 }), _jsx(LogoTitanTitle, { children: "Commercial" })] }), leftClassName: "d-f align-items-center", right: _jsxs(Fragment, { children: [_jsx(TimeZoneOffset, {}), _jsx(HeaderNavigationLink, { id: "search", to: "https://google.com", target: "_blank", iconComponent: SearchIcon, hint: "Search: for all the questions", icon: SvgSearch, iconActive: SvgSearch }), _jsx(CallsNavigationTrigger, {}), _jsx(HeaderNavigationLink, { id: "titanAdvisor", to: "titanAdvisor", iconName: "rocket", iconClassName: Styles.rocketIcon, icon: SvgRocket, iconActive: SvgRocketActive }), _jsx(HeaderNavigationLink, { id: "settings", to: "settings", iconName: "settings", "aria-label": "search", hint: "Settings", icon: SvgSettings, iconActive: SvgSettingsActive }), _jsxs(ProfileDropdown, { children: [_jsx(ProfileDropdown.Link, { id: "tasks", to: "https://googgle.com", counter: 10, children: "Task Management" }), _jsx(ProfileDropdown.Divider, {}), _jsxs(ProfileDropdown.Link, { id: "sign-out", to: "https://googgle.com", children: ["Sign Out", ' ', _jsx("span", { className: "c-neutral-100 m-l-half t-truncate", children: "James Bond" })] }), _jsx(ProfileDropdown.Section, { id: "userid", className: "c-neutral-100 fs-1", children: "User ID: 007" })] })] }), center: _jsx(Input, { placeholder: "Search smth", size: "xsmall", className: "w-100" }), centerClassName: "d-f align-items-center" }));
|
|
30
|
+
//# sourceMappingURL=header-navigation-tiny.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header-navigation-tiny.stories.js","sourceRoot":"","sources":["../../../src/components/left-navigation/header-navigation-tiny.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,6DAA6D,CAAC;AACpF,OAAO,iBAAiB,MAAM,+DAA+D,CAAC;AAC9F,OAAO,WAAW,MAAM,iEAAiE,CAAC;AAC1F,OAAO,eAAe,MAAM,oEAAoE,CAAC;AACjG,OAAO,SAAS,MAAM,sEAAsE,CAAC;AAE7F,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EACH,s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EAAE,EAAC,qBAAqB,yBAC/C,GAAG,EACZ,eAAM,SAAS,EAAC,mCAAmC,2BAAkB,IAClD,EACvB,KAAC,eAAe,CAAC,OAAO,IAAC,EAAE,EAAC,QAAQ,EAAC,SAAS,EAAC,oBAAoB,6BAEzC,IACZ,IACX,EAEf,MAAM,EAAE,KAAC,KAAK,IAAC,WAAW,EAAC,aAAa,EAAC,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,OAAO,GAAG,EAC3E,eAAe,EAAC,wBAAwB,GAC1C,CACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/left-navigation/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/left-navigation/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC
|
|
1
|
+
import { FC } from 'react';
|
|
2
2
|
import { HeaderNavigationItemData, NavLinkComponentProps } from '../../utils/navigation';
|
|
3
3
|
export interface SideNavigationProps {
|
|
4
4
|
/** container class name */
|
|
@@ -17,20 +17,9 @@ export interface SideNavigationProps {
|
|
|
17
17
|
onExpandedChange(expanded: boolean): void;
|
|
18
18
|
}
|
|
19
19
|
export declare const SideNavigation: FC<SideNavigationProps>;
|
|
20
|
-
interface SideNavigationItemProps extends HeaderNavigationItemData {
|
|
21
|
-
expanded?: boolean;
|
|
22
|
-
}
|
|
23
|
-
/** Side Navigation menu item */
|
|
24
|
-
export declare const SideNavigationItem: FC<SideNavigationItemProps>;
|
|
25
20
|
/** Side Navigation options toggle */
|
|
26
21
|
export declare const SideNavigationOptionsToggle: FC<{
|
|
27
22
|
expanded?: boolean;
|
|
28
23
|
onExpandedChange(expanded: boolean): void;
|
|
29
24
|
}>;
|
|
30
|
-
/** Side Navigation options popover */
|
|
31
|
-
export declare const SideNavigationOptionsPopover: FC<PropsWithChildren<{
|
|
32
|
-
expanded?: boolean;
|
|
33
|
-
onExpandedChange(expanded: boolean): void;
|
|
34
|
-
}>>;
|
|
35
|
-
export {};
|
|
36
25
|
//# sourceMappingURL=side-navigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"side-navigation.d.ts","sourceRoot":"","sources":["../../../src/components/left-navigation/side-navigation.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAMzF,MAAM,WAAW,mBAAmB;IAChC,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,4BAA4B;IAC5B,KAAK,CAAC,EAAE,wBAAwB,EAAE,CAAC;IACnC,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,wBAAwB,EAAE,CAAC;IACtC,uBAAuB;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4CAA4C;IAC5C,mBAAmB,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC,CAAC;IAChD,4BAA4B;IAC5B,gBAAgB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;CAC7C;AAED,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAoDlD,CAAC;AAsEF,qCAAqC;AACrC,eAAO,MAAM,2BAA2B,EAAE,EAAE,CAAC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;CAC7C,CAgBI,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Icon } from '@servicetitan/anvil2';
|
|
3
|
+
import SvgCollapse from '@servicetitan/anvil2/assets/icons/st/gnav_menu_collapse.svg';
|
|
4
|
+
import SvgExpand from '@servicetitan/anvil2/assets/icons/st/gnav_menu_expand.svg';
|
|
5
|
+
import classNames from 'classnames';
|
|
6
|
+
import { Fragment } from 'react';
|
|
7
|
+
import { DefaultNavLinkComponent } from '../../utils/navigation-context';
|
|
8
|
+
import { withTooltip } from '../../utils/with-tooltip';
|
|
9
|
+
import { CounterTag } from '../counter-tag';
|
|
10
|
+
import * as Styles from './side-navigation.module.less';
|
|
11
|
+
export const SideNavigation = ({ className, expanded, id, items, itemsTop, navigationComponent = DefaultNavLinkComponent, onExpandedChange, }) => {
|
|
12
|
+
return (_jsxs("div", { className: classNames(Styles.sideNav, expanded ? Styles.sideNavExpanded : Styles.sideNavSlim, className), id: id, "data-cy": "side-navigation", children: [!!(itemsTop === null || itemsTop === void 0 ? void 0 : itemsTop.length) && (_jsxs(Fragment, { children: [_jsx("div", { className: Styles.sideNavTop, "data-cy": "navigation-items-top", children: itemsTop.map(item => (_jsx(SideNavigationItem, Object.assign({ expanded: expanded, navigationComponent: navigationComponent }, item), item.id))) }), _jsx("div", { className: Styles.divider })] })), _jsx("div", { className: Styles.sideNavContent, "data-cy": "navigation-items", children: items === null || items === void 0 ? void 0 : items.map(item => (_jsx(SideNavigationItem, Object.assign({ expanded: expanded, navigationComponent: navigationComponent }, item), item.id))) }), _jsx("div", { className: Styles.sideNavBottom, children: _jsx(SideNavigationOptionsToggle, { expanded: expanded, onExpandedChange: onExpandedChange }) })] }));
|
|
13
|
+
};
|
|
14
|
+
/** Side Navigation menu item */
|
|
15
|
+
const SideNavigationItem = ({ id, to, title, hint, counter, className, iconClassName, iconComponent: IconComponent, icon, iconActive, isActive, navigationComponent: NavigationComponent, expanded, }) => {
|
|
16
|
+
return withTooltip(_jsxs(NavigationComponent, { "data-cy": `navigation-item-${id}`, "data-pendo": `navigation-item-${id}`, to: to, title: hint, className: classNames(Styles.navigationItem, className, {
|
|
17
|
+
[Styles.navigationItemActive]: isActive === true,
|
|
18
|
+
[Styles.navigationItemIconState]: !!icon && !!iconActive,
|
|
19
|
+
}), isActive: typeof isActive === 'function' ? isActive : undefined, activeClassName: Styles.navigationItemActive, children: [IconComponent ? (_jsx("i", { className: classNames(Styles.navigationIcon, iconClassName), children: _jsx(IconComponent, {}) })) : (_jsxs(Fragment, { children: [icon && (_jsx(Icon, { svg: icon, className: classNames(Styles.navigationIcon, iconClassName) })), iconActive && (_jsx(Icon, { svg: iconActive, className: classNames(Styles.navigationIcon, Styles.navigationIconActive, iconClassName) }))] })), !!expanded && _jsx("span", { className: Styles.navigationItemText, children: title }), !!counter && _jsx(CounterTag, { data: counter, className: Styles.navigationItemCounter })] }, id), expanded ? undefined : title, 'right');
|
|
20
|
+
};
|
|
21
|
+
/** Side Navigation options toggle */
|
|
22
|
+
export const SideNavigationOptionsToggle = ({ expanded, onExpandedChange }) => withTooltip(_jsxs("div", { "data-cy": "navigation-left-options", "data-pendo": "navigation-left-options", className: classNames(Styles.optionsItem), onClick: () => onExpandedChange(!expanded), children: [_jsx("div", { className: Styles.optionsIconWrapper, children: _jsx(Icon, { className: Styles.optionsIcon, svg: expanded ? SvgCollapse : SvgExpand }) }), !!expanded && _jsx("span", { className: Styles.optionsItemText, children: "Collapse Menu" })] }), expanded ? undefined : 'Expand Menu', 'right');
|
|
23
|
+
//# sourceMappingURL=side-navigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"side-navigation.js","sourceRoot":"","sources":["../../../src/components/left-navigation/side-navigation.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,WAAW,MAAM,6DAA6D,CAAC;AACtF,OAAO,SAAS,MAAM,2DAA2D,CAAC;AAClF,OAAO,UAAU,MAAM,Y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