@mattilsynet/design 2.2.18 → 2.2.20

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.
Files changed (88) hide show
  1. package/mtds/atlas/atlas-element.d.ts +26 -0
  2. package/mtds/atlas/atlas-element.js +74 -0
  3. package/mtds/atlas/atlas-element.js.map +1 -0
  4. package/mtds/atlas/atlas.css.js +88 -0
  5. package/mtds/atlas/atlas.css.js.map +1 -0
  6. package/mtds/atlas/atlas.stories.d.ts +18 -0
  7. package/mtds/atlas/cluster.js +1149 -0
  8. package/mtds/atlas/cluster.js.map +1 -0
  9. package/mtds/atlas.d.ts +1 -0
  10. package/mtds/atlas.iife.js +687 -0
  11. package/mtds/atlas.js +7 -0
  12. package/mtds/atlas.js.map +1 -0
  13. package/mtds/external/leaflet/dist/leaflet-src.js +6265 -0
  14. package/mtds/external/leaflet/dist/leaflet-src.js.map +1 -0
  15. package/mtds/external/leaflet/dist/leaflet.css.js +607 -0
  16. package/mtds/external/leaflet/dist/leaflet.css.js.map +1 -0
  17. package/mtds/illustrations/byggning-1-gronn.svg +1 -0
  18. package/mtds/illustrations/byggning-1-mattilsynet.svg +1 -0
  19. package/mtds/illustrations/byggning-2-gronn.svg +1 -0
  20. package/mtds/illustrations/byggning-3-gronn.svg +1 -0
  21. package/mtds/illustrations/byggning-4-gronn.svg +1 -0
  22. package/mtds/illustrations/byggning-5-gronn.svg +1 -0
  23. package/mtds/illustrations/byggning-6-blaa.svg +1 -0
  24. package/mtds/illustrations/byggning-7-blaa.svg +1 -0
  25. package/mtds/illustrations/byggning-8-blaa.svg +1 -0
  26. package/mtds/illustrations/byggningsrekke-1-gronn.svg +1 -0
  27. package/mtds/illustrations/byggningsrekke-1-mattilsynet.svg +1 -0
  28. package/mtds/illustrations/byggningsrekke-2-gronn.svg +1 -0
  29. package/mtds/illustrations/byggningsrekke-3-blaa.svg +1 -0
  30. package/mtds/illustrations/debatt.svg +1 -0
  31. package/mtds/illustrations/egg.svg +1 -0
  32. package/mtds/illustrations/flagg-aaland.svg +1 -0
  33. package/mtds/illustrations/flagg-danmark.svg +1 -0
  34. package/mtds/illustrations/flagg-faeroyene.svg +1 -0
  35. package/mtds/illustrations/flagg-finland.svg +1 -0
  36. package/mtds/illustrations/flagg-gronland.svg +1 -0
  37. package/mtds/illustrations/flagg-island.svg +1 -0
  38. package/mtds/illustrations/flagg-norge.svg +1 -0
  39. package/mtds/illustrations/flagg-sapmi.svg +1 -0
  40. package/mtds/illustrations/flagg-sverige.svg +1 -0
  41. package/mtds/illustrations/forstorrelsesglass.svg +1 -0
  42. package/mtds/illustrations/hengelas.svg +1 -0
  43. package/mtds/illustrations/kompass.svg +1 -0
  44. package/mtds/illustrations/skinke.svg +1 -0
  45. package/mtds/illustrations/system-stotte.svg +1 -0
  46. package/mtds/illustrations/system.svg +1 -0
  47. package/mtds/illustrations/tre-1.svg +1 -0
  48. package/mtds/illustrations/tre-2.svg +1 -0
  49. package/mtds/illustrations/tre-3.svg +1 -0
  50. package/mtds/index.d.ts +2 -0
  51. package/mtds/index.iife.js +15 -15
  52. package/mtds/index.js +20 -15
  53. package/mtds/index.js.map +1 -1
  54. package/mtds/law/law-helper.d.ts +29 -22
  55. package/mtds/law/law-helper.js +78 -0
  56. package/mtds/law/law-helper.js.map +1 -0
  57. package/mtds/law/law.d.ts +2 -18
  58. package/mtds/law/law.js +10 -0
  59. package/mtds/law/law.js.map +1 -0
  60. package/mtds/law/law.stories.d.ts +6 -0
  61. package/mtds/law/vinforskriften-new.d.ts +1 -0
  62. package/mtds/law/vinforskriften-old.d.ts +1 -0
  63. package/mtds/logo/logo-observer.js +1 -1
  64. package/mtds/logo/logo-observer.js.map +1 -1
  65. package/mtds/package.json.js +1 -1
  66. package/mtds/react.d.ts +1 -0
  67. package/mtds/react.js +53 -51
  68. package/mtds/react.js.map +1 -1
  69. package/mtds/styles.css +1 -1
  70. package/mtds/styles.json +43 -42
  71. package/mtds/styles.module.css.js +88 -86
  72. package/mtds/styles.module.css.js.map +1 -1
  73. package/mtds/tabs/tabs.stories.d.ts +1 -0
  74. package/mtds/utils.d.ts +1 -1
  75. package/mtds/utils.js +37 -31
  76. package/mtds/utils.js.map +1 -1
  77. package/package.json +17 -19
  78. package/mtds/law/vin.d.ts +0 -1
  79. package/mtds/map/map-element.d.ts +0 -47
  80. package/mtds/map/map-element.js +0 -82
  81. package/mtds/map/map-element.js.map +0 -1
  82. package/mtds/map/map.css.js +0 -46
  83. package/mtds/map/map.css.js.map +0 -1
  84. package/mtds/map/map.stories.d.ts +0 -10
  85. package/mtds/map.d.ts +0 -1
  86. package/mtds/map.iife.js +0 -722
  87. package/mtds/map.js +0 -8
  88. package/mtds/map.js.map +0 -1
@@ -0,0 +1,26 @@
1
+ import { default as L } from 'leaflet';
2
+ import { MTDSElement } from '../utils';
3
+ import type * as ReactTypes from "react";
4
+ export { L };
5
+ declare global {
6
+ namespace React.JSX {
7
+ interface IntrinsicElements {
8
+ "mtds-atlas": ReactTypes.DetailedHTMLProps<ReactTypes.HTMLAttributes<MTDSAtlasElement>, MTDSAtlasElement> & {
9
+ class?: string;
10
+ "data-view"?: string | number[];
11
+ };
12
+ }
13
+ }
14
+ }
15
+ export declare class MTDSAtlasElement extends MTDSElement {
16
+ cluster?: L.MarkerClusterGroup;
17
+ map?: L.Map;
18
+ _popup?: [HTMLElement, L.Popup];
19
+ static get observedAttributes(): string[];
20
+ constructor();
21
+ connectedCallback(): void;
22
+ attributeChangedCallback(name: string, _prev?: string | null, next?: string | null): void;
23
+ setView(view: string | number[], options?: L.ZoomPanOptions): void;
24
+ addMarker(latlng: L.LatLngExpression, options?: L.MarkerOptions): L.Marker<any>;
25
+ disconnectedCallback(): void;
26
+ }
@@ -0,0 +1,74 @@
1
+ import s from "../external/leaflet/dist/leaflet-src.js";
2
+ import d from "../external/leaflet/dist/leaflet.css.js";
3
+ import { IS_BROWSER as c, MTDSElement as m, tag as a, attr as l, debounce as h } from "../utils.js";
4
+ import p from "./atlas.css.js";
5
+ import "./cluster.js";
6
+ const u = [
7
+ [57.5, 4.73],
8
+ [71.5, 31.44]
9
+ ], f = "https://cache.kartverket.no/v1/wmts/1.0.0/topo/default/webmercator/{z}/{y}/{x}.png";
10
+ class r extends m {
11
+ cluster;
12
+ map;
13
+ // Private properties
14
+ _popup;
15
+ static get observedAttributes() {
16
+ return ["data-view", "data-scrollzoom"];
17
+ }
18
+ constructor() {
19
+ super(), this.attachShadow({ mode: "open" }).append(
20
+ a("style", {}, `${d}
21
+ ${p}`),
22
+ a("slot"),
23
+ a("div")
24
+ );
25
+ }
26
+ connectedCallback() {
27
+ const t = this.shadowRoot?.lastElementChild, o = Number(l(this, "data-cluster")) || 1, e = new s.TileLayer(f, {
28
+ attribution: "&copy; Kartverket",
29
+ maxZoom: 18
30
+ });
31
+ this.map = new s.Map(t, {
32
+ attributionControl: !1,
33
+ wheelPxPerZoomLevel: 20,
34
+ zoomControl: !1,
35
+ zoomSnap: 0,
36
+ layers: [e]
37
+ }), this.cluster = new s.MarkerClusterGroup({
38
+ disableClusteringAtZoom: o,
39
+ showCoverageOnHover: !1,
40
+ zoomToBoundsOnClick: !0
41
+ }).addTo(this.map), this.map.addControl(new s.Control.Attribution({ prefix: "" })), this.map.addControl(new s.Control.Zoom({ position: "bottomright" })), r.observedAttributes.forEach((i) => {
42
+ this.attributeChangedCallback(i, null, l(this, i));
43
+ });
44
+ }
45
+ attributeChangedCallback(t, o = null, e = null) {
46
+ this.map && (t === "data-view" && this.setView(e || ""), t === "data-scrollzoom" && this.map.scrollWheelZoom[e === "false" ? "disable" : "enable"]());
47
+ }
48
+ setView(t, o) {
49
+ const e = `${t}`.split(",").map(parseFloat).filter(Number.isFinite), i = this.cluster?.getBounds();
50
+ e.length === 3 ? this.map?.setView([e[0], e[1]], e[2], o) : t !== "fit" ? this.map?.fitBounds(u, o) : i?.isValid() ? this.map?.fitBounds(i, o || { padding: [40, 40] }) : this.cluster?.on("layeradd", n, this);
51
+ }
52
+ addMarker(t, o) {
53
+ return new s.Marker(t, o).addTo(
54
+ this.cluster
55
+ );
56
+ }
57
+ disconnectedCallback() {
58
+ this.map?.remove();
59
+ }
60
+ }
61
+ c && !window.customElements.get("mtds-atlas") && (s.Marker.prototype.options.icon = new s.DivIcon({
62
+ html: '<svg class="map-pin" viewBox="0 0 256 256"><rect x="78" y="50" width="100" height="100" /><path fill="var(--mtds-)" d="M128,16a88.1,88.1,0,0,0-88,88c0,75.3,80,132.17,83.41,134.55a8,8,0,0,0,9.18,0C136,236.17,216,179.3,216,104A88.1,88.1,0,0,0,128,16Zm0,56a32,32,0,1,1-32,32A32,32,0,0,1,128,72Z"/></svg>',
63
+ iconSize: [30, 30],
64
+ iconAnchor: [15, 30],
65
+ popupAnchor: [0, -15]
66
+ }), window.customElements.define("mtds-atlas", r));
67
+ const n = h(function() {
68
+ this.cluster?.off("layeradd", n), this.cluster?.getBounds().isValid() && this.setView("fit");
69
+ }, 100);
70
+ export {
71
+ s as L,
72
+ r as MTDSAtlasElement
73
+ };
74
+ //# sourceMappingURL=atlas-element.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atlas-element.js","sources":["../../designsystem/atlas/atlas-element.ts"],"sourcesContent":["import L from \"leaflet\";\nimport LeafletCSS from \"leaflet/dist/leaflet.css?raw\";\nimport type {} from \"leaflet.markercluster\";\nimport type * as ReactTypes from \"react\";\nimport { attr, debounce, IS_BROWSER, MTDSElement, tag } from \"../utils\";\nimport css from \"./atlas.css?raw\";\nimport \"./cluster.js\";\nexport { L };\ndeclare global {\n\tnamespace React.JSX {\n\t\tinterface IntrinsicElements {\n\t\t\t\"mtds-atlas\": ReactTypes.DetailedHTMLProps<\n\t\t\t\tReactTypes.HTMLAttributes<MTDSAtlasElement>,\n\t\t\t\tMTDSAtlasElement\n\t\t\t> & {\n\t\t\t\tclass?: string;\n\t\t\t\t\"data-view\"?: string | number[];\n\t\t\t};\n\t\t}\n\t}\n}\n\n// const EVENTS = \"popupopen popupclose move zoom resize\";\nconst BOUNDS_NORWAY: L.LatLngBoundsLiteral = [\n\t[57.5, 4.73],\n\t[71.5, 31.44],\n];\n\n// Turns out Kartverket's color tiles are better in grayscale than their grayscale tiles\n// const TILES_GRAY = \"https://cache.kartverket.no/v1/wmts/1.0.0/topograatone/default/webmercator/{z}/{y}/{x}.png\";\nconst TILES_COLOR =\n\t\"https://cache.kartverket.no/v1/wmts/1.0.0/topo/default/webmercator/{z}/{y}/{x}.png\";\n\nexport class MTDSAtlasElement extends MTDSElement {\n\tcluster?: L.MarkerClusterGroup;\n\tmap?: L.Map;\n\n\t// Private properties\n\t_popup?: [HTMLElement, L.Popup];\n\n\tstatic get observedAttributes() {\n\t\treturn [\"data-view\", \"data-scrollzoom\"]; //TODO: \"data-layers\" // Using ES2015 syntax for backwards compatibility\n\t}\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.attachShadow({ mode: \"open\" }).append(\n\t\t\ttag(\"style\", {}, `${LeafletCSS}\\n${css}`),\n\t\t\ttag(\"slot\"),\n\t\t\ttag(\"div\"),\n\t\t);\n\t}\n\tconnectedCallback() {\n\t\tconst div = this.shadowRoot?.lastElementChild;\n\t\tconst cluster = Number(attr(this, \"data-cluster\")) || 1;\n\t\tconst tiles = new L.TileLayer(TILES_COLOR, {\n\t\t\tattribution: \"&copy; Kartverket\",\n\t\t\tmaxZoom: 18,\n\t\t});\n\n\t\tthis.map = new L.Map(div as HTMLElement, {\n\t\t\tattributionControl: false,\n\t\t\twheelPxPerZoomLevel: 20,\n\t\t\tzoomControl: false,\n\t\t\tzoomSnap: 0,\n\t\t\tlayers: [tiles],\n\t\t});\n\n\t\tthis.cluster = new L.MarkerClusterGroup({\n\t\t\tdisableClusteringAtZoom: cluster,\n\t\t\tshowCoverageOnHover: false,\n\t\t\tzoomToBoundsOnClick: true,\n\t\t}).addTo(this.map);\n\n\t\tthis.map.addControl(new L.Control.Attribution({ prefix: \"\" }));\n\t\tthis.map.addControl(new L.Control.Zoom({ position: \"bottomright\" }));\n\t\t// this.map.on(EVENTS, handleEvents);\n\n\t\t// Initial setup when map is connected\n\t\tMTDSAtlasElement.observedAttributes.forEach((name) => {\n\t\t\tthis.attributeChangedCallback(name, null, attr(this, name));\n\t\t});\n\t}\n\tattributeChangedCallback(\n\t\tname: string,\n\t\t_prev: string | null = null,\n\t\tnext: string | null = null,\n\t) {\n\t\tif (!this.map) return; // No map yet\n\t\tif (name === \"data-view\") this.setView(next || \"\");\n\t\tif (name === \"data-scrollzoom\")\n\t\t\tthis.map.scrollWheelZoom[next === \"false\" ? \"disable\" : \"enable\"]();\n\t}\n\tsetView(view: string | number[], options?: L.ZoomPanOptions) {\n\t\tconst pos = `${view}`.split(\",\").map(parseFloat).filter(Number.isFinite);\n\t\tconst bounds = this.cluster?.getBounds();\n\n\t\tif (pos.length === 3) this.map?.setView([pos[0], pos[1]], pos[2], options);\n\t\telse if (view !== \"fit\") this.map?.fitBounds(BOUNDS_NORWAY, options);\n\t\telse if (!bounds?.isValid())\n\t\t\tthis.cluster?.on(\"layeradd\", fitWhenMarkers, this);\n\t\telse this.map?.fitBounds(bounds, options || { padding: [40, 40] });\n\t}\n\taddMarker(latlng: L.LatLngExpression, options?: L.MarkerOptions) {\n\t\treturn new L.Marker(latlng, options).addTo(\n\t\t\tthis.cluster as L.MarkerClusterGroup,\n\t\t);\n\t}\n\tdisconnectedCallback() {\n\t\tthis.map?.remove();\n\t\t// this.map?.off(EVENTS, handleEvents);\n\t}\n}\n\n// Set default marker icon and define custom element\nif (IS_BROWSER && !window.customElements.get(\"mtds-atlas\")) {\n\tL.Marker.prototype.options.icon = new L.DivIcon({\n\t\thtml: '<svg class=\"map-pin\" viewBox=\"0 0 256 256\"><rect x=\"78\" y=\"50\" width=\"100\" height=\"100\" /><path fill=\"var(--mtds-)\" d=\"M128,16a88.1,88.1,0,0,0-88,88c0,75.3,80,132.17,83.41,134.55a8,8,0,0,0,9.18,0C136,236.17,216,179.3,216,104A88.1,88.1,0,0,0,128,16Zm0,56a32,32,0,1,1-32,32A32,32,0,0,1,128,72Z\"/></svg>',\n\t\ticonSize: [30, 30],\n\t\ticonAnchor: [15, 30],\n\t\tpopupAnchor: [0, -15],\n\t});\n\twindow.customElements.define(\"mtds-atlas\", MTDSAtlasElement);\n}\n\nconst fitWhenMarkers = debounce(function (this: MTDSAtlasElement) {\n\tthis.cluster?.off(\"layeradd\", fitWhenMarkers);\n\tif (this.cluster?.getBounds().isValid()) this.setView(\"fit\");\n}, 100);\n\n// const handleEvents: L.LeafletEventHandlerFn = ({ type, target, popup }) => {\n// \tconst self = target.getContainer();\n\n// \tif (type === \"popupopen\" || type === \"popupclose\") {\n// \t\tif (self._popup) {\n// \t\t\tconst [el] = self._popup;\n// \t\t\tself._popup = el.hidePopover();\n// \t\t\tself._popup = undefined;\n// \t\t}\n// \t\tconst id = type === \"popupopen\" && popup.getContent();\n// \t\tconst el = String(id)[0] === \"#\" && document.getElementById(id.slice(1));\n\n// \t\tif (el) {\n// \t\t\tattr(el, \"popover\", \"manual\");\n// \t\t\tattr(popup.getElement(), \"data-atlas-popup\", id);\n// \t\t\tel.showPopover();\n// \t\t\tself._popup = [el, popup];\n// \t\t\tanchorPopover(target, popup, el);\n// \t\t}\n// \t} else if (self._popup) {\n// \t\tanchorPopover(target, self._popup[1], self._popup[0]);\n// \t}\n// };\n\n// const anchorPopover = (map: L.Map, popup: L.Popup, popover: HTMLElement) => {\n// \tconst point = map.latLngToContainerPoint(popup.getLatLng() as L.LatLng);\n// \tconst rect = map.getContainer().getBoundingClientRect();\n// \tpopover.style.translate = `${rect.x + point.x + window.scrollX}px ${rect.y + point.y + window.scrollY}px`;\n// };\n\n// .on(\"click\", ({ target: marker, originalEvent: event }) => {\n// \tconst id = (marker.options as Record<string, string>)?.popoverTarget;\n// \tconst el = document.getElementById(id || \"\");\n\n// \tif (el) {\n// \t\tconsole.log(el, this);\n// \t\tevent.stopPropagation();\n// \t\tel.showPopover();\n// \t\tthis.popup = el;\n// \t\tthis.map?.fire(\"move\"); // Trigger position update\n\n// \t\t// \tconst updatePosition = () => {\n// \t\t// \t\tconst point = this.map?.latLngToContainerPoint(marker.getLatLng());\n// \t\t// \t\tconst rect = this.getBoundingClientRect();\n// \t\t// \t\tconsole.dir(rect);\n// \t\t// \t\t// console.log(point, this.map?.getBounds().getCenter().lat);\n// \t\t// \t\tif (point)\n// \t\t// \t\t\tel.style.translate = `${rect.x + point.x + window.scrollX}px ${rect.y + point.y + window.scrollY}px`;\n// \t\t// \t};\n\n// \t\t// \tupdatePosition();\n// \t}\n// })\n\n// export type Adresse = {\n// \tadressekode: number;\n// \tadressetekst: string;\n// \tbokstav: string;\n// \tbruksenhetsnummer: string[];\n// \tbruksnummer: number;\n// \tfestenummer: number;\n// \tgardsnummer: number;\n// \tkommunenavn: string;\n// \tkommunenummer: string;\n// \tnummer: number;\n// \tobjtype: string;\n// \toppdateringsdato: string;\n// \tpostnummer: string;\n// \tpoststed: string;\n// \trepresentasjonspunkt: {\n// \t\tepsg: string;\n// \t\tlat: number;\n// \t\tlon: number;\n// \t};\n// \tstedfestingverifisert: boolean;\n// \tundernummer: string | null;\n// };\n\n// // Hent punkt for adresse fra GeoNorge\n// export async function getPunktFraAdresse(\n// \tadresseSoek: string,\n// ): Promise<Adresse[]> {\n// \ttry {\n// \t\tconst response = await fetch(\n// \t\t\t`https://ws.geonorge.no/adresser/v1/sok?sok=${adresseSoek}&fuzzy=false&utkoordsys=3857&treffPerSide=100&asciiKompatibel=true`,\n// \t\t);\n// \t\tconst jsonresponse = await response.json();\n// \t\tif (jsonresponse.adresser.length > 0) {\n// \t\t\treturn jsonresponse.adresser.map((adresse: Adresse) => ({\n// \t\t\t\tadressekode: adresse.adressekode,\n// \t\t\t\tadressetekst: adresse.adressetekst,\n// \t\t\t\tbokstav: adresse.bokstav,\n// \t\t\t\tbruksenhetsnummer: adresse.bruksenhetsnummer,\n// \t\t\t\tbruksnummer: adresse.bruksnummer,\n// \t\t\t\tfestenummer: adresse.festenummer,\n// \t\t\t\tgardsnummer: adresse.gardsnummer,\n// \t\t\t\tkommunenavn: adresse.kommunenavn,\n// \t\t\t\tkommunenummer: adresse.kommunenummer,\n// \t\t\t\tnummer: adresse.nummer,\n// \t\t\t\tobjtype: adresse.objtype,\n// \t\t\t\toppdateringsdato: adresse.oppdateringsdato,\n// \t\t\t\tpostnummer: adresse.postnummer,\n// \t\t\t\tpoststed: adresse.poststed,\n// \t\t\t\trepresentasjonspunkt: {\n// \t\t\t\t\tepsg: adresse.representasjonspunkt.epsg,\n// \t\t\t\t\tlat: adresse.representasjonspunkt.lat,\n// \t\t\t\t\tlon: adresse.representasjonspunkt.lon,\n// \t\t\t\t},\n// \t\t\t}));\n// \t\t} else {\n// \t\t\treturn [];\n// \t\t}\n// \t} catch (error) {\n// \t\tconsole.log(`Feilet i å hente adresse fra punkt: ${error}`);\n// \t\treturn [];\n// \t}\n// }\n"],"names":["BOUNDS_NORWAY","TILES_COLOR","MTDSAtlasElement","MTDSElement","tag","LeafletCSS","css","div","cluster","attr","tiles","L","name","_prev","next","view","options","pos","bounds","fitWhenMarkers","latlng","IS_BROWSER","debounce"],"mappings":"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"}
@@ -0,0 +1,88 @@
1
+ const t = `:host {
2
+ --mtdsc-atlas-cluster-size: var(--mtds-8);
3
+ --mtdsc-atlas-background: #fbfbfb;
4
+ --mtdsc-atlas-border-color: var(--mtds-color-border-subtle);
5
+ --mtdsc-atlas-border: var(--mtds-border-width-default) solid
6
+ var(--mtdsc-atlas-border-color);
7
+
8
+ border-radius: var(--mtds-border-radius-md);
9
+ aspect-ratio: 2;
10
+ overflow: clip;
11
+ position: relative;
12
+ user-select: none;
13
+ }
14
+ :host(:not([hidden])) {
15
+ display: grid;
16
+ }
17
+ :host([data-cursor="pointer"]) .leaflet-grab {
18
+ cursor: pointer;
19
+ }
20
+ .leaflet-tile-container {
21
+ filter: grayscale(1) contrast(0.75) brightness(1.15);
22
+ }
23
+ :host([data-tiles="color"]) .leaflet-tile-container {
24
+ filter: grayscale(0.2);
25
+ }
26
+ :host([data-tiles="color"]) {
27
+ --mtdsc-atlas-background: #e5fcfd;
28
+ }
29
+ :host:has(.leaflet-container:focus-visible) {
30
+ box-shadow: var(--mtdsc-focus-boxShadow);
31
+ outline: var(--mtdsc-focus-outline);
32
+ outline-offset: var(--mtds-border-width-focus);
33
+ }
34
+ slot {
35
+ display: grid;
36
+ inset: var(--mtds-3);
37
+ pointer-events: none; /* Ensure slot does not stop pointer from reaching leaflet */
38
+ position: absolute;
39
+ z-index: 2;
40
+ }
41
+ ::slotted(*) {
42
+ pointer-events: all; /* But let children of slot stop pointer from reaching leaflet */
43
+ }
44
+ .leaflet-div-icon {
45
+ background: none;
46
+ border: 0;
47
+ }
48
+ .leaflet-container {
49
+ background: var(--mtdsc-atlas-background);
50
+ border-radius: inherit;
51
+ border: var(--mtdsc-atlas-border);
52
+ box-sizing: border-box;
53
+ font: inherit;
54
+ outline: 0;
55
+ }
56
+ .leaflet-control-attribution {
57
+ font-size: 12px;
58
+ border-top-left-radius: var(--mtds-border-radius-md);
59
+ }
60
+
61
+ .map-pin rect {
62
+ fill: var(--mtds-color-base-contrast-default);
63
+ }
64
+ .map-pin path {
65
+ fill: var(--mtds-color-base-default);
66
+ }
67
+
68
+ .marker-cluster {
69
+ background-color: var(--mtds-color-base-default);
70
+ border-radius: 100%;
71
+ color: var(--mtds-color-base-contrast-default);
72
+ font-weight: 500;
73
+ font-size: var(--mtds-body-xs-font-size);
74
+ line-height: var(--mtdsc-atlas-cluster-size);
75
+ text-align: center;
76
+
77
+ /* biome-ignore lint/complexity/noImportantStyles: need to overwrite style attribute */
78
+ width: var(--mtdsc-atlas-cluster-size) !important;
79
+ /* biome-ignore lint/complexity/noImportantStyles: need to overwrite style attribute */
80
+ height: var(--mtdsc-atlas-cluster-size) !important;
81
+ /* biome-ignore lint/complexity/noImportantStyles: need to overwrite style attribute */
82
+ margin: calc(var(--mtdsc-atlas-cluster-size) / -2) !important;
83
+ }
84
+ `;
85
+ export {
86
+ t as default
87
+ };
88
+ //# sourceMappingURL=atlas.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atlas.css.js","sources":["../../designsystem/atlas/atlas.css?raw"],"sourcesContent":["export default \":host {\\n\\t--mtdsc-atlas-cluster-size: var(--mtds-8);\\n\\t--mtdsc-atlas-background: #fbfbfb;\\n\\t--mtdsc-atlas-border-color: var(--ds-color-border-subtle);\\n\\t--mtdsc-atlas-border: var(--ds-border-width-default) solid\\n\\t\\tvar(--mtdsc-atlas-border-color);\\n\\n\\tborder-radius: var(--ds-border-radius-md);\\n\\taspect-ratio: 2;\\n\\toverflow: clip;\\n\\tposition: relative;\\n\\tuser-select: none;\\n}\\n:host(:not([hidden])) {\\n\\tdisplay: grid;\\n}\\n:host([data-cursor=\\\"pointer\\\"]) .leaflet-grab {\\n\\tcursor: pointer;\\n}\\n.leaflet-tile-container {\\n\\tfilter: grayscale(1) contrast(0.75) brightness(1.15);\\n}\\n:host([data-tiles=\\\"color\\\"]) .leaflet-tile-container {\\n\\tfilter: grayscale(0.2);\\n}\\n:host([data-tiles=\\\"color\\\"]) {\\n\\t--mtdsc-atlas-background: #e5fcfd;\\n}\\n:host:has(.leaflet-container:focus-visible) {\\n\\tbox-shadow: var(--dsc-focus-boxShadow);\\n\\toutline: var(--dsc-focus-outline);\\n\\toutline-offset: var(--ds-border-width-focus);\\n}\\nslot {\\n\\tdisplay: grid;\\n\\tinset: var(--mtds-3);\\n\\tpointer-events: none; /* Ensure slot does not stop pointer from reaching leaflet */\\n\\tposition: absolute;\\n\\tz-index: 2;\\n}\\n::slotted(*) {\\n\\tpointer-events: all; /* But let children of slot stop pointer from reaching leaflet */\\n}\\n.leaflet-div-icon {\\n\\tbackground: none;\\n\\tborder: 0;\\n}\\n.leaflet-container {\\n\\tbackground: var(--mtdsc-atlas-background);\\n\\tborder-radius: inherit;\\n\\tborder: var(--mtdsc-atlas-border);\\n\\tbox-sizing: border-box;\\n\\tfont: inherit;\\n\\toutline: 0;\\n}\\n.leaflet-control-attribution {\\n\\tfont-size: 12px;\\n\\tborder-top-left-radius: var(--ds-border-radius-md);\\n}\\n\\n.map-pin rect {\\n\\tfill: var(--ds-color-base-contrast-default);\\n}\\n.map-pin path {\\n\\tfill: var(--ds-color-base-default);\\n}\\n\\n.marker-cluster {\\n\\tbackground-color: var(--mtds-color-base-default);\\n\\tborder-radius: 100%;\\n\\tcolor: var(--mtds-color-base-contrast-default);\\n\\tfont-weight: 500;\\n\\tfont-size: var(--ds-body-xs-font-size);\\n\\tline-height: var(--mtdsc-atlas-cluster-size);\\n\\ttext-align: center;\\n\\n\\t/* biome-ignore lint/complexity/noImportantStyles: need to overwrite style attribute */\\n\\twidth: var(--mtdsc-atlas-cluster-size) !important;\\n\\t/* biome-ignore lint/complexity/noImportantStyles: need to overwrite style attribute */\\n\\theight: var(--mtdsc-atlas-cluster-size) !important;\\n\\t/* biome-ignore lint/complexity/noImportantStyles: need to overwrite style attribute */\\n\\tmargin: calc(var(--mtdsc-atlas-cluster-size) / -2) !important;\\n}\\n\""],"names":["css"],"mappings":"AAAA,MAAAA,IAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
@@ -0,0 +1,18 @@
1
+ import { StoryObj } from '@storybook/react-vite';
2
+ declare const meta: {
3
+ title: string;
4
+ parameters: {
5
+ layout: string;
6
+ };
7
+ };
8
+ export default meta;
9
+ type Story = StoryObj<typeof meta>;
10
+ export declare const Default: Story;
11
+ export declare const WithView: Story;
12
+ export declare const WithViewAdvanced: Story;
13
+ export declare const WithColor: Story;
14
+ export declare const WithCustomSize: Story;
15
+ export declare const WithMarker: Story;
16
+ export declare const WithClickToAddMarker: Story;
17
+ export declare const WithClustering: Story;
18
+ export declare const WithoutScrollZoom: Story;