@alfadocs/ui-kit 0.41.2 → 0.42.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.
- package/dist/_chunks/address-autocomplete-CSjMrBvu.js +358 -0
- package/dist/_chunks/{alia-sidebar-DXsYPinm.js → alia-sidebar-BpX4z_af.js} +2 -2
- package/dist/_chunks/{bmi-calculator-DnEr513I.js → bmi-calculator-D4juUcyF.js} +57 -51
- package/dist/_chunks/{breadcrumb-CLlhx7qo.js → breadcrumb-OTbaY70e.js} +4 -4
- package/dist/_chunks/cycle-calculator-DsZbyzX6.js +191 -0
- package/dist/_chunks/{document-scanner-CqS_klIr.js → document-scanner-BqLsGs4Y.js} +7 -7
- package/dist/_chunks/{dropdown-menu-BC5ZdOMo.js → dropdown-menu-CUEXqKis.js} +2 -2
- package/dist/_chunks/{due-date-calculator-CUspKSTw.js → due-date-calculator-s_CBgaFs.js} +53 -40
- package/dist/_chunks/{editable-currency-cell-renderer-DgkCIIcO.js → editable-currency-cell-renderer-BhUkRiPZ.js} +2 -2
- package/dist/_chunks/{freemium-paywall-BAk3a6er.js → freemium-paywall-BLXESpH4.js} +2 -2
- package/dist/_chunks/{gestational-age-calculator-CsQ05qDy.js → gestational-age-calculator-CWOG3bkI.js} +56 -43
- package/dist/_chunks/{header-settings-CBLwUK6t.js → header-settings-Bx0Biimh.js} +2 -2
- package/dist/_chunks/index.modern-D2LGACWg.js +1529 -0
- package/dist/_chunks/insert-result-DtQQeSSf.js +227 -0
- package/dist/_chunks/{kbd-Cglkd7CY.js → kbd-D855ZXIW.js} +2 -2
- package/dist/_chunks/map-view-Tb5VfK9Y.js +333 -0
- package/dist/_chunks/marketplace-app-shell-kVAVycz_.js +391 -0
- package/dist/_chunks/{patient-search-CBq62kmL.js → patient-search-DPe2ZYEL.js} +2 -2
- package/dist/_chunks/{patient-shell-DF81lALv.js → patient-shell-lDX3wwu6.js} +2 -2
- package/dist/_chunks/{payment-form-Dy3WIIsC.js → payment-form-BzVsG6Ks.js} +5 -5
- package/dist/_chunks/{pdf-viewer-Cy6Ul3hZ.js → pdf-viewer-B6MC6VTx.js} +139 -126
- package/dist/_chunks/{practice-results-C0d4IL5E.js → practice-results-CrLpEiiW.js} +4 -4
- package/dist/_chunks/pregnancy-weight-gain-B7kBK-ZR.js +223 -0
- package/dist/_chunks/{public-header.agent-B2dDg2_d.js → public-header.agent-BY6FH71R.js} +2 -2
- package/dist/_chunks/radio-group-CLjK-SlK.js +167 -0
- package/dist/_chunks/{rich-text-editor-DLbg2852.js → rich-text-editor-DhGIBd4a.js} +10 -10
- package/dist/_chunks/{sheet-BV-yuLE2.js → sheet-xbzu4YiY.js} +7 -7
- package/dist/_chunks/{sign-document-CpLDZ6Db.js → sign-document-QHfcNKFj.js} +5 -5
- package/dist/_chunks/{signature-capture-DoiBd6i3.js → signature-capture-CpMBhqQ9.js} +6 -6
- package/dist/_chunks/tab-bar-C4II-7ej.js +86 -0
- package/dist/_chunks/{theme-toggle-DpC28kt5.js → theme-toggle-ClATnY4Q.js} +2 -2
- package/dist/_chunks/{toast.agent-WHHfw5VX.js → toast.agent-B0MCsvdZ.js} +2 -2
- package/dist/_chunks/{unit-converter-EUwO6QYq.js → unit-converter-D1UrEUxa.js} +46 -40
- package/dist/_chunks/{workflow-map-C3gB0FvB.js → workflow-map-BFNpzTiw.js} +2 -2
- package/dist/agent-catalog.json +1 -1
- package/dist/brand/product-lockup/product-lockup.d.ts +16 -0
- package/dist/components/_shared/insert-result.d.ts +21 -4
- package/dist/components/address-autocomplete/address-autocomplete.d.ts +77 -0
- package/dist/components/address-autocomplete/index.d.ts +4 -0
- package/dist/components/address-autocomplete/index.js +6 -0
- package/dist/components/address-autocomplete/parse-address.d.ts +52 -0
- package/dist/components/bmi-calculator/bmi-calculator.d.ts +11 -1
- package/dist/components/bmi-calculator/index.js +1 -1
- package/dist/components/breadcrumb/index.js +1 -1
- package/dist/components/cycle-calculator/cycle-calculator.d.ts +12 -2
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/document-scanner/index.js +1 -1
- package/dist/components/dropdown-menu/index.js +1 -1
- package/dist/components/due-date-calculator/due-date-calculator.d.ts +11 -1
- package/dist/components/due-date-calculator/index.js +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/gestational-age-calculator/gestational-age-calculator.d.ts +12 -2
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/header-settings/index.js +1 -1
- package/dist/components/index.d.ts +3 -1
- package/dist/components/kbd/index.js +1 -1
- package/dist/components/map-view/index.js +1 -1
- package/dist/components/matrix-rain/matrix-rain.d.ts +1 -1
- package/dist/components/patient-search/index.js +1 -1
- package/dist/components/payment-form/index.js +1 -1
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.d.ts +12 -2
- package/dist/components/public-header/index.js +1 -1
- package/dist/components/radio-group/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/sheet/index.js +1 -1
- package/dist/components/sign-document/index.js +1 -1
- package/dist/components/signature-capture/index.js +1 -1
- package/dist/components/tab-bar/index.d.ts +3 -0
- package/dist/components/tab-bar/index.js +5 -0
- package/dist/components/tab-bar/tab-bar.d.ts +61 -0
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/toast/index.js +1 -1
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/unit-converter/unit-converter.d.ts +11 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +17 -0
- package/dist/i18n/locales/ar.js +18 -1
- package/dist/i18n/locales/de.d.ts +17 -0
- package/dist/i18n/locales/de.js +18 -1
- package/dist/i18n/locales/el.d.ts +17 -0
- package/dist/i18n/locales/el.js +18 -1
- package/dist/i18n/locales/en.d.ts +17 -0
- package/dist/i18n/locales/en.js +18 -1
- package/dist/i18n/locales/es.d.ts +17 -0
- package/dist/i18n/locales/es.js +18 -1
- package/dist/i18n/locales/fr.d.ts +17 -0
- package/dist/i18n/locales/fr.js +18 -1
- package/dist/i18n/locales/hi.d.ts +17 -0
- package/dist/i18n/locales/hi.js +18 -1
- package/dist/i18n/locales/it.d.ts +17 -0
- package/dist/i18n/locales/it.js +18 -1
- package/dist/i18n/locales/ja.d.ts +17 -0
- package/dist/i18n/locales/ja.js +18 -1
- package/dist/i18n/locales/nl.d.ts +17 -0
- package/dist/i18n/locales/nl.js +18 -1
- package/dist/i18n/locales/pl.d.ts +17 -0
- package/dist/i18n/locales/pl.js +18 -1
- package/dist/i18n/locales/pt.d.ts +17 -0
- package/dist/i18n/locales/pt.js +18 -1
- package/dist/i18n/locales/ro.d.ts +17 -0
- package/dist/i18n/locales/ro.js +18 -1
- package/dist/i18n/locales/ru.d.ts +17 -0
- package/dist/i18n/locales/ru.js +18 -1
- package/dist/i18n/locales/sq.d.ts +17 -0
- package/dist/i18n/locales/sq.js +18 -1
- package/dist/i18n/locales/sv.d.ts +17 -0
- package/dist/i18n/locales/sv.js +18 -1
- package/dist/i18n/locales/tr.d.ts +17 -0
- package/dist/i18n/locales/tr.js +18 -1
- package/dist/i18n/locales/zh.d.ts +17 -0
- package/dist/i18n/locales/zh.js +18 -1
- package/dist/index.js +604 -599
- package/dist/locales/ar.json +18 -1
- package/dist/locales/de.json +18 -1
- package/dist/locales/el.json +18 -1
- package/dist/locales/en.json +18 -1
- package/dist/locales/es.json +18 -1
- package/dist/locales/fr.json +18 -1
- package/dist/locales/hi.json +18 -1
- package/dist/locales/it.json +18 -1
- package/dist/locales/ja.json +18 -1
- package/dist/locales/nl.json +18 -1
- package/dist/locales/pl.json +18 -1
- package/dist/locales/pt.json +18 -1
- package/dist/locales/ro.json +18 -1
- package/dist/locales/ru.json +18 -1
- package/dist/locales/sq.json +18 -1
- package/dist/locales/sv.json +18 -1
- package/dist/locales/tr.json +18 -1
- package/dist/locales/zh.json +18 -1
- package/dist/patterns/alia-assistant/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/marketplace-app-shell.d.ts +30 -3
- package/dist/patterns/patient-shell/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +16 -1
- package/dist/_chunks/cycle-calculator-B5Uj9QeT.js +0 -185
- package/dist/_chunks/insert-result-yJ0QavoN.js +0 -133
- package/dist/_chunks/map-view-qJLybrmN.js +0 -1850
- package/dist/_chunks/marketplace-app-shell-BlxVizU4.js +0 -296
- package/dist/_chunks/pregnancy-weight-gain-BCdi-JSv.js +0 -209
- package/dist/_chunks/radio-group-BcF92GEF.js +0 -152
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { jsxs as A, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as P, useRef as S } from "react";
|
|
3
|
+
import { useTranslation as z } from "react-i18next";
|
|
4
|
+
import { c as M } from "./index-D2ZczOXr.js";
|
|
5
|
+
import { B as N } from "./button-DD_0Xdmr.js";
|
|
6
|
+
import { c as C } from "./createLucideIcon-CrFbzy84.js";
|
|
7
|
+
import { I as _ } from "./image-C6RM5hfF.js";
|
|
8
|
+
/**
|
|
9
|
+
* @license lucide-react v1.8.0 - ISC
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the ISC license.
|
|
12
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
13
|
+
*/
|
|
14
|
+
const k = [
|
|
15
|
+
[
|
|
16
|
+
"path",
|
|
17
|
+
{
|
|
18
|
+
d: "M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",
|
|
19
|
+
key: "zw3jo"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"path",
|
|
24
|
+
{
|
|
25
|
+
d: "M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",
|
|
26
|
+
key: "1wduqc"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
"path",
|
|
31
|
+
{
|
|
32
|
+
d: "M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",
|
|
33
|
+
key: "kqbvx6"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
], T = C("layers", k);
|
|
37
|
+
/**
|
|
38
|
+
* @license lucide-react v1.8.0 - ISC
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the ISC license.
|
|
41
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
+
*/
|
|
43
|
+
const E = [
|
|
44
|
+
["path", { d: "M12 4v16", key: "1654pz" }],
|
|
45
|
+
["path", { d: "M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2", key: "e0r10z" }],
|
|
46
|
+
["path", { d: "M9 20h6", key: "s66wpe" }]
|
|
47
|
+
], H = C("type", E), L = ["fg", "muted", "accent", "border", "bg"], I = 380;
|
|
48
|
+
function v(t) {
|
|
49
|
+
const e = {
|
|
50
|
+
fg: "currentColor",
|
|
51
|
+
muted: "currentColor",
|
|
52
|
+
accent: "currentColor",
|
|
53
|
+
border: "currentColor",
|
|
54
|
+
bg: "transparent",
|
|
55
|
+
font: "sans-serif"
|
|
56
|
+
};
|
|
57
|
+
if (!t) return e;
|
|
58
|
+
const n = (o) => {
|
|
59
|
+
const a = t.querySelector(`[data-k="${o}"]`);
|
|
60
|
+
return a && getComputedStyle(a).color || "currentColor";
|
|
61
|
+
};
|
|
62
|
+
return {
|
|
63
|
+
fg: n("fg"),
|
|
64
|
+
muted: n("muted"),
|
|
65
|
+
accent: n("accent"),
|
|
66
|
+
border: n("border"),
|
|
67
|
+
bg: n("bg"),
|
|
68
|
+
font: getComputedStyle(t).fontFamily || "sans-serif"
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const g = (t) => t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
72
|
+
function Y(t) {
|
|
73
|
+
const e = [t.title];
|
|
74
|
+
t.highlight && e.push(t.highlight);
|
|
75
|
+
for (const n of t.fields) e.push(`• ${n.label}: ${n.value}`);
|
|
76
|
+
return e.join(`
|
|
77
|
+
`);
|
|
78
|
+
}
|
|
79
|
+
function B(t) {
|
|
80
|
+
const e = t.fields.map((o) => `<li>${g(o.label)}: ${g(o.value)}</li>`).join(""), n = t.highlight ? `<p><strong>${g(t.highlight)}</strong></p>` : "";
|
|
81
|
+
return `<p><strong>${g(t.title)}</strong></p>${n}<ul>${e}</ul>`;
|
|
82
|
+
}
|
|
83
|
+
function V(t) {
|
|
84
|
+
return (t.highlight ? 62 : 38) + 28 + t.fields.length * 22 + 8 + 20;
|
|
85
|
+
}
|
|
86
|
+
function D(t, e) {
|
|
87
|
+
const n = I, o = 20, a = o + 18, s = !!t.highlight, l = a + 24, r = (s ? l : a) + 28, c = 22, x = r + t.fields.length * c + 8, $ = x + o, m = g(e.font), y = t.fields.map((f, d) => {
|
|
88
|
+
const h = r + d * c;
|
|
89
|
+
return `<text x="${o}" y="${h}" font-family="${m}" font-size="13"><tspan fill="${e.muted}">${g(
|
|
90
|
+
f.label
|
|
91
|
+
)}: </tspan><tspan fill="${e.fg}">${g(f.value)}</tspan></text>`;
|
|
92
|
+
}).join(""), i = s ? `<text x="${o}" y="${l}" font-family="${m}" font-size="14" font-weight="600" fill="${e.accent}">${g(
|
|
93
|
+
t.highlight
|
|
94
|
+
)}</text>` : "";
|
|
95
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="${$}" viewBox="0 0 ${n} ${$}" role="img" aria-label="${g(
|
|
96
|
+
t.title
|
|
97
|
+
)}"><rect x="0.5" y="0.5" width="${n - 1}" height="${$ - 1}" rx="12" fill="${e.bg}" stroke="${e.border}"/><text x="${o}" y="${a}" font-family="${m}" font-size="16" font-weight="700" fill="${e.fg}">${g(
|
|
98
|
+
t.title
|
|
99
|
+
)}</text>${i}${y}<text x="${o}" y="${x}" font-family="${m}" font-size="10" fill="${e.muted}">AlfaDocs</text></svg>`;
|
|
100
|
+
}
|
|
101
|
+
function j() {
|
|
102
|
+
var t;
|
|
103
|
+
return typeof navigator < "u" && typeof ((t = navigator.clipboard) == null ? void 0 : t.write) == "function" && typeof ClipboardItem < "u";
|
|
104
|
+
}
|
|
105
|
+
function q(t, e, n) {
|
|
106
|
+
return new Promise((o, a) => {
|
|
107
|
+
const s = new Image();
|
|
108
|
+
s.decoding = "async", s.onload = () => {
|
|
109
|
+
const l = document.createElement("canvas");
|
|
110
|
+
l.width = e, l.height = n;
|
|
111
|
+
const r = l.getContext("2d");
|
|
112
|
+
if (!r) {
|
|
113
|
+
a(new Error("2D canvas context unavailable"));
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
r.drawImage(s, 0, 0, e, n), l.toBlob((c) => {
|
|
117
|
+
c ? o(c) : a(new Error("canvas.toBlob produced no PNG"));
|
|
118
|
+
}, "image/png");
|
|
119
|
+
}, s.onerror = () => a(new Error("SVG failed to decode as an image")), s.src = t;
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
async function F(t, e, n) {
|
|
123
|
+
const o = Y(e), a = new Blob([o], { type: "text/plain" });
|
|
124
|
+
if (t === "text")
|
|
125
|
+
return new ClipboardItem({ "text/plain": a });
|
|
126
|
+
const s = D(e, n), l = `data:image/svg+xml,${encodeURIComponent(s)}`, r = await q(l, I, V(e));
|
|
127
|
+
if (t === "image")
|
|
128
|
+
return new ClipboardItem({ "image/png": r, "text/plain": a });
|
|
129
|
+
const c = new Blob([B(e)], { type: "text/html" });
|
|
130
|
+
return new ClipboardItem({
|
|
131
|
+
"text/html": c,
|
|
132
|
+
"image/png": r,
|
|
133
|
+
"text/plain": a
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
const O = M(
|
|
137
|
+
"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
138
|
+
{
|
|
139
|
+
variants: {
|
|
140
|
+
variant: {
|
|
141
|
+
insert: "",
|
|
142
|
+
copy: ""
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
defaultVariants: { variant: "insert" }
|
|
146
|
+
}
|
|
147
|
+
), U = ["text", "image", "text-image"], G = {
|
|
148
|
+
text: /* @__PURE__ */ u(H, { "aria-hidden": !0 }),
|
|
149
|
+
image: /* @__PURE__ */ u(_, { "aria-hidden": !0 }),
|
|
150
|
+
"text-image": /* @__PURE__ */ u(T, { "aria-hidden": !0 })
|
|
151
|
+
}, w = {
|
|
152
|
+
insert: {
|
|
153
|
+
text: "insert.text",
|
|
154
|
+
image: "insert.image",
|
|
155
|
+
"text-image": "insert.textImage"
|
|
156
|
+
},
|
|
157
|
+
copy: {
|
|
158
|
+
text: "insert.copyText",
|
|
159
|
+
image: "insert.copyImage",
|
|
160
|
+
"text-image": "insert.copyTextImage"
|
|
161
|
+
}
|
|
162
|
+
}, W = P(
|
|
163
|
+
function({ card: e, variant: n = "insert", onInsert: o, onCopy: a, onError: s, size: l = "sm" }, r) {
|
|
164
|
+
const { t: c } = z(), p = S(null), x = (i) => {
|
|
165
|
+
const f = Y(e), d = B(e);
|
|
166
|
+
let h = "", b = "";
|
|
167
|
+
if (i !== "text") {
|
|
168
|
+
const R = v(p.current);
|
|
169
|
+
h = D(e, R), b = `data:image/svg+xml,${encodeURIComponent(h)}`;
|
|
170
|
+
}
|
|
171
|
+
return { mode: i, text: f, html: d, svg: h, imageDataUri: b };
|
|
172
|
+
}, y = n === "copy" ? (i) => {
|
|
173
|
+
if (!j()) {
|
|
174
|
+
s == null || s(new Error("Clipboard write unavailable in this context"));
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
const f = v(p.current);
|
|
178
|
+
(async () => {
|
|
179
|
+
try {
|
|
180
|
+
const d = await F(i, e, f);
|
|
181
|
+
await navigator.clipboard.write([d]), a == null || a(i);
|
|
182
|
+
} catch (d) {
|
|
183
|
+
s == null || s(d);
|
|
184
|
+
}
|
|
185
|
+
})();
|
|
186
|
+
} : (i) => {
|
|
187
|
+
o == null || o(x(i));
|
|
188
|
+
};
|
|
189
|
+
return /* @__PURE__ */ A(
|
|
190
|
+
"div",
|
|
191
|
+
{
|
|
192
|
+
ref: r,
|
|
193
|
+
"data-component": "insert-result",
|
|
194
|
+
"data-variant": n,
|
|
195
|
+
className: O({ variant: n }),
|
|
196
|
+
children: [
|
|
197
|
+
/* @__PURE__ */ u("span", { ref: p, "aria-hidden": !0, className: "ds:sr-only", children: L.map((i) => /* @__PURE__ */ u(
|
|
198
|
+
"span",
|
|
199
|
+
{
|
|
200
|
+
"data-k": i,
|
|
201
|
+
className: i === "fg" ? "ds:text-foreground" : i === "muted" ? "ds:text-muted-foreground" : i === "accent" ? "ds:text-[color:var(--primary)]" : i === "border" ? "ds:text-[color:var(--border)]" : "ds:text-[color:var(--card)]"
|
|
202
|
+
},
|
|
203
|
+
i
|
|
204
|
+
)) }),
|
|
205
|
+
U.map((i) => /* @__PURE__ */ u(
|
|
206
|
+
N,
|
|
207
|
+
{
|
|
208
|
+
type: "button",
|
|
209
|
+
intent: "outline",
|
|
210
|
+
size: l,
|
|
211
|
+
startIcon: G[i],
|
|
212
|
+
"aria-label": c(w[n][i]),
|
|
213
|
+
onClick: () => y(i),
|
|
214
|
+
children: c(w[n][i])
|
|
215
|
+
},
|
|
216
|
+
i
|
|
217
|
+
))
|
|
218
|
+
]
|
|
219
|
+
}
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
W.displayName = "InsertButton";
|
|
224
|
+
export {
|
|
225
|
+
W as I
|
|
226
|
+
};
|
|
227
|
+
//# sourceMappingURL=insert-result-DtQQeSSf.js.map
|
|
@@ -83,7 +83,7 @@ const h = x(
|
|
|
83
83
|
"ds:rounded-[var(--radius-sm)]",
|
|
84
84
|
"ds:select-none",
|
|
85
85
|
// Tight minimum size so single-key pills never collapse.
|
|
86
|
-
"ds:min-inline-size
|
|
86
|
+
"ds:[min-inline-size:1.5em] ds:[min-block-size:1.5em]"
|
|
87
87
|
].join(" "),
|
|
88
88
|
{
|
|
89
89
|
variants: {
|
|
@@ -225,4 +225,4 @@ export {
|
|
|
225
225
|
$ as K,
|
|
226
226
|
_ as k
|
|
227
227
|
};
|
|
228
|
-
//# sourceMappingURL=kbd-
|
|
228
|
+
//# sourceMappingURL=kbd-D855ZXIW.js.map
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
import { jsx as n, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as J, useId as K, useMemo as h, useState as T, useEffect as u, useRef as O, useCallback as N, useImperativeHandle as Q } from "react";
|
|
3
|
+
import { c } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as Z } from "react-i18next";
|
|
5
|
+
import { A as W, M as X, a as Y, P as C, b as k, c as ee } from "./index.modern-D2LGACWg.js";
|
|
6
|
+
import { B as se } from "./button-DD_0Xdmr.js";
|
|
7
|
+
import { u as ae } from "./registry-nPAVE19X.js";
|
|
8
|
+
import { M as te } from "./map-pin-B8STOPMJ.js";
|
|
9
|
+
import { E as ne } from "./external-link-C6F25E6k.js";
|
|
10
|
+
const oe = {
|
|
11
|
+
id: "map-view",
|
|
12
|
+
capabilities: [],
|
|
13
|
+
state: {},
|
|
14
|
+
actions: {
|
|
15
|
+
pan_to: {
|
|
16
|
+
safety: "read",
|
|
17
|
+
argsType: "{ position: { lat: number; lng: number } }",
|
|
18
|
+
description: "Pan the map to a new centre without changing zoom.",
|
|
19
|
+
invoke: (t, o) => {
|
|
20
|
+
t.panTo(o.position);
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
set_zoom: {
|
|
24
|
+
safety: "read",
|
|
25
|
+
argsType: "{ zoom: number }",
|
|
26
|
+
description: "Set the map zoom level (typical range 1–20).",
|
|
27
|
+
invoke: (t, o) => {
|
|
28
|
+
t.setZoom(o.zoom);
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
select_marker: {
|
|
32
|
+
safety: "read",
|
|
33
|
+
argsType: "{ id: string | null }",
|
|
34
|
+
description: "Select a marker by id, or pass null to clear the selection.",
|
|
35
|
+
invoke: (t, o) => {
|
|
36
|
+
t.selectMarker(o.id);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
domHooks: {
|
|
41
|
+
root: {
|
|
42
|
+
attr: "data-component",
|
|
43
|
+
value: "map-view",
|
|
44
|
+
description: "Marks the element as a kit MapView."
|
|
45
|
+
},
|
|
46
|
+
instanceId: {
|
|
47
|
+
attr: "data-component-id",
|
|
48
|
+
sourceProp: "id",
|
|
49
|
+
description: "Sourced from the id prop."
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}, re = c(
|
|
53
|
+
["ds:relative ds:overflow-hidden ds:block", "ds:bg-[var(--muted)]"].join(" "),
|
|
54
|
+
{
|
|
55
|
+
variants: {
|
|
56
|
+
size: {
|
|
57
|
+
sm: "ds:[--map-block-size:14rem]",
|
|
58
|
+
md: "ds:[--map-block-size:20rem]",
|
|
59
|
+
lg: "ds:[--map-block-size:28rem]",
|
|
60
|
+
// `fill` defers sizing to the parent. The outer takes
|
|
61
|
+
// `block-size: 100%` so the inner (also 100%) has something
|
|
62
|
+
// to inherit from. Use inside a viewport-locked column —
|
|
63
|
+
// `<PracticeResults variant="map-first">` wires this through
|
|
64
|
+
// automatically; standalone consumers must give the parent
|
|
65
|
+
// a constrained block-size or the map collapses to 0.
|
|
66
|
+
fill: "ds:[block-size:100%]"
|
|
67
|
+
},
|
|
68
|
+
surface: {
|
|
69
|
+
bordered: "ds:rounded-[var(--radius-md)] ds:border ds:border-[color:var(--border)]",
|
|
70
|
+
elevated: "ds:rounded-[var(--radius-md)] ds:shadow-[var(--shadow-card)] ds:border ds:border-[color:var(--card-border)] ds:[.theme-accessible_&]:border-2",
|
|
71
|
+
bare: "ds:rounded-none ds:border-0"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
defaultVariants: { size: "md", surface: "bordered" }
|
|
75
|
+
}
|
|
76
|
+
), ie = c("ds:block ds:inline-size-full", {
|
|
77
|
+
variants: {
|
|
78
|
+
size: {
|
|
79
|
+
sm: "ds:[block-size:var(--map-block-size)]",
|
|
80
|
+
md: "ds:[block-size:var(--map-block-size)]",
|
|
81
|
+
lg: "ds:[block-size:var(--map-block-size)]",
|
|
82
|
+
fill: "ds:[block-size:100%]"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
defaultVariants: { size: "md" }
|
|
86
|
+
}), de = c(
|
|
87
|
+
[
|
|
88
|
+
"ds:absolute ds:inset-0",
|
|
89
|
+
"ds:flex ds:flex-col ds:items-center ds:justify-center",
|
|
90
|
+
"ds:gap-[var(--spacing-sm)]",
|
|
91
|
+
"ds:p-[var(--spacing-md)]",
|
|
92
|
+
"ds:bg-[var(--muted)] ds:text-[var(--foreground)]",
|
|
93
|
+
"ds:text-center"
|
|
94
|
+
].join(" ")
|
|
95
|
+
), le = c("type-heading-3 ds:m-0"), I = c(
|
|
96
|
+
"type-body-sm ds:text-[var(--muted-foreground)] ds:[max-inline-size:28rem] ds:m-0"
|
|
97
|
+
);
|
|
98
|
+
function ce({
|
|
99
|
+
onHandleReady: t,
|
|
100
|
+
onMarkerSelect: o
|
|
101
|
+
}) {
|
|
102
|
+
const a = ee();
|
|
103
|
+
return u(() => {
|
|
104
|
+
a && t({
|
|
105
|
+
panTo: (i) => a.panTo(i),
|
|
106
|
+
setZoom: (i) => a.setZoom(i),
|
|
107
|
+
selectMarker: (i) => o(i)
|
|
108
|
+
});
|
|
109
|
+
}, [a, t, o]), null;
|
|
110
|
+
}
|
|
111
|
+
function me({
|
|
112
|
+
address: t,
|
|
113
|
+
description: o,
|
|
114
|
+
onLoadMap: a,
|
|
115
|
+
openInGoogleMapsHref: i,
|
|
116
|
+
consentCta: f
|
|
117
|
+
}) {
|
|
118
|
+
const { t: l } = Z();
|
|
119
|
+
return /* @__PURE__ */ p("div", { className: de(), "data-testid": "map-view-consent", children: [
|
|
120
|
+
/* @__PURE__ */ n(
|
|
121
|
+
te,
|
|
122
|
+
{
|
|
123
|
+
"aria-hidden": "true",
|
|
124
|
+
className: "ds:size-6 ds:text-[var(--muted-foreground)]"
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
/* @__PURE__ */ n("p", { className: le(), children: l("mapView.consentTitle") }),
|
|
128
|
+
t ? /* @__PURE__ */ n(
|
|
129
|
+
"p",
|
|
130
|
+
{
|
|
131
|
+
className: I(),
|
|
132
|
+
"data-testid": "map-view-address",
|
|
133
|
+
children: t
|
|
134
|
+
}
|
|
135
|
+
) : null,
|
|
136
|
+
/* @__PURE__ */ n("p", { className: I(), children: o }),
|
|
137
|
+
/* @__PURE__ */ p("div", { className: "ds:flex ds:gap-[var(--spacing-sm)] ds:flex-wrap ds:items-center ds:justify-center", children: [
|
|
138
|
+
f ?? /* @__PURE__ */ n(
|
|
139
|
+
se,
|
|
140
|
+
{
|
|
141
|
+
type: "button",
|
|
142
|
+
intent: "primary",
|
|
143
|
+
size: "sm",
|
|
144
|
+
onClick: a,
|
|
145
|
+
"data-testid": "map-view-load-cta",
|
|
146
|
+
children: l("mapView.consentCta")
|
|
147
|
+
}
|
|
148
|
+
),
|
|
149
|
+
/* @__PURE__ */ p(
|
|
150
|
+
"a",
|
|
151
|
+
{
|
|
152
|
+
href: i,
|
|
153
|
+
target: "_blank",
|
|
154
|
+
rel: "noopener noreferrer",
|
|
155
|
+
className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)] ds:text-[var(--primary)] ds:underline ds:underline-offset-2",
|
|
156
|
+
children: [
|
|
157
|
+
l("mapView.openInGoogleMaps"),
|
|
158
|
+
/* @__PURE__ */ n(ne, { "aria-hidden": "true", className: "ds:size-3" })
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
] })
|
|
163
|
+
] });
|
|
164
|
+
}
|
|
165
|
+
const pe = J(
|
|
166
|
+
({
|
|
167
|
+
id: t,
|
|
168
|
+
apiKey: o,
|
|
169
|
+
center: a,
|
|
170
|
+
zoom: i = 15,
|
|
171
|
+
markers: f,
|
|
172
|
+
selectedMarkerId: l,
|
|
173
|
+
onMarkerClick: r,
|
|
174
|
+
consentGranted: P = !1,
|
|
175
|
+
onConsentRequest: v,
|
|
176
|
+
address: m,
|
|
177
|
+
consentDescription: L,
|
|
178
|
+
consentCta: M,
|
|
179
|
+
mapId: w,
|
|
180
|
+
size: y,
|
|
181
|
+
surface: j,
|
|
182
|
+
ariaLabel: A,
|
|
183
|
+
className: S,
|
|
184
|
+
..._
|
|
185
|
+
}, E) => {
|
|
186
|
+
const { t: b, i18n: H } = Z(), z = K(), R = h(
|
|
187
|
+
() => `map-${z.replace(/[^a-zA-Z0-9-_]/g, "")}`,
|
|
188
|
+
[z]
|
|
189
|
+
), [V, $] = T(!1);
|
|
190
|
+
u(() => {
|
|
191
|
+
if (typeof window > "u") return;
|
|
192
|
+
const e = window.matchMedia("(prefers-reduced-motion: reduce)"), s = () => $(e.matches);
|
|
193
|
+
return s(), e.addEventListener("change", s), () => e.removeEventListener("change", s);
|
|
194
|
+
}, []);
|
|
195
|
+
const B = h(() => `https://www.google.com/maps/search/?api=1&query=${m ? encodeURIComponent(m) : `${a.lat},${a.lng}`}`, [m, a.lat, a.lng]), d = O(null), D = N((e) => {
|
|
196
|
+
d.current = e;
|
|
197
|
+
}, []);
|
|
198
|
+
Q(
|
|
199
|
+
E,
|
|
200
|
+
() => ({
|
|
201
|
+
panTo: (e) => {
|
|
202
|
+
var s;
|
|
203
|
+
return (s = d.current) == null ? void 0 : s.panTo(e);
|
|
204
|
+
},
|
|
205
|
+
setZoom: (e) => {
|
|
206
|
+
var s;
|
|
207
|
+
return (s = d.current) == null ? void 0 : s.setZoom(e);
|
|
208
|
+
},
|
|
209
|
+
selectMarker: (e) => {
|
|
210
|
+
var s;
|
|
211
|
+
return (s = d.current) == null ? void 0 : s.selectMarker(e);
|
|
212
|
+
}
|
|
213
|
+
}),
|
|
214
|
+
[]
|
|
215
|
+
);
|
|
216
|
+
const q = h(
|
|
217
|
+
() => ({
|
|
218
|
+
panTo: (e) => {
|
|
219
|
+
var s;
|
|
220
|
+
return (s = d.current) == null ? void 0 : s.panTo(e);
|
|
221
|
+
},
|
|
222
|
+
setZoom: (e) => {
|
|
223
|
+
var s;
|
|
224
|
+
return (s = d.current) == null ? void 0 : s.setZoom(e);
|
|
225
|
+
},
|
|
226
|
+
selectMarker: (e) => {
|
|
227
|
+
var s;
|
|
228
|
+
return (s = d.current) == null ? void 0 : s.selectMarker(e);
|
|
229
|
+
}
|
|
230
|
+
}),
|
|
231
|
+
[]
|
|
232
|
+
);
|
|
233
|
+
ae(oe, q, t), u(() => {
|
|
234
|
+
var e;
|
|
235
|
+
V || (e = d.current) == null || e.panTo(a);
|
|
236
|
+
}, [a.lat, a.lng, V]), u(() => {
|
|
237
|
+
var e;
|
|
238
|
+
(e = d.current) == null || e.setZoom(i);
|
|
239
|
+
}, [i]);
|
|
240
|
+
const [G, x] = T(!1), U = P || G, F = N(() => {
|
|
241
|
+
if (v) {
|
|
242
|
+
v(), x(!0);
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
x(!0);
|
|
246
|
+
}, [v]);
|
|
247
|
+
return /* @__PURE__ */ n(
|
|
248
|
+
"div",
|
|
249
|
+
{
|
|
250
|
+
className: re({ size: y, surface: j, className: S }),
|
|
251
|
+
"data-component": "map-view",
|
|
252
|
+
"data-component-id": t ?? R,
|
|
253
|
+
role: "region",
|
|
254
|
+
"aria-label": A ?? b("mapView.label"),
|
|
255
|
+
..._,
|
|
256
|
+
children: /* @__PURE__ */ n("div", { className: ie({ size: y }), children: U ? /* @__PURE__ */ n(
|
|
257
|
+
W,
|
|
258
|
+
{
|
|
259
|
+
apiKey: o,
|
|
260
|
+
language: H.language,
|
|
261
|
+
children: /* @__PURE__ */ p(
|
|
262
|
+
X,
|
|
263
|
+
{
|
|
264
|
+
defaultCenter: a,
|
|
265
|
+
defaultZoom: i,
|
|
266
|
+
mapId: w,
|
|
267
|
+
gestureHandling: "cooperative",
|
|
268
|
+
disableDefaultUI: !1,
|
|
269
|
+
onClick: () => r == null ? void 0 : r(null),
|
|
270
|
+
className: "ds:[inline-size:100%] ds:[block-size:100%]",
|
|
271
|
+
children: [
|
|
272
|
+
/* @__PURE__ */ n(
|
|
273
|
+
ce,
|
|
274
|
+
{
|
|
275
|
+
onHandleReady: D,
|
|
276
|
+
onMarkerSelect: (e) => r == null ? void 0 : r(e)
|
|
277
|
+
}
|
|
278
|
+
),
|
|
279
|
+
(f ?? []).map((e) => {
|
|
280
|
+
const s = l != null && l === e.id, g = b("mapView.markerLabel", {
|
|
281
|
+
label: e.label ?? e.id
|
|
282
|
+
});
|
|
283
|
+
return w ? /* @__PURE__ */ n(
|
|
284
|
+
Y,
|
|
285
|
+
{
|
|
286
|
+
position: e.position,
|
|
287
|
+
title: g,
|
|
288
|
+
"aria-label": g,
|
|
289
|
+
"data-selected": s ? "true" : "false",
|
|
290
|
+
onClick: () => r == null ? void 0 : r(e.id),
|
|
291
|
+
children: /* @__PURE__ */ n(
|
|
292
|
+
C,
|
|
293
|
+
{
|
|
294
|
+
background: "var(--primary)",
|
|
295
|
+
borderColor: "var(--primary)",
|
|
296
|
+
glyphColor: "var(--primary-foreground)"
|
|
297
|
+
}
|
|
298
|
+
)
|
|
299
|
+
},
|
|
300
|
+
e.id
|
|
301
|
+
) : /* @__PURE__ */ n(
|
|
302
|
+
k,
|
|
303
|
+
{
|
|
304
|
+
position: e.position,
|
|
305
|
+
title: g,
|
|
306
|
+
onClick: () => r == null ? void 0 : r(e.id)
|
|
307
|
+
},
|
|
308
|
+
e.id
|
|
309
|
+
);
|
|
310
|
+
})
|
|
311
|
+
]
|
|
312
|
+
}
|
|
313
|
+
)
|
|
314
|
+
}
|
|
315
|
+
) : /* @__PURE__ */ n(
|
|
316
|
+
me,
|
|
317
|
+
{
|
|
318
|
+
address: m,
|
|
319
|
+
description: L ?? b("mapView.consentDescription"),
|
|
320
|
+
onLoadMap: F,
|
|
321
|
+
consentCta: M,
|
|
322
|
+
openInGoogleMapsHref: B
|
|
323
|
+
}
|
|
324
|
+
) })
|
|
325
|
+
}
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
);
|
|
329
|
+
pe.displayName = "MapView";
|
|
330
|
+
export {
|
|
331
|
+
pe as M
|
|
332
|
+
};
|
|
333
|
+
//# sourceMappingURL=map-view-Tb5VfK9Y.js.map
|