Skip to content

Commit

Permalink
Simplify "Usage" formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
lyzadanger committed Apr 21, 2023
1 parent 14cc125 commit 319934d
Show file tree
Hide file tree
Showing 23 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion plop-templates/pattern-library-page.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function {{name}}Page() {
intro={<p><code>{{name}}</code> is a {{category}} component</p>}
>

<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="{{name}}" />
<Library.Example>
<Library.Demo withSource>
Expand Down
4 changes: 2 additions & 2 deletions src/pattern-library/components/Library.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { jsxToHTML } from '../util/jsx-to-string';
* <p>Any content you want on the page.</p>
*
* <Library.Section title="ComponentName">
* <Library.Pattern title="Usage">
* <Library.Pattern>
* <p>The `Elephant` component is used to render information about elephant
* personalities.</p>
* <Library.Example title="Colored elephants">
Expand Down Expand Up @@ -302,7 +302,7 @@ export type LibraryCodeProps = {
/** Controls relative code font size */
size?: 'sm' | 'md' | 'lg';
/** Caption (e.g. filename, description) of code block */
title?: string;
title?: ComponentChildren;
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function AspectRatioPage() {
}
>
<Library.Section title="AspectRatio">
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="AspectRatio" />
<Library.Example>
<Library.Demo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function DataTablePage() {
}
>
<Library.Section title="DataTable">
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="DataTable" />

<Library.Example title="Basic DataTable">
Expand Down
2 changes: 1 addition & 1 deletion src/pattern-library/components/patterns/data/IconsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function IconsPage() {
}
>
<Library.Section title="Icon components">
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="CancelIcon" />
<Library.Example>
<Library.Demo title="Usage example with CancelIcon" withSource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function ScrollBoxPage() {
</p>
}
>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="ScrollBox" />
<Library.Example title="Basic ScrollBox">
<Library.Demo withSource>
Expand Down Expand Up @@ -110,7 +110,7 @@ export default function ScrollBoxPage() {
</p>
}
>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="Scroll" />
<Library.Example>
<Library.Demo title="Using Scroll by itself" withSource>
Expand Down Expand Up @@ -166,7 +166,7 @@ export default function ScrollBoxPage() {
</p>
}
>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="ScrollContent" />
<Library.Example>
<Library.Demo title="Scroll with ScrollContent" withSource>
Expand Down Expand Up @@ -201,7 +201,7 @@ export default function ScrollBoxPage() {
</>
}
>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="ScrollContainer" />

<Library.Example>
Expand Down
2 changes: 1 addition & 1 deletion src/pattern-library/components/patterns/data/TablePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function TablePage() {
}
>
<Library.Section title="Table">
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage
componentName="Table, TableHead, TableBody, TableRow, TableCell"
size="sm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function ThumbnailPage() {
</p>
}
>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="Thumbnail" />
<Library.Example>
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export default function DialogPage() {
</strong>
</p>
</Library.Pattern>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="Dialog" />
<Library.Demo title="Basic Dialog" withSource>
<Dialog_
Expand Down Expand Up @@ -442,7 +442,7 @@ export default function DialogPage() {
</Library.Changelog>
</Library.Example>
</Library.Pattern>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="ModalDialog" />

<Library.Demo title="Basic ModalDialog" withSource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export default function ModalPage() {
</Library.ChangelogItem>
</Library.Changelog>
</Library.Pattern>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="Modal" />
<Library.Demo title="Basic modal" withSource>
<Modal_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function SpinnerPage() {
</p>
}
>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="Spinner" />
<Library.Example>
<Library.Demo withSource>
Expand Down Expand Up @@ -77,7 +77,7 @@ export default function SpinnerPage() {
</p>
}
>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="SpinnerOverlay" />
<Library.Example>
<Library.Demo>
Expand Down
6 changes: 3 additions & 3 deletions src/pattern-library/components/patterns/input/ButtonPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function ButtonPage() {
</p>
}
>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="Button" />
<Library.Example>
<Library.Demo title="Basic Button" withSource>
Expand Down Expand Up @@ -135,7 +135,7 @@ export default function ButtonPage() {
</p>
}
>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="IconButton" />
<Library.Example>
<Library.Demo title="Basic IconButton" withSource>
Expand Down Expand Up @@ -314,7 +314,7 @@ export default function ButtonPage() {
</>
}
>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="ButtonBase" />

<Library.Example>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function CheckboxPage() {
</p>
}
>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="Checkbox" />
<Library.Example>
<Library.Demo title="Basic Checkbox" withSource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function InputGroupPage() {
</p>
}
>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="InputGroup" />
<Library.Example>
<Library.Demo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function InputPage() {
</p>
}
>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="Input" />

<Library.Example>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function SelectPage() {
</p>
}
>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="Select" />

<Library.Example>
Expand Down
10 changes: 5 additions & 5 deletions src/pattern-library/components/patterns/layout/CardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function CardPage() {
</p>
}
>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="Card, CardContent" />
<Library.Example>
<Library.Demo title="Basic Card with CardContent" withSource>
Expand Down Expand Up @@ -121,7 +121,7 @@ export default function CardPage() {
</p>
}
>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="Card, CardContent" />

<Library.Example title="Laying out Card content">
Expand Down Expand Up @@ -207,7 +207,7 @@ export default function CardPage() {
</p>
}
>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage
componentName="Card, CardContent, CardHeader"
size="sm"
Expand Down Expand Up @@ -285,7 +285,7 @@ export default function CardPage() {
</p>
}
>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage
componentName="Card, CardContent, CardHeader, CardTitle"
size="sm"
Expand Down Expand Up @@ -317,7 +317,7 @@ export default function CardPage() {
</p>
}
>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage
componentName="Card, CardContent, CardHeader, CardActions"
size="sm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function OverlayPage() {
</p>
}
>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="Overlay" />
<Library.Example>
<Library.Demo title="Basic Overlay" withSource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function PanelPage() {
</p>
}
>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="Panel" />
<Library.Example>
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function LinkButtonPage() {
</p>
}
>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="LinkButton" />
<Library.Example>
<Library.Demo title="Basic LinkButton" withSource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function LinkPage() {
</p>
}
>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="Link" />
<Library.Example>
<Library.Demo title="Basic Link" withSource>
Expand Down Expand Up @@ -108,7 +108,7 @@ export default function LinkPage() {
</>
}
>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="LinkBase" />

<Library.Example>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function PointerButtonPage() {
</p>
}
>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="PointerButton" />
<Library.Example>
<Library.Demo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function TabPage() {
</p>
}
>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="Tab" />
<Library.Example>
<Library.Demo title="Basic (non-interactive) example" withSource>
Expand Down Expand Up @@ -255,7 +255,7 @@ export default function TabPage() {
<code>TabList</code> is a new component.
</p>
</Library.Pattern>
<Library.Pattern title="Usage">
<Library.Pattern>
<Library.Usage componentName="TabList" />
<Library.Example>
<p>
Expand Down

0 comments on commit 319934d

Please sign in to comment.