diff --git a/canon-docs/src/app/(docs)/components/text-field/page.mdx b/canon-docs/src/app/(docs)/components/text-field/page.mdx index bd5fa31025..ed857def4e 100644 --- a/canon-docs/src/app/(docs)/components/text-field/page.mdx +++ b/canon-docs/src/app/(docs)/components/text-field/page.mdx @@ -33,9 +33,16 @@ A text field component for your forms. We recommend starting with our [global tokens](/theme/theming) to customize the library and align it with your brand. For additional flexibility, you can use the provided class names for each element listed below. - `} - /> + - `canon-TextField` + - `canon-TextFieldLabel` + - `canon-TextFieldRequired` + - `canon-TextFieldInputWrapper` + - `canon-TextFieldIcon` + - `canon-TextFieldInput` + - `canon-TextFieldClearButton` + - `canon-TextFieldClearButtonIcon` + - `canon-TextFieldDescription` + - `canon-TextFieldError` @@ -55,8 +62,8 @@ We support two different sizes: `small`, `medium`. open preview={} code={` - - + } /> + } /> `} /> diff --git a/canon-docs/src/app/(docs)/components/text-field/props.ts b/canon-docs/src/app/(docs)/components/text-field/props.ts index cafed21189..74dec9d5e6 100644 --- a/canon-docs/src/app/(docs)/components/text-field/props.ts +++ b/canon-docs/src/app/(docs)/components/text-field/props.ts @@ -5,12 +5,16 @@ export const inputPropDefs: Record = { size: { type: 'enum', values: ['small', 'medium'], - default: 'medium', - responsive: false, + default: 'small', + responsive: true, }, label: { type: 'string', }, + icon: { + type: 'enum', + values: ['ReactNode'], + }, description: { type: 'string', }, diff --git a/packages/canon/report.api.md b/packages/canon/report.api.md index dec30129e3..ebec81fcae 100644 --- a/packages/canon/report.api.md +++ b/packages/canon/report.api.md @@ -15,6 +15,7 @@ import { ForwardRefExoticComponent } from 'react'; import { HTMLAttributes } from 'react'; import { JSX as JSX_2 } from 'react/jsx-runtime'; import { Menu as Menu_2 } from '@base-ui-components/react/menu'; +import type { MouseEventHandler } from 'react'; import { ReactElement } from 'react'; import { ReactNode } from 'react'; import { RefAttributes } from 'react'; @@ -1220,10 +1221,10 @@ export interface TextFieldProps className?: string; description?: string; error?: string | null; - icon?: React.ReactNode; + icon?: ReactNode; label?: string; name: string; - onClear?: React.MouseEventHandler; + onClear?: MouseEventHandler; size?: 'small' | 'medium' | Partial>; } diff --git a/packages/canon/src/components/TextField/TextField.stories.tsx b/packages/canon/src/components/TextField/TextField.stories.tsx index 86f9034e5c..7e625dad24 100644 --- a/packages/canon/src/components/TextField/TextField.stories.tsx +++ b/packages/canon/src/components/TextField/TextField.stories.tsx @@ -80,8 +80,8 @@ export const Sizes: Story = { }, render: args => ( - } /> - } /> + } /> + } /> ), }; diff --git a/packages/canon/src/components/TextField/types.ts b/packages/canon/src/components/TextField/types.ts index a01061cbfd..8a37a23efe 100644 --- a/packages/canon/src/components/TextField/types.ts +++ b/packages/canon/src/components/TextField/types.ts @@ -15,7 +15,7 @@ */ import type { Breakpoint } from '../../types'; - +import type { ReactNode, MouseEventHandler } from 'react'; /** @public */ export interface TextFieldProps extends Omit, 'size'> { @@ -53,10 +53,10 @@ export interface TextFieldProps /** * An icon to render before the input */ - icon?: React.ReactNode; + icon?: ReactNode; /** * Handler to call when the clear button is pressed */ - onClear?: React.MouseEventHandler; + onClear?: MouseEventHandler; }