@k2b/ui 0.42.0 → 0.43.0

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,21 @@
1
+ import { type JSX } from "solid-js";
2
+ export type CountryMapDatum = {
3
+ /** ISO 3166-1 alpha-2 code. Other values appear neither on the map nor in the list. */
4
+ code: string;
5
+ value: number;
6
+ };
7
+ export type CountryMapProps = {
8
+ data: readonly CountryMapDatum[];
9
+ /** Accessible name of the map, such as the panel title. */
10
+ label: string;
11
+ format?: (value: number) => string;
12
+ /** How many countries the ranked list names. */
13
+ limit?: number;
14
+ class?: string;
15
+ };
16
+ /**
17
+ * A world map that shades countries by one value, with a ranked list that names the same numbers.
18
+ * The geometry ships with the component, so the map makes no network request.
19
+ * @example <CountryMap label="Visitors" data={[{ code: "DE", value: 1200 }, { code: "FR", value: 300 }]} />
20
+ */
21
+ export declare function CountryMap(props: CountryMapProps): JSX.Element;
@@ -0,0 +1,6 @@
1
+ export declare const WORLD_MAP_VIEW_WIDTH = 1000;
2
+ export declare const WORLD_MAP_VIEW_HEIGHT = 450;
3
+ /** ISO 3166-1 alpha-2 code and SVG path. */
4
+ export declare const WORLD_COUNTRY_SHAPES: readonly (readonly [string, string])[];
5
+ /** Countries too small for a shape: ISO 3166-1 alpha-2 code, x and y. */
6
+ export declare const WORLD_COUNTRY_DOTS: readonly (readonly [string, number, number])[];
@@ -0,0 +1,2 @@
1
+ /** A separate entry because the country shapes weigh about 90 KB; load it only where a map appears. */
2
+ export { CountryMap, type CountryMapDatum, type CountryMapProps } from "./content/CountryMap";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k2b/ui",
3
- "version": "0.42.0",
3
+ "version": "0.43.0",
4
4
  "description": "Production-ready components for SolidJS applications.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -36,6 +36,12 @@
36
36
  "browser": "./dist/browser/charts.js",
37
37
  "default": "./dist/ssr/charts.js"
38
38
  },
39
+ "./country-map": {
40
+ "types": "./dist/types/country-map.d.ts",
41
+ "browser": "./dist/browser/country-map.js",
42
+ "import": "./dist/ssr/country-map.js",
43
+ "default": "./dist/ssr/country-map.js"
44
+ },
39
45
  "./package.json": "./package.json",
40
46
  "./map-glyphs/*": "./map-glyphs/*",
41
47
  "./text-editor": {