@terraware/web-components 3.5.4 → 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.
@@ -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;
@@ -0,0 +1,14 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ import './styles.scss';
3
+ type MapDrawerSize = 'small' | 'medium';
4
+ export type MapDrawerProp = {
5
+ children?: ReactNode;
6
+ onClose?: () => void;
7
+ open: boolean;
8
+ size: MapDrawerSize;
9
+ style?: CSSProperties;
10
+ title: string;
11
+ };
12
+ declare const MapDrawer: (props: MapDrawerProp) => import("react/jsx-runtime").JSX.Element | null;
13
+ export default MapDrawer;
14
+ //# sourceMappingURL=MapDrawer.d.ts.map
@@ -0,0 +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,mDAyBtC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _material = require("@mui/material");
10
+ var _Icon = _interopRequireDefault(require("../Icon/Icon"));
11
+ require("./styles.scss");
12
+ var _utils = require("../../utils");
13
+ const MapDrawer = props => {
14
+ const {
15
+ children,
16
+ onClose,
17
+ open,
18
+ size,
19
+ style,
20
+ title
21
+ } = props;
22
+ const theme = (0, _material.useTheme)();
23
+ const {
24
+ isDesktop
25
+ } = (0, _utils.useDeviceInfo)();
26
+ return open ? /*#__PURE__*/_react.default.createElement(_material.Box, {
27
+ className: "map-drawer map-drawer".concat(isDesktop ? "--".concat(size) : '--mobile'),
28
+ borderLeft: isDesktop ? "1px solid ".concat(theme.palette.TwClrBrdrTertiary) : undefined,
29
+ borderRight: isDesktop ? "1px solid ".concat(theme.palette.TwClrBrdrTertiary) : undefined,
30
+ style: style
31
+ }, /*#__PURE__*/_react.default.createElement(_material.Box, {
32
+ className: "map-drawer--header"
33
+ }, /*#__PURE__*/_react.default.createElement("p", {
34
+ className: "title"
35
+ }, title), /*#__PURE__*/_react.default.createElement(_material.IconButton, {
36
+ onClick: onClose,
37
+ size: "small"
38
+ }, /*#__PURE__*/_react.default.createElement(_Icon.default, {
39
+ name: "close",
40
+ className: "icon-close"
41
+ }))), /*#__PURE__*/_react.default.createElement(_material.Box, {
42
+ className: 'map-drawer--body'
43
+ }, children)) : null;
44
+ };
45
+ var _default = exports.default = MapDrawer;
@@ -1 +1 @@
1
- {"version":3,"file":"MapLegend.d.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SAAS,gBAAiB,cAAc,KAAG,WAsNhD,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -160,14 +160,11 @@ const MapLegend = _ref => {
160
160
  return /*#__PURE__*/_react.default.createElement(_material.Box, {
161
161
  display: "flex",
162
162
  justifyItems: "flex-start",
163
- border: "1px solid ".concat(theme.palette.TwClrBrdrTertiary),
164
- borderRadius: "8px",
165
163
  padding: theme.spacing(2, 1),
166
164
  flexDirection: 'column',
167
- maxWidth: isDesktop ? '184px' : '100%',
168
- width: isDesktop ? 'auto' : '100%',
169
- marginRight: 2,
170
- marginTop: isDesktop ? 0 : 2
165
+ maxWidth: isDesktop ? '184px' : 'fill',
166
+ width: isDesktop ? 'auto' : 'fill',
167
+ margin: 0
171
168
  }, legendComponents);
172
169
  };
173
170
  var _default = exports.default = MapLegend;
@@ -0,0 +1,64 @@
1
+ @import '../../style-dictionary-dist/terraware.scss';
2
+
3
+ .map-drawer {
4
+ display: flex;
5
+ flex-direction: column;
6
+ background: $tw-clr-base-white;
7
+
8
+ &--mobile {
9
+ width: fill;
10
+ }
11
+
12
+ &--small {
13
+ min-width: 280px;
14
+ width: 280px;
15
+ }
16
+ &--medium {
17
+ min-width: 420px;
18
+ width: 420px;
19
+ }
20
+
21
+ &--header {
22
+ padding: $tw-spc-base-x-small;
23
+ display: flex;
24
+ justify-content: space-between;
25
+ align-items: center;
26
+ .title {
27
+ font-family: $tw-fnt-mssg-title-font-family;
28
+ font-size: $tw-fnt-mssg-title-font-size;
29
+ font-weight: $tw-fnt-mssg-title-font-weight;
30
+ line-height: $tw-fnt-mssg-title-line-height;
31
+ color: $tw-clr-txt;
32
+ text-align: center;
33
+ text-overflow: ellipsis;
34
+ overflow: hidden;
35
+ white-space: nowrap;
36
+ margin: 0;
37
+ width: 100%;
38
+ }
39
+
40
+ .icon-close {
41
+ fill: $tw-clr-icn-secondary;
42
+ height: $tw-sz-base-medium;
43
+ width: $tw-sz-base-medium;
44
+ }
45
+ }
46
+
47
+ &--body {
48
+ background: $tw-clr-base-white;
49
+ padding: $tw-spc-base-x-small $tw-spc-base-small;
50
+ text-align: start;
51
+ overflow: auto;
52
+ white-space: pre-wrap;
53
+ }
54
+
55
+ &--message {
56
+ font-family: $tw-fnt-dlg-bx-message-font-family;
57
+ font-size: $tw-fnt-dlg-bx-message-font-size;
58
+ font-weight: $tw-fnt-dlg-bx-message-font-weight;
59
+ line-height: $tw-fnt-dlg-bx-message-line-height;
60
+ color: $tw-clr-txt;
61
+ width: 100%;
62
+ text-align: start;
63
+ }
64
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@terraware/web-components",
3
- "version": "3.5.4",
3
+ "version": "3.5.6",
4
4
  "author": "Terraformation Inc.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -0,0 +1,8 @@
1
+ import { MapDrawerProp } from '../components/Map/MapDrawer';
2
+ declare const _default: {
3
+ title: string;
4
+ component: (props: MapDrawerProp) => import("react/jsx-runtime").JSX.Element | null;
5
+ };
6
+ export default _default;
7
+ export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, MapDrawerProp>;
8
+ //# sourceMappingURL=MapDrawer.stories.d.ts.map
@@ -0,0 +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;;;;;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;AAuKF,eAAO,MAAM,OAAO,uGAAoB,CAAC"}
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"}