mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-16 22:46:03 +01:00
chore: optimize imports
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { IconLookup, IconName, IconPrefix } from '@fortawesome/fontawesome-common-types';
|
||||
import { IconName, IconPrefix } from '@fortawesome/fontawesome-common-types';
|
||||
import { CSSProperties } from 'react';
|
||||
|
||||
type IconAnimation = 'spin' | 'spinPulse' | 'spinReverse' | 'pulse' | 'beat' | 'fade' | 'beatFade' | 'bounce' | 'shake';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { ActionIcon, Tooltip, Drawer, Stack, Divider, Button } from '@mantine/core';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { ActionIcon, Button, Divider, Drawer, Stack, Tooltip } from '@mantine/core';
|
||||
import { debugAlert } from './debug/alert';
|
||||
import { debugContext } from './debug/context';
|
||||
import { debugInput } from './debug/input';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Modal, Button, Stack, Group, useMantineTheme, createStyles } from '@mantine/core';
|
||||
import { Button, createStyles, Group, Modal, Stack, useMantineTheme } from '@mantine/core';
|
||||
import { useState } from 'react';
|
||||
import ReactMarkdown from 'react-markdown';
|
||||
import { useNuiEvent } from '../../hooks/useNuiEvent';
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { Group, Modal, Button, Stack } from '@mantine/core';
|
||||
import { Button, Group, Modal, Stack } from '@mantine/core';
|
||||
import React from 'react';
|
||||
import { useNuiEvent } from '../../hooks/useNuiEvent';
|
||||
import { useLocales } from '../../providers/LocaleProvider';
|
||||
import { fetchNui } from '../../utils/fetchNui';
|
||||
import type { InputProps } from '../../typings';
|
||||
import { OptionValue } from '../../typings';
|
||||
import InputField from './components/fields/input';
|
||||
import CheckboxField from './components/fields/checkbox';
|
||||
@@ -14,7 +15,6 @@ import ColorField from './components/fields/color';
|
||||
import DateField from './components/fields/date';
|
||||
import TextareaField from './components/fields/textarea';
|
||||
import TimeField from './components/fields/time';
|
||||
import type { IDateInput, InputProps } from '../../typings';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
export type FormValues = {
|
||||
|
||||
@@ -2,7 +2,6 @@ import { IColorInput } from '../../../../typings/dialog';
|
||||
import { Control, useController } from 'react-hook-form';
|
||||
import { FormValues } from '../../InputDialog';
|
||||
import { ColorInput } from '@mantine/core';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import LibIcon from '../../../../components/LibIcon';
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -2,7 +2,6 @@ import { IDateInput } from '../../../../typings/dialog';
|
||||
import { Control, useController } from 'react-hook-form';
|
||||
import { FormValues } from '../../InputDialog';
|
||||
import { DatePicker, DateRangePicker } from '@mantine/dates';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import LibIcon from '../../../../components/LibIcon';
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { createStyles, PasswordInput, TextInput } from '@mantine/core';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import React from 'react';
|
||||
import { IInput } from '../../../../typings/dialog';
|
||||
import { UseFormRegisterReturn } from 'react-hook-form';
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { NumberInput } from '@mantine/core';
|
||||
import { INumber } from '../../../../typings/dialog';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { Control, useController } from 'react-hook-form';
|
||||
import { FormValues } from '../../InputDialog';
|
||||
import LibIcon from '../../../../components/LibIcon';
|
||||
|
||||
@@ -2,7 +2,6 @@ import { MultiSelect, Select } from '@mantine/core';
|
||||
import { ISelect } from '../../../../typings';
|
||||
import { Control, useController } from 'react-hook-form';
|
||||
import { FormValues } from '../../InputDialog';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import LibIcon from '../../../../components/LibIcon';
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useNuiEvent } from '../../../hooks/useNuiEvent';
|
||||
import { Box, Stack, Text, Flex, createStyles } from '@mantine/core';
|
||||
import { Box, createStyles, Flex, Stack, Text } from '@mantine/core';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { ContextMenuProps } from '../../../typings';
|
||||
import ContextButton from './components/ContextButton';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Button, Box, Group, Stack, Text, Progress, HoverCard, Image, createStyles } from '@mantine/core';
|
||||
import { Button, createStyles, Group, HoverCard, Image, Progress, Stack, Text } from '@mantine/core';
|
||||
import ReactMarkdown from 'react-markdown';
|
||||
import { Option, ContextMenuProps } from '../../../../typings';
|
||||
import { ContextMenuProps, Option } from '../../../../typings';
|
||||
import { fetchNui } from '../../../../utils/fetchNui';
|
||||
import { isIconUrl } from '../../../../utils/isIconUrl';
|
||||
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Button, createStyles } from '@mantine/core';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
||||
import LibIcon from '../../../../components/LibIcon';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Checkbox, createStyles, Stack } from '@mantine/core';
|
||||
import { Checkbox, createStyles } from '@mantine/core';
|
||||
|
||||
const useStyles = createStyles((theme) => ({
|
||||
root: {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Box, Group, Stack, Text, Progress, Image } from '@mantine/core';
|
||||
import { Box, createStyles, Group, Progress, Stack, Text } from '@mantine/core';
|
||||
import React, { forwardRef } from 'react';
|
||||
import CustomCheckbox from './CustomCheckbox';
|
||||
import type { MenuItem } from '../../../typings';
|
||||
import { createStyles } from '@mantine/core';
|
||||
import { isIconUrl } from '../../../utils/isIconUrl';
|
||||
import { IconProp } from '@fortawesome/fontawesome-svg-core';
|
||||
import LibIcon from '../../../components/LibIcon';
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { Box, createStyles, Stack, Tooltip } from '@mantine/core';
|
||||
import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { useNuiEvent } from '../../../hooks/useNuiEvent';
|
||||
import ListItem from './ListItem';
|
||||
import Header from './Header';
|
||||
import FocusTrap from 'focus-trap-react';
|
||||
import { fetchNui } from '../../../utils/fetchNui';
|
||||
import React from 'react';
|
||||
import type { MenuPosition, MenuSettings } from '../../../typings';
|
||||
import LibIcon from '../../../components/LibIcon';
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { Box, createStyles } from '@mantine/core';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useNuiEvent } from '../../../hooks/useNuiEvent';
|
||||
import { fetchNui } from '../../../utils/fetchNui';
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { useNuiEvent } from '../../hooks/useNuiEvent';
|
||||
import { toast, Toaster } from 'react-hot-toast';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import ReactMarkdown from 'react-markdown';
|
||||
import { Avatar, createStyles, Group, Stack, Box, Text, keyframes, Sx } from '@mantine/core';
|
||||
import { Avatar, Box, createStyles, Group, keyframes, Stack, Text } from '@mantine/core';
|
||||
import React from 'react';
|
||||
import type { NotificationProps } from '../../typings';
|
||||
import MarkdownComponents from '../../config/MarkdownComponents';
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import React from 'react';
|
||||
import { RingProgress, Text, useMantineTheme, keyframes, Stack, createStyles } from '@mantine/core';
|
||||
import { useNuiEvent } from '../../hooks/useNuiEvent';
|
||||
import { fetchNui } from '../../utils/fetchNui';
|
||||
import {createStyles, keyframes, RingProgress, Stack, Text, useMantineTheme} from '@mantine/core';
|
||||
import {useNuiEvent} from '../../hooks/useNuiEvent';
|
||||
import {fetchNui} from '../../utils/fetchNui';
|
||||
import ScaleFade from '../../transitions/ScaleFade';
|
||||
import type { CircleProgressbarProps } from '../../typings';
|
||||
import type {CircleProgressbarProps} from '../../typings';
|
||||
|
||||
// 33.5 is the r of the circle
|
||||
const progressCircle = keyframes({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Box, Text, createStyles } from '@mantine/core';
|
||||
import { Box, createStyles, Text } from '@mantine/core';
|
||||
import { useNuiEvent } from '../../hooks/useNuiEvent';
|
||||
import { fetchNui } from '../../utils/fetchNui';
|
||||
import ScaleFade from '../../transitions/ScaleFade';
|
||||
|
||||
@@ -3,7 +3,7 @@ import { useNuiEvent } from '../../hooks/useNuiEvent';
|
||||
import Indicator from './indicator';
|
||||
import { fetchNui } from '../../utils/fetchNui';
|
||||
import { Box, createStyles } from '@mantine/core';
|
||||
import type { SkillCheckProps, GameDifficulty } from '../../typings';
|
||||
import type { GameDifficulty, SkillCheckProps } from '../../typings';
|
||||
|
||||
export const circleCircumference = 2 * 50 * Math.PI;
|
||||
|
||||
|
||||
@@ -2,10 +2,9 @@ import React from 'react';
|
||||
import { useNuiEvent } from '../../hooks/useNuiEvent';
|
||||
import { Box, createStyles, Group } from '@mantine/core';
|
||||
import ReactMarkdown from 'react-markdown';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import ScaleFade from '../../transitions/ScaleFade';
|
||||
import remarkGfm from 'remark-gfm';
|
||||
import type { TextUiProps, TextUiPosition } from '../../typings';
|
||||
import type { TextUiPosition, TextUiProps } from '../../typings';
|
||||
import MarkdownComponents from '../../config/MarkdownComponents';
|
||||
import LibIcon from '../../components/LibIcon';
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { defineConfig } from "vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
|
||||
const path = require("path");
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
|
||||
Reference in New Issue
Block a user