@ankhorage/zora-tabletop 0.0.1 → 0.0.3
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/CHANGELOG.md +12 -0
- package/README.md +294 -72
- package/dist/colors.d.ts +17 -0
- package/dist/colors.d.ts.map +1 -1
- package/dist/colors.js +116 -8
- package/dist/colors.js.map +1 -1
- package/dist/components/card-back/CardBack.d.ts +12 -0
- package/dist/components/card-back/CardBack.d.ts.map +1 -1
- package/dist/components/card-back/CardBack.js +12 -0
- package/dist/components/card-back/CardBack.js.map +1 -1
- package/dist/components/card-hand/CardHand.d.ts +12 -0
- package/dist/components/card-hand/CardHand.d.ts.map +1 -1
- package/dist/components/card-hand/CardHand.js +12 -0
- package/dist/components/card-hand/CardHand.js.map +1 -1
- package/dist/components/playing-card/PlayingCard.d.ts +13 -0
- package/dist/components/playing-card/PlayingCard.d.ts.map +1 -1
- package/dist/components/playing-card/PlayingCard.js +13 -0
- package/dist/components/playing-card/PlayingCard.js.map +1 -1
- package/dist/components/tabletop-table/TabletopTable.d.ts +17 -0
- package/dist/components/tabletop-table/TabletopTable.d.ts.map +1 -1
- package/dist/components/tabletop-table/TabletopTable.js +23 -6
- package/dist/components/tabletop-table/TabletopTable.js.map +1 -1
- package/package.json +2 -2
- package/src/colors.test.ts +58 -0
- package/src/colors.ts +156 -8
- package/src/components/card-back/CardBack.tsx +12 -0
- package/src/components/card-hand/CardHand.tsx +12 -0
- package/src/components/playing-card/PlayingCard.tsx +13 -0
- package/src/components/tabletop-table/TabletopTable.tsx +23 -6
|
@@ -21,6 +21,23 @@ function createSeatAccessibilityLabel(seat: TabletopSeatState): string | undefin
|
|
|
21
21
|
return parts.join(', ');
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
/***
|
|
25
|
+
* Responsive tabletop surface for generic card-game and board-game scenes.
|
|
26
|
+
*
|
|
27
|
+
* Use `TabletopTable` to arrange seats around a themed table surface, display
|
|
28
|
+
* shared center cards, and show neutral seat labels/tokens without embedding game
|
|
29
|
+
* rules into the component.
|
|
30
|
+
*
|
|
31
|
+
* @readme
|
|
32
|
+
* @example Basic table
|
|
33
|
+
* ```tsx
|
|
34
|
+
* <TabletopTable
|
|
35
|
+
* seats={seats}
|
|
36
|
+
* centerCards={[{ rank: 'A', suit: 'spades' }]}
|
|
37
|
+
* centerLabel="Round 1"
|
|
38
|
+
* />
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
24
41
|
export function TabletopTable({
|
|
25
42
|
seats,
|
|
26
43
|
centerCards = [],
|
|
@@ -73,13 +90,13 @@ export function TabletopTable({
|
|
|
73
90
|
) : null}
|
|
74
91
|
{centerLabel !== undefined ? (
|
|
75
92
|
<View style={[styles.centerLabel, { backgroundColor: colors.seatSurface }]}>
|
|
76
|
-
<Text style={[styles.centerLabelText, { color: colors.
|
|
93
|
+
<Text style={[styles.centerLabelText, { color: colors.seatText }]}>
|
|
77
94
|
{centerLabel}
|
|
78
95
|
</Text>
|
|
79
96
|
</View>
|
|
80
97
|
) : null}
|
|
81
98
|
{centerSublabel !== undefined ? (
|
|
82
|
-
<Text style={[styles.centerSublabel, { color: colors.
|
|
99
|
+
<Text style={[styles.centerSublabel, { color: colors.tableMutedText }]}>
|
|
83
100
|
{centerSublabel}
|
|
84
101
|
</Text>
|
|
85
102
|
) : null}
|
|
@@ -114,9 +131,9 @@ export function TabletopTable({
|
|
|
114
131
|
size={cardSize}
|
|
115
132
|
/>
|
|
116
133
|
) : null}
|
|
117
|
-
<Text style={[styles.seatLabel, { color: colors.
|
|
134
|
+
<Text style={[styles.seatLabel, { color: colors.seatText }]}>{seat.label}</Text>
|
|
118
135
|
{seat.sublabel !== undefined ? (
|
|
119
|
-
<Text style={[styles.seatSublabel, { color: colors.
|
|
136
|
+
<Text style={[styles.seatSublabel, { color: colors.seatMutedText }]}>
|
|
120
137
|
{seat.sublabel}
|
|
121
138
|
</Text>
|
|
122
139
|
) : null}
|
|
@@ -154,7 +171,7 @@ const styles = StyleSheet.create({
|
|
|
154
171
|
},
|
|
155
172
|
centerSublabel: {
|
|
156
173
|
fontSize: 11,
|
|
157
|
-
fontWeight: '
|
|
174
|
+
fontWeight: '700',
|
|
158
175
|
},
|
|
159
176
|
circleSurface: {
|
|
160
177
|
borderRadius: 999,
|
|
@@ -197,7 +214,7 @@ const styles = StyleSheet.create({
|
|
|
197
214
|
},
|
|
198
215
|
seatSublabel: {
|
|
199
216
|
fontSize: 10,
|
|
200
|
-
fontWeight: '
|
|
217
|
+
fontWeight: '700',
|
|
201
218
|
},
|
|
202
219
|
surface: {
|
|
203
220
|
borderWidth: 8,
|