@onesaz/ui 0.4.0 → 0.4.1
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 +28 -16
- package/dist/index.js +246 -232
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -737,10 +737,10 @@ var colorClasses2 = {
|
|
|
737
737
|
inherit: "",
|
|
738
738
|
primary: "text-accent",
|
|
739
739
|
secondary: "text-muted-foreground",
|
|
740
|
-
success: "text-
|
|
741
|
-
warning: "text-
|
|
742
|
-
error: "text-
|
|
743
|
-
info: "text-
|
|
740
|
+
success: "text-success-600 dark:text-success-400",
|
|
741
|
+
warning: "text-warning-600 dark:text-warning-400",
|
|
742
|
+
error: "text-error-600 dark:text-error-400",
|
|
743
|
+
info: "text-info-600 dark:text-info-400",
|
|
744
744
|
muted: "text-muted-foreground",
|
|
745
745
|
white: "text-white",
|
|
746
746
|
dark: "text-foreground"
|
|
@@ -771,13 +771,13 @@ var verticalAlignClasses = {
|
|
|
771
771
|
baseline: "align-baseline"
|
|
772
772
|
};
|
|
773
773
|
var gradientClasses = {
|
|
774
|
-
primary: "from-
|
|
775
|
-
secondary: "from-slate-
|
|
776
|
-
info: "from-
|
|
777
|
-
success: "from-
|
|
778
|
-
warning: "from-
|
|
779
|
-
error: "from-
|
|
780
|
-
dark: "from-slate-
|
|
774
|
+
primary: "from-violet-400 to-violet-700",
|
|
775
|
+
secondary: "from-slate-400 to-slate-700",
|
|
776
|
+
info: "from-info-400 to-info-700",
|
|
777
|
+
success: "from-success-400 to-success-700",
|
|
778
|
+
warning: "from-warning-400 to-warning-700",
|
|
779
|
+
error: "from-error-400 to-error-700",
|
|
780
|
+
dark: "from-slate-600 to-slate-900"
|
|
781
781
|
};
|
|
782
782
|
var Typography = React5.forwardRef(
|
|
783
783
|
({
|
|
@@ -1834,8 +1834,34 @@ CardFooter.displayName = "CardFooter";
|
|
|
1834
1834
|
// src/components/badge.tsx
|
|
1835
1835
|
import * as React19 from "react";
|
|
1836
1836
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1837
|
+
var containedClasses = {
|
|
1838
|
+
default: "bg-accent text-accent-foreground",
|
|
1839
|
+
success: "bg-success-500 text-white dark:bg-success-600",
|
|
1840
|
+
warning: "bg-warning-500 text-white dark:bg-warning-600",
|
|
1841
|
+
error: "bg-error-500 text-white dark:bg-error-600",
|
|
1842
|
+
destructive: "bg-destructive text-destructive-foreground"
|
|
1843
|
+
};
|
|
1844
|
+
var outlinedClasses = {
|
|
1845
|
+
default: "border border-accent text-accent",
|
|
1846
|
+
success: "border border-success-500 text-success-600 dark:text-success-400",
|
|
1847
|
+
warning: "border border-warning-500 text-warning-600 dark:text-warning-400",
|
|
1848
|
+
error: "border border-error-500 text-error-600 dark:text-error-400",
|
|
1849
|
+
destructive: "border border-destructive text-destructive"
|
|
1850
|
+
};
|
|
1851
|
+
var textClasses = {
|
|
1852
|
+
default: "text-accent",
|
|
1853
|
+
success: "text-success-600 dark:text-success-400",
|
|
1854
|
+
warning: "text-warning-600 dark:text-warning-400",
|
|
1855
|
+
error: "text-error-600 dark:text-error-400",
|
|
1856
|
+
destructive: "text-destructive"
|
|
1857
|
+
};
|
|
1858
|
+
var variantMap = {
|
|
1859
|
+
contained: containedClasses,
|
|
1860
|
+
outlined: outlinedClasses,
|
|
1861
|
+
text: textClasses
|
|
1862
|
+
};
|
|
1837
1863
|
var Badge = React19.forwardRef(
|
|
1838
|
-
({ className,
|
|
1864
|
+
({ className, color = "default", variant = "contained", ...props }, ref) => {
|
|
1839
1865
|
return /* @__PURE__ */ jsx19(
|
|
1840
1866
|
"div",
|
|
1841
1867
|
{
|
|
@@ -1843,15 +1869,7 @@ var Badge = React19.forwardRef(
|
|
|
1843
1869
|
className: cn(
|
|
1844
1870
|
"inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors",
|
|
1845
1871
|
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
1846
|
-
|
|
1847
|
-
"border-transparent bg-accent text-accent-foreground": variant === "default",
|
|
1848
|
-
"border-transparent bg-muted text-foreground": variant === "secondary",
|
|
1849
|
-
"border-transparent bg-destructive text-destructive-foreground": variant === "destructive",
|
|
1850
|
-
"border border-border text-foreground": variant === "outline",
|
|
1851
|
-
"border border-green-300 bg-green-100 text-green-800": variant === "success",
|
|
1852
|
-
"border border-yellow-300 bg-yellow-100 text-yellow-800": variant === "warning",
|
|
1853
|
-
"border border-blue-300 bg-blue-100 text-blue-800": variant === "info"
|
|
1854
|
-
},
|
|
1872
|
+
(variantMap[variant] ?? variantMap.contained)[color] ?? "",
|
|
1855
1873
|
className
|
|
1856
1874
|
),
|
|
1857
1875
|
...props
|
|
@@ -1864,28 +1882,51 @@ Badge.displayName = "Badge";
|
|
|
1864
1882
|
// src/components/chip.tsx
|
|
1865
1883
|
import * as React20 from "react";
|
|
1866
1884
|
import { jsx as jsx20, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1867
|
-
var
|
|
1868
|
-
default: "bg-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1885
|
+
var filledClasses = {
|
|
1886
|
+
default: "bg-accent text-accent-foreground",
|
|
1887
|
+
success: "bg-success-500 text-white dark:bg-success-600",
|
|
1888
|
+
warning: "bg-warning-500 text-white dark:bg-warning-600",
|
|
1889
|
+
error: "bg-error-500 text-white dark:bg-error-600",
|
|
1890
|
+
destructive: "bg-destructive text-destructive-foreground"
|
|
1891
|
+
};
|
|
1892
|
+
var filledHoverClasses = {
|
|
1893
|
+
default: "hover:bg-accent-hover",
|
|
1894
|
+
success: "hover:bg-success-600 dark:hover:bg-success-500",
|
|
1895
|
+
warning: "hover:bg-warning-600 dark:hover:bg-warning-500",
|
|
1896
|
+
error: "hover:bg-error-600 dark:hover:bg-error-500",
|
|
1897
|
+
destructive: "hover:bg-destructive/90"
|
|
1875
1898
|
};
|
|
1876
|
-
var
|
|
1877
|
-
default: "border-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1899
|
+
var outlinedClasses2 = {
|
|
1900
|
+
default: "border-accent text-accent",
|
|
1901
|
+
success: "border-success-500 text-success-600 dark:border-success-400 dark:text-success-400",
|
|
1902
|
+
warning: "border-warning-500 text-warning-600 dark:border-warning-400 dark:text-warning-400",
|
|
1903
|
+
error: "border-error-500 text-error-600 dark:border-error-400 dark:text-error-400",
|
|
1904
|
+
destructive: "border-destructive text-destructive"
|
|
1905
|
+
};
|
|
1906
|
+
var outlinedHoverClasses = {
|
|
1907
|
+
default: "hover:bg-accent/10",
|
|
1908
|
+
success: "hover:bg-success-500/10",
|
|
1909
|
+
warning: "hover:bg-warning-500/10",
|
|
1910
|
+
error: "hover:bg-error-500/10",
|
|
1911
|
+
destructive: "hover:bg-destructive/10"
|
|
1884
1912
|
};
|
|
1885
1913
|
var sizeClasses3 = {
|
|
1886
|
-
small: "h-6 text-xs px-2",
|
|
1887
|
-
medium: "h-8 text-sm px-3"
|
|
1914
|
+
small: "h-6 text-xs px-2 gap-1",
|
|
1915
|
+
medium: "h-8 text-sm px-3 gap-1.5"
|
|
1916
|
+
};
|
|
1917
|
+
var iconSizeClasses = {
|
|
1918
|
+
small: "[&>svg]:h-3 [&>svg]:w-3",
|
|
1919
|
+
medium: "[&>svg]:h-4 [&>svg]:w-4"
|
|
1920
|
+
};
|
|
1921
|
+
var avatarSizeClasses = {
|
|
1922
|
+
small: "[&>*]:h-4 [&>*]:w-4",
|
|
1923
|
+
medium: "[&>*]:h-5 [&>*]:w-5"
|
|
1924
|
+
};
|
|
1925
|
+
var deleteBtnSizeClasses = {
|
|
1926
|
+
small: "h-3.5 w-3.5",
|
|
1927
|
+
medium: "h-4 w-4"
|
|
1888
1928
|
};
|
|
1929
|
+
var DefaultDeleteIcon = ({ size }) => /* @__PURE__ */ jsx20("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: deleteBtnSizeClasses[size], children: /* @__PURE__ */ jsx20("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" }) });
|
|
1889
1930
|
var Chip = React20.forwardRef(
|
|
1890
1931
|
({
|
|
1891
1932
|
className,
|
|
@@ -1899,58 +1940,74 @@ var Chip = React20.forwardRef(
|
|
|
1899
1940
|
deleteIcon,
|
|
1900
1941
|
clickable = false,
|
|
1901
1942
|
disabled = false,
|
|
1943
|
+
href,
|
|
1944
|
+
component,
|
|
1902
1945
|
children,
|
|
1903
1946
|
onClick,
|
|
1947
|
+
onKeyDown,
|
|
1904
1948
|
...props
|
|
1905
1949
|
}, ref) => {
|
|
1906
|
-
const isClickable = clickable || !!onClick;
|
|
1907
1950
|
const content = label ?? children;
|
|
1951
|
+
const isClickable = clickable || !!onClick || !!href;
|
|
1952
|
+
const Component = component ?? (href ? "a" : "div");
|
|
1953
|
+
const colorClass = variant === "filled" ? filledClasses[color] ?? filledClasses.default : outlinedClasses2[color] ?? outlinedClasses2.default;
|
|
1954
|
+
const hoverClass = isClickable && !disabled ? variant === "filled" ? filledHoverClasses[color] ?? filledHoverClasses.default : outlinedHoverClasses[color] ?? outlinedHoverClasses.default : "";
|
|
1955
|
+
const handleKeyDown = (e) => {
|
|
1956
|
+
if (!disabled) {
|
|
1957
|
+
if (isClickable && (e.key === "Enter" || e.key === " ")) {
|
|
1958
|
+
e.preventDefault();
|
|
1959
|
+
e.currentTarget.click();
|
|
1960
|
+
}
|
|
1961
|
+
if (onDelete && (e.key === "Delete" || e.key === "Backspace")) {
|
|
1962
|
+
e.preventDefault();
|
|
1963
|
+
onDelete(e);
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
onKeyDown?.(e);
|
|
1967
|
+
};
|
|
1908
1968
|
return /* @__PURE__ */ jsxs9(
|
|
1909
|
-
|
|
1969
|
+
Component,
|
|
1910
1970
|
{
|
|
1911
1971
|
ref,
|
|
1972
|
+
href,
|
|
1912
1973
|
role: isClickable ? "button" : void 0,
|
|
1913
|
-
tabIndex: isClickable && !disabled ? 0 : void 0,
|
|
1974
|
+
tabIndex: isClickable && !disabled ? 0 : onDelete && !disabled ? 0 : void 0,
|
|
1975
|
+
"aria-disabled": disabled || void 0,
|
|
1914
1976
|
onClick: disabled ? void 0 : onClick,
|
|
1977
|
+
onKeyDown: handleKeyDown,
|
|
1915
1978
|
className: cn(
|
|
1916
|
-
"inline-flex items-center rounded-full font-medium transition-colors",
|
|
1917
|
-
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1",
|
|
1979
|
+
"inline-flex items-center rounded-full font-medium transition-colors select-none",
|
|
1980
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",
|
|
1918
1981
|
sizeClasses3[size],
|
|
1919
|
-
variant === "
|
|
1920
|
-
|
|
1982
|
+
variant === "outlined" && "border bg-transparent",
|
|
1983
|
+
colorClass,
|
|
1984
|
+
hoverClass,
|
|
1985
|
+
isClickable && !disabled ? "cursor-pointer" : "cursor-default",
|
|
1921
1986
|
disabled && "pointer-events-none opacity-50",
|
|
1922
1987
|
className
|
|
1923
1988
|
),
|
|
1924
1989
|
...props,
|
|
1925
1990
|
children: [
|
|
1926
|
-
avatar && /* @__PURE__ */ jsx20("span", { className: "
|
|
1927
|
-
!avatar && icon && /* @__PURE__ */ jsx20("span", { className: "
|
|
1991
|
+
avatar && /* @__PURE__ */ jsx20("span", { className: cn("-ml-1 flex shrink-0 items-center justify-center [&>*]:rounded-full", avatarSizeClasses[size]), children: avatar }),
|
|
1992
|
+
!avatar && icon && /* @__PURE__ */ jsx20("span", { className: cn("-ml-0.5 flex shrink-0 items-center justify-center", iconSizeClasses[size]), children: icon }),
|
|
1928
1993
|
/* @__PURE__ */ jsx20("span", { className: "truncate", children: content }),
|
|
1929
1994
|
onDelete && /* @__PURE__ */ jsx20(
|
|
1930
1995
|
"button",
|
|
1931
1996
|
{
|
|
1932
1997
|
type: "button",
|
|
1998
|
+
tabIndex: -1,
|
|
1933
1999
|
onClick: (e) => {
|
|
1934
2000
|
e.stopPropagation();
|
|
1935
2001
|
if (!disabled) onDelete(e);
|
|
1936
2002
|
},
|
|
1937
2003
|
className: cn(
|
|
1938
|
-
"
|
|
1939
|
-
"
|
|
2004
|
+
"-mr-1 flex shrink-0 items-center justify-center rounded-full",
|
|
2005
|
+
"opacity-60 hover:opacity-100 focus:outline-none transition-opacity",
|
|
1940
2006
|
disabled && "pointer-events-none"
|
|
1941
2007
|
),
|
|
1942
2008
|
disabled,
|
|
1943
2009
|
"aria-label": "Remove",
|
|
1944
|
-
children: deleteIcon ?? /* @__PURE__ */ jsx20(
|
|
1945
|
-
"svg",
|
|
1946
|
-
{
|
|
1947
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1948
|
-
viewBox: "0 0 20 20",
|
|
1949
|
-
fill: "currentColor",
|
|
1950
|
-
className: "h-3 w-3",
|
|
1951
|
-
children: /* @__PURE__ */ jsx20("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" })
|
|
1952
|
-
}
|
|
1953
|
-
)
|
|
2010
|
+
children: deleteIcon ?? /* @__PURE__ */ jsx20(DefaultDeleteIcon, { size })
|
|
1954
2011
|
}
|
|
1955
2012
|
)
|
|
1956
2013
|
]
|
|
@@ -2399,20 +2456,20 @@ var variantStyles = {
|
|
|
2399
2456
|
border: ""
|
|
2400
2457
|
},
|
|
2401
2458
|
destructive: {
|
|
2402
|
-
icon: "text-
|
|
2403
|
-
border: "border-l-4 border-l-
|
|
2459
|
+
icon: "text-error-500",
|
|
2460
|
+
border: "border-l-4 border-l-error-500"
|
|
2404
2461
|
},
|
|
2405
2462
|
success: {
|
|
2406
|
-
icon: "text-
|
|
2407
|
-
border: "border-l-4 border-l-
|
|
2463
|
+
icon: "text-success-500",
|
|
2464
|
+
border: "border-l-4 border-l-success-500"
|
|
2408
2465
|
},
|
|
2409
2466
|
warning: {
|
|
2410
|
-
icon: "text-
|
|
2411
|
-
border: "border-l-4 border-l-
|
|
2467
|
+
icon: "text-warning-500",
|
|
2468
|
+
border: "border-l-4 border-l-warning-500"
|
|
2412
2469
|
},
|
|
2413
2470
|
info: {
|
|
2414
|
-
icon: "text-
|
|
2415
|
-
border: "border-l-4 border-l-
|
|
2471
|
+
icon: "text-info-500",
|
|
2472
|
+
border: "border-l-4 border-l-info-500"
|
|
2416
2473
|
}
|
|
2417
2474
|
};
|
|
2418
2475
|
var VariantIcons = {
|
|
@@ -2578,217 +2635,170 @@ Spinner.displayName = "Spinner";
|
|
|
2578
2635
|
// src/components/alert.tsx
|
|
2579
2636
|
import * as React27 from "react";
|
|
2580
2637
|
import { jsx as jsx27, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2581
|
-
var
|
|
2638
|
+
var variantConfig = {
|
|
2582
2639
|
default: {
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
},
|
|
2587
|
-
info: {
|
|
2588
|
-
iconBg: "bg-blue-600",
|
|
2589
|
-
progress: "bg-blue-600",
|
|
2590
|
-
textColor: "text-blue-600"
|
|
2640
|
+
root: "bg-accent/10",
|
|
2641
|
+
strip: "bg-accent",
|
|
2642
|
+
iconColor: "text-accent"
|
|
2591
2643
|
},
|
|
2592
2644
|
success: {
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2645
|
+
root: "bg-success-500/10",
|
|
2646
|
+
strip: "bg-success-500",
|
|
2647
|
+
iconColor: "text-success-600 dark:text-success-500"
|
|
2596
2648
|
},
|
|
2597
2649
|
warning: {
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2650
|
+
root: "bg-warning-500/10",
|
|
2651
|
+
strip: "bg-warning-500",
|
|
2652
|
+
iconColor: "text-warning-600 dark:text-warning-500"
|
|
2601
2653
|
},
|
|
2602
2654
|
error: {
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
},
|
|
2607
|
-
destructive: {
|
|
2608
|
-
iconBg: "bg-rose-700",
|
|
2609
|
-
progress: "bg-rose-700",
|
|
2610
|
-
textColor: "text-rose-700"
|
|
2655
|
+
root: "bg-error-500/10",
|
|
2656
|
+
strip: "bg-error-500",
|
|
2657
|
+
iconColor: "text-error-600 dark:text-error-500"
|
|
2611
2658
|
}
|
|
2612
2659
|
};
|
|
2613
|
-
var
|
|
2660
|
+
var InfoIcon = () => /* @__PURE__ */ jsxs14(
|
|
2614
2661
|
"svg",
|
|
2615
2662
|
{
|
|
2616
|
-
className,
|
|
2617
2663
|
viewBox: "0 0 24 24",
|
|
2618
2664
|
fill: "none",
|
|
2619
2665
|
stroke: "currentColor",
|
|
2620
2666
|
strokeWidth: "2",
|
|
2621
|
-
|
|
2667
|
+
strokeLinecap: "round",
|
|
2668
|
+
strokeLinejoin: "round",
|
|
2669
|
+
className: "h-4 w-4 shrink-0 mt-px",
|
|
2670
|
+
children: [
|
|
2671
|
+
/* @__PURE__ */ jsx27("circle", { cx: "12", cy: "12", r: "10" }),
|
|
2672
|
+
/* @__PURE__ */ jsx27("path", { d: "M12 16v-4M12 8h.01" })
|
|
2673
|
+
]
|
|
2622
2674
|
}
|
|
2623
2675
|
);
|
|
2624
|
-
var
|
|
2676
|
+
var CheckIcon2 = () => /* @__PURE__ */ jsxs14(
|
|
2625
2677
|
"svg",
|
|
2626
2678
|
{
|
|
2627
|
-
className,
|
|
2628
2679
|
viewBox: "0 0 24 24",
|
|
2629
2680
|
fill: "none",
|
|
2630
2681
|
stroke: "currentColor",
|
|
2631
2682
|
strokeWidth: "2",
|
|
2683
|
+
strokeLinecap: "round",
|
|
2684
|
+
strokeLinejoin: "round",
|
|
2685
|
+
className: "h-4 w-4 shrink-0 mt-px",
|
|
2632
2686
|
children: [
|
|
2633
|
-
/* @__PURE__ */ jsx27("
|
|
2634
|
-
/* @__PURE__ */ jsx27("path", { d: "
|
|
2687
|
+
/* @__PURE__ */ jsx27("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
|
|
2688
|
+
/* @__PURE__ */ jsx27("path", { d: "m9 11 3 3L22 4" })
|
|
2635
2689
|
]
|
|
2636
2690
|
}
|
|
2637
2691
|
);
|
|
2638
|
-
var WarningIcon = (
|
|
2692
|
+
var WarningIcon = () => /* @__PURE__ */ jsxs14(
|
|
2639
2693
|
"svg",
|
|
2640
2694
|
{
|
|
2641
|
-
className,
|
|
2642
2695
|
viewBox: "0 0 24 24",
|
|
2643
2696
|
fill: "none",
|
|
2644
2697
|
stroke: "currentColor",
|
|
2645
2698
|
strokeWidth: "2",
|
|
2699
|
+
strokeLinecap: "round",
|
|
2700
|
+
strokeLinejoin: "round",
|
|
2701
|
+
className: "h-4 w-4 shrink-0 mt-px",
|
|
2646
2702
|
children: [
|
|
2647
2703
|
/* @__PURE__ */ jsx27("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z" }),
|
|
2648
2704
|
/* @__PURE__ */ jsx27("path", { d: "M12 9v4M12 17h.01" })
|
|
2649
2705
|
]
|
|
2650
2706
|
}
|
|
2651
2707
|
);
|
|
2652
|
-
var
|
|
2708
|
+
var ErrorIcon = () => /* @__PURE__ */ jsxs14(
|
|
2653
2709
|
"svg",
|
|
2654
2710
|
{
|
|
2655
|
-
className,
|
|
2656
2711
|
viewBox: "0 0 24 24",
|
|
2657
2712
|
fill: "none",
|
|
2658
2713
|
stroke: "currentColor",
|
|
2659
2714
|
strokeWidth: "2",
|
|
2715
|
+
strokeLinecap: "round",
|
|
2716
|
+
strokeLinejoin: "round",
|
|
2717
|
+
className: "h-4 w-4 shrink-0 mt-px",
|
|
2660
2718
|
children: [
|
|
2661
2719
|
/* @__PURE__ */ jsx27("circle", { cx: "12", cy: "12", r: "10" }),
|
|
2662
2720
|
/* @__PURE__ */ jsx27("path", { d: "m15 9-6 6M9 9l6 6" })
|
|
2663
2721
|
]
|
|
2664
2722
|
}
|
|
2665
2723
|
);
|
|
2666
|
-
var CloseIcon = (
|
|
2724
|
+
var CloseIcon = () => /* @__PURE__ */ jsx27(
|
|
2667
2725
|
"svg",
|
|
2668
2726
|
{
|
|
2669
|
-
className,
|
|
2670
2727
|
viewBox: "0 0 24 24",
|
|
2671
2728
|
fill: "none",
|
|
2672
2729
|
stroke: "currentColor",
|
|
2673
2730
|
strokeWidth: "2",
|
|
2731
|
+
strokeLinecap: "round",
|
|
2732
|
+
strokeLinejoin: "round",
|
|
2733
|
+
className: "h-3.5 w-3.5",
|
|
2674
2734
|
children: /* @__PURE__ */ jsx27("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
2675
2735
|
}
|
|
2676
2736
|
);
|
|
2677
|
-
var
|
|
2678
|
-
default: InfoIcon,
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
error: XCircleIcon,
|
|
2683
|
-
destructive: XCircleIcon
|
|
2737
|
+
var defaultIcons = {
|
|
2738
|
+
default: /* @__PURE__ */ jsx27(InfoIcon, {}),
|
|
2739
|
+
success: /* @__PURE__ */ jsx27(CheckIcon2, {}),
|
|
2740
|
+
warning: /* @__PURE__ */ jsx27(WarningIcon, {}),
|
|
2741
|
+
error: /* @__PURE__ */ jsx27(ErrorIcon, {})
|
|
2684
2742
|
};
|
|
2685
|
-
var Alert = (
|
|
2686
|
-
variant = "default",
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2743
|
+
var Alert = React27.forwardRef(
|
|
2744
|
+
({ className, variant = "default", onClose, icon, children, ...props }, ref) => {
|
|
2745
|
+
const cfg = variantConfig[variant];
|
|
2746
|
+
const resolvedIcon = icon === null ? null : icon ?? defaultIcons[variant];
|
|
2747
|
+
return /* @__PURE__ */ jsxs14(
|
|
2748
|
+
"div",
|
|
2749
|
+
{
|
|
2750
|
+
ref,
|
|
2751
|
+
role: "alert",
|
|
2752
|
+
className: cn(
|
|
2753
|
+
"relative flex gap-3 rounded-lg border border-border pl-5 pr-4 py-3 text-sm overflow-hidden",
|
|
2754
|
+
cfg.root,
|
|
2755
|
+
className
|
|
2756
|
+
),
|
|
2757
|
+
...props,
|
|
2758
|
+
children: [
|
|
2759
|
+
/* @__PURE__ */ jsx27("div", { className: cn("absolute left-0 top-0 bottom-0 w-1", cfg.strip) }),
|
|
2760
|
+
resolvedIcon && /* @__PURE__ */ jsx27("span", { className: cn("mt-0.5", cfg.iconColor), children: resolvedIcon }),
|
|
2761
|
+
/* @__PURE__ */ jsx27("div", { className: "flex-1 min-w-0", children }),
|
|
2762
|
+
onClose && /* @__PURE__ */ jsx27(
|
|
2763
|
+
"button",
|
|
2764
|
+
{
|
|
2765
|
+
type: "button",
|
|
2766
|
+
onClick: onClose,
|
|
2767
|
+
"aria-label": "Dismiss",
|
|
2768
|
+
className: "shrink-0 self-start mt-0.5 rounded text-muted-foreground hover:text-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
2769
|
+
children: /* @__PURE__ */ jsx27(CloseIcon, {})
|
|
2770
|
+
}
|
|
2771
|
+
)
|
|
2772
|
+
]
|
|
2711
2773
|
}
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
if (!visible) return null;
|
|
2720
|
-
return /* @__PURE__ */ jsxs14(
|
|
2721
|
-
"div",
|
|
2774
|
+
);
|
|
2775
|
+
}
|
|
2776
|
+
);
|
|
2777
|
+
Alert.displayName = "Alert";
|
|
2778
|
+
var AlertTitle = React27.forwardRef(
|
|
2779
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx27(
|
|
2780
|
+
"h5",
|
|
2722
2781
|
{
|
|
2723
|
-
|
|
2724
|
-
className: cn(
|
|
2725
|
-
"relative w-[380px] rounded-xl bg-background border border-border shadow-lg p-4 flex gap-4 items-start overflow-hidden",
|
|
2726
|
-
className
|
|
2727
|
-
),
|
|
2782
|
+
ref,
|
|
2783
|
+
className: cn("font-semibold leading-snug text-foreground", className),
|
|
2728
2784
|
...props,
|
|
2729
|
-
children
|
|
2730
|
-
/* @__PURE__ */ jsx27(
|
|
2731
|
-
"div",
|
|
2732
|
-
{
|
|
2733
|
-
className: cn(
|
|
2734
|
-
"flex items-center justify-center h-10 w-10 rounded-full text-white shrink-0",
|
|
2735
|
-
styles.iconBg
|
|
2736
|
-
),
|
|
2737
|
-
children: /* @__PURE__ */ jsx27(Icon2, { className: "h-5 w-5" })
|
|
2738
|
-
}
|
|
2739
|
-
),
|
|
2740
|
-
/* @__PURE__ */ jsx27("div", { className: cn("flex-1", !hasDescription && "flex items-center mt-2"), children: React27.Children.map(children, (child) => {
|
|
2741
|
-
if (React27.isValidElement(child) && child.type === AlertTitle) {
|
|
2742
|
-
return React27.cloneElement(child, {
|
|
2743
|
-
hasDescription,
|
|
2744
|
-
variant
|
|
2745
|
-
});
|
|
2746
|
-
}
|
|
2747
|
-
return child;
|
|
2748
|
-
}) }),
|
|
2749
|
-
/* @__PURE__ */ jsx27(
|
|
2750
|
-
"button",
|
|
2751
|
-
{
|
|
2752
|
-
onClick: handleClose,
|
|
2753
|
-
className: "absolute top-3 right-3 text-muted-foreground hover:text-foreground transition",
|
|
2754
|
-
children: /* @__PURE__ */ jsx27(CloseIcon, { className: "h-4 w-4" })
|
|
2755
|
-
}
|
|
2756
|
-
),
|
|
2757
|
-
duration !== null && /* @__PURE__ */ jsx27("div", { className: "absolute bottom-0 left-0 h-1 w-full bg-muted", children: /* @__PURE__ */ jsx27(
|
|
2758
|
-
"div",
|
|
2759
|
-
{
|
|
2760
|
-
className: cn("h-full transition-all", styles.progress),
|
|
2761
|
-
style: { width: `${progress}%` }
|
|
2762
|
-
}
|
|
2763
|
-
) })
|
|
2764
|
-
]
|
|
2785
|
+
children
|
|
2765
2786
|
}
|
|
2766
|
-
)
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
children,
|
|
2771
|
-
|
|
2772
|
-
variant = "default",
|
|
2773
|
-
...props
|
|
2774
|
-
}) => {
|
|
2775
|
-
const styles = variants[variant];
|
|
2776
|
-
return /* @__PURE__ */ jsx27(
|
|
2777
|
-
"h4",
|
|
2787
|
+
)
|
|
2788
|
+
);
|
|
2789
|
+
AlertTitle.displayName = "AlertTitle";
|
|
2790
|
+
var AlertDescription = React27.forwardRef(
|
|
2791
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx27(
|
|
2792
|
+
"p",
|
|
2778
2793
|
{
|
|
2779
|
-
|
|
2794
|
+
ref,
|
|
2795
|
+
className: cn("text-sm text-muted-foreground mt-0.5 leading-relaxed", className),
|
|
2780
2796
|
...props,
|
|
2781
2797
|
children
|
|
2782
2798
|
}
|
|
2783
|
-
)
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
className,
|
|
2787
|
-
children,
|
|
2788
|
-
...props
|
|
2789
|
-
}) => {
|
|
2790
|
-
return /* @__PURE__ */ jsx27("p", { className: cn("text-sm text-muted-foreground mt-1", className), ...props, children });
|
|
2791
|
-
};
|
|
2799
|
+
)
|
|
2800
|
+
);
|
|
2801
|
+
AlertDescription.displayName = "AlertDescription";
|
|
2792
2802
|
|
|
2793
2803
|
// src/components/tabs.tsx
|
|
2794
2804
|
import * as React28 from "react";
|
|
@@ -3053,11 +3063,11 @@ var linearSizeClasses = {
|
|
|
3053
3063
|
lg: "h-3"
|
|
3054
3064
|
};
|
|
3055
3065
|
var variantClasses2 = {
|
|
3056
|
-
default: "bg-
|
|
3057
|
-
success: "bg-
|
|
3058
|
-
warning: "bg-
|
|
3059
|
-
error: "bg-
|
|
3060
|
-
info: "bg-
|
|
3066
|
+
default: "bg-accent",
|
|
3067
|
+
success: "bg-success-500",
|
|
3068
|
+
warning: "bg-warning-500",
|
|
3069
|
+
error: "bg-error-500",
|
|
3070
|
+
info: "bg-info-500"
|
|
3061
3071
|
};
|
|
3062
3072
|
var LinearProgress = React30.forwardRef(
|
|
3063
3073
|
({
|
|
@@ -3109,11 +3119,11 @@ var circularSizeValues = {
|
|
|
3109
3119
|
xl: 72
|
|
3110
3120
|
};
|
|
3111
3121
|
var strokeColors = {
|
|
3112
|
-
default: "stroke-
|
|
3113
|
-
success: "stroke-
|
|
3114
|
-
warning: "stroke-
|
|
3115
|
-
error: "stroke-
|
|
3116
|
-
info: "stroke-
|
|
3122
|
+
default: "stroke-accent",
|
|
3123
|
+
success: "stroke-success-500",
|
|
3124
|
+
warning: "stroke-warning-500",
|
|
3125
|
+
error: "stroke-error-500",
|
|
3126
|
+
info: "stroke-info-500"
|
|
3117
3127
|
};
|
|
3118
3128
|
var CircularProgress = React30.forwardRef(
|
|
3119
3129
|
({
|
|
@@ -6118,10 +6128,10 @@ var colorStyles = {
|
|
|
6118
6128
|
default: "text-foreground",
|
|
6119
6129
|
muted: "text-muted-foreground",
|
|
6120
6130
|
primary: "text-primary",
|
|
6121
|
-
success: "text-
|
|
6122
|
-
warning: "text-
|
|
6123
|
-
error: "text-
|
|
6124
|
-
info: "text-
|
|
6131
|
+
success: "text-success-600 dark:text-success-400",
|
|
6132
|
+
warning: "text-warning-600 dark:text-warning-400",
|
|
6133
|
+
error: "text-error-600 dark:text-error-400",
|
|
6134
|
+
info: "text-info-600 dark:text-info-400"
|
|
6125
6135
|
};
|
|
6126
6136
|
var DataListLabel = React38.forwardRef(
|
|
6127
6137
|
({
|
|
@@ -8364,8 +8374,11 @@ var IconRail = React46.forwardRef(
|
|
|
8364
8374
|
{
|
|
8365
8375
|
className: cn(
|
|
8366
8376
|
"flex flex-col bg-card border-r border-border h-full",
|
|
8367
|
-
"transition-[width] duration-200",
|
|
8368
|
-
overlayRail &&
|
|
8377
|
+
"transition-[width,box-shadow] duration-200",
|
|
8378
|
+
overlayRail && expandableRail ? cn(
|
|
8379
|
+
"absolute left-0 top-0 z-30",
|
|
8380
|
+
isExpanded ? "w-[var(--rail-expanded-width)] shadow-lg" : "w-[var(--rail-width)] shadow-none"
|
|
8381
|
+
) : "w-full",
|
|
8369
8382
|
className
|
|
8370
8383
|
),
|
|
8371
8384
|
children
|
|
@@ -8764,9 +8777,10 @@ var PlaygroundContent = () => {
|
|
|
8764
8777
|
] }) }),
|
|
8765
8778
|
/* @__PURE__ */ jsx47(Section, { title: "Badge", children: /* @__PURE__ */ jsxs32("div", { className: "flex flex-wrap gap-4", children: [
|
|
8766
8779
|
/* @__PURE__ */ jsx47(Badge, { children: "Default" }),
|
|
8767
|
-
/* @__PURE__ */ jsx47(Badge, {
|
|
8768
|
-
/* @__PURE__ */ jsx47(Badge, {
|
|
8769
|
-
/* @__PURE__ */ jsx47(Badge, { variant: "
|
|
8780
|
+
/* @__PURE__ */ jsx47(Badge, { color: "success", children: "Success" }),
|
|
8781
|
+
/* @__PURE__ */ jsx47(Badge, { color: "warning", children: "Warning" }),
|
|
8782
|
+
/* @__PURE__ */ jsx47(Badge, { color: "error", variant: "outlined", children: "Error" }),
|
|
8783
|
+
/* @__PURE__ */ jsx47(Badge, { color: "destructive", variant: "text", children: "Destructive" })
|
|
8770
8784
|
] }) }),
|
|
8771
8785
|
/* @__PURE__ */ jsx47(Section, { title: "Card", children: /* @__PURE__ */ jsxs32("div", { className: "grid gap-4 md:grid-cols-2", children: [
|
|
8772
8786
|
/* @__PURE__ */ jsxs32(Card, { children: [
|
|
@@ -8850,19 +8864,19 @@ var PlaygroundContent = () => {
|
|
|
8850
8864
|
/* @__PURE__ */ jsxs32(TableBody, { children: [
|
|
8851
8865
|
/* @__PURE__ */ jsxs32(TableRow, { children: [
|
|
8852
8866
|
/* @__PURE__ */ jsx47(TableCell, { children: "INV001" }),
|
|
8853
|
-
/* @__PURE__ */ jsx47(TableCell, { children: /* @__PURE__ */ jsx47(Badge, { children: "Paid" }) }),
|
|
8867
|
+
/* @__PURE__ */ jsx47(TableCell, { children: /* @__PURE__ */ jsx47(Badge, { color: "success", children: "Paid" }) }),
|
|
8854
8868
|
/* @__PURE__ */ jsx47(TableCell, { children: "Credit Card" }),
|
|
8855
8869
|
/* @__PURE__ */ jsx47(TableCell, { className: "text-right", children: "$250.00" })
|
|
8856
8870
|
] }),
|
|
8857
8871
|
/* @__PURE__ */ jsxs32(TableRow, { children: [
|
|
8858
8872
|
/* @__PURE__ */ jsx47(TableCell, { children: "INV002" }),
|
|
8859
|
-
/* @__PURE__ */ jsx47(TableCell, { children: /* @__PURE__ */ jsx47(Badge, { variant: "
|
|
8873
|
+
/* @__PURE__ */ jsx47(TableCell, { children: /* @__PURE__ */ jsx47(Badge, { color: "warning", variant: "outlined", children: "Pending" }) }),
|
|
8860
8874
|
/* @__PURE__ */ jsx47(TableCell, { children: "PayPal" }),
|
|
8861
8875
|
/* @__PURE__ */ jsx47(TableCell, { className: "text-right", children: "$150.00" })
|
|
8862
8876
|
] }),
|
|
8863
8877
|
/* @__PURE__ */ jsxs32(TableRow, { children: [
|
|
8864
8878
|
/* @__PURE__ */ jsx47(TableCell, { children: "INV003" }),
|
|
8865
|
-
/* @__PURE__ */ jsx47(TableCell, { children: /* @__PURE__ */ jsx47(Badge, { variant: "
|
|
8879
|
+
/* @__PURE__ */ jsx47(TableCell, { children: /* @__PURE__ */ jsx47(Badge, { color: "error", variant: "outlined", children: "Failed" }) }),
|
|
8866
8880
|
/* @__PURE__ */ jsx47(TableCell, { children: "Bank Transfer" }),
|
|
8867
8881
|
/* @__PURE__ */ jsx47(TableCell, { className: "text-right", children: "$350.00" })
|
|
8868
8882
|
] })
|