@automattic/charts 1.10.2 → 1.10.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/charts",
3
- "version": "1.10.2",
3
+ "version": "1.10.3",
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": {
@@ -100,23 +100,24 @@
100
100
  font-style: italic;
101
101
  }
102
102
 
103
- .interactiveRow {
103
+ .row {
104
104
  --focus-ring-width: var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px));
105
105
 
106
106
  display: grid;
107
107
  grid-column: 1 / -1;
108
108
  grid-template-columns: subgrid;
109
109
  align-items: center;
110
+ // Every row reserves the same space for the interactive focus ring. Keeping
111
+ // this on the shared wrapper ensures that adding or removing an action never
112
+ // changes the row height or subgrid column edges.
113
+ padding: var(--focus-ring-width);
114
+ }
115
+
116
+ .interactiveRow {
110
117
  position: relative;
111
118
 
112
119
  // Native button reset.
113
- box-sizing: border-box;
114
120
  appearance: none;
115
- width: 100%;
116
- margin: 0;
117
- // Reserve a ring's worth of space on every edge so the inset focus outline
118
- // hugs the row without the bar painting over it (see :focus-visible below).
119
- padding: var(--focus-ring-width);
120
121
  border: 0;
121
122
  background: none;
122
123
  color: inherit;
@@ -179,9 +180,8 @@
179
180
  var(--focus-ring-width) solid
180
181
  var(--wpds-color-stroke-focus, var(--wp-admin-theme-color, #3858e9));
181
182
  // Inset by its own width so the outer edge hugs the row boundary: the
182
- // outline then sits in the row's padding (also a ring width), clear of the
183
- // bar, and stays inside the overflow:auto container that would clip an
184
- // outset ring.
183
+ // outline then sits in the shared row padding, clear of the bar, and stays
184
+ // inside the overflow:auto container that would clip an outset ring.
185
185
  outline-offset: calc(-1 * var(--focus-ring-width));
186
186
  }
187
187
  }
@@ -1,6 +1,5 @@
1
1
  /* eslint-disable @wordpress/no-unsafe-wp-apis */
2
2
  import { __experimentalGrid as Grid, VisuallyHidden } from '@wordpress/components';
3
- import { Fragment } from '@wordpress/element';
4
3
  import { __ } from '@wordpress/i18n';
5
4
  import { Icon, chevronRight } from '@wordpress/icons';
6
5
  import { Stack, Text } from '@wordpress/ui';
@@ -404,7 +403,7 @@ const LeaderboardChartInternal: FC< LeaderboardChartProps > = ( {
404
403
  <button
405
404
  key={ entry.id }
406
405
  type="button"
407
- className={ styles.interactiveRow }
406
+ className={ clsx( styles.row, styles.interactiveRow ) }
408
407
  onClick={ entry.onClick }
409
408
  aria-label={ entry.ariaLabel }
410
409
  >
@@ -414,7 +413,11 @@ const LeaderboardChartInternal: FC< LeaderboardChartProps > = ( {
414
413
  );
415
414
  }
416
415
 
417
- return <Fragment key={ entry.id }>{ rowCells }</Fragment>;
416
+ return (
417
+ <div key={ entry.id } className={ styles.row }>
418
+ { rowCells }
419
+ </div>
420
+ );
418
421
  } ) }
419
422
  </Grid>
420
423
  ) }