@trackunit/react-components 0.1.257-alpha-3fd0172a5e.0 → 0.1.259
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
CHANGED
|
@@ -176,7 +176,7 @@ const isSafari = () => {
|
|
|
176
176
|
* @param {IconProps} props - The props for the Icon component
|
|
177
177
|
* @returns {JSX.Element} Icon component
|
|
178
178
|
*/
|
|
179
|
-
const Icon = ({ name, size = "large", className, dataTestId, color, onClick, type, style, forwardedRef, }) => {
|
|
179
|
+
const Icon = ({ name, size = "large", className, dataTestId, color, onClick, type, style, forwardedRef, title, }) => {
|
|
180
180
|
const useTagRef = React.useRef(null);
|
|
181
181
|
const correctIconType = React.useMemo(() => {
|
|
182
182
|
if (size === "small" || size === "medium") {
|
|
@@ -198,7 +198,7 @@ const Icon = ({ name, size = "large", className, dataTestId, color, onClick, typ
|
|
|
198
198
|
useTagRef.current.setAttribute("href", href[correctIconType]);
|
|
199
199
|
}
|
|
200
200
|
}, [correctIconType, href]);
|
|
201
|
-
return (jsxRuntime.jsx("span", { className: cvaIcon({ color, size, className }), onClick: onClick, "data-testid": dataTestId, ref: forwardedRef, children: jsxRuntime.jsxs("svg", { viewBox: correctIconType === "mini" ? "0 0 20 20" : "0 0 24 24", "data-testid": dataTestId ? `${dataTestId}-${iconName}` : iconName, style: style, role: "img", children: [jsxRuntime.jsx("title", { children: iconName }), jsxRuntime.jsx("use", { href: href[correctIconType], ref: useTagRef })] }) }));
|
|
201
|
+
return (jsxRuntime.jsx("span", { className: cvaIcon({ color, size, className }), onClick: onClick, "data-testid": dataTestId, ref: forwardedRef, children: jsxRuntime.jsxs("svg", { viewBox: correctIconType === "mini" ? "0 0 20 20" : "0 0 24 24", "data-testid": dataTestId ? `${dataTestId}-${iconName}` : iconName, style: style, role: "img", children: [jsxRuntime.jsx("title", { children: title ? title : iconName }), jsxRuntime.jsx("use", { href: href[correctIconType], ref: useTagRef })] }) }));
|
|
202
202
|
};
|
|
203
203
|
|
|
204
204
|
const cvaTag = cssClassVarianceUtilities.cvaMerge([
|
|
@@ -946,8 +946,8 @@ const Card = (_a) => {
|
|
|
946
946
|
* @param {CardBodyProps} props - The props for the CardBody component
|
|
947
947
|
* @returns {JSX.Element} CardBody component
|
|
948
948
|
*/
|
|
949
|
-
const CardBody = ({ density = "auto", children, dataTestId, className, disableGap }) => {
|
|
950
|
-
return (jsxRuntime.jsx("div", { "data-testid": dataTestId, className: cvaCardBodyDensityContainer({ density, disableGap, className }), children: children }));
|
|
949
|
+
const CardBody = ({ density = "auto", children, dataTestId, className, disableGap, id }) => {
|
|
950
|
+
return (jsxRuntime.jsx("div", { "data-testid": dataTestId, id: id, className: cvaCardBodyDensityContainer({ density, disableGap, className }), children: children }));
|
|
951
951
|
};
|
|
952
952
|
|
|
953
953
|
/**
|
package/index.esm.js
CHANGED
|
@@ -145,7 +145,7 @@ const isSafari = () => {
|
|
|
145
145
|
* @param {IconProps} props - The props for the Icon component
|
|
146
146
|
* @returns {JSX.Element} Icon component
|
|
147
147
|
*/
|
|
148
|
-
const Icon = ({ name, size = "large", className, dataTestId, color, onClick, type, style, forwardedRef, }) => {
|
|
148
|
+
const Icon = ({ name, size = "large", className, dataTestId, color, onClick, type, style, forwardedRef, title, }) => {
|
|
149
149
|
const useTagRef = useRef(null);
|
|
150
150
|
const correctIconType = useMemo(() => {
|
|
151
151
|
if (size === "small" || size === "medium") {
|
|
@@ -167,7 +167,7 @@ const Icon = ({ name, size = "large", className, dataTestId, color, onClick, typ
|
|
|
167
167
|
useTagRef.current.setAttribute("href", href[correctIconType]);
|
|
168
168
|
}
|
|
169
169
|
}, [correctIconType, href]);
|
|
170
|
-
return (jsx("span", { className: cvaIcon({ color, size, className }), onClick: onClick, "data-testid": dataTestId, ref: forwardedRef, children: jsxs("svg", { viewBox: correctIconType === "mini" ? "0 0 20 20" : "0 0 24 24", "data-testid": dataTestId ? `${dataTestId}-${iconName}` : iconName, style: style, role: "img", children: [jsx("title", { children: iconName }), jsx("use", { href: href[correctIconType], ref: useTagRef })] }) }));
|
|
170
|
+
return (jsx("span", { className: cvaIcon({ color, size, className }), onClick: onClick, "data-testid": dataTestId, ref: forwardedRef, children: jsxs("svg", { viewBox: correctIconType === "mini" ? "0 0 20 20" : "0 0 24 24", "data-testid": dataTestId ? `${dataTestId}-${iconName}` : iconName, style: style, role: "img", children: [jsx("title", { children: title ? title : iconName }), jsx("use", { href: href[correctIconType], ref: useTagRef })] }) }));
|
|
171
171
|
};
|
|
172
172
|
|
|
173
173
|
const cvaTag = cvaMerge([
|
|
@@ -915,8 +915,8 @@ const Card = (_a) => {
|
|
|
915
915
|
* @param {CardBodyProps} props - The props for the CardBody component
|
|
916
916
|
* @returns {JSX.Element} CardBody component
|
|
917
917
|
*/
|
|
918
|
-
const CardBody = ({ density = "auto", children, dataTestId, className, disableGap }) => {
|
|
919
|
-
return (jsx("div", { "data-testid": dataTestId, className: cvaCardBodyDensityContainer({ density, disableGap, className }), children: children }));
|
|
918
|
+
const CardBody = ({ density = "auto", children, dataTestId, className, disableGap, id }) => {
|
|
919
|
+
return (jsx("div", { "data-testid": dataTestId, id: id, className: cvaCardBodyDensityContainer({ density, disableGap, className }), children: children }));
|
|
920
920
|
};
|
|
921
921
|
|
|
922
922
|
/**
|
package/package.json
CHANGED
|
@@ -13,6 +13,10 @@ export interface CardBodyProps extends CommonProps {
|
|
|
13
13
|
* Child elements to render in the body
|
|
14
14
|
*/
|
|
15
15
|
children: React.ReactNode | null;
|
|
16
|
+
/**
|
|
17
|
+
* The id of the element.
|
|
18
|
+
*/
|
|
19
|
+
id?: string;
|
|
16
20
|
}
|
|
17
21
|
/**
|
|
18
22
|
* The CardBody component should be used to inform the user of important information.
|
|
@@ -22,4 +26,4 @@ export interface CardBodyProps extends CommonProps {
|
|
|
22
26
|
* @param {CardBodyProps} props - The props for the CardBody component
|
|
23
27
|
* @returns {JSX.Element} CardBody component
|
|
24
28
|
*/
|
|
25
|
-
export declare const CardBody: ({ density, children, dataTestId, className, disableGap }: CardBodyProps) => JSX.Element;
|
|
29
|
+
export declare const CardBody: ({ density, children, dataTestId, className, disableGap, id }: CardBodyProps) => JSX.Element;
|
|
@@ -310,6 +310,12 @@ export type IconProps = DiscriminatedIconProps & CommonProps & {
|
|
|
310
310
|
* @memberof IconProps
|
|
311
311
|
*/
|
|
312
312
|
style?: CSSProperties;
|
|
313
|
+
/**
|
|
314
|
+
* The title (text) to show in the tooltip when hovering over an icon
|
|
315
|
+
* Default title is the name of the icon.
|
|
316
|
+
* If a custom title is needed, set it using this prop.
|
|
317
|
+
*/
|
|
318
|
+
title?: string;
|
|
313
319
|
};
|
|
314
320
|
/**
|
|
315
321
|
* - The Icon component is used to display an Icon.
|
|
@@ -319,5 +325,5 @@ export type IconProps = DiscriminatedIconProps & CommonProps & {
|
|
|
319
325
|
* @param {IconProps} props - The props for the Icon component
|
|
320
326
|
* @returns {JSX.Element} Icon component
|
|
321
327
|
*/
|
|
322
|
-
export declare const Icon: ({ name, size, className, dataTestId, color, onClick, type, style, forwardedRef, }: IconProps) => JSX.Element;
|
|
328
|
+
export declare const Icon: ({ name, size, className, dataTestId, color, onClick, type, style, forwardedRef, title, }: IconProps) => JSX.Element;
|
|
323
329
|
export {};
|