diff --git a/bun.lockb b/bun.lockb index 628c73a8..49906305 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/components/doc-how.tsx b/components/doc-how.tsx index 3a8e303d..20e78929 100644 --- a/components/doc-how.tsx +++ b/components/doc-how.tsx @@ -108,7 +108,7 @@ const Tab = ({ children, ...props }: TabProps) => { > {({ isSelected }) => ( <> - {children} + {children as React.ReactNode} {isSelected && ( = { "date-and-time/date-field/date-field-demo": { diff --git a/components/ui/checkbox.tsx b/components/ui/checkbox.tsx index 21db1968..7a6655f4 100644 --- a/components/ui/checkbox.tsx +++ b/components/ui/checkbox.tsx @@ -1,7 +1,6 @@ "use client" import * as React from "react" -import { type ReactNode } from "react" import { IconCheck, IconMinus } from "justd-icons" import { @@ -16,9 +15,8 @@ import { tv } from "tailwind-variants" import { Description, FieldError, Label } from "./field" import { cn, cr, ctr } from "./primitive" -interface CheckboxGroupProps extends Omit { +interface CheckboxGroupProps extends CheckboxGroupPrimitiveProps { label?: string - children?: ReactNode description?: string errorMessage?: string | ((validation: ValidationResult) => string) } @@ -27,7 +25,7 @@ const CheckboxGroup = (props: CheckboxGroupProps) => { return ( - <>{props.children} + <>{props.children as React.ReactNode} {props.description && {props.description}} {props.errorMessage} @@ -93,7 +91,7 @@ const Checkbox = ({ className, ...props }: CheckboxProps) => {
<> - {props.label ? : props.children} + {props.label ? : (props.children as React.ReactNode)} {props.description && {props.description}}
diff --git a/components/ui/dialog.tsx b/components/ui/dialog.tsx index 511dcd60..7035d430 100644 --- a/components/ui/dialog.tsx +++ b/components/ui/dialog.tsx @@ -41,7 +41,7 @@ const dialogStyles = tv({ const { root, header, description, body, footer, closeIndicator } = dialogStyles() const Dialog = ({ role, className, ...props }: DialogProps) => { - return + return } const Trigger = (props: ButtonPrimitiveProps) => ( diff --git a/components/ui/drawer.tsx b/components/ui/drawer.tsx index 40bb9c3b..020fe545 100644 --- a/components/ui/drawer.tsx +++ b/components/ui/drawer.tsx @@ -72,6 +72,7 @@ interface DrawerOverlayPrimitiveProps "aria-label"?: DialogProps["aria-label"] "aria-labelledby"?: DialogProps["aria-labelledby"] role?: DialogProps["role"] + children?: React.ReactNode } const DrawerContentPrimitive = ({ children, ...props }: DrawerOverlayPrimitiveProps) => { @@ -178,7 +179,7 @@ const DrawerPrimitive = (props: DrawerPrimitiveProps) => { transformOrigin: "center 0" }} > - {isOpen && <>{props.children}} + {isOpen && <>{props.children as React.ReactNode}} ) } diff --git a/components/ui/grid-list.tsx b/components/ui/grid-list.tsx index 65c7ec03..45f54084 100644 --- a/components/ui/grid-list.tsx +++ b/components/ui/grid-list.tsx @@ -67,7 +67,7 @@ const Item = ({ className, ...props }: GridListItemProps) => { {selectionMode === "multiple" && selectionBehavior === "toggle" && ( )} - {props.children} + {props.children as React.ReactNode} )} diff --git a/components/ui/meter.tsx b/components/ui/meter.tsx index 2732f04d..60eda47f 100644 --- a/components/ui/meter.tsx +++ b/components/ui/meter.tsx @@ -4,13 +4,15 @@ import * as React from "react" import { motion } from "framer-motion" import { IconTriangleInfo } from "justd-icons" -import type { MeterProps as AriaMeterProps } from "react-aria-components" -import { Meter as MeterPrimitive } from "react-aria-components" +import { + Meter as MeterPrimitive, + type MeterProps as MeterPrimitiveProps +} from "react-aria-components" import { Label } from "./field" import { ctr } from "./primitive" -export interface MeterProps extends AriaMeterProps { +export interface MeterProps extends MeterPrimitiveProps { label?: string } diff --git a/components/ui/modal.tsx b/components/ui/modal.tsx index 3d34061e..5b4d8c3f 100644 --- a/components/ui/modal.tsx +++ b/components/ui/modal.tsx @@ -2,13 +2,9 @@ import * as React from "react" -import type { - DialogTriggerProps, - ModalOverlayProps as ModalOverlayPrimitiveProps -} from "react-aria-components" +import type { DialogProps, DialogTriggerProps, ModalOverlayProps } from "react-aria-components" import { - type DialogProps, - DialogTrigger as DialogTriggerPrimitive, + DialogTrigger, Modal as ModalPrimitive, ModalOverlay as ModalOverlayPrimitive } from "react-aria-components" @@ -73,13 +69,13 @@ const modalContentStyles = tv({ }) type ModalProps = DialogTriggerProps -const Modal = ({ children, ...props }: ModalProps) => { - return {children} +const Modal = (props: ModalProps) => { + return } interface ModalContentProps extends Omit, "children">, - Omit, + Omit, VariantProps { "aria-label"?: DialogProps["aria-label"] "aria-labelledby"?: DialogProps["aria-labelledby"] @@ -87,8 +83,8 @@ interface ModalContentProps closeButton?: boolean isBlurred?: boolean classNames?: { - overlay?: ModalOverlayPrimitiveProps["className"] - content?: ModalOverlayPrimitiveProps["className"] + overlay?: ModalOverlayProps["className"] + content?: ModalOverlayProps["className"] } } diff --git a/components/ui/radio.tsx b/components/ui/radio.tsx index 653a31b5..54cb1c08 100644 --- a/components/ui/radio.tsx +++ b/components/ui/radio.tsx @@ -2,19 +2,18 @@ import * as React from "react" -import { - Radio as RadioPrimitive, - RadioGroup as RadioGroupPrimitive, - type RadioGroupProps as RACRadioGroupProps, - type RadioProps as RadioPrimitiveProps, - type ValidationResult +import type { + RadioGroupProps as RadioGroupPrimitiveProps, + RadioProps as RadioPrimitiveProps, + ValidationResult } from "react-aria-components" +import { Radio as RadioPrimitive, RadioGroup as RadioGroupPrimitive } from "react-aria-components" import { tv } from "tailwind-variants" import { Description, FieldError, Label } from "./field" import { ctr } from "./primitive" -interface RadioGroupProps extends Omit { +interface RadioGroupProps extends Omit { label?: string children?: React.ReactNode description?: string @@ -79,7 +78,7 @@ const Radio = ({ description, ...props }: RadioProps) => { })} />
- <>{props.children} + {props.children as React.ReactNode} {description && {description}}
diff --git a/components/ui/select.tsx b/components/ui/select.tsx index 52412e88..1b71be68 100644 --- a/components/ui/select.tsx +++ b/components/ui/select.tsx @@ -53,7 +53,7 @@ const Select = ({ return ( {label && } - <>{children} + <>{children as React.ReactNode} {description && {description}} {errorMessage} diff --git a/components/ui/sheet.tsx b/components/ui/sheet.tsx index f5de7123..282d3d80 100644 --- a/components/ui/sheet.tsx +++ b/components/ui/sheet.tsx @@ -132,7 +132,7 @@ const SheetContent = ({ {(values) => ( <> - {props.children} + {props.children as React.ReactNode} {closeButton && ( { +const TableColumn = ({ isResizable = false, className, ...props }: TableColumnProps) => { return ( (
<> - {children} + {props.children as React.ReactNode} {allowsSorting && ( <> diff --git a/components/ui/tabs.tsx b/components/ui/tabs.tsx index 813cc9be..293e6f1a 100644 --- a/components/ui/tabs.tsx +++ b/components/ui/tabs.tsx @@ -99,7 +99,7 @@ const Tab = ({ children, ...props }: TabProps) => { > {({ isSelected }) => ( <> - {children} + {children as React.ReactNode} {isSelected && ( { - const textValue = typeof children === "string" ? children : undefined +const TagItem = ({ className, intent, shape, ...props }: TagProps) => { + const textValue = typeof props.children === "string" ? props.children : undefined const groupContext = React.useContext(TagGroupContext) return ( @@ -155,7 +155,7 @@ const TagItem = ({ children, className, intent, shape, ...props }: TagProps) => {({ allowsRemoving }) => { return ( <> - {children} + {props.children as React.ReactNode} {allowsRemoving && (