mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
refactor: remove unnecessary props types (#4530)
* refactor(docs): remove string type as it is included in ReactNode * refactor: remove unnecessary types * feat(changeset): add changeset * chore: remove changeset * refactor: remove null since ReactNode unions it already
This commit is contained in:
parent
fcdf24a019
commit
26fc514791
@ -327,19 +327,19 @@ Here's an example of how to customize the accordion styles:
|
|||||||
data={[
|
data={[
|
||||||
{
|
{
|
||||||
attribute: "children",
|
attribute: "children",
|
||||||
type: "ReactNode | string",
|
type: "ReactNode",
|
||||||
description: "The content of the component.",
|
description: "The content of the component.",
|
||||||
default: "-"
|
default: "-"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
attribute: "title",
|
attribute: "title",
|
||||||
type: "ReactNode | string",
|
type: "ReactNode",
|
||||||
description: "The accordion item title.",
|
description: "The accordion item title.",
|
||||||
default: "-"
|
default: "-"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
attribute: "subtitle",
|
attribute: "subtitle",
|
||||||
type: "ReactNode | string",
|
type: "ReactNode",
|
||||||
description: "The accordion item subtitle.",
|
description: "The accordion item subtitle.",
|
||||||
default: "-"
|
default: "-"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -412,7 +412,7 @@ When the `NavbarItem` is active, it will have a `data-active` attribute. You can
|
|||||||
data={[
|
data={[
|
||||||
{
|
{
|
||||||
attribute: "icon",
|
attribute: "icon",
|
||||||
type: "ReactNode | ((isOpen: boolean | undefined) => ReactNode | null)",
|
type: "ReactNode | ((isOpen: boolean | undefined) => ReactNode)",
|
||||||
description: "The icon to render as the navbar menu toggle.",
|
description: "The icon to render as the navbar menu toggle.",
|
||||||
default: "-"
|
default: "-"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -40,7 +40,7 @@ const AccordionItem = forwardRef<"button", AccordionItemProps>((props, ref) => {
|
|||||||
|
|
||||||
const willChange = useWillChange();
|
const willChange = useWillChange();
|
||||||
|
|
||||||
const indicatorContent = useMemo<ReactNode | null>(() => {
|
const indicatorContent = useMemo<ReactNode>(() => {
|
||||||
if (typeof indicator === "function") {
|
if (typeof indicator === "function") {
|
||||||
return indicator({indicator: <ChevronIcon />, isOpen, isDisabled});
|
return indicator({indicator: <ChevronIcon />, isOpen, isDisabled});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,15 +33,15 @@ export interface Props<T extends object = {}>
|
|||||||
/**
|
/**
|
||||||
* The content of the component.
|
* The content of the component.
|
||||||
*/
|
*/
|
||||||
children?: ReactNode | null;
|
children?: ReactNode;
|
||||||
/**
|
/**
|
||||||
* The accordion item title.
|
* The accordion item title.
|
||||||
*/
|
*/
|
||||||
title?: ReactNode | string;
|
title?: ReactNode;
|
||||||
/**
|
/**
|
||||||
* The accordion item subtitle.
|
* The accordion item subtitle.
|
||||||
*/
|
*/
|
||||||
subtitle?: ReactNode | string;
|
subtitle?: ReactNode;
|
||||||
/**
|
/**
|
||||||
* The accordion item `expanded` indicator, it's usually an arrow icon.
|
* The accordion item `expanded` indicator, it's usually an arrow icon.
|
||||||
* If you pass a function, NextUI will expose the current indicator and the open status,
|
* If you pass a function, NextUI will expose the current indicator and the open status,
|
||||||
|
|||||||
@ -25,15 +25,15 @@ interface Props<T extends object = {}> extends Omit<ItemProps<"li", T>, "childre
|
|||||||
/**
|
/**
|
||||||
* The content of the component.
|
* The content of the component.
|
||||||
*/
|
*/
|
||||||
children?: ReactNode | null;
|
children?: ReactNode;
|
||||||
/**
|
/**
|
||||||
* The listbox item title.
|
* The listbox item title.
|
||||||
*/
|
*/
|
||||||
title?: ReactNode | string;
|
title?: ReactNode;
|
||||||
/**
|
/**
|
||||||
* The listbox item subtitle.
|
* The listbox item subtitle.
|
||||||
*/
|
*/
|
||||||
description?: ReactNode | string;
|
description?: ReactNode;
|
||||||
/**
|
/**
|
||||||
* The listbox item start content.
|
* The listbox item start content.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -29,7 +29,7 @@ const ListboxItem = (props: ListboxItemProps) => {
|
|||||||
getSelectedIconProps,
|
getSelectedIconProps,
|
||||||
} = useListboxItem(props);
|
} = useListboxItem(props);
|
||||||
|
|
||||||
const selectedContent = useMemo<ReactNode | null>(() => {
|
const selectedContent = useMemo<ReactNode>(() => {
|
||||||
const defaultIcon = (
|
const defaultIcon = (
|
||||||
<ListboxSelectedIcon disableAnimation={disableAnimation} isSelected={isSelected} />
|
<ListboxSelectedIcon disableAnimation={disableAnimation} isSelected={isSelected} />
|
||||||
);
|
);
|
||||||
|
|||||||
@ -25,19 +25,19 @@ interface Props<T extends object = {}> extends Omit<ItemProps<"li", T>, "childre
|
|||||||
/**
|
/**
|
||||||
* The content of the component.
|
* The content of the component.
|
||||||
*/
|
*/
|
||||||
children?: ReactNode | null;
|
children?: ReactNode;
|
||||||
/**
|
/**
|
||||||
* The menu item title.
|
* The menu item title.
|
||||||
*/
|
*/
|
||||||
title?: ReactNode | string;
|
title?: ReactNode;
|
||||||
/**
|
/**
|
||||||
* The menu item subtitle.
|
* The menu item subtitle.
|
||||||
*/
|
*/
|
||||||
description?: ReactNode | string;
|
description?: ReactNode;
|
||||||
/**
|
/**
|
||||||
* The menu item keyboard shortcut.
|
* The menu item keyboard shortcut.
|
||||||
*/
|
*/
|
||||||
shortcut?: ReactNode | string;
|
shortcut?: ReactNode;
|
||||||
/**
|
/**
|
||||||
* The menu item start content.
|
* The menu item start content.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -32,7 +32,7 @@ const MenuItem = (props: MenuItemProps) => {
|
|||||||
getSelectedIconProps,
|
getSelectedIconProps,
|
||||||
} = useMenuItem(props);
|
} = useMenuItem(props);
|
||||||
|
|
||||||
const selectedContent = useMemo<ReactNode | null>(() => {
|
const selectedContent = useMemo<ReactNode>(() => {
|
||||||
const defaultIcon = (
|
const defaultIcon = (
|
||||||
<MenuSelectedIcon disableAnimation={disableAnimation} isSelected={isSelected} />
|
<MenuSelectedIcon disableAnimation={disableAnimation} isSelected={isSelected} />
|
||||||
);
|
);
|
||||||
|
|||||||
@ -24,7 +24,7 @@ export interface UseSnippetProps extends Omit<HTMLNextUIProps, "onCopy">, Snippe
|
|||||||
* The content of the snippet.
|
* The content of the snippet.
|
||||||
* if `string[]` is passed, it will be rendered as a multi-line snippet.
|
* if `string[]` is passed, it will be rendered as a multi-line snippet.
|
||||||
*/
|
*/
|
||||||
children?: React.ReactNode | string | string[];
|
children?: React.ReactNode | string[];
|
||||||
/**
|
/**
|
||||||
* The symbol to show before the snippet.
|
* The symbol to show before the snippet.
|
||||||
* @default "$"
|
* @default "$"
|
||||||
|
|||||||
@ -4,11 +4,11 @@ interface Props<T extends object = {}> extends Omit<ItemProps<"button", T>, "chi
|
|||||||
/**
|
/**
|
||||||
* The content of the component.
|
* The content of the component.
|
||||||
*/
|
*/
|
||||||
children?: ReactNode | null;
|
children?: ReactNode;
|
||||||
/**
|
/**
|
||||||
* The title of the component.
|
* The title of the component.
|
||||||
*/
|
*/
|
||||||
title?: ReactNode | null;
|
title?: ReactNode;
|
||||||
/**
|
/**
|
||||||
* A string representation of the item's contents. Use this when the title is not readable.
|
* A string representation of the item's contents. Use this when the title is not readable.
|
||||||
* This will be used as native `title` attribute.
|
* This will be used as native `title` attribute.
|
||||||
|
|||||||
@ -17,11 +17,11 @@ interface Props {
|
|||||||
/**
|
/**
|
||||||
* The user name.
|
* The user name.
|
||||||
*/
|
*/
|
||||||
name: ReactNode | string;
|
name: ReactNode;
|
||||||
/**
|
/**
|
||||||
* The user information, like email, phone, etc.
|
* The user information, like email, phone, etc.
|
||||||
*/
|
*/
|
||||||
description?: ReactNode | string;
|
description?: ReactNode;
|
||||||
/**
|
/**
|
||||||
* Whether the user can be focused.
|
* Whether the user can be focused.
|
||||||
* @default false
|
* @default false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user