@vention/machine-ui 3.46.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -9404,7 +9404,8 @@ const VentionCollapsibleCaretButton = ({
9404
9404
  component: "div",
9405
9405
  className: classes.root,
9406
9406
  onClick: onClick,
9407
- "data-testid": dataTestid ? `${dataTestid}-collapse-button` : "collapsibleCaretButton",
9407
+ "data-testid": dataTestid,
9408
+ "aria-expanded": isExpanded,
9408
9409
  children: jsx(IconCaretRightFilled, {
9409
9410
  size: 16
9410
9411
  })
@@ -9512,12 +9513,14 @@ const VentionTreeItem = /*#__PURE__*/forwardRef((inputProps, ref) => {
9512
9513
  onClick === null || onClick === void 0 ? void 0 : onClick(event);
9513
9514
  };
9514
9515
  const isCaretVisible = Children.count(children) > 0;
9516
+ const testId = dataTestid !== null && dataTestid !== void 0 ? dataTestid : "vention-tree-item";
9515
9517
  return jsxs("div", {
9516
9518
  className: classes.root,
9517
9519
  onClick: handleOnClick,
9518
9520
  ref: ref,
9519
9521
  children: [jsxs("div", {
9520
- "data-testid": "mainContent",
9522
+ "aria-selected": isSelected,
9523
+ "data-testid": testId,
9521
9524
  className: classes.mainContent,
9522
9525
  onContextMenu: event => onContextMenu === null || onContextMenu === void 0 ? void 0 : onContextMenu(event),
9523
9526
  onMouseEnter: event => {
@@ -9538,14 +9541,14 @@ const VentionTreeItem = /*#__PURE__*/forwardRef((inputProps, ref) => {
9538
9541
  isVisible: isCaretVisible,
9539
9542
  isExpanded: isExpanded,
9540
9543
  onClick: handleIsExpandedToggle,
9541
- dataTestid: dataTestid
9544
+ dataTestid: `${testId}-collapseButton`
9542
9545
  }), jsx("div", {
9543
- "data-testid": "treeItemIcon",
9546
+ "data-testid": `${testId}-icon`,
9544
9547
  className: classes.iconContainer,
9545
9548
  children: icon
9546
9549
  }), jsx("div", {
9547
9550
  className: classes.labelContainer,
9548
- "data-testid": dataTestid,
9551
+ "data-testid": `${testId}-label`,
9549
9552
  onDoubleClick: handleRenaming,
9550
9553
  children: jsx(Typography, {
9551
9554
  className: classes.label,
@@ -9560,7 +9563,7 @@ const VentionTreeItem = /*#__PURE__*/forwardRef((inputProps, ref) => {
9560
9563
  paddingLeft: theme.spacing(2)
9561
9564
  }
9562
9565
  },
9563
- "data-testid": "tree-item-text-input",
9566
+ "data-testid": `${testId}-textInput`,
9564
9567
  onChange: event => setLabel(event.target.value),
9565
9568
  onBlur: () => handleRename(label),
9566
9569
  onKeyUp: event => {
@@ -9572,10 +9575,10 @@ const VentionTreeItem = /*#__PURE__*/forwardRef((inputProps, ref) => {
9572
9575
  })
9573
9576
  }), hasVisibleTrailingOrActionItems && jsxs("div", {
9574
9577
  className: classes.actionButtonsContainer,
9575
- "data-testid": "actionButtonContainer",
9578
+ "data-testid": `${testId}-contextItems`,
9576
9579
  children: [trailingElements === null || trailingElements === void 0 ? void 0 : trailingElements.map((trailingElement, index) => jsx("div", {
9577
9580
  className: cx(classes.trailingElement, trailingElement.showOnHover && classes.trailingElementShowOnHover),
9578
- "data-testid": `trailingElement-${index}`,
9581
+ "data-testid": `${testId}-trailingElement-${index}`,
9579
9582
  onClick: handleTrailingElementClick,
9580
9583
  children: trailingElement.component
9581
9584
  }, index)), actionButtons === null || actionButtons === void 0 ? void 0 : actionButtons.map((button, index) => {
@@ -9586,7 +9589,7 @@ const VentionTreeItem = /*#__PURE__*/forwardRef((inputProps, ref) => {
9586
9589
  return jsx(VentionIconButton, {
9587
9590
  variant: "shaded",
9588
9591
  className: `${classes.actionButton} ${button.showOnHover ? classes.showOnHover : ""}`,
9589
- "data-testid": `actionButtonContainer-${index}`,
9592
+ "data-testid": `${testId}-actionButton-${index}`,
9590
9593
  onClick: handleButtonOnClick,
9591
9594
  children: button.component
9592
9595
  }, index);
@@ -9594,7 +9597,7 @@ const VentionTreeItem = /*#__PURE__*/forwardRef((inputProps, ref) => {
9594
9597
  })]
9595
9598
  }), captionsRight && captionsRight.length > 0 && jsx("div", {
9596
9599
  className: classes.captionRightContainer,
9597
- "data-testid": "captionRight",
9600
+ "data-testid": `${testId}-captionRightContainer`,
9598
9601
  children: captionsRight.map((caption, index) => jsx("div", {
9599
9602
  className: cx(classes.captionRight, !!caption.onClick && classes.clickableCaptionRight),
9600
9603
  onClick: caption.onClick ? event => {
@@ -9604,7 +9607,7 @@ const VentionTreeItem = /*#__PURE__*/forwardRef((inputProps, ref) => {
9604
9607
  style: {
9605
9608
  color: caption.color
9606
9609
  },
9607
- "data-testid": `captionRight-${index}`,
9610
+ "data-testid": `${testId}-captionRight-${index}`,
9608
9611
  children: jsx(Typography, {
9609
9612
  className: cx(classes.label, classes.captionRightLabel),
9610
9613
  variant: "uiTableNumbers12Reg",
@@ -9624,7 +9627,6 @@ const VentionTreeItem = /*#__PURE__*/forwardRef((inputProps, ref) => {
9624
9627
  });
9625
9628
  });
9626
9629
  const useStyles$a = tss.withParams().withNestedSelectors().create(({
9627
- hasWarning,
9628
9630
  isSelected,
9629
9631
  isExpanded,
9630
9632
  theme,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vention/machine-ui",
3
- "version": "3.46.0",
3
+ "version": "4.0.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/VentionCo/machine-cloud.git"
@@ -6,7 +6,7 @@ interface VentionCollapsibleCaretButtonProps {
6
6
  isExpanded: boolean;
7
7
  isVisible: boolean;
8
8
  onClick: (event: React.MouseEvent<HTMLDivElement>) => void;
9
- dataTestid?: string;
9
+ dataTestid?: string | undefined;
10
10
  }
11
11
  export declare const VentionCollapsibleCaretButton: FC<VentionCollapsibleCaretButtonProps>;
12
12
  export {};