@servicetitan/navigation 4.0.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-content.d.ts +0 -7
- package/dist/components/header-navigation/header-navigation-content.d.ts.map +1 -1
- package/dist/components/header-navigation/header-navigation-content.js +6 -7
- package/dist/components/header-navigation/header-navigation-content.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 +5 -6
- package/dist/components/header-navigation/header-navigation-extra.stories.d.ts.map +1 -1
- package/dist/components/header-navigation/header-navigation-extra.stories.js +19 -11
- package/dist/components/header-navigation/header-navigation-extra.stories.js.map +1 -1
- package/dist/components/header-navigation/header-navigation-links.d.ts +2 -31
- package/dist/components/header-navigation/header-navigation-links.d.ts.map +1 -1
- package/dist/components/header-navigation/header-navigation-links.js +11 -30
- 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.d.ts.map +1 -1
- package/dist/components/header-navigation/header-navigation-stacked.stories.js +9 -8
- 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 +9 -24
- package/dist/components/header-navigation/header-navigation.js.map +1 -1
- package/dist/components/header-navigation/header-navigation.module.less +2 -84
- package/dist/components/header-navigation/header-navigation.stories.d.ts +3 -3
- package/dist/components/header-navigation/header-navigation.stories.d.ts.map +1 -1
- package/dist/components/header-navigation/header-navigation.stories.js +9 -8
- 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.js +3 -3
- 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 +18 -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 +30 -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 +117 -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.map +1 -1
- package/dist/components/{side-navigation → left-navigation}/side-navigation.js +2 -2
- package/dist/components/left-navigation/side-navigation.js.map +1 -0
- package/dist/components/{side-navigation → left-navigation}/side-navigation.module.less +3 -3
- package/dist/components/{side-navigation → left-navigation}/side-navigation.stories.d.ts +0 -1
- package/dist/components/left-navigation/side-navigation.stories.d.ts.map +1 -0
- package/dist/components/{side-navigation → left-navigation}/side-navigation.stories.js +1 -1
- package/dist/components/{side-navigation → left-navigation}/side-navigation.stories.js.map +1 -1
- 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/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 +4 -4
- 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 +5 -5
- package/dist/components/profile-dropdown/profile-dropdown-tiny.stories.js.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown.d.ts.map +1 -1
- package/dist/components/profile-dropdown/profile-dropdown.js +9 -22
- 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 +3 -3
- package/dist/components/profile-dropdown/profile-dropdown.stories.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/test/data-stories.module.less +5 -3
- 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} +16 -19
- package/dist/test/data.js.map +1 -0
- package/dist/utils/navigation-context.d.ts +2 -5
- package/dist/utils/navigation-context.d.ts.map +1 -1
- package/dist/utils/navigation-context.js +3 -19
- package/dist/utils/navigation-context.js.map +1 -1
- package/dist/utils/navigation.d.ts +46 -0
- package/dist/utils/navigation.d.ts.map +1 -1
- package/dist/utils/with-tooltip.d.ts +1 -1
- package/package.json +5 -5
- package/src/components/header-navigation/header-navigation-content.tsx +10 -38
- package/src/components/header-navigation/header-navigation-extra-stacked.stories.tsx +19 -0
- package/src/components/header-navigation/header-navigation-extra.stories.tsx +84 -52
- package/src/components/header-navigation/header-navigation-links.tsx +13 -55
- package/src/components/header-navigation/header-navigation-stacked.stories.tsx +6 -8
- package/src/components/header-navigation/header-navigation.module.less +2 -84
- package/src/components/header-navigation/header-navigation.module.less.d.ts +0 -3
- package/src/components/header-navigation/header-navigation.stories.tsx +6 -8
- package/src/components/header-navigation/header-navigation.tsx +7 -120
- package/src/components/header-navigation/index.ts +0 -1
- package/src/components/layout.stories.tsx +3 -3
- package/src/components/left-navigation/header-navigation-extra-tiny.stories.tsx +21 -0
- package/src/components/left-navigation/header-navigation-tiny-links.tsx +134 -0
- package/src/components/left-navigation/header-navigation-tiny.module.less +117 -0
- package/src/components/left-navigation/header-navigation-tiny.module.less.d.ts +15 -0
- package/src/components/{header-navigation → left-navigation}/header-navigation-tiny.stories.tsx +5 -13
- 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 +3 -3
- package/src/components/{side-navigation → left-navigation}/side-navigation.module.less.d.ts +1 -0
- package/src/components/{side-navigation → left-navigation}/side-navigation.stories.tsx +1 -1
- package/src/components/{side-navigation → left-navigation}/side-navigation.tsx +2 -2
- package/src/components/links.tsx +31 -0
- package/src/components/logo/logo.stories.tsx +6 -6
- package/src/components/profile-dropdown/profile-dropdown-stacked.stories.tsx +14 -6
- package/src/components/profile-dropdown/profile-dropdown-tiny.stories.tsx +15 -5
- 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 +3 -3
- package/src/components/profile-dropdown/profile-dropdown.tsx +7 -4
- package/src/index.ts +3 -1
- package/src/test/data-stories.module.less +5 -3
- package/src/test/{data.stories.tsx → data.tsx} +5 -2
- package/src/utils/navigation-context.tsx +3 -8
- package/src/utils/navigation.ts +51 -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 -29
- 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.js.map +0 -1
- package/dist/components/side-navigation/side-navigation.stories.d.ts.map +0 -1
- package/dist/test/data.stories.d.ts.map +0 -1
- package/dist/test/data.stories.js.map +0 -1
- package/src/components/side-navigation/icons.tsx +0 -74
- package/src/components/side-navigation/index.ts +0 -1
- /package/dist/components/{side-navigation → left-navigation}/side-navigation.d.ts +0 -0
|
@@ -10,6 +10,6 @@ const getCounterProps = (props) => {
|
|
|
10
10
|
export const CounterTag = ({ className, data, longClassName }) => {
|
|
11
11
|
var _a;
|
|
12
12
|
const props = getCounterProps(data);
|
|
13
|
-
return props ? (_jsx(Tag,
|
|
13
|
+
return props ? (_jsx(Tag, { ...props, className: classNames(className, props.className, props.children > 10 && longClassName), compact: true, badge: true, color: (_a = props.color) !== null && _a !== void 0 ? _a : 'critical', children: props.children })) : null;
|
|
14
14
|
};
|
|
15
15
|
//# sourceMappingURL=counter-tag.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"counter-tag.js","sourceRoot":"","sources":["../../src/components/counter-tag.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAkB,MAAM,6BAA6B,CAAC;AAClE,OAAO,UAAU,MAAM,YAAY,CAAC;AAepC,MAAM,eAAe,GAAG,CACpB,KAAsC,EACL,EAAE;IACnC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC/B,CAAC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAIlB,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE;;IACxC,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAEpC,OAAO,KAAK,CAAC,CAAC,CAAC,CACX,KAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"counter-tag.js","sourceRoot":"","sources":["../../src/components/counter-tag.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAkB,MAAM,6BAA6B,CAAC;AAClE,OAAO,UAAU,MAAM,YAAY,CAAC;AAepC,MAAM,eAAe,GAAG,CACpB,KAAsC,EACL,EAAE;IACnC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC/B,CAAC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAIlB,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE;;IACxC,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAEpC,OAAO,KAAK,CAAC,CAAC,CAAC,CACX,KAAC,GAAG,OACI,KAAK,EACT,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,QAAQ,GAAG,EAAE,IAAI,aAAa,CAAC,EACvF,OAAO,QACP,KAAK,QACL,KAAK,EAAE,MAAA,KAAK,CAAC,KAAK,mCAAI,UAAU,YAE/B,KAAK,CAAC,QAAQ,GACb,CACT,CAAC,CAAC,CAAC,IAAI,CAAC;AACb,CAAC,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IconProps } from '@servicetitan/anvil2';
|
|
2
1
|
import { IconPropsStrict } from '@servicetitan/design-system';
|
|
3
2
|
import { FC } from 'react';
|
|
4
3
|
import { HeaderNavigationItemData } from '../../utils/navigation';
|
|
@@ -18,12 +17,6 @@ export interface HeaderNavigationItemContentPropsStrict {
|
|
|
18
17
|
iconComponent?: FC;
|
|
19
18
|
/** iconName name of anvil icon */
|
|
20
19
|
iconName?: IconPropsStrict['name'];
|
|
21
|
-
/** svg icon (anvil2) of inactive item */
|
|
22
|
-
icon: IconProps['svg'] | undefined;
|
|
23
|
-
/** svg icon (anvil2) of active item */
|
|
24
|
-
iconActive: IconProps['svg'] | undefined;
|
|
25
|
-
/** show legacy icons */
|
|
26
|
-
isLegacy: boolean;
|
|
27
20
|
}
|
|
28
21
|
/** Content for navigation items */
|
|
29
22
|
export declare const HeaderNavigationItemContent: FC<HeaderNavigationItemContentPropsStrict>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header-navigation-content.d.ts","sourceRoot":"","sources":["../../../src/components/header-navigation/header-navigation-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,
|
|
1
|
+
{"version":3,"file":"header-navigation-content.d.ts","sourceRoot":"","sources":["../../../src/components/header-navigation/header-navigation-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEpE,OAAO,EAAE,EAAE,EAAwB,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAGlE,OAAO,EAAc,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAGjE,MAAM,WAAW,sCAAsC;IACnD,gBAAgB;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6BAA6B;IAC7B,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,mCAAmC;IACnC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gCAAgC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0CAA0C;IAC1C,aAAa,CAAC,EAAE,EAAE,CAAC;IACnB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;CACtC;AAED,mCAAmC;AACnC,eAAO,MAAM,2BAA2B,EAAE,EAAE,CAAC,sCAAsC,CAqClF,CAAC;AAEF,UAAU,+BAAgC,SAAQ,wBAAwB;IACtE,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;CACjB;AAED,gCAAgC;AAChC,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,+BAA+B,CA6CpE,CAAC"}
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Icon } from '@servicetitan/
|
|
3
|
-
import { Icon as IconLegacy } from '@servicetitan/design-system';
|
|
2
|
+
import { Icon } from '@servicetitan/design-system';
|
|
4
3
|
import classNames from 'classnames';
|
|
5
4
|
import { Fragment, useContext } from 'react';
|
|
6
|
-
import {
|
|
5
|
+
import { NavigationComponentContext } from '../../utils/navigation-context';
|
|
7
6
|
import { withTooltip } from '../../utils/with-tooltip';
|
|
8
7
|
import { CounterTag } from '../counter-tag';
|
|
9
8
|
import * as Styles from './header-navigation.module.less';
|
|
10
9
|
/** Content for navigation items */
|
|
11
|
-
export const HeaderNavigationItemContent = ({ title, titleClassName, counter, counterClassName, iconClassName, iconComponent: IconComponent, iconName,
|
|
10
|
+
export const HeaderNavigationItemContent = ({ title, titleClassName, counter, counterClassName, iconClassName, iconComponent: IconComponent, iconName, }) => {
|
|
12
11
|
const iconClass = classNames(Styles.navigationIcon, iconClassName);
|
|
13
|
-
return (_jsxs(Fragment, { children: [
|
|
12
|
+
return (_jsxs(Fragment, { children: [IconComponent ? (_jsx("i", { className: iconClass, children: _jsx(IconComponent, {}) })) : iconName ? (_jsx(Icon, { name: iconName, className: iconClass })) : (_jsx("i", { className: iconClass })), !!title && (_jsx("span", { className: classNames(Styles.navigationItemTitle, titleClassName), children: title })), !!counter && (_jsx(CounterTag, { data: counter, className: classNames(Styles.navigationItemCounter, counterClassName), longClassName: Styles.navigationItemCounterLong }))] }));
|
|
14
13
|
};
|
|
15
14
|
/** Navigation main menu item */
|
|
16
15
|
export const HeaderNavigationItem = ({ id, to, title, hint, counter, className, iconClassName, iconComponent, iconName, isActive, main, minimized, }) => {
|
|
17
|
-
const
|
|
16
|
+
const NavigationComponent = useContext(NavigationComponentContext);
|
|
18
17
|
return withTooltip(_jsx(NavigationComponent, { "data-cy": `navigation-item-${id}`, "data-pendo": `navigation-item-${id}`, to: to, title: hint, className: classNames(Styles.navigationItem, main ? Styles.navigationItemMain : Styles.navigationItemOverflow, className, {
|
|
19
18
|
[Styles.navigationItemActive]: isActive === true,
|
|
20
|
-
}), isActive: typeof isActive === 'function' ? isActive : undefined, activeClassName: Styles.navigationItemActive, children: _jsx(HeaderNavigationItemContent, { title: minimized ? undefined : title, titleClassName: main ? '' : 'm-l-half', counter: counter, iconComponent: iconComponent, iconClassName: iconClassName, iconName: iconName
|
|
19
|
+
}), isActive: typeof isActive === 'function' ? isActive : undefined, activeClassName: Styles.navigationItemActive, children: _jsx(HeaderNavigationItemContent, { title: minimized ? undefined : title, titleClassName: main ? '' : 'm-l-half', counter: counter, iconComponent: iconComponent, iconClassName: iconClassName, iconName: iconName }) }, id), minimized ? title : undefined);
|
|
21
20
|
};
|
|
22
21
|
//# sourceMappingURL=header-navigation-content.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header-navigation-content.js","sourceRoot":"","sources":["../../../src/components/header-navigation/header-navigation-content.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"header-navigation-content.js","sourceRoot":"","sources":["../../../src/components/header-navigation/header-navigation-content.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,6BAA6B,CAAC;AACpE,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,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAuB,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAK,MAAM,MAAM,iCAAiC,CAAC;AAmB1D,mCAAmC;AACnC,MAAM,CAAC,MAAM,2BAA2B,GAA+C,CAAC,EACpF,KAAK,EACL,cAAc,EACd,OAAO,EACP,gBAAgB,EAChB,aAAa,EACb,aAAa,EAAE,aAAa,EAC5B,QAAQ,GACX,EAAE,EAAE;IACD,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC;IACnE,OAAO,CACH,MAAC,QAAQ,eACJ,aAAa,CAAC,CAAC,CAAC,CACb,YAAG,SAAS,EAAE,SAAS,YACnB,KAAC,aAAa,KAAG,GACjB,CACP,CA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,CAAC,CAAC,CAAC,SAAS,EAC/D,eAAe,EAAE,MAAM,CAAC,oBAAoB,YAE5C,KAAC,2BAA2B,IACxB,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,EACpC,cAAc,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,EACtC,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,QAAQ,GACpB,IArBG,EAAE,CAsBW,EACtB,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAChC,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
title: string;
|
|
3
|
+
component: import("react").FC<import("../..").HeaderNavigationLinkProps>;
|
|
4
|
+
decorators: ((Story: any) => import("react/jsx-runtime").JSX.Element)[];
|
|
5
|
+
parameters: {};
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
export { ExtraWithTooltip, ExtraLink, ExtraTrigger, ExtraWithLabel, } from './header-navigation-extra.stories';
|
|
9
|
+
//# sourceMappingURL=header-navigation-extra-stacked.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header-navigation-extra-stacked.stories.d.ts","sourceRoot":"","sources":["../../../src/components/header-navigation/header-navigation-extra-stacked.stories.tsx"],"names":[],"mappings":";;;;;;AAMA,wBAKE;AAEF,OAAO,EACH,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,cAAc,GACjB,MAAM,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { withAnvil, withMemoryRouter } from '../../test/data';
|
|
3
|
+
import { HeaderNavigationLink } from '../links';
|
|
4
|
+
import { HeaderNavigationStacked } from './header-navigation';
|
|
5
|
+
const withHeaderNavigationStacked = (Story) => _jsx(HeaderNavigationStacked, { right: _jsx(Story, {}) });
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Navigation/Extra/Stacked',
|
|
8
|
+
component: HeaderNavigationLink,
|
|
9
|
+
decorators: [withHeaderNavigationStacked, withMemoryRouter, withAnvil],
|
|
10
|
+
parameters: {},
|
|
11
|
+
};
|
|
12
|
+
export { ExtraWithTooltip, ExtraLink, ExtraTrigger, ExtraWithLabel, } from './header-navigation-extra.stories';
|
|
13
|
+
//# sourceMappingURL=header-navigation-extra-stacked.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header-navigation-extra-stacked.stories.js","sourceRoot":"","sources":["../../../src/components/header-navigation/header-navigation-extra-stacked.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,MAAM,2BAA2B,GAAG,CAAC,KAAU,EAAE,EAAE,CAAC,KAAC,uBAAuB,IAAC,KAAK,EAAE,KAAC,KAAK,KAAG,GAAI,CAAC;AAElG,eAAe;IACX,KAAK,EAAE,0BAA0B;IACjC,SAAS,EAAE,oBAAoB;IAC/B,UAAU,EAAE,CAAC,2BAA2B,EAAE,gBAAgB,EAAE,SAAS,CAAC;IACtE,UAAU,EAAE,EAAE;CACjB,CAAC;AAEF,OAAO,EACH,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,cAAc,GACjB,MAAM,mCAAmC,CAAC"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
declare const _default: {
|
|
3
2
|
title: string;
|
|
4
|
-
component: import("react").FC<import("
|
|
3
|
+
component: import("react").FC<import("../..").HeaderNavigationLinkProps>;
|
|
5
4
|
decorators: ((Story: any) => import("react/jsx-runtime").JSX.Element)[];
|
|
6
5
|
parameters: {};
|
|
7
6
|
};
|
|
8
7
|
export default _default;
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
8
|
+
export declare const ExtraLink: () => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const ExtraTrigger: () => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const ExtraWithTooltip: () => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const ExtraWithLabel: () => import("react/jsx-runtime").JSX.Element;
|
|
13
12
|
//# sourceMappingURL=header-navigation-extra.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header-navigation-extra.stories.d.ts","sourceRoot":"","sources":["../../../src/components/header-navigation/header-navigation-extra.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"header-navigation-extra.stories.d.ts","sourceRoot":"","sources":["../../../src/components/header-navigation/header-navigation-extra.stories.tsx"],"names":[],"mappings":";;;;;;AAeA,wBAKE;AAEF,eAAO,MAAM,SAAS,+CAUrB,CAAC;AAEF,eAAO,MAAM,YAAY,+CASxB,CAAC;AAEF,eAAO,MAAM,gBAAgB,+CAwB5B,CAAC;AA0CF,eAAO,MAAM,cAAc,+CAuB1B,CAAC"}
|
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import SvgHelp from '@servicetitan/anvil2/assets/icons/material/round/help_outline.svg';
|
|
3
|
+
import SvgPhone from '@servicetitan/anvil2/assets/icons/material/round/phone.svg';
|
|
4
|
+
import SvgSearch from '@servicetitan/anvil2/assets/icons/material/round/search.svg';
|
|
2
5
|
import { Button, Popover } from '@servicetitan/design-system';
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
+
import { Fragment, useState } from 'react';
|
|
7
|
+
import { withAnvil, withMemoryRouter } from '../../test/data';
|
|
8
|
+
import { HeaderNavigationLink, HeaderNavigationTrigger } from '../links';
|
|
9
|
+
import { HeaderNavigation } from './';
|
|
10
|
+
const withHeaderNavigation = (Story) => (_jsx(HeaderNavigation, { rightClassName: "m-r-1", children: _jsx(Story, {}) }));
|
|
6
11
|
export default {
|
|
7
|
-
title: 'Navigation/
|
|
12
|
+
title: 'Navigation/Extra/Legacy',
|
|
8
13
|
component: HeaderNavigationLink,
|
|
9
|
-
decorators: [withMemoryRouter, withAnvil],
|
|
14
|
+
decorators: [withHeaderNavigation, withMemoryRouter, withAnvil],
|
|
10
15
|
parameters: {},
|
|
11
16
|
};
|
|
12
|
-
const
|
|
13
|
-
export const
|
|
14
|
-
export const
|
|
15
|
-
export const extraCustomTrigger = () => (_jsx(HeaderNavigation, { items: [], navigationComponent: NavLinkMock, children: _jsx(HeaderNavigationTriggerCustom, { id: "help-center", children: _jsx(HelpCenterButton, {}) }) }));
|
|
16
|
-
export const extraWithTooltip = () => (_jsxs(HeaderNavigation, { items: [], navigationComponent: NavLinkMock, rightClassName: "m-r-1", children: [_jsx(HeaderNavigationLink, { id: "search", to: "https://google.com", target: "_blank", iconName: "search", icon: SvgIcon, iconActive: SvgIcon, tooltip: "Search: for all the questions", hint: "Google" }), _jsx(HeaderNavigationTrigger, { id: "dialpad", iconName: "phone", title: "Dialpad", counter: 2, icon: SvgIcon, iconActive: SvgIcon }), _jsx(HelpCenterButton, {})] }));
|
|
17
|
+
export const ExtraLink = () => (_jsx(HeaderNavigationLink, { id: "search", to: "https://google.com", target: "_blank", iconName: "search", icon: SvgSearch, iconActive: undefined, hint: "Search: for all the questions" }));
|
|
18
|
+
export const ExtraTrigger = () => (_jsx(HeaderNavigationTrigger, { id: "dialpad", iconName: "phone", counter: 2, tooltip: "Phones pro", icon: SvgPhone, iconActive: undefined }));
|
|
19
|
+
export const ExtraWithTooltip = () => (_jsxs(Fragment, { children: [_jsx(HeaderNavigationLink, { id: "search", to: "https://google.com", target: "_blank", iconName: "search", icon: SvgSearch, iconActive: undefined, tooltip: "Search: for all the questions", hint: "Google" }), _jsx(HeaderNavigationTrigger, { id: "dialpad", iconName: "phone", hint: "Dialpad", counter: 2, icon: SvgPhone, iconActive: undefined }), _jsx(HelpCenterButton, {})] }));
|
|
17
20
|
const HelpCenterButton = () => {
|
|
18
21
|
const [open, setOpen] = useState(false);
|
|
19
|
-
return (_jsx(Popover, { onClickOutside: () => setOpen(false), open: open, direction: "bl", width: "xs", trigger: _jsx(Button, { className: "c-
|
|
22
|
+
return (_jsx(Popover, { onClickOutside: () => setOpen(false), open: open, direction: "bl", width: "xs", trigger: _jsx(Button, { className: "c-inherit", iconName: "help_outline", fill: "subtle", onClick: () => setOpen(true) }), portal: true, children: "help center" }));
|
|
20
23
|
};
|
|
24
|
+
const HelpTrigger = () => {
|
|
25
|
+
const [active, setActive] = useState(true);
|
|
26
|
+
return (_jsx(HeaderNavigationTrigger, { id: "help", iconName: "help_outline", hint: "Help", icon: SvgHelp, iconActive: undefined, label: "Live Chat", onClick: () => setActive(!active), isActive: active }));
|
|
27
|
+
};
|
|
28
|
+
export const ExtraWithLabel = () => (_jsxs(Fragment, { children: [_jsx(HeaderNavigationLink, { id: "search", to: "https://google.com", target: "_blank", iconName: "search", icon: SvgSearch, iconActive: undefined, tooltip: "Search: for all the questions", hint: "Google" }), _jsx(HelpTrigger, {}), _jsx(HeaderNavigationTrigger, { id: "dialpad", iconName: "phone", hint: "Dialpad", counter: 2, icon: SvgPhone, iconActive: undefined })] }));
|
|
21
29
|
//# sourceMappingURL=header-navigation-extra.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header-navigation-extra.stories.js","sourceRoot":"","sources":["../../../src/components/header-navigation/header-navigation-extra.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"header-navigation-extra.stories.js","sourceRoot":"","sources":["../../../src/components/header-navigation/header-navigation-extra.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,OAAO,MAAM,mEAAmE,CAAC;AACxF,OAAO,QAAQ,MAAM,4DAA4D,CAAC;AAClF,OAAO,SAAS,MAAM,6DAA6D,CAAC;AACpF,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAC;AAEtC,MAAM,oBAAoB,GAAG,CAAC,KAAU,EAAE,EAAE,CAAC,CACzC,KAAC,gBAAgB,IAAC,cAAc,EAAC,OAAO,YACpC,KAAC,KAAK,KAAG,GACM,CACtB,CAAC;AAEF,eAAe;IACX,KAAK,EAAE,yBAAyB;IAChC,SAAS,EAAE,oBAAoB;IAC/B,UAAU,EAAE,CAAC,oBAAoB,EAAE,gBAAgB,EAAE,SAAS,CAAC;IAC/D,UAAU,EAAE,EAAE;CACjB,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC,CAC3B,KAAC,oBAAoB,IACjB,EAAE,EAAC,QAAQ,EACX,EAAE,EAAC,oBAAoB,EACvB,MAAM,EAAC,QAAQ,EACf,QAAQ,EAAC,QAAQ,EACjB,IAAI,EAAE,SAAS,EACf,UAAU,EAAE,SAAS,EACrB,IAAI,EAAC,+BAA+B,GACtC,CACL,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,CAC9B,KAAC,uBAAuB,IACpB,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AAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAE3C,OAAO,CACH,KAAC,uBAAuB,IACpB,EAAE,EAAC,MAAM,EACT,QAAQ,EAAC,cAAc,EACvB,IAAI,EAAC,MAAM,EACX,IAAI,EAAE,OAAO,EACb,UAAU,EAAE,SAAS,EACrB,KAAK,EAAC,WAAW,EACjB,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,EACjC,QAAQ,EAAE,MAAM,GAClB,CACL,CAAC;AACN,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,CAChC,MAAC,QAAQ,eACL,KAAC,oBAAoB,IACjB,EAAE,EAAC,QAAQ,EACX,EAAE,EAAC,oBAAoB,EACvB,MAAM,EAAC,QAAQ,EACf,QAAQ,EAAC,QAAQ,EACjB,IAAI,EAAE,SAAS,EACf,UAAU,EAAE,SAAS,EACrB,OAAO,EAAC,+BAA+B,EACvC,IAAI,EAAC,QAAQ,GACf,EAEF,KAAC,WAAW,KAAG,EACf,KAAC,uBAAuB,IACpB,EAAE,EAAC,SAAS,EACZ,QAAQ,EAAC,OAAO,EAChB,IAAI,EAAC,SAAS,EACd,OAAO,EAAE,CAAC,EACV,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,SAAS,GACvB,IACK,CACd,CAAC"}
|
|
@@ -1,33 +1,5 @@
|
|
|
1
|
-
import { FC,
|
|
2
|
-
import {
|
|
3
|
-
export interface HeaderNavigationTriggerPropsStrict extends Omit<HeaderNavigationItemContentPropsStrict, 'title' | 'isLegacy'> {
|
|
4
|
-
/** unique identifier */
|
|
5
|
-
id: string;
|
|
6
|
-
/** tooltip text */
|
|
7
|
-
tooltip?: string;
|
|
8
|
-
/** item description */
|
|
9
|
-
hint?: string;
|
|
10
|
-
/** container class name */
|
|
11
|
-
className?: string;
|
|
12
|
-
/** isActive */
|
|
13
|
-
isActive?: boolean;
|
|
14
|
-
}
|
|
15
|
-
interface HeaderNavigationTriggerProps extends HeaderNavigationTriggerPropsStrict {
|
|
16
|
-
/** unstrict props */
|
|
17
|
-
[key: string]: any;
|
|
18
|
-
}
|
|
19
|
-
export interface HeaderNavigationLinkPropsStrict extends Omit<HeaderNavigationTriggerPropsStrict, 'isActive'> {
|
|
20
|
-
/** link href */
|
|
21
|
-
to: string;
|
|
22
|
-
/** isActive */
|
|
23
|
-
isActive?: boolean | ((pathname: string) => boolean);
|
|
24
|
-
/** link html target */
|
|
25
|
-
target?: HTMLAttributeAnchorTarget;
|
|
26
|
-
}
|
|
27
|
-
export interface HeaderNavigationLinkProps extends HeaderNavigationLinkPropsStrict {
|
|
28
|
-
/** unstrict props */
|
|
29
|
-
[key: string]: any;
|
|
30
|
-
}
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { HeaderNavigationLinkProps, HeaderNavigationTriggerProps } from '../../utils/navigation';
|
|
31
3
|
/** Navigation extra item with link */
|
|
32
4
|
export declare const HeaderNavigationLink: FC<HeaderNavigationLinkProps>;
|
|
33
5
|
/** Navigation extra item with icon button */
|
|
@@ -36,5 +8,4 @@ export declare const HeaderNavigationTrigger: FC<HeaderNavigationTriggerProps>;
|
|
|
36
8
|
export declare const HeaderNavigationTriggerCustom: FC<Omit<HeaderNavigationTriggerProps, 'counter' | 'iconSize' | 'iconName' | 'iconComponent' | 'iconClassName' | 'icon' | 'iconActive'> & {
|
|
37
9
|
children: ReactNode;
|
|
38
10
|
}>;
|
|
39
|
-
export {};
|
|
40
11
|
//# sourceMappingURL=header-navigation-links.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header-navigation-links.d.ts","sourceRoot":"","sources":["../../../src/components/header-navigation/header-navigation-links.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"header-navigation-links.d.ts","sourceRoot":"","sources":["../../../src/components/header-navigation/header-navigation-links.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,SAAS,EAAc,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAMjG,sCAAsC;AACtC,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CA4C9D,CAAC;AAEF,6CAA6C;AAC7C,eAAO,MAAM,uBAAuB,EAAE,EAAE,CAAC,4BAA4B,CAyCpE,CAAC;AAEF,gDAAgD;AAChD,eAAO,MAAM,6BAA6B,EAAE,EAAE,CAC1C,IAAI,CACA,4BAA4B,EAC1B,SAAS,GACT,UAAU,GACV,UAAU,GACV,eAAe,GACf,eAAe,GACf,MAAM,GACN,YAAY,CACjB,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,CAkB1B,CAAC"}
|
|
@@ -1,44 +1,25 @@
|
|
|
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 { createElement as _createElement } from "react";
|
|
14
3
|
import classNames from 'classnames';
|
|
15
4
|
import { useContext } from 'react';
|
|
16
|
-
import {
|
|
5
|
+
import { NavigationComponentContext } from '../../utils/navigation-context';
|
|
17
6
|
import { withTooltip } from '../../utils/with-tooltip';
|
|
18
|
-
import { HeaderNavigationItemContent
|
|
7
|
+
import { HeaderNavigationItemContent } from './header-navigation-content';
|
|
19
8
|
import * as Styles from './header-navigation.module.less';
|
|
20
9
|
/** Navigation extra item with link */
|
|
21
|
-
export const HeaderNavigationLink = (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
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, Styles.navigationItem, className, {
|
|
10
|
+
export const HeaderNavigationLink = ({ id, to, hint, tooltip, counter, className, iconClassName, iconComponent, iconName, isActive, label, labelClassName, target, ...rest }) => {
|
|
11
|
+
const NavigationComponent = useContext(NavigationComponentContext);
|
|
12
|
+
return withTooltip(_createElement(NavigationComponent, { "data-cy": `navigation-link-${id}`, "data-pendo": `navigation-link-${id}`, ...rest, key: id, to: to, title: hint, className: classNames(Styles.navigationLink, Styles.navigationItem, className, {
|
|
25
13
|
[Styles.navigationItemActive]: isActive === true,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
_jsx(HeaderNavigationItemContent, { counter: counter, iconComponent: iconComponent, iconClassName: iconClassName, iconName: iconName, icon: icon, iconActive: iconActive, isLegacy: isLegacy })), tooltip);
|
|
14
|
+
}), isActive: typeof isActive === 'function' ? isActive : undefined, activeClassName: Styles.navigationItemActive, target: target },
|
|
15
|
+
_jsx(HeaderNavigationItemContent, { counter: counter, iconComponent: iconComponent, iconClassName: iconClassName, iconName: iconName, title: label, titleClassName: labelClassName })), tooltip);
|
|
29
16
|
};
|
|
30
17
|
/** Navigation extra item with icon button */
|
|
31
|
-
export const HeaderNavigationTrigger = (
|
|
32
|
-
|
|
33
|
-
const { isLegacy } = useContext(NavigationContext);
|
|
34
|
-
return withTooltip(_jsx("div", Object.assign({ "data-cy": `navigation-trigger-${id}`, "data-pendo": `navigation-trigger-${id}` }, rest, { title: hint, className: classNames(Styles.navigationItem, Styles.navigationLink, {
|
|
18
|
+
export const HeaderNavigationTrigger = ({ id, className, counter, iconClassName, iconComponent, iconName, isActive, label, labelClassName, hint, tooltip, ...rest }) => {
|
|
19
|
+
return withTooltip(_jsx("div", { "data-cy": `navigation-trigger-${id}`, "data-pendo": `navigation-trigger-${id}`, ...rest, title: hint, className: classNames(Styles.navigationItem, Styles.navigationLink, {
|
|
35
20
|
[Styles.navigationItemActive]: isActive === true,
|
|
36
|
-
|
|
37
|
-
}, 'cursor-pointer', className), children: _jsx(HeaderNavigationItemContent, { counter: counter, iconComponent: iconComponent, iconClassName: iconClassName, iconName: iconName, icon: icon, iconActive: iconActive, isLegacy: isLegacy }) })), tooltip);
|
|
21
|
+
}, 'cursor-pointer', className), children: _jsx(HeaderNavigationItemContent, { counter: counter, iconComponent: iconComponent, iconClassName: iconClassName, iconName: iconName, title: label, titleClassName: labelClassName }) }), tooltip);
|
|
38
22
|
};
|
|
39
23
|
/** Navigation extra item with custom content */
|
|
40
|
-
export const HeaderNavigationTriggerCustom = (
|
|
41
|
-
var { children, id, className, tooltip, title } = _a, rest = __rest(_a, ["children", "id", "className", "tooltip", "title"]);
|
|
42
|
-
return withTooltip(_jsx("div", Object.assign({ "data-cy": `navigation-custom-${id}`, "data-pendo": `navigation-custom-${id}` }, rest, { title: title, className: classNames(Styles.navigationItem, Styles.navigationLink, 'cursor-pointer', className), children: children })), tooltip);
|
|
43
|
-
};
|
|
24
|
+
export const HeaderNavigationTriggerCustom = ({ children, id, className, tooltip, title, ...rest }) => withTooltip(_jsx("div", { "data-cy": `navigation-custom-${id}`, "data-pendo": `navigation-custom-${id}`, ...rest, title: title, className: classNames(Styles.navigationItem, Styles.navigationLink, 'cursor-pointer', className), children: children }), tooltip);
|
|
44
25
|
//# sourceMappingURL=header-navigation-links.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header-navigation-links.js","sourceRoot":"","sources":["../../../src/components/header-navigation/header-navigation-links.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"header-navigation-links.js","sourceRoot":"","sources":["../../../src/components/header-navigation/header-navigation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|
|
@@ -6,7 +6,7 @@ declare const _default: {
|
|
|
6
6
|
decorators: ((Story: any) => import("react/jsx-runtime").JSX.Element)[];
|
|
7
7
|
};
|
|
8
8
|
export default _default;
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
9
|
+
export declare const DefaultNavigation: () => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const WithLogoTextAndOverflow: () => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const WithAllMonolithData: () => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
//# sourceMappingURL=header-navigation-stacked.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header-navigation-stacked.stories.d.ts","sourceRoot":"","sources":["../../../src/components/header-navigation/header-navigation-stacked.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;;;;;;;
|
|
1
|
+
{"version":3,"file":"header-navigation-stacked.stories.d.ts","sourceRoot":"","sources":["../../../src/components/header-navigation/header-navigation-stacked.stories.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;;;;;;;AASrC,wBAKE;AAIF,eAAO,MAAM,iBAAiB,+CAa7B,CAAC;AAEF,eAAO,MAAM,uBAAuB,+CAmBnC,CAAC;AAQF,eAAO,MAAM,mBAAmB,+CAgF/B,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Input, Stack } from '@servicetitan/design-system';
|
|
3
3
|
import { Fragment } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { SearchIcon, items, withMemoryRouter } from '../../test/data';
|
|
5
5
|
import { LogoCompanyTitle } from '../logo/logo-company-title';
|
|
6
6
|
import { LogoTitan, LogoTitanTitle } from '../logo/logo-titan-text';
|
|
7
7
|
import { ProfileDropdown } from '../profile-dropdown/profile-dropdown';
|
|
8
|
+
import { HeaderNavigationLink, HeaderNavigationTrigger } from './header-navigation-links';
|
|
8
9
|
import * as Styles from './header-navigation-stories.module.less';
|
|
9
|
-
import {
|
|
10
|
+
import { HeaderNavigationStacked } from './';
|
|
10
11
|
export default {
|
|
11
12
|
title: 'Navigation/HeaderNavigationStacked',
|
|
12
13
|
component: HeaderNavigationStacked,
|
|
@@ -14,15 +15,15 @@ export default {
|
|
|
14
15
|
decorators: [withMemoryRouter],
|
|
15
16
|
};
|
|
16
17
|
const SvgIcon = undefined;
|
|
17
|
-
export const
|
|
18
|
+
export const DefaultNavigation = () => (_jsx(HeaderNavigationStacked, { left: _jsx(LogoCompanyTitle, { className: "m-l-1", fill: "#fff", size: "150" }), leftClassName: "d-f align-items-center", items: [
|
|
18
19
|
items.dashboard,
|
|
19
20
|
items.calendar,
|
|
20
21
|
items.calls,
|
|
21
22
|
items.accounting,
|
|
22
23
|
items.dispatch,
|
|
23
24
|
items.fleet,
|
|
24
|
-
]
|
|
25
|
-
export const
|
|
25
|
+
] }));
|
|
26
|
+
export const WithLogoTextAndOverflow = () => (_jsx(HeaderNavigationStacked, { left: _jsxs(Stack, { alignItems: "center", children: [_jsx(LogoTitan, { mantleFill: "#2270EE", size: 44 }), _jsx(LogoTitanTitle, { className: "c-white m-l-1", children: "Commercial" })] }), items: [
|
|
26
27
|
items.dashboard,
|
|
27
28
|
items.calendar,
|
|
28
29
|
items.calls,
|
|
@@ -30,9 +31,9 @@ export const withLogoTextAndOverflow = () => (_jsx(HeaderNavigationStacked, { le
|
|
|
30
31
|
items.dispatch,
|
|
31
32
|
items.purchasing,
|
|
32
33
|
items.fleet,
|
|
33
|
-
], itemsOverflow: [items.calls, items.accounting, items.purchasing, items.dispatch]
|
|
34
|
+
], itemsOverflow: [items.calls, items.accounting, items.purchasing, items.dispatch] }));
|
|
34
35
|
const TimeZoneOffset = () => (_jsx("div", { className: "fs-2 ff-default p-r-2", children: _jsx("span", { children: "EST (-9 hrs)" }) }));
|
|
35
|
-
export const
|
|
36
|
+
export const WithAllMonolithData = () => (_jsx(HeaderNavigationStacked, { left: _jsx(LogoCompanyTitle, { className: "m-l-1", fill: "#fff", size: "150" }), leftClassName: "d-f align-items-center", items: [
|
|
36
37
|
items.dashboard,
|
|
37
38
|
items.calendar,
|
|
38
39
|
items.calls,
|
|
@@ -45,5 +46,5 @@ export const withAllMonolithData = () => (_jsx(HeaderNavigationStacked, { left:
|
|
|
45
46
|
items.priceBook,
|
|
46
47
|
items.pointOfSale,
|
|
47
48
|
items.reports,
|
|
48
|
-
],
|
|
49
|
+
], 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: SvgIcon, iconActive: SvgIcon }), _jsx(HeaderNavigationTrigger, { id: "dialpad", iconName: "phone", counter: 2, icon: SvgIcon, iconActive: SvgIcon }), _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" })] })] }), center: _jsx(Input, { placeholder: "Search smth", size: "xsmall", className: "w-100" }), centerClassName: "d-f align-items-center" }));
|
|
49
50
|
//# sourceMappingURL=header-navigation-stacked.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header-navigation-stacked.stories.js","sourceRoot":"","sources":["../../../src/components/header-navigation/header-navigation-stacked.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"header-navigation-stacked.stories.js","sourceRoot":"","sources":["../../../src/components/header-navigation/header-navigation-stacked.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACpE,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,uBAAuB,EAAE,MAAM,IAAI,CAAC;AAE7C,eAAe;IACX,KAAK,EAAE,oCAAoC;IAC3C,SAAS,EAAE,uBAAuB;IAClC,UAAU,EAAE,EAAE;IACd,UAAU,EAAE,CAAC,gBAAgB,CAAC;CACjC,CAAC;AAEF,MAAM,OAAO,GAAG,SAAgB,CAAC;AAEjC,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC,CACnC,KAAC,uBAAuB,IACpB,IAAI,EAAE,KAAC,gBAAgB,IAAC,SAAS,EAAC,OAAO,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,K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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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PopoverPropsStrict } from '@servicetitan/design-system';
|
|
2
2
|
import { FC, ReactElement, ReactNode } from 'react';
|
|
3
|
-
import { HeaderNavigationItemData
|
|
3
|
+
import { HeaderNavigationItemData } from '../../utils/navigation';
|
|
4
4
|
export interface HeaderNavigationOverflowProps {
|
|
5
5
|
direction: PopoverPropsStrict['direction'];
|
|
6
6
|
width: PopoverPropsStrict['width'];
|
|
@@ -25,8 +25,6 @@ export interface HeaderNavigationProps {
|
|
|
25
25
|
items?: HeaderNavigationItemData[];
|
|
26
26
|
/** main navigation overflow items */
|
|
27
27
|
itemsOverflow?: HeaderNavigationItemData[];
|
|
28
|
-
/** navigation component used for routing */
|
|
29
|
-
navigationComponent?: FC<NavLinkComponentProps>;
|
|
30
28
|
/** props for main items overflow component */
|
|
31
29
|
overflow?: HeaderNavigationOverflowProps;
|
|
32
30
|
}
|
|
@@ -54,33 +52,8 @@ export interface HeaderNavigationStackedProps {
|
|
|
54
52
|
items?: HeaderNavigationItemData[];
|
|
55
53
|
/** main navigation overflow items */
|
|
56
54
|
itemsOverflow?: HeaderNavigationItemData[];
|
|
57
|
-
/** navigation component used for routing */
|
|
58
|
-
navigationComponent?: FC<NavLinkComponentProps>;
|
|
59
55
|
/** props for main items overflow component */
|
|
60
56
|
overflow?: HeaderNavigationOverflowProps;
|
|
61
57
|
}
|
|
62
58
|
export declare const HeaderNavigationStacked: FC<HeaderNavigationStackedProps>;
|
|
63
|
-
export interface HeaderNavigationTinyProps {
|
|
64
|
-
/** container class name */
|
|
65
|
-
className?: string;
|
|
66
|
-
/** extra navigation */
|
|
67
|
-
right?: ReactNode;
|
|
68
|
-
/** extra navigation container class name */
|
|
69
|
-
rightClassName?: string;
|
|
70
|
-
/** container id */
|
|
71
|
-
id?: string;
|
|
72
|
-
/** left content (usually used for logo) */
|
|
73
|
-
left?: ReactElement;
|
|
74
|
-
/** left container class name */
|
|
75
|
-
leftClassName?: string;
|
|
76
|
-
/** center content */
|
|
77
|
-
center?: ReactElement;
|
|
78
|
-
/** center container class name */
|
|
79
|
-
centerClassName?: string;
|
|
80
|
-
/** minimal width for navigation bar */
|
|
81
|
-
minWidth?: number;
|
|
82
|
-
/** navigation component used for routing */
|
|
83
|
-
navigationComponent?: FC<NavLinkComponentProps>;
|
|
84
|
-
}
|
|
85
|
-
export declare const HeaderNavigationTiny: FC<HeaderNavigationTinyProps>;
|
|
86
59
|
//# sourceMappingURL=header-navigation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header-navigation.d.ts","sourceRoot":"","sources":["../../../src/components/header-navigation/header-navigation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEhF,OAAO,
|
|
1
|
+
{"version":3,"file":"header-navigation.d.ts","sourceRoot":"","sources":["../../../src/components/header-navigation/header-navigation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEhF,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,SAAS,EAA4C,MAAM,OAAO,CAAC;AAC9F,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAYlE,MAAM,WAAW,6BAA6B;IAC1C,SAAS,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAC3C,KAAK,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACnC,MAAM,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