@geoinsight/react-components 1.0.4 → 1.0.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.
Files changed (143) hide show
  1. package/.pnp.cjs +2014 -3638
  2. package/.yarn/install-state.gz +0 -0
  3. package/.yarn/unplugged/{@swc-core-linux-x64-gnu-npm-1.3.106-7bb327124d → @swc-core-linux-x64-gnu-npm-1.4.0-07735121da}/node_modules/@swc/core-linux-x64-gnu/package.json +1 -1
  4. package/.yarn/unplugged/{@swc-core-linux-x64-gnu-npm-1.3.106-7bb327124d → @swc-core-linux-x64-gnu-npm-1.4.0-07735121da}/node_modules/@swc/core-linux-x64-gnu/swc.linux-x64-gnu.node +0 -0
  5. package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/CHANGELOG.md +70 -85
  6. package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/package.json +11 -11
  7. package/dist/cjs/components/button/index.stories.d.ts +12 -9
  8. package/dist/cjs/components/map/map-mapbox.d.ts +0 -1
  9. package/dist/cjs/index.css +67 -184
  10. package/dist/cjs/index.d.ts +0 -3
  11. package/dist/cjs/index.js +47 -213
  12. package/dist/cjs/index.js.map +1 -1
  13. package/dist/esm/components/button/index.stories.d.ts +12 -9
  14. package/dist/esm/components/map/map-mapbox.d.ts +0 -1
  15. package/dist/esm/index.css +67 -184
  16. package/dist/esm/index.d.ts +0 -3
  17. package/dist/esm/index.js +49 -192
  18. package/dist/esm/index.js.map +1 -1
  19. package/package.json +1 -5
  20. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/.ready +0 -0
  21. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/LICENSE.txt +0 -116
  22. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/README.md +0 -149
  23. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/banner.ts +0 -4
  24. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/check-bundle-size.js +0 -77
  25. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/generate-debug-index-file.ts +0 -19
  26. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/generate-query-test-fixtures.ts +0 -126
  27. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/generate-shaders.ts +0 -35
  28. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/generate-struct-arrays.ts +0 -437
  29. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/generate-style-code.ts +0 -280
  30. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/generate-style-spec.ts +0 -323
  31. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/generate-typings.ts +0 -26
  32. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/readme.md +0 -52
  33. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/release-notes.js +0 -45
  34. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/rollup_plugin_minify_style_spec.ts +0 -25
  35. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/rollup_plugins.ts +0 -52
  36. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl-csp-worker.js +0 -2
  37. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl-csp-worker.js.map +0 -1
  38. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl-csp.js +0 -2
  39. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl-csp.js.map +0 -1
  40. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl-dev.js +0 -51935
  41. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl.css +0 -1
  42. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl.d.ts +0 -11736
  43. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl.js +0 -44
  44. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl.js.map +0 -1
  45. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/package.json +0 -1
  46. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/style-spec/index.d.ts +0 -1768
  47. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/package.json +0 -182
  48. package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/postinstall.js +0 -1
  49. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/.editorconfig +0 -7
  50. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/.ready +0 -0
  51. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/LICENSE +0 -21
  52. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/README.md +0 -108
  53. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/darwin/LICENSE-PVRTexToolCLI.txt +0 -52
  54. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/darwin/LICENSE-astcenc.txt +0 -137
  55. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/darwin/LICENSE-crunch.txt +0 -25
  56. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/darwin/PVRTexToolCLI +0 -0
  57. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/darwin/astcenc +0 -0
  58. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/darwin/crunch +0 -0
  59. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/linux/LICENSE-PVRTexToolCLI.txt +0 -52
  60. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/linux/LICENSE-astcenc.txt +0 -137
  61. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/linux/LICENSE-crunch.txt +0 -25
  62. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/linux/PVRTexToolCLI +0 -0
  63. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/linux/astcenc +0 -0
  64. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/linux/crunch +0 -0
  65. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/texture-compressor.js +0 -3
  66. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/win32/LICENSE-PVRTexToolCLI.txt +0 -52
  67. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/win32/LICENSE-astcenc.txt +0 -137
  68. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/win32/LICENSE-crunch.txt +0 -25
  69. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/win32/PVRTexToolCLI.exe +0 -0
  70. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/win32/astcenc.exe +0 -0
  71. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/win32/crunch.exe +0 -0
  72. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/argsHandler.js +0 -101
  73. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/argsHandler.js.map +0 -1
  74. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/compressors/compressWithCrunch.js +0 -48
  75. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/compressors/compressWithCrunch.js.map +0 -1
  76. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/compressors/compressWithPVRTexTool.js +0 -51
  77. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/compressors/compressWithPVRTexTool.js.map +0 -1
  78. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/compressors/spawnProcess.js +0 -45
  79. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/compressors/spawnProcess.js.map +0 -1
  80. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/compressors/validateArgs.js +0 -36
  81. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/compressors/validateArgs.js.map +0 -1
  82. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/constants.js +0 -85
  83. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/constants.js.map +0 -1
  84. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/index.js +0 -33
  85. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/index.js.map +0 -1
  86. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/utilities.js +0 -52
  87. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/utilities.js.map +0 -1
  88. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/package.json +0 -37
  89. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/types/lib/argsHandler.d.ts +0 -14
  90. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/types/lib/compressors/compressWithCrunch.d.ts +0 -5
  91. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/types/lib/compressors/compressWithPVRTexTool.d.ts +0 -5
  92. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/types/lib/compressors/spawnProcess.d.ts +0 -9
  93. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/types/lib/compressors/validateArgs.d.ts +0 -11
  94. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/types/lib/constants.d.ts +0 -45
  95. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/types/lib/index.d.ts +0 -5
  96. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/types/lib/utilities.d.ts +0 -43
  97. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/RECOMMENDED_PARAMETERS.md +0 -17
  98. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/SUPPORTED_DEVICES_TABLE.md +0 -47
  99. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/SUPPORTED_PARAMETERS.md +0 -154
  100. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/KTXLoader.js +0 -149
  101. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-astc-4x4.ktx +0 -0
  102. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-astc-8x8.ktx +0 -0
  103. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-dxt1.ktx +0 -0
  104. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-dxt1A.ktx +0 -0
  105. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-dxt3.ktx +0 -0
  106. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-dxt5.ktx +0 -0
  107. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-etc1.ktx +0 -0
  108. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-etc2.ktx +0 -0
  109. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-etc2A.ktx +0 -0
  110. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-pvrtc2BPP.ktx +0 -0
  111. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-pvrtc2BPPA.ktx +0 -0
  112. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-pvrtc4BPP.ktx +0 -0
  113. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-pvrtc4BPPA.ktx +0 -0
  114. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/main.js +0 -195
  115. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/index.html +0 -37
  116. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/lib/argsHandler.ts +0 -135
  117. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/lib/compressors/compressWithCrunch.ts +0 -66
  118. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/lib/compressors/compressWithPVRTexTool.ts +0 -91
  119. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/lib/compressors/spawnProcess.ts +0 -57
  120. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/lib/compressors/validateArgs.ts +0 -53
  121. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/lib/constants.ts +0 -86
  122. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/lib/index.ts +0 -37
  123. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/lib/utilities.ts +0 -57
  124. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/package.json +0 -37
  125. package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/tslint.json +0 -12
  126. /package/.yarn/unplugged/{@swc-core-linux-x64-gnu-npm-1.3.106-7bb327124d → @swc-core-linux-x64-gnu-npm-1.4.0-07735121da}/node_modules/@swc/core-linux-x64-gnu/.ready +0 -0
  127. /package/.yarn/unplugged/{@swc-core-linux-x64-gnu-npm-1.3.106-7bb327124d → @swc-core-linux-x64-gnu-npm-1.4.0-07735121da}/node_modules/@swc/core-linux-x64-gnu/README.md +0 -0
  128. /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/.ready +0 -0
  129. /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/LICENSE +0 -0
  130. /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/README.md +0 -0
  131. /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/Visitor.d.ts +0 -0
  132. /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/Visitor.js +0 -0
  133. /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/binding.d.ts +0 -0
  134. /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/binding.js +0 -0
  135. /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/bindings/README.md +0 -0
  136. /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/bindings/binding_core_wasm/package.json +0 -0
  137. /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/index.d.ts +0 -0
  138. /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/index.js +0 -0
  139. /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/postinstall.js +0 -0
  140. /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/spack.d.ts +0 -0
  141. /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/spack.js +0 -0
  142. /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/util.d.ts +0 -0
  143. /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/util.js +0 -0
@@ -53,6 +53,9 @@
53
53
  cubic-bezier(0.1, 0.2, 0.3, 0.4);
54
54
  --transition-box-shadow-cubic-bezier: box-shadow 500ms
55
55
  cubic-bezier(0.1, 0.2, 0.3, 0.4);
56
+ --transition-border-cubic-bezier: border 250ms
57
+ cubic-bezier(0.1, 0.2, 0.3, 0.4);
58
+
56
59
 
57
60
  --color-dark-base: #2e3440;
58
61
  --color-dark-bright: #3b4252;
@@ -323,7 +326,8 @@ h6 {
323
326
  background-color: var(--color-primary-darker);
324
327
  }
325
328
 
326
- .button {
329
+ .button,
330
+ .link {
327
331
  align-items: center;
328
332
  border-radius: var(--spacing-32);
329
333
  border: none;
@@ -353,19 +357,46 @@ h6 {
353
357
  var(--transition-box-shadow-cubic-bezier);
354
358
  }
355
359
 
356
- .button__link {
360
+
361
+ .button__primary {
362
+ background-color: var(--color-primary-bright);
363
+ border: 3px solid var(--color-primary-base);
364
+ }
365
+
366
+ .button__secondary,
367
+ .link__secondary {
368
+ background-color: var(--color-main-background);
369
+ border: 3px solid var(--color-primary-base);
370
+ border-radius: var(--spacing-32);
371
+ text-decoration: unset;
372
+ }
373
+
374
+ .button__secondary:hover {
375
+ box-shadow: unset;
376
+ border: 3px solid var(--color-primary-base);
377
+ }
378
+
379
+ .button__icon {
380
+ background-color: var(--color-primary-bright);
381
+ }
382
+
383
+ .button__icon:hover {
384
+ border: unset;
385
+ }
386
+
387
+ .link__primary {
357
388
  background-color: unset !important;
358
389
  color: var(--color-primary-base) !important;
359
390
  text-decoration: underline 1px var(--color-primary-base);
360
391
  text-underline-offset: var(--spacing-4);
361
392
  }
362
393
 
363
- [data-theme="light"] .button__link {
394
+ [data-theme="light"] .link__primary {
364
395
  color: var(--color-primary-darker) !important;
365
396
  text-decoration: underline 1px var(--color-primary-darker);
366
397
  }
367
398
 
368
- .button__link:hover {
399
+ .link__primary:hover {
369
400
  border: unset;
370
401
  box-shadow: unset;
371
402
  color: var(--color-primary-dark) !important;
@@ -375,29 +406,48 @@ h6 {
375
406
  var(--transition-text-underline-offset-cubic-bezier);
376
407
  }
377
408
 
378
- .button__primary {
379
- background-color: var(--color-primary-bright);
409
+ .link__secondary:hover {
410
+ background-color: var(--color-primary-dark);
380
411
  border: 3px solid var(--color-primary-base);
412
+ box-shadow: unset;
413
+ transition: var(--transition-bg-cubic-bezier),
414
+ var(--transition-box-shadow-cubic-bezier);
381
415
  }
382
416
 
383
- .button__secondary {
384
- background-color: var(--color-main-background);
385
- border: 3px solid var(--color-primary-base);
386
- border-radius: var(--spacing-32);
387
- text-decoration: unset;
417
+ .link__icon {
418
+ background-color: unset !important;
419
+ color: var(--color-primary-base) !important;
388
420
  }
389
421
 
390
- .button__secondary:hover {
391
- box-shadow: unset;
392
- border: 3px solid var(--color-primary-base);
422
+ .link > a {
423
+ text-decoration: inherit;
424
+ color: inherit;
393
425
  }
394
426
 
395
- .button__icon {
396
- background-color: var(--color-primary-bright);
427
+ .link__icon svg {
428
+ border: 2px solid transparent;
429
+ border-bottom: 2px solid var(--color-primary-base);
430
+ border-radius: 2px;
431
+ padding: var(--spacing-4);
397
432
  }
398
433
 
399
- .button__icon:hover {
434
+ [data-theme="light"] .link__icon {
435
+ color: var(--color-primary-darker) !important;
436
+ }
437
+
438
+ [data-theme="light"] .link__icon svg {
439
+ border-bottom: 2px solid var(--color-primary-darker);
440
+ }
441
+
442
+ .link__icon:hover {
400
443
  border: unset;
444
+ box-shadow: unset;
445
+ }
446
+
447
+ .link__icon:hover svg {
448
+ color: var(--color-main-color) !important;
449
+ border: 2px solid var(--color-primary-dark);
450
+ transition: var(--transition-color-cubic-bezier), var(--transition-border-cubic-bezier);
401
451
  }
402
452
 
403
453
  .button__small {
@@ -412,11 +462,6 @@ h6 {
412
462
  padding: var(--spacing-16);
413
463
  }
414
464
 
415
- .button__link > a {
416
- text-decoration: inherit;
417
- color: inherit;
418
- }
419
-
420
465
  .button__icon.button__medium {
421
466
  padding: var(--spacing-8) var(--spacing-12);
422
467
  }
@@ -797,165 +842,3 @@ h6 {
797
842
  .modal__footer {
798
843
  padding-bottom: var(--spacing-16);
799
844
  }
800
-
801
- .map {
802
- position: relative;
803
- height: 100%;
804
- }
805
-
806
- .map__attribution {
807
- display: flex;
808
- flex-direction: row;
809
- gap: var(--spacing-4);
810
- position: absolute;
811
- right: 0;
812
- bottom: 0;
813
- }
814
-
815
- .map__attribution a {
816
- font-size: var(--font-size-12);
817
- padding: 0 var(--spacing-8) 0 0;
818
- }
819
-
820
- .map__attribution a:hover {
821
- text-underline-offset: var(--spacing-4);
822
- }
823
-
824
- .map__button.button {
825
- padding: var(--spacing-8) !important;
826
- }
827
- .map__mapbox-error {
828
- color: var(--color-danger);
829
- }
830
-
831
- .map__popup {
832
- background-color: var(--color-main-color);
833
- border-radius: var(--spacing-8);
834
- color: var(--color-main-background);
835
- padding: var(--spacing-4);
836
- position: absolute;
837
- }
838
-
839
- .map__popup-content {
840
- border: 1px solid var(--color-main-background);
841
- border-radius: var(--spacing-8);
842
- display: flex;
843
- flex-direction: row;
844
- gap: var(--spacing-8);
845
- padding: var(--spacing-8);
846
- }
847
-
848
- .map__popup-list {
849
- border-radius: var(--spacing-8);
850
- display: flex;
851
- flex-direction: column;
852
- gap: var(--spacing-8);
853
- }
854
-
855
- .map__popup-list > h5 {
856
- margin: unset;
857
- }
858
-
859
- /* .map__tip {
860
- display: flex;
861
- align-self: center;
862
- border: 10px solid transparent;
863
- border-bottom-color: var(--color-main-color) !important;
864
- border-top: none;
865
- flex-direction: column;
866
- height: 0;
867
- width: 0;
868
- z-index: 1;
869
- } */
870
-
871
- .mapboxgl-popup-tip {
872
- border-bottom-color: var(--color-main-color) !important;
873
- }
874
-
875
- .mapboxgl-popup-content {
876
- background-color: var(--color-main-color) !important;
877
- border: 1px solid var(--color-main-background) !important;
878
- border-radius: var(--spacing-8) !important;
879
- color: var(--color-main-background) !important;
880
- display: flex !important;
881
- flex-direction: row !important;
882
- gap: var(--spacing-8) !important;
883
- padding: var(--spacing-8) !important;
884
- }
885
-
886
- .mapboxgl-popup-close-button {
887
- border-radius: var(--spacing-32) !important;
888
- background-color: var(--color-primary-dark) !important;
889
- top: -16px !important;
890
- right: -16px !important;
891
- }
892
-
893
- .mapboxgl-popup-close-button:hover {
894
- background-color: var(--color-primary-dark);
895
- box-shadow: 2px 4px 6px 0 var(--color-primary-base);
896
- transition: var(--transition-bg-cubic-bezier),
897
- var(--transition-box-shadow-cubic-bezier);
898
- }
899
-
900
- .control {
901
- color: var(--color-main-background);
902
- display: flex;
903
- flex-direction: column;
904
- gap: var(--spacing-8);
905
- position: absolute;
906
- /* margin: var(--spacing-4); */
907
- }
908
-
909
- .control--top-left {
910
- padding: var(--spacing-8) 0 0 var(--spacing-8);
911
- top: 0;
912
- }
913
-
914
- .control--top-right {
915
- align-items: end;
916
- padding: var(--spacing-8) var(--spacing-8) 0 0;
917
- right: 0;
918
- top: 0;
919
- }
920
-
921
- .control--bottom-left {
922
- bottom: 0;
923
- padding: 0 0 var(--spacing-32) var(--spacing-8);
924
- }
925
-
926
- .control--bottom-right {
927
- align-items: end;
928
- bottom: 0;
929
- padding: 0 var(--spacing-8) var(--spacing-32) 0;
930
- right: 0;
931
- }
932
-
933
- .control--top-center {
934
- left: 40%;
935
- padding-top: var(--spacing-8);
936
- top: 0;
937
- }
938
-
939
- .control--center-left {
940
- left: 0;
941
- padding-left: var(--spacing-8);
942
- top: 40%;
943
- }
944
-
945
- .control--center {
946
- left: 50%;
947
- top: 50%;
948
- }
949
-
950
- .control--center-right {
951
- padding-right: var(--spacing-8);
952
- right: 0;
953
- top: 40%;
954
- }
955
-
956
- .control--bottom-center {
957
- bottom: 0;
958
- left: 40%;
959
- padding-bottom: var(--spacing-8);
960
- top: auto;
961
- }
@@ -10,9 +10,6 @@ export { Loading } from "./components/loading";
10
10
  export { Modal } from "./components/modal";
11
11
  export { Select } from "./components/select";
12
12
  export { TextArea } from "./components/text-area";
13
- export { MapComponent } from "./components/map";
14
- export { MapControl } from "./components/map-control";
15
13
  export { LoadingContext, LoadingProvider, useLoading } from "./context/loading";
16
14
  export { ModalContext, ModalProvider, useModal } from "./context/modal";
17
15
  export { ThemeContext, ThemeProvider, useTheme } from "./context/theme";
18
- export { MapProvider, useMap } from "./context/map";
package/dist/esm/index.js CHANGED
@@ -2,16 +2,10 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { useMemo, Children, isValidElement, cloneElement, createContext, useState, useContext, useRef, useEffect, useReducer } from 'react';
3
3
  import clsx from 'clsx';
4
4
  import { TfiAngleDown, TfiAngleUp } from 'react-icons/tfi';
5
- import { BsCheckCircleFill, BsXCircleFill, BsFillMoonFill, BsFillSunFill } from 'react-icons/bs';
5
+ import { BsCheckCircleFill, BsXCircleFill } from 'react-icons/bs';
6
6
  import { useForm, FormProvider, useFormContext, Controller } from 'react-hook-form';
7
7
  import { TbArrowsDiagonal2 } from 'react-icons/tb';
8
8
  import { IoClose } from 'react-icons/io5';
9
- import DeckGL from '@deck.gl/react/typed';
10
- import * as Layers from '@deck.gl/layers';
11
- import { Popup, Map, Source, Layer } from 'react-map-gl';
12
- import maplibregl from 'maplibre-gl';
13
- import { FiSun, FiMoon } from 'react-icons/fi';
14
- import 'mapbox-gl/dist/mapbox-gl.css';
15
9
 
16
10
  const ALLOWED_CHILD_COMPONENT$1 = ["MenuItem"];
17
11
  function MenuWrapper({ children }) {
@@ -63,7 +57,7 @@ const Anchor = ({ Custom, children, ...rest }) => {
63
57
  return Custom ? (jsx(Custom, { ...rest, children: children })) : (jsx("a", { ...rest, children: children }));
64
58
  };
65
59
  function Button({ children = "Click me", className = "", icon = undefined, isNewWindow = false, mode = "primary", size = "medium", as = "button", CustomAnchor, ...rest }) {
66
- return as === "link" ? (jsxs(Anchor, { Custom: CustomAnchor, ...(isNewWindow && { target: "_blank" }), className: clsx(`button ${className}`, mode === "secondary" ? `button__${mode}` : "button__link", `button__${size}`), ...rest, children: [children, icon] })) : (jsxs("button", { className: clsx("button", `button__${mode}`, `button__${size}`, className), ...rest, children: [children, icon] }));
60
+ return as === "link" ? (jsxs(Anchor, { Custom: CustomAnchor, ...(isNewWindow && { target: "_blank" }), className: clsx(`button ${className}`, `link__${mode}`, `button__${size}`), ...rest, children: [children, icon] })) : (jsxs("button", { className: clsx("button", `button__${mode}`, `button__${size}`, className), ...rest, children: [children, icon] }));
67
61
  }
68
62
 
69
63
  function MenuButton({ anchor, children, buttonClassName, nested, subnested, dropdown, isLink, isSelected, handleCallbackClick, ...props }) {
@@ -296,189 +290,6 @@ function Modal({ className, modalref, children, title, subtitle, footer, hasOver
296
290
  return (jsxs(Fragment, { children: [hasOverlay && jsx("div", { className: "modal-overlay" }), jsxs("div", { ref: modalref, className: clsx("modal", className), ...rest, children: [hasCloseButton && (jsx(Button, { mode: "secondary", className: "modal__close", size: "small", onClick: handleClose, children: jsx(IoClose, {}) })), jsxs("div", { className: "modal__content", children: [title && (jsxs("div", { className: "modal__header", children: [jsx("h3", { children: title }), jsx("h6", { children: subtitle })] })), jsx("div", { className: "modal__children", children: children }), footer && jsx("div", { className: "modal__footer", children: footer })] })] })] }));
297
291
  }
298
292
 
299
- const ThemeContext = createContext(undefined);
300
- function ThemeProvider({ children, dataTheme: dataThemeProp, dataPalette: dataPaletteProp = "water", }) {
301
- const [dataTheme, setDataTheme] = useState();
302
- const [dataPalette, setDataPalette] = useState();
303
- useEffect(() => {
304
- if (dataPaletteProp) {
305
- switchDataPalette(dataPaletteProp);
306
- }
307
- }, [dataPaletteProp]);
308
- useEffect(() => {
309
- if (dataThemeProp) {
310
- switchDataTheme(dataThemeProp);
311
- }
312
- }, [dataThemeProp]);
313
- useEffect(() => {
314
- if (window.matchMedia) {
315
- if (localStorage.getItem("data-theme")) {
316
- document.documentElement.setAttribute("data-theme", localStorage.getItem("data-theme"));
317
- setDataTheme(localStorage.getItem("data-theme"));
318
- }
319
- else if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
320
- document.documentElement.setAttribute("data-theme", "dark");
321
- setDataTheme("dark");
322
- }
323
- }
324
- }, []);
325
- const switchDataTheme = (mode) => {
326
- document.documentElement.setAttribute("data-theme", mode);
327
- setDataTheme(mode);
328
- localStorage.setItem("data-theme", mode);
329
- };
330
- const switchDataPalette = (mode) => {
331
- document.documentElement.setAttribute("data-palette", mode);
332
- setDataPalette(mode);
333
- localStorage.setItem("palette-theme", mode);
334
- };
335
- return (jsx(ThemeContext.Provider, { value: { dataTheme, switchDataTheme, dataPalette, switchDataPalette }, children: children }));
336
- }
337
- function useTheme() {
338
- const context = useContext(ThemeContext);
339
- if (context === undefined) {
340
- throw new Error("useTheme must be used within a ThemeProvider");
341
- }
342
- return context;
343
- }
344
-
345
- function MapControl({ children, position = "top-right", ...rest }) {
346
- return (jsx("div", { className: `control control--${position}`, ...rest, children: children }));
347
- }
348
-
349
- function MapToc({ items, selected, setSelected }) {
350
- return (jsx(Menu.Root, { children: Object.entries(items).map(([parentId, parent], index) => (jsxs(Menu.Item, { children: [jsx(Menu.Button, { dropdown: true, children: parent.title }), jsx(Menu.Content, { children: Object.entries(parent.children).map(([childId, child], index) => (jsx(Menu.Item, { children: jsx(Menu.Button, { isSelected: childId === selected.id, nested: true, handleCallbackClick: () => setSelected({ id: childId, ...child }), children: child.label }) }))) })] }, `first-level-${index}`))) }));
351
- }
352
-
353
- /** Context */
354
- const MapContext = createContext(undefined);
355
- function MapProvider({ children }) {
356
- const [currentLayer, setCurrentLayer] = useState(undefined);
357
- return (jsx(MapContext.Provider, { value: { state: { currentLayer }, setCurrentLayer }, children: children }));
358
- }
359
- function useMap({ defaultLayer }) {
360
- const context = useContext(MapContext);
361
- useEffect(() => {
362
- if (context) {
363
- context.setCurrentLayer(defaultLayer);
364
- }
365
- }, []);
366
- if (context === undefined) {
367
- throw new Error("useMap must be used within a MapProvider");
368
- }
369
- return context;
370
- }
371
-
372
- const DefaultPopup = ({ popup }) => {
373
- const { isDefault, data, render } = popup.model;
374
- return isDefault || true ? (jsxs("div", { className: "map__popup-content", children: [jsx("div", { className: "map__popup-list", children: data.fields.map((field) => (jsxs("h5", { children: [field, ":"] }))) }), jsx("div", { className: "map__popup-list", children: data.values.map((value) => (jsx("span", { children: typeof value === "string"
375
- ? new Function("v", `return (${value})(${JSON.stringify(popup.info)})`)()
376
- : value(popup.info) }))) })] })) : (render);
377
- };
378
- const MapPopup = ({ popup, framework = "deck.gl", setPopupData, longitude, latitude, }) => {
379
- return framework === "deck.gl" ? (jsx("div", { className: "map__popup", style: { left: longitude, top: latitude }, children: jsx(DefaultPopup, { popup: popup }) })) : (jsx(Popup, { anchor: "top", longitude: Number(longitude), latitude: Number(latitude), onClose: () => setPopupData && setPopupData(undefined), children: jsx(DefaultPopup, { popup: popup }) }));
380
- };
381
-
382
- const INITIAL_VIEW_STATE = {
383
- longitude: -122.41669,
384
- latitude: 37.7853,
385
- zoom: 13,
386
- pitch: 0,
387
- bearing: 0,
388
- };
389
- function MapDeckgl({ attribution, basemap, basemapToken, initialViewState, hasSwitchBasemap = true, layers, mapProps, renderControls = {}, toc, }) {
390
- // @ts-ignore
391
- const { onClick, ...restMapProps } = mapProps;
392
- const theme = useTheme();
393
- const [lngLat, setLngLat] = useState();
394
- const [popupData, setPopupData] = useState();
395
- const _layers = layers &&
396
- useMemo(() => layers.map(({ type, layer }) => new Layers[type](layer)), []);
397
- const { "bottom-left": bottomLeft, "center-left": centerLeft, ..._controls } = renderControls;
398
- const mapContext = toc &&
399
- useMap({
400
- defaultLayer: {
401
- id: toc.defaultIds[1],
402
- ...toc?.parents[toc.defaultIds[0]].children[toc.defaultIds[1]],
403
- },
404
- });
405
- const handleToggle = () => {
406
- theme.switchDataTheme(theme.dataTheme === "dark" ? "light" : "dark");
407
- };
408
- const handeSelectedLayer = (layer) => {
409
- mapContext.setCurrentLayer(layer);
410
- };
411
- const handleClick = (event) => {
412
- if (event.object) {
413
- if (event.layer?.props?.popup) {
414
- setPopupData({ model: event.layer?.props.popup, info: event.object });
415
- }
416
- setLngLat([event.pixel[0], event.pixel[1]]);
417
- }
418
- else {
419
- setLngLat(undefined);
420
- }
421
- if (onClick) {
422
- onClick(event);
423
- }
424
- };
425
- return (jsxs("div", { className: "map", children: [jsxs(DeckGL, { initialViewState: initialViewState || INITIAL_VIEW_STATE, controller: true, layers: _layers, onClick: handleClick, ...restMapProps, children: [jsx(Map, { attributionControl: false, mapLib: maplibregl, mapStyle: basemap || theme.dataTheme === "dark"
426
- ? `https://api.maptiler.com/maps/darkmatter/style.json?key=${basemapToken || process.env.STORYBOOK_OPEN_TILES_TOKEN}`
427
- : `https://api.maptiler.com/maps/positron/style.json?key=${basemapToken || process.env.STORYBOOK_OPEN_TILES_TOKEN}` }), Object.keys(_controls).map((key) => {
428
- // @ts-ignore
429
- return jsx(MapControl, { position: key, children: _controls[key] });
430
- }), jsxs(MapControl, { position: "center-left", children: [centerLeft, mapContext?.state.currentLayer && (jsx(MapToc, { items: toc.parents, selected: mapContext.state.currentLayer, setSelected: handeSelectedLayer }))] }), jsx(MapControl, { position: "bottom-left", children: hasSwitchBasemap ? (jsxs(Fragment, { children: [bottomLeft, jsx(Button, { mode: "icon", size: "small", onClick: handleToggle, children: theme.dataTheme === "dark" ? (jsx(FiSun, { size: "1.25rem" })) : (jsx(FiMoon, { size: "1.25rem", color: "var(--color-black)" })) })] })) : (bottomLeft) }), jsx("div", { className: "map__attribution", children: attribution || (jsxs(Fragment, { children: [jsx(Button, { as: "link", href: "https://www.maptiler.com/copyright/", target: "_blank", children: "\u00A9 MapTiler" }), jsx(Button, { as: "link", href: "https://www.openstreetmap.org/copyright", target: "_blank", children: "\u00A9 OpenStreetMap contributors" })] })) })] }), popupData && lngLat && (jsx(MapPopup, { longitude: lngLat[0], latitude: lngLat[1],
431
- // framework="deck.gl"
432
- popup: popupData }))] }));
433
- }
434
-
435
- function MapMapbox({ basemap, mapProps, hasSwitchBasemap, hasSwitchProjection, renderControls, sources, toc, }) {
436
- // @ts-ignore
437
- const { onClick, ...restMapProps } = mapProps;
438
- const { dataTheme, switchDataTheme } = useTheme();
439
- const [projection, setProjection] = useState("globe");
440
- const { "bottom-left": bottomLeft, "center-left": centerLeft, ..._controls } = renderControls;
441
- const [popupData, setPopupData] = useState();
442
- const [lngLat, setLngLat] = useState();
443
- const mapContext = toc &&
444
- useMap({
445
- defaultLayer: {
446
- id: toc.defaultIds[1],
447
- ...toc?.parents[toc.defaultIds[0]].children[toc.defaultIds[1]],
448
- },
449
- });
450
- const handeSelectedLayer = (layer) => {
451
- mapContext.setCurrentLayer(layer);
452
- };
453
- const handleClick = (event) => {
454
- const { features, point: { x, y }, lngLat: { lng, lat }, } = event;
455
- const hoveredFeature = features && features[0];
456
- if (hoveredFeature) {
457
- setPopupData({
458
- model: hoveredFeature.layer.metadata["mapbox:popup"],
459
- info: hoveredFeature,
460
- });
461
- setLngLat([lng, lat]);
462
- }
463
- if (onClick) {
464
- onClick(event);
465
- }
466
- };
467
- return mapProps?.mapboxAccessToken ? (jsx(Fragment, { children: jsxs(Map, { mapboxAccessToken: mapProps.mapboxAccessToken, projection: projection, mapStyle: basemap ||
468
- `mapbox://styles/mapbox/${dataTheme === "dark" ? "light" : "dark"}-v11`, ...((mapProps.interactiveLayerIds && { onClick: handleClick }) ||
469
- (onClick && { onClick })), ...restMapProps, children: [sources &&
470
- sources.map(({ id, layers, ...restSource }) => (
471
- // @ts-ignore
472
- jsx(Source, { id: id, ...restSource, children: layers && layers.map((layer) => jsx(Layer, { ...layer })) }))), Object.keys(_controls).map((key) => {
473
- // @ts-ignore
474
- return jsx(MapControl, { position: key, children: _controls[key] });
475
- }), jsxs(MapControl, { position: "center-left", children: [centerLeft, mapContext?.state.currentLayer && (jsx(MapToc, { items: toc.parents, selected: mapContext.state.currentLayer, setSelected: handeSelectedLayer }))] }), jsxs(MapControl, { position: "bottom-left", children: [bottomLeft, hasSwitchBasemap && (jsx(Button, { className: "map__button", mode: "icon", onClick: () => switchDataTheme(dataTheme === "dark" ? "light" : "dark"), children: dataTheme === "dark" ? jsx(BsFillMoonFill, {}) : jsx(BsFillSunFill, {}) })), hasSwitchProjection && (jsx(Button, { className: "map__button", mode: "icon", onClick: () => setProjection((prev) => prev === "globe" ? "mercator" : "globe"), children: projection === "globe" ? "2D" : "3D" }))] }), popupData && lngLat && (jsx(MapPopup, { longitude: lngLat[0], latitude: lngLat[1], framework: "mapboxgl", setPopupData: setPopupData, popup: popupData }))] }) })) : (jsx(Modal, { hasCloseButton: false, children: jsx("p", { className: "map__mapbox-error", children: "You need to add the mapbox token to the prop mapboxAccessToken." }) }));
476
- }
477
-
478
- function MapComponent({ attribution, basemap, basemapToken, framework = "deck.gl", mapProps, hasSwitchBasemap = true, hasSwitchProjection = true, layers, renderControls = {}, sources, toc, }) {
479
- return framework === "deck.gl" ? (jsx(MapDeckgl, { attribution: attribution, basemap: basemap, basemapToken: basemapToken, hasSwitchBasemap: hasSwitchBasemap, layers: layers, mapProps: mapProps, renderControls: renderControls, toc: toc })) : framework === "mapboxgl" ? (jsx(MapMapbox, { basemap: basemap, hasSwitchBasemap: hasSwitchBasemap, hasSwitchProjection: hasSwitchProjection, mapProps: mapProps, renderControls: renderControls, sources: sources, toc: toc })) : (jsx("div", { children: "The component needs a framework" }));
480
- }
481
-
482
293
  const LoadingContext = createContext(undefined);
483
294
  function loadingReducer(state, action) {
484
295
  switch (action.type) {
@@ -610,5 +421,51 @@ function useModal({} = {}) {
610
421
  return context;
611
422
  }
612
423
 
613
- export { Button, Form, FormInput, FormSelect, FormTextArea, Input, Loading, LoadingContext, LoadingProvider, MapComponent, MapControl, MapProvider, Menu, Modal, ModalContext, ModalProvider, Select, TextArea, ThemeContext, ThemeProvider, useLoading, useMap, useModal, useTheme };
424
+ const ThemeContext = createContext(undefined);
425
+ function ThemeProvider({ children, dataTheme: dataThemeProp, dataPalette: dataPaletteProp = "water", }) {
426
+ const [dataTheme, setDataTheme] = useState();
427
+ const [dataPalette, setDataPalette] = useState();
428
+ useEffect(() => {
429
+ if (dataPaletteProp) {
430
+ switchDataPalette(dataPaletteProp);
431
+ }
432
+ }, [dataPaletteProp]);
433
+ useEffect(() => {
434
+ if (dataThemeProp) {
435
+ switchDataTheme(dataThemeProp);
436
+ }
437
+ }, [dataThemeProp]);
438
+ useEffect(() => {
439
+ if (window.matchMedia) {
440
+ if (localStorage.getItem("data-theme")) {
441
+ document.documentElement.setAttribute("data-theme", localStorage.getItem("data-theme"));
442
+ setDataTheme(localStorage.getItem("data-theme"));
443
+ }
444
+ else if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
445
+ document.documentElement.setAttribute("data-theme", "dark");
446
+ setDataTheme("dark");
447
+ }
448
+ }
449
+ }, []);
450
+ const switchDataTheme = (mode) => {
451
+ document.documentElement.setAttribute("data-theme", mode);
452
+ setDataTheme(mode);
453
+ localStorage.setItem("data-theme", mode);
454
+ };
455
+ const switchDataPalette = (mode) => {
456
+ document.documentElement.setAttribute("data-palette", mode);
457
+ setDataPalette(mode);
458
+ localStorage.setItem("palette-theme", mode);
459
+ };
460
+ return (jsx(ThemeContext.Provider, { value: { dataTheme, switchDataTheme, dataPalette, switchDataPalette }, children: children }));
461
+ }
462
+ function useTheme() {
463
+ const context = useContext(ThemeContext);
464
+ if (context === undefined) {
465
+ throw new Error("useTheme must be used within a ThemeProvider");
466
+ }
467
+ return context;
468
+ }
469
+
470
+ export { Button, Form, FormInput, FormSelect, FormTextArea, Input, Loading, LoadingContext, LoadingProvider, Menu, Modal, ModalContext, ModalProvider, Select, TextArea, ThemeContext, ThemeProvider, useLoading, useModal, useTheme };
614
471
  //# sourceMappingURL=index.js.map