diff --git a/docs-ui/src/components/ChangelogComponent/index.tsx b/docs-ui/src/components/ChangelogComponent/index.tsx new file mode 100644 index 0000000000..d70e39e342 --- /dev/null +++ b/docs-ui/src/components/ChangelogComponent/index.tsx @@ -0,0 +1,29 @@ +import { changelog } from '@/utils/changelog'; +import { MDXRemote } from 'next-mdx-remote-client/rsc'; +import { formattedMDXComponents } from '@/mdx-components'; +import type { Component } from '@/utils/changelog'; + +export const ChangelogComponent = ({ component }: { component: Component }) => { + const componentChangelog = changelog.filter(c => + c.components.includes(component), + ); + + return ( + { + const prs = + change.prs.length > 0 && + change.prs + .map( + pr => + `[#${pr}](https://github.com/backstage/backstage/pull/${pr})`, + ) + .join(', '); + return `- \`${change.version}\` - ${change.description} ${prs}`; + }) + .join('\n')}`} + /> + ); +}; diff --git a/docs-ui/src/components/PageTitle/PageTitle.module.css b/docs-ui/src/components/PageTitle/PageTitle.module.css new file mode 100644 index 0000000000..f03b53db96 --- /dev/null +++ b/docs-ui/src/components/PageTitle/PageTitle.module.css @@ -0,0 +1,12 @@ +.container { + margin-bottom: 40px; +} + +.component { + font-size: 11px; + text-transform: uppercase; + font-weight: 500; + letter-spacing: 0.05em; + color: var(--secondary); + margin-bottom: 6px; +} diff --git a/docs-ui/src/components/PageTitle/index.tsx b/docs-ui/src/components/PageTitle/index.tsx new file mode 100644 index 0000000000..540e19eb36 --- /dev/null +++ b/docs-ui/src/components/PageTitle/index.tsx @@ -0,0 +1,23 @@ +import { MDXRemote } from 'next-mdx-remote-client/rsc'; +import { formattedMDXComponents } from '@/mdx-components'; +import styles from './PageTitle.module.css'; + +export const PageTitle = ({ + title, + description, + type = 'component', +}: { + title: string; + type?: string; + description: string; +}) => { + return ( +
+
{type}
+ +
+ ); +}; diff --git a/docs-ui/src/components/Sidebar/Sidebar.module.css b/docs-ui/src/components/Sidebar/Sidebar.module.css index 4fad36c74d..3687869490 100644 --- a/docs-ui/src/components/Sidebar/Sidebar.module.css +++ b/docs-ui/src/components/Sidebar/Sidebar.module.css @@ -73,11 +73,12 @@ } .sectionTitle { - font-size: 0.875rem; - font-weight: 600; - padding: 12px 0; - color: var(--primary); - margin-top: 24px; + font-size: 0.6875rem; + font-weight: 500; + padding: 0 12px 4px; + color: var(--secondary); + margin-top: 40px; + text-transform: uppercase; } .line { @@ -93,13 +94,12 @@ border-radius: 4px; &:hover { - background-color: var(--surface-1); - transition: background-color 0.2s ease-in-out; + background-color: white; } } .line.active { - background-color: var(--surface-1); + background-color: white; } .line.active .lineTitle { @@ -109,7 +109,7 @@ .lineTitle { font-size: 14px; font-weight: 400; - color: var(--secondary); + color: var(--primary); } .lineStatus { diff --git a/docs-ui/src/components/Toolbar/Toolbar.module.css b/docs-ui/src/components/Toolbar/Toolbar.module.css index d1f1b44a7f..d2803e1962 100644 --- a/docs-ui/src/components/Toolbar/Toolbar.module.css +++ b/docs-ui/src/components/Toolbar/Toolbar.module.css @@ -14,14 +14,14 @@ .left { display: flex; align-items: center; - gap: 0.75rem; + gap: 0.5rem; } .name { margin-top: 3px; font-size: 28px; color: #26c9ad; - font-weight: 600; + font-weight: 500; } .actions { diff --git a/docs-ui/src/components/Toolbar/Toolbar.tsx b/docs-ui/src/components/Toolbar/Toolbar.tsx index 5d7a5e3c47..e9c50fb269 100644 --- a/docs-ui/src/components/Toolbar/Toolbar.tsx +++ b/docs-ui/src/components/Toolbar/Toolbar.tsx @@ -1,9 +1,22 @@ +'use client'; + import { ThemeSelector } from './theme'; import { ThemeNameSelector } from './theme-name'; import styles from './Toolbar.module.css'; -import { Nav } from './nav'; +import { usePathname } from 'next/navigation'; +import { components, layoutComponents } from '@/utils/data'; +import { AnimatedName } from './AnimatedName'; export const Toolbar = () => { + const pathname = usePathname(); + const allComponents = [...layoutComponents, ...components]; + const isComponent = pathname.startsWith('/components'); + const componentSlug = pathname.replace('/components/', ''); + const findComponent = allComponents.find(c => c.slug === componentSlug); + + let name = 'UI'; + if (isComponent && findComponent) name = findComponent.title; + return (
@@ -19,7 +32,7 @@ export const Toolbar = () => { fill="#121212" /> -
Button
+
UI
diff --git a/docs-ui/src/components/Toolbar/nav.module.css b/docs-ui/src/components/Toolbar/nav.module.css deleted file mode 100644 index 56501f186e..0000000000 --- a/docs-ui/src/components/Toolbar/nav.module.css +++ /dev/null @@ -1,78 +0,0 @@ -.tabs { - display: none; -} - -@media (min-width: 768px) { - .tabs { - display: block; - height: 60px; - } -} - -.tabsTheme { - width: 142px; - border-radius: 0.375rem; - background-color: var(--bg); - transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out; -} - -.list { - display: flex; - position: relative; - z-index: 0; - gap: 2rem; -} - -.tab { - all: unset; - height: 60px; - color: var(--secondary); - font-size: 0.875rem; - font-weight: 600; - cursor: pointer; - - &:hover { - transition: color 0.2s ease-in-out; - color: var(--primary); - } - - &[data-selected] { - color: var(--primary); - - & p { - color: var(--primary); - } - } - - &:focus-visible { - position: relative; - - &::before { - content: ''; - position: absolute; - inset: 0.25rem 0; - border-radius: 0.25rem; - outline: 2px solid var(--panel); - outline-offset: -1px; - } - } -} - -.tab p { - color: var(--secondary) !important; -} - -.indicator { - position: absolute; - z-index: -1; - left: 0; - bottom: -1px; - translate: var(--active-tab-left) -50%; - width: var(--active-tab-width); - height: 1px; - border-radius: 0.25rem; - background-color: var(--primary); - transition-property: translate, width; - transition-duration: 200ms; - transition-timing-function: ease-in-out; -} diff --git a/docs-ui/src/components/Toolbar/nav.tsx b/docs-ui/src/components/Toolbar/nav.tsx deleted file mode 100644 index 017599581e..0000000000 --- a/docs-ui/src/components/Toolbar/nav.tsx +++ /dev/null @@ -1,49 +0,0 @@ -'use client'; - -import { Tabs } from '@base-ui-components/react/tabs'; -import { usePathname } from 'next/navigation'; -import { useRouter } from 'next/navigation'; -import styles from './nav.module.css'; - -export const Nav = () => { - const pathname = usePathname(); - const router = useRouter(); - - const onValueChange = (value: string) => { - if (value === 'docs') { - router.push('/'); - } else { - router.push('/playground'); - } - }; - - return ( - - - { - router.push('/'); - }} - > - Documentation - - { - router.push('/playground'); - }} - > - Playground - - - - - ); -}; diff --git a/docs-ui/src/content/components/avatar.mdx b/docs-ui/src/content/components/avatar.mdx index f5d39809ab..99b1da8264 100644 --- a/docs-ui/src/content/components/avatar.mdx +++ b/docs-ui/src/content/components/avatar.mdx @@ -9,10 +9,12 @@ import { snippetFallback, } from './avatar.props'; import { ComponentInfos } from '@/components/ComponentInfos'; +import { PageTitle } from '@/components/PageTitle'; -# Avatar - -An avatar component with a fallback for initials. + - +## Usage + + ## API reference @@ -102,3 +102,11 @@ If you want to use a button as a link, please use the `ButtonLink` component. preview={} code={buttonAsLinkSnippet} /> + +## Theming + +- `bui-Button` + +## Changelog + + diff --git a/docs-ui/src/content/components/card.mdx b/docs-ui/src/content/components/card.mdx index f08e68f88b..e0e49a2cd4 100644 --- a/docs-ui/src/content/components/card.mdx +++ b/docs-ui/src/content/components/card.mdx @@ -13,10 +13,12 @@ import { cardListRowSnippet, } from './card.props'; import { ComponentInfos } from '@/components/ComponentInfos'; +import { PageTitle } from '@/components/PageTitle'; -# Card - -A card component that can be used to display content in a box. + ` element. + diff --git a/docs-ui/src/content/components/tabs.mdx b/docs-ui/src/content/components/tabs.mdx index d3188b8d96..e2aa0f1ecd 100644 --- a/docs-ui/src/content/components/tabs.mdx +++ b/docs-ui/src/content/components/tabs.mdx @@ -11,10 +11,12 @@ import { tabsDefaultSnippet, } from './tabs.props'; import { ComponentInfos } from '@/components/ComponentInfos'; +import { PageTitle } from '@/components/PageTitle'; -# Tabs - -A component for toggling between related panels on the same page. +