elseware-ui 2.36.1 → 2.36.2
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 +9 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +336 -276
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +162 -102
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var tailwindMerge = require('tailwind-merge');
|
|
4
|
-
var
|
|
4
|
+
var React8 = 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
9
|
var react = require('@headlessui/react');
|
|
10
|
-
var
|
|
10
|
+
var classNames17 = require('classnames');
|
|
11
11
|
var fa6 = require('react-icons/fa6');
|
|
12
12
|
var ReactWorldFlags = require('react-world-flags');
|
|
13
13
|
var emojiFlags = require('emoji-flags');
|
|
@@ -43,8 +43,8 @@ function _interopNamespace(e) {
|
|
|
43
43
|
return Object.freeze(n);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
var
|
|
47
|
-
var
|
|
46
|
+
var React8__default = /*#__PURE__*/_interopDefault(React8);
|
|
47
|
+
var classNames17__default = /*#__PURE__*/_interopDefault(classNames17);
|
|
48
48
|
var ReactWorldFlags__default = /*#__PURE__*/_interopDefault(ReactWorldFlags);
|
|
49
49
|
var emojiFlags__default = /*#__PURE__*/_interopDefault(emojiFlags);
|
|
50
50
|
var d3__namespace = /*#__PURE__*/_interopNamespace(d3);
|
|
@@ -582,9 +582,9 @@ function ConfigBootstrap({
|
|
|
582
582
|
loadingFallback = null,
|
|
583
583
|
showStack = false
|
|
584
584
|
}) {
|
|
585
|
-
const [RootApp, setRootApp] =
|
|
586
|
-
const [loadError, setLoadError] =
|
|
587
|
-
|
|
585
|
+
const [RootApp, setRootApp] = React8.useState(null);
|
|
586
|
+
const [loadError, setLoadError] = React8.useState(null);
|
|
587
|
+
React8.useEffect(() => {
|
|
588
588
|
if (!config.isValid) {
|
|
589
589
|
return;
|
|
590
590
|
}
|
|
@@ -625,16 +625,16 @@ function ConfigBootstrap({
|
|
|
625
625
|
return /* @__PURE__ */ jsxRuntime.jsx(RootApp, {});
|
|
626
626
|
}
|
|
627
627
|
var ConfigBootstrap_default = ConfigBootstrap;
|
|
628
|
-
var EUIContext =
|
|
628
|
+
var EUIContext = React8.createContext(null);
|
|
629
629
|
var EUIProvider = ({
|
|
630
630
|
config,
|
|
631
631
|
children
|
|
632
632
|
}) => {
|
|
633
|
-
const [state, setState] =
|
|
633
|
+
const [state, setState] = React8.useState(config);
|
|
634
634
|
return /* @__PURE__ */ jsxRuntime.jsx(EUIContext.Provider, { value: { config: state, setConfig: setState }, children });
|
|
635
635
|
};
|
|
636
636
|
var useEUIConfig = () => {
|
|
637
|
-
const ctx =
|
|
637
|
+
const ctx = React8.useContext(EUIContext);
|
|
638
638
|
if (!ctx) {
|
|
639
639
|
throw new Error("useEUIConfig must be used inside EUIProvider");
|
|
640
640
|
}
|
|
@@ -1452,14 +1452,14 @@ function useChartData({
|
|
|
1452
1452
|
onDataChange,
|
|
1453
1453
|
onError
|
|
1454
1454
|
} = {}) {
|
|
1455
|
-
const [state, setState] =
|
|
1455
|
+
const [state, setState] = React8.useState({
|
|
1456
1456
|
data: data ?? [],
|
|
1457
1457
|
loading: false,
|
|
1458
1458
|
error: null,
|
|
1459
1459
|
status: data?.length ? "success" : "idle",
|
|
1460
1460
|
lastUpdatedAt: data?.length ? /* @__PURE__ */ new Date() : void 0
|
|
1461
1461
|
});
|
|
1462
|
-
const prepareData =
|
|
1462
|
+
const prepareData = React8.useCallback(
|
|
1463
1463
|
(nextData) => {
|
|
1464
1464
|
if (!normalize2) {
|
|
1465
1465
|
return nextData;
|
|
@@ -1468,7 +1468,7 @@ function useChartData({
|
|
|
1468
1468
|
},
|
|
1469
1469
|
[normalize2]
|
|
1470
1470
|
);
|
|
1471
|
-
const replaceData =
|
|
1471
|
+
const replaceData = React8.useCallback(
|
|
1472
1472
|
(nextData) => {
|
|
1473
1473
|
const normalizedData = prepareData(nextData);
|
|
1474
1474
|
setState({
|
|
@@ -1482,7 +1482,7 @@ function useChartData({
|
|
|
1482
1482
|
},
|
|
1483
1483
|
[onDataChange, prepareData]
|
|
1484
1484
|
);
|
|
1485
|
-
const appendData =
|
|
1485
|
+
const appendData = React8.useCallback(
|
|
1486
1486
|
(nextData) => {
|
|
1487
1487
|
setState((currentState) => {
|
|
1488
1488
|
const incomingData = Array.isArray(nextData) ? nextData : [nextData];
|
|
@@ -1506,7 +1506,7 @@ function useChartData({
|
|
|
1506
1506
|
},
|
|
1507
1507
|
[maxDataPoints, onDataChange, prepareData]
|
|
1508
1508
|
);
|
|
1509
|
-
const clearData =
|
|
1509
|
+
const clearData = React8.useCallback(() => {
|
|
1510
1510
|
setState({
|
|
1511
1511
|
data: [],
|
|
1512
1512
|
loading: false,
|
|
@@ -1516,7 +1516,7 @@ function useChartData({
|
|
|
1516
1516
|
});
|
|
1517
1517
|
onDataChange?.([]);
|
|
1518
1518
|
}, [onDataChange]);
|
|
1519
|
-
const handleError =
|
|
1519
|
+
const handleError = React8.useCallback(
|
|
1520
1520
|
(error) => {
|
|
1521
1521
|
setState((currentState) => ({
|
|
1522
1522
|
...currentState,
|
|
@@ -1528,7 +1528,7 @@ function useChartData({
|
|
|
1528
1528
|
},
|
|
1529
1529
|
[onError]
|
|
1530
1530
|
);
|
|
1531
|
-
const refresh =
|
|
1531
|
+
const refresh = React8.useCallback(async () => {
|
|
1532
1532
|
const resolvedDataSource = dataSource;
|
|
1533
1533
|
if (!resolvedDataSource?.refresh && !resolvedDataSource?.getInitialData) {
|
|
1534
1534
|
return;
|
|
@@ -1547,13 +1547,13 @@ function useChartData({
|
|
|
1547
1547
|
handleError(error instanceof Error ? error : new Error(String(error)));
|
|
1548
1548
|
}
|
|
1549
1549
|
}, [dataSource, handleError, replaceData]);
|
|
1550
|
-
|
|
1550
|
+
React8.useEffect(() => {
|
|
1551
1551
|
if (!data) {
|
|
1552
1552
|
return;
|
|
1553
1553
|
}
|
|
1554
1554
|
replaceData(data);
|
|
1555
1555
|
}, [data, replaceData]);
|
|
1556
|
-
|
|
1556
|
+
React8.useEffect(() => {
|
|
1557
1557
|
if (!dataSource || !autoLoad) {
|
|
1558
1558
|
return;
|
|
1559
1559
|
}
|
|
@@ -1592,7 +1592,7 @@ function useChartData({
|
|
|
1592
1592
|
unsubscribe?.();
|
|
1593
1593
|
};
|
|
1594
1594
|
}, [appendData, autoLoad, dataSource, handleError, replaceData]);
|
|
1595
|
-
return
|
|
1595
|
+
return React8.useMemo(
|
|
1596
1596
|
() => ({
|
|
1597
1597
|
...state,
|
|
1598
1598
|
refresh,
|
|
@@ -1611,11 +1611,11 @@ function useChartRealtime({
|
|
|
1611
1611
|
onData,
|
|
1612
1612
|
onError
|
|
1613
1613
|
}) {
|
|
1614
|
-
const [data, setData] =
|
|
1615
|
-
const [error, setError] =
|
|
1616
|
-
const [connected, setConnected] =
|
|
1617
|
-
const [lastUpdatedAt, setLastUpdatedAt] =
|
|
1618
|
-
|
|
1614
|
+
const [data, setData] = React8.useState([]);
|
|
1615
|
+
const [error, setError] = React8.useState(null);
|
|
1616
|
+
const [connected, setConnected] = React8.useState(false);
|
|
1617
|
+
const [lastUpdatedAt, setLastUpdatedAt] = React8.useState();
|
|
1618
|
+
React8.useEffect(() => {
|
|
1619
1619
|
if (!enabled) {
|
|
1620
1620
|
setConnected(false);
|
|
1621
1621
|
return;
|
|
@@ -1649,7 +1649,7 @@ function useChartRealtime({
|
|
|
1649
1649
|
setConnected(false);
|
|
1650
1650
|
};
|
|
1651
1651
|
}, [connect, enabled, maxDataPoints, normalize2, onData, onError]);
|
|
1652
|
-
return
|
|
1652
|
+
return React8.useMemo(
|
|
1653
1653
|
() => ({
|
|
1654
1654
|
data,
|
|
1655
1655
|
error,
|
|
@@ -1671,13 +1671,13 @@ function useChartPolling({
|
|
|
1671
1671
|
onData,
|
|
1672
1672
|
onError
|
|
1673
1673
|
}) {
|
|
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 =
|
|
1674
|
+
const isMountedRef = React8.useRef(false);
|
|
1675
|
+
const isFetchingRef = React8.useRef(false);
|
|
1676
|
+
const [data, setData] = React8.useState([]);
|
|
1677
|
+
const [error, setError] = React8.useState(null);
|
|
1678
|
+
const [loading, setLoading] = React8.useState(immediate);
|
|
1679
|
+
const [lastUpdatedAt, setLastUpdatedAt] = React8.useState();
|
|
1680
|
+
const refresh = React8.useCallback(async () => {
|
|
1681
1681
|
if (isFetchingRef.current) {
|
|
1682
1682
|
return;
|
|
1683
1683
|
}
|
|
@@ -1706,13 +1706,13 @@ function useChartPolling({
|
|
|
1706
1706
|
isFetchingRef.current = false;
|
|
1707
1707
|
}
|
|
1708
1708
|
}, [fetcher, normalize2, onData, onError]);
|
|
1709
|
-
|
|
1709
|
+
React8.useEffect(() => {
|
|
1710
1710
|
isMountedRef.current = true;
|
|
1711
1711
|
return () => {
|
|
1712
1712
|
isMountedRef.current = false;
|
|
1713
1713
|
};
|
|
1714
1714
|
}, []);
|
|
1715
|
-
|
|
1715
|
+
React8.useEffect(() => {
|
|
1716
1716
|
if (!enabled) {
|
|
1717
1717
|
setLoading(false);
|
|
1718
1718
|
return;
|
|
@@ -1727,7 +1727,7 @@ function useChartPolling({
|
|
|
1727
1727
|
window.clearInterval(timer);
|
|
1728
1728
|
};
|
|
1729
1729
|
}, [enabled, immediate, interval, refresh]);
|
|
1730
|
-
return
|
|
1730
|
+
return React8.useMemo(
|
|
1731
1731
|
() => ({
|
|
1732
1732
|
data,
|
|
1733
1733
|
error,
|
|
@@ -1764,7 +1764,7 @@ function useChartSeries({
|
|
|
1764
1764
|
xKey,
|
|
1765
1765
|
excludeKeys = []
|
|
1766
1766
|
}) {
|
|
1767
|
-
return
|
|
1767
|
+
return React8.useMemo(() => {
|
|
1768
1768
|
const normalizedSeries = series && series.length > 0 ? series : inferSeriesKeys(data, xKey, excludeKeys).map((key) => ({
|
|
1769
1769
|
key
|
|
1770
1770
|
}));
|
|
@@ -1812,12 +1812,12 @@ function useChartTheme({
|
|
|
1812
1812
|
mode = "dark",
|
|
1813
1813
|
theme
|
|
1814
1814
|
} = {}) {
|
|
1815
|
-
return
|
|
1815
|
+
return React8.useMemo(() => {
|
|
1816
1816
|
const baseTheme = mode === "light" ? CHART_LIGHT_THEME : mode === "dark" ? CHART_DARK_THEME : DEFAULT_CHART_THEME;
|
|
1817
1817
|
return mergeChartTheme(baseTheme, theme);
|
|
1818
1818
|
}, [mode, theme]);
|
|
1819
1819
|
}
|
|
1820
|
-
var ChartContext =
|
|
1820
|
+
var ChartContext = React8.createContext({
|
|
1821
1821
|
data: [],
|
|
1822
1822
|
loading: false,
|
|
1823
1823
|
error: null,
|
|
@@ -1849,7 +1849,7 @@ function ChartProvider({
|
|
|
1849
1849
|
onDataChange,
|
|
1850
1850
|
onError
|
|
1851
1851
|
});
|
|
1852
|
-
const value =
|
|
1852
|
+
const value = React8.useMemo(
|
|
1853
1853
|
() => ({
|
|
1854
1854
|
...chartData,
|
|
1855
1855
|
mode: dataSource?.mode,
|
|
@@ -1866,7 +1866,7 @@ function ChartProvider({
|
|
|
1866
1866
|
);
|
|
1867
1867
|
}
|
|
1868
1868
|
function useChartContext() {
|
|
1869
|
-
return
|
|
1869
|
+
return React8.useContext(ChartContext);
|
|
1870
1870
|
}
|
|
1871
1871
|
|
|
1872
1872
|
// src/components/data-display/charts/context/chartReducer.ts
|
|
@@ -2170,7 +2170,7 @@ function ChartLegend({
|
|
|
2170
2170
|
valueSource = "latest",
|
|
2171
2171
|
onItemClick
|
|
2172
2172
|
}) {
|
|
2173
|
-
const legendItems =
|
|
2173
|
+
const legendItems = React8.useMemo(() => {
|
|
2174
2174
|
if (items?.length) {
|
|
2175
2175
|
return items;
|
|
2176
2176
|
}
|
|
@@ -2948,7 +2948,7 @@ function GaugePlot({
|
|
|
2948
2948
|
const chartData = data ?? context.data;
|
|
2949
2949
|
const chartLoading = loading ?? context.loading;
|
|
2950
2950
|
const chartError = error ?? context.error;
|
|
2951
|
-
const resolvedValue =
|
|
2951
|
+
const resolvedValue = React8.useMemo(() => {
|
|
2952
2952
|
if (typeof value === "number") {
|
|
2953
2953
|
return value;
|
|
2954
2954
|
}
|
|
@@ -3065,14 +3065,14 @@ function StatPlot({
|
|
|
3065
3065
|
const chartData = data ?? context.data;
|
|
3066
3066
|
const chartLoading = loading ?? context.loading;
|
|
3067
3067
|
const chartError = error ?? context.error;
|
|
3068
|
-
const resolvedValue =
|
|
3068
|
+
const resolvedValue = React8.useMemo(() => {
|
|
3069
3069
|
if (value !== void 0) {
|
|
3070
3070
|
return value;
|
|
3071
3071
|
}
|
|
3072
3072
|
const latestPoint = chartData[chartData.length - 1];
|
|
3073
3073
|
return latestPoint?.[String(valueKey)] ?? null;
|
|
3074
3074
|
}, [chartData, value, valueKey]);
|
|
3075
|
-
const resolvedPreviousValue =
|
|
3075
|
+
const resolvedPreviousValue = React8.useMemo(() => {
|
|
3076
3076
|
if (previousValue !== void 0) {
|
|
3077
3077
|
return previousValue;
|
|
3078
3078
|
}
|
|
@@ -3080,7 +3080,7 @@ function StatPlot({
|
|
|
3080
3080
|
const previous = previousPoint?.[String(valueKey)];
|
|
3081
3081
|
return typeof previous === "number" ? previous : void 0;
|
|
3082
3082
|
}, [chartData, previousValue, valueKey]);
|
|
3083
|
-
const trend =
|
|
3083
|
+
const trend = React8.useMemo(() => {
|
|
3084
3084
|
if (typeof resolvedValue !== "number" || typeof resolvedPreviousValue !== "number") {
|
|
3085
3085
|
return null;
|
|
3086
3086
|
}
|
|
@@ -3551,7 +3551,7 @@ var Chip = ({
|
|
|
3551
3551
|
}
|
|
3552
3552
|
) });
|
|
3553
3553
|
};
|
|
3554
|
-
var DataViewContext =
|
|
3554
|
+
var DataViewContext = React8.createContext(null);
|
|
3555
3555
|
|
|
3556
3556
|
// src/components/data-display/data-view/utils/searchData.ts
|
|
3557
3557
|
function searchData(data, search) {
|
|
@@ -3595,19 +3595,19 @@ function DataViewProvider({
|
|
|
3595
3595
|
defaultPageSize = 9,
|
|
3596
3596
|
sortConfig = {}
|
|
3597
3597
|
}) {
|
|
3598
|
-
const [search, setSearch] =
|
|
3599
|
-
const [filters, setFilters] =
|
|
3600
|
-
const [sort, setSort] =
|
|
3601
|
-
const [page, setPage] =
|
|
3602
|
-
const [pageSize, setPageSize] =
|
|
3603
|
-
const processedData =
|
|
3598
|
+
const [search, setSearch] = React8.useState("");
|
|
3599
|
+
const [filters, setFilters] = React8.useState({});
|
|
3600
|
+
const [sort, setSort] = React8.useState("suggested");
|
|
3601
|
+
const [page, setPage] = React8.useState(1);
|
|
3602
|
+
const [pageSize, setPageSize] = React8.useState(defaultPageSize);
|
|
3603
|
+
const processedData = React8.useMemo(() => {
|
|
3604
3604
|
let result = searchData(data, search);
|
|
3605
3605
|
result = filterData(result, filters);
|
|
3606
3606
|
result = sortData(result, sort, sortConfig);
|
|
3607
3607
|
return result;
|
|
3608
3608
|
}, [data, search, filters, sort, sortConfig]);
|
|
3609
3609
|
const totalPages = pageSize === "All" ? 1 : Math.ceil(processedData.length / pageSize);
|
|
3610
|
-
const paginatedData =
|
|
3610
|
+
const paginatedData = React8.useMemo(() => {
|
|
3611
3611
|
if (pageSize === "All") return processedData;
|
|
3612
3612
|
const size = pageSize;
|
|
3613
3613
|
const start = (page - 1) * size;
|
|
@@ -3645,7 +3645,7 @@ function DataViewSidebar({ children }) {
|
|
|
3645
3645
|
}
|
|
3646
3646
|
var DataViewSidebar_default = DataViewSidebar;
|
|
3647
3647
|
function useDataView() {
|
|
3648
|
-
const ctx =
|
|
3648
|
+
const ctx = React8.useContext(DataViewContext);
|
|
3649
3649
|
if (!ctx) {
|
|
3650
3650
|
throw new Error("useDataView must be used within DataViewProvider");
|
|
3651
3651
|
}
|
|
@@ -3711,7 +3711,7 @@ function Accordion({
|
|
|
3711
3711
|
toggleOnSummaryClick = false,
|
|
3712
3712
|
enableChildrenPadding = true
|
|
3713
3713
|
}) {
|
|
3714
|
-
const [collapse, setCollapse] =
|
|
3714
|
+
const [collapse, setCollapse] = React8.useState(defaultCollapse);
|
|
3715
3715
|
const handleToggle = () => {
|
|
3716
3716
|
setCollapse((prev) => !prev);
|
|
3717
3717
|
};
|
|
@@ -3719,7 +3719,7 @@ function Accordion({
|
|
|
3719
3719
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3720
3720
|
"div",
|
|
3721
3721
|
{
|
|
3722
|
-
className:
|
|
3722
|
+
className: classNames17__default.default({
|
|
3723
3723
|
"inline-flex gap-3 items-center px-3 py-2 w-full eui-gradient-to-r-general-xs": true,
|
|
3724
3724
|
"hover:cursor-pointer": toggleOnSummaryClick
|
|
3725
3725
|
}),
|
|
@@ -3737,7 +3737,7 @@ function Accordion({
|
|
|
3737
3737
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3738
3738
|
fa6.FaCircleChevronDown,
|
|
3739
3739
|
{
|
|
3740
|
-
className:
|
|
3740
|
+
className: classNames17__default.default(
|
|
3741
3741
|
"text-xl transition-transform duration-300",
|
|
3742
3742
|
{ "rotate-180": collapse }
|
|
3743
3743
|
)
|
|
@@ -3759,11 +3759,11 @@ function Accordion({
|
|
|
3759
3759
|
leave: "transition duration-75 ease-out",
|
|
3760
3760
|
leaveFrom: "transform scale-100 opacity-100",
|
|
3761
3761
|
leaveTo: "transform scale-95 opacity-0",
|
|
3762
|
-
as:
|
|
3762
|
+
as: React8.Fragment,
|
|
3763
3763
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3764
3764
|
"div",
|
|
3765
3765
|
{
|
|
3766
|
-
className:
|
|
3766
|
+
className: classNames17__default.default({
|
|
3767
3767
|
"border-t border-t-eui-dark-400/40 eui-text-sm": true,
|
|
3768
3768
|
"p-5": enableChildrenPadding
|
|
3769
3769
|
}),
|
|
@@ -3847,7 +3847,7 @@ function CardHeader({ icon, title, description, className }) {
|
|
|
3847
3847
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3848
3848
|
"div",
|
|
3849
3849
|
{
|
|
3850
|
-
className:
|
|
3850
|
+
className: classNames17__default.default(
|
|
3851
3851
|
"flex items-start gap-4 p-6 border-b border-white/10",
|
|
3852
3852
|
className
|
|
3853
3853
|
),
|
|
@@ -3863,14 +3863,14 @@ function CardHeader({ icon, title, description, className }) {
|
|
|
3863
3863
|
}
|
|
3864
3864
|
var CardHeader_default = CardHeader;
|
|
3865
3865
|
function CardContent({ children, className }) {
|
|
3866
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
3866
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames17__default.default("p-6 text-gray-300 text-sm", className), children });
|
|
3867
3867
|
}
|
|
3868
3868
|
var CardContent_default = CardContent;
|
|
3869
3869
|
function CardFooter({ children, className }) {
|
|
3870
3870
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3871
3871
|
"div",
|
|
3872
3872
|
{
|
|
3873
|
-
className:
|
|
3873
|
+
className: classNames17__default.default(
|
|
3874
3874
|
"flex items-center gap-3 p-5 border-t border-white/10 text-sm text-gray-400",
|
|
3875
3875
|
className
|
|
3876
3876
|
),
|
|
@@ -3912,7 +3912,7 @@ function GradientAnimation({
|
|
|
3912
3912
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3913
3913
|
"div",
|
|
3914
3914
|
{
|
|
3915
|
-
className:
|
|
3915
|
+
className: classNames17__default.default("absolute inset-0"),
|
|
3916
3916
|
style: {
|
|
3917
3917
|
background: `linear-gradient(${cfg.angle}deg, ${cfg.colors?.join(",")})`,
|
|
3918
3918
|
backgroundSize: cfg.backgroundSize,
|
|
@@ -4058,7 +4058,7 @@ function MotionSurface({
|
|
|
4058
4058
|
}) {
|
|
4059
4059
|
const AnimationComponent = animationVariant === "custom" ? CustomAnimation : animationRegistry[animationVariant];
|
|
4060
4060
|
const OverlayComponent = overlay === "custom" ? CustomOverlay : overlayRegistry[overlay];
|
|
4061
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
4061
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classNames17__default.default("relative overflow-hidden", className), children: [
|
|
4062
4062
|
AnimationComponent && /* @__PURE__ */ jsxRuntime.jsx(AnimationComponent, { config: animationConfig, animated }),
|
|
4063
4063
|
OverlayComponent && /* @__PURE__ */ jsxRuntime.jsx(OverlayComponent, { config: overlayConfig }),
|
|
4064
4064
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative z-10", children })
|
|
@@ -4216,8 +4216,8 @@ var Flag = ({
|
|
|
4216
4216
|
className,
|
|
4217
4217
|
...rest
|
|
4218
4218
|
}) => {
|
|
4219
|
-
const [pos, setPos] =
|
|
4220
|
-
const [showTooltip, setShowTooltip] =
|
|
4219
|
+
const [pos, setPos] = React8.useState({ x: 0, y: 0 });
|
|
4220
|
+
const [showTooltip, setShowTooltip] = React8.useState(false);
|
|
4221
4221
|
const upperCode = code.toUpperCase();
|
|
4222
4222
|
const country = emojiFlags__default.default.countryCode(upperCode);
|
|
4223
4223
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -4421,16 +4421,16 @@ var GraphRenderer = ({
|
|
|
4421
4421
|
width = 1e3,
|
|
4422
4422
|
height = 700
|
|
4423
4423
|
}) => {
|
|
4424
|
-
const [nodes, setNodes] =
|
|
4424
|
+
const [nodes, setNodes] = React8.useState([]);
|
|
4425
4425
|
const edges = data.edges;
|
|
4426
|
-
const simulationRef =
|
|
4427
|
-
const [offset, setOffset] =
|
|
4428
|
-
const isDragging =
|
|
4429
|
-
const lastPos =
|
|
4430
|
-
const nodeMap =
|
|
4426
|
+
const simulationRef = React8.useRef(null);
|
|
4427
|
+
const [offset, setOffset] = React8.useState({ x: 0, y: 0 });
|
|
4428
|
+
const isDragging = React8.useRef(false);
|
|
4429
|
+
const lastPos = React8.useRef({ x: 0, y: 0 });
|
|
4430
|
+
const nodeMap = React8.useMemo(() => {
|
|
4431
4431
|
return new Map(nodes.map((n) => [n.id, n]));
|
|
4432
4432
|
}, [nodes]);
|
|
4433
|
-
|
|
4433
|
+
React8.useEffect(() => {
|
|
4434
4434
|
simulationRef.current?.stop?.();
|
|
4435
4435
|
const positionedNodes = data.nodes.map((n) => ({
|
|
4436
4436
|
...n,
|
|
@@ -4511,13 +4511,13 @@ var Graph = ({
|
|
|
4511
4511
|
}
|
|
4512
4512
|
);
|
|
4513
4513
|
};
|
|
4514
|
-
var CloudinaryContext =
|
|
4514
|
+
var CloudinaryContext = React8.createContext(null);
|
|
4515
4515
|
var CloudinaryProvider = ({
|
|
4516
4516
|
cloudName,
|
|
4517
4517
|
children
|
|
4518
4518
|
}) => /* @__PURE__ */ jsxRuntime.jsx(CloudinaryContext.Provider, { value: { cloudName }, children });
|
|
4519
4519
|
var useCloudinaryConfig = () => {
|
|
4520
|
-
const ctx =
|
|
4520
|
+
const ctx = React8.useContext(CloudinaryContext);
|
|
4521
4521
|
if (!ctx) {
|
|
4522
4522
|
throw new Error(
|
|
4523
4523
|
"CloudinaryProvider is missing. Wrap your app with <CloudinaryProvider />"
|
|
@@ -4968,7 +4968,7 @@ var ListItem = ({
|
|
|
4968
4968
|
children: bullet
|
|
4969
4969
|
}
|
|
4970
4970
|
),
|
|
4971
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-w-0", children: TypographyComponent ?
|
|
4971
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-w-0", children: TypographyComponent ? React8__default.default.cloneElement(
|
|
4972
4972
|
TypographyComponent,
|
|
4973
4973
|
{
|
|
4974
4974
|
className: cn(
|
|
@@ -5002,7 +5002,7 @@ function normalizeItem(item, defaultBulletType) {
|
|
|
5002
5002
|
bulletType: defaultBulletType
|
|
5003
5003
|
};
|
|
5004
5004
|
}
|
|
5005
|
-
if (
|
|
5005
|
+
if (React8__default.default.isValidElement(item)) {
|
|
5006
5006
|
return {
|
|
5007
5007
|
content: item,
|
|
5008
5008
|
bulletType: defaultBulletType
|
|
@@ -5462,7 +5462,7 @@ var Backdrop = ({ children, styles }) => {
|
|
|
5462
5462
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5463
5463
|
"div",
|
|
5464
5464
|
{
|
|
5465
|
-
className:
|
|
5465
|
+
className: classNames17__default.default({
|
|
5466
5466
|
"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
5467
|
[`${styles}`]: styles
|
|
5468
5468
|
}),
|
|
@@ -5687,8 +5687,8 @@ function Table({
|
|
|
5687
5687
|
}) {
|
|
5688
5688
|
const eui = useEUIConfig();
|
|
5689
5689
|
const resolvedShape = shape ?? eui?.config?.global?.shape ?? "square";
|
|
5690
|
-
const [sortKey, setSortKey] =
|
|
5691
|
-
const [sortOrder, setSortOrder] =
|
|
5690
|
+
const [sortKey, setSortKey] = React8.useState(null);
|
|
5691
|
+
const [sortOrder, setSortOrder] = React8.useState("asc");
|
|
5692
5692
|
const toggleSort = (key) => {
|
|
5693
5693
|
if (sortKey === key) {
|
|
5694
5694
|
setSortOrder((prev) => prev === "asc" ? "desc" : "asc");
|
|
@@ -5697,7 +5697,7 @@ function Table({
|
|
|
5697
5697
|
setSortOrder("asc");
|
|
5698
5698
|
}
|
|
5699
5699
|
};
|
|
5700
|
-
const sortedData =
|
|
5700
|
+
const sortedData = React8.useMemo(() => {
|
|
5701
5701
|
if (!sortKey) return data;
|
|
5702
5702
|
return [...data].sort((a, b) => {
|
|
5703
5703
|
const aVal = a[sortKey];
|
|
@@ -5788,8 +5788,8 @@ function Tooltip6({
|
|
|
5788
5788
|
className,
|
|
5789
5789
|
...rest
|
|
5790
5790
|
}) {
|
|
5791
|
-
const [pos, setPos] =
|
|
5792
|
-
|
|
5791
|
+
const [pos, setPos] = React8.useState({ x: 0, y: 0 });
|
|
5792
|
+
React8.useEffect(() => {
|
|
5793
5793
|
if (!show) return;
|
|
5794
5794
|
const handleMove = (e) => {
|
|
5795
5795
|
setPos({ x: e.clientX + offsetX, y: e.clientY + offsetY });
|
|
@@ -5918,8 +5918,8 @@ function CloudinaryVideo({
|
|
|
5918
5918
|
}
|
|
5919
5919
|
var CloudinaryVideo_default = CloudinaryVideo;
|
|
5920
5920
|
var FormObserver = ({ formik, onChange }) => {
|
|
5921
|
-
const prevValuesRef =
|
|
5922
|
-
|
|
5921
|
+
const prevValuesRef = React8.useRef(formik.values);
|
|
5922
|
+
React8.useEffect(() => {
|
|
5923
5923
|
if (!onChange) return;
|
|
5924
5924
|
const currentValues = formik.values;
|
|
5925
5925
|
const prevValues = prevValuesRef.current;
|
|
@@ -5938,7 +5938,7 @@ var FormObserver = ({ formik, onChange }) => {
|
|
|
5938
5938
|
};
|
|
5939
5939
|
var FormObserver_default = FormObserver;
|
|
5940
5940
|
var DirtyObserver = ({ formik, onDirtyChange }) => {
|
|
5941
|
-
|
|
5941
|
+
React8.useEffect(() => {
|
|
5942
5942
|
if (onDirtyChange) {
|
|
5943
5943
|
onDirtyChange(formik.dirty);
|
|
5944
5944
|
}
|
|
@@ -5947,7 +5947,7 @@ var DirtyObserver = ({ formik, onDirtyChange }) => {
|
|
|
5947
5947
|
};
|
|
5948
5948
|
var DirtyObserver_default = DirtyObserver;
|
|
5949
5949
|
var UnsavedChangesGuard = ({ formik, enabled }) => {
|
|
5950
|
-
|
|
5950
|
+
React8.useEffect(() => {
|
|
5951
5951
|
if (!enabled) return;
|
|
5952
5952
|
const handleBeforeUnload = (e) => {
|
|
5953
5953
|
if (!formik.dirty) return;
|
|
@@ -5986,7 +5986,7 @@ var Form = ({
|
|
|
5986
5986
|
/* @__PURE__ */ jsxRuntime.jsx(UnsavedChangesGuard_default, { formik: formik$1, enabled: warnOnUnsavedChanges }),
|
|
5987
5987
|
/* @__PURE__ */ jsxRuntime.jsx(DirtyObserver_default, { formik: formik$1, onDirtyChange }),
|
|
5988
5988
|
/* @__PURE__ */ jsxRuntime.jsx(FormObserver_default, { formik: formik$1, onChange }),
|
|
5989
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
5989
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames17__default.default(styles), children })
|
|
5990
5990
|
] })
|
|
5991
5991
|
}
|
|
5992
5992
|
);
|
|
@@ -6235,17 +6235,17 @@ function useToastTimer({
|
|
|
6235
6235
|
pauseOnHover,
|
|
6236
6236
|
onTimeout
|
|
6237
6237
|
}) {
|
|
6238
|
-
const [isPaused, setIsPaused] =
|
|
6239
|
-
const timeoutRef =
|
|
6240
|
-
const startedAtRef =
|
|
6241
|
-
const remainingRef =
|
|
6242
|
-
const clearTimer =
|
|
6238
|
+
const [isPaused, setIsPaused] = React8.useState(false);
|
|
6239
|
+
const timeoutRef = React8.useRef(null);
|
|
6240
|
+
const startedAtRef = React8.useRef(0);
|
|
6241
|
+
const remainingRef = React8.useRef(typeof duration === "number" ? duration : 0);
|
|
6242
|
+
const clearTimer = React8.useCallback(() => {
|
|
6243
6243
|
if (timeoutRef.current !== null) {
|
|
6244
6244
|
window.clearTimeout(timeoutRef.current);
|
|
6245
6245
|
timeoutRef.current = null;
|
|
6246
6246
|
}
|
|
6247
6247
|
}, []);
|
|
6248
|
-
const startTimer =
|
|
6248
|
+
const startTimer = React8.useCallback(() => {
|
|
6249
6249
|
if (typeof duration !== "number" || duration <= 0) {
|
|
6250
6250
|
return;
|
|
6251
6251
|
}
|
|
@@ -6255,12 +6255,12 @@ function useToastTimer({
|
|
|
6255
6255
|
onTimeout();
|
|
6256
6256
|
}, remainingRef.current);
|
|
6257
6257
|
}, [clearTimer, duration, onTimeout]);
|
|
6258
|
-
|
|
6258
|
+
React8.useEffect(() => {
|
|
6259
6259
|
remainingRef.current = typeof duration === "number" ? duration : 0;
|
|
6260
6260
|
startTimer();
|
|
6261
6261
|
return clearTimer;
|
|
6262
6262
|
}, [clearTimer, duration, startTimer]);
|
|
6263
|
-
const pauseTimer =
|
|
6263
|
+
const pauseTimer = React8.useCallback(() => {
|
|
6264
6264
|
if (!pauseOnHover || typeof duration !== "number") {
|
|
6265
6265
|
return;
|
|
6266
6266
|
}
|
|
@@ -6271,14 +6271,14 @@ function useToastTimer({
|
|
|
6271
6271
|
);
|
|
6272
6272
|
setIsPaused(true);
|
|
6273
6273
|
}, [clearTimer, duration, pauseOnHover]);
|
|
6274
|
-
const resumeTimer =
|
|
6274
|
+
const resumeTimer = React8.useCallback(() => {
|
|
6275
6275
|
if (!pauseOnHover || typeof duration !== "number") {
|
|
6276
6276
|
return;
|
|
6277
6277
|
}
|
|
6278
6278
|
setIsPaused(false);
|
|
6279
6279
|
startTimer();
|
|
6280
6280
|
}, [duration, pauseOnHover, startTimer]);
|
|
6281
|
-
const progressStyle =
|
|
6281
|
+
const progressStyle = React8.useMemo(() => {
|
|
6282
6282
|
if (typeof duration !== "number") {
|
|
6283
6283
|
return void 0;
|
|
6284
6284
|
}
|
|
@@ -6319,7 +6319,7 @@ function ToastItem({
|
|
|
6319
6319
|
const duration = item.duration ?? autoClose;
|
|
6320
6320
|
const variant = toastStatusVariantMap[item.status];
|
|
6321
6321
|
const statusStyles = toastVariantStyles[variant];
|
|
6322
|
-
const dismiss =
|
|
6322
|
+
const dismiss = React8.useCallback(() => {
|
|
6323
6323
|
toastStore.remove(item.id);
|
|
6324
6324
|
}, [item.id]);
|
|
6325
6325
|
const { pauseTimer, resumeTimer, progressStyle } = useToastTimer({
|
|
@@ -6398,16 +6398,16 @@ var Toast = ({
|
|
|
6398
6398
|
...rest
|
|
6399
6399
|
}) => {
|
|
6400
6400
|
const eui = useEUIConfig();
|
|
6401
|
-
const [items, setItems] =
|
|
6401
|
+
const [items, setItems] = React8.useState(() => {
|
|
6402
6402
|
return toastStore.getSnapshot();
|
|
6403
6403
|
});
|
|
6404
|
-
|
|
6404
|
+
React8.useEffect(() => {
|
|
6405
6405
|
return toastStore.subscribe(setItems);
|
|
6406
6406
|
}, []);
|
|
6407
|
-
const safeShape =
|
|
6407
|
+
const safeShape = React8.useMemo(() => {
|
|
6408
6408
|
return normalizeToastShape(shape ?? eui?.config?.global?.shape);
|
|
6409
6409
|
}, [shape, eui?.config?.global?.shape]);
|
|
6410
|
-
const visibleItems =
|
|
6410
|
+
const visibleItems = React8.useMemo(() => {
|
|
6411
6411
|
const orderedItems = newestOnTop ? [...items].reverse() : [...items];
|
|
6412
6412
|
return orderedItems.slice(0, maxToasts);
|
|
6413
6413
|
}, [items, maxToasts, newestOnTop]);
|
|
@@ -6486,18 +6486,80 @@ function sendToast(data = {}) {
|
|
|
6486
6486
|
status: data.status || "success" /* success */
|
|
6487
6487
|
});
|
|
6488
6488
|
}
|
|
6489
|
+
function renderTransitionChild(children, className) {
|
|
6490
|
+
const childCount = React8.Children.count(children);
|
|
6491
|
+
if (childCount !== 1) {
|
|
6492
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children });
|
|
6493
|
+
}
|
|
6494
|
+
const child = React8.Children.only(children);
|
|
6495
|
+
if (!React8__default.default.isValidElement(child)) {
|
|
6496
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: child });
|
|
6497
|
+
}
|
|
6498
|
+
const element = child;
|
|
6499
|
+
return React8__default.default.cloneElement(element, {
|
|
6500
|
+
className: classNames17__default.default(element.props.className, className)
|
|
6501
|
+
});
|
|
6502
|
+
}
|
|
6503
|
+
function TransitionBase({
|
|
6504
|
+
visibility,
|
|
6505
|
+
children,
|
|
6506
|
+
enterClassName,
|
|
6507
|
+
leaveClassName,
|
|
6508
|
+
visibleClassName,
|
|
6509
|
+
hiddenClassName,
|
|
6510
|
+
leaveDuration = 150
|
|
6511
|
+
}) {
|
|
6512
|
+
const [mounted, setMounted] = React8.useState(Boolean(visibility));
|
|
6513
|
+
const [active, setActive] = React8.useState(Boolean(visibility));
|
|
6514
|
+
const frameRef = React8.useRef(null);
|
|
6515
|
+
const timeoutRef = React8.useRef(null);
|
|
6516
|
+
React8.useEffect(() => {
|
|
6517
|
+
if (frameRef.current) {
|
|
6518
|
+
cancelAnimationFrame(frameRef.current);
|
|
6519
|
+
}
|
|
6520
|
+
if (timeoutRef.current) {
|
|
6521
|
+
clearTimeout(timeoutRef.current);
|
|
6522
|
+
}
|
|
6523
|
+
if (visibility) {
|
|
6524
|
+
setMounted(true);
|
|
6525
|
+
frameRef.current = requestAnimationFrame(() => {
|
|
6526
|
+
setActive(true);
|
|
6527
|
+
});
|
|
6528
|
+
return;
|
|
6529
|
+
}
|
|
6530
|
+
setActive(false);
|
|
6531
|
+
timeoutRef.current = setTimeout(() => {
|
|
6532
|
+
setMounted(false);
|
|
6533
|
+
}, leaveDuration);
|
|
6534
|
+
return () => {
|
|
6535
|
+
if (frameRef.current) {
|
|
6536
|
+
cancelAnimationFrame(frameRef.current);
|
|
6537
|
+
}
|
|
6538
|
+
if (timeoutRef.current) {
|
|
6539
|
+
clearTimeout(timeoutRef.current);
|
|
6540
|
+
}
|
|
6541
|
+
};
|
|
6542
|
+
}, [visibility, leaveDuration]);
|
|
6543
|
+
if (!mounted) {
|
|
6544
|
+
return null;
|
|
6545
|
+
}
|
|
6546
|
+
const transitionClassName = classNames17__default.default(
|
|
6547
|
+
visibility ? enterClassName : leaveClassName,
|
|
6548
|
+
active ? visibleClassName : hiddenClassName
|
|
6549
|
+
);
|
|
6550
|
+
return renderTransitionChild(children, transitionClassName);
|
|
6551
|
+
}
|
|
6552
|
+
var TransitionBase_default = TransitionBase;
|
|
6489
6553
|
function TransitionDropdown({ visibility, children }) {
|
|
6490
6554
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6491
|
-
|
|
6555
|
+
TransitionBase_default,
|
|
6492
6556
|
{
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
|
|
6499
|
-
leaveFrom: "transform scale-100 opacity-100",
|
|
6500
|
-
leaveTo: "transform scale-95 opacity-0",
|
|
6557
|
+
visibility: Boolean(visibility),
|
|
6558
|
+
enterClassName: "transition duration-100 ease-out",
|
|
6559
|
+
leaveClassName: "transition duration-50 ease-out",
|
|
6560
|
+
visibleClassName: "transform scale-100 opacity-100",
|
|
6561
|
+
hiddenClassName: "transform scale-95 opacity-0",
|
|
6562
|
+
leaveDuration: 50,
|
|
6501
6563
|
children
|
|
6502
6564
|
}
|
|
6503
6565
|
);
|
|
@@ -6505,16 +6567,14 @@ function TransitionDropdown({ visibility, children }) {
|
|
|
6505
6567
|
var TransitionDropdown_default = TransitionDropdown;
|
|
6506
6568
|
function TransitionFadeIn({ visibility, children }) {
|
|
6507
6569
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6508
|
-
|
|
6570
|
+
TransitionBase_default,
|
|
6509
6571
|
{
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6516
|
-
leaveFrom: "opacity-100",
|
|
6517
|
-
leaveTo: "opacity-0",
|
|
6572
|
+
visibility: Boolean(visibility),
|
|
6573
|
+
enterClassName: "transition-all ease-in-out duration-700 delay-[0ms]",
|
|
6574
|
+
leaveClassName: "transition-all ease-in-out duration-300",
|
|
6575
|
+
visibleClassName: "opacity-100 translate-y-0",
|
|
6576
|
+
hiddenClassName: "opacity-0 translate-y-6",
|
|
6577
|
+
leaveDuration: 300,
|
|
6518
6578
|
children
|
|
6519
6579
|
}
|
|
6520
6580
|
);
|
|
@@ -6522,7 +6582,7 @@ function TransitionFadeIn({ visibility, children }) {
|
|
|
6522
6582
|
var TransitionFadeIn_default = TransitionFadeIn;
|
|
6523
6583
|
|
|
6524
6584
|
// src/components/feedback/transition/index.tsx
|
|
6525
|
-
var
|
|
6585
|
+
var Transition2 = {
|
|
6526
6586
|
TransitionDropdown: TransitionDropdown_default,
|
|
6527
6587
|
TransitionFadeIn: TransitionFadeIn_default
|
|
6528
6588
|
};
|
|
@@ -6540,10 +6600,10 @@ function FormResponse({
|
|
|
6540
6600
|
size = "md",
|
|
6541
6601
|
styles
|
|
6542
6602
|
}) {
|
|
6543
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6603
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Transition2.TransitionDropdown, { visibility: text ? true : false, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6544
6604
|
"div",
|
|
6545
6605
|
{
|
|
6546
|
-
className:
|
|
6606
|
+
className: classNames17__default.default({
|
|
6547
6607
|
"font-poppins font-light text-sm": true,
|
|
6548
6608
|
[`${variantsLite[variant]}`]: variant,
|
|
6549
6609
|
[`${shapes[shape]}`]: shape,
|
|
@@ -6610,17 +6670,17 @@ function YoutubeVideo({
|
|
|
6610
6670
|
) });
|
|
6611
6671
|
}
|
|
6612
6672
|
var YoutubeVideo_default = YoutubeVideo;
|
|
6613
|
-
var ThemeContext =
|
|
6673
|
+
var ThemeContext = React8.createContext(
|
|
6614
6674
|
void 0
|
|
6615
6675
|
);
|
|
6616
6676
|
var ThemeProvider = ({
|
|
6617
6677
|
defaultTheme = "dark",
|
|
6618
6678
|
children
|
|
6619
6679
|
}) => {
|
|
6620
|
-
const [theme, setTheme] =
|
|
6680
|
+
const [theme, setTheme] = React8.useState(() => {
|
|
6621
6681
|
return localStorage.getItem("theme") || defaultTheme;
|
|
6622
6682
|
});
|
|
6623
|
-
|
|
6683
|
+
React8.useEffect(() => {
|
|
6624
6684
|
if (theme === "dark") {
|
|
6625
6685
|
document.documentElement.classList.add("dark");
|
|
6626
6686
|
} else {
|
|
@@ -6634,7 +6694,7 @@ var ThemeProvider = ({
|
|
|
6634
6694
|
return /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value: { theme, setTheme, toggleTheme }, children });
|
|
6635
6695
|
};
|
|
6636
6696
|
var ThemeSwitch = () => {
|
|
6637
|
-
const themeContext =
|
|
6697
|
+
const themeContext = React8.useContext(ThemeContext);
|
|
6638
6698
|
if (!themeContext) return null;
|
|
6639
6699
|
const { theme, toggleTheme } = themeContext;
|
|
6640
6700
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -6660,7 +6720,7 @@ var ThemeSwitch = () => {
|
|
|
6660
6720
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6661
6721
|
"div",
|
|
6662
6722
|
{
|
|
6663
|
-
className:
|
|
6723
|
+
className: classNames17__default.default(
|
|
6664
6724
|
"w-6 h-6 bg-white dark:bg-gray-600 rounded-full shadow-md transition-transform duration-300",
|
|
6665
6725
|
theme === "dark" ? "translate-x-8" : "translate-x-0"
|
|
6666
6726
|
)
|
|
@@ -6696,7 +6756,7 @@ var ShapeSwitch = () => {
|
|
|
6696
6756
|
|
|
6697
6757
|
// src/hooks/theme/useCurrentTheme.ts
|
|
6698
6758
|
var useCurrentTheme = () => {
|
|
6699
|
-
const context =
|
|
6759
|
+
const context = React8.useContext(ThemeContext);
|
|
6700
6760
|
if (!context) {
|
|
6701
6761
|
throw new Error("useCurrentTheme must be used within a ThemeProvider");
|
|
6702
6762
|
}
|
|
@@ -18039,7 +18099,7 @@ function WorldMap({
|
|
|
18039
18099
|
}
|
|
18040
18100
|
};
|
|
18041
18101
|
const mode = isDarkMode ? mapStyles.dark : mapStyles.light;
|
|
18042
|
-
const resolvedData =
|
|
18102
|
+
const resolvedData = React8.useMemo(() => {
|
|
18043
18103
|
return data.map((item) => {
|
|
18044
18104
|
const c = COUNTRIES.find((x) => x.code === item.code);
|
|
18045
18105
|
if (!c) return null;
|
|
@@ -18051,8 +18111,8 @@ function WorldMap({
|
|
|
18051
18111
|
}).filter(Boolean);
|
|
18052
18112
|
}, [data]);
|
|
18053
18113
|
const maxValue = resolvedData.length > 0 ? Math.max(...resolvedData.map((d) => d.value)) : 0;
|
|
18054
|
-
const [showTooltip, setShowTooltip] =
|
|
18055
|
-
const [tooltipContent, setTooltipContent] =
|
|
18114
|
+
const [showTooltip, setShowTooltip] = React8.useState(false);
|
|
18115
|
+
const [tooltipContent, setTooltipContent] = React8.useState(null);
|
|
18056
18116
|
const handleMouseMove = (_e, point) => {
|
|
18057
18117
|
setTooltipContent(
|
|
18058
18118
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
@@ -18138,7 +18198,7 @@ function Button({
|
|
|
18138
18198
|
}) {
|
|
18139
18199
|
const eui = useEUIConfig();
|
|
18140
18200
|
const resolvedShape = shape ?? eui?.config?.global?.shape ?? "square";
|
|
18141
|
-
const btnRef =
|
|
18201
|
+
const btnRef = React8.useRef(null);
|
|
18142
18202
|
const variantStyles = resolveAppearanceStyles({
|
|
18143
18203
|
appearance,
|
|
18144
18204
|
variant,
|
|
@@ -18201,14 +18261,14 @@ function Button({
|
|
|
18201
18261
|
var Button_default = Button;
|
|
18202
18262
|
function InputResponse({
|
|
18203
18263
|
name,
|
|
18204
|
-
visibility,
|
|
18264
|
+
visibility = false,
|
|
18205
18265
|
variant = "default",
|
|
18206
18266
|
styles
|
|
18207
18267
|
}) {
|
|
18208
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18268
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Transition2.TransitionDropdown, { visibility, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18209
18269
|
"div",
|
|
18210
18270
|
{
|
|
18211
|
-
className:
|
|
18271
|
+
className: classNames17__default.default({
|
|
18212
18272
|
"font-medium text-sm py-1 px-2": true,
|
|
18213
18273
|
[`${textVariants[variant]}`]: variant,
|
|
18214
18274
|
"transition-all ease-in-out": true,
|
|
@@ -18223,7 +18283,7 @@ function InputLabel({ text, children, styles }) {
|
|
|
18223
18283
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18224
18284
|
"label",
|
|
18225
18285
|
{
|
|
18226
|
-
className:
|
|
18286
|
+
className: classNames17__default.default({
|
|
18227
18287
|
"px-0 eui-text-sm text-[13.5px] pointer-events-none select-none": true,
|
|
18228
18288
|
"transition-all ease-in-out": true,
|
|
18229
18289
|
[`${styles}`]: styles
|
|
@@ -18239,7 +18299,7 @@ var toggleType = (visibility) => {
|
|
|
18239
18299
|
var PasswordVisibilityToggler = ({
|
|
18240
18300
|
onClick
|
|
18241
18301
|
}) => {
|
|
18242
|
-
const [passwordVisibility, setPasswordVisibilty] =
|
|
18302
|
+
const [passwordVisibility, setPasswordVisibilty] = React8.useState(false);
|
|
18243
18303
|
const handleOnClick = (visibility) => {
|
|
18244
18304
|
onClick(visibility);
|
|
18245
18305
|
setPasswordVisibilty(visibility);
|
|
@@ -18264,7 +18324,7 @@ var Input = ({
|
|
|
18264
18324
|
const eui = useEUIConfig();
|
|
18265
18325
|
const resolvedShape = shape ?? eui?.config?.global?.shape ?? "square";
|
|
18266
18326
|
const [field, meta] = formik.useField(props);
|
|
18267
|
-
const [passwordVisibility, setPasswordVisibilty] =
|
|
18327
|
+
const [passwordVisibility, setPasswordVisibilty] = React8.useState(false);
|
|
18268
18328
|
const inputType = type === "password" ? toggleType(passwordVisibility) : type;
|
|
18269
18329
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full", children: [
|
|
18270
18330
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -18275,7 +18335,7 @@ var Input = ({
|
|
|
18275
18335
|
...field,
|
|
18276
18336
|
...props,
|
|
18277
18337
|
placeholder,
|
|
18278
|
-
className:
|
|
18338
|
+
className: classNames17__default.default({
|
|
18279
18339
|
"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
18340
|
"border-eui-primary-400 focus:border-eui-secondary-500": !(meta.touched && meta.error),
|
|
18281
18341
|
"border-eui-danger-500": meta.touched && meta.error,
|
|
@@ -18309,7 +18369,7 @@ var InputFile = ({
|
|
|
18309
18369
|
styles,
|
|
18310
18370
|
...props
|
|
18311
18371
|
}) => {
|
|
18312
|
-
const fileInputRef =
|
|
18372
|
+
const fileInputRef = React8.useRef(null);
|
|
18313
18373
|
const [field, meta, helpers] = formik.useField(props);
|
|
18314
18374
|
const handleFileChange = (e) => {
|
|
18315
18375
|
const file = e.target.files?.[0] || null;
|
|
@@ -18320,7 +18380,7 @@ var InputFile = ({
|
|
|
18320
18380
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18321
18381
|
"div",
|
|
18322
18382
|
{
|
|
18323
|
-
className:
|
|
18383
|
+
className: classNames17__default.default(
|
|
18324
18384
|
"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
18385
|
{
|
|
18326
18386
|
"border-eui-primary-400 focus:border-eui-secondary-500": !(meta.touched && meta.error),
|
|
@@ -18346,7 +18406,7 @@ var InputFile = ({
|
|
|
18346
18406
|
InputLabel_default,
|
|
18347
18407
|
{
|
|
18348
18408
|
text: placeholder,
|
|
18349
|
-
styles:
|
|
18409
|
+
styles: classNames17__default.default({
|
|
18350
18410
|
"absolute left-2 eui-text-sm peer-placeholder-shown:text-base peer-placeholder-shown:top-3 pointer-events-none": true,
|
|
18351
18411
|
"top-[0.7px]": showFloatingLabel,
|
|
18352
18412
|
"top-[13px] text-base": !showFloatingLabel
|
|
@@ -18399,7 +18459,7 @@ var InputList = ({ name, placeholder, shape }) => {
|
|
|
18399
18459
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsxRuntime.jsx(formik.FieldArray, { name, children: ({ push, remove, move }) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
18400
18460
|
"div",
|
|
18401
18461
|
{
|
|
18402
|
-
className:
|
|
18462
|
+
className: classNames17__default.default(
|
|
18403
18463
|
"flex w-full flex-col space-y-2 bg-eui-primary-300/10",
|
|
18404
18464
|
shapes[resolvedShape]
|
|
18405
18465
|
),
|
|
@@ -18428,7 +18488,7 @@ var InputList = ({ name, placeholder, shape }) => {
|
|
|
18428
18488
|
ref: provided2.innerRef,
|
|
18429
18489
|
...draggableProps,
|
|
18430
18490
|
style: draggableStyle,
|
|
18431
|
-
className:
|
|
18491
|
+
className: classNames17__default.default(
|
|
18432
18492
|
"flex items-center space-x-2 bg-eui-primary-300/10 p-2",
|
|
18433
18493
|
shapes[resolvedShape]
|
|
18434
18494
|
),
|
|
@@ -18439,7 +18499,7 @@ var InputList = ({ name, placeholder, shape }) => {
|
|
|
18439
18499
|
{
|
|
18440
18500
|
name: `${name}[${index}]`,
|
|
18441
18501
|
placeholder: `Item ${index + 1}`,
|
|
18442
|
-
className:
|
|
18502
|
+
className: classNames17__default.default(
|
|
18443
18503
|
"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
18504
|
shapes[resolvedShape],
|
|
18445
18505
|
hasItemError ? "border-eui-danger-500" : "border-eui-primary-400 focus:border-eui-secondary-500"
|
|
@@ -18535,7 +18595,7 @@ var InputListGroup = ({
|
|
|
18535
18595
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
18536
18596
|
"div",
|
|
18537
18597
|
{
|
|
18538
|
-
className:
|
|
18598
|
+
className: classNames17__default.default(
|
|
18539
18599
|
"flex flex-col gap-2 bg-eui-primary-300/10 p-3",
|
|
18540
18600
|
shapes[resolvedShape]
|
|
18541
18601
|
),
|
|
@@ -18547,7 +18607,7 @@ var InputListGroup = ({
|
|
|
18547
18607
|
{
|
|
18548
18608
|
name: `${name}[${groupIndex}].name`,
|
|
18549
18609
|
placeholder: `Group ${groupIndex + 1}`,
|
|
18550
|
-
className:
|
|
18610
|
+
className: classNames17__default.default(
|
|
18551
18611
|
"h-[40px] w-full border bg-eui-primary-300/10 px-3 py-2 text-md focus:outline-none",
|
|
18552
18612
|
shapes[resolvedShape],
|
|
18553
18613
|
"border-eui-primary-400 focus:border-eui-secondary-500"
|
|
@@ -18578,7 +18638,7 @@ var InputListGroup = ({
|
|
|
18578
18638
|
{
|
|
18579
18639
|
ref: provided.innerRef,
|
|
18580
18640
|
...provided.droppableProps,
|
|
18581
|
-
className:
|
|
18641
|
+
className: classNames17__default.default(
|
|
18582
18642
|
"space-y-2 bg-eui-primary-300/10 p-2",
|
|
18583
18643
|
shapes[resolvedShape]
|
|
18584
18644
|
),
|
|
@@ -18598,7 +18658,7 @@ var InputListGroup = ({
|
|
|
18598
18658
|
ref: provided2.innerRef,
|
|
18599
18659
|
...draggableProps,
|
|
18600
18660
|
style: draggableStyle,
|
|
18601
|
-
className:
|
|
18661
|
+
className: classNames17__default.default(
|
|
18602
18662
|
"flex items-center gap-2 bg-eui-primary-300/10 p-2",
|
|
18603
18663
|
shapes[resolvedShape]
|
|
18604
18664
|
),
|
|
@@ -18609,7 +18669,7 @@ var InputListGroup = ({
|
|
|
18609
18669
|
{
|
|
18610
18670
|
name: `${itemsFieldName}[${itemIndex}]`,
|
|
18611
18671
|
placeholder: `Item ${itemIndex + 1}`,
|
|
18612
|
-
className:
|
|
18672
|
+
className: classNames17__default.default(
|
|
18613
18673
|
"h-[40px] w-full border bg-eui-primary-300/10 px-3 py-2 text-md focus:outline-none",
|
|
18614
18674
|
shapes[resolvedShape],
|
|
18615
18675
|
"border-eui-primary-400 focus:border-eui-secondary-500"
|
|
@@ -18823,7 +18883,7 @@ var DateSelector = ({
|
|
|
18823
18883
|
...field,
|
|
18824
18884
|
...props,
|
|
18825
18885
|
placeholder,
|
|
18826
|
-
className:
|
|
18886
|
+
className: classNames17__default.default({
|
|
18827
18887
|
"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
18888
|
"border-eui-danger-500": meta.touched && meta.error,
|
|
18829
18889
|
"transition-all ease-in-out": true,
|
|
@@ -18849,7 +18909,7 @@ function ImageView({ imageUrl, secure = true, alt = "image" }) {
|
|
|
18849
18909
|
) }) });
|
|
18850
18910
|
}
|
|
18851
18911
|
var ImageView_default = ImageView;
|
|
18852
|
-
var ImageInput =
|
|
18912
|
+
var ImageInput = React8.forwardRef(
|
|
18853
18913
|
({
|
|
18854
18914
|
title = "Upload Image",
|
|
18855
18915
|
uploadDir = "eg-frontend-admin-temp",
|
|
@@ -18861,10 +18921,10 @@ var ImageInput = React4.forwardRef(
|
|
|
18861
18921
|
const [field, meta, helpers] = formik.useField(props);
|
|
18862
18922
|
const { value: imageUrl } = field;
|
|
18863
18923
|
const { setValue } = helpers;
|
|
18864
|
-
const [image, setImage] =
|
|
18865
|
-
const [url, setUrl] =
|
|
18866
|
-
const [loading, setLoading] =
|
|
18867
|
-
const [preview, setPreview] =
|
|
18924
|
+
const [image, setImage] = React8.useState(null);
|
|
18925
|
+
const [url, setUrl] = React8.useState(imageUrl);
|
|
18926
|
+
const [loading, setLoading] = React8.useState(false);
|
|
18927
|
+
const [preview, setPreview] = React8.useState(null);
|
|
18868
18928
|
const uploadImage = async () => {
|
|
18869
18929
|
if (!image) return;
|
|
18870
18930
|
setLoading(true);
|
|
@@ -18910,10 +18970,10 @@ var ImageInput = React4.forwardRef(
|
|
|
18910
18970
|
if (!disableSetValue) setValue("");
|
|
18911
18971
|
setLoading(false);
|
|
18912
18972
|
};
|
|
18913
|
-
|
|
18973
|
+
React8.useImperativeHandle(ref, () => ({
|
|
18914
18974
|
handleResetClick
|
|
18915
18975
|
}));
|
|
18916
|
-
|
|
18976
|
+
React8.useEffect(() => {
|
|
18917
18977
|
if (!disableSetValue) setValue(url);
|
|
18918
18978
|
}, [url, setValue, disableSetValue]);
|
|
18919
18979
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full", children: [
|
|
@@ -18932,7 +18992,7 @@ var ImageInput = React4.forwardRef(
|
|
|
18932
18992
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
18933
18993
|
"label",
|
|
18934
18994
|
{
|
|
18935
|
-
className:
|
|
18995
|
+
className: classNames17__default.default({
|
|
18936
18996
|
"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
18997
|
"hover:cursor-pointer hover:border-solid hover:border-gray-600 hover:bg-gray-900/80": true,
|
|
18938
18998
|
"transition-all ease-in-out duration-150": true
|
|
@@ -18998,14 +19058,14 @@ function MultiImageInput({
|
|
|
18998
19058
|
const [field, meta, helpers] = formik.useField(props);
|
|
18999
19059
|
const { value: imageUrls } = field;
|
|
19000
19060
|
const { setValue } = helpers;
|
|
19001
|
-
const imageInputRef =
|
|
19061
|
+
const imageInputRef = React8.useRef(null);
|
|
19002
19062
|
const onValueChanged = (url) => {
|
|
19003
19063
|
setValue([...imageUrls, url]);
|
|
19004
19064
|
if (imageInputRef.current) {
|
|
19005
19065
|
imageInputRef.current.handleResetClick();
|
|
19006
19066
|
}
|
|
19007
19067
|
};
|
|
19008
|
-
|
|
19068
|
+
React8.useEffect(() => {
|
|
19009
19069
|
}, [imageUrls]);
|
|
19010
19070
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
19011
19071
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row flex-wrap gap-5 w-ful", children: [
|
|
@@ -19049,7 +19109,7 @@ function Radio({
|
|
|
19049
19109
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
19050
19110
|
"div",
|
|
19051
19111
|
{
|
|
19052
|
-
className:
|
|
19112
|
+
className: classNames17__default.default({
|
|
19053
19113
|
"flex flex-row gap-2 items-center mx-1 my-2": true
|
|
19054
19114
|
}),
|
|
19055
19115
|
children: [
|
|
@@ -19062,7 +19122,7 @@ function Radio({
|
|
|
19062
19122
|
...props,
|
|
19063
19123
|
value: option.value,
|
|
19064
19124
|
checked: field2.value === option.value,
|
|
19065
|
-
className:
|
|
19125
|
+
className: classNames17__default.default({
|
|
19066
19126
|
"appearance-none w-4 h-4 border-2 border-eui-primary-400 rounded-full cursor-pointer transition-all duration-300": true,
|
|
19067
19127
|
// base radio button styles
|
|
19068
19128
|
"checked:bg-eui-secondary-700 checked:border-eui-primary-400": field2.value === option.value
|
|
@@ -19074,7 +19134,7 @@ function Radio({
|
|
|
19074
19134
|
"label",
|
|
19075
19135
|
{
|
|
19076
19136
|
htmlFor: option.value,
|
|
19077
|
-
className:
|
|
19137
|
+
className: classNames17__default.default({
|
|
19078
19138
|
"eui-text-md text-sm": true
|
|
19079
19139
|
}),
|
|
19080
19140
|
children: option.label
|
|
@@ -19105,9 +19165,9 @@ function StarRatingInput({
|
|
|
19105
19165
|
const { name } = props;
|
|
19106
19166
|
const [field, meta] = formik.useField(props);
|
|
19107
19167
|
const formikContext = formik.useFormikContext();
|
|
19108
|
-
const [rating, setRating] =
|
|
19109
|
-
const [hover, setHover] =
|
|
19110
|
-
|
|
19168
|
+
const [rating, setRating] = React8.useState(Number(field.value) || 0);
|
|
19169
|
+
const [hover, setHover] = React8.useState(null);
|
|
19170
|
+
React8.useEffect(() => {
|
|
19111
19171
|
setRating(Number(field.value));
|
|
19112
19172
|
}, [field.value]);
|
|
19113
19173
|
const handleOnClick = (index) => {
|
|
@@ -19117,7 +19177,7 @@ function StarRatingInput({
|
|
|
19117
19177
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
19118
19178
|
"div",
|
|
19119
19179
|
{
|
|
19120
|
-
className:
|
|
19180
|
+
className: classNames17__default.default({
|
|
19121
19181
|
"inline-flex gap-[4px] text-[20px]": true,
|
|
19122
19182
|
[`${styles}`]: styles
|
|
19123
19183
|
}),
|
|
@@ -19130,7 +19190,7 @@ function StarRatingInput({
|
|
|
19130
19190
|
onClick: () => handleOnClick(index),
|
|
19131
19191
|
onMouseEnter: () => setHover(index),
|
|
19132
19192
|
onMouseLeave: () => setHover(null),
|
|
19133
|
-
className:
|
|
19193
|
+
className: classNames17__default.default({
|
|
19134
19194
|
"text-yellow-600": index <= (hover ?? rating - 1),
|
|
19135
19195
|
"text-gray-400": index > (hover ?? rating - 1)
|
|
19136
19196
|
}),
|
|
@@ -19174,7 +19234,7 @@ function Select({
|
|
|
19174
19234
|
{
|
|
19175
19235
|
as: "select",
|
|
19176
19236
|
...props,
|
|
19177
|
-
className:
|
|
19237
|
+
className: classNames17__default.default({
|
|
19178
19238
|
"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
19239
|
"border-eui-primary-400": !(meta.touched && meta.error),
|
|
19180
19240
|
"border-red-500": meta.touched && meta.error,
|
|
@@ -19226,7 +19286,7 @@ function Switch({
|
|
|
19226
19286
|
"div",
|
|
19227
19287
|
{
|
|
19228
19288
|
onClick: () => helpers.setValue(!field.value),
|
|
19229
|
-
className:
|
|
19289
|
+
className: classNames17__default.default(
|
|
19230
19290
|
"w-11 h-6 bg-gray-200 peer-focus:outline-none rounded-full peer dark:bg-eui-dark-100",
|
|
19231
19291
|
"peer-checked:after:translate-x-full peer-checked:after:border-white",
|
|
19232
19292
|
"after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white",
|
|
@@ -19256,7 +19316,7 @@ function Tags({
|
|
|
19256
19316
|
...props
|
|
19257
19317
|
}) {
|
|
19258
19318
|
const [field, meta, helpers] = formik.useField({ ...props });
|
|
19259
|
-
const [input, setInput] =
|
|
19319
|
+
const [input, setInput] = React8.useState("");
|
|
19260
19320
|
const handleAddTag = () => {
|
|
19261
19321
|
const trimmed = input.trim();
|
|
19262
19322
|
if (trimmed && !field.value.includes(trimmed) && field.value.length < limit) {
|
|
@@ -19283,7 +19343,7 @@ function Tags({
|
|
|
19283
19343
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
19284
19344
|
"div",
|
|
19285
19345
|
{
|
|
19286
|
-
className:
|
|
19346
|
+
className: classNames17__default.default(
|
|
19287
19347
|
"border rounded-sm flex flex-wrap items-center gap-2 px-2 pt-2 pb-6 min-h-[3rem]",
|
|
19288
19348
|
{
|
|
19289
19349
|
"bg-eui-primary-300/10 eui-text-md": true,
|
|
@@ -19331,7 +19391,7 @@ function Tags({
|
|
|
19331
19391
|
InputLabel_default,
|
|
19332
19392
|
{
|
|
19333
19393
|
text: placeholder,
|
|
19334
|
-
styles:
|
|
19394
|
+
styles: classNames17__default.default(
|
|
19335
19395
|
"absolute left-2 transition-all pointer-events-none text-eui-dark-200",
|
|
19336
19396
|
input.length > 0 || field.value.length > 0 ? "top-[2px] text-[13.5px]" : "top-3 text-base"
|
|
19337
19397
|
)
|
|
@@ -19372,7 +19432,7 @@ function TextArea({
|
|
|
19372
19432
|
as: "textarea",
|
|
19373
19433
|
...field,
|
|
19374
19434
|
...props,
|
|
19375
|
-
className:
|
|
19435
|
+
className: classNames17__default.default({
|
|
19376
19436
|
"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
19437
|
"transition-all ease-in-out": true,
|
|
19378
19438
|
"border-eui-primary-400 focus:border-eui-secondary-500": !(meta.touched && meta.error),
|
|
@@ -19386,7 +19446,7 @@ function TextArea({
|
|
|
19386
19446
|
InputLabel_default,
|
|
19387
19447
|
{
|
|
19388
19448
|
text: placeholder,
|
|
19389
|
-
styles:
|
|
19449
|
+
styles: classNames17__default.default(
|
|
19390
19450
|
"absolute left-2 transition-all pointer-events-none text-eui-dark-200",
|
|
19391
19451
|
field.value ? "top-[2px] text-[13.5px]" : "top-3 text-base"
|
|
19392
19452
|
)
|
|
@@ -19417,7 +19477,7 @@ function ContentArea({
|
|
|
19417
19477
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19418
19478
|
"div",
|
|
19419
19479
|
{
|
|
19420
|
-
className:
|
|
19480
|
+
className: classNames17__default.default({
|
|
19421
19481
|
"min-h-screen h-full w-full py-3 px-5": true,
|
|
19422
19482
|
"py-3 px-5": !enablePadding,
|
|
19423
19483
|
"py-3 px-5 lg:px-[150px]": enablePadding,
|
|
@@ -19433,7 +19493,7 @@ function FlexCol({ children, gap = 3, styles }) {
|
|
|
19433
19493
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19434
19494
|
"div",
|
|
19435
19495
|
{
|
|
19436
|
-
className:
|
|
19496
|
+
className: classNames17__default.default({
|
|
19437
19497
|
[`flex flex-col gap-${gap}`]: true,
|
|
19438
19498
|
[`${styles}`]: styles
|
|
19439
19499
|
}),
|
|
@@ -19446,7 +19506,7 @@ function FlexRow({ children, gap = 3, styles }) {
|
|
|
19446
19506
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19447
19507
|
"div",
|
|
19448
19508
|
{
|
|
19449
|
-
className:
|
|
19509
|
+
className: classNames17__default.default({
|
|
19450
19510
|
[`flex flex-row gap-${gap}`]: true,
|
|
19451
19511
|
[`${styles}`]: styles
|
|
19452
19512
|
}),
|
|
@@ -19465,7 +19525,7 @@ function Grid({ children, styles }) {
|
|
|
19465
19525
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19466
19526
|
"div",
|
|
19467
19527
|
{
|
|
19468
|
-
className:
|
|
19528
|
+
className: classNames17__default.default({
|
|
19469
19529
|
[`grid`]: true,
|
|
19470
19530
|
[`${styles}`]: styles
|
|
19471
19531
|
}),
|
|
@@ -19482,7 +19542,7 @@ var Layout = ({
|
|
|
19482
19542
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19483
19543
|
"div",
|
|
19484
19544
|
{
|
|
19485
|
-
className:
|
|
19545
|
+
className: classNames17__default.default({
|
|
19486
19546
|
// "flex h-full w-screen bg-gray-100 overflow-auto": true,
|
|
19487
19547
|
"flex bg-eui-light-600": true,
|
|
19488
19548
|
"flex-col": flexDirection === "vertical",
|
|
@@ -19501,7 +19561,7 @@ var Header = ({
|
|
|
19501
19561
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19502
19562
|
"div",
|
|
19503
19563
|
{
|
|
19504
|
-
className:
|
|
19564
|
+
className: classNames17__default.default({
|
|
19505
19565
|
static: position === "static",
|
|
19506
19566
|
fixed: position === "fixed",
|
|
19507
19567
|
sticky: position === "sticky",
|
|
@@ -19520,8 +19580,8 @@ var Header = ({
|
|
|
19520
19580
|
);
|
|
19521
19581
|
};
|
|
19522
19582
|
var useIsMobile = (breakpoint = 768) => {
|
|
19523
|
-
const [isMobile, setIsMobile] =
|
|
19524
|
-
|
|
19583
|
+
const [isMobile, setIsMobile] = React8.useState(window.innerWidth < breakpoint);
|
|
19584
|
+
React8.useEffect(() => {
|
|
19525
19585
|
const handleResize = () => {
|
|
19526
19586
|
setIsMobile(window.innerWidth < breakpoint);
|
|
19527
19587
|
};
|
|
@@ -19541,7 +19601,7 @@ var Content = ({
|
|
|
19541
19601
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19542
19602
|
"div",
|
|
19543
19603
|
{
|
|
19544
|
-
className:
|
|
19604
|
+
className: classNames17__default.default({
|
|
19545
19605
|
"w-full min-h-screen transition-all duration-200 eui-bg-sm": true,
|
|
19546
19606
|
"md:pl-[300px]": !overlayedSidebar && sidebarVisible && !isMobile,
|
|
19547
19607
|
// Shift when sidebar is open (desktop)
|
|
@@ -19557,7 +19617,7 @@ var Footer = ({ children, styles }) => {
|
|
|
19557
19617
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19558
19618
|
"div",
|
|
19559
19619
|
{
|
|
19560
|
-
className:
|
|
19620
|
+
className: classNames17__default.default({
|
|
19561
19621
|
"bottom-0 w-full h-fit": true,
|
|
19562
19622
|
"border-t border-eui-dark-500/40 dark:border-eui-secondary-800 eui-bg-md": !styles,
|
|
19563
19623
|
[`${styles}`]: styles
|
|
@@ -19631,7 +19691,7 @@ function BlockGroup({
|
|
|
19631
19691
|
}
|
|
19632
19692
|
var BlockGroup_default = BlockGroup;
|
|
19633
19693
|
var useTheme = () => {
|
|
19634
|
-
const context =
|
|
19694
|
+
const context = React8.useContext(ThemeContext);
|
|
19635
19695
|
if (!context) {
|
|
19636
19696
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
19637
19697
|
}
|
|
@@ -19645,7 +19705,7 @@ function MarkdownEditor({
|
|
|
19645
19705
|
const [field, meta, helpers] = formik.useField(props);
|
|
19646
19706
|
const { theme } = useTheme_default();
|
|
19647
19707
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
19648
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
19708
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames17__default.default(theme === "dark" ? "dark" : "", styles), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
19649
19709
|
editor.MDXEditor,
|
|
19650
19710
|
{
|
|
19651
19711
|
markdown: field.value,
|
|
@@ -19693,11 +19753,11 @@ function MarkdownEditor({
|
|
|
19693
19753
|
] });
|
|
19694
19754
|
}
|
|
19695
19755
|
var MarkdownEditor_default = MarkdownEditor;
|
|
19696
|
-
var MarkdownContext =
|
|
19756
|
+
var MarkdownContext = React8.createContext(null);
|
|
19697
19757
|
|
|
19698
19758
|
// src/components/markdown/hooks/useMarkdown.tsx
|
|
19699
19759
|
function useMarkdown() {
|
|
19700
|
-
return
|
|
19760
|
+
return React8.useContext(MarkdownContext);
|
|
19701
19761
|
}
|
|
19702
19762
|
|
|
19703
19763
|
// src/components/markdown/utils/generateHeadingNumbers.ts
|
|
@@ -19748,7 +19808,7 @@ function MarkdownTOC({ title = "Table of Contents" }) {
|
|
|
19748
19808
|
"button",
|
|
19749
19809
|
{
|
|
19750
19810
|
onClick: () => scrollToHeading(heading.id),
|
|
19751
|
-
className:
|
|
19811
|
+
className: classNames17__default.default(
|
|
19752
19812
|
"block w-full text-left text-sm transition-all ease-in-out duration-150",
|
|
19753
19813
|
"hover:text-primary",
|
|
19754
19814
|
activeHeading === heading.id ? "text-primary font-semibold underline" : "text-gray-500 dark:text-gray-400"
|
|
@@ -19772,7 +19832,7 @@ function MarkdownViewer({ value }) {
|
|
|
19772
19832
|
const markdown = value ?? context?.markdown ?? "";
|
|
19773
19833
|
const headings = context?.headings ?? [];
|
|
19774
19834
|
const setActiveHeading = context?.setActiveHeading;
|
|
19775
|
-
|
|
19835
|
+
React8.useEffect(() => {
|
|
19776
19836
|
const timeout = setTimeout(() => {
|
|
19777
19837
|
headings.forEach((heading) => {
|
|
19778
19838
|
const headingEls = document.querySelectorAll("h1,h2,h3,h4,h5,h6");
|
|
@@ -19877,8 +19937,8 @@ function extractHeadings(markdown) {
|
|
|
19877
19937
|
});
|
|
19878
19938
|
}
|
|
19879
19939
|
function MarkdownProvider({ markdown, children }) {
|
|
19880
|
-
const [activeHeading, setActiveHeading] =
|
|
19881
|
-
const headings =
|
|
19940
|
+
const [activeHeading, setActiveHeading] = React8.useState("");
|
|
19941
|
+
const headings = React8.useMemo(() => extractHeadings(markdown), [markdown]);
|
|
19882
19942
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19883
19943
|
MarkdownContext.Provider,
|
|
19884
19944
|
{
|
|
@@ -19904,7 +19964,7 @@ function BreadcrumbItem({
|
|
|
19904
19964
|
{
|
|
19905
19965
|
href,
|
|
19906
19966
|
onClick,
|
|
19907
|
-
className:
|
|
19967
|
+
className: classNames17__default.default({
|
|
19908
19968
|
"text-lg font-semibold": true,
|
|
19909
19969
|
"text-gray-400 hover:text-gray-600 cursor-pointer": !active,
|
|
19910
19970
|
"text-eui-light-800": active,
|
|
@@ -19951,7 +20011,7 @@ var Breadcrumb = ({
|
|
|
19951
20011
|
const { config } = useEUIConfig();
|
|
19952
20012
|
const pathname = currentPath || (typeof window !== "undefined" ? window.location.pathname : "/");
|
|
19953
20013
|
const resolvedRoutes = routes || config?.routes || [];
|
|
19954
|
-
const resolvedData =
|
|
20014
|
+
const resolvedData = React8.useMemo(() => {
|
|
19955
20015
|
if (resolvedRoutes && resolvedRoutes.length > 0) {
|
|
19956
20016
|
return buildFromRoutes(resolvedRoutes, pathname);
|
|
19957
20017
|
}
|
|
@@ -19968,7 +20028,7 @@ var Breadcrumb = ({
|
|
|
19968
20028
|
navigate(item.href);
|
|
19969
20029
|
}
|
|
19970
20030
|
};
|
|
19971
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
20031
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React8__default.default.Fragment, { children: [
|
|
19972
20032
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
19973
20033
|
BreadcrumbItem_default,
|
|
19974
20034
|
{
|
|
@@ -19981,7 +20041,7 @@ var Breadcrumb = ({
|
|
|
19981
20041
|
index < resolvedData.length - 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
19982
20042
|
"span",
|
|
19983
20043
|
{
|
|
19984
|
-
className:
|
|
20044
|
+
className: classNames17__default.default({
|
|
19985
20045
|
"text-lg font-semibold text-gray-500": true,
|
|
19986
20046
|
[`px-${gap}`]: gap
|
|
19987
20047
|
}),
|
|
@@ -19995,7 +20055,7 @@ var Breadcrumb = ({
|
|
|
19995
20055
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19996
20056
|
"div",
|
|
19997
20057
|
{
|
|
19998
|
-
className:
|
|
20058
|
+
className: classNames17__default.default({
|
|
19999
20059
|
"inline-flex": true,
|
|
20000
20060
|
[`${styles}`]: styles
|
|
20001
20061
|
}),
|
|
@@ -20025,7 +20085,7 @@ var Drawer = ({
|
|
|
20025
20085
|
{
|
|
20026
20086
|
show: visibility,
|
|
20027
20087
|
enter: "transform transition duration-200 ease-out",
|
|
20028
|
-
enterFrom:
|
|
20088
|
+
enterFrom: classNames17__default.default({
|
|
20029
20089
|
"-translate-x-full": side === "left",
|
|
20030
20090
|
"translate-x-full": side === "right",
|
|
20031
20091
|
"-translate-y-full": side === "top",
|
|
@@ -20034,7 +20094,7 @@ var Drawer = ({
|
|
|
20034
20094
|
enterTo: "translate-x-0 translate-y-0",
|
|
20035
20095
|
leave: "transform transition duration-200 ease-in",
|
|
20036
20096
|
leaveFrom: "translate-x-0 translate-y-0",
|
|
20037
|
-
leaveTo:
|
|
20097
|
+
leaveTo: classNames17__default.default({
|
|
20038
20098
|
"-translate-x-full": side === "left",
|
|
20039
20099
|
"translate-x-full": side === "right",
|
|
20040
20100
|
"-translate-y-full": side === "top",
|
|
@@ -20043,7 +20103,7 @@ var Drawer = ({
|
|
|
20043
20103
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
20044
20104
|
"div",
|
|
20045
20105
|
{
|
|
20046
|
-
className:
|
|
20106
|
+
className: classNames17__default.default(
|
|
20047
20107
|
"fixed shadow-lg z-50",
|
|
20048
20108
|
{
|
|
20049
20109
|
"h-full w-[300px]": isHorizontal,
|
|
@@ -20075,7 +20135,7 @@ function DrawerToggler({
|
|
|
20075
20135
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
20076
20136
|
"div",
|
|
20077
20137
|
{
|
|
20078
|
-
className:
|
|
20138
|
+
className: classNames17__default.default({
|
|
20079
20139
|
"text-xl p-3 cursor-pointer": true,
|
|
20080
20140
|
"transition-all ease-in-out": true,
|
|
20081
20141
|
"text-eui-dark-500 dark:text-eui-secondary-600": !styles,
|
|
@@ -20123,7 +20183,7 @@ function FooterNav({ data = [], styles }) {
|
|
|
20123
20183
|
childrenContent = /* @__PURE__ */ jsxRuntime.jsx(
|
|
20124
20184
|
"div",
|
|
20125
20185
|
{
|
|
20126
|
-
className:
|
|
20186
|
+
className: classNames17__default.default({
|
|
20127
20187
|
"grid w-full": true,
|
|
20128
20188
|
"grid-cols-1": isMobile,
|
|
20129
20189
|
"grid-cols-3": !isMobile,
|
|
@@ -20136,7 +20196,7 @@ function FooterNav({ data = [], styles }) {
|
|
|
20136
20196
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
20137
20197
|
"div",
|
|
20138
20198
|
{
|
|
20139
|
-
className:
|
|
20199
|
+
className: classNames17__default.default({
|
|
20140
20200
|
[`${styles}`]: styles
|
|
20141
20201
|
}),
|
|
20142
20202
|
children: childrenContent
|
|
@@ -20177,7 +20237,7 @@ var FooterNavGroup = ({
|
|
|
20177
20237
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
20178
20238
|
"div",
|
|
20179
20239
|
{
|
|
20180
|
-
className:
|
|
20240
|
+
className: classNames17__default.default({
|
|
20181
20241
|
"": true,
|
|
20182
20242
|
"py-2 font-semibold eui-text-lg": !styles,
|
|
20183
20243
|
[`${styles}`]: styles
|
|
@@ -20222,7 +20282,7 @@ var FooterNavItem = ({
|
|
|
20222
20282
|
"div",
|
|
20223
20283
|
{
|
|
20224
20284
|
onClick: handleNavigation,
|
|
20225
|
-
className:
|
|
20285
|
+
className: classNames17__default.default({
|
|
20226
20286
|
"flex flex-row items-center gap-3 cursor-pointer p-1 w-full": true,
|
|
20227
20287
|
"transition-all duration-200 ease-in-out": true,
|
|
20228
20288
|
"text-sm eui-text-sm": !styles,
|
|
@@ -20251,7 +20311,7 @@ var FooterNavItemTitle = ({
|
|
|
20251
20311
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
20252
20312
|
"div",
|
|
20253
20313
|
{
|
|
20254
|
-
className:
|
|
20314
|
+
className: classNames17__default.default({
|
|
20255
20315
|
"": true,
|
|
20256
20316
|
"py-2 font-thin eui-text-md": !styles,
|
|
20257
20317
|
[`${styles}`]: styles
|
|
@@ -20304,7 +20364,7 @@ function HeaderNav({ data = [], styles }) {
|
|
|
20304
20364
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
20305
20365
|
"div",
|
|
20306
20366
|
{
|
|
20307
|
-
className:
|
|
20367
|
+
className: classNames17__default.default({
|
|
20308
20368
|
[`${styles}`]: styles
|
|
20309
20369
|
}),
|
|
20310
20370
|
children: childrenContent
|
|
@@ -20313,7 +20373,7 @@ function HeaderNav({ data = [], styles }) {
|
|
|
20313
20373
|
}
|
|
20314
20374
|
var HeaderNav_default = HeaderNav;
|
|
20315
20375
|
function useClickOutside(ref, fun) {
|
|
20316
|
-
|
|
20376
|
+
React8.useEffect(() => {
|
|
20317
20377
|
const listener = (e) => {
|
|
20318
20378
|
if (!ref.current || ref.current.contains(e.target)) {
|
|
20319
20379
|
return;
|
|
@@ -20354,8 +20414,8 @@ var HeaderNavGroup = ({
|
|
|
20354
20414
|
styles,
|
|
20355
20415
|
children
|
|
20356
20416
|
}) => {
|
|
20357
|
-
const [collapsed, setCollapsed] =
|
|
20358
|
-
const headerNavGroupRef =
|
|
20417
|
+
const [collapsed, setCollapsed] = React8.useState(true);
|
|
20418
|
+
const headerNavGroupRef = React8.useRef(null);
|
|
20359
20419
|
useClickOutside(headerNavGroupRef, () => setCollapsed(true));
|
|
20360
20420
|
const handleNavigation = () => {
|
|
20361
20421
|
if (to) {
|
|
@@ -20366,7 +20426,7 @@ var HeaderNavGroup = ({
|
|
|
20366
20426
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
20367
20427
|
"div",
|
|
20368
20428
|
{
|
|
20369
|
-
className:
|
|
20429
|
+
className: classNames17__default.default({
|
|
20370
20430
|
"flex flex-row gap-2 items-center justify-between cursor-pointer p-3 w-full": true,
|
|
20371
20431
|
"transition-all duration-300 ease-in-out": true,
|
|
20372
20432
|
"eui-text-md bg-gradient-to-t from-eui-dark-500/10 dark:from-green-700/10": !styles,
|
|
@@ -20394,7 +20454,7 @@ var HeaderNavGroup = ({
|
|
|
20394
20454
|
children && /* @__PURE__ */ jsxRuntime.jsx(
|
|
20395
20455
|
bs.BsChevronDown,
|
|
20396
20456
|
{
|
|
20397
|
-
className:
|
|
20457
|
+
className: classNames17__default.default({
|
|
20398
20458
|
"text-md": true,
|
|
20399
20459
|
"transition-all ease-in-out duration-300": true,
|
|
20400
20460
|
"rotate-180": !collapsed
|
|
@@ -20407,7 +20467,7 @@ var HeaderNavGroup = ({
|
|
|
20407
20467
|
!collapsed && children && /* @__PURE__ */ jsxRuntime.jsx(
|
|
20408
20468
|
"div",
|
|
20409
20469
|
{
|
|
20410
|
-
className:
|
|
20470
|
+
className: classNames17__default.default({
|
|
20411
20471
|
"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
20472
|
"transition-all duration-300 ease-in-out": true
|
|
20413
20473
|
}),
|
|
@@ -20437,7 +20497,7 @@ var HeaderNavItem = ({
|
|
|
20437
20497
|
"div",
|
|
20438
20498
|
{
|
|
20439
20499
|
onClick: handleNavigation,
|
|
20440
|
-
className:
|
|
20500
|
+
className: classNames17__default.default({
|
|
20441
20501
|
"flex flex-row items-center gap-3 cursor-pointer p-3 w-full": true,
|
|
20442
20502
|
"transition-all duration-200 ease-in-out": true,
|
|
20443
20503
|
"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 +20526,7 @@ var HeaderNavItemTitle = ({
|
|
|
20466
20526
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
20467
20527
|
"div",
|
|
20468
20528
|
{
|
|
20469
|
-
className:
|
|
20529
|
+
className: classNames17__default.default({
|
|
20470
20530
|
"p-3 font-thin": true,
|
|
20471
20531
|
"eui-text-md": !styles,
|
|
20472
20532
|
[`${styles}`]: styles
|
|
@@ -20506,7 +20566,7 @@ var Link = ({
|
|
|
20506
20566
|
href: href || "#",
|
|
20507
20567
|
target: targets[target],
|
|
20508
20568
|
onClick: handleClick,
|
|
20509
|
-
className:
|
|
20569
|
+
className: classNames17__default.default({
|
|
20510
20570
|
[`${textVariants[variant]}`]: variant,
|
|
20511
20571
|
[`${decorations[decoration]}`]: decoration,
|
|
20512
20572
|
"font-bold": bold,
|
|
@@ -20578,8 +20638,8 @@ var MenuGroup = ({
|
|
|
20578
20638
|
style,
|
|
20579
20639
|
...rest
|
|
20580
20640
|
}) => {
|
|
20581
|
-
const [collapsed, setCollapsed] =
|
|
20582
|
-
|
|
20641
|
+
const [collapsed, setCollapsed] = React8.useState(!defaultOpen);
|
|
20642
|
+
React8.useEffect(() => {
|
|
20583
20643
|
if (defaultOpen !== void 0) {
|
|
20584
20644
|
setCollapsed(!defaultOpen);
|
|
20585
20645
|
}
|
|
@@ -20696,12 +20756,12 @@ var Menu = ({
|
|
|
20696
20756
|
defaultMenuElements,
|
|
20697
20757
|
currentPath
|
|
20698
20758
|
}) => {
|
|
20699
|
-
const normalizedItems =
|
|
20700
|
-
const selected =
|
|
20759
|
+
const normalizedItems = React8.useMemo(() => assignKeys(items), [items]);
|
|
20760
|
+
const selected = React8.useMemo(() => {
|
|
20701
20761
|
if (!currentPath) return void 0;
|
|
20702
20762
|
return findSelectedKey(normalizedItems, currentPath);
|
|
20703
20763
|
}, [currentPath, normalizedItems]);
|
|
20704
|
-
const parentMap =
|
|
20764
|
+
const parentMap = React8.useMemo(
|
|
20705
20765
|
() => buildParentMap(normalizedItems),
|
|
20706
20766
|
[normalizedItems]
|
|
20707
20767
|
);
|
|
@@ -20854,8 +20914,8 @@ function RouteTabs({
|
|
|
20854
20914
|
const currentPath = window.location.pathname;
|
|
20855
20915
|
return navData.find((tab) => tab.to === currentPath)?.to || navData[0]?.to;
|
|
20856
20916
|
};
|
|
20857
|
-
const [activeTab, setActiveTab] =
|
|
20858
|
-
|
|
20917
|
+
const [activeTab, setActiveTab] = React8.useState(getActiveTab);
|
|
20918
|
+
React8.useEffect(() => {
|
|
20859
20919
|
if (mode !== "route") return;
|
|
20860
20920
|
const handlePopState = () => {
|
|
20861
20921
|
setActiveTab(getActiveTab());
|
|
@@ -20952,7 +21012,7 @@ function Modal({
|
|
|
20952
21012
|
}) {
|
|
20953
21013
|
const eui = useEUIConfig();
|
|
20954
21014
|
const resolvedShape = shape ?? eui?.config?.global?.shape ?? "square";
|
|
20955
|
-
const modalRef =
|
|
21015
|
+
const modalRef = React8.useRef(null);
|
|
20956
21016
|
useClickOutside(
|
|
20957
21017
|
modalRef,
|
|
20958
21018
|
enableCloseOnClickOutside ? handleOnClose : void 0
|
|
@@ -20967,12 +21027,12 @@ function Modal({
|
|
|
20967
21027
|
leave: "transition duration-100 ease-out",
|
|
20968
21028
|
leaveFrom: "transform scale-200 opacity-100",
|
|
20969
21029
|
leaveTo: "transform scale-95 opacity-0",
|
|
20970
|
-
as:
|
|
21030
|
+
as: React8.Fragment,
|
|
20971
21031
|
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.jsxs(
|
|
20972
21032
|
"div",
|
|
20973
21033
|
{
|
|
20974
21034
|
ref: modalRef,
|
|
20975
|
-
className:
|
|
21035
|
+
className: classNames17__default.default({
|
|
20976
21036
|
"eui-bg-md eui-shadow-lg border border-gray-700/80 w-fit h-fit": true,
|
|
20977
21037
|
[`${shapes[resolvedShape]}`]: true,
|
|
20978
21038
|
[`${styles}`]: styles
|
|
@@ -20983,7 +21043,7 @@ function Modal({
|
|
|
20983
21043
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
20984
21044
|
"div",
|
|
20985
21045
|
{
|
|
20986
|
-
className:
|
|
21046
|
+
className: classNames17__default.default({
|
|
20987
21047
|
"w-[60px] h-[60px] flex items-center justify-center transition-standard-fast": true,
|
|
20988
21048
|
"hover:cursor-pointer hover:bg-eui-dark-500": true
|
|
20989
21049
|
}),
|
|
@@ -21021,8 +21081,8 @@ var GlowWrapper = ({
|
|
|
21021
21081
|
className = "",
|
|
21022
21082
|
hideOnLeave = true
|
|
21023
21083
|
}) => {
|
|
21024
|
-
const ref =
|
|
21025
|
-
const handleMove =
|
|
21084
|
+
const ref = React8.useRef(null);
|
|
21085
|
+
const handleMove = React8.useCallback(
|
|
21026
21086
|
(e) => {
|
|
21027
21087
|
const el = ref.current;
|
|
21028
21088
|
if (!el) return;
|
|
@@ -21044,7 +21104,7 @@ var GlowWrapper = ({
|
|
|
21044
21104
|
},
|
|
21045
21105
|
[glowSize, glowColor]
|
|
21046
21106
|
);
|
|
21047
|
-
const handleLeave =
|
|
21107
|
+
const handleLeave = React8.useCallback(() => {
|
|
21048
21108
|
const el = ref.current;
|
|
21049
21109
|
if (!el || !hideOnLeave) return;
|
|
21050
21110
|
el.style.setProperty("--glow-x", `-999px`);
|
|
@@ -21089,8 +21149,8 @@ function InfiniteScrollTrigger({
|
|
|
21089
21149
|
threshold = 0,
|
|
21090
21150
|
onLoadMore
|
|
21091
21151
|
}) {
|
|
21092
|
-
const triggerRef =
|
|
21093
|
-
|
|
21152
|
+
const triggerRef = React8.useRef(null);
|
|
21153
|
+
React8.useEffect(() => {
|
|
21094
21154
|
const element = triggerRef.current;
|
|
21095
21155
|
if (!element || !hasMore || isLoading) {
|
|
21096
21156
|
return;
|
|
@@ -21116,7 +21176,7 @@ function InfiniteScrollTrigger({
|
|
|
21116
21176
|
}
|
|
21117
21177
|
var InfiniteScrollTrigger_default = InfiniteScrollTrigger;
|
|
21118
21178
|
function ShowMore({ text, limit }) {
|
|
21119
|
-
const [showMore, setShowMore] =
|
|
21179
|
+
const [showMore, setShowMore] = React8.useState(false);
|
|
21120
21180
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
21121
21181
|
showMore ? text : `${text.substring(0, limit)}`,
|
|
21122
21182
|
text.length > limit && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
@@ -21124,7 +21184,7 @@ function ShowMore({ text, limit }) {
|
|
|
21124
21184
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21125
21185
|
"div",
|
|
21126
21186
|
{
|
|
21127
|
-
className:
|
|
21187
|
+
className: classNames17__default.default({
|
|
21128
21188
|
"text-blue-300 px-1 pb-1 mt-1": true,
|
|
21129
21189
|
"bg-slate-900/70": !showMore,
|
|
21130
21190
|
"bg-gradient-to-t from-slate-900/50 to-transparent": showMore
|
|
@@ -21151,8 +21211,8 @@ function CommentComposer({
|
|
|
21151
21211
|
loading,
|
|
21152
21212
|
onSubmit
|
|
21153
21213
|
}) {
|
|
21154
|
-
const [value, setValue] =
|
|
21155
|
-
const [focused, setFocused] =
|
|
21214
|
+
const [value, setValue] = React8.useState("");
|
|
21215
|
+
const [focused, setFocused] = React8.useState(false);
|
|
21156
21216
|
async function handleSubmit() {
|
|
21157
21217
|
const content = value.trim();
|
|
21158
21218
|
if (!content) {
|
|
@@ -21407,7 +21467,7 @@ function CommentHeader({ comment, config }) {
|
|
|
21407
21467
|
}
|
|
21408
21468
|
var CommentHeader_default = CommentHeader;
|
|
21409
21469
|
var useDrawer = (defaultVisibility = true) => {
|
|
21410
|
-
const [show, setShow] =
|
|
21470
|
+
const [show, setShow] = React8.useState(defaultVisibility);
|
|
21411
21471
|
const openDrawer = () => {
|
|
21412
21472
|
setShow((prev) => !prev);
|
|
21413
21473
|
};
|
|
@@ -21422,7 +21482,7 @@ var useDrawer = (defaultVisibility = true) => {
|
|
|
21422
21482
|
};
|
|
21423
21483
|
var useDrawer_default = useDrawer;
|
|
21424
21484
|
var useModal = () => {
|
|
21425
|
-
const [show, setShow] =
|
|
21485
|
+
const [show, setShow] = React8.useState(false);
|
|
21426
21486
|
const handleOpenModal = () => {
|
|
21427
21487
|
setShow(true);
|
|
21428
21488
|
};
|
|
@@ -21470,7 +21530,7 @@ function CommentMenu({
|
|
|
21470
21530
|
onDelete,
|
|
21471
21531
|
onReport
|
|
21472
21532
|
}) {
|
|
21473
|
-
const ref =
|
|
21533
|
+
const ref = React8.useRef(null);
|
|
21474
21534
|
useClickOutside(ref, () => setOpen(false));
|
|
21475
21535
|
const items = [];
|
|
21476
21536
|
if (canEdit) {
|
|
@@ -21525,7 +21585,7 @@ function CommentMenu({
|
|
|
21525
21585
|
children: /* @__PURE__ */ jsxRuntime.jsx(bi.BiDotsVerticalRounded, { size: 18 })
|
|
21526
21586
|
}
|
|
21527
21587
|
),
|
|
21528
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
21588
|
+
/* @__PURE__ */ jsxRuntime.jsx(Transition2.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
21589
|
] });
|
|
21530
21590
|
}
|
|
21531
21591
|
var CommentMenu_default = CommentMenu;
|
|
@@ -21598,11 +21658,11 @@ function CommentItem({
|
|
|
21598
21658
|
onDelete,
|
|
21599
21659
|
onReport
|
|
21600
21660
|
}) {
|
|
21601
|
-
const [collapsed, setCollapsed] =
|
|
21602
|
-
const [isReplying, setIsReplying] =
|
|
21603
|
-
const [menuOpen, setMenuOpen] =
|
|
21604
|
-
const [loadingReplies, setLoadingReplies] =
|
|
21605
|
-
const [repliesLoaded, setRepliesLoaded] =
|
|
21661
|
+
const [collapsed, setCollapsed] = React8.useState(true);
|
|
21662
|
+
const [isReplying, setIsReplying] = React8.useState(false);
|
|
21663
|
+
const [menuOpen, setMenuOpen] = React8.useState(false);
|
|
21664
|
+
const [loadingReplies, setLoadingReplies] = React8.useState(false);
|
|
21665
|
+
const [repliesLoaded, setRepliesLoaded] = React8.useState(false);
|
|
21606
21666
|
const resolvedDepth = Math.min(depth, config.maxDepth);
|
|
21607
21667
|
const {
|
|
21608
21668
|
Header: HeaderComponent = CommentHeader_default,
|
|
@@ -21766,18 +21826,18 @@ function CommentThread({
|
|
|
21766
21826
|
onDelete,
|
|
21767
21827
|
onReport
|
|
21768
21828
|
}) {
|
|
21769
|
-
const [comments, setComments] =
|
|
21770
|
-
const [isLoadingComments, setIsLoadingComments] =
|
|
21771
|
-
const [replyCache, setReplyCache] =
|
|
21829
|
+
const [comments, setComments] = React8.useState([]);
|
|
21830
|
+
const [isLoadingComments, setIsLoadingComments] = React8.useState(true);
|
|
21831
|
+
const [replyCache, setReplyCache] = React8.useState(
|
|
21772
21832
|
{}
|
|
21773
21833
|
);
|
|
21774
|
-
const replyCacheRef =
|
|
21834
|
+
const replyCacheRef = React8.useRef(replyCache);
|
|
21775
21835
|
const ComposerComponent = components?.Composer ?? CommentComposer_default;
|
|
21776
21836
|
const resolvedConfig = {
|
|
21777
21837
|
...DEFAULT_COMMENT_THREAD_CONFIG,
|
|
21778
21838
|
...config
|
|
21779
21839
|
};
|
|
21780
|
-
|
|
21840
|
+
React8.useEffect(() => {
|
|
21781
21841
|
async function loadComments() {
|
|
21782
21842
|
try {
|
|
21783
21843
|
const result = await dataSource.getComments({
|
|
@@ -21791,10 +21851,10 @@ function CommentThread({
|
|
|
21791
21851
|
}
|
|
21792
21852
|
void loadComments();
|
|
21793
21853
|
}, [dataSource, resolvedConfig.commentsPerPage]);
|
|
21794
|
-
|
|
21854
|
+
React8.useEffect(() => {
|
|
21795
21855
|
replyCacheRef.current = replyCache;
|
|
21796
21856
|
}, [replyCache]);
|
|
21797
|
-
|
|
21857
|
+
React8.useEffect(() => {
|
|
21798
21858
|
let cancelled = false;
|
|
21799
21859
|
async function refreshLoadedReplies() {
|
|
21800
21860
|
const parentIds = Object.keys(replyCacheRef.current);
|
|
@@ -21830,13 +21890,13 @@ function CommentThread({
|
|
|
21830
21890
|
cancelled = true;
|
|
21831
21891
|
};
|
|
21832
21892
|
}, [dataSource, resolvedConfig.repliesPerPage]);
|
|
21833
|
-
|
|
21893
|
+
React8.useEffect(() => {
|
|
21834
21894
|
if (!updatedComment) {
|
|
21835
21895
|
return;
|
|
21836
21896
|
}
|
|
21837
21897
|
updateCommentEverywhere(updatedComment.id, () => updatedComment);
|
|
21838
21898
|
}, [updatedComment]);
|
|
21839
|
-
|
|
21899
|
+
React8.useEffect(() => {
|
|
21840
21900
|
if (!deletedComment) {
|
|
21841
21901
|
return;
|
|
21842
21902
|
}
|
|
@@ -22050,13 +22110,13 @@ function SliderItem({
|
|
|
22050
22110
|
}
|
|
22051
22111
|
var SliderItem_default = SliderItem;
|
|
22052
22112
|
function Slider({ isLoading, isSuccess, coverArt, screenshots }) {
|
|
22053
|
-
const [images, setImages] =
|
|
22113
|
+
const [images, setImages] = React8.useState([
|
|
22054
22114
|
{
|
|
22055
22115
|
img: coverArt,
|
|
22056
22116
|
selected: true
|
|
22057
22117
|
}
|
|
22058
22118
|
]);
|
|
22059
|
-
|
|
22119
|
+
React8.useEffect(() => {
|
|
22060
22120
|
setImages([
|
|
22061
22121
|
{
|
|
22062
22122
|
img: coverArt,
|
|
@@ -22064,7 +22124,7 @@ function Slider({ isLoading, isSuccess, coverArt, screenshots }) {
|
|
|
22064
22124
|
}
|
|
22065
22125
|
]);
|
|
22066
22126
|
}, [isSuccess]);
|
|
22067
|
-
|
|
22127
|
+
React8.useEffect(() => {
|
|
22068
22128
|
if (screenshots) {
|
|
22069
22129
|
const selectableScreenshots = [];
|
|
22070
22130
|
screenshots.forEach((item) => {
|
|
@@ -22076,8 +22136,8 @@ function Slider({ isLoading, isSuccess, coverArt, screenshots }) {
|
|
|
22076
22136
|
setImages((prev) => [...prev, ...selectableScreenshots]);
|
|
22077
22137
|
}
|
|
22078
22138
|
}, [isSuccess]);
|
|
22079
|
-
const [displayImg, setDisplayImg] =
|
|
22080
|
-
|
|
22139
|
+
const [displayImg, setDisplayImg] = React8.useState(coverArt);
|
|
22140
|
+
React8.useEffect(() => {
|
|
22081
22141
|
setDisplayImg(coverArt);
|
|
22082
22142
|
}, [coverArt]);
|
|
22083
22143
|
const displayImageHandler = (itemIndex, img) => {
|
|
@@ -22189,7 +22249,7 @@ function WorldMapCountryTable({
|
|
|
22189
22249
|
title = "Country Breakdown",
|
|
22190
22250
|
data
|
|
22191
22251
|
}) {
|
|
22192
|
-
const enrichedData =
|
|
22252
|
+
const enrichedData = React8.useMemo(() => {
|
|
22193
22253
|
const mapped = data.map((item) => {
|
|
22194
22254
|
const countryMeta = COUNTRIES.find((c) => c.code === item.code);
|
|
22195
22255
|
return {
|
|
@@ -22202,11 +22262,11 @@ function WorldMapCountryTable({
|
|
|
22202
22262
|
});
|
|
22203
22263
|
return mapped.sort((a, b) => b.value - a.value);
|
|
22204
22264
|
}, [data]);
|
|
22205
|
-
const total =
|
|
22265
|
+
const total = React8.useMemo(
|
|
22206
22266
|
() => enrichedData.reduce((sum, i) => sum + i.value, 0),
|
|
22207
22267
|
[enrichedData]
|
|
22208
22268
|
);
|
|
22209
|
-
const finalData =
|
|
22269
|
+
const finalData = React8.useMemo(() => {
|
|
22210
22270
|
return enrichedData.map((item) => ({
|
|
22211
22271
|
...item,
|
|
22212
22272
|
percent: total > 0 ? item.value / total * 100 : 0
|
|
@@ -22281,7 +22341,7 @@ function BoxNavItem({ icon, name, to, selected, onClick }) {
|
|
|
22281
22341
|
type: "button",
|
|
22282
22342
|
onClick: handleClick,
|
|
22283
22343
|
"aria-current": selected ? "page" : void 0,
|
|
22284
|
-
className:
|
|
22344
|
+
className: classNames17__default.default(
|
|
22285
22345
|
"w-full min-w-[80px] flex flex-col items-center justify-center py-3 text-center",
|
|
22286
22346
|
"hover:text-secondary-700 hover:bg-gray-300/10 hover:cursor-pointer",
|
|
22287
22347
|
selected ? "text-eui-secondary-700 bg-gray-300/10" : "text-gray-400",
|
|
@@ -22451,7 +22511,7 @@ var TNDropdownGroup = ({
|
|
|
22451
22511
|
navigate,
|
|
22452
22512
|
className
|
|
22453
22513
|
}) => {
|
|
22454
|
-
const [open, setOpen] =
|
|
22514
|
+
const [open, setOpen] = React8.useState(true);
|
|
22455
22515
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
22456
22516
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
22457
22517
|
"div",
|
|
@@ -22540,8 +22600,8 @@ var TNGroup = ({
|
|
|
22540
22600
|
components,
|
|
22541
22601
|
selected
|
|
22542
22602
|
}) => {
|
|
22543
|
-
const [open, setOpen] =
|
|
22544
|
-
const timeoutRef =
|
|
22603
|
+
const [open, setOpen] = React8.useState(false);
|
|
22604
|
+
const timeoutRef = React8.useRef(null);
|
|
22545
22605
|
const handleEnter = () => {
|
|
22546
22606
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
22547
22607
|
setOpen(true);
|
|
@@ -22641,7 +22701,7 @@ function GenericLayout({
|
|
|
22641
22701
|
return /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider, { defaultTheme, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
22642
22702
|
"div",
|
|
22643
22703
|
{
|
|
22644
|
-
className:
|
|
22704
|
+
className: classNames17__default.default({
|
|
22645
22705
|
[`${styles}`]: styles
|
|
22646
22706
|
}),
|
|
22647
22707
|
children
|
|
@@ -22678,7 +22738,7 @@ function SidebarLayout({
|
|
|
22678
22738
|
header = /* @__PURE__ */ jsxRuntime.jsx(Header, {}),
|
|
22679
22739
|
footer = /* @__PURE__ */ jsxRuntime.jsx(Footer, {})
|
|
22680
22740
|
}) {
|
|
22681
|
-
const [showSidebar, setShowSidebar] =
|
|
22741
|
+
const [showSidebar, setShowSidebar] = React8.useState(true);
|
|
22682
22742
|
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
22743
|
/* @__PURE__ */ jsxRuntime.jsx(ContentArea_default, { children }),
|
|
22684
22744
|
footer
|
|
@@ -22690,7 +22750,7 @@ function SidemenuLayout({ data, children }) {
|
|
|
22690
22750
|
return /* @__PURE__ */ jsxRuntime.jsx(DefaultLayout_default, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
22691
22751
|
"div",
|
|
22692
22752
|
{
|
|
22693
|
-
className:
|
|
22753
|
+
className: classNames17__default.default({
|
|
22694
22754
|
grid: true,
|
|
22695
22755
|
"grid-cols-7 gap-10": !isMobile,
|
|
22696
22756
|
"grid-cols-1 gap-": isMobile
|
|
@@ -22732,7 +22792,7 @@ function ScrollToTop({
|
|
|
22732
22792
|
behavior = "smooth",
|
|
22733
22793
|
target
|
|
22734
22794
|
}) {
|
|
22735
|
-
|
|
22795
|
+
React8.useEffect(() => {
|
|
22736
22796
|
if (target) {
|
|
22737
22797
|
target.scrollTo({
|
|
22738
22798
|
top: 0,
|
|
@@ -22927,7 +22987,7 @@ exports.TitleBanner = TitleBanner;
|
|
|
22927
22987
|
exports.Toast = Toast;
|
|
22928
22988
|
exports.Tooltip = Tooltip6;
|
|
22929
22989
|
exports.TopNav = TopNav;
|
|
22930
|
-
exports.Transition =
|
|
22990
|
+
exports.Transition = Transition2;
|
|
22931
22991
|
exports.TransitionDropdown = TransitionDropdown_default;
|
|
22932
22992
|
exports.TransitionFadeIn = TransitionFadeIn_default;
|
|
22933
22993
|
exports.Typography = Typography;
|