@rovula/ui 0.0.25 → 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 (73) 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/Navbar/Navbar.d.ts +4 -0
  7. package/dist/cjs/types/components/Navbar/Navbar.stories.d.ts +4 -0
  8. package/dist/cjs/types/components/RadioGroup/RadioGroup.stories.d.ts +1 -1
  9. package/dist/cjs/types/components/Text/Text.d.ts +5 -6
  10. package/dist/cjs/types/components/Text/Text.stories.d.ts +10 -2
  11. package/dist/cjs/types/components/Toast/Toast.d.ts +17 -0
  12. package/dist/cjs/types/components/Toast/Toast.stories.d.ts +358 -0
  13. package/dist/cjs/types/components/Toast/Toast.styles.d.ts +12 -0
  14. package/dist/cjs/types/components/Toast/Toaster.d.ts +1 -0
  15. package/dist/cjs/types/components/Toast/useToast.d.ts +55 -0
  16. package/dist/cjs/types/components/Tooltip/Tooltip.d.ts +8 -0
  17. package/dist/cjs/types/components/Tooltip/Tooltip.stories.d.ts +59 -0
  18. package/dist/cjs/types/components/Tooltip/TooltipSimple.d.ts +13 -0
  19. package/dist/cjs/types/index.d.ts +5 -0
  20. package/dist/components/AlertDialog/{Alert.stories.js → AlertDialog.stories.js} +13 -1
  21. package/dist/components/Checkbox/Checkbox.js +5 -4
  22. package/dist/components/Navbar/Navbar.js +2 -2
  23. package/dist/components/Popover/Popover.js +1 -1
  24. package/dist/components/RadioGroup/RadioGroup.js +1 -4
  25. package/dist/components/Switch/Switch.js +1 -1
  26. package/dist/components/Text/Text.js +3 -5
  27. package/dist/components/Toast/Toast.js +52 -0
  28. package/dist/components/Toast/Toast.stories.js +82 -0
  29. package/dist/components/Toast/Toast.styles.js +60 -0
  30. package/dist/components/Toast/Toaster.js +24 -0
  31. package/dist/components/Toast/useToast.js +121 -0
  32. package/dist/components/Tooltip/Tooltip.js +26 -0
  33. package/dist/components/Tooltip/Tooltip.stories.js +61 -0
  34. package/dist/components/Tooltip/TooltipSimple.js +18 -0
  35. package/dist/esm/bundle.css +185 -37
  36. package/dist/esm/bundle.js +3 -3
  37. package/dist/esm/bundle.js.map +1 -1
  38. package/dist/esm/types/components/AlertDialog/{Alert.stories.d.ts → AlertDialog.stories.d.ts} +4 -0
  39. package/dist/esm/types/components/Calendar/Calendar.stories.d.ts +7 -7
  40. package/dist/esm/types/components/Navbar/Navbar.d.ts +4 -0
  41. package/dist/esm/types/components/Navbar/Navbar.stories.d.ts +4 -0
  42. package/dist/esm/types/components/RadioGroup/RadioGroup.stories.d.ts +1 -1
  43. package/dist/esm/types/components/Text/Text.d.ts +5 -6
  44. package/dist/esm/types/components/Text/Text.stories.d.ts +10 -2
  45. package/dist/esm/types/components/Toast/Toast.d.ts +17 -0
  46. package/dist/esm/types/components/Toast/Toast.stories.d.ts +358 -0
  47. package/dist/esm/types/components/Toast/Toast.styles.d.ts +12 -0
  48. package/dist/esm/types/components/Toast/Toaster.d.ts +1 -0
  49. package/dist/esm/types/components/Toast/useToast.d.ts +55 -0
  50. package/dist/esm/types/components/Tooltip/Tooltip.d.ts +8 -0
  51. package/dist/esm/types/components/Tooltip/Tooltip.stories.d.ts +59 -0
  52. package/dist/esm/types/components/Tooltip/TooltipSimple.d.ts +13 -0
  53. package/dist/esm/types/index.d.ts +5 -0
  54. package/dist/index.d.ts +98 -6
  55. package/dist/index.js +5 -0
  56. package/dist/src/theme/global.css +229 -45
  57. package/package.json +4 -1
  58. package/src/components/AlertDialog/{Alert.stories.tsx → AlertDialog.stories.tsx} +41 -1
  59. package/src/components/Checkbox/Checkbox.tsx +9 -4
  60. package/src/components/Navbar/Navbar.tsx +33 -6
  61. package/src/components/Popover/Popover.tsx +1 -1
  62. package/src/components/RadioGroup/RadioGroup.tsx +6 -7
  63. package/src/components/Switch/Switch.tsx +8 -5
  64. package/src/components/Text/Text.tsx +33 -40
  65. package/src/components/Toast/Toast.stories.tsx +144 -0
  66. package/src/components/Toast/Toast.styles.tsx +73 -0
  67. package/src/components/Toast/Toast.tsx +116 -0
  68. package/src/components/Toast/Toaster.tsx +50 -0
  69. package/src/components/Toast/useToast.ts +222 -0
  70. package/src/components/Tooltip/Tooltip.stories.tsx +152 -0
  71. package/src/components/Tooltip/Tooltip.tsx +38 -0
  72. package/src/components/Tooltip/TooltipSimple.tsx +46 -0
  73. package/src/index.ts +5 -0
@@ -0,0 +1,59 @@
1
+ import React from "react";
2
+ declare const meta: {
3
+ title: string;
4
+ tags: string[];
5
+ parameters: {
6
+ layout: string;
7
+ };
8
+ decorators: ((Story: import("@storybook/types").PartialStoryFn<import("@storybook/react").ReactRenderer, {
9
+ children?: React.ReactNode;
10
+ open?: boolean | undefined;
11
+ defaultOpen?: boolean | undefined;
12
+ onOpenChange?: ((open: boolean) => void) | undefined;
13
+ delayDuration?: number | undefined;
14
+ disableHoverableContent?: boolean | undefined;
15
+ }>) => import("react/jsx-runtime").JSX.Element)[];
16
+ };
17
+ export default meta;
18
+ export declare const Default: {
19
+ args: {
20
+ delayDuration: number;
21
+ skipDelayDuration: number;
22
+ disableHoverableContent: boolean;
23
+ };
24
+ render: (args: any) => import("react/jsx-runtime").JSX.Element;
25
+ };
26
+ export declare const Position: {
27
+ argTypes: {
28
+ side: {
29
+ control: "select";
30
+ options: string[];
31
+ };
32
+ align: {
33
+ control: "select";
34
+ options: string[];
35
+ };
36
+ };
37
+ args: {
38
+ side: "top";
39
+ align: "center";
40
+ sideOffset: number;
41
+ };
42
+ render: (args: {
43
+ side: "top" | "right" | "bottom" | "left";
44
+ align: "start" | "center" | "end";
45
+ sideOffset: number;
46
+ }) => import("react/jsx-runtime").JSX.Element;
47
+ };
48
+ export declare const Controlled: {
49
+ args: {
50
+ open: boolean;
51
+ };
52
+ render: (args: {}) => import("react/jsx-runtime").JSX.Element;
53
+ };
54
+ export declare const Simple: {
55
+ args: {
56
+ open: boolean;
57
+ };
58
+ render: (args: {}) => import("react/jsx-runtime").JSX.Element;
59
+ };
@@ -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;
@@ -192,6 +193,10 @@ type NavbarProps = {
192
193
  center?: ReactNode;
193
194
  container?: boolean;
194
195
  className?: string;
196
+ containerClassName?: string;
197
+ leftNavClassName?: string;
198
+ centerClassName?: string;
199
+ rightNavClassName?: string;
195
200
  };
196
201
  declare const Navbar: FC<NavbarProps>;
197
202
 
@@ -424,6 +429,93 @@ declare const DropdownMenuShortcut: {
424
429
  displayName: string;
425
430
  };
426
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
+
427
519
  declare const resloveTimestamp: (timestamp: number) => number;
428
520
  declare const getStartDateOfDay: (date: Date) => Date;
429
521
  declare const getEndDateOfDay: (date: Date) => Date;
@@ -435,4 +527,4 @@ declare const getTimestampUTC: (date: Date) => number;
435
527
 
436
528
  declare function cn(...inputs: ClassValue[]): string;
437
529
 
438
- 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";