@trackunit/react-widgets 3.6.46 → 3.6.48

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
@@ -195,7 +195,8 @@ const useWidgetListItemClickAnalytics = ({ pageName, }) => {
195
195
  return react.useMemo(() => ({ trackWidgetListItemClick }), [trackWidgetListItemClick]);
196
196
  };
197
197
 
198
- const cvaWidgetContent = cssClassVarianceUtilities.cvaMerge(["@container", "overflow-hidden", "h-full", "w-full", "bg-white", "grid"], {
198
+ const cvaWidgetContent = cssClassVarianceUtilities.cva({
199
+ base: ["@container", "overflow-hidden", "h-full", "w-full", "bg-white", "grid"],
199
200
  variants: {
200
201
  layout: {
201
202
  none: "",
@@ -311,7 +312,8 @@ const WidgetContent = ({ children, "data-testid": dataTestId, layout = "none", p
311
312
  return (jsxRuntime.jsx("div", { className: cvaWidgetContent({ layout, padding, gap, className, centering }), "data-testid": dataTestId, ref: ref, style: style, children: children }));
312
313
  };
313
314
 
314
- const cvaWidgetEditBodyContainer = cssClassVarianceUtilities.cvaMerge(["absolute", "left-1/2", "top-1/2", "flex", "origin-center", "-translate-x-1/2", "-translate-y-1/2", "w-96"], {
315
+ const cvaWidgetEditBodyContainer = cssClassVarianceUtilities.cva({
316
+ base: ["absolute", "left-1/2", "top-1/2", "flex", "origin-center", "-translate-x-1/2", "-translate-y-1/2", "w-96"],
315
317
  variants: {
316
318
  direction: {
317
319
  row: "flex-row",
@@ -350,7 +352,8 @@ const WidgetEditBody = ({ children, "data-testid": dataTestId, className, onCanc
350
352
  }, children: t("widget.edit.save") })] })] }));
351
353
  };
352
354
 
353
- const cvaWidgetKPI = cssClassVarianceUtilities.cvaMerge(["w-full", "h-full", "flex", "flex-col"], {
355
+ const cvaWidgetKPI = cssClassVarianceUtilities.cva({
356
+ base: ["w-full", "h-full", "flex", "flex-col"],
354
357
  variants: {
355
358
  variant: {
356
359
  small: ["px-3"],
@@ -362,25 +365,24 @@ const cvaWidgetKPI = cssClassVarianceUtilities.cvaMerge(["w-full", "h-full", "fl
362
365
  variant: "default",
363
366
  },
364
367
  });
365
- const cvaWidgetKPIHeader = cssClassVarianceUtilities.cvaMerge(["flex", "flex-row", "place-items-end", "gap-2", "min-h-[1.7lh]"]);
366
- const cvaWidgetKPITitleText = cssClassVarianceUtilities.cvaMerge([
367
- "leading-tight",
368
- "!line-clamp-2",
369
- "!overflow-hidden",
370
- "flex",
371
- "items-start",
372
- "text-sm",
373
- "font-medium",
374
- "text-neutral-500",
375
- ]);
376
- const cvaWidgetKPIvalueText = cssClassVarianceUtilities.cvaMerge([
377
- "truncate",
378
- "whitespace-nowrap",
379
- "text-3xl",
380
- "font-medium",
381
- "!leading-none",
382
- ]);
383
- const cvaWidgetKPIContentLayout = cssClassVarianceUtilities.cvaMerge(["flex", "flex-1"], {
368
+ const cvaWidgetKPIHeader = cssClassVarianceUtilities.cva({ base: ["flex", "flex-row", "place-items-end", "gap-2", "min-h-[1.7lh]"] });
369
+ const cvaWidgetKPITitleText = cssClassVarianceUtilities.cva({
370
+ base: [
371
+ "leading-tight",
372
+ "!line-clamp-2",
373
+ "!overflow-hidden",
374
+ "flex",
375
+ "items-start",
376
+ "text-sm",
377
+ "font-medium",
378
+ "text-neutral-500",
379
+ ],
380
+ });
381
+ const cvaWidgetKPIvalueText = cssClassVarianceUtilities.cva({
382
+ base: ["truncate", "whitespace-nowrap", "text-3xl", "font-medium", "!leading-none"],
383
+ });
384
+ const cvaWidgetKPIContentLayout = cssClassVarianceUtilities.cva({
385
+ base: ["flex", "flex-1"],
384
386
  variants: {
385
387
  interactive: {
386
388
  true: ["flex-row"],
@@ -391,7 +393,8 @@ const cvaWidgetKPIContentLayout = cssClassVarianceUtilities.cvaMerge(["flex", "f
391
393
  interactive: false,
392
394
  },
393
395
  });
394
- const cvaWidgetKPIBodyLayout = cssClassVarianceUtilities.cvaMerge(["flex", "flex-col", "flex-1"], {
396
+ const cvaWidgetKPIBodyLayout = cssClassVarianceUtilities.cva({
397
+ base: ["flex", "flex-col", "flex-1"],
395
398
  variants: {
396
399
  interactive: {
397
400
  true: ["min-w-0"],
package/index.esm.js CHANGED
@@ -4,7 +4,7 @@ import { EmptyState, Card, CardHeader, IconButton, Icon, CardBody, CardFooter, B
4
4
  import { WidgetConfigRuntime, createEvent } from '@trackunit/iris-app-runtime-core';
5
5
  import { useAnalytics } from '@trackunit/react-core-hooks';
6
6
  import { useMemo, useCallback, useState } from 'react';
7
- import { cvaMerge } from '@trackunit/css-class-variance-utilities';
7
+ import { cva } from '@trackunit/css-class-variance-utilities';
8
8
  import { twMerge } from 'tailwind-merge';
9
9
 
10
10
  var defaultTranslations = {
@@ -193,7 +193,8 @@ const useWidgetListItemClickAnalytics = ({ pageName, }) => {
193
193
  return useMemo(() => ({ trackWidgetListItemClick }), [trackWidgetListItemClick]);
194
194
  };
195
195
 
196
- const cvaWidgetContent = cvaMerge(["@container", "overflow-hidden", "h-full", "w-full", "bg-white", "grid"], {
196
+ const cvaWidgetContent = cva({
197
+ base: ["@container", "overflow-hidden", "h-full", "w-full", "bg-white", "grid"],
197
198
  variants: {
198
199
  layout: {
199
200
  none: "",
@@ -309,7 +310,8 @@ const WidgetContent = ({ children, "data-testid": dataTestId, layout = "none", p
309
310
  return (jsx("div", { className: cvaWidgetContent({ layout, padding, gap, className, centering }), "data-testid": dataTestId, ref: ref, style: style, children: children }));
310
311
  };
311
312
 
312
- const cvaWidgetEditBodyContainer = cvaMerge(["absolute", "left-1/2", "top-1/2", "flex", "origin-center", "-translate-x-1/2", "-translate-y-1/2", "w-96"], {
313
+ const cvaWidgetEditBodyContainer = cva({
314
+ base: ["absolute", "left-1/2", "top-1/2", "flex", "origin-center", "-translate-x-1/2", "-translate-y-1/2", "w-96"],
313
315
  variants: {
314
316
  direction: {
315
317
  row: "flex-row",
@@ -348,7 +350,8 @@ const WidgetEditBody = ({ children, "data-testid": dataTestId, className, onCanc
348
350
  }, children: t("widget.edit.save") })] })] }));
349
351
  };
350
352
 
351
- const cvaWidgetKPI = cvaMerge(["w-full", "h-full", "flex", "flex-col"], {
353
+ const cvaWidgetKPI = cva({
354
+ base: ["w-full", "h-full", "flex", "flex-col"],
352
355
  variants: {
353
356
  variant: {
354
357
  small: ["px-3"],
@@ -360,25 +363,24 @@ const cvaWidgetKPI = cvaMerge(["w-full", "h-full", "flex", "flex-col"], {
360
363
  variant: "default",
361
364
  },
362
365
  });
363
- const cvaWidgetKPIHeader = cvaMerge(["flex", "flex-row", "place-items-end", "gap-2", "min-h-[1.7lh]"]);
364
- const cvaWidgetKPITitleText = cvaMerge([
365
- "leading-tight",
366
- "!line-clamp-2",
367
- "!overflow-hidden",
368
- "flex",
369
- "items-start",
370
- "text-sm",
371
- "font-medium",
372
- "text-neutral-500",
373
- ]);
374
- const cvaWidgetKPIvalueText = cvaMerge([
375
- "truncate",
376
- "whitespace-nowrap",
377
- "text-3xl",
378
- "font-medium",
379
- "!leading-none",
380
- ]);
381
- const cvaWidgetKPIContentLayout = cvaMerge(["flex", "flex-1"], {
366
+ const cvaWidgetKPIHeader = cva({ base: ["flex", "flex-row", "place-items-end", "gap-2", "min-h-[1.7lh]"] });
367
+ const cvaWidgetKPITitleText = cva({
368
+ base: [
369
+ "leading-tight",
370
+ "!line-clamp-2",
371
+ "!overflow-hidden",
372
+ "flex",
373
+ "items-start",
374
+ "text-sm",
375
+ "font-medium",
376
+ "text-neutral-500",
377
+ ],
378
+ });
379
+ const cvaWidgetKPIvalueText = cva({
380
+ base: ["truncate", "whitespace-nowrap", "text-3xl", "font-medium", "!leading-none"],
381
+ });
382
+ const cvaWidgetKPIContentLayout = cva({
383
+ base: ["flex", "flex-1"],
382
384
  variants: {
383
385
  interactive: {
384
386
  true: ["flex-row"],
@@ -389,7 +391,8 @@ const cvaWidgetKPIContentLayout = cvaMerge(["flex", "flex-1"], {
389
391
  interactive: false,
390
392
  },
391
393
  });
392
- const cvaWidgetKPIBodyLayout = cvaMerge(["flex", "flex-col", "flex-1"], {
394
+ const cvaWidgetKPIBodyLayout = cva({
395
+ base: ["flex", "flex-col", "flex-1"],
393
396
  variants: {
394
397
  interactive: {
395
398
  true: ["min-w-0"],
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@trackunit/react-widgets",
3
- "version": "3.6.46",
3
+ "version": "3.6.48",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
7
7
  "node": ">=24.x"
8
8
  },
9
9
  "dependencies": {
10
- "@trackunit/react-components": "2.12.0",
11
- "@trackunit/react-core-hooks": "1.21.40",
12
- "@trackunit/iris-app-runtime-core": "1.18.40",
13
- "@trackunit/css-class-variance-utilities": "1.14.28",
14
- "@trackunit/ui-design-tokens": "1.15.18",
15
- "@trackunit/ui-icons": "1.14.27",
16
- "@trackunit/i18n-library-translation": "2.4.40",
10
+ "@trackunit/react-components": "2.13.1",
11
+ "@trackunit/react-core-hooks": "1.21.42",
12
+ "@trackunit/iris-app-runtime-core": "1.18.42",
13
+ "@trackunit/css-class-variance-utilities": "2.0.0",
14
+ "@trackunit/ui-design-tokens": "1.15.20",
15
+ "@trackunit/ui-icons": "1.14.29",
16
+ "@trackunit/i18n-library-translation": "2.4.42",
17
17
  "tailwind-merge": "^2.0.0"
18
18
  },
19
19
  "peerDependencies": {
@@ -1,6 +1,116 @@
1
- export declare const cvaWidgetContent: (props?: ({
2
- layout?: "none" | "top-fill" | "fill-bottom" | "top-fill-bottom" | null | undefined;
3
- centering?: "none" | "centered" | null | undefined;
4
- gap?: "none" | "responsive" | null | undefined;
5
- padding?: "none" | "responsive" | null | undefined;
6
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
1
+ export declare const cvaWidgetContent: import("cva").CVAComponent<Omit<{
2
+ base: string[];
3
+ variants: {
4
+ layout: {
5
+ none: string;
6
+ "top-fill": string[];
7
+ "fill-bottom": string[];
8
+ "top-fill-bottom": string[];
9
+ };
10
+ centering: {
11
+ none: string;
12
+ centered: string;
13
+ };
14
+ gap: {
15
+ responsive: string;
16
+ none: string;
17
+ };
18
+ padding: {
19
+ responsive: string;
20
+ none: string;
21
+ };
22
+ };
23
+ defaultVariants: {
24
+ layout: "none";
25
+ centering: "none";
26
+ gap: "none";
27
+ padding: "none";
28
+ };
29
+ compoundVariants: ({
30
+ layout: "none";
31
+ centering: "centered";
32
+ class: "place-items-center"[];
33
+ padding?: undefined;
34
+ } | {
35
+ layout: "top-fill";
36
+ centering: "centered";
37
+ class: ("*:nth-2:grid" | "*:nth-2:place-items-center")[];
38
+ padding?: undefined;
39
+ } | {
40
+ layout: "fill-bottom";
41
+ centering: "centered";
42
+ class: ("*:nth-1:grid" | "*:nth-1:place-items-center")[];
43
+ padding?: undefined;
44
+ } | {
45
+ layout: "top-fill-bottom";
46
+ centering: "centered";
47
+ class: ("*:nth-2:grid" | "*:nth-2:place-items-center")[];
48
+ padding?: undefined;
49
+ } | {
50
+ layout: "none";
51
+ padding: "responsive";
52
+ class: "p-4"[];
53
+ centering?: undefined;
54
+ } | {
55
+ layout: "top-fill";
56
+ padding: "responsive";
57
+ class: "*:nth-2:p-4"[];
58
+ centering?: undefined;
59
+ } | {
60
+ layout: "fill-bottom";
61
+ padding: "responsive";
62
+ class: "*:nth-1:p-4"[];
63
+ centering?: undefined;
64
+ } | {
65
+ layout: "top-fill-bottom";
66
+ padding: "responsive";
67
+ class: "*:nth-2:p-4"[];
68
+ centering?: undefined;
69
+ })[];
70
+ }, "defaultVariants"> & {
71
+ variants: {
72
+ layout: {
73
+ none: string;
74
+ "top-fill": string[];
75
+ "fill-bottom": string[];
76
+ "top-fill-bottom": string[];
77
+ };
78
+ centering: {
79
+ none: string;
80
+ centered: string;
81
+ };
82
+ gap: {
83
+ responsive: string;
84
+ none: string;
85
+ };
86
+ padding: {
87
+ responsive: string;
88
+ none: string;
89
+ };
90
+ };
91
+ defaultVariants: Omit<{}, "layout" | "centering" | "gap" | "padding"> & {
92
+ layout: "none";
93
+ centering: "none";
94
+ gap: "none";
95
+ padding: "none";
96
+ };
97
+ }, {
98
+ layout: {
99
+ none: string;
100
+ "top-fill": string[];
101
+ "fill-bottom": string[];
102
+ "top-fill-bottom": string[];
103
+ };
104
+ centering: {
105
+ none: string;
106
+ centered: string;
107
+ };
108
+ gap: {
109
+ responsive: string;
110
+ none: string;
111
+ };
112
+ padding: {
113
+ responsive: string;
114
+ none: string;
115
+ };
116
+ }>;
@@ -1,3 +1,33 @@
1
- export declare const cvaWidgetEditBodyContainer: (props?: ({
2
- direction?: "row" | "row-reverse" | "column" | "column-reverse" | null | undefined;
3
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
1
+ export declare const cvaWidgetEditBodyContainer: import("cva").CVAComponent<Omit<{
2
+ base: string[];
3
+ variants: {
4
+ direction: {
5
+ row: string;
6
+ "row-reverse": string;
7
+ column: string;
8
+ "column-reverse": string;
9
+ };
10
+ };
11
+ defaultVariants: {
12
+ direction: "column";
13
+ };
14
+ }, "defaultVariants"> & {
15
+ variants: {
16
+ direction: {
17
+ row: string;
18
+ "row-reverse": string;
19
+ column: string;
20
+ "column-reverse": string;
21
+ };
22
+ };
23
+ defaultVariants: Omit<{}, "direction"> & {
24
+ direction: "column";
25
+ };
26
+ }, {
27
+ direction: {
28
+ row: string;
29
+ "row-reverse": string;
30
+ column: string;
31
+ "column-reverse": string;
32
+ };
33
+ }>;
@@ -1,12 +1,102 @@
1
- export declare const cvaWidgetKPI: (props?: ({
2
- variant?: "default" | "small" | "condensed" | null | undefined;
3
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
4
- export declare const cvaWidgetKPIHeader: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
5
- export declare const cvaWidgetKPITitleText: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
6
- export declare const cvaWidgetKPIvalueText: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
7
- export declare const cvaWidgetKPIContentLayout: (props?: ({
8
- interactive?: boolean | null | undefined;
9
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
10
- export declare const cvaWidgetKPIBodyLayout: (props?: ({
11
- interactive?: boolean | null | undefined;
12
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
1
+ export declare const cvaWidgetKPI: import("cva").CVAComponent<Omit<{
2
+ base: string[];
3
+ variants: {
4
+ variant: {
5
+ small: string[];
6
+ condensed: string[];
7
+ default: string[];
8
+ };
9
+ };
10
+ defaultVariants: {
11
+ variant: "default";
12
+ };
13
+ }, "defaultVariants"> & {
14
+ variants: {
15
+ variant: {
16
+ small: string[];
17
+ condensed: string[];
18
+ default: string[];
19
+ };
20
+ };
21
+ defaultVariants: Omit<{}, "variant"> & {
22
+ variant: "default";
23
+ };
24
+ }, {
25
+ variant: {
26
+ small: string[];
27
+ condensed: string[];
28
+ default: string[];
29
+ };
30
+ }>;
31
+ export declare const cvaWidgetKPIHeader: import("cva").CVAComponent<Omit<{
32
+ base: string[];
33
+ }, "defaultVariants"> & {
34
+ variants: unknown;
35
+ defaultVariants: Omit<{}, never>;
36
+ }, unknown>;
37
+ export declare const cvaWidgetKPITitleText: import("cva").CVAComponent<Omit<{
38
+ base: string[];
39
+ }, "defaultVariants"> & {
40
+ variants: unknown;
41
+ defaultVariants: Omit<{}, never>;
42
+ }, unknown>;
43
+ export declare const cvaWidgetKPIvalueText: import("cva").CVAComponent<Omit<{
44
+ base: string[];
45
+ }, "defaultVariants"> & {
46
+ variants: unknown;
47
+ defaultVariants: Omit<{}, never>;
48
+ }, unknown>;
49
+ export declare const cvaWidgetKPIContentLayout: import("cva").CVAComponent<Omit<{
50
+ base: string[];
51
+ variants: {
52
+ interactive: {
53
+ true: string[];
54
+ false: string[];
55
+ };
56
+ };
57
+ defaultVariants: {
58
+ interactive: false;
59
+ };
60
+ }, "defaultVariants"> & {
61
+ variants: {
62
+ interactive: {
63
+ true: string[];
64
+ false: string[];
65
+ };
66
+ };
67
+ defaultVariants: Omit<{}, "interactive"> & {
68
+ interactive: false;
69
+ };
70
+ }, {
71
+ interactive: {
72
+ true: string[];
73
+ false: string[];
74
+ };
75
+ }>;
76
+ export declare const cvaWidgetKPIBodyLayout: import("cva").CVAComponent<Omit<{
77
+ base: string[];
78
+ variants: {
79
+ interactive: {
80
+ true: string[];
81
+ false: never[];
82
+ };
83
+ };
84
+ defaultVariants: {
85
+ interactive: false;
86
+ };
87
+ }, "defaultVariants"> & {
88
+ variants: {
89
+ interactive: {
90
+ true: string[];
91
+ false: never[];
92
+ };
93
+ };
94
+ defaultVariants: Omit<{}, "interactive"> & {
95
+ interactive: false;
96
+ };
97
+ }, {
98
+ interactive: {
99
+ true: string[];
100
+ false: never[];
101
+ };
102
+ }>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"entry.js","sourceRoot":"","sources":["../../../../../libs/react/widgets/migrations/entry.ts"],"names":[],"mappings":"","sourcesContent":["export {};\n"]}