@scality/core-ui 0.161.0 → 0.163.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/README.md +15 -15
- package/dist/components/accordion/Accordion.component.d.ts +0 -1
- package/dist/components/accordion/Accordion.component.d.ts.map +1 -1
- package/dist/components/barchartv2/Barchart.component.d.ts +53 -0
- package/dist/components/barchartv2/Barchart.component.d.ts.map +1 -0
- package/dist/components/barchartv2/Barchart.component.js +86 -0
- package/dist/components/barchartv2/utils.d.ts +118 -0
- package/dist/components/barchartv2/utils.d.ts.map +1 -0
- package/dist/components/barchartv2/utils.js +337 -0
- package/dist/components/buttonv2/Buttonv2.component.d.ts +1 -1
- package/dist/components/buttonv2/Buttonv2.component.d.ts.map +1 -1
- package/dist/components/chartlegend/ChartLegend.d.ts +8 -0
- package/dist/components/chartlegend/ChartLegend.d.ts.map +1 -0
- package/dist/components/chartlegend/ChartLegend.js +65 -0
- package/dist/components/chartlegend/ChartLegendWrapper.d.ts +17 -0
- package/dist/components/chartlegend/ChartLegendWrapper.d.ts.map +1 -0
- package/dist/components/chartlegend/ChartLegendWrapper.js +50 -0
- package/dist/components/constrainedtext/Constrainedtext.component.d.ts +2 -1
- package/dist/components/constrainedtext/Constrainedtext.component.d.ts.map +1 -1
- package/dist/components/constrainedtext/Constrainedtext.component.js +5 -4
- package/dist/components/coreuithemeprovider/CoreUiThemeProvider.d.ts +0 -1
- package/dist/components/coreuithemeprovider/CoreUiThemeProvider.d.ts.map +1 -1
- package/dist/components/date/FormattedDateTime.d.ts +4 -1
- package/dist/components/date/FormattedDateTime.d.ts.map +1 -1
- package/dist/components/date/FormattedDateTime.js +24 -1
- package/dist/components/date/FormattedDateTime.spec.js +12 -0
- package/dist/components/emptytable/Emptytable.component.d.ts +0 -1
- package/dist/components/emptytable/Emptytable.component.d.ts.map +1 -1
- package/dist/components/emptytable/Emptytable.component.js +1 -0
- package/dist/components/error-pages/ErrorPage401.component.d.ts +0 -1
- package/dist/components/error-pages/ErrorPage401.component.d.ts.map +1 -1
- package/dist/components/error-pages/ErrorPage404.component.d.ts +0 -1
- package/dist/components/error-pages/ErrorPage404.component.d.ts.map +1 -1
- package/dist/components/error-pages/ErrorPage500.component.d.ts +0 -1
- package/dist/components/error-pages/ErrorPage500.component.d.ts.map +1 -1
- package/dist/components/error-pages/ErrorPageAuth.component.d.ts.map +1 -1
- package/dist/components/form/Form.component.d.ts +2 -2
- package/dist/components/form/Form.component.d.ts.map +1 -1
- package/dist/components/icon/Icon.component.d.ts +5 -5
- package/dist/components/icon/Icon.component.d.ts.map +1 -1
- package/dist/components/icon/Icon.component.js +33 -31
- package/dist/components/infomessage/InfoMessage.component.d.ts +0 -1
- package/dist/components/infomessage/InfoMessage.component.d.ts.map +1 -1
- package/dist/components/lateralnavbarlayout/LateralNavbarLayout.component.d.ts.map +1 -1
- package/dist/components/layout/Layout.component.d.ts.map +1 -1
- package/dist/components/layout/v2/panels.d.ts.map +1 -1
- package/dist/components/linetimeseriechart/linetimeseriechart.component.d.ts +33 -0
- package/dist/components/linetimeseriechart/linetimeseriechart.component.d.ts.map +1 -0
- package/dist/components/linetimeseriechart/linetimeseriechart.component.js +249 -0
- package/dist/components/modal/Modal.component.js +2 -2
- package/dist/components/navbar/Navbar.component.js +2 -2
- package/dist/components/scrollbarwrapper/ScrollbarWrapper.component.d.ts +0 -1
- package/dist/components/scrollbarwrapper/ScrollbarWrapper.component.d.ts.map +1 -1
- package/dist/components/searchinput/SearchInput.component.d.ts +1 -2
- package/dist/components/searchinput/SearchInput.component.d.ts.map +1 -1
- package/dist/components/selectv2/Selectv2.component.d.ts +5 -5
- package/dist/components/selectv2/Selectv2.component.d.ts.map +1 -1
- package/dist/components/selectv2/Selectv2.component.js +11 -6
- package/dist/components/statuswrapper/Statuswrapper.component.d.ts +0 -1
- package/dist/components/statuswrapper/Statuswrapper.component.d.ts.map +1 -1
- package/dist/components/steppers/Stepper.component.d.ts.map +1 -1
- package/dist/components/steppers/Stepper.component.js +9 -8
- package/dist/components/tablev2/Search.js +2 -2
- package/dist/components/tablev2/SingleSelectableContent.d.ts +1 -2
- package/dist/components/tablev2/SingleSelectableContent.d.ts.map +1 -1
- package/dist/components/tablev2/TableCommon.d.ts +2 -2
- package/dist/components/tablev2/TableCommon.d.ts.map +1 -1
- package/dist/components/tablev2/TableSync.d.ts +8 -0
- package/dist/components/tablev2/TableSync.d.ts.map +1 -0
- package/dist/components/tablev2/TableSync.js +11 -0
- package/dist/components/tablev2/Tablev2.component.d.ts +2 -1
- package/dist/components/tablev2/Tablev2.component.d.ts.map +1 -1
- package/dist/components/tablev2/Tablev2.component.js +10 -9
- package/dist/components/tabsv2/ScrollButton.d.ts +1 -2
- package/dist/components/tabsv2/ScrollButton.d.ts.map +1 -1
- package/dist/components/tabsv2/ScrollButton.js +2 -2
- package/dist/components/tabsv2/Tabsv2.component.d.ts +2 -2
- package/dist/components/tabsv2/Tabsv2.component.d.ts.map +1 -1
- package/dist/components/tabsv2/Tabsv2.component.js +2 -2
- package/dist/components/text/Text.component.d.ts +0 -1
- package/dist/components/text/Text.component.d.ts.map +1 -1
- package/dist/components/textarea/TextArea.component.d.ts +3 -3
- package/dist/components/textarea/TextArea.component.d.ts.map +1 -1
- package/dist/components/textbadge/TextBadge.component.d.ts +0 -1
- package/dist/components/textbadge/TextBadge.component.d.ts.map +1 -1
- package/dist/components/toast/Toast.component.d.ts +1 -1
- package/dist/components/toast/Toast.component.d.ts.map +1 -1
- package/dist/components/toast/ToastProvider.d.ts.map +1 -1
- package/dist/components/toast/ToastProvider.js +4 -5
- package/dist/components/vegachartv2/SyncedCursorCharts.d.ts +1 -2
- package/dist/components/vegachartv2/SyncedCursorCharts.d.ts.map +1 -1
- package/dist/components/vegachartv2/SyncedCursorCharts.js +3 -5
- package/dist/components/vegachartv2/VegaChartV2.component.d.ts +1 -2
- package/dist/components/vegachartv2/VegaChartV2.component.d.ts.map +1 -1
- package/dist/components/vegachartv2/VegaChartV2.component.js +2 -2
- package/dist/icons/branding.d.ts.map +1 -1
- package/dist/icons/scality-loading.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/next.d.ts +2 -0
- package/dist/next.d.ts.map +1 -1
- package/dist/next.js +2 -0
- package/dist/style/theme.d.ts +20 -0
- package/dist/style/theme.d.ts.map +1 -1
- package/dist/style/theme.js +46 -1
- package/package.json +7 -4
- package/setupTests.js +6 -0
- package/src/lib/components/accordion/Accordion.component.tsx +1 -1
- package/src/lib/components/accordion/Accordion.test.tsx +7 -15
- package/src/lib/components/barchartv2/Barchart.component.test.tsx +364 -0
- package/src/lib/components/barchartv2/Barchart.component.tsx +321 -0
- package/src/lib/components/barchartv2/utils.test.ts +899 -0
- package/src/lib/components/barchartv2/utils.ts +534 -0
- package/src/lib/components/buttonv2/Buttonv2.component.tsx +1 -1
- package/src/lib/components/chartlegend/ChartLegend.tsx +113 -0
- package/src/lib/components/chartlegend/ChartLegendWrapper.tsx +85 -0
- package/src/lib/components/constrainedtext/Constrainedtext.component.tsx +22 -3
- package/src/lib/components/coreuithemeprovider/CoreUiThemeProvider.tsx +0 -1
- package/src/lib/components/date/FormattedDateTime.spec.tsx +24 -0
- package/src/lib/components/date/FormattedDateTime.tsx +42 -2
- package/src/lib/components/emptytable/Emptytable.component.tsx +1 -1
- package/src/lib/components/error-pages/ErrorPage401.component.tsx +0 -1
- package/src/lib/components/error-pages/ErrorPage404.component.tsx +0 -1
- package/src/lib/components/error-pages/ErrorPage500.component.tsx +0 -1
- package/src/lib/components/error-pages/ErrorPageAuth.component.tsx +0 -1
- package/src/lib/components/form/Form.component.tsx +1 -1
- package/src/lib/components/healthselectorv2/HealthSelector.component.test.tsx +3 -3
- package/src/lib/components/icon/Icon.component.tsx +48 -60
- package/src/lib/components/infomessage/InfoMessage.component.tsx +0 -1
- package/src/lib/components/inlineinput/InlineInput.test.tsx +22 -19
- package/src/lib/components/inputlist/InputList.test.tsx +21 -19
- package/src/lib/components/lateralnavbarlayout/LateralNavbarLayout.component.tsx +0 -1
- package/src/lib/components/layout/Layout.component.tsx +0 -1
- package/src/lib/components/layout/v2/panels.tsx +1 -1
- package/src/lib/components/linetimeseriechart/linetimeseriechart.component.tsx +502 -0
- package/src/lib/components/modal/Modal.component.tsx +2 -2
- package/src/lib/components/navbar/Navbar.component.tsx +2 -2
- package/src/lib/components/scrollbarwrapper/ScrollbarWrapper.component.tsx +0 -1
- package/src/lib/components/searchinput/SearchInput.component.tsx +0 -1
- package/src/lib/components/searchinput/SearchInput.test.tsx +3 -7
- package/src/lib/components/selectv2/Selectv2.component.tsx +24 -14
- package/src/lib/components/selectv2/selectv2.test.tsx +62 -57
- package/src/lib/components/sidebar/Sidebar.component.tsx +1 -1
- package/src/lib/components/statuswrapper/Statuswrapper.component.tsx +0 -1
- package/src/lib/components/steppers/Stepper.component.tsx +10 -8
- package/src/lib/components/tablev2/Search.tsx +2 -2
- package/src/lib/components/tablev2/SingleSelectableContent.tsx +2 -2
- package/src/lib/components/tablev2/TableCommon.tsx +1 -1
- package/src/lib/components/tablev2/TableSync.test.tsx +28 -0
- package/src/lib/components/tablev2/TableSync.tsx +36 -0
- package/src/lib/components/tablev2/Tablev2.component.tsx +11 -9
- package/src/lib/components/tablev2/Tablev2.test.tsx +36 -37
- package/src/lib/components/tabsv2/ScrollButton.tsx +2 -2
- package/src/lib/components/tabsv2/Tabsv2.component.tsx +6 -6
- package/src/lib/components/text/Text.component.tsx +4 -5
- package/src/lib/components/textarea/TextArea.component.tsx +3 -2
- package/src/lib/components/textbadge/TextBadge.component.tsx +0 -1
- package/src/lib/components/toast/Toast.component.tsx +1 -1
- package/src/lib/components/toast/ToastProvider.tsx +17 -7
- package/src/lib/components/vegachartv2/SyncedCursorCharts.tsx +5 -7
- package/src/lib/components/vegachartv2/VegaChartV2.component.tsx +2 -2
- package/src/lib/icons/branding.tsx +0 -2
- package/src/lib/icons/scality-loading.tsx +0 -2
- package/src/lib/index.ts +1 -0
- package/src/lib/next.ts +6 -0
- package/src/lib/style/theme.ts +53 -1
- package/stories/BarChart/barchart.stories.tsx +822 -0
- package/stories/areachart.stories.tsx +0 -1
- package/stories/format.mdx +4 -2
- package/stories/linetimeseriechart.stories.tsx +485 -0
- package/stories/tablev2.stories.tsx +41 -0
- package/tsconfig.json +5 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorPage401.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/error-pages/ErrorPage401.component.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ErrorPage401.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/error-pages/ErrorPage401.component.tsx"],"names":[],"mappings":"AA0BA,KAAK,KAAK,GAAG;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CAC1E,CAAC;AAEF,iBAAS,YAAY,CAAC,EACpB,WAAuB,EACvB,MAAa,EACb,iBAAiB,EACjB,GAAG,IAAI,EACR,EAAE,KAAK,2CAoCP;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorPage404.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/error-pages/ErrorPage404.component.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ErrorPage404.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/error-pages/ErrorPage404.component.tsx"],"names":[],"mappings":"AA0BA,KAAK,KAAK,GAAG;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CAC1E,CAAC;AAEF,iBAAS,YAAY,CAAC,EAAE,MAAa,EAAE,iBAAiB,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,2CA6BzE;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorPage500.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/error-pages/ErrorPage500.component.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ErrorPage500.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/error-pages/ErrorPage500.component.tsx"],"names":[],"mappings":"AA+BA,KAAK,KAAK,GAAG;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACzE,YAAY,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3C,CAAC;AAEF,iBAAS,YAAY,CAAC,EACpB,WAAuB,EACvB,MAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,GAAG,IAAI,EACR,EAAE,KAAK,2CAwCP;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorPageAuth.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/error-pages/ErrorPageAuth.component.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ErrorPageAuth.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/error-pages/ErrorPageAuth.component.tsx"],"names":[],"mappings":"AA0BA,KAAK,KAAK,GAAG;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,iBAAS,aAAa,CAAC,EACrB,WAAuB,EACvB,MAAa,EACb,GAAG,IAAI,EACR,EAAE,KAAK,2CA+BP;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FormHTMLAttributes, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { IconName } from '../icon/Icon.component';
|
|
3
3
|
declare const DESCRIPTION_PREFIX = "describe-";
|
|
4
4
|
declare const LABEL_PREFIX = "label-";
|
|
@@ -50,7 +50,7 @@ type FormSectionProps = {
|
|
|
50
50
|
rightActions?: ReactNode;
|
|
51
51
|
};
|
|
52
52
|
declare const FormSection: ({ children, title, forceLabelWidth, rightActions, }: FormSectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
53
|
-
declare const Form:
|
|
53
|
+
declare const Form: import("react").ForwardRefExoticComponent<(PageFormProps | TabFormProps) & import("react").RefAttributes<HTMLFormElement>>;
|
|
54
54
|
declare const useFieldContext: () => {
|
|
55
55
|
isContextAvailable: boolean;
|
|
56
56
|
error?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/form/Form.component.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Form.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/form/Form.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,EAGlB,YAAY,EACZ,SAAS,EAKV,MAAM,OAAO,CAAC;AAKf,OAAO,EAAQ,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAKxD,QAAA,MAAM,kBAAkB,cAAc,CAAC;AACvC,QAAA,MAAM,YAAY,WAAW,CAAC;AAG9B,KAAK,SAAS,GAAG,IAAI,CACnB,kBAAkB,CAAC,eAAe,CAAC,EACnC,YAAY,GAAG,gBAAgB,CAChC,GAAG;IACF,QAAQ,EAAE,SAAS,GAAG,SAAS,EAAE,CAAC;IAClC,WAAW,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IAChC,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,QAAQ,CAAC;KACjB,CAAC;CACH,GAAG,SAAS,CAAC;AACd,KAAK,YAAY,GAAG;IAAE,MAAM,EAAE;QAAE,IAAI,EAAE,KAAK,CAAA;KAAE,CAAA;CAAE,GAAG,SAAS,CAAC;AAyD5D,KAAK,YAAY,GAAG;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;IACpC,SAAS,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IACtC,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,QAAA,MAAM,SAAS,6GAWZ,cAAc,4CAsGhB,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACtB,QAAQ,EAAE,YAAY,CAAC,cAAc,CAAC,GAAG,YAAY,CAAC,cAAc,CAAC,EAAE,CAAC;IACxE,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,QAAQ,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAChE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B,CAAC;AAEF,QAAA,MAAM,WAAW,wDAKd,gBAAgB,4CAmClB,CAAC;AAgGF,QAAA,MAAM,IAAI,4HAYT,CAAC;AASF,QAAA,MAAM,eAAe;;YANX,MAAM;eACH,OAAO;eACP,OAAO;CAWnB,CAAC;AAEF,OAAO,EACL,IAAI,EACJ,WAAW,EACX,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,YAAY,GACb,CAAC"}
|
|
@@ -128,13 +128,13 @@ export declare const iconTable: {
|
|
|
128
128
|
Mail: string;
|
|
129
129
|
};
|
|
130
130
|
export declare const customIcons: {
|
|
131
|
-
'Remote-user': ({ ariaLabel, color, size }: {
|
|
132
|
-
|
|
131
|
+
'Remote-user': ({ "aria-label": ariaLabel, color, size }: {
|
|
132
|
+
"aria-label": any;
|
|
133
133
|
color: any;
|
|
134
134
|
size: any;
|
|
135
135
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
136
|
-
'Remote-group': ({ ariaLabel, color, size }: {
|
|
137
|
-
|
|
136
|
+
'Remote-group': ({ "aria-label": ariaLabel, color, size }: {
|
|
137
|
+
"aria-label": any;
|
|
138
138
|
color: any;
|
|
139
139
|
size: any;
|
|
140
140
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -148,7 +148,7 @@ type Props = {
|
|
|
148
148
|
ariaLabel?: string;
|
|
149
149
|
withWrapper?: boolean;
|
|
150
150
|
style?: CSSProperties;
|
|
151
|
-
onClick?: (event: MouseEvent) => void;
|
|
151
|
+
onClick?: (event: React.MouseEvent) => void;
|
|
152
152
|
title?: string;
|
|
153
153
|
};
|
|
154
154
|
export declare const IconWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/icon/Icon.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAE7D,OAAO,EACL,aAAa,EAKd,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Icon.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/icon/Icon.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAE7D,OAAO,EACL,aAAa,EAKd,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAOhD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6HrB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;CAOvB,CAAC;AAaF,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,SAAS,GAAG,MAAM,OAAO,WAAW,CAAC;AACzE,MAAM,MAAM,SAAS,GAAG,MAAM,WAAW,CAAC;AAC1C,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,KAAK,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAiBF,eAAO,MAAM,WAAW;UAAsB,QAAQ;SAiCrD,CAAC;AA2DF,iBAAS,IAAI,CAAC,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,2CAU7C;AAED,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
3
3
|
import { useEffect, useState, } from 'react';
|
|
4
|
-
import { useQuery } from 'react-query';
|
|
5
4
|
import styled, { css } from 'styled-components';
|
|
6
5
|
import { Loader } from '../loader/Loader.component';
|
|
7
6
|
import { RemoteGroup, RemoteUser } from './CustomsIcons';
|
|
7
|
+
// Module-level cache for imported icons
|
|
8
|
+
const iconCache = {};
|
|
8
9
|
export const iconTable = {
|
|
9
10
|
Account: 'fas faWallet',
|
|
10
11
|
Backend: 'fas faNetworkWired',
|
|
@@ -132,8 +133,8 @@ export const iconTable = {
|
|
|
132
133
|
Mail: 'fas faEnvelope',
|
|
133
134
|
};
|
|
134
135
|
export const customIcons = {
|
|
135
|
-
'Remote-user': ({ ariaLabel, color, size }) => (_jsx(RemoteUser, { ariaLabel: ariaLabel, color: color, size: size })),
|
|
136
|
-
'Remote-group': ({ ariaLabel, color, size }) => (_jsx(RemoteGroup, { ariaLabel: ariaLabel, color: color, size: size })),
|
|
136
|
+
'Remote-user': ({ 'aria-label': ariaLabel, color, size }) => (_jsx(RemoteUser, { ariaLabel: ariaLabel, color: color, size: size })),
|
|
137
|
+
'Remote-group': ({ 'aria-label': ariaLabel, color, size }) => (_jsx(RemoteGroup, { ariaLabel: ariaLabel, color: color, size: size })),
|
|
137
138
|
};
|
|
138
139
|
const IconStyled = styled(FontAwesomeIcon) `
|
|
139
140
|
${(props) => {
|
|
@@ -189,36 +190,37 @@ export const IconWrapper = styled.div `
|
|
|
189
190
|
align-items: center;
|
|
190
191
|
border-radius: 100%;
|
|
191
192
|
`;
|
|
192
|
-
function NonWrappedIcon({ name, size = '1x', color
|
|
193
|
+
function NonWrappedIcon({ name, size = '1x', color, ariaLabel = '', title, ...rest }) {
|
|
194
|
+
var _a;
|
|
193
195
|
const iconInfo = iconTable[name] || customIcons[name];
|
|
194
196
|
if (!iconInfo)
|
|
195
197
|
throw new Error(`${name}: is not a valid icon.`);
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
return (
|
|
198
|
+
// Loaded fortawesome icon if not a custom icon
|
|
199
|
+
const [icon, setIcon] = useState();
|
|
200
|
+
useEffect(() => {
|
|
201
|
+
if (customIcons[name]) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
const [iconType, iconClass] = iconInfo.split(' ');
|
|
205
|
+
const fontAwesomeType = iconType === 'far' ? 'free-regular-svg-icons' : 'free-solid-svg-icons';
|
|
206
|
+
const cacheKey = `${fontAwesomeType}/${iconClass}`;
|
|
207
|
+
if (iconCache[cacheKey]) {
|
|
208
|
+
setIcon(iconCache[cacheKey]);
|
|
209
|
+
return () => setIcon(undefined);
|
|
210
|
+
}
|
|
211
|
+
// Handle FontAwesome icons with dynamic import
|
|
212
|
+
import(`@fortawesome/${fontAwesomeType}/${iconClass}.js`)
|
|
213
|
+
.then((module) => {
|
|
214
|
+
setIcon(module[iconClass]);
|
|
215
|
+
iconCache[cacheKey] = module[iconClass];
|
|
216
|
+
});
|
|
217
|
+
return () => setIcon(undefined);
|
|
218
|
+
}, [name, iconInfo]);
|
|
219
|
+
if (!icon && !customIcons[name]) {
|
|
220
|
+
return (_jsx(DelayedFallback, { "aria-label": `${name} ${ariaLabel}`, children: _jsx(Loader, { size: "base" }) }));
|
|
221
|
+
}
|
|
222
|
+
const IconComponent = (_a = customIcons[name]) !== null && _a !== void 0 ? _a : IconStyled;
|
|
223
|
+
return (_jsx(IconComponent, { color: color, icon: icon, size: size, title: title, "aria-label": `${name} ${ariaLabel}`, ...rest }));
|
|
222
224
|
}
|
|
223
225
|
function Icon({ withWrapper, ...props }) {
|
|
224
226
|
if (withWrapper) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoMessage.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/infomessage/InfoMessage.component.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InfoMessage.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/infomessage/InfoMessage.component.tsx"],"names":[],"mappings":"AAMA,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAChC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAYF,eAAO,MAAM,WAAW,6BAA8B,KAAK,4CAuB1D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LateralNavbarLayout.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/lateralnavbarlayout/LateralNavbarLayout.component.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LateralNavbarLayout.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/lateralnavbarlayout/LateralNavbarLayout.component.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAGrE,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC;CACvB,CAAC;AAiBF,iBAAS,mBAAmB,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,2CASjE;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/layout/Layout.component.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Layout.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/layout/Layout.component.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAGrE,KAAK,KAAK,GAAG;IACX,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,aAAa,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAC5B,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC;CACvB,CAAC;AAgBF,iBAAS,MAAM,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,2CAc3E;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panels.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/v2/panels.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"panels.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/v2/panels.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAwDnD,KAAK,WAAW,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAgB/C,eAAO,MAAM,cAAc,2DAMxB;IACD,WAAW,EAAE,WAAW,CAAC;IACzB,SAAS,EAAE;QAAE,QAAQ,EAAE,YAAY,CAAC;QAAC,UAAU,CAAC,EAAE,WAAW,CAAA;KAAE,CAAC;IAChE,UAAU,EAAE;QAAE,QAAQ,EAAE,YAAY,CAAC;QAAC,UAAU,CAAC,EAAE,WAAW,CAAA;KAAE,CAAC;IACjE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,4CAmBA,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export type Serie = {
|
|
2
|
+
resource: string;
|
|
3
|
+
data: [number, string | null][];
|
|
4
|
+
getTooltipLabel: (metricPrefix?: string, resource?: string) => string;
|
|
5
|
+
metricPrefix?: string;
|
|
6
|
+
isLineDashed?: boolean;
|
|
7
|
+
};
|
|
8
|
+
type NonSymmetricalChartSerie = {
|
|
9
|
+
yAxisType?: 'default' | 'percentage';
|
|
10
|
+
series: Serie[];
|
|
11
|
+
};
|
|
12
|
+
type SymmetricalChartSerie = {
|
|
13
|
+
yAxisType: 'symmetrical';
|
|
14
|
+
series: {
|
|
15
|
+
above: Serie[];
|
|
16
|
+
below: Serie[];
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export type LineChartProps = (NonSymmetricalChartSerie | SymmetricalChartSerie) & {
|
|
20
|
+
title: string;
|
|
21
|
+
height: number;
|
|
22
|
+
startingTimeStamp: number;
|
|
23
|
+
unitRange?: {
|
|
24
|
+
threshold: number;
|
|
25
|
+
label: string;
|
|
26
|
+
}[];
|
|
27
|
+
isLoading?: boolean;
|
|
28
|
+
yAxisTitle?: string;
|
|
29
|
+
helpText?: string;
|
|
30
|
+
};
|
|
31
|
+
export declare function LineTimeSerieChart({ series, title, height, startingTimeStamp, unitRange, isLoading, yAxisType, yAxisTitle, helpText, ...rest }: LineChartProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=linetimeseriechart.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linetimeseriechart.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/linetimeseriechart/linetimeseriechart.component.tsx"],"names":[],"mappings":"AA2FA,MAAM,MAAM,KAAK,GAAG;IAElB,QAAQ,EAAE,MAAM,CAAC;IAEjB,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAEhC,eAAe,EAAE,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAEtE,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC9B,SAAS,CAAC,EAAE,SAAS,GAAG,YAAY,CAAC;IACrC,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB,CAAC;AAGF,KAAK,qBAAqB,GAAG;IAC3B,SAAS,EAAE,aAAa,CAAC;IACzB,MAAM,EAAE;QACN,KAAK,EAAE,KAAK,EAAE,CAAC;QACf,KAAK,EAAE,KAAK,EAAE,CAAC;KAChB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,CACzB,wBAAwB,GACxB,qBAAqB,CACxB,GAAG;IACF,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE;QACV,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IACJ,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAiEF,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,KAAK,EACL,MAAM,EACN,iBAAiB,EACjB,SAAS,EACT,SAAiB,EACjB,SAAqB,EACrB,UAAU,EACV,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,cAAc,2CAqShB"}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Line, LineChart, ReferenceLine, ResponsiveContainer, Tooltip, XAxis, YAxis, CartesianGrid, } from 'recharts';
|
|
3
|
+
import { useMemo, useRef } from 'react';
|
|
4
|
+
import { useTheme } from 'styled-components';
|
|
5
|
+
import { useMetricsTimeSpan } from '../linetemporalchart/MetricTimespanProvider';
|
|
6
|
+
import { addMissingDataPoint } from '../linetemporalchart/ChartUtil';
|
|
7
|
+
import styled from 'styled-components';
|
|
8
|
+
import { fontSize, fontWeight } from '../../style/theme';
|
|
9
|
+
import { useChartLegend } from '../chartlegend/ChartLegendWrapper';
|
|
10
|
+
import { ChartTitleText, SmallerText } from '../text/Text.component';
|
|
11
|
+
import { Loader } from '../loader/Loader.component';
|
|
12
|
+
import { spacing } from '../../spacing';
|
|
13
|
+
import { getUnitLabel } from '../linetemporalchart/ChartUtil';
|
|
14
|
+
import { Icon } from '../icon/Icon.component';
|
|
15
|
+
import { Tooltip as TooltipComponent } from '../tooltip/Tooltip.component';
|
|
16
|
+
import { DAY_MONTH_ABBREVIATED_HOUR_MINUTE, FormattedDateTime, } from '../date/FormattedDateTime';
|
|
17
|
+
const LineTemporalChartWrapper = styled.div `
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
justify-content: flex-start;
|
|
21
|
+
flex: 1;
|
|
22
|
+
`;
|
|
23
|
+
const ChartHeader = styled.div `
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
`;
|
|
27
|
+
const TooltipContainer = styled.div `
|
|
28
|
+
background-color: ${(props) => props.theme.backgroundLevel1};
|
|
29
|
+
padding: ${spacing.r8};
|
|
30
|
+
border: 1px solid ${(props) => props.theme.border};
|
|
31
|
+
border-radius: 4px;
|
|
32
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
33
|
+
max-width: 250px;
|
|
34
|
+
`;
|
|
35
|
+
const TooltipTime = styled.div `
|
|
36
|
+
margin-bottom: ${spacing.r8};
|
|
37
|
+
color: ${(props) => props.theme.textPrimary};
|
|
38
|
+
font-size: ${fontSize.smaller};
|
|
39
|
+
font-weight: ${fontWeight.bold};
|
|
40
|
+
text-align: center;
|
|
41
|
+
`;
|
|
42
|
+
const TooltipValue = styled.div `
|
|
43
|
+
font-size: ${fontSize.smaller};
|
|
44
|
+
margin-top: 4px;
|
|
45
|
+
color: ${(props) => props.theme.textSecondary};
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: flex-start;
|
|
48
|
+
`;
|
|
49
|
+
const TooltipLegend = styled.div `
|
|
50
|
+
width: 12px;
|
|
51
|
+
height: 3px;
|
|
52
|
+
background-color: ${(props) => props.color};
|
|
53
|
+
margin-right: 8px;
|
|
54
|
+
flex-shrink: 0;
|
|
55
|
+
margin-top: 8px;
|
|
56
|
+
`;
|
|
57
|
+
const TooltipContent = styled.div `
|
|
58
|
+
display: flex;
|
|
59
|
+
min-width: 0;
|
|
60
|
+
flex: 1;
|
|
61
|
+
`;
|
|
62
|
+
const TooltipName = styled.div `
|
|
63
|
+
margin-right: 4px;
|
|
64
|
+
word-wrap: break-word;
|
|
65
|
+
word-break: break-word;
|
|
66
|
+
justify-content: flex-start;
|
|
67
|
+
`;
|
|
68
|
+
const TooltipInstanceValue = styled.div `
|
|
69
|
+
justify-content: flex-end;
|
|
70
|
+
`;
|
|
71
|
+
const CustomTooltip = ({ active, payload, label, unitLabel, }) => {
|
|
72
|
+
if (!active || !payload || !payload.length || !label)
|
|
73
|
+
return null;
|
|
74
|
+
// We can't use the default itemSorter method because it's a custom tooltip.
|
|
75
|
+
// Sort the payload here instead
|
|
76
|
+
const sortedPayload = [...payload].sort((a, b) => {
|
|
77
|
+
const aValue = Number(a.value);
|
|
78
|
+
const bValue = Number(b.value);
|
|
79
|
+
if (aValue >= 0 && bValue >= 0) {
|
|
80
|
+
return bValue - aValue; // Higher positive values first
|
|
81
|
+
}
|
|
82
|
+
if (aValue < 0 && bValue < 0) {
|
|
83
|
+
return bValue - aValue; // Lower negative values first
|
|
84
|
+
}
|
|
85
|
+
return bValue - aValue; // Positives before negatives
|
|
86
|
+
});
|
|
87
|
+
return (_jsxs(TooltipContainer, { children: [_jsx(TooltipTime, { children: _jsx(FormattedDateTime, { format: "day-month-abbreviated-hour-minute-second", value: new Date(label) }) }), sortedPayload.map((entry, index) => (_jsxs(TooltipValue, { children: [_jsx(TooltipLegend, { color: entry.color }), _jsxs(TooltipContent, { children: [_jsx(TooltipName, { children: entry.name }), _jsx(TooltipInstanceValue, { children: isNaN(Number(entry.value))
|
|
88
|
+
? '-'
|
|
89
|
+
: `${Number(entry.value).toFixed(2)}${unitLabel}` })] })] }, index)))] }));
|
|
90
|
+
};
|
|
91
|
+
const isSymmetricalSeries = (series) => {
|
|
92
|
+
return 'above' in series && 'below' in series;
|
|
93
|
+
};
|
|
94
|
+
export function LineTimeSerieChart({ series, title, height, startingTimeStamp, unitRange, isLoading = false, yAxisType = 'default', yAxisTitle, helpText, ...rest }) {
|
|
95
|
+
const theme = useTheme();
|
|
96
|
+
const { frequency, duration } = useMetricsTimeSpan();
|
|
97
|
+
const { getColor } = useChartLegend();
|
|
98
|
+
const chartRef = useRef(null);
|
|
99
|
+
const chartData = useMemo(() => {
|
|
100
|
+
// 1. Add missing data points
|
|
101
|
+
const normalizedSeries = yAxisType === 'symmetrical' && isSymmetricalSeries(series)
|
|
102
|
+
? {
|
|
103
|
+
above: series.above.map((line) => ({
|
|
104
|
+
...line,
|
|
105
|
+
data: addMissingDataPoint(line.data, startingTimeStamp, duration, frequency),
|
|
106
|
+
})),
|
|
107
|
+
// Convert positive values to negative values
|
|
108
|
+
below: series.below.map((line) => ({
|
|
109
|
+
...line,
|
|
110
|
+
data: addMissingDataPoint(line.data, startingTimeStamp, duration, frequency).map(([timestamp, value]) => [timestamp, value === null ? null : `-${Number(value)}`]),
|
|
111
|
+
})),
|
|
112
|
+
}
|
|
113
|
+
: series.map((line) => ({
|
|
114
|
+
...line,
|
|
115
|
+
data: addMissingDataPoint(line.data, startingTimeStamp, duration, frequency),
|
|
116
|
+
}));
|
|
117
|
+
// 2. Convert directly to Recharts format
|
|
118
|
+
// Initialize an object to hold data points by timestamp
|
|
119
|
+
const dataPointsByTime = {};
|
|
120
|
+
const seriesToProcess = yAxisType === 'symmetrical' && isSymmetricalSeries(normalizedSeries)
|
|
121
|
+
? [...normalizedSeries.above, ...normalizedSeries.below]
|
|
122
|
+
: normalizedSeries;
|
|
123
|
+
seriesToProcess.forEach((serie) => {
|
|
124
|
+
const label = serie.getTooltipLabel(serie.metricPrefix, serie.resource);
|
|
125
|
+
serie.data.forEach((point) => {
|
|
126
|
+
const timestamp = typeof point[0] === 'number' ? point[0] * 1000 : Number(point[0]);
|
|
127
|
+
const value = point[1];
|
|
128
|
+
// Initialize this timestamp if it doesn't exist
|
|
129
|
+
if (!dataPointsByTime[timestamp]) {
|
|
130
|
+
dataPointsByTime[timestamp] = { timestamp };
|
|
131
|
+
}
|
|
132
|
+
// Add this metric's value to the data point, and convert the value to a number if it's a string
|
|
133
|
+
dataPointsByTime[timestamp][label] =
|
|
134
|
+
typeof value === 'string' ? Number(value) : value;
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
// Convert object to array for Recharts
|
|
138
|
+
return Object.values(dataPointsByTime).sort((a, b) => a.timestamp - b.timestamp);
|
|
139
|
+
}, [series, startingTimeStamp, duration, frequency, yAxisType]);
|
|
140
|
+
// Calculate 5 perfectly evenly spaced ticks
|
|
141
|
+
const xAxisTicks = useMemo(() => {
|
|
142
|
+
if (!chartData || chartData.length === 0)
|
|
143
|
+
return [];
|
|
144
|
+
const timestamps = chartData.map((d) => d.timestamp);
|
|
145
|
+
const minTimestamp = Math.min(...timestamps);
|
|
146
|
+
const maxTimestamp = Math.max(...timestamps);
|
|
147
|
+
// Calculate 5 perfectly evenly spaced ticks
|
|
148
|
+
const timeRange = maxTimestamp - minTimestamp;
|
|
149
|
+
const interval = timeRange / 4; // 4 intervals create 5 points
|
|
150
|
+
const exactEvenTicks = [
|
|
151
|
+
minTimestamp,
|
|
152
|
+
minTimestamp + interval,
|
|
153
|
+
minTimestamp + interval * 2,
|
|
154
|
+
minTimestamp + interval * 3,
|
|
155
|
+
maxTimestamp,
|
|
156
|
+
];
|
|
157
|
+
// Return perfectly even ticks (guaranteed to be evenly divided)
|
|
158
|
+
return exactEvenTicks;
|
|
159
|
+
}, [chartData]);
|
|
160
|
+
// 3. Transform the data base on the valuebase
|
|
161
|
+
const { topValue, unitLabel, rechartsData } = useMemo(() => {
|
|
162
|
+
if (yAxisType === 'percentage')
|
|
163
|
+
return {
|
|
164
|
+
topValue: 100,
|
|
165
|
+
unitLabel: '%',
|
|
166
|
+
rechartsData: chartData,
|
|
167
|
+
};
|
|
168
|
+
const values = chartData.flatMap((dataPoint) => Object.entries(dataPoint)
|
|
169
|
+
.filter(([key]) => key !== 'timestamp')
|
|
170
|
+
.map(([_, value]) => {
|
|
171
|
+
const num = typeof value === 'string' ? Number(value) : (value !== null && value !== void 0 ? value : Infinity);
|
|
172
|
+
return !isNaN(num) && num !== null ? num : null;
|
|
173
|
+
})
|
|
174
|
+
.filter((value) => value !== null));
|
|
175
|
+
const top = Math.abs(Math.max(...values));
|
|
176
|
+
const bottom = Math.abs(Math.min(...values));
|
|
177
|
+
const maxValue = Math.max(top, bottom);
|
|
178
|
+
const { valueBase, unitLabel } = getUnitLabel(unitRange !== null && unitRange !== void 0 ? unitRange : [], maxValue);
|
|
179
|
+
const topValue = Math.ceil(maxValue / valueBase / 10) * 10;
|
|
180
|
+
const rechartsData = chartData.map((dataPoint) => {
|
|
181
|
+
const normalizedDataPoint = { ...dataPoint };
|
|
182
|
+
Object.entries(dataPoint).forEach(([key, value]) => {
|
|
183
|
+
if (key !== 'timestamp' && typeof value === 'number') {
|
|
184
|
+
normalizedDataPoint[key] = value / valueBase;
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
return normalizedDataPoint;
|
|
188
|
+
});
|
|
189
|
+
return { topValue, unitLabel, rechartsData };
|
|
190
|
+
}, [chartData, yAxisType, unitRange]);
|
|
191
|
+
// Group series by resource and create color mapping
|
|
192
|
+
const { colorMapping, groupedSeries } = useMemo(() => {
|
|
193
|
+
const mapping = {};
|
|
194
|
+
const allSeries = isSymmetricalSeries(series)
|
|
195
|
+
? [...series.above, ...series.below]
|
|
196
|
+
: series;
|
|
197
|
+
// Group series by resource
|
|
198
|
+
const groups = allSeries.reduce((acc, serie) => {
|
|
199
|
+
const key = serie.resource;
|
|
200
|
+
if (!acc[key]) {
|
|
201
|
+
acc[key] = [];
|
|
202
|
+
}
|
|
203
|
+
acc[key].push(serie);
|
|
204
|
+
return acc;
|
|
205
|
+
}, {});
|
|
206
|
+
// Get colors from the ChartLegend context
|
|
207
|
+
Object.keys(groups).forEach((resource) => {
|
|
208
|
+
const color = getColor(resource);
|
|
209
|
+
if (color) {
|
|
210
|
+
mapping[resource] = color;
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
console.warn(`Color not defined for resource: ${resource}`);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
return {
|
|
217
|
+
colorMapping: mapping,
|
|
218
|
+
groupedSeries: groups,
|
|
219
|
+
};
|
|
220
|
+
}, [series, getColor]);
|
|
221
|
+
// Format time for display the tick in the x axis
|
|
222
|
+
const formatTime = useMemo(() => (timestamp) => {
|
|
223
|
+
const date = new Date(timestamp);
|
|
224
|
+
return DAY_MONTH_ABBREVIATED_HOUR_MINUTE.format(date).replace(',', '');
|
|
225
|
+
}, []);
|
|
226
|
+
return (_jsxs(LineTemporalChartWrapper, { children: [_jsxs(ChartHeader, { children: [_jsxs(ChartTitleText, { children: [title, " ", unitLabel && `(${unitLabel})`] }), helpText && (_jsx(TooltipComponent, { placement: 'right', overlay: _jsx(SmallerText, { children: helpText }), children: _jsx(Icon, { name: "Info", color: theme.buttonSecondary }) })), isLoading && _jsx(Loader, {})] }), _jsx(ResponsiveContainer, { width: "100%", height: height, children: _jsxs(LineChart, { data: rechartsData, ref: chartRef, margin: { top: 0, right: 0, bottom: 0, left: 0 }, "aria-label": `Time series chart for ${title}`, children: [_jsx(CartesianGrid, { vertical: true, horizontal: true, verticalPoints: [0], horizontalPoints: [0], stroke: theme.border, fill: theme.backgroundLevel4, strokeWidth: 1 }), _jsx(XAxis, { dataKey: "timestamp", type: "number", domain: ['dataMin', 'dataMax'], ticks: xAxisTicks, tickFormatter: formatTime, tickCount: 5, tick: {
|
|
227
|
+
fill: theme.textSecondary,
|
|
228
|
+
fontSize: fontSize.smaller,
|
|
229
|
+
}, axisLine: { stroke: theme.border } }), _jsx(YAxis, { orientation: "right", allowDataOverflow: false, label: {
|
|
230
|
+
value: yAxisTitle,
|
|
231
|
+
angle: 90,
|
|
232
|
+
position: 'insideRight',
|
|
233
|
+
style: {
|
|
234
|
+
textAnchor: 'middle',
|
|
235
|
+
fill: theme.textSecondary,
|
|
236
|
+
fontSize: fontSize.smaller,
|
|
237
|
+
},
|
|
238
|
+
}, domain: yAxisType === 'percentage'
|
|
239
|
+
? [0, 100]
|
|
240
|
+
: yAxisType === 'symmetrical'
|
|
241
|
+
? [-topValue, topValue]
|
|
242
|
+
: [0, topValue], axisLine: { stroke: theme.border }, tick: {
|
|
243
|
+
fill: theme.textSecondary,
|
|
244
|
+
fontSize: fontSize.smaller,
|
|
245
|
+
}, tickFormatter: (value) => Math.round(value).toString() }), _jsx(Tooltip, { content: _jsx(CustomTooltip, { unitLabel: unitLabel }) }), yAxisType === 'symmetrical' && (_jsx(ReferenceLine, { y: 0, stroke: theme.border })), Object.entries(groupedSeries).map(([resource, resourceSeries]) => resourceSeries.map((serie, serieIndex) => {
|
|
246
|
+
const label = serie.getTooltipLabel(serie.metricPrefix, serie.resource);
|
|
247
|
+
return (_jsx(Line, { type: "monotone", dataKey: label, stroke: colorMapping[resource], dot: false }, `${title}-${resource}-${serieIndex}`));
|
|
248
|
+
}))] }) })] }));
|
|
249
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useLayoutEffect, useRef } from 'react';
|
|
3
|
-
import
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import { Wrap, spacing } from '../../spacing';
|
|
6
6
|
import { zIndex } from '../../style/theme';
|
|
@@ -73,7 +73,7 @@ const Modal = ({ isOpen, close, title, children, footer, subTitle, role = 'dialo
|
|
|
73
73
|
}
|
|
74
74
|
}, [isOpen]);
|
|
75
75
|
return isOpen
|
|
76
|
-
?
|
|
76
|
+
? createPortal(_jsx(ModalContainer, { className: "sc-modal", role: role, "aria-modal": "true", "aria-labelledby": "dialog_label", "aria-describedby": "dialog_desc", ...rest, children: _jsxs(ModalContent, { className: "sc-modal-content", children: [_jsx(ModalHeader, { className: "sc-modal-header", children: _jsxs(Wrap, { style: { flex: 1 }, children: [_jsx(Text, { variant: "Larger", id: "dialog_label", children: title }), close ? (_jsx(Button, { icon: _jsx(Icon, { name: "Close" }), onClick: close, tooltip: {
|
|
77
77
|
overlay: 'Close modal',
|
|
78
78
|
} })) : (_jsx(_Fragment, { children: subTitle }))] }) }), _jsx(ModalBody, { className: "sc-modal-body", id: "dialog_desc", children: children }), footer && (_jsx(ModalFooter, { className: "sc-modal-footer", children: footer }))] }) }), modalContainer.current)
|
|
79
79
|
: null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { cloneElement, Fragment } from 'react';
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
4
|
import { Logo } from '../../icons/branding';
|
|
5
5
|
import { spacing } from '../../spacing';
|
|
@@ -156,7 +156,7 @@ function NavBar({ onToggleClick, logo, tabs = [], rightActions = [], ...rest })
|
|
|
156
156
|
if (render) {
|
|
157
157
|
return (_jsx(Fragment, { children: render }, `navbar_tab_item_${index}`));
|
|
158
158
|
}
|
|
159
|
-
return link ? (
|
|
159
|
+
return link ? (cloneElement(link, {
|
|
160
160
|
className: selected ? 'selected' : '',
|
|
161
161
|
'aria-selected': selected,
|
|
162
162
|
role: 'tab',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollbarWrapper.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/scrollbarwrapper/ScrollbarWrapper.component.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScrollbarWrapper.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/scrollbarwrapper/ScrollbarWrapper.component.tsx"],"names":[],"mappings":"AAEA,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAmDF,iBAAS,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,2CAO5C;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { ChangeEvent } from 'react';
|
|
3
2
|
import { InputSize } from '../inputv2/inputv2';
|
|
4
3
|
export type Props = {
|
|
@@ -11,6 +10,6 @@ export type Props = {
|
|
|
11
10
|
size?: InputSize;
|
|
12
11
|
autoComplete?: 'on' | 'off';
|
|
13
12
|
};
|
|
14
|
-
declare const SearchInput:
|
|
13
|
+
declare const SearchInput: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<unknown>>;
|
|
15
14
|
export { SearchInput };
|
|
16
15
|
//# sourceMappingURL=SearchInput.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchInput.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/searchinput/SearchInput.component.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"SearchInput.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/searchinput/SearchInput.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA2C,MAAM,OAAO,CAAC;AAG7E,OAAO,EAAS,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGtD,MAAM,MAAM,KAAK,GAAG;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACrD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,YAAY,CAAC,EAAE,IAAI,GAAG,KAAK,CAAC;CAC7B,CAAC;AAuCF,QAAA,MAAM,WAAW,2FAuFhB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ForwardRefExoticComponent, RefAttributes, ReactNode } from 'react';
|
|
2
2
|
import { GroupTypeBase, OptionTypeBase } from 'react-select';
|
|
3
3
|
import ReactSelect from 'react-select/src/Select';
|
|
4
4
|
export type OptionProps = {
|
|
5
5
|
title?: string;
|
|
6
6
|
disabled?: boolean;
|
|
7
|
-
icon?:
|
|
8
|
-
children?:
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
children?: ReactNode;
|
|
9
9
|
value: string;
|
|
10
|
-
disabledReason?:
|
|
10
|
+
disabledReason?: ReactNode;
|
|
11
11
|
};
|
|
12
12
|
export declare function Option({ value, children, disabled, icon, disabledReason, ...rest }: OptionProps): JSX.Element;
|
|
13
13
|
export interface SelectRef<OptionType extends OptionTypeBase, IsMulti extends boolean, GroupType extends GroupTypeBase<OptionType>> {
|
|
@@ -23,7 +23,7 @@ export type SelectProps = {
|
|
|
23
23
|
id: string;
|
|
24
24
|
placeholder?: string;
|
|
25
25
|
disabled?: boolean;
|
|
26
|
-
children?:
|
|
26
|
+
children?: ReactNode;
|
|
27
27
|
value?: string;
|
|
28
28
|
onFocus?: (event: FocusEvent) => void;
|
|
29
29
|
onBlur?: (event: FocusEvent) => void;
|