@rpg-engine/long-bow 0.1.794 → 0.2.2

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.
Files changed (129) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +181 -181
  3. package/dist/components/Button.d.ts +1 -0
  4. package/dist/components/Equipment/EquipmentSet.d.ts +5 -3
  5. package/dist/components/Item/Cards/ItemTooltip.d.ts +6 -0
  6. package/dist/components/Item/Inventory/ItemContainer.d.ts +4 -6
  7. package/dist/components/Item/Inventory/ItemContainerTypes.d.ts +6 -0
  8. package/dist/components/Item/Inventory/ItemSlot.d.ts +5 -9
  9. package/dist/components/Item/Inventory/itemContainerHelper.d.ts +2 -7
  10. package/dist/components/PropertySelect/PropertySelect.d.ts +12 -0
  11. package/dist/components/QuestInfo/QuestInfo.d.ts +14 -0
  12. package/dist/components/RelativeListMenu.d.ts +13 -0
  13. package/dist/index.d.ts +1 -1
  14. package/dist/long-bow.cjs.development.js +748 -1194
  15. package/dist/long-bow.cjs.development.js.map +1 -1
  16. package/dist/long-bow.cjs.production.min.js +1 -1
  17. package/dist/long-bow.cjs.production.min.js.map +1 -1
  18. package/dist/long-bow.esm.js +748 -1196
  19. package/dist/long-bow.esm.js.map +1 -1
  20. package/dist/mocks/equipmentSet.mocks.d.ts +2 -2
  21. package/dist/stories/Button.stories.d.ts +5 -0
  22. package/dist/stories/Chat.stories.d.ts +5 -0
  23. package/dist/stories/CheckButton.stories.d.ts +5 -0
  24. package/dist/stories/DraggableContainer.stories.d.ts +5 -0
  25. package/dist/stories/Dropdown.stories.d.ts +5 -0
  26. package/dist/stories/EquipmentSet.stories.d.ts +5 -0
  27. package/dist/stories/ItemContainer.stories.d.ts +5 -0
  28. package/dist/stories/ListMenu.stories.d.ts +5 -0
  29. package/dist/stories/Multitab.stories.d.ts +6 -0
  30. package/dist/stories/NPCDialog.stories.d.ts +7 -0
  31. package/dist/stories/ProgressBar.stories.d.ts +8 -0
  32. package/dist/stories/PropertySelect.stories.d.ts +5 -0
  33. package/dist/stories/QuestInfo.stories.d.ts +5 -0
  34. package/dist/stories/RPGUIContainers.stories.d.ts +5 -0
  35. package/dist/stories/RadioButton.stories.d.ts +5 -0
  36. package/dist/stories/RangeSlider.stories.d.ts +5 -0
  37. package/dist/stories/ScrollList.stories.d.ts +5 -0
  38. package/dist/stories/SimpleProgressBar.stories.d.ts +5 -0
  39. package/dist/stories/SkillProgressBar.stories.d.ts +5 -0
  40. package/dist/stories/SkillsContainer.stories.d.ts +5 -0
  41. package/dist/stories/Text.stories.d.ts +7 -0
  42. package/package.json +98 -96
  43. package/src/components/Abstractions/SlotsContainer.tsx +42 -42
  44. package/src/components/Button.tsx +30 -29
  45. package/src/components/Chat/Chat.tsx +193 -193
  46. package/src/components/CheckButton.tsx +65 -65
  47. package/src/components/DraggableContainer.tsx +150 -150
  48. package/src/components/Dropdown.tsx +57 -57
  49. package/src/components/Equipment/EquipmentSet.tsx +138 -180
  50. package/src/components/Input.tsx +11 -11
  51. package/src/components/Item/Cards/ItemTooltip.tsx +32 -0
  52. package/src/components/Item/Inventory/ItemContainer.tsx +68 -113
  53. package/src/components/Item/Inventory/ItemContainerTypes.ts +6 -0
  54. package/src/components/Item/Inventory/ItemSlot.tsx +212 -158
  55. package/src/components/Item/Inventory/itemContainerHelper.ts +146 -81
  56. package/src/components/ListMenu.tsx +65 -65
  57. package/src/components/Multitab/Tab.tsx +57 -57
  58. package/src/components/Multitab/TabBody.tsx +13 -13
  59. package/src/components/Multitab/TabsContainer.tsx +97 -97
  60. package/src/components/NPCDialog/NPCDialog.tsx +145 -145
  61. package/src/components/NPCDialog/NPCDialogText.tsx +53 -53
  62. package/src/components/NPCDialog/QuestionDialog/QuestionDialog.tsx +237 -242
  63. package/src/components/ProgressBar.tsx +91 -91
  64. package/src/components/PropertySelect/PropertySelect.tsx +101 -0
  65. package/src/components/PropertySelect/img/ui-arrows/arrow01-left-clicked.png +0 -0
  66. package/src/components/PropertySelect/img/ui-arrows/arrow01-left.png +0 -0
  67. package/src/components/PropertySelect/img/ui-arrows/arrow01-right-clicked.png +0 -0
  68. package/src/components/PropertySelect/img/ui-arrows/arrow01-right.png +0 -0
  69. package/src/components/PropertySelect/img/ui-arrows/arrow02-left-clicked.png +0 -0
  70. package/src/components/PropertySelect/img/ui-arrows/arrow02-left.png +0 -0
  71. package/src/components/PropertySelect/img/ui-arrows/arrow02-right-clicked.png +0 -0
  72. package/src/components/PropertySelect/img/ui-arrows/arrow02-right.png +0 -0
  73. package/src/components/QuestInfo/QuestInfo.tsx +143 -0
  74. package/src/components/QuestInfo/img/default.png +0 -0
  75. package/src/components/RPGUIContainer.tsx +47 -47
  76. package/src/components/RPGUIRoot.tsx +14 -14
  77. package/src/components/RadioButton.tsx +53 -53
  78. package/src/components/RangeSlider.tsx +68 -68
  79. package/src/components/RelativeListMenu.tsx +83 -0
  80. package/src/components/ScrollList.tsx +77 -77
  81. package/src/components/SimpleProgressBar.tsx +62 -62
  82. package/src/components/SkillProgressBar.tsx +123 -124
  83. package/src/components/SkillsContainer.tsx +196 -235
  84. package/src/components/TextArea.tsx +11 -11
  85. package/src/components/Truncate.tsx +25 -25
  86. package/src/components/shared/Column.tsx +16 -16
  87. package/src/components/shared/SpriteFromAtlas.tsx +99 -99
  88. package/src/components/typography/DynamicText.tsx +49 -49
  89. package/src/constants/uiColors.ts +10 -10
  90. package/src/hooks/useEventListener.ts +21 -21
  91. package/src/hooks/useOutsideAlerter.ts +25 -25
  92. package/src/index.tsx +25 -25
  93. package/src/libs/StringHelpers.ts +3 -3
  94. package/src/mocks/atlas/icons/icons.json +735 -303
  95. package/src/mocks/atlas/icons/icons.png +0 -0
  96. package/src/mocks/atlas/items/items.json +5215 -5195
  97. package/src/mocks/atlas/items/items.png +0 -0
  98. package/src/mocks/equipmentSet.mocks.ts +347 -347
  99. package/src/mocks/itemContainer.mocks.ts +281 -249
  100. package/src/mocks/skills.mocks.ts +122 -122
  101. package/src/stories/Button.stories.tsx +36 -0
  102. package/src/stories/Chat.stories.tsx +170 -0
  103. package/src/stories/CheckButton.stories.tsx +48 -0
  104. package/src/stories/DraggableContainer.stories.tsx +28 -0
  105. package/src/stories/Dropdown.stories.tsx +46 -0
  106. package/src/stories/EquipmentSet.stories.tsx +51 -0
  107. package/src/stories/ItemContainer.stories.tsx +51 -0
  108. package/src/stories/ListMenu.stories.tsx +56 -0
  109. package/src/stories/Multitab.stories.tsx +51 -0
  110. package/src/stories/NPCDialog.stories.tsx +130 -0
  111. package/src/stories/ProgressBar.stories.tsx +23 -0
  112. package/src/stories/PropertySelect.stories.tsx +41 -0
  113. package/src/stories/QuestInfo.stories.tsx +76 -0
  114. package/src/stories/RPGUIContainers.stories.tsx +42 -0
  115. package/src/stories/RadioButton.stories.tsx +49 -0
  116. package/src/stories/RangeSlider.stories.tsx +60 -0
  117. package/src/stories/ScrollList.stories.tsx +85 -0
  118. package/src/stories/SimpleProgressBar.stories.tsx +22 -0
  119. package/src/stories/SkillProgressBar.stories.tsx +30 -0
  120. package/src/stories/SkillsContainer.stories.tsx +31 -0
  121. package/src/stories/Text.stories.tsx +42 -0
  122. package/src/types/eventTypes.ts +4 -4
  123. package/src/types/index.d.ts +2 -2
  124. package/dist/components/Item/Cards/ItemCard.d.ts +0 -9
  125. package/dist/components/shared/SpriteIcon.d.ts +0 -9
  126. package/dist/components/store/UI.store.d.ts +0 -38
  127. package/src/components/Item/Cards/ItemCard.tsx +0 -36
  128. package/src/components/shared/SpriteIcon.tsx +0 -67
  129. package/src/components/store/UI.store.ts +0 -232
@@ -1,122 +1,122 @@
1
- import { SkillType } from '@rpg-engine/shared';
2
-
3
- export const skillMock = {
4
- _id: '62aebda8785a9f0089a4f757',
5
- stamina: {
6
- type: SkillType.BasicAttributes,
7
- level: 1,
8
- skillPoints: 10,
9
- skillPointsToNextLevel: 80,
10
- },
11
- magic: {
12
- type: SkillType.BasicAttributes,
13
- level: 1,
14
- skillPoints: 22,
15
- skillPointsToNextLevel: 80,
16
- },
17
- magicResistance: {
18
- type: SkillType.BasicAttributes,
19
- level: 1,
20
- skillPoints: 13,
21
- skillPointsToNextLevel: 80,
22
- },
23
- strength: {
24
- type: SkillType.BasicAttributes,
25
- level: 1,
26
- skillPoints: 14,
27
- skillPointsToNextLevel: 80,
28
- },
29
- resistance: {
30
- type: SkillType.BasicAttributes,
31
- level: 1,
32
- skillPoints: 5,
33
- skillPointsToNextLevel: 80,
34
- },
35
- dexterity: {
36
- type: SkillType.BasicAttributes,
37
- level: 1,
38
- skillPoints: 52,
39
- skillPointsToNextLevel: 80,
40
- },
41
- first: {
42
- type: SkillType.Combat,
43
- level: 1,
44
- skillPoints: 22,
45
- skillPointsToNextLevel: 80,
46
- },
47
- club: {
48
- type: SkillType.Combat,
49
- level: 1,
50
- skillPoints: 12,
51
- skillPointsToNextLevel: 80,
52
- },
53
- sword: {
54
- type: SkillType.Combat,
55
- level: 1,
56
- skillPoints: 3,
57
- skillPointsToNextLevel: 80,
58
- },
59
- dagger: {
60
- type: SkillType.Combat,
61
- level: 1,
62
- skillPoints: 3,
63
- skillPointsToNextLevel: 80,
64
- },
65
- axe: {
66
- type: SkillType.Combat,
67
- level: 1,
68
- skillPoints: 45,
69
- skillPointsToNextLevel: 80,
70
- },
71
- distance: {
72
- type: SkillType.Combat,
73
- level: 1,
74
- skillPoints: 23,
75
- skillPointsToNextLevel: 80,
76
- },
77
- shielding: {
78
- type: SkillType.Combat,
79
- level: 1,
80
- skillPoints: 12,
81
- skillPointsToNextLevel: 80,
82
- },
83
- fishing: {
84
- type: SkillType.Gathering,
85
- level: 1,
86
- skillPoints: 5,
87
- skillPointsToNextLevel: 80,
88
- },
89
- mining: {
90
- type: SkillType.Crafting,
91
- level: 1,
92
- skillPoints: 3,
93
- skillPointsToNextLevel: 80,
94
- },
95
- lumberjacking: {
96
- type: SkillType.Crafting,
97
- level: 1,
98
- skillPoints: 2,
99
- skillPointsToNextLevel: 80,
100
- },
101
- cooking: {
102
- type: SkillType.Crafting,
103
- level: 1,
104
- skillPoints: 10,
105
- skillPointsToNextLevel: 80,
106
- },
107
- alchemy: {
108
- type: SkillType.Crafting,
109
- level: 1,
110
- skillPoints: 2,
111
- skillPointsToNextLevel: 80,
112
- },
113
- level: 1,
114
- xpGainRate: 100,
115
- experience: 0,
116
- xpToNextLevel: 40,
117
- ownerType: 'NPC',
118
- owner: '62aebda8785a9f0089a4f758',
119
- createdAt: '2022-06-19T06:09:44.661Z',
120
- updatedAt: '2022-06-19T06:09:44.661Z',
121
- __v: 0,
122
- };
1
+ import { SkillType } from '@rpg-engine/shared';
2
+
3
+ export const skillMock = {
4
+ _id: '62aebda8785a9f0089a4f757',
5
+ stamina: {
6
+ type: SkillType.BasicAttributes,
7
+ level: 1,
8
+ skillPoints: 10,
9
+ skillPointsToNextLevel: 80,
10
+ },
11
+ magic: {
12
+ type: SkillType.BasicAttributes,
13
+ level: 1,
14
+ skillPoints: 22,
15
+ skillPointsToNextLevel: 80,
16
+ },
17
+ magicResistance: {
18
+ type: SkillType.BasicAttributes,
19
+ level: 1,
20
+ skillPoints: 13,
21
+ skillPointsToNextLevel: 80,
22
+ },
23
+ strength: {
24
+ type: SkillType.BasicAttributes,
25
+ level: 1,
26
+ skillPoints: 14,
27
+ skillPointsToNextLevel: 80,
28
+ },
29
+ resistance: {
30
+ type: SkillType.BasicAttributes,
31
+ level: 1,
32
+ skillPoints: 5,
33
+ skillPointsToNextLevel: 80,
34
+ },
35
+ dexterity: {
36
+ type: SkillType.BasicAttributes,
37
+ level: 1,
38
+ skillPoints: 52,
39
+ skillPointsToNextLevel: 80,
40
+ },
41
+ first: {
42
+ type: SkillType.Combat,
43
+ level: 1,
44
+ skillPoints: 22,
45
+ skillPointsToNextLevel: 80,
46
+ },
47
+ club: {
48
+ type: SkillType.Combat,
49
+ level: 1,
50
+ skillPoints: 12,
51
+ skillPointsToNextLevel: 80,
52
+ },
53
+ sword: {
54
+ type: SkillType.Combat,
55
+ level: 1,
56
+ skillPoints: 3,
57
+ skillPointsToNextLevel: 80,
58
+ },
59
+ dagger: {
60
+ type: SkillType.Combat,
61
+ level: 1,
62
+ skillPoints: 3,
63
+ skillPointsToNextLevel: 80,
64
+ },
65
+ axe: {
66
+ type: SkillType.Combat,
67
+ level: 1,
68
+ skillPoints: 45,
69
+ skillPointsToNextLevel: 80,
70
+ },
71
+ distance: {
72
+ type: SkillType.Combat,
73
+ level: 1,
74
+ skillPoints: 23,
75
+ skillPointsToNextLevel: 80,
76
+ },
77
+ shielding: {
78
+ type: SkillType.Combat,
79
+ level: 1,
80
+ skillPoints: 12,
81
+ skillPointsToNextLevel: 80,
82
+ },
83
+ fishing: {
84
+ type: SkillType.Gathering,
85
+ level: 1,
86
+ skillPoints: 5,
87
+ skillPointsToNextLevel: 80,
88
+ },
89
+ mining: {
90
+ type: SkillType.Crafting,
91
+ level: 1,
92
+ skillPoints: 3,
93
+ skillPointsToNextLevel: 80,
94
+ },
95
+ lumberjacking: {
96
+ type: SkillType.Crafting,
97
+ level: 1,
98
+ skillPoints: 2,
99
+ skillPointsToNextLevel: 80,
100
+ },
101
+ cooking: {
102
+ type: SkillType.Crafting,
103
+ level: 1,
104
+ skillPoints: 10,
105
+ skillPointsToNextLevel: 80,
106
+ },
107
+ alchemy: {
108
+ type: SkillType.Crafting,
109
+ level: 1,
110
+ skillPoints: 2,
111
+ skillPointsToNextLevel: 80,
112
+ },
113
+ level: 1,
114
+ xpGainRate: 100,
115
+ experience: 0,
116
+ xpToNextLevel: 40,
117
+ ownerType: 'NPC',
118
+ owner: '62aebda8785a9f0089a4f758',
119
+ createdAt: '2022-06-19T06:09:44.661Z',
120
+ updatedAt: '2022-06-19T06:09:44.661Z',
121
+ __v: 0,
122
+ };
@@ -0,0 +1,36 @@
1
+ import { Meta, Story } from '@storybook/react';
2
+ import React from 'react';
3
+ import { Button, ButtonTypes, IButtonProps } from '../../src/components/Button';
4
+ import { RPGUIRoot } from '../../src/components/RPGUIRoot';
5
+
6
+ const meta: Meta = {
7
+ title: 'Button',
8
+ component: Button,
9
+ argTypes: {
10
+ children: {},
11
+ buttonType: {
12
+ control: {
13
+ type: 'select',
14
+ labels: {
15
+ [ButtonTypes.RPGUIButton]: 'rpgui-button',
16
+ [ButtonTypes.RPGUIGoldButton]: 'rpgui-button gold',
17
+ },
18
+ },
19
+ },
20
+ },
21
+ };
22
+
23
+ export default meta;
24
+
25
+ const Template: Story<IButtonProps> = args => (
26
+ <RPGUIRoot>
27
+ <Button {...args} />
28
+ </RPGUIRoot>
29
+ );
30
+
31
+ export const Default = Template.bind({});
32
+
33
+ Default.args = {
34
+ children: 'Teste',
35
+ buttonType: ButtonTypes.RPGUIButton,
36
+ };
@@ -0,0 +1,170 @@
1
+ import { ChatMessageType, IChatMessage } from '@rpg-engine/shared';
2
+ import { Meta, Story } from '@storybook/react';
3
+ import React from 'react';
4
+ import { Chat } from '../../src/components/Chat/Chat';
5
+ import { RPGUIRoot } from '../../src/components/RPGUIRoot';
6
+
7
+ const meta: Meta = {
8
+ title: 'Chat',
9
+ component: Chat,
10
+ };
11
+
12
+ export default meta;
13
+
14
+ const chatMessagesMock = [
15
+ {
16
+ _id: 'test-id-1',
17
+ message: 'test message',
18
+ emitter: {
19
+ _id: 'someid',
20
+ name: 'Guilherme',
21
+ },
22
+ type: ChatMessageType.Global,
23
+ x: 128,
24
+ y: 128,
25
+ scene: 'MainScene',
26
+ createdAt: '2020-08-20T16:00:00.000Z',
27
+ updatedAt: '2020-08-20T16:00:00.000Z',
28
+ },
29
+ {
30
+ _id: 'test-id-1',
31
+ message: 'test message',
32
+ emitter: {
33
+ _id: 'someid',
34
+ name: 'Guilherme',
35
+ },
36
+ type: ChatMessageType.Global,
37
+ x: 128,
38
+ y: 128,
39
+ scene: 'MainScene',
40
+ createdAt: '2020-08-20T16:00:00.000Z',
41
+ updatedAt: '2020-08-20T16:00:00.000Z',
42
+ },
43
+ {
44
+ _id: 'test-id-2',
45
+ message: 'Good morning!',
46
+ emitter: {
47
+ _id: 'someid',
48
+ name: 'Guilherme',
49
+ },
50
+ type: ChatMessageType.Global,
51
+ x: 128,
52
+ y: 128,
53
+ scene: 'MainScene',
54
+ createdAt: '2020-08-20T16:00:00.000Z',
55
+ updatedAt: '2020-08-20T16:00:00.000Z',
56
+ },
57
+ {
58
+ _id: 'test-id-3',
59
+ message: 'How are you doing?',
60
+ emitter: {
61
+ _id: 'someid',
62
+ name: 'Guilherme',
63
+ },
64
+ type: ChatMessageType.Global,
65
+ x: 128,
66
+ y: 128,
67
+ scene: 'MainScene',
68
+ createdAt: '2020-08-20T16:00:00.000Z',
69
+ updatedAt: '2020-08-20T16:00:00.000Z',
70
+ },
71
+ {
72
+ _id: 'test-id-4',
73
+ message: 'Hey hey hey!!!',
74
+ emitter: {
75
+ _id: 'someid',
76
+ name: 'Guilherme',
77
+ },
78
+ type: ChatMessageType.Global,
79
+ x: 128,
80
+ y: 128,
81
+ scene: 'MainScene',
82
+ createdAt: '2020-08-20T16:00:00.000Z',
83
+ updatedAt: '2020-08-20T16:00:00.000Z',
84
+ },
85
+ {
86
+ _id: 'test-id-5',
87
+ message: 'BITCONNEEEEEEEEECT!',
88
+ emitter: {
89
+ _id: 'someid',
90
+ name: 'Guilherme',
91
+ },
92
+ type: ChatMessageType.Global,
93
+ x: 128,
94
+ y: 128,
95
+ scene: 'MainScene',
96
+ createdAt: '2020-08-20T16:00:00.000Z',
97
+ updatedAt: '2020-08-20T16:00:00.000Z',
98
+ },
99
+ {
100
+ _id: 'test-id-6',
101
+ message: 'BITCONNEEEEEEEEECT!',
102
+ emitter: {
103
+ _id: 'someid',
104
+ name: 'Guilherme',
105
+ },
106
+ type: ChatMessageType.Global,
107
+ x: 128,
108
+ y: 128,
109
+ scene: 'MainScene',
110
+ createdAt: '2020-08-20T16:00:00.000Z',
111
+ updatedAt: '2020-08-20T16:00:00.000Z',
112
+ },
113
+ {
114
+ _id: 'test-id-7',
115
+ message: 'BITCONNEEEEEEEEECT!',
116
+ emitter: {
117
+ _id: 'someid',
118
+ name: 'Guilherme',
119
+ },
120
+ type: ChatMessageType.Global,
121
+ x: 128,
122
+ y: 128,
123
+ scene: 'MainScene',
124
+ createdAt: '2020-08-20T16:00:00.000Z',
125
+ updatedAt: '2020-08-20T16:00:00.000Z',
126
+ },
127
+ {
128
+ _id: 'test-id-8',
129
+ message: 'BITCONNEEEEEEEEECT!',
130
+ emitter: {
131
+ _id: 'someid',
132
+ name: 'Guilherme',
133
+ },
134
+ type: ChatMessageType.Global,
135
+ x: 128,
136
+ y: 128,
137
+ scene: 'MainScene',
138
+ createdAt: '2020-08-20T16:00:00.000Z',
139
+ updatedAt: '2020-08-20T16:00:00.000Z',
140
+ },
141
+ {
142
+ _id: 'test-id-9',
143
+ message: 'BITCONNEEEEEEEEECT!',
144
+ emitter: {
145
+ _id: 'someid',
146
+ name: 'Guilherme',
147
+ },
148
+ type: ChatMessageType.Global,
149
+ x: 128,
150
+ y: 128,
151
+ scene: 'MainScene',
152
+ createdAt: '2020-08-20T16:00:00.000Z',
153
+ updatedAt: '2020-08-20T16:00:00.000Z',
154
+ },
155
+ ];
156
+
157
+ const Template: Story<IChatMessage> = args => (
158
+ <RPGUIRoot>
159
+ <Chat
160
+ onSendChatMessage={msg => console.log(msg)}
161
+ chatMessages={chatMessagesMock}
162
+ opacity={0.5}
163
+ height={'200px'}
164
+ onCloseButton={() => console.log('closing chat...')}
165
+ {...args}
166
+ />
167
+ </RPGUIRoot>
168
+ );
169
+
170
+ export const Default = Template.bind({});
@@ -0,0 +1,48 @@
1
+ import { Meta, Story } from '@storybook/react';
2
+ import React from 'react';
3
+ import {
4
+ CheckButton,
5
+ ICheckItems,
6
+ ICheckProps,
7
+ } from '../../src/components/CheckButton';
8
+ import {
9
+ RPGUIContainer,
10
+ RPGUIContainerTypes,
11
+ } from '../../src/components/RPGUIContainer';
12
+ import { RPGUIRoot } from '../../src/components/RPGUIRoot';
13
+
14
+ const meta: Meta = {
15
+ title: 'Check Input',
16
+ component: CheckButton,
17
+ };
18
+
19
+ export default meta;
20
+
21
+ const Template: Story<ICheckProps> = args => (
22
+ <RPGUIRoot>
23
+ <RPGUIContainer type={RPGUIContainerTypes.Framed}>
24
+ <CheckButton {...args} />
25
+ </RPGUIContainer>
26
+ </RPGUIRoot>
27
+ );
28
+
29
+ export const Default = Template.bind({});
30
+
31
+ const items: ICheckItems[] = [
32
+ {
33
+ label: 'label1',
34
+ value: 'value1',
35
+ },
36
+ {
37
+ label: 'label2',
38
+ value: 'value2',
39
+ },
40
+ {
41
+ label: 'label3',
42
+ value: 'value3',
43
+ },
44
+ ];
45
+
46
+ Default.args = {
47
+ items,
48
+ };
@@ -0,0 +1,28 @@
1
+ import { Meta, Story } from '@storybook/react';
2
+ import React from 'react';
3
+ import {
4
+ DraggableContainer,
5
+ IDraggableContainerProps,
6
+ } from '../../src/components/DraggableContainer';
7
+ import { RPGUIRoot } from '../../src/components/RPGUIRoot';
8
+
9
+ const meta: Meta = {
10
+ title: 'Draggable Container',
11
+ component: DraggableContainer,
12
+ };
13
+
14
+ export default meta;
15
+
16
+ const Template: Story<IDraggableContainerProps> = args => (
17
+ <RPGUIRoot>
18
+ <DraggableContainer {...args} />
19
+ </RPGUIRoot>
20
+ );
21
+
22
+ export const Default = Template.bind({});
23
+
24
+ Default.args = {
25
+ title: 'Example',
26
+ onCloseButton: () => console.log('closing'),
27
+ children: <p>This is a draggable container!</p>,
28
+ };
@@ -0,0 +1,46 @@
1
+ import { Meta, Story } from '@storybook/react';
2
+ import React from 'react';
3
+ import { RPGUIRoot } from '../../src';
4
+ import {
5
+ Dropdown,
6
+ IDropdownProps,
7
+ IOptionsProps,
8
+ } from '../../src/components/Dropdown';
9
+
10
+ const meta: Meta = {
11
+ title: 'Dropdown',
12
+ component: Dropdown,
13
+ };
14
+
15
+ export default meta;
16
+
17
+ const Template: Story<IDropdownProps> = args => (
18
+ <RPGUIRoot>
19
+ <Dropdown {...args} />
20
+ </RPGUIRoot>
21
+ );
22
+
23
+ export const Default = Template.bind({});
24
+
25
+ const options: IOptionsProps[] = [
26
+ {
27
+ id: 1,
28
+ value: 'Human',
29
+ option: 'Human',
30
+ },
31
+ {
32
+ id: 2,
33
+ value: 'Elfo',
34
+ option: 'Elfo',
35
+ },
36
+ {
37
+ id: 3,
38
+ value: 'Dragão',
39
+ option: 'Dragão',
40
+ },
41
+ ];
42
+
43
+ Default.args = {
44
+ options,
45
+ width: '100%',
46
+ };
@@ -0,0 +1,51 @@
1
+ import { IItem, ItemContainerType, ItemType } from '@rpg-engine/shared';
2
+ import { Meta, Story } from '@storybook/react';
3
+ import React from 'react';
4
+ import {
5
+ EquipmentSet,
6
+ IEquipmentSetProps,
7
+ } from '../../src/components/Equipment/EquipmentSet';
8
+ import { RPGUIRoot } from '../../src/components/RPGUIRoot';
9
+ import { equipmentSetMock } from '../../src/mocks/equipmentSet.mocks';
10
+
11
+ const meta: Meta = {
12
+ title: 'Equipment Set',
13
+ component: EquipmentSet,
14
+ };
15
+
16
+ export default meta;
17
+
18
+ const onMouseOver = (event: any, slotIndex: number, item: IItem | null) => {
19
+ if (!item) {
20
+ console.log(`Free at ${slotIndex},${event}`);
21
+ return;
22
+ }
23
+ };
24
+
25
+ const onItemClick = (
26
+ ItemType: ItemType,
27
+ item: IItem,
28
+ itemContainerType: ItemContainerType | null
29
+ ) => {
30
+ console.log(item, ItemType, itemContainerType, 'was clicked!');
31
+ };
32
+
33
+ const onSelected = (payload: string) => {
34
+ console.log('dispatch', payload);
35
+ };
36
+
37
+ const Template: Story<IEquipmentSetProps> = args => (
38
+ <RPGUIRoot>
39
+ <EquipmentSet
40
+ {...args}
41
+ equipmentSet={equipmentSetMock}
42
+ onClose={() => console.log('closing Equipment Set Container')}
43
+ onMouseOver={onMouseOver}
44
+ onSelected={onSelected}
45
+ onItemClick={onItemClick}
46
+ type={ItemContainerType.Equipment}
47
+ />
48
+ </RPGUIRoot>
49
+ );
50
+
51
+ export const Default = Template.bind({});
@@ -0,0 +1,51 @@
1
+ import { IItem, ItemContainerType, ItemType } from '@rpg-engine/shared';
2
+ import { Meta, Story } from '@storybook/react';
3
+ import React from 'react';
4
+ import {
5
+ IItemContainerProps,
6
+ ItemContainer,
7
+ } from '../../src/components/Item/Inventory/ItemContainer';
8
+ import { RPGUIRoot } from '../../src/components/RPGUIRoot';
9
+ import { itemContainerMock } from '../../src/mocks/itemContainer.mocks';
10
+
11
+ const meta: Meta = {
12
+ title: 'Item Container',
13
+ component: ItemContainer,
14
+ };
15
+
16
+ export default meta;
17
+
18
+ const onMouseOver = (_event: any, slotIndex: number, item: IItem | null) => {
19
+ if (!item) {
20
+ // console.log(`Free at ${slotIndex}` )
21
+ return;
22
+ }
23
+ console.log(`${item.name} at ${slotIndex}`);
24
+ };
25
+
26
+ const onSelected = (payload: string, item: IItem) => {
27
+ console.log('onSelected', payload, item);
28
+ };
29
+
30
+ const onItemClick = (
31
+ item: IItem,
32
+ ItemType: ItemType,
33
+ itemContainerType: ItemContainerType | null
34
+ ) => {
35
+ console.log(item, ItemType, itemContainerType, 'was clicked!');
36
+ };
37
+
38
+ const Template: Story<IItemContainerProps> = () => (
39
+ <RPGUIRoot>
40
+ <ItemContainer
41
+ itemContainer={itemContainerMock}
42
+ onClose={() => console.log('closing item container')}
43
+ onMouseOver={onMouseOver}
44
+ onSelected={onSelected}
45
+ onItemClick={onItemClick}
46
+ type={ItemContainerType.Inventory}
47
+ />
48
+ </RPGUIRoot>
49
+ );
50
+
51
+ export const Default = Template.bind({});