@alfadocs/ui-kit 1.90.0 → 1.90.2
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-DR4Xn23Z.js +519 -0
- package/dist/_chunks/{address-fields-CfnXK8RT.js → address-fields-qxQkGwPf.js} +5 -5
- package/dist/_chunks/{ai-permission-notice-CoW22jx1.js → ai-permission-notice-VNh3W57L.js} +2 -2
- package/dist/_chunks/{anamnesis-summary-rows-DUMERHK3.js → anamnesis-summary-rows-EKPfVCmh.js} +662 -654
- package/dist/_chunks/autocomplete-BXMcNoa3.js +562 -0
- package/dist/_chunks/{balance-badge-cell-C9-hyfxy.js → balance-badge-cell-D9VhFp0L.js} +3 -3
- package/dist/_chunks/{booking-C0FoW8Yx.js → booking-CcE_oviI.js} +1896 -1859
- package/dist/_chunks/browser-D5CD3WOj.js +565 -0
- package/dist/_chunks/{calendar-appointment-editor-dialog-D8Wkbm8_.js → calendar-appointment-editor-dialog-CiAGAX2t.js} +7 -7
- package/dist/_chunks/{checkbox-BjDv-r3o.js → checkbox-a7Sh-dXb.js} +32 -31
- package/dist/_chunks/{checkbox-group-Cw2H5qaq.js → checkbox-group-eGdv9fZc.js} +2 -2
- package/dist/_chunks/{city-input-CJVGswxp.js → city-input-CA59CjnV.js} +2 -2
- package/dist/_chunks/{combobox-CDPm_n0p.js → combobox-D-gpgEDy.js} +314 -294
- package/dist/_chunks/{country-select-DQ8q7ypA.js → country-select-BfmX9y5i.js} +2 -2
- package/dist/_chunks/{data-table-D7EGpqOn.js → data-table-CqQgoNsU.js} +553 -552
- package/dist/_chunks/{face-scheme-BgJGFDTa.js → face-scheme-BKSE98bo.js} +2 -2
- package/dist/_chunks/{file-manager-DQbWBTfk.js → file-manager-BnI1ZWZu.js} +2 -2
- package/dist/_chunks/{header-settings-BVhjndtV.js → header-settings-BeA2fnol.js} +24 -23
- package/dist/_chunks/{heatmap-BJB6V9yJ.js → heatmap-fCxwNz2o.js} +2 -2
- package/dist/_chunks/index-CpVcVNBu.js +2326 -0
- package/dist/_chunks/{index.es-Bpb8_NrX.js → index.es-Beo-XicE.js} +2 -2
- package/dist/_chunks/jspdf.es.min-BW7y6yhl.js +9674 -0
- package/dist/_chunks/{link-cell-renderer-C0ynDik7.js → link-cell-renderer-CnCgudvq.js} +3 -3
- package/dist/_chunks/{login-dev-card-DYwbL5sD.js → login-dev-card-BZBR58mu.js} +2 -2
- package/dist/_chunks/{map-view-Bvi06RVh.js → map-view-UrNgxBy3.js} +260 -237
- package/dist/_chunks/{index.modern-BeRXQVdc.js → maps-core-gate-DkNqGkm3.js} +360 -319
- package/dist/_chunks/{marketplace-app-shell-x_abo_ye.js → marketplace-app-shell-CmZx0Oam.js} +2 -2
- package/dist/_chunks/{notes-panel-CZO1qsD-.js → notes-panel-Dywo6R55.js} +2 -2
- package/dist/_chunks/{patient-details-D0P5eog5.js → patient-details-BUr7Oemx.js} +2 -2
- package/dist/_chunks/{patient-field-row-R73dZJY6.js → patient-field-row-bJk8Q_qr.js} +5 -5
- package/dist/_chunks/patient-search-Ca9j5cWb.js +1306 -0
- package/dist/_chunks/{patient-summary-card-6U74-ivO.js → patient-summary-card-CCQZ8X37.js} +2 -2
- package/dist/_chunks/{periodontal-diagnosis-B9YmmVmM.js → periodontal-diagnosis-DD3hrg9X.js} +2 -2
- package/dist/_chunks/{permission-matrix-BoQjENGV.js → permission-matrix-BJ6sg3Zp.js} +3 -3
- package/dist/_chunks/{practice-results-B61krlwu.js → practice-results-DQuOfqej.js} +2 -2
- package/dist/_chunks/{province-select-CPdTwEob.js → province-select-D64whw0m.js} +2 -2
- package/dist/_chunks/{registration-form-DmP3YUfp.js → registration-form-CRm6DaB9.js} +2 -2
- package/dist/_chunks/{reviews-panel-UzQQLb-z.js → reviews-panel-B7InBORU.js} +42 -41
- package/dist/_chunks/{rich-text-editor-BZTyxQBd.js → rich-text-editor-BfEu57dk.js} +3 -3
- package/dist/_chunks/{slot-grid-Bb13H9Rl.js → slot-grid-DrwynKeN.js} +91 -89
- package/dist/_chunks/{task-editor-BOETWbjU.js → task-editor-CI1SKUNc.js} +2 -2
- package/dist/_chunks/{use-appointment-details-read-CWN-nJCZ.js → use-appointment-details-read-BytPq3Ux.js} +2 -2
- package/dist/_chunks/{voice-control-panel-BziKE-KK.js → voice-control-panel-BP0otrID.js} +2 -2
- package/dist/_chunks/{workflow-webhook-action-DulCpCRz.js → workflow-webhook-action-B_nBJ_ht.js} +2 -2
- package/dist/agent-catalog.json +2 -2
- package/dist/agent-i18n/en.json +1 -1
- package/dist/components/_shared/maps-core-gate.d.ts +18 -0
- package/dist/components/address-autocomplete/index.js +1 -1
- package/dist/components/address-fields/index.js +1 -1
- package/dist/components/ai-permission-notice/index.js +1 -1
- package/dist/components/appointment-details-panel/index.js +1 -1
- package/dist/components/autocomplete/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/checkbox-group/index.js +1 -1
- package/dist/components/city-input/index.js +1 -1
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/country-select/index.js +1 -1
- package/dist/components/data-table/index.js +2 -2
- package/dist/components/data-table/xlsx-export.d.ts +13 -0
- package/dist/components/face-scheme/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/header-settings/header-settings.d.ts +2 -1
- package/dist/components/header-settings/index.js +1 -1
- package/dist/components/heatmap/index.js +1 -1
- package/dist/components/map-view/index.js +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-search/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/periodontal-diagnosis/index.js +1 -1
- package/dist/components/permission-matrix/index.js +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/province-select/index.js +1 -1
- package/dist/components/reviews-panel/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/slot-grid/index.js +1 -1
- package/dist/components/task-editor/index.js +1 -1
- package/dist/components/voice-control-panel/index.js +1 -1
- package/dist/host-compat.css +1 -10
- package/dist/index.js +37 -37
- package/dist/patterns/anamnesis/anamnesis-export-download.d.ts +1 -1
- package/dist/patterns/anamnesis/anamnesis-export.d.ts +3 -1
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/login-form/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/registration-form/index.js +1 -1
- package/dist/patterns/workflow-webhook-action/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +4 -8
- package/dist/_chunks/address-autocomplete-bPR2mNBt.js +0 -498
- package/dist/_chunks/autocomplete-CnB1mHGc.js +0 -539
- package/dist/_chunks/exceljs.min-D2MHbJsF.js +0 -23046
- package/dist/_chunks/jspdf.es.min-Cal6Nuw_.js +0 -10007
- package/dist/_chunks/patient-search-CCOUZABE.js +0 -1196
|
@@ -0,0 +1,519 @@
|
|
|
1
|
+
import { jsx as d, jsxs as M, Fragment as Ee } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Ne, useRef as _, useMemo as le, useId as Pe, useState as S, useCallback as H, useEffect as Y } from "react";
|
|
3
|
+
import { c as G } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as fe } from "react-i18next";
|
|
5
|
+
import { M as Fe, A as Ve, d as Be } from "./maps-core-gate-DkNqGkm3.js";
|
|
6
|
+
import { E as De } from "./error-boundary-tAn_GuCu.js";
|
|
7
|
+
import { u as Me, a as Se } from "./form-field-context-DtiROUJV.js";
|
|
8
|
+
import { c as Ue } from "./compose-refs-C0k0tdqF.js";
|
|
9
|
+
import { u as $e } from "./use-controllable-state-BiY4xTzM.js";
|
|
10
|
+
import { b as je } from "./menu-row-BAr8bx1I.js";
|
|
11
|
+
import { u as qe } from "./registry-DvAUVLHh.js";
|
|
12
|
+
import { I as Ke, a as X, b as J, c as Oe } from "./input-surface-iBmxVBfr.js";
|
|
13
|
+
import { u as He } from "./use-debounced-callback-BisrB-Fq.js";
|
|
14
|
+
import { M as Ge } from "./map-pin-BaY37-Km.js";
|
|
15
|
+
const Le = {
|
|
16
|
+
id: "address-autocomplete",
|
|
17
|
+
capabilities: ["select_single", "filter", "open", "close"],
|
|
18
|
+
state: {
|
|
19
|
+
value: {
|
|
20
|
+
type: "string",
|
|
21
|
+
descriptionKey: "ui.agent.addressAutocomplete.state.value",
|
|
22
|
+
description: "Current free-text value of the address input.",
|
|
23
|
+
read: (t) => t.getValue()
|
|
24
|
+
},
|
|
25
|
+
query: {
|
|
26
|
+
type: "string",
|
|
27
|
+
descriptionKey: "ui.agent.addressAutocomplete.state.query",
|
|
28
|
+
description: "Current query driving the suggestion listbox.",
|
|
29
|
+
read: (t) => t.getQuery()
|
|
30
|
+
},
|
|
31
|
+
isOpen: {
|
|
32
|
+
type: "boolean",
|
|
33
|
+
descriptionKey: "ui.agent.addressAutocomplete.state.isOpen",
|
|
34
|
+
description: "True when the suggestion listbox is visible.",
|
|
35
|
+
read: (t) => t.getIsOpen()
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
actions: {
|
|
39
|
+
set_value: {
|
|
40
|
+
safety: "write",
|
|
41
|
+
argsType: "{ value: string }",
|
|
42
|
+
argsSchema: {
|
|
43
|
+
type: "object",
|
|
44
|
+
properties: {
|
|
45
|
+
value: {
|
|
46
|
+
type: "string",
|
|
47
|
+
description: "Text to place in the input (also runs a fetch)."
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
required: ["value"]
|
|
51
|
+
},
|
|
52
|
+
idempotent: !0,
|
|
53
|
+
openWorld: !0,
|
|
54
|
+
descriptionKey: "ui.agent.addressAutocomplete.actions.setValue",
|
|
55
|
+
description: "Set the input text programmatically; opens and refreshes the suggestion list (issues an external address-lookup fetch).",
|
|
56
|
+
examples: [
|
|
57
|
+
{ args: { value: "Via Roma 12" }, note: "Seed a partial address." }
|
|
58
|
+
],
|
|
59
|
+
invoke: (t, a) => {
|
|
60
|
+
t.setValue(a.value);
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
apply_filter: {
|
|
64
|
+
safety: "read",
|
|
65
|
+
argsType: "{ query: string }",
|
|
66
|
+
argsSchema: {
|
|
67
|
+
type: "object",
|
|
68
|
+
properties: {
|
|
69
|
+
query: {
|
|
70
|
+
type: "string",
|
|
71
|
+
description: "Query text to filter the address suggestions."
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
required: ["query"]
|
|
75
|
+
},
|
|
76
|
+
idempotent: !0,
|
|
77
|
+
openWorld: !0,
|
|
78
|
+
descriptionKey: "ui.agent.addressAutocomplete.actions.applyFilter",
|
|
79
|
+
description: "Set the query text, which refreshes the suggestion list via an external address-lookup fetch.",
|
|
80
|
+
invoke: (t, a) => {
|
|
81
|
+
t.setQuery(a.query);
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
clear: {
|
|
85
|
+
safety: "write",
|
|
86
|
+
idempotent: !0,
|
|
87
|
+
descriptionKey: "ui.agent.addressAutocomplete.actions.clear",
|
|
88
|
+
description: "Clear the typed text and dismiss the suggestion list.",
|
|
89
|
+
invoke: (t) => {
|
|
90
|
+
t.clear();
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
open: {
|
|
94
|
+
safety: "read",
|
|
95
|
+
idempotent: !0,
|
|
96
|
+
descriptionKey: "ui.agent.addressAutocomplete.actions.open",
|
|
97
|
+
description: "Open the suggestion listbox.",
|
|
98
|
+
invoke: (t) => {
|
|
99
|
+
t.open();
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
close: {
|
|
103
|
+
safety: "read",
|
|
104
|
+
idempotent: !0,
|
|
105
|
+
descriptionKey: "ui.agent.addressAutocomplete.actions.close",
|
|
106
|
+
description: "Close the suggestion listbox.",
|
|
107
|
+
invoke: (t) => {
|
|
108
|
+
t.close();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
domHooks: {
|
|
113
|
+
root: {
|
|
114
|
+
attr: "data-component",
|
|
115
|
+
value: "address-autocomplete",
|
|
116
|
+
description: "Marks the AddressAutocomplete wrapper."
|
|
117
|
+
},
|
|
118
|
+
instanceId: {
|
|
119
|
+
attr: "data-component-id",
|
|
120
|
+
sourceProp: "id",
|
|
121
|
+
description: "Sourced from the id prop. Required to address a specific field from the agent."
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
function U(t) {
|
|
126
|
+
return t.longText ?? t.long_name ?? "";
|
|
127
|
+
}
|
|
128
|
+
function ce(t) {
|
|
129
|
+
return t.shortText ?? t.short_name ?? U(t);
|
|
130
|
+
}
|
|
131
|
+
function C(t, a) {
|
|
132
|
+
return t.find((s) => s.types.includes(a));
|
|
133
|
+
}
|
|
134
|
+
function ue(t, a = "") {
|
|
135
|
+
const s = C(t, "route"), l = C(t, "street_number"), o = C(t, "locality"), n = C(t, "postal_town"), v = C(t, "administrative_area_level_3"), p = C(t, "postal_code"), g = C(t, "administrative_area_level_2"), I = C(t, "country"), y = s ? U(s) : "", r = l ? U(l) : "", u = [y, r].filter(Boolean).join(" ").trim(), c = o ?? n ?? v, N = c ? U(c) : "", P = p ? U(p) : "", L = g ? ce(g).toUpperCase() : "", B = I ? ce(I).toLowerCase() : "";
|
|
136
|
+
return {
|
|
137
|
+
street: u,
|
|
138
|
+
city: N,
|
|
139
|
+
postcode: P,
|
|
140
|
+
province: L,
|
|
141
|
+
country: B,
|
|
142
|
+
formatted: a
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
const Qe = G(
|
|
146
|
+
["ds:flex ds:w-full ds:items-center", Oe].join(" "),
|
|
147
|
+
{
|
|
148
|
+
variants: {
|
|
149
|
+
size: {
|
|
150
|
+
sm: `${X.sm} ${J.sm}`,
|
|
151
|
+
md: `${X.md} ${J.md}`,
|
|
152
|
+
lg: `${X.lg} ${J.lg}`
|
|
153
|
+
},
|
|
154
|
+
tone: Ke
|
|
155
|
+
},
|
|
156
|
+
defaultVariants: { size: "md", tone: "default" }
|
|
157
|
+
}
|
|
158
|
+
), ze = G(
|
|
159
|
+
[
|
|
160
|
+
"ds:flex-1 ds:min-w-0 ds:ps-3 ds:pe-3 ds:bg-transparent ds:text-foreground",
|
|
161
|
+
"ds:placeholder:text-muted-foreground",
|
|
162
|
+
"ds:outline-none ds:focus:outline-none ds:focus-visible:outline-none",
|
|
163
|
+
"ds:disabled:cursor-not-allowed ds:read-only:cursor-default"
|
|
164
|
+
].join(" ")
|
|
165
|
+
), We = "ds:inline-flex ds:items-center ds:shrink-0 ds:ps-3 ds:text-muted-foreground ds:[&_svg]:size-4", Xe = G(
|
|
166
|
+
[
|
|
167
|
+
"ds:absolute ds:z-[var(--z-dropdown)] ds:mt-[var(--spacing-2xs)] ds:w-full",
|
|
168
|
+
"ds:overflow-auto ds:max-h-[18rem]",
|
|
169
|
+
"ds:rounded-[var(--radius-sm)] ds:border ds:border-border ds:bg-background",
|
|
170
|
+
"ds:shadow-[var(--shadow-md)] ds:p-[var(--spacing-xs)]"
|
|
171
|
+
].join(" ")
|
|
172
|
+
), Je = G(
|
|
173
|
+
[
|
|
174
|
+
"ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]",
|
|
175
|
+
"ds:ps-3 ds:pe-3 ds:py-2 ds:rounded-[var(--radius-sm)]",
|
|
176
|
+
"ds:cursor-pointer ds:select-none ds:text-foreground",
|
|
177
|
+
"ds:text-start",
|
|
178
|
+
// Hover moves the active row, so a separate hover tint would light two.
|
|
179
|
+
je.active
|
|
180
|
+
].join(" ")
|
|
181
|
+
), pe = "ds:ps-3 ds:pe-3 ds:py-2 type-body-sm ds:text-muted-foreground";
|
|
182
|
+
function Ye({
|
|
183
|
+
regionCodes: t,
|
|
184
|
+
onEngine: a
|
|
185
|
+
}) {
|
|
186
|
+
const s = Be("places"), l = _(null), o = !!(s && "AutocompleteSuggestion" in s && "Place" in s && "AutocompleteSessionToken" in s), n = H(
|
|
187
|
+
async (p) => {
|
|
188
|
+
if (!s || p.trim().length === 0) return [];
|
|
189
|
+
if (o) {
|
|
190
|
+
l.current || (l.current = new s.AutocompleteSessionToken());
|
|
191
|
+
const { suggestions: r } = await s.AutocompleteSuggestion.fetchAutocompleteSuggestions({
|
|
192
|
+
input: p,
|
|
193
|
+
sessionToken: l.current,
|
|
194
|
+
includedRegionCodes: t
|
|
195
|
+
});
|
|
196
|
+
return r.map((u) => {
|
|
197
|
+
var N, P;
|
|
198
|
+
const c = u.placePrediction;
|
|
199
|
+
return c ? {
|
|
200
|
+
placeId: c.placeId,
|
|
201
|
+
primaryText: ((N = c.mainText) == null ? void 0 : N.text) ?? c.text.text,
|
|
202
|
+
secondaryText: (P = c.secondaryText) == null ? void 0 : P.text
|
|
203
|
+
} : null;
|
|
204
|
+
}).filter((u) => u !== null);
|
|
205
|
+
}
|
|
206
|
+
const g = s.AutocompleteService;
|
|
207
|
+
return g ? (await new g().getPlacePredictions({ input: p })).predictions.map((r) => {
|
|
208
|
+
var u, c;
|
|
209
|
+
return {
|
|
210
|
+
placeId: r.place_id,
|
|
211
|
+
primaryText: ((u = r.structured_formatting) == null ? void 0 : u.main_text) ?? r.description,
|
|
212
|
+
secondaryText: (c = r.structured_formatting) == null ? void 0 : c.secondary_text
|
|
213
|
+
};
|
|
214
|
+
}) : [];
|
|
215
|
+
},
|
|
216
|
+
[s, o, t]
|
|
217
|
+
), v = H(
|
|
218
|
+
async (p) => {
|
|
219
|
+
if (p.address) return p.address;
|
|
220
|
+
if (!s) return null;
|
|
221
|
+
if (o) {
|
|
222
|
+
const y = new s.Place({ id: p.placeId }), { place: r } = await y.fetchFields({
|
|
223
|
+
fields: ["addressComponents", "formattedAddress"]
|
|
224
|
+
});
|
|
225
|
+
l.current = null;
|
|
226
|
+
const u = r.addressComponents ?? [];
|
|
227
|
+
return ue(
|
|
228
|
+
u,
|
|
229
|
+
r.formattedAddress ?? ""
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
const g = s.PlacesService;
|
|
233
|
+
if (!g) return null;
|
|
234
|
+
const I = new g(document.createElement("div"));
|
|
235
|
+
return new Promise((y) => {
|
|
236
|
+
I.getDetails(
|
|
237
|
+
{
|
|
238
|
+
placeId: p.placeId,
|
|
239
|
+
fields: ["address_components", "formatted_address"]
|
|
240
|
+
},
|
|
241
|
+
(r) => {
|
|
242
|
+
if (!r) {
|
|
243
|
+
y(null);
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
const u = r.address_components ?? [];
|
|
247
|
+
y(
|
|
248
|
+
ue(
|
|
249
|
+
u,
|
|
250
|
+
r.formatted_address ?? ""
|
|
251
|
+
)
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
);
|
|
255
|
+
});
|
|
256
|
+
},
|
|
257
|
+
[s, o]
|
|
258
|
+
);
|
|
259
|
+
return Y(() => {
|
|
260
|
+
if (s)
|
|
261
|
+
return a({ getSuggestions: n, resolveSelection: v }), () => a(null);
|
|
262
|
+
}, [s, n, v, a]), null;
|
|
263
|
+
}
|
|
264
|
+
function Ze({
|
|
265
|
+
apiKey: t,
|
|
266
|
+
forwardedRef: a,
|
|
267
|
+
regionCodes: s,
|
|
268
|
+
...l
|
|
269
|
+
}) {
|
|
270
|
+
const { i18n: o } = fe("ui"), [n, v] = S(null);
|
|
271
|
+
return /* @__PURE__ */ M(Ee, { children: [
|
|
272
|
+
/* @__PURE__ */ d(
|
|
273
|
+
Z,
|
|
274
|
+
{
|
|
275
|
+
...l,
|
|
276
|
+
forwardedRef: a,
|
|
277
|
+
getSuggestions: n == null ? void 0 : n.getSuggestions,
|
|
278
|
+
resolveSelection: n == null ? void 0 : n.resolveSelection
|
|
279
|
+
}
|
|
280
|
+
),
|
|
281
|
+
/* @__PURE__ */ d(De, { fallback: null, children: /* @__PURE__ */ d(Fe, { pending: null, children: /* @__PURE__ */ d(Ve, { apiKey: t, language: o.language, children: /* @__PURE__ */ d(
|
|
282
|
+
Ye,
|
|
283
|
+
{
|
|
284
|
+
regionCodes: s,
|
|
285
|
+
onEngine: v
|
|
286
|
+
}
|
|
287
|
+
) }) }) })
|
|
288
|
+
] });
|
|
289
|
+
}
|
|
290
|
+
function Z({
|
|
291
|
+
forwardedRef: t,
|
|
292
|
+
value: a,
|
|
293
|
+
defaultValue: s,
|
|
294
|
+
onValueChange: l,
|
|
295
|
+
onSelect: o,
|
|
296
|
+
getSuggestions: n,
|
|
297
|
+
resolveSelection: v,
|
|
298
|
+
placeholder: p,
|
|
299
|
+
debounceMs: g = 250,
|
|
300
|
+
disabled: I,
|
|
301
|
+
required: y,
|
|
302
|
+
readOnly: r,
|
|
303
|
+
name: u,
|
|
304
|
+
id: c,
|
|
305
|
+
size: N = "md",
|
|
306
|
+
tone: P = "default",
|
|
307
|
+
className: L,
|
|
308
|
+
"aria-label": B
|
|
309
|
+
}) {
|
|
310
|
+
const { t: R } = fe("ui"), A = Me(), Q = _(null), me = le(
|
|
311
|
+
() => Ue(t, Q),
|
|
312
|
+
[t]
|
|
313
|
+
), he = Pe(), $ = Se(A, c) ?? he, ee = `${$}-listbox`, ve = `${$}-live`, te = (e) => `${$}-opt-${e}`, F = !!(A.disabled || I), ge = !!(A.required || y), se = A.invalid, ye = se ? "error" : P, xe = A.describedBy || void 0, [be, k] = $e({
|
|
314
|
+
value: a,
|
|
315
|
+
defaultValue: s ?? "",
|
|
316
|
+
onChange: l
|
|
317
|
+
}), m = be ?? "", [T, h] = S(!1), [f, j] = S([]), [D, z] = S(!1), [w, x] = S(-1), q = _(!1), K = _(""), Ae = p ?? R("inputs.addressAutocomplete.placeholder"), re = H(
|
|
318
|
+
(e) => {
|
|
319
|
+
!n || F || r || q.current || (K.current = e, z(!0), Promise.resolve(n(e)).then((i) => {
|
|
320
|
+
K.current === e && (j(i), x(-1), z(!1));
|
|
321
|
+
}).catch(() => {
|
|
322
|
+
K.current === e && (j([]), z(!1));
|
|
323
|
+
}));
|
|
324
|
+
},
|
|
325
|
+
[n, F, r]
|
|
326
|
+
), b = He(re, g), oe = _(!!n);
|
|
327
|
+
Y(() => {
|
|
328
|
+
const e = oe.current;
|
|
329
|
+
oe.current = !!n, !e && n && T && m.trim().length > 0 && re(m);
|
|
330
|
+
}, [n]), Y(() => () => b.cancel(), [b]);
|
|
331
|
+
const Te = (e) => {
|
|
332
|
+
k(e), !(F || r) && (T || h(!0), !q.current && b(e));
|
|
333
|
+
}, ne = H(
|
|
334
|
+
(e) => {
|
|
335
|
+
var i;
|
|
336
|
+
k(e.primaryText), h(!1), x(-1), j([]), K.current = e.primaryText, v ? Promise.resolve(v(e)).then((E) => {
|
|
337
|
+
E && (o == null || o(E));
|
|
338
|
+
}).catch(() => {
|
|
339
|
+
}) : e.address && (o == null || o(e.address)), (i = Q.current) == null || i.focus();
|
|
340
|
+
},
|
|
341
|
+
[k, v, o, Q]
|
|
342
|
+
), ae = T && !D && m.trim().length > 0 && f.length === 0 && !!n, O = f.length > 0, V = T && (O || ae || D), we = (e) => {
|
|
343
|
+
if (!e.nativeEvent.isComposing) {
|
|
344
|
+
if (e.key === "ArrowDown") {
|
|
345
|
+
if (e.preventDefault(), !T) {
|
|
346
|
+
h(!0), m && b(m);
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
if (f.length === 0) return;
|
|
350
|
+
x((i) => (i + 1) % f.length);
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
if (e.key === "ArrowUp") {
|
|
354
|
+
if (e.preventDefault(), f.length === 0) return;
|
|
355
|
+
x(
|
|
356
|
+
(i) => i <= 0 ? f.length - 1 : i - 1
|
|
357
|
+
);
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
if (e.key === "Enter") {
|
|
361
|
+
V && (e.preventDefault(), w >= 0 && f[w] && ne(f[w]));
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
e.key === "Escape" && T && (e.preventDefault(), h(!1), x(-1));
|
|
365
|
+
}
|
|
366
|
+
}, Ce = () => {
|
|
367
|
+
F || r || m && (h(!0), b(m));
|
|
368
|
+
}, _e = (e) => {
|
|
369
|
+
var E;
|
|
370
|
+
const i = e.relatedTarget;
|
|
371
|
+
i && ((E = ie.current) != null && E.contains(i)) || (h(!1), x(-1));
|
|
372
|
+
}, ie = _(null), Ie = T && w >= 0 && f[w] ? te(f[w].placeId) : void 0, W = _(m);
|
|
373
|
+
W.current = m;
|
|
374
|
+
const de = _(V);
|
|
375
|
+
de.current = V;
|
|
376
|
+
const Re = le(
|
|
377
|
+
() => ({
|
|
378
|
+
getValue: () => W.current,
|
|
379
|
+
getQuery: () => W.current,
|
|
380
|
+
getIsOpen: () => de.current,
|
|
381
|
+
setValue: (e) => {
|
|
382
|
+
k(e), h(!0), b(e);
|
|
383
|
+
},
|
|
384
|
+
setQuery: (e) => {
|
|
385
|
+
k(e), h(!0), b(e);
|
|
386
|
+
},
|
|
387
|
+
clear: () => {
|
|
388
|
+
k(""), h(!1), x(-1), j([]);
|
|
389
|
+
},
|
|
390
|
+
open: () => h(!0),
|
|
391
|
+
close: () => {
|
|
392
|
+
h(!1), x(-1);
|
|
393
|
+
}
|
|
394
|
+
}),
|
|
395
|
+
[k, b]
|
|
396
|
+
);
|
|
397
|
+
qe(Le, Re, c);
|
|
398
|
+
const ke = D ? R("inputs.addressAutocomplete.loading") : T && m.trim().length > 0 ? R("inputs.addressAutocomplete.results", { count: f.length }) : "";
|
|
399
|
+
return /* @__PURE__ */ M(
|
|
400
|
+
"div",
|
|
401
|
+
{
|
|
402
|
+
className: "ds:relative ds:w-full",
|
|
403
|
+
"data-component": "address-autocomplete",
|
|
404
|
+
"data-component-id": c,
|
|
405
|
+
children: [
|
|
406
|
+
/* @__PURE__ */ M(
|
|
407
|
+
"div",
|
|
408
|
+
{
|
|
409
|
+
className: Qe({ size: N, tone: ye, className: L }),
|
|
410
|
+
"data-disabled": F || void 0,
|
|
411
|
+
children: [
|
|
412
|
+
/* @__PURE__ */ d("span", { "aria-hidden": "true", className: We, children: /* @__PURE__ */ d(Ge, {}) }),
|
|
413
|
+
/* @__PURE__ */ d(
|
|
414
|
+
"input",
|
|
415
|
+
{
|
|
416
|
+
ref: me,
|
|
417
|
+
id: $,
|
|
418
|
+
name: u,
|
|
419
|
+
type: "text",
|
|
420
|
+
autoComplete: "off",
|
|
421
|
+
role: "combobox",
|
|
422
|
+
"aria-autocomplete": "list",
|
|
423
|
+
"aria-expanded": V,
|
|
424
|
+
"aria-controls": V ? ee : void 0,
|
|
425
|
+
"aria-activedescendant": Ie,
|
|
426
|
+
"aria-describedby": xe,
|
|
427
|
+
"aria-invalid": se || void 0,
|
|
428
|
+
"aria-label": B ?? (A.label ? void 0 : R("inputs.addressAutocomplete.ariaLabel")),
|
|
429
|
+
"aria-labelledby": !B && A.label ? `${A.id}-label` : void 0,
|
|
430
|
+
placeholder: Ae,
|
|
431
|
+
value: m,
|
|
432
|
+
disabled: F,
|
|
433
|
+
required: ge,
|
|
434
|
+
readOnly: r,
|
|
435
|
+
onChange: (e) => Te(e.target.value),
|
|
436
|
+
onKeyDown: we,
|
|
437
|
+
onFocus: Ce,
|
|
438
|
+
onBlur: _e,
|
|
439
|
+
onCompositionStart: () => {
|
|
440
|
+
q.current = !0;
|
|
441
|
+
},
|
|
442
|
+
onCompositionEnd: (e) => {
|
|
443
|
+
q.current = !1, b(e.currentTarget.value);
|
|
444
|
+
},
|
|
445
|
+
className: ze()
|
|
446
|
+
}
|
|
447
|
+
)
|
|
448
|
+
]
|
|
449
|
+
}
|
|
450
|
+
),
|
|
451
|
+
V ? /* @__PURE__ */ M(
|
|
452
|
+
"ul",
|
|
453
|
+
{
|
|
454
|
+
ref: ie,
|
|
455
|
+
id: ee,
|
|
456
|
+
role: "listbox",
|
|
457
|
+
"aria-label": B ?? R("inputs.addressAutocomplete.listLabel"),
|
|
458
|
+
className: Xe(),
|
|
459
|
+
children: [
|
|
460
|
+
O ? f.map((e, i) => /* @__PURE__ */ M(
|
|
461
|
+
"li",
|
|
462
|
+
{
|
|
463
|
+
id: te(e.placeId),
|
|
464
|
+
role: "option",
|
|
465
|
+
"aria-selected": i === w,
|
|
466
|
+
"data-active": i === w || void 0,
|
|
467
|
+
onMouseDown: (E) => {
|
|
468
|
+
E.preventDefault(), ne(e);
|
|
469
|
+
},
|
|
470
|
+
onMouseEnter: () => x(i),
|
|
471
|
+
className: Je(),
|
|
472
|
+
children: [
|
|
473
|
+
/* @__PURE__ */ d("span", { className: "ds:truncate", children: e.primaryText }),
|
|
474
|
+
e.secondaryText ? /* @__PURE__ */ d("span", { className: "type-meta ds:text-muted-foreground ds:truncate", children: e.secondaryText }) : null
|
|
475
|
+
]
|
|
476
|
+
},
|
|
477
|
+
e.placeId
|
|
478
|
+
)) : null,
|
|
479
|
+
!O && D ? /* @__PURE__ */ d("li", { role: "presentation", className: pe, children: R("inputs.addressAutocomplete.loading") }) : null,
|
|
480
|
+
!O && !D && ae ? /* @__PURE__ */ d("li", { role: "presentation", className: pe, children: R("inputs.addressAutocomplete.noResults") }) : null
|
|
481
|
+
]
|
|
482
|
+
}
|
|
483
|
+
) : null,
|
|
484
|
+
/* @__PURE__ */ d(
|
|
485
|
+
"span",
|
|
486
|
+
{
|
|
487
|
+
id: ve,
|
|
488
|
+
role: "status",
|
|
489
|
+
"aria-live": "polite",
|
|
490
|
+
"aria-atomic": "true",
|
|
491
|
+
className: "ds:sr-only",
|
|
492
|
+
children: ke
|
|
493
|
+
}
|
|
494
|
+
)
|
|
495
|
+
]
|
|
496
|
+
}
|
|
497
|
+
);
|
|
498
|
+
}
|
|
499
|
+
const et = Ne(function({ apiKey: a, getSuggestions: s, ...l }, o) {
|
|
500
|
+
return s ? /* @__PURE__ */ d(
|
|
501
|
+
Z,
|
|
502
|
+
{
|
|
503
|
+
...l,
|
|
504
|
+
forwardedRef: o,
|
|
505
|
+
getSuggestions: s,
|
|
506
|
+
resolveSelection: tt
|
|
507
|
+
}
|
|
508
|
+
) : a ? /* @__PURE__ */ d(Ze, { ...l, apiKey: a, forwardedRef: o }) : /* @__PURE__ */ d(Z, { ...l, forwardedRef: o });
|
|
509
|
+
});
|
|
510
|
+
et.displayName = "AddressAutocomplete";
|
|
511
|
+
async function tt(t) {
|
|
512
|
+
return t.address ?? null;
|
|
513
|
+
}
|
|
514
|
+
export {
|
|
515
|
+
et as A,
|
|
516
|
+
Le as a,
|
|
517
|
+
ue as p
|
|
518
|
+
};
|
|
519
|
+
//# sourceMappingURL=address-autocomplete-DR4Xn23Z.js.map
|
|
@@ -2,13 +2,13 @@ import { jsx as c } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as k, useRef as N, useEffect as O, useCallback as D, useMemo as B } from "react";
|
|
3
3
|
import { c as H } from "./index-D2ZczOXr.js";
|
|
4
4
|
import { useTranslation as K } from "react-i18next";
|
|
5
|
-
import { C as M } from "./country-select-
|
|
6
|
-
import { P as U } from "./province-select-
|
|
5
|
+
import { C as M } from "./country-select-BfmX9y5i.js";
|
|
6
|
+
import { P as U } from "./province-select-D64whw0m.js";
|
|
7
7
|
import { P as W } from "./postal-code-input-CfZOnIkW.js";
|
|
8
|
-
import { C as Y } from "./city-input-
|
|
8
|
+
import { C as Y } from "./city-input-CA59CjnV.js";
|
|
9
9
|
import { T as z } from "./text-input-CaG9ApoE.js";
|
|
10
10
|
import { F as y } from "./form-field-CyHfOVKF.js";
|
|
11
|
-
import { A as G } from "./address-autocomplete-
|
|
11
|
+
import { A as G } from "./address-autocomplete-DR4Xn23Z.js";
|
|
12
12
|
import { u as J } from "./registry-DvAUVLHh.js";
|
|
13
13
|
const Q = {
|
|
14
14
|
street: { type: "string" },
|
|
@@ -295,4 +295,4 @@ export {
|
|
|
295
295
|
te as A,
|
|
296
296
|
X as a
|
|
297
297
|
};
|
|
298
|
-
//# sourceMappingURL=address-fields-
|
|
298
|
+
//# sourceMappingURL=address-fields-qxQkGwPf.js.map
|
|
@@ -5,7 +5,7 @@ import { useTranslation as P } from "react-i18next";
|
|
|
5
5
|
import { A as g } from "./alert-9kEwDza3.js";
|
|
6
6
|
import { B as D } from "./badge-BUk4RjTS.js";
|
|
7
7
|
import { B as H } from "./button-DohK_Ak_.js";
|
|
8
|
-
import { C as J } from "./checkbox-
|
|
8
|
+
import { C as J } from "./checkbox-a7Sh-dXb.js";
|
|
9
9
|
import { S as U } from "./spinner-CoflYlEx.js";
|
|
10
10
|
import { T as W } from "./timestamp-DPLDWdxA.js";
|
|
11
11
|
import { u as _ } from "./registry-DvAUVLHh.js";
|
|
@@ -203,4 +203,4 @@ export {
|
|
|
203
203
|
Q as A,
|
|
204
204
|
$ as a
|
|
205
205
|
};
|
|
206
|
-
//# sourceMappingURL=ai-permission-notice-
|
|
206
|
+
//# sourceMappingURL=ai-permission-notice-VNh3W57L.js.map
|