@servicetitan/navigation 11.0.0-canary.237.4d902dc.0 → 11.0.0-canary.237.6ce8e81.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.
Files changed (53) hide show
  1. package/dist/components/header-navigation/header-navigation-stacked.stories.js +1 -1
  2. package/dist/components/header-navigation/header-navigation-stacked.stories.js.map +1 -1
  3. package/dist/components/header-navigation/header-navigation.stories.js +1 -1
  4. package/dist/components/header-navigation/header-navigation.stories.js.map +1 -1
  5. package/dist/components/left-navigation/header-navigation-tiny.stories.js +2 -2
  6. package/dist/components/left-navigation/header-navigation-tiny.stories.js.map +1 -1
  7. package/dist/components/profile-dropdown/profile-dropdown.d.ts +9 -7
  8. package/dist/components/profile-dropdown/profile-dropdown.d.ts.map +1 -1
  9. package/dist/components/profile-dropdown/profile-dropdown.js.map +1 -1
  10. package/dist/components/titan-layout/layout-header.d.ts.map +1 -1
  11. package/dist/components/titan-layout/layout-header.js +1 -1
  12. package/dist/components/titan-layout/layout-header.js.map +1 -1
  13. package/dist/components/titan-layout/layout-header.module.less +37 -16
  14. package/dist/components/titan-layout/layout-profile.d.ts.map +1 -1
  15. package/dist/components/titan-layout/layout-profile.js +13 -4
  16. package/dist/components/titan-layout/layout-profile.js.map +1 -1
  17. package/dist/components/titan-layout/layout-profile.stories.d.ts.map +1 -1
  18. package/dist/components/titan-layout/layout-profile.stories.js +1 -1
  19. package/dist/components/titan-layout/layout-profile.stories.js.map +1 -1
  20. package/dist/components/titan-layout/layout-sidebar-links.d.ts.map +1 -1
  21. package/dist/components/titan-layout/layout-sidebar-links.js +2 -2
  22. package/dist/components/titan-layout/layout-sidebar-links.js.map +1 -1
  23. package/dist/components/titan-layout/layout-sidebar.d.ts +0 -1
  24. package/dist/components/titan-layout/layout-sidebar.d.ts.map +1 -1
  25. package/dist/components/titan-layout/layout-sidebar.js +2 -2
  26. package/dist/components/titan-layout/layout-sidebar.js.map +1 -1
  27. package/dist/components/titan-layout/layout-sidebar.module.less +4 -16
  28. package/dist/components/titan-layout/titan-layout.d.ts +4 -3
  29. package/dist/components/titan-layout/titan-layout.d.ts.map +1 -1
  30. package/dist/components/titan-layout/titan-layout.js +39 -11
  31. package/dist/components/titan-layout/titan-layout.js.map +1 -1
  32. package/dist/components/titan-layout/titan-layout.module.less +47 -16
  33. package/dist/components/titan-layout/titan-layout.stories.d.ts +13 -11
  34. package/dist/components/titan-layout/titan-layout.stories.d.ts.map +1 -1
  35. package/dist/components/titan-layout/titan-layout.stories.js +30 -12
  36. package/dist/components/titan-layout/titan-layout.stories.js.map +1 -1
  37. package/package.json +2 -2
  38. package/src/components/header-navigation/header-navigation-stacked.stories.tsx +1 -1
  39. package/src/components/header-navigation/header-navigation.stories.tsx +1 -1
  40. package/src/components/left-navigation/header-navigation-tiny.stories.tsx +2 -2
  41. package/src/components/profile-dropdown/profile-dropdown.tsx +9 -6
  42. package/src/components/titan-layout/layout-header.module.less +37 -16
  43. package/src/components/titan-layout/layout-header.tsx +5 -1
  44. package/src/components/titan-layout/layout-profile.stories.tsx +9 -0
  45. package/src/components/titan-layout/layout-profile.tsx +18 -6
  46. package/src/components/titan-layout/layout-sidebar-links.tsx +5 -2
  47. package/src/components/titan-layout/layout-sidebar.module.less +4 -16
  48. package/src/components/titan-layout/layout-sidebar.module.less.d.ts +0 -2
  49. package/src/components/titan-layout/layout-sidebar.tsx +1 -4
  50. package/src/components/titan-layout/titan-layout.module.less +47 -16
  51. package/src/components/titan-layout/titan-layout.module.less.d.ts +4 -0
  52. package/src/components/titan-layout/titan-layout.stories.tsx +156 -18
  53. package/src/components/titan-layout/titan-layout.tsx +89 -17
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import classNames from 'classnames';
3
- import { Children, Fragment, isValidElement, useCallback, useEffect, useMemo, useState, } from 'react';
3
+ import { Children, Fragment, isValidElement, useCallback, useEffect, useMemo, useRef, useState, } from 'react';
4
4
  import { DefaultNavLinkComponent } from '../../utils/navigation-context';
5
5
  import { useTitanBreakpoint } from '../../utils/use-breakpoint';
6
6
  import { LayoutContext, LayoutPlacementContext, } from './layout-context';
@@ -26,7 +26,7 @@ const useVariant = (appearance) => useMemo(() => {
26
26
  isLegacy,
27
27
  isAnvil1,
28
28
  isAnvil2,
29
- isSequent: isLegacy || isAnvil1,
29
+ isSequent: isLegacy || isAnvil2,
30
30
  };
31
31
  }, [appearance]);
32
32
  const useLayoutChildren = (children) => useMemo(() => Children.toArray(children).reduce((out, item) => {
@@ -45,7 +45,7 @@ const useLayoutChildren = (children) => useMemo(() => Children.toArray(children)
45
45
  }, {
46
46
  logo: _jsx(TitanLayoutLogo, {}),
47
47
  }), [children]);
48
- const TitanLayoutComponent = ({ appearance = 'anvil2', id, children, navigationComponent, header, profile, state, onStateChange, navigationMainItems, extraLinks, extraLinksTop, extraText, sidebarTop, }) => {
48
+ const TitanLayoutComponent = ({ appearance = 'anvil2', id, children, navigationComponent, header, top, profile, state, onStateChange, navigationMainItems, extraLinks, extraLinksTop, extraText, sideTop, }) => {
49
49
  const breakpoint = useTitanBreakpoint();
50
50
  const isMobile = breakpoint.isMobile;
51
51
  const context = useMemo(() => ({
@@ -87,23 +87,51 @@ const TitanLayoutComponent = ({ appearance = 'anvil2', id, children, navigationC
87
87
  submenuExpanded: expanded ? id : undefined,
88
88
  });
89
89
  }, [state, onStateChange]);
90
- const [layoutStyles] = useState({});
91
90
  const layoutClass = variant.isLegacy
92
91
  ? Styles.layoutLegacy
93
92
  : variant.isAnvil1
94
93
  ? Styles.layoutAnvil1
95
94
  : Styles.layoutAnvil2;
96
- return (_jsx(LayoutContext.Provider, { value: context, children: _jsx(LayoutPlacementContext.Provider, { value: "unset", children: _jsxs("div", { id: id, className: classNames(Styles.layout, isMobile
97
- ? Styles.layoutMobile
98
- : (state === null || state === void 0 ? void 0 : state.navCollapsed)
99
- ? Styles.layoutNavSlim
100
- : Styles.layoutNavWide, layoutClass), style: layoutStyles, children: [variant.isSequent && _jsx("div", { className: Styles.topPlaceholder }), _jsx(LayoutHeader, { className: Styles.top, logo: logo, profile: isMobile ? undefined : profile, center: header, rightText: isMobile ? undefined : extraText, right: _jsxs(Fragment, { children: [extraLinksTop, !isMobile && extraLinks] }), onBurgerClick: onBurgerClick }), _jsx(LayoutSidebar, { flex: !variant.isSequent, mobile: breakpoint.isMobile, barExpanded: isMobile ? mobileDrawerOpened : !(state === null || state === void 0 ? void 0 : state.navCollapsed), submenuExpanded: state === null || state === void 0 ? void 0 : state.submenuExpanded, onBarExpandChange: onBarExpandChange, onSubmenuExpandChange: onSubmenuExpandChange, top: sidebarTop, mainItems: navigationMainItems, navigationComponent: context.NavigationComponent, bottom: isMobile ? (_jsxs(Fragment, { children: [profile, extraLinks, !!extraText && (_jsx(InternalSideNavigationTrigger, { id: "__extra_text", title: extraText, submenuExpanded: undefined, dataPrefix: "navigation-extra-text", tag: undefined, icon: undefined, iconActive: undefined }))] })) : undefined }), content] }) }) }));
95
+ return (_jsx(LayoutContext.Provider, { value: context, children: _jsx(LayoutPlacementContext.Provider, { value: "unset", children: _jsxs("div", { id: id, className: classNames(Styles.layout, isMobile ? Styles.layoutMobile : Styles.layoutDesktop, !isMobile && (state === null || state === void 0 ? void 0 : state.navCollapsed)
96
+ ? Styles.layoutNavSlim
97
+ : Styles.layoutNavWide, layoutClass), children: [variant.isSequent && _jsx("div", { className: Styles.topPlaceholder }), _jsx(LayoutHeader, { className: Styles.top, logo: logo, profile: isMobile ? undefined : profile, center: top, rightText: isMobile ? undefined : extraText, right: _jsxs(Fragment, { children: [extraLinksTop, !isMobile && extraLinks] }), onBurgerClick: onBurgerClick }), _jsx(LayoutSidebar, { className: Styles.side, mobile: breakpoint.isMobile, barExpanded: isMobile ? mobileDrawerOpened : !(state === null || state === void 0 ? void 0 : state.navCollapsed), submenuExpanded: state === null || state === void 0 ? void 0 : state.submenuExpanded, onBarExpandChange: onBarExpandChange, onSubmenuExpandChange: onSubmenuExpandChange, top: sideTop, mainItems: navigationMainItems, navigationComponent: context.NavigationComponent, bottom: isMobile ? (_jsxs(Fragment, { children: [profile, extraLinks, !!extraText && (_jsx(InternalSideNavigationTrigger, { id: "__extra_text", title: extraText, submenuExpanded: undefined, dataPrefix: "navigation-extra-text", tag: undefined, icon: undefined, iconActive: undefined }))] })) : undefined }), _jsx(LayoutContent, { header: header, anvil2: variant.isAnvil2, anvil1: variant.isAnvil1, children: content })] }) }) }));
98
+ };
99
+ const TitanLayoutHeaderObserved = ({ children, heightChange }) => {
100
+ const ref = useRef(null);
101
+ useEffect(() => {
102
+ if (ref.current) {
103
+ const updatePosition = () => {
104
+ if (ref.current && heightChange) {
105
+ const pos = ref.current.getBoundingClientRect();
106
+ heightChange(pos.height);
107
+ }
108
+ };
109
+ const observer = new ResizeObserver(updatePosition);
110
+ observer.observe(ref.current);
111
+ updatePosition();
112
+ return () => observer.disconnect();
113
+ }
114
+ }, [heightChange]);
115
+ useEffect(() => {
116
+ return () => {
117
+ heightChange === null || heightChange === void 0 ? void 0 : heightChange(0);
118
+ };
119
+ }, [heightChange]);
120
+ return (_jsx("div", { ref: ref, className: Styles.header, children: children }));
101
121
  };
102
122
  const TitanLayoutContent = ({ children }) => children;
123
+ const LayoutContent = ({ anvil1, anvil2, children, header }) => {
124
+ const [anvil2Styles, setAnvil2Styles] = useState({});
125
+ const updateIndicatorsHeight = useCallback((offset) => {
126
+ setAnvil2Styles({ '--offset': `calc(var(--nav-offset-top) + ${offset}px)` });
127
+ }, []);
128
+ return (_jsxs("div", { className: Styles.content, style: anvil2Styles, children: [!!header &&
129
+ (anvil2 ? (_jsx(TitanLayoutHeaderObserved, { heightChange: updateIndicatorsHeight, children: header })) : (header)), anvil1 ? (_jsx("div", { className: "position-relative d-f flex-grow-1 flex-basis-0 of-hidden", children: children })) : (children)] }));
130
+ };
103
131
  export const TitanLayout = Object.assign(TitanLayoutComponent, {
104
132
  Content: TitanLayoutContent,
105
133
  Logo: TitanLayoutLogo,
106
- SidebarLink: TitanLayoutSidebarLink,
107
- SidebarTrigger: TitanLayoutSidebarTrigger,
134
+ Link: TitanLayoutSidebarLink,
135
+ Trigger: TitanLayoutSidebarTrigger,
108
136
  });
109
137
  //# sourceMappingURL=titan-layout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"titan-layout.js","sourceRoot":"","sources":["../../../src/components/titan-layout/titan-layout.tsx"],"names":[],"mappings":";AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAEH,QAAQ,EAGR,QAAQ,EAGR,cAAc,EACd,WAAW,EACX,SAAS,EACT,OAAO,EACP,QAAQ,GACX,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,uBAAuB,EAAyB,MAAM,gCAAgC,CAAC;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EACH,aAAa,EACb,sBAAsB,GAGzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAwB,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAC3F,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AA6BrD,MAAM,qBAAqB,GAAkC;IACzD,MAAM,EAAE;QACJ,cAAc,EAAE;YACZ,2BAA2B,EAAE,SAAS;YACtC,OAAO,EAAE,oBAAoB;SACf;KACrB;CACJ,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,UAA0C,EAAE,EAAE,CAC9D,OAAO,CAAC,GAAG,EAAE;IACT,MAAM,QAAQ,GAAG,UAAU,KAAK,QAAQ,CAAC;IACzC,MAAM,QAAQ,GAAG,UAAU,KAAK,QAAQ,CAAC;I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AAC,CAAC;AAKF,MAAM,kBAAkB,GAAgC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC;AAEnF,MAAM,aAAa,GAKd,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE;IAC1C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAS,EAAE,CAAC,CAAC;IAC7D,MAAM,sBAAsB,GAAG,WAAW,CAAC,CAAC,MAAc,EAAE,EAAE;QAC1D,eAAe,CAAC,EAAE,UAAU,EAAE,gCAAgC,MAAM,KAAK,EAAE,CAAC,CAAC;IACjF,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACH,eAAK,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,YAAY,aAC9C,CAAC,CAAC,MAAM;gBACL,CAAC,MAAM,CAAC,CAAC,CAAC,CACN,KAAC,yBAAyB,IAAC,YAAY,EAAE,sBAAsB,YAC1D,MAAM,GACiB,CAC/B,CAAC,CAAC,CAAC,CACA,MAAM,CACT,CAAC,EACL,MAAM,CAAC,CAAC,CAAC,CACN,cAAK,SAAS,EAAC,0DAA0D,YACpE,QAAQ,GACP,CACT,CAAC,CAAC,CAAC,CACA,QAAQ,CACX,IACC,CACT,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,oBAAoB,EAAE;IAC3D,OAAO,EAAE,kBAAkB;IAC3B,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE,sBAAsB;IAC5B,OAAO,EAAE,yBAAyB;CACrC,CAAC,CAAC"}
@@ -8,30 +8,53 @@
8
8
  @bg-color-hover: rgba(255, 255, 255, 0.08);
9
9
  @bg-color-active: rgba(120, 187, 250, 0.2);
10
10
 
11
- .layout-legacy {
12
- padding-left: var(--nav-offset-left);
13
- }
14
-
15
11
  .layout-anvil1 {
16
- display: block;
17
- }
12
+ height: calc(100vh - var(--nav-offset-top));
13
+ margin-top: var(--nav-offset-top);
18
14
 
19
- .layout-anvil2 {
20
- display: block;
15
+ display: flex;
16
+ flex-direction: row;
17
+
18
+ .side {
19
+ flex-basis: var(--nav-offset-left);
20
+ flex-grow: 0;
21
+ flex-shrink: 0;
22
+ }
23
+
24
+ .content {
25
+ flex-grow: 1;
26
+
27
+ display: flex;
28
+ flex-direction: column;
29
+ overflow: hidden;
30
+ }
21
31
  }
22
32
 
23
- .layout-legacy,
24
33
  .layout-anvil2 {
25
- .top-placeholder {
26
- height: var(--nav-offset-top);
34
+ .header {
35
+ position: sticky;
36
+ top: var(--nav-offset-top);
37
+ z-index: 989;
27
38
  }
39
+ }
28
40
 
29
- .top {
41
+ .layout-desktop {
42
+ padding-left: var(--nav-offset-left);
43
+
44
+ .side {
30
45
  position: fixed;
31
- top: 0;
46
+ top: var(--nav-offset-top);
47
+ bottom: 0;
32
48
  left: 0;
33
49
  right: 0;
34
- z-index: 991;
50
+ z-index: @z-index-global-nav;
51
+ }
52
+ }
53
+
54
+ .layout-legacy,
55
+ .layout-anvil2 {
56
+ .top-placeholder {
57
+ height: var(--nav-offset-top);
35
58
  }
36
59
  }
37
60
 
@@ -43,11 +66,19 @@
43
66
  --nav-offset-left: 0;
44
67
  }
45
68
 
46
- &.layout-nav-slim {
69
+ &.layout-desktop.layout-nav-slim {
47
70
  --nav-offset-left: 64px;
48
71
  }
49
72
 
50
- &.layout-nav-wide {
73
+ &.layout-desktop.layout-nav-wide {
51
74
  --nav-offset-left: 212px;
52
75
  }
76
+
77
+ .top {
78
+ position: fixed;
79
+ top: 0;
80
+ left: 0;
81
+ right: 0;
82
+ z-index: 991;
83
+ }
53
84
  }
@@ -1,18 +1,20 @@
1
- import { FC } from 'react';
2
- import { TitanLayoutProps } from './';
1
+ interface LayoutContentArgs {
2
+ header: boolean;
3
+ sideTop: boolean;
4
+ extraText: boolean;
5
+ search: boolean;
6
+ longContent: boolean;
7
+ wideContent: boolean;
8
+ }
3
9
  declare const _default: {
4
10
  title: string;
5
- component: FC<TitanLayoutProps> & {
6
- Content: FC<import("./titan-layout").TitanLayoutContentProps>;
7
- Logo: FC<import("./layout-logo").TitanLayoutLogoProps>;
8
- SidebarLink: typeof import("./layout-sidebar-links").TitanLayoutSidebarLink;
9
- SidebarTrigger: typeof import("./layout-sidebar-links").TitanLayoutSidebarTrigger;
10
- };
11
11
  decorators: ((Story: any) => import("react/jsx-runtime").JSX.Element)[];
12
12
  parameters: {};
13
+ argTypes: {};
14
+ args: LayoutContentArgs;
13
15
  };
14
16
  export default _default;
15
- export declare const TitanLayoutLegacy: () => import("react/jsx-runtime").JSX.Element;
16
- export declare const TitanLayoutAnvil1: () => import("react/jsx-runtime").JSX.Element;
17
- export declare const TitanLayoutAnvil2: () => import("react/jsx-runtime").JSX.Element;
17
+ export declare const TitanLayoutLegacy: (args: LayoutContentArgs) => import("react/jsx-runtime").JSX.Element;
18
+ export declare const TitanLayoutAnvil1: (args: LayoutContentArgs) => import("react/jsx-runtime").JSX.Element;
19
+ export declare const TitanLayoutAnvil2: (args: LayoutContentArgs) => import("react/jsx-runtime").JSX.Element;
18
20
  //# sourceMappingURL=titan-layout.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"titan-layout.stories.d.ts","sourceRoot":"","sources":["../../../src/components/titan-layout/titan-layout.stories.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,EAAE,EAAsB,MAAM,OAAO,CAAC;AAY/C,OAAO,EAAgC,gBAAgB,EAAoB,MAAM,IAAI,CAAC;;;;;;;;;;;;AAEtF,wBAKE;AAuIF,eAAO,MAAM,iBAAiB,+CAO7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,+CAS7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,+CAW7B,CAAC"}
1
+ {"version":3,"file":"titan-layout.stories.d.ts","sourceRoot":"","sources":["../../../src/components/titan-layout/titan-layout.stories.tsx"],"names":[],"mappings":"AAsBA,UAAU,iBAAiB;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;CACxB;;;;;;UAcQ,iBAAiB;;AAZ1B,wBAaE;AA8PF,eAAO,MAAM,iBAAiB,GAAI,MAAM,iBAAiB,4CASxD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,MAAM,iBAAiB,4CASxD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,MAAM,iBAAiB,4CAWxD,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Page as Anvil2Page, Popover } from '@servicetitan/anvil2';
2
+ import { Announcement, Page as Anvil2Page, Button, Popover, TextField } from '@servicetitan/anvil2';
3
3
  import SvgSearch from '@servicetitan/anvil2/assets/icons/material/round/search.svg';
4
4
  import SvgAtlas from '@servicetitan/anvil2/assets/icons/st/atlas_logo.svg';
5
5
  import SvgSettingsActive from '@servicetitan/anvil2/assets/icons/st/gnav_settings_active.svg';
@@ -13,9 +13,17 @@ import { HeaderNavigationLink, HeaderNavigationTrigger } from '../links';
13
13
  import { ProfileDropdown, TitanLayout } from './';
14
14
  export default {
15
15
  title: 'Navigation/TitanLayout',
16
- component: TitanLayout,
17
16
  decorators: [withDefaultRedirects, withMemoryRouter, withAnvil],
18
17
  parameters: {},
18
+ argTypes: {},
19
+ args: {
20
+ header: true,
21
+ sideTop: true,
22
+ extraText: true,
23
+ search: true,
24
+ longContent: true,
25
+ wideContent: false,
26
+ },
19
27
  };
20
28
  const mainNavItems = [
21
29
  items.dashboard,
@@ -38,25 +46,35 @@ const SideLinkPopoverWrapper = ({ children, context }) => {
38
46
  return (_jsxs(Popover, { placement: "right", openOnHover: true, children: [_jsx(Popover.Trigger, { children: (props) => _jsx("div", { ...props, children: children }) }), _jsx(Popover.Content, { style: context.styles.popoverContent, children: "popover content" })] }));
39
47
  };
40
48
  const sidebarTop = () => [
41
- _jsx(TitanLayout.SidebarLink, { ...items.tasks }, "tasks"),
42
- _jsx(TitanLayout.SidebarLink, { ...items.calls }, "calls"),
43
- _jsx(TitanLayout.SidebarTrigger, { ...items.marketing, isActive: false, wrapper: SideLinkPopoverWrapper, onMobileClick: () => alert('clicked'), counter: 50 }, "marketing"),
49
+ _jsx(TitanLayout.Link, { ...items.tasks }, "tasks"),
50
+ _jsx(TitanLayout.Link, { ...items.calls }, "calls"),
51
+ _jsx(TitanLayout.Trigger, { ...items.marketing, isActive: false, wrapper: SideLinkPopoverWrapper, onMobileClick: () => alert('clicked'), counter: 50 }, "marketing"),
44
52
  ];
45
- const useLayoutProps = () => {
53
+ const ContentHeader = () => {
54
+ const [longInfo, setLongInfo] = useState(false);
55
+ return (_jsxs(Fragment, { children: [_jsx(Announcement, { title: "Some info", status: "info" }), _jsx(Announcement, { title: "Some warning", status: "warning" }), _jsx("div", { className: "d-f justify-content-center align-items-center bg-purple-100-i", style: { height: longInfo ? '120px' : '48px' }, children: _jsxs("div", { className: "d-f align-items-center gap-1", children: ["custom content", ' ', _jsx(Button, { onClick: () => setLongInfo(!longInfo), size: "small", "aria-label": "test", children: longInfo ? '↑' : '↓' })] }) })] }));
56
+ };
57
+ const SearchBar = () => _jsx(TextField, { size: "small", placeholder: "Search", className: "w-100-i" });
58
+ const useLayoutProps = (args) => {
46
59
  const [state, setState] = useState(undefined);
47
60
  return {
48
61
  state,
49
62
  onStateChange: setState,
63
+ navigationComponent: NavLinkMock,
50
64
  navigationMainItems: mainNavItems,
51
65
  profile,
66
+ top: args.search ? _jsx(SearchBar, {}) : undefined,
67
+ header: args.header ? _jsx(ContentHeader, {}) : undefined,
52
68
  extraLinks,
53
69
  extraLinksTop,
54
- sidebarTop: sidebarTop(),
55
- navigationComponent: NavLinkMock,
56
- extraText: 'EST (-8 hrs)',
70
+ extraText: args.extraText ? 'EST (-8 hrs)' : undefined,
71
+ sideTop: args.sideTop ? sidebarTop() : undefined,
57
72
  };
58
73
  };
59
- export const TitanLayoutLegacy = () => (_jsxs(TitanLayout, { ...useLayoutProps(), appearance: "legacy", children: [_jsx(TitanLayout.Logo, { title: true }), _jsx(TitanLayout.Content, { children: _jsx(LocationInfo, {}) })] }));
60
- export const TitanLayoutAnvil1 = () => (_jsxs(TitanLayout, { ...useLayoutProps(), appearance: "anvil1", children: [_jsx(TitanLayout.Logo, { title: true }), _jsx(TitanLayout.Content, { children: _jsx(Anvil1Page, { children: _jsx(LocationInfo, {}) }) })] }));
61
- export const TitanLayoutAnvil2 = () => (_jsxs(TitanLayout, { ...useLayoutProps(), appearance: "anvil2", children: [_jsx(TitanLayout.Logo, { title: true }), _jsx(TitanLayout.Content, { children: _jsx(Anvil2Page, { children: _jsx(Anvil2Page.Content, { children: _jsx(LocationInfo, {}) }) }) })] }));
74
+ const Content = (args) => {
75
+ return (_jsxs(Fragment, { children: [_jsx(LocationInfo, {}), args.wideContent && (_jsx("div", { style: { width: '1200px' }, children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." })), args.longContent && (_jsxs("div", { children: [_jsx("p", { children: "Lorem" }), _jsx("p", { children: "ipsum" }), _jsx("p", { children: "dolor" }), _jsx("p", { children: "sit" }), _jsx("p", { children: "amet," }), _jsx("p", { children: "consectetur" }), _jsx("p", { children: "adipiscing" }), _jsx("p", { children: "elit," }), _jsx("p", { children: "sed" }), _jsx("p", { children: "do" }), _jsx("p", { children: "eiusmod" }), _jsx("p", { children: "tempor" }), _jsx("p", { children: "incididunt" }), _jsx("p", { children: "ut" }), _jsx("p", { children: "labore" }), _jsx("p", { children: "et" }), _jsx("p", { children: "dolore" }), _jsx("p", { children: "magna" }), _jsx("p", { children: "aliqua." }), _jsx("p", { children: "Ut" }), _jsx("p", { children: "enim" }), _jsx("p", { children: "ad" }), _jsx("p", { children: "minim" }), _jsx("p", { children: "veniam," }), _jsx("p", { children: "quis" }), _jsx("p", { children: "nostrud" }), _jsx("p", { children: "exercitation" }), _jsx("p", { children: "ullamco" }), _jsx("p", { children: "laboris" }), _jsx("p", { children: "nisi" }), _jsx("p", { children: "ut" }), _jsx("p", { children: "aliquip" }), _jsx("p", { children: "ex" }), _jsx("p", { children: "ea" }), _jsx("p", { children: "commodo" }), _jsx("p", { children: "consequat." }), _jsx("p", { children: "Duis" }), _jsx("p", { children: "aute" }), _jsx("p", { children: "irure" }), _jsx("p", { children: "dolor" }), _jsx("p", { children: "in" }), _jsx("p", { children: "reprehenderit" }), _jsx("p", { children: "in" }), _jsx("p", { children: "voluptate" }), _jsx("p", { children: "velit" }), _jsx("p", { children: "esse" }), _jsx("p", { children: "cillum" }), _jsx("p", { children: "dolore" }), _jsx("p", { children: "eu" }), _jsx("p", { children: "fugiat" }), _jsx("p", { children: "nulla" }), _jsx("p", { children: "pariatur." }), _jsx("p", { children: "Excepteur" }), _jsx("p", { children: "sint" }), _jsx("p", { children: "occaecat" }), _jsx("p", { children: "cupidatat" }), _jsx("p", { children: "non" }), _jsx("p", { children: "proident," }), _jsx("p", { children: "sunt" }), _jsx("p", { children: "in" }), _jsx("p", { children: "culpa" }), _jsx("p", { children: "qui" }), _jsx("p", { children: "officia" }), _jsx("p", { children: "deserunt" }), _jsx("p", { children: "mollit" }), _jsx("p", { children: "anim" }), _jsx("p", { children: "id" }), _jsx("p", { children: "est" }), _jsx("p", { children: "laborum." })] }))] }));
76
+ };
77
+ export const TitanLayoutLegacy = (args) => (_jsxs(TitanLayout, { ...useLayoutProps(args), appearance: "legacy", children: [_jsx(TitanLayout.Logo, { title: true }), _jsx(TitanLayout.Content, { children: _jsx("div", { className: "p-3", children: _jsx(Content, { ...args }) }) })] }));
78
+ export const TitanLayoutAnvil1 = (args) => (_jsxs(TitanLayout, { ...useLayoutProps(args), appearance: "anvil1", children: [_jsx(TitanLayout.Logo, { title: true }), _jsx(TitanLayout.Content, { children: _jsx(Anvil1Page, { children: _jsx(Content, { ...args }) }) })] }));
79
+ export const TitanLayoutAnvil2 = (args) => (_jsxs(TitanLayout, { ...useLayoutProps(args), appearance: "anvil2", children: [_jsx(TitanLayout.Logo, { title: true }), _jsx(TitanLayout.Content, { children: _jsx(Anvil2Page, { children: _jsx(Anvil2Page.Content, { children: _jsx(Content, { ...args }) }) }) })] }));
62
80
  //# sourceMappingURL=titan-layout.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"titan-layout.stories.js","sourceRoot":"","sources":["../../../src/components/titan-layout/titan-layout.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,SAAS,MAAM,6DAA6D,CAAC;AACpF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,iBAAiB,MAAM,+DAA+D,CAAC;AAC9F,OAAO,WAAW,MAAM,iEAAiE,CAAC;AAC1F,OAAO,eAAe,MAAM,oEAAoE,CAAC;AACjG,OAAO,SAAS,MAAM,sEAAsE,CAAC;AAC7F,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAM,QAAQ,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EACH,sBAAsB,EACtB,YAAY,EACZ,WAAW,EACX,KAAK,EACL,SAAS,EACT,oBAAoB,EACpB,gBAAgB,GACnB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACzE,OAAO,EAAE,eAAe,EAA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,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE,CAAC,CACnC,MAAC,WAAW,OAAK,cAAc,EAAE,EAAE,UAAU,EAAC,QAAQ,aAClD,KAAC,WAAW,CAAC,IAAI,IAAC,KAAK,SAAG,EAC1B,KAAC,WAAW,CAAC,OAAO,cAChB,KAAC,UAAU,cACP,KAAC,UAAU,CAAC,OAAO,cACf,KAAC,YAAY,KAAG,GACC,GACZ,GACK,IACZ,CACjB,CAAC"}
1
+ {"version":3,"file":"titan-layout.stories.js","sourceRoot":"","sources":["../../../src/components/titan-layout/titan-layout.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACpG,OAAO,SAAS,MAAM,6DAA6D,CAAC;AACpF,OAAO,QAAQ,MAAM,qDAAqD,CAAC;AAC3E,OAAO,iBAAiB,MAAM,+DAA+D,CAAC;AAC9F,OAAO,WAAW,MAAM,iEAAiE,CAAC;AAC1F,OAAO,eAAe,MAAM,oEAAoE,CAAC;AACjG,OAAO,SAAS,MAAM,sEAAsE,CAAC;AAC7F,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAM,QAAQ,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EACH,sBAAsB,EACtB,YAAY,EACZ,WAAW,EACX,KAAK,EACL,SAAS,EACT,oBAAoB,EACpB,gBAAgB,GACnB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAsC,MAAM,IAAI,CAAC;AAWtF,eAAe;IACX,KAAK,EAAE,wBAAwB;IAC/B,UAAU,EAAE,CAAC,oBAAoB,EAAE,gBAAgB,EAAE,SAAS,CAAC;IAC/D,UAAU,E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,GAAG,CAAC,IAAuB,EAAE,EAAE,CAAC,CAC1D,MAAC,WAAW,OAAK,cAAc,CAAC,IAAI,CAAC,EAAE,UAAU,EAAC,QAAQ,aACtD,KAAC,WAAW,CAAC,IAAI,IAAC,KAAK,SAAG,EAC1B,KAAC,WAAW,CAAC,OAAO,cAChB,KAAC,UAAU,cACP,KAAC,UAAU,CAAC,OAAO,cACf,KAAC,OAAO,OAAK,IAAI,GAAI,GACJ,GACZ,GACK,IACZ,CACjB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/navigation",
3
- "version": "11.0.0-canary.237.4d902dc.0",
3
+ "version": "11.0.0-canary.237.6ce8e81.0",
4
4
  "description": "Navigation components",
5
5
  "repository": {
6
6
  "type": "git",
@@ -42,5 +42,5 @@
42
42
  "less": true,
43
43
  "webpack": false
44
44
  },
45
- "gitHead": "4d902dcdcc48f94d6593def648277fdd80405231"
45
+ "gitHead": "6ce8e814c957b04f0372fd9ee1da10265cd0e6d3"
46
46
  }
@@ -130,7 +130,7 @@ export const WithAllMonolithData = () => (
130
130
  Task Management
131
131
  </ProfileDropdown.Link>
132
132
  <ProfileDropdown.Divider />
133
- <ProfileDropdown.Link id="sign-out" to="https://googgle.com">
133
+ <ProfileDropdown.Link id="sign-out" to="https://googgle.com" text="Sign Out">
134
134
  Sign Out{' '}
135
135
  <span className="c-neutral-100 m-l-half t-truncate">James Bond</span>
136
136
  </ProfileDropdown.Link>
@@ -154,7 +154,7 @@ export const WithAllMonolithData = () => (
154
154
  Task Management
155
155
  </ProfileDropdown.Link>
156
156
  <ProfileDropdown.Divider />
157
- <ProfileDropdown.Link id="sign-out" to="https://googgle.com">
157
+ <ProfileDropdown.Link id="sign-out" to="https://googgle.com" text="Sign Out">
158
158
  Sign Out <span className="c-neutral-100 m-l-half t-truncate">James Bond</span>
159
159
  </ProfileDropdown.Link>
160
160
  <ProfileDropdown.Section id="userid" className="c-neutral-100 fs-1">
@@ -93,7 +93,7 @@ export const WithAllMonolithData = () => (
93
93
  Task Management
94
94
  </ProfileDropdown.Link>
95
95
  <ProfileDropdown.Divider />
96
- <ProfileDropdown.Link id="sign-out" to="https://googgle.com">
96
+ <ProfileDropdown.Link id="sign-out" to="https://googgle.com" text="Sign Out">
97
97
  Sign Out{' '}
98
98
  <span className="c-neutral-100 m-l-half t-truncate">James Bond</span>
99
99
  </ProfileDropdown.Link>
@@ -162,7 +162,7 @@ export const WithAllMonolithDataCommercial = () => (
162
162
  Task Management
163
163
  </ProfileDropdown.Link>
164
164
  <ProfileDropdown.Divider />
165
- <ProfileDropdown.Link id="sign-out" to="https://googgle.com">
165
+ <ProfileDropdown.Link id="sign-out" to="https://googgle.com" text="Sign Out">
166
166
  Sign Out{' '}
167
167
  <span className="c-neutral-100 m-l-half t-truncate">James Bond</span>
168
168
  </ProfileDropdown.Link>
@@ -6,6 +6,7 @@ import SvgAccountInactive from '@servicetitan/anvil2/assets/icons/st/gnav_accoun
6
6
  import { BodyText, Popover, PopoverPropsStrict } from '@servicetitan/design-system';
7
7
  import classNames from 'classnames';
8
8
  import {
9
+ ComponentPropsWithoutRef,
9
10
  FC,
10
11
  HTMLAttributeAnchorTarget,
11
12
  MouseEvent,
@@ -147,6 +148,8 @@ const ProfileDropdownTrigger: FC<ProfileDropdownTriggerProps> = ({
147
148
  );
148
149
  };
149
150
 
151
+ export type ProfileItemContent = { children: string } | { children: ReactNode; text: string };
152
+
150
153
  export interface ProfileDropdownSectionPropsStrict {
151
154
  children: ReactNode;
152
155
  id: string;
@@ -155,9 +158,9 @@ export interface ProfileDropdownSectionPropsStrict {
155
158
  onClick?(e: MouseEvent): void;
156
159
  }
157
160
 
158
- export interface ProfileDropdownSectionProps extends ProfileDropdownSectionPropsStrict {
159
- [key: string]: any;
160
- }
161
+ export type ProfileDropdownSectionProps = Omit<ComponentPropsWithoutRef<'div'>, 'children'> &
162
+ ProfileDropdownSectionPropsStrict &
163
+ ProfileItemContent;
161
164
 
162
165
  export const ProfileDropdownSection: FC<ProfileDropdownSectionProps> = ({
163
166
  children,
@@ -206,9 +209,9 @@ export interface ProfileDropdownLinkPropsStrict {
206
209
  counter?: CounterTagValue;
207
210
  }
208
211
 
209
- export interface ProfileDropdownLinkProps extends ProfileDropdownLinkPropsStrict {
210
- [key: string]: any;
211
- }
212
+ export type ProfileDropdownLinkProps = Omit<ComponentPropsWithoutRef<'a'>, 'children'> &
213
+ ProfileDropdownLinkPropsStrict &
214
+ ProfileItemContent;
212
215
 
213
216
  export const ProfileDropdownLink: FC<ProfileDropdownLinkProps> = ({
214
217
  children,
@@ -4,28 +4,23 @@
4
4
  @size-links-tiny: 24px;
5
5
 
6
6
  .header {
7
- display: grid;
7
+ display: flex;
8
+ justify-content: space-between;
8
9
 
9
10
  background-color: @color-white;
10
11
  color: @color-black;
12
+ border-bottom: 1px solid @color-neutral-60;
11
13
 
12
14
  & > * {
13
15
  overflow-y: hidden;
14
16
  }
15
17
 
16
18
  .he-top-left {
17
- grid-column: span 1;
18
19
  display: flex;
19
20
  align-items: center;
20
21
  }
21
22
 
22
- .he-top-center {
23
- grid-column: span 1;
24
- }
25
-
26
23
  .he-top-right {
27
- grid-column: span 1;
28
-
29
24
  & > * {
30
25
  color: @color-black;
31
26
  }
@@ -92,31 +87,57 @@
92
87
  // desktop
93
88
  @media only screen and (min-width: 768px) {
94
89
  .header {
95
- grid-template-columns: repeat(3, 1fr);
96
- grid-template-rows: 48px;
97
-
90
+ height: var(--nav-offset-top);
98
91
  .navigation-link {
99
92
  margin: 6px 2px;
100
93
  padding: 6px 6px;
101
94
  }
95
+
96
+ .he-top-left {
97
+ padding-left: @spacing-1;
98
+ }
99
+ .he-top-center {
100
+ flex: 1;
101
+ margin-left: @spacing-2;
102
+ margin-right: @spacing-2;
103
+ max-width: 400px;
104
+ }
102
105
  }
106
+ }
107
+ // desktop wide
108
+ @media only screen and (min-width: 1200px) {
109
+ .header {
110
+ display: grid;
111
+ grid-template-columns: repeat(3, 1fr);
112
+ grid-template-rows: 48px;
103
113
 
104
- .he-top-left {
105
- padding-left: @spacing-1;
114
+ .he-top-left,
115
+ .he-top-center,
116
+ .he-top-right {
117
+ grid-column: span 1;
118
+ }
119
+
120
+ .he-top-center {
121
+ max-width: unset;
122
+ }
106
123
  }
107
124
  }
108
125
 
109
126
  // mobile
110
127
  @media only screen and (max-width: 768px) {
111
128
  .header {
112
- grid-template-columns: repeat(3, 1fr);
113
- grid-template-rows: 44px;
114
-
115
129
  padding: @spacing-1 @spacing-half;
116
130
 
117
131
  .navigation-link {
118
132
  padding: 10px;
119
133
  }
134
+
135
+ .he-top-center {
136
+ max-width: unset;
137
+ flex: 1;
138
+ margin-left: @spacing-3;
139
+ margin-right: @spacing-3;
140
+ }
120
141
  }
121
142
  }
122
143
 
@@ -63,7 +63,11 @@ export const LayoutHeader: FC<LayoutHeaderProps> = ({
63
63
  {logo}
64
64
  </div>
65
65
  <div
66
- className={classNames(Styles.heTopCenter, centerClassName)}
66
+ className={classNames(
67
+ Styles.heTopCenter,
68
+ 'd-f align-items-center justify-content-center',
69
+ centerClassName
70
+ )}
67
71
  data-cy="navigation-center"
68
72
  >
69
73
  {center}
@@ -33,5 +33,14 @@ export const ProfileDefault = withTitanLayout(
33
33
  third link
34
34
  </ProfileDropdown.Link>
35
35
  <ProfileDropdown.Divider />
36
+ <ProfileDropdown.Section
37
+ id="forth"
38
+ onClick={() => alert('forth click')}
39
+ text="Sign Out user"
40
+ >
41
+ Sign Out
42
+ <span className="c-neutral-60 m-l-1">user</span>
43
+ </ProfileDropdown.Section>
44
+ <ProfileDropdown.Divider />
36
45
  </ProfileDropdown>
37
46
  );
@@ -70,6 +70,18 @@ const ProfileDropdownDivider: FC = () => {
70
70
  );
71
71
  };
72
72
 
73
+ const getText = (props: any): string | undefined => {
74
+ if (typeof props.children === 'string') {
75
+ return props.children;
76
+ }
77
+
78
+ if (typeof props.text === 'string') {
79
+ return props.text;
80
+ }
81
+
82
+ return undefined;
83
+ };
84
+
73
85
  const ProfileDropdownSection: FC<ProfileDropdownSectionProps> = props => {
74
86
  const { breakpoint } = useTitanLayoutContext();
75
87
  return breakpoint.isMobile ? (
@@ -79,9 +91,9 @@ const ProfileDropdownSection: FC<ProfileDropdownSectionProps> = props => {
79
91
  );
80
92
  };
81
93
  const MobileProfileDropdownSection: FC<ProfileDropdownSectionProps> = props => {
82
- const title = typeof props.children === 'string' ? props.children : undefined;
83
- return title ? (
84
- <InternalSideNavigationGroupTrigger id={props.id} title={title} onClick={props.onClick} />
94
+ const text = getText(props);
95
+ return text ? (
96
+ <InternalSideNavigationGroupTrigger id={props.id} title={text} onClick={props.onClick} />
85
97
  ) : null;
86
98
  };
87
99
 
@@ -98,12 +110,12 @@ const MobileProfileDropdownLink: FC<ProfileDropdownLinkProps & NavigationCompone
98
110
  navigationComponent,
99
111
  ...props
100
112
  }) => {
101
- const title = typeof props.children === 'string' ? props.children : undefined;
102
- return title ? (
113
+ const text = getText(props);
114
+ return text ? (
103
115
  <InternalSideNavigationGroupLink
104
116
  {...props}
105
117
  to={to}
106
- title={title}
118
+ title={text}
107
119
  navigationComponent={navigationComponent}
108
120
  />
109
121
  ) : null;