UNPKG

flipper-plugin

Version:

Flipper Desktop plugin SDK and components

42 lines 1.79 kB
"use strict"; /** * 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 __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Container = void 0; const styled_1 = __importDefault(require("@emotion/styled")); const theme_1 = require("./theme"); exports.Container = styled_1.default.div(({ bordered, borderBottom, borderLeft, borderRight, borderTop, rounded, width, height, grow, shrink, gap, center, ...rest }) => ({ display: 'flex', flexDirection: 'column', flex: grow && shrink ? `1 1 0` // allow growing, and shrinking smaller than actual size : grow ? `1 0 auto` // allow grow, start at natural size : shrink ? `0 1 0` // allow shrinking smaller than natural size : `0 0 auto`, // (default) use natural size, don't grow or shrink (in parent flex direction) alignItems: center ? 'center' : 'stretch', gap: (0, theme_1.normalizeSpace)(gap, theme_1.theme.space.small), minWidth: shrink ? 0 : undefined, maxWidth: shrink ? '100%' : undefined, boxSizing: 'border-box', width, height, padding: (0, theme_1.normalizePadding)(rest), borderRadius: rounded ? theme_1.theme.containerBorderRadius : undefined, borderStyle: 'solid', borderColor: theme_1.theme.dividerColor, borderWidth: bordered ? 1 : `${borderTop ? 1 : 0}px ${borderRight ? 1 : 0}px ${borderBottom ? 1 : 0}px ${borderLeft ? 1 : 0}px`, })); //# sourceMappingURL=Container.js.map