@seqera/docusaurus-theme-seqera 1.0.4 → 1.0.6-next.22

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 (38) hide show
  1. package/lib/styles/admonition-alerts.css +35 -0
  2. package/lib/styles/other-overrides.css +5 -0
  3. package/lib/styles/search.css +21 -10
  4. package/lib/styles/typography.css +1 -1
  5. package/lib/theme/Details/styles.module.css +1 -0
  6. package/lib/theme/DocItem/Layout/index.js +3 -3
  7. package/lib/theme/DocSidebar/Desktop/Content/VersionSwitcher/index.d.ts +7 -0
  8. package/lib/theme/DocSidebar/Desktop/Content/VersionSwitcher/index.js +100 -0
  9. package/lib/theme/DocSidebar/Desktop/index.js +4 -1
  10. package/lib/theme/DocSidebarItem/Html/index.js +1 -1
  11. package/lib/theme/DocSidebarItem/Link/index.js +1 -1
  12. package/lib/theme/DocVersionBanner/index.js +1 -1
  13. package/lib/theme/Navbar/Content/index.js +2 -2
  14. package/lib/theme/Navbar/Content/styles.module.css +0 -10
  15. package/lib/theme/Navbar/Logo/index.js +1 -1
  16. package/lib/theme/TOCCollapsible/styles.module.css +1 -0
  17. package/lib/theme/TabItem/styles.module.css +4 -0
  18. package/lib/theme/Tabs/index.js +11 -5
  19. package/lib/theme/Tabs/styles.module.css +2 -0
  20. package/package.json +1 -1
  21. package/src/styles/admonition-alerts.css +35 -0
  22. package/src/styles/other-overrides.css +5 -0
  23. package/src/styles/search.css +21 -10
  24. package/src/styles/typography.css +1 -1
  25. package/src/theme/Details/styles.module.css +1 -0
  26. package/src/theme/DocItem/Layout/index.tsx +3 -3
  27. package/src/theme/DocSidebar/Desktop/Content/VersionSwitcher/index.tsx +114 -0
  28. package/src/theme/DocSidebar/Desktop/index.tsx +6 -5
  29. package/src/theme/DocSidebarItem/Html/index.tsx +1 -1
  30. package/src/theme/DocSidebarItem/Link/index.tsx +1 -1
  31. package/src/theme/DocVersionBanner/index.tsx +1 -1
  32. package/src/theme/Navbar/Content/index.tsx +2 -2
  33. package/src/theme/Navbar/Content/styles.module.css +0 -10
  34. package/src/theme/Navbar/Logo/index.tsx +1 -1
  35. package/src/theme/TOCCollapsible/styles.module.css +1 -0
  36. package/src/theme/TabItem/styles.module.css +4 -0
  37. package/src/theme/Tabs/index.tsx +4 -4
  38. package/src/theme/Tabs/styles.module.css +2 -0
@@ -1,10 +1,16 @@
1
1
  .alert {
2
2
  box-shadow: none;
3
+ display: flex;
4
+ flex-direction: column;
5
+ justify-content: flex-start;
6
+ align-items: flex-start;
3
7
  }
4
8
 
5
9
  .theme-admonition {
10
+ margin: .75rem 0;
6
11
  p {
7
12
  line-height: 1.8;
13
+ margin-top: 0;
8
14
  }
9
15
  }
10
16
  .alert--warning {
@@ -65,9 +71,38 @@
65
71
  }
66
72
  }
67
73
 
74
+ .theme-admonition-caution {
75
+ background-color: #FEF8E8;
76
+ border-color: #ECD79F;
77
+ }
78
+
79
+ [data-theme='dark'] {
80
+ .theme-admonition-caution {
81
+ background-color: #74570A;
82
+ border-color: #BEA04E;
83
+ }
84
+ }
85
+
68
86
  .alert--secondary {
69
87
  --ifm-alert-background-color: var(--ifm-color-warning-contrast-background);
70
88
  --ifm-alert-background-color-highlight: #ffba0026;
71
89
  --ifm-alert-foreground-color: var(--ifm-color-warning-contrast-foreground);
72
90
  --ifm-alert-border-color: var(--ifm-color-warning-dark);
73
91
  }
92
+
93
+ summary {
94
+ &:hover {
95
+ color: black !important;
96
+ }
97
+ }
98
+
99
+ [data-theme='dark'] {
100
+ summary {
101
+ &::before {
102
+ border-color: transparent transparent transparent white !important;
103
+ }
104
+ &:hover {
105
+ color: white;
106
+ }
107
+ }
108
+ }
@@ -3,4 +3,9 @@ svg.excalidraw {
3
3
  max-width: 100%;
4
4
  height: 100%;
5
5
  margin-bottom: 2rem;
6
+ }
7
+
8
+ /* force height on searchbar to match button heights */
9
+ .DocSearch-Button {
10
+ height: 33px!important;
6
11
  }
@@ -11,12 +11,12 @@
11
11
  }
12
12
 
13
13
  mark {
14
- background: var(--color-nextflow-200)!important;
14
+ background: var(--color-nextflow-200) !important;
15
15
  }
16
16
  }
17
17
 
18
18
  .search-page-wrapper .theme-layout-main {
19
- h2 {
19
+ h2 {
20
20
  font-size: 1.8rem;
21
21
  line-height: 1.5;
22
22
 
@@ -27,12 +27,23 @@
27
27
  }
28
28
 
29
29
  [data-theme='dark'] {
30
- --docsearch-key-gradient: rgba(255,255,255,.3)!important;
31
- --docsearch-key-shadow: none!important;
32
- --docsearch-muted-color: var(--color-nextflow-100) !important;
33
- --docsearch-highlight-color: var(--color-nextflow-800)!important;
34
- --docsearch-searchbox-shadow: var(--color-nextflow-600)!important;
35
- --docsearch-modal-background: var(--ifm-color-gray-900)!important;
36
- --docsearch-modal-shadow: var(--ifm-color-gray-900)!important;
37
- --docsearch-footer-background: var(--ifm-color-gray-900)!important;
30
+ --docsearch-key-gradient: rgba(255, 255, 255, 0.3) !important;
31
+ --docsearch-key-shadow: none !important;
32
+ --docsearch-muted-color: var(--color-nextflow-100) !important;
33
+ --docsearch-highlight-color: var(--color-nextflow-800) !important;
34
+ --docsearch-searchbox-shadow: var(--color-nextflow-600) !important;
35
+ --docsearch-modal-background: var(--ifm-color-gray-900) !important;
36
+ --docsearch-modal-shadow: var(--ifm-color-gray-900) !important;
37
+ --docsearch-footer-background: var(--ifm-color-gray-900) !important;
38
+ }
39
+
40
+ /* force height on searchbar to match button heights */
41
+ .DocSearch-Button {
42
+ height: 33px !important;
43
+ }
44
+
45
+ @media (max-width: 996px) {
46
+ .DocSearch-Button {
47
+ background: none!important;
48
+ }
38
49
  }
@@ -370,4 +370,4 @@ main prose styles
370
370
  color: var(--color-primary)!important;
371
371
  }
372
372
  }
373
- }
373
+ }
@@ -4,6 +4,7 @@
4
4
  margin: 0 0 var(--ifm-spacing-vertical);
5
5
  border: 1px solid var(--ifm-alert-border-color);
6
6
  display: block;
7
+ overflow-x: scroll;
7
8
  summary {
8
9
  width: 100%;
9
10
  padding: 0 1rem;
@@ -35,10 +35,10 @@ export default function DocItemLayout({children}) {
35
35
  const docTOC = useDocTOC();
36
36
  const {metadata} = useDoc();
37
37
  return (
38
- <div className="row">
38
+ <div className="row flex-row flex justify-between">
39
39
  <div
40
40
  className={clsx(
41
- 'prose__wrapper mx-auto',
41
+ 'prose__wrapper mx-auto lg:pr-8',
42
42
  !docTOC.hidden && styles.docItemCol,
43
43
  )}>
44
44
  <ContentVisibility metadata={metadata} />
@@ -54,7 +54,7 @@ export default function DocItemLayout({children}) {
54
54
  <DocItemPaginator />
55
55
  </div>
56
56
  </div>
57
- {docTOC.desktop && <div className="col col--3">{docTOC.desktop}</div>}
57
+ <div className="col col--3">{docTOC.desktop && docTOC.desktop} </div>
58
58
  </div>
59
59
  );
60
60
  }
@@ -0,0 +1,7 @@
1
+ import React, { Dispatch, SetStateAction } from "react";
2
+ interface VersionSwitcherProps {
3
+ isOpen: boolean;
4
+ setIsOpen: Dispatch<SetStateAction<boolean>>;
5
+ }
6
+ declare const VersionSwitcher: React.FC<VersionSwitcherProps>;
7
+ export default VersionSwitcher;
@@ -0,0 +1,100 @@
1
+ import React, {useState, useRef, useEffect} from 'react';
2
+ import {
3
+ useVersions,
4
+ useDocsVersion,
5
+ useDocsPreferredVersion,
6
+ } from '@docusaurus/plugin-content-docs/client';
7
+ import {useLocation} from '@docusaurus/router';
8
+ import Link from '@docusaurus/Link';
9
+ const VersionSwitcher = ({isOpen, setIsOpen}) => {
10
+ const dropdownRef = useRef(null);
11
+ const location = useLocation();
12
+ const {savePreferredVersionName} = useDocsPreferredVersion(
13
+ 'platform-enterprise',
14
+ );
15
+ const versions = useVersions('platform-enterprise');
16
+ const currentVersion = useDocsVersion();
17
+ const [isEnterprisePage, setEnterprisePage] = useState(false);
18
+ useEffect(() => {
19
+ if (location.pathname.startsWith('/platform-enterprise')) {
20
+ setEnterprisePage(true);
21
+ } else {
22
+ setEnterprisePage(false);
23
+ }
24
+ }, [location.pathname]);
25
+ useEffect(() => {
26
+ const handleClickOutside = (event) => {
27
+ if (dropdownRef.current?.contains(event.target)) return;
28
+ setTimeout(() => setIsOpen(false), 100);
29
+ };
30
+ document.addEventListener('mousedown', handleClickOutside);
31
+ return () => {
32
+ document.removeEventListener('mousedown', handleClickOutside);
33
+ };
34
+ }, [setIsOpen]);
35
+ const toggleDropdown = () => setIsOpen((prev) => !prev);
36
+ function handleSelectVersion(version) {
37
+ savePreferredVersionName(version);
38
+ }
39
+ if (typeof window === 'undefined') return null;
40
+ if (!versions || versions.length === 0) return null;
41
+ if (!isEnterprisePage) return null;
42
+ const items = versions.filter(
43
+ (version) => version.label !== currentVersion?.label,
44
+ );
45
+ let urlSuffix = '';
46
+ if (
47
+ currentVersion &&
48
+ location.pathname.startsWith(`/platform-enterprise/${currentVersion.label}`)
49
+ ) {
50
+ const currentVersionPrefix = `/platform-enterprise/${currentVersion.label}`;
51
+ urlSuffix = location.pathname.replace(currentVersionPrefix, '');
52
+ }
53
+ return (
54
+ <div ref={dropdownRef} className="relative px-4">
55
+ <div
56
+ className={`bg-white dark:bg-gray-900 rounded-lg border border-gray-300 dark:border-gray-700 overflow-hidden ${
57
+ isOpen ? 'rounded-b-none' : ''
58
+ }`}>
59
+ <button
60
+ onClick={toggleDropdown}
61
+ className="h-9 w-full flex items-center justify-between px-3 text-sm bg-transparent border-none cursor-pointer relative z-10 text-gray-900 dark:text-white transition-colors hover:bg-gray-100 dark:hover:bg-gray-800">
62
+ <span>
63
+ {currentVersion ? `v${currentVersion.label}` : 'Version'}{' '}
64
+ {currentVersion && currentVersion.label === versions[0]?.label
65
+ ? '(current)'
66
+ : ''}
67
+ </span>
68
+ <svg
69
+ className={`w-5 h-5 transition-transform duration-200 ${
70
+ isOpen ? 'rotate-0' : '-rotate-90'
71
+ }`}
72
+ xmlns="http://www.w3.org/2000/svg"
73
+ viewBox="4 4 16 16"
74
+ fill="currentColor">
75
+ <path d="M11.8152 13.1989L10.0167 11.1432C9.80447 10.9013 9.97697 10.5214 10.2991 10.5214H13.8961C13.9682 10.5214 14.0388 10.5421 14.0994 10.5811C14.16 10.6201 14.2081 10.6758 14.2379 10.7414C14.2677 10.8071 14.2779 10.8799 14.2674 10.9512C14.2569 11.0226 14.226 11.0893 14.1785 11.1435L12.38 13.1985C12.3448 13.2388 12.3014 13.2711 12.2527 13.2932C12.204 13.3153 12.1511 13.3268 12.0976 13.3268C12.0441 13.3268 11.9912 13.3153 11.9425 13.2932C11.8938 13.2711 11.8504 13.2388 11.8152 13.1985V13.1989Z" />
76
+ </svg>
77
+ </button>
78
+
79
+ {isOpen && (
80
+ <div className="absolute left-4 right-4 top-full -mt-0.5 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 border-t-gray-200 dark:border-t-gray-600 rounded-b-lg overflow-hidden z-50 transition-all duration-100">
81
+ {items?.map((version) => (
82
+ <div
83
+ key={version.name}
84
+ className="w-full"
85
+ onClick={() => handleSelectVersion(version.name)}>
86
+ <Link
87
+ to={`${version.path}${urlSuffix}`}
88
+ className="h-9 w-full flex items-center justify-between px-3 text-sm bg-transparent cursor-pointer text-gray-900 dark:text-white transition-colors hover:bg-gray-100 dark:hover:bg-gray-800 no-underline border-t border-gray-200 dark:border-gray-700 first:border-t-0">
89
+ v{version.label}{' '}
90
+ {version.label === versions[0]?.label ? '(current)' : ''}
91
+ </Link>
92
+ </div>
93
+ ))}
94
+ </div>
95
+ )}
96
+ </div>
97
+ </div>
98
+ );
99
+ };
100
+ export default VersionSwitcher;
@@ -1,9 +1,10 @@
1
- import React from 'react';
1
+ import React, {useState} from 'react';
2
2
  import clsx from 'clsx';
3
3
  import {useThemeConfig} from '@docusaurus/theme-common';
4
4
  import Logo from '@theme/Logo';
5
5
  import CollapseButton from '@theme/DocSidebar/Desktop/CollapseButton';
6
6
  import Content from '@theme/DocSidebar/Desktop/Content';
7
+ import VersionSwitcher from './Content/VersionSwitcher';
7
8
  import styles from './styles.module.css';
8
9
  function DocSidebarDesktop({path, sidebar, onCollapse, isHidden}) {
9
10
  const {
@@ -12,6 +13,7 @@ function DocSidebarDesktop({path, sidebar, onCollapse, isHidden}) {
12
13
  sidebar: {hideable},
13
14
  },
14
15
  } = useThemeConfig();
16
+ const [isOpen, setIsOpen] = useState(false);
15
17
  return (
16
18
  <div
17
19
  className={clsx(
@@ -21,6 +23,7 @@ function DocSidebarDesktop({path, sidebar, onCollapse, isHidden}) {
21
23
  'h-full relative w-full',
22
24
  )}>
23
25
  {hideOnScroll && <Logo tabIndex={-1} className={styles.sidebarLogo} />}
26
+ <VersionSwitcher isOpen={isOpen} setIsOpen={setIsOpen} />
24
27
  <Content path={path} sidebar={sidebar} />
25
28
  {hideable && (
26
29
  <div className="absolute right-0 top-[3.75rem]">
@@ -11,7 +11,7 @@ export default function DocSidebarItemHtml({item, level, index}) {
11
11
  ThemeClassNames.docs.docSidebarItemLinkLevel(level),
12
12
  level > 1 &&
13
13
  ThemeClassNames.docs.docSidebarItemLinkLevel(level) &&
14
- 'ml-2',
14
+ 'ml-3 lg:ml-0',
15
15
  defaultStyle && [styles.menuHtmlItem, 'menu__list-item '],
16
16
  className,
17
17
  )}
@@ -31,7 +31,7 @@ export default function DocSidebarItemLink({
31
31
  ThemeClassNames.docs.docSidebarItemLinkLevel(level),
32
32
  level > 1 &&
33
33
  ThemeClassNames.docs.docSidebarItemLinkLevel(level) &&
34
- 'ml-2',
34
+ 'ml-3 lg:ml-0',
35
35
  'menu__list-item',
36
36
  className,
37
37
  )}
@@ -101,7 +101,7 @@ function DocVersionBannerEnabled({className, versionMetadata}) {
101
101
  <div>
102
102
  <BannerLabel siteTitle={siteTitle} versionMetadata={versionMetadata} />
103
103
  </div>
104
- <div className="margin-top--md">
104
+ <div className="">
105
105
  <LatestVersionSuggestionLabel
106
106
  versionLabel={latestVersionSuggestion.label}
107
107
  to={latestVersionSuggestedDoc.path}
@@ -72,7 +72,7 @@ export default function NavbarContent() {
72
72
  const searchBarItem = items.find((item) => item.type === 'search');
73
73
  return (
74
74
  <div className="w-full flex flex-col">
75
- <div className="pt-3 pb-1">
75
+ <div className="md:pt-3 md:pb-1">
76
76
  <NavbarContentLayout
77
77
  left={
78
78
  <>
@@ -84,7 +84,7 @@ export default function NavbarContent() {
84
84
  <NavbarItems items={rightItems} />
85
85
 
86
86
  <SearchBar />
87
- <div className="mr-2">
87
+ <div className="ml-1.5 mr-2">
88
88
  <NavbarColorModeToggle className={styles.colorModeToggle} />
89
89
  </div>
90
90
  <div className="hidden md:flex!">
@@ -1,14 +1,4 @@
1
1
 
2
-
3
- /*
4
- Hide color mode toggle in small viewports
5
- */
6
- @media (max-width: 996px) {
7
- .colorModeToggle {
8
- display: none;
9
- }
10
- }
11
-
12
2
  /*
13
3
  Restore some Infima style that broke with CSS Cascade Layers
14
4
  See https://github.com/facebook/docusaurus/pull/11142
@@ -3,7 +3,7 @@ import Logo from '@theme/Logo';
3
3
  export default function NavbarLogo() {
4
4
  return (
5
5
  <Logo
6
- className="navbar__brand"
6
+ className="navbar__brand pt-2 md:pt-0"
7
7
  imageClassName="navbar__logo"
8
8
  titleClassName="hidden"
9
9
  />
@@ -19,6 +19,7 @@
19
19
 
20
20
  .tocCollapsibleContent a {
21
21
  display: block;
22
+ text-decoration: none!important;
22
23
  }
23
24
 
24
25
  .tocCollapsibleExpanded {
@@ -3,3 +3,7 @@
3
3
  .tabItem > *:last-child {
4
4
  margin-bottom: 0;
5
5
  }
6
+
7
+ .tabItem {
8
+ border-radius: 0;
9
+ }
@@ -48,7 +48,7 @@ function TabList({className, block, selectedValue, selectValue, tabValues}) {
48
48
  role="tablist"
49
49
  aria-orientation="horizontal"
50
50
  className={clsx(
51
- 'tabs',
51
+ 'tabs m-0! p-0! ',
52
52
  {
53
53
  'tabs--block': block,
54
54
  },
@@ -67,9 +67,15 @@ function TabList({className, block, selectedValue, selectValue, tabValues}) {
67
67
  onKeyDown={handleKeydown}
68
68
  onClick={handleTabChange}
69
69
  {...attributes}
70
- className={clsx('tabs__item', styles.tabItem, attributes?.className, {
71
- 'tabs__item--active': selectedValue === value,
72
- })}>
70
+ className={clsx(
71
+ 'tabs__item bg-gray-100 dark:bg-gray-900 dark:text-white hover:text-black dark:hover:border-white rounded-none border-b-4 border-gray-200',
72
+ styles.tabItem,
73
+ attributes?.className,
74
+ {
75
+ 'tabs__item--active border-b-4 border-black! dark:border-white! bg-nextflow-100 dark:bg-nextflow-900 text-black':
76
+ selectedValue === value,
77
+ },
78
+ )}>
73
79
  {label ?? value}
74
80
  </li>
75
81
  ))}
@@ -89,7 +95,7 @@ function TabContent({lazy, children, selectedValue}) {
89
95
  return null;
90
96
  }
91
97
  return cloneElement(selectedTabItem, {
92
- className: clsx('margin-top--md', selectedTabItem.props.className),
98
+ className: clsx('', selectedTabItem.props.className),
93
99
  });
94
100
  }
95
101
  return (
@@ -6,4 +6,6 @@
6
6
 
7
7
  .tabItem {
8
8
  margin-top: 0 !important;
9
+ padding: .8rem 1rem;
10
+ margin: 1rem .1rem;
9
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seqera/docusaurus-theme-seqera",
3
- "version": "1.0.4",
3
+ "version": "1.0.6-next.22",
4
4
  "description": "Seqera docs theme for Docusaurus",
5
5
  "author": "Seqera docs team <education@seqera.io>",
6
6
  "license": "Apache-2.0",
@@ -1,10 +1,16 @@
1
1
  .alert {
2
2
  box-shadow: none;
3
+ display: flex;
4
+ flex-direction: column;
5
+ justify-content: flex-start;
6
+ align-items: flex-start;
3
7
  }
4
8
 
5
9
  .theme-admonition {
10
+ margin: .75rem 0;
6
11
  p {
7
12
  line-height: 1.8;
13
+ margin-top: 0;
8
14
  }
9
15
  }
10
16
  .alert--warning {
@@ -65,9 +71,38 @@
65
71
  }
66
72
  }
67
73
 
74
+ .theme-admonition-caution {
75
+ background-color: #FEF8E8;
76
+ border-color: #ECD79F;
77
+ }
78
+
79
+ [data-theme='dark'] {
80
+ .theme-admonition-caution {
81
+ background-color: #74570A;
82
+ border-color: #BEA04E;
83
+ }
84
+ }
85
+
68
86
  .alert--secondary {
69
87
  --ifm-alert-background-color: var(--ifm-color-warning-contrast-background);
70
88
  --ifm-alert-background-color-highlight: #ffba0026;
71
89
  --ifm-alert-foreground-color: var(--ifm-color-warning-contrast-foreground);
72
90
  --ifm-alert-border-color: var(--ifm-color-warning-dark);
73
91
  }
92
+
93
+ summary {
94
+ &:hover {
95
+ color: black !important;
96
+ }
97
+ }
98
+
99
+ [data-theme='dark'] {
100
+ summary {
101
+ &::before {
102
+ border-color: transparent transparent transparent white !important;
103
+ }
104
+ &:hover {
105
+ color: white;
106
+ }
107
+ }
108
+ }
@@ -3,4 +3,9 @@ svg.excalidraw {
3
3
  max-width: 100%;
4
4
  height: 100%;
5
5
  margin-bottom: 2rem;
6
+ }
7
+
8
+ /* force height on searchbar to match button heights */
9
+ .DocSearch-Button {
10
+ height: 33px!important;
6
11
  }
@@ -11,12 +11,12 @@
11
11
  }
12
12
 
13
13
  mark {
14
- background: var(--color-nextflow-200)!important;
14
+ background: var(--color-nextflow-200) !important;
15
15
  }
16
16
  }
17
17
 
18
18
  .search-page-wrapper .theme-layout-main {
19
- h2 {
19
+ h2 {
20
20
  font-size: 1.8rem;
21
21
  line-height: 1.5;
22
22
 
@@ -27,12 +27,23 @@
27
27
  }
28
28
 
29
29
  [data-theme='dark'] {
30
- --docsearch-key-gradient: rgba(255,255,255,.3)!important;
31
- --docsearch-key-shadow: none!important;
32
- --docsearch-muted-color: var(--color-nextflow-100) !important;
33
- --docsearch-highlight-color: var(--color-nextflow-800)!important;
34
- --docsearch-searchbox-shadow: var(--color-nextflow-600)!important;
35
- --docsearch-modal-background: var(--ifm-color-gray-900)!important;
36
- --docsearch-modal-shadow: var(--ifm-color-gray-900)!important;
37
- --docsearch-footer-background: var(--ifm-color-gray-900)!important;
30
+ --docsearch-key-gradient: rgba(255, 255, 255, 0.3) !important;
31
+ --docsearch-key-shadow: none !important;
32
+ --docsearch-muted-color: var(--color-nextflow-100) !important;
33
+ --docsearch-highlight-color: var(--color-nextflow-800) !important;
34
+ --docsearch-searchbox-shadow: var(--color-nextflow-600) !important;
35
+ --docsearch-modal-background: var(--ifm-color-gray-900) !important;
36
+ --docsearch-modal-shadow: var(--ifm-color-gray-900) !important;
37
+ --docsearch-footer-background: var(--ifm-color-gray-900) !important;
38
+ }
39
+
40
+ /* force height on searchbar to match button heights */
41
+ .DocSearch-Button {
42
+ height: 33px !important;
43
+ }
44
+
45
+ @media (max-width: 996px) {
46
+ .DocSearch-Button {
47
+ background: none!important;
48
+ }
38
49
  }
@@ -370,4 +370,4 @@ main prose styles
370
370
  color: var(--color-primary)!important;
371
371
  }
372
372
  }
373
- }
373
+ }
@@ -4,6 +4,7 @@
4
4
  margin: 0 0 var(--ifm-spacing-vertical);
5
5
  border: 1px solid var(--ifm-alert-border-color);
6
6
  display: block;
7
+ overflow-x: scroll;
7
8
  summary {
8
9
  width: 100%;
9
10
  padding: 0 1rem;
@@ -45,8 +45,8 @@ export default function DocItemLayout({children}: Props): ReactNode {
45
45
  const docTOC = useDocTOC();
46
46
  const {metadata} = useDoc();
47
47
  return (
48
- <div className="row">
49
- <div className={clsx('prose__wrapper mx-auto', !docTOC.hidden && styles.docItemCol)}>
48
+ <div className="row flex-row flex justify-between">
49
+ <div className={clsx('prose__wrapper mx-auto lg:pr-8', !docTOC.hidden && styles.docItemCol)}>
50
50
  <ContentVisibility metadata={metadata} />
51
51
  <DocVersionBanner />
52
52
  <div className={styles.docItemContainer}>
@@ -60,7 +60,7 @@ export default function DocItemLayout({children}: Props): ReactNode {
60
60
  <DocItemPaginator />
61
61
  </div>
62
62
  </div>
63
- {docTOC.desktop && <div className="col col--3">{docTOC.desktop}</div>}
63
+ <div className="col col--3">{docTOC.desktop && docTOC.desktop} </div>
64
64
  </div>
65
65
  );
66
66
  }
@@ -0,0 +1,114 @@
1
+ import React, { useState, useRef, useEffect, Dispatch, SetStateAction } from "react";
2
+ import {
3
+ useVersions,
4
+ useDocsVersion,
5
+ useDocsPreferredVersion,
6
+ } from "@docusaurus/plugin-content-docs/client";
7
+ import { useLocation } from "@docusaurus/router";
8
+ import Link from "@docusaurus/Link";
9
+
10
+ interface VersionSwitcherProps {
11
+ isOpen: boolean;
12
+ setIsOpen: Dispatch<SetStateAction<boolean>>;
13
+ }
14
+
15
+ const VersionSwitcher: React.FC<VersionSwitcherProps> = ({ isOpen, setIsOpen }) => {
16
+ const dropdownRef = useRef<HTMLDivElement>(null);
17
+ const location = useLocation();
18
+ const { savePreferredVersionName } = useDocsPreferredVersion("platform-enterprise");
19
+ const versions = useVersions("platform-enterprise");
20
+ const currentVersion = useDocsVersion();
21
+ const [isEnterprisePage, setEnterprisePage] = useState(false);
22
+
23
+ useEffect(() => {
24
+ if (location.pathname.startsWith('/platform-enterprise')) {
25
+ setEnterprisePage(true);
26
+ } else {
27
+ setEnterprisePage(false);
28
+ }
29
+ }, [location.pathname]);
30
+
31
+ useEffect(() => {
32
+ const handleClickOutside = (event: MouseEvent) => {
33
+ if (dropdownRef.current?.contains(event.target as Node)) return;
34
+ setTimeout(() => setIsOpen(false), 100);
35
+ };
36
+
37
+ document.addEventListener("mousedown", handleClickOutside);
38
+ return () => {
39
+ document.removeEventListener("mousedown", handleClickOutside);
40
+ };
41
+ }, [setIsOpen]);
42
+
43
+ const toggleDropdown = () => setIsOpen((prev) => !prev);
44
+
45
+ function handleSelectVersion(version: string) {
46
+ savePreferredVersionName(version);
47
+ }
48
+
49
+ if (typeof window === "undefined") return null;
50
+ if (!versions || versions.length === 0) return null;
51
+ if (!isEnterprisePage) return null;
52
+
53
+ const items = versions.filter(
54
+ (version) => version.label !== currentVersion?.label,
55
+ );
56
+
57
+ let urlSuffix = "";
58
+
59
+ if (
60
+ currentVersion &&
61
+ location.pathname.startsWith(`/platform-enterprise/${currentVersion.label}`)
62
+ ) {
63
+ const currentVersionPrefix = `/platform-enterprise/${currentVersion.label}`;
64
+ urlSuffix = location.pathname.replace(currentVersionPrefix, "");
65
+ }
66
+
67
+ return (
68
+ <div ref={dropdownRef} className="relative px-4">
69
+ <div className={`bg-white dark:bg-gray-900 rounded-lg border border-gray-300 dark:border-gray-700 overflow-hidden ${isOpen ? 'rounded-b-none' : ''}`}>
70
+ <button
71
+ onClick={toggleDropdown}
72
+ className="h-9 w-full flex items-center justify-between px-3 text-sm bg-transparent border-none cursor-pointer relative z-10 text-gray-900 dark:text-white transition-colors hover:bg-gray-100 dark:hover:bg-gray-800"
73
+ >
74
+ <span>
75
+ {currentVersion ? `v${currentVersion.label}` : "Version"}{" "}
76
+ {currentVersion && currentVersion.label === versions[0]?.label
77
+ ? "(current)"
78
+ : ""}
79
+ </span>
80
+ <svg
81
+ className={`w-5 h-5 transition-transform duration-200 ${isOpen ? 'rotate-0' : '-rotate-90'}`}
82
+ xmlns="http://www.w3.org/2000/svg"
83
+ viewBox="4 4 16 16"
84
+ fill="currentColor"
85
+ >
86
+ <path d="M11.8152 13.1989L10.0167 11.1432C9.80447 10.9013 9.97697 10.5214 10.2991 10.5214H13.8961C13.9682 10.5214 14.0388 10.5421 14.0994 10.5811C14.16 10.6201 14.2081 10.6758 14.2379 10.7414C14.2677 10.8071 14.2779 10.8799 14.2674 10.9512C14.2569 11.0226 14.226 11.0893 14.1785 11.1435L12.38 13.1985C12.3448 13.2388 12.3014 13.2711 12.2527 13.2932C12.204 13.3153 12.1511 13.3268 12.0976 13.3268C12.0441 13.3268 11.9912 13.3153 11.9425 13.2932C11.8938 13.2711 11.8504 13.2388 11.8152 13.1985V13.1989Z" />
87
+ </svg>
88
+ </button>
89
+
90
+ {isOpen && (
91
+ <div className="absolute left-4 right-4 top-full -mt-0.5 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 border-t-gray-200 dark:border-t-gray-600 rounded-b-lg overflow-hidden z-50 transition-all duration-100">
92
+ {items?.map((version) => (
93
+ <div
94
+ key={version.name}
95
+ className="w-full"
96
+ onClick={() => handleSelectVersion(version.name)}
97
+ >
98
+ <Link
99
+ to={`${version.path}${urlSuffix}`}
100
+ className="h-9 w-full flex items-center justify-between px-3 text-sm bg-transparent cursor-pointer text-gray-900 dark:text-white transition-colors hover:bg-gray-100 dark:hover:bg-gray-800 no-underline border-t border-gray-200 dark:border-gray-700 first:border-t-0"
101
+ >
102
+ v{version.label}{" "}
103
+ {version.label === versions[0]?.label ? "(current)" : ""}
104
+ </Link>
105
+ </div>
106
+ ))}
107
+ </div>
108
+ )}
109
+ </div>
110
+ </div>
111
+ );
112
+ };
113
+
114
+ export default VersionSwitcher;
@@ -1,13 +1,11 @@
1
-
2
-
3
- import React from 'react';
1
+ import React, { useState } from 'react';
4
2
  import clsx from 'clsx';
5
3
  import {useThemeConfig} from '@docusaurus/theme-common';
6
4
  import Logo from '@theme/Logo';
7
5
  import CollapseButton from '@theme/DocSidebar/Desktop/CollapseButton';
8
6
  import Content from '@theme/DocSidebar/Desktop/Content';
9
7
  import type {Props} from '@theme/DocSidebar/Desktop';
10
-
8
+ import VersionSwitcher from './Content/VersionSwitcher';
11
9
  import styles from './styles.module.css';
12
10
 
13
11
  function DocSidebarDesktop({path, sidebar, onCollapse, isHidden}: Props) {
@@ -18,6 +16,8 @@ function DocSidebarDesktop({path, sidebar, onCollapse, isHidden}: Props) {
18
16
  },
19
17
  } = useThemeConfig();
20
18
 
19
+ const [isOpen, setIsOpen] = useState(false);
20
+
21
21
  return (
22
22
  <div
23
23
  className={clsx(
@@ -27,10 +27,11 @@ function DocSidebarDesktop({path, sidebar, onCollapse, isHidden}: Props) {
27
27
  'h-full relative w-full'
28
28
  )}>
29
29
  {hideOnScroll && <Logo tabIndex={-1} className={styles.sidebarLogo} />}
30
+ <VersionSwitcher isOpen={isOpen} setIsOpen={setIsOpen} />
30
31
  <Content path={path} sidebar={sidebar} />
31
32
  {hideable && <div className="absolute right-0 top-[3.75rem]"><CollapseButton onClick={onCollapse} /></div>}
32
33
  </div>
33
34
  );
34
35
  }
35
36
 
36
- export default React.memo(DocSidebarDesktop);
37
+ export default React.memo(DocSidebarDesktop);
@@ -18,7 +18,7 @@ export default function DocSidebarItemHtml({
18
18
  ThemeClassNames.docs.docSidebarItemLinkLevel(level),
19
19
  level > 1 &&
20
20
  ThemeClassNames.docs.docSidebarItemLinkLevel(level) &&
21
- 'ml-2',
21
+ 'ml-3 lg:ml-0',
22
22
  defaultStyle && [styles.menuHtmlItem, 'menu__list-item '],
23
23
  className,
24
24
  )}
@@ -33,7 +33,7 @@ export default function DocSidebarItemLink({
33
33
  className={clsx(
34
34
  ThemeClassNames.docs.docSidebarItemLink,
35
35
  ThemeClassNames.docs.docSidebarItemLinkLevel(level),
36
- level > 1 && ThemeClassNames.docs.docSidebarItemLinkLevel(level) && 'ml-2',
36
+ level > 1 && ThemeClassNames.docs.docSidebarItemLinkLevel(level) && 'ml-3 lg:ml-0',
37
37
  'menu__list-item',
38
38
  className,
39
39
  )}
@@ -146,7 +146,7 @@ function DocVersionBannerEnabled({
146
146
  <div>
147
147
  <BannerLabel siteTitle={siteTitle} versionMetadata={versionMetadata} />
148
148
  </div>
149
- <div className="margin-top--md">
149
+ <div className="">
150
150
  <LatestVersionSuggestionLabel
151
151
  versionLabel={latestVersionSuggestion.label}
152
152
  to={latestVersionSuggestedDoc.path}
@@ -88,7 +88,7 @@ export default function NavbarContent(): ReactNode {
88
88
 
89
89
  return (
90
90
  <div className="w-full flex flex-col">
91
- <div className="pt-3 pb-1">
91
+ <div className="md:pt-3 md:pb-1">
92
92
  <NavbarContentLayout
93
93
  left={
94
94
  <>
@@ -100,7 +100,7 @@ export default function NavbarContent(): ReactNode {
100
100
  <NavbarItems items={rightItems} />
101
101
 
102
102
  <SearchBar />
103
- <div className="mr-2">
103
+ <div className="ml-1.5 mr-2">
104
104
  <NavbarColorModeToggle className={styles.colorModeToggle} />
105
105
  </div>
106
106
  <div className="hidden md:flex!">
@@ -1,14 +1,4 @@
1
1
 
2
-
3
- /*
4
- Hide color mode toggle in small viewports
5
- */
6
- @media (max-width: 996px) {
7
- .colorModeToggle {
8
- display: none;
9
- }
10
- }
11
-
12
2
  /*
13
3
  Restore some Infima style that broke with CSS Cascade Layers
14
4
  See https://github.com/facebook/docusaurus/pull/11142
@@ -6,7 +6,7 @@ import Logo from '@theme/Logo';
6
6
  export default function NavbarLogo(): ReactNode {
7
7
  return (
8
8
  <Logo
9
- className="navbar__brand"
9
+ className="navbar__brand pt-2 md:pt-0"
10
10
  imageClassName="navbar__logo"
11
11
  titleClassName="hidden"
12
12
  />
@@ -19,6 +19,7 @@
19
19
 
20
20
  .tocCollapsibleContent a {
21
21
  display: block;
22
+ text-decoration: none!important;
22
23
  }
23
24
 
24
25
  .tocCollapsibleExpanded {
@@ -3,3 +3,7 @@
3
3
  .tabItem > *:last-child {
4
4
  margin-bottom: 0;
5
5
  }
6
+
7
+ .tabItem {
8
+ border-radius: 0;
9
+ }
@@ -70,7 +70,7 @@ function TabList({
70
70
  role="tablist"
71
71
  aria-orientation="horizontal"
72
72
  className={clsx(
73
- 'tabs',
73
+ 'tabs m-0! p-0! ',
74
74
  {
75
75
  'tabs--block': block,
76
76
  },
@@ -90,11 +90,11 @@ function TabList({
90
90
  onClick={handleTabChange}
91
91
  {...attributes}
92
92
  className={clsx(
93
- 'tabs__item',
93
+ 'tabs__item bg-gray-100 dark:bg-gray-900 dark:text-white hover:text-black dark:hover:border-white rounded-none border-b-4 border-gray-200',
94
94
  styles.tabItem,
95
95
  attributes?.className as string,
96
96
  {
97
- 'tabs__item--active': selectedValue === value,
97
+ 'tabs__item--active border-b-4 border-black! dark:border-white! bg-nextflow-100 dark:bg-nextflow-900 text-black': selectedValue === value,
98
98
  },
99
99
  )}>
100
100
  {label ?? value}
@@ -121,7 +121,7 @@ function TabContent({
121
121
  return null;
122
122
  }
123
123
  return cloneElement(selectedTabItem, {
124
- className: clsx('margin-top--md', selectedTabItem.props.className),
124
+ className: clsx('', selectedTabItem.props.className),
125
125
  });
126
126
  }
127
127
  return (
@@ -6,4 +6,6 @@
6
6
 
7
7
  .tabItem {
8
8
  margin-top: 0 !important;
9
+ padding: .8rem 1rem;
10
+ margin: 1rem .1rem;
9
11
  }