mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-20 11:36:25 +08:00
chore: sort imports
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { ReactNode } from 'react';
|
||||
import { useState, Fragment } from 'react';
|
||||
import { has } from '@toeverything/utils';
|
||||
import type { ReactNode } from 'react';
|
||||
import { Fragment, useState } from 'react';
|
||||
|
||||
export type UnPatchNode = () => void;
|
||||
export type PatchNode = (key: string, node: ReactNode) => UnPatchNode;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
/* eslint-disable no-restricted-imports */
|
||||
export { autocompleteClasses } from '@mui/material/Autocomplete';
|
||||
export { useAutocomplete } from '@mui/material';
|
||||
export { autocompleteClasses } from '@mui/material/Autocomplete';
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type {
|
||||
MouseEventHandler,
|
||||
CSSProperties,
|
||||
MouseEventHandler,
|
||||
PropsWithChildren,
|
||||
} from 'react';
|
||||
import { cx } from '../clsx';
|
||||
import { styled } from '../styled';
|
||||
import { buttonStatus } from './constants';
|
||||
import { cx } from '../clsx';
|
||||
|
||||
/* Temporary solution, needs to be adjusted */
|
||||
const SIZE_SMALL = 'small' as const;
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import React from 'react';
|
||||
import clsx from 'clsx';
|
||||
import style9 from 'style9';
|
||||
|
||||
import { BaseButton } from './base-button';
|
||||
import { SvgIconProps } from '../svg-icon';
|
||||
import { BaseButton } from './base-button';
|
||||
|
||||
const styles = style9.create({
|
||||
item: {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export { BaseButton } from './base-button';
|
||||
export { ListButton } from './ListButton';
|
||||
export { IconButton } from './IconButton';
|
||||
export { ListButton } from './ListButton';
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { useRef, useState, ReactElement } from 'react';
|
||||
import { ArrowRightIcon } from '@toeverything/components/icons';
|
||||
import { ReactElement, useRef, useState } from 'react';
|
||||
import { Divider } from '../divider';
|
||||
import {
|
||||
MuiGrow as Grow,
|
||||
MuiPopper as Popper,
|
||||
MuiPopperPlacementType as PopperPlacementType,
|
||||
} from '../mui';
|
||||
import { styled } from '../styled';
|
||||
import { ArrowRightIcon } from '@toeverything/components/icons';
|
||||
import { Divider } from '../divider';
|
||||
|
||||
export interface CascaderItemProps {
|
||||
title: string;
|
||||
@@ -39,7 +39,7 @@ function CascaderItem(props: ItemProps) {
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
if (isDivide) {
|
||||
return <Divider></Divider>;
|
||||
return <Divider />;
|
||||
}
|
||||
|
||||
const on_click_item = () => {
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import * as React from 'react';
|
||||
/* eslint-disable no-restricted-imports */
|
||||
import MuiCheckbox, { type CheckboxProps } from '@mui/material/Checkbox';
|
||||
import {
|
||||
CheckBoxUncheckIcon,
|
||||
CheckBoxCheckIcon,
|
||||
CheckBoxUncheckIcon,
|
||||
} from '@toeverything/components/icons';
|
||||
import { styled } from '../styled';
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import React from 'react';
|
||||
import {
|
||||
Calendar as ReactCalendar,
|
||||
type CalendarProps,
|
||||
|
||||
@@ -2,10 +2,9 @@ import 'react-date-range/dist/styles.css'; // main css file
|
||||
import 'react-date-range/dist/theme/default.css'; // theme css file
|
||||
|
||||
// export { DateRange } from 'react-date-range';
|
||||
export { DateRange } from './DateRange';
|
||||
export { Calendar } from './Calendar';
|
||||
|
||||
export type { DateRangeProps, Range } from './DateRange';
|
||||
export type { CalendarProps } from './Calendar';
|
||||
export { DateRange } from './DateRange';
|
||||
export type { DateRangeProps, Range } from './DateRange';
|
||||
|
||||
// export const NewDateRange = DateRange;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { ReactNode, CSSProperties } from 'react';
|
||||
import { styled } from '../styled';
|
||||
import { MuiDivider } from '../mui';
|
||||
import type { CSSProperties, ReactNode } from 'react';
|
||||
import type { MuiDividerProps } from '../mui';
|
||||
import { MuiDivider } from '../mui';
|
||||
import { styled } from '../styled';
|
||||
|
||||
interface DividerProps {
|
||||
orientation?: 'horizontal' | 'vertical';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useState, useEffect, useRef } from 'react';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
|
||||
type Equal<X, Y, TrueValue, FalseValue> =
|
||||
// prettier-ignore
|
||||
|
||||
@@ -1,52 +1,47 @@
|
||||
// Base abstract feature for all UI components
|
||||
export { Theme, useTheme, withTheme, ThemeProvider } from './theme';
|
||||
export { styled, keyframes } from './styled';
|
||||
export type { SxProps } from './styled';
|
||||
|
||||
export * from './mui';
|
||||
export * from './svg-icon';
|
||||
|
||||
export { StaticDatePicker } from '@mui/x-date-pickers/StaticDatePicker';
|
||||
export { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
|
||||
export { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
||||
export {
|
||||
PickersDay,
|
||||
type PickersDayProps,
|
||||
} from '@mui/x-date-pickers/PickersDay';
|
||||
|
||||
export { StaticDatePicker } from '@mui/x-date-pickers/StaticDatePicker';
|
||||
export { autocompleteClasses, useAutocomplete } from './autocomplete';
|
||||
// Components
|
||||
export { BaseButton, ListButton, IconButton } from './button';
|
||||
export { BaseButton, IconButton, ListButton } from './button';
|
||||
export * from './cascader';
|
||||
export { Checkbox } from './checkbox';
|
||||
export type { CheckboxProps } from './checkbox';
|
||||
export { Clickable } from './clickable';
|
||||
export * from './clsx';
|
||||
export { Calendar, DateRange } from './date';
|
||||
export type { CalendarProps, DateRangeProps, Range } from './date';
|
||||
export { Divider } from './divider';
|
||||
export { Input } from './input';
|
||||
export type { InputProps } from './input';
|
||||
export { ListIcon, ListItem } from './list';
|
||||
export { message } from './message';
|
||||
export { TransitionsModal } from './model';
|
||||
export * from './mui';
|
||||
export { usePatchNodes } from './PatchElements';
|
||||
export type { PatchNode, UnPatchNode } from './PatchElements';
|
||||
export { Popover, PopoverContainer } from './popover';
|
||||
export type { PopoverProps } from './popover';
|
||||
export { Popper } from './popper';
|
||||
export type { PopperProps, PopperHandler } from './popper';
|
||||
|
||||
export { OldSelect, Select, Option } from './select';
|
||||
export { message } from './message';
|
||||
export { Input } from './input';
|
||||
export type { InputProps } from './input';
|
||||
export { Tooltip } from './tooltip';
|
||||
export { usePatchNodes } from './PatchElements';
|
||||
export type { PatchNode, UnPatchNode } from './PatchElements';
|
||||
export { Tag } from './tag';
|
||||
export type { TagProps } from './tag';
|
||||
export { Divider } from './divider';
|
||||
export { autocompleteClasses, useAutocomplete } from './autocomplete';
|
||||
export { Slider } from './slider';
|
||||
export { Typography } from './typography';
|
||||
export { ListItem, ListIcon } from './list';
|
||||
export { Clickable } from './clickable';
|
||||
export { DateRange, Calendar } from './date';
|
||||
export type { DateRangeProps, Range, CalendarProps } from './date';
|
||||
export type { PopperHandler, PopperProps } from './popper';
|
||||
export { Radio } from './radio';
|
||||
export type { RadioProps } from './radio';
|
||||
export { Checkbox } from './checkbox';
|
||||
export type { CheckboxProps } from './checkbox';
|
||||
export * from './cascader';
|
||||
export { Switch } from './switch';
|
||||
export type { SwitchProps } from './switch';
|
||||
export { OldSelect, Option, Select } from './select';
|
||||
export { Slider } from './slider';
|
||||
export { keyframes, styled } from './styled';
|
||||
export type { SxProps } from './styled';
|
||||
export * from './svg-icon';
|
||||
/* types */
|
||||
export type { SvgIconProps } from './svg-icon';
|
||||
|
||||
export * from './clsx';
|
||||
export { Switch } from './switch';
|
||||
export type { SwitchProps } from './switch';
|
||||
export { Tag } from './tag';
|
||||
export type { TagProps } from './tag';
|
||||
export { Theme, ThemeProvider, useTheme, withTheme } from './theme';
|
||||
export { Tooltip } from './tooltip';
|
||||
export { Typography } from './typography';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import React, {
|
||||
forwardRef,
|
||||
type CSSProperties,
|
||||
type ForwardedRef,
|
||||
type InputHTMLAttributes,
|
||||
type CSSProperties,
|
||||
} from 'react';
|
||||
import { styled } from '../styled';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { PropsWithChildren, CSSProperties } from 'react';
|
||||
import type { CSSProperties, PropsWithChildren } from 'react';
|
||||
import { Clickable } from '../clickable';
|
||||
import { styled } from '../styled';
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export { ListItem } from './ListItem';
|
||||
export { ListIcon } from './ListIcon';
|
||||
export { ListItem } from './ListItem';
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import {
|
||||
NotificationInstance,
|
||||
type NotificationContent,
|
||||
type NotificationController,
|
||||
type NotificationInstanceProps,
|
||||
type NotificationContent,
|
||||
type NotificationOption,
|
||||
type NotificationKey,
|
||||
type NotificationOption,
|
||||
} from '../notification';
|
||||
import {
|
||||
SuccessMessage,
|
||||
ErrorMessage,
|
||||
InfoMessage,
|
||||
SuccessMessage,
|
||||
WarningMessage,
|
||||
} from './MessageContent';
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { useState } from 'react';
|
||||
|
||||
import { styled } from '@mui/system';
|
||||
import ModalUnstyled from '@mui/base/ModalUnstyled';
|
||||
import { styled } from '@mui/system';
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import Fade from '@mui/material/Fade';
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import {
|
||||
Collapse,
|
||||
Container,
|
||||
Divider,
|
||||
Fade,
|
||||
FormControlLabel,
|
||||
Grid,
|
||||
Grow,
|
||||
@@ -52,7 +53,6 @@ import {
|
||||
tooltipClasses,
|
||||
Typography,
|
||||
Zoom,
|
||||
Fade,
|
||||
} from '@mui/material';
|
||||
|
||||
export { alpha } from '@mui/system';
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import React, { forwardRef, useImperativeHandle } from 'react';
|
||||
import { forwardRef, useImperativeHandle } from 'react';
|
||||
|
||||
import {
|
||||
SnackbarProvider,
|
||||
useSnackbar,
|
||||
type SnackbarProviderProps,
|
||||
type OptionsObject,
|
||||
type SnackbarMessage,
|
||||
type SnackbarKey,
|
||||
type SnackbarMessage,
|
||||
type SnackbarProviderProps,
|
||||
} from 'notistack';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { type PropsWithChildren } from 'react';
|
||||
import type { MuiPopperPlacementType as PopperPlacementType } from '../mui';
|
||||
import React, { type PropsWithChildren } from 'react';
|
||||
import { Popper } from '../popper';
|
||||
import { PopoverContainer } from './Container';
|
||||
import type { PopoverProps, PopoverDirection } from './interface';
|
||||
import type { PopoverDirection, PopoverProps } from './interface';
|
||||
|
||||
export const placementToContainerDirection: Record<
|
||||
PopperPlacementType,
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export * from './Popover';
|
||||
export * from './interface';
|
||||
export { PopoverContainer } from './Container';
|
||||
export * from './interface';
|
||||
export * from './Popover';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ReactNode, CSSProperties } from 'react';
|
||||
import type { CSSProperties, ReactNode } from 'react';
|
||||
import { PopperProps } from '../popper';
|
||||
|
||||
export type PopoverDirection =
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { forwardRef } from 'react';
|
||||
import { PopperArrowProps } from './interface';
|
||||
import { forwardRef } from 'react';
|
||||
import { styled } from '../styled';
|
||||
import { PopperArrowProps } from './interface';
|
||||
|
||||
export const PopperArrow = forwardRef<HTMLElement, PopperArrowProps>(
|
||||
({ placement }, ref) => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, {
|
||||
import {
|
||||
useEffect,
|
||||
useImperativeHandle,
|
||||
useMemo,
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export * from './Popper';
|
||||
export * from './interface';
|
||||
export * from './Popper';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { CSSProperties, ReactNode, Ref } from 'react';
|
||||
/* eslint-disable no-restricted-imports */
|
||||
import {
|
||||
type PopperUnstyledProps,
|
||||
type PopperPlacementType,
|
||||
type PopperUnstyledProps,
|
||||
} from '@mui/base/PopperUnstyled';
|
||||
export type VirtualElement = {
|
||||
getBoundingClientRect: () => ClientRect | DOMRect;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import * as React from 'react';
|
||||
/* eslint-disable no-restricted-imports */
|
||||
import MuiRadio, { type RadioProps } from '@mui/material/Radio';
|
||||
import { styled } from '../styled';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ChangeEvent, CSSProperties } from 'react';
|
||||
import { useCallback } from 'react';
|
||||
import { styled } from '../styled';
|
||||
import type { CSSProperties, ChangeEvent } from 'react';
|
||||
|
||||
/**
|
||||
* WARNING: This component is about to be deprecated, use Select replace
|
||||
|
||||
@@ -2,13 +2,13 @@ import {
|
||||
forwardRef,
|
||||
type CSSProperties,
|
||||
type ForwardedRef,
|
||||
type RefAttributes,
|
||||
type ReactNode,
|
||||
type RefAttributes,
|
||||
} from 'react';
|
||||
/* eslint-disable no-restricted-imports */
|
||||
import SelectUnstyled, {
|
||||
type SelectUnstyledProps,
|
||||
selectUnstyledClasses,
|
||||
type SelectUnstyledProps,
|
||||
} from '@mui/base/SelectUnstyled';
|
||||
/* eslint-disable no-restricted-imports */
|
||||
import PopperUnstyled from '@mui/base/PopperUnstyled';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export { Select } from './Select';
|
||||
export { OldSelect } from './OldSelect';
|
||||
export { Option } from './Option';
|
||||
export { OptionGroup } from './OptionGroup';
|
||||
export { OldSelect } from './OldSelect';
|
||||
export { Select } from './Select';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { SliderUnstyled, sliderUnstyledClasses } from '@mui/base';
|
||||
import type { SliderUnstyledProps } from '@mui/base';
|
||||
import { SliderUnstyled, sliderUnstyledClasses } from '@mui/base';
|
||||
import { alpha } from '@mui/system';
|
||||
import { styled } from '../styled';
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import { styled as muiStyled, keyframes } from '@mui/material/styles';
|
||||
import { ReactHTML, ReactSVG } from 'react';
|
||||
import isPropValid from '@emotion/is-prop-valid';
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import { keyframes, styled as muiStyled } from '@mui/material/styles';
|
||||
import { ReactHTML, ReactSVG } from 'react';
|
||||
export type { SxProps } from '@mui/system';
|
||||
export { keyframes };
|
||||
|
||||
// Props that will be passed to DOM
|
||||
const ALLOW_LIST_PROPS: string[] = [];
|
||||
@@ -71,5 +72,3 @@ export const styled: typeof muiStyled = (
|
||||
options.shouldForwardProp = isValidProp;
|
||||
return muiStyled(component, options);
|
||||
};
|
||||
|
||||
export { keyframes };
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { CSSProperties } from 'react';
|
||||
import { styled } from '../styled';
|
||||
import { useSwitch, UseSwitchParameters } from '@mui/base/SwitchUnstyled';
|
||||
import type { CSSProperties } from 'react';
|
||||
import { ReactNode } from 'react';
|
||||
import { styled } from '../styled';
|
||||
|
||||
/**
|
||||
* Switch is extend by mui SwitchUnstyled
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
import type {
|
||||
ChangeEventHandler,
|
||||
PropsWithChildren,
|
||||
CSSProperties,
|
||||
ReactNode,
|
||||
} from 'react';
|
||||
import type { CSSProperties, PropsWithChildren, ReactNode } from 'react';
|
||||
|
||||
import { MouseEventHandler } from 'react';
|
||||
import CloseIcon from '@mui/icons-material/Close';
|
||||
import { MouseEventHandler } from 'react';
|
||||
import { StyledTag } from './style';
|
||||
|
||||
export interface TagProps {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import ColorObject from './color';
|
||||
// import { ThemeOptions } from '@mui/material/styles';
|
||||
/**
|
||||
* @deprecated Please use the new {@link ThemeOptions} type.
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import type { PropsWithChildren, ReactNode } from 'react';
|
||||
import type { ReactNode } from 'react';
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import {
|
||||
createTheme,
|
||||
Theme as MuiTheme,
|
||||
ThemeProvider as MuiThemeProvider,
|
||||
useTheme as muiUseTheme,
|
||||
Theme as MuiTheme,
|
||||
} from '@mui/material/styles';
|
||||
import type { ThemeOptions as AffineThemeOptions } from './theme';
|
||||
import { Theme } from './theme';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { type PropsWithChildren, type CSSProperties } from 'react';
|
||||
import { type PopperProps, Popper } from '../popper';
|
||||
import { PopoverContainer, placementToContainerDirection } from '../popover';
|
||||
import type { TooltipProps } from './interface';
|
||||
import { type CSSProperties, type PropsWithChildren } from 'react';
|
||||
import { placementToContainerDirection, PopoverContainer } from '../popover';
|
||||
import { Popper, type PopperProps } from '../popper';
|
||||
import { useTheme } from '../theme';
|
||||
import type { TooltipProps } from './interface';
|
||||
|
||||
const useTooltipStyle = (): CSSProperties => {
|
||||
const theme = useTheme();
|
||||
|
||||
Reference in New Issue
Block a user