Merged in fix/3697-prettier-configs (pull request #3396)
fix(SW-3691): Setup one prettier config for whole repo * Setup prettierrc in root and remove other configs Approved-by: Joakim Jäderberg Approved-by: Linus Flood
This commit is contained in:
@@ -5,9 +5,9 @@ import {
|
||||
Description,
|
||||
Controls,
|
||||
Stories,
|
||||
} from '@storybook/addon-docs/blocks'
|
||||
} from "@storybook/addon-docs/blocks"
|
||||
|
||||
import * as TypographyStories from './Typography.stories.tsx'
|
||||
import * as TypographyStories from "./Typography.stories.tsx"
|
||||
|
||||
<Meta of={TypographyStories} />
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import type { Meta, StoryObj } from '@storybook/nextjs-vite'
|
||||
import type { Meta, StoryObj } from "@storybook/nextjs-vite"
|
||||
|
||||
import { Typography } from './Typography.tsx'
|
||||
import { Typography } from "./Typography.tsx"
|
||||
|
||||
import TypographyDocs from './Typography.docs.mdx'
|
||||
import TypographyDocs from "./Typography.docs.mdx"
|
||||
|
||||
import { config as typographyConfig } from './variants'
|
||||
import { config as typographyConfig } from "./variants"
|
||||
|
||||
const meta: Meta<typeof Typography> = {
|
||||
title: 'Core Components/Typography',
|
||||
title: "Core Components/Typography",
|
||||
component: Typography,
|
||||
args: { variant: typographyConfig.defaultVariants.variant },
|
||||
argTypes: {
|
||||
variant: {
|
||||
control: 'select',
|
||||
control: "select",
|
||||
options: Object.keys(typographyConfig.variants.variant),
|
||||
table: {
|
||||
defaultValue: { summary: typographyConfig.defaultVariants.variant },
|
||||
@@ -27,163 +27,163 @@ export default meta
|
||||
type Story = StoryObj<typeof Typography>
|
||||
|
||||
export const TitleLg: Story = {
|
||||
name: 'Title/lg',
|
||||
name: "Title/lg",
|
||||
args: {
|
||||
variant: 'Title/lg',
|
||||
variant: "Title/lg",
|
||||
children: <h1>The quick brown fox jumps over the lazy dog</h1>,
|
||||
},
|
||||
}
|
||||
export const TitleMd: Story = {
|
||||
name: 'Title/md',
|
||||
name: "Title/md",
|
||||
args: {
|
||||
variant: 'Title/md',
|
||||
variant: "Title/md",
|
||||
children: <h1>The quick brown fox jumps over the lazy dog</h1>,
|
||||
},
|
||||
}
|
||||
export const TitleMdLowCase: Story = {
|
||||
name: 'Title/mdLowCase',
|
||||
name: "Title/mdLowCase",
|
||||
args: {
|
||||
variant: 'Title/mdLowCase',
|
||||
variant: "Title/mdLowCase",
|
||||
children: <h1>The quick brown fox jumps over the lazy dog</h1>,
|
||||
},
|
||||
}
|
||||
export const TitleSm: Story = {
|
||||
name: 'Title/sm',
|
||||
name: "Title/sm",
|
||||
args: {
|
||||
variant: 'Title/sm',
|
||||
variant: "Title/sm",
|
||||
children: <h1>The quick brown fox jumps over the lazy dog</h1>,
|
||||
},
|
||||
}
|
||||
export const TitleSmLowCase: Story = {
|
||||
name: 'Title/smLowCase',
|
||||
name: "Title/smLowCase",
|
||||
args: {
|
||||
variant: 'Title/smLowCase',
|
||||
variant: "Title/smLowCase",
|
||||
children: <h1>The quick brown fox jumps over the lazy dog</h1>,
|
||||
},
|
||||
}
|
||||
export const TitleXs: Story = {
|
||||
name: 'Title/xs',
|
||||
name: "Title/xs",
|
||||
args: {
|
||||
variant: 'Title/xs',
|
||||
variant: "Title/xs",
|
||||
children: <h1>The quick brown fox jumps over the lazy dog</h1>,
|
||||
},
|
||||
}
|
||||
export const TitleDecorativeLg: Story = {
|
||||
name: 'Title/Decorative/lg',
|
||||
name: "Title/Decorative/lg",
|
||||
args: {
|
||||
variant: 'Title/Decorative/lg',
|
||||
variant: "Title/Decorative/lg",
|
||||
children: <h1>The quick brown fox jumps over the lazy dog</h1>,
|
||||
},
|
||||
}
|
||||
export const TitleDecorativeMd: Story = {
|
||||
name: 'Title/Decorative/md',
|
||||
name: "Title/Decorative/md",
|
||||
args: {
|
||||
variant: 'Title/Decorative/md',
|
||||
variant: "Title/Decorative/md",
|
||||
children: <h1>The quick brown fox jumps over the lazy dog</h1>,
|
||||
},
|
||||
}
|
||||
export const TitleSubtitleLg: Story = {
|
||||
name: 'Title/Subtitle/lg',
|
||||
name: "Title/Subtitle/lg",
|
||||
args: {
|
||||
variant: 'Title/Subtitle/lg',
|
||||
variant: "Title/Subtitle/lg",
|
||||
children: <h1>The quick brown fox jumps over the lazy dog</h1>,
|
||||
},
|
||||
}
|
||||
export const TitleSubtitleMd: Story = {
|
||||
name: 'Title/Subtitle/md',
|
||||
name: "Title/Subtitle/md",
|
||||
args: {
|
||||
variant: 'Title/Subtitle/md',
|
||||
variant: "Title/Subtitle/md",
|
||||
children: <h1>The quick brown fox jumps over the lazy dog</h1>,
|
||||
},
|
||||
}
|
||||
export const TitleOverlineSm: Story = {
|
||||
name: 'Title/Overline/sm',
|
||||
name: "Title/Overline/sm",
|
||||
args: {
|
||||
variant: 'Title/Overline/sm',
|
||||
variant: "Title/Overline/sm",
|
||||
children: <h1>The quick brown fox jumps over the lazy dog</h1>,
|
||||
},
|
||||
}
|
||||
export const BodyLeadtext: Story = {
|
||||
name: 'Body/Lead text',
|
||||
name: "Body/Lead text",
|
||||
args: {
|
||||
variant: 'Body/Lead text',
|
||||
variant: "Body/Lead text",
|
||||
children: <p>The quick brown fox jumps over the lazy dog</p>,
|
||||
},
|
||||
}
|
||||
export const BodyParagraphMdRegular: Story = {
|
||||
name: 'Body/Paragraph/mdRegular',
|
||||
name: "Body/Paragraph/mdRegular",
|
||||
args: {
|
||||
variant: 'Body/Paragraph/mdRegular',
|
||||
variant: "Body/Paragraph/mdRegular",
|
||||
children: <p>The quick brown fox jumps over the lazy dog</p>,
|
||||
},
|
||||
}
|
||||
export const BodyParagraphMdBold: Story = {
|
||||
name: 'Body/Paragraph/mdBold',
|
||||
name: "Body/Paragraph/mdBold",
|
||||
args: {
|
||||
variant: 'Body/Paragraph/mdBold',
|
||||
variant: "Body/Paragraph/mdBold",
|
||||
children: <p>The quick brown fox jumps over the lazy dog</p>,
|
||||
},
|
||||
}
|
||||
export const BodySupportingtextCaptionSmRegular: Story = {
|
||||
name: 'Body/Supporting text (caption)/smRegular',
|
||||
name: "Body/Supporting text (caption)/smRegular",
|
||||
args: {
|
||||
variant: 'Body/Supporting text (caption)/smRegular',
|
||||
variant: "Body/Supporting text (caption)/smRegular",
|
||||
children: <p>The quick brown fox jumps over the lazy dog</p>,
|
||||
},
|
||||
}
|
||||
export const BodySupportingtextCaptionSmBold: Story = {
|
||||
name: 'Body/Supporting text (caption)/smBold',
|
||||
name: "Body/Supporting text (caption)/smBold",
|
||||
args: {
|
||||
variant: 'Body/Supporting text (caption)/smBold',
|
||||
variant: "Body/Supporting text (caption)/smBold",
|
||||
children: <p>The quick brown fox jumps over the lazy dog</p>,
|
||||
},
|
||||
}
|
||||
export const BodyUnderlineMd: Story = {
|
||||
name: 'Body/Underline/md',
|
||||
name: "Body/Underline/md",
|
||||
args: {
|
||||
variant: 'Body/Underline/md',
|
||||
variant: "Body/Underline/md",
|
||||
children: <p>The quick brown fox jumps over the lazy dog</p>,
|
||||
},
|
||||
}
|
||||
export const BodyUnderlineSm: Story = {
|
||||
name: 'Body/Underline/sm',
|
||||
name: "Body/Underline/sm",
|
||||
args: {
|
||||
variant: 'Body/Underline/sm',
|
||||
variant: "Body/Underline/sm",
|
||||
children: <p>The quick brown fox jumps over the lazy dog</p>,
|
||||
},
|
||||
}
|
||||
export const TagSm: Story = {
|
||||
name: 'Tag/sm',
|
||||
name: "Tag/sm",
|
||||
args: {
|
||||
variant: 'Tag/sm',
|
||||
variant: "Tag/sm",
|
||||
children: <span>The quick brown fox jumps over the lazy dog</span>,
|
||||
},
|
||||
}
|
||||
export const LinkMd: Story = {
|
||||
name: 'Link/md',
|
||||
name: "Link/md",
|
||||
args: {
|
||||
variant: 'Link/md',
|
||||
variant: "Link/md",
|
||||
children: <a href="#">The quick brown fox jumps over the lazy dog</a>,
|
||||
},
|
||||
}
|
||||
export const LinkSm: Story = {
|
||||
name: 'Link/sm',
|
||||
name: "Link/sm",
|
||||
args: {
|
||||
variant: 'Link/sm',
|
||||
variant: "Link/sm",
|
||||
children: <a href="#">The quick brown fox jumps over the lazy dog</a>,
|
||||
},
|
||||
}
|
||||
export const LabelXsRegular: Story = {
|
||||
name: 'Label/xsRegular',
|
||||
name: "Label/xsRegular",
|
||||
args: {
|
||||
variant: 'Label/xsRegular',
|
||||
variant: "Label/xsRegular",
|
||||
children: <span>The quick brown fox jumps over the lazy dog</span>,
|
||||
},
|
||||
}
|
||||
export const LabelXsBold: Story = {
|
||||
name: 'Label/xsBold',
|
||||
name: "Label/xsBold",
|
||||
args: {
|
||||
variant: 'Label/xsBold',
|
||||
variant: "Label/xsBold",
|
||||
children: <span>The quick brown fox jumps over the lazy dog</span>,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { cloneElement, isValidElement } from 'react'
|
||||
import { cloneElement, isValidElement } from "react"
|
||||
|
||||
import { variants } from './variants'
|
||||
import { variants } from "./variants"
|
||||
|
||||
import type { TypographyProps } from './types'
|
||||
import type { TypographyProps } from "./types"
|
||||
|
||||
export function Typography({
|
||||
variant,
|
||||
@@ -19,6 +19,6 @@ export function Typography({
|
||||
...children.props,
|
||||
className: [className, children.props.className, classNames]
|
||||
.filter(Boolean)
|
||||
.join(' '),
|
||||
.join(" "),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export { Typography } from './Typography'
|
||||
export { Typography } from "./Typography"
|
||||
// eslint-disable-next-line react-refresh/only-export-components
|
||||
export { withTypography } from './variants'
|
||||
export { withTypography } from "./variants"
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import type { VariantProps } from 'class-variance-authority'
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { variants } from './variants'
|
||||
import type { variants } from "./variants"
|
||||
|
||||
export interface TypographyProps
|
||||
extends Pick<React.HTMLAttributes<HTMLElement>, 'className'>,
|
||||
extends
|
||||
Pick<React.HTMLAttributes<HTMLElement>, "className">,
|
||||
VariantProps<typeof variants> {
|
||||
children: React.ReactElement<{ className?: string }>
|
||||
}
|
||||
|
||||
@@ -1,40 +1,40 @@
|
||||
import { cva } from 'class-variance-authority'
|
||||
import { deepmerge } from 'deepmerge-ts'
|
||||
import { cva } from "class-variance-authority"
|
||||
import { deepmerge } from "deepmerge-ts"
|
||||
|
||||
import styles from './typography.module.css'
|
||||
import styles from "./typography.module.css"
|
||||
|
||||
export const config = {
|
||||
variants: {
|
||||
variant: {
|
||||
'Title/lg': styles['Title-lg'],
|
||||
'Title/md': styles['Title-md'],
|
||||
'Title/mdLowCase': styles['Title-mdLowCase'],
|
||||
'Title/sm': styles['Title-sm'],
|
||||
'Title/smLowCase': styles['Title-smLowCase'],
|
||||
'Title/xs': styles['Title-xs'],
|
||||
'Title/Decorative/lg': styles['Title-Decorative-lg'],
|
||||
'Title/Decorative/md': styles['Title-Decorative-md'],
|
||||
'Title/Subtitle/lg': styles['Title-Subtitle-lg'],
|
||||
'Title/Subtitle/md': styles['Title-Subtitle-md'],
|
||||
'Title/Overline/sm': styles['Title-Overline-sm'],
|
||||
'Body/Lead text': styles['Body-Lead-text'],
|
||||
'Body/Paragraph/mdRegular': styles['Body-Paragraph-mdRegular'],
|
||||
'Body/Paragraph/mdBold': styles['Body-Paragraph-mdBold'],
|
||||
'Body/Supporting text (caption)/smRegular':
|
||||
styles['Body-Supporting-text-caption-smRegular'],
|
||||
'Body/Supporting text (caption)/smBold':
|
||||
styles['Body-Supporting-text-caption-smBold'],
|
||||
'Body/Underline/md': styles['Body-Underline-md'],
|
||||
'Body/Underline/sm': styles['Body-Underline-sm'],
|
||||
'Tag/sm': styles['Tag-sm'],
|
||||
'Link/md': styles['Link-md'],
|
||||
'Link/sm': styles['Link-sm'],
|
||||
'Label/xsRegular': styles['Label-xsRegular'],
|
||||
'Label/xsBold': styles['Label-xsBold'],
|
||||
"Title/lg": styles["Title-lg"],
|
||||
"Title/md": styles["Title-md"],
|
||||
"Title/mdLowCase": styles["Title-mdLowCase"],
|
||||
"Title/sm": styles["Title-sm"],
|
||||
"Title/smLowCase": styles["Title-smLowCase"],
|
||||
"Title/xs": styles["Title-xs"],
|
||||
"Title/Decorative/lg": styles["Title-Decorative-lg"],
|
||||
"Title/Decorative/md": styles["Title-Decorative-md"],
|
||||
"Title/Subtitle/lg": styles["Title-Subtitle-lg"],
|
||||
"Title/Subtitle/md": styles["Title-Subtitle-md"],
|
||||
"Title/Overline/sm": styles["Title-Overline-sm"],
|
||||
"Body/Lead text": styles["Body-Lead-text"],
|
||||
"Body/Paragraph/mdRegular": styles["Body-Paragraph-mdRegular"],
|
||||
"Body/Paragraph/mdBold": styles["Body-Paragraph-mdBold"],
|
||||
"Body/Supporting text (caption)/smRegular":
|
||||
styles["Body-Supporting-text-caption-smRegular"],
|
||||
"Body/Supporting text (caption)/smBold":
|
||||
styles["Body-Supporting-text-caption-smBold"],
|
||||
"Body/Underline/md": styles["Body-Underline-md"],
|
||||
"Body/Underline/sm": styles["Body-Underline-sm"],
|
||||
"Tag/sm": styles["Tag-sm"],
|
||||
"Link/md": styles["Link-md"],
|
||||
"Link/sm": styles["Link-sm"],
|
||||
"Label/xsRegular": styles["Label-xsRegular"],
|
||||
"Label/xsBold": styles["Label-xsBold"],
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
variant: 'Body/Paragraph/mdRegular',
|
||||
variant: "Body/Paragraph/mdRegular",
|
||||
},
|
||||
} as const
|
||||
|
||||
|
||||
Reference in New Issue
Block a user