pelatform-ui 1.2.4 → 1.2.6
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/components.d.ts +18 -4
- package/dist/components.js +97 -47
- package/dist/index.d.ts +1 -5
- package/dist/index.js +1 -14
- package/dist/utils.d.ts +6 -0
- package/dist/utils.js +14 -0
- package/package.json +13 -9
- /package/dist/{chunk-7EOSDFS3.js → chunk-QEWGMDVY.js} +0 -0
package/dist/components.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
3
|
import React__default, { ComponentProps, ReactNode, HTMLAttributes, FC, DragEvent, RefObject } from 'react';
|
|
4
|
-
import { Alert, badgeVariants, Button } from '@pelatform/ui.components/
|
|
4
|
+
import { Alert, badgeVariants, Button } from '@pelatform/ui.components/radix';
|
|
5
5
|
import { B as BaseComponentProps, L as LinkComponentProps, I as ImageComponentProps } from './components-B1rw2xzN.js';
|
|
6
6
|
import { QueryClient } from '@tanstack/react-query';
|
|
7
7
|
import { ThemeProvider as ThemeProvider$1 } from 'next-themes';
|
|
@@ -2634,7 +2634,7 @@ declare const ToolbarActions: ({ children }: BaseComponentProps) => react_jsx_ru
|
|
|
2634
2634
|
|
|
2635
2635
|
/**
|
|
2636
2636
|
* User Avatar Component
|
|
2637
|
-
* Displays user profile pictures with fallback initials
|
|
2637
|
+
* Displays user profile pictures with fallback initials and optional status indicators
|
|
2638
2638
|
* Built on top of the base Avatar component with enhanced user-specific features
|
|
2639
2639
|
*/
|
|
2640
2640
|
/**
|
|
@@ -2643,6 +2643,8 @@ declare const ToolbarActions: ({ children }: BaseComponentProps) => react_jsx_ru
|
|
|
2643
2643
|
interface UserAvatarProps {
|
|
2644
2644
|
/** Additional CSS classes for styling */
|
|
2645
2645
|
className?: string;
|
|
2646
|
+
/** Whether to show online status indicator */
|
|
2647
|
+
indicator?: boolean;
|
|
2646
2648
|
/** Source URL for the user's profile image */
|
|
2647
2649
|
src?: string | null | undefined;
|
|
2648
2650
|
/** Alt text for the image, also used to generate initials */
|
|
@@ -2652,16 +2654,19 @@ interface UserAvatarProps {
|
|
|
2652
2654
|
* UserAvatar Component
|
|
2653
2655
|
*
|
|
2654
2656
|
* Displays a user's profile picture with automatic fallback to initials
|
|
2655
|
-
* when no image is available.
|
|
2657
|
+
* when no image is available. Supports optional online status indicators
|
|
2658
|
+
* and follows accessibility best practices.
|
|
2656
2659
|
*
|
|
2657
2660
|
* Features:
|
|
2658
2661
|
* - Automatic initials generation from name
|
|
2659
2662
|
* - Fallback handling for missing images
|
|
2663
|
+
* - Optional online status indicator
|
|
2660
2664
|
* - Accessible alt text support
|
|
2661
2665
|
* - Customizable styling
|
|
2662
2666
|
*
|
|
2663
2667
|
* @param props - Component props
|
|
2664
2668
|
* @param props.className - Additional CSS classes for styling
|
|
2669
|
+
* @param props.indicator - Whether to show online status indicator (default: false)
|
|
2665
2670
|
* @param props.src - Source URL for the user's profile image
|
|
2666
2671
|
* @param props.alt - Alt text for the image, also used to generate initials
|
|
2667
2672
|
* @returns JSX element containing the user avatar
|
|
@@ -2674,6 +2679,13 @@ interface UserAvatarProps {
|
|
|
2674
2679
|
* alt="John Doe"
|
|
2675
2680
|
* />
|
|
2676
2681
|
*
|
|
2682
|
+
* // Avatar with online indicator
|
|
2683
|
+
* <UserAvatar
|
|
2684
|
+
* src="https://example.com/avatar.jpg"
|
|
2685
|
+
* alt="Jane Smith"
|
|
2686
|
+
* indicator={true}
|
|
2687
|
+
* />
|
|
2688
|
+
*
|
|
2677
2689
|
* // Avatar with fallback initials (no image)
|
|
2678
2690
|
* <UserAvatar
|
|
2679
2691
|
* alt="Bob Johnson"
|
|
@@ -2687,6 +2699,7 @@ interface UserAvatarProps {
|
|
|
2687
2699
|
* key={user.id}
|
|
2688
2700
|
* src={user.avatar}
|
|
2689
2701
|
* alt={user.name}
|
|
2702
|
+
* indicator={user.isOnline}
|
|
2690
2703
|
* className="w-8 h-8"
|
|
2691
2704
|
* />
|
|
2692
2705
|
* ))}
|
|
@@ -2697,6 +2710,7 @@ interface UserAvatarProps {
|
|
|
2697
2710
|
* <UserAvatar
|
|
2698
2711
|
* src={currentUser.avatar}
|
|
2699
2712
|
* alt={currentUser.name}
|
|
2713
|
+
* indicator={true}
|
|
2700
2714
|
* className="w-16 h-16"
|
|
2701
2715
|
* />
|
|
2702
2716
|
* <div>
|
|
@@ -2706,7 +2720,7 @@ interface UserAvatarProps {
|
|
|
2706
2720
|
* </div>
|
|
2707
2721
|
* ```
|
|
2708
2722
|
*/
|
|
2709
|
-
declare function UserAvatar({ className, src, alt }: UserAvatarProps): react_jsx_runtime.JSX.Element;
|
|
2723
|
+
declare function UserAvatar({ className, indicator, src, alt }: UserAvatarProps): react_jsx_runtime.JSX.Element;
|
|
2710
2724
|
/**
|
|
2711
2725
|
* Utility function to generate initials from a name
|
|
2712
2726
|
*
|
package/dist/components.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-NOAZYT3J.js";
|
|
5
5
|
import {
|
|
6
6
|
cn
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-QEWGMDVY.js";
|
|
8
8
|
import {
|
|
9
9
|
DEFAULT_THEME_MODE,
|
|
10
10
|
THEME_MODES
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
TriangleAlertIcon
|
|
21
21
|
} from "lucide-react";
|
|
22
22
|
import { toast } from "sonner";
|
|
23
|
-
import { Alert, AlertTitle } from "@pelatform/ui.components/
|
|
23
|
+
import { Alert, AlertTitle } from "@pelatform/ui.components/radix";
|
|
24
24
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
25
25
|
var iconMap = {
|
|
26
26
|
primary: /* @__PURE__ */ jsx(CircleAlertIcon, {}),
|
|
@@ -98,7 +98,7 @@ import {
|
|
|
98
98
|
AlertDialogFooter,
|
|
99
99
|
AlertDialogHeader,
|
|
100
100
|
AlertDialogTitle
|
|
101
|
-
} from "@pelatform/ui.components/
|
|
101
|
+
} from "@pelatform/ui.components/radix";
|
|
102
102
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
103
103
|
var ConfirmDismissDialog = ({
|
|
104
104
|
open,
|
|
@@ -165,7 +165,7 @@ function ScreenLoader({
|
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
// src/components/layout/auth.tsx
|
|
168
|
-
import { Card, CardContent } from "@pelatform/ui.components/
|
|
168
|
+
import { Card, CardContent } from "@pelatform/ui.components/radix";
|
|
169
169
|
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
170
170
|
function LayoutAuth({
|
|
171
171
|
children,
|
|
@@ -297,7 +297,7 @@ function ComingSoon({ className, title, description }) {
|
|
|
297
297
|
}
|
|
298
298
|
|
|
299
299
|
// src/components/layout/error.tsx
|
|
300
|
-
import { Badge } from "@pelatform/ui.components/
|
|
300
|
+
import { Badge } from "@pelatform/ui.components/radix";
|
|
301
301
|
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
302
302
|
function ErrorComponents({
|
|
303
303
|
className,
|
|
@@ -327,7 +327,7 @@ function ErrorComponents({
|
|
|
327
327
|
}
|
|
328
328
|
)
|
|
329
329
|
] }),
|
|
330
|
-
/* @__PURE__ */ jsx9(Badge, { variant: "destructive", className: "mb-3", children: "404 Error" }),
|
|
330
|
+
/* @__PURE__ */ jsx9(Badge, { variant: "destructive-outline", className: "mb-3", children: "404 Error" }),
|
|
331
331
|
/* @__PURE__ */ jsx9("h3", { className: "mb-2 text-center font-semibold text-2xl text-foreground", children: textTitle }),
|
|
332
332
|
/* @__PURE__ */ jsx9("div", { className: "mb-10 text-center text-base text-secondary-foreground", children: textSubtitle })
|
|
333
333
|
] });
|
|
@@ -352,7 +352,7 @@ function ErrorComponents({
|
|
|
352
352
|
}
|
|
353
353
|
)
|
|
354
354
|
] }),
|
|
355
|
-
/* @__PURE__ */ jsx9(Badge, { variant: "destructive", className: "mb-3", children: "500 Error" }),
|
|
355
|
+
/* @__PURE__ */ jsx9(Badge, { variant: "destructive-outline", className: "mb-3", children: "500 Error" }),
|
|
356
356
|
/* @__PURE__ */ jsx9("h3", { className: "mb-2 text-center font-semibold text-2xl text-foreground", children: textTitle }),
|
|
357
357
|
/* @__PURE__ */ jsx9("div", { className: "mb-10 text-center text-base text-secondary-foreground", children: textSubtitle }),
|
|
358
358
|
button
|
|
@@ -484,7 +484,7 @@ function CodeDisplay({
|
|
|
484
484
|
|
|
485
485
|
// src/components/mdx/download.tsx
|
|
486
486
|
import { DownloadIcon } from "lucide-react";
|
|
487
|
-
import { Button } from "@pelatform/ui.components/
|
|
487
|
+
import { Button } from "@pelatform/ui.components/radix";
|
|
488
488
|
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
489
489
|
function DownloadFile({ children, className, href }) {
|
|
490
490
|
return /* @__PURE__ */ jsx16("div", { className: "inline-flex pb-4", children: /* @__PURE__ */ jsx16(Button, { size: "lg", className: cn("rounded-full", className), children: /* @__PURE__ */ jsxs12("a", { href, target: "_blank", rel: "noopener noreferrer", children: [
|
|
@@ -565,7 +565,7 @@ function Youtube({ id }) {
|
|
|
565
565
|
|
|
566
566
|
// src/components/navigation/back-link.tsx
|
|
567
567
|
import { ChevronLeftIcon } from "lucide-react";
|
|
568
|
-
import { Button as Button2 } from "@pelatform/ui.components/
|
|
568
|
+
import { Button as Button2 } from "@pelatform/ui.components/radix";
|
|
569
569
|
import { jsx as jsx22, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
570
570
|
function BackLink({ Link = DefaultLink, children, href, className }) {
|
|
571
571
|
return /* @__PURE__ */ jsxs13(
|
|
@@ -595,7 +595,7 @@ function BackLink({ Link = DefaultLink, children, href, className }) {
|
|
|
595
595
|
// src/components/navigation/command-menu.tsx
|
|
596
596
|
import * as React from "react";
|
|
597
597
|
import { SearchIcon } from "lucide-react";
|
|
598
|
-
import { Button as Button3, CommandDialog, CommandInput, CommandList } from "@pelatform/ui.components/
|
|
598
|
+
import { Button as Button3, CommandDialog, CommandInput, CommandList } from "@pelatform/ui.components/radix";
|
|
599
599
|
import { Fragment as Fragment2, jsx as jsx23, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
600
600
|
function CommandMenu({
|
|
601
601
|
children,
|
|
@@ -680,7 +680,7 @@ import {
|
|
|
680
680
|
DropdownMenuSubContent,
|
|
681
681
|
DropdownMenuSubTrigger,
|
|
682
682
|
DropdownMenuTrigger
|
|
683
|
-
} from "@pelatform/ui.components/
|
|
683
|
+
} from "@pelatform/ui.components/radix";
|
|
684
684
|
import { jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
685
685
|
function MainNav({ Link = DefaultLink, pathname, items, className }) {
|
|
686
686
|
return /* @__PURE__ */ jsx24("div", { className: cn("me-4 hidden items-center justify-center md:flex", className), children: /* @__PURE__ */ jsx24("nav", { className: "flex items-center gap-4 font-medium text-sm xl:gap-6", children: items.map((item) => /* @__PURE__ */ jsx24(NavItemRenderer, { Link, item, pathname, level: 1 }, item.title)) }) });
|
|
@@ -694,7 +694,7 @@ function NavItemRenderer({ Link = DefaultLink, item, pathname, level }) {
|
|
|
694
694
|
) ?? false : item.href === pathname || item.href !== "/" && item.href && pathname?.startsWith(item.href);
|
|
695
695
|
if (hasChildren && level <= 3) {
|
|
696
696
|
return /* @__PURE__ */ jsxs15(DropdownMenu, { children: [
|
|
697
|
-
/* @__PURE__ */ jsx24(DropdownMenuTrigger, { children: /* @__PURE__ */ jsxs15(
|
|
697
|
+
/* @__PURE__ */ jsx24(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs15(
|
|
698
698
|
"button",
|
|
699
699
|
{
|
|
700
700
|
className: cn(
|
|
@@ -777,7 +777,7 @@ function ChildNavItemRenderer({ Link = DefaultLink, item, pathname, level }) {
|
|
|
777
777
|
)) })
|
|
778
778
|
] });
|
|
779
779
|
}
|
|
780
|
-
return /* @__PURE__ */ jsx24(DropdownMenuItem, { children: /* @__PURE__ */ jsxs15(
|
|
780
|
+
return /* @__PURE__ */ jsx24(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsxs15(
|
|
781
781
|
Link,
|
|
782
782
|
{
|
|
783
783
|
href: item.href || "",
|
|
@@ -808,7 +808,7 @@ import {
|
|
|
808
808
|
DrawerDescription,
|
|
809
809
|
DrawerTitle,
|
|
810
810
|
DrawerTrigger
|
|
811
|
-
} from "@pelatform/ui.components/
|
|
811
|
+
} from "@pelatform/ui.components/radix";
|
|
812
812
|
import { jsx as jsx25, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
813
813
|
function MobileNav({ children, className }) {
|
|
814
814
|
const { setMetaColor, metaColor } = useMetaColor();
|
|
@@ -2916,7 +2916,7 @@ var QueryClientProvider = ({
|
|
|
2916
2916
|
// src/components/providers/query-provider.tsx
|
|
2917
2917
|
import { CircleAlertIcon as CircleAlertIcon2 } from "lucide-react";
|
|
2918
2918
|
import { toast as toast2 } from "sonner";
|
|
2919
|
-
import { Alert as Alert2, AlertTitle as AlertTitle2 } from "@pelatform/ui.components/
|
|
2919
|
+
import { Alert as Alert2, AlertTitle as AlertTitle2 } from "@pelatform/ui.components/radix";
|
|
2920
2920
|
import { jsx as jsx27, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2921
2921
|
var QueryProvider = ({
|
|
2922
2922
|
client: clientProps,
|
|
@@ -2986,7 +2986,7 @@ var QueryProvider = ({
|
|
|
2986
2986
|
|
|
2987
2987
|
// src/components/providers/theme-provider.tsx
|
|
2988
2988
|
import { ThemeProvider as NextThemesProvider } from "next-themes";
|
|
2989
|
-
import { TooltipProvider } from "@pelatform/ui.components/
|
|
2989
|
+
import { TooltipProvider } from "@pelatform/ui.components/radix";
|
|
2990
2990
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
2991
2991
|
function ThemeProvider({ children, ...props }) {
|
|
2992
2992
|
return /* @__PURE__ */ jsx28(
|
|
@@ -3000,13 +3000,13 @@ function ThemeProvider({ children, ...props }) {
|
|
|
3000
3000
|
storageKey: "theme",
|
|
3001
3001
|
themes: [THEME_MODES.LIGHT, THEME_MODES.DARK, THEME_MODES.SYSTEM],
|
|
3002
3002
|
...props,
|
|
3003
|
-
children: /* @__PURE__ */ jsx28(TooltipProvider, {
|
|
3003
|
+
children: /* @__PURE__ */ jsx28(TooltipProvider, { delayDuration: 0, children })
|
|
3004
3004
|
}
|
|
3005
3005
|
);
|
|
3006
3006
|
}
|
|
3007
3007
|
|
|
3008
3008
|
// src/components/ui/announcement.tsx
|
|
3009
|
-
import { Badge as Badge2 } from "@pelatform/ui.components/
|
|
3009
|
+
import { Badge as Badge2 } from "@pelatform/ui.components/radix";
|
|
3010
3010
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
3011
3011
|
var Announcement = ({
|
|
3012
3012
|
variant = "outline",
|
|
@@ -3469,7 +3469,7 @@ import {
|
|
|
3469
3469
|
DropdownMenuSubContent as DropdownMenuSubContent2,
|
|
3470
3470
|
DropdownMenuSubTrigger as DropdownMenuSubTrigger2,
|
|
3471
3471
|
DropdownMenuTrigger as DropdownMenuTrigger2
|
|
3472
|
-
} from "@pelatform/ui.components/
|
|
3472
|
+
} from "@pelatform/ui.components/radix";
|
|
3473
3473
|
import { jsx as jsx35, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3474
3474
|
function getFlagUrl(flag) {
|
|
3475
3475
|
const flagCode = flag.toLowerCase();
|
|
@@ -3505,7 +3505,7 @@ function LanguageSwitcher({
|
|
|
3505
3505
|
}
|
|
3506
3506
|
if (type === "dropdown") {
|
|
3507
3507
|
return /* @__PURE__ */ jsxs23(DropdownMenu2, { children: [
|
|
3508
|
-
/* @__PURE__ */ jsx35(DropdownMenuTrigger2, { children: /* @__PURE__ */ jsxs23(
|
|
3508
|
+
/* @__PURE__ */ jsx35(DropdownMenuTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs23(
|
|
3509
3509
|
Button5,
|
|
3510
3510
|
{
|
|
3511
3511
|
variant,
|
|
@@ -3522,28 +3522,36 @@ function LanguageSwitcher({
|
|
|
3522
3522
|
]
|
|
3523
3523
|
}
|
|
3524
3524
|
) }),
|
|
3525
|
-
/* @__PURE__ */ jsx35(
|
|
3526
|
-
|
|
3525
|
+
/* @__PURE__ */ jsx35(
|
|
3526
|
+
DropdownMenuContent2,
|
|
3527
3527
|
{
|
|
3528
|
-
|
|
3529
|
-
className:
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3528
|
+
align: "end",
|
|
3529
|
+
className: "min-w-[150px]",
|
|
3530
|
+
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
3531
|
+
children: languages.map((lang) => /* @__PURE__ */ jsxs23(
|
|
3532
|
+
DropdownMenuItem2,
|
|
3533
|
+
{
|
|
3534
|
+
onClick: () => handleLanguageChange(lang.code),
|
|
3535
|
+
className: cn("gap-2", currentLocale === lang.code && "bg-accent"),
|
|
3536
|
+
children: [
|
|
3537
|
+
showFlags && lang.flag ? /* @__PURE__ */ jsx35(
|
|
3538
|
+
Image2,
|
|
3539
|
+
{
|
|
3540
|
+
src: customFlagUrl ? lang.flag : getFlagUrl(lang.flag),
|
|
3541
|
+
alt: `${lang.name} flag`,
|
|
3542
|
+
className: "size-4 rounded-full object-cover",
|
|
3543
|
+
width: 24,
|
|
3544
|
+
height: 24
|
|
3545
|
+
}
|
|
3546
|
+
) : showFlags ? /* @__PURE__ */ jsx35(GlobeIcon, { className: "size-4" }) : null,
|
|
3547
|
+
showNames && /* @__PURE__ */ jsx35("span", { className: "text-sm", children: lang.name }),
|
|
3548
|
+
currentLocale === lang.code && /* @__PURE__ */ jsx35("span", { className: "ms-auto text-muted-foreground text-xs", children: "\u2713" })
|
|
3549
|
+
]
|
|
3550
|
+
},
|
|
3551
|
+
lang.code
|
|
3552
|
+
))
|
|
3553
|
+
}
|
|
3554
|
+
)
|
|
3547
3555
|
] });
|
|
3548
3556
|
}
|
|
3549
3557
|
return /* @__PURE__ */ jsxs23(DropdownMenuSub2, { children: [
|
|
@@ -3636,7 +3644,7 @@ import {
|
|
|
3636
3644
|
DropdownMenuContent as DropdownMenuContent3,
|
|
3637
3645
|
DropdownMenuItem as DropdownMenuItem3,
|
|
3638
3646
|
DropdownMenuTrigger as DropdownMenuTrigger3
|
|
3639
|
-
} from "@pelatform/ui.components/
|
|
3647
|
+
} from "@pelatform/ui.components/radix";
|
|
3640
3648
|
import { Fragment as Fragment4, jsx as jsx37, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3641
3649
|
function ModeSwitcher({
|
|
3642
3650
|
className,
|
|
@@ -3697,7 +3705,7 @@ function ModeSwitcher({
|
|
|
3697
3705
|
}
|
|
3698
3706
|
if (type === "dropdown") {
|
|
3699
3707
|
return /* @__PURE__ */ jsxs24(DropdownMenu3, { children: [
|
|
3700
|
-
/* @__PURE__ */ jsx37(DropdownMenuTrigger3, { children: /* @__PURE__ */ jsxs24(
|
|
3708
|
+
/* @__PURE__ */ jsx37(DropdownMenuTrigger3, { asChild: true, children: /* @__PURE__ */ jsxs24(
|
|
3701
3709
|
Button6,
|
|
3702
3710
|
{
|
|
3703
3711
|
size,
|
|
@@ -3712,7 +3720,7 @@ function ModeSwitcher({
|
|
|
3712
3720
|
]
|
|
3713
3721
|
}
|
|
3714
3722
|
) }),
|
|
3715
|
-
/* @__PURE__ */ jsxs24(DropdownMenuContent3, { align: "end", children: [
|
|
3723
|
+
/* @__PURE__ */ jsxs24(DropdownMenuContent3, { align: "end", onCloseAutoFocus: (e) => e.preventDefault(), children: [
|
|
3716
3724
|
/* @__PURE__ */ jsxs24(
|
|
3717
3725
|
DropdownMenuItem3,
|
|
3718
3726
|
{
|
|
@@ -3880,14 +3888,32 @@ var ToolbarActions = ({ children }) => {
|
|
|
3880
3888
|
};
|
|
3881
3889
|
|
|
3882
3890
|
// src/components/ui/user-avatar.tsx
|
|
3883
|
-
import {
|
|
3891
|
+
import { cva } from "class-variance-authority";
|
|
3892
|
+
import { Avatar, AvatarFallback, AvatarImage } from "@pelatform/ui.components/radix";
|
|
3884
3893
|
import { jsx as jsx40, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3885
|
-
|
|
3894
|
+
var avatarStatusVariants = cva(
|
|
3895
|
+
"flex size-2 items-center rounded-full border-2 border-background",
|
|
3896
|
+
{
|
|
3897
|
+
variants: {
|
|
3898
|
+
variant: {
|
|
3899
|
+
online: "bg-green-600",
|
|
3900
|
+
offline: "bg-zinc-400 dark:bg-zinc-500",
|
|
3901
|
+
busy: "bg-yellow-600",
|
|
3902
|
+
away: "bg-blue-600"
|
|
3903
|
+
}
|
|
3904
|
+
},
|
|
3905
|
+
defaultVariants: {
|
|
3906
|
+
variant: "online"
|
|
3907
|
+
}
|
|
3908
|
+
}
|
|
3909
|
+
);
|
|
3910
|
+
function UserAvatar({ className, indicator = false, src, alt }) {
|
|
3886
3911
|
const name = alt ?? "User";
|
|
3887
3912
|
const initial = getInitials(name);
|
|
3888
3913
|
return /* @__PURE__ */ jsxs26(Avatar, { className, children: [
|
|
3889
3914
|
/* @__PURE__ */ jsx40(AvatarImage, { src: src ?? void 0, alt: name }),
|
|
3890
|
-
/* @__PURE__ */ jsx40(AvatarFallback, { children: initial })
|
|
3915
|
+
/* @__PURE__ */ jsx40(AvatarFallback, { children: initial }),
|
|
3916
|
+
indicator && /* @__PURE__ */ jsx40(AvatarIndicator, { className: "-end-2 -top-2", children: /* @__PURE__ */ jsx40(AvatarStatus, { variant: "online", className: "size-2.5" }) })
|
|
3891
3917
|
] });
|
|
3892
3918
|
}
|
|
3893
3919
|
var getInitials = (name, count) => {
|
|
@@ -3897,6 +3923,30 @@ var getInitials = (name, count) => {
|
|
|
3897
3923
|
const initials = name.split(" ").filter(Boolean).map((part) => part[0].toUpperCase());
|
|
3898
3924
|
return count && count > 0 ? initials.slice(0, count).join("") : initials.join("");
|
|
3899
3925
|
};
|
|
3926
|
+
function AvatarIndicator({ className, ...props }) {
|
|
3927
|
+
return /* @__PURE__ */ jsx40(
|
|
3928
|
+
"div",
|
|
3929
|
+
{
|
|
3930
|
+
"data-slot": "avatar-indicator",
|
|
3931
|
+
className: cn("absolute flex size-6 items-center justify-center", className),
|
|
3932
|
+
...props
|
|
3933
|
+
}
|
|
3934
|
+
);
|
|
3935
|
+
}
|
|
3936
|
+
function AvatarStatus({
|
|
3937
|
+
className,
|
|
3938
|
+
variant,
|
|
3939
|
+
...props
|
|
3940
|
+
}) {
|
|
3941
|
+
return /* @__PURE__ */ jsx40(
|
|
3942
|
+
"div",
|
|
3943
|
+
{
|
|
3944
|
+
"data-slot": "avatar-status",
|
|
3945
|
+
className: cn(avatarStatusVariants({ variant }), className),
|
|
3946
|
+
...props
|
|
3947
|
+
}
|
|
3948
|
+
);
|
|
3949
|
+
}
|
|
3900
3950
|
|
|
3901
3951
|
// src/components/utils/fonts.tsx
|
|
3902
3952
|
import { jsx as jsx41 } from "react/jsx-runtime";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import React__default, { ComponentType, SVGProps } from 'react';
|
|
3
|
-
import { ClassValue } from 'clsx';
|
|
4
|
-
export { D as DEFAULT_THEME_MODE, M as META_THEME_COLORS, T as THEME_MODES, a as ThemeMode } from './colors-CUDWvz1g.js';
|
|
5
3
|
export { B as BaseComponentProps, I as ImageComponentProps, L as LinkComponentProps } from './components-B1rw2xzN.js';
|
|
6
4
|
|
|
7
5
|
/**
|
|
@@ -83,8 +81,6 @@ declare const Icons: {
|
|
|
83
81
|
Zoom: (props: IconProps) => react_jsx_runtime.JSX.Element;
|
|
84
82
|
};
|
|
85
83
|
|
|
86
|
-
declare function cn(...inputs: ClassValue[]): string;
|
|
87
|
-
|
|
88
84
|
/**
|
|
89
85
|
* Menu item interface
|
|
90
86
|
*/
|
|
@@ -127,4 +123,4 @@ interface MenuItem {
|
|
|
127
123
|
*/
|
|
128
124
|
type MenuConfig = MenuItem[];
|
|
129
125
|
|
|
130
|
-
export { Icons, type MenuConfig, type MenuItem
|
|
126
|
+
export { Icons, type MenuConfig, type MenuItem };
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
cn
|
|
3
|
-
} from "./chunk-7EOSDFS3.js";
|
|
4
|
-
import {
|
|
5
|
-
DEFAULT_THEME_MODE,
|
|
6
|
-
META_THEME_COLORS,
|
|
7
|
-
THEME_MODES
|
|
8
|
-
} from "./chunk-HW52LCWN.js";
|
|
9
|
-
|
|
10
1
|
// src/components/icons.tsx
|
|
11
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
3
|
var Icons = {
|
|
@@ -628,9 +619,5 @@ var Icons = {
|
|
|
628
619
|
) })
|
|
629
620
|
};
|
|
630
621
|
export {
|
|
631
|
-
|
|
632
|
-
Icons,
|
|
633
|
-
META_THEME_COLORS,
|
|
634
|
-
THEME_MODES,
|
|
635
|
-
cn
|
|
622
|
+
Icons
|
|
636
623
|
};
|
package/dist/utils.d.ts
ADDED
package/dist/utils.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pelatform-ui",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
4
4
|
"description": "A Modern and Minimal React UI Library built with TailwindCSS.",
|
|
5
5
|
"author": "Pelatform",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,17 +24,21 @@
|
|
|
24
24
|
"types": "./dist/base.d.ts",
|
|
25
25
|
"default": "./dist/base.js"
|
|
26
26
|
},
|
|
27
|
-
"./
|
|
28
|
-
"types": "./dist/
|
|
29
|
-
"
|
|
27
|
+
"./components": {
|
|
28
|
+
"types": "./dist/components.d.ts",
|
|
29
|
+
"default": "./dist/components.js"
|
|
30
30
|
},
|
|
31
31
|
"./hooks": {
|
|
32
32
|
"types": "./dist/hooks.d.ts",
|
|
33
33
|
"default": "./dist/hooks.js"
|
|
34
34
|
},
|
|
35
|
-
"./
|
|
36
|
-
"types": "./dist/
|
|
37
|
-
"default": "./dist/
|
|
35
|
+
"./radix": {
|
|
36
|
+
"types": "./dist/radix.d.ts",
|
|
37
|
+
"default": "./dist/radix.js"
|
|
38
|
+
},
|
|
39
|
+
"./utils": {
|
|
40
|
+
"types": "./dist/utils.d.ts",
|
|
41
|
+
"default": "./dist/utils.js"
|
|
38
42
|
}
|
|
39
43
|
},
|
|
40
44
|
"scripts": {
|
|
@@ -80,8 +84,8 @@
|
|
|
80
84
|
"@tanstack/react-query": "^5.90.21",
|
|
81
85
|
"@types/node": "^25.3.3",
|
|
82
86
|
"@types/react": "^19.2.14",
|
|
83
|
-
"lucide-react": "^0.
|
|
84
|
-
"motion": "^12.
|
|
87
|
+
"lucide-react": "^0.577.0",
|
|
88
|
+
"motion": "^12.35.0",
|
|
85
89
|
"next-themes": "^0.4.6",
|
|
86
90
|
"react": "^19.2.4",
|
|
87
91
|
"react-dom": "^19.2.4",
|
|
File without changes
|