@trackunit/react-components 0.1.133 → 0.1.134
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
CHANGED
|
@@ -18868,8 +18868,20 @@ const SkeletonLines = React.memo(({ margin = "10px 0", lines = 1, height, width
|
|
|
18868
18868
|
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: skeletonLines });
|
|
18869
18869
|
});
|
|
18870
18870
|
|
|
18871
|
-
const
|
|
18872
|
-
|
|
18871
|
+
const cvaContainerStyles = cssClassVarianceUtilities.cvaMerge([
|
|
18872
|
+
"flex",
|
|
18873
|
+
"flex-col",
|
|
18874
|
+
"items-center",
|
|
18875
|
+
"gap-5",
|
|
18876
|
+
"p-4",
|
|
18877
|
+
"sm:p-6",
|
|
18878
|
+
"md:p-12",
|
|
18879
|
+
"text-center",
|
|
18880
|
+
"justify-center",
|
|
18881
|
+
"h-full",
|
|
18882
|
+
]);
|
|
18883
|
+
const cvaTextStyles = cssClassVarianceUtilities.cvaMerge(["flex", "flex-col", "items-center", "gap-2"]);
|
|
18884
|
+
const cvaImgStyles = cssClassVarianceUtilities.cvaMerge(["w-2/3", "min-w-[60px]", "max-w-[200px]"]);
|
|
18873
18885
|
|
|
18874
18886
|
var WorkerWithSign = "8df3d27593b5fba4.svg";
|
|
18875
18887
|
|
|
@@ -18915,7 +18927,7 @@ const EmptyState = ({ title, description, altText, image, customImageSrc, action
|
|
|
18915
18927
|
lazyLoadImage();
|
|
18916
18928
|
}
|
|
18917
18929
|
}, [customImageSrc, image]);
|
|
18918
|
-
return (jsxRuntime.jsx("div", { className: `${
|
|
18930
|
+
return (jsxRuntime.jsx("div", { className: `${cvaContainerStyles()} ${className}`, "data-testid": dataTestId !== null && dataTestId !== void 0 ? dataTestId : "empty-state", children: loading ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Spinner, { dataTestId: "spinner", size: "large", centering: "centered" }), jsxRuntime.jsx(SkeletonLines, { dataTestId: "skeleton-lines", width: 50 })] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("img", { className: cvaImgStyles(), width: 200, height: 200, src: customImageSrc ? customImageSrc : imageSource, alt: altText }), jsxRuntime.jsxs("div", { className: cvaTextStyles(), children: [jsxRuntime.jsx(Heading, { variant: "secondary", children: title }), jsxRuntime.jsx(Text, { align: "center", children: description })] }), action] })) }));
|
|
18919
18931
|
};
|
|
18920
18932
|
|
|
18921
18933
|
/**
|
|
@@ -36590,7 +36602,7 @@ function getDevicePixelRatio(options) {
|
|
|
36590
36602
|
* The boolean will be true if the element is being hovered, and false if it is not.
|
|
36591
36603
|
* Can be directionally debounced.
|
|
36592
36604
|
*
|
|
36593
|
-
* @param {
|
|
36605
|
+
* @param {UseHoverProps} param0 The options
|
|
36594
36606
|
* @returns {object} The object containing the onMouseEnter, onMouseLeave and hovering props
|
|
36595
36607
|
*/
|
|
36596
36608
|
const useHover = ({ debounced = false, delay = 100, direction = "out" } = { debounced: false }) => {
|
package/index.js
CHANGED
|
@@ -18841,8 +18841,20 @@ const SkeletonLines = memo(({ margin = "10px 0", lines = 1, height, width = "100
|
|
|
18841
18841
|
return jsx(Fragment, { children: skeletonLines });
|
|
18842
18842
|
});
|
|
18843
18843
|
|
|
18844
|
-
const
|
|
18845
|
-
|
|
18844
|
+
const cvaContainerStyles = cvaMerge([
|
|
18845
|
+
"flex",
|
|
18846
|
+
"flex-col",
|
|
18847
|
+
"items-center",
|
|
18848
|
+
"gap-5",
|
|
18849
|
+
"p-4",
|
|
18850
|
+
"sm:p-6",
|
|
18851
|
+
"md:p-12",
|
|
18852
|
+
"text-center",
|
|
18853
|
+
"justify-center",
|
|
18854
|
+
"h-full",
|
|
18855
|
+
]);
|
|
18856
|
+
const cvaTextStyles = cvaMerge(["flex", "flex-col", "items-center", "gap-2"]);
|
|
18857
|
+
const cvaImgStyles = cvaMerge(["w-2/3", "min-w-[60px]", "max-w-[200px]"]);
|
|
18846
18858
|
|
|
18847
18859
|
var WorkerWithSign = "8df3d27593b5fba4.svg";
|
|
18848
18860
|
|
|
@@ -18888,7 +18900,7 @@ const EmptyState = ({ title, description, altText, image, customImageSrc, action
|
|
|
18888
18900
|
lazyLoadImage();
|
|
18889
18901
|
}
|
|
18890
18902
|
}, [customImageSrc, image]);
|
|
18891
|
-
return (jsx("div", { className: `${
|
|
18903
|
+
return (jsx("div", { className: `${cvaContainerStyles()} ${className}`, "data-testid": dataTestId !== null && dataTestId !== void 0 ? dataTestId : "empty-state", children: loading ? (jsxs(Fragment, { children: [jsx(Spinner, { dataTestId: "spinner", size: "large", centering: "centered" }), jsx(SkeletonLines, { dataTestId: "skeleton-lines", width: 50 })] })) : (jsxs(Fragment, { children: [jsx("img", { className: cvaImgStyles(), width: 200, height: 200, src: customImageSrc ? customImageSrc : imageSource, alt: altText }), jsxs("div", { className: cvaTextStyles(), children: [jsx(Heading, { variant: "secondary", children: title }), jsx(Text, { align: "center", children: description })] }), action] })) }));
|
|
18892
18904
|
};
|
|
18893
18905
|
|
|
18894
18906
|
/**
|
|
@@ -36563,7 +36575,7 @@ function getDevicePixelRatio(options) {
|
|
|
36563
36575
|
* The boolean will be true if the element is being hovered, and false if it is not.
|
|
36564
36576
|
* Can be directionally debounced.
|
|
36565
36577
|
*
|
|
36566
|
-
* @param {
|
|
36578
|
+
* @param {UseHoverProps} param0 The options
|
|
36567
36579
|
* @returns {object} The object containing the onMouseEnter, onMouseLeave and hovering props
|
|
36568
36580
|
*/
|
|
36569
36581
|
const useHover = ({ debounced = false, delay = 100, direction = "out" } = { debounced: false }) => {
|
package/package.json
CHANGED
|
@@ -25,7 +25,7 @@ export interface CardProps extends CommonProps, React.InputHTMLAttributes<HTMLDi
|
|
|
25
25
|
*/
|
|
26
26
|
onMouseEnter?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
27
27
|
/**
|
|
28
|
-
* A
|
|
28
|
+
* A MouseLeave handler function
|
|
29
29
|
*/
|
|
30
30
|
onMouseLeave?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
31
31
|
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const
|
|
1
|
+
export declare const cvaContainerStyles: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
2
|
+
export declare const cvaTextStyles: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
3
|
+
export declare const cvaImgStyles: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
@@ -5,7 +5,18 @@ export type ButtonVariant = "filled" | "transparent";
|
|
|
5
5
|
export type ButtonColor = Extract<GeneralColors, "primary" | "secondary"> | Extract<IntentColors, "warning" | "danger"> | "tertiary";
|
|
6
6
|
export type ButtonType = "button" | "submit";
|
|
7
7
|
export interface ButtonCommonProps extends CommonProps {
|
|
8
|
+
/**
|
|
9
|
+
* An onClick handler
|
|
10
|
+
*/
|
|
8
11
|
onClick?: (event: React.MouseEvent<HTMLElement>) => void;
|
|
12
|
+
/**
|
|
13
|
+
* A MouseEnter handler function
|
|
14
|
+
*/
|
|
15
|
+
onMouseEnter?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
16
|
+
/**
|
|
17
|
+
* A MouseLeave handler function
|
|
18
|
+
*/
|
|
19
|
+
onMouseLeave?: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
9
20
|
/**
|
|
10
21
|
* Whether the button is loading.
|
|
11
22
|
*/
|
package/src/hooks/useHover.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DebounceDirection } from "./useDebounce";
|
|
2
|
-
type
|
|
2
|
+
type UseHoverProps = {
|
|
3
3
|
debounced: true;
|
|
4
4
|
delay?: number;
|
|
5
5
|
direction?: DebounceDirection;
|
|
@@ -13,10 +13,10 @@ type ConditionalUseHoverProps = {
|
|
|
13
13
|
* The boolean will be true if the element is being hovered, and false if it is not.
|
|
14
14
|
* Can be directionally debounced.
|
|
15
15
|
*
|
|
16
|
-
* @param {
|
|
16
|
+
* @param {UseHoverProps} param0 The options
|
|
17
17
|
* @returns {object} The object containing the onMouseEnter, onMouseLeave and hovering props
|
|
18
18
|
*/
|
|
19
|
-
export declare const useHover: ({ debounced, delay, direction }?:
|
|
19
|
+
export declare const useHover: ({ debounced, delay, direction }?: UseHoverProps) => {
|
|
20
20
|
onMouseEnter: () => void;
|
|
21
21
|
onMouseLeave: () => void;
|
|
22
22
|
hovering: boolean;
|