-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a648037
commit 007faea
Showing
17 changed files
with
238 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 29 additions & 12 deletions
41
packages/polaris-viz/src/components/FunnelChartNext/components/Tooltip/Tooltip.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,50 @@ | ||
.Rows { | ||
display: grid; | ||
grid-template-columns: 1fr 1fr; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 8px; | ||
|
||
> *:not(:last-child)::after { | ||
content: ''; | ||
display: block; | ||
width: 255px; | ||
height: 1px; | ||
background: #e3e3e3; | ||
margin: 8px auto 0; | ||
} | ||
} | ||
|
||
.Row { | ||
font-size: 12px; | ||
display: grid; | ||
grid-column: 1 / -1; | ||
grid-template-columns: subgrid; | ||
color: rgba(97, 97, 97, 1); | ||
align-items: center; | ||
display: grid; | ||
grid-template-columns: 20px auto; | ||
} | ||
|
||
.Keys { | ||
display: flex; | ||
grid-column: 1 / -1; | ||
display: grid; | ||
grid-template-columns: subgrid; | ||
align-items: center; | ||
gap: 4px; | ||
} | ||
|
||
.Values { | ||
display: flex; | ||
align-items: center; | ||
justify-content: flex-end; | ||
gap: 4px; | ||
align-items: flex-start; | ||
gap: 8px; | ||
grid-column: 2; | ||
font-weight: 600; | ||
padding-top: 2px; | ||
|
||
> span { | ||
flex: 0 0 auto; | ||
} | ||
|
||
.TrendIndicator { | ||
margin-left: auto; | ||
} | ||
|
||
strong { | ||
font-weight: 600; | ||
font-weight: 500; | ||
color: rgba(31, 33, 36, 1); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
packages/polaris-viz/src/components/FunnelChartNext/stories/WithTrendIndicators.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import type {Story} from '@storybook/react'; | ||
import type {DataSeries} from '@shopify/polaris-viz-core'; | ||
|
||
import type {FunnelChartNextProps} from '../FunnelChartNext'; | ||
import {DEFAULT_DATA, DEFAULT_PROPS, Template} from './data'; | ||
import {META} from './meta'; | ||
|
||
export default META; | ||
|
||
const DATA_WITH_TRENDS: DataSeries[] = [ | ||
{ | ||
...DEFAULT_DATA[0], | ||
metadata: { | ||
trends: { | ||
0: { | ||
reached: { | ||
value: '10%', | ||
trend: 'positive', | ||
direction: 'upward', | ||
}, | ||
dropped: { | ||
value: '-25%', | ||
trend: 'negative', | ||
direction: 'downward', | ||
}, | ||
}, | ||
1: { | ||
reached: { | ||
value: '30%', | ||
trend: 'positive', | ||
direction: 'upward', | ||
}, | ||
dropped: { | ||
value: '-10%', | ||
trend: 'negative', | ||
direction: 'downward', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
]; | ||
|
||
export const WithTrendIndicators: Story<FunnelChartNextProps> = Template.bind( | ||
{}, | ||
); | ||
|
||
WithTrendIndicators.args = { | ||
data: DATA_WITH_TRENDS, | ||
...DEFAULT_PROPS, | ||
}; |
Oops, something went wrong.