@freegamestore/games 0.12.1 → 0.13.0

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.
@@ -0,0 +1,8 @@
1
+ import type { LeaderboardEntry } from './useLeaderboard.js';
2
+ export interface LeaderboardProps {
3
+ topScores: LeaderboardEntry[];
4
+ recentScores: LeaderboardEntry[];
5
+ loading: boolean;
6
+ }
7
+ export declare function Leaderboard({ topScores, recentScores, loading }: LeaderboardProps): React.JSX.Element;
8
+ //# sourceMappingURL=Leaderboard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Leaderboard.d.ts","sourceRoot":"","sources":["../src/Leaderboard.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,YAAY,EAAE,gBAAgB,EAAE,CAAC;IACjC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,gBAAgB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA2DrG"}
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ export function Leaderboard({ topScores, recentScores, loading }) {
4
+ const [tab, setTab] = useState('top');
5
+ const scores = tab === 'top' ? topScores : recentScores;
6
+ if (loading) {
7
+ return (_jsx("div", { className: "px-4 py-3 text-xs", style: { color: 'var(--muted)' }, children: "Loading scores..." }));
8
+ }
9
+ return (_jsxs("div", { className: "flex flex-col gap-2 px-4 py-3", children: [_jsx("div", { className: "flex gap-1", children: ['top', 'recent'].map((t) => (_jsx("button", { onClick: () => setTab(t), className: "px-3 py-1 text-xs font-semibold rounded-lg", style: {
10
+ background: tab === t ? 'var(--accent)' : 'transparent',
11
+ color: tab === t ? '#fff' : 'var(--muted)',
12
+ }, children: t === 'top' ? 'Top' : 'Recent' }, t))) }), scores.length === 0 ? (_jsx("div", { className: "text-xs", style: { color: 'var(--muted)' }, children: "No scores yet. Be the first!" })) : (_jsx("div", { className: "flex flex-col gap-1", children: scores.map((entry, i) => (_jsxs("div", { className: "flex items-center justify-between text-xs py-1", style: { borderBottom: '1px solid var(--line)' }, children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "w-5 text-right font-semibold", style: { color: i < 3 ? 'var(--accent)' : 'var(--muted)' }, children: i + 1 }), _jsx("span", { className: "truncate max-w-[8rem]", children: entry.player_name })] }), _jsx("span", { className: "font-bold", style: { fontFamily: 'Fraunces, serif' }, children: entry.score.toLocaleString() })] }, `${entry.player_name}-${entry.score}-${i}`))) }))] }));
13
+ }
14
+ //# sourceMappingURL=Leaderboard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Leaderboard.js","sourceRoot":"","sources":["../src/Leaderboard.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AASjC,MAAM,UAAU,WAAW,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAoB;IAChF,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAmB,KAAK,CAAC,CAAC;IACxD,MAAM,MAAM,GAAG,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC;IAExD,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CACL,cAAK,SAAS,EAAC,mBAAmB,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,kCAE7D,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,eAAK,SAAS,EAAC,+BAA+B,aAC5C,cAAK,SAAS,EAAC,YAAY,YACvB,CAAC,KAAK,EAAE,QAAQ,CAAW,CAAC,GAAG,CAAC,CAAC,CAA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C,EAAE,CAgB3C,CACP,CAAC,GACE,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -18,6 +18,7 @@ export { GameButton, type GameButtonProps, type GameButtonVariant, type GameButt
18
18
  export { GameAuth } from './GameAuth.js';
19
19
  export { useAuth, type User } from './useAuth.js';
20
20
  export { useLeaderboard, type LeaderboardEntry, } from './useLeaderboard.js';
21
+ export { Leaderboard, type LeaderboardProps } from './Leaderboard.js';
21
22
  export { useSound } from './SoundContext.js';
22
23
  export { useGameSounds } from './useGameSounds.js';
23
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EACL,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,cAAc,GACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,cAAc,GACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EACL,cAAc,EACd,KAAK,gBAAgB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EACL,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,cAAc,GACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,cAAc,GACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EACL,cAAc,EACd,KAAK,gBAAgB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -18,6 +18,7 @@ export { GameButton, } from './GameButton.js';
18
18
  export { GameAuth } from './GameAuth.js';
19
19
  export { useAuth } from './useAuth.js';
20
20
  export { useLeaderboard, } from './useLeaderboard.js';
21
+ export { Leaderboard } from './Leaderboard.js';
21
22
  export { useSound } from './SoundContext.js';
22
23
  export { useGameSounds } from './useGameSounds.js';
23
24
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,SAAS,EAAuB,MAAM,gBAAgB,CAAC;AAChE,OAAO,EACL,UAAU,GAGX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,UAAU,GAIX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,OAAO,EAAa,MAAM,cAAc,CAAC;AAClD,OAAO,EACL,cAAc,GAEf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,SAAS,EAAuB,MAAM,gBAAgB,CAAC;AAChE,OAAO,EACL,UAAU,GAGX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,UAAU,GAIX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,OAAO,EAAa,MAAM,cAAc,CAAC;AAClD,OAAO,EACL,cAAc,GAEf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAyB,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@freegamestore/games",
3
- "version": "0.12.1",
3
+ "version": "0.13.0",
4
4
  "description": "Shared React UI primitives for games on FreeGameStore — GameShell, GameTopbar, etc. Brand-consistent, scroll-free.",
5
5
  "license": "MIT",
6
6
  "type": "module",