@rpg-engine/long-bow 0.8.195 → 0.8.197

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpg-engine/long-bow",
3
- "version": "0.8.195",
3
+ "version": "0.8.197",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  "build": "tsdx build",
25
25
  "test": "tsdx test --passWithNoTests",
26
26
  "lint": "tsdx lint",
27
- "prepare": "echo skip",
27
+ "prepare": "tsdx build",
28
28
  "size": "size-limit",
29
29
  "analyze": "size-limit --why",
30
30
  "storybook": "start-storybook -p 6006",
@@ -0,0 +1,138 @@
1
+ import React, { useCallback } from 'react';
2
+ import { FaTimes } from 'react-icons/fa';
3
+ import styled from 'styled-components';
4
+ import { ISkillInfoEntry } from '../constants/skillInfoData';
5
+ import ModalPortal from './Abstractions/ModalPortal';
6
+
7
+ interface IProps {
8
+ info: ISkillInfoEntry;
9
+ onClose: () => void;
10
+ }
11
+
12
+ export const SkillInfoModal: React.FC<IProps> = ({ info, onClose }) => {
13
+ const stopPropagation = useCallback((e: React.PointerEvent) => {
14
+ e.stopPropagation();
15
+ }, []);
16
+
17
+ return (
18
+ <ModalPortal>
19
+ <Overlay onPointerDown={onClose} />
20
+ <ModalContainer>
21
+ <ModalContent onPointerDown={stopPropagation}>
22
+ <Header>
23
+ <Title $color={info.color}>{info.name}</Title>
24
+ <CloseButton onPointerDown={onClose}>
25
+ <FaTimes />
26
+ </CloseButton>
27
+ </Header>
28
+
29
+ <Section>
30
+ <Label>What it does</Label>
31
+ <Text>{info.description}</Text>
32
+ </Section>
33
+
34
+ <Section>
35
+ <Label>How to train</Label>
36
+ <Text>{info.howToTrain}</Text>
37
+ </Section>
38
+
39
+ {info.notes && (
40
+ <Section>
41
+ <Label>Notes</Label>
42
+ <Text>{info.notes}</Text>
43
+ </Section>
44
+ )}
45
+ </ModalContent>
46
+ </ModalContainer>
47
+ </ModalPortal>
48
+ );
49
+ };
50
+
51
+ const Overlay = styled.div`
52
+ position: fixed;
53
+ inset: 0;
54
+ background: rgba(0, 0, 0, 0.65);
55
+ z-index: 1000;
56
+ `;
57
+
58
+ const ModalContainer = styled.div`
59
+ position: fixed;
60
+ inset: 0;
61
+ display: flex;
62
+ align-items: center;
63
+ justify-content: center;
64
+ z-index: 1001;
65
+ pointer-events: none;
66
+ `;
67
+
68
+ const ModalContent = styled.div`
69
+ background: #1a1a2e;
70
+ border: 2px solid #f59e0b;
71
+ border-radius: 8px;
72
+ padding: 20px 24px 24px;
73
+ width: 340px;
74
+ max-width: 90%;
75
+ max-height: 80dvh;
76
+ overflow-y: auto;
77
+ display: flex;
78
+ flex-direction: column;
79
+ gap: 14px;
80
+ pointer-events: auto;
81
+ animation: scaleIn 0.15s ease-out;
82
+
83
+ @keyframes scaleIn {
84
+ from { transform: scale(0.85); opacity: 0; }
85
+ to { transform: scale(1); opacity: 1; }
86
+ }
87
+ `;
88
+
89
+ const Header = styled.div`
90
+ display: flex;
91
+ align-items: center;
92
+ gap: 8px;
93
+ `;
94
+
95
+ const Title = styled.h3<{ $color: string }>`
96
+ margin: 0;
97
+ flex: 1;
98
+ font-family: 'Press Start 2P', cursive;
99
+ font-size: 0.65rem;
100
+ color: ${({ $color }) => $color};
101
+ `;
102
+
103
+ const CloseButton = styled.button`
104
+ background: none;
105
+ border: none;
106
+ color: rgba(255, 255, 255, 0.6);
107
+ cursor: pointer;
108
+ font-size: 1rem;
109
+ padding: 4px;
110
+ display: flex;
111
+ align-items: center;
112
+ pointer-events: auto;
113
+
114
+ &:hover {
115
+ color: #ffffff;
116
+ }
117
+ `;
118
+
119
+ const Section = styled.div`
120
+ display: flex;
121
+ flex-direction: column;
122
+ gap: 6px;
123
+ `;
124
+
125
+ const Label = styled.span`
126
+ font-size: 0.5rem;
127
+ font-weight: bold;
128
+ text-transform: uppercase;
129
+ letter-spacing: 0.05em;
130
+ color: rgba(255, 255, 255, 0.45);
131
+ `;
132
+
133
+ const Text = styled.p`
134
+ font-size: 0.55rem;
135
+ line-height: 1.6;
136
+ color: rgba(255, 255, 255, 0.85);
137
+ margin: 0;
138
+ `;
@@ -11,7 +11,7 @@ import styled from 'styled-components';
11
11
  import { uiColors } from '../constants/uiColors';
12
12
  import { SKILL_INFO_DATA } from '../constants/skillInfoData';
13
13
  import { DraggableContainer } from './DraggableContainer';
14
- import { SkillInfoOverlay } from './SkillInfoOverlay';
14
+ import { SkillInfoModal } from './SkillInfoModal';
15
15
  import { SkillProgressBar } from './SkillProgressBar';
16
16
 
17
17
  export interface ISkillContainerProps {
@@ -159,7 +159,7 @@ export const SkillsContainer: React.FC<ISkillContainerProps> = ({
159
159
  <CloseButton onPointerDown={onCloseButton}>X</CloseButton>
160
160
  )}
161
161
  {selectedInfo && (
162
- <SkillInfoOverlay
162
+ <SkillInfoModal
163
163
  info={selectedInfo}
164
164
  onClose={() => setSelectedSkillKey(null)}
165
165
  />
@@ -208,7 +208,6 @@ export const SkillsContainer: React.FC<ISkillContainerProps> = ({
208
208
  };
209
209
 
210
210
  const SkillsDraggableContainer = styled(DraggableContainer)`
211
- position: relative;
212
211
  border: 1px solid black;
213
212
 
214
213
  max-width: 450px;
@@ -1,100 +0,0 @@
1
- import React from 'react';
2
- import styled from 'styled-components';
3
- import { ISkillInfoEntry } from '../constants/skillInfoData';
4
-
5
- interface IProps {
6
- info: ISkillInfoEntry;
7
- onClose: () => void;
8
- }
9
-
10
- export const SkillInfoOverlay: React.FC<IProps> = ({ info, onClose }) => (
11
- <Overlay>
12
- <Header>
13
- <ColorBar $color={info.color} />
14
- <Title $color={info.color}>{info.name}</Title>
15
- <CloseBtn onPointerDown={onClose}>✕</CloseBtn>
16
- </Header>
17
- <Section>
18
- <Label>What it does</Label>
19
- <Text>{info.description}</Text>
20
- </Section>
21
- <Section>
22
- <Label>How to train</Label>
23
- <Text>{info.howToTrain}</Text>
24
- </Section>
25
- {info.notes && (
26
- <Section>
27
- <Label>Notes</Label>
28
- <Text>{info.notes}</Text>
29
- </Section>
30
- )}
31
- </Overlay>
32
- );
33
-
34
- const Overlay = styled.div`
35
- position: absolute;
36
- inset: 0;
37
- background: rgba(20, 20, 30, 0.97);
38
- z-index: 10;
39
- overflow-y: auto;
40
- padding: 0.75rem;
41
- display: flex;
42
- flex-direction: column;
43
- gap: 0.75rem;
44
- `;
45
-
46
- const Header = styled.div`
47
- display: flex;
48
- flex-direction: row;
49
- align-items: center;
50
- gap: 0.4rem;
51
- margin-bottom: 0.25rem;
52
- `;
53
-
54
- const ColorBar = styled.div<{ $color: string }>`
55
- width: 3px;
56
- height: 1rem;
57
- background: ${({ $color }) => $color};
58
- border-radius: 2px;
59
- flex-shrink: 0;
60
- `;
61
-
62
- const Title = styled.span<{ $color: string }>`
63
- font-size: 0.65rem;
64
- font-weight: bold;
65
- flex: 1;
66
- color: ${({ $color }) => $color};
67
- `;
68
-
69
- const CloseBtn = styled.div`
70
- cursor: pointer;
71
- color: rgba(255, 255, 255, 0.6);
72
- font-size: 0.7rem;
73
- line-height: 1;
74
- padding: 2px 4px;
75
-
76
- &:hover {
77
- color: rgba(255, 255, 255, 0.9);
78
- }
79
- `;
80
-
81
- const Section = styled.div`
82
- display: flex;
83
- flex-direction: column;
84
- gap: 0.15rem;
85
- `;
86
-
87
- const Label = styled.span`
88
- font-size: 0.5rem;
89
- font-weight: bold;
90
- text-transform: uppercase;
91
- letter-spacing: 0.05em;
92
- color: rgba(255, 255, 255, 0.45);
93
- `;
94
-
95
- const Text = styled.p`
96
- font-size: 0.55rem;
97
- line-height: 1.5;
98
- color: rgba(255, 255, 255, 0.85);
99
- margin: 0;
100
- `;