@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,358 @@
|
|
|
1
|
+
import { jsx as i, jsxs as S } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as we, useRef as B, useMemo as _e, useId as Ce, useState as z, useCallback as H, useEffect as Ie } from "react";
|
|
3
|
+
import { c as O } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as de } from "react-i18next";
|
|
5
|
+
import { A as Re, u as Ne } from "./index.modern-D2LGACWg.js";
|
|
6
|
+
import { u as Pe } from "./form-field-context-B3APVHKx.js";
|
|
7
|
+
import { c as Ee } from "./compose-refs-C0k0tdqF.js";
|
|
8
|
+
import { u as ke } from "./use-controllable-state-BiY4xTzM.js";
|
|
9
|
+
import { I as De, a as J, b as W, c as Fe } from "./input-surface-xyERuLU_.js";
|
|
10
|
+
import { u as Be } from "./use-debounced-callback-BisrB-Fq.js";
|
|
11
|
+
import { M as Ue } from "./map-pin-B8STOPMJ.js";
|
|
12
|
+
function U(s) {
|
|
13
|
+
return s.longText ?? s.long_name ?? "";
|
|
14
|
+
}
|
|
15
|
+
function ne(s) {
|
|
16
|
+
return s.shortText ?? s.short_name ?? U(s);
|
|
17
|
+
}
|
|
18
|
+
function y(s, u) {
|
|
19
|
+
return s.find((p) => p.types.includes(u));
|
|
20
|
+
}
|
|
21
|
+
function oe(s, u = "") {
|
|
22
|
+
const p = y(s, "route"), f = y(s, "street_number"), t = y(s, "locality"), a = y(s, "postal_town"), m = y(s, "administrative_area_level_3"), I = y(s, "postal_code"), R = y(s, "administrative_area_level_2"), d = y(s, "country"), h = p ? U(p) : "", v = f ? U(f) : "", x = [h, v].filter(Boolean).join(" ").trim(), r = t ?? a ?? m, o = r ? U(r) : "", c = I ? U(I) : "", N = R ? ne(R).toUpperCase() : "", g = d ? ne(d).toLowerCase() : "";
|
|
23
|
+
return {
|
|
24
|
+
street: x,
|
|
25
|
+
city: o,
|
|
26
|
+
postcode: c,
|
|
27
|
+
province: N,
|
|
28
|
+
country: g,
|
|
29
|
+
formatted: u
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const $e = O(
|
|
33
|
+
["ds:flex ds:w-full ds:items-center", Fe].join(" "),
|
|
34
|
+
{
|
|
35
|
+
variants: {
|
|
36
|
+
size: {
|
|
37
|
+
sm: `${J.sm} ${W.sm}`,
|
|
38
|
+
md: `${J.md} ${W.md}`,
|
|
39
|
+
lg: `${J.lg} ${W.lg}`
|
|
40
|
+
},
|
|
41
|
+
tone: De
|
|
42
|
+
},
|
|
43
|
+
defaultVariants: { size: "md", tone: "default" }
|
|
44
|
+
}
|
|
45
|
+
), Me = O(
|
|
46
|
+
[
|
|
47
|
+
"ds:flex-1 ds:min-w-0 ds:ps-3 ds:pe-3 ds:bg-transparent ds:text-foreground",
|
|
48
|
+
"ds:placeholder:text-muted-foreground",
|
|
49
|
+
"ds:outline-none ds:focus:outline-none ds:focus-visible:outline-none",
|
|
50
|
+
"ds:disabled:cursor-not-allowed ds:read-only:cursor-default"
|
|
51
|
+
].join(" ")
|
|
52
|
+
), Ve = "ds:inline-flex ds:items-center ds:shrink-0 ds:ps-3 ds:text-muted-foreground ds:[&_svg]:size-4", je = O(
|
|
53
|
+
[
|
|
54
|
+
"ds:absolute ds:z-[var(--z-dropdown)] ds:mt-[var(--spacing-2xs)] ds:w-full",
|
|
55
|
+
"ds:overflow-auto ds:max-h-[18rem]",
|
|
56
|
+
"ds:rounded-[var(--radius-sm)] ds:border ds:border-border ds:bg-background",
|
|
57
|
+
"ds:shadow-[var(--shadow-md)] ds:p-[var(--spacing-xs)]"
|
|
58
|
+
].join(" ")
|
|
59
|
+
), Le = O(
|
|
60
|
+
[
|
|
61
|
+
"ds:flex ds:flex-col ds:gap-[var(--spacing-3xs)]",
|
|
62
|
+
"ds:ps-3 ds:pe-3 ds:py-2 ds:rounded-[var(--radius-sm)]",
|
|
63
|
+
"ds:cursor-pointer ds:select-none ds:text-foreground",
|
|
64
|
+
"ds:text-start",
|
|
65
|
+
"ds:data-[active=true]:bg-primary ds:data-[active=true]:text-primary-foreground",
|
|
66
|
+
"ds:hover:bg-muted ds:data-[active=true]:hover:bg-primary"
|
|
67
|
+
].join(" ")
|
|
68
|
+
), ae = "ds:ps-3 ds:pe-3 ds:py-2 type-body-sm ds:text-muted-foreground";
|
|
69
|
+
function Se({
|
|
70
|
+
forwardedRef: s,
|
|
71
|
+
regionCodes: u,
|
|
72
|
+
onSelect: p,
|
|
73
|
+
...f
|
|
74
|
+
}) {
|
|
75
|
+
const t = Ne("places"), a = B(null), m = !!(t && "AutocompleteSuggestion" in t && "Place" in t && "AutocompleteSessionToken" in t), I = H(
|
|
76
|
+
async (d) => {
|
|
77
|
+
if (!t || d.trim().length === 0) return [];
|
|
78
|
+
if (m) {
|
|
79
|
+
a.current || (a.current = new t.AutocompleteSessionToken());
|
|
80
|
+
const { suggestions: r } = await t.AutocompleteSuggestion.fetchAutocompleteSuggestions({
|
|
81
|
+
input: d,
|
|
82
|
+
sessionToken: a.current,
|
|
83
|
+
includedRegionCodes: u
|
|
84
|
+
});
|
|
85
|
+
return r.map((o) => {
|
|
86
|
+
var N, g;
|
|
87
|
+
const c = o.placePrediction;
|
|
88
|
+
return c ? {
|
|
89
|
+
placeId: c.placeId,
|
|
90
|
+
primaryText: ((N = c.mainText) == null ? void 0 : N.text) ?? c.text.text,
|
|
91
|
+
secondaryText: (g = c.secondaryText) == null ? void 0 : g.text
|
|
92
|
+
} : null;
|
|
93
|
+
}).filter((o) => o !== null);
|
|
94
|
+
}
|
|
95
|
+
const h = t.AutocompleteService;
|
|
96
|
+
return h ? (await new h().getPlacePredictions({ input: d })).predictions.map((r) => {
|
|
97
|
+
var o, c;
|
|
98
|
+
return {
|
|
99
|
+
placeId: r.place_id,
|
|
100
|
+
primaryText: ((o = r.structured_formatting) == null ? void 0 : o.main_text) ?? r.description,
|
|
101
|
+
secondaryText: (c = r.structured_formatting) == null ? void 0 : c.secondary_text
|
|
102
|
+
};
|
|
103
|
+
}) : [];
|
|
104
|
+
},
|
|
105
|
+
[t, m, u]
|
|
106
|
+
), R = H(
|
|
107
|
+
async (d) => {
|
|
108
|
+
if (d.address) return d.address;
|
|
109
|
+
if (!t) return null;
|
|
110
|
+
if (m) {
|
|
111
|
+
const x = new t.Place({ id: d.placeId }), { place: r } = await x.fetchFields({
|
|
112
|
+
fields: ["addressComponents", "formattedAddress"]
|
|
113
|
+
});
|
|
114
|
+
a.current = null;
|
|
115
|
+
const o = r.addressComponents ?? [];
|
|
116
|
+
return oe(
|
|
117
|
+
o,
|
|
118
|
+
r.formattedAddress ?? ""
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
const h = t.PlacesService;
|
|
122
|
+
if (!h) return null;
|
|
123
|
+
const v = new h(document.createElement("div"));
|
|
124
|
+
return new Promise((x) => {
|
|
125
|
+
v.getDetails(
|
|
126
|
+
{
|
|
127
|
+
placeId: d.placeId,
|
|
128
|
+
fields: ["address_components", "formatted_address"]
|
|
129
|
+
},
|
|
130
|
+
(r) => {
|
|
131
|
+
if (!r) {
|
|
132
|
+
x(null);
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const o = r.address_components ?? [];
|
|
136
|
+
x(
|
|
137
|
+
oe(
|
|
138
|
+
o,
|
|
139
|
+
r.formatted_address ?? ""
|
|
140
|
+
)
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
});
|
|
145
|
+
},
|
|
146
|
+
[t, m]
|
|
147
|
+
);
|
|
148
|
+
return /* @__PURE__ */ i(
|
|
149
|
+
Y,
|
|
150
|
+
{
|
|
151
|
+
...f,
|
|
152
|
+
forwardedRef: s,
|
|
153
|
+
getSuggestions: I,
|
|
154
|
+
resolveSelection: R,
|
|
155
|
+
onSelect: p
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
function Y({
|
|
160
|
+
forwardedRef: s,
|
|
161
|
+
value: u,
|
|
162
|
+
defaultValue: p,
|
|
163
|
+
onValueChange: f,
|
|
164
|
+
onSelect: t,
|
|
165
|
+
getSuggestions: a,
|
|
166
|
+
resolveSelection: m,
|
|
167
|
+
placeholder: I,
|
|
168
|
+
debounceMs: R = 250,
|
|
169
|
+
disabled: d,
|
|
170
|
+
required: h,
|
|
171
|
+
readOnly: v,
|
|
172
|
+
name: x,
|
|
173
|
+
id: r,
|
|
174
|
+
size: o = "md",
|
|
175
|
+
tone: c = "default",
|
|
176
|
+
className: N,
|
|
177
|
+
"aria-label": g
|
|
178
|
+
}) {
|
|
179
|
+
const { t: T } = de(), D = Pe(), G = B(null), ie = _e(
|
|
180
|
+
() => Ee(s, G),
|
|
181
|
+
[s]
|
|
182
|
+
), ce = Ce(), $ = r ?? D.id ?? ce, Z = `${$}-listbox`, le = `${$}-live`, q = (e) => `${$}-opt-${e}`, P = !!(D.disabled || d), ue = !!(D.required || h), ee = D.invalid, pe = ee ? "error" : c, fe = D.describedBy || void 0, [me, K] = ke({
|
|
183
|
+
value: u,
|
|
184
|
+
defaultValue: p ?? "",
|
|
185
|
+
onChange: f
|
|
186
|
+
}), A = me ?? "", [w, E] = z(!1), [l, Q] = z([]), [F, X] = z(!1), [b, _] = z(-1), M = B(!1), V = B(""), ve = I ?? T("inputs.addressAutocomplete.placeholder"), he = H(
|
|
187
|
+
(e) => {
|
|
188
|
+
!a || P || v || M.current || (V.current = e, X(!0), Promise.resolve(a(e)).then((n) => {
|
|
189
|
+
V.current === e && (Q(n), _(-1), X(!1));
|
|
190
|
+
}).catch(() => {
|
|
191
|
+
V.current === e && (Q([]), X(!1));
|
|
192
|
+
}));
|
|
193
|
+
},
|
|
194
|
+
[a, P, v]
|
|
195
|
+
), k = Be(he, R);
|
|
196
|
+
Ie(() => () => k.cancel(), [k]);
|
|
197
|
+
const xe = (e) => {
|
|
198
|
+
K(e), !(P || v) && (w || E(!0), !M.current && k(e));
|
|
199
|
+
}, te = H(
|
|
200
|
+
(e) => {
|
|
201
|
+
var n;
|
|
202
|
+
K(e.primaryText), E(!1), _(-1), Q([]), V.current = e.primaryText, m ? Promise.resolve(m(e)).then((C) => {
|
|
203
|
+
C && (t == null || t(C));
|
|
204
|
+
}).catch(() => {
|
|
205
|
+
}) : e.address && (t == null || t(e.address)), (n = G.current) == null || n.focus();
|
|
206
|
+
},
|
|
207
|
+
[K, m, t, G]
|
|
208
|
+
), se = w && !F && A.trim().length > 0 && l.length === 0 && !!a, j = l.length > 0, L = w && (j || se || F), be = (e) => {
|
|
209
|
+
if (!e.nativeEvent.isComposing) {
|
|
210
|
+
if (e.key === "ArrowDown") {
|
|
211
|
+
if (e.preventDefault(), !w) {
|
|
212
|
+
E(!0), A && k(A);
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
if (l.length === 0) return;
|
|
216
|
+
_((n) => (n + 1) % l.length);
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
if (e.key === "ArrowUp") {
|
|
220
|
+
if (e.preventDefault(), l.length === 0) return;
|
|
221
|
+
_(
|
|
222
|
+
(n) => n <= 0 ? l.length - 1 : n - 1
|
|
223
|
+
);
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
if (e.key === "Enter") {
|
|
227
|
+
L && (e.preventDefault(), b >= 0 && l[b] && te(l[b]));
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
e.key === "Escape" && w && (e.preventDefault(), E(!1), _(-1));
|
|
231
|
+
}
|
|
232
|
+
}, ye = () => {
|
|
233
|
+
P || v || A && (E(!0), k(A));
|
|
234
|
+
}, ge = (e) => {
|
|
235
|
+
var C;
|
|
236
|
+
const n = e.relatedTarget;
|
|
237
|
+
n && ((C = re.current) != null && C.contains(n)) || (E(!1), _(-1));
|
|
238
|
+
}, re = B(null), Te = w && b >= 0 && l[b] ? q(l[b].placeId) : void 0, Ae = F ? T("inputs.addressAutocomplete.loading") : w && A.trim().length > 0 ? T("inputs.addressAutocomplete.results", { count: l.length }) : "";
|
|
239
|
+
return /* @__PURE__ */ S(
|
|
240
|
+
"div",
|
|
241
|
+
{
|
|
242
|
+
className: "ds:relative ds:w-full",
|
|
243
|
+
"data-component": "address-autocomplete",
|
|
244
|
+
"data-component-id": r,
|
|
245
|
+
children: [
|
|
246
|
+
/* @__PURE__ */ S(
|
|
247
|
+
"div",
|
|
248
|
+
{
|
|
249
|
+
className: $e({ size: o, tone: pe, className: N }),
|
|
250
|
+
"data-disabled": P || void 0,
|
|
251
|
+
children: [
|
|
252
|
+
/* @__PURE__ */ i("span", { "aria-hidden": "true", className: Ve, children: /* @__PURE__ */ i(Ue, {}) }),
|
|
253
|
+
/* @__PURE__ */ i(
|
|
254
|
+
"input",
|
|
255
|
+
{
|
|
256
|
+
ref: ie,
|
|
257
|
+
id: $,
|
|
258
|
+
name: x,
|
|
259
|
+
type: "text",
|
|
260
|
+
autoComplete: "off",
|
|
261
|
+
role: "combobox",
|
|
262
|
+
"aria-autocomplete": "list",
|
|
263
|
+
"aria-expanded": L,
|
|
264
|
+
"aria-controls": L ? Z : void 0,
|
|
265
|
+
"aria-activedescendant": Te,
|
|
266
|
+
"aria-describedby": fe,
|
|
267
|
+
"aria-invalid": ee || void 0,
|
|
268
|
+
"aria-label": g ?? T("inputs.addressAutocomplete.ariaLabel"),
|
|
269
|
+
placeholder: ve,
|
|
270
|
+
value: A,
|
|
271
|
+
disabled: P,
|
|
272
|
+
required: ue,
|
|
273
|
+
readOnly: v,
|
|
274
|
+
onChange: (e) => xe(e.target.value),
|
|
275
|
+
onKeyDown: be,
|
|
276
|
+
onFocus: ye,
|
|
277
|
+
onBlur: ge,
|
|
278
|
+
onCompositionStart: () => {
|
|
279
|
+
M.current = !0;
|
|
280
|
+
},
|
|
281
|
+
onCompositionEnd: (e) => {
|
|
282
|
+
M.current = !1, k(e.currentTarget.value);
|
|
283
|
+
},
|
|
284
|
+
className: Me()
|
|
285
|
+
}
|
|
286
|
+
)
|
|
287
|
+
]
|
|
288
|
+
}
|
|
289
|
+
),
|
|
290
|
+
L ? /* @__PURE__ */ S(
|
|
291
|
+
"ul",
|
|
292
|
+
{
|
|
293
|
+
ref: re,
|
|
294
|
+
id: Z,
|
|
295
|
+
role: "listbox",
|
|
296
|
+
"aria-label": g ?? T("inputs.addressAutocomplete.listLabel"),
|
|
297
|
+
className: je(),
|
|
298
|
+
children: [
|
|
299
|
+
j ? l.map((e, n) => /* @__PURE__ */ S(
|
|
300
|
+
"li",
|
|
301
|
+
{
|
|
302
|
+
id: q(e.placeId),
|
|
303
|
+
role: "option",
|
|
304
|
+
"aria-selected": n === b,
|
|
305
|
+
"data-active": n === b || void 0,
|
|
306
|
+
onMouseDown: (C) => {
|
|
307
|
+
C.preventDefault(), te(e);
|
|
308
|
+
},
|
|
309
|
+
onMouseEnter: () => _(n),
|
|
310
|
+
className: Le(),
|
|
311
|
+
children: [
|
|
312
|
+
/* @__PURE__ */ i("span", { className: "ds:truncate", children: e.primaryText }),
|
|
313
|
+
e.secondaryText ? /* @__PURE__ */ i("span", { className: "type-meta ds:text-muted-foreground ds:data-[active=true]:text-primary-foreground ds:truncate", children: e.secondaryText }) : null
|
|
314
|
+
]
|
|
315
|
+
},
|
|
316
|
+
e.placeId
|
|
317
|
+
)) : null,
|
|
318
|
+
!j && F ? /* @__PURE__ */ i("li", { role: "presentation", className: ae, children: T("inputs.addressAutocomplete.loading") }) : null,
|
|
319
|
+
!j && !F && se ? /* @__PURE__ */ i("li", { role: "presentation", className: ae, children: T("inputs.addressAutocomplete.noResults") }) : null
|
|
320
|
+
]
|
|
321
|
+
}
|
|
322
|
+
) : null,
|
|
323
|
+
/* @__PURE__ */ i(
|
|
324
|
+
"span",
|
|
325
|
+
{
|
|
326
|
+
id: le,
|
|
327
|
+
role: "status",
|
|
328
|
+
"aria-live": "polite",
|
|
329
|
+
"aria-atomic": "true",
|
|
330
|
+
className: "ds:sr-only",
|
|
331
|
+
children: Ae
|
|
332
|
+
}
|
|
333
|
+
)
|
|
334
|
+
]
|
|
335
|
+
}
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
const ze = we(function({ apiKey: u, getSuggestions: p, ...f }, t) {
|
|
339
|
+
const { i18n: a } = de();
|
|
340
|
+
return p ? /* @__PURE__ */ i(
|
|
341
|
+
Y,
|
|
342
|
+
{
|
|
343
|
+
...f,
|
|
344
|
+
forwardedRef: t,
|
|
345
|
+
getSuggestions: p,
|
|
346
|
+
resolveSelection: He
|
|
347
|
+
}
|
|
348
|
+
) : u ? /* @__PURE__ */ i(Re, { apiKey: u, language: a.language, children: /* @__PURE__ */ i(Se, { ...f, forwardedRef: t }) }) : /* @__PURE__ */ i(Y, { ...f, forwardedRef: t });
|
|
349
|
+
});
|
|
350
|
+
ze.displayName = "AddressAutocomplete";
|
|
351
|
+
async function He(s) {
|
|
352
|
+
return s.address ?? null;
|
|
353
|
+
}
|
|
354
|
+
export {
|
|
355
|
+
ze as A,
|
|
356
|
+
oe as p
|
|
357
|
+
};
|
|
358
|
+
//# sourceMappingURL=address-autocomplete-CSjMrBvu.js.map
|
|
@@ -4,7 +4,7 @@ import * as ee from "@radix-ui/react-dialog";
|
|
|
4
4
|
import { useTranslation as z } from "react-i18next";
|
|
5
5
|
import { F as se } from "./floating-action-button-pojvb9gG.js";
|
|
6
6
|
import { I as B } from "./icon-button-CKEOrN37.js";
|
|
7
|
-
import { S as E } from "./sheet-
|
|
7
|
+
import { S as E } from "./sheet-xbzu4YiY.js";
|
|
8
8
|
import { X as ae } from "./x-CCcI3eJp.js";
|
|
9
9
|
import { S as P } from "./sparkles-CuYXqQLg.js";
|
|
10
10
|
import { A as k } from "./avatar-BNQNhoyL.js";
|
|
@@ -739,4 +739,4 @@ export {
|
|
|
739
739
|
ze as b,
|
|
740
740
|
Ce as c
|
|
741
741
|
};
|
|
742
|
-
//# sourceMappingURL=alia-sidebar-
|
|
742
|
+
//# sourceMappingURL=alia-sidebar-BpX4z_af.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsxs as i, jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { R as
|
|
6
|
-
import { R as
|
|
7
|
-
import { F as
|
|
2
|
+
import { forwardRef as P, useId as R, useState as r, useMemo as Y, useEffect as _ } from "react";
|
|
3
|
+
import { c as q } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as J } from "react-i18next";
|
|
5
|
+
import { R as T } from "./radio-TWf9Q-mp.js";
|
|
6
|
+
import { R as Q } from "./radio-group-CLjK-SlK.js";
|
|
7
|
+
import { F as S } from "./form-field-BOm9hK35.js";
|
|
8
8
|
import { N as h } from "./number-input-Dj5L3pXK.js";
|
|
9
|
-
import { C as
|
|
10
|
-
import { B as
|
|
11
|
-
import { I as
|
|
12
|
-
import { a as
|
|
13
|
-
const
|
|
9
|
+
import { C as X } from "./chart-Cbt0_sKv.js";
|
|
10
|
+
import { B as Z } from "./badge-zsf5i5bH.js";
|
|
11
|
+
import { I as aa } from "./insert-result-DtQQeSSf.js";
|
|
12
|
+
import { a as la, b as ea, e as ta, c as ia, f as G, l as k, k as ra } from "./bmi-BxD-tFzU.js";
|
|
13
|
+
const sa = q("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
14
14
|
variants: {
|
|
15
15
|
width: {
|
|
16
16
|
full: "ds:w-full",
|
|
@@ -18,41 +18,44 @@ const ta = R("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
defaultVariants: { width: "full" }
|
|
21
|
-
}),
|
|
21
|
+
}), oa = {
|
|
22
22
|
underweight: "info",
|
|
23
23
|
normal: "success",
|
|
24
24
|
overweight: "warning",
|
|
25
25
|
obese: "error"
|
|
26
|
-
}, p = (f) => Math.round(f * 10) / 10,
|
|
26
|
+
}, p = (f) => Math.round(f * 10) / 10, na = P(
|
|
27
27
|
({
|
|
28
28
|
defaultUnitSystem: f = "metric",
|
|
29
29
|
onResultChange: u,
|
|
30
30
|
onInsert: y,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
insertVariant: v = "insert",
|
|
32
|
+
onCopy: A,
|
|
33
|
+
onError: H,
|
|
34
|
+
id: K,
|
|
35
|
+
width: D,
|
|
36
|
+
className: E
|
|
37
|
+
}, L) => {
|
|
38
|
+
const { t: a, i18n: x } = J(), N = R(), [s, M] = r(f), [d, w] = r(null), [g, F] = r(null), [o, $] = r(null), [n, B] = r(null), [m, I] = r(null), V = (z) => {
|
|
39
|
+
const C = z;
|
|
37
40
|
if (C !== s) {
|
|
38
41
|
if (C === "imperial") {
|
|
39
42
|
if (d !== null) {
|
|
40
|
-
const { ft:
|
|
41
|
-
|
|
43
|
+
const { ft: U, in: O } = ia(d);
|
|
44
|
+
$(U), B(p(O));
|
|
42
45
|
}
|
|
43
|
-
g !== null &&
|
|
46
|
+
g !== null && I(p(ra(g)));
|
|
44
47
|
} else
|
|
45
|
-
(o !== null || n !== null) &&
|
|
46
|
-
|
|
48
|
+
(o !== null || n !== null) && w(p(G(o ?? 0, n ?? 0))), m !== null && F(p(k(m)));
|
|
49
|
+
M(C);
|
|
47
50
|
}
|
|
48
|
-
},
|
|
49
|
-
() => new Intl.NumberFormat(
|
|
51
|
+
}, W = s === "metric" ? d : o !== null || n !== null ? G(o ?? 0, n ?? 0) : null, j = s === "metric" ? g : m !== null ? k(m) : null, t = ta(j, W), e = t !== null ? ea(t) : null, b = Y(
|
|
52
|
+
() => new Intl.NumberFormat(x.language, {
|
|
50
53
|
minimumFractionDigits: 1,
|
|
51
54
|
maximumFractionDigits: 1
|
|
52
55
|
}),
|
|
53
|
-
[
|
|
56
|
+
[x.language]
|
|
54
57
|
);
|
|
55
|
-
|
|
58
|
+
_(() => {
|
|
56
59
|
u == null || u(
|
|
57
60
|
t !== null && e !== null ? { bmi: t, category: e } : null
|
|
58
61
|
);
|
|
@@ -61,22 +64,22 @@ const ta = R("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
61
64
|
return /* @__PURE__ */ i(
|
|
62
65
|
"div",
|
|
63
66
|
{
|
|
64
|
-
ref:
|
|
67
|
+
ref: L,
|
|
65
68
|
"data-component": "bmi-calculator",
|
|
66
|
-
"data-component-id":
|
|
67
|
-
className:
|
|
69
|
+
"data-component-id": K,
|
|
70
|
+
className: sa({ width: D, className: E }),
|
|
68
71
|
children: [
|
|
69
72
|
/* @__PURE__ */ i(
|
|
70
|
-
|
|
73
|
+
Q,
|
|
71
74
|
{
|
|
72
75
|
label: a("bmiCalculator.unitSystem.label"),
|
|
73
76
|
variant: "horizontal",
|
|
74
77
|
value: s,
|
|
75
|
-
onValueChange:
|
|
78
|
+
onValueChange: V,
|
|
76
79
|
children: [
|
|
77
|
-
/* @__PURE__ */ l(
|
|
80
|
+
/* @__PURE__ */ l(T, { label: a("bmiCalculator.unitSystem.metric"), value: "metric" }),
|
|
78
81
|
/* @__PURE__ */ l(
|
|
79
|
-
|
|
82
|
+
T,
|
|
80
83
|
{
|
|
81
84
|
label: a("bmiCalculator.unitSystem.imperial"),
|
|
82
85
|
value: "imperial"
|
|
@@ -87,7 +90,7 @@ const ta = R("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
87
90
|
),
|
|
88
91
|
/* @__PURE__ */ i("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2", children: [
|
|
89
92
|
c ? /* @__PURE__ */ l(
|
|
90
|
-
|
|
93
|
+
S,
|
|
91
94
|
{
|
|
92
95
|
label: `${a("bmiCalculator.height")} (${a("bmiCalculator.units.cm")})`,
|
|
93
96
|
children: /* @__PURE__ */ l(
|
|
@@ -97,15 +100,15 @@ const ta = R("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
97
100
|
min: 0,
|
|
98
101
|
step: 0.5,
|
|
99
102
|
value: d,
|
|
100
|
-
onChange:
|
|
103
|
+
onChange: w
|
|
101
104
|
}
|
|
102
105
|
)
|
|
103
106
|
}
|
|
104
|
-
) : /* @__PURE__ */ i("div", { role: "group", "aria-labelledby":
|
|
107
|
+
) : /* @__PURE__ */ i("div", { role: "group", "aria-labelledby": N, children: [
|
|
105
108
|
/* @__PURE__ */ l(
|
|
106
109
|
"span",
|
|
107
110
|
{
|
|
108
|
-
id:
|
|
111
|
+
id: N,
|
|
109
112
|
className: "type-label ds:mb-[var(--spacing-xs)] ds:block ds:text-foreground",
|
|
110
113
|
children: a("bmiCalculator.height")
|
|
111
114
|
}
|
|
@@ -117,7 +120,7 @@ const ta = R("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
117
120
|
mode: "integer",
|
|
118
121
|
min: 0,
|
|
119
122
|
value: o,
|
|
120
|
-
onChange:
|
|
123
|
+
onChange: $,
|
|
121
124
|
"aria-label": a("bmiCalculator.feet")
|
|
122
125
|
}
|
|
123
126
|
),
|
|
@@ -130,7 +133,7 @@ const ta = R("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
130
133
|
max: 11.9,
|
|
131
134
|
step: 0.5,
|
|
132
135
|
value: n,
|
|
133
|
-
onChange:
|
|
136
|
+
onChange: B,
|
|
134
137
|
"aria-label": a("bmiCalculator.inches")
|
|
135
138
|
}
|
|
136
139
|
),
|
|
@@ -138,7 +141,7 @@ const ta = R("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
138
141
|
] })
|
|
139
142
|
] }),
|
|
140
143
|
/* @__PURE__ */ l(
|
|
141
|
-
|
|
144
|
+
S,
|
|
142
145
|
{
|
|
143
146
|
label: `${a("bmiCalculator.weight")} (${a(
|
|
144
147
|
c ? "bmiCalculator.units.kg" : "bmiCalculator.units.lb"
|
|
@@ -150,7 +153,7 @@ const ta = R("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
150
153
|
min: 0,
|
|
151
154
|
step: c ? 0.1 : 0.5,
|
|
152
155
|
value: c ? g : m,
|
|
153
|
-
onChange: c ?
|
|
156
|
+
onChange: c ? F : I
|
|
154
157
|
}
|
|
155
158
|
)
|
|
156
159
|
}
|
|
@@ -163,27 +166,30 @@ const ta = R("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
163
166
|
t !== null && e !== null ? /* @__PURE__ */ i("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-md)]", children: [
|
|
164
167
|
/* @__PURE__ */ i("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-xs)] ds:text-center", children: [
|
|
165
168
|
/* @__PURE__ */ l("span", { className: "type-label ds:text-muted-foreground", children: a("bmiCalculator.category.label") }),
|
|
166
|
-
/* @__PURE__ */ l(
|
|
169
|
+
/* @__PURE__ */ l(Z, { variant: oa[e], size: "lg", children: a(`bmiCalculator.category.${e}`) }),
|
|
167
170
|
/* @__PURE__ */ l("p", { className: "type-body ds:text-muted-foreground", children: a(`bmiCalculator.range.${e}`) })
|
|
168
171
|
] }),
|
|
169
172
|
/* @__PURE__ */ l("div", { className: "ds:w-[240px] ds:max-w-full", children: /* @__PURE__ */ l(
|
|
170
|
-
|
|
173
|
+
X,
|
|
171
174
|
{
|
|
172
175
|
type: "radialBar",
|
|
173
176
|
title: a("bmiCalculator.gaugeAria", {
|
|
174
177
|
bmi: b.format(t),
|
|
175
178
|
category: a(`bmiCalculator.category.${e}`)
|
|
176
179
|
}),
|
|
177
|
-
series: [
|
|
180
|
+
series: [la(t)],
|
|
178
181
|
labels: [a(`bmiCalculator.category.${e}`)],
|
|
179
182
|
radialValueFormatter: () => b.format(t),
|
|
180
183
|
height: 240
|
|
181
184
|
}
|
|
182
185
|
) }),
|
|
183
|
-
y ? /* @__PURE__ */ l(
|
|
184
|
-
|
|
186
|
+
v === "copy" || y ? /* @__PURE__ */ l(
|
|
187
|
+
aa,
|
|
185
188
|
{
|
|
186
189
|
onInsert: y,
|
|
190
|
+
variant: v,
|
|
191
|
+
onCopy: A,
|
|
192
|
+
onError: H,
|
|
187
193
|
card: {
|
|
188
194
|
title: a("insert.title.bmi"),
|
|
189
195
|
highlight: a(`bmiCalculator.category.${e}`),
|
|
@@ -206,8 +212,8 @@ const ta = R("ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", {
|
|
|
206
212
|
);
|
|
207
213
|
}
|
|
208
214
|
);
|
|
209
|
-
|
|
215
|
+
na.displayName = "BmiCalculator";
|
|
210
216
|
export {
|
|
211
|
-
|
|
217
|
+
na as B
|
|
212
218
|
};
|
|
213
|
-
//# sourceMappingURL=bmi-calculator-
|
|
219
|
+
//# sourceMappingURL=bmi-calculator-D4juUcyF.js.map
|
|
@@ -165,7 +165,7 @@ const Q = [
|
|
|
165
165
|
S.displayName = "BreadcrumbList";
|
|
166
166
|
const U = [
|
|
167
167
|
"ds:inline-flex ds:items-center",
|
|
168
|
-
"ds:max-inline-size
|
|
168
|
+
"ds:[max-inline-size:16rem]",
|
|
169
169
|
"ds:min-h-[var(--min-target-size)]",
|
|
170
170
|
"ds:py-[var(--spacing-xs)]"
|
|
171
171
|
].join(" "), N = y(
|
|
@@ -199,7 +199,7 @@ const U = [
|
|
|
199
199
|
N.displayName = "BreadcrumbItem";
|
|
200
200
|
const P = [
|
|
201
201
|
"ds:inline-flex ds:items-center",
|
|
202
|
-
"ds:max-inline-size
|
|
202
|
+
"ds:[max-inline-size:16rem]",
|
|
203
203
|
"ds:overflow-hidden ds:text-ellipsis ds:whitespace-nowrap",
|
|
204
204
|
"ds:break-normal",
|
|
205
205
|
"ds:text-[var(--muted-foreground)] ds:no-underline",
|
|
@@ -211,7 +211,7 @@ const P = [
|
|
|
211
211
|
"ds:min-h-[var(--min-target-size)] ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)]"
|
|
212
212
|
].join(" "), W = [
|
|
213
213
|
"ds:inline-flex ds:items-center",
|
|
214
|
-
"ds:max-inline-size
|
|
214
|
+
"ds:[max-inline-size:16rem]",
|
|
215
215
|
"ds:overflow-hidden ds:text-ellipsis ds:whitespace-nowrap",
|
|
216
216
|
"ds:break-normal",
|
|
217
217
|
"ds:text-[var(--foreground)] ds:font-[var(--font-weight-semibold)]",
|
|
@@ -376,4 +376,4 @@ export {
|
|
|
376
376
|
T as e,
|
|
377
377
|
G as f
|
|
378
378
|
};
|
|
379
|
-
//# sourceMappingURL=breadcrumb-
|
|
379
|
+
//# sourceMappingURL=breadcrumb-OTbaY70e.js.map
|