@ankhorage/zora-tabletop 0.0.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 (94) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +98 -0
  3. package/dist/cardLabel.d.ts +4 -0
  4. package/dist/cardLabel.d.ts.map +1 -0
  5. package/dist/cardLabel.js +9 -0
  6. package/dist/cardLabel.js.map +1 -0
  7. package/dist/cardSizing.d.ts +10 -0
  8. package/dist/cardSizing.d.ts.map +1 -0
  9. package/dist/cardSizing.js +27 -0
  10. package/dist/cardSizing.js.map +1 -0
  11. package/dist/colors.d.ts +44 -0
  12. package/dist/colors.d.ts.map +1 -0
  13. package/dist/colors.js +20 -0
  14. package/dist/colors.js.map +1 -0
  15. package/dist/components/card-back/CardBack.d.ts +4 -0
  16. package/dist/components/card-back/CardBack.d.ts.map +1 -0
  17. package/dist/components/card-back/CardBack.js +44 -0
  18. package/dist/components/card-back/CardBack.js.map +1 -0
  19. package/dist/components/card-back/index.d.ts +3 -0
  20. package/dist/components/card-back/index.d.ts.map +1 -0
  21. package/dist/components/card-back/index.js +2 -0
  22. package/dist/components/card-back/index.js.map +1 -0
  23. package/dist/components/card-back/types.d.ts +10 -0
  24. package/dist/components/card-back/types.d.ts.map +1 -0
  25. package/dist/components/card-back/types.js +2 -0
  26. package/dist/components/card-back/types.js.map +1 -0
  27. package/dist/components/card-hand/CardHand.d.ts +4 -0
  28. package/dist/components/card-hand/CardHand.d.ts.map +1 -0
  29. package/dist/components/card-hand/CardHand.js +23 -0
  30. package/dist/components/card-hand/CardHand.js.map +1 -0
  31. package/dist/components/card-hand/index.d.ts +3 -0
  32. package/dist/components/card-hand/index.d.ts.map +1 -0
  33. package/dist/components/card-hand/index.js +2 -0
  34. package/dist/components/card-hand/index.js.map +1 -0
  35. package/dist/components/card-hand/types.d.ts +12 -0
  36. package/dist/components/card-hand/types.d.ts.map +1 -0
  37. package/dist/components/card-hand/types.js +2 -0
  38. package/dist/components/card-hand/types.js.map +1 -0
  39. package/dist/components/playing-card/PlayingCard.d.ts +4 -0
  40. package/dist/components/playing-card/PlayingCard.d.ts.map +1 -0
  41. package/dist/components/playing-card/PlayingCard.js +68 -0
  42. package/dist/components/playing-card/PlayingCard.js.map +1 -0
  43. package/dist/components/playing-card/index.d.ts +3 -0
  44. package/dist/components/playing-card/index.d.ts.map +1 -0
  45. package/dist/components/playing-card/index.js +2 -0
  46. package/dist/components/playing-card/index.js.map +1 -0
  47. package/dist/components/playing-card/types.d.ts +12 -0
  48. package/dist/components/playing-card/types.d.ts.map +1 -0
  49. package/dist/components/playing-card/types.js +2 -0
  50. package/dist/components/playing-card/types.js.map +1 -0
  51. package/dist/components/tabletop-table/TabletopTable.d.ts +4 -0
  52. package/dist/components/tabletop-table/TabletopTable.d.ts.map +1 -0
  53. package/dist/components/tabletop-table/TabletopTable.js +165 -0
  54. package/dist/components/tabletop-table/TabletopTable.js.map +1 -0
  55. package/dist/components/tabletop-table/index.d.ts +3 -0
  56. package/dist/components/tabletop-table/index.d.ts.map +1 -0
  57. package/dist/components/tabletop-table/index.js +2 -0
  58. package/dist/components/tabletop-table/index.js.map +1 -0
  59. package/dist/components/tabletop-table/types.d.ts +17 -0
  60. package/dist/components/tabletop-table/types.d.ts.map +1 -0
  61. package/dist/components/tabletop-table/types.js +2 -0
  62. package/dist/components/tabletop-table/types.js.map +1 -0
  63. package/dist/index.d.ts +12 -0
  64. package/dist/index.d.ts.map +1 -0
  65. package/dist/index.js +6 -0
  66. package/dist/index.js.map +1 -0
  67. package/dist/tablePositions.d.ts +11 -0
  68. package/dist/tablePositions.d.ts.map +1 -0
  69. package/dist/tablePositions.js +85 -0
  70. package/dist/tablePositions.js.map +1 -0
  71. package/dist/types.d.ts +22 -0
  72. package/dist/types.d.ts.map +1 -0
  73. package/dist/types.js +2 -0
  74. package/dist/types.js.map +1 -0
  75. package/package.json +82 -0
  76. package/src/cardLabel.ts +11 -0
  77. package/src/cardSizing.ts +37 -0
  78. package/src/colors.ts +67 -0
  79. package/src/components/card-back/CardBack.tsx +66 -0
  80. package/src/components/card-back/index.ts +2 -0
  81. package/src/components/card-back/types.ts +10 -0
  82. package/src/components/card-hand/CardHand.tsx +55 -0
  83. package/src/components/card-hand/index.ts +2 -0
  84. package/src/components/card-hand/types.ts +12 -0
  85. package/src/components/playing-card/PlayingCard.tsx +99 -0
  86. package/src/components/playing-card/index.ts +2 -0
  87. package/src/components/playing-card/types.ts +12 -0
  88. package/src/components/tabletop-table/TabletopTable.tsx +219 -0
  89. package/src/components/tabletop-table/index.ts +2 -0
  90. package/src/components/tabletop-table/types.ts +24 -0
  91. package/src/index.ts +18 -0
  92. package/src/tablePositions.test.ts +40 -0
  93. package/src/tablePositions.ts +97 -0
  94. package/src/types.ts +24 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ankhorage
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,98 @@
1
+ <!-- markdownlint-disable MD013 MD033 -->
2
+ <!-- This file is generated by Paradox. Do not edit manually. -->
3
+
4
+ # @ankhorage/zora-tabletop
5
+
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v0.0.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
7
+
8
+ Reusable tabletop, playing-card, seat, token, and card-game presentation components for React Native and React Native Web.
9
+
10
+ ## Generated documentation
11
+
12
+ - [Interactive documentation app](././paradox/index.html)
13
+ - [Public API reference](././paradox/exports.md)
14
+ - [Component registry](././paradox/components.md)
15
+ - [Architecture overview](././paradox/diagrams/architecture-overview.mmd)
16
+ - [Module relationships](././paradox/diagrams/module-relationships.mmd)
17
+ - [Export graph](././paradox/diagrams/export-graph.mmd)
18
+ - [CardBack sequence](././paradox/diagrams/sequences/card-back.mmd)
19
+ - [CardHand sequence](././paradox/diagrams/sequences/card-hand.mmd)
20
+ - [PlayingCard sequence](././paradox/diagrams/sequences/playing-card.mmd)
21
+ - [TabletopTable sequence](././paradox/diagrams/sequences/tabletop-table.mmd)
22
+
23
+ ## Architecture preview
24
+
25
+ <details>
26
+ <summary>Architecture overview</summary>
27
+
28
+ ```mermaid
29
+ graph TD
30
+ package__ankhorage_zora_tabletop["@ankhorage/zora-tabletop"]
31
+ entrypoint_src_index_ts["src/index.ts"]
32
+ package__ankhorage_zora_tabletop --> entrypoint_src_index_ts
33
+ module_src_cardLabel_ts["src/cardLabel.ts"]
34
+ package__ankhorage_zora_tabletop -.-> module_src_cardLabel_ts
35
+ module_src_cardLabel_ts --> module_src_types_ts
36
+ module_src_cardSizing_ts["src/cardSizing.ts"]
37
+ package__ankhorage_zora_tabletop -.-> module_src_cardSizing_ts
38
+ module_src_cardSizing_ts --> module_src_types_ts
39
+ module_src_colors_ts["src/colors.ts"]
40
+ package__ankhorage_zora_tabletop -.-> module_src_colors_ts
41
+ module_src_components_card_back_CardBack_tsx["src/components/card-back/CardBack.tsx"]
42
+ package__ankhorage_zora_tabletop -.-> module_src_components_card_back_CardBack_tsx
43
+ module_src_components_card_back_CardBack_tsx --> module_src_cardLabel_ts
44
+ module_src_components_card_back_CardBack_tsx --> module_src_cardSizing_ts
45
+ module_src_components_card_back_CardBack_tsx --> module_src_colors_ts
46
+ module_src_components_card_back_CardBack_tsx --> module_src_components_card_back_types_ts
47
+ module_src_components_card_back_index_ts["src/components/card-back/index.ts"]
48
+ package__ankhorage_zora_tabletop -.-> module_src_components_card_back_index_ts
49
+ module_src_components_card_back_types_ts["src/components/card-back/types.ts"]
50
+ package__ankhorage_zora_tabletop -.-> module_src_components_card_back_types_ts
51
+ module_src_components_card_back_types_ts --> module_src_colors_ts
52
+ module_src_components_card_back_types_ts --> module_src_types_ts
53
+ module_src_components_card_hand_CardHand_tsx["src/components/card-hand/CardHand.tsx"]
54
+ package__ankhorage_zora_tabletop -.-> module_src_components_card_hand_CardHand_tsx
55
+ module_src_components_card_hand_CardHand_tsx --> module_src_components_card_back_index_ts
56
+ module_src_components_card_hand_CardHand_tsx --> module_src_components_card_hand_types_ts
57
+ module_src_components_card_hand_CardHand_tsx --> module_src_components_playing_card_index_ts
58
+ module_src_components_card_hand_index_ts["src/components/card-hand/index.ts"]
59
+ package__ankhorage_zora_tabletop -.-> module_src_components_card_hand_index_ts
60
+ module_src_components_card_hand_types_ts["src/components/card-hand/types.ts"]
61
+ package__ankhorage_zora_tabletop -.-> module_src_components_card_hand_types_ts
62
+ module_src_components_card_hand_types_ts --> module_src_colors_ts
63
+ module_src_components_card_hand_types_ts --> module_src_types_ts
64
+ module_src_components_playing_card_index_ts["src/components/playing-card/index.ts"]
65
+ package__ankhorage_zora_tabletop -.-> module_src_components_playing_card_index_ts
66
+ module_src_components_playing_card_PlayingCard_tsx["src/components/playing-card/PlayingCard.tsx"]
67
+ package__ankhorage_zora_tabletop -.-> module_src_components_playing_card_PlayingCard_tsx
68
+ module_src_components_playing_card_PlayingCard_tsx --> module_src_cardLabel_ts
69
+ module_src_components_playing_card_PlayingCard_tsx --> module_src_cardSizing_ts
70
+ module_src_components_playing_card_PlayingCard_tsx --> module_src_colors_ts
71
+ module_src_components_playing_card_PlayingCard_tsx --> module_src_components_playing_card_types_ts
72
+ module_src_components_playing_card_PlayingCard_tsx --> module_src_types_ts
73
+ module_src_components_playing_card_types_ts["src/components/playing-card/types.ts"]
74
+ package__ankhorage_zora_tabletop -.-> module_src_components_playing_card_types_ts
75
+ module_src_components_playing_card_types_ts --> module_src_colors_ts
76
+ module_src_components_playing_card_types_ts --> module_src_types_ts
77
+ module_src_components_tabletop_table_index_ts["src/components/tabletop-table/index.ts"]
78
+ package__ankhorage_zora_tabletop -.-> module_src_components_tabletop_table_index_ts
79
+ module_src_components_tabletop_table_TabletopTable_tsx["src/components/tabletop-table/TabletopTable.tsx"]
80
+ package__ankhorage_zora_tabletop -.-> module_src_components_tabletop_table_TabletopTable_tsx
81
+ module_src_components_tabletop_table_TabletopTable_tsx --> module_src_colors_ts
82
+ module_src_components_tabletop_table_TabletopTable_tsx --> module_src_components_card_hand_index_ts
83
+ module_src_components_tabletop_table_TabletopTable_tsx --> module_src_components_tabletop_table_types_ts
84
+ module_src_components_tabletop_table_TabletopTable_tsx --> module_src_tablePositions_ts
85
+ module_src_components_tabletop_table_TabletopTable_tsx --> module_src_types_ts
86
+ module_src_components_tabletop_table_types_ts["src/components/tabletop-table/types.ts"]
87
+ package__ankhorage_zora_tabletop -.-> module_src_components_tabletop_table_types_ts
88
+ module_src_components_tabletop_table_types_ts --> module_src_colors_ts
89
+ module_src_components_tabletop_table_types_ts --> module_src_types_ts
90
+ module_src_index_ts["src/index.ts"]
91
+ module_src_tablePositions_ts["src/tablePositions.ts"]
92
+ package__ankhorage_zora_tabletop -.-> module_src_tablePositions_ts
93
+ module_src_tablePositions_ts --> module_src_types_ts
94
+ module_src_types_ts["src/types.ts"]
95
+ package__ankhorage_zora_tabletop -.-> module_src_types_ts
96
+ ```
97
+
98
+ </details>
@@ -0,0 +1,4 @@
1
+ import type { PlayingCardValue } from './types';
2
+ export declare function getPlayingCardLabel(card: PlayingCardValue): string;
3
+ export declare function createHiddenCardLabel(index?: number): string;
4
+ //# sourceMappingURL=cardLabel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cardLabel.d.ts","sourceRoot":"","sources":["../src/cardLabel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAElE;AAED,wBAAgB,qBAAqB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAI5D"}
@@ -0,0 +1,9 @@
1
+ export function getPlayingCardLabel(card) {
2
+ return `${card.rank} ${card.suit}`;
3
+ }
4
+ export function createHiddenCardLabel(index) {
5
+ if (index === undefined)
6
+ return 'Hidden card';
7
+ return `Hidden card ${index + 1}`;
8
+ }
9
+ //# sourceMappingURL=cardLabel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cardLabel.js","sourceRoot":"","sources":["../src/cardLabel.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,mBAAmB,CAAC,IAAsB;IACxD,OAAO,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,KAAc;IAClD,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,aAAa,CAAC;IAE9C,OAAO,eAAe,KAAK,GAAG,CAAC,EAAE,CAAC;AACpC,CAAC","sourcesContent":["import type { PlayingCardValue } from './types';\n\nexport function getPlayingCardLabel(card: PlayingCardValue): string {\n return `${card.rank} ${card.suit}`;\n}\n\nexport function createHiddenCardLabel(index?: number): string {\n if (index === undefined) return 'Hidden card';\n\n return `Hidden card ${index + 1}`;\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import type { TabletopCardSize } from './types';
2
+ export interface TabletopCardDimensions {
3
+ readonly width: number;
4
+ readonly height: number;
5
+ readonly radius: number;
6
+ readonly rankFontSize: number;
7
+ readonly suitFontSize: number;
8
+ }
9
+ export declare function getTabletopCardDimensions(size: TabletopCardSize): TabletopCardDimensions;
10
+ //# sourceMappingURL=cardSizing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cardSizing.d.ts","sourceRoot":"","sources":["../src/cardSizing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AA0BD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,gBAAgB,GAAG,sBAAsB,CAExF"}
@@ -0,0 +1,27 @@
1
+ const cardDimensions = {
2
+ large: {
3
+ width: 56,
4
+ height: 80,
5
+ radius: 8,
6
+ rankFontSize: 20,
7
+ suitFontSize: 16,
8
+ },
9
+ medium: {
10
+ width: 40,
11
+ height: 56,
12
+ radius: 6,
13
+ rankFontSize: 15,
14
+ suitFontSize: 12,
15
+ },
16
+ small: {
17
+ width: 28,
18
+ height: 40,
19
+ radius: 5,
20
+ rankFontSize: 11,
21
+ suitFontSize: 9,
22
+ },
23
+ };
24
+ export function getTabletopCardDimensions(size) {
25
+ return cardDimensions[size];
26
+ }
27
+ //# sourceMappingURL=cardSizing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cardSizing.js","sourceRoot":"","sources":["../src/cardSizing.ts"],"names":[],"mappings":"AAUA,MAAM,cAAc,GAA+D;IACjF,KAAK,EAAE;QACL,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,CAAC;QACT,YAAY,EAAE,EAAE;QAChB,YAAY,EAAE,EAAE;KACjB;IACD,MAAM,EAAE;QACN,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,CAAC;QACT,YAAY,EAAE,EAAE;QAChB,YAAY,EAAE,EAAE;KACjB;IACD,KAAK,EAAE;QACL,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,CAAC;QACT,YAAY,EAAE,EAAE;QAChB,YAAY,EAAE,CAAC;KAChB;CACF,CAAC;AAEF,MAAM,UAAU,yBAAyB,CAAC,IAAsB;IAC9D,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["import type { TabletopCardSize } from './types';\n\nexport interface TabletopCardDimensions {\n readonly width: number;\n readonly height: number;\n readonly radius: number;\n readonly rankFontSize: number;\n readonly suitFontSize: number;\n}\n\nconst cardDimensions: Readonly<Record<TabletopCardSize, TabletopCardDimensions>> = {\n large: {\n width: 56,\n height: 80,\n radius: 8,\n rankFontSize: 20,\n suitFontSize: 16,\n },\n medium: {\n width: 40,\n height: 56,\n radius: 6,\n rankFontSize: 15,\n suitFontSize: 12,\n },\n small: {\n width: 28,\n height: 40,\n radius: 5,\n rankFontSize: 11,\n suitFontSize: 9,\n },\n};\n\nexport function getTabletopCardDimensions(size: TabletopCardSize): TabletopCardDimensions {\n return cardDimensions[size];\n}\n"]}
@@ -0,0 +1,44 @@
1
+ export interface TabletopColorScheme {
2
+ readonly cardBack: string;
3
+ readonly cardBackBorder: string;
4
+ readonly cardBorder: string;
5
+ readonly cardSurface: string;
6
+ readonly cardText: string;
7
+ readonly mutedText: string;
8
+ readonly redSuitText: string;
9
+ readonly seatBorder: string;
10
+ readonly seatSelectedBorder: string;
11
+ readonly seatSurface: string;
12
+ readonly tableBorder: string;
13
+ readonly tableFelt: string;
14
+ readonly tableInnerBorder: string;
15
+ readonly tokenSurface: string;
16
+ readonly tokenText: string;
17
+ }
18
+ export type TabletopColorOverrides = Partial<TabletopColorScheme>;
19
+ export interface TabletopColorThemeShape {
20
+ semantics: {
21
+ action: {
22
+ primary: {
23
+ base: string;
24
+ softBg: string;
25
+ };
26
+ };
27
+ content: {
28
+ default: string;
29
+ muted: string;
30
+ };
31
+ neutral: {
32
+ border: string;
33
+ divider: string;
34
+ surface: string;
35
+ surfaceHover: string;
36
+ };
37
+ warning: {
38
+ base: string;
39
+ softBg: string;
40
+ };
41
+ };
42
+ }
43
+ export declare function createTabletopColorScheme(theme: TabletopColorThemeShape, overrides?: TabletopColorOverrides): TabletopColorScheme;
44
+ //# sourceMappingURL=colors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../src/colors.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAElE,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE;QACT,MAAM,EAAE;YACN,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM,CAAC;gBACb,MAAM,EAAE,MAAM,CAAC;aAChB,CAAC;SACH,CAAC;QACF,OAAO,EAAE;YACP,OAAO,EAAE,MAAM,CAAC;YAChB,KAAK,EAAE,MAAM,CAAC;SACf,CAAC;QACF,OAAO,EAAE;YACP,MAAM,EAAE,MAAM,CAAC;YACf,OAAO,EAAE,MAAM,CAAC;YAChB,OAAO,EAAE,MAAM,CAAC;YAChB,YAAY,EAAE,MAAM,CAAC;SACtB,CAAC;QACF,OAAO,EAAE;YACP,IAAI,EAAE,MAAM,CAAC;YACb,MAAM,EAAE,MAAM,CAAC;SAChB,CAAC;KACH,CAAC;CACH;AAED,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,uBAAuB,EAC9B,SAAS,GAAE,sBAA2B,GACrC,mBAAmB,CAkBrB"}
package/dist/colors.js ADDED
@@ -0,0 +1,20 @@
1
+ export function createTabletopColorScheme(theme, overrides = {}) {
2
+ return {
3
+ cardBack: overrides.cardBack ?? theme.semantics.warning.base,
4
+ cardBackBorder: overrides.cardBackBorder ?? theme.semantics.neutral.border,
5
+ cardBorder: overrides.cardBorder ?? theme.semantics.neutral.border,
6
+ cardSurface: overrides.cardSurface ?? theme.semantics.neutral.surface,
7
+ cardText: overrides.cardText ?? theme.semantics.content.default,
8
+ mutedText: overrides.mutedText ?? theme.semantics.content.muted,
9
+ redSuitText: overrides.redSuitText ?? theme.semantics.warning.base,
10
+ seatBorder: overrides.seatBorder ?? theme.semantics.neutral.divider,
11
+ seatSelectedBorder: overrides.seatSelectedBorder ?? theme.semantics.action.primary.base,
12
+ seatSurface: overrides.seatSurface ?? theme.semantics.neutral.surface,
13
+ tableBorder: overrides.tableBorder ?? theme.semantics.warning.base,
14
+ tableFelt: overrides.tableFelt ?? theme.semantics.action.primary.softBg,
15
+ tableInnerBorder: overrides.tableInnerBorder ?? theme.semantics.neutral.divider,
16
+ tokenSurface: overrides.tokenSurface ?? theme.semantics.warning.softBg,
17
+ tokenText: overrides.tokenText ?? theme.semantics.content.default,
18
+ };
19
+ }
20
+ //# sourceMappingURL=colors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.js","sourceRoot":"","sources":["../src/colors.ts"],"names":[],"mappings":"AA6CA,MAAM,UAAU,yBAAyB,CACvC,KAA8B,EAC9B,YAAoC,EAAE;IAEtC,OAAO;QACL,QAAQ,EAAE,SAAS,CAAC,QAAQ,IAAI,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI;QAC5D,cAAc,EAAE,SAAS,CAAC,cAAc,IAAI,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM;QAC1E,UAAU,EAAE,SAAS,CAAC,UAAU,IAAI,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM;QAClE,WAAW,EAAE,SAAS,CAAC,WAAW,IAAI,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO;QACrE,QAAQ,EAAE,SAAS,CAAC,QAAQ,IAAI,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO;QAC/D,SAAS,EAAE,SAAS,CAAC,SAAS,IAAI,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK;QAC/D,WAAW,EAAE,SAAS,CAAC,WAAW,IAAI,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI;QAClE,UAAU,EAAE,SAAS,CAAC,UAAU,IAAI,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO;QACnE,kBAAkB,EAAE,SAAS,CAAC,kBAAkB,IAAI,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI;QACvF,WAAW,EAAE,SAAS,CAAC,WAAW,IAAI,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO;QACrE,WAAW,EAAE,SAAS,CAAC,WAAW,IAAI,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI;QAClE,SAAS,EAAE,SAAS,CAAC,SAAS,IAAI,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM;QACvE,gBAAgB,EAAE,SAAS,CAAC,gBAAgB,IAAI,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO;QAC/E,YAAY,EAAE,SAAS,CAAC,YAAY,IAAI,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM;QACtE,SAAS,EAAE,SAAS,CAAC,SAAS,IAAI,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO;KAClE,CAAC;AACJ,CAAC","sourcesContent":["export interface TabletopColorScheme {\n readonly cardBack: string;\n readonly cardBackBorder: string;\n readonly cardBorder: string;\n readonly cardSurface: string;\n readonly cardText: string;\n readonly mutedText: string;\n readonly redSuitText: string;\n readonly seatBorder: string;\n readonly seatSelectedBorder: string;\n readonly seatSurface: string;\n readonly tableBorder: string;\n readonly tableFelt: string;\n readonly tableInnerBorder: string;\n readonly tokenSurface: string;\n readonly tokenText: string;\n}\n\nexport type TabletopColorOverrides = Partial<TabletopColorScheme>;\n\nexport interface TabletopColorThemeShape {\n semantics: {\n action: {\n primary: {\n base: string;\n softBg: string;\n };\n };\n content: {\n default: string;\n muted: string;\n };\n neutral: {\n border: string;\n divider: string;\n surface: string;\n surfaceHover: string;\n };\n warning: {\n base: string;\n softBg: string;\n };\n };\n}\n\nexport function createTabletopColorScheme(\n theme: TabletopColorThemeShape,\n overrides: TabletopColorOverrides = {},\n): TabletopColorScheme {\n return {\n cardBack: overrides.cardBack ?? theme.semantics.warning.base,\n cardBackBorder: overrides.cardBackBorder ?? theme.semantics.neutral.border,\n cardBorder: overrides.cardBorder ?? theme.semantics.neutral.border,\n cardSurface: overrides.cardSurface ?? theme.semantics.neutral.surface,\n cardText: overrides.cardText ?? theme.semantics.content.default,\n mutedText: overrides.mutedText ?? theme.semantics.content.muted,\n redSuitText: overrides.redSuitText ?? theme.semantics.warning.base,\n seatBorder: overrides.seatBorder ?? theme.semantics.neutral.divider,\n seatSelectedBorder: overrides.seatSelectedBorder ?? theme.semantics.action.primary.base,\n seatSurface: overrides.seatSurface ?? theme.semantics.neutral.surface,\n tableBorder: overrides.tableBorder ?? theme.semantics.warning.base,\n tableFelt: overrides.tableFelt ?? theme.semantics.action.primary.softBg,\n tableInnerBorder: overrides.tableInnerBorder ?? theme.semantics.neutral.divider,\n tokenSurface: overrides.tokenSurface ?? theme.semantics.warning.softBg,\n tokenText: overrides.tokenText ?? theme.semantics.content.default,\n };\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { CardBackProps } from './types';
3
+ export declare function CardBack({ size, muted, accessibilityLabel, colorScheme, testID, }: CardBackProps): React.JSX.Element;
4
+ //# sourceMappingURL=CardBack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardBack.d.ts","sourceRoot":"","sources":["../../../src/components/card-back/CardBack.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,wBAAgB,QAAQ,CAAC,EACvB,IAAe,EACf,KAAa,EACb,kBAAkB,EAClB,WAAW,EACX,MAAM,GACP,EAAE,aAAa,qBAoCf"}
@@ -0,0 +1,44 @@
1
+ import { useZoraTheme } from '@ankhorage/zora';
2
+ import React from 'react';
3
+ import { StyleSheet, View } from 'react-native';
4
+ import { createHiddenCardLabel } from '../../cardLabel';
5
+ import { getTabletopCardDimensions } from '../../cardSizing';
6
+ import { createTabletopColorScheme } from '../../colors';
7
+ export function CardBack({ size = 'medium', muted = false, accessibilityLabel, colorScheme, testID, }) {
8
+ const { theme } = useZoraTheme();
9
+ const colors = React.useMemo(() => createTabletopColorScheme(theme, colorScheme), [colorScheme, theme]);
10
+ const dimensions = getTabletopCardDimensions(size);
11
+ return (<View accessibilityLabel={accessibilityLabel ?? createHiddenCardLabel()} accessibilityRole="image" style={[
12
+ styles.card,
13
+ {
14
+ backgroundColor: colors.cardBack,
15
+ borderColor: colors.cardBackBorder,
16
+ borderRadius: dimensions.radius,
17
+ height: dimensions.height,
18
+ opacity: muted ? 0.48 : 1,
19
+ width: dimensions.width,
20
+ },
21
+ ]} testID={testID}>
22
+ <View style={[
23
+ styles.inner,
24
+ {
25
+ borderColor: colors.cardBackBorder,
26
+ borderRadius: Math.max(2, dimensions.radius - 3),
27
+ },
28
+ ]}/>
29
+ </View>);
30
+ }
31
+ const styles = StyleSheet.create({
32
+ card: {
33
+ alignItems: 'center',
34
+ borderWidth: 1,
35
+ justifyContent: 'center',
36
+ },
37
+ inner: {
38
+ borderWidth: 1,
39
+ height: '68%',
40
+ opacity: 0.48,
41
+ width: '68%',
42
+ },
43
+ });
44
+ //# sourceMappingURL=CardBack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardBack.js","sourceRoot":"","sources":["../../../src/components/card-back/CardBack.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAGzD,MAAM,UAAU,QAAQ,CAAC,EACvB,IAAI,GAAG,QAAQ,EACf,KAAK,GAAG,KAAK,EACb,kBAAkB,EAClB,WAAW,EACX,MAAM,GACQ;IACd,MAAM,EAAE,KAAK,EAAE,GAAG,YAAY,EAAE,CAAC;IACjC,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAC1B,GAAG,EAAE,CAAC,yBAAyB,CAAC,KAAK,EAAE,WAAW,CAAC,EACnD,CAAC,WAAW,EAAE,KAAK,CAAC,CACrB,CAAC;IACF,MAAM,UAAU,GAAG,yBAAyB,CAAC,IAAI,CAAC,CAAC;IAEnD,OAAO,CACL,CAAC,IAAI,CACH,kBAAkB,CAAC,CAAC,kBAAkB,IAAI,qBAAqB,EAAE,CAAC,CAClE,iBAAiB,CAAC,OAAO,CACzB,KAAK,CAAC,CAAC;YACL,MAAM,CAAC,IAAI;YACX;gBACE,eAAe,EAAE,MAAM,CAAC,QAAQ;gBAChC,WAAW,EAAE,MAAM,CAAC,cAAc;gBAClC,YAAY,EAAE,UAAU,CAAC,MAAM;gBAC/B,MAAM,EAAE,UAAU,CAAC,MAAM;gBACzB,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACzB,KAAK,EAAE,UAAU,CAAC,KAAK;aACxB;SACF,CAAC,CACF,MAAM,CAAC,CAAC,MAAM,CAAC,CAEf;MAAA,CAAC,IAAI,CACH,KAAK,CAAC,CAAC;YACL,MAAM,CAAC,KAAK;YACZ;gBACE,WAAW,EAAE,MAAM,CAAC,cAAc;gBAClC,YAAY,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;aACjD;SACF,CAAC,EAEN;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,UAAU,EAAE,QAAQ;QACpB,WAAW,EAAE,CAAC;QACd,cAAc,EAAE,QAAQ;KACzB;IACD,KAAK,EAAE;QACL,WAAW,EAAE,CAAC;QACd,MAAM,EAAE,KAAK;QACb,OAAO,EAAE,IAAI;QACb,KAAK,EAAE,KAAK;KACb;CACF,CAAC,CAAC","sourcesContent":["import { useZoraTheme } from '@ankhorage/zora';\nimport React from 'react';\nimport { StyleSheet, View } from 'react-native';\n\nimport { createHiddenCardLabel } from '../../cardLabel';\nimport { getTabletopCardDimensions } from '../../cardSizing';\nimport { createTabletopColorScheme } from '../../colors';\nimport type { CardBackProps } from './types';\n\nexport function CardBack({\n size = 'medium',\n muted = false,\n accessibilityLabel,\n colorScheme,\n testID,\n}: CardBackProps) {\n const { theme } = useZoraTheme();\n const colors = React.useMemo(\n () => createTabletopColorScheme(theme, colorScheme),\n [colorScheme, theme],\n );\n const dimensions = getTabletopCardDimensions(size);\n\n return (\n <View\n accessibilityLabel={accessibilityLabel ?? createHiddenCardLabel()}\n accessibilityRole=\"image\"\n style={[\n styles.card,\n {\n backgroundColor: colors.cardBack,\n borderColor: colors.cardBackBorder,\n borderRadius: dimensions.radius,\n height: dimensions.height,\n opacity: muted ? 0.48 : 1,\n width: dimensions.width,\n },\n ]}\n testID={testID}\n >\n <View\n style={[\n styles.inner,\n {\n borderColor: colors.cardBackBorder,\n borderRadius: Math.max(2, dimensions.radius - 3),\n },\n ]}\n />\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n card: {\n alignItems: 'center',\n borderWidth: 1,\n justifyContent: 'center',\n },\n inner: {\n borderWidth: 1,\n height: '68%',\n opacity: 0.48,\n width: '68%',\n },\n});\n"]}
@@ -0,0 +1,3 @@
1
+ export { CardBack } from './CardBack';
2
+ export type { CardBackProps } from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/card-back/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { CardBack } from './CardBack';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/card-back/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export { CardBack } from './CardBack';\nexport type { CardBackProps } from './types';\n"]}
@@ -0,0 +1,10 @@
1
+ import type { TabletopColorOverrides } from '../../colors';
2
+ import type { TabletopCardSize } from '../../types';
3
+ export interface CardBackProps {
4
+ readonly size?: TabletopCardSize;
5
+ readonly muted?: boolean;
6
+ readonly accessibilityLabel?: string;
7
+ readonly colorScheme?: TabletopColorOverrides;
8
+ readonly testID?: string;
9
+ }
10
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/card-back/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,WAAW,CAAC,EAAE,sBAAsB,CAAC;IAC9C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/card-back/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TabletopColorOverrides } from '../../colors';\nimport type { TabletopCardSize } from '../../types';\n\nexport interface CardBackProps {\n readonly size?: TabletopCardSize;\n readonly muted?: boolean;\n readonly accessibilityLabel?: string;\n readonly colorScheme?: TabletopColorOverrides;\n readonly testID?: string;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { CardHandProps } from './types';
3
+ export declare function CardHand({ cards, faceDownCards, size, muted, colorScheme, accessibilityLabel, testID, }: CardHandProps): React.JSX.Element;
4
+ //# sourceMappingURL=CardHand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardHand.d.ts","sourceRoot":"","sources":["../../../src/components/card-hand/CardHand.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAM7C,wBAAgB,QAAQ,CAAC,EACvB,KAAU,EACV,aAAiB,EACjB,IAAe,EACf,KAAa,EACb,WAAW,EACX,kBAAkB,EAClB,MAAM,GACP,EAAE,aAAa,qBA0Bf"}
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { StyleSheet, View } from 'react-native';
3
+ import { CardBack } from '../card-back';
4
+ import { PlayingCard } from '../playing-card';
5
+ function createFaceDownCards(count) {
6
+ return Array.from({ length: Math.max(0, count) }, (_, index) => index);
7
+ }
8
+ export function CardHand({ cards = [], faceDownCards = 0, size = 'medium', muted = false, colorScheme, accessibilityLabel, testID, }) {
9
+ const hiddenCards = createFaceDownCards(faceDownCards);
10
+ return (<View accessibilityLabel={accessibilityLabel} style={styles.hand} testID={testID}>
11
+ {cards.map((card, index) => (<PlayingCard card={card} colorScheme={colorScheme} key={`${card.rank}-${card.suit}-${index}`} muted={muted} size={size} testID={testID ? `${testID}-card-${index}` : undefined}/>))}
12
+ {hiddenCards.map((index) => (<CardBack colorScheme={colorScheme} key={`hidden-${index}`} muted={muted} size={size} testID={testID ? `${testID}-hidden-${index}` : undefined}/>))}
13
+ </View>);
14
+ }
15
+ const styles = StyleSheet.create({
16
+ hand: {
17
+ alignItems: 'center',
18
+ flexDirection: 'row',
19
+ gap: 4,
20
+ justifyContent: 'center',
21
+ },
22
+ });
23
+ //# sourceMappingURL=CardHand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardHand.js","sourceRoot":"","sources":["../../../src/components/card-hand/CardHand.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,SAAS,mBAAmB,CAAC,KAAa;IACxC,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,EACvB,KAAK,GAAG,EAAE,EACV,aAAa,GAAG,CAAC,EACjB,IAAI,GAAG,QAAQ,EACf,KAAK,GAAG,KAAK,EACb,WAAW,EACX,kBAAkB,EAClB,MAAM,GACQ;IACd,MAAM,WAAW,GAAG,mBAAmB,CAAC,aAAa,CAAC,CAAC;IAEvD,OAAO,CACL,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,kBAAkB,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAC/E;MAAA,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAC1B,CAAC,WAAW,CACV,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC,CAC1C,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,SAAS,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EACvD,CACH,CAAC,CACF;MAAA,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAC1B,CAAC,QAAQ,CACP,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,GAAG,CAAC,CAAC,UAAU,KAAK,EAAE,CAAC,CACvB,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,WAAW,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,EACzD,CACH,CAAC,CACJ;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,IAAI,EAAE;QACJ,UAAU,EAAE,QAAQ;QACpB,aAAa,EAAE,KAAK;QACpB,GAAG,EAAE,CAAC;QACN,cAAc,EAAE,QAAQ;KACzB;CACF,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { StyleSheet, View } from 'react-native';\n\nimport { CardBack } from '../card-back';\nimport { PlayingCard } from '../playing-card';\nimport type { CardHandProps } from './types';\n\nfunction createFaceDownCards(count: number): readonly number[] {\n return Array.from({ length: Math.max(0, count) }, (_, index) => index);\n}\n\nexport function CardHand({\n cards = [],\n faceDownCards = 0,\n size = 'medium',\n muted = false,\n colorScheme,\n accessibilityLabel,\n testID,\n}: CardHandProps) {\n const hiddenCards = createFaceDownCards(faceDownCards);\n\n return (\n <View accessibilityLabel={accessibilityLabel} style={styles.hand} testID={testID}>\n {cards.map((card, index) => (\n <PlayingCard\n card={card}\n colorScheme={colorScheme}\n key={`${card.rank}-${card.suit}-${index}`}\n muted={muted}\n size={size}\n testID={testID ? `${testID}-card-${index}` : undefined}\n />\n ))}\n {hiddenCards.map((index) => (\n <CardBack\n colorScheme={colorScheme}\n key={`hidden-${index}`}\n muted={muted}\n size={size}\n testID={testID ? `${testID}-hidden-${index}` : undefined}\n />\n ))}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n hand: {\n alignItems: 'center',\n flexDirection: 'row',\n gap: 4,\n justifyContent: 'center',\n },\n});\n"]}
@@ -0,0 +1,3 @@
1
+ export { CardHand } from './CardHand';
2
+ export type { CardHandProps } from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/card-hand/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { CardHand } from './CardHand';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/card-hand/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export { CardHand } from './CardHand';\nexport type { CardHandProps } from './types';\n"]}
@@ -0,0 +1,12 @@
1
+ import type { TabletopColorOverrides } from '../../colors';
2
+ import type { PlayingCardValue, TabletopCardSize } from '../../types';
3
+ export interface CardHandProps {
4
+ readonly cards?: readonly PlayingCardValue[];
5
+ readonly faceDownCards?: number;
6
+ readonly size?: TabletopCardSize;
7
+ readonly muted?: boolean;
8
+ readonly colorScheme?: TabletopColorOverrides;
9
+ readonly accessibilityLabel?: string;
10
+ readonly testID?: string;
11
+ }
12
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/card-hand/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEtE,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC7C,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,sBAAsB,CAAC;IAC9C,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/card-hand/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TabletopColorOverrides } from '../../colors';\nimport type { PlayingCardValue, TabletopCardSize } from '../../types';\n\nexport interface CardHandProps {\n readonly cards?: readonly PlayingCardValue[];\n readonly faceDownCards?: number;\n readonly size?: TabletopCardSize;\n readonly muted?: boolean;\n readonly colorScheme?: TabletopColorOverrides;\n readonly accessibilityLabel?: string;\n readonly testID?: string;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { PlayingCardProps } from './types';
3
+ export declare function PlayingCard({ card, size, selected, muted, accessibilityLabel, colorScheme, testID, }: PlayingCardProps): React.JSX.Element;
4
+ //# sourceMappingURL=PlayingCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlayingCard.d.ts","sourceRoot":"","sources":["../../../src/components/playing-card/PlayingCard.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAahD,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,IAAe,EACf,QAAgB,EAChB,KAAa,EACb,kBAAkB,EAClB,WAAW,EACX,MAAM,GACP,EAAE,gBAAgB,qBAsDlB"}
@@ -0,0 +1,68 @@
1
+ import { useZoraTheme } from '@ankhorage/zora';
2
+ import React from 'react';
3
+ import { StyleSheet, Text, View } from 'react-native';
4
+ import { getPlayingCardLabel } from '../../cardLabel';
5
+ import { getTabletopCardDimensions } from '../../cardSizing';
6
+ import { createTabletopColorScheme } from '../../colors';
7
+ const suitMarks = {
8
+ clubs: 'C',
9
+ diamonds: 'D',
10
+ hearts: 'H',
11
+ spades: 'S',
12
+ };
13
+ function isRedSuit(suit) {
14
+ return suit === 'diamonds' || suit === 'hearts';
15
+ }
16
+ export function PlayingCard({ card, size = 'medium', selected = false, muted = false, accessibilityLabel, colorScheme, testID, }) {
17
+ const { theme } = useZoraTheme();
18
+ const colors = React.useMemo(() => createTabletopColorScheme(theme, colorScheme), [colorScheme, theme]);
19
+ const dimensions = getTabletopCardDimensions(size);
20
+ const suitColor = isRedSuit(card.suit) ? colors.redSuitText : colors.cardText;
21
+ return (<View accessibilityLabel={accessibilityLabel ?? getPlayingCardLabel(card)} accessibilityRole="image" style={[
22
+ styles.card,
23
+ {
24
+ backgroundColor: colors.cardSurface,
25
+ borderColor: selected ? colors.seatSelectedBorder : colors.cardBorder,
26
+ borderRadius: dimensions.radius,
27
+ height: dimensions.height,
28
+ opacity: muted ? 0.48 : 1,
29
+ width: dimensions.width,
30
+ },
31
+ ]} testID={testID}>
32
+ <Text selectable={false} style={[
33
+ styles.rank,
34
+ {
35
+ color: suitColor,
36
+ fontSize: dimensions.rankFontSize,
37
+ lineHeight: dimensions.rankFontSize + 4,
38
+ },
39
+ ]}>
40
+ {card.rank}
41
+ </Text>
42
+ <Text selectable={false} style={[
43
+ styles.suit,
44
+ {
45
+ color: suitColor,
46
+ fontSize: dimensions.suitFontSize,
47
+ lineHeight: dimensions.suitFontSize + 3,
48
+ },
49
+ ]}>
50
+ {suitMarks[card.suit]}
51
+ </Text>
52
+ </View>);
53
+ }
54
+ const styles = StyleSheet.create({
55
+ card: {
56
+ alignItems: 'center',
57
+ borderWidth: 1,
58
+ justifyContent: 'center',
59
+ },
60
+ rank: {
61
+ fontWeight: '800',
62
+ },
63
+ suit: {
64
+ fontWeight: '700',
65
+ marginTop: -2,
66
+ },
67
+ });
68
+ //# sourceMappingURL=PlayingCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlayingCard.js","sourceRoot":"","sources":["../../../src/components/playing-card/PlayingCard.tsx"],"names":[],"mappings":"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","sourcesContent":["import { useZoraTheme } from '@ankhorage/zora';\nimport React from 'react';\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport { getPlayingCardLabel } from '../../cardLabel';\nimport { getTabletopCardDimensions } from '../../cardSizing';\nimport { createTabletopColorScheme } from '../../colors';\nimport type { PlayingCardSuit } from '../../types';\nimport type { PlayingCardProps } from './types';\n\nconst suitMarks: Readonly<Record<PlayingCardSuit, string>> = {\n clubs: 'C',\n diamonds: 'D',\n hearts: 'H',\n spades: 'S',\n};\n\nfunction isRedSuit(suit: PlayingCardSuit): boolean {\n return suit === 'diamonds' || suit === 'hearts';\n}\n\nexport function PlayingCard({\n card,\n size = 'medium',\n selected = false,\n muted = false,\n accessibilityLabel,\n colorScheme,\n testID,\n}: PlayingCardProps) {\n const { theme } = useZoraTheme();\n const colors = React.useMemo(\n () => createTabletopColorScheme(theme, colorScheme),\n [colorScheme, theme],\n );\n const dimensions = getTabletopCardDimensions(size);\n const suitColor = isRedSuit(card.suit) ? colors.redSuitText : colors.cardText;\n\n return (\n <View\n accessibilityLabel={accessibilityLabel ?? getPlayingCardLabel(card)}\n accessibilityRole=\"image\"\n style={[\n styles.card,\n {\n backgroundColor: colors.cardSurface,\n borderColor: selected ? colors.seatSelectedBorder : colors.cardBorder,\n borderRadius: dimensions.radius,\n height: dimensions.height,\n opacity: muted ? 0.48 : 1,\n width: dimensions.width,\n },\n ]}\n testID={testID}\n >\n <Text\n selectable={false}\n style={[\n styles.rank,\n {\n color: suitColor,\n fontSize: dimensions.rankFontSize,\n lineHeight: dimensions.rankFontSize + 4,\n },\n ]}\n >\n {card.rank}\n </Text>\n <Text\n selectable={false}\n style={[\n styles.suit,\n {\n color: suitColor,\n fontSize: dimensions.suitFontSize,\n lineHeight: dimensions.suitFontSize + 3,\n },\n ]}\n >\n {suitMarks[card.suit]}\n </Text>\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n card: {\n alignItems: 'center',\n borderWidth: 1,\n justifyContent: 'center',\n },\n rank: {\n fontWeight: '800',\n },\n suit: {\n fontWeight: '700',\n marginTop: -2,\n },\n});\n"]}
@@ -0,0 +1,3 @@
1
+ export { PlayingCard } from './PlayingCard';
2
+ export type { PlayingCardProps } from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/playing-card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { PlayingCard } from './PlayingCard';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/playing-card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export { PlayingCard } from './PlayingCard';\nexport type { PlayingCardProps } from './types';\n"]}
@@ -0,0 +1,12 @@
1
+ import type { TabletopColorOverrides } from '../../colors';
2
+ import type { PlayingCardValue, TabletopCardSize } from '../../types';
3
+ export interface PlayingCardProps {
4
+ readonly card: PlayingCardValue;
5
+ readonly size?: TabletopCardSize;
6
+ readonly selected?: boolean;
7
+ readonly muted?: boolean;
8
+ readonly accessibilityLabel?: string;
9
+ readonly colorScheme?: TabletopColorOverrides;
10
+ readonly testID?: string;
11
+ }
12
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/playing-card/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEtE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,WAAW,CAAC,EAAE,sBAAsB,CAAC;IAC9C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/playing-card/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TabletopColorOverrides } from '../../colors';\nimport type { PlayingCardValue, TabletopCardSize } from '../../types';\n\nexport interface PlayingCardProps {\n readonly card: PlayingCardValue;\n readonly size?: TabletopCardSize;\n readonly selected?: boolean;\n readonly muted?: boolean;\n readonly accessibilityLabel?: string;\n readonly colorScheme?: TabletopColorOverrides;\n readonly testID?: string;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { TabletopTableProps } from './types';
3
+ export declare function TabletopTable({ seats, centerCards, centerLabel, centerSublabel, shape, seatCount, cardSize, disabled, colorScheme, accessibilityLabel, testID, }: TabletopTableProps): React.JSX.Element;
4
+ //# sourceMappingURL=TabletopTable.d.ts.map