@rpg-engine/long-bow 0.1.76 → 0.1.77
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/ScrollList.d.ts +15 -0
- package/dist/index.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +145 -0
- 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 +145 -1
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +3 -3
- package/src/components/Multitab/TabsContainer.tsx +1 -3
- package/src/components/ScrollList.tsx +77 -0
- package/src/index.tsx +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rpg-engine/long-bow",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.77",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"@storybook/addon-links": "^6.5.9",
|
|
62
62
|
"@storybook/addons": "^6.5.9",
|
|
63
63
|
"@storybook/react": "^6.5.9",
|
|
64
|
-
"@types/react": "^
|
|
65
|
-
"@types/react-dom": "^
|
|
64
|
+
"@types/react": "^18.0.14",
|
|
65
|
+
"@types/react-dom": "^18.0.5",
|
|
66
66
|
"@types/styled-components": "^5.1.24",
|
|
67
67
|
"@types/uuid": "^8.3.4",
|
|
68
68
|
"babel-loader": "^8.2.3",
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { DraggableContainer } from './DraggableContainer';
|
|
4
|
+
|
|
5
|
+
interface IListMenuOption {
|
|
6
|
+
id: string;
|
|
7
|
+
text: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface IListMenuProps {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
options: IListMenuOption[];
|
|
14
|
+
onSelected: (selectedOptionId: string) => void;
|
|
15
|
+
fontSize?: number;
|
|
16
|
+
title: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const ListMenu: React.FC<IListMenuProps> = ({
|
|
20
|
+
options,
|
|
21
|
+
onSelected,
|
|
22
|
+
title,
|
|
23
|
+
}) => {
|
|
24
|
+
return (
|
|
25
|
+
<ScrollListContainer title={title}>
|
|
26
|
+
<SkillSplitDiv>
|
|
27
|
+
<hr className="golden" />
|
|
28
|
+
</SkillSplitDiv>
|
|
29
|
+
|
|
30
|
+
<ListContainer className="rpgui-list-imp">
|
|
31
|
+
{options.map(params => (
|
|
32
|
+
<ListElement
|
|
33
|
+
key={params?.id}
|
|
34
|
+
onClick={() => {
|
|
35
|
+
onSelected(params?.id);
|
|
36
|
+
}}
|
|
37
|
+
>
|
|
38
|
+
{params?.text || 'No text'}
|
|
39
|
+
</ListElement>
|
|
40
|
+
))}
|
|
41
|
+
</ListContainer>
|
|
42
|
+
</ScrollListContainer>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const ScrollListContainer = styled(DraggableContainer)`
|
|
47
|
+
border: 1px solid black;
|
|
48
|
+
width: 400px;
|
|
49
|
+
height: 400px;
|
|
50
|
+
.DraggableContainer__TitleContainer-sc-184mpyl-2 {
|
|
51
|
+
width: auto;
|
|
52
|
+
height: auto;
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
|
|
56
|
+
const SkillSplitDiv = styled.div`
|
|
57
|
+
width: 100%;
|
|
58
|
+
font-size: 11px;
|
|
59
|
+
margin-bottom: 10px;
|
|
60
|
+
hr {
|
|
61
|
+
margin: 0px;
|
|
62
|
+
padding: 0px;
|
|
63
|
+
}
|
|
64
|
+
p {
|
|
65
|
+
margin-bottom: 0px;
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
68
|
+
|
|
69
|
+
const ListContainer = styled.ul`
|
|
70
|
+
border: none;
|
|
71
|
+
width: 400px;
|
|
72
|
+
height: 250px;
|
|
73
|
+
overflow-y: scroll;
|
|
74
|
+
`;
|
|
75
|
+
const ListElement = styled.li`
|
|
76
|
+
margin-right: 0.5rem;
|
|
77
|
+
`;
|
package/src/index.tsx
CHANGED
|
@@ -18,6 +18,7 @@ export * from './components/RPGUIRoot';
|
|
|
18
18
|
export * from './components/shared/SpriteFromAtlas';
|
|
19
19
|
export * from './components/shared/SpriteIcon';
|
|
20
20
|
export * from './components/SkillProgressBar';
|
|
21
|
+
export * from './components/SkillsContainer';
|
|
21
22
|
export * from './components/TextArea';
|
|
22
23
|
export * from './components/Truncate';
|
|
23
24
|
export * from './components/typography/DynamicText';
|