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:
@@ -1,9 +1,9 @@
|
||||
import type { Meta, StoryObj } from '@storybook/nextjs-vite'
|
||||
import type { Meta, StoryObj } from "@storybook/nextjs-vite"
|
||||
|
||||
import { Card } from './Card.tsx'
|
||||
import { Card } from "./Card.tsx"
|
||||
|
||||
const meta: Meta<typeof Card> = {
|
||||
title: 'Core Components/Card',
|
||||
title: "Core Components/Card",
|
||||
component: Card,
|
||||
}
|
||||
|
||||
@@ -13,13 +13,13 @@ type Story = StoryObj<typeof Card>
|
||||
|
||||
export const Default: Story = {
|
||||
args: {
|
||||
as: 'Default',
|
||||
as: "Default",
|
||||
},
|
||||
}
|
||||
|
||||
export const Featured: Story = {
|
||||
args: {
|
||||
...Default.args,
|
||||
as: 'Featured',
|
||||
as: "Featured",
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { variants } from './variants'
|
||||
import { variants } from "./variants"
|
||||
|
||||
import type { CardProps } from './types'
|
||||
import type { CardProps } from "./types"
|
||||
|
||||
export function Card({ as, className, children }: CardProps) {
|
||||
const classNames = variants({
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { Meta, StoryObj } from '@storybook/nextjs-vite'
|
||||
import { fn } from 'storybook/test'
|
||||
import type { Meta, StoryObj } from "@storybook/nextjs-vite"
|
||||
import { fn } from "storybook/test"
|
||||
|
||||
import { themes } from '../../../../.storybook/preview'
|
||||
import { themes } from "../../../../.storybook/preview"
|
||||
|
||||
import { Card } from '../'
|
||||
import { Button } from '../../Button'
|
||||
import { Typography } from '../../Typography'
|
||||
import { Card } from "../"
|
||||
import { Button } from "../../Button"
|
||||
import { Typography } from "../../Typography"
|
||||
|
||||
type CompositionProps = React.ComponentPropsWithoutRef<typeof Card> & {
|
||||
_onPrimaryPress?: () => void
|
||||
@@ -18,18 +18,18 @@ type CompositionProps = React.ComponentPropsWithoutRef<typeof Card> & {
|
||||
}
|
||||
|
||||
const meta: Meta<CompositionProps> = {
|
||||
title: 'Compositions/Card',
|
||||
title: "Compositions/Card",
|
||||
component: Card,
|
||||
decorators: [
|
||||
(Story, context) => {
|
||||
if (context.name.toLowerCase().indexOf('all themes') >= 0) {
|
||||
if (context.name.toLowerCase().indexOf("all themes") >= 0) {
|
||||
return (
|
||||
<>
|
||||
<h1>{context.name}</h1>
|
||||
{Object.entries(themes.themes).map(([key, value], ix) => {
|
||||
return (
|
||||
<div key={ix} className={value} style={{ padding: '1em 0' }}>
|
||||
<h2 style={{ paddingBottom: '0.5em' }}>{key}</h2>
|
||||
<div key={ix} className={value} style={{ padding: "1em 0" }}>
|
||||
<h2 style={{ paddingBottom: "0.5em" }}>{key}</h2>
|
||||
<Story />
|
||||
</div>
|
||||
)
|
||||
@@ -39,7 +39,7 @@ const meta: Meta<CompositionProps> = {
|
||||
}
|
||||
|
||||
return (
|
||||
<div style={{ display: 'flex' }}>
|
||||
<div style={{ display: "flex" }}>
|
||||
<Story />
|
||||
</div>
|
||||
)
|
||||
@@ -47,19 +47,19 @@ const meta: Meta<CompositionProps> = {
|
||||
],
|
||||
argTypes: {
|
||||
inMainArea: {
|
||||
name: 'Is in main area',
|
||||
name: "Is in main area",
|
||||
},
|
||||
showTitle: {
|
||||
name: 'Composition: Show title',
|
||||
name: "Composition: Show title",
|
||||
},
|
||||
showPreamble: {
|
||||
name: 'Composition: Show preamble',
|
||||
name: "Composition: Show preamble",
|
||||
},
|
||||
showPrimaryButton: {
|
||||
name: 'Composition: Show primary button',
|
||||
name: "Composition: Show primary button",
|
||||
},
|
||||
showSecondaryButton: {
|
||||
name: 'Composition: Show secondary button',
|
||||
name: "Composition: Show secondary button",
|
||||
},
|
||||
_onPrimaryPress: {
|
||||
table: {
|
||||
@@ -110,7 +110,7 @@ const meta: Meta<CompositionProps> = {
|
||||
|
||||
{showSecondaryButton && (
|
||||
<Button
|
||||
size={inMainArea ? 'lg' : 'sm'}
|
||||
size={inMainArea ? "lg" : "sm"}
|
||||
variant="Secondary"
|
||||
onPress={args._onSecondaryPress}
|
||||
>
|
||||
@@ -127,7 +127,7 @@ type Story = StoryObj<CompositionProps>
|
||||
|
||||
export const ContentCardMainArea: Story = {
|
||||
args: {
|
||||
as: 'Default',
|
||||
as: "Default",
|
||||
inMainArea: true,
|
||||
showTitle: true,
|
||||
showPreamble: true,
|
||||
@@ -140,7 +140,7 @@ export const ContentCardMainArea: Story = {
|
||||
|
||||
export const ContentCardNonMainArea: Story = {
|
||||
args: {
|
||||
as: 'Default',
|
||||
as: "Default",
|
||||
inMainArea: false,
|
||||
showTitle: true,
|
||||
showPreamble: true,
|
||||
|
||||
@@ -1 +1 @@
|
||||
export { Card } from './Card'
|
||||
export { Card } from "./Card"
|
||||
|
||||
@@ -1,11 +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"
|
||||
|
||||
type CardStyles = 'Default' | 'Featured'
|
||||
type CardStyles = "Default" | "Featured"
|
||||
|
||||
export interface CardProps
|
||||
extends React.HTMLAttributes<HTMLDivElement>,
|
||||
VariantProps<typeof variants> {
|
||||
extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof variants> {
|
||||
as: CardStyles
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { cva } from 'class-variance-authority'
|
||||
import { cva } from "class-variance-authority"
|
||||
|
||||
import styles from './card.module.css'
|
||||
import styles from "./card.module.css"
|
||||
|
||||
const config = {
|
||||
variants: {
|
||||
@@ -10,7 +10,7 @@ const config = {
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
as: 'Default',
|
||||
as: "Default",
|
||||
},
|
||||
} as const
|
||||
|
||||
|
||||
Reference in New Issue
Block a user