@rovula/ui 0.0.26 → 0.0.27

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.
Files changed (67) hide show
  1. package/dist/cjs/bundle.css +185 -37
  2. package/dist/cjs/bundle.js +3 -3
  3. package/dist/cjs/bundle.js.map +1 -1
  4. package/dist/cjs/types/components/AlertDialog/{Alert.stories.d.ts → AlertDialog.stories.d.ts} +4 -0
  5. package/dist/cjs/types/components/Calendar/Calendar.stories.d.ts +7 -7
  6. package/dist/cjs/types/components/RadioGroup/RadioGroup.stories.d.ts +1 -1
  7. package/dist/cjs/types/components/Text/Text.d.ts +5 -6
  8. package/dist/cjs/types/components/Text/Text.stories.d.ts +10 -2
  9. package/dist/cjs/types/components/Toast/Toast.d.ts +17 -0
  10. package/dist/cjs/types/components/Toast/Toast.stories.d.ts +358 -0
  11. package/dist/cjs/types/components/Toast/Toast.styles.d.ts +12 -0
  12. package/dist/cjs/types/components/Toast/Toaster.d.ts +1 -0
  13. package/dist/cjs/types/components/Toast/useToast.d.ts +55 -0
  14. package/dist/cjs/types/components/Tooltip/Tooltip.d.ts +8 -0
  15. package/dist/cjs/types/components/Tooltip/Tooltip.stories.d.ts +59 -0
  16. package/dist/cjs/types/components/Tooltip/TooltipSimple.d.ts +13 -0
  17. package/dist/cjs/types/index.d.ts +5 -0
  18. package/dist/components/AlertDialog/{Alert.stories.js → AlertDialog.stories.js} +13 -1
  19. package/dist/components/Checkbox/Checkbox.js +5 -4
  20. package/dist/components/Popover/Popover.js +1 -1
  21. package/dist/components/RadioGroup/RadioGroup.js +1 -4
  22. package/dist/components/Switch/Switch.js +1 -1
  23. package/dist/components/Text/Text.js +3 -5
  24. package/dist/components/Toast/Toast.js +52 -0
  25. package/dist/components/Toast/Toast.stories.js +82 -0
  26. package/dist/components/Toast/Toast.styles.js +60 -0
  27. package/dist/components/Toast/Toaster.js +24 -0
  28. package/dist/components/Toast/useToast.js +121 -0
  29. package/dist/components/Tooltip/Tooltip.js +26 -0
  30. package/dist/components/Tooltip/Tooltip.stories.js +61 -0
  31. package/dist/components/Tooltip/TooltipSimple.js +18 -0
  32. package/dist/esm/bundle.css +185 -37
  33. package/dist/esm/bundle.js +3 -3
  34. package/dist/esm/bundle.js.map +1 -1
  35. package/dist/esm/types/components/AlertDialog/{Alert.stories.d.ts → AlertDialog.stories.d.ts} +4 -0
  36. package/dist/esm/types/components/Calendar/Calendar.stories.d.ts +7 -7
  37. package/dist/esm/types/components/RadioGroup/RadioGroup.stories.d.ts +1 -1
  38. package/dist/esm/types/components/Text/Text.d.ts +5 -6
  39. package/dist/esm/types/components/Text/Text.stories.d.ts +10 -2
  40. package/dist/esm/types/components/Toast/Toast.d.ts +17 -0
  41. package/dist/esm/types/components/Toast/Toast.stories.d.ts +358 -0
  42. package/dist/esm/types/components/Toast/Toast.styles.d.ts +12 -0
  43. package/dist/esm/types/components/Toast/Toaster.d.ts +1 -0
  44. package/dist/esm/types/components/Toast/useToast.d.ts +55 -0
  45. package/dist/esm/types/components/Tooltip/Tooltip.d.ts +8 -0
  46. package/dist/esm/types/components/Tooltip/Tooltip.stories.d.ts +59 -0
  47. package/dist/esm/types/components/Tooltip/TooltipSimple.d.ts +13 -0
  48. package/dist/esm/types/index.d.ts +5 -0
  49. package/dist/index.d.ts +94 -6
  50. package/dist/index.js +5 -0
  51. package/dist/src/theme/global.css +229 -45
  52. package/package.json +4 -1
  53. package/src/components/AlertDialog/{Alert.stories.tsx → AlertDialog.stories.tsx} +41 -1
  54. package/src/components/Checkbox/Checkbox.tsx +9 -4
  55. package/src/components/Popover/Popover.tsx +1 -1
  56. package/src/components/RadioGroup/RadioGroup.tsx +6 -7
  57. package/src/components/Switch/Switch.tsx +8 -5
  58. package/src/components/Text/Text.tsx +33 -40
  59. package/src/components/Toast/Toast.stories.tsx +144 -0
  60. package/src/components/Toast/Toast.styles.tsx +73 -0
  61. package/src/components/Toast/Toast.tsx +116 -0
  62. package/src/components/Toast/Toaster.tsx +50 -0
  63. package/src/components/Toast/useToast.ts +222 -0
  64. package/src/components/Tooltip/Tooltip.stories.tsx +152 -0
  65. package/src/components/Tooltip/Tooltip.tsx +38 -0
  66. package/src/components/Tooltip/TooltipSimple.tsx +46 -0
  67. package/src/index.ts +5 -0
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from "react";
2
+ interface TooltipProps {
3
+ children: ReactNode;
4
+ content: ReactNode;
5
+ open?: boolean;
6
+ defaultOpen?: boolean;
7
+ onOpenChange?: (open: boolean) => void;
8
+ side?: "top" | "bottom" | "left" | "right";
9
+ align?: "start" | "center" | "end";
10
+ className?: string;
11
+ }
12
+ export declare function TooltipSimple({ children, content, open, defaultOpen, onOpenChange, ...props }: TooltipProps): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -26,6 +26,11 @@ export * from "./components/Search/Search";
26
26
  export * from "./components/Slider/Slider";
27
27
  export * from "./components/Switch/Switch";
28
28
  export * from "./components/DropdownMenu/DropdownMenu";
29
+ export * from "./components/Tooltip/Tooltip";
30
+ export * from "./components/Tooltip/TooltipSimple";
31
+ export * from "./components/Toast/Toast";
32
+ export * from "./components/Toast/Toaster";
33
+ export * from "./components/Toast/useToast";
29
34
  export type { ButtonProps } from "./components/Button/Button";
30
35
  export type { InputProps } from "./components/TextInput/TextInput";
31
36
  export type { DropdownProps, Options } from "./components/Dropdown/Dropdown";
package/dist/index.d.ts CHANGED
@@ -13,6 +13,8 @@ import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
13
13
  import * as SliderPrimitive from '@radix-ui/react-slider';
14
14
  import * as SwitchPrimitives from '@radix-ui/react-switch';
15
15
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
16
+ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
17
+ import * as ToastPrimitives from '@radix-ui/react-toast';
16
18
  import { ClassValue } from 'clsx';
17
19
 
18
20
  type ButtonProps = {
@@ -81,17 +83,16 @@ declare const TextInput: React__default.ForwardRefExoticComponent<{
81
83
  labelClassName?: string | undefined;
82
84
  } & Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "size"> & React__default.RefAttributes<HTMLInputElement>>;
83
85
 
84
- type TextProps<T extends React__default.ElementType> = {
86
+ type TextProps = {
85
87
  variant?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subtitile1" | "subtitile2" | "subtitile3" | "subtitile4" | "subtitile5" | "subtitile6" | "body1" | "body2" | "body3" | "body4" | "small1" | "small2" | "small3" | "small4" | "small5" | "label1" | "label2" | "buttonL" | "buttonMS";
86
88
  color?: "primary" | "secondary" | "success" | "tertiary" | "info" | "warning" | "error";
87
89
  children?: React__default.ReactNode;
88
90
  className?: string;
89
- tag?: T;
91
+ tag?: React__default.ElementType;
90
92
  style?: React__default.CSSProperties;
91
93
  id?: string;
92
- } & React__default.ComponentProps<T>;
93
- type TextComponent<T extends React__default.ElementType> = React__default.ForwardRefExoticComponent<TextProps<T> & React__default.RefAttributes<HTMLElement>>;
94
- declare const ForwardedText: TextComponent<any>;
94
+ };
95
+ declare const Text: React__default.ForwardRefExoticComponent<TextProps & React__default.RefAttributes<unknown>>;
95
96
 
96
97
  type Tab = {
97
98
  label: string;
@@ -428,6 +429,93 @@ declare const DropdownMenuShortcut: {
428
429
  displayName: string;
429
430
  };
430
431
 
432
+ declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
433
+ declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
434
+ declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
435
+ declare const TooltipArrow: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipArrowProps & React.RefAttributes<SVGSVGElement>>;
436
+ declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
437
+
438
+ interface TooltipProps {
439
+ children: ReactNode;
440
+ content: ReactNode;
441
+ open?: boolean;
442
+ defaultOpen?: boolean;
443
+ onOpenChange?: (open: boolean) => void;
444
+ side?: "top" | "bottom" | "left" | "right";
445
+ align?: "start" | "center" | "end";
446
+ className?: string;
447
+ }
448
+ declare function TooltipSimple({ children, content, open, defaultOpen, onOpenChange, ...props }: TooltipProps): react_jsx_runtime.JSX.Element;
449
+
450
+ declare const ToastProvider: React.FC<ToastPrimitives.ToastProviderProps>;
451
+ declare const ToastViewport: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastViewportProps & React.RefAttributes<HTMLOListElement>, "ref"> & VariantProps<(props?: ({
452
+ position?: "top-center" | "top-left" | "top-right" | "bottom-center" | "bottom-left" | "bottom-right" | null | undefined;
453
+ } & class_variance_authority_dist_types.ClassProp) | undefined) => string> & React.RefAttributes<HTMLOListElement>>;
454
+ declare const Toast$1: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastProps & React.RefAttributes<HTMLLIElement>, "ref"> & VariantProps<(props?: ({
455
+ variant?: "default" | "success" | "info" | "warning" | "error" | null | undefined;
456
+ } & class_variance_authority_dist_types.ClassProp) | undefined) => string> & React.RefAttributes<HTMLLIElement>>;
457
+ declare const ToastAction: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
458
+ declare const ToastClose: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastCloseProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
459
+ declare const ToastTitle: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastTitleProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
460
+ declare const ToastDescription: React.ForwardRefExoticComponent<Omit<ToastPrimitives.ToastDescriptionProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
461
+ type ToastProps = React.ComponentPropsWithoutRef<typeof Toast$1>;
462
+ type ToastActionElement = React.ReactElement<typeof ToastAction>;
463
+
464
+ declare function Toaster(): react_jsx_runtime.JSX.Element;
465
+
466
+ type ToasterToast = ToastProps & {
467
+ id: string;
468
+ title?: React.ReactNode;
469
+ description?: React.ReactNode;
470
+ action?: ToastActionElement;
471
+ contentMode?: "vertical" | "horizontal";
472
+ };
473
+ type ToasterPosition = "top-center" | "top-left" | "top-right" | "bottom-center" | "bottom-left" | "bottom-right" | undefined;
474
+ declare const actionTypes: {
475
+ readonly ADD_TOAST: "ADD_TOAST";
476
+ readonly UPDATE_TOAST: "UPDATE_TOAST";
477
+ readonly DISMISS_TOAST: "DISMISS_TOAST";
478
+ readonly REMOVE_TOAST: "REMOVE_TOAST";
479
+ readonly ADD_POSITION: "ADD_POSITION";
480
+ };
481
+ type ActionType = typeof actionTypes;
482
+ type Action = {
483
+ type: ActionType["ADD_TOAST"];
484
+ toast: ToasterToast;
485
+ } | {
486
+ type: ActionType["UPDATE_TOAST"];
487
+ toast: Partial<ToasterToast>;
488
+ } | {
489
+ type: ActionType["DISMISS_TOAST"];
490
+ toastId?: ToasterToast["id"];
491
+ } | {
492
+ type: ActionType["REMOVE_TOAST"];
493
+ toastId?: ToasterToast["id"];
494
+ } | {
495
+ type: ActionType["ADD_POSITION"];
496
+ position?: ToasterPosition;
497
+ };
498
+ interface State {
499
+ toasts: ToasterToast[];
500
+ position?: ToasterPosition;
501
+ }
502
+ declare const reducer: (state: State, action: Action) => State;
503
+ type Toast = Omit<ToasterToast, "id">;
504
+ declare function toast({ ...props }: Toast): {
505
+ id: string;
506
+ dismiss: () => void;
507
+ update: (props: ToasterToast) => void;
508
+ };
509
+ type ToastOptions = {
510
+ position?: State["position"];
511
+ };
512
+ declare function useToast(options?: ToastOptions): {
513
+ toast: typeof toast;
514
+ dismiss: (toastId?: string) => void;
515
+ toasts: ToasterToast[];
516
+ position?: ToasterPosition;
517
+ };
518
+
431
519
  declare const resloveTimestamp: (timestamp: number) => number;
432
520
  declare const getStartDateOfDay: (date: Date) => Date;
433
521
  declare const getEndDateOfDay: (date: Date) => Date;
@@ -439,4 +527,4 @@ declare const getTimestampUTC: (date: Date) => number;
439
527
 
440
528
  declare function cn(...inputs: ClassValue[]): string;
441
529
 
442
- export { ActionButton, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, Button, type ButtonProps, Calendar, Checkbox, Collapsible, DataTable, type DataTableProps, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Dropdown, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type DropdownProps, Icon, Input, type InputProps, Label, Loading, Navbar, type NavbarProps, type Options, Popover, PopoverContent, PopoverTrigger, ProgressBar, Search, type SearchProps, Slider, type SliderProps, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, ForwardedText as Text, TextInput, cn, getEndDateOfDay, getStartDateOfDay, getStartEndTimestampOfDay, getTimestampUTC, resloveTimestamp };
530
+ export { ActionButton, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, Button, type ButtonProps, Calendar, Checkbox, Collapsible, DataTable, type DataTableProps, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Dropdown, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type DropdownProps, Icon, Input, type InputProps, Label, Loading, Navbar, type NavbarProps, type Options, Popover, PopoverContent, PopoverTrigger, ProgressBar, Search, type SearchProps, Slider, type SliderProps, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, Text, TextInput, Toast$1 as Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipSimple, TooltipTrigger, cn, getEndDateOfDay, getStartDateOfDay, getStartEndTimestampOfDay, getTimestampUTC, reducer, resloveTimestamp, toast, useToast };
package/dist/index.js CHANGED
@@ -28,6 +28,11 @@ export * from "./components/Search/Search";
28
28
  export * from "./components/Slider/Slider";
29
29
  export * from "./components/Switch/Switch";
30
30
  export * from "./components/DropdownMenu/DropdownMenu";
31
+ export * from "./components/Tooltip/Tooltip";
32
+ export * from "./components/Tooltip/TooltipSimple";
33
+ export * from "./components/Toast/Toast";
34
+ export * from "./components/Toast/Toaster";
35
+ export * from "./components/Toast/useToast";
31
36
  // UTILS
32
37
  export { resloveTimestamp, getStartDateOfDay, getEndDateOfDay, getStartEndTimestampOfDay, getTimestampUTC, } from "./utils/datetime";
33
38
  export { cn } from "./utils/cn";