@connectif/ui-components 2.0.19 → 2.0.20

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.
@@ -104,10 +104,30 @@ export type LineChartProps = CategorizedChartProps & {
104
104
  * Option to set the position of the Y axis when there is only one.
105
105
  */
106
106
  yAxisPosition?: 'left' | 'right';
107
+ /**
108
+ * Rotation angle in degrees for X-axis labels to prevent overlapping.
109
+ * Positive values rotate to the right, negative values rotate to the left.
110
+ */
111
+ xAxisLabelRotationDegrees?: number;
112
+ /**
113
+ * If true, all labels will be displayed
114
+ * @default false
115
+ */
116
+ forceAllXLabels?: boolean;
107
117
  /**
108
118
  * Margin to add between labels and x axis. It will be in px
109
119
  */
110
120
  xAxisMargin?: number;
121
+ /**
122
+ * Margin to add between labels and Y axis. It will be in px
123
+ */
124
+ yAxisMargin?: number;
125
+ /**
126
+ * If true, the chart stretches to use the full width,
127
+ * even when it has only a few values.
128
+ * @default false
129
+ */
130
+ stretch?: boolean;
111
131
  /**
112
132
  * Reference to chart component
113
133
  */
@@ -126,5 +146,5 @@ export type LineChartProps = CategorizedChartProps & {
126
146
  * A line chart component to display numeric data grouped by categories and series.
127
147
  * Commonly, categories use to be sorted dates.
128
148
  */
129
- declare const LineChart: ({ style, isLoading, series, categories, yAxisLabelFormatter, ySecondaryAxisLabelFormatter, onClick, disableSeriesNames, disableAxes, disableSplitLine, axisFontSize, axisFontColor, yAxisPosition, xAxisMargin, chartRef, gridMargin }: LineChartProps) => import("react/jsx-runtime").JSX.Element;
149
+ declare const LineChart: ({ style, isLoading, series, categories, yAxisLabelFormatter, ySecondaryAxisLabelFormatter, onClick, disableSeriesNames, disableAxes, disableSplitLine, axisFontSize, axisFontColor, yAxisPosition, xAxisLabelRotationDegrees, xAxisMargin, yAxisMargin, stretch, forceAllXLabels, chartRef, gridMargin }: LineChartProps) => import("react/jsx-runtime").JSX.Element;
130
150
  export default LineChart;
@@ -43,6 +43,10 @@ export type ChatMessageProps = {
43
43
  * Sets a different border radius in the entry message
44
44
  */
45
45
  highlightStartEdge?: boolean;
46
+ /**
47
+ * Sets maxWidth in the entry message
48
+ */
49
+ maxWidth?: number;
46
50
  /**
47
51
  * When cancelable button is clicked
48
52
  */
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { ThemeTypography } from '../../theme';
3
+ import { TextEllipsisTooltipProps } from './TextEllipsisTooltip';
3
4
  import { SxProps } from '@mui/material';
4
5
  export type TextEllipsisProps = {
5
6
  text?: React.ReactNode;
@@ -13,6 +14,7 @@ export type TextEllipsisProps = {
13
14
  lines?: number;
14
15
  'data-test'?: string;
15
16
  sx?: SxProps;
17
+ zIndex?: TextEllipsisTooltipProps['zIndex'];
16
18
  };
17
- declare const TextEllipsis: ({ text, typographyVariant, color, width, lines, maxWidth, "data-test": dataTest, sx }: TextEllipsisProps) => import("react/jsx-runtime").JSX.Element;
19
+ declare const TextEllipsis: ({ text, typographyVariant, color, width, lines, maxWidth, "data-test": dataTest, sx, zIndex }: TextEllipsisProps) => import("react/jsx-runtime").JSX.Element;
18
20
  export default TextEllipsis;
package/dist/index.js CHANGED
@@ -9442,7 +9442,8 @@ var TextEllipsis = ({
9442
9442
  lines = 1,
9443
9443
  maxWidth: maxWidth2,
9444
9444
  "data-test": dataTest,
9445
- sx
9445
+ sx,
9446
+ zIndex
9446
9447
  }) => {
9447
9448
  const textElementRef = React17.useRef(null);
9448
9449
  return /* @__PURE__ */ jsx32(
@@ -9451,6 +9452,7 @@ var TextEllipsis = ({
9451
9452
  title: text ?? "\xA0",
9452
9453
  textEllipsableElement: textElementRef,
9453
9454
  lines,
9455
+ zIndex,
9454
9456
  children: /* @__PURE__ */ jsx32(
9455
9457
  Typography_default,
9456
9458
  {
@@ -12307,7 +12309,11 @@ var LineChart2 = ({
12307
12309
  axisFontSize = "11px",
12308
12310
  axisFontColor = grey400,
12309
12311
  yAxisPosition = "right",
12312
+ xAxisLabelRotationDegrees,
12310
12313
  xAxisMargin,
12314
+ yAxisMargin,
12315
+ stretch = false,
12316
+ forceAllXLabels = false,
12311
12317
  chartRef,
12312
12318
  gridMargin
12313
12319
  }) => {
@@ -12481,6 +12487,7 @@ var LineChart2 = ({
12481
12487
  xAxis: {
12482
12488
  type: "category",
12483
12489
  data: categories,
12490
+ ...stretch && { boundaryGap: false },
12484
12491
  axisLine: {
12485
12492
  show: !disableSplitLine,
12486
12493
  lineStyle: {
@@ -12495,7 +12502,11 @@ var LineChart2 = ({
12495
12502
  color: axisFontColor,
12496
12503
  fontSize: axisFontSize,
12497
12504
  show: true,
12498
- opacity: !disableAxes ? 1 : 0
12505
+ opacity: !disableAxes ? 1 : 0,
12506
+ ...forceAllXLabels && { interval: 0 },
12507
+ ...xAxisLabelRotationDegrees && {
12508
+ rotate: xAxisLabelRotationDegrees
12509
+ }
12499
12510
  }
12500
12511
  },
12501
12512
  yAxis: [
@@ -12509,6 +12520,7 @@ var LineChart2 = ({
12509
12520
  }
12510
12521
  },
12511
12522
  axisLabel: {
12523
+ ...yAxisMargin && { margin: yAxisMargin },
12512
12524
  color: axisFontColor,
12513
12525
  fontSize: axisFontSize,
12514
12526
  formatter: yAxisLabelFormatter,
@@ -13753,6 +13765,7 @@ var ChatMessage = React35.forwardRef(function ChatMessage2({
13753
13765
  cancelableButtonText,
13754
13766
  backgroundColor: backgroundColor2,
13755
13767
  highlightStartEdge = true,
13768
+ maxWidth: maxWidth2,
13756
13769
  typographyColor,
13757
13770
  typographyVariant,
13758
13771
  onCancelableButtonClicked,
@@ -13783,7 +13796,7 @@ var ChatMessage = React35.forwardRef(function ChatMessage2({
13783
13796
  sx: {
13784
13797
  display: "flex",
13785
13798
  alignItems: "flex-start",
13786
- maxWidth: messageType === "outgoing" ? "93%" : "100%",
13799
+ maxWidth: !maxWidth2 ? messageType === "outgoing" ? "93%" : "100%" : `${maxWidth2}px`,
13787
13800
  textAlign: "left"
13788
13801
  },
13789
13802
  children: /* @__PURE__ */ jsxs35(
@@ -24277,9 +24290,9 @@ var MarkdownContainer = styled8("div")(
24277
24290
  borderRadius: "8px",
24278
24291
  overflowWrap: "break-word",
24279
24292
  "& h1, & h2, & h3": { color: color2 },
24280
- "& h1:not(:first-child)": { marginTop: "40px" },
24281
- "& h2:not(:first-child)": { marginTop: "32px" },
24282
- "& h3:not(:first-child)": { marginTop: "20px" },
24293
+ "& :is(h1, h2, h3) ~ h1": { marginTop: "40px" },
24294
+ "& :is(h1, h2, h3) ~ h2": { marginTop: "32px" },
24295
+ "& :is(h1, h2, h3) ~ h3": { marginTop: "20px" },
24283
24296
  "& h1": { fontSize: "1.75rem" },
24284
24297
  "& h2": { fontSize: "1.5rem" },
24285
24298
  "& h3": { fontSize: "1.25rem" },
@@ -24328,16 +24341,16 @@ var MarkdownContainer = styled8("div")(
24328
24341
  textAlign: "left",
24329
24342
  ...lineHeight && { lineHeight: `${lineHeight}px` }
24330
24343
  },
24331
- "& table tr:first-child th:first-child": {
24344
+ "& table tr:first-of-type th:first-of-type": {
24332
24345
  borderTopLeftRadius: "8px"
24333
24346
  },
24334
- "& table tr:first-child th:last-child": {
24347
+ "& table tr:first-of-type th:last-of-type": {
24335
24348
  borderTopRightRadius: "8px"
24336
24349
  },
24337
- "& table tr:last-child td:first-child": {
24350
+ "& table tr:last-of-type td:first-of-type": {
24338
24351
  borderBottomLeftRadius: "8px"
24339
24352
  },
24340
- "& table tr:last-child td:last-child": {
24353
+ "& table tr:last-of-type td:last-of-type": {
24341
24354
  borderBottomRightRadius: "8px"
24342
24355
  },
24343
24356
  "& th": { backgroundColor: dark800, color: white },