@progress/kendo-react-layout
Version:
React Layout components enable you to create a perceptive and intuitive layout of web projects. KendoReact Layout package
45 lines (44 loc) • 1.32 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 s from "react";
import r from "prop-types";
import { focusFirstFocusableChild as d, classNames as f } from "@progress/kendo-react-common";
const l = s.forwardRef((p, n) => {
const { children: o, className: t, style: e } = p, a = s.useRef(null), c = s.useCallback(() => {
a.current && d(a.current);
}, []), i = s.useCallback(
() => ({
element: a.current,
focus: c
}),
[c]
);
s.useImperativeHandle(n, i);
const m = s.useMemo(
() => f(
"k-appbar-spacer",
{
"k-appbar-spacer-sized": e && e.width && e.width !== null
},
t
),
[t, e]
), u = s.useMemo(() => ({
flexBasis: e && e.width ? e.width : void 0
}), [e]);
return /* @__PURE__ */ s.createElement("span", { className: m, style: u }, o);
});
l.propTypes = {
children: r.any,
className: r.string,
style: r.object
};
l.displayName = "KendoAppBarSpacer";
export {
l as AppBarSpacer
};