@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 {};
|
|
@@ -18,7 +18,7 @@ export const toastVariants = cva([
|
|
|
18
18
|
variant: "success",
|
|
19
19
|
},
|
|
20
20
|
});
|
|
21
|
-
export const toastViewportVariants = cva(["fixed z-[100] flex w-
|
|
21
|
+
export const toastViewportVariants = cva(["fixed z-[100] flex w-auto flex-col-reverse px-4"], {
|
|
22
22
|
variants: {
|
|
23
23
|
position: {
|
|
24
24
|
"top-center": "top-[40px] left-0 right-0 justify-self-center",
|
|
@@ -15,10 +15,11 @@ import { Toast, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastVi
|
|
|
15
15
|
import { useToast } from "./useToast";
|
|
16
16
|
import Icon from "../Icon/Icon";
|
|
17
17
|
import { toastContentVariants, toastIconVariants } from "./Toast.styles";
|
|
18
|
-
|
|
18
|
+
import { cn } from "@/utils/cn";
|
|
19
|
+
export function Toaster({ viewportClassName, titleClassName, descriptionClassName, contentClassName, iconWrapperClassName, actionWrapperClassName, }) {
|
|
19
20
|
const { toasts, position } = useToast();
|
|
20
21
|
return (_jsxs(ToastProvider, { children: [toasts.map(function (_a) {
|
|
21
|
-
var { id, title, description, action, contentMode } = _a, props = __rest(_a, ["id", "title", "description", "action", "contentMode"]);
|
|
22
|
-
return (_jsxs(Toast, Object.assign({}, props, { children: [_jsx("div", { className: toastIconVariants({ variant: props.variant }), children: _jsx(Icon, { type: "heroicons", name: "check-circle", className: "size-6" }) }), _jsxs("div", { className: toastContentVariants({ contentMode }), children: [title && _jsx(ToastTitle, { children: title }), description && (_jsx(ToastDescription, { children: description }))] }), _jsx("div", { className: "self-center ml-[var(--spacing-spacing-xl)]", children: action }), _jsx(ToastClose, {})] }), id));
|
|
23
|
-
}), _jsx(ToastViewport, { position: position })] }));
|
|
22
|
+
var { id, title, description, action, contentMode = "horizontal" } = _a, props = __rest(_a, ["id", "title", "description", "action", "contentMode"]);
|
|
23
|
+
return (_jsxs(Toast, Object.assign({}, props, { children: [_jsx("div", { className: cn(toastIconVariants({ variant: props.variant }), iconWrapperClassName), children: _jsx(Icon, { type: "heroicons", name: "check-circle", className: "size-6" }) }), _jsxs("div", { className: cn(toastContentVariants({ contentMode }), contentClassName), children: [title && (_jsx(ToastTitle, { className: titleClassName, children: title })), description && (_jsx(ToastDescription, { className: descriptionClassName, children: description }))] }), _jsx("div", { className: cn("self-center ml-[var(--spacing-spacing-xl)]", actionWrapperClassName), children: action }), _jsx(ToastClose, {})] }), id));
|
|
24
|
+
}), _jsx(ToastViewport, { position: position, className: viewportClassName })] }));
|
|
24
25
|
}
|