@invana/ui 0.0.5 → 0.0.7
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.cjs +78 -117
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +51 -55
- package/dist/index.d.ts +51 -55
- package/dist/index.js +78 -118
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -154,12 +154,12 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
154
154
|
{
|
|
155
155
|
variants: {
|
|
156
156
|
variant: {
|
|
157
|
-
default: "bg-primary text-primary-foreground shadow ring-1 ring-primary/30 hover:ring-primary/50 hover:shadow-lg active:bg-primary",
|
|
158
|
-
destructive: "bg-destructive text-destructive-foreground shadow-sm ring-1 ring-destructive/40 hover:ring-destructive/60 active:bg-destructive/70",
|
|
159
|
-
outline: "bg-background shadow-sm ring-1 ring-border hover:bg-
|
|
160
|
-
secondary: "bg-secondary text-secondary-foreground shadow-sm ring-1 ring-border hover:bg-secondary/80 hover:ring-
|
|
161
|
-
ghost: "ring-1 ring-transparent hover:bg-
|
|
162
|
-
soft: "bg-primary/10 text-primary ring-1 ring-primary/30 shadow-sm hover:bg-primary/20 active:bg-primary/25",
|
|
157
|
+
default: "bg-[hsl(var(--primary)_/_var(--surface-alpha))] glassable text-primary-foreground shadow ring-1 ring-primary/30 hover:ring-primary/50 hover:shadow-lg active:bg-[hsl(var(--primary)_/_var(--surface-alpha))]",
|
|
158
|
+
destructive: "bg-[hsl(var(--destructive)_/_var(--surface-alpha))] glassable text-destructive-foreground shadow-sm ring-1 ring-destructive/40 hover:ring-destructive/60 active:bg-destructive/70",
|
|
159
|
+
outline: "bg-[hsl(var(--background)_/_var(--surface-alpha))] glassable shadow-sm ring-1 ring-border hover:bg-[hsl(var(--accent)_/_var(--surface-alpha))] hover:text-accent-foreground active:bg-[hsl(var(--accent)_/_var(--surface-alpha))]",
|
|
160
|
+
secondary: "bg-[hsl(var(--secondary)_/_var(--surface-alpha))] glassable text-secondary-foreground shadow-sm ring-1 ring-border hover:bg-secondary/80 hover:ring-border active:bg-secondary/60",
|
|
161
|
+
ghost: "ring-1 ring-transparent hover:bg-[hsl(var(--accent)_/_var(--surface-alpha))] hover:text-accent-foreground active:bg-[hsl(var(--accent)_/_var(--surface-alpha))]",
|
|
162
|
+
soft: "bg-primary/10 glassable text-primary ring-1 ring-primary/30 shadow-sm hover:bg-primary/20 active:bg-primary/25",
|
|
163
163
|
link: "text-primary underline-offset-4 hover:underline hover:text-primary/80 active:text-primary/60"
|
|
164
164
|
},
|
|
165
165
|
size: {
|
|
@@ -2746,6 +2746,75 @@ var MenuItem = ({
|
|
|
2746
2746
|
)
|
|
2747
2747
|
] });
|
|
2748
2748
|
};
|
|
2749
|
+
var NavItems = ({
|
|
2750
|
+
items,
|
|
2751
|
+
orientation = "horizontal",
|
|
2752
|
+
tooltipSide = orientation === "vertical" ? "right" : "bottom",
|
|
2753
|
+
iconClassName = orientation === "vertical" ? "w-5 h-5" : "w-4 h-4 flex-shrink-0"
|
|
2754
|
+
}) => {
|
|
2755
|
+
const isVertical = orientation === "vertical";
|
|
2756
|
+
const [activeItem, setActiveItem] = React23__namespace.default.useState(null);
|
|
2757
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: items.map((item) => {
|
|
2758
|
+
const isActive = activeItem === item.name;
|
|
2759
|
+
const padding = item.label ? "px-3 py-1.5" : "px-2 py-2";
|
|
2760
|
+
const itemClass = `inline-flex border-0 items-center justify-center gap-2
|
|
2761
|
+
whitespace-nowrap rounded-md cursor-pointer transition-colors
|
|
2762
|
+
ring-1 ring-transparent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring
|
|
2763
|
+
${padding}
|
|
2764
|
+
hover:bg-primary/10 hover:text-primary hover:ring-primary/25
|
|
2765
|
+
${isActive ? `bg-primary/15 text-primary ring-primary/25 ${item.activeClass || ""}` : ""}
|
|
2766
|
+
${item.className || ""}`;
|
|
2767
|
+
const icon = /* @__PURE__ */ jsxRuntime.jsx(
|
|
2768
|
+
item.icon,
|
|
2769
|
+
{
|
|
2770
|
+
strokeWidth: item.iconStroke || 2,
|
|
2771
|
+
className: item.iconClassName || iconClassName
|
|
2772
|
+
}
|
|
2773
|
+
);
|
|
2774
|
+
const label = item.label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm", children: item.label });
|
|
2775
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React23__namespace.default.Fragment, { children: [
|
|
2776
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
2777
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: item.href ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2778
|
+
"a",
|
|
2779
|
+
{
|
|
2780
|
+
href: item.href,
|
|
2781
|
+
onClick: () => setActiveItem(item.name),
|
|
2782
|
+
className: itemClass,
|
|
2783
|
+
children: [
|
|
2784
|
+
icon,
|
|
2785
|
+
label
|
|
2786
|
+
]
|
|
2787
|
+
}
|
|
2788
|
+
) : item.onClick ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2789
|
+
"button",
|
|
2790
|
+
{
|
|
2791
|
+
type: "button",
|
|
2792
|
+
onClick: () => {
|
|
2793
|
+
item.onClick?.();
|
|
2794
|
+
setActiveItem(isActive ? null : item.name);
|
|
2795
|
+
},
|
|
2796
|
+
className: itemClass,
|
|
2797
|
+
children: [
|
|
2798
|
+
icon,
|
|
2799
|
+
label
|
|
2800
|
+
]
|
|
2801
|
+
}
|
|
2802
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: itemClass, children: [
|
|
2803
|
+
icon,
|
|
2804
|
+
label
|
|
2805
|
+
] }) }),
|
|
2806
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { side: item.tooltipSide || tooltipSide, children: item.tooltip || item.name })
|
|
2807
|
+
] }),
|
|
2808
|
+
item.showSeperator && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2809
|
+
Separator,
|
|
2810
|
+
{
|
|
2811
|
+
orientation: isVertical ? "horizontal" : "vertical",
|
|
2812
|
+
className: isVertical ? "" : "h-4"
|
|
2813
|
+
}
|
|
2814
|
+
)
|
|
2815
|
+
] }, item.key || item.name);
|
|
2816
|
+
}) });
|
|
2817
|
+
};
|
|
2749
2818
|
var NavBase = ({ className = "", orientation, sections }) => {
|
|
2750
2819
|
const isVertical = orientation === "vertical";
|
|
2751
2820
|
const containerClass = isVertical ? `flex flex-col items-center h-full ${className}` : `flex items-center w-full ${className}`;
|
|
@@ -2759,75 +2828,7 @@ var NavBase = ({ className = "", orientation, sections }) => {
|
|
|
2759
2828
|
sections.end?.content && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${sectionWrapperClass} ${isVertical ? "" : "ml-auto"} ${sections.end.className || ""}`, children: sections.end.content })
|
|
2760
2829
|
] });
|
|
2761
2830
|
};
|
|
2762
|
-
var NavHorizontalItems = ({ items }) => {
|
|
2763
|
-
const [activeItem, setActiveItem] = React23__namespace.default.useState(null);
|
|
2764
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(React23__namespace.default.Fragment, { children: [
|
|
2765
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
2766
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: item.href ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2767
|
-
"a",
|
|
2768
|
-
{
|
|
2769
|
-
href: item.href,
|
|
2770
|
-
onClick: () => setActiveItem(item.name),
|
|
2771
|
-
className: `flex border-0 items-center justify-center gap-2
|
|
2772
|
-
transition-colors rounded-md h-full whitespace-nowrap
|
|
2773
|
-
hover:bg-muted hover:text-foreground ${item.label ? "px-3" : "px-2"} ${item.className || ""}
|
|
2774
|
-
${activeItem === item.name ? "bg-primary/15 text-primary ring-1 ring-primary/25" : ""}`,
|
|
2775
|
-
children: [
|
|
2776
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2777
|
-
item.icon,
|
|
2778
|
-
{
|
|
2779
|
-
strokeWidth: item.iconStroke || 2,
|
|
2780
|
-
className: item.iconClassName || "w-4 h-4 flex-shrink-0"
|
|
2781
|
-
}
|
|
2782
|
-
),
|
|
2783
|
-
item.label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm", children: item.label })
|
|
2784
|
-
]
|
|
2785
|
-
}
|
|
2786
|
-
) : item.onClick ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2787
|
-
Button,
|
|
2788
|
-
{
|
|
2789
|
-
size: item.label ? "sm" : "icon",
|
|
2790
|
-
variant: "ghost",
|
|
2791
|
-
onClick: () => {
|
|
2792
|
-
if (item.onClick) item.onClick();
|
|
2793
|
-
setActiveItem(item.name === activeItem ? null : item.name);
|
|
2794
|
-
},
|
|
2795
|
-
className: `h-full gap-2 whitespace-nowrap ${item.label ? "w-auto px-3" : ""} ${item.className || ""}
|
|
2796
|
-
${activeItem === item.name ? ` ${item?.activeClass || ""}` : ""}`,
|
|
2797
|
-
children: [
|
|
2798
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2799
|
-
item.icon,
|
|
2800
|
-
{
|
|
2801
|
-
strokeWidth: item.iconStroke || 2,
|
|
2802
|
-
className: item.iconClassName || "w-4 h-4 flex-shrink-0"
|
|
2803
|
-
}
|
|
2804
|
-
),
|
|
2805
|
-
item.label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm", children: item.label })
|
|
2806
|
-
]
|
|
2807
|
-
}
|
|
2808
|
-
) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2809
|
-
"div",
|
|
2810
|
-
{
|
|
2811
|
-
className: `flex border-0 items-center justify-center gap-2 h-full whitespace-nowrap
|
|
2812
|
-
transition-colors rounded-md ${item.label ? "px-3" : "px-2"} ${item.className || ""}
|
|
2813
|
-
${activeItem === item.name ? "bg-primary/15 text-primary ring-1 ring-primary/25" : ""}`,
|
|
2814
|
-
children: [
|
|
2815
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2816
|
-
item.icon,
|
|
2817
|
-
{
|
|
2818
|
-
strokeWidth: item.iconStroke || 2,
|
|
2819
|
-
className: item.iconClassName || "w-4 h-4 flex-shrink-0"
|
|
2820
|
-
}
|
|
2821
|
-
),
|
|
2822
|
-
item.label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm", children: item.label })
|
|
2823
|
-
]
|
|
2824
|
-
}
|
|
2825
|
-
) }),
|
|
2826
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { side: item.tooltipSide || "bottom", children: item.tooltip || item.name })
|
|
2827
|
-
] }),
|
|
2828
|
-
item.showSeperator && /* @__PURE__ */ jsxRuntime.jsx(Separator, { orientation: "vertical", className: "h-4" })
|
|
2829
|
-
] }, item.key || item.name)) });
|
|
2830
|
-
};
|
|
2831
|
+
var NavHorizontalItems = ({ items }) => /* @__PURE__ */ jsxRuntime.jsx(NavItems, { items, orientation: "horizontal" });
|
|
2831
2832
|
var NavHorizontal = ({
|
|
2832
2833
|
left,
|
|
2833
2834
|
leftNavItems,
|
|
@@ -2866,48 +2867,7 @@ var NavHorizontal = ({
|
|
|
2866
2867
|
}
|
|
2867
2868
|
);
|
|
2868
2869
|
};
|
|
2869
|
-
var NavVerticalItems = ({ items }) => {
|
|
2870
|
-
const [activeItem, setActiveItem] = React23__namespace.default.useState(null);
|
|
2871
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(React23__namespace.default.Fragment, { children: [
|
|
2872
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
|
|
2873
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipTrigger, { asChild: true, children: item.href ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2874
|
-
"a",
|
|
2875
|
-
{
|
|
2876
|
-
href: item.href,
|
|
2877
|
-
onClick: () => setActiveItem(item.name),
|
|
2878
|
-
className: ` flex border-0 items-center justify-center
|
|
2879
|
-
transition-colors rounded-md
|
|
2880
|
-
hover:text-primary/80 px-2 py-2 ${item.className || ""}
|
|
2881
|
-
${activeItem === item.name ? "bg-accent text-accent-foreground" : ""}`,
|
|
2882
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(item.icon, { strokeWidth: item.iconStroke ? item.iconStroke : 2, className: item.iconClassName ? item.iconClassName : "w-5 h-5" })
|
|
2883
|
-
}
|
|
2884
|
-
) : item.onClick ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2885
|
-
Button,
|
|
2886
|
-
{
|
|
2887
|
-
size: "nav-icon",
|
|
2888
|
-
variant: "ghost",
|
|
2889
|
-
onClick: () => {
|
|
2890
|
-
if (item.onClick) item.onClick();
|
|
2891
|
-
setActiveItem(item.name === activeItem ? null : item.name);
|
|
2892
|
-
},
|
|
2893
|
-
className: `${item.className || ""}
|
|
2894
|
-
${activeItem === item.name ? ` ${item?.activeClass || ""}` : ""}`,
|
|
2895
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(item.icon, { strokeWidth: item.iconStroke ? item.iconStroke : 2, className: item.iconClassName ? item.iconClassName : "w-5 h-5" })
|
|
2896
|
-
}
|
|
2897
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2898
|
-
"div",
|
|
2899
|
-
{
|
|
2900
|
-
className: ` flex border-0 items-center justify-center
|
|
2901
|
-
transition-colors rounded-md px-2 py-2 ${item.className || ""}
|
|
2902
|
-
${activeItem === item.name ? "bg-accent text-accent-foreground" : ""}`,
|
|
2903
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(item.icon, { strokeWidth: item.iconStroke ? item.iconStroke : 2, className: item.iconClassName ? item.iconClassName : "w-5 h-5" })
|
|
2904
|
-
}
|
|
2905
|
-
) }),
|
|
2906
|
-
/* @__PURE__ */ jsxRuntime.jsx(TooltipContent, { side: item.tooltipSide ? item.tooltipSide : "right", children: item.tooltip || item.name })
|
|
2907
|
-
] }, item.name),
|
|
2908
|
-
item.showSeperator && /* @__PURE__ */ jsxRuntime.jsx(Separator, {})
|
|
2909
|
-
] }, item.name)) });
|
|
2910
|
-
};
|
|
2870
|
+
var NavVerticalItems = ({ items }) => /* @__PURE__ */ jsxRuntime.jsx(NavItems, { items, orientation: "vertical" });
|
|
2911
2871
|
var NavVertical = ({
|
|
2912
2872
|
className = "",
|
|
2913
2873
|
top,
|
|
@@ -3877,6 +3837,7 @@ exports.MenubarTrigger = MenubarTrigger;
|
|
|
3877
3837
|
exports.NavBase = NavBase;
|
|
3878
3838
|
exports.NavHorizontal = NavHorizontal;
|
|
3879
3839
|
exports.NavHorizontalItems = NavHorizontalItems;
|
|
3840
|
+
exports.NavItems = NavItems;
|
|
3880
3841
|
exports.NavVertical = NavVertical;
|
|
3881
3842
|
exports.NavVerticalItems = NavVerticalItems;
|
|
3882
3843
|
exports.NavigationMenu = NavigationMenu;
|