chore: add consistent type imports
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import { VariantProps } from "class-variance-authority"
|
||||
|
||||
import { accordionItemVariants } from "./variants"
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { IconName } from "@/types/components/icon"
|
||||
import type { accordionItemVariants } from "./variants"
|
||||
|
||||
export interface AccordionItemProps
|
||||
extends React.HtmlHTMLAttributes<HTMLDetailsElement>,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { VariantProps } from "class-variance-authority"
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import { accordionVariants } from "./variants"
|
||||
import type { accordionVariants } from "./variants"
|
||||
|
||||
export interface AccordionProps
|
||||
extends React.HtmlHTMLAttributes<HTMLUListElement>,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Children, cloneElement, isValidElement } from "react"
|
||||
|
||||
import { AccordionItemProps } from "./AccordionItem/accordionItem"
|
||||
import { accordionVariants } from "./variants"
|
||||
|
||||
import type { AccordionProps } from "./accordion"
|
||||
import type { AccordionItemProps } from "./AccordionItem/accordionItem"
|
||||
|
||||
export default function Accordion({
|
||||
children,
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { alertVariants } from "./variants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import { AlertTypeEnum } from "@/types/enums/alert"
|
||||
import type { AlertTypeEnum } from "@/types/enums/alert"
|
||||
import type { SidepeekContent } from "@/types/trpc/routers/contentstack/siteConfig"
|
||||
import type { alertVariants } from "./variants"
|
||||
|
||||
export interface AlertProps extends VariantProps<typeof alertVariants> {
|
||||
className?: string
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { buttonVariants } from "./variants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
import type { ButtonProps as ReactAriaButtonProps } from "react-aria-components"
|
||||
|
||||
import type { buttonVariants } from "./variants"
|
||||
|
||||
export interface ButtonPropsRAC
|
||||
extends Omit<ReactAriaButtonProps, "isDisabled">,
|
||||
VariantProps<typeof buttonVariants> {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { cardVariants } from "./variants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { ApiImage } from "@/types/components/image"
|
||||
import type { ImageVaultAsset } from "@/types/components/imageVault"
|
||||
import type { cardVariants } from "./variants"
|
||||
|
||||
export interface CardProps
|
||||
extends React.HTMLAttributes<HTMLDivElement>,
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { biroScriptVariants } from "@/components/TempDesignSystem/Text/BiroScript/variants"
|
||||
import { bodyVariants } from "@/components/TempDesignSystem/Text/Body/variants"
|
||||
import { headingVariants } from "@/components/TempDesignSystem/Text/Title/variants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { ButtonProps } from "@/components/TempDesignSystem/Button/button"
|
||||
import type { CardProps } from "@/components/TempDesignSystem/Card/card"
|
||||
import type { biroScriptVariants } from "@/components/TempDesignSystem/Text/BiroScript/variants"
|
||||
import type { bodyVariants } from "@/components/TempDesignSystem/Text/Body/variants"
|
||||
import type { headingVariants } from "@/components/TempDesignSystem/Text/Title/variants"
|
||||
|
||||
export function getTitleFontColor(
|
||||
theme: CardProps["theme"]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { chipVariants } from "./variants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { chipVariants } from "./variants"
|
||||
|
||||
export interface ChipProps
|
||||
extends React.HtmlHTMLAttributes<HTMLDivElement>,
|
||||
VariantProps<typeof chipVariants> {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { dividerVariants } from "./variants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { dividerVariants } from "./variants"
|
||||
|
||||
export interface DividerProps
|
||||
extends Omit<React.HTMLAttributes<HTMLDivElement>, "color">,
|
||||
VariantProps<typeof dividerVariants> {}
|
||||
|
||||
@@ -9,7 +9,7 @@ import Caption from "@/components/TempDesignSystem/Text/Caption"
|
||||
|
||||
import styles from "./checkbox.module.css"
|
||||
|
||||
import { CheckboxProps } from "@/types/components/checkbox"
|
||||
import type { CheckboxProps } from "@/types/components/checkbox"
|
||||
|
||||
export default function Checkbox({
|
||||
className,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client"
|
||||
import { parseDate } from "@internationalized/date"
|
||||
import { useEffect } from "react"
|
||||
import { DateInput, DatePicker, Group } from "react-aria-components"
|
||||
import { DateInput, DatePicker, Group, type Key } from "react-aria-components"
|
||||
import { useController, useFormContext, useWatch } from "react-hook-form"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
@@ -13,14 +13,10 @@ import { getLocalizedMonthName } from "@/utils/dateFormatting"
|
||||
import { rangeArray } from "@/utils/rangeArray"
|
||||
|
||||
import ErrorMessage from "../ErrorMessage"
|
||||
import { DateName } from "./date"
|
||||
import { DateName, type DateProps } from "./date"
|
||||
|
||||
import styles from "./date.module.css"
|
||||
|
||||
import type { Key } from "react-aria-components"
|
||||
|
||||
import type { DateProps } from "./date"
|
||||
|
||||
export default function DateSelect({ name, registerOptions = {} }: DateProps) {
|
||||
const intl = useIntl()
|
||||
const { control, setValue, formState, watch } = useFormContext()
|
||||
|
||||
@@ -6,7 +6,7 @@ import Caption from "@/components/TempDesignSystem/Text/Caption"
|
||||
|
||||
import styles from "./chip.module.css"
|
||||
|
||||
import { FilterChipProps } from "@/types/components/form/filterChip"
|
||||
import type { FilterChipProps } from "@/types/components/form/filterChip"
|
||||
|
||||
export default function FilterChip({
|
||||
Icon = HeartIcon,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { labelVariants } from "./variants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { labelVariants } from "./variants"
|
||||
|
||||
export interface LabelProps
|
||||
extends React.PropsWithChildren<React.HTMLAttributes<HTMLSpanElement>>,
|
||||
VariantProps<typeof labelVariants> {
|
||||
|
||||
@@ -17,11 +17,11 @@ import Caption from "@/components/TempDesignSystem/Text/Caption"
|
||||
import { passwordValidators } from "@/utils/passwordValidator"
|
||||
|
||||
import Button from "../../Button"
|
||||
import { IconProps, type NewPasswordProps } from "./newPassword"
|
||||
import { type IconProps, type NewPasswordProps } from "./newPassword"
|
||||
|
||||
import styles from "./newPassword.module.css"
|
||||
|
||||
import { PasswordValidatorKey } from "@/types/components/form/newPassword"
|
||||
import type { PasswordValidatorKey } from "@/types/components/form/newPassword"
|
||||
|
||||
export default function NewPassword({
|
||||
name = "newPassword",
|
||||
|
||||
@@ -7,13 +7,11 @@ import { useController, useFormContext, useWatch } from "react-hook-form"
|
||||
import {
|
||||
CountrySelector,
|
||||
DialCodePreview,
|
||||
ParsedCountry,
|
||||
type ParsedCountry,
|
||||
usePhoneInput,
|
||||
} from "react-international-phone"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { Lang } from "@/constants/languages"
|
||||
|
||||
import { ChevronDownIcon } from "@/components/Icons"
|
||||
import ErrorMessage from "@/components/TempDesignSystem/Form/ErrorMessage"
|
||||
import AriaInputWithLabel from "@/components/TempDesignSystem/Form/Input/AriaInputWithLabel"
|
||||
@@ -29,6 +27,7 @@ import type {
|
||||
LowerCaseCountryCode,
|
||||
PhoneProps,
|
||||
} from "@/types/components/form/phone"
|
||||
import type { Lang } from "@/constants/languages"
|
||||
|
||||
export default function Phone({
|
||||
ariaLabel = "Phone number input",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { itemVariants } from "./variants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { itemVariants } from "./variants"
|
||||
|
||||
export interface ItemProps
|
||||
extends React.HTMLAttributes<HTMLElement>,
|
||||
VariantProps<typeof itemVariants> {}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { StackableGridProps } from "./stackable"
|
||||
import { stackableGridVariants } from "./variants"
|
||||
|
||||
import type { StackableGridProps } from "./stackable"
|
||||
|
||||
export default function Stackable({
|
||||
children,
|
||||
className,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { stackableGridVariants } from "./variants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { stackableGridVariants } from "./variants"
|
||||
|
||||
export interface StackableGridProps
|
||||
extends React.HTMLAttributes<HTMLDivElement>,
|
||||
VariantProps<typeof stackableGridVariants> {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { linkVariants } from "./variants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { linkVariants } from "./variants"
|
||||
|
||||
export interface LinkProps
|
||||
extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "color">,
|
||||
VariantProps<typeof linkVariants> {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { loyaltyCardVariants } from "./variants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import { ImageVaultAsset } from "@/types/components/imageVault"
|
||||
import type { ImageVaultAsset } from "@/types/components/imageVault"
|
||||
import type { loyaltyCardVariants } from "./variants"
|
||||
|
||||
export interface LoyaltyCardProps
|
||||
extends React.HTMLAttributes<HTMLDivElement>,
|
||||
|
||||
@@ -10,10 +10,11 @@ import { CloseLargeIcon } from "@/components/Icons"
|
||||
import useSetOverFlowVisibleOnRA from "@/hooks/useSetOverflowVisibleOnRA"
|
||||
|
||||
import { Arrow } from "./Arrow"
|
||||
import { PopoverProps } from "./popover"
|
||||
|
||||
import styles from "./popover.module.css"
|
||||
|
||||
import type { PopoverProps } from "./popover"
|
||||
|
||||
export default function Popover({
|
||||
triggerContent,
|
||||
children,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { showMoreButtonVariants } from "./variants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { showMoreButtonVariants } from "./variants"
|
||||
|
||||
export interface ShowMoreButtonProps
|
||||
extends React.PropsWithChildren<React.HTMLAttributes<HTMLDivElement>>,
|
||||
VariantProps<typeof showMoreButtonVariants> {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { tableVariants } from "./variants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { tableVariants } from "./variants"
|
||||
|
||||
export interface TableProps
|
||||
extends React.PropsWithChildren<React.HTMLAttributes<HTMLTableElement>>,
|
||||
VariantProps<typeof tableVariants> {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { biroScriptVariants } from "./variants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { biroScriptVariants } from "./variants"
|
||||
|
||||
export interface BiroScriptProps
|
||||
extends Omit<React.HTMLAttributes<HTMLSpanElement>, "color">,
|
||||
VariantProps<typeof biroScriptVariants> {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { bodyVariants } from "./variants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { bodyVariants } from "./variants"
|
||||
|
||||
export interface BodyProps
|
||||
extends Omit<React.HTMLAttributes<HTMLHeadingElement>, "color">,
|
||||
VariantProps<typeof bodyVariants> {
|
||||
VariantProps<typeof bodyVariants> {
|
||||
asChild?: boolean
|
||||
fontOnly?: boolean
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { captionVariants } from "./variants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { captionVariants } from "./variants"
|
||||
|
||||
export interface CaptionProps
|
||||
extends Omit<React.HTMLAttributes<HTMLHeadingElement>, "color">,
|
||||
VariantProps<typeof captionVariants> {
|
||||
VariantProps<typeof captionVariants> {
|
||||
asChild?: boolean
|
||||
fontOnly?: boolean
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { footnoteVariants } from "./variants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { footnoteVariants } from "./variants"
|
||||
|
||||
export interface FootnoteProps
|
||||
extends Omit<React.HTMLAttributes<HTMLParagraphElement>, "color">,
|
||||
VariantProps<typeof footnoteVariants> {
|
||||
VariantProps<typeof footnoteVariants> {
|
||||
asChild?: boolean
|
||||
fontOnly?: boolean
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { preambleVariants } from "./variants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { preambleVariants } from "./variants"
|
||||
|
||||
export interface CaptionProps
|
||||
extends Omit<React.HTMLAttributes<HTMLHeadingElement>, "color">,
|
||||
VariantProps<typeof preambleVariants> {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { subtitleVariants } from "./variants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { subtitleVariants } from "./variants"
|
||||
|
||||
export interface SubtitleProps
|
||||
extends Omit<React.HTMLAttributes<HTMLHeadingElement>, "color">,
|
||||
VariantProps<typeof subtitleVariants> {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { headingVariants } from "./variants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { headingVariants } from "./variants"
|
||||
|
||||
type HeadingLevel = "h1" | "h2" | "h3" | "h4" | "h5"
|
||||
|
||||
export interface HeadingProps
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ExternalToast, toast as sonnerToast, Toaster } from "sonner"
|
||||
import { type ExternalToast, toast as sonnerToast, Toaster } from "sonner"
|
||||
|
||||
import {
|
||||
CheckCircleIcon,
|
||||
@@ -10,11 +10,12 @@ import {
|
||||
|
||||
import Button from "../Button"
|
||||
import Body from "../Text/Body"
|
||||
import { ToastsProps } from "./toasts"
|
||||
import { toastVariants } from "./variants"
|
||||
|
||||
import styles from "./toasts.module.css"
|
||||
|
||||
import type { ToastsProps } from "./toasts"
|
||||
|
||||
export function ToastHandler() {
|
||||
return <Toaster position="bottom-right" duration={5000} />
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { toastVariants } from "./variants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { toastVariants } from "./variants"
|
||||
|
||||
export type ToastsProps = Omit<React.HTMLAttributes<HTMLDivElement>, "color"> &
|
||||
VariantProps<typeof toastVariants> & {
|
||||
onClose?: () => void
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { PropsWithChildren, useState } from "react"
|
||||
import { type PropsWithChildren, useState } from "react"
|
||||
|
||||
import Caption from "@/components/TempDesignSystem/Text/Caption"
|
||||
|
||||
@@ -6,7 +6,7 @@ import { tooltipVariants } from "./variants"
|
||||
|
||||
import styles from "./tooltip.module.css"
|
||||
|
||||
import { TooltipPosition, TooltipProps } from "@/types/components/tooltip"
|
||||
import type { TooltipPosition, TooltipProps } from "@/types/components/tooltip"
|
||||
|
||||
export function Tooltip<P extends TooltipPosition>({
|
||||
heading,
|
||||
|
||||
Reference in New Issue
Block a user