@automattic/charts 1.1.0 → 1.2.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/AGENTS.md +14 -1
- package/CHANGELOG.md +13 -0
- package/dist/index.cjs +1238 -1155
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +50 -123
- package/dist/index.css.map +1 -1
- package/dist/index.js +1273 -1190
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
- package/src/charts/conversion-funnel-chart/conversion-funnel-chart.module.scss +25 -52
- package/src/charts/conversion-funnel-chart/conversion-funnel-chart.tsx +20 -11
- package/src/charts/geo-chart/geo-chart.module.scss +0 -3
- package/src/charts/geo-chart/geo-chart.tsx +9 -4
- package/src/charts/leaderboard-chart/leaderboard-chart.module.scss +7 -3
- package/src/charts/line-chart/line-chart.module.scss +13 -20
- package/src/charts/line-chart/line-chart.tsx +9 -2
- package/src/charts/line-chart/private/line-chart-annotation-label-popover.tsx +3 -2
- package/src/charts/pie-semi-circle-chart/pie-semi-circle-chart.module.scss +3 -3
- package/src/charts/private/svg-empty-state/svg-empty-state.module.scss +1 -1
- package/src/components/legend/private/base-legend.module.scss +3 -52
- package/src/components/legend/private/base-legend.tsx +30 -28
- package/src/components/tooltip/base-tooltip.module.scss +3 -3
- package/src/components/trend-indicator/trend-indicator.module.scss +2 -2
package/AGENTS.md
CHANGED
|
@@ -20,6 +20,15 @@ jp changelog add js-packages/charts -s patch -t changed -e "Charts: <user-facing
|
|
|
20
20
|
- Accessibility behavior (keyboard navigation, accessible tooltips) is core chart behavior, not optional polish.
|
|
21
21
|
- Charts are responsive by default — do not add external responsive wrappers that conflict with built-in sizing semantics.
|
|
22
22
|
|
|
23
|
+
## WordPress UI + Theme Integration
|
|
24
|
+
|
|
25
|
+
The package is migrating to WordPress UI and Theme as its defaults. When adding or changing code, follow these defaults unless the task explicitly says otherwise:
|
|
26
|
+
|
|
27
|
+
- **Design tokens (WPDS).** In SCSS, use `var(--wpds-dimension-*, <fallback>)`, `var(--wpds-border-*, <fallback>)`, and `var(--wpds-typography-*, <fallback>)` instead of hardcoded px values for spacing, padding, margins, border radius, border width, font size, and font weight. Fallbacks must match the WPDS spec value for that token — do not invent fallback values.
|
|
28
|
+
- **UI primitives.** Prefer `Stack` and the stable `Text` from `@wordpress/ui` over ad-hoc flexbox or raw `<span>`/`<div>` for layout and text. Do not use `__experimental*` exports from `@wordpress/components` (e.g. `__experimentalText`, `__experimentalHStack`) — use the stable `@wordpress/ui` equivalents. Exception: `__experimentalGrid` has no stable alternative yet and is acceptable to use for now.
|
|
29
|
+
- **Theming.** Theming flows through `@wordpress/theme`'s `ThemeProvider` (unlocked via private APIs in Storybook; see `src/stories/chart-decorator.tsx`). Do not manually override DS tokens in stories or components to achieve theming — pass a color through `ThemeProvider` instead.
|
|
30
|
+
- **Chart element styles.** Read chart element styles via `getElementStyles` from `GlobalChartsProvider`, not directly from `theme`. This is the supported path for color/style resolution across themes.
|
|
31
|
+
|
|
23
32
|
## Documentation Workflow
|
|
24
33
|
|
|
25
34
|
- For docs tasks agents should use the skill at `.agents/skills/charts-docs.md`.
|
|
@@ -43,8 +52,12 @@ jp changelog add js-packages/charts -s patch -t changed -e "Charts: <user-facing
|
|
|
43
52
|
- Documenting props or behavior not present in stories and implementation.
|
|
44
53
|
- Refactoring core composition/provider patterns as if they are accidental complexity.
|
|
45
54
|
- Defining new chart prop interfaces that diverge from established base chart contracts (for example, not aligning with `BaseChartProps` when appropriate).
|
|
46
|
-
- Using ad-hoc flexbox layouts where established layout primitives (e.g. `Stack`) should be preferred.
|
|
55
|
+
- Using ad-hoc flexbox layouts where established layout primitives (e.g. `Stack` from `@wordpress/ui`) should be preferred.
|
|
47
56
|
- Accessing colors/styles directly from `theme` rather than using `getElementStyles` from `GlobalChartsProvider`.
|
|
57
|
+
- Hardcoding px values in SCSS for spacing, borders, or typography where a WPDS token (`--wpds-dimension-*`, `--wpds-border-*`, `--wpds-typography-*`) exists.
|
|
58
|
+
- CSS variable fallback values that diverge from the WPDS spec for that token.
|
|
59
|
+
- Using `__experimental*` exports from `@wordpress/components` (e.g. `__experimentalText`, `__experimentalHStack`) instead of the stable `@wordpress/ui` equivalents. (`__experimentalGrid` is excepted — no stable alternative exists yet.)
|
|
60
|
+
- Manually overriding DS tokens in stories or components to achieve theming instead of passing a color through `@wordpress/theme`'s `ThemeProvider`.
|
|
48
61
|
- Responsive wrappers that conflict with component sizing semantics (fixed-height charts, resize behavior, aspect-ratio assumptions).
|
|
49
62
|
- Updating `.docs.mdx` without the corresponding `.api.mdx` when API docs are affected.
|
|
50
63
|
- Not checking CSF file references in `.docs.mdx` when changing or removing stories.
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.2.0] - 2026-04-20
|
|
9
|
+
### Changed
|
|
10
|
+
- Charts: Replace hardcoded spacing and border values in module SCSS with WPDS dimension and border design tokens. [#48019]
|
|
11
|
+
- Update package dependencies. [#48106] [#48126] [#48141]
|
|
12
|
+
|
|
13
|
+
## [1.1.1] - 2026-04-15
|
|
14
|
+
### Changed
|
|
15
|
+
- Charts: Document WordPress UI + Theme integration defaults. [#48020]
|
|
16
|
+
- Charts: Replace ad-hoc flexbox layouts with @wordpress/ui Stack across legend, conversion funnel, line chart, geo chart, conversion funnel tooltip, and donut story. [#47981]
|
|
17
|
+
- Update package dependencies. [#47907]
|
|
18
|
+
|
|
8
19
|
## [1.1.0] - 2026-04-10
|
|
9
20
|
### Changed
|
|
10
21
|
- Replace hardcoded typography values with WPDS design tokens for font family, size, weight, and line height. [#47989]
|
|
@@ -794,6 +805,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
794
805
|
- Fixed lints following ESLint rule changes for TS [#40584]
|
|
795
806
|
- Fixing a bug in Chart storybook data. [#40640]
|
|
796
807
|
|
|
808
|
+
[1.2.0]: https://github.com/Automattic/charts/compare/v1.1.1...v1.2.0
|
|
809
|
+
[1.1.1]: https://github.com/Automattic/charts/compare/v1.1.0...v1.1.1
|
|
797
810
|
[1.1.0]: https://github.com/Automattic/charts/compare/v1.0.2...v1.1.0
|
|
798
811
|
[1.0.2]: https://github.com/Automattic/charts/compare/v1.0.1...v1.0.2
|
|
799
812
|
[1.0.1]: https://github.com/Automattic/charts/compare/v1.0.0...v1.0.1
|