@atlaskit/primitives
Version:
Primitives are token-backed low-level building blocks.
39 lines • 1.84 kB
JavaScript
/* focusable.tsx generated by @compiled/babel-plugin v0.39.1 */
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["as", "children", "isInset", "testId", "style", "xcss"],
_excluded2 = ["className"];
import "./focusable.compiled.css";
import * as React from 'react';
import { ax, ix } from "@compiled/react/runtime";
import { forwardRef } from 'react';
var focusRingStyles = null;
var insetFocusRingStyles = null;
/**
* __Focus ring__
*
* A focus ring visually indicates the currently focused item.
*
*/
var Focusable = /*#__PURE__*/forwardRef(function (_ref, ref) {
var _ref$as = _ref.as,
Component = _ref$as === void 0 ? 'button' : _ref$as,
children = _ref.children,
isInset = _ref.isInset,
testId = _ref.testId,
style = _ref.style,
xcss = _ref.xcss,
htmlAttributes = _objectWithoutProperties(_ref, _excluded);
// 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
var _spreadClass = htmlAttributes.className,
safeHtmlAttributes = _objectWithoutProperties(htmlAttributes, _excluded2);
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;