@janovix/blocks 1.0.0-rc.3 → 1.0.0-rc.5
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/README.md +605 -28
- package/dist/index.cjs +474 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +66 -1
- package/dist/index.d.ts +66 -1
- package/dist/index.js +467 -9
- package/dist/index.js.map +1 -1
- package/package.json +3 -1
package/dist/index.d.cts
CHANGED
|
@@ -8,6 +8,8 @@ import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
|
8
8
|
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
9
9
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
10
10
|
import { Drawer as Drawer$1 } from 'vaul';
|
|
11
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
12
|
+
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
11
13
|
import { ClassValue } from 'clsx';
|
|
12
14
|
|
|
13
15
|
type ThemeSwitcherLabels = {
|
|
@@ -132,6 +134,61 @@ interface AvatarEditorDialogProps {
|
|
|
132
134
|
}
|
|
133
135
|
declare function AvatarEditorDialog({ value, onChange, onSave, displaySize, editorSize, outputSize, placeholder: _placeholder, editLabel, dialogTitle, acceptText, cancelText, successMessage, errorMessage, className, }: AvatarEditorDialogProps): react_jsx_runtime.JSX.Element;
|
|
134
136
|
|
|
137
|
+
/**
|
|
138
|
+
* NotificationsWidget - A compact notification bell for navigation bars
|
|
139
|
+
*
|
|
140
|
+
* @description
|
|
141
|
+
* Displays a bell icon with unread count badge, plays sound on new notifications,
|
|
142
|
+
* and shows a popover with recent notifications that can be marked as read or dismissed.
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```tsx
|
|
146
|
+
* <NotificationsWidget
|
|
147
|
+
* notifications={notifications}
|
|
148
|
+
* onMarkAsRead={(id) => markAsRead(id)}
|
|
149
|
+
* onMarkAllAsRead={() => markAllAsRead()}
|
|
150
|
+
* onDismiss={(id) => dismiss(id)}
|
|
151
|
+
* onClearAll={() => clearAll()}
|
|
152
|
+
* playSound={true}
|
|
153
|
+
* />
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
type NotificationType = "info" | "success" | "warning" | "error";
|
|
157
|
+
interface Notification {
|
|
158
|
+
id: string;
|
|
159
|
+
title: string;
|
|
160
|
+
message?: string;
|
|
161
|
+
type?: NotificationType;
|
|
162
|
+
timestamp: Date;
|
|
163
|
+
read?: boolean;
|
|
164
|
+
href?: string;
|
|
165
|
+
}
|
|
166
|
+
type WidgetSize = "sm" | "md" | "lg";
|
|
167
|
+
type DotColor = "red" | "blue" | "green" | "amber" | "purple" | "primary";
|
|
168
|
+
type SoundType = "chime" | "bell" | "pop" | "ding" | "none";
|
|
169
|
+
type PulseStyle = "ring" | "glow" | "bounce" | "none";
|
|
170
|
+
interface NotificationsWidgetProps {
|
|
171
|
+
notifications: Notification[];
|
|
172
|
+
onMarkAsRead?: (id: string) => void;
|
|
173
|
+
onMarkAllAsRead?: () => void;
|
|
174
|
+
onDismiss?: (id: string) => void;
|
|
175
|
+
onClearAll?: () => void;
|
|
176
|
+
onNotificationClick?: (notification: Notification) => void;
|
|
177
|
+
size?: WidgetSize;
|
|
178
|
+
maxVisible?: number;
|
|
179
|
+
playSound?: boolean;
|
|
180
|
+
soundUrl?: string;
|
|
181
|
+
className?: string;
|
|
182
|
+
emptyMessage?: string;
|
|
183
|
+
title?: string;
|
|
184
|
+
dotColor?: DotColor;
|
|
185
|
+
showPulse?: boolean;
|
|
186
|
+
soundType?: SoundType;
|
|
187
|
+
pulseStyle?: PulseStyle;
|
|
188
|
+
soundCooldown?: number;
|
|
189
|
+
}
|
|
190
|
+
declare function NotificationsWidget({ notifications, onMarkAsRead, onMarkAllAsRead, onDismiss, onClearAll, onNotificationClick, size, maxVisible, playSound, soundUrl, className, emptyMessage, title, dotColor, showPulse, soundType, pulseStyle, soundCooldown, }: NotificationsWidgetProps): react_jsx_runtime.JSX.Element;
|
|
191
|
+
|
|
135
192
|
declare const buttonVariants: (props?: ({
|
|
136
193
|
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
137
194
|
size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
|
|
@@ -200,6 +257,14 @@ declare function DrawerFooter({ className, ...props }: React.ComponentProps<"div
|
|
|
200
257
|
declare function DrawerTitle({ className, ...props }: React.ComponentProps<typeof Drawer$1.Title>): react_jsx_runtime.JSX.Element;
|
|
201
258
|
declare function DrawerDescription({ className, ...props }: React.ComponentProps<typeof Drawer$1.Description>): react_jsx_runtime.JSX.Element;
|
|
202
259
|
|
|
260
|
+
declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
261
|
+
declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
|
|
262
|
+
declare function PopoverContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>): react_jsx_runtime.JSX.Element;
|
|
263
|
+
declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): react_jsx_runtime.JSX.Element;
|
|
264
|
+
|
|
265
|
+
declare function ScrollArea({ className, children, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
266
|
+
declare function ScrollBar({ className, orientation, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): react_jsx_runtime.JSX.Element;
|
|
267
|
+
|
|
203
268
|
declare function cn(...inputs: ClassValue[]): string;
|
|
204
269
|
|
|
205
|
-
export { AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, Button, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type Language, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, Slider, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, buttonVariants, cn, toggleVariants };
|
|
270
|
+
export { AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, Button, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type Language, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, type Notification, type NotificationType, NotificationsWidget, type NotificationsWidgetProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, ScrollArea, ScrollBar, Slider, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, buttonVariants, cn, toggleVariants };
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
|
8
8
|
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
9
9
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
10
10
|
import { Drawer as Drawer$1 } from 'vaul';
|
|
11
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
12
|
+
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
11
13
|
import { ClassValue } from 'clsx';
|
|
12
14
|
|
|
13
15
|
type ThemeSwitcherLabels = {
|
|
@@ -132,6 +134,61 @@ interface AvatarEditorDialogProps {
|
|
|
132
134
|
}
|
|
133
135
|
declare function AvatarEditorDialog({ value, onChange, onSave, displaySize, editorSize, outputSize, placeholder: _placeholder, editLabel, dialogTitle, acceptText, cancelText, successMessage, errorMessage, className, }: AvatarEditorDialogProps): react_jsx_runtime.JSX.Element;
|
|
134
136
|
|
|
137
|
+
/**
|
|
138
|
+
* NotificationsWidget - A compact notification bell for navigation bars
|
|
139
|
+
*
|
|
140
|
+
* @description
|
|
141
|
+
* Displays a bell icon with unread count badge, plays sound on new notifications,
|
|
142
|
+
* and shows a popover with recent notifications that can be marked as read or dismissed.
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```tsx
|
|
146
|
+
* <NotificationsWidget
|
|
147
|
+
* notifications={notifications}
|
|
148
|
+
* onMarkAsRead={(id) => markAsRead(id)}
|
|
149
|
+
* onMarkAllAsRead={() => markAllAsRead()}
|
|
150
|
+
* onDismiss={(id) => dismiss(id)}
|
|
151
|
+
* onClearAll={() => clearAll()}
|
|
152
|
+
* playSound={true}
|
|
153
|
+
* />
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
type NotificationType = "info" | "success" | "warning" | "error";
|
|
157
|
+
interface Notification {
|
|
158
|
+
id: string;
|
|
159
|
+
title: string;
|
|
160
|
+
message?: string;
|
|
161
|
+
type?: NotificationType;
|
|
162
|
+
timestamp: Date;
|
|
163
|
+
read?: boolean;
|
|
164
|
+
href?: string;
|
|
165
|
+
}
|
|
166
|
+
type WidgetSize = "sm" | "md" | "lg";
|
|
167
|
+
type DotColor = "red" | "blue" | "green" | "amber" | "purple" | "primary";
|
|
168
|
+
type SoundType = "chime" | "bell" | "pop" | "ding" | "none";
|
|
169
|
+
type PulseStyle = "ring" | "glow" | "bounce" | "none";
|
|
170
|
+
interface NotificationsWidgetProps {
|
|
171
|
+
notifications: Notification[];
|
|
172
|
+
onMarkAsRead?: (id: string) => void;
|
|
173
|
+
onMarkAllAsRead?: () => void;
|
|
174
|
+
onDismiss?: (id: string) => void;
|
|
175
|
+
onClearAll?: () => void;
|
|
176
|
+
onNotificationClick?: (notification: Notification) => void;
|
|
177
|
+
size?: WidgetSize;
|
|
178
|
+
maxVisible?: number;
|
|
179
|
+
playSound?: boolean;
|
|
180
|
+
soundUrl?: string;
|
|
181
|
+
className?: string;
|
|
182
|
+
emptyMessage?: string;
|
|
183
|
+
title?: string;
|
|
184
|
+
dotColor?: DotColor;
|
|
185
|
+
showPulse?: boolean;
|
|
186
|
+
soundType?: SoundType;
|
|
187
|
+
pulseStyle?: PulseStyle;
|
|
188
|
+
soundCooldown?: number;
|
|
189
|
+
}
|
|
190
|
+
declare function NotificationsWidget({ notifications, onMarkAsRead, onMarkAllAsRead, onDismiss, onClearAll, onNotificationClick, size, maxVisible, playSound, soundUrl, className, emptyMessage, title, dotColor, showPulse, soundType, pulseStyle, soundCooldown, }: NotificationsWidgetProps): react_jsx_runtime.JSX.Element;
|
|
191
|
+
|
|
135
192
|
declare const buttonVariants: (props?: ({
|
|
136
193
|
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
137
194
|
size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
|
|
@@ -200,6 +257,14 @@ declare function DrawerFooter({ className, ...props }: React.ComponentProps<"div
|
|
|
200
257
|
declare function DrawerTitle({ className, ...props }: React.ComponentProps<typeof Drawer$1.Title>): react_jsx_runtime.JSX.Element;
|
|
201
258
|
declare function DrawerDescription({ className, ...props }: React.ComponentProps<typeof Drawer$1.Description>): react_jsx_runtime.JSX.Element;
|
|
202
259
|
|
|
260
|
+
declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
261
|
+
declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
|
|
262
|
+
declare function PopoverContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>): react_jsx_runtime.JSX.Element;
|
|
263
|
+
declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): react_jsx_runtime.JSX.Element;
|
|
264
|
+
|
|
265
|
+
declare function ScrollArea({ className, children, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
266
|
+
declare function ScrollBar({ className, orientation, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): react_jsx_runtime.JSX.Element;
|
|
267
|
+
|
|
203
268
|
declare function cn(...inputs: ClassValue[]): string;
|
|
204
269
|
|
|
205
|
-
export { AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, Button, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type Language, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, Slider, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, buttonVariants, cn, toggleVariants };
|
|
270
|
+
export { AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, Button, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type Language, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, type Notification, type NotificationType, NotificationsWidget, type NotificationsWidgetProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, ScrollArea, ScrollBar, Slider, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, buttonVariants, cn, toggleVariants };
|