@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
|
@@ -47,13 +47,20 @@ import "../../../dynamic-table/z2-table-context.js";
|
|
|
47
47
|
import "../../../chart/chart.js";
|
|
48
48
|
import "../../../chart-card/config/defaults.js";
|
|
49
49
|
import "../../../chart-card/config/colors.js";
|
|
50
|
-
|
|
50
|
+
import "../../../z2map/map.js";
|
|
51
|
+
import "../../../z2map/map.constants.js";
|
|
52
|
+
import "../../../z2map/components/map-pin.js";
|
|
53
|
+
import "../../../z2map/components/map-pin-content.js";
|
|
54
|
+
import "../../../z2map/components/map-controls.js";
|
|
55
|
+
import "../../../z2map/components/map-zoom-control.js";
|
|
56
|
+
import "../../../z2map/components/map-style-control.js";
|
|
57
|
+
const xt = ({
|
|
51
58
|
avatar: m,
|
|
52
59
|
value: a,
|
|
53
60
|
rightIcon: o,
|
|
54
61
|
className: s,
|
|
55
|
-
helperText:
|
|
56
|
-
description:
|
|
62
|
+
helperText: p,
|
|
63
|
+
description: e
|
|
57
64
|
}) => /* @__PURE__ */ i(
|
|
58
65
|
"div",
|
|
59
66
|
{
|
|
@@ -74,16 +81,16 @@ const pt = ({
|
|
|
74
81
|
a
|
|
75
82
|
] }),
|
|
76
83
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2.5", children: [
|
|
77
|
-
|
|
84
|
+
p && /* @__PURE__ */ t("span", { className: "text-text-neutral-secondary", children: p }),
|
|
78
85
|
o && /* @__PURE__ */ t("span", { className: r("min-h-max min-w-max"), children: o })
|
|
79
86
|
] })
|
|
80
87
|
]
|
|
81
88
|
}
|
|
82
89
|
),
|
|
83
|
-
|
|
90
|
+
e && /* @__PURE__ */ t("div", { className: "text-text-neutral-secondary w-full", children: e })
|
|
84
91
|
]
|
|
85
92
|
}
|
|
86
93
|
);
|
|
87
94
|
export {
|
|
88
|
-
|
|
95
|
+
xt as AvatarCell
|
|
89
96
|
};
|
|
@@ -52,6 +52,13 @@ import "../dynamic-table/z2-table-context.js";
|
|
|
52
52
|
import "../chart/chart.js";
|
|
53
53
|
import "../chart-card/config/defaults.js";
|
|
54
54
|
import "../chart-card/config/colors.js";
|
|
55
|
+
import "../z2map/map.js";
|
|
56
|
+
import "../z2map/map.constants.js";
|
|
57
|
+
import "../z2map/components/map-pin.js";
|
|
58
|
+
import "../z2map/components/map-pin-content.js";
|
|
59
|
+
import "../z2map/components/map-controls.js";
|
|
60
|
+
import "../z2map/components/map-zoom-control.js";
|
|
61
|
+
import "../z2map/components/map-style-control.js";
|
|
55
62
|
import { TableHeaderWrapper as T } from "./components/table-header-wrapper.js";
|
|
56
63
|
import { TableHeaderContent as b } from "./components/table-header-content.js";
|
|
57
64
|
import { TableFooter as s } from "./components/table-footer.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as t, jsxs as m } from "react/jsx-runtime";
|
|
2
2
|
import { Table as r } from "../table/table-provider.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { cn as d } from "../../lib/utils.js";
|
|
@@ -47,8 +47,15 @@ import "../dynamic-table/z2-table-context.js";
|
|
|
47
47
|
import "../chart/chart.js";
|
|
48
48
|
import "../chart-card/config/defaults.js";
|
|
49
49
|
import "../chart-card/config/colors.js";
|
|
50
|
+
import "../z2map/map.js";
|
|
51
|
+
import "../z2map/map.constants.js";
|
|
52
|
+
import "../z2map/components/map-pin.js";
|
|
53
|
+
import "../z2map/components/map-pin-content.js";
|
|
54
|
+
import "../z2map/components/map-controls.js";
|
|
55
|
+
import "../z2map/components/map-zoom-control.js";
|
|
56
|
+
import "../z2map/components/map-style-control.js";
|
|
50
57
|
import "../table/table.context.js";
|
|
51
|
-
const
|
|
58
|
+
const zt = ({
|
|
52
59
|
dataSource: w,
|
|
53
60
|
schema: B,
|
|
54
61
|
loading: b,
|
|
@@ -58,8 +65,8 @@ const _e = ({
|
|
|
58
65
|
bordered: n = !0,
|
|
59
66
|
showHeader: g = !0,
|
|
60
67
|
headerClassName: j,
|
|
61
|
-
search:
|
|
62
|
-
filter:
|
|
68
|
+
search: a,
|
|
69
|
+
filter: e,
|
|
63
70
|
headerLeftContent: h,
|
|
64
71
|
headerActions: p,
|
|
65
72
|
body: l = {
|
|
@@ -71,24 +78,24 @@ const _e = ({
|
|
|
71
78
|
footerClassName: T,
|
|
72
79
|
pagination: o,
|
|
73
80
|
paginationInfo: i,
|
|
74
|
-
paginationQuickJumper:
|
|
81
|
+
paginationQuickJumper: s,
|
|
75
82
|
error: u = !1,
|
|
76
83
|
dataSourceError: _ = !1
|
|
77
84
|
}) => {
|
|
78
85
|
var F;
|
|
79
86
|
if (u)
|
|
80
|
-
return /* @__PURE__ */
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
typeof u == "string" && /* @__PURE__ */
|
|
87
|
+
return /* @__PURE__ */ t("div", { className: "flex flex-col items-center justify-center h-64 bg-background-error-subtle rounded-lg text-text-warning-secondary", children: /* @__PURE__ */ m("div", { className: "flex gap-2", children: [
|
|
88
|
+
/* @__PURE__ */ t(S, { className: "mt-1.5" }),
|
|
89
|
+
/* @__PURE__ */ m("div", { className: "flex flex-col gap-2", children: [
|
|
90
|
+
/* @__PURE__ */ t("div", { className: "text-text-error-primary text-lg font-medium", children: "Error loading data" }),
|
|
91
|
+
/* @__PURE__ */ t("div", { className: "text-sm", children: "Please try again later" }),
|
|
92
|
+
typeof u == "string" && /* @__PURE__ */ t("div", { className: "text-text-warning-secondary text-sm", children: u })
|
|
86
93
|
] })
|
|
87
94
|
] }) });
|
|
88
|
-
const C =
|
|
89
|
-
return /* @__PURE__ */
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
g && v && /* @__PURE__ */
|
|
95
|
+
const C = s && s.totalPage && s.totalPage >= 2, N = o && o.totalPage && o.totalPage >= 2 || !!i || C, v = a || e || h || p, R = typeof (e == null ? void 0 : e.showFilterButton) > "u" ? !0 : e == null ? void 0 : e.showFilterButton;
|
|
96
|
+
return /* @__PURE__ */ m("div", { className: d("flex flex-col overflow-hidden relative", H), children: [
|
|
97
|
+
/* @__PURE__ */ m(r, { dataSource: w, schema: B, emptyMessage: k, children: [
|
|
98
|
+
g && v && /* @__PURE__ */ m(
|
|
92
99
|
r.Header,
|
|
93
100
|
{
|
|
94
101
|
className: d(
|
|
@@ -98,43 +105,43 @@ const _e = ({
|
|
|
98
105
|
j
|
|
99
106
|
),
|
|
100
107
|
children: [
|
|
101
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ m(r.HeaderContent, { children: [
|
|
102
109
|
h && h,
|
|
103
|
-
|
|
110
|
+
a && /* @__PURE__ */ t(
|
|
104
111
|
r.Search,
|
|
105
112
|
{
|
|
106
113
|
search: {
|
|
107
|
-
value:
|
|
108
|
-
onChange:
|
|
114
|
+
value: a.value || "",
|
|
115
|
+
onChange: a.onChange || (() => {
|
|
109
116
|
}),
|
|
110
|
-
placeholder:
|
|
117
|
+
placeholder: a.placeholder
|
|
111
118
|
},
|
|
112
|
-
className:
|
|
119
|
+
className: a.className
|
|
113
120
|
}
|
|
114
121
|
),
|
|
115
|
-
|
|
122
|
+
e && /* @__PURE__ */ m(
|
|
116
123
|
x,
|
|
117
124
|
{
|
|
118
|
-
filterSchema:
|
|
125
|
+
filterSchema: e.filterSchema,
|
|
119
126
|
filter: {
|
|
120
|
-
value:
|
|
121
|
-
onChange:
|
|
127
|
+
value: e.value || [],
|
|
128
|
+
onChange: e.onChange || (() => {
|
|
122
129
|
}),
|
|
123
|
-
onFilterClick:
|
|
124
|
-
loading:
|
|
130
|
+
onFilterClick: e.onFilterClick,
|
|
131
|
+
loading: e.loading
|
|
125
132
|
},
|
|
126
133
|
children: [
|
|
127
|
-
R && /* @__PURE__ */
|
|
128
|
-
(F =
|
|
134
|
+
R && /* @__PURE__ */ t(x.FilterButton, {}),
|
|
135
|
+
(F = e == null ? void 0 : e.quickFilters) == null ? void 0 : F.map((f) => /* @__PURE__ */ t(x.FilterColumnButton, { filterName: f }, f))
|
|
129
136
|
]
|
|
130
137
|
}
|
|
131
138
|
)
|
|
132
139
|
] }),
|
|
133
|
-
p && /* @__PURE__ */
|
|
140
|
+
p && /* @__PURE__ */ t(r.HeaderContent, { children: p })
|
|
134
141
|
]
|
|
135
142
|
}
|
|
136
143
|
),
|
|
137
|
-
/* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ t(
|
|
138
145
|
r.Body,
|
|
139
146
|
{
|
|
140
147
|
dataSourceError: _,
|
|
@@ -152,7 +159,7 @@ const _e = ({
|
|
|
152
159
|
stickyHeader: l == null ? void 0 : l.stickyHeader
|
|
153
160
|
}
|
|
154
161
|
),
|
|
155
|
-
P && N && /* @__PURE__ */
|
|
162
|
+
P && N && /* @__PURE__ */ m(
|
|
156
163
|
r.Footer,
|
|
157
164
|
{
|
|
158
165
|
className: d(
|
|
@@ -162,7 +169,7 @@ const _e = ({
|
|
|
162
169
|
T
|
|
163
170
|
),
|
|
164
171
|
children: [
|
|
165
|
-
i ? /* @__PURE__ */
|
|
172
|
+
i ? /* @__PURE__ */ t(r.FooterContent, { children: /* @__PURE__ */ t(
|
|
166
173
|
r.PaginationInfo,
|
|
167
174
|
{
|
|
168
175
|
showTotal: i.showTotal,
|
|
@@ -170,19 +177,19 @@ const _e = ({
|
|
|
170
177
|
currentPage: i.currentPage,
|
|
171
178
|
itemsPerPage: i.itemsPerPage
|
|
172
179
|
}
|
|
173
|
-
) }) :
|
|
174
|
-
(
|
|
175
|
-
C && /* @__PURE__ */
|
|
180
|
+
) }) : s || o ? /* @__PURE__ */ t(r.FooterContent, { children: null }) : null,
|
|
181
|
+
(s || o) && /* @__PURE__ */ m(r.FooterContent, { children: [
|
|
182
|
+
C && /* @__PURE__ */ t(
|
|
176
183
|
r.PaginationQuickJumper,
|
|
177
184
|
{
|
|
178
|
-
currentPage:
|
|
179
|
-
totalPage:
|
|
180
|
-
onChange:
|
|
185
|
+
currentPage: s.currentPage,
|
|
186
|
+
totalPage: s.totalPage,
|
|
187
|
+
onChange: s.onChange || (() => {
|
|
181
188
|
}),
|
|
182
|
-
disabled:
|
|
189
|
+
disabled: s.disabled
|
|
183
190
|
}
|
|
184
191
|
),
|
|
185
|
-
o && /* @__PURE__ */
|
|
192
|
+
o && /* @__PURE__ */ t(
|
|
186
193
|
r.Pagination,
|
|
187
194
|
{
|
|
188
195
|
currentPage: o.currentPage,
|
|
@@ -197,12 +204,12 @@ const _e = ({
|
|
|
197
204
|
}
|
|
198
205
|
)
|
|
199
206
|
] }),
|
|
200
|
-
b && /* @__PURE__ */
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
-
/* @__PURE__ */
|
|
207
|
+
b && /* @__PURE__ */ t("div", { className: "absolute top-0 inset-0 w-full h-full bg-white/80 flex items-center justify-center", children: /* @__PURE__ */ m("div", { className: "flex flex-col items-center gap-3", children: [
|
|
208
|
+
/* @__PURE__ */ t("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-text-brand-secondary" }),
|
|
209
|
+
/* @__PURE__ */ t("p", { className: "text-text-neutral-primary font-medium", children: "Loading..." })
|
|
203
210
|
] }) })
|
|
204
211
|
] });
|
|
205
212
|
};
|
|
206
213
|
export {
|
|
207
|
-
|
|
214
|
+
zt as default
|
|
208
215
|
};
|
|
@@ -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,29 @@
|
|
|
1
|
+
import { jsxs as m, Fragment as p, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { MapZoomControl as d } from "./map-zoom-control.js";
|
|
3
|
+
import { MapStyleControl as c } from "./map-style-control.js";
|
|
4
|
+
import { cn as s } from "../../../lib/utils.js";
|
|
5
|
+
const f = ({
|
|
6
|
+
showZoomControls: n = !0,
|
|
7
|
+
onZoomIn: o,
|
|
8
|
+
onZoomOut: t,
|
|
9
|
+
showStyleSwitcher: e = !1,
|
|
10
|
+
activeStyle: a,
|
|
11
|
+
onStyleChange: i,
|
|
12
|
+
className: l
|
|
13
|
+
}) => /* @__PURE__ */ m(p, { children: [
|
|
14
|
+
n && o && t && /* @__PURE__ */ r(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
className: s(
|
|
18
|
+
"absolute bottom-6 right-6 z-10 transition-all duration-300 hover:scale-105",
|
|
19
|
+
l
|
|
20
|
+
),
|
|
21
|
+
children: /* @__PURE__ */ r(d, { onZoomIn: o, onZoomOut: t })
|
|
22
|
+
}
|
|
23
|
+
),
|
|
24
|
+
e && a && i && /* @__PURE__ */ r("div", { className: s("absolute top-6 right-6 z-10 transition-all duration-300", l), children: /* @__PURE__ */ r(c, { activeStyle: a, onStyleChange: i }) })
|
|
25
|
+
] });
|
|
26
|
+
f.displayName = "MapControls";
|
|
27
|
+
export {
|
|
28
|
+
f as MapControls
|
|
29
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { MapPinOff as a } from "lucide-react";
|
|
3
|
+
const s = () => /* @__PURE__ */ e("div", { className: "absolute inset-0 pointer-events-none flex items-center justify-center z-20", children: /* @__PURE__ */ e("div", { className: "bg-white/95 backdrop-blur-sm rounded-2xl shadow-[0_8px_32px_rgba(0,0,0,0.12)] border border-stroke-solid-light p-8 max-w-sm mx-4 pointer-events-auto", children: /* @__PURE__ */ t("div", { className: "flex flex-col items-center gap-4 text-center", children: [
|
|
4
|
+
/* @__PURE__ */ e("div", { className: "relative", children: /* @__PURE__ */ e("div", { className: "w-16 h-16 rounded-full bg-surface-neutral-default flex items-center justify-center", children: /* @__PURE__ */ e(a, { className: "w-8 h-8 text-neutral-secondary" }) }) }),
|
|
5
|
+
/* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ e("h3", { className: "leading-none-medium-base text-neutral-primary font-semibold", children: "No locations to display" }) })
|
|
6
|
+
] }) }) });
|
|
7
|
+
s.displayName = "MapEmptyState";
|
|
8
|
+
export {
|
|
9
|
+
s as MapEmptyState
|
|
10
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Loader2 as i } from "lucide-react";
|
|
3
|
+
import { cn as s } from "../../../lib/utils.js";
|
|
4
|
+
const c = ({ width: r, height: t, className: l }) => {
|
|
5
|
+
const n = {
|
|
6
|
+
width: typeof r == "number" ? `${r}px` : r,
|
|
7
|
+
height: typeof t == "number" ? `${t}px` : t
|
|
8
|
+
};
|
|
9
|
+
return /* @__PURE__ */ a(
|
|
10
|
+
"div",
|
|
11
|
+
{
|
|
12
|
+
style: n,
|
|
13
|
+
className: s(
|
|
14
|
+
"relative bg-gradient-to-br from-surface-neutral-default to-surface-neutral-hover rounded-xl border border-stroke-solid-light flex flex-col items-center justify-center gap-4 overflow-hidden",
|
|
15
|
+
l
|
|
16
|
+
),
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ e("div", { className: "absolute inset-0 opacity-[0.03]", children: /* @__PURE__ */ e(
|
|
19
|
+
"div",
|
|
20
|
+
{
|
|
21
|
+
className: "absolute inset-0",
|
|
22
|
+
style: {
|
|
23
|
+
backgroundImage: "radial-gradient(circle at 20px 20px, currentColor 1px, transparent 1px)",
|
|
24
|
+
backgroundSize: "40px 40px"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
) }),
|
|
28
|
+
/* @__PURE__ */ a("div", { className: "relative z-10 flex flex-col items-center gap-3", children: [
|
|
29
|
+
/* @__PURE__ */ a("div", { className: "relative", children: [
|
|
30
|
+
/* @__PURE__ */ e("div", { className: "w-16 h-16 rounded-full bg-surface-accent-default/10 flex items-center justify-center", children: /* @__PURE__ */ e(i, { className: "w-8 h-8 text-accent-primary animate-spin" }) }),
|
|
31
|
+
/* @__PURE__ */ e("div", { className: "absolute inset-0 rounded-full bg-accent-primary/20 animate-ping" })
|
|
32
|
+
] }),
|
|
33
|
+
/* @__PURE__ */ a("div", { className: "flex flex-col items-center gap-1", children: [
|
|
34
|
+
/* @__PURE__ */ e("div", { className: "leading-none-medium-sm text-neutral-primary font-medium", children: "Loading map..." }),
|
|
35
|
+
/* @__PURE__ */ e("div", { className: "leading-none-regular-xs text-neutral-secondary", children: "Please wait" })
|
|
36
|
+
] })
|
|
37
|
+
] })
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
c.displayName = "MapLoadingState";
|
|
43
|
+
export {
|
|
44
|
+
c as MapLoadingState
|
|
45
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as r, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { MapPin as d, MapPinned as m } from "lucide-react";
|
|
3
|
+
import { Badge as c } from "../../badge/badge.js";
|
|
4
|
+
import { cn as t } from "../../../lib/utils.js";
|
|
5
|
+
const p = ({ location: e, customContent: s, className: n }) => s ? /* @__PURE__ */ r("div", { className: t("min-w-0", n), children: s }) : /* @__PURE__ */ a("div", { className: t("flex flex-col gap-3 max-w-xs p-1", n), children: [
|
|
6
|
+
/* @__PURE__ */ a("div", { className: "flex items-start gap-2.5", children: [
|
|
7
|
+
/* @__PURE__ */ r("div", { className: "flex-shrink-0 w-8 h-8 rounded-full bg-surface-accent-default/10 flex items-center justify-center mt-0.5", children: /* @__PURE__ */ r(d, { size: 16, className: "text-accent-primary" }) }),
|
|
8
|
+
/* @__PURE__ */ a("div", { className: "flex-1 min-w-0", children: [
|
|
9
|
+
/* @__PURE__ */ r("h3", { className: "leading-none-medium-base text-neutral-primary font-semibold mb-1 break-words", children: e.title }),
|
|
10
|
+
e.name && e.name !== e.title && /* @__PURE__ */ r("p", { className: "leading-none-regular-xs text-neutral-secondary", children: e.name })
|
|
11
|
+
] })
|
|
12
|
+
] }),
|
|
13
|
+
e.description && /* @__PURE__ */ r("p", { className: "leading-none-regular-sm text-neutral-secondary leading-relaxed", children: e.description }),
|
|
14
|
+
e.specs && e.specs.length > 0 && /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1.5", children: e.specs.map((i, l) => /* @__PURE__ */ r(c, { label: i, size: "sm", variant: "neutral" }, l)) }),
|
|
15
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-1.5 text-neutral-tertiary leading-none-regular-xs pt-2 border-t border-stroke-solid-light", children: [
|
|
16
|
+
/* @__PURE__ */ r(m, { size: 12, className: "text-neutral-tertiary" }),
|
|
17
|
+
/* @__PURE__ */ a("span", { className: "font-mono text-[10px]", children: [
|
|
18
|
+
e.coordinate.lat.toFixed(4),
|
|
19
|
+
", ",
|
|
20
|
+
e.coordinate.lng.toFixed(4)
|
|
21
|
+
] })
|
|
22
|
+
] })
|
|
23
|
+
] });
|
|
24
|
+
p.displayName = "MapPinContent";
|
|
25
|
+
export {
|
|
26
|
+
p as MapPinContent
|
|
27
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { 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,116 @@
|
|
|
1
|
+
import { jsxs as d, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { cva as v } from "class-variance-authority";
|
|
3
|
+
import { MapPin as h } from "lucide-react";
|
|
4
|
+
import { cn as c } from "../../../lib/utils.js";
|
|
5
|
+
import { PIN_SIZES as r } from "../map.constants.js";
|
|
6
|
+
const m = v(
|
|
7
|
+
[
|
|
8
|
+
"relative flex items-center justify-center cursor-pointer transition-all duration-300 select-none group",
|
|
9
|
+
'before:content-[""] before:absolute before:inset-0 before:rounded-full',
|
|
10
|
+
"before:transition-all before:duration-300",
|
|
11
|
+
"before:ring-2 before:ring-white/90",
|
|
12
|
+
"before:shadow-[0_2px_8px_rgba(0,0,0,0.15)] hover:before:shadow-[0_4px_16px_rgba(0,0,0,0.25)]",
|
|
13
|
+
"before:z-[0]"
|
|
14
|
+
],
|
|
15
|
+
{
|
|
16
|
+
variants: {
|
|
17
|
+
variant: {
|
|
18
|
+
brand: "",
|
|
19
|
+
neutral: "",
|
|
20
|
+
danger: "",
|
|
21
|
+
success: "",
|
|
22
|
+
warning: ""
|
|
23
|
+
},
|
|
24
|
+
active: {
|
|
25
|
+
true: [
|
|
26
|
+
"scale-125 z-50",
|
|
27
|
+
"before:ring-4 before:ring-white/70",
|
|
28
|
+
"before:shadow-[0_8px_24px_rgba(0,0,0,0.3)]"
|
|
29
|
+
],
|
|
30
|
+
false: "hover:scale-110"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
compoundVariants: [
|
|
34
|
+
{
|
|
35
|
+
variant: "brand",
|
|
36
|
+
className: "before:bg-surface-accent-default hover:before:bg-surface-accent-hover"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
variant: "neutral",
|
|
40
|
+
className: "before:bg-surface-gray-default hover:before:bg-surface-gray-hover"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
variant: "danger",
|
|
44
|
+
className: "before:bg-surface-danger-default hover:before:bg-surface-danger-hover"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
variant: "success",
|
|
48
|
+
className: "before:bg-surface-success-default hover:before:bg-surface-success-hover"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
variant: "warning",
|
|
52
|
+
className: "before:bg-surface-warning-default hover:before:bg-surface-warning-hover"
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
defaultVariants: {
|
|
56
|
+
variant: "warning",
|
|
57
|
+
active: !1
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
), p = {
|
|
61
|
+
sm: r.sm.iconSize,
|
|
62
|
+
md: r.md.iconSize,
|
|
63
|
+
lg: r.lg.iconSize
|
|
64
|
+
}, w = {
|
|
65
|
+
brand: "bg-surface-accent-hover",
|
|
66
|
+
neutral: "bg-surface-gray-hover",
|
|
67
|
+
danger: "bg-surface-danger-hover",
|
|
68
|
+
success: "bg-surface-success-hover",
|
|
69
|
+
warning: "bg-surface-warning-hover"
|
|
70
|
+
}, x = ({
|
|
71
|
+
icon: f,
|
|
72
|
+
className: b,
|
|
73
|
+
onClick: e,
|
|
74
|
+
onMouseEnter: u,
|
|
75
|
+
onMouseLeave: l,
|
|
76
|
+
active: s = !1,
|
|
77
|
+
variant: o = "warning",
|
|
78
|
+
size: t = "md"
|
|
79
|
+
}) => {
|
|
80
|
+
const g = p[t], i = r[t];
|
|
81
|
+
return /* @__PURE__ */ d(
|
|
82
|
+
"div",
|
|
83
|
+
{
|
|
84
|
+
className: c(m({ variant: o, active: s }), b),
|
|
85
|
+
style: {
|
|
86
|
+
width: `${i.width}px`,
|
|
87
|
+
height: `${i.height}px`
|
|
88
|
+
},
|
|
89
|
+
onClick: e,
|
|
90
|
+
onMouseEnter: u,
|
|
91
|
+
onMouseLeave: l,
|
|
92
|
+
role: "button",
|
|
93
|
+
tabIndex: 0,
|
|
94
|
+
"aria-label": "Map pin",
|
|
95
|
+
onKeyDown: (a) => {
|
|
96
|
+
(a.key === "Enter" || a.key === " ") && (a.preventDefault(), e == null || e());
|
|
97
|
+
},
|
|
98
|
+
children: [
|
|
99
|
+
s && /* @__PURE__ */ n(
|
|
100
|
+
"div",
|
|
101
|
+
{
|
|
102
|
+
className: c(
|
|
103
|
+
"absolute inset-0 rounded-full z-[1] opacity-60",
|
|
104
|
+
w[o]
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
/* @__PURE__ */ n("div", { className: "relative z-10 flex items-center justify-center", children: f || /* @__PURE__ */ n(h, { size: g, className: "text-white drop-shadow-sm" }) })
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
};
|
|
113
|
+
x.displayName = "MapPinComponent";
|
|
114
|
+
export {
|
|
115
|
+
x as MapPinComponent
|
|
116
|
+
};
|
|
@@ -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,45 @@
|
|
|
1
|
+
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { Layers as d, Map as p, Satellite as m, Mountain as c, Moon as M, Sun as b } from "lucide-react";
|
|
3
|
+
import { Button as h } from "../../button/button.js";
|
|
4
|
+
import { Z2DropdownMenu as D, Z2DropdownMenuTrigger as w, Z2DropdownMenuContent as T, Z2DropdownMenuLabel as v, Z2DropdownMenuRadioGroup as S, Z2DropdownMenuRadioItem as g } from "../../dropdown-menu/z2-dropdown-menu.js";
|
|
5
|
+
import { cn as R } from "../../../lib/utils.js";
|
|
6
|
+
import { MAP_VARIANTS as n } from "../map.constants.js";
|
|
7
|
+
const i = [
|
|
8
|
+
{ value: n.STREETS, label: "Streets", icon: /* @__PURE__ */ e(p, { size: 14 }) },
|
|
9
|
+
{ value: n.SATELLITE, label: "Satellite", icon: /* @__PURE__ */ e(m, { size: 14 }) },
|
|
10
|
+
{ value: n.TERRAIN, label: "Terrain", icon: /* @__PURE__ */ e(c, { size: 14 }) },
|
|
11
|
+
{ value: n.DARK, label: "Dark", icon: /* @__PURE__ */ e(M, { size: 14 }) },
|
|
12
|
+
{ value: n.LIGHT, label: "Light", icon: /* @__PURE__ */ e(b, { size: 14 }) }
|
|
13
|
+
], f = ({
|
|
14
|
+
activeStyle: r,
|
|
15
|
+
onStyleChange: s,
|
|
16
|
+
className: u
|
|
17
|
+
}) => {
|
|
18
|
+
const l = i.find((a) => a.value === r), t = (a) => {
|
|
19
|
+
s(a);
|
|
20
|
+
};
|
|
21
|
+
return /* @__PURE__ */ e("div", { className: R("relative", u), children: /* @__PURE__ */ o(D, { children: [
|
|
22
|
+
/* @__PURE__ */ e(w, { asChild: !0, children: /* @__PURE__ */ e(
|
|
23
|
+
h,
|
|
24
|
+
{
|
|
25
|
+
variant: "stroke",
|
|
26
|
+
shade: "neutral",
|
|
27
|
+
leftIcon: /* @__PURE__ */ e(d, { size: 16 }),
|
|
28
|
+
label: l == null ? void 0 : l.label,
|
|
29
|
+
"aria-label": "Open map style menu",
|
|
30
|
+
size: "large"
|
|
31
|
+
}
|
|
32
|
+
) }),
|
|
33
|
+
/* @__PURE__ */ o(T, { size: "xsmall", className: "bg-white/95 backdrop-blur-sm", children: [
|
|
34
|
+
/* @__PURE__ */ e(v, {}),
|
|
35
|
+
/* @__PURE__ */ e(S, { value: r, onValueChange: t, children: i.map((a) => /* @__PURE__ */ o(g, { value: a.value, children: [
|
|
36
|
+
/* @__PURE__ */ e("span", { className: "mr-2", children: a.icon }),
|
|
37
|
+
a.label
|
|
38
|
+
] }, a.value)) })
|
|
39
|
+
] })
|
|
40
|
+
] }) });
|
|
41
|
+
};
|
|
42
|
+
f.displayName = "MapStyleControl";
|
|
43
|
+
export {
|
|
44
|
+
f as MapStyleControl
|
|
45
|
+
};
|