@axzydev/axzy_ui_system 1.4.2 → 1.4.4
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 +322 -211
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.cts +143 -69
- package/dist/index.d.ts +143 -69
- package/dist/index.js +224 -114
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/card/card.tsx +22 -9
- package/src/components/organisms/page-header/page-header.tsx +14 -3
- package/src/components/organisms/sidebar/sidebar.doc.mdx +2 -0
- package/src/components/organisms/sidebar/sidebar.props.ts +30 -2
- package/src/components/organisms/sidebar/sidebar.tsx +77 -26
- package/src/components/organisms/topbar/topbar.props.ts +13 -0
- package/src/components/organisms/topbar/topbar.tsx +35 -9
- package/src/components/templates/layout/layout.props.ts +8 -0
- package/src/components/templates/layout/layout.tsx +111 -54
- package/src/components/theme-provider/themeProvider.doc.mdx +1 -0
- package/src/components/theme-provider/themeProvider.props.ts +6 -0
- package/src/components/theme-provider/themeProvider.tsx +11 -1
- package/src/index.ts +6 -6
- package/src/theme/theme-context.ts +11 -1
- package/src/theme/theme.types.ts +7 -0
package/dist/index.js
CHANGED
|
@@ -1809,6 +1809,25 @@ var calendar_default = ITCalendar;
|
|
|
1809
1809
|
// src/components/molecules/card/card.tsx
|
|
1810
1810
|
import clsx8 from "clsx";
|
|
1811
1811
|
import { useState as useState8 } from "react";
|
|
1812
|
+
|
|
1813
|
+
// src/theme/theme-context.ts
|
|
1814
|
+
import { createContext, useContext } from "react";
|
|
1815
|
+
var ITThemeContext = createContext(void 0);
|
|
1816
|
+
var useITTheme = () => {
|
|
1817
|
+
const context = useContext(ITThemeContext);
|
|
1818
|
+
if (!context) {
|
|
1819
|
+
throw new Error("useITTheme must be used within an ITThemeProvider");
|
|
1820
|
+
}
|
|
1821
|
+
return context;
|
|
1822
|
+
};
|
|
1823
|
+
var useITThemeSafe = () => {
|
|
1824
|
+
return useContext(ITThemeContext);
|
|
1825
|
+
};
|
|
1826
|
+
var useITFlatAppearance = () => {
|
|
1827
|
+
return useContext(ITThemeContext)?.appearance === "flat";
|
|
1828
|
+
};
|
|
1829
|
+
|
|
1830
|
+
// src/components/molecules/card/card.tsx
|
|
1812
1831
|
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1813
1832
|
function ITCard({
|
|
1814
1833
|
title,
|
|
@@ -1824,16 +1843,20 @@ function ITCard({
|
|
|
1824
1843
|
onClick
|
|
1825
1844
|
}) {
|
|
1826
1845
|
const [isHovered, setIsHovered] = useState8(false);
|
|
1846
|
+
const flat = useITFlatAppearance();
|
|
1827
1847
|
const containerStyle = {
|
|
1828
1848
|
backgroundColor: "var(--it-card-bg, #ffffff)",
|
|
1829
|
-
borderColor: "var(--it-card-border, rgba(15, 23, 42, 0.06))",
|
|
1849
|
+
borderColor: flat ? "var(--it-card-flat-border, var(--color-secondary-200))" : "var(--it-card-border, rgba(15, 23, 42, 0.06))",
|
|
1830
1850
|
borderWidth: "1px",
|
|
1831
|
-
|
|
1851
|
+
borderStyle: "solid",
|
|
1852
|
+
borderRadius: flat ? "var(--it-card-radius, var(--radius-lg))" : "var(--it-card-radius, var(--radius-2xl))",
|
|
1832
1853
|
// Soft depth: every card floats a little at rest; interactive cards
|
|
1833
1854
|
// gain visual weight on hover instead of appearing flat until clicked.
|
|
1834
|
-
|
|
1855
|
+
// Flat appearance: the hairline border carries the surface, so a card
|
|
1856
|
+
// only gets a shadow as hover feedback when it is clickable.
|
|
1857
|
+
boxShadow: flat ? onClick && isHovered ? "var(--shadow-sm)" : "none" : onClick ? isHovered ? "var(--shadow-lg)" : "var(--shadow-sm)" : "var(--shadow-sm)",
|
|
1835
1858
|
transition: onClick ? "box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out" : "none",
|
|
1836
|
-
transform: onClick && isHovered ? "translateY(-2px)" : "translateY(0)",
|
|
1859
|
+
transform: onClick && isHovered && !flat ? "translateY(-2px)" : "translateY(0)",
|
|
1837
1860
|
cursor: onClick ? "pointer" : "default"
|
|
1838
1861
|
};
|
|
1839
1862
|
const bodyStyle = {
|
|
@@ -1861,7 +1884,7 @@ function ITCard({
|
|
|
1861
1884
|
ITText,
|
|
1862
1885
|
{
|
|
1863
1886
|
as: "h3",
|
|
1864
|
-
className: clsx8("text-xl font-semibold mb-2", titleClassName),
|
|
1887
|
+
className: clsx8(flat ? "text-base font-semibold mb-3" : "text-xl font-semibold mb-2", titleClassName),
|
|
1865
1888
|
children: title
|
|
1866
1889
|
}
|
|
1867
1890
|
),
|
|
@@ -4940,20 +4963,6 @@ import { FaRegTimesCircle } from "react-icons/fa";
|
|
|
4940
4963
|
// src/components/molecules/form-header/form-header.tsx
|
|
4941
4964
|
import { FaTimes as FaTimes6 } from "react-icons/fa";
|
|
4942
4965
|
|
|
4943
|
-
// src/theme/theme-context.ts
|
|
4944
|
-
import { createContext, useContext } from "react";
|
|
4945
|
-
var ITThemeContext = createContext(void 0);
|
|
4946
|
-
var useITTheme = () => {
|
|
4947
|
-
const context = useContext(ITThemeContext);
|
|
4948
|
-
if (!context) {
|
|
4949
|
-
throw new Error("useITTheme must be used within an ITThemeProvider");
|
|
4950
|
-
}
|
|
4951
|
-
return context;
|
|
4952
|
-
};
|
|
4953
|
-
var useITThemeSafe = () => {
|
|
4954
|
-
return useContext(ITThemeContext);
|
|
4955
|
-
};
|
|
4956
|
-
|
|
4957
4966
|
// src/utils/color.utils.ts
|
|
4958
4967
|
var isLightColor = (hex) => {
|
|
4959
4968
|
if (!hex || typeof hex !== "string") return false;
|
|
@@ -6519,6 +6528,7 @@ function ITPageHeader({
|
|
|
6519
6528
|
className
|
|
6520
6529
|
}) {
|
|
6521
6530
|
const showTopRow = breadcrumbs?.length || backAction;
|
|
6531
|
+
const flat = useITFlatAppearance();
|
|
6522
6532
|
return /* @__PURE__ */ jsxs29("div", { className: `${className} space-y-3`, children: [
|
|
6523
6533
|
showTopRow && /* @__PURE__ */ jsxs29("div", { className: "flex items-center justify-between gap-4", children: [
|
|
6524
6534
|
/* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
@@ -6537,7 +6547,7 @@ function ITPageHeader({
|
|
|
6537
6547
|
] }),
|
|
6538
6548
|
/* @__PURE__ */ jsxs29("div", { className: "flex items-start justify-between gap-6", children: [
|
|
6539
6549
|
/* @__PURE__ */ jsxs29("div", { className: "flex items-start gap-4 min-w-0", children: [
|
|
6540
|
-
icon && /* @__PURE__ */ jsx38(
|
|
6550
|
+
icon && !flat && /* @__PURE__ */ jsx38(
|
|
6541
6551
|
"div",
|
|
6542
6552
|
{
|
|
6543
6553
|
className: "flex items-center justify-center w-12 h-12 rounded-full border border-slate-200 dark:border-slate-700 bg-slate-50/50 dark:bg-slate-800/50 text-slate-600 dark:text-slate-300 flex-shrink-0 transition-all duration-200 hover:border-slate-300 dark:hover:border-slate-500 hover:shadow-sm",
|
|
@@ -6550,7 +6560,7 @@ function ITPageHeader({
|
|
|
6550
6560
|
ITText,
|
|
6551
6561
|
{
|
|
6552
6562
|
as: "h1",
|
|
6553
|
-
className: "text-3xl font-bold text-slate-800 dark:text-white tracking-tight leading-tight",
|
|
6563
|
+
className: flat ? "text-[1.625rem] font-bold text-slate-900 dark:text-white tracking-tight leading-tight" : "text-3xl font-bold text-slate-800 dark:text-white tracking-tight leading-tight",
|
|
6554
6564
|
children: title
|
|
6555
6565
|
}
|
|
6556
6566
|
),
|
|
@@ -6558,7 +6568,7 @@ function ITPageHeader({
|
|
|
6558
6568
|
ITText,
|
|
6559
6569
|
{
|
|
6560
6570
|
as: "p",
|
|
6561
|
-
className: "text-sm font-light text-slate-500 dark:text-slate-400 mt-1 leading-relaxed",
|
|
6571
|
+
className: flat ? "text-sm font-normal text-slate-500 dark:text-slate-400 mt-0.5 leading-relaxed" : "text-sm font-light text-slate-500 dark:text-slate-400 mt-1 leading-relaxed",
|
|
6562
6572
|
children: description
|
|
6563
6573
|
}
|
|
6564
6574
|
)
|
|
@@ -7595,8 +7605,12 @@ function ITSidebar({
|
|
|
7595
7605
|
onSubItemClick,
|
|
7596
7606
|
subitemConnector = "dot",
|
|
7597
7607
|
header,
|
|
7598
|
-
notification
|
|
7608
|
+
notification,
|
|
7609
|
+
brand,
|
|
7610
|
+
onToggleCollapse,
|
|
7611
|
+
expandOnHover = true
|
|
7599
7612
|
}) {
|
|
7613
|
+
const flat = useITFlatAppearance();
|
|
7600
7614
|
const [expandedItems, setExpandedItems] = useState27(/* @__PURE__ */ new Set());
|
|
7601
7615
|
const [isHovering, setIsHovering] = useState27(false);
|
|
7602
7616
|
const sidebarRef = useRef20(null);
|
|
@@ -7650,6 +7664,9 @@ function ITSidebar({
|
|
|
7650
7664
|
});
|
|
7651
7665
|
}
|
|
7652
7666
|
}, [navigationItems]);
|
|
7667
|
+
const isSidebarCollapsed = visibleOnMobile ? false : isCollapsed && !(expandOnHover && isHovering);
|
|
7668
|
+
const sidebarWidth = isSidebarCollapsed ? flat ? "w-[72px]" : "w-[88px]" : flat ? "w-[248px]" : "w-[280px]";
|
|
7669
|
+
const fixedRail = isSidebarCollapsed && !expandOnHover;
|
|
7653
7670
|
const toggleExpanded = (itemId) => {
|
|
7654
7671
|
const newExpanded = new Set(expandedItems);
|
|
7655
7672
|
if (newExpanded.has(itemId)) newExpanded.delete(itemId);
|
|
@@ -7658,14 +7675,17 @@ function ITSidebar({
|
|
|
7658
7675
|
};
|
|
7659
7676
|
const handleItemClick = (item) => {
|
|
7660
7677
|
if (item.subitems && item.subitems.length > 0) {
|
|
7661
|
-
|
|
7678
|
+
if (isSidebarCollapsed && !expandOnHover) {
|
|
7679
|
+
setExpandedItems((prev) => new Set(prev).add(item.id));
|
|
7680
|
+
onToggleCollapse?.();
|
|
7681
|
+
} else {
|
|
7682
|
+
toggleExpanded(item.id);
|
|
7683
|
+
}
|
|
7662
7684
|
} else {
|
|
7663
7685
|
if (item.action) item.action();
|
|
7664
7686
|
if (onItemClick) onItemClick(item);
|
|
7665
7687
|
}
|
|
7666
7688
|
};
|
|
7667
|
-
const isSidebarCollapsed = visibleOnMobile ? false : !isHovering && isCollapsed;
|
|
7668
|
-
const sidebarWidth = isSidebarCollapsed ? "w-[88px]" : "w-[280px]";
|
|
7669
7689
|
const renderSubItem = (subitem) => /* @__PURE__ */ jsx56("li", { className: "relative", children: /* @__PURE__ */ jsxs43(
|
|
7670
7690
|
"button",
|
|
7671
7691
|
{
|
|
@@ -7678,7 +7698,7 @@ function ITSidebar({
|
|
|
7678
7698
|
style: {
|
|
7679
7699
|
color: subitem.isActive ? "var(--it-sidebar-active-color, var(--color-secondary-900))" : "var(--it-sidebar-label-color, var(--color-secondary-600))",
|
|
7680
7700
|
backgroundColor: subitem.isActive ? "var(--it-sidebar-active-bg, var(--color-secondary-50))" : "transparent",
|
|
7681
|
-
fontSize: "0.78rem",
|
|
7701
|
+
fontSize: flat ? "0.84rem" : "0.78rem",
|
|
7682
7702
|
fontWeight: subitem.isActive ? 600 : 500,
|
|
7683
7703
|
letterSpacing: "0.01em",
|
|
7684
7704
|
marginLeft: subitemConnector === "|" ? "-1px" : "0"
|
|
@@ -7696,7 +7716,7 @@ function ITSidebar({
|
|
|
7696
7716
|
}
|
|
7697
7717
|
},
|
|
7698
7718
|
children: [
|
|
7699
|
-
subitem.isActive && subitemConnector === "|" && /* @__PURE__ */ jsx56(
|
|
7719
|
+
subitem.isActive && subitemConnector === "|" && !flat && /* @__PURE__ */ jsx56(
|
|
7700
7720
|
"div",
|
|
7701
7721
|
{
|
|
7702
7722
|
className: "absolute left-0 top-1/3 bottom-1/3 w-[2.5px] rounded-r-full transition-all",
|
|
@@ -7831,22 +7851,40 @@ function ITSidebar({
|
|
|
7831
7851
|
${sidebarWidth}
|
|
7832
7852
|
${className}
|
|
7833
7853
|
${!visibleOnMobile ? "hidden lg:flex" : "flex"}
|
|
7834
|
-
shadow-[4px_0_32px_rgba(15,23,42,0.04)]
|
|
7854
|
+
${flat ? "" : "shadow-[4px_0_32px_rgba(15,23,42,0.04)]"}
|
|
7835
7855
|
`,
|
|
7836
7856
|
style: {
|
|
7837
7857
|
zIndex: 50,
|
|
7838
7858
|
backgroundColor: "var(--it-sidebar-bg, rgba(255, 255, 255, 0.90))",
|
|
7839
7859
|
borderRight: "1px solid var(--it-sidebar-border, var(--color-secondary-200))",
|
|
7840
|
-
WebkitBackdropFilter: "blur(12px)",
|
|
7841
|
-
backdropFilter: "blur(12px)"
|
|
7860
|
+
...flat ? {} : { WebkitBackdropFilter: "blur(12px)", backdropFilter: "blur(12px)" }
|
|
7842
7861
|
},
|
|
7843
7862
|
children: [
|
|
7863
|
+
brand && (brand.logo || brand.text) && /* @__PURE__ */ jsxs43(
|
|
7864
|
+
"div",
|
|
7865
|
+
{
|
|
7866
|
+
className: `flex items-center flex-shrink-0 h-[64px] ${isSidebarCollapsed ? "justify-center px-2" : "gap-2.5 px-7"}`,
|
|
7867
|
+
children: [
|
|
7868
|
+
brand.logo && /* @__PURE__ */ jsx56("div", { className: "flex-shrink-0 flex items-center", children: brand.logo }),
|
|
7869
|
+
brand.text && !isSidebarCollapsed && /* @__PURE__ */ jsx56(
|
|
7870
|
+
ITText,
|
|
7871
|
+
{
|
|
7872
|
+
as: "span",
|
|
7873
|
+
className: "text-[1.05rem] font-bold tracking-tight truncate",
|
|
7874
|
+
style: { color: "var(--it-sidebar-brand-color, var(--it-sidebar-label-color, var(--color-secondary-900)))" },
|
|
7875
|
+
children: brand.text
|
|
7876
|
+
}
|
|
7877
|
+
)
|
|
7878
|
+
]
|
|
7879
|
+
}
|
|
7880
|
+
),
|
|
7844
7881
|
header && !isSidebarCollapsed && /* @__PURE__ */ jsx56("div", { className: "px-4 pt-4 pb-1 flex-shrink-0", children: header }),
|
|
7845
7882
|
notification && /* @__PURE__ */ jsx56("div", { className: "px-4 pt-3 flex-shrink-0", children: renderNotification() }),
|
|
7846
|
-
/* @__PURE__ */ jsx56("nav", { "aria-label": "Componentes de la librer\xEDa", className:
|
|
7883
|
+
/* @__PURE__ */ jsx56("nav", { "aria-label": "Componentes de la librer\xEDa", className: `flex-1 py-4 custom-scrollbar ${fixedRail ? "overflow-visible" : "overflow-y-auto overflow-x-hidden"} ${flat && isSidebarCollapsed ? "px-3" : "px-4"}`, children: /* @__PURE__ */ jsx56("ul", { className: "space-y-1", children: navigationItems.map((item) => {
|
|
7847
7884
|
const hasSubmenu = !!item.subitems && item.subitems.length > 0;
|
|
7848
7885
|
const submenuId = `it-sidebar-submenu-${item.id}`;
|
|
7849
7886
|
const { className: badgeClassName, ...badgeRest } = item.badgeProps ?? {};
|
|
7887
|
+
const active = !!item.isActive && !(flat && hasSubmenu && !isSidebarCollapsed);
|
|
7850
7888
|
return /* @__PURE__ */ jsxs43("li", { className: "relative group/navitem", children: [
|
|
7851
7889
|
/* @__PURE__ */ jsxs43(
|
|
7852
7890
|
"div",
|
|
@@ -7859,18 +7897,18 @@ function ITSidebar({
|
|
|
7859
7897
|
className: `flex items-center cursor-pointer
|
|
7860
7898
|
transition-all duration-300 ease-[cubic-bezier(0.2,0,0,1)]
|
|
7861
7899
|
rounded-xl relative overflow-visible
|
|
7862
|
-
${isSidebarCollapsed ? "justify-center p-2 mb-1" : "justify-between px-3 py-2 mb-0.5"}
|
|
7900
|
+
${isSidebarCollapsed ? flat ? "justify-center h-10 mb-1" : "justify-center p-2 mb-1" : "justify-between px-3 py-2 mb-0.5"}
|
|
7863
7901
|
`,
|
|
7864
7902
|
style: {
|
|
7865
|
-
backgroundColor:
|
|
7866
|
-
boxShadow:
|
|
7867
|
-
border:
|
|
7903
|
+
backgroundColor: active ? "var(--it-sidebar-active-bg, var(--color-secondary-50))" : "transparent",
|
|
7904
|
+
boxShadow: active && !flat ? "var(--shadow-xs)" : "none",
|
|
7905
|
+
border: active && !flat ? "1px solid var(--it-sidebar-border, var(--color-secondary-200))" : "1px solid transparent"
|
|
7868
7906
|
},
|
|
7869
7907
|
onMouseEnter: (e) => {
|
|
7870
|
-
if (!
|
|
7908
|
+
if (!active) e.currentTarget.style.backgroundColor = "var(--it-sidebar-hover-bg, var(--color-secondary-100))";
|
|
7871
7909
|
},
|
|
7872
7910
|
onMouseLeave: (e) => {
|
|
7873
|
-
if (!
|
|
7911
|
+
if (!active) e.currentTarget.style.backgroundColor = "transparent";
|
|
7874
7912
|
},
|
|
7875
7913
|
onClick: () => handleItemClick(item),
|
|
7876
7914
|
onKeyDown: (e) => {
|
|
@@ -7880,7 +7918,7 @@ function ITSidebar({
|
|
|
7880
7918
|
}
|
|
7881
7919
|
},
|
|
7882
7920
|
children: [
|
|
7883
|
-
|
|
7921
|
+
active && !isSidebarCollapsed && !flat && /* @__PURE__ */ jsx56(
|
|
7884
7922
|
"div",
|
|
7885
7923
|
{
|
|
7886
7924
|
className: "absolute left-0 top-1/4 bottom-1/4 w-[3px] rounded-r-full transition-all",
|
|
@@ -7893,10 +7931,10 @@ function ITSidebar({
|
|
|
7893
7931
|
{
|
|
7894
7932
|
className: `transition-all duration-300 flex-shrink-0 flex items-center justify-center`,
|
|
7895
7933
|
style: {
|
|
7896
|
-
color:
|
|
7897
|
-
opacity:
|
|
7898
|
-
fontSize:
|
|
7899
|
-
filter:
|
|
7934
|
+
color: active ? "var(--it-sidebar-active-icon, var(--color-primary-500))" : "var(--it-sidebar-icon-color, #9ca3af)",
|
|
7935
|
+
opacity: active ? 1 : 0.8,
|
|
7936
|
+
fontSize: flat ? "1rem" : active ? "1.12rem" : "1.05rem",
|
|
7937
|
+
filter: active && !flat ? "drop-shadow(0 0 8px rgba(255,255,255,0.2))" : "none"
|
|
7900
7938
|
},
|
|
7901
7939
|
children: item.icon
|
|
7902
7940
|
}
|
|
@@ -7907,9 +7945,9 @@ function ITSidebar({
|
|
|
7907
7945
|
as: "span",
|
|
7908
7946
|
className: `transition-all duration-300 truncate tracking-wide`,
|
|
7909
7947
|
style: {
|
|
7910
|
-
color:
|
|
7911
|
-
fontSize: "0.8rem",
|
|
7912
|
-
fontWeight:
|
|
7948
|
+
color: active ? "var(--it-sidebar-active-color, #ffffff)" : "var(--it-sidebar-label-color, var(--color-secondary-300))",
|
|
7949
|
+
fontSize: flat ? "0.875rem" : "0.8rem",
|
|
7950
|
+
fontWeight: active ? "600" : "500"
|
|
7913
7951
|
},
|
|
7914
7952
|
children: item.label
|
|
7915
7953
|
}
|
|
@@ -7919,7 +7957,7 @@ function ITSidebar({
|
|
|
7919
7957
|
"div",
|
|
7920
7958
|
{
|
|
7921
7959
|
className: `flex-shrink-0 transition-transform duration-300 ease-[cubic-bezier(0.2,0,0,1)] ${expandedItems.has(item.id) ? "rotate-180" : ""}`,
|
|
7922
|
-
style: { color:
|
|
7960
|
+
style: { color: active ? "var(--it-sidebar-active-color, var(--color-secondary-900))" : "var(--it-sidebar-icon-color, var(--color-secondary-500))", opacity: 0.7 },
|
|
7923
7961
|
children: /* @__PURE__ */ jsx56(FaChevronDown4, { className: "w-3 h-3" })
|
|
7924
7962
|
}
|
|
7925
7963
|
),
|
|
@@ -7940,7 +7978,21 @@ function ITSidebar({
|
|
|
7940
7978
|
]
|
|
7941
7979
|
}
|
|
7942
7980
|
),
|
|
7943
|
-
isSidebarCollapsed && /* @__PURE__ */
|
|
7981
|
+
isSidebarCollapsed && flat && /* @__PURE__ */ jsx56(
|
|
7982
|
+
"div",
|
|
7983
|
+
{
|
|
7984
|
+
role: "tooltip",
|
|
7985
|
+
className: "absolute left-full top-1/2 -translate-y-1/2 ml-3 px-2.5 py-1.5 rounded-lg whitespace-nowrap opacity-0 invisible group-hover/navitem:opacity-100 group-hover/navitem:visible transition-opacity duration-150 pointer-events-none z-[70]",
|
|
7986
|
+
style: {
|
|
7987
|
+
backgroundColor: "var(--it-sidebar-tooltip-bg, var(--color-secondary-900))",
|
|
7988
|
+
color: "var(--it-sidebar-tooltip-color, #ffffff)",
|
|
7989
|
+
fontSize: "0.78rem",
|
|
7990
|
+
fontWeight: 500
|
|
7991
|
+
},
|
|
7992
|
+
children: item.label
|
|
7993
|
+
}
|
|
7994
|
+
),
|
|
7995
|
+
isSidebarCollapsed && !flat && /* @__PURE__ */ jsxs43(
|
|
7944
7996
|
"div",
|
|
7945
7997
|
{
|
|
7946
7998
|
className: "absolute left-full top-0 ml-4 rounded-2xl opacity-0 invisible group-hover/navitem:opacity-100 group-hover/navitem:visible transition-all duration-300 pointer-events-none z-[70] min-w-[220px] overflow-hidden -translate-x-2 group-hover/navitem:translate-x-0 shadow-[0_10px_40px_-10px_rgba(0,0,0,0.15)]",
|
|
@@ -7982,7 +8034,7 @@ function ITSidebar({
|
|
|
7982
8034
|
!isSidebarCollapsed && item.subitems && item.subitems.length > 0 && /* @__PURE__ */ jsx56("div", { id: submenuId, role: "group", "aria-label": item.label, className: `overflow-hidden transition-all duration-400 ease-[cubic-bezier(0.2,0,0,1)] ${expandedItems.has(item.id) ? "max-h-[1000px] opacity-100 mt-1" : "max-h-0 opacity-0"}`, children: /* @__PURE__ */ jsx56(
|
|
7983
8035
|
"ul",
|
|
7984
8036
|
{
|
|
7985
|
-
className: "ml-4 flex flex-col gap-0 py-0.5
|
|
8037
|
+
className: `${flat && subitemConnector === "|" ? "ml-[21px] pl-2" : "ml-4"} flex flex-col gap-0 py-0.5`,
|
|
7986
8038
|
style: {
|
|
7987
8039
|
borderLeft: subitemConnector === "|" ? "1px solid var(--it-sidebar-border, var(--color-secondary-200))" : "none"
|
|
7988
8040
|
},
|
|
@@ -9995,26 +10047,32 @@ function ITTopBar({
|
|
|
9995
10047
|
showMobileMenuButton,
|
|
9996
10048
|
onToggleMobileMenu,
|
|
9997
10049
|
navItems,
|
|
9998
|
-
onNavItemClick
|
|
10050
|
+
onNavItemClick,
|
|
10051
|
+
hideBrandOnDesktop = false,
|
|
10052
|
+
showDesktopMenuButton = false
|
|
9999
10053
|
}) {
|
|
10054
|
+
const flat = useITFlatAppearance();
|
|
10055
|
+
const initials = (userMenu?.userName ?? "").trim().split(/\s+/).slice(0, 2).map((word) => word.charAt(0).toUpperCase()).join("");
|
|
10000
10056
|
const [isUserMenuOpen, setIsUserMenuOpen] = useState35(false);
|
|
10001
10057
|
const userMenuRef = useRef22(null);
|
|
10002
10058
|
useClickOutside_default(userMenuRef, () => setIsUserMenuOpen(false));
|
|
10003
10059
|
return /* @__PURE__ */ jsx68(
|
|
10004
10060
|
"header",
|
|
10005
10061
|
{
|
|
10006
|
-
className:
|
|
10062
|
+
className: `sticky top-0 z-40 transition-all duration-300 ${flat ? "" : "backdrop-blur-md"}`,
|
|
10007
10063
|
style: {
|
|
10008
10064
|
backgroundColor: "var(--it-topbar-bg, rgba(255, 255, 255, 0.9))",
|
|
10009
10065
|
borderBottom: "1px solid var(--it-topbar-border, rgba(15, 23, 42, 0.06))",
|
|
10010
|
-
boxShadow: "var(--shadow-xs)"
|
|
10066
|
+
boxShadow: flat ? "none" : "var(--shadow-xs)"
|
|
10011
10067
|
},
|
|
10012
|
-
children: /* @__PURE__ */ jsxs53("div", { className:
|
|
10068
|
+
children: /* @__PURE__ */ jsxs53("div", { className: `flex items-center justify-between px-6 lg:px-8 ${flat ? "h-[64px]" : "h-[72px]"}`, children: [
|
|
10013
10069
|
/* @__PURE__ */ jsxs53("div", { className: "flex items-center gap-5", children: [
|
|
10014
10070
|
showMobileMenuButton && /* @__PURE__ */ jsx68(
|
|
10015
10071
|
"button",
|
|
10016
10072
|
{
|
|
10017
|
-
|
|
10073
|
+
type: "button",
|
|
10074
|
+
"aria-label": "Men\xFA",
|
|
10075
|
+
className: `${showDesktopMenuButton ? "" : "lg:hidden"} p-2.5 -ml-2.5 rounded-xl transition-colors duration-200`,
|
|
10018
10076
|
style: {
|
|
10019
10077
|
color: "var(--it-topbar-icon, #64748b)"
|
|
10020
10078
|
},
|
|
@@ -10024,7 +10082,7 @@ function ITTopBar({
|
|
|
10024
10082
|
children: /* @__PURE__ */ jsx68(FaBars, { className: "w-[1.125rem] h-[1.125rem]" })
|
|
10025
10083
|
}
|
|
10026
10084
|
),
|
|
10027
|
-
/* @__PURE__ */ jsxs53("div", { className:
|
|
10085
|
+
/* @__PURE__ */ jsxs53("div", { className: `items-center gap-3 ${hideBrandOnDesktop ? "flex lg:hidden" : "flex"}`, children: [
|
|
10028
10086
|
logo && /* @__PURE__ */ jsx68("div", { className: "flex-shrink-0 drop-shadow-sm", children: logo }),
|
|
10029
10087
|
logoText && /* @__PURE__ */ jsx68(
|
|
10030
10088
|
ITText,
|
|
@@ -10058,7 +10116,7 @@ function ITTopBar({
|
|
|
10058
10116
|
item.id
|
|
10059
10117
|
)) })
|
|
10060
10118
|
] }),
|
|
10061
|
-
centerContent && /* @__PURE__ */ jsx68("div", { className:
|
|
10119
|
+
centerContent && /* @__PURE__ */ jsx68("div", { className: `hidden lg:flex flex-1 min-w-0 items-center ${hideBrandOnDesktop ? "justify-start pr-4" : "justify-center px-4"}`, children: /* @__PURE__ */ jsx68("div", { className: "w-full max-w-[420px]", children: centerContent }) }),
|
|
10062
10120
|
(children || userMenu) && /* @__PURE__ */ jsxs53("div", { className: "flex items-center gap-2", children: [
|
|
10063
10121
|
children,
|
|
10064
10122
|
userMenu && /* @__PURE__ */ jsxs53("div", { className: "relative", children: [
|
|
@@ -10066,7 +10124,7 @@ function ITTopBar({
|
|
|
10066
10124
|
"button",
|
|
10067
10125
|
{
|
|
10068
10126
|
type: "button",
|
|
10069
|
-
className:
|
|
10127
|
+
className: `flex items-center gap-3 rounded-full py-1.5 transition-all duration-200 ease-[cubic-bezier(0.2,0,0,1)] border border-transparent hover:border-secondary-200 ${flat ? "flex-row-reverse pl-4 pr-2" : "pl-2 pr-4"}`,
|
|
10070
10128
|
style: {
|
|
10071
10129
|
backgroundColor: isUserMenuOpen ? "var(--it-topbar-user-hover, #f1f5f9)" : "transparent"
|
|
10072
10130
|
},
|
|
@@ -10086,10 +10144,21 @@ function ITTopBar({
|
|
|
10086
10144
|
src: userMenu.userImage,
|
|
10087
10145
|
alt: "Current user"
|
|
10088
10146
|
}
|
|
10147
|
+
) : flat && initials ? /* @__PURE__ */ jsx68(
|
|
10148
|
+
"div",
|
|
10149
|
+
{
|
|
10150
|
+
"aria-hidden": "true",
|
|
10151
|
+
className: "w-9 h-9 rounded-full flex items-center justify-center text-[0.8rem] font-semibold",
|
|
10152
|
+
style: {
|
|
10153
|
+
backgroundColor: "color-mix(in srgb, var(--color-primary, #3b82f6) 14%, transparent)",
|
|
10154
|
+
color: "var(--color-primary, #2563eb)"
|
|
10155
|
+
},
|
|
10156
|
+
children: initials
|
|
10157
|
+
}
|
|
10089
10158
|
) : /* @__PURE__ */ jsx68("div", { className: "w-9 h-9 rounded-full bg-slate-100 flex items-center justify-center ring-2 ring-white shadow-sm", children: /* @__PURE__ */ jsx68(FaUserCircle2, { className: "w-6 h-6", style: { color: "var(--it-topbar-icon, #94a3b8)" } }) }),
|
|
10090
|
-
/* @__PURE__ */ jsx68("div", { className: "absolute bottom-0 right-0 w-2.5 h-2.5 bg-green-500 border-2 border-white rounded-full" })
|
|
10159
|
+
!flat && /* @__PURE__ */ jsx68("div", { className: "absolute bottom-0 right-0 w-2.5 h-2.5 bg-green-500 border-2 border-white rounded-full" })
|
|
10091
10160
|
] }),
|
|
10092
|
-
/* @__PURE__ */ jsxs53("div", { className:
|
|
10161
|
+
/* @__PURE__ */ jsxs53("div", { className: `hidden sm:flex flex-col py-0.5 ${flat ? "text-right" : "text-left"}`, children: [
|
|
10093
10162
|
/* @__PURE__ */ jsx68(
|
|
10094
10163
|
ITText,
|
|
10095
10164
|
{
|
|
@@ -10170,75 +10239,108 @@ function ITLayout({
|
|
|
10170
10239
|
sidebar,
|
|
10171
10240
|
children,
|
|
10172
10241
|
className = "",
|
|
10173
|
-
contentClassName = ""
|
|
10242
|
+
contentClassName = "",
|
|
10243
|
+
sidebarFullHeight = false
|
|
10174
10244
|
}) {
|
|
10175
10245
|
const [internalCollapsed, setInternalCollapsed] = useState36(true);
|
|
10176
10246
|
const [mobileSidebarOpen, setMobileSidebarOpen] = useState36(false);
|
|
10247
|
+
const flat = useITFlatAppearance();
|
|
10177
10248
|
const isControlled = sidebar.isCollapsed !== void 0;
|
|
10178
10249
|
const desktopCollapsed = isControlled ? sidebar.isCollapsed : internalCollapsed;
|
|
10179
10250
|
const handleToggleCollapse = isControlled ? sidebar.onToggleCollapse ?? (() => {
|
|
10180
10251
|
}) : () => setInternalCollapsed((v) => !v);
|
|
10181
10252
|
const layoutTokens = theme.layout;
|
|
10182
|
-
|
|
10183
|
-
|
|
10184
|
-
|
|
10253
|
+
const reservedWidth = desktopCollapsed ? flat ? "w-[72px]" : "w-[88px]" : flat ? "w-[248px]" : "w-[280px]";
|
|
10254
|
+
const toggleByButton = sidebar.expandOnHover === false;
|
|
10255
|
+
const handleMenuButton = () => {
|
|
10256
|
+
if (toggleByButton && window.matchMedia("(min-width: 1024px)").matches) handleToggleCollapse();
|
|
10257
|
+
else setMobileSidebarOpen((v) => !v);
|
|
10258
|
+
};
|
|
10259
|
+
const brand = sidebarFullHeight ? sidebar.brand ?? { logo: topBar.logo, text: topBar.logoText } : sidebar.brand;
|
|
10260
|
+
const topBarNode = /* @__PURE__ */ jsx69(
|
|
10261
|
+
ITTopBar,
|
|
10262
|
+
{
|
|
10263
|
+
...topBar,
|
|
10264
|
+
hideBrandOnDesktop: sidebarFullHeight || topBar.hideBrandOnDesktop,
|
|
10265
|
+
showMobileMenuButton: true,
|
|
10266
|
+
showDesktopMenuButton: toggleByButton || topBar.showDesktopMenuButton,
|
|
10267
|
+
onToggleMobileMenu: handleMenuButton
|
|
10268
|
+
}
|
|
10269
|
+
);
|
|
10270
|
+
const desktopSidebar = (
|
|
10271
|
+
// Full-height: the sidebar sits beside the top bar, so it needs to win the
|
|
10272
|
+
// stacking order when the collapsed rail expands over the content on hover.
|
|
10273
|
+
/* @__PURE__ */ jsxs54("div", { className: `hidden lg:block relative h-full ${sidebarFullHeight ? "z-50" : "z-40"}`, children: [
|
|
10274
|
+
/* @__PURE__ */ jsx69("div", { className: `${reservedWidth} h-full flex-shrink-0` }),
|
|
10275
|
+
/* @__PURE__ */ jsx69("div", { className: "absolute top-0 left-0 h-full", children: /* @__PURE__ */ jsx69(
|
|
10276
|
+
ITSidebar,
|
|
10277
|
+
{
|
|
10278
|
+
...sidebar,
|
|
10279
|
+
brand,
|
|
10280
|
+
isCollapsed: desktopCollapsed,
|
|
10281
|
+
onToggleCollapse: handleToggleCollapse,
|
|
10282
|
+
visibleOnMobile: false,
|
|
10283
|
+
className: `h-full ${flat ? "" : "drop-shadow-2xl"} transition-all duration-400 ease-[cubic-bezier(0.2,0,0,1)] flex-shrink-0`
|
|
10284
|
+
}
|
|
10285
|
+
) })
|
|
10286
|
+
] })
|
|
10287
|
+
);
|
|
10288
|
+
const mobileSidebar = mobileSidebarOpen && /* @__PURE__ */ jsx69(
|
|
10289
|
+
"div",
|
|
10290
|
+
{
|
|
10291
|
+
className: "lg:hidden fixed inset-0 z-[40] transition-opacity duration-300 backdrop-blur-sm bg-black/40",
|
|
10292
|
+
onClick: () => setMobileSidebarOpen(false),
|
|
10293
|
+
children: /* @__PURE__ */ jsx69(
|
|
10294
|
+
"div",
|
|
10295
|
+
{
|
|
10296
|
+
className: "h-full w-fit flex transform transition-transform duration-300 ease-[cubic-bezier(0.2,0,0,1)]",
|
|
10297
|
+
onClick: (e) => e.stopPropagation(),
|
|
10298
|
+
children: /* @__PURE__ */ jsx69(
|
|
10299
|
+
ITSidebar,
|
|
10300
|
+
{
|
|
10301
|
+
...sidebar,
|
|
10302
|
+
brand,
|
|
10303
|
+
isCollapsed: false,
|
|
10304
|
+
visibleOnMobile: true,
|
|
10305
|
+
className: "h-full shadow-2xl relative z-[60]",
|
|
10306
|
+
onToggleCollapse: () => setMobileSidebarOpen(false),
|
|
10307
|
+
onItemClick: () => setMobileSidebarOpen(false),
|
|
10308
|
+
onSubItemClick: () => setMobileSidebarOpen(false)
|
|
10309
|
+
}
|
|
10310
|
+
)
|
|
10311
|
+
}
|
|
10312
|
+
)
|
|
10313
|
+
}
|
|
10314
|
+
);
|
|
10315
|
+
const main = /* @__PURE__ */ jsx69("main", { className: "flex-1 overflow-y-auto w-full custom-scrollbar relative z-0", children: /* @__PURE__ */ jsx69("div", { className: clsx52("mx-auto w-full max-w-7xl px-4 sm:px-6 lg:px-8 py-6 h-full", contentClassName), children }) });
|
|
10316
|
+
if (sidebarFullHeight) {
|
|
10317
|
+
return /* @__PURE__ */ jsxs54(
|
|
10318
|
+
"div",
|
|
10185
10319
|
{
|
|
10186
|
-
|
|
10187
|
-
|
|
10188
|
-
|
|
10320
|
+
className: `flex h-screen overflow-hidden w-full relative ${className}`,
|
|
10321
|
+
style: { backgroundColor: layoutTokens.backgroundColor },
|
|
10322
|
+
children: [
|
|
10323
|
+
desktopSidebar,
|
|
10324
|
+
/* @__PURE__ */ jsxs54("div", { className: "flex flex-col flex-1 min-w-0 overflow-hidden", children: [
|
|
10325
|
+
topBarNode,
|
|
10326
|
+
main
|
|
10327
|
+
] }),
|
|
10328
|
+
mobileSidebar
|
|
10329
|
+
]
|
|
10189
10330
|
}
|
|
10190
|
-
)
|
|
10331
|
+
);
|
|
10332
|
+
}
|
|
10333
|
+
return /* @__PURE__ */ jsxs54("div", { className: `flex flex-col h-screen overflow-hidden w-full ${className}`, children: [
|
|
10334
|
+
topBarNode,
|
|
10191
10335
|
/* @__PURE__ */ jsxs54(
|
|
10192
10336
|
"div",
|
|
10193
10337
|
{
|
|
10194
10338
|
className: "flex flex-1 overflow-hidden relative",
|
|
10195
10339
|
style: { backgroundColor: layoutTokens.backgroundColor },
|
|
10196
10340
|
children: [
|
|
10197
|
-
|
|
10198
|
-
|
|
10199
|
-
|
|
10200
|
-
{
|
|
10201
|
-
className: `${desktopCollapsed ? "w-[88px]" : "w-[280px]"} h-full flex-shrink-0`
|
|
10202
|
-
}
|
|
10203
|
-
),
|
|
10204
|
-
/* @__PURE__ */ jsx69("div", { className: "absolute top-0 left-0 h-full", children: /* @__PURE__ */ jsx69(
|
|
10205
|
-
ITSidebar,
|
|
10206
|
-
{
|
|
10207
|
-
...sidebar,
|
|
10208
|
-
isCollapsed: desktopCollapsed,
|
|
10209
|
-
onToggleCollapse: handleToggleCollapse,
|
|
10210
|
-
visibleOnMobile: false,
|
|
10211
|
-
className: "h-full drop-shadow-2xl transition-all duration-400 ease-[cubic-bezier(0.2,0,0,1)] flex-shrink-0"
|
|
10212
|
-
}
|
|
10213
|
-
) })
|
|
10214
|
-
] }),
|
|
10215
|
-
mobileSidebarOpen && /* @__PURE__ */ jsx69(
|
|
10216
|
-
"div",
|
|
10217
|
-
{
|
|
10218
|
-
className: "lg:hidden fixed inset-0 z-[40] transition-opacity duration-300 backdrop-blur-sm bg-black/40",
|
|
10219
|
-
onClick: () => setMobileSidebarOpen(false),
|
|
10220
|
-
children: /* @__PURE__ */ jsx69(
|
|
10221
|
-
"div",
|
|
10222
|
-
{
|
|
10223
|
-
className: "h-full w-fit flex transform transition-transform duration-300 ease-[cubic-bezier(0.2,0,0,1)]",
|
|
10224
|
-
onClick: (e) => e.stopPropagation(),
|
|
10225
|
-
children: /* @__PURE__ */ jsx69(
|
|
10226
|
-
ITSidebar,
|
|
10227
|
-
{
|
|
10228
|
-
...sidebar,
|
|
10229
|
-
isCollapsed: false,
|
|
10230
|
-
visibleOnMobile: true,
|
|
10231
|
-
className: "h-full shadow-2xl relative z-[60]",
|
|
10232
|
-
onToggleCollapse: () => setMobileSidebarOpen(false),
|
|
10233
|
-
onItemClick: () => setMobileSidebarOpen(false),
|
|
10234
|
-
onSubItemClick: () => setMobileSidebarOpen(false)
|
|
10235
|
-
}
|
|
10236
|
-
)
|
|
10237
|
-
}
|
|
10238
|
-
)
|
|
10239
|
-
}
|
|
10240
|
-
),
|
|
10241
|
-
/* @__PURE__ */ jsx69("main", { className: "flex-1 overflow-y-auto w-full custom-scrollbar relative z-0", children: /* @__PURE__ */ jsx69("div", { className: clsx52("mx-auto w-full max-w-7xl px-4 sm:px-6 lg:px-8 py-6 h-full", contentClassName), children }) })
|
|
10341
|
+
desktopSidebar,
|
|
10342
|
+
mobileSidebar,
|
|
10343
|
+
main
|
|
10242
10344
|
]
|
|
10243
10345
|
}
|
|
10244
10346
|
)
|
|
@@ -10798,7 +10900,8 @@ function ITThemeProvider({
|
|
|
10798
10900
|
showFab = true,
|
|
10799
10901
|
density = 1,
|
|
10800
10902
|
radius,
|
|
10801
|
-
shadow
|
|
10903
|
+
shadow,
|
|
10904
|
+
appearance = "soft"
|
|
10802
10905
|
}) {
|
|
10803
10906
|
const [palette2, setPaletteState] = useState38(() => {
|
|
10804
10907
|
const basePalette = {
|
|
@@ -10911,6 +11014,11 @@ function ITThemeProvider({
|
|
|
10911
11014
|
root.style.fontSize = "";
|
|
10912
11015
|
};
|
|
10913
11016
|
}, [density]);
|
|
11017
|
+
useLayoutEffect4(() => {
|
|
11018
|
+
const root = document.documentElement;
|
|
11019
|
+
root.setAttribute("data-it-appearance", appearance);
|
|
11020
|
+
return () => root.removeAttribute("data-it-appearance");
|
|
11021
|
+
}, [appearance]);
|
|
10914
11022
|
useLayoutEffect4(() => {
|
|
10915
11023
|
const root = document.documentElement;
|
|
10916
11024
|
const radiusTokens = ["xs", "sm", "md", "lg", "xl", "2xl", "3xl"];
|
|
@@ -12192,7 +12300,8 @@ function ITThemeProvider({
|
|
|
12192
12300
|
applyPreset,
|
|
12193
12301
|
resolvedTheme,
|
|
12194
12302
|
darkModeMode,
|
|
12195
|
-
setDarkModeMode
|
|
12303
|
+
setDarkModeMode,
|
|
12304
|
+
appearance
|
|
12196
12305
|
},
|
|
12197
12306
|
children: [
|
|
12198
12307
|
children,
|
|
@@ -12452,6 +12561,7 @@ export {
|
|
|
12452
12561
|
useDebouncedSearch,
|
|
12453
12562
|
useEditableRow,
|
|
12454
12563
|
useFloatingPanel,
|
|
12564
|
+
useITFlatAppearance,
|
|
12455
12565
|
useITTheme,
|
|
12456
12566
|
useITThemeSafe,
|
|
12457
12567
|
useTableState
|