UNPKG

@lote-design-system/marketing-blocks

Version:
174 lines (158 loc) 6.09 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.theme = exports.media = void 0; var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); var _react = _interopRequireDefault(require("react")); var _styledMediaQuery = require("styled-media-query"); var _polished = require("polished"); var _generate = require("./generate"); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } // Desktop & MacBook Pro var siteMaxWidth = '1440px'; // Media query breakpoints var breakpoints = { // Extra small devices (portrait phones) mobileS: '320px', mobileM: '375px', // Small devices (landscape phones) mobileL: '576px', // Medium devices (tablets) tablet: '768px', // Large devices (desktops) laptopL: '992px', // Extra large devices (desktops) laptopXl: '1200px', // Extra Extra large devices (desktops) laptopXxl: '1440px', // Desktop Devices desktop: '2560px' }; var media = (0, _styledMediaQuery.generateMedia)(breakpoints); exports.media = media; var defaultColors = { primary: '#01A1FF', secondary: '#3A3838', info: '#01A1FF', success: '#52C41A', danger: '#FF4D4F', warning: '#FAAD14' }; // Default Grid system is generated based on these values. For custom gird // please change the following values and set the breakpoints according to // the `media` object. var grid = { // Define the minimum dimensions at which your layout will change, // adapting to different screen sizes, for use in media queries. gridBreakpoints: { // 576px sm: breakpoints.mobileL, // 768px md: breakpoints.tablet, // 992px lg: breakpoints.laptopL, // 1200px xl: breakpoints.laptopXl }, // Define the maximum width of `Container` for different screen sizes. containerMaxWidths: { sm: '540px', md: '720px', lg: '960px', xl: '1140px' }, // Set the number of columns and specify the width of the gutters. gridColumns: 12, gridGutterWidth: 30 // Left => 15 & Right => 15 (15 + 15) = 30 }; var _generateThemeColors = (0, _generate.generateThemeColors)(defaultColors), palettes = _generateThemeColors.palettes; var NATIVE_FONT_STACK = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"'; var theme = { palettes: palettes, // Fonts that are used inside the storybook components fonts: { // For text like paragraphs and anchors body: "Roboto, ".concat(NATIVE_FONT_STACK), // Same font will also apply to the heading, but if you want to change this you could add here heading: 'inherit' }, text: { // Default heading styles heading: { marginBottom: (0, _polished.rem)(8), fontWeight: 500, lineHeight: 1.2 } }, // sizes `theme key` is used for the following properties // width, height, min-width, max-width, min-height, max-height // But make sure `styled-system` layout API is passed on the // styled-component to use these theme values. sizes: [0, 16, 18, 32, 50, 52, 64, 128, 256, 512, 576, 720, 768, 992, 960, 1140, 1200, 1440, 2560], container: { paddingRight: '32px', paddingLeft: '32px', maxWidth: siteMaxWidth }, card: { borderRadius: (0, _polished.rem)(8) }, site: { xpadding: [144, 108, 72], ypadding: [72, 64, 32] }, sections: { gradients: ['#0950BA', '#33CCFF'] }, input: _objectSpread({ color: '#000', background: '#fff', placeholder: 'gray', border: '#01A1FF', borderRadius: (0, _polished.em)(3), borderWidth: '1px', borderStyle: 'solid' }, (0, _polished.padding)((0, _polished.em)(6 - 0.5), (0, _polished.em)(12 - 0.5))), button: { display: 'inline-block', fontWeight: 400, color: 'rgba(0, 0, 0, 0.65)', textAlign: 'center', verticalAlign: 'middle', cursor: 'pointer', userSelect: 'none', backgroundColor: 'transparent', border: '1px solid transparent', padding: "".concat((0, _polished.rem)(10), " ").concat((0, _polished.rem)(26)), fontSize: (0, _polished.rem)(14), lineHeight: 1.5, borderRadius: (0, _polished.rem)(4), transition: 'background-color 0.4s linear, border-color 0.4s linear, color 0.4s linear', // Hover '&:hover': { textDecoration: 'none' }, // Focus '&:focus': { outline: 0 }, // Disable '&:disabled': { opacity: 0.65 } }, shadowSide: { up: '0 -6px 16px -8px rgba(0, 0, 0, 0.08), 0 -9px 28px 0 rgba(0, 0, 0, 0.05), 0 -12px 48px 16px rgba(0, 0, 0, 0.03)', down: '0 6px 16px -8px rgba(0, 0, 0, 0.08), 0 9px 28px 0 rgba(0, 0, 0, 0.05), 0 12px 48px 16px rgba(0, 0, 0, 0.03)', left: '-6px 0 16px -8px rgba(0, 0, 0, 0.08), -9px 0 28px 0 rgba(0, 0, 0, 0.05), -12px 0 48px 16px rgba(0, 0, 0, 0.03)', right: '6px 0 16px -8px rgba(0, 0, 0, 0.08), 9px 0 28px 0 rgba(0, 0, 0, 0.05), 12px 0 48px 16px rgba(0, 0, 0, 0.03)' }, spacing: { siteMaxWidth: siteMaxWidth }, grid: grid, media: media // media object from styled-media-query }; exports.theme = theme;