@axzydev/axzy_ui_system 1.4.2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +273 -194
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.cts +125 -68
- package/dist/index.d.ts +125 -68
- package/dist/index.js +175 -97
- 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 +1 -0
- package/src/components/organisms/sidebar/sidebar.props.ts +18 -1
- package/src/components/organisms/sidebar/sidebar.tsx +30 -10
- package/src/components/organisms/topbar/topbar.props.ts +7 -0
- package/src/components/organisms/topbar/topbar.tsx +31 -8
- package/src/components/templates/layout/layout.props.ts +8 -0
- package/src/components/templates/layout/layout.tsx +101 -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,10 @@ function ITSidebar({
|
|
|
7595
7605
|
onSubItemClick,
|
|
7596
7606
|
subitemConnector = "dot",
|
|
7597
7607
|
header,
|
|
7598
|
-
notification
|
|
7608
|
+
notification,
|
|
7609
|
+
brand
|
|
7599
7610
|
}) {
|
|
7611
|
+
const flat = useITFlatAppearance();
|
|
7600
7612
|
const [expandedItems, setExpandedItems] = useState27(/* @__PURE__ */ new Set());
|
|
7601
7613
|
const [isHovering, setIsHovering] = useState27(false);
|
|
7602
7614
|
const sidebarRef = useRef20(null);
|
|
@@ -7665,7 +7677,7 @@ function ITSidebar({
|
|
|
7665
7677
|
}
|
|
7666
7678
|
};
|
|
7667
7679
|
const isSidebarCollapsed = visibleOnMobile ? false : !isHovering && isCollapsed;
|
|
7668
|
-
const sidebarWidth = isSidebarCollapsed ? "w-[88px]" : "w-[280px]";
|
|
7680
|
+
const sidebarWidth = isSidebarCollapsed ? "w-[88px]" : flat ? "w-[248px]" : "w-[280px]";
|
|
7669
7681
|
const renderSubItem = (subitem) => /* @__PURE__ */ jsx56("li", { className: "relative", children: /* @__PURE__ */ jsxs43(
|
|
7670
7682
|
"button",
|
|
7671
7683
|
{
|
|
@@ -7831,16 +7843,33 @@ function ITSidebar({
|
|
|
7831
7843
|
${sidebarWidth}
|
|
7832
7844
|
${className}
|
|
7833
7845
|
${!visibleOnMobile ? "hidden lg:flex" : "flex"}
|
|
7834
|
-
shadow-[4px_0_32px_rgba(15,23,42,0.04)]
|
|
7846
|
+
${flat ? "" : "shadow-[4px_0_32px_rgba(15,23,42,0.04)]"}
|
|
7835
7847
|
`,
|
|
7836
7848
|
style: {
|
|
7837
7849
|
zIndex: 50,
|
|
7838
7850
|
backgroundColor: "var(--it-sidebar-bg, rgba(255, 255, 255, 0.90))",
|
|
7839
7851
|
borderRight: "1px solid var(--it-sidebar-border, var(--color-secondary-200))",
|
|
7840
|
-
WebkitBackdropFilter: "blur(12px)",
|
|
7841
|
-
backdropFilter: "blur(12px)"
|
|
7852
|
+
...flat ? {} : { WebkitBackdropFilter: "blur(12px)", backdropFilter: "blur(12px)" }
|
|
7842
7853
|
},
|
|
7843
7854
|
children: [
|
|
7855
|
+
brand && (brand.logo || brand.text) && /* @__PURE__ */ jsxs43(
|
|
7856
|
+
"div",
|
|
7857
|
+
{
|
|
7858
|
+
className: `flex items-center flex-shrink-0 h-[64px] ${isSidebarCollapsed ? "justify-center px-2" : "gap-2.5 px-7"}`,
|
|
7859
|
+
children: [
|
|
7860
|
+
brand.logo && /* @__PURE__ */ jsx56("div", { className: "flex-shrink-0 flex items-center", children: brand.logo }),
|
|
7861
|
+
brand.text && !isSidebarCollapsed && /* @__PURE__ */ jsx56(
|
|
7862
|
+
ITText,
|
|
7863
|
+
{
|
|
7864
|
+
as: "span",
|
|
7865
|
+
className: "text-[1.05rem] font-bold tracking-tight truncate",
|
|
7866
|
+
style: { color: "var(--it-sidebar-brand-color, var(--it-sidebar-label-color, var(--color-secondary-900)))" },
|
|
7867
|
+
children: brand.text
|
|
7868
|
+
}
|
|
7869
|
+
)
|
|
7870
|
+
]
|
|
7871
|
+
}
|
|
7872
|
+
),
|
|
7844
7873
|
header && !isSidebarCollapsed && /* @__PURE__ */ jsx56("div", { className: "px-4 pt-4 pb-1 flex-shrink-0", children: header }),
|
|
7845
7874
|
notification && /* @__PURE__ */ jsx56("div", { className: "px-4 pt-3 flex-shrink-0", children: renderNotification() }),
|
|
7846
7875
|
/* @__PURE__ */ jsx56("nav", { "aria-label": "Componentes de la librer\xEDa", className: "flex-1 py-4 overflow-y-auto overflow-x-hidden custom-scrollbar px-4", children: /* @__PURE__ */ jsx56("ul", { className: "space-y-1", children: navigationItems.map((item) => {
|
|
@@ -7863,8 +7892,8 @@ function ITSidebar({
|
|
|
7863
7892
|
`,
|
|
7864
7893
|
style: {
|
|
7865
7894
|
backgroundColor: item.isActive ? "var(--it-sidebar-active-bg, var(--color-secondary-50))" : "transparent",
|
|
7866
|
-
boxShadow: item.isActive ? "var(--shadow-xs)" : "none",
|
|
7867
|
-
border: item.isActive ? "1px solid var(--it-sidebar-border, var(--color-secondary-200))" : "1px solid transparent"
|
|
7895
|
+
boxShadow: item.isActive && !flat ? "var(--shadow-xs)" : "none",
|
|
7896
|
+
border: item.isActive && !flat ? "1px solid var(--it-sidebar-border, var(--color-secondary-200))" : "1px solid transparent"
|
|
7868
7897
|
},
|
|
7869
7898
|
onMouseEnter: (e) => {
|
|
7870
7899
|
if (!item.isActive) e.currentTarget.style.backgroundColor = "var(--it-sidebar-hover-bg, var(--color-secondary-100))";
|
|
@@ -7880,7 +7909,7 @@ function ITSidebar({
|
|
|
7880
7909
|
}
|
|
7881
7910
|
},
|
|
7882
7911
|
children: [
|
|
7883
|
-
item.isActive && !isSidebarCollapsed && /* @__PURE__ */ jsx56(
|
|
7912
|
+
item.isActive && !isSidebarCollapsed && !flat && /* @__PURE__ */ jsx56(
|
|
7884
7913
|
"div",
|
|
7885
7914
|
{
|
|
7886
7915
|
className: "absolute left-0 top-1/4 bottom-1/4 w-[3px] rounded-r-full transition-all",
|
|
@@ -7895,8 +7924,8 @@ function ITSidebar({
|
|
|
7895
7924
|
style: {
|
|
7896
7925
|
color: item.isActive ? "var(--it-sidebar-active-icon, var(--color-primary-500))" : "var(--it-sidebar-icon-color, #9ca3af)",
|
|
7897
7926
|
opacity: item.isActive ? 1 : 0.8,
|
|
7898
|
-
fontSize: item.isActive ? "1.12rem" : "1.05rem",
|
|
7899
|
-
filter: item.isActive ? "drop-shadow(0 0 8px rgba(255,255,255,0.2))" : "none"
|
|
7927
|
+
fontSize: flat ? "1rem" : item.isActive ? "1.12rem" : "1.05rem",
|
|
7928
|
+
filter: item.isActive && !flat ? "drop-shadow(0 0 8px rgba(255,255,255,0.2))" : "none"
|
|
7900
7929
|
},
|
|
7901
7930
|
children: item.icon
|
|
7902
7931
|
}
|
|
@@ -7908,7 +7937,7 @@ function ITSidebar({
|
|
|
7908
7937
|
className: `transition-all duration-300 truncate tracking-wide`,
|
|
7909
7938
|
style: {
|
|
7910
7939
|
color: item.isActive ? "var(--it-sidebar-active-color, #ffffff)" : "var(--it-sidebar-label-color, var(--color-secondary-300))",
|
|
7911
|
-
fontSize: "0.8rem",
|
|
7940
|
+
fontSize: flat ? "0.875rem" : "0.8rem",
|
|
7912
7941
|
fontWeight: item.isActive ? "600" : "500"
|
|
7913
7942
|
},
|
|
7914
7943
|
children: item.label
|
|
@@ -9995,21 +10024,24 @@ function ITTopBar({
|
|
|
9995
10024
|
showMobileMenuButton,
|
|
9996
10025
|
onToggleMobileMenu,
|
|
9997
10026
|
navItems,
|
|
9998
|
-
onNavItemClick
|
|
10027
|
+
onNavItemClick,
|
|
10028
|
+
hideBrandOnDesktop = false
|
|
9999
10029
|
}) {
|
|
10030
|
+
const flat = useITFlatAppearance();
|
|
10031
|
+
const initials = (userMenu?.userName ?? "").trim().split(/\s+/).slice(0, 2).map((word) => word.charAt(0).toUpperCase()).join("");
|
|
10000
10032
|
const [isUserMenuOpen, setIsUserMenuOpen] = useState35(false);
|
|
10001
10033
|
const userMenuRef = useRef22(null);
|
|
10002
10034
|
useClickOutside_default(userMenuRef, () => setIsUserMenuOpen(false));
|
|
10003
10035
|
return /* @__PURE__ */ jsx68(
|
|
10004
10036
|
"header",
|
|
10005
10037
|
{
|
|
10006
|
-
className:
|
|
10038
|
+
className: `sticky top-0 z-40 transition-all duration-300 ${flat ? "" : "backdrop-blur-md"}`,
|
|
10007
10039
|
style: {
|
|
10008
10040
|
backgroundColor: "var(--it-topbar-bg, rgba(255, 255, 255, 0.9))",
|
|
10009
10041
|
borderBottom: "1px solid var(--it-topbar-border, rgba(15, 23, 42, 0.06))",
|
|
10010
|
-
boxShadow: "var(--shadow-xs)"
|
|
10042
|
+
boxShadow: flat ? "none" : "var(--shadow-xs)"
|
|
10011
10043
|
},
|
|
10012
|
-
children: /* @__PURE__ */ jsxs53("div", { className:
|
|
10044
|
+
children: /* @__PURE__ */ jsxs53("div", { className: `flex items-center justify-between px-6 lg:px-8 ${flat ? "h-[64px]" : "h-[72px]"}`, children: [
|
|
10013
10045
|
/* @__PURE__ */ jsxs53("div", { className: "flex items-center gap-5", children: [
|
|
10014
10046
|
showMobileMenuButton && /* @__PURE__ */ jsx68(
|
|
10015
10047
|
"button",
|
|
@@ -10024,7 +10056,7 @@ function ITTopBar({
|
|
|
10024
10056
|
children: /* @__PURE__ */ jsx68(FaBars, { className: "w-[1.125rem] h-[1.125rem]" })
|
|
10025
10057
|
}
|
|
10026
10058
|
),
|
|
10027
|
-
/* @__PURE__ */ jsxs53("div", { className:
|
|
10059
|
+
/* @__PURE__ */ jsxs53("div", { className: `items-center gap-3 ${hideBrandOnDesktop ? "flex lg:hidden" : "flex"}`, children: [
|
|
10028
10060
|
logo && /* @__PURE__ */ jsx68("div", { className: "flex-shrink-0 drop-shadow-sm", children: logo }),
|
|
10029
10061
|
logoText && /* @__PURE__ */ jsx68(
|
|
10030
10062
|
ITText,
|
|
@@ -10058,7 +10090,7 @@ function ITTopBar({
|
|
|
10058
10090
|
item.id
|
|
10059
10091
|
)) })
|
|
10060
10092
|
] }),
|
|
10061
|
-
centerContent && /* @__PURE__ */ jsx68("div", { className:
|
|
10093
|
+
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
10094
|
(children || userMenu) && /* @__PURE__ */ jsxs53("div", { className: "flex items-center gap-2", children: [
|
|
10063
10095
|
children,
|
|
10064
10096
|
userMenu && /* @__PURE__ */ jsxs53("div", { className: "relative", children: [
|
|
@@ -10066,7 +10098,7 @@ function ITTopBar({
|
|
|
10066
10098
|
"button",
|
|
10067
10099
|
{
|
|
10068
10100
|
type: "button",
|
|
10069
|
-
className:
|
|
10101
|
+
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
10102
|
style: {
|
|
10071
10103
|
backgroundColor: isUserMenuOpen ? "var(--it-topbar-user-hover, #f1f5f9)" : "transparent"
|
|
10072
10104
|
},
|
|
@@ -10086,10 +10118,21 @@ function ITTopBar({
|
|
|
10086
10118
|
src: userMenu.userImage,
|
|
10087
10119
|
alt: "Current user"
|
|
10088
10120
|
}
|
|
10121
|
+
) : flat && initials ? /* @__PURE__ */ jsx68(
|
|
10122
|
+
"div",
|
|
10123
|
+
{
|
|
10124
|
+
"aria-hidden": "true",
|
|
10125
|
+
className: "w-9 h-9 rounded-full flex items-center justify-center text-[0.8rem] font-semibold",
|
|
10126
|
+
style: {
|
|
10127
|
+
backgroundColor: "color-mix(in srgb, var(--color-primary, #3b82f6) 14%, transparent)",
|
|
10128
|
+
color: "var(--color-primary, #2563eb)"
|
|
10129
|
+
},
|
|
10130
|
+
children: initials
|
|
10131
|
+
}
|
|
10089
10132
|
) : /* @__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" })
|
|
10133
|
+
!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
10134
|
] }),
|
|
10092
|
-
/* @__PURE__ */ jsxs53("div", { className:
|
|
10135
|
+
/* @__PURE__ */ jsxs53("div", { className: `hidden sm:flex flex-col py-0.5 ${flat ? "text-right" : "text-left"}`, children: [
|
|
10093
10136
|
/* @__PURE__ */ jsx68(
|
|
10094
10137
|
ITText,
|
|
10095
10138
|
{
|
|
@@ -10170,75 +10213,102 @@ function ITLayout({
|
|
|
10170
10213
|
sidebar,
|
|
10171
10214
|
children,
|
|
10172
10215
|
className = "",
|
|
10173
|
-
contentClassName = ""
|
|
10216
|
+
contentClassName = "",
|
|
10217
|
+
sidebarFullHeight = false
|
|
10174
10218
|
}) {
|
|
10175
10219
|
const [internalCollapsed, setInternalCollapsed] = useState36(true);
|
|
10176
10220
|
const [mobileSidebarOpen, setMobileSidebarOpen] = useState36(false);
|
|
10221
|
+
const flat = useITFlatAppearance();
|
|
10177
10222
|
const isControlled = sidebar.isCollapsed !== void 0;
|
|
10178
10223
|
const desktopCollapsed = isControlled ? sidebar.isCollapsed : internalCollapsed;
|
|
10179
10224
|
const handleToggleCollapse = isControlled ? sidebar.onToggleCollapse ?? (() => {
|
|
10180
10225
|
}) : () => setInternalCollapsed((v) => !v);
|
|
10181
10226
|
const layoutTokens = theme.layout;
|
|
10182
|
-
|
|
10183
|
-
|
|
10184
|
-
|
|
10227
|
+
const reservedWidth = desktopCollapsed ? "w-[88px]" : flat ? "w-[248px]" : "w-[280px]";
|
|
10228
|
+
const brand = sidebarFullHeight ? sidebar.brand ?? { logo: topBar.logo, text: topBar.logoText } : sidebar.brand;
|
|
10229
|
+
const topBarNode = /* @__PURE__ */ jsx69(
|
|
10230
|
+
ITTopBar,
|
|
10231
|
+
{
|
|
10232
|
+
...topBar,
|
|
10233
|
+
hideBrandOnDesktop: sidebarFullHeight || topBar.hideBrandOnDesktop,
|
|
10234
|
+
showMobileMenuButton: true,
|
|
10235
|
+
onToggleMobileMenu: () => setMobileSidebarOpen((v) => !v)
|
|
10236
|
+
}
|
|
10237
|
+
);
|
|
10238
|
+
const desktopSidebar = (
|
|
10239
|
+
// Full-height: the sidebar sits beside the top bar, so it needs to win the
|
|
10240
|
+
// stacking order when the collapsed rail expands over the content on hover.
|
|
10241
|
+
/* @__PURE__ */ jsxs54("div", { className: `hidden lg:block relative h-full ${sidebarFullHeight ? "z-50" : "z-40"}`, children: [
|
|
10242
|
+
/* @__PURE__ */ jsx69("div", { className: `${reservedWidth} h-full flex-shrink-0` }),
|
|
10243
|
+
/* @__PURE__ */ jsx69("div", { className: "absolute top-0 left-0 h-full", children: /* @__PURE__ */ jsx69(
|
|
10244
|
+
ITSidebar,
|
|
10245
|
+
{
|
|
10246
|
+
...sidebar,
|
|
10247
|
+
brand,
|
|
10248
|
+
isCollapsed: desktopCollapsed,
|
|
10249
|
+
onToggleCollapse: handleToggleCollapse,
|
|
10250
|
+
visibleOnMobile: false,
|
|
10251
|
+
className: `h-full ${flat ? "" : "drop-shadow-2xl"} transition-all duration-400 ease-[cubic-bezier(0.2,0,0,1)] flex-shrink-0`
|
|
10252
|
+
}
|
|
10253
|
+
) })
|
|
10254
|
+
] })
|
|
10255
|
+
);
|
|
10256
|
+
const mobileSidebar = mobileSidebarOpen && /* @__PURE__ */ jsx69(
|
|
10257
|
+
"div",
|
|
10258
|
+
{
|
|
10259
|
+
className: "lg:hidden fixed inset-0 z-[40] transition-opacity duration-300 backdrop-blur-sm bg-black/40",
|
|
10260
|
+
onClick: () => setMobileSidebarOpen(false),
|
|
10261
|
+
children: /* @__PURE__ */ jsx69(
|
|
10262
|
+
"div",
|
|
10263
|
+
{
|
|
10264
|
+
className: "h-full w-fit flex transform transition-transform duration-300 ease-[cubic-bezier(0.2,0,0,1)]",
|
|
10265
|
+
onClick: (e) => e.stopPropagation(),
|
|
10266
|
+
children: /* @__PURE__ */ jsx69(
|
|
10267
|
+
ITSidebar,
|
|
10268
|
+
{
|
|
10269
|
+
...sidebar,
|
|
10270
|
+
brand,
|
|
10271
|
+
isCollapsed: false,
|
|
10272
|
+
visibleOnMobile: true,
|
|
10273
|
+
className: "h-full shadow-2xl relative z-[60]",
|
|
10274
|
+
onToggleCollapse: () => setMobileSidebarOpen(false),
|
|
10275
|
+
onItemClick: () => setMobileSidebarOpen(false),
|
|
10276
|
+
onSubItemClick: () => setMobileSidebarOpen(false)
|
|
10277
|
+
}
|
|
10278
|
+
)
|
|
10279
|
+
}
|
|
10280
|
+
)
|
|
10281
|
+
}
|
|
10282
|
+
);
|
|
10283
|
+
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 }) });
|
|
10284
|
+
if (sidebarFullHeight) {
|
|
10285
|
+
return /* @__PURE__ */ jsxs54(
|
|
10286
|
+
"div",
|
|
10185
10287
|
{
|
|
10186
|
-
|
|
10187
|
-
|
|
10188
|
-
|
|
10288
|
+
className: `flex h-screen overflow-hidden w-full relative ${className}`,
|
|
10289
|
+
style: { backgroundColor: layoutTokens.backgroundColor },
|
|
10290
|
+
children: [
|
|
10291
|
+
desktopSidebar,
|
|
10292
|
+
/* @__PURE__ */ jsxs54("div", { className: "flex flex-col flex-1 min-w-0 overflow-hidden", children: [
|
|
10293
|
+
topBarNode,
|
|
10294
|
+
main
|
|
10295
|
+
] }),
|
|
10296
|
+
mobileSidebar
|
|
10297
|
+
]
|
|
10189
10298
|
}
|
|
10190
|
-
)
|
|
10299
|
+
);
|
|
10300
|
+
}
|
|
10301
|
+
return /* @__PURE__ */ jsxs54("div", { className: `flex flex-col h-screen overflow-hidden w-full ${className}`, children: [
|
|
10302
|
+
topBarNode,
|
|
10191
10303
|
/* @__PURE__ */ jsxs54(
|
|
10192
10304
|
"div",
|
|
10193
10305
|
{
|
|
10194
10306
|
className: "flex flex-1 overflow-hidden relative",
|
|
10195
10307
|
style: { backgroundColor: layoutTokens.backgroundColor },
|
|
10196
10308
|
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 }) })
|
|
10309
|
+
desktopSidebar,
|
|
10310
|
+
mobileSidebar,
|
|
10311
|
+
main
|
|
10242
10312
|
]
|
|
10243
10313
|
}
|
|
10244
10314
|
)
|
|
@@ -10798,7 +10868,8 @@ function ITThemeProvider({
|
|
|
10798
10868
|
showFab = true,
|
|
10799
10869
|
density = 1,
|
|
10800
10870
|
radius,
|
|
10801
|
-
shadow
|
|
10871
|
+
shadow,
|
|
10872
|
+
appearance = "soft"
|
|
10802
10873
|
}) {
|
|
10803
10874
|
const [palette2, setPaletteState] = useState38(() => {
|
|
10804
10875
|
const basePalette = {
|
|
@@ -10911,6 +10982,11 @@ function ITThemeProvider({
|
|
|
10911
10982
|
root.style.fontSize = "";
|
|
10912
10983
|
};
|
|
10913
10984
|
}, [density]);
|
|
10985
|
+
useLayoutEffect4(() => {
|
|
10986
|
+
const root = document.documentElement;
|
|
10987
|
+
root.setAttribute("data-it-appearance", appearance);
|
|
10988
|
+
return () => root.removeAttribute("data-it-appearance");
|
|
10989
|
+
}, [appearance]);
|
|
10914
10990
|
useLayoutEffect4(() => {
|
|
10915
10991
|
const root = document.documentElement;
|
|
10916
10992
|
const radiusTokens = ["xs", "sm", "md", "lg", "xl", "2xl", "3xl"];
|
|
@@ -12192,7 +12268,8 @@ function ITThemeProvider({
|
|
|
12192
12268
|
applyPreset,
|
|
12193
12269
|
resolvedTheme,
|
|
12194
12270
|
darkModeMode,
|
|
12195
|
-
setDarkModeMode
|
|
12271
|
+
setDarkModeMode,
|
|
12272
|
+
appearance
|
|
12196
12273
|
},
|
|
12197
12274
|
children: [
|
|
12198
12275
|
children,
|
|
@@ -12452,6 +12529,7 @@ export {
|
|
|
12452
12529
|
useDebouncedSearch,
|
|
12453
12530
|
useEditableRow,
|
|
12454
12531
|
useFloatingPanel,
|
|
12532
|
+
useITFlatAppearance,
|
|
12455
12533
|
useITTheme,
|
|
12456
12534
|
useITThemeSafe,
|
|
12457
12535
|
useTableState
|