Skip to content

The Open Standard for Generative UI

fix: resolve React ESM exports and CSS side-effect imports for Next.js Pages Router (#341)

zerone0x02e2f36ebb57
diff --git a/packages/react-lang/package.json b/packages/react-lang/package.json
index 24f17ca9d..53434cae6 100644
--- a/packages/react-lang/package.json
+++ b/packages/react-lang/package.json
@@ -12,8 +12,9 @@
],
"exports": {
".": {
+ "types": "./dist/index.d.ts",
"import": "./dist/index.js",
- "types": "./dist/index.d.ts"
+ "default": "./dist/index.js"
}
},
"scripts": {
diff --git a/packages/react-ui/package.json b/packages/react-ui/package.json
index 7e6d6150f..e95de180b 100644
--- a/packages/react-ui/package.json
+++ b/packages/react-ui/package.json
@@ -33,6 +33,10 @@
"default": "./dist/components/*/index.js"
}
},
+ "sideEffects": [
+ "*.css",
+ "*.scss"
+ ],
"files": [
"dist",
"README.md"
diff --git a/packages/react-ui/src/components/Calendar/components/helperComponents.tsx b/packages/react-ui/src/components/Calendar/components/helperComponents.tsx
index 2478b9e23..5512768a8 100644
--- a/packages/react-ui/src/components/Calendar/components/helperComponents.tsx
+++ b/packages/react-ui/src/components/Calendar/components/helperComponents.tsx
@@ -3,7 +3,6 @@ import clsx from "clsx";
import debounce from "lodash-es/debounce";
import { DetailedHTMLProps, forwardRef, SelectHTMLAttributes, useEffect, useState } from "react";
import { ClassNames, CustomComponents, DropdownOption } from "react-day-picker";
-import "react-day-picker/style.css";
import { Select, SelectItem, SelectTrigger, SelectValue } from "../../Select";
import { getMonthName, getMonthNumber } from "../utils/helperFn";
diff --git a/packages/react-ui/src/components/DatePicker/helpers/components/HelperComponents.tsx b/packages/react-ui/src/components/DatePicker/helpers/components/HelperComponents.tsx
index bb29e320a..65d3c7957 100644
--- a/packages/react-ui/src/components/DatePicker/helpers/components/HelperComponents.tsx
+++ b/packages/react-ui/src/components/DatePicker/helpers/components/HelperComponents.tsx
@@ -11,7 +11,6 @@ import {
useState,
} from "react";
import { ClassNames, CustomComponents, DropdownOption } from "react-day-picker";
-import "react-day-picker/style.css";
import { IconButton } from "../../../IconButton";
import { Select, SelectItem, SelectTrigger, SelectValue } from "../../../Select";
import { useTheme } from "../../../ThemeProvider";
diff --git a/packages/react-ui/src/components/SectionBlock/FoldableSection.tsx b/packages/react-ui/src/components/SectionBlock/FoldableSection.tsx
index d6bd451a9..03fb049c9 100644
--- a/packages/react-ui/src/components/SectionBlock/FoldableSection.tsx
+++ b/packages/react-ui/src/components/SectionBlock/FoldableSection.tsx
@@ -4,7 +4,6 @@ import { ChevronRight } from "lucide-react";
import React, { forwardRef } from "react";
import { IconButton } from "../IconButton";
import { Separator } from "../Separator";
-import "./foldableSection.scss";
export type FoldableSectionRootProps = AccordionPrimitive.AccordionMultipleProps;
diff --git a/packages/react-ui/src/components/SectionBlock/SectionV2.tsx b/packages/react-ui/src/components/SectionBlock/SectionV2.tsx
index 3f57087bf..eef4c7815 100644
--- a/packages/react-ui/src/components/SectionBlock/SectionV2.tsx
+++ b/packages/react-ui/src/components/SectionBlock/SectionV2.tsx
@@ -1,6 +1,5 @@
import React from "react";
import { Separator } from "../Separator";
-import "./sectionV2.scss";
interface SectionV2Props {
trigger: string;