Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding docs to Button and migrating to MDX #762

Merged
merged 6 commits into from
Jun 16, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/store-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"dependencies": {
"@reach/popover": "^0.15.0",
"@reach/router": "^1.3.4",
"@storybook/addon-docs": "^6.2.9",
"@theme-ui/match-media": "^0.3.1",
"@theme-ui/preset-base": "^0.3.0",
"@types/react-modal": "^3.12.0",
Expand Down
18 changes: 18 additions & 0 deletions packages/store-ui/src/atoms/Button/Button.stories.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Meta, Story, Preview, ArgsTable } from "@storybook/addon-docs/blocks";
import Button from "./Button";

<Meta title="Atoms/Button" />

# Preview

<Preview>
<Story name="Button" args={{
children: "Button"
}}>
{(args) => <Button {...args} />}
</Story>
</Preview>

# Props

<ArgsTable of={Button} />
16 changes: 0 additions & 16 deletions packages/store-ui/src/atoms/Button/Button.stories.tsx

This file was deleted.

9 changes: 9 additions & 0 deletions packages/store-ui/src/atoms/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@ import type { ButtonHTMLAttributes, ElementType } from 'react'
import React, { forwardRef } from 'react'

export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
/**
* Specifies the URL of the page this button click goes to.
*/
href?: string
/**
* Set the HTML element tag of this component.
*/
as?: ElementType
/**
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
*/
testId?: string
}

Expand Down
5 changes: 4 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3815,7 +3815,7 @@
core-js "^3.8.2"
ts-dedent "^2.0.0"

"@storybook/addon-docs@6.2.9":
"@storybook/addon-docs@6.2.9", "@storybook/addon-docs@^6.2.9":
version "6.2.9"
resolved "https://registry.yarnpkg.com/@storybook/addon-docs/-/addon-docs-6.2.9.tgz#61271e54ff4ea490409e4873ed022e62577366c1"
integrity sha512-qOtwgiqI3LMqT0eXYNV6ykp7qSu0LQGeXxy3wOBGuDDqAizfgnAjomYEWGFcyKp5ahV7HCRCjxbixAklFPUmyw==
Expand Down Expand Up @@ -17839,6 +17839,9 @@ minizlib@^2.1.1:
version "2.1.2"
resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931"
integrity sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==
dependencies:
minipass "^3.0.0"
yallist "^4.0.0"

mississippi@^3.0.0:
version "3.0.0"
Expand Down