@ztwoint/z-ui 0.1.122 → 0.1.123
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/dist/components/table/components/cell/avatar-cell.js +13 -6
- package/dist/components/table/table-provider.js +7 -0
- package/dist/components/table-card/table-card.js +52 -45
- package/dist/components/z2map/components/index.d.ts +5 -0
- package/dist/components/z2map/components/map-controls.d.ts +12 -0
- package/dist/components/z2map/components/map-controls.js +29 -0
- package/dist/components/z2map/components/map-empty-state.d.ts +2 -0
- package/dist/components/z2map/components/map-empty-state.js +10 -0
- package/dist/components/z2map/components/map-loading-state.d.ts +8 -0
- package/dist/components/z2map/components/map-loading-state.js +45 -0
- package/dist/components/z2map/components/map-pin-content.d.ts +8 -0
- package/dist/components/z2map/components/map-pin-content.js +27 -0
- package/dist/components/z2map/components/map-pin.d.ts +19 -0
- package/dist/components/z2map/components/map-pin.js +116 -0
- package/dist/components/z2map/components/map-style-control.d.ts +8 -0
- package/dist/components/z2map/components/map-style-control.js +45 -0
- package/dist/components/z2map/components/map-zoom-control.d.ts +8 -0
- package/dist/components/z2map/components/map-zoom-control.js +49 -0
- package/dist/components/z2map/index.d.ts +9 -0
- package/dist/components/z2map/map.constants.d.ts +47 -0
- package/dist/components/z2map/map.constants.js +40 -0
- package/dist/components/z2map/map.d.ts +4 -0
- package/dist/components/z2map/map.hook.d.ts +33 -0
- package/dist/components/z2map/map.hook.js +99 -0
- package/dist/components/z2map/map.js +161 -0
- package/dist/components/z2map/map.type.d.ts +45 -0
- package/dist/components/z2map/map.utils.d.ts +10 -0
- package/dist/components/z2map/map.utils.js +37 -0
- package/dist/css/node_modules/mapbox-gl/dist/mapbox-gl.css +1 -0
- package/dist/css/styles/tailwind.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +128 -112
- package/dist/node_modules/@vis.gl/react-mapbox/dist/components/attribution-control.js +12 -0
- package/dist/node_modules/@vis.gl/react-mapbox/dist/components/fullscreen-control.js +12 -0
- package/dist/node_modules/@vis.gl/react-mapbox/dist/components/geolocate-control.js +30 -0
- package/dist/node_modules/@vis.gl/react-mapbox/dist/components/map.js +54 -0
- package/dist/node_modules/@vis.gl/react-mapbox/dist/components/marker.js +56 -0
- package/dist/node_modules/@vis.gl/react-mapbox/dist/components/navigation-control.js +12 -0
- package/dist/node_modules/@vis.gl/react-mapbox/dist/components/popup.js +35 -0
- package/dist/node_modules/@vis.gl/react-mapbox/dist/components/scale-control.js +14 -0
- package/dist/node_modules/@vis.gl/react-mapbox/dist/components/use-control.js +14 -0
- package/dist/node_modules/@vis.gl/react-mapbox/dist/components/use-map.js +6 -0
- package/dist/node_modules/@vis.gl/react-mapbox/dist/mapbox/create-ref.js +77 -0
- package/dist/node_modules/@vis.gl/react-mapbox/dist/mapbox/mapbox.js +315 -0
- package/dist/node_modules/@vis.gl/react-mapbox/dist/mapbox/proxy-transform.js +35 -0
- package/dist/node_modules/@vis.gl/react-mapbox/dist/utils/apply-react-style.js +13 -0
- package/dist/node_modules/@vis.gl/react-mapbox/dist/utils/compare-class-names.js +16 -0
- package/dist/node_modules/@vis.gl/react-mapbox/dist/utils/deep-equal.js +33 -0
- package/dist/node_modules/@vis.gl/react-mapbox/dist/utils/set-globals.js +18 -0
- package/dist/node_modules/@vis.gl/react-mapbox/dist/utils/style-utils.js +25 -0
- package/dist/node_modules/@vis.gl/react-mapbox/dist/utils/transform.js +40 -0
- package/dist/node_modules/@vis.gl/react-mapbox/dist/utils/use-isomorphic-layout-effect.js +5 -0
- package/dist/routes/map.d.ts +2 -0
- package/dist/types/components/z2map/components/index.d.ts +5 -0
- package/dist/types/components/z2map/components/map-controls.d.ts +12 -0
- package/dist/types/components/z2map/components/map-empty-state.d.ts +2 -0
- package/dist/types/components/z2map/components/map-loading-state.d.ts +8 -0
- package/dist/types/components/z2map/components/map-pin-content.d.ts +8 -0
- package/dist/types/components/z2map/components/map-pin.d.ts +19 -0
- package/dist/types/components/z2map/components/map-style-control.d.ts +8 -0
- package/dist/types/components/z2map/components/map-zoom-control.d.ts +8 -0
- package/dist/types/components/z2map/index.d.ts +9 -0
- package/dist/types/components/z2map/map.constants.d.ts +47 -0
- package/dist/types/components/z2map/map.d.ts +5 -0
- package/dist/types/components/z2map/map.hook.d.ts +33 -0
- package/dist/types/components/z2map/map.type.d.ts +45 -0
- package/dist/types/components/z2map/map.utils.d.ts +10 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/routes/map.d.ts +2 -0
- package/package.json +6 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { MapVariant } from '../map.constants';
|
|
3
|
+
export interface MapControlsProps {
|
|
4
|
+
showZoomControls?: boolean;
|
|
5
|
+
onZoomIn?: () => void;
|
|
6
|
+
onZoomOut?: () => void;
|
|
7
|
+
showStyleSwitcher?: boolean;
|
|
8
|
+
activeStyle?: MapVariant;
|
|
9
|
+
onStyleChange?: (style: MapVariant) => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const MapControls: FC<MapControlsProps>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { PinSize, PinVariant } from '../map.type';
|
|
4
|
+
declare const pinVariants: (props?: ({
|
|
5
|
+
variant?: "success" | "warning" | "danger" | "neutral" | "brand" | null | undefined;
|
|
6
|
+
active?: boolean | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
8
|
+
export interface MapPinProps extends VariantProps<typeof pinVariants> {
|
|
9
|
+
icon?: ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
onClick?: () => void;
|
|
12
|
+
onMouseEnter?: () => void;
|
|
13
|
+
onMouseLeave?: () => void;
|
|
14
|
+
active?: boolean;
|
|
15
|
+
variant?: PinVariant;
|
|
16
|
+
size?: PinSize;
|
|
17
|
+
}
|
|
18
|
+
export declare const MapPinComponent: FC<MapPinProps>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { MapVariant } from '../map.constants';
|
|
3
|
+
export interface MapStyleControlProps {
|
|
4
|
+
activeStyle: MapVariant;
|
|
5
|
+
onStyleChange: (style: MapVariant) => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const MapStyleControl: FC<MapStyleControlProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as Z2Map } from './map';
|
|
2
|
+
export type { Location, MapProps, PinVariant, PinSize, Coordinate } from './map.type';
|
|
3
|
+
export { MAP_VARIANTS, DEFAULT_MAP_CONFIG, PIN_SIZES } from './map.constants';
|
|
4
|
+
export type { MapVariant } from './map.constants';
|
|
5
|
+
export { MapPinComponent } from './components/map-pin';
|
|
6
|
+
export { MapPinContent } from './components/map-pin-content';
|
|
7
|
+
export { MapControls } from './components/map-controls';
|
|
8
|
+
export { MapZoomControl } from './components/map-zoom-control';
|
|
9
|
+
export { MapStyleControl } from './components/map-style-control';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export declare const MAP_VARIANTS: {
|
|
2
|
+
readonly STREETS: "streets";
|
|
3
|
+
readonly SATELLITE: "satellite";
|
|
4
|
+
readonly TERRAIN: "terrain";
|
|
5
|
+
readonly DARK: "dark";
|
|
6
|
+
readonly LIGHT: "light";
|
|
7
|
+
};
|
|
8
|
+
export type MapVariant = (typeof MAP_VARIANTS)[keyof typeof MAP_VARIANTS];
|
|
9
|
+
export declare const MAPBOX_STYLE_MAP: Record<MapVariant, string>;
|
|
10
|
+
export declare const DEFAULT_MAP_CONFIG: {
|
|
11
|
+
center: {
|
|
12
|
+
lat: number;
|
|
13
|
+
lng: number;
|
|
14
|
+
};
|
|
15
|
+
zoom: number;
|
|
16
|
+
minZoom: number;
|
|
17
|
+
maxZoom: number;
|
|
18
|
+
variant: MapVariant;
|
|
19
|
+
width: string;
|
|
20
|
+
height: number;
|
|
21
|
+
interactive: boolean;
|
|
22
|
+
draggable: boolean;
|
|
23
|
+
scrollZoom: boolean;
|
|
24
|
+
showZoomControls: boolean;
|
|
25
|
+
showStyleSwitcher: boolean;
|
|
26
|
+
fitBoundsToLocations: boolean;
|
|
27
|
+
popoverDisabled: boolean;
|
|
28
|
+
pinVariant: "brand";
|
|
29
|
+
pinSize: "md";
|
|
30
|
+
};
|
|
31
|
+
export declare const PIN_SIZES: {
|
|
32
|
+
readonly sm: {
|
|
33
|
+
readonly width: 22;
|
|
34
|
+
readonly height: 22;
|
|
35
|
+
readonly iconSize: 12;
|
|
36
|
+
};
|
|
37
|
+
readonly md: {
|
|
38
|
+
readonly width: 32;
|
|
39
|
+
readonly height: 32;
|
|
40
|
+
readonly iconSize: 16;
|
|
41
|
+
};
|
|
42
|
+
readonly lg: {
|
|
43
|
+
readonly width: 40;
|
|
44
|
+
readonly height: 40;
|
|
45
|
+
readonly iconSize: 20;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { MapRef } from 'react-map-gl/mapbox';
|
|
2
|
+
import { MapProps, Location } from './map.type';
|
|
3
|
+
import { MapVariant } from './map.constants';
|
|
4
|
+
export declare const useMap: (props: MapProps) => {
|
|
5
|
+
mapRef: import("react").RefObject<MapRef | null>;
|
|
6
|
+
initialViewState: {
|
|
7
|
+
latitude: number;
|
|
8
|
+
longitude: number;
|
|
9
|
+
zoom: number;
|
|
10
|
+
};
|
|
11
|
+
currentVariant: MapVariant;
|
|
12
|
+
activeLocation: Location | null;
|
|
13
|
+
openPopoverId: string | null;
|
|
14
|
+
setOpenPopoverId: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
15
|
+
mapStyle: string;
|
|
16
|
+
containerStyle: {
|
|
17
|
+
width: string;
|
|
18
|
+
height: string;
|
|
19
|
+
};
|
|
20
|
+
handleZoomIn: () => void;
|
|
21
|
+
handleZoomOut: () => void;
|
|
22
|
+
handleStyleChange: (newStyle: MapVariant) => void;
|
|
23
|
+
handlePinHover: (location: Location | null) => void;
|
|
24
|
+
handlePinClick: (location: Location) => void;
|
|
25
|
+
handlePinClickWrapper: (location: Location) => void;
|
|
26
|
+
handleMove: (evt: {
|
|
27
|
+
viewState: {
|
|
28
|
+
latitude: number;
|
|
29
|
+
longitude: number;
|
|
30
|
+
zoom: number;
|
|
31
|
+
};
|
|
32
|
+
}) => void;
|
|
33
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { MapVariant } from './map.constants';
|
|
3
|
+
export interface Coordinate {
|
|
4
|
+
lat: number;
|
|
5
|
+
lng: number;
|
|
6
|
+
}
|
|
7
|
+
export interface Location {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
coordinate: Coordinate;
|
|
11
|
+
title: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
specs?: string[];
|
|
14
|
+
icon?: ReactNode;
|
|
15
|
+
metadata?: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
export type PinVariant = 'brand' | 'neutral' | 'danger' | 'success' | 'warning';
|
|
18
|
+
export type PinSize = 'sm' | 'md' | 'lg';
|
|
19
|
+
export interface MapProps {
|
|
20
|
+
locations: Location[];
|
|
21
|
+
mapboxToken?: string;
|
|
22
|
+
onPinClick?: (location: Location) => void;
|
|
23
|
+
onPinHover?: (location: Location | null) => void;
|
|
24
|
+
onMapMove?: (center: Coordinate, zoom: number) => void;
|
|
25
|
+
center?: Coordinate;
|
|
26
|
+
zoom?: number;
|
|
27
|
+
minZoom?: number;
|
|
28
|
+
maxZoom?: number;
|
|
29
|
+
variant?: MapVariant;
|
|
30
|
+
width?: string | number;
|
|
31
|
+
height?: string | number;
|
|
32
|
+
className?: string;
|
|
33
|
+
pinVariant?: PinVariant;
|
|
34
|
+
pinSize?: PinSize;
|
|
35
|
+
renderPin?: (location: Location) => ReactNode;
|
|
36
|
+
interactive?: boolean;
|
|
37
|
+
draggable?: boolean;
|
|
38
|
+
scrollZoom?: boolean;
|
|
39
|
+
showZoomControls?: boolean;
|
|
40
|
+
showStyleSwitcher?: boolean;
|
|
41
|
+
renderPopover?: (location: Location) => ReactNode;
|
|
42
|
+
popoverDisabled?: boolean;
|
|
43
|
+
fitBoundsToLocations?: boolean;
|
|
44
|
+
loading?: boolean;
|
|
45
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Coordinate } from './map.type';
|
|
2
|
+
export declare const calculateCenter: (coordinates: Coordinate[]) => Coordinate;
|
|
3
|
+
export declare const calculateBounds: (coordinates: Coordinate[]) => {
|
|
4
|
+
north: number;
|
|
5
|
+
south: number;
|
|
6
|
+
east: number;
|
|
7
|
+
west: number;
|
|
8
|
+
center: Coordinate;
|
|
9
|
+
};
|
|
10
|
+
export declare const formatDimension: (value: string | number) => string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -31,5 +31,6 @@ export * from './components/dynamic-table';
|
|
|
31
31
|
export * from './components/chart';
|
|
32
32
|
export * from './components/chart-card';
|
|
33
33
|
export * from './components/radio-card/radio-card';
|
|
34
|
+
export * from './components/z2map';
|
|
34
35
|
export * from './lib/theme.hook';
|
|
35
36
|
export * from './lib/utils';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ztwoint/z-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.123",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -86,6 +86,7 @@
|
|
|
86
86
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.4",
|
|
87
87
|
"@fontsource-variable/inter": "^5.2.5",
|
|
88
88
|
"@heroicons/react": "^2.2.0",
|
|
89
|
+
"@math.gl/web-mercator": "^4.1.0",
|
|
89
90
|
"@radix-ui/react-checkbox": "^1.3.2",
|
|
90
91
|
"@radix-ui/react-dialog": "^1.1.14",
|
|
91
92
|
"@radix-ui/react-dropdown-menu": "^2.1.15",
|
|
@@ -97,6 +98,7 @@
|
|
|
97
98
|
"@radix-ui/react-tabs": "^1.1.12",
|
|
98
99
|
"@radix-ui/react-tooltip": "^1.2.7",
|
|
99
100
|
"@tanstack/react-table": "^8.21.3",
|
|
101
|
+
"@types/mapbox-gl": "^3.4.1",
|
|
100
102
|
"class-variance-authority": "^0.7.1",
|
|
101
103
|
"classnames": "^2.5.1",
|
|
102
104
|
"clsx": "^2.1.1",
|
|
@@ -104,8 +106,10 @@
|
|
|
104
106
|
"echarts": "^5.6.0",
|
|
105
107
|
"echarts-for-react": "^3.0.2",
|
|
106
108
|
"lucide-react": "^0.525.0",
|
|
109
|
+
"mapbox-gl": "^3.15.0",
|
|
107
110
|
"radix-ui": "^1.4.3",
|
|
108
111
|
"react-country-flag": "^3.1.0",
|
|
112
|
+
"react-map-gl": "^8.1.0",
|
|
109
113
|
"react-router-dom": "^7.7.1",
|
|
110
114
|
"react-virtuoso": "^4.14.0",
|
|
111
115
|
"tailwind-merge": "^3.3.0",
|
|
@@ -115,4 +119,4 @@
|
|
|
115
119
|
"react": "19.1.0",
|
|
116
120
|
"react-dom": "19.1.0"
|
|
117
121
|
}
|
|
118
|
-
}
|
|
122
|
+
}
|