@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.cjs
CHANGED
|
@@ -98,6 +98,7 @@ __export(index_exports, {
|
|
|
98
98
|
useDebouncedSearch: () => useDebouncedSearch,
|
|
99
99
|
useEditableRow: () => useEditableRow,
|
|
100
100
|
useFloatingPanel: () => useFloatingPanel,
|
|
101
|
+
useITFlatAppearance: () => useITFlatAppearance,
|
|
101
102
|
useITTheme: () => useITTheme,
|
|
102
103
|
useITThemeSafe: () => useITThemeSafe,
|
|
103
104
|
useTableState: () => useTableState
|
|
@@ -1896,7 +1897,26 @@ var calendar_default = ITCalendar;
|
|
|
1896
1897
|
|
|
1897
1898
|
// src/components/molecules/card/card.tsx
|
|
1898
1899
|
var import_clsx8 = __toESM(require("clsx"), 1);
|
|
1900
|
+
var import_react10 = require("react");
|
|
1901
|
+
|
|
1902
|
+
// src/theme/theme-context.ts
|
|
1899
1903
|
var import_react9 = require("react");
|
|
1904
|
+
var ITThemeContext = (0, import_react9.createContext)(void 0);
|
|
1905
|
+
var useITTheme = () => {
|
|
1906
|
+
const context = (0, import_react9.useContext)(ITThemeContext);
|
|
1907
|
+
if (!context) {
|
|
1908
|
+
throw new Error("useITTheme must be used within an ITThemeProvider");
|
|
1909
|
+
}
|
|
1910
|
+
return context;
|
|
1911
|
+
};
|
|
1912
|
+
var useITThemeSafe = () => {
|
|
1913
|
+
return (0, import_react9.useContext)(ITThemeContext);
|
|
1914
|
+
};
|
|
1915
|
+
var useITFlatAppearance = () => {
|
|
1916
|
+
return (0, import_react9.useContext)(ITThemeContext)?.appearance === "flat";
|
|
1917
|
+
};
|
|
1918
|
+
|
|
1919
|
+
// src/components/molecules/card/card.tsx
|
|
1900
1920
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1901
1921
|
function ITCard({
|
|
1902
1922
|
title,
|
|
@@ -1911,17 +1931,21 @@ function ITCard({
|
|
|
1911
1931
|
actionClassName,
|
|
1912
1932
|
onClick
|
|
1913
1933
|
}) {
|
|
1914
|
-
const [isHovered, setIsHovered] = (0,
|
|
1934
|
+
const [isHovered, setIsHovered] = (0, import_react10.useState)(false);
|
|
1935
|
+
const flat = useITFlatAppearance();
|
|
1915
1936
|
const containerStyle = {
|
|
1916
1937
|
backgroundColor: "var(--it-card-bg, #ffffff)",
|
|
1917
|
-
borderColor: "var(--it-card-border, rgba(15, 23, 42, 0.06))",
|
|
1938
|
+
borderColor: flat ? "var(--it-card-flat-border, var(--color-secondary-200))" : "var(--it-card-border, rgba(15, 23, 42, 0.06))",
|
|
1918
1939
|
borderWidth: "1px",
|
|
1919
|
-
|
|
1940
|
+
borderStyle: "solid",
|
|
1941
|
+
borderRadius: flat ? "var(--it-card-radius, var(--radius-lg))" : "var(--it-card-radius, var(--radius-2xl))",
|
|
1920
1942
|
// Soft depth: every card floats a little at rest; interactive cards
|
|
1921
1943
|
// gain visual weight on hover instead of appearing flat until clicked.
|
|
1922
|
-
|
|
1944
|
+
// Flat appearance: the hairline border carries the surface, so a card
|
|
1945
|
+
// only gets a shadow as hover feedback when it is clickable.
|
|
1946
|
+
boxShadow: flat ? onClick && isHovered ? "var(--shadow-sm)" : "none" : onClick ? isHovered ? "var(--shadow-lg)" : "var(--shadow-sm)" : "var(--shadow-sm)",
|
|
1923
1947
|
transition: onClick ? "box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out" : "none",
|
|
1924
|
-
transform: onClick && isHovered ? "translateY(-2px)" : "translateY(0)",
|
|
1948
|
+
transform: onClick && isHovered && !flat ? "translateY(-2px)" : "translateY(0)",
|
|
1925
1949
|
cursor: onClick ? "pointer" : "default"
|
|
1926
1950
|
};
|
|
1927
1951
|
const bodyStyle = {
|
|
@@ -1949,7 +1973,7 @@ function ITCard({
|
|
|
1949
1973
|
ITText,
|
|
1950
1974
|
{
|
|
1951
1975
|
as: "h3",
|
|
1952
|
-
className: (0, import_clsx8.default)("text-xl font-semibold mb-2", titleClassName),
|
|
1976
|
+
className: (0, import_clsx8.default)(flat ? "text-base font-semibold mb-3" : "text-xl font-semibold mb-2", titleClassName),
|
|
1953
1977
|
children: title
|
|
1954
1978
|
}
|
|
1955
1979
|
),
|
|
@@ -2123,7 +2147,7 @@ function ITChip({
|
|
|
2123
2147
|
|
|
2124
2148
|
// src/components/molecules/chip-input/chip-input.tsx
|
|
2125
2149
|
var import_clsx12 = __toESM(require("clsx"), 1);
|
|
2126
|
-
var
|
|
2150
|
+
var import_react11 = require("react");
|
|
2127
2151
|
|
|
2128
2152
|
// src/utils/styles.ts
|
|
2129
2153
|
var import_clsx11 = __toESM(require("clsx"), 1);
|
|
@@ -2255,11 +2279,11 @@ function ITChipInput({
|
|
|
2255
2279
|
helpText,
|
|
2256
2280
|
className
|
|
2257
2281
|
}) {
|
|
2258
|
-
const [inputValue, setInputValue] = (0,
|
|
2259
|
-
const [localTouched, setLocalTouched] = (0,
|
|
2260
|
-
const [localError, setLocalError] = (0,
|
|
2261
|
-
const [isFocused, setIsFocused] = (0,
|
|
2262
|
-
const inputRef = (0,
|
|
2282
|
+
const [inputValue, setInputValue] = (0, import_react11.useState)("");
|
|
2283
|
+
const [localTouched, setLocalTouched] = (0, import_react11.useState)(false);
|
|
2284
|
+
const [localError, setLocalError] = (0, import_react11.useState)(void 0);
|
|
2285
|
+
const [isFocused, setIsFocused] = (0, import_react11.useState)(false);
|
|
2286
|
+
const inputRef = (0, import_react11.useRef)(null);
|
|
2263
2287
|
const inputTheme = theme.input || {};
|
|
2264
2288
|
const isTouched = touched !== void 0 ? touched : localTouched;
|
|
2265
2289
|
const externalError = error !== void 0 && error !== false ? error === true ? "Este campo es requerido" : error : required && value.length === 0 ? "Este campo es requerido" : void 0;
|
|
@@ -2400,7 +2424,7 @@ function ITChipInput({
|
|
|
2400
2424
|
|
|
2401
2425
|
// src/components/molecules/dropdown-menu/dropdown-menu.tsx
|
|
2402
2426
|
var import_clsx13 = __toESM(require("clsx"), 1);
|
|
2403
|
-
var
|
|
2427
|
+
var import_react12 = require("react");
|
|
2404
2428
|
var import_react_dom = require("react-dom");
|
|
2405
2429
|
var import_fa6 = require("react-icons/fa");
|
|
2406
2430
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
@@ -2414,20 +2438,20 @@ function ITDropdownMenu({
|
|
|
2414
2438
|
className,
|
|
2415
2439
|
menuClassName
|
|
2416
2440
|
}) {
|
|
2417
|
-
const [isOpen, setIsOpen] = (0,
|
|
2418
|
-
const [activeIndex, setActiveIndex] = (0,
|
|
2419
|
-
const triggerRef = (0,
|
|
2420
|
-
const itemRefs = (0,
|
|
2441
|
+
const [isOpen, setIsOpen] = (0, import_react12.useState)(false);
|
|
2442
|
+
const [activeIndex, setActiveIndex] = (0, import_react12.useState)(-1);
|
|
2443
|
+
const triggerRef = (0, import_react12.useRef)(null);
|
|
2444
|
+
const itemRefs = (0, import_react12.useRef)([]);
|
|
2421
2445
|
const { panelRef, style: panelStyle } = useFloatingPanel(triggerRef, isOpen, {
|
|
2422
2446
|
estimatedHeight: Math.max(items.length * 40, 120),
|
|
2423
2447
|
matchWidth: false,
|
|
2424
2448
|
align: placement.endsWith("end") ? "end" : "start"
|
|
2425
2449
|
});
|
|
2426
|
-
const enabledIndexes = (0,
|
|
2450
|
+
const enabledIndexes = (0, import_react12.useMemo)(
|
|
2427
2451
|
() => items.map((item, i) => item.disabled ? -1 : i).filter((i) => i >= 0),
|
|
2428
2452
|
[items]
|
|
2429
2453
|
);
|
|
2430
|
-
(0,
|
|
2454
|
+
(0, import_react12.useEffect)(() => {
|
|
2431
2455
|
if (!isOpen) return;
|
|
2432
2456
|
function handleClickOutside(event) {
|
|
2433
2457
|
const target = event.target;
|
|
@@ -2438,7 +2462,7 @@ function ITDropdownMenu({
|
|
|
2438
2462
|
document.addEventListener("mousedown", handleClickOutside);
|
|
2439
2463
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
2440
2464
|
}, [isOpen, panelRef]);
|
|
2441
|
-
(0,
|
|
2465
|
+
(0, import_react12.useEffect)(() => {
|
|
2442
2466
|
if (isOpen) {
|
|
2443
2467
|
setActiveIndex(enabledIndexes[0] ?? -1);
|
|
2444
2468
|
requestAnimationFrame(() => {
|
|
@@ -2610,12 +2634,12 @@ function ITField({
|
|
|
2610
2634
|
}
|
|
2611
2635
|
|
|
2612
2636
|
// src/components/molecules/masked-input/masked-input.tsx
|
|
2613
|
-
var
|
|
2637
|
+
var import_react14 = require("react");
|
|
2614
2638
|
var import_clsx16 = __toESM(require("clsx"), 1);
|
|
2615
2639
|
|
|
2616
2640
|
// src/components/atoms/input/input.tsx
|
|
2617
2641
|
var import_clsx15 = __toESM(require("clsx"), 1);
|
|
2618
|
-
var
|
|
2642
|
+
var import_react13 = require("react");
|
|
2619
2643
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2620
2644
|
function ITInput({
|
|
2621
2645
|
name,
|
|
@@ -2655,12 +2679,12 @@ function ITInput({
|
|
|
2655
2679
|
const isNumberType = type === "number";
|
|
2656
2680
|
const isTextArea = type === "textarea";
|
|
2657
2681
|
const decimalPlaces = decimals ?? (currencyFormat ? 2 : 0);
|
|
2658
|
-
const [displayValue, setDisplayValue] = (0,
|
|
2659
|
-
const [isFocused, setIsFocused] = (0,
|
|
2660
|
-
const [hasSelectedAll, setHasSelectedAll] = (0,
|
|
2661
|
-
const [showPassword, setShowPassword] = (0,
|
|
2662
|
-
const [localTouched, setLocalTouched] = (0,
|
|
2663
|
-
const inputRef = (0,
|
|
2682
|
+
const [displayValue, setDisplayValue] = (0, import_react13.useState)("");
|
|
2683
|
+
const [isFocused, setIsFocused] = (0, import_react13.useState)(false);
|
|
2684
|
+
const [hasSelectedAll, setHasSelectedAll] = (0, import_react13.useState)(false);
|
|
2685
|
+
const [showPassword, setShowPassword] = (0, import_react13.useState)(false);
|
|
2686
|
+
const [localTouched, setLocalTouched] = (0, import_react13.useState)(false);
|
|
2687
|
+
const inputRef = (0, import_react13.useRef)(null);
|
|
2664
2688
|
const inputTheme = theme.input || {};
|
|
2665
2689
|
const getStyle = () => {
|
|
2666
2690
|
const style = inputFieldStyle(inputTheme, size);
|
|
@@ -2699,7 +2723,7 @@ function ITInput({
|
|
|
2699
2723
|
setHasSelectedAll(true);
|
|
2700
2724
|
}
|
|
2701
2725
|
};
|
|
2702
|
-
const formatValue = (0,
|
|
2726
|
+
const formatValue = (0, import_react13.useCallback)(
|
|
2703
2727
|
(val) => {
|
|
2704
2728
|
const num = typeof val === "string" ? parseFloat(val.replace(/,/g, "")) : val;
|
|
2705
2729
|
if (num == null || isNaN(num)) {
|
|
@@ -2718,14 +2742,14 @@ function ITInput({
|
|
|
2718
2742
|
},
|
|
2719
2743
|
[currencyFormat, decimalPlaces]
|
|
2720
2744
|
);
|
|
2721
|
-
const unformatValue = (0,
|
|
2745
|
+
const unformatValue = (0, import_react13.useCallback)(
|
|
2722
2746
|
(val) => {
|
|
2723
2747
|
if (val == null) return "";
|
|
2724
2748
|
return String(val).replace(/,/g, "");
|
|
2725
2749
|
},
|
|
2726
2750
|
[]
|
|
2727
2751
|
);
|
|
2728
|
-
(0,
|
|
2752
|
+
(0, import_react13.useEffect)(() => {
|
|
2729
2753
|
if (!isFocused) {
|
|
2730
2754
|
if (isNumberType) {
|
|
2731
2755
|
if (formatNumber) {
|
|
@@ -3193,15 +3217,15 @@ function ITMaskedInput({
|
|
|
3193
3217
|
iconRight,
|
|
3194
3218
|
autoFocus = false
|
|
3195
3219
|
}) {
|
|
3196
|
-
const containerRef = (0,
|
|
3197
|
-
const rawRef = (0,
|
|
3220
|
+
const containerRef = (0, import_react14.useRef)(null);
|
|
3221
|
+
const rawRef = (0, import_react14.useRef)(value ?? "");
|
|
3198
3222
|
const isControlled = value !== void 0;
|
|
3199
|
-
const [internalRaw, setInternalRaw] = (0,
|
|
3200
|
-
const [invalidPattern, setInvalidPattern] = (0,
|
|
3201
|
-
const rules = (0,
|
|
3202
|
-
const tokenCount = (0,
|
|
3223
|
+
const [internalRaw, setInternalRaw] = (0, import_react14.useState)(value ?? "");
|
|
3224
|
+
const [invalidPattern, setInvalidPattern] = (0, import_react14.useState)(false);
|
|
3225
|
+
const rules = (0, import_react14.useMemo)(() => parseMask(mask), [mask]);
|
|
3226
|
+
const tokenCount = (0, import_react14.useMemo)(() => rules.filter((r) => r.type === "token").length, [rules]);
|
|
3203
3227
|
const raw = isControlled ? value ?? "" : internalRaw;
|
|
3204
|
-
const display = (0,
|
|
3228
|
+
const display = (0, import_react14.useMemo)(() => format2(raw, rules, placeholderChar), [raw, rules, placeholderChar]);
|
|
3205
3229
|
const scheduleCaret = (caret) => {
|
|
3206
3230
|
const inputEl = containerRef.current?.querySelector("input");
|
|
3207
3231
|
if (!inputEl) return;
|
|
@@ -3265,7 +3289,7 @@ function ITMaskedInput({
|
|
|
3265
3289
|
|
|
3266
3290
|
// src/components/molecules/multi-select/multi-select.tsx
|
|
3267
3291
|
var import_clsx17 = __toESM(require("clsx"), 1);
|
|
3268
|
-
var
|
|
3292
|
+
var import_react15 = require("react");
|
|
3269
3293
|
var import_react_dom2 = require("react-dom");
|
|
3270
3294
|
var import_fa7 = require("react-icons/fa");
|
|
3271
3295
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
@@ -3294,32 +3318,32 @@ function ITMultiSelect({
|
|
|
3294
3318
|
renderOption,
|
|
3295
3319
|
className
|
|
3296
3320
|
}) {
|
|
3297
|
-
const [isOpen, setIsOpen] = (0,
|
|
3298
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
3299
|
-
const [isFocused, setIsFocused] = (0,
|
|
3300
|
-
const [localTouched, setLocalTouched] = (0,
|
|
3301
|
-
const [activeIndex, setActiveIndex] = (0,
|
|
3302
|
-
const containerRef = (0,
|
|
3303
|
-
const controlRef = (0,
|
|
3304
|
-
const inputRef = (0,
|
|
3305
|
-
const optionRefs = (0,
|
|
3306
|
-
const timeoutRef = (0,
|
|
3321
|
+
const [isOpen, setIsOpen] = (0, import_react15.useState)(false);
|
|
3322
|
+
const [searchTerm, setSearchTerm] = (0, import_react15.useState)("");
|
|
3323
|
+
const [isFocused, setIsFocused] = (0, import_react15.useState)(false);
|
|
3324
|
+
const [localTouched, setLocalTouched] = (0, import_react15.useState)(false);
|
|
3325
|
+
const [activeIndex, setActiveIndex] = (0, import_react15.useState)(-1);
|
|
3326
|
+
const containerRef = (0, import_react15.useRef)(null);
|
|
3327
|
+
const controlRef = (0, import_react15.useRef)(null);
|
|
3328
|
+
const inputRef = (0, import_react15.useRef)(null);
|
|
3329
|
+
const optionRefs = (0, import_react15.useRef)([]);
|
|
3330
|
+
const timeoutRef = (0, import_react15.useRef)(null);
|
|
3307
3331
|
const { panelRef, style: panelStyle } = useFloatingPanel(controlRef, isOpen, {
|
|
3308
3332
|
estimatedHeight: 260,
|
|
3309
3333
|
matchWidth: true
|
|
3310
3334
|
});
|
|
3311
|
-
const selectedOptions = (0,
|
|
3335
|
+
const selectedOptions = (0, import_react15.useMemo)(
|
|
3312
3336
|
() => options.filter((opt) => value.includes(opt[valueField])),
|
|
3313
3337
|
[options, value, valueField]
|
|
3314
3338
|
);
|
|
3315
|
-
const filteredOptions = (0,
|
|
3339
|
+
const filteredOptions = (0, import_react15.useMemo)(() => {
|
|
3316
3340
|
if (onSearch) return options;
|
|
3317
3341
|
if (!searchTerm) return options;
|
|
3318
3342
|
return options.filter(
|
|
3319
3343
|
(opt) => String(opt[labelField]).toLowerCase().includes(searchTerm.toLowerCase())
|
|
3320
3344
|
);
|
|
3321
3345
|
}, [options, searchTerm, onSearch, labelField]);
|
|
3322
|
-
(0,
|
|
3346
|
+
(0, import_react15.useEffect)(() => {
|
|
3323
3347
|
function handleClickOutside(event) {
|
|
3324
3348
|
const target = event.target;
|
|
3325
3349
|
if (!containerRef.current?.contains(target) && !panelRef.current?.contains(target)) {
|
|
@@ -3618,11 +3642,11 @@ function ITConfirmDialog({
|
|
|
3618
3642
|
}
|
|
3619
3643
|
|
|
3620
3644
|
// src/hooks/useElementSize.ts
|
|
3621
|
-
var
|
|
3645
|
+
var import_react16 = require("react");
|
|
3622
3646
|
function useElementSize() {
|
|
3623
|
-
const ref = (0,
|
|
3624
|
-
const [size, setSize] = (0,
|
|
3625
|
-
(0,
|
|
3647
|
+
const ref = (0, import_react16.useRef)(null);
|
|
3648
|
+
const [size, setSize] = (0, import_react16.useState)({ width: 0, height: 0 });
|
|
3649
|
+
(0, import_react16.useLayoutEffect)(() => {
|
|
3626
3650
|
const element = ref.current;
|
|
3627
3651
|
if (!element) return;
|
|
3628
3652
|
const update = () => {
|
|
@@ -3638,7 +3662,7 @@ function useElementSize() {
|
|
|
3638
3662
|
}
|
|
3639
3663
|
|
|
3640
3664
|
// src/hooks/useVirtualRows.ts
|
|
3641
|
-
var
|
|
3665
|
+
var import_react17 = require("react");
|
|
3642
3666
|
function useVirtualRows({
|
|
3643
3667
|
count,
|
|
3644
3668
|
rowHeight,
|
|
@@ -3646,15 +3670,15 @@ function useVirtualRows({
|
|
|
3646
3670
|
enabled = true,
|
|
3647
3671
|
resetKey
|
|
3648
3672
|
}) {
|
|
3649
|
-
const scrollRef = (0,
|
|
3650
|
-
const [scrollTop, setScrollTop] = (0,
|
|
3651
|
-
const [viewportHeight, setViewportHeight] = (0,
|
|
3652
|
-
const scrollToTop = (0,
|
|
3673
|
+
const scrollRef = (0, import_react17.useRef)(null);
|
|
3674
|
+
const [scrollTop, setScrollTop] = (0, import_react17.useState)(0);
|
|
3675
|
+
const [viewportHeight, setViewportHeight] = (0, import_react17.useState)(0);
|
|
3676
|
+
const scrollToTop = (0, import_react17.useCallback)(() => {
|
|
3653
3677
|
setScrollTop(0);
|
|
3654
3678
|
const element = scrollRef.current;
|
|
3655
3679
|
if (element) element.scrollTop = 0;
|
|
3656
3680
|
}, []);
|
|
3657
|
-
(0,
|
|
3681
|
+
(0, import_react17.useLayoutEffect)(() => {
|
|
3658
3682
|
if (!enabled) return;
|
|
3659
3683
|
const element = scrollRef.current;
|
|
3660
3684
|
if (!element) return;
|
|
@@ -3670,7 +3694,7 @@ function useVirtualRows({
|
|
|
3670
3694
|
observer.disconnect();
|
|
3671
3695
|
};
|
|
3672
3696
|
}, [enabled]);
|
|
3673
|
-
(0,
|
|
3697
|
+
(0, import_react17.useLayoutEffect)(() => {
|
|
3674
3698
|
if (!enabled) return;
|
|
3675
3699
|
const element = scrollRef.current;
|
|
3676
3700
|
if (element) element.scrollTop = 0;
|
|
@@ -3698,18 +3722,18 @@ function useVirtualRows({
|
|
|
3698
3722
|
|
|
3699
3723
|
// src/components/organisms/data-table/dataTable.tsx
|
|
3700
3724
|
var import_clsx23 = __toESM(require("clsx"), 1);
|
|
3701
|
-
var
|
|
3725
|
+
var import_react22 = __toESM(require("react"), 1);
|
|
3702
3726
|
var import_fa13 = require("react-icons/fa");
|
|
3703
3727
|
var import_md = require("react-icons/md");
|
|
3704
3728
|
|
|
3705
3729
|
// src/components/molecules/pagination/pagination.tsx
|
|
3706
|
-
var
|
|
3730
|
+
var import_react19 = __toESM(require("react"), 1);
|
|
3707
3731
|
var import_clsx20 = __toESM(require("clsx"), 1);
|
|
3708
3732
|
var import_fa10 = require("react-icons/fa");
|
|
3709
3733
|
|
|
3710
3734
|
// src/components/molecules/select/select.tsx
|
|
3711
3735
|
var import_clsx19 = __toESM(require("clsx"), 1);
|
|
3712
|
-
var
|
|
3736
|
+
var import_react18 = require("react");
|
|
3713
3737
|
var import_fa9 = require("react-icons/fa");
|
|
3714
3738
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
3715
3739
|
function ITSelect({
|
|
@@ -3730,8 +3754,8 @@ function ITSelect({
|
|
|
3730
3754
|
readOnly = false,
|
|
3731
3755
|
size = "md"
|
|
3732
3756
|
}) {
|
|
3733
|
-
const [isFocused, setIsFocused] = (0,
|
|
3734
|
-
const [localTouched, setLocalTouched] = (0,
|
|
3757
|
+
const [isFocused, setIsFocused] = (0, import_react18.useState)(false);
|
|
3758
|
+
const [localTouched, setLocalTouched] = (0, import_react18.useState)(false);
|
|
3735
3759
|
const inputTheme = theme.input || {};
|
|
3736
3760
|
const isTouched = touched !== void 0 ? touched : localTouched;
|
|
3737
3761
|
const isEmpty = value === void 0 || value === null || String(value).trim() === "";
|
|
@@ -3825,7 +3849,7 @@ var usePagination = ({
|
|
|
3825
3849
|
currentPage,
|
|
3826
3850
|
siblingCount = 1
|
|
3827
3851
|
}) => {
|
|
3828
|
-
return
|
|
3852
|
+
return import_react19.default.useMemo(() => {
|
|
3829
3853
|
const totalPageNumbers = siblingCount + 5;
|
|
3830
3854
|
if (totalPageNumbers >= totalPages) {
|
|
3831
3855
|
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
@@ -3993,7 +4017,7 @@ function ITPagination({
|
|
|
3993
4017
|
}
|
|
3994
4018
|
|
|
3995
4019
|
// src/components/molecules/search-select/search-select.tsx
|
|
3996
|
-
var
|
|
4020
|
+
var import_react20 = require("react");
|
|
3997
4021
|
var import_react_dom3 = require("react-dom");
|
|
3998
4022
|
var import_clsx21 = __toESM(require("clsx"), 1);
|
|
3999
4023
|
var import_fa11 = require("react-icons/fa");
|
|
@@ -4022,26 +4046,26 @@ function ITSearchSelect({
|
|
|
4022
4046
|
clearable = true,
|
|
4023
4047
|
onClear
|
|
4024
4048
|
}) {
|
|
4025
|
-
const [isOpen, setIsOpen] = (0,
|
|
4026
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
4027
|
-
const [isFocused, setIsFocused] = (0,
|
|
4028
|
-
const [localTouched, setLocalTouched] = (0,
|
|
4029
|
-
const containerRef = (0,
|
|
4030
|
-
const inputWrapperRef = (0,
|
|
4031
|
-
const timeoutRef = (0,
|
|
4049
|
+
const [isOpen, setIsOpen] = (0, import_react20.useState)(false);
|
|
4050
|
+
const [searchTerm, setSearchTerm] = (0, import_react20.useState)("");
|
|
4051
|
+
const [isFocused, setIsFocused] = (0, import_react20.useState)(false);
|
|
4052
|
+
const [localTouched, setLocalTouched] = (0, import_react20.useState)(false);
|
|
4053
|
+
const containerRef = (0, import_react20.useRef)(null);
|
|
4054
|
+
const inputWrapperRef = (0, import_react20.useRef)(null);
|
|
4055
|
+
const timeoutRef = (0, import_react20.useRef)(null);
|
|
4032
4056
|
const { panelRef, style: panelStyle } = useFloatingPanel(inputWrapperRef, isOpen, {
|
|
4033
4057
|
estimatedHeight: 260,
|
|
4034
4058
|
matchWidth: true
|
|
4035
4059
|
});
|
|
4036
|
-
const selectedOption = (0,
|
|
4060
|
+
const selectedOption = (0, import_react20.useMemo)(() => {
|
|
4037
4061
|
return options.find((opt) => opt[valueField] === value);
|
|
4038
4062
|
}, [options, value, valueField]);
|
|
4039
|
-
(0,
|
|
4063
|
+
(0, import_react20.useEffect)(() => {
|
|
4040
4064
|
if (!isFocused) {
|
|
4041
4065
|
setSearchTerm(selectedOption ? String(selectedOption[labelField]) : "");
|
|
4042
4066
|
}
|
|
4043
4067
|
}, [selectedOption, isFocused, labelField]);
|
|
4044
|
-
(0,
|
|
4068
|
+
(0, import_react20.useEffect)(() => {
|
|
4045
4069
|
function handleClickOutside(event) {
|
|
4046
4070
|
const target = event.target;
|
|
4047
4071
|
const inContainer = containerRef.current?.contains(target);
|
|
@@ -4054,7 +4078,7 @@ function ITSearchSelect({
|
|
|
4054
4078
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
4055
4079
|
}, []);
|
|
4056
4080
|
const selectedLabel = selectedOption ? String(selectedOption[labelField]) : "";
|
|
4057
|
-
const filteredOptions = (0,
|
|
4081
|
+
const filteredOptions = (0, import_react20.useMemo)(() => {
|
|
4058
4082
|
if (onSearch) return options;
|
|
4059
4083
|
if (!searchTerm || !isFocused || searchTerm === selectedLabel) return options;
|
|
4060
4084
|
return options.filter(
|
|
@@ -4225,7 +4249,7 @@ function ITSearchSelect({
|
|
|
4225
4249
|
|
|
4226
4250
|
// src/components/molecules/date-picker/datePicker.tsx
|
|
4227
4251
|
var import_clsx22 = __toESM(require("clsx"), 1);
|
|
4228
|
-
var
|
|
4252
|
+
var import_react21 = __toESM(require("react"), 1);
|
|
4229
4253
|
var import_react_dom4 = require("react-dom");
|
|
4230
4254
|
var import_fa12 = require("react-icons/fa");
|
|
4231
4255
|
var import_date_fns2 = require("date-fns");
|
|
@@ -4249,16 +4273,16 @@ function ITDatePicker({
|
|
|
4249
4273
|
maxDate,
|
|
4250
4274
|
range = false
|
|
4251
4275
|
}) {
|
|
4252
|
-
const [isOpen, setIsOpen] = (0,
|
|
4253
|
-
const [inputValue, setInputValue] = (0,
|
|
4254
|
-
const [isValidDate, setIsValidDate] = (0,
|
|
4255
|
-
const [internalRange, setInternalRange] = (0,
|
|
4256
|
-
const wrapperRef = (0,
|
|
4276
|
+
const [isOpen, setIsOpen] = (0, import_react21.useState)(false);
|
|
4277
|
+
const [inputValue, setInputValue] = (0, import_react21.useState)("");
|
|
4278
|
+
const [isValidDate, setIsValidDate] = (0, import_react21.useState)(true);
|
|
4279
|
+
const [internalRange, setInternalRange] = (0, import_react21.useState)([null, null]);
|
|
4280
|
+
const wrapperRef = (0, import_react21.useRef)(null);
|
|
4257
4281
|
const { panelRef, style: panelStyle } = useFloatingPanel(wrapperRef, isOpen, {
|
|
4258
4282
|
estimatedHeight: 360,
|
|
4259
4283
|
matchWidth: false
|
|
4260
4284
|
});
|
|
4261
|
-
const dateRange =
|
|
4285
|
+
const dateRange = import_react21.default.useMemo(() => {
|
|
4262
4286
|
if (range) {
|
|
4263
4287
|
if (Array.isArray(value)) return value;
|
|
4264
4288
|
return internalRange;
|
|
@@ -4266,7 +4290,7 @@ function ITDatePicker({
|
|
|
4266
4290
|
return [value instanceof Date ? value : null, null];
|
|
4267
4291
|
}, [value, range, internalRange]);
|
|
4268
4292
|
const [startDate, endDate] = dateRange;
|
|
4269
|
-
(0,
|
|
4293
|
+
(0, import_react21.useEffect)(() => {
|
|
4270
4294
|
if (range) {
|
|
4271
4295
|
if (startDate && endDate) {
|
|
4272
4296
|
setInputValue(`${formatDate(startDate)} - ${formatDate(endDate)}`);
|
|
@@ -4283,7 +4307,7 @@ function ITDatePicker({
|
|
|
4283
4307
|
}
|
|
4284
4308
|
}
|
|
4285
4309
|
}, [startDate, endDate, range]);
|
|
4286
|
-
(0,
|
|
4310
|
+
(0, import_react21.useEffect)(() => {
|
|
4287
4311
|
const handleClickOutside = (event) => {
|
|
4288
4312
|
const target = event.target;
|
|
4289
4313
|
const inWrapper = wrapperRef.current?.contains(target);
|
|
@@ -4557,11 +4581,11 @@ function ITDataTable({
|
|
|
4557
4581
|
overscan = 5,
|
|
4558
4582
|
stickyHeader = false
|
|
4559
4583
|
}) {
|
|
4560
|
-
const [viewMode, setViewMode] = (0,
|
|
4584
|
+
const [viewMode, setViewMode] = (0, import_react22.useState)(defaultView || "table");
|
|
4561
4585
|
const { ref: rootRef, width: containerWidth } = useElementSize();
|
|
4562
|
-
const [data, setData] = (0,
|
|
4563
|
-
const [totalItems, setTotalItems] = (0,
|
|
4564
|
-
const [isLoading, setIsLoading] = (0,
|
|
4586
|
+
const [data, setData] = (0, import_react22.useState)([]);
|
|
4587
|
+
const [totalItems, setTotalItems] = (0, import_react22.useState)(0);
|
|
4588
|
+
const [isLoading, setIsLoading] = (0, import_react22.useState)(fetchOnMount);
|
|
4565
4589
|
const isFixed = layout === "fixed";
|
|
4566
4590
|
const forcedCards = autoCardBreakpoint > 0 && containerWidth > 0 && containerWidth < autoCardBreakpoint;
|
|
4567
4591
|
const effectiveView = forcedCards ? "cards" : viewMode;
|
|
@@ -4571,7 +4595,7 @@ function ITDataTable({
|
|
|
4571
4595
|
const isStickyHeader = stickyHeader && isTableVirtual;
|
|
4572
4596
|
const resolvedRowHeight = rowHeight ?? getRowHeight(size, density);
|
|
4573
4597
|
const columnCount = columns.length;
|
|
4574
|
-
const pinnedMeta =
|
|
4598
|
+
const pinnedMeta = import_react22.default.useMemo(() => getPinnedColumnMeta(columns), [columns]);
|
|
4575
4599
|
const scrollOuterClass = isTableVirtual ? "relative min-h-[200px]" : "overflow-x-auto relative min-h-[200px]";
|
|
4576
4600
|
const {
|
|
4577
4601
|
currentPage,
|
|
@@ -4597,15 +4621,15 @@ function ITDataTable({
|
|
|
4597
4621
|
resetKey: `${currentPage}-${itemsPerPage}`
|
|
4598
4622
|
});
|
|
4599
4623
|
const windowData = isTableVirtual ? data.slice(startIndex, endIndex + 1) : data;
|
|
4600
|
-
const debounceTimerRef = (0,
|
|
4601
|
-
const hasFetchedRef = (0,
|
|
4602
|
-
const fetchDataRef = (0,
|
|
4624
|
+
const debounceTimerRef = (0, import_react22.useRef)(null);
|
|
4625
|
+
const hasFetchedRef = (0, import_react22.useRef)(false);
|
|
4626
|
+
const fetchDataRef = (0, import_react22.useRef)(fetchData);
|
|
4603
4627
|
fetchDataRef.current = fetchData;
|
|
4604
|
-
const externalFiltersRef = (0,
|
|
4628
|
+
const externalFiltersRef = (0, import_react22.useRef)(externalFilters);
|
|
4605
4629
|
externalFiltersRef.current = externalFilters;
|
|
4606
4630
|
const externalKey = JSON.stringify(externalFilters);
|
|
4607
4631
|
const computedTotalPages = Math.ceil(totalItems / itemsPerPage) || 1;
|
|
4608
|
-
const performFetch = (0,
|
|
4632
|
+
const performFetch = (0, import_react22.useCallback)(async () => {
|
|
4609
4633
|
setIsLoading(true);
|
|
4610
4634
|
try {
|
|
4611
4635
|
const response = await fetchDataRef.current({
|
|
@@ -4626,9 +4650,9 @@ function ITDataTable({
|
|
|
4626
4650
|
setIsLoading(false);
|
|
4627
4651
|
}
|
|
4628
4652
|
}, [currentPage, itemsPerPage, filters, sortConfig]);
|
|
4629
|
-
const performFetchRef = (0,
|
|
4653
|
+
const performFetchRef = (0, import_react22.useRef)(performFetch);
|
|
4630
4654
|
performFetchRef.current = performFetch;
|
|
4631
|
-
(0,
|
|
4655
|
+
(0, import_react22.useEffect)(() => {
|
|
4632
4656
|
if (!fetchOnMount && !hasFetchedRef.current) return;
|
|
4633
4657
|
if (debounceTimerRef.current) clearTimeout(debounceTimerRef.current);
|
|
4634
4658
|
debounceTimerRef.current = setTimeout(() => {
|
|
@@ -5028,20 +5052,6 @@ var import_fa15 = require("react-icons/fa");
|
|
|
5028
5052
|
// src/components/molecules/form-header/form-header.tsx
|
|
5029
5053
|
var import_fa14 = require("react-icons/fa");
|
|
5030
5054
|
|
|
5031
|
-
// src/theme/theme-context.ts
|
|
5032
|
-
var import_react22 = require("react");
|
|
5033
|
-
var ITThemeContext = (0, import_react22.createContext)(void 0);
|
|
5034
|
-
var useITTheme = () => {
|
|
5035
|
-
const context = (0, import_react22.useContext)(ITThemeContext);
|
|
5036
|
-
if (!context) {
|
|
5037
|
-
throw new Error("useITTheme must be used within an ITThemeProvider");
|
|
5038
|
-
}
|
|
5039
|
-
return context;
|
|
5040
|
-
};
|
|
5041
|
-
var useITThemeSafe = () => {
|
|
5042
|
-
return (0, import_react22.useContext)(ITThemeContext);
|
|
5043
|
-
};
|
|
5044
|
-
|
|
5045
5055
|
// src/utils/color.utils.ts
|
|
5046
5056
|
var isLightColor = (hex) => {
|
|
5047
5057
|
if (!hex || typeof hex !== "string") return false;
|
|
@@ -6607,6 +6617,7 @@ function ITPageHeader({
|
|
|
6607
6617
|
className
|
|
6608
6618
|
}) {
|
|
6609
6619
|
const showTopRow = breadcrumbs?.length || backAction;
|
|
6620
|
+
const flat = useITFlatAppearance();
|
|
6610
6621
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: `${className} space-y-3`, children: [
|
|
6611
6622
|
showTopRow && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
6612
6623
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
@@ -6625,7 +6636,7 @@ function ITPageHeader({
|
|
|
6625
6636
|
] }),
|
|
6626
6637
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-start justify-between gap-6", children: [
|
|
6627
6638
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-start gap-4 min-w-0", children: [
|
|
6628
|
-
icon && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6639
|
+
icon && !flat && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6629
6640
|
"div",
|
|
6630
6641
|
{
|
|
6631
6642
|
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",
|
|
@@ -6638,7 +6649,7 @@ function ITPageHeader({
|
|
|
6638
6649
|
ITText,
|
|
6639
6650
|
{
|
|
6640
6651
|
as: "h1",
|
|
6641
|
-
className: "text-3xl font-bold text-slate-800 dark:text-white tracking-tight leading-tight",
|
|
6652
|
+
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",
|
|
6642
6653
|
children: title
|
|
6643
6654
|
}
|
|
6644
6655
|
),
|
|
@@ -6646,7 +6657,7 @@ function ITPageHeader({
|
|
|
6646
6657
|
ITText,
|
|
6647
6658
|
{
|
|
6648
6659
|
as: "p",
|
|
6649
|
-
className: "text-sm font-light text-slate-500 dark:text-slate-400 mt-1 leading-relaxed",
|
|
6660
|
+
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",
|
|
6650
6661
|
children: description
|
|
6651
6662
|
}
|
|
6652
6663
|
)
|
|
@@ -7683,8 +7694,12 @@ function ITSidebar({
|
|
|
7683
7694
|
onSubItemClick,
|
|
7684
7695
|
subitemConnector = "dot",
|
|
7685
7696
|
header,
|
|
7686
|
-
notification
|
|
7697
|
+
notification,
|
|
7698
|
+
brand,
|
|
7699
|
+
onToggleCollapse,
|
|
7700
|
+
expandOnHover = true
|
|
7687
7701
|
}) {
|
|
7702
|
+
const flat = useITFlatAppearance();
|
|
7688
7703
|
const [expandedItems, setExpandedItems] = (0, import_react35.useState)(/* @__PURE__ */ new Set());
|
|
7689
7704
|
const [isHovering, setIsHovering] = (0, import_react35.useState)(false);
|
|
7690
7705
|
const sidebarRef = (0, import_react35.useRef)(null);
|
|
@@ -7738,6 +7753,9 @@ function ITSidebar({
|
|
|
7738
7753
|
});
|
|
7739
7754
|
}
|
|
7740
7755
|
}, [navigationItems]);
|
|
7756
|
+
const isSidebarCollapsed = visibleOnMobile ? false : isCollapsed && !(expandOnHover && isHovering);
|
|
7757
|
+
const sidebarWidth = isSidebarCollapsed ? flat ? "w-[72px]" : "w-[88px]" : flat ? "w-[248px]" : "w-[280px]";
|
|
7758
|
+
const fixedRail = isSidebarCollapsed && !expandOnHover;
|
|
7741
7759
|
const toggleExpanded = (itemId) => {
|
|
7742
7760
|
const newExpanded = new Set(expandedItems);
|
|
7743
7761
|
if (newExpanded.has(itemId)) newExpanded.delete(itemId);
|
|
@@ -7746,14 +7764,17 @@ function ITSidebar({
|
|
|
7746
7764
|
};
|
|
7747
7765
|
const handleItemClick = (item) => {
|
|
7748
7766
|
if (item.subitems && item.subitems.length > 0) {
|
|
7749
|
-
|
|
7767
|
+
if (isSidebarCollapsed && !expandOnHover) {
|
|
7768
|
+
setExpandedItems((prev) => new Set(prev).add(item.id));
|
|
7769
|
+
onToggleCollapse?.();
|
|
7770
|
+
} else {
|
|
7771
|
+
toggleExpanded(item.id);
|
|
7772
|
+
}
|
|
7750
7773
|
} else {
|
|
7751
7774
|
if (item.action) item.action();
|
|
7752
7775
|
if (onItemClick) onItemClick(item);
|
|
7753
7776
|
}
|
|
7754
7777
|
};
|
|
7755
|
-
const isSidebarCollapsed = visibleOnMobile ? false : !isHovering && isCollapsed;
|
|
7756
|
-
const sidebarWidth = isSidebarCollapsed ? "w-[88px]" : "w-[280px]";
|
|
7757
7778
|
const renderSubItem = (subitem) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("li", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
7758
7779
|
"button",
|
|
7759
7780
|
{
|
|
@@ -7766,7 +7787,7 @@ function ITSidebar({
|
|
|
7766
7787
|
style: {
|
|
7767
7788
|
color: subitem.isActive ? "var(--it-sidebar-active-color, var(--color-secondary-900))" : "var(--it-sidebar-label-color, var(--color-secondary-600))",
|
|
7768
7789
|
backgroundColor: subitem.isActive ? "var(--it-sidebar-active-bg, var(--color-secondary-50))" : "transparent",
|
|
7769
|
-
fontSize: "0.78rem",
|
|
7790
|
+
fontSize: flat ? "0.84rem" : "0.78rem",
|
|
7770
7791
|
fontWeight: subitem.isActive ? 600 : 500,
|
|
7771
7792
|
letterSpacing: "0.01em",
|
|
7772
7793
|
marginLeft: subitemConnector === "|" ? "-1px" : "0"
|
|
@@ -7784,7 +7805,7 @@ function ITSidebar({
|
|
|
7784
7805
|
}
|
|
7785
7806
|
},
|
|
7786
7807
|
children: [
|
|
7787
|
-
subitem.isActive && subitemConnector === "|" && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7808
|
+
subitem.isActive && subitemConnector === "|" && !flat && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7788
7809
|
"div",
|
|
7789
7810
|
{
|
|
7790
7811
|
className: "absolute left-0 top-1/3 bottom-1/3 w-[2.5px] rounded-r-full transition-all",
|
|
@@ -7919,22 +7940,40 @@ function ITSidebar({
|
|
|
7919
7940
|
${sidebarWidth}
|
|
7920
7941
|
${className}
|
|
7921
7942
|
${!visibleOnMobile ? "hidden lg:flex" : "flex"}
|
|
7922
|
-
shadow-[4px_0_32px_rgba(15,23,42,0.04)]
|
|
7943
|
+
${flat ? "" : "shadow-[4px_0_32px_rgba(15,23,42,0.04)]"}
|
|
7923
7944
|
`,
|
|
7924
7945
|
style: {
|
|
7925
7946
|
zIndex: 50,
|
|
7926
7947
|
backgroundColor: "var(--it-sidebar-bg, rgba(255, 255, 255, 0.90))",
|
|
7927
7948
|
borderRight: "1px solid var(--it-sidebar-border, var(--color-secondary-200))",
|
|
7928
|
-
WebkitBackdropFilter: "blur(12px)",
|
|
7929
|
-
backdropFilter: "blur(12px)"
|
|
7949
|
+
...flat ? {} : { WebkitBackdropFilter: "blur(12px)", backdropFilter: "blur(12px)" }
|
|
7930
7950
|
},
|
|
7931
7951
|
children: [
|
|
7952
|
+
brand && (brand.logo || brand.text) && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
7953
|
+
"div",
|
|
7954
|
+
{
|
|
7955
|
+
className: `flex items-center flex-shrink-0 h-[64px] ${isSidebarCollapsed ? "justify-center px-2" : "gap-2.5 px-7"}`,
|
|
7956
|
+
children: [
|
|
7957
|
+
brand.logo && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex-shrink-0 flex items-center", children: brand.logo }),
|
|
7958
|
+
brand.text && !isSidebarCollapsed && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7959
|
+
ITText,
|
|
7960
|
+
{
|
|
7961
|
+
as: "span",
|
|
7962
|
+
className: "text-[1.05rem] font-bold tracking-tight truncate",
|
|
7963
|
+
style: { color: "var(--it-sidebar-brand-color, var(--it-sidebar-label-color, var(--color-secondary-900)))" },
|
|
7964
|
+
children: brand.text
|
|
7965
|
+
}
|
|
7966
|
+
)
|
|
7967
|
+
]
|
|
7968
|
+
}
|
|
7969
|
+
),
|
|
7932
7970
|
header && !isSidebarCollapsed && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "px-4 pt-4 pb-1 flex-shrink-0", children: header }),
|
|
7933
7971
|
notification && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "px-4 pt-3 flex-shrink-0", children: renderNotification() }),
|
|
7934
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("nav", { "aria-label": "Componentes de la librer\xEDa", className:
|
|
7972
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("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__ */ (0, import_jsx_runtime57.jsx)("ul", { className: "space-y-1", children: navigationItems.map((item) => {
|
|
7935
7973
|
const hasSubmenu = !!item.subitems && item.subitems.length > 0;
|
|
7936
7974
|
const submenuId = `it-sidebar-submenu-${item.id}`;
|
|
7937
7975
|
const { className: badgeClassName, ...badgeRest } = item.badgeProps ?? {};
|
|
7976
|
+
const active = !!item.isActive && !(flat && hasSubmenu && !isSidebarCollapsed);
|
|
7938
7977
|
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("li", { className: "relative group/navitem", children: [
|
|
7939
7978
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
7940
7979
|
"div",
|
|
@@ -7947,18 +7986,18 @@ function ITSidebar({
|
|
|
7947
7986
|
className: `flex items-center cursor-pointer
|
|
7948
7987
|
transition-all duration-300 ease-[cubic-bezier(0.2,0,0,1)]
|
|
7949
7988
|
rounded-xl relative overflow-visible
|
|
7950
|
-
${isSidebarCollapsed ? "justify-center p-2 mb-1" : "justify-between px-3 py-2 mb-0.5"}
|
|
7989
|
+
${isSidebarCollapsed ? flat ? "justify-center h-10 mb-1" : "justify-center p-2 mb-1" : "justify-between px-3 py-2 mb-0.5"}
|
|
7951
7990
|
`,
|
|
7952
7991
|
style: {
|
|
7953
|
-
backgroundColor:
|
|
7954
|
-
boxShadow:
|
|
7955
|
-
border:
|
|
7992
|
+
backgroundColor: active ? "var(--it-sidebar-active-bg, var(--color-secondary-50))" : "transparent",
|
|
7993
|
+
boxShadow: active && !flat ? "var(--shadow-xs)" : "none",
|
|
7994
|
+
border: active && !flat ? "1px solid var(--it-sidebar-border, var(--color-secondary-200))" : "1px solid transparent"
|
|
7956
7995
|
},
|
|
7957
7996
|
onMouseEnter: (e) => {
|
|
7958
|
-
if (!
|
|
7997
|
+
if (!active) e.currentTarget.style.backgroundColor = "var(--it-sidebar-hover-bg, var(--color-secondary-100))";
|
|
7959
7998
|
},
|
|
7960
7999
|
onMouseLeave: (e) => {
|
|
7961
|
-
if (!
|
|
8000
|
+
if (!active) e.currentTarget.style.backgroundColor = "transparent";
|
|
7962
8001
|
},
|
|
7963
8002
|
onClick: () => handleItemClick(item),
|
|
7964
8003
|
onKeyDown: (e) => {
|
|
@@ -7968,7 +8007,7 @@ function ITSidebar({
|
|
|
7968
8007
|
}
|
|
7969
8008
|
},
|
|
7970
8009
|
children: [
|
|
7971
|
-
|
|
8010
|
+
active && !isSidebarCollapsed && !flat && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7972
8011
|
"div",
|
|
7973
8012
|
{
|
|
7974
8013
|
className: "absolute left-0 top-1/4 bottom-1/4 w-[3px] rounded-r-full transition-all",
|
|
@@ -7981,10 +8020,10 @@ function ITSidebar({
|
|
|
7981
8020
|
{
|
|
7982
8021
|
className: `transition-all duration-300 flex-shrink-0 flex items-center justify-center`,
|
|
7983
8022
|
style: {
|
|
7984
|
-
color:
|
|
7985
|
-
opacity:
|
|
7986
|
-
fontSize:
|
|
7987
|
-
filter:
|
|
8023
|
+
color: active ? "var(--it-sidebar-active-icon, var(--color-primary-500))" : "var(--it-sidebar-icon-color, #9ca3af)",
|
|
8024
|
+
opacity: active ? 1 : 0.8,
|
|
8025
|
+
fontSize: flat ? "1rem" : active ? "1.12rem" : "1.05rem",
|
|
8026
|
+
filter: active && !flat ? "drop-shadow(0 0 8px rgba(255,255,255,0.2))" : "none"
|
|
7988
8027
|
},
|
|
7989
8028
|
children: item.icon
|
|
7990
8029
|
}
|
|
@@ -7995,9 +8034,9 @@ function ITSidebar({
|
|
|
7995
8034
|
as: "span",
|
|
7996
8035
|
className: `transition-all duration-300 truncate tracking-wide`,
|
|
7997
8036
|
style: {
|
|
7998
|
-
color:
|
|
7999
|
-
fontSize: "0.8rem",
|
|
8000
|
-
fontWeight:
|
|
8037
|
+
color: active ? "var(--it-sidebar-active-color, #ffffff)" : "var(--it-sidebar-label-color, var(--color-secondary-300))",
|
|
8038
|
+
fontSize: flat ? "0.875rem" : "0.8rem",
|
|
8039
|
+
fontWeight: active ? "600" : "500"
|
|
8001
8040
|
},
|
|
8002
8041
|
children: item.label
|
|
8003
8042
|
}
|
|
@@ -8007,7 +8046,7 @@ function ITSidebar({
|
|
|
8007
8046
|
"div",
|
|
8008
8047
|
{
|
|
8009
8048
|
className: `flex-shrink-0 transition-transform duration-300 ease-[cubic-bezier(0.2,0,0,1)] ${expandedItems.has(item.id) ? "rotate-180" : ""}`,
|
|
8010
|
-
style: { color:
|
|
8049
|
+
style: { color: active ? "var(--it-sidebar-active-color, var(--color-secondary-900))" : "var(--it-sidebar-icon-color, var(--color-secondary-500))", opacity: 0.7 },
|
|
8011
8050
|
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_fa26.FaChevronDown, { className: "w-3 h-3" })
|
|
8012
8051
|
}
|
|
8013
8052
|
),
|
|
@@ -8028,7 +8067,21 @@ function ITSidebar({
|
|
|
8028
8067
|
]
|
|
8029
8068
|
}
|
|
8030
8069
|
),
|
|
8031
|
-
isSidebarCollapsed && /* @__PURE__ */ (0, import_jsx_runtime57.
|
|
8070
|
+
isSidebarCollapsed && flat && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8071
|
+
"div",
|
|
8072
|
+
{
|
|
8073
|
+
role: "tooltip",
|
|
8074
|
+
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]",
|
|
8075
|
+
style: {
|
|
8076
|
+
backgroundColor: "var(--it-sidebar-tooltip-bg, var(--color-secondary-900))",
|
|
8077
|
+
color: "var(--it-sidebar-tooltip-color, #ffffff)",
|
|
8078
|
+
fontSize: "0.78rem",
|
|
8079
|
+
fontWeight: 500
|
|
8080
|
+
},
|
|
8081
|
+
children: item.label
|
|
8082
|
+
}
|
|
8083
|
+
),
|
|
8084
|
+
isSidebarCollapsed && !flat && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
8032
8085
|
"div",
|
|
8033
8086
|
{
|
|
8034
8087
|
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)]",
|
|
@@ -8070,7 +8123,7 @@ function ITSidebar({
|
|
|
8070
8123
|
!isSidebarCollapsed && item.subitems && item.subitems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("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__ */ (0, import_jsx_runtime57.jsx)(
|
|
8071
8124
|
"ul",
|
|
8072
8125
|
{
|
|
8073
|
-
className: "ml-4 flex flex-col gap-0 py-0.5
|
|
8126
|
+
className: `${flat && subitemConnector === "|" ? "ml-[21px] pl-2" : "ml-4"} flex flex-col gap-0 py-0.5`,
|
|
8074
8127
|
style: {
|
|
8075
8128
|
borderLeft: subitemConnector === "|" ? "1px solid var(--it-sidebar-border, var(--color-secondary-200))" : "none"
|
|
8076
8129
|
},
|
|
@@ -10064,26 +10117,32 @@ function ITTopBar({
|
|
|
10064
10117
|
showMobileMenuButton,
|
|
10065
10118
|
onToggleMobileMenu,
|
|
10066
10119
|
navItems,
|
|
10067
|
-
onNavItemClick
|
|
10120
|
+
onNavItemClick,
|
|
10121
|
+
hideBrandOnDesktop = false,
|
|
10122
|
+
showDesktopMenuButton = false
|
|
10068
10123
|
}) {
|
|
10124
|
+
const flat = useITFlatAppearance();
|
|
10125
|
+
const initials = (userMenu?.userName ?? "").trim().split(/\s+/).slice(0, 2).map((word) => word.charAt(0).toUpperCase()).join("");
|
|
10069
10126
|
const [isUserMenuOpen, setIsUserMenuOpen] = (0, import_react43.useState)(false);
|
|
10070
10127
|
const userMenuRef = (0, import_react43.useRef)(null);
|
|
10071
10128
|
useClickOutside_default(userMenuRef, () => setIsUserMenuOpen(false));
|
|
10072
10129
|
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
10073
10130
|
"header",
|
|
10074
10131
|
{
|
|
10075
|
-
className:
|
|
10132
|
+
className: `sticky top-0 z-40 transition-all duration-300 ${flat ? "" : "backdrop-blur-md"}`,
|
|
10076
10133
|
style: {
|
|
10077
10134
|
backgroundColor: "var(--it-topbar-bg, rgba(255, 255, 255, 0.9))",
|
|
10078
10135
|
borderBottom: "1px solid var(--it-topbar-border, rgba(15, 23, 42, 0.06))",
|
|
10079
|
-
boxShadow: "var(--shadow-xs)"
|
|
10136
|
+
boxShadow: flat ? "none" : "var(--shadow-xs)"
|
|
10080
10137
|
},
|
|
10081
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className:
|
|
10138
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: `flex items-center justify-between px-6 lg:px-8 ${flat ? "h-[64px]" : "h-[72px]"}`, children: [
|
|
10082
10139
|
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-center gap-5", children: [
|
|
10083
10140
|
showMobileMenuButton && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
10084
10141
|
"button",
|
|
10085
10142
|
{
|
|
10086
|
-
|
|
10143
|
+
type: "button",
|
|
10144
|
+
"aria-label": "Men\xFA",
|
|
10145
|
+
className: `${showDesktopMenuButton ? "" : "lg:hidden"} p-2.5 -ml-2.5 rounded-xl transition-colors duration-200`,
|
|
10087
10146
|
style: {
|
|
10088
10147
|
color: "var(--it-topbar-icon, #64748b)"
|
|
10089
10148
|
},
|
|
@@ -10093,7 +10152,7 @@ function ITTopBar({
|
|
|
10093
10152
|
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_fa30.FaBars, { className: "w-[1.125rem] h-[1.125rem]" })
|
|
10094
10153
|
}
|
|
10095
10154
|
),
|
|
10096
|
-
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className:
|
|
10155
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: `items-center gap-3 ${hideBrandOnDesktop ? "flex lg:hidden" : "flex"}`, children: [
|
|
10097
10156
|
logo && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "flex-shrink-0 drop-shadow-sm", children: logo }),
|
|
10098
10157
|
logoText && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
10099
10158
|
ITText,
|
|
@@ -10127,7 +10186,7 @@ function ITTopBar({
|
|
|
10127
10186
|
item.id
|
|
10128
10187
|
)) })
|
|
10129
10188
|
] }),
|
|
10130
|
-
centerContent && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className:
|
|
10189
|
+
centerContent && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: `hidden lg:flex flex-1 min-w-0 items-center ${hideBrandOnDesktop ? "justify-start pr-4" : "justify-center px-4"}`, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "w-full max-w-[420px]", children: centerContent }) }),
|
|
10131
10190
|
(children || userMenu) && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
10132
10191
|
children,
|
|
10133
10192
|
userMenu && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "relative", children: [
|
|
@@ -10135,7 +10194,7 @@ function ITTopBar({
|
|
|
10135
10194
|
"button",
|
|
10136
10195
|
{
|
|
10137
10196
|
type: "button",
|
|
10138
|
-
className:
|
|
10197
|
+
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"}`,
|
|
10139
10198
|
style: {
|
|
10140
10199
|
backgroundColor: isUserMenuOpen ? "var(--it-topbar-user-hover, #f1f5f9)" : "transparent"
|
|
10141
10200
|
},
|
|
@@ -10155,10 +10214,21 @@ function ITTopBar({
|
|
|
10155
10214
|
src: userMenu.userImage,
|
|
10156
10215
|
alt: "Current user"
|
|
10157
10216
|
}
|
|
10217
|
+
) : flat && initials ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
10218
|
+
"div",
|
|
10219
|
+
{
|
|
10220
|
+
"aria-hidden": "true",
|
|
10221
|
+
className: "w-9 h-9 rounded-full flex items-center justify-center text-[0.8rem] font-semibold",
|
|
10222
|
+
style: {
|
|
10223
|
+
backgroundColor: "color-mix(in srgb, var(--color-primary, #3b82f6) 14%, transparent)",
|
|
10224
|
+
color: "var(--color-primary, #2563eb)"
|
|
10225
|
+
},
|
|
10226
|
+
children: initials
|
|
10227
|
+
}
|
|
10158
10228
|
) : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "w-9 h-9 rounded-full bg-slate-100 flex items-center justify-center ring-2 ring-white shadow-sm", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_fa30.FaUserCircle, { className: "w-6 h-6", style: { color: "var(--it-topbar-icon, #94a3b8)" } }) }),
|
|
10159
|
-
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "absolute bottom-0 right-0 w-2.5 h-2.5 bg-green-500 border-2 border-white rounded-full" })
|
|
10229
|
+
!flat && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "absolute bottom-0 right-0 w-2.5 h-2.5 bg-green-500 border-2 border-white rounded-full" })
|
|
10160
10230
|
] }),
|
|
10161
|
-
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className:
|
|
10231
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: `hidden sm:flex flex-col py-0.5 ${flat ? "text-right" : "text-left"}`, children: [
|
|
10162
10232
|
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
10163
10233
|
ITText,
|
|
10164
10234
|
{
|
|
@@ -10239,75 +10309,108 @@ function ITLayout({
|
|
|
10239
10309
|
sidebar,
|
|
10240
10310
|
children,
|
|
10241
10311
|
className = "",
|
|
10242
|
-
contentClassName = ""
|
|
10312
|
+
contentClassName = "",
|
|
10313
|
+
sidebarFullHeight = false
|
|
10243
10314
|
}) {
|
|
10244
10315
|
const [internalCollapsed, setInternalCollapsed] = (0, import_react44.useState)(true);
|
|
10245
10316
|
const [mobileSidebarOpen, setMobileSidebarOpen] = (0, import_react44.useState)(false);
|
|
10317
|
+
const flat = useITFlatAppearance();
|
|
10246
10318
|
const isControlled = sidebar.isCollapsed !== void 0;
|
|
10247
10319
|
const desktopCollapsed = isControlled ? sidebar.isCollapsed : internalCollapsed;
|
|
10248
10320
|
const handleToggleCollapse = isControlled ? sidebar.onToggleCollapse ?? (() => {
|
|
10249
10321
|
}) : () => setInternalCollapsed((v) => !v);
|
|
10250
10322
|
const layoutTokens = theme.layout;
|
|
10251
|
-
|
|
10252
|
-
|
|
10253
|
-
|
|
10323
|
+
const reservedWidth = desktopCollapsed ? flat ? "w-[72px]" : "w-[88px]" : flat ? "w-[248px]" : "w-[280px]";
|
|
10324
|
+
const toggleByButton = sidebar.expandOnHover === false;
|
|
10325
|
+
const handleMenuButton = () => {
|
|
10326
|
+
if (toggleByButton && window.matchMedia("(min-width: 1024px)").matches) handleToggleCollapse();
|
|
10327
|
+
else setMobileSidebarOpen((v) => !v);
|
|
10328
|
+
};
|
|
10329
|
+
const brand = sidebarFullHeight ? sidebar.brand ?? { logo: topBar.logo, text: topBar.logoText } : sidebar.brand;
|
|
10330
|
+
const topBarNode = /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
10331
|
+
ITTopBar,
|
|
10332
|
+
{
|
|
10333
|
+
...topBar,
|
|
10334
|
+
hideBrandOnDesktop: sidebarFullHeight || topBar.hideBrandOnDesktop,
|
|
10335
|
+
showMobileMenuButton: true,
|
|
10336
|
+
showDesktopMenuButton: toggleByButton || topBar.showDesktopMenuButton,
|
|
10337
|
+
onToggleMobileMenu: handleMenuButton
|
|
10338
|
+
}
|
|
10339
|
+
);
|
|
10340
|
+
const desktopSidebar = (
|
|
10341
|
+
// Full-height: the sidebar sits beside the top bar, so it needs to win the
|
|
10342
|
+
// stacking order when the collapsed rail expands over the content on hover.
|
|
10343
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: `hidden lg:block relative h-full ${sidebarFullHeight ? "z-50" : "z-40"}`, children: [
|
|
10344
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: `${reservedWidth} h-full flex-shrink-0` }),
|
|
10345
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "absolute top-0 left-0 h-full", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
10346
|
+
ITSidebar,
|
|
10347
|
+
{
|
|
10348
|
+
...sidebar,
|
|
10349
|
+
brand,
|
|
10350
|
+
isCollapsed: desktopCollapsed,
|
|
10351
|
+
onToggleCollapse: handleToggleCollapse,
|
|
10352
|
+
visibleOnMobile: false,
|
|
10353
|
+
className: `h-full ${flat ? "" : "drop-shadow-2xl"} transition-all duration-400 ease-[cubic-bezier(0.2,0,0,1)] flex-shrink-0`
|
|
10354
|
+
}
|
|
10355
|
+
) })
|
|
10356
|
+
] })
|
|
10357
|
+
);
|
|
10358
|
+
const mobileSidebar = mobileSidebarOpen && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
10359
|
+
"div",
|
|
10360
|
+
{
|
|
10361
|
+
className: "lg:hidden fixed inset-0 z-[40] transition-opacity duration-300 backdrop-blur-sm bg-black/40",
|
|
10362
|
+
onClick: () => setMobileSidebarOpen(false),
|
|
10363
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
10364
|
+
"div",
|
|
10365
|
+
{
|
|
10366
|
+
className: "h-full w-fit flex transform transition-transform duration-300 ease-[cubic-bezier(0.2,0,0,1)]",
|
|
10367
|
+
onClick: (e) => e.stopPropagation(),
|
|
10368
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
10369
|
+
ITSidebar,
|
|
10370
|
+
{
|
|
10371
|
+
...sidebar,
|
|
10372
|
+
brand,
|
|
10373
|
+
isCollapsed: false,
|
|
10374
|
+
visibleOnMobile: true,
|
|
10375
|
+
className: "h-full shadow-2xl relative z-[60]",
|
|
10376
|
+
onToggleCollapse: () => setMobileSidebarOpen(false),
|
|
10377
|
+
onItemClick: () => setMobileSidebarOpen(false),
|
|
10378
|
+
onSubItemClick: () => setMobileSidebarOpen(false)
|
|
10379
|
+
}
|
|
10380
|
+
)
|
|
10381
|
+
}
|
|
10382
|
+
)
|
|
10383
|
+
}
|
|
10384
|
+
);
|
|
10385
|
+
const main = /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("main", { className: "flex-1 overflow-y-auto w-full custom-scrollbar relative z-0", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: (0, import_clsx52.default)("mx-auto w-full max-w-7xl px-4 sm:px-6 lg:px-8 py-6 h-full", contentClassName), children }) });
|
|
10386
|
+
if (sidebarFullHeight) {
|
|
10387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
10388
|
+
"div",
|
|
10254
10389
|
{
|
|
10255
|
-
|
|
10256
|
-
|
|
10257
|
-
|
|
10390
|
+
className: `flex h-screen overflow-hidden w-full relative ${className}`,
|
|
10391
|
+
style: { backgroundColor: layoutTokens.backgroundColor },
|
|
10392
|
+
children: [
|
|
10393
|
+
desktopSidebar,
|
|
10394
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex flex-col flex-1 min-w-0 overflow-hidden", children: [
|
|
10395
|
+
topBarNode,
|
|
10396
|
+
main
|
|
10397
|
+
] }),
|
|
10398
|
+
mobileSidebar
|
|
10399
|
+
]
|
|
10258
10400
|
}
|
|
10259
|
-
)
|
|
10401
|
+
);
|
|
10402
|
+
}
|
|
10403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: `flex flex-col h-screen overflow-hidden w-full ${className}`, children: [
|
|
10404
|
+
topBarNode,
|
|
10260
10405
|
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
10261
10406
|
"div",
|
|
10262
10407
|
{
|
|
10263
10408
|
className: "flex flex-1 overflow-hidden relative",
|
|
10264
10409
|
style: { backgroundColor: layoutTokens.backgroundColor },
|
|
10265
10410
|
children: [
|
|
10266
|
-
|
|
10267
|
-
|
|
10268
|
-
|
|
10269
|
-
{
|
|
10270
|
-
className: `${desktopCollapsed ? "w-[88px]" : "w-[280px]"} h-full flex-shrink-0`
|
|
10271
|
-
}
|
|
10272
|
-
),
|
|
10273
|
-
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "absolute top-0 left-0 h-full", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
10274
|
-
ITSidebar,
|
|
10275
|
-
{
|
|
10276
|
-
...sidebar,
|
|
10277
|
-
isCollapsed: desktopCollapsed,
|
|
10278
|
-
onToggleCollapse: handleToggleCollapse,
|
|
10279
|
-
visibleOnMobile: false,
|
|
10280
|
-
className: "h-full drop-shadow-2xl transition-all duration-400 ease-[cubic-bezier(0.2,0,0,1)] flex-shrink-0"
|
|
10281
|
-
}
|
|
10282
|
-
) })
|
|
10283
|
-
] }),
|
|
10284
|
-
mobileSidebarOpen && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
10285
|
-
"div",
|
|
10286
|
-
{
|
|
10287
|
-
className: "lg:hidden fixed inset-0 z-[40] transition-opacity duration-300 backdrop-blur-sm bg-black/40",
|
|
10288
|
-
onClick: () => setMobileSidebarOpen(false),
|
|
10289
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
10290
|
-
"div",
|
|
10291
|
-
{
|
|
10292
|
-
className: "h-full w-fit flex transform transition-transform duration-300 ease-[cubic-bezier(0.2,0,0,1)]",
|
|
10293
|
-
onClick: (e) => e.stopPropagation(),
|
|
10294
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
10295
|
-
ITSidebar,
|
|
10296
|
-
{
|
|
10297
|
-
...sidebar,
|
|
10298
|
-
isCollapsed: false,
|
|
10299
|
-
visibleOnMobile: true,
|
|
10300
|
-
className: "h-full shadow-2xl relative z-[60]",
|
|
10301
|
-
onToggleCollapse: () => setMobileSidebarOpen(false),
|
|
10302
|
-
onItemClick: () => setMobileSidebarOpen(false),
|
|
10303
|
-
onSubItemClick: () => setMobileSidebarOpen(false)
|
|
10304
|
-
}
|
|
10305
|
-
)
|
|
10306
|
-
}
|
|
10307
|
-
)
|
|
10308
|
-
}
|
|
10309
|
-
),
|
|
10310
|
-
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("main", { className: "flex-1 overflow-y-auto w-full custom-scrollbar relative z-0", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: (0, import_clsx52.default)("mx-auto w-full max-w-7xl px-4 sm:px-6 lg:px-8 py-6 h-full", contentClassName), children }) })
|
|
10411
|
+
desktopSidebar,
|
|
10412
|
+
mobileSidebar,
|
|
10413
|
+
main
|
|
10311
10414
|
]
|
|
10312
10415
|
}
|
|
10313
10416
|
)
|
|
@@ -10867,7 +10970,8 @@ function ITThemeProvider({
|
|
|
10867
10970
|
showFab = true,
|
|
10868
10971
|
density = 1,
|
|
10869
10972
|
radius,
|
|
10870
|
-
shadow
|
|
10973
|
+
shadow,
|
|
10974
|
+
appearance = "soft"
|
|
10871
10975
|
}) {
|
|
10872
10976
|
const [palette2, setPaletteState] = (0, import_react46.useState)(() => {
|
|
10873
10977
|
const basePalette = {
|
|
@@ -10980,6 +11084,11 @@ function ITThemeProvider({
|
|
|
10980
11084
|
root.style.fontSize = "";
|
|
10981
11085
|
};
|
|
10982
11086
|
}, [density]);
|
|
11087
|
+
(0, import_react46.useLayoutEffect)(() => {
|
|
11088
|
+
const root = document.documentElement;
|
|
11089
|
+
root.setAttribute("data-it-appearance", appearance);
|
|
11090
|
+
return () => root.removeAttribute("data-it-appearance");
|
|
11091
|
+
}, [appearance]);
|
|
10983
11092
|
(0, import_react46.useLayoutEffect)(() => {
|
|
10984
11093
|
const root = document.documentElement;
|
|
10985
11094
|
const radiusTokens = ["xs", "sm", "md", "lg", "xl", "2xl", "3xl"];
|
|
@@ -12261,7 +12370,8 @@ function ITThemeProvider({
|
|
|
12261
12370
|
applyPreset,
|
|
12262
12371
|
resolvedTheme,
|
|
12263
12372
|
darkModeMode,
|
|
12264
|
-
setDarkModeMode
|
|
12373
|
+
setDarkModeMode,
|
|
12374
|
+
appearance
|
|
12265
12375
|
},
|
|
12266
12376
|
children: [
|
|
12267
12377
|
children,
|
|
@@ -12522,6 +12632,7 @@ var createValidationSchema = (fields) => Yup.object().shape(
|
|
|
12522
12632
|
useDebouncedSearch,
|
|
12523
12633
|
useEditableRow,
|
|
12524
12634
|
useFloatingPanel,
|
|
12635
|
+
useITFlatAppearance,
|
|
12525
12636
|
useITTheme,
|
|
12526
12637
|
useITThemeSafe,
|
|
12527
12638
|
useTableState
|