NextUI Components
diff --git a/packages/components/dropdown/package.json b/packages/components/dropdown/package.json
index 37037bfb15..6116a1ec85 100644
--- a/packages/components/dropdown/package.json
+++ b/packages/components/dropdown/package.json
@@ -1,6 +1,6 @@
{
"name": "@nextui-org/dropdown",
- "version": "0.0.0-dev-v2-20230729132654",
+ "version": "0.0.0-dev-v2-20230729152229",
"description": "A dropdown displays a list of actions or options that a user can choose.",
"keywords": [
"dropdown"
diff --git a/packages/components/dropdown/src/dropdown-item.tsx b/packages/components/dropdown/src/dropdown-item.tsx
index 797bac270f..86f409de50 100644
--- a/packages/components/dropdown/src/dropdown-item.tsx
+++ b/packages/components/dropdown/src/dropdown-item.tsx
@@ -1,4 +1,5 @@
-import {useMemo, ReactNode, forwardRef} from "react";
+import {useMemo, ReactNode} from "react";
+import {forwardRef} from "@nextui-org/system";
import {UseDropdownItemProps, useDropdownItem} from "./use-dropdown-item";
import {DropdownSelectedIcon} from "./dropdown-selected-icon";
@@ -8,7 +9,7 @@ export interface DropdownItemProps
extends UseDropdow
/**
* @internal
*/
-const DropdownItem = forwardRef((props, _) => {
+const DropdownItem = forwardRef<"li", DropdownItemProps>((props, _) => {
const {
Component,
slots,
diff --git a/packages/components/dropdown/src/dropdown-menu.tsx b/packages/components/dropdown/src/dropdown-menu.tsx
index 6d4621d01e..8fe5c0d2ba 100644
--- a/packages/components/dropdown/src/dropdown-menu.tsx
+++ b/packages/components/dropdown/src/dropdown-menu.tsx
@@ -6,8 +6,8 @@ import {AriaMenuProps} from "@react-types/menu";
import {useTreeState} from "@react-stately/tree";
import {dropdownMenu} from "@nextui-org/theme";
import {FocusScope} from "@react-aria/focus";
-import {useMemo, forwardRef} from "react";
-import {HTMLNextUIProps} from "@nextui-org/system";
+import {useMemo} from "react";
+import {HTMLNextUIProps, forwardRef} from "@nextui-org/system";
import DropdownSection from "./dropdown-section";
import DropdownItem, {DropdownItemProps} from "./dropdown-item";
@@ -42,7 +42,7 @@ export interface DropdownMenuProps
itemClasses?: DropdownItemProps["classNames"];
}
-const DropdownMenu = forwardRef(
+const DropdownMenu = forwardRef<"ul", DropdownMenuProps>(
(
{
as,
diff --git a/packages/components/dropdown/src/dropdown-section.tsx b/packages/components/dropdown/src/dropdown-section.tsx
index b518ee4cbe..835b43c686 100644
--- a/packages/components/dropdown/src/dropdown-section.tsx
+++ b/packages/components/dropdown/src/dropdown-section.tsx
@@ -2,7 +2,8 @@ import {dropdownSection} from "@nextui-org/theme";
import {Node} from "@react-types/shared";
import {TreeState} from "@react-stately/tree";
import {useMenuSection} from "@react-aria/menu";
-import {useMemo, Key, forwardRef} from "react";
+import {useMemo, Key} from "react";
+import {forwardRef} from "@nextui-org/system";
import {mergeProps} from "@react-aria/utils";
import {clsx} from "@nextui-org/shared-utils";
import {Divider} from "@nextui-org/divider";
@@ -40,7 +41,7 @@ export interface DropdownSectionProps extends Dropdow
/**
* @internal
*/
-const DropdownSection = forwardRef(
+const DropdownSection = forwardRef<"li", DropdownSectionProps>(
(
{
item,
diff --git a/packages/components/dropdown/src/dropdown-trigger.tsx b/packages/components/dropdown/src/dropdown-trigger.tsx
index 2342acc1ab..5217e188d3 100644
--- a/packages/components/dropdown/src/dropdown-trigger.tsx
+++ b/packages/components/dropdown/src/dropdown-trigger.tsx
@@ -1,4 +1,4 @@
-import {forwardRef} from "react";
+import {forwardRef} from "@nextui-org/system";
import {PopoverTrigger} from "@nextui-org/popover";
import {useDropdownContext} from "./dropdown-context";
@@ -11,7 +11,7 @@ export interface DropdownTriggerProps {
* DropdownTrigger opens the popover's content. It must be an interactive element
* such as `button` or `a`.
*/
-const DropdownTrigger = forwardRef((props, _) => {
+const DropdownTrigger = forwardRef<"button", DropdownTriggerProps>((props, _) => {
const {getMenuTriggerProps} = useDropdownContext();
const {children, ...otherProps} = props;
diff --git a/packages/components/dropdown/src/use-dropdown.ts b/packages/components/dropdown/src/use-dropdown.ts
index d9d39cfff5..040cc340e2 100644
--- a/packages/components/dropdown/src/use-dropdown.ts
+++ b/packages/components/dropdown/src/use-dropdown.ts
@@ -10,8 +10,7 @@ import {PopoverProps} from "@nextui-org/popover";
import {useMemo, useRef} from "react";
import {mergeProps} from "@react-aria/utils";
-export interface UseDropdownProps
- extends HTMLNextUIProps<"div", Omit> {
+interface Props extends HTMLNextUIProps<"div"> {
/**
* Type of overlay that is opened by the trigger.
*/
@@ -37,6 +36,8 @@ export interface UseDropdownProps
closeOnSelect?: boolean;
}
+export type UseDropdownProps = Props & Omit;
+
export function useDropdown(props: UseDropdownProps) {
const {
as,
diff --git a/packages/components/dropdown/stories/dropdown.stories.tsx b/packages/components/dropdown/stories/dropdown.stories.tsx
index c16494cdc9..9b50ecb136 100644
--- a/packages/components/dropdown/stories/dropdown.stories.tsx
+++ b/packages/components/dropdown/stories/dropdown.stories.tsx
@@ -1,5 +1,5 @@
import React from "react";
-import {ComponentStory, ComponentMeta} from "@storybook/react";
+import {ComponentMeta} from "@storybook/react";
import {dropdown, popover} from "@nextui-org/theme";
import {Button} from "@nextui-org/button";
import {Avatar} from "@nextui-org/avatar";
@@ -113,11 +113,7 @@ const defaultProps = {
disableAnimation: false,
};
-const Template: ComponentStory = ({
- color,
- variant,
- ...args
-}: DropdownProps & DropdownMenuProps) => (
+const Template = ({color, variant, ...args}: DropdownProps & DropdownMenuProps) => (
@@ -133,11 +129,7 @@ const Template: ComponentStory = ({
);
-const DividerTemplate: ComponentStory = ({
- color,
- variant,
- ...args
-}: DropdownProps & DropdownMenuProps) => (
+const DividerTemplate = ({color, variant, ...args}: DropdownProps & DropdownMenuProps) => (
@@ -153,11 +145,7 @@ const DividerTemplate: ComponentStory = ({
);
-const DisabledKeysTemplate: ComponentStory = ({
- color,
- variant,
- ...args
-}: DropdownProps & DropdownMenuProps) => (
+const DisabledKeysTemplate = ({color, variant, ...args}: DropdownProps & DropdownMenuProps) => (
@@ -179,11 +167,7 @@ const DisabledKeysTemplate: ComponentStory = ({
);
-const SingleSelectionTemplate: ComponentStory = ({
- color,
- variant,
- ...args
-}: DropdownProps & DropdownMenuProps) => {
+const SingleSelectionTemplate = ({color, variant, ...args}: DropdownProps & DropdownMenuProps) => {
const [selected, setSelected] = React.useState>(new Set(["text"]));
const selectedValue = React.useMemo(
@@ -218,7 +202,7 @@ const SingleSelectionTemplate: ComponentStory = ({
);
};
-const MultipleSelectionTemplate: ComponentStory = ({
+const MultipleSelectionTemplate = ({
color,
variant,
...args
@@ -258,7 +242,7 @@ const MultipleSelectionTemplate: ComponentStory = ({
);
};
-const WithShortcutTemplate: ComponentStory = ({color, variant, ...args}) => (
+const WithShortcutTemplate = ({color, variant, ...args}) => (
@@ -280,12 +264,12 @@ const WithShortcutTemplate: ComponentStory = ({color, variant, ...args}) =>
);
-const WithStartContentTemplate: ComponentStory = ({
+const WithStartContentTemplate = ({
color,
variant,
disableAnimation,
...args
-}) => {
+}: DropdownProps & DropdownMenuProps) => {
const iconClasses = "text-2xl text-secondary pointer-events-none flex-shrink-0";
return (
@@ -331,12 +315,7 @@ const WithStartContentTemplate: ComponentStory = ({
);
};
-const WithEndContentTemplate: ComponentStory = ({
- color,
- variant,
- disableAnimation,
- ...args
-}) => {
+const WithEndContentTemplate = ({color, variant, disableAnimation, ...args}) => {
const iconClasses = "text-2xl text-default-500 pointer-events-none flex-shrink-0";
return (
@@ -369,12 +348,7 @@ const WithEndContentTemplate: ComponentStory = ({
);
};
-const WithDescriptionTemplate: ComponentStory = ({
- color,
- variant,
- disableAnimation,
- ...args
-}) => {
+const WithDescriptionTemplate = ({color, variant, disableAnimation, ...args}) => {
const iconClasses = "text-2xl text-secondary pointer-events-none flex-shrink-0";
return (
@@ -424,7 +398,7 @@ const WithDescriptionTemplate: ComponentStory = ({
);
};
-const WithSectionsTemplate: ComponentStory = ({color, variant, disableAnimation, ...args}) => {
+const WithSectionsTemplate = ({color, variant, disableAnimation, ...args}) => {
const iconClasses = "text-2xl text-secondary pointer-events-none flex-shrink-0";
return (
@@ -484,7 +458,7 @@ const WithSectionsTemplate: ComponentStory = ({color, variant, disableAnima
);
};
-const CustomTriggerTemplate: ComponentStory = ({variant, ...args}) => {
+const CustomTriggerTemplate = ({variant, ...args}) => {
return (
diff --git a/packages/components/image/package.json b/packages/components/image/package.json
index d89aed85c7..9ed43b9ae8 100644
--- a/packages/components/image/package.json
+++ b/packages/components/image/package.json
@@ -1,6 +1,6 @@
{
"name": "@nextui-org/image",
- "version": "0.0.0-dev-v2-20230729132654",
+ "version": "0.0.0-dev-v2-20230729152229",
"description": "A simple image component",
"keywords": [
"image"
diff --git a/packages/components/image/src/image.tsx b/packages/components/image/src/image.tsx
index d99bad2750..1a242bf836 100644
--- a/packages/components/image/src/image.tsx
+++ b/packages/components/image/src/image.tsx
@@ -1,10 +1,11 @@
-import {cloneElement, forwardRef} from "react";
+import {cloneElement} from "react";
+import {forwardRef} from "@nextui-org/system";
import {UseImageProps, useImage} from "./use-image";
-export interface ImageProps extends Omit {}
+export interface ImageProps extends Omit {}
-const Image = forwardRef((props, ref) => {
+const Image = forwardRef<"img", ImageProps>((props, ref) => {
const {
Component,
domRef,
@@ -19,8 +20,8 @@ const Image = forwardRef((props, ref) => {
getWrapperProps,
getBlurredImgProps,
} = useImage({
- ref,
...props,
+ ref,
});
const img = ;
diff --git a/packages/components/image/stories/image.stories.tsx b/packages/components/image/stories/image.stories.tsx
index bd6cc2fa1c..dcbec31a66 100644
--- a/packages/components/image/stories/image.stories.tsx
+++ b/packages/components/image/stories/image.stories.tsx
@@ -1,5 +1,5 @@
import React from "react";
-import {ComponentStory, ComponentMeta} from "@storybook/react";
+import {ComponentMeta} from "@storybook/react";
import {image} from "@nextui-org/theme";
import {Image, ImageProps} from "../src";
@@ -52,9 +52,9 @@ const defaultProps = {
disableSkeleton: true,
};
-const Template: ComponentStory = (args: ImageProps) => ;
+const Template = (args: ImageProps) => ;
-const LoadingTemplate: ComponentStory = (args: ImageProps) => {
+const LoadingTemplate = (args: ImageProps) => {
const [isLoading, setIsLoading] = React.useState(true);
React.useEffect(() => {
diff --git a/packages/components/input/package.json b/packages/components/input/package.json
index a04c313b7c..c703d3e486 100644
--- a/packages/components/input/package.json
+++ b/packages/components/input/package.json
@@ -1,6 +1,6 @@
{
"name": "@nextui-org/input",
- "version": "0.0.0-dev-v2-20230729132654",
+ "version": "0.0.0-dev-v2-20230729152229",
"description": "The input component is designed for capturing user input within a text field.",
"keywords": [
"input"
diff --git a/packages/components/input/src/input.tsx b/packages/components/input/src/input.tsx
index 9c654f833a..ef05772415 100644
--- a/packages/components/input/src/input.tsx
+++ b/packages/components/input/src/input.tsx
@@ -1,12 +1,12 @@
import {CloseFilledIcon} from "@nextui-org/shared-icons";
-import {useMemo, forwardRef} from "react";
+import {useMemo} from "react";
+import {forwardRef} from "@nextui-org/system";
import {UseInputProps, useInput} from "./use-input";
-export interface InputProps
- extends Omit {}
+export interface InputProps extends Omit {}
-const Input = forwardRef((props, ref) => {
+const Input = forwardRef<"input", InputProps>((props, ref) => {
const {
Component,
label,
@@ -30,7 +30,7 @@ const Input = forwardRef((props, ref) => {
getDescriptionProps,
getErrorMessageProps,
getClearButtonProps,
- } = useInput({ref, ...props});
+ } = useInput({...props, ref});
const labelContent = label ? : null;
diff --git a/packages/components/input/src/textarea.tsx b/packages/components/input/src/textarea.tsx
index 56874fec9a..54d685735c 100644
--- a/packages/components/input/src/textarea.tsx
+++ b/packages/components/input/src/textarea.tsx
@@ -1,4 +1,4 @@
-import {forwardRef} from "react";
+import {forwardRef} from "@nextui-org/system";
import {mergeProps} from "@react-aria/utils";
import TextareaAutosize from "react-textarea-autosize";
@@ -24,7 +24,7 @@ export type TextareaHeightChangeMeta = {
rowHeight: number;
};
-export interface TextAreaProps extends Omit {
+export interface TextAreaProps extends Omit {
/**
* Minimum number of rows to show for textarea
* @default 3
@@ -51,7 +51,7 @@ export interface TextAreaProps extends Omit void;
}
-const Textarea = forwardRef(
+const Textarea = forwardRef<"textarea", TextAreaProps>(
(
{style, minRows = 3, maxRows = 8, cacheMeasurements = false, onHeightChange, ...otherProps},
ref,
@@ -70,7 +70,7 @@ const Textarea = forwardRef(
getHelperWrapperProps,
getDescriptionProps,
getErrorMessageProps,
- } = useInput({ref, ...otherProps, isMultiline: true});
+ } = useInput({...otherProps, ref, isMultiline: true});
const labelContent = ;
const inputProps = getInputProps();
diff --git a/packages/components/input/stories/input.stories.tsx b/packages/components/input/stories/input.stories.tsx
index 779a9c286c..10cb091869 100644
--- a/packages/components/input/stories/input.stories.tsx
+++ b/packages/components/input/stories/input.stories.tsx
@@ -1,7 +1,7 @@
/* eslint-disable jsx-a11y/interactive-supports-focus */
/* eslint-disable jsx-a11y/click-events-have-key-events */
import React from "react";
-import {ComponentStory, ComponentMeta} from "@storybook/react";
+import {ComponentMeta} from "@storybook/react";
import {input} from "@nextui-org/theme";
import {
MailFilledIcon,
@@ -11,7 +11,7 @@ import {
CloseFilledIcon,
} from "@nextui-org/shared-icons";
-import {Input, useInput} from "../src";
+import {Input, InputProps, useInput} from "../src";
export default {
title: "Components/Input",
@@ -67,20 +67,20 @@ const defaultProps = {
label: "Email",
};
-const Template: ComponentStory = (args) => (
+const Template = (args) => (
);
-const MirrorTemplate: ComponentStory = (args) => (
+const MirrorTemplate = (args) => (
);
-const PasswordTemplate: ComponentStory = (args) => {
+const PasswordTemplate = (args) => {
const [isPasswordVisible, setIsPasswordVisible] = React.useState(false);
const togglePasswordVisibility = () => setIsPasswordVisible(!isPasswordVisible);
@@ -109,7 +109,7 @@ const PasswordTemplate: ComponentStory = (args) => {
);
};
-const RegexValidationTemplate: ComponentStory = (args) => {
+const RegexValidationTemplate = (args) => {
const [value, setValue] = React.useState("");
const validateEmail = (value) => value.match(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}$/i);
@@ -134,7 +134,7 @@ const RegexValidationTemplate: ComponentStory = (args) => {
);
};
-const ControlledTemplate: ComponentStory = (args) => {
+const ControlledTemplate = (args) => {
const [value, setValue] = React.useState("");
return (
@@ -145,7 +145,7 @@ const ControlledTemplate: ComponentStory = (args) => {
);
};
-const LabelPlacementTemplate: ComponentStory = (args) => (
+const LabelPlacementTemplate = (args) => (
Without placeholder
@@ -166,7 +166,7 @@ const LabelPlacementTemplate: ComponentStory = (args) => (
);
-const StartContentTemplate: ComponentStory
= (args) => (
+const StartContentTemplate = (args) => (
= (args) => (
);
-const EndContentTemplate: ComponentStory = (args) => (
+const EndContentTemplate = (args) => (
= (args) => (
);
-const StartAndEndContentTemplate: ComponentStory = (args) => (
+const StartAndEndContentTemplate = (args) => (
= (args) => (
);
-const InputTypesTemplate: ComponentStory = (args) => (
+const InputTypesTemplate = (args) => (
@@ -311,7 +311,7 @@ const InputTypesTemplate: ComponentStory = (args) => (
);
-const CustomWithClassNamesTemplate: ComponentStory = (args) => (
+const CustomWithClassNamesTemplate = (args) => (
= (args) => (
);
-const CustomWithHooksTemplate: ComponentStory = (args) => {
+const CustomWithHooksTemplate = (args: InputProps) => {
const {
Component,
label,
diff --git a/packages/components/input/stories/textarea.stories.tsx b/packages/components/input/stories/textarea.stories.tsx
index 2a375ad0a9..420d74d2a6 100644
--- a/packages/components/input/stories/textarea.stories.tsx
+++ b/packages/components/input/stories/textarea.stories.tsx
@@ -1,5 +1,5 @@
import React from "react";
-import {ComponentStory, ComponentMeta} from "@storybook/react";
+import {ComponentMeta} from "@storybook/react";
import {input} from "@nextui-org/theme";
import {Textarea, TextAreaProps} from "../src";
@@ -59,13 +59,13 @@ const defaultProps = {
placeholder: "Enter your description",
};
-const Template: ComponentStory = (args: TextAreaProps) => (
+const Template = (args: TextAreaProps) => (
);
-const MinRowsTemplate: ComponentStory = (args: TextAreaProps) => (
+const MinRowsTemplate = (args: TextAreaProps) => (
@@ -73,7 +73,7 @@ const MinRowsTemplate: ComponentStory = (args: TextAreaProps) =
);
-const MaxRowsTemplate: ComponentStory = (args: TextAreaProps) => (
+const MaxRowsTemplate = (args: TextAreaProps) => (
diff --git a/packages/components/kbd/package.json b/packages/components/kbd/package.json
index eca167c3b6..2004db6d77 100644
--- a/packages/components/kbd/package.json
+++ b/packages/components/kbd/package.json
@@ -1,6 +1,6 @@
{
"name": "@nextui-org/kbd",
- "version": "0.0.0-dev-v2-20230729132654",
+ "version": "0.0.0-dev-v2-20230729152229",
"description": "The keyboard key components indicates which key or set of keys used to execute a specificv action",
"keywords": [
"kbd"
diff --git a/packages/components/kbd/src/kbd.tsx b/packages/components/kbd/src/kbd.tsx
index d19a3746f7..944730c690 100644
--- a/packages/components/kbd/src/kbd.tsx
+++ b/packages/components/kbd/src/kbd.tsx
@@ -1,14 +1,15 @@
-import {useMemo, forwardRef} from "react";
+import {useMemo} from "react";
+import {forwardRef} from "@nextui-org/system";
import {UseKbdProps, useKbd} from "./use-kbd";
import {kbdKeysLabelMap, kbdKeysMap} from "./utils";
-export interface KbdProps extends Omit
{}
+export interface KbdProps extends UseKbdProps {}
-const Kbd = forwardRef((props, ref) => {
+const Kbd = forwardRef<"kbd", KbdProps>((props, ref) => {
const {Component, children, slots, classNames, keysToRender, getKbdProps} = useKbd({
- ref,
...props,
+ ref,
});
const keysContent = useMemo(() => {
diff --git a/packages/components/kbd/src/use-kbd.ts b/packages/components/kbd/src/use-kbd.ts
index 50a486df31..d936a11c72 100644
--- a/packages/components/kbd/src/use-kbd.ts
+++ b/packages/components/kbd/src/use-kbd.ts
@@ -10,7 +10,7 @@ import {mergeProps} from "@react-aria/utils";
import {KbdKey} from "./utils";
-export interface UseKbdProps extends HTMLNextUIProps<"kbd", KbdVariantProps> {
+interface Props extends HTMLNextUIProps<"kbd"> {
/**
* Ref to the DOM node.
*/
@@ -35,6 +35,8 @@ export interface UseKbdProps extends HTMLNextUIProps<"kbd", KbdVariantProps> {
classNames?: SlotsToClasses;
}
+export type UseKbdProps = Props & KbdVariantProps;
+
export function useKbd(originalProps: UseKbdProps) {
const [props, variantProps] = mapPropsVariants(originalProps, kbd.variantKeys);
diff --git a/packages/components/kbd/stories/kbd.stories.tsx b/packages/components/kbd/stories/kbd.stories.tsx
index 24063f1f84..d0b695bf42 100644
--- a/packages/components/kbd/stories/kbd.stories.tsx
+++ b/packages/components/kbd/stories/kbd.stories.tsx
@@ -1,5 +1,5 @@
import React from "react";
-import {ComponentStory, ComponentMeta} from "@storybook/react";
+import {ComponentMeta} from "@storybook/react";
import {kbd} from "@nextui-org/theme";
import {Kbd, KbdProps} from "../src";
@@ -42,7 +42,7 @@ const defaultProps = {
keys: ["command"],
};
-const Template: ComponentStory = (args: KbdProps) => ;
+const Template = (args: KbdProps) => ;
export const Default = Template.bind({});
Default.args = {
diff --git a/packages/components/link/package.json b/packages/components/link/package.json
index 45204efd24..c764712852 100644
--- a/packages/components/link/package.json
+++ b/packages/components/link/package.json
@@ -1,6 +1,6 @@
{
"name": "@nextui-org/link",
- "version": "0.0.0-dev-v2-20230729132654",
+ "version": "0.0.0-dev-v2-20230729152229",
"description": "Links allow users to click their way from page to page. This component is styled to resemble a hyperlink and semantically renders an <a>",
"keywords": [
"link"
diff --git a/packages/components/link/src/link.tsx b/packages/components/link/src/link.tsx
index 54190a8608..caf39cac35 100644
--- a/packages/components/link/src/link.tsx
+++ b/packages/components/link/src/link.tsx
@@ -1,12 +1,12 @@
-import {forwardRef} from "react";
+import {forwardRef} from "@nextui-org/system";
import {LinkIcon} from "@nextui-org/shared-icons";
import {linkAnchorClasses} from "@nextui-org/theme";
import {UseLinkProps, useLink} from "./use-link";
-export interface LinkProps extends Omit {}
+export interface LinkProps extends UseLinkProps {}
-const Link = forwardRef((props, ref) => {
+const Link = forwardRef<"a", LinkProps>((props, ref) => {
const {
Component,
children,
@@ -14,8 +14,8 @@ const Link = forwardRef((props, ref) => {
anchorIcon = ,
getLinkProps,
} = useLink({
- ...props,
ref,
+ ...props,
});
return (
diff --git a/packages/components/link/stories/link.stories.tsx b/packages/components/link/stories/link.stories.tsx
index 188078a43e..2a1301fd85 100644
--- a/packages/components/link/stories/link.stories.tsx
+++ b/packages/components/link/stories/link.stories.tsx
@@ -1,6 +1,6 @@
import type {VariantProps} from "@nextui-org/theme";
-import {ComponentStory, ComponentMeta} from "@storybook/react";
+import {ComponentMeta} from "@storybook/react";
import React from "react";
import {tv} from "@nextui-org/theme";
import {link} from "@nextui-org/theme";
@@ -46,7 +46,7 @@ const defaultProps = {
children,
};
-const Template: ComponentStory = (args: LinkProps) => ;
+const Template = (args: LinkProps) => ;
export const Default = Template.bind({});
Default.args = {
diff --git a/packages/components/modal/package.json b/packages/components/modal/package.json
index 5e31799488..f357bdd3c4 100644
--- a/packages/components/modal/package.json
+++ b/packages/components/modal/package.json
@@ -1,6 +1,6 @@
{
"name": "@nextui-org/modal",
- "version": "0.0.0-dev-v2-20230729132654",
+ "version": "0.0.0-dev-v2-20230729152229",
"description": "Displays a dialog with a custom content that requires attention or provides additional information.",
"keywords": [
"modal"
diff --git a/packages/components/modal/src/modal-body.tsx b/packages/components/modal/src/modal-body.tsx
index 2a07b36f5f..0b8aaa1a7c 100644
--- a/packages/components/modal/src/modal-body.tsx
+++ b/packages/components/modal/src/modal-body.tsx
@@ -7,7 +7,7 @@ import {useModalContext} from "./modal-context";
export interface ModalBodyProps extends HTMLNextUIProps<"div"> {}
-const ModalBody = forwardRef((props, ref) => {
+const ModalBody = forwardRef<"div", ModalBodyProps>((props, ref) => {
const {as, children, className, ...otherProps} = props;
const {slots, classNames, bodyId, setBodyMounted} = useModalContext();
diff --git a/packages/components/modal/src/modal-content.tsx b/packages/components/modal/src/modal-content.tsx
index 7b0b990ab7..5c2d41f5c9 100644
--- a/packages/components/modal/src/modal-content.tsx
+++ b/packages/components/modal/src/modal-content.tsx
@@ -1,7 +1,8 @@
import type {AriaDialogProps} from "@react-aria/dialog";
import type {HTMLMotionProps} from "framer-motion";
-import {cloneElement, isValidElement, ReactNode, useMemo, forwardRef} from "react";
+import {cloneElement, isValidElement, ReactNode, useMemo} from "react";
+import {forwardRef} from "@nextui-org/system";
import {DismissButton} from "@react-aria/overlays";
import {TRANSITION_VARIANTS} from "@nextui-org/framer-transitions";
import {CloseIcon} from "@nextui-org/shared-icons";
@@ -14,13 +15,13 @@ import {HTMLNextUIProps} from "@nextui-org/system";
import {useModalContext} from "./modal-context";
import {scaleInOut} from "./modal-transition";
-export interface ModalContentProps
- extends AriaDialogProps,
- Omit, "children" | "role"> {
+type KeysToOmit = "children" | "role";
+
+export interface ModalContentProps extends AriaDialogProps, HTMLNextUIProps<"div", KeysToOmit> {
children: ReactNode | ((onClose: () => void) => ReactNode);
}
-const ModalContent = forwardRef((props, _) => {
+const ModalContent = forwardRef<"div", ModalContentProps, KeysToOmit>((props, _) => {
const {as, children, role = "dialog", ...otherProps} = props;
const {
diff --git a/packages/components/modal/src/modal-footer.tsx b/packages/components/modal/src/modal-footer.tsx
index 1df27d539c..405b54b1ac 100644
--- a/packages/components/modal/src/modal-footer.tsx
+++ b/packages/components/modal/src/modal-footer.tsx
@@ -6,7 +6,7 @@ import {useModalContext} from "./modal-context";
export interface ModalFooterProps extends HTMLNextUIProps<"footer"> {}
-const ModalFooter = forwardRef((props, ref) => {
+const ModalFooter = forwardRef<"footer", ModalFooterProps>((props, ref) => {
const {as, children, className, ...otherProps} = props;
const {slots, classNames} = useModalContext();
diff --git a/packages/components/modal/src/modal-header.tsx b/packages/components/modal/src/modal-header.tsx
index 893fc15522..4e6a96da53 100644
--- a/packages/components/modal/src/modal-header.tsx
+++ b/packages/components/modal/src/modal-header.tsx
@@ -7,7 +7,7 @@ import {useModalContext} from "./modal-context";
export interface ModalHeaderProps extends HTMLNextUIProps<"header"> {}
-const ModalHeader = forwardRef((props, ref) => {
+const ModalHeader = forwardRef<"header", ModalHeaderProps>((props, ref) => {
const {as, children, className, ...otherProps} = props;
const {slots, classNames, headerId, setHeaderMounted} = useModalContext();
diff --git a/packages/components/modal/src/modal.tsx b/packages/components/modal/src/modal.tsx
index b2fdea7a8f..323aa53089 100644
--- a/packages/components/modal/src/modal.tsx
+++ b/packages/components/modal/src/modal.tsx
@@ -1,20 +1,21 @@
-import {ReactNode, forwardRef} from "react";
+import {ReactNode} from "react";
import {AnimatePresence} from "framer-motion";
import {Overlay} from "@react-aria/overlays";
+import {forwardRef} from "@nextui-org/system";
import {UseModalProps, useModal} from "./use-modal";
import {ModalProvider} from "./modal-context";
-export interface ModalProps extends Omit {
+export interface ModalProps extends UseModalProps {
/**
* The content of the modal. Usually the ModalContent
*/
children: ReactNode;
}
-const Modal = forwardRef((props, ref) => {
+const Modal = forwardRef<"div", ModalProps>((props, ref) => {
const {children, ...otherProps} = props;
- const context = useModal({ref, ...otherProps});
+ const context = useModal({...otherProps, ref});
const overlay = {children};
diff --git a/packages/components/modal/stories/modal.stories.tsx b/packages/components/modal/stories/modal.stories.tsx
index a170d7ea76..d5ebd311cb 100644
--- a/packages/components/modal/stories/modal.stories.tsx
+++ b/packages/components/modal/stories/modal.stories.tsx
@@ -1,7 +1,7 @@
/* eslint-disable jsx-a11y/anchor-is-valid */
/* eslint-disable jsx-a11y/no-autofocus */
import React from "react";
-import {ComponentStory, ComponentMeta} from "@storybook/react";
+import {ComponentMeta} from "@storybook/react";
import {modal} from "@nextui-org/theme";
import {Button} from "@nextui-org/button";
import {Input} from "@nextui-org/input";
@@ -129,7 +129,7 @@ const content = (
);
-const Template: ComponentStory = (args: ModalProps) => {
+const Template = (args: ModalProps) => {
const {isOpen, onOpen, onOpenChange} = useDisclosure({defaultOpen: args.defaultOpen});
return (
@@ -142,7 +142,7 @@ const Template: ComponentStory = (args: ModalProps) => {
);
};
-const InsideScrollTemplate: ComponentStory = (args: ModalProps) => {
+const InsideScrollTemplate = (args: ModalProps) => {
const {isOpen, onOpen, onClose, onOpenChange} = useDisclosure();
return (
@@ -163,7 +163,7 @@ const InsideScrollTemplate: ComponentStory = (args: ModalProps) =>
);
};
-const OutsideScrollTemplate: ComponentStory = (args: ModalProps) => {
+const OutsideScrollTemplate = (args: ModalProps) => {
const {isOpen, onOpen, onClose, onOpenChange} = useDisclosure();
return (
@@ -183,7 +183,7 @@ const OutsideScrollTemplate: ComponentStory = (args: ModalProps) =
>
);
};
-const OpenChangeTemplate: ComponentStory = (args: ModalProps) => {
+const OpenChangeTemplate = (args: ModalProps) => {
const {isOpen, onOpen, onClose, onOpenChange} = useDisclosure();
return (
diff --git a/packages/components/navbar/package.json b/packages/components/navbar/package.json
index 560ad739fd..37f34bd974 100644
--- a/packages/components/navbar/package.json
+++ b/packages/components/navbar/package.json
@@ -1,6 +1,6 @@
{
"name": "@nextui-org/navbar",
- "version": "0.0.0-dev-v2-20230729132654",
+ "version": "0.0.0-dev-v2-20230729152229",
"description": "A responsive navigation header positioned on top side of your page that includes support for branding, links, navigation, collapse and more.",
"keywords": [
"navbar"
diff --git a/packages/components/navbar/src/navbar-brand.tsx b/packages/components/navbar/src/navbar-brand.tsx
index c6321ef2ef..3665940775 100644
--- a/packages/components/navbar/src/navbar-brand.tsx
+++ b/packages/components/navbar/src/navbar-brand.tsx
@@ -8,7 +8,7 @@ export interface NavbarBrandProps extends HTMLNextUIProps<"div"> {
children?: React.ReactNode | React.ReactNode[];
}
-const NavbarBrand = forwardRef((props, ref) => {
+const NavbarBrand = forwardRef<"div", NavbarBrandProps>((props, ref) => {
const {as, className, children, ...otherProps} = props;
const Component = as || "div";
diff --git a/packages/components/navbar/src/navbar-content.tsx b/packages/components/navbar/src/navbar-content.tsx
index af4ce3ed37..b4d5b0cb6f 100644
--- a/packages/components/navbar/src/navbar-content.tsx
+++ b/packages/components/navbar/src/navbar-content.tsx
@@ -16,7 +16,7 @@ export interface NavbarContentProps extends HTMLNextUIProps<"ul"> {
justify?: "start" | "end" | "center";
}
-const NavbarContent = forwardRef((props, ref) => {
+const NavbarContent = forwardRef<"ul", NavbarContentProps>((props, ref) => {
const {as, className, children, justify = "start", ...otherProps} = props;
const Component = as || "ul";
diff --git a/packages/components/navbar/src/navbar-item.tsx b/packages/components/navbar/src/navbar-item.tsx
index 6023199724..3745d10f57 100644
--- a/packages/components/navbar/src/navbar-item.tsx
+++ b/packages/components/navbar/src/navbar-item.tsx
@@ -13,7 +13,7 @@ export interface NavbarItemProps extends HTMLNextUIProps<"li"> {
isActive?: boolean;
}
-const NavbarItem = forwardRef((props, ref) => {
+const NavbarItem = forwardRef<"li", NavbarItemProps>((props, ref) => {
const {as, className, children, isActive, ...otherProps} = props;
const Component = as || "li";
diff --git a/packages/components/navbar/src/navbar-menu-item.tsx b/packages/components/navbar/src/navbar-menu-item.tsx
index 2432703910..dcd30e6273 100644
--- a/packages/components/navbar/src/navbar-menu-item.tsx
+++ b/packages/components/navbar/src/navbar-menu-item.tsx
@@ -8,7 +8,7 @@ export interface NavbarMenuItemProps extends HTMLNextUIProps<"li"> {
children?: React.ReactNode;
}
-const NavbarMenuItem = forwardRef((props, ref) => {
+const NavbarMenuItem = forwardRef<"li", NavbarMenuItemProps>((props, ref) => {
const {className, children, ...otherProps} = props;
const domRef = useDOMRef(ref);
diff --git a/packages/components/navbar/src/navbar-menu-toggle.tsx b/packages/components/navbar/src/navbar-menu-toggle.tsx
index 59e4fa8e70..13dc620d03 100644
--- a/packages/components/navbar/src/navbar-menu-toggle.tsx
+++ b/packages/components/navbar/src/navbar-menu-toggle.tsx
@@ -28,7 +28,7 @@ export interface Props extends Omit, keyof AriaToggleB
export type NavbarMenuToggleProps = Props & AriaToggleButtonProps;
-const NavbarMenuToggle = forwardRef((props, ref) => {
+const NavbarMenuToggle = forwardRef<"button", NavbarMenuToggleProps>((props, ref) => {
const {
as,
icon,
diff --git a/packages/components/navbar/src/navbar-menu.tsx b/packages/components/navbar/src/navbar-menu.tsx
index fbeeaa045e..d556d24558 100644
--- a/packages/components/navbar/src/navbar-menu.tsx
+++ b/packages/components/navbar/src/navbar-menu.tsx
@@ -23,7 +23,7 @@ export interface NavbarMenuProps extends HTMLNextUIProps<"ul"> {
motionProps?: HTMLMotionProps<"ul">;
}
-const NavbarMenu = forwardRef((props, ref) => {
+const NavbarMenu = forwardRef<"ul", NavbarMenuProps>((props, ref) => {
const {className, children, portalContainer, motionProps, style, ...otherProps} = props;
const domRef = useDOMRef(ref);
diff --git a/packages/components/navbar/src/navbar.tsx b/packages/components/navbar/src/navbar.tsx
index 29786d18b9..7249e4f841 100644
--- a/packages/components/navbar/src/navbar.tsx
+++ b/packages/components/navbar/src/navbar.tsx
@@ -1,4 +1,4 @@
-import {forwardRef} from "react";
+import {forwardRef} from "@nextui-org/system";
import {pickChildren} from "@nextui-org/react-utils";
import {motion} from "framer-motion";
import {mergeProps} from "@react-aria/utils";
@@ -8,14 +8,14 @@ import {UseNavbarProps, useNavbar} from "./use-navbar";
import {NavbarProvider} from "./navbar-context";
import NavbarMenu from "./navbar-menu";
-export interface NavbarProps extends Omit {
+export interface NavbarProps extends Omit {
children?: React.ReactNode | React.ReactNode[];
}
-const Navbar = forwardRef((props, ref) => {
+const Navbar = forwardRef<"div", NavbarProps>((props, ref) => {
const {children, ...otherProps} = props;
- const context = useNavbar({ref, ...otherProps});
+ const context = useNavbar({...otherProps, ref});
const Component = context.Component;
diff --git a/packages/components/navbar/src/use-navbar.ts b/packages/components/navbar/src/use-navbar.ts
index 1d88327568..5becec6481 100644
--- a/packages/components/navbar/src/use-navbar.ts
+++ b/packages/components/navbar/src/use-navbar.ts
@@ -11,7 +11,7 @@ import {useScrollPosition} from "@nextui-org/use-scroll-position";
import {useControlledState} from "@react-stately/utils";
import {HTMLMotionProps} from "framer-motion";
-export interface UseNavbarProps extends HTMLNextUIProps<"nav", NavbarVariantProps> {
+interface Props extends HTMLNextUIProps<"nav"> {
/**
* Ref to the DOM node.
*/
@@ -83,6 +83,8 @@ export interface UseNavbarProps extends HTMLNextUIProps<"nav", NavbarVariantProp
classNames?: SlotsToClasses;
}
+export type UseNavbarProps = Props & NavbarVariantProps;
+
export function useNavbar(originalProps: UseNavbarProps) {
const [props, variantProps] = mapPropsVariants(originalProps, navbar.variantKeys);
diff --git a/packages/components/navbar/stories/navbar.stories.tsx b/packages/components/navbar/stories/navbar.stories.tsx
index 4933b0f6f9..0942df0a88 100644
--- a/packages/components/navbar/stories/navbar.stories.tsx
+++ b/packages/components/navbar/stories/navbar.stories.tsx
@@ -1,5 +1,5 @@
import React from "react";
-import {ComponentStory, ComponentMeta} from "@storybook/react";
+import {ComponentMeta} from "@storybook/react";
import {navbar} from "@nextui-org/theme";
import {Link} from "@nextui-org/link";
import {Button} from "@nextui-org/button";
@@ -94,7 +94,7 @@ const App = React.forwardRef(({children}: any, ref: any) => {
App.displayName = "App";
-const Template: ComponentStory = (args: NavbarProps) => {
+const Template = (args: NavbarProps) => {
// for hide on scroll cases
const parentRef = React.useRef(null);
@@ -145,7 +145,7 @@ const Template: ComponentStory = (args: NavbarProps) => {
);
};
-const WithMenuTemplate: ComponentStory = (args: NavbarProps) => {
+const WithMenuTemplate = (args: NavbarProps) => {
const parentRef = React.useRef(null);
const [isMenuOpen, setIsMenuOpen] = React.useState(false);
@@ -231,7 +231,7 @@ const WithMenuTemplate: ComponentStory = (args: NavbarProps) => {
);
};
-const WithDropdownTemplate: ComponentStory = (args: NavbarProps) => {
+const WithDropdownTemplate = (args: NavbarProps) => {
const icons = {
chevron: ,
scale: ,
@@ -346,7 +346,7 @@ const WithDropdownTemplate: ComponentStory = (args: NavbarProps)
);
};
-const WithAvatarUserTemplate: ComponentStory = (args: NavbarProps) => {
+const WithAvatarUserTemplate = (args: NavbarProps) => {
const menuItems = [
"Profile",
"Dashboard",
@@ -446,7 +446,7 @@ const WithAvatarUserTemplate: ComponentStory = (args: NavbarProps
);
};
-const WithSearchInputTemplate: ComponentStory = (args: NavbarProps) => {
+const WithSearchInputTemplate = (args: NavbarProps) => {
const menuItems = [
"Profile",
"Dashboard",
diff --git a/packages/components/pagination/package.json b/packages/components/pagination/package.json
index 9b122a91f9..c18127db96 100644
--- a/packages/components/pagination/package.json
+++ b/packages/components/pagination/package.json
@@ -1,6 +1,6 @@
{
"name": "@nextui-org/pagination",
- "version": "0.0.0-dev-v2-20230729132654",
+ "version": "0.0.0-dev-v2-20230729152229",
"description": "The Pagination component allows you to display active page and navigate between multiple pages.",
"keywords": [
"pagination"
diff --git a/packages/components/pagination/src/pagination-cursor.tsx b/packages/components/pagination/src/pagination-cursor.tsx
index dfd2812dba..60eaf7f65f 100644
--- a/packages/components/pagination/src/pagination-cursor.tsx
+++ b/packages/components/pagination/src/pagination-cursor.tsx
@@ -8,7 +8,7 @@ export interface PaginationCursorProps extends HTMLNextUIProps<"span"> {
activePage?: number;
}
-const PaginationCursor = forwardRef((props, ref) => {
+const PaginationCursor = forwardRef<"span", PaginationCursorProps>((props, ref) => {
const {as, activePage, ...otherProps} = props;
const Component = as || "span";
diff --git a/packages/components/pagination/src/pagination-item.tsx b/packages/components/pagination/src/pagination-item.tsx
index 429233fbde..226e1a1a1c 100644
--- a/packages/components/pagination/src/pagination-item.tsx
+++ b/packages/components/pagination/src/pagination-item.tsx
@@ -1,11 +1,11 @@
-import {forwardRef} from "react";
+import {forwardRef} from "@nextui-org/system";
import {usePaginationItem, UsePaginationItemProps} from "./use-pagination-item";
-export interface PaginationItemProps extends Omit {}
+export interface PaginationItemProps extends UsePaginationItemProps {}
-const PaginationItem = forwardRef(({key, ...props}, ref) => {
- const {Component, children, getItemProps} = usePaginationItem({ref, ...props});
+const PaginationItem = forwardRef<"li", PaginationItemProps>(({key, ...props}, ref) => {
+ const {Component, children, getItemProps} = usePaginationItem({...props, ref});
return (
diff --git a/packages/components/pagination/src/pagination.tsx b/packages/components/pagination/src/pagination.tsx
index 5622277c72..0bd9106e3a 100644
--- a/packages/components/pagination/src/pagination.tsx
+++ b/packages/components/pagination/src/pagination.tsx
@@ -1,5 +1,6 @@
import {PaginationItemValue} from "@nextui-org/use-pagination";
-import {useCallback, forwardRef} from "react";
+import {useCallback} from "react";
+import {forwardRef} from "@nextui-org/system";
import {PaginationItemType} from "@nextui-org/use-pagination";
import {ChevronIcon, EllipsisIcon, ForwardIcon} from "@nextui-org/shared-icons";
import {clsx, dataAttr} from "@nextui-org/shared-utils";
@@ -8,9 +9,9 @@ import {UsePaginationProps, usePagination} from "./use-pagination";
import PaginationItem from "./pagination-item";
import PaginationCursor from "./pagination-cursor";
-export interface PaginationProps extends Omit {}
+export interface PaginationProps extends UsePaginationProps {}
-const Pagination = forwardRef((props, ref) => {
+const Pagination = forwardRef<"nav", PaginationProps>((props, ref) => {
const {
Component,
dotsJump,
@@ -32,7 +33,7 @@ const Pagination = forwardRef((props, ref) => {
getWrapperProps,
getItemProps,
getCursorProps,
- } = usePagination({ref, ...props});
+ } = usePagination({...props, ref});
const renderItem = useCallback(
(value: PaginationItemValue, index: number) => {
diff --git a/packages/components/pagination/stories/pagination.stories.tsx b/packages/components/pagination/stories/pagination.stories.tsx
index 5d0771e451..02b9c1568d 100644
--- a/packages/components/pagination/stories/pagination.stories.tsx
+++ b/packages/components/pagination/stories/pagination.stories.tsx
@@ -1,5 +1,5 @@
import React from "react";
-import {ComponentStory, ComponentMeta} from "@storybook/react";
+import {ComponentMeta} from "@storybook/react";
import {button, pagination} from "@nextui-org/theme";
import {cn} from "@nextui-org/system";
import {ChevronIcon} from "@nextui-org/shared-icons";
@@ -76,9 +76,7 @@ const defaultProps = {
initialPage: 1,
};
-const Template: ComponentStory = (args: PaginationProps) => (
-
-);
+const Template = (args: PaginationProps) => ;
export const Default = Template.bind({});
Default.args = {
diff --git a/packages/components/popover/package.json b/packages/components/popover/package.json
index 54796ebfd7..9c7eecde47 100644
--- a/packages/components/popover/package.json
+++ b/packages/components/popover/package.json
@@ -1,6 +1,6 @@
{
"name": "@nextui-org/popover",
- "version": "0.0.0-dev-v2-20230729132654",
+ "version": "0.0.0-dev-v2-20230729152229",
"description": "A popover is an overlay element positioned relative to a trigger.",
"keywords": [
"popover"
diff --git a/packages/components/popover/src/popover-content.tsx b/packages/components/popover/src/popover-content.tsx
index 9ae895cb81..e2629898ff 100644
--- a/packages/components/popover/src/popover-content.tsx
+++ b/packages/components/popover/src/popover-content.tsx
@@ -1,7 +1,8 @@
import type {AriaDialogProps} from "@react-aria/dialog";
import type {HTMLMotionProps} from "framer-motion";
-import {DOMAttributes, ReactNode, useMemo, useRef, forwardRef} from "react";
+import {DOMAttributes, ReactNode, useMemo, useRef} from "react";
+import {forwardRef} from "@nextui-org/system";
import {DismissButton} from "@react-aria/overlays";
import {TRANSITION_VARIANTS} from "@nextui-org/framer-transitions";
import {motion} from "framer-motion";
@@ -15,11 +16,11 @@ import {usePopoverContext} from "./popover-context";
export interface PopoverContentProps
extends AriaDialogProps,
- Omit, "children" | "role"> {
+ Omit {
children: ReactNode | ((titleProps: DOMAttributes) => ReactNode);
}
-const PopoverContent = forwardRef((props, _) => {
+const PopoverContent = forwardRef<"div", PopoverContentProps>((props, _) => {
const {as, children, role = "dialog", ...otherProps} = props;
const {
diff --git a/packages/components/popover/src/popover-trigger.tsx b/packages/components/popover/src/popover-trigger.tsx
index fb080f7da0..9fbe0e7cde 100644
--- a/packages/components/popover/src/popover-trigger.tsx
+++ b/packages/components/popover/src/popover-trigger.tsx
@@ -1,4 +1,5 @@
-import React, {Children, cloneElement, useMemo, forwardRef} from "react";
+import React, {Children, cloneElement, useMemo} from "react";
+import {forwardRef} from "@nextui-org/system";
import {pickChildren} from "@nextui-org/react-utils";
import {useAriaButton} from "@nextui-org/use-aria-button";
import {Button} from "@nextui-org/button";
@@ -14,7 +15,7 @@ export interface PopoverTriggerProps {
* PopoverTrigger opens the popover's content. It must be an interactive element
* such as `button` or `a`.
*/
-const PopoverTrigger = forwardRef((props, _) => {
+const PopoverTrigger = forwardRef<"button", PopoverTriggerProps>((props, _) => {
const {triggerRef, getTriggerProps} = usePopoverContext();
const {children, ...otherProps} = props;
diff --git a/packages/components/popover/src/popover.tsx b/packages/components/popover/src/popover.tsx
index 507f9aa349..bbe4158515 100644
--- a/packages/components/popover/src/popover.tsx
+++ b/packages/components/popover/src/popover.tsx
@@ -1,11 +1,12 @@
-import {Children, ReactNode, forwardRef} from "react";
+import {Children, ReactNode} from "react";
+import {forwardRef} from "@nextui-org/system";
import {AnimatePresence} from "framer-motion";
import {Overlay} from "@react-aria/overlays";
import {UsePopoverProps, usePopover} from "./use-popover";
import {PopoverProvider} from "./popover-context";
-export interface PopoverProps extends Omit {
+export interface PopoverProps extends UsePopoverProps {
/**
* The content of the popover. It is usually the `PopoverTrigger`,
* and `PopoverContent`
@@ -13,9 +14,9 @@ export interface PopoverProps extends Omit {
children: ReactNode[];
}
-const Popover = forwardRef((props, ref) => {
+const Popover = forwardRef<"div", PopoverProps>((props, ref) => {
const {children, ...otherProps} = props;
- const context = usePopover({ref, ...otherProps});
+ const context = usePopover({...otherProps, ref});
const [trigger, content] = Children.toArray(children);
diff --git a/packages/components/popover/stories/popover.stories.tsx b/packages/components/popover/stories/popover.stories.tsx
index fc69c056a0..f4c7e74409 100644
--- a/packages/components/popover/stories/popover.stories.tsx
+++ b/packages/components/popover/stories/popover.stories.tsx
@@ -1,6 +1,6 @@
/* eslint-disable jsx-a11y/no-autofocus */
import React from "react";
-import {ComponentStory, ComponentMeta} from "@storybook/react";
+import {ComponentMeta} from "@storybook/react";
import {popover, ButtonVariantProps} from "@nextui-org/theme";
import {Button} from "@nextui-org/button";
import {Input} from "@nextui-org/input";
@@ -113,7 +113,7 @@ const content = (
);
-const Template: ComponentStory = (args: PopoverProps) => {
+const Template = (args: PopoverProps) => {
return (
@@ -124,7 +124,7 @@ const Template: ComponentStory = (args: PopoverProps) => {
);
};
-const WithTitlePropsTemplate: ComponentStory = (args: PopoverProps) => {
+const WithTitlePropsTemplate = (args: PopoverProps) => {
return (
@@ -144,7 +144,7 @@ const WithTitlePropsTemplate: ComponentStory = (args: PopoverPro
);
};
-const OpenChangeTemplate: ComponentStory = (args: PopoverProps) => {
+const OpenChangeTemplate = (args: PopoverProps) => {
const [isOpen, setIsOpen] = React.useState(false);
return (
@@ -165,7 +165,7 @@ const OpenChangeTemplate: ComponentStory = (args: PopoverProps)
);
};
-const PlacementsTemplate: ComponentStory = (args: PopoverProps) => {
+const PlacementsTemplate = (args: PopoverProps) => {
const buttonColor = args.color as ButtonVariantProps["color"];
return (
@@ -281,7 +281,7 @@ const PlacementsTemplate: ComponentStory = (args: PopoverProps)
);
};
-const OffsetTemplate: ComponentStory = (args: PopoverProps) => (
+const OffsetTemplate = (args: PopoverProps) => (
@@ -310,7 +310,7 @@ const OffsetTemplate: ComponentStory = (args: PopoverProps) => (
);
-const WithFormTemplate: ComponentStory = (args: PopoverProps) => (
+const WithFormTemplate = (args: PopoverProps) => (
@@ -333,7 +333,7 @@ const WithFormTemplate: ComponentStory = (args: PopoverProps) =>
);
-const WithBackdropTemplate: ComponentStory = (args: PopoverProps) => (
+const WithBackdropTemplate = (args: PopoverProps) => (
Your day your way
diff --git a/packages/components/progress/package.json b/packages/components/progress/package.json
index 07cace33b2..313ac06b1e 100644
--- a/packages/components/progress/package.json
+++ b/packages/components/progress/package.json
@@ -1,6 +1,6 @@
{
"name": "@nextui-org/progress",
- "version": "0.0.0-dev-v2-20230729132654",
+ "version": "0.0.0-dev-v2-20230729152229",
"description": "Progress bars show either determinate or indeterminate progress of an operation over time.",
"keywords": [
"progress"
diff --git a/packages/components/progress/src/circular-progress.tsx b/packages/components/progress/src/circular-progress.tsx
index 35ab770a24..f847400aba 100644
--- a/packages/components/progress/src/circular-progress.tsx
+++ b/packages/components/progress/src/circular-progress.tsx
@@ -1,10 +1,10 @@
-import {forwardRef} from "react";
+import {forwardRef} from "@nextui-org/system";
import {UseCircularProgressProps, useCircularProgress} from "./use-circular-progress";
-export interface CircularProgressProps extends Omit {}
+export interface CircularProgressProps extends UseCircularProgressProps {}
-const CircularProgress = forwardRef((props, ref) => {
+const CircularProgress = forwardRef<"div", CircularProgressProps>((props, ref) => {
const {
Component,
slots,
diff --git a/packages/components/progress/src/progress.tsx b/packages/components/progress/src/progress.tsx
index 42d8f41127..0b9c02e300 100644
--- a/packages/components/progress/src/progress.tsx
+++ b/packages/components/progress/src/progress.tsx
@@ -1,10 +1,10 @@
-import {forwardRef} from "react";
+import {forwardRef} from "@nextui-org/system";
import {UseProgressProps, useProgress} from "./use-progress";
-export interface ProgressProps extends Omit {}
+export interface ProgressProps extends UseProgressProps {}
-const Progress = forwardRef((props, ref) => {
+const Progress = forwardRef<"div", ProgressProps>((props, ref) => {
const {
Component,
slots,
@@ -14,7 +14,7 @@ const Progress = forwardRef((props, ref) => {
showValueLabel,
getProgressBarProps,
getLabelProps,
- } = useProgress({ref, ...props});
+ } = useProgress({...props, ref});
const progressBarProps = getProgressBarProps();
const shouldShowLabelWrapper = label || showValueLabel;
diff --git a/packages/components/progress/stories/circular-progress.stories.tsx b/packages/components/progress/stories/circular-progress.stories.tsx
index 04d2521895..b4c25e0990 100644
--- a/packages/components/progress/stories/circular-progress.stories.tsx
+++ b/packages/components/progress/stories/circular-progress.stories.tsx
@@ -1,5 +1,5 @@
import React from "react";
-import {ComponentStory, ComponentMeta} from "@storybook/react";
+import {ComponentMeta} from "@storybook/react";
import {circularProgress} from "@nextui-org/theme";
import {Card, CardBody, CardFooter} from "@nextui-org/card";
import {Chip} from "@nextui-org/chip";
@@ -34,11 +34,9 @@ const defaultProps = {
...circularProgress.defaultVariants,
};
-const Template: ComponentStory = (args: CircularProgressProps) => (
-
-);
+const Template = (args: CircularProgressProps) => ;
-const IntervalTemplate: ComponentStory = (args: CircularProgressProps) => {
+const IntervalTemplate = (args: CircularProgressProps) => {
const [value, setValue] = React.useState(0);
React.useEffect(() => {
@@ -52,9 +50,7 @@ const IntervalTemplate: ComponentStory = (args: Circula
return ;
};
-const CustomClassnamesTemplate: ComponentStory = (
- args: CircularProgressProps,
-) => (
+const CustomClassnamesTemplate = (args: CircularProgressProps) => (