elseware-ui 2.36.1 → 2.36.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +351 -132
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +64 -12
- package/dist/index.d.ts +64 -12
- package/dist/index.js +576 -418
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +399 -246
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -4
package/dist/index.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
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
|
|
10
|
-
var classNames16 = require('classnames');
|
|
9
|
+
var classNames17 = require('classnames');
|
|
11
10
|
var fa6 = require('react-icons/fa6');
|
|
12
11
|
var ReactWorldFlags = require('react-world-flags');
|
|
13
12
|
var emojiFlags = require('emoji-flags');
|
|
@@ -43,8 +42,8 @@ function _interopNamespace(e) {
|
|
|
43
42
|
return Object.freeze(n);
|
|
44
43
|
}
|
|
45
44
|
|
|
46
|
-
var
|
|
47
|
-
var
|
|
45
|
+
var React2__default = /*#__PURE__*/_interopDefault(React2);
|
|
46
|
+
var classNames17__default = /*#__PURE__*/_interopDefault(classNames17);
|
|
48
47
|
var ReactWorldFlags__default = /*#__PURE__*/_interopDefault(ReactWorldFlags);
|
|
49
48
|
var emojiFlags__default = /*#__PURE__*/_interopDefault(emojiFlags);
|
|
50
49
|
var d3__namespace = /*#__PURE__*/_interopNamespace(d3);
|
|
@@ -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:
|
|
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:
|
|
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: React4.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;
|
|
@@ -3847,7 +4074,7 @@ function CardHeader({ icon, title, description, className }) {
|
|
|
3847
4074
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3848
4075
|
"div",
|
|
3849
4076
|
{
|
|
3850
|
-
className:
|
|
4077
|
+
className: classNames17__default.default(
|
|
3851
4078
|
"flex items-start gap-4 p-6 border-b border-white/10",
|
|
3852
4079
|
className
|
|
3853
4080
|
),
|
|
@@ -3863,14 +4090,14 @@ function CardHeader({ icon, title, description, className }) {
|
|
|
3863
4090
|
}
|
|
3864
4091
|
var CardHeader_default = CardHeader;
|
|
3865
4092
|
function CardContent({ children, className }) {
|
|
3866
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
4093
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames17__default.default("p-6 text-gray-300 text-sm", className), children });
|
|
3867
4094
|
}
|
|
3868
4095
|
var CardContent_default = CardContent;
|
|
3869
4096
|
function CardFooter({ children, className }) {
|
|
3870
4097
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3871
4098
|
"div",
|
|
3872
4099
|
{
|
|
3873
|
-
className:
|
|
4100
|
+
className: classNames17__default.default(
|
|
3874
4101
|
"flex items-center gap-3 p-5 border-t border-white/10 text-sm text-gray-400",
|
|
3875
4102
|
className
|
|
3876
4103
|
),
|
|
@@ -3912,7 +4139,7 @@ function GradientAnimation({
|
|
|
3912
4139
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3913
4140
|
"div",
|
|
3914
4141
|
{
|
|
3915
|
-
className:
|
|
4142
|
+
className: classNames17__default.default("absolute inset-0"),
|
|
3916
4143
|
style: {
|
|
3917
4144
|
background: `linear-gradient(${cfg.angle}deg, ${cfg.colors?.join(",")})`,
|
|
3918
4145
|
backgroundSize: cfg.backgroundSize,
|
|
@@ -4058,7 +4285,7 @@ function MotionSurface({
|
|
|
4058
4285
|
}) {
|
|
4059
4286
|
const AnimationComponent = animationVariant === "custom" ? CustomAnimation : animationRegistry[animationVariant];
|
|
4060
4287
|
const OverlayComponent = overlay === "custom" ? CustomOverlay : overlayRegistry[overlay];
|
|
4061
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
4288
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classNames17__default.default("relative overflow-hidden", className), children: [
|
|
4062
4289
|
AnimationComponent && /* @__PURE__ */ jsxRuntime.jsx(AnimationComponent, { config: animationConfig, animated }),
|
|
4063
4290
|
OverlayComponent && /* @__PURE__ */ jsxRuntime.jsx(OverlayComponent, { config: overlayConfig }),
|
|
4064
4291
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative z-10", children })
|
|
@@ -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
|
|
@@ -5462,7 +5689,7 @@ var Backdrop = ({ children, styles }) => {
|
|
|
5462
5689
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5463
5690
|
"div",
|
|
5464
5691
|
{
|
|
5465
|
-
className:
|
|
5692
|
+
className: classNames17__default.default({
|
|
5466
5693
|
"bg-black/75 top-0 bottom-0 left-0 right-0 z-50 fixed inset-0 flex items-center justify-center overflow-hidden": true,
|
|
5467
5694
|
[`${styles}`]: styles
|
|
5468
5695
|
}),
|
|
@@ -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;
|
|
@@ -5986,7 +6213,7 @@ var Form = ({
|
|
|
5986
6213
|
/* @__PURE__ */ jsxRuntime.jsx(UnsavedChangesGuard_default, { formik: formik$1, enabled: warnOnUnsavedChanges }),
|
|
5987
6214
|
/* @__PURE__ */ jsxRuntime.jsx(DirtyObserver_default, { formik: formik$1, onDirtyChange }),
|
|
5988
6215
|
/* @__PURE__ */ jsxRuntime.jsx(FormObserver_default, { formik: formik$1, onChange }),
|
|
5989
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
6216
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames17__default.default(styles), children })
|
|
5990
6217
|
] })
|
|
5991
6218
|
}
|
|
5992
6219
|
);
|
|
@@ -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,46 +6713,6 @@ function sendToast(data = {}) {
|
|
|
6486
6713
|
status: data.status || "success" /* success */
|
|
6487
6714
|
});
|
|
6488
6715
|
}
|
|
6489
|
-
function TransitionDropdown({ visibility, children }) {
|
|
6490
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6491
|
-
react.Transition,
|
|
6492
|
-
{
|
|
6493
|
-
as: React4.Fragment,
|
|
6494
|
-
show: visibility,
|
|
6495
|
-
enter: "transition duration-100 ease-out",
|
|
6496
|
-
enterFrom: "transform scale-95 opacity-0",
|
|
6497
|
-
enterTo: "transform scale-100 opacity-100",
|
|
6498
|
-
leave: "transition duration-50 ease-out",
|
|
6499
|
-
leaveFrom: "transform scale-100 opacity-100",
|
|
6500
|
-
leaveTo: "transform scale-95 opacity-0",
|
|
6501
|
-
children
|
|
6502
|
-
}
|
|
6503
|
-
);
|
|
6504
|
-
}
|
|
6505
|
-
var TransitionDropdown_default = TransitionDropdown;
|
|
6506
|
-
function TransitionFadeIn({ visibility, children }) {
|
|
6507
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6508
|
-
react.Transition,
|
|
6509
|
-
{
|
|
6510
|
-
as: React4.Fragment,
|
|
6511
|
-
show: visibility,
|
|
6512
|
-
enter: `transition-all ease-in-out duration-700 dalay-[0ms]`,
|
|
6513
|
-
enterFrom: "opacity-0 translate-y-6",
|
|
6514
|
-
enterTo: "opacity-100 translate-y-0",
|
|
6515
|
-
leave: "transition-all ease-in-out duration-300",
|
|
6516
|
-
leaveFrom: "opacity-100",
|
|
6517
|
-
leaveTo: "opacity-0",
|
|
6518
|
-
children
|
|
6519
|
-
}
|
|
6520
|
-
);
|
|
6521
|
-
}
|
|
6522
|
-
var TransitionFadeIn_default = TransitionFadeIn;
|
|
6523
|
-
|
|
6524
|
-
// src/components/feedback/transition/index.tsx
|
|
6525
|
-
var Transition4 = {
|
|
6526
|
-
TransitionDropdown: TransitionDropdown_default,
|
|
6527
|
-
TransitionFadeIn: TransitionFadeIn_default
|
|
6528
|
-
};
|
|
6529
6716
|
var sizes3 = {
|
|
6530
6717
|
xs: "px-2 py-1 text-xs",
|
|
6531
6718
|
sm: "px-3 py-2 text-sm",
|
|
@@ -6540,10 +6727,10 @@ function FormResponse({
|
|
|
6540
6727
|
size = "md",
|
|
6541
6728
|
styles
|
|
6542
6729
|
}) {
|
|
6543
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6730
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Transition.TransitionDropdown, { visibility: text ? true : false, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6544
6731
|
"div",
|
|
6545
6732
|
{
|
|
6546
|
-
className:
|
|
6733
|
+
className: classNames17__default.default({
|
|
6547
6734
|
"font-poppins font-light text-sm": true,
|
|
6548
6735
|
[`${variantsLite[variant]}`]: variant,
|
|
6549
6736
|
[`${shapes[shape]}`]: shape,
|
|
@@ -6610,17 +6797,17 @@ function YoutubeVideo({
|
|
|
6610
6797
|
) });
|
|
6611
6798
|
}
|
|
6612
6799
|
var YoutubeVideo_default = YoutubeVideo;
|
|
6613
|
-
var ThemeContext =
|
|
6800
|
+
var ThemeContext = React2.createContext(
|
|
6614
6801
|
void 0
|
|
6615
6802
|
);
|
|
6616
6803
|
var ThemeProvider = ({
|
|
6617
6804
|
defaultTheme = "dark",
|
|
6618
6805
|
children
|
|
6619
6806
|
}) => {
|
|
6620
|
-
const [theme, setTheme] =
|
|
6807
|
+
const [theme, setTheme] = React2.useState(() => {
|
|
6621
6808
|
return localStorage.getItem("theme") || defaultTheme;
|
|
6622
6809
|
});
|
|
6623
|
-
|
|
6810
|
+
React2.useEffect(() => {
|
|
6624
6811
|
if (theme === "dark") {
|
|
6625
6812
|
document.documentElement.classList.add("dark");
|
|
6626
6813
|
} else {
|
|
@@ -6634,7 +6821,7 @@ var ThemeProvider = ({
|
|
|
6634
6821
|
return /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value: { theme, setTheme, toggleTheme }, children });
|
|
6635
6822
|
};
|
|
6636
6823
|
var ThemeSwitch = () => {
|
|
6637
|
-
const themeContext =
|
|
6824
|
+
const themeContext = React2.useContext(ThemeContext);
|
|
6638
6825
|
if (!themeContext) return null;
|
|
6639
6826
|
const { theme, toggleTheme } = themeContext;
|
|
6640
6827
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -6660,7 +6847,7 @@ var ThemeSwitch = () => {
|
|
|
6660
6847
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6661
6848
|
"div",
|
|
6662
6849
|
{
|
|
6663
|
-
className:
|
|
6850
|
+
className: classNames17__default.default(
|
|
6664
6851
|
"w-6 h-6 bg-white dark:bg-gray-600 rounded-full shadow-md transition-transform duration-300",
|
|
6665
6852
|
theme === "dark" ? "translate-x-8" : "translate-x-0"
|
|
6666
6853
|
)
|
|
@@ -6696,7 +6883,7 @@ var ShapeSwitch = () => {
|
|
|
6696
6883
|
|
|
6697
6884
|
// src/hooks/theme/useCurrentTheme.ts
|
|
6698
6885
|
var useCurrentTheme = () => {
|
|
6699
|
-
const context =
|
|
6886
|
+
const context = React2.useContext(ThemeContext);
|
|
6700
6887
|
if (!context) {
|
|
6701
6888
|
throw new Error("useCurrentTheme must be used within a ThemeProvider");
|
|
6702
6889
|
}
|
|
@@ -18039,7 +18226,7 @@ function WorldMap({
|
|
|
18039
18226
|
}
|
|
18040
18227
|
};
|
|
18041
18228
|
const mode = isDarkMode ? mapStyles.dark : mapStyles.light;
|
|
18042
|
-
const resolvedData =
|
|
18229
|
+
const resolvedData = React2.useMemo(() => {
|
|
18043
18230
|
return data.map((item) => {
|
|
18044
18231
|
const c = COUNTRIES.find((x) => x.code === item.code);
|
|
18045
18232
|
if (!c) return null;
|
|
@@ -18051,8 +18238,8 @@ function WorldMap({
|
|
|
18051
18238
|
}).filter(Boolean);
|
|
18052
18239
|
}, [data]);
|
|
18053
18240
|
const maxValue = resolvedData.length > 0 ? Math.max(...resolvedData.map((d) => d.value)) : 0;
|
|
18054
|
-
const [showTooltip, setShowTooltip] =
|
|
18055
|
-
const [tooltipContent, setTooltipContent] =
|
|
18241
|
+
const [showTooltip, setShowTooltip] = React2.useState(false);
|
|
18242
|
+
const [tooltipContent, setTooltipContent] = React2.useState(null);
|
|
18056
18243
|
const handleMouseMove = (_e, point) => {
|
|
18057
18244
|
setTooltipContent(
|
|
18058
18245
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
@@ -18138,7 +18325,7 @@ function Button({
|
|
|
18138
18325
|
}) {
|
|
18139
18326
|
const eui = useEUIConfig();
|
|
18140
18327
|
const resolvedShape = shape ?? eui?.config?.global?.shape ?? "square";
|
|
18141
|
-
const btnRef =
|
|
18328
|
+
const btnRef = React2.useRef(null);
|
|
18142
18329
|
const variantStyles = resolveAppearanceStyles({
|
|
18143
18330
|
appearance,
|
|
18144
18331
|
variant,
|
|
@@ -18201,14 +18388,14 @@ function Button({
|
|
|
18201
18388
|
var Button_default = Button;
|
|
18202
18389
|
function InputResponse({
|
|
18203
18390
|
name,
|
|
18204
|
-
visibility,
|
|
18391
|
+
visibility = false,
|
|
18205
18392
|
variant = "default",
|
|
18206
18393
|
styles
|
|
18207
18394
|
}) {
|
|
18208
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18395
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Transition.TransitionDropdown, { visibility, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18209
18396
|
"div",
|
|
18210
18397
|
{
|
|
18211
|
-
className:
|
|
18398
|
+
className: classNames17__default.default({
|
|
18212
18399
|
"font-medium text-sm py-1 px-2": true,
|
|
18213
18400
|
[`${textVariants[variant]}`]: variant,
|
|
18214
18401
|
"transition-all ease-in-out": true,
|
|
@@ -18223,7 +18410,7 @@ function InputLabel({ text, children, styles }) {
|
|
|
18223
18410
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18224
18411
|
"label",
|
|
18225
18412
|
{
|
|
18226
|
-
className:
|
|
18413
|
+
className: classNames17__default.default({
|
|
18227
18414
|
"px-0 eui-text-sm text-[13.5px] pointer-events-none select-none": true,
|
|
18228
18415
|
"transition-all ease-in-out": true,
|
|
18229
18416
|
[`${styles}`]: styles
|
|
@@ -18239,7 +18426,7 @@ var toggleType = (visibility) => {
|
|
|
18239
18426
|
var PasswordVisibilityToggler = ({
|
|
18240
18427
|
onClick
|
|
18241
18428
|
}) => {
|
|
18242
|
-
const [passwordVisibility, setPasswordVisibilty] =
|
|
18429
|
+
const [passwordVisibility, setPasswordVisibilty] = React2.useState(false);
|
|
18243
18430
|
const handleOnClick = (visibility) => {
|
|
18244
18431
|
onClick(visibility);
|
|
18245
18432
|
setPasswordVisibilty(visibility);
|
|
@@ -18264,7 +18451,7 @@ var Input = ({
|
|
|
18264
18451
|
const eui = useEUIConfig();
|
|
18265
18452
|
const resolvedShape = shape ?? eui?.config?.global?.shape ?? "square";
|
|
18266
18453
|
const [field, meta] = formik.useField(props);
|
|
18267
|
-
const [passwordVisibility, setPasswordVisibilty] =
|
|
18454
|
+
const [passwordVisibility, setPasswordVisibilty] = React2.useState(false);
|
|
18268
18455
|
const inputType = type === "password" ? toggleType(passwordVisibility) : type;
|
|
18269
18456
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full", children: [
|
|
18270
18457
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -18275,7 +18462,7 @@ var Input = ({
|
|
|
18275
18462
|
...field,
|
|
18276
18463
|
...props,
|
|
18277
18464
|
placeholder,
|
|
18278
|
-
className:
|
|
18465
|
+
className: classNames17__default.default({
|
|
18279
18466
|
"border peer w-full bg-eui-primary-300/10 pt-5 px-3 pb-2 text-md eui-text-md placeholder-transparent placeholder-shown:p-3 focus:outline-none h-[50px]": true,
|
|
18280
18467
|
"border-eui-primary-400 focus:border-eui-secondary-500": !(meta.touched && meta.error),
|
|
18281
18468
|
"border-eui-danger-500": meta.touched && meta.error,
|
|
@@ -18309,7 +18496,7 @@ var InputFile = ({
|
|
|
18309
18496
|
styles,
|
|
18310
18497
|
...props
|
|
18311
18498
|
}) => {
|
|
18312
|
-
const fileInputRef =
|
|
18499
|
+
const fileInputRef = React2.useRef(null);
|
|
18313
18500
|
const [field, meta, helpers] = formik.useField(props);
|
|
18314
18501
|
const handleFileChange = (e) => {
|
|
18315
18502
|
const file = e.target.files?.[0] || null;
|
|
@@ -18320,7 +18507,7 @@ var InputFile = ({
|
|
|
18320
18507
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18321
18508
|
"div",
|
|
18322
18509
|
{
|
|
18323
|
-
className:
|
|
18510
|
+
className: classNames17__default.default(
|
|
18324
18511
|
"border rounded-sm bg-eui-primary-300/10 px-3 pt-3 text-md text-eui-dark-100 cursor-pointer h-[50px] flex items-center",
|
|
18325
18512
|
{
|
|
18326
18513
|
"border-eui-primary-400 focus:border-eui-secondary-500": !(meta.touched && meta.error),
|
|
@@ -18346,7 +18533,7 @@ var InputFile = ({
|
|
|
18346
18533
|
InputLabel_default,
|
|
18347
18534
|
{
|
|
18348
18535
|
text: placeholder,
|
|
18349
|
-
styles:
|
|
18536
|
+
styles: classNames17__default.default({
|
|
18350
18537
|
"absolute left-2 eui-text-sm peer-placeholder-shown:text-base peer-placeholder-shown:top-3 pointer-events-none": true,
|
|
18351
18538
|
"top-[0.7px]": showFloatingLabel,
|
|
18352
18539
|
"top-[13px] text-base": !showFloatingLabel
|
|
@@ -18399,7 +18586,7 @@ var InputList = ({ name, placeholder, shape }) => {
|
|
|
18399
18586
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsxRuntime.jsx(formik.FieldArray, { name, children: ({ push, remove, move }) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
18400
18587
|
"div",
|
|
18401
18588
|
{
|
|
18402
|
-
className:
|
|
18589
|
+
className: classNames17__default.default(
|
|
18403
18590
|
"flex w-full flex-col space-y-2 bg-eui-primary-300/10",
|
|
18404
18591
|
shapes[resolvedShape]
|
|
18405
18592
|
),
|
|
@@ -18428,7 +18615,7 @@ var InputList = ({ name, placeholder, shape }) => {
|
|
|
18428
18615
|
ref: provided2.innerRef,
|
|
18429
18616
|
...draggableProps,
|
|
18430
18617
|
style: draggableStyle,
|
|
18431
|
-
className:
|
|
18618
|
+
className: classNames17__default.default(
|
|
18432
18619
|
"flex items-center space-x-2 bg-eui-primary-300/10 p-2",
|
|
18433
18620
|
shapes[resolvedShape]
|
|
18434
18621
|
),
|
|
@@ -18439,7 +18626,7 @@ var InputList = ({ name, placeholder, shape }) => {
|
|
|
18439
18626
|
{
|
|
18440
18627
|
name: `${name}[${index}]`,
|
|
18441
18628
|
placeholder: `Item ${index + 1}`,
|
|
18442
|
-
className:
|
|
18629
|
+
className: classNames17__default.default(
|
|
18443
18630
|
"peer h-[50px] w-full border bg-eui-primary-300/10 px-3 pb-2 pt-5 text-md placeholder-transparent placeholder-shown:p-3 focus:outline-none eui-text-md",
|
|
18444
18631
|
shapes[resolvedShape],
|
|
18445
18632
|
hasItemError ? "border-eui-danger-500" : "border-eui-primary-400 focus:border-eui-secondary-500"
|
|
@@ -18535,7 +18722,7 @@ var InputListGroup = ({
|
|
|
18535
18722
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
18536
18723
|
"div",
|
|
18537
18724
|
{
|
|
18538
|
-
className:
|
|
18725
|
+
className: classNames17__default.default(
|
|
18539
18726
|
"flex flex-col gap-2 bg-eui-primary-300/10 p-3",
|
|
18540
18727
|
shapes[resolvedShape]
|
|
18541
18728
|
),
|
|
@@ -18547,7 +18734,7 @@ var InputListGroup = ({
|
|
|
18547
18734
|
{
|
|
18548
18735
|
name: `${name}[${groupIndex}].name`,
|
|
18549
18736
|
placeholder: `Group ${groupIndex + 1}`,
|
|
18550
|
-
className:
|
|
18737
|
+
className: classNames17__default.default(
|
|
18551
18738
|
"h-[40px] w-full border bg-eui-primary-300/10 px-3 py-2 text-md focus:outline-none",
|
|
18552
18739
|
shapes[resolvedShape],
|
|
18553
18740
|
"border-eui-primary-400 focus:border-eui-secondary-500"
|
|
@@ -18578,7 +18765,7 @@ var InputListGroup = ({
|
|
|
18578
18765
|
{
|
|
18579
18766
|
ref: provided.innerRef,
|
|
18580
18767
|
...provided.droppableProps,
|
|
18581
|
-
className:
|
|
18768
|
+
className: classNames17__default.default(
|
|
18582
18769
|
"space-y-2 bg-eui-primary-300/10 p-2",
|
|
18583
18770
|
shapes[resolvedShape]
|
|
18584
18771
|
),
|
|
@@ -18598,7 +18785,7 @@ var InputListGroup = ({
|
|
|
18598
18785
|
ref: provided2.innerRef,
|
|
18599
18786
|
...draggableProps,
|
|
18600
18787
|
style: draggableStyle,
|
|
18601
|
-
className:
|
|
18788
|
+
className: classNames17__default.default(
|
|
18602
18789
|
"flex items-center gap-2 bg-eui-primary-300/10 p-2",
|
|
18603
18790
|
shapes[resolvedShape]
|
|
18604
18791
|
),
|
|
@@ -18609,7 +18796,7 @@ var InputListGroup = ({
|
|
|
18609
18796
|
{
|
|
18610
18797
|
name: `${itemsFieldName}[${itemIndex}]`,
|
|
18611
18798
|
placeholder: `Item ${itemIndex + 1}`,
|
|
18612
|
-
className:
|
|
18799
|
+
className: classNames17__default.default(
|
|
18613
18800
|
"h-[40px] w-full border bg-eui-primary-300/10 px-3 py-2 text-md focus:outline-none",
|
|
18614
18801
|
shapes[resolvedShape],
|
|
18615
18802
|
"border-eui-primary-400 focus:border-eui-secondary-500"
|
|
@@ -18823,7 +19010,7 @@ var DateSelector = ({
|
|
|
18823
19010
|
...field,
|
|
18824
19011
|
...props,
|
|
18825
19012
|
placeholder,
|
|
18826
|
-
className:
|
|
19013
|
+
className: classNames17__default.default({
|
|
18827
19014
|
"border border-eui-primary-400 peer w-full bg-eui-primary-300/10 pt-5 px-3 pb-2 text-md eui-text-md placeholder-transparent placeholder-shown:p-3 focus:border-eui-secondary-500 focus:outline-none h-[50px]": true,
|
|
18828
19015
|
"border-eui-danger-500": meta.touched && meta.error,
|
|
18829
19016
|
"transition-all ease-in-out": true,
|
|
@@ -18849,7 +19036,7 @@ function ImageView({ imageUrl, secure = true, alt = "image" }) {
|
|
|
18849
19036
|
) }) });
|
|
18850
19037
|
}
|
|
18851
19038
|
var ImageView_default = ImageView;
|
|
18852
|
-
var ImageInput =
|
|
19039
|
+
var ImageInput = React2.forwardRef(
|
|
18853
19040
|
({
|
|
18854
19041
|
title = "Upload Image",
|
|
18855
19042
|
uploadDir = "eg-frontend-admin-temp",
|
|
@@ -18861,10 +19048,10 @@ var ImageInput = React4.forwardRef(
|
|
|
18861
19048
|
const [field, meta, helpers] = formik.useField(props);
|
|
18862
19049
|
const { value: imageUrl } = field;
|
|
18863
19050
|
const { setValue } = helpers;
|
|
18864
|
-
const [image, setImage] =
|
|
18865
|
-
const [url, setUrl] =
|
|
18866
|
-
const [loading, setLoading] =
|
|
18867
|
-
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);
|
|
18868
19055
|
const uploadImage = async () => {
|
|
18869
19056
|
if (!image) return;
|
|
18870
19057
|
setLoading(true);
|
|
@@ -18910,10 +19097,10 @@ var ImageInput = React4.forwardRef(
|
|
|
18910
19097
|
if (!disableSetValue) setValue("");
|
|
18911
19098
|
setLoading(false);
|
|
18912
19099
|
};
|
|
18913
|
-
|
|
19100
|
+
React2.useImperativeHandle(ref, () => ({
|
|
18914
19101
|
handleResetClick
|
|
18915
19102
|
}));
|
|
18916
|
-
|
|
19103
|
+
React2.useEffect(() => {
|
|
18917
19104
|
if (!disableSetValue) setValue(url);
|
|
18918
19105
|
}, [url, setValue, disableSetValue]);
|
|
18919
19106
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full", children: [
|
|
@@ -18932,7 +19119,7 @@ var ImageInput = React4.forwardRef(
|
|
|
18932
19119
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
18933
19120
|
"label",
|
|
18934
19121
|
{
|
|
18935
|
-
className:
|
|
19122
|
+
className: classNames17__default.default({
|
|
18936
19123
|
"border-2 border-dashed border-gray-700 bg-gray-900 h-[200px] w-[300px] flex flex-col gap-2 items-center justify-center group": true,
|
|
18937
19124
|
"hover:cursor-pointer hover:border-solid hover:border-gray-600 hover:bg-gray-900/80": true,
|
|
18938
19125
|
"transition-all ease-in-out duration-150": true
|
|
@@ -18998,14 +19185,14 @@ function MultiImageInput({
|
|
|
18998
19185
|
const [field, meta, helpers] = formik.useField(props);
|
|
18999
19186
|
const { value: imageUrls } = field;
|
|
19000
19187
|
const { setValue } = helpers;
|
|
19001
|
-
const imageInputRef =
|
|
19188
|
+
const imageInputRef = React2.useRef(null);
|
|
19002
19189
|
const onValueChanged = (url) => {
|
|
19003
19190
|
setValue([...imageUrls, url]);
|
|
19004
19191
|
if (imageInputRef.current) {
|
|
19005
19192
|
imageInputRef.current.handleResetClick();
|
|
19006
19193
|
}
|
|
19007
19194
|
};
|
|
19008
|
-
|
|
19195
|
+
React2.useEffect(() => {
|
|
19009
19196
|
}, [imageUrls]);
|
|
19010
19197
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
19011
19198
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row flex-wrap gap-5 w-ful", children: [
|
|
@@ -19049,7 +19236,7 @@ function Radio({
|
|
|
19049
19236
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
19050
19237
|
"div",
|
|
19051
19238
|
{
|
|
19052
|
-
className:
|
|
19239
|
+
className: classNames17__default.default({
|
|
19053
19240
|
"flex flex-row gap-2 items-center mx-1 my-2": true
|
|
19054
19241
|
}),
|
|
19055
19242
|
children: [
|
|
@@ -19062,7 +19249,7 @@ function Radio({
|
|
|
19062
19249
|
...props,
|
|
19063
19250
|
value: option.value,
|
|
19064
19251
|
checked: field2.value === option.value,
|
|
19065
|
-
className:
|
|
19252
|
+
className: classNames17__default.default({
|
|
19066
19253
|
"appearance-none w-4 h-4 border-2 border-eui-primary-400 rounded-full cursor-pointer transition-all duration-300": true,
|
|
19067
19254
|
// base radio button styles
|
|
19068
19255
|
"checked:bg-eui-secondary-700 checked:border-eui-primary-400": field2.value === option.value
|
|
@@ -19074,7 +19261,7 @@ function Radio({
|
|
|
19074
19261
|
"label",
|
|
19075
19262
|
{
|
|
19076
19263
|
htmlFor: option.value,
|
|
19077
|
-
className:
|
|
19264
|
+
className: classNames17__default.default({
|
|
19078
19265
|
"eui-text-md text-sm": true
|
|
19079
19266
|
}),
|
|
19080
19267
|
children: option.label
|
|
@@ -19105,9 +19292,9 @@ function StarRatingInput({
|
|
|
19105
19292
|
const { name } = props;
|
|
19106
19293
|
const [field, meta] = formik.useField(props);
|
|
19107
19294
|
const formikContext = formik.useFormikContext();
|
|
19108
|
-
const [rating, setRating] =
|
|
19109
|
-
const [hover, setHover] =
|
|
19110
|
-
|
|
19295
|
+
const [rating, setRating] = React2.useState(Number(field.value) || 0);
|
|
19296
|
+
const [hover, setHover] = React2.useState(null);
|
|
19297
|
+
React2.useEffect(() => {
|
|
19111
19298
|
setRating(Number(field.value));
|
|
19112
19299
|
}, [field.value]);
|
|
19113
19300
|
const handleOnClick = (index) => {
|
|
@@ -19117,7 +19304,7 @@ function StarRatingInput({
|
|
|
19117
19304
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
19118
19305
|
"div",
|
|
19119
19306
|
{
|
|
19120
|
-
className:
|
|
19307
|
+
className: classNames17__default.default({
|
|
19121
19308
|
"inline-flex gap-[4px] text-[20px]": true,
|
|
19122
19309
|
[`${styles}`]: styles
|
|
19123
19310
|
}),
|
|
@@ -19130,7 +19317,7 @@ function StarRatingInput({
|
|
|
19130
19317
|
onClick: () => handleOnClick(index),
|
|
19131
19318
|
onMouseEnter: () => setHover(index),
|
|
19132
19319
|
onMouseLeave: () => setHover(null),
|
|
19133
|
-
className:
|
|
19320
|
+
className: classNames17__default.default({
|
|
19134
19321
|
"text-yellow-600": index <= (hover ?? rating - 1),
|
|
19135
19322
|
"text-gray-400": index > (hover ?? rating - 1)
|
|
19136
19323
|
}),
|
|
@@ -19174,7 +19361,7 @@ function Select({
|
|
|
19174
19361
|
{
|
|
19175
19362
|
as: "select",
|
|
19176
19363
|
...props,
|
|
19177
|
-
className:
|
|
19364
|
+
className: classNames17__default.default({
|
|
19178
19365
|
"border peer w-full bg-eui-primary-300/10 pt-5 px-3 pb-2 text-md eui-text-md placeholder-transparent placeholder-shown:p-3 focus:border-eui-secondary-500 focus:outline-none h-[50px]": true,
|
|
19179
19366
|
"border-eui-primary-400": !(meta.touched && meta.error),
|
|
19180
19367
|
"border-red-500": meta.touched && meta.error,
|
|
@@ -19226,7 +19413,7 @@ function Switch({
|
|
|
19226
19413
|
"div",
|
|
19227
19414
|
{
|
|
19228
19415
|
onClick: () => helpers.setValue(!field.value),
|
|
19229
|
-
className:
|
|
19416
|
+
className: classNames17__default.default(
|
|
19230
19417
|
"w-11 h-6 bg-gray-200 peer-focus:outline-none rounded-full peer dark:bg-eui-dark-100",
|
|
19231
19418
|
"peer-checked:after:translate-x-full peer-checked:after:border-white",
|
|
19232
19419
|
"after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white",
|
|
@@ -19256,7 +19443,7 @@ function Tags({
|
|
|
19256
19443
|
...props
|
|
19257
19444
|
}) {
|
|
19258
19445
|
const [field, meta, helpers] = formik.useField({ ...props });
|
|
19259
|
-
const [input, setInput] =
|
|
19446
|
+
const [input, setInput] = React2.useState("");
|
|
19260
19447
|
const handleAddTag = () => {
|
|
19261
19448
|
const trimmed = input.trim();
|
|
19262
19449
|
if (trimmed && !field.value.includes(trimmed) && field.value.length < limit) {
|
|
@@ -19283,7 +19470,7 @@ function Tags({
|
|
|
19283
19470
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
19284
19471
|
"div",
|
|
19285
19472
|
{
|
|
19286
|
-
className:
|
|
19473
|
+
className: classNames17__default.default(
|
|
19287
19474
|
"border rounded-sm flex flex-wrap items-center gap-2 px-2 pt-2 pb-6 min-h-[3rem]",
|
|
19288
19475
|
{
|
|
19289
19476
|
"bg-eui-primary-300/10 eui-text-md": true,
|
|
@@ -19331,7 +19518,7 @@ function Tags({
|
|
|
19331
19518
|
InputLabel_default,
|
|
19332
19519
|
{
|
|
19333
19520
|
text: placeholder,
|
|
19334
|
-
styles:
|
|
19521
|
+
styles: classNames17__default.default(
|
|
19335
19522
|
"absolute left-2 transition-all pointer-events-none text-eui-dark-200",
|
|
19336
19523
|
input.length > 0 || field.value.length > 0 ? "top-[2px] text-[13.5px]" : "top-3 text-base"
|
|
19337
19524
|
)
|
|
@@ -19372,7 +19559,7 @@ function TextArea({
|
|
|
19372
19559
|
as: "textarea",
|
|
19373
19560
|
...field,
|
|
19374
19561
|
...props,
|
|
19375
|
-
className:
|
|
19562
|
+
className: classNames17__default.default({
|
|
19376
19563
|
"border peer w-full bg-eui-primary-300/10 eui-text-md outline-none px-3 py-5 resize-none focus:resize-none focus:outline-none": true,
|
|
19377
19564
|
"transition-all ease-in-out": true,
|
|
19378
19565
|
"border-eui-primary-400 focus:border-eui-secondary-500": !(meta.touched && meta.error),
|
|
@@ -19386,7 +19573,7 @@ function TextArea({
|
|
|
19386
19573
|
InputLabel_default,
|
|
19387
19574
|
{
|
|
19388
19575
|
text: placeholder,
|
|
19389
|
-
styles:
|
|
19576
|
+
styles: classNames17__default.default(
|
|
19390
19577
|
"absolute left-2 transition-all pointer-events-none text-eui-dark-200",
|
|
19391
19578
|
field.value ? "top-[2px] text-[13.5px]" : "top-3 text-base"
|
|
19392
19579
|
)
|
|
@@ -19417,7 +19604,7 @@ function ContentArea({
|
|
|
19417
19604
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19418
19605
|
"div",
|
|
19419
19606
|
{
|
|
19420
|
-
className:
|
|
19607
|
+
className: classNames17__default.default({
|
|
19421
19608
|
"min-h-screen h-full w-full py-3 px-5": true,
|
|
19422
19609
|
"py-3 px-5": !enablePadding,
|
|
19423
19610
|
"py-3 px-5 lg:px-[150px]": enablePadding,
|
|
@@ -19433,7 +19620,7 @@ function FlexCol({ children, gap = 3, styles }) {
|
|
|
19433
19620
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19434
19621
|
"div",
|
|
19435
19622
|
{
|
|
19436
|
-
className:
|
|
19623
|
+
className: classNames17__default.default({
|
|
19437
19624
|
[`flex flex-col gap-${gap}`]: true,
|
|
19438
19625
|
[`${styles}`]: styles
|
|
19439
19626
|
}),
|
|
@@ -19446,7 +19633,7 @@ function FlexRow({ children, gap = 3, styles }) {
|
|
|
19446
19633
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19447
19634
|
"div",
|
|
19448
19635
|
{
|
|
19449
|
-
className:
|
|
19636
|
+
className: classNames17__default.default({
|
|
19450
19637
|
[`flex flex-row gap-${gap}`]: true,
|
|
19451
19638
|
[`${styles}`]: styles
|
|
19452
19639
|
}),
|
|
@@ -19465,7 +19652,7 @@ function Grid({ children, styles }) {
|
|
|
19465
19652
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19466
19653
|
"div",
|
|
19467
19654
|
{
|
|
19468
|
-
className:
|
|
19655
|
+
className: classNames17__default.default({
|
|
19469
19656
|
[`grid`]: true,
|
|
19470
19657
|
[`${styles}`]: styles
|
|
19471
19658
|
}),
|
|
@@ -19482,7 +19669,7 @@ var Layout = ({
|
|
|
19482
19669
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19483
19670
|
"div",
|
|
19484
19671
|
{
|
|
19485
|
-
className:
|
|
19672
|
+
className: classNames17__default.default({
|
|
19486
19673
|
// "flex h-full w-screen bg-gray-100 overflow-auto": true,
|
|
19487
19674
|
"flex bg-eui-light-600": true,
|
|
19488
19675
|
"flex-col": flexDirection === "vertical",
|
|
@@ -19501,7 +19688,7 @@ var Header = ({
|
|
|
19501
19688
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19502
19689
|
"div",
|
|
19503
19690
|
{
|
|
19504
|
-
className:
|
|
19691
|
+
className: classNames17__default.default({
|
|
19505
19692
|
static: position === "static",
|
|
19506
19693
|
fixed: position === "fixed",
|
|
19507
19694
|
sticky: position === "sticky",
|
|
@@ -19520,8 +19707,8 @@ var Header = ({
|
|
|
19520
19707
|
);
|
|
19521
19708
|
};
|
|
19522
19709
|
var useIsMobile = (breakpoint = 768) => {
|
|
19523
|
-
const [isMobile, setIsMobile] =
|
|
19524
|
-
|
|
19710
|
+
const [isMobile, setIsMobile] = React2.useState(window.innerWidth < breakpoint);
|
|
19711
|
+
React2.useEffect(() => {
|
|
19525
19712
|
const handleResize = () => {
|
|
19526
19713
|
setIsMobile(window.innerWidth < breakpoint);
|
|
19527
19714
|
};
|
|
@@ -19541,7 +19728,7 @@ var Content = ({
|
|
|
19541
19728
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19542
19729
|
"div",
|
|
19543
19730
|
{
|
|
19544
|
-
className:
|
|
19731
|
+
className: classNames17__default.default({
|
|
19545
19732
|
"w-full min-h-screen transition-all duration-200 eui-bg-sm": true,
|
|
19546
19733
|
"md:pl-[300px]": !overlayedSidebar && sidebarVisible && !isMobile,
|
|
19547
19734
|
// Shift when sidebar is open (desktop)
|
|
@@ -19557,7 +19744,7 @@ var Footer = ({ children, styles }) => {
|
|
|
19557
19744
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19558
19745
|
"div",
|
|
19559
19746
|
{
|
|
19560
|
-
className:
|
|
19747
|
+
className: classNames17__default.default({
|
|
19561
19748
|
"bottom-0 w-full h-fit": true,
|
|
19562
19749
|
"border-t border-eui-dark-500/40 dark:border-eui-secondary-800 eui-bg-md": !styles,
|
|
19563
19750
|
[`${styles}`]: styles
|
|
@@ -19631,7 +19818,7 @@ function BlockGroup({
|
|
|
19631
19818
|
}
|
|
19632
19819
|
var BlockGroup_default = BlockGroup;
|
|
19633
19820
|
var useTheme = () => {
|
|
19634
|
-
const context =
|
|
19821
|
+
const context = React2.useContext(ThemeContext);
|
|
19635
19822
|
if (!context) {
|
|
19636
19823
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
19637
19824
|
}
|
|
@@ -19645,7 +19832,7 @@ function MarkdownEditor({
|
|
|
19645
19832
|
const [field, meta, helpers] = formik.useField(props);
|
|
19646
19833
|
const { theme } = useTheme_default();
|
|
19647
19834
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
19648
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
19835
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames17__default.default(theme === "dark" ? "dark" : "", styles), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
19649
19836
|
editor.MDXEditor,
|
|
19650
19837
|
{
|
|
19651
19838
|
markdown: field.value,
|
|
@@ -19693,11 +19880,11 @@ function MarkdownEditor({
|
|
|
19693
19880
|
] });
|
|
19694
19881
|
}
|
|
19695
19882
|
var MarkdownEditor_default = MarkdownEditor;
|
|
19696
|
-
var MarkdownContext =
|
|
19883
|
+
var MarkdownContext = React2.createContext(null);
|
|
19697
19884
|
|
|
19698
19885
|
// src/components/markdown/hooks/useMarkdown.tsx
|
|
19699
19886
|
function useMarkdown() {
|
|
19700
|
-
return
|
|
19887
|
+
return React2.useContext(MarkdownContext);
|
|
19701
19888
|
}
|
|
19702
19889
|
|
|
19703
19890
|
// src/components/markdown/utils/generateHeadingNumbers.ts
|
|
@@ -19748,7 +19935,7 @@ function MarkdownTOC({ title = "Table of Contents" }) {
|
|
|
19748
19935
|
"button",
|
|
19749
19936
|
{
|
|
19750
19937
|
onClick: () => scrollToHeading(heading.id),
|
|
19751
|
-
className:
|
|
19938
|
+
className: classNames17__default.default(
|
|
19752
19939
|
"block w-full text-left text-sm transition-all ease-in-out duration-150",
|
|
19753
19940
|
"hover:text-primary",
|
|
19754
19941
|
activeHeading === heading.id ? "text-primary font-semibold underline" : "text-gray-500 dark:text-gray-400"
|
|
@@ -19772,7 +19959,7 @@ function MarkdownViewer({ value }) {
|
|
|
19772
19959
|
const markdown = value ?? context?.markdown ?? "";
|
|
19773
19960
|
const headings = context?.headings ?? [];
|
|
19774
19961
|
const setActiveHeading = context?.setActiveHeading;
|
|
19775
|
-
|
|
19962
|
+
React2.useEffect(() => {
|
|
19776
19963
|
const timeout = setTimeout(() => {
|
|
19777
19964
|
headings.forEach((heading) => {
|
|
19778
19965
|
const headingEls = document.querySelectorAll("h1,h2,h3,h4,h5,h6");
|
|
@@ -19877,8 +20064,8 @@ function extractHeadings(markdown) {
|
|
|
19877
20064
|
});
|
|
19878
20065
|
}
|
|
19879
20066
|
function MarkdownProvider({ markdown, children }) {
|
|
19880
|
-
const [activeHeading, setActiveHeading] =
|
|
19881
|
-
const headings =
|
|
20067
|
+
const [activeHeading, setActiveHeading] = React2.useState("");
|
|
20068
|
+
const headings = React2.useMemo(() => extractHeadings(markdown), [markdown]);
|
|
19882
20069
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19883
20070
|
MarkdownContext.Provider,
|
|
19884
20071
|
{
|
|
@@ -19904,7 +20091,7 @@ function BreadcrumbItem({
|
|
|
19904
20091
|
{
|
|
19905
20092
|
href,
|
|
19906
20093
|
onClick,
|
|
19907
|
-
className:
|
|
20094
|
+
className: classNames17__default.default({
|
|
19908
20095
|
"text-lg font-semibold": true,
|
|
19909
20096
|
"text-gray-400 hover:text-gray-600 cursor-pointer": !active,
|
|
19910
20097
|
"text-eui-light-800": active,
|
|
@@ -19951,7 +20138,7 @@ var Breadcrumb = ({
|
|
|
19951
20138
|
const { config } = useEUIConfig();
|
|
19952
20139
|
const pathname = currentPath || (typeof window !== "undefined" ? window.location.pathname : "/");
|
|
19953
20140
|
const resolvedRoutes = routes || config?.routes || [];
|
|
19954
|
-
const resolvedData =
|
|
20141
|
+
const resolvedData = React2.useMemo(() => {
|
|
19955
20142
|
if (resolvedRoutes && resolvedRoutes.length > 0) {
|
|
19956
20143
|
return buildFromRoutes(resolvedRoutes, pathname);
|
|
19957
20144
|
}
|
|
@@ -19968,7 +20155,7 @@ var Breadcrumb = ({
|
|
|
19968
20155
|
navigate(item.href);
|
|
19969
20156
|
}
|
|
19970
20157
|
};
|
|
19971
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
20158
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React2__default.default.Fragment, { children: [
|
|
19972
20159
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
19973
20160
|
BreadcrumbItem_default,
|
|
19974
20161
|
{
|
|
@@ -19981,7 +20168,7 @@ var Breadcrumb = ({
|
|
|
19981
20168
|
index < resolvedData.length - 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
19982
20169
|
"span",
|
|
19983
20170
|
{
|
|
19984
|
-
className:
|
|
20171
|
+
className: classNames17__default.default({
|
|
19985
20172
|
"text-lg font-semibold text-gray-500": true,
|
|
19986
20173
|
[`px-${gap}`]: gap
|
|
19987
20174
|
}),
|
|
@@ -19995,7 +20182,7 @@ var Breadcrumb = ({
|
|
|
19995
20182
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19996
20183
|
"div",
|
|
19997
20184
|
{
|
|
19998
|
-
className:
|
|
20185
|
+
className: classNames17__default.default({
|
|
19999
20186
|
"inline-flex": true,
|
|
20000
20187
|
[`${styles}`]: styles
|
|
20001
20188
|
}),
|
|
@@ -20008,63 +20195,41 @@ var Drawer = ({
|
|
|
20008
20195
|
visibility,
|
|
20009
20196
|
side = "left",
|
|
20010
20197
|
handleClose,
|
|
20011
|
-
styles
|
|
20198
|
+
styles,
|
|
20199
|
+
showBackdrop = true,
|
|
20200
|
+
closeOnBackdropClick = true
|
|
20012
20201
|
}) => {
|
|
20013
20202
|
const isHorizontal = side === "left" || side === "right";
|
|
20014
20203
|
const isMobile = useIsMobile_default();
|
|
20015
20204
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
20016
|
-
isMobile &&
|
|
20205
|
+
isMobile && showBackdrop && /* @__PURE__ */ jsxRuntime.jsx(TransitionFade_default, { visibility, leaveDuration: 200, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
20017
20206
|
"div",
|
|
20018
20207
|
{
|
|
20019
|
-
className: "fixed inset-0 bg-black
|
|
20020
|
-
onClick: handleClose
|
|
20208
|
+
className: "fixed inset-0 bg-black/50 z-40",
|
|
20209
|
+
onClick: closeOnBackdropClick ? handleClose : void 0
|
|
20021
20210
|
}
|
|
20022
|
-
),
|
|
20023
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
20024
|
-
|
|
20211
|
+
) }),
|
|
20212
|
+
/* @__PURE__ */ jsxRuntime.jsx(TransitionSlide_default, { visibility, side, leaveDuration: 200, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
20213
|
+
"div",
|
|
20025
20214
|
{
|
|
20026
|
-
|
|
20027
|
-
|
|
20028
|
-
enterFrom: classNames16__default.default({
|
|
20029
|
-
"-translate-x-full": side === "left",
|
|
20030
|
-
"translate-x-full": side === "right",
|
|
20031
|
-
"-translate-y-full": side === "top",
|
|
20032
|
-
"translate-y-full": side === "bottom"
|
|
20033
|
-
}),
|
|
20034
|
-
enterTo: "translate-x-0 translate-y-0",
|
|
20035
|
-
leave: "transform transition duration-200 ease-in",
|
|
20036
|
-
leaveFrom: "translate-x-0 translate-y-0",
|
|
20037
|
-
leaveTo: classNames16__default.default({
|
|
20038
|
-
"-translate-x-full": side === "left",
|
|
20039
|
-
"translate-x-full": side === "right",
|
|
20040
|
-
"-translate-y-full": side === "top",
|
|
20041
|
-
"translate-y-full": side === "bottom"
|
|
20042
|
-
}),
|
|
20043
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
20044
|
-
"div",
|
|
20215
|
+
className: classNames17__default.default(
|
|
20216
|
+
"fixed shadow-lg z-50",
|
|
20045
20217
|
{
|
|
20046
|
-
|
|
20047
|
-
|
|
20048
|
-
|
|
20049
|
-
|
|
20050
|
-
|
|
20051
|
-
|
|
20052
|
-
|
|
20053
|
-
|
|
20054
|
-
|
|
20055
|
-
|
|
20056
|
-
|
|
20057
|
-
|
|
20058
|
-
|
|
20059
|
-
},
|
|
20060
|
-
{ "eui-bg-md": !styles },
|
|
20061
|
-
{ [`${styles}`]: styles }
|
|
20062
|
-
),
|
|
20063
|
-
children
|
|
20064
|
-
}
|
|
20065
|
-
)
|
|
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
|
|
20066
20231
|
}
|
|
20067
|
-
)
|
|
20232
|
+
) })
|
|
20068
20233
|
] });
|
|
20069
20234
|
};
|
|
20070
20235
|
function DrawerToggler({
|
|
@@ -20075,7 +20240,7 @@ function DrawerToggler({
|
|
|
20075
20240
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
20076
20241
|
"div",
|
|
20077
20242
|
{
|
|
20078
|
-
className:
|
|
20243
|
+
className: classNames17__default.default({
|
|
20079
20244
|
"text-xl p-3 cursor-pointer": true,
|
|
20080
20245
|
"transition-all ease-in-out": true,
|
|
20081
20246
|
"text-eui-dark-500 dark:text-eui-secondary-600": !styles,
|
|
@@ -20123,7 +20288,7 @@ function FooterNav({ data = [], styles }) {
|
|
|
20123
20288
|
childrenContent = /* @__PURE__ */ jsxRuntime.jsx(
|
|
20124
20289
|
"div",
|
|
20125
20290
|
{
|
|
20126
|
-
className:
|
|
20291
|
+
className: classNames17__default.default({
|
|
20127
20292
|
"grid w-full": true,
|
|
20128
20293
|
"grid-cols-1": isMobile,
|
|
20129
20294
|
"grid-cols-3": !isMobile,
|
|
@@ -20136,7 +20301,7 @@ function FooterNav({ data = [], styles }) {
|
|
|
20136
20301
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
20137
20302
|
"div",
|
|
20138
20303
|
{
|
|
20139
|
-
className:
|
|
20304
|
+
className: classNames17__default.default({
|
|
20140
20305
|
[`${styles}`]: styles
|
|
20141
20306
|
}),
|
|
20142
20307
|
children: childrenContent
|
|
@@ -20177,7 +20342,7 @@ var FooterNavGroup = ({
|
|
|
20177
20342
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
20178
20343
|
"div",
|
|
20179
20344
|
{
|
|
20180
|
-
className:
|
|
20345
|
+
className: classNames17__default.default({
|
|
20181
20346
|
"": true,
|
|
20182
20347
|
"py-2 font-semibold eui-text-lg": !styles,
|
|
20183
20348
|
[`${styles}`]: styles
|
|
@@ -20222,7 +20387,7 @@ var FooterNavItem = ({
|
|
|
20222
20387
|
"div",
|
|
20223
20388
|
{
|
|
20224
20389
|
onClick: handleNavigation,
|
|
20225
|
-
className:
|
|
20390
|
+
className: classNames17__default.default({
|
|
20226
20391
|
"flex flex-row items-center gap-3 cursor-pointer p-1 w-full": true,
|
|
20227
20392
|
"transition-all duration-200 ease-in-out": true,
|
|
20228
20393
|
"text-sm eui-text-sm": !styles,
|
|
@@ -20251,7 +20416,7 @@ var FooterNavItemTitle = ({
|
|
|
20251
20416
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
20252
20417
|
"div",
|
|
20253
20418
|
{
|
|
20254
|
-
className:
|
|
20419
|
+
className: classNames17__default.default({
|
|
20255
20420
|
"": true,
|
|
20256
20421
|
"py-2 font-thin eui-text-md": !styles,
|
|
20257
20422
|
[`${styles}`]: styles
|
|
@@ -20304,7 +20469,7 @@ function HeaderNav({ data = [], styles }) {
|
|
|
20304
20469
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
20305
20470
|
"div",
|
|
20306
20471
|
{
|
|
20307
|
-
className:
|
|
20472
|
+
className: classNames17__default.default({
|
|
20308
20473
|
[`${styles}`]: styles
|
|
20309
20474
|
}),
|
|
20310
20475
|
children: childrenContent
|
|
@@ -20313,7 +20478,7 @@ function HeaderNav({ data = [], styles }) {
|
|
|
20313
20478
|
}
|
|
20314
20479
|
var HeaderNav_default = HeaderNav;
|
|
20315
20480
|
function useClickOutside(ref, fun) {
|
|
20316
|
-
|
|
20481
|
+
React2.useEffect(() => {
|
|
20317
20482
|
const listener = (e) => {
|
|
20318
20483
|
if (!ref.current || ref.current.contains(e.target)) {
|
|
20319
20484
|
return;
|
|
@@ -20354,8 +20519,8 @@ var HeaderNavGroup = ({
|
|
|
20354
20519
|
styles,
|
|
20355
20520
|
children
|
|
20356
20521
|
}) => {
|
|
20357
|
-
const [collapsed, setCollapsed] =
|
|
20358
|
-
const headerNavGroupRef =
|
|
20522
|
+
const [collapsed, setCollapsed] = React2.useState(true);
|
|
20523
|
+
const headerNavGroupRef = React2.useRef(null);
|
|
20359
20524
|
useClickOutside(headerNavGroupRef, () => setCollapsed(true));
|
|
20360
20525
|
const handleNavigation = () => {
|
|
20361
20526
|
if (to) {
|
|
@@ -20366,7 +20531,7 @@ var HeaderNavGroup = ({
|
|
|
20366
20531
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
20367
20532
|
"div",
|
|
20368
20533
|
{
|
|
20369
|
-
className:
|
|
20534
|
+
className: classNames17__default.default({
|
|
20370
20535
|
"flex flex-row gap-2 items-center justify-between cursor-pointer p-3 w-full": true,
|
|
20371
20536
|
"transition-all duration-300 ease-in-out": true,
|
|
20372
20537
|
"eui-text-md bg-gradient-to-t from-eui-dark-500/10 dark:from-green-700/10": !styles,
|
|
@@ -20394,7 +20559,7 @@ var HeaderNavGroup = ({
|
|
|
20394
20559
|
children && /* @__PURE__ */ jsxRuntime.jsx(
|
|
20395
20560
|
bs.BsChevronDown,
|
|
20396
20561
|
{
|
|
20397
|
-
className:
|
|
20562
|
+
className: classNames17__default.default({
|
|
20398
20563
|
"text-md": true,
|
|
20399
20564
|
"transition-all ease-in-out duration-300": true,
|
|
20400
20565
|
"rotate-180": !collapsed
|
|
@@ -20407,7 +20572,7 @@ var HeaderNavGroup = ({
|
|
|
20407
20572
|
!collapsed && children && /* @__PURE__ */ jsxRuntime.jsx(
|
|
20408
20573
|
"div",
|
|
20409
20574
|
{
|
|
20410
|
-
className:
|
|
20575
|
+
className: classNames17__default.default({
|
|
20411
20576
|
"absolute min-w-80 left-0 top-full mt-1 border border-eui-dark-300/10 dark:border-eui-dark-300/50 shadow-lg eui-shadow-lg z-50 w-full eui-bg-md": true,
|
|
20412
20577
|
"transition-all duration-300 ease-in-out": true
|
|
20413
20578
|
}),
|
|
@@ -20437,7 +20602,7 @@ var HeaderNavItem = ({
|
|
|
20437
20602
|
"div",
|
|
20438
20603
|
{
|
|
20439
20604
|
onClick: handleNavigation,
|
|
20440
|
-
className:
|
|
20605
|
+
className: classNames17__default.default({
|
|
20441
20606
|
"flex flex-row items-center gap-3 cursor-pointer p-3 w-full": true,
|
|
20442
20607
|
"transition-all duration-200 ease-in-out": true,
|
|
20443
20608
|
"eui-text-md border-b border-eui-dark-500/20 dark:border-eui-secondary-900/20 bg-gradient-to-r from-eui-dark-500/10 dark:from-eui-secondary-900/10": !styles,
|
|
@@ -20466,7 +20631,7 @@ var HeaderNavItemTitle = ({
|
|
|
20466
20631
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
20467
20632
|
"div",
|
|
20468
20633
|
{
|
|
20469
|
-
className:
|
|
20634
|
+
className: classNames17__default.default({
|
|
20470
20635
|
"p-3 font-thin": true,
|
|
20471
20636
|
"eui-text-md": !styles,
|
|
20472
20637
|
[`${styles}`]: styles
|
|
@@ -20506,7 +20671,7 @@ var Link = ({
|
|
|
20506
20671
|
href: href || "#",
|
|
20507
20672
|
target: targets[target],
|
|
20508
20673
|
onClick: handleClick,
|
|
20509
|
-
className:
|
|
20674
|
+
className: classNames17__default.default({
|
|
20510
20675
|
[`${textVariants[variant]}`]: variant,
|
|
20511
20676
|
[`${decorations[decoration]}`]: decoration,
|
|
20512
20677
|
"font-bold": bold,
|
|
@@ -20578,8 +20743,8 @@ var MenuGroup = ({
|
|
|
20578
20743
|
style,
|
|
20579
20744
|
...rest
|
|
20580
20745
|
}) => {
|
|
20581
|
-
const [collapsed, setCollapsed] =
|
|
20582
|
-
|
|
20746
|
+
const [collapsed, setCollapsed] = React2.useState(!defaultOpen);
|
|
20747
|
+
React2.useEffect(() => {
|
|
20583
20748
|
if (defaultOpen !== void 0) {
|
|
20584
20749
|
setCollapsed(!defaultOpen);
|
|
20585
20750
|
}
|
|
@@ -20696,12 +20861,12 @@ var Menu = ({
|
|
|
20696
20861
|
defaultMenuElements,
|
|
20697
20862
|
currentPath
|
|
20698
20863
|
}) => {
|
|
20699
|
-
const normalizedItems =
|
|
20700
|
-
const selected =
|
|
20864
|
+
const normalizedItems = React2.useMemo(() => assignKeys(items), [items]);
|
|
20865
|
+
const selected = React2.useMemo(() => {
|
|
20701
20866
|
if (!currentPath) return void 0;
|
|
20702
20867
|
return findSelectedKey(normalizedItems, currentPath);
|
|
20703
20868
|
}, [currentPath, normalizedItems]);
|
|
20704
|
-
const parentMap =
|
|
20869
|
+
const parentMap = React2.useMemo(
|
|
20705
20870
|
() => buildParentMap(normalizedItems),
|
|
20706
20871
|
[normalizedItems]
|
|
20707
20872
|
);
|
|
@@ -20854,8 +21019,8 @@ function RouteTabs({
|
|
|
20854
21019
|
const currentPath = window.location.pathname;
|
|
20855
21020
|
return navData.find((tab) => tab.to === currentPath)?.to || navData[0]?.to;
|
|
20856
21021
|
};
|
|
20857
|
-
const [activeTab, setActiveTab] =
|
|
20858
|
-
|
|
21022
|
+
const [activeTab, setActiveTab] = React2.useState(getActiveTab);
|
|
21023
|
+
React2.useEffect(() => {
|
|
20859
21024
|
if (mode !== "route") return;
|
|
20860
21025
|
const handlePopState = () => {
|
|
20861
21026
|
setActiveTab(getActiveTab());
|
|
@@ -20898,6 +21063,11 @@ function RouteTabs({
|
|
|
20898
21063
|
] });
|
|
20899
21064
|
}
|
|
20900
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
|
+
}
|
|
20901
21071
|
var getDefaultErrorMessage = (error) => {
|
|
20902
21072
|
if (!error) return "Something went wrong.";
|
|
20903
21073
|
if (typeof error === "string") return error;
|
|
@@ -20952,68 +21122,51 @@ function Modal({
|
|
|
20952
21122
|
}) {
|
|
20953
21123
|
const eui = useEUIConfig();
|
|
20954
21124
|
const resolvedShape = shape ?? eui?.config?.global?.shape ?? "square";
|
|
20955
|
-
const modalRef =
|
|
21125
|
+
const modalRef = React2.useRef(null);
|
|
20956
21126
|
useClickOutside(
|
|
20957
21127
|
modalRef,
|
|
20958
21128
|
enableCloseOnClickOutside ? handleOnClose : void 0
|
|
20959
21129
|
);
|
|
20960
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
20961
|
-
|
|
21130
|
+
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(
|
|
21131
|
+
"div",
|
|
20962
21132
|
{
|
|
20963
|
-
|
|
20964
|
-
|
|
20965
|
-
|
|
20966
|
-
|
|
20967
|
-
|
|
20968
|
-
|
|
20969
|
-
|
|
20970
|
-
|
|
20971
|
-
|
|
20972
|
-
|
|
20973
|
-
|
|
20974
|
-
|
|
20975
|
-
|
|
20976
|
-
|
|
20977
|
-
|
|
20978
|
-
|
|
20979
|
-
|
|
20980
|
-
|
|
20981
|
-
|
|
20982
|
-
|
|
20983
|
-
|
|
20984
|
-
|
|
20985
|
-
|
|
20986
|
-
|
|
20987
|
-
|
|
20988
|
-
|
|
20989
|
-
|
|
20990
|
-
|
|
20991
|
-
|
|
20992
|
-
|
|
20993
|
-
|
|
20994
|
-
|
|
20995
|
-
|
|
20996
|
-
AsyncComponentWrapper_default,
|
|
20997
|
-
{
|
|
20998
|
-
isLoading,
|
|
20999
|
-
isSuccess,
|
|
21000
|
-
isError,
|
|
21001
|
-
error,
|
|
21002
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-5 w-full", children })
|
|
21003
|
-
}
|
|
21004
|
-
)
|
|
21005
|
-
]
|
|
21006
|
-
}
|
|
21007
|
-
) })
|
|
21133
|
+
ref: modalRef,
|
|
21134
|
+
className: classNames17__default.default(
|
|
21135
|
+
"eui-bg-md eui-shadow-lg border border-gray-700/80 w-fit h-fit",
|
|
21136
|
+
shapes[resolvedShape],
|
|
21137
|
+
styles
|
|
21138
|
+
),
|
|
21139
|
+
children: [
|
|
21140
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "eui-gradient-to-r-sm inline-flex items-center border-b w-full border-eui-dark-500/80", children: [
|
|
21141
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full text-center text-md font-semibold", children: title }),
|
|
21142
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21143
|
+
"button",
|
|
21144
|
+
{
|
|
21145
|
+
type: "button",
|
|
21146
|
+
className: classNames17__default.default(
|
|
21147
|
+
"w-[60px] h-[60px] flex items-center justify-center transition-standard-fast",
|
|
21148
|
+
"hover:cursor-pointer hover:bg-eui-dark-500"
|
|
21149
|
+
),
|
|
21150
|
+
onClick: handleOnClose,
|
|
21151
|
+
children: "X"
|
|
21152
|
+
}
|
|
21153
|
+
)
|
|
21154
|
+
] }),
|
|
21155
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21156
|
+
AsyncComponentWrapper_default,
|
|
21157
|
+
{
|
|
21158
|
+
isLoading,
|
|
21159
|
+
isSuccess,
|
|
21160
|
+
isError,
|
|
21161
|
+
error,
|
|
21162
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-5 w-full", children })
|
|
21163
|
+
}
|
|
21164
|
+
)
|
|
21165
|
+
]
|
|
21008
21166
|
}
|
|
21009
|
-
);
|
|
21167
|
+
) }) }) });
|
|
21010
21168
|
}
|
|
21011
21169
|
var Modal_default = Modal;
|
|
21012
|
-
function UnderConstructionBanner({
|
|
21013
|
-
text
|
|
21014
|
-
}) {
|
|
21015
|
-
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" }) });
|
|
21016
|
-
}
|
|
21017
21170
|
var GlowWrapper = ({
|
|
21018
21171
|
children,
|
|
21019
21172
|
glowSize = 200,
|
|
@@ -21021,8 +21174,8 @@ var GlowWrapper = ({
|
|
|
21021
21174
|
className = "",
|
|
21022
21175
|
hideOnLeave = true
|
|
21023
21176
|
}) => {
|
|
21024
|
-
const ref =
|
|
21025
|
-
const handleMove =
|
|
21177
|
+
const ref = React2.useRef(null);
|
|
21178
|
+
const handleMove = React2.useCallback(
|
|
21026
21179
|
(e) => {
|
|
21027
21180
|
const el = ref.current;
|
|
21028
21181
|
if (!el) return;
|
|
@@ -21044,7 +21197,7 @@ var GlowWrapper = ({
|
|
|
21044
21197
|
},
|
|
21045
21198
|
[glowSize, glowColor]
|
|
21046
21199
|
);
|
|
21047
|
-
const handleLeave =
|
|
21200
|
+
const handleLeave = React2.useCallback(() => {
|
|
21048
21201
|
const el = ref.current;
|
|
21049
21202
|
if (!el || !hideOnLeave) return;
|
|
21050
21203
|
el.style.setProperty("--glow-x", `-999px`);
|
|
@@ -21089,8 +21242,8 @@ function InfiniteScrollTrigger({
|
|
|
21089
21242
|
threshold = 0,
|
|
21090
21243
|
onLoadMore
|
|
21091
21244
|
}) {
|
|
21092
|
-
const triggerRef =
|
|
21093
|
-
|
|
21245
|
+
const triggerRef = React2.useRef(null);
|
|
21246
|
+
React2.useEffect(() => {
|
|
21094
21247
|
const element = triggerRef.current;
|
|
21095
21248
|
if (!element || !hasMore || isLoading) {
|
|
21096
21249
|
return;
|
|
@@ -21116,7 +21269,7 @@ function InfiniteScrollTrigger({
|
|
|
21116
21269
|
}
|
|
21117
21270
|
var InfiniteScrollTrigger_default = InfiniteScrollTrigger;
|
|
21118
21271
|
function ShowMore({ text, limit }) {
|
|
21119
|
-
const [showMore, setShowMore] =
|
|
21272
|
+
const [showMore, setShowMore] = React2.useState(false);
|
|
21120
21273
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
21121
21274
|
showMore ? text : `${text.substring(0, limit)}`,
|
|
21122
21275
|
text.length > limit && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
@@ -21124,7 +21277,7 @@ function ShowMore({ text, limit }) {
|
|
|
21124
21277
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21125
21278
|
"div",
|
|
21126
21279
|
{
|
|
21127
|
-
className:
|
|
21280
|
+
className: classNames17__default.default({
|
|
21128
21281
|
"text-blue-300 px-1 pb-1 mt-1": true,
|
|
21129
21282
|
"bg-slate-900/70": !showMore,
|
|
21130
21283
|
"bg-gradient-to-t from-slate-900/50 to-transparent": showMore
|
|
@@ -21151,8 +21304,8 @@ function CommentComposer({
|
|
|
21151
21304
|
loading,
|
|
21152
21305
|
onSubmit
|
|
21153
21306
|
}) {
|
|
21154
|
-
const [value, setValue] =
|
|
21155
|
-
const [focused, setFocused] =
|
|
21307
|
+
const [value, setValue] = React2.useState("");
|
|
21308
|
+
const [focused, setFocused] = React2.useState(false);
|
|
21156
21309
|
async function handleSubmit() {
|
|
21157
21310
|
const content = value.trim();
|
|
21158
21311
|
if (!content) {
|
|
@@ -21407,7 +21560,7 @@ function CommentHeader({ comment, config }) {
|
|
|
21407
21560
|
}
|
|
21408
21561
|
var CommentHeader_default = CommentHeader;
|
|
21409
21562
|
var useDrawer = (defaultVisibility = true) => {
|
|
21410
|
-
const [show, setShow] =
|
|
21563
|
+
const [show, setShow] = React2.useState(defaultVisibility);
|
|
21411
21564
|
const openDrawer = () => {
|
|
21412
21565
|
setShow((prev) => !prev);
|
|
21413
21566
|
};
|
|
@@ -21422,7 +21575,7 @@ var useDrawer = (defaultVisibility = true) => {
|
|
|
21422
21575
|
};
|
|
21423
21576
|
var useDrawer_default = useDrawer;
|
|
21424
21577
|
var useModal = () => {
|
|
21425
|
-
const [show, setShow] =
|
|
21578
|
+
const [show, setShow] = React2.useState(false);
|
|
21426
21579
|
const handleOpenModal = () => {
|
|
21427
21580
|
setShow(true);
|
|
21428
21581
|
};
|
|
@@ -21470,7 +21623,7 @@ function CommentMenu({
|
|
|
21470
21623
|
onDelete,
|
|
21471
21624
|
onReport
|
|
21472
21625
|
}) {
|
|
21473
|
-
const ref =
|
|
21626
|
+
const ref = React2.useRef(null);
|
|
21474
21627
|
useClickOutside(ref, () => setOpen(false));
|
|
21475
21628
|
const items = [];
|
|
21476
21629
|
if (canEdit) {
|
|
@@ -21525,7 +21678,7 @@ function CommentMenu({
|
|
|
21525
21678
|
children: /* @__PURE__ */ jsxRuntime.jsx(bi.BiDotsVerticalRounded, { size: 18 })
|
|
21526
21679
|
}
|
|
21527
21680
|
),
|
|
21528
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21681
|
+
/* @__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 }) }) })
|
|
21529
21682
|
] });
|
|
21530
21683
|
}
|
|
21531
21684
|
var CommentMenu_default = CommentMenu;
|
|
@@ -21598,11 +21751,11 @@ function CommentItem({
|
|
|
21598
21751
|
onDelete,
|
|
21599
21752
|
onReport
|
|
21600
21753
|
}) {
|
|
21601
|
-
const [collapsed, setCollapsed] =
|
|
21602
|
-
const [isReplying, setIsReplying] =
|
|
21603
|
-
const [menuOpen, setMenuOpen] =
|
|
21604
|
-
const [loadingReplies, setLoadingReplies] =
|
|
21605
|
-
const [repliesLoaded, setRepliesLoaded] =
|
|
21754
|
+
const [collapsed, setCollapsed] = React2.useState(true);
|
|
21755
|
+
const [isReplying, setIsReplying] = React2.useState(false);
|
|
21756
|
+
const [menuOpen, setMenuOpen] = React2.useState(false);
|
|
21757
|
+
const [loadingReplies, setLoadingReplies] = React2.useState(false);
|
|
21758
|
+
const [repliesLoaded, setRepliesLoaded] = React2.useState(false);
|
|
21606
21759
|
const resolvedDepth = Math.min(depth, config.maxDepth);
|
|
21607
21760
|
const {
|
|
21608
21761
|
Header: HeaderComponent = CommentHeader_default,
|
|
@@ -21766,18 +21919,18 @@ function CommentThread({
|
|
|
21766
21919
|
onDelete,
|
|
21767
21920
|
onReport
|
|
21768
21921
|
}) {
|
|
21769
|
-
const [comments, setComments] =
|
|
21770
|
-
const [isLoadingComments, setIsLoadingComments] =
|
|
21771
|
-
const [replyCache, setReplyCache] =
|
|
21922
|
+
const [comments, setComments] = React2.useState([]);
|
|
21923
|
+
const [isLoadingComments, setIsLoadingComments] = React2.useState(true);
|
|
21924
|
+
const [replyCache, setReplyCache] = React2.useState(
|
|
21772
21925
|
{}
|
|
21773
21926
|
);
|
|
21774
|
-
const replyCacheRef =
|
|
21927
|
+
const replyCacheRef = React2.useRef(replyCache);
|
|
21775
21928
|
const ComposerComponent = components?.Composer ?? CommentComposer_default;
|
|
21776
21929
|
const resolvedConfig = {
|
|
21777
21930
|
...DEFAULT_COMMENT_THREAD_CONFIG,
|
|
21778
21931
|
...config
|
|
21779
21932
|
};
|
|
21780
|
-
|
|
21933
|
+
React2.useEffect(() => {
|
|
21781
21934
|
async function loadComments() {
|
|
21782
21935
|
try {
|
|
21783
21936
|
const result = await dataSource.getComments({
|
|
@@ -21791,10 +21944,10 @@ function CommentThread({
|
|
|
21791
21944
|
}
|
|
21792
21945
|
void loadComments();
|
|
21793
21946
|
}, [dataSource, resolvedConfig.commentsPerPage]);
|
|
21794
|
-
|
|
21947
|
+
React2.useEffect(() => {
|
|
21795
21948
|
replyCacheRef.current = replyCache;
|
|
21796
21949
|
}, [replyCache]);
|
|
21797
|
-
|
|
21950
|
+
React2.useEffect(() => {
|
|
21798
21951
|
let cancelled = false;
|
|
21799
21952
|
async function refreshLoadedReplies() {
|
|
21800
21953
|
const parentIds = Object.keys(replyCacheRef.current);
|
|
@@ -21830,13 +21983,13 @@ function CommentThread({
|
|
|
21830
21983
|
cancelled = true;
|
|
21831
21984
|
};
|
|
21832
21985
|
}, [dataSource, resolvedConfig.repliesPerPage]);
|
|
21833
|
-
|
|
21986
|
+
React2.useEffect(() => {
|
|
21834
21987
|
if (!updatedComment) {
|
|
21835
21988
|
return;
|
|
21836
21989
|
}
|
|
21837
21990
|
updateCommentEverywhere(updatedComment.id, () => updatedComment);
|
|
21838
21991
|
}, [updatedComment]);
|
|
21839
|
-
|
|
21992
|
+
React2.useEffect(() => {
|
|
21840
21993
|
if (!deletedComment) {
|
|
21841
21994
|
return;
|
|
21842
21995
|
}
|
|
@@ -22050,13 +22203,13 @@ function SliderItem({
|
|
|
22050
22203
|
}
|
|
22051
22204
|
var SliderItem_default = SliderItem;
|
|
22052
22205
|
function Slider({ isLoading, isSuccess, coverArt, screenshots }) {
|
|
22053
|
-
const [images, setImages] =
|
|
22206
|
+
const [images, setImages] = React2.useState([
|
|
22054
22207
|
{
|
|
22055
22208
|
img: coverArt,
|
|
22056
22209
|
selected: true
|
|
22057
22210
|
}
|
|
22058
22211
|
]);
|
|
22059
|
-
|
|
22212
|
+
React2.useEffect(() => {
|
|
22060
22213
|
setImages([
|
|
22061
22214
|
{
|
|
22062
22215
|
img: coverArt,
|
|
@@ -22064,7 +22217,7 @@ function Slider({ isLoading, isSuccess, coverArt, screenshots }) {
|
|
|
22064
22217
|
}
|
|
22065
22218
|
]);
|
|
22066
22219
|
}, [isSuccess]);
|
|
22067
|
-
|
|
22220
|
+
React2.useEffect(() => {
|
|
22068
22221
|
if (screenshots) {
|
|
22069
22222
|
const selectableScreenshots = [];
|
|
22070
22223
|
screenshots.forEach((item) => {
|
|
@@ -22076,8 +22229,8 @@ function Slider({ isLoading, isSuccess, coverArt, screenshots }) {
|
|
|
22076
22229
|
setImages((prev) => [...prev, ...selectableScreenshots]);
|
|
22077
22230
|
}
|
|
22078
22231
|
}, [isSuccess]);
|
|
22079
|
-
const [displayImg, setDisplayImg] =
|
|
22080
|
-
|
|
22232
|
+
const [displayImg, setDisplayImg] = React2.useState(coverArt);
|
|
22233
|
+
React2.useEffect(() => {
|
|
22081
22234
|
setDisplayImg(coverArt);
|
|
22082
22235
|
}, [coverArt]);
|
|
22083
22236
|
const displayImageHandler = (itemIndex, img) => {
|
|
@@ -22189,7 +22342,7 @@ function WorldMapCountryTable({
|
|
|
22189
22342
|
title = "Country Breakdown",
|
|
22190
22343
|
data
|
|
22191
22344
|
}) {
|
|
22192
|
-
const enrichedData =
|
|
22345
|
+
const enrichedData = React2.useMemo(() => {
|
|
22193
22346
|
const mapped = data.map((item) => {
|
|
22194
22347
|
const countryMeta = COUNTRIES.find((c) => c.code === item.code);
|
|
22195
22348
|
return {
|
|
@@ -22202,11 +22355,11 @@ function WorldMapCountryTable({
|
|
|
22202
22355
|
});
|
|
22203
22356
|
return mapped.sort((a, b) => b.value - a.value);
|
|
22204
22357
|
}, [data]);
|
|
22205
|
-
const total =
|
|
22358
|
+
const total = React2.useMemo(
|
|
22206
22359
|
() => enrichedData.reduce((sum, i) => sum + i.value, 0),
|
|
22207
22360
|
[enrichedData]
|
|
22208
22361
|
);
|
|
22209
|
-
const finalData =
|
|
22362
|
+
const finalData = React2.useMemo(() => {
|
|
22210
22363
|
return enrichedData.map((item) => ({
|
|
22211
22364
|
...item,
|
|
22212
22365
|
percent: total > 0 ? item.value / total * 100 : 0
|
|
@@ -22281,7 +22434,7 @@ function BoxNavItem({ icon, name, to, selected, onClick }) {
|
|
|
22281
22434
|
type: "button",
|
|
22282
22435
|
onClick: handleClick,
|
|
22283
22436
|
"aria-current": selected ? "page" : void 0,
|
|
22284
|
-
className:
|
|
22437
|
+
className: classNames17__default.default(
|
|
22285
22438
|
"w-full min-w-[80px] flex flex-col items-center justify-center py-3 text-center",
|
|
22286
22439
|
"hover:text-secondary-700 hover:bg-gray-300/10 hover:cursor-pointer",
|
|
22287
22440
|
selected ? "text-eui-secondary-700 bg-gray-300/10" : "text-gray-400",
|
|
@@ -22451,7 +22604,7 @@ var TNDropdownGroup = ({
|
|
|
22451
22604
|
navigate,
|
|
22452
22605
|
className
|
|
22453
22606
|
}) => {
|
|
22454
|
-
const [open, setOpen] =
|
|
22607
|
+
const [open, setOpen] = React2.useState(true);
|
|
22455
22608
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
22456
22609
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
22457
22610
|
"div",
|
|
@@ -22540,8 +22693,8 @@ var TNGroup = ({
|
|
|
22540
22693
|
components,
|
|
22541
22694
|
selected
|
|
22542
22695
|
}) => {
|
|
22543
|
-
const [open, setOpen] =
|
|
22544
|
-
const timeoutRef =
|
|
22696
|
+
const [open, setOpen] = React2.useState(false);
|
|
22697
|
+
const timeoutRef = React2.useRef(null);
|
|
22545
22698
|
const handleEnter = () => {
|
|
22546
22699
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
22547
22700
|
setOpen(true);
|
|
@@ -22641,7 +22794,7 @@ function GenericLayout({
|
|
|
22641
22794
|
return /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider, { defaultTheme, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
22642
22795
|
"div",
|
|
22643
22796
|
{
|
|
22644
|
-
className:
|
|
22797
|
+
className: classNames17__default.default({
|
|
22645
22798
|
[`${styles}`]: styles
|
|
22646
22799
|
}),
|
|
22647
22800
|
children
|
|
@@ -22678,7 +22831,7 @@ function SidebarLayout({
|
|
|
22678
22831
|
header = /* @__PURE__ */ jsxRuntime.jsx(Header, {}),
|
|
22679
22832
|
footer = /* @__PURE__ */ jsxRuntime.jsx(Footer, {})
|
|
22680
22833
|
}) {
|
|
22681
|
-
const [showSidebar, setShowSidebar] =
|
|
22834
|
+
const [showSidebar, setShowSidebar] = React2.useState(true);
|
|
22682
22835
|
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: [
|
|
22683
22836
|
/* @__PURE__ */ jsxRuntime.jsx(ContentArea_default, { children }),
|
|
22684
22837
|
footer
|
|
@@ -22690,7 +22843,7 @@ function SidemenuLayout({ data, children }) {
|
|
|
22690
22843
|
return /* @__PURE__ */ jsxRuntime.jsx(DefaultLayout_default, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
22691
22844
|
"div",
|
|
22692
22845
|
{
|
|
22693
|
-
className:
|
|
22846
|
+
className: classNames17__default.default({
|
|
22694
22847
|
grid: true,
|
|
22695
22848
|
"grid-cols-7 gap-10": !isMobile,
|
|
22696
22849
|
"grid-cols-1 gap-": isMobile
|
|
@@ -22732,7 +22885,7 @@ function ScrollToTop({
|
|
|
22732
22885
|
behavior = "smooth",
|
|
22733
22886
|
target
|
|
22734
22887
|
}) {
|
|
22735
|
-
|
|
22888
|
+
React2.useEffect(() => {
|
|
22736
22889
|
if (target) {
|
|
22737
22890
|
target.scrollTo({
|
|
22738
22891
|
top: 0,
|
|
@@ -22927,9 +23080,14 @@ exports.TitleBanner = TitleBanner;
|
|
|
22927
23080
|
exports.Toast = Toast;
|
|
22928
23081
|
exports.Tooltip = Tooltip6;
|
|
22929
23082
|
exports.TopNav = TopNav;
|
|
22930
|
-
exports.Transition =
|
|
23083
|
+
exports.Transition = Transition;
|
|
23084
|
+
exports.TransitionAccordion = TransitionAccordion_default;
|
|
23085
|
+
exports.TransitionBase = TransitionBase_default;
|
|
22931
23086
|
exports.TransitionDropdown = TransitionDropdown_default;
|
|
23087
|
+
exports.TransitionFade = TransitionFade_default;
|
|
22932
23088
|
exports.TransitionFadeIn = TransitionFadeIn_default;
|
|
23089
|
+
exports.TransitionScale = TransitionScale_default;
|
|
23090
|
+
exports.TransitionSlide = TransitionSlide_default;
|
|
22933
23091
|
exports.Typography = Typography;
|
|
22934
23092
|
exports.UnderConstructionBanner = UnderConstructionBanner;
|
|
22935
23093
|
exports.ValueBadge = ValueBadge_default;
|