Skip to content

Commit

Permalink
feat: add initial Storybook frontmatter (#837)
Browse files Browse the repository at this point in the history
## 📝 Changes

- Adds "Getting Started", "Changelog", and "Contributing" frontmatter
sections
- Breaks out "Components" into "Primitives" and "Components"
  • Loading branch information
stephenjwatkins authored Dec 8, 2023
1 parent a98c59b commit d0b91ad
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 21 deletions.
11 changes: 11 additions & 0 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ const preview: Preview = {
opacity: 0.25,
},
},
options: {
storySort: {
order: [
"Getting Started",
"Changelog",
"Contributing",
"Primitives",
"Components",
],
},
},
},
decorators: [
(Story, context) => {
Expand Down
30 changes: 16 additions & 14 deletions easy-ui-react/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Easy UI React
# Easy UI

Easy UI React is a component library designed to help developers create the best experience for shippers who use EasyPost.
[Easy UI](https://github.com/EasyPost/easy-ui) is a component library designed to help developers create the best experience for shippers who use EasyPost.

## Installation

Expand All @@ -20,35 +20,39 @@ npm install @easypost/easy-ui --save
font-style: normal;
font-weight: 400;
font-display: swap;
src: url("/fonts/poppins/poppins-v20-latin-400.woff2") format("woff2"), url("/fonts/poppins/poppins-v20-latin-400.woff")
format("woff");
src:
url("/fonts/poppins/poppins-v20-latin-400.woff2") format("woff2"),
url("/fonts/poppins/poppins-v20-latin-400.woff") format("woff");
}

@font-face {
font-family: "Poppins";
font-style: normal;
font-weight: 500;
font-display: swap;
src: url("/fonts/poppins/poppins-v20-latin-500.woff2") format("woff2"), url("/fonts/poppins/poppins-v20-latin-500.woff")
format("woff");
src:
url("/fonts/poppins/poppins-v20-latin-500.woff2") format("woff2"),
url("/fonts/poppins/poppins-v20-latin-500.woff") format("woff");
}

@font-face {
font-family: "Poppins";
font-style: normal;
font-weight: 600;
font-display: swap;
src: url("/fonts/poppins/poppins-v20-latin-600.woff2") format("woff2"), url("/fonts/poppins/poppins-v20-latin-600.woff")
format("woff");
src:
url("/fonts/poppins/poppins-v20-latin-600.woff2") format("woff2"),
url("/fonts/poppins/poppins-v20-latin-600.woff") format("woff");
}

@font-face {
font-family: "Poppins";
font-style: normal;
font-weight: 700;
font-display: swap;
src: url("/fonts/poppins/poppins-v20-latin-700.woff2") format("woff2"), url("/fonts/poppins/poppins-v20-latin-700.woff")
format("woff");
src:
url("/fonts/poppins/poppins-v20-latin-700.woff2") format("woff2"),
url("/fonts/poppins/poppins-v20-latin-700.woff") format("woff");
}
```

Expand All @@ -69,10 +73,8 @@ import { Provider as EasyUIProvider } from "@easypost/easy-ui/Provider";
```js
ReactDOM.render(
<EasyUIProvider>
<div>
{/* More to come */}
</div>
</AppProvider>,
<div>{/* More to come */}</div>
</EasyUIProvider>,
document.querySelector("#app"),
);
```
Expand Down
7 changes: 7 additions & 0 deletions easy-ui-react/src/Changelog.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from "react";
import { Canvas, Meta, ArgTypes, Controls, Markdown } from "@storybook/blocks";
import Changelog from "../CHANGELOG.md?raw";

<Meta title="Changelog" />

<Markdown>{Changelog}</Markdown>
2 changes: 1 addition & 1 deletion easy-ui-react/src/CodeBlock/CodeBlock.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const getSnippets = () => (
);

const meta: Meta<typeof CodeBlock> = {
title: "Components/CodeBlock",
title: "Components/Code/CodeBlock",
component: CodeBlock,
args: {
children: (
Expand Down
2 changes: 1 addition & 1 deletion easy-ui-react/src/CodeSnippet/CodeSnippet.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Template = (args: CodeSnippetProps) => (
);

const meta: Meta<typeof CodeSnippet> = {
title: "Components/CodeSnippet",
title: "Components/Code/CodeSnippet",
component: CodeSnippet,
args: {
language: SnippetLanguages.JAVASCRIPT,
Expand Down
7 changes: 7 additions & 0 deletions easy-ui-react/src/Contributing.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from "react";
import { Canvas, Meta, ArgTypes, Controls, Markdown } from "@storybook/blocks";
import Contributing from "../../.github/CONTRIBUTING.md?raw";

<Meta title="Contributing" />

<Markdown>{Contributing}</Markdown>
7 changes: 7 additions & 0 deletions easy-ui-react/src/GettingStarted.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from "react";
import { Canvas, Meta, ArgTypes, Controls, Markdown } from "@storybook/blocks";
import Readme from "../README.md?raw";

<Meta title="Getting Started" />

<Markdown>{Readme}</Markdown>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Content = (props: PlaceholderBoxProps) => (
const Template = (args: HorizontalGridProps) => <HorizontalGrid {...args} />;

const meta: Meta<typeof HorizontalGrid> = {
title: "Components/HorizontalGrid",
title: "Primitives/HorizontalGrid",
component: HorizontalGrid,
args: {
columns: 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Content = (props: PlaceholderBoxProps) => (
const Template = (args: HorizontalStackProps) => <HorizontalStack {...args} />;

const meta: Meta<typeof HorizontalStack> = {
title: "Components/HorizontalStack",
title: "Primitives/HorizontalStack",
component: HorizontalStack,
args: {
gap: "2",
Expand Down
2 changes: 1 addition & 1 deletion easy-ui-react/src/Icon/Icon.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type Story = StoryObj<typeof Icon>;
const Template = (args: IconProps) => <Icon {...args} />;

const meta: Meta<typeof Icon> = {
title: "Components/Icon",
title: "Primitives/Icon",
argTypes: {
// TODO: Figure out how to include all icons from our icons project
symbol: createLabelledOptionsControl({
Expand Down
2 changes: 1 addition & 1 deletion easy-ui-react/src/Text/Text.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type Story = StoryObj<typeof Text>;
const Template = (args: TextProps) => <Text {...args} />;

const meta: Meta<typeof Text> = {
title: "Components/Text",
title: "Primitives/Text",
argTypes: {
variant: createFontStyleTokensControl(),
color: createColorTokensControl(),
Expand Down
2 changes: 1 addition & 1 deletion easy-ui-react/src/VerticalStack/VerticalStack.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const Content = (props: PlaceholderBoxProps) => (
const Template = (args: VerticalStackProps) => <VerticalStack {...args} />;

const meta: Meta<typeof VerticalStack> = {
title: "Components/VerticalStack",
title: "Primitives/VerticalStack",
component: VerticalStack,
args: {
gap: "2",
Expand Down

0 comments on commit d0b91ad

Please sign in to comment.