@atlaskit/storybook-addon-design-system 1.1.1 → 1.2.1

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 CHANGED
@@ -1,5 +1,27 @@
1
1
  # @atlaskit/storybook-addon-design-system
2
2
 
3
+ ## 1.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 1.2.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#127511](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/127511)
14
+ [`db30e29344013`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/db30e29344013) -
15
+ Widening range of `react` and `react-dom` peer dependencies from `^16.8.0 || ^17.0.0 || ~18.2.0`
16
+ to the wider range of ``^16.8.0 || ^17.0.0 || ^18.0.0` (where applicable).
17
+
18
+ This change has been done to enable usage of `react@18.3` as well as to have a consistent peer
19
+ dependency range for `react` and `react-dom` for `/platform` packages.
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies
24
+
3
25
  ## 1.1.1
4
26
 
5
27
  ### Patch Changes
@@ -1,38 +1,36 @@
1
- After installing the package, register the addon with your Storybook configuration in the
2
- `.storybook/main.js` file.
1
+ ## Storybook v8
3
2
 
4
- ```diff
5
- module.exports = {
6
- addons: [
7
- + '@atlaskit/storybook-addon-design-system'
8
- ]
9
- };
10
- ```
11
-
12
- ## Storybook v6 and below
13
-
14
- Add the decorator to `.storybook/preview.js`, which is responsible for applying the logic which has
15
- the ability to modify the DOM of your stories.
16
-
17
- ```diff
18
- + import { withDesignTokens } from '@atlaskit/storybook-addon-design-system';
3
+ 1. Install a latest v1 version of the addon (e.g., `1.1.0`).
4
+ 2. Register the addon with your Storybook configuration in the `.storybook/main.js` file.
19
5
 
20
- const { addDecorator } = require('@storybook/react');
6
+ ```diff
7
+ module.exports = {
8
+ addons: [
9
+ + '@atlaskit/storybook-addon-design-system'
10
+ ]
11
+ };
12
+ ```
21
13
 
22
- + addDecorator(withDesignTokens);
23
- ```
14
+ ## Storybook v7
24
15
 
25
- ## Storybook v7 and above
16
+ 1. Install a pre-1.0 version of the addon (e.g., `0.8.0`).
17
+ 2. Register the addon with your Storybook configuration in the `.storybook/main.js` file.
26
18
 
27
- For Storybook version 7, the following changes are necessary:
19
+ ```diff
20
+ module.exports = {
21
+ addons: [
22
+ + '@atlaskit/storybook-addon-design-system'
23
+ ]
24
+ };
25
+ ```
28
26
 
29
- 1. Initialising the `globalTypes.adsTheme` property in the global context
30
- 2. Disable the
27
+ 3. Initialise the `globalTypes.adsTheme` property in the global context
28
+ 4. Disable the
31
29
  [built in `backgrounds` add on](https://storybook.js.org/docs/essentials/backgrounds#disable-backgrounds),
32
30
  as it conflicts with the ADS theming
33
31
 
34
- Both of these can be done in
35
- [the `preview` file](https://storybook.js.org/docs/configure#configure-story-rendering):
32
+ Both step 3 and step 4 can be done in
33
+ [the `preview.js` file](https://storybook.js.org/docs/configure#configure-story-rendering):
36
34
 
37
35
  ```diff
38
36
  + import { withDesignTokens } from '@atlaskit/storybook-addon-design-system';
@@ -58,3 +56,27 @@ const preview = {
58
56
 
59
57
  export default preview;
60
58
  ```
59
+
60
+ ## Storybook v6 and below
61
+
62
+ 1. Install a pre-1.0 version of the addon (e.g., `0.8.0`).
63
+ 2. Register the addon with your Storybook configuration in the `.storybook/main.js` file.
64
+
65
+ ```diff
66
+ module.exports = {
67
+ addons: [
68
+ + '@atlaskit/storybook-addon-design-system'
69
+ ]
70
+ };
71
+ ```
72
+
73
+ 3. Add the decorator to `.storybook/preview.js`, which is responsible for applying the logic which
74
+ has the ability to modify the DOM of your stories.
75
+
76
+ ```diff
77
+ + import { withDesignTokens } from '@atlaskit/storybook-addon-design-system';
78
+
79
+ const { addDecorator } = require('@storybook/react');
80
+
81
+ + addDecorator(withDesignTokens);
82
+ ```
@@ -13,7 +13,7 @@ var _react = _interopRequireWildcard(require("react"));
13
13
  var _previewApi = require("@storybook/preview-api");
14
14
  var _tokens = require("@atlaskit/tokens");
15
15
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
16
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
17
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
18
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
19
19
  var splitColumnStyles = {
package/dist/cjs/tool.js CHANGED
@@ -13,7 +13,7 @@ var _icons = require("@storybook/icons");
13
13
  var _managerApi = require("@storybook/manager-api");
14
14
  var _constants = require("./constants");
15
15
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
16
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
17
  var themeOptions = [{
18
18
  id: 'auto',
19
19
  title: 'Same as system',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/storybook-addon-design-system",
3
- "version": "1.1.1",
3
+ "version": "1.2.1",
4
4
  "description": "Design token storybook addon",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "publishConfig": {
@@ -8,7 +8,6 @@
8
8
  },
9
9
  "atlassian": {
10
10
  "team": "Design System Team",
11
- "releaseModel": "continuous",
12
11
  "runReact18": true,
13
12
  "website": {
14
13
  "name": "Storybook addon",
@@ -32,7 +31,7 @@
32
31
  ".": "./src/index.tsx"
33
32
  },
34
33
  "dependencies": {
35
- "@atlaskit/tokens": "^1.56.0",
34
+ "@atlaskit/tokens": "^2.0.0",
36
35
  "@babel/runtime": "^7.0.0",
37
36
  "@storybook/components": "^8.1.0",
38
37
  "@storybook/icons": "^1.2.9",
@@ -41,7 +40,7 @@
41
40
  "@storybook/types": "8.0.0"
42
41
  },
43
42
  "peerDependencies": {
44
- "react": "^16.8.0 || ^17.0.0 || ~18.2.0"
43
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
45
44
  },
46
45
  "bundler": {
47
46
  "exportEntries": [
package/src/manager.tsx CHANGED
@@ -7,7 +7,8 @@ addons.register(ADDON_ID, () => {
7
7
  addons.add(TOOL_ID, {
8
8
  type: types.TOOL,
9
9
  title: TITLE,
10
- match: ({ viewMode }) => !!(viewMode && viewMode.match(/^(story|docs)$/)),
10
+ match: ({ viewMode }: { viewMode?: string | undefined }) =>
11
+ !!(viewMode && viewMode.match(/^(story|docs)$/)),
11
12
  render: Tool,
12
13
  });
13
14
  });
package/src/tool.tsx CHANGED
@@ -49,7 +49,7 @@ const Tool = () => {
49
49
  trigger="click"
50
50
  // closeOnClick
51
51
  onVisibleChange={setIsVisible}
52
- tooltip={({ onHide }) => (
52
+ tooltip={({ onHide }: { onHide: () => void }) => (
53
53
  <TooltipLinkList
54
54
  links={themeOptions.map(({ id, title, icon }) => ({
55
55
  id,