diff --git a/packages/ui/src/components/index.ts b/packages/ui/src/components/index.ts index cabc443b56..86ac4c0a3e 100644 --- a/packages/ui/src/components/index.ts +++ b/packages/ui/src/components/index.ts @@ -84,7 +84,7 @@ export { Sortable } from './composites/Sortable' export * from './primitives/button' export * from './primitives/command' export * from './primitives/dialog' -export * from './primitives/Input' +export * from './primitives/input' export * from './primitives/popover' export * from './primitives/radioGroup' export * from './primitives/shadcn-io/dropzone' diff --git a/packages/ui/src/components/primitives/Input/button.tsx b/packages/ui/src/components/primitives/Input/button.tsx deleted file mode 100644 index e8e1f767b4..0000000000 --- a/packages/ui/src/components/primitives/Input/button.tsx +++ /dev/null @@ -1 +0,0 @@ -export function WithButton() {} diff --git a/packages/ui/src/components/primitives/Input/index.tsx b/packages/ui/src/components/primitives/Input/index.tsx deleted file mode 100644 index 4309609ddf..0000000000 --- a/packages/ui/src/components/primitives/Input/index.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { WithButton } from './button' -import { Input as InternalInput } from './input' -import { Password } from './password' - -type CompoundedComponent = typeof InternalInput & { - Password: typeof Password - Button: typeof WithButton -} - -const Input: CompoundedComponent = InternalInput as CompoundedComponent -Input.Password = Password -Input.Button = WithButton - -export { Input } diff --git a/packages/ui/src/components/primitives/Input/input.tsx b/packages/ui/src/components/primitives/Input/input.tsx deleted file mode 100644 index 86403b6661..0000000000 --- a/packages/ui/src/components/primitives/Input/input.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import { cn } from '@cherrystudio/ui/utils' -import React from 'react' - -interface BaseInputProps extends React.ComponentPropsWithRef<'input'> { - startContent?: React.ReactNode - endContent?: React.ReactNode -} - -interface WithLabel extends BaseInputProps { - label: string - caption?: string -} - -interface WithoutLabel extends BaseInputProps { - label?: never - caption?: never -} - -type InputProps = WithLabel | WithoutLabel - -export function Input({ className, type, required, label, caption, ...props }: InputProps) { - const id = React.useId() - const input = ( - - ) - - if (label !== undefined) { - return ( -