@d3plus/docs 3.0.1 → 3.0.3

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.
@@ -13,19 +13,16 @@ module.exports = {
13
13
  "../packages/**/*.stories.@(mdx|js|jsx|ts|tsx)"
14
14
  ],
15
15
 
16
- addons: [
17
- getAbsolutePath("@storybook/addon-controls"),
18
- {
19
- name: getAbsolutePath("@storybook/addon-docs"),
20
- options: {
21
- mdxPluginOptions: {
22
- mdxCompileOptions: {
23
- remarkPlugins: [remarkGfm],
24
- },
16
+ addons: [{
17
+ name: getAbsolutePath("@storybook/addon-docs"),
18
+ options: {
19
+ mdxPluginOptions: {
20
+ mdxCompileOptions: {
21
+ remarkPlugins: [remarkGfm],
25
22
  },
26
23
  },
27
- }
28
- ],
24
+ },
25
+ }],
29
26
 
30
27
  framework: {
31
28
  name: getAbsolutePath("@storybook/nextjs"),
@@ -48,15 +45,19 @@ module.exports = {
48
45
  disableTelemetry: true, // 👈 Disables telemetry
49
46
  disableWhatsNewNotifications: true,
50
47
  },
51
-
48
+
52
49
  webpackFinal: async (config) => {
53
50
  if (config.resolve) {
54
51
 
55
52
  const workspacePackages = glob.sync('../*/').reduce((aliases, folder) => {
56
53
  const name = path.basename(folder);
57
- if (name !== "docs") aliases[`@d3plus/${name}`] = path.resolve(__dirname, "../", folder);
54
+ if (name !== "docs") {
55
+ const filename = name === "react" ? "index.jsx" : "index.js";
56
+ aliases[`@d3plus/${name}`] = path.resolve(__dirname, "../", folder, filename);
57
+ }
58
58
  return aliases;
59
59
  }, {});
60
+ console.log(workspacePackages);
60
61
 
61
62
  config.resolve.alias = {
62
63
  ...workspacePackages,
@@ -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";
@@ -15,7 +15,12 @@ const axisConfig = {
15
15
  stroke: gridColor
16
16
  },
17
17
  shapeConfig: {
18
- fill: tickColor,
18
+ Circle: {
19
+ stroke: gridColor
20
+ },
21
+ Rect: {
22
+ fill: tickColor
23
+ },
19
24
  labelConfig: {
20
25
  fontColor: tickColor
21
26
  },
@@ -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.3",
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.3",
20
+ "@d3plus/dom": "3.0.3",
21
+ "@d3plus/format": "3.0.3",
22
+ "@d3plus/locales": "3.0.3",
23
+ "@d3plus/react": "3.0.3",
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
  }