@trackunit/react-components 1.10.64 → 1.10.67

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-components",
3
- "version": "1.10.64",
3
+ "version": "1.10.67",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -14,10 +14,10 @@
14
14
  "@floating-ui/react": "^0.26.25",
15
15
  "string-ts": "^2.0.0",
16
16
  "tailwind-merge": "^2.0.0",
17
- "@trackunit/ui-design-tokens": "1.7.89",
18
- "@trackunit/css-class-variance-utilities": "1.7.89",
19
- "@trackunit/shared-utils": "1.9.89",
20
- "@trackunit/ui-icons": "1.7.90",
17
+ "@trackunit/ui-design-tokens": "1.7.92",
18
+ "@trackunit/css-class-variance-utilities": "1.7.92",
19
+ "@trackunit/shared-utils": "1.9.92",
20
+ "@trackunit/ui-icons": "1.7.93",
21
21
  "@tanstack/react-router": "1.114.29",
22
22
  "es-toolkit": "^1.39.10",
23
23
  "@tanstack/react-virtual": "3.13.12",
@@ -1,3 +1,4 @@
1
+ import { CSSProperties } from "react";
1
2
  export type Styleable = {
2
- style?: React.CSSProperties;
3
+ style?: CSSProperties;
3
4
  };
@@ -1,4 +1,5 @@
1
1
  import { CommonProps } from "../../../common/CommonProps";
2
+ import { ReactElement } from "react";
2
3
  export interface BreadcrumbItemProps {
3
4
  label: string;
4
5
  to: string;
@@ -8,8 +9,8 @@ export interface BreadcrumbProps extends CommonProps {
8
9
  back: () => void;
9
10
  }
10
11
  export interface BreadcrumbContainerProps extends CommonProps {
11
- breadcrumbItems: Array<React.ReactElement<BreadcrumbItemProps>>;
12
+ breadcrumbItems: Array<ReactElement<BreadcrumbItemProps>>;
12
13
  }
13
14
  export interface BreadcrumbItemRenderProps extends CommonProps {
14
- item: React.ReactElement<BreadcrumbItemProps>;
15
+ item: ReactElement<BreadcrumbItemProps>;
15
16
  }
@@ -1,5 +1,6 @@
1
+ import { ReactElement } from "react";
1
2
  import { BreadcrumbItemProps } from "./types";
2
3
  /**
3
4
  * useBreadcrumbItemsToRender is a custom hook that takes an array of BreadcrumbItemProps and returns an array of React.ReactElement
4
5
  */
5
- export declare const useBreadcrumbItemsToRender: (breadcrumbItems: Array<BreadcrumbItemProps>) => Array<React.ReactElement<BreadcrumbItemProps>>;
6
+ export declare const useBreadcrumbItemsToRender: (breadcrumbItems: Array<BreadcrumbItemProps>) => Array<ReactElement<BreadcrumbItemProps>>;
@@ -1,4 +1,4 @@
1
- import { ReactElement, ReactNode } from "react";
1
+ import { MouseEventHandler, ReactElement, ReactNode } from "react";
2
2
  import { CommonProps } from "../../common/CommonProps";
3
3
  import { Density } from "../../common/Density";
4
4
  import { HeadingVariant } from "../Heading/Heading";
@@ -29,7 +29,7 @@ export interface CardHeaderProps extends CommonProps {
29
29
  */
30
30
  hideSeparator?: boolean;
31
31
  /** Function to call when the close button is clicked */
32
- onClose?: () => void;
32
+ onClose?: MouseEventHandler<HTMLButtonElement>;
33
33
  /**
34
34
  * Children to render in the header
35
35
  */
@@ -1,4 +1,4 @@
1
- import { ReactElement } from "react";
1
+ import { ReactElement, ReactNode } from "react";
2
2
  import { CommonProps } from "../../common/CommonProps";
3
3
  type EmptyStateImage = "WORKER_WITH_SIGN" | "ROAD_BLOCK" | "BUILDING_ERROR" | "WALL_CONSTRUCTION" | "PHONE_LOCK_SECURITY" | "SEARCH_DOCUMENT";
4
4
  type EmptyStateButtonAction = {
@@ -15,7 +15,7 @@ export interface EmptyStateProps extends CommonProps {
15
15
  description?: string;
16
16
  altText?: string;
17
17
  image?: EmptyStateImage;
18
- customImageSrc?: string | React.ReactNode;
18
+ customImageSrc?: string | ReactNode;
19
19
  primaryAction?: EmptyStateButtonAction;
20
20
  secondaryAction?: EmptyStateButtonAction;
21
21
  additionalHelpAction?: EmptyStateButtonAction;
@@ -1,4 +1,4 @@
1
- import { MouseEvent, ReactElement, ReactNode } from "react";
1
+ import { MouseEventHandler, ReactElement, ReactNode } from "react";
2
2
  import { CommonProps } from "../../common/CommonProps";
3
3
  export interface ExternalLinkProps extends CommonProps {
4
4
  /**
@@ -25,7 +25,7 @@ export interface ExternalLinkProps extends CommonProps {
25
25
  * Used to specify the relationship between the link and the current document. Defaults to "noreferrer".
26
26
  */
27
27
  rel?: string;
28
- onClick?: (event: MouseEvent<HTMLAnchorElement, globalThis.MouseEvent>) => void;
28
+ onClick?: MouseEventHandler<HTMLAnchorElement>;
29
29
  }
30
30
  /**
31
31
  * Link is an interactive element that allows users to navigate between different parts of an application or to external resources. Links are used to indicate clickable text.
@@ -1,4 +1,4 @@
1
- import { ReactElement } from "react";
1
+ import { MouseEvent, ReactElement } from "react";
2
2
  import { CommonProps } from "../../common/CommonProps";
3
3
  type OverflowDirection = "left" | "right";
4
4
  export interface OverflowIndicatorProps extends CommonProps {
@@ -9,7 +9,7 @@ export interface OverflowIndicatorProps extends CommonProps {
9
9
  /**
10
10
  * Callback function to handle scroll action
11
11
  */
12
- onClickScroll?: (event: React.MouseEvent<HTMLElement>) => void;
12
+ onClickScroll?: (event: MouseEvent<HTMLElement>) => void;
13
13
  }
14
14
  /**
15
15
  * Overflow indicator component that shows visual cues when content extends beyond visible area
@@ -1,6 +1,6 @@
1
1
  import { ActivityColors, CriticalityColors, GeneralColors, IntentColors, RentalStatusColors, SitesColors, UtilizationColors } from "@trackunit/ui-design-tokens";
2
2
  import { IconName } from "@trackunit/ui-icons";
3
- import { CSSProperties, ReactElement } from "react";
3
+ import { CSSProperties, MouseEvent, ReactElement, RefObject } from "react";
4
4
  import { AriaProps } from "../../common/AriaProps";
5
5
  import { CommonProps } from "../../common/CommonProps";
6
6
  import { Size } from "../../common/Size";
@@ -278,13 +278,13 @@ export type IconProps = DiscriminatedIconProps & CommonProps & AriaProps & {
278
278
  * The type value depends on the size prop, the small and medium size are always solid, the large size is either solid or outline.
279
279
  */
280
280
  type?: "solid" | "outline" | "mini";
281
- onClick?: (event: React.MouseEvent<HTMLElement>) => void;
281
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
282
282
  /**
283
283
  * Ref forwarded to the span element
284
284
  *
285
285
  * @memberof IconProps
286
286
  */
287
- forwardedRef?: React.RefObject<HTMLSpanElement>;
287
+ forwardedRef?: RefObject<HTMLSpanElement>;
288
288
  /**
289
289
  * Custom styles object used to override existing styles or add some extra styling
290
290
  *
@@ -1,5 +1,5 @@
1
1
  import { IconName } from "@trackunit/ui-icons";
2
- import { ReactElement, ReactNode } from "react";
2
+ import { MouseEvent, ReactElement, ReactNode } from "react";
3
3
  import { CommonProps } from "../../common/CommonProps";
4
4
  import { ButtonVariant } from "../buttons";
5
5
  import { TabListProps } from "../Tabs/TabList";
@@ -12,7 +12,7 @@ export type PageHeaderKpiMetricsType = {
12
12
  hidden?: boolean;
13
13
  };
14
14
  export type PageHeaderActionType = CommonProps & {
15
- actionCallback?: (e?: React.MouseEvent) => void;
15
+ actionCallback?: (e?: MouseEvent) => void;
16
16
  actionText: string;
17
17
  prefixIconName?: IconName;
18
18
  disabled?: boolean;
@@ -1,11 +1,11 @@
1
- import { HTMLAttributes } from "react";
1
+ import { HTMLAttributes, ReactElement, RefObject } from "react";
2
2
  import { SidebarItemProps } from "./Sidebar";
3
3
  export interface OverflowItemsOptions {
4
4
  /**
5
5
  * If the child elements of the container are not available at the time of the hook initialization,
6
6
  * you can pass the children as a prop, and the hook will initialize the observer when the children are available.
7
7
  */
8
- children?: Array<React.ReactElement<SidebarItemProps>> | React.ReactElement<SidebarItemProps>;
8
+ children?: Array<ReactElement<SidebarItemProps>> | ReactElement<SidebarItemProps>;
9
9
  /**
10
10
  * The threshold for the intersection observer.
11
11
  * Learn more: https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#creating_an_intersection_observer
@@ -34,6 +34,6 @@ export type OverflowMap = {
34
34
  * @returns {object} The overflow items and the ref to the container.
35
35
  */
36
36
  export declare const useOverflowItems: ({ threshold, childUniqueIdentifierAttribute, children, }: OverflowItemsOptions) => {
37
- overflowContainerRef: React.RefObject<HTMLDivElement | null>;
37
+ overflowContainerRef: RefObject<HTMLDivElement | null>;
38
38
  itemOverflowMap: OverflowMap;
39
39
  };
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from "@trackunit/css-class-variance-utilities";
2
2
  import { MappedOmit } from "@trackunit/shared-utils";
3
3
  import { IconName } from "@trackunit/ui-icons";
4
- import { Dispatch, ReactElement, SetStateAction } from "react";
4
+ import { Dispatch, MouseEvent, ReactElement, SetStateAction } from "react";
5
5
  import { CommonProps } from "../../common/CommonProps";
6
6
  import { TooltipPlacement } from "../Tooltip/Tooltip";
7
7
  import { cvaToggleGroup } from "./ToggleGroup.variants";
@@ -73,7 +73,7 @@ export interface ToggleItemProps extends CommonProps, MappedOmit<BasicToggleGrou
73
73
  content?: string;
74
74
  placement?: TooltipPlacement;
75
75
  };
76
- onClick: (event?: React.MouseEvent<HTMLElement>) => void;
76
+ onClick: (event?: MouseEvent<HTMLElement>) => void;
77
77
  selected: boolean;
78
78
  disabled: boolean;
79
79
  size: "small" | "medium" | "large";
@@ -1,8 +1,7 @@
1
- import { MouseEvent, ReactElement, ReactNode, Ref } from "react";
1
+ import { ReactElement, ReactNode, Ref } from "react";
2
2
  import { Size } from "../../../common/Size";
3
3
  import { ButtonCommonProps, ButtonType } from "../shared/ButtonProps";
4
4
  export interface ButtonProps extends Omit<ButtonCommonProps, "size"> {
5
- onClick?: (event: MouseEvent<HTMLElement>) => void;
6
5
  /**
7
6
  * Child nodes. Can be used to pass in text to be displayed on the button.
8
7
  */
@@ -1,3 +1,4 @@
1
+ import { MouseEventHandler } from "react";
1
2
  import { CommonProps } from "../../../common/CommonProps";
2
3
  import { Size } from "../../../common/Size";
3
4
  export type ButtonVariant = "primary" | "secondary" | "primary-danger" | "secondary-danger" | "ghost" | "ghost-neutral" | "filled";
@@ -6,15 +7,15 @@ export interface ButtonCommonProps extends CommonProps {
6
7
  /**
7
8
  * An onClick handler
8
9
  */
9
- onClick?: (event: React.MouseEvent<HTMLElement>) => void;
10
+ onClick?: MouseEventHandler<HTMLButtonElement>;
10
11
  /**
11
12
  * A MouseEnter handler function
12
13
  */
13
- onMouseEnter?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
14
+ onMouseEnter?: MouseEventHandler<HTMLButtonElement>;
14
15
  /**
15
16
  * A MouseLeave handler function
16
17
  */
17
- onMouseLeave?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
18
+ onMouseLeave?: MouseEventHandler<HTMLButtonElement>;
18
19
  /**
19
20
  * Whether the button is loading.
20
21
  */
@@ -1,6 +1,7 @@
1
+ import { RefObject } from "react";
1
2
  /**
2
3
  * A useRef that updates its given value whenever it changes.
3
4
  *
4
5
  * @returns {boolean} Returns true if it is the first render, false otherwise.
5
6
  */
6
- export declare const useSelfUpdatingRef: <TState>(initialState: TState) => React.RefObject<TState>;
7
+ export declare const useSelfUpdatingRef: <TState>(initialState: TState) => RefObject<TState>;