@engie-group/fluid-design-system-react
Version:
Fluid Design System React
16 lines (13 loc) • 1.04 kB
JavaScript
import { jsxs, jsx } from 'react/jsx-runtime';
import React__default from 'react';
import { Utils } from '../../utils/util.js';
const rootComponentClassName = 'nj-status-indicator';
const NJStatusIndicator = React__default.forwardRef(({ children, scale, status, className, hideLabel, ...htmlProps }, ref) => {
const statusIndicatorClasses = Utils.classNames(rootComponentClassName, {
[`${rootComponentClassName}--${scale}`]: scale && scale !== 'md',
[`${rootComponentClassName}--${status}`]: status
}, className);
return (jsxs("div", { ...htmlProps, ref: ref, className: statusIndicatorClasses, "aria-hidden": children ? undefined : 'true', children: [jsx("div", { className: `${rootComponentClassName}__svg`, children: children && hideLabel && jsx("span", { className: "nj-sr-only", children: children }) }), children && !hideLabel && jsx("p", { className: `${rootComponentClassName}__text`, children: children })] }));
});
NJStatusIndicator.displayName = 'NJStatusIndicator';
export { NJStatusIndicator };