@atlaskit/editor-common
Version:
A package that contains common classes and components for editor and renderer
103 lines (101 loc) • 2.97 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.iconOnlySpacing = exports.getButtonStyles = void 0;
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
var iconOnlySpacing = exports.iconOnlySpacing = {
'&&': {
padding: '0px'
},
'& > span': {
margin: '0px'
}
};
var getStyles = function getStyles(property, _ref) {
var _ref$appearance = _ref.appearance,
appearance = _ref$appearance === void 0 ? 'default' : _ref$appearance,
_ref$state = _ref.state,
state = _ref$state === void 0 ? 'default' : _ref$state,
_ref$mode = _ref.mode,
mode = _ref$mode === void 0 ? 'light' : _ref$mode;
if (!property[appearance] || !property[appearance][state]) {
return 'initial';
}
return property[appearance][state][mode];
};
var background = {
danger: {
default: {
light: 'inherit',
dark: 'inherit'
},
hover: {
light: "var(--ds-background-neutral-subtle-hovered, #091E420F)",
dark: "var(--ds-background-neutral-subtle-hovered, #091E420F)"
},
active: {
light: "var(--ds-background-neutral-pressed, #091E424F)",
dark: "var(--ds-background-neutral-pressed, #091E424F)"
}
}
};
var backgroundVisualRefresh = {
danger: {
default: {
light: 'inherit',
dark: 'inherit'
},
hover: {
light: "var(--ds-background-danger-hovered, #FFD5D2)",
dark: "var(--ds-background-danger-hovered, #FFD5D2)"
},
active: {
light: "var(--ds-background-danger-pressed, #FD9891)",
dark: "var(--ds-background-danger-pressed, #FD9891)"
}
}
};
var color = {
danger: {
default: {
light: "var(--ds-icon, #44546F)",
dark: "var(--ds-icon, #44546F)"
},
hover: {
light: "var(--ds-icon-danger, #C9372C)",
dark: "var(--ds-icon-danger, #C9372C)"
},
active: {
light: "var(--ds-icon-danger, #C9372C)",
dark: "var(--ds-icon-danger, #C9372C)"
}
}
};
var colorVisualRefresh = {
danger: {
default: {
light: "var(--ds-icon-subtle, #626F86)",
dark: "var(--ds-icon-subtle, #626F86)"
},
hover: {
light: "var(--ds-icon-danger, #C9372C)",
dark: "var(--ds-icon-danger, #C9372C)"
},
active: {
light: "var(--ds-icon-danger, #C9372C)",
dark: "var(--ds-icon-danger, #C9372C)"
}
}
};
// Ignored via go/ees005
// eslint-disable-next-line @typescript-eslint/no-explicit-any
var getButtonStyles = exports.getButtonStyles = function getButtonStyles(props) {
return {
background: getStyles(
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
(0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') ? backgroundVisualRefresh : background, props),
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
color: getStyles((0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') ? colorVisualRefresh : color, props)
};
};