Skip to content

Commit

Permalink
default variant tsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
jpaladin committed Dec 15, 2023
1 parent e90423b commit 28fc029
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
16 changes: 9 additions & 7 deletions packages/react-ui/SearchHeader/SearchHeader.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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
}

/**
Expand All @@ -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<HTMLButtonElement>) => {
e.stopPropagation();
setIsSearching(true);
Expand Down
9 changes: 6 additions & 3 deletions packages/react-ui/temp/react-ui.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -116,11 +116,14 @@ export type PageDrawerProps = HTMLAttributes<HTMLDivElement> & {
};

// @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
Expand Down

0 comments on commit 28fc029

Please sign in to comment.