Skip to content

Commit

Permalink
refactor: split types into files (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
spleafy committed May 15, 2024
1 parent 135af7f commit de75e96
Show file tree
Hide file tree
Showing 101 changed files with 302 additions and 302 deletions.
3 changes: 2 additions & 1 deletion .storybook/storybook.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ export default defineConfig({
"@components": resolve(__dirname, "../src/components"),
"@hooks": resolve(__dirname, "../src/hooks"),
"@themes": resolve(__dirname, "../src/themes"),
"@validators": resolve(__dirname, "../src/validators"),
"@validators": resolve(__dirname, "./src/validators"),
"@types": resolve(__dirname, "../src/types"),
},
},
});
2 changes: 1 addition & 1 deletion src/components/Accordion/Accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Flex, { FlexProps } from "@components/Flex";
// Context
import { AccordionContextProvider } from "./AccordionContext";
// Types
import { PrismaneWithInternal, PrismaneProps } from "@/types";
import { PrismaneWithInternal, PrismaneProps } from "@types";
// Utils
import { strip } from "@/utils";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Transition, { TransitionProps } from "@components/Transition";
import { useAccordionContext } from "../AccordionContext";
import { useAccordionItemContext } from "../AccordionItem/AccordionItemContext";
// Types
import { PrismaneProps } from "@/types";
import { PrismaneProps } from "@types";
// Utils
import { strip, fr } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Accordion/AccordionIcon/AccordionIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Transition from "@components/Transition";
import { useAccordionContext } from "../AccordionContext";
import { useAccordionItemContext } from "../AccordionItem/AccordionItemContext";
// Types
import { PrismaneProps } from "@/types";
import { PrismaneProps } from "@types";
// Utils
import { strip } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Accordion/AccordionItem/AccordionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Flex, { FlexProps } from "@components/Flex";
// Context
import { AccordionItemContextProvider } from "./AccordionItemContext";
// Types
import { PrismaneProps } from "@/types";
import { PrismaneProps } from "@types";
// Utils
import { strip } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Alert/Alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import CloseButton from "@components/CloseButton";
import useAnimation from "@hooks/useAnimation";
import usePresence from "@hooks/usePresence";
// Types
import { PrismaneActions, PrismaneWithInternal, PrismaneProps } from "@/types";
import { PrismaneActions, PrismaneWithInternal, PrismaneProps } from "@types";
// Utils
import { strip, variants, fr } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Animation/Animation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
PrismaneVersatile,
PrismaneVersatileRef,
PrismaneProps,
} from "@/types";
} from "@types";
// Utils
import { strip } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/AspectRatio/AspectRatio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { forwardRef } from "react";
// Components
import Box, { BoxProps } from "@components/Box";
// Types
import { PrismaneStyles, PrismaneProps } from "@/types";
import { PrismaneStyles, PrismaneProps } from "@types";
// Utils
import { strip } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/AutocompleteField/AutocompleteField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import SelectField, { SelectFieldProps } from "@components/SelectField";
// Hooks
import useDebounce from "@hooks/useDebounce";
// Types
import { PrismaneProps } from "@/types";
import { PrismaneProps } from "@types";
// Utils
import { strip } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
PrismaneVersatile,
PrismaneVersatileRef,
PrismaneProps,
} from "@/types";
} from "@types";
// Utils
import { strip, variants, fr } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Badge/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
PrismaneVersatile,
PrismaneVersatileRef,
PrismaneProps,
} from "@/types";
} from "@types";
// Utils
import { strip, variants, fr } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Box/Box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
PrismaneVersatile,
Versatile,
PrismaneVersatileRef,
} from "@/types";
} from "@types";
// Utils
import { strip, dual, fr } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Box/useStyling/useStyling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { usePrismaneTheme } from "@components/PrismaneProvider/PrismaneContext";
// Hooks
import useMemoization from "@hooks/useMemoization";
// Types
import { PrismaneTheme } from "@/types";
import { PrismaneTheme } from "@types";

type StylingProp =
| any
Expand Down
2 changes: 1 addition & 1 deletion src/components/Breadcrumb/Breadcrumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
// Types
import { PrismaneWithInternal } from "@/types";
import { PrismaneWithInternal } from "@types";
// Utils
import { strip, fr } from "@/utils";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { forwardRef } from "react";
import Flex, { FlexProps } from "@components/Flex";
import Link from "@components/Link";
// Types
import { Versatile, PrismaneVersatile, PrismaneVersatileRef } from "@/types";
import { Versatile, PrismaneVersatile, PrismaneVersatileRef } from "@types";
// Utils
import { strip } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
PrismaneVersatile,
PrismaneVersatileRef,
PrismaneProps,
} from "@/types";
} from "@types";
// Utils
import { strip, variants, fr } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
Versatile,
PrismaneVersatile,
PrismaneVersatileRef,
} from "@/types";
} from "@types";
// Utils
import { strip, fr } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Center/Center.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
// Types
import { Versatile, PrismaneVersatile, PrismaneVersatileRef } from "@/types";
import { Versatile, PrismaneVersatile, PrismaneVersatileRef } from "@types";
// Utils
import { strip } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Field, { useFieldProps } from "@components/Field";
import Animation from "@components/Animation";
import Hidden from "@components/Hidden";
// Types
import { PrismaneFieldComponent, PrismaneProps } from "@/types";
import { PrismaneFieldComponent, PrismaneProps } from "@types";
// Utils
import { strip, variants, fr } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Chip/Chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Transition, { TransitionProps } from "@components/Transition";
import Icon from "@components/Icon";
import Text from "@components/Text";
// Types
import { PrismaneColors, PrismaneBreakpoints, PrismaneProps } from "@/types";
import { PrismaneColors, PrismaneBreakpoints, PrismaneProps } from "@types";
// Utils
import { strip, variants, fr } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Circle/Circle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
PrismaneVersatile,
PrismaneVersatileRef,
PrismaneProps,
} from "@/types";
} from "@types";
// Utils
import { strip } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Collapse/Collapse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { forwardRef, useRef } from "react";
import Animation, { AnimationProps } from "@components/Animation";
import Box from "@components/Box";
// Types
import { PrismaneProps } from "@/types";
import { PrismaneProps } from "@types";
// Utils
import { strip } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/ColorField/ColorField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import usePrismaneColor from "@components/PrismaneProvider/usePrismaneColor";
// Globals
import { PRISMANE_DEFAULT_COLORS_MAP } from "@/constants";
// Types
import { PrismaneColors, PrismaneProps } from "@/types";
import { PrismaneColors, PrismaneProps } from "@types";
// Utils
import { strip, fr } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Container/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
// Types
import { PrismaneBreakpoints, PrismaneProps } from "@/types";
import { PrismaneBreakpoints, PrismaneProps } from "@types";
// Utils
import { strip } from "@/utils";

Expand Down
6 changes: 1 addition & 5 deletions src/components/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ import useKeyboardShortcut from "@/hooks/useKeyboardShortcut";
// Context
import { DialogContextProvider } from "./DialogContext";
// Types
import {
PrismaneWithInternal,
PrismanePositions,
PrismaneProps,
} from "@/types";
import { PrismaneWithInternal, PrismanePositions, PrismaneProps } from "@types";
// Utils
import { strip, fr, variants } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Divider/Divider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
// Types
import { PrismaneProps, PrismaneBreakpoints } from "@/types";
import { PrismaneProps, PrismaneBreakpoints } from "@types";
// Utils
import { strip, variants } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Drawer/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
PrismaneWithInternal,
PrismaneBreakpoints,
PrismaneProps,
} from "@/types";
} from "@types";
// Utils
import { strip, variants, dual, fr } from "@/utils";
// Internal Components
Expand Down
2 changes: 1 addition & 1 deletion src/components/Field/Field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
PrismaneVersatile,
PrismaneVersatileRef,
PrismaneProps,
} from "@/types";
} from "@types";
// Hooks
import { usePrismaneColor } from "../PrismaneProvider";
import useFieldProps from "./useFieldProps";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Field/FieldAddon/FieldAddon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { forwardRef } from "react";
import Transition, { TransitionProps } from "@components/Transition";
import Flex, { FlexProps } from "@components/Flex";
// Types
import { PrismaneBreakpoints, PrismaneProps } from "@/types";
import { PrismaneBreakpoints, PrismaneProps } from "@types";
// Utils
import { strip, variants, fr } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Field/FieldError/FieldError.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { forwardRef } from "react";
import Flex, { FlexProps } from "@components/Flex";
import Animation, { AnimationProps } from "@components/Animation";
// Types
import { PrismaneBreakpoints, PrismaneProps } from "@/types";
import { PrismaneBreakpoints, PrismaneProps } from "@types";
// Utils
import { strip, variants, fr } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Field/FieldLabel/FieldLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { forwardRef } from "react";
// Components
import Text, { TextProps } from "@components/Text";
// Types
import { PrismaneBreakpoints, PrismaneProps } from "@/types";
import { PrismaneBreakpoints, PrismaneProps } from "@types";
// Utils
import { strip, variants } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Field/useFieldProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useId } from "../../hooks";
// Utils
import { splitProps } from "../../utils";
// Types
import { PrismaneFieldComponent } from "../../types";
import { PrismaneFieldComponent } from "@types";

const useFieldProps = (props: any): [any, PrismaneFieldComponent] => {
const [rest, field] = splitProps(props, [
Expand Down
2 changes: 1 addition & 1 deletion src/components/Flex/Flex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
PrismaneVersatile,
PrismaneVersatileRef,
PrismaneProps,
} from "@/types";
} from "@types";
// Utils
import { strip, variants } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Gradient/Gradient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
PrismaneProps,
PrismaneColors,
PrismaneShades,
} from "@/types";
} from "@types";
// Utils
import { strip } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Grid/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { forwardRef } from "react";
// Components
import Box, { BoxProps } from "@components/Box";
// Types
import { PrismaneProps, PrismaneWithInternal } from "@/types";
import { PrismaneProps, PrismaneWithInternal } from "@types";
// Utils
import { strip, variants } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Grid/GridItem/GridItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { forwardRef } from "react";
// Components
import Flex, { FlexProps } from "@components/Flex";
// Types
import { PrismaneProps } from "@/types";
import { PrismaneProps } from "@types";
// Utils
import { strip, variants } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Hide/Hide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Box, { BoxProps } from "@components/Box";
// Hooks
import useMediaQuery from "@hooks/useMediaQuery";
// Types
import { PrismaneBreakpoints, PrismaneProps } from "@/types";
import { PrismaneBreakpoints, PrismaneProps } from "@types";
// Utils
import { strip, dual, fr } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Highlight/Highlight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { forwardRef } from "react";
// Components
import Box, { BoxProps } from "@components/Box";
// Types
import { Versatile, PrismaneVersatile, PrismaneVersatileRef } from "@/types";
import { Versatile, PrismaneVersatile, PrismaneVersatileRef } from "@types";
// Utils
import { strip, fr } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { forwardRef } from "react";
// Components
import Square, { SquareProps } from "@components/Square";
// Types
import { PrismaneBreakpoints, PrismaneProps } from "@/types";
import { PrismaneBreakpoints, PrismaneProps } from "@types";
// Utils
import { strip, dual, fr } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Image/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { forwardRef } from "react";
// Components
import Box, { BoxProps } from "@components/Box";
// Types
import { PrismaneProps } from "@/types";
import { PrismaneProps } from "@types";
// Utils
import { strip } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Link/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
PrismaneVersatile,
PrismaneVersatileRef,
PrismaneProps,
} from "@/types";
} from "@types";
// Utils
import { strip, variants, fr } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/List/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
Versatile,
PrismaneVersatile,
PrismaneVersatileRef,
} from "@/types";
} from "@types";
// Utils
import { strip } from "@/utils";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Animation, { AnimationProps } from "@components/Animation";
import usePresence from "@hooks/usePresence";
import useAnimation from "@hooks/useAnimation";
// Types
import { PrismaneProps, PrismaneWithInternal } from "@/types";
import { PrismaneProps, PrismaneWithInternal } from "@types";
// Utils
import { strip, fr } from "@/utils";

Expand Down
Loading

0 comments on commit de75e96

Please sign in to comment.