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

Commit d316e42

Browse files
committed
fix: export separatedly components with document error (#112)
1 parent 8dec94d commit d316e42

File tree

30 files changed

+96
-103
lines changed

30 files changed

+96
-103
lines changed

colors.md

-92
This file was deleted.

package.json

+25
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,31 @@
8282
"types": "./dist/retrofunding.d.ts",
8383
"import": "./dist/retrofunding.js",
8484
"require": "./dist/retrofunding.js"
85+
},
86+
"./form": {
87+
"types": "./dist/form.d.ts",
88+
"import": "./dist/form.js",
89+
"require": "./dist/form.js"
90+
},
91+
"./setup-progress-form": {
92+
"types": "./dist/setupProgressForm.d.ts",
93+
"import": "./dist/setupProgressForm.js",
94+
"require": "./dist/setupProgressForm.js"
95+
},
96+
"./accordion": {
97+
"types": "./dist/accordion.d.ts",
98+
"import": "./dist/accordion.js",
99+
"require": "./dist/accordion.js"
100+
},
101+
"./markdown-editor": {
102+
"types": "./dist/markdownEditor.d.ts",
103+
"import": "./dist/markdownEditor.js",
104+
"require": "./dist/markdownEditor.js"
105+
},
106+
"./markdown": {
107+
"types": "./dist/markdown.d.ts",
108+
"import": "./dist/markdown.js",
109+
"require": "./dist/markdown.js"
85110
}
86111
},
87112
"devDependencies": {

src/components/AllocationSidebar/components/AllocationChart.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client";
2+
13
import { CartesianGrid, Line, YAxis, LineChart } from "recharts";
24

35
export const AllocationChart = ({

src/components/AllocationSidebar/components/AllocationItem.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client";
2+
13
import { PropsWithChildren } from "react";
24

35
import { cn } from "@/lib/utils";

src/components/AllocationSidebar/components/AllocationSortButton.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client";
2+
13
import { ArrowDownNarrowWide } from "lucide-react";
24
import { ArrowUpWideNarrow } from "lucide-react";
35

src/components/AllocationSidebar/components/SkeletonAllocationItems.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client";
2+
13
import { cn } from "@/lib/utils";
24
import { Skeleton } from "@/primitives/Skeleton";
35

src/components/Form/FormControllers/AllowlistFormController/AllowlistFormController.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// src/components/Form/FormAllowlistController.tsx
1+
"use client";
2+
23
import React, { useRef } from "react";
34
import { useFormContext, Controller } from "react-hook-form";
45

src/components/Form/FormControllers/ApplicationQuestionsFormController/ApplicationQuestionsFormController.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// src/components/Form/ApplicationQuestionsController.tsx
1+
"use client";
2+
23
import React from "react";
34
import { useEffect } from "react";
45
import { useFieldArray, useFormContext, Controller } from "react-hook-form";

src/components/Form/FormControllers/DisabledProgramInputFormController/DisabledProgramInputFormController.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// src/components/Form/DisabledInputController.tsx
1+
"use client";
2+
23
import React from "react";
34
import { Controller, useFormContext } from "react-hook-form";
45

src/components/Form/FormControllers/FieldArrayFormController/FieldArrayFormController.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// src/components/Form/FieldArrayController.tsx
1+
"use client";
2+
23
import React from "react";
34
import { useFieldArray, useFormContext, Controller } from "react-hook-form";
45

src/components/Form/FormControllers/FileUploadController/FileUploadController.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client";
2+
13
import React from "react";
24
import { Controller, useFormContext } from "react-hook-form";
35

src/components/Form/FormControllers/MarkdownEditorFormController/MarkdownEditorFormController.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// src/components/Form/MarkdownEditorController.tsx
1+
"use client";
2+
23
import React from "react";
34
import { Controller, useFormContext } from "react-hook-form";
45

src/components/Form/FormControllers/MetricsFormController/MetricsFormController.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client";
2+
13
import * as React from "react";
24
import { Controller, useFormContext } from "react-hook-form";
35

src/components/Form/FormControllers/RoundDatesFormController/RoundDatesFormController.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client";
2+
13
import * as React from "react";
24
import { useFormContext, Controller } from "react-hook-form";
35

src/components/Form/FormControllers/RoundDatesFormController/SelectedDateRenderer.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client";
2+
13
import * as React from "react";
24

35
import moment from "moment-timezone";

src/components/Form/FormControllers/RoundDatesFormController/TimelineRow.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client";
2+
13
import { CheckCircle2Icon } from "lucide-react";
24

35
import { Label } from "@/ui-shadcn/label";

src/components/Form/FormControllers/SelectFormController/SelectFormController.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client";
2+
13
import React from "react";
24
import { Controller, useFormContext } from "react-hook-form";
35

src/components/Form/utils/buildSchemaFromFields.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// File: utils/buildSchemaFromFields.ts
21
import { z } from "zod";
32

43
import { FormField } from "../types/fieldTypes";

src/components/IconLabel/IconLabelContainer.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client";
2+
13
import "lucide-react";
24

35
import { cn } from "@/lib/utils";

src/components/IconLabel/types.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { HeroiconsType } from "@/assets";
21
import { IconType } from "@/primitives/Icon";
32

43
interface AIEvaluationProps {

src/components/SideNav/SideNav.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client";
2+
13
import { tv } from "tailwind-variants";
24

35
import { AccordionItem, NavItem, InternalSideNavProps } from "@/components/SideNav";

src/components/SideNav/components/NavItem.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client";
2+
13
import { SideNavItem } from "@/components/SideNav";
24
import { cn } from "@/lib/utils";
35
import { Icon } from "@/primitives/Icon";

src/components/index.ts

-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
export * from "./AllocationSidebar";
2-
export * from "./EvaluationForm";
31
export * from "./Form";
42
export * from "./IconLabel";
53
export * from "./ProgressModal";
64
export * from "./RadioGroupList";
7-
export * from "./SetupProgressForm";
85
export * from "./SideNav";
96
export * from "./Toaster";

src/lib/withSSR/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./withSSR";

src/lib/withSSR/withSSR.tsx

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import * as React from "react";
2+
3+
export function withSSR<P extends object>(
4+
Component: React.ComponentType<P>,
5+
fallback: React.ReactNode = null,
6+
) {
7+
return function SSRSafeComponent(props: P) {
8+
const [mounted, setMounted] = React.useState(false);
9+
10+
React.useEffect(() => {
11+
setMounted(true);
12+
}, []);
13+
14+
if (!mounted) {
15+
return <>{fallback}</>;
16+
}
17+
18+
return <Component {...props} />;
19+
};
20+
}

src/primitives/Navbar/Navbar.stories.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import type { Meta, StoryObj } from "@storybook/react";
22

33
import { DefaultLogo } from "@/assets";
44
import { CheckerIcon } from "@/assets/icons";
5+
import { Button } from "@/primitives/Button";
56

6-
import { Button } from "../Button";
77
import { Navbar } from "./Navbar";
88

99
// Adjust the path as needed

src/primitives/Navbar/Navbar.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client";
2+
13
import * as React from "react";
24

35
import { tv } from "tailwind-variants";

src/primitives/Navbar/components/NavbarLogo.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client";
2+
13
import { GitcoinLogo } from "@/assets";
24

35
const defaultLogo = GitcoinLogo;

src/primitives/Navbar/components/NavbarTitle.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client";
2+
13
import { cn } from "@/lib";
24

35
export interface NavbarTitleProps {

vite.config.ts

+7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ export default defineConfig({
1818
mocks: resolve(__dirname, "./src/mocks/handlers.ts"),
1919
types: resolve(__dirname, "./src/types/index.ts"),
2020

21+
// client
22+
setupProgressForm: resolve(__dirname, "./src/components/SetupProgressForm/index.ts"),
23+
form: resolve(__dirname, "./src/components/Form/index.ts"),
24+
accordion: resolve(__dirname, "./src/primitives/Accordion/index.ts"),
25+
markdownEditor: resolve(__dirname, "./src/primitives/MarkdownEditor/index.ts"),
26+
markdown: resolve(__dirname, "./src/primitives/Markdown/index.ts"),
27+
2128
// features
2229
application: resolve(__dirname, "./src/features/application/index.ts"),
2330
checker: resolve(__dirname, "./src/features/checker/index.ts"),

0 commit comments

Comments
 (0)