@addsign/moje-agenda-shared-lib 2.0.1 → 2.0.4
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/dist/Dialog-CLPZ1Y00.js +422 -0
- package/dist/Dialog-CLPZ1Y00.js.map +1 -0
- package/dist/assets/style.css +17 -0
- package/dist/assets/tailwind.css +25 -24
- package/dist/components/datatable/DataTable.js +6 -1
- package/dist/components/datatable/DataTable.js.map +1 -1
- package/dist/components/datatable/DataTableServer.js +6 -1
- package/dist/components/datatable/DataTableServer.js.map +1 -1
- package/dist/components/form/AutocompleteSearchBar.js +6 -1
- package/dist/components/form/AutocompleteSearchBar.js.map +1 -1
- package/dist/components/form/AutocompleteSearchBarServer.js +6 -1
- package/dist/components/form/AutocompleteSearchBarServer.js.map +1 -1
- package/dist/components/form/FileInput.js +7 -2
- package/dist/components/form/FileInput.js.map +1 -1
- package/dist/components/form/FileInputMultiple.js +7 -2
- package/dist/components/form/FileInputMultiple.js.map +1 -1
- package/dist/components/form/FormField.js +6 -1
- package/dist/components/form/FormField.js.map +1 -1
- package/dist/components/form/PositionsSelectorSingle.js +6 -1
- package/dist/components/form/PositionsSelectorSingle.js.map +1 -1
- package/dist/components/form/SelectField.js +6 -1
- package/dist/components/form/SelectField.js.map +1 -1
- package/dist/components/profiles/ProfileOverview.js +6 -1
- package/dist/components/profiles/ProfileOverview.js.map +1 -1
- package/dist/components/ui/Combobox.js +3 -2
- package/dist/components/ui/Combobox.js.map +1 -1
- package/dist/components/ui/DateTimePicker.d.ts +1 -1
- package/dist/components/ui/DateTimePicker.js +25 -13
- package/dist/components/ui/DateTimePicker.js.map +1 -1
- package/dist/components/ui/Dialog.js +1 -1
- package/dist/components/ui/ScrollArea.js +3 -3
- package/dist/components/ui/button.js +4 -4
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/command.js +2 -2
- package/dist/components/ui/datepicker.js +11 -0
- package/dist/components/ui/datepicker.js.map +1 -1
- package/dist/components/ui/form.js +1 -1
- package/dist/components/ui/input.d.ts +5 -1
- package/dist/components/ui/input.js +93 -13
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/label.js +1 -1
- package/dist/components/ui/popover.js +6 -5
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/radioGroup.js +4 -4
- package/dist/components/ui/select.d.ts +3 -1
- package/dist/components/ui/select.js +10 -35
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/separator.js +48 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/ui/textarea.js +21 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/components/ui/tooltip.js +509 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/index-B3cR4C4Z.js +2203 -0
- package/dist/index-B3cR4C4Z.js.map +1 -0
- package/dist/index-B761_inZ.js +28884 -0
- package/dist/index-B761_inZ.js.map +1 -0
- package/dist/index-BULFV6Qz.js +2266 -0
- package/dist/index-BULFV6Qz.js.map +1 -0
- package/dist/index-Bjw9JvWH.js +131 -0
- package/dist/index-Bjw9JvWH.js.map +1 -0
- package/dist/index-BzZGaGRV.js +230 -0
- package/dist/index-BzZGaGRV.js.map +1 -0
- package/dist/index-C59RTYp9.js +140 -0
- package/dist/index-C59RTYp9.js.map +1 -0
- package/dist/index-D8AkGh-j.js +1173 -0
- package/dist/index-D8AkGh-j.js.map +1 -0
- package/dist/index-D9mvqz1C.js +97 -0
- package/dist/index-D9mvqz1C.js.map +1 -0
- package/dist/index-cCT-Qkr7.js +36 -0
- package/dist/index-cCT-Qkr7.js.map +1 -0
- package/dist/main.d.ts +5 -0
- package/dist/main.js +24 -1
- package/dist/main.js.map +1 -1
- package/lib/components/ui/Combobox.tsx +13 -8
- package/lib/components/ui/DatePicker.tsx +11 -0
- package/lib/components/ui/DateTimePicker.tsx +30 -16
- package/lib/components/ui/button.tsx +3 -3
- package/lib/components/ui/input.tsx +97 -10
- package/lib/components/ui/select.tsx +9 -5
- package/lib/components/ui/separator.tsx +29 -0
- package/lib/components/ui/textarea.tsx +22 -0
- package/lib/components/ui/tooltip.tsx +28 -0
- package/lib/main.ts +5 -0
- package/package.json +3 -1
|
@@ -19,7 +19,7 @@ const DATE_FORMAT = "dd.MM.yyyy HH:mm";
|
|
|
19
19
|
|
|
20
20
|
interface DateTimePickerProps {
|
|
21
21
|
value?: Date;
|
|
22
|
-
onChange?: (date: Date | undefined) => void;
|
|
22
|
+
onChange?: (date: Date | undefined | null) => void;
|
|
23
23
|
className?: string;
|
|
24
24
|
placeholder?: string;
|
|
25
25
|
clearable?: boolean;
|
|
@@ -30,43 +30,56 @@ const DateTimePicker = forwardRef<HTMLInputElement, DateTimePickerProps>(
|
|
|
30
30
|
{ value, onChange, className, clearable = true, placeholder, ...props },
|
|
31
31
|
ref
|
|
32
32
|
) => {
|
|
33
|
-
const [dateTime, setDateTime] = React.useState<Date |
|
|
34
|
-
const [inputValue, setInputValue] = React.useState<string>("");
|
|
33
|
+
const [dateTime, setDateTime] = React.useState<Date | null>(value || null);
|
|
34
|
+
const [inputValue, setInputValue] = React.useState<string | null>("");
|
|
35
35
|
|
|
36
36
|
useEffect(() => {
|
|
37
37
|
if (value) {
|
|
38
38
|
setDateTime(value);
|
|
39
39
|
setInputValue(format(value, DATE_FORMAT));
|
|
40
40
|
} else {
|
|
41
|
-
setDateTime(
|
|
41
|
+
setDateTime(null);
|
|
42
42
|
setInputValue("");
|
|
43
43
|
}
|
|
44
44
|
}, [value]);
|
|
45
45
|
|
|
46
46
|
const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
47
|
+
event.stopPropagation(); // Stop bubbling to prevent interference with other components
|
|
48
|
+
|
|
47
49
|
setInputValue(event.target.value);
|
|
50
|
+
const parsedDateTime = parse(event.target.value, DATE_FORMAT, new Date());
|
|
51
|
+
|
|
52
|
+
if (isValid(parsedDateTime)) {
|
|
53
|
+
setDateTime(parsedDateTime);
|
|
54
|
+
onChange?.(parsedDateTime);
|
|
55
|
+
setInputValue(format(parsedDateTime, DATE_FORMAT));
|
|
56
|
+
} else {
|
|
57
|
+
setInputValue("");
|
|
58
|
+
setDateTime(null);
|
|
59
|
+
onChange?.(null);
|
|
60
|
+
}
|
|
48
61
|
};
|
|
49
62
|
|
|
50
63
|
const handleInputBlur = () => {
|
|
51
64
|
if (inputValue === "") {
|
|
52
|
-
setDateTime(
|
|
53
|
-
onChange?.(
|
|
65
|
+
setDateTime(null);
|
|
66
|
+
onChange?.(null);
|
|
54
67
|
return;
|
|
55
68
|
}
|
|
56
69
|
|
|
57
|
-
const parsedDateTime = parse(inputValue, DATE_FORMAT, new Date());
|
|
70
|
+
const parsedDateTime = parse(inputValue || "", DATE_FORMAT, new Date());
|
|
58
71
|
if (isValid(parsedDateTime)) {
|
|
59
72
|
setDateTime(parsedDateTime);
|
|
60
73
|
onChange?.(parsedDateTime);
|
|
61
74
|
setInputValue(format(parsedDateTime, DATE_FORMAT));
|
|
62
75
|
} else {
|
|
63
76
|
setInputValue("");
|
|
64
|
-
setDateTime(
|
|
65
|
-
onChange?.(
|
|
77
|
+
setDateTime(null);
|
|
78
|
+
onChange?.(null);
|
|
66
79
|
}
|
|
67
80
|
};
|
|
68
81
|
|
|
69
|
-
const handleDateSelect = (selectedDate: Date | undefined) => {
|
|
82
|
+
const handleDateSelect = (selectedDate: Date | undefined | null) => {
|
|
70
83
|
if (selectedDate) {
|
|
71
84
|
const newDateTime = dateTime
|
|
72
85
|
? set(dateTime, {
|
|
@@ -79,9 +92,9 @@ const DateTimePicker = forwardRef<HTMLInputElement, DateTimePickerProps>(
|
|
|
79
92
|
onChange?.(newDateTime);
|
|
80
93
|
setInputValue(format(newDateTime, DATE_FORMAT));
|
|
81
94
|
} else {
|
|
82
|
-
setDateTime(
|
|
95
|
+
setDateTime(null);
|
|
83
96
|
setInputValue("");
|
|
84
|
-
onChange?.(
|
|
97
|
+
onChange?.(null);
|
|
85
98
|
}
|
|
86
99
|
};
|
|
87
100
|
|
|
@@ -102,8 +115,8 @@ const DateTimePicker = forwardRef<HTMLInputElement, DateTimePickerProps>(
|
|
|
102
115
|
|
|
103
116
|
const handleClear = () => {
|
|
104
117
|
setInputValue("");
|
|
105
|
-
setDateTime(
|
|
106
|
-
onChange?.(
|
|
118
|
+
setDateTime(null);
|
|
119
|
+
onChange?.(null);
|
|
107
120
|
};
|
|
108
121
|
|
|
109
122
|
const timeOptions = Array.from({ length: 48 }, (_, i) => {
|
|
@@ -119,7 +132,7 @@ const DateTimePicker = forwardRef<HTMLInputElement, DateTimePickerProps>(
|
|
|
119
132
|
<Input
|
|
120
133
|
ref={ref}
|
|
121
134
|
type="text"
|
|
122
|
-
value={inputValue}
|
|
135
|
+
value={inputValue || ""}
|
|
123
136
|
onChange={handleInputChange}
|
|
124
137
|
onBlur={handleInputBlur}
|
|
125
138
|
placeholder={placeholder}
|
|
@@ -132,6 +145,7 @@ const DateTimePicker = forwardRef<HTMLInputElement, DateTimePickerProps>(
|
|
|
132
145
|
<CalendarClockIcon className="absolute left-2 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground" />
|
|
133
146
|
{clearable && inputValue && (
|
|
134
147
|
<Button
|
|
148
|
+
type="button"
|
|
135
149
|
variant="ghost"
|
|
136
150
|
size="icon"
|
|
137
151
|
className="absolute right-2 top-1/2 -translate-y-1/2 h-4 w-4 p-0"
|
|
@@ -146,7 +160,7 @@ const DateTimePicker = forwardRef<HTMLInputElement, DateTimePickerProps>(
|
|
|
146
160
|
<PopoverContent className="w-auto p-0" align="start">
|
|
147
161
|
<Calendar
|
|
148
162
|
mode="single"
|
|
149
|
-
selected={dateTime}
|
|
163
|
+
selected={dateTime || undefined}
|
|
150
164
|
onSelect={handleDateSelect}
|
|
151
165
|
initialFocus
|
|
152
166
|
/>
|
|
@@ -5,7 +5,7 @@ import { cva, type VariantProps } from "class-variance-authority";
|
|
|
5
5
|
import { cn } from "../../utils/utils";
|
|
6
6
|
|
|
7
7
|
const buttonVariants = cva(
|
|
8
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-
|
|
8
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-ring transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
@@ -20,8 +20,8 @@ const buttonVariants = cva(
|
|
|
20
20
|
link: "text-primary underline-offset-4 hover:underline",
|
|
21
21
|
},
|
|
22
22
|
size: {
|
|
23
|
-
default: "h-10 px-
|
|
24
|
-
sm: "h-9 rounded-md px-
|
|
23
|
+
default: "h-10 px-2 py-2",
|
|
24
|
+
sm: "h-9 rounded-md px-2",
|
|
25
25
|
lg: "h-11 rounded-md px-8",
|
|
26
26
|
icon: "h-10 w-10",
|
|
27
27
|
},
|
|
@@ -1,19 +1,106 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
3
|
import { cn } from "../..//utils/utils";
|
|
4
|
+
import { Button } from "./button";
|
|
5
|
+
import { LoaderCircleIcon, X } from "lucide-react";
|
|
6
|
+
import SpinnerIcon from "../SpinnerIcon";
|
|
4
7
|
|
|
5
|
-
|
|
6
|
-
|
|
8
|
+
interface IInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
9
|
+
debounceTimeout?: number;
|
|
10
|
+
clearable?: boolean;
|
|
11
|
+
}
|
|
12
|
+
const Input = React.forwardRef<HTMLInputElement, IInputProps>(
|
|
13
|
+
(
|
|
14
|
+
{
|
|
15
|
+
className,
|
|
16
|
+
type,
|
|
17
|
+
value: propValue,
|
|
18
|
+
onChange,
|
|
19
|
+
clearable = false,
|
|
20
|
+
debounceTimeout,
|
|
21
|
+
...props
|
|
22
|
+
},
|
|
23
|
+
ref
|
|
24
|
+
) => {
|
|
25
|
+
const [internalValue, setInternalValue] = React.useState(propValue || "");
|
|
26
|
+
const debounceTimeoutRef = React.useRef<NodeJS.Timeout | null>(null); // Ref to hold the debounce timeout
|
|
27
|
+
const [inputIsChanging, setInputIsChanging] = React.useState(false);
|
|
28
|
+
React.useEffect(() => {
|
|
29
|
+
setInternalValue(propValue ?? "");
|
|
30
|
+
}, [propValue]);
|
|
31
|
+
|
|
32
|
+
const handleDebouncedChange = React.useCallback(
|
|
33
|
+
(e: React.ChangeEvent<HTMLInputElement>) => {
|
|
34
|
+
const { value } = e.target;
|
|
35
|
+
setInternalValue(value); // Update local state
|
|
36
|
+
setInputIsChanging(true);
|
|
37
|
+
|
|
38
|
+
if (debounceTimeout) {
|
|
39
|
+
// Clear any previous debounce timeout
|
|
40
|
+
if (debounceTimeoutRef.current)
|
|
41
|
+
clearTimeout(debounceTimeoutRef.current);
|
|
42
|
+
|
|
43
|
+
// Set a new debounce timeout
|
|
44
|
+
debounceTimeoutRef.current = setTimeout(() => {
|
|
45
|
+
const newValue: string = e.target.value;
|
|
46
|
+
setInternalValue(newValue);
|
|
47
|
+
onChange?.(e);
|
|
48
|
+
setInputIsChanging(false);
|
|
49
|
+
}, debounceTimeout);
|
|
50
|
+
} else {
|
|
51
|
+
const newValue = e.target.value;
|
|
52
|
+
setInternalValue(newValue);
|
|
53
|
+
onChange?.(e);
|
|
54
|
+
setInputIsChanging(false);
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
[debounceTimeout, debounceTimeoutRef, onChange, setInternalValue]
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
const handleClear = () => {
|
|
61
|
+
setInternalValue("");
|
|
62
|
+
onChange?.({
|
|
63
|
+
target: { value: "" },
|
|
64
|
+
} as React.ChangeEvent<HTMLInputElement>);
|
|
65
|
+
};
|
|
7
66
|
return (
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
67
|
+
<div className="relative w-full">
|
|
68
|
+
<input
|
|
69
|
+
type={type}
|
|
70
|
+
value={internalValue}
|
|
71
|
+
onChange={handleDebouncedChange}
|
|
72
|
+
className={cn(
|
|
73
|
+
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 " +
|
|
74
|
+
(clearable && !!internalValue ? " pr-10 " : " pr-3 ") +
|
|
75
|
+
" text-base ring-offset-ring file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-80 disabled:border-opacity-100 md:text-sm",
|
|
76
|
+
className
|
|
77
|
+
)}
|
|
78
|
+
ref={ref}
|
|
79
|
+
{...props}
|
|
80
|
+
/>
|
|
81
|
+
|
|
82
|
+
{inputIsChanging === true && (
|
|
83
|
+
<div className="absolute right-0 top-0 h-full px-2 py-2 hover:bg-transparent text-muted-foreground">
|
|
84
|
+
<SpinnerIcon
|
|
85
|
+
icon={
|
|
86
|
+
<LoaderCircleIcon size={25} className="text-muted-foreground" />
|
|
87
|
+
}
|
|
88
|
+
/>
|
|
89
|
+
</div>
|
|
90
|
+
)}
|
|
91
|
+
{!!internalValue && clearable && (
|
|
92
|
+
<Button
|
|
93
|
+
type="button"
|
|
94
|
+
variant="ghost"
|
|
95
|
+
size="icon"
|
|
96
|
+
className="absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent"
|
|
97
|
+
onClick={handleClear}
|
|
98
|
+
>
|
|
99
|
+
<X className="h-4 w-4 text-muted-foreground" />
|
|
100
|
+
<span className="sr-only">Clear input</span>
|
|
101
|
+
</Button>
|
|
13
102
|
)}
|
|
14
|
-
|
|
15
|
-
{...props}
|
|
16
|
-
/>
|
|
103
|
+
</div>
|
|
17
104
|
);
|
|
18
105
|
}
|
|
19
106
|
);
|
|
@@ -9,22 +9,26 @@ const Select = SelectPrimitive.Root;
|
|
|
9
9
|
const SelectGroup = SelectPrimitive.Group;
|
|
10
10
|
|
|
11
11
|
const SelectValue = SelectPrimitive.Value;
|
|
12
|
-
|
|
12
|
+
type SelectTriggerProps = React.ComponentPropsWithoutRef<
|
|
13
|
+
typeof SelectPrimitive.Trigger
|
|
14
|
+
> & {
|
|
15
|
+
iconClassName?: string;
|
|
16
|
+
};
|
|
13
17
|
const SelectTrigger = React.forwardRef<
|
|
14
18
|
React.ElementRef<typeof SelectPrimitive.Trigger>,
|
|
15
|
-
|
|
16
|
-
>(({ className, children, ...props }, ref) => (
|
|
19
|
+
SelectTriggerProps
|
|
20
|
+
>(({ className, children, iconClassName, ...props }, ref) => (
|
|
17
21
|
<SelectPrimitive.Trigger
|
|
18
22
|
ref={ref}
|
|
19
23
|
className={cn(
|
|
20
|
-
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-
|
|
24
|
+
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-ring placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
21
25
|
className
|
|
22
26
|
)}
|
|
23
27
|
{...props}
|
|
24
28
|
>
|
|
25
29
|
{children}
|
|
26
30
|
<SelectPrimitive.Icon asChild>
|
|
27
|
-
<ChevronDown className="h-4 w-4 opacity-50" />
|
|
31
|
+
<ChevronDown className={cn("h-4 w-4 opacity-50 ", iconClassName)} />
|
|
28
32
|
</SelectPrimitive.Icon>
|
|
29
33
|
</SelectPrimitive.Trigger>
|
|
30
34
|
));
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
3
|
+
|
|
4
|
+
import { cn } from "../../utils/utils";
|
|
5
|
+
|
|
6
|
+
const Separator = React.forwardRef<
|
|
7
|
+
React.ElementRef<typeof SeparatorPrimitive.Root>,
|
|
8
|
+
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
|
|
9
|
+
>(
|
|
10
|
+
(
|
|
11
|
+
{ className, orientation = "horizontal", decorative = true, ...props },
|
|
12
|
+
ref
|
|
13
|
+
) => (
|
|
14
|
+
<SeparatorPrimitive.Root
|
|
15
|
+
ref={ref}
|
|
16
|
+
decorative={decorative}
|
|
17
|
+
orientation={orientation}
|
|
18
|
+
className={cn(
|
|
19
|
+
"shrink-0 bg-border",
|
|
20
|
+
orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
21
|
+
className
|
|
22
|
+
)}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
)
|
|
26
|
+
);
|
|
27
|
+
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
28
|
+
|
|
29
|
+
export { Separator };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../utils/utils";
|
|
4
|
+
|
|
5
|
+
const Textarea = React.forwardRef<
|
|
6
|
+
HTMLTextAreaElement,
|
|
7
|
+
React.ComponentProps<"textarea">
|
|
8
|
+
>(({ className, ...props }, ref) => {
|
|
9
|
+
return (
|
|
10
|
+
<textarea
|
|
11
|
+
className={cn(
|
|
12
|
+
"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-ring placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
13
|
+
className
|
|
14
|
+
)}
|
|
15
|
+
ref={ref}
|
|
16
|
+
{...props}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
Textarea.displayName = "Textarea";
|
|
21
|
+
|
|
22
|
+
export { Textarea };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
3
|
+
|
|
4
|
+
import { cn } from "../../utils/utils";
|
|
5
|
+
|
|
6
|
+
const TooltipProvider = TooltipPrimitive.Provider;
|
|
7
|
+
|
|
8
|
+
const Tooltip = TooltipPrimitive.Root;
|
|
9
|
+
|
|
10
|
+
const TooltipTrigger = TooltipPrimitive.Trigger;
|
|
11
|
+
|
|
12
|
+
const TooltipContent = React.forwardRef<
|
|
13
|
+
React.ElementRef<typeof TooltipPrimitive.Content>,
|
|
14
|
+
React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
|
|
15
|
+
>(({ className, sideOffset = 4, ...props }, ref) => (
|
|
16
|
+
<TooltipPrimitive.Content
|
|
17
|
+
ref={ref}
|
|
18
|
+
sideOffset={sideOffset}
|
|
19
|
+
className={cn(
|
|
20
|
+
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
21
|
+
className
|
|
22
|
+
)}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
));
|
|
26
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
27
|
+
|
|
28
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
package/lib/main.ts
CHANGED
|
@@ -56,6 +56,11 @@ export * from "./components/ui/form.tsx";
|
|
|
56
56
|
export * from "./components/ui/radioGroup.tsx";
|
|
57
57
|
export * from "./components/ui/command.tsx";
|
|
58
58
|
export * from "./components/ui/Combobox.tsx";
|
|
59
|
+
export * from "./components/ui/select.tsx";
|
|
60
|
+
export * from "./components/ui/tooltip.tsx";
|
|
61
|
+
export * from "./components/ui/separator.tsx";
|
|
62
|
+
export * from "./components/ui/textarea.tsx";
|
|
63
|
+
export { Button as ButtonCN, buttonVariants } from "./components/ui/button.tsx";
|
|
59
64
|
|
|
60
65
|
|
|
61
66
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@addsign/moje-agenda-shared-lib",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/main.js",
|
|
7
7
|
"types": "dist/main.d.ts",
|
|
@@ -69,7 +69,9 @@
|
|
|
69
69
|
"@radix-ui/react-radio-group": "^1.2.1",
|
|
70
70
|
"@radix-ui/react-scroll-area": "^1.2.0",
|
|
71
71
|
"@radix-ui/react-select": "^2.1.2",
|
|
72
|
+
"@radix-ui/react-separator": "^1.1.0",
|
|
72
73
|
"@radix-ui/react-slot": "^1.1.0",
|
|
74
|
+
"@radix-ui/react-tooltip": "^1.1.4",
|
|
73
75
|
"@types/date-fns": "^2.6.3",
|
|
74
76
|
"axios": "^1.7.2",
|
|
75
77
|
"class-variance-authority": "^0.7.0",
|