@trackunit/react-components 1.4.23 → 1.4.27
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.cjs.js +89 -75
- package/index.esm.js +89 -75
- package/package.json +8 -8
- package/src/components/Alert/Alert.d.ts +2 -2
- package/src/components/Badge/Badge.d.ts +1 -1
- package/src/components/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/src/components/Card/Card.d.ts +2 -2
- package/src/components/Card/CardBody.d.ts +1 -1
- package/src/components/Card/CardFooter.d.ts +2 -2
- package/src/components/Card/CardHeader.d.ts +2 -2
- package/src/components/Collapse/Collapse.d.ts +1 -1
- package/src/components/CopyableText/CopyableText.d.ts +1 -1
- package/src/components/EmptyValue/EmptyValue.d.ts +3 -2
- package/src/components/ExternalLink/ExternalLink.d.ts +5 -4
- package/src/components/Heading/Heading.d.ts +4 -4
- package/src/components/Icon/Icon.d.ts +1 -1
- package/src/components/Indicator/Indicator.d.ts +4 -3
- package/src/components/KPICard/KPICard.d.ts +3 -3
- package/src/components/Menu/MenuItem/MenuItem.d.ts +6 -5
- package/src/components/Menu/MenuList/MenuList.d.ts +4 -3
- package/src/components/Menu/MoreMenu/MoreMenu.d.ts +1 -1
- package/src/components/Notice/Notice.d.ts +4 -3
- package/src/components/PageHeader/PageHeader.d.ts +1 -1
- package/src/components/Pagination/Pagination.d.ts +1 -1
- package/src/components/Polygon/Polygon.d.ts +1 -1
- package/src/components/Popover/Popover.d.ts +1 -1
- package/src/components/Popover/PopoverContent.d.ts +9 -2
- package/src/components/Popover/PopoverTitle.d.ts +2 -2
- package/src/components/Popover/PopoverTrigger.d.ts +14 -4
- package/src/components/Popover/PopoverTypes.d.ts +6 -4
- package/src/components/SectionHeader/SectionHeader.d.ts +3 -3
- package/src/components/Sidebar/Sidebar.d.ts +2 -2
- package/src/components/Sidebar/useOverflowItems.d.ts +1 -1
- package/src/components/Spacer/Spacer.d.ts +1 -1
- package/src/components/Spinner/Spinner.d.ts +1 -1
- package/src/components/Tabs/Tab.d.ts +1 -1
- package/src/components/Tabs/TabContent.d.ts +1 -1
- package/src/components/Tag/Tag.d.ts +11 -4
- package/src/components/Text/Text.d.ts +11 -4
- package/src/components/ToggleGroup/ToggleGroup.d.ts +1 -1
- package/src/components/Tooltip/Tooltip.d.ts +3 -3
- package/src/components/ValueBar/ValueBar.d.ts +1 -1
- package/src/components/ValueBar/ValueBarHelper.d.ts +1 -1
- package/src/components/VirtualizedList/VirtualizedList.d.ts +3 -2
- package/src/components/Widget/WidgetBody.d.ts +1 -1
- package/src/components/buttons/Button/Button.d.ts +10 -3
- package/src/components/buttons/IconButton/IconButton.d.ts +12 -2
- package/src/components/buttons/StarButton/StarButton.d.ts +2 -2
- package/src/hooks/useClickOutside.d.ts +1 -1
- package/src/hooks/useContainerBreakpoints.d.ts +1 -1
- package/src/hooks/useElevatedReducer.d.ts +2 -2
- package/src/hooks/useGeometry.d.ts +1 -1
- package/src/hooks/useIsTextTruncated.d.ts +3 -3
- package/src/hooks/useIsTextWrapping.d.ts +1 -1
- package/src/hooks/useScrollDetection.d.ts +1 -1
- package/src/hooks/useSelfUpdatingRef.d.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentType, ReactNode } from "react";
|
|
1
|
+
import { ComponentType, JSX, ReactNode, Ref } from "react";
|
|
2
2
|
import { Size } from "../../../common";
|
|
3
3
|
import { ButtonCommonProps } from "../shared/ButtonProps";
|
|
4
4
|
export interface IconButtonProps extends ButtonCommonProps {
|
|
@@ -16,8 +16,18 @@ export interface IconButtonProps extends ButtonCommonProps {
|
|
|
16
16
|
* The size of the button. Defaults to "medium".
|
|
17
17
|
*/
|
|
18
18
|
size?: Size;
|
|
19
|
+
/**
|
|
20
|
+
* A ref for the component
|
|
21
|
+
*/
|
|
22
|
+
ref?: Ref<HTMLButtonElement>;
|
|
19
23
|
}
|
|
20
24
|
/**
|
|
21
25
|
* Buttons are clickable elements that are used to trigger actions. They communicate calls to action to the user and allow users to interact with pages in a variety of ways. The Icon Button is a version of the standard Button component without the text label.
|
|
22
26
|
*/
|
|
23
|
-
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
export declare const IconButton: {
|
|
31
|
+
({ icon, size, square, loading, disabled, className, ref, ...rest }: IconButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
displayName: string;
|
|
33
|
+
};
|
|
@@ -5,9 +5,9 @@ interface StarButtonProps {
|
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* The StarButton component is used for favorite actions or similar.
|
|
8
|
-
|
|
8
|
+
*
|
|
9
9
|
* @param {StarButtonProps} props - The props for the StarButton component
|
|
10
|
-
* @returns {
|
|
10
|
+
* @returns {ReactElement} StarButton component
|
|
11
11
|
*/
|
|
12
12
|
export declare const StarButton: ({ starred, onClick }: StarButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export {};
|
|
@@ -7,7 +7,7 @@ import { RefObject } from "react";
|
|
|
7
7
|
* @param {Function} [options.onClick] - The event handler for the click outside event.
|
|
8
8
|
* @param {boolean} [options.active=true] - Whether the click outside event listener should be active.
|
|
9
9
|
*/
|
|
10
|
-
export declare const useClickOutside: (el: RefObject<HTMLElement> | RefObject<HTMLElement>[], options: {
|
|
10
|
+
export declare const useClickOutside: (el: RefObject<HTMLElement | null> | RefObject<HTMLElement | null>[], options: {
|
|
11
11
|
onClick: (ev: MouseEvent) => void;
|
|
12
12
|
active?: boolean;
|
|
13
13
|
}) => void;
|
|
@@ -26,4 +26,4 @@ import { type BreakpointState } from "./breakpoint-utils";
|
|
|
26
26
|
* );
|
|
27
27
|
* }
|
|
28
28
|
*/
|
|
29
|
-
export declare const useContainerBreakpoints: (ref: RefObject<HTMLElement>) => BreakpointState;
|
|
29
|
+
export declare const useContainerBreakpoints: (ref: RefObject<HTMLElement | null>) => BreakpointState;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ActionDispatch, AnyActionArg } from "react";
|
|
2
2
|
/**
|
|
3
3
|
* Use this hook if you want to optionally elevate the reducer state of a component.
|
|
4
4
|
* Useful when you _want_ to be able to control the reducer state of a component
|
|
@@ -9,4 +9,4 @@ import { Dispatch, Reducer } from "react";
|
|
|
9
9
|
* @example
|
|
10
10
|
* const [state, dispatch] = useElevatedReducer(reducer, initialState, elevatedReducerState);
|
|
11
11
|
*/
|
|
12
|
-
export declare const useElevatedReducer: <TState, TAction>(reducer:
|
|
12
|
+
export declare const useElevatedReducer: <TState, TAction extends AnyActionArg>(reducer: (prevState: TState, ...args: TAction) => TState, initialState: TState, customState?: [TState, ActionDispatch<TAction>]) => [TState, ActionDispatch<TAction>];
|
|
@@ -3,7 +3,7 @@ import { RefObject } from "react";
|
|
|
3
3
|
* Custom hook to get the geometry of an element.
|
|
4
4
|
* Size and position of the element relative to the viewport.
|
|
5
5
|
*/
|
|
6
|
-
export declare const useGeometry: (ref: RefObject<HTMLElement>) => {
|
|
6
|
+
export declare const useGeometry: (ref: RefObject<HTMLElement | null>) => {
|
|
7
7
|
width: number;
|
|
8
8
|
height: number;
|
|
9
9
|
top: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ref } from "react";
|
|
2
2
|
/**
|
|
3
3
|
* A custom hook that determines if text within an element is truncated
|
|
4
4
|
* (i.e., the text overflows the container).
|
|
@@ -7,13 +7,13 @@ import { RefObject } from "react";
|
|
|
7
7
|
* @param {string} [text] - (Optional) Text used to trigger a re-check of truncation,
|
|
8
8
|
* especially if the text is dynamic (such as an input's value).
|
|
9
9
|
* @returns {{
|
|
10
|
-
* ref:
|
|
10
|
+
* ref: Ref<TElement | null>;
|
|
11
11
|
* isTooltipVisible: boolean;
|
|
12
12
|
* }} An object with:
|
|
13
13
|
* - `ref`: a ref to attach to the element you want to observe for truncation.
|
|
14
14
|
* - `isTextTruncated`: a boolean indicating if the text is truncated.
|
|
15
15
|
*/
|
|
16
16
|
export declare const useIsTextTruncated: <TElement extends HTMLElement>(text?: string) => {
|
|
17
|
-
ref:
|
|
17
|
+
ref: Ref<TElement>;
|
|
18
18
|
isTextTruncated: boolean;
|
|
19
19
|
};
|
|
@@ -11,6 +11,6 @@ import { RefObject } from "react";
|
|
|
11
11
|
* - `isTextWrapping`: a boolean indicating if the text is wrapping.
|
|
12
12
|
*/
|
|
13
13
|
export declare const useIsTextWrapping: <TElement extends HTMLElement>() => {
|
|
14
|
-
ref: RefObject<TElement>;
|
|
14
|
+
ref: RefObject<TElement | null>;
|
|
15
15
|
isTextWrapping: boolean;
|
|
16
16
|
};
|
|
@@ -5,7 +5,7 @@ import { type RefObject } from "react";
|
|
|
5
5
|
* @param {useRef} elementRef - Ref hook holding the element that needs to be observed during scrolling
|
|
6
6
|
* @returns {object} An object containing if the element is scrollable, is at the top, is at the bottom, and its current scroll position.
|
|
7
7
|
*/
|
|
8
|
-
export declare const useScrollDetection: (elementRef
|
|
8
|
+
export declare const useScrollDetection: (elementRef?: RefObject<HTMLElement | null>) => {
|
|
9
9
|
isScrollable: boolean;
|
|
10
10
|
isAtTop: boolean;
|
|
11
11
|
isAtBottom: boolean;
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @returns {boolean} Returns true if it is the first render, false otherwise.
|
|
5
5
|
*/
|
|
6
|
-
export declare const useSelfUpdatingRef: <TState>(initialState: TState) => import("react").
|
|
6
|
+
export declare const useSelfUpdatingRef: <TState>(initialState: TState) => import("react").RefObject<TState>;
|