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

migrate breadcrumbs and change url paths to doc #289

Merged
merged 2 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions src/components/breadcrumbs/BreadcrumbLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ export type BreadcrumbLinkProps = ClassNameProps &
Partial<Pick<LinkComponentProps, 'href'>>
}

/**
* A link component that is commonly used for parent links inside a [Breadcrumbs](../?path=/docs/components-breadcrumbs--docs) component
*/
export function BreadcrumbLink({
href,
className,
Expand Down
78 changes: 0 additions & 78 deletions src/components/breadcrumbs/Breadcrumbs.stories.mdx

This file was deleted.

80 changes: 80 additions & 0 deletions src/components/breadcrumbs/Breadcrumbs.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import {
Controls,
Markdown,
Primary,
Stories,
Subheading,
Title,
} from '@storybook/addon-docs'
import { Meta, StoryObj } from '@storybook/react'
import { Theme } from '../../../.storybook/components'
import { Breadcrumbs } from './Breadcrumbs'
import { BreadcrumbLink } from './BreadcrumbLink'
import { BreadcrumbsLoading } from './BreadcrumbsLoading'
import { BreadcrumbText } from './BreadcrumbText'
import { BreadcrumbLoading } from './BreadcrumbLoading'

const meta = {
component: Breadcrumbs,
parameters: {
docs: {
page: () => (
<>
<Title />
<Markdown>
These components render breadcrumbs, which can be used as a
secondary navigation that helps to see the users location.
Typically, you use the `BreadcrumbLink` component for the parent
links and the `BreadcrumbText` component for the current page. You
can use the `BreadcrumbLoading` component or the
`BreadcrumbsLoading` component to show a loading state.
</Markdown>
<Primary />
<Subheading>Props</Subheading>
<Controls />
<Theme
component="breadcrumbs"
items={[
'breadcrumbs',
'breadcrumbLink',
'breadcrumbText',
'breadcrumbLoading',
]}
/>
<Stories />
</>
),
},
},
} satisfies Meta<typeof Breadcrumbs>

export default meta
type Story = StoryObj<typeof Breadcrumbs>

export const Default: Story = {
render: (args) => (
<Breadcrumbs {...args}>
<BreadcrumbLink href="#">Start</BreadcrumbLink>
<BreadcrumbLink href="#">User</BreadcrumbLink>
<BreadcrumbText>Settings</BreadcrumbText>
</Breadcrumbs>
),
}

export const LoadingDefault: Story = {
render: () => (
<Breadcrumbs>
<BreadcrumbsLoading numberOfItems={3} />
</Breadcrumbs>
),
}

export const LoadingCustom: Story = {
render: () => (
<Breadcrumbs>
<BreadcrumbLoading loadingBarProps={{ className: '!w-10' }} />
<BreadcrumbLoading />
<BreadcrumbText>Settings</BreadcrumbText>
</Breadcrumbs>
),
}
2 changes: 1 addition & 1 deletion src/components/button/ButtonIcon.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButto

<Theme component="button" items={['buttonIcon']} />

Additionally, all the `button.modeVariantTone` themes are used. See [Button](/docs/components-button-button--default-story#theme).
Additionally, all the `button.modeVariantTone` themes are used. See [Button](/docs/components-button-button--docs#theme).

## Mode

Expand Down
10 changes: 5 additions & 5 deletions src/components/button/ButtonIconLink.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@ export const Template = ({ ...args }) => <ButtonIconLink {...args} />



All themes are the same as for the [ButtonIcon](/docs/components-button-buttonicon--default-story#theme).
All themes are the same as for the [ButtonIcon](/docs/components-button-buttonicon--docs#theme).

## Mode

The mode is the same as for the [ButtonIcon](/docs/components-button-buttonicon--default-story#theme).
The mode is the same as for the [ButtonIcon](/docs/components-button-buttonicon--docs#theme).

## Variants

The variants are the same as for the [ButtonIcon](/docs/components-button-buttonicon--default-story#theme).
The variants are the same as for the [ButtonIcon](/docs/components-button-buttonicon--docs#theme).

## Size

The size is the same as for the [ButtonIcon](/docs/components-button-buttonicon--default-story#theme).
The size is the same as for the [ButtonIcon](/docs/components-button-buttonicon--docs#theme).

## Tone

The tone is the same as for the [ButtonIcon](/docs/components-button-buttonicon--default-story#theme).
The tone is the same as for the [ButtonIcon](/docs/components-button-buttonicon--docs#theme).
10 changes: 5 additions & 5 deletions src/components/button/ButtonLink.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ AnchorHTMLAttributes<HTMLAnchorElement>



All themes are the same as for the [Button](/docs/components-button-button--default-story#theme).
All themes are the same as for the [Button](/docs/components-button-button--docs#theme).

## Examples

Expand All @@ -90,16 +90,16 @@ All themes are the same as for the [Button](/docs/components-button-button--defa

## Mode

The mode is the same as for the [Button](/docs/components-button-button--default-story#size).
The mode is the same as for the [Button](/docs/components-button-button--docs#size).

## Variants

The variants are the same as for the [Button](/docs/components-button-button--default-story#variants).
The variants are the same as for the [Button](/docs/components-button-button--docs#variants).

## Size

The size is the same as for the [Button](/docs/components-button-button--default-story#size).
The size is the same as for the [Button](/docs/components-button-button--docs#size).

## Tone

The tone is the same as for the [Button](/docs/components-button-button--default-story#tone).
The tone is the same as for the [Button](/docs/components-button-button--docs#tone).
2 changes: 1 addition & 1 deletion src/components/button/SubmitButton.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const Template = ({ children, ...args }) => (

# SubmitButton

The **_default values_** for variant, size, and tone can be found in the [Button Section](/docs/components-button-button--default-story).
The **_default values_** for variant, size, and tone can be found in the [Button Section](/docs/components-button-button--docs).

The submit button uses `React Hook Form` to automatically disable during submitting.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { LoadingDescriptionItem } from './LoadingDescriptionItem'

# LoadingDescriptionItem

This component is used to show a loading [DescriptionItem](/docs/components-content-descriptionitem--default-story).
This component is used to show a loading [DescriptionItem](/docs/components-content-descriptionitem--docs).

export const Template = ({ ...args }) => <LoadingDescriptionItem {...args} />

Expand Down
2 changes: 1 addition & 1 deletion src/components/form/CheckboxField.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Status } from './types'

A checkbox field.

It is composed of the primitives [Checkbox](../?path=/docs/components-form-primitive-checkbox--default-story) and [InputMessage](../?path=/docs/components-form-primitive-inputmessage--default-story).
It is composed of the primitives [Checkbox](../?path=/docs/components-form-primitive-checkbox--docs) and [InputMessage](../?path=/docs/components-form-primitive-inputmessage--docs).

export const Template = ({ ...args }) => <CheckboxField {...args} />

Expand Down
2 changes: 1 addition & 1 deletion src/components/form/CheckboxField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export type CheckboxFieldProps = Omit<CheckboxProps, 'tone'> &
/**
* A checkbox field.
*
* It is composed of the primitives [Checkbox](../?path=/docs/components-form-primitive-checkbox--default-story) and [InputMessage](../?path=/docs/components-form-primitive-inputmessage--default-story).
* It is composed of the primitives [Checkbox](../?path=/docs/components-form-primitive-checkbox--docs) and [InputMessage](../?path=/docs/components-form-primitive-inputmessage--docs).
*/
export const CheckboxField = forwardRef<HTMLInputElement, CheckboxFieldProps>(
function CheckboxField(
Expand Down
2 changes: 1 addition & 1 deletion src/components/form/FormError.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { FormError } from './FormError'

# FormError

This component is a variation of the [Alert](/docs/components-alert-alert--default-story) component.
This component is a variation of the [Alert](/docs/components-alert-alert--docs) component.
Its main purpose is to show an error in a form. The default style applies `col-span-2`, so that the error message is shown in one line in `SectionContentTwoColumn` forms.

export const Template = ({ children, ...args }) => (
Expand Down
4 changes: 2 additions & 2 deletions src/components/form/InputField.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { FormVariant, Status } from './types'

An input field independent of any form validation library.

It is composed of the primitives [Input](../?path=/docs/components-form-primitive-input--default-story), [InputLabel](../?path=/docs/components-form-primitive-inputlabel--default-story) and [InputMessage](../?path=/docs/components-form-primitive-inputmessage--default-story).
It is composed of the primitives [Input](../?path=/docs/components-form-primitive-input--docs), [InputLabel](../?path=/docs/components-form-primitive-inputlabel--docs) and [InputMessage](../?path=/docs/components-form-primitive-inputmessage--docs).

export const Template = ({ ...args }) => <InputField {...args} />

Expand Down Expand Up @@ -107,7 +107,7 @@ export const Template = ({ ...args }) => <InputField {...args} />
args={{
label: 'Label',
message: 'This is the message',
status: Status.invalid,
status: Status.Invalid,
}}
>
{Template.bind({})}
Expand Down
2 changes: 1 addition & 1 deletion src/components/form/InputField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export type InputFieldProps = Omit<InputProps, 'tone' | 'required'> &
/**
* An input field independent of any form validation library.
*
* It is composed of the primitives [Input](../?path=/docs/components-form-primitive-input--default-story), [InputLabel](../?path=/docs/components-form-primitive-inputlabel--default-story) and [InputMessage](../?path=/docs/components-form-primitive-inputmessage--default-story).
* It is composed of the primitives [Input](../?path=/docs/components-form-primitive-input--docs), [InputLabel](../?path=/docs/components-form-primitive-inputlabel--docs) and [InputMessage](../?path=/docs/components-form-primitive-inputmessage--docs).
*/
export const InputField = forwardRef<HTMLInputElement, InputFieldProps>(
function InputField(
Expand Down
2 changes: 1 addition & 1 deletion src/components/form/RadioField.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Status } from './types'

A radio field.

It is composed of the primitives [Radio](../?path=/docs/components-form-primitive-radio--default-story) and [InputMessage](../?path=/docs/components-form-primitive-inputmessage--default-story).
It is composed of the primitives [Radio](../?path=/docs/components-form-primitive-radio--docs) and [InputMessage](../?path=/docs/components-form-primitive-inputmessage--docs).

export const Template = ({ ...args }) => (
<div className="space-y-4">
Expand Down
2 changes: 1 addition & 1 deletion src/components/form/RadioField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export type RadioFieldProps = Omit<RadioProps, 'tone'> &
/**
* A radio field.
*
* It is composed of the primitives [Radio](../?path=/docs/components-form-primitive-radio--default-story) and [InputMessage](../?path=/docs/components-form-primitive-inputmessage--default-story).
* It is composed of the primitives [Radio](../?path=/docs/components-form-primitive-radio--docs) and [InputMessage](../?path=/docs/components-form-primitive-inputmessage--docs).
*/
export const RadioField = forwardRef<HTMLInputElement, RadioFieldProps>(
function RadioField(
Expand Down
2 changes: 1 addition & 1 deletion src/components/form/SelectField.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Status } from './types'

A select field independent of any form validation library.

It is composed of the primitives [Select](../?path=/docs/components-form-primitive-select--default-story), [InputLabel](../?path=/docs/components-form-primitive-inputlabel--default-story) and [InputMessage](../?path=/docs/components-form-primitive-inputmessage--default-story).
It is composed of the primitives [Select](../?path=/docs/components-form-primitive-select--docs), [InputLabel](../?path=/docs/components-form-primitive-inputlabel--docs) and [InputMessage](../?path=/docs/components-form-primitive-inputmessage--docs).

export const Template = ({ ...args }) => <SelectField {...args} />

Expand Down
2 changes: 1 addition & 1 deletion src/components/form/SelectField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export type SelectFieldProps = Omit<SelectProps, 'tone'> &
/**
* A select field independent of any form validation library.
*
* It is composed of the primitives [Select](../?path=/docs/components-form-primitive-select--default-story), [InputLabel](../?path=/docs/components-form-primitive-inputlabel--default-story) and [InputMessage](../?path=/docs/components-form-primitive-inputmessage--default-story).
* It is composed of the primitives [Select](../?path=/docs/components-form-primitive-select--docs), [InputLabel](../?path=/docs/components-form-primitive-inputlabel--docs) and [InputMessage](../?path=/docs/components-form-primitive-inputmessage--docs).
*/
export const SelectField = forwardRef<HTMLSelectElement, SelectFieldProps>(
function SelectField(
Expand Down
2 changes: 1 addition & 1 deletion src/components/form/SelectMonthField.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { SelectMonthField } from './SelectMonthField'

A select field for months independent of any form validation library.

It uses the [SelectField](../?path=/docs/components-form-selectfield--default-story) and [Option](../?path=/docs/components-form-primitive-option--default-story) components.
It uses the [SelectField](../?path=/docs/components-form-selectfield--docs) and [Option](../?path=/docs/components-form-primitive-option--docs) components.

export const Template = (args) => <SelectMonthField {...args} />

Expand Down
2 changes: 1 addition & 1 deletion src/components/form/SelectMonthField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export type SelectMonthFieldProps = Omit<SelectFieldProps, 'children'>
/**
* A select field for months independent of any form validation library.
*
* It uses the [SelectField](../?path=/docs/components-form-selectfield--default-story) and [Option](../?path=/docs/components-form-primitive-option--default-story) components.
* It uses the [SelectField](../?path=/docs/components-form-selectfield--docs) and [Option](../?path=/docs/components-form-primitive-option--docs) components.
*/
export const SelectMonthField = forwardRef<
HTMLSelectElement,
Expand Down
2 changes: 1 addition & 1 deletion src/components/form/SelectYearField.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { SelectYearField } from './SelectYearField'

A select field for years independent of any form validation library.

It uses the [SelectField](../?path=/docs/components-form-selectfield--default-story) and [Option](../?path=/docs/components-form-primitive-option--default-story) components.
It uses the [SelectField](../?path=/docs/components-form-selectfield--docs) and [Option](../?path=/docs/components-form-primitive-option--docs) components.

With the props `from` and `to`, the corresponding start and end year can be set.

Expand Down
2 changes: 1 addition & 1 deletion src/components/form/SelectYearField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type SelectYearFieldProps = Omit<SelectFieldProps, 'children'> &
/**
* A select field for years independent of any form validation library.
*
* It uses the [SelectField](../?path=/docs/components-form-selectfield--default-story) and [Option](../?path=/docs/components-form-primitive-option--default-story) components.
* It uses the [SelectField](../?path=/docs/components-form-selectfield--docs) and [Option](../?path=/docs/components-form-primitive-option--docs) components.
*
* With the props `from` and `to`, the corresponding start and end year can be set.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/components/form/TextAreaField.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { FormVariant, Status } from './types'

A text area field independent of any form validation library.

It is composed of the primitives [TextArea](../?path=/docs/components-form-primitive-textarea--default-story), [InputLabel](../?path=/docs/components-form-primitive-inputlabel--default-story) and [InputMessage](../?path=/docs/components-form-primitive-inputmessage--default-story).
It is composed of the primitives [TextArea](../?path=/docs/components-form-primitive-textarea--docs), [InputLabel](../?path=/docs/components-form-primitive-inputlabel--docs) and [InputMessage](../?path=/docs/components-form-primitive-inputmessage--docs).

export const Template = ({ ...args }) => <TextAreaField {...args} />

Expand Down
2 changes: 1 addition & 1 deletion src/components/form/TextAreaField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export type TextAreaFieldProps = Omit<TextAreaProps, 'tone'> &
/**
* A text area field independent of any form validation library.
*
* It is composed of the primitives [TextArea](../?path=/docs/components-form-primitive-textarea--default-story), [InputLabel](../?path=/docs/components-form-primitive-inputlabel--default-story) and [InputMessage](../?path=/docs/components-form-primitive-inputmessage--default-story).
* It is composed of the primitives [TextArea](../?path=/docs/components-form-primitive-textarea--docs), [InputLabel](../?path=/docs/components-form-primitive-inputlabel--docs) and [InputMessage](../?path=/docs/components-form-primitive-inputmessage--docs).
*/
export const TextAreaField = forwardRef<
HTMLTextAreaElement,
Expand Down
Loading