@atlaskit/navigation-system
Version:
The latest navigation system for Atlassian apps.
26 lines (23 loc) • 1.23 kB
JavaScript
/* responsive-icon-button.tsx generated by @compiled/babel-plugin v3.0.2 */
import _extends from "@babel/runtime/helpers/extends";
import "./responsive-icon-button.compiled.css";
import { ax, ix } from "@compiled/react/runtime";
import React, { forwardRef } from 'react';
// Custom properties adapt the existing themed control to the default ADS palette.
import { useHasCustomTheme } from './has-custom-theme-context';
import { ThemedIconButton } from './themed-icon-button';
var styles = {
defaultTheme: "_syazazsu _1b56sm61 _y05i1dpa _1lx4fcek _1fcq1l7x _1wn615cr _1ir41856 _3zkhhf2y _1a59g6ey _1ugg6x5g _11f215s3 _1wknufnl _1y6knozp _1uufq98m _1jdn1gmx _17r4187o",
neutralDisabled: "_17r41j28 _rrxibk0g"
};
/**
* Keep one control mounted, including its tooltip, while its label and shape change.
*/
export var ResponsiveIconButton = /*#__PURE__*/forwardRef(function (props, ref) {
var hasCustomTheme = useHasCustomTheme();
return /*#__PURE__*/React.createElement("span", {
className: ax([!hasCustomTheme && styles.defaultTheme, !hasCustomTheme && props.appearance !== 'primary' && styles.neutralDisabled])
}, /*#__PURE__*/React.createElement(ThemedIconButton, _extends({}, props, {
ref: ref
})));
});