@rpg-engine/long-bow 0.8.171 → 0.8.172

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 (53) hide show
  1. package/dist/components/Store/CartView.d.ts +21 -1
  2. package/dist/components/Store/CountdownTimer.d.ts +7 -0
  3. package/dist/components/Store/FeaturedBanner.d.ts +23 -0
  4. package/dist/components/Store/PurchaseSuccess.d.ts +18 -0
  5. package/dist/components/Store/Store.d.ts +50 -2
  6. package/dist/components/Store/StoreBadges.d.ts +13 -0
  7. package/dist/components/Store/StoreCharacterSkinRow.d.ts +1 -0
  8. package/dist/components/Store/StoreItemRow.d.ts +10 -0
  9. package/dist/components/Store/TrustBar.d.ts +9 -0
  10. package/dist/components/Store/sections/StoreItemsSection.d.ts +13 -0
  11. package/dist/components/Store/sections/StorePacksSection.d.ts +11 -0
  12. package/dist/components/shared/CTAButton/CTAButton.d.ts +1 -0
  13. package/dist/components/shared/CustomScrollbar.d.ts +9 -0
  14. package/dist/index.d.ts +6 -1
  15. package/dist/long-bow.cjs.development.js +1284 -302
  16. package/dist/long-bow.cjs.development.js.map +1 -1
  17. package/dist/long-bow.cjs.production.min.js +1 -1
  18. package/dist/long-bow.cjs.production.min.js.map +1 -1
  19. package/dist/long-bow.esm.js +1281 -304
  20. package/dist/long-bow.esm.js.map +1 -1
  21. package/dist/stories/Features/store/FeaturedBanner.stories.d.ts +1 -0
  22. package/dist/stories/Features/store/PurchaseSuccess.stories.d.ts +1 -0
  23. package/dist/stories/Features/store/StoreBadges.stories.d.ts +1 -0
  24. package/dist/stories/Features/store/TrustBar.stories.d.ts +1 -0
  25. package/package.json +2 -2
  26. package/src/components/Marketplace/BuyPanel.tsx +1 -1
  27. package/src/components/Store/CartView.tsx +143 -13
  28. package/src/components/Store/CountdownTimer.tsx +86 -0
  29. package/src/components/Store/FeaturedBanner.tsx +273 -0
  30. package/src/components/Store/PurchaseSuccess.tsx +258 -0
  31. package/src/components/Store/Store.tsx +236 -50
  32. package/src/components/Store/StoreBadges.tsx +94 -0
  33. package/src/components/Store/StoreCharacterSkinRow.tsx +113 -22
  34. package/src/components/Store/StoreItemRow.tsx +135 -17
  35. package/src/components/Store/TrustBar.tsx +69 -0
  36. package/src/components/Store/__test__/CountdownTimer.spec.tsx +100 -0
  37. package/src/components/Store/__test__/FeaturedBanner.spec.tsx +207 -0
  38. package/src/components/Store/__test__/PurchaseSuccess.spec.tsx +174 -0
  39. package/src/components/Store/__test__/StoreBadges.spec.tsx +133 -0
  40. package/src/components/Store/__test__/TrustBar.spec.tsx +85 -0
  41. package/src/components/Store/sections/StoreItemsSection.tsx +27 -1
  42. package/src/components/Store/sections/StorePacksSection.tsx +92 -28
  43. package/src/components/shared/CTAButton/CTAButton.tsx +25 -1
  44. package/src/components/shared/CustomScrollbar.ts +41 -0
  45. package/src/components/shared/ItemRowWrapper.tsx +26 -12
  46. package/src/components/shared/ScrollableContent/ScrollableContent.tsx +3 -0
  47. package/src/components/shared/SpriteFromAtlas.tsx +4 -1
  48. package/src/index.tsx +6 -1
  49. package/src/stories/Features/store/FeaturedBanner.stories.tsx +121 -0
  50. package/src/stories/Features/store/PurchaseSuccess.stories.tsx +74 -0
  51. package/src/stories/Features/store/Store.stories.tsx +39 -3
  52. package/src/stories/Features/store/StoreBadges.stories.tsx +83 -0
  53. package/src/stories/Features/store/TrustBar.stories.tsx +51 -0
@@ -0,0 +1,74 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import React from 'react';
3
+ import { RPGUIRoot } from '../../../components/RPGUI/RPGUIRoot';
4
+ import { PurchaseSuccess } from '../../../components/Store/PurchaseSuccess';
5
+ import itemsAtlasJSON from '../../../mocks/atlas/items/items.json';
6
+ import itemsAtlasIMG from '../../../mocks/atlas/items/items.png';
7
+
8
+ const meta = {
9
+ title: 'Features/Store/PurchaseSuccess',
10
+ component: PurchaseSuccess,
11
+ parameters: { layout: 'centered' },
12
+ decorators: [
13
+ Story => (
14
+ <RPGUIRoot>
15
+ <div style={{ width: 500, background: '#1a1a2e', borderRadius: 8 }}>
16
+ <Story />
17
+ </div>
18
+ </RPGUIRoot>
19
+ ),
20
+ ],
21
+ } satisfies Meta<typeof PurchaseSuccess>;
22
+
23
+ export default meta;
24
+ type Story = StoryObj<typeof PurchaseSuccess>;
25
+
26
+ export const Default: Story = {
27
+ render: () => (
28
+ <PurchaseSuccess
29
+ items={[
30
+ { name: 'Greater Life Potion', texturePath: 'items/greater_life_potion.png', quantity: 3 },
31
+ { name: 'Angelic Sword', texturePath: 'items/angelic_sword.png', quantity: 1 },
32
+ ]}
33
+ totalPrice={19.98}
34
+ atlasJSON={itemsAtlasJSON}
35
+ atlasIMG={itemsAtlasIMG}
36
+ onContinueShopping={() => console.log('Continue shopping')}
37
+ onClose={() => console.log('Close store')}
38
+ />
39
+ ),
40
+ };
41
+
42
+ export const SingleItem: Story = {
43
+ render: () => (
44
+ <PurchaseSuccess
45
+ items={[
46
+ { name: 'Starter Pack', texturePath: 'items/greater_life_potion.png', quantity: 1 },
47
+ ]}
48
+ totalPrice={4.99}
49
+ atlasJSON={itemsAtlasJSON}
50
+ atlasIMG={itemsAtlasIMG}
51
+ onContinueShopping={() => console.log('Continue shopping')}
52
+ onClose={() => console.log('Close store')}
53
+ />
54
+ ),
55
+ };
56
+
57
+ export const ManyItems: Story = {
58
+ render: () => (
59
+ <PurchaseSuccess
60
+ items={[
61
+ { name: 'Life Potion', texturePath: 'items/greater_life_potion.png', quantity: 10 },
62
+ { name: 'Angelic Sword', texturePath: 'items/angelic_sword.png', quantity: 1 },
63
+ { name: 'Dragon Scale', texturePath: 'items/greater_life_potion.png', quantity: 5 },
64
+ { name: 'Mana Gem', texturePath: 'items/greater_life_potion.png', quantity: 2 },
65
+ { name: 'Phoenix Feather', texturePath: 'items/angelic_sword.png', quantity: 1 },
66
+ ]}
67
+ totalPrice={74.95}
68
+ atlasJSON={itemsAtlasJSON}
69
+ atlasIMG={itemsAtlasIMG}
70
+ onContinueShopping={() => console.log('Continue shopping')}
71
+ onClose={() => console.log('Close store')}
72
+ />
73
+ ),
74
+ };
@@ -9,6 +9,8 @@ import entitiesAtlasIMG from '../../../mocks/atlas/entities/entities.png';
9
9
  import itemsAtlasJSON from '../../../mocks/atlas/items/items.json';
10
10
  import itemsAtlasIMG from '../../../mocks/atlas/items/items.png';
11
11
  import { mockItems } from '../../../mocks/informationCenter.mocks';
12
+ import { DCWalletContent } from '../../../components/DCWallet/DCWalletContent';
13
+ import { DCHistoryPanel } from '../../../components/DCWallet/DCHistoryPanel';
12
14
 
13
15
  const meta = {
14
16
  title: 'Features/Store/Store',
@@ -81,6 +83,7 @@ const characterNameChangeItem: IProductBlueprint = {
81
83
  textureAtlas: 'items',
82
84
  textureKey: 'items/character_customization.png',
83
85
  type: PurchaseType.Item,
86
+ dcPrice: 500,
84
87
  onPurchase: async () => { },
85
88
  itemType: ItemType.Other,
86
89
  itemSubType: ItemSubType.Other,
@@ -104,6 +107,7 @@ const characterSkinItems: IProductBlueprint[] = [
104
107
  textureAtlas: 'items',
105
108
  textureKey: 'items/character_customization.png',
106
109
  type: PurchaseType.Item,
110
+ dcPrice: 1500,
107
111
  onPurchase: async () => { },
108
112
  itemType: ItemType.Other,
109
113
  itemSubType: ItemSubType.Other,
@@ -132,6 +136,7 @@ const characterSkinItems: IProductBlueprint[] = [
132
136
  textureAtlas: 'items',
133
137
  textureKey: 'items/premium_character_pack.png',
134
138
  type: PurchaseType.Item,
139
+ dcPrice: 2500,
135
140
  onPurchase: async () => { },
136
141
  itemType: ItemType.Other,
137
142
  itemSubType: ItemSubType.Other,
@@ -229,9 +234,24 @@ export const Default: Story = {
229
234
  console.log('Purchase details:', purchase);
230
235
  return Promise.resolve(true);
231
236
  }}
232
- onShowHistory={() => console.log('Show History clicked in story')}
233
- onShowWallet={() => console.log('DC Wallet clicked in story')}
234
- walletLabel="DC Wallet: 1,200"
237
+ customWalletContent={<DCWalletContent
238
+ dcBalance={1200}
239
+ historyData={{ transactions: [], totalPages: 1, currentPage: 1 }}
240
+ historyLoading={false}
241
+ onRequestHistory={() => {}}
242
+ transferLoading={false}
243
+ transferResult={null}
244
+ onSendTransfer={() => {}}
245
+ onClearTransferResult={() => {}}
246
+ onBuyDC={() => console.log('Buy DC')}
247
+ />}
248
+ customHistoryContent={<DCHistoryPanel
249
+ transactions={[]}
250
+ totalPages={1}
251
+ currentPage={1}
252
+ loading={false}
253
+ onRequestHistory={() => {}}
254
+ />}
235
255
  onClose={() => console.log('Store closed')}
236
256
  atlasJSON={itemsAtlasJSON}
237
257
  atlasIMG={itemsAtlasIMG}
@@ -240,6 +260,22 @@ export const Default: Story = {
240
260
  defaultActiveTab="packs"
241
261
  textInputItemKeys={['original-greater-life-potion-2', 'original-angelic-sword-1', 'character-name-change']}
242
262
  packsBadge="SAVE"
263
+ onTabChange={(tab, count) => console.log('[tracking] tab_change', { tab, count })}
264
+ onCategoryChange={(category, count) => console.log('[tracking] category_change', { category, count })}
265
+ onItemView={(item, position) => console.log('[tracking] item_viewed', { key: item.key, position })}
266
+ onPackView={(pack, position) => console.log('[tracking] pack_viewed', { key: pack.key, position })}
267
+ onCartOpen={() => console.log('[tracking] cart_opened')}
268
+ onAddToCart={(item, qty) => console.log('[tracking] add_to_cart', { key: item.key, qty })}
269
+ onRemoveFromCart={(key) => console.log('[tracking] remove_from_cart', { key })}
270
+ onCheckoutStart={(items, total) => console.log('[tracking] checkout_start', { items, total })}
271
+ onPurchaseSuccess={(items, total) => console.log('[tracking] purchase_success', { items, total })}
272
+ onPurchaseError={(error) => console.log('[tracking] purchase_error', { error })}
273
+ itemBadges={{
274
+ 'original-greater-life-potion-0': { originalPrice: 15.00 },
275
+ 'character-name-change': { originalPrice: 15.00 },
276
+ 'skin-character-customization': { originalPrice: 20.00 },
277
+ 'starter-pack': { originalPrice: 9.99 }
278
+ }}
243
279
  />
244
280
  ),
245
281
  };
@@ -0,0 +1,83 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import React from 'react';
3
+ import { RPGUIRoot } from '../../../components/RPGUI/RPGUIRoot';
4
+ import { StoreBadges } from '../../../components/Store/StoreBadges';
5
+
6
+ const meta = {
7
+ title: 'Features/Store/StoreBadges',
8
+ component: StoreBadges,
9
+ parameters: { layout: 'centered' },
10
+ decorators: [
11
+ Story => (
12
+ <RPGUIRoot>
13
+ <div style={{ padding: 16, background: '#1a1a2e', borderRadius: 8 }}>
14
+ <Story />
15
+ </div>
16
+ </RPGUIRoot>
17
+ ),
18
+ ],
19
+ } satisfies Meta<typeof StoreBadges>;
20
+
21
+ export default meta;
22
+ type Story = StoryObj<typeof StoreBadges>;
23
+
24
+ const future = new Date(Date.now() + 3 * 60 * 60 * 1000).toISOString();
25
+
26
+ export const AllBadgeTypes: Story = {
27
+ render: () => (
28
+ <div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
29
+ <StoreBadges badges={[{ type: 'popular' }]} />
30
+ <StoreBadges badges={[{ type: 'bestSeller' }]} />
31
+ <StoreBadges badges={[{ type: 'limited' }]} />
32
+ <StoreBadges badges={[{ type: 'new' }]} />
33
+ <StoreBadges badges={[{ type: 'sale' }]} />
34
+ <StoreBadges badges={[{ type: 'event' }]} />
35
+ </div>
36
+ ),
37
+ };
38
+
39
+ export const SocialProof: Story = {
40
+ render: () => (
41
+ <StoreBadges
42
+ badges={[{ type: 'bestSeller' }]}
43
+ buyCount={142}
44
+ viewersCount={8}
45
+ />
46
+ ),
47
+ };
48
+
49
+ export const WithCountdown: Story = {
50
+ render: () => (
51
+ <StoreBadges
52
+ badges={[{ type: 'sale' }]}
53
+ buyCount={37}
54
+ saleEndsAt={future}
55
+ />
56
+ ),
57
+ };
58
+
59
+ export const MultipleBadges: Story = {
60
+ render: () => (
61
+ <StoreBadges
62
+ badges={[{ type: 'popular' }, { type: 'limited', label: 'Only 3 left!' }]}
63
+ buyCount={89}
64
+ viewersCount={12}
65
+ saleEndsAt={future}
66
+ />
67
+ ),
68
+ };
69
+
70
+ export const CustomLabels: Story = {
71
+ render: () => (
72
+ <StoreBadges
73
+ badges={[
74
+ { type: 'event', label: 'Halloween Special' },
75
+ { type: 'limited', label: 'Last 5!' },
76
+ ]}
77
+ />
78
+ ),
79
+ };
80
+
81
+ export const Empty: Story = {
82
+ render: () => <StoreBadges />,
83
+ };
@@ -0,0 +1,51 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import React from 'react';
3
+ import { FaShieldAlt, FaTruck, FaUndo } from 'react-icons/fa';
4
+ import { RPGUIRoot } from '../../../components/RPGUI/RPGUIRoot';
5
+ import { TrustBar } from '../../../components/Store/TrustBar';
6
+
7
+ const meta = {
8
+ title: 'Features/Store/TrustBar',
9
+ component: TrustBar,
10
+ parameters: { layout: 'centered' },
11
+ decorators: [
12
+ Story => (
13
+ <RPGUIRoot>
14
+ <div style={{ width: 600, padding: 16, background: '#1a1a2e', borderRadius: 8 }}>
15
+ <Story />
16
+ </div>
17
+ </RPGUIRoot>
18
+ ),
19
+ ],
20
+ } satisfies Meta<typeof TrustBar>;
21
+
22
+ export default meta;
23
+ type Story = StoryObj<typeof TrustBar>;
24
+
25
+ export const Default: Story = {
26
+ render: () => <TrustBar />,
27
+ };
28
+
29
+ export const CustomSignals: Story = {
30
+ render: () => (
31
+ <TrustBar
32
+ signals={[
33
+ { icon: <FaShieldAlt />, label: 'SSL Encrypted' },
34
+ { icon: <FaTruck />, label: 'Instant Delivery' },
35
+ { icon: <FaUndo />, label: 'Money-back Guarantee' },
36
+ ]}
37
+ />
38
+ ),
39
+ };
40
+
41
+ export const TextOnly: Story = {
42
+ render: () => (
43
+ <TrustBar
44
+ signals={[
45
+ { label: 'No subscriptions' },
46
+ { label: 'One-time payment' },
47
+ { label: 'Cancel anytime' },
48
+ ]}
49
+ />
50
+ ),
51
+ };