@rovula/ui 0.0.40 → 0.0.42

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.
@@ -1,11 +1,13 @@
1
- import React, { FC } from "react";
1
+ import React, { ComponentPropsWithoutRef, FC } from "react";
2
2
  import { Calendar } from "../Calendar";
3
+ import { PopoverContent } from "../Popover/Popover";
3
4
  import { Modifiers } from "react-day-picker";
4
5
  import { InputProps } from "../TextInput/TextInput";
5
6
  type DatePickerProps = {
6
7
  date: Date | undefined;
7
8
  onSelect: (selected: Date | undefined, triggerDate: Date, modifiers: Modifiers, e: React.MouseEvent | React.KeyboardEvent) => void | undefined;
8
9
  textInputProps?: Partial<InputProps>;
10
+ popoverContentProps?: ComponentPropsWithoutRef<typeof PopoverContent>;
9
11
  } & React.ComponentPropsWithoutRef<typeof Calendar>;
10
12
  declare const DatePicker: FC<DatePickerProps>;
11
13
  export default DatePicker;
@@ -5,6 +5,7 @@ declare const meta: {
5
5
  date: Date | undefined;
6
6
  onSelect: (selected: Date | undefined, triggerDate: Date, modifiers: import("react-day-picker").Modifiers, e: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>) => void | undefined;
7
7
  textInputProps?: Partial<import("../..").InputProps> | undefined;
8
+ popoverContentProps?: Omit<Omit<import("@radix-ui/react-popover").PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> | undefined;
8
9
  } & import("react-day-picker").DayPickerProps>;
9
10
  tags: string[];
10
11
  parameters: {
@@ -14,6 +15,7 @@ declare const meta: {
14
15
  date: Date | undefined;
15
16
  onSelect: ((selected: Date | undefined, triggerDate: Date, modifiers: import("react-day-picker").Modifiers, e: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>) => void | undefined) & ((selected: Date | undefined, triggerDate: Date, modifiers: import("react-day-picker").Modifiers, e: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>) => void);
16
17
  textInputProps?: Partial<import("../..").InputProps> | undefined;
18
+ popoverContentProps?: Omit<Omit<import("@radix-ui/react-popover").PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> | undefined;
17
19
  mode: "single";
18
20
  required?: false | undefined;
19
21
  className?: string | undefined;
@@ -116,6 +118,7 @@ declare const meta: {
116
118
  date: Date | undefined;
117
119
  onSelect: ((selected: Date | undefined, triggerDate: Date, modifiers: import("react-day-picker").Modifiers, e: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>) => void | undefined) & ((selected: Date, triggerDate: Date, modifiers: import("react-day-picker").Modifiers, e: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>) => void | undefined);
118
120
  textInputProps?: Partial<import("../..").InputProps> | undefined;
121
+ popoverContentProps?: Omit<Omit<import("@radix-ui/react-popover").PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> | undefined;
119
122
  mode: "single";
120
123
  required: true;
121
124
  className?: string | undefined;
@@ -218,6 +221,7 @@ declare const meta: {
218
221
  date: Date | undefined;
219
222
  onSelect: ((selected: Date | undefined, triggerDate: Date, modifiers: import("react-day-picker").Modifiers, e: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>) => void | undefined) & ((selected: Date[] | undefined, triggerDate: Date, modifiers: import("react-day-picker").Modifiers, e: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>) => void);
220
223
  textInputProps?: Partial<import("../..").InputProps> | undefined;
224
+ popoverContentProps?: Omit<Omit<import("@radix-ui/react-popover").PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> | undefined;
221
225
  mode: "multiple";
222
226
  required?: false | undefined;
223
227
  className?: string | undefined;
@@ -322,6 +326,7 @@ declare const meta: {
322
326
  date: Date | undefined;
323
327
  onSelect: ((selected: Date | undefined, triggerDate: Date, modifiers: import("react-day-picker").Modifiers, e: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>) => void | undefined) & ((selected: Date[], triggerDate: Date, modifiers: import("react-day-picker").Modifiers, e: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>) => void);
324
328
  textInputProps?: Partial<import("../..").InputProps> | undefined;
329
+ popoverContentProps?: Omit<Omit<import("@radix-ui/react-popover").PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> | undefined;
325
330
  mode: "multiple";
326
331
  required: true;
327
332
  className?: string | undefined;
@@ -426,6 +431,7 @@ declare const meta: {
426
431
  date: Date | undefined;
427
432
  onSelect: ((selected: Date | undefined, triggerDate: Date, modifiers: import("react-day-picker").Modifiers, e: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>) => void | undefined) & ((selected: import("react-day-picker").DateRange | undefined, triggerDate: Date, modifiers: import("react-day-picker").Modifiers, e: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>) => void | undefined);
428
433
  textInputProps?: Partial<import("../..").InputProps> | undefined;
434
+ popoverContentProps?: Omit<Omit<import("@radix-ui/react-popover").PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> | undefined;
429
435
  mode: "range";
430
436
  required?: false | undefined;
431
437
  className?: string | undefined;
@@ -531,6 +537,7 @@ declare const meta: {
531
537
  date: Date | undefined;
532
538
  onSelect: ((selected: Date | undefined, triggerDate: Date, modifiers: import("react-day-picker").Modifiers, e: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>) => void | undefined) & ((selected: import("react-day-picker").DateRange, triggerDate: Date, modifiers: import("react-day-picker").Modifiers, e: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>) => void);
533
539
  textInputProps?: Partial<import("../..").InputProps> | undefined;
540
+ popoverContentProps?: Omit<Omit<import("@radix-ui/react-popover").PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> | undefined;
534
541
  mode: "range";
535
542
  required: true;
536
543
  className?: string | undefined;
@@ -636,6 +643,7 @@ declare const meta: {
636
643
  date: Date | undefined;
637
644
  onSelect: (selected: Date | undefined, triggerDate: Date, modifiers: import("react-day-picker").Modifiers, e: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>) => void | undefined;
638
645
  textInputProps?: Partial<import("../..").InputProps> | undefined;
646
+ popoverContentProps?: Omit<Omit<import("@radix-ui/react-popover").PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> | undefined;
639
647
  mode?: undefined;
640
648
  required?: undefined;
641
649
  className?: string | undefined;
@@ -1 +1,10 @@
1
- export declare function Toaster(): import("react/jsx-runtime").JSX.Element;
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
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import React__default, { ReactElement, ReactNode, FC } from 'react';
2
+ import React__default, { ReactElement, ReactNode, FC, ComponentPropsWithoutRef } from 'react';
3
3
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
4
4
  import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
5
5
  import * as LabelPrimitive from '@radix-ui/react-label';
@@ -299,17 +299,18 @@ declare namespace Calendar {
299
299
  var displayName: string;
300
300
  }
301
301
 
302
+ declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
303
+ declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
304
+ declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
305
+
302
306
  type DatePickerProps = {
303
307
  date: Date | undefined;
304
308
  onSelect: (selected: Date | undefined, triggerDate: Date, modifiers: Modifiers, e: React__default.MouseEvent | React__default.KeyboardEvent) => void | undefined;
305
309
  textInputProps?: Partial<InputProps>;
310
+ popoverContentProps?: ComponentPropsWithoutRef<typeof PopoverContent>;
306
311
  } & React__default.ComponentPropsWithoutRef<typeof Calendar>;
307
312
  declare const DatePicker: FC<DatePickerProps>;
308
313
 
309
- declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
310
- declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
311
- declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
312
-
313
314
  type LoadingProps = {
314
315
  size?: number;
315
316
  color?: string;
@@ -530,7 +531,15 @@ declare const ToastDescription: React.ForwardRefExoticComponent<Omit<ToastPrimit
530
531
  type ToastProps = React.ComponentPropsWithoutRef<typeof Toast$1>;
531
532
  type ToastActionElement = React.ReactElement<typeof ToastAction>;
532
533
 
533
- declare function Toaster(): react_jsx_runtime.JSX.Element;
534
+ type ToasterProps = {
535
+ viewportClassName?: string;
536
+ titleClassName?: string;
537
+ descriptionClassName?: string;
538
+ contentClassName?: string;
539
+ iconWrapperClassName?: string;
540
+ actionWrapperClassName?: string;
541
+ };
542
+ declare function Toaster({ viewportClassName, titleClassName, descriptionClassName, contentClassName, iconWrapperClassName, actionWrapperClassName, }: ToasterProps): react_jsx_runtime.JSX.Element;
534
543
 
535
544
  type ToasterToast = ToastProps & {
536
545
  id: string;
@@ -8485,10 +8485,6 @@ body {
8485
8485
  .md\:right-\[40px\] {
8486
8486
  right: 40px;
8487
8487
  }
8488
-
8489
- .md\:w-auto {
8490
- width: auto;
8491
- }
8492
8488
  }
8493
8489
 
8494
8490
  .\[\&\:has\(\[role\=checkbox\]\)\]\:w-4:has([role=checkbox]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rovula/ui",
3
- "version": "0.0.40",
3
+ "version": "0.0.42",
4
4
  "main": "dist/cjs/bundle.js",
5
5
  "module": "dist/esm/bundle.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import React, { FC, useState } from "react";
3
+ import React, { ComponentPropsWithoutRef, FC, useState } from "react";
4
4
  import { CalendarIcon } from "@heroicons/react/16/solid";
5
5
 
6
6
  import { Calendar } from "../Calendar";
@@ -18,12 +18,14 @@ type DatePickerProps = {
18
18
  e: React.MouseEvent | React.KeyboardEvent
19
19
  ) => void | undefined;
20
20
  textInputProps?: Partial<InputProps>;
21
+ popoverContentProps?: ComponentPropsWithoutRef<typeof PopoverContent>;
21
22
  } & React.ComponentPropsWithoutRef<typeof Calendar>;
22
23
 
23
24
  const DatePicker: FC<DatePickerProps> = ({
24
25
  date,
25
26
  onSelect,
26
27
  textInputProps,
28
+ popoverContentProps,
27
29
  ...props
28
30
  }) => {
29
31
  const [isOpen, setIsOpen] = useState(false);
@@ -48,7 +50,7 @@ const DatePicker: FC<DatePickerProps> = ({
48
50
  />
49
51
  </div>
50
52
  </PopoverTrigger>
51
- <PopoverContent className="w-auto p-0">
53
+ <PopoverContent className="w-auto p-0 z-[100]" {...popoverContentProps}>
52
54
  <Calendar
53
55
  defaultMonth={date}
54
56
  {...props}
@@ -24,7 +24,7 @@ export const toastVariants = cva(
24
24
  );
25
25
 
26
26
  export const toastViewportVariants = cva(
27
- ["fixed z-[100] flex w-full md:w-auto flex-col-reverse px-4"],
27
+ ["fixed z-[100] flex w-auto flex-col-reverse px-4"],
28
28
  {
29
29
  variants: {
30
30
  position: {
@@ -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
- export function Toaster() {
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 className={toastIconVariants({ variant: props.variant })}>
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 className={toastContentVariants({ contentMode })}>
35
- {title && <ToastTitle>{title}</ToastTitle>}
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>{description}</ToastDescription>
66
+ <ToastDescription className={descriptionClassName}>
67
+ {description}
68
+ </ToastDescription>
38
69
  )}
39
70
  </div>
40
- <div className="self-center ml-[var(--spacing-spacing-xl)]">
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
  }