UNPKG

ffr-components

Version:

Fiori styled UI components

26 lines (23 loc) 949 B
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; import classnames from 'classnames'; import React from 'react'; var FormLabel = function FormLabel(_ref) { var required = _ref.required, children = _ref.children, className = _ref.className, htmlFor = _ref.htmlFor, label = _ref.label, props = _objectWithoutProperties(_ref, ["required", "children", "className", "htmlFor", "label"]); var formLabelClasses = classnames('fd-form-label ffr-form-label', className, { 'ffr-form-label__required': required }); return React.createElement("label", _extends({}, props, { "aria-required": required, className: formLabelClasses, htmlFor: htmlFor, "aria-label": label || (typeof children === 'string' ? children : '') }), children); }; FormLabel.displayName = 'FormLabel'; export default FormLabel;