Skip to content
This repository has been archived by the owner on Feb 10, 2025. It is now read-only.

Commit

Permalink
fix: export separatedly components with document error (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
hussedev committed Jan 14, 2025
1 parent 8dec94d commit d316e42
Show file tree
Hide file tree
Showing 30 changed files with 96 additions and 103 deletions.
92 changes: 0 additions & 92 deletions colors.md

This file was deleted.

25 changes: 25 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,31 @@
"types": "./dist/retrofunding.d.ts",
"import": "./dist/retrofunding.js",
"require": "./dist/retrofunding.js"
},
"./form": {
"types": "./dist/form.d.ts",
"import": "./dist/form.js",
"require": "./dist/form.js"
},
"./setup-progress-form": {
"types": "./dist/setupProgressForm.d.ts",
"import": "./dist/setupProgressForm.js",
"require": "./dist/setupProgressForm.js"
},
"./accordion": {
"types": "./dist/accordion.d.ts",
"import": "./dist/accordion.js",
"require": "./dist/accordion.js"
},
"./markdown-editor": {
"types": "./dist/markdownEditor.d.ts",
"import": "./dist/markdownEditor.js",
"require": "./dist/markdownEditor.js"
},
"./markdown": {
"types": "./dist/markdown.d.ts",
"import": "./dist/markdown.js",
"require": "./dist/markdown.js"
}
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { CartesianGrid, Line, YAxis, LineChart } from "recharts";

export const AllocationChart = ({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { PropsWithChildren } from "react";

import { cn } from "@/lib/utils";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { ArrowDownNarrowWide } from "lucide-react";
import { ArrowUpWideNarrow } from "lucide-react";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { cn } from "@/lib/utils";
import { Skeleton } from "@/primitives/Skeleton";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// src/components/Form/FormAllowlistController.tsx
"use client";

import React, { useRef } from "react";
import { useFormContext, Controller } from "react-hook-form";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// src/components/Form/ApplicationQuestionsController.tsx
"use client";

import React from "react";
import { useEffect } from "react";
import { useFieldArray, useFormContext, Controller } from "react-hook-form";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// src/components/Form/DisabledInputController.tsx
"use client";

import React from "react";
import { Controller, useFormContext } from "react-hook-form";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// src/components/Form/FieldArrayController.tsx
"use client";

import React from "react";
import { useFieldArray, useFormContext, Controller } from "react-hook-form";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import React from "react";
import { Controller, useFormContext } from "react-hook-form";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// src/components/Form/MarkdownEditorController.tsx
"use client";

import React from "react";
import { Controller, useFormContext } from "react-hook-form";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import * as React from "react";
import { Controller, useFormContext } from "react-hook-form";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import * as React from "react";
import { useFormContext, Controller } from "react-hook-form";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import * as React from "react";

import moment from "moment-timezone";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { CheckCircle2Icon } from "lucide-react";

import { Label } from "@/ui-shadcn/label";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import React from "react";
import { Controller, useFormContext } from "react-hook-form";

Expand Down
1 change: 0 additions & 1 deletion src/components/Form/utils/buildSchemaFromFields.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// File: utils/buildSchemaFromFields.ts
import { z } from "zod";

import { FormField } from "../types/fieldTypes";
Expand Down
2 changes: 2 additions & 0 deletions src/components/IconLabel/IconLabelContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import "lucide-react";

import { cn } from "@/lib/utils";
Expand Down
1 change: 0 additions & 1 deletion src/components/IconLabel/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { HeroiconsType } from "@/assets";
import { IconType } from "@/primitives/Icon";

interface AIEvaluationProps {
Expand Down
2 changes: 2 additions & 0 deletions src/components/SideNav/SideNav.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { tv } from "tailwind-variants";

import { AccordionItem, NavItem, InternalSideNavProps } from "@/components/SideNav";
Expand Down
2 changes: 2 additions & 0 deletions src/components/SideNav/components/NavItem.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { SideNavItem } from "@/components/SideNav";
import { cn } from "@/lib/utils";
import { Icon } from "@/primitives/Icon";
Expand Down
3 changes: 0 additions & 3 deletions src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
export * from "./AllocationSidebar";
export * from "./EvaluationForm";
export * from "./Form";
export * from "./IconLabel";
export * from "./ProgressModal";
export * from "./RadioGroupList";
export * from "./SetupProgressForm";
export * from "./SideNav";
export * from "./Toaster";
1 change: 1 addition & 0 deletions src/lib/withSSR/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./withSSR";
20 changes: 20 additions & 0 deletions src/lib/withSSR/withSSR.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import * as React from "react";

export function withSSR<P extends object>(
Component: React.ComponentType<P>,
fallback: React.ReactNode = null,
) {
return function SSRSafeComponent(props: P) {
const [mounted, setMounted] = React.useState(false);

React.useEffect(() => {
setMounted(true);
}, []);

if (!mounted) {
return <>{fallback}</>;
}

return <Component {...props} />;
};
}
2 changes: 1 addition & 1 deletion src/primitives/Navbar/Navbar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import type { Meta, StoryObj } from "@storybook/react";

import { DefaultLogo } from "@/assets";
import { CheckerIcon } from "@/assets/icons";
import { Button } from "@/primitives/Button";

import { Button } from "../Button";
import { Navbar } from "./Navbar";

// Adjust the path as needed
Expand Down
2 changes: 2 additions & 0 deletions src/primitives/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import * as React from "react";

import { tv } from "tailwind-variants";
Expand Down
2 changes: 2 additions & 0 deletions src/primitives/Navbar/components/NavbarLogo.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { GitcoinLogo } from "@/assets";

const defaultLogo = GitcoinLogo;
Expand Down
2 changes: 2 additions & 0 deletions src/primitives/Navbar/components/NavbarTitle.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

import { cn } from "@/lib";

export interface NavbarTitleProps {
Expand Down
7 changes: 7 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ export default defineConfig({
mocks: resolve(__dirname, "./src/mocks/handlers.ts"),
types: resolve(__dirname, "./src/types/index.ts"),

// client
setupProgressForm: resolve(__dirname, "./src/components/SetupProgressForm/index.ts"),
form: resolve(__dirname, "./src/components/Form/index.ts"),
accordion: resolve(__dirname, "./src/primitives/Accordion/index.ts"),
markdownEditor: resolve(__dirname, "./src/primitives/MarkdownEditor/index.ts"),
markdown: resolve(__dirname, "./src/primitives/Markdown/index.ts"),

// features
application: resolve(__dirname, "./src/features/application/index.ts"),
checker: resolve(__dirname, "./src/features/checker/index.ts"),
Expand Down

0 comments on commit d316e42

Please sign in to comment.