From 28fc029c7626410a0fda741d4058d77de95e2e47 Mon Sep 17 00:00:00 2001 From: Josip Paladin Date: Fri, 15 Dec 2023 10:16:14 +0100 Subject: [PATCH] default variant tsdoc --- packages/react-ui/SearchHeader/SearchHeader.tsx | 16 +++++++++------- packages/react-ui/temp/react-ui.api.md | 9 ++++++--- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/packages/react-ui/SearchHeader/SearchHeader.tsx b/packages/react-ui/SearchHeader/SearchHeader.tsx index de0f51f8..ccfed7eb 100644 --- a/packages/react-ui/SearchHeader/SearchHeader.tsx +++ b/packages/react-ui/SearchHeader/SearchHeader.tsx @@ -1,4 +1,4 @@ -import React, { type MouseEvent } from 'react'; +import React, { ReactNode, type MouseEvent } from 'react'; import { Typography, Stack, IconButton, InputBase, useTheme } from '@mui/material'; @@ -11,9 +11,12 @@ import { Search, Clear } from '@mui/icons-material'; */ export type SearchHeaderProps = { onSubmit?: (searchTerm: string) => void, - placeholder: string, - variant: Variant, - children: React.ReactNode + placeholder?: string | undefined, + /** + * @defaultValue 'h1' + */ + variant?: Variant | undefined, + children?: ReactNode | undefined } /** @@ -26,14 +29,13 @@ export function SearchHeader({ onSubmit, placeholder, children, - variant = 'h1', - ...rest + variant = 'h1' }: SearchHeaderProps) { const [isSearching, setIsSearching] = React.useState(false); const [searchTerm, setSearchTerm] = React.useState(''); const theme = useTheme(); - console.log("theme.", theme.typography) + const handleSearchClick = (e: MouseEvent) => { e.stopPropagation(); setIsSearching(true); diff --git a/packages/react-ui/temp/react-ui.api.md b/packages/react-ui/temp/react-ui.api.md index 65e32f8a..0ce6193f 100644 --- a/packages/react-ui/temp/react-ui.api.md +++ b/packages/react-ui/temp/react-ui.api.md @@ -20,7 +20,7 @@ import { ReactNode } from 'react'; import { SyntheticEvent } from 'react'; import { TextField } from '@mui/material'; import { TextFieldProps } from '@mui/material'; -import { TypographyProps } from '@mui/material'; +import { Variant } from '@mui/material/styles/createTypography'; // @public export function ConfirmButton({ header, message, confirmButtonText, color, onConfirm, slots, ...rest }: ConfirmButtonProps): react_jsx_runtime.JSX.Element; @@ -116,11 +116,14 @@ export type PageDrawerProps = HTMLAttributes & { }; // @public -export function SearchHeader({ onSubmit, children, ...rest }: SearchHeaderProps): react_jsx_runtime.JSX.Element; +export function SearchHeader({ onSubmit, placeholder, children, variant }: SearchHeaderProps): react_jsx_runtime.JSX.Element; // @public -export type SearchHeaderProps = TypographyProps & { +export type SearchHeaderProps = { onSubmit?: (searchTerm: string) => void; + placeholder?: string | undefined; + variant?: Variant | undefined; + children?: ReactNode | undefined; }; // @public