Skip to content

Commit 39087d8

Browse files
authored
feat: Update documentation version hint text and improve Navbar links (#310)
2 parents 216e95e + 6bab55f commit 39087d8

File tree

10 files changed

+58
-52
lines changed

10 files changed

+58
-52
lines changed

.npmrc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1 @@
1-
# - npm
2-
legacy-peer-deps=true
3-
save-exact=true
4-
5-
# - pnpm
6-
auto-install-peers=true
7-
prefer-offline=true
81
shamefully-hoist=true
9-
strict-peer-dependencies=false

docusaurus.config.js

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,14 @@ const config = {
9393
},
9494
items: [
9595
{
96-
type: 'docsVersionDropdown',
97-
position: 'left',
98-
dropdownActiveClassDisabled: true,
99-
dropdownItemsAfter: [
96+
label: 'Version 3',
97+
position: 'right',
98+
items: [
99+
{
100+
type: 'html',
101+
className: 'dropdown-archived-versions',
102+
value: '<strong class="dropdown__link">Version 3</strong>',
103+
},
100104
{ to: `${PUBLIC_BASE_URL}/v2/`, label: 'Version 2' },
101105
{
102106
type: 'html',
@@ -114,21 +118,15 @@ const config = {
114118
to: '/docs',
115119
position: 'left',
116120
},
117-
{ to: '/blog', label: 'Blog', position: 'left' },
118-
{ type: 'search', position: 'right' },
119-
// {
120-
// href: 'https://public-ui.github.io/designer',
121-
// label: 'Designer',
122-
// position: 'left',
123-
// },
124-
// {
125-
// type: 'docsVersionDropdown',
126-
// position: 'left',
127-
// },
128-
// {
129-
// type: 'localeDropdown',
130-
// position: 'right',
131-
// },
121+
{
122+
to: '/blog',
123+
label: 'Blog',
124+
position: 'left',
125+
},
126+
{
127+
type: 'search',
128+
position: 'right',
129+
},
132130
],
133131
},
134132
footer: {

i18n/de/code.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,6 @@
352352
"message": "Beispiel der Komponente ansehen"
353353
},
354354
"custom.docs-version-hint": {
355-
"message": "Diese Dokumentation behandelt KoliBri - Public UI {version}. Die aktuellste Dokumentation finden Sie hier: {link}"
355+
"message": "Diese Dokumentation behandelt KoliBri - Public UI {version}. Für die aktuellste Version, siehe {link}."
356356
}
357357
}

i18n/en/code.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,6 @@
352352
"message": "View the example of the component"
353353
},
354354
"custom.docs-version-hint": {
355-
"message": "This documentation covers KoliBri - Public UI {version}. You can find the latest documentation here: {link}"
355+
"message": "This documentation covers KoliBri - Public UI {version}. For the latest version, see {link}."
356356
}
357357
}

src/components/DocumentationVersionHint.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ export default function DocumentationVersionHint(): ReactNode {
1212
values={{
1313
link: (
1414
<KolLink
15-
style={{ padding: '0 .5rem' }}
15+
style={{
16+
padding: '0 .25rem',
17+
}}
1618
_href={`https://public-ui.github.io/v2${i18n.currentLocale === 'en' ? '/en' : ''}`}
1719
_label={'https://public-ui.github.io/v2'}
1820
></KolLink>

src/css/custom.css

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,12 @@ kol-link-button {
193193
background: linear-gradient(90deg, #facc15, #fbbf24); /* leichter gelber Verlauf */
194194
color: #1f2937; /* dunkles Grau für gute Lesbarkeit */
195195
font-weight: 500;
196+
margin: 0;
196197
text-align: center;
197-
padding: 0.75rem 1rem;
198-
font-size: 0.95rem;
198+
padding: 0.5rem 1rem;
199+
font-size: 0.8rem;
199200
border-bottom: 1px solid #e5e7eb; /* feine untere Linie */
200201
position: sticky;
201-
top: 0;
202-
z-index: 1000;
203202
}
204203

205204
.version-hint a {

src/pages/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import Layout from '@theme/Layout';
66
import type { FunctionComponent, ReactElement } from 'react';
77
import React from 'react';
88
import { KoliBriAbbr } from '../components/KoliBriAbbr';
9-
import { VERSION_ID } from '@site/src/shares/version';
109
import { ITZLogo } from '@site/src/components/ITZLogo';
1110

1211
const HomepageHeader: FunctionComponent = () => (
@@ -46,7 +45,7 @@ const HomepageButtons: FunctionComponent = () => {
4645
></KolLinkButton>
4746
<KolLinkButton
4847
className="w-72"
49-
_href={`/${VERSION_ID}/sample-react/#/handout/basic`}
48+
_href="https://develop--kolibri-public-ui.netlify.app"
5049
_label={translate({
5150
id: 'custom.sample-app-button',
5251
})}

src/theme/DocVersionBadge/index.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/theme/Navbar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export const NavbarWrapper: FunctionComponent<PropsWithChildren> = (props) => {
8282
</div> */}
8383
<div>
8484
<KolLinkButton
85-
_href={`/sample-react/#/handout/basic`}
85+
_href="https://develop--kolibri-public-ui.netlify.app"
8686
_icons={'codicon codicon-preview'}
8787
_hideLabel
8888
_label={translate({

src/theme/Root.tsx

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { register } from '@public-ui/components';
1+
import { KoliBriDevHelper, register } from '@public-ui/components';
22
import { defineCustomElements } from '@public-ui/components/dist/loader';
33
import { DEFAULT } from '@public-ui/theme-default';
44
import type { FunctionComponent, PropsWithChildren } from 'react';
@@ -10,7 +10,36 @@ export const Root: FunctionComponent<PropsWithChildren> = (props) => {
1010
theme: {
1111
detect: 'fixed',
1212
},
13-
}).catch(console.warn);
13+
})
14+
.then(() => {
15+
KoliBriDevHelper.patchTheme(
16+
'default',
17+
{
18+
'KOL-BUTTON-LINK': `
19+
:host,
20+
button {
21+
font-size: inherit;
22+
}
23+
`,
24+
'KOL-ICON': `
25+
:host {
26+
color: inherit;
27+
font-size: inherit;
28+
}
29+
`,
30+
'KOL-LINK': `
31+
:host,
32+
a {
33+
font-size: inherit;
34+
}
35+
`,
36+
},
37+
{
38+
append: true,
39+
}
40+
);
41+
})
42+
.catch(console.warn);
1443
}, []);
1544

1645
return <div id="doc-app">{props.children}</div>;

0 commit comments

Comments
 (0)