@servicetitan/navigation 4.1.0 → 5.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/counter-tag.js +1 -1
- package/dist/components/counter-tag.js.map +1 -1
- package/dist/components/header-navigation/header-navigation-extra-stacked.stories.d.ts +9 -0
- package/dist/components/header-navigation/header-navigation-extra-stacked.stories.d.ts.map +1 -0
- package/dist/components/header-navigation/header-navigation-extra-stacked.stories.js +13 -0
- package/dist/components/header-navigation/header-navigation-extra-stacked.stories.js.map +1 -0
- package/dist/components/header-navigation/header-navigation-extra.stories.d.ts +4 -4
- package/dist/components/header-navigation/header-navigation-extra.stories.d.ts.map +1 -1
- package/dist/components/header-navigation/header-navigation-extra.stories.js +18 -10
- package/dist/components/header-navigation/header-navigation-extra.stories.js.map +1 -1
- package/dist/components/header-navigation/header-navigation-links.d.ts.map +1 -1
- package/dist/components/header-navigation/header-navigation-links.js +8 -24
- package/dist/components/header-navigation/header-navigation-links.js.map +1 -1
- package/dist/components/header-navigation/header-navigation-stacked.stories.d.ts +3 -3
- package/dist/components/header-navigation/header-navigation-stacked.stories.js +4 -4
- package/dist/components/header-navigation/header-navigation-stacked.stories.js.map +1 -1
- package/dist/components/header-navigation/header-navigation.js +3 -3
- package/dist/components/header-navigation/header-navigation.js.map +1 -1
- package/dist/components/header-navigation/header-navigation.stories.d.ts +3 -3
- package/dist/components/header-navigation/header-navigation.stories.js +4 -4
- package/dist/components/header-navigation/header-navigation.stories.js.map +1 -1
- package/dist/components/layout.stories.js +1 -1
- package/dist/components/layout.stories.js.map +1 -1
- package/dist/components/left-navigation/header-navigation-extra-tiny.stories.d.ts +9 -0
- package/dist/components/left-navigation/header-navigation-extra-tiny.stories.d.ts.map +1 -0
- package/dist/components/left-navigation/header-navigation-extra-tiny.stories.js +13 -0
- package/dist/components/left-navigation/header-navigation-extra-tiny.stories.js.map +1 -0
- package/dist/components/left-navigation/header-navigation-tiny-links.d.ts +2 -0
- package/dist/components/left-navigation/header-navigation-tiny-links.d.ts.map +1 -1
- package/dist/components/left-navigation/header-navigation-tiny-links.js +9 -22
- package/dist/components/left-navigation/header-navigation-tiny-links.js.map +1 -1
- package/dist/components/left-navigation/header-navigation-tiny.module.less +8 -0
- package/dist/components/left-navigation/header-navigation-tiny.stories.d.ts.map +1 -1
- package/dist/components/left-navigation/header-navigation-tiny.stories.js +1 -1
- package/dist/components/left-navigation/header-navigation-tiny.stories.js.map +1 -1
- package/dist/components/left-navigation/side-navigation.js +1 -1
- package/dist/components/left-navigation/side-navigation.js.map +1 -1
- package/dist/components/left-navigation/side-navigation.stories.d.ts +0 -1
- package/dist/components/left-navigation/side-navigation.stories.d.ts.map +1 -1
- package/dist/components/left-navigation/side-navigation.stories.js +1 -1
- package/dist/components/left-navigation/side-navigation.stories.js.map +1 -1
- package/dist/components/links.js +2 -2
- package/dist/components/links.js.map +1 -1
- package/dist/components/logo/logo-titan.js +1 -1
- package/dist/components/logo/logo-titan.js.map +1 -1
- package/dist/components/logo/logo.stories.d.ts +6 -6
- package/dist/components/logo/logo.stories.d.ts.map +1 -1
- package/dist/components/logo/logo.stories.js +6 -6
- package/dist/components/logo/logo.stories.js.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.d.ts +1 -1
- package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.d.ts.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.js +3 -3
- package/dist/components/profile-dropdown/profile-dropdown-stacked.stories.js.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown-tiny.stories.d.ts +1 -1
- package/dist/components/profile-dropdown/profile-dropdown-tiny.stories.d.ts.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown-tiny.stories.js +3 -3
- package/dist/components/profile-dropdown/profile-dropdown-tiny.stories.js.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown.js +6 -19
- package/dist/components/profile-dropdown/profile-dropdown.js.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown.module.less +9 -0
- package/dist/components/profile-dropdown/profile-dropdown.stories.js +2 -2
- package/dist/components/profile-dropdown/profile-dropdown.stories.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/test/{data.stories.d.ts → data.d.ts} +1 -2
- package/dist/test/data.d.ts.map +1 -0
- package/dist/test/{data.stories.js → data.js} +13 -17
- package/dist/test/data.js.map +1 -0
- package/dist/utils/navigation-context.js +1 -15
- package/dist/utils/navigation-context.js.map +1 -1
- package/dist/utils/navigation.d.ts +4 -0
- package/dist/utils/navigation.d.ts.map +1 -1
- package/dist/utils/with-tooltip.d.ts +1 -1
- package/package.json +3 -3
- package/src/components/header-navigation/header-navigation-extra-stacked.stories.tsx +19 -0
- package/src/components/header-navigation/header-navigation-extra.stories.tsx +83 -39
- package/src/components/header-navigation/header-navigation-links.tsx +8 -0
- package/src/components/header-navigation/header-navigation-stacked.stories.tsx +4 -4
- package/src/components/header-navigation/header-navigation.stories.tsx +4 -4
- package/src/components/layout.stories.tsx +1 -1
- package/src/components/left-navigation/header-navigation-extra-tiny.stories.tsx +21 -0
- package/src/components/left-navigation/header-navigation-tiny-links.tsx +27 -3
- package/src/components/left-navigation/header-navigation-tiny.module.less +8 -0
- package/src/components/left-navigation/header-navigation-tiny.module.less.d.ts +1 -0
- package/src/components/left-navigation/header-navigation-tiny.stories.tsx +1 -6
- package/src/components/left-navigation/side-navigation.stories.tsx +1 -1
- package/src/components/logo/logo.stories.tsx +6 -6
- package/src/components/profile-dropdown/profile-dropdown-stacked.stories.tsx +13 -3
- package/src/components/profile-dropdown/profile-dropdown-tiny.stories.tsx +13 -3
- package/src/components/profile-dropdown/profile-dropdown.module.less +9 -0
- package/src/components/profile-dropdown/profile-dropdown.module.less.d.ts +1 -0
- package/src/components/profile-dropdown/profile-dropdown.stories.tsx +2 -2
- package/src/components/profile-dropdown/profile-dropdown.tsx +1 -1
- package/src/index.ts +1 -0
- package/src/utils/navigation.ts +4 -0
- package/dist/test/data.stories.d.ts.map +0 -1
- package/dist/test/data.stories.js.map +0 -1
- /package/src/test/{data.stories.tsx → data.tsx} +0 -0
|
@@ -0,0 +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,WA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AC;IAExC,OAAO,CACH,KAAC,OAAO,IACJ,IAAI,EAAE,IAAI,EACV,cAAc,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EACpC,SAAS,EAAC,IAAI,EACd,OAAO,EACH,KAAC,uBAAuB,IACpB,EAAE,EAAC,SAAS,EACZ,QAAQ,EAAC,OAAO,EAChB,OAAO,EAAE,CAAC,EACV,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"}
|
|
@@ -1,20 +1,6 @@
|
|
|
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
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
2
|
import { createContext } from 'react';
|
|
14
|
-
export const DefaultNavLinkComponent = (
|
|
15
|
-
var { children, activeClassName, isActive } = _a, props = __rest(_a, ["children", "activeClassName", "isActive"]);
|
|
16
|
-
return _jsx("a", Object.assign({}, props, { children: children }));
|
|
17
|
-
};
|
|
3
|
+
export const DefaultNavLinkComponent = ({ children, activeClassName, isActive, ...props }) => _jsx("a", { ...props, children: children });
|
|
18
4
|
export const NavigationComponentContext = createContext(DefaultNavLinkComponent);
|
|
19
5
|
export const NavigationLegacyContext = createContext(false);
|
|
20
6
|
//# sourceMappingURL=navigation-context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-context.js","sourceRoot":"","sources":["../../src/utils/navigation-context.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"navigation-context.js","sourceRoot":"","sources":["../../src/utils/navigation-context.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,aAAa,EAAE,MAAM,OAAO,CAAC;AAG1C,MAAM,CAAC,MAAM,uBAAuB,GAA8B,CAAC,EAC/D,QAAQ,EACR,eAAe,EACf,QAAQ,EACR,GAAG,KAAK,EACX,EAAE,EAAE,CAAC,eAAO,KAAK,YAAG,QAAQ,GAAK,CAAC;AAEnC,MAAM,CAAC,MAAM,0BAA0B,GACnC,aAAa,CAA4B,uBAAuB,CAAC,CAAC;AACtE,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -51,6 +51,10 @@ export interface HeaderNavigationTriggerPropsStrict {
|
|
|
51
51
|
hint?: string;
|
|
52
52
|
/** container class name */
|
|
53
53
|
className?: string;
|
|
54
|
+
/** item label */
|
|
55
|
+
label?: string;
|
|
56
|
+
/** label class name */
|
|
57
|
+
labelClassName?: string;
|
|
54
58
|
/** isActive */
|
|
55
59
|
isActive?: boolean;
|
|
56
60
|
/** counter shown for item */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/utils/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,yBAAyB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,MAAM,WAAW,wBAAwB;IACrC,cAAc;IACd,E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Q,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC;IACrD,uBAAuB;IACvB,MAAM,CAAC,EAAE,yBAAyB,CAAC;CACtC;AAED,MAAM,WAAW,yBAA0B,SAAQ,+BAA+B;IAC9E,qBAAqB;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { TooltipPropsStrict } from '@servicetitan/design-system';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
export declare const withTooltip: (element: ReactNode, tooltip: string | undefined, direction?: TooltipPropsStrict[
|
|
3
|
+
export declare const withTooltip: (element: ReactNode, tooltip: string | undefined, direction?: TooltipPropsStrict["direction"]) => string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | null | undefined;
|
|
4
4
|
//# sourceMappingURL=with-tooltip.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/navigation",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Navigation components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"@servicetitan/anvil2": ">=1.16.3",
|
|
21
|
-
"@servicetitan/design-system": ">=
|
|
21
|
+
"@servicetitan/design-system": ">=14.0.0",
|
|
22
22
|
"@servicetitan/react-ioc": ">=14.1.1",
|
|
23
23
|
"@servicetitan/tokens": ">=12.0.0",
|
|
24
24
|
"mobx": ">=6.10.0",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"less": true,
|
|
44
44
|
"webpack": false
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "5e07aac7393d63f77dccb60b1d4372d1817e18cd"
|
|
47
47
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { withAnvil, withMemoryRouter } from '../../test/data';
|
|
2
|
+
import { HeaderNavigationLink } from '../links';
|
|
3
|
+
import { HeaderNavigationStacked } from './header-navigation';
|
|
4
|
+
|
|
5
|
+
const withHeaderNavigationStacked = (Story: any) => <HeaderNavigationStacked right={<Story />} />;
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Navigation/Extra/Stacked',
|
|
9
|
+
component: HeaderNavigationLink,
|
|
10
|
+
decorators: [withHeaderNavigationStacked, withMemoryRouter, withAnvil],
|
|
11
|
+
parameters: {},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
ExtraWithTooltip,
|
|
16
|
+
ExtraLink,
|
|
17
|
+
ExtraTrigger,
|
|
18
|
+
ExtraWithLabel,
|
|
19
|
+
} from './header-navigation-extra.stories';
|
|
@@ -1,54 +1,57 @@
|
|
|
1
|
+
import SvgHelp from '@servicetitan/anvil2/assets/icons/material/round/help_outline.svg';
|
|
2
|
+
import SvgPhone from '@servicetitan/anvil2/assets/icons/material/round/phone.svg';
|
|
3
|
+
import SvgSearch from '@servicetitan/anvil2/assets/icons/material/round/search.svg';
|
|
1
4
|
import { Button, Popover } from '@servicetitan/design-system';
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { withAnvil, withMemoryRouter } from '../../test/data
|
|
4
|
-
import { HeaderNavigationLink, HeaderNavigationTrigger } from '
|
|
5
|
+
import { Fragment, useState } from 'react';
|
|
6
|
+
import { withAnvil, withMemoryRouter } from '../../test/data';
|
|
7
|
+
import { HeaderNavigationLink, HeaderNavigationTrigger } from '../links';
|
|
5
8
|
import { HeaderNavigation } from './';
|
|
6
9
|
|
|
10
|
+
const withHeaderNavigation = (Story: any) => (
|
|
11
|
+
<HeaderNavigation rightClassName="m-r-1">
|
|
12
|
+
<Story />
|
|
13
|
+
</HeaderNavigation>
|
|
14
|
+
);
|
|
15
|
+
|
|
7
16
|
export default {
|
|
8
|
-
title: 'Navigation/
|
|
17
|
+
title: 'Navigation/Extra/Legacy',
|
|
9
18
|
component: HeaderNavigationLink,
|
|
10
|
-
decorators: [withMemoryRouter, withAnvil],
|
|
19
|
+
decorators: [withHeaderNavigation, withMemoryRouter, withAnvil],
|
|
11
20
|
parameters: {},
|
|
12
21
|
};
|
|
13
22
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
iconActive={SvgIcon}
|
|
25
|
-
hint="Search: for all the questions"
|
|
26
|
-
/>
|
|
27
|
-
</HeaderNavigation>
|
|
23
|
+
export const ExtraLink = () => (
|
|
24
|
+
<HeaderNavigationLink
|
|
25
|
+
id="search"
|
|
26
|
+
to="https://google.com"
|
|
27
|
+
target="_blank"
|
|
28
|
+
iconName="search"
|
|
29
|
+
icon={SvgSearch}
|
|
30
|
+
iconActive={undefined}
|
|
31
|
+
hint="Search: for all the questions"
|
|
32
|
+
/>
|
|
28
33
|
);
|
|
29
34
|
|
|
30
|
-
export const
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
/>
|
|
40
|
-
</HeaderNavigation>
|
|
35
|
+
export const ExtraTrigger = () => (
|
|
36
|
+
<HeaderNavigationTrigger
|
|
37
|
+
id="dialpad"
|
|
38
|
+
iconName="phone"
|
|
39
|
+
counter={2}
|
|
40
|
+
tooltip="Phones pro"
|
|
41
|
+
icon={SvgPhone}
|
|
42
|
+
iconActive={undefined}
|
|
43
|
+
/>
|
|
41
44
|
);
|
|
42
45
|
|
|
43
|
-
export const
|
|
44
|
-
<
|
|
46
|
+
export const ExtraWithTooltip = () => (
|
|
47
|
+
<Fragment>
|
|
45
48
|
<HeaderNavigationLink
|
|
46
49
|
id="search"
|
|
47
50
|
to="https://google.com"
|
|
48
51
|
target="_blank"
|
|
49
52
|
iconName="search"
|
|
50
|
-
icon={
|
|
51
|
-
iconActive={
|
|
53
|
+
icon={SvgSearch}
|
|
54
|
+
iconActive={undefined}
|
|
52
55
|
tooltip="Search: for all the questions"
|
|
53
56
|
hint="Google"
|
|
54
57
|
/>
|
|
@@ -56,14 +59,14 @@ export const extraWithTooltip = () => (
|
|
|
56
59
|
<HeaderNavigationTrigger
|
|
57
60
|
id="dialpad"
|
|
58
61
|
iconName="phone"
|
|
59
|
-
|
|
62
|
+
hint="Dialpad"
|
|
60
63
|
counter={2}
|
|
61
|
-
icon={
|
|
62
|
-
iconActive={
|
|
64
|
+
icon={SvgPhone}
|
|
65
|
+
iconActive={undefined}
|
|
63
66
|
/>
|
|
64
67
|
|
|
65
68
|
<HelpCenterButton />
|
|
66
|
-
</
|
|
69
|
+
</Fragment>
|
|
67
70
|
);
|
|
68
71
|
|
|
69
72
|
const HelpCenterButton = () => {
|
|
@@ -77,7 +80,7 @@ const HelpCenterButton = () => {
|
|
|
77
80
|
width="xs"
|
|
78
81
|
trigger={
|
|
79
82
|
<Button
|
|
80
|
-
className="c-
|
|
83
|
+
className="c-inherit"
|
|
81
84
|
iconName="help_outline"
|
|
82
85
|
fill="subtle"
|
|
83
86
|
onClick={() => setOpen(true)}
|
|
@@ -89,3 +92,44 @@ const HelpCenterButton = () => {
|
|
|
89
92
|
</Popover>
|
|
90
93
|
);
|
|
91
94
|
};
|
|
95
|
+
|
|
96
|
+
const HelpTrigger = () => {
|
|
97
|
+
const [active, setActive] = useState(true);
|
|
98
|
+
|
|
99
|
+
return (
|
|
100
|
+
<HeaderNavigationTrigger
|
|
101
|
+
id="help"
|
|
102
|
+
iconName="help_outline"
|
|
103
|
+
hint="Help"
|
|
104
|
+
icon={SvgHelp}
|
|
105
|
+
iconActive={undefined}
|
|
106
|
+
label="Live Chat"
|
|
107
|
+
onClick={() => setActive(!active)}
|
|
108
|
+
isActive={active}
|
|
109
|
+
/>
|
|
110
|
+
);
|
|
111
|
+
};
|
|
112
|
+
export const ExtraWithLabel = () => (
|
|
113
|
+
<Fragment>
|
|
114
|
+
<HeaderNavigationLink
|
|
115
|
+
id="search"
|
|
116
|
+
to="https://google.com"
|
|
117
|
+
target="_blank"
|
|
118
|
+
iconName="search"
|
|
119
|
+
icon={SvgSearch}
|
|
120
|
+
iconActive={undefined}
|
|
121
|
+
tooltip="Search: for all the questions"
|
|
122
|
+
hint="Google"
|
|
123
|
+
/>
|
|
124
|
+
|
|
125
|
+
<HelpTrigger />
|
|
126
|
+
<HeaderNavigationTrigger
|
|
127
|
+
id="dialpad"
|
|
128
|
+
iconName="phone"
|
|
129
|
+
hint="Dialpad"
|
|
130
|
+
counter={2}
|
|
131
|
+
icon={SvgPhone}
|
|
132
|
+
iconActive={undefined}
|
|
133
|
+
/>
|
|
134
|
+
</Fragment>
|
|
135
|
+
);
|
|
@@ -18,6 +18,8 @@ export const HeaderNavigationLink: FC<HeaderNavigationLinkProps> = ({
|
|
|
18
18
|
iconComponent,
|
|
19
19
|
iconName,
|
|
20
20
|
isActive,
|
|
21
|
+
label,
|
|
22
|
+
labelClassName,
|
|
21
23
|
target,
|
|
22
24
|
...rest
|
|
23
25
|
}) => {
|
|
@@ -43,6 +45,8 @@ export const HeaderNavigationLink: FC<HeaderNavigationLinkProps> = ({
|
|
|
43
45
|
iconComponent={iconComponent}
|
|
44
46
|
iconClassName={iconClassName}
|
|
45
47
|
iconName={iconName}
|
|
48
|
+
title={label}
|
|
49
|
+
titleClassName={labelClassName}
|
|
46
50
|
/>
|
|
47
51
|
</NavigationComponent>,
|
|
48
52
|
tooltip
|
|
@@ -58,6 +62,8 @@ export const HeaderNavigationTrigger: FC<HeaderNavigationTriggerProps> = ({
|
|
|
58
62
|
iconComponent,
|
|
59
63
|
iconName,
|
|
60
64
|
isActive,
|
|
65
|
+
label,
|
|
66
|
+
labelClassName,
|
|
61
67
|
hint,
|
|
62
68
|
tooltip,
|
|
63
69
|
...rest
|
|
@@ -83,6 +89,8 @@ export const HeaderNavigationTrigger: FC<HeaderNavigationTriggerProps> = ({
|
|
|
83
89
|
iconComponent={iconComponent}
|
|
84
90
|
iconClassName={iconClassName}
|
|
85
91
|
iconName={iconName}
|
|
92
|
+
title={label}
|
|
93
|
+
titleClassName={labelClassName}
|
|
86
94
|
/>
|
|
87
95
|
</div>,
|
|
88
96
|
tooltip
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Input, Stack } from '@servicetitan/design-system';
|
|
2
2
|
import { FC, Fragment } from 'react';
|
|
3
|
-
import { SearchIcon, items, withMemoryRouter } from '../../test/data
|
|
3
|
+
import { SearchIcon, items, withMemoryRouter } from '../../test/data';
|
|
4
4
|
import { LogoCompanyTitle } from '../logo/logo-company-title';
|
|
5
5
|
import { LogoTitan, LogoTitanTitle } from '../logo/logo-titan-text';
|
|
6
6
|
import { ProfileDropdown } from '../profile-dropdown/profile-dropdown';
|
|
@@ -17,7 +17,7 @@ export default {
|
|
|
17
17
|
|
|
18
18
|
const SvgIcon = undefined as any;
|
|
19
19
|
|
|
20
|
-
export const
|
|
20
|
+
export const DefaultNavigation = () => (
|
|
21
21
|
<HeaderNavigationStacked
|
|
22
22
|
left={<LogoCompanyTitle className="m-l-1" fill="#fff" size="150" />}
|
|
23
23
|
leftClassName="d-f align-items-center"
|
|
@@ -32,7 +32,7 @@ export const defaultNavigation = () => (
|
|
|
32
32
|
/>
|
|
33
33
|
);
|
|
34
34
|
|
|
35
|
-
export const
|
|
35
|
+
export const WithLogoTextAndOverflow = () => (
|
|
36
36
|
<HeaderNavigationStacked
|
|
37
37
|
left={
|
|
38
38
|
<Stack alignItems="center">
|
|
@@ -59,7 +59,7 @@ const TimeZoneOffset: FC = () => (
|
|
|
59
59
|
</div>
|
|
60
60
|
);
|
|
61
61
|
|
|
62
|
-
export const
|
|
62
|
+
export const WithAllMonolithData = () => (
|
|
63
63
|
<HeaderNavigationStacked
|
|
64
64
|
left={<LogoCompanyTitle className="m-l-1" fill="#fff" size="150" />}
|
|
65
65
|
leftClassName="d-f align-items-center"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Popover } from '@servicetitan/design-system';
|
|
2
2
|
import { FC, useState } from 'react';
|
|
3
|
-
import { SearchIcon, items, withMemoryRouter } from '../../test/data
|
|
3
|
+
import { SearchIcon, items, withMemoryRouter } from '../../test/data';
|
|
4
4
|
import { LogoCompanyTitle } from '../logo/logo-company-title';
|
|
5
5
|
import { LogoTitanText } from '../logo/logo-titan-text';
|
|
6
6
|
import { ProfileDropdown } from '../profile-dropdown/profile-dropdown';
|
|
@@ -16,7 +16,7 @@ export default {
|
|
|
16
16
|
};
|
|
17
17
|
const SvgIcon = undefined as any;
|
|
18
18
|
|
|
19
|
-
export const
|
|
19
|
+
export const DefaultNavigation = () => (
|
|
20
20
|
<HeaderNavigation
|
|
21
21
|
left={<LogoCompanyTitle className="m-l-1" fill="#fff" />}
|
|
22
22
|
items={[
|
|
@@ -30,7 +30,7 @@ export const defaultNavigation = () => (
|
|
|
30
30
|
/>
|
|
31
31
|
);
|
|
32
32
|
|
|
33
|
-
export const
|
|
33
|
+
export const WithLogoTextAndOverflow = () => (
|
|
34
34
|
<HeaderNavigation
|
|
35
35
|
left={
|
|
36
36
|
<LogoTitanText
|
|
@@ -83,7 +83,7 @@ const TimeZoneOffset: FC = () => (
|
|
|
83
83
|
</div>
|
|
84
84
|
);
|
|
85
85
|
|
|
86
|
-
export const
|
|
86
|
+
export const WithAllMonolithData = () => (
|
|
87
87
|
<HeaderNavigation
|
|
88
88
|
left={<LogoCompanyTitle className="m-l-1" fill="#fff" />}
|
|
89
89
|
items={[
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { withAnvil, withMemoryRouter } from '../../test/data';
|
|
2
|
+
import { HeaderNavigationLink } from '../links';
|
|
3
|
+
import { HeaderNavigationTiny } from './header-navigation-tiny';
|
|
4
|
+
|
|
5
|
+
const withHeaderNavigationTiny = (Story: any) => (
|
|
6
|
+
<HeaderNavigationTiny className="border" right={<Story />} />
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: 'Navigation/Extra/Tiny',
|
|
11
|
+
component: HeaderNavigationLink,
|
|
12
|
+
decorators: [withHeaderNavigationTiny, withMemoryRouter, withAnvil],
|
|
13
|
+
parameters: {},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
ExtraWithTooltip,
|
|
18
|
+
ExtraLink,
|
|
19
|
+
ExtraTrigger,
|
|
20
|
+
ExtraWithLabel,
|
|
21
|
+
} from '../header-navigation/header-navigation-extra.stories';
|
|
@@ -13,7 +13,9 @@ export const HeaderNavigationItemContent: FC<{
|
|
|
13
13
|
counterClassName?: string;
|
|
14
14
|
icon: IconProps['svg'] | undefined;
|
|
15
15
|
iconActive: IconProps['svg'] | undefined;
|
|
16
|
-
|
|
16
|
+
label?: string;
|
|
17
|
+
labelClassName?: string;
|
|
18
|
+
}> = ({ counter, counterClassName, icon, iconActive, label, labelClassName }) => {
|
|
17
19
|
return (
|
|
18
20
|
<Fragment>
|
|
19
21
|
{!!icon && <Icon svg={icon} className={Styles.navigationIcon} />}
|
|
@@ -24,6 +26,12 @@ export const HeaderNavigationItemContent: FC<{
|
|
|
24
26
|
/>
|
|
25
27
|
)}
|
|
26
28
|
|
|
29
|
+
{!!label && (
|
|
30
|
+
<span className={classNames(Styles.navigationItemLabel, labelClassName)}>
|
|
31
|
+
{label}
|
|
32
|
+
</span>
|
|
33
|
+
)}
|
|
34
|
+
|
|
27
35
|
{!!counter && (
|
|
28
36
|
<CounterTag
|
|
29
37
|
data={counter}
|
|
@@ -46,6 +54,8 @@ export const HeaderNavigationLink: FC<HeaderNavigationLinkProps> = ({
|
|
|
46
54
|
icon,
|
|
47
55
|
iconActive,
|
|
48
56
|
isActive,
|
|
57
|
+
label,
|
|
58
|
+
labelClassName,
|
|
49
59
|
target,
|
|
50
60
|
...rest
|
|
51
61
|
}) => {
|
|
@@ -67,7 +77,13 @@ export const HeaderNavigationLink: FC<HeaderNavigationLinkProps> = ({
|
|
|
67
77
|
activeClassName={Styles.navigationItemActive}
|
|
68
78
|
target={target}
|
|
69
79
|
>
|
|
70
|
-
<HeaderNavigationItemContent
|
|
80
|
+
<HeaderNavigationItemContent
|
|
81
|
+
counter={counter}
|
|
82
|
+
icon={icon}
|
|
83
|
+
iconActive={iconActive}
|
|
84
|
+
label={label}
|
|
85
|
+
labelClassName={labelClassName}
|
|
86
|
+
/>
|
|
71
87
|
</NavigationComponent>,
|
|
72
88
|
tooltip
|
|
73
89
|
);
|
|
@@ -82,6 +98,8 @@ export const HeaderNavigationTrigger: FC<HeaderNavigationTriggerProps> = ({
|
|
|
82
98
|
iconActive,
|
|
83
99
|
isActive,
|
|
84
100
|
hint,
|
|
101
|
+
label,
|
|
102
|
+
labelClassName,
|
|
85
103
|
tooltip,
|
|
86
104
|
title,
|
|
87
105
|
titleClassName,
|
|
@@ -103,7 +121,13 @@ export const HeaderNavigationTrigger: FC<HeaderNavigationTriggerProps> = ({
|
|
|
103
121
|
className
|
|
104
122
|
)}
|
|
105
123
|
>
|
|
106
|
-
<HeaderNavigationItemContent
|
|
124
|
+
<HeaderNavigationItemContent
|
|
125
|
+
counter={counter}
|
|
126
|
+
icon={icon}
|
|
127
|
+
iconActive={iconActive}
|
|
128
|
+
label={label}
|
|
129
|
+
labelClassName={labelClassName}
|
|
130
|
+
/>
|
|
107
131
|
</div>,
|
|
108
132
|
tooltip
|
|
109
133
|
);
|
|
@@ -103,6 +103,14 @@
|
|
|
103
103
|
right: -2px;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
.navigation-item-label {
|
|
107
|
+
color: inherit;
|
|
108
|
+
font-size: @typescale-1;
|
|
109
|
+
font-family: @base-font-family;
|
|
110
|
+
font-weight: @font-weight-semibold;
|
|
111
|
+
margin-left: @spacing-half;
|
|
112
|
+
}
|
|
113
|
+
|
|
106
114
|
&.navigation-item-counter-long {
|
|
107
115
|
right: -8px;
|
|
108
116
|
}
|
|
@@ -9,6 +9,7 @@ export const navigationItemActive: string;
|
|
|
9
9
|
export const navigationItemCounter: string;
|
|
10
10
|
export const navigationItemCounterLong: string;
|
|
11
11
|
export const navigationItemIconState: string;
|
|
12
|
+
export const navigationItemLabel: string;
|
|
12
13
|
export const navigationItemOverflow: string;
|
|
13
14
|
export const navigationLink: string;
|
|
14
15
|
|
|
@@ -6,12 +6,7 @@ import SvgRocket from '@servicetitan/anvil2/assets/icons/st/gnav_titan_advisor_i
|
|
|
6
6
|
|
|
7
7
|
import { Input, Stack } from '@servicetitan/design-system';
|
|
8
8
|
import { FC, Fragment } from 'react';
|
|
9
|
-
import {
|
|
10
|
-
CallsNavigationTrigger,
|
|
11
|
-
SearchIcon,
|
|
12
|
-
withAnvil,
|
|
13
|
-
withMemoryRouter,
|
|
14
|
-
} from '../../test/data.stories';
|
|
9
|
+
import { CallsNavigationTrigger, SearchIcon, withAnvil, withMemoryRouter } from '../../test/data';
|
|
15
10
|
import * as Styles from '../header-navigation/header-navigation-stories.module.less';
|
|
16
11
|
import { LogoCompanyTitle } from '../logo/logo-company-title';
|
|
17
12
|
import { LogoTitan, LogoTitanTitle } from '../logo/logo-titan-text';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentType, useState } from 'react';
|
|
2
|
-
import { NavLinkMock, items, withAnvil, withMemoryRouter } from '../../test/data
|
|
2
|
+
import { NavLinkMock, items, withAnvil, withMemoryRouter } from '../../test/data';
|
|
3
3
|
import { SideNavigation } from './';
|
|
4
4
|
|
|
5
5
|
const layout = (Story: ComponentType) => {
|
|
@@ -10,10 +10,10 @@ export default {
|
|
|
10
10
|
parameters: {},
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
export const
|
|
14
|
-
export const
|
|
15
|
-
export const
|
|
16
|
-
export const
|
|
13
|
+
export const Titan = () => <LogoTitanSvg />;
|
|
14
|
+
export const TitanBlueMantle = () => <LogoTitanSvg mantleFill="#2270EE" />;
|
|
15
|
+
export const CompanyTitle = () => <LogoCompanyTitle />;
|
|
16
|
+
export const TitanText = () => (
|
|
17
17
|
<LogoTitanText
|
|
18
18
|
className="bg-neutral-300 border"
|
|
19
19
|
mantleFill="#2270EE"
|
|
@@ -34,7 +34,7 @@ const NavLinkMock: FC<{ className: string; children: ReactNode }> = ({ className
|
|
|
34
34
|
</a>
|
|
35
35
|
);
|
|
36
36
|
|
|
37
|
-
export const
|
|
37
|
+
export const TitanTextWithLink = () => (
|
|
38
38
|
<LogoTitanText
|
|
39
39
|
className="bg-neutral-300 border"
|
|
40
40
|
mantleFill="#2270EE"
|
|
@@ -44,7 +44,7 @@ export const logoTitanTextWithLink = () => (
|
|
|
44
44
|
/>
|
|
45
45
|
);
|
|
46
46
|
|
|
47
|
-
export const
|
|
47
|
+
export const TitanWithText = () => (
|
|
48
48
|
<Stack className="border bg-neutral-300" alignItems="center">
|
|
49
49
|
<LogoTitan className="border-left m-r-1" mantleFill="#2270EE" />
|
|
50
50
|
<LogoTitanTitle className="m-x-1 p-b-half c-white">Contact Center</LogoTitanTitle>
|
|
@@ -1,13 +1,23 @@
|
|
|
1
|
-
import { withAnvil, withMemoryRouter } from '../../test/data
|
|
1
|
+
import { withAnvil, withMemoryRouter } from '../../test/data';
|
|
2
2
|
import { HeaderNavigationStacked } from '../header-navigation';
|
|
3
|
-
export * from './profile-dropdown.stories';
|
|
4
3
|
import { ProfileDropdown } from './profile-dropdown';
|
|
5
4
|
|
|
6
5
|
const withHeaderNavigationStacked = (Story: any) => <HeaderNavigationStacked right={<Story />} />;
|
|
7
6
|
|
|
8
7
|
export default {
|
|
9
|
-
title: 'Navigation/
|
|
8
|
+
title: 'Navigation/ProfileDropdown/Stacked',
|
|
10
9
|
component: ProfileDropdown,
|
|
11
10
|
parameters: {},
|
|
12
11
|
decorators: [withMemoryRouter, withAnvil, withHeaderNavigationStacked],
|
|
13
12
|
};
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
ProfileDropdownDefault,
|
|
16
|
+
ProfileDropdownWithBothBadges,
|
|
17
|
+
ProfileDropdownWithCounter,
|
|
18
|
+
ProfileDropdownWithErrorLogo,
|
|
19
|
+
ProfileDropdownWithInfo,
|
|
20
|
+
ProfileDropdownWithHintAndInfoPopup,
|
|
21
|
+
ProfileDropdownWithHintPopup,
|
|
22
|
+
ProfileDropdownWithLogo,
|
|
23
|
+
} from './profile-dropdown.stories';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { withAnvil, withMemoryRouter } from '../../test/data
|
|
1
|
+
import { withAnvil, withMemoryRouter } from '../../test/data';
|
|
2
2
|
import { HeaderNavigationTiny } from '../left-navigation';
|
|
3
|
-
export * from './profile-dropdown.stories';
|
|
4
3
|
import { ProfileDropdown } from './profile-dropdown';
|
|
5
4
|
|
|
6
5
|
const withHeaderNavigationTiny = (Story: any) => (
|
|
@@ -8,8 +7,19 @@ const withHeaderNavigationTiny = (Story: any) => (
|
|
|
8
7
|
);
|
|
9
8
|
|
|
10
9
|
export default {
|
|
11
|
-
title: 'Navigation/
|
|
10
|
+
title: 'Navigation/ProfileDropdown/Tiny',
|
|
12
11
|
component: ProfileDropdown,
|
|
13
12
|
parameters: {},
|
|
14
13
|
decorators: [withMemoryRouter, withAnvil, withHeaderNavigationTiny],
|
|
15
14
|
};
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
ProfileDropdownDefault,
|
|
18
|
+
ProfileDropdownWithBothBadges,
|
|
19
|
+
ProfileDropdownWithCounter,
|
|
20
|
+
ProfileDropdownWithErrorLogo,
|
|
21
|
+
ProfileDropdownWithInfo,
|
|
22
|
+
ProfileDropdownWithHintAndInfoPopup,
|
|
23
|
+
ProfileDropdownWithHintPopup,
|
|
24
|
+
ProfileDropdownWithLogo,
|
|
25
|
+
} from './profile-dropdown.stories';
|
|
@@ -50,10 +50,19 @@
|
|
|
50
50
|
border-radius: 8px;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
.expand-icon[data-anv][data-anv] {
|
|
54
|
+
color: inherit;
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
}
|
|
58
|
+
|
|
53
59
|
&.trigger-container-legacy {
|
|
54
60
|
.avatar-badge {
|
|
55
61
|
left: 0;
|
|
56
62
|
}
|
|
63
|
+
.badge {
|
|
64
|
+
right: 12px;
|
|
65
|
+
}
|
|
57
66
|
}
|
|
58
67
|
|
|
59
68
|
&.trigger-container-hint-arrow:first-child:before {
|