Feat/server components (#1291)

* feat(root): rsc components added, packages modified, filter dom props function adapted

* fix(root): eslint/prettier issues

* feat(root): exports changed to named, new pkg for system rsc compatible functions
This commit is contained in:
Junior Garcia 2023-08-05 23:35:28 -03:00 committed by GitHub
parent eefda8d6e2
commit 86f921d098
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
45 changed files with 174 additions and 63 deletions

View File

@ -13,7 +13,7 @@ export {useAvatarGroup} from "./use-avatar-group";
export {AvatarIcon} from "./avatar-icon";
// export context
export * from "./avatar-group-context";
export {AvatarGroupProvider, useAvatarGroupContext} from "./avatar-group-context";
// export component
export {Avatar, AvatarGroup};

View File

@ -37,7 +37,7 @@
"react": ">=18"
},
"dependencies": {
"@nextui-org/system": "workspace:*",
"@nextui-org/system-rsc": "workspace:*",
"@nextui-org/theme": "workspace:*",
"@nextui-org/shared-utils": "workspace:*",
"@nextui-org/react-utils": "workspace:*"

View File

@ -1,6 +1,6 @@
import type {ReactNode} from "react";
import {forwardRef} from "@nextui-org/system/utils";
import {forwardRef} from "@nextui-org/system-rsc";
import {UseBadgeProps, useBadge} from "./use-badge";

View File

@ -1,9 +1,9 @@
import type {BadgeSlots, BadgeVariantProps, SlotsToClasses} from "@nextui-org/theme";
import type {ReactNode} from "react";
import type {HTMLNextUIProps, PropGetter} from "@nextui-org/system-rsc";
import {badge} from "@nextui-org/theme";
import {HTMLNextUIProps, PropGetter} from "@nextui-org/system/types";
import {mapPropsVariants} from "@nextui-org/system/utils";
import {mapPropsVariants} from "@nextui-org/system-rsc";
import {clsx} from "@nextui-org/shared-utils";
import {ReactRef} from "@nextui-org/react-utils";
import {useMemo} from "react";

View File

@ -10,7 +10,7 @@ export {useButton} from "./use-button";
export {useButtonGroup} from "./use-button-group";
// export context
export * from "./button-group-context";
export {ButtonGroupProvider, useButtonGroupContext} from "./button-group-context";
// export component
export {Button, ButtonGroup};

View File

@ -6,7 +6,7 @@ export type {CardFooterProps} from "./card-footer";
export {useCard} from "./use-card";
// export context
export * from "./card-context";
export {CardProvider, useCardContext} from "./card-context";
// export components
export {default as Card} from "./card";

View File

@ -11,8 +11,8 @@ export type {CheckboxGroupProps} from "./checkbox-group";
export type {CheckboxIconProps} from "./use-checkbox";
// export context
export * from "./checkbox-group-context";
export {CheckboxGroupProvider, useCheckboxGroupContext} from "./checkbox-group-context";
// export components
export {Checkbox, CheckboxGroup};
export * from "./checkbox-icon";
export {CheckboxIcon} from "./checkbox-icon";

View File

@ -37,7 +37,7 @@
"react": ">=18"
},
"dependencies": {
"@nextui-org/system": "workspace:*",
"@nextui-org/system-rsc": "workspace:*",
"@nextui-org/theme": "workspace:*",
"@nextui-org/shared-utils": "workspace:*",
"@nextui-org/react-utils": "workspace:*"

View File

@ -1,4 +1,4 @@
import {forwardRef} from "@nextui-org/system/utils";
import {forwardRef} from "@nextui-org/system-rsc";
import {useCode, UseCodeProps} from "./use-code";

View File

@ -1,8 +1,8 @@
import type {CodeVariantProps} from "@nextui-org/theme";
import type {HTMLNextUIProps, PropGetter} from "@nextui-org/system-rsc";
import {code} from "@nextui-org/theme";
import {HTMLNextUIProps, PropGetter} from "@nextui-org/system/types";
import {mapPropsVariants} from "@nextui-org/system/utils";
import {mapPropsVariants} from "@nextui-org/system-rsc";
import {ReactRef} from "@nextui-org/react-utils";
import {useMemo} from "react";

View File

@ -39,7 +39,7 @@
"dependencies": {
"@nextui-org/shared-utils": "workspace:*",
"@nextui-org/react-rsc-utils": "workspace:*",
"@nextui-org/system": "workspace:*",
"@nextui-org/system-rsc": "workspace:*",
"@nextui-org/theme": "workspace:*",
"@react-types/shared": "^3.18.1"
},

View File

@ -1,4 +1,4 @@
import {forwardRef} from "@nextui-org/system/utils";
import {forwardRef} from "@nextui-org/system-rsc";
import {UseDividerProps, useDivider} from "./use-divider";

View File

@ -1,6 +1,6 @@
import type {DividerVariantProps} from "@nextui-org/theme";
import type {HTMLNextUIProps, PropGetter} from "@nextui-org/system-rsc";
import {HTMLNextUIProps, PropGetter} from "@nextui-org/system/types";
import {divider} from "@nextui-org/theme";
import {Ref, useCallback, useMemo} from "react";

View File

@ -37,7 +37,7 @@
"react": ">=18"
},
"dependencies": {
"@nextui-org/system": "workspace:*",
"@nextui-org/system-rsc": "workspace:*",
"@nextui-org/theme": "workspace:*",
"@nextui-org/shared-utils": "workspace:*",
"@nextui-org/react-utils": "workspace:*",

View File

@ -1,5 +1,5 @@
import {useMemo} from "react";
import {forwardRef} from "@nextui-org/system/utils";
import {forwardRef} from "@nextui-org/system-rsc";
import {UseKbdProps, useKbd} from "./use-kbd";
import {kbdKeysLabelMap, kbdKeysMap} from "./utils";

View File

@ -1,7 +1,7 @@
import type {KbdVariantProps, KbdSlots, SlotsToClasses} from "@nextui-org/theme";
import type {HTMLNextUIProps, PropGetter} from "@nextui-org/system-rsc";
import {HTMLNextUIProps, PropGetter} from "@nextui-org/system/types";
import {mapPropsVariants} from "@nextui-org/system/utils";
import {mapPropsVariants} from "@nextui-org/system-rsc";
import {kbd} from "@nextui-org/theme";
import {clsx} from "@nextui-org/shared-utils";
import {ReactRef} from "@nextui-org/react-utils";

View File

@ -10,13 +10,14 @@ export type {ModalContentProps} from "./modal-content";
export type {ModalHeaderProps} from "./modal-header";
export type {ModalBodyProps} from "./modal-body";
export type {ModalFooterProps} from "./modal-footer";
export type {UseDisclosureProps} from "@nextui-org/use-disclosure";
// export hooks
export {useModal} from "./use-modal";
export * from "@nextui-org/use-disclosure";
export {useDisclosure} from "@nextui-org/use-disclosure";
// export context
export * from "./modal-context";
export {ModalProvider, useModalContext} from "./modal-context";
// export components
export {Modal, ModalContent, ModalHeader, ModalBody, ModalFooter};

View File

@ -11,7 +11,7 @@ export type {NavbarMenuItemProps} from "./navbar-menu-item";
export {useNavbar} from "./use-navbar";
// export context
export * from "./navbar-context";
export {NavbarProvider, useNavbarContext} from "./navbar-context";
// export components
export {default as Navbar} from "./navbar";

View File

@ -11,7 +11,7 @@ export type {PopoverContentProps} from "./popover-content";
export {usePopover} from "./use-popover";
// export context
export * from "./popover-context";
export {PopoverProvider, usePopoverContext} from "./popover-context";
// export components
export {Popover, PopoverTrigger, PopoverContent};

View File

@ -10,7 +10,7 @@ export {useRadio} from "./use-radio";
export {useRadioGroup} from "./use-radio-group";
// export context
export * from "./radio-group-context";
export {RadioGroupProvider, useRadioGroupContext} from "./radio-group-context";
// export component
export {Radio, RadioGroup};

View File

@ -37,7 +37,7 @@
"react": ">=18"
},
"dependencies": {
"@nextui-org/system": "workspace:*",
"@nextui-org/system-rsc": "workspace:*",
"@nextui-org/theme": "workspace:*",
"@nextui-org/shared-utils": "workspace:*",
"@nextui-org/react-utils": "workspace:*"

View File

@ -1,4 +1,4 @@
import {forwardRef} from "@nextui-org/system/utils";
import {forwardRef} from "@nextui-org/system-rsc";
import {UseSkeletonProps, useSkeleton} from "./use-skeleton";

View File

@ -1,7 +1,7 @@
import type {SkeletonVariantProps, SkeletonSlots, SlotsToClasses} from "@nextui-org/theme";
import type {HTMLNextUIProps, PropGetter} from "@nextui-org/system/types";
import type {HTMLNextUIProps, PropGetter} from "@nextui-org/system-rsc";
import {mapPropsVariants} from "@nextui-org/system/utils";
import {mapPropsVariants} from "@nextui-org/system-rsc";
import {skeleton} from "@nextui-org/theme";
import {clsx, dataAttr} from "@nextui-org/shared-utils";
import {useMemo, Ref} from "react";

View File

@ -37,7 +37,7 @@
"react": ">=18"
},
"dependencies": {
"@nextui-org/system": "workspace:*",
"@nextui-org/system-rsc": "workspace:*",
"@nextui-org/theme": "workspace:*",
"@nextui-org/shared-utils": "workspace:*",
"@nextui-org/react-utils": "workspace:*"

View File

@ -1,4 +1,4 @@
import {forwardRef} from "@nextui-org/system/utils";
import {forwardRef} from "@nextui-org/system-rsc";
import {UseSpacerProps, useSpacer} from "./use-spacer";

View File

@ -1,7 +1,7 @@
import type {SpacerVariantProps} from "@nextui-org/theme";
import type {HTMLNextUIProps, PropGetter} from "@nextui-org/system-rsc";
import {HTMLNextUIProps, PropGetter} from "@nextui-org/system/types";
import {mapPropsVariants} from "@nextui-org/system/utils";
import {mapPropsVariants} from "@nextui-org/system-rsc";
import {spacer} from "@nextui-org/theme";
import {clsx, dataAttr} from "@nextui-org/shared-utils";
import {ReactRef} from "@nextui-org/react-utils";

View File

@ -39,7 +39,7 @@
"react": ">=18"
},
"dependencies": {
"@nextui-org/system": "workspace:*",
"@nextui-org/system-rsc": "workspace:*",
"@nextui-org/theme": "workspace:*",
"@nextui-org/shared-utils": "workspace:*",
"@nextui-org/react-utils": "workspace:*"

View File

@ -1,4 +1,4 @@
import {forwardRef} from "@nextui-org/system/utils";
import {forwardRef} from "@nextui-org/system-rsc";
import {UseSpinnerProps, useSpinner} from "./use-spinner";

View File

@ -1,7 +1,7 @@
import type {SpinnerVariantProps, SpinnerSlots, SlotsToClasses} from "@nextui-org/theme";
import type {HTMLNextUIProps, PropGetter} from "@nextui-org/system/types";
import type {HTMLNextUIProps, PropGetter} from "@nextui-org/system-rsc";
import {mapPropsVariants} from "@nextui-org/system/utils";
import {mapPropsVariants} from "@nextui-org/system-rsc";
import {spinner} from "@nextui-org/theme";
import {clsx} from "@nextui-org/shared-utils";
import {useMemo, useCallback, Ref} from "react";

View File

@ -16,4 +16,7 @@ export {getKeyValue} from "@nextui-org/shared-utils";
// export component
export {default as Table} from "./table";
export * from "./base";
// export base components
export {TableBody, TableCell, TableColumn, TableHeader, TableRow} from "./base";
export type {TableBodyProps, TableCellProps, TableColumnProps, TableHeaderProps} from "./base";

View File

@ -0,0 +1,24 @@
# @nextui-org/system-rsc
A Quick description of the component
> This is an internal utility, not intended for public usage.
## Installation
```sh
yarn add @nextui-org/system-rsc
# or
npm i @nextui-org/system-rsc
```
## Contribution
Yes please! See the
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
for details.
## Licence
This project is licensed under the terms of the
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).

View File

@ -0,0 +1,58 @@
{
"name": "@nextui-org/system-rsc",
"version": "2.0.2",
"description": "NextUI system primitives compatibles with RSC imports",
"keywords": [
"system-rsc"
],
"author": "Junior Garcia <jrgarciadev@gmail.com>",
"homepage": "https://nextui.org",
"license": "MIT",
"main": "src/index.ts",
"sideEffects": false,
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/nextui-org/nextui.git",
"directory": "packages/core/system-rsc"
},
"bugs": {
"url": "https://github.com/nextui-org/nextui/issues"
},
"scripts": {
"build": "tsup src --dts",
"build:fast": "tsup src",
"dev": "yarn build:fast -- --watch",
"clean": "rimraf dist .turbo",
"typecheck": "tsc --noEmit",
"prepack": "clean-package",
"postpack": "clean-package restore"
},
"peerDependencies": {
"react": ">=18"
},
"devDependencies": {
"react": "^18.0.0",
"@nextui-org/theme": "workspace:*",
"@nextui-org/react-utils": "workspace:*",
"clean-package": "2.2.0"
},
"dependencies": {
"tailwind-variants": "^0.1.13",
"clsx": "^1.2.1"
},
"clean-package": "../../../clean-package.config.json",
"tsup": {
"clean": true,
"target": "es2019",
"format": [
"cjs",
"esm"
]
}
}

View File

@ -0,0 +1,3 @@
export * from "./types";
export * from "./utils";
export * from "./extend-variants";

View File

@ -0,0 +1,13 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"outDir": "dist",
"allowJs": true,
"baseUrl": "./",
"paths": {
"tailwind-variants": ["../../../node_modules/tailwind-variants"]
}
},
"include": ["src", "index.ts"],
"exclude": ["node_modules", "dist"]
}

View File

@ -44,8 +44,7 @@
},
"devDependencies": {
"clean-package": "2.2.0",
"react": "^18.0.0",
"@nextui-org/react-utils": "workspace:*"
"react": "^18.0.0"
},
"clean-package": "../../../clean-package.config.json",
"tsup": {
@ -57,10 +56,8 @@
]
},
"dependencies": {
"@nextui-org/theme": "workspace:*",
"tailwind-variants": "^0.1.13",
"@nextui-org/system-rsc": "workspace:*",
"@react-aria/i18n": "^3.8.0",
"@react-aria/overlays": "^3.15.0",
"clsx": "^1.2.1"
"@react-aria/overlays": "^3.15.0"
}
}

View File

@ -1,4 +1,3 @@
export * from "./types";
export * from "./utils";
export * from "./provider";
export * from "./extend-variants";
export * from "@nextui-org/system-rsc";

45
pnpm-lock.yaml generated
View File

@ -693,9 +693,9 @@ importers:
'@nextui-org/shared-utils':
specifier: workspace:*
version: link:../../utilities/shared-utils
'@nextui-org/system':
'@nextui-org/system-rsc':
specifier: workspace:*
version: link:../../core/system
version: link:../../core/system-rsc
'@nextui-org/theme':
specifier: workspace:*
version: link:../../core/theme
@ -935,9 +935,9 @@ importers:
'@nextui-org/shared-utils':
specifier: workspace:*
version: link:../../utilities/shared-utils
'@nextui-org/system':
'@nextui-org/system-rsc':
specifier: workspace:*
version: link:../../core/system
version: link:../../core/system-rsc
'@nextui-org/theme':
specifier: workspace:*
version: link:../../core/theme
@ -957,9 +957,9 @@ importers:
'@nextui-org/shared-utils':
specifier: workspace:*
version: link:../../utilities/shared-utils
'@nextui-org/system':
'@nextui-org/system-rsc':
specifier: workspace:*
version: link:../../core/system
version: link:../../core/system-rsc
'@nextui-org/theme':
specifier: workspace:*
version: link:../../core/theme
@ -1129,9 +1129,9 @@ importers:
'@nextui-org/shared-utils':
specifier: workspace:*
version: link:../../utilities/shared-utils
'@nextui-org/system':
'@nextui-org/system-rsc':
specifier: workspace:*
version: link:../../core/system
version: link:../../core/system-rsc
'@nextui-org/theme':
specifier: workspace:*
version: link:../../core/theme
@ -1573,9 +1573,9 @@ importers:
'@nextui-org/shared-utils':
specifier: workspace:*
version: link:../../utilities/shared-utils
'@nextui-org/system':
'@nextui-org/system-rsc':
specifier: workspace:*
version: link:../../core/system
version: link:../../core/system-rsc
'@nextui-org/theme':
specifier: workspace:*
version: link:../../core/theme
@ -1638,9 +1638,9 @@ importers:
'@nextui-org/shared-utils':
specifier: workspace:*
version: link:../../utilities/shared-utils
'@nextui-org/system':
'@nextui-org/system-rsc':
specifier: workspace:*
version: link:../../core/system
version: link:../../core/system-rsc
'@nextui-org/theme':
specifier: workspace:*
version: link:../../core/theme
@ -1660,9 +1660,9 @@ importers:
'@nextui-org/shared-utils':
specifier: workspace:*
version: link:../../utilities/shared-utils
'@nextui-org/system':
'@nextui-org/system-rsc':
specifier: workspace:*
version: link:../../core/system
version: link:../../core/system-rsc
'@nextui-org/theme':
specifier: workspace:*
version: link:../../core/theme
@ -2078,15 +2078,25 @@ importers:
packages/core/system:
dependencies:
'@nextui-org/theme':
'@nextui-org/system-rsc':
specifier: workspace:*
version: link:../theme
version: link:../system-rsc
'@react-aria/i18n':
specifier: ^3.8.0
version: 3.8.0(react@18.2.0)
'@react-aria/overlays':
specifier: ^3.15.0
version: 3.15.0(react-dom@18.2.0)(react@18.2.0)
devDependencies:
clean-package:
specifier: 2.2.0
version: 2.2.0
react:
specifier: ^18.2.0
version: 18.2.0
packages/core/system-rsc:
dependencies:
clsx:
specifier: ^1.2.1
version: 1.2.1
@ -2097,6 +2107,9 @@ importers:
'@nextui-org/react-utils':
specifier: workspace:*
version: link:../../utilities/react-utils
'@nextui-org/theme':
specifier: workspace:*
version: link:../theme
clean-package:
specifier: 2.2.0
version: 2.2.0