@lindle/linoardo 1.0.21 → 1.0.22
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/button.cjs +2 -1
- package/dist/button.cjs.map +1 -1
- package/dist/button.js +1 -1
- package/dist/chunk-67USTSXI.js +214 -0
- package/dist/chunk-67USTSXI.js.map +1 -0
- package/dist/{chunk-RFPNVLAD.js → chunk-F2G2JRKA.js} +4 -3
- package/dist/chunk-F2G2JRKA.js.map +1 -0
- package/dist/{chunk-QRBJFDV5.js → chunk-NEYVJE67.js} +3 -3
- package/dist/{chunk-QRBJFDV5.js.map → chunk-NEYVJE67.js.map} +1 -1
- package/dist/chunk-Z5A2OIDI.js +312 -0
- package/dist/chunk-Z5A2OIDI.js.map +1 -0
- package/dist/index.cjs +653 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +27 -1
- package/dist/index.d.ts +27 -1
- package/dist/index.js +147 -2
- package/dist/index.js.map +1 -1
- package/dist/notification.cjs +236 -0
- package/dist/notification.cjs.map +1 -0
- package/dist/notification.d.cts +34 -0
- package/dist/notification.d.ts +34 -0
- package/dist/notification.js +3 -0
- package/dist/notification.js.map +1 -0
- package/dist/profileCard.cjs +2 -1
- package/dist/profileCard.cjs.map +1 -1
- package/dist/profileCard.js +2 -2
- package/dist/progress.cjs +314 -0
- package/dist/progress.cjs.map +1 -0
- package/dist/progress.d.cts +30 -0
- package/dist/progress.d.ts +30 -0
- package/dist/progress.js +3 -0
- package/dist/progress.js.map +1 -0
- package/dist/styles.css +276 -0
- package/package.json +11 -1
- package/dist/chunk-RFPNVLAD.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -182,6 +182,7 @@ var Button = React3__namespace.forwardRef(
|
|
|
182
182
|
children,
|
|
183
183
|
disabled,
|
|
184
184
|
onClick,
|
|
185
|
+
type,
|
|
185
186
|
as,
|
|
186
187
|
...rest
|
|
187
188
|
}, ref) => {
|
|
@@ -192,7 +193,7 @@ var Button = React3__namespace.forwardRef(
|
|
|
192
193
|
const blockClass = block ? "w-full" : null;
|
|
193
194
|
const isNativeButton = Component === "button";
|
|
194
195
|
const isDisabled = disabled || loading;
|
|
195
|
-
const cursor = onClick && !isDisabled ? "cursor-pointer" : "cursor-default";
|
|
196
|
+
const cursor = (onClick || type === "submit") && !isDisabled ? "cursor-pointer" : "cursor-default";
|
|
196
197
|
const resolvedIconClass = resolveIconClassName(icon);
|
|
197
198
|
const shouldRenderIcon = Boolean(resolvedIconClass && !loading);
|
|
198
199
|
const isLoadingTextProvided = loadingText !== void 0 && loadingText !== null;
|
|
@@ -1649,6 +1650,143 @@ function resolveItemContent(item, index, renderItem) {
|
|
|
1649
1650
|
}
|
|
1650
1651
|
return item;
|
|
1651
1652
|
}
|
|
1653
|
+
var positionClasses = {
|
|
1654
|
+
fixed: "fixed inset-x-0 top-0",
|
|
1655
|
+
absolute: "absolute inset-x-0 top-0",
|
|
1656
|
+
sticky: "sticky inset-x-0 top-0",
|
|
1657
|
+
static: "static",
|
|
1658
|
+
relative: "relative"
|
|
1659
|
+
};
|
|
1660
|
+
var colorClasses = {
|
|
1661
|
+
primary: "bg-primary text-white",
|
|
1662
|
+
surface: "bg-white text-gray-900 border-b border-gray-200",
|
|
1663
|
+
muted: "bg-gray-50 text-gray-900 border-b border-gray-200",
|
|
1664
|
+
dark: "bg-gray-900 text-white",
|
|
1665
|
+
transparent: "bg-transparent text-inherit"
|
|
1666
|
+
};
|
|
1667
|
+
var AppBar = ({
|
|
1668
|
+
title,
|
|
1669
|
+
logo,
|
|
1670
|
+
logoAlt = "Logo",
|
|
1671
|
+
brandHref,
|
|
1672
|
+
navigation = [],
|
|
1673
|
+
actions,
|
|
1674
|
+
position = "static",
|
|
1675
|
+
color = "surface",
|
|
1676
|
+
dense = false,
|
|
1677
|
+
elevated = true,
|
|
1678
|
+
contained = true,
|
|
1679
|
+
titlePosition = "start",
|
|
1680
|
+
className,
|
|
1681
|
+
children,
|
|
1682
|
+
...rest
|
|
1683
|
+
}) => {
|
|
1684
|
+
const [mobileOpen, setMobileOpen] = React3__namespace.useState(false);
|
|
1685
|
+
const isDark = color === "primary" || color === "dark";
|
|
1686
|
+
const isTransparent = color === "transparent";
|
|
1687
|
+
const barClass = tailwindMerge.twMerge(
|
|
1688
|
+
"app-bar z-40 w-full backdrop-blur-md",
|
|
1689
|
+
positionClasses[position] ?? positionClasses.static,
|
|
1690
|
+
colorClasses[color] ?? colorClasses.surface,
|
|
1691
|
+
elevated && !isTransparent ? "shadow-sm shadow-black/10" : void 0,
|
|
1692
|
+
"relative",
|
|
1693
|
+
className
|
|
1694
|
+
);
|
|
1695
|
+
const innerClass = tailwindMerge.twMerge(
|
|
1696
|
+
"mx-auto flex w-full items-center gap-4",
|
|
1697
|
+
contained ? "max-w-6xl px-4 sm:px-6 lg:px-8" : "px-4",
|
|
1698
|
+
dense ? "py-2.5" : "py-4"
|
|
1699
|
+
);
|
|
1700
|
+
const brandTextClass = isDark ? "text-white" : "text-gray-900";
|
|
1701
|
+
const navBaseClass = tailwindMerge.twMerge(
|
|
1702
|
+
"inline-flex items-center gap-2 rounded-xl px-3 py-2 text-sm font-medium transition focus-visible:outline-none",
|
|
1703
|
+
isDark ? "hover:bg-white/10 focus-visible:ring-2 focus-visible:ring-white/70" : "hover:bg-gray-100 focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-2 focus-visible:ring-offset-transparent"
|
|
1704
|
+
);
|
|
1705
|
+
const navActiveClass = isDark ? "bg-white/15 text-white" : "bg-primary/10 text-primary";
|
|
1706
|
+
const renderNavItem = (item, index) => {
|
|
1707
|
+
const { href, label, active, onClick } = item;
|
|
1708
|
+
const Component = href ? "a" : "button";
|
|
1709
|
+
const resolvedHref = href && href.trim().length > 0 ? href : void 0;
|
|
1710
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1711
|
+
Component,
|
|
1712
|
+
{
|
|
1713
|
+
href: resolvedHref,
|
|
1714
|
+
onClick,
|
|
1715
|
+
className: tailwindMerge.twMerge(navBaseClass, active ? navActiveClass : void 0),
|
|
1716
|
+
"aria-current": active ? "page" : void 0,
|
|
1717
|
+
children: label
|
|
1718
|
+
},
|
|
1719
|
+
`${resolvedHref ?? "item"}-${index}`
|
|
1720
|
+
);
|
|
1721
|
+
};
|
|
1722
|
+
const brandAlignClass = titlePosition === "center" ? "justify-self-center text-center" : titlePosition === "end" ? "justify-self-end text-right" : "justify-self-start";
|
|
1723
|
+
const brandNode = title || logo ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tailwindMerge.twMerge("flex min-w-0 items-center gap-3", brandAlignClass), children: [
|
|
1724
|
+
logo ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-xl bg-white/10 ring-1 ring-black/5", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1725
|
+
"img",
|
|
1726
|
+
{
|
|
1727
|
+
src: logo,
|
|
1728
|
+
alt: logoAlt,
|
|
1729
|
+
className: "h-full w-full object-cover",
|
|
1730
|
+
loading: "lazy",
|
|
1731
|
+
decoding: "async"
|
|
1732
|
+
}
|
|
1733
|
+
) }) : null,
|
|
1734
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0", children: title ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: tailwindMerge.twMerge("text-base font-semibold leading-tight", brandTextClass), children: brandHref ? /* @__PURE__ */ jsxRuntime.jsx("a", { href: brandHref, className: "hover:underline focus-visible:outline-none", children: title }) : title }) : null })
|
|
1735
|
+
] }) : null;
|
|
1736
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("header", { ...rest, className: barClass, children: [
|
|
1737
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: innerClass, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid w-full grid-cols-[auto_1fr_auto] items-center gap-3", children: [
|
|
1738
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1739
|
+
navigation.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1740
|
+
"button",
|
|
1741
|
+
{
|
|
1742
|
+
type: "button",
|
|
1743
|
+
"aria-label": "Otev\u0159\xEDt navigaci",
|
|
1744
|
+
className: tailwindMerge.twMerge(
|
|
1745
|
+
"inline-flex h-10 w-10 items-center justify-center rounded-xl text-xl sm:hidden",
|
|
1746
|
+
isDark ? "text-white hover:bg-white/10 focus-visible:ring-2 focus-visible:ring-white/60" : "text-gray-700 hover:bg-gray-100 focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 focus-visible:ring-offset-transparent"
|
|
1747
|
+
),
|
|
1748
|
+
"aria-expanded": mobileOpen,
|
|
1749
|
+
onClick: () => setMobileOpen((open) => !open),
|
|
1750
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("i", { className: mobileOpen ? "mdi mdi-close" : "mdi mdi-menu", "aria-hidden": true })
|
|
1751
|
+
}
|
|
1752
|
+
) : null,
|
|
1753
|
+
navigation.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("nav", { className: "hidden items-center gap-1 sm:flex", "aria-label": "Hlavni navigace", children: navigation.map(renderNavItem) }) : null
|
|
1754
|
+
] }),
|
|
1755
|
+
brandNode,
|
|
1756
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-auto flex items-center justify-end gap-2", children: [
|
|
1757
|
+
children,
|
|
1758
|
+
actions
|
|
1759
|
+
] })
|
|
1760
|
+
] }) }),
|
|
1761
|
+
navigation.length > 0 && mobileOpen ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sm:hidden", children: /* @__PURE__ */ jsxRuntime.jsx("nav", { className: "absolute inset-x-0 top-full border-t border-gray-200/70 bg-white/95 p-3 shadow-lg shadow-gray-900/5 backdrop-blur-md", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2", "aria-label": "Mobilni navigace", children: navigation.map((item, index) => {
|
|
1762
|
+
const { href, label, active, onClick } = item;
|
|
1763
|
+
const Component = href ? "a" : "button";
|
|
1764
|
+
const resolvedHref = href && href.trim().length > 0 ? href : void 0;
|
|
1765
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1766
|
+
Component,
|
|
1767
|
+
{
|
|
1768
|
+
href: resolvedHref,
|
|
1769
|
+
onClick: (event) => {
|
|
1770
|
+
onClick?.(event);
|
|
1771
|
+
setMobileOpen(false);
|
|
1772
|
+
},
|
|
1773
|
+
className: tailwindMerge.twMerge(
|
|
1774
|
+
"flex items-center justify-between rounded-xl px-3 py-2 text-sm font-medium transition",
|
|
1775
|
+
active ? "bg-primary/10 text-primary" : "text-gray-800 hover:bg-gray-100"
|
|
1776
|
+
),
|
|
1777
|
+
"aria-current": active ? "page" : void 0,
|
|
1778
|
+
children: [
|
|
1779
|
+
label,
|
|
1780
|
+
active ? /* @__PURE__ */ jsxRuntime.jsx("i", { className: "mdi mdi-circle-small text-primary", "aria-hidden": true }) : null
|
|
1781
|
+
]
|
|
1782
|
+
},
|
|
1783
|
+
`${resolvedHref ?? "mobile-item"}-${index}`
|
|
1784
|
+
);
|
|
1785
|
+
}) }) }) }) : null
|
|
1786
|
+
] });
|
|
1787
|
+
};
|
|
1788
|
+
AppBar.displayName = "AppBar";
|
|
1789
|
+
var AppBar_default = AppBar;
|
|
1652
1790
|
var containerVariants = {
|
|
1653
1791
|
solid: "bg-gradient-to-br from-primary via-primary/90 to-indigo-600 text-white shadow-2xl shadow-primary/30",
|
|
1654
1792
|
outline: "border border-gray-200 bg-white text-gray-900",
|
|
@@ -2540,7 +2678,7 @@ var sizeClasses3 = {
|
|
|
2540
2678
|
large: "text-lg",
|
|
2541
2679
|
"x-large": "text-2xl"
|
|
2542
2680
|
};
|
|
2543
|
-
var
|
|
2681
|
+
var colorClasses2 = {
|
|
2544
2682
|
primary: "text-primary",
|
|
2545
2683
|
neutral: "text-gray-700",
|
|
2546
2684
|
info: "text-sky-600",
|
|
@@ -2572,11 +2710,521 @@ var Icon = ({ className, icon, size, color, ...rest }) => {
|
|
|
2572
2710
|
}
|
|
2573
2711
|
const classBase = "mdi";
|
|
2574
2712
|
const sizeClass = size ? sizeClasses3[size] ?? sizeClasses3.medium : void 0;
|
|
2575
|
-
const colorClass = color ?
|
|
2713
|
+
const colorClass = color ? colorClasses2[color] ?? colorClasses2.primary : void 0;
|
|
2576
2714
|
return /* @__PURE__ */ jsxRuntime.jsx("i", { ...rest, className: tailwindMerge.twMerge(classBase, iconValue, sizeClass, colorClass, className) });
|
|
2577
2715
|
};
|
|
2578
2716
|
var Icon_default = Icon;
|
|
2717
|
+
var placementClasses3 = {
|
|
2718
|
+
topLeft: "top-4 left-4 items-start",
|
|
2719
|
+
topRight: "top-4 right-4 items-end",
|
|
2720
|
+
bottomLeft: "bottom-4 left-4 items-start",
|
|
2721
|
+
bottomRight: "bottom-4 right-4 items-end"
|
|
2722
|
+
};
|
|
2723
|
+
var typeIconMap = {
|
|
2724
|
+
info: "mdi-information-outline",
|
|
2725
|
+
success: "mdi-check-circle-outline",
|
|
2726
|
+
warning: "mdi-alert-outline",
|
|
2727
|
+
error: "mdi-close-circle-outline"
|
|
2728
|
+
};
|
|
2729
|
+
var typeAccentMap = {
|
|
2730
|
+
info: "bg-sky-50 text-sky-600",
|
|
2731
|
+
success: "bg-emerald-50 text-emerald-600",
|
|
2732
|
+
warning: "bg-amber-50 text-amber-700",
|
|
2733
|
+
error: "bg-red-50 text-red-600"
|
|
2734
|
+
};
|
|
2735
|
+
var typeTone = {
|
|
2736
|
+
info: {
|
|
2737
|
+
bg: "bg-sky-50",
|
|
2738
|
+
text: "text-sky-900",
|
|
2739
|
+
border: "border-sky-200",
|
|
2740
|
+
iconBg: "bg-sky-100",
|
|
2741
|
+
iconText: "text-sky-600"
|
|
2742
|
+
},
|
|
2743
|
+
success: {
|
|
2744
|
+
bg: "bg-emerald-50",
|
|
2745
|
+
text: "text-emerald-900",
|
|
2746
|
+
border: "border-emerald-200",
|
|
2747
|
+
iconBg: "bg-emerald-100",
|
|
2748
|
+
iconText: "text-emerald-600"
|
|
2749
|
+
},
|
|
2750
|
+
warning: {
|
|
2751
|
+
bg: "bg-amber-50",
|
|
2752
|
+
text: "text-amber-900",
|
|
2753
|
+
border: "border-amber-200",
|
|
2754
|
+
iconBg: "bg-amber-100",
|
|
2755
|
+
iconText: "text-amber-700"
|
|
2756
|
+
},
|
|
2757
|
+
error: {
|
|
2758
|
+
bg: "bg-red-50",
|
|
2759
|
+
text: "text-red-900",
|
|
2760
|
+
border: "border-red-200",
|
|
2761
|
+
iconBg: "bg-red-100",
|
|
2762
|
+
iconText: "text-red-600"
|
|
2763
|
+
}
|
|
2764
|
+
};
|
|
2765
|
+
var resolveVariantClass3 = (variant, type) => {
|
|
2766
|
+
const tone = type ? typeTone[type] : void 0;
|
|
2767
|
+
switch (variant) {
|
|
2768
|
+
case "filled":
|
|
2769
|
+
return tailwindMerge.twMerge(
|
|
2770
|
+
tone?.bg ?? "bg-primary/10",
|
|
2771
|
+
tone?.text ?? "text-primary",
|
|
2772
|
+
"border border-transparent shadow-none"
|
|
2773
|
+
);
|
|
2774
|
+
case "outline":
|
|
2775
|
+
return tailwindMerge.twMerge(
|
|
2776
|
+
"bg-white/90",
|
|
2777
|
+
tone?.text ?? "text-gray-900",
|
|
2778
|
+
tone?.border ?? "border-primary/20",
|
|
2779
|
+
"border-[1.5px]"
|
|
2780
|
+
);
|
|
2781
|
+
case "ghost":
|
|
2782
|
+
return tailwindMerge.twMerge(
|
|
2783
|
+
"bg-transparent shadow-none border border-transparent",
|
|
2784
|
+
tone?.text ?? "text-gray-900"
|
|
2785
|
+
);
|
|
2786
|
+
case "solid":
|
|
2787
|
+
default:
|
|
2788
|
+
return "bg-white/95 text-gray-900 border border-gray-200";
|
|
2789
|
+
}
|
|
2790
|
+
};
|
|
2791
|
+
var resolveIconClassName4 = (icon) => {
|
|
2792
|
+
if (!icon) return void 0;
|
|
2793
|
+
if (typeof icon === "string") {
|
|
2794
|
+
const trimmed = icon.trim();
|
|
2795
|
+
if (!trimmed) return void 0;
|
|
2796
|
+
if (trimmed.includes(" ")) return trimmed;
|
|
2797
|
+
const normalized2 = trimmed.startsWith("mdi-") ? trimmed : `mdi-${trimmed}`;
|
|
2798
|
+
return `mdi ${normalized2}`;
|
|
2799
|
+
}
|
|
2800
|
+
const [library, iconName] = icon;
|
|
2801
|
+
const normalized = iconName?.startsWith("mdi-") ? iconName : `mdi-${iconName}`;
|
|
2802
|
+
return `mdi ${library} ${normalized}`.trim();
|
|
2803
|
+
};
|
|
2804
|
+
var resolveIconNode = (icon, fallbackClassName) => {
|
|
2805
|
+
if (React3__namespace.isValidElement(icon)) return icon;
|
|
2806
|
+
const iconClassName = resolveIconClassName4(icon) ?? fallbackClassName;
|
|
2807
|
+
if (!iconClassName) return null;
|
|
2808
|
+
const hasBase = iconClassName.split(" ").some((token) => token.trim() === "mdi");
|
|
2809
|
+
const hasGlyph = iconClassName.includes("mdi-");
|
|
2810
|
+
const finalClassName = hasBase && hasGlyph ? iconClassName : `mdi ${iconClassName}`.trim();
|
|
2811
|
+
return /* @__PURE__ */ jsxRuntime.jsx("i", { className: finalClassName, "aria-hidden": true });
|
|
2812
|
+
};
|
|
2813
|
+
var NotificationCard = ({ item }) => {
|
|
2814
|
+
const {
|
|
2815
|
+
key,
|
|
2816
|
+
message,
|
|
2817
|
+
description,
|
|
2818
|
+
icon,
|
|
2819
|
+
closeIcon,
|
|
2820
|
+
closable = true,
|
|
2821
|
+
btn,
|
|
2822
|
+
onClick,
|
|
2823
|
+
className,
|
|
2824
|
+
style,
|
|
2825
|
+
role = "status",
|
|
2826
|
+
type,
|
|
2827
|
+
variant = "solid",
|
|
2828
|
+
...rest
|
|
2829
|
+
} = item;
|
|
2830
|
+
const hasMessage = message !== void 0 && message !== null;
|
|
2831
|
+
const hasDescription = description !== void 0 && description !== null;
|
|
2832
|
+
const hasContent = hasMessage || hasDescription;
|
|
2833
|
+
const accentClass = type ? typeAccentMap[type] : void 0;
|
|
2834
|
+
const iconNode = resolveIconNode(icon, type ? `mdi ${typeIconMap[type]}` : void 0);
|
|
2835
|
+
const closeIconNode = resolveIconNode(closeIcon, "mdi mdi-close");
|
|
2836
|
+
const variantClass = resolveVariantClass3(variant, type);
|
|
2837
|
+
const toneIconBg = type ? typeTone[type]?.iconBg : void 0;
|
|
2838
|
+
const toneIconText = type ? typeTone[type]?.iconText : void 0;
|
|
2839
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2840
|
+
"article",
|
|
2841
|
+
{
|
|
2842
|
+
...rest,
|
|
2843
|
+
role,
|
|
2844
|
+
className: tailwindMerge.twMerge(
|
|
2845
|
+
"pointer-events-auto flex w-88 max-w-[calc(100vw-2.5rem)] gap-3 rounded-2xl p-4 shadow-xl ring-1 ring-black/5 backdrop-blur-sm transition hover:-translate-y-0.5 hover:shadow-2xl focus:outline-none",
|
|
2846
|
+
"dark:border-gray-800 dark:bg-gray-900/95 dark:text-gray-50 dark:ring-white/5",
|
|
2847
|
+
variantClass,
|
|
2848
|
+
className
|
|
2849
|
+
),
|
|
2850
|
+
style,
|
|
2851
|
+
onClick,
|
|
2852
|
+
children: [
|
|
2853
|
+
iconNode ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2854
|
+
"div",
|
|
2855
|
+
{
|
|
2856
|
+
className: tailwindMerge.twMerge(
|
|
2857
|
+
"mt-0.5 flex h-10 w-10 shrink-0 items-center justify-center rounded-xl text-xl",
|
|
2858
|
+
toneIconBg ?? accentClass ?? "bg-primary/10",
|
|
2859
|
+
toneIconText ?? "text-primary"
|
|
2860
|
+
),
|
|
2861
|
+
children: iconNode
|
|
2862
|
+
}
|
|
2863
|
+
) : null,
|
|
2864
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1 space-y-1", children: [
|
|
2865
|
+
hasContent ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
|
|
2866
|
+
hasMessage ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[15px] font-semibold leading-5 text-gray-900 dark:text-white", children: message }) : null,
|
|
2867
|
+
hasDescription ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm leading-6 text-gray-600 dark:text-gray-300", children: description }) : null
|
|
2868
|
+
] }) : null,
|
|
2869
|
+
btn ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pt-1 text-sm", children: btn }) : null
|
|
2870
|
+
] }),
|
|
2871
|
+
closable ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2872
|
+
"button",
|
|
2873
|
+
{
|
|
2874
|
+
type: "button",
|
|
2875
|
+
"aria-label": "Zav\u0159\xEDt upozorn\u011Bn\xED",
|
|
2876
|
+
className: "-mr-1 -mt-1 h-8 w-8 shrink-0 rounded-full text-gray-500 transition hover:bg-gray-100 hover:text-gray-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-white",
|
|
2877
|
+
onClick: (event) => {
|
|
2878
|
+
event.stopPropagation();
|
|
2879
|
+
item.onClose?.();
|
|
2880
|
+
},
|
|
2881
|
+
children: closeIconNode
|
|
2882
|
+
}
|
|
2883
|
+
) : null
|
|
2884
|
+
]
|
|
2885
|
+
}
|
|
2886
|
+
);
|
|
2887
|
+
};
|
|
2888
|
+
var Notification = ({
|
|
2889
|
+
items = [],
|
|
2890
|
+
placement = "topRight",
|
|
2891
|
+
gap = 12,
|
|
2892
|
+
containerClassName,
|
|
2893
|
+
className,
|
|
2894
|
+
...rest
|
|
2895
|
+
}) => {
|
|
2896
|
+
if (!items.length) return null;
|
|
2897
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
2898
|
+
items.forEach((item) => {
|
|
2899
|
+
const resolvedKey = item.key ?? `notification-${item.message ?? Math.random()}`;
|
|
2900
|
+
const resolvedPlacement = item.placement ?? placement;
|
|
2901
|
+
const group = grouped.get(resolvedPlacement) ?? [];
|
|
2902
|
+
group.push({ ...item, key: resolvedKey });
|
|
2903
|
+
grouped.set(resolvedPlacement, group);
|
|
2904
|
+
});
|
|
2905
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: Array.from(grouped.entries()).map(([groupPlacement, groupItems]) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2906
|
+
"div",
|
|
2907
|
+
{
|
|
2908
|
+
className: tailwindMerge.twMerge(
|
|
2909
|
+
"pointer-events-none fixed z-70 flex w-full max-w-[24rem] flex-col",
|
|
2910
|
+
placementClasses3[groupPlacement],
|
|
2911
|
+
containerClassName,
|
|
2912
|
+
className
|
|
2913
|
+
),
|
|
2914
|
+
style: { gap: `${gap}px` },
|
|
2915
|
+
...rest,
|
|
2916
|
+
children: groupItems.map((item) => /* @__PURE__ */ jsxRuntime.jsx(NotificationCard, { item }, item.key))
|
|
2917
|
+
},
|
|
2918
|
+
groupPlacement
|
|
2919
|
+
)) });
|
|
2920
|
+
};
|
|
2921
|
+
var Notification_default = Notification;
|
|
2922
|
+
var clampPercent = (value) => {
|
|
2923
|
+
if (value === void 0 || value === null || Number.isNaN(value)) {
|
|
2924
|
+
return 0;
|
|
2925
|
+
}
|
|
2926
|
+
return Math.min(100, Math.max(0, value));
|
|
2927
|
+
};
|
|
2928
|
+
var statusIconMap = {
|
|
2929
|
+
success: "mdi mdi-check",
|
|
2930
|
+
exception: "mdi mdi-alert"
|
|
2931
|
+
};
|
|
2932
|
+
var strokeColorByStatus = {
|
|
2933
|
+
normal: "rgb(99 102 241)",
|
|
2934
|
+
active: "rgb(99 102 241)",
|
|
2935
|
+
success: "rgb(16 185 129)",
|
|
2936
|
+
exception: "rgb(239 68 68)"
|
|
2937
|
+
};
|
|
2938
|
+
var trailColorDefault = "rgb(229 231 235)";
|
|
2939
|
+
var resolveStroke = (status, strokeColor, gradientId) => {
|
|
2940
|
+
if (!strokeColor) {
|
|
2941
|
+
return { color: strokeColorByStatus[status] };
|
|
2942
|
+
}
|
|
2943
|
+
if (typeof strokeColor === "string") {
|
|
2944
|
+
return { color: strokeColor };
|
|
2945
|
+
}
|
|
2946
|
+
const id = gradientId ?? `progress-gradient-${Math.random().toString(16).slice(2)}`;
|
|
2947
|
+
return {
|
|
2948
|
+
color: `url(#${id})`,
|
|
2949
|
+
gradient: { id, from: strokeColor.from, to: strokeColor.to },
|
|
2950
|
+
cssGradient: `linear-gradient(90deg, ${strokeColor.from}, ${strokeColor.to})`
|
|
2951
|
+
};
|
|
2952
|
+
};
|
|
2953
|
+
var resolveRotation = (gapPosition) => {
|
|
2954
|
+
switch (gapPosition) {
|
|
2955
|
+
case "bottom":
|
|
2956
|
+
return 90;
|
|
2957
|
+
case "left":
|
|
2958
|
+
return 180;
|
|
2959
|
+
case "right":
|
|
2960
|
+
return 0;
|
|
2961
|
+
case "top":
|
|
2962
|
+
default:
|
|
2963
|
+
return -90;
|
|
2964
|
+
}
|
|
2965
|
+
};
|
|
2966
|
+
var buildGradientId = (strokeColor) => {
|
|
2967
|
+
if (strokeColor && typeof strokeColor !== "string") {
|
|
2968
|
+
const from = strokeColor.from.replace(/\W+/g, "");
|
|
2969
|
+
const to = strokeColor.to.replace(/\W+/g, "");
|
|
2970
|
+
return `progress-gradient-${from}-${to}`;
|
|
2971
|
+
}
|
|
2972
|
+
return void 0;
|
|
2973
|
+
};
|
|
2974
|
+
var InfoNode = ({ status, percent, successPercent, format }) => {
|
|
2975
|
+
const iconClass = status === "success" || status === "exception" ? statusIconMap[status] : void 0;
|
|
2976
|
+
const content = typeof format === "function" ? format(percent, successPercent) : iconClass ? /* @__PURE__ */ jsxRuntime.jsx("i", { className: iconClass, "aria-hidden": true }) : `${Math.round(percent)}%`;
|
|
2977
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-gray-700 dark:text-gray-200", children: content });
|
|
2978
|
+
};
|
|
2979
|
+
var renderSteps = (percent, steps, status, strokeStyle, trailColor, height) => {
|
|
2980
|
+
const filled = Math.round(percent / 100 * steps);
|
|
2981
|
+
const stepStyle = height ? { height } : {};
|
|
2982
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-full items-center gap-1", style: stepStyle, children: Array.from({ length: steps }).map((_, idx) => {
|
|
2983
|
+
const isFilled = idx < filled;
|
|
2984
|
+
const resolvedStyle = {
|
|
2985
|
+
...isFilled ? strokeStyle : { backgroundColor: trailColor ?? trailColorDefault },
|
|
2986
|
+
height
|
|
2987
|
+
};
|
|
2988
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2989
|
+
"span",
|
|
2990
|
+
{
|
|
2991
|
+
className: tailwindMerge.twMerge(
|
|
2992
|
+
"flex-1 rounded-full",
|
|
2993
|
+
isFilled ? void 0 : "bg-gray-200 dark:bg-gray-800",
|
|
2994
|
+
status === "active" && isFilled ? "animate-pulse" : void 0
|
|
2995
|
+
),
|
|
2996
|
+
style: resolvedStyle
|
|
2997
|
+
},
|
|
2998
|
+
idx
|
|
2999
|
+
);
|
|
3000
|
+
}) });
|
|
3001
|
+
};
|
|
3002
|
+
var LineProgress = ({
|
|
3003
|
+
percent,
|
|
3004
|
+
status,
|
|
3005
|
+
successPercent,
|
|
3006
|
+
format,
|
|
3007
|
+
showInfo = true,
|
|
3008
|
+
strokeWidth,
|
|
3009
|
+
trailColor,
|
|
3010
|
+
strokeColor,
|
|
3011
|
+
success,
|
|
3012
|
+
size = "default",
|
|
3013
|
+
steps,
|
|
3014
|
+
className,
|
|
3015
|
+
style,
|
|
3016
|
+
...rest
|
|
3017
|
+
}) => {
|
|
3018
|
+
const height = strokeWidth ?? (size === "small" ? 6 : size === "large" ? 12 : 8);
|
|
3019
|
+
const gradientId = buildGradientId(strokeColor);
|
|
3020
|
+
const { color, gradient, cssGradient } = resolveStroke(status, strokeColor, gradientId);
|
|
3021
|
+
const stepStrokeStyle = gradient ? { backgroundImage: cssGradient } : { backgroundColor: color };
|
|
3022
|
+
const lineStyle = {
|
|
3023
|
+
height,
|
|
3024
|
+
backgroundColor: trailColor ?? trailColorDefault
|
|
3025
|
+
};
|
|
3026
|
+
const barStyle = {
|
|
3027
|
+
width: `${percent}%`,
|
|
3028
|
+
height,
|
|
3029
|
+
backgroundColor: color,
|
|
3030
|
+
background: gradient ? cssGradient : color
|
|
3031
|
+
};
|
|
3032
|
+
const successWidth = successPercent ? Math.min(successPercent, percent) : 0;
|
|
3033
|
+
const successColor = success?.strokeColor ?? "rgb(16 185 129)";
|
|
3034
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tailwindMerge.twMerge("flex w-full items-center gap-3", className), style, ...rest, children: [
|
|
3035
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full overflow-hidden rounded-full", style: lineStyle, children: typeof steps === "number" && steps > 1 ? renderSteps(percent, steps, status, stepStrokeStyle, trailColor, height) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3036
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3037
|
+
"div",
|
|
3038
|
+
{
|
|
3039
|
+
className: tailwindMerge.twMerge(
|
|
3040
|
+
"h-full rounded-full transition-[width] duration-300 ease-out",
|
|
3041
|
+
status === "active" ? "animate-pulse" : void 0
|
|
3042
|
+
),
|
|
3043
|
+
style: barStyle
|
|
3044
|
+
}
|
|
3045
|
+
),
|
|
3046
|
+
successWidth > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3047
|
+
"div",
|
|
3048
|
+
{
|
|
3049
|
+
className: "absolute inset-y-0 left-0 rounded-full transition-[width] duration-300 ease-out",
|
|
3050
|
+
style: { width: `${successWidth}%`, height, backgroundColor: successColor }
|
|
3051
|
+
}
|
|
3052
|
+
) : null
|
|
3053
|
+
] }) }),
|
|
3054
|
+
showInfo ? /* @__PURE__ */ jsxRuntime.jsx(InfoNode, { status, percent, successPercent, format }) : null
|
|
3055
|
+
] });
|
|
3056
|
+
};
|
|
3057
|
+
var CircleProgress = ({
|
|
3058
|
+
percent,
|
|
3059
|
+
status,
|
|
3060
|
+
successPercent,
|
|
3061
|
+
format,
|
|
3062
|
+
showInfo = true,
|
|
3063
|
+
strokeWidth,
|
|
3064
|
+
trailColor,
|
|
3065
|
+
strokeColor,
|
|
3066
|
+
success,
|
|
3067
|
+
width = 120,
|
|
3068
|
+
type,
|
|
3069
|
+
gapDegree,
|
|
3070
|
+
gapPosition = "top",
|
|
3071
|
+
className,
|
|
3072
|
+
style,
|
|
3073
|
+
...rest
|
|
3074
|
+
}) => {
|
|
3075
|
+
const stroke = strokeWidth ?? 10;
|
|
3076
|
+
const radius = (width - stroke) / 2;
|
|
3077
|
+
const circumference = 2 * Math.PI * radius;
|
|
3078
|
+
const gap = type === "dashboard" ? gapDegree ?? 75 : gapDegree ?? 0;
|
|
3079
|
+
const perimeter = circumference - gap / 360 * circumference;
|
|
3080
|
+
const dashOffsetBase = gap / 360 * circumference / 2;
|
|
3081
|
+
const dashArray = `${perimeter} ${circumference}`;
|
|
3082
|
+
const gradientId = buildGradientId(strokeColor);
|
|
3083
|
+
const { color, gradient } = resolveStroke(status, strokeColor, gradientId);
|
|
3084
|
+
const rotation = resolveRotation(gapPosition);
|
|
3085
|
+
const successColor = success?.strokeColor ?? "rgb(16 185 129)";
|
|
3086
|
+
const progressDashOffset = (100 - percent) / 100 * perimeter + dashOffsetBase;
|
|
3087
|
+
const successDashOffset = (100 - successPercent) / 100 * perimeter + dashOffsetBase;
|
|
3088
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: tailwindMerge.twMerge("inline-flex flex-col items-center justify-center", className), style, ...rest, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex items-center justify-center", style: { width, height: width }, children: [
|
|
3089
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3090
|
+
"svg",
|
|
3091
|
+
{
|
|
3092
|
+
width,
|
|
3093
|
+
height: width,
|
|
3094
|
+
viewBox: `0 0 ${width} ${width}`,
|
|
3095
|
+
className: "absolute inset-0 overflow-visible",
|
|
3096
|
+
style: { transform: `rotate(${rotation}deg)` },
|
|
3097
|
+
children: [
|
|
3098
|
+
gradient ? /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: gradient.id, x1: "0%", y1: "0%", x2: "100%", y2: "0%", children: [
|
|
3099
|
+
/* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0%", stopColor: gradient.from }),
|
|
3100
|
+
/* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "100%", stopColor: gradient.to })
|
|
3101
|
+
] }) }) : null,
|
|
3102
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3103
|
+
"circle",
|
|
3104
|
+
{
|
|
3105
|
+
cx: width / 2,
|
|
3106
|
+
cy: width / 2,
|
|
3107
|
+
r: radius,
|
|
3108
|
+
strokeWidth: stroke,
|
|
3109
|
+
stroke: trailColor ?? trailColorDefault,
|
|
3110
|
+
fill: "none",
|
|
3111
|
+
strokeDasharray: dashArray,
|
|
3112
|
+
strokeDashoffset: dashOffsetBase,
|
|
3113
|
+
strokeLinecap: "round"
|
|
3114
|
+
}
|
|
3115
|
+
),
|
|
3116
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3117
|
+
"circle",
|
|
3118
|
+
{
|
|
3119
|
+
cx: width / 2,
|
|
3120
|
+
cy: width / 2,
|
|
3121
|
+
r: radius,
|
|
3122
|
+
strokeWidth: stroke,
|
|
3123
|
+
stroke: color,
|
|
3124
|
+
fill: "none",
|
|
3125
|
+
strokeDasharray: dashArray,
|
|
3126
|
+
strokeDashoffset: progressDashOffset,
|
|
3127
|
+
strokeLinecap: "round",
|
|
3128
|
+
className: tailwindMerge.twMerge(status === "active" ? "animate-[spin_3s_linear_infinite]" : void 0)
|
|
3129
|
+
}
|
|
3130
|
+
),
|
|
3131
|
+
successPercent > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3132
|
+
"circle",
|
|
3133
|
+
{
|
|
3134
|
+
cx: width / 2,
|
|
3135
|
+
cy: width / 2,
|
|
3136
|
+
r: radius,
|
|
3137
|
+
strokeWidth: stroke,
|
|
3138
|
+
stroke: successColor,
|
|
3139
|
+
fill: "none",
|
|
3140
|
+
strokeDasharray: dashArray,
|
|
3141
|
+
strokeDashoffset: successDashOffset,
|
|
3142
|
+
strokeLinecap: "round"
|
|
3143
|
+
}
|
|
3144
|
+
) : null
|
|
3145
|
+
]
|
|
3146
|
+
}
|
|
3147
|
+
),
|
|
3148
|
+
showInfo ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm font-semibold text-gray-800 dark:text-gray-100", children: /* @__PURE__ */ jsxRuntime.jsx(InfoNode, { status, percent, successPercent, format }) }) }) : null
|
|
3149
|
+
] }) });
|
|
3150
|
+
};
|
|
3151
|
+
var Progress = (props) => {
|
|
3152
|
+
const toNumber2 = (value) => {
|
|
3153
|
+
if (typeof value === "string") {
|
|
3154
|
+
const parsed = Number.parseFloat(value);
|
|
3155
|
+
return Number.isFinite(parsed) ? parsed : void 0;
|
|
3156
|
+
}
|
|
3157
|
+
return value;
|
|
3158
|
+
};
|
|
3159
|
+
const {
|
|
3160
|
+
percent: rawPercent = 0,
|
|
3161
|
+
success,
|
|
3162
|
+
status: providedStatus,
|
|
3163
|
+
type = "line",
|
|
3164
|
+
showInfo = true,
|
|
3165
|
+
format,
|
|
3166
|
+
strokeWidth,
|
|
3167
|
+
trailColor,
|
|
3168
|
+
strokeColor,
|
|
3169
|
+
width,
|
|
3170
|
+
size,
|
|
3171
|
+
steps,
|
|
3172
|
+
gapDegree,
|
|
3173
|
+
gapPosition,
|
|
3174
|
+
className,
|
|
3175
|
+
style,
|
|
3176
|
+
...restProps
|
|
3177
|
+
} = props;
|
|
3178
|
+
const percent = clampPercent(toNumber2(rawPercent));
|
|
3179
|
+
const successPercent = clampPercent(toNumber2(success?.percent));
|
|
3180
|
+
const status = providedStatus ?? (percent >= 100 ? "success" : "normal");
|
|
3181
|
+
const resolvedClassName = tailwindMerge.twMerge("min-w-[200px]", className);
|
|
3182
|
+
if (type === "circle" || type === "dashboard") {
|
|
3183
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3184
|
+
CircleProgress,
|
|
3185
|
+
{
|
|
3186
|
+
...restProps,
|
|
3187
|
+
type,
|
|
3188
|
+
percent,
|
|
3189
|
+
successPercent,
|
|
3190
|
+
success,
|
|
3191
|
+
status,
|
|
3192
|
+
showInfo,
|
|
3193
|
+
className: resolvedClassName,
|
|
3194
|
+
format,
|
|
3195
|
+
strokeWidth,
|
|
3196
|
+
trailColor,
|
|
3197
|
+
strokeColor,
|
|
3198
|
+
width,
|
|
3199
|
+
gapDegree,
|
|
3200
|
+
gapPosition,
|
|
3201
|
+
style
|
|
3202
|
+
}
|
|
3203
|
+
);
|
|
3204
|
+
}
|
|
3205
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3206
|
+
LineProgress,
|
|
3207
|
+
{
|
|
3208
|
+
percent,
|
|
3209
|
+
successPercent,
|
|
3210
|
+
success,
|
|
3211
|
+
status,
|
|
3212
|
+
showInfo,
|
|
3213
|
+
className: resolvedClassName,
|
|
3214
|
+
format,
|
|
3215
|
+
strokeWidth,
|
|
3216
|
+
trailColor,
|
|
3217
|
+
strokeColor,
|
|
3218
|
+
size,
|
|
3219
|
+
steps,
|
|
3220
|
+
style,
|
|
3221
|
+
...restProps
|
|
3222
|
+
}
|
|
3223
|
+
);
|
|
3224
|
+
};
|
|
3225
|
+
var Progress_default = Progress;
|
|
2579
3226
|
|
|
3227
|
+
exports.AppBar = AppBar_default;
|
|
2580
3228
|
exports.Button = Button_default;
|
|
2581
3229
|
exports.Card = Card_default;
|
|
2582
3230
|
exports.Chip = Chip_default;
|
|
@@ -2590,7 +3238,9 @@ exports.List = List_default;
|
|
|
2590
3238
|
exports.ListItem = Item_default;
|
|
2591
3239
|
exports.Masonry = Masonry_default;
|
|
2592
3240
|
exports.Menu = Menu_default;
|
|
3241
|
+
exports.Notification = Notification_default;
|
|
2593
3242
|
exports.ProfileCard = ProfileCard_default;
|
|
3243
|
+
exports.Progress = Progress_default;
|
|
2594
3244
|
exports.Select = Select_default;
|
|
2595
3245
|
exports.Slider = Slider_default;
|
|
2596
3246
|
exports.Switch = Switch_default;
|