@atlaskit/primitives
Version:
Primitives are token-backed low-level building blocks.
40 lines • 1.41 kB
JavaScript
/* focusable.tsx generated by @compiled/babel-plugin v0.36.1 */
import _extends from "@babel/runtime/helpers/extends";
import "./focusable.compiled.css";
import * as React from 'react';
import { ax, ix } from "@compiled/react/runtime";
import { forwardRef } from 'react';
const focusRingStyles = null;
const insetFocusRingStyles = null;
/**
* __Focus ring__
*
* A focus ring visually indicates the currently focused item.
*
*/
const Focusable = /*#__PURE__*/forwardRef(({
as: Component = 'button',
children,
isInset,
testId,
style,
xcss,
...htmlAttributes
}, ref) => {
// This is to remove className from safeHtmlAttributes
// @ts-expect-error className doesn't exist in the prop definition but we want to ensure it cannot be applied even if types are bypassed
const {
className: _spreadClass,
...safeHtmlAttributes
} = htmlAttributes;
return /*#__PURE__*/React.createElement(Component, _extends({}, safeHtmlAttributes, {
// @ts-ignore Expression produces a union type that is too complex to represent. We may be able to narrow the type here but unsure.
ref: ref,
className: ax(["_mizu194a _1ah31bk5 _ra3xnqa1 _128m1bk5 _1cvmnqa1 _4davt94y", isInset && "_1ah311pw _2mwq11pw", xcss])
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
,
style: style,
"data-testid": testId
}), children);
});
export default Focusable;