@actinc/dls
Version:
Design Language System (DLS) for ACT & Encoura front-end projects.
32 lines • 1.8 kB
JavaScript
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
import { jsx as _jsx } from "react/jsx-runtime";
/**
* Copyright (c) ACT, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/* eslint-disable security/detect-non-literal-regexp */
import { Tooltip } from '@mui/material';
import { StyledTypography } from './styles';
export var CustomizedAxisTick = function (_a) {
var onClick = _a.onClick, y = _a.y, textWidth = _a.textWidth, payload = _a.payload, height = _a.height, orientation = _a.orientation, type = _a.type, style = _a.style, variant = _a.variant, yAxisLabelTypographyProps = _a.yAxisLabelTypographyProps;
var onClickHandler = function () {
if (onClick && payload) {
onClick(payload);
}
};
return (_jsx("foreignObject", { height: height, orientation: orientation, requiredFeatures: "http://www.w3.org/TR/SVG11/feature#Extensibility", style: style, textAnchor: "middle", type: type, width: textWidth || (variant ? 60 : 80), y: y - 20, children: _jsx(Tooltip, { title: (payload === null || payload === void 0 ? void 0 : payload.value) || '', children: _jsx(StyledTypography, __assign({ noWrap: true, onClick: onClickHandler }, yAxisLabelTypographyProps, { children: payload === null || payload === void 0 ? void 0 : payload.value })) }) }));
};
export default CustomizedAxisTick;
//# sourceMappingURL=index.js.map