@rpg-engine/long-bow 0.6.63 → 0.6.65

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpg-engine/long-bow",
3
- "version": "0.6.63",
3
+ "version": "0.6.65",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -19,6 +19,14 @@ export interface ITabsContainer {
19
19
  onCloseButton?: () => void;
20
20
  tabs: ITab[];
21
21
  type: MultitabType;
22
+ styles?: {
23
+ width?: string;
24
+ height?: string;
25
+ className?: string;
26
+ title?: string;
27
+ imgSrc?: string;
28
+ imgWidth?: string;
29
+ };
22
30
  }
23
31
 
24
32
  export const TabsContainer: React.FC<ITabsContainer> = ({
@@ -26,8 +34,9 @@ export const TabsContainer: React.FC<ITabsContainer> = ({
26
34
  onCloseButton,
27
35
  tabs,
28
36
  type = MultitabType.Brown,
37
+ styles = {}, // default to an empty object to avoid undefined errors
29
38
  }) => {
30
- const [selectedTab, setSelectedTab] = useState(tabs[0].id); //by default the first one
39
+ const [selectedTab, setSelectedTab] = useState(tabs[0].id); // by default the first one
31
40
 
32
41
  const onRenderTabs = () =>
33
42
  tabs.map((tab, index) => (
@@ -55,9 +64,19 @@ export const TabsContainer: React.FC<ITabsContainer> = ({
55
64
  <DraggableContainer
56
65
  onCloseButton={onCloseButton}
57
66
  type={onGetContainerType()}
67
+ cancelDrag=".tabs-container *" // Disable drag on all elements inside .tabs-container
68
+ width={styles?.width} // use optional chaining
69
+ height={styles?.height}
70
+ className={styles?.className}
71
+ title={styles?.title}
72
+ imgSrc={styles?.imgSrc}
73
+ imgWidth={styles?.imgWidth}
58
74
  >
59
75
  {onRenderTabs()}
60
- <BodyContainer selectedTab={selectedTab} className={type}>
76
+ <BodyContainer
77
+ selectedTab={selectedTab}
78
+ className={`${type} tabs-container`}
79
+ >
61
80
  {children}
62
81
  </BodyContainer>
63
82
  </DraggableContainer>
@@ -80,18 +99,15 @@ const BodyContainer = styled.div<IBodyContainer>`
80
99
  }
81
100
 
82
101
  &.brown {
83
- border: 0.25rem solid #996D55;
84
- background-color: #BF886A;
102
+ border: 0.25rem solid #996D55;
103
+ background-color: #BF886A;
85
104
  }
86
105
 
87
-
88
106
  &.gray {
89
107
  border: 0.25rem solid rgba(0, 0, 0, 0.25);
90
108
  background-color: #4E4A4E;
91
109
  }
92
110
 
93
-
94
111
  border-radius: 5px;
95
112
  padding: 0.5rem;
96
-
97
113
  `;