@automattic/charts 0.19.0 → 0.19.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
@@ -5,6 +5,10 @@ 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
+ ## [0.19.1] - 2025-07-22
9
+ ### Changed
10
+ - Removed dependency on jetpack-components [#44411]
11
+
8
12
  ## [0.19.0] - 2025-07-21
9
13
  ### Added
10
14
  - Added more exports for Woo Analytics to get rid of visx dependencies [#44390]
@@ -300,6 +304,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
300
304
  - Fixed lints following ESLint rule changes for TS [#40584]
301
305
  - Fixing a bug in Chart storybook data. [#40640]
302
306
 
307
+ [0.19.1]: https://github.com/Automattic/charts/compare/v0.19.0...v0.19.1
303
308
  [0.19.0]: https://github.com/Automattic/charts/compare/v0.18.0...v0.19.0
304
309
  [0.18.0]: https://github.com/Automattic/charts/compare/v0.17.0...v0.18.0
305
310
  [0.17.0]: https://github.com/Automattic/charts/compare/v0.16.2...v0.17.0
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@automattic/jetpack-components"),a=require("clsx"),r=require("react"),n=require("../shared/utils.js"),o=require("./line-chart.module.scss.js");exports.POPOVER_BUTTON_SIZE=44,exports.default=({title:l,subtitle:i,renderLabel:s,renderLabelPopover:c})=>{const p=r.useId(),u=r.useRef(null),d=r.useRef(null),[h,b]=r.useState(!1),v=n.isSafari();return r.useEffect((()=>{const e=u.current,t=d.current;if(!e||!t)return;const a=()=>{if(!v){const a=e.getBoundingClientRect();t.style.left=`${a.right}px`,t.style.top=`${a.top}px`}b(!0)};t.addEventListener("toggle",(e=>{"open"===e.newState&&a()}));try{t.matches(":popover-open")&&a()}catch{}}),[v]),e.jsxs("div",{className:o["line-chart__annotation-label"],children:[e.jsx("button",{ref:u,popovertarget:p,className:o["line-chart__annotation-label-trigger-button"],style:{width:"44px",height:"44px",transform:"translate(22px, 0)"},"aria-label":l||"View details",children:s({title:l,subtitle:i})}),e.jsx("div",{ref:d,id:p,popover:"auto",className:a(o["line-chart__annotation-label-popover"],h&&o["line-chart__annotation-label-popover--visible"],v&&o["line-chart__annotation-label-popover--safari"]),"data-testid":"line-chart-annotation-label-popover",children:e.jsxs("div",{className:o["line-chart__annotation-label-popover-header"],children:[e.jsx("div",{className:o["line-chart__annotation-label-popover-content"],children:c({title:l,subtitle:i})}),e.jsx("button",{popovertarget:p,popovertargetaction:"hide",className:o["line-chart__annotation-label-popover-close-button"],"aria-label":"Close",children:e.jsx(t.Gridicon,{icon:"cross",size:16})})]})})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("clsx"),a=require("gridicons"),r=require("react"),n=require("../shared/utils.js"),l=require("./line-chart.module.scss.js");exports.POPOVER_BUTTON_SIZE=44,exports.default=({title:o,subtitle:i,renderLabel:s,renderLabelPopover:c})=>{const p=r.useId(),u=r.useRef(null),d=r.useRef(null),[h,b]=r.useState(!1),v=n.isSafari();return r.useEffect((()=>{const e=u.current,t=d.current;if(!e||!t)return;const a=()=>{if(!v){const a=e.getBoundingClientRect();t.style.left=`${a.right}px`,t.style.top=`${a.top}px`}b(!0)};t.addEventListener("toggle",(e=>{"open"===e.newState&&a()}));try{t.matches(":popover-open")&&a()}catch{}}),[v]),e.jsxs("div",{className:l["line-chart__annotation-label"],children:[e.jsx("button",{ref:u,popovertarget:p,className:l["line-chart__annotation-label-trigger-button"],style:{width:"44px",height:"44px",transform:"translate(22px, 0)"},"aria-label":o||"View details",children:s({title:o,subtitle:i})}),e.jsx("div",{ref:d,id:p,popover:"auto",className:t(l["line-chart__annotation-label-popover"],h&&l["line-chart__annotation-label-popover--visible"],v&&l["line-chart__annotation-label-popover--safari"]),"data-testid":"line-chart-annotation-label-popover",children:e.jsxs("div",{className:l["line-chart__annotation-label-popover-header"],children:[e.jsx("div",{className:l["line-chart__annotation-label-popover-content"],children:c({title:o,subtitle:i})}),e.jsx("button",{popovertarget:p,popovertargetaction:"hide",className:l["line-chart__annotation-label-popover-close-button"],"aria-label":"Close",children:e.jsx(a,{icon:"cross",size:16})})]})})]})};
2
2
  //# sourceMappingURL=line-chart-annotation-label-popover.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"line-chart-annotation-label-popover.js","sources":["/@automattic/charts/../../../../src/components/line-chart/line-chart-annotation-label-popover.tsx"],"sourcesContent":[null],"names":["title","subtitle","renderLabel","renderLabelPopover","popoverId","useId","buttonRef","useRef","popoverRef","isPositioned","setIsPositioned","useState","isBrowserSafari","isSafari","useEffect","button","current","popover","positionPopover","buttonRect","getBoundingClientRect","style","left","right","top","addEventListener","e","newState","matches","_jsxs","jsxs","className","styles","children","_jsx","ref","popovertarget","width","height","transform","id","clsx","popovertargetaction","jsx","Gridicon","icon","size"],"mappings":"6RAQmC,mBASyD,EAC3FA,QACAC,WACAC,cACAC,yBAEA,MAAMC,EAAYC,EAAAA,QACZC,EAAYC,SAA6B,MACzCC,EAAaD,SAA0B,OACrCE,EAAcC,GAAoBC,EAAQA,UAAE,GAC9CC,EAAkBC,EAAAA,WAoCxB,OAlCAC,EAAAA,WAAW,KACV,MAAMC,EAAST,EAAUU,QACnBC,EAAUT,EAAWQ,QAE3B,IAAOD,IAAYE,EAAU,OAE7B,MAAMC,EAAkB,KAEvB,IAAON,EAAkB,CACxB,MAAMO,EAAaJ,EAAOK,wBAC1BH,EAAQI,MAAMC,KAAO,GAAIH,EAAWI,UACpCN,EAAQI,MAAMG,IAAM,GAAIL,EAAWK,OACnC,CAEDd,GAAiB,IAIlBO,EAAQQ,iBAAkB,UAAYC,IACjB,SAAfA,EAAEC,UACNT,OAKF,IACMD,EAAQW,QAAS,kBACrBV,GAED,CAAC,MAED,IACC,CAAEN,IAGJiB,EAAAC,KAAA,MAAA,CAAKC,UAAYC,EAAQ,gCACxBC,SAAA,CAAAC,EAAAA,IAAA,SAAA,CACCC,IAAM7B,EACG8B,cAAehC,EACxB2B,UAAYC,EAAQ,+CACpBX,MAAQ,CACPgB,MAAO,OACPC,OAAQ,OACRC,UAAW,sBACX,aACYvC,GAAS,eAEpBiC,SAAA/B,EAAa,CAAEF,QAAOC,eAEzBiC,EAAAA,IACC,MAAA,CAAAC,IAAM3B,EACNgC,GAAKpC,EACIa,QAAS,OAClBc,UAAYU,EACXT,EAAQ,wCACRvB,GAAgBuB,EAAQ,iDACxBpB,GAAmBoB,EAAQ,+DAEhB,sCAAqCC,SAEjDJ,cAAKE,UAAYC,EAAQ,+CAA+CC,SAAA,CACvEC,aAAKH,UAAYC,EAAQ,gDACtBC,SAAA9B,EAAoB,CAAEH,QAAOC,eAEhCiC,EAAAA,IACQ,SAAA,CACNE,cAAehC,EACfsC,oBAAqB,OAEtBX,UAAYC,EAAQ,qDACT,aAAA,QAEXC,SAAAC,EAAAS,IAACC,WAAQ,CAACC,KAAK,QAAQC,KAAO"}
1
+ {"version":3,"file":"line-chart-annotation-label-popover.js","sources":["/@automattic/charts/../../../../src/components/line-chart/line-chart-annotation-label-popover.tsx"],"sourcesContent":[null],"names":["title","subtitle","renderLabel","renderLabelPopover","popoverId","useId","buttonRef","useRef","popoverRef","isPositioned","setIsPositioned","useState","isBrowserSafari","isSafari","useEffect","button","current","popover","positionPopover","buttonRect","getBoundingClientRect","style","left","right","top","addEventListener","e","newState","matches","_jsxs","jsxs","className","styles","children","_jsx","ref","popovertarget","width","height","transform","id","clsx","popovertargetaction","jsx","Gridicon","icon","size"],"mappings":"wQAQmC,mBASyD,EAC3FA,QACAC,WACAC,cACAC,yBAEA,MAAMC,EAAYC,EAAAA,QACZC,EAAYC,SAA6B,MACzCC,EAAaD,SAA0B,OACrCE,EAAcC,GAAoBC,EAAQA,UAAE,GAC9CC,EAAkBC,EAAAA,WAoCxB,OAlCAC,EAAAA,WAAW,KACV,MAAMC,EAAST,EAAUU,QACnBC,EAAUT,EAAWQ,QAE3B,IAAOD,IAAYE,EAAU,OAE7B,MAAMC,EAAkB,KAEvB,IAAON,EAAkB,CACxB,MAAMO,EAAaJ,EAAOK,wBAC1BH,EAAQI,MAAMC,KAAO,GAAIH,EAAWI,UACpCN,EAAQI,MAAMG,IAAM,GAAIL,EAAWK,OACnC,CAEDd,GAAiB,IAIlBO,EAAQQ,iBAAkB,UAAYC,IACjB,SAAfA,EAAEC,UACNT,OAKF,IACMD,EAAQW,QAAS,kBACrBV,GAED,CAAC,MAED,IACC,CAAEN,IAGJiB,EAAAC,KAAA,MAAA,CAAKC,UAAYC,EAAQ,gCACxBC,SAAA,CAAAC,EAAAA,IAAA,SAAA,CACCC,IAAM7B,EACG8B,cAAehC,EACxB2B,UAAYC,EAAQ,+CACpBX,MAAQ,CACPgB,MAAO,OACPC,OAAQ,OACRC,UAAW,sBACX,aACYvC,GAAS,eAEpBiC,SAAA/B,EAAa,CAAEF,QAAOC,eAEzBiC,EAAAA,IACC,MAAA,CAAAC,IAAM3B,EACNgC,GAAKpC,EACIa,QAAS,OAClBc,UAAYU,EACXT,EAAQ,wCACRvB,GAAgBuB,EAAQ,iDACxBpB,GAAmBoB,EAAQ,+DAEhB,sCAAqCC,SAEjDJ,cAAKE,UAAYC,EAAQ,+CAA+CC,SAAA,CACvEC,aAAKH,UAAYC,EAAQ,gDACtBC,SAAA9B,EAAoB,CAAEH,QAAOC,eAEhCiC,EAAAA,IACQ,SAAA,CACNE,cAAehC,EACfsC,oBAAqB,OAEtBX,UAAYC,EAAQ,qDACT,aAAA,QAEXC,SAAAC,EAAAS,IAACC,EAAQ,CAACC,KAAK,QAAQC,KAAO"}
@@ -1,2 +1,2 @@
1
- import{jsxs as t,jsx as e}from"react/jsx-runtime";import{Gridicon as o}from"@automattic/jetpack-components";import a from"clsx";import{useId as n,useRef as r,useState as l,useEffect as i}from"react";import{isSafari as s}from"../shared/utils.js";import c from"./line-chart.module.scss.js";const p=44,d=({title:p,subtitle:d,renderLabel:h,renderLabelPopover:m})=>{const b=n(),u=r(null),v=r(null),[_,f]=l(!1),g=s();return i((()=>{const t=u.current,e=v.current;if(!t||!e)return;const o=()=>{if(!g){const o=t.getBoundingClientRect();e.style.left=`${o.right}px`,e.style.top=`${o.top}px`}f(!0)};e.addEventListener("toggle",(t=>{"open"===t.newState&&o()}));try{e.matches(":popover-open")&&o()}catch{}}),[g]),t("div",{className:c["line-chart__annotation-label"],children:[e("button",{ref:u,popovertarget:b,className:c["line-chart__annotation-label-trigger-button"],style:{width:"44px",height:"44px",transform:"translate(22px, 0)"},"aria-label":p||"View details",children:h({title:p,subtitle:d})}),e("div",{ref:v,id:b,popover:"auto",className:a(c["line-chart__annotation-label-popover"],_&&c["line-chart__annotation-label-popover--visible"],g&&c["line-chart__annotation-label-popover--safari"]),"data-testid":"line-chart-annotation-label-popover",children:t("div",{className:c["line-chart__annotation-label-popover-header"],children:[e("div",{className:c["line-chart__annotation-label-popover-content"],children:m({title:p,subtitle:d})}),e("button",{popovertarget:b,popovertargetaction:"hide",className:c["line-chart__annotation-label-popover-close-button"],"aria-label":"Close",children:e(o,{icon:"cross",size:16})})]})})]})};export{p as POPOVER_BUTTON_SIZE,d as default};
1
+ import{jsxs as t,jsx as e}from"react/jsx-runtime";import o from"clsx";import a from"gridicons";import{useId as r,useRef as n,useState as l,useEffect as i}from"react";import{isSafari as s}from"../shared/utils.js";import c from"./line-chart.module.scss.js";const p=44,d=({title:p,subtitle:d,renderLabel:h,renderLabelPopover:m})=>{const b=r(),u=n(null),v=n(null),[_,f]=l(!1),g=s();return i((()=>{const t=u.current,e=v.current;if(!t||!e)return;const o=()=>{if(!g){const o=t.getBoundingClientRect();e.style.left=`${o.right}px`,e.style.top=`${o.top}px`}f(!0)};e.addEventListener("toggle",(t=>{"open"===t.newState&&o()}));try{e.matches(":popover-open")&&o()}catch{}}),[g]),t("div",{className:c["line-chart__annotation-label"],children:[e("button",{ref:u,popovertarget:b,className:c["line-chart__annotation-label-trigger-button"],style:{width:"44px",height:"44px",transform:"translate(22px, 0)"},"aria-label":p||"View details",children:h({title:p,subtitle:d})}),e("div",{ref:v,id:b,popover:"auto",className:o(c["line-chart__annotation-label-popover"],_&&c["line-chart__annotation-label-popover--visible"],g&&c["line-chart__annotation-label-popover--safari"]),"data-testid":"line-chart-annotation-label-popover",children:t("div",{className:c["line-chart__annotation-label-popover-header"],children:[e("div",{className:c["line-chart__annotation-label-popover-content"],children:m({title:p,subtitle:d})}),e("button",{popovertarget:b,popovertargetaction:"hide",className:c["line-chart__annotation-label-popover-close-button"],"aria-label":"Close",children:e(a,{icon:"cross",size:16})})]})})]})};export{p as POPOVER_BUTTON_SIZE,d as default};
2
2
  //# sourceMappingURL=line-chart-annotation-label-popover.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"line-chart-annotation-label-popover.js","sources":["../../../../src/components/line-chart/line-chart-annotation-label-popover.tsx"],"sourcesContent":[null],"names":["POPOVER_BUTTON_SIZE","LineChartAnnotationLabelWithPopover","title","subtitle","renderLabel","renderLabelPopover","popoverId","useId","buttonRef","useRef","popoverRef","isPositioned","setIsPositioned","useState","isBrowserSafari","isSafari","useEffect","button","current","popover","positionPopover","buttonRect","getBoundingClientRect","style","left","right","top","addEventListener","e","newState","matches","_jsxs","className","styles","children","_jsx","ref","popovertarget","width","height","transform","id","clsx","popovertargetaction","Gridicon","icon","size"],"mappings":"gSAQO,MAAMA,EAAsB,GAS7BC,EAAsF,EAC3FC,QACAC,WACAC,cACAC,yBAEA,MAAMC,EAAYC,IACZC,EAAYC,EAA6B,MACzCC,EAAaD,EAA0B,OACrCE,EAAcC,GAAoBC,GAAU,GAC9CC,EAAkBC,IAoCxB,OAlCAC,GAAW,KACV,MAAMC,EAAST,EAAUU,QACnBC,EAAUT,EAAWQ,QAE3B,IAAOD,IAAYE,EAAU,OAE7B,MAAMC,EAAkB,KAEvB,IAAON,EAAkB,CACxB,MAAMO,EAAaJ,EAAOK,wBAC1BH,EAAQI,MAAMC,KAAO,GAAIH,EAAWI,UACpCN,EAAQI,MAAMG,IAAM,GAAIL,EAAWK,OACnC,CAEDd,GAAiB,IAIlBO,EAAQQ,iBAAkB,UAAYC,IACjB,SAAfA,EAAEC,UACNT,OAKF,IACMD,EAAQW,QAAS,kBACrBV,GAED,CAAC,MAED,IACC,CAAEN,IAGJiB,EAAA,MAAA,CAAKC,UAAYC,EAAQ,gCACxBC,SAAA,CAAAC,EAAA,SAAA,CACCC,IAAM5B,EACG6B,cAAe/B,EACxB0B,UAAYC,EAAQ,+CACpBV,MAAQ,CACPe,MAAO,OACPC,OAAQ,OACRC,UAAW,sBACX,aACYtC,GAAS,eAEpBgC,SAAA9B,EAAa,CAAEF,QAAOC,eAEzBgC,EACC,MAAA,CAAAC,IAAM1B,EACN+B,GAAKnC,EACIa,QAAS,OAClBa,UAAYU,EACXT,EAAQ,wCACRtB,GAAgBsB,EAAQ,iDACxBnB,GAAmBmB,EAAQ,+DAEhB,sCAAqCC,SAEjDH,SAAKC,UAAYC,EAAQ,+CAA+CC,SAAA,CACvEC,SAAKH,UAAYC,EAAQ,gDACtBC,SAAA7B,EAAoB,CAAEH,QAAOC,eAEhCgC,EACQ,SAAA,CACNE,cAAe/B,EACfqC,oBAAqB,OAEtBX,UAAYC,EAAQ,qDACT,aAAA,QAEXC,SAAAC,EAACS,EAAQ,CAACC,KAAK,QAAQC,KAAO"}
1
+ {"version":3,"file":"line-chart-annotation-label-popover.js","sources":["../../../../src/components/line-chart/line-chart-annotation-label-popover.tsx"],"sourcesContent":[null],"names":["POPOVER_BUTTON_SIZE","LineChartAnnotationLabelWithPopover","title","subtitle","renderLabel","renderLabelPopover","popoverId","useId","buttonRef","useRef","popoverRef","isPositioned","setIsPositioned","useState","isBrowserSafari","isSafari","useEffect","button","current","popover","positionPopover","buttonRect","getBoundingClientRect","style","left","right","top","addEventListener","e","newState","matches","_jsxs","className","styles","children","_jsx","ref","popovertarget","width","height","transform","id","clsx","popovertargetaction","Gridicon","icon","size"],"mappings":"+PAQO,MAAMA,EAAsB,GAS7BC,EAAsF,EAC3FC,QACAC,WACAC,cACAC,yBAEA,MAAMC,EAAYC,IACZC,EAAYC,EAA6B,MACzCC,EAAaD,EAA0B,OACrCE,EAAcC,GAAoBC,GAAU,GAC9CC,EAAkBC,IAoCxB,OAlCAC,GAAW,KACV,MAAMC,EAAST,EAAUU,QACnBC,EAAUT,EAAWQ,QAE3B,IAAOD,IAAYE,EAAU,OAE7B,MAAMC,EAAkB,KAEvB,IAAON,EAAkB,CACxB,MAAMO,EAAaJ,EAAOK,wBAC1BH,EAAQI,MAAMC,KAAO,GAAIH,EAAWI,UACpCN,EAAQI,MAAMG,IAAM,GAAIL,EAAWK,OACnC,CAEDd,GAAiB,IAIlBO,EAAQQ,iBAAkB,UAAYC,IACjB,SAAfA,EAAEC,UACNT,OAKF,IACMD,EAAQW,QAAS,kBACrBV,GAED,CAAC,MAED,IACC,CAAEN,IAGJiB,EAAA,MAAA,CAAKC,UAAYC,EAAQ,gCACxBC,SAAA,CAAAC,EAAA,SAAA,CACCC,IAAM5B,EACG6B,cAAe/B,EACxB0B,UAAYC,EAAQ,+CACpBV,MAAQ,CACPe,MAAO,OACPC,OAAQ,OACRC,UAAW,sBACX,aACYtC,GAAS,eAEpBgC,SAAA9B,EAAa,CAAEF,QAAOC,eAEzBgC,EACC,MAAA,CAAAC,IAAM1B,EACN+B,GAAKnC,EACIa,QAAS,OAClBa,UAAYU,EACXT,EAAQ,wCACRtB,GAAgBsB,EAAQ,iDACxBnB,GAAmBmB,EAAQ,+DAEhB,sCAAqCC,SAEjDH,SAAKC,UAAYC,EAAQ,+CAA+CC,SAAA,CACvEC,SAAKH,UAAYC,EAAQ,gDACtBC,SAAA7B,EAAoB,CAAEH,QAAOC,eAEhCgC,EACQ,SAAA,CACNE,cAAe/B,EACfqC,oBAAqB,OAEtBX,UAAYC,EAAQ,qDACT,aAAA,QAEXC,SAAAC,EAACS,EAAQ,CAACC,KAAK,QAAQC,KAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/charts",
3
- "version": "0.19.0",
3
+ "version": "0.19.1",
4
4
  "description": "Display charts within Automattic products.",
5
5
  "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/charts/#readme",
6
6
  "bugs": {
@@ -51,7 +51,6 @@
51
51
  "./style.css": "./dist/mjs/style.css"
52
52
  },
53
53
  "dependencies": {
54
- "@automattic/jetpack-components": "^1.1.14",
55
54
  "@automattic/number-formatters": "^1.0.9",
56
55
  "@babel/runtime": "7.27.6",
57
56
  "@react-spring/web": "9.7.5",
@@ -73,6 +72,7 @@
73
72
  "clsx": "2.1.1",
74
73
  "date-fns": "^4.1.0",
75
74
  "deepmerge": "4.3.1",
75
+ "gridicons": "3.4.2",
76
76
  "tslib": "2.5.0"
77
77
  },
78
78
  "devDependencies": {
@@ -1,5 +1,5 @@
1
- import { Gridicon } from '@automattic/jetpack-components';
2
1
  import clsx from 'clsx';
2
+ import Gridicon from 'gridicons';
3
3
  import { useEffect, useId, useRef, useState } from 'react';
4
4
  import { isSafari } from '../shared/utils';
5
5
  import styles from './line-chart.module.scss';