@rpg-engine/long-bow 0.8.182 → 0.8.184

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 (29) hide show
  1. package/dist/components/Marketplace/CharacterListingForm.d.ts +4 -2
  2. package/dist/components/Marketplace/CharacterListingModal.d.ts +17 -0
  3. package/dist/components/Marketplace/CharacterMarketplacePanel.d.ts +4 -0
  4. package/dist/components/Marketplace/CharacterMarketplaceRows.d.ts +6 -0
  5. package/dist/components/Marketplace/Marketplace.d.ts +3 -2
  6. package/dist/components/Marketplace/MyCharacterListingsPanel.d.ts +4 -0
  7. package/dist/components/shared/DCRateStrip.d.ts +2 -0
  8. package/dist/components/shared/RadioOption.d.ts +22 -0
  9. package/dist/long-bow.cjs.development.js +476 -371
  10. package/dist/long-bow.cjs.development.js.map +1 -1
  11. package/dist/long-bow.cjs.production.min.js +1 -1
  12. package/dist/long-bow.cjs.production.min.js.map +1 -1
  13. package/dist/long-bow.esm.js +477 -372
  14. package/dist/long-bow.esm.js.map +1 -1
  15. package/dist/stories/Features/marketplace/CharacterListingModal.stories.d.ts +8 -0
  16. package/dist/stories/shared/RadioOption.stories.d.ts +8 -0
  17. package/package.json +1 -1
  18. package/src/components/DCWallet/DCWalletContent.tsx +5 -47
  19. package/src/components/Marketplace/CharacterListingForm.tsx +56 -351
  20. package/src/components/Marketplace/CharacterListingModal.tsx +404 -0
  21. package/src/components/Marketplace/CharacterMarketplacePanel.tsx +112 -67
  22. package/src/components/Marketplace/CharacterMarketplaceRows.tsx +21 -9
  23. package/src/components/Marketplace/Marketplace.tsx +11 -6
  24. package/src/components/Marketplace/MyCharacterListingsPanel.tsx +15 -14
  25. package/src/components/shared/DCRateStrip.tsx +67 -0
  26. package/src/components/shared/RadioOption.tsx +93 -0
  27. package/src/stories/Features/marketplace/CharacterListingModal.stories.tsx +131 -0
  28. package/src/stories/Features/marketplace/CharacterMarketplace.stories.tsx +39 -23
  29. package/src/stories/shared/RadioOption.stories.tsx +93 -0
@@ -4,8 +4,10 @@ import React from 'react';
4
4
  import { RPGUIRoot } from '../../..';
5
5
  import { CharacterMarketplacePanel } from '../../../components/Marketplace/CharacterMarketplacePanel';
6
6
  import { MyCharacterListingsPanel } from '../../../components/Marketplace/MyCharacterListingsPanel';
7
- import atlasJSON from '../../../mocks/atlas/items/items.json';
8
- import atlasIMG from '../../../mocks/atlas/items/items.png';
7
+ import entitiesAtlasJSON from '../../../mocks/atlas/entities/entities.json';
8
+ import entitiesAtlasIMG from '../../../mocks/atlas/entities/entities.png';
9
+ import itemsAtlasJSON from '../../../mocks/atlas/items/items.json';
10
+ import itemsAtlasIMG from '../../../mocks/atlas/items/items.png';
9
11
 
10
12
  const meta: Meta = {
11
13
  title: 'Features/Marketplace/CharacterMarketplace',
@@ -38,7 +40,7 @@ const mockCharacterListings: ICharacterListing[] = [
38
40
  { slot: 'weapon', itemName: 'Broad Sword', itemKey: 'items/broad-sword', rarity: 'Common' },
39
41
  { slot: 'armor', itemName: 'Steel Armor', itemKey: 'items/steel-armor', rarity: 'Rare' },
40
42
  ],
41
- textureKey: 'characters/warrior/male',
43
+ textureKey: 'black-knight',
42
44
  },
43
45
  createdAt: daysAgo(3),
44
46
  updatedAt: daysAgo(3),
@@ -61,7 +63,7 @@ const mockCharacterListings: ICharacterListing[] = [
61
63
  equipment: [
62
64
  { slot: 'weapon', itemName: 'Fire Staff', itemKey: 'items/fire-staff', rarity: 'Epic' },
63
65
  ],
64
- textureKey: 'characters/mage/male',
66
+ textureKey: 'pink-mage-1',
65
67
  },
66
68
  createdAt: daysAgo(1),
67
69
  updatedAt: daysAgo(1),
@@ -84,7 +86,7 @@ const mockCharacterListings: ICharacterListing[] = [
84
86
  equipment: [
85
87
  { slot: 'weapon', itemName: 'Dagger', itemKey: 'items/dagger', rarity: 'Uncommon' },
86
88
  ],
87
- textureKey: 'characters/rogue/female',
89
+ textureKey: 'redhair-girl-1',
88
90
  },
89
91
  createdAt: daysAgo(7),
90
92
  updatedAt: daysAgo(1),
@@ -108,7 +110,7 @@ const mockCharacterListings: ICharacterListing[] = [
108
110
  { slot: 'weapon', itemName: 'Holy Sword', itemKey: 'items/holy-sword', rarity: 'Legendary' },
109
111
  { slot: 'armor', itemName: 'Divine Armor', itemKey: 'items/divine-armor', rarity: 'Epic' },
110
112
  ],
111
- textureKey: 'characters/paladin/male',
113
+ textureKey: 'dragon-knight',
112
114
  },
113
115
  createdAt: daysAgo(14),
114
116
  updatedAt: daysAgo(14),
@@ -131,7 +133,7 @@ const mockCharacterListings: ICharacterListing[] = [
131
133
  equipment: [
132
134
  { slot: 'weapon', itemName: 'Longbow', itemKey: 'items/longbow', rarity: 'Rare' },
133
135
  ],
134
- textureKey: 'characters/archer/female',
136
+ textureKey: 'pink-hair-girl-1',
135
137
  },
136
138
  createdAt: daysAgo(2),
137
139
  updatedAt: daysAgo(2),
@@ -157,7 +159,7 @@ const mockMyCharacterListings: ICharacterListing[] = [
157
159
  equipment: [
158
160
  { slot: 'weapon', itemName: 'Epic Sword', itemKey: 'items/epic-sword', rarity: 'Epic' },
159
161
  ],
160
- textureKey: 'characters/warrior/male',
162
+ textureKey: 'black-knight',
161
163
  },
162
164
  createdAt: daysAgo(10),
163
165
  updatedAt: daysAgo(10),
@@ -180,7 +182,7 @@ const mockMyCharacterListings: ICharacterListing[] = [
180
182
  equipment: [
181
183
  { slot: 'weapon', itemName: 'Basic Staff', itemKey: 'items/staff', rarity: 'Common' },
182
184
  ],
183
- textureKey: 'characters/mage/female',
185
+ textureKey: 'red-mage-1',
184
186
  },
185
187
  createdAt: daysAgo(5),
186
188
  updatedAt: daysAgo(1),
@@ -196,8 +198,10 @@ export const CharacterBrowse: Story = () => (
196
198
  itemsPerPage={8}
197
199
  onPageChange={() => {}}
198
200
  onCharacterBuy={() => {}}
199
- atlasJSON={atlasJSON}
200
- atlasIMG={atlasIMG}
201
+ atlasJSON={itemsAtlasJSON}
202
+ atlasIMG={itemsAtlasIMG}
203
+ characterAtlasJSON={entitiesAtlasJSON}
204
+ characterAtlasIMG={entitiesAtlasIMG}
201
205
  nameFilter=""
202
206
  onNameFilterChange={() => {}}
203
207
  isLoading={false}
@@ -216,8 +220,10 @@ export const CharacterBrowseLoading: Story = () => (
216
220
  itemsPerPage={8}
217
221
  onPageChange={() => {}}
218
222
  onCharacterBuy={() => {}}
219
- atlasJSON={atlasJSON}
220
- atlasIMG={atlasIMG}
223
+ atlasJSON={itemsAtlasJSON}
224
+ atlasIMG={itemsAtlasIMG}
225
+ characterAtlasJSON={entitiesAtlasJSON}
226
+ characterAtlasIMG={entitiesAtlasIMG}
221
227
  nameFilter=""
222
228
  onNameFilterChange={() => {}}
223
229
  isLoading={true}
@@ -236,8 +242,10 @@ export const CharacterBrowseEmpty: Story = () => (
236
242
  itemsPerPage={8}
237
243
  onPageChange={() => {}}
238
244
  onCharacterBuy={() => {}}
239
- atlasJSON={atlasJSON}
240
- atlasIMG={atlasIMG}
245
+ atlasJSON={itemsAtlasJSON}
246
+ atlasIMG={itemsAtlasIMG}
247
+ characterAtlasJSON={entitiesAtlasJSON}
248
+ characterAtlasIMG={entitiesAtlasIMG}
241
249
  nameFilter=""
242
250
  onNameFilterChange={() => {}}
243
251
  isLoading={false}
@@ -258,8 +266,10 @@ export const CharacterBrowseFiltered: Story = () => (
258
266
  itemsPerPage={8}
259
267
  onPageChange={() => {}}
260
268
  onCharacterBuy={() => {}}
261
- atlasJSON={atlasJSON}
262
- atlasIMG={atlasIMG}
269
+ atlasJSON={itemsAtlasJSON}
270
+ atlasIMG={itemsAtlasIMG}
271
+ characterAtlasJSON={entitiesAtlasJSON}
272
+ characterAtlasIMG={entitiesAtlasIMG}
263
273
  nameFilter="warrior"
264
274
  onNameFilterChange={() => {}}
265
275
  isLoading={false}
@@ -278,8 +288,10 @@ export const MyCharacterListings: Story = () => (
278
288
  itemsPerPage={8}
279
289
  onPageChange={() => {}}
280
290
  onCharacterDelist={() => {}}
281
- atlasJSON={atlasJSON}
282
- atlasIMG={atlasIMG}
291
+ atlasJSON={itemsAtlasJSON}
292
+ atlasIMG={itemsAtlasIMG}
293
+ characterAtlasJSON={entitiesAtlasJSON}
294
+ characterAtlasIMG={entitiesAtlasIMG}
283
295
  />
284
296
  </RPGUIRoot>
285
297
  );
@@ -295,8 +307,10 @@ export const MyCharacterListingsEmpty: Story = () => (
295
307
  itemsPerPage={8}
296
308
  onPageChange={() => {}}
297
309
  onCharacterDelist={() => {}}
298
- atlasJSON={atlasJSON}
299
- atlasIMG={atlasIMG}
310
+ atlasJSON={itemsAtlasJSON}
311
+ atlasIMG={itemsAtlasIMG}
312
+ characterAtlasJSON={entitiesAtlasJSON}
313
+ characterAtlasIMG={entitiesAtlasIMG}
300
314
  />
301
315
  </RPGUIRoot>
302
316
  );
@@ -312,8 +326,10 @@ export const CharacterListingPending: Story = () => (
312
326
  itemsPerPage={8}
313
327
  onPageChange={() => {}}
314
328
  onCharacterBuy={() => {}}
315
- atlasJSON={atlasJSON}
316
- atlasIMG={atlasIMG}
329
+ atlasJSON={itemsAtlasJSON}
330
+ atlasIMG={itemsAtlasIMG}
331
+ characterAtlasJSON={entitiesAtlasJSON}
332
+ characterAtlasIMG={entitiesAtlasIMG}
317
333
  nameFilter=""
318
334
  onNameFilterChange={() => {}}
319
335
  isLoading={false}
@@ -0,0 +1,93 @@
1
+ import { Meta, Story } from '@storybook/react';
2
+ import React, { useState } from 'react';
3
+ import { RPGUIRoot } from '../../components/RPGUI/RPGUIRoot';
4
+ import {
5
+ IRadioOptionProps,
6
+ RadioOption,
7
+ RadioOptionLabel,
8
+ RadioOptionSub,
9
+ } from '../../components/shared/RadioOption';
10
+
11
+ const meta: Meta = {
12
+ title: 'Shared/RadioOption',
13
+ component: RadioOption,
14
+ decorators: [
15
+ Story => (
16
+ <RPGUIRoot>
17
+ <div style={{ padding: '2rem', background: '#1a1a2e', minWidth: '320px' }}>
18
+ <Story />
19
+ </div>
20
+ </RPGUIRoot>
21
+ ),
22
+ ],
23
+ };
24
+
25
+ export default meta;
26
+
27
+ // ---------------------------------------------------------------------------
28
+ // Single unselected option
29
+ // ---------------------------------------------------------------------------
30
+ export const Unselected: Story<IRadioOptionProps> = () => (
31
+ <RadioOption selected={false} onSelect={() => {}}>
32
+ <div>
33
+ <RadioOptionLabel>Pay with Stripe</RadioOptionLabel>
34
+ </div>
35
+ </RadioOption>
36
+ );
37
+
38
+ // ---------------------------------------------------------------------------
39
+ // Single selected option
40
+ // ---------------------------------------------------------------------------
41
+ export const Selected: Story<IRadioOptionProps> = () => (
42
+ <RadioOption selected={true} onSelect={() => {}}>
43
+ <div>
44
+ <RadioOptionLabel>Pay with Stripe</RadioOptionLabel>
45
+ </div>
46
+ </RadioOption>
47
+ );
48
+
49
+ // ---------------------------------------------------------------------------
50
+ // Disabled option
51
+ // ---------------------------------------------------------------------------
52
+ export const Disabled: Story<IRadioOptionProps> = () => (
53
+ <RadioOption selected={false} disabled={true} onSelect={() => {}}>
54
+ <div>
55
+ <RadioOptionLabel $disabled={true}>Pay with DC Wallet</RadioOptionLabel>
56
+ <RadioOptionSub>Insufficient balance</RadioOptionSub>
57
+ </div>
58
+ </RadioOption>
59
+ );
60
+
61
+ // ---------------------------------------------------------------------------
62
+ // Interactive group of 3 options
63
+ // ---------------------------------------------------------------------------
64
+ const OPTIONS = [
65
+ { id: 'stripe', label: 'Pay with Stripe', sub: 'Credit / debit card' },
66
+ { id: 'dc', label: 'Pay with DC Wallet', sub: '250 DC available' },
67
+ { id: 'paypal', label: 'Pay with PayPal', sub: 'Coming soon' },
68
+ ] as const;
69
+
70
+ type IOptionId = (typeof OPTIONS)[number]['id'];
71
+
72
+ export const InteractiveGroup: Story = () => {
73
+ const [selected, setSelected] = useState<IOptionId>('stripe');
74
+
75
+ return (
76
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
77
+ {OPTIONS.map(opt => (
78
+ <RadioOption
79
+ key={opt.id}
80
+ selected={selected === opt.id}
81
+ onSelect={() => setSelected(opt.id)}
82
+ >
83
+ <div>
84
+ <RadioOptionLabel>{opt.label}</RadioOptionLabel>
85
+ <div style={{ marginTop: '3px' }}>
86
+ <RadioOptionSub>{opt.sub}</RadioOptionSub>
87
+ </div>
88
+ </div>
89
+ </RadioOption>
90
+ ))}
91
+ </div>
92
+ );
93
+ };