Skip to content

Commit

Permalink
chore: update clsx import (#2049)
Browse files Browse the repository at this point in the history
  • Loading branch information
Barsnes authored May 22, 2024
1 parent 16944fb commit c6c8ce4
Show file tree
Hide file tree
Showing 31 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion packages/react/src/components/Accordion/Accordion.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ReactNode, HTMLAttributes } from 'react';
import { forwardRef } from 'react';
import cl from 'clsx';
import cl from 'clsx/lite';

export type AccordionProps = {
/** Accordion background color */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import cl from 'clsx';
import cl from 'clsx/lite';
import type { ReactNode, HTMLAttributes } from 'react';
import { forwardRef, useContext } from 'react';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ChevronDownIcon } from '@navikt/aksel-icons';
import cl from 'clsx';
import cl from 'clsx/lite';
import type { ReactNode, MouseEventHandler, HTMLAttributes } from 'react';
import { forwardRef, useContext } from 'react';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import cl from 'clsx';
import cl from 'clsx/lite';
import type { ReactNode, HTMLAttributes } from 'react';
import { createContext, forwardRef, useState, useId } from 'react';

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Alert/Alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
XMarkOctagonFillIcon,
ExclamationmarkTriangleFillIcon,
} from '@navikt/aksel-icons';
import cl from 'clsx';
import cl from 'clsx/lite';

import { Paragraph } from '..';
import { getSize } from '../../utilities/getSize';
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Divider/Divider.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type * as React from 'react';
import cl from 'clsx';
import cl from 'clsx/lite';
import { forwardRef } from 'react';

export type DividerProps = {
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/HelpText/HelpText.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ButtonHTMLAttributes } from 'react';
import { useState } from 'react';
import cl from 'clsx';
import cl from 'clsx/lite';
import type { Placement } from '@floating-ui/utils';

import { Popover } from '../Popover';
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/List/ListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { forwardRef } from 'react';
import type { LiHTMLAttributes } from 'react';
import cl from 'clsx';
import cl from 'clsx/lite';
import { Slot } from '@radix-ui/react-slot';

export type ListItemProps = {
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/List/Lists.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { HTMLAttributes, OlHTMLAttributes } from 'react';
import { forwardRef, useContext } from 'react';
import cl from 'clsx';
import cl from 'clsx/lite';
import { Slot } from '@radix-ui/react-slot';

import { Paragraph } from '../Typography';
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Popover/PopoverContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
useMergeRefs,
useRole,
} from '@floating-ui/react';
import cl from 'clsx';
import cl from 'clsx/lite';

import { Paragraph } from '../Typography';
import { useIsomorphicLayoutEffect } from '../../hooks';
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Skeleton/Circle/Circle.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { HTMLAttributes } from 'react';
import cl from 'clsx';
import cl from 'clsx/lite';

import { useSynchronizedAnimation } from '../../../hooks';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { HTMLAttributes } from 'react';
import cl from 'clsx';
import cl from 'clsx/lite';

import { useSynchronizedAnimation } from '../../../hooks';

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Skeleton/Text/Text.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { HTMLAttributes } from 'react';
import cl from 'clsx';
import cl from 'clsx/lite';

import { useSynchronizedAnimation } from '../../../hooks';

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/SkipLink/SkipLink.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { AnchorHTMLAttributes, ReactNode } from 'react';
import cl from 'clsx';
import cl from 'clsx/lite';

export type SkipLinkProps = {
/** The content to display inside the skiplink. */
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Tabs/Tab/Tab.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { HTMLAttributes } from 'react';
import { forwardRef } from 'react';
import cl from 'clsx';
import cl from 'clsx/lite';

import { RovingTabindexItem } from '../../../utilities/RovingTabIndex';

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Tabs/TabList/TabList.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { HTMLAttributes } from 'react';
import { forwardRef } from 'react';
import cl from 'clsx';
import cl from 'clsx/lite';

import { RovingTabindexRoot } from '../../../utilities/RovingTabIndex';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { forwardRef } from 'react';
import cl from 'clsx';
import cl from 'clsx/lite';

import type { ButtonProps } from '../../Button';
import { Button } from '../../Button';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { HTMLAttributes } from 'react';
import { forwardRef } from 'react';
import cl from 'clsx';
import cl from 'clsx/lite';
import { Slot } from '@radix-ui/react-slot';

import { getSize } from '../../../utilities/getSize';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ElementType, HTMLAttributes } from 'react';
import { forwardRef } from 'react';
import cl from 'clsx';
import cl from 'clsx/lite';
import { Slot } from '@radix-ui/react-slot';

import { getSize } from '../../../utilities/getSize';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { HTMLAttributes } from 'react';
import { forwardRef } from 'react';
import cl from 'clsx';
import cl from 'clsx/lite';
import { Slot } from '@radix-ui/react-slot';

import { getSize } from '../../../utilities/getSize';
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Typography/Label/Label.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { LabelHTMLAttributes } from 'react';
import { forwardRef } from 'react';
import cl from 'clsx';
import cl from 'clsx/lite';
import { Slot } from '@radix-ui/react-slot';

import { getSize } from '../../../utilities/getSize';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { HTMLAttributes } from 'react';
import { forwardRef } from 'react';
import cl from 'clsx';
import cl from 'clsx/lite';
import { Slot } from '@radix-ui/react-slot';

import { getSize } from '../../../utilities/getSize';
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/form/Fieldset/Fieldset.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { FieldsetHTMLAttributes, ReactNode } from 'react';
import { useContext, forwardRef } from 'react';
import cl from 'clsx';
import cl from 'clsx/lite';
import { PadlockLockedFillIcon } from '@navikt/aksel-icons';

import { Label, Paragraph, ErrorMessage } from '../../Typography';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { forwardRef } from 'react';
import type { ForwardedRef, ReactNode, SelectHTMLAttributes } from 'react';
import cl from 'clsx';
import cl from 'clsx/lite';
import { PadlockLockedFillIcon } from '@navikt/aksel-icons';

import { omit } from '../../../utilities';
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/form/Radio/Group/Group.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ReactNode } from 'react';
import { forwardRef, createContext, useId } from 'react';
import cl from 'clsx';
import cl from 'clsx/lite';

import type { FieldsetProps } from '../../Fieldset';
import { Fieldset } from '../../Fieldset';
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/form/Radio/Radio.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { InputHTMLAttributes, ReactNode } from 'react';
import { forwardRef } from 'react';
import cl from 'clsx';
import cl from 'clsx/lite';

import { omit } from '../../../utilities';
import { Label, Paragraph } from '../../Typography';
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/form/Search/Search.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ReactNode, InputHTMLAttributes, ChangeEvent } from 'react';
import { forwardRef, useCallback, useRef, useState } from 'react';
import cl from 'clsx';
import cl from 'clsx/lite';
import { MagnifyingGlassIcon, XMarkIcon } from '@navikt/aksel-icons';
import { useMergeRefs } from '@floating-ui/react';

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/form/Textarea/Textarea.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ReactNode, TextareaHTMLAttributes } from 'react';
import { useState, forwardRef } from 'react';
import cl from 'clsx';
import cl from 'clsx/lite';
import { PadlockLockedFillIcon } from '@navikt/aksel-icons';

import { omit } from '../../../utilities';
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/form/Textfield/Textfield.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { InputHTMLAttributes, ReactNode } from 'react';
import { useState, useId, forwardRef } from 'react';
import cl from 'clsx';
import cl from 'clsx/lite';
import { PadlockLockedFillIcon } from '@navikt/aksel-icons';

import { omit } from '../../../utilities';
Expand Down
14 changes: 7 additions & 7 deletions packages/react/src/components/form/useFormField.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useContext, useId } from 'react';
import type { HTMLAttributes, InputHTMLAttributes, ReactNode } from 'react';
import cl from 'clsx';
import cl from 'clsx/lite';

import { getSize } from '../../utilities/getSize';

Expand Down Expand Up @@ -79,12 +79,12 @@ export const useFormField = (
disabled,
'aria-invalid': hasError ? true : undefined,
'aria-describedby':
cl(props['aria-describedby'], {
[descriptionId]:
!!props?.description && typeof props?.description === 'string',
[errorId]: hasError && !fieldset?.error,
[fieldset?.errorId ?? '']: hasError && !!fieldset?.error,
}) || undefined,
cl(
props['aria-describedby'],
(!!props?.description && typeof props?.description === 'string') && descriptionId,
(hasError && !fieldset?.error) && errorId,
(hasError && !!fieldset?.error) && fieldset?.errorId,
) || undefined,
},
};
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useCallback, useRef, useState } from 'react';
import type * as React from 'react';
import cl from 'clsx';
import cl from 'clsx/lite';

import { useMediaQuery, usePrevious } from '../../hooks';

Expand Down

0 comments on commit c6c8ce4

Please sign in to comment.