flipper-plugin
Version:
Flipper Desktop plugin SDK and components
115 lines • 4.57 kB
JavaScript
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.normalizeSpace = exports.normalizePadding = exports.theme = void 0;
const antColors = __importStar(require("@ant-design/colors"));
// Exposes all the variables defined in themes/base.less:
exports.theme = {
white: 'white', // use as counter color for primary
black: 'black',
primaryColor: 'var(--flipper-primary-color)',
successColor: 'var(--flipper-success-color)',
errorColor: 'var(--flipper-error-color)',
warningColor: 'var(--flipper-warning-color)',
textColorPrimary: 'var(--flipper-text-color-primary)',
textColorSecondary: 'var(--flipper-text-color-secondary)',
textColorPlaceholder: 'var(--flipper-text-color-placeholder)',
textColorActive: 'var(--light-color-button-active)',
searchHighlightBackground: {
yellow: antColors.yellow[3],
red: antColors.red[3],
green: antColors.green[3],
blue: antColors.blue[3],
},
selectionBackgroundColor: 'var(--flipper-primary-background-wash)',
disabledColor: 'var(--flipper-disabled-color)',
backgroundDefault: 'var(--flipper-background-default)',
backgroundWash: 'var(--flipper-background-wash)',
buttonDefaultBackground: 'var(--flipper-button-default-background)',
backgroundTransparentHover: 'var(--flipper-background-transparent-hover)',
dividerColor: 'var(--flipper-divider-color)',
borderColor: 'var(--flipper-border-color)',
borderRadius: 'var(--flipper-border-radius)',
containerBorderRadius: 8,
inlinePaddingV: 6, // vertical padding on inline elements like buttons
inlinePaddingH: 12, // horizontal ,,,
space: {
// from Space component in Ant
tiny: 4,
small: 8,
medium: 12,
large: 16,
huge: 24,
},
fontSize: {
large: '16px',
default: '14px',
small: '12px',
smaller: '10px',
},
monospace: {
fontFamily: 'SF Mono,Monaco,Andale Mono,monospace',
fontSize: '12px',
},
bold: 600,
semanticColors: {
attribute: antColors.orange[5],
// TODO: Fix this the next time the file is edited.
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
nullValue: antColors.grey.primary,
stringValue: antColors.orange[5],
colorValue: antColors.cyan[5],
booleanValue: antColors.magenta[5],
numberValue: antColors.blue[5],
diffAddedBackground: 'var(--flipper-diff-added-background)',
diffRemovedBackground: 'var(--flipper-diff-removed-background)',
},
};
function normalizePadding({ padv, padh, pad, }) {
if (padv === undefined && padh === undefined && pad === undefined) {
return undefined;
}
return `${normalizeSpace(padv ?? pad ?? 0, exports.theme.inlinePaddingV)}px ${normalizeSpace(padh ?? pad ?? 0, exports.theme.inlinePaddingH)}px`;
}
exports.normalizePadding = normalizePadding;
function normalizeSpace(spacing, defaultSpace) {
return spacing === true
? defaultSpace
: spacing === undefined || spacing === false
? 0
: typeof spacing === 'string'
? exports.theme.space[spacing]
: spacing;
}
exports.normalizeSpace = normalizeSpace;
//# sourceMappingURL=theme.js.map
;