@trackunit/react-components 0.1.301 → 0.1.304
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 +2 -2
- package/index.esm.js +2 -2
- package/package.json +1 -1
- package/src/components/Notice/Notice.d.ts +9 -1
package/index.cjs.js
CHANGED
|
@@ -3958,8 +3958,8 @@ const cvaNoticeIcon = cssClassVarianceUtilities.cvaMerge(["rounded-full", "items
|
|
|
3958
3958
|
* @returns {JSX.Element} Notice component
|
|
3959
3959
|
*/
|
|
3960
3960
|
const Notice = (_a) => {
|
|
3961
|
-
var { dataTestId, icon, label, color = "neutral", withLabel = true, className } = _a, rest = __rest(_a, ["dataTestId", "icon", "label", "color", "withLabel", "className"]);
|
|
3962
|
-
return (jsxRuntime.jsx(Tooltip, { className: className, disabled:
|
|
3961
|
+
var { dataTestId, icon, label, color = "neutral", withLabel = true, className, tooltipLabel = label, withTooltip = false } = _a, rest = __rest(_a, ["dataTestId", "icon", "label", "color", "withLabel", "className", "tooltipLabel", "withTooltip"]);
|
|
3962
|
+
return (jsxRuntime.jsx(Tooltip, { className: className, disabled: !withTooltip, label: tooltipLabel, placement: "bottom", children: jsxRuntime.jsxs("div", Object.assign({ "aria-label": label, className: cvaNotice(), "data-testid": dataTestId }, rest, { children: [jsxRuntime.jsx("div", { className: cvaNoticeIcon({ color }), "data-testid": dataTestId ? `${dataTestId}-icon` : "notice-icon", children: icon }), label !== undefined && withLabel ? (jsxRuntime.jsx("div", { className: cvaNoticeLabel({ color }), "data-testid": dataTestId ? `${dataTestId}-label` : "notice-label", children: label })) : null] })) }));
|
|
3963
3963
|
};
|
|
3964
3964
|
|
|
3965
3965
|
const cvaPage = cssClassVarianceUtilities.cvaMerge(["grid", "h-full"], {
|
package/index.esm.js
CHANGED
|
@@ -3927,8 +3927,8 @@ const cvaNoticeIcon = cvaMerge(["rounded-full", "items-center", "justify-center"
|
|
|
3927
3927
|
* @returns {JSX.Element} Notice component
|
|
3928
3928
|
*/
|
|
3929
3929
|
const Notice = (_a) => {
|
|
3930
|
-
var { dataTestId, icon, label, color = "neutral", withLabel = true, className } = _a, rest = __rest(_a, ["dataTestId", "icon", "label", "color", "withLabel", "className"]);
|
|
3931
|
-
return (jsx(Tooltip, { className: className, disabled:
|
|
3930
|
+
var { dataTestId, icon, label, color = "neutral", withLabel = true, className, tooltipLabel = label, withTooltip = false } = _a, rest = __rest(_a, ["dataTestId", "icon", "label", "color", "withLabel", "className", "tooltipLabel", "withTooltip"]);
|
|
3931
|
+
return (jsx(Tooltip, { className: className, disabled: !withTooltip, label: tooltipLabel, placement: "bottom", children: jsxs("div", Object.assign({ "aria-label": label, className: cvaNotice(), "data-testid": dataTestId }, rest, { children: [jsx("div", { className: cvaNoticeIcon({ color }), "data-testid": dataTestId ? `${dataTestId}-icon` : "notice-icon", children: icon }), label !== undefined && withLabel ? (jsx("div", { className: cvaNoticeLabel({ color }), "data-testid": dataTestId ? `${dataTestId}-label` : "notice-label", children: label })) : null] })) }));
|
|
3932
3932
|
};
|
|
3933
3933
|
|
|
3934
3934
|
const cvaPage = cvaMerge(["grid", "h-full"], {
|
package/package.json
CHANGED
|
@@ -18,6 +18,14 @@ export interface NoticeProps extends CommonProps {
|
|
|
18
18
|
* A boolean parameter to display or hide label and instead show as html title on hover, default value is true
|
|
19
19
|
*/
|
|
20
20
|
withLabel?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* A string to set the label in tooltip, if not set it will be the same as the label
|
|
23
|
+
*/
|
|
24
|
+
tooltipLabel?: string;
|
|
25
|
+
/**
|
|
26
|
+
* A flag to enable the tooltip
|
|
27
|
+
*/
|
|
28
|
+
withTooltip?: boolean;
|
|
21
29
|
}
|
|
22
30
|
/**
|
|
23
31
|
* Notices are non-interactive elements that communicate information that the user needs to see, without directly prompting an action button.
|
|
@@ -29,4 +37,4 @@ export interface NoticeProps extends CommonProps {
|
|
|
29
37
|
* @param {NoticeProps} props - The props for the Notice component
|
|
30
38
|
* @returns {JSX.Element} Notice component
|
|
31
39
|
*/
|
|
32
|
-
export declare const Notice: ({ dataTestId, icon, label, color, withLabel, className, ...rest }: NoticeProps) => JSX.Element;
|
|
40
|
+
export declare const Notice: ({ dataTestId, icon, label, color, withLabel, className, tooltipLabel, withTooltip, ...rest }: NoticeProps) => JSX.Element;
|