@atlaskit/renderer
Version:
Renderer component
44 lines • 2.78 kB
JavaScript
/* panel-compiled.tsx generated by @compiled/babel-plugin v0.39.1 */
import _extends from "@babel/runtime/helpers/extends";
import "./panel-compiled.compiled.css";
import { ax, ix } from "@compiled/react/runtime";
/**
* Compiled branch of the `platform_editor_static_css` experiment.
* Used via `componentWithCondition` in `panel.tsx`.
*
* Cleanup: delete this file once the experiment has shipped.
*/
import React from 'react';
import { PanelType } from '@atlaskit/adf-schema';
import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
import { fg } from '@atlaskit/platform-feature-flags';
// New custom icons are a little smaller than predefined icons.
// To fix alignment issues with custom icons, vertical alignment is updated.
const panelEmojiSpriteVerticalAlignment = -(8 * 3 - akEditorCustomIconSize) / 2;
const panelEmojiImageVerticalAlignment = panelEmojiSpriteVerticalAlignment - 1;
const blockNodesVerticalMargin = '0.75rem';
const akEditorTableCellMinWidth = 48;
const panelBaseStyles = null;
const panelHasNoIconStyles = null;
const panelNestedIconStyles = null;
const nestedPanelStyles = null;
const panelCustomBackground = null;
export const PanelStyledCompiled = ({
backgroundColor,
children,
className,
hasIcon,
...props
}) => {
const customBackgroundColor = backgroundColor ? hexToEditorBackgroundPaletteColor(backgroundColor) || backgroundColor : undefined;
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- intentional: preserve existing PanelSharedCssClassName.prefix class
className: ax(["_lklzfajl _1alzoqnp _xmo1idpf _u70eidpf _1m1jidpf _50vakb7n _19agidpf _1q6xf1ug _jde2v77o _1bi2v77o _gb1eidpf _11k7idpf _fc9iidpf _1554u2gc _1eiopxbi _1w22u2gc _66ohu2gc _1it3ckbl _19s71txw _18w0h2mm _13n84jg8 _6qwr1hna _ujht1s93 _iqv91kw7 _1l9midpf _1v1c1ejb _11wb1ejb _1oah1ntv _1pciu2gc _1cgk1h6o _5zphglyw _wz94glyw _zs6jglyw _1n3wglyw _1yw1vq3b _1h33yhbg _1a3fnkob _1uvd116y _1hau12gs _7c6pj39m _udsa1o8l _nlelp2ly _18y8qm1h _e5ovn729 _g8a34pcx _1g6dibhp _1udservl _15sp1vk5 _1fe7s4qr _s4ldn729 _gt7x4pcx", !hasIcon && "_1whxutpp _1b0jutpp", props['data-panel-type'] === PanelType.CUSTOM && backgroundColor && "_122m1aok", fg('platform_editor_nested_dnd_styles_changes') && "_9dunutpp _pzbautpp", "_1wvnia51", className]),
style: {
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- intentional: custom panel background is dynamic via CSS variable
'--ak-renderer-panel-custom-bg-color': customBackgroundColor
}
}), children);
};
PanelStyledCompiled.displayName = 'PanelStyledCompiled';