@rovula/ui 0.0.39 → 0.0.41
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/cjs/bundle.css +0 -4
- package/dist/cjs/bundle.js +1 -1
- package/dist/cjs/bundle.js.map +1 -1
- package/dist/cjs/types/components/Dropdown/Dropdown.d.ts +2 -2
- package/dist/cjs/types/components/Dropdown/Dropdown.stories.d.ts +2 -2
- package/dist/cjs/types/components/Search/Search.stories.d.ts +1 -1
- package/dist/cjs/types/components/Toast/Toaster.d.ts +10 -1
- package/dist/components/Toast/Toast.styles.js +1 -1
- package/dist/components/Toast/Toaster.js +5 -4
- package/dist/esm/bundle.css +0 -4
- package/dist/esm/bundle.js +1 -1
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/types/components/Dropdown/Dropdown.d.ts +2 -2
- package/dist/esm/types/components/Dropdown/Dropdown.stories.d.ts +2 -2
- package/dist/esm/types/components/Search/Search.stories.d.ts +1 -1
- package/dist/esm/types/components/Toast/Toaster.d.ts +10 -1
- package/dist/index.d.ts +11 -3
- package/dist/src/theme/global.css +0 -4
- package/package.json +1 -1
- package/src/components/Dropdown/Dropdown.tsx +1 -1
- package/src/components/Toast/Toast.styles.tsx +1 -1
- package/src/components/Toast/Toaster.tsx +44 -8
|
@@ -35,7 +35,7 @@ export type DropdownProps = {
|
|
|
35
35
|
selectedOption: Options | null | undefined;
|
|
36
36
|
onClick: (option: Options) => void;
|
|
37
37
|
}) => ReactNode;
|
|
38
|
-
} & Omit<InputProps, "value">;
|
|
38
|
+
} & Omit<InputProps, "value" | "onSelect">;
|
|
39
39
|
declare const Dropdown: React.ForwardRefExoticComponent<{
|
|
40
40
|
id?: string | undefined;
|
|
41
41
|
label?: string | undefined;
|
|
@@ -60,5 +60,5 @@ declare const Dropdown: React.ForwardRefExoticComponent<{
|
|
|
60
60
|
selectedOption: Options | null | undefined;
|
|
61
61
|
onClick: (option: Options) => void;
|
|
62
62
|
}) => ReactNode) | undefined;
|
|
63
|
-
} & Omit<InputProps, "value"> & React.RefAttributes<HTMLInputElement>>;
|
|
63
|
+
} & Omit<InputProps, "onSelect" | "value"> & React.RefAttributes<HTMLInputElement>>;
|
|
64
64
|
export default Dropdown;
|
|
@@ -26,7 +26,7 @@ declare const meta: {
|
|
|
26
26
|
selectedOption: Options | null | undefined;
|
|
27
27
|
onClick: (option: Options) => void;
|
|
28
28
|
}) => React.ReactNode) | undefined;
|
|
29
|
-
} & Omit<import("../..").InputProps, "value"> & React.RefAttributes<HTMLInputElement>>;
|
|
29
|
+
} & Omit<import("../..").InputProps, "onSelect" | "value"> & React.RefAttributes<HTMLInputElement>>;
|
|
30
30
|
tags: string[];
|
|
31
31
|
parameters: {
|
|
32
32
|
layout: string;
|
|
@@ -49,7 +49,7 @@ declare const meta: {
|
|
|
49
49
|
options: Options[];
|
|
50
50
|
value?: Options | undefined;
|
|
51
51
|
onChangeText?: React.ChangeEventHandler<HTMLInputElement> | undefined;
|
|
52
|
-
onSelect?: ((
|
|
52
|
+
onSelect?: ((value: Options) => void) | undefined;
|
|
53
53
|
renderOptions?: ((value: {
|
|
54
54
|
optionsFiltered: Options[];
|
|
55
55
|
selectedOption: Options | null | undefined;
|
|
@@ -200,7 +200,7 @@ declare const meta: {
|
|
|
200
200
|
onMouseOverCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
|
|
201
201
|
onMouseUp?: React.MouseEventHandler<HTMLInputElement> | undefined;
|
|
202
202
|
onMouseUpCapture?: React.MouseEventHandler<HTMLInputElement> | undefined;
|
|
203
|
-
onSelect?: ((
|
|
203
|
+
onSelect?: ((value: Options) => void) | undefined;
|
|
204
204
|
onSelectCapture?: React.ReactEventHandler<HTMLInputElement> | undefined;
|
|
205
205
|
onTouchCancel?: React.TouchEventHandler<HTMLInputElement> | undefined;
|
|
206
206
|
onTouchCancelCapture?: React.TouchEventHandler<HTMLInputElement> | undefined;
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
type ToasterProps = {
|
|
2
|
+
viewportClassName?: string;
|
|
3
|
+
titleClassName?: string;
|
|
4
|
+
descriptionClassName?: string;
|
|
5
|
+
contentClassName?: string;
|
|
6
|
+
iconWrapperClassName?: string;
|
|
7
|
+
actionWrapperClassName?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function Toaster({ viewportClassName, titleClassName, descriptionClassName, contentClassName, iconWrapperClassName, actionWrapperClassName, }: ToasterProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -160,7 +160,7 @@ type DropdownProps = {
|
|
|
160
160
|
selectedOption: Options$1 | null | undefined;
|
|
161
161
|
onClick: (option: Options$1) => void;
|
|
162
162
|
}) => ReactNode;
|
|
163
|
-
} & Omit<InputProps, "value">;
|
|
163
|
+
} & Omit<InputProps, "value" | "onSelect">;
|
|
164
164
|
declare const Dropdown: React__default.ForwardRefExoticComponent<{
|
|
165
165
|
id?: string | undefined;
|
|
166
166
|
label?: string | undefined;
|
|
@@ -185,7 +185,7 @@ declare const Dropdown: React__default.ForwardRefExoticComponent<{
|
|
|
185
185
|
selectedOption: Options$1 | null | undefined;
|
|
186
186
|
onClick: (option: Options$1) => void;
|
|
187
187
|
}) => ReactNode) | undefined;
|
|
188
|
-
} & Omit<InputProps, "value"> & React__default.RefAttributes<HTMLInputElement>>;
|
|
188
|
+
} & Omit<InputProps, "onSelect" | "value"> & React__default.RefAttributes<HTMLInputElement>>;
|
|
189
189
|
|
|
190
190
|
declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
191
191
|
|
|
@@ -530,7 +530,15 @@ declare const ToastDescription: React.ForwardRefExoticComponent<Omit<ToastPrimit
|
|
|
530
530
|
type ToastProps = React.ComponentPropsWithoutRef<typeof Toast$1>;
|
|
531
531
|
type ToastActionElement = React.ReactElement<typeof ToastAction>;
|
|
532
532
|
|
|
533
|
-
|
|
533
|
+
type ToasterProps = {
|
|
534
|
+
viewportClassName?: string;
|
|
535
|
+
titleClassName?: string;
|
|
536
|
+
descriptionClassName?: string;
|
|
537
|
+
contentClassName?: string;
|
|
538
|
+
iconWrapperClassName?: string;
|
|
539
|
+
actionWrapperClassName?: string;
|
|
540
|
+
};
|
|
541
|
+
declare function Toaster({ viewportClassName, titleClassName, descriptionClassName, contentClassName, iconWrapperClassName, actionWrapperClassName, }: ToasterProps): react_jsx_runtime.JSX.Element;
|
|
534
542
|
|
|
535
543
|
type ToasterToast = ToastProps & {
|
|
536
544
|
id: string;
|
package/package.json
CHANGED
|
@@ -56,7 +56,7 @@ export type DropdownProps = {
|
|
|
56
56
|
selectedOption: Options | null | undefined;
|
|
57
57
|
onClick: (option: Options) => void;
|
|
58
58
|
}) => ReactNode;
|
|
59
|
-
} & Omit<InputProps, "value">;
|
|
59
|
+
} & Omit<InputProps, "value" | "onSelect">;
|
|
60
60
|
|
|
61
61
|
const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
|
|
62
62
|
(
|
|
@@ -12,8 +12,25 @@ import {
|
|
|
12
12
|
import { useToast } from "./useToast";
|
|
13
13
|
import Icon from "../Icon/Icon";
|
|
14
14
|
import { toastContentVariants, toastIconVariants } from "./Toast.styles";
|
|
15
|
+
import { cn } from "@/utils/cn";
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
type ToasterProps = {
|
|
18
|
+
viewportClassName?: string;
|
|
19
|
+
titleClassName?: string;
|
|
20
|
+
descriptionClassName?: string;
|
|
21
|
+
contentClassName?: string;
|
|
22
|
+
iconWrapperClassName?: string;
|
|
23
|
+
actionWrapperClassName?: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export function Toaster({
|
|
27
|
+
viewportClassName,
|
|
28
|
+
titleClassName,
|
|
29
|
+
descriptionClassName,
|
|
30
|
+
contentClassName,
|
|
31
|
+
iconWrapperClassName,
|
|
32
|
+
actionWrapperClassName,
|
|
33
|
+
}: ToasterProps) {
|
|
17
34
|
const { toasts, position } = useToast();
|
|
18
35
|
|
|
19
36
|
return (
|
|
@@ -23,28 +40,47 @@ export function Toaster() {
|
|
|
23
40
|
title,
|
|
24
41
|
description,
|
|
25
42
|
action,
|
|
26
|
-
contentMode,
|
|
43
|
+
contentMode = "horizontal",
|
|
27
44
|
...props
|
|
28
45
|
}) {
|
|
29
46
|
return (
|
|
30
47
|
<Toast key={id} {...props}>
|
|
31
|
-
<div
|
|
48
|
+
<div
|
|
49
|
+
className={cn(
|
|
50
|
+
toastIconVariants({ variant: props.variant }),
|
|
51
|
+
iconWrapperClassName
|
|
52
|
+
)}
|
|
53
|
+
>
|
|
32
54
|
<Icon type="heroicons" name="check-circle" className="size-6" />
|
|
33
55
|
</div>
|
|
34
|
-
<div
|
|
35
|
-
{
|
|
56
|
+
<div
|
|
57
|
+
className={cn(
|
|
58
|
+
toastContentVariants({ contentMode }),
|
|
59
|
+
contentClassName
|
|
60
|
+
)}
|
|
61
|
+
>
|
|
62
|
+
{title && (
|
|
63
|
+
<ToastTitle className={titleClassName}>{title}</ToastTitle>
|
|
64
|
+
)}
|
|
36
65
|
{description && (
|
|
37
|
-
<ToastDescription
|
|
66
|
+
<ToastDescription className={descriptionClassName}>
|
|
67
|
+
{description}
|
|
68
|
+
</ToastDescription>
|
|
38
69
|
)}
|
|
39
70
|
</div>
|
|
40
|
-
<div
|
|
71
|
+
<div
|
|
72
|
+
className={cn(
|
|
73
|
+
"self-center ml-[var(--spacing-spacing-xl)]",
|
|
74
|
+
actionWrapperClassName
|
|
75
|
+
)}
|
|
76
|
+
>
|
|
41
77
|
{action}
|
|
42
78
|
</div>
|
|
43
79
|
<ToastClose />
|
|
44
80
|
</Toast>
|
|
45
81
|
);
|
|
46
82
|
})}
|
|
47
|
-
<ToastViewport position={position} />
|
|
83
|
+
<ToastViewport position={position} className={viewportClassName} />
|
|
48
84
|
</ToastProvider>
|
|
49
85
|
);
|
|
50
86
|
}
|