Skip to content

Commit

Permalink
APJ-2908 upgrade atlaskit tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
Łukasz Matuszewski committed Nov 24, 2023
1 parent fef35d4 commit 775a139
Showing 22 changed files with 328 additions and 589 deletions.
31 changes: 21 additions & 10 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import '@atlaskit/css-reset/dist/bundle.css';
import '@atlaskit/tokens/css/atlassian-dark.css'
import '@atlaskit/tokens/css/atlassian-light.css'
import '@atlaskit/tokens/css/atlassian-spacing.css'
import '@atlaskit/tokens/css/atlassian-typography.css'
import { getGlobalTheme, setGlobalTheme } from '@atlaskit/tokens';
import './style.css';

import { storiesOf, configure } from '@storybook/vue';
@@ -30,10 +26,10 @@ const registerStory = (filename) => {
.addParameters({
rootAttributes: [{
root: 'html',
attribute: 'data-theme',
attribute: 'theme',
defaultState: {
name: "Light",
value: null
value: "light"
},
states: [
{
@@ -42,13 +38,14 @@ const registerStory = (filename) => {
}
]
}]
}).addDecorator(withRootAttribute)
})
.addDecorator(withRootAttribute)
.addParameters({
rootAttribute: {
attribute: 'data-theme',
attribute: 'theme',
defaultState: {
name: "Light",
value: null
value: "light"
},
states: [
{
@@ -61,6 +58,20 @@ const registerStory = (filename) => {
.add(name, () => ({
name: 'StoryWrapper',
components: component.components,
mounted() {
const targetNode = document.querySelector("html");
const config = { attributes: true };
const callback = function (mutationsList) {
for (let mutation of mutationsList) {
const currentTheme = mutation.target.getAttribute("theme");
if (mutation.type === 'attributes' && currentTheme && currentTheme !== getGlobalTheme().colorMode) {
void setGlobalTheme({ colorMode: mutation.target.getAttribute('theme') })
}
}
};
const observer = new MutationObserver(callback);
observer.observe(targetNode, config);
},
render(h) {
return h(component, { style: { padding: '20px' } });
}
10 changes: 10 additions & 0 deletions .storybook/style.css
Original file line number Diff line number Diff line change
@@ -2,6 +2,16 @@ html,
body,
#app {
height: 100%;
background-color: var(--ds-surface, #fff);
color: var(--ds-text, #172B4D);
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: 1.42857142857143;
-ms-overflow-style: -ms-autohiding-scrollbar;
-webkit-text-decoration-skip: ink;
text-decoration-skip-ink: auto;
}


3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/* eslint-env node */
module.exports = {
plugins: [
"@atlaskit/tokens/babel-plugin"
],
presets: [
[
'@babel/preset-env',
Binary file removed docs/favicon.ico
Binary file not shown.
74 changes: 0 additions & 74 deletions docs/iframe.html

This file was deleted.

19 changes: 0 additions & 19 deletions docs/index.html

This file was deleted.

1 change: 0 additions & 1 deletion docs/main.00d2a1d12d30d5ba79bb.bundle.js

This file was deleted.

3 changes: 0 additions & 3 deletions docs/main.cefdfccade8f06570bba.bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/main.cefdfccade8f06570bba.bundle.js.LICENSE.txt

This file was deleted.

1 change: 0 additions & 1 deletion docs/main.cefdfccade8f06570bba.bundle.js.map

This file was deleted.

2 changes: 0 additions & 2 deletions docs/runtime~main.cefdfccade8f06570bba.bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/runtime~main.cefdfccade8f06570bba.bundle.js.map

This file was deleted.

1 change: 0 additions & 1 deletion docs/runtime~main.f6145a39c2e3eb089a89.bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/sb_dll/storybook_ui-manifest.json

This file was deleted.

113 changes: 0 additions & 113 deletions docs/sb_dll/storybook_ui_dll.LICENCE

This file was deleted.

2 changes: 0 additions & 2 deletions docs/sb_dll/storybook_ui_dll.js

This file was deleted.

112 changes: 0 additions & 112 deletions docs/vendors~main.28c73344df1b9891621a.bundle.js

This file was deleted.

3 changes: 0 additions & 3 deletions docs/vendors~main.cefdfccade8f06570bba.bundle.js

This file was deleted.

Loading

0 comments on commit 775a139

Please sign in to comment.