rbro-tat-uds 2.2.21 → 2.2.22

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.
@@ -36,7 +36,6 @@ const UnitLinkGraphStyled = styled.svg`
36
36
  .text-contribution {
37
37
  font-size: 12px;
38
38
  font-weight: 500;
39
- fill: ${utils.colors.blue_600};
40
39
  }
41
40
  .text-action {
42
41
  font-size: 12px;
@@ -65,6 +64,7 @@ const UnitLinkGraph = ({
65
64
  header: "Placeholder",
66
65
  color_primary: utils.colors.purple_600,
67
66
  color_secondary: utils.colors.purple_50,
67
+ outline_color: utils.colors.white,
68
68
  percentage: 50,
69
69
  place_at_ani: 7,
70
70
  actions: [
@@ -87,6 +87,11 @@ const UnitLinkGraph = ({
87
87
  timeline_texts = {
88
88
  left: "Placeholder"
89
89
  },
90
+ timeline_text_color = {
91
+ left: utils.colors.blue_600,
92
+ right: utils.colors.blue_600
93
+ },
94
+ lineGraphAreaColor,
90
95
  ...rest
91
96
  }) => {
92
97
  const sliderActive = React.useMemo(() => {
@@ -222,7 +227,9 @@ const UnitLinkGraph = ({
222
227
  wrappedLabel,
223
228
  sublabel: item.sublabel,
224
229
  sublabel_x,
225
- sublabel_y
230
+ sublabel_y,
231
+ bgColor: item.bgColor || void 0,
232
+ textColor: item.textColor || void 0
226
233
  };
227
234
  }
228
235
  return {
@@ -254,7 +261,8 @@ const UnitLinkGraph = ({
254
261
  const dynamic_pos_secondary_x = get_position_at_indicator - APPROXIMATE_BAR_STROKE_WIDTH - configurations.bars.width - configurations.area.indicators.margin;
255
262
  const dynamic_pos_main_x = get_position_at_indicator + APPROXIMATE_BAR_STROKE_WIDTH + configurations.area.indicators.strokeWidth + configurations.area.indicators.margin;
256
263
  const h = mainHeightGraph - configurations.bars.actionsGap - START_Y;
257
- const calculate_filled_bar = floorToHalf(config.percentage / 100 * h);
264
+ const mainPercentage = (config?.secondary_percentage || 0) > 0 ? config.percentage - (config?.secondary_percentage || 0) : config.percentage;
265
+ const calculate_filled_bar = floorToHalf(mainPercentage / 100 * h);
258
266
  const x = floorToHalf(main ? dynamic_pos_main_x : dynamic_pos_secondary_x);
259
267
  const w = floorToHalf(configurations.bars.width);
260
268
  const outlined_y = START_Y + APPROXIMATE_BAR_STROKE_WIDTH + configurations.bars.actionsGap;
@@ -279,7 +287,9 @@ const UnitLinkGraph = ({
279
287
  filled_h: Math.max(filled_h, 0),
280
288
  colorPrimary: config.color_primary,
281
289
  colorSecondary: config.color_secondary,
290
+ outlineColor: config.outline_color || utils.colors.white,
282
291
  strokeWidth: configurations.bars.strokeWidth,
292
+ percentage: config.percentage,
283
293
  barActions: {
284
294
  header: {
285
295
  title: config.header,
@@ -310,7 +320,7 @@ const UnitLinkGraph = ({
310
320
  x1: floorToHalf(mainStart + configurations.area.outersPartsWidth),
311
321
  x2: floorToHalf(barMain.x - configurations.area.outersPartsWidth),
312
322
  y1: mainHeightGraph - configurations.area.strokeWidth,
313
- y2: barMain.filled_y + 1 - configurations.area.additionalSpaceVisualize,
323
+ y2: (barMain.percentage === 100 ? barMain.outlined_y : barMain.filled_y) + 1 - configurations.area.additionalSpaceVisualize,
314
324
  strokeWidth: barMainConfiguration.percentage === 0 ? 0 : configurations.area.graphLineStrokeWidth
315
325
  };
316
326
  const part_3 = {
@@ -318,8 +328,8 @@ const UnitLinkGraph = ({
318
328
  barMain.x - configurations.area.outersPartsWidth - configurations.area.additionalSpaceVisualize
319
329
  ),
320
330
  x2: floorToHalf(barMain.x),
321
- y1: barMain.filled_y + 1 - configurations.area.additionalSpaceVisualize,
322
- y2: barMain.filled_y + 1 - configurations.area.additionalSpaceVisualize,
331
+ y1: (barMain.percentage === 100 ? barMain.outlined_y : barMain.filled_y) + 1 - configurations.area.additionalSpaceVisualize,
332
+ y2: (barMain.percentage === 100 ? barMain.outlined_y : barMain.filled_y) + 1 - configurations.area.additionalSpaceVisualize,
323
333
  strokeWidth: barMainConfiguration.percentage === 0 ? 0 : configurations.area.graphLineStrokeWidth
324
334
  };
325
335
  return {
@@ -525,7 +535,7 @@ const UnitLinkGraph = ({
525
535
  y1: graph.main.area.part_1.y1,
526
536
  y2: graph.main.area.part_1.y2,
527
537
  strokeWidth: graph.main.area.part_1.strokeWidth,
528
- stroke: graph.main.bars.main.colorPrimary
538
+ stroke: lineGraphAreaColor || graph.main.bars.main.colorPrimary
529
539
  }
530
540
  ),
531
541
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -536,7 +546,7 @@ const UnitLinkGraph = ({
536
546
  y1: graph.main.area.part_2.y1,
537
547
  y2: graph.main.area.part_2.y2,
538
548
  strokeWidth: graph.main.area.part_2.strokeWidth,
539
- stroke: graph.main.bars.main.colorPrimary
549
+ stroke: lineGraphAreaColor || graph.main.bars.main.colorPrimary
540
550
  }
541
551
  ),
542
552
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -547,15 +557,15 @@ const UnitLinkGraph = ({
547
557
  y1: graph.main.area.part_3.y1,
548
558
  y2: graph.main.area.part_3.y2,
549
559
  strokeWidth: graph.main.area.part_3.strokeWidth,
550
- stroke: graph.main.bars.main.colorPrimary
560
+ stroke: lineGraphAreaColor || graph.main.bars.main.colorPrimary
551
561
  }
552
562
  ),
553
563
  /* @__PURE__ */ jsxRuntime.jsx(
554
564
  "polygon",
555
565
  {
556
566
  points: `
557
- ${graph.main.area.part_2.x2},${graph.main.bars.main.filled_y + 1.5}
558
- ${graph.main.area.part_3.x2},${graph.main.bars.main.filled_y + 1.5}
567
+ ${graph.main.area.part_2.x2},${(graph.main.bars.main.percentage === 100 ? graph.main.bars.main.outlined_y : graph.main.bars.main.filled_y) + 1.5}
568
+ ${graph.main.area.part_3.x2},${(graph.main.bars.main.percentage === 100 ? graph.main.bars.main.outlined_y : graph.main.bars.main.filled_y) + 1.5}
559
569
  ${graph.main.area.part_3.x2},${graph.mainHeightGraph}
560
570
  ${graph.main.area.part_2.x1},${graph.mainHeightGraph}`,
561
571
  fill: graph.main.bars.main.colorSecondary
@@ -615,6 +625,7 @@ const UnitLinkGraph = ({
615
625
  className: "text-contribution",
616
626
  y: graph.timeline.text.left.y,
617
627
  x: graph.timeline.text.left.x,
628
+ fill: timeline_text_color.left,
618
629
  textAnchor: "end",
619
630
  children: timeline_texts.left
620
631
  }
@@ -625,6 +636,7 @@ const UnitLinkGraph = ({
625
636
  className: "text-contribution",
626
637
  y: graph.timeline.text.right.y,
627
638
  x: graph.timeline.text.right.x,
639
+ fill: timeline_text_color.right,
628
640
  textAnchor: "start",
629
641
  children: timeline_texts.right
630
642
  }
@@ -709,7 +721,7 @@ const RenderBar = ({
709
721
  y: bar.outlined_y,
710
722
  width: bar.w,
711
723
  height: bar.outlined_h,
712
- fill: utils.colors.white,
724
+ fill: bar.outlineColor,
713
725
  stroke: bar.colorPrimary,
714
726
  strokeWidth: bar.strokeWidth
715
727
  }
@@ -737,6 +749,8 @@ const RenderBar = ({
737
749
  ),
738
750
  bar.barActions.actions.map((action, index) => {
739
751
  const isActive = activeAction === index;
752
+ const rectColor = isActive ? bar.colorPrimary : action.bgColor ? action.bgColor : bar.colorSecondary;
753
+ const textColor = isActive ? utils.colors.white : action.textColor ? action.textColor : bar.colorPrimary;
740
754
  return /* @__PURE__ */ jsxRuntime.jsxs(
741
755
  "g",
742
756
  {
@@ -746,7 +760,7 @@ const RenderBar = ({
746
760
  /* @__PURE__ */ jsxRuntime.jsx(
747
761
  "rect",
748
762
  {
749
- fill: isActive ? bar.colorPrimary : bar.colorSecondary,
763
+ fill: rectColor,
750
764
  rx: 4,
751
765
  ry: 4,
752
766
  height: action.actions_h,
@@ -761,7 +775,7 @@ const RenderBar = ({
761
775
  className: "text-bar-actions-label",
762
776
  x: action.label_x,
763
777
  y: action.label_y,
764
- fill: isActive ? utils.colors.white : bar.colorPrimary,
778
+ fill: textColor,
765
779
  children: action.wrappedLabel?.map((line, lineIndex) => /* @__PURE__ */ jsxRuntime.jsx(
766
780
  "tspan",
767
781
  {
@@ -776,7 +790,7 @@ const RenderBar = ({
776
790
  action.sublabel && /* @__PURE__ */ jsxRuntime.jsx(
777
791
  "text",
778
792
  {
779
- fill: isActive ? utils.colors.white : bar.colorPrimary,
793
+ fill: textColor,
780
794
  className: "text-bar-actions-sublabel",
781
795
  x: action.sublabel_x,
782
796
  y: action.sublabel_y,
@@ -80803,7 +80803,6 @@ const UnitLinkGraphStyled = styled__default.default.svg`
80803
80803
  .text-contribution {
80804
80804
  font-size: 12px;
80805
80805
  font-weight: 500;
80806
- fill: ${utils.colors.blue_600};
80807
80806
  }
80808
80807
  .text-action {
80809
80808
  font-size: 12px;
@@ -80832,6 +80831,7 @@ const UnitLinkGraph = ({
80832
80831
  header: "Placeholder",
80833
80832
  color_primary: utils.colors.purple_600,
80834
80833
  color_secondary: utils.colors.purple_50,
80834
+ outline_color: utils.colors.white,
80835
80835
  percentage: 50,
80836
80836
  place_at_ani: 7,
80837
80837
  actions: [
@@ -80854,6 +80854,11 @@ const UnitLinkGraph = ({
80854
80854
  timeline_texts = {
80855
80855
  left: "Placeholder"
80856
80856
  },
80857
+ timeline_text_color = {
80858
+ left: utils.colors.blue_600,
80859
+ right: utils.colors.blue_600
80860
+ },
80861
+ lineGraphAreaColor,
80857
80862
  ...rest
80858
80863
  }) => {
80859
80864
  const sliderActive = React.useMemo(() => {
@@ -80989,7 +80994,9 @@ const UnitLinkGraph = ({
80989
80994
  wrappedLabel,
80990
80995
  sublabel: item.sublabel,
80991
80996
  sublabel_x,
80992
- sublabel_y
80997
+ sublabel_y,
80998
+ bgColor: item.bgColor || void 0,
80999
+ textColor: item.textColor || void 0
80993
81000
  };
80994
81001
  }
80995
81002
  return {
@@ -81021,7 +81028,8 @@ const UnitLinkGraph = ({
81021
81028
  const dynamic_pos_secondary_x = get_position_at_indicator - APPROXIMATE_BAR_STROKE_WIDTH - configurations.bars.width - configurations.area.indicators.margin;
81022
81029
  const dynamic_pos_main_x = get_position_at_indicator + APPROXIMATE_BAR_STROKE_WIDTH + configurations.area.indicators.strokeWidth + configurations.area.indicators.margin;
81023
81030
  const h = mainHeightGraph - configurations.bars.actionsGap - START_Y;
81024
- const calculate_filled_bar = floorToHalf(config.percentage / 100 * h);
81031
+ const mainPercentage = (config?.secondary_percentage || 0) > 0 ? config.percentage - (config?.secondary_percentage || 0) : config.percentage;
81032
+ const calculate_filled_bar = floorToHalf(mainPercentage / 100 * h);
81025
81033
  const x = floorToHalf(main ? dynamic_pos_main_x : dynamic_pos_secondary_x);
81026
81034
  const w = floorToHalf(configurations.bars.width);
81027
81035
  const outlined_y = START_Y + APPROXIMATE_BAR_STROKE_WIDTH + configurations.bars.actionsGap;
@@ -81046,7 +81054,9 @@ const UnitLinkGraph = ({
81046
81054
  filled_h: Math.max(filled_h, 0),
81047
81055
  colorPrimary: config.color_primary,
81048
81056
  colorSecondary: config.color_secondary,
81057
+ outlineColor: config.outline_color || utils.colors.white,
81049
81058
  strokeWidth: configurations.bars.strokeWidth,
81059
+ percentage: config.percentage,
81050
81060
  barActions: {
81051
81061
  header: {
81052
81062
  title: config.header,
@@ -81077,7 +81087,7 @@ const UnitLinkGraph = ({
81077
81087
  x1: floorToHalf(mainStart + configurations.area.outersPartsWidth),
81078
81088
  x2: floorToHalf(barMain.x - configurations.area.outersPartsWidth),
81079
81089
  y1: mainHeightGraph - configurations.area.strokeWidth,
81080
- y2: barMain.filled_y + 1 - configurations.area.additionalSpaceVisualize,
81090
+ y2: (barMain.percentage === 100 ? barMain.outlined_y : barMain.filled_y) + 1 - configurations.area.additionalSpaceVisualize,
81081
81091
  strokeWidth: barMainConfiguration.percentage === 0 ? 0 : configurations.area.graphLineStrokeWidth
81082
81092
  };
81083
81093
  const part_3 = {
@@ -81085,8 +81095,8 @@ const UnitLinkGraph = ({
81085
81095
  barMain.x - configurations.area.outersPartsWidth - configurations.area.additionalSpaceVisualize
81086
81096
  ),
81087
81097
  x2: floorToHalf(barMain.x),
81088
- y1: barMain.filled_y + 1 - configurations.area.additionalSpaceVisualize,
81089
- y2: barMain.filled_y + 1 - configurations.area.additionalSpaceVisualize,
81098
+ y1: (barMain.percentage === 100 ? barMain.outlined_y : barMain.filled_y) + 1 - configurations.area.additionalSpaceVisualize,
81099
+ y2: (barMain.percentage === 100 ? barMain.outlined_y : barMain.filled_y) + 1 - configurations.area.additionalSpaceVisualize,
81090
81100
  strokeWidth: barMainConfiguration.percentage === 0 ? 0 : configurations.area.graphLineStrokeWidth
81091
81101
  };
81092
81102
  return {
@@ -81292,7 +81302,7 @@ const UnitLinkGraph = ({
81292
81302
  y1: graph.main.area.part_1.y1,
81293
81303
  y2: graph.main.area.part_1.y2,
81294
81304
  strokeWidth: graph.main.area.part_1.strokeWidth,
81295
- stroke: graph.main.bars.main.colorPrimary
81305
+ stroke: lineGraphAreaColor || graph.main.bars.main.colorPrimary
81296
81306
  }
81297
81307
  ),
81298
81308
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -81303,7 +81313,7 @@ const UnitLinkGraph = ({
81303
81313
  y1: graph.main.area.part_2.y1,
81304
81314
  y2: graph.main.area.part_2.y2,
81305
81315
  strokeWidth: graph.main.area.part_2.strokeWidth,
81306
- stroke: graph.main.bars.main.colorPrimary
81316
+ stroke: lineGraphAreaColor || graph.main.bars.main.colorPrimary
81307
81317
  }
81308
81318
  ),
81309
81319
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -81314,15 +81324,15 @@ const UnitLinkGraph = ({
81314
81324
  y1: graph.main.area.part_3.y1,
81315
81325
  y2: graph.main.area.part_3.y2,
81316
81326
  strokeWidth: graph.main.area.part_3.strokeWidth,
81317
- stroke: graph.main.bars.main.colorPrimary
81327
+ stroke: lineGraphAreaColor || graph.main.bars.main.colorPrimary
81318
81328
  }
81319
81329
  ),
81320
81330
  /* @__PURE__ */ jsxRuntime.jsx(
81321
81331
  "polygon",
81322
81332
  {
81323
81333
  points: `
81324
- ${graph.main.area.part_2.x2},${graph.main.bars.main.filled_y + 1.5}
81325
- ${graph.main.area.part_3.x2},${graph.main.bars.main.filled_y + 1.5}
81334
+ ${graph.main.area.part_2.x2},${(graph.main.bars.main.percentage === 100 ? graph.main.bars.main.outlined_y : graph.main.bars.main.filled_y) + 1.5}
81335
+ ${graph.main.area.part_3.x2},${(graph.main.bars.main.percentage === 100 ? graph.main.bars.main.outlined_y : graph.main.bars.main.filled_y) + 1.5}
81326
81336
  ${graph.main.area.part_3.x2},${graph.mainHeightGraph}
81327
81337
  ${graph.main.area.part_2.x1},${graph.mainHeightGraph}`,
81328
81338
  fill: graph.main.bars.main.colorSecondary
@@ -81382,6 +81392,7 @@ const UnitLinkGraph = ({
81382
81392
  className: "text-contribution",
81383
81393
  y: graph.timeline.text.left.y,
81384
81394
  x: graph.timeline.text.left.x,
81395
+ fill: timeline_text_color.left,
81385
81396
  textAnchor: "end",
81386
81397
  children: timeline_texts.left
81387
81398
  }
@@ -81392,6 +81403,7 @@ const UnitLinkGraph = ({
81392
81403
  className: "text-contribution",
81393
81404
  y: graph.timeline.text.right.y,
81394
81405
  x: graph.timeline.text.right.x,
81406
+ fill: timeline_text_color.right,
81395
81407
  textAnchor: "start",
81396
81408
  children: timeline_texts.right
81397
81409
  }
@@ -81476,7 +81488,7 @@ const RenderBar = ({
81476
81488
  y: bar.outlined_y,
81477
81489
  width: bar.w,
81478
81490
  height: bar.outlined_h,
81479
- fill: utils.colors.white,
81491
+ fill: bar.outlineColor,
81480
81492
  stroke: bar.colorPrimary,
81481
81493
  strokeWidth: bar.strokeWidth
81482
81494
  }
@@ -81504,6 +81516,8 @@ const RenderBar = ({
81504
81516
  ),
81505
81517
  bar.barActions.actions.map((action, index) => {
81506
81518
  const isActive = activeAction === index;
81519
+ const rectColor = isActive ? bar.colorPrimary : action.bgColor ? action.bgColor : bar.colorSecondary;
81520
+ const textColor = isActive ? utils.colors.white : action.textColor ? action.textColor : bar.colorPrimary;
81507
81521
  return /* @__PURE__ */ jsxRuntime.jsxs(
81508
81522
  "g",
81509
81523
  {
@@ -81513,7 +81527,7 @@ const RenderBar = ({
81513
81527
  /* @__PURE__ */ jsxRuntime.jsx(
81514
81528
  "rect",
81515
81529
  {
81516
- fill: isActive ? bar.colorPrimary : bar.colorSecondary,
81530
+ fill: rectColor,
81517
81531
  rx: 4,
81518
81532
  ry: 4,
81519
81533
  height: action.actions_h,
@@ -81528,7 +81542,7 @@ const RenderBar = ({
81528
81542
  className: "text-bar-actions-label",
81529
81543
  x: action.label_x,
81530
81544
  y: action.label_y,
81531
- fill: isActive ? utils.colors.white : bar.colorPrimary,
81545
+ fill: textColor,
81532
81546
  children: action.wrappedLabel?.map((line, lineIndex) => /* @__PURE__ */ jsxRuntime.jsx(
81533
81547
  "tspan",
81534
81548
  {
@@ -81543,7 +81557,7 @@ const RenderBar = ({
81543
81557
  action.sublabel && /* @__PURE__ */ jsxRuntime.jsx(
81544
81558
  "text",
81545
81559
  {
81546
- fill: isActive ? utils.colors.white : bar.colorPrimary,
81560
+ fill: textColor,
81547
81561
  className: "text-bar-actions-sublabel",
81548
81562
  x: action.sublabel_x,
81549
81563
  y: action.sublabel_y,
@@ -32,7 +32,6 @@ const UnitLinkGraphStyled = styled.svg`
32
32
  .text-contribution {
33
33
  font-size: 12px;
34
34
  font-weight: 500;
35
- fill: ${colors.blue_600};
36
35
  }
37
36
  .text-action {
38
37
  font-size: 12px;
@@ -61,6 +60,7 @@ const UnitLinkGraph = ({
61
60
  header: "Placeholder",
62
61
  color_primary: colors.purple_600,
63
62
  color_secondary: colors.purple_50,
63
+ outline_color: colors.white,
64
64
  percentage: 50,
65
65
  place_at_ani: 7,
66
66
  actions: [
@@ -83,6 +83,11 @@ const UnitLinkGraph = ({
83
83
  timeline_texts = {
84
84
  left: "Placeholder"
85
85
  },
86
+ timeline_text_color = {
87
+ left: colors.blue_600,
88
+ right: colors.blue_600
89
+ },
90
+ lineGraphAreaColor,
86
91
  ...rest
87
92
  }) => {
88
93
  const sliderActive = useMemo(() => {
@@ -218,7 +223,9 @@ const UnitLinkGraph = ({
218
223
  wrappedLabel,
219
224
  sublabel: item.sublabel,
220
225
  sublabel_x,
221
- sublabel_y
226
+ sublabel_y,
227
+ bgColor: item.bgColor || void 0,
228
+ textColor: item.textColor || void 0
222
229
  };
223
230
  }
224
231
  return {
@@ -250,7 +257,8 @@ const UnitLinkGraph = ({
250
257
  const dynamic_pos_secondary_x = get_position_at_indicator - APPROXIMATE_BAR_STROKE_WIDTH - configurations.bars.width - configurations.area.indicators.margin;
251
258
  const dynamic_pos_main_x = get_position_at_indicator + APPROXIMATE_BAR_STROKE_WIDTH + configurations.area.indicators.strokeWidth + configurations.area.indicators.margin;
252
259
  const h = mainHeightGraph - configurations.bars.actionsGap - START_Y;
253
- const calculate_filled_bar = floorToHalf(config.percentage / 100 * h);
260
+ const mainPercentage = (config?.secondary_percentage || 0) > 0 ? config.percentage - (config?.secondary_percentage || 0) : config.percentage;
261
+ const calculate_filled_bar = floorToHalf(mainPercentage / 100 * h);
254
262
  const x = floorToHalf(main ? dynamic_pos_main_x : dynamic_pos_secondary_x);
255
263
  const w = floorToHalf(configurations.bars.width);
256
264
  const outlined_y = START_Y + APPROXIMATE_BAR_STROKE_WIDTH + configurations.bars.actionsGap;
@@ -275,7 +283,9 @@ const UnitLinkGraph = ({
275
283
  filled_h: Math.max(filled_h, 0),
276
284
  colorPrimary: config.color_primary,
277
285
  colorSecondary: config.color_secondary,
286
+ outlineColor: config.outline_color || colors.white,
278
287
  strokeWidth: configurations.bars.strokeWidth,
288
+ percentage: config.percentage,
279
289
  barActions: {
280
290
  header: {
281
291
  title: config.header,
@@ -306,7 +316,7 @@ const UnitLinkGraph = ({
306
316
  x1: floorToHalf(mainStart + configurations.area.outersPartsWidth),
307
317
  x2: floorToHalf(barMain.x - configurations.area.outersPartsWidth),
308
318
  y1: mainHeightGraph - configurations.area.strokeWidth,
309
- y2: barMain.filled_y + 1 - configurations.area.additionalSpaceVisualize,
319
+ y2: (barMain.percentage === 100 ? barMain.outlined_y : barMain.filled_y) + 1 - configurations.area.additionalSpaceVisualize,
310
320
  strokeWidth: barMainConfiguration.percentage === 0 ? 0 : configurations.area.graphLineStrokeWidth
311
321
  };
312
322
  const part_3 = {
@@ -314,8 +324,8 @@ const UnitLinkGraph = ({
314
324
  barMain.x - configurations.area.outersPartsWidth - configurations.area.additionalSpaceVisualize
315
325
  ),
316
326
  x2: floorToHalf(barMain.x),
317
- y1: barMain.filled_y + 1 - configurations.area.additionalSpaceVisualize,
318
- y2: barMain.filled_y + 1 - configurations.area.additionalSpaceVisualize,
327
+ y1: (barMain.percentage === 100 ? barMain.outlined_y : barMain.filled_y) + 1 - configurations.area.additionalSpaceVisualize,
328
+ y2: (barMain.percentage === 100 ? barMain.outlined_y : barMain.filled_y) + 1 - configurations.area.additionalSpaceVisualize,
319
329
  strokeWidth: barMainConfiguration.percentage === 0 ? 0 : configurations.area.graphLineStrokeWidth
320
330
  };
321
331
  return {
@@ -521,7 +531,7 @@ const UnitLinkGraph = ({
521
531
  y1: graph.main.area.part_1.y1,
522
532
  y2: graph.main.area.part_1.y2,
523
533
  strokeWidth: graph.main.area.part_1.strokeWidth,
524
- stroke: graph.main.bars.main.colorPrimary
534
+ stroke: lineGraphAreaColor || graph.main.bars.main.colorPrimary
525
535
  }
526
536
  ),
527
537
  /* @__PURE__ */ jsx(
@@ -532,7 +542,7 @@ const UnitLinkGraph = ({
532
542
  y1: graph.main.area.part_2.y1,
533
543
  y2: graph.main.area.part_2.y2,
534
544
  strokeWidth: graph.main.area.part_2.strokeWidth,
535
- stroke: graph.main.bars.main.colorPrimary
545
+ stroke: lineGraphAreaColor || graph.main.bars.main.colorPrimary
536
546
  }
537
547
  ),
538
548
  /* @__PURE__ */ jsx(
@@ -543,15 +553,15 @@ const UnitLinkGraph = ({
543
553
  y1: graph.main.area.part_3.y1,
544
554
  y2: graph.main.area.part_3.y2,
545
555
  strokeWidth: graph.main.area.part_3.strokeWidth,
546
- stroke: graph.main.bars.main.colorPrimary
556
+ stroke: lineGraphAreaColor || graph.main.bars.main.colorPrimary
547
557
  }
548
558
  ),
549
559
  /* @__PURE__ */ jsx(
550
560
  "polygon",
551
561
  {
552
562
  points: `
553
- ${graph.main.area.part_2.x2},${graph.main.bars.main.filled_y + 1.5}
554
- ${graph.main.area.part_3.x2},${graph.main.bars.main.filled_y + 1.5}
563
+ ${graph.main.area.part_2.x2},${(graph.main.bars.main.percentage === 100 ? graph.main.bars.main.outlined_y : graph.main.bars.main.filled_y) + 1.5}
564
+ ${graph.main.area.part_3.x2},${(graph.main.bars.main.percentage === 100 ? graph.main.bars.main.outlined_y : graph.main.bars.main.filled_y) + 1.5}
555
565
  ${graph.main.area.part_3.x2},${graph.mainHeightGraph}
556
566
  ${graph.main.area.part_2.x1},${graph.mainHeightGraph}`,
557
567
  fill: graph.main.bars.main.colorSecondary
@@ -611,6 +621,7 @@ const UnitLinkGraph = ({
611
621
  className: "text-contribution",
612
622
  y: graph.timeline.text.left.y,
613
623
  x: graph.timeline.text.left.x,
624
+ fill: timeline_text_color.left,
614
625
  textAnchor: "end",
615
626
  children: timeline_texts.left
616
627
  }
@@ -621,6 +632,7 @@ const UnitLinkGraph = ({
621
632
  className: "text-contribution",
622
633
  y: graph.timeline.text.right.y,
623
634
  x: graph.timeline.text.right.x,
635
+ fill: timeline_text_color.right,
624
636
  textAnchor: "start",
625
637
  children: timeline_texts.right
626
638
  }
@@ -705,7 +717,7 @@ const RenderBar = ({
705
717
  y: bar.outlined_y,
706
718
  width: bar.w,
707
719
  height: bar.outlined_h,
708
- fill: colors.white,
720
+ fill: bar.outlineColor,
709
721
  stroke: bar.colorPrimary,
710
722
  strokeWidth: bar.strokeWidth
711
723
  }
@@ -733,6 +745,8 @@ const RenderBar = ({
733
745
  ),
734
746
  bar.barActions.actions.map((action, index) => {
735
747
  const isActive = activeAction === index;
748
+ const rectColor = isActive ? bar.colorPrimary : action.bgColor ? action.bgColor : bar.colorSecondary;
749
+ const textColor = isActive ? colors.white : action.textColor ? action.textColor : bar.colorPrimary;
736
750
  return /* @__PURE__ */ jsxs(
737
751
  "g",
738
752
  {
@@ -742,7 +756,7 @@ const RenderBar = ({
742
756
  /* @__PURE__ */ jsx(
743
757
  "rect",
744
758
  {
745
- fill: isActive ? bar.colorPrimary : bar.colorSecondary,
759
+ fill: rectColor,
746
760
  rx: 4,
747
761
  ry: 4,
748
762
  height: action.actions_h,
@@ -757,7 +771,7 @@ const RenderBar = ({
757
771
  className: "text-bar-actions-label",
758
772
  x: action.label_x,
759
773
  y: action.label_y,
760
- fill: isActive ? colors.white : bar.colorPrimary,
774
+ fill: textColor,
761
775
  children: action.wrappedLabel?.map((line, lineIndex) => /* @__PURE__ */ jsx(
762
776
  "tspan",
763
777
  {
@@ -772,7 +786,7 @@ const RenderBar = ({
772
786
  action.sublabel && /* @__PURE__ */ jsx(
773
787
  "text",
774
788
  {
775
- fill: isActive ? colors.white : bar.colorPrimary,
789
+ fill: textColor,
776
790
  className: "text-bar-actions-sublabel",
777
791
  x: action.sublabel_x,
778
792
  y: action.sublabel_y,
@@ -80780,7 +80780,6 @@ const UnitLinkGraphStyled = styled.svg`
80780
80780
  .text-contribution {
80781
80781
  font-size: 12px;
80782
80782
  font-weight: 500;
80783
- fill: ${colors.blue_600};
80784
80783
  }
80785
80784
  .text-action {
80786
80785
  font-size: 12px;
@@ -80809,6 +80808,7 @@ const UnitLinkGraph = ({
80809
80808
  header: "Placeholder",
80810
80809
  color_primary: colors.purple_600,
80811
80810
  color_secondary: colors.purple_50,
80811
+ outline_color: colors.white,
80812
80812
  percentage: 50,
80813
80813
  place_at_ani: 7,
80814
80814
  actions: [
@@ -80831,6 +80831,11 @@ const UnitLinkGraph = ({
80831
80831
  timeline_texts = {
80832
80832
  left: "Placeholder"
80833
80833
  },
80834
+ timeline_text_color = {
80835
+ left: colors.blue_600,
80836
+ right: colors.blue_600
80837
+ },
80838
+ lineGraphAreaColor,
80834
80839
  ...rest
80835
80840
  }) => {
80836
80841
  const sliderActive = useMemo(() => {
@@ -80966,7 +80971,9 @@ const UnitLinkGraph = ({
80966
80971
  wrappedLabel,
80967
80972
  sublabel: item.sublabel,
80968
80973
  sublabel_x,
80969
- sublabel_y
80974
+ sublabel_y,
80975
+ bgColor: item.bgColor || void 0,
80976
+ textColor: item.textColor || void 0
80970
80977
  };
80971
80978
  }
80972
80979
  return {
@@ -80998,7 +81005,8 @@ const UnitLinkGraph = ({
80998
81005
  const dynamic_pos_secondary_x = get_position_at_indicator - APPROXIMATE_BAR_STROKE_WIDTH - configurations.bars.width - configurations.area.indicators.margin;
80999
81006
  const dynamic_pos_main_x = get_position_at_indicator + APPROXIMATE_BAR_STROKE_WIDTH + configurations.area.indicators.strokeWidth + configurations.area.indicators.margin;
81000
81007
  const h = mainHeightGraph - configurations.bars.actionsGap - START_Y;
81001
- const calculate_filled_bar = floorToHalf(config.percentage / 100 * h);
81008
+ const mainPercentage = (config?.secondary_percentage || 0) > 0 ? config.percentage - (config?.secondary_percentage || 0) : config.percentage;
81009
+ const calculate_filled_bar = floorToHalf(mainPercentage / 100 * h);
81002
81010
  const x = floorToHalf(main ? dynamic_pos_main_x : dynamic_pos_secondary_x);
81003
81011
  const w = floorToHalf(configurations.bars.width);
81004
81012
  const outlined_y = START_Y + APPROXIMATE_BAR_STROKE_WIDTH + configurations.bars.actionsGap;
@@ -81023,7 +81031,9 @@ const UnitLinkGraph = ({
81023
81031
  filled_h: Math.max(filled_h, 0),
81024
81032
  colorPrimary: config.color_primary,
81025
81033
  colorSecondary: config.color_secondary,
81034
+ outlineColor: config.outline_color || colors.white,
81026
81035
  strokeWidth: configurations.bars.strokeWidth,
81036
+ percentage: config.percentage,
81027
81037
  barActions: {
81028
81038
  header: {
81029
81039
  title: config.header,
@@ -81054,7 +81064,7 @@ const UnitLinkGraph = ({
81054
81064
  x1: floorToHalf(mainStart + configurations.area.outersPartsWidth),
81055
81065
  x2: floorToHalf(barMain.x - configurations.area.outersPartsWidth),
81056
81066
  y1: mainHeightGraph - configurations.area.strokeWidth,
81057
- y2: barMain.filled_y + 1 - configurations.area.additionalSpaceVisualize,
81067
+ y2: (barMain.percentage === 100 ? barMain.outlined_y : barMain.filled_y) + 1 - configurations.area.additionalSpaceVisualize,
81058
81068
  strokeWidth: barMainConfiguration.percentage === 0 ? 0 : configurations.area.graphLineStrokeWidth
81059
81069
  };
81060
81070
  const part_3 = {
@@ -81062,8 +81072,8 @@ const UnitLinkGraph = ({
81062
81072
  barMain.x - configurations.area.outersPartsWidth - configurations.area.additionalSpaceVisualize
81063
81073
  ),
81064
81074
  x2: floorToHalf(barMain.x),
81065
- y1: barMain.filled_y + 1 - configurations.area.additionalSpaceVisualize,
81066
- y2: barMain.filled_y + 1 - configurations.area.additionalSpaceVisualize,
81075
+ y1: (barMain.percentage === 100 ? barMain.outlined_y : barMain.filled_y) + 1 - configurations.area.additionalSpaceVisualize,
81076
+ y2: (barMain.percentage === 100 ? barMain.outlined_y : barMain.filled_y) + 1 - configurations.area.additionalSpaceVisualize,
81067
81077
  strokeWidth: barMainConfiguration.percentage === 0 ? 0 : configurations.area.graphLineStrokeWidth
81068
81078
  };
81069
81079
  return {
@@ -81269,7 +81279,7 @@ const UnitLinkGraph = ({
81269
81279
  y1: graph.main.area.part_1.y1,
81270
81280
  y2: graph.main.area.part_1.y2,
81271
81281
  strokeWidth: graph.main.area.part_1.strokeWidth,
81272
- stroke: graph.main.bars.main.colorPrimary
81282
+ stroke: lineGraphAreaColor || graph.main.bars.main.colorPrimary
81273
81283
  }
81274
81284
  ),
81275
81285
  /* @__PURE__ */ jsx(
@@ -81280,7 +81290,7 @@ const UnitLinkGraph = ({
81280
81290
  y1: graph.main.area.part_2.y1,
81281
81291
  y2: graph.main.area.part_2.y2,
81282
81292
  strokeWidth: graph.main.area.part_2.strokeWidth,
81283
- stroke: graph.main.bars.main.colorPrimary
81293
+ stroke: lineGraphAreaColor || graph.main.bars.main.colorPrimary
81284
81294
  }
81285
81295
  ),
81286
81296
  /* @__PURE__ */ jsx(
@@ -81291,15 +81301,15 @@ const UnitLinkGraph = ({
81291
81301
  y1: graph.main.area.part_3.y1,
81292
81302
  y2: graph.main.area.part_3.y2,
81293
81303
  strokeWidth: graph.main.area.part_3.strokeWidth,
81294
- stroke: graph.main.bars.main.colorPrimary
81304
+ stroke: lineGraphAreaColor || graph.main.bars.main.colorPrimary
81295
81305
  }
81296
81306
  ),
81297
81307
  /* @__PURE__ */ jsx(
81298
81308
  "polygon",
81299
81309
  {
81300
81310
  points: `
81301
- ${graph.main.area.part_2.x2},${graph.main.bars.main.filled_y + 1.5}
81302
- ${graph.main.area.part_3.x2},${graph.main.bars.main.filled_y + 1.5}
81311
+ ${graph.main.area.part_2.x2},${(graph.main.bars.main.percentage === 100 ? graph.main.bars.main.outlined_y : graph.main.bars.main.filled_y) + 1.5}
81312
+ ${graph.main.area.part_3.x2},${(graph.main.bars.main.percentage === 100 ? graph.main.bars.main.outlined_y : graph.main.bars.main.filled_y) + 1.5}
81303
81313
  ${graph.main.area.part_3.x2},${graph.mainHeightGraph}
81304
81314
  ${graph.main.area.part_2.x1},${graph.mainHeightGraph}`,
81305
81315
  fill: graph.main.bars.main.colorSecondary
@@ -81359,6 +81369,7 @@ const UnitLinkGraph = ({
81359
81369
  className: "text-contribution",
81360
81370
  y: graph.timeline.text.left.y,
81361
81371
  x: graph.timeline.text.left.x,
81372
+ fill: timeline_text_color.left,
81362
81373
  textAnchor: "end",
81363
81374
  children: timeline_texts.left
81364
81375
  }
@@ -81369,6 +81380,7 @@ const UnitLinkGraph = ({
81369
81380
  className: "text-contribution",
81370
81381
  y: graph.timeline.text.right.y,
81371
81382
  x: graph.timeline.text.right.x,
81383
+ fill: timeline_text_color.right,
81372
81384
  textAnchor: "start",
81373
81385
  children: timeline_texts.right
81374
81386
  }
@@ -81453,7 +81465,7 @@ const RenderBar = ({
81453
81465
  y: bar.outlined_y,
81454
81466
  width: bar.w,
81455
81467
  height: bar.outlined_h,
81456
- fill: colors.white,
81468
+ fill: bar.outlineColor,
81457
81469
  stroke: bar.colorPrimary,
81458
81470
  strokeWidth: bar.strokeWidth
81459
81471
  }
@@ -81481,6 +81493,8 @@ const RenderBar = ({
81481
81493
  ),
81482
81494
  bar.barActions.actions.map((action, index) => {
81483
81495
  const isActive = activeAction === index;
81496
+ const rectColor = isActive ? bar.colorPrimary : action.bgColor ? action.bgColor : bar.colorSecondary;
81497
+ const textColor = isActive ? colors.white : action.textColor ? action.textColor : bar.colorPrimary;
81484
81498
  return /* @__PURE__ */ jsxs(
81485
81499
  "g",
81486
81500
  {
@@ -81490,7 +81504,7 @@ const RenderBar = ({
81490
81504
  /* @__PURE__ */ jsx(
81491
81505
  "rect",
81492
81506
  {
81493
- fill: isActive ? bar.colorPrimary : bar.colorSecondary,
81507
+ fill: rectColor,
81494
81508
  rx: 4,
81495
81509
  ry: 4,
81496
81510
  height: action.actions_h,
@@ -81505,7 +81519,7 @@ const RenderBar = ({
81505
81519
  className: "text-bar-actions-label",
81506
81520
  x: action.label_x,
81507
81521
  y: action.label_y,
81508
- fill: isActive ? colors.white : bar.colorPrimary,
81522
+ fill: textColor,
81509
81523
  children: action.wrappedLabel?.map((line, lineIndex) => /* @__PURE__ */ jsx(
81510
81524
  "tspan",
81511
81525
  {
@@ -81520,7 +81534,7 @@ const RenderBar = ({
81520
81534
  action.sublabel && /* @__PURE__ */ jsx(
81521
81535
  "text",
81522
81536
  {
81523
- fill: isActive ? colors.white : bar.colorPrimary,
81537
+ fill: textColor,
81524
81538
  className: "text-bar-actions-sublabel",
81525
81539
  x: action.sublabel_x,
81526
81540
  y: action.sublabel_y,
@@ -4,10 +4,14 @@ interface BarConfiguration {
4
4
  header: string;
5
5
  color_primary: string;
6
6
  color_secondary: string;
7
+ outline_color?: string;
7
8
  percentage: number;
9
+ secondary_percentage?: number;
8
10
  actions: Array<{
9
11
  label: string;
10
12
  sublabel?: string;
13
+ bgColor?: string;
14
+ textColor?: string;
11
15
  }>;
12
16
  }
13
17
  interface UnitLinkGraphProps extends HTMLAttributes<SVGSVGElement> {
@@ -27,7 +31,12 @@ interface UnitLinkGraphProps extends HTMLAttributes<SVGSVGElement> {
27
31
  left: string;
28
32
  right?: string;
29
33
  };
34
+ timeline_text_color?: {
35
+ left: string;
36
+ right: string;
37
+ };
30
38
  initialSliderValue?: number;
39
+ lineGraphAreaColor?: string;
31
40
  }
32
41
  declare const UnitLinkGraph: React.FC<UnitLinkGraphProps>;
33
42
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rbro-tat-uds",
3
- "version": "2.2.21",
3
+ "version": "2.2.22",
4
4
  "type": "module",
5
5
  "main": "build/cjs/index.cjs",
6
6
  "module": "build/esm/index.js",