@connectif/ui-components 2.3.1 → 2.3.3

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.
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  import './EchartsConfig';
3
3
  import { ChartTooltipEntryFormatter } from '../../utils/ChartUtils';
4
4
  import { IncrementLabelType } from '../../propTypes/IncrementLabel';
5
+ import { CallbackDataParams } from 'echarts/types/dist/shared';
5
6
  export type DonutChartProps = {
6
7
  /**
7
8
  * The css style to apply to the chart container.
@@ -69,11 +70,27 @@ export type DonutChartProps = {
69
70
  * The color for this data item.
70
71
  */
71
72
  color: string;
73
+ /**
74
+ * The opacity to apply in color. Value between 0 and 1.
75
+ */
76
+ opacity?: number;
72
77
  }[];
73
78
  }[];
79
+ /**
80
+ * To modify start angle
81
+ */
82
+ startAngle?: number;
83
+ /**
84
+ * Inner circle width. Values between 0 to 100.
85
+ */
86
+ innerWidth?: number;
87
+ /**
88
+ * Function used to set specified tooltip.
89
+ */
90
+ getTooltip?: (param: CallbackDataParams) => React.ReactNode;
74
91
  };
75
92
  /**
76
93
  * A donut chart component to display numeric data grouped by categories and series.
77
94
  */
78
- declare const DonutChart: ({ style, isLoading, series, tooltipEntryFormatter, onClick }: DonutChartProps) => import("react/jsx-runtime").JSX.Element;
95
+ declare const DonutChart: ({ style, isLoading, series, startAngle, innerWidth, tooltipEntryFormatter, getTooltip, onClick }: DonutChartProps) => import("react/jsx-runtime").JSX.Element;
79
96
  export default DonutChart;
@@ -606,6 +606,7 @@ export declare const icons: {
606
606
  'division-box': string;
607
607
  dna: string;
608
608
  dns: string;
609
+ 'dns-outline': string;
609
610
  'do-not-disturb': string;
610
611
  'do-not-disturb-off': string;
611
612
  dolby: string;
@@ -5,7 +5,7 @@ export type InfoBoxProps = {
5
5
  children: React.ReactNode;
6
6
  variant?: InfoBoxVariant;
7
7
  collapsedHeight?: number;
8
- sx?: SxProps;
8
+ sx?: Omit<SxProps, 'position'>;
9
9
  };
10
10
  declare const InfoBox: React.FC<InfoBoxProps>;
11
11
  export default InfoBox;
package/dist/index.js CHANGED
@@ -1479,6 +1479,7 @@ import {
1479
1479
  mdiDivisionBox,
1480
1480
  mdiDna,
1481
1481
  mdiDns,
1482
+ mdiDnsOutline,
1482
1483
  mdiDomain,
1483
1484
  mdiSquareRounded,
1484
1485
  mdiDotsHorizontal,
@@ -3260,6 +3261,7 @@ var icons = {
3260
3261
  "division-box": mdiDivisionBox,
3261
3262
  dna: mdiDna,
3262
3263
  dns: mdiDns,
3264
+ "dns-outline": mdiDnsOutline,
3263
3265
  "do-not-disturb": mdiMinusCircle,
3264
3266
  "do-not-disturb-off": mdiMinusCircleOff,
3265
3267
  dolby: "M2,5V19H22V5H2M6,17H4V7H6C8.86,7.09 11.1,9.33 11,12C11.1,14.67 8.86,16.91 6,17M20,17H18C15.14,16.91 12.9,14.67 13,12C12.9,9.33 15.14,7.09 18,7H20V17Z",
@@ -4732,13 +4734,6 @@ __export(Typography_exports, {
4732
4734
  var Colors_exports = {};
4733
4735
  __export(Colors_exports, {
4734
4736
  black: () => black,
4735
- blackOpacity04: () => blackOpacity04,
4736
- blueGrey: () => blueGrey,
4737
- blueGrey300: () => blueGrey300,
4738
- blueGrey400: () => blueGrey400,
4739
- blueGrey500: () => blueGrey500,
4740
- blueGrey700: () => blueGrey700,
4741
- blueGrey800: () => blueGrey800,
4742
4737
  complementary100: () => complementary100,
4743
4738
  complementary200: () => complementary200,
4744
4739
  complementary300: () => complementary300,
@@ -4756,7 +4751,6 @@ __export(Colors_exports, {
4756
4751
  dark700: () => dark700,
4757
4752
  dark800: () => dark800,
4758
4753
  dark900: () => dark900,
4759
- darkGreen: () => darkGreen,
4760
4754
  darkMain: () => darkMain,
4761
4755
  electricLavender: () => electricLavender,
4762
4756
  error100: () => error100,
@@ -4771,7 +4765,6 @@ __export(Colors_exports, {
4771
4765
  error800: () => error800,
4772
4766
  error900: () => error900,
4773
4767
  errorMain: () => errorMain,
4774
- green2: () => green2,
4775
4768
  grey100: () => grey100,
4776
4769
  grey200: () => grey200,
4777
4770
  grey300: () => grey300,
@@ -4783,10 +4776,7 @@ __export(Colors_exports, {
4783
4776
  grey800: () => grey800,
4784
4777
  grey900: () => grey900,
4785
4778
  gunMetal: () => gunMetal,
4786
- lightGreen: () => lightGreen,
4787
4779
  oliveGreen: () => oliveGreen,
4788
- overlay02: () => overlay02,
4789
- overlay05: () => overlay05,
4790
4780
  paleOliveGreen: () => paleOliveGreen,
4791
4781
  primary100: () => primary100,
4792
4782
  primary200: () => primary200,
@@ -4799,14 +4789,10 @@ __export(Colors_exports, {
4799
4789
  primary800: () => primary800,
4800
4790
  primary900: () => primary900,
4801
4791
  primaryAlpha32: () => primaryAlpha32,
4802
- primaryAlpha64: () => primaryAlpha64,
4803
4792
  primaryDark: () => primaryDark,
4804
4793
  primaryLight: () => primaryLight,
4805
4794
  primaryMain: () => primaryMain,
4806
4795
  primaryOpacity32: () => primaryOpacity32,
4807
- purpleDark: () => purpleDark,
4808
- purpleLight: () => purpleLight,
4809
- redOrange: () => redOrange,
4810
4796
  success100: () => success100,
4811
4797
  success200: () => success200,
4812
4798
  success300: () => success300,
@@ -4820,12 +4806,6 @@ __export(Colors_exports, {
4820
4806
  successDark: () => successDark,
4821
4807
  successLight: () => successLight,
4822
4808
  successMain: () => successMain,
4823
- tertiaryBlueGray: () => tertiaryBlueGray,
4824
- tertiaryBlueGrayLight: () => tertiaryBlueGrayLight,
4825
- tertiaryOliveGreen: () => tertiaryOliveGreen,
4826
- tertiaryOliveGreenLight: () => tertiaryOliveGreenLight,
4827
- tertiaryTealBlue: () => tertiaryTealBlue,
4828
- tertiaryTealBlueLight: () => tertiaryTealBlueLight,
4829
4809
  white: () => white,
4830
4810
  whiteOpacity32: () => whiteOpacity32,
4831
4811
  yellow: () => yellow
@@ -4845,7 +4825,6 @@ var primaryDark = primary800;
4845
4825
  var primaryLight = primary300;
4846
4826
  var primaryOpacity32 = "rgba(212, 224, 246, 0.32)";
4847
4827
  var primaryAlpha32 = "#F1F5FC";
4848
- var primaryAlpha64 = "#E3EBF9";
4849
4828
  var complementary50 = "#FBF3E3";
4850
4829
  var complementary100 = "#F5E0B9";
4851
4830
  var complementary200 = "#F0CC8C";
@@ -4895,14 +4874,6 @@ var grey900 = "#212121";
4895
4874
  var white = "#FFFFFF";
4896
4875
  var whiteOpacity32 = "rgba(255, 255, 255, 0.32)";
4897
4876
  var black = "#000000";
4898
- var blackOpacity04 = "rgba(0, 0, 0, 0.04)";
4899
- var blueGrey300 = "#A0A4AB";
4900
- var blueGrey400 = "#646D7A";
4901
- var blueGrey500 = "#495362";
4902
- var blueGrey700 = "#414A58";
4903
- var blueGrey800 = "#383F4C";
4904
- var lightGreen = "#599D7D";
4905
- var darkGreen = "#487F65";
4906
4877
  var dark500 = "#7F8BA8";
4907
4878
  var dark600 = "#3A4155";
4908
4879
  var dark700 = "#2F3646";
@@ -4911,23 +4882,10 @@ var dark900 = "#1D202A";
4911
4882
  var darkMain = dark700;
4912
4883
  var electricLavender = "#AD77EF";
4913
4884
  var cornflowerBlue = "#5F90EF";
4914
- var tertiaryBlueGray = "#0E7178";
4915
- var tertiaryBlueGrayLight = "#E4F5F7";
4916
- var tertiaryOliveGreen = "#619C1D";
4917
- var tertiaryOliveGreenLight = "#EFF7E6";
4918
- var tertiaryTealBlue = "#73849F";
4919
- var tertiaryTealBlueLight = "#F1F3F5";
4920
- var overlay02 = "rgba(0, 0, 0, 0.02)";
4921
- var overlay05 = "rgba(0, 0, 0, 0.05)";
4922
- var purpleDark = "#8035DC";
4923
- var purpleLight = "#FCEDFF";
4924
4885
  var gunMetal = "#47535D";
4925
4886
  var yellow = "#FFD234";
4926
- var blueGrey = "#7384A0";
4927
4887
  var paleOliveGreen = "#AED581";
4928
4888
  var oliveGreen = "#83B04E";
4929
- var redOrange = "#FF3D00";
4930
- var green2 = "#2AC1CB";
4931
4889
 
4932
4890
  // src/theme/Typography.ts
4933
4891
  var sizes = {
@@ -5230,7 +5188,6 @@ var buttonTheme = {
5230
5188
  // src/theme/Palettes.ts
5231
5189
  var Palettes_exports = {};
5232
5190
  __export(Palettes_exports, {
5233
- blueGreyPalette: () => blueGreyPalette,
5234
5191
  commonPalette: () => commonPalette,
5235
5192
  complementaryPalette: () => complementaryPalette,
5236
5193
  cornflowerBluePalette: () => cornflowerBluePalette,
@@ -5257,8 +5214,7 @@ var primaryPalette = {
5257
5214
  800: primary800,
5258
5215
  900: primary900,
5259
5216
  opacity32: primaryOpacity32,
5260
- alpha32: primaryAlpha32,
5261
- alpha64: primaryAlpha64
5217
+ alpha32: primaryAlpha32
5262
5218
  };
5263
5219
  var complementaryPalette = {
5264
5220
  main: complementaryMain,
@@ -5318,21 +5274,10 @@ var greyPalette = {
5318
5274
  var commonPalette = {
5319
5275
  black,
5320
5276
  white,
5321
- blackOpacity04,
5322
5277
  whiteOpacity32
5323
5278
  };
5324
- var blueGreyPalette = {
5325
- main: blueGrey,
5326
- 300: blueGrey300,
5327
- 400: blueGrey400,
5328
- 500: blueGrey500,
5329
- 700: blueGrey700,
5330
- 800: blueGrey800
5331
- };
5332
5279
  var greenPalette = {
5333
- main: oliveGreen,
5334
- light: lightGreen,
5335
- dark: darkGreen
5280
+ main: oliveGreen
5336
5281
  };
5337
5282
  var darkPalette = {
5338
5283
  main: darkMain,
@@ -7699,7 +7644,6 @@ var themeOptions = {
7699
7644
  success: successPalette,
7700
7645
  grey: greyPalette,
7701
7646
  common: commonPalette,
7702
- blueGrey: blueGreyPalette,
7703
7647
  green: greenPalette,
7704
7648
  dark: darkPalette,
7705
7649
  electricLavender: electricLavenderPalette,
@@ -12066,7 +12010,7 @@ function useTooltipFormatter(chartTooltipEntryFormatter = ({
12066
12010
  value
12067
12011
  }) => ({
12068
12012
  text: `${seriesName}: ${value}`
12069
- })) {
12013
+ }), getTooltip) {
12070
12014
  const tooltipReact = React31.useMemo(() => {
12071
12015
  const domElement = document.createElement("div");
12072
12016
  return { root: createRoot(domElement), domElement };
@@ -12079,7 +12023,7 @@ function useTooltipFormatter(chartTooltipEntryFormatter = ({
12079
12023
  };
12080
12024
  params.sort((a, b) => getOrder(a) - getOrder(b));
12081
12025
  const tooltip = /* @__PURE__ */ jsxs26(Fragment9, { children: [
12082
- /* @__PURE__ */ jsx65(Typography_default, { variant: "tooltip", children: params[0].name }),
12026
+ !getTooltip && /* @__PURE__ */ jsx65(Typography_default, { variant: "tooltip", children: params[0].name }),
12083
12027
  params.map((p) => {
12084
12028
  const entry = chartTooltipEntryFormatter({
12085
12029
  seriesIndex: p.seriesIndex,
@@ -12088,6 +12032,9 @@ function useTooltipFormatter(chartTooltipEntryFormatter = ({
12088
12032
  data: p.data
12089
12033
  });
12090
12034
  const incrementType = entry.incrementLabelType ?? "neutral";
12035
+ if (getTooltip) {
12036
+ return /* @__PURE__ */ jsx65(React31.Fragment, { children: getTooltip(p) }, p.seriesIndex);
12037
+ }
12091
12038
  return /* @__PURE__ */ jsxs26(React31.Fragment, { children: [
12092
12039
  /* @__PURE__ */ jsx65("br", {}),
12093
12040
  /* @__PURE__ */ jsx65(
@@ -13101,7 +13048,10 @@ var DonutChart = ({
13101
13048
  style: style3,
13102
13049
  isLoading,
13103
13050
  series = [],
13051
+ startAngle,
13052
+ innerWidth,
13104
13053
  tooltipEntryFormatter,
13054
+ getTooltip,
13105
13055
  onClick
13106
13056
  }) => {
13107
13057
  const mainMetricWidth = 20;
@@ -13117,7 +13067,7 @@ var DonutChart = ({
13117
13067
  tooltip: {
13118
13068
  ...tooltipOptions,
13119
13069
  trigger: "item",
13120
- formatter: useTooltipFormatter(tooltipEntryFormatter)
13070
+ formatter: useTooltipFormatter(tooltipEntryFormatter, getTooltip)
13121
13071
  },
13122
13072
  grid: {
13123
13073
  left: 0,
@@ -13143,8 +13093,9 @@ var DonutChart = ({
13143
13093
  emptyCircleStyle: {
13144
13094
  color: alpha4(grey200, 0.5)
13145
13095
  },
13096
+ ...startAngle && { startAngle },
13146
13097
  radius: [
13147
- `${currentRadius - mainMetricWidth}%`,
13098
+ `${currentRadius - (innerWidth ?? mainMetricWidth)}%`,
13148
13099
  `${currentRadius}%`
13149
13100
  ],
13150
13101
  name,
@@ -13155,17 +13106,17 @@ var DonutChart = ({
13155
13106
  label: {
13156
13107
  show: false
13157
13108
  },
13158
- data: isAllZero ? [] : data.map(({ value, label, color: color2 }) => ({
13109
+ data: isAllZero ? [] : data.map(({ value, label, color: color2, opacity }) => ({
13159
13110
  value,
13160
13111
  name: label,
13161
13112
  incrementLabelValue,
13162
13113
  incrementLabelType,
13163
13114
  itemStyle: {
13164
- color: color2
13115
+ color: opacity === void 0 ? color2 : alpha4(color2, opacity)
13165
13116
  }
13166
13117
  }))
13167
13118
  });
13168
- currentRadius -= mainMetricWidth;
13119
+ currentRadius -= innerWidth ?? mainMetricWidth;
13169
13120
  if (isComparison) {
13170
13121
  currentRadius -= comparisonMetricMargin;
13171
13122
  previous.push({
@@ -13190,12 +13141,13 @@ var DonutChart = ({
13190
13141
  ({
13191
13142
  comparisonValue,
13192
13143
  comparisonLabel,
13193
- color: color2
13144
+ color: color2,
13145
+ opacity
13194
13146
  }) => ({
13195
13147
  value: comparisonValue,
13196
13148
  name: comparisonLabel,
13197
13149
  itemStyle: {
13198
- color: color2
13150
+ color: opacity === void 0 ? color2 : alpha4(color2, opacity)
13199
13151
  }
13200
13152
  })
13201
13153
  )
@@ -18337,7 +18289,8 @@ var InfoBox = ({
18337
18289
  }) => {
18338
18290
  const [ref, { height: height2 }] = useResizeObserver();
18339
18291
  const [expanded, setExpanded] = React46.useState(false);
18340
- const showExpandButton = height2 > collapsedHeight && expanded || height2 === collapsedHeight && !expanded;
18292
+ const showExpandButton = height2 >= collapsedHeight;
18293
+ const maxHeight2 = expanded ? `${height2}px` : `${collapsedHeight}px`;
18341
18294
  return /* @__PURE__ */ jsxs41(
18342
18295
  Stack_default,
18343
18296
  {
@@ -18345,9 +18298,11 @@ var InfoBox = ({
18345
18298
  direction: "row",
18346
18299
  sx: {
18347
18300
  position: "relative",
18301
+ transition: "max-height 0.25s cubic-bezier(0.2, 0.8, 0.4, 1)",
18302
+ maxHeight: maxHeight2,
18303
+ overflow: "hidden",
18348
18304
  ...variantStyles2[variant],
18349
- ...!expanded ? { maxHeight: `${collapsedHeight}px`, overflow: "hidden" } : {},
18350
- ...sx
18305
+ ...sx && { sx }
18351
18306
  },
18352
18307
  children: [
18353
18308
  /* @__PURE__ */ jsx93(
@@ -13,7 +13,6 @@ export declare const primaryDark = "#516DC4";
13
13
  export declare const primaryLight = "#82BDFD";
14
14
  export declare const primaryOpacity32 = "rgba(212, 224, 246, 0.32)";
15
15
  export declare const primaryAlpha32 = "#F1F5FC";
16
- export declare const primaryAlpha64 = "#E3EBF9";
17
16
  export declare const complementary50 = "#FBF3E3";
18
17
  export declare const complementary100 = "#F5E0B9";
19
18
  export declare const complementary200 = "#F0CC8C";
@@ -63,14 +62,6 @@ export declare const grey900 = "#212121";
63
62
  export declare const white = "#FFFFFF";
64
63
  export declare const whiteOpacity32 = "rgba(255, 255, 255, 0.32)";
65
64
  export declare const black = "#000000";
66
- export declare const blackOpacity04 = "rgba(0, 0, 0, 0.04)";
67
- export declare const blueGrey300 = "#A0A4AB";
68
- export declare const blueGrey400 = "#646D7A";
69
- export declare const blueGrey500 = "#495362";
70
- export declare const blueGrey700 = "#414A58";
71
- export declare const blueGrey800 = "#383F4C";
72
- export declare const lightGreen = "#599D7D";
73
- export declare const darkGreen = "#487F65";
74
65
  export declare const dark500 = "#7F8BA8";
75
66
  export declare const dark600 = "#3A4155";
76
67
  export declare const dark700 = "#2F3646";
@@ -79,20 +70,7 @@ export declare const dark900 = "#1D202A";
79
70
  export declare const darkMain = "#2F3646";
80
71
  export declare const electricLavender = "#AD77EF";
81
72
  export declare const cornflowerBlue = "#5F90EF";
82
- export declare const tertiaryBlueGray = "#0E7178";
83
- export declare const tertiaryBlueGrayLight = "#E4F5F7";
84
- export declare const tertiaryOliveGreen = "#619C1D";
85
- export declare const tertiaryOliveGreenLight = "#EFF7E6";
86
- export declare const tertiaryTealBlue = "#73849F";
87
- export declare const tertiaryTealBlueLight = "#F1F3F5";
88
- export declare const overlay02 = "rgba(0, 0, 0, 0.02)";
89
- export declare const overlay05 = "rgba(0, 0, 0, 0.05)";
90
- export declare const purpleDark = "#8035DC";
91
- export declare const purpleLight = "#FCEDFF";
92
73
  export declare const gunMetal = "#47535D";
93
74
  export declare const yellow = "#FFD234";
94
- export declare const blueGrey = "#7384A0";
95
75
  export declare const paleOliveGreen = "#AED581";
96
76
  export declare const oliveGreen = "#83B04E";
97
- export declare const redOrange = "#FF3D00";
98
- export declare const green2 = "#2AC1CB";
@@ -8,7 +8,6 @@ export interface CustomPalette extends Palette {
8
8
  success: CustomPaletteColor;
9
9
  grey: CustomPaletteColor;
10
10
  common: CustomPaletteCommon;
11
- blueGrey: CustomPaletteColor;
12
11
  green: CustomPaletteColor;
13
12
  dark: CustomPaletteColor;
14
13
  electricLavender: CustomPaletteColor;
@@ -21,7 +20,6 @@ export interface CustomPaletteOptions extends PaletteOptions {
21
20
  success?: CustomPaletteColorOptions;
22
21
  grey?: CustomPaletteColorOptions;
23
22
  common?: CustomPaletteCommonOptions;
24
- blueGrey?: CustomPaletteColorOptions;
25
23
  green?: CustomPaletteColorOptions;
26
24
  dark?: CustomPaletteColorOptions;
27
25
  electricLavender?: CustomPaletteColorOptions;
@@ -1,7 +1,6 @@
1
1
  export interface CustomPaletteCommon {
2
2
  black: string;
3
3
  white: string;
4
- blackOpacity04: string;
5
4
  whiteOpacity32: string;
6
5
  }
7
6
  export type CustomPaletteCommonOptions = Partial<CustomPaletteCommon>;
@@ -6,7 +6,6 @@ export declare const errorPalette: CustomPaletteColorOptions;
6
6
  export declare const successPalette: CustomPaletteColorOptions;
7
7
  export declare const greyPalette: CustomPaletteColorOptions;
8
8
  export declare const commonPalette: CustomPaletteCommonOptions;
9
- export declare const blueGreyPalette: CustomPaletteColorOptions;
10
9
  export declare const greenPalette: CustomPaletteColorOptions;
11
10
  export declare const darkPalette: CustomPaletteColorOptions;
12
11
  export declare const electricLavenderPalette: CustomPaletteColorOptions;