@clickhouse/click-ui 0.0.197 → 0.0.198

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.
@@ -2643,7 +2643,9 @@ const FormFieldLabel = styled.label.withConfig({
2643
2643
  ${disabled ? `
2644
2644
  color: ${theme2.click.field.color.genericLabel.disabled};
2645
2645
  font: ${theme2.click.field.typography.genericLabel.disabled};
2646
+ cursor: not-allowed;
2646
2647
  ` : `
2648
+ cursor: pointer;
2647
2649
  color: ${theme2.click.field.color.genericLabel.default};
2648
2650
  font: ${theme2.click.field.typography.genericLabel.default};
2649
2651
  &:hover {
@@ -7920,11 +7922,9 @@ DropdownTrigger.displayName = "DropdownTrigger";
7920
7922
  Dropdown.Trigger = DropdownTrigger;
7921
7923
  const DropdownMenuContent = styled(GenericMenuPanel).withConfig({
7922
7924
  componentId: "sc-18bhwbw-2"
7923
- })(["min-width:", ";flex-direction:column;z-index:1;overflow-y:auto;max-height:calc( (var(--radix-", "-content-available-height) - 100px) );"], ({
7925
+ })(["min-width:", ";flex-direction:column;z-index:1;overflow-y:auto;"], ({
7924
7926
  theme: theme2
7925
- }) => theme2.click.genericMenu.item.size.minWidth, ({
7926
- $type
7927
- }) => $type);
7927
+ }) => theme2.click.genericMenu.item.size.minWidth);
7928
7928
  const DropdownContent$1 = ({
7929
7929
  sub,
7930
7930
  children,
@@ -7932,7 +7932,7 @@ const DropdownContent$1 = ({
7932
7932
  ...props
7933
7933
  }) => {
7934
7934
  const ContentElement = sub ? $d08ef79370b62062$export$6d4de93b380beddf : $d08ef79370b62062$export$7c6e2c02157bb7d2;
7935
- return /* @__PURE__ */ jsx($d08ef79370b62062$export$602eac185826482c, { children: /* @__PURE__ */ jsxs(DropdownMenuContent, { $type: "dropdown-menu", $showArrow: showArrow, as: ContentElement, sideOffset: 4, loop: true, ...props, children: [
7935
+ return /* @__PURE__ */ jsx($d08ef79370b62062$export$602eac185826482c, { children: /* @__PURE__ */ jsxs(DropdownMenuContent, { $type: "dropdown-menu", $showArrow: showArrow, as: ContentElement, sideOffset: 4, loop: true, collisionPadding: 100, ...props, children: [
7936
7936
  showArrow && /* @__PURE__ */ jsx(Arrow$1, { asChild: true, as: $d08ef79370b62062$export$21b07c8f274aebd5, width: 20, height: 10, children: /* @__PURE__ */ jsx(PopoverArrow, {}) }),
7937
7937
  children
7938
7938
  ] }) });
@@ -9635,12 +9635,13 @@ const Wrapper$a = styled.div.withConfig({
9635
9635
  theme: theme2,
9636
9636
  $color,
9637
9637
  $isSelected,
9638
+ $isSelectable,
9638
9639
  $disabled
9639
9640
  }) => `
9640
9641
  background: ${theme2.click.card.horizontal[$color].color.background.default};
9641
9642
  color: ${theme2.click.card.horizontal[$color].color.title.default};
9642
9643
  border-radius: ${theme2.click.card.horizontal.radii.all};
9643
- border: 1px solid ${theme2.click.card.horizontal[$color].color.stroke[$isSelected ? "active" : "default"]};
9644
+ border: 1px solid ${theme2.click.card.horizontal[$color].color.stroke[$isSelectable ? $isSelected ? "active" : "hover" : "default"]};
9644
9645
  padding: ${theme2.click.card.horizontal.space.y} ${theme2.click.card.horizontal.space.x};
9645
9646
  gap: ${theme2.click.card.horizontal.space.gap};
9646
9647
  font: ${theme2.click.card.horizontal.typography.title.default};
@@ -9649,24 +9650,24 @@ const Wrapper$a = styled.div.withConfig({
9649
9650
  font: ${theme2.click.card.horizontal.typography.description.default};
9650
9651
  }
9651
9652
  &:hover{
9652
- background-color: ${theme2.click.card.horizontal[$color].color.background.hover};
9653
- color: ${theme2.click.card.horizontal[$color].color.title.hover};
9654
- border: 1px solid ${theme2.click.card.horizontal[$color].color.stroke[$isSelected ? "active" : "hover"]};
9655
- cursor: pointer;
9653
+ background-color: ${theme2.click.card.horizontal[$color].color.background[$isSelectable ? "hover" : "default"]};
9654
+ color: ${theme2.click.card.horizontal[$color].color.title[$isSelectable ? "hover" : "default"]};
9655
+ border: 1px solid ${theme2.click.card.horizontal[$color].color.stroke[$isSelectable ? $isSelected ? "active" : "default" : "default"]};
9656
+ cursor: ${$isSelectable ? "pointer" : "default"};
9656
9657
  font: ${theme2.click.card.horizontal.typography.title.hover};
9657
9658
  ${Description} {
9658
- color: ${theme2.click.card.horizontal[$color].color.description.hover};
9659
- font: ${theme2.click.card.horizontal.typography.description.hover};
9659
+ color: ${theme2.click.card.horizontal[$color].color.description[$isSelectable ? "hover" : "default"]};
9660
+ font: ${theme2.click.card.horizontal.typography.description[$isSelectable ? "hover" : "default"]};
9660
9661
  }
9661
9662
  }
9662
9663
 
9663
9664
  &:active, &:focus, &:focus-within {
9664
- background-color: ${theme2.click.card.horizontal[$color].color.background.active};
9665
- color: ${theme2.click.card.horizontal[$color].color.title.active};
9666
- border: 1px solid ${theme2.click.card.horizontal[$color].color.stroke.active};
9665
+ background-color: ${theme2.click.card.horizontal[$color].color.background[$isSelectable ? "active" : "default"]};
9666
+ color: ${theme2.click.card.horizontal[$color].color.title[$isSelectable ? "active" : "default"]};
9667
+ border: 1px solid ${theme2.click.card.horizontal[$color].color.stroke[$isSelectable ? "active" : "default"]};
9667
9668
  ${Description} {
9668
- color: ${theme2.click.card.horizontal[$color].color.description.active};
9669
- font: ${theme2.click.card.horizontal.typography.description.active};
9669
+ color: ${theme2.click.card.horizontal[$color].color.description[$isSelectable ? "active" : "default"]};
9670
+ font: ${theme2.click.card.horizontal.typography.description[$isSelectable ? "active" : "default"]};
9670
9671
  }
9671
9672
  }
9672
9673
  ${$disabled ? `
@@ -9698,32 +9699,56 @@ const CardIcon$1 = styled(SvgImage).withConfig({
9698
9699
  `);
9699
9700
  const ContentWrapper = styled.div.withConfig({
9700
9701
  componentId: "sc-1qnbjoa-4"
9701
- })(["display:flex;flex-direction:column;width:100%;"]);
9702
+ })(["display:flex;flex-direction:row;width:100%;gap:", ";@media (max-width:", "){flex-direction:column;}"], ({
9703
+ theme: theme2
9704
+ }) => theme2.click.card.horizontal.space.gap, ({
9705
+ theme: theme2
9706
+ }) => theme2.breakpoint.sizes.md);
9707
+ const IconTextContentWrapper = styled.div.withConfig({
9708
+ componentId: "sc-1qnbjoa-5"
9709
+ })(["display:flex;flex-direction:row;align-items:center;width:100%;gap:", ";"], ({
9710
+ theme: theme2
9711
+ }) => theme2.click.card.horizontal.space.gap);
9702
9712
  const CardHorizontal = ({
9703
9713
  title,
9704
9714
  icon,
9705
9715
  description,
9706
9716
  disabled = false,
9717
+ infoText,
9718
+ infoUrl,
9707
9719
  isSelected,
9720
+ isSelectable = infoText ? false : true,
9708
9721
  children,
9709
9722
  color = "default",
9710
9723
  badgeText,
9711
9724
  badgeState,
9712
9725
  badgeIcon,
9713
9726
  badgeIconDir,
9727
+ onButtonClick,
9714
9728
  ...props
9715
9729
  }) => {
9716
- return /* @__PURE__ */ jsxs(Wrapper$a, { $disabled: disabled, $isSelected: isSelected, $color: color, tabIndex: 0, ...props, children: [
9717
- icon && /* @__PURE__ */ jsx(CardIcon$1, { name: icon, "aria-hidden": true }),
9718
- /* @__PURE__ */ jsxs(ContentWrapper, { children: [
9719
- title && /* @__PURE__ */ jsxs(Header$4, { as: Container, isResponsive: false, gap: "xs", justifyContent: "space-between", fillWidth: true, children: [
9720
- /* @__PURE__ */ jsx(Container, { orientation: "horizontal", gap: "xs", isResponsive: false, fillWidth: false, grow: "1", children: title }),
9721
- badgeText && /* @__PURE__ */ jsx(Container, { isResponsive: false, justifyContent: "end", fillWidth: false, "data-testid": "horizontal-card-badge", children: /* @__PURE__ */ jsx(Badge, { text: badgeText, size: "md", state: badgeState, icon: badgeIcon, iconDir: badgeIconDir }) })
9722
- ] }),
9723
- description && /* @__PURE__ */ jsx(Description, { children: description }),
9724
- children && /* @__PURE__ */ jsx(Description, { children })
9725
- ] })
9726
- ] });
9730
+ const handleClick = (e) => {
9731
+ if (typeof onButtonClick === "function") {
9732
+ onButtonClick(e);
9733
+ }
9734
+ if (infoUrl && infoUrl.length > 0) {
9735
+ window.open(infoUrl, "_blank");
9736
+ }
9737
+ };
9738
+ return /* @__PURE__ */ jsx(Wrapper$a, { $disabled: disabled, $isSelected: isSelected, $isSelectable: isSelectable, $color: color, tabIndex: 0, onClick: handleClick, ...props, children: /* @__PURE__ */ jsxs(ContentWrapper, { children: [
9739
+ /* @__PURE__ */ jsxs(IconTextContentWrapper, { children: [
9740
+ icon && /* @__PURE__ */ jsx(CardIcon$1, { name: icon, "aria-hidden": true }),
9741
+ /* @__PURE__ */ jsxs(Container, { padding: "none", orientation: "vertical", children: [
9742
+ title && /* @__PURE__ */ jsxs(Header$4, { as: Container, isResponsive: false, gap: "xs", justifyContent: "space-between", fillWidth: true, children: [
9743
+ /* @__PURE__ */ jsx(Container, { orientation: "horizontal", gap: "xs", isResponsive: false, fillWidth: false, grow: "1", children: title }),
9744
+ badgeText && /* @__PURE__ */ jsx(Container, { isResponsive: false, justifyContent: "end", fillWidth: false, "data-testid": "horizontal-card-badge", children: /* @__PURE__ */ jsx(Badge, { text: badgeText, size: "md", state: badgeState, icon: badgeIcon, iconDir: badgeIconDir }) })
9745
+ ] }),
9746
+ description && /* @__PURE__ */ jsx(Description, { children: description }),
9747
+ children && /* @__PURE__ */ jsx(Description, { children })
9748
+ ] })
9749
+ ] }),
9750
+ infoText && /* @__PURE__ */ jsx(Container, { justifyContent: "end", fillWidth: false, "data-testid": "horizontal-card-button", children: /* @__PURE__ */ jsx(Button, { label: infoText, onClick: handleClick, fillWidth: true }) })
9751
+ ] }) });
9727
9752
  };
9728
9753
  const Title$2 = forwardRef(({
9729
9754
  align,
@@ -18107,9 +18132,12 @@ const StyledCell = styled.div.withConfig({
18107
18132
  $selectionType,
18108
18133
  $height,
18109
18134
  $type = "body",
18110
- $showBorder
18135
+ $showBorder,
18136
+ $rowAutoHeight
18111
18137
  }) => `
18112
- height: ${$height}px;
18138
+ height: ${$rowAutoHeight ? "100%" : `${$height}px`};
18139
+ min-height: ${$rowAutoHeight ? "auto" : ""};
18140
+ overflow-y: ${$rowAutoHeight ? "auto" : ""};
18113
18141
  background: ${theme2.click.grid[$type].cell.color.background[$selectionType]};
18114
18142
  color: ${$type === "header" ? theme2.click.grid.header.cell.color.title[$selectionType] : theme2.click.grid.body.cell.color.text[$selectionType]};
18115
18143
  font: ${theme2.click.grid.cell.text.default};
@@ -18130,6 +18158,7 @@ const StyledCell = styled.div.withConfig({
18130
18158
  ${$isLastColumn ? `
18131
18159
  border-right-color: ${theme2.click.grid[$type].cell.color.stroke[$isFocused ? "selectDirect" : $selectionType]};
18132
18160
  ` : "border-right: none;"}
18161
+ ${$rowAutoHeight && "border: none;"}
18133
18162
  `, ({
18134
18163
  theme: theme2,
18135
18164
  $isLastRow,
@@ -18137,8 +18166,9 @@ const StyledCell = styled.div.withConfig({
18137
18166
  $selectionType,
18138
18167
  $type = "body",
18139
18168
  $isSelectedTop,
18140
- $isSelectedLeft
18141
- }) => $isSelectedTop || $isSelectedLeft || $selectionType === "selectDirect" && ($isLastRow || $isLastColumn) ? `
18169
+ $isSelectedLeft,
18170
+ $rowAutoHeight
18171
+ }) => $isSelectedTop || $isSelectedLeft || $selectionType === "selectDirect" && ($isLastRow || $isLastColumn) || $rowAutoHeight ? `
18142
18172
  &::before {
18143
18173
  content: "";
18144
18174
  position: absolute;
@@ -18150,6 +18180,7 @@ const StyledCell = styled.div.withConfig({
18150
18180
  ${$isSelectedLeft ? `border-left: 1px solid ${theme2.click.grid[$type].cell.color.stroke.selectDirect};` : ""}
18151
18181
  ${$selectionType === "selectDirect" && $isLastRow ? `border-bottom: 1px solid ${theme2.click.grid[$type].cell.color.stroke.selectDirect};` : ""}
18152
18182
  ${$selectionType === "selectDirect" && $isLastColumn ? `border-right: 1px solid ${theme2.click.grid[$type].cell.color.stroke.selectDirect};` : ""}
18183
+ ${$rowAutoHeight && "border: none;"}
18153
18184
  }
18154
18185
  ` : "");
18155
18186
  const RowNumberColumnContainer = styled.div.withConfig({
@@ -18169,10 +18200,11 @@ const RowNumberCell = styled.div.withConfig({
18169
18200
  componentId: "sc-7gbi4d-1"
18170
18201
  })(["position:absolute;left:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;", ""], ({
18171
18202
  $height,
18172
- $rowNumber
18203
+ $rowNumber,
18204
+ $rowAutoHeight
18173
18205
  }) => `
18174
18206
  top: ${$height * $rowNumber}px;
18175
- height: ${$height}px;
18207
+ height: ${$rowAutoHeight ? "100%" : `${$height}px`};
18176
18208
  `);
18177
18209
  const RowNumber = ({
18178
18210
  rowIndex,
@@ -18181,7 +18213,8 @@ const RowNumber = ({
18181
18213
  isLastRow,
18182
18214
  isFirstRow,
18183
18215
  showBorder,
18184
- rowStart
18216
+ rowStart,
18217
+ rowAutoHeight
18185
18218
  }) => {
18186
18219
  const currentRowIndex = rowIndex + rowStart;
18187
18220
  const selectionType = getSelectionType({
@@ -18194,7 +18227,7 @@ const RowNumber = ({
18194
18227
  type: "row"
18195
18228
  });
18196
18229
  const isSelectedTop = (topSelectionType === "selectDirect" || isSelected) && topSelectionType !== selectionType;
18197
- return /* @__PURE__ */ jsx(RowNumberCell, { $rowNumber: rowIndex, $height: rowHeight, children: /* @__PURE__ */ jsx(StyledCell, { $height: rowHeight, $isLastColumn: false, $selectionType: selectionType, $isFirstColumn: true, $type: "header", $isFirstRow: isFirstRow, $isFocused: false, $isLastRow: isLastRow, $isSelectedLeft: isSelected, $isSelectedTop: isSelectedTop, "data-selected": isSelected, "data-grid-row": currentRowIndex, "data-grid-column": -1, "data-testid": `header-cell-${currentRowIndex}-x`, $showBorder: showBorder, "data-align": "right", children: currentRowIndex }) });
18230
+ return /* @__PURE__ */ jsx(RowNumberCell, { $rowNumber: rowIndex, $height: rowHeight, $rowAutoHeight: rowAutoHeight, children: /* @__PURE__ */ jsx(StyledCell, { $height: rowHeight, $isLastColumn: false, $selectionType: selectionType, $isFirstColumn: true, $type: "header", $isFirstRow: isFirstRow, $isFocused: false, $isLastRow: isLastRow, $isSelectedLeft: isSelected, $isSelectedTop: isSelectedTop, $rowAutoHeight: rowAutoHeight, "data-selected": isSelected, "data-grid-row": currentRowIndex, "data-grid-column": -1, "data-testid": `header-cell-${currentRowIndex}-x`, $showBorder: showBorder, "data-align": "right", children: currentRowIndex }) });
18198
18231
  };
18199
18232
  const RowNumberColumn = ({
18200
18233
  minRow,
@@ -18207,11 +18240,12 @@ const RowNumberColumn = ({
18207
18240
  showHeader,
18208
18241
  scrolledHorizontal,
18209
18242
  rowStart = 0,
18210
- showBorder
18243
+ showBorder,
18244
+ rowAutoHeight
18211
18245
  }) => {
18212
- return /* @__PURE__ */ jsx(RowNumberColumnContainer, { $height: headerHeight, $width: rowWidth, $scrolledHorizontal: scrolledHorizontal, children: Array.from({
18246
+ return /* @__PURE__ */ jsx(RowNumberColumnContainer, { $height: headerHeight, $width: rowWidth, $scrolledHorizontal: scrolledHorizontal, $rowAutoHeight: rowAutoHeight, children: Array.from({
18213
18247
  length: maxRow - minRow + 1
18214
- }, (_, index2) => minRow + index2).map((rowIndex) => /* @__PURE__ */ jsx(RowNumber, { getSelectionType, rowHeight, rowIndex, isLastRow: rowIndex === rowCount, isFirstRow: !showHeader && rowIndex === 0, showBorder, rowStart }, `row-number-${rowIndex}`)) });
18248
+ }, (_, index2) => minRow + index2).map((rowIndex) => /* @__PURE__ */ jsx(RowNumber, { getSelectionType, rowHeight, rowIndex, isLastRow: rowIndex === rowCount, isFirstRow: !showHeader && rowIndex === 0, showBorder, rowStart, rowAutoHeight }, `row-number-${rowIndex}`)) });
18215
18249
  };
18216
18250
  function isObject$a(value) {
18217
18251
  var type = typeof value;
@@ -18593,7 +18627,7 @@ const RowColumnContainer = styled(HeaderCellContainer).withConfig({
18593
18627
  }) => $scrolledHorizontal ? `box-shadow: 0px 0 0px 1px ${theme2.click.grid.header.cell.color.stroke.default};` : "");
18594
18628
  const RowColumn = styled(StyledCell).withConfig({
18595
18629
  componentId: "sc-1oadqc8-4"
18596
- })(["width:100%;text-align:right;"]);
18630
+ })(["width:100%;text-align:right;overflow:hidden;"]);
18597
18631
  const Column = ({
18598
18632
  columnIndex,
18599
18633
  cell,
@@ -19022,7 +19056,9 @@ const Cell = memo(({
19022
19056
  showRowNumber,
19023
19057
  showHeader,
19024
19058
  rowHeight,
19025
- rowStart
19059
+ rowStart,
19060
+ rowAutoHeight,
19061
+ updateRowHeight
19026
19062
  } = data;
19027
19063
  const currentRowIndex = rowIndex + rowStart;
19028
19064
  const {
@@ -19051,7 +19087,19 @@ const Cell = memo(({
19051
19087
  const belowSelectionBorder = (selectionType === "selectDirect" || belowSelection === "selectDirect") && selectionType !== belowSelection;
19052
19088
  const selectionBorderLeft = rightOfSelectionBorder || rightOfFocus || isFocused;
19053
19089
  const selectionBorderTop = belowSelectionBorder || belowFocus || isFocused;
19054
- return /* @__PURE__ */ jsx("div", { style, "data-row": currentRowIndex, "data-column": columnIndex, children: /* @__PURE__ */ jsx(StyledCell, { as: CellData, rowIndex: currentRowIndex, columnIndex, type: "row-cell", "data-selected": isFocused || selectionType === "selectDirect", "data-focused": isFocused, $isSelectedTop: selectionBorderTop, $isSelectedLeft: selectionBorderLeft, $isFocused: isFocused, $isLastRow: rowCount - 1 === rowIndex, $isLastColumn: columnCount - 1 === columnIndex, $isFirstColumn: columnIndex === 0 && !showRowNumber, $isFirstRow: rowIndex === 0 && !showHeader, $selectionType: selectionType, $height: rowHeight, "data-grid-row": currentRowIndex, "data-grid-column": columnIndex, $showBorder: true, ...props }) });
19090
+ const cellRef = useRef(null);
19091
+ useEffect(() => {
19092
+ if (!rowAutoHeight || !cellRef.current) {
19093
+ return;
19094
+ }
19095
+ const height = cellRef.current.getBoundingClientRect().height;
19096
+ updateRowHeight(rowIndex, height);
19097
+ }, [updateRowHeight, rowIndex, rowAutoHeight]);
19098
+ const styleWithHeight = {
19099
+ ...style,
19100
+ height: "auto"
19101
+ };
19102
+ return /* @__PURE__ */ jsx("div", { style: styleWithHeight, "data-row": currentRowIndex, "data-column": columnIndex, ref: cellRef, children: /* @__PURE__ */ jsx(StyledCell, { as: CellData, rowIndex: currentRowIndex, columnIndex, type: "row-cell", "data-selected": isFocused || selectionType === "selectDirect", "data-focused": isFocused, $isSelectedTop: selectionBorderTop, $isSelectedLeft: selectionBorderLeft, $isFocused: isFocused, $isLastRow: rowCount - 1 === rowIndex, $isLastColumn: columnCount - 1 === columnIndex, $isFirstColumn: columnIndex === 0 && !showRowNumber, $isFirstRow: rowIndex === 0 && !showHeader, $selectionType: selectionType, $height: rowHeight, "data-grid-row": currentRowIndex, "data-grid-column": columnIndex, $showBorder: true, $rowAutoHeight: rowAutoHeight, ...props }) });
19055
19103
  }, areEqual);
19056
19104
  var reactDomServerLegacy_browser_production_min = {};
19057
19105
  /**
@@ -33256,6 +33304,7 @@ const Grid = forwardRef(({
33256
33304
  onContextMenu: onContextMenuProp,
33257
33305
  forwardedGridRef,
33258
33306
  onItemsRendered: onItemsRenderedProp,
33307
+ rowAutoHeight,
33259
33308
  ...props
33260
33309
  }, forwardedRef) => {
33261
33310
  const [focus, setFocus] = useState(focusProp ?? {
@@ -33337,6 +33386,29 @@ const Grid = forwardRef(({
33337
33386
  }
33338
33387
  }, [onSelectProp]);
33339
33388
  const resizingState = useResizingState();
33389
+ const [rowHeights, setRowHeights] = useState({});
33390
+ const getRowHeight2 = useCallback((index2) => {
33391
+ if (rowAutoHeight && rowHeights[index2] !== void 0) {
33392
+ return rowHeights[index2] + rowHeight;
33393
+ }
33394
+ return rowHeight;
33395
+ }, [rowHeight, rowAutoHeight, rowHeights]);
33396
+ const updateRowHeight = useCallback((rowIndex, height) => {
33397
+ if (!rowAutoHeight) {
33398
+ return;
33399
+ }
33400
+ setRowHeights((prevRowHeights) => {
33401
+ if (height > (prevRowHeights[rowIndex] || 0) && gridRef.current) {
33402
+ const newRowHeights = {
33403
+ ...prevRowHeights,
33404
+ [rowIndex]: height
33405
+ };
33406
+ gridRef.current.resetAfterRowIndex(rowIndex);
33407
+ return newRowHeights;
33408
+ }
33409
+ return prevRowHeights;
33410
+ });
33411
+ }, [rowAutoHeight, gridRef]);
33340
33412
  const onFocusChange = useCallback((row, column) => {
33341
33413
  setFocus((focus2) => ({
33342
33414
  row: row ?? (focusProp == null ? void 0 : focusProp.row) ?? focus2.row,
@@ -33462,7 +33534,10 @@ const Grid = forwardRef(({
33462
33534
  rowHeight,
33463
33535
  headerHeight,
33464
33536
  rowNumberWidth,
33465
- rowStart
33537
+ rowStart,
33538
+ rowAutoHeight,
33539
+ updateRowHeight,
33540
+ getRowHeight: getRowHeight2
33466
33541
  };
33467
33542
  const InnerElementType = forwardRef(({
33468
33543
  children,
@@ -33471,7 +33546,7 @@ const Grid = forwardRef(({
33471
33546
  const [minRow, maxRow, minColumn, maxColumn] = getRenderedCursor(children);
33472
33547
  return /* @__PURE__ */ jsxs(GridContainer, { ...containerProps, className: `sticky-grid__container grid-outer ${props.className ?? ""}`, children: [
33473
33548
  /* @__PURE__ */ jsx(GridDataContainer, { $top: showHeader ? headerHeight : 0, $left: showRowNumber ? rowNumberWidth : 0, ref, children }),
33474
- showRowNumber && /* @__PURE__ */ jsx(RowNumberColumn, { scrolledHorizontal, minRow, maxRow, rowHeight, headerHeight, rowWidth: rowNumberWidth, rowCount, getSelectionType, showHeader, rowStart, showBorder }),
33549
+ showRowNumber && /* @__PURE__ */ jsx(RowNumberColumn, { scrolledHorizontal, minRow, maxRow, rowHeight, headerHeight, rowWidth: rowNumberWidth, rowCount, getSelectionType, showHeader, rowStart, showBorder, rowAutoHeight }),
33475
33550
  showHeader && /* @__PURE__ */ jsx(Header, { scrolledVertical, scrolledHorizontal, showRowNumber, minColumn, maxColumn, height: headerHeight, getColumnWidth: columnWidth, cell, rowNumberWidth, getSelectionType, columnCount, onColumnResize, getColumnHorizontalPosition, getResizerPosition, showBorder, resizingState })
33476
33551
  ] });
33477
33552
  });
@@ -33724,11 +33799,16 @@ const Grid = forwardRef(({
33724
33799
  const width = columnWidth(args.columnIndex);
33725
33800
  return /* @__PURE__ */ jsx(Cell, { ...args, width });
33726
33801
  };
33802
+ useEffect(() => {
33803
+ if (gridRef.current) {
33804
+ gridRef.current.resetAfterRowIndex(0);
33805
+ }
33806
+ }, [rowCount, columnCount]);
33727
33807
  return /* @__PURE__ */ jsxs(ContextMenu, { modal: false, onOpenChange: setContextMenuOpen, children: [
33728
33808
  /* @__PURE__ */ jsx(ContextMenuTrigger, { as: ContextMenu.Trigger, ref: mergeRefs([forwardedRef, containerRef]), tabIndex: 0, onMouseDown, onMouseMove, onKeyDown, onPointerDown, onPointerUp, onPointerLeave: setPointerCapture, onPointerEnter: setPointerCapture, onContextMenu, $rounded: rounded, $height: autoHeight ? rowCount * rowHeight + (showHeader ? headerHeight : 0) + elementBorderRef.current.scrollBarHeight : void 0, $showBorder: showBorder, children: /* @__PURE__ */ jsx(AutoSizer, { onResize, children: ({
33729
33809
  height,
33730
33810
  width
33731
- }) => /* @__PURE__ */ jsx(VariableSizeGrid, { ref: forwardedGridRef ? mergeRefs([forwardedGridRef, gridRef]) : gridRef, height, width, columnCount, rowHeight: () => rowHeight, useIsScrolling, innerElementType: InnerElementType, itemData: data, initialScrollTop: focus.row < rowStart ? focus.row * rowHeight : (focus.row - rowStart) * rowHeight, initialScrollLeft: getColumnHorizontalPosition(focus.column), columnWidth, rowCount, onScroll, outerRef, outerElementType: OuterElementType, onItemsRendered, ...props, children: CellWithWidth }) }) }),
33811
+ }) => /* @__PURE__ */ jsx(VariableSizeGrid, { ref: forwardedGridRef ? mergeRefs([forwardedGridRef, gridRef]) : gridRef, height, width, columnCount, rowHeight: getRowHeight2, useIsScrolling, innerElementType: InnerElementType, itemData: data, initialScrollTop: focus.row < rowStart ? focus.row * rowHeight : (focus.row - rowStart) * rowHeight, initialScrollLeft: getColumnHorizontalPosition(focus.column), columnWidth, rowCount, onScroll, outerRef, outerElementType: OuterElementType, onItemsRendered, ...props, children: CellWithWidth }) }) }),
33732
33812
  /* @__PURE__ */ jsx(ContextMenu.Content, { children: menuOptions.map((option2, index2) => /* @__PURE__ */ jsx(ContextMenu.Item, { onSelect: option2.onSelect, children: option2.label }, `grid-${index2}`)) })
33733
33813
  ] });
33734
33814
  });
@@ -39393,7 +39473,8 @@ const SwitchRoot = styled($6be4966fd9bbc698$export$be92b6f5f03c0fe9).withConfig(
39393
39473
  border: vars.border,
39394
39474
  borderRadius: props.theme.click.switch.radii.all,
39395
39475
  position: "relative",
39396
- padding: 0
39476
+ padding: 0,
39477
+ cursor: props.disabled ? "not-allowed" : "pointer"
39397
39478
  };
39398
39479
  });
39399
39480
  const SwitchThumb = styled($6be4966fd9bbc698$export$6521433ed15a34db).withConfig({
@@ -44714,7 +44795,8 @@ const click$2 = {
44714
44795
  "default": "#323232"
44715
44796
  },
44716
44797
  text: {
44717
- "default": "#ffffff"
44798
+ "default": "#ffffff",
44799
+ disabled: "#808080"
44718
44800
  },
44719
44801
  link: {
44720
44802
  "default": "#FAFF69"
@@ -46485,7 +46567,8 @@ const click$1 = {
46485
46567
  "default": "#e6e7e9"
46486
46568
  },
46487
46569
  text: {
46488
- "default": "#161517"
46570
+ "default": "#161517",
46571
+ disabled: "#a0a0a0"
46489
46572
  },
46490
46573
  link: {
46491
46574
  "default": "#437EEF"
@@ -49349,7 +49432,8 @@ const click = {
49349
49432
  "default": "#e6e7e9"
49350
49433
  },
49351
49434
  text: {
49352
- "default": "#161517"
49435
+ "default": "#161517",
49436
+ disabled: "#a0a0a0"
49353
49437
  },
49354
49438
  link: {
49355
49439
  "default": "#437EEF"
@@ -2658,7 +2658,9 @@ var __publicField = (obj, key, value) => {
2658
2658
  ${disabled ? `
2659
2659
  color: ${theme2.click.field.color.genericLabel.disabled};
2660
2660
  font: ${theme2.click.field.typography.genericLabel.disabled};
2661
+ cursor: not-allowed;
2661
2662
  ` : `
2663
+ cursor: pointer;
2662
2664
  color: ${theme2.click.field.color.genericLabel.default};
2663
2665
  font: ${theme2.click.field.typography.genericLabel.default};
2664
2666
  &:hover {
@@ -7935,11 +7937,9 @@ var __publicField = (obj, key, value) => {
7935
7937
  Dropdown.Trigger = DropdownTrigger;
7936
7938
  const DropdownMenuContent = styledComponents.styled(GenericMenuPanel).withConfig({
7937
7939
  componentId: "sc-18bhwbw-2"
7938
- })(["min-width:", ";flex-direction:column;z-index:1;overflow-y:auto;max-height:calc( (var(--radix-", "-content-available-height) - 100px) );"], ({
7940
+ })(["min-width:", ";flex-direction:column;z-index:1;overflow-y:auto;"], ({
7939
7941
  theme: theme2
7940
- }) => theme2.click.genericMenu.item.size.minWidth, ({
7941
- $type
7942
- }) => $type);
7942
+ }) => theme2.click.genericMenu.item.size.minWidth);
7943
7943
  const DropdownContent$1 = ({
7944
7944
  sub,
7945
7945
  children,
@@ -7947,7 +7947,7 @@ var __publicField = (obj, key, value) => {
7947
7947
  ...props
7948
7948
  }) => {
7949
7949
  const ContentElement = sub ? $d08ef79370b62062$export$6d4de93b380beddf : $d08ef79370b62062$export$7c6e2c02157bb7d2;
7950
- return /* @__PURE__ */ jsxRuntime.jsx($d08ef79370b62062$export$602eac185826482c, { children: /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuContent, { $type: "dropdown-menu", $showArrow: showArrow, as: ContentElement, sideOffset: 4, loop: true, ...props, children: [
7950
+ return /* @__PURE__ */ jsxRuntime.jsx($d08ef79370b62062$export$602eac185826482c, { children: /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuContent, { $type: "dropdown-menu", $showArrow: showArrow, as: ContentElement, sideOffset: 4, loop: true, collisionPadding: 100, ...props, children: [
7951
7951
  showArrow && /* @__PURE__ */ jsxRuntime.jsx(Arrow$1, { asChild: true, as: $d08ef79370b62062$export$21b07c8f274aebd5, width: 20, height: 10, children: /* @__PURE__ */ jsxRuntime.jsx(PopoverArrow, {}) }),
7952
7952
  children
7953
7953
  ] }) });
@@ -9650,12 +9650,13 @@ var __publicField = (obj, key, value) => {
9650
9650
  theme: theme2,
9651
9651
  $color,
9652
9652
  $isSelected,
9653
+ $isSelectable,
9653
9654
  $disabled
9654
9655
  }) => `
9655
9656
  background: ${theme2.click.card.horizontal[$color].color.background.default};
9656
9657
  color: ${theme2.click.card.horizontal[$color].color.title.default};
9657
9658
  border-radius: ${theme2.click.card.horizontal.radii.all};
9658
- border: 1px solid ${theme2.click.card.horizontal[$color].color.stroke[$isSelected ? "active" : "default"]};
9659
+ border: 1px solid ${theme2.click.card.horizontal[$color].color.stroke[$isSelectable ? $isSelected ? "active" : "hover" : "default"]};
9659
9660
  padding: ${theme2.click.card.horizontal.space.y} ${theme2.click.card.horizontal.space.x};
9660
9661
  gap: ${theme2.click.card.horizontal.space.gap};
9661
9662
  font: ${theme2.click.card.horizontal.typography.title.default};
@@ -9664,24 +9665,24 @@ var __publicField = (obj, key, value) => {
9664
9665
  font: ${theme2.click.card.horizontal.typography.description.default};
9665
9666
  }
9666
9667
  &:hover{
9667
- background-color: ${theme2.click.card.horizontal[$color].color.background.hover};
9668
- color: ${theme2.click.card.horizontal[$color].color.title.hover};
9669
- border: 1px solid ${theme2.click.card.horizontal[$color].color.stroke[$isSelected ? "active" : "hover"]};
9670
- cursor: pointer;
9668
+ background-color: ${theme2.click.card.horizontal[$color].color.background[$isSelectable ? "hover" : "default"]};
9669
+ color: ${theme2.click.card.horizontal[$color].color.title[$isSelectable ? "hover" : "default"]};
9670
+ border: 1px solid ${theme2.click.card.horizontal[$color].color.stroke[$isSelectable ? $isSelected ? "active" : "default" : "default"]};
9671
+ cursor: ${$isSelectable ? "pointer" : "default"};
9671
9672
  font: ${theme2.click.card.horizontal.typography.title.hover};
9672
9673
  ${Description} {
9673
- color: ${theme2.click.card.horizontal[$color].color.description.hover};
9674
- font: ${theme2.click.card.horizontal.typography.description.hover};
9674
+ color: ${theme2.click.card.horizontal[$color].color.description[$isSelectable ? "hover" : "default"]};
9675
+ font: ${theme2.click.card.horizontal.typography.description[$isSelectable ? "hover" : "default"]};
9675
9676
  }
9676
9677
  }
9677
9678
 
9678
9679
  &:active, &:focus, &:focus-within {
9679
- background-color: ${theme2.click.card.horizontal[$color].color.background.active};
9680
- color: ${theme2.click.card.horizontal[$color].color.title.active};
9681
- border: 1px solid ${theme2.click.card.horizontal[$color].color.stroke.active};
9680
+ background-color: ${theme2.click.card.horizontal[$color].color.background[$isSelectable ? "active" : "default"]};
9681
+ color: ${theme2.click.card.horizontal[$color].color.title[$isSelectable ? "active" : "default"]};
9682
+ border: 1px solid ${theme2.click.card.horizontal[$color].color.stroke[$isSelectable ? "active" : "default"]};
9682
9683
  ${Description} {
9683
- color: ${theme2.click.card.horizontal[$color].color.description.active};
9684
- font: ${theme2.click.card.horizontal.typography.description.active};
9684
+ color: ${theme2.click.card.horizontal[$color].color.description[$isSelectable ? "active" : "default"]};
9685
+ font: ${theme2.click.card.horizontal.typography.description[$isSelectable ? "active" : "default"]};
9685
9686
  }
9686
9687
  }
9687
9688
  ${$disabled ? `
@@ -9713,32 +9714,56 @@ var __publicField = (obj, key, value) => {
9713
9714
  `);
9714
9715
  const ContentWrapper = styledComponents.styled.div.withConfig({
9715
9716
  componentId: "sc-1qnbjoa-4"
9716
- })(["display:flex;flex-direction:column;width:100%;"]);
9717
+ })(["display:flex;flex-direction:row;width:100%;gap:", ";@media (max-width:", "){flex-direction:column;}"], ({
9718
+ theme: theme2
9719
+ }) => theme2.click.card.horizontal.space.gap, ({
9720
+ theme: theme2
9721
+ }) => theme2.breakpoint.sizes.md);
9722
+ const IconTextContentWrapper = styledComponents.styled.div.withConfig({
9723
+ componentId: "sc-1qnbjoa-5"
9724
+ })(["display:flex;flex-direction:row;align-items:center;width:100%;gap:", ";"], ({
9725
+ theme: theme2
9726
+ }) => theme2.click.card.horizontal.space.gap);
9717
9727
  const CardHorizontal = ({
9718
9728
  title,
9719
9729
  icon,
9720
9730
  description,
9721
9731
  disabled = false,
9732
+ infoText,
9733
+ infoUrl,
9722
9734
  isSelected,
9735
+ isSelectable = infoText ? false : true,
9723
9736
  children,
9724
9737
  color = "default",
9725
9738
  badgeText,
9726
9739
  badgeState,
9727
9740
  badgeIcon,
9728
9741
  badgeIconDir,
9742
+ onButtonClick,
9729
9743
  ...props
9730
9744
  }) => {
9731
- return /* @__PURE__ */ jsxRuntime.jsxs(Wrapper$a, { $disabled: disabled, $isSelected: isSelected, $color: color, tabIndex: 0, ...props, children: [
9732
- icon && /* @__PURE__ */ jsxRuntime.jsx(CardIcon$1, { name: icon, "aria-hidden": true }),
9733
- /* @__PURE__ */ jsxRuntime.jsxs(ContentWrapper, { children: [
9734
- title && /* @__PURE__ */ jsxRuntime.jsxs(Header$4, { as: Container, isResponsive: false, gap: "xs", justifyContent: "space-between", fillWidth: true, children: [
9735
- /* @__PURE__ */ jsxRuntime.jsx(Container, { orientation: "horizontal", gap: "xs", isResponsive: false, fillWidth: false, grow: "1", children: title }),
9736
- badgeText && /* @__PURE__ */ jsxRuntime.jsx(Container, { isResponsive: false, justifyContent: "end", fillWidth: false, "data-testid": "horizontal-card-badge", children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { text: badgeText, size: "md", state: badgeState, icon: badgeIcon, iconDir: badgeIconDir }) })
9737
- ] }),
9738
- description && /* @__PURE__ */ jsxRuntime.jsx(Description, { children: description }),
9739
- children && /* @__PURE__ */ jsxRuntime.jsx(Description, { children })
9740
- ] })
9741
- ] });
9745
+ const handleClick = (e) => {
9746
+ if (typeof onButtonClick === "function") {
9747
+ onButtonClick(e);
9748
+ }
9749
+ if (infoUrl && infoUrl.length > 0) {
9750
+ window.open(infoUrl, "_blank");
9751
+ }
9752
+ };
9753
+ return /* @__PURE__ */ jsxRuntime.jsx(Wrapper$a, { $disabled: disabled, $isSelected: isSelected, $isSelectable: isSelectable, $color: color, tabIndex: 0, onClick: handleClick, ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(ContentWrapper, { children: [
9754
+ /* @__PURE__ */ jsxRuntime.jsxs(IconTextContentWrapper, { children: [
9755
+ icon && /* @__PURE__ */ jsxRuntime.jsx(CardIcon$1, { name: icon, "aria-hidden": true }),
9756
+ /* @__PURE__ */ jsxRuntime.jsxs(Container, { padding: "none", orientation: "vertical", children: [
9757
+ title && /* @__PURE__ */ jsxRuntime.jsxs(Header$4, { as: Container, isResponsive: false, gap: "xs", justifyContent: "space-between", fillWidth: true, children: [
9758
+ /* @__PURE__ */ jsxRuntime.jsx(Container, { orientation: "horizontal", gap: "xs", isResponsive: false, fillWidth: false, grow: "1", children: title }),
9759
+ badgeText && /* @__PURE__ */ jsxRuntime.jsx(Container, { isResponsive: false, justifyContent: "end", fillWidth: false, "data-testid": "horizontal-card-badge", children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { text: badgeText, size: "md", state: badgeState, icon: badgeIcon, iconDir: badgeIconDir }) })
9760
+ ] }),
9761
+ description && /* @__PURE__ */ jsxRuntime.jsx(Description, { children: description }),
9762
+ children && /* @__PURE__ */ jsxRuntime.jsx(Description, { children })
9763
+ ] })
9764
+ ] }),
9765
+ infoText && /* @__PURE__ */ jsxRuntime.jsx(Container, { justifyContent: "end", fillWidth: false, "data-testid": "horizontal-card-button", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { label: infoText, onClick: handleClick, fillWidth: true }) })
9766
+ ] }) });
9742
9767
  };
9743
9768
  const Title$2 = React.forwardRef(({
9744
9769
  align,
@@ -18122,9 +18147,12 @@ var __publicField = (obj, key, value) => {
18122
18147
  $selectionType,
18123
18148
  $height,
18124
18149
  $type = "body",
18125
- $showBorder
18150
+ $showBorder,
18151
+ $rowAutoHeight
18126
18152
  }) => `
18127
- height: ${$height}px;
18153
+ height: ${$rowAutoHeight ? "100%" : `${$height}px`};
18154
+ min-height: ${$rowAutoHeight ? "auto" : ""};
18155
+ overflow-y: ${$rowAutoHeight ? "auto" : ""};
18128
18156
  background: ${theme2.click.grid[$type].cell.color.background[$selectionType]};
18129
18157
  color: ${$type === "header" ? theme2.click.grid.header.cell.color.title[$selectionType] : theme2.click.grid.body.cell.color.text[$selectionType]};
18130
18158
  font: ${theme2.click.grid.cell.text.default};
@@ -18145,6 +18173,7 @@ var __publicField = (obj, key, value) => {
18145
18173
  ${$isLastColumn ? `
18146
18174
  border-right-color: ${theme2.click.grid[$type].cell.color.stroke[$isFocused ? "selectDirect" : $selectionType]};
18147
18175
  ` : "border-right: none;"}
18176
+ ${$rowAutoHeight && "border: none;"}
18148
18177
  `, ({
18149
18178
  theme: theme2,
18150
18179
  $isLastRow,
@@ -18152,8 +18181,9 @@ var __publicField = (obj, key, value) => {
18152
18181
  $selectionType,
18153
18182
  $type = "body",
18154
18183
  $isSelectedTop,
18155
- $isSelectedLeft
18156
- }) => $isSelectedTop || $isSelectedLeft || $selectionType === "selectDirect" && ($isLastRow || $isLastColumn) ? `
18184
+ $isSelectedLeft,
18185
+ $rowAutoHeight
18186
+ }) => $isSelectedTop || $isSelectedLeft || $selectionType === "selectDirect" && ($isLastRow || $isLastColumn) || $rowAutoHeight ? `
18157
18187
  &::before {
18158
18188
  content: "";
18159
18189
  position: absolute;
@@ -18165,6 +18195,7 @@ var __publicField = (obj, key, value) => {
18165
18195
  ${$isSelectedLeft ? `border-left: 1px solid ${theme2.click.grid[$type].cell.color.stroke.selectDirect};` : ""}
18166
18196
  ${$selectionType === "selectDirect" && $isLastRow ? `border-bottom: 1px solid ${theme2.click.grid[$type].cell.color.stroke.selectDirect};` : ""}
18167
18197
  ${$selectionType === "selectDirect" && $isLastColumn ? `border-right: 1px solid ${theme2.click.grid[$type].cell.color.stroke.selectDirect};` : ""}
18198
+ ${$rowAutoHeight && "border: none;"}
18168
18199
  }
18169
18200
  ` : "");
18170
18201
  const RowNumberColumnContainer = styledComponents.styled.div.withConfig({
@@ -18184,10 +18215,11 @@ var __publicField = (obj, key, value) => {
18184
18215
  componentId: "sc-7gbi4d-1"
18185
18216
  })(["position:absolute;left:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;", ""], ({
18186
18217
  $height,
18187
- $rowNumber
18218
+ $rowNumber,
18219
+ $rowAutoHeight
18188
18220
  }) => `
18189
18221
  top: ${$height * $rowNumber}px;
18190
- height: ${$height}px;
18222
+ height: ${$rowAutoHeight ? "100%" : `${$height}px`};
18191
18223
  `);
18192
18224
  const RowNumber = ({
18193
18225
  rowIndex,
@@ -18196,7 +18228,8 @@ var __publicField = (obj, key, value) => {
18196
18228
  isLastRow,
18197
18229
  isFirstRow,
18198
18230
  showBorder,
18199
- rowStart
18231
+ rowStart,
18232
+ rowAutoHeight
18200
18233
  }) => {
18201
18234
  const currentRowIndex = rowIndex + rowStart;
18202
18235
  const selectionType = getSelectionType({
@@ -18209,7 +18242,7 @@ var __publicField = (obj, key, value) => {
18209
18242
  type: "row"
18210
18243
  });
18211
18244
  const isSelectedTop = (topSelectionType === "selectDirect" || isSelected) && topSelectionType !== selectionType;
18212
- return /* @__PURE__ */ jsxRuntime.jsx(RowNumberCell, { $rowNumber: rowIndex, $height: rowHeight, children: /* @__PURE__ */ jsxRuntime.jsx(StyledCell, { $height: rowHeight, $isLastColumn: false, $selectionType: selectionType, $isFirstColumn: true, $type: "header", $isFirstRow: isFirstRow, $isFocused: false, $isLastRow: isLastRow, $isSelectedLeft: isSelected, $isSelectedTop: isSelectedTop, "data-selected": isSelected, "data-grid-row": currentRowIndex, "data-grid-column": -1, "data-testid": `header-cell-${currentRowIndex}-x`, $showBorder: showBorder, "data-align": "right", children: currentRowIndex }) });
18245
+ return /* @__PURE__ */ jsxRuntime.jsx(RowNumberCell, { $rowNumber: rowIndex, $height: rowHeight, $rowAutoHeight: rowAutoHeight, children: /* @__PURE__ */ jsxRuntime.jsx(StyledCell, { $height: rowHeight, $isLastColumn: false, $selectionType: selectionType, $isFirstColumn: true, $type: "header", $isFirstRow: isFirstRow, $isFocused: false, $isLastRow: isLastRow, $isSelectedLeft: isSelected, $isSelectedTop: isSelectedTop, $rowAutoHeight: rowAutoHeight, "data-selected": isSelected, "data-grid-row": currentRowIndex, "data-grid-column": -1, "data-testid": `header-cell-${currentRowIndex}-x`, $showBorder: showBorder, "data-align": "right", children: currentRowIndex }) });
18213
18246
  };
18214
18247
  const RowNumberColumn = ({
18215
18248
  minRow,
@@ -18222,11 +18255,12 @@ var __publicField = (obj, key, value) => {
18222
18255
  showHeader,
18223
18256
  scrolledHorizontal,
18224
18257
  rowStart = 0,
18225
- showBorder
18258
+ showBorder,
18259
+ rowAutoHeight
18226
18260
  }) => {
18227
- return /* @__PURE__ */ jsxRuntime.jsx(RowNumberColumnContainer, { $height: headerHeight, $width: rowWidth, $scrolledHorizontal: scrolledHorizontal, children: Array.from({
18261
+ return /* @__PURE__ */ jsxRuntime.jsx(RowNumberColumnContainer, { $height: headerHeight, $width: rowWidth, $scrolledHorizontal: scrolledHorizontal, $rowAutoHeight: rowAutoHeight, children: Array.from({
18228
18262
  length: maxRow - minRow + 1
18229
- }, (_, index2) => minRow + index2).map((rowIndex) => /* @__PURE__ */ jsxRuntime.jsx(RowNumber, { getSelectionType, rowHeight, rowIndex, isLastRow: rowIndex === rowCount, isFirstRow: !showHeader && rowIndex === 0, showBorder, rowStart }, `row-number-${rowIndex}`)) });
18263
+ }, (_, index2) => minRow + index2).map((rowIndex) => /* @__PURE__ */ jsxRuntime.jsx(RowNumber, { getSelectionType, rowHeight, rowIndex, isLastRow: rowIndex === rowCount, isFirstRow: !showHeader && rowIndex === 0, showBorder, rowStart, rowAutoHeight }, `row-number-${rowIndex}`)) });
18230
18264
  };
18231
18265
  function isObject$a(value) {
18232
18266
  var type = typeof value;
@@ -18608,7 +18642,7 @@ var __publicField = (obj, key, value) => {
18608
18642
  }) => $scrolledHorizontal ? `box-shadow: 0px 0 0px 1px ${theme2.click.grid.header.cell.color.stroke.default};` : "");
18609
18643
  const RowColumn = styledComponents.styled(StyledCell).withConfig({
18610
18644
  componentId: "sc-1oadqc8-4"
18611
- })(["width:100%;text-align:right;"]);
18645
+ })(["width:100%;text-align:right;overflow:hidden;"]);
18612
18646
  const Column = ({
18613
18647
  columnIndex,
18614
18648
  cell,
@@ -19037,7 +19071,9 @@ var __publicField = (obj, key, value) => {
19037
19071
  showRowNumber,
19038
19072
  showHeader,
19039
19073
  rowHeight,
19040
- rowStart
19074
+ rowStart,
19075
+ rowAutoHeight,
19076
+ updateRowHeight
19041
19077
  } = data;
19042
19078
  const currentRowIndex = rowIndex + rowStart;
19043
19079
  const {
@@ -19066,7 +19102,19 @@ var __publicField = (obj, key, value) => {
19066
19102
  const belowSelectionBorder = (selectionType === "selectDirect" || belowSelection === "selectDirect") && selectionType !== belowSelection;
19067
19103
  const selectionBorderLeft = rightOfSelectionBorder || rightOfFocus || isFocused;
19068
19104
  const selectionBorderTop = belowSelectionBorder || belowFocus || isFocused;
19069
- return /* @__PURE__ */ jsxRuntime.jsx("div", { style, "data-row": currentRowIndex, "data-column": columnIndex, children: /* @__PURE__ */ jsxRuntime.jsx(StyledCell, { as: CellData, rowIndex: currentRowIndex, columnIndex, type: "row-cell", "data-selected": isFocused || selectionType === "selectDirect", "data-focused": isFocused, $isSelectedTop: selectionBorderTop, $isSelectedLeft: selectionBorderLeft, $isFocused: isFocused, $isLastRow: rowCount - 1 === rowIndex, $isLastColumn: columnCount - 1 === columnIndex, $isFirstColumn: columnIndex === 0 && !showRowNumber, $isFirstRow: rowIndex === 0 && !showHeader, $selectionType: selectionType, $height: rowHeight, "data-grid-row": currentRowIndex, "data-grid-column": columnIndex, $showBorder: true, ...props }) });
19105
+ const cellRef = React.useRef(null);
19106
+ React.useEffect(() => {
19107
+ if (!rowAutoHeight || !cellRef.current) {
19108
+ return;
19109
+ }
19110
+ const height = cellRef.current.getBoundingClientRect().height;
19111
+ updateRowHeight(rowIndex, height);
19112
+ }, [updateRowHeight, rowIndex, rowAutoHeight]);
19113
+ const styleWithHeight = {
19114
+ ...style,
19115
+ height: "auto"
19116
+ };
19117
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { style: styleWithHeight, "data-row": currentRowIndex, "data-column": columnIndex, ref: cellRef, children: /* @__PURE__ */ jsxRuntime.jsx(StyledCell, { as: CellData, rowIndex: currentRowIndex, columnIndex, type: "row-cell", "data-selected": isFocused || selectionType === "selectDirect", "data-focused": isFocused, $isSelectedTop: selectionBorderTop, $isSelectedLeft: selectionBorderLeft, $isFocused: isFocused, $isLastRow: rowCount - 1 === rowIndex, $isLastColumn: columnCount - 1 === columnIndex, $isFirstColumn: columnIndex === 0 && !showRowNumber, $isFirstRow: rowIndex === 0 && !showHeader, $selectionType: selectionType, $height: rowHeight, "data-grid-row": currentRowIndex, "data-grid-column": columnIndex, $showBorder: true, $rowAutoHeight: rowAutoHeight, ...props }) });
19070
19118
  }, areEqual);
19071
19119
  var reactDomServerLegacy_browser_production_min = {};
19072
19120
  /**
@@ -33271,6 +33319,7 @@ var __publicField = (obj, key, value) => {
33271
33319
  onContextMenu: onContextMenuProp,
33272
33320
  forwardedGridRef,
33273
33321
  onItemsRendered: onItemsRenderedProp,
33322
+ rowAutoHeight,
33274
33323
  ...props
33275
33324
  }, forwardedRef) => {
33276
33325
  const [focus, setFocus] = React.useState(focusProp ?? {
@@ -33352,6 +33401,29 @@ var __publicField = (obj, key, value) => {
33352
33401
  }
33353
33402
  }, [onSelectProp]);
33354
33403
  const resizingState = useResizingState();
33404
+ const [rowHeights, setRowHeights] = React.useState({});
33405
+ const getRowHeight = React.useCallback((index2) => {
33406
+ if (rowAutoHeight && rowHeights[index2] !== void 0) {
33407
+ return rowHeights[index2] + rowHeight;
33408
+ }
33409
+ return rowHeight;
33410
+ }, [rowHeight, rowAutoHeight, rowHeights]);
33411
+ const updateRowHeight = React.useCallback((rowIndex, height) => {
33412
+ if (!rowAutoHeight) {
33413
+ return;
33414
+ }
33415
+ setRowHeights((prevRowHeights) => {
33416
+ if (height > (prevRowHeights[rowIndex] || 0) && gridRef.current) {
33417
+ const newRowHeights = {
33418
+ ...prevRowHeights,
33419
+ [rowIndex]: height
33420
+ };
33421
+ gridRef.current.resetAfterRowIndex(rowIndex);
33422
+ return newRowHeights;
33423
+ }
33424
+ return prevRowHeights;
33425
+ });
33426
+ }, [rowAutoHeight, gridRef]);
33355
33427
  const onFocusChange = React.useCallback((row, column) => {
33356
33428
  setFocus((focus2) => ({
33357
33429
  row: row ?? (focusProp == null ? void 0 : focusProp.row) ?? focus2.row,
@@ -33477,7 +33549,10 @@ var __publicField = (obj, key, value) => {
33477
33549
  rowHeight,
33478
33550
  headerHeight,
33479
33551
  rowNumberWidth,
33480
- rowStart
33552
+ rowStart,
33553
+ rowAutoHeight,
33554
+ updateRowHeight,
33555
+ getRowHeight
33481
33556
  };
33482
33557
  const InnerElementType = React.forwardRef(({
33483
33558
  children,
@@ -33486,7 +33561,7 @@ var __publicField = (obj, key, value) => {
33486
33561
  const [minRow, maxRow, minColumn, maxColumn] = getRenderedCursor(children);
33487
33562
  return /* @__PURE__ */ jsxRuntime.jsxs(GridContainer, { ...containerProps, className: `sticky-grid__container grid-outer ${props.className ?? ""}`, children: [
33488
33563
  /* @__PURE__ */ jsxRuntime.jsx(GridDataContainer, { $top: showHeader ? headerHeight : 0, $left: showRowNumber ? rowNumberWidth : 0, ref, children }),
33489
- showRowNumber && /* @__PURE__ */ jsxRuntime.jsx(RowNumberColumn, { scrolledHorizontal, minRow, maxRow, rowHeight, headerHeight, rowWidth: rowNumberWidth, rowCount, getSelectionType, showHeader, rowStart, showBorder }),
33564
+ showRowNumber && /* @__PURE__ */ jsxRuntime.jsx(RowNumberColumn, { scrolledHorizontal, minRow, maxRow, rowHeight, headerHeight, rowWidth: rowNumberWidth, rowCount, getSelectionType, showHeader, rowStart, showBorder, rowAutoHeight }),
33490
33565
  showHeader && /* @__PURE__ */ jsxRuntime.jsx(Header, { scrolledVertical, scrolledHorizontal, showRowNumber, minColumn, maxColumn, height: headerHeight, getColumnWidth: columnWidth, cell, rowNumberWidth, getSelectionType, columnCount, onColumnResize, getColumnHorizontalPosition, getResizerPosition, showBorder, resizingState })
33491
33566
  ] });
33492
33567
  });
@@ -33739,11 +33814,16 @@ var __publicField = (obj, key, value) => {
33739
33814
  const width = columnWidth(args.columnIndex);
33740
33815
  return /* @__PURE__ */ jsxRuntime.jsx(Cell, { ...args, width });
33741
33816
  };
33817
+ React.useEffect(() => {
33818
+ if (gridRef.current) {
33819
+ gridRef.current.resetAfterRowIndex(0);
33820
+ }
33821
+ }, [rowCount, columnCount]);
33742
33822
  return /* @__PURE__ */ jsxRuntime.jsxs(ContextMenu, { modal: false, onOpenChange: setContextMenuOpen, children: [
33743
33823
  /* @__PURE__ */ jsxRuntime.jsx(ContextMenuTrigger, { as: ContextMenu.Trigger, ref: mergeRefs([forwardedRef, containerRef]), tabIndex: 0, onMouseDown, onMouseMove, onKeyDown, onPointerDown, onPointerUp, onPointerLeave: setPointerCapture, onPointerEnter: setPointerCapture, onContextMenu, $rounded: rounded, $height: autoHeight ? rowCount * rowHeight + (showHeader ? headerHeight : 0) + elementBorderRef.current.scrollBarHeight : void 0, $showBorder: showBorder, children: /* @__PURE__ */ jsxRuntime.jsx(AutoSizer, { onResize, children: ({
33744
33824
  height,
33745
33825
  width
33746
- }) => /* @__PURE__ */ jsxRuntime.jsx(VariableSizeGrid, { ref: forwardedGridRef ? mergeRefs([forwardedGridRef, gridRef]) : gridRef, height, width, columnCount, rowHeight: () => rowHeight, useIsScrolling, innerElementType: InnerElementType, itemData: data, initialScrollTop: focus.row < rowStart ? focus.row * rowHeight : (focus.row - rowStart) * rowHeight, initialScrollLeft: getColumnHorizontalPosition(focus.column), columnWidth, rowCount, onScroll, outerRef, outerElementType: OuterElementType, onItemsRendered, ...props, children: CellWithWidth }) }) }),
33826
+ }) => /* @__PURE__ */ jsxRuntime.jsx(VariableSizeGrid, { ref: forwardedGridRef ? mergeRefs([forwardedGridRef, gridRef]) : gridRef, height, width, columnCount, rowHeight: getRowHeight, useIsScrolling, innerElementType: InnerElementType, itemData: data, initialScrollTop: focus.row < rowStart ? focus.row * rowHeight : (focus.row - rowStart) * rowHeight, initialScrollLeft: getColumnHorizontalPosition(focus.column), columnWidth, rowCount, onScroll, outerRef, outerElementType: OuterElementType, onItemsRendered, ...props, children: CellWithWidth }) }) }),
33747
33827
  /* @__PURE__ */ jsxRuntime.jsx(ContextMenu.Content, { children: menuOptions.map((option, index2) => /* @__PURE__ */ jsxRuntime.jsx(ContextMenu.Item, { onSelect: option.onSelect, children: option.label }, `grid-${index2}`)) })
33748
33828
  ] });
33749
33829
  });
@@ -39408,7 +39488,8 @@ Defaulting to \`${$89eedd556c436f6a$var$DEFAULT_ORIENTATION}\`.`;
39408
39488
  border: vars.border,
39409
39489
  borderRadius: props.theme.click.switch.radii.all,
39410
39490
  position: "relative",
39411
- padding: 0
39491
+ padding: 0,
39492
+ cursor: props.disabled ? "not-allowed" : "pointer"
39412
39493
  };
39413
39494
  });
39414
39495
  const SwitchThumb = styledComponents.styled($6be4966fd9bbc698$export$6521433ed15a34db).withConfig({
@@ -44729,7 +44810,8 @@ Defaulting to \`${$89eedd556c436f6a$var$DEFAULT_ORIENTATION}\`.`;
44729
44810
  "default": "#323232"
44730
44811
  },
44731
44812
  text: {
44732
- "default": "#ffffff"
44813
+ "default": "#ffffff",
44814
+ disabled: "#808080"
44733
44815
  },
44734
44816
  link: {
44735
44817
  "default": "#FAFF69"
@@ -46500,7 +46582,8 @@ Defaulting to \`${$89eedd556c436f6a$var$DEFAULT_ORIENTATION}\`.`;
46500
46582
  "default": "#e6e7e9"
46501
46583
  },
46502
46584
  text: {
46503
- "default": "#161517"
46585
+ "default": "#161517",
46586
+ disabled: "#a0a0a0"
46504
46587
  },
46505
46588
  link: {
46506
46589
  "default": "#437EEF"
@@ -49364,7 +49447,8 @@ Defaulting to \`${$89eedd556c436f6a$var$DEFAULT_ORIENTATION}\`.`;
49364
49447
  "default": "#e6e7e9"
49365
49448
  },
49366
49449
  text: {
49367
- "default": "#161517"
49450
+ "default": "#161517",
49451
+ disabled: "#a0a0a0"
49368
49452
  },
49369
49453
  link: {
49370
49454
  "default": "#437EEF"
@@ -1,4 +1,4 @@
1
- import { HTMLAttributes, ReactNode } from 'react';
1
+ import { HTMLAttributes, MouseEventHandler, ReactNode } from 'react';
2
2
  import { BadgeState, HorizontalDirection, IconName } from '..';
3
3
 
4
4
  type CardColor = "default" | "muted";
@@ -7,13 +7,17 @@ export interface CardHorizontalProps extends Omit<HTMLAttributes<HTMLDivElement>
7
7
  icon?: IconName;
8
8
  disabled?: boolean;
9
9
  description?: ReactNode;
10
+ infoUrl?: string;
11
+ infoText?: string;
10
12
  isSelected?: boolean;
13
+ isSelectable?: boolean;
11
14
  children?: ReactNode;
12
15
  color?: CardColor;
13
16
  badgeText?: string;
14
17
  badgeState?: BadgeState;
15
18
  badgeIcon?: IconName;
16
19
  badgeIconDir?: HorizontalDirection;
20
+ onButtonClick?: MouseEventHandler<HTMLElement>;
17
21
  }
18
- export declare const CardHorizontal: ({ title, icon, description, disabled, isSelected, children, color, badgeText, badgeState, badgeIcon, badgeIconDir, ...props }: CardHorizontalProps) => import("react/jsx-runtime").JSX.Element;
22
+ export declare const CardHorizontal: ({ title, icon, description, disabled, infoText, infoUrl, isSelected, isSelectable, children, color, badgeText, badgeState, badgeIcon, badgeIconDir, onButtonClick, ...props }: CardHorizontalProps) => import("react/jsx-runtime").JSX.Element;
19
23
  export {};
@@ -12,6 +12,7 @@ interface RowNumberColumnProps {
12
12
  scrolledHorizontal: boolean;
13
13
  rowStart: number;
14
14
  showBorder: boolean;
15
+ rowAutoHeight?: boolean;
15
16
  }
16
- declare const RowNumberColumn: ({ minRow, maxRow, rowHeight, headerHeight, rowWidth, getSelectionType, rowCount, showHeader, scrolledHorizontal, rowStart, showBorder, }: RowNumberColumnProps) => import("react/jsx-runtime").JSX.Element;
17
+ declare const RowNumberColumn: ({ minRow, maxRow, rowHeight, headerHeight, rowWidth, getSelectionType, rowCount, showHeader, scrolledHorizontal, rowStart, showBorder, rowAutoHeight, }: RowNumberColumnProps) => import("react/jsx-runtime").JSX.Element;
17
18
  export default RowNumberColumn;
@@ -12,4 +12,5 @@ export declare const StyledCell: import('styled-components/dist/types').IStyledC
12
12
  $height: number;
13
13
  $type?: "body" | "header";
14
14
  $showBorder: boolean;
15
+ $rowAutoHeight?: boolean;
15
16
  }>> & string;
@@ -107,6 +107,9 @@ export interface ItemDataType {
107
107
  headerHeight: number;
108
108
  rowNumberWidth: number;
109
109
  rowStart: number;
110
+ rowAutoHeight?: boolean;
111
+ updateRowHeight: (rowIndex: number, height: number) => void;
112
+ getRowHeight: (index: number) => number;
110
113
  }
111
114
  export interface GridContextMenuItemProps extends Omit<ContextMenuItemProps, "children"> {
112
115
  label: ReactNode;
@@ -137,6 +140,7 @@ export interface GridProps extends Omit<VariableSizeGridProps, "height" | "width
137
140
  onCopyCallback?: (copied: boolean) => void;
138
141
  onContextMenu?: MouseEventHandler<HTMLDivElement>;
139
142
  forwardedGridRef?: MutableRefObject<VariableSizeGrid>;
143
+ rowAutoHeight?: boolean;
140
144
  }
141
145
  export type ResizerPosition = {
142
146
  left: string;
@@ -2389,6 +2389,7 @@ export interface Theme {
2389
2389
  };
2390
2390
  text: {
2391
2391
  default: string;
2392
+ disabled: string;
2392
2393
  };
2393
2394
  link: {
2394
2395
  default: string;
@@ -1303,7 +1303,8 @@ declare const _default: {
1303
1303
  "default": "#323232"
1304
1304
  },
1305
1305
  "text": {
1306
- "default": "#ffffff"
1306
+ "default": "#ffffff",
1307
+ "disabled": "#808080"
1307
1308
  },
1308
1309
  "link": {
1309
1310
  "default": "#FAFF69"
@@ -2388,7 +2388,8 @@ declare const _default: {
2388
2388
  "default": "#e6e7e9"
2389
2389
  },
2390
2390
  "text": {
2391
- "default": "#161517"
2391
+ "default": "#161517",
2392
+ "disabled": "#a0a0a0"
2392
2393
  },
2393
2394
  "link": {
2394
2395
  "default": "#437EEF"
@@ -1293,7 +1293,8 @@ declare const _default: {
1293
1293
  "default": "#e6e7e9"
1294
1294
  },
1295
1295
  "text": {
1296
- "default": "#161517"
1296
+ "default": "#161517",
1297
+ "disabled": "#a0a0a0"
1297
1298
  },
1298
1299
  "link": {
1299
1300
  "default": "#437EEF"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clickhouse/click-ui",
3
- "version": "0.0.197",
3
+ "version": "0.0.198",
4
4
  "description": "Official ClickHouse design system react library",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",