diff --git a/projects/js-packages/charts/changelog/charts-199-spacing-border-tokenization b/projects/js-packages/charts/changelog/charts-199-spacing-border-tokenization new file mode 100644 index 000000000000..404fd125cf31 --- /dev/null +++ b/projects/js-packages/charts/changelog/charts-199-spacing-border-tokenization @@ -0,0 +1,4 @@ +Significance: minor +Type: changed + +Charts: Replace hardcoded spacing and border values in module SCSS with WPDS dimension and border design tokens. diff --git a/projects/js-packages/charts/src/charts/conversion-funnel-chart/conversion-funnel-chart.module.scss b/projects/js-packages/charts/src/charts/conversion-funnel-chart/conversion-funnel-chart.module.scss index 52b4891936f0..b72cdbb1fd72 100644 --- a/projects/js-packages/charts/src/charts/conversion-funnel-chart/conversion-funnel-chart.module.scss +++ b/projects/js-packages/charts/src/charts/conversion-funnel-chart/conversion-funnel-chart.module.scss @@ -54,11 +54,9 @@ .step-label { color: #757575; font-size: var(--wpds-font-size-sm, 12px); - font-style: normal; font-weight: var(--wpds-font-weight-regular, 400); line-height: var(--wpds-font-line-height-xs, 16px); - margin: 0 0 2px 0; - display: block; + white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } @@ -66,16 +64,13 @@ .step-rate { color: #1e1e1e; font-size: var(--wpds-font-size-md, 13px); - font-style: normal; font-weight: var(--wpds-font-weight-medium, 499); - line-height: var(--wpds-font-line-height-sm, 20px); - margin: 0; - display: block; + line-height: var(--wpds-font-line-height-xs, 16px); } .bar-container { flex: 1; - border-radius: 4px; + border-radius: var(--wpds-border-radius-md, 4px); position: relative; cursor: pointer; } @@ -83,7 +78,7 @@ .funnel-bar { width: 100%; min-height: 4px; - border-radius: 4px 4px 0 0; + border-radius: var(--wpds-border-radius-md, 4px) var(--wpds-border-radius-md, 4px) 0 0; &--animated { transform-origin: bottom; @@ -101,12 +96,12 @@ } .tooltip-wrapper { - border-bottom: 1px solid var(--Gray-Gray-5, #dcdcde); + border-bottom: var(--wpds-border-width-xs, 1px) solid var(--Gray-Gray-5, #dcdcde); background: var(--black-white-white, #fff); // Override .visx-tooltip inline styles. - border-radius: 4px !important; - padding: 12px !important; + border-radius: var(--wpds-border-radius-md, 4px) !important; + padding: var(--wpds-dimension-padding-md, 12px) !important; box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.15), 0 3px 9px 0 rgba(0, 0, 0, 0.12) !important; } @@ -129,7 +124,6 @@ .empty-state { text-align: center; - padding: 48px 24px; color: #6b7280; font-size: var(--wpds-font-size-lg, 16px); } diff --git a/projects/js-packages/charts/src/charts/conversion-funnel-chart/conversion-funnel-chart.tsx b/projects/js-packages/charts/src/charts/conversion-funnel-chart/conversion-funnel-chart.tsx index 05fb970b5523..35a15492215b 100644 --- a/projects/js-packages/charts/src/charts/conversion-funnel-chart/conversion-funnel-chart.tsx +++ b/projects/js-packages/charts/src/charts/conversion-funnel-chart/conversion-funnel-chart.tsx @@ -300,6 +300,8 @@ const ConversionFunnelChartInternal: FC< ConversionFunnelChartProps > = ( { return ( = ( { gap="xl" > { /* Step Label and Rate */ } -
+ { renderStepLabel ? ( renderStepLabel( { step, @@ -390,7 +392,7 @@ const ConversionFunnelChartInternal: FC< ConversionFunnelChartProps > = ( { { formatPercentage( step.rate ) } ) } -
+
{ /* Funnel Bar */ }