@atlaskit/primitives
Version:
Primitives are token-backed low-level building blocks.
38 lines • 1.43 kB
JavaScript
/* focusable.tsx generated by @compiled/babel-plugin v0.39.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-ignore -- not using expect since it causes issues with help-center local consumption - 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(["_ymio1r31 _ypr0glyw _zcxs1o36 _mizu194a _1ah3dkaa _ra3xnqa1 _128mdkaa _1cvmnqa1 _4davt94y", isInset && "_1ah31gjf _2mwq1gjf", xcss]),
style: style,
"data-testid": testId
}), children);
});
export default Focusable;