-
Notifications
You must be signed in to change notification settings - Fork 875
Charts: Tokenize spacing and border values with WPDS dimension/border tokens #48019
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e93bbaa
bd724f9
5c6bc41
1f88552
2ca6b4b
0a13771
c3d2512
a0a657f
99abe91
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,36 +54,31 @@ | |
| .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; | ||
| } | ||
|
|
||
| .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); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
|
|
||
| .bar-container { | ||
| flex: 1; | ||
| border-radius: 4px; | ||
| border-radius: var(--wpds-border-radius-md, 4px); | ||
| position: relative; | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| .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; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replaced with a centered layout, matching other charts, eg. GeoChart
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| color: #6b7280; | ||
| font-size: var(--wpds-font-size-lg, 16px); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -300,6 +300,8 @@ const ConversionFunnelChartInternal: FC< ConversionFunnelChartProps > = ( { | |
| return ( | ||
| <Stack | ||
| direction="column" | ||
| align="center" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| justify="center" | ||
| data-testid="conversion-funnel-chart" | ||
| className={ clsx( | ||
| styles[ 'conversion-funnel-chart' ], | ||
|
|
@@ -369,7 +371,7 @@ const ConversionFunnelChartInternal: FC< ConversionFunnelChartProps > = ( { | |
| gap="xl" | ||
| > | ||
| { /* Step Label and Rate */ } | ||
| <div> | ||
| <Stack direction="column" gap="xs"> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| { renderStepLabel ? ( | ||
| renderStepLabel( { | ||
| step, | ||
|
|
@@ -390,7 +392,7 @@ const ConversionFunnelChartInternal: FC< ConversionFunnelChartProps > = ( { | |
| { formatPercentage( step.rate ) } | ||
| </span> | ||
| ) } | ||
| </div> | ||
| </Stack> | ||
|
|
||
| { /* Funnel Bar */ } | ||
| <Stack | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,10 @@ | |
| display: grid; | ||
| align-items: center; | ||
| grid-template-columns: 1fr; | ||
| // Outlier: not tokenized. The leaderboard's compact bar + gap + bar | ||
| // rhythm (6px bar, 6px row-gap, 6px bar) is intentional and does not | ||
| // map to any WPDS dimension token — gap-sm (8px) breaks the visual | ||
| // balance between the rows and the bars. | ||
|
Comment on lines
+24
to
+27
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| row-gap: 6px; | ||
| isolation: isolate; | ||
|
|
||
|
|
@@ -34,7 +38,7 @@ | |
| } | ||
|
|
||
| .label { | ||
| padding-left: 8px; | ||
| padding-left: var(--wpds-dimension-padding-sm, 8px); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -70,7 +74,7 @@ | |
| } | ||
|
|
||
| .emptyState { | ||
| padding: 32px 16px; | ||
| padding: var(--wpds-dimension-padding-3xl, 32px) var(--wpds-dimension-padding-lg, 16px); | ||
| text-align: center; | ||
| color: #666; | ||
| font-size: var(--wpds-font-size-md, 13px); | ||
|
|
||






There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Completes the overflow handling styles. Without this text will wrap and not get ellipsis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes for text with spaces.