@trackunit/react-date-and-time-components 2.6.47 → 2.6.49

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
@@ -392,7 +392,8 @@ const DayRangeSelectOptions = ({ "data-testid": dataTestId, temporalPeriods, sel
392
392
  };
393
393
  const stringifyTemporalPeriod = (temporalPeriod) => `${temporalPeriod.direction}-${temporalPeriod.count}-${temporalPeriod.unit}`;
394
394
 
395
- const cvaTriggerButton = cssClassVarianceUtilities.cvaMerge(["justify-start"], {
395
+ const cvaTriggerButton = cssClassVarianceUtilities.cva({
396
+ base: ["justify-start"],
396
397
  variants: {
397
398
  active: {
398
399
  true: "text-primary-600 hover:text-primary-700 active:text-primary-800 focus:text-primary-800",
@@ -790,7 +791,8 @@ const DayRangeSelect = ({ className, "data-testid": dataTestId, disabled = false
790
791
  } })] }));
791
792
  };
792
793
 
793
- const cvaTimelineElement = cssClassVarianceUtilities.cvaMerge(["flex", "group/timeline"], {
794
+ const cvaTimelineElement = cssClassVarianceUtilities.cva({
795
+ base: ["flex", "group/timeline"],
794
796
  variants: {
795
797
  selected: {
796
798
  true: "bg-info-50 rounded-[4px]",
@@ -802,27 +804,20 @@ const cvaTimelineElement = cssClassVarianceUtilities.cvaMerge(["flex", "group/ti
802
804
  },
803
805
  },
804
806
  });
805
- const cvaDotWrapper = cssClassVarianceUtilities.cvaMerge([
806
- "relative",
807
- "flex",
808
- "flex-col",
809
- "items-center",
810
- "justify-items-center",
811
- "ml-2",
812
- "mr-2",
813
- "pt-2",
814
- "min-w-6",
815
- ]);
816
- const cvaLine = cssClassVarianceUtilities.cvaMerge([
817
- "absolute",
818
- "top-0",
819
- "w-px",
820
- "h-full",
821
- "border-l",
822
- "border-neutral-300",
823
- "group-first/timeline:top-3.5",
824
- "group-last/timeline:h-4",
825
- ], {
807
+ const cvaDotWrapper = cssClassVarianceUtilities.cva({
808
+ base: ["relative", "flex", "flex-col", "items-center", "justify-items-center", "ml-2", "mr-2", "pt-2", "min-w-6"],
809
+ });
810
+ const cvaLine = cssClassVarianceUtilities.cva({
811
+ base: [
812
+ "absolute",
813
+ "top-0",
814
+ "w-px",
815
+ "h-full",
816
+ "border-l",
817
+ "border-neutral-300",
818
+ "group-first/timeline:top-3.5",
819
+ "group-last/timeline:h-4",
820
+ ],
826
821
  variants: {
827
822
  lineStyle: {
828
823
  dashed: "border-dashed",
@@ -830,19 +825,22 @@ const cvaLine = cssClassVarianceUtilities.cvaMerge([
830
825
  },
831
826
  },
832
827
  });
833
- const cvaCustomDot = cssClassVarianceUtilities.cvaMerge([
834
- "flex",
835
- "items-center",
836
- "justify-center",
837
- "w-5",
838
- "h-5",
839
- "bg-white",
840
- "rounded-full",
841
- "border",
842
- "border-white",
843
- "z-[2]",
844
- ]);
845
- const cvaToggleBtnIcon = cssClassVarianceUtilities.cvaMerge(["mr-1", "rounded-lg", "transition-transform", "duration-300", "cursor-pointer"], {
828
+ const cvaCustomDot = cssClassVarianceUtilities.cva({
829
+ base: [
830
+ "flex",
831
+ "items-center",
832
+ "justify-center",
833
+ "w-5",
834
+ "h-5",
835
+ "bg-white",
836
+ "rounded-full",
837
+ "border",
838
+ "border-white",
839
+ "z-[2]",
840
+ ],
841
+ });
842
+ const cvaToggleBtnIcon = cssClassVarianceUtilities.cva({
843
+ base: ["mr-1", "rounded-lg", "transition-transform", "duration-300", "cursor-pointer"],
846
844
  variants: {
847
845
  rotated: {
848
846
  true: "rotate-180",
@@ -850,7 +848,8 @@ const cvaToggleBtnIcon = cssClassVarianceUtilities.cvaMerge(["mr-1", "rounded-lg
850
848
  },
851
849
  },
852
850
  });
853
- const cvaTimelineElementTime = cssClassVarianceUtilities.cvaMerge(["min-h-6", "content-center"], {
851
+ const cvaTimelineElementTime = cssClassVarianceUtilities.cva({
852
+ base: ["min-h-6", "content-center"],
854
853
  variants: {
855
854
  width: {
856
855
  large: "min-w-16",
@@ -988,7 +987,7 @@ const TimelineElement = ({ date, children, className, style, "data-testid": data
988
987
  setIsHovered(false);
989
988
  }
990
989
  };
991
- return (jsxRuntime.jsxs("div", { className: cvaTimelineElement({ className, selected, hoverBehavior }), "data-date": date, "data-testid": dataTestId, onClick: onClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: style, children: [renderDate(formattedDate, locale), jsxRuntime.jsxs("div", { className: cvaDotWrapper(), children: [renderDot(customDot, isHovered, selected), jsxRuntime.jsx("div", { className: cvaLine({ lineStyle }) })] }), jsxRuntime.jsxs("div", { className: "pb-2 pt-2", children: [renderHeader(header, dataTestId), renderChildren(children), renderActionButton(actionButton)] })] }));
990
+ return (jsxRuntime.jsxs("div", { className: cvaTimelineElement({ className, selected, hoverBehavior }), "data-date": date, "data-testid": dataTestId, onClick: onClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: style, children: [renderDate(formattedDate, locale), jsxRuntime.jsxs("div", { className: cvaDotWrapper(), children: [renderDot(customDot, isHovered, selected), jsxRuntime.jsx("div", { className: cvaLine({ lineStyle }), "data-testid": `${dataTestId}-line` })] }), jsxRuntime.jsxs("div", { className: "pb-2 pt-2", children: [renderHeader(header, dataTestId), renderChildren(children), renderActionButton(actionButton)] })] }));
992
991
  };
993
992
  const renderDate = (formattedDate, locale) => {
994
993
  if (!formattedDate) {
package/index.esm.js CHANGED
@@ -8,7 +8,7 @@ import { twMerge } from 'tailwind-merge';
8
8
  import { Tooltip, Button, MenuItem, Icon, Popover, PopoverTrigger, PopoverContent, MenuContent, MenuDivider, Card, Text } from '@trackunit/react-components';
9
9
  import Calendar from 'react-calendar';
10
10
  import { Search } from '@trackunit/react-form-components';
11
- import { cvaMerge } from '@trackunit/css-class-variance-utilities';
11
+ import { cva } from '@trackunit/css-class-variance-utilities';
12
12
  import { lowerCase } from 'string-ts';
13
13
 
14
14
  var defaultTranslations = {
@@ -390,7 +390,8 @@ const DayRangeSelectOptions = ({ "data-testid": dataTestId, temporalPeriods, sel
390
390
  };
391
391
  const stringifyTemporalPeriod = (temporalPeriod) => `${temporalPeriod.direction}-${temporalPeriod.count}-${temporalPeriod.unit}`;
392
392
 
393
- const cvaTriggerButton = cvaMerge(["justify-start"], {
393
+ const cvaTriggerButton = cva({
394
+ base: ["justify-start"],
394
395
  variants: {
395
396
  active: {
396
397
  true: "text-primary-600 hover:text-primary-700 active:text-primary-800 focus:text-primary-800",
@@ -788,7 +789,8 @@ const DayRangeSelect = ({ className, "data-testid": dataTestId, disabled = false
788
789
  } })] }));
789
790
  };
790
791
 
791
- const cvaTimelineElement = cvaMerge(["flex", "group/timeline"], {
792
+ const cvaTimelineElement = cva({
793
+ base: ["flex", "group/timeline"],
792
794
  variants: {
793
795
  selected: {
794
796
  true: "bg-info-50 rounded-[4px]",
@@ -800,27 +802,20 @@ const cvaTimelineElement = cvaMerge(["flex", "group/timeline"], {
800
802
  },
801
803
  },
802
804
  });
803
- const cvaDotWrapper = cvaMerge([
804
- "relative",
805
- "flex",
806
- "flex-col",
807
- "items-center",
808
- "justify-items-center",
809
- "ml-2",
810
- "mr-2",
811
- "pt-2",
812
- "min-w-6",
813
- ]);
814
- const cvaLine = cvaMerge([
815
- "absolute",
816
- "top-0",
817
- "w-px",
818
- "h-full",
819
- "border-l",
820
- "border-neutral-300",
821
- "group-first/timeline:top-3.5",
822
- "group-last/timeline:h-4",
823
- ], {
805
+ const cvaDotWrapper = cva({
806
+ base: ["relative", "flex", "flex-col", "items-center", "justify-items-center", "ml-2", "mr-2", "pt-2", "min-w-6"],
807
+ });
808
+ const cvaLine = cva({
809
+ base: [
810
+ "absolute",
811
+ "top-0",
812
+ "w-px",
813
+ "h-full",
814
+ "border-l",
815
+ "border-neutral-300",
816
+ "group-first/timeline:top-3.5",
817
+ "group-last/timeline:h-4",
818
+ ],
824
819
  variants: {
825
820
  lineStyle: {
826
821
  dashed: "border-dashed",
@@ -828,19 +823,22 @@ const cvaLine = cvaMerge([
828
823
  },
829
824
  },
830
825
  });
831
- const cvaCustomDot = cvaMerge([
832
- "flex",
833
- "items-center",
834
- "justify-center",
835
- "w-5",
836
- "h-5",
837
- "bg-white",
838
- "rounded-full",
839
- "border",
840
- "border-white",
841
- "z-[2]",
842
- ]);
843
- const cvaToggleBtnIcon = cvaMerge(["mr-1", "rounded-lg", "transition-transform", "duration-300", "cursor-pointer"], {
826
+ const cvaCustomDot = cva({
827
+ base: [
828
+ "flex",
829
+ "items-center",
830
+ "justify-center",
831
+ "w-5",
832
+ "h-5",
833
+ "bg-white",
834
+ "rounded-full",
835
+ "border",
836
+ "border-white",
837
+ "z-[2]",
838
+ ],
839
+ });
840
+ const cvaToggleBtnIcon = cva({
841
+ base: ["mr-1", "rounded-lg", "transition-transform", "duration-300", "cursor-pointer"],
844
842
  variants: {
845
843
  rotated: {
846
844
  true: "rotate-180",
@@ -848,7 +846,8 @@ const cvaToggleBtnIcon = cvaMerge(["mr-1", "rounded-lg", "transition-transform",
848
846
  },
849
847
  },
850
848
  });
851
- const cvaTimelineElementTime = cvaMerge(["min-h-6", "content-center"], {
849
+ const cvaTimelineElementTime = cva({
850
+ base: ["min-h-6", "content-center"],
852
851
  variants: {
853
852
  width: {
854
853
  large: "min-w-16",
@@ -986,7 +985,7 @@ const TimelineElement = ({ date, children, className, style, "data-testid": data
986
985
  setIsHovered(false);
987
986
  }
988
987
  };
989
- return (jsxs("div", { className: cvaTimelineElement({ className, selected, hoverBehavior }), "data-date": date, "data-testid": dataTestId, onClick: onClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: style, children: [renderDate(formattedDate, locale), jsxs("div", { className: cvaDotWrapper(), children: [renderDot(customDot, isHovered, selected), jsx("div", { className: cvaLine({ lineStyle }) })] }), jsxs("div", { className: "pb-2 pt-2", children: [renderHeader(header, dataTestId), renderChildren(children), renderActionButton(actionButton)] })] }));
988
+ return (jsxs("div", { className: cvaTimelineElement({ className, selected, hoverBehavior }), "data-date": date, "data-testid": dataTestId, onClick: onClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: style, children: [renderDate(formattedDate, locale), jsxs("div", { className: cvaDotWrapper(), children: [renderDot(customDot, isHovered, selected), jsx("div", { className: cvaLine({ lineStyle }), "data-testid": `${dataTestId}-line` })] }), jsxs("div", { className: "pb-2 pt-2", children: [renderHeader(header, dataTestId), renderChildren(children), renderActionButton(actionButton)] })] }));
990
989
  };
991
990
  const renderDate = (formattedDate, locale) => {
992
991
  if (!formattedDate) {
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@trackunit/react-date-and-time-components",
3
- "version": "2.6.47",
3
+ "version": "2.6.49",
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/date-and-time-utils": "1.14.29",
12
- "@trackunit/react-date-and-time-hooks": "2.6.45",
13
- "@trackunit/css-class-variance-utilities": "1.14.28",
14
- "@trackunit/ui-icons": "1.14.27",
15
- "@trackunit/shared-utils": "1.16.31",
16
- "@trackunit/i18n-library-translation": "2.4.40",
17
- "@trackunit/react-form-components": "2.6.47",
10
+ "@trackunit/react-components": "2.13.1",
11
+ "@trackunit/date-and-time-utils": "1.14.31",
12
+ "@trackunit/react-date-and-time-hooks": "2.6.47",
13
+ "@trackunit/css-class-variance-utilities": "2.0.0",
14
+ "@trackunit/ui-icons": "1.14.29",
15
+ "@trackunit/shared-utils": "1.16.33",
16
+ "@trackunit/i18n-library-translation": "2.4.42",
17
+ "@trackunit/react-form-components": "2.6.49",
18
18
  "string-ts": "^2.0.0",
19
19
  "tailwind-merge": "^2.0.0",
20
20
  "react-calendar": "^6.0.0"
@@ -1,3 +1,22 @@
1
- export declare const cvaTriggerButton: (props?: ({
2
- active?: boolean | null | undefined;
3
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
1
+ export declare const cvaTriggerButton: import("cva").CVAComponent<Omit<{
2
+ base: string[];
3
+ variants: {
4
+ active: {
5
+ true: string;
6
+ false: string;
7
+ };
8
+ };
9
+ }, "defaultVariants"> & {
10
+ variants: {
11
+ active: {
12
+ true: string;
13
+ false: string;
14
+ };
15
+ };
16
+ defaultVariants: Omit<{}, never>;
17
+ }, {
18
+ active: {
19
+ true: string;
20
+ false: string;
21
+ };
22
+ }>;
@@ -1,15 +1,115 @@
1
- export declare const cvaTimelineElement: (props?: ({
2
- selected?: boolean | null | undefined;
3
- hoverBehavior?: boolean | null | undefined;
4
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
5
- export declare const cvaDotWrapper: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
6
- export declare const cvaLine: (props?: ({
7
- lineStyle?: "solid" | "dashed" | null | undefined;
8
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
- export declare const cvaCustomDot: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
10
- export declare const cvaToggleBtnIcon: (props?: ({
11
- rotated?: boolean | null | undefined;
12
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
13
- export declare const cvaTimelineElementTime: (props?: ({
14
- width?: "small" | "medium" | "large" | null | undefined;
15
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
1
+ export declare const cvaTimelineElement: import("cva").CVAComponent<Omit<{
2
+ base: string[];
3
+ variants: {
4
+ selected: {
5
+ true: string;
6
+ false: string;
7
+ };
8
+ hoverBehavior: {
9
+ true: string;
10
+ false: string;
11
+ };
12
+ };
13
+ }, "defaultVariants"> & {
14
+ variants: {
15
+ selected: {
16
+ true: string;
17
+ false: string;
18
+ };
19
+ hoverBehavior: {
20
+ true: string;
21
+ false: string;
22
+ };
23
+ };
24
+ defaultVariants: Omit<{}, never>;
25
+ }, {
26
+ selected: {
27
+ true: string;
28
+ false: string;
29
+ };
30
+ hoverBehavior: {
31
+ true: string;
32
+ false: string;
33
+ };
34
+ }>;
35
+ export declare const cvaDotWrapper: import("cva").CVAComponent<Omit<{
36
+ base: string[];
37
+ }, "defaultVariants"> & {
38
+ variants: unknown;
39
+ defaultVariants: Omit<{}, never>;
40
+ }, unknown>;
41
+ export declare const cvaLine: import("cva").CVAComponent<Omit<{
42
+ base: string[];
43
+ variants: {
44
+ lineStyle: {
45
+ dashed: string;
46
+ solid: string;
47
+ };
48
+ };
49
+ }, "defaultVariants"> & {
50
+ variants: {
51
+ lineStyle: {
52
+ dashed: string;
53
+ solid: string;
54
+ };
55
+ };
56
+ defaultVariants: Omit<{}, never>;
57
+ }, {
58
+ lineStyle: {
59
+ dashed: string;
60
+ solid: string;
61
+ };
62
+ }>;
63
+ export declare const cvaCustomDot: import("cva").CVAComponent<Omit<{
64
+ base: string[];
65
+ }, "defaultVariants"> & {
66
+ variants: unknown;
67
+ defaultVariants: Omit<{}, never>;
68
+ }, unknown>;
69
+ export declare const cvaToggleBtnIcon: import("cva").CVAComponent<Omit<{
70
+ base: string[];
71
+ variants: {
72
+ rotated: {
73
+ true: string;
74
+ false: string;
75
+ };
76
+ };
77
+ }, "defaultVariants"> & {
78
+ variants: {
79
+ rotated: {
80
+ true: string;
81
+ false: string;
82
+ };
83
+ };
84
+ defaultVariants: Omit<{}, never>;
85
+ }, {
86
+ rotated: {
87
+ true: string;
88
+ false: string;
89
+ };
90
+ }>;
91
+ export declare const cvaTimelineElementTime: import("cva").CVAComponent<Omit<{
92
+ base: string[];
93
+ variants: {
94
+ width: {
95
+ large: string;
96
+ medium: string;
97
+ small: string;
98
+ };
99
+ };
100
+ }, "defaultVariants"> & {
101
+ variants: {
102
+ width: {
103
+ large: string;
104
+ medium: string;
105
+ small: string;
106
+ };
107
+ };
108
+ defaultVariants: Omit<{}, never>;
109
+ }, {
110
+ width: {
111
+ large: string;
112
+ medium: string;
113
+ small: string;
114
+ };
115
+ }>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"entry.js","sourceRoot":"","sources":["../../../../../libs/react/date-and-time-components/migrations/entry.ts"],"names":[],"mappings":"","sourcesContent":["export {};\n"]}