@rpg-engine/long-bow 0.8.217 → 0.8.219

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.8.217",
3
+ "version": "0.8.219",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -12,6 +12,12 @@ export interface IDraggableContainerProps {
12
12
  height?: string;
13
13
  minWidth?: string;
14
14
  minHeight?: string;
15
+ /** CSS override for width applied below `mobileBreakpoint`. Useful for responsive sizing without JS detection. */
16
+ mobileWidth?: string;
17
+ /** CSS override for height applied below `mobileBreakpoint`. Useful for responsive sizing without JS detection. */
18
+ mobileHeight?: string;
19
+ /** Viewport width in px under which mobile overrides apply. Defaults to 768. */
20
+ mobileBreakpoint?: number;
15
21
  className?: string;
16
22
  type?: RPGUIContainerTypes;
17
23
  title?: string;
@@ -36,6 +42,9 @@ export const DraggableContainer: React.FC<IDraggableContainerProps> = ({
36
42
  height,
37
43
  minHeight,
38
44
  minWidth,
45
+ mobileWidth,
46
+ mobileHeight,
47
+ mobileBreakpoint = 768,
39
48
  className,
40
49
  type = RPGUIContainerTypes.FramedGold,
41
50
  onCloseButton,
@@ -117,6 +126,9 @@ export const DraggableContainer: React.FC<IDraggableContainerProps> = ({
117
126
  height={height || 'auto'}
118
127
  minWidth={minWidth}
119
128
  minHeight={minHeight}
129
+ mobileWidth={mobileWidth}
130
+ mobileHeight={mobileHeight}
131
+ mobileBreakpoint={mobileBreakpoint}
120
132
  className={`rpgui-container ${type} ${className}`}
121
133
  isFullScreen={isFullScreen}
122
134
  opacity={opacity}
@@ -149,6 +161,9 @@ interface IContainerProps {
149
161
  height: string;
150
162
  minWidth?: string;
151
163
  minHeight?: string;
164
+ mobileWidth?: string;
165
+ mobileHeight?: string;
166
+ mobileBreakpoint?: number;
152
167
  isFullScreen?: boolean;
153
168
  opacity?: number;
154
169
  }
@@ -178,6 +193,15 @@ const Container = styled.div<IContainerProps>`
178
193
  align-content: flex-start;
179
194
  `}
180
195
 
196
+ ${({ mobileWidth, mobileHeight, mobileBreakpoint }) =>
197
+ (mobileWidth || mobileHeight) &&
198
+ css`
199
+ @media (max-width: ${mobileBreakpoint ?? 768}px) {
200
+ ${mobileWidth && `width: ${mobileWidth}; min-width: unset;`}
201
+ ${mobileHeight && `height: ${mobileHeight}; min-height: unset;`}
202
+ }
203
+ `}
204
+
181
205
  &.rpgui-container {
182
206
  padding-top: 1.5rem;
183
207
  }
@@ -51,8 +51,14 @@ export interface IStoreProps {
51
51
  fullScreen?: boolean;
52
52
  /** Override the DraggableContainer width (e.g. "90vw"). Defaults to "1000px". */
53
53
  containerWidth?: string;
54
- /** Override the DraggableContainer height (e.g. "80vh"). Defaults to "auto". */
54
+ /** Override the DraggableContainer height (e.g. "80vh"). Defaults to "min(85vh, 900px)" so the inner scroll area is bounded. */
55
55
  containerHeight?: string;
56
+ /** Width applied below `mobileBreakpoint` (e.g. "95vw"). Defaults to "95vw". */
57
+ mobileContainerWidth?: string;
58
+ /** Height applied below `mobileBreakpoint` (e.g. "95vh"). Defaults to "95vh" so mobile fills the viewport. */
59
+ mobileContainerHeight?: string;
60
+ /** Viewport px under which mobile overrides apply. Defaults to 768. */
61
+ mobileBreakpoint?: number;
56
62
  packsBadge?: string;
57
63
  featuredItems?: IFeaturedItem[];
58
64
  onQuickBuy?: (item: IProductBlueprint, quantity?: number) => void;
@@ -116,6 +122,9 @@ export const Store: React.FC<IStoreProps> = ({
116
122
  fullScreen = false,
117
123
  containerWidth,
118
124
  containerHeight,
125
+ mobileContainerWidth,
126
+ mobileContainerHeight,
127
+ mobileBreakpoint,
119
128
  packsTabLabel = 'Packs',
120
129
  packsBadge,
121
130
  featuredItems,
@@ -412,7 +421,10 @@ export const Store: React.FC<IStoreProps> = ({
412
421
  onCloseButton={onClose}
413
422
  width={containerWidth ?? "1000px"}
414
423
  minWidth="700px"
415
- height={containerHeight ?? "auto"}
424
+ height={containerHeight ?? "min(85vh, 900px)"}
425
+ mobileWidth={mobileContainerWidth ?? "95vw"}
426
+ mobileHeight={mobileContainerHeight ?? "95vh"}
427
+ mobileBreakpoint={mobileBreakpoint}
416
428
  type={RPGUIContainerTypes.Framed}
417
429
  cancelDrag="[class*='Store__Container'], [class*='CartView'], [class*='StoreItemDetails'], .close-button"
418
430
  isFullScreen={fullScreen}