@vention/machine-ui 5.30.10 → 5.30.12

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
@@ -1,6 +1,7 @@
1
1
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
2
  import { Typography, useTheme, Button, Stack, Box as Box$1, Grid, IconButton, ClickAwayListener, Modal, CircularProgress as CircularProgress$1, linearProgressClasses, LinearProgress, Skeleton, InputAdornment, TextField, MenuList, MenuItem, ListItemIcon, ListItemText, Popover, Popper, Radio, FormControlLabel, FormControl, Select, FormHelperText, ButtonGroup, Paper, Card, CardMedia, CardContent, Drawer, Autocomplete, Tooltip, Checkbox } from '@mui/material';
3
3
  import { IconCheck, IconAlertTriangleFilled, IconAlertTriangle, IconExclamationMark, IconExternalLink, IconX, IconInfoCircleFilled, IconCircleCheckFilled, IconChevronUp, IconChevronDown, IconInfoCircle, IconInfoSmall, IconMinus, IconPlus, IconLoader2, IconCaretRightFilled, IconChevronsRight, IconChevronsLeft, IconChevronRight } from '@tabler/icons-react';
4
+ import * as React from 'react';
4
5
  import { lazy, memo, Suspense, forwardRef, useState, cloneElement, useRef, useEffect, useCallback, createContext, useContext, useImperativeHandle, useMemo, Children, Fragment as Fragment$1, useReducer, useLayoutEffect } from 'react';
5
6
  import { tss } from 'tss-react/mui';
6
7
  import Box from '@mui/material/Box';
@@ -1641,9 +1642,19 @@ for (var COLLECTION_NAME in DOMIterables) {
1641
1642
  handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
1642
1643
 
1643
1644
  // utility functions for Machine UI here
1644
- //The following function already exists in shared-utils.ts but that increases bundle size for Machine UI package
1645
+ /**
1646
+ * Replacement for `Component.defaultProps`, which React 19 no longer applies to function components.
1647
+ * Follows React's rule: a default is used when the prop is missing or explicitly `undefined`.
1648
+ * To opt out of a default (e.g. hide a default icon), the component must accept `null` for that prop.
1649
+ */
1645
1650
  function applyDefaultProps(inputProps, defaultProps) {
1646
- return Object.assign(Object.assign({}, defaultProps), inputProps);
1651
+ const resolvedProps = Object.assign({}, inputProps);
1652
+ for (const key of Object.keys(defaultProps)) {
1653
+ if (resolvedProps[key] === undefined) {
1654
+ resolvedProps[key] = defaultProps[key];
1655
+ }
1656
+ }
1657
+ return resolvedProps;
1647
1658
  }
1648
1659
 
1649
1660
  /******************************************************************************
@@ -1988,7 +1999,8 @@ const defaultProps$8 = {
1988
1999
  size: "medium",
1989
2000
  colored: false
1990
2001
  };
1991
- const VentionSpinner = props => {
2002
+ const VentionSpinner = inputProps => {
2003
+ const props = applyDefaultProps(inputProps, defaultProps$8);
1992
2004
  const {
1993
2005
  classes
1994
2006
  } = useStyles$P({
@@ -2157,7 +2169,6 @@ const SPINNER_SIZES = {
2157
2169
  iconSize: 24
2158
2170
  }
2159
2171
  };
2160
- VentionSpinner.defaultProps = defaultProps$8;
2161
2172
 
2162
2173
  /* global Bun, Deno -- detection */
2163
2174
  var globalThis$h = globalThis_1;
@@ -7335,7 +7346,6 @@ const PROGRESS_BAR_SIZES = {
7335
7346
  borderRadius: 0
7336
7347
  }
7337
7348
  };
7338
- VentionProgressBar.defaultProps = defaultProps$5;
7339
7349
 
7340
7350
  function VentionSkeleton(props) {
7341
7351
  var _a;
@@ -10841,10 +10851,14 @@ const VentionDraggable = props => {
10841
10851
  const {
10842
10852
  classes
10843
10853
  } = useStyles$k(props);
10854
+ // Passing nodeRef stops react-draggable from calling findDOMNode, which React 19 removed.
10855
+ const draggableNodeRef = React.useRef(null);
10844
10856
  return jsx(Draggable, {
10845
10857
  handle: "#draggable-area",
10846
10858
  positionOffset: props.defaultPosition,
10859
+ nodeRef: draggableNodeRef,
10847
10860
  children: jsx(Box$1, {
10861
+ ref: draggableNodeRef,
10848
10862
  className: classes.container,
10849
10863
  id: props.tabLocation == null ? "draggable-area" : null,
10850
10864
  "data-testid": testIds.body,
@@ -11803,7 +11817,7 @@ const VentionTreeItem = /*#__PURE__*/forwardRef((inputProps, ref) => {
11803
11817
  onClick: handleOnClick,
11804
11818
  ref: ref,
11805
11819
  children: [jsxs("div", {
11806
- "aria-selected": isSelected,
11820
+ "aria-selected": selectable ? isSelected : undefined,
11807
11821
  "data-testid": testId,
11808
11822
  className: classes.mainContent,
11809
11823
  onContextMenu: event => onContextMenu === null || onContextMenu === void 0 ? void 0 : onContextMenu(event),
@@ -13190,6 +13204,7 @@ const VentionCombobox = props => {
13190
13204
  const labelTypography = typographyNameFromSizeMap[size].label;
13191
13205
  const handleClick = event => {
13192
13206
  setAnchorEl(event.currentTarget);
13207
+ /* v8 ignore else -- buttonRef is attached to the button that fires this click */
13193
13208
  if (buttonRef.current) {
13194
13209
  setMenuWidth(buttonRef.current.offsetWidth);
13195
13210
  }
@@ -14896,7 +14911,7 @@ function VentionDropZone({
14896
14911
  title: defaultTitle,
14897
14912
  errorMessages: []
14898
14913
  });
14899
- const fileInputRef = useRef();
14914
+ const fileInputRef = useRef(null);
14900
14915
  const {
14901
14916
  classes
14902
14917
  } = useStyle({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vention/machine-ui",
3
- "version": "5.30.10",
3
+ "version": "5.30.12",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/VentionCo/machine-cloud.git"
@@ -14,9 +14,9 @@
14
14
  "tss-react": "^4.9.20"
15
15
  },
16
16
  "peerDependencies": {
17
- "@mui/material": "5.16.7",
18
- "react": "17.0.2",
19
- "react-dom": "17.0.2"
17
+ "@mui/material": "^5.16.7",
18
+ "react": "^17.0.2 || ^19.3.0",
19
+ "react-dom": "^17.0.2 || ^19.3.0"
20
20
  },
21
21
  "module": "./index.esm.js",
22
22
  "main": "./index.esm.js",
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import type { JSX } from "react";
2
3
  export type AnchorPosition = {
3
4
  top: number;
4
5
  left: number;
@@ -11,7 +11,8 @@ export interface VentionAlertProps {
11
11
  onCloseButtonClick?: () => void;
12
12
  size?: StrictExtract<Sizes, "small" | "medium" | "large" | "xx-large">;
13
13
  descriptionText?: ReactElement | string;
14
- leftIcon?: ReactElement | undefined;
14
+ /** Defaults to the severity's icon. Pass `null` to show no icon. */
15
+ leftIcon?: ReactElement | null;
15
16
  rightIcon?: ReactElement | undefined;
16
17
  title?: ReactElement | string;
17
18
  isCloseable?: boolean;
@@ -11,7 +11,8 @@ export interface VentionCalloutProps {
11
11
  onSecondaryButtonClick?: () => void;
12
12
  size?: StrictExtract<Sizes, "small" | "medium">;
13
13
  descriptionText?: string;
14
- leftIcon?: ReactElement | undefined;
14
+ /** Defaults to an info icon. Pass `null` to show no icon. */
15
+ leftIcon?: ReactElement | null;
15
16
  title?: string;
16
17
  isCloseable?: boolean;
17
18
  variant?: "shaded" | "outline";
@@ -1,3 +1,4 @@
1
+ import type { JSX } from "react";
1
2
  import { DropZoneSize, DropZoneStyle } from "./vention-dropzone-utils";
2
3
  export type DropZoneProps = {
3
4
  style: DropZoneStyle;
@@ -9,7 +9,4 @@ export interface VentionProgressBarProps {
9
9
  helperText?: string;
10
10
  statusText?: string;
11
11
  }
12
- export declare const VentionProgressBar: {
13
- (inputProps: VentionProgressBarProps): import("react/jsx-runtime").JSX.Element;
14
- defaultProps: Partial<VentionProgressBarProps>;
15
- };
12
+ export declare const VentionProgressBar: (inputProps: VentionProgressBarProps) => import("react/jsx-runtime").JSX.Element;
@@ -7,7 +7,4 @@ export interface VentionSpinnerProps {
7
7
  label?: string;
8
8
  color?: string;
9
9
  }
10
- export declare const VentionSpinner: {
11
- (props: VentionSpinnerProps): import("react/jsx-runtime").JSX.Element;
12
- defaultProps: Partial<VentionSpinnerProps>;
13
- };
10
+ export declare const VentionSpinner: (inputProps: VentionSpinnerProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import { Sizes, StrictExtract } from "../../theme/machine-ui-theme";
2
+ import type { JSX } from "react";
2
3
  interface Step {
3
4
  title: string;
4
5
  description?: string;
@@ -1,3 +1,4 @@
1
+ import type { JSX } from "react";
1
2
  import { type UploadedFileProps } from "./vention-uploadfile-utils";
2
3
  /**
3
4
  * A component that displays an uploaded file with its upload status, file name, file size, and a remove button.
@@ -1,4 +1,4 @@
1
- import "@testing-library/jest-dom";
1
+ import "@testing-library/jest-dom/vitest";
2
2
  import { RenderResult } from "@testing-library/react";
3
3
  import { ReactElement } from "react";
4
4
  export declare const setupUser: () => import("@testing-library/user-event").UserEvent;
@@ -1,4 +1,9 @@
1
- export declare function applyDefaultProps<T>(inputProps: T, defaultProps: Partial<T>): Partial<T> & T;
1
+ /**
2
+ * Replacement for `Component.defaultProps`, which React 19 no longer applies to function components.
3
+ * Follows React's rule: a default is used when the prop is missing or explicitly `undefined`.
4
+ * To opt out of a default (e.g. hide a default icon), the component must accept `null` for that prop.
5
+ */
6
+ export declare function applyDefaultProps<T extends object>(inputProps: T, defaultProps: Partial<T>): T;
2
7
  /**
3
8
  * Retrieves anything from the MachineUi S3 bucket
4
9
  * @param path string