@rpg-engine/long-bow 0.3.43 → 0.3.44

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 (115) hide show
  1. package/dist/components/Abstractions/SlotsContainer.d.ts +0 -1
  2. package/dist/components/Button.d.ts +2 -3
  3. package/dist/components/Chat/Chat.d.ts +2 -12
  4. package/dist/components/CheckButton.d.ts +2 -1
  5. package/dist/components/DraggableContainer.d.ts +0 -1
  6. package/dist/components/Equipment/EquipmentSet.d.ts +0 -8
  7. package/dist/components/Input.d.ts +0 -1
  8. package/dist/components/Item/Inventory/ItemContainer.d.ts +0 -12
  9. package/dist/components/Item/Inventory/ItemSlot.d.ts +0 -9
  10. package/dist/components/NPCDialog/NPCDialogText.d.ts +2 -4
  11. package/dist/components/RangeSlider.d.ts +0 -1
  12. package/dist/index.d.ts +0 -8
  13. package/dist/long-bow.cjs.development.js +515 -7465
  14. package/dist/long-bow.cjs.development.js.map +1 -1
  15. package/dist/long-bow.cjs.production.min.js +1 -1
  16. package/dist/long-bow.cjs.production.min.js.map +1 -1
  17. package/dist/long-bow.esm.js +520 -7461
  18. package/dist/long-bow.esm.js.map +1 -1
  19. package/dist/mocks/equipmentSet.mocks.d.ts +2 -15
  20. package/dist/mocks/skills.mocks.d.ts +121 -2
  21. package/package.json +2 -5
  22. package/src/components/Abstractions/SlotsContainer.tsx +0 -3
  23. package/src/components/Button.tsx +8 -18
  24. package/src/components/Chat/Chat.tsx +105 -106
  25. package/src/components/CheckButton.tsx +1 -1
  26. package/src/components/DraggableContainer.tsx +1 -4
  27. package/src/components/Dropdown.tsx +1 -7
  28. package/src/components/Equipment/EquipmentSet.tsx +0 -46
  29. package/src/components/Input.tsx +2 -6
  30. package/src/components/Item/Inventory/ItemContainer.tsx +6 -104
  31. package/src/components/Item/Inventory/ItemSlot.tsx +34 -234
  32. package/src/components/NPCDialog/NPCDialog.tsx +28 -4
  33. package/src/components/NPCDialog/NPCDialogText.tsx +15 -75
  34. package/src/components/RangeSlider.tsx +14 -37
  35. package/src/components/SkillsContainer.tsx +1 -1
  36. package/src/components/TimeWidget/TimeWidget.tsx +0 -1
  37. package/src/components/TradingMenu/TradingItemRow.tsx +6 -43
  38. package/src/components/TradingMenu/TradingMenu.tsx +1 -1
  39. package/src/components/TradingMenu/items.mock.ts +0 -1
  40. package/src/components/shared/SpriteFromAtlas.tsx +1 -4
  41. package/src/hooks/useOutsideAlerter.ts +2 -2
  42. package/src/index.tsx +0 -8
  43. package/src/mocks/atlas/items/items.json +314 -6086
  44. package/src/mocks/atlas/items/items.png +0 -0
  45. package/src/mocks/equipmentSet.mocks.ts +4 -49
  46. package/src/mocks/itemContainer.mocks.ts +6 -54
  47. package/src/mocks/skills.mocks.ts +2 -8
  48. package/src/stories/Chat.stories.tsx +3 -20
  49. package/src/stories/EquipmentSet.stories.tsx +0 -10
  50. package/src/stories/ItemContainer.stories.tsx +15 -84
  51. package/src/stories/RangeSlider.stories.tsx +9 -10
  52. package/dist/components/CaracterStatus/CaracterStatus.d.ts +0 -9
  53. package/dist/components/Chatdeprecated/ChatDeprecated.d.ts +0 -13
  54. package/dist/components/CircularController/CircularController.d.ts +0 -10
  55. package/dist/components/CraftBook/CraftBook.d.ts +0 -15
  56. package/dist/components/CraftBook/MockItems.d.ts +0 -2
  57. package/dist/components/DropdownSelectorContainer.d.ts +0 -13
  58. package/dist/components/Item/Inventory/ItemQuantitySelector.d.ts +0 -7
  59. package/dist/components/RadioInput/RadioButton.d.ts +0 -8
  60. package/dist/components/RadioInput/RadioInput.d.ts +0 -13
  61. package/dist/components/RadioInput/instruments.d.ts +0 -4
  62. package/dist/components/Spellbook/QuickSpells.d.ts +0 -10
  63. package/dist/components/Spellbook/Spell.d.ts +0 -11
  64. package/dist/components/Spellbook/Spellbook.d.ts +0 -15
  65. package/dist/components/Spellbook/SpellbookShortcuts.d.ts +0 -10
  66. package/dist/components/Spellbook/constants.d.ts +0 -3
  67. package/dist/components/Spellbook/mockSpells.d.ts +0 -2
  68. package/dist/components/itemSelector/ItemSelector.d.ts +0 -14
  69. package/dist/constants/uiDevices.d.ts +0 -1
  70. package/dist/stories/CaracterStatus.stories.d.ts +0 -5
  71. package/dist/stories/ChatDeprecated.stories.d.ts +0 -5
  72. package/dist/stories/CircullarController.stories.d.ts +0 -5
  73. package/dist/stories/CraftBook.stories.d.ts +0 -4
  74. package/dist/stories/DropdownSelectorContainer.stories.d.ts +0 -5
  75. package/dist/stories/ItemQuantitySelector.stories.d.ts +0 -5
  76. package/dist/stories/ItemSelector.stories.d.ts +0 -4
  77. package/dist/stories/QuickSpells.stories.d.ts +0 -5
  78. package/dist/stories/RadioInput.stories.d.ts +0 -5
  79. package/dist/stories/Spellbook.stories.d.ts +0 -5
  80. package/src/.DS_Store +0 -0
  81. package/src/components/.DS_Store +0 -0
  82. package/src/components/CaracterStatus/CaracterStatus.tsx +0 -86
  83. package/src/components/CaracterStatus/Character.png +0 -0
  84. package/src/components/Chatdeprecated/ChatDeprecated.tsx +0 -200
  85. package/src/components/CircularController/CircularController.tsx +0 -162
  86. package/src/components/CraftBook/CraftBook.tsx +0 -230
  87. package/src/components/CraftBook/MockItems.ts +0 -46
  88. package/src/components/DropdownSelectorContainer.tsx +0 -42
  89. package/src/components/Item/Inventory/ItemQuantitySelector.tsx +0 -142
  90. package/src/components/NPCDialog/.DS_Store +0 -0
  91. package/src/components/NPCDialog/img/.DS_Store +0 -0
  92. package/src/components/NPCDialog/img/press-button.gif +0 -0
  93. package/src/components/RadioInput/RadioButton.tsx +0 -98
  94. package/src/components/RadioInput/RadioInput.tsx +0 -99
  95. package/src/components/RadioInput/instruments.ts +0 -16
  96. package/src/components/Spellbook/QuickSpells.tsx +0 -120
  97. package/src/components/Spellbook/Spell.tsx +0 -201
  98. package/src/components/Spellbook/Spellbook.tsx +0 -144
  99. package/src/components/Spellbook/SpellbookShortcuts.tsx +0 -77
  100. package/src/components/Spellbook/constants.ts +0 -12
  101. package/src/components/Spellbook/mockSpells.ts +0 -60
  102. package/src/components/itemSelector/ItemSelector.tsx +0 -136
  103. package/src/constants/uiDevices.ts +0 -5
  104. package/src/mocks/.DS_Store +0 -0
  105. package/src/mocks/atlas/.DS_Store +0 -0
  106. package/src/stories/CaracterStatus.stories.tsx +0 -29
  107. package/src/stories/ChatDeprecated.stories.tsx +0 -170
  108. package/src/stories/CircullarController.stories.tsx +0 -33
  109. package/src/stories/CraftBook.stories.tsx +0 -40
  110. package/src/stories/DropdownSelectorContainer.stories.tsx +0 -41
  111. package/src/stories/ItemQuantitySelector.stories.tsx +0 -26
  112. package/src/stories/ItemSelector.stories.tsx +0 -77
  113. package/src/stories/QuickSpells.stories.tsx +0 -38
  114. package/src/stories/RadioInput.stories.tsx +0 -35
  115. package/src/stories/Spellbook.stories.tsx +0 -107
@@ -1,136 +0,0 @@
1
- import React, { useEffect, useState } from 'react';
2
- import styled from 'styled-components';
3
- import { Button, ButtonTypes } from '../Button';
4
- import { DraggableContainer } from '../DraggableContainer';
5
- import { RPGUIContainerTypes } from '../RPGUIContainer';
6
- import { SpriteFromAtlas } from '../shared/SpriteFromAtlas';
7
-
8
- export interface IOptionsItemSelectorProps {
9
- name: string;
10
- description?: string;
11
- imageKey: string;
12
- }
13
-
14
- export interface IItemSelectorProps {
15
- atlasJSON: any;
16
- atlasIMG: any;
17
- options: IOptionsItemSelectorProps[];
18
- onClose: () => void;
19
- onSelect: (value: string) => void;
20
- }
21
-
22
- export const ItemSelector: React.FC<IItemSelectorProps> = ({
23
- atlasIMG,
24
- atlasJSON,
25
- options,
26
- onClose,
27
- onSelect,
28
- }) => {
29
- const [selectedValue, setSelectedValue] = useState<string>();
30
-
31
- const handleClick = () => {
32
- let element = document.querySelector(
33
- `input[name='test']:checked`
34
- ) as HTMLInputElement;
35
- const elementValue = element.value;
36
- setSelectedValue(elementValue);
37
- };
38
-
39
- useEffect(() => {
40
- if (selectedValue) {
41
- onSelect(selectedValue);
42
- }
43
- }, [selectedValue]);
44
- return (
45
- <DraggableContainer
46
- type={RPGUIContainerTypes.Framed}
47
- width="500px"
48
- cancelDrag=".equipment-container-body .arrow-selector"
49
- onCloseButton={() => {
50
- if (onClose) {
51
- onClose();
52
- }
53
- }}
54
- >
55
- <div style={{ width: '100%' }}>
56
- <Title>{'Harvesting instruments'}</Title>
57
- <Subtitle>{'Use the tool, you need it'}</Subtitle>
58
- <hr className="golden" />
59
- </div>
60
-
61
- <RadioInputScroller>
62
- {options?.map((option, index) => (
63
- <RadioOptionsWrapper key={index}>
64
- <SpriteAtlasWrapper>
65
- <SpriteFromAtlas
66
- atlasIMG={atlasIMG}
67
- atlasJSON={atlasJSON}
68
- spriteKey={option.imageKey}
69
- imgScale={3}
70
- />
71
- </SpriteAtlasWrapper>
72
- <div>
73
- <input
74
- className="rpgui-radio"
75
- type="radio"
76
- value={option.name}
77
- name="test"
78
- />
79
- <label
80
- onClick={handleClick}
81
- style={{ display: 'flex', alignItems: 'center' }}
82
- >
83
- {option.name} <br />
84
- {option.description}
85
- </label>
86
- </div>
87
- </RadioOptionsWrapper>
88
- ))}
89
- </RadioInputScroller>
90
- <ButtonWrapper>
91
- <Button buttonType={ButtonTypes.RPGUIButton} onClick={onClose}>
92
- Cancel
93
- </Button>
94
- <Button buttonType={ButtonTypes.RPGUIButton}>Select</Button>
95
- </ButtonWrapper>
96
- </DraggableContainer>
97
- );
98
- };
99
-
100
- const Title = styled.h1`
101
- font-size: 0.6rem;
102
- color: yellow !important;
103
- `;
104
- const Subtitle = styled.h1`
105
- font-size: 0.4rem;
106
- color: yellow !important;
107
- `;
108
-
109
- const RadioInputScroller = styled.div`
110
- padding-left: 15px;
111
- padding-top: 10px;
112
- width: 100%;
113
- margin-top: 1rem;
114
- align-items: center;
115
- margin-left: 20px;
116
- align-items: flex-start;
117
- overflow-y: scroll;
118
- height: 360px;
119
- `;
120
-
121
- const SpriteAtlasWrapper = styled.div`
122
- margin-right: 40px;
123
- `;
124
-
125
- const RadioOptionsWrapper = styled.div`
126
- display: flex;
127
- align-items: stretch;
128
- margin-bottom: 40px;
129
- `;
130
-
131
- const ButtonWrapper = styled.div`
132
- display: flex;
133
- justify-content: space-around;
134
- padding-top: 20px;
135
- width: 100%;
136
- `;
@@ -1,5 +0,0 @@
1
- import isMobile from 'is-mobile';
2
-
3
- export const IS_MOBILE_OR_TABLET = isMobile({
4
- tablet: true,
5
- });
Binary file
Binary file
@@ -1,29 +0,0 @@
1
- import { Meta, Story } from '@storybook/react';
2
- import React from 'react';
3
- import {
4
- CharacterStatus,
5
- ICharacterStatusProps,
6
- } from '../components/CaracterStatus/CaracterStatus';
7
- import { RPGUIRoot } from '../components/RPGUIRoot';
8
-
9
- const meta: Meta = {
10
- title: 'Caracter Status',
11
- component: CharacterStatus,
12
- };
13
-
14
- export default meta;
15
-
16
- const Template: Story<ICharacterStatusProps> = args => (
17
- <RPGUIRoot>
18
- <CharacterStatus {...args} />
19
- </RPGUIRoot>
20
- );
21
-
22
- export const Default = Template.bind({});
23
- Default.args = {
24
- healthValue: 30,
25
- healthMaxValue: 100,
26
- manaValue: 30,
27
- manaMaxValue: 100,
28
- charName: 'Char Name',
29
- };
@@ -1,170 +0,0 @@
1
- import { ChatMessageType, IChatMessage } from '@rpg-engine/shared';
2
- import { Meta, Story } from '@storybook/react';
3
- import React from 'react';
4
- import { ChatDeprecated } from '../components/Chatdeprecated/ChatDeprecated';
5
- import { RPGUIRoot } from '../components/RPGUIRoot';
6
-
7
- const meta: Meta = {
8
- title: 'ChatDeprecated',
9
- component: ChatDeprecated,
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
- <ChatDeprecated
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({});
@@ -1,33 +0,0 @@
1
- import { Meta, Story } from '@storybook/react';
2
- import React from 'react';
3
- import { RPGUIRoot } from '..';
4
- import {
5
- CircularController,
6
- CircularControllerProps,
7
- } from '../components/CircularController/CircularController';
8
- import { SPELL_SHORTCUTS_STORAGE_KEY } from '../components/Spellbook/constants';
9
-
10
- const meta: Meta = {
11
- title: 'Circular Controller',
12
- component: CircularController,
13
- };
14
-
15
- export default meta;
16
-
17
- const Template: Story<CircularControllerProps> = args => (
18
- <RPGUIRoot>
19
- <CircularController {...args} />
20
- </RPGUIRoot>
21
- );
22
-
23
- export const Default = Template.bind({});
24
-
25
- Default.args = {
26
- spells: JSON.parse(
27
- localStorage.getItem(SPELL_SHORTCUTS_STORAGE_KEY) as string
28
- ),
29
- onSpellClick: key => console.log(key),
30
- onActionClick: () => console.log('action'),
31
- onCancelClick: () => console.log('cancel attack'),
32
- mana: 100,
33
- };
@@ -1,40 +0,0 @@
1
- import { Meta, Story } from '@storybook/react';
2
- import React from 'react';
3
- import { RPGUIRoot } from '..';
4
- import { CraftBook } from '../components/CraftBook/CraftBook';
5
- import { craftableItems } from '../components/CraftBook/MockItems';
6
- import atlasJSON from '../mocks/atlas/items/items.json';
7
- import atlasIMG from '../mocks/atlas/items/items.png';
8
-
9
- const meta: Meta = {
10
- title: 'Craft Book',
11
- component: CraftBook,
12
- };
13
-
14
- export default meta;
15
-
16
- const Template: Story = args => (
17
- <RPGUIRoot>
18
- <CraftBook
19
- atlasIMG={atlasIMG}
20
- atlasJSON={atlasJSON}
21
- onSelect={onSelect}
22
- onClose={() => console.log('closing Equipment Set Container')}
23
- craftablesItems={craftableItems}
24
- onCraftItem={onCraftItem}
25
- {...args}
26
- />
27
- </RPGUIRoot>
28
- );
29
-
30
- export const Default = Template.bind({});
31
-
32
- const onCraftItem = (value: string | undefined) => {
33
- console.log('Craft', value);
34
- };
35
-
36
- const onSelect = (value: string) => {
37
- console.log('Story package', value);
38
- };
39
-
40
- Default.args = {};
@@ -1,41 +0,0 @@
1
- import { Meta, Story } from '@storybook/react';
2
- import React from 'react';
3
- import { RPGUIRoot } from '..';
4
- import {
5
- DropdownSelectorContainer,
6
- IDropdownSelectorContainer,
7
- } from '../components/DropdownSelectorContainer';
8
-
9
- const meta: Meta = {
10
- title: 'DropdownSelectorContainer',
11
- component: DropdownSelectorContainer,
12
- };
13
-
14
- export default meta;
15
-
16
- const Template: Story<IDropdownSelectorContainer> = args => (
17
- <RPGUIRoot>
18
- <DropdownSelectorContainer {...args} details="There are server details" />
19
- </RPGUIRoot>
20
- );
21
-
22
- export const Default = Template.bind({});
23
-
24
- Default.args = {
25
- title: 'Choose a server',
26
- onChange: () => {},
27
- options: [
28
- {
29
- id: 'europe-germany',
30
- name: 'Europe (Germany)',
31
- },
32
- {
33
- id: 'europe-uk',
34
- name: 'Europe (UK)',
35
- },
36
- {
37
- id: 'america-us',
38
- name: 'America',
39
- },
40
- ],
41
- };
@@ -1,26 +0,0 @@
1
- import { Meta, Story } from '@storybook/react';
2
- import React from 'react';
3
- import { RPGUIRoot } from '..';
4
- import {
5
- IItemQuantitySelectorProps,
6
- ItemQuantitySelector,
7
- } from '../components/Item/Inventory/ItemQuantitySelector';
8
-
9
- const meta: Meta = {
10
- title: 'Item Quantity Selector',
11
- component: ItemQuantitySelector,
12
- };
13
-
14
- export default meta;
15
-
16
- const Template: Story<IItemQuantitySelectorProps> = args => (
17
- <RPGUIRoot>
18
- <ItemQuantitySelector {...args} />
19
- </RPGUIRoot>
20
- );
21
-
22
- export const Default = Template.bind({});
23
-
24
- Default.args = {
25
- quantity: 10,
26
- };
@@ -1,77 +0,0 @@
1
- import { Meta, Story } from '@storybook/react';
2
- import React from 'react';
3
- import { RPGUIRoot } from '..';
4
- import {
5
- IOptionsItemSelectorProps,
6
- ItemSelector,
7
- } from '../components/itemSelector/ItemSelector';
8
- import atlasJSON from '../mocks/atlas/items/items.json';
9
- import atlasIMG from '../mocks/atlas/items/items.png';
10
-
11
- const meta: Meta = {
12
- title: 'Item Selector',
13
- component: ItemSelector,
14
- };
15
-
16
- export default meta;
17
-
18
- const Template: Story = args => (
19
- <RPGUIRoot>
20
- <ItemSelector
21
- atlasIMG={atlasIMG}
22
- atlasJSON={atlasJSON}
23
- options={options}
24
- onSelect={onSelect}
25
- onClose={() => console.log('closing Equipment Set Container')}
26
- {...args}
27
- />
28
- </RPGUIRoot>
29
- );
30
-
31
- export const Default = Template.bind({});
32
-
33
- const onSelect = (value: string): void => {
34
- console.log('Story package', value);
35
- };
36
-
37
- const options: IOptionsItemSelectorProps[] = [
38
- {
39
- name: 'Human',
40
- description: 'Human',
41
- imageKey: 'axes/frost-double-axe.png',
42
- },
43
- {
44
- name: 'Human',
45
- description: 'Human',
46
- imageKey: 'maces/spiked-club.png',
47
- },
48
- {
49
- name: 'Human2',
50
- description: 'Human2',
51
- imageKey: 'axes/frost-double-axe.png',
52
- },
53
- {
54
- name: 'Human3',
55
- description: 'Human3',
56
- imageKey: 'maces/spiked-club.png',
57
- },
58
- {
59
- name: 'Human4',
60
- description: 'Human4',
61
- imageKey: 'axes/frost-double-axe.png',
62
- },
63
- {
64
- name: 'Human5',
65
- description: 'Human5',
66
- imageKey: 'maces/spiked-club.png',
67
- },
68
- {
69
- name: 'Human6',
70
- description: 'Human6',
71
- imageKey: 'axes/frost-double-axe.png',
72
- },
73
- ];
74
-
75
- Default.args = {
76
- options,
77
- };
@@ -1,38 +0,0 @@
1
- import { Meta, Story } from '@storybook/react';
2
- import React from 'react';
3
- import { RPGUIRoot } from '../components/RPGUIRoot';
4
- import { SPELL_SHORTCUTS_STORAGE_KEY } from '../components/Spellbook/constants';
5
- import {
6
- QuickSpells,
7
- QuickSpellsProps,
8
- } from '../components/Spellbook/QuickSpells';
9
-
10
- const meta: Meta = {
11
- title: 'QuickSpells',
12
- component: QuickSpells,
13
- };
14
-
15
- export default meta;
16
-
17
- const Template: Story<QuickSpellsProps> = args => {
18
- return (
19
- <RPGUIRoot>
20
- <div
21
- style={{
22
- width: '100%',
23
- }}
24
- >
25
- <QuickSpells {...args} />
26
- </div>
27
- </RPGUIRoot>
28
- );
29
- };
30
-
31
- export const Default = Template.bind({});
32
- Default.args = {
33
- onSpellCast: spellKey => console.log(spellKey),
34
- quickSpells: JSON.parse(
35
- localStorage.getItem(SPELL_SHORTCUTS_STORAGE_KEY) as string
36
- ),
37
- mana: 100,
38
- };
@@ -1,35 +0,0 @@
1
- import React from 'react';
2
- import { Meta, Story } from '@storybook/react';
3
- import { RadioInput ,IRadioInput} from '../components/RadioInput/RadioInput';
4
- import { RPGUIRoot } from '../components/RPGUIRoot';
5
- import { Itools } from '../components/RadioInput/instruments';
6
-
7
- const meta: Meta = {
8
- component: RadioInput,
9
- };
10
-
11
- export default meta;
12
- const Template: Story<IRadioInput> = args => (
13
- <RPGUIRoot>
14
- <RadioInput {...args} />
15
- </RPGUIRoot>
16
- );
17
-
18
- export const RadioInputElement = Template.bind({});
19
-
20
- const onSelectIt = (value:string):void => {
21
- console.log('Story package', value);
22
- };
23
-
24
- const onClose = () => {
25
- console.log('close');
26
- };
27
-
28
- RadioInputElement.args={
29
- title:"Harvesting instruments",
30
- subtitle:'Use the tool, you need it',
31
- onSelect:onSelectIt,
32
- onCancel:onClose,
33
- items:Itools
34
-
35
- }