Skip to content

Commit

Permalink
chore: storybook cookie cleanup & maintenance
Browse files Browse the repository at this point in the history
* chore: remove google-analytics/-fonts

* chore: get rid of broken circle-ci badge

* feat: add Inter font family assets to storybook

* feat: add cookie-banner
  • Loading branch information
misama-ct authored Jul 22, 2024
1 parent 10cb5ca commit 7c71425
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 31 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</p>

<p align="center">
<a href="https://www.npmjs.com/package/@commercetools-frontend/ui-kit"><img src="https://badgen.net/npm/v/@commercetools-frontend/ui-kit" alt="Latest release (latest dist-tag)" /></a> <a href="https://www.npmjs.com/package/@commercetools-frontend/ui-kit"><img src="https://badgen.net/npm/v/@commercetools-frontend/ui-kit/next" alt="Latest release (next dist-tag)" /></a> <a href="https://circleci.com/gh/commercetools/ui-kit"><img src="https://circleci.com/gh/commercetools/ui-kit.svg?style=shield&circle-token=477a5b4b825bc5a09b933d15054b99e57e3cbe73" alt="CI status" /></a> <a href="https://percy.io/commercetools-GmbH/merchant-center-application-kit"><img src="https://percy.io/static/images/percy-badge.svg" alt="This project is using Percy.io for visual regression testing" /></a>
<a href="https://www.npmjs.com/package/@commercetools-frontend/ui-kit"><img src="https://badgen.net/npm/v/@commercetools-frontend/ui-kit" alt="Latest release (latest dist-tag)" /></a> <a href="https://www.npmjs.com/package/@commercetools-frontend/ui-kit"><img src="https://badgen.net/npm/v/@commercetools-frontend/ui-kit/next" alt="Latest release (next dist-tag)" /></a> <a href="https://percy.io/commercetools-GmbH/merchant-center-application-kit"><img src="https://percy.io/static/images/percy-badge.svg" alt="This project is using Percy.io for visual regression testing" /></a>
<a href="https://bundlephobia.com/result?p=@commercetools-frontend/ui-kit"><img src="https://badgen.net/bundlephobia/minzip/@commercetools-frontend/ui-kit" alt="Minified + GZipped size" /></a> <a href="https://github.com/commercetools/ui-kit/blob/main/LICENSE"><img src="https://badgen.net/github/license/commercetools/ui-kit" alt="GitHub license" /></a>
</p>
<p align="center">
Expand Down
1 change: 0 additions & 1 deletion docs/.storybook/addons.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ import '@storybook/addon-options/register';
import '@storybook/addon-links/register';
import '@storybook/addon-contexts/register';
import '@storybook/addon-a11y/register';
import '@storybook/addon-google-analytics/register';
25 changes: 24 additions & 1 deletion docs/.storybook/manager-head.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
<script>document.title = "UI Kit";</script>;
<script>
document.title = "UI Kit"; window.STORYBOOK_GA_ID = "UA-38285631-31";
function injectScript(url, attributes = {}, onLoad) {
var tag = document.createElement('script');
tag.type = 'text/javascript';
tag.src = url;
Object.keys(attributes).forEach((key) => {
tag.setAttribute(key, attributes[key]);
});

if (onLoad) tag.onload = onLoad;
document.head.appendChild(tag);
};

// Inject the cookie consent scripts only if the page is served on a `*.commercetools.com` domain.
if (window && window.location.host.includes('.commercetools.com')) {
injectScript(
'https://cdn.cookielaw.org/consent/b104027d-4d10-4b75-9675-9ffef11562a8/OtAutoBlock.js'
);
injectScript(
'https://cdn.cookielaw.org/scripttemplates/otSDKStub.js',
{ 'data-domain-script': 'b104027d-4d10-4b75-9675-9ffef11562a8' },
'function OptanonWrapper() {};'
);
}
</script>
5 changes: 2 additions & 3 deletions docs/.storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<link rel="preconnect" href="https://fonts.googleapis.com"></link>
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin></link>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Open+Sans:ital,wght@0,300;0,400;0,700;1,400;1,700&display=swap" rel="stylesheet"></link>
<link rel="stylesheet" href="./fonts/index.css">
<style>
html,
body {
font-size: var(--font-size-for-body);
font-family: var(--font-family);
}

body {
Expand Down
Binary file added docs/assets/fonts/InterVariable-Italic.woff2
Binary file not shown.
Binary file added docs/assets/fonts/InterVariable.woff2
Binary file not shown.
14 changes: 14 additions & 0 deletions docs/assets/fonts/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@font-face {
font-family: Inter;
font-style: normal;
font-weight: 100 900;
font-display: swap;
src: url("InterVariable.woff2") format("woff2");
}
@font-face {
font-family: Inter;
font-style: italic;
font-weight: 100 900;
font-display: swap;
src: url("InterVariable-Italic.woff2") format("woff2");
}
1 change: 0 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"@storybook/addon-a11y": "5.3.21",
"@storybook/addon-actions": "5.3.21",
"@storybook/addon-contexts": "5.3.21",
"@storybook/addon-google-analytics": "5.3.21",
"@storybook/addon-info": "5.3.21",
"@storybook/addon-knobs": "5.3.21",
"@storybook/addon-links": "5.3.21",
Expand Down
24 changes: 0 additions & 24 deletions docs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1940,7 +1940,6 @@ __metadata:
"@storybook/addon-a11y": 5.3.21
"@storybook/addon-actions": 5.3.21
"@storybook/addon-contexts": 5.3.21
"@storybook/addon-google-analytics": 5.3.21
"@storybook/addon-info": 5.3.21
"@storybook/addon-knobs": 5.3.21
"@storybook/addon-links": 5.3.21
Expand Down Expand Up @@ -2569,19 +2568,6 @@ __metadata:
languageName: node
linkType: hard

"@storybook/addon-google-analytics@npm:5.3.21":
version: 5.3.21
resolution: "@storybook/addon-google-analytics@npm:5.3.21"
dependencies:
"@storybook/addons": 5.3.21
"@storybook/core-events": 5.3.21
core-js: ^3.0.1
global: ^4.3.2
react-ga: ^2.5.7
checksum: 9dc616616cc60ea1d4f09a2a4e6e341a8b2e25a350e8299f6695b4719c8afdc2d1d10550a6c939c49acb9518462e6302a0d020f9a4b769a6686d5aa849931bbc
languageName: node
linkType: hard

"@storybook/addon-info@npm:5.3.21":
version: 5.3.21
resolution: "@storybook/addon-info@npm:5.3.21"
Expand Down Expand Up @@ -11357,16 +11343,6 @@ __metadata:
languageName: node
linkType: hard

"react-ga@npm:^2.5.7":
version: 2.7.0
resolution: "react-ga@npm:2.7.0"
peerDependencies:
prop-types: ^15.6.0
react: ^15.6.2 || ^16.0
checksum: 15d8571c156edfaa204ff0041db7a901b0eeca3e3b21774e918269b0fe48204bb5b6a3df882caea5e0077aa3a32be39a48e7082e556563338f2a78b402a59463
languageName: node
linkType: hard

"react-helmet-async@npm:^1.0.2":
version: 1.3.0
resolution: "react-helmet-async@npm:1.3.0"
Expand Down

0 comments on commit 7c71425

Please sign in to comment.