@alexandregme/zljs 0.5.0 → 1.0.0
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/index.d.ts +10 -7
- package/dist/index.js +151 -118
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -18,9 +18,9 @@ type DataColor = "blue" | "red" | "yellow" | "green" | "gray" | "orange";
|
|
|
18
18
|
/**
|
|
19
19
|
* Sizes shared by every sized component (Icon, Button, Input, etc.)
|
|
20
20
|
*/
|
|
21
|
-
type Size = "sm" | "md";
|
|
21
|
+
type Size = "sm" | "md" | "lg";
|
|
22
22
|
|
|
23
|
-
declare const iconNames: readonly ["Check", "X", "Plus", "Minus", "Search", "Menu", "ChevronDown", "ChevronUp", "ChevronLeft", "ChevronRight", "Pencil", "Trash2", "Save", "RefreshCw", "Home", "MessageSquare", "Users", "Store", "ShoppingCart", "BarChart3", "Brain", "Send", "LogOut", "User", "Key", "Contact", "Package", "Warehouse", "HandCoins", "Stethoscope", "LogIn", "Megaphone", "LayoutDashboard", "Smile", "Frown", "Cat", "ArrowRight", "Loader", "CheckCircle", "XCircle", "AlertTriangle", "Info", "SiWhatsapp", "SiFacebook", "SiInstagram", "SiShopify"];
|
|
23
|
+
declare const iconNames: readonly ["Check", "X", "Plus", "Minus", "Search", "Menu", "ChevronDown", "ChevronUp", "ChevronLeft", "ChevronRight", "Pencil", "Trash2", "Save", "RefreshCw", "Home", "MessageSquare", "Users", "Store", "ShoppingCart", "BarChart3", "Brain", "Send", "LogOut", "User", "Key", "Contact", "Package", "Warehouse", "HandCoins", "Stethoscope", "LogIn", "Megaphone", "LayoutDashboard", "Smile", "Frown", "Cat", "ArrowRight", "Loader", "LoaderCircle", "CheckCircle", "XCircle", "AlertTriangle", "Info", "SiWhatsapp", "SiFacebook", "SiInstagram", "SiShopify"];
|
|
24
24
|
|
|
25
25
|
type IconName = (typeof iconNames)[number];
|
|
26
26
|
interface IconProps {
|
|
@@ -28,12 +28,13 @@ interface IconProps {
|
|
|
28
28
|
size?: Size;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
type ButtonVariant = "default" | "icon" | "
|
|
31
|
+
type ButtonVariant = "default" | "icon" | "link";
|
|
32
|
+
type ButtonColor = SemanticColor | "ghost";
|
|
32
33
|
interface ButtonProps {
|
|
33
34
|
children?: ReactNode;
|
|
34
35
|
type?: "button" | "submit" | "reset";
|
|
35
36
|
variant?: ButtonVariant;
|
|
36
|
-
color?:
|
|
37
|
+
color?: ButtonColor;
|
|
37
38
|
size?: Size;
|
|
38
39
|
icon?: IconName;
|
|
39
40
|
iconPosition?: "left" | "right";
|
|
@@ -400,11 +401,13 @@ interface ConnectedModalProps {
|
|
|
400
401
|
|
|
401
402
|
declare const ConnectedModal: ({ modalId, title, description, size, children, }: ConnectedModalProps) => react.JSX.Element;
|
|
402
403
|
|
|
404
|
+
type SpinnerVariant = "circle" | "dots" | "refresh";
|
|
403
405
|
interface SpinnerProps {
|
|
404
|
-
|
|
406
|
+
variant?: SpinnerVariant;
|
|
407
|
+
size?: Size;
|
|
405
408
|
}
|
|
406
409
|
|
|
407
|
-
declare const Spinner: ({
|
|
410
|
+
declare const Spinner: ({ variant, size }: SpinnerProps) => react.JSX.Element;
|
|
408
411
|
|
|
409
412
|
interface LoaderProps {
|
|
410
413
|
label?: string;
|
|
@@ -453,4 +456,4 @@ declare class HTTPClient {
|
|
|
453
456
|
}
|
|
454
457
|
|
|
455
458
|
export { AppWrapper, Button, Checkbox, ConnectedModal, DataGrid, DocumentWrapper, Error, Form, GlobalState, HTTPClient, Heading, Icon, Input, Loader, Modal, PageWrapper, Radio, Select, Sidebar, Spinner, StatsCard, Tag, Text, TextArea, Toaster, WhatsAppButton, splitURLasPath, useAppStore, useModalStore, usePageStore, useRouterStore, useToastStore };
|
|
456
|
-
export type { AppState, AppWrapperProps, ButtonProps, ButtonVariant, CheckboxProps, ConnectedModalProps, DataGridColumn, DataGridProps, DocumentWrapperProps, ErrorProps, ExtendedStore, FormProps, GlobalStateProps, HeadingProps, HttpClientConfig, HttpRequestConfig, IconName, InitPageFunction, InputProps, LoaderProps, ModalEntry, ModalProps, ModalState, PageState, PageWrapperProps, RadioProps, RouterState, SelectOption, SelectProps, SidebarItem, SidebarProps, SidebarSection, SidebarUser, SpinnerProps, StatsCardProps, TagProps, TextAreaProps, TextProps, TextVariant, Toast, ToastState, ToastType, WhatsAppButtonProps };
|
|
459
|
+
export type { AppState, AppWrapperProps, ButtonColor, ButtonProps, ButtonVariant, CheckboxProps, ConnectedModalProps, DataGridColumn, DataGridProps, DocumentWrapperProps, ErrorProps, ExtendedStore, FormProps, GlobalStateProps, HeadingProps, HttpClientConfig, HttpRequestConfig, IconName, InitPageFunction, InputProps, LoaderProps, ModalEntry, ModalProps, ModalState, PageState, PageWrapperProps, RadioProps, RouterState, SelectOption, SelectProps, SidebarItem, SidebarProps, SidebarSection, SidebarUser, SpinnerProps, SpinnerVariant, StatsCardProps, TagProps, TextAreaProps, TextProps, TextVariant, Toast, ToastState, ToastType, WhatsAppButtonProps };
|
package/dist/index.js
CHANGED
|
@@ -19,7 +19,8 @@ var iconBrands = {
|
|
|
19
19
|
};
|
|
20
20
|
var iconSizes = {
|
|
21
21
|
sm: 12,
|
|
22
|
-
md: 16
|
|
22
|
+
md: 16,
|
|
23
|
+
lg: 24
|
|
23
24
|
};
|
|
24
25
|
|
|
25
26
|
// core/icon/icon.tsx
|
|
@@ -39,8 +40,7 @@ var button = tv({
|
|
|
39
40
|
variant: {
|
|
40
41
|
default: "px-4 py-2 text-white text-sm gap-2 rounded-md focus:ring-2 focus:ring-offset-2",
|
|
41
42
|
icon: "p-1 bg-transparent text-gray-500 hover:text-gray-700 hover:bg-gray-100 focus:ring-gray-500 rounded-md focus:ring-2 focus:ring-offset-2",
|
|
42
|
-
|
|
43
|
-
link: "text-xs underline bg-transparent hover:no-underline"
|
|
43
|
+
link: "text-xs hover:underline"
|
|
44
44
|
},
|
|
45
45
|
color: {
|
|
46
46
|
primary: "bg-blue-600 hover:bg-blue-700 focus:ring-blue-500",
|
|
@@ -48,14 +48,21 @@ var button = tv({
|
|
|
48
48
|
danger: "bg-red-600 hover:bg-red-700 focus:ring-red-500",
|
|
49
49
|
warning: "bg-yellow-500 hover:bg-yellow-600 focus:ring-yellow-500 text-gray-900",
|
|
50
50
|
info: "bg-cyan-500 hover:bg-cyan-600 focus:ring-cyan-500",
|
|
51
|
+
ghost: "bg-transparent text-neutral-400 hover:text-white hover:bg-neutral-800 focus:ring-neutral-600",
|
|
51
52
|
none: ""
|
|
52
53
|
},
|
|
53
54
|
size: {
|
|
54
55
|
sm: "",
|
|
55
|
-
md: ""
|
|
56
|
+
md: "",
|
|
57
|
+
lg: ""
|
|
56
58
|
}
|
|
57
59
|
},
|
|
58
60
|
compoundVariants: [
|
|
61
|
+
{
|
|
62
|
+
variant: "default",
|
|
63
|
+
color: "none",
|
|
64
|
+
class: "bg-gray-100 text-gray-900 hover:bg-gray-200 focus:ring-gray-500"
|
|
65
|
+
},
|
|
59
66
|
{
|
|
60
67
|
variant: "default",
|
|
61
68
|
size: "sm",
|
|
@@ -66,20 +73,54 @@ var button = tv({
|
|
|
66
73
|
size: "sm",
|
|
67
74
|
class: "p-0.5"
|
|
68
75
|
},
|
|
76
|
+
{
|
|
77
|
+
variant: "default",
|
|
78
|
+
size: "lg",
|
|
79
|
+
class: "px-6 py-3 text-base gap-2"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
variant: "icon",
|
|
83
|
+
size: "lg",
|
|
84
|
+
class: "p-2"
|
|
85
|
+
},
|
|
69
86
|
{
|
|
70
87
|
variant: "link",
|
|
71
88
|
color: "primary",
|
|
72
|
-
class: "
|
|
89
|
+
class: "text-blue-600 hover:text-blue-800"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
variant: "link",
|
|
93
|
+
color: "success",
|
|
94
|
+
class: "text-green-600 hover:text-green-800"
|
|
73
95
|
},
|
|
74
96
|
{
|
|
75
97
|
variant: "link",
|
|
76
98
|
color: "danger",
|
|
77
|
-
class: "
|
|
99
|
+
class: "text-red-600 hover:text-red-800"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
variant: "link",
|
|
103
|
+
color: "warning",
|
|
104
|
+
class: "text-yellow-600 hover:text-yellow-800"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
variant: "link",
|
|
108
|
+
color: "info",
|
|
109
|
+
class: "text-cyan-600 hover:text-cyan-800"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
variant: "link",
|
|
113
|
+
color: "ghost",
|
|
114
|
+
class: "text-neutral-400 hover:text-neutral-600"
|
|
78
115
|
},
|
|
79
116
|
{
|
|
80
117
|
variant: "link",
|
|
81
118
|
color: "none",
|
|
82
119
|
class: "text-slate-500 hover:text-slate-700"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
variant: "link",
|
|
123
|
+
class: "bg-transparent hover:bg-transparent"
|
|
83
124
|
}
|
|
84
125
|
],
|
|
85
126
|
defaultVariants: {
|
|
@@ -130,7 +171,7 @@ var Button = ({
|
|
|
130
171
|
"aria-label": ariaLabel,
|
|
131
172
|
className: button({
|
|
132
173
|
variant,
|
|
133
|
-
color: variant === "icon"
|
|
174
|
+
color: variant === "icon" && color !== "ghost" ? "none" : color,
|
|
134
175
|
size
|
|
135
176
|
}),
|
|
136
177
|
children: renderContent()
|
|
@@ -589,45 +630,53 @@ var DataGrid = ({
|
|
|
589
630
|
);
|
|
590
631
|
};
|
|
591
632
|
|
|
592
|
-
// core/
|
|
593
|
-
import {
|
|
594
|
-
var
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
card: "bg-red-100",
|
|
602
|
-
label: "text-red-800",
|
|
603
|
-
value: "text-red-900"
|
|
604
|
-
},
|
|
605
|
-
yellow: {
|
|
606
|
-
card: "bg-yellow-100",
|
|
607
|
-
label: "text-yellow-800",
|
|
608
|
-
value: "text-yellow-900"
|
|
609
|
-
},
|
|
610
|
-
green: {
|
|
611
|
-
card: "bg-green-100",
|
|
612
|
-
label: "text-green-800",
|
|
613
|
-
value: "text-green-900"
|
|
614
|
-
},
|
|
615
|
-
gray: {
|
|
616
|
-
card: "bg-gray-100",
|
|
617
|
-
label: "text-gray-800",
|
|
618
|
-
value: "text-gray-900"
|
|
633
|
+
// core/text/text.styles.ts
|
|
634
|
+
import { tv as tv8 } from "tailwind-variants";
|
|
635
|
+
var text = tv8({
|
|
636
|
+
variants: {
|
|
637
|
+
variant: {
|
|
638
|
+
body: "text-base",
|
|
639
|
+
caption: "text-sm",
|
|
640
|
+
display: "text-3xl font-bold"
|
|
641
|
+
}
|
|
619
642
|
},
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
label: "text-orange-800",
|
|
623
|
-
value: "text-orange-900"
|
|
643
|
+
defaultVariants: {
|
|
644
|
+
variant: "body"
|
|
624
645
|
}
|
|
646
|
+
});
|
|
647
|
+
|
|
648
|
+
// core/text/text.tsx
|
|
649
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
650
|
+
var Text = ({
|
|
651
|
+
children,
|
|
652
|
+
as: Tag2 = "p",
|
|
653
|
+
variant = "body"
|
|
654
|
+
}) => {
|
|
655
|
+
return /* @__PURE__ */ jsx12(Tag2, { "data-testid": "text", className: text({ variant }), children });
|
|
625
656
|
};
|
|
657
|
+
|
|
658
|
+
// core/stats-card/stats-card.styles.ts
|
|
659
|
+
import { tv as tv9 } from "tailwind-variants";
|
|
660
|
+
var statsCard = tv9({
|
|
661
|
+
base: "p-4 rounded-lg",
|
|
662
|
+
variants: {
|
|
663
|
+
color: {
|
|
664
|
+
blue: "bg-blue-100 text-blue-900",
|
|
665
|
+
red: "bg-red-100 text-red-900",
|
|
666
|
+
yellow: "bg-yellow-100 text-yellow-900",
|
|
667
|
+
green: "bg-green-100 text-green-900",
|
|
668
|
+
gray: "bg-gray-100 text-gray-900",
|
|
669
|
+
orange: "bg-orange-100 text-orange-900"
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
});
|
|
673
|
+
|
|
674
|
+
// core/stats-card/stats-card.tsx
|
|
675
|
+
import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
626
676
|
var StatsCard = ({ label: label5, value, color }) => {
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
/* @__PURE__ */
|
|
630
|
-
/* @__PURE__ */ jsx12("p", { className: `text-3xl font-bold ${styles.value}`, children: value })
|
|
677
|
+
return /* @__PURE__ */ jsxs10("div", { "data-testid": "stats-card", className: statsCard({ color }), children: [
|
|
678
|
+
/* @__PURE__ */ jsx13(Text, { variant: "caption", children: label5 }),
|
|
679
|
+
/* @__PURE__ */ jsx13(Text, { variant: "display", children: value })
|
|
631
680
|
] });
|
|
632
681
|
};
|
|
633
682
|
|
|
@@ -635,11 +684,11 @@ var StatsCard = ({ label: label5, value, color }) => {
|
|
|
635
684
|
import * as Dialog from "@radix-ui/react-dialog";
|
|
636
685
|
|
|
637
686
|
// core/modal/modal.styles.ts
|
|
638
|
-
import { tv as
|
|
639
|
-
var overlay =
|
|
687
|
+
import { tv as tv10 } from "tailwind-variants";
|
|
688
|
+
var overlay = tv10({
|
|
640
689
|
base: "fixed inset-0 bg-black/50"
|
|
641
690
|
});
|
|
642
|
-
var content =
|
|
691
|
+
var content = tv10({
|
|
643
692
|
base: "fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-white rounded-lg shadow-lg p-6 w-full focus:outline-none max-h-[90vh] overflow-y-auto",
|
|
644
693
|
variants: {
|
|
645
694
|
size: {
|
|
@@ -654,21 +703,21 @@ var content = tv8({
|
|
|
654
703
|
size: "md"
|
|
655
704
|
}
|
|
656
705
|
});
|
|
657
|
-
var header =
|
|
706
|
+
var header = tv10({
|
|
658
707
|
base: "flex items-start justify-between"
|
|
659
708
|
});
|
|
660
|
-
var title =
|
|
709
|
+
var title = tv10({
|
|
661
710
|
base: "text-lg font-semibold text-gray-900 m-0"
|
|
662
711
|
});
|
|
663
|
-
var description =
|
|
712
|
+
var description = tv10({
|
|
664
713
|
base: "text-sm text-gray-600 mt-2"
|
|
665
714
|
});
|
|
666
|
-
var body =
|
|
715
|
+
var body = tv10({
|
|
667
716
|
base: "mt-4"
|
|
668
717
|
});
|
|
669
718
|
|
|
670
719
|
// core/modal/modal.tsx
|
|
671
|
-
import { jsx as
|
|
720
|
+
import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
672
721
|
var Modal = ({
|
|
673
722
|
open,
|
|
674
723
|
onClose,
|
|
@@ -677,8 +726,8 @@ var Modal = ({
|
|
|
677
726
|
children,
|
|
678
727
|
size = "md"
|
|
679
728
|
}) => {
|
|
680
|
-
return /* @__PURE__ */
|
|
681
|
-
/* @__PURE__ */
|
|
729
|
+
return /* @__PURE__ */ jsx14(Dialog.Root, { open, onOpenChange: (isOpen) => !isOpen && onClose(), children: /* @__PURE__ */ jsxs11(Dialog.Portal, { children: [
|
|
730
|
+
/* @__PURE__ */ jsx14(Dialog.Overlay, { className: overlay() }),
|
|
682
731
|
/* @__PURE__ */ jsxs11(
|
|
683
732
|
Dialog.Content,
|
|
684
733
|
{
|
|
@@ -686,19 +735,24 @@ var Modal = ({
|
|
|
686
735
|
...!description2 && { "aria-describedby": void 0 },
|
|
687
736
|
children: [
|
|
688
737
|
/* @__PURE__ */ jsxs11("div", { className: header(), children: [
|
|
689
|
-
/* @__PURE__ */
|
|
690
|
-
/* @__PURE__ */
|
|
738
|
+
/* @__PURE__ */ jsx14(Dialog.Title, { className: title(), children: title2 }),
|
|
739
|
+
/* @__PURE__ */ jsx14(Button, { icon: "X", "aria-label": "Close", onClick: onClose })
|
|
691
740
|
] }),
|
|
692
|
-
description2 && /* @__PURE__ */
|
|
693
|
-
children && /* @__PURE__ */
|
|
741
|
+
description2 && /* @__PURE__ */ jsx14(Dialog.Description, { className: description(), children: description2 }),
|
|
742
|
+
children && /* @__PURE__ */ jsx14("div", { className: body(), children })
|
|
694
743
|
]
|
|
695
744
|
}
|
|
696
745
|
)
|
|
697
746
|
] }) });
|
|
698
747
|
};
|
|
699
748
|
|
|
749
|
+
// core/whatsapp-button/whatsapp-button.const.ts
|
|
750
|
+
var whatsappWebUrl = "https://wa.me";
|
|
751
|
+
var whatsappBusinessUrl = "whatsapp-business://send";
|
|
752
|
+
var whatsappMobileUserAgent = /Android|iPhone|iPad|iPod/i;
|
|
753
|
+
|
|
700
754
|
// core/whatsapp-button/whatsapp-button.tsx
|
|
701
|
-
import { jsx as
|
|
755
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
702
756
|
var WhatsAppButton = ({
|
|
703
757
|
phone,
|
|
704
758
|
message,
|
|
@@ -707,23 +761,23 @@ var WhatsAppButton = ({
|
|
|
707
761
|
}) => {
|
|
708
762
|
const handleClick = () => {
|
|
709
763
|
const userAgent = navigator?.userAgent ?? "";
|
|
710
|
-
const isMobile =
|
|
764
|
+
const isMobile = whatsappMobileUserAgent.test(userAgent);
|
|
711
765
|
const hasMessage = Boolean(message);
|
|
712
766
|
const encodedMessage = hasMessage ? encodeURIComponent(message) : "";
|
|
713
|
-
const
|
|
714
|
-
const
|
|
767
|
+
const webUrl = hasMessage ? `${whatsappWebUrl}/${phone}?text=${encodedMessage}` : `${whatsappWebUrl}/${phone}`;
|
|
768
|
+
const businessUrl = hasMessage ? `${whatsappBusinessUrl}?phone=${phone}&text=${encodedMessage}` : `${whatsappBusinessUrl}?phone=${phone}`;
|
|
715
769
|
if (isMobile) {
|
|
716
770
|
if (window.location?.assign) {
|
|
717
|
-
window.location.assign(
|
|
771
|
+
window.location.assign(businessUrl);
|
|
718
772
|
} else {
|
|
719
|
-
window.location.href =
|
|
773
|
+
window.location.href = businessUrl;
|
|
720
774
|
}
|
|
721
775
|
} else {
|
|
722
|
-
window.open(
|
|
776
|
+
window.open(webUrl, "_blank");
|
|
723
777
|
}
|
|
724
778
|
onClick?.();
|
|
725
779
|
};
|
|
726
|
-
return /* @__PURE__ */
|
|
780
|
+
return /* @__PURE__ */ jsx15(Button, { color: "success", icon: "SiWhatsapp", onClick: handleClick, children });
|
|
727
781
|
};
|
|
728
782
|
|
|
729
783
|
// core/heading/heading.const.ts
|
|
@@ -737,8 +791,8 @@ var headingTags = {
|
|
|
737
791
|
};
|
|
738
792
|
|
|
739
793
|
// core/heading/heading.styles.ts
|
|
740
|
-
import { tv as
|
|
741
|
-
var heading =
|
|
794
|
+
import { tv as tv11 } from "tailwind-variants";
|
|
795
|
+
var heading = tv11({
|
|
742
796
|
variants: {
|
|
743
797
|
level: {
|
|
744
798
|
1: "text-3xl font-bold",
|
|
@@ -763,35 +817,10 @@ var heading = tv9({
|
|
|
763
817
|
});
|
|
764
818
|
|
|
765
819
|
// core/heading/heading.tsx
|
|
766
|
-
import { jsx as
|
|
820
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
767
821
|
var Heading = ({ children, level = 1, color }) => {
|
|
768
822
|
const Tag2 = headingTags[level];
|
|
769
|
-
return /* @__PURE__ */
|
|
770
|
-
};
|
|
771
|
-
|
|
772
|
-
// core/text/text.styles.ts
|
|
773
|
-
import { tv as tv10 } from "tailwind-variants";
|
|
774
|
-
var text = tv10({
|
|
775
|
-
variants: {
|
|
776
|
-
variant: {
|
|
777
|
-
body: "text-base",
|
|
778
|
-
caption: "text-sm",
|
|
779
|
-
display: "text-3xl font-bold"
|
|
780
|
-
}
|
|
781
|
-
},
|
|
782
|
-
defaultVariants: {
|
|
783
|
-
variant: "body"
|
|
784
|
-
}
|
|
785
|
-
});
|
|
786
|
-
|
|
787
|
-
// core/text/text.tsx
|
|
788
|
-
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
789
|
-
var Text = ({
|
|
790
|
-
children,
|
|
791
|
-
as: Tag2 = "p",
|
|
792
|
-
variant = "body"
|
|
793
|
-
}) => {
|
|
794
|
-
return /* @__PURE__ */ jsx16(Tag2, { "data-testid": "text", className: text({ variant }), children });
|
|
823
|
+
return /* @__PURE__ */ jsx16(Tag2, { className: heading({ level, color }), children });
|
|
795
824
|
};
|
|
796
825
|
|
|
797
826
|
// core/sidebar/sidebar.tsx
|
|
@@ -799,8 +828,8 @@ import { useState as useState3 } from "react";
|
|
|
799
828
|
import Link from "next/link";
|
|
800
829
|
|
|
801
830
|
// core/sidebar/sidebar.styles.ts
|
|
802
|
-
import { tv as
|
|
803
|
-
var sidebar =
|
|
831
|
+
import { tv as tv12 } from "tailwind-variants";
|
|
832
|
+
var sidebar = tv12({
|
|
804
833
|
base: "h-screen bg-neutral-800 text-neutral-300 flex flex-col overflow-hidden transition-all duration-200",
|
|
805
834
|
variants: {
|
|
806
835
|
collapsed: {
|
|
@@ -812,16 +841,16 @@ var sidebar = tv11({
|
|
|
812
841
|
collapsed: false
|
|
813
842
|
}
|
|
814
843
|
});
|
|
815
|
-
var nav =
|
|
844
|
+
var nav = tv12({
|
|
816
845
|
base: "flex-1 min-h-0 overflow-y-auto overflow-x-hidden"
|
|
817
846
|
});
|
|
818
|
-
var header2 =
|
|
847
|
+
var header2 = tv12({
|
|
819
848
|
base: "shrink-0 border-b border-neutral-600/50 grid p-2"
|
|
820
849
|
});
|
|
821
|
-
var section =
|
|
850
|
+
var section = tv12({
|
|
822
851
|
base: "border-b border-neutral-600/50 last:border-b-0 grid gap-1 p-2"
|
|
823
852
|
});
|
|
824
|
-
var item =
|
|
853
|
+
var item = tv12({
|
|
825
854
|
base: "flex w-full items-center rounded-md text-sm whitespace-nowrap transition-colors cursor-pointer p-1",
|
|
826
855
|
variants: {
|
|
827
856
|
active: {
|
|
@@ -833,10 +862,10 @@ var item = tv11({
|
|
|
833
862
|
active: false
|
|
834
863
|
}
|
|
835
864
|
});
|
|
836
|
-
var itemIcon =
|
|
865
|
+
var itemIcon = tv12({
|
|
837
866
|
base: "p-2"
|
|
838
867
|
});
|
|
839
|
-
var itemLabel =
|
|
868
|
+
var itemLabel = tv12({
|
|
840
869
|
base: "truncate transition-all duration-200",
|
|
841
870
|
variants: {
|
|
842
871
|
collapsed: {
|
|
@@ -848,22 +877,22 @@ var itemLabel = tv11({
|
|
|
848
877
|
collapsed: false
|
|
849
878
|
}
|
|
850
879
|
});
|
|
851
|
-
var footer =
|
|
880
|
+
var footer = tv12({
|
|
852
881
|
base: "shrink-0 border-t border-neutral-600/50 p-3 flex items-center gap-3 whitespace-nowrap"
|
|
853
882
|
});
|
|
854
|
-
var avatar =
|
|
883
|
+
var avatar = tv12({
|
|
855
884
|
base: "shrink-0 w-8 h-8 rounded-full bg-neutral-600 text-white text-xs font-medium flex items-center justify-center"
|
|
856
885
|
});
|
|
857
|
-
var userInfo =
|
|
886
|
+
var userInfo = tv12({
|
|
858
887
|
base: "flex flex-col min-w-0"
|
|
859
888
|
});
|
|
860
|
-
var userName =
|
|
889
|
+
var userName = tv12({
|
|
861
890
|
base: "text-sm text-white truncate"
|
|
862
891
|
});
|
|
863
|
-
var userEmail =
|
|
892
|
+
var userEmail = tv12({
|
|
864
893
|
base: "text-xs text-neutral-400"
|
|
865
894
|
});
|
|
866
|
-
var toggleButton =
|
|
895
|
+
var toggleButton = tv12({
|
|
867
896
|
base: "shrink-0 border-t border-neutral-600/50 grid p-2 [&>button]:justify-start [&>button]:overflow-hidden [&>button]:whitespace-nowrap"
|
|
868
897
|
});
|
|
869
898
|
|
|
@@ -926,7 +955,7 @@ var Sidebar = ({
|
|
|
926
955
|
/* @__PURE__ */ jsx17(
|
|
927
956
|
Button,
|
|
928
957
|
{
|
|
929
|
-
|
|
958
|
+
color: "ghost",
|
|
930
959
|
icon: "LogOut",
|
|
931
960
|
"aria-label": "Logout",
|
|
932
961
|
onClick: onLogout
|
|
@@ -936,7 +965,7 @@ var Sidebar = ({
|
|
|
936
965
|
/* @__PURE__ */ jsx17("div", { className: toggleButton(), children: /* @__PURE__ */ jsx17(
|
|
937
966
|
Button,
|
|
938
967
|
{
|
|
939
|
-
|
|
968
|
+
color: "ghost",
|
|
940
969
|
icon: collapsed ? "ChevronRight" : "ChevronLeft",
|
|
941
970
|
"aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
942
971
|
onClick: () => setCollapsed(!collapsed),
|
|
@@ -1223,22 +1252,26 @@ var ConnectedModal = ({
|
|
|
1223
1252
|
);
|
|
1224
1253
|
};
|
|
1225
1254
|
|
|
1226
|
-
// core/spinner/spinner.
|
|
1227
|
-
|
|
1255
|
+
// core/spinner/spinner.const.ts
|
|
1256
|
+
var spinnerIcons = {
|
|
1257
|
+
circle: "LoaderCircle",
|
|
1258
|
+
dots: "Loader",
|
|
1259
|
+
refresh: "RefreshCw"
|
|
1260
|
+
};
|
|
1228
1261
|
|
|
1229
1262
|
// core/spinner/spinner.styles.ts
|
|
1230
|
-
import { tv as
|
|
1231
|
-
var spinner =
|
|
1232
|
-
base: "animate-spin
|
|
1263
|
+
import { tv as tv13 } from "tailwind-variants";
|
|
1264
|
+
var spinner = tv13({
|
|
1265
|
+
base: "inline-flex animate-spin text-white"
|
|
1233
1266
|
});
|
|
1234
1267
|
|
|
1235
1268
|
// core/spinner/spinner.tsx
|
|
1236
1269
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1237
|
-
var Spinner = ({
|
|
1270
|
+
var Spinner = ({ variant = "circle", size = "md" }) => /* @__PURE__ */ jsx22("span", { "data-testid": "spinner", className: spinner(), children: /* @__PURE__ */ jsx22(Icon, { name: spinnerIcons[variant], size }) });
|
|
1238
1271
|
|
|
1239
1272
|
// core/loader/loader.styles.ts
|
|
1240
|
-
import { tv as
|
|
1241
|
-
var overlay2 =
|
|
1273
|
+
import { tv as tv14 } from "tailwind-variants";
|
|
1274
|
+
var overlay2 = tv14({
|
|
1242
1275
|
base: "flex fixed justify-center items-center w-full h-full bg-black/20 z-50"
|
|
1243
1276
|
});
|
|
1244
1277
|
|
|
@@ -1247,7 +1280,7 @@ import { jsx as jsx23 } from "react/jsx-runtime";
|
|
|
1247
1280
|
var Loader = ({ label: label5 = "Loading" }) => {
|
|
1248
1281
|
const fetching = useAppStore((s) => s.fetching);
|
|
1249
1282
|
if (!fetching) return null;
|
|
1250
|
-
return /* @__PURE__ */ jsx23("div", { role: "status", "aria-label": label5, className: overlay2(), children: /* @__PURE__ */ jsx23(Spinner, {}) });
|
|
1283
|
+
return /* @__PURE__ */ jsx23("div", { role: "status", "aria-label": label5, className: overlay2(), children: /* @__PURE__ */ jsx23(Spinner, { size: "lg" }) });
|
|
1251
1284
|
};
|
|
1252
1285
|
|
|
1253
1286
|
// core/app-wrapper/app-wrapper.tsx
|