@js-empire/emperor-ui 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/.prettierrc +10 -0
  2. package/.storybook/main.ts +33 -0
  3. package/.storybook/preview.ts +19 -0
  4. package/.storybook/vitest.setup.ts +7 -0
  5. package/README.md +1 -0
  6. package/dist/emperor-ui.js +3171 -0
  7. package/dist/emperor-ui.umd.cjs +6 -0
  8. package/dist/src/components/filter/filter.d.ts +3 -0
  9. package/dist/src/components/filter/index.d.ts +1 -0
  10. package/dist/src/components/footer/footer.d.ts +3 -0
  11. package/dist/src/components/footer/index.d.ts +1 -0
  12. package/dist/src/components/header/header.d.ts +9 -0
  13. package/dist/src/components/header/index.d.ts +1 -0
  14. package/dist/src/components/index.d.ts +8 -0
  15. package/dist/src/components/item-card/index.d.ts +1 -0
  16. package/dist/src/components/item-card/item-card.d.ts +3 -0
  17. package/dist/src/components/item-details/index.d.ts +1 -0
  18. package/dist/src/components/item-details/item-details.d.ts +3 -0
  19. package/dist/src/components/listings/index.d.ts +1 -0
  20. package/dist/src/components/listings/listings.d.ts +3 -0
  21. package/dist/src/components/nav-bar/index.d.ts +1 -0
  22. package/dist/src/components/nav-bar/nav-bar.d.ts +3 -0
  23. package/dist/src/components/scaffold/index.d.ts +1 -0
  24. package/dist/src/components/scaffold/scaffold.d.ts +3 -0
  25. package/dist/src/constants/defaults.d.ts +4 -0
  26. package/dist/src/constants/index.d.ts +1 -0
  27. package/dist/src/context/emperor-ui-context.d.ts +3 -0
  28. package/dist/src/context/index.d.ts +1 -0
  29. package/dist/src/examples/index.d.ts +1 -0
  30. package/dist/src/hooks/index.d.ts +1 -0
  31. package/dist/src/hooks/use-emperor-ui.d.ts +1 -0
  32. package/dist/src/index.d.ts +8 -0
  33. package/dist/src/providers/emperor-ui-provider.d.ts +3 -0
  34. package/dist/src/providers/index.d.ts +1 -0
  35. package/dist/src/types/components/filter/filter.d.ts +8 -0
  36. package/dist/src/types/components/filter/index.d.ts +1 -0
  37. package/dist/src/types/components/footer/footer.d.ts +8 -0
  38. package/dist/src/types/components/footer/index.d.ts +1 -0
  39. package/dist/src/types/components/header/header.d.ts +19 -0
  40. package/dist/src/types/components/header/index.d.ts +1 -0
  41. package/dist/src/types/components/index.d.ts +8 -0
  42. package/dist/src/types/components/item-card/index.d.ts +1 -0
  43. package/dist/src/types/components/item-card/item-card.d.ts +8 -0
  44. package/dist/src/types/components/item-details/index.d.ts +1 -0
  45. package/dist/src/types/components/item-details/item-details.d.ts +8 -0
  46. package/dist/src/types/components/listings/index.d.ts +1 -0
  47. package/dist/src/types/components/listings/listings.d.ts +8 -0
  48. package/dist/src/types/components/nav-bar/index.d.ts +1 -0
  49. package/dist/src/types/components/nav-bar/nav-bar.d.ts +8 -0
  50. package/dist/src/types/components/scaffold/index.d.ts +1 -0
  51. package/dist/src/types/components/scaffold/scaffold.d.ts +8 -0
  52. package/dist/src/types/context/emperor-ui.d.ts +31 -0
  53. package/dist/src/types/context/index.d.ts +1 -0
  54. package/dist/src/types/index.d.ts +3 -0
  55. package/dist/src/types/shared/components.d.ts +6 -0
  56. package/dist/src/types/shared/index.d.ts +1 -0
  57. package/dist/src/utils/cn.d.ts +3 -0
  58. package/dist/src/utils/index.d.ts +1 -0
  59. package/eslint.config.js +43 -0
  60. package/index.html +13 -0
  61. package/package.json +82 -0
  62. package/src/components/filter/filter.tsx +6 -0
  63. package/src/components/filter/index.ts +1 -0
  64. package/src/components/footer/footer.tsx +6 -0
  65. package/src/components/footer/index.ts +1 -0
  66. package/src/components/header/header.tsx +49 -0
  67. package/src/components/header/index.ts +1 -0
  68. package/src/components/index.ts +8 -0
  69. package/src/components/item-card/index.ts +1 -0
  70. package/src/components/item-card/item-card.tsx +6 -0
  71. package/src/components/item-details/index.ts +1 -0
  72. package/src/components/item-details/item-details.tsx +6 -0
  73. package/src/components/listings/index.ts +1 -0
  74. package/src/components/listings/listings.tsx +6 -0
  75. package/src/components/nav-bar/index.ts +1 -0
  76. package/src/components/nav-bar/nav-bar.tsx +6 -0
  77. package/src/components/scaffold/index.ts +1 -0
  78. package/src/components/scaffold/scaffold.tsx +15 -0
  79. package/src/constants/defaults.ts +22 -0
  80. package/src/constants/index.ts +1 -0
  81. package/src/context/emperor-ui-context.ts +6 -0
  82. package/src/context/index.ts +1 -0
  83. package/src/examples/index.ts +1 -0
  84. package/src/hooks/index.ts +1 -0
  85. package/src/hooks/use-emperor-ui.ts +12 -0
  86. package/src/index.css +1 -0
  87. package/src/index.ts +8 -0
  88. package/src/providers/emperor-ui-provider.tsx +31 -0
  89. package/src/providers/index.ts +1 -0
  90. package/src/types/components/filter/filter.ts +9 -0
  91. package/src/types/components/filter/index.ts +1 -0
  92. package/src/types/components/footer/footer.ts +9 -0
  93. package/src/types/components/footer/index.ts +1 -0
  94. package/src/types/components/header/header.ts +21 -0
  95. package/src/types/components/header/index.ts +1 -0
  96. package/src/types/components/index.ts +8 -0
  97. package/src/types/components/item-card/index.ts +1 -0
  98. package/src/types/components/item-card/item-card.ts +9 -0
  99. package/src/types/components/item-details/index.ts +1 -0
  100. package/src/types/components/item-details/item-details.ts +9 -0
  101. package/src/types/components/listings/index.ts +1 -0
  102. package/src/types/components/listings/listings.ts +9 -0
  103. package/src/types/components/nav-bar/index.ts +1 -0
  104. package/src/types/components/nav-bar/nav-bar.ts +9 -0
  105. package/src/types/components/scaffold/index.ts +1 -0
  106. package/src/types/components/scaffold/scaffold.ts +9 -0
  107. package/src/types/context/emperor-ui.ts +37 -0
  108. package/src/types/context/index.ts +1 -0
  109. package/src/types/index.ts +3 -0
  110. package/src/types/shared/components.ts +6 -0
  111. package/src/types/shared/index.ts +1 -0
  112. package/src/utils/cn.ts +6 -0
  113. package/src/utils/index.ts +1 -0
  114. package/tailwind.config.js +6 -0
  115. package/tsconfig.app.json +45 -0
  116. package/tsconfig.json +7 -0
  117. package/tsconfig.node.json +26 -0
  118. package/vite.config.ts +49 -0
  119. package/vitest.shims.d.ts +1 -0
@@ -0,0 +1,49 @@
1
+ import type { HeaderProps } from "@types";
2
+ import { cn } from "@utils";
3
+ import { cva, VariantProps } from "class-variance-authority";
4
+ import { ComponentProps, forwardRef } from "react";
5
+
6
+ const headerStyles = cva(["flex justify-center items-center min-h-16"], {
7
+ variants: {
8
+ variant: {
9
+ primary: "bg-blue-500 text-white",
10
+ secondary: "bg-gray-500 text-black",
11
+ },
12
+ padding: {
13
+ sm: "p-2",
14
+ md: "p-4",
15
+ lg: "p-6",
16
+ },
17
+ },
18
+ defaultVariants: {
19
+ variant: "primary",
20
+ padding: "md",
21
+ },
22
+ compoundVariants: [
23
+ {
24
+ variant: "primary",
25
+ padding: "lg",
26
+ class: "shadow-lg",
27
+ },
28
+ {
29
+ variant: "secondary",
30
+ padding: "sm",
31
+ class: "border-2 border-black",
32
+ },
33
+ ],
34
+ });
35
+
36
+ export const Header = forwardRef<
37
+ HTMLElement,
38
+ ComponentProps<"header"> & VariantProps<typeof headerStyles> & HeaderProps
39
+ >(({ className, variant, padding, ...props }, ref) => {
40
+ return (
41
+ <header
42
+ ref={ref}
43
+ className={cn(headerStyles({ variant, padding, className }))}
44
+ {...props}
45
+ >
46
+ this is a header
47
+ </header>
48
+ );
49
+ });
@@ -0,0 +1 @@
1
+ export * from "./header";
@@ -0,0 +1,8 @@
1
+ export * from "./filter";
2
+ export * from "./footer";
3
+ export * from "./header";
4
+ export * from "./item-card";
5
+ export * from "./item-details";
6
+ export * from "./listings";
7
+ export * from "./nav-bar";
8
+ export * from "./scaffold";
@@ -0,0 +1 @@
1
+ export * from "./item-card";
@@ -0,0 +1,6 @@
1
+ import type { FooterProps } from "@types";
2
+ import { cn } from "@utils";
3
+
4
+ export function Footer({ className }: FooterProps) {
5
+ return <div className={cn("", className)}>Footer Component</div>;
6
+ }
@@ -0,0 +1 @@
1
+ export * from "./item-details";
@@ -0,0 +1,6 @@
1
+ import type { ItemDetailsProps } from "src";
2
+ import { cn } from "@utils";
3
+
4
+ export function ItemDetails({ className }: ItemDetailsProps) {
5
+ return <div className={cn("", className)}>ItemDetails Component</div>;
6
+ }
@@ -0,0 +1 @@
1
+ export * from "./listings";
@@ -0,0 +1,6 @@
1
+ import type { ListingsProps } from "src";
2
+ import { cn } from "@utils";
3
+
4
+ export function Listings({ className }: ListingsProps) {
5
+ return <div className={cn("", className)}>Listings Component</div>;
6
+ }
@@ -0,0 +1 @@
1
+ export * from "./nav-bar";
@@ -0,0 +1,6 @@
1
+ import type { NavBarProps } from "src";
2
+ import { cn } from "@utils";
3
+
4
+ export function NavBar({ className }: NavBarProps) {
5
+ return <div className={cn("", className)}>NavBar Component</div>;
6
+ }
@@ -0,0 +1 @@
1
+ export * from "./scaffold";
@@ -0,0 +1,15 @@
1
+ import { useEmperorUI } from "@hooks";
2
+ import type { ScaffoldProps } from "@types";
3
+ import { cn } from "@utils";
4
+
5
+ export function Scaffold({ className, children }: ScaffoldProps) {
6
+ const { config } = useEmperorUI();
7
+
8
+ const backgroundColor = config?.theme?.colors?.background;
9
+
10
+ return (
11
+ <div className={cn("flex flex-col", className)} style={{ backgroundColor }}>
12
+ {children}
13
+ </div>
14
+ );
15
+ }
@@ -0,0 +1,22 @@
1
+ import type { ColorsPalette, EmperorUIConfig } from "@types";
2
+
3
+ export const defaultColorsPalette: ColorsPalette = {
4
+ primary: "#1E40AF",
5
+ secondary: "#F59E0B",
6
+ background: "#FFFFFF",
7
+ text: "#111827",
8
+ danger: "#DC2626",
9
+ warning: "#D97706",
10
+ info: "#3B82F6",
11
+ success: "#16A34A",
12
+ };
13
+
14
+ export const defaultEmperorUIConfig: EmperorUIConfig = {
15
+ theme: {
16
+ mode: "dark",
17
+ colors: defaultColorsPalette,
18
+ },
19
+ layout: {
20
+ withScaffold: true,
21
+ },
22
+ };
@@ -0,0 +1 @@
1
+ export * from "./defaults";
@@ -0,0 +1,6 @@
1
+ import type { EmperorUIContextState } from "@types";
2
+ import { createContext } from "react";
3
+
4
+ export const EmperorUIContext = createContext<
5
+ EmperorUIContextState | undefined
6
+ >(undefined);
@@ -0,0 +1 @@
1
+ export * from "./emperor-ui-context";
@@ -0,0 +1 @@
1
+ export * from "./";
@@ -0,0 +1 @@
1
+ export * from "./use-emperor-ui";
@@ -0,0 +1,12 @@
1
+ import { EmperorUIContext } from "@context";
2
+ import { useContext } from "react";
3
+
4
+ export function useEmperorUI() {
5
+ const context = useContext(EmperorUIContext);
6
+
7
+ if (!context) {
8
+ throw new Error("useEmperorUI must be used within a EmperorUIProvider");
9
+ }
10
+
11
+ return context;
12
+ }
package/src/index.css ADDED
@@ -0,0 +1 @@
1
+ @import "tailwindcss";
package/src/index.ts ADDED
@@ -0,0 +1,8 @@
1
+ export * from "./components";
2
+ export type * from "./types";
3
+ export * from "./utils";
4
+ export * from "./providers";
5
+ export * from "./context";
6
+ export * from "./hooks";
7
+ export * from "./constants";
8
+ export * from "./examples";
@@ -0,0 +1,31 @@
1
+ import type { EmperorUIContextState, EmperorUIProviderProps } from "@types";
2
+ import { useMemo } from "react";
3
+ import { EmperorUIContext } from "@context";
4
+ import { defaultEmperorUIConfig } from "@constants";
5
+ import { Scaffold } from "@components";
6
+
7
+ export function EmperorUIProvider({
8
+ children,
9
+ config = defaultEmperorUIConfig,
10
+ }: EmperorUIProviderProps) {
11
+ const emperorUIProviderValue: EmperorUIContextState = useMemo(() => {
12
+ return {
13
+ config,
14
+ };
15
+ }, [config]);
16
+
17
+ const withScaffold = config.layout?.withScaffold ?? true;
18
+
19
+ if (withScaffold)
20
+ return (
21
+ <EmperorUIContext.Provider value={emperorUIProviderValue}>
22
+ <Scaffold>{children}</Scaffold>
23
+ </EmperorUIContext.Provider>
24
+ );
25
+
26
+ return (
27
+ <EmperorUIContext.Provider value={emperorUIProviderValue}>
28
+ {children}
29
+ </EmperorUIContext.Provider>
30
+ );
31
+ }
@@ -0,0 +1 @@
1
+ export * from "./emperor-ui-provider";
@@ -0,0 +1,9 @@
1
+ import type { SharedComponentProps } from "@types";
2
+
3
+ export type FilterClassnames = {
4
+ base?: string;
5
+ };
6
+
7
+ export type FilterProps = SharedComponentProps & {
8
+ classNames?: FilterClassnames;
9
+ };
@@ -0,0 +1 @@
1
+ export type * from "./filter";
@@ -0,0 +1,9 @@
1
+ import type { SharedComponentProps } from "@types";
2
+
3
+ export type FooterClassnames = {
4
+ base?: string;
5
+ };
6
+
7
+ export type FooterProps = SharedComponentProps & {
8
+ classNames?: FooterClassnames;
9
+ };
@@ -0,0 +1 @@
1
+ export type * from "./footer";
@@ -0,0 +1,21 @@
1
+ import type { SharedComponentProps } from "@types";
2
+
3
+ export type HeaderClassnames = {
4
+ base?: string;
5
+ logo?: string;
6
+ navbar?: string;
7
+ userDropdown?: string;
8
+ sideMenu?: string;
9
+ };
10
+
11
+ export type HeaderActivations = {
12
+ hideLog?: boolean;
13
+ hideNavbar?: boolean;
14
+ hideUserDropdown?: boolean;
15
+ hideSideMenu?: boolean;
16
+ };
17
+
18
+ export type HeaderProps = SharedComponentProps & {
19
+ variant?: "default" | "compact";
20
+ classNames?: HeaderClassnames;
21
+ };
@@ -0,0 +1 @@
1
+ export type * from "./header";
@@ -0,0 +1,8 @@
1
+ export type * from "./header";
2
+ export type * from "./listings";
3
+ export type * from "./nav-bar";
4
+ export type * from "./scaffold";
5
+ export type * from "./filter";
6
+ export type * from "./footer";
7
+ export type * from "./item-card";
8
+ export type * from "./item-details";
@@ -0,0 +1 @@
1
+ export type * from "./item-card";
@@ -0,0 +1,9 @@
1
+ import type { SharedComponentProps } from "@types";
2
+
3
+ export type ItemCardClassnames = {
4
+ base?: string;
5
+ };
6
+
7
+ export type ItemCardProps = SharedComponentProps & {
8
+ classNames?: ItemCardClassnames;
9
+ };
@@ -0,0 +1 @@
1
+ export type * from "./item-details";
@@ -0,0 +1,9 @@
1
+ import type { SharedComponentProps } from "@types";
2
+
3
+ export type ItemDetailsClassnames = {
4
+ base?: string;
5
+ };
6
+
7
+ export type ItemDetailsProps = SharedComponentProps & {
8
+ classNames?: ItemDetailsClassnames;
9
+ };
@@ -0,0 +1 @@
1
+ export type * from "./listings";
@@ -0,0 +1,9 @@
1
+ import type { SharedComponentProps } from "@types";
2
+
3
+ export type ListingsClassnames = {
4
+ base?: string;
5
+ };
6
+
7
+ export type ListingsProps = SharedComponentProps & {
8
+ classNames?: ListingsClassnames;
9
+ };
@@ -0,0 +1 @@
1
+ export type * from "./nav-bar";
@@ -0,0 +1,9 @@
1
+ import type { SharedComponentProps } from "@types";
2
+
3
+ export type NavBarClassnames = {
4
+ base?: string;
5
+ };
6
+
7
+ export type NavBarProps = SharedComponentProps & {
8
+ classNames?: NavBarClassnames;
9
+ };
@@ -0,0 +1 @@
1
+ export type * from "./scaffold";
@@ -0,0 +1,9 @@
1
+ import type { SharedComponentProps } from "@types";
2
+
3
+ export type ScaffoldClassnames = {
4
+ base?: string;
5
+ };
6
+
7
+ export type ScaffoldProps = SharedComponentProps & {
8
+ classNames?: ScaffoldClassnames;
9
+ };
@@ -0,0 +1,37 @@
1
+ import { type ReactNode } from "react";
2
+
3
+ export type EmperorUIContextState = {
4
+ config: EmperorUIConfig;
5
+ };
6
+
7
+ export type EmperorUIProviderProps = {
8
+ children: ReactNode;
9
+ config: EmperorUIConfig;
10
+ };
11
+
12
+ export type ColorMode = "light" | "dark";
13
+
14
+ export type ColorsPalette = {
15
+ primary: string;
16
+ secondary: string;
17
+ success: string;
18
+ danger: string;
19
+ warning: string;
20
+ info: string;
21
+ background: string;
22
+ text: string;
23
+ };
24
+
25
+ export type EmperorUITheme = {
26
+ mode: ColorMode;
27
+ colors: Partial<ColorsPalette>;
28
+ };
29
+
30
+ export type EmperorUILayout = {
31
+ withScaffold: boolean;
32
+ };
33
+
34
+ export type EmperorUIConfig = {
35
+ theme?: Partial<EmperorUITheme>;
36
+ layout?: Partial<EmperorUILayout>;
37
+ };
@@ -0,0 +1 @@
1
+ export type * from "./emperor-ui";
@@ -0,0 +1,3 @@
1
+ export type * from "./components";
2
+ export type * from "./shared";
3
+ export type * from "./context";
@@ -0,0 +1,6 @@
1
+ import { type ReactNode } from "react";
2
+
3
+ export type SharedComponentProps = {
4
+ className?: string;
5
+ children?: ReactNode;
6
+ };
@@ -0,0 +1 @@
1
+ export type * from "./components";
@@ -0,0 +1,6 @@
1
+ import clsx, { ClassValue } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+
4
+ export function cn(...classes: ClassValue[]) {
5
+ return twMerge(clsx(classes));
6
+ }
@@ -0,0 +1 @@
1
+ export * from "./cn";
@@ -0,0 +1,6 @@
1
+ /** @type {import('tailwindcss').Config} */
2
+ export default {
3
+ content: ["./src/**/*.{js,ts,jsx,tsx}"],
4
+ theme: {},
5
+ plugins: [],
6
+ };
@@ -0,0 +1,45 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
5
+ "target": "ES2022",
6
+ "useDefineForClassFields": true,
7
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
8
+ "module": "ESNext",
9
+ "types": ["vite/client"],
10
+ "skipLibCheck": true,
11
+
12
+ /* Bundler mode */
13
+ "moduleResolution": "bundler",
14
+ "allowImportingTsExtensions": true,
15
+ "moduleDetection": "force",
16
+ "noEmit": true,
17
+ "jsx": "react-jsx",
18
+
19
+ /* Linting */
20
+ "strict": true,
21
+ "noUnusedLocals": true,
22
+ "noUnusedParameters": true,
23
+ "erasableSyntaxOnly": true,
24
+ "noFallthroughCasesInSwitch": true,
25
+ "noUncheckedSideEffectImports": true,
26
+
27
+ "baseUrl": ".",
28
+ "paths": {
29
+ "@utils": ["./src/utils"],
30
+ "@components": ["./src/components"],
31
+ "@constants": ["./src/constants"],
32
+ "@hooks": ["./src/hooks"],
33
+ "@context": ["./src/context"],
34
+ "@examples": ["./src/examples"],
35
+ "@providers": ["./src/providers"],
36
+ "@types": ["./src/types"]
37
+ }
38
+ },
39
+ "include": [
40
+ "**/*.ts",
41
+ "src/**/*.(ts|js|tsx|jsx)",
42
+ "src/**/*.d.(ts|js|tsx|jsx)",
43
+ "src"
44
+ ]
45
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ { "path": "./tsconfig.app.json" },
5
+ { "path": "./tsconfig.node.json" }
6
+ ]
7
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "compilerOptions": {
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
4
+ "target": "ES2023",
5
+ "lib": ["ES2023"],
6
+ "module": "ESNext",
7
+ "types": ["node"],
8
+ "skipLibCheck": true,
9
+
10
+ /* Bundler mode */
11
+ "moduleResolution": "bundler",
12
+ "allowImportingTsExtensions": true,
13
+ "verbatimModuleSyntax": true,
14
+ "moduleDetection": "force",
15
+ "noEmit": true,
16
+
17
+ /* Linting */
18
+ "strict": true,
19
+ "noUnusedLocals": true,
20
+ "noUnusedParameters": true,
21
+ "erasableSyntaxOnly": true,
22
+ "noFallthroughCasesInSwitch": true,
23
+ "noUncheckedSideEffectImports": true
24
+ },
25
+ "include": ["vite.config.ts"]
26
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,49 @@
1
+ import tailwindcss from "@tailwindcss/vite";
2
+ import react from "@vitejs/plugin-react";
3
+ import path from "path";
4
+ import { defineConfig } from "vite";
5
+ import dts from "vite-plugin-dts";
6
+
7
+ export default defineConfig({
8
+ server: {
9
+ port: 3000,
10
+ },
11
+ plugins: [
12
+ react(),
13
+ tailwindcss(),
14
+ dts({
15
+ include: ["src/**/*.ts", "src/**/*.tsx"],
16
+ exclude: ["src/**/*.test.ts", "src/**/*.test.tsx"],
17
+ rollupTypes: false,
18
+ tsconfigPath: "./tsconfig.app.json",
19
+ }),
20
+ ],
21
+ resolve: {
22
+ alias: {
23
+ "@utils": path.resolve(__dirname, "./src/utils"),
24
+ "@components": path.resolve(__dirname, "./src/components"),
25
+ "@types": path.resolve(__dirname, "./src/types"),
26
+ "@providers": path.resolve(__dirname, "./src/providers"),
27
+ "@constants": path.resolve(__dirname, "./src/constants"),
28
+ "@hooks": path.resolve(__dirname, "./src/hooks"),
29
+ "@context": path.resolve(__dirname, "./src/context"),
30
+ "@examples": path.resolve(__dirname, "./src/examples"),
31
+ },
32
+ },
33
+ build: {
34
+ lib: {
35
+ entry: path.resolve(__dirname, "./src/index.ts"),
36
+ name: "EmperorUI",
37
+ fileName: "emperor-ui",
38
+ },
39
+ rollupOptions: {
40
+ external: ["react", "react-dom"],
41
+ output: {
42
+ globals: {
43
+ react: "React",
44
+ "react-dom": "ReactDOM",
45
+ },
46
+ },
47
+ },
48
+ },
49
+ });
@@ -0,0 +1 @@
1
+ /// <reference types="@vitest/browser-playwright" />