diff --git a/Client/src/Components/Button/index.jsx b/Client/src/Components/Button/index.jsx index f357e1dd2..66a345746 100644 --- a/Client/src/Components/Button/index.jsx +++ b/Client/src/Components/Button/index.jsx @@ -21,10 +21,14 @@ const levelConfig = { }; /** - * @typedef {Object} Props - * @property {'primary' | 'secondary' | 'tertiary' | 'error'} level - The level of the button - * @property {string} label - The label of the button - * @property {boolean} [disabled] - Whether the button is disabled + * @param {Object} props + * @param {'primary' | 'secondary' | 'tertiary' | 'error'} props.level - The level of the button + * @param {string} props.label - The label of the button + * @param {boolean} [props.disabled] - Whether the button is disabled + * @returns {JSX.Element} + * @example + * // Render an error button + * */ const Button = ({ level, label, disabled }) => { diff --git a/Client/src/Components/Label/BaseLabel.css b/Client/src/Components/Label/BaseLabel.css new file mode 100644 index 000000000..6aed6326d --- /dev/null +++ b/Client/src/Components/Label/BaseLabel.css @@ -0,0 +1,6 @@ +.label { + border: 1px solid #000; + display: inline-flex; + justify-content: center; + align-items: center; +} diff --git a/Client/src/Components/Label/BaseLabel.jsx b/Client/src/Components/Label/BaseLabel.jsx new file mode 100644 index 000000000..aa23aeab3 --- /dev/null +++ b/Client/src/Components/Label/BaseLabel.jsx @@ -0,0 +1,54 @@ +import PropTypes from "prop-types"; +import "./BaseLabel.css"; +import { useTheme } from "@mui/material"; + +/** + * @typedef {Object} Styles + * @param {string} [color] - The text color + * @param {string} [backgroundColor] - The background color + * @param {string} [borderColor] - The border color + */ + +/** + * @component + * @param {Object} props + * @param {string} props.label - The label of the label + * @param {Styles} props.styles - CSS Styles passed from parent component + * @param {React.ReactNode} children - Children passed from parent component + * @returns {JSX.Element} + */ + +const BaseLabel = ({ label, styles, children }) => { + const theme = useTheme(); + // Grab the default borderRadius from the theme to match button style + const { borderRadius } = theme.shape; + // Calculate padding for the label to mimic button. Appears to scale correctly, not 100% sure though. + const padding = theme.spacing(1 * 0.75, 2); + + return ( +