@stachelock/ui 0.6.15 → 0.6.16

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 (55) hide show
  1. package/dist/NavigationItem.vue_vue_type_script_setup_true_lang-a6F3LQ_P.js +56 -0
  2. package/dist/ScreenSizeSelector.vue_vue_type_script_setup_true_lang-FINxrVod.js +183 -0
  3. package/dist/UiMapAll.vue_vue_type_script_setup_true_lang-DKcK0HmT.js +501 -0
  4. package/dist/charts/BaseChart.js +76 -56
  5. package/dist/charts/chartTheme.js +199 -60
  6. package/dist/charts/index.js +30 -27
  7. package/dist/components/Button.js +109 -89
  8. package/dist/composables/index.js +41 -32
  9. package/dist/composables/useMap.js +1 -1
  10. package/dist/index.js +2304 -1560
  11. package/dist/layouts/DashboardLayout.js +218 -2
  12. package/dist/layouts/NavigationItem.js +1 -1
  13. package/dist/maps/UiMap.js +167 -150
  14. package/dist/maps/UiMapAll.js +1 -1
  15. package/dist/maps/UiMapMarker.js +227 -118
  16. package/dist/maps/index.js +1 -1
  17. package/dist/src/components/UiProgressBar.d.ts +1 -1
  18. package/dist/src/components/UiRadialProgressBar.d.ts +1 -1
  19. package/dist/src/components/charts/chartTheme.d.ts +53 -0
  20. package/dist/src/components/formatters/DateFormatter.d.ts +1 -1
  21. package/dist/src/components/index.d.ts +1 -0
  22. package/dist/src/components/inputs/DatepickerInput.d.ts +3 -3
  23. package/dist/src/components/layouts/DashboardLayout.d.ts +80 -18
  24. package/dist/src/components/layouts/ShowcaseCard.d.ts +1 -0
  25. package/dist/src/components/layouts/UiDetailPanel.d.ts +65 -0
  26. package/dist/src/components/layouts/UiSplitPanelLayout.d.ts +96 -0
  27. package/dist/src/components/layouts/index.d.ts +2 -0
  28. package/dist/src/components/maps/UiMap.d.ts +13 -2
  29. package/dist/src/components/maps/UiMapAll.d.ts +13 -0
  30. package/dist/src/components/maps/UiMapMarker.d.ts +47 -10
  31. package/dist/src/components/modals/UiSlideOver.d.ts +104 -0
  32. package/dist/src/components/modals/index.d.ts +1 -0
  33. package/dist/src/components/palettes/UiCommandPalette.d.ts +166 -0
  34. package/dist/src/components/palettes/index.d.ts +1 -0
  35. package/dist/src/components/wrappers/BreakpointWrapper.d.ts +36 -0
  36. package/dist/src/components/wrappers/ResponsivePreviewWrapper.d.ts +85 -0
  37. package/dist/src/components/wrappers/ScreenSizeSelector.d.ts +74 -0
  38. package/dist/src/components/wrappers/index.d.ts +3 -0
  39. package/dist/src/composables/index.d.ts +1 -0
  40. package/dist/src/composables/useScreenSize.d.ts +131 -0
  41. package/dist/src/types/index.d.ts +1 -0
  42. package/dist/src/types/layouts.d.ts +42 -0
  43. package/dist/src/types/palettes.d.ts +134 -0
  44. package/dist/src/views/components/index.d.ts +2 -0
  45. package/dist/src/views/index.d.ts +5 -1
  46. package/dist/src/views/layouts/index.d.ts +3 -1
  47. package/dist/style.css +1 -1
  48. package/dist/useMap-CM59TKX6.js +318 -0
  49. package/dist/useScreenSize-Kr6cn5Zr.js +104 -0
  50. package/dist/wrappers/index.js +10 -6
  51. package/package.json +1 -1
  52. package/dist/DashboardLayout.vue_vue_type_script_setup_true_lang-BAx4gKqh.js +0 -239
  53. package/dist/NavigationItem.vue_vue_type_script_setup_true_lang-C8aX-84Q.js +0 -56
  54. package/dist/UiMapAll.vue_vue_type_script_setup_true_lang-11yT7mTH.js +0 -471
  55. package/dist/useMap-BGg0H582.js +0 -297
@@ -1,56 +0,0 @@
1
- import { defineComponent as c, createElementBlock as t, openBlock as l, createElementVNode as o, normalizeStyle as a, normalizeClass as s, createBlock as m, createCommentVNode as n, resolveDynamicComponent as r, toDisplayString as i } from "vue";
2
- const d = ["href"], g = {
3
- key: 0,
4
- class: "sl-truncate"
5
- }, y = /* @__PURE__ */ c({
6
- __name: "NavigationItem",
7
- props: {
8
- name: {},
9
- href: {},
10
- icon: {},
11
- isActive: { type: Boolean },
12
- iconOnly: { type: Boolean },
13
- badge: {},
14
- badgeTheme: {}
15
- },
16
- setup(e) {
17
- return (h, f) => (l(), t("li", null, [
18
- o("a", {
19
- href: e.href,
20
- class: s([
21
- "sl-group sl-flex sl-gap-x-3 sl-rounded-md sl-p-2 sl-text-sm sl-leading-6 sl-font-semibold",
22
- e.isActive ? "sl-bg-stachelock-400" : "hover:sl-bg-white/10"
23
- ]),
24
- style: a({
25
- color: e.isActive ? "#fef2f2" : "#fca5a5",
26
- backgroundColor: e.isActive ? "#f87171" : "transparent"
27
- })
28
- }, [
29
- (l(), m(r(e.icon), {
30
- class: s([
31
- "sl-h-6 sl-w-6 sl-shrink-0"
32
- ]),
33
- style: a({
34
- color: e.isActive ? "#fef2f2" : "#fca5a5"
35
- }),
36
- "aria-hidden": "true"
37
- }, null, 8, ["style"])),
38
- e.iconOnly ? n("", !0) : (l(), t("span", g, i(e.name), 1)),
39
- e.badge ? (l(), t("span", {
40
- key: 1,
41
- class: s([
42
- "sl-ml-auto sl-inline-flex sl-items-center sl-rounded-md sl-px-2 sl-py-1 sl-text-xs sl-font-medium",
43
- e.badgeTheme === "primary" ? "sl-bg-stachelock-400 sl-text-white" : "",
44
- e.badgeTheme === "secondary" ? "sl-bg-gray-400 sl-text-white" : "",
45
- e.badgeTheme === "success" ? "sl-bg-green-400 sl-text-white" : "",
46
- e.badgeTheme === "warning" ? "sl-bg-yellow-400 sl-text-white" : "",
47
- e.badgeTheme === "danger" ? "sl-bg-red-400 sl-text-white" : ""
48
- ])
49
- }, i(e.badge), 3)) : n("", !0)
50
- ], 14, d)
51
- ]));
52
- }
53
- });
54
- export {
55
- y as _
56
- };
@@ -1,471 +0,0 @@
1
- import { defineComponent as se, ref as g, computed as L, watch as U, onMounted as ne, createElementBlock as v, openBlock as u, Fragment as B, createVNode as w, mergeProps as re, withCtx as C, createElementVNode as x, createCommentVNode as b, renderSlot as I, normalizeClass as i, unref as k, toDisplayString as E, renderList as R, createBlock as $ } from "vue";
2
- import { PlusIcon as ie, MinusIcon as ue, ArrowsPointingOutIcon as de } from "@heroicons/vue/24/outline";
3
- import ce from "./maps/UiMap.js";
4
- import V from "./maps/UiMapMarker.js";
5
- import fe from "./maps/UiInfoWindow.js";
6
- import { u as me } from "./useMap-BGg0H582.js";
7
- import { g as ge } from "./mapThemes-DFE9fZm3.js";
8
- const ve = { class: "sl-flex sl-flex-col sl-gap-2" }, Me = /* @__PURE__ */ se({
9
- __name: "UiMapAll",
10
- props: {
11
- /** Google Maps API key */
12
- apiKey: {
13
- type: String,
14
- default: ""
15
- },
16
- /** Array of markers or data objects */
17
- items: {
18
- type: Array,
19
- default: () => []
20
- },
21
- /** Custom coordinate extractor for data objects */
22
- coordinateExtractor: {
23
- type: Function,
24
- default: void 0
25
- },
26
- /** ID field for data objects */
27
- idField: {
28
- type: String,
29
- default: "id"
30
- },
31
- /** Title field for data objects */
32
- titleField: {
33
- type: String,
34
- default: "name"
35
- },
36
- /** Initial map center */
37
- center: {
38
- type: Object,
39
- default: () => ({ lat: 39.8283, lng: -98.5795 })
40
- // US center
41
- },
42
- /** Initial zoom level */
43
- zoom: {
44
- type: Number,
45
- default: 4
46
- },
47
- /** Map width */
48
- width: {
49
- type: String,
50
- default: "100%"
51
- },
52
- /** Map height */
53
- height: {
54
- type: String,
55
- default: "400px"
56
- },
57
- /** Map theme */
58
- theme: {
59
- type: String,
60
- default: "ultraLight"
61
- },
62
- /** Auto-switch theme based on dark mode */
63
- autoTheme: {
64
- type: Boolean,
65
- default: !0
66
- },
67
- /** Enable clustering */
68
- enableClustering: {
69
- type: Boolean,
70
- default: !0
71
- },
72
- /** Clustering options */
73
- clusteringOptions: {
74
- type: Object,
75
- default: () => ({
76
- minimumClusterSize: 2,
77
- maxZoom: 15,
78
- gridSize: 60,
79
- maxMarkersWithoutClustering: 100
80
- })
81
- },
82
- /** Maximum markers to render */
83
- maxMarkers: {
84
- type: Number,
85
- default: 500
86
- },
87
- /** Marker color */
88
- markerColor: {
89
- type: String,
90
- default: "primary"
91
- },
92
- /** Marker size */
93
- markerSize: {
94
- type: String,
95
- default: "md"
96
- },
97
- /** Use pin-style markers */
98
- pinMarkers: {
99
- type: Boolean,
100
- default: !1
101
- },
102
- /** Custom marker icon */
103
- markerIcon: {
104
- type: Object,
105
- default: void 0
106
- },
107
- /** Show info window on marker click */
108
- showInfoWindow: {
109
- type: Boolean,
110
- default: !0
111
- },
112
- /** Show avatar in info window */
113
- showInfoAvatar: {
114
- type: Boolean,
115
- default: !0
116
- },
117
- /** Info window actions */
118
- infoActions: {
119
- type: Array,
120
- default: () => []
121
- },
122
- /** Info window field mapping */
123
- infoFields: {
124
- type: Array,
125
- default: () => []
126
- },
127
- /** Data loading state */
128
- isDataLoading: {
129
- type: Boolean,
130
- default: !1
131
- },
132
- /** Data loading text */
133
- dataLoadingText: {
134
- type: String,
135
- default: "Loading data..."
136
- },
137
- /** Show marker count badge */
138
- showMarkerCount: {
139
- type: Boolean,
140
- default: !1
141
- },
142
- /** Show controls */
143
- showControls: {
144
- type: Boolean,
145
- default: !0
146
- },
147
- /** Show default zoom controls */
148
- showDefaultZoomControls: {
149
- type: Boolean,
150
- default: !0
151
- },
152
- /** Show fit to markers button */
153
- showFitButton: {
154
- type: Boolean,
155
- default: !0
156
- },
157
- /** Controls position */
158
- controlsPosition: {
159
- type: String,
160
- default: "bottom-left"
161
- },
162
- /** Auto fit to markers on load */
163
- autoFit: {
164
- type: Boolean,
165
- default: !1
166
- },
167
- /** Fit padding */
168
- fitPadding: {
169
- type: Number,
170
- default: 50
171
- }
172
- },
173
- emits: ["marker-click", "cluster-click", "info-action", "ready", "error", "update:visible-markers", "update:center", "update:zoom"],
174
- setup(s, { expose: K, emit: q }) {
175
- const t = s, d = q, {
176
- markers: T,
177
- clusters: M,
178
- shouldShowClusters: P,
179
- processMarkers: S,
180
- markersFromData: G
181
- } = me({
182
- clustering: t.enableClustering ? {
183
- enabled: !0,
184
- ...t.clusteringOptions
185
- } : { enabled: !1 }
186
- }), h = g(null), F = g(t.center), f = g(t.zoom), m = g(null), p = g(null), y = g(null), O = g(!1), n = g({
187
- visible: !1,
188
- loading: !1,
189
- error: null,
190
- title: "",
191
- subtitle: "",
192
- imageUrl: "",
193
- details: [],
194
- actions: [],
195
- data: void 0
196
- }), H = L(() => ({
197
- apiKey: t.apiKey,
198
- center: t.center,
199
- zoom: t.zoom,
200
- width: t.width,
201
- height: t.height,
202
- theme: t.theme,
203
- autoTheme: t.autoTheme
204
- })), a = L(() => {
205
- if (!t.items.length) return [];
206
- const e = t.items[0];
207
- return "position" in e && "id" in e ? t.items : G(
208
- t.items,
209
- t.coordinateExtractor,
210
- t.idField
211
- ).slice(0, t.maxMarkers);
212
- }), Z = L(() => {
213
- if (P.value && t.enableClustering) {
214
- const e = /* @__PURE__ */ new Set();
215
- return M.value.forEach((o) => {
216
- o.markers.forEach((l) => e.add(l.id));
217
- }), a.value.filter((o) => !e.has(o.id)).slice(0, t.maxMarkers);
218
- }
219
- return m.value ? a.value.filter((e) => {
220
- const { lat: o, lng: l } = e.position, c = m.value;
221
- return o >= c.south && o <= c.north && l >= c.west && l <= c.east;
222
- }).slice(0, t.maxMarkers) : a.value.slice(0, t.maxMarkers);
223
- });
224
- function J(e) {
225
- y.value = e.map, O.value = !0, d("ready", e), t.autoFit && a.value.length > 0 && setTimeout(() => z(), 100);
226
- }
227
- function Q() {
228
- A();
229
- }
230
- function X(e) {
231
- m.value = e.bounds, t.enableClustering && S(f.value, e.bounds), d("update:visible-markers", Z.value);
232
- }
233
- function Y(e) {
234
- f.value = e.zoom, d("update:zoom", e.zoom), t.enableClustering && m.value && S(e.zoom, m.value);
235
- }
236
- function D() {
237
- if (h.value) {
238
- const e = h.value.getBounds?.();
239
- e && (m.value = e);
240
- }
241
- }
242
- function _(e) {
243
- d("error", e);
244
- }
245
- function ee(e) {
246
- d("marker-click", e), t.showInfoWindow && (p.value = e.marker, W(e.marker));
247
- }
248
- function te(e, o) {
249
- d("cluster-click", { cluster: e, markers: e.markers });
250
- const l = new google.maps.LatLngBounds();
251
- e.markers.forEach((c) => l.extend(c.position)), o.fitBounds(l, t.fitPadding);
252
- }
253
- function W(e) {
254
- const o = e.data;
255
- n.value = {
256
- visible: !0,
257
- loading: !1,
258
- error: null,
259
- title: e.title || o?.[t.titleField] || "Details",
260
- subtitle: o?.subtitle || "",
261
- imageUrl: o?.imageUrl || o?.profile_image || o?.image || "",
262
- details: t.infoFields.length > 0 ? t.infoFields.map((l) => ({
263
- label: l.label,
264
- value: o?.[l.field] || "",
265
- type: l.type
266
- })) : [],
267
- actions: t.infoActions,
268
- data: e.data
269
- };
270
- }
271
- function A() {
272
- n.value.visible = !1, p.value = null;
273
- }
274
- function le() {
275
- p.value && W(p.value);
276
- }
277
- function oe(e) {
278
- d("info-action", { ...e, marker: p.value || void 0 });
279
- }
280
- function ae(e) {
281
- return {
282
- path: 0,
283
- // google.maps.SymbolPath.CIRCLE
284
- scale: Math.min(20 + Math.log(e.size) * 5, 40),
285
- fillColor: ge(e.size),
286
- fillOpacity: 0.8,
287
- strokeColor: "#ffffff",
288
- strokeWeight: 2
289
- };
290
- }
291
- function j() {
292
- if (h.value) {
293
- const e = f.value;
294
- h.value.setZoom?.(Math.min(e + 1, 21));
295
- }
296
- }
297
- function N() {
298
- if (h.value) {
299
- const e = f.value;
300
- h.value.setZoom?.(Math.max(e - 1, 1));
301
- }
302
- }
303
- function z() {
304
- if (!y.value || a.value.length === 0) return;
305
- const e = new google.maps.LatLngBounds();
306
- a.value.forEach((o) => e.extend(o.position)), y.value.fitBounds(e, t.fitPadding);
307
- }
308
- return U(() => t.items, () => {
309
- T.value = a.value, t.enableClustering && m.value && S(f.value, m.value), t.autoFit && O.value && a.value.length > 0 && z();
310
- }, { deep: !0 }), U(() => t.center, (e) => {
311
- F.value = e, d("update:center", e);
312
- }), U(() => t.zoom, (e) => {
313
- f.value = e, d("update:zoom", e);
314
- }), ne(() => {
315
- T.value = a.value;
316
- }), K({
317
- getMap: () => y.value,
318
- fitToMarkers: z,
319
- zoomIn: j,
320
- zoomOut: N,
321
- panTo: (e) => y.value?.panTo(e),
322
- setZoom: (e) => y.value?.setZoom(e),
323
- closeInfoWindow: A,
324
- getMarkers: () => a.value,
325
- getVisibleMarkers: () => Z.value,
326
- getClusters: () => M.value
327
- }), (e, o) => (u(), v(B, null, [
328
- w(ce, re({
329
- ref_key: "mapRef",
330
- ref: h
331
- }, H.value, {
332
- "show-custom-controls": s.showControls,
333
- "show-default-zoom-controls": s.showDefaultZoomControls,
334
- "controls-position": s.controlsPosition,
335
- onReady: J,
336
- onClick: Q,
337
- onBoundsChanged: X,
338
- onZoomChanged: Y,
339
- onIdle: D,
340
- onError: _,
341
- center: F.value,
342
- "onUpdate:center": o[0] || (o[0] = (l) => F.value = l),
343
- zoom: f.value,
344
- "onUpdate:zoom": o[1] || (o[1] = (l) => f.value = l)
345
- }), {
346
- default: C(({ ready: l, map: c }) => [
347
- l && c ? (u(), v(B, { key: 0 }, [
348
- k(P) ? (u(!0), v(B, { key: 0 }, R(k(M), (r) => (u(), $(V, {
349
- key: r.id,
350
- position: r.position,
351
- id: r.id,
352
- title: `${r.size} items in this area`,
353
- ready: l,
354
- icon: ae(r),
355
- "z-index": 1e3,
356
- onClick: (he) => te(r, c)
357
- }, null, 8, ["position", "id", "title", "ready", "icon", "onClick"]))), 128)) : b("", !0),
358
- (u(!0), v(B, null, R(Z.value, (r) => (u(), $(V, {
359
- key: r.id,
360
- position: r.position,
361
- id: r.id,
362
- title: r.title,
363
- data: r.data,
364
- ready: l,
365
- color: s.markerColor,
366
- size: s.markerSize,
367
- pin: s.pinMarkers,
368
- icon: s.markerIcon,
369
- "z-index": 100,
370
- onClick: ee
371
- }, null, 8, ["position", "id", "title", "data", "ready", "color", "size", "pin", "icon"]))), 128))
372
- ], 64)) : b("", !0)
373
- ]),
374
- overlay: C(({ isDark: l }) => [
375
- s.isDataLoading ? (u(), v("div", {
376
- key: 0,
377
- class: i(["sl-absolute sl-top-4 sl-left-4 sl-z-10 sl-flex sl-items-center sl-gap-2 sl-px-3 sl-py-2 sl-rounded-lg sl-shadow-md", l ? "sl-bg-gray-800" : "sl-bg-white"])
378
- }, [
379
- x("div", {
380
- class: i(["sl-animate-spin sl-h-4 sl-w-4 sl-border-2 sl-border-t-transparent sl-rounded-full", l ? "sl-border-primary-400" : "sl-border-primary-600"])
381
- }, null, 2),
382
- x("span", {
383
- class: i(["sl-text-sm", l ? "sl-text-gray-300" : "sl-text-gray-600"])
384
- }, E(s.dataLoadingText), 3)
385
- ], 2)) : b("", !0),
386
- s.showMarkerCount && a.value.length > 0 ? (u(), v("div", {
387
- key: 1,
388
- class: i(["sl-absolute sl-top-4 sl-right-4 sl-z-10 sl-px-2 sl-py-1 sl-rounded-md sl-text-xs sl-font-medium", l ? "sl-bg-gray-800/90 sl-text-gray-300" : "sl-bg-white/90 sl-text-gray-700"])
389
- }, E(a.value.length) + " " + E(a.value.length === 1 ? "marker" : "markers"), 3)) : b("", !0),
390
- I(e.$slots, "overlay", {
391
- isDark: l,
392
- markers: a.value,
393
- clusters: k(M)
394
- })
395
- ]),
396
- controls: C(({ isDark: l }) => [
397
- x("div", ve, [
398
- s.showDefaultZoomControls ? (u(), v("div", {
399
- key: 0,
400
- class: i(["sl-flex sl-flex-col sl-rounded-lg sl-shadow-md sl-overflow-hidden", l ? "sl-bg-gray-800" : "sl-bg-white"])
401
- }, [
402
- x("button", {
403
- onClick: j,
404
- class: i(["sl-w-8 sl-h-8 sl-flex sl-items-center sl-justify-center sl-border-b sl-transition-colors", l ? "sl-border-gray-700 hover:sl-bg-gray-700" : "sl-border-gray-200 hover:sl-bg-gray-50"]),
405
- title: "Zoom in"
406
- }, [
407
- w(k(ie), {
408
- class: i(["sl-w-4 sl-h-4", l ? "sl-text-gray-300" : "sl-text-gray-600"])
409
- }, null, 8, ["class"])
410
- ], 2),
411
- x("button", {
412
- onClick: N,
413
- class: i(["sl-w-8 sl-h-8 sl-flex sl-items-center sl-justify-center sl-transition-colors", l ? "hover:sl-bg-gray-700" : "hover:sl-bg-gray-50"]),
414
- title: "Zoom out"
415
- }, [
416
- w(k(ue), {
417
- class: i(["sl-w-4 sl-h-4", l ? "sl-text-gray-300" : "sl-text-gray-600"])
418
- }, null, 8, ["class"])
419
- ], 2)
420
- ], 2)) : b("", !0),
421
- s.showFitButton && a.value.length > 0 ? (u(), v("button", {
422
- key: 1,
423
- onClick: z,
424
- class: i(["sl-w-8 sl-h-8 sl-flex sl-items-center sl-justify-center sl-rounded-lg sl-shadow-md sl-transition-colors", l ? "sl-bg-gray-800 hover:sl-bg-gray-700" : "sl-bg-white hover:sl-bg-gray-50"]),
425
- title: "Fit to all markers"
426
- }, [
427
- w(k(de), {
428
- class: i(["sl-w-4 sl-h-4", l ? "sl-text-gray-300" : "sl-text-gray-600"])
429
- }, null, 8, ["class"])
430
- ], 2)) : b("", !0),
431
- I(e.$slots, "controls", { isDark: l })
432
- ])
433
- ]),
434
- _: 3
435
- }, 16, ["show-custom-controls", "show-default-zoom-controls", "controls-position", "center", "zoom"]),
436
- w(fe, {
437
- visible: n.value.visible,
438
- "onUpdate:visible": o[2] || (o[2] = (l) => n.value.visible = l),
439
- loading: n.value.loading,
440
- error: n.value.error,
441
- title: n.value.title,
442
- subtitle: n.value.subtitle,
443
- "image-url": n.value.imageUrl,
444
- details: n.value.details,
445
- actions: n.value.actions,
446
- data: n.value.data,
447
- "show-avatar": s.showInfoAvatar,
448
- onClose: A,
449
- onRetry: le,
450
- onAction: oe
451
- }, {
452
- footer: C(() => [
453
- I(e.$slots, "info-footer", {
454
- data: n.value.data,
455
- marker: p.value
456
- })
457
- ]),
458
- default: C(() => [
459
- I(e.$slots, "info-content", {
460
- data: n.value.data,
461
- marker: p.value
462
- })
463
- ]),
464
- _: 3
465
- }, 8, ["visible", "loading", "error", "title", "subtitle", "image-url", "details", "actions", "data", "show-avatar"])
466
- ], 64));
467
- }
468
- });
469
- export {
470
- Me as _
471
- };