kaleido-ui 0.1.2 → 0.1.3
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/css/kaleido-ui.css +238 -72
- package/dist/native/index.cjs +8 -2
- package/dist/native/index.d.cts +7 -2
- package/dist/native/index.d.ts +7 -2
- package/dist/native/index.js +8 -2
- package/dist/tokens/index.cjs +85 -2
- package/dist/tokens/index.d.cts +124 -3
- package/dist/tokens/index.d.ts +124 -3
- package/dist/tokens/index.js +82 -2
- package/dist/web/index.cjs +112 -103
- package/dist/web/index.d.cts +16 -12
- package/dist/web/index.d.ts +16 -12
- package/dist/web/index.js +110 -101
- package/package.json +6 -10
- package/dist/tailwind/index.cjs +0 -225
- package/dist/tailwind/index.d.cts +0 -162
- package/dist/tailwind/index.d.ts +0 -162
- package/dist/tailwind/index.js +0 -202
- package/tailwind/index.d.ts +0 -1
- package/tailwind/index.js +0 -1
package/dist/web/index.js
CHANGED
|
@@ -17,28 +17,30 @@ var buttonVariants = cva(
|
|
|
17
17
|
{
|
|
18
18
|
variants: {
|
|
19
19
|
variant: {
|
|
20
|
-
default: "bg-primary text-primary-foreground hover:
|
|
21
|
-
destructive: "bg-destructive text-destructive-foreground hover:
|
|
22
|
-
outline: "border border-
|
|
20
|
+
default: "bg-primary text-primary-foreground hover:brightness-115",
|
|
21
|
+
destructive: "bg-destructive text-destructive-foreground hover:brightness-115",
|
|
22
|
+
outline: "border border-primary/50 bg-transparent text-[#31ff8b] hover:bg-primary/5 hover:border-primary hover:brightness-115",
|
|
23
23
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
24
|
-
ghost: "hover:bg-
|
|
24
|
+
ghost: "text-[#31ff8b] hover:brightness-115 hover:bg-transparent hover:[&_span]:brightness-115",
|
|
25
25
|
link: "text-primary underline-offset-4 hover:underline",
|
|
26
26
|
glow: "bg-primary text-primary-foreground shadow-md",
|
|
27
|
-
surface: "bg-
|
|
28
|
-
cta: "w-full bg-primary
|
|
27
|
+
surface: "bg-primary/15 text-[#31ff8b] hover:bg-primary/25",
|
|
28
|
+
cta: "w-full bg-primary text-primary-foreground font-bold rounded-2xl shadow-md hover:brightness-115 disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none",
|
|
29
29
|
"cta-gradient": "w-full bg-gradient-to-r from-primary to-primary/80 text-primary-foreground font-extrabold rounded-2xl shadow-lg hover:opacity-90 hover:-translate-y-0.5 active:translate-y-0 active:opacity-100 disabled:opacity-40 disabled:shadow-none disabled:cursor-not-allowed disabled:bg-accent disabled:text-muted-foreground",
|
|
30
|
-
"danger-subtle": "
|
|
30
|
+
"danger-subtle": "bg-red-500/10 border border-red-500/20 text-destructive font-bold rounded-xl hover:brightness-115",
|
|
31
|
+
hyperlink: "group text-muted-foreground underline underline-offset-2 hover:text-white hover:decoration-[#31ff8b] hover:[&_.icon]:text-[#31ff8b] bg-transparent font-normal"
|
|
31
32
|
},
|
|
32
33
|
size: {
|
|
33
34
|
default: "h-11 px-5 py-2",
|
|
35
|
+
xs: "h-7 rounded-lg px-2 text-xs",
|
|
34
36
|
sm: "h-9 rounded-lg px-3 text-xs",
|
|
35
37
|
lg: "h-14 rounded-xl px-8 text-base font-bold",
|
|
36
38
|
xl: "h-16 rounded-2xl px-10 text-lg font-bold",
|
|
37
39
|
cta: "h-14 py-4 px-6 text-lg",
|
|
38
40
|
"cta-lg": "h-[60px] py-5 px-6 text-lg",
|
|
39
|
-
icon: "h-
|
|
40
|
-
"icon-lg": "h-
|
|
41
|
-
"icon-xl": "h-
|
|
41
|
+
icon: "h-6 w-6 rounded-full",
|
|
42
|
+
"icon-lg": "h-9 w-9 rounded-full",
|
|
43
|
+
"icon-xl": "h-12 w-12 rounded-full"
|
|
42
44
|
}
|
|
43
45
|
},
|
|
44
46
|
defaultVariants: {
|
|
@@ -71,7 +73,7 @@ var Card = React2.forwardRef(
|
|
|
71
73
|
{
|
|
72
74
|
ref,
|
|
73
75
|
className: cn(
|
|
74
|
-
"rounded-2xl
|
|
76
|
+
"rounded-2xl bg-card text-card-foreground shadow-sm transition-colors",
|
|
75
77
|
className
|
|
76
78
|
),
|
|
77
79
|
...props
|
|
@@ -117,7 +119,7 @@ var Input = React3.forwardRef(
|
|
|
117
119
|
{
|
|
118
120
|
type,
|
|
119
121
|
className: cn(
|
|
120
|
-
"flex h-12 w-full rounded-xl
|
|
122
|
+
"flex h-12 w-full rounded-xl bg-white/8 px-4 py-3 text-base transition-all border border-transparent file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary/50 disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-white/6",
|
|
121
123
|
className
|
|
122
124
|
),
|
|
123
125
|
ref,
|
|
@@ -251,13 +253,13 @@ var DialogContent = React4.forwardRef(({ className, children, ...props }, ref) =
|
|
|
251
253
|
{
|
|
252
254
|
ref,
|
|
253
255
|
className: cn(
|
|
254
|
-
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4
|
|
256
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 bg-card p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-2xl",
|
|
255
257
|
className
|
|
256
258
|
),
|
|
257
259
|
...props,
|
|
258
260
|
children: [
|
|
259
261
|
children,
|
|
260
|
-
/* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none
|
|
262
|
+
/* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
|
|
261
263
|
/* @__PURE__ */ jsx5(Icon, { name: "close", size: "sm" }),
|
|
262
264
|
/* @__PURE__ */ jsx5("span", { className: "sr-only", children: "Close" })
|
|
263
265
|
] })
|
|
@@ -299,7 +301,7 @@ var TabsList = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
299
301
|
{
|
|
300
302
|
ref,
|
|
301
303
|
className: cn(
|
|
302
|
-
"inline-flex h-12 items-center justify-center gap-2 rounded-xl bg-card p-1.5 text-muted-foreground
|
|
304
|
+
"inline-flex h-12 items-center justify-center gap-2 rounded-xl bg-card p-1.5 text-muted-foreground",
|
|
303
305
|
className
|
|
304
306
|
),
|
|
305
307
|
...props
|
|
@@ -312,8 +314,8 @@ var TabsTrigger = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
312
314
|
ref,
|
|
313
315
|
className: cn(
|
|
314
316
|
"inline-flex items-center justify-center whitespace-nowrap rounded-lg px-4 py-2 text-sm font-semibold ring-offset-background transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
315
|
-
"hover:text-
|
|
316
|
-
"data-[state=active]:bg-primary data-[state=active]:text-primary
|
|
317
|
+
"text-white hover:text-primary hover:bg-transparent",
|
|
318
|
+
"data-[state=active]:bg-primary/15 data-[state=active]:text-[#31ff8b] data-[state=active]:hover:bg-primary/25",
|
|
317
319
|
className
|
|
318
320
|
),
|
|
319
321
|
...props
|
|
@@ -370,12 +372,12 @@ var ToastViewport = React7.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
370
372
|
));
|
|
371
373
|
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
|
372
374
|
var toastVariants = cva3(
|
|
373
|
-
"group pointer-events-auto relative flex w-full max-w-md items-center justify-between space-x-3 overflow-hidden rounded-xl
|
|
375
|
+
"group pointer-events-auto relative flex w-full max-w-md items-center justify-between space-x-3 overflow-hidden rounded-xl backdrop-blur-xl p-4 shadow-[0_0_30px_rgba(0,0,0,0.3)] transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-bottom-full data-[state=open]:slide-in-from-bottom-full",
|
|
374
376
|
{
|
|
375
377
|
variants: {
|
|
376
378
|
variant: {
|
|
377
|
-
default: "
|
|
378
|
-
destructive: "
|
|
379
|
+
default: "bg-card text-foreground brightness-125",
|
|
380
|
+
destructive: "bg-red-500/20 text-red-400"
|
|
379
381
|
}
|
|
380
382
|
},
|
|
381
383
|
defaultVariants: {
|
|
@@ -399,7 +401,7 @@ var ToastAction = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
399
401
|
{
|
|
400
402
|
ref,
|
|
401
403
|
className: cn(
|
|
402
|
-
"inline-flex h-8 shrink-0 items-center justify-center rounded-
|
|
404
|
+
"inline-flex h-8 shrink-0 items-center justify-center rounded-lg border border-primary/50 bg-transparent px-3 text-xs font-semibold text-[#31ff8b] transition-all hover:bg-primary/5 hover:border-primary hover:brightness-115 focus:outline-none disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-red-500/30 group-[.destructive]:text-red-400 group-[.destructive]:hover:border-red-500 group-[.destructive]:hover:bg-red-500/10",
|
|
403
405
|
className
|
|
404
406
|
),
|
|
405
407
|
...props
|
|
@@ -411,7 +413,7 @@ var ToastClose = React7.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
411
413
|
{
|
|
412
414
|
ref,
|
|
413
415
|
className: cn(
|
|
414
|
-
"
|
|
416
|
+
"p-1.5 text-muted-foreground opacity-100 transition-all hover:text-white focus:opacity-100 focus:outline-none group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50",
|
|
415
417
|
className
|
|
416
418
|
),
|
|
417
419
|
"toast-close": "",
|
|
@@ -558,7 +560,7 @@ function ToastWithProgress({ id, title, description, action, duration = 4e3, var
|
|
|
558
560
|
if (variant === "destructive") {
|
|
559
561
|
return /* @__PURE__ */ jsx9(Icon, { name: "error", size: "md", className: "text-red-400" });
|
|
560
562
|
}
|
|
561
|
-
return /* @__PURE__ */ jsx9(Icon, { name: "check_circle", size: "md", className: "text-
|
|
563
|
+
return /* @__PURE__ */ jsx9(Icon, { name: "check_circle", size: "md", className: "text-primary" });
|
|
562
564
|
};
|
|
563
565
|
return /* @__PURE__ */ jsxs2(Toast, { ...props, variant, children: [
|
|
564
566
|
/* @__PURE__ */ jsxs2("div", { className: "flex items-start gap-3 flex-1", children: [
|
|
@@ -568,8 +570,10 @@ function ToastWithProgress({ id, title, description, action, duration = 4e3, var
|
|
|
568
570
|
description && /* @__PURE__ */ jsx9(ToastDescription, { children: description })
|
|
569
571
|
] })
|
|
570
572
|
] }),
|
|
571
|
-
|
|
572
|
-
|
|
573
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 shrink-0", children: [
|
|
574
|
+
action,
|
|
575
|
+
/* @__PURE__ */ jsx9(ToastClose, {})
|
|
576
|
+
] }),
|
|
573
577
|
/* @__PURE__ */ jsx9("div", { className: "absolute bottom-0 left-0 right-0 h-1 bg-white/10 overflow-hidden", children: /* @__PURE__ */ jsx9(
|
|
574
578
|
"div",
|
|
575
579
|
{
|
|
@@ -645,7 +649,7 @@ function StatusBadge({ status, className }) {
|
|
|
645
649
|
"div",
|
|
646
650
|
{
|
|
647
651
|
className: cn(
|
|
648
|
-
"inline-flex items-center gap-1.5
|
|
652
|
+
"inline-flex items-center gap-1.5 pl-1 pr-2.5 py-1 rounded-full border font-medium text-xs",
|
|
649
653
|
bg,
|
|
650
654
|
border,
|
|
651
655
|
color,
|
|
@@ -670,65 +674,65 @@ var networkConfig = {
|
|
|
670
674
|
iconSuffix: "bitcoin/bitcoin-logo.svg"
|
|
671
675
|
},
|
|
672
676
|
LN: {
|
|
673
|
-
color: "text-
|
|
674
|
-
bg: "bg-
|
|
675
|
-
border: "border-
|
|
677
|
+
color: "text-network-lightning",
|
|
678
|
+
bg: "bg-network-lightning/10 backdrop-blur-md",
|
|
679
|
+
border: "border-network-lightning/20",
|
|
676
680
|
label: "LN",
|
|
677
681
|
iconSuffix: "lightning/lightning.svg"
|
|
678
682
|
},
|
|
679
683
|
RGB20: {
|
|
680
|
-
color: "text-
|
|
681
|
-
bg: "bg-
|
|
682
|
-
border: "border-
|
|
684
|
+
color: "text-destructive",
|
|
685
|
+
bg: "bg-red-500/20 backdrop-blur-md",
|
|
686
|
+
border: "border-red-500/20",
|
|
683
687
|
label: "RGB",
|
|
684
688
|
iconSuffix: "rgb/rgb-logo.svg"
|
|
685
689
|
},
|
|
686
690
|
RGB21: {
|
|
687
|
-
color: "text-
|
|
688
|
-
bg: "bg-
|
|
689
|
-
border: "border-
|
|
691
|
+
color: "text-destructive",
|
|
692
|
+
bg: "bg-red-500/20 backdrop-blur-md",
|
|
693
|
+
border: "border-red-500/20",
|
|
690
694
|
label: "RGB21",
|
|
691
695
|
iconSuffix: "rgb/rgb-logo.svg"
|
|
692
696
|
},
|
|
693
697
|
"RGB-L1": {
|
|
694
|
-
color: "text-
|
|
695
|
-
bg: "bg-
|
|
696
|
-
border: "border-
|
|
698
|
+
color: "text-destructive",
|
|
699
|
+
bg: "bg-red-500/20 backdrop-blur-md",
|
|
700
|
+
border: "border-red-500/20",
|
|
697
701
|
label: "RGB L1",
|
|
698
702
|
iconSuffix: "rgb/rgb-logo.svg"
|
|
699
703
|
},
|
|
700
704
|
"RGB-LN": {
|
|
701
|
-
color: "text-
|
|
702
|
-
bg: "bg-
|
|
703
|
-
border: "border-
|
|
705
|
+
color: "text-destructive",
|
|
706
|
+
bg: "bg-red-500/20 backdrop-blur-md",
|
|
707
|
+
border: "border-red-500/20",
|
|
704
708
|
label: "RGB LN",
|
|
705
709
|
iconSuffix: "rgb/rgb-logo.svg"
|
|
706
710
|
},
|
|
707
711
|
Spark: {
|
|
708
|
-
color: "text-
|
|
709
|
-
bg: "bg-
|
|
710
|
-
border: "border-
|
|
712
|
+
color: "text-black dark:text-white",
|
|
713
|
+
bg: "bg-black/10 dark:bg-white/10 backdrop-blur-md",
|
|
714
|
+
border: "border-black/20 dark:border-white/20",
|
|
711
715
|
label: "Spark",
|
|
712
716
|
iconSuffix: "spark/Asterisk/Spark Asterisk White.svg"
|
|
713
717
|
},
|
|
714
718
|
Arkade: {
|
|
715
|
-
color: "text-
|
|
716
|
-
bg: "bg-
|
|
717
|
-
border: "border-
|
|
719
|
+
color: "text-violet-400",
|
|
720
|
+
bg: "bg-violet-500/15 backdrop-blur-md",
|
|
721
|
+
border: "border-violet-500/20",
|
|
718
722
|
label: "Arkade",
|
|
719
723
|
iconSuffix: "arkade/arkade-icon.svg"
|
|
720
724
|
}
|
|
721
725
|
};
|
|
722
|
-
function NetworkBadge({ network, iconBasePath = "/icons", className }) {
|
|
723
|
-
const { color, bg,
|
|
726
|
+
function NetworkBadge({ network, iconBasePath = "/icons", iconOnly = false, className }) {
|
|
727
|
+
const { color, bg, label, iconSuffix } = networkConfig[network];
|
|
724
728
|
const icon = `${iconBasePath}/${iconSuffix}`;
|
|
725
729
|
return /* @__PURE__ */ jsxs4(
|
|
726
730
|
"span",
|
|
727
731
|
{
|
|
728
732
|
className: cn(
|
|
729
|
-
"text-
|
|
733
|
+
"text-xs rounded-full font-bold flex items-center justify-center w-max",
|
|
734
|
+
iconOnly ? "p-1.5" : "px-2.5 py-1 gap-1",
|
|
730
735
|
bg,
|
|
731
|
-
border,
|
|
732
736
|
color,
|
|
733
737
|
className
|
|
734
738
|
),
|
|
@@ -738,10 +742,10 @@ function NetworkBadge({ network, iconBasePath = "/icons", className }) {
|
|
|
738
742
|
{
|
|
739
743
|
src: icon,
|
|
740
744
|
alt: network,
|
|
741
|
-
className: cn("size-3 object-contain", network === "Spark" && "
|
|
745
|
+
className: cn(iconOnly ? "size-4" : "size-3.5", "object-contain", network === "Spark" && "brightness-0 dark:brightness-0 dark:invert")
|
|
742
746
|
}
|
|
743
747
|
),
|
|
744
|
-
label
|
|
748
|
+
!iconOnly && label
|
|
745
749
|
]
|
|
746
750
|
}
|
|
747
751
|
);
|
|
@@ -866,6 +870,7 @@ function AssetIcon({ ticker, logoUri, cdnBaseUrl, size = 40, className }) {
|
|
|
866
870
|
}
|
|
867
871
|
|
|
868
872
|
// src/web/components/asset-card.tsx
|
|
873
|
+
import { useState as useState5 } from "react";
|
|
869
874
|
import { jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
870
875
|
function AssetCard({
|
|
871
876
|
ticker,
|
|
@@ -874,19 +879,26 @@ function AssetCard({
|
|
|
874
879
|
networks = [],
|
|
875
880
|
logoUri,
|
|
876
881
|
balanceVisible = true,
|
|
882
|
+
accentColor,
|
|
877
883
|
onClick,
|
|
878
884
|
className
|
|
879
885
|
}) {
|
|
880
886
|
const shown = balanceVisible ? displayBalance : "\u2022\u2022\u2022\u2022\u2022\u2022";
|
|
887
|
+
const [hovered, setHovered] = useState5(false);
|
|
888
|
+
const gradientStyle = accentColor ? { background: `linear-gradient(135deg, var(--card) 30%, ${accentColor}${hovered ? "77" : "55"} 75%, ${accentColor}${hovered ? "dd" : "b3"} 100%)`, transition: "background 0.3s ease" } : void 0;
|
|
881
889
|
return /* @__PURE__ */ jsxs5(
|
|
882
890
|
"div",
|
|
883
891
|
{
|
|
884
892
|
className: cn(
|
|
885
|
-
"p-4 rounded-card
|
|
886
|
-
|
|
893
|
+
"p-4 rounded-card backdrop-blur-xl transition-all shadow-sm relative overflow-hidden group",
|
|
894
|
+
!accentColor && "bg-card",
|
|
895
|
+
onClick && "cursor-pointer hover:brightness-110 active:scale-[0.98]",
|
|
887
896
|
className
|
|
888
897
|
),
|
|
898
|
+
style: gradientStyle,
|
|
889
899
|
onClick,
|
|
900
|
+
onMouseEnter: () => setHovered(true),
|
|
901
|
+
onMouseLeave: () => setHovered(false),
|
|
890
902
|
children: [
|
|
891
903
|
/* @__PURE__ */ jsx13("div", { className: "absolute inset-0 bg-gradient-to-br from-white/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none" }),
|
|
892
904
|
/* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between relative z-10", children: [
|
|
@@ -906,7 +918,7 @@ function AssetCard({
|
|
|
906
918
|
{
|
|
907
919
|
className: cn(
|
|
908
920
|
"font-bold text-base leading-tight tracking-wide text-foreground",
|
|
909
|
-
onClick && "
|
|
921
|
+
onClick && "transition-colors"
|
|
910
922
|
),
|
|
911
923
|
children: name
|
|
912
924
|
}
|
|
@@ -915,7 +927,7 @@ function AssetCard({
|
|
|
915
927
|
] })
|
|
916
928
|
] }),
|
|
917
929
|
/* @__PURE__ */ jsxs5("div", { className: "text-right", children: [
|
|
918
|
-
/* @__PURE__ */ jsx13("p", { className: "font-bold text-
|
|
930
|
+
/* @__PURE__ */ jsx13("p", { className: "font-bold text-lg tracking-tight text-foreground group-hover:opacity-90 transition-colors", children: shown }),
|
|
919
931
|
/* @__PURE__ */ jsx13("p", { className: "text-tiny text-muted-foreground font-medium tracking-wide uppercase mt-0.5", children: ticker })
|
|
920
932
|
] })
|
|
921
933
|
] })
|
|
@@ -937,12 +949,34 @@ function TransactionCard({
|
|
|
937
949
|
}) {
|
|
938
950
|
const isInbound = direction === "inbound";
|
|
939
951
|
const formatDate = (ts) => new Date(ts * 1e3).toLocaleDateString();
|
|
952
|
+
const statusStyle = {
|
|
953
|
+
success: { base: "bg-primary/5", hover: "hover:bg-primary/10" },
|
|
954
|
+
completed: { base: "bg-primary/5", hover: "hover:bg-primary/10" },
|
|
955
|
+
pending: { base: "bg-yellow-500/10", hover: "hover:bg-yellow-500/15" },
|
|
956
|
+
failed: { base: "bg-red-500/10", hover: "hover:bg-red-500/15" },
|
|
957
|
+
error: { base: "bg-red-500/10", hover: "hover:bg-red-500/15" }
|
|
958
|
+
}[status] ?? { base: "bg-background/40", hover: "hover:bg-white/5" };
|
|
959
|
+
const iconStyle = {
|
|
960
|
+
success: "bg-primary/20 text-primary",
|
|
961
|
+
completed: "bg-primary/20 text-primary",
|
|
962
|
+
pending: "bg-yellow-500/20 text-yellow-500",
|
|
963
|
+
failed: "bg-red-500/20 text-red-500",
|
|
964
|
+
error: "bg-red-500/20 text-red-500"
|
|
965
|
+
}[status] ?? "bg-accent text-muted-foreground";
|
|
966
|
+
const textColor = {
|
|
967
|
+
success: "text-primary",
|
|
968
|
+
completed: "text-primary",
|
|
969
|
+
pending: "text-yellow-500",
|
|
970
|
+
failed: "text-red-500",
|
|
971
|
+
error: "text-red-500"
|
|
972
|
+
}[status] ?? "text-foreground";
|
|
940
973
|
return /* @__PURE__ */ jsxs6(
|
|
941
974
|
"div",
|
|
942
975
|
{
|
|
943
976
|
className: cn(
|
|
944
|
-
"p-4 rounded-card
|
|
945
|
-
|
|
977
|
+
"p-4 rounded-card backdrop-blur-xl flex items-center justify-between transition-all shadow-sm relative overflow-hidden group",
|
|
978
|
+
statusStyle.base,
|
|
979
|
+
onClick && `cursor-pointer active:scale-[0.98] ${statusStyle.hover}`,
|
|
946
980
|
className
|
|
947
981
|
),
|
|
948
982
|
onClick,
|
|
@@ -954,24 +988,15 @@ function TransactionCard({
|
|
|
954
988
|
{
|
|
955
989
|
className: cn(
|
|
956
990
|
"size-11 rounded-full flex items-center justify-center shadow-inner group-hover:scale-105 transition-transform",
|
|
957
|
-
|
|
991
|
+
iconStyle
|
|
958
992
|
),
|
|
959
993
|
children: /* @__PURE__ */ jsx14("span", { className: "material-symbols-outlined text-[20px]", children: isInbound ? "arrow_downward" : "arrow_outward" })
|
|
960
994
|
}
|
|
961
995
|
),
|
|
962
996
|
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col", children: [
|
|
963
|
-
/* @__PURE__ */ jsx14(
|
|
964
|
-
"span",
|
|
965
|
-
{
|
|
966
|
-
className: cn(
|
|
967
|
-
"font-bold text-sm text-foreground tracking-wide",
|
|
968
|
-
onClick && "group-hover:text-primary transition-colors"
|
|
969
|
-
),
|
|
970
|
-
children: isInbound ? "Received" : "Sent"
|
|
971
|
-
}
|
|
972
|
-
),
|
|
997
|
+
/* @__PURE__ */ jsx14("span", { className: "font-bold text-sm tracking-wide text-foreground", children: isInbound ? "Received" : "Sent" }),
|
|
973
998
|
/* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-2 mt-1", children: [
|
|
974
|
-
/* @__PURE__ */ jsx14(StatusBadge, { status
|
|
999
|
+
/* @__PURE__ */ jsx14(StatusBadge, { status }),
|
|
975
1000
|
/* @__PURE__ */ jsx14("span", { className: "text-tiny text-muted-foreground font-medium tracking-wide", children: formatDate(timestamp) })
|
|
976
1001
|
] })
|
|
977
1002
|
] })
|
|
@@ -981,8 +1006,8 @@ function TransactionCard({
|
|
|
981
1006
|
"p",
|
|
982
1007
|
{
|
|
983
1008
|
className: cn(
|
|
984
|
-
"font-bold text-
|
|
985
|
-
|
|
1009
|
+
"font-bold text-lg tracking-tight group-hover:opacity-90 transition-opacity",
|
|
1010
|
+
textColor
|
|
986
1011
|
),
|
|
987
1012
|
children: [
|
|
988
1013
|
isInbound ? "+" : "-",
|
|
@@ -1025,15 +1050,15 @@ function SettingItem({
|
|
|
1025
1050
|
onClick,
|
|
1026
1051
|
showChevron = true,
|
|
1027
1052
|
className,
|
|
1028
|
-
iconColor = "text-
|
|
1053
|
+
iconColor = "text-[#31ff8b]"
|
|
1029
1054
|
}) {
|
|
1030
1055
|
const isClickable = !!onClick;
|
|
1031
1056
|
return /* @__PURE__ */ jsx16(
|
|
1032
1057
|
"div",
|
|
1033
1058
|
{
|
|
1034
1059
|
className: cn(
|
|
1035
|
-
"p-5 rounded-2xl bg-card
|
|
1036
|
-
isClickable && "cursor-pointer
|
|
1060
|
+
"p-5 rounded-2xl bg-card transition-all duration-200 group",
|
|
1061
|
+
isClickable && "cursor-pointer active:scale-[0.98]",
|
|
1037
1062
|
className
|
|
1038
1063
|
),
|
|
1039
1064
|
onClick,
|
|
@@ -1043,7 +1068,7 @@ function SettingItem({
|
|
|
1043
1068
|
"div",
|
|
1044
1069
|
{
|
|
1045
1070
|
className: cn(
|
|
1046
|
-
"flex-shrink-0 size-10 rounded-xl flex items-center justify-center bg-
|
|
1071
|
+
"flex-shrink-0 size-10 rounded-xl flex items-center justify-center bg-primary/15 group-hover:bg-primary/25 group-hover:scale-105 transition-all",
|
|
1047
1072
|
iconColor
|
|
1048
1073
|
),
|
|
1049
1074
|
children: iconSrc ? /* @__PURE__ */ jsx16("img", { src: iconSrc, alt: iconAlt ?? title, className: "size-5 object-contain" }) : /* @__PURE__ */ jsx16("span", { className: "material-symbols-outlined text-[20px]", children: icon })
|
|
@@ -1056,7 +1081,7 @@ function SettingItem({
|
|
|
1056
1081
|
] }),
|
|
1057
1082
|
/* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2 flex-shrink-0", children: [
|
|
1058
1083
|
value && /* @__PURE__ */ jsx16("span", { className: "text-xs text-muted-foreground font-mono", children: value }),
|
|
1059
|
-
showChevron && isClickable && /* @__PURE__ */ jsx16("span", { className: "material-symbols-outlined text-[16px] text-muted-foreground", children: "chevron_right" })
|
|
1084
|
+
showChevron && isClickable && /* @__PURE__ */ jsx16("span", { className: "material-symbols-outlined text-[16px] text-muted-foreground group-hover:scale-110 group-hover:text-white transition-all", children: "chevron_right" })
|
|
1060
1085
|
] })
|
|
1061
1086
|
] })
|
|
1062
1087
|
}
|
|
@@ -1078,32 +1103,16 @@ function SectionLabel({ children, className }) {
|
|
|
1078
1103
|
// src/web/components/alert-banner.tsx
|
|
1079
1104
|
import { jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1080
1105
|
var variantStyles = {
|
|
1081
|
-
error: {
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
},
|
|
1086
|
-
warning: {
|
|
1087
|
-
container: "bg-amber-500/10 border-amber-500/20",
|
|
1088
|
-
icon: "text-amber-400",
|
|
1089
|
-
iconName: "warning"
|
|
1090
|
-
},
|
|
1091
|
-
info: {
|
|
1092
|
-
container: "bg-blue-500/10 border-blue-500/20",
|
|
1093
|
-
icon: "text-blue-400",
|
|
1094
|
-
iconName: "info"
|
|
1095
|
-
},
|
|
1096
|
-
success: {
|
|
1097
|
-
container: "bg-primary/10 border-primary/20",
|
|
1098
|
-
icon: "text-primary",
|
|
1099
|
-
iconName: "check_circle"
|
|
1100
|
-
}
|
|
1106
|
+
error: { container: "bg-red-900/40", icon: "text-red-500", iconName: "error" },
|
|
1107
|
+
warning: { container: "bg-yellow-900/40", icon: "text-yellow-400", iconName: "warning" },
|
|
1108
|
+
info: { container: "bg-blue-900/40", icon: "text-blue-300", iconName: "info" },
|
|
1109
|
+
success: { container: "bg-primary/8", icon: "text-primary/90", iconName: "check_circle" }
|
|
1101
1110
|
};
|
|
1102
1111
|
function AlertBanner({ variant = "info", icon, children, className }) {
|
|
1103
1112
|
const styles = variantStyles[variant];
|
|
1104
|
-
return /* @__PURE__ */ jsxs9("div", { className: cn("rounded-xl
|
|
1105
|
-
/* @__PURE__ */ jsx18(Icon, { name: icon ?? styles.iconName, size: "md", className: cn("shrink-0
|
|
1106
|
-
/* @__PURE__ */ jsx18("div", { className: "text-sm", children })
|
|
1113
|
+
return /* @__PURE__ */ jsxs9("div", { className: cn("rounded-xl p-3 flex items-center gap-2", styles.container, className), children: [
|
|
1114
|
+
/* @__PURE__ */ jsx18(Icon, { name: icon ?? styles.iconName, size: "md", className: cn("shrink-0", styles.icon) }),
|
|
1115
|
+
/* @__PURE__ */ jsx18("div", { className: cn("text-sm", styles.icon), children })
|
|
1107
1116
|
] });
|
|
1108
1117
|
}
|
|
1109
1118
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kaleido-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "KaleidoSwap shared UI library — design tokens, web components (Tailwind + Radix), and React Native components extending WDK UI Kit",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -23,24 +23,19 @@
|
|
|
23
23
|
"import": "./dist/native/index.js",
|
|
24
24
|
"require": "./dist/native/index.cjs"
|
|
25
25
|
},
|
|
26
|
-
"./tailwind": {
|
|
27
|
-
"types": "./dist/tailwind/index.d.ts",
|
|
28
|
-
"import": "./dist/tailwind/index.js",
|
|
29
|
-
"require": "./dist/tailwind/index.cjs"
|
|
30
|
-
},
|
|
31
26
|
"./css": "./dist/css/kaleido-ui.css"
|
|
32
27
|
},
|
|
33
28
|
"files": [
|
|
34
29
|
"dist",
|
|
35
30
|
"native",
|
|
36
|
-
"tokens"
|
|
37
|
-
"tailwind"
|
|
31
|
+
"tokens"
|
|
38
32
|
],
|
|
39
33
|
"scripts": {
|
|
40
|
-
"
|
|
34
|
+
"generate:css": "node node_modules/tsx/dist/cli.mjs scripts/generate-css.ts",
|
|
35
|
+
"build": "npm run generate:css && tsup && mkdir -p dist/css && cp src/css/kaleido-ui.css dist/css/kaleido-ui.css",
|
|
41
36
|
"dev": "tsup --watch",
|
|
42
37
|
"showcase": "vite --config showcase/vite.config.ts",
|
|
43
|
-
"showcase:build": "vite build --config showcase/vite.config.ts",
|
|
38
|
+
"showcase:build": "npm run generate:css && vite build --config showcase/vite.config.ts",
|
|
44
39
|
"type-check": "tsc --noEmit",
|
|
45
40
|
"clean": "rm -rf dist"
|
|
46
41
|
},
|
|
@@ -112,6 +107,7 @@
|
|
|
112
107
|
"tailwind-merge": "^2.6.1",
|
|
113
108
|
"tailwindcss": "^4.2.4",
|
|
114
109
|
"tsup": "^8.0.0",
|
|
110
|
+
"tsx": "^4.21.0",
|
|
115
111
|
"typescript": "^5.9.0",
|
|
116
112
|
"vite": "^5.4.11"
|
|
117
113
|
},
|