@moontra/moonui-pro 2.18.2 → 2.18.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.mjs
CHANGED
|
@@ -61374,6 +61374,12 @@ var AdvancedForms = ({ className, ...props }) => {
|
|
|
61374
61374
|
|
|
61375
61375
|
// src/components/github-stars/github-api.ts
|
|
61376
61376
|
var cache = /* @__PURE__ */ new Map();
|
|
61377
|
+
var isDocsMode = () => {
|
|
61378
|
+
return typeof window !== "undefined" && (window.location.pathname.includes("/docs/") || window.location.pathname.includes("/components/"));
|
|
61379
|
+
};
|
|
61380
|
+
var getCacheDuration = (defaultDuration) => {
|
|
61381
|
+
return isDocsMode() ? 18e5 : defaultDuration;
|
|
61382
|
+
};
|
|
61377
61383
|
var LANGUAGE_COLORS = {
|
|
61378
61384
|
JavaScript: "#f7df1e",
|
|
61379
61385
|
TypeScript: "#3178c6",
|
|
@@ -61441,8 +61447,8 @@ async function getRateLimitInfo(token) {
|
|
|
61441
61447
|
cache.set(cacheKey, {
|
|
61442
61448
|
data: rateLimitInfo,
|
|
61443
61449
|
timestamp: Date.now(),
|
|
61444
|
-
expiresAt: Date.now() + 6e4
|
|
61445
|
-
//
|
|
61450
|
+
expiresAt: Date.now() + getCacheDuration(6e4)
|
|
61451
|
+
// Docs modunda daha uzun cache
|
|
61446
61452
|
});
|
|
61447
61453
|
return rateLimitInfo;
|
|
61448
61454
|
}
|
|
@@ -61462,8 +61468,8 @@ async function fetchUserRepositories(username, token, options) {
|
|
|
61462
61468
|
cache.set(cacheKey, {
|
|
61463
61469
|
data: repos,
|
|
61464
61470
|
timestamp: Date.now(),
|
|
61465
|
-
expiresAt: Date.now() + 3e5
|
|
61466
|
-
//
|
|
61471
|
+
expiresAt: Date.now() + getCacheDuration(3e5)
|
|
61472
|
+
// Docs modunda 30 dakika
|
|
61467
61473
|
});
|
|
61468
61474
|
return repos;
|
|
61469
61475
|
}
|
|
@@ -61478,8 +61484,8 @@ async function fetchRepository(owner, repo, token) {
|
|
|
61478
61484
|
cache.set(cacheKey, {
|
|
61479
61485
|
data: repository,
|
|
61480
61486
|
timestamp: Date.now(),
|
|
61481
|
-
expiresAt: Date.now() + 3e5
|
|
61482
|
-
//
|
|
61487
|
+
expiresAt: Date.now() + getCacheDuration(3e5)
|
|
61488
|
+
// Docs modunda 30 dakika
|
|
61483
61489
|
});
|
|
61484
61490
|
return repository;
|
|
61485
61491
|
}
|
|
@@ -61502,8 +61508,8 @@ async function fetchContributorsCount(owner, repo, token) {
|
|
|
61502
61508
|
cache.set(cacheKey, {
|
|
61503
61509
|
data: count4,
|
|
61504
61510
|
timestamp: Date.now(),
|
|
61505
|
-
expiresAt: Date.now() + 36e5
|
|
61506
|
-
//
|
|
61511
|
+
expiresAt: Date.now() + getCacheDuration(36e5)
|
|
61512
|
+
// Docs modunda 30 dakika
|
|
61507
61513
|
});
|
|
61508
61514
|
return count4;
|
|
61509
61515
|
}
|
|
@@ -61513,8 +61519,8 @@ async function fetchContributorsCount(owner, repo, token) {
|
|
|
61513
61519
|
cache.set(cacheKey, {
|
|
61514
61520
|
data: count3,
|
|
61515
61521
|
timestamp: Date.now(),
|
|
61516
|
-
expiresAt: Date.now() + 36e5
|
|
61517
|
-
//
|
|
61522
|
+
expiresAt: Date.now() + getCacheDuration(36e5)
|
|
61523
|
+
// Docs modunda 30 dakika
|
|
61518
61524
|
});
|
|
61519
61525
|
return count3;
|
|
61520
61526
|
} catch (error) {
|
|
@@ -61676,8 +61682,12 @@ function useGitHubData({
|
|
|
61676
61682
|
onError,
|
|
61677
61683
|
onDataUpdate,
|
|
61678
61684
|
onMilestoneReached,
|
|
61679
|
-
milestones = [10, 50, 100, 500, 1e3, 5e3, 1e4]
|
|
61685
|
+
milestones = [10, 50, 100, 500, 1e3, 5e3, 1e4],
|
|
61686
|
+
docsMode = false,
|
|
61687
|
+
mockDataFallback = true
|
|
61680
61688
|
}) {
|
|
61689
|
+
const isDocsMode2 = docsMode || typeof window !== "undefined" && (window.location.pathname.includes("/docs/") || window.location.pathname.includes("/components/"));
|
|
61690
|
+
const effectiveAutoRefresh = isDocsMode2 ? false : autoRefresh;
|
|
61681
61691
|
const [repos, setRepos] = useState([]);
|
|
61682
61692
|
const [stats, setStats] = useState(null);
|
|
61683
61693
|
const [loading, setLoading] = useState(true);
|
|
@@ -61687,7 +61697,9 @@ function useGitHubData({
|
|
|
61687
61697
|
const refreshTimeoutRef = useRef();
|
|
61688
61698
|
const previousStarsRef = useRef(/* @__PURE__ */ new Map());
|
|
61689
61699
|
const errorCountRef = useRef(0);
|
|
61690
|
-
const maxErrorCount = 2;
|
|
61700
|
+
const maxErrorCount = isDocsMode2 ? 1 : 2;
|
|
61701
|
+
const hasInitialFetchedRef = useRef(false);
|
|
61702
|
+
const docsDataCacheRef = useRef(null);
|
|
61691
61703
|
const milestonesRef = useRef(milestones);
|
|
61692
61704
|
const onMilestoneReachedRef = useRef(onMilestoneReached);
|
|
61693
61705
|
useEffect(() => {
|
|
@@ -61716,10 +61728,26 @@ function useGitHubData({
|
|
|
61716
61728
|
});
|
|
61717
61729
|
}, []);
|
|
61718
61730
|
const fetchData = useCallback(async () => {
|
|
61731
|
+
if (isDocsMode2 && hasInitialFetchedRef.current && docsDataCacheRef.current) {
|
|
61732
|
+
console.log("[Docs Mode] Returning cached data, skipping API request");
|
|
61733
|
+
setRepos(docsDataCacheRef.current);
|
|
61734
|
+
const calculatedStats = calculateStats(docsDataCacheRef.current);
|
|
61735
|
+
setStats(calculatedStats);
|
|
61736
|
+
setLoading(false);
|
|
61737
|
+
return;
|
|
61738
|
+
}
|
|
61719
61739
|
if (errorCountRef.current >= maxErrorCount) {
|
|
61720
61740
|
console.warn("Maximum error count reached. Stopping requests.");
|
|
61741
|
+
if (isDocsMode2 && mockDataFallback) {
|
|
61742
|
+
const mockData = getMockGitHubData(username, repository, repositories);
|
|
61743
|
+
setRepos(mockData);
|
|
61744
|
+
const calculatedStats = calculateStats(mockData);
|
|
61745
|
+
setStats(calculatedStats);
|
|
61746
|
+
setError(null);
|
|
61747
|
+
} else {
|
|
61748
|
+
setError("Maximum retry limit exceeded. Please check your configuration.");
|
|
61749
|
+
}
|
|
61721
61750
|
setLoading(false);
|
|
61722
|
-
setError("Maximum retry limit exceeded. Please check your configuration.");
|
|
61723
61751
|
return;
|
|
61724
61752
|
}
|
|
61725
61753
|
const hasValidInput = username && repository || // Tek repository modu
|
|
@@ -61812,12 +61840,25 @@ function useGitHubData({
|
|
|
61812
61840
|
}
|
|
61813
61841
|
setLastUpdated(/* @__PURE__ */ new Date());
|
|
61814
61842
|
errorCountRef.current = 0;
|
|
61843
|
+
if (isDocsMode2) {
|
|
61844
|
+
hasInitialFetchedRef.current = true;
|
|
61845
|
+
docsDataCacheRef.current = enhancedRepos;
|
|
61846
|
+
}
|
|
61815
61847
|
} catch (err) {
|
|
61816
61848
|
const errorMessage = err instanceof Error ? err.message : "Failed to fetch data";
|
|
61817
61849
|
setError(errorMessage);
|
|
61818
61850
|
errorCountRef.current += 1;
|
|
61819
61851
|
console.error(`GitHub API error (${errorCountRef.current}/${maxErrorCount}):`, errorMessage);
|
|
61820
|
-
if (
|
|
61852
|
+
if (isDocsMode2 && mockDataFallback && !hasInitialFetchedRef.current) {
|
|
61853
|
+
console.warn("[Docs Mode] API failed, using mock data");
|
|
61854
|
+
const mockData = getMockGitHubData(username, repository, repositories);
|
|
61855
|
+
setRepos(mockData);
|
|
61856
|
+
const calculatedStats = calculateStats(mockData);
|
|
61857
|
+
setStats(calculatedStats);
|
|
61858
|
+
setError(null);
|
|
61859
|
+
hasInitialFetchedRef.current = true;
|
|
61860
|
+
docsDataCacheRef.current = mockData;
|
|
61861
|
+
} else if (onError) {
|
|
61821
61862
|
onError(err instanceof Error ? err : new Error(errorMessage));
|
|
61822
61863
|
}
|
|
61823
61864
|
} finally {
|
|
@@ -61834,7 +61875,9 @@ function useGitHubData({
|
|
|
61834
61875
|
checkMilestones,
|
|
61835
61876
|
// Artık stable
|
|
61836
61877
|
onDataUpdate,
|
|
61837
|
-
onError
|
|
61878
|
+
onError,
|
|
61879
|
+
isDocsMode2,
|
|
61880
|
+
mockDataFallback
|
|
61838
61881
|
]);
|
|
61839
61882
|
useEffect(() => {
|
|
61840
61883
|
const hasValidInput = username && repository || username && repositories && repositories.length > 0 || repositories && repositories.length > 0 && repositories.every((r2) => r2.includes("/")) || username;
|
|
@@ -61845,7 +61888,7 @@ function useGitHubData({
|
|
|
61845
61888
|
}
|
|
61846
61889
|
}, [fetchData]);
|
|
61847
61890
|
useEffect(() => {
|
|
61848
|
-
if (!
|
|
61891
|
+
if (!effectiveAutoRefresh)
|
|
61849
61892
|
return;
|
|
61850
61893
|
const scheduleRefresh = () => {
|
|
61851
61894
|
refreshTimeoutRef.current = setTimeout(() => {
|
|
@@ -61859,15 +61902,19 @@ function useGitHubData({
|
|
|
61859
61902
|
clearTimeout(refreshTimeoutRef.current);
|
|
61860
61903
|
}
|
|
61861
61904
|
};
|
|
61862
|
-
}, [
|
|
61905
|
+
}, [effectiveAutoRefresh, refreshInterval, fetchData]);
|
|
61863
61906
|
const refresh = useCallback(() => {
|
|
61907
|
+
if (isDocsMode2 && hasInitialFetchedRef.current) {
|
|
61908
|
+
console.warn("[Docs Mode] Refresh disabled after initial fetch");
|
|
61909
|
+
return Promise.resolve();
|
|
61910
|
+
}
|
|
61864
61911
|
if (errorCountRef.current >= maxErrorCount) {
|
|
61865
61912
|
console.warn("Cannot refresh: maximum error count reached");
|
|
61866
61913
|
return Promise.resolve();
|
|
61867
61914
|
}
|
|
61868
61915
|
clearCache();
|
|
61869
61916
|
return fetchData();
|
|
61870
|
-
}, [fetchData]);
|
|
61917
|
+
}, [fetchData, isDocsMode2]);
|
|
61871
61918
|
return {
|
|
61872
61919
|
repos,
|
|
61873
61920
|
stats,
|
|
@@ -61907,31 +61954,110 @@ function useGitHubNotifications(enabled = true) {
|
|
|
61907
61954
|
);
|
|
61908
61955
|
return { permission, notify };
|
|
61909
61956
|
}
|
|
61957
|
+
function getMockGitHubData(username, repository, repositories) {
|
|
61958
|
+
const defaultRepos = [
|
|
61959
|
+
{
|
|
61960
|
+
id: 1,
|
|
61961
|
+
name: repository || "awesome-project",
|
|
61962
|
+
full_name: `${username || "moonui"}/${repository || "awesome-project"}`,
|
|
61963
|
+
description: "An amazing open source project with great features",
|
|
61964
|
+
html_url: `https://github.com/${username || "moonui"}/${repository || "awesome-project"}`,
|
|
61965
|
+
homepage: "https://awesome-project.dev",
|
|
61966
|
+
stargazers_count: 12453,
|
|
61967
|
+
watchers_count: 543,
|
|
61968
|
+
forks_count: 2341,
|
|
61969
|
+
language: "TypeScript",
|
|
61970
|
+
topics: ["react", "ui", "components", "typescript"],
|
|
61971
|
+
created_at: "2022-01-15T10:30:00Z",
|
|
61972
|
+
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
61973
|
+
pushed_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
61974
|
+
size: 4567,
|
|
61975
|
+
open_issues_count: 23,
|
|
61976
|
+
license: {
|
|
61977
|
+
key: "mit",
|
|
61978
|
+
name: "MIT License",
|
|
61979
|
+
spdx_id: "MIT",
|
|
61980
|
+
url: "https://api.github.com/licenses/mit"
|
|
61981
|
+
},
|
|
61982
|
+
owner: {
|
|
61983
|
+
login: username || "moonui",
|
|
61984
|
+
avatar_url: `https://github.com/${username || "moonui"}.png`,
|
|
61985
|
+
html_url: `https://github.com/${username || "moonui"}`,
|
|
61986
|
+
type: "Organization"
|
|
61987
|
+
},
|
|
61988
|
+
contributors_count: 89
|
|
61989
|
+
}
|
|
61990
|
+
];
|
|
61991
|
+
if (repositories && repositories.length > 0) {
|
|
61992
|
+
return repositories.map((repo, index2) => {
|
|
61993
|
+
const [owner, name] = repo.includes("/") ? repo.split("/") : [username || "moonui", repo];
|
|
61994
|
+
return {
|
|
61995
|
+
...defaultRepos[0],
|
|
61996
|
+
id: index2 + 1,
|
|
61997
|
+
name,
|
|
61998
|
+
full_name: `${owner}/${name}`,
|
|
61999
|
+
html_url: `https://github.com/${owner}/${name}`,
|
|
62000
|
+
stargazers_count: Math.floor(Math.random() * 2e4) + 1e3,
|
|
62001
|
+
forks_count: Math.floor(Math.random() * 3e3) + 100,
|
|
62002
|
+
watchers_count: Math.floor(Math.random() * 1e3) + 50,
|
|
62003
|
+
language: ["TypeScript", "JavaScript", "Python", "Go", "Rust"][index2 % 5],
|
|
62004
|
+
owner: {
|
|
62005
|
+
login: owner,
|
|
62006
|
+
avatar_url: `https://github.com/${owner}.png`,
|
|
62007
|
+
html_url: `https://github.com/${owner}`,
|
|
62008
|
+
type: "Organization"
|
|
62009
|
+
}
|
|
62010
|
+
};
|
|
62011
|
+
});
|
|
62012
|
+
}
|
|
62013
|
+
return defaultRepos;
|
|
62014
|
+
}
|
|
61910
62015
|
var MinimalVariant = ({ repos, stats, className }) => {
|
|
61911
62016
|
if (!stats)
|
|
61912
62017
|
return null;
|
|
61913
62018
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-4 text-sm", className), children: [
|
|
61914
|
-
/* @__PURE__ */ jsxs(
|
|
61915
|
-
|
|
61916
|
-
|
|
61917
|
-
|
|
61918
|
-
|
|
61919
|
-
|
|
61920
|
-
|
|
61921
|
-
|
|
61922
|
-
|
|
61923
|
-
|
|
61924
|
-
|
|
61925
|
-
|
|
61926
|
-
|
|
61927
|
-
|
|
61928
|
-
/* @__PURE__ */ jsxs(
|
|
61929
|
-
|
|
61930
|
-
|
|
61931
|
-
|
|
61932
|
-
|
|
61933
|
-
|
|
61934
|
-
|
|
62019
|
+
/* @__PURE__ */ jsxs(
|
|
62020
|
+
"button",
|
|
62021
|
+
{
|
|
62022
|
+
className: "flex items-center gap-2 hover:text-primary transition-colors",
|
|
62023
|
+
onClick: () => repos[0] && window.open(`https://github.com/${repos[0].owner?.login}`, "_blank"),
|
|
62024
|
+
children: [
|
|
62025
|
+
/* @__PURE__ */ jsx(Github, { className: "h-4 w-4" }),
|
|
62026
|
+
/* @__PURE__ */ jsxs("span", { className: "font-medium", children: [
|
|
62027
|
+
repos.length,
|
|
62028
|
+
" repositories"
|
|
62029
|
+
] })
|
|
62030
|
+
]
|
|
62031
|
+
}
|
|
62032
|
+
),
|
|
62033
|
+
/* @__PURE__ */ jsxs(
|
|
62034
|
+
"button",
|
|
62035
|
+
{
|
|
62036
|
+
className: "flex items-center gap-2 hover:text-yellow-600 transition-colors",
|
|
62037
|
+
onClick: () => repos[0] && window.open(`https://github.com/${repos[0].owner?.login}?tab=repositories&q=&type=&language=&sort=stargazers`, "_blank"),
|
|
62038
|
+
children: [
|
|
62039
|
+
/* @__PURE__ */ jsx(Star, { className: "h-4 w-4 text-yellow-500" }),
|
|
62040
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
62041
|
+
formatNumber(stats.totalStars),
|
|
62042
|
+
" stars"
|
|
62043
|
+
] })
|
|
62044
|
+
]
|
|
62045
|
+
}
|
|
62046
|
+
),
|
|
62047
|
+
/* @__PURE__ */ jsxs(
|
|
62048
|
+
"button",
|
|
62049
|
+
{
|
|
62050
|
+
className: "flex items-center gap-2 hover:text-blue-600 transition-colors",
|
|
62051
|
+
onClick: () => repos[0] && window.open(`https://github.com/${repos[0].owner?.login}?tab=repositories&q=&type=fork&language=&sort=`, "_blank"),
|
|
62052
|
+
children: [
|
|
62053
|
+
/* @__PURE__ */ jsx(GitFork, { className: "h-4 w-4 text-blue-500" }),
|
|
62054
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
62055
|
+
formatNumber(stats.totalForks),
|
|
62056
|
+
" forks"
|
|
62057
|
+
] })
|
|
62058
|
+
]
|
|
62059
|
+
}
|
|
62060
|
+
)
|
|
61935
62061
|
] });
|
|
61936
62062
|
};
|
|
61937
62063
|
var CompactVariant = ({
|
|
@@ -61953,21 +62079,35 @@ var CompactVariant = ({
|
|
|
61953
62079
|
] })
|
|
61954
62080
|
] }),
|
|
61955
62081
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 text-sm", children: [
|
|
61956
|
-
/* @__PURE__ */ jsxs(
|
|
61957
|
-
|
|
61958
|
-
|
|
61959
|
-
|
|
61960
|
-
|
|
61961
|
-
|
|
61962
|
-
|
|
61963
|
-
|
|
62082
|
+
/* @__PURE__ */ jsxs(
|
|
62083
|
+
"button",
|
|
62084
|
+
{
|
|
62085
|
+
className: "flex items-center gap-1 hover:text-yellow-600 transition-colors cursor-pointer",
|
|
62086
|
+
onClick: () => window.open(`https://github.com/${repos[0]?.owner?.login}/${repos[0]?.name}/stargazers`, "_blank"),
|
|
62087
|
+
children: [
|
|
62088
|
+
/* @__PURE__ */ jsx(Star, { className: "h-4 w-4 text-yellow-500" }),
|
|
62089
|
+
/* @__PURE__ */ jsx("span", { children: formatNumber(stats.totalStars) })
|
|
62090
|
+
]
|
|
62091
|
+
}
|
|
62092
|
+
),
|
|
62093
|
+
/* @__PURE__ */ jsxs(
|
|
62094
|
+
"button",
|
|
62095
|
+
{
|
|
62096
|
+
className: "flex items-center gap-1 hover:text-blue-600 transition-colors cursor-pointer",
|
|
62097
|
+
onClick: () => window.open(`https://github.com/${repos[0]?.owner?.login}/${repos[0]?.name}/forks`, "_blank"),
|
|
62098
|
+
children: [
|
|
62099
|
+
/* @__PURE__ */ jsx(GitFork, { className: "h-4 w-4 text-blue-500" }),
|
|
62100
|
+
/* @__PURE__ */ jsx("span", { children: formatNumber(stats.totalForks) })
|
|
62101
|
+
]
|
|
62102
|
+
}
|
|
62103
|
+
)
|
|
61964
62104
|
] })
|
|
61965
62105
|
] }),
|
|
61966
62106
|
/* @__PURE__ */ jsx("div", { className: "space-y-2", children: topRepos.map((repo) => /* @__PURE__ */ jsxs(
|
|
61967
62107
|
"div",
|
|
61968
62108
|
{
|
|
61969
62109
|
className: "flex items-center justify-between p-2 rounded-md hover:bg-accent cursor-pointer transition-colors",
|
|
61970
|
-
onClick: () =>
|
|
62110
|
+
onClick: () => window.open(`https://github.com/${repo.owner?.login}/${repo.name}`, "_blank"),
|
|
61971
62111
|
children: [
|
|
61972
62112
|
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
61973
62113
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium truncate", children: repo.name }),
|
|
@@ -62009,12 +62149,15 @@ var CardVariant = ({
|
|
|
62009
62149
|
children: /* @__PURE__ */ jsx(
|
|
62010
62150
|
MoonUICardPro,
|
|
62011
62151
|
{
|
|
62012
|
-
className: "h-full hover:shadow-lg transition-shadow cursor-pointer",
|
|
62013
|
-
onClick: () =>
|
|
62152
|
+
className: "h-full hover:shadow-lg transition-shadow cursor-pointer group",
|
|
62153
|
+
onClick: () => window.open(`https://github.com/${repo.owner?.login}/${repo.name}`, "_blank"),
|
|
62014
62154
|
children: /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "p-6", children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
62015
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
62016
|
-
/* @__PURE__ */
|
|
62017
|
-
|
|
62155
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between", children: [
|
|
62156
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
62157
|
+
/* @__PURE__ */ jsx("h3", { className: "font-semibold text-lg mb-1", children: repo.name }),
|
|
62158
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground line-clamp-2", children: repo.description || "No description available" })
|
|
62159
|
+
] }),
|
|
62160
|
+
/* @__PURE__ */ jsx(ExternalLink, { className: "h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity" })
|
|
62018
62161
|
] }),
|
|
62019
62162
|
repo.topics.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: repo.topics.slice(0, 3).map((topic) => /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "secondary", className: "text-xs", children: topic }, topic)) }),
|
|
62020
62163
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-sm", children: [
|
|
@@ -62029,14 +62172,34 @@ var CardVariant = ({
|
|
|
62029
62172
|
/* @__PURE__ */ jsx("span", { children: repo.language })
|
|
62030
62173
|
] }) }),
|
|
62031
62174
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
62032
|
-
/* @__PURE__ */ jsxs(
|
|
62033
|
-
|
|
62034
|
-
|
|
62035
|
-
|
|
62036
|
-
|
|
62037
|
-
|
|
62038
|
-
|
|
62039
|
-
|
|
62175
|
+
/* @__PURE__ */ jsxs(
|
|
62176
|
+
"button",
|
|
62177
|
+
{
|
|
62178
|
+
className: "flex items-center gap-1 hover:text-yellow-600 transition-colors",
|
|
62179
|
+
onClick: (e) => {
|
|
62180
|
+
e.stopPropagation();
|
|
62181
|
+
window.open(`https://github.com/${repo.owner?.login}/${repo.name}/stargazers`, "_blank");
|
|
62182
|
+
},
|
|
62183
|
+
children: [
|
|
62184
|
+
/* @__PURE__ */ jsx(Star, { className: "h-4 w-4 text-yellow-500" }),
|
|
62185
|
+
/* @__PURE__ */ jsx("span", { children: formatNumber(repo.stargazers_count) })
|
|
62186
|
+
]
|
|
62187
|
+
}
|
|
62188
|
+
),
|
|
62189
|
+
/* @__PURE__ */ jsxs(
|
|
62190
|
+
"button",
|
|
62191
|
+
{
|
|
62192
|
+
className: "flex items-center gap-1 hover:text-blue-600 transition-colors",
|
|
62193
|
+
onClick: (e) => {
|
|
62194
|
+
e.stopPropagation();
|
|
62195
|
+
window.open(`https://github.com/${repo.owner?.login}/${repo.name}/forks`, "_blank");
|
|
62196
|
+
},
|
|
62197
|
+
children: [
|
|
62198
|
+
/* @__PURE__ */ jsx(GitFork, { className: "h-4 w-4 text-blue-500" }),
|
|
62199
|
+
/* @__PURE__ */ jsx("span", { children: formatNumber(repo.forks_count) })
|
|
62200
|
+
]
|
|
62201
|
+
}
|
|
62202
|
+
)
|
|
62040
62203
|
] })
|
|
62041
62204
|
] })
|
|
62042
62205
|
] }) })
|
|
@@ -62056,24 +62219,38 @@ var DetailedVariant = ({
|
|
|
62056
62219
|
if (!stats)
|
|
62057
62220
|
return null;
|
|
62058
62221
|
return /* @__PURE__ */ jsxs(MoonUICardPro, { className: cn("w-full", className), children: [
|
|
62059
|
-
/* @__PURE__ */ jsx(MoonUICardHeaderPro, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
62222
|
+
/* @__PURE__ */ jsx(MoonUICardHeaderPro, { className: "pb-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
62060
62223
|
/* @__PURE__ */ jsxs(MoonUICardTitlePro, { className: "flex items-center gap-2", children: [
|
|
62061
62224
|
/* @__PURE__ */ jsx(Github, { className: "h-6 w-6" }),
|
|
62062
62225
|
"GitHub Repository Analytics"
|
|
62063
62226
|
] }),
|
|
62064
|
-
|
|
62065
|
-
/* @__PURE__ */
|
|
62066
|
-
|
|
62227
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
62228
|
+
repos[0] && /* @__PURE__ */ jsxs(
|
|
62229
|
+
MoonUIButtonPro,
|
|
62230
|
+
{
|
|
62231
|
+
onClick: () => window.open(`https://github.com/${repos[0].owner?.login}`, "_blank"),
|
|
62232
|
+
variant: "outline",
|
|
62233
|
+
size: "sm",
|
|
62234
|
+
children: [
|
|
62235
|
+
/* @__PURE__ */ jsx(Github, { className: "h-4 w-4 mr-2" }),
|
|
62236
|
+
"View Profile"
|
|
62237
|
+
]
|
|
62238
|
+
}
|
|
62239
|
+
),
|
|
62240
|
+
onExport && /* @__PURE__ */ jsxs(MoonUIButtonPro, { onClick: onExport, variant: "outline", size: "sm", children: [
|
|
62241
|
+
/* @__PURE__ */ jsx(Download, { className: "h-4 w-4 mr-2" }),
|
|
62242
|
+
"Export"
|
|
62243
|
+
] })
|
|
62067
62244
|
] })
|
|
62068
62245
|
] }) }),
|
|
62069
|
-
/* @__PURE__ */ jsx(MoonUICardContentPro, { children: /* @__PURE__ */ jsxs(MoonUITabsPro, { defaultValue: "overview", className: "w-full", children: [
|
|
62070
|
-
/* @__PURE__ */ jsxs(MoonUITabsListPro, { className: "grid w-full grid-cols-4", children: [
|
|
62246
|
+
/* @__PURE__ */ jsx(MoonUICardContentPro, { className: "pt-0", children: /* @__PURE__ */ jsxs(MoonUITabsPro, { defaultValue: "overview", className: "w-full mt-4", children: [
|
|
62247
|
+
/* @__PURE__ */ jsxs(MoonUITabsListPro, { className: "grid w-full grid-cols-4 mb-6", children: [
|
|
62071
62248
|
/* @__PURE__ */ jsx(MoonUITabsTriggerPro, { value: "overview", children: "Overview" }),
|
|
62072
62249
|
/* @__PURE__ */ jsx(MoonUITabsTriggerPro, { value: "repositories", children: "Repositories" }),
|
|
62073
62250
|
/* @__PURE__ */ jsx(MoonUITabsTriggerPro, { value: "languages", children: "Languages" }),
|
|
62074
62251
|
/* @__PURE__ */ jsx(MoonUITabsTriggerPro, { value: "activity", children: "Activity" })
|
|
62075
62252
|
] }),
|
|
62076
|
-
/* @__PURE__ */ jsxs(MoonUITabsContentPro, { value: "overview", className: "space-y-
|
|
62253
|
+
/* @__PURE__ */ jsxs(MoonUITabsContentPro, { value: "overview", className: "space-y-6 mt-6", children: [
|
|
62077
62254
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4", children: [
|
|
62078
62255
|
/* @__PURE__ */ jsx(
|
|
62079
62256
|
StatCard,
|
|
@@ -62088,7 +62265,8 @@ var DetailedVariant = ({
|
|
|
62088
62265
|
{
|
|
62089
62266
|
icon: /* @__PURE__ */ jsx(Star, { className: "h-4 w-4 text-yellow-500" }),
|
|
62090
62267
|
label: "Total Stars",
|
|
62091
|
-
value: formatNumber(stats.totalStars)
|
|
62268
|
+
value: formatNumber(stats.totalStars),
|
|
62269
|
+
onClick: () => repos[0] && window.open(`https://github.com/${repos[0].owner?.login}?tab=repositories&q=&type=&language=&sort=stargazers`, "_blank")
|
|
62092
62270
|
}
|
|
62093
62271
|
),
|
|
62094
62272
|
/* @__PURE__ */ jsx(
|
|
@@ -62108,27 +62286,40 @@ var DetailedVariant = ({
|
|
|
62108
62286
|
}
|
|
62109
62287
|
)
|
|
62110
62288
|
] }),
|
|
62111
|
-
stats.mostStarredRepo && /* @__PURE__ */ jsx(
|
|
62112
|
-
|
|
62113
|
-
|
|
62114
|
-
|
|
62115
|
-
|
|
62116
|
-
|
|
62117
|
-
"
|
|
62118
|
-
|
|
62119
|
-
|
|
62120
|
-
|
|
62121
|
-
|
|
62289
|
+
stats.mostStarredRepo && /* @__PURE__ */ jsx(
|
|
62290
|
+
MoonUICardPro,
|
|
62291
|
+
{
|
|
62292
|
+
className: "hover:shadow-md transition-shadow cursor-pointer",
|
|
62293
|
+
onClick: () => window.open(`https://github.com/${stats.mostStarredRepo.owner?.login}/${stats.mostStarredRepo.name}`, "_blank"),
|
|
62294
|
+
children: /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "p-6", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
62295
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
62296
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-2", children: "Most Starred Repository" }),
|
|
62297
|
+
/* @__PURE__ */ jsx("h4", { className: "font-semibold text-lg mb-1", children: stats.mostStarredRepo.name }),
|
|
62298
|
+
/* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground", children: [
|
|
62299
|
+
formatNumber(stats.mostStarredRepo.stargazers_count),
|
|
62300
|
+
" stars"
|
|
62301
|
+
] })
|
|
62302
|
+
] }),
|
|
62303
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-2", children: [
|
|
62304
|
+
/* @__PURE__ */ jsx(TrendingUp, { className: "h-8 w-8 text-muted-foreground" }),
|
|
62305
|
+
/* @__PURE__ */ jsx(ExternalLink, { className: "h-4 w-4 text-muted-foreground" })
|
|
62306
|
+
] })
|
|
62307
|
+
] }) })
|
|
62308
|
+
}
|
|
62309
|
+
)
|
|
62122
62310
|
] }),
|
|
62123
|
-
/* @__PURE__ */ jsx(MoonUITabsContentPro, { value: "repositories", className: "space-y-4", children: /* @__PURE__ */ jsx("div", { className: "space-y-
|
|
62311
|
+
/* @__PURE__ */ jsx(MoonUITabsContentPro, { value: "repositories", className: "space-y-4 mt-6", children: /* @__PURE__ */ jsx("div", { className: "space-y-3", children: repos.map((repo) => /* @__PURE__ */ jsx(
|
|
62124
62312
|
MoonUICardPro,
|
|
62125
62313
|
{
|
|
62126
|
-
className: "hover:shadow-md transition-shadow cursor-pointer",
|
|
62127
|
-
onClick: () =>
|
|
62128
|
-
children: /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "p-
|
|
62314
|
+
className: "hover:shadow-md transition-shadow cursor-pointer group",
|
|
62315
|
+
onClick: () => window.open(`https://github.com/${repo.owner?.login}/${repo.name}`, "_blank"),
|
|
62316
|
+
children: /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "p-5", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between", children: [
|
|
62129
62317
|
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
62130
|
-
/* @__PURE__ */
|
|
62131
|
-
|
|
62318
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
62319
|
+
/* @__PURE__ */ jsx("h4", { className: "font-semibold text-base", children: repo.name }),
|
|
62320
|
+
repo.private && /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "secondary", className: "text-xs", children: "Private" })
|
|
62321
|
+
] }),
|
|
62322
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-3", children: repo.description || "No description" }),
|
|
62132
62323
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 text-sm", children: [
|
|
62133
62324
|
repo.language && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
62134
62325
|
/* @__PURE__ */ jsx(
|
|
@@ -62142,67 +62333,166 @@ var DetailedVariant = ({
|
|
|
62142
62333
|
),
|
|
62143
62334
|
/* @__PURE__ */ jsx("span", { children: repo.language })
|
|
62144
62335
|
] }),
|
|
62145
|
-
/* @__PURE__ */ jsxs(
|
|
62146
|
-
|
|
62147
|
-
|
|
62148
|
-
|
|
62149
|
-
|
|
62150
|
-
|
|
62151
|
-
|
|
62152
|
-
|
|
62336
|
+
/* @__PURE__ */ jsxs(
|
|
62337
|
+
"button",
|
|
62338
|
+
{
|
|
62339
|
+
className: "flex items-center gap-1 hover:text-yellow-600 transition-colors",
|
|
62340
|
+
onClick: (e) => {
|
|
62341
|
+
e.stopPropagation();
|
|
62342
|
+
window.open(`https://github.com/${repo.owner?.login}/${repo.name}/stargazers`, "_blank");
|
|
62343
|
+
},
|
|
62344
|
+
children: [
|
|
62345
|
+
/* @__PURE__ */ jsx(Star, { className: "h-3 w-3" }),
|
|
62346
|
+
/* @__PURE__ */ jsx("span", { children: formatNumber(repo.stargazers_count) })
|
|
62347
|
+
]
|
|
62348
|
+
}
|
|
62349
|
+
),
|
|
62350
|
+
/* @__PURE__ */ jsxs(
|
|
62351
|
+
"button",
|
|
62352
|
+
{
|
|
62353
|
+
className: "flex items-center gap-1 hover:text-blue-600 transition-colors",
|
|
62354
|
+
onClick: (e) => {
|
|
62355
|
+
e.stopPropagation();
|
|
62356
|
+
window.open(`https://github.com/${repo.owner?.login}/${repo.name}/forks`, "_blank");
|
|
62357
|
+
},
|
|
62358
|
+
children: [
|
|
62359
|
+
/* @__PURE__ */ jsx(GitFork, { className: "h-3 w-3" }),
|
|
62360
|
+
/* @__PURE__ */ jsx("span", { children: formatNumber(repo.forks_count) })
|
|
62361
|
+
]
|
|
62362
|
+
}
|
|
62363
|
+
),
|
|
62364
|
+
/* @__PURE__ */ jsxs(
|
|
62365
|
+
"button",
|
|
62366
|
+
{
|
|
62367
|
+
className: "flex items-center gap-1 hover:text-purple-600 transition-colors",
|
|
62368
|
+
onClick: (e) => {
|
|
62369
|
+
e.stopPropagation();
|
|
62370
|
+
window.open(`https://github.com/${repo.owner?.login}/${repo.name}/issues`, "_blank");
|
|
62371
|
+
},
|
|
62372
|
+
children: [
|
|
62373
|
+
/* @__PURE__ */ jsx(Users, { className: "h-3 w-3" }),
|
|
62374
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
62375
|
+
repo.open_issues_count,
|
|
62376
|
+
" issues"
|
|
62377
|
+
] })
|
|
62378
|
+
]
|
|
62379
|
+
}
|
|
62380
|
+
),
|
|
62153
62381
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
62154
62382
|
/* @__PURE__ */ jsx(Calendar$1, { className: "h-3 w-3" }),
|
|
62155
62383
|
/* @__PURE__ */ jsx("span", { children: formatDate2(repo.updated_at) })
|
|
62156
62384
|
] })
|
|
62157
62385
|
] })
|
|
62158
62386
|
] }),
|
|
62159
|
-
/* @__PURE__ */ jsx(
|
|
62387
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx(
|
|
62388
|
+
MoonUIButtonPro,
|
|
62389
|
+
{
|
|
62390
|
+
size: "sm",
|
|
62391
|
+
variant: "ghost",
|
|
62392
|
+
className: "opacity-0 group-hover:opacity-100 transition-opacity",
|
|
62393
|
+
onClick: (e) => {
|
|
62394
|
+
e.stopPropagation();
|
|
62395
|
+
window.open(`https://github.com/${repo.owner?.login}/${repo.name}`, "_blank");
|
|
62396
|
+
},
|
|
62397
|
+
children: /* @__PURE__ */ jsx(ExternalLink, { className: "h-4 w-4" })
|
|
62398
|
+
}
|
|
62399
|
+
) })
|
|
62160
62400
|
] }) })
|
|
62161
62401
|
},
|
|
62162
62402
|
repo.id
|
|
62163
62403
|
)) }) }),
|
|
62164
|
-
/* @__PURE__ */
|
|
62165
|
-
/* @__PURE__ */
|
|
62166
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center
|
|
62167
|
-
/* @__PURE__ */
|
|
62168
|
-
|
|
62169
|
-
|
|
62170
|
-
|
|
62171
|
-
|
|
62172
|
-
|
|
62173
|
-
|
|
62174
|
-
|
|
62404
|
+
/* @__PURE__ */ jsxs(MoonUITabsContentPro, { value: "languages", className: "space-y-6 mt-6", children: [
|
|
62405
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-4", children: stats.languages.map((lang) => /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
62406
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-sm", children: [
|
|
62407
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
62408
|
+
/* @__PURE__ */ jsx(
|
|
62409
|
+
"div",
|
|
62410
|
+
{
|
|
62411
|
+
className: "w-3 h-3 rounded-full shadow-sm",
|
|
62412
|
+
style: { backgroundColor: lang.color }
|
|
62413
|
+
}
|
|
62414
|
+
),
|
|
62415
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium", children: lang.language })
|
|
62416
|
+
] }),
|
|
62417
|
+
/* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
|
|
62418
|
+
lang.count,
|
|
62419
|
+
" repos (",
|
|
62420
|
+
lang.percentage.toFixed(1),
|
|
62421
|
+
"%)"
|
|
62422
|
+
] })
|
|
62175
62423
|
] }),
|
|
62176
|
-
/* @__PURE__ */
|
|
62177
|
-
|
|
62178
|
-
|
|
62179
|
-
|
|
62180
|
-
|
|
62181
|
-
|
|
62182
|
-
|
|
62183
|
-
|
|
62184
|
-
|
|
62185
|
-
|
|
62186
|
-
|
|
62187
|
-
|
|
62188
|
-
|
|
62189
|
-
|
|
62190
|
-
|
|
62191
|
-
|
|
62192
|
-
|
|
62193
|
-
|
|
62194
|
-
|
|
62195
|
-
|
|
62424
|
+
/* @__PURE__ */ jsx("div", { className: "px-1", children: /* @__PURE__ */ jsx(MoonUIProgressPro, { value: lang.percentage, className: "h-2" }) })
|
|
62425
|
+
] }, lang.language)) }),
|
|
62426
|
+
repos[0] && /* @__PURE__ */ jsx("div", { className: "pt-4 border-t", children: /* @__PURE__ */ jsxs(
|
|
62427
|
+
MoonUIButtonPro,
|
|
62428
|
+
{
|
|
62429
|
+
variant: "outline",
|
|
62430
|
+
className: "w-full",
|
|
62431
|
+
onClick: () => window.open(`https://github.com/${repos[0].owner?.login}?tab=repositories&q=&type=&language=&sort=`, "_blank"),
|
|
62432
|
+
children: [
|
|
62433
|
+
/* @__PURE__ */ jsx(BarChart3, { className: "h-4 w-4 mr-2" }),
|
|
62434
|
+
"View Language Statistics on GitHub"
|
|
62435
|
+
]
|
|
62436
|
+
}
|
|
62437
|
+
) })
|
|
62438
|
+
] }),
|
|
62439
|
+
/* @__PURE__ */ jsxs(MoonUITabsContentPro, { value: "activity", className: "space-y-4 mt-6", children: [
|
|
62440
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-3", children: stats.recentActivity.map((activity, index2) => {
|
|
62441
|
+
const repo = repos.find((r2) => r2.name === activity.repository);
|
|
62442
|
+
return /* @__PURE__ */ jsxs(
|
|
62443
|
+
"div",
|
|
62444
|
+
{
|
|
62445
|
+
className: "flex items-center gap-4 p-4 rounded-lg bg-accent/30 hover:bg-accent/50 transition-colors cursor-pointer",
|
|
62446
|
+
onClick: () => repo && window.open(`https://github.com/${repo.owner?.login}/${repo.name}`, "_blank"),
|
|
62447
|
+
children: [
|
|
62448
|
+
/* @__PURE__ */ jsx(Activity, { className: "h-4 w-4 text-muted-foreground flex-shrink-0" }),
|
|
62449
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
62450
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: activity.description }),
|
|
62451
|
+
/* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground mt-1", children: [
|
|
62452
|
+
activity.repository,
|
|
62453
|
+
" \u2022 ",
|
|
62454
|
+
formatDate2(activity.timestamp)
|
|
62455
|
+
] })
|
|
62456
|
+
] }),
|
|
62457
|
+
/* @__PURE__ */ jsx(ExternalLink, { className: "h-3 w-3 text-muted-foreground flex-shrink-0" })
|
|
62458
|
+
]
|
|
62459
|
+
},
|
|
62460
|
+
index2
|
|
62461
|
+
);
|
|
62462
|
+
}) }),
|
|
62463
|
+
repos[0] && /* @__PURE__ */ jsx("div", { className: "pt-4 border-t", children: /* @__PURE__ */ jsxs(
|
|
62464
|
+
MoonUIButtonPro,
|
|
62465
|
+
{
|
|
62466
|
+
variant: "outline",
|
|
62467
|
+
className: "w-full",
|
|
62468
|
+
onClick: () => window.open(`https://github.com/${repos[0].owner?.login}?tab=repositories&q=&type=&language=&sort=updated`, "_blank"),
|
|
62469
|
+
children: [
|
|
62470
|
+
/* @__PURE__ */ jsx(Activity, { className: "h-4 w-4 mr-2" }),
|
|
62471
|
+
"View All Activity on GitHub"
|
|
62472
|
+
]
|
|
62473
|
+
}
|
|
62474
|
+
) })
|
|
62475
|
+
] })
|
|
62196
62476
|
] }) })
|
|
62197
62477
|
] });
|
|
62198
62478
|
};
|
|
62199
|
-
var StatCard = ({ icon, label, value }) => /* @__PURE__ */ jsx(
|
|
62200
|
-
|
|
62201
|
-
|
|
62202
|
-
|
|
62203
|
-
|
|
62204
|
-
|
|
62205
|
-
|
|
62479
|
+
var StatCard = ({ icon, label, value, onClick }) => /* @__PURE__ */ jsx(
|
|
62480
|
+
MoonUICardPro,
|
|
62481
|
+
{
|
|
62482
|
+
className: cn(
|
|
62483
|
+
"transition-all",
|
|
62484
|
+
onClick && "hover:shadow-md cursor-pointer hover:scale-105"
|
|
62485
|
+
),
|
|
62486
|
+
onClick,
|
|
62487
|
+
children: /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "p-5", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
62488
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
62489
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-1", children: label }),
|
|
62490
|
+
/* @__PURE__ */ jsx("p", { className: "text-2xl font-bold", children: value })
|
|
62491
|
+
] }),
|
|
62492
|
+
/* @__PURE__ */ jsx("div", { className: "text-muted-foreground", children: icon })
|
|
62493
|
+
] }) })
|
|
62494
|
+
}
|
|
62495
|
+
);
|
|
62206
62496
|
var GitHubStarsInternal = ({
|
|
62207
62497
|
username = "",
|
|
62208
62498
|
repository,
|
|
@@ -62244,7 +62534,11 @@ var GitHubStarsInternal = ({
|
|
|
62244
62534
|
size: size4 = "md",
|
|
62245
62535
|
customColors
|
|
62246
62536
|
}) => {
|
|
62247
|
-
const
|
|
62537
|
+
const isDocsMode2 = typeof window !== "undefined" && (window.location.pathname.includes("/docs/") || window.location.pathname.includes("/components/"));
|
|
62538
|
+
const effectiveAutoRefresh = isDocsMode2 ? false : autoRefresh;
|
|
62539
|
+
const effectiveNotifications = isDocsMode2 ? false : enableNotifications;
|
|
62540
|
+
const effectiveRefreshInterval = isDocsMode2 ? 36e5 : refreshInterval;
|
|
62541
|
+
const { notify } = useGitHubNotifications(effectiveNotifications);
|
|
62248
62542
|
const handleMilestoneReached = t__default.useCallback((milestone) => {
|
|
62249
62543
|
if (celebrateAt?.includes(milestone.count)) {
|
|
62250
62544
|
confetti({
|
|
@@ -62272,14 +62566,18 @@ var GitHubStarsInternal = ({
|
|
|
62272
62566
|
repository,
|
|
62273
62567
|
repositories,
|
|
62274
62568
|
token,
|
|
62275
|
-
autoRefresh,
|
|
62276
|
-
refreshInterval,
|
|
62569
|
+
autoRefresh: effectiveAutoRefresh,
|
|
62570
|
+
refreshInterval: effectiveRefreshInterval,
|
|
62277
62571
|
sortBy,
|
|
62278
62572
|
maxItems,
|
|
62279
62573
|
onError,
|
|
62280
62574
|
onDataUpdate,
|
|
62281
62575
|
onMilestoneReached: handleMilestoneReached,
|
|
62282
|
-
milestones
|
|
62576
|
+
milestones,
|
|
62577
|
+
docsMode: isDocsMode2,
|
|
62578
|
+
// Docs mode flag'ini gönder
|
|
62579
|
+
mockDataFallback: true
|
|
62580
|
+
// Docs modunda mock data kullan
|
|
62283
62581
|
});
|
|
62284
62582
|
const handleExport = t__default.useCallback((format7) => {
|
|
62285
62583
|
if (!enableExport)
|
|
@@ -62428,12 +62726,13 @@ var GitHubStarsInternal = ({
|
|
|
62428
62726
|
className: cn("w-full", className),
|
|
62429
62727
|
children: [
|
|
62430
62728
|
renderVariant(),
|
|
62431
|
-
rateLimitInfo && rateLimitInfo.remaining < 10 && /* @__PURE__ */ jsx("div", { className: "mt-4 p-3 bg-yellow-50 dark:bg-yellow-900/20 rounded-md text-sm", children: /* @__PURE__ */ jsxs("p", { className: "text-yellow-800 dark:text-yellow-200", children: [
|
|
62729
|
+
!isDocsMode2 && rateLimitInfo && rateLimitInfo.remaining < 10 && /* @__PURE__ */ jsx("div", { className: "mt-4 p-3 bg-yellow-50 dark:bg-yellow-900/20 rounded-md text-sm", children: /* @__PURE__ */ jsxs("p", { className: "text-yellow-800 dark:text-yellow-200", children: [
|
|
62432
62730
|
"\u26A0\uFE0F Low API rate limit: ",
|
|
62433
62731
|
rateLimitInfo.remaining,
|
|
62434
62732
|
" requests remaining.",
|
|
62435
62733
|
token ? "" : " Consider adding a GitHub token for higher limits."
|
|
62436
|
-
] }) })
|
|
62734
|
+
] }) }),
|
|
62735
|
+
isDocsMode2 && true && /* @__PURE__ */ jsx("div", { className: "mt-2 text-xs text-muted-foreground text-center", children: "\u{1F4DA} Docs Mode: API istekleri optimize edildi" })
|
|
62437
62736
|
]
|
|
62438
62737
|
}
|
|
62439
62738
|
);
|