@progress/kendo-react-indicators
Version:
React Indicators offer an interface to represent a visual indication for their UI elements. KendoReact Indicators package
40 lines (39 loc) • 1.2 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import * as e from "react";
import n from "prop-types";
import { useDir as f, classNames as p } from "@progress/kendo-react-common";
const o = e.forwardRef((t, c) => {
const { children: l, className: r, style: a } = t, s = e.useRef(null), i = e.useCallback(() => {
s.current && s.current.focus();
}, []);
e.useImperativeHandle(
c,
() => ({
element: s.current,
focus: i
})
);
const m = f(s, t.dir), u = e.useMemo(() => p("k-badge-container", r), [r]), d = e.useMemo(
() => ({
display: "inline-block",
...a
}),
[a]
);
return /* @__PURE__ */ e.createElement("span", { className: u, style: d, dir: m }, l);
});
o.propTypes = {
className: n.string,
dir: n.string,
style: n.object
};
o.displayName = "KendoBadgeContainer";
export {
o as BadgeContainer
};