diff --git a/docs-ui/src/app/components/box/components.tsx b/docs-ui/src/app/components/box/components.tsx index e197ce2eb8..dac66f1f59 100644 --- a/docs-ui/src/app/components/box/components.tsx +++ b/docs-ui/src/app/components/box/components.tsx @@ -2,11 +2,12 @@ import { Box } from '../../../../../packages/ui/src/components/Box/Box'; import { Flex } from '../../../../../packages/ui/src/components/Flex/Flex'; +import { DecorativeBox } from '@/components/DecorativeBox'; export const Default = () => { return ( - - Hello World + + ); }; @@ -36,7 +37,7 @@ export const Responsive = () => { p={{ initial: '2', md: '4' }} display={{ initial: 'block', md: 'flex' }} > - Hello World + Resize to see change ); }; diff --git a/docs-ui/src/app/components/box/page.mdx b/docs-ui/src/app/components/box/page.mdx index f825ddfdbf..41ce6feba0 100644 --- a/docs-ui/src/app/components/box/page.mdx +++ b/docs-ui/src/app/components/box/page.mdx @@ -41,7 +41,7 @@ avoid collapsing margins but both are available. ### Surface -Here's a view when boxes have different surface levels. +Use surface levels to create visual hierarchy. } code={boxSurfaceSnippet} layout="side-by-side" /> diff --git a/docs-ui/src/app/components/box/snippets.ts b/docs-ui/src/app/components/box/snippets.ts index 5da9dbc34c..e9af07dec5 100644 --- a/docs-ui/src/app/components/box/snippets.ts +++ b/docs-ui/src/app/components/box/snippets.ts @@ -4,8 +4,8 @@ export const snippetUsage = `import { Box } from '@backstage/ui'; Content with padding and background `; -export const defaultSnippet = ` - Hello World +export const defaultSnippet = ` + `; export const boxSurfaceSnippet = ` @@ -19,5 +19,5 @@ export const boxResponsiveSnippet = ` - Hello World + Content `; diff --git a/docs-ui/src/app/components/container/components.tsx b/docs-ui/src/app/components/container/components.tsx index 76eaf56ff1..a11bbd9463 100644 --- a/docs-ui/src/app/components/container/components.tsx +++ b/docs-ui/src/app/components/container/components.tsx @@ -1,33 +1,20 @@ 'use client'; import { Container } from '../../../../../packages/ui/src/components/Container/Container'; -import { Box } from '../../../../../packages/ui/src/components/Box/Box'; -import { Text } from '../../../../../packages/ui/src/components/Text/Text'; +import { DecorativeBox } from '@/components/DecorativeBox'; -export const Preview = () => { - return ( - - Content is centered with max-width - - ); -}; - -export const BasicUsagePreview = () => { +export const Default = () => { return ( - Hello World - Hello World - Hello World + Page content goes here ); }; -export const ResponsiveSpacingPreview = () => { +export const ResponsiveSpacing = () => { return ( - - Hello World - Hello World - Hello World + + Content with vertical spacing ); }; diff --git a/docs-ui/src/app/components/container/page.mdx b/docs-ui/src/app/components/container/page.mdx index 4ffca3bfc5..e0f4014a07 100644 --- a/docs-ui/src/app/components/container/page.mdx +++ b/docs-ui/src/app/components/container/page.mdx @@ -4,15 +4,10 @@ import { Snippet } from '@/components/Snippet'; import { containerPropDefs } from './props-definition'; import { containerUsageSnippet, - previewSnippet, - containerSimpleSnippet, + defaultSnippet, containerResponsiveSnippet, } from './snippets'; -import { - Preview, - BasicUsagePreview, - ResponsiveSpacingPreview, -} from './components'; +import { Default, ResponsiveSpacing } from './components'; import { PageTitle } from '@/components/PageTitle'; import { Theming } from '@/components/Theming'; import { ContainerDefinition } from '../../../utils/definitions'; @@ -21,38 +16,30 @@ import { ChangelogComponent } from '@/components/ChangelogComponent'; -} code={previewSnippet} /> +} code={defaultSnippet} /> ## Usage -## API reference +## Core Concepts + +Container provides the standard page layout for plugin content. It constrains content to a maximum width, centers it horizontally, and adds consistent horizontal gutters. Use it once per page to wrap your main content area. + +## API Reference ## Examples -### Basic Usage +### Responsive spacing -} - code={containerSimpleSnippet} - layout="side-by-side" -/> +Vertical spacing props accept breakpoint objects. -### Responsive Spacing - -Spacing props accept breakpoint objects for responsive behavior. - -} - code={containerResponsiveSnippet} - layout="side-by-side" -/> +} code={containerResponsiveSnippet} /> diff --git a/docs-ui/src/app/components/container/snippets.ts b/docs-ui/src/app/components/container/snippets.ts index b16c1b81fd..a314b52387 100644 --- a/docs-ui/src/app/components/container/snippets.ts +++ b/docs-ui/src/app/components/container/snippets.ts @@ -1,19 +1,13 @@ export const containerUsageSnippet = `import { Container } from "@backstage/ui"; -Hello World!`; - -export const previewSnippet = ` - Content is centered with max-width + + {/* Your plugin's main content */} `; -export const containerSimpleSnippet = ` - Hello World - Hello World - Hello World +export const defaultSnippet = ` + Page content goes here `; -export const containerResponsiveSnippet = ` - Hello World - Hello World - Hello World +export const containerResponsiveSnippet = ` + Content with vertical spacing `; diff --git a/docs-ui/src/app/components/flex/components.tsx b/docs-ui/src/app/components/flex/components.tsx index fba9aff201..ce6cc8c05f 100644 --- a/docs-ui/src/app/components/flex/components.tsx +++ b/docs-ui/src/app/components/flex/components.tsx @@ -1,29 +1,14 @@ 'use client'; import { Flex } from '../../../../../packages/ui/src/components/Flex/Flex'; -import { Box } from '../../../../../packages/ui/src/components/Box/Box'; - -const boxStyle = { - width: '64px', - height: '64px', - background: '#eaf2fd', - border: '1px solid #2563eb', - borderRadius: '4px', -}; - -const smallBoxStyle = { - padding: '8px 12px', - background: '#eaf2fd', - border: '1px solid #2563eb', - borderRadius: '4px', -}; +import { DecorativeBox } from '@/components/DecorativeBox'; export const Default = () => { return ( - - - + + + ); }; @@ -31,9 +16,9 @@ export const Default = () => { export const DirectionExample = () => { return ( - First - Second - Third + First + Second + Third ); }; @@ -41,9 +26,9 @@ export const DirectionExample = () => { export const ResponsiveExample = () => { return ( - Item 1 - Item 2 - Item 3 + 1 + 2 + 3 ); }; @@ -51,9 +36,9 @@ export const ResponsiveExample = () => { export const AlignExample = () => { return ( - Start - Middle - End + Start + Middle + End ); }; diff --git a/docs-ui/src/app/components/flex/snippets.ts b/docs-ui/src/app/components/flex/snippets.ts index b0c08ed140..8770880c79 100644 --- a/docs-ui/src/app/components/flex/snippets.ts +++ b/docs-ui/src/app/components/flex/snippets.ts @@ -7,25 +7,25 @@ export const flexUsageSnippet = `import { Flex } from '@backstage/ui'; `; export const defaultSnippet = ` - - - + + + `; export const flexDirectionSnippet = ` - First - Second - Third + First + Second + Third `; export const flexResponsiveSnippet = ` - Item 1 - Item 2 - Item 3 + 1 + 2 + 3 `; export const flexAlignSnippet = ` - Start - Middle - End + Start + Middle + End `; diff --git a/docs-ui/src/app/components/grid/components.tsx b/docs-ui/src/app/components/grid/components.tsx index 088897f004..0c0e5a0546 100644 --- a/docs-ui/src/app/components/grid/components.tsx +++ b/docs-ui/src/app/components/grid/components.tsx @@ -1,31 +1,17 @@ 'use client'; import { Grid } from '../../../../../packages/ui/src/components/Grid/Grid'; -import { Box } from '../../../../../packages/ui/src/components/Box/Box'; - -const boxStyle = { - height: '64px', - background: '#eaf2fd', - border: '1px solid #2563eb', - borderRadius: '4px', -}; - -const labelBoxStyle = { - padding: '8px 12px', - background: '#eaf2fd', - border: '1px solid #2563eb', - borderRadius: '4px', -}; +import { DecorativeBox } from '@/components/DecorativeBox'; export const Default = () => { return ( - - - - - - + + + + + + ); }; @@ -33,10 +19,10 @@ export const Default = () => { export const ResponsiveExample = () => { return ( - 1 - 2 - 3 - 4 + 1 + 2 + 3 + 4 ); }; @@ -44,11 +30,11 @@ export const ResponsiveExample = () => { export const GridItemExample = () => { return ( - - Spans 2 columns + + Spans 2 columns - 1 column - 1 column + 1 column + 1 column ); }; diff --git a/docs-ui/src/app/components/grid/snippets.ts b/docs-ui/src/app/components/grid/snippets.ts index f6d32b8802..2915a2ba4b 100644 --- a/docs-ui/src/app/components/grid/snippets.ts +++ b/docs-ui/src/app/components/grid/snippets.ts @@ -7,23 +7,25 @@ export const gridUsageSnippet = `import { Grid } from '@backstage/ui'; `; export const defaultSnippet = ` - - - - - - + + + + + + `; export const gridResponsiveSnippet = ` - 1 - 2 - 3 - 4 + 1 + 2 + 3 + 4 `; export const gridItemSnippet = ` - Spans 2 columns - 1 column - 1 column + + Spans 2 columns + + 1 column + 1 column `; diff --git a/docs-ui/src/components/DecorativeBox/index.tsx b/docs-ui/src/components/DecorativeBox/index.tsx index a5c20725bc..8af067459e 100644 --- a/docs-ui/src/components/DecorativeBox/index.tsx +++ b/docs-ui/src/components/DecorativeBox/index.tsx @@ -1,5 +1,17 @@ +'use client'; + +import { CSSProperties, ReactNode } from 'react'; import styles from './styles.module.css'; -export const DecorativeBox = () => { - return
; +interface DecorativeBoxProps { + children?: ReactNode; + style?: CSSProperties; +} + +export const DecorativeBox = ({ children, style }: DecorativeBoxProps) => { + return ( +
+ {children} +
+ ); }; diff --git a/docs-ui/src/components/DecorativeBox/styles.module.css b/docs-ui/src/components/DecorativeBox/styles.module.css index 84a6b579a0..a2a5c9407a 100644 --- a/docs-ui/src/components/DecorativeBox/styles.module.css +++ b/docs-ui/src/components/DecorativeBox/styles.module.css @@ -1,8 +1,14 @@ .box { min-width: 64px; min-height: 64px; + padding: 8px 12px; background-color: #eaf2fd; border-radius: 4px; box-shadow: 0 0 0 1px #2563eb; background-image: url("data:image/svg+xml,%3Csvg width='6' height='6' viewBox='0 0 6 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%232563eb' fill-opacity='0.3' fill-rule='evenodd'%3E%3Cpath d='M5 0h1L0 6V5zM6 5v1H5z'/%3E%3C/g%3E%3C/svg%3E"); + color: #2563eb; + font-weight: 500; + display: flex; + align-items: center; + justify-content: center; }