@trackunit/react-components 0.1.302 → 0.1.307

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
@@ -340,7 +340,12 @@ function __rest(s, e) {
340
340
  t[p[i]] = s[p[i]];
341
341
  }
342
342
  return t;
343
- }
343
+ }
344
+
345
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
346
+ var e = new Error(message);
347
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
348
+ };
344
349
 
345
350
  const cvaText = cssClassVarianceUtilities.cvaMerge(["text-black", "m-0", "relative", "text-sm", "font-normal"], {
346
351
  variants: {
@@ -494,7 +499,7 @@ const cvaButton = cssClassVarianceUtilities.cvaMerge([
494
499
  "cursor-pointer",
495
500
  "flex-none",
496
501
  "component-button-border",
497
- "component-button-padding",
502
+ "component-button-padding", //TODO: Is overwritten by size which messes with marketing theme
498
503
  "component-button-height",
499
504
  "focus:ring",
500
505
  "focus:ring-inset",
@@ -3958,8 +3963,8 @@ const cvaNoticeIcon = cssClassVarianceUtilities.cvaMerge(["rounded-full", "items
3958
3963
  * @returns {JSX.Element} Notice component
3959
3964
  */
3960
3965
  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: withLabel, label: label, 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] })) }));
3966
+ 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"]);
3967
+ 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
3968
  };
3964
3969
 
3965
3970
  const cvaPage = cssClassVarianceUtilities.cvaMerge(["grid", "h-full"], {
package/index.esm.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./src/index";
package/index.esm.js CHANGED
@@ -309,7 +309,12 @@ function __rest(s, e) {
309
309
  t[p[i]] = s[p[i]];
310
310
  }
311
311
  return t;
312
- }
312
+ }
313
+
314
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
315
+ var e = new Error(message);
316
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
317
+ };
313
318
 
314
319
  const cvaText = cvaMerge(["text-black", "m-0", "relative", "text-sm", "font-normal"], {
315
320
  variants: {
@@ -463,7 +468,7 @@ const cvaButton = cvaMerge([
463
468
  "cursor-pointer",
464
469
  "flex-none",
465
470
  "component-button-border",
466
- "component-button-padding",
471
+ "component-button-padding", //TODO: Is overwritten by size which messes with marketing theme
467
472
  "component-button-height",
468
473
  "focus:ring",
469
474
  "focus:ring-inset",
@@ -3927,8 +3932,8 @@ const cvaNoticeIcon = cvaMerge(["rounded-full", "items-center", "justify-center"
3927
3932
  * @returns {JSX.Element} Notice component
3928
3933
  */
3929
3934
  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: withLabel, label: label, 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] })) }));
3935
+ 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"]);
3936
+ 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
3937
  };
3933
3938
 
3934
3939
  const cvaPage = cvaMerge(["grid", "h-full"], {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-components",
3
- "version": "0.1.302",
3
+ "version": "0.1.307",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -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;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { CommonProps, Size } from "../../../common";
2
3
  export type BackToTopColor = "primary" | "secondary";
3
4
  export interface StyledBackToTopProps {
@@ -8,5 +8,5 @@ import { RefObject } from "react";
8
8
  * @param {Function} [onClick] - The event handler for the click outside event.
9
9
  */
10
10
  export declare const useClickOutside: (el: RefObject<HTMLElement> | RefObject<HTMLElement>[], options?: {
11
- active?: boolean | undefined;
12
- } | ((ev: MouseEvent) => void), onClick?: ((ev: MouseEvent) => void) | undefined) => void;
11
+ active?: boolean;
12
+ } | ((ev: MouseEvent) => void), onClick?: (ev: MouseEvent) => void) => void;
@@ -6,4 +6,4 @@ import { Dispatch, SetStateAction } from "react";
6
6
  *
7
7
  * If no custom state is provided, the fallback state will be used and it works like a normal useState hook.
8
8
  */
9
- export declare const useOptionallyElevatedState: <TState>(initialState: TState, customState?: [TState, Dispatch<SetStateAction<TState>>] | undefined) => [TState, Dispatch<SetStateAction<TState>>];
9
+ export declare const useOptionallyElevatedState: <TState>(initialState: TState, customState?: [TState, Dispatch<SetStateAction<TState>>]) => [TState, Dispatch<SetStateAction<TState>>];