@breakergames/design-system 0.1.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.
Files changed (57) hide show
  1. package/dist/components/Avatar/Avatar.d.ts +8 -0
  2. package/dist/components/Avatar/index.d.ts +2 -0
  3. package/dist/components/Badge/Badge.d.ts +9 -0
  4. package/dist/components/Badge/index.d.ts +2 -0
  5. package/dist/components/BottomInputBar/BottomInputBar.d.ts +10 -0
  6. package/dist/components/BottomInputBar/index.d.ts +2 -0
  7. package/dist/components/Button/Button.d.ts +10 -0
  8. package/dist/components/Button/index.d.ts +2 -0
  9. package/dist/components/Card/Card.d.ts +9 -0
  10. package/dist/components/Card/FeaturedCard.d.ts +15 -0
  11. package/dist/components/Card/GeneratingCard.d.ts +7 -0
  12. package/dist/components/Card/ScenarioCard.d.ts +15 -0
  13. package/dist/components/Card/index.d.ts +8 -0
  14. package/dist/components/ChatBubble/ChatBubble.d.ts +7 -0
  15. package/dist/components/ChatBubble/index.d.ts +2 -0
  16. package/dist/components/GameGrid/GameGrid.d.ts +8 -0
  17. package/dist/components/GameGrid/HotGrid.d.ts +9 -0
  18. package/dist/components/GameGrid/WaterfallGrid.d.ts +8 -0
  19. package/dist/components/GameGrid/index.d.ts +6 -0
  20. package/dist/components/Header/Header.d.ts +21 -0
  21. package/dist/components/Header/index.d.ts +2 -0
  22. package/dist/components/Input/Input.d.ts +8 -0
  23. package/dist/components/Input/index.d.ts +2 -0
  24. package/dist/components/LikeButton/LikeButton.d.ts +9 -0
  25. package/dist/components/LikeButton/index.d.ts +2 -0
  26. package/dist/components/Modal/BottomSheet.d.ts +11 -0
  27. package/dist/components/Modal/Modal.d.ts +10 -0
  28. package/dist/components/Modal/index.d.ts +4 -0
  29. package/dist/components/StatCard/StatCard.d.ts +8 -0
  30. package/dist/components/StatCard/index.d.ts +2 -0
  31. package/dist/icons/ArrowUpIcon.d.ts +4 -0
  32. package/dist/icons/CloseIcon.d.ts +4 -0
  33. package/dist/icons/HeartIcon.d.ts +5 -0
  34. package/dist/icons/PlayIcon.d.ts +4 -0
  35. package/dist/icons/index.d.ts +4 -0
  36. package/dist/index.cjs.js +1 -0
  37. package/dist/index.d.ts +30 -0
  38. package/dist/index.es.js +361 -0
  39. package/dist/style.css +1 -0
  40. package/dist/tokens/colors.d.ts +14 -0
  41. package/dist/tokens/spacing.d.ts +20 -0
  42. package/dist/tokens/typography.d.ts +9 -0
  43. package/dist/types/index.d.ts +19 -0
  44. package/guidelines/Guidelines.md +41 -0
  45. package/guidelines/components/badge.md +25 -0
  46. package/guidelines/components/button.md +30 -0
  47. package/guidelines/components/card.md +51 -0
  48. package/guidelines/components/chat-bubble.md +17 -0
  49. package/guidelines/components/game-grid.md +34 -0
  50. package/guidelines/components/header.md +38 -0
  51. package/guidelines/components/input.md +22 -0
  52. package/guidelines/components/modal.md +42 -0
  53. package/guidelines/design-tokens/colors.md +47 -0
  54. package/guidelines/design-tokens/spacing.md +47 -0
  55. package/guidelines/design-tokens/typography.md +30 -0
  56. package/guidelines/overview-components.md +43 -0
  57. package/package.json +38 -0
@@ -0,0 +1,34 @@
1
+ # Game Grid Components
2
+
3
+ ## GameGrid
4
+ Responsive card grid layout. 2 columns on mobile, 3 on tablet, optionally 4 on desktop.
5
+
6
+ ```tsx
7
+ <GameGrid columns={3}>
8
+ <ScenarioCard ... />
9
+ <ScenarioCard ... />
10
+ <ScenarioCard ... />
11
+ </GameGrid>
12
+ ```
13
+
14
+ ## HotGrid
15
+ Section with emoji icon + title header, followed by a content grid.
16
+ Use for "Trending", "New", "Popular" sections.
17
+
18
+ ```tsx
19
+ <HotGrid title="Trending" icon="🔥">
20
+ <ScenarioCard ... />
21
+ <ScenarioCard ... />
22
+ </HotGrid>
23
+ ```
24
+
25
+ ## WaterfallGrid
26
+ Two-column masonry layout where the right column is offset 24px down.
27
+ Use for infinite scroll feeds.
28
+
29
+ ```tsx
30
+ <WaterfallGrid
31
+ leftColumn={<><ScenarioCard /><ScenarioCard /></>}
32
+ rightColumn={<><ScenarioCard /><ScenarioCard /></>}
33
+ />
34
+ ```
@@ -0,0 +1,38 @@
1
+ # Header
2
+
3
+ Fixed top navigation bar with frosted glass background.
4
+
5
+ ## Layout
6
+ - **Logo** (left): Icon + gradient text (text hidden on mobile)
7
+ - **Tabs** (center): Pill-shaped navigation tabs
8
+ - **Actions** (right): Language toggle, user name/avatar, sign in button
9
+
10
+ ## Props
11
+ - `logoText`: string — brand name (default: "Makabaka")
12
+ - `logoIcon`: ReactNode — logo icon (default: 🦙)
13
+ - `tabs`: HeaderTab[] — `{ id: string, label: string }`
14
+ - `activeTab`: string — currently active tab ID
15
+ - `onTabChange`: (id) => void
16
+ - `userName`: string — logged-in user name
17
+ - `avatar`: ReactNode — avatar component
18
+ - `onSignIn`: () => void — show sign in button
19
+ - `onLogout`: () => void
20
+ - `languageLabel`: string — e.g. "EN" or "中文"
21
+ - `onLanguageToggle`: () => void
22
+
23
+ ## Usage
24
+ ```tsx
25
+ <Header
26
+ tabs={[
27
+ { id: 'recommend', label: 'For You' },
28
+ { id: 'community', label: 'Community' },
29
+ { id: 'messages', label: 'Messages' },
30
+ ]}
31
+ activeTab="recommend"
32
+ onTabChange={setTab}
33
+ userName="Alice"
34
+ avatar={<Avatar name="Alice" size="sm" />}
35
+ languageLabel="EN"
36
+ onLanguageToggle={toggleLang}
37
+ />
38
+ ```
@@ -0,0 +1,22 @@
1
+ # Input
2
+
3
+ Text input field with optional label, error state, and helper text.
4
+
5
+ ## States
6
+ - **Default**: Dark background, subtle border
7
+ - **Focus**: Purple border with ring
8
+ - **Error**: Red border, error message below
9
+ - **Disabled**: Reduced opacity
10
+
11
+ ## Props
12
+ - `label`: string — label text above input
13
+ - `error`: string — error message (activates red border)
14
+ - `helperText`: string — hint text below input
15
+ - All standard `<input>` attributes (type, placeholder, etc.)
16
+
17
+ ## Usage
18
+ ```tsx
19
+ <Input label="Email" type="email" placeholder="you@example.com" />
20
+ <Input label="Password" type="password" error="Password is too short" />
21
+ <Input label="Code" helperText="Check your email for the code" />
22
+ ```
@@ -0,0 +1,42 @@
1
+ # Modal & BottomSheet
2
+
3
+ ## Modal
4
+ Centered overlay dialog with frosted backdrop.
5
+
6
+ ### Sizes
7
+ - `sm` — 400px max width (alerts, confirmations)
8
+ - `md` — 560px max width (forms, game details)
9
+ - `lg` — 896px max width (full game detail view)
10
+
11
+ ### Props
12
+ - `isOpen`: boolean
13
+ - `onClose`: () => void
14
+ - `size`: 'sm' | 'md' | 'lg'
15
+
16
+ ### Usage
17
+ ```tsx
18
+ <Modal isOpen={showDetail} onClose={close} size="lg">
19
+ <GameDetailContent />
20
+ </Modal>
21
+ ```
22
+
23
+ ## BottomSheet
24
+ Bottom-sliding panel on mobile, centered modal on desktop.
25
+
26
+ ### Props
27
+ - `isOpen`: boolean
28
+ - `onClose`: () => void
29
+ - `title`: string
30
+ - `subtitle`: string
31
+
32
+ ### Features
33
+ - Mobile drag handle (hidden on desktop)
34
+ - Header with title, subtitle, close button
35
+ - Scrollable body content
36
+
37
+ ### Usage
38
+ ```tsx
39
+ <BottomSheet isOpen={showSimilar} onClose={close} title="Similar Games" subtitle="8 games found">
40
+ <GameList />
41
+ </BottomSheet>
42
+ ```
@@ -0,0 +1,47 @@
1
+ # Color Tokens
2
+
3
+ ## Brand Colors
4
+ | Token | Value | Usage |
5
+ |-------|-------|-------|
6
+ | `--maka-primary` | `#7c5cfa` | Primary actions, active states, logo gradient start |
7
+ | `--maka-primary-hover` | `#6b4ee0` | Primary button hover state |
8
+ | `--maka-secondary` | `#5c9cfa` | Secondary accents, logo gradient end |
9
+ | `--maka-accent` | `#06d6a0` | Success indicators, highlights |
10
+
11
+ ## Surface Colors
12
+ | Token | Value | Usage |
13
+ |-------|-------|-------|
14
+ | `--maka-bg-dark` | `#1b2838` | Page background |
15
+ | `--maka-bg-card` | `#1e2a3a` | Card/panel surfaces |
16
+ | `--maka-bg-hover` | `#2a3a4a` | Hover state surfaces |
17
+ | `--maka-bg-overlay` | `rgba(0,0,0,0.8)` | Modal backdrops |
18
+ | `--maka-bg-frosted` | `rgba(0,0,0,0.7)` | Frosted glass panels |
19
+
20
+ ## Text Colors
21
+ | Token | Value | Usage |
22
+ |-------|-------|-------|
23
+ | `--maka-text-primary` | `#e8e8ec` | Main content text |
24
+ | `--maka-text-secondary` | `rgba(255,255,255,0.7)` | Labels, descriptions |
25
+ | `--maka-text-muted` | `rgba(255,255,255,0.4)` | Placeholders, hints |
26
+ | `--maka-text-disabled` | `rgba(255,255,255,0.3)` | Disabled elements |
27
+
28
+ ## Semantic Colors
29
+ | Token | Value | Usage |
30
+ |-------|-------|-------|
31
+ | `--maka-danger` | `#ef4444` | Errors, destructive actions |
32
+ | `--maka-success` | `#22c55e` | Success messages |
33
+ | `--maka-warning` | `#f59e0b` | Warnings, cautions |
34
+ | `--maka-like` | `#f43f5e` | Like/heart active state |
35
+
36
+ ## Gradients
37
+ - **Primary gradient**: `linear-gradient(to right, var(--maka-primary), var(--maka-secondary))`
38
+ - **Card overlay**: `linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%)`
39
+
40
+ ## Badge Colors
41
+ Each badge type has a `from` and `to` gradient:
42
+ - Staff Pick: amber `#f59e0b` → `#eab308`
43
+ - Hot: orange `#f97316` → red `#ef4444`
44
+ - Liked: pink `#ec4899` → rose `#f43f5e`
45
+ - Rising: green `#22c55e` → emerald `#10b981`
46
+ - New: purple `#a855f7` → indigo `#6366f1`
47
+ - Trending: cyan `#06b6d4` → blue `#3b82f6`
@@ -0,0 +1,47 @@
1
+ # Spacing & Layout
2
+
3
+ ## Spacing Scale
4
+ | Token | Value | Usage |
5
+ |-------|-------|-------|
6
+ | `--maka-space-1` | 4px | Tight gaps (badge icon-text) |
7
+ | `--maka-space-2` | 8px | Small gaps (tab spacing, icon gaps) |
8
+ | `--maka-space-3` | 12px | Grid gaps, card padding compact |
9
+ | `--maka-space-4` | 16px | Standard padding, input padding |
10
+ | `--maka-space-5` | 20px | Card content padding |
11
+ | `--maka-space-6` | 24px | Card padding, section gaps |
12
+ | `--maka-space-8` | 32px | Desktop header padding, large gaps |
13
+ | `--maka-space-10` | 40px | Section margins |
14
+ | `--maka-space-12` | 48px | Page top padding (below header) |
15
+ | `--maka-space-16` | 64px | Hero section padding |
16
+
17
+ ## Border Radius
18
+ | Token | Value | Usage |
19
+ |-------|-------|-------|
20
+ | `--maka-radius-sm` | 4px | Chat bubble sharp corners |
21
+ | `--maka-radius-md` | 8px | Buttons, inputs |
22
+ | `--maka-radius-lg` | 12px | Cards, stat cards |
23
+ | `--maka-radius-xl` | 16px | Featured cards, chat bubbles |
24
+ | `--maka-radius-2xl` | 24px | Modals, bottom sheets |
25
+ | `--maka-radius-full` | 9999px | Pills, badges, avatars, tabs |
26
+
27
+ ## Borders
28
+ | Token | Value | Usage |
29
+ |-------|-------|-------|
30
+ | `--maka-border-subtle` | `rgba(255,255,255,0.1)` | Default card/divider borders |
31
+ | `--maka-border-medium` | `rgba(255,255,255,0.2)` | Input borders, language toggle |
32
+ | `--maka-border-emphasis` | `rgba(255,255,255,0.4)` | Hover emphasis borders |
33
+ | `--maka-border-primary` | `rgba(124,92,250,0.4)` | Primary accent borders |
34
+
35
+ ## Shadows
36
+ | Token | Value | Usage |
37
+ |-------|-------|-------|
38
+ | `--maka-shadow-card` | `0 8px 24px rgba(0,0,0,0.3)` | Card hover shadows |
39
+ | `--maka-shadow-button` | `0 4px 16px rgba(124,92,250,0.35)` | Primary button glow |
40
+
41
+ ## Layout Patterns
42
+ - **Max container width**: 896px (`max-width: 56rem`)
43
+ - **Page padding**: 16px mobile, 32px desktop
44
+ - **Header height**: ~56px
45
+ - **Bottom bar height**: ~64px (+ safe-area-inset)
46
+ - **Grid columns**: 2 (mobile) → 3 (tablet) → 4 (desktop)
47
+ - **Grid gap**: 12px (mobile) → 16px (desktop)
@@ -0,0 +1,30 @@
1
+ # Typography
2
+
3
+ ## Font Families
4
+ | Token | Value | Usage |
5
+ |-------|-------|-------|
6
+ | `--maka-font-display` | "Plus Jakarta Sans", "Inter", sans-serif | Headings, logos, card titles, stats |
7
+ | `--maka-font-body` | "Inter", sans-serif | Body text, labels, buttons, inputs |
8
+
9
+ ## Font Weights
10
+ | Weight | Value | Usage |
11
+ |--------|-------|-------|
12
+ | Regular | 400 | Body text, descriptions |
13
+ | Medium | 500 | Labels, buttons, tabs |
14
+ | Semibold | 600 | Card titles, section headers |
15
+ | Bold | 700 | Page titles, logo text, stats |
16
+ | Extrabold | 800 | Hero headings |
17
+
18
+ ## Type Scale (recommended)
19
+ | Size | Usage |
20
+ |------|-------|
21
+ | 11px | Badges |
22
+ | 12px | Stat labels, helper text |
23
+ | 13px | Secondary text, card stats, error/helper messages |
24
+ | 14px | Body text, inputs, buttons (md), tabs |
25
+ | 15px | Card titles, tabs (desktop) |
26
+ | 16px | Buttons (lg) |
27
+ | 18px | Section headers, bottom sheet titles |
28
+ | 20px | Featured card titles |
29
+ | 24px | Page titles, logo text |
30
+ | 28px | Stat values |
@@ -0,0 +1,43 @@
1
+ # Component Overview
2
+
3
+ ## Primitives
4
+ | Component | Description | When to use |
5
+ |-----------|-------------|-------------|
6
+ | `Button` | Action button with 4 variants | Any clickable action |
7
+ | `Input` | Text input with label/error | Forms, search fields |
8
+ | `Badge` | Colored pill label | Game status tags (Hot, New, etc.) |
9
+ | `Avatar` | Circular user image/initial | User profiles, comments |
10
+ | `StatCard` | Metric display card | Dashboard statistics |
11
+
12
+ ## Cards
13
+ | Component | Description | When to use |
14
+ |-----------|-------------|-------------|
15
+ | `Card` | Base container card | Generic card wrapper |
16
+ | `FeaturedCard` | Hero-size game card with overlay | Featured/promoted games |
17
+ | `ScenarioCard` | Standard game listing card | Game grids and lists |
18
+ | `GeneratingCard` | Loading placeholder card | During AI game generation |
19
+
20
+ ## Chat
21
+ | Component | Description | When to use |
22
+ |-----------|-------------|-------------|
23
+ | `ChatBubble` | Message bubble (user/assistant) | MakaAI chat conversations |
24
+ | `LikeButton` | Heart toggle with count | Like/favorite actions |
25
+ | `BottomInputBar` | Fixed bottom input trigger | Discovery page chat launcher |
26
+
27
+ ## Layout
28
+ | Component | Description | When to use |
29
+ |-----------|-------------|-------------|
30
+ | `Header` | Fixed top navigation bar | Every page (required) |
31
+ | `Modal` | Centered overlay dialog | Game details, confirmations |
32
+ | `BottomSheet` | Bottom-sliding panel | Similar games, filters |
33
+ | `GameGrid` | Responsive card grid | Game listings (2-4 cols) |
34
+ | `HotGrid` | Section with title + grid | Trending/featured sections |
35
+ | `WaterfallGrid` | Masonry 2-column layout | Infinite scroll feed |
36
+
37
+ ## Icons
38
+ | Icon | Description |
39
+ |------|-------------|
40
+ | `PlayIcon` | Filled play triangle |
41
+ | `CloseIcon` | X close mark |
42
+ | `HeartIcon` | Heart (outline or filled) |
43
+ | `ArrowUpIcon` | Upward arrow |
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@breakergames/design-system",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "main": "dist/index.cjs.js",
6
+ "module": "dist/index.es.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.es.js",
11
+ "require": "./dist/index.cjs.js",
12
+ "types": "./dist/index.d.ts"
13
+ },
14
+ "./theme.css": "./dist/style.css"
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "guidelines"
19
+ ],
20
+ "peerDependencies": {
21
+ "react": ">=18.0.0",
22
+ "react-dom": ">=18.0.0"
23
+ },
24
+ "devDependencies": {
25
+ "@types/react": "^18.2.0",
26
+ "@types/react-dom": "^18.2.0",
27
+ "@vitejs/plugin-react": "^4.0.0",
28
+ "react": "^18.2.0",
29
+ "react-dom": "^18.2.0",
30
+ "typescript": "^5.3.0",
31
+ "vite": "^5.0.0",
32
+ "vite-plugin-dts": "^3.7.0"
33
+ },
34
+ "scripts": {
35
+ "build": "vite build",
36
+ "dev": "vite build --watch"
37
+ }
38
+ }