@servicetitan/marketing-ui 6.1.0 → 7.0.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/dist/components/charts/funnel-chart/components/funnel-chart.js +1 -1
- package/dist/components/charts/funnel-chart/components/funnel-chart.js.map +1 -1
- package/dist/components/charts/funnel-chart/components/funnel-chart.module.less +9 -5
- package/dist/components/charts/funnel-chart/components/funnel-chart.module.less.d.ts +1 -0
- package/package.json +3 -3
- package/src/components/charts/funnel-chart/components/funnel-chart.module.less +9 -5
- package/src/components/charts/funnel-chart/components/funnel-chart.module.less.d.ts +1 -0
- package/src/components/charts/funnel-chart/components/funnel-chart.tsx +1 -1
|
@@ -59,7 +59,7 @@ export const FunnelChart = ({ sections, format, topSideLength = defaultTopSideLe
|
|
|
59
59
|
children: /*#__PURE__*/ _jsx("div", {
|
|
60
60
|
className: Styles.percentTextWrapper,
|
|
61
61
|
children: /*#__PURE__*/ _jsx(BodyText, {
|
|
62
|
-
className: classNames(
|
|
62
|
+
className: classNames(Styles.percentText),
|
|
63
63
|
"data-cy": `marketing-funnel-section-${id}-value`,
|
|
64
64
|
children: formatValue(value, format)
|
|
65
65
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/charts/funnel-chart/components/funnel-chart.tsx"],"sourcesContent":["import { useMemo, useState, FC, Fragment } from 'react';\nimport classNames from 'classnames';\nimport { BodyText, Eyebrow, Icon, Mask, Stack, Tooltip } from '@servicetitan/design-system';\nimport { tokens } from '@servicetitan/tokens/core';\nimport { formatValue } from '../../../../utils/formatters';\nimport { StatDiff } from '../../../stat/stat-card';\nimport { FunnelChartProps } from '../utils/interface';\nimport { defaultBottomSideLength, defaultTopSideLength } from '../utils/const';\nimport { FunnelPyramidSvg } from './funnel-svg';\nimport * as Styles from './funnel-chart.module.less';\nimport { Popover } from '@servicetitan/anvil2';\nimport { ColorTag } from '../../common';\n\nexport const FunnelChart: FC<FunnelChartProps> = ({\n sections,\n format,\n topSideLength = defaultTopSideLength,\n bottomSideLength = defaultBottomSideLength,\n popoverContent: PopoverContent,\n loading,\n className,\n}) => {\n const [popoverShown, setPopoverShown] = useState<number | undefined>(undefined);\n const [rowYs, setRowYs] = useState<number[]>([]);\n const colors = useMemo(() => sections.map(s => s.color), [sections]);\n const outlineColors = useMemo(() => sections.map(s => s.outlineColor), [sections]);\n const hidePopover = () => setPopoverShown(undefined);\n\n const rightStyles = useMemo(\n () => ({\n left: `${100 - topSideLength}%`,\n }),\n [topSideLength]\n );\n\n return (\n <Mask\n className={classNames(\n 'h-100 bg-white border border-radius-2 p-3 of-hidden position-relative',\n className\n )}\n active={!!loading}\n >\n <div className={Styles.pyramidWrapper}>\n <FunnelPyramidSvg\n colors={colors}\n outlineColors={outlineColors}\n topSideLength={topSideLength}\n bottomSideLength={bottomSideLength}\n onRowAnchors={setRowYs}\n />\n </div>\n\n <div\n className={classNames(\n 'd-f flex-column justify-content-around',\n Styles.pyramidBoxRight\n )}\n style={rightStyles}\n >\n {sections.map(({ id, title, value, color, prev, data, outlineColor }) => (\n <Stack\n key={title}\n className={Styles.flex1}\n justifyContent=\"center\"\n alignItems=\"center\"\n onMouseEnter={() => setPopoverShown(id)}\n onMouseLeave={hidePopover}\n >\n <Popover open={popoverShown === id} openOnHover placement=\"right\">\n <Popover.Trigger>\n {props => (\n <span {...props}>\n <div className={Styles.percentTextWrapper}>\n <BodyText\n className={classNames('m-x-2 m-b-0-i')}\n data-cy={`marketing-funnel-section-${id}-value`}\n >\n {formatValue(value, format)}\n </BodyText>\n </div>\n </span>\n )}\n </Popover.Trigger>\n <Popover.Content>\n <Stack\n alignItems=\"flex-start\"\n justifyContent=\"flex-start\"\n direction=\"column\"\n data-cy={`marketing-funnel-popover-${id}-content`}\n >\n <Stack>\n <ColorTag\n label=\"\"\n color={color}\n outlineColor={outlineColor}\n pattern={outlineColor ? 'outline' : 'solid'}\n />\n <BodyText bold className=\"m-r-half\">\n {title} {formatValue(value, format)}\n </BodyText>\n </Stack>\n <Stack.Item>\n <StatDiff\n value={value}\n prev={prev}\n size=\"xsmall\"\n format={format}\n />\n </Stack.Item>\n </Stack>\n\n {!!PopoverContent && (\n <PopoverContent\n id={id}\n value={value}\n text={formatValue(value, format)}\n data={data}\n />\n )}\n </Popover.Content>\n </Popover>\n </Stack>\n ))}\n </div>\n <div className={Styles.pyramidBoxLeft} style={{ width: `${100 - topSideLength}%` }}>\n {sections.map((s, i) => {\n const y = rowYs[i] ?? 0;\n const TITLE_UP = 24;\n const DIFF_DOWN = 4;\n\n return (\n <Fragment key={s.id}>\n <div\n className={Styles.leftTitle}\n style={{ top: `calc(${y}% - ${TITLE_UP}px)` }}\n >\n <Eyebrow\n size=\"small\"\n className={classNames(Styles.statTitle, 'm-r-half')}\n >\n {s.title}\n </Eyebrow>\n <Tooltip direction=\"t\" portal text={s.description}>\n <Icon\n name=\"info\"\n className=\"m-r-1\"\n size=\"14px\"\n color={tokens.colorNeutral90}\n />\n </Tooltip>\n </div>\n\n <div\n className={Styles.leftDiff}\n style={{ top: `calc(${y}% + ${DIFF_DOWN}px)` }}\n >\n <StatDiff\n value={s.value}\n prev={s.prev}\n size=\"small\"\n format={format}\n />\n </div>\n </Fragment>\n );\n })}\n </div>\n </Mask>\n );\n};\n"],"names":["useMemo","useState","Fragment","classNames","BodyText","Eyebrow","Icon","Mask","Stack","Tooltip","tokens","formatValue","StatDiff","defaultBottomSideLength","defaultTopSideLength","FunnelPyramidSvg","Styles","Popover","ColorTag","FunnelChart","sections","format","topSideLength","bottomSideLength","popoverContent","PopoverContent","loading","className","popoverShown","setPopoverShown","undefined","rowYs","setRowYs","colors","map","s","color","outlineColors","outlineColor","hidePopover","rightStyles","left","active","div","pyramidWrapper","onRowAnchors","pyramidBoxRight","style","id","title","value","prev","data","flex1","justifyContent","alignItems","onMouseEnter","onMouseLeave","open","openOnHover","placement","Trigger","props","span","percentTextWrapper","data-cy","Content","direction","label","pattern","bold","Item","size","text","pyramidBoxLeft","width","i","y","TITLE_UP","DIFF_DOWN","leftTitle","top","statTitle","portal","description","name","colorNeutral90","leftDiff"],"mappings":";AAAA,SAASA,OAAO,EAAEC,QAAQ,EAAMC,QAAQ,QAAQ,QAAQ;AACxD,OAAOC,gBAAgB,aAAa;AACpC,SAASC,QAAQ,EAAEC,OAAO,EAAEC,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAEC,OAAO,QAAQ,8BAA8B;AAC5F,SAASC,MAAM,QAAQ,4BAA4B;AACnD,SAASC,WAAW,QAAQ,+BAA+B;AAC3D,SAASC,QAAQ,QAAQ,0BAA0B;AAEnD,SAASC,uBAAuB,EAAEC,oBAAoB,QAAQ,iBAAiB;AAC/E,SAASC,gBAAgB,QAAQ,eAAe;AAChD,YAAYC,YAAY,6BAA6B;AACrD,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,QAAQ,QAAQ,eAAe;AAExC,OAAO,MAAMC,cAAoC,CAAC,EAC9CC,QAAQ,EACRC,MAAM,EACNC,gBAAgBR,oBAAoB,EACpCS,mBAAmBV,uBAAuB,EAC1CW,gBAAgBC,cAAc,EAC9BC,OAAO,EACPC,SAAS,EACZ;IACG,MAAM,CAACC,cAAcC,gBAAgB,GAAG5B,SAA6B6B;IACrE,MAAM,CAACC,OAAOC,SAAS,GAAG/B,SAAmB,EAAE;IAC/C,MAAMgC,SAASjC,QAAQ,IAAMoB,SAASc,GAAG,CAACC,CAAAA,IAAKA,EAAEC,KAAK,GAAG;QAAChB;KAAS;IACnE,MAAMiB,gBAAgBrC,QAAQ,IAAMoB,SAASc,GAAG,CAACC,CAAAA,IAAKA,EAAEG,YAAY,GAAG;QAAClB;KAAS;IACjF,MAAMmB,cAAc,IAAMV,gBAAgBC;IAE1C,MAAMU,cAAcxC,QAChB,IAAO,CAAA;YACHyC,MAAM,GAAG,MAAMnB,cAAc,CAAC,CAAC;QACnC,CAAA,GACA;QAACA;KAAc;IAGnB,qBACI,MAACf;QACGoB,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,EAAEa,EAAE;gBAkC3B;;;;AAIhB,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/charts/funnel-chart/components/funnel-chart.tsx"],"sourcesContent":["import { useMemo, useState, FC, Fragment } from 'react';\nimport classNames from 'classnames';\nimport { BodyText, Eyebrow, Icon, Mask, Stack, Tooltip } from '@servicetitan/design-system';\nimport { tokens } from '@servicetitan/tokens/core';\nimport { formatValue } from '../../../../utils/formatters';\nimport { StatDiff } from '../../../stat/stat-card';\nimport { FunnelChartProps } from '../utils/interface';\nimport { defaultBottomSideLength, defaultTopSideLength } from '../utils/const';\nimport { FunnelPyramidSvg } from './funnel-svg';\nimport * as Styles from './funnel-chart.module.less';\nimport { Popover } from '@servicetitan/anvil2';\nimport { ColorTag } from '../../common';\n\nexport const FunnelChart: FC<FunnelChartProps> = ({\n sections,\n format,\n topSideLength = defaultTopSideLength,\n bottomSideLength = defaultBottomSideLength,\n popoverContent: PopoverContent,\n loading,\n className,\n}) => {\n const [popoverShown, setPopoverShown] = useState<number | undefined>(undefined);\n const [rowYs, setRowYs] = useState<number[]>([]);\n const colors = useMemo(() => sections.map(s => s.color), [sections]);\n const outlineColors = useMemo(() => sections.map(s => s.outlineColor), [sections]);\n const hidePopover = () => setPopoverShown(undefined);\n\n const rightStyles = useMemo(\n () => ({\n left: `${100 - topSideLength}%`,\n }),\n [topSideLength]\n );\n\n return (\n <Mask\n className={classNames(\n 'h-100 bg-white border border-radius-2 p-3 of-hidden position-relative',\n className\n )}\n active={!!loading}\n >\n <div className={Styles.pyramidWrapper}>\n <FunnelPyramidSvg\n colors={colors}\n outlineColors={outlineColors}\n topSideLength={topSideLength}\n bottomSideLength={bottomSideLength}\n onRowAnchors={setRowYs}\n />\n </div>\n\n <div\n className={classNames(\n 'd-f flex-column justify-content-around',\n Styles.pyramidBoxRight\n )}\n style={rightStyles}\n >\n {sections.map(({ id, title, value, color, prev, data, outlineColor }) => (\n <Stack\n key={title}\n className={Styles.flex1}\n justifyContent=\"center\"\n alignItems=\"center\"\n onMouseEnter={() => setPopoverShown(id)}\n onMouseLeave={hidePopover}\n >\n <Popover open={popoverShown === id} openOnHover placement=\"right\">\n <Popover.Trigger>\n {props => (\n <span {...props}>\n <div className={Styles.percentTextWrapper}>\n <BodyText\n className={classNames(Styles.percentText)}\n data-cy={`marketing-funnel-section-${id}-value`}\n >\n {formatValue(value, format)}\n </BodyText>\n </div>\n </span>\n )}\n </Popover.Trigger>\n <Popover.Content>\n <Stack\n alignItems=\"flex-start\"\n justifyContent=\"flex-start\"\n direction=\"column\"\n data-cy={`marketing-funnel-popover-${id}-content`}\n >\n <Stack>\n <ColorTag\n label=\"\"\n color={color}\n outlineColor={outlineColor}\n pattern={outlineColor ? 'outline' : 'solid'}\n />\n <BodyText bold className=\"m-r-half\">\n {title} {formatValue(value, format)}\n </BodyText>\n </Stack>\n <Stack.Item>\n <StatDiff\n value={value}\n prev={prev}\n size=\"xsmall\"\n format={format}\n />\n </Stack.Item>\n </Stack>\n\n {!!PopoverContent && (\n <PopoverContent\n id={id}\n value={value}\n text={formatValue(value, format)}\n data={data}\n />\n )}\n </Popover.Content>\n </Popover>\n </Stack>\n ))}\n </div>\n <div className={Styles.pyramidBoxLeft} style={{ width: `${100 - topSideLength}%` }}>\n {sections.map((s, i) => {\n const y = rowYs[i] ?? 0;\n const TITLE_UP = 24;\n const DIFF_DOWN = 4;\n\n return (\n <Fragment key={s.id}>\n <div\n className={Styles.leftTitle}\n style={{ top: `calc(${y}% - ${TITLE_UP}px)` }}\n >\n <Eyebrow\n size=\"small\"\n className={classNames(Styles.statTitle, 'm-r-half')}\n >\n {s.title}\n </Eyebrow>\n <Tooltip direction=\"t\" portal text={s.description}>\n <Icon\n name=\"info\"\n className=\"m-r-1\"\n size=\"14px\"\n color={tokens.colorNeutral90}\n />\n </Tooltip>\n </div>\n\n <div\n className={Styles.leftDiff}\n style={{ top: `calc(${y}% + ${DIFF_DOWN}px)` }}\n >\n <StatDiff\n value={s.value}\n prev={s.prev}\n size=\"small\"\n format={format}\n />\n </div>\n </Fragment>\n );\n })}\n </div>\n </Mask>\n );\n};\n"],"names":["useMemo","useState","Fragment","classNames","BodyText","Eyebrow","Icon","Mask","Stack","Tooltip","tokens","formatValue","StatDiff","defaultBottomSideLength","defaultTopSideLength","FunnelPyramidSvg","Styles","Popover","ColorTag","FunnelChart","sections","format","topSideLength","bottomSideLength","popoverContent","PopoverContent","loading","className","popoverShown","setPopoverShown","undefined","rowYs","setRowYs","colors","map","s","color","outlineColors","outlineColor","hidePopover","rightStyles","left","active","div","pyramidWrapper","onRowAnchors","pyramidBoxRight","style","id","title","value","prev","data","flex1","justifyContent","alignItems","onMouseEnter","onMouseLeave","open","openOnHover","placement","Trigger","props","span","percentTextWrapper","percentText","data-cy","Content","direction","label","pattern","bold","Item","size","text","pyramidBoxLeft","width","i","y","TITLE_UP","DIFF_DOWN","leftTitle","top","statTitle","portal","description","name","colorNeutral90","leftDiff"],"mappings":";AAAA,SAASA,OAAO,EAAEC,QAAQ,EAAMC,QAAQ,QAAQ,QAAQ;AACxD,OAAOC,gBAAgB,aAAa;AACpC,SAASC,QAAQ,EAAEC,OAAO,EAAEC,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAEC,OAAO,QAAQ,8BAA8B;AAC5F,SAASC,MAAM,QAAQ,4BAA4B;AACnD,SAASC,WAAW,QAAQ,+BAA+B;AAC3D,SAASC,QAAQ,QAAQ,0BAA0B;AAEnD,SAASC,uBAAuB,EAAEC,oBAAoB,QAAQ,iBAAiB;AAC/E,SAASC,gBAAgB,QAAQ,eAAe;AAChD,YAAYC,YAAY,6BAA6B;AACrD,SAASC,OAAO,QAAQ,uBAAuB;AAC/C,SAASC,QAAQ,QAAQ,eAAe;AAExC,OAAO,MAAMC,cAAoC,CAAC,EAC9CC,QAAQ,EACRC,MAAM,EACNC,gBAAgBR,oBAAoB,EACpCS,mBAAmBV,uBAAuB,EAC1CW,gBAAgBC,cAAc,EAC9BC,OAAO,EACPC,SA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9C,WAAWxB,WAAWa,OAAOmE,SAAS,EAAE;kDAEvChD,EAAEc,KAAK;;kDAEZ,KAACxC;wCAAQ2D,WAAU;wCAAIgB,MAAM;wCAACV,MAAMvC,EAAEkD,WAAW;kDAC7C,cAAA,KAAC/E;4CACGgF,MAAK;4CACL3D,WAAU;4CACV8C,MAAK;4CACLrC,OAAO1B,OAAO6E,cAAc;;;;;0CAKxC,KAAC5C;gCACGhB,WAAWX,OAAOwE,QAAQ;gCAC1BzC,OAAO;oCAAEmC,KAAK,CAAC,KAAK,EAAEJ,EAAE,IAAI,EAAEE,UAAU,GAAG,CAAC;gCAAC;0CAE7C,cAAA,KAACpE;oCACGsC,OAAOf,EAAEe,KAAK;oCACdC,MAAMhB,EAAEgB,IAAI;oCACZsB,MAAK;oCACLpD,QAAQA;;;;uBA7BLc,EAAEa,EAAE;gBAkC3B;;;;AAIhB,EAAE"}
|
|
@@ -9,16 +9,20 @@
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.percent-text-wrapper {
|
|
12
|
-
width:
|
|
13
|
-
height:
|
|
14
|
-
|
|
12
|
+
width: auto;
|
|
13
|
+
height: 28px;
|
|
14
|
+
padding: @spacing-0 @spacing-half;
|
|
15
|
+
display: inline-flex;
|
|
15
16
|
align-items: center;
|
|
16
17
|
justify-content: center;
|
|
17
|
-
border-radius:
|
|
18
|
+
border-radius: 9999px;
|
|
18
19
|
background: rgba(255, 255, 255, 0.8);
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
.percent-text {
|
|
21
22
|
font-size: @typescale-0;
|
|
23
|
+
margin: @spacing-0;
|
|
24
|
+
text-align: center;
|
|
25
|
+
white-space: nowrap;
|
|
22
26
|
}
|
|
23
27
|
}
|
|
24
28
|
|
|
@@ -2,6 +2,7 @@ export const __esModule: true;
|
|
|
2
2
|
export const flex1: string;
|
|
3
3
|
export const leftDiff: string;
|
|
4
4
|
export const leftTitle: string;
|
|
5
|
+
export const percentText: string;
|
|
5
6
|
export const percentTextWrapper: string;
|
|
6
7
|
export const pyramidBoxLeft: string;
|
|
7
8
|
export const pyramidBoxRight: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/marketing-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.1",
|
|
4
4
|
"description": "Marketing UI component and utils",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@servicetitan/anvil2": "^1.42.0",
|
|
34
34
|
"@servicetitan/design-system": "~14.5.1",
|
|
35
|
-
"@servicetitan/react-ioc": "^
|
|
35
|
+
"@servicetitan/react-ioc": "^33.0.0",
|
|
36
36
|
"@servicetitan/tokens": ">=12.2.1",
|
|
37
37
|
"@testing-library/react": "^14.2.1",
|
|
38
38
|
"@types/accounting": "~0.4.2",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"less": true,
|
|
54
54
|
"webpack": false
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "adf2c3ae6e37a646304d21b6701d358a52f8f2e7"
|
|
57
57
|
}
|
|
@@ -9,16 +9,20 @@
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.percent-text-wrapper {
|
|
12
|
-
width:
|
|
13
|
-
height:
|
|
14
|
-
|
|
12
|
+
width: auto;
|
|
13
|
+
height: 28px;
|
|
14
|
+
padding: @spacing-0 @spacing-half;
|
|
15
|
+
display: inline-flex;
|
|
15
16
|
align-items: center;
|
|
16
17
|
justify-content: center;
|
|
17
|
-
border-radius:
|
|
18
|
+
border-radius: 9999px;
|
|
18
19
|
background: rgba(255, 255, 255, 0.8);
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
.percent-text {
|
|
21
22
|
font-size: @typescale-0;
|
|
23
|
+
margin: @spacing-0;
|
|
24
|
+
text-align: center;
|
|
25
|
+
white-space: nowrap;
|
|
22
26
|
}
|
|
23
27
|
}
|
|
24
28
|
|
|
@@ -2,6 +2,7 @@ export const __esModule: true;
|
|
|
2
2
|
export const flex1: string;
|
|
3
3
|
export const leftDiff: string;
|
|
4
4
|
export const leftTitle: string;
|
|
5
|
+
export const percentText: string;
|
|
5
6
|
export const percentTextWrapper: string;
|
|
6
7
|
export const pyramidBoxLeft: string;
|
|
7
8
|
export const pyramidBoxRight: string;
|
|
@@ -73,7 +73,7 @@ export const FunnelChart: FC<FunnelChartProps> = ({
|
|
|
73
73
|
<span {...props}>
|
|
74
74
|
<div className={Styles.percentTextWrapper}>
|
|
75
75
|
<BodyText
|
|
76
|
-
className={classNames(
|
|
76
|
+
className={classNames(Styles.percentText)}
|
|
77
77
|
data-cy={`marketing-funnel-section-${id}-value`}
|
|
78
78
|
>
|
|
79
79
|
{formatValue(value, format)}
|