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,18 +1,18 @@
|
||||
import type { Meta, StoryObj } from '@storybook/nextjs-vite'
|
||||
import type { Meta, StoryObj } from "@storybook/nextjs-vite"
|
||||
|
||||
import { fn } from 'storybook/test'
|
||||
import { fn } from "storybook/test"
|
||||
|
||||
import { MaterialIcon } from '../Icons/MaterialIcon/MaterialIcon.tsx'
|
||||
import { ChipButton } from './ChipButton.tsx'
|
||||
import { config as chipButtonConfig } from './variants'
|
||||
import { MaterialIcon } from "../Icons/MaterialIcon/MaterialIcon.tsx"
|
||||
import { ChipButton } from "./ChipButton.tsx"
|
||||
import { config as chipButtonConfig } from "./variants"
|
||||
|
||||
const meta: Meta<typeof ChipButton> = {
|
||||
title: 'Core Components/ChipButton',
|
||||
title: "Core Components/ChipButton",
|
||||
component: ChipButton,
|
||||
argTypes: {
|
||||
variant: {
|
||||
control: 'select',
|
||||
type: 'string',
|
||||
control: "select",
|
||||
type: "string",
|
||||
options: Object.keys(chipButtonConfig.variants.variant),
|
||||
},
|
||||
onPress: {
|
||||
@@ -41,7 +41,7 @@ export const Default: Story = {
|
||||
|
||||
export const Outlined: Story = {
|
||||
args: {
|
||||
variant: 'Outlined',
|
||||
variant: "Outlined",
|
||||
onPress: fn(),
|
||||
children: (
|
||||
<>
|
||||
@@ -54,9 +54,9 @@ export const Outlined: Story = {
|
||||
|
||||
export const FilterRoundedLarge: Story = {
|
||||
args: {
|
||||
variant: 'FilterRounded',
|
||||
variant: "FilterRounded",
|
||||
onPress: fn(),
|
||||
size: 'Large',
|
||||
size: "Large",
|
||||
children: (
|
||||
<>
|
||||
<MaterialIcon icon="location_city" size={20} color="CurrentColor" />
|
||||
@@ -68,9 +68,9 @@ export const FilterRoundedLarge: Story = {
|
||||
|
||||
export const FilterRoundedLargeSelected: Story = {
|
||||
args: {
|
||||
variant: 'FilterRounded',
|
||||
variant: "FilterRounded",
|
||||
onPress: fn(),
|
||||
size: 'Large',
|
||||
size: "Large",
|
||||
selected: true,
|
||||
children: (
|
||||
<>
|
||||
@@ -83,9 +83,9 @@ export const FilterRoundedLargeSelected: Story = {
|
||||
|
||||
export const FilterRoundedMedium: Story = {
|
||||
args: {
|
||||
variant: 'FilterRounded',
|
||||
variant: "FilterRounded",
|
||||
onPress: fn(),
|
||||
size: 'Medium',
|
||||
size: "Medium",
|
||||
children: (
|
||||
<>
|
||||
<MaterialIcon icon="location_city" size={20} color="CurrentColor" />
|
||||
@@ -97,9 +97,9 @@ export const FilterRoundedMedium: Story = {
|
||||
|
||||
export const FilterRoundedMediumSelected: Story = {
|
||||
args: {
|
||||
variant: 'FilterRounded',
|
||||
variant: "FilterRounded",
|
||||
onPress: fn(),
|
||||
size: 'Medium',
|
||||
size: "Medium",
|
||||
selected: true,
|
||||
children: (
|
||||
<>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { Button as ButtonRAC } from 'react-aria-components'
|
||||
import { Button as ButtonRAC } from "react-aria-components"
|
||||
|
||||
import { ChipButtonProps } from './types'
|
||||
import { variants } from './variants'
|
||||
import { ChipButtonProps } from "./types"
|
||||
import { variants } from "./variants"
|
||||
|
||||
export function ChipButton({
|
||||
children,
|
||||
variant,
|
||||
selected = false,
|
||||
size = 'Large',
|
||||
size = "Large",
|
||||
className,
|
||||
...props
|
||||
}: ChipButtonProps) {
|
||||
@@ -18,7 +18,7 @@ export function ChipButton({
|
||||
})
|
||||
|
||||
return (
|
||||
<ButtonRAC {...props} className={[className, classNames].join(' ')}>
|
||||
<ButtonRAC {...props} className={[className, classNames].join(" ")}>
|
||||
{children}
|
||||
</ButtonRAC>
|
||||
)
|
||||
|
||||
@@ -1 +1 @@
|
||||
export { ChipButton } from './ChipButton'
|
||||
export { ChipButton } from "./ChipButton"
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { Button } from 'react-aria-components'
|
||||
import { Button } from "react-aria-components"
|
||||
|
||||
import type { VariantProps } from 'class-variance-authority'
|
||||
import type { ComponentProps } from 'react'
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
import type { ComponentProps } from "react"
|
||||
|
||||
import type { variants } from './variants'
|
||||
import type { variants } from "./variants"
|
||||
|
||||
export interface ChipButtonProps
|
||||
extends ComponentProps<typeof Button>,
|
||||
VariantProps<typeof variants> {}
|
||||
extends ComponentProps<typeof Button>, VariantProps<typeof variants> {}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
import { cva } from 'class-variance-authority'
|
||||
import { cva } from "class-variance-authority"
|
||||
|
||||
import { deepmerge } from 'deepmerge-ts'
|
||||
import styles from './chip-button.module.css'
|
||||
import { config as typographyConfig } from '../Typography/variants'
|
||||
import { deepmerge } from "deepmerge-ts"
|
||||
import styles from "./chip-button.module.css"
|
||||
import { config as typographyConfig } from "../Typography/variants"
|
||||
|
||||
const variantKeys = {
|
||||
variant: {
|
||||
Default: 'Default',
|
||||
Outlined: 'Outlined',
|
||||
FilterRounded: 'FilterRounded',
|
||||
Default: "Default",
|
||||
Outlined: "Outlined",
|
||||
FilterRounded: "FilterRounded",
|
||||
},
|
||||
style: {
|
||||
Medium: 'Medium',
|
||||
Large: 'Large',
|
||||
Medium: "Medium",
|
||||
Large: "Large",
|
||||
},
|
||||
typography: {
|
||||
Bold: 'Body/Supporting text (caption)/smBold',
|
||||
Regular: 'Body/Supporting text (caption)/smRegular',
|
||||
Bold: "Body/Supporting text (caption)/smBold",
|
||||
Regular: "Body/Supporting text (caption)/smRegular",
|
||||
},
|
||||
} as const
|
||||
|
||||
@@ -28,12 +28,12 @@ export const config = {
|
||||
[variantKeys.variant.FilterRounded]: styles.FilterRounded,
|
||||
},
|
||||
selected: {
|
||||
true: '',
|
||||
false: '',
|
||||
true: "",
|
||||
false: "",
|
||||
},
|
||||
size: {
|
||||
[variantKeys.style.Medium]: '',
|
||||
[variantKeys.style.Large]: '',
|
||||
[variantKeys.style.Medium]: "",
|
||||
[variantKeys.style.Large]: "",
|
||||
},
|
||||
},
|
||||
compoundVariants: [
|
||||
@@ -41,7 +41,7 @@ export const config = {
|
||||
variant: variantKeys.variant.Default,
|
||||
className: [
|
||||
typographyConfig.variants.variant[
|
||||
'Body/Supporting text (caption)/smBold'
|
||||
"Body/Supporting text (caption)/smBold"
|
||||
],
|
||||
],
|
||||
},
|
||||
@@ -49,7 +49,7 @@ export const config = {
|
||||
variant: variantKeys.variant.Outlined,
|
||||
className: [
|
||||
typographyConfig.variants.variant[
|
||||
'Body/Supporting text (caption)/smBold'
|
||||
"Body/Supporting text (caption)/smBold"
|
||||
],
|
||||
],
|
||||
},
|
||||
@@ -59,7 +59,7 @@ export const config = {
|
||||
selected: true,
|
||||
className: [
|
||||
typographyConfig.variants.variant[
|
||||
'Body/Supporting text (caption)/smRegular'
|
||||
"Body/Supporting text (caption)/smRegular"
|
||||
],
|
||||
styles.selected,
|
||||
styles.medium,
|
||||
@@ -71,7 +71,7 @@ export const config = {
|
||||
selected: false,
|
||||
className: [
|
||||
typographyConfig.variants.variant[
|
||||
'Body/Supporting text (caption)/smRegular'
|
||||
"Body/Supporting text (caption)/smRegular"
|
||||
],
|
||||
styles.medium,
|
||||
],
|
||||
@@ -82,7 +82,7 @@ export const config = {
|
||||
selected: true,
|
||||
className: [
|
||||
typographyConfig.variants.variant[
|
||||
'Body/Supporting text (caption)/smRegular'
|
||||
"Body/Supporting text (caption)/smRegular"
|
||||
],
|
||||
styles.selected,
|
||||
styles.large,
|
||||
@@ -94,7 +94,7 @@ export const config = {
|
||||
selected: false,
|
||||
className: [
|
||||
typographyConfig.variants.variant[
|
||||
'Body/Supporting text (caption)/smRegular'
|
||||
"Body/Supporting text (caption)/smRegular"
|
||||
],
|
||||
styles.large,
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user