Skip to content

Commit

Permalink
refactor(components): update imports to use centralized types from ..…
Browse files Browse the repository at this point in the history
…/../types
  • Loading branch information
SutuSebastian committed Jan 21, 2025
1 parent 065672d commit 58f1730
Show file tree
Hide file tree
Showing 60 changed files with 344 additions and 244 deletions.
2 changes: 1 addition & 1 deletion packages/ui/src/components/Accordion/Accordion.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import userEvent from "@testing-library/user-event";
import { HiOutlineArrowCircleDown } from "react-icons/hi";
import { beforeEach, describe, expect, it } from "vitest";
import { ThemeProvider } from "../../theme/provider";
import type { CustomFlowbiteTheme } from "../Flowbite/FlowbiteTheme";
import type { CustomFlowbiteTheme } from "../../types";
import type { AccordionProps } from "./Accordion";
import { Accordion } from "./Accordion";
import { AccordionContent } from "./AccordionContent";
Expand Down
3 changes: 1 addition & 2 deletions packages/ui/src/components/Accordion/Accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import { useResolveTheme } from "../../helpers/resolve-theme";
import { twMerge } from "../../helpers/tailwind-merge";
import { ChevronDownIcon } from "../../icons";
import { useThemeProvider } from "../../theme/provider";
import type { ThemingProps } from "../../types";
import type { FlowbiteBoolean } from "../Flowbite/FlowbiteTheme";
import type { FlowbiteBoolean, ThemingProps } from "../../types";
import type { AccordionComponentTheme } from "./AccordionContent";
import type { AccordionPanelProps } from "./AccordionPanel";
import type { AccordionTitleTheme } from "./AccordionTitle";
Expand Down
3 changes: 1 addition & 2 deletions packages/ui/src/components/Accordion/AccordionTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { get } from "../../helpers/get";
import { useResolveTheme } from "../../helpers/resolve-theme";
import { twMerge } from "../../helpers/tailwind-merge";
import { useThemeProvider } from "../../theme/provider";
import type { ThemingProps } from "../../types";
import type { FlowbiteBoolean, FlowbiteHeadingLevel } from "../Flowbite/FlowbiteTheme";
import type { FlowbiteBoolean, FlowbiteHeadingLevel, ThemingProps } from "../../types";
import { useAccordionContext } from "./AccordionPanelContext";
import { accordionTheme } from "./theme";

Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/Alert/Alert.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useState } from "react";
import { HiEye, HiHeart, HiInformationCircle } from "react-icons/hi";
import { describe, expect, it, vi } from "vitest";
import { ThemeProvider } from "../../theme/provider";
import type { CustomFlowbiteTheme } from "../Flowbite/FlowbiteTheme";
import type { CustomFlowbiteTheme } from "../../types";
import type { AlertProps } from "./Alert";
import { Alert } from "./Alert";

Expand Down
3 changes: 1 addition & 2 deletions packages/ui/src/components/Alert/Alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { useResolveTheme } from "../../helpers/resolve-theme";
import { twMerge } from "../../helpers/tailwind-merge";
import { XIcon } from "../../icons";
import { useThemeProvider } from "../../theme/provider";
import type { DynamicStringEnumKeysOf, ThemingProps } from "../../types";
import type { FlowbiteColors } from "../Flowbite/FlowbiteTheme";
import type { DynamicStringEnumKeysOf, FlowbiteColors, ThemingProps } from "../../types";
import { alertTheme } from "./theme";

export interface AlertTheme {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/Avatar/Avatar.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { render, screen } from "@testing-library/react";
import { describe, expect, it } from "vitest";
import { ThemeProvider } from "../../theme/provider";
import type { CustomFlowbiteTheme } from "../Flowbite/FlowbiteTheme";
import type { CustomFlowbiteTheme } from "../../types";
import { Avatar } from "./Avatar";

describe("Components / Avatar", () => {
Expand Down
10 changes: 8 additions & 2 deletions packages/ui/src/components/Avatar/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ import { get } from "../../helpers/get";
import { useResolveTheme } from "../../helpers/resolve-theme";
import { twMerge } from "../../helpers/tailwind-merge";
import { useThemeProvider } from "../../theme/provider";
import type { DynamicStringEnumKeysOf, ThemingProps } from "../../types";
import type { FlowbiteBoolean, FlowbiteColors, FlowbitePositions, FlowbiteSizes } from "../Flowbite/FlowbiteTheme";
import type {
DynamicStringEnumKeysOf,
FlowbiteBoolean,
FlowbiteColors,
FlowbitePositions,
FlowbiteSizes,
ThemingProps,
} from "../../types";
import type { AvatarGroupTheme } from "./AvatarGroup";
import type { AvatarGroupCounterTheme } from "./AvatarGroupCounter";
import { avatarTheme } from "./theme";
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/Badge/Badge.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { render, screen } from "@testing-library/react";
import { HiCheck } from "react-icons/hi";
import { describe, expect, it } from "vitest";
import { ThemeProvider } from "../../theme/provider";
import type { CustomFlowbiteTheme } from "../Flowbite/FlowbiteTheme";
import type { CustomFlowbiteTheme } from "../../types";
import { Badge } from "./Badge";

describe("Components / Badge", () => {
Expand Down
9 changes: 7 additions & 2 deletions packages/ui/src/components/Badge/Badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ import { get } from "../../helpers/get";
import { useResolveTheme } from "../../helpers/resolve-theme";
import { twMerge } from "../../helpers/tailwind-merge";
import { useThemeProvider } from "../../theme/provider";
import type { DynamicStringEnumKeysOf, ThemingProps } from "../../types";
import type { FlowbiteBoolean, FlowbiteColors, FlowbiteSizes } from "../Flowbite/FlowbiteTheme";
import type {
DynamicStringEnumKeysOf,
FlowbiteBoolean,
FlowbiteColors,
FlowbiteSizes,
ThemingProps,
} from "../../types";
import { badgeTheme } from "./theme";

export interface BadgeTheme {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/Blockquote/Blockquote.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { render, screen } from "@testing-library/react";
import { describe, expect, it } from "vitest";
import { ThemeProvider } from "../../theme/provider";
import type { CustomFlowbiteTheme } from "../Flowbite/FlowbiteTheme";
import type { CustomFlowbiteTheme } from "../../types";
import { Blockquote } from "./Blockquote";

describe("Components / Blockquote", () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/Breadcrumb/Breadcrumb.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { render, screen } from "@testing-library/react";
import { HiHome } from "react-icons/hi";
import { describe, expect, it } from "vitest";
import { ThemeProvider } from "../../theme/provider";
import type { CustomFlowbiteTheme } from "../Flowbite/FlowbiteTheme";
import type { CustomFlowbiteTheme } from "../../types";
import { Breadcrumb } from "./Breadcrumb";
import { BreadcrumbItem } from "./BreadcrumbItem";

Expand Down
3 changes: 1 addition & 2 deletions packages/ui/src/components/Breadcrumb/BreadcrumbItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import { useResolveTheme } from "../../helpers/resolve-theme";
import { twMerge } from "../../helpers/tailwind-merge";
import { ChevronRightIcon } from "../../icons";
import { useThemeProvider } from "../../theme/provider";
import type { ThemingProps } from "../../types";
import type { FlowbiteBoolean } from "../Flowbite/FlowbiteTheme";
import type { FlowbiteBoolean, ThemingProps } from "../../types";
import { breadcrumbTheme } from "./theme";

export interface BreadcrumbItemTheme {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/Button/Button.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import userEvent from "@testing-library/user-event";
import type { PropsWithChildren } from "react";
import { describe, expect, it, vi } from "vitest";
import { ThemeProvider } from "../../theme/provider";
import type { CustomFlowbiteTheme } from "../Flowbite/FlowbiteTheme";
import type { CustomFlowbiteTheme } from "../../types";
import { Button } from "./Button";

describe("Components / Button", () => {
Expand Down
9 changes: 7 additions & 2 deletions packages/ui/src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ import { get } from "../../helpers/get";
import { useResolveTheme } from "../../helpers/resolve-theme";
import { twMerge } from "../../helpers/tailwind-merge";
import { useThemeProvider } from "../../theme/provider";
import type { DynamicStringEnumKeysOf, ThemingProps } from "../../types";
import type { FlowbiteColors, FlowbiteSizes, FlowbiteStateColors } from "../Flowbite/FlowbiteTheme";
import type {
DynamicStringEnumKeysOf,
FlowbiteColors,
FlowbiteSizes,
FlowbiteStateColors,
ThemingProps,
} from "../../types";
import { ButtonBase } from "./ButtonBase";
import { useButtonGroupContext } from "./ButtonGroupContext";
import { buttonTheme } from "./theme";
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/Button/ButtonGroup.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { render, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { describe, expect, it, vi } from "vitest";
import { ThemeProvider } from "../../theme";
import type { CustomFlowbiteTheme } from "../Flowbite/FlowbiteTheme";
import type { CustomFlowbiteTheme } from "../../types";
import { Button } from "./Button";
import { ButtonGroup } from "./ButtonGroup";
import { buttonTheme } from "./theme";
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/Card/Card.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { render, screen } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest";
import { ThemeProvider } from "../../theme/provider";
import type { CustomFlowbiteTheme } from "../Flowbite/FlowbiteTheme";
import type { CustomFlowbiteTheme } from "../../types";
import { Card } from "./Card";

describe("Components / Card", () => {
Expand Down
3 changes: 1 addition & 2 deletions packages/ui/src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { omit } from "../../helpers/omit";
import { useResolveTheme } from "../../helpers/resolve-theme";
import { twMerge } from "../../helpers/tailwind-merge";
import { useThemeProvider } from "../../theme/provider";
import type { DeepPartial, ThemingProps } from "../../types";
import type { FlowbiteBoolean } from "../Flowbite/FlowbiteTheme";
import type { DeepPartial, FlowbiteBoolean, ThemingProps } from "../../types";
import { cardTheme } from "./theme";

export interface CardTheme {
Expand Down
3 changes: 1 addition & 2 deletions packages/ui/src/components/Carousel/Carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import { useResolveTheme } from "../../helpers/resolve-theme";
import { twMerge } from "../../helpers/tailwind-merge";
import { ChevronLeftIcon, ChevronRightIcon } from "../../icons";
import { useThemeProvider } from "../../theme/provider";
import type { ThemingProps } from "../../types";
import type { FlowbiteBoolean } from "../Flowbite/FlowbiteTheme";
import type { FlowbiteBoolean, ThemingProps } from "../../types";
import { carouselTheme } from "./theme";

export interface CarouselTheme {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/Checkbox/Checkbox.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { render, screen } from "@testing-library/react";
import { describe, expect, it } from "vitest";
import { ThemeProvider } from "../../theme/provider";
import type { CustomFlowbiteTheme } from "../Flowbite/FlowbiteTheme";
import type { CustomFlowbiteTheme } from "../../types";
import { Checkbox } from "./Checkbox";

describe("Components / Checkbox", () => {
Expand Down
3 changes: 1 addition & 2 deletions packages/ui/src/components/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { get } from "../../helpers/get";
import { useResolveTheme } from "../../helpers/resolve-theme";
import { twMerge } from "../../helpers/tailwind-merge";
import { useThemeProvider } from "../../theme/provider";
import type { DynamicStringEnumKeysOf, ThemingProps } from "../../types";
import type { FlowbiteColors } from "../Flowbite/FlowbiteTheme";
import type { DynamicStringEnumKeysOf, FlowbiteColors, ThemingProps } from "../../types";
import { checkboxTheme } from "./theme";

export interface CheckboxTheme {
Expand Down
3 changes: 1 addition & 2 deletions packages/ui/src/components/Drawer/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { get } from "../../helpers/get";
import { useResolveTheme } from "../../helpers/resolve-theme";
import { twMerge } from "../../helpers/tailwind-merge";
import { useThemeProvider } from "../../theme/provider";
import type { ThemingProps } from "../../types";
import type { FlowbiteBoolean } from "../Flowbite/FlowbiteTheme";
import type { FlowbiteBoolean, ThemingProps } from "../../types";
import { DrawerContext } from "./DrawerContext";
import type { DrawerHeaderTheme } from "./DrawerHeader";
import type { DrawerItemsTheme } from "./DrawerItems";
Expand Down
3 changes: 1 addition & 2 deletions packages/ui/src/components/Drawer/DrawerHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { get } from "../../helpers/get";
import { useResolveTheme } from "../../helpers/resolve-theme";
import { CloseIcon as DefaultCloseIcon, HomeIcon } from "../../icons";
import { useThemeProvider } from "../../theme/provider";
import type { ThemingProps } from "../../types";
import type { FlowbiteBoolean } from "../Flowbite/FlowbiteTheme";
import type { FlowbiteBoolean, ThemingProps } from "../../types";
import { useDrawerContext } from "./DrawerContext";
import { drawerTheme } from "./theme";

Expand Down
153 changes: 0 additions & 153 deletions packages/ui/src/components/Flowbite/FlowbiteTheme.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/ui/src/components/Footer/Footer.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { cleanup, render, screen } from "@testing-library/react";
import { BsDribbble, BsFacebook, BsGithub, BsInstagram, BsTwitter } from "react-icons/bs";
import { describe, expect, it } from "vitest";
import { ThemeProvider } from "../../theme/provider";
import type { CustomFlowbiteTheme } from "../Flowbite/FlowbiteTheme";
import type { CustomFlowbiteTheme } from "../../types";
import { Footer } from "./Footer";
import { FooterBrand } from "./FooterBrand";
import { FooterCopyright } from "./FooterCopyright";
Expand Down
Loading

0 comments on commit 58f1730

Please sign in to comment.