mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
style: enable import-x/no-duplicates (#6279)
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { CameraIcon } from '@blocksuite/icons';
|
||||
import type { Meta, StoryFn } from '@storybook/react';
|
||||
|
||||
import { Avatar, type AvatarProps } from './avatar';
|
||||
import type { AvatarProps } from './avatar';
|
||||
import { Avatar } from './avatar';
|
||||
|
||||
export default {
|
||||
title: 'UI/Avatar',
|
||||
|
||||
@@ -1,19 +1,27 @@
|
||||
import { CloseIcon } from '@blocksuite/icons';
|
||||
import type {
|
||||
AvatarFallbackProps,
|
||||
AvatarImageProps,
|
||||
AvatarProps as RadixAvatarProps,
|
||||
} from '@radix-ui/react-avatar';
|
||||
import {
|
||||
type AvatarFallbackProps,
|
||||
type AvatarImageProps,
|
||||
type AvatarProps as RadixAvatarProps,
|
||||
Fallback as AvatarFallback,
|
||||
Image as AvatarImage,
|
||||
Root as AvatarRoot,
|
||||
} from '@radix-ui/react-avatar';
|
||||
import { assignInlineVars } from '@vanilla-extract/dynamic';
|
||||
import clsx from 'clsx';
|
||||
import type { CSSProperties, HTMLAttributes, MouseEvent } from 'react';
|
||||
import { forwardRef, type ReactElement, useMemo, useState } from 'react';
|
||||
import type {
|
||||
CSSProperties,
|
||||
HTMLAttributes,
|
||||
MouseEvent,
|
||||
ReactElement,
|
||||
} from 'react';
|
||||
import { forwardRef, useMemo, useState } from 'react';
|
||||
|
||||
import { IconButton } from '../button';
|
||||
import { Tooltip, type TooltipProps } from '../tooltip';
|
||||
import type { TooltipProps } from '../tooltip';
|
||||
import { Tooltip } from '../tooltip';
|
||||
import { ColorfulFallback } from './colorful-fallback';
|
||||
import * as style from './style.css';
|
||||
import { sizeVar } from './style.css';
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { InformationIcon } from '@blocksuite/icons';
|
||||
import type { Meta, StoryFn } from '@storybook/react';
|
||||
|
||||
import { Button, type ButtonProps } from './button';
|
||||
import type { ButtonProps } from './button';
|
||||
import { Button } from './button';
|
||||
export default {
|
||||
title: 'UI/Button',
|
||||
component: Button,
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import clsx from 'clsx';
|
||||
import {
|
||||
type FC,
|
||||
forwardRef,
|
||||
type HTMLAttributes,
|
||||
type PropsWithChildren,
|
||||
type ReactElement,
|
||||
useMemo,
|
||||
import type {
|
||||
FC,
|
||||
HTMLAttributes,
|
||||
PropsWithChildren,
|
||||
ReactElement,
|
||||
} from 'react';
|
||||
import { forwardRef, useMemo } from 'react';
|
||||
|
||||
import { Loading } from '../loading';
|
||||
import { button, buttonIcon } from './button.css';
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import { ArrowDownSmallIcon } from '@blocksuite/icons';
|
||||
import {
|
||||
type ButtonHTMLAttributes,
|
||||
forwardRef,
|
||||
type MouseEventHandler,
|
||||
} from 'react';
|
||||
import type { ButtonHTMLAttributes, MouseEventHandler } from 'react';
|
||||
import { forwardRef } from 'react';
|
||||
|
||||
import * as styles from './styles.css';
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { InformationIcon } from '@blocksuite/icons';
|
||||
import type { Meta, StoryFn } from '@storybook/react';
|
||||
|
||||
import { IconButton, type IconButtonProps } from './icon-button';
|
||||
import type { IconButtonProps } from './icon-button';
|
||||
import { IconButton } from './icon-button';
|
||||
export default {
|
||||
title: 'UI/IconButton',
|
||||
component: IconButton,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import clsx from 'clsx';
|
||||
import type { HTMLAttributes, PropsWithChildren } from 'react';
|
||||
import { forwardRef, type ReactElement } from 'react';
|
||||
import type { HTMLAttributes, PropsWithChildren, ReactElement } from 'react';
|
||||
import { forwardRef } from 'react';
|
||||
|
||||
import { Loading } from '../loading';
|
||||
import type { ButtonType } from './button';
|
||||
|
||||
@@ -4,7 +4,8 @@ import type {
|
||||
} from '@radix-ui/react-radio-group';
|
||||
import * as RadioGroup from '@radix-ui/react-radio-group';
|
||||
import clsx from 'clsx';
|
||||
import { type CSSProperties, forwardRef } from 'react';
|
||||
import type { CSSProperties } from 'react';
|
||||
import { forwardRef } from 'react';
|
||||
|
||||
import * as styles from './styles.css';
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// components/checkbox.tsx
|
||||
import clsx from 'clsx';
|
||||
import { type HTMLAttributes, useCallback, useEffect, useRef } from 'react';
|
||||
import type { HTMLAttributes } from 'react';
|
||||
import { useCallback, useEffect, useRef } from 'react';
|
||||
|
||||
import * as icons from './icons';
|
||||
import * as styles from './index.css';
|
||||
|
||||
@@ -6,8 +6,8 @@ import * as styles from './calendar.css';
|
||||
import { DATE_MAX, DATE_MIN } from './constants';
|
||||
import { DayPicker } from './day-picker';
|
||||
import { MonthPicker } from './month-picker';
|
||||
import type { SelectMode } from './types';
|
||||
import { type DatePickerProps, defaultDatePickerProps } from './types';
|
||||
import type { DatePickerProps, SelectMode } from './types';
|
||||
import { defaultDatePickerProps } from './types';
|
||||
import { YearPicker } from './year-picker';
|
||||
|
||||
export type { DatePickerProps } from './types';
|
||||
|
||||
@@ -1,13 +1,8 @@
|
||||
import { ArrowLeftSmallIcon, ArrowRightSmallIcon } from '@blocksuite/icons';
|
||||
import { assignInlineVars } from '@vanilla-extract/dynamic';
|
||||
import clsx from 'clsx';
|
||||
import {
|
||||
forwardRef,
|
||||
type HTMLAttributes,
|
||||
memo,
|
||||
type PropsWithChildren,
|
||||
type ReactNode,
|
||||
} from 'react';
|
||||
import type { HTMLAttributes, PropsWithChildren, ReactNode } from 'react';
|
||||
import { forwardRef, memo } from 'react';
|
||||
|
||||
import { IconButton } from '../../button';
|
||||
import * as styles from './calendar.css';
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { ArrowLeftSmallIcon, ArrowRightSmallIcon } from '@blocksuite/icons';
|
||||
import clsx from 'clsx';
|
||||
import dayjs from 'dayjs';
|
||||
import type { ForwardedRef, HTMLAttributes } from 'react';
|
||||
import {
|
||||
type ForwardedRef,
|
||||
type HTMLAttributes,
|
||||
memo,
|
||||
useCallback,
|
||||
useEffect,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { Meta, StoryFn } from '@storybook/react';
|
||||
|
||||
import { Divider, type DividerProps } from './index';
|
||||
import type { DividerProps } from './index';
|
||||
import { Divider } from './index';
|
||||
|
||||
export default {
|
||||
title: 'UI/Divider',
|
||||
|
||||
@@ -3,7 +3,8 @@ import { useCallback, useRef, useState } from 'react';
|
||||
|
||||
import { Button } from '../button';
|
||||
import { ResizePanel } from '../resize-panel/resize-panel';
|
||||
import { InlineEdit, type InlineEditHandle } from './inline-edit';
|
||||
import type { InlineEditHandle } from './inline-edit';
|
||||
import { InlineEdit } from './inline-edit';
|
||||
|
||||
export default {
|
||||
title: 'UI/Editable/Inline Edit',
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { Meta, StoryFn } from '@storybook/react';
|
||||
|
||||
import { Empty, type EmptyContentProps } from './index';
|
||||
import type { EmptyContentProps } from './index';
|
||||
import { Empty } from './index';
|
||||
|
||||
export default {
|
||||
title: 'UI/Empty',
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { InformationIcon } from '@blocksuite/icons';
|
||||
import type { Meta, StoryFn } from '@storybook/react';
|
||||
|
||||
import { Input, type InputProps } from './index';
|
||||
import type { InputProps } from './index';
|
||||
import { Input } from './index';
|
||||
|
||||
export default {
|
||||
title: 'UI/Input',
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { Meta, StoryFn } from '@storybook/react';
|
||||
|
||||
import { Loading, type LoadingProps } from './loading';
|
||||
import type { LoadingProps } from './loading';
|
||||
import { Loading } from './loading';
|
||||
|
||||
export default {
|
||||
title: 'UI/Loading',
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import type { Meta, StoryFn } from '@storybook/react';
|
||||
|
||||
import {
|
||||
AnimatedCollectionsIcon,
|
||||
type CollectionsIconProps,
|
||||
} from './collections-icon';
|
||||
import type { CollectionsIconProps } from './collections-icon';
|
||||
import { AnimatedCollectionsIcon } from './collections-icon';
|
||||
|
||||
export default {
|
||||
title: 'UI/Lottie/Collection Icons',
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import clsx from 'clsx';
|
||||
import Lottie, { type LottieRef } from 'lottie-react';
|
||||
import type { LottieRef } from 'lottie-react';
|
||||
import Lottie from 'lottie-react';
|
||||
import { useEffect, useRef } from 'react';
|
||||
|
||||
import animationData from './collections-icon.json';
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { Meta, StoryFn } from '@storybook/react';
|
||||
|
||||
import { AnimatedDeleteIcon, type DeleteIconProps } from './delete-icon';
|
||||
import type { DeleteIconProps } from './delete-icon';
|
||||
import { AnimatedDeleteIcon } from './delete-icon';
|
||||
|
||||
export default {
|
||||
title: 'UI/Lottie/Delete Icon',
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import clsx from 'clsx';
|
||||
import Lottie, { type LottieRef } from 'lottie-react';
|
||||
import type { LottieRef } from 'lottie-react';
|
||||
import Lottie from 'lottie-react';
|
||||
import { useEffect, useRef } from 'react';
|
||||
|
||||
import animationData from './delete-icon.json';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import clsx from 'clsx';
|
||||
import type { PropsWithChildren, ReactNode } from 'react';
|
||||
import { forwardRef, type HTMLAttributes, useMemo } from 'react';
|
||||
import type { HTMLAttributes, PropsWithChildren, ReactNode } from 'react';
|
||||
import { forwardRef, useMemo } from 'react';
|
||||
|
||||
import { menuItemIcon } from './styles.css';
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { Meta, StoryFn } from '@storybook/react';
|
||||
|
||||
import { MenuTrigger, type MenuTriggerProps } from './index';
|
||||
import type { MenuTriggerProps } from './index';
|
||||
import { MenuTrigger } from './index';
|
||||
|
||||
export default {
|
||||
title: 'UI/MenuTrigger',
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { ArrowDownSmallIcon } from '@blocksuite/icons';
|
||||
import { assignInlineVars } from '@vanilla-extract/dynamic';
|
||||
import clsx from 'clsx';
|
||||
import type { PropsWithChildren } from 'react';
|
||||
import {
|
||||
type CSSProperties,
|
||||
forwardRef,
|
||||
type HTMLAttributes,
|
||||
type ReactNode,
|
||||
import type {
|
||||
CSSProperties,
|
||||
HTMLAttributes,
|
||||
PropsWithChildren,
|
||||
ReactNode,
|
||||
} from 'react';
|
||||
import { forwardRef } from 'react';
|
||||
|
||||
import { MenuIcon } from './menu-icon';
|
||||
import * as styles from './styles.css';
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { InformationIcon } from '@blocksuite/icons';
|
||||
import type { Meta, StoryFn } from '@storybook/react';
|
||||
import { type ReactNode, useCallback, useState } from 'react';
|
||||
import type { ReactNode } from 'react';
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
import { Button } from '../button';
|
||||
import { Tooltip } from '../tooltip';
|
||||
import type { MenuItemProps, MenuProps } from './index';
|
||||
import {
|
||||
Menu,
|
||||
MenuIcon,
|
||||
MenuItem,
|
||||
type MenuItemProps,
|
||||
type MenuProps,
|
||||
MenuSeparator,
|
||||
MenuSub,
|
||||
MenuTrigger,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { DoneIcon } from '@blocksuite/icons';
|
||||
import clsx from 'clsx';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import { type MenuItemProps } from './menu.types';
|
||||
import type { MenuItemProps } from './menu.types';
|
||||
import { MenuIcon } from './menu-icon';
|
||||
import * as styles from './styles.css';
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@ import clsx from 'clsx';
|
||||
|
||||
import type { ButtonProps } from '../button';
|
||||
import { Button } from '../button';
|
||||
import { Modal, type ModalProps } from './modal';
|
||||
import type { ModalProps } from './modal';
|
||||
import { Modal } from './modal';
|
||||
import * as styles from './styles.css';
|
||||
|
||||
export interface ConfirmModalProps extends ModalProps {
|
||||
|
||||
@@ -2,10 +2,14 @@ import type { Meta, StoryFn } from '@storybook/react';
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
import { Button } from '../button';
|
||||
import { Input, type InputProps } from '../input';
|
||||
import { ConfirmModal, type ConfirmModalProps } from './confirm-modal';
|
||||
import { Modal, type ModalProps } from './modal';
|
||||
import { OverlayModal, type OverlayModalProps } from './overlay-modal';
|
||||
import type { InputProps } from '../input';
|
||||
import { Input } from '../input';
|
||||
import type { ConfirmModalProps } from './confirm-modal';
|
||||
import { ConfirmModal } from './confirm-modal';
|
||||
import type { ModalProps } from './modal';
|
||||
import { Modal } from './modal';
|
||||
import type { OverlayModalProps } from './overlay-modal';
|
||||
import { OverlayModal } from './overlay-modal';
|
||||
|
||||
export default {
|
||||
title: 'UI/Modal',
|
||||
|
||||
@@ -8,9 +8,11 @@ import type {
|
||||
import * as Dialog from '@radix-ui/react-dialog';
|
||||
import { assignInlineVars } from '@vanilla-extract/dynamic';
|
||||
import clsx from 'clsx';
|
||||
import { type CSSProperties, forwardRef } from 'react';
|
||||
import type { CSSProperties } from 'react';
|
||||
import { forwardRef } from 'react';
|
||||
|
||||
import { IconButton, type IconButtonProps } from '../button';
|
||||
import type { IconButtonProps } from '../button';
|
||||
import { IconButton } from '../button';
|
||||
import * as styles from './styles.css';
|
||||
|
||||
export interface ModalProps extends DialogProps {
|
||||
|
||||
@@ -3,8 +3,10 @@ import { cssVar } from '@toeverything/theme';
|
||||
import { memo, useCallback } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
import { Button, type ButtonProps } from '../button';
|
||||
import { Modal, type ModalProps } from './modal';
|
||||
import type { ButtonProps } from '../button';
|
||||
import { Button } from '../button';
|
||||
import type { ModalProps } from './modal';
|
||||
import { Modal } from './modal';
|
||||
import * as styles from './overlay-modal.css';
|
||||
|
||||
const defaultContentOptions: ModalProps['contentOptions'] = {
|
||||
|
||||
@@ -5,7 +5,8 @@ import type {
|
||||
} from '@radix-ui/react-popover';
|
||||
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
||||
import clsx from 'clsx';
|
||||
import { type ReactNode, useMemo } from 'react';
|
||||
import type { ReactNode } from 'react';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import * as styles from './styles.css';
|
||||
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
import clsx from 'clsx';
|
||||
import {
|
||||
type HTMLAttributes,
|
||||
type PropsWithChildren,
|
||||
useEffect,
|
||||
useRef,
|
||||
} from 'react';
|
||||
import type { HTMLAttributes, PropsWithChildren } from 'react';
|
||||
import { useEffect, useRef } from 'react';
|
||||
|
||||
import * as styles from './styles.css';
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import * as ScrollArea from '@radix-ui/react-scroll-area';
|
||||
import clsx from 'clsx';
|
||||
import { forwardRef, type RefAttributes } from 'react';
|
||||
import type { RefAttributes } from 'react';
|
||||
import { forwardRef } from 'react';
|
||||
|
||||
import * as styles from './index.css';
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { Meta, StoryFn } from '@storybook/react';
|
||||
|
||||
import { ScrollableContainer, type ScrollableContainerProps } from './index';
|
||||
import type { ScrollableContainerProps } from './index';
|
||||
import { ScrollableContainer } from './index';
|
||||
|
||||
export default {
|
||||
title: 'UI/Scrollbar',
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import * as ScrollArea from '@radix-ui/react-scroll-area';
|
||||
import clsx from 'clsx';
|
||||
import { type PropsWithChildren, useRef } from 'react';
|
||||
import type { PropsWithChildren } from 'react';
|
||||
import { useRef } from 'react';
|
||||
|
||||
import * as styles from './index.css';
|
||||
import { useHasScrollTop } from './use-has-scroll-top';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { type RefObject, useEffect, useState } from 'react';
|
||||
import type { RefObject } from 'react';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
export function useHasScrollTop(ref: RefObject<HTMLElement> | null) {
|
||||
const [hasScrollTop, setHasScrollTop] = useState(false);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { Meta, StoryFn } from '@storybook/react';
|
||||
|
||||
import { Skeleton, type SkeletonProps } from './index';
|
||||
import type { SkeletonProps } from './index';
|
||||
import { Skeleton } from './index';
|
||||
|
||||
export default {
|
||||
title: 'UI/Skeleton',
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { Meta, StoryFn } from '@storybook/react';
|
||||
|
||||
import { Switch, type SwitchProps } from './index';
|
||||
import type { SwitchProps } from './index';
|
||||
import { Switch } from './index';
|
||||
|
||||
export default {
|
||||
title: 'UI/Switch',
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
// components/switch.tsx
|
||||
import clsx from 'clsx';
|
||||
import {
|
||||
type HTMLAttributes,
|
||||
type ReactNode,
|
||||
useCallback,
|
||||
useState,
|
||||
} from 'react';
|
||||
import type { HTMLAttributes, ReactNode } from 'react';
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
import * as styles from './index.css';
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import type { Meta, StoryFn } from '@storybook/react';
|
||||
|
||||
import { Button } from '../button';
|
||||
import Tooltip, { type TooltipProps } from './index';
|
||||
import type { TooltipProps } from './index';
|
||||
import Tooltip from './index';
|
||||
|
||||
export default {
|
||||
title: 'UI/Tooltip',
|
||||
|
||||
Reference in New Issue
Block a user