@lidofinance/lido-ui 3.31.0 → 3.32.0
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/cjs/chart-line/ChartLine.js +4 -3
- package/dist/cjs/chart-line/ChartLine.js.map +1 -1
- package/dist/cjs/chart-line/ChartLineLabel.js +5 -2
- package/dist/cjs/chart-line/ChartLineLabel.js.map +1 -1
- package/dist/cjs/chart-line/types.js.map +1 -1
- package/dist/cjs/chart-line/utils/constants.js +2 -2
- package/dist/cjs/chart-line/utils/constants.js.map +1 -1
- package/dist/cjs/chart-line/utils/handlePositioning.js +6 -5
- package/dist/cjs/chart-line/utils/handlePositioning.js.map +1 -1
- package/dist/cjs/chart-line/utils/processData.js +4 -2
- package/dist/cjs/chart-line/utils/processData.js.map +1 -1
- package/dist/cjs/index.js +35 -33
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/modal/Modal.js +4 -0
- package/dist/cjs/modal/Modal.js.map +1 -1
- package/dist/cjs/modal/ModalStyles.js +16 -2
- package/dist/cjs/modal/ModalStyles.js.map +1 -1
- package/dist/cjs/modal/types.js +13 -0
- package/dist/cjs/modal/types.js.map +1 -0
- package/dist/esm/chart-line/ChartLine.mjs +5 -4
- package/dist/esm/chart-line/ChartLine.mjs.map +1 -1
- package/dist/esm/chart-line/ChartLineLabel.mjs +5 -2
- package/dist/esm/chart-line/ChartLineLabel.mjs.map +1 -1
- package/dist/esm/chart-line/types.mjs.map +1 -1
- package/dist/esm/chart-line/utils/constants.mjs +2 -2
- package/dist/esm/chart-line/utils/constants.mjs.map +1 -1
- package/dist/esm/chart-line/utils/handlePositioning.mjs +7 -6
- package/dist/esm/chart-line/utils/handlePositioning.mjs.map +1 -1
- package/dist/esm/chart-line/utils/processData.mjs +4 -2
- package/dist/esm/chart-line/utils/processData.mjs.map +1 -1
- package/dist/esm/index.mjs +1 -0
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/modal/Modal.mjs +4 -0
- package/dist/esm/modal/Modal.mjs.map +1 -1
- package/dist/esm/modal/ModalStyles.mjs +16 -3
- package/dist/esm/modal/ModalStyles.mjs.map +1 -1
- package/dist/esm/modal/types.mjs +9 -0
- package/dist/esm/modal/types.mjs.map +1 -0
- package/dist/types/chart-line/ChartLine.d.ts.map +1 -1
- package/dist/types/chart-line/ChartLineLabel.d.ts +2 -1
- package/dist/types/chart-line/ChartLineLabel.d.ts.map +1 -1
- package/dist/types/chart-line/types.d.ts +1 -0
- package/dist/types/chart-line/types.d.ts.map +1 -1
- package/dist/types/chart-line/utils/constants.d.ts +1 -1
- package/dist/types/chart-line/utils/constants.d.ts.map +1 -1
- package/dist/types/chart-line/utils/handlePositioning.d.ts +1 -0
- package/dist/types/chart-line/utils/handlePositioning.d.ts.map +1 -1
- package/dist/types/chart-line/utils/processData.d.ts +1 -1
- package/dist/types/chart-line/utils/processData.d.ts.map +1 -1
- package/dist/types/modal/Modal.d.ts +5 -0
- package/dist/types/modal/Modal.d.ts.map +1 -1
- package/dist/types/modal/ModalStyles.d.ts +7 -0
- package/dist/types/modal/ModalStyles.d.ts.map +1 -1
- package/dist/types/modal/types.d.ts +9 -0
- package/dist/types/modal/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
let ModalWindowSize = /*#__PURE__*/function (ModalWindowSize) {
|
|
6
|
+
ModalWindowSize[ModalWindowSize["sm"] = 0] = "sm";
|
|
7
|
+
ModalWindowSize[ModalWindowSize["md"] = 1] = "md";
|
|
8
|
+
ModalWindowSize[ModalWindowSize["lg"] = 2] = "lg";
|
|
9
|
+
return ModalWindowSize;
|
|
10
|
+
}({});
|
|
11
|
+
|
|
12
|
+
exports.ModalWindowSize = ModalWindowSize;
|
|
13
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../packages/modal/types.tsx"],"sourcesContent":["import { ReactElement, ReactNode } from 'react'\nimport { LidoComponentProps } from '../utils/index.js'\nimport {\n TransitionWrapperProps,\n TransitionInnerProps,\n} from '../transition/index.js'\nimport { ButtonProps } from '../button/index.js'\n\nexport type ModalOverlayOwnProps = LidoComponentProps<\n 'div',\n {\n onClose?: () => void\n onBack?: () => void\n }\n>\n\nexport type ModalOverlayProps = ModalOverlayOwnProps & TransitionWrapperProps\nexport type ModalOverlayInnerProps = ModalOverlayOwnProps & TransitionInnerProps\n\nexport type ModalProps = {\n title?: ReactNode\n titleIcon?: ReactNode\n subtitle?: ReactNode\n extra?: ReactNode\n center?: boolean\n open?: boolean\n windowSize?: ModalWindowSizes\n windowProps?: ModalWindowProps\n} & Omit<ModalOverlayProps, 'title' | 'in'>\n\nexport enum ModalWindowSize {\n sm,\n md,\n lg,\n}\nexport type ModalWindowSizes = keyof typeof ModalWindowSize\nexport type ModalWindowProps = LidoComponentProps<'div'>\n\nexport type ModalExtraProps = LidoComponentProps<'div'>\n\nexport type ModalButtonIconProps = {\n icon: ReactElement\n} & ButtonProps\n"],"names":["ModalWindowSize"],"mappings":";;;;AA8BYA,IAAAA,eAAZ,0BAAYA,eAAZ,EAAA;AAAYA,EAAAA,eAAZ,CAAYA,eAAZ,CAAA,IAAA,CAAA,GAAA,CAAA,CAAA,GAAA,IAAA,CAAA;AAAYA,EAAAA,eAAZ,CAAYA,eAAZ,CAAA,IAAA,CAAA,GAAA,CAAA,CAAA,GAAA,IAAA,CAAA;AAAYA,EAAAA,eAAZ,CAAYA,eAAZ,CAAA,IAAA,CAAA,GAAA,CAAA,CAAA,GAAA,IAAA,CAAA;AAAA,EAAA,OAAYA,eAAZ,CAAA;AAAA,CAAA,CAAA,EAAA;;;;"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { forwardRef, useState, useMemo, useLayoutEffect } from 'react';
|
|
1
|
+
import { forwardRef, useState, useId, useMemo, useLayoutEffect } from 'react';
|
|
2
2
|
import '../loaders/Loader.mjs';
|
|
3
3
|
import { InlineLoader } from '../loaders/InlineLoader.mjs';
|
|
4
4
|
import { ChartLineLabel } from './ChartLineLabel.mjs';
|
|
5
|
-
import { CHART_LINE_CONTAINER_ID } from './utils/constants.mjs';
|
|
6
5
|
import { getContainerSize } from './utils/getContainerSize.mjs';
|
|
7
6
|
import { processData } from './utils/processData.mjs';
|
|
8
7
|
import { WrapperStyle, ContainerStyle, LineStyle } from './ChartLineStyles.mjs';
|
|
@@ -22,10 +21,11 @@ const ChartLine = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22
21
|
...rest
|
|
23
22
|
} = props;
|
|
24
23
|
const [containerSize, setContainerSize] = useState(null);
|
|
24
|
+
const containerId = useId();
|
|
25
25
|
const {
|
|
26
26
|
data: processedData,
|
|
27
27
|
ids
|
|
28
|
-
} = useMemo(() => processData(data, maxValue), [data, maxValue]);
|
|
28
|
+
} = useMemo(() => processData(data, containerId, maxValue), [data, maxValue, containerId]);
|
|
29
29
|
const allPreviousIds = useMemo(() => ids.map((_, index) => ids.slice(0, index)), [ids]);
|
|
30
30
|
useLayoutEffect(() => {
|
|
31
31
|
if (!showLabels) {
|
|
@@ -48,7 +48,7 @@ const ChartLine = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
return /*#__PURE__*/jsx(ContainerStyle, {
|
|
51
|
-
id:
|
|
51
|
+
id: containerId,
|
|
52
52
|
$alignItems: containerSize?.isCenterAlign ? 'center' : 'flex-start',
|
|
53
53
|
$height: containerSize?.size ?? 0,
|
|
54
54
|
children: /*#__PURE__*/jsx(WrapperStyle, {
|
|
@@ -75,6 +75,7 @@ const ChartLine = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
75
75
|
previousIds: previousIds,
|
|
76
76
|
height: height,
|
|
77
77
|
thresholdType: thresholdType,
|
|
78
|
+
containerId: containerId,
|
|
78
79
|
...item
|
|
79
80
|
})
|
|
80
81
|
}, id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartLine.mjs","sources":["../../../packages/chart-line/ChartLine.tsx"],"sourcesContent":["import {\n ForwardedRef,\n forwardRef,\n useMemo,\n useLayoutEffect,\n useState,\n} from 'react'\n\nimport { InlineLoader } from '../loaders/index.js'\n\nimport { ChartLineLabel } from './ChartLineLabel.js'\nimport {
|
|
1
|
+
{"version":3,"file":"ChartLine.mjs","sources":["../../../packages/chart-line/ChartLine.tsx"],"sourcesContent":["import {\n ForwardedRef,\n forwardRef,\n useMemo,\n useLayoutEffect,\n useState,\n useId,\n} from 'react'\n\nimport { InlineLoader } from '../loaders/index.js'\n\nimport { ChartLineLabel } from './ChartLineLabel.js'\nimport { getContainerSize, processData } from './utils/index.js'\nimport { ContainerStyle, LineStyle, WrapperStyle } from './ChartLineStyles.js'\nimport { ChartLineProps } from './types.js'\n\nexport const ChartLine = forwardRef(\n (props: ChartLineProps, ref?: ForwardedRef<HTMLDivElement>) => {\n const {\n loading = false,\n onClick,\n children,\n height,\n border,\n data,\n showLabels,\n maxValue,\n thresholdType,\n ...rest\n } = props\n\n const [containerSize, setContainerSize] = useState<{\n size: number\n isCenterAlign: boolean\n } | null>(null)\n const containerId = useId()\n\n const { data: processedData, ids } = useMemo(\n () => processData(data, containerId, maxValue),\n [data, maxValue, containerId],\n )\n\n const allPreviousIds = useMemo(\n () => ids.map((_, index) => ids.slice(0, index)),\n [ids],\n )\n\n useLayoutEffect(() => {\n if (!showLabels) {\n setContainerSize(null)\n return\n }\n const containerSize = getContainerSize(ids)\n setContainerSize(containerSize)\n }, [ids, showLabels])\n\n if (loading) {\n return (\n <WrapperStyle $border={border} $height={height} ref={ref} {...rest}>\n <InlineLoader />\n </WrapperStyle>\n )\n }\n\n return (\n <ContainerStyle\n id={containerId}\n $alignItems={containerSize?.isCenterAlign ? 'center' : 'flex-start'}\n $height={containerSize?.size ?? 0}\n >\n <WrapperStyle $border={border} $height={height} ref={ref} {...rest}>\n {processedData.map((item, index) => {\n const { color, id, width } = item\n const previousIds = allPreviousIds[index]\n\n return (\n <LineStyle\n key={id}\n $width={`${width}%`}\n $backgroundColor={color}\n $zIndex={processedData.length - index}\n $border={border}\n $isFullWidth={width === 100}\n >\n <ChartLineLabel\n zIndex={processedData.length - index}\n show={showLabels}\n previousIds={previousIds}\n height={height}\n thresholdType={thresholdType}\n containerId={containerId}\n {...item}\n />\n </LineStyle>\n )\n })}\n </WrapperStyle>\n </ContainerStyle>\n )\n },\n)\nChartLine.displayName = 'ChartLine'\n"],"names":["ChartLine","forwardRef","props","ref","loading","onClick","children","height","border","data","showLabels","maxValue","thresholdType","rest","containerSize","setContainerSize","useState","containerId","useId","processedData","ids","useMemo","processData","allPreviousIds","map","_","index","slice","useLayoutEffect","getContainerSize","_jsx","isCenterAlign","size","item","color","id","width","previousIds","length","displayName"],"mappings":";;;;;;;;;AAgBO,MAAMA,SAAS,gBAAGC,UAAU,CACjC,CAACC,KAAD,EAAwBC,GAAxB,KAA+D;EAC7D,MAAM;AACJC,IAAAA,OAAO,GAAG,KADN;IAEJC,OAFI;IAGJC,QAHI;IAIJC,MAJI;IAKJC,MALI;IAMJC,IANI;IAOJC,UAPI;IAQJC,QARI;IASJC,aATI;IAUJ,GAAGC,IAAAA;AAVC,GAAA,GAWFX,KAXJ,CAAA;EAaA,MAAM,CAACY,aAAD,EAAgBC,gBAAhB,IAAoCC,QAAQ,CAGxC,IAHwC,CAAlD,CAAA;EAIA,MAAMC,WAAW,GAAGC,KAAK,EAAzB,CAAA;EAEA,MAAM;AAAET,IAAAA,IAAI,EAAEU,aAAR;AAAuBC,IAAAA,GAAAA;AAAvB,GAAA,GAA+BC,OAAO,CAC1C,MAAMC,WAAW,CAACb,IAAD,EAAOQ,WAAP,EAAoBN,QAApB,CADyB,EAE1C,CAACF,IAAD,EAAOE,QAAP,EAAiBM,WAAjB,CAF0C,CAA5C,CAAA;E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AAiB;QAClC,MAAM;UAAEQ,KAAF;UAASC,EAAT;AAAaC,UAAAA,KAAAA;AAAb,SAAA,GAAuBH,IAA7B,CAAA;AACA,QAAA,MAAMI,WAAW,GAAGd,cAAc,CAACG,KAAD,CAAlC,CAAA;AAEA,QAAA,oBACEI,IAAC,SAAD,EAAA;UAEE,MAAM,EAAG,CAAEM,EAAAA,KAAM,CAFnB,CAAA,CAAA;AAGE,UAAA,gBAAgB,EAAEF,KAHpB;AAIE,UAAA,OAAO,EAAEf,aAAa,CAACmB,MAAd,GAAuBZ,KAJlC;AAKE,UAAA,OAAO,EAAElB,MALX;UAME,YAAY,EAAE4B,KAAK,KAAK,GAN1B;AAAA,UAAA,QAAA,eAQEN,IAAC,cAAD,EAAA;AACE,YAAA,MAAM,EAAEX,aAAa,CAACmB,MAAd,GAAuBZ,KADjC;AAEE,YAAA,IAAI,EAAEhB,UAFR;AAGE,YAAA,WAAW,EAAE2B,WAHf;AAIE,YAAA,MAAM,EAAE9B,MAJV;AAKE,YAAA,aAAa,EAAEK,aALjB;AAME,YAAA,WAAW,EAAEK,WANf;YAAA,GAOMgB,IAAAA;AAPN,WAAA,CAAA;AARF,SAAA,EACOE,EADP,CADF,CAAA;OAJD,CAAA;AADH,KAAA,CAAA;GANJ,CAAA,CAAA;AAmCD,CAnFgC,EAA5B;AAqFPnC,SAAS,CAACuC,WAAV,GAAwB,WAAxB;;;;"}
|
|
@@ -15,6 +15,7 @@ const ChartLineLabel = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
15
15
|
thresholdType,
|
|
16
16
|
height,
|
|
17
17
|
threshold,
|
|
18
|
+
containerId,
|
|
18
19
|
...rest
|
|
19
20
|
} = props;
|
|
20
21
|
useLayoutEffect(() => {
|
|
@@ -24,15 +25,17 @@ const ChartLineLabel = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
24
25
|
handlePositioning({
|
|
25
26
|
previousIds,
|
|
26
27
|
id,
|
|
28
|
+
containerId,
|
|
27
29
|
reset: true
|
|
28
30
|
});
|
|
29
31
|
} else {
|
|
30
32
|
handlePositioning({
|
|
31
33
|
previousIds,
|
|
32
|
-
id
|
|
34
|
+
id,
|
|
35
|
+
containerId
|
|
33
36
|
});
|
|
34
37
|
}
|
|
35
|
-
}, [previousIds, id, show, thresholdType]);
|
|
38
|
+
}, [previousIds, id, show, thresholdType, containerId]);
|
|
36
39
|
if (!show) return null;
|
|
37
40
|
const backgroundColor = threshold.color || color;
|
|
38
41
|
const content = threshold.descriptionElement || threshold.description;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartLineLabel.mjs","sources":["../../../packages/chart-line/ChartLineLabel.tsx"],"sourcesContent":["import { ForwardedRef, forwardRef, useLayoutEffect } from 'react'\n\nimport { ChartLineLabelProps, ChartLineThresholdType } from './types.js'\nimport { ThresholdLabelStyle, ThresholdStyle } from './ChartLineStyles.js'\nimport { handlePositioning } from './utils/index.js'\n\nexport const ChartLineLabel = forwardRef(\n (props: ChartLineLabelProps, ref?: ForwardedRef<HTMLDivElement>) => {\n const {\n previousIds,\n id,\n color,\n zIndex,\n show,\n labelPosition,\n thresholdType,\n height,\n threshold,\n ...rest\n } = props\n\n useLayoutEffect(() => {\n if (!show) return\n if (thresholdType !== ChartLineThresholdType.flag) {\n handlePositioning({ previousIds, id, reset: true })\n } else {\n handlePositioning({ previousIds, id })\n }\n }, [previousIds, id, show, thresholdType])\n\n if (!show) return null\n\n const backgroundColor = threshold.color || color\n const content = threshold.descriptionElement || threshold.description\n\n return (\n <ThresholdStyle\n ref={ref}\n id={id}\n data-label-position={labelPosition}\n $labelPosition={labelPosition}\n $thresholdType={thresholdType}\n $height={height}\n $backgroundColor={backgroundColor}\n $zIndex={zIndex}\n {...rest}\n >\n {thresholdType === ChartLineThresholdType.flag && (\n <ThresholdLabelStyle\n style={{ backgroundColor }}\n id={`${id}-description`}\n $labelPosition={labelPosition}\n >\n {content}\n </ThresholdLabelStyle>\n )}\n </ThresholdStyle>\n )\n },\n)\nChartLineLabel.displayName = 'ChartLineLabel'\n"],"names":["ChartLineLabel","forwardRef","props","ref","previousIds","id","color","zIndex","show","labelPosition","thresholdType","height","threshold","rest","useLayoutEffect","ChartLineThresholdType","flag","handlePositioning","reset","backgroundColor","content","descriptionElement","description","_jsx","displayName"],"mappings":";;;;;;AAMO,MAAMA,cAAc,gBAAGC,UAAU,CACtC,CAACC,KAAD,EAA6BC,GAA7B,KAAoE;EAClE,MAAM;IACJC,WADI;IAEJC,EAFI;IAGJC,KAHI;IAIJC,MAJI;IAKJC,IALI;IAMJC,aANI;IAOJC,aAPI;IAQJC,MARI;IASJC,SATI;
|
|
1
|
+
{"version":3,"file":"ChartLineLabel.mjs","sources":["../../../packages/chart-line/ChartLineLabel.tsx"],"sourcesContent":["import { ForwardedRef, forwardRef, useLayoutEffect } from 'react'\n\nimport { ChartLineLabelProps, ChartLineThresholdType } from './types.js'\nimport { ThresholdLabelStyle, ThresholdStyle } from './ChartLineStyles.js'\nimport { handlePositioning } from './utils/index.js'\n\nexport const ChartLineLabel = forwardRef(\n (props: ChartLineLabelProps, ref?: ForwardedRef<HTMLDivElement>) => {\n const {\n previousIds,\n id,\n color,\n zIndex,\n show,\n labelPosition,\n thresholdType,\n height,\n threshold,\n containerId,\n ...rest\n } = props\n\n useLayoutEffect(() => {\n if (!show) return\n if (thresholdType !== ChartLineThresholdType.flag) {\n handlePositioning({ previousIds, id, containerId, reset: true })\n } else {\n handlePositioning({ previousIds, id, containerId })\n }\n }, [previousIds, id, show, thresholdType, containerId])\n\n if (!show) return null\n\n const backgroundColor = threshold.color || color\n const content = threshold.descriptionElement || threshold.description\n\n return (\n <ThresholdStyle\n ref={ref}\n id={id}\n data-label-position={labelPosition}\n $labelPosition={labelPosition}\n $thresholdType={thresholdType}\n $height={height}\n $backgroundColor={backgroundColor}\n $zIndex={zIndex}\n {...rest}\n >\n {thresholdType === ChartLineThresholdType.flag && (\n <ThresholdLabelStyle\n style={{ backgroundColor }}\n id={`${id}-description`}\n $labelPosition={labelPosition}\n >\n {content}\n </ThresholdLabelStyle>\n )}\n </ThresholdStyle>\n )\n },\n)\nChartLineLabel.displayName = 'ChartLineLabel'\n"],"names":["ChartLineLabel","forwardRef","props","ref","previousIds","id","color","zIndex","show","labelPosition","thresholdType","height","threshold","containerId","rest","useLayoutEffect","ChartLineThresholdType","flag","handlePositioning","reset","backgroundColor","content","descriptionElement","description","_jsx","displayName"],"mappings":";;;;;;AAMO,MAAMA,cAAc,gBAAGC,UAAU,CACtC,CAACC,KAAD,EAA6BC,GAA7B,KAAoE;EAClE,MAAM;IACJC,WADI;IAEJC,EAFI;IAGJC,KAHI;IAIJC,MAJI;IAKJC,IALI;IAMJC,aANI;IAOJC,aAPI;IAQJC,MARI;IASJC,SATI;IAUJC,WAVI;IAWJ,GAAGC,IAAAA;AAXC,GAAA,GAYFZ,KAZJ,CAAA;AAcAa,EAAAA,eAAe,CAAC,MAAM;IACpB,IAAI,CAACP,IAAL,EAAW,OAAA;;AACX,IAAA,IAAIE,aAAa,KAAKM,sBAAsB,CAACC,IAA7C,EAAmD;AACjDC,MAAAA,iBAAiB,CAAC;QAAEd,WAAF;QAAeC,EAAf;QAAmBQ,WAAnB;AAAgCM,QAAAA,KAAK,EAAE,IAAA;AAAvC,OAAD,CAAjB,CAAA;AACD,KAFD,MAEO;AACLD,MAAAA,iBAAiB,CAAC;QAAEd,WAAF;QAAeC,EAAf;AAAmBQ,QAAAA,WAAAA;AAAnB,OAAD,CAAjB,CAAA;AACD,KAAA;AACF,GAPc,EAOZ,CAACT,WAAD,EAAcC,EAAd,EAAkBG,IAAlB,EAAwBE,aAAxB,EAAuCG,WAAvC,CAPY,CAAf,CAAA;AASA,EAAA,IAAI,CAACL,IAAL,EAAW,OAAO,IAAP,CAAA;AAEX,EAAA,MAAMY,eAAe,GAAGR,SAAS,CAACN,KAAV,IAAmBA,KAA3C,CAAA;EACA,MAAMe,OAAO,GAAGT,SAAS,CAACU,kBAAV,IAAgCV,SAAS,CAACW,WAA1D,CAAA;AAEA,EAAA,oBACEC,IAAC,cAAD,EAAA;AACE,IAAA,GAAG,EAAErB,GADP;AAEE,IAAA,EAAE,EAAEE,EAFN;AAGE,IAAA,qBAAA,EAAqBI,aAHvB;AAIE,IAAA,cAAc,EAAEA,aAJlB;AAKE,IAAA,cAAc,EAAEC,aALlB;AAME,IAAA,OAAO,EAAEC,MANX;AAOE,IAAA,gBAAgB,EAAES,eAPpB;AAQE,IAAA,OAAO,EAAEb,MARX;AAAA,IAAA,GASMO,IATN;AAAA,IAAA,QAAA,EAWGJ,aAAa,KAAKM,sBAAsB,CAACC,IAAzC,iBACCO,IAAC,mBAAD,EAAA;AACE,MAAA,KAAK,EAAE;AAAEJ,QAAAA,eAAAA;OADX;MAEE,EAAE,EAAG,CAAEf,EAAAA,EAAG,CAFZ,YAAA,CAAA;AAGE,MAAA,cAAc,EAAEI,aAHlB;MAAA,QAKGY,EAAAA,OAAAA;AALH,KAAA,CAAA;GAbN,CAAA,CAAA;AAuBD,CArDqC,EAAjC;AAuDPrB,cAAc,CAACyB,WAAf,GAA6B,gBAA7B;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sources":["../../../packages/chart-line/types.tsx"],"sourcesContent":["import { LidoComponentProps } from '../utils/index.js'\nexport type { Theme } from '../theme/index.js'\n\nexport enum ChartLineThresholdType {\n dash = 'dash',\n flag = 'flag',\n}\nexport type ChartLineThresholdTypes = keyof typeof ChartLineThresholdType\nexport enum ChartLineBorderType {\n rounded = 'rounded',\n square = 'square',\n}\nexport type ChartLineBorderTypes = keyof typeof ChartLineBorderType\n\nexport type ChartLineConfig = {\n loading?: boolean\n data: LineData[]\n thresholdType: ChartLineThresholdType\n height: number\n border: ChartLineBorderType\n maxValue?: number\n showLabels?: boolean\n}\n\nexport type LineData = {\n color?: string\n labelPosition?: 'top' | 'bottom'\n threshold: {\n value: number\n color?: string\n label: string\n description: string\n descriptionElement?: React.ReactNode\n }\n}\n\nexport type ChartLineProps = LidoComponentProps<'div', ChartLineConfig>\n\nexport type ChartLineLabelProps = LidoComponentProps<\n 'div',\n {\n id: string\n previousIds?: string[]\n zIndex: number\n show?: boolean\n height: number\n thresholdType: ChartLineThresholdType\n } & LineData\n>\n"],"names":["ChartLineThresholdType","ChartLineBorderType"],"mappings":"AAGYA,IAAAA,sBAAZ,0BAAYA,sBAAZ,EAAA;EAAYA,sBAAZ,CAAA,MAAA,CAAA,GAAA,MAAA,CAAA;EAAYA,sBAAZ,CAAA,MAAA,CAAA,GAAA,MAAA,CAAA;AAAA,EAAA,OAAYA,sBAAZ,CAAA;AAAA,CAAA,CAAA,EAAA,EAAA;AAKYC,IAAAA,mBAAZ,0BAAYA,mBAAZ,EAAA;EAAYA,mBAAZ,CAAA,SAAA,CAAA,GAAA,SAAA,CAAA;EAAYA,mBAAZ,CAAA,QAAA,CAAA,GAAA,QAAA,CAAA;AAAA,EAAA,OAAYA,mBAAZ,CAAA;AAAA,CAAA,CAAA,EAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"types.mjs","sources":["../../../packages/chart-line/types.tsx"],"sourcesContent":["import { LidoComponentProps } from '../utils/index.js'\nexport type { Theme } from '../theme/index.js'\n\nexport enum ChartLineThresholdType {\n dash = 'dash',\n flag = 'flag',\n}\nexport type ChartLineThresholdTypes = keyof typeof ChartLineThresholdType\nexport enum ChartLineBorderType {\n rounded = 'rounded',\n square = 'square',\n}\nexport type ChartLineBorderTypes = keyof typeof ChartLineBorderType\n\nexport type ChartLineConfig = {\n loading?: boolean\n data: LineData[]\n thresholdType: ChartLineThresholdType\n height: number\n border: ChartLineBorderType\n maxValue?: number\n showLabels?: boolean\n}\n\nexport type LineData = {\n color?: string\n labelPosition?: 'top' | 'bottom'\n threshold: {\n value: number\n color?: string\n label: string\n description: string\n descriptionElement?: React.ReactNode\n }\n}\n\nexport type ChartLineProps = LidoComponentProps<'div', ChartLineConfig>\n\nexport type ChartLineLabelProps = LidoComponentProps<\n 'div',\n {\n id: string\n previousIds?: string[]\n zIndex: number\n show?: boolean\n height: number\n thresholdType: ChartLineThresholdType\n containerId: string\n } & LineData\n>\n"],"names":["ChartLineThresholdType","ChartLineBorderType"],"mappings":"AAGYA,IAAAA,sBAAZ,0BAAYA,sBAAZ,EAAA;EAAYA,sBAAZ,CAAA,MAAA,CAAA,GAAA,MAAA,CAAA;EAAYA,sBAAZ,CAAA,MAAA,CAAA,GAAA,MAAA,CAAA;AAAA,EAAA,OAAYA,sBAAZ,CAAA;AAAA,CAAA,CAAA,EAAA,EAAA;AAKYC,IAAAA,mBAAZ,0BAAYA,mBAAZ,EAAA;EAAYA,mBAAZ,CAAA,SAAA,CAAA,GAAA,SAAA,CAAA;EAAYA,mBAAZ,CAAA,QAAA,CAAA,GAAA,QAAA,CAAA;AAAA,EAAA,OAAYA,mBAAZ,CAAA;AAAA,CAAA,CAAA,EAAA;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const VIEWPORT_MARGIN = 8;
|
|
2
|
-
const
|
|
2
|
+
const CHART_LINE_LABEL_ID = 'chart-line-label';
|
|
3
3
|
const LABEL_HEIGHT_INCREASE = 36;
|
|
4
4
|
|
|
5
|
-
export {
|
|
5
|
+
export { CHART_LINE_LABEL_ID, LABEL_HEIGHT_INCREASE, VIEWPORT_MARGIN };
|
|
6
6
|
//# sourceMappingURL=constants.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.mjs","sources":["../../../../packages/chart-line/utils/constants.ts"],"sourcesContent":["export const VIEWPORT_MARGIN = 8\nexport const
|
|
1
|
+
{"version":3,"file":"constants.mjs","sources":["../../../../packages/chart-line/utils/constants.ts"],"sourcesContent":["export const VIEWPORT_MARGIN = 8\nexport const CHART_LINE_LABEL_ID = 'chart-line-label'\nexport const LABEL_HEIGHT_INCREASE = 36\n"],"names":["VIEWPORT_MARGIN","CHART_LINE_LABEL_ID","LABEL_HEIGHT_INCREASE"],"mappings":"AAAO,MAAMA,eAAe,GAAG,EAAxB;AACA,MAAMC,mBAAmB,GAAG,mBAA5B;AACA,MAAMC,qBAAqB,GAAG;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { checkViewportOverflow } from './checkViewport.mjs';
|
|
2
|
-
import { LABEL_HEIGHT_INCREASE,
|
|
2
|
+
import { LABEL_HEIGHT_INCREASE, VIEWPORT_MARGIN } from './constants.mjs';
|
|
3
3
|
|
|
4
4
|
// Get elements and their rects in one go
|
|
5
|
-
const getElementData = id => {
|
|
5
|
+
const getElementData = (id, containerId) => {
|
|
6
6
|
const threshold = document.getElementById(id);
|
|
7
7
|
const label = document.getElementById(`${id}-description`);
|
|
8
8
|
if (!threshold || !label) return null;
|
|
9
|
-
const container = document.getElementById(
|
|
9
|
+
const container = document.getElementById(containerId);
|
|
10
10
|
if (!container) return null; // Temporarily reset transform to get original positions
|
|
11
11
|
|
|
12
12
|
const originalTransform = label.style.transform;
|
|
@@ -108,7 +108,8 @@ const handlePositioning = props => {
|
|
|
108
108
|
const {
|
|
109
109
|
previousIds = [],
|
|
110
110
|
id,
|
|
111
|
-
reset
|
|
111
|
+
reset,
|
|
112
|
+
containerId
|
|
112
113
|
} = props; // Check if we are in browser (not SSR)
|
|
113
114
|
|
|
114
115
|
if (typeof window === 'undefined') return;
|
|
@@ -118,7 +119,7 @@ const handlePositioning = props => {
|
|
|
118
119
|
return;
|
|
119
120
|
}
|
|
120
121
|
|
|
121
|
-
const currentData = getElementData(id);
|
|
122
|
+
const currentData = getElementData(id, containerId);
|
|
122
123
|
if (!currentData) return;
|
|
123
124
|
const {
|
|
124
125
|
elements: currentElements,
|
|
@@ -142,7 +143,7 @@ const handlePositioning = props => {
|
|
|
142
143
|
|
|
143
144
|
const previousId = getPreviousThreshold(previousIds, id);
|
|
144
145
|
if (!previousId) return;
|
|
145
|
-
const previousData = getElementData(previousId);
|
|
146
|
+
const previousData = getElementData(previousId, containerId);
|
|
146
147
|
if (!previousData) return;
|
|
147
148
|
const {
|
|
148
149
|
rects: previousRects,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlePositioning.mjs","sources":["../../../../packages/chart-line/utils/handlePositioning.ts"],"sourcesContent":["import { checkViewportOverflow } from './checkViewport.js'\nimport {\n CHART_LINE_CONTAINER_ID,\n LABEL_HEIGHT_INCREASE,\n VIEWPORT_MARGIN,\n} from './constants.js'\n\ntype HandlePositioningProps = {\n previousIds?: string[]\n id: string\n reset?: boolean\n}\n\ntype PositioningData = {\n elements: {\n threshold: HTMLElement\n label: HTMLElement\n }\n rects: {\n threshold: DOMRect\n label: DOMRect\n }\n containerRect: DOMRect\n}\n\n// Get elements and their rects in one go\nconst getElementData = (id: string): PositioningData | null => {\n const threshold = document.getElementById(id)\n const label = document.getElementById(`${id}-description`)\n\n if (!threshold || !label) return null\n\n const container = document.getElementById(CHART_LINE_CONTAINER_ID)\n if (!container) return null\n\n // Temporarily reset transform to get original positions\n const originalTransform = label.style.transform\n label.style.removeProperty('transform')\n\n const thresholdRect = threshold.getBoundingClientRect()\n const labelRect = label.getBoundingClientRect()\n const containerRect = container.getBoundingClientRect()\n\n // Restore transform if it existed\n if (originalTransform) {\n label.style.setProperty('transform', originalTransform)\n }\n\n return {\n elements: { threshold, label },\n rects: { threshold: thresholdRect, label: labelRect },\n containerRect,\n }\n}\n\n// Calculate offset needed to keep label within viewport bounds\nconst calculateLabelOffset = (\n thresholdRect: DOMRect,\n labelRect: DOMRect,\n containerRect: DOMRect,\n isInverted: boolean,\n): number => {\n if (isInverted) {\n // Label positioned with left: 0 (extends right from threshold)\n // Check if label extends beyond container right boundary\n const labelRightEdge = thresholdRect.left + labelRect.width\n const containerRightEdge = containerRect.right - VIEWPORT_MARGIN\n\n if (labelRightEdge > containerRightEdge) {\n return labelRightEdge - containerRightEdge\n }\n } else {\n // Label positioned with right: 0 (extends left from threshold - default behavior)\n // Check if label left edge goes beyond container left boundary\n const labelLeftEdge = thresholdRect.right - labelRect.width\n const containerLeftEdge = containerRect.left + VIEWPORT_MARGIN\n\n if (labelLeftEdge < containerLeftEdge) {\n return containerLeftEdge - labelLeftEdge\n }\n }\n return 0\n}\n\n// Calculate if flag should be inverted based on viewport overflow\nconst shouldInvertLabel = (\n thresholdRect: DOMRect,\n labelRect: DOMRect,\n containerRect: DOMRect,\n viewportWidth: number,\n): boolean => {\n const position = containerRect.right - thresholdRect.right\n\n const isInverted = checkViewportOverflow(\n position,\n labelRect.width,\n viewportWidth,\n )\n\n return isInverted\n}\n\nexport const resetThresholdHeight = (threshold: HTMLElement | null): void => {\n if (!threshold) return\n\n threshold.style.removeProperty('height')\n}\n\n// Apply label positioning based on inversion\nconst applyLabelPosition = (label: HTMLElement, isInverted: boolean): void => {\n if (isInverted) {\n label.style.setProperty('left', '0px')\n label.style.setProperty('right', 'auto')\n label.dataset.isInverted = 'true'\n } else {\n label.style.setProperty('right', '0px')\n label.style.setProperty('left', 'auto')\n label.dataset.isInverted = 'false'\n }\n}\n\n// Calculate distance between two thresholds considering label inversion\nconst calculateFlagDistance = (\n currentRect: DOMRect,\n previousRect: DOMRect,\n currentLabelRect: DOMRect,\n isPreviousInverted: boolean,\n): number => {\n return isPreviousInverted\n ? currentRect.left - previousRect.left - currentLabelRect.width\n : currentRect.left - previousRect.left\n}\n\n// Get first previous threshold on the same position as the current threshold\nconst getPreviousThreshold = (\n previousIds: string[],\n currentId: string,\n): string | null => {\n const currentElement = document.getElementById(currentId)\n if (!currentElement) return null\n\n const currentLabelPosition = currentElement.dataset.labelPosition\n\n for (let i = previousIds.length - 1; i >= 0; i--) {\n const id = previousIds[i]\n const element = document.getElementById(id)\n if (element?.dataset.labelPosition === currentLabelPosition) {\n return id\n }\n }\n\n return null\n}\n\nexport const handlePositioning = (props: HandlePositioningProps): void => {\n const { previousIds = [], id, reset } = props\n\n // Check if we are in browser (not SSR)\n if (typeof window === 'undefined') return\n\n if (reset) {\n resetThresholdHeight(document.getElementById(id))\n return\n }\n\n const currentData = getElementData(id)\n if (!currentData) return\n\n const {\n elements: currentElements,\n rects: currentRects,\n containerRect,\n } = currentData\n\n // Calculate inversion for current label using container width\n const currentIsInverted = shouldInvertLabel(\n currentRects.threshold,\n currentRects.label,\n containerRect,\n containerRect.width,\n )\n\n // Apply positioning for current label\n applyLabelPosition(currentElements.label, currentIsInverted)\n\n // Calculate offset needed to keep label within bounds\n const currentOffset = calculateLabelOffset(\n currentRects.threshold,\n currentRects.label,\n containerRect,\n currentIsInverted,\n )\n\n // Apply offset if needed\n if (currentOffset > 0) {\n const direction = currentIsInverted ? -currentOffset : currentOffset\n currentElements.label.style.setProperty(\n 'transform',\n `translateX(${direction}px)`,\n )\n } else {\n currentElements.label.style.removeProperty('transform')\n }\n\n // Handle previous threshold positioning if exists\n const previousId = getPreviousThreshold(previousIds, id)\n if (!previousId) return\n\n const previousData = getElementData(previousId)\n if (!previousData) return\n\n const { rects: previousRects, elements: previousElements } = previousData\n\n // Calculate inversion for previous flag using window width (as in original)\n const previousIsInverted =\n previousElements.label.dataset.isInverted === 'true'\n\n // Calculate distance and adjust height if needed\n const distance = calculateFlagDistance(\n currentRects.threshold,\n previousRects.threshold,\n currentRects.label,\n previousIsInverted,\n )\n\n if (distance < currentRects.label.width) {\n const newHeight = previousRects.threshold.height + LABEL_HEIGHT_INCREASE\n currentElements.threshold.style.setProperty('height', `${newHeight}px`)\n }\n}\n"],"names":["getElementData","id","threshold","document","getElementById","label","container","CHART_LINE_CONTAINER_ID","originalTransform","style","transform","removeProperty","thresholdRect","getBoundingClientRect","labelRect","containerRect","setProperty","elements","rects","calculateLabelOffset","isInverted","labelRightEdge","left","width","containerRightEdge","right","VIEWPORT_MARGIN","labelLeftEdge","containerLeftEdge","shouldInvertLabel","viewportWidth","position","checkViewportOverflow","resetThresholdHeight","applyLabelPosition","dataset","calculateFlagDistance","currentRect","previousRect","currentLabelRect","isPreviousInverted","getPreviousThreshold","previousIds","currentId","currentElement","currentLabelPosition","labelPosition","i","length","element","handlePositioning","props","reset","window","currentData","currentElements","currentRects","currentIsInverted","currentOffset","direction","previousId","previousData","previousRects","previousElements","previousIsInverted","distance","newHeight","height","LABEL_HEIGHT_INCREASE"],"mappings":";;;AAyBA;AACA,MAAMA,cAAc,GAAIC,EAAD,IAAwC;AAC7D,EAAA,MAAMC,SAAS,GAAGC,QAAQ,CAACC,cAAT,CAAwBH,EAAxB,CAAlB,CAAA;EACA,MAAMI,KAAK,GAAGF,QAAQ,CAACC,cAAT,CAAyB,CAAA,EAAEH,EAAG,CAAA,YAAA,CAA9B,CAAd,CAAA;AAEA,EAAA,IAAI,CAACC,SAAD,IAAc,CAACG,KAAnB,EAA0B,OAAO,IAAP,CAAA;AAE1B,EAAA,MAAMC,SAAS,GAAGH,QAAQ,CAACC,cAAT,CAAwBG,uBAAxB,CAAlB,CAAA;AACA,EAAA,IAAI,CAACD,SAAL,EAAgB,OAAO,IAAP,CAP6C;;AAU7D,EAAA,MAAME,iBAAiB,GAAGH,KAAK,CAACI,KAAN,CAAYC,SAAtC,CAAA;AACAL,EAAAA,KAAK,CAACI,KAAN,CAAYE,cAAZ,CAA2B,WAA3B,CAAA,CAAA;AAEA,EAAA,MAAMC,aAAa,GAAGV,SAAS,CAACW,qBAAV,EAAtB,CAAA;AACA,EAAA,MAAMC,SAAS,GAAGT,KAAK,CAACQ,qBAAN,EAAlB,CAAA;AACA,EAAA,MAAME,aAAa,GAAGT,SAAS,CAACO,qBAAV,EAAtB,CAf6D;;AAkB7D,EAAA,IAAIL,iBAAJ,EAAuB;AACrBH,IAAAA,KAAK,CAACI,KAAN,CAAYO,WAAZ,CAAwB,WAAxB,EAAqCR,iBAArC,CAAA,CAAA;AACD,GAAA;;EAED,OAAO;AACLS,IAAAA,QAAQ,EAAE;MAAEf,SAAF;AAAaG,MAAAA,KAAAA;KADlB;AAELa,IAAAA,KAAK,EAAE;AAAEhB,MAAAA,SAAS,EAAEU,aAAb;AAA4BP,MAAAA,KAAK,EAAES,SAAAA;KAFrC;AAGLC,IAAAA,a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,GAAGT,YAAY,CAACnD,KAAb,CAAmBkB,KAAlC,EAAyC;IACvC,MAAM2C,SAAS,GAAGJ,aAAa,CAAC5D,SAAd,CAAwBiE,MAAxB,GAAiCC,qBAAnD,CAAA;IACAb,eAAe,CAACrD,SAAhB,CAA0BO,KAA1B,CAAgCO,WAAhC,CAA4C,QAA5C,EAAuD,CAAEkD,EAAAA,SAAU,CAAnE,EAAA,CAAA,CAAA,CAAA;AACD,GAAA;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"handlePositioning.mjs","sources":["../../../../packages/chart-line/utils/handlePositioning.ts"],"sourcesContent":["import { checkViewportOverflow } from './checkViewport.js'\nimport { LABEL_HEIGHT_INCREASE, VIEWPORT_MARGIN } from './constants.js'\n\ntype HandlePositioningProps = {\n previousIds?: string[]\n id: string\n reset?: boolean\n containerId: string\n}\n\ntype PositioningData = {\n elements: {\n threshold: HTMLElement\n label: HTMLElement\n }\n rects: {\n threshold: DOMRect\n label: DOMRect\n }\n containerRect: DOMRect\n}\n\n// Get elements and their rects in one go\nconst getElementData = (\n id: string,\n containerId: string,\n): PositioningData | null => {\n const threshold = document.getElementById(id)\n const label = document.getElementById(`${id}-description`)\n\n if (!threshold || !label) return null\n\n const container = document.getElementById(containerId)\n if (!container) return null\n\n // Temporarily reset transform to get original positions\n const originalTransform = label.style.transform\n label.style.removeProperty('transform')\n\n const thresholdRect = threshold.getBoundingClientRect()\n const labelRect = label.getBoundingClientRect()\n const containerRect = container.getBoundingClientRect()\n\n // Restore transform if it existed\n if (originalTransform) {\n label.style.setProperty('transform', originalTransform)\n }\n\n return {\n elements: { threshold, label },\n rects: { threshold: thresholdRect, label: labelRect },\n containerRect,\n }\n}\n\n// Calculate offset needed to keep label within viewport bounds\nconst calculateLabelOffset = (\n thresholdRect: DOMRect,\n labelRect: DOMRect,\n containerRect: DOMRect,\n isInverted: boolean,\n): number => {\n if (isInverted) {\n // Label positioned with left: 0 (extends right from threshold)\n // Check if label extends beyond container right boundary\n const labelRightEdge = thresholdRect.left + labelRect.width\n const containerRightEdge = containerRect.right - VIEWPORT_MARGIN\n\n if (labelRightEdge > containerRightEdge) {\n return labelRightEdge - containerRightEdge\n }\n } else {\n // Label positioned with right: 0 (extends left from threshold - default behavior)\n // Check if label left edge goes beyond container left boundary\n const labelLeftEdge = thresholdRect.right - labelRect.width\n const containerLeftEdge = containerRect.left + VIEWPORT_MARGIN\n\n if (labelLeftEdge < containerLeftEdge) {\n return containerLeftEdge - labelLeftEdge\n }\n }\n return 0\n}\n\n// Calculate if flag should be inverted based on viewport overflow\nconst shouldInvertLabel = (\n thresholdRect: DOMRect,\n labelRect: DOMRect,\n containerRect: DOMRect,\n viewportWidth: number,\n): boolean => {\n const position = containerRect.right - thresholdRect.right\n\n const isInverted = checkViewportOverflow(\n position,\n labelRect.width,\n viewportWidth,\n )\n\n return isInverted\n}\n\nexport const resetThresholdHeight = (threshold: HTMLElement | null): void => {\n if (!threshold) return\n\n threshold.style.removeProperty('height')\n}\n\n// Apply label positioning based on inversion\nconst applyLabelPosition = (label: HTMLElement, isInverted: boolean): void => {\n if (isInverted) {\n label.style.setProperty('left', '0px')\n label.style.setProperty('right', 'auto')\n label.dataset.isInverted = 'true'\n } else {\n label.style.setProperty('right', '0px')\n label.style.setProperty('left', 'auto')\n label.dataset.isInverted = 'false'\n }\n}\n\n// Calculate distance between two thresholds considering label inversion\nconst calculateFlagDistance = (\n currentRect: DOMRect,\n previousRect: DOMRect,\n currentLabelRect: DOMRect,\n isPreviousInverted: boolean,\n): number => {\n return isPreviousInverted\n ? currentRect.left - previousRect.left - currentLabelRect.width\n : currentRect.left - previousRect.left\n}\n\n// Get first previous threshold on the same position as the current threshold\nconst getPreviousThreshold = (\n previousIds: string[],\n currentId: string,\n): string | null => {\n const currentElement = document.getElementById(currentId)\n if (!currentElement) return null\n\n const currentLabelPosition = currentElement.dataset.labelPosition\n\n for (let i = previousIds.length - 1; i >= 0; i--) {\n const id = previousIds[i]\n const element = document.getElementById(id)\n if (element?.dataset.labelPosition === currentLabelPosition) {\n return id\n }\n }\n\n return null\n}\n\nexport const handlePositioning = (props: HandlePositioningProps): void => {\n const { previousIds = [], id, reset, containerId } = props\n\n // Check if we are in browser (not SSR)\n if (typeof window === 'undefined') return\n\n if (reset) {\n resetThresholdHeight(document.getElementById(id))\n return\n }\n\n const currentData = getElementData(id, containerId)\n if (!currentData) return\n\n const {\n elements: currentElements,\n rects: currentRects,\n containerRect,\n } = currentData\n\n // Calculate inversion for current label using container width\n const currentIsInverted = shouldInvertLabel(\n currentRects.threshold,\n currentRects.label,\n containerRect,\n containerRect.width,\n )\n\n // Apply positioning for current label\n applyLabelPosition(currentElements.label, currentIsInverted)\n\n // Calculate offset needed to keep label within bounds\n const currentOffset = calculateLabelOffset(\n currentRects.threshold,\n currentRects.label,\n containerRect,\n currentIsInverted,\n )\n\n // Apply offset if needed\n if (currentOffset > 0) {\n const direction = currentIsInverted ? -currentOffset : currentOffset\n currentElements.label.style.setProperty(\n 'transform',\n `translateX(${direction}px)`,\n )\n } else {\n currentElements.label.style.removeProperty('transform')\n }\n\n // Handle previous threshold positioning if exists\n const previousId = getPreviousThreshold(previousIds, id)\n if (!previousId) return\n\n const previousData = getElementData(previousId, containerId)\n if (!previousData) return\n\n const { rects: previousRects, elements: previousElements } = previousData\n\n // Calculate inversion for previous flag using window width (as in original)\n const previousIsInverted =\n previousElements.label.dataset.isInverted === 'true'\n\n // Calculate distance and adjust height if needed\n const distance = calculateFlagDistance(\n currentRects.threshold,\n previousRects.threshold,\n currentRects.label,\n previousIsInverted,\n )\n\n if (distance < currentRects.label.width) {\n const newHeight = previousRects.threshold.height + LABEL_HEIGHT_INCREASE\n currentElements.threshold.style.setProperty('height', `${newHeight}px`)\n }\n}\n"],"names":["getElementData","id","containerId","threshold","document","getElementById","label","container","originalTransform","style","transform","removeProperty","thresholdRect","getBoundingClientRect","labelRect","containerRect","setProperty","elements","rects","calculateLabelOffset","isInverted","labelRightEdge","left","width","containerRightEdge","right","VIEWPORT_MARGIN","labelLeftEdge","containerLeftEdge","shouldInvertLabel","viewportWidth","position","checkViewportOverflow","resetThresholdHeight","applyLabelPosition","dataset","calculateFlagDistance","currentRect","previousRect","currentLabelRect","isPreviousInverted","getPreviousThreshold","previousIds","currentId","currentElement","currentLabelPosition","labelPosition","i","length","element","handlePositioning","props","reset","window","currentData","currentElements","currentRects","currentIsInverted","currentOffset","direction","previousId","previousData","previousRects","previousElements","previousIsInverted","distance","newHeight","height","LABEL_HEIGHT_INCREASE"],"mappings":";;;AAsBA;AACA,MAAMA,cAAc,GAAG,CACrBC,EADqB,EAErBC,WAFqB,KAGM;AAC3B,EAAA,MAAMC,SAAS,GAAGC,QAAQ,CAACC,cAAT,CAAwBJ,EAAxB,CAAlB,CAAA;EACA,MAAMK,KAAK,GAAGF,QAAQ,CAACC,cAAT,CAAyB,CAAA,EAAEJ,EAAG,CAAA,YAAA,CAA9B,CAAd,CAAA;AAEA,EAAA,IAAI,CAACE,SAAD,IAAc,CAACG,KAAnB,EAA0B,OAAO,IAAP,CAAA;AAE1B,EAAA,MAAMC,SAAS,GAAGH,QAAQ,CAACC,cAAT,CAAwBH,WAAxB,CAAlB,CAAA;AACA,EAAA,IAAI,CAACK,SAAL,EAAgB,OAAO,IAAP,CAPW;;AAU3B,EAAA,MAAMC,iBAAiB,GAAGF,KAAK,CAACG,KAAN,CAAYC,SAAtC,CAAA;AACAJ,EAAAA,KAAK,CAACG,KAAN,CAAYE,cAAZ,CAA2B,WAA3B,CAAA,CAAA;AAEA,EAAA,MAAMC,aAAa,GAAGT,SAAS,CAACU,qBAAV,EAAtB,CAAA;AACA,EAAA,MAAMC,SAAS,GAAGR,KAAK,CAACO,qBAAN,EAAlB,CAAA;AACA,EAAA,MAAME,aAAa,GAAGR,SAAS,CAACM,qBAAV,EAAtB,CAf2B;;AAkB3B,EAAA,IAAIL,iBAAJ,EAAuB;AACrBF,IAAAA,KAAK,CAACG,KAAN,CAAYO,WAAZ,CAAwB,WAAxB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kBAAkB,GACtBD,gBAAgB,CAACzD,KAAjB,CAAuB6B,OAAvB,CAA+Bf,UAA/B,KAA8C,MADhD,CA5DwE;;AAgExE,EAAA,MAAM6C,QAAQ,GAAG7B,qBAAqB,CACpCoB,YAAY,CAACrD,SADuB,EAEpC2D,aAAa,CAAC3D,SAFsB,EAGpCqD,YAAY,CAAClD,KAHuB,EAIpC0D,kBAJoC,CAAtC,CAAA;;AAOA,EAAA,IAAIC,QAAQ,GAAGT,YAAY,CAAClD,KAAb,CAAmBiB,KAAlC,EAAyC;IACvC,MAAM2C,SAAS,GAAGJ,aAAa,CAAC3D,SAAd,CAAwBgE,MAAxB,GAAiCC,qBAAnD,CAAA;IACAb,eAAe,CAACpD,SAAhB,CAA0BM,KAA1B,CAAgCO,WAAhC,CAA4C,QAA5C,EAAuD,CAAEkD,EAAAA,SAAU,CAAnE,EAAA,CAAA,CAAA,CAAA;AACD,GAAA;AACF;;;;"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import { CHART_LINE_LABEL_ID } from './constants.mjs';
|
|
2
|
+
|
|
3
|
+
const processData = (data, containerId, maxValue) => {
|
|
2
4
|
// Calculate maxValue once if not provided
|
|
3
5
|
const calculatedMaxValue = maxValue ?? Math.max(...data.map(item => item.threshold.value));
|
|
4
6
|
return data.sort((a, b) => a.threshold.value - b.threshold.value).reduce((acc, item, index) => {
|
|
5
7
|
const {
|
|
6
8
|
threshold
|
|
7
9
|
} = item;
|
|
8
|
-
const id =
|
|
10
|
+
const id = `${containerId}-${CHART_LINE_LABEL_ID}-${index}-${threshold.label}`;
|
|
9
11
|
const width = threshold.value / (calculatedMaxValue / 100);
|
|
10
12
|
const processedItem = { ...item,
|
|
11
13
|
id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processData.mjs","sources":["../../../../packages/chart-line/utils/processData.ts"],"sourcesContent":["import { LineData } from '../types.js'\n\ntype ProcessedLineData = LineData & {\n id: string\n index: number\n width: number\n}\n\ntype ProcessedData = {\n data: ProcessedLineData[]\n ids: string[]\n}\n\nexport const processData = (\n data: LineData[],\n maxValue?: number,\n): ProcessedData => {\n // Calculate maxValue once if not provided\n const calculatedMaxValue =\n maxValue ?? Math.max(...data.map((item) => item.threshold.value))\n\n return data\n .sort((a, b) => a.threshold.value - b.threshold.value)\n .reduce<ProcessedData>(\n (acc, item, index) => {\n const { threshold } = item\n const id =
|
|
1
|
+
{"version":3,"file":"processData.mjs","sources":["../../../../packages/chart-line/utils/processData.ts"],"sourcesContent":["import { CHART_LINE_LABEL_ID } from './constants.js'\nimport { LineData } from '../types.js'\n\ntype ProcessedLineData = LineData & {\n id: string\n index: number\n width: number\n}\n\ntype ProcessedData = {\n data: ProcessedLineData[]\n ids: string[]\n}\n\nexport const processData = (\n data: LineData[],\n containerId: string,\n maxValue?: number,\n): ProcessedData => {\n // Calculate maxValue once if not provided\n const calculatedMaxValue =\n maxValue ?? Math.max(...data.map((item) => item.threshold.value))\n\n return data\n .sort((a, b) => a.threshold.value - b.threshold.value)\n .reduce<ProcessedData>(\n (acc, item, index) => {\n const { threshold } = item\n const id = `${containerId}-${CHART_LINE_LABEL_ID}-${index}-${threshold.label}`\n const width = threshold.value / (calculatedMaxValue / 100)\n\n const processedItem: ProcessedLineData = {\n ...item,\n id,\n index,\n width,\n }\n\n acc.data.push(processedItem)\n acc.ids.push(id)\n\n return acc\n },\n { data: [], ids: [] },\n )\n}\n"],"names":["processData","data","containerId","maxValue","calculatedMaxValue","Math","max","map","item","threshold","value","sort","a","b","reduce","acc","index","id","CHART_LINE_LABEL_ID","label","width","processedItem","push","ids"],"mappings":";;AAcO,MAAMA,WAAW,GAAG,CACzBC,IADyB,EAEzBC,WAFyB,EAGzBC,QAHyB,KAIP;AAClB;EACA,MAAMC,kBAAkB,GACtBD,QAAQ,IAAIE,IAAI,CAACC,GAAL,CAAS,GAAGL,IAAI,CAACM,GAAL,CAAUC,IAAD,IAAUA,IAAI,CAACC,SAAL,CAAeC,KAAlC,CAAZ,CADd,CAAA;AAGA,EAAA,OAAOT,IAAI,CACRU,IADI,CACC,CAACC,CAAD,EAAIC,CAAJ,KAAUD,CAAC,CAACH,SAAF,CAAYC,KAAZ,GAAoBG,CAAC,CAACJ,SAAF,CAAYC,KAD3C,CAEJI,CAAAA,MAFI,CAGH,CAACC,GAAD,EAAMP,IAAN,EAAYQ,KAAZ,KAAsB;IACpB,MAAM;AAAEP,MAAAA,SAAAA;AAAF,KAAA,GAAgBD,IAAtB,CAAA;AACA,IAAA,MAAMS,EAAE,GAAI,CAAEf,EAAAA,WAAY,CAAGgB,CAAAA,EAAAA,mBAAoB,CAAGF,CAAAA,EAAAA,KAAM,CAAGP,CAAAA,EAAAA,SAAS,CAACU,KAAM,CAA7E,CAAA,CAAA;IACA,MAAMC,KAAK,GAAGX,SAAS,CAACC,KAAV,IAAmBN,kBAAkB,GAAG,GAAxC,CAAd,CAAA;AAEA,IAAA,MAAMiB,aAAgC,GAAG,EACvC,GAAGb,IADoC;MAEvCS,EAFuC;MAGvCD,KAHuC;AAIvCI,MAAAA,KAAAA;KAJF,CAAA;AAOAL,IAAAA,GAAG,CAACd,IAAJ,CAASqB,IAAT,CAAcD,aAAd,CAAA,CAAA;AACAN,IAAAA,GAAG,CAACQ,GAAJ,CAAQD,IAAR,CAAaL,EAAb,CAAA,CAAA;AAEA,IAAA,OAAOF,GAAP,CAAA;AACD,GAnBE,EAoBH;AAAEd,IAAAA,IAAI,EAAE,EAAR;AAAYsB,IAAAA,GAAG,EAAE,EAAA;AAAjB,GApBG,CAAP,CAAA;AAsBD;;;;"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -48,6 +48,7 @@ export { Modal } from './modal/Modal.mjs';
|
|
|
48
48
|
export { ModalExtra } from './modal/ModalExtra.mjs';
|
|
49
49
|
export { ModalOverlay } from './modal/ModalOverlay.mjs';
|
|
50
50
|
export { ModalButton } from './modal/ModalButton.mjs';
|
|
51
|
+
export { ModalWindowSize } from './modal/types.mjs';
|
|
51
52
|
export { Pagination } from './pagination/Pagination.mjs';
|
|
52
53
|
export { PaginationItem } from './pagination/PaginationItem.mjs';
|
|
53
54
|
export { PaginationItemVariant } from './pagination/types.mjs';
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/esm/modal/Modal.mjs
CHANGED
|
@@ -14,6 +14,8 @@ const Modal = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
14
14
|
open,
|
|
15
15
|
onClose,
|
|
16
16
|
onBack,
|
|
17
|
+
windowSize = 'sm',
|
|
18
|
+
windowProps,
|
|
17
19
|
...rest
|
|
18
20
|
} = _ref;
|
|
19
21
|
const withTitleIcon = !!titleIcon;
|
|
@@ -49,6 +51,8 @@ const Modal = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
49
51
|
...rest,
|
|
50
52
|
children: /*#__PURE__*/jsxs(ModalStyle, {
|
|
51
53
|
$center: center,
|
|
54
|
+
$size: windowSize,
|
|
55
|
+
...windowProps,
|
|
52
56
|
children: [/*#__PURE__*/jsxs(ModalBaseStyle, {
|
|
53
57
|
children: [modalHeader, withSubtitle && /*#__PURE__*/jsx(ModalSubtitleStyle, {
|
|
54
58
|
children: subtitle
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.mjs","sources":["../../../packages/modal/Modal.tsx"],"sourcesContent":["import { ForwardedRef, forwardRef } from 'react'\nimport {\n ModalStyle,\n ModalBaseStyle,\n ModalHeaderStyle,\n ModalTitleStyle,\n ModalTitleIconStyle,\n ModalTitleTextStyle,\n ModalCloseStyle,\n ModalContentStyle,\n ModalBackStyle,\n ModalSubtitleStyle,\n} from './ModalStyles.js'\nimport { ModalProps } from './types.js'\nimport { ModalOverlay } from './ModalOverlay.js'\n\nexport const Modal = forwardRef(\n (\n {\n children,\n title,\n titleIcon,\n subtitle,\n center = false,\n extra,\n open,\n onClose,\n onBack,\n ...rest\n }: ModalProps,\n ref?: ForwardedRef<HTMLDivElement>,\n ) => {\n const withTitleIcon = !!titleIcon\n const withSubtitle = !!subtitle\n const withCloseButton = !!onClose\n const withBackButton = !!onBack\n\n const modalHeader = (\n <ModalHeaderStyle $short={!title}>\n {withBackButton && <ModalBackStyle onClick={onBack} />}\n <ModalTitleStyle\n $center={center}\n $withTitleIcon={withTitleIcon}\n $withCloseButton={withCloseButton}\n $withBackButton={withBackButton}\n >\n {withTitleIcon && (\n <ModalTitleIconStyle $center={center}>\n {titleIcon}\n </ModalTitleIconStyle>\n )}\n <ModalTitleTextStyle>{title}</ModalTitleTextStyle>\n </ModalTitleStyle>\n {withCloseButton && <ModalCloseStyle onClick={onClose} />}\n </ModalHeaderStyle>\n )\n\n return (\n <ModalOverlay\n ref={ref}\n in={open}\n onClose={onClose}\n onBack={onBack}\n {...rest}\n >\n <ModalStyle $center={center}>\n <ModalBaseStyle>\n {modalHeader}\n {withSubtitle && (\n <ModalSubtitleStyle>{subtitle}</ModalSubtitleStyle>\n )}\n <ModalContentStyle>{children}</ModalContentStyle>\n </ModalBaseStyle>\n {extra}\n </ModalStyle>\n </ModalOverlay>\n )\n },\n)\nModal.displayName = 'Modal'\n"],"names":["Modal","forwardRef","ref","children","title","titleIcon","subtitle","center","extra","open","onClose","onBack","rest","withTitleIcon","withSubtitle","withCloseButton","withBackButton","modalHeader","_jsxs","_jsx","displayName"],"mappings":";;;;;MAgBaA,KAAK,gBAAGC,UAAU,CAC7B,CAAA,IAAA,
|
|
1
|
+
{"version":3,"file":"Modal.mjs","sources":["../../../packages/modal/Modal.tsx"],"sourcesContent":["import { ForwardedRef, forwardRef } from 'react'\nimport {\n ModalStyle,\n ModalBaseStyle,\n ModalHeaderStyle,\n ModalTitleStyle,\n ModalTitleIconStyle,\n ModalTitleTextStyle,\n ModalCloseStyle,\n ModalContentStyle,\n ModalBackStyle,\n ModalSubtitleStyle,\n} from './ModalStyles.js'\nimport { ModalProps } from './types.js'\nimport { ModalOverlay } from './ModalOverlay.js'\n\nexport const Modal = forwardRef(\n (\n {\n children,\n title,\n titleIcon,\n subtitle,\n center = false,\n extra,\n open,\n onClose,\n onBack,\n windowSize = 'sm',\n windowProps,\n ...rest\n }: ModalProps,\n ref?: ForwardedRef<HTMLDivElement>,\n ) => {\n const withTitleIcon = !!titleIcon\n const withSubtitle = !!subtitle\n const withCloseButton = !!onClose\n const withBackButton = !!onBack\n\n const modalHeader = (\n <ModalHeaderStyle $short={!title}>\n {withBackButton && <ModalBackStyle onClick={onBack} />}\n <ModalTitleStyle\n $center={center}\n $withTitleIcon={withTitleIcon}\n $withCloseButton={withCloseButton}\n $withBackButton={withBackButton}\n >\n {withTitleIcon && (\n <ModalTitleIconStyle $center={center}>\n {titleIcon}\n </ModalTitleIconStyle>\n )}\n <ModalTitleTextStyle>{title}</ModalTitleTextStyle>\n </ModalTitleStyle>\n {withCloseButton && <ModalCloseStyle onClick={onClose} />}\n </ModalHeaderStyle>\n )\n\n return (\n <ModalOverlay\n ref={ref}\n in={open}\n onClose={onClose}\n onBack={onBack}\n {...rest}\n >\n <ModalStyle $center={center} $size={windowSize} {...windowProps}>\n <ModalBaseStyle>\n {modalHeader}\n {withSubtitle && (\n <ModalSubtitleStyle>{subtitle}</ModalSubtitleStyle>\n )}\n <ModalContentStyle>{children}</ModalContentStyle>\n </ModalBaseStyle>\n {extra}\n </ModalStyle>\n </ModalOverlay>\n )\n },\n)\nModal.displayName = 'Modal'\n"],"names":["Modal","forwardRef","ref","children","title","titleIcon","subtitle","center","extra","open","onClose","onBack","windowSize","windowProps","rest","withTitleIcon","withSubtitle","withCloseButton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A;KAfhD,CAAA,CAAA;GADF,CAAA,CAAA;;AAoBA,EAAA,oBACEW,IAAC,YAAD,EAAA;AACE,IAAA,GAAG,EAAEnB,GADP;AAEE,IAAA,EAAE,EAAEO,IAFN;AAGE,IAAA,OAAO,EAAEC,OAHX;AAIE,IAAA,MAAM,EAAEC,MAJV;AAAA,IAAA,GAKMG,IALN;AAAA,IAAA,QAAA,eAOEM,KAAC,UAAD,EAAA;AAAY,MAAA,OAAO,EAAEb,MAArB;AAA6B,MAAA,KAAK,EAAEK,UAApC;AAAA,MAAA,GAAoDC,WAApD;AAAA,MAAA,QAAA,EAAA,cACEO,KAAC,cAAD,EAAA;AAAA,QAAA,QAAA,EAAA,CACGD,WADH,EAEGH,YAAY,iBACXK,IAAC,kBAAD,EAAA;UAAA,QAAqBf,EAAAA,QAAAA;SAHzB,CAAA,eAKEe,IAAC,iBAAD,EAAA;UAAA,QAAoBlB,EAAAA,QAAAA;SALtB,CAAA,CAAA;AAAA,OAAA,CADF,EAQGK,KARH,CAAA;AAAA,KAAA,CAAA;GARJ,CAAA,CAAA;AAoBD,CA/D4B,EAAxB;AAiEPR,KAAK,CAACsB,WAAN,GAAoB,OAApB;;;;"}
|
|
@@ -5,6 +5,17 @@ import { ButtonIcon } from '../button/ButtonIcon.mjs';
|
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
import { css } from 'styled-components';
|
|
7
7
|
|
|
8
|
+
const ModalWindowSizesMap = {
|
|
9
|
+
sm: css`
|
|
10
|
+
width: 432px;
|
|
11
|
+
`,
|
|
12
|
+
md: css`
|
|
13
|
+
width: 520px;
|
|
14
|
+
`,
|
|
15
|
+
lg: css`
|
|
16
|
+
width: 960px;
|
|
17
|
+
`
|
|
18
|
+
};
|
|
8
19
|
const ModalStyle = styled.div`
|
|
9
20
|
${_ref => {
|
|
10
21
|
let {
|
|
@@ -14,10 +25,10 @@ const ModalStyle = styled.div`
|
|
|
14
25
|
colors,
|
|
15
26
|
boxShadows
|
|
16
27
|
},
|
|
17
|
-
$center
|
|
28
|
+
$center,
|
|
29
|
+
$size
|
|
18
30
|
} = _ref;
|
|
19
31
|
return css`
|
|
20
|
-
width: 432px;
|
|
21
32
|
max-width: 100%;
|
|
22
33
|
font-weight: 400;
|
|
23
34
|
font-size: ${fontSizesMap.xs}px;
|
|
@@ -25,6 +36,8 @@ const ModalStyle = styled.div`
|
|
|
25
36
|
text-align: ${$center ? 'center' : 'left'};
|
|
26
37
|
border-radius: ${borderRadiusesMap.xl}px;
|
|
27
38
|
box-shadow: ${boxShadows.xxl} ${colors.shadowDark};
|
|
39
|
+
|
|
40
|
+
${ModalWindowSizesMap[$size]}
|
|
28
41
|
`;
|
|
29
42
|
}}
|
|
30
43
|
`;
|
|
@@ -200,5 +213,5 @@ const ModalBackStyle = styled(ButtonIcon).attrs({
|
|
|
200
213
|
}}
|
|
201
214
|
`;
|
|
202
215
|
|
|
203
|
-
export { ModalBackStyle, ModalBaseStyle, ModalCloseStyle, ModalContentStyle, ModalHeaderStyle, ModalStyle, ModalSubtitleStyle, ModalTitleIconStyle, ModalTitleStyle, ModalTitleTextStyle };
|
|
216
|
+
export { ModalBackStyle, ModalBaseStyle, ModalCloseStyle, ModalContentStyle, ModalHeaderStyle, ModalStyle, ModalSubtitleStyle, ModalTitleIconStyle, ModalTitleStyle, ModalTitleTextStyle, ModalWindowSizesMap };
|
|
204
217
|
//# sourceMappingURL=ModalStyles.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalStyles.mjs","sources":["../../../packages/modal/ModalStyles.tsx"],"sourcesContent":["import styled, { css } from '../utils/styled-components-wrapper.js'\nimport { Close, ArrowBack } from '../icons/index.js'\nimport { ButtonIcon } from '../button/index.js'\n\nexport const ModalStyle = styled.div<{
|
|
1
|
+
{"version":3,"file":"ModalStyles.mjs","sources":["../../../packages/modal/ModalStyles.tsx"],"sourcesContent":["import styled, { css } from '../utils/styled-components-wrapper.js'\nimport { Close, ArrowBack } from '../icons/index.js'\nimport { ButtonIcon } from '../button/index.js'\nimport { ModalWindowSizes } from './types.js'\n\nexport const ModalWindowSizesMap = {\n sm: css`\n width: 432px;\n `,\n md: css`\n width: 520px;\n `,\n lg: css`\n width: 960px;\n `,\n}\n\nexport const ModalStyle = styled.div<{\n $center: boolean\n $size: ModalWindowSizes\n}>`\n ${({\n theme: { fontSizesMap, borderRadiusesMap, colors, boxShadows },\n $center,\n $size,\n }) => css`\n max-width: 100%;\n font-weight: 400;\n font-size: ${fontSizesMap.xs}px;\n line-height: 1.5em;\n text-align: ${$center ? 'center' : 'left'};\n border-radius: ${borderRadiusesMap.xl}px;\n box-shadow: ${boxShadows.xxl} ${colors.shadowDark};\n\n ${ModalWindowSizesMap[$size]}\n `}\n`\n\nexport const ModalBaseStyle = styled.div`\n ${({ theme: { colors } }) => css`\n color: ${colors.text};\n background: ${colors.foreground};\n border-radius: inherit;\n position: relative;\n z-index: 1;\n `}\n`\n\nexport const ModalHeaderStyle = styled.div<{\n $short: boolean\n}>`\n ${({ theme: { spaceMap, fontSizesMap, mediaQueries }, $short }) => css`\n display: flex;\n align-items: flex-start;\n min-height: 32px;\n margin-bottom: ${$short ? -spaceMap.md : 0}px;\n padding: ${spaceMap.xl}px ${spaceMap.xxl}px;\n font-size: ${fontSizesMap.md}px;\n line-height: 1.5em;\n\n ${mediaQueries.md} {\n padding: ${spaceMap.lg}px;\n }\n `}\n`\n\nexport const ModalTitleStyle = styled.div<{\n $center: boolean\n $withTitleIcon: boolean\n $withCloseButton: boolean\n $withBackButton: boolean\n}>`\n ${({\n theme: { fontSizesMap, spaceMap, mediaQueries },\n $center,\n $withBackButton,\n $withCloseButton,\n $withTitleIcon,\n }) => css`\n font-size: ${fontSizesMap.sm}px;\n line-height: 1.5em;\n font-weight: 700;\n margin-left: ${$center && !$withBackButton ? spaceMap.xxl : '0'}px;\n margin-right: ${$center && !$withCloseButton ? spaceMap.xxl : '0'}px;\n padding-top: ${$withTitleIcon ? spaceMap.sm : '0'}px;\n padding-left: 0;\n padding-right: ${spaceMap.sm}px;\n flex-grow: 1;\n align-self: center;\n\n ${mediaQueries.md} {\n padding-right: ${spaceMap.xs}px;\n }\n `}\n`\n\nexport const ModalTitleIconStyle = styled.div<{\n $center: boolean\n}>`\n ${({ theme: { spaceMap }, $center }) => css`\n display: ${$center ? 'flex' : 'block'};\n justify-content: ${$center ? 'center' : 'flex-start'};\n line-height: 0.7;\n margin-bottom: ${spaceMap.md}px;\n `}\n`\n\nexport const ModalTitleTextStyle = styled.div`\n margin: ${({ theme }) => theme.spaceMap.xs}px 0;\n`\n\nexport const ModalSubtitleStyle = styled.div`\n ${({ theme: { colors, fontSizesMap, spaceMap, mediaQueries } }) => css`\n color: ${colors.textSecondary};\n font-size: ${fontSizesMap.xs}px;\n font-weight: 400;\n line-height: 24px;\n margin-top: -${spaceMap.xl}px;\n padding: 0 ${spaceMap.xxl}px ${spaceMap.sm}px;\n\n ${mediaQueries.md} {\n padding-left: ${spaceMap.xl}px;\n padding-right: ${spaceMap.xl}px;\n }\n `}\n`\n\nexport const ModalContentStyle = styled.div`\n ${({ theme: { spaceMap, mediaQueries } }) => css`\n padding: 0 ${spaceMap.xxl}px ${spaceMap.xxl}px;\n\n ${mediaQueries.md} {\n padding: 0 ${spaceMap.lg}px ${spaceMap.lg}px;\n }\n `}\n`\n\nexport const ModalCloseStyle = styled(ButtonIcon).attrs({\n icon: <Close />,\n color: 'secondary',\n variant: 'ghost',\n size: 'xs',\n})`\n margin: 0 -10px 0 0;\n color: var(--lido-color-textSecondary);\n flex-shrink: 0;\n border-radius: 50%;\n`\n\nexport const ModalBackStyle = styled(ButtonIcon).attrs({\n icon: <ArrowBack />,\n color: 'secondary',\n variant: 'ghost',\n size: 'xs',\n})`\n ${({ theme: { colors, spaceMap } }) => css`\n color: ${colors.textSecondary};\n flex-shrink: 0;\n margin: 0 ${spaceMap.sm}px 0 -6px;\n border-radius: 50%;\n background: transparent !important;\n `}\n`\n"],"names":["ModalWindowSizesMap","sm","css","md","lg","ModalStyle","styled","div","theme","fontSizesMap","borderRadiusesMap","colors","boxShadows","$center","$size","xs","xl","xxl","shadowDark","ModalBaseStyle","text","foreground","ModalHeaderStyle","spaceMap","mediaQueries","$short","ModalTitleStyle","$withBackButton","$withCloseButton","$withTitleIcon","ModalTitleIconStyle","ModalTitleTextStyle","ModalSubtitleStyle","textSecondary","ModalContentStyle","ModalCloseStyle","ButtonIcon","attrs","icon","_jsx","color","variant","size","ModalBackStyle"],"mappings":";;;;;;;AAKO,MAAMA,mBAAmB,GAAG;AACjCC,EAAAA,EAAE,EAAEC,GAAI,CAAA;AACV;AACA,EAHmC,CAAA;AAIjCC,EAAAA,EAAE,EAAED,GAAI,CAAA;AACV;AACA,EANmC,CAAA;AAOjCE,EAAAA,EAAE,EAAEF,GAAI,CAAA;AACV;AACA,EAAA,CAAA;AATmC,EAA5B;AAYMG,MAAAA,UAAU,GAAGC,MAAM,CAACC,GAG9B,CAAA;AACH,EAAI,EAAA,IAAA,IAAA;EAAA,IAAC;AACDC,IAAAA,KAAK,EAAE;MAAEC,YAAF;MAAgBC,iBAAhB;MAAmCC,MAAnC;AAA2CC,MAAAA,UAAAA;KADjD;IAEDC,OAFC;AAGDC,IAAAA,KAAAA;GAHA,GAAA,IAAA,CAAA;AAAA,EAAA,OAIIZ,GAAI,CAAA;AACZ;AACA;AACA,eAAiBO,EAAAA,YAAY,CAACM,EAAG,CAAA;AACjC;AACA,gBAAA,EAAkBF,OAAO,GAAG,QAAH,GAAc,MAAO,CAAA;AAC9C,mBAAqBH,EAAAA,iBAAiB,CAACM,EAAG,CAAA;AAC1C,gBAAA,EAAkBJ,UAAU,CAACK,GAAI,CAAGN,CAAAA,EAAAA,MAAM,CAACO,UAAW,CAAA;AACtD;AACA,IAAMlB,EAAAA,mBAAmB,CAACc,KAAD,CAAQ,CAAA;AACjC,EAdI,CAAA,CAAA;AAAA,CAcA,CAAA;AACJ,EAnBO;AAqBMK,MAAAA,cAAc,GAA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A,QAAQ,CAACnB,EAAG,CAAA;AAChD;AACA,EANI,CAAA,CAAA;AAAA,CAMA,CAAA;AACJ,EARO;AAUA,MAAM+B,eAAe,GAAG7B,MAAM,CAAC8B,UAAD,CAAN,CAAmBC,KAAnB,CAAyB;EACtDC,IAAI,eAAEC,GAAC,CAAA,KAAD,EADgD,EAAA,CAAA;AAEtDC,EAAAA,KAAK,EAAE,WAF+C;AAGtDC,EAAAA,OAAO,EAAE,OAH6C;AAItDC,EAAAA,IAAI,EAAE,IAAA;AAJgD,CAAzB,CAK5B,CAAA;AACH;AACA;AACA;AACA;AACA,EAVO;AAYA,MAAMC,cAAc,GAAGrC,MAAM,CAAC8B,UAAD,CAAN,CAAmBC,KAAnB,CAAyB;EACrDC,IAAI,eAAEC,GAAC,CAAA,SAAD,EAD+C,EAAA,CAAA;AAErDC,EAAAA,KAAK,EAAE,WAF8C;AAGrDC,EAAAA,OAAO,EAAE,OAH4C;AAIrDC,EAAAA,IAAI,EAAE,IAAA;AAJ+C,CAAzB,CAK3B,CAAA;AACH,EAAI,EAAA,KAAA,IAAA;EAAA,IAAC;AAAElC,IAAAA,KAAK,EAAE;MAAEG,MAAF;AAAUY,MAAAA,QAAAA;AAAV,KAAA;GAAV,GAAA,KAAA,CAAA;AAAA,EAAA,OAAqCrB,GAAI,CAAA;AAC7C,WAAaS,EAAAA,MAAM,CAACsB,aAAc,CAAA;AAClC;AACA,cAAgBV,EAAAA,QAAQ,CAACtB,EAAG,CAAA;AAC5B;AACA;AACA,EANI,CAAA,CAAA;AAAA,CAMA,CAAA;AACJ;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
let ModalWindowSize = /*#__PURE__*/function (ModalWindowSize) {
|
|
2
|
+
ModalWindowSize[ModalWindowSize["sm"] = 0] = "sm";
|
|
3
|
+
ModalWindowSize[ModalWindowSize["md"] = 1] = "md";
|
|
4
|
+
ModalWindowSize[ModalWindowSize["lg"] = 2] = "lg";
|
|
5
|
+
return ModalWindowSize;
|
|
6
|
+
}({});
|
|
7
|
+
|
|
8
|
+
export { ModalWindowSize };
|
|
9
|
+
//# sourceMappingURL=types.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.mjs","sources":["../../../packages/modal/types.tsx"],"sourcesContent":["import { ReactElement, ReactNode } from 'react'\nimport { LidoComponentProps } from '../utils/index.js'\nimport {\n TransitionWrapperProps,\n TransitionInnerProps,\n} from '../transition/index.js'\nimport { ButtonProps } from '../button/index.js'\n\nexport type ModalOverlayOwnProps = LidoComponentProps<\n 'div',\n {\n onClose?: () => void\n onBack?: () => void\n }\n>\n\nexport type ModalOverlayProps = ModalOverlayOwnProps & TransitionWrapperProps\nexport type ModalOverlayInnerProps = ModalOverlayOwnProps & TransitionInnerProps\n\nexport type ModalProps = {\n title?: ReactNode\n titleIcon?: ReactNode\n subtitle?: ReactNode\n extra?: ReactNode\n center?: boolean\n open?: boolean\n windowSize?: ModalWindowSizes\n windowProps?: ModalWindowProps\n} & Omit<ModalOverlayProps, 'title' | 'in'>\n\nexport enum ModalWindowSize {\n sm,\n md,\n lg,\n}\nexport type ModalWindowSizes = keyof typeof ModalWindowSize\nexport type ModalWindowProps = LidoComponentProps<'div'>\n\nexport type ModalExtraProps = LidoComponentProps<'div'>\n\nexport type ModalButtonIconProps = {\n icon: ReactElement\n} & ButtonProps\n"],"names":["ModalWindowSize"],"mappings":"AA8BYA,IAAAA,eAAZ,0BAAYA,eAAZ,EAAA;AAAYA,EAAAA,eAAZ,CAAYA,eAAZ,CAAA,IAAA,CAAA,GAAA,CAAA,CAAA,GAAA,IAAA,CAAA;AAAYA,EAAAA,eAAZ,CAAYA,eAAZ,CAAA,IAAA,CAAA,GAAA,CAAA,CAAA,GAAA,IAAA,CAAA;AAAYA,EAAAA,eAAZ,CAAYA,eAAZ,CAAA,IAAA,CAAA,GAAA,CAAA,CAAA,GAAA,IAAA,CAAA;AAAA,EAAA,OAAYA,eAAZ,CAAA;AAAA,CAAA,CAAA,EAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartLine.d.ts","sourceRoot":"","sources":["../../../packages/chart-line/ChartLine.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ChartLine.d.ts","sourceRoot":"","sources":["../../../packages/chart-line/ChartLine.tsx"],"names":[],"mappings":";AAgBA,eAAO,MAAM,SAAS;;;uGAoFrB,CAAA"}
|
|
@@ -7,8 +7,9 @@ export declare const ChartLineLabel: import("react").ForwardRefExoticComponent<{
|
|
|
7
7
|
show?: boolean | undefined;
|
|
8
8
|
height: number;
|
|
9
9
|
thresholdType: ChartLineThresholdType;
|
|
10
|
+
containerId: string;
|
|
10
11
|
} & import("./types.js").LineData & Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
11
12
|
as?: keyof JSX.IntrinsicElements | undefined;
|
|
12
13
|
forwardedAs?: keyof JSX.IntrinsicElements | undefined;
|
|
13
|
-
}, "ref" | "height" | "id" | "zIndex" | "show" | "thresholdType" | "previousIds" | keyof import("./types.js").LineData> & import("react").RefAttributes<HTMLDivElement>>;
|
|
14
|
+
}, "ref" | "height" | "id" | "zIndex" | "show" | "containerId" | "thresholdType" | "previousIds" | keyof import("./types.js").LineData> & import("react").RefAttributes<HTMLDivElement>>;
|
|
14
15
|
//# sourceMappingURL=ChartLineLabel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartLineLabel.d.ts","sourceRoot":"","sources":["../../../packages/chart-line/ChartLineLabel.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAuB,sBAAsB,EAAE,MAAM,YAAY,CAAA;AAIxE,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"ChartLineLabel.d.ts","sourceRoot":"","sources":["../../../packages/chart-line/ChartLineLabel.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAuB,sBAAsB,EAAE,MAAM,YAAY,CAAA;AA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,kBAAkB,CAAC,KAAK,EAAE,eAAe,CAAC,CAAA;AAEvE,oBAAY,mBAAmB,GAAG,kBAAkB,CAClD,KAAK,EACL;IACE,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,sBAAsB,CAAA;IACrC,WAAW,EAAE,MAAM,CAAA;CACpB,GAAG,QAAQ,CACb,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const VIEWPORT_MARGIN = 8;
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const CHART_LINE_LABEL_ID = "chart-line-label";
|
|
3
3
|
export declare const LABEL_HEIGHT_INCREASE = 36;
|
|
4
4
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../packages/chart-line/utils/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,IAAI,CAAA;AAChC,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../packages/chart-line/utils/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,IAAI,CAAA;AAChC,eAAO,MAAM,mBAAmB,qBAAqB,CAAA;AACrD,eAAO,MAAM,qBAAqB,KAAK,CAAA"}
|
|
@@ -2,6 +2,7 @@ declare type HandlePositioningProps = {
|
|
|
2
2
|
previousIds?: string[];
|
|
3
3
|
id: string;
|
|
4
4
|
reset?: boolean;
|
|
5
|
+
containerId: string;
|
|
5
6
|
};
|
|
6
7
|
export declare const resetThresholdHeight: (threshold: HTMLElement | null) => void;
|
|
7
8
|
export declare const handlePositioning: (props: HandlePositioningProps) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlePositioning.d.ts","sourceRoot":"","sources":["../../../../packages/chart-line/utils/handlePositioning.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handlePositioning.d.ts","sourceRoot":"","sources":["../../../../packages/chart-line/utils/handlePositioning.ts"],"names":[],"mappings":"AAGA,aAAK,sBAAsB,GAAG;IAC5B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AA8FD,eAAO,MAAM,oBAAoB,cAAe,WAAW,GAAG,IAAI,KAAG,IAIpE,CAAA;AAgDD,eAAO,MAAM,iBAAiB,UAAW,sBAAsB,KAAG,IA2EjE,CAAA"}
|
|
@@ -8,6 +8,6 @@ declare type ProcessedData = {
|
|
|
8
8
|
data: ProcessedLineData[];
|
|
9
9
|
ids: string[];
|
|
10
10
|
};
|
|
11
|
-
export declare const processData: (data: LineData[], maxValue?: number) => ProcessedData;
|
|
11
|
+
export declare const processData: (data: LineData[], containerId: string, maxValue?: number) => ProcessedData;
|
|
12
12
|
export {};
|
|
13
13
|
//# sourceMappingURL=processData.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processData.d.ts","sourceRoot":"","sources":["../../../../packages/chart-line/utils/processData.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"processData.d.ts","sourceRoot":"","sources":["../../../../packages/chart-line/utils/processData.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,aAAK,iBAAiB,GAAG,QAAQ,GAAG;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,aAAK,aAAa,GAAG;IACnB,IAAI,EAAE,iBAAiB,EAAE,CAAA;IACzB,GAAG,EAAE,MAAM,EAAE,CAAA;CACd,CAAA;AAED,eAAO,MAAM,WAAW,SAChB,QAAQ,EAAE,eACH,MAAM,aACR,MAAM,KAChB,aA2BF,CAAA"}
|
|
@@ -6,5 +6,10 @@ export declare const Modal: import("react").ForwardRefExoticComponent<{
|
|
|
6
6
|
extra?: import("react").ReactNode;
|
|
7
7
|
center?: boolean | undefined;
|
|
8
8
|
open?: boolean | undefined;
|
|
9
|
+
windowSize?: "sm" | "md" | "lg" | undefined;
|
|
10
|
+
windowProps?: Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
11
|
+
as?: keyof JSX.IntrinsicElements | undefined;
|
|
12
|
+
forwardedAs?: keyof JSX.IntrinsicElements | undefined;
|
|
13
|
+
}, "ref"> | undefined;
|
|
9
14
|
} & Omit<import("./types.js").ModalOverlayProps, "title" | "in"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
10
15
|
//# sourceMappingURL=Modal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../packages/modal/Modal.tsx"],"names":[],"mappings":";AAgBA,eAAO,MAAM,KAAK
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../packages/modal/Modal.tsx"],"names":[],"mappings":";AAgBA,eAAO,MAAM,KAAK;;;;;;;;;;;;iHAgEjB,CAAA"}
|