@rpg-engine/long-bow 0.8.140 → 0.8.145
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/dist/components/Marketplace/BlueprintSearchModal.d.ts +17 -0
- package/dist/components/Marketplace/BuyOrderDetailsModal.d.ts +17 -0
- package/dist/components/Marketplace/BuyOrderPanel.d.ts +24 -0
- package/dist/components/Marketplace/BuyOrderRows.d.ts +13 -0
- package/dist/components/Marketplace/BuyPanel.d.ts +9 -1
- package/dist/components/Marketplace/HistoryPanel.d.ts +18 -0
- package/dist/components/Marketplace/ManagmentPanel.d.ts +4 -3
- package/dist/components/Marketplace/Marketplace.d.ts +38 -2
- package/dist/components/Marketplace/MarketplaceRows.d.ts +13 -1
- package/dist/components/Marketplace/MarketplaceSettingsPanel.d.ts +8 -0
- package/dist/components/Store/PaymentMethodModal.d.ts +1 -0
- package/dist/components/shared/LabelPill/LabelPill.d.ts +9 -0
- package/dist/components/shared/LabelPill/index.d.ts +1 -0
- package/dist/components/shared/SegmentedToggle/SegmentedToggle.d.ts +12 -0
- package/dist/components/shared/SegmentedToggle/index.d.ts +1 -0
- package/dist/components/shared/Tabs/Tabs.d.ts +13 -0
- package/dist/components/shared/Tabs/index.d.ts +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/long-bow.cjs.development.js +12074 -1449
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +12060 -1450
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/stories/Features/marketplace/BlueprintSearchModal.stories.d.ts +1 -0
- package/dist/stories/Features/marketplace/BuyOrderPanel.stories.d.ts +1 -0
- package/dist/stories/Features/marketplace/BuyOrderRows.stories.d.ts +1 -0
- package/dist/stories/Features/marketplace/HistoryPanel.stories.d.ts +1 -0
- package/dist/stories/Features/trading/MarketplaceRows.stories.d.ts +2 -1
- package/dist/stories/UI/buttonsAndInputs/SegmentedToggle.stories.d.ts +6 -0
- package/dist/stories/UI/text/LabelPill.stories.d.ts +7 -0
- package/dist/utils/atlasUtils.d.ts +2 -0
- package/package.json +3 -2
- package/src/components/ConfirmModal.tsx +50 -27
- package/src/components/Marketplace/BlueprintSearchModal.tsx +418 -0
- package/src/components/Marketplace/BuyOrderDetailsModal.tsx +307 -0
- package/src/components/Marketplace/BuyOrderPanel.tsx +266 -0
- package/src/components/Marketplace/BuyOrderRows.tsx +287 -0
- package/src/components/Marketplace/BuyPanel.tsx +486 -170
- package/src/components/Marketplace/HistoryPanel.tsx +422 -0
- package/src/components/Marketplace/ManagmentPanel.tsx +176 -98
- package/src/components/Marketplace/Marketplace.tsx +227 -40
- package/src/components/Marketplace/MarketplaceBuyModal.tsx +1 -0
- package/src/components/Marketplace/MarketplaceRows.tsx +274 -80
- package/src/components/Marketplace/MarketplaceSettingsPanel.tsx +128 -0
- package/src/components/Store/CartView.tsx +11 -0
- package/src/components/Store/PaymentMethodModal.tsx +26 -9
- package/src/components/shared/LabelPill/LabelPill.tsx +45 -0
- package/src/components/shared/LabelPill/index.ts +1 -0
- package/src/components/shared/SegmentedToggle/SegmentedToggle.tsx +61 -0
- package/src/components/shared/SegmentedToggle/index.ts +1 -0
- package/src/components/shared/SpriteFromAtlas.tsx +7 -2
- package/src/components/shared/Tabs/Tabs.tsx +60 -0
- package/src/components/shared/Tabs/index.ts +1 -0
- package/src/index.tsx +5 -0
- package/src/mocks/atlas/items/items.json +33998 -25238
- package/src/mocks/atlas/items/items.png +0 -0
- package/src/mocks/itemContainer.mocks.ts +31 -0
- package/src/stories/Features/marketplace/BlueprintSearchModal.stories.tsx +145 -0
- package/src/stories/Features/marketplace/BuyOrderPanel.stories.tsx +207 -0
- package/src/stories/Features/marketplace/BuyOrderRows.stories.tsx +116 -0
- package/src/stories/Features/marketplace/HistoryPanel.stories.tsx +157 -0
- package/src/stories/Features/trading/Marketplace.stories.tsx +109 -0
- package/src/stories/Features/trading/MarketplaceRows.stories.tsx +11 -0
- package/src/stories/UI/buttonsAndInputs/SegmentedToggle.stories.tsx +54 -0
- package/src/stories/UI/text/LabelPill.stories.tsx +43 -0
- package/src/utils/__test__/atlasUtils.spec.ts +26 -0
- package/src/utils/atlasUtils.ts +80 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
export interface ILabelPillProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
background?: string;
|
|
7
|
+
borderColor?: string;
|
|
8
|
+
color?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const LabelPill: React.FC<ILabelPillProps> = ({
|
|
13
|
+
children,
|
|
14
|
+
background = 'rgba(255,255,255,0.08)',
|
|
15
|
+
borderColor = 'rgba(255,255,255,0.08)',
|
|
16
|
+
color = '#fff',
|
|
17
|
+
className,
|
|
18
|
+
}) => {
|
|
19
|
+
return (
|
|
20
|
+
<Pill
|
|
21
|
+
className={className}
|
|
22
|
+
$background={background}
|
|
23
|
+
$borderColor={borderColor}
|
|
24
|
+
$color={color}
|
|
25
|
+
>
|
|
26
|
+
{children}
|
|
27
|
+
</Pill>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const Pill = styled.span<{
|
|
32
|
+
$background: string;
|
|
33
|
+
$borderColor: string;
|
|
34
|
+
$color: string;
|
|
35
|
+
}>`
|
|
36
|
+
font-family: 'Press Start 2P', cursive;
|
|
37
|
+
font-size: 0.45rem !important;
|
|
38
|
+
color: ${({ $color }) => $color};
|
|
39
|
+
text-transform: uppercase;
|
|
40
|
+
white-space: nowrap;
|
|
41
|
+
background: ${({ $background }) => $background};
|
|
42
|
+
padding: 2px 6px;
|
|
43
|
+
border-radius: 8px;
|
|
44
|
+
border: 1px solid ${({ $borderColor }) => $borderColor};
|
|
45
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LabelPill';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
export interface ISegmentedToggleOption {
|
|
5
|
+
id: string;
|
|
6
|
+
label: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface ISegmentedToggleProps {
|
|
10
|
+
options: ISegmentedToggleOption[];
|
|
11
|
+
activeId: string;
|
|
12
|
+
onChange: (id: string) => void;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const SegmentedToggle: React.FC<ISegmentedToggleProps> = ({
|
|
17
|
+
options,
|
|
18
|
+
activeId,
|
|
19
|
+
onChange,
|
|
20
|
+
className,
|
|
21
|
+
}) => {
|
|
22
|
+
return (
|
|
23
|
+
<Container className={className}>
|
|
24
|
+
{options.map(option => (
|
|
25
|
+
<OptionButton
|
|
26
|
+
key={option.id}
|
|
27
|
+
type="button"
|
|
28
|
+
$active={option.id === activeId}
|
|
29
|
+
onClick={() => onChange(option.id)}
|
|
30
|
+
>
|
|
31
|
+
{option.label}
|
|
32
|
+
</OptionButton>
|
|
33
|
+
))}
|
|
34
|
+
</Container>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const Container = styled.div`
|
|
39
|
+
display: inline-flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
gap: 8px;
|
|
42
|
+
flex-wrap: wrap;
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
const OptionButton = styled.button<{ $active: boolean }>`
|
|
46
|
+
border: 1px solid ${({ $active }) => ($active ? 'rgba(245, 158, 11, 0.75)' : 'rgba(255, 255, 255, 0.08)')};
|
|
47
|
+
background: ${({ $active }) => ($active ? 'rgba(245, 158, 11, 0.16)' : 'rgba(0, 0, 0, 0.18)')};
|
|
48
|
+
color: ${({ $active }) => ($active ? '#fde68a' : '#cfcfcf')};
|
|
49
|
+
border-radius: 999px;
|
|
50
|
+
padding: 8px 12px;
|
|
51
|
+
cursor: pointer;
|
|
52
|
+
font-size: 0.56rem;
|
|
53
|
+
text-transform: uppercase;
|
|
54
|
+
letter-spacing: 0.8px;
|
|
55
|
+
transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
|
|
56
|
+
|
|
57
|
+
&:hover {
|
|
58
|
+
border-color: rgba(245, 158, 11, 0.45);
|
|
59
|
+
color: #fde68a;
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './SegmentedToggle';
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { GRID_HEIGHT, GRID_WIDTH } from '@rpg-engine/shared';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
|
+
import {
|
|
5
|
+
NO_IMAGE_SPRITE_KEY,
|
|
6
|
+
resolveAtlasSpriteKey,
|
|
7
|
+
} from '../../utils/atlasUtils';
|
|
4
8
|
import { toUppercaseHexColor } from '../../utils/colorUtils';
|
|
5
9
|
|
|
6
10
|
interface IProps {
|
|
@@ -41,9 +45,10 @@ export const SpriteFromAtlas: React.FC<IProps> = ({
|
|
|
41
45
|
//! If an item is not showing, remember that you MUST run yarn atlas:copy everytime you add a new item to the atlas (it will sync our public folder atlas with src/atlas).
|
|
42
46
|
//!Due to React's limitations, we cannot import it from the public folder directly!
|
|
43
47
|
|
|
48
|
+
const resolvedSpriteKey = resolveAtlasSpriteKey(atlasJSON, spriteKey);
|
|
44
49
|
const spriteData =
|
|
45
|
-
atlasJSON?.frames?.[
|
|
46
|
-
atlasJSON?.frames?.[
|
|
50
|
+
(resolvedSpriteKey && atlasJSON?.frames?.[resolvedSpriteKey]) ||
|
|
51
|
+
atlasJSON?.frames?.[NO_IMAGE_SPRITE_KEY];
|
|
47
52
|
|
|
48
53
|
if (!spriteData) {
|
|
49
54
|
console.error(
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
export interface ITabOption {
|
|
5
|
+
id: string;
|
|
6
|
+
label: React.ReactNode;
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface ITabsProps {
|
|
11
|
+
options: ITabOption[];
|
|
12
|
+
activeTabId: string;
|
|
13
|
+
onTabChange: (tabId: string) => void;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const Tabs: React.FC<ITabsProps> = ({ options, activeTabId, onTabChange, className }) => {
|
|
18
|
+
return (
|
|
19
|
+
<TabsContainer className={className}>
|
|
20
|
+
{options.map((option) => (
|
|
21
|
+
<TabButton
|
|
22
|
+
key={option.id}
|
|
23
|
+
$active={option.id === activeTabId}
|
|
24
|
+
onClick={() => onTabChange(option.id)}
|
|
25
|
+
>
|
|
26
|
+
{option.icon && option.icon} {option.label}
|
|
27
|
+
</TabButton>
|
|
28
|
+
))}
|
|
29
|
+
</TabsContainer>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const TabsContainer = styled.div`
|
|
34
|
+
display: flex;
|
|
35
|
+
gap: 15px;
|
|
36
|
+
width: 95%;
|
|
37
|
+
margin: 0 auto 15px auto;
|
|
38
|
+
border-bottom: 2px solid rgba(255, 255, 255, 0.1);
|
|
39
|
+
padding-bottom: 10px;
|
|
40
|
+
`;
|
|
41
|
+
|
|
42
|
+
const TabButton = styled.button<{ $active: boolean }>`
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
gap: 8px;
|
|
46
|
+
background: transparent;
|
|
47
|
+
border: none;
|
|
48
|
+
border-bottom: ${({ $active }) => ($active ? '3px solid #f59e0b' : '3px solid transparent')};
|
|
49
|
+
color: ${({ $active }) => ($active ? '#ffffff' : '#888888')};
|
|
50
|
+
font-family: 'Press Start 2P', cursive;
|
|
51
|
+
font-size: 0.70rem;
|
|
52
|
+
letter-spacing: 1px;
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
padding: 5px 10px 10px 10px;
|
|
55
|
+
transition: color 0.2s, border-bottom 0.2s;
|
|
56
|
+
|
|
57
|
+
&:hover {
|
|
58
|
+
color: #ffffff;
|
|
59
|
+
}
|
|
60
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Tabs';
|
package/src/index.tsx
CHANGED
|
@@ -37,6 +37,11 @@ export * from './components/ListMenu';
|
|
|
37
37
|
export * from './components/Marketplace/Marketplace';
|
|
38
38
|
export * from './components/Marketplace/MarketplaceBuyModal';
|
|
39
39
|
export * from './components/Marketplace/MarketplaceRows';
|
|
40
|
+
export * from './components/Marketplace/MarketplaceSettingsPanel';
|
|
41
|
+
export * from './components/Marketplace/BuyOrderPanel';
|
|
42
|
+
export * from './components/Marketplace/BuyOrderRows';
|
|
43
|
+
export * from './components/Marketplace/HistoryPanel';
|
|
44
|
+
export * from './components/Marketplace/BlueprintSearchModal';
|
|
40
45
|
export * from './components/Multitab/TabBody';
|
|
41
46
|
export * from './components/Multitab/TabsContainer';
|
|
42
47
|
export * from './components/NPCDialog/NPCDialog';
|