diff --git a/apps/docs/components/ExampleItemAccordion.tsx b/apps/docs/components/ExampleItemAccordion.tsx new file mode 100644 index 00000000..f5b9bfbd --- /dev/null +++ b/apps/docs/components/ExampleItemAccordion.tsx @@ -0,0 +1,26 @@ +import { ItemAccordion, ItemAccordionDetails, ItemAccordionSummary, ItemAccordionActions } from '@enterwell/react-ui'; +import { Button, Stack, Typography } from '@mui/material'; + +export function ExampleItemAccordion() { + return ( + + + + + Test title + + + + Test summary text + + + + + + + + + + + ) +} \ No newline at end of file diff --git a/apps/docs/pages/react-ui/components/item-accordion.mdx b/apps/docs/pages/react-ui/components/item-accordion.mdx new file mode 100644 index 00000000..48963105 --- /dev/null +++ b/apps/docs/pages/react-ui/components/item-accordion.mdx @@ -0,0 +1,33 @@ +--- +title: ItemAccordion +--- + +import { ItemAccordion } from '@enterwell/react-ui'; +import { ComponentWithSource } from '../../../components/docs/ComponentWithSource.tsx'; +import { ExampleItemAccordion } from '../../../components/ExampleItemAccordion.tsx'; +import { ComponentDescription, ComponentParameters, ComponentSource } from '../../../components/docs/ComponentDocs'; + +# ItemAccordion + +## Description + + + +### Parameters + + + +## Example + + + +## Inspect + +
+ Source code + +
\ No newline at end of file diff --git a/packages/react-ui/.changelog.json b/packages/react-ui/.changelog.json index ea1c548f..77a91f4b 100644 --- a/packages/react-ui/.changelog.json +++ b/packages/react-ui/.changelog.json @@ -9,6 +9,7 @@ "SearchHeader", "Select", "SplitButton", - "TimeInput" + "TimeInput", + "ItemAccordion" ] } \ No newline at end of file diff --git a/packages/react-ui/ItemAccordion/ItemAccordion.tsx b/packages/react-ui/ItemAccordion/ItemAccordion.tsx new file mode 100644 index 00000000..720e7a56 --- /dev/null +++ b/packages/react-ui/ItemAccordion/ItemAccordion.tsx @@ -0,0 +1,12 @@ +import MuiAccordion, { type AccordionProps } from '@mui/material/Accordion'; + +/** + * Item accordion component. + * + * @param props - The props of the component + * @returns The ItemAccordion component. + * @public + */ +export function ItemAccordion(props: AccordionProps) { + return +} diff --git a/packages/react-ui/ItemAccordion/ItemAccordionActions.tsx b/packages/react-ui/ItemAccordion/ItemAccordionActions.tsx new file mode 100644 index 00000000..5db18942 --- /dev/null +++ b/packages/react-ui/ItemAccordion/ItemAccordionActions.tsx @@ -0,0 +1,18 @@ +import { useTheme } from '@mui/material'; +import MuiAccordionActions, { type AccordionActionsProps } from '@mui/material/AccordionActions'; + +/** + * Item accordion actions component. + * + * @param props - The props of the component + * @returns The ItemAccordionActions component. + * @public + */ +export function ItemAccordionActions(props: AccordionActionsProps) { + const theme = useTheme(); + return ( + + ); +} + +export default ItemAccordionActions; diff --git a/packages/react-ui/ItemAccordion/ItemAccordionDetails.tsx b/packages/react-ui/ItemAccordion/ItemAccordionDetails.tsx new file mode 100644 index 00000000..1ab2002c --- /dev/null +++ b/packages/react-ui/ItemAccordion/ItemAccordionDetails.tsx @@ -0,0 +1,18 @@ +import { useTheme } from '@mui/material'; +import MuiAccordionDetails, { type AccordionDetailsProps } from '@mui/material/AccordionDetails'; + +/** + * Item accordion details component. + * + * @param props - The props of the component + * @returns The ItemAccordionDetails component. + * @public + */ +export function ItemAccordionDetails(props: AccordionDetailsProps) { + const theme = useTheme(); + return ( + + ); +} + +export default ItemAccordionDetails; diff --git a/packages/react-ui/ItemAccordion/ItemAccordionSummary.tsx b/packages/react-ui/ItemAccordion/ItemAccordionSummary.tsx new file mode 100644 index 00000000..56c788c9 --- /dev/null +++ b/packages/react-ui/ItemAccordion/ItemAccordionSummary.tsx @@ -0,0 +1,28 @@ +import MuiAccordionSummary, { type AccordionSummaryProps } from '@mui/material/AccordionSummary'; +import { ExpandMore } from '@mui/icons-material'; + +/** + * Item accordion summary component. + * + * @param props - The props of the component + * @returns The ItemAccordionSummary component. + * @public + */ +export function ItemAccordionSummary(props: AccordionSummaryProps) { + const { + children, + ...rest + } = props; + + return ( + } + {...rest} + sx={{ height: 56, ...rest.sx }} + > + {children} + + ); +} + +export default ItemAccordionSummary; diff --git a/packages/react-ui/ItemAccordion/index.tsx b/packages/react-ui/ItemAccordion/index.tsx new file mode 100644 index 00000000..e5f5b8ca --- /dev/null +++ b/packages/react-ui/ItemAccordion/index.tsx @@ -0,0 +1,4 @@ +export * from "./ItemAccordion"; +export * from "./ItemAccordionSummary"; +export * from "./ItemAccordionDetails"; +export * from "./ItemAccordionActions"; diff --git a/packages/react-ui/changes/Added [ItemAccordion] ItemAccordion component b/packages/react-ui/changes/Added [ItemAccordion] ItemAccordion component new file mode 100644 index 00000000..e69de29b diff --git a/packages/react-ui/index.tsx b/packages/react-ui/index.tsx index 9e5500af..9ae55a4d 100644 --- a/packages/react-ui/index.tsx +++ b/packages/react-ui/index.tsx @@ -1,6 +1,7 @@ 'use client'; // component exports +export * from "./ItemAccordion"; export * from "./Select"; export * from "./SplitButton"; export * from "./DatePicker"; diff --git a/packages/react-ui/temp/react-ui.api.md b/packages/react-ui/temp/react-ui.api.md index ca594e16..38f5d835 100644 --- a/packages/react-ui/temp/react-ui.api.md +++ b/packages/react-ui/temp/react-ui.api.md @@ -4,6 +4,10 @@ ```ts +import { AccordionActionsProps } from '@mui/material/AccordionActions'; +import { AccordionDetailsProps } from '@mui/material/AccordionDetails'; +import { AccordionProps } from '@mui/material/Accordion'; +import { AccordionSummaryProps } from '@mui/material/AccordionSummary'; import { AutocompleteProps } from '@mui/material/Autocomplete'; import { ButtonGroupProps } from '@mui/material'; import { ButtonProps } from '@mui/material'; @@ -102,6 +106,18 @@ export type DropdownButtonProps = ButtonProps & { onClick?: (event: any, value: any) => void; }; +// @public +export function ItemAccordion(props: AccordionProps): react_jsx_runtime.JSX.Element; + +// @public +export function ItemAccordionActions(props: AccordionActionsProps): react_jsx_runtime.JSX.Element; + +// @public +export function ItemAccordionDetails(props: AccordionDetailsProps): react_jsx_runtime.JSX.Element; + +// @public +export function ItemAccordionSummary(props: AccordionSummaryProps): react_jsx_runtime.JSX.Element; + // @public export function PageDrawer({ expanded, onChange, children, height, minHeight, onResize, color, ...rest }: PageDrawerProps): react_jsx_runtime.JSX.Element;