1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00
metamask-extension/ui/components/component-library/label/label.js
jainex c1c6c8237a
Update Label component font weight from bold to medium (#19731)
* Update Label component font weight from bold to medium

* update snapshot

* fix snapshots

* fix snapshots 2

* Removeing deprecated constants for enums

---------

Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
2023-06-27 01:29:04 +05:30

45 lines
988 B
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import {
FontWeight,
TextVariant,
Display,
AlignItems,
} from '../../../helpers/constants/design-system';
import { Text } from '../text';
export const Label = ({ htmlFor, className, children, ...props }) => (
<Text
className={classnames(
'mm-label',
{ 'mm-label--html-for': htmlFor },
className,
)}
as="label"
htmlFor={htmlFor}
variant={TextVariant.bodyMd}
fontWeight={FontWeight.Medium}
display={Display.InlineFlex}
alignItems={AlignItems.center}
{...props}
>
{children}
</Text>
);
Label.propTypes = {
/**
* The content of the label
*/
children: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
/**
* The id of the input associated with the label
*/
htmlFor: PropTypes.string,
/**
* Additional classNames to be added to the label component
*/
className: PropTypes.string,
};