@rpg-engine/long-bow 0.8.7 → 0.8.9

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 (70) hide show
  1. package/dist/components/InformationCenter/sections/bestiary/{BestiarySection.d.ts → InformationCenterBestiarySection.d.ts} +1 -1
  2. package/dist/components/InformationCenter/sections/faq/{FaqSection.d.ts → InformationCenterFaqSection.d.ts} +1 -1
  3. package/dist/components/InformationCenter/sections/items/{ItemsSection.d.ts → InformationCenterItemsSection.d.ts} +1 -1
  4. package/dist/components/InformationCenter/sections/tutorials/{TutorialsSection.d.ts → InformationCenterTutorialsSection.d.ts} +2 -1
  5. package/dist/components/Item/Inventory/ItemPropertyColorSelector.d.ts +10 -0
  6. package/dist/components/Item/Inventory/ItemPropertySimpleHandler.d.ts +10 -0
  7. package/dist/components/Store/CartView.d.ts +15 -0
  8. package/dist/components/Store/StoreItemDetails.d.ts +16 -0
  9. package/dist/components/Store/StoreItemRow.d.ts +1 -2
  10. package/dist/components/Store/StoreTypes.d.ts +33 -4
  11. package/dist/components/Store/hooks/useStoreCart.d.ts +14 -0
  12. package/dist/components/Store/sections/StoreItemsSection.d.ts +12 -0
  13. package/dist/components/Store/sections/StorePacksSection.d.ts +9 -0
  14. package/dist/components/shared/CTAButton/CTAButton.d.ts +13 -0
  15. package/dist/components/shared/Card/Card.d.ts +14 -0
  16. package/dist/components/shared/Ellipsis.d.ts +1 -1
  17. package/dist/components/shared/PaginatedContent/PaginatedContent.d.ts +3 -1
  18. package/dist/components/shared/ScrollableContent/ScrollableContent.d.ts +23 -0
  19. package/dist/components/shared/SearchBar/SearchBar.d.ts +2 -3
  20. package/dist/components/shared/SearchHeader/SearchHeader.d.ts +17 -0
  21. package/dist/components/shared/ShoppingCart/CartCard.d.ts +14 -0
  22. package/dist/components/shared/ShoppingCart/CartCardHorizontal.d.ts +13 -0
  23. package/dist/index.d.ts +1 -0
  24. package/dist/long-bow.cjs.development.js +105 -39
  25. package/dist/long-bow.cjs.development.js.map +1 -1
  26. package/dist/long-bow.cjs.production.min.js +1 -1
  27. package/dist/long-bow.cjs.production.min.js.map +1 -1
  28. package/dist/long-bow.esm.js +105 -40
  29. package/dist/long-bow.esm.js.map +1 -1
  30. package/dist/stories/UI/buttonsAndInputs/CTAButton.stories.d.ts +18 -0
  31. package/dist/stories/UI/dropdownsAndSelectors/ItemPropertyColorSelector.stories.d.ts +3 -0
  32. package/package.json +3 -2
  33. package/src/components/InformationCenter/InformationCenter.tsx +8 -8
  34. package/src/components/InformationCenter/InformationCenterTabView.tsx +0 -1
  35. package/src/components/InformationCenter/sections/bestiary/{BestiarySection.tsx → InformationCenterBestiarySection.tsx} +2 -1
  36. package/src/components/InformationCenter/sections/faq/InformationCenterFaqSection.tsx +81 -0
  37. package/src/components/InformationCenter/sections/items/{ItemsSection.tsx → InformationCenterItemsSection.tsx} +2 -10
  38. package/src/components/InformationCenter/sections/tutorials/InformationCenterTutorialsSection.tsx +135 -0
  39. package/src/components/Item/Inventory/ItemPropertyColorSelector.tsx +75 -0
  40. package/src/components/Item/Inventory/ItemPropertySimpleHandler.tsx +26 -0
  41. package/src/components/Item/Inventory/itemContainerHelper.ts +10 -1
  42. package/src/components/Store/CartView.tsx +271 -0
  43. package/src/components/Store/Store.tsx +199 -96
  44. package/src/components/Store/StoreItemDetails.tsx +161 -0
  45. package/src/components/Store/StoreItemRow.tsx +24 -40
  46. package/src/components/Store/StoreTypes.ts +38 -4
  47. package/src/components/Store/hooks/useStoreCart.ts +121 -0
  48. package/src/components/Store/sections/StoreItemsSection.tsx +52 -0
  49. package/src/components/Store/sections/StorePacksSection.tsx +89 -0
  50. package/src/components/Store/sections/images/custom-skin.png +0 -0
  51. package/src/components/shared/CTAButton/CTAButton.tsx +127 -0
  52. package/src/components/shared/Card/Card.tsx +107 -0
  53. package/src/components/shared/Ellipsis.tsx +20 -22
  54. package/src/components/shared/PaginatedContent/PaginatedContent.tsx +48 -79
  55. package/src/components/shared/ScrollableContent/ScrollableContent.tsx +160 -0
  56. package/src/components/shared/SearchBar/SearchBar.tsx +43 -24
  57. package/src/components/shared/SearchHeader/SearchHeader.tsx +80 -0
  58. package/src/components/shared/ShoppingCart/CartCard.tsx +116 -0
  59. package/src/components/shared/ShoppingCart/CartCardHorizontal.tsx +120 -0
  60. package/src/components/shared/SpriteFromAtlas.tsx +2 -0
  61. package/src/index.tsx +1 -0
  62. package/src/stories/Features/store/Store.stories.tsx +54 -4
  63. package/src/stories/UI/buttonsAndInputs/CTAButton.stories.tsx +77 -0
  64. package/src/stories/UI/dropdownsAndSelectors/ItemPropertyColorSelector.stories.tsx +77 -0
  65. package/dist/components/Store/InternalStoreTab.d.ts +0 -15
  66. package/dist/components/Store/StoreTabContent.d.ts +0 -14
  67. package/src/components/InformationCenter/sections/faq/FaqSection.tsx +0 -51
  68. package/src/components/InformationCenter/sections/tutorials/TutorialsSection.tsx +0 -144
  69. package/src/components/Store/InternalStoreTab.tsx +0 -142
  70. package/src/components/Store/StoreTabContent.tsx +0 -46
@@ -1,51 +0,0 @@
1
- import React from 'react';
2
- import styled from 'styled-components';
3
- import { PaginatedContent } from '../../../shared/PaginatedContent/PaginatedContent';
4
- import { IFaqItem } from '../../InformationCenter';
5
-
6
- interface IFaqSectionProps {
7
- faqItems: IFaqItem[];
8
- initialSearchQuery: string;
9
- tabId: string;
10
- }
11
-
12
- export const FaqSection: React.FC<IFaqSectionProps> = ({
13
- faqItems,
14
- initialSearchQuery,
15
- tabId,
16
- }) => {
17
- const renderItem = (item: IFaqItem) => (
18
- <FaqItem>
19
- <Question>{item.question}</Question>
20
- <Answer>{item.answer}</Answer>
21
- </FaqItem>
22
- );
23
-
24
- return (
25
- <PaginatedContent<IFaqItem>
26
- items={faqItems}
27
- renderItem={renderItem}
28
- emptyMessage="No FAQ items found"
29
- tabId={tabId}
30
- layout="list"
31
- itemsPerPage={10}
32
- />
33
- );
34
- };
35
-
36
- const FaqItem = styled.div`
37
- background: rgba(0, 0, 0, 0.2);
38
- padding: 1rem;
39
- border-radius: 4px;
40
- `;
41
-
42
- const Question = styled.h3`
43
- font-size: 1rem;
44
- color: #fef08a;
45
- margin-bottom: 0.5rem;
46
- `;
47
-
48
- const Answer = styled.p`
49
- font-size: 0.9rem;
50
- color: #ffffff;
51
- `;
@@ -1,144 +0,0 @@
1
- import React, { useState } from 'react';
2
- import styled from 'styled-components';
3
- import { uiColors } from '../../../../constants/uiColors';
4
- import { IOptionsProps } from '../../../Dropdown';
5
- import { IVideoGuide } from '../../InformationCenter';
6
- import { InformationCenterTabView } from '../../InformationCenterTabView';
7
-
8
- interface ITutorialsSectionProps {
9
- videoGuides: IVideoGuide[];
10
- initialSearchQuery: string;
11
- }
12
-
13
- export const TutorialsSection: React.FC<ITutorialsSectionProps> = ({
14
- videoGuides,
15
- initialSearchQuery,
16
- }) => {
17
- const [guidesSearchQuery, setGuidesSearchQuery] = useState(
18
- initialSearchQuery
19
- );
20
- const [selectedGuideCategory, setSelectedGuideCategory] = useState<string>(
21
- 'all'
22
- );
23
-
24
- const guideCategoryOptions: IOptionsProps[] = [
25
- { id: 0, value: 'all', option: 'All Guides' },
26
- { id: 1, value: 'Combat', option: 'Combat' },
27
- { id: 2, value: 'Crafting', option: 'Crafting' },
28
- { id: 3, value: 'Exploration', option: 'Exploration' },
29
- { id: 4, value: 'General', option: 'General' },
30
- ];
31
-
32
- const filterItems = (items: IVideoGuide[]) => {
33
- return items.filter(
34
- guide =>
35
- (selectedGuideCategory === 'all' ||
36
- guide.category === selectedGuideCategory) &&
37
- (guide.title.toLowerCase().includes(guidesSearchQuery.toLowerCase()) ||
38
- guide.description
39
- .toLowerCase()
40
- .includes(guidesSearchQuery.toLowerCase()))
41
- );
42
- };
43
-
44
- const renderContent = (items: IVideoGuide[]) => (
45
- <GuidesGrid>
46
- {items.map(guide => (
47
- <GuideItem key={guide.id}>
48
- <GuideThumbnail>
49
- <img
50
- src={guide.thumbnailUrl || '/placeholder-thumbnail.png'}
51
- alt={guide.title}
52
- />
53
- </GuideThumbnail>
54
- <GuideContent>
55
- <GuideTitle>{guide.title}</GuideTitle>
56
- <GuideDescription>{guide.description}</GuideDescription>
57
- <GuideCategory>{guide.category}</GuideCategory>
58
- </GuideContent>
59
- </GuideItem>
60
- ))}
61
- </GuidesGrid>
62
- );
63
-
64
- return (
65
- <InformationCenterTabView
66
- items={videoGuides}
67
- searchQuery={guidesSearchQuery}
68
- onSearchChange={setGuidesSearchQuery}
69
- filterItems={filterItems}
70
- renderContent={renderContent}
71
- searchPlaceholder="Search guides..."
72
- filterOptions={{
73
- options: guideCategoryOptions,
74
- selectedOption: selectedGuideCategory,
75
- onOptionChange: setSelectedGuideCategory,
76
- }}
77
- emptyMessage="No guides found"
78
- dependencies={[selectedGuideCategory]}
79
- />
80
- );
81
- };
82
-
83
- const GuidesGrid = styled.div`
84
- display: grid;
85
- grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
86
- gap: 16px;
87
- padding: 16px;
88
- `;
89
-
90
- const GuideItem = styled.div`
91
- background: rgba(0, 0, 0, 0.3);
92
- border-radius: 4px;
93
- overflow: hidden;
94
- border: 1px solid ${uiColors.darkGray};
95
- cursor: pointer;
96
- transition: transform 0.2s ease;
97
-
98
- &:hover {
99
- transform: translateY(-2px);
100
- }
101
- `;
102
-
103
- const GuideThumbnail = styled.div`
104
- width: 100%;
105
- height: 168px;
106
- background: rgba(0, 0, 0, 0.2);
107
- overflow: hidden;
108
-
109
- img {
110
- width: 100%;
111
- height: 100%;
112
- object-fit: cover;
113
- }
114
- `;
115
-
116
- const GuideContent = styled.div`
117
- padding: 12px;
118
- `;
119
-
120
- const GuideTitle = styled.h3`
121
- margin: 0;
122
- font-size: 0.6rem;
123
- color: ${uiColors.yellow};
124
- font-family: 'Press Start 2P', cursive;
125
- margin-bottom: 8px;
126
- `;
127
-
128
- const GuideDescription = styled.p`
129
- margin: 0;
130
- font-size: 0.55rem;
131
- color: ${uiColors.lightGray};
132
- font-family: 'Press Start 2P', cursive;
133
- margin-bottom: 8px;
134
- line-height: 1.4;
135
- `;
136
-
137
- const GuideCategory = styled.span`
138
- font-size: 0.5rem;
139
- color: ${uiColors.yellow};
140
- font-family: 'Press Start 2P', cursive;
141
- background: rgba(255, 255, 255, 0.1);
142
- padding: 4px 8px;
143
- border-radius: 4px;
144
- `;
@@ -1,142 +0,0 @@
1
- import { ItemType, UserAccountTypes } from '@rpg-engine/shared';
2
- import React, { useMemo, useState } from 'react';
3
- import styled from 'styled-components';
4
- import { usePagination } from '../CraftBook/hooks/usePagination';
5
- import { Pagination } from '../shared/Pagination/Pagination';
6
- import { SearchBar } from '../shared/SearchBar/SearchBar';
7
- import { StoreItemRow } from './StoreItemRow';
8
- import { IStoreItem } from './StoreTypes';
9
-
10
- const ITEMS_PER_PAGE = 4;
11
-
12
- interface IInternalStoreTabProps {
13
- items: IStoreItem[];
14
- atlasJSON: Record<string, any>;
15
- atlasIMG: string;
16
- onPurchase: (item: IStoreItem, quantity: number) => void;
17
- userGold: number;
18
- userAccountType: UserAccountTypes;
19
- type?: ItemType | 'premium' | 'all';
20
- initialSearchQuery?: string;
21
- }
22
-
23
- export const InternalStoreTab: React.FC<IInternalStoreTabProps> = ({
24
- items,
25
- atlasJSON,
26
- atlasIMG,
27
- onPurchase,
28
- userGold,
29
- userAccountType,
30
- type = 'all',
31
- initialSearchQuery = '',
32
- }) => {
33
- const [searchQuery, setSearchQuery] = useState(initialSearchQuery);
34
-
35
- const filteredItems = useMemo(() => {
36
- return items.filter(item => {
37
- const matchesSearch = item.name
38
- .toLowerCase()
39
- .includes(searchQuery.toLowerCase());
40
-
41
- if (!matchesSearch) return false;
42
-
43
- switch (type) {
44
- case ItemType.Weapon:
45
- return item.type === ItemType.Weapon;
46
- case ItemType.Consumable:
47
- return item.type === ItemType.Consumable;
48
- case 'premium':
49
- return (
50
- item.requiredAccountType && item.requiredAccountType.length > 0
51
- );
52
- default:
53
- return true;
54
- }
55
- });
56
- }, [items, searchQuery, type]);
57
-
58
- const {
59
- currentPage,
60
- setCurrentPage,
61
- paginatedItems,
62
- totalPages,
63
- } = usePagination({
64
- items: filteredItems,
65
- itemsPerPage: ITEMS_PER_PAGE,
66
- dependencies: [searchQuery, type],
67
- });
68
-
69
- return (
70
- <Container>
71
- <SearchContainer>
72
- <SearchBar
73
- value={searchQuery}
74
- onChange={setSearchQuery}
75
- placeholder="Search items..."
76
- />
77
- </SearchContainer>
78
-
79
- <StoreContent>
80
- {paginatedItems.length > 0 ? (
81
- paginatedItems.map(item => (
82
- <StoreItemRow
83
- key={item._id}
84
- item={item}
85
- atlasJSON={atlasJSON}
86
- atlasIMG={atlasIMG}
87
- onPurchase={onPurchase}
88
- userGold={userGold}
89
- userAccountType={userAccountType}
90
- />
91
- ))
92
- ) : (
93
- <EmptyMessage>No items found</EmptyMessage>
94
- )}
95
- </StoreContent>
96
-
97
- <PaginationContainer>
98
- <Pagination
99
- currentPage={currentPage}
100
- totalPages={Math.max(1, totalPages)}
101
- onPageChange={setCurrentPage}
102
- />
103
- </PaginationContainer>
104
- </Container>
105
- );
106
- };
107
-
108
- const Container = styled.div`
109
- display: flex;
110
- flex-direction: column;
111
- gap: 1rem;
112
- padding: 1rem;
113
- min-height: 400px;
114
- `;
115
-
116
- const SearchContainer = styled.div`
117
- width: 100%;
118
- `;
119
-
120
- const StoreContent = styled.div`
121
- display: flex;
122
- flex-direction: column;
123
- gap: 0.5rem;
124
- flex: 1;
125
- `;
126
-
127
- const PaginationContainer = styled.div`
128
- display: flex;
129
- justify-content: center;
130
- padding-top: 1rem;
131
- border-top: 1px solid rgba(255, 255, 255, 0.1);
132
- `;
133
-
134
- const EmptyMessage = styled.div`
135
- display: flex;
136
- align-items: center;
137
- justify-content: center;
138
- padding: 2rem;
139
- color: rgba(255, 255, 255, 0.5);
140
- font-family: 'Press Start 2P', cursive;
141
- font-size: 0.8rem;
142
- `;
@@ -1,46 +0,0 @@
1
- import { UserAccountTypes } from '@rpg-engine/shared';
2
- import React from 'react';
3
- import { PaginatedContent } from '../shared/PaginatedContent/PaginatedContent';
4
- import { StoreItemRow } from './StoreItemRow';
5
- import { IStoreItem } from './StoreTypes';
6
-
7
- interface IStoreTabContentProps {
8
- items: IStoreItem[];
9
- atlasJSON: Record<string, any>;
10
- atlasIMG: string;
11
- onPurchase: (item: IStoreItem, quantity: number) => void;
12
- userGold: number;
13
- userAccountType: UserAccountTypes;
14
- tabId: string;
15
- }
16
-
17
- export const StoreTabContent: React.FC<IStoreTabContentProps> = ({
18
- items,
19
- atlasJSON,
20
- atlasIMG,
21
- onPurchase,
22
- userGold,
23
- userAccountType,
24
- tabId,
25
- }) => {
26
- const renderItem = (item: IStoreItem) => (
27
- <StoreItemRow
28
- key={item._id}
29
- item={item}
30
- atlasJSON={atlasJSON}
31
- atlasIMG={atlasIMG}
32
- onPurchase={onPurchase}
33
- userGold={userGold}
34
- userAccountType={userAccountType}
35
- />
36
- );
37
-
38
- return (
39
- <PaginatedContent
40
- items={items}
41
- renderItem={renderItem}
42
- emptyMessage="No items found"
43
- tabId={tabId}
44
- />
45
- );
46
- };