@alfadocs/ui-kit 1.88.1 → 1.89.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.
@@ -9,7 +9,7 @@ import { C as U } from "./card-BA4Ig_kn.js";
9
9
  import { D as u } from "./dropdown-menu-D1we7oAY.js";
10
10
  import { T as ke } from "./tab-bar-BEODTG6k.js";
11
11
  import { a as Y, H as we, g as Ne, f as G, e as ye, c as Se, d as Ce } from "./header-l_B8MV0g.js";
12
- import { H as Ae } from "./header-settings-CifwJEKB.js";
12
+ import { H as Ae } from "./header-settings-BVhjndtV.js";
13
13
  import { S as Te } from "./sign-in-with-alfadocs-button-DzrNgbWv.js";
14
14
  import { S as Ee, a as ee, v as ze, h as Ie, c as Me, r as Le, b as He, l as Ve, m as Be, k as Re, j as J } from "./sidebar-BS24EnYd.js";
15
15
  import { N as De } from "./navigation-dismiss-B1mcW1CT.js";
@@ -656,4 +656,4 @@ export {
656
656
  na as M,
657
657
  y as P
658
658
  };
659
- //# sourceMappingURL=marketplace-app-shell-vON3WhD0.js.map
659
+ //# sourceMappingURL=marketplace-app-shell-x_abo_ye.js.map
@@ -1,5 +1,5 @@
1
1
  import { jsx as a, jsxs as w } from "react/jsx-runtime";
2
- import { forwardRef as ce, useRef as j, useEffect as K, useMemo as Y, useImperativeHandle as le, useState as z, useCallback as M, useId as ue } from "react";
2
+ import { forwardRef as ce, useRef as j, useEffect as K, useMemo as Y, useImperativeHandle as le, useState as W, useCallback as M, useId as ue } from "react";
3
3
  import { c as L } from "./index-D2ZczOXr.js";
4
4
  import { useTranslation as C } from "react-i18next";
5
5
  import { A as re } from "./autocomplete-CnB1mHGc.js";
@@ -7,7 +7,7 @@ import { B as fe } from "./button-DohK_Ak_.js";
7
7
  import { C as H } from "./card-BA4Ig_kn.js";
8
8
  import { S as pe } from "./slider-pZ95bEm7.js";
9
9
  import { A as ee } from "./alert-9kEwDza3.js";
10
- import { D as W } from "./dropdown-menu-D1we7oAY.js";
10
+ import { D as F } from "./dropdown-menu-D1we7oAY.js";
11
11
  import { u as me } from "./registry-DvAUVLHh.js";
12
12
  import { S as ne } from "./search-QbWPlY5f.js";
13
13
  import { X as ie } from "./x-B5YnXwCz.js";
@@ -122,7 +122,7 @@ function $({
122
122
  inputRef: p
123
123
  }) {
124
124
  var l, u, c, g;
125
- const { t: v } = C("ui"), [b, h] = z(((l = e.object) == null ? void 0 : l.label) ?? ""), d = j((u = e.object) == null ? void 0 : u.value);
125
+ const { t: v } = C("ui"), [b, h] = W(((l = e.object) == null ? void 0 : l.label) ?? ""), d = j((u = e.object) == null ? void 0 : u.value);
126
126
  K(() => {
127
127
  var m, o, S;
128
128
  ((m = e.object) == null ? void 0 : m.value) !== d.current && (d.current = (o = e.object) == null ? void 0 : o.value, h(((S = e.object) == null ? void 0 : S.label) ?? ""));
@@ -157,6 +157,7 @@ function $({
157
157
  re,
158
158
  {
159
159
  ref: p,
160
+ size: "lg",
160
161
  value: b,
161
162
  onChange: (m) => {
162
163
  h(m), e.object && m !== e.object.label && (d.current = void 0, s({ ...e, object: void 0 }));
@@ -194,8 +195,8 @@ function q({
194
195
  defaultRadiusKm: b = J,
195
196
  reverseGeocode: h
196
197
  }) {
197
- var O, F, E, P;
198
- const { t: d } = C("ui"), [n, f] = z(((O = e.place) == null ? void 0 : O.label) ?? ""), r = j((F = e.place) == null ? void 0 : F.value), l = e.geo ? "granted" : "pristine", [u, c] = z(l);
198
+ var O, z, E, P;
199
+ const { t: d } = C("ui"), [n, f] = W(((O = e.place) == null ? void 0 : O.label) ?? ""), r = j((z = e.place) == null ? void 0 : z.value), l = e.geo ? "granted" : "pristine", [u, c] = W(l);
199
200
  K(() => {
200
201
  var y, x, N;
201
202
  ((y = e.place) == null ? void 0 : y.value) !== r.current && (r.current = (x = e.place) == null ? void 0 : x.value, f(((N = e.place) == null ? void 0 : N.label) ?? ""));
@@ -291,6 +292,7 @@ function q({
291
292
  re,
292
293
  {
293
294
  ref: v,
295
+ size: "lg",
294
296
  value: n,
295
297
  onChange: (y) => {
296
298
  var x, N;
@@ -339,7 +341,7 @@ function U({
339
341
  onChange: s,
340
342
  defaultRadiusKm: t = J
341
343
  }) {
342
- const { t: i } = C("ui"), [p, v] = z(
344
+ const { t: i } = C("ui"), [p, v] = W(
343
345
  () => {
344
346
  var d;
345
347
  return _e(((d = e.geo) == null ? void 0 : d.radiusKm) ?? t);
@@ -561,8 +563,8 @@ function Re({ facets: e, value: s, onChange: t }) {
561
563
  n.key
562
564
  );
563
565
  const u = l ? ` (${r.length})` : "";
564
- return /* @__PURE__ */ w(W.Root, { children: [
565
- /* @__PURE__ */ a(W.Trigger, { asChild: !0, children: /* @__PURE__ */ w(
566
+ return /* @__PURE__ */ w(F.Root, { children: [
567
+ /* @__PURE__ */ a(F.Trigger, { asChild: !0, children: /* @__PURE__ */ w(
566
568
  "button",
567
569
  {
568
570
  type: "button",
@@ -585,8 +587,8 @@ function Re({ facets: e, value: s, onChange: t }) {
585
587
  ]
586
588
  }
587
589
  ) }),
588
- /* @__PURE__ */ a(W.Content, { sideOffset: 8, align: "start", children: n.options.map((c) => /* @__PURE__ */ a(
589
- W.CheckboxItem,
590
+ /* @__PURE__ */ a(F.Content, { sideOffset: 8, align: "start", children: n.options.map((c) => /* @__PURE__ */ a(
591
+ F.CheckboxItem,
590
592
  {
591
593
  checked: r.includes(c.value),
592
594
  onSelect: (g) => {
@@ -1086,7 +1088,7 @@ const Ve = ce(function({
1086
1088
  className: Q,
1087
1089
  ...D
1088
1090
  }, I) {
1089
- const { t: Z } = C("ui"), X = j(null), O = j(null), F = j(null), E = j(!1);
1091
+ const { t: Z } = C("ui"), X = j(null), O = j(null), z = j(null), E = j(!1);
1090
1092
  K(() => {
1091
1093
  if (!E.current && s === "who-where-when") {
1092
1094
  if (l.when !== void 0) {
@@ -1144,7 +1146,7 @@ const Ve = ce(function({
1144
1146
  submitLabel: m,
1145
1147
  allowEmptySubmit: o,
1146
1148
  whoRef: O,
1147
- whereRef: F,
1149
+ whereRef: z,
1148
1150
  cardLabel: N
1149
1151
  }, R = (() => {
1150
1152
  switch (s) {
@@ -1182,4 +1184,4 @@ export {
1182
1184
  Ve as P,
1183
1185
  we as p
1184
1186
  };
1185
- //# sourceMappingURL=patient-search-Dy0sxcwv.js.map
1187
+ //# sourceMappingURL=patient-search-BPjP2__L.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "packageVersion": "1.88.1",
3
+ "packageVersion": "1.89.0",
4
4
  "components": [
5
5
  {
6
6
  "kind": "component",
@@ -6498,7 +6498,7 @@
6498
6498
  {
6499
6499
  "name": "locale",
6500
6500
  "type": "string",
6501
- "description": "Active IETF language tag (e.g. \"en\", \"it\", \"ar\"). Initially uses storage, then HTML lang when initialLocaleFromHtmlLang is enabled, then the browser. Read after set_locale to confirm the switch; unknown tags leave it unchanged.",
6501
+ "description": "Active IETF language tag (e.g. \"en\", \"it\", \"ar\"). Initially uses HTML lang first when followHtmlLang is enabled; otherwise storage, then HTML lang when initialLocaleFromHtmlLang is enabled, then the browser. Read after set_locale to confirm the switch; unknown tags leave it unchanged.",
6502
6502
  "descriptionKey": "ui.agent.headerSettings.state.locale"
6503
6503
  },
6504
6504
  {
@@ -6549,7 +6549,7 @@
6549
6549
  "note": "Switch to Italian."
6550
6550
  }
6551
6551
  ],
6552
- "description": "Switch the active locale to the given IETF tag. Unknown tags are silently dropped — read the `locale` state slot afterwards to confirm.",
6552
+ "description": "Switch the active locale to the given IETF tag. Unknown tags are silently dropped — read the `locale` state slot afterwards to confirm. On a site with one address per language, the host may then load that language's address.",
6553
6553
  "descriptionKey": "ui.agent.headerSettings.actions.setLocale"
6554
6554
  },
6555
6555
  {
@@ -7552,7 +7552,7 @@
7552
7552
  {
7553
7553
  "name": "isSystemDefault",
7554
7554
  "type": "boolean",
7555
- "description": "True when following navigator.language. False for a saved or explicit choice, or when initialLocaleFromHtmlLang used the page language. Read alongside locale to distinguish browser detection from a concrete language selection.",
7555
+ "description": "True when following navigator.language. False for a saved or explicit choice, or when initialLocaleFromHtmlLang or followHtmlLang used the page language. Read alongside locale to distinguish browser detection from a concrete language selection.",
7556
7556
  "descriptionKey": "ui.agent.localePicker.state.isSystemDefault"
7557
7557
  }
7558
7558
  ],
@@ -675,13 +675,13 @@
675
675
  },
676
676
  "headerSettings": {
677
677
  "state": {
678
- "locale": "Active IETF language tag (e.g. \"en\", \"it\", \"ar\"). Initially uses storage, then HTML lang when initialLocaleFromHtmlLang is enabled, then the browser. Read after set_locale to confirm the switch; unknown tags leave it unchanged.",
678
+ "locale": "Active IETF language tag (e.g. \"en\", \"it\", \"ar\"). Initially uses HTML lang first when followHtmlLang is enabled; otherwise storage, then HTML lang when initialLocaleFromHtmlLang is enabled, then the browser. Read after set_locale to confirm the switch; unknown tags leave it unchanged.",
679
679
  "theme": "Stored base-theme preference. `'system'` means no override is set and the OS decides — read `resolvedTheme` for what is actually painted.",
680
680
  "accessibility": "Stored AAA-contrast preference. `'system'` means no override is set and `prefers-contrast` decides.",
681
681
  "resolvedTheme": "The theme actually applied to the document once preference and OS signals resolve. This is what makes a `set_theme(\"system\")` or `set_accessibility(\"system\")` write verifiable."
682
682
  },
683
683
  "actions": {
684
- "setLocale": "Switch the active locale to the given IETF tag. Unknown tags are silently dropped — read the `locale` state slot afterwards to confirm.",
684
+ "setLocale": "Switch the active locale to the given IETF tag. Unknown tags are silently dropped — read the `locale` state slot afterwards to confirm. On a site with one address per language, the host may then load that language's address.",
685
685
  "setTheme": "Switch the theme preference. Verify with the `theme` slot (the stored preference) and `resolvedTheme` (what is actually painted).",
686
686
  "setAccessibility": "Switch the accessibility preference. Verify with the `accessibility` slot (the stored preference) and `resolvedTheme` (what is actually painted)."
687
687
  }
@@ -773,7 +773,7 @@
773
773
  "localePicker": {
774
774
  "state": {
775
775
  "locale": "Resolved IETF tag of the locale currently applied to the page. Read this after `set_locale` — the setter silently drops tags the kit ships no bundle for, so this is the only confirmation the switch landed.",
776
- "isSystemDefault": "True when following navigator.language. False for a saved or explicit choice, or when initialLocaleFromHtmlLang used the page language. Read alongside locale to distinguish browser detection from a concrete language selection."
776
+ "isSystemDefault": "True when following navigator.language. False for a saved or explicit choice, or when initialLocaleFromHtmlLang or followHtmlLang used the page language. Read alongside locale to distinguish browser detection from a concrete language selection."
777
777
  },
778
778
  "actions": {
779
779
  "setLocale": "Switch the active locale to the given IETF tag. Unsupported tags are a silent no-op — read the `locale` state slot afterwards to confirm the switch landed."
@@ -1,5 +1,6 @@
1
1
  import { type HTMLAttributes } from 'react';
2
2
  import { type VariantProps } from 'class-variance-authority';
3
+ import { type LocaleChangeHandler } from '../locale-picker/locale-picker';
3
4
  import { type AccessibilityPreference, type ResolvedTheme, type ThemePreference } from '../../hooks';
4
5
  declare const wrapperVariants: (props?: ({
5
6
  align?: "end" | "start" | null | undefined;
@@ -26,6 +27,19 @@ export interface HeaderSettingsProps extends Omit<HTMLAttributes<HTMLDivElement>
26
27
  * decides for the app lifecycle; pass the same option to LocalePicker.
27
28
  */
28
29
  initialLocaleFromHtmlLang?: boolean;
30
+ /**
31
+ * The page's HTML lang decides the starting locale, ahead of a saved
32
+ * choice. For sites with one address per language, where the address
33
+ * decides. Defaults to false. Pass the same option to LocalePicker.
34
+ */
35
+ followHtmlLang?: boolean;
36
+ /**
37
+ * Called after a language picked in the menu (or set through the agent
38
+ * handle) has been applied and changed the language. Not called for the
39
+ * starting locale. A site with one address per language navigates to
40
+ * `resolved` here.
41
+ */
42
+ onLocaleChange?: LocaleChangeHandler;
29
43
  }
30
44
  export interface HeaderSettingsHandle {
31
45
  /**
@@ -1,4 +1,4 @@
1
- import { H as t } from "../../_chunks/header-settings-CifwJEKB.js";
1
+ import { H as t } from "../../_chunks/header-settings-BVhjndtV.js";
2
2
  export {
3
3
  t as HeaderSettings
4
4
  };
@@ -1,7 +1,8 @@
1
- import { L, a as c, b as r } from "../../_chunks/locale-picker-QbT1p60X.js";
1
+ import { L as c, a as e, b as E, c as r } from "../../_chunks/locale-picker-DVvinQXU.js";
2
2
  export {
3
- L as LOCALE_STORAGE_KEY,
4
- c as LocalePicker,
3
+ c as LOCALE_STORAGE_KEY,
4
+ e as LOCALE_SYSTEM_DEFAULT,
5
+ E as LocalePicker,
5
6
  r as LocalePickerSearchList
6
7
  };
7
8
  //# sourceMappingURL=index.js.map
@@ -10,19 +10,30 @@ export declare const LOCALE_STORAGE_KEY = "alfadocs-ui.locale";
10
10
  */
11
11
  export declare const LOCALE_SYSTEM_DEFAULT: "system";
12
12
  export type LocalePreference = Locale | typeof LOCALE_SYSTEM_DEFAULT;
13
+ /**
14
+ * Reports a language change: the picked preference, and the concrete locale it
15
+ * applied (the browser's for System default, which is what a site navigates to).
16
+ */
17
+ export type LocaleChangeHandler = (next: LocalePreference, resolved: Locale) => void;
13
18
  /** @internal Simulate a fresh app lifecycle after test components unmount. */
14
19
  export declare function __resetLocalePreferenceForTests(): void;
20
+ /**
21
+ * Calls `onLocaleChange` when a pick changed the language. Picking the language
22
+ * already shown (or System default resolving to it) reports nothing.
23
+ */
24
+ export declare function reportLocaleChange(onLocaleChange: LocaleChangeHandler | undefined, next: LocalePreference, previous: Locale): void;
15
25
  /** Shared persistence for picker selections and HeaderSettings agent actions. */
16
26
  export declare function persistLocalePreference(next: LocalePreference): void;
17
27
  /**
18
28
  * Applies storage, optionally HTML lang, then the browser, once per app lifecycle.
29
+ * With `followHtmlLang`, a supported HTML lang comes first, ahead of storage.
19
30
  * Every locale surface calls it on mount (the picker, and HeaderSettings,
20
31
  * whose search list only mounts when its flyout opens), so the page starts
21
32
  * in the right language and direction whichever one the host renders.
22
33
  * The first caller whose mount effect runs decides the option for all surfaces.
23
34
  * Pass the same option everywhere; later mounts or prop changes do not re-detect.
24
35
  */
25
- export declare function useInitialLocale(initialLocaleFromHtmlLang?: boolean): void;
36
+ export declare function useInitialLocale(initialLocaleFromHtmlLang?: boolean, followHtmlLang?: boolean): void;
26
37
  declare const wrapperVariants: (props?: ({
27
38
  variant?: "icon" | "compact" | null | undefined;
28
39
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -46,6 +57,19 @@ export interface LocalePickerProps extends Omit<HTMLAttributes<HTMLDivElement>,
46
57
  * decides for the app lifecycle; pass the same option to HeaderSettings.
47
58
  */
48
59
  initialLocaleFromHtmlLang?: boolean;
60
+ /**
61
+ * The page's HTML lang decides the starting locale, ahead of a saved
62
+ * choice. For sites with one address per language, where the address
63
+ * decides. Defaults to false. Pass the same option to HeaderSettings.
64
+ */
65
+ followHtmlLang?: boolean;
66
+ /**
67
+ * Called after the picker (or its agent handle) has applied a selection
68
+ * that changed the language. Uncontrolled mode only: with `onValueChange`
69
+ * it stays silent. A site with one address per language navigates to
70
+ * `resolved` here. Not called for the starting language.
71
+ */
72
+ onLocaleChange?: LocaleChangeHandler;
49
73
  /**
50
74
  * Side the search popover opens onto, relative to the trigger.
51
75
  * Defaults to `bottom` (standard dropdown). Use `end` (inline-end —
@@ -92,6 +116,12 @@ export interface LocalePickerSearchListProps {
92
116
  * or clears storage, updates document.dir/lang).
93
117
  */
94
118
  onValueChange?: (next: LocalePreference) => void;
119
+ /**
120
+ * Called after the shared setter has applied a selection that changed the
121
+ * language (uncontrolled mode only; with `onValueChange` it stays silent).
122
+ * A site with one address per language navigates to `resolved` here.
123
+ */
124
+ onLocaleChange?: LocaleChangeHandler;
95
125
  /** Optional id for the search input (axe `aria-labelledby` chain). */
96
126
  inputId?: string;
97
127
  /** Disable the input + list interactions. */
@@ -1,4 +1,4 @@
1
- import { P as t, p as r } from "../../_chunks/patient-search-Dy0sxcwv.js";
1
+ import { P as t, p as r } from "../../_chunks/patient-search-BPjP2__L.js";
2
2
  export {
3
3
  t as PatientSearch,
4
4
  r as patientSearchAgent
package/dist/index.js CHANGED
@@ -227,7 +227,7 @@ import { C as Dc, c as Oc } from "./_chunks/care-plan-header-BzsAg6oY.js";
227
227
  import { O as Lc, o as hc } from "./_chunks/operator-hero-6aAIQaFZ.js";
228
228
  import { P as yc, p as kc } from "./_chunks/practice-profile-hero-qfrsFQI_.js";
229
229
  import { P as Gc, p as vc } from "./_chunks/patient-details-D0P5eog5.js";
230
- import { P as Wc, p as wc } from "./_chunks/patient-search-Dy0sxcwv.js";
230
+ import { P as Wc, p as wc } from "./_chunks/patient-search-BPjP2__L.js";
231
231
  import { P as Vc, p as Kc } from "./_chunks/patient-summary-card-6U74-ivO.js";
232
232
  import { A as Xc, a as qc } from "./_chunks/anamnesis-summary-card-DQ3iE1gD.js";
233
233
  import { B as jc, C as Qc, N as Zc, P as Jc, a as $c, T as aS, b as eS, g as sS, u as rS } from "./_chunks/balance-badge-cell-BHXJS8Ga.js";
@@ -268,7 +268,7 @@ import { E as iu } from "./_chunks/error-page-illustration-BdJLuMdV.js";
268
268
  import { F as mu, a as lu } from "./_chunks/forgot-password-form-BQPvDS7i.js";
269
269
  import { A as Au, a as fu, H as cu, b as Su, u as gu } from "./_chunks/help-me-write-templates-BJSf24xS.js";
270
270
  import { L as Tu, a as xu, b as uu } from "./_chunks/login-dev-card-DYwbL5sD.js";
271
- import { C as Eu, M as Iu, P as Ru } from "./_chunks/marketplace-app-shell-vON3WhD0.js";
271
+ import { C as Eu, M as Iu, P as Ru } from "./_chunks/marketplace-app-shell-x_abo_ye.js";
272
272
  import { P as bu } from "./_chunks/payment-automation-upsell-D1YdO1xY.js";
273
273
  import { R as Du, a as Ou } from "./_chunks/registration-form-DmP3YUfp.js";
274
274
  import { R as Lu, a as hu } from "./_chunks/reset-password-form-Cf9QPEJu.js";
@@ -1,4 +1,4 @@
1
- import { C as l, M as o } from "../../_chunks/marketplace-app-shell-vON3WhD0.js";
1
+ import { C as l, M as o } from "../../_chunks/marketplace-app-shell-x_abo_ye.js";
2
2
  export {
3
3
  l as ConnectWithAlfadocs,
4
4
  o as MarketplaceAppShell
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfadocs/ui-kit",
3
- "version": "1.88.1",
3
+ "version": "1.89.0",
4
4
  "type": "module",
5
5
  "description": "AlfaDocs shared design system — tokens, components, patterns, and translations for platform, booking, and alfascribe.",
6
6
  "license": "BUSL-1.1",