@d3plus/docs 3.0.1 → 3.0.2

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.
@@ -1,6 +1,5 @@
1
1
  import remarkGfm from "remark-gfm";
2
2
  import path from "node:path";
3
- import glob from "glob";
4
3
 
5
4
  // monorepo fix
6
5
  // https://storybook.js.org/docs/faq#how-do-i-fix-module-resolution-in-special-environments
@@ -13,19 +12,16 @@ module.exports = {
13
12
  "../packages/**/*.stories.@(mdx|js|jsx|ts|tsx)"
14
13
  ],
15
14
 
16
- addons: [
17
- getAbsolutePath("@storybook/addon-controls"),
18
- {
19
- name: getAbsolutePath("@storybook/addon-docs"),
20
- options: {
21
- mdxPluginOptions: {
22
- mdxCompileOptions: {
23
- remarkPlugins: [remarkGfm],
24
- },
15
+ addons: [{
16
+ name: getAbsolutePath("@storybook/addon-docs"),
17
+ options: {
18
+ mdxPluginOptions: {
19
+ mdxCompileOptions: {
20
+ remarkPlugins: [remarkGfm],
25
21
  },
26
22
  },
27
- }
28
- ],
23
+ },
24
+ }],
29
25
 
30
26
  framework: {
31
27
  name: getAbsolutePath("@storybook/nextjs"),
@@ -47,23 +43,6 @@ module.exports = {
47
43
  core: {
48
44
  disableTelemetry: true, // 👈 Disables telemetry
49
45
  disableWhatsNewNotifications: true,
50
- },
51
-
52
- webpackFinal: async (config) => {
53
- if (config.resolve) {
54
-
55
- const workspacePackages = glob.sync('../*/').reduce((aliases, folder) => {
56
- const name = path.basename(folder);
57
- if (name !== "docs") aliases[`@d3plus/${name}`] = path.resolve(__dirname, "../", folder);
58
- return aliases;
59
- }, {});
60
-
61
- config.resolve.alias = {
62
- ...workspacePackages,
63
- ...config.resolve.alias
64
- };
65
- }
66
- return config;
67
46
  }
68
47
 
69
48
  };
@@ -1,4 +1,4 @@
1
- import {addons} from "@storybook/manager-api";
1
+ import {addons} from "storybook/manager-api";
2
2
  import theme from "./theme.js";
3
3
 
4
4
  addons.setConfig({
@@ -15,10 +15,6 @@
15
15
  padding: 2rem !important;
16
16
  }
17
17
 
18
- .sbdocs-content {
19
- max-width: calc(100% - 15rem) !important;
20
- }
21
-
22
18
  /* kill margins */
23
19
  .docblock-argstable, /* control block */
24
20
  .sbdocs-preview { /* chart/code block */
@@ -1,5 +1,5 @@
1
1
  import React, {useContext, useMemo} from "react";
2
- import { Anchor, Canvas, Controls, Description, DocsContext, Subheading, Subtitle, Title } from '@storybook/blocks';
2
+ import { Anchor, Canvas, Controls, Description, DocsContext, Subheading, Subtitle, Title } from '@storybook/addon-docs/blocks';
3
3
  import theme from "./theme.js";
4
4
  import stringify from "../helpers/stringify.js";
5
5
  import {D3plusContext} from "@d3plus/react";
@@ -1,4 +1,4 @@
1
- import {create} from "@storybook/theming";
1
+ import {create} from "storybook/theming";
2
2
 
3
3
  export default create({
4
4
 
@@ -1,4 +1,4 @@
1
- import { Meta } from '@storybook/blocks';
1
+ import { Meta } from '@storybook/addon-docs/blocks';
2
2
 
3
3
  <Meta title="Accessibility" />
4
4
 
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import {Treemap} from "@d3plus/react";
3
- import {Source} from '@storybook/blocks';
3
+ import {Source} from '@storybook/addon-docs/blocks';
4
4
  import stringify from "../helpers/stringify";
5
5
 
6
6
  const Logo = () => {
@@ -19,16 +19,27 @@ const Logo = () => {
19
19
 
20
20
  const code = `<Treemap config={${stringify(config)}} />`;
21
21
 
22
+ const mobile = window !== undefined && window.innerWidth <= 768;
23
+
24
+ const wrapperStyle = {
25
+ alignItems: "stretch",
26
+ display: "flex",
27
+ flexDirection: mobile ? "column" : "row",
28
+ height: mobile ? "auto" : "300px",
29
+ marginBottom: mobile ? "50px" : 0
30
+ };
31
+ const sourceStyle = {
32
+ marginRight: mobile ? 0 : "20px",
33
+ width: mobile ? "100%" : "300px"
34
+ };
35
+ const vizStyle = {flex: `1 1 ${mobile ? "300px" : "auto"}`}
36
+
22
37
  return (
23
- <div style={{
24
- alignItems: "stretch",
25
- display: "flex",
26
- height: "300px"
27
- }}>
28
- <div style={{marginRight: "20px", width: "300px"}}>
38
+ <div style={wrapperStyle}>
39
+ <div style={sourceStyle}>
29
40
  <Source code={code} />
30
41
  </div>
31
- <div style={{flex: "1 1 auto"}}>
42
+ <div style={vizStyle}>
32
43
  <Treemap config={config} />
33
44
  </div>
34
45
  </div>
@@ -1,4 +1,4 @@
1
- import {Meta} from '@storybook/blocks';
1
+ import {Meta} from '@storybook/addon-docs/blocks';
2
2
  import Logo from "./Logo.jsx";
3
3
  import HomeChart from "./HomeChart.jsx";
4
4
 
@@ -10,7 +10,8 @@ const threeColor = colors[1];
10
10
  const threeAccent = colorLegible(threeColor);
11
11
  const plusColor = colors[2];
12
12
 
13
- const height = 200;
13
+ const mobile = window !== undefined && window.innerWidth <= 768;
14
+ const height = mobile ? 150 : 200;
14
15
  const yAxisOffset = 35;
15
16
  const xAxisOffset = 46;
16
17
  const ySquares = 12;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d3plus/docs",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "Documentation and examples for the d3plus visualization library.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://d3plus.org",
@@ -12,19 +12,15 @@
12
12
  "keywords": [],
13
13
  "scripts": {
14
14
  "build": "storybook build --docs -o build",
15
- "dev": "node ../../scripts/dev.js"
15
+ "dev": "node ../../scripts/dev.js",
16
+ "dev:local": "storybook dev --docs --ci --no-version-updates --port=4000"
16
17
  },
17
18
  "dependencies": {
18
- "@d3plus/core": "3.0.1",
19
- "@d3plus/dom": "3.0.1",
20
- "@d3plus/format": "3.0.1",
21
- "@d3plus/locales": "3.0.1",
22
- "@d3plus/react": "3.0.1",
23
- "@storybook/blocks": "^8.6.12",
24
- "@storybook/components": "^8.6.12",
25
- "@storybook/icons": "^1.4.0",
26
- "@storybook/manager-api": "^8.6.12",
27
- "@storybook/test": "^8.6.12",
19
+ "@d3plus/core": "3.0.2",
20
+ "@d3plus/dom": "3.0.2",
21
+ "@d3plus/format": "3.0.2",
22
+ "@d3plus/locales": "3.0.2",
23
+ "@d3plus/react": "3.0.2",
28
24
  "@types/react": "^19.1.0",
29
25
  "next": "^15.2.4",
30
26
  "react": "^18.2.0",
@@ -34,12 +30,10 @@
34
30
  "webpack": "^5.98.0"
35
31
  },
36
32
  "devDependencies": {
37
- "@storybook/addon-controls": "^8.6.12",
38
- "@storybook/addon-docs": "^8.6.12",
39
- "@storybook/nextjs": "^8.6.12",
40
- "@storybook/react": "^8.6.12",
41
- "@storybook/theming": "^8.6.12",
33
+ "@storybook/addon-docs": "9.0.11",
34
+ "@storybook/nextjs": "9.0.11",
35
+ "eslint-plugin-storybook": "9.0.11",
42
36
  "remark-gfm": "^4.0.1",
43
- "storybook": "^8.6.12"
37
+ "storybook": "9.0.11"
44
38
  }
45
39
  }