@terraware/web-components 3.5.3 → 3.5.5
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/AntSwitch/index.d.ts +1 -1
- package/components/AntSwitch/index.d.ts.map +1 -1
- package/components/AntSwitch/index.js +1 -1
- package/components/Map/MapDrawer.d.ts +14 -0
- package/components/Map/MapDrawer.d.ts.map +1 -0
- package/components/Map/MapDrawer.js +44 -0
- package/components/Map/MapLegend.d.ts +59 -0
- package/components/Map/MapLegend.d.ts.map +1 -0
- package/components/Map/MapLegend.js +180 -0
- package/components/Map/styles.scss +64 -0
- package/package.json +1 -1
- package/stories/MapDrawer.stories.d.ts +8 -0
- package/stories/MapDrawer.stories.d.ts.map +1 -0
- package/stories/MapLegend.stories.d.ts +9 -0
- package/stories/MapLegend.stories.d.ts.map +1 -0
|
@@ -2,7 +2,7 @@ import './styles.scss';
|
|
|
2
2
|
export type AntSwitchProps = {
|
|
3
3
|
checked?: boolean;
|
|
4
4
|
disabled?: boolean;
|
|
5
|
-
onChange
|
|
5
|
+
onChange?: (checked: boolean) => void;
|
|
6
6
|
};
|
|
7
7
|
declare const AntSwitch: (props: AntSwitchProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export default AntSwitch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AntSwitch/index.tsx"],"names":[],"mappings":"AAEA,OAAO,eAAe,CAAC;AAEvB,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AntSwitch/index.tsx"],"names":[],"mappings":"AAEA,OAAO,eAAe,CAAC;AAEvB,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC,CAAC;AAEF,QAAA,MAAM,SAAS,UAAW,cAAc,4CAQvC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -15,7 +15,7 @@ const AntSwitch = props => {
|
|
|
15
15
|
onChange
|
|
16
16
|
} = props;
|
|
17
17
|
const onChangeHandler = (0, _react.useCallback)((event, value) => {
|
|
18
|
-
onChange(value);
|
|
18
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
19
19
|
}, [onChange]);
|
|
20
20
|
return /*#__PURE__*/_react.default.createElement(_material.Switch, {
|
|
21
21
|
className: "ant-switch",
|
|
@@ -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,mDAwBtC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
border: "1px solid ".concat(theme.palette.TwClrBrdrTertiary),
|
|
29
|
+
style: style
|
|
30
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
31
|
+
className: "map-drawer--header"
|
|
32
|
+
}, /*#__PURE__*/_react.default.createElement("p", {
|
|
33
|
+
className: "title"
|
|
34
|
+
}, title), /*#__PURE__*/_react.default.createElement(_material.IconButton, {
|
|
35
|
+
onClick: onClose,
|
|
36
|
+
size: "small"
|
|
37
|
+
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
38
|
+
name: "close",
|
|
39
|
+
className: "icon-close"
|
|
40
|
+
}))), /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
41
|
+
className: 'map-drawer--body'
|
|
42
|
+
}, children)) : null;
|
|
43
|
+
};
|
|
44
|
+
var _default = exports.default = MapDrawer;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IconName } from '../Icon/icons';
|
|
3
|
+
export type MapLayerItem = {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
style: {
|
|
8
|
+
borderColor: string;
|
|
9
|
+
fillColor?: string;
|
|
10
|
+
fillPatternUrl?: string;
|
|
11
|
+
opacity?: number;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export type MapLayerGroup = {
|
|
15
|
+
type: 'layer';
|
|
16
|
+
items: MapLayerItem[];
|
|
17
|
+
setSelectedLayer: (id: string) => void;
|
|
18
|
+
selectedLayer: string;
|
|
19
|
+
};
|
|
20
|
+
export type MapFeatureItem = {
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
icon: IconName;
|
|
23
|
+
iconColor: string;
|
|
24
|
+
iconOpacity?: number;
|
|
25
|
+
id: string;
|
|
26
|
+
label: string;
|
|
27
|
+
setVisible?: (visible: boolean) => void;
|
|
28
|
+
visible: boolean;
|
|
29
|
+
};
|
|
30
|
+
export type MapFeatureGroup = {
|
|
31
|
+
type: 'feature';
|
|
32
|
+
items: MapFeatureItem[];
|
|
33
|
+
};
|
|
34
|
+
export type MapHighlightItem = {
|
|
35
|
+
label: string;
|
|
36
|
+
style: {
|
|
37
|
+
borderColor: string;
|
|
38
|
+
fillColor?: string;
|
|
39
|
+
fillPatternUrl?: string;
|
|
40
|
+
opacity?: number;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export type MapHighlightGroup = {
|
|
44
|
+
type: 'highlight';
|
|
45
|
+
items: MapHighlightItem[];
|
|
46
|
+
setVisible?: (visible: boolean) => void;
|
|
47
|
+
visible: boolean;
|
|
48
|
+
};
|
|
49
|
+
export type MapLegendGroup = {
|
|
50
|
+
disabled?: boolean;
|
|
51
|
+
tooltip?: string;
|
|
52
|
+
title: string;
|
|
53
|
+
} & (MapFeatureGroup | MapLayerGroup | MapHighlightGroup);
|
|
54
|
+
export type MapLegendProps = {
|
|
55
|
+
legends: MapLegendGroup[];
|
|
56
|
+
};
|
|
57
|
+
declare const MapLegend: ({ legends }: MapLegendProps) => JSX.Element;
|
|
58
|
+
export default MapLegend;
|
|
59
|
+
//# sourceMappingURL=MapLegend.d.ts.map
|
|
@@ -0,0 +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,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,cAAc,EAAE,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,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,iBAAiB,GAAG;IAC9B,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,OAAO,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,WAgOhD,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _material = require("@mui/material");
|
|
11
|
+
var _utils = require("../../utils");
|
|
12
|
+
var _Icon = _interopRequireDefault(require("../Icon/Icon"));
|
|
13
|
+
var _AntSwitch = _interopRequireDefault(require("../AntSwitch"));
|
|
14
|
+
const MapLegend = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
legends
|
|
17
|
+
} = _ref;
|
|
18
|
+
const theme = (0, _material.useTheme)();
|
|
19
|
+
const {
|
|
20
|
+
isMobile,
|
|
21
|
+
isDesktop
|
|
22
|
+
} = (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
|
+
const legendComponents = legends.map((legend, index) => {
|
|
31
|
+
const isFirst = index === 0;
|
|
32
|
+
const isLast = index === legends.length - 1;
|
|
33
|
+
const switchComponent = legend.type === 'highlight' ? /*#__PURE__*/_react.default.createElement(_AntSwitch.default, {
|
|
34
|
+
disabled: legend.disabled,
|
|
35
|
+
checked: legend.visible,
|
|
36
|
+
onChange: legend.setVisible
|
|
37
|
+
}) : undefined;
|
|
38
|
+
const titleComponent = /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
39
|
+
fontSize: "16px",
|
|
40
|
+
fontWeight: 600,
|
|
41
|
+
width: isMobile ? '100%' : undefined,
|
|
42
|
+
marginRight: isMobile ? 0 : theme.spacing(4),
|
|
43
|
+
paddingLeft: switchComponent ? theme.spacing(1) : theme.spacing(0)
|
|
44
|
+
}, legend.title, legend.tooltip && /*#__PURE__*/_react.default.createElement(_material.Tooltip, {
|
|
45
|
+
title: legend.tooltip,
|
|
46
|
+
sx: {
|
|
47
|
+
display: 'inline-block',
|
|
48
|
+
verticalAlign: 'text-top',
|
|
49
|
+
marginLeft: theme.spacing(1)
|
|
50
|
+
}
|
|
51
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
52
|
+
display: "flex"
|
|
53
|
+
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
54
|
+
fillColor: theme.palette.TwClrIcnInfo,
|
|
55
|
+
name: "info",
|
|
56
|
+
size: "small"
|
|
57
|
+
}))));
|
|
58
|
+
const itemComponents = legend.items.map((item, itemIndex) => {
|
|
59
|
+
const onClick = legend.disabled ? undefined : legend.type === 'layer' ? item.disabled ? undefined : () => legend.setSelectedLayer(item.id) : legend.type === 'feature' ? item.disabled ? undefined : () => {
|
|
60
|
+
var _setVisible, _ref2;
|
|
61
|
+
return (_setVisible = (_ref2 = item).setVisible) === null || _setVisible === void 0 ? void 0 : _setVisible.call(_ref2, !item.visible);
|
|
62
|
+
} : undefined;
|
|
63
|
+
const disabled = legend.disabled || (legend.type === 'layer' ? item.disabled : legend.type === 'feature' ? item.disabled : false) || false;
|
|
64
|
+
const selected = legend.type === 'layer' ? item.id === legend.selectedLayer : legend.type === 'feature' ? item.visible : false;
|
|
65
|
+
const logoComponent = () => {
|
|
66
|
+
var _layerItem$style$opac;
|
|
67
|
+
switch (legend.type) {
|
|
68
|
+
case 'feature':
|
|
69
|
+
const featureItem = item;
|
|
70
|
+
return /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
71
|
+
name: featureItem.icon,
|
|
72
|
+
fillColor: featureItem.iconColor,
|
|
73
|
+
style: {
|
|
74
|
+
marginRight: theme.spacing(1),
|
|
75
|
+
opacity: featureItem.iconOpacity
|
|
76
|
+
},
|
|
77
|
+
size: 'small'
|
|
78
|
+
});
|
|
79
|
+
case 'layer':
|
|
80
|
+
case 'highlight':
|
|
81
|
+
const layerItem = item;
|
|
82
|
+
const opacity = (_layerItem$style$opac = layerItem.style.opacity) !== null && _layerItem$style$opac !== void 0 ? _layerItem$style$opac : 1.0;
|
|
83
|
+
return /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
84
|
+
sx: {
|
|
85
|
+
border: "2px solid ".concat(layerItem.style.borderColor),
|
|
86
|
+
backgroundColor: layerItem.style.fillColor,
|
|
87
|
+
backgroundImage: layerItem.style.fillPatternUrl ? "url('".concat(layerItem.style.fillPatternUrl, "')") : undefined,
|
|
88
|
+
backgroundRepeat: 'repeat',
|
|
89
|
+
opacity: disabled ? 0.7 * opacity : opacity,
|
|
90
|
+
height: '16px',
|
|
91
|
+
width: '24px',
|
|
92
|
+
minWidth: '24px',
|
|
93
|
+
marginRight: theme.spacing(1)
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
const visibleComponent = () => {
|
|
99
|
+
switch (legend.type) {
|
|
100
|
+
case 'feature':
|
|
101
|
+
const featureItem = item;
|
|
102
|
+
const visibleIcon = featureItem.visible ? /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
103
|
+
name: "iconEye"
|
|
104
|
+
}) : /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
105
|
+
name: "iconEyeOff"
|
|
106
|
+
});
|
|
107
|
+
return /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
108
|
+
display: "flex"
|
|
109
|
+
}, visibleIcon);
|
|
110
|
+
case 'layer':
|
|
111
|
+
const layerLegend = legend;
|
|
112
|
+
const layerItem = item;
|
|
113
|
+
return /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
114
|
+
display: "flex",
|
|
115
|
+
sx: {
|
|
116
|
+
visibility: layerItem.id === layerLegend.selectedLayer ? 'visible' : 'hidden'
|
|
117
|
+
}
|
|
118
|
+
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
119
|
+
name: "checkmark",
|
|
120
|
+
style: {
|
|
121
|
+
marginRight: theme.spacing(1)
|
|
122
|
+
}
|
|
123
|
+
}));
|
|
124
|
+
case 'highlight':
|
|
125
|
+
return undefined;
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
return /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
129
|
+
onClick: onClick,
|
|
130
|
+
display: "flex",
|
|
131
|
+
alignItems: "center",
|
|
132
|
+
sx: {
|
|
133
|
+
cursor: onClick ? 'pointer' : 'default',
|
|
134
|
+
background: selected ? theme.palette.TwClrBgSecondary : 'none',
|
|
135
|
+
borderRadius: theme.spacing(1),
|
|
136
|
+
padding: theme.spacing(1, 1),
|
|
137
|
+
opacity: disabled ? '0.5' : 1
|
|
138
|
+
},
|
|
139
|
+
justifyContent: 'space-between',
|
|
140
|
+
key: "".concat(index, "-").concat(itemIndex)
|
|
141
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
142
|
+
display: "flex",
|
|
143
|
+
alignItems: "center",
|
|
144
|
+
paddingRight: theme.spacing(1)
|
|
145
|
+
}, logoComponent(), /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
146
|
+
fontSize: "14px",
|
|
147
|
+
fontWeight: 400
|
|
148
|
+
}, item.label)), /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
149
|
+
display: "flex"
|
|
150
|
+
}, visibleComponent()));
|
|
151
|
+
});
|
|
152
|
+
return /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
153
|
+
key: legend.title,
|
|
154
|
+
sx: {
|
|
155
|
+
opacity: legend.disabled ? 0.7 : 1
|
|
156
|
+
},
|
|
157
|
+
borderBottom: isLast ? 'none' : "1px solid ".concat(theme.palette.TwClrBrdrTertiary)
|
|
158
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
159
|
+
paddingBottom: 2,
|
|
160
|
+
paddingTop: isFirst ? 0 : 2,
|
|
161
|
+
flexDirection: 'column'
|
|
162
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
163
|
+
display: "flex",
|
|
164
|
+
alignItems: 'center',
|
|
165
|
+
paddingLeft: theme.spacing(1)
|
|
166
|
+
}, switchComponent, titleComponent), itemComponents));
|
|
167
|
+
});
|
|
168
|
+
return /*#__PURE__*/_react.default.createElement(_material.Box, {
|
|
169
|
+
display: "flex",
|
|
170
|
+
justifyItems: "flex-start",
|
|
171
|
+
border: "1px solid ".concat(theme.palette.TwClrBrdrTertiary),
|
|
172
|
+
borderRadius: borderRadius,
|
|
173
|
+
padding: theme.spacing(2, 1),
|
|
174
|
+
flexDirection: 'column',
|
|
175
|
+
maxWidth: isDesktop ? '184px' : 'fill',
|
|
176
|
+
width: isDesktop ? 'auto' : 'fill',
|
|
177
|
+
margin: 0
|
|
178
|
+
}, legendComponents);
|
|
179
|
+
};
|
|
180
|
+
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
|
+
display: none;
|
|
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 $tw-spc-base-xx-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 $tw-spc-base-xx-small;
|
|
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-small $tw-spc-base-x-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
|
@@ -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;;;;;AAGvE,wBAGE;AAuEF,eAAO,MAAM,OAAO,sGAAoB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MapLegendProps } from '../components/Map/MapLegend';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: ({ legends }: MapLegendProps) => JSX.Element;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, MapLegendProps>;
|
|
9
|
+
//# sourceMappingURL=MapLegend.stories.d.ts.map
|
|
@@ -0,0 +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;AAkLF,eAAO,MAAM,OAAO,uGAAoB,CAAC"}
|