@trackunit/react-components 1.4.157 → 1.4.158
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
|
@@ -203,24 +203,24 @@ const cvaTag = cssClassVarianceUtilities.cvaMerge([
|
|
|
203
203
|
default: "",
|
|
204
204
|
},
|
|
205
205
|
color: {
|
|
206
|
-
primary: "bg-primary-100 text-primary-700",
|
|
207
|
-
secondary: "bg-secondary-100 text-secondary-700",
|
|
208
|
-
neutral: "bg-neutral-100 text-neutral-700",
|
|
209
|
-
black: "bg-neutral-100 text-neutral-700",
|
|
210
|
-
white: "bg-white text-neutral-600",
|
|
211
|
-
info: "bg-info-100 text-info-700",
|
|
212
|
-
success: "bg-success-100 text-success-700",
|
|
213
|
-
warning: "bg-warning-100 text-warning-700",
|
|
214
|
-
danger: "bg-danger-100 text-danger-700",
|
|
215
|
-
good: "bg-good-100 text-good-700",
|
|
216
|
-
low: "bg-low-100 text-low-700",
|
|
217
|
-
critical: "bg-critical-100 text-critical-700",
|
|
218
|
-
working: "bg-working-100 text-working-700",
|
|
219
|
-
stopped: "bg-stopped-100 text-stopped-700",
|
|
220
|
-
idle: "bg-idle-100 text-idle-700",
|
|
221
|
-
unknown: "bg-unknown-100 text-unknown-700",
|
|
222
|
-
moving: "bg-neutral-100 text-neutral-700",
|
|
223
|
-
active: "bg-neutral-100 text-neutral-700",
|
|
206
|
+
primary: ["bg-primary-100", "text-primary-700"],
|
|
207
|
+
secondary: ["bg-secondary-100", "text-secondary-700"],
|
|
208
|
+
neutral: ["bg-neutral-100", "text-neutral-700"],
|
|
209
|
+
black: ["bg-neutral-100", "text-neutral-700"],
|
|
210
|
+
white: ["bg-white", "text-neutral-600"],
|
|
211
|
+
info: ["bg-info-100", "text-info-700"],
|
|
212
|
+
success: ["bg-success-100", "text-success-700"],
|
|
213
|
+
warning: ["bg-warning-100", "text-warning-700"],
|
|
214
|
+
danger: ["bg-danger-100", "text-danger-700"],
|
|
215
|
+
good: ["bg-good-100", "text-good-700"],
|
|
216
|
+
low: ["bg-low-100", "text-low-700"],
|
|
217
|
+
critical: ["bg-critical-100", "text-critical-700"],
|
|
218
|
+
working: ["bg-working-100", "text-working-700"],
|
|
219
|
+
stopped: ["bg-stopped-100", "text-stopped-700"],
|
|
220
|
+
idle: ["bg-idle-100", "text-idle-700"],
|
|
221
|
+
unknown: ["bg-unknown-100", "text-unknown-700"],
|
|
222
|
+
moving: ["bg-neutral-100", "text-neutral-700"],
|
|
223
|
+
active: ["bg-neutral-100", "text-neutral-700"],
|
|
224
224
|
},
|
|
225
225
|
border: {
|
|
226
226
|
none: "border-none",
|
|
@@ -238,16 +238,17 @@ const cvaTagIconContainer = cssClassVarianceUtilities.cvaMerge(["inline-flex", "
|
|
|
238
238
|
const cvaTagIcon = cssClassVarianceUtilities.cvaMerge(["cursor-pointer", "transition-opacity", "hover:opacity-70", "text-neutral-500"]);
|
|
239
239
|
|
|
240
240
|
/**
|
|
241
|
-
*
|
|
241
|
+
* The Tag component is used for labeling or categorizing items in the UI.
|
|
242
|
+
* It's commonly used to indicate the status of an asset, mark a feature as Beta,
|
|
243
|
+
* or display selected options in multi-select inputs.
|
|
242
244
|
*
|
|
243
|
-
*
|
|
245
|
+
* How to choose between Tag, Badge and Highlight?
|
|
246
|
+
* - Use a Tag for labeling statuses, categories, or selections.
|
|
247
|
+
* - Use a [Badge](https://apps.iris.trackunit.com/storybook/?path=/docs/react-components-badge--docs) to indicate notifications or counts of applied elements, such as filters.
|
|
248
|
+
* - Use a [Highlight](https://apps.iris.trackunit.com/storybook/?path=/docs/react-components-highlight--docs) to draw attention to values in plain text that require special attention or have crossed a threshold.
|
|
244
249
|
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
* **Do:** Use short labels for easy scanning.
|
|
248
|
-
*
|
|
249
|
-
* @param {TagProps} props - The props for the tag component
|
|
250
|
-
* @returns {ReactElement} tag component
|
|
250
|
+
* @param {TagProps} props - The props for the Tag component.
|
|
251
|
+
* @returns {ReactElement} The rendered Tag component.
|
|
251
252
|
*/
|
|
252
253
|
const Tag = ({ className, dataTestId, children, size = "medium", onClose, color = "primary", disabled = false, ref, icon, }) => {
|
|
253
254
|
const isSupportedDismissColor = react.useMemo(() => {
|
|
@@ -887,8 +888,13 @@ const cvaBadge = cssClassVarianceUtilities.cvaMerge([
|
|
|
887
888
|
});
|
|
888
889
|
|
|
889
890
|
/**
|
|
890
|
-
* The Badge component is used to
|
|
891
|
-
|
|
891
|
+
* The Badge component is used to indicate notifications or counts of applied elements.
|
|
892
|
+
* It's typically used to display numbers on elements like filters, tabs, or buttons.
|
|
893
|
+
*
|
|
894
|
+
* How to choose between Badge and Tag?
|
|
895
|
+
* - Use a Badge to indicate notifications or counts of applied elements.
|
|
896
|
+
* - Use a [Tag](https://apps.iris.trackunit.com/storybook/?path=/docs/react-components-tag--docs) for labeling statuses, categories, or selections.
|
|
897
|
+
*
|
|
892
898
|
* @param {BadgeProps} props - The props for the Badge component
|
|
893
899
|
* @returns {ReactElement} Badge component
|
|
894
900
|
*/
|
package/index.esm.js
CHANGED
|
@@ -201,24 +201,24 @@ const cvaTag = cvaMerge([
|
|
|
201
201
|
default: "",
|
|
202
202
|
},
|
|
203
203
|
color: {
|
|
204
|
-
primary: "bg-primary-100 text-primary-700",
|
|
205
|
-
secondary: "bg-secondary-100 text-secondary-700",
|
|
206
|
-
neutral: "bg-neutral-100 text-neutral-700",
|
|
207
|
-
black: "bg-neutral-100 text-neutral-700",
|
|
208
|
-
white: "bg-white text-neutral-600",
|
|
209
|
-
info: "bg-info-100 text-info-700",
|
|
210
|
-
success: "bg-success-100 text-success-700",
|
|
211
|
-
warning: "bg-warning-100 text-warning-700",
|
|
212
|
-
danger: "bg-danger-100 text-danger-700",
|
|
213
|
-
good: "bg-good-100 text-good-700",
|
|
214
|
-
low: "bg-low-100 text-low-700",
|
|
215
|
-
critical: "bg-critical-100 text-critical-700",
|
|
216
|
-
working: "bg-working-100 text-working-700",
|
|
217
|
-
stopped: "bg-stopped-100 text-stopped-700",
|
|
218
|
-
idle: "bg-idle-100 text-idle-700",
|
|
219
|
-
unknown: "bg-unknown-100 text-unknown-700",
|
|
220
|
-
moving: "bg-neutral-100 text-neutral-700",
|
|
221
|
-
active: "bg-neutral-100 text-neutral-700",
|
|
204
|
+
primary: ["bg-primary-100", "text-primary-700"],
|
|
205
|
+
secondary: ["bg-secondary-100", "text-secondary-700"],
|
|
206
|
+
neutral: ["bg-neutral-100", "text-neutral-700"],
|
|
207
|
+
black: ["bg-neutral-100", "text-neutral-700"],
|
|
208
|
+
white: ["bg-white", "text-neutral-600"],
|
|
209
|
+
info: ["bg-info-100", "text-info-700"],
|
|
210
|
+
success: ["bg-success-100", "text-success-700"],
|
|
211
|
+
warning: ["bg-warning-100", "text-warning-700"],
|
|
212
|
+
danger: ["bg-danger-100", "text-danger-700"],
|
|
213
|
+
good: ["bg-good-100", "text-good-700"],
|
|
214
|
+
low: ["bg-low-100", "text-low-700"],
|
|
215
|
+
critical: ["bg-critical-100", "text-critical-700"],
|
|
216
|
+
working: ["bg-working-100", "text-working-700"],
|
|
217
|
+
stopped: ["bg-stopped-100", "text-stopped-700"],
|
|
218
|
+
idle: ["bg-idle-100", "text-idle-700"],
|
|
219
|
+
unknown: ["bg-unknown-100", "text-unknown-700"],
|
|
220
|
+
moving: ["bg-neutral-100", "text-neutral-700"],
|
|
221
|
+
active: ["bg-neutral-100", "text-neutral-700"],
|
|
222
222
|
},
|
|
223
223
|
border: {
|
|
224
224
|
none: "border-none",
|
|
@@ -236,16 +236,17 @@ const cvaTagIconContainer = cvaMerge(["inline-flex", "self-center"]);
|
|
|
236
236
|
const cvaTagIcon = cvaMerge(["cursor-pointer", "transition-opacity", "hover:opacity-70", "text-neutral-500"]);
|
|
237
237
|
|
|
238
238
|
/**
|
|
239
|
-
*
|
|
239
|
+
* The Tag component is used for labeling or categorizing items in the UI.
|
|
240
|
+
* It's commonly used to indicate the status of an asset, mark a feature as Beta,
|
|
241
|
+
* or display selected options in multi-select inputs.
|
|
240
242
|
*
|
|
241
|
-
*
|
|
243
|
+
* How to choose between Tag, Badge and Highlight?
|
|
244
|
+
* - Use a Tag for labeling statuses, categories, or selections.
|
|
245
|
+
* - Use a [Badge](https://apps.iris.trackunit.com/storybook/?path=/docs/react-components-badge--docs) to indicate notifications or counts of applied elements, such as filters.
|
|
246
|
+
* - Use a [Highlight](https://apps.iris.trackunit.com/storybook/?path=/docs/react-components-highlight--docs) to draw attention to values in plain text that require special attention or have crossed a threshold.
|
|
242
247
|
*
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
* **Do:** Use short labels for easy scanning.
|
|
246
|
-
*
|
|
247
|
-
* @param {TagProps} props - The props for the tag component
|
|
248
|
-
* @returns {ReactElement} tag component
|
|
248
|
+
* @param {TagProps} props - The props for the Tag component.
|
|
249
|
+
* @returns {ReactElement} The rendered Tag component.
|
|
249
250
|
*/
|
|
250
251
|
const Tag = ({ className, dataTestId, children, size = "medium", onClose, color = "primary", disabled = false, ref, icon, }) => {
|
|
251
252
|
const isSupportedDismissColor = useMemo(() => {
|
|
@@ -885,8 +886,13 @@ const cvaBadge = cvaMerge([
|
|
|
885
886
|
});
|
|
886
887
|
|
|
887
888
|
/**
|
|
888
|
-
* The Badge component is used to
|
|
889
|
-
|
|
889
|
+
* The Badge component is used to indicate notifications or counts of applied elements.
|
|
890
|
+
* It's typically used to display numbers on elements like filters, tabs, or buttons.
|
|
891
|
+
*
|
|
892
|
+
* How to choose between Badge and Tag?
|
|
893
|
+
* - Use a Badge to indicate notifications or counts of applied elements.
|
|
894
|
+
* - Use a [Tag](https://apps.iris.trackunit.com/storybook/?path=/docs/react-components-tag--docs) for labeling statuses, categories, or selections.
|
|
895
|
+
*
|
|
890
896
|
* @param {BadgeProps} props - The props for the Badge component
|
|
891
897
|
* @returns {ReactElement} Badge component
|
|
892
898
|
*/
|
package/package.json
CHANGED
|
@@ -32,8 +32,13 @@ interface BaseBadgeProps extends CommonProps {
|
|
|
32
32
|
}
|
|
33
33
|
export type BadgeProps = BaseBadgeProps;
|
|
34
34
|
/**
|
|
35
|
-
* The Badge component is used to
|
|
36
|
-
|
|
35
|
+
* The Badge component is used to indicate notifications or counts of applied elements.
|
|
36
|
+
* It's typically used to display numbers on elements like filters, tabs, or buttons.
|
|
37
|
+
*
|
|
38
|
+
* How to choose between Badge and Tag?
|
|
39
|
+
* - Use a Badge to indicate notifications or counts of applied elements.
|
|
40
|
+
* - Use a [Tag](https://apps.iris.trackunit.com/storybook/?path=/docs/react-components-tag--docs) for labeling statuses, categories, or selections.
|
|
41
|
+
*
|
|
37
42
|
* @param {BadgeProps} props - The props for the Badge component
|
|
38
43
|
* @returns {ReactElement} Badge component
|
|
39
44
|
*/
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ReactNode, Ref } from "react";
|
|
2
|
+
import { CommonProps, Size } from "../../common";
|
|
3
|
+
export type HighlightSize = Extract<Size, "small" | "medium">;
|
|
4
|
+
export interface HighlightProps extends CommonProps {
|
|
5
|
+
/**
|
|
6
|
+
* The color of the highlight. Allowed values: "primary", "success", "warning", "danger", "unknown".
|
|
7
|
+
*/
|
|
8
|
+
color?: "primary" | "success" | "warning" | "danger" | "unknown";
|
|
9
|
+
/**
|
|
10
|
+
* The content of the highlight. Accepts any valid React children (text, numbers, elements).
|
|
11
|
+
*/
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* A ref for the component
|
|
15
|
+
*/
|
|
16
|
+
ref?: Ref<HTMLDivElement>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The Highlight component is used to draw attention to data values that may require user action, monitoring, or investigation.
|
|
20
|
+
* It visually emphasizes out-of-range or critical values using color cues (e.g. danger or warning) to support quick scanning and awareness.
|
|
21
|
+
*
|
|
22
|
+
* How to choose between Highlight and Tag?
|
|
23
|
+
* - Use Highlight to draw attention to values in plain text that require special attention or have crossed a threshold.
|
|
24
|
+
* - Use a [Tag](https://apps.iris.trackunit.com/storybook/?path=/docs/react-components-tag--docs) for labeling statuses, categories, or selections.
|
|
25
|
+
*
|
|
26
|
+
* @param {HighlightProps} props - The props for the highlight component
|
|
27
|
+
* @returns {ReactElement} highlight component
|
|
28
|
+
*/
|
|
29
|
+
export declare const Highlight: {
|
|
30
|
+
({ className, dataTestId, children, color, ref }: HighlightProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
displayName: string;
|
|
32
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const cvaHighlight: (props?: ({
|
|
2
|
+
color?: "primary" | "success" | "warning" | "danger" | "unknown" | null | undefined;
|
|
3
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
4
|
+
export declare const cvaHighlightText: (props?: import("class-variance-authority/dist/types").ClassProp | undefined) => string;
|
|
@@ -39,16 +39,17 @@ export interface TagProps extends CommonProps {
|
|
|
39
39
|
icon?: ReactNode;
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
42
|
+
* The Tag component is used for labeling or categorizing items in the UI.
|
|
43
|
+
* It's commonly used to indicate the status of an asset, mark a feature as Beta,
|
|
44
|
+
* or display selected options in multi-select inputs.
|
|
43
45
|
*
|
|
44
|
-
*
|
|
46
|
+
* How to choose between Tag, Badge and Highlight?
|
|
47
|
+
* - Use a Tag for labeling statuses, categories, or selections.
|
|
48
|
+
* - Use a [Badge](https://apps.iris.trackunit.com/storybook/?path=/docs/react-components-badge--docs) to indicate notifications or counts of applied elements, such as filters.
|
|
49
|
+
* - Use a [Highlight](https://apps.iris.trackunit.com/storybook/?path=/docs/react-components-highlight--docs) to draw attention to values in plain text that require special attention or have crossed a threshold.
|
|
45
50
|
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* **Do:** Use short labels for easy scanning.
|
|
49
|
-
*
|
|
50
|
-
* @param {TagProps} props - The props for the tag component
|
|
51
|
-
* @returns {ReactElement} tag component
|
|
51
|
+
* @param {TagProps} props - The props for the Tag component.
|
|
52
|
+
* @returns {ReactElement} The rendered Tag component.
|
|
52
53
|
*/
|
|
53
54
|
export declare const Tag: {
|
|
54
55
|
({ className, dataTestId, children, size, onClose, color, disabled, ref, icon, }: TagProps): import("react/jsx-runtime").JSX.Element;
|