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,31 +1,31 @@
|
||||
import type { Meta, StoryObj } from '@storybook/nextjs-vite'
|
||||
import type { Meta, StoryObj } from "@storybook/nextjs-vite"
|
||||
|
||||
import { expect } from 'storybook/test'
|
||||
import { expect } from "storybook/test"
|
||||
|
||||
import { TextLink } from '.'
|
||||
import { MaterialIcon } from '../Icons/MaterialIcon'
|
||||
import { Typography } from '../Typography'
|
||||
import { config } from './variants'
|
||||
import { TextLink } from "."
|
||||
import { MaterialIcon } from "../Icons/MaterialIcon"
|
||||
import { Typography } from "../Typography"
|
||||
import { config } from "./variants"
|
||||
|
||||
const meta: Meta<typeof TextLink> = {
|
||||
title: 'Core Components/TextLink',
|
||||
title: "Core Components/TextLink",
|
||||
component: TextLink,
|
||||
argTypes: {
|
||||
theme: {
|
||||
control: 'select',
|
||||
control: "select",
|
||||
options: Object.keys(config.variants.theme),
|
||||
default: config.defaultVariants.theme,
|
||||
},
|
||||
isInline: {
|
||||
control: 'boolean',
|
||||
control: "boolean",
|
||||
default: false,
|
||||
description:
|
||||
'Should be used when the link is placed inside a text block, removes the padding.',
|
||||
"Should be used when the link is placed inside a text block, removes the padding.",
|
||||
},
|
||||
isDisabled: {
|
||||
control: 'boolean',
|
||||
control: "boolean",
|
||||
default: false,
|
||||
description: 'Disables the link and makes it non-interactive.',
|
||||
description: "Disables the link and makes it non-interactive.",
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -36,12 +36,12 @@ type Story = StoryObj<typeof TextLink>
|
||||
|
||||
export const Default: Story = {
|
||||
args: {
|
||||
href: 'https://www.scandichotels.com/en',
|
||||
href: "https://www.scandichotels.com/en",
|
||||
},
|
||||
render: (args) => <TextLink {...args}>Default link</TextLink>,
|
||||
play: async ({ canvasElement }) => {
|
||||
const link = canvasElement.querySelector('a')
|
||||
if (!link) throw new Error('Link not found')
|
||||
const link = canvasElement.querySelector("a")
|
||||
if (!link) throw new Error("Link not found")
|
||||
expect(link).toBeInTheDocument()
|
||||
},
|
||||
}
|
||||
@@ -49,12 +49,12 @@ export const Default: Story = {
|
||||
export const Inverted: Story = {
|
||||
args: {
|
||||
...Default.args,
|
||||
theme: 'Inverted',
|
||||
theme: "Inverted",
|
||||
},
|
||||
render: (args) => <TextLink {...args}>Inverted link</TextLink>,
|
||||
play: async ({ canvasElement }) => {
|
||||
const link = canvasElement.querySelector('a')
|
||||
if (!link) throw new Error('Link not found')
|
||||
const link = canvasElement.querySelector("a")
|
||||
if (!link) throw new Error("Link not found")
|
||||
expect(link).toBeInTheDocument()
|
||||
},
|
||||
}
|
||||
@@ -66,8 +66,8 @@ export const Disabled: Story = {
|
||||
},
|
||||
render: (args) => <TextLink {...args}>Disabled link</TextLink>,
|
||||
play: async ({ canvasElement }) => {
|
||||
const link = canvasElement.querySelector('a')
|
||||
if (!link) throw new Error('Link not found')
|
||||
const link = canvasElement.querySelector("a")
|
||||
if (!link) throw new Error("Link not found")
|
||||
expect(link).toBeInTheDocument()
|
||||
},
|
||||
}
|
||||
@@ -83,8 +83,8 @@ export const WithIcon: Story = {
|
||||
</TextLink>
|
||||
),
|
||||
play: async ({ canvasElement }) => {
|
||||
const link = canvasElement.querySelector('a')
|
||||
if (!link) throw new Error('Link not found')
|
||||
const link = canvasElement.querySelector("a")
|
||||
if (!link) throw new Error("Link not found")
|
||||
expect(link).toBeInTheDocument()
|
||||
},
|
||||
}
|
||||
@@ -92,12 +92,12 @@ export const WithIcon: Story = {
|
||||
export const Small: Story = {
|
||||
args: {
|
||||
...Default.args,
|
||||
typography: 'Link/sm',
|
||||
typography: "Link/sm",
|
||||
},
|
||||
render: (args) => <TextLink {...args}>Small link</TextLink>,
|
||||
play: async ({ canvasElement }) => {
|
||||
const link = canvasElement.querySelector('a')
|
||||
if (!link) throw new Error('Link not found')
|
||||
const link = canvasElement.querySelector("a")
|
||||
if (!link) throw new Error("Link not found")
|
||||
expect(link).toBeInTheDocument()
|
||||
},
|
||||
}
|
||||
@@ -105,7 +105,7 @@ export const Small: Story = {
|
||||
export const SmallWithIcon: Story = {
|
||||
args: {
|
||||
...Default.args,
|
||||
typography: 'Link/sm',
|
||||
typography: "Link/sm",
|
||||
},
|
||||
render: (args) => (
|
||||
<TextLink {...args}>
|
||||
@@ -114,8 +114,8 @@ export const SmallWithIcon: Story = {
|
||||
</TextLink>
|
||||
),
|
||||
play: async ({ canvasElement }) => {
|
||||
const link = canvasElement.querySelector('a')
|
||||
if (!link) throw new Error('Link not found')
|
||||
const link = canvasElement.querySelector("a")
|
||||
if (!link) throw new Error("Link not found")
|
||||
expect(link).toBeInTheDocument()
|
||||
},
|
||||
}
|
||||
@@ -128,7 +128,7 @@ export const Inline: Story = {
|
||||
render: (args) => (
|
||||
<Typography variant="Body/Paragraph/mdRegular">
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit.{' '}
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit.{" "}
|
||||
<TextLink {...args}>Inline link</TextLink> Curabitur vitae neque non
|
||||
ipsum efficitur hendrerit at ut nulla. Cras in tellus et ligula posuere
|
||||
ullamcorper. Praesent pulvinar rutrum metus ut gravida.
|
||||
@@ -136,8 +136,8 @@ export const Inline: Story = {
|
||||
</Typography>
|
||||
),
|
||||
play: async ({ canvasElement }) => {
|
||||
const link = canvasElement.querySelector('a')
|
||||
if (!link) throw new Error('Link not found')
|
||||
const link = canvasElement.querySelector("a")
|
||||
if (!link) throw new Error("Link not found")
|
||||
expect(link).toBeInTheDocument()
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user