@atlaskit/storybook-addon-design-system 0.2.4 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/constellation/index/examples.mdx +5 -0
- package/constellation/index/props.mdx +0 -0
- package/constellation/index/usage.mdx +5 -0
- package/dist/cjs/tokens/decorator.js +0 -17
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/tokens/decorator.js +2 -21
- package/dist/es2019/version.json +1 -1
- package/dist/esm/tokens/decorator.js +2 -21
- package/dist/esm/version.json +1 -1
- package/package.json +9 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @atlaskit/storybook-addon-design-system
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`6c65a3147c1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6c65a3147c1) - Removes root selector hack from lightmode, this is no longer necessary since the default theme no longer enables tokens by default
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 0.2.6
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [`4942487a9f6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4942487a9f6) - Fixes internal representation of CSS entrypoints for themes. This is an internal change only and does not effect public APIs.
|
|
18
|
+
|
|
19
|
+
## 0.2.5
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
|
|
3
25
|
## 0.2.4
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
File without changes
|
|
@@ -57,23 +57,6 @@ var withDesignTokens = (0, _addons.makeDecorator)({
|
|
|
57
57
|
wrapper: function wrapper(storyFn, context) {
|
|
58
58
|
var theme = context.globals.adsTheme; // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
59
59
|
|
|
60
|
-
(0, _addons.useEffect)(function () {
|
|
61
|
-
document.querySelectorAll('style').forEach(function (el) {
|
|
62
|
-
if (el.innerText.includes(':root, html[data-theme="light"]')) {
|
|
63
|
-
// HACK: Allows us to disable the light mode style since it uses root:
|
|
64
|
-
el.innerText = el.textContent.replace(':root,', ''); // HACK: Allows us to apply the theme to children elements
|
|
65
|
-
|
|
66
|
-
el.innerText = el.textContent.replace('html[data-theme="light"]', 'html[data-theme="light"],.ads-theme-override[data-theme="light"]');
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
document.querySelectorAll('style').forEach(function (el) {
|
|
70
|
-
if (el.innerText.includes('html[data-theme="dark"]')) {
|
|
71
|
-
// HACK: Allows us to apply the theme to children elements
|
|
72
|
-
el.innerText = el.textContent.replace('html[data-theme="dark"]', 'html[data-theme="dark"],.ads-theme-override[data-theme="dark"]');
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}, [context.id]); // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
76
|
-
|
|
77
60
|
(0, _addons.useEffect)(function () {
|
|
78
61
|
if (!theme || theme === 'none') {
|
|
79
62
|
delete document.documentElement.dataset.theme;
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React, { Fragment } from 'react';
|
|
2
2
|
import { makeDecorator, useEffect } from '@storybook/addons';
|
|
3
|
-
import { token } from '@atlaskit/tokens';
|
|
4
|
-
|
|
5
|
-
import '@atlaskit/tokens/css/atlassian-light.css'; // eslint-disable-next-line
|
|
6
|
-
|
|
3
|
+
import { token } from '@atlaskit/tokens';
|
|
4
|
+
import '@atlaskit/tokens/css/atlassian-light.css';
|
|
7
5
|
import '@atlaskit/tokens/css/atlassian-dark.css';
|
|
8
6
|
import { DECORATOR_ID, DECORATOR_PARAM } from './constants';
|
|
9
7
|
const splitColumnStyles = {
|
|
@@ -32,23 +30,6 @@ const withDesignTokens = makeDecorator({
|
|
|
32
30
|
wrapper: (storyFn, context) => {
|
|
33
31
|
const theme = context.globals.adsTheme; // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
34
32
|
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
document.querySelectorAll('style').forEach(el => {
|
|
37
|
-
if (el.innerText.includes(':root, html[data-theme="light"]')) {
|
|
38
|
-
// HACK: Allows us to disable the light mode style since it uses root:
|
|
39
|
-
el.innerText = el.textContent.replace(':root,', ''); // HACK: Allows us to apply the theme to children elements
|
|
40
|
-
|
|
41
|
-
el.innerText = el.textContent.replace('html[data-theme="light"]', 'html[data-theme="light"],.ads-theme-override[data-theme="light"]');
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
document.querySelectorAll('style').forEach(el => {
|
|
45
|
-
if (el.innerText.includes('html[data-theme="dark"]')) {
|
|
46
|
-
// HACK: Allows us to apply the theme to children elements
|
|
47
|
-
el.innerText = el.textContent.replace('html[data-theme="dark"]', 'html[data-theme="dark"],.ads-theme-override[data-theme="dark"]');
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
}, [context.id]); // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
51
|
-
|
|
52
33
|
useEffect(() => {
|
|
53
34
|
if (!theme || theme === 'none') {
|
|
54
35
|
delete document.documentElement.dataset.theme;
|
package/dist/es2019/version.json
CHANGED
|
@@ -6,10 +6,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
6
6
|
|
|
7
7
|
import React, { Fragment } from 'react';
|
|
8
8
|
import { makeDecorator, useEffect } from '@storybook/addons';
|
|
9
|
-
import { token } from '@atlaskit/tokens';
|
|
10
|
-
|
|
11
|
-
import '@atlaskit/tokens/css/atlassian-light.css'; // eslint-disable-next-line
|
|
12
|
-
|
|
9
|
+
import { token } from '@atlaskit/tokens';
|
|
10
|
+
import '@atlaskit/tokens/css/atlassian-light.css';
|
|
13
11
|
import '@atlaskit/tokens/css/atlassian-dark.css';
|
|
14
12
|
import { DECORATOR_ID, DECORATOR_PARAM } from './constants';
|
|
15
13
|
var splitColumnStyles = {
|
|
@@ -38,23 +36,6 @@ var withDesignTokens = makeDecorator({
|
|
|
38
36
|
wrapper: function wrapper(storyFn, context) {
|
|
39
37
|
var theme = context.globals.adsTheme; // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
40
38
|
|
|
41
|
-
useEffect(function () {
|
|
42
|
-
document.querySelectorAll('style').forEach(function (el) {
|
|
43
|
-
if (el.innerText.includes(':root, html[data-theme="light"]')) {
|
|
44
|
-
// HACK: Allows us to disable the light mode style since it uses root:
|
|
45
|
-
el.innerText = el.textContent.replace(':root,', ''); // HACK: Allows us to apply the theme to children elements
|
|
46
|
-
|
|
47
|
-
el.innerText = el.textContent.replace('html[data-theme="light"]', 'html[data-theme="light"],.ads-theme-override[data-theme="light"]');
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
document.querySelectorAll('style').forEach(function (el) {
|
|
51
|
-
if (el.innerText.includes('html[data-theme="dark"]')) {
|
|
52
|
-
// HACK: Allows us to apply the theme to children elements
|
|
53
|
-
el.innerText = el.textContent.replace('html[data-theme="dark"]', 'html[data-theme="dark"],.ads-theme-override[data-theme="dark"]');
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}, [context.id]); // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
57
|
-
|
|
58
39
|
useEffect(function () {
|
|
59
40
|
if (!theme || theme === 'none') {
|
|
60
41
|
delete document.documentElement.dataset.theme;
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/storybook-addon-design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Design token storybook addon",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"publishConfig": {
|
|
@@ -8,7 +8,12 @@
|
|
|
8
8
|
},
|
|
9
9
|
"atlassian": {
|
|
10
10
|
"team": "Design System Team",
|
|
11
|
-
"releaseModel": "scheduled"
|
|
11
|
+
"releaseModel": "scheduled",
|
|
12
|
+
"website": {
|
|
13
|
+
"name": "Storybook addon",
|
|
14
|
+
"category": "Tooling",
|
|
15
|
+
"draft": true
|
|
16
|
+
}
|
|
12
17
|
},
|
|
13
18
|
"repository": "https://bitbucket.org/atlassian/atlassian-frontend",
|
|
14
19
|
"main": "dist/cjs/index.js",
|
|
@@ -21,7 +26,7 @@
|
|
|
21
26
|
".": "./src/index.tsx"
|
|
22
27
|
},
|
|
23
28
|
"dependencies": {
|
|
24
|
-
"@atlaskit/tokens": "^0.
|
|
29
|
+
"@atlaskit/tokens": "^0.10.0",
|
|
25
30
|
"@babel/runtime": "^7.0.0",
|
|
26
31
|
"@storybook/addons": "^6.4.0",
|
|
27
32
|
"@storybook/api": "^6.4.0",
|
|
@@ -43,5 +48,6 @@
|
|
|
43
48
|
"styling": "emotion"
|
|
44
49
|
}
|
|
45
50
|
},
|
|
51
|
+
"homepage": "https://atlassian.design/components/storybook-addon-design-system",
|
|
46
52
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
47
53
|
}
|