Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions etc/rollup/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import url from 'rollup-plugin-url';
import babel from 'rollup-plugin-babel';
import commonjs from 'rollup-plugin-commonjs';
import { terser } from 'rollup-plugin-terser';
import json from '@rollup/plugin-json';

const pkg = require(path.resolve(process.cwd(), 'package.json'));

Expand All @@ -30,6 +31,7 @@ export default {
preserveModules: true,
external: [...Object.keys(pkg.dependencies || {}), ...Object.keys(pkg.peerDependencies || {})],
plugins: [
json(),
customResolveOptions({ extensions }),
babel({
presets: [['react-app', { flow: false, typescript: true }]],
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"devDependencies": {
"@commitlint/cli": "^8.2.0",
"@commitlint/config-conventional": "^8.2.0",
"@rollup/plugin-json": "^4.0.1",
"@semantic-release/changelog": "^3.0.1",
"@semantic-release/git": "^7.0.5",
"@testing-library/jest-dom": "^4.2.4",
Expand Down
2 changes: 0 additions & 2 deletions src/components/molecules/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import React from 'react';
import Tippy, { TippyProps } from '@tippy.js/react';
import 'tippy.js/dist/tippy.css';
import 'tippy.js/animations/shift-toward.css';

export default function Tooltip({ children, ...config }: Omit<TippyProps, 'animation' | 'theme' | 'flipOnUpdate'>) {
return (
Expand Down
7 changes: 7 additions & 0 deletions src/components/styles/GlobalStyles.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createGlobalStyle, css } from 'styled-components';
import { normalize } from 'styled-normalize';
import { typography } from '../../constants/typography';
import { version as tippyVersion } from 'tippy.js/package.json';

// Universal box sizing with Inheritance. More info: https://css-tricks.com/box-sizing/#article-header-id-6
const boxSizing = css`
Expand Down Expand Up @@ -28,11 +29,17 @@ const imagery = css`
}
`;

const tooltipGlobalStyles = css`
@import url('https://unpkg.com/tippy.js@${tippyVersion}/dist/tippy.css');
@import url('https://unpkg.com/tippy.js@${tippyVersion}/animations/shift-toward.css');
`;

const GlobalStyles = createGlobalStyle`
${normalize}
${defaultFont}
${boxSizing}
${imagery}
${tooltipGlobalStyles}
`;

export default GlobalStyles;
4 changes: 2 additions & 2 deletions src/components/styles/__snapshots__/Styles.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`allows to set global font styles 1`] = `"/* sc-component-id: sc-global-2771653525-import */ @import url('https://fonts.googleapis.com/css?family=Open+Sans:400,600,700&display=swap');"`;
exports[`allows to set global font styles 1`] = `"/* sc-component-id: sc-global-3277831321-import */ /* sc-component-id: sc-global-2771653525-import */ @import url('https://fonts.googleapis.com/css?family=Open+Sans:400,600,700&display=swap');"`;

exports[`allows to set global generic styles 1`] = `"/* sc-component-id: sc-global-2771653525 */ /* sc-component-id: sc-global-3786679869 */ /* sc-component-id: sc-global-4069480412 */ html{line-height:1.15;-webkit-text-size-adjust:100%;} body{margin:0;} main{display:block;} h1{font-size:2em;margin:0.67em 0;} hr{box-sizing:content-box;height:0;overflow:visible;} pre{font-family:monospace,monospace;font-size:1em;} a{background-color:transparent;} abbr[title]{border-bottom:none;-webkit-text-decoration:underline;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;} b,strong{font-weight:bolder;} code,kbd,samp{font-family:monospace,monospace;font-size:1em;} small{font-size:80%;} sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;} sub{bottom:-0.25em;} sup{top:-0.5em;} img{border-style:none;} button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;} button,input{overflow:visible;} button,select{text-transform:none;} button,[type=\\"button\\"],[type=\\"reset\\"],[type=\\"submit\\"]{-webkit-appearance:button;} button::-moz-focus-inner,[type=\\"button\\"]::-moz-focus-inner,[type=\\"reset\\"]::-moz-focus-inner,[type=\\"submit\\"]::-moz-focus-inner{border-style:none;padding:0;} button:-moz-focusring,[type=\\"button\\"]:-moz-focusring,[type=\\"reset\\"]:-moz-focusring,[type=\\"submit\\"]:-moz-focusring{outline:1px dotted ButtonText;} fieldset{padding:0.35em 0.75em 0.625em;} legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;} progress{vertical-align:baseline;} textarea{overflow:auto;} [type=\\"checkbox\\"],[type=\\"radio\\"]{box-sizing:border-box;padding:0;} [type=\\"number\\"]::-webkit-inner-spin-button,[type=\\"number\\"]::-webkit-outer-spin-button{height:auto;} [type=\\"search\\"]{-webkit-appearance:textfield;outline-offset:-2px;} [type=\\"search\\"]::-webkit-search-decoration{-webkit-appearance:none;} ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;} details{display:block;} summary{display:list-item;} template{display:none;} [hidden]{display:none;} html,body{font-family:\\"Open Sans\\",-apple-system,BlinkMacSystemFont,\\"Segoe UI\\",Roboto,Helvetica,Arial,sans-serif,\\"Apple Color Emoji\\",\\"Segoe UI Emoji\\",\\"Segoe UI Symbol\\";font-size:16px;} html{box-sizing:border-box;} *,*:before,*:after{box-sizing:inherit;} img{max-width:100%;}"`;
exports[`allows to set global generic styles 1`] = `"/* sc-component-id: sc-global-3277831321-import */ @import url('https://unpkg.com/tippy.js@5.1.4/dist/tippy.css'); @import url('https://unpkg.com/tippy.js@5.1.4/animations/shift-toward.css');"`;
9 changes: 8 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1441,6 +1441,13 @@
universal-user-agent "^2.0.0"
url-template "^2.0.8"

"@rollup/plugin-json@^4.0.1":
version "4.0.1"
resolved "https://registry.yarnpkg.com/@rollup/plugin-json/-/plugin-json-4.0.1.tgz#223898c6c37993886da06989b0e93ceef52aa3ce"
integrity sha512-soxllkhOGgchswBAAaTe7X9G80U2tjjHvXv0sBrriLJcC/89PkP59iTrKPOfbz3SjX088mKDmMhAscuyLz8ZSg==
dependencies:
rollup-pluginutils "^2.5.0"

"@samverschueren/stream-to-observable@^0.3.0":
version "0.3.0"
resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f"
Expand Down Expand Up @@ -12786,7 +12793,7 @@ rollup-plugin-url@^3.0.0:
mime "^2.4.4"
rollup-pluginutils "^2.8.2"

rollup-pluginutils@^2.8.1, rollup-pluginutils@^2.8.2:
rollup-pluginutils@^2.5.0, rollup-pluginutils@^2.8.1, rollup-pluginutils@^2.8.2:
version "2.8.2"
resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e"
integrity sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==
Expand Down