@rpg-engine/long-bow 0.1.21 → 0.1.24
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/NPCDialog/NPCDialog.d.ts +5 -1
- package/dist/NPCDialog/QuestionDialog/QuestionDialog.d.ts +17 -0
- package/dist/RPGUI/RPGUIContainer.d.ts +1 -0
- package/dist/RPGUI/RPGUIRoot.d.ts +9 -0
- package/dist/RPGUI/RPGUISlider.d.ts +13 -0
- package/dist/components/ListMenu.d.ts +10 -0
- package/dist/index.d.ts +5 -1
- package/dist/long-bow.cjs.development.js +334 -32
- 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 +331 -32
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +5 -2
- package/src/NPCDialog/NPCDialog.tsx +72 -36
- package/src/NPCDialog/NPCDialogText.tsx +0 -5
- package/src/NPCDialog/QuestionDialog/QuestionDialog.tsx +240 -0
- package/src/RPGUI/RPGUIContainer.tsx +12 -2
- package/src/RPGUI/RPGUIRoot.tsx +14 -0
- package/src/RPGUI/RPGUISlider.tsx +71 -0
- package/src/components/ListMenu.tsx +48 -0
- package/src/index.tsx +5 -1
- package/src/typography/DynamicText.tsx +1 -0
- package/dist/RPGUI/RPGUI.d.ts +0 -8
- package/src/RPGUI/RPGUI.tsx +0 -11
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { RPGUIRoot } from '../RPGUI/RPGUIRoot';
|
|
4
|
+
|
|
5
|
+
export interface IListMenuProps {
|
|
6
|
+
title: string;
|
|
7
|
+
options: [
|
|
8
|
+
{
|
|
9
|
+
id: string;
|
|
10
|
+
text: string;
|
|
11
|
+
}
|
|
12
|
+
];
|
|
13
|
+
onSelected: (selectedOptionId: string) => void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const ListMenu: React.FC<IListMenuProps> = ({
|
|
17
|
+
title,
|
|
18
|
+
options,
|
|
19
|
+
onSelected,
|
|
20
|
+
}) => {
|
|
21
|
+
return (
|
|
22
|
+
<RPGUIRoot>
|
|
23
|
+
<Container>
|
|
24
|
+
<p>{title}: </p>
|
|
25
|
+
<ul className="rpgui-list-imp" style={{ overflow: 'hidden' }}>
|
|
26
|
+
{options.map((params) => (
|
|
27
|
+
<li
|
|
28
|
+
key={params.text}
|
|
29
|
+
onClick={() => {
|
|
30
|
+
onSelected(params.id);
|
|
31
|
+
}}
|
|
32
|
+
>
|
|
33
|
+
{params.text}
|
|
34
|
+
</li>
|
|
35
|
+
))}
|
|
36
|
+
</ul>
|
|
37
|
+
</Container>
|
|
38
|
+
</RPGUIRoot>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const Container = styled.div`
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
width: 100%;
|
|
46
|
+
justify-content: start;
|
|
47
|
+
align-items: flex-start;
|
|
48
|
+
`;
|
package/src/index.tsx
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
export * from './components/ListMenu';
|
|
2
|
+
export { useEventListener } from './hooks/useEventListener';
|
|
1
3
|
export * from './NPCDialog/NPCDialog';
|
|
2
|
-
export * from './
|
|
4
|
+
export * from './NPCDialog/QuestionDialog/QuestionDialog';
|
|
3
5
|
export * from './RPGUI/RPGUIContainer';
|
|
6
|
+
export * from './RPGUI/RPGUIRoot';
|
|
7
|
+
export * from './RPGUI/RPGUISlider';
|
|
4
8
|
export * from './typography/DynamicText';
|
package/dist/RPGUI/RPGUI.d.ts
DELETED
package/src/RPGUI/RPGUI.tsx
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import 'rpgui/rpgui.css';
|
|
3
|
-
import 'rpgui/rpgui.js';
|
|
4
|
-
|
|
5
|
-
interface IProps {
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const RPGUI: React.FC<IProps> = ({ children }) => {
|
|
10
|
-
return <div className="rpgui-content">{children}</div>;
|
|
11
|
-
};
|