@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.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,10 @@ function ITSidebar({
|
|
|
7683
7694
|
onSubItemClick,
|
|
7684
7695
|
subitemConnector = "dot",
|
|
7685
7696
|
header,
|
|
7686
|
-
notification
|
|
7697
|
+
notification,
|
|
7698
|
+
brand
|
|
7687
7699
|
}) {
|
|
7700
|
+
const flat = useITFlatAppearance();
|
|
7688
7701
|
const [expandedItems, setExpandedItems] = (0, import_react35.useState)(/* @__PURE__ */ new Set());
|
|
7689
7702
|
const [isHovering, setIsHovering] = (0, import_react35.useState)(false);
|
|
7690
7703
|
const sidebarRef = (0, import_react35.useRef)(null);
|
|
@@ -7753,7 +7766,7 @@ function ITSidebar({
|
|
|
7753
7766
|
}
|
|
7754
7767
|
};
|
|
7755
7768
|
const isSidebarCollapsed = visibleOnMobile ? false : !isHovering && isCollapsed;
|
|
7756
|
-
const sidebarWidth = isSidebarCollapsed ? "w-[88px]" : "w-[280px]";
|
|
7769
|
+
const sidebarWidth = isSidebarCollapsed ? "w-[88px]" : flat ? "w-[248px]" : "w-[280px]";
|
|
7757
7770
|
const renderSubItem = (subitem) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("li", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
7758
7771
|
"button",
|
|
7759
7772
|
{
|
|
@@ -7919,16 +7932,33 @@ function ITSidebar({
|
|
|
7919
7932
|
${sidebarWidth}
|
|
7920
7933
|
${className}
|
|
7921
7934
|
${!visibleOnMobile ? "hidden lg:flex" : "flex"}
|
|
7922
|
-
shadow-[4px_0_32px_rgba(15,23,42,0.04)]
|
|
7935
|
+
${flat ? "" : "shadow-[4px_0_32px_rgba(15,23,42,0.04)]"}
|
|
7923
7936
|
`,
|
|
7924
7937
|
style: {
|
|
7925
7938
|
zIndex: 50,
|
|
7926
7939
|
backgroundColor: "var(--it-sidebar-bg, rgba(255, 255, 255, 0.90))",
|
|
7927
7940
|
borderRight: "1px solid var(--it-sidebar-border, var(--color-secondary-200))",
|
|
7928
|
-
WebkitBackdropFilter: "blur(12px)",
|
|
7929
|
-
backdropFilter: "blur(12px)"
|
|
7941
|
+
...flat ? {} : { WebkitBackdropFilter: "blur(12px)", backdropFilter: "blur(12px)" }
|
|
7930
7942
|
},
|
|
7931
7943
|
children: [
|
|
7944
|
+
brand && (brand.logo || brand.text) && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
7945
|
+
"div",
|
|
7946
|
+
{
|
|
7947
|
+
className: `flex items-center flex-shrink-0 h-[64px] ${isSidebarCollapsed ? "justify-center px-2" : "gap-2.5 px-7"}`,
|
|
7948
|
+
children: [
|
|
7949
|
+
brand.logo && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex-shrink-0 flex items-center", children: brand.logo }),
|
|
7950
|
+
brand.text && !isSidebarCollapsed && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7951
|
+
ITText,
|
|
7952
|
+
{
|
|
7953
|
+
as: "span",
|
|
7954
|
+
className: "text-[1.05rem] font-bold tracking-tight truncate",
|
|
7955
|
+
style: { color: "var(--it-sidebar-brand-color, var(--it-sidebar-label-color, var(--color-secondary-900)))" },
|
|
7956
|
+
children: brand.text
|
|
7957
|
+
}
|
|
7958
|
+
)
|
|
7959
|
+
]
|
|
7960
|
+
}
|
|
7961
|
+
),
|
|
7932
7962
|
header && !isSidebarCollapsed && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "px-4 pt-4 pb-1 flex-shrink-0", children: header }),
|
|
7933
7963
|
notification && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "px-4 pt-3 flex-shrink-0", children: renderNotification() }),
|
|
7934
7964
|
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("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__ */ (0, import_jsx_runtime57.jsx)("ul", { className: "space-y-1", children: navigationItems.map((item) => {
|
|
@@ -7951,8 +7981,8 @@ function ITSidebar({
|
|
|
7951
7981
|
`,
|
|
7952
7982
|
style: {
|
|
7953
7983
|
backgroundColor: item.isActive ? "var(--it-sidebar-active-bg, var(--color-secondary-50))" : "transparent",
|
|
7954
|
-
boxShadow: item.isActive ? "var(--shadow-xs)" : "none",
|
|
7955
|
-
border: item.isActive ? "1px solid var(--it-sidebar-border, var(--color-secondary-200))" : "1px solid transparent"
|
|
7984
|
+
boxShadow: item.isActive && !flat ? "var(--shadow-xs)" : "none",
|
|
7985
|
+
border: item.isActive && !flat ? "1px solid var(--it-sidebar-border, var(--color-secondary-200))" : "1px solid transparent"
|
|
7956
7986
|
},
|
|
7957
7987
|
onMouseEnter: (e) => {
|
|
7958
7988
|
if (!item.isActive) e.currentTarget.style.backgroundColor = "var(--it-sidebar-hover-bg, var(--color-secondary-100))";
|
|
@@ -7968,7 +7998,7 @@ function ITSidebar({
|
|
|
7968
7998
|
}
|
|
7969
7999
|
},
|
|
7970
8000
|
children: [
|
|
7971
|
-
item.isActive && !isSidebarCollapsed && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8001
|
+
item.isActive && !isSidebarCollapsed && !flat && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
7972
8002
|
"div",
|
|
7973
8003
|
{
|
|
7974
8004
|
className: "absolute left-0 top-1/4 bottom-1/4 w-[3px] rounded-r-full transition-all",
|
|
@@ -7983,8 +8013,8 @@ function ITSidebar({
|
|
|
7983
8013
|
style: {
|
|
7984
8014
|
color: item.isActive ? "var(--it-sidebar-active-icon, var(--color-primary-500))" : "var(--it-sidebar-icon-color, #9ca3af)",
|
|
7985
8015
|
opacity: item.isActive ? 1 : 0.8,
|
|
7986
|
-
fontSize: item.isActive ? "1.12rem" : "1.05rem",
|
|
7987
|
-
filter: item.isActive ? "drop-shadow(0 0 8px rgba(255,255,255,0.2))" : "none"
|
|
8016
|
+
fontSize: flat ? "1rem" : item.isActive ? "1.12rem" : "1.05rem",
|
|
8017
|
+
filter: item.isActive && !flat ? "drop-shadow(0 0 8px rgba(255,255,255,0.2))" : "none"
|
|
7988
8018
|
},
|
|
7989
8019
|
children: item.icon
|
|
7990
8020
|
}
|
|
@@ -7996,7 +8026,7 @@ function ITSidebar({
|
|
|
7996
8026
|
className: `transition-all duration-300 truncate tracking-wide`,
|
|
7997
8027
|
style: {
|
|
7998
8028
|
color: item.isActive ? "var(--it-sidebar-active-color, #ffffff)" : "var(--it-sidebar-label-color, var(--color-secondary-300))",
|
|
7999
|
-
fontSize: "0.8rem",
|
|
8029
|
+
fontSize: flat ? "0.875rem" : "0.8rem",
|
|
8000
8030
|
fontWeight: item.isActive ? "600" : "500"
|
|
8001
8031
|
},
|
|
8002
8032
|
children: item.label
|
|
@@ -10064,21 +10094,24 @@ function ITTopBar({
|
|
|
10064
10094
|
showMobileMenuButton,
|
|
10065
10095
|
onToggleMobileMenu,
|
|
10066
10096
|
navItems,
|
|
10067
|
-
onNavItemClick
|
|
10097
|
+
onNavItemClick,
|
|
10098
|
+
hideBrandOnDesktop = false
|
|
10068
10099
|
}) {
|
|
10100
|
+
const flat = useITFlatAppearance();
|
|
10101
|
+
const initials = (userMenu?.userName ?? "").trim().split(/\s+/).slice(0, 2).map((word) => word.charAt(0).toUpperCase()).join("");
|
|
10069
10102
|
const [isUserMenuOpen, setIsUserMenuOpen] = (0, import_react43.useState)(false);
|
|
10070
10103
|
const userMenuRef = (0, import_react43.useRef)(null);
|
|
10071
10104
|
useClickOutside_default(userMenuRef, () => setIsUserMenuOpen(false));
|
|
10072
10105
|
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
10073
10106
|
"header",
|
|
10074
10107
|
{
|
|
10075
|
-
className:
|
|
10108
|
+
className: `sticky top-0 z-40 transition-all duration-300 ${flat ? "" : "backdrop-blur-md"}`,
|
|
10076
10109
|
style: {
|
|
10077
10110
|
backgroundColor: "var(--it-topbar-bg, rgba(255, 255, 255, 0.9))",
|
|
10078
10111
|
borderBottom: "1px solid var(--it-topbar-border, rgba(15, 23, 42, 0.06))",
|
|
10079
|
-
boxShadow: "var(--shadow-xs)"
|
|
10112
|
+
boxShadow: flat ? "none" : "var(--shadow-xs)"
|
|
10080
10113
|
},
|
|
10081
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className:
|
|
10114
|
+
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
10115
|
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-center gap-5", children: [
|
|
10083
10116
|
showMobileMenuButton && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
10084
10117
|
"button",
|
|
@@ -10093,7 +10126,7 @@ function ITTopBar({
|
|
|
10093
10126
|
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_fa30.FaBars, { className: "w-[1.125rem] h-[1.125rem]" })
|
|
10094
10127
|
}
|
|
10095
10128
|
),
|
|
10096
|
-
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className:
|
|
10129
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: `items-center gap-3 ${hideBrandOnDesktop ? "flex lg:hidden" : "flex"}`, children: [
|
|
10097
10130
|
logo && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "flex-shrink-0 drop-shadow-sm", children: logo }),
|
|
10098
10131
|
logoText && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
10099
10132
|
ITText,
|
|
@@ -10127,7 +10160,7 @@ function ITTopBar({
|
|
|
10127
10160
|
item.id
|
|
10128
10161
|
)) })
|
|
10129
10162
|
] }),
|
|
10130
|
-
centerContent && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className:
|
|
10163
|
+
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
10164
|
(children || userMenu) && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
10132
10165
|
children,
|
|
10133
10166
|
userMenu && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "relative", children: [
|
|
@@ -10135,7 +10168,7 @@ function ITTopBar({
|
|
|
10135
10168
|
"button",
|
|
10136
10169
|
{
|
|
10137
10170
|
type: "button",
|
|
10138
|
-
className:
|
|
10171
|
+
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
10172
|
style: {
|
|
10140
10173
|
backgroundColor: isUserMenuOpen ? "var(--it-topbar-user-hover, #f1f5f9)" : "transparent"
|
|
10141
10174
|
},
|
|
@@ -10155,10 +10188,21 @@ function ITTopBar({
|
|
|
10155
10188
|
src: userMenu.userImage,
|
|
10156
10189
|
alt: "Current user"
|
|
10157
10190
|
}
|
|
10191
|
+
) : flat && initials ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
10192
|
+
"div",
|
|
10193
|
+
{
|
|
10194
|
+
"aria-hidden": "true",
|
|
10195
|
+
className: "w-9 h-9 rounded-full flex items-center justify-center text-[0.8rem] font-semibold",
|
|
10196
|
+
style: {
|
|
10197
|
+
backgroundColor: "color-mix(in srgb, var(--color-primary, #3b82f6) 14%, transparent)",
|
|
10198
|
+
color: "var(--color-primary, #2563eb)"
|
|
10199
|
+
},
|
|
10200
|
+
children: initials
|
|
10201
|
+
}
|
|
10158
10202
|
) : /* @__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" })
|
|
10203
|
+
!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
10204
|
] }),
|
|
10161
|
-
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className:
|
|
10205
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: `hidden sm:flex flex-col py-0.5 ${flat ? "text-right" : "text-left"}`, children: [
|
|
10162
10206
|
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
10163
10207
|
ITText,
|
|
10164
10208
|
{
|
|
@@ -10239,75 +10283,102 @@ function ITLayout({
|
|
|
10239
10283
|
sidebar,
|
|
10240
10284
|
children,
|
|
10241
10285
|
className = "",
|
|
10242
|
-
contentClassName = ""
|
|
10286
|
+
contentClassName = "",
|
|
10287
|
+
sidebarFullHeight = false
|
|
10243
10288
|
}) {
|
|
10244
10289
|
const [internalCollapsed, setInternalCollapsed] = (0, import_react44.useState)(true);
|
|
10245
10290
|
const [mobileSidebarOpen, setMobileSidebarOpen] = (0, import_react44.useState)(false);
|
|
10291
|
+
const flat = useITFlatAppearance();
|
|
10246
10292
|
const isControlled = sidebar.isCollapsed !== void 0;
|
|
10247
10293
|
const desktopCollapsed = isControlled ? sidebar.isCollapsed : internalCollapsed;
|
|
10248
10294
|
const handleToggleCollapse = isControlled ? sidebar.onToggleCollapse ?? (() => {
|
|
10249
10295
|
}) : () => setInternalCollapsed((v) => !v);
|
|
10250
10296
|
const layoutTokens = theme.layout;
|
|
10251
|
-
|
|
10252
|
-
|
|
10253
|
-
|
|
10297
|
+
const reservedWidth = desktopCollapsed ? "w-[88px]" : flat ? "w-[248px]" : "w-[280px]";
|
|
10298
|
+
const brand = sidebarFullHeight ? sidebar.brand ?? { logo: topBar.logo, text: topBar.logoText } : sidebar.brand;
|
|
10299
|
+
const topBarNode = /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
10300
|
+
ITTopBar,
|
|
10301
|
+
{
|
|
10302
|
+
...topBar,
|
|
10303
|
+
hideBrandOnDesktop: sidebarFullHeight || topBar.hideBrandOnDesktop,
|
|
10304
|
+
showMobileMenuButton: true,
|
|
10305
|
+
onToggleMobileMenu: () => setMobileSidebarOpen((v) => !v)
|
|
10306
|
+
}
|
|
10307
|
+
);
|
|
10308
|
+
const desktopSidebar = (
|
|
10309
|
+
// Full-height: the sidebar sits beside the top bar, so it needs to win the
|
|
10310
|
+
// stacking order when the collapsed rail expands over the content on hover.
|
|
10311
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: `hidden lg:block relative h-full ${sidebarFullHeight ? "z-50" : "z-40"}`, children: [
|
|
10312
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: `${reservedWidth} h-full flex-shrink-0` }),
|
|
10313
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { className: "absolute top-0 left-0 h-full", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
10314
|
+
ITSidebar,
|
|
10315
|
+
{
|
|
10316
|
+
...sidebar,
|
|
10317
|
+
brand,
|
|
10318
|
+
isCollapsed: desktopCollapsed,
|
|
10319
|
+
onToggleCollapse: handleToggleCollapse,
|
|
10320
|
+
visibleOnMobile: false,
|
|
10321
|
+
className: `h-full ${flat ? "" : "drop-shadow-2xl"} transition-all duration-400 ease-[cubic-bezier(0.2,0,0,1)] flex-shrink-0`
|
|
10322
|
+
}
|
|
10323
|
+
) })
|
|
10324
|
+
] })
|
|
10325
|
+
);
|
|
10326
|
+
const mobileSidebar = mobileSidebarOpen && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
10327
|
+
"div",
|
|
10328
|
+
{
|
|
10329
|
+
className: "lg:hidden fixed inset-0 z-[40] transition-opacity duration-300 backdrop-blur-sm bg-black/40",
|
|
10330
|
+
onClick: () => setMobileSidebarOpen(false),
|
|
10331
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
10332
|
+
"div",
|
|
10333
|
+
{
|
|
10334
|
+
className: "h-full w-fit flex transform transition-transform duration-300 ease-[cubic-bezier(0.2,0,0,1)]",
|
|
10335
|
+
onClick: (e) => e.stopPropagation(),
|
|
10336
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
10337
|
+
ITSidebar,
|
|
10338
|
+
{
|
|
10339
|
+
...sidebar,
|
|
10340
|
+
brand,
|
|
10341
|
+
isCollapsed: false,
|
|
10342
|
+
visibleOnMobile: true,
|
|
10343
|
+
className: "h-full shadow-2xl relative z-[60]",
|
|
10344
|
+
onToggleCollapse: () => setMobileSidebarOpen(false),
|
|
10345
|
+
onItemClick: () => setMobileSidebarOpen(false),
|
|
10346
|
+
onSubItemClick: () => setMobileSidebarOpen(false)
|
|
10347
|
+
}
|
|
10348
|
+
)
|
|
10349
|
+
}
|
|
10350
|
+
)
|
|
10351
|
+
}
|
|
10352
|
+
);
|
|
10353
|
+
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 }) });
|
|
10354
|
+
if (sidebarFullHeight) {
|
|
10355
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
10356
|
+
"div",
|
|
10254
10357
|
{
|
|
10255
|
-
|
|
10256
|
-
|
|
10257
|
-
|
|
10358
|
+
className: `flex h-screen overflow-hidden w-full relative ${className}`,
|
|
10359
|
+
style: { backgroundColor: layoutTokens.backgroundColor },
|
|
10360
|
+
children: [
|
|
10361
|
+
desktopSidebar,
|
|
10362
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex flex-col flex-1 min-w-0 overflow-hidden", children: [
|
|
10363
|
+
topBarNode,
|
|
10364
|
+
main
|
|
10365
|
+
] }),
|
|
10366
|
+
mobileSidebar
|
|
10367
|
+
]
|
|
10258
10368
|
}
|
|
10259
|
-
)
|
|
10369
|
+
);
|
|
10370
|
+
}
|
|
10371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: `flex flex-col h-screen overflow-hidden w-full ${className}`, children: [
|
|
10372
|
+
topBarNode,
|
|
10260
10373
|
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
10261
10374
|
"div",
|
|
10262
10375
|
{
|
|
10263
10376
|
className: "flex flex-1 overflow-hidden relative",
|
|
10264
10377
|
style: { backgroundColor: layoutTokens.backgroundColor },
|
|
10265
10378
|
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 }) })
|
|
10379
|
+
desktopSidebar,
|
|
10380
|
+
mobileSidebar,
|
|
10381
|
+
main
|
|
10311
10382
|
]
|
|
10312
10383
|
}
|
|
10313
10384
|
)
|
|
@@ -10867,7 +10938,8 @@ function ITThemeProvider({
|
|
|
10867
10938
|
showFab = true,
|
|
10868
10939
|
density = 1,
|
|
10869
10940
|
radius,
|
|
10870
|
-
shadow
|
|
10941
|
+
shadow,
|
|
10942
|
+
appearance = "soft"
|
|
10871
10943
|
}) {
|
|
10872
10944
|
const [palette2, setPaletteState] = (0, import_react46.useState)(() => {
|
|
10873
10945
|
const basePalette = {
|
|
@@ -10980,6 +11052,11 @@ function ITThemeProvider({
|
|
|
10980
11052
|
root.style.fontSize = "";
|
|
10981
11053
|
};
|
|
10982
11054
|
}, [density]);
|
|
11055
|
+
(0, import_react46.useLayoutEffect)(() => {
|
|
11056
|
+
const root = document.documentElement;
|
|
11057
|
+
root.setAttribute("data-it-appearance", appearance);
|
|
11058
|
+
return () => root.removeAttribute("data-it-appearance");
|
|
11059
|
+
}, [appearance]);
|
|
10983
11060
|
(0, import_react46.useLayoutEffect)(() => {
|
|
10984
11061
|
const root = document.documentElement;
|
|
10985
11062
|
const radiusTokens = ["xs", "sm", "md", "lg", "xl", "2xl", "3xl"];
|
|
@@ -12261,7 +12338,8 @@ function ITThemeProvider({
|
|
|
12261
12338
|
applyPreset,
|
|
12262
12339
|
resolvedTheme,
|
|
12263
12340
|
darkModeMode,
|
|
12264
|
-
setDarkModeMode
|
|
12341
|
+
setDarkModeMode,
|
|
12342
|
+
appearance
|
|
12265
12343
|
},
|
|
12266
12344
|
children: [
|
|
12267
12345
|
children,
|
|
@@ -12522,6 +12600,7 @@ var createValidationSchema = (fields) => Yup.object().shape(
|
|
|
12522
12600
|
useDebouncedSearch,
|
|
12523
12601
|
useEditableRow,
|
|
12524
12602
|
useFloatingPanel,
|
|
12603
|
+
useITFlatAppearance,
|
|
12525
12604
|
useITTheme,
|
|
12526
12605
|
useITThemeSafe,
|
|
12527
12606
|
useTableState
|