@navinc/base-react-components
Version:
Nav's Pattern Library
44 lines (43 loc) • 2.3 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
const styled_components_1 = __importDefault(require("styled-components"));
const react_1 = require("@storybook/react");
const copy_js_1 = __importDefault(require("./copy.js"));
const theme_js_1 = require("./theme.js");
const Container = styled_components_1.default.div.withConfig({ displayName: "brc-sc-Container", componentId: "brc-sc-1cd56kp" }) `
display: flex;
flex-wrap: wrap;
`;
const Row = styled_components_1.default.div.withConfig({ displayName: "brc-sc-Row", componentId: "brc-sc-wnuvzd" }) `
display: flex;
width: 100%;
& > ${copy_js_1.default} {
margin-top: 8px;
margin-right: 8px;
}
`;
const ColorItem = styled_components_1.default.div.withConfig({ displayName: "brc-sc-ColorItem", componentId: "brc-sc-1p4ywq8" }) `
flex: 1 1 160px;
padding: 16px;
& > * {
text-align: center;
margin: 0 auto;
}
`;
const ColorDot = styled_components_1.default.div.withConfig({ displayName: "brc-sc-ColorDot", componentId: "brc-sc-1srnlnh" }) `
height: 32px;
width: 32px;
background-color: ${({ color }) => color};
border-radius: 50%;
`;
(0, react_1.storiesOf)('2. Misc | Theme', module).add('theme', () => ((0, jsx_runtime_1.jsx)(Container, { children: Object.entries(theme_js_1.theme).map(([key, value]) => {
if (typeof value === 'string' && (value.startsWith('#') || value.startsWith('rgba')))
return ((0, jsx_runtime_1.jsxs)(ColorItem, { children: [(0, jsx_runtime_1.jsx)(copy_js_1.default, Object.assign({ bold: true }, { children: key })), (0, jsx_runtime_1.jsx)(copy_js_1.default, Object.assign({ light: true }, { children: value })), (0, jsx_runtime_1.jsx)(ColorDot, { color: value })] }));
else
return ((0, jsx_runtime_1.jsxs)(Row, { children: [(0, jsx_runtime_1.jsx)(copy_js_1.default, Object.assign({ bold: true }, { children: key })), (0, jsx_runtime_1.jsx)(copy_js_1.default, { children: typeof value === 'function' ? 'is function, see theme.js for details.' : JSON.stringify(value) })] }));
}) })));
//# sourceMappingURL=story.js.map