botc-character-sheet 0.1.0 → 0.2.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.
- package/README.md +118 -0
- package/package.json +3 -2
package/README.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# botc-character-sheet
|
|
2
|
+
|
|
3
|
+
Reusable Preact component for rendering Blood on the Clocktower character sheets with a beautiful parchment theme.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install botc-character-sheet
|
|
9
|
+
# or
|
|
10
|
+
bun add botc-character-sheet
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { CharacterSheet, SheetBack } from 'botc-character-sheet';
|
|
17
|
+
import 'botc-character-sheet/style.css';
|
|
18
|
+
|
|
19
|
+
function App() {
|
|
20
|
+
const characters = {
|
|
21
|
+
townsfolk: [...],
|
|
22
|
+
outsider: [...],
|
|
23
|
+
minion: [...],
|
|
24
|
+
demon: [...],
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<>
|
|
29
|
+
<CharacterSheet
|
|
30
|
+
title="My Custom Script"
|
|
31
|
+
author="John Doe"
|
|
32
|
+
characters={characters}
|
|
33
|
+
color="#137415"
|
|
34
|
+
jinxes={[]}
|
|
35
|
+
showSwirls={true}
|
|
36
|
+
solidTitle={false}
|
|
37
|
+
iconScale={1.6}
|
|
38
|
+
compactAppearance={false}
|
|
39
|
+
/>
|
|
40
|
+
<SheetBack
|
|
41
|
+
title="My Custom Script"
|
|
42
|
+
color="#137415"
|
|
43
|
+
includeMargins={false}
|
|
44
|
+
/>
|
|
45
|
+
</>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Components
|
|
51
|
+
|
|
52
|
+
### CharacterSheet
|
|
53
|
+
|
|
54
|
+
Main character sheet component with parchment background and styled sections.
|
|
55
|
+
|
|
56
|
+
**Props:**
|
|
57
|
+
- `title` (string): Script title
|
|
58
|
+
- `author` (string, optional): Script author name
|
|
59
|
+
- `characters` (GroupedCharacters): Characters grouped by team
|
|
60
|
+
- `color` (string): Theme color (default: "#137415")
|
|
61
|
+
- `jinxes` (Jinx[]): Array of jinx relationships
|
|
62
|
+
- `showSwirls` (boolean): Show decorative swirls (default: true)
|
|
63
|
+
- `solidTitle` (boolean): Use solid title background (default: false)
|
|
64
|
+
- `iconScale` (number): Scale character icons (default: 1.6)
|
|
65
|
+
- `compactAppearance` (boolean): Use compact layout (default: false)
|
|
66
|
+
- `includeMargins` (boolean): Add margins for printing (default: false)
|
|
67
|
+
|
|
68
|
+
### SheetBack
|
|
69
|
+
|
|
70
|
+
Backing sheet component for double-sided printing.
|
|
71
|
+
|
|
72
|
+
**Props:**
|
|
73
|
+
- `title` (string): Script title
|
|
74
|
+
- `color` (string): Theme color
|
|
75
|
+
- `includeMargins` (boolean): Add margins for printing
|
|
76
|
+
|
|
77
|
+
## Types
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
interface ResolvedCharacter {
|
|
81
|
+
id: string;
|
|
82
|
+
name: string;
|
|
83
|
+
ability: string;
|
|
84
|
+
team: 'townsfolk' | 'outsider' | 'minion' | 'demon' | 'traveller' | 'fabled';
|
|
85
|
+
image?: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
interface GroupedCharacters {
|
|
89
|
+
townsfolk: ResolvedCharacter[];
|
|
90
|
+
outsider: ResolvedCharacter[];
|
|
91
|
+
minion: ResolvedCharacter[];
|
|
92
|
+
demon: ResolvedCharacter[];
|
|
93
|
+
traveller?: ResolvedCharacter[];
|
|
94
|
+
fabled?: ResolvedCharacter[];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
interface Jinx {
|
|
98
|
+
id: string;
|
|
99
|
+
jinx: Array<{ id: string; reason: string }>;
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Development
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Install dependencies
|
|
107
|
+
bun install
|
|
108
|
+
|
|
109
|
+
# Build
|
|
110
|
+
bun run build
|
|
111
|
+
|
|
112
|
+
# Watch mode
|
|
113
|
+
bun run dev
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## License
|
|
117
|
+
|
|
118
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "botc-character-sheet",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
19
|
"build": "vite build && tsc --emitDeclarationOnly --outDir dist",
|
|
20
|
-
"dev": "vite build --watch"
|
|
20
|
+
"dev": "vite build --watch",
|
|
21
|
+
"publish": "bun run build && bun publish"
|
|
21
22
|
},
|
|
22
23
|
"peerDependencies": {
|
|
23
24
|
"preact": "^10.19.3"
|