UNPKG

@mui/x-charts

Version:

The community edition of the Charts components (MUI X).

53 lines (52 loc) 2.06 kB
'use client'; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; import _extends from "@babel/runtime/helpers/esm/extends"; const _excluded = ["seriesId", "dataIndex", "color", "isFaded", "isHighlighted", "classes"]; import * as React from 'react'; import { styled, useThemeProps } from '@mui/material/styles'; import { animated } from '@react-spring/web'; import PropTypes from 'prop-types'; import { barLabelClasses } from "./barLabelClasses.js"; import { jsx as _jsx } from "react/jsx-runtime"; export const BarLabelComponent = styled(animated.text, { name: 'MuiBarLabel', slot: 'Root', overridesResolver: (_, styles) => [{ [`&.${barLabelClasses.faded}`]: styles.faded }, { [`&.${barLabelClasses.highlighted}`]: styles.highlighted }, styles.root] })(({ theme }) => _extends({}, theme?.typography?.body2, { stroke: 'none', fill: (theme.vars || theme)?.palette?.text?.primary, transition: 'opacity 0.2s ease-in, fill 0.2s ease-in', textAnchor: 'middle', dominantBaseline: 'central', pointerEvents: 'none', opacity: 1, [`&.${barLabelClasses.faded}`]: { opacity: 0.3 } })); function BarLabel(inProps) { const props = useThemeProps({ props: inProps, name: 'MuiBarLabel' }); const otherProps = _objectWithoutPropertiesLoose(props, _excluded); return /*#__PURE__*/_jsx(BarLabelComponent, _extends({}, otherProps)); } process.env.NODE_ENV !== "production" ? BarLabel.propTypes = { // ----------------------------- Warning -------------------------------- // | These PropTypes are generated from the TypeScript type definitions | // | To update them edit the TypeScript types and run "pnpm proptypes" | // ---------------------------------------------------------------------- classes: PropTypes.object, dataIndex: PropTypes.number.isRequired, isFaded: PropTypes.bool.isRequired, isHighlighted: PropTypes.bool.isRequired, seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired } : void 0; export { BarLabel };