From 7bdd04ed437a24fdcb69e685ee3bdb481868bfae Mon Sep 17 00:00:00 2001 From: Junior Garcia Date: Sat, 5 Aug 2023 18:19:17 -0300 Subject: [PATCH 1/2] feat(root): rsc components added, packages modified, filter dom props function adapted --- .changeset/fresh-jobs-draw.md | 22 +++++++ apps/docs/app/page.tsx | 2 +- apps/docs/components/blog-post.tsx | 9 ++- .../docs/components/component-links.tsx | 66 ++++++++++++++----- apps/docs/content/docs/components/badge.mdx | 2 +- apps/docs/content/docs/components/code.mdx | 2 +- apps/docs/content/docs/components/divider.mdx | 2 +- apps/docs/content/docs/components/kbd.mdx | 2 +- .../docs/content/docs/components/skeleton.mdx | 2 +- apps/docs/content/docs/components/spacer.mdx | 2 +- apps/docs/content/docs/components/spinner.mdx | 2 +- apps/docs/package.json | 7 ++ .../accordion/src/use-accordion-item.ts | 10 ++- packages/components/badge/src/badge.tsx | 7 +- packages/components/badge/src/use-badge.ts | 9 +-- packages/components/badge/tsup.config.ts | 1 - packages/components/button/src/use-button.ts | 6 +- packages/components/card/src/use-card.ts | 6 +- packages/components/code/src/code.tsx | 10 ++- packages/components/code/src/use-code.ts | 9 +-- packages/components/code/tsup.config.ts | 1 - packages/components/divider/package.json | 5 +- packages/components/divider/src/divider.tsx | 6 +- .../components/divider/src/use-divider.ts | 18 +++-- .../components/divider/src/use-separator.ts | 53 +++++++++++++++ packages/components/divider/tsup.config.ts | 1 - .../dropdown/src/use-dropdown-item.ts | 5 +- packages/components/input/src/use-input.ts | 1 + packages/components/kbd/src/kbd.tsx | 5 +- packages/components/kbd/src/use-kbd.ts | 13 ++-- packages/components/kbd/tsup.config.ts | 1 - packages/components/skeleton/src/skeleton.tsx | 6 +- .../components/skeleton/src/use-skeleton.ts | 16 ++--- packages/components/skeleton/tsup.config.ts | 1 - packages/components/spacer/src/spacer.tsx | 6 +- packages/components/spacer/src/use-spacer.ts | 9 +-- packages/components/spacer/tsup.config.ts | 1 - packages/components/spinner/src/spinner.tsx | 6 +- .../components/spinner/src/use-spinner.ts | 15 ++--- packages/components/spinner/tsup.config.ts | 1 - packages/components/table/src/table-body.tsx | 10 ++- packages/components/table/src/table-cell.tsx | 11 +++- .../table/src/table-checkbox-cell.tsx | 11 +++- .../table/src/table-column-header.tsx | 6 +- .../components/table/src/table-header-row.tsx | 9 ++- packages/components/table/src/table-row.tsx | 5 +- .../table/src/table-select-all-checkbox.tsx | 10 ++- packages/components/table/src/use-table.ts | 11 +++- packages/components/tabs/src/tab.tsx | 5 +- packages/components/tabs/src/use-tabs.ts | 8 ++- packages/core/system/extend-variants.d.ts | 1 + packages/core/system/extend-variants.js | 1 + packages/core/system/package.json | 8 ++- packages/core/system/types.d.ts | 1 + packages/core/system/types.js | 1 + packages/core/system/utils.d.ts | 1 + packages/core/system/utils.js | 1 + packages/utilities/react-rsc-utils/README.md | 24 +++++++ .../utilities/react-rsc-utils/children.d.ts | 1 + .../utilities/react-rsc-utils/children.js | 1 + .../react-rsc-utils/filter-dom-props.d.ts | 1 + .../react-rsc-utils/filter-dom-props.js | 1 + .../utilities/react-rsc-utils/package.json | 52 +++++++++++++++ .../src/children.ts | 0 .../src/filter-dom-props.ts | 9 +++ .../utilities/react-rsc-utils/src/index.ts | 2 + .../utilities/react-rsc-utils/tsconfig.json | 4 ++ packages/utilities/react-utils/package.json | 2 +- packages/utilities/react-utils/src/index.ts | 4 +- pnpm-lock.yaml | 57 +++++++++------- 70 files changed, 449 insertions(+), 157 deletions(-) create mode 100644 .changeset/fresh-jobs-draw.md create mode 100644 packages/components/divider/src/use-separator.ts create mode 100644 packages/core/system/extend-variants.d.ts create mode 100644 packages/core/system/extend-variants.js create mode 100644 packages/core/system/types.d.ts create mode 100644 packages/core/system/types.js create mode 100644 packages/core/system/utils.d.ts create mode 100644 packages/core/system/utils.js create mode 100644 packages/utilities/react-rsc-utils/README.md create mode 100644 packages/utilities/react-rsc-utils/children.d.ts create mode 100644 packages/utilities/react-rsc-utils/children.js create mode 100644 packages/utilities/react-rsc-utils/filter-dom-props.d.ts create mode 100644 packages/utilities/react-rsc-utils/filter-dom-props.js create mode 100644 packages/utilities/react-rsc-utils/package.json rename packages/utilities/{react-utils => react-rsc-utils}/src/children.ts (100%) rename packages/utilities/{react-utils => react-rsc-utils}/src/filter-dom-props.ts (90%) create mode 100644 packages/utilities/react-rsc-utils/src/index.ts create mode 100644 packages/utilities/react-rsc-utils/tsconfig.json diff --git a/.changeset/fresh-jobs-draw.md b/.changeset/fresh-jobs-draw.md new file mode 100644 index 0000000000..9c9900eee4 --- /dev/null +++ b/.changeset/fresh-jobs-draw.md @@ -0,0 +1,22 @@ +--- +"@nextui-org/react-utils": patch +"@nextui-org/accordion": patch +"@nextui-org/dropdown": patch +"@nextui-org/skeleton": patch +"@nextui-org/divider": patch +"@nextui-org/spinner": patch +"@nextui-org/button": patch +"@nextui-org/spacer": patch +"@nextui-org/badge": patch +"@nextui-org/input": patch +"@nextui-org/table": patch +"@nextui-org/card": patch +"@nextui-org/code": patch +"@nextui-org/tabs": patch +"@nextui-org/kbd": patch +"@nextui-org/system": patch +--- + +- "use client" directive removed from components that didn't need it +- packages adapted to support RSC imports +- filterDomProps function was modified to enable/disabled it diff --git a/apps/docs/app/page.tsx b/apps/docs/app/page.tsx index b3e3f87bd5..6dc92eb071 100644 --- a/apps/docs/app/page.tsx +++ b/apps/docs/app/page.tsx @@ -1,4 +1,4 @@ -import {Spacer} from "@nextui-org/react"; +import {Spacer} from "@nextui-org/spacer"; import {Hero} from "@/components/marketing/hero"; import {FeaturesGrid} from "@/components/marketing/features-grid"; diff --git a/apps/docs/components/blog-post.tsx b/apps/docs/components/blog-post.tsx index 06cda66e72..6dec50c216 100644 --- a/apps/docs/components/blog-post.tsx +++ b/apps/docs/components/blog-post.tsx @@ -1,7 +1,7 @@ "use client"; import {BlogPost} from "contentlayer/generated"; -import {Card, CardFooter, CardBody, CardHeader, Link, Avatar} from "@nextui-org/react"; +import {Card, CardFooter, CardBody, CardHeader, Link, Avatar, Image} from "@nextui-org/react"; import Balancer from "react-wrap-balancer"; import {format, parseISO} from "date-fns"; import NextLink from "next/link"; @@ -39,10 +39,9 @@ const BlogPostCard = (post: BlogPost) => { {post.title} - -

- {post.description} -

+ + +

{post.description}