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,12 +1,13 @@
|
||||
import { Children, ReactNode } from 'react'
|
||||
import { headingVariants } from './variants'
|
||||
import { Children, ReactNode } from "react"
|
||||
import { headingVariants } from "./variants"
|
||||
|
||||
import type { VariantProps } from 'class-variance-authority'
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
type HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5'
|
||||
type HeadingLevel = "h1" | "h2" | "h3" | "h4" | "h5"
|
||||
|
||||
export interface HeadingProps
|
||||
extends Omit<React.HTMLAttributes<HTMLHeadingElement>, 'color'>,
|
||||
extends
|
||||
Omit<React.HTMLAttributes<HTMLHeadingElement>, "color">,
|
||||
VariantProps<typeof headingVariants> {
|
||||
as?: HeadingLevel
|
||||
level?: HeadingLevel
|
||||
@@ -22,12 +23,12 @@ export default function Title({
|
||||
*/
|
||||
as,
|
||||
children,
|
||||
className = '',
|
||||
className = "",
|
||||
color,
|
||||
/**
|
||||
* What HTML tag to use. Defaults to h1.
|
||||
*/
|
||||
level = 'h1',
|
||||
level = "h1",
|
||||
textAlign,
|
||||
textTransform,
|
||||
...rest
|
||||
@@ -52,7 +53,7 @@ export default function Title({
|
||||
|
||||
function checkForEmptyChildren(children: ReactNode) {
|
||||
return Children.toArray(children).filter((child) => {
|
||||
if (child === '') {
|
||||
if (child === "") {
|
||||
return false
|
||||
} else if (child == null) {
|
||||
return false
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { cva } from 'class-variance-authority'
|
||||
import { cva } from "class-variance-authority"
|
||||
|
||||
import styles from './title.module.css'
|
||||
import styles from "./title.module.css"
|
||||
|
||||
const config = {
|
||||
variants: {
|
||||
@@ -37,10 +37,10 @@ const config = {
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
color: 'burgundy',
|
||||
textAlign: 'left',
|
||||
textTransform: 'uppercase',
|
||||
type: 'h1',
|
||||
color: "burgundy",
|
||||
textAlign: "left",
|
||||
textTransform: "uppercase",
|
||||
type: "h1",
|
||||
},
|
||||
} as const
|
||||
|
||||
|
||||
Reference in New Issue
Block a user