elseware-ui 2.36.2 → 2.36.5
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.css +351 -141
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +81 -13
- package/dist/index.d.ts +81 -13
- package/dist/index.js +607 -422
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +431 -251
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -4
package/dist/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var tailwindMerge = require('tailwind-merge');
|
|
4
|
-
var
|
|
4
|
+
var React2 = require('react');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var bs = require('react-icons/bs');
|
|
7
7
|
var fa = require('react-icons/fa');
|
|
8
8
|
var recharts = require('recharts');
|
|
9
|
-
var react = require('@headlessui/react');
|
|
10
9
|
var classNames17 = require('classnames');
|
|
11
10
|
var fa6 = require('react-icons/fa6');
|
|
12
11
|
var ReactWorldFlags = require('react-world-flags');
|
|
@@ -43,7 +42,7 @@ function _interopNamespace(e) {
|
|
|
43
42
|
return Object.freeze(n);
|
|
44
43
|
}
|
|
45
44
|
|
|
46
|
-
var
|
|
45
|
+
var React2__default = /*#__PURE__*/_interopDefault(React2);
|
|
47
46
|
var classNames17__default = /*#__PURE__*/_interopDefault(classNames17);
|
|
48
47
|
var ReactWorldFlags__default = /*#__PURE__*/_interopDefault(ReactWorldFlags);
|
|
49
48
|
var emojiFlags__default = /*#__PURE__*/_interopDefault(emojiFlags);
|
|
@@ -582,9 +581,9 @@ function ConfigBootstrap({
|
|
|
582
581
|
loadingFallback = null,
|
|
583
582
|
showStack = false
|
|
584
583
|
}) {
|
|
585
|
-
const [RootApp, setRootApp] =
|
|
586
|
-
const [loadError, setLoadError] =
|
|
587
|
-
|
|
584
|
+
const [RootApp, setRootApp] = React2.useState(null);
|
|
585
|
+
const [loadError, setLoadError] = React2.useState(null);
|
|
586
|
+
React2.useEffect(() => {
|
|
588
587
|
if (!config.isValid) {
|
|
589
588
|
return;
|
|
590
589
|
}
|
|
@@ -625,16 +624,16 @@ function ConfigBootstrap({
|
|
|
625
624
|
return /* @__PURE__ */ jsxRuntime.jsx(RootApp, {});
|
|
626
625
|
}
|
|
627
626
|
var ConfigBootstrap_default = ConfigBootstrap;
|
|
628
|
-
var EUIContext =
|
|
627
|
+
var EUIContext = React2.createContext(null);
|
|
629
628
|
var EUIProvider = ({
|
|
630
629
|
config,
|
|
631
630
|
children
|
|
632
631
|
}) => {
|
|
633
|
-
const [state, setState] =
|
|
632
|
+
const [state, setState] = React2.useState(config);
|
|
634
633
|
return /* @__PURE__ */ jsxRuntime.jsx(EUIContext.Provider, { value: { config: state, setConfig: setState }, children });
|
|
635
634
|
};
|
|
636
635
|
var useEUIConfig = () => {
|
|
637
|
-
const ctx =
|
|
636
|
+
const ctx = React2.useContext(EUIContext);
|
|
638
637
|
if (!ctx) {
|
|
639
638
|
throw new Error("useEUIConfig must be used inside EUIProvider");
|
|
640
639
|
}
|
|
@@ -1452,14 +1451,14 @@ function useChartData({
|
|
|
1452
1451
|
onDataChange,
|
|
1453
1452
|
onError
|
|
1454
1453
|
} = {}) {
|
|
1455
|
-
const [state, setState] =
|
|
1454
|
+
const [state, setState] = React2.useState({
|
|
1456
1455
|
data: data ?? [],
|
|
1457
1456
|
loading: false,
|
|
1458
1457
|
error: null,
|
|
1459
1458
|
status: data?.length ? "success" : "idle",
|
|
1460
1459
|
lastUpdatedAt: data?.length ? /* @__PURE__ */ new Date() : void 0
|
|
1461
1460
|
});
|
|
1462
|
-
const prepareData =
|
|
1461
|
+
const prepareData = React2.useCallback(
|
|
1463
1462
|
(nextData) => {
|
|
1464
1463
|
if (!normalize2) {
|
|
1465
1464
|
return nextData;
|
|
@@ -1468,7 +1467,7 @@ function useChartData({
|
|
|
1468
1467
|
},
|
|
1469
1468
|
[normalize2]
|
|
1470
1469
|
);
|
|
1471
|
-
const replaceData =
|
|
1470
|
+
const replaceData = React2.useCallback(
|
|
1472
1471
|
(nextData) => {
|
|
1473
1472
|
const normalizedData = prepareData(nextData);
|
|
1474
1473
|
setState({
|
|
@@ -1482,7 +1481,7 @@ function useChartData({
|
|
|
1482
1481
|
},
|
|
1483
1482
|
[onDataChange, prepareData]
|
|
1484
1483
|
);
|
|
1485
|
-
const appendData =
|
|
1484
|
+
const appendData = React2.useCallback(
|
|
1486
1485
|
(nextData) => {
|
|
1487
1486
|
setState((currentState) => {
|
|
1488
1487
|
const incomingData = Array.isArray(nextData) ? nextData : [nextData];
|
|
@@ -1506,7 +1505,7 @@ function useChartData({
|
|
|
1506
1505
|
},
|
|
1507
1506
|
[maxDataPoints, onDataChange, prepareData]
|
|
1508
1507
|
);
|
|
1509
|
-
const clearData =
|
|
1508
|
+
const clearData = React2.useCallback(() => {
|
|
1510
1509
|
setState({
|
|
1511
1510
|
data: [],
|
|
1512
1511
|
loading: false,
|
|
@@ -1516,7 +1515,7 @@ function useChartData({
|
|
|
1516
1515
|
});
|
|
1517
1516
|
onDataChange?.([]);
|
|
1518
1517
|
}, [onDataChange]);
|
|
1519
|
-
const handleError =
|
|
1518
|
+
const handleError = React2.useCallback(
|
|
1520
1519
|
(error) => {
|
|
1521
1520
|
setState((currentState) => ({
|
|
1522
1521
|
...currentState,
|
|
@@ -1528,7 +1527,7 @@ function useChartData({
|
|
|
1528
1527
|
},
|
|
1529
1528
|
[onError]
|
|
1530
1529
|
);
|
|
1531
|
-
const refresh =
|
|
1530
|
+
const refresh = React2.useCallback(async () => {
|
|
1532
1531
|
const resolvedDataSource = dataSource;
|
|
1533
1532
|
if (!resolvedDataSource?.refresh && !resolvedDataSource?.getInitialData) {
|
|
1534
1533
|
return;
|
|
@@ -1547,13 +1546,13 @@ function useChartData({
|
|
|
1547
1546
|
handleError(error instanceof Error ? error : new Error(String(error)));
|
|
1548
1547
|
}
|
|
1549
1548
|
}, [dataSource, handleError, replaceData]);
|
|
1550
|
-
|
|
1549
|
+
React2.useEffect(() => {
|
|
1551
1550
|
if (!data) {
|
|
1552
1551
|
return;
|
|
1553
1552
|
}
|
|
1554
1553
|
replaceData(data);
|
|
1555
1554
|
}, [data, replaceData]);
|
|
1556
|
-
|
|
1555
|
+
React2.useEffect(() => {
|
|
1557
1556
|
if (!dataSource || !autoLoad) {
|
|
1558
1557
|
return;
|
|
1559
1558
|
}
|
|
@@ -1592,7 +1591,7 @@ function useChartData({
|
|
|
1592
1591
|
unsubscribe?.();
|
|
1593
1592
|
};
|
|
1594
1593
|
}, [appendData, autoLoad, dataSource, handleError, replaceData]);
|
|
1595
|
-
return
|
|
1594
|
+
return React2.useMemo(
|
|
1596
1595
|
() => ({
|
|
1597
1596
|
...state,
|
|
1598
1597
|
refresh,
|
|
@@ -1611,11 +1610,11 @@ function useChartRealtime({
|
|
|
1611
1610
|
onData,
|
|
1612
1611
|
onError
|
|
1613
1612
|
}) {
|
|
1614
|
-
const [data, setData] =
|
|
1615
|
-
const [error, setError] =
|
|
1616
|
-
const [connected, setConnected] =
|
|
1617
|
-
const [lastUpdatedAt, setLastUpdatedAt] =
|
|
1618
|
-
|
|
1613
|
+
const [data, setData] = React2.useState([]);
|
|
1614
|
+
const [error, setError] = React2.useState(null);
|
|
1615
|
+
const [connected, setConnected] = React2.useState(false);
|
|
1616
|
+
const [lastUpdatedAt, setLastUpdatedAt] = React2.useState();
|
|
1617
|
+
React2.useEffect(() => {
|
|
1619
1618
|
if (!enabled) {
|
|
1620
1619
|
setConnected(false);
|
|
1621
1620
|
return;
|
|
@@ -1649,7 +1648,7 @@ function useChartRealtime({
|
|
|
1649
1648
|
setConnected(false);
|
|
1650
1649
|
};
|
|
1651
1650
|
}, [connect, enabled, maxDataPoints, normalize2, onData, onError]);
|
|
1652
|
-
return
|
|
1651
|
+
return React2.useMemo(
|
|
1653
1652
|
() => ({
|
|
1654
1653
|
data,
|
|
1655
1654
|
error,
|
|
@@ -1671,13 +1670,13 @@ function useChartPolling({
|
|
|
1671
1670
|
onData,
|
|
1672
1671
|
onError
|
|
1673
1672
|
}) {
|
|
1674
|
-
const isMountedRef =
|
|
1675
|
-
const isFetchingRef =
|
|
1676
|
-
const [data, setData] =
|
|
1677
|
-
const [error, setError] =
|
|
1678
|
-
const [loading, setLoading] =
|
|
1679
|
-
const [lastUpdatedAt, setLastUpdatedAt] =
|
|
1680
|
-
const refresh =
|
|
1673
|
+
const isMountedRef = React2.useRef(false);
|
|
1674
|
+
const isFetchingRef = React2.useRef(false);
|
|
1675
|
+
const [data, setData] = React2.useState([]);
|
|
1676
|
+
const [error, setError] = React2.useState(null);
|
|
1677
|
+
const [loading, setLoading] = React2.useState(immediate);
|
|
1678
|
+
const [lastUpdatedAt, setLastUpdatedAt] = React2.useState();
|
|
1679
|
+
const refresh = React2.useCallback(async () => {
|
|
1681
1680
|
if (isFetchingRef.current) {
|
|
1682
1681
|
return;
|
|
1683
1682
|
}
|
|
@@ -1706,13 +1705,13 @@ function useChartPolling({
|
|
|
1706
1705
|
isFetchingRef.current = false;
|
|
1707
1706
|
}
|
|
1708
1707
|
}, [fetcher, normalize2, onData, onError]);
|
|
1709
|
-
|
|
1708
|
+
React2.useEffect(() => {
|
|
1710
1709
|
isMountedRef.current = true;
|
|
1711
1710
|
return () => {
|
|
1712
1711
|
isMountedRef.current = false;
|
|
1713
1712
|
};
|
|
1714
1713
|
}, []);
|
|
1715
|
-
|
|
1714
|
+
React2.useEffect(() => {
|
|
1716
1715
|
if (!enabled) {
|
|
1717
1716
|
setLoading(false);
|
|
1718
1717
|
return;
|
|
@@ -1727,7 +1726,7 @@ function useChartPolling({
|
|
|
1727
1726
|
window.clearInterval(timer);
|
|
1728
1727
|
};
|
|
1729
1728
|
}, [enabled, immediate, interval, refresh]);
|
|
1730
|
-
return
|
|
1729
|
+
return React2.useMemo(
|
|
1731
1730
|
() => ({
|
|
1732
1731
|
data,
|
|
1733
1732
|
error,
|
|
@@ -1764,7 +1763,7 @@ function useChartSeries({
|
|
|
1764
1763
|
xKey,
|
|
1765
1764
|
excludeKeys = []
|
|
1766
1765
|
}) {
|
|
1767
|
-
return
|
|
1766
|
+
return React2.useMemo(() => {
|
|
1768
1767
|
const normalizedSeries = series && series.length > 0 ? series : inferSeriesKeys(data, xKey, excludeKeys).map((key) => ({
|
|
1769
1768
|
key
|
|
1770
1769
|
}));
|
|
@@ -1812,12 +1811,12 @@ function useChartTheme({
|
|
|
1812
1811
|
mode = "dark",
|
|
1813
1812
|
theme
|
|
1814
1813
|
} = {}) {
|
|
1815
|
-
return
|
|
1814
|
+
return React2.useMemo(() => {
|
|
1816
1815
|
const baseTheme = mode === "light" ? CHART_LIGHT_THEME : mode === "dark" ? CHART_DARK_THEME : DEFAULT_CHART_THEME;
|
|
1817
1816
|
return mergeChartTheme(baseTheme, theme);
|
|
1818
1817
|
}, [mode, theme]);
|
|
1819
1818
|
}
|
|
1820
|
-
var ChartContext =
|
|
1819
|
+
var ChartContext = React2.createContext({
|
|
1821
1820
|
data: [],
|
|
1822
1821
|
loading: false,
|
|
1823
1822
|
error: null,
|
|
@@ -1849,7 +1848,7 @@ function ChartProvider({
|
|
|
1849
1848
|
onDataChange,
|
|
1850
1849
|
onError
|
|
1851
1850
|
});
|
|
1852
|
-
const value =
|
|
1851
|
+
const value = React2.useMemo(
|
|
1853
1852
|
() => ({
|
|
1854
1853
|
...chartData,
|
|
1855
1854
|
mode: dataSource?.mode,
|
|
@@ -1866,7 +1865,7 @@ function ChartProvider({
|
|
|
1866
1865
|
);
|
|
1867
1866
|
}
|
|
1868
1867
|
function useChartContext() {
|
|
1869
|
-
return
|
|
1868
|
+
return React2.useContext(ChartContext);
|
|
1870
1869
|
}
|
|
1871
1870
|
|
|
1872
1871
|
// src/components/data-display/charts/context/chartReducer.ts
|
|
@@ -2170,7 +2169,7 @@ function ChartLegend({
|
|
|
2170
2169
|
valueSource = "latest",
|
|
2171
2170
|
onItemClick
|
|
2172
2171
|
}) {
|
|
2173
|
-
const legendItems =
|
|
2172
|
+
const legendItems = React2.useMemo(() => {
|
|
2174
2173
|
if (items?.length) {
|
|
2175
2174
|
return items;
|
|
2176
2175
|
}
|
|
@@ -2948,7 +2947,7 @@ function GaugePlot({
|
|
|
2948
2947
|
const chartData = data ?? context.data;
|
|
2949
2948
|
const chartLoading = loading ?? context.loading;
|
|
2950
2949
|
const chartError = error ?? context.error;
|
|
2951
|
-
const resolvedValue =
|
|
2950
|
+
const resolvedValue = React2.useMemo(() => {
|
|
2952
2951
|
if (typeof value === "number") {
|
|
2953
2952
|
return value;
|
|
2954
2953
|
}
|
|
@@ -3065,14 +3064,14 @@ function StatPlot({
|
|
|
3065
3064
|
const chartData = data ?? context.data;
|
|
3066
3065
|
const chartLoading = loading ?? context.loading;
|
|
3067
3066
|
const chartError = error ?? context.error;
|
|
3068
|
-
const resolvedValue =
|
|
3067
|
+
const resolvedValue = React2.useMemo(() => {
|
|
3069
3068
|
if (value !== void 0) {
|
|
3070
3069
|
return value;
|
|
3071
3070
|
}
|
|
3072
3071
|
const latestPoint = chartData[chartData.length - 1];
|
|
3073
3072
|
return latestPoint?.[String(valueKey)] ?? null;
|
|
3074
3073
|
}, [chartData, value, valueKey]);
|
|
3075
|
-
const resolvedPreviousValue =
|
|
3074
|
+
const resolvedPreviousValue = React2.useMemo(() => {
|
|
3076
3075
|
if (previousValue !== void 0) {
|
|
3077
3076
|
return previousValue;
|
|
3078
3077
|
}
|
|
@@ -3080,7 +3079,7 @@ function StatPlot({
|
|
|
3080
3079
|
const previous = previousPoint?.[String(valueKey)];
|
|
3081
3080
|
return typeof previous === "number" ? previous : void 0;
|
|
3082
3081
|
}, [chartData, previousValue, valueKey]);
|
|
3083
|
-
const trend =
|
|
3082
|
+
const trend = React2.useMemo(() => {
|
|
3084
3083
|
if (typeof resolvedValue !== "number" || typeof resolvedPreviousValue !== "number") {
|
|
3085
3084
|
return null;
|
|
3086
3085
|
}
|
|
@@ -3551,7 +3550,7 @@ var Chip = ({
|
|
|
3551
3550
|
}
|
|
3552
3551
|
) });
|
|
3553
3552
|
};
|
|
3554
|
-
var DataViewContext =
|
|
3553
|
+
var DataViewContext = React2.createContext(null);
|
|
3555
3554
|
|
|
3556
3555
|
// src/components/data-display/data-view/utils/searchData.ts
|
|
3557
3556
|
function searchData(data, search) {
|
|
@@ -3595,19 +3594,19 @@ function DataViewProvider({
|
|
|
3595
3594
|
defaultPageSize = 9,
|
|
3596
3595
|
sortConfig = {}
|
|
3597
3596
|
}) {
|
|
3598
|
-
const [search, setSearch] =
|
|
3599
|
-
const [filters, setFilters] =
|
|
3600
|
-
const [sort, setSort] =
|
|
3601
|
-
const [page, setPage] =
|
|
3602
|
-
const [pageSize, setPageSize] =
|
|
3603
|
-
const processedData =
|
|
3597
|
+
const [search, setSearch] = React2.useState("");
|
|
3598
|
+
const [filters, setFilters] = React2.useState({});
|
|
3599
|
+
const [sort, setSort] = React2.useState("suggested");
|
|
3600
|
+
const [page, setPage] = React2.useState(1);
|
|
3601
|
+
const [pageSize, setPageSize] = React2.useState(defaultPageSize);
|
|
3602
|
+
const processedData = React2.useMemo(() => {
|
|
3604
3603
|
let result = searchData(data, search);
|
|
3605
3604
|
result = filterData(result, filters);
|
|
3606
3605
|
result = sortData(result, sort, sortConfig);
|
|
3607
3606
|
return result;
|
|
3608
3607
|
}, [data, search, filters, sort, sortConfig]);
|
|
3609
3608
|
const totalPages = pageSize === "All" ? 1 : Math.ceil(processedData.length / pageSize);
|
|
3610
|
-
const paginatedData =
|
|
3609
|
+
const paginatedData = React2.useMemo(() => {
|
|
3611
3610
|
if (pageSize === "All") return processedData;
|
|
3612
3611
|
const size = pageSize;
|
|
3613
3612
|
const start = (page - 1) * size;
|
|
@@ -3645,7 +3644,7 @@ function DataViewSidebar({ children }) {
|
|
|
3645
3644
|
}
|
|
3646
3645
|
var DataViewSidebar_default = DataViewSidebar;
|
|
3647
3646
|
function useDataView() {
|
|
3648
|
-
const ctx =
|
|
3647
|
+
const ctx = React2.useContext(DataViewContext);
|
|
3649
3648
|
if (!ctx) {
|
|
3650
3649
|
throw new Error("useDataView must be used within DataViewProvider");
|
|
3651
3650
|
}
|
|
@@ -3702,6 +3701,243 @@ function DataViewSort({ options = [], shape }) {
|
|
|
3702
3701
|
);
|
|
3703
3702
|
}
|
|
3704
3703
|
var DataViewSort_default = DataViewSort;
|
|
3704
|
+
function useTransitionVisibility(visibility, leaveDuration = 150) {
|
|
3705
|
+
const [mounted, setMounted] = React2.useState(Boolean(visibility));
|
|
3706
|
+
const [active, setActive] = React2.useState(Boolean(visibility));
|
|
3707
|
+
const isInitialRenderRef = React2.useRef(true);
|
|
3708
|
+
const frameOneRef = React2.useRef(null);
|
|
3709
|
+
const frameTwoRef = React2.useRef(null);
|
|
3710
|
+
const timeoutRef = React2.useRef(null);
|
|
3711
|
+
const clearTimers = () => {
|
|
3712
|
+
if (frameOneRef.current) {
|
|
3713
|
+
cancelAnimationFrame(frameOneRef.current);
|
|
3714
|
+
frameOneRef.current = null;
|
|
3715
|
+
}
|
|
3716
|
+
if (frameTwoRef.current) {
|
|
3717
|
+
cancelAnimationFrame(frameTwoRef.current);
|
|
3718
|
+
frameTwoRef.current = null;
|
|
3719
|
+
}
|
|
3720
|
+
if (timeoutRef.current) {
|
|
3721
|
+
clearTimeout(timeoutRef.current);
|
|
3722
|
+
timeoutRef.current = null;
|
|
3723
|
+
}
|
|
3724
|
+
};
|
|
3725
|
+
React2.useEffect(() => {
|
|
3726
|
+
clearTimers();
|
|
3727
|
+
if (isInitialRenderRef.current) {
|
|
3728
|
+
isInitialRenderRef.current = false;
|
|
3729
|
+
return clearTimers;
|
|
3730
|
+
}
|
|
3731
|
+
if (visibility) {
|
|
3732
|
+
setMounted(true);
|
|
3733
|
+
setActive(false);
|
|
3734
|
+
frameOneRef.current = requestAnimationFrame(() => {
|
|
3735
|
+
frameTwoRef.current = requestAnimationFrame(() => {
|
|
3736
|
+
setActive(true);
|
|
3737
|
+
});
|
|
3738
|
+
});
|
|
3739
|
+
return clearTimers;
|
|
3740
|
+
}
|
|
3741
|
+
setActive(false);
|
|
3742
|
+
timeoutRef.current = setTimeout(() => {
|
|
3743
|
+
setMounted(false);
|
|
3744
|
+
}, leaveDuration);
|
|
3745
|
+
return clearTimers;
|
|
3746
|
+
}, [visibility, leaveDuration]);
|
|
3747
|
+
return {
|
|
3748
|
+
mounted,
|
|
3749
|
+
active
|
|
3750
|
+
};
|
|
3751
|
+
}
|
|
3752
|
+
function renderTransitionChild(children, className) {
|
|
3753
|
+
const childCount = React2.Children.count(children);
|
|
3754
|
+
if (childCount !== 1) {
|
|
3755
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children });
|
|
3756
|
+
}
|
|
3757
|
+
const child = React2.Children.only(children);
|
|
3758
|
+
if (!React2__default.default.isValidElement(child)) {
|
|
3759
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: child });
|
|
3760
|
+
}
|
|
3761
|
+
const element = child;
|
|
3762
|
+
return React2__default.default.cloneElement(element, {
|
|
3763
|
+
className: classNames17__default.default(element.props.className, className)
|
|
3764
|
+
});
|
|
3765
|
+
}
|
|
3766
|
+
function TransitionBase({
|
|
3767
|
+
visibility,
|
|
3768
|
+
children,
|
|
3769
|
+
enterClassName,
|
|
3770
|
+
leaveClassName,
|
|
3771
|
+
visibleClassName,
|
|
3772
|
+
hiddenClassName,
|
|
3773
|
+
leaveDuration = 150,
|
|
3774
|
+
unmountOnExit = true
|
|
3775
|
+
}) {
|
|
3776
|
+
const { mounted, active } = useTransitionVisibility(
|
|
3777
|
+
Boolean(visibility),
|
|
3778
|
+
leaveDuration
|
|
3779
|
+
);
|
|
3780
|
+
if (!mounted && unmountOnExit) {
|
|
3781
|
+
return null;
|
|
3782
|
+
}
|
|
3783
|
+
const transitionClassName = classNames17__default.default(
|
|
3784
|
+
visibility ? enterClassName : leaveClassName,
|
|
3785
|
+
active ? visibleClassName : hiddenClassName
|
|
3786
|
+
);
|
|
3787
|
+
return renderTransitionChild(children, transitionClassName);
|
|
3788
|
+
}
|
|
3789
|
+
var TransitionBase_default = TransitionBase;
|
|
3790
|
+
function TransitionDropdown({
|
|
3791
|
+
visibility,
|
|
3792
|
+
children,
|
|
3793
|
+
leaveDuration = 120
|
|
3794
|
+
}) {
|
|
3795
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3796
|
+
TransitionBase_default,
|
|
3797
|
+
{
|
|
3798
|
+
visibility: Boolean(visibility),
|
|
3799
|
+
enterClassName: "transform-gpu transition-all duration-150 ease-out origin-top-right",
|
|
3800
|
+
leaveClassName: "transform-gpu transition-all duration-120 ease-in origin-top-right",
|
|
3801
|
+
visibleClassName: "scale-100 opacity-100 translate-y-0",
|
|
3802
|
+
hiddenClassName: "scale-95 opacity-0 -translate-y-1",
|
|
3803
|
+
leaveDuration,
|
|
3804
|
+
children
|
|
3805
|
+
}
|
|
3806
|
+
);
|
|
3807
|
+
}
|
|
3808
|
+
var TransitionDropdown_default = TransitionDropdown;
|
|
3809
|
+
function TransitionFade({
|
|
3810
|
+
visibility,
|
|
3811
|
+
children,
|
|
3812
|
+
leaveDuration = 180
|
|
3813
|
+
}) {
|
|
3814
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3815
|
+
TransitionBase_default,
|
|
3816
|
+
{
|
|
3817
|
+
visibility: Boolean(visibility),
|
|
3818
|
+
enterClassName: "transition-opacity duration-200 ease-out",
|
|
3819
|
+
leaveClassName: "transition-opacity duration-180 ease-in",
|
|
3820
|
+
visibleClassName: "opacity-100",
|
|
3821
|
+
hiddenClassName: "opacity-0",
|
|
3822
|
+
leaveDuration,
|
|
3823
|
+
children
|
|
3824
|
+
}
|
|
3825
|
+
);
|
|
3826
|
+
}
|
|
3827
|
+
var TransitionFade_default = TransitionFade;
|
|
3828
|
+
function TransitionFadeIn({
|
|
3829
|
+
visibility,
|
|
3830
|
+
children,
|
|
3831
|
+
leaveDuration = 180
|
|
3832
|
+
}) {
|
|
3833
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3834
|
+
TransitionBase_default,
|
|
3835
|
+
{
|
|
3836
|
+
visibility: Boolean(visibility),
|
|
3837
|
+
enterClassName: "transform-gpu transition-all duration-250 ease-out",
|
|
3838
|
+
leaveClassName: "transform-gpu transition-all duration-180 ease-in",
|
|
3839
|
+
visibleClassName: "opacity-100 translate-y-0",
|
|
3840
|
+
hiddenClassName: "opacity-0 translate-y-3",
|
|
3841
|
+
leaveDuration,
|
|
3842
|
+
children
|
|
3843
|
+
}
|
|
3844
|
+
);
|
|
3845
|
+
}
|
|
3846
|
+
var TransitionFadeIn_default = TransitionFadeIn;
|
|
3847
|
+
function TransitionScale({
|
|
3848
|
+
visibility,
|
|
3849
|
+
children,
|
|
3850
|
+
leaveDuration = 120
|
|
3851
|
+
}) {
|
|
3852
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3853
|
+
TransitionBase_default,
|
|
3854
|
+
{
|
|
3855
|
+
visibility: Boolean(visibility),
|
|
3856
|
+
enterClassName: "transform-gpu transition-all duration-150 ease-out origin-center",
|
|
3857
|
+
leaveClassName: "transform-gpu transition-all duration-120 ease-in origin-center",
|
|
3858
|
+
visibleClassName: "scale-100 opacity-100",
|
|
3859
|
+
hiddenClassName: "scale-95 opacity-0",
|
|
3860
|
+
leaveDuration,
|
|
3861
|
+
children
|
|
3862
|
+
}
|
|
3863
|
+
);
|
|
3864
|
+
}
|
|
3865
|
+
var TransitionScale_default = TransitionScale;
|
|
3866
|
+
function getHiddenClassName(side) {
|
|
3867
|
+
switch (side) {
|
|
3868
|
+
case "right":
|
|
3869
|
+
return "translate-x-full";
|
|
3870
|
+
case "top":
|
|
3871
|
+
return "-translate-y-full";
|
|
3872
|
+
case "bottom":
|
|
3873
|
+
return "translate-y-full";
|
|
3874
|
+
case "left":
|
|
3875
|
+
default:
|
|
3876
|
+
return "-translate-x-full";
|
|
3877
|
+
}
|
|
3878
|
+
}
|
|
3879
|
+
function TransitionSlide({
|
|
3880
|
+
visibility,
|
|
3881
|
+
side = "left",
|
|
3882
|
+
children,
|
|
3883
|
+
leaveDuration = 240
|
|
3884
|
+
}) {
|
|
3885
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3886
|
+
TransitionBase_default,
|
|
3887
|
+
{
|
|
3888
|
+
visibility: Boolean(visibility),
|
|
3889
|
+
enterClassName: "transform-gpu transition-transform duration-300 ease-out",
|
|
3890
|
+
leaveClassName: "transform-gpu transition-transform duration-240 ease-in",
|
|
3891
|
+
visibleClassName: "translate-x-0 translate-y-0",
|
|
3892
|
+
hiddenClassName: getHiddenClassName(side),
|
|
3893
|
+
leaveDuration,
|
|
3894
|
+
children
|
|
3895
|
+
}
|
|
3896
|
+
);
|
|
3897
|
+
}
|
|
3898
|
+
var TransitionSlide_default = TransitionSlide;
|
|
3899
|
+
function TransitionAccordion({
|
|
3900
|
+
visibility,
|
|
3901
|
+
children,
|
|
3902
|
+
enterDuration = 220,
|
|
3903
|
+
leaveDuration = 180
|
|
3904
|
+
}) {
|
|
3905
|
+
const { mounted, active } = useTransitionVisibility(
|
|
3906
|
+
Boolean(visibility),
|
|
3907
|
+
leaveDuration
|
|
3908
|
+
);
|
|
3909
|
+
if (!mounted) {
|
|
3910
|
+
return null;
|
|
3911
|
+
}
|
|
3912
|
+
const duration = visibility ? enterDuration : leaveDuration;
|
|
3913
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3914
|
+
"div",
|
|
3915
|
+
{
|
|
3916
|
+
style: {
|
|
3917
|
+
display: "grid",
|
|
3918
|
+
gridTemplateRows: active ? "1fr" : "0fr",
|
|
3919
|
+
opacity: active ? 1 : 0,
|
|
3920
|
+
transitionProperty: "grid-template-rows, opacity",
|
|
3921
|
+
transitionDuration: `${duration}ms`,
|
|
3922
|
+
transitionTimingFunction: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
3923
|
+
willChange: "grid-template-rows, opacity"
|
|
3924
|
+
},
|
|
3925
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 overflow-hidden", children })
|
|
3926
|
+
}
|
|
3927
|
+
);
|
|
3928
|
+
}
|
|
3929
|
+
var TransitionAccordion_default = TransitionAccordion;
|
|
3930
|
+
|
|
3931
|
+
// src/components/feedback/transition/index.tsx
|
|
3932
|
+
var Transition = {
|
|
3933
|
+
TransitionBase: TransitionBase_default,
|
|
3934
|
+
TransitionDropdown: TransitionDropdown_default,
|
|
3935
|
+
TransitionFade: TransitionFade_default,
|
|
3936
|
+
TransitionFadeIn: TransitionFadeIn_default,
|
|
3937
|
+
TransitionScale: TransitionScale_default,
|
|
3938
|
+
TransitionSlide: TransitionSlide_default,
|
|
3939
|
+
TransitionAccordion: TransitionAccordion_default
|
|
3940
|
+
};
|
|
3705
3941
|
function Accordion({
|
|
3706
3942
|
summary = "Accordion",
|
|
3707
3943
|
children,
|
|
@@ -3711,18 +3947,20 @@ function Accordion({
|
|
|
3711
3947
|
toggleOnSummaryClick = false,
|
|
3712
3948
|
enableChildrenPadding = true
|
|
3713
3949
|
}) {
|
|
3714
|
-
const [collapse, setCollapse] =
|
|
3950
|
+
const [collapse, setCollapse] = React2.useState(defaultCollapse);
|
|
3715
3951
|
const handleToggle = () => {
|
|
3716
3952
|
setCollapse((prev) => !prev);
|
|
3717
3953
|
};
|
|
3718
3954
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border border-eui-dark-400/80 text-gray-500", children: [
|
|
3719
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3955
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3720
3956
|
"div",
|
|
3721
3957
|
{
|
|
3722
|
-
className: classNames17__default.default(
|
|
3723
|
-
"inline-flex gap-3 items-center px-3 py-2 w-full eui-gradient-to-r-general-xs"
|
|
3724
|
-
|
|
3725
|
-
|
|
3958
|
+
className: classNames17__default.default(
|
|
3959
|
+
"inline-flex gap-3 items-center px-3 py-2 w-full eui-gradient-to-r-general-xs",
|
|
3960
|
+
{
|
|
3961
|
+
"hover:cursor-pointer": toggleOnSummaryClick
|
|
3962
|
+
}
|
|
3963
|
+
),
|
|
3726
3964
|
onClick: toggleOnSummaryClick ? handleToggle : void 0,
|
|
3727
3965
|
children: [
|
|
3728
3966
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "inline-flex gap-3 items-center w-full", children: [
|
|
@@ -3730,17 +3968,17 @@ function Accordion({
|
|
|
3730
3968
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "eui-text-md w-full", children: summary })
|
|
3731
3969
|
] }),
|
|
3732
3970
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3733
|
-
"
|
|
3971
|
+
"button",
|
|
3734
3972
|
{
|
|
3973
|
+
type: "button",
|
|
3735
3974
|
onClick: toggleOnSummaryClick ? void 0 : handleToggle,
|
|
3736
3975
|
className: "hover:cursor-pointer",
|
|
3737
3976
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3738
3977
|
fa6.FaCircleChevronDown,
|
|
3739
3978
|
{
|
|
3740
|
-
className: classNames17__default.default(
|
|
3741
|
-
"
|
|
3742
|
-
|
|
3743
|
-
)
|
|
3979
|
+
className: classNames17__default.default("text-xl transition-transform duration-300", {
|
|
3980
|
+
"rotate-180": collapse
|
|
3981
|
+
})
|
|
3744
3982
|
}
|
|
3745
3983
|
)
|
|
3746
3984
|
}
|
|
@@ -3748,30 +3986,19 @@ function Accordion({
|
|
|
3748
3986
|
rhsActions && /* @__PURE__ */ jsxRuntime.jsx("div", { onClick: (e) => e.stopPropagation(), children: rhsActions })
|
|
3749
3987
|
]
|
|
3750
3988
|
}
|
|
3751
|
-
)
|
|
3752
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3753
|
-
|
|
3989
|
+
),
|
|
3990
|
+
/* @__PURE__ */ jsxRuntime.jsx(TransitionAccordion_default, { visibility: collapse, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3991
|
+
"div",
|
|
3754
3992
|
{
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
enterFrom: "transform scale-95 opacity-0",
|
|
3758
|
-
enterTo: "transform scale-100 opacity-100",
|
|
3759
|
-
leave: "transition duration-75 ease-out",
|
|
3760
|
-
leaveFrom: "transform scale-100 opacity-100",
|
|
3761
|
-
leaveTo: "transform scale-95 opacity-0",
|
|
3762
|
-
as: React8.Fragment,
|
|
3763
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3764
|
-
"div",
|
|
3993
|
+
className: classNames17__default.default(
|
|
3994
|
+
"border-t border-t-eui-dark-400/40 eui-text-sm",
|
|
3765
3995
|
{
|
|
3766
|
-
|
|
3767
|
-
"border-t border-t-eui-dark-400/40 eui-text-sm": true,
|
|
3768
|
-
"p-5": enableChildrenPadding
|
|
3769
|
-
}),
|
|
3770
|
-
children
|
|
3996
|
+
"p-5": enableChildrenPadding
|
|
3771
3997
|
}
|
|
3772
|
-
)
|
|
3998
|
+
),
|
|
3999
|
+
children
|
|
3773
4000
|
}
|
|
3774
|
-
)
|
|
4001
|
+
) })
|
|
3775
4002
|
] });
|
|
3776
4003
|
}
|
|
3777
4004
|
var Accordion_default = Accordion;
|
|
@@ -4216,8 +4443,8 @@ var Flag = ({
|
|
|
4216
4443
|
className,
|
|
4217
4444
|
...rest
|
|
4218
4445
|
}) => {
|
|
4219
|
-
const [pos, setPos] =
|
|
4220
|
-
const [showTooltip, setShowTooltip] =
|
|
4446
|
+
const [pos, setPos] = React2.useState({ x: 0, y: 0 });
|
|
4447
|
+
const [showTooltip, setShowTooltip] = React2.useState(false);
|
|
4221
4448
|
const upperCode = code.toUpperCase();
|
|
4222
4449
|
const country = emojiFlags__default.default.countryCode(upperCode);
|
|
4223
4450
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -4421,16 +4648,16 @@ var GraphRenderer = ({
|
|
|
4421
4648
|
width = 1e3,
|
|
4422
4649
|
height = 700
|
|
4423
4650
|
}) => {
|
|
4424
|
-
const [nodes, setNodes] =
|
|
4651
|
+
const [nodes, setNodes] = React2.useState([]);
|
|
4425
4652
|
const edges = data.edges;
|
|
4426
|
-
const simulationRef =
|
|
4427
|
-
const [offset, setOffset] =
|
|
4428
|
-
const isDragging =
|
|
4429
|
-
const lastPos =
|
|
4430
|
-
const nodeMap =
|
|
4653
|
+
const simulationRef = React2.useRef(null);
|
|
4654
|
+
const [offset, setOffset] = React2.useState({ x: 0, y: 0 });
|
|
4655
|
+
const isDragging = React2.useRef(false);
|
|
4656
|
+
const lastPos = React2.useRef({ x: 0, y: 0 });
|
|
4657
|
+
const nodeMap = React2.useMemo(() => {
|
|
4431
4658
|
return new Map(nodes.map((n) => [n.id, n]));
|
|
4432
4659
|
}, [nodes]);
|
|
4433
|
-
|
|
4660
|
+
React2.useEffect(() => {
|
|
4434
4661
|
simulationRef.current?.stop?.();
|
|
4435
4662
|
const positionedNodes = data.nodes.map((n) => ({
|
|
4436
4663
|
...n,
|
|
@@ -4511,13 +4738,13 @@ var Graph = ({
|
|
|
4511
4738
|
}
|
|
4512
4739
|
);
|
|
4513
4740
|
};
|
|
4514
|
-
var CloudinaryContext =
|
|
4741
|
+
var CloudinaryContext = React2.createContext(null);
|
|
4515
4742
|
var CloudinaryProvider = ({
|
|
4516
4743
|
cloudName,
|
|
4517
4744
|
children
|
|
4518
4745
|
}) => /* @__PURE__ */ jsxRuntime.jsx(CloudinaryContext.Provider, { value: { cloudName }, children });
|
|
4519
4746
|
var useCloudinaryConfig = () => {
|
|
4520
|
-
const ctx =
|
|
4747
|
+
const ctx = React2.useContext(CloudinaryContext);
|
|
4521
4748
|
if (!ctx) {
|
|
4522
4749
|
throw new Error(
|
|
4523
4750
|
"CloudinaryProvider is missing. Wrap your app with <CloudinaryProvider />"
|
|
@@ -4968,7 +5195,7 @@ var ListItem = ({
|
|
|
4968
5195
|
children: bullet
|
|
4969
5196
|
}
|
|
4970
5197
|
),
|
|
4971
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-w-0", children: TypographyComponent ?
|
|
5198
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-w-0", children: TypographyComponent ? React2__default.default.cloneElement(
|
|
4972
5199
|
TypographyComponent,
|
|
4973
5200
|
{
|
|
4974
5201
|
className: cn(
|
|
@@ -5002,7 +5229,7 @@ function normalizeItem(item, defaultBulletType) {
|
|
|
5002
5229
|
bulletType: defaultBulletType
|
|
5003
5230
|
};
|
|
5004
5231
|
}
|
|
5005
|
-
if (
|
|
5232
|
+
if (React2__default.default.isValidElement(item)) {
|
|
5006
5233
|
return {
|
|
5007
5234
|
content: item,
|
|
5008
5235
|
bulletType: defaultBulletType
|
|
@@ -5687,8 +5914,8 @@ function Table({
|
|
|
5687
5914
|
}) {
|
|
5688
5915
|
const eui = useEUIConfig();
|
|
5689
5916
|
const resolvedShape = shape ?? eui?.config?.global?.shape ?? "square";
|
|
5690
|
-
const [sortKey, setSortKey] =
|
|
5691
|
-
const [sortOrder, setSortOrder] =
|
|
5917
|
+
const [sortKey, setSortKey] = React2.useState(null);
|
|
5918
|
+
const [sortOrder, setSortOrder] = React2.useState("asc");
|
|
5692
5919
|
const toggleSort = (key) => {
|
|
5693
5920
|
if (sortKey === key) {
|
|
5694
5921
|
setSortOrder((prev) => prev === "asc" ? "desc" : "asc");
|
|
@@ -5697,7 +5924,7 @@ function Table({
|
|
|
5697
5924
|
setSortOrder("asc");
|
|
5698
5925
|
}
|
|
5699
5926
|
};
|
|
5700
|
-
const sortedData =
|
|
5927
|
+
const sortedData = React2.useMemo(() => {
|
|
5701
5928
|
if (!sortKey) return data;
|
|
5702
5929
|
return [...data].sort((a, b) => {
|
|
5703
5930
|
const aVal = a[sortKey];
|
|
@@ -5788,8 +6015,8 @@ function Tooltip6({
|
|
|
5788
6015
|
className,
|
|
5789
6016
|
...rest
|
|
5790
6017
|
}) {
|
|
5791
|
-
const [pos, setPos] =
|
|
5792
|
-
|
|
6018
|
+
const [pos, setPos] = React2.useState({ x: 0, y: 0 });
|
|
6019
|
+
React2.useEffect(() => {
|
|
5793
6020
|
if (!show) return;
|
|
5794
6021
|
const handleMove = (e) => {
|
|
5795
6022
|
setPos({ x: e.clientX + offsetX, y: e.clientY + offsetY });
|
|
@@ -5918,8 +6145,8 @@ function CloudinaryVideo({
|
|
|
5918
6145
|
}
|
|
5919
6146
|
var CloudinaryVideo_default = CloudinaryVideo;
|
|
5920
6147
|
var FormObserver = ({ formik, onChange }) => {
|
|
5921
|
-
const prevValuesRef =
|
|
5922
|
-
|
|
6148
|
+
const prevValuesRef = React2.useRef(formik.values);
|
|
6149
|
+
React2.useEffect(() => {
|
|
5923
6150
|
if (!onChange) return;
|
|
5924
6151
|
const currentValues = formik.values;
|
|
5925
6152
|
const prevValues = prevValuesRef.current;
|
|
@@ -5938,7 +6165,7 @@ var FormObserver = ({ formik, onChange }) => {
|
|
|
5938
6165
|
};
|
|
5939
6166
|
var FormObserver_default = FormObserver;
|
|
5940
6167
|
var DirtyObserver = ({ formik, onDirtyChange }) => {
|
|
5941
|
-
|
|
6168
|
+
React2.useEffect(() => {
|
|
5942
6169
|
if (onDirtyChange) {
|
|
5943
6170
|
onDirtyChange(formik.dirty);
|
|
5944
6171
|
}
|
|
@@ -5947,7 +6174,7 @@ var DirtyObserver = ({ formik, onDirtyChange }) => {
|
|
|
5947
6174
|
};
|
|
5948
6175
|
var DirtyObserver_default = DirtyObserver;
|
|
5949
6176
|
var UnsavedChangesGuard = ({ formik, enabled }) => {
|
|
5950
|
-
|
|
6177
|
+
React2.useEffect(() => {
|
|
5951
6178
|
if (!enabled) return;
|
|
5952
6179
|
const handleBeforeUnload = (e) => {
|
|
5953
6180
|
if (!formik.dirty) return;
|
|
@@ -6235,17 +6462,17 @@ function useToastTimer({
|
|
|
6235
6462
|
pauseOnHover,
|
|
6236
6463
|
onTimeout
|
|
6237
6464
|
}) {
|
|
6238
|
-
const [isPaused, setIsPaused] =
|
|
6239
|
-
const timeoutRef =
|
|
6240
|
-
const startedAtRef =
|
|
6241
|
-
const remainingRef =
|
|
6242
|
-
const clearTimer =
|
|
6465
|
+
const [isPaused, setIsPaused] = React2.useState(false);
|
|
6466
|
+
const timeoutRef = React2.useRef(null);
|
|
6467
|
+
const startedAtRef = React2.useRef(0);
|
|
6468
|
+
const remainingRef = React2.useRef(typeof duration === "number" ? duration : 0);
|
|
6469
|
+
const clearTimer = React2.useCallback(() => {
|
|
6243
6470
|
if (timeoutRef.current !== null) {
|
|
6244
6471
|
window.clearTimeout(timeoutRef.current);
|
|
6245
6472
|
timeoutRef.current = null;
|
|
6246
6473
|
}
|
|
6247
6474
|
}, []);
|
|
6248
|
-
const startTimer =
|
|
6475
|
+
const startTimer = React2.useCallback(() => {
|
|
6249
6476
|
if (typeof duration !== "number" || duration <= 0) {
|
|
6250
6477
|
return;
|
|
6251
6478
|
}
|
|
@@ -6255,12 +6482,12 @@ function useToastTimer({
|
|
|
6255
6482
|
onTimeout();
|
|
6256
6483
|
}, remainingRef.current);
|
|
6257
6484
|
}, [clearTimer, duration, onTimeout]);
|
|
6258
|
-
|
|
6485
|
+
React2.useEffect(() => {
|
|
6259
6486
|
remainingRef.current = typeof duration === "number" ? duration : 0;
|
|
6260
6487
|
startTimer();
|
|
6261
6488
|
return clearTimer;
|
|
6262
6489
|
}, [clearTimer, duration, startTimer]);
|
|
6263
|
-
const pauseTimer =
|
|
6490
|
+
const pauseTimer = React2.useCallback(() => {
|
|
6264
6491
|
if (!pauseOnHover || typeof duration !== "number") {
|
|
6265
6492
|
return;
|
|
6266
6493
|
}
|
|
@@ -6271,14 +6498,14 @@ function useToastTimer({
|
|
|
6271
6498
|
);
|
|
6272
6499
|
setIsPaused(true);
|
|
6273
6500
|
}, [clearTimer, duration, pauseOnHover]);
|
|
6274
|
-
const resumeTimer =
|
|
6501
|
+
const resumeTimer = React2.useCallback(() => {
|
|
6275
6502
|
if (!pauseOnHover || typeof duration !== "number") {
|
|
6276
6503
|
return;
|
|
6277
6504
|
}
|
|
6278
6505
|
setIsPaused(false);
|
|
6279
6506
|
startTimer();
|
|
6280
6507
|
}, [duration, pauseOnHover, startTimer]);
|
|
6281
|
-
const progressStyle =
|
|
6508
|
+
const progressStyle = React2.useMemo(() => {
|
|
6282
6509
|
if (typeof duration !== "number") {
|
|
6283
6510
|
return void 0;
|
|
6284
6511
|
}
|
|
@@ -6319,7 +6546,7 @@ function ToastItem({
|
|
|
6319
6546
|
const duration = item.duration ?? autoClose;
|
|
6320
6547
|
const variant = toastStatusVariantMap[item.status];
|
|
6321
6548
|
const statusStyles = toastVariantStyles[variant];
|
|
6322
|
-
const dismiss =
|
|
6549
|
+
const dismiss = React2.useCallback(() => {
|
|
6323
6550
|
toastStore.remove(item.id);
|
|
6324
6551
|
}, [item.id]);
|
|
6325
6552
|
const { pauseTimer, resumeTimer, progressStyle } = useToastTimer({
|
|
@@ -6398,16 +6625,16 @@ var Toast = ({
|
|
|
6398
6625
|
...rest
|
|
6399
6626
|
}) => {
|
|
6400
6627
|
const eui = useEUIConfig();
|
|
6401
|
-
const [items, setItems] =
|
|
6628
|
+
const [items, setItems] = React2.useState(() => {
|
|
6402
6629
|
return toastStore.getSnapshot();
|
|
6403
6630
|
});
|
|
6404
|
-
|
|
6631
|
+
React2.useEffect(() => {
|
|
6405
6632
|
return toastStore.subscribe(setItems);
|
|
6406
6633
|
}, []);
|
|
6407
|
-
const safeShape =
|
|
6634
|
+
const safeShape = React2.useMemo(() => {
|
|
6408
6635
|
return normalizeToastShape(shape ?? eui?.config?.global?.shape);
|
|
6409
6636
|
}, [shape, eui?.config?.global?.shape]);
|
|
6410
|
-
const visibleItems =
|
|
6637
|
+
const visibleItems = React2.useMemo(() => {
|
|
6411
6638
|
const orderedItems = newestOnTop ? [...items].reverse() : [...items];
|
|
6412
6639
|
return orderedItems.slice(0, maxToasts);
|
|
6413
6640
|
}, [items, maxToasts, newestOnTop]);
|
|
@@ -6486,106 +6713,6 @@ function sendToast(data = {}) {
|
|
|
6486
6713
|
status: data.status || "success" /* success */
|
|
6487
6714
|
});
|
|
6488
6715
|
}
|
|
6489
|
-
function renderTransitionChild(children, className) {
|
|
6490
|
-
const childCount = React8.Children.count(children);
|
|
6491
|
-
if (childCount !== 1) {
|
|
6492
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children });
|
|
6493
|
-
}
|
|
6494
|
-
const child = React8.Children.only(children);
|
|
6495
|
-
if (!React8__default.default.isValidElement(child)) {
|
|
6496
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: child });
|
|
6497
|
-
}
|
|
6498
|
-
const element = child;
|
|
6499
|
-
return React8__default.default.cloneElement(element, {
|
|
6500
|
-
className: classNames17__default.default(element.props.className, className)
|
|
6501
|
-
});
|
|
6502
|
-
}
|
|
6503
|
-
function TransitionBase({
|
|
6504
|
-
visibility,
|
|
6505
|
-
children,
|
|
6506
|
-
enterClassName,
|
|
6507
|
-
leaveClassName,
|
|
6508
|
-
visibleClassName,
|
|
6509
|
-
hiddenClassName,
|
|
6510
|
-
leaveDuration = 150
|
|
6511
|
-
}) {
|
|
6512
|
-
const [mounted, setMounted] = React8.useState(Boolean(visibility));
|
|
6513
|
-
const [active, setActive] = React8.useState(Boolean(visibility));
|
|
6514
|
-
const frameRef = React8.useRef(null);
|
|
6515
|
-
const timeoutRef = React8.useRef(null);
|
|
6516
|
-
React8.useEffect(() => {
|
|
6517
|
-
if (frameRef.current) {
|
|
6518
|
-
cancelAnimationFrame(frameRef.current);
|
|
6519
|
-
}
|
|
6520
|
-
if (timeoutRef.current) {
|
|
6521
|
-
clearTimeout(timeoutRef.current);
|
|
6522
|
-
}
|
|
6523
|
-
if (visibility) {
|
|
6524
|
-
setMounted(true);
|
|
6525
|
-
frameRef.current = requestAnimationFrame(() => {
|
|
6526
|
-
setActive(true);
|
|
6527
|
-
});
|
|
6528
|
-
return;
|
|
6529
|
-
}
|
|
6530
|
-
setActive(false);
|
|
6531
|
-
timeoutRef.current = setTimeout(() => {
|
|
6532
|
-
setMounted(false);
|
|
6533
|
-
}, leaveDuration);
|
|
6534
|
-
return () => {
|
|
6535
|
-
if (frameRef.current) {
|
|
6536
|
-
cancelAnimationFrame(frameRef.current);
|
|
6537
|
-
}
|
|
6538
|
-
if (timeoutRef.current) {
|
|
6539
|
-
clearTimeout(timeoutRef.current);
|
|
6540
|
-
}
|
|
6541
|
-
};
|
|
6542
|
-
}, [visibility, leaveDuration]);
|
|
6543
|
-
if (!mounted) {
|
|
6544
|
-
return null;
|
|
6545
|
-
}
|
|
6546
|
-
const transitionClassName = classNames17__default.default(
|
|
6547
|
-
visibility ? enterClassName : leaveClassName,
|
|
6548
|
-
active ? visibleClassName : hiddenClassName
|
|
6549
|
-
);
|
|
6550
|
-
return renderTransitionChild(children, transitionClassName);
|
|
6551
|
-
}
|
|
6552
|
-
var TransitionBase_default = TransitionBase;
|
|
6553
|
-
function TransitionDropdown({ visibility, children }) {
|
|
6554
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6555
|
-
TransitionBase_default,
|
|
6556
|
-
{
|
|
6557
|
-
visibility: Boolean(visibility),
|
|
6558
|
-
enterClassName: "transition duration-100 ease-out",
|
|
6559
|
-
leaveClassName: "transition duration-50 ease-out",
|
|
6560
|
-
visibleClassName: "transform scale-100 opacity-100",
|
|
6561
|
-
hiddenClassName: "transform scale-95 opacity-0",
|
|
6562
|
-
leaveDuration: 50,
|
|
6563
|
-
children
|
|
6564
|
-
}
|
|
6565
|
-
);
|
|
6566
|
-
}
|
|
6567
|
-
var TransitionDropdown_default = TransitionDropdown;
|
|
6568
|
-
function TransitionFadeIn({ visibility, children }) {
|
|
6569
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6570
|
-
TransitionBase_default,
|
|
6571
|
-
{
|
|
6572
|
-
visibility: Boolean(visibility),
|
|
6573
|
-
enterClassName: "transition-all ease-in-out duration-700 delay-[0ms]",
|
|
6574
|
-
leaveClassName: "transition-all ease-in-out duration-300",
|
|
6575
|
-
visibleClassName: "opacity-100 translate-y-0",
|
|
6576
|
-
hiddenClassName: "opacity-0 translate-y-6",
|
|
6577
|
-
leaveDuration: 300,
|
|
6578
|
-
children
|
|
6579
|
-
}
|
|
6580
|
-
);
|
|
6581
|
-
}
|
|
6582
|
-
var TransitionFadeIn_default = TransitionFadeIn;
|
|
6583
|
-
|
|
6584
|
-
// src/components/feedback/transition/index.tsx
|
|
6585
|
-
var Transition2 = {
|
|
6586
|
-
TransitionDropdown: TransitionDropdown_default,
|
|
6587
|
-
TransitionFadeIn: TransitionFadeIn_default
|
|
6588
|
-
};
|
|
6589
6716
|
var sizes3 = {
|
|
6590
6717
|
xs: "px-2 py-1 text-xs",
|
|
6591
6718
|
sm: "px-3 py-2 text-sm",
|
|
@@ -6600,7 +6727,7 @@ function FormResponse({
|
|
|
6600
6727
|
size = "md",
|
|
6601
6728
|
styles
|
|
6602
6729
|
}) {
|
|
6603
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6730
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Transition.TransitionDropdown, { visibility: text ? true : false, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6604
6731
|
"div",
|
|
6605
6732
|
{
|
|
6606
6733
|
className: classNames17__default.default({
|
|
@@ -6670,17 +6797,17 @@ function YoutubeVideo({
|
|
|
6670
6797
|
) });
|
|
6671
6798
|
}
|
|
6672
6799
|
var YoutubeVideo_default = YoutubeVideo;
|
|
6673
|
-
var ThemeContext =
|
|
6800
|
+
var ThemeContext = React2.createContext(
|
|
6674
6801
|
void 0
|
|
6675
6802
|
);
|
|
6676
6803
|
var ThemeProvider = ({
|
|
6677
6804
|
defaultTheme = "dark",
|
|
6678
6805
|
children
|
|
6679
6806
|
}) => {
|
|
6680
|
-
const [theme, setTheme] =
|
|
6807
|
+
const [theme, setTheme] = React2.useState(() => {
|
|
6681
6808
|
return localStorage.getItem("theme") || defaultTheme;
|
|
6682
6809
|
});
|
|
6683
|
-
|
|
6810
|
+
React2.useEffect(() => {
|
|
6684
6811
|
if (theme === "dark") {
|
|
6685
6812
|
document.documentElement.classList.add("dark");
|
|
6686
6813
|
} else {
|
|
@@ -6694,7 +6821,7 @@ var ThemeProvider = ({
|
|
|
6694
6821
|
return /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value: { theme, setTheme, toggleTheme }, children });
|
|
6695
6822
|
};
|
|
6696
6823
|
var ThemeSwitch = () => {
|
|
6697
|
-
const themeContext =
|
|
6824
|
+
const themeContext = React2.useContext(ThemeContext);
|
|
6698
6825
|
if (!themeContext) return null;
|
|
6699
6826
|
const { theme, toggleTheme } = themeContext;
|
|
6700
6827
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -6756,7 +6883,7 @@ var ShapeSwitch = () => {
|
|
|
6756
6883
|
|
|
6757
6884
|
// src/hooks/theme/useCurrentTheme.ts
|
|
6758
6885
|
var useCurrentTheme = () => {
|
|
6759
|
-
const context =
|
|
6886
|
+
const context = React2.useContext(ThemeContext);
|
|
6760
6887
|
if (!context) {
|
|
6761
6888
|
throw new Error("useCurrentTheme must be used within a ThemeProvider");
|
|
6762
6889
|
}
|
|
@@ -18099,7 +18226,7 @@ function WorldMap({
|
|
|
18099
18226
|
}
|
|
18100
18227
|
};
|
|
18101
18228
|
const mode = isDarkMode ? mapStyles.dark : mapStyles.light;
|
|
18102
|
-
const resolvedData =
|
|
18229
|
+
const resolvedData = React2.useMemo(() => {
|
|
18103
18230
|
return data.map((item) => {
|
|
18104
18231
|
const c = COUNTRIES.find((x) => x.code === item.code);
|
|
18105
18232
|
if (!c) return null;
|
|
@@ -18111,8 +18238,8 @@ function WorldMap({
|
|
|
18111
18238
|
}).filter(Boolean);
|
|
18112
18239
|
}, [data]);
|
|
18113
18240
|
const maxValue = resolvedData.length > 0 ? Math.max(...resolvedData.map((d) => d.value)) : 0;
|
|
18114
|
-
const [showTooltip, setShowTooltip] =
|
|
18115
|
-
const [tooltipContent, setTooltipContent] =
|
|
18241
|
+
const [showTooltip, setShowTooltip] = React2.useState(false);
|
|
18242
|
+
const [tooltipContent, setTooltipContent] = React2.useState(null);
|
|
18116
18243
|
const handleMouseMove = (_e, point) => {
|
|
18117
18244
|
setTooltipContent(
|
|
18118
18245
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
@@ -18198,7 +18325,7 @@ function Button({
|
|
|
18198
18325
|
}) {
|
|
18199
18326
|
const eui = useEUIConfig();
|
|
18200
18327
|
const resolvedShape = shape ?? eui?.config?.global?.shape ?? "square";
|
|
18201
|
-
const btnRef =
|
|
18328
|
+
const btnRef = React2.useRef(null);
|
|
18202
18329
|
const variantStyles = resolveAppearanceStyles({
|
|
18203
18330
|
appearance,
|
|
18204
18331
|
variant,
|
|
@@ -18265,7 +18392,7 @@ function InputResponse({
|
|
|
18265
18392
|
variant = "default",
|
|
18266
18393
|
styles
|
|
18267
18394
|
}) {
|
|
18268
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18395
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Transition.TransitionDropdown, { visibility, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18269
18396
|
"div",
|
|
18270
18397
|
{
|
|
18271
18398
|
className: classNames17__default.default({
|
|
@@ -18299,7 +18426,7 @@ var toggleType = (visibility) => {
|
|
|
18299
18426
|
var PasswordVisibilityToggler = ({
|
|
18300
18427
|
onClick
|
|
18301
18428
|
}) => {
|
|
18302
|
-
const [passwordVisibility, setPasswordVisibilty] =
|
|
18429
|
+
const [passwordVisibility, setPasswordVisibilty] = React2.useState(false);
|
|
18303
18430
|
const handleOnClick = (visibility) => {
|
|
18304
18431
|
onClick(visibility);
|
|
18305
18432
|
setPasswordVisibilty(visibility);
|
|
@@ -18324,7 +18451,7 @@ var Input = ({
|
|
|
18324
18451
|
const eui = useEUIConfig();
|
|
18325
18452
|
const resolvedShape = shape ?? eui?.config?.global?.shape ?? "square";
|
|
18326
18453
|
const [field, meta] = formik.useField(props);
|
|
18327
|
-
const [passwordVisibility, setPasswordVisibilty] =
|
|
18454
|
+
const [passwordVisibility, setPasswordVisibilty] = React2.useState(false);
|
|
18328
18455
|
const inputType = type === "password" ? toggleType(passwordVisibility) : type;
|
|
18329
18456
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full", children: [
|
|
18330
18457
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -18369,7 +18496,7 @@ var InputFile = ({
|
|
|
18369
18496
|
styles,
|
|
18370
18497
|
...props
|
|
18371
18498
|
}) => {
|
|
18372
|
-
const fileInputRef =
|
|
18499
|
+
const fileInputRef = React2.useRef(null);
|
|
18373
18500
|
const [field, meta, helpers] = formik.useField(props);
|
|
18374
18501
|
const handleFileChange = (e) => {
|
|
18375
18502
|
const file = e.target.files?.[0] || null;
|
|
@@ -18909,7 +19036,7 @@ function ImageView({ imageUrl, secure = true, alt = "image" }) {
|
|
|
18909
19036
|
) }) });
|
|
18910
19037
|
}
|
|
18911
19038
|
var ImageView_default = ImageView;
|
|
18912
|
-
var ImageInput =
|
|
19039
|
+
var ImageInput = React2.forwardRef(
|
|
18913
19040
|
({
|
|
18914
19041
|
title = "Upload Image",
|
|
18915
19042
|
uploadDir = "eg-frontend-admin-temp",
|
|
@@ -18921,10 +19048,10 @@ var ImageInput = React8.forwardRef(
|
|
|
18921
19048
|
const [field, meta, helpers] = formik.useField(props);
|
|
18922
19049
|
const { value: imageUrl } = field;
|
|
18923
19050
|
const { setValue } = helpers;
|
|
18924
|
-
const [image, setImage] =
|
|
18925
|
-
const [url, setUrl] =
|
|
18926
|
-
const [loading, setLoading] =
|
|
18927
|
-
const [preview, setPreview] =
|
|
19051
|
+
const [image, setImage] = React2.useState(null);
|
|
19052
|
+
const [url, setUrl] = React2.useState(imageUrl);
|
|
19053
|
+
const [loading, setLoading] = React2.useState(false);
|
|
19054
|
+
const [preview, setPreview] = React2.useState(null);
|
|
18928
19055
|
const uploadImage = async () => {
|
|
18929
19056
|
if (!image) return;
|
|
18930
19057
|
setLoading(true);
|
|
@@ -18970,10 +19097,10 @@ var ImageInput = React8.forwardRef(
|
|
|
18970
19097
|
if (!disableSetValue) setValue("");
|
|
18971
19098
|
setLoading(false);
|
|
18972
19099
|
};
|
|
18973
|
-
|
|
19100
|
+
React2.useImperativeHandle(ref, () => ({
|
|
18974
19101
|
handleResetClick
|
|
18975
19102
|
}));
|
|
18976
|
-
|
|
19103
|
+
React2.useEffect(() => {
|
|
18977
19104
|
if (!disableSetValue) setValue(url);
|
|
18978
19105
|
}, [url, setValue, disableSetValue]);
|
|
18979
19106
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full", children: [
|
|
@@ -19058,14 +19185,14 @@ function MultiImageInput({
|
|
|
19058
19185
|
const [field, meta, helpers] = formik.useField(props);
|
|
19059
19186
|
const { value: imageUrls } = field;
|
|
19060
19187
|
const { setValue } = helpers;
|
|
19061
|
-
const imageInputRef =
|
|
19188
|
+
const imageInputRef = React2.useRef(null);
|
|
19062
19189
|
const onValueChanged = (url) => {
|
|
19063
19190
|
setValue([...imageUrls, url]);
|
|
19064
19191
|
if (imageInputRef.current) {
|
|
19065
19192
|
imageInputRef.current.handleResetClick();
|
|
19066
19193
|
}
|
|
19067
19194
|
};
|
|
19068
|
-
|
|
19195
|
+
React2.useEffect(() => {
|
|
19069
19196
|
}, [imageUrls]);
|
|
19070
19197
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
19071
19198
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row flex-wrap gap-5 w-ful", children: [
|
|
@@ -19165,9 +19292,9 @@ function StarRatingInput({
|
|
|
19165
19292
|
const { name } = props;
|
|
19166
19293
|
const [field, meta] = formik.useField(props);
|
|
19167
19294
|
const formikContext = formik.useFormikContext();
|
|
19168
|
-
const [rating, setRating] =
|
|
19169
|
-
const [hover, setHover] =
|
|
19170
|
-
|
|
19295
|
+
const [rating, setRating] = React2.useState(Number(field.value) || 0);
|
|
19296
|
+
const [hover, setHover] = React2.useState(null);
|
|
19297
|
+
React2.useEffect(() => {
|
|
19171
19298
|
setRating(Number(field.value));
|
|
19172
19299
|
}, [field.value]);
|
|
19173
19300
|
const handleOnClick = (index) => {
|
|
@@ -19316,7 +19443,7 @@ function Tags({
|
|
|
19316
19443
|
...props
|
|
19317
19444
|
}) {
|
|
19318
19445
|
const [field, meta, helpers] = formik.useField({ ...props });
|
|
19319
|
-
const [input, setInput] =
|
|
19446
|
+
const [input, setInput] = React2.useState("");
|
|
19320
19447
|
const handleAddTag = () => {
|
|
19321
19448
|
const trimmed = input.trim();
|
|
19322
19449
|
if (trimmed && !field.value.includes(trimmed) && field.value.length < limit) {
|
|
@@ -19580,8 +19707,8 @@ var Header = ({
|
|
|
19580
19707
|
);
|
|
19581
19708
|
};
|
|
19582
19709
|
var useIsMobile = (breakpoint = 768) => {
|
|
19583
|
-
const [isMobile, setIsMobile] =
|
|
19584
|
-
|
|
19710
|
+
const [isMobile, setIsMobile] = React2.useState(window.innerWidth < breakpoint);
|
|
19711
|
+
React2.useEffect(() => {
|
|
19585
19712
|
const handleResize = () => {
|
|
19586
19713
|
setIsMobile(window.innerWidth < breakpoint);
|
|
19587
19714
|
};
|
|
@@ -19691,7 +19818,7 @@ function BlockGroup({
|
|
|
19691
19818
|
}
|
|
19692
19819
|
var BlockGroup_default = BlockGroup;
|
|
19693
19820
|
var useTheme = () => {
|
|
19694
|
-
const context =
|
|
19821
|
+
const context = React2.useContext(ThemeContext);
|
|
19695
19822
|
if (!context) {
|
|
19696
19823
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
19697
19824
|
}
|
|
@@ -19753,11 +19880,11 @@ function MarkdownEditor({
|
|
|
19753
19880
|
] });
|
|
19754
19881
|
}
|
|
19755
19882
|
var MarkdownEditor_default = MarkdownEditor;
|
|
19756
|
-
var MarkdownContext =
|
|
19883
|
+
var MarkdownContext = React2.createContext(null);
|
|
19757
19884
|
|
|
19758
19885
|
// src/components/markdown/hooks/useMarkdown.tsx
|
|
19759
19886
|
function useMarkdown() {
|
|
19760
|
-
return
|
|
19887
|
+
return React2.useContext(MarkdownContext);
|
|
19761
19888
|
}
|
|
19762
19889
|
|
|
19763
19890
|
// src/components/markdown/utils/generateHeadingNumbers.ts
|
|
@@ -19832,7 +19959,7 @@ function MarkdownViewer({ value }) {
|
|
|
19832
19959
|
const markdown = value ?? context?.markdown ?? "";
|
|
19833
19960
|
const headings = context?.headings ?? [];
|
|
19834
19961
|
const setActiveHeading = context?.setActiveHeading;
|
|
19835
|
-
|
|
19962
|
+
React2.useEffect(() => {
|
|
19836
19963
|
const timeout = setTimeout(() => {
|
|
19837
19964
|
headings.forEach((heading) => {
|
|
19838
19965
|
const headingEls = document.querySelectorAll("h1,h2,h3,h4,h5,h6");
|
|
@@ -19937,8 +20064,8 @@ function extractHeadings(markdown) {
|
|
|
19937
20064
|
});
|
|
19938
20065
|
}
|
|
19939
20066
|
function MarkdownProvider({ markdown, children }) {
|
|
19940
|
-
const [activeHeading, setActiveHeading] =
|
|
19941
|
-
const headings =
|
|
20067
|
+
const [activeHeading, setActiveHeading] = React2.useState("");
|
|
20068
|
+
const headings = React2.useMemo(() => extractHeadings(markdown), [markdown]);
|
|
19942
20069
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19943
20070
|
MarkdownContext.Provider,
|
|
19944
20071
|
{
|
|
@@ -20011,7 +20138,7 @@ var Breadcrumb = ({
|
|
|
20011
20138
|
const { config } = useEUIConfig();
|
|
20012
20139
|
const pathname = currentPath || (typeof window !== "undefined" ? window.location.pathname : "/");
|
|
20013
20140
|
const resolvedRoutes = routes || config?.routes || [];
|
|
20014
|
-
const resolvedData =
|
|
20141
|
+
const resolvedData = React2.useMemo(() => {
|
|
20015
20142
|
if (resolvedRoutes && resolvedRoutes.length > 0) {
|
|
20016
20143
|
return buildFromRoutes(resolvedRoutes, pathname);
|
|
20017
20144
|
}
|
|
@@ -20028,7 +20155,7 @@ var Breadcrumb = ({
|
|
|
20028
20155
|
navigate(item.href);
|
|
20029
20156
|
}
|
|
20030
20157
|
};
|
|
20031
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
20158
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React2__default.default.Fragment, { children: [
|
|
20032
20159
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
20033
20160
|
BreadcrumbItem_default,
|
|
20034
20161
|
{
|
|
@@ -20068,63 +20195,41 @@ var Drawer = ({
|
|
|
20068
20195
|
visibility,
|
|
20069
20196
|
side = "left",
|
|
20070
20197
|
handleClose,
|
|
20071
|
-
styles
|
|
20198
|
+
styles,
|
|
20199
|
+
showBackdrop = true,
|
|
20200
|
+
closeOnBackdropClick = true
|
|
20072
20201
|
}) => {
|
|
20073
20202
|
const isHorizontal = side === "left" || side === "right";
|
|
20074
20203
|
const isMobile = useIsMobile_default();
|
|
20075
20204
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
20076
|
-
isMobile &&
|
|
20205
|
+
isMobile && showBackdrop && /* @__PURE__ */ jsxRuntime.jsx(TransitionFade_default, { visibility, leaveDuration: 200, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
20077
20206
|
"div",
|
|
20078
20207
|
{
|
|
20079
|
-
className: "fixed inset-0 bg-black
|
|
20080
|
-
onClick: handleClose
|
|
20208
|
+
className: "fixed inset-0 bg-black/50 z-40",
|
|
20209
|
+
onClick: closeOnBackdropClick ? handleClose : void 0
|
|
20081
20210
|
}
|
|
20082
|
-
),
|
|
20083
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
20084
|
-
|
|
20211
|
+
) }),
|
|
20212
|
+
/* @__PURE__ */ jsxRuntime.jsx(TransitionSlide_default, { visibility, side, leaveDuration: 200, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
20213
|
+
"div",
|
|
20085
20214
|
{
|
|
20086
|
-
|
|
20087
|
-
|
|
20088
|
-
enterFrom: classNames17__default.default({
|
|
20089
|
-
"-translate-x-full": side === "left",
|
|
20090
|
-
"translate-x-full": side === "right",
|
|
20091
|
-
"-translate-y-full": side === "top",
|
|
20092
|
-
"translate-y-full": side === "bottom"
|
|
20093
|
-
}),
|
|
20094
|
-
enterTo: "translate-x-0 translate-y-0",
|
|
20095
|
-
leave: "transform transition duration-200 ease-in",
|
|
20096
|
-
leaveFrom: "translate-x-0 translate-y-0",
|
|
20097
|
-
leaveTo: classNames17__default.default({
|
|
20098
|
-
"-translate-x-full": side === "left",
|
|
20099
|
-
"translate-x-full": side === "right",
|
|
20100
|
-
"-translate-y-full": side === "top",
|
|
20101
|
-
"translate-y-full": side === "bottom"
|
|
20102
|
-
}),
|
|
20103
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
20104
|
-
"div",
|
|
20215
|
+
className: classNames17__default.default(
|
|
20216
|
+
"fixed shadow-lg z-50",
|
|
20105
20217
|
{
|
|
20106
|
-
|
|
20107
|
-
|
|
20108
|
-
|
|
20109
|
-
|
|
20110
|
-
|
|
20111
|
-
|
|
20112
|
-
|
|
20113
|
-
|
|
20114
|
-
|
|
20115
|
-
|
|
20116
|
-
|
|
20117
|
-
|
|
20118
|
-
|
|
20119
|
-
},
|
|
20120
|
-
{ "eui-bg-md": !styles },
|
|
20121
|
-
{ [`${styles}`]: styles }
|
|
20122
|
-
),
|
|
20123
|
-
children
|
|
20124
|
-
}
|
|
20125
|
-
)
|
|
20218
|
+
"h-full w-[300px] top-0": isHorizontal,
|
|
20219
|
+
"w-full h-[300px] left-0": !isHorizontal,
|
|
20220
|
+
"left-0": side === "left",
|
|
20221
|
+
"right-0": side === "right",
|
|
20222
|
+
"top-0": side === "top",
|
|
20223
|
+
"bottom-0": side === "bottom"
|
|
20224
|
+
},
|
|
20225
|
+
{
|
|
20226
|
+
"eui-bg-md": !styles
|
|
20227
|
+
},
|
|
20228
|
+
styles
|
|
20229
|
+
),
|
|
20230
|
+
children
|
|
20126
20231
|
}
|
|
20127
|
-
)
|
|
20232
|
+
) })
|
|
20128
20233
|
] });
|
|
20129
20234
|
};
|
|
20130
20235
|
function DrawerToggler({
|
|
@@ -20373,7 +20478,7 @@ function HeaderNav({ data = [], styles }) {
|
|
|
20373
20478
|
}
|
|
20374
20479
|
var HeaderNav_default = HeaderNav;
|
|
20375
20480
|
function useClickOutside(ref, fun) {
|
|
20376
|
-
|
|
20481
|
+
React2.useEffect(() => {
|
|
20377
20482
|
const listener = (e) => {
|
|
20378
20483
|
if (!ref.current || ref.current.contains(e.target)) {
|
|
20379
20484
|
return;
|
|
@@ -20414,8 +20519,8 @@ var HeaderNavGroup = ({
|
|
|
20414
20519
|
styles,
|
|
20415
20520
|
children
|
|
20416
20521
|
}) => {
|
|
20417
|
-
const [collapsed, setCollapsed] =
|
|
20418
|
-
const headerNavGroupRef =
|
|
20522
|
+
const [collapsed, setCollapsed] = React2.useState(true);
|
|
20523
|
+
const headerNavGroupRef = React2.useRef(null);
|
|
20419
20524
|
useClickOutside(headerNavGroupRef, () => setCollapsed(true));
|
|
20420
20525
|
const handleNavigation = () => {
|
|
20421
20526
|
if (to) {
|
|
@@ -20638,8 +20743,8 @@ var MenuGroup = ({
|
|
|
20638
20743
|
style,
|
|
20639
20744
|
...rest
|
|
20640
20745
|
}) => {
|
|
20641
|
-
const [collapsed, setCollapsed] =
|
|
20642
|
-
|
|
20746
|
+
const [collapsed, setCollapsed] = React2.useState(!defaultOpen);
|
|
20747
|
+
React2.useEffect(() => {
|
|
20643
20748
|
if (defaultOpen !== void 0) {
|
|
20644
20749
|
setCollapsed(!defaultOpen);
|
|
20645
20750
|
}
|
|
@@ -20756,12 +20861,12 @@ var Menu = ({
|
|
|
20756
20861
|
defaultMenuElements,
|
|
20757
20862
|
currentPath
|
|
20758
20863
|
}) => {
|
|
20759
|
-
const normalizedItems =
|
|
20760
|
-
const selected =
|
|
20864
|
+
const normalizedItems = React2.useMemo(() => assignKeys(items), [items]);
|
|
20865
|
+
const selected = React2.useMemo(() => {
|
|
20761
20866
|
if (!currentPath) return void 0;
|
|
20762
20867
|
return findSelectedKey(normalizedItems, currentPath);
|
|
20763
20868
|
}, [currentPath, normalizedItems]);
|
|
20764
|
-
const parentMap =
|
|
20869
|
+
const parentMap = React2.useMemo(
|
|
20765
20870
|
() => buildParentMap(normalizedItems),
|
|
20766
20871
|
[normalizedItems]
|
|
20767
20872
|
);
|
|
@@ -20914,8 +21019,8 @@ function RouteTabs({
|
|
|
20914
21019
|
const currentPath = window.location.pathname;
|
|
20915
21020
|
return navData.find((tab) => tab.to === currentPath)?.to || navData[0]?.to;
|
|
20916
21021
|
};
|
|
20917
|
-
const [activeTab, setActiveTab] =
|
|
20918
|
-
|
|
21022
|
+
const [activeTab, setActiveTab] = React2.useState(getActiveTab);
|
|
21023
|
+
React2.useEffect(() => {
|
|
20919
21024
|
if (mode !== "route") return;
|
|
20920
21025
|
const handlePopState = () => {
|
|
20921
21026
|
setActiveTab(getActiveTab());
|
|
@@ -20958,16 +21063,21 @@ function RouteTabs({
|
|
|
20958
21063
|
] });
|
|
20959
21064
|
}
|
|
20960
21065
|
var RouteTabs_default = RouteTabs;
|
|
21066
|
+
function UnderConstructionBanner({
|
|
21067
|
+
text
|
|
21068
|
+
}) {
|
|
21069
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-5", children: /* @__PURE__ */ jsxRuntime.jsx(Info_default, { children: text ? text : "This component is currently under construction and will be made available soon" }) });
|
|
21070
|
+
}
|
|
20961
21071
|
var getDefaultErrorMessage = (error) => {
|
|
20962
21072
|
if (!error) return "Something went wrong.";
|
|
20963
21073
|
if (typeof error === "string") return error;
|
|
20964
21074
|
if (error instanceof Error) return error.message;
|
|
20965
21075
|
if (typeof error === "object") {
|
|
20966
21076
|
const anyErr = error;
|
|
20967
|
-
if (anyErr?.data?.message
|
|
21077
|
+
if (typeof anyErr?.data?.message === "string") {
|
|
20968
21078
|
return anyErr.data.message;
|
|
20969
21079
|
}
|
|
20970
|
-
if (
|
|
21080
|
+
if (typeof anyErr?.message === "string") {
|
|
20971
21081
|
return anyErr.message;
|
|
20972
21082
|
}
|
|
20973
21083
|
if (anyErr?.status) {
|
|
@@ -20983,20 +21093,107 @@ var getDefaultErrorMessage = (error) => {
|
|
|
20983
21093
|
};
|
|
20984
21094
|
function AsyncComponentWrapper({
|
|
20985
21095
|
children,
|
|
20986
|
-
isLoading,
|
|
20987
|
-
|
|
20988
|
-
|
|
21096
|
+
isLoading = false,
|
|
21097
|
+
isFetching = false,
|
|
21098
|
+
isSuccess,
|
|
21099
|
+
isError = false,
|
|
21100
|
+
isUninitialized = false,
|
|
20989
21101
|
error,
|
|
20990
|
-
|
|
21102
|
+
isEmpty = false,
|
|
21103
|
+
loadingText = "Loading...",
|
|
21104
|
+
fetchingText = "Updating...",
|
|
21105
|
+
emptyText = "No data available.",
|
|
21106
|
+
loadingType = "spinner",
|
|
21107
|
+
skeletonCount = 3,
|
|
21108
|
+
skeletonClassName = "h-24 w-full rounded-md",
|
|
21109
|
+
spinnerProps,
|
|
21110
|
+
fetchingSpinnerProps,
|
|
21111
|
+
loadingFallback,
|
|
21112
|
+
emptyFallback,
|
|
21113
|
+
errorFallback,
|
|
21114
|
+
showFetchingIndicator = true,
|
|
21115
|
+
onRetry,
|
|
21116
|
+
errorFormatter,
|
|
21117
|
+
className,
|
|
21118
|
+
contentClassName
|
|
20991
21119
|
}) {
|
|
20992
|
-
const errorMessage =
|
|
20993
|
-
|
|
20994
|
-
|
|
20995
|
-
|
|
20996
|
-
|
|
21120
|
+
const errorMessage = React2.useMemo(() => {
|
|
21121
|
+
if (!isError) return "";
|
|
21122
|
+
return errorFormatter ? errorFormatter(error) : getDefaultErrorMessage(error);
|
|
21123
|
+
}, [isError, error, errorFormatter]);
|
|
21124
|
+
const hasSuccess = isSuccess ?? (!isLoading && !isError && !isUninitialized);
|
|
21125
|
+
const renderLoading = () => {
|
|
21126
|
+
if (loadingFallback) return loadingFallback;
|
|
21127
|
+
if (loadingType === "skeleton") {
|
|
21128
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-3 py-4", children: Array.from({ length: skeletonCount }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: skeletonClassName }, index)) });
|
|
21129
|
+
}
|
|
21130
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21131
|
+
Spinner_default,
|
|
21132
|
+
{
|
|
21133
|
+
centered: true,
|
|
21134
|
+
label: loadingText,
|
|
21135
|
+
type: "border",
|
|
21136
|
+
size: "md",
|
|
21137
|
+
variant: "primary",
|
|
21138
|
+
...spinnerProps
|
|
21139
|
+
}
|
|
21140
|
+
);
|
|
21141
|
+
};
|
|
21142
|
+
const renderError = () => {
|
|
21143
|
+
if (typeof errorFallback === "function") {
|
|
21144
|
+
return errorFallback(errorMessage);
|
|
21145
|
+
}
|
|
21146
|
+
if (errorFallback) {
|
|
21147
|
+
return errorFallback;
|
|
21148
|
+
}
|
|
21149
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-5", children: [
|
|
21150
|
+
/* @__PURE__ */ jsxRuntime.jsx(FormResponse_default, { text: errorMessage, variant: "danger" }),
|
|
21151
|
+
onRetry && /* @__PURE__ */ jsxRuntime.jsx(
|
|
21152
|
+
"button",
|
|
21153
|
+
{
|
|
21154
|
+
type: "button",
|
|
21155
|
+
onClick: onRetry,
|
|
21156
|
+
className: "mt-3 rounded-md border px-4 py-2",
|
|
21157
|
+
children: "Retry"
|
|
21158
|
+
}
|
|
21159
|
+
)
|
|
21160
|
+
] });
|
|
21161
|
+
};
|
|
21162
|
+
const renderEmpty = () => {
|
|
21163
|
+
if (emptyFallback) return emptyFallback;
|
|
21164
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "py-10 text-center text-gray-500", children: emptyText });
|
|
21165
|
+
};
|
|
21166
|
+
if (isLoading) {
|
|
21167
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, "aria-live": "polite", children: renderLoading() });
|
|
21168
|
+
}
|
|
21169
|
+
if (isError) {
|
|
21170
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, "aria-live": "polite", children: renderError() });
|
|
21171
|
+
}
|
|
21172
|
+
if (hasSuccess && isEmpty) {
|
|
21173
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, "aria-live": "polite", children: renderEmpty() });
|
|
21174
|
+
}
|
|
21175
|
+
if (!hasSuccess) {
|
|
21176
|
+
return null;
|
|
21177
|
+
}
|
|
21178
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, children: [
|
|
21179
|
+
showFetchingIndicator && isFetching && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-3 flex items-center gap-2 text-sm text-gray-500", children: [
|
|
21180
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21181
|
+
Spinner_default,
|
|
21182
|
+
{
|
|
21183
|
+
size: "xs",
|
|
21184
|
+
type: "border",
|
|
21185
|
+
variant: "primary",
|
|
21186
|
+
showLabel: false,
|
|
21187
|
+
ariaLabel: fetchingText,
|
|
21188
|
+
...fetchingSpinnerProps
|
|
21189
|
+
}
|
|
21190
|
+
),
|
|
21191
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: fetchingText })
|
|
21192
|
+
] }),
|
|
21193
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(contentClassName), children })
|
|
20997
21194
|
] });
|
|
20998
21195
|
}
|
|
20999
|
-
var AsyncComponentWrapper_default = AsyncComponentWrapper;
|
|
21196
|
+
var AsyncComponentWrapper_default = React2__default.default.memo(AsyncComponentWrapper);
|
|
21000
21197
|
function Modal({
|
|
21001
21198
|
title,
|
|
21002
21199
|
show = false,
|
|
@@ -21012,68 +21209,51 @@ function Modal({
|
|
|
21012
21209
|
}) {
|
|
21013
21210
|
const eui = useEUIConfig();
|
|
21014
21211
|
const resolvedShape = shape ?? eui?.config?.global?.shape ?? "square";
|
|
21015
|
-
const modalRef =
|
|
21212
|
+
const modalRef = React2.useRef(null);
|
|
21016
21213
|
useClickOutside(
|
|
21017
21214
|
modalRef,
|
|
21018
21215
|
enableCloseOnClickOutside ? handleOnClose : void 0
|
|
21019
21216
|
);
|
|
21020
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21021
|
-
|
|
21217
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TransitionFade_default, { visibility: show, leaveDuration: 100, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-eui-dark-900/90 top-0 bottom-0 left-0 right-0 z-50 fixed inset-0 flex items-center justify-center overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(TransitionScale_default, { visibility: show, leaveDuration: 100, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
21218
|
+
"div",
|
|
21022
21219
|
{
|
|
21023
|
-
|
|
21024
|
-
|
|
21025
|
-
|
|
21026
|
-
|
|
21027
|
-
|
|
21028
|
-
|
|
21029
|
-
|
|
21030
|
-
|
|
21031
|
-
|
|
21032
|
-
|
|
21033
|
-
|
|
21034
|
-
|
|
21035
|
-
|
|
21036
|
-
|
|
21037
|
-
|
|
21038
|
-
|
|
21039
|
-
|
|
21040
|
-
|
|
21041
|
-
|
|
21042
|
-
|
|
21043
|
-
|
|
21044
|
-
|
|
21045
|
-
|
|
21046
|
-
|
|
21047
|
-
|
|
21048
|
-
|
|
21049
|
-
|
|
21050
|
-
|
|
21051
|
-
|
|
21052
|
-
|
|
21053
|
-
|
|
21054
|
-
|
|
21055
|
-
|
|
21056
|
-
AsyncComponentWrapper_default,
|
|
21057
|
-
{
|
|
21058
|
-
isLoading,
|
|
21059
|
-
isSuccess,
|
|
21060
|
-
isError,
|
|
21061
|
-
error,
|
|
21062
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-5 w-full", children })
|
|
21063
|
-
}
|
|
21064
|
-
)
|
|
21065
|
-
]
|
|
21066
|
-
}
|
|
21067
|
-
) })
|
|
21220
|
+
ref: modalRef,
|
|
21221
|
+
className: classNames17__default.default(
|
|
21222
|
+
"eui-bg-md eui-shadow-lg border border-gray-700/80 w-fit h-fit",
|
|
21223
|
+
shapes[resolvedShape],
|
|
21224
|
+
styles
|
|
21225
|
+
),
|
|
21226
|
+
children: [
|
|
21227
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "eui-gradient-to-r-sm inline-flex items-center border-b w-full border-eui-dark-500/80", children: [
|
|
21228
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full text-center text-md font-semibold", children: title }),
|
|
21229
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21230
|
+
"button",
|
|
21231
|
+
{
|
|
21232
|
+
type: "button",
|
|
21233
|
+
className: classNames17__default.default(
|
|
21234
|
+
"w-[60px] h-[60px] flex items-center justify-center transition-standard-fast",
|
|
21235
|
+
"hover:cursor-pointer hover:bg-eui-dark-500"
|
|
21236
|
+
),
|
|
21237
|
+
onClick: handleOnClose,
|
|
21238
|
+
children: "X"
|
|
21239
|
+
}
|
|
21240
|
+
)
|
|
21241
|
+
] }),
|
|
21242
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21243
|
+
AsyncComponentWrapper_default,
|
|
21244
|
+
{
|
|
21245
|
+
isLoading,
|
|
21246
|
+
isSuccess,
|
|
21247
|
+
isError,
|
|
21248
|
+
error,
|
|
21249
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-5 w-full", children })
|
|
21250
|
+
}
|
|
21251
|
+
)
|
|
21252
|
+
]
|
|
21068
21253
|
}
|
|
21069
|
-
);
|
|
21254
|
+
) }) }) });
|
|
21070
21255
|
}
|
|
21071
21256
|
var Modal_default = Modal;
|
|
21072
|
-
function UnderConstructionBanner({
|
|
21073
|
-
text
|
|
21074
|
-
}) {
|
|
21075
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-5", children: /* @__PURE__ */ jsxRuntime.jsx(Info_default, { children: text ? text : "This component is currently under construction and will be made available soon" }) });
|
|
21076
|
-
}
|
|
21077
21257
|
var GlowWrapper = ({
|
|
21078
21258
|
children,
|
|
21079
21259
|
glowSize = 200,
|
|
@@ -21081,8 +21261,8 @@ var GlowWrapper = ({
|
|
|
21081
21261
|
className = "",
|
|
21082
21262
|
hideOnLeave = true
|
|
21083
21263
|
}) => {
|
|
21084
|
-
const ref =
|
|
21085
|
-
const handleMove =
|
|
21264
|
+
const ref = React2.useRef(null);
|
|
21265
|
+
const handleMove = React2.useCallback(
|
|
21086
21266
|
(e) => {
|
|
21087
21267
|
const el = ref.current;
|
|
21088
21268
|
if (!el) return;
|
|
@@ -21104,7 +21284,7 @@ var GlowWrapper = ({
|
|
|
21104
21284
|
},
|
|
21105
21285
|
[glowSize, glowColor]
|
|
21106
21286
|
);
|
|
21107
|
-
const handleLeave =
|
|
21287
|
+
const handleLeave = React2.useCallback(() => {
|
|
21108
21288
|
const el = ref.current;
|
|
21109
21289
|
if (!el || !hideOnLeave) return;
|
|
21110
21290
|
el.style.setProperty("--glow-x", `-999px`);
|
|
@@ -21149,8 +21329,8 @@ function InfiniteScrollTrigger({
|
|
|
21149
21329
|
threshold = 0,
|
|
21150
21330
|
onLoadMore
|
|
21151
21331
|
}) {
|
|
21152
|
-
const triggerRef =
|
|
21153
|
-
|
|
21332
|
+
const triggerRef = React2.useRef(null);
|
|
21333
|
+
React2.useEffect(() => {
|
|
21154
21334
|
const element = triggerRef.current;
|
|
21155
21335
|
if (!element || !hasMore || isLoading) {
|
|
21156
21336
|
return;
|
|
@@ -21176,7 +21356,7 @@ function InfiniteScrollTrigger({
|
|
|
21176
21356
|
}
|
|
21177
21357
|
var InfiniteScrollTrigger_default = InfiniteScrollTrigger;
|
|
21178
21358
|
function ShowMore({ text, limit }) {
|
|
21179
|
-
const [showMore, setShowMore] =
|
|
21359
|
+
const [showMore, setShowMore] = React2.useState(false);
|
|
21180
21360
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
21181
21361
|
showMore ? text : `${text.substring(0, limit)}`,
|
|
21182
21362
|
text.length > limit && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
@@ -21211,8 +21391,8 @@ function CommentComposer({
|
|
|
21211
21391
|
loading,
|
|
21212
21392
|
onSubmit
|
|
21213
21393
|
}) {
|
|
21214
|
-
const [value, setValue] =
|
|
21215
|
-
const [focused, setFocused] =
|
|
21394
|
+
const [value, setValue] = React2.useState("");
|
|
21395
|
+
const [focused, setFocused] = React2.useState(false);
|
|
21216
21396
|
async function handleSubmit() {
|
|
21217
21397
|
const content = value.trim();
|
|
21218
21398
|
if (!content) {
|
|
@@ -21467,7 +21647,7 @@ function CommentHeader({ comment, config }) {
|
|
|
21467
21647
|
}
|
|
21468
21648
|
var CommentHeader_default = CommentHeader;
|
|
21469
21649
|
var useDrawer = (defaultVisibility = true) => {
|
|
21470
|
-
const [show, setShow] =
|
|
21650
|
+
const [show, setShow] = React2.useState(defaultVisibility);
|
|
21471
21651
|
const openDrawer = () => {
|
|
21472
21652
|
setShow((prev) => !prev);
|
|
21473
21653
|
};
|
|
@@ -21482,7 +21662,7 @@ var useDrawer = (defaultVisibility = true) => {
|
|
|
21482
21662
|
};
|
|
21483
21663
|
var useDrawer_default = useDrawer;
|
|
21484
21664
|
var useModal = () => {
|
|
21485
|
-
const [show, setShow] =
|
|
21665
|
+
const [show, setShow] = React2.useState(false);
|
|
21486
21666
|
const handleOpenModal = () => {
|
|
21487
21667
|
setShow(true);
|
|
21488
21668
|
};
|
|
@@ -21530,7 +21710,7 @@ function CommentMenu({
|
|
|
21530
21710
|
onDelete,
|
|
21531
21711
|
onReport
|
|
21532
21712
|
}) {
|
|
21533
|
-
const ref =
|
|
21713
|
+
const ref = React2.useRef(null);
|
|
21534
21714
|
useClickOutside(ref, () => setOpen(false));
|
|
21535
21715
|
const items = [];
|
|
21536
21716
|
if (canEdit) {
|
|
@@ -21585,7 +21765,7 @@ function CommentMenu({
|
|
|
21585
21765
|
children: /* @__PURE__ */ jsxRuntime.jsx(bi.BiDotsVerticalRounded, { size: 18 })
|
|
21586
21766
|
}
|
|
21587
21767
|
),
|
|
21588
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21768
|
+
/* @__PURE__ */ jsxRuntime.jsx(Transition.TransitionDropdown, { visibility: open, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-0 top-full z-50 mt-2 min-w-[180px] overflow-hidden rounded-xl border border-gray-200 bg-white shadow-xl dark:border-neutral-800 dark:bg-neutral-900", children: /* @__PURE__ */ jsxRuntime.jsx(Menu, { items }) }) })
|
|
21589
21769
|
] });
|
|
21590
21770
|
}
|
|
21591
21771
|
var CommentMenu_default = CommentMenu;
|
|
@@ -21658,11 +21838,11 @@ function CommentItem({
|
|
|
21658
21838
|
onDelete,
|
|
21659
21839
|
onReport
|
|
21660
21840
|
}) {
|
|
21661
|
-
const [collapsed, setCollapsed] =
|
|
21662
|
-
const [isReplying, setIsReplying] =
|
|
21663
|
-
const [menuOpen, setMenuOpen] =
|
|
21664
|
-
const [loadingReplies, setLoadingReplies] =
|
|
21665
|
-
const [repliesLoaded, setRepliesLoaded] =
|
|
21841
|
+
const [collapsed, setCollapsed] = React2.useState(true);
|
|
21842
|
+
const [isReplying, setIsReplying] = React2.useState(false);
|
|
21843
|
+
const [menuOpen, setMenuOpen] = React2.useState(false);
|
|
21844
|
+
const [loadingReplies, setLoadingReplies] = React2.useState(false);
|
|
21845
|
+
const [repliesLoaded, setRepliesLoaded] = React2.useState(false);
|
|
21666
21846
|
const resolvedDepth = Math.min(depth, config.maxDepth);
|
|
21667
21847
|
const {
|
|
21668
21848
|
Header: HeaderComponent = CommentHeader_default,
|
|
@@ -21826,18 +22006,18 @@ function CommentThread({
|
|
|
21826
22006
|
onDelete,
|
|
21827
22007
|
onReport
|
|
21828
22008
|
}) {
|
|
21829
|
-
const [comments, setComments] =
|
|
21830
|
-
const [isLoadingComments, setIsLoadingComments] =
|
|
21831
|
-
const [replyCache, setReplyCache] =
|
|
22009
|
+
const [comments, setComments] = React2.useState([]);
|
|
22010
|
+
const [isLoadingComments, setIsLoadingComments] = React2.useState(true);
|
|
22011
|
+
const [replyCache, setReplyCache] = React2.useState(
|
|
21832
22012
|
{}
|
|
21833
22013
|
);
|
|
21834
|
-
const replyCacheRef =
|
|
22014
|
+
const replyCacheRef = React2.useRef(replyCache);
|
|
21835
22015
|
const ComposerComponent = components?.Composer ?? CommentComposer_default;
|
|
21836
22016
|
const resolvedConfig = {
|
|
21837
22017
|
...DEFAULT_COMMENT_THREAD_CONFIG,
|
|
21838
22018
|
...config
|
|
21839
22019
|
};
|
|
21840
|
-
|
|
22020
|
+
React2.useEffect(() => {
|
|
21841
22021
|
async function loadComments() {
|
|
21842
22022
|
try {
|
|
21843
22023
|
const result = await dataSource.getComments({
|
|
@@ -21851,10 +22031,10 @@ function CommentThread({
|
|
|
21851
22031
|
}
|
|
21852
22032
|
void loadComments();
|
|
21853
22033
|
}, [dataSource, resolvedConfig.commentsPerPage]);
|
|
21854
|
-
|
|
22034
|
+
React2.useEffect(() => {
|
|
21855
22035
|
replyCacheRef.current = replyCache;
|
|
21856
22036
|
}, [replyCache]);
|
|
21857
|
-
|
|
22037
|
+
React2.useEffect(() => {
|
|
21858
22038
|
let cancelled = false;
|
|
21859
22039
|
async function refreshLoadedReplies() {
|
|
21860
22040
|
const parentIds = Object.keys(replyCacheRef.current);
|
|
@@ -21890,13 +22070,13 @@ function CommentThread({
|
|
|
21890
22070
|
cancelled = true;
|
|
21891
22071
|
};
|
|
21892
22072
|
}, [dataSource, resolvedConfig.repliesPerPage]);
|
|
21893
|
-
|
|
22073
|
+
React2.useEffect(() => {
|
|
21894
22074
|
if (!updatedComment) {
|
|
21895
22075
|
return;
|
|
21896
22076
|
}
|
|
21897
22077
|
updateCommentEverywhere(updatedComment.id, () => updatedComment);
|
|
21898
22078
|
}, [updatedComment]);
|
|
21899
|
-
|
|
22079
|
+
React2.useEffect(() => {
|
|
21900
22080
|
if (!deletedComment) {
|
|
21901
22081
|
return;
|
|
21902
22082
|
}
|
|
@@ -22110,13 +22290,13 @@ function SliderItem({
|
|
|
22110
22290
|
}
|
|
22111
22291
|
var SliderItem_default = SliderItem;
|
|
22112
22292
|
function Slider({ isLoading, isSuccess, coverArt, screenshots }) {
|
|
22113
|
-
const [images, setImages] =
|
|
22293
|
+
const [images, setImages] = React2.useState([
|
|
22114
22294
|
{
|
|
22115
22295
|
img: coverArt,
|
|
22116
22296
|
selected: true
|
|
22117
22297
|
}
|
|
22118
22298
|
]);
|
|
22119
|
-
|
|
22299
|
+
React2.useEffect(() => {
|
|
22120
22300
|
setImages([
|
|
22121
22301
|
{
|
|
22122
22302
|
img: coverArt,
|
|
@@ -22124,7 +22304,7 @@ function Slider({ isLoading, isSuccess, coverArt, screenshots }) {
|
|
|
22124
22304
|
}
|
|
22125
22305
|
]);
|
|
22126
22306
|
}, [isSuccess]);
|
|
22127
|
-
|
|
22307
|
+
React2.useEffect(() => {
|
|
22128
22308
|
if (screenshots) {
|
|
22129
22309
|
const selectableScreenshots = [];
|
|
22130
22310
|
screenshots.forEach((item) => {
|
|
@@ -22136,8 +22316,8 @@ function Slider({ isLoading, isSuccess, coverArt, screenshots }) {
|
|
|
22136
22316
|
setImages((prev) => [...prev, ...selectableScreenshots]);
|
|
22137
22317
|
}
|
|
22138
22318
|
}, [isSuccess]);
|
|
22139
|
-
const [displayImg, setDisplayImg] =
|
|
22140
|
-
|
|
22319
|
+
const [displayImg, setDisplayImg] = React2.useState(coverArt);
|
|
22320
|
+
React2.useEffect(() => {
|
|
22141
22321
|
setDisplayImg(coverArt);
|
|
22142
22322
|
}, [coverArt]);
|
|
22143
22323
|
const displayImageHandler = (itemIndex, img) => {
|
|
@@ -22249,7 +22429,7 @@ function WorldMapCountryTable({
|
|
|
22249
22429
|
title = "Country Breakdown",
|
|
22250
22430
|
data
|
|
22251
22431
|
}) {
|
|
22252
|
-
const enrichedData =
|
|
22432
|
+
const enrichedData = React2.useMemo(() => {
|
|
22253
22433
|
const mapped = data.map((item) => {
|
|
22254
22434
|
const countryMeta = COUNTRIES.find((c) => c.code === item.code);
|
|
22255
22435
|
return {
|
|
@@ -22262,11 +22442,11 @@ function WorldMapCountryTable({
|
|
|
22262
22442
|
});
|
|
22263
22443
|
return mapped.sort((a, b) => b.value - a.value);
|
|
22264
22444
|
}, [data]);
|
|
22265
|
-
const total =
|
|
22445
|
+
const total = React2.useMemo(
|
|
22266
22446
|
() => enrichedData.reduce((sum, i) => sum + i.value, 0),
|
|
22267
22447
|
[enrichedData]
|
|
22268
22448
|
);
|
|
22269
|
-
const finalData =
|
|
22449
|
+
const finalData = React2.useMemo(() => {
|
|
22270
22450
|
return enrichedData.map((item) => ({
|
|
22271
22451
|
...item,
|
|
22272
22452
|
percent: total > 0 ? item.value / total * 100 : 0
|
|
@@ -22511,7 +22691,7 @@ var TNDropdownGroup = ({
|
|
|
22511
22691
|
navigate,
|
|
22512
22692
|
className
|
|
22513
22693
|
}) => {
|
|
22514
|
-
const [open, setOpen] =
|
|
22694
|
+
const [open, setOpen] = React2.useState(true);
|
|
22515
22695
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
22516
22696
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
22517
22697
|
"div",
|
|
@@ -22600,8 +22780,8 @@ var TNGroup = ({
|
|
|
22600
22780
|
components,
|
|
22601
22781
|
selected
|
|
22602
22782
|
}) => {
|
|
22603
|
-
const [open, setOpen] =
|
|
22604
|
-
const timeoutRef =
|
|
22783
|
+
const [open, setOpen] = React2.useState(false);
|
|
22784
|
+
const timeoutRef = React2.useRef(null);
|
|
22605
22785
|
const handleEnter = () => {
|
|
22606
22786
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
22607
22787
|
setOpen(true);
|
|
@@ -22738,7 +22918,7 @@ function SidebarLayout({
|
|
|
22738
22918
|
header = /* @__PURE__ */ jsxRuntime.jsx(Header, {}),
|
|
22739
22919
|
footer = /* @__PURE__ */ jsxRuntime.jsx(Footer, {})
|
|
22740
22920
|
}) {
|
|
22741
|
-
const [showSidebar, setShowSidebar] =
|
|
22921
|
+
const [showSidebar, setShowSidebar] = React2.useState(true);
|
|
22742
22922
|
return /* @__PURE__ */ jsxRuntime.jsx(GenericLayout_default, { children: /* @__PURE__ */ jsxRuntime.jsx(Layout, { children: /* @__PURE__ */ jsxRuntime.jsx(Layout, { flexDirection: "horizontal", children: /* @__PURE__ */ jsxRuntime.jsxs(Content, { sidebarVisible: showSidebar, styles: "theme-bg-md pt-[60px]", children: [
|
|
22743
22923
|
/* @__PURE__ */ jsxRuntime.jsx(ContentArea_default, { children }),
|
|
22744
22924
|
footer
|
|
@@ -22792,7 +22972,7 @@ function ScrollToTop({
|
|
|
22792
22972
|
behavior = "smooth",
|
|
22793
22973
|
target
|
|
22794
22974
|
}) {
|
|
22795
|
-
|
|
22975
|
+
React2.useEffect(() => {
|
|
22796
22976
|
if (target) {
|
|
22797
22977
|
target.scrollTo({
|
|
22798
22978
|
top: 0,
|
|
@@ -22987,9 +23167,14 @@ exports.TitleBanner = TitleBanner;
|
|
|
22987
23167
|
exports.Toast = Toast;
|
|
22988
23168
|
exports.Tooltip = Tooltip6;
|
|
22989
23169
|
exports.TopNav = TopNav;
|
|
22990
|
-
exports.Transition =
|
|
23170
|
+
exports.Transition = Transition;
|
|
23171
|
+
exports.TransitionAccordion = TransitionAccordion_default;
|
|
23172
|
+
exports.TransitionBase = TransitionBase_default;
|
|
22991
23173
|
exports.TransitionDropdown = TransitionDropdown_default;
|
|
23174
|
+
exports.TransitionFade = TransitionFade_default;
|
|
22992
23175
|
exports.TransitionFadeIn = TransitionFadeIn_default;
|
|
23176
|
+
exports.TransitionScale = TransitionScale_default;
|
|
23177
|
+
exports.TransitionSlide = TransitionSlide_default;
|
|
22993
23178
|
exports.Typography = Typography;
|
|
22994
23179
|
exports.UnderConstructionBanner = UnderConstructionBanner;
|
|
22995
23180
|
exports.ValueBadge = ValueBadge_default;
|