diff --git a/src/components/MUI/DataDisplay/Badge.stories.tsx b/src/components/MUI/DataDisplay/Badge.stories.tsx index 18ab3b40..ba479284 100644 --- a/src/components/MUI/DataDisplay/Badge.stories.tsx +++ b/src/components/MUI/DataDisplay/Badge.stories.tsx @@ -65,7 +65,7 @@ export const InvisibleNumber: Story = { render: (args) => , }; -export const Colors: Story = { +export const Colours: Story = { args: { badgeContent: 7 }, render: (args) => ( <> diff --git a/src/components/MUI/MuiWrapped.tsx b/src/components/MUI/MuiWrapped.tsx index 13284a4f..06fef5a8 100644 --- a/src/components/MUI/MuiWrapped.tsx +++ b/src/components/MUI/MuiWrapped.tsx @@ -4,14 +4,23 @@ import MuiAddIcon from "@mui/icons-material/Add"; import MuiAssignmentIcon from "@mui/icons-material/Assignment"; import MuiDeleteIcon from "@mui/icons-material/Delete"; import MuiExpandMoreIcon from "@mui/icons-material/ExpandMore"; +import MuiFavoriteIcon from "@mui/icons-material/Favorite"; +import MuiFileCopyIcon from "@mui/icons-material/FileCopy"; import MuiFolderIcon from "@mui/icons-material/Folder"; +import MuiGrainIcon from "@mui/icons-material/Grain"; +import MuiHomeIcon from "@mui/icons-material/Home"; import MuiInboxIcon from "@mui/icons-material/Inbox"; +import MuiLocationOnIcon from "@mui/icons-material/LocationOn"; import MuiMailIcon from "@mui/icons-material/Mail"; import MuiMenuIcon from "@mui/icons-material/Menu"; import MuiNotificationsIcon from "@mui/icons-material/Notifications"; import MuiPageviewIcon from "@mui/icons-material/Pageview"; +import MuiPrintIcon from "@mui/icons-material/Print"; +import MuiRestoreIcon from "@mui/icons-material/Restore"; import MuiSaveIcon from "@mui/icons-material/Save"; import MuiSendIcon from "@mui/icons-material/Send"; +import MuiShareIcon from "@mui/icons-material/Share"; +import MuiWhatshotIcon from "@mui/icons-material/Whatshot"; import MuiWorkIcon from "@mui/icons-material/Work"; import MuiAccordion, { @@ -29,8 +38,20 @@ import MuiAvatar, { AvatarProps as MuiAvatarProps } from "@mui/material/Avatar"; import MuiAvatarGroup, { AvatarGroupProps as MuiAvatarGroupProps, } from "@mui/material/AvatarGroup"; +import MuiBackdrop, { + BackdropProps as MuiBackdropProps, +} from "@mui/material/Backdrop"; import MuiBadge, { BadgeProps as MuiBadgeProps } from "@mui/material/Badge"; +import MuiBottomNavigation, { + BottomNavigationProps as MuiBottomNavigationProps, +} from "@mui/material/BottomNavigation"; +import MuiBottomNavigationAction, { + BottomNavigationActionProps as MuiBottomNavigationActionProps, +} from "@mui/material/BottomNavigationAction"; import MuiBox, { BoxProps as MuiBoxProps } from "@mui/material/Box"; +import MuiBreadcrumbs, { + BreadcrumbsProps as MuiBreadcrumbsProps, +} from "@mui/material/Breadcrumbs"; import MuiButton, { ButtonProps as MuiButtonProps } from "@mui/material/Button"; import MuiCard, { CardProps as MuiCardProps } from "@mui/material/Card"; import MuiCardActions, { @@ -43,13 +64,31 @@ import MuiCardMedia, { CardMediaProps as MuiCardMediaProps, } from "@mui/material/CardMedia"; import MuiChip, { ChipProps as MuiChipProps } from "@mui/material/Chip"; +import MuiCircularProgress, { + CircularProgressProps as MuiCircularProgressProps, +} from "@mui/material/CircularProgress"; +import MuiDialog, { DialogProps as MuiDialogProps } from "@mui/material/Dialog"; +import MuiDialogActions, { + DialogActionsProps as MuiDialogActionsProps, +} from "@mui/material/DialogActions"; +import MuiDialogContent, { + DialogContentProps as MuiDialogContentProps, +} from "@mui/material/DialogContent"; +import MuiDialogTitle, { + DialogTitleProps as MuiDialogTitleProps, +} from "@mui/material/DialogTitle"; import MuiDivider, { DividerProps as MuiDividerProps, } from "@mui/material/Divider"; +import MuiDrawer, { DrawerProps as MuiDrawerProps } from "@mui/material/Drawer"; import MuiIcon, { IconProps as MuiIconProps } from "@mui/material/Icon"; import MuiIconButton, { IconButtonProps as MuiIconButtonProps, } from "@mui/material/IconButton"; +import MuiLinearProgress, { + LinearProgressProps as MuiLinearProgressProps, +} from "@mui/material/LinearProgress"; +import MuiLink, { LinkProps as MuiLinkProps } from "@mui/material/Link"; import MuiList, { ListProps as MuiListProps } from "@mui/material/List"; import MuiListItem, { ListItemProps as MuiListItemProps, @@ -69,25 +108,13 @@ import MuiListItemText, { import MuiListSubheader, { ListSubheaderProps as MuiListSubheaderProps, } from "@mui/material/ListSubheader"; -import MuiBackdrop, { - BackdropProps as MuiBackdropProps, -} from "@mui/material/Backdrop"; -import MuiCircularProgress, { - CircularProgressProps as MuiCircularProgressProps, -} from "@mui/material/CircularProgress"; -import MuiDialog, { DialogProps as MuiDialogProps } from "@mui/material/Dialog"; -import MuiDialogTitle, { - DialogTitleProps as MuiDialogTitleProps, -} from "@mui/material/DialogTitle"; -import MuiDialogActions, { - DialogActionsProps as MuiDialogActionsProps, -} from "@mui/material/DialogActions"; -import MuiDialogContent, { - DialogContentProps as MuiDialogContentProps, -} from "@mui/material/DialogContent"; -import MuiLinearProgress, { - LinearProgressProps as MuiLinearProgressProps, -} from "@mui/material/LinearProgress"; +import MuiMenu, { MenuProps as MuiMenuProps } from "@mui/material/Menu"; +import MuiMenuItem, { + MenuItemProps as MuiMenuItemProps, +} from "@mui/material/MenuItem"; +import MuiPagination, { + PaginationProps as MuiPaginationProps, +} from "@mui/material/Pagination"; import MuiPaper, { PaperProps as MuiPaperProps } from "@mui/material/Paper"; import MuiSkeleton, { SkeletonProps as MuiSkeletonProps, @@ -95,10 +122,28 @@ import MuiSkeleton, { import MuiSnackbar, { SnackbarProps as MuiSnackbarProps, } from "@mui/material/Snackbar"; +import MuiSpeedDial, { + SpeedDialProps as MuiSpeedDialProps, +} from "@mui/material/SpeedDial"; +import MuiSpeedDialAction, { + SpeedDialActionProps as MuiSpeedDialActionProps, +} from "@mui/material/SpeedDialAction"; +import MuiSpeedDialIcon from "@mui/material/SpeedDial"; import MuiStack, { StackProps as MuiStackProps } from "@mui/material/Stack"; +import MuiStepper, { + StepperProps as MuiStepperProps, +} from "@mui/material/Stepper"; +import MuiStep, { StepProps as MuiStepProps } from "@mui/material/Step"; +import MuiStepLabel, { + StepLabelProps as MuiStepLabelProps, +} from "@mui/material/StepLabel"; +import MuiStepContent, { + StepContentProps as MuiStepContentProps, +} from "@mui/material/StepContent"; import MuiSvgIcon, { SvgIconProps as MuiSvgIconProps, } from "@mui/material/SvgIcon"; +import MuiTab, { TabProps as MuiTabProps } from "@mui/material/Tab"; import MuiTable, { TableProps as MuiTableProps } from "@mui/material/Table"; import MuiTableBody, { TableBodyProps as MuiTableBodyProps, @@ -124,6 +169,7 @@ import MuiTableRow, { import MuiTableSortLabel, { TableSortLabelProps as MuiTableSortLabelProps, } from "@mui/material/TableSortLabel"; +import MuiTabs, { TabsProps as MuiTabsProps } from "@mui/material/Tabs"; import MuiToolbar, { ToolbarProps as MuiToolbarProps, } from "@mui/material/Toolbar"; @@ -131,6 +177,99 @@ import MuiTypography, { TypographyProps as MuiTypographyProps, } from "@mui/material/Typography"; +export const AddIcon = MuiWrapper( + MuiAddIcon, + "AddIcon", +); +export const AssignmentIcon = MuiWrapper( + MuiAssignmentIcon, + "AssignmentIcon", +); +export const DeleteIcon = MuiWrapper( + MuiDeleteIcon, + "DeleteIcon", +); +export const ExpandMoreIcon = MuiWrapper( + MuiExpandMoreIcon, + "ExpandMoreIcon", +); +export const FavoriteIcon = MuiWrapper( + MuiFavoriteIcon, + "FavoriteIcon", +); +export const FileCopyIcon = MuiWrapper( + MuiFileCopyIcon, + "FileCopyIcon", +); +export const FolderIcon = MuiWrapper( + MuiFolderIcon, + "FolderIcon", +); +export const GrainIcon = MuiWrapper( + MuiGrainIcon, + "GrainIcon", +); +export const HomeIcon = MuiWrapper( + MuiHomeIcon, + "HomeIcon", +); +export const InboxIcon = MuiWrapper( + MuiInboxIcon, + "InboxIcon", +); +export const LocationOnIcon = MuiWrapper( + MuiLocationOnIcon, + "LocationOnIcon", +); +export const MailIcon = MuiWrapper( + MuiMailIcon, + "MailIcon", +); +export const MenuIcon = MuiWrapper( + MuiMenuIcon, + "MenuIcon", +); +export const NotificationsIcon = MuiWrapper( + MuiNotificationsIcon, + "NotificationIcon", +); +export const PageviewIcon = MuiWrapper( + MuiPageviewIcon, + "PageviewIcon", +); +export const PrintIcon = MuiWrapper( + MuiPrintIcon, + "PrintIcon", +); +export const RestoreIcon = MuiWrapper( + MuiRestoreIcon, + "RestoreIcon", +); +export const SaveIcon = MuiWrapper( + MuiSaveIcon, + "SaveIcon", +); +export const SendIcon = MuiWrapper( + MuiSendIcon, + "SendIcon", +); +export const ShareIcon = MuiWrapper( + MuiShareIcon, + "ShareIcon", +); +export const SpeedDialIcon = MuiWrapper( + MuiSpeedDialIcon, + "SpeedDialIcon", +); +export const WhatshotIcon = MuiWrapper( + MuiWhatshotIcon, + "WhatshotIcon", +); +export const WorkIcon = MuiWrapper( + MuiWorkIcon, + "WorkIcon", +); + export const Accordion = MuiWrapper( MuiAccordion, "Accordion", @@ -143,18 +282,29 @@ export const AccordionSummary = MuiWrapper( MuiAccordionSummary, "AccordionSummary", ); -export const AddIcon = MuiWrapper(MuiAddIcon, "AddIcon"); export const Alert = MuiWrapper(MuiAlert, "Alert"); export const AppBar = MuiWrapper(MuiAppBar, "AppBar"); -export const AssignmentIcon = MuiWrapper(MuiAssignmentIcon, "AssignmentIcon"); export const Avatar = MuiWrapper(MuiAvatar, "Avatar"); export const AvatarGroup = MuiWrapper( MuiAvatarGroup, "AvatarGroup", ); -export const Badge = MuiWrapper(MuiBadge, "Badge"); export const Backdrop = MuiWrapper(MuiBackdrop, "Backdrop"); +export const Badge = MuiWrapper(MuiBadge, "Badge"); +export const BottomNavigation = MuiWrapper( + MuiBottomNavigation, + "BottomNavigation", +); +export const BottomNavigationAction = + MuiWrapper( + MuiBottomNavigationAction, + "BottomNavigationAction", + ); export const Box = MuiWrapper(MuiBox, "Box"); +export const Breadcrumbs = MuiWrapper( + MuiBreadcrumbs, + "Breadcrumbs", +); export const Button = MuiWrapper(MuiButton, "Button"); export const Card = MuiWrapper(MuiCard, "Card"); export const CardActions = MuiWrapper( @@ -170,8 +320,6 @@ export const CardMedia = MuiWrapper( "CardMedia", ); export const Chip = MuiWrapper(MuiChip, "Chip"); -export const DeleteIcon = MuiWrapper(MuiDeleteIcon, "DeleteIcon"); -export const Divider = MuiWrapper(MuiDivider, "Divider"); export const CircularProgress = MuiWrapper< MuiCircularProgressProps, HTMLSpanElement @@ -189,14 +337,18 @@ export const DialogTitle = MuiWrapper( MuiDialogTitle, "DialogTitle", ); -export const ExpandMoreIcon = MuiWrapper(MuiExpandMoreIcon, "ExpandMoreIcon"); -export const FolderIcon = MuiWrapper(MuiFolderIcon, "FolderIcon"); +export const Divider = MuiWrapper(MuiDivider, "Divider"); +export const Drawer = MuiWrapper(MuiDrawer, "Drawer"); export const Icon = MuiWrapper(MuiIcon, "Icon"); export const IconButton = MuiWrapper( MuiIconButton, "IconButton", ); -export const InboxIcon = MuiWrapper(MuiInboxIcon, "InboxIcon"); +export const LinearProgress = MuiWrapper( + MuiLinearProgress, + "LinearProgress", +); +export const Link = MuiWrapper(MuiLink, "Link"); export const List = MuiWrapper(MuiList, "List"); export const ListItem = MuiWrapper(MuiListItem, "ListItem"); export const ListItemAvatar = MuiWrapper( @@ -219,25 +371,36 @@ export const ListSubheader = MuiWrapper( MuiListSubheader, "ListSubheader", ); -export const MailIcon = MuiWrapper(MuiMailIcon, "MailIcon"); - -export const LinearProgress = MuiWrapper( - MuiLinearProgress, - "LinearProgress", -); -export const MenuIcon = MuiWrapper(MuiMenuIcon, "MenuIcon"); -export const NotificationsIcon = MuiWrapper( - MuiNotificationsIcon, - "NotificationIcon", +export const Menu = MuiWrapper(MuiMenu, "Menu"); +export const MenuItem = MuiWrapper(MuiMenuItem, "MenuItem"); +export const Pagination = MuiWrapper( + MuiPagination, + "Pagination", ); -export const PageviewIcon = MuiWrapper(MuiPageviewIcon, "PageviewIcon"); export const Paper = MuiWrapper(MuiPaper, "Paper"); -export const SaveIcon = MuiWrapper(MuiSaveIcon, "SaveIcon"); -export const SendIcon = MuiWrapper(MuiSendIcon, "SendIcon"); export const Skeleton = MuiWrapper(MuiSkeleton, "Skeleton"); export const Snackbar = MuiWrapper(MuiSnackbar, "Snackbar"); +export const SpeedDial = MuiWrapper( + MuiSpeedDial, + "SpeedDial", +); +export const SpeedDialAction = MuiWrapper( + MuiSpeedDialAction, + "SpeedDialAction", +); export const Stack = MuiWrapper(MuiStack, "Stack"); +export const Stepper = MuiWrapper(MuiStepper, "Stepper"); +export const Step = MuiWrapper(MuiStep, "Step"); +export const StepLabel = MuiWrapper( + MuiStepLabel, + "StepLabel", +); +export const StepContent = MuiWrapper( + MuiStepContent, + "StepContent", +); export const SvgIcon = MuiWrapper(MuiSvgIcon, "SvgIcon"); +export const Tab = MuiWrapper(MuiTab, "Tab"); export const Table = MuiWrapper(MuiTable, "Table"); export const TableBody = MuiWrapper( MuiTableBody, @@ -268,9 +431,9 @@ export const TableSortLabel = MuiWrapper( MuiTableSortLabel, "TableSortLabel", ); +export const Tabs = MuiWrapper(MuiTabs, "Tabs"); export const Toolbar = MuiWrapper(MuiToolbar, "Toolbar"); export const Typography = MuiWrapper( MuiTypography, "Typography", ); -export const WorkIcon = MuiWrapper(MuiWorkIcon, "WorkIcon"); diff --git a/src/components/MUI/Navigation/BottomNavigation.stories.tsx b/src/components/MUI/Navigation/BottomNavigation.stories.tsx new file mode 100644 index 00000000..8656852f --- /dev/null +++ b/src/components/MUI/Navigation/BottomNavigation.stories.tsx @@ -0,0 +1,40 @@ +import type { Meta, StoryObj } from "@storybook/react"; +import * as React from "react"; +import { + BottomNavigation, + BottomNavigationAction, + FavoriteIcon, + LocationOnIcon, + RestoreIcon, +} from "../MuiWrapped"; +import { muiDocsParameters } from "../../../../.storybook/muiDocsParameters"; + +const meta: Meta = { + title: "MUI/Navigation/BottomNavigation", + component: BottomNavigation, + tags: ["autodocs"], + parameters: muiDocsParameters, + argTypes: { + showLabels: { control: "boolean" }, + }, + args: { showLabels: true }, +}; +export default meta; +type Story = StoryObj; + +export const Basic: Story = { + render: (args) => { + const [value, setValue] = React.useState(0); + return ( + setValue(v)} + > + } /> + } /> + } /> + + ); + }, +}; diff --git a/src/components/MUI/Navigation/Breadcrumbs.stories.tsx b/src/components/MUI/Navigation/Breadcrumbs.stories.tsx new file mode 100644 index 00000000..860f8a9a --- /dev/null +++ b/src/components/MUI/Navigation/Breadcrumbs.stories.tsx @@ -0,0 +1,121 @@ +import type { Meta, StoryObj } from "@storybook/react"; +import { + Breadcrumbs, + GrainIcon, + HomeIcon, + Link, + Typography, + WhatshotIcon, + WorkIcon, +} from "../MuiWrapped"; +import { + muiDocsParameters, + muiDocsText, +} from "../../../../.storybook/muiDocsParameters"; + +const meta: Meta = { + title: "MUI/Navigation/Breadcrumbs", + component: Breadcrumbs, + tags: ["autodocs"], + parameters: { + layout: "fullscreen", + ...muiDocsParameters, + docs: { + description: { + component: ` +${muiDocsText} +Not to be confused with custom [Breadcrumbs component](?path=/docs/components-navigation-breadcrumbs--docs) (opens in this tab). +`, + }, + }, + }, + argTypes: { + separator: { control: "text" }, + maxItems: { control: { type: "number", min: 2, max: 10, step: 1 } }, + itemsBeforeCollapse: { + control: { type: "number", min: 0, max: 5, step: 1 }, + }, + itemsAfterCollapse: { + control: { type: "number", min: 0, max: 5, step: 1 }, + }, + }, + args: { + separator: "/", + maxItems: 8, + itemsBeforeCollapse: 1, + itemsAfterCollapse: 1, + }, +}; +export default meta; + +type Story = StoryObj; + +export const Basic: Story = { + render: (args) => ( + + Home + Instrument Session + Data Collection + Scan + + ), +}; + +export const CustomSeparator: Story = { + args: { separator: "›" }, + render: (args) => ( + + Home + Instrument Session + Data Collection + Scan + + ), +}; + +export const WithIcons: Story = { + render: (args) => ( + + + + Home + + + + Instrument Session + + + + Data Collection + + + + Data Collection + + + ), +}; + +export const Collapsed: Story = { + args: { + maxItems: 3, + itemsBeforeCollapse: 1, + itemsAfterCollapse: 1, + separator: "/", + }, + render: (args) => ( + + Home + Instrument Session + Data Collection + Scan + Item + + ), +}; diff --git a/src/components/MUI/Navigation/Drawer.stories.tsx b/src/components/MUI/Navigation/Drawer.stories.tsx new file mode 100644 index 00000000..9921588a --- /dev/null +++ b/src/components/MUI/Navigation/Drawer.stories.tsx @@ -0,0 +1,58 @@ +import type { Meta, StoryObj } from "@storybook/react"; +import * as React from "react"; +import { + Box, + Button, + Drawer, + List, + ListItem, + ListItemText, +} from "../MuiWrapped"; +import { muiDocsParameters } from "../../../../.storybook/muiDocsParameters"; + +const meta: Meta = { + title: "MUI/Navigation/Drawer", + component: Drawer, + tags: ["autodocs"], + parameters: muiDocsParameters, + argTypes: { + anchor: { control: "select", options: ["left", "right", "top", "bottom"] }, + }, + args: { anchor: "left" }, +}; +export default meta; +type Story = StoryObj; + +export const Basic: Story = { + render: (args) => { + const [open, setOpen] = React.useState(false); + return ( + + + setOpen(false)}> + + + + + + + + + + + + + + + + ); + }, +}; diff --git a/src/components/MUI/Navigation/Link.stories.tsx b/src/components/MUI/Navigation/Link.stories.tsx new file mode 100644 index 00000000..d4f5b658 --- /dev/null +++ b/src/components/MUI/Navigation/Link.stories.tsx @@ -0,0 +1,41 @@ +import type { Meta, StoryObj } from "@storybook/react"; +import { Link } from "../MuiWrapped"; +import { muiDocsParameters } from "../../../../.storybook/muiDocsParameters"; + +const meta: Meta = { + title: "MUI/Navigation/Link", + component: Link, + tags: ["autodocs"], + parameters: muiDocsParameters, + argTypes: { + underline: { control: "select", options: ["none", "hover", "always"] }, + color: { + control: "select", + options: [ + "inherit", + "primary", + "secondary", + "success", + "error", + "info", + "warning", + ], + }, + href: { control: "text" }, + target: { control: "select", options: ["", "_self", "_blank"] }, + rel: { control: "text" }, + children: { name: "text", control: "text" }, + }, + args: { + underline: "hover", + color: "primary", + href: "https://mui.com/", + target: "_blank", + rel: "noopener noreferrer", + children: "MUI docs", + }, +}; +export default meta; +type Story = StoryObj; + +export const Basic: Story = { render: (args) => }; diff --git a/src/components/MUI/Navigation/Menu.stories.tsx b/src/components/MUI/Navigation/Menu.stories.tsx new file mode 100644 index 00000000..ec684b3b --- /dev/null +++ b/src/components/MUI/Navigation/Menu.stories.tsx @@ -0,0 +1,103 @@ +import type { Meta, StoryObj } from "@storybook/react"; +import React from "react"; +import { + Box, + Button, + ListItemIcon, + Menu, + MenuItem, + SaveIcon, + SendIcon, +} from "../MuiWrapped"; +import { muiDocsParameters } from "../../../../.storybook/muiDocsParameters"; + +const originMap = { + tl: { vertical: "top", horizontal: "left" }, + tc: { vertical: "top", horizontal: "center" }, + tr: { vertical: "top", horizontal: "right" }, + bl: { vertical: "bottom", horizontal: "left" }, + bc: { vertical: "bottom", horizontal: "center" }, + br: { vertical: "bottom", horizontal: "right" }, +} as const; + +const meta: Meta = { + title: "MUI/Navigation/Menu", + component: Menu, + tags: ["autodocs"], + parameters: muiDocsParameters, + argTypes: { + anchorOrigin: { + control: "select", + options: Object.keys(originMap), + mapping: originMap, + }, + transformOrigin: { + control: "select", + options: Object.keys(originMap), + mapping: originMap, + }, + keepMounted: { control: "boolean" }, + variant: { control: "select", options: ["selectedMenu", "menu"] }, + }, + args: { + anchorOrigin: { vertical: "bottom", horizontal: "left" }, + transformOrigin: { vertical: "top", horizontal: "left" }, + keepMounted: false, + variant: "menu", + }, +}; +export default meta; +type Story = StoryObj; + +export const Basic: Story = { + render: (args) => { + const [anchorEl, setAnchorEl] = React.useState(null); + const open = Boolean(anchorEl); + return ( + + + setAnchorEl(null)} + > + setAnchorEl(null)}>Profile + setAnchorEl(null)}>My account + setAnchorEl(null)}>Logout + + + ); + }, +}; + +export const WithIcons: Story = { + render: (args) => { + const [anchorEl, setAnchorEl] = React.useState(null); + const open = Boolean(anchorEl); + return ( + + + setAnchorEl(null)} + > + setAnchorEl(null)}> + + + + Save + + setAnchorEl(null)}> + + + + Send + + + + ); + }, +}; diff --git a/src/components/MUI/Navigation/Pagination.stories.tsx b/src/components/MUI/Navigation/Pagination.stories.tsx new file mode 100644 index 00000000..f599cdac --- /dev/null +++ b/src/components/MUI/Navigation/Pagination.stories.tsx @@ -0,0 +1,40 @@ +import type { Meta, StoryObj } from "@storybook/react"; +import React from "react"; +import { Pagination } from "../MuiWrapped"; +import { muiDocsParameters } from "../../../../.storybook/muiDocsParameters"; + +const meta: Meta = { + title: "MUI/Navigation/Pagination", + component: Pagination, + tags: ["autodocs"], + parameters: muiDocsParameters, + argTypes: { + count: { control: { type: "number", min: 1, max: 20, step: 1 } }, + color: { control: "select", options: ["primary", "secondary", "standard"] }, + variant: { control: "select", options: ["text", "outlined"] }, + shape: { control: "select", options: ["rounded", "circular"] }, + size: { control: "select", options: ["small", "medium", "large"] }, + showFirstButton: { control: "boolean" }, + showLastButton: { control: "boolean" }, + disabled: { control: "boolean" }, + }, + args: { + count: 10, + color: "primary", + variant: "outlined", + shape: "rounded", + size: "medium", + showFirstButton: false, + showLastButton: false, + disabled: false, + }, +}; +export default meta; +type Story = StoryObj; + +export const Basic: Story = { + render: (args) => { + const [page, setPage] = React.useState(1); + return setPage(p)} />; + }, +}; diff --git a/src/components/MUI/Navigation/SpeedDial.stories.tsx b/src/components/MUI/Navigation/SpeedDial.stories.tsx new file mode 100644 index 00000000..ebd23ec8 --- /dev/null +++ b/src/components/MUI/Navigation/SpeedDial.stories.tsx @@ -0,0 +1,78 @@ +import type { Meta, StoryObj } from "@storybook/react"; +import { + Box, + FileCopyIcon, + PrintIcon, + SaveIcon, + ShareIcon, + SpeedDialAction, + SpeedDial, + WorkIcon, +} from "../MuiWrapped"; +import { muiDocsParameters } from "../../../../.storybook/muiDocsParameters"; +import React from "react"; + +const meta: Meta = { + title: "MUI/Navigation/SpeedDial", + component: SpeedDial, + tags: ["autodocs"], + parameters: muiDocsParameters, + argTypes: { + ariaLabel: { control: "text" }, + direction: { control: "select", options: ["up", "down", "left", "right"] }, + }, + args: { ariaLabel: "SpeedDial", direction: "up" }, +}; +export default meta; +type Story = StoryObj; + +export const Basic: Story = { + render: (args) => { + const [open, setOpen] = React.useState(true); + + return ( + + setOpen(true)} + onClose={() => setOpen(false)} + icon={} + sx={{ + position: "absolute", + bottom: 16, + right: 16, + }} + > + } + slotProps={{ tooltip: { title: "Copy" } }} + onClick={() => setOpen(false)} + /> + } + slotProps={{ tooltip: { title: "Save" } }} + onClick={() => setOpen(false)} + /> + } + slotProps={{ tooltip: { title: "Print" } }} + onClick={() => setOpen(false)} + /> + } + slotProps={{ tooltip: { title: "Share" } }} + onClick={() => setOpen(false)} + /> + + + ); + }, +}; diff --git a/src/components/MUI/Navigation/Stepper.stories.tsx b/src/components/MUI/Navigation/Stepper.stories.tsx new file mode 100644 index 00000000..4be0679b --- /dev/null +++ b/src/components/MUI/Navigation/Stepper.stories.tsx @@ -0,0 +1,112 @@ +import type { Meta, StoryObj } from "@storybook/react"; +import React from "react"; +import { + Box, + Button, + Step, + StepContent, + StepLabel, + Stepper, +} from "../MuiWrapped"; +import { muiDocsParameters } from "../../../../.storybook/muiDocsParameters"; + +const steps = ["Calibrate instrument", "Acquire data", "Analyse results"]; + +const meta: Meta = { + title: "MUI/Navigation/Stepper", + component: Stepper, + tags: ["autodocs"], + parameters: muiDocsParameters, + argTypes: { + orientation: { control: "select", options: ["horizontal", "vertical"] }, + alternativeLabel: { control: "boolean" }, + activeStep: { + control: { type: "number", min: 0, max: steps.length - 1, step: 1 }, + }, + }, + args: { + orientation: "horizontal", + alternativeLabel: false, + activeStep: 0, + }, +}; + +export default meta; +type Story = StoryObj; + +export const Basic: Story = { + render: (args) => { + const [active, setActive] = React.useState(0); + + return ( + + + {steps.map((label) => ( + + {label} + + ))} + + + + + + + + ); + }, +}; + +export const VerticalWorkflow: Story = { + args: { orientation: "vertical" }, + render: (args) => { + const [active, setActive] = React.useState(0); + + return ( + + + {steps.map((label) => ( + + {label} + + + + + + + + ))} + + + ); + }, +}; + +export const AlternativeLabel: Story = { + args: { alternativeLabel: true }, + render: (args) => ( + + {steps.map((label) => ( + + {label} + + ))} + + ), +}; diff --git a/src/components/MUI/Navigation/Tabs.stories.tsx b/src/components/MUI/Navigation/Tabs.stories.tsx new file mode 100644 index 00000000..b508f1c8 --- /dev/null +++ b/src/components/MUI/Navigation/Tabs.stories.tsx @@ -0,0 +1,62 @@ +import type { Meta, StoryObj } from "@storybook/react"; +import React from "react"; +import { Box, Tab, Tabs } from "../MuiWrapped"; +import { muiDocsParameters } from "../../../../.storybook/muiDocsParameters"; + +const meta: Meta = { + title: "MUI/Navigation/Tabs", + component: Tabs, + tags: ["autodocs"], + parameters: muiDocsParameters, + argTypes: { + orientation: { control: "select", options: ["horizontal", "vertical"] }, + variant: { + control: "select", + options: ["standard", "scrollable", "fullWidth"], + }, + textColor: { + control: "select", + options: ["inherit", "primary", "secondary"], + }, + indicatorColor: { control: "select", options: ["primary", "secondary"] }, + }, + args: { + orientation: "horizontal", + variant: "standard", + textColor: "primary", + indicatorColor: "primary", + }, +}; +export default meta; +type Story = StoryObj; + +export const Basic: Story = { + render: (args) => { + const [value, setValue] = React.useState(0); + return ( + + setValue(v)}> + + + + + + ); + }, +}; + +export const Vertical: Story = { + args: { orientation: "vertical" }, + render: (args) => { + const [value, setValue] = React.useState(0); + return ( + + setValue(v)}> + + + + + + ); + }, +}; diff --git a/src/components/MUI/Surfaces/AppBar.stories.tsx b/src/components/MUI/Surfaces/AppBar.stories.tsx index 798a5a88..8120b82d 100644 --- a/src/components/MUI/Surfaces/AppBar.stories.tsx +++ b/src/components/MUI/Surfaces/AppBar.stories.tsx @@ -23,7 +23,7 @@ const meta: Meta = { description: { component: ` ${muiDocsText} -Not to be confused with custom [AppTitleBar component](?path=/docs/navigation-apptitlebar--docs) (opens in this tab). +Not to be confused with custom [AppTitleBar component](?path=/docs/components-controls-apptitlebar--docs) (opens in this tab). `, }, }, diff --git a/src/components/navigation/Breadcrumbs.stories.tsx b/src/components/navigation/Breadcrumbs.stories.tsx index 3c78bb0f..aac11e01 100644 --- a/src/components/navigation/Breadcrumbs.stories.tsx +++ b/src/components/navigation/Breadcrumbs.stories.tsx @@ -6,8 +6,17 @@ const meta: Meta = { title: "Components/Navigation/Breadcrumbs", component: Breadcrumbs, tags: ["autodocs"], + parameters: { + docs: { + description: { + component: `Not to be confused with MUI's Breadcrumbs component. + See also: + [Breadcrumbs Story](?path=/docs/mui-navigation-breadcrumbs--docs) (opens in this tab) + [MUI Breadcrumbs documentation](https://v7.mui.com/material-ui/react-breadcrumbs/)`, + }, + }, + }, }; - export default meta; type Story = StoryObj;