@terraware/web-components 3.5.5 → 3.5.6
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/components/Map/MapContainer.d.ts +10 -0
- package/components/Map/MapContainer.d.ts.map +1 -0
- package/components/Map/MapContainer.js +47 -0
- package/components/Map/MapDrawer.d.ts.map +1 -1
- package/components/Map/MapDrawer.js +2 -1
- package/components/Map/MapLegend.d.ts.map +1 -1
- package/components/Map/MapLegend.js +1 -11
- package/components/Map/styles.scss +4 -4
- package/package.json +1 -1
- package/stories/MapDrawer.stories.d.ts.map +1 -1
- package/stories/MapLegend.stories.d.ts.map +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type MapContainerProps = {
|
|
3
|
+
drawer?: ReactNode;
|
|
4
|
+
drawerOpen?: boolean;
|
|
5
|
+
legend?: ReactNode;
|
|
6
|
+
map: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
declare const MapContainer: (props: MapContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default MapContainer;
|
|
10
|
+
//# sourceMappingURL=MapContainer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapContainer.d.ts","sourceRoot":"","sources":["../../../src/components/Map/MapContainer.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAW,MAAM,OAAO,CAAC;AAIlD,KAAK,iBAAiB,GAAG;IACvB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,GAAG,EAAE,SAAS,CAAC;CAChB,CAAC;AAEF,QAAA,MAAM,YAAY,UAAW,iBAAiB,4CAqC7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _material = require("@mui/material");
|
|
10
|
+
var _utils = require("../../utils");
|
|
11
|
+
const MapContainer = props => {
|
|
12
|
+
const {
|
|
13
|
+
drawer,
|
|
14
|
+
drawerOpen,
|
|
15
|
+
legend,
|
|
16
|
+
map
|
|
17
|
+
} = props;
|
|
18
|
+
const {
|
|
19
|
+
isDesktop
|
|
20
|
+
} = (0, _utils.useDeviceInfo)();
|
|
21
|
+
const theme = (0, _material.useTheme)();
|
|
22
|
+
const border = (0, _react.useMemo)(() => {
|
|
23
|
+
if (!isDesktop && drawerOpen) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
return "1px solid ".concat(theme.palette.TwClrBrdrTertiary);
|
|
27
|
+
}, [drawerOpen, isDesktop, theme]);
|
|
28
|
+
const borderRadius = (0, _react.useMemo)(() => {
|
|
29
|
+
if (!isDesktop && drawerOpen) {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
return '8px';
|
|
33
|
+
}, [drawerOpen, isDesktop]);
|
|
34
|
+
return /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
35
|
+
sx: {
|
|
36
|
+
marginTop: '30px'
|
|
37
|
+
}
|
|
38
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
39
|
+
border: border,
|
|
40
|
+
borderRadius: borderRadius,
|
|
41
|
+
display: 'flex',
|
|
42
|
+
flexDirection: isDesktop ? 'row' : 'column',
|
|
43
|
+
maxHeight: isDesktop ? '700px' : undefined,
|
|
44
|
+
overflow: 'hidden'
|
|
45
|
+
}, (isDesktop || !drawerOpen) && map, drawerOpen && drawer, (isDesktop || !drawerOpen) && legend));
|
|
46
|
+
};
|
|
47
|
+
var _default = exports.default = MapContainer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapDrawer.d.ts","sourceRoot":"","sources":["../../../src/components/Map/MapDrawer.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGxD,OAAO,eAAe,CAAC;AAGvB,KAAK,aAAa,GAAG,OAAO,GAAG,QAAQ,CAAC;AAExC,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,QAAA,MAAM,SAAS,UAAW,aAAa,
|
|
1
|
+
{"version":3,"file":"MapDrawer.d.ts","sourceRoot":"","sources":["../../../src/components/Map/MapDrawer.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGxD,OAAO,eAAe,CAAC;AAGvB,KAAK,aAAa,GAAG,OAAO,GAAG,QAAQ,CAAC;AAExC,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,QAAA,MAAM,SAAS,UAAW,aAAa,mDAyBtC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -25,7 +25,8 @@ const MapDrawer = props => {
|
|
|
25
25
|
} = (0, _utils.useDeviceInfo)();
|
|
26
26
|
return open ? /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
27
27
|
className: "map-drawer map-drawer".concat(isDesktop ? "--".concat(size) : '--mobile'),
|
|
28
|
-
|
|
28
|
+
borderLeft: isDesktop ? "1px solid ".concat(theme.palette.TwClrBrdrTertiary) : undefined,
|
|
29
|
+
borderRight: isDesktop ? "1px solid ".concat(theme.palette.TwClrBrdrTertiary) : undefined,
|
|
29
30
|
style: style
|
|
30
31
|
}, /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
31
32
|
className: "map-drawer--header"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapLegend.d.ts","sourceRoot":"","sources":["../../../src/components/Map/MapLegend.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE;QACL,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,CAAC,OAAO,EA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EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,CAAC,eAAe,GAAG,aAAa,GAAG,iBAAiB,CAAC,CAAC;AAE1D,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,cAAc,EAAE,CAAC;CAC3B,CAAC;AAEF,QAAA,MAAM,SAAS,gBAAiB,cAAc,KAAG,WAsNhD,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
9
|
var _material = require("@mui/material");
|
|
11
10
|
var _utils = require("../../utils");
|
|
12
11
|
var _Icon = _interopRequireDefault(require("../Icon/Icon"));
|
|
@@ -20,13 +19,6 @@ const MapLegend = _ref => {
|
|
|
20
19
|
isMobile,
|
|
21
20
|
isDesktop
|
|
22
21
|
} = (0, _utils.useDeviceInfo)();
|
|
23
|
-
const borderRadius = (0, _react.useMemo)(() => {
|
|
24
|
-
if (isDesktop) {
|
|
25
|
-
return '0 8px 8px 0'; // right-side
|
|
26
|
-
} else {
|
|
27
|
-
return '0 0 8px 8px'; // bottom-side
|
|
28
|
-
}
|
|
29
|
-
}, [isDesktop]);
|
|
30
22
|
const legendComponents = legends.map((legend, index) => {
|
|
31
23
|
const isFirst = index === 0;
|
|
32
24
|
const isLast = index === legends.length - 1;
|
|
@@ -168,8 +160,6 @@ const MapLegend = _ref => {
|
|
|
168
160
|
return /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
169
161
|
display: "flex",
|
|
170
162
|
justifyItems: "flex-start",
|
|
171
|
-
border: "1px solid ".concat(theme.palette.TwClrBrdrTertiary),
|
|
172
|
-
borderRadius: borderRadius,
|
|
173
163
|
padding: theme.spacing(2, 1),
|
|
174
164
|
flexDirection: 'column',
|
|
175
165
|
maxWidth: isDesktop ? '184px' : 'fill',
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
background: $tw-clr-base-white;
|
|
7
7
|
|
|
8
8
|
&--mobile {
|
|
9
|
-
|
|
9
|
+
width: fill;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
&--small {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
&--header {
|
|
22
|
-
padding: $tw-spc-base-x-small
|
|
22
|
+
padding: $tw-spc-base-x-small;
|
|
23
23
|
display: flex;
|
|
24
24
|
justify-content: space-between;
|
|
25
25
|
align-items: center;
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
text-overflow: ellipsis;
|
|
34
34
|
overflow: hidden;
|
|
35
35
|
white-space: nowrap;
|
|
36
|
-
margin: 0
|
|
36
|
+
margin: 0;
|
|
37
37
|
width: 100%;
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
|
|
47
47
|
&--body {
|
|
48
48
|
background: $tw-clr-base-white;
|
|
49
|
-
padding: $tw-spc-base-small $tw-spc-base-
|
|
49
|
+
padding: $tw-spc-base-x-small $tw-spc-base-small;
|
|
50
50
|
text-align: start;
|
|
51
51
|
overflow: auto;
|
|
52
52
|
white-space: pre-wrap;
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapDrawer.stories.d.ts","sourceRoot":"","sources":["../../src/stories/MapDrawer.stories.tsx"],"names":[],"mappings":"AAKA,OAAkB,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;;;;;
|
|
1
|
+
{"version":3,"file":"MapDrawer.stories.d.ts","sourceRoot":"","sources":["../../src/stories/MapDrawer.stories.tsx"],"names":[],"mappings":"AAKA,OAAkB,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;;;;;AAIvE,wBAGE;AAuDF,eAAO,MAAM,OAAO,sGAAoB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapLegend.stories.d.ts","sourceRoot":"","sources":["../../src/stories/MapLegend.stories.tsx"],"names":[],"mappings":";AAEA,OAAkB,EAAkB,cAAc,EAAE,MAAM,6BAA6B,CAAC;;;;;AAKxF,wBAGE;
|
|
1
|
+
{"version":3,"file":"MapLegend.stories.d.ts","sourceRoot":"","sources":["../../src/stories/MapLegend.stories.tsx"],"names":[],"mappings":";AAEA,OAAkB,EAAkB,cAAc,EAAE,MAAM,6BAA6B,CAAC;;;;;AAKxF,wBAGE;AAwKF,eAAO,MAAM,OAAO,uGAAoB,CAAC"}
|