@servicetitan/navigation 11.0.0-canary.237.0ce6038.0 → 11.0.0-canary.237.4786284.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 (52) 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 +10 -7
  8. package/dist/components/profile-dropdown/profile-dropdown.d.ts.map +1 -1
  9. package/dist/components/profile-dropdown/profile-dropdown.js +2 -2
  10. package/dist/components/profile-dropdown/profile-dropdown.js.map +1 -1
  11. package/dist/components/titan-layout/layout-header.d.ts.map +1 -1
  12. package/dist/components/titan-layout/layout-header.js +1 -1
  13. package/dist/components/titan-layout/layout-header.js.map +1 -1
  14. package/dist/components/titan-layout/layout-header.module.less +36 -16
  15. package/dist/components/titan-layout/layout-profile.d.ts.map +1 -1
  16. package/dist/components/titan-layout/layout-profile.js +14 -4
  17. package/dist/components/titan-layout/layout-profile.js.map +1 -1
  18. package/dist/components/titan-layout/layout-profile.stories.d.ts.map +1 -1
  19. package/dist/components/titan-layout/layout-profile.stories.js +1 -1
  20. package/dist/components/titan-layout/layout-profile.stories.js.map +1 -1
  21. package/dist/components/titan-layout/layout-sidebar-links-internal.d.ts.map +1 -1
  22. package/dist/components/titan-layout/layout-sidebar-links-internal.js +2 -2
  23. package/dist/components/titan-layout/layout-sidebar-links-internal.js.map +1 -1
  24. package/dist/components/titan-layout/layout-sidebar-links.d.ts.map +1 -1
  25. package/dist/components/titan-layout/layout-sidebar-links.js +2 -2
  26. package/dist/components/titan-layout/layout-sidebar-links.js.map +1 -1
  27. package/dist/components/titan-layout/layout-sidebar.module.less +4 -1
  28. package/dist/components/titan-layout/titan-layout.d.ts +5 -3
  29. package/dist/components/titan-layout/titan-layout.d.ts.map +1 -1
  30. package/dist/components/titan-layout/titan-layout.js +45 -11
  31. package/dist/components/titan-layout/titan-layout.js.map +1 -1
  32. package/dist/components/titan-layout/titan-layout.module.less +56 -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 +13 -6
  42. package/src/components/titan-layout/layout-header.module.less +36 -16
  43. package/src/components/titan-layout/layout-header.tsx +5 -1
  44. package/src/components/titan-layout/layout-profile.stories.tsx +10 -1
  45. package/src/components/titan-layout/layout-profile.tsx +24 -8
  46. package/src/components/titan-layout/layout-sidebar-links-internal.tsx +12 -2
  47. package/src/components/titan-layout/layout-sidebar-links.tsx +5 -2
  48. package/src/components/titan-layout/layout-sidebar.module.less +4 -1
  49. package/src/components/titan-layout/titan-layout.module.less +56 -16
  50. package/src/components/titan-layout/titan-layout.module.less.d.ts +3 -0
  51. package/src/components/titan-layout/titan-layout.stories.tsx +156 -18
  52. package/src/components/titan-layout/titan-layout.tsx +101 -18
@@ -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';
@@ -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, minContentWidth, sideTop, }) => {
49
49
  const breakpoint = useTitanBreakpoint();
50
50
  const isMobile = breakpoint.isMobile;
51
51
  const context = useMemo(() => ({
@@ -68,6 +68,12 @@ const TitanLayoutComponent = ({ appearance = 'anvil2', id, children, navigationC
68
68
  document.addEventListener('click', listener);
69
69
  return () => document.removeEventListener('click', listener);
70
70
  }, [isMobile]);
71
+ useEffect(() => {
72
+ if (variant.isAnvil1) {
73
+ document.body.classList.add('of-hidden-i');
74
+ return () => document.body.classList.remove('of-hidden');
75
+ }
76
+ }, [variant.isAnvil1]);
71
77
  const onBurgerClick = useCallback((e) => {
72
78
  setMobileDrawerOpened(true);
73
79
  e.stopPropagation();
@@ -87,23 +93,51 @@ const TitanLayoutComponent = ({ appearance = 'anvil2', id, children, navigationC
87
93
  submenuExpanded: expanded ? id : undefined,
88
94
  });
89
95
  }, [state, onStateChange]);
90
- const [layoutStyles] = useState({});
91
96
  const layoutClass = variant.isLegacy
92
97
  ? Styles.layoutLegacy
93
98
  : variant.isAnvil1
94
99
  ? Styles.layoutAnvil1
95
100
  : 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, { 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: 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] }) }) }));
101
+ 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)
102
+ ? Styles.layoutNavSlim
103
+ : 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, minWidth: minContentWidth, children: content })] }) }) }));
104
+ };
105
+ const TitanLayoutHeaderObserved = ({ children, heightChange }) => {
106
+ const ref = useRef(null);
107
+ useEffect(() => {
108
+ if (ref.current) {
109
+ const updatePosition = () => {
110
+ if (ref.current && heightChange) {
111
+ const pos = ref.current.getBoundingClientRect();
112
+ heightChange(pos.height);
113
+ }
114
+ };
115
+ const observer = new ResizeObserver(updatePosition);
116
+ observer.observe(ref.current);
117
+ updatePosition();
118
+ return () => observer.disconnect();
119
+ }
120
+ }, [heightChange]);
121
+ useEffect(() => {
122
+ return () => {
123
+ heightChange === null || heightChange === void 0 ? void 0 : heightChange(0);
124
+ };
125
+ }, [heightChange]);
126
+ return (_jsx("div", { ref: ref, className: Styles.header, children: children }));
127
+ };
128
+ const TitanLayoutContent = ({ children }) => children;
129
+ const LayoutContent = ({ anvil1, anvil2, children, header }) => {
130
+ const [anvil2Styles, setAnvil2Styles] = useState({});
131
+ const updateIndicatorsHeight = useCallback((offset) => {
132
+ setAnvil2Styles({ '--offset': `calc(var(--nav-offset-top) + ${offset}px)` });
133
+ }, []);
134
+ return (_jsxs(Fragment, { children: [!!header &&
135
+ (anvil2 ? (_jsx(TitanLayoutHeaderObserved, { heightChange: updateIndicatorsHeight, children: header })) : (_jsx("div", { className: Styles.header, children: header }))), _jsx("div", { className: Styles.content, style: anvil2Styles, "data-cy": "layout-content", children: anvil1 ? (_jsx("div", { className: "position-relative d-f flex-grow-1 flex-basis-0 of-hidden", children: children })) : (children) })] }));
101
136
  };
102
- const TitanLayoutContent = ({ children }) => (_jsx("div", { className: Styles.content, children: children }));
103
137
  export const TitanLayout = Object.assign(TitanLayoutComponent, {
104
138
  Content: TitanLayoutContent,
105
139
  Logo: TitanLayoutLogo,
106
- SidebarLink: TitanLayoutSidebarLink,
107
- SidebarTrigger: TitanLayoutSidebarTrigger,
140
+ Link: TitanLayoutSidebarLink,
141
+ Trigger: TitanLayoutSidebarTrigger,
108
142
  });
109
143
  //# 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;KAC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AC1B,UAAU,EAAC,uBAAuB,EAClC,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,SAAS,EACf,UAAU,EAAE,SAAS,GACvB,CACL,IACM,CACd,CAAC,CAAC,CAAC,SAAS,GAEnB,EAED,OAAO,IACN,GACwB,GACb,CAC5B,CAAC;AACN,CAAC,CAAC;AAKF,MAAM,kBAAkB,GAAgC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CACtE,cAAK,SAAS,EAAE,MAAM,CAAC,OAAO,YAAG,QAAQ,GAAO,CACnD,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,oBAAoB,EAAE;IAC3D,OAAO,EAAE,kBAAkB;IAC3B,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,sBAAsB;IACnC,cAAc,EAAE,yBAAyB;CAC5C,CAAC,CAAC"}
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,MAAM,EACN,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,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C,CACA,cAAK,SAAS,EAAE,MAAM,CAAC,MAAM,YAAG,MAAM,GAAO,CAChD,CAAC,EACN,cAAK,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,YAAY,aAAU,gBAAgB,YACxE,MAAM,CAAC,CAAC,CAAC,CACN,cAAK,SAAS,EAAC,0DAA0D,YACpE,QAAQ,GACP,CACT,CAAC,CAAC,CAAC,CACA,QAAQ,CACX,GACC,IACC,CACd,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"}
@@ -13,7 +13,7 @@
13
13
  margin-top: var(--nav-offset-top);
14
14
 
15
15
  display: flex;
16
- flex-direction: row;
16
+ flex-direction: column;
17
17
 
18
18
  .side {
19
19
  flex-basis: var(--nav-offset-left);
@@ -26,27 +26,45 @@
26
26
 
27
27
  display: flex;
28
28
  flex-direction: column;
29
- overflow: hidden;
29
+ overflow-y: hidden;
30
+ overflow-x: auto;
31
+
32
+ .content-page {
33
+ position: relative;
34
+ display: flex;
35
+ flex-direction: column;
36
+ flex-grow: 1;
37
+ flex-basis: 0;
38
+ overflow-y: hidden;
39
+ }
30
40
  }
31
41
  }
32
42
 
33
- .layout-legacy,
34
43
  .layout-anvil2 {
44
+ .header {
45
+ position: sticky;
46
+ top: var(--nav-offset-top);
47
+ z-index: 989;
48
+ }
49
+ }
50
+
51
+ .layout-desktop {
35
52
  padding-left: var(--nav-offset-left);
36
53
 
37
- .top-placeholder {
38
- height: var(--nav-offset-top);
54
+ .side {
55
+ position: fixed;
56
+ top: var(--nav-offset-top);
57
+ bottom: 0;
58
+ left: 0;
59
+ right: 0;
60
+ z-index: @z-index-global-nav;
39
61
  }
62
+ }
40
63
 
41
- &:not(.layout-mobile) {
42
- .side {
43
- position: fixed;
44
- top: var(--nav-offset-top);
45
- bottom: 0;
46
- left: 0;
47
- right: 0;
48
- z-index: @z-index-global-nav;
49
- }
64
+ .layout-legacy,
65
+ .layout-anvil2 {
66
+ .top-placeholder {
67
+ height: var(--nav-offset-top);
50
68
  }
51
69
  }
52
70
 
@@ -58,11 +76,11 @@
58
76
  --nav-offset-left: 0;
59
77
  }
60
78
 
61
- &.layout-nav-slim {
79
+ &.layout-desktop.layout-nav-slim {
62
80
  --nav-offset-left: 64px;
63
81
  }
64
82
 
65
- &.layout-nav-wide {
83
+ &.layout-desktop.layout-nav-wide {
66
84
  --nav-offset-left: 212px;
67
85
  }
68
86
 
@@ -73,4 +91,26 @@
73
91
  right: 0;
74
92
  z-index: 991;
75
93
  }
94
+
95
+ .content {
96
+ overflow-x: auto;
97
+
98
+ .header {
99
+ position: sticky;
100
+ left: 0;
101
+ right: 0;
102
+ }
103
+ }
104
+ }
105
+
106
+ @media print {
107
+ .layout {
108
+ --nav-offset-left: 0px !important;
109
+ --nav-offset-right: 0px !important;
110
+
111
+ .side,
112
+ .top {
113
+ display: none !important;
114
+ }
115
+ }
76
116
  }
@@ -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,EAAE,WAAW,EAAsC,MAAM,IAAI,CAAC;AAEtF,eAAe;IACX,KAAK,EAAE,wBAAwB;IAC/B,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,CAAC,oBAAoB,EAAE,gBAAgB,EAAE,SAAS,CAAC;IAC/D,UAAU,EAAE,EAAE;CACjB,CAAC;AAEF,MAAM,YAAY,GAAG;IACjB,KAAK,CAAC,SAAS;IACf,KAAK,CAAC,QAAQ;IACd,KAAK,CAAC,KAAK;IACX,KAAK,CAAC,qBAAqB;IAC3B,KAAK,CAAC,QA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@
1
1
  {
2
2
  "name": "@servicetitan/navigation",
3
- "version": "11.0.0-canary.237.0ce6038.0",
3
+ "version": "11.0.0-canary.237.4786284.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": "0ce60388dae320a497061d0f4703e731a1c7c279"
45
+ "gitHead": "478628439021a8e8cf5b157d3a041ec8de0b4644"
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,10 @@ const ProfileDropdownTrigger: FC<ProfileDropdownTriggerProps> = ({
147
148
  );
148
149
  };
149
150
 
151
+ export type ProfileItemContent =
152
+ | { children: string; text?: string }
153
+ | { children: ReactNode; text: string };
154
+
150
155
  export interface ProfileDropdownSectionPropsStrict {
151
156
  children: ReactNode;
152
157
  id: string;
@@ -155,14 +160,15 @@ export interface ProfileDropdownSectionPropsStrict {
155
160
  onClick?(e: MouseEvent): void;
156
161
  }
157
162
 
158
- export interface ProfileDropdownSectionProps extends ProfileDropdownSectionPropsStrict {
159
- [key: string]: any;
160
- }
163
+ export type ProfileDropdownSectionProps = Omit<ComponentPropsWithoutRef<'div'>, 'children'> &
164
+ ProfileDropdownSectionPropsStrict &
165
+ ProfileItemContent;
161
166
 
162
167
  export const ProfileDropdownSection: FC<ProfileDropdownSectionProps> = ({
163
168
  children,
164
169
  className,
165
170
  id,
171
+ text,
166
172
  tooltip,
167
173
  onClick,
168
174
  ...rest
@@ -206,9 +212,9 @@ export interface ProfileDropdownLinkPropsStrict {
206
212
  counter?: CounterTagValue;
207
213
  }
208
214
 
209
- export interface ProfileDropdownLinkProps extends ProfileDropdownLinkPropsStrict {
210
- [key: string]: any;
211
- }
215
+ export type ProfileDropdownLinkProps = Omit<ComponentPropsWithoutRef<'a'>, 'children'> &
216
+ ProfileDropdownLinkPropsStrict &
217
+ ProfileItemContent;
212
218
 
213
219
  export const ProfileDropdownLink: FC<ProfileDropdownLinkProps> = ({
214
220
  children,
@@ -218,6 +224,7 @@ export const ProfileDropdownLink: FC<ProfileDropdownLinkProps> = ({
218
224
  counter,
219
225
  tag,
220
226
  target,
227
+ text,
221
228
  to,
222
229
  tooltip,
223
230
  onClick,
@@ -4,7 +4,8 @@
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;
@@ -15,18 +16,11 @@
15
16
  }
16
17
 
17
18
  .he-top-left {
18
- grid-column: span 1;
19
19
  display: flex;
20
20
  align-items: center;
21
21
  }
22
22
 
23
- .he-top-center {
24
- grid-column: span 1;
25
- }
26
-
27
23
  .he-top-right {
28
- grid-column: span 1;
29
-
30
24
  & > * {
31
25
  color: @color-black;
32
26
  }
@@ -93,31 +87,57 @@
93
87
  // desktop
94
88
  @media only screen and (min-width: 768px) {
95
89
  .header {
96
- grid-template-columns: repeat(3, 1fr);
97
- grid-template-rows: 48px;
98
-
90
+ height: var(--nav-offset-top);
99
91
  .navigation-link {
100
92
  margin: 6px 2px;
101
93
  padding: 6px 6px;
102
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
+ }
103
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;
104
113
 
105
- .he-top-left {
106
- 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
+ }
107
123
  }
108
124
  }
109
125
 
110
126
  // mobile
111
127
  @media only screen and (max-width: 768px) {
112
128
  .header {
113
- grid-template-columns: repeat(3, 1fr);
114
- grid-template-rows: 44px;
115
-
116
129
  padding: @spacing-1 @spacing-half;
117
130
 
118
131
  .navigation-link {
119
132
  padding: 10px;
120
133
  }
134
+
135
+ .he-top-center {
136
+ max-width: unset;
137
+ flex: 1;
138
+ margin-left: @spacing-3;
139
+ margin-right: @spacing-3;
140
+ }
121
141
  }
122
142
  }
123
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}
@@ -18,7 +18,7 @@ export default {
18
18
 
19
19
  export const ProfileDefault = withTitanLayout(
20
20
  <ProfileDropdown>
21
- <ProfileDropdown.Link id="first" to="https://google.com">
21
+ <ProfileDropdown.Link id="first" to="https://google.com" external>
22
22
  first link
23
23
  </ProfileDropdown.Link>
24
24
  <ProfileDropdown.Section id="second" onClick={() => alert('second click')}>
@@ -33,5 +33,14 @@ export const ProfileDefault = withTitanLayout(
33
33
  third link
34
34
  </ProfileDropdown.Link>
35
35
  <ProfileDropdown.Divider />
36
+ <ProfileDropdown.Section
37
+ id="forth"
38
+ onClick={() => alert('forth click')}
39
+ text="Sign Out user"
40
+ >
41
+ Sign Out
42
+ <span className="c-neutral-60 m-l-1">user</span>
43
+ </ProfileDropdown.Section>
44
+ <ProfileDropdown.Divider />
36
45
  </ProfileDropdown>
37
46
  );