@rpg-engine/long-bow 0.1.52 → 0.1.56
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/DraggableContainer.d.ts +12 -0
- package/dist/components/SimpleProgressBar.d.ts +8 -0
- package/dist/components/SkillProgressBar.d.ts +9 -0
- package/dist/imgExp.png +0 -0
- package/dist/index.d.ts +3 -1
- package/dist/long-bow.cjs.development.js +179 -57
- 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 +178 -58
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +5 -2
- package/src/components/Button.tsx +5 -7
- package/src/components/Chat/Chat.tsx +1 -1
- package/src/components/CheckButton.tsx +4 -3
- package/src/components/DraggableContainer.tsx +94 -0
- package/src/components/Dropdown.tsx +1 -1
- package/src/components/ListMenu.tsx +4 -4
- package/src/components/NPCDialog/NPCDialog.tsx +3 -2
- package/src/components/NPCDialog/NPCDialogText.tsx +1 -1
- package/src/components/NPCDialog/QuestionDialog/QuestionDialog.tsx +15 -13
- package/src/components/ProgressBar.tsx +4 -4
- package/src/components/RPGUIContainer.tsx +1 -1
- package/src/components/RadioButton.tsx +1 -1
- package/src/components/SimpleProgressBar.tsx +58 -0
- package/src/components/SkillProgressBar.tsx +70 -0
- package/src/components/Truncate.tsx +1 -1
- package/src/components/imgExp.png +0 -0
- package/src/components/shared/Column.tsx +4 -4
- package/src/hooks/useEventListener.ts +1 -1
- package/src/index.tsx +3 -1
|
@@ -20,7 +20,7 @@ export const ProgressBar: React.FC<IBarProps> = ({
|
|
|
20
20
|
minWidth = 100,
|
|
21
21
|
style,
|
|
22
22
|
}) => {
|
|
23
|
-
const calculatePercentageValue = function
|
|
23
|
+
const calculatePercentageValue = function(max: number, value: number) {
|
|
24
24
|
if (value > max) {
|
|
25
25
|
value = max;
|
|
26
26
|
}
|
|
@@ -83,9 +83,9 @@ interface IContainerProps {
|
|
|
83
83
|
const Container = styled.div<IContainerProps>`
|
|
84
84
|
display: flex;
|
|
85
85
|
flex-direction: column;
|
|
86
|
-
min-width: ${
|
|
87
|
-
width: ${
|
|
86
|
+
min-width: ${props => props.minWidth}px;
|
|
87
|
+
width: ${props => props.percentageWidth}%;
|
|
88
88
|
justify-content: start;
|
|
89
89
|
align-items: flex-start;
|
|
90
|
-
${
|
|
90
|
+
${props => props.style}
|
|
91
91
|
`;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
interface IProps {
|
|
5
|
+
value: number;
|
|
6
|
+
height?: string;
|
|
7
|
+
bgColor?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const SimpleProgressBar: React.FC<IProps> = ({
|
|
11
|
+
value,
|
|
12
|
+
|
|
13
|
+
bgColor = 'red',
|
|
14
|
+
}) => {
|
|
15
|
+
return (
|
|
16
|
+
<Container>
|
|
17
|
+
<ProgressBarContainer>
|
|
18
|
+
<BackgroundBar>
|
|
19
|
+
<Progress value={value} bgColor={bgColor} />
|
|
20
|
+
</BackgroundBar>
|
|
21
|
+
</ProgressBarContainer>
|
|
22
|
+
</Container>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const Container = styled.div`
|
|
27
|
+
display: flex;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
align-items: center;
|
|
30
|
+
width: 100%;
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
const BackgroundBar = styled.span`
|
|
34
|
+
background-color: rgba(0, 0, 0, 0.075);
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
interface IProgressProps {
|
|
38
|
+
value: number;
|
|
39
|
+
bgColor: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const Progress = styled.span`
|
|
43
|
+
background-color: ${(props: IProgressProps) => props.bgColor};
|
|
44
|
+
width: ${(props: IProgressProps) => props.value}%;
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
const ProgressBarContainer = styled.div`
|
|
48
|
+
border-radius: 60px;
|
|
49
|
+
border: 1px solid #282424;
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
width: 100%;
|
|
52
|
+
span {
|
|
53
|
+
display: block;
|
|
54
|
+
height: 100%;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
height: 8px;
|
|
58
|
+
`;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import imgSrcTemplate from './imgExp.png';
|
|
4
|
+
import { SimpleProgressBar } from './SimpleProgressBar';
|
|
5
|
+
|
|
6
|
+
export interface ISkillProgressBarProps {
|
|
7
|
+
value: number;
|
|
8
|
+
|
|
9
|
+
height: string;
|
|
10
|
+
bgColor: string;
|
|
11
|
+
titleName: string;
|
|
12
|
+
|
|
13
|
+
logoSrc?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({
|
|
17
|
+
value,
|
|
18
|
+
bgColor,
|
|
19
|
+
titleName,
|
|
20
|
+
|
|
21
|
+
logoSrc = imgSrcTemplate,
|
|
22
|
+
}) => {
|
|
23
|
+
return (
|
|
24
|
+
<>
|
|
25
|
+
<ProgressTitle>
|
|
26
|
+
<TitleName>{titleName}</TitleName>
|
|
27
|
+
<ValueDisplay>{value}</ValueDisplay>
|
|
28
|
+
</ProgressTitle>
|
|
29
|
+
<ProgressBody>
|
|
30
|
+
<ProgressIconContainer>
|
|
31
|
+
<Icon src={logoSrc} />
|
|
32
|
+
</ProgressIconContainer>
|
|
33
|
+
|
|
34
|
+
<SimpleProgressBar value={value} bgColor={bgColor} />
|
|
35
|
+
</ProgressBody>
|
|
36
|
+
</>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const TitleName = styled.span`
|
|
41
|
+
margin-left: 5px;
|
|
42
|
+
`;
|
|
43
|
+
|
|
44
|
+
const ValueDisplay = styled.span``;
|
|
45
|
+
|
|
46
|
+
const ProgressIconContainer = styled.div`
|
|
47
|
+
display: flex;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
align-items: center;
|
|
50
|
+
`;
|
|
51
|
+
|
|
52
|
+
const ProgressBody = styled.div`
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-direction: row;
|
|
55
|
+
`;
|
|
56
|
+
|
|
57
|
+
const ProgressTitle = styled.div`
|
|
58
|
+
width: 100%;
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: row;
|
|
61
|
+
justify-content: space-between;
|
|
62
|
+
span {
|
|
63
|
+
font-size: 0.6rem;
|
|
64
|
+
}
|
|
65
|
+
`;
|
|
66
|
+
|
|
67
|
+
const Icon = styled.img`
|
|
68
|
+
margin-right: 10px;
|
|
69
|
+
height: 30px;
|
|
70
|
+
`;
|
|
@@ -19,7 +19,7 @@ const Container = styled.div<IContainerProps>`
|
|
|
19
19
|
display: -webkit-box;
|
|
20
20
|
max-width: 100%;
|
|
21
21
|
max-height: 100%;
|
|
22
|
-
-webkit-line-clamp: ${
|
|
22
|
+
-webkit-line-clamp: ${props => props.maxLines};
|
|
23
23
|
-webkit-box-orient: vertical;
|
|
24
24
|
overflow: hidden;
|
|
25
25
|
`;
|
|
Binary file
|
|
@@ -8,9 +8,9 @@ interface IColumn {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export const Column = styled.div<IColumn>`
|
|
11
|
-
flex: ${
|
|
11
|
+
flex: ${props => props.flex || 'auto'};
|
|
12
12
|
display: flex;
|
|
13
|
-
flex-wrap: ${
|
|
14
|
-
align-items: ${
|
|
15
|
-
justify-content: ${
|
|
13
|
+
flex-wrap: ${props => props.flexWrap || 'nowrap'};
|
|
14
|
+
align-items: ${props => props.alignItems || 'flex-start'};
|
|
15
|
+
justify-content: ${props => props.justifyContent || 'flex-start'};
|
|
16
16
|
`;
|
package/src/index.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './components/Button';
|
|
2
|
-
export * from './components/CheckButton';
|
|
3
2
|
export * from './components/Chat/Chat';
|
|
3
|
+
export * from './components/CheckButton';
|
|
4
|
+
export * from './components/DraggableContainer';
|
|
4
5
|
export * from './components/Dropdown';
|
|
5
6
|
export * from './components/Input';
|
|
6
7
|
export * from './components/ListMenu';
|
|
@@ -11,6 +12,7 @@ export * from './components/RadioButton';
|
|
|
11
12
|
export * from './components/RangeSlider';
|
|
12
13
|
export * from './components/RPGUIContainer';
|
|
13
14
|
export * from './components/RPGUIRoot';
|
|
15
|
+
export * from './components/SkillProgressBar';
|
|
14
16
|
export * from './components/TextArea';
|
|
15
17
|
export * from './components/Truncate';
|
|
16
18
|
export * from './components/typography/DynamicText';
|