@alfadocs/ui-kit-debug 1.103.0 → 1.103.1
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/{calendar-appointment-editor-dialog-DL6V6xfj.js → calendar-appointment-editor-dialog-DqyATSh3.js} +3 -3
- package/dist/_chunks/{calendar-appointment-editor-dialog-DL6V6xfj.js.map → calendar-appointment-editor-dialog-DqyATSh3.js.map} +1 -1
- package/dist/_chunks/{care-plan-header-F4l0st2X.js → care-plan-header-k8FslxsU.js} +2 -2
- package/dist/_chunks/{care-plan-header-F4l0st2X.js.map → care-plan-header-k8FslxsU.js.map} +1 -1
- package/dist/_chunks/{contact-profile-card-LXbmhx48.js → contact-profile-card-uExd3pKC.js} +13 -13
- package/dist/_chunks/{contact-profile-card-LXbmhx48.js.map → contact-profile-card-uExd3pKC.js.map} +1 -1
- package/dist/_chunks/{key-value-pair-Cg7gjL7J.js → key-value-pair-DOTl68_U.js} +63 -63
- package/dist/_chunks/key-value-pair-DOTl68_U.js.map +1 -0
- package/dist/_chunks/{patient-summary-card-B4Ijw_ig.js → patient-summary-card-DB7fv-Tr.js} +2 -2
- package/dist/_chunks/{patient-summary-card-B4Ijw_ig.js.map → patient-summary-card-DB7fv-Tr.js.map} +1 -1
- package/dist/_chunks/{payment-request-card-CrXhB5H-.js → payment-request-card-IR83TJax.js} +2 -2
- package/dist/_chunks/{payment-request-card-CrXhB5H-.js.map → payment-request-card-IR83TJax.js.map} +1 -1
- package/dist/_chunks/{periodontal-chart-JmsaYYb7.js → periodontal-chart-DqdUEFxK.js} +2 -2
- package/dist/_chunks/{periodontal-chart-JmsaYYb7.js.map → periodontal-chart-DqdUEFxK.js.map} +1 -1
- package/dist/_chunks/{periodontal-chart-card-TxZBO6kb.js → periodontal-chart-card-CCkzStlm.js} +2 -2
- package/dist/_chunks/{periodontal-chart-card-TxZBO6kb.js.map → periodontal-chart-card-CCkzStlm.js.map} +1 -1
- package/dist/_chunks/{use-appointment-details-read-DawTb1SQ.js → use-appointment-details-read-CmqGGYCy.js} +2 -2
- package/dist/_chunks/{use-appointment-details-read-DawTb1SQ.js.map → use-appointment-details-read-CmqGGYCy.js.map} +1 -1
- package/dist/_chunks/{workflow-map-D_pyYK1B.js → workflow-map-B1jf6QaB.js} +2 -2
- package/dist/_chunks/{workflow-map-D_pyYK1B.js.map → workflow-map-B1jf6QaB.js.map} +1 -1
- package/dist/agent-catalog.json +1 -1
- package/dist/components/appointment-details-panel/index.js +1 -1
- package/dist/components/care-plan-header/index.js +1 -1
- package/dist/components/contact-profile-card/index.js +1 -1
- package/dist/components/key-value-pair/index.js +1 -1
- package/dist/components/key-value-pair/key-value-pair.d.ts.map +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/payment-card/index.js +1 -1
- package/dist/components/periodontal-chart/index.js +1 -1
- package/dist/components/periodontal-chart-card/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/core.css +1 -1
- package/dist/host-compat.css +4 -1
- package/dist/index.js +10 -10
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/key-value-pair-Cg7gjL7J.js.map +0 -1
|
@@ -2,7 +2,7 @@ import { jsx as r, jsxs as n, Fragment as N } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as F, useId as M } from "react";
|
|
3
3
|
import { useTranslation as U } from "react-i18next";
|
|
4
4
|
import { B as P } from "./badge-BUk4RjTS.js";
|
|
5
|
-
import { a as G } from "./key-value-pair-
|
|
5
|
+
import { a as G } from "./key-value-pair-DOTl68_U.js";
|
|
6
6
|
import { L as O } from "./link-DtCfnLnF.js";
|
|
7
7
|
import { S as $ } from "./separator-Bdc9bqoJ.js";
|
|
8
8
|
import { T as A } from "./timestamp-DPLDWdxA.js";
|
|
@@ -195,4 +195,4 @@ export {
|
|
|
195
195
|
ee as C,
|
|
196
196
|
X as c
|
|
197
197
|
};
|
|
198
|
-
//# sourceMappingURL=care-plan-header-
|
|
198
|
+
//# sourceMappingURL=care-plan-header-k8FslxsU.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"care-plan-header-F4l0st2X.js","sources":["../../src/components/care-plan-header/care-plan-header.agent.ts","../../src/components/care-plan-header/care-plan-header.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — CarePlanHeader. */\n/* */\n/* Read-only surface: expose the plan's lifecycle state and the count of */\n/* attention alerts so an agent can introspect a plan header's status. */\n/* Enum + count only — never the plan name, the meta values (operator, */\n/* price list, …), or any patient identity. The actions slot is */\n/* consumer-provided, so no backing action is registered. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { CarePlanHeaderHandle } from './care-plan-header';\n\nexport const carePlanHeaderAgent: AgentAdapter<CarePlanHeaderHandle> = {\n id: 'care-plan-header',\n capabilities: [],\n state: {\n state: {\n type: \"'estimate' | 'accepted' | 'discarded' | 'closed'\",\n descriptionKey: 'ui.agent.carePlanHeader.state.state',\n description:\n 'The plan lifecycle state. Enum value only — never the localised label or any PHI.',\n read: (handle) => handle.getState(),\n },\n alertCount: {\n type: 'number',\n descriptionKey: 'ui.agent.carePlanHeader.state.alertCount',\n description:\n 'How many attention alerts (e.g. missing signature) are showing. Count only — never the alert labels.',\n read: (handle) => handle.getAlertCount(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'care-plan-header',\n description: 'Marks the CarePlanHeader root region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Addresses a specific plan header.',\n },\n },\n};\n","import {\n forwardRef,\n useId,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Badge, type BadgeProps } from '../badge/badge';\nimport { KeyValuePair } from '../key-value-pair/key-value-pair';\nimport { Link } from '../link/link';\nimport { Separator } from '../separator/separator';\nimport { Timestamp } from '../timestamp/timestamp';\nimport {\n entitySurfaceVariants,\n CARE_PLAN_STATE_BADGE,\n isSafeEntityUrl,\n type CarePlanState,\n} from '../_shared/entity-card';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { carePlanHeaderAgent } from './care-plan-header.agent';\n\n/* -------------------------------------------------------------------- */\n/* CarePlanHeader */\n/* */\n/* The identity + meta BANNER for a care plan / estimate — the header */\n/* that crowns an editor or a detail view. The lighter sibling of */\n/* `CarePlanCard`: where that card is the read-only WHOLE-plan summary */\n/* (financials + a phase-progress bar + an entries accordion), */\n/* CarePlanHeader is just the plan's identity (number, name, lifecycle */\n/* badge), its attention alerts (e.g. a missing signature), a consumer- */\n/* labelled meta strip (operator, price list, …), lifecycle dates, and an */\n/* actions slot. It carries NO entries / financials, so it sits cleanly */\n/* atop an EDITABLE surface (odontogram + treatments table) without */\n/* duplicating it. */\n/* */\n/* Composes: entitySurfaceVariants (the shared entity-card surface) + */\n/* Badge (lifecycle state + alerts) + Timestamp (dates) + Link (deep */\n/* link) + KeyValuePair (meta). Reuses the `carePlanCard.*` lifecycle / */\n/* number / date vocabulary, so the header and the summary card speak the */\n/* SAME localised plan language. Identifiers + structural state only reach */\n/* the agent layer — never patient identity. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* -------------------------------------------------------------------- */\n\nexport type { CarePlanState } from '../_shared/entity-card';\n\n/** Heading element the plan name / number renders as. */\nexport type CarePlanHeaderHeadingTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\n/** Tone of an attention alert chip → the Badge variant it paints with. */\nexport type CarePlanHeaderAlertTone = 'warning' | 'error' | 'info';\n\n/**\n * One attention alert shown as a chip beneath the heading — e.g. a missing\n * signature, an expired estimate. The kit owns the chip; the consumer owns the\n * (already-localised) label and the meaning.\n */\nexport interface CarePlanHeaderAlert {\n /** Stable key — identifier only, never PHI. Keys the chip + agent count. */\n id: string;\n /** Already-localised label (consumer-provided). */\n label: ReactNode;\n /** Severity tone. Defaults to `warning`. */\n tone?: CarePlanHeaderAlertTone;\n /** Optional leading glyph (a single lucide element). */\n icon?: ReactElement;\n}\n\n/**\n * One meta fact in the footer strip — operator, price list, referrer, …. The\n * label is consumer-localised; the value is any node (text, an Avatar + name,\n * a Link). Rendered through the shared `KeyValuePair`.\n */\nexport interface CarePlanHeaderMetaItem {\n /** Stable key — identifier only, never PHI. */\n id: string;\n /** Already-localised label (consumer-provided). */\n label: string;\n /** Value node. */\n value: ReactNode;\n /** Optional leading glyph for the pair (a single lucide element). */\n icon?: ReactElement | null;\n}\n\n/** Lifecycle dates — each an ISO-8601 string, rendered via `Timestamp`. */\nexport interface CarePlanHeaderDates {\n /** Acceptance date. */\n acceptedIso?: string;\n /** Closure date. */\n closedIso?: string;\n /** Discard date. */\n discardedIso?: string;\n}\n\n/**\n * Imperative handle the agent adapter drives. Reads only structural state —\n * the lifecycle enum and the count of alerts. Never the plan name, the meta\n * values, or any patient identity.\n */\nexport interface CarePlanHeaderHandle {\n /** The plan lifecycle state (enum, never the localised label). */\n getState: () => CarePlanState;\n /** How many attention alerts are showing. */\n getAlertCount: () => number;\n}\n\nexport interface CarePlanHeaderProps extends Omit<\n HTMLAttributes<HTMLElement>,\n 'title'\n> {\n /** Agent-readiness instance id, surfaced as `data-component-id`. */\n id?: string;\n /**\n * Plan number — used as the heading when no `name` is given (matching\n * platform's `getPresentationName()`, which falls back to `Piano #{number}`)\n * and as the plan's structural identity for the agent layer.\n */\n number: string | number;\n /**\n * Override the number-as-heading label (e.g. a consumer's own `Plan #15`),\n * used ONLY when no `name` is given. Defaults to the localised\n * `Care plan {{number}}` shared with `CarePlanCard`, so the two surfaces read\n * alike unless a consumer opts out. With a `name` present the number is not\n * shown — platform draws no separate plan-number eyebrow.\n */\n numberLabel?: ReactNode;\n /** Plan name — the title heading. Omit for a number-only header. */\n name?: ReactNode;\n /** Lifecycle state — drives the badge variant + localised label. */\n state: CarePlanState;\n /** Deep link for the heading. Rendered only when it passes the safe-URL gate. */\n url?: string;\n /** Attention alerts (e.g. signature missing) shown as chips under the heading. */\n alerts?: CarePlanHeaderAlert[];\n /** Consumer-labelled meta facts (operator, price list, …) in the footer. */\n meta?: CarePlanHeaderMetaItem[];\n /**\n * Lifecycle dates. The date matching the current `state` is folded into the\n * lifecycle badge (e.g. \"Accepted · {date}\"), making the badge self-describing;\n * any other date (e.g. the acceptance date of a now-closed plan) renders as a\n * muted `Timestamp` line beneath the meta.\n */\n dates?: CarePlanHeaderDates;\n /** Inline-end actions slot (e.g. Share / Print). */\n actions?: ReactNode;\n /** Heading element the name / number renders as. Defaults to `h3`. */\n headingTag?: CarePlanHeaderHeadingTag;\n /** `elevated` (default) paints the kit card chrome; `flat` drops it. */\n surface?: 'flat' | 'elevated';\n /** Internal padding density. Defaults to `comfortable`. */\n density?: 'comfortable' | 'compact';\n /** BCP-47 locale override for the dates. Defaults to `i18n.language`. */\n locale?: string;\n /** Fires when the plan deep link / heading is activated. */\n onActivate?: () => void;\n /** Accessible name override for the plan region (defaults to the heading). */\n 'aria-label'?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\n/** English fallbacks for the (reused) lifecycle-state labels. */\nconst STATE_LABEL_FALLBACK: Record<CarePlanState, string> = {\n estimate: 'Estimate',\n accepted: 'Accepted',\n discarded: 'Discarded',\n closed: 'Closed',\n};\n\nconst ALERT_TONE_VARIANT: Record<\n CarePlanHeaderAlertTone,\n NonNullable<BadgeProps['variant']>\n> = {\n warning: 'warning',\n error: 'error',\n info: 'info',\n};\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const CarePlanHeader = forwardRef<HTMLElement, CarePlanHeaderProps>(\n function CarePlanHeader(\n {\n id,\n number,\n numberLabel,\n name,\n state,\n url,\n alerts,\n meta,\n dates,\n actions,\n headingTag = 'h3',\n surface = 'elevated',\n density = 'comfortable',\n locale,\n onActivate,\n 'aria-label': ariaLabel,\n className,\n ...rest\n },\n ref,\n ) {\n const { t, i18n } = useTranslation('ui');\n const headingId = useId();\n const activeLocale = locale ?? i18n.language ?? 'en';\n\n useAgentRegistration(\n carePlanHeaderAgent,\n {\n getState: () => state,\n getAlertCount: () => alerts?.length ?? 0,\n },\n id,\n );\n\n const resolvedNumberLabel =\n numberLabel ??\n t('carePlanCard.number', {\n number,\n defaultValue: 'Care plan {{number}}',\n });\n const stateLabel = t(`carePlanCard.state.${state}`, {\n defaultValue: STATE_LABEL_FALLBACK[state],\n });\n\n const hasName = name != null && name !== '';\n const hasSafeUrl = !!url && isSafeEntityUrl(url);\n const hasAlerts = !!alerts && alerts.length > 0;\n const hasMeta = !!meta && meta.length > 0;\n\n // The date that matches the CURRENT lifecycle state rides INSIDE the state\n // badge (e.g. \"Accepted · {date}\") — the badge becomes self-describing. Any\n // OTHER dates (e.g. the acceptance date of a now-closed plan) remain in the\n // muted footer line below.\n const stateDateIso =\n state === 'accepted'\n ? dates?.acceptedIso\n : state === 'closed'\n ? dates?.closedIso\n : state === 'discarded'\n ? dates?.discardedIso\n : undefined;\n\n const footerDates: Array<{ key: string; label: string; iso: string }> = [];\n if (dates?.acceptedIso && state !== 'accepted') {\n footerDates.push({\n key: 'accepted',\n label: t('carePlanCard.date.accepted', 'Accepted on'),\n iso: dates.acceptedIso,\n });\n }\n if (dates?.closedIso && state !== 'closed') {\n footerDates.push({\n key: 'closed',\n label: t('carePlanCard.date.closed', 'Closed on'),\n iso: dates.closedIso,\n });\n }\n if (dates?.discardedIso && state !== 'discarded') {\n footerDates.push({\n key: 'discarded',\n label: t('carePlanCard.date.discarded', 'Discarded on'),\n iso: dates.discardedIso,\n });\n }\n const hasDates = footerDates.length > 0;\n\n const Heading = headingTag;\n const headingNode = (\n <Heading\n id={headingId}\n className=\"type-title-card ds:m-0 ds:text-[color:var(--foreground)]\"\n >\n {hasName ? name : resolvedNumberLabel}\n </Heading>\n );\n\n const datesLine = hasDates ? (\n <div className=\"type-body-sm ds:flex ds:flex-wrap ds:items-center ds:gap-x-[var(--spacing-md)] ds:gap-y-[var(--spacing-2xs)] ds:text-[color:var(--muted-foreground)]\">\n {footerDates.map((d) => (\n <span\n key={d.key}\n className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\"\n >\n <span>{d.label}</span>\n <Timestamp value={d.iso} format=\"absolute\" locale={activeLocale} />\n </span>\n ))}\n </div>\n ) : null;\n\n return (\n <section\n ref={ref}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabel ? undefined : headingId}\n data-component=\"care-plan-header\"\n data-component-id={id}\n data-state={state}\n id={id}\n className={entitySurfaceVariants({ surface, density, className })}\n {...rest}\n >\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {/* Heading row: the plan's single title (name, or the number label as\n a fallback when unnamed — platform's `getPresentationName()`) on\n the inline-start, the document actions docked inline-end. */}\n <div className=\"ds:flex ds:items-start ds:gap-[var(--spacing-sm)]\">\n <div className=\"ds:min-w-0 ds:flex-1\">\n {hasSafeUrl ? (\n <Link\n href={url as string}\n weight=\"strong\"\n onClick={(event) => {\n if (\n event.defaultPrevented ||\n event.metaKey ||\n event.ctrlKey ||\n event.shiftKey\n ) {\n return;\n }\n onActivate?.();\n }}\n >\n {headingNode}\n </Link>\n ) : (\n headingNode\n )}\n </div>\n {actions ? (\n <div className=\"ds:flex ds:shrink-0 ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]\">\n {actions}\n </div>\n ) : null}\n </div>\n\n {/* Lifecycle state + attention alerts — chips beneath the title. The\n state badge always leads the row; consumer alerts (e.g. a missing\n signature) follow. Size + gap match the shared metadata-chip strip\n (Badge `md` default + `gap-xs`) used by PatientSummaryCard and the\n PatientDetails header, so every card on a patient screen reads with\n one chip rhythm. */}\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]\">\n <Badge variant={CARE_PLAN_STATE_BADGE[state]} size=\"md\" withDot>\n {stateLabel}\n {stateDateIso ? (\n <>\n {' · '}\n <Timestamp\n value={stateDateIso}\n format=\"absolute\"\n locale={activeLocale}\n shape=\"bare\"\n />\n </>\n ) : null}\n </Badge>\n {hasAlerts\n ? alerts!.map((alert) => (\n <Badge\n key={alert.id}\n variant={ALERT_TONE_VARIANT[alert.tone ?? 'warning']}\n size=\"md\"\n leading={alert.icon}\n >\n {alert.label}\n </Badge>\n ))\n : null}\n </div>\n\n {/* Footer: meta (operator, price list, …) + lifecycle dates. */}\n {hasMeta || hasDates ? (\n <>\n <Separator orientation=\"horizontal\" />\n <div className=\"ds:flex ds:min-w-0 ds:flex-col ds:gap-[var(--spacing-xs)]\">\n {hasMeta ? (\n <div className=\"ds:flex ds:flex-wrap ds:gap-x-[var(--spacing-lg)] ds:gap-y-[var(--spacing-xs)]\">\n {meta!.map((item) => (\n <KeyValuePair\n key={item.id}\n label={item.label}\n value={item.value}\n icon={item.icon ?? undefined}\n data-field-id={item.id}\n />\n ))}\n </div>\n ) : null}\n {datesLine}\n </div>\n </>\n ) : null}\n </div>\n </section>\n );\n },\n);\n\nCarePlanHeader.displayName = 'CarePlanHeader';\n\n/** Surface variant union re-exported for downstream typing. */\nexport type CarePlanHeaderSurface = NonNullable<\n VariantProps<typeof entitySurfaceVariants>['surface']\n>;\n"],"names":["carePlanHeaderAgent","handle","STATE_LABEL_FALLBACK","ALERT_TONE_VARIANT","CarePlanHeader","forwardRef","id","number","numberLabel","name","state","url","alerts","meta","dates","actions","headingTag","surface","density","locale","onActivate","ariaLabel","className","rest","ref","t","i18n","useTranslation","headingId","useId","activeLocale","useAgentRegistration","resolvedNumberLabel","stateLabel","hasName","hasSafeUrl","isSafeEntityUrl","hasAlerts","hasMeta","stateDateIso","footerDates","hasDates","headingNode","jsx","datesLine","d","jsxs","Timestamp","entitySurfaceVariants","Link","event","Badge","CARE_PLAN_STATE_BADGE","Fragment","alert","Separator","item","KeyValuePair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AMb,GACH,IACE;AAAA,cACHZ;AAAA,YAAA,EAAA,CACH;AAAA,UAAA,EAAA,CACF,IACE;AAAA,QAAA,EAAA,CACN;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEAxC,GAAe,cAAc;"}
|
|
1
|
+
{"version":3,"file":"care-plan-header-k8FslxsU.js","sources":["../../src/components/care-plan-header/care-plan-header.agent.ts","../../src/components/care-plan-header/care-plan-header.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — CarePlanHeader. */\n/* */\n/* Read-only surface: expose the plan's lifecycle state and the count of */\n/* attention alerts so an agent can introspect a plan header's status. */\n/* Enum + count only — never the plan name, the meta values (operator, */\n/* price list, …), or any patient identity. The actions slot is */\n/* consumer-provided, so no backing action is registered. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { CarePlanHeaderHandle } from './care-plan-header';\n\nexport const carePlanHeaderAgent: AgentAdapter<CarePlanHeaderHandle> = {\n id: 'care-plan-header',\n capabilities: [],\n state: {\n state: {\n type: \"'estimate' | 'accepted' | 'discarded' | 'closed'\",\n descriptionKey: 'ui.agent.carePlanHeader.state.state',\n description:\n 'The plan lifecycle state. Enum value only — never the localised label or any PHI.',\n read: (handle) => handle.getState(),\n },\n alertCount: {\n type: 'number',\n descriptionKey: 'ui.agent.carePlanHeader.state.alertCount',\n description:\n 'How many attention alerts (e.g. missing signature) are showing. Count only — never the alert labels.',\n read: (handle) => handle.getAlertCount(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'care-plan-header',\n description: 'Marks the CarePlanHeader root region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Addresses a specific plan header.',\n },\n },\n};\n","import {\n forwardRef,\n useId,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Badge, type BadgeProps } from '../badge/badge';\nimport { KeyValuePair } from '../key-value-pair/key-value-pair';\nimport { Link } from '../link/link';\nimport { Separator } from '../separator/separator';\nimport { Timestamp } from '../timestamp/timestamp';\nimport {\n entitySurfaceVariants,\n CARE_PLAN_STATE_BADGE,\n isSafeEntityUrl,\n type CarePlanState,\n} from '../_shared/entity-card';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { carePlanHeaderAgent } from './care-plan-header.agent';\n\n/* -------------------------------------------------------------------- */\n/* CarePlanHeader */\n/* */\n/* The identity + meta BANNER for a care plan / estimate — the header */\n/* that crowns an editor or a detail view. The lighter sibling of */\n/* `CarePlanCard`: where that card is the read-only WHOLE-plan summary */\n/* (financials + a phase-progress bar + an entries accordion), */\n/* CarePlanHeader is just the plan's identity (number, name, lifecycle */\n/* badge), its attention alerts (e.g. a missing signature), a consumer- */\n/* labelled meta strip (operator, price list, …), lifecycle dates, and an */\n/* actions slot. It carries NO entries / financials, so it sits cleanly */\n/* atop an EDITABLE surface (odontogram + treatments table) without */\n/* duplicating it. */\n/* */\n/* Composes: entitySurfaceVariants (the shared entity-card surface) + */\n/* Badge (lifecycle state + alerts) + Timestamp (dates) + Link (deep */\n/* link) + KeyValuePair (meta). Reuses the `carePlanCard.*` lifecycle / */\n/* number / date vocabulary, so the header and the summary card speak the */\n/* SAME localised plan language. Identifiers + structural state only reach */\n/* the agent layer — never patient identity. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* -------------------------------------------------------------------- */\n\nexport type { CarePlanState } from '../_shared/entity-card';\n\n/** Heading element the plan name / number renders as. */\nexport type CarePlanHeaderHeadingTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\n/** Tone of an attention alert chip → the Badge variant it paints with. */\nexport type CarePlanHeaderAlertTone = 'warning' | 'error' | 'info';\n\n/**\n * One attention alert shown as a chip beneath the heading — e.g. a missing\n * signature, an expired estimate. The kit owns the chip; the consumer owns the\n * (already-localised) label and the meaning.\n */\nexport interface CarePlanHeaderAlert {\n /** Stable key — identifier only, never PHI. Keys the chip + agent count. */\n id: string;\n /** Already-localised label (consumer-provided). */\n label: ReactNode;\n /** Severity tone. Defaults to `warning`. */\n tone?: CarePlanHeaderAlertTone;\n /** Optional leading glyph (a single lucide element). */\n icon?: ReactElement;\n}\n\n/**\n * One meta fact in the footer strip — operator, price list, referrer, …. The\n * label is consumer-localised; the value is any node (text, an Avatar + name,\n * a Link). Rendered through the shared `KeyValuePair`.\n */\nexport interface CarePlanHeaderMetaItem {\n /** Stable key — identifier only, never PHI. */\n id: string;\n /** Already-localised label (consumer-provided). */\n label: string;\n /** Value node. */\n value: ReactNode;\n /** Optional leading glyph for the pair (a single lucide element). */\n icon?: ReactElement | null;\n}\n\n/** Lifecycle dates — each an ISO-8601 string, rendered via `Timestamp`. */\nexport interface CarePlanHeaderDates {\n /** Acceptance date. */\n acceptedIso?: string;\n /** Closure date. */\n closedIso?: string;\n /** Discard date. */\n discardedIso?: string;\n}\n\n/**\n * Imperative handle the agent adapter drives. Reads only structural state —\n * the lifecycle enum and the count of alerts. Never the plan name, the meta\n * values, or any patient identity.\n */\nexport interface CarePlanHeaderHandle {\n /** The plan lifecycle state (enum, never the localised label). */\n getState: () => CarePlanState;\n /** How many attention alerts are showing. */\n getAlertCount: () => number;\n}\n\nexport interface CarePlanHeaderProps extends Omit<\n HTMLAttributes<HTMLElement>,\n 'title'\n> {\n /** Agent-readiness instance id, surfaced as `data-component-id`. */\n id?: string;\n /**\n * Plan number — used as the heading when no `name` is given (matching\n * platform's `getPresentationName()`, which falls back to `Piano #{number}`)\n * and as the plan's structural identity for the agent layer.\n */\n number: string | number;\n /**\n * Override the number-as-heading label (e.g. a consumer's own `Plan #15`),\n * used ONLY when no `name` is given. Defaults to the localised\n * `Care plan {{number}}` shared with `CarePlanCard`, so the two surfaces read\n * alike unless a consumer opts out. With a `name` present the number is not\n * shown — platform draws no separate plan-number eyebrow.\n */\n numberLabel?: ReactNode;\n /** Plan name — the title heading. Omit for a number-only header. */\n name?: ReactNode;\n /** Lifecycle state — drives the badge variant + localised label. */\n state: CarePlanState;\n /** Deep link for the heading. Rendered only when it passes the safe-URL gate. */\n url?: string;\n /** Attention alerts (e.g. signature missing) shown as chips under the heading. */\n alerts?: CarePlanHeaderAlert[];\n /** Consumer-labelled meta facts (operator, price list, …) in the footer. */\n meta?: CarePlanHeaderMetaItem[];\n /**\n * Lifecycle dates. The date matching the current `state` is folded into the\n * lifecycle badge (e.g. \"Accepted · {date}\"), making the badge self-describing;\n * any other date (e.g. the acceptance date of a now-closed plan) renders as a\n * muted `Timestamp` line beneath the meta.\n */\n dates?: CarePlanHeaderDates;\n /** Inline-end actions slot (e.g. Share / Print). */\n actions?: ReactNode;\n /** Heading element the name / number renders as. Defaults to `h3`. */\n headingTag?: CarePlanHeaderHeadingTag;\n /** `elevated` (default) paints the kit card chrome; `flat` drops it. */\n surface?: 'flat' | 'elevated';\n /** Internal padding density. Defaults to `comfortable`. */\n density?: 'comfortable' | 'compact';\n /** BCP-47 locale override for the dates. Defaults to `i18n.language`. */\n locale?: string;\n /** Fires when the plan deep link / heading is activated. */\n onActivate?: () => void;\n /** Accessible name override for the plan region (defaults to the heading). */\n 'aria-label'?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\n/** English fallbacks for the (reused) lifecycle-state labels. */\nconst STATE_LABEL_FALLBACK: Record<CarePlanState, string> = {\n estimate: 'Estimate',\n accepted: 'Accepted',\n discarded: 'Discarded',\n closed: 'Closed',\n};\n\nconst ALERT_TONE_VARIANT: Record<\n CarePlanHeaderAlertTone,\n NonNullable<BadgeProps['variant']>\n> = {\n warning: 'warning',\n error: 'error',\n info: 'info',\n};\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const CarePlanHeader = forwardRef<HTMLElement, CarePlanHeaderProps>(\n function CarePlanHeader(\n {\n id,\n number,\n numberLabel,\n name,\n state,\n url,\n alerts,\n meta,\n dates,\n actions,\n headingTag = 'h3',\n surface = 'elevated',\n density = 'comfortable',\n locale,\n onActivate,\n 'aria-label': ariaLabel,\n className,\n ...rest\n },\n ref,\n ) {\n const { t, i18n } = useTranslation('ui');\n const headingId = useId();\n const activeLocale = locale ?? i18n.language ?? 'en';\n\n useAgentRegistration(\n carePlanHeaderAgent,\n {\n getState: () => state,\n getAlertCount: () => alerts?.length ?? 0,\n },\n id,\n );\n\n const resolvedNumberLabel =\n numberLabel ??\n t('carePlanCard.number', {\n number,\n defaultValue: 'Care plan {{number}}',\n });\n const stateLabel = t(`carePlanCard.state.${state}`, {\n defaultValue: STATE_LABEL_FALLBACK[state],\n });\n\n const hasName = name != null && name !== '';\n const hasSafeUrl = !!url && isSafeEntityUrl(url);\n const hasAlerts = !!alerts && alerts.length > 0;\n const hasMeta = !!meta && meta.length > 0;\n\n // The date that matches the CURRENT lifecycle state rides INSIDE the state\n // badge (e.g. \"Accepted · {date}\") — the badge becomes self-describing. Any\n // OTHER dates (e.g. the acceptance date of a now-closed plan) remain in the\n // muted footer line below.\n const stateDateIso =\n state === 'accepted'\n ? dates?.acceptedIso\n : state === 'closed'\n ? dates?.closedIso\n : state === 'discarded'\n ? dates?.discardedIso\n : undefined;\n\n const footerDates: Array<{ key: string; label: string; iso: string }> = [];\n if (dates?.acceptedIso && state !== 'accepted') {\n footerDates.push({\n key: 'accepted',\n label: t('carePlanCard.date.accepted', 'Accepted on'),\n iso: dates.acceptedIso,\n });\n }\n if (dates?.closedIso && state !== 'closed') {\n footerDates.push({\n key: 'closed',\n label: t('carePlanCard.date.closed', 'Closed on'),\n iso: dates.closedIso,\n });\n }\n if (dates?.discardedIso && state !== 'discarded') {\n footerDates.push({\n key: 'discarded',\n label: t('carePlanCard.date.discarded', 'Discarded on'),\n iso: dates.discardedIso,\n });\n }\n const hasDates = footerDates.length > 0;\n\n const Heading = headingTag;\n const headingNode = (\n <Heading\n id={headingId}\n className=\"type-title-card ds:m-0 ds:text-[color:var(--foreground)]\"\n >\n {hasName ? name : resolvedNumberLabel}\n </Heading>\n );\n\n const datesLine = hasDates ? (\n <div className=\"type-body-sm ds:flex ds:flex-wrap ds:items-center ds:gap-x-[var(--spacing-md)] ds:gap-y-[var(--spacing-2xs)] ds:text-[color:var(--muted-foreground)]\">\n {footerDates.map((d) => (\n <span\n key={d.key}\n className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\"\n >\n <span>{d.label}</span>\n <Timestamp value={d.iso} format=\"absolute\" locale={activeLocale} />\n </span>\n ))}\n </div>\n ) : null;\n\n return (\n <section\n ref={ref}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabel ? undefined : headingId}\n data-component=\"care-plan-header\"\n data-component-id={id}\n data-state={state}\n id={id}\n className={entitySurfaceVariants({ surface, density, className })}\n {...rest}\n >\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {/* Heading row: the plan's single title (name, or the number label as\n a fallback when unnamed — platform's `getPresentationName()`) on\n the inline-start, the document actions docked inline-end. */}\n <div className=\"ds:flex ds:items-start ds:gap-[var(--spacing-sm)]\">\n <div className=\"ds:min-w-0 ds:flex-1\">\n {hasSafeUrl ? (\n <Link\n href={url as string}\n weight=\"strong\"\n onClick={(event) => {\n if (\n event.defaultPrevented ||\n event.metaKey ||\n event.ctrlKey ||\n event.shiftKey\n ) {\n return;\n }\n onActivate?.();\n }}\n >\n {headingNode}\n </Link>\n ) : (\n headingNode\n )}\n </div>\n {actions ? (\n <div className=\"ds:flex ds:shrink-0 ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]\">\n {actions}\n </div>\n ) : null}\n </div>\n\n {/* Lifecycle state + attention alerts — chips beneath the title. The\n state badge always leads the row; consumer alerts (e.g. a missing\n signature) follow. Size + gap match the shared metadata-chip strip\n (Badge `md` default + `gap-xs`) used by PatientSummaryCard and the\n PatientDetails header, so every card on a patient screen reads with\n one chip rhythm. */}\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]\">\n <Badge variant={CARE_PLAN_STATE_BADGE[state]} size=\"md\" withDot>\n {stateLabel}\n {stateDateIso ? (\n <>\n {' · '}\n <Timestamp\n value={stateDateIso}\n format=\"absolute\"\n locale={activeLocale}\n shape=\"bare\"\n />\n </>\n ) : null}\n </Badge>\n {hasAlerts\n ? alerts!.map((alert) => (\n <Badge\n key={alert.id}\n variant={ALERT_TONE_VARIANT[alert.tone ?? 'warning']}\n size=\"md\"\n leading={alert.icon}\n >\n {alert.label}\n </Badge>\n ))\n : null}\n </div>\n\n {/* Footer: meta (operator, price list, …) + lifecycle dates. */}\n {hasMeta || hasDates ? (\n <>\n <Separator orientation=\"horizontal\" />\n <div className=\"ds:flex ds:min-w-0 ds:flex-col ds:gap-[var(--spacing-xs)]\">\n {hasMeta ? (\n <div className=\"ds:flex ds:flex-wrap ds:gap-x-[var(--spacing-lg)] ds:gap-y-[var(--spacing-xs)]\">\n {meta!.map((item) => (\n <KeyValuePair\n key={item.id}\n label={item.label}\n value={item.value}\n icon={item.icon ?? undefined}\n data-field-id={item.id}\n />\n ))}\n </div>\n ) : null}\n {datesLine}\n </div>\n </>\n ) : null}\n </div>\n </section>\n );\n },\n);\n\nCarePlanHeader.displayName = 'CarePlanHeader';\n\n/** Surface variant union re-exported for downstream typing. */\nexport type CarePlanHeaderSurface = NonNullable<\n VariantProps<typeof entitySurfaceVariants>['surface']\n>;\n"],"names":["carePlanHeaderAgent","handle","STATE_LABEL_FALLBACK","ALERT_TONE_VARIANT","CarePlanHeader","forwardRef","id","number","numberLabel","name","state","url","alerts","meta","dates","actions","headingTag","surface","density","locale","onActivate","ariaLabel","className","rest","ref","t","i18n","useTranslation","headingId","useId","activeLocale","useAgentRegistration","resolvedNumberLabel","stateLabel","hasName","hasSafeUrl","isSafeEntityUrl","hasAlerts","hasMeta","stateDateIso","footerDates","hasDates","headingNode","jsx","datesLine","d","jsxs","Timestamp","entitySurfaceVariants","Link","event","Badge","CARE_PLAN_STATE_BADGE","Fragment","alert","Separator","item","KeyValuePair"],"mappings":";;;;;;;;;;;AAaO,MAAMA,IAA0D;AAAA,EACrE,IAAI;AAAA,EACJ,cAAc,CAAA;AAAA,EACd,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,YAAY;AAAA,MACV,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,cAAA;AAAA,IAAc;AAAA,EACzC;AAAA,EAEF,SAAS,CAAA;AAAA,EACT,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IAAA;AAAA,IAEf,YAAY;AAAA,MACV,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,aACE;AAAA,IAAA;AAAA,EACJ;AAEJ,GC2HMC,IAAsD;AAAA,EAC1D,UAAU;AAAA,EACV,UAAU;AAAA,EACV,WAAW;AAAA,EACX,QAAQ;AACV,GAEMC,IAGF;AAAA,EACF,SAAS;AAAA,EACT,OAAO;AAAA,EACP,MAAM;AACR,GAMaC,KAAiBC;AAAA,EAC5B,SACE;AAAA,IACE,IAAAC;AAAA,IACA,QAAAC;AAAA,IACA,aAAAC;AAAA,IACA,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,KAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,SAAAC,IAAU;AAAA,IACV,SAAAC,IAAU;AAAA,IACV,QAAAC;AAAA,IACA,YAAAC;AAAA,IACA,cAAcC;AAAA,IACd,WAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,GACA;AACA,UAAM,EAAE,GAA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BACnB,iBAAeA,EAAK;AAAA,gBAAA;AAAA,gBAJfA,EAAK;AAAA,cAAA,CAMb,GACH,IACE;AAAA,cACHZ;AAAA,YAAA,EAAA,CACH;AAAA,UAAA,EAAA,CACF,IACE;AAAA,QAAA,EAAA,CACN;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEAxC,GAAe,cAAc;"}
|
|
@@ -4,14 +4,14 @@ import { c as me } from "./index-D2ZczOXr.js";
|
|
|
4
4
|
import { useTranslation as he } from "react-i18next";
|
|
5
5
|
import { B as k } from "./badge-BUk4RjTS.js";
|
|
6
6
|
import { C as O } from "./card-C85_Ndhb.js";
|
|
7
|
-
import { K as ge, a as V, S as ye } from "./key-value-pair-
|
|
7
|
+
import { K as ge, a as V, S as ye } from "./key-value-pair-DOTl68_U.js";
|
|
8
8
|
import { L as d } from "./link-DtCfnLnF.js";
|
|
9
9
|
import { S as ve } from "./specialty-list-BzalHR8_.js";
|
|
10
10
|
import { b as be } from "./format-price-BcFBa-WP.js";
|
|
11
|
-
import { u as
|
|
11
|
+
import { u as xe } from "./registry-DvAUVLHh.js";
|
|
12
12
|
import { S as w } from "./stethoscope-sZXGC43m.js";
|
|
13
13
|
import { H as z } from "./heart--qCA4ffe.js";
|
|
14
|
-
import { c as
|
|
14
|
+
import { c as Ce } from "./createLucideIcon-DhHxpK9K.js";
|
|
15
15
|
import { S as E } from "./shield-check-DCJALLVh.js";
|
|
16
16
|
import { L } from "./languages-CGLX6Qpe.js";
|
|
17
17
|
import { G as U } from "./globe-sHBW1JN5.js";
|
|
@@ -29,7 +29,7 @@ const Pe = [
|
|
|
29
29
|
["rect", { width: "20", height: "12", x: "2", y: "6", rx: "2", key: "9lu3g6" }],
|
|
30
30
|
["circle", { cx: "12", cy: "12", r: "2", key: "1c9p78" }],
|
|
31
31
|
["path", { d: "M6 12h.01M18 12h.01", key: "113zkx" }]
|
|
32
|
-
], W =
|
|
32
|
+
], W = Ce("banknote", Pe), ke = {
|
|
33
33
|
id: "contact-profile-card",
|
|
34
34
|
// Passive presentation surface — only exposes the rendered profession for
|
|
35
35
|
// introspection. No interactive capability is backed by the handle.
|
|
@@ -131,8 +131,8 @@ const Ie = pe(
|
|
|
131
131
|
insurances: v,
|
|
132
132
|
firstVisitPriceCents: b,
|
|
133
133
|
currencyCode: S = "EUR",
|
|
134
|
-
profession:
|
|
135
|
-
specialties:
|
|
134
|
+
profession: x,
|
|
135
|
+
specialties: C,
|
|
136
136
|
specializedInFearPatients: D,
|
|
137
137
|
googleMapsApiKey: M,
|
|
138
138
|
mapZoom: Y = 14,
|
|
@@ -254,16 +254,16 @@ const Ie = pe(
|
|
|
254
254
|
label: r("contactProfileCard.label.expertForAnxiousPatients"),
|
|
255
255
|
value: r("contactProfileCard.value.yesShort")
|
|
256
256
|
});
|
|
257
|
-
const f =
|
|
258
|
-
|
|
257
|
+
const f = C && C.length > 0 ? C : void 0;
|
|
258
|
+
x && !f && o.push({
|
|
259
259
|
key: "profession",
|
|
260
260
|
icon: /* @__PURE__ */ e(w, { "aria-hidden": "true" }),
|
|
261
261
|
label: r("contactProfileCard.label.profession"),
|
|
262
|
-
value:
|
|
263
|
-
}),
|
|
262
|
+
value: x
|
|
263
|
+
}), xe(
|
|
264
264
|
ke,
|
|
265
265
|
{
|
|
266
|
-
getProfession: () =>
|
|
266
|
+
getProfession: () => x,
|
|
267
267
|
getSpecialtyKeys: () => (f ?? []).map((n) => n.key)
|
|
268
268
|
},
|
|
269
269
|
P
|
|
@@ -295,7 +295,7 @@ const Ie = pe(
|
|
|
295
295
|
V,
|
|
296
296
|
{
|
|
297
297
|
layout: "vertical",
|
|
298
|
-
className: "ds:!gap-[var(--spacing-md)]",
|
|
298
|
+
className: "ds:!gap-x-[var(--spacing-md)]",
|
|
299
299
|
icon: /* @__PURE__ */ e(w, { "aria-hidden": "true" }),
|
|
300
300
|
label: r("contactProfileCard.label.profession"),
|
|
301
301
|
value: /* @__PURE__ */ e(ve, { items: f })
|
|
@@ -366,4 +366,4 @@ export {
|
|
|
366
366
|
Ie as b,
|
|
367
367
|
ke as c
|
|
368
368
|
};
|
|
369
|
-
//# sourceMappingURL=contact-profile-card-
|
|
369
|
+
//# sourceMappingURL=contact-profile-card-uExd3pKC.js.map
|
package/dist/_chunks/{contact-profile-card-LXbmhx48.js.map → contact-profile-card-uExd3pKC.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contact-profile-card-LXbmhx48.js","sources":["../../node_modules/lucide-react/dist/esm/icons/banknote.mjs","../../src/components/contact-profile-card/contact-profile-card.agent.ts","../../src/components/contact-profile-card/contact-profile-card.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"rect\", { width: \"20\", height: \"12\", x: \"2\", y: \"6\", rx: \"2\", key: \"9lu3g6\" }],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"2\", key: \"1c9p78\" }],\n [\"path\", { d: \"M6 12h.01M18 12h.01\", key: \"113zkx\" }]\n];\nconst Banknote = createLucideIcon(\"banknote\", __iconNode);\n\nexport { __iconNode, Banknote as default };\n//# sourceMappingURL=banknote.mjs.map\n","import type { AgentAdapter } from '../../agent/types';\nimport type { ContactProfileCardHandle } from './contact-profile-card';\n\n/* -------------------------------------------------------------------- */\n/* Agent adapter — ContactProfileCard */\n/* */\n/* Read-only adapter. Surfaces the rendered profession field so an */\n/* agent / MCP runtime can resolve \"what kind of practice is this?\" */\n/* without re-parsing the DOM. No actions yet — the card is a passive */\n/* presentation surface; navigation lives on the consumer's page. */\n/* -------------------------------------------------------------------- */\n\nexport const contactProfileCardAgent: AgentAdapter<ContactProfileCardHandle> = {\n id: 'contact-profile-card',\n // Passive presentation surface — only exposes the rendered profession for\n // introspection. No interactive capability is backed by the handle.\n capabilities: [],\n state: {\n profession: {\n type: 'string',\n descriptionKey: 'ui.agent.contactProfileCard.state.profession',\n description:\n 'Profession string the card is currently rendering — undefined when the consumer omitted it.',\n read: (handle) => handle.getProfession(),\n },\n specialtyKeys: {\n type: 'string[]',\n descriptionKey: 'ui.agent.contactProfileCard.state.specialtyKeys',\n description:\n 'Profession keys of the specialities the card is rendering, in display order. Empty when the consumer passed none.',\n read: (handle) => handle.getSpecialtyKeys(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'contact-profile-card',\n description: 'Marks the ContactProfileCard root region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n forwardRef,\n useId,\n useMemo,\n type ComponentPropsWithoutRef,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport {\n Banknote,\n ExternalLink,\n Globe,\n Heart,\n Languages as LanguagesIcon,\n Mail,\n MapPin,\n MessageCircle,\n Phone,\n ShieldCheck,\n Stethoscope,\n type LucideIcon,\n} from 'lucide-react';\nimport { Badge } from '../badge/badge';\nimport { Card } from '../card/card';\nimport {\n KeyValueList,\n KeyValuePair,\n SemanticKeyValueGroup,\n} from '../key-value-pair/key-value-pair';\nimport { Link } from '../link/link';\nimport {\n SpecialtyList,\n type SpecialtyListItem,\n} from '../specialty-list/specialty-list';\nimport { formatPriceOrFree } from '../_shared/format-price';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { contactProfileCardAgent } from './contact-profile-card.agent';\n\n/* -------------------------------------------------------------------- */\n/* ContactProfileCard */\n/* */\n/* Replaces the bespoke \"Profilo\" / \"Practice info\" cards that every */\n/* AlfaDocs surface composes by hand (booking-website PracticeInfoCard, */\n/* alfascribe operator pages, builders docs example, …). Composes Card */\n/* + KeyValueList + KeyValuePair so the labels share a column (no */\n/* zigzag values) and every row uses the same lucide icon family. */\n/* */\n/* The component is intentionally opinionated: every field is optional, */\n/* but the ORDER, ICONS, and LABELS are owned by the kit. Consumers */\n/* pass the data; the kit owns the visual + i18n. */\n/* */\n/* All visible text flows through `useTranslation('ui')` against the */\n/* `contactProfileCard.*` namespace. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* CVA */\n/* -------------------------------------------------------------------- */\n\n// Override the KVP icon colour at the card root so every inner row's\n// leading glyph paints with `--accent` (brand magenta/violet) instead\n// of the default `--muted-foreground`. The ContactProfileCard is a\n// marketing surface — muted icons read as disabled against the\n// otherwise saturated card chrome. Scoped via CSS custom property so\n// only this card's icons shift; standalone KVPs elsewhere keep\n// `--muted-foreground`.\nconst rootVariants = cva(\n 'ds:w-full ds:text-[color:var(--foreground)] ds:[--key-value-pair-icon-color:var(--accent)]',\n {\n variants: {\n // Matches the kit's other `surface` props (Booking, ReviewsPanel).\n // The card itself renders `<Card variant=\"elevated\">` so the\n // `surface=\"flat\"` opt-out is rare — most consumers want the\n // boundary.\n surface: {\n flat: '',\n elevated: '',\n },\n },\n defaultVariants: { surface: 'elevated' },\n },\n);\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* -------------------------------------------------------------------- */\n\nexport interface ContactProfileCardAddress {\n /** Display text — already formatted by the consumer (street, postcode, city). */\n line: string;\n /** Optional lat/lng — drives the static-map link + the embedded thumbnail. */\n lat?: number;\n lng?: number;\n}\n\nexport interface ContactProfileCardHandle {\n /** Resolved consumer-supplied data — useful for agent introspection. */\n getProfession: () => string | undefined;\n /** Profession keys of the rendered specialities, empty when there are none. */\n getSpecialtyKeys: () => string[];\n}\n\nexport interface ContactProfileCardProps extends Omit<\n ComponentPropsWithoutRef<'div'>,\n 'aria-label' | 'children' | 'children'\n> {\n /**\n * Override the localised \"Profilo\" / \"Profile\" heading. Most\n * consumers leave this unset.\n */\n heading?: string;\n /**\n * Free-text intro paragraph rendered above the data rows (e.g.\n * the practice's `bookingDescription` field). When omitted, the\n * card jumps straight into the data rows.\n */\n description?: string;\n\n /* ----- Identity rows ----- */\n\n /** Street + postcode + city, with optional lat/lng for the map link. */\n address?: ContactProfileCardAddress;\n /** Phone number, displayed as-is. Compiled into a `tel:` link. */\n phone?: string;\n /**\n * WhatsApp number — digits only (no `+`, no spaces). Compiled into\n * a `https://wa.me/<number>` link with an optional pre-filled message.\n */\n whatsappNumber?: string;\n /** Optional pre-filled WhatsApp message. Consumer-localised. */\n whatsappMessage?: string;\n /** Public-facing email. Compiled into a `mailto:` link. */\n email?: string;\n /**\n * Practice website. An address without a scheme (`www.example.it`) is\n * linked over `https://`; anything but a web address shows as text.\n */\n website?: string;\n\n /* ----- Embedded map thumbnail ----- */\n\n /**\n * Google Maps Static API key. When provided alongside `address.lat`\n * and `address.lng`, renders a static-map thumbnail at the top of\n * the card — a single one-shot `<img>` fetch, no JS SDK boot, no\n * consent gate needed (the same pattern PracticeResults uses).\n *\n * Without it (or without coords), the card renders info rows only —\n * the address row's \"Open in Google Maps\" link is still emitted as\n * a real `<a>` so the spatial cue isn't lost.\n *\n * Additive — existing consumers that don't pass this prop see the\n * same render as before.\n */\n googleMapsApiKey?: string;\n /**\n * Zoom level for the embedded map thumbnail. Default `14` —\n * neighbourhood-level, shows the pin in context. Ignored when the\n * thumbnail isn't rendered.\n */\n mapZoom?: number;\n\n /* ----- Profile metadata ----- */\n\n /**\n * ISO 639-1 language codes the practice speaks. Rendered as\n * `<Badge variant=\"neutral\">` chips. Each code is auto-resolved\n * into the active locale's native language name via the kit's\n * built-in `languages.<iso>` i18n bundle (18 ISO codes × 18\n * locales). For example `languages={['it', 'en']}` with\n * `i18n.language === 'it'` renders \"Italiano\" + \"Inglese\".\n *\n * Unknown / unbundled codes fall back to the uppercase ISO code\n * (`'xyz'` → `'XYZ'`). To override a specific label — regional\n * dialect, brand-voice variant, codes the kit doesn't ship — pass\n * `languageLabels`.\n */\n languages?: string[];\n /**\n * Override map from ISO code → display label, applied on top of\n * the kit's i18n auto-resolution. Only set when you need a\n * consumer-specific label for a code — the typical case is\n * regional dialect / brand-voice variants / non-ISO codes.\n *\n * Resolution order: `languageLabels[code]` > `t('languages.<code>')`\n * > `code.toUpperCase()`.\n */\n languageLabels?: Record<string, string>;\n /**\n * Insurance / convention strings (consumer-supplied, free text).\n * Rendered as `<Badge variant=\"info\">` chips.\n */\n insurances?: string[];\n /**\n * First-visit price in the smallest currency unit (cents / centesimi).\n * Formatted via `Intl.NumberFormat`; `0` renders the translated word\n * \"Free\". Omit when the consumer doesn't want to show the price.\n */\n firstVisitPriceCents?: number;\n /** ISO-4217 currency code for the price formatter. Defaults to `EUR`. */\n currencyCode?: string;\n /** Profession line — single value or already-joined comma list. */\n profession?: string;\n /**\n * The practice's specialities, each with its medical glyph. When present\n * and not empty they replace the `profession` row with a vertical row\n * (\"Profession\" above, a `SpecialtyList` below): a long list needs the full\n * card width, not the value column. When absent or empty the `profession`\n * string row renders as before.\n */\n specialties?: SpecialtyListItem[];\n /** Show the \"expert for anxious patients\" row when true. */\n specializedInFearPatients?: boolean;\n\n /* ----- Telemetry hooks ----- */\n\n /**\n * Fires when the patient clicks the phone link. The kit emits a\n * `track('practice_profile_card_phone_click')` event before\n * invoking this — gate consumer-side analytics on the same event\n * to avoid duplicate fires.\n */\n onPhoneClick?: () => void;\n /** Fires when the patient clicks the WhatsApp link. */\n onWhatsAppClick?: () => void;\n /** Fires when the patient clicks the static-map link. */\n onMapClick?: () => void;\n /** Fires when the patient clicks the email mailto link. */\n onEmailClick?: () => void;\n\n /* ----- Slots ----- */\n\n /**\n * Rendered above the heading — e.g. a `<Avatar>` for the operator\n * variant, or a coloured chip strip. Optional.\n */\n headerSlot?: ReactNode;\n /**\n * Render an arbitrary map widget at the top of the card chrome —\n * replaces the built-in static `<img>` thumbnail that\n * `googleMapsApiKey` would otherwise produce. Use this when you\n * want an interactive map inside the card boundary instead of a\n * fixed image:\n *\n * <ContactProfileCard\n * mapSlot={\n * <PracticeMap practice={practice} googleMapsApiKey={key} />\n * }\n * …\n * />\n *\n * When both `mapSlot` and `googleMapsApiKey` are provided, the slot\n * wins (explicit > implicit). When neither is provided, no map area\n * renders. The slot is unstyled — pass through any container chrome\n * the consumer wants (e.g. a fixed height wrapper). The kit\n * positions it where the static thumbnail would have lived.\n */\n mapSlot?: ReactNode;\n /**\n * @default false\n * Render the facts (address, phone, languages and the other rows) as a\n * real definition list: a `<dl>` with one `<dt>` label and one `<dd>`\n * value per row, so crawlers and screen readers pair every label with its\n * value. Same look as the default; only the elements change. Turn it on\n * for public pages that search engines index, such as the practice page.\n */\n factsAsDefinitionList?: boolean;\n /**\n * Rendered at the end of the card body, below the rows. Use for\n * a \"Book now\" `<Button>` or a \"View full profile\" link.\n */\n footerSlot?: ReactNode;\n\n /* ----- Styling ----- */\n\n /**\n * `'elevated'` (default) wraps the card in `<Card variant=\"elevated\">`\n * for a defined surface — what most consumers want when the card\n * stands alone on a page. `'flat'` drops the Card chrome so the\n * content sits naked — use when an outer card / sheet already\n * provides the boundary (e.g. embedded inside a `<Sheet>` or a\n * parent `<Card.Body>`).\n */\n surface?: 'flat' | 'elevated';\n\n /* ----- a11y ----- */\n\n /** Override the default region aria-label. */\n 'aria-label'?: string;\n /** Agent-readiness consumer id, surfaced as `data-component-id`. */\n id?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\n/** Strip everything except digits + leading `+` for `tel:` URLs. */\nfunction normalisePhone(raw: string): string {\n return raw.replace(/[^\\d+]/g, '');\n}\n\n/** Build the WhatsApp `wa.me` URL. Number must already be digits-only. */\nfunction buildWhatsAppHref(number: string, message?: string): string {\n const base = `https://wa.me/${number}`;\n if (!message) return base;\n return `${base}?text=${encodeURIComponent(message)}`;\n}\n\n/**\n * The website as a link address, or undefined when it is not a web\n * address. Practices often save `www.example.it`, which a link would\n * resolve against the current page, and the field is practice-written,\n * so a `javascript:` value must never become a link.\n */\nfunction websiteHref(website: string): string | undefined {\n const value = website.trim();\n const href = /^[a-z][a-z0-9+.-]*:/i.test(value) ? value : `https://${value}`;\n try {\n const { protocol } = new URL(href);\n return protocol === 'http:' || protocol === 'https:' ? href : undefined;\n } catch {\n return undefined;\n }\n}\n\n/** Google Maps search query — works without an API key. */\nfunction buildMapHref(address: ContactProfileCardAddress): string {\n const q = encodeURIComponent(address.line);\n return `https://www.google.com/maps/search/?api=1&query=${q}`;\n}\n\n/* -------------------------------------------------------------------- */\n/* MapThumbStrip — embedded Google Static Maps image */\n/* */\n/* Full-width strip rendered at the top of the card when the consumer */\n/* supplies both `address.lat`/`lng` and `googleMapsApiKey`. Same */\n/* one-shot `<img>` strategy as PracticeResults' StaticMapThumb (no JS */\n/* SDK boot → no consent gate needed), but full-card-width instead of */\n/* a 12rem aside. */\n/* -------------------------------------------------------------------- */\n\ninterface MapThumbStripProps {\n apiKey: string;\n center: { lat: number; lng: number };\n zoom: number;\n altText: string;\n}\n\n/**\n * Resolve the kit's `--map-marker-color` token to a six-character hex\n * string (no leading `#`) for Google Static Maps' `markers=color:` URL\n * parameter, which requires a literal hex value at fetch time.\n *\n * SSR-safe: when `document` is undefined we fall back to the kit's\n * brand violet. Same helper as PracticeResults — keep in sync if you\n * touch one.\n */\nfunction getStaticMapMarkerHex(): string {\n if (typeof document === 'undefined') return '4945a3';\n const raw = getComputedStyle(document.documentElement)\n .getPropertyValue('--map-marker-color')\n .trim();\n const match = /^#?([0-9a-fA-F]{6})$/.exec(raw);\n return match ? match[1] : '4945a3';\n}\n\nfunction MapThumbStrip({ apiKey, center, zoom, altText }: MapThumbStripProps) {\n // 640×192 keeps the asset under Google's 1MP free tier at scale=2\n // (1280×384 actual) and matches the strip's 12rem height at a\n // ~3.33:1 aspect ratio. Marker colour resolves from the kit's\n // `--map-marker-color` token at runtime so the value still lives\n // in `src/tokens/**` per the closed-palette constraint.\n const markerHex = getStaticMapMarkerHex();\n const src =\n `https://maps.googleapis.com/maps/api/staticmap` +\n `?center=${center.lat},${center.lng}` +\n `&zoom=${zoom}` +\n `&size=640x192&scale=2` +\n `&markers=color:0x${markerHex}%7C${center.lat},${center.lng}` +\n `&key=${encodeURIComponent(apiKey)}`;\n return (\n <img\n src={src}\n alt={altText}\n loading=\"lazy\"\n decoding=\"async\"\n width={640}\n height={192}\n className=\"ds:block ds:w-full ds:h-[12rem] ds:[object-fit:cover] ds:rounded-[var(--radius-md)]\"\n />\n );\n}\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const ContactProfileCard = forwardRef<\n HTMLDivElement,\n ContactProfileCardProps\n>(\n (\n {\n heading,\n description,\n address,\n phone,\n whatsappNumber,\n whatsappMessage,\n email,\n website,\n languages,\n languageLabels,\n insurances,\n firstVisitPriceCents,\n currencyCode = 'EUR',\n profession,\n specialties,\n specializedInFearPatients,\n googleMapsApiKey,\n mapZoom = 14,\n onPhoneClick,\n onWhatsAppClick,\n onMapClick,\n onEmailClick,\n headerSlot,\n footerSlot,\n mapSlot,\n factsAsDefinitionList = false,\n surface = 'elevated',\n 'aria-label': ariaLabel,\n id,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation('ui');\n const headingId = useId();\n const locale = i18n.language ?? 'en';\n\n const resolvedHeading = heading ?? t('contactProfileCard.heading');\n const resolvedAriaLabel = ariaLabel ?? resolvedHeading;\n\n const formattedPrice = useMemo(() => {\n if (firstVisitPriceCents == null) return undefined;\n // 0 is a free first visit: the chip reads \"Free\", not \"€0.00\".\n return formatPriceOrFree(\n firstVisitPriceCents,\n currencyCode,\n locale,\n t('common.freeOfCharge'),\n );\n }, [firstVisitPriceCents, currencyCode, locale, t]);\n\n // Compose the rows in display order. Each `row` carries the icon +\n // localised label + the rendered value. Skipping a field is just\n // omitting the row — `KeyValueList` collapses the subgrid cleanly.\n const rows: Array<{\n key: string;\n icon: ReactElement;\n label: string;\n value: ReactNode;\n }> = [];\n\n if (address) {\n rows.push({\n key: 'address',\n icon: <MapPin aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.address'),\n value: (\n <span className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]\">\n <span dir=\"auto\">{address.line}</span>\n {address.lat != null && address.lng != null ? (\n <Link\n href={buildMapHref(address)}\n external\n intent=\"default\"\n onClick={onMapClick}\n >\n {t('contactProfileCard.openInGoogleMaps')}\n </Link>\n ) : null}\n </span>\n ),\n });\n }\n\n if (phone) {\n rows.push({\n key: 'phone',\n icon: <Phone aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.phone'),\n value: (\n <Link\n href={`tel:${normalisePhone(phone)}`}\n intent=\"default\"\n onClick={onPhoneClick}\n >\n <bdi dir=\"ltr\">{phone}</bdi>\n </Link>\n ),\n });\n }\n\n if (whatsappNumber) {\n rows.push({\n key: 'whatsapp',\n icon: <MessageCircle aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.whatsapp'),\n value: (\n <Link\n href={buildWhatsAppHref(whatsappNumber, whatsappMessage)}\n external\n intent=\"default\"\n onClick={onWhatsAppClick}\n >\n <bdi dir=\"ltr\">{whatsappNumber}</bdi>\n </Link>\n ),\n });\n }\n\n if (email) {\n rows.push({\n key: 'email',\n icon: <Mail aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.email'),\n value: (\n <Link\n href={`mailto:${email}`}\n intent=\"default\"\n onClick={onEmailClick}\n >\n <bdi dir=\"ltr\">{email}</bdi>\n </Link>\n ),\n });\n }\n\n if (website) {\n const href = websiteHref(website);\n rows.push({\n key: 'website',\n icon: <Globe aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.website'),\n value: href ? (\n <Link href={href} external intent=\"default\">\n <bdi dir=\"ltr\">{website}</bdi>\n </Link>\n ) : (\n <bdi dir=\"ltr\">{website}</bdi>\n ),\n });\n }\n\n if (languages && languages.length > 0) {\n // Resolution order, highest to lowest:\n // 1. consumer `languageLabels` override — for regional dialects,\n // brand-voice variants, or codes the kit doesn't ship.\n // 2. kit i18n bundle (`languages.<iso>`) — auto-resolves the 18\n // ISO codes the kit ships into the active locale's native\n // language name. Retires consumer-side ISO→label plumbing.\n // 3. uppercase fallback for unknown codes that the consumer\n // didn't override.\n const resolveLabel = (code: string): string => {\n if (languageLabels?.[code]) return languageLabels[code];\n const key = `languages.${code}`;\n if (i18n.exists(key)) return t(key);\n return code.toUpperCase();\n };\n rows.push({\n key: 'languages',\n icon: <LanguagesIcon aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.languages'),\n value: (\n <span className=\"ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]\">\n {languages.map((code) => (\n <Badge key={code} variant=\"neutral\">\n {resolveLabel(code)}\n </Badge>\n ))}\n </span>\n ),\n });\n }\n\n if (insurances && insurances.length > 0) {\n rows.push({\n key: 'insurances',\n icon: <ShieldCheck aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.insurances'),\n value: (\n <span className=\"ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]\">\n {insurances.map((ins) => (\n <Badge key={ins} variant=\"info\">\n {ins}\n </Badge>\n ))}\n </span>\n ),\n });\n }\n\n if (formattedPrice) {\n // The one figure on this card a patient compares between\n // practices, so it gets a chip. The chip starts in the value\n // column with every other row's value (the subgrid aligns them),\n // not pinned to the row's end, where it read as out of line.\n // `accentSoft`, not `brand`. The languages and insurance rows on\n // this card are tonal chips (`neutral` and `info`), so a solid\n // `brand` fill would read as a different class of object rather\n // than the same family. `accentSoft` is the same tonal recipe in\n // the most distinct hue on the card, so the price still leads.\n // `lg` because `md` sets the label at the smallest step of the\n // ramp, and `.theme-accessible` cannot lift it — the one figure\n // patients compare should not be the smallest text on the card.\n rows.push({\n key: 'firstVisitPrice',\n icon: <Banknote aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.firstVisitPrice'),\n value: (\n <Badge variant=\"accentSoft\" size=\"lg\">\n {formattedPrice}\n </Badge>\n ),\n });\n }\n\n if (specializedInFearPatients) {\n rows.push({\n key: 'expertForAnxiousPatients',\n icon: <Heart aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.expertForAnxiousPatients'),\n value: t('contactProfileCard.value.yesShort'),\n });\n }\n\n const specialtyItems =\n specialties && specialties.length > 0 ? specialties : undefined;\n\n if (profession && !specialtyItems) {\n rows.push({\n key: 'profession',\n icon: <Stethoscope aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.profession'),\n value: profession,\n });\n }\n\n // Imperative handle for agent integrations.\n useAgentRegistration(\n contactProfileCardAgent,\n {\n getProfession: () => profession,\n getSpecialtyKeys: () => (specialtyItems ?? []).map((item) => item.key),\n },\n id,\n );\n\n // Embedded static-map thumbnail. Renders only when the consumer\n // supplies BOTH a usable lat/lng pair AND a `googleMapsApiKey`.\n // The d.ts-promised behaviour; without a key the strip is silently\n // omitted and the address row's \"Open in Google Maps\" link still\n // emits as the spatial-cue fallback.\n const showMapThumb =\n !!googleMapsApiKey &&\n address?.lat !== undefined &&\n address?.lng !== undefined;\n const mapThumb = showMapThumb ? (\n <MapThumbStrip\n apiKey={googleMapsApiKey!}\n center={{ lat: address!.lat!, lng: address!.lng! }}\n zoom={mapZoom}\n altText={t('contactProfileCard.map.alt', {\n address: address!.line,\n defaultValue: 'Map showing {{address}}',\n })}\n />\n ) : null;\n\n // Map area: explicit consumer slot wins over the implicit\n // googleMapsApiKey-driven static thumbnail. 0.33.4 introduces the\n // slot so consumers can embed an interactive <MapView> /\n // <PracticeMap> wrapper inside the card chrome instead of the\n // fixed static <img>. When neither is set the area renders as\n // nothing. 0.33.6 moves the area from above the heading to below\n // the data rows — the map reads as the spatial closer (\"here it\n // is on the map\") rather than a stylised hero, and any CTA in\n // footerSlot still lands at the very bottom.\n const mapArea = mapSlot ?? mapThumb;\n\n const body = (\n <>\n {description ? (\n <p dir=\"auto\" className=\"type-body-sm ds:m-0 ds:whitespace-pre-line\">\n {description}\n </p>\n ) : null}\n {rows.length > 0 ? (\n <KeyValueList rowGap=\"md\" semantic={factsAsDefinitionList}>\n {rows.map((row) => (\n <KeyValuePair\n key={row.key}\n icon={row.icon}\n label={row.label}\n value={row.value}\n />\n ))}\n </KeyValueList>\n ) : null}\n {specialtyItems\n ? (() => {\n // Outside the KeyValueList on purpose: its rows are promoted to a\n // three-column subgrid, which a stacked label-above-value row does\n // not fit. The icon gap is the list's column gap (`gap-x-md`), so\n // this label and its list line up with the labels above. In\n // definition-list mode it is still a dt/dd pair, in its own dl.\n const specialtyPair = (\n <KeyValuePair\n layout=\"vertical\"\n className=\"ds:!gap-[var(--spacing-md)]\"\n icon={<Stethoscope aria-hidden=\"true\" />}\n label={t('contactProfileCard.label.profession')}\n value={<SpecialtyList items={specialtyItems} />}\n />\n );\n return factsAsDefinitionList ? (\n <SemanticKeyValueGroup>{specialtyPair}</SemanticKeyValueGroup>\n ) : (\n specialtyPair\n );\n })()\n : null}\n {mapArea}\n {footerSlot}\n </>\n );\n\n // `surface=\"flat\"` skips the Card wrapper — the consumer is\n // already inside a Card / Sheet and doesn't want a double border.\n const inner = (\n <>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n {headerSlot}\n <h2\n id={headingId}\n className=\"type-title-card ds:m-0 ds:text-[color:var(--foreground)]\"\n >\n {resolvedHeading}\n </h2>\n </div>\n {body}\n </>\n );\n\n return (\n <div\n ref={ref}\n role=\"region\"\n aria-label={resolvedAriaLabel}\n aria-labelledby={headingId}\n data-component=\"contact-profile-card\"\n data-component-id={id}\n id={id}\n className={rootVariants({ surface, className })}\n {...rest}\n >\n {surface === 'elevated' ? (\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {inner}\n </Card.Body>\n </Card>\n ) : (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {inner}\n </div>\n )}\n </div>\n );\n },\n);\n\nContactProfileCard.displayName = 'ContactProfileCard';\n\n// Helper export so consumers can mirror the kit's row order if they\n// need to compose a partial alternative (rare).\nexport const CONTACT_PROFILE_CARD_ROW_KEYS = [\n 'address',\n 'phone',\n 'whatsapp',\n 'email',\n 'website',\n 'languages',\n 'insurances',\n 'firstVisitPrice',\n 'expertForAnxiousPatients',\n 'profession',\n] as const;\n\n// Defensive icon export so consumers can render the same glyph\n// outside the card if they need it for consistency.\nexport const CONTACT_PROFILE_CARD_ROW_ICONS: Record<\n (typeof CONTACT_PROFILE_CARD_ROW_KEYS)[number],\n LucideIcon\n> = {\n address: MapPin,\n phone: Phone,\n whatsapp: MessageCircle,\n email: Mail,\n website: Globe,\n languages: LanguagesIcon,\n insurances: ShieldCheck,\n firstVisitPrice: Banknote,\n expertForAnxiousPatients: Heart,\n profession: Stethoscope,\n};\n\n// Re-exports of the rootVariants type for downstream typing.\nexport type ContactProfileCardSurface = NonNullable<\n VariantProps<typeof rootVariants>['surface']\n>;\n\n// ExternalLink is exported by lucide-react and used elsewhere in the\n// kit; re-exporting here so consumers don't have to add it as a\n// peer-dep import for icon parity in their own UIs.\nexport { ExternalLink };\n"],"names":["__iconNode","Banknote","createLucideIcon","contactProfileCardAgent","handle","rootVariants","cva","normalisePhone","raw","buildWhatsAppHref","number","message","base","websiteHref","website","value","href","protocol","buildMapHref","address","getStaticMapMarkerHex","match","MapThumbStrip","apiKey","center","zoom","altText","markerHex","src","jsx","ContactProfileCard","forwardRef","heading","description","phone","whatsappNumber","whatsappMessage","email","languages","languageLabels","insurances","firstVisitPriceCents","currencyCode","profession","specialties","specializedInFearPatients","googleMapsApiKey","mapZoom","onPhoneClick","onWhatsAppClick","onMapClick","onEmailClick","headerSlot","footerSlot","mapSlot","factsAsDefinitionList","surface","ariaLabel","id","className","rest","ref","t","i18n","useTranslation","headingId","useId","locale","resolvedHeading","resolvedAriaLabel","formattedPrice","useMemo","formatPriceOrFree","rows","MapPin","jsxs","Link","Phone","MessageCircle","Mail","Globe","resolveLabel","code","key","LanguagesIcon","Badge","ShieldCheck","ins","Heart","specialtyItems","Stethoscope","useAgentRegistration","item","mapThumb","mapArea","body","Fragment","KeyValueList","row","KeyValuePair","specialtyPair","SpecialtyList","SemanticKeyValueGroup","inner","Card","CONTACT_PROFILE_C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AAAA,EACjB,0BAA0BuF;AAAA,EAC1B,YAAYE;AACd;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"contact-profile-card-uExd3pKC.js","sources":["../../node_modules/lucide-react/dist/esm/icons/banknote.mjs","../../src/components/contact-profile-card/contact-profile-card.agent.ts","../../src/components/contact-profile-card/contact-profile-card.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"rect\", { width: \"20\", height: \"12\", x: \"2\", y: \"6\", rx: \"2\", key: \"9lu3g6\" }],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"2\", key: \"1c9p78\" }],\n [\"path\", { d: \"M6 12h.01M18 12h.01\", key: \"113zkx\" }]\n];\nconst Banknote = createLucideIcon(\"banknote\", __iconNode);\n\nexport { __iconNode, Banknote as default };\n//# sourceMappingURL=banknote.mjs.map\n","import type { AgentAdapter } from '../../agent/types';\nimport type { ContactProfileCardHandle } from './contact-profile-card';\n\n/* -------------------------------------------------------------------- */\n/* Agent adapter — ContactProfileCard */\n/* */\n/* Read-only adapter. Surfaces the rendered profession field so an */\n/* agent / MCP runtime can resolve \"what kind of practice is this?\" */\n/* without re-parsing the DOM. No actions yet — the card is a passive */\n/* presentation surface; navigation lives on the consumer's page. */\n/* -------------------------------------------------------------------- */\n\nexport const contactProfileCardAgent: AgentAdapter<ContactProfileCardHandle> = {\n id: 'contact-profile-card',\n // Passive presentation surface — only exposes the rendered profession for\n // introspection. No interactive capability is backed by the handle.\n capabilities: [],\n state: {\n profession: {\n type: 'string',\n descriptionKey: 'ui.agent.contactProfileCard.state.profession',\n description:\n 'Profession string the card is currently rendering — undefined when the consumer omitted it.',\n read: (handle) => handle.getProfession(),\n },\n specialtyKeys: {\n type: 'string[]',\n descriptionKey: 'ui.agent.contactProfileCard.state.specialtyKeys',\n description:\n 'Profession keys of the specialities the card is rendering, in display order. Empty when the consumer passed none.',\n read: (handle) => handle.getSpecialtyKeys(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'contact-profile-card',\n description: 'Marks the ContactProfileCard root region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n forwardRef,\n useId,\n useMemo,\n type ComponentPropsWithoutRef,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport {\n Banknote,\n ExternalLink,\n Globe,\n Heart,\n Languages as LanguagesIcon,\n Mail,\n MapPin,\n MessageCircle,\n Phone,\n ShieldCheck,\n Stethoscope,\n type LucideIcon,\n} from 'lucide-react';\nimport { Badge } from '../badge/badge';\nimport { Card } from '../card/card';\nimport {\n KeyValueList,\n KeyValuePair,\n SemanticKeyValueGroup,\n} from '../key-value-pair/key-value-pair';\nimport { Link } from '../link/link';\nimport {\n SpecialtyList,\n type SpecialtyListItem,\n} from '../specialty-list/specialty-list';\nimport { formatPriceOrFree } from '../_shared/format-price';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { contactProfileCardAgent } from './contact-profile-card.agent';\n\n/* -------------------------------------------------------------------- */\n/* ContactProfileCard */\n/* */\n/* Replaces the bespoke \"Profilo\" / \"Practice info\" cards that every */\n/* AlfaDocs surface composes by hand (booking-website PracticeInfoCard, */\n/* alfascribe operator pages, builders docs example, …). Composes Card */\n/* + KeyValueList + KeyValuePair so the labels share a column (no */\n/* zigzag values) and every row uses the same lucide icon family. */\n/* */\n/* The component is intentionally opinionated: every field is optional, */\n/* but the ORDER, ICONS, and LABELS are owned by the kit. Consumers */\n/* pass the data; the kit owns the visual + i18n. */\n/* */\n/* All visible text flows through `useTranslation('ui')` against the */\n/* `contactProfileCard.*` namespace. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* CVA */\n/* -------------------------------------------------------------------- */\n\n// Override the KVP icon colour at the card root so every inner row's\n// leading glyph paints with `--accent` (brand magenta/violet) instead\n// of the default `--muted-foreground`. The ContactProfileCard is a\n// marketing surface — muted icons read as disabled against the\n// otherwise saturated card chrome. Scoped via CSS custom property so\n// only this card's icons shift; standalone KVPs elsewhere keep\n// `--muted-foreground`.\nconst rootVariants = cva(\n 'ds:w-full ds:text-[color:var(--foreground)] ds:[--key-value-pair-icon-color:var(--accent)]',\n {\n variants: {\n // Matches the kit's other `surface` props (Booking, ReviewsPanel).\n // The card itself renders `<Card variant=\"elevated\">` so the\n // `surface=\"flat\"` opt-out is rare — most consumers want the\n // boundary.\n surface: {\n flat: '',\n elevated: '',\n },\n },\n defaultVariants: { surface: 'elevated' },\n },\n);\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* -------------------------------------------------------------------- */\n\nexport interface ContactProfileCardAddress {\n /** Display text — already formatted by the consumer (street, postcode, city). */\n line: string;\n /** Optional lat/lng — drives the static-map link + the embedded thumbnail. */\n lat?: number;\n lng?: number;\n}\n\nexport interface ContactProfileCardHandle {\n /** Resolved consumer-supplied data — useful for agent introspection. */\n getProfession: () => string | undefined;\n /** Profession keys of the rendered specialities, empty when there are none. */\n getSpecialtyKeys: () => string[];\n}\n\nexport interface ContactProfileCardProps extends Omit<\n ComponentPropsWithoutRef<'div'>,\n 'aria-label' | 'children' | 'children'\n> {\n /**\n * Override the localised \"Profilo\" / \"Profile\" heading. Most\n * consumers leave this unset.\n */\n heading?: string;\n /**\n * Free-text intro paragraph rendered above the data rows (e.g.\n * the practice's `bookingDescription` field). When omitted, the\n * card jumps straight into the data rows.\n */\n description?: string;\n\n /* ----- Identity rows ----- */\n\n /** Street + postcode + city, with optional lat/lng for the map link. */\n address?: ContactProfileCardAddress;\n /** Phone number, displayed as-is. Compiled into a `tel:` link. */\n phone?: string;\n /**\n * WhatsApp number — digits only (no `+`, no spaces). Compiled into\n * a `https://wa.me/<number>` link with an optional pre-filled message.\n */\n whatsappNumber?: string;\n /** Optional pre-filled WhatsApp message. Consumer-localised. */\n whatsappMessage?: string;\n /** Public-facing email. Compiled into a `mailto:` link. */\n email?: string;\n /**\n * Practice website. An address without a scheme (`www.example.it`) is\n * linked over `https://`; anything but a web address shows as text.\n */\n website?: string;\n\n /* ----- Embedded map thumbnail ----- */\n\n /**\n * Google Maps Static API key. When provided alongside `address.lat`\n * and `address.lng`, renders a static-map thumbnail at the top of\n * the card — a single one-shot `<img>` fetch, no JS SDK boot, no\n * consent gate needed (the same pattern PracticeResults uses).\n *\n * Without it (or without coords), the card renders info rows only —\n * the address row's \"Open in Google Maps\" link is still emitted as\n * a real `<a>` so the spatial cue isn't lost.\n *\n * Additive — existing consumers that don't pass this prop see the\n * same render as before.\n */\n googleMapsApiKey?: string;\n /**\n * Zoom level for the embedded map thumbnail. Default `14` —\n * neighbourhood-level, shows the pin in context. Ignored when the\n * thumbnail isn't rendered.\n */\n mapZoom?: number;\n\n /* ----- Profile metadata ----- */\n\n /**\n * ISO 639-1 language codes the practice speaks. Rendered as\n * `<Badge variant=\"neutral\">` chips. Each code is auto-resolved\n * into the active locale's native language name via the kit's\n * built-in `languages.<iso>` i18n bundle (18 ISO codes × 18\n * locales). For example `languages={['it', 'en']}` with\n * `i18n.language === 'it'` renders \"Italiano\" + \"Inglese\".\n *\n * Unknown / unbundled codes fall back to the uppercase ISO code\n * (`'xyz'` → `'XYZ'`). To override a specific label — regional\n * dialect, brand-voice variant, codes the kit doesn't ship — pass\n * `languageLabels`.\n */\n languages?: string[];\n /**\n * Override map from ISO code → display label, applied on top of\n * the kit's i18n auto-resolution. Only set when you need a\n * consumer-specific label for a code — the typical case is\n * regional dialect / brand-voice variants / non-ISO codes.\n *\n * Resolution order: `languageLabels[code]` > `t('languages.<code>')`\n * > `code.toUpperCase()`.\n */\n languageLabels?: Record<string, string>;\n /**\n * Insurance / convention strings (consumer-supplied, free text).\n * Rendered as `<Badge variant=\"info\">` chips.\n */\n insurances?: string[];\n /**\n * First-visit price in the smallest currency unit (cents / centesimi).\n * Formatted via `Intl.NumberFormat`; `0` renders the translated word\n * \"Free\". Omit when the consumer doesn't want to show the price.\n */\n firstVisitPriceCents?: number;\n /** ISO-4217 currency code for the price formatter. Defaults to `EUR`. */\n currencyCode?: string;\n /** Profession line — single value or already-joined comma list. */\n profession?: string;\n /**\n * The practice's specialities, each with its medical glyph. When present\n * and not empty they replace the `profession` row with a vertical row\n * (\"Profession\" above, a `SpecialtyList` below): a long list needs the full\n * card width, not the value column. When absent or empty the `profession`\n * string row renders as before.\n */\n specialties?: SpecialtyListItem[];\n /** Show the \"expert for anxious patients\" row when true. */\n specializedInFearPatients?: boolean;\n\n /* ----- Telemetry hooks ----- */\n\n /**\n * Fires when the patient clicks the phone link. The kit emits a\n * `track('practice_profile_card_phone_click')` event before\n * invoking this — gate consumer-side analytics on the same event\n * to avoid duplicate fires.\n */\n onPhoneClick?: () => void;\n /** Fires when the patient clicks the WhatsApp link. */\n onWhatsAppClick?: () => void;\n /** Fires when the patient clicks the static-map link. */\n onMapClick?: () => void;\n /** Fires when the patient clicks the email mailto link. */\n onEmailClick?: () => void;\n\n /* ----- Slots ----- */\n\n /**\n * Rendered above the heading — e.g. a `<Avatar>` for the operator\n * variant, or a coloured chip strip. Optional.\n */\n headerSlot?: ReactNode;\n /**\n * Render an arbitrary map widget at the top of the card chrome —\n * replaces the built-in static `<img>` thumbnail that\n * `googleMapsApiKey` would otherwise produce. Use this when you\n * want an interactive map inside the card boundary instead of a\n * fixed image:\n *\n * <ContactProfileCard\n * mapSlot={\n * <PracticeMap practice={practice} googleMapsApiKey={key} />\n * }\n * …\n * />\n *\n * When both `mapSlot` and `googleMapsApiKey` are provided, the slot\n * wins (explicit > implicit). When neither is provided, no map area\n * renders. The slot is unstyled — pass through any container chrome\n * the consumer wants (e.g. a fixed height wrapper). The kit\n * positions it where the static thumbnail would have lived.\n */\n mapSlot?: ReactNode;\n /**\n * @default false\n * Render the facts (address, phone, languages and the other rows) as a\n * real definition list: a `<dl>` with one `<dt>` label and one `<dd>`\n * value per row, so crawlers and screen readers pair every label with its\n * value. Same look as the default; only the elements change. Turn it on\n * for public pages that search engines index, such as the practice page.\n */\n factsAsDefinitionList?: boolean;\n /**\n * Rendered at the end of the card body, below the rows. Use for\n * a \"Book now\" `<Button>` or a \"View full profile\" link.\n */\n footerSlot?: ReactNode;\n\n /* ----- Styling ----- */\n\n /**\n * `'elevated'` (default) wraps the card in `<Card variant=\"elevated\">`\n * for a defined surface — what most consumers want when the card\n * stands alone on a page. `'flat'` drops the Card chrome so the\n * content sits naked — use when an outer card / sheet already\n * provides the boundary (e.g. embedded inside a `<Sheet>` or a\n * parent `<Card.Body>`).\n */\n surface?: 'flat' | 'elevated';\n\n /* ----- a11y ----- */\n\n /** Override the default region aria-label. */\n 'aria-label'?: string;\n /** Agent-readiness consumer id, surfaced as `data-component-id`. */\n id?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\n/** Strip everything except digits + leading `+` for `tel:` URLs. */\nfunction normalisePhone(raw: string): string {\n return raw.replace(/[^\\d+]/g, '');\n}\n\n/** Build the WhatsApp `wa.me` URL. Number must already be digits-only. */\nfunction buildWhatsAppHref(number: string, message?: string): string {\n const base = `https://wa.me/${number}`;\n if (!message) return base;\n return `${base}?text=${encodeURIComponent(message)}`;\n}\n\n/**\n * The website as a link address, or undefined when it is not a web\n * address. Practices often save `www.example.it`, which a link would\n * resolve against the current page, and the field is practice-written,\n * so a `javascript:` value must never become a link.\n */\nfunction websiteHref(website: string): string | undefined {\n const value = website.trim();\n const href = /^[a-z][a-z0-9+.-]*:/i.test(value) ? value : `https://${value}`;\n try {\n const { protocol } = new URL(href);\n return protocol === 'http:' || protocol === 'https:' ? href : undefined;\n } catch {\n return undefined;\n }\n}\n\n/** Google Maps search query — works without an API key. */\nfunction buildMapHref(address: ContactProfileCardAddress): string {\n const q = encodeURIComponent(address.line);\n return `https://www.google.com/maps/search/?api=1&query=${q}`;\n}\n\n/* -------------------------------------------------------------------- */\n/* MapThumbStrip — embedded Google Static Maps image */\n/* */\n/* Full-width strip rendered at the top of the card when the consumer */\n/* supplies both `address.lat`/`lng` and `googleMapsApiKey`. Same */\n/* one-shot `<img>` strategy as PracticeResults' StaticMapThumb (no JS */\n/* SDK boot → no consent gate needed), but full-card-width instead of */\n/* a 12rem aside. */\n/* -------------------------------------------------------------------- */\n\ninterface MapThumbStripProps {\n apiKey: string;\n center: { lat: number; lng: number };\n zoom: number;\n altText: string;\n}\n\n/**\n * Resolve the kit's `--map-marker-color` token to a six-character hex\n * string (no leading `#`) for Google Static Maps' `markers=color:` URL\n * parameter, which requires a literal hex value at fetch time.\n *\n * SSR-safe: when `document` is undefined we fall back to the kit's\n * brand violet. Same helper as PracticeResults — keep in sync if you\n * touch one.\n */\nfunction getStaticMapMarkerHex(): string {\n if (typeof document === 'undefined') return '4945a3';\n const raw = getComputedStyle(document.documentElement)\n .getPropertyValue('--map-marker-color')\n .trim();\n const match = /^#?([0-9a-fA-F]{6})$/.exec(raw);\n return match ? match[1] : '4945a3';\n}\n\nfunction MapThumbStrip({ apiKey, center, zoom, altText }: MapThumbStripProps) {\n // 640×192 keeps the asset under Google's 1MP free tier at scale=2\n // (1280×384 actual) and matches the strip's 12rem height at a\n // ~3.33:1 aspect ratio. Marker colour resolves from the kit's\n // `--map-marker-color` token at runtime so the value still lives\n // in `src/tokens/**` per the closed-palette constraint.\n const markerHex = getStaticMapMarkerHex();\n const src =\n `https://maps.googleapis.com/maps/api/staticmap` +\n `?center=${center.lat},${center.lng}` +\n `&zoom=${zoom}` +\n `&size=640x192&scale=2` +\n `&markers=color:0x${markerHex}%7C${center.lat},${center.lng}` +\n `&key=${encodeURIComponent(apiKey)}`;\n return (\n <img\n src={src}\n alt={altText}\n loading=\"lazy\"\n decoding=\"async\"\n width={640}\n height={192}\n className=\"ds:block ds:w-full ds:h-[12rem] ds:[object-fit:cover] ds:rounded-[var(--radius-md)]\"\n />\n );\n}\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const ContactProfileCard = forwardRef<\n HTMLDivElement,\n ContactProfileCardProps\n>(\n (\n {\n heading,\n description,\n address,\n phone,\n whatsappNumber,\n whatsappMessage,\n email,\n website,\n languages,\n languageLabels,\n insurances,\n firstVisitPriceCents,\n currencyCode = 'EUR',\n profession,\n specialties,\n specializedInFearPatients,\n googleMapsApiKey,\n mapZoom = 14,\n onPhoneClick,\n onWhatsAppClick,\n onMapClick,\n onEmailClick,\n headerSlot,\n footerSlot,\n mapSlot,\n factsAsDefinitionList = false,\n surface = 'elevated',\n 'aria-label': ariaLabel,\n id,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation('ui');\n const headingId = useId();\n const locale = i18n.language ?? 'en';\n\n const resolvedHeading = heading ?? t('contactProfileCard.heading');\n const resolvedAriaLabel = ariaLabel ?? resolvedHeading;\n\n const formattedPrice = useMemo(() => {\n if (firstVisitPriceCents == null) return undefined;\n // 0 is a free first visit: the chip reads \"Free\", not \"€0.00\".\n return formatPriceOrFree(\n firstVisitPriceCents,\n currencyCode,\n locale,\n t('common.freeOfCharge'),\n );\n }, [firstVisitPriceCents, currencyCode, locale, t]);\n\n // Compose the rows in display order. Each `row` carries the icon +\n // localised label + the rendered value. Skipping a field is just\n // omitting the row — `KeyValueList` collapses the subgrid cleanly.\n const rows: Array<{\n key: string;\n icon: ReactElement;\n label: string;\n value: ReactNode;\n }> = [];\n\n if (address) {\n rows.push({\n key: 'address',\n icon: <MapPin aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.address'),\n value: (\n <span className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]\">\n <span dir=\"auto\">{address.line}</span>\n {address.lat != null && address.lng != null ? (\n <Link\n href={buildMapHref(address)}\n external\n intent=\"default\"\n onClick={onMapClick}\n >\n {t('contactProfileCard.openInGoogleMaps')}\n </Link>\n ) : null}\n </span>\n ),\n });\n }\n\n if (phone) {\n rows.push({\n key: 'phone',\n icon: <Phone aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.phone'),\n value: (\n <Link\n href={`tel:${normalisePhone(phone)}`}\n intent=\"default\"\n onClick={onPhoneClick}\n >\n <bdi dir=\"ltr\">{phone}</bdi>\n </Link>\n ),\n });\n }\n\n if (whatsappNumber) {\n rows.push({\n key: 'whatsapp',\n icon: <MessageCircle aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.whatsapp'),\n value: (\n <Link\n href={buildWhatsAppHref(whatsappNumber, whatsappMessage)}\n external\n intent=\"default\"\n onClick={onWhatsAppClick}\n >\n <bdi dir=\"ltr\">{whatsappNumber}</bdi>\n </Link>\n ),\n });\n }\n\n if (email) {\n rows.push({\n key: 'email',\n icon: <Mail aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.email'),\n value: (\n <Link\n href={`mailto:${email}`}\n intent=\"default\"\n onClick={onEmailClick}\n >\n <bdi dir=\"ltr\">{email}</bdi>\n </Link>\n ),\n });\n }\n\n if (website) {\n const href = websiteHref(website);\n rows.push({\n key: 'website',\n icon: <Globe aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.website'),\n value: href ? (\n <Link href={href} external intent=\"default\">\n <bdi dir=\"ltr\">{website}</bdi>\n </Link>\n ) : (\n <bdi dir=\"ltr\">{website}</bdi>\n ),\n });\n }\n\n if (languages && languages.length > 0) {\n // Resolution order, highest to lowest:\n // 1. consumer `languageLabels` override — for regional dialects,\n // brand-voice variants, or codes the kit doesn't ship.\n // 2. kit i18n bundle (`languages.<iso>`) — auto-resolves the 18\n // ISO codes the kit ships into the active locale's native\n // language name. Retires consumer-side ISO→label plumbing.\n // 3. uppercase fallback for unknown codes that the consumer\n // didn't override.\n const resolveLabel = (code: string): string => {\n if (languageLabels?.[code]) return languageLabels[code];\n const key = `languages.${code}`;\n if (i18n.exists(key)) return t(key);\n return code.toUpperCase();\n };\n rows.push({\n key: 'languages',\n icon: <LanguagesIcon aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.languages'),\n value: (\n <span className=\"ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]\">\n {languages.map((code) => (\n <Badge key={code} variant=\"neutral\">\n {resolveLabel(code)}\n </Badge>\n ))}\n </span>\n ),\n });\n }\n\n if (insurances && insurances.length > 0) {\n rows.push({\n key: 'insurances',\n icon: <ShieldCheck aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.insurances'),\n value: (\n <span className=\"ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]\">\n {insurances.map((ins) => (\n <Badge key={ins} variant=\"info\">\n {ins}\n </Badge>\n ))}\n </span>\n ),\n });\n }\n\n if (formattedPrice) {\n // The one figure on this card a patient compares between\n // practices, so it gets a chip. The chip starts in the value\n // column with every other row's value (the subgrid aligns them),\n // not pinned to the row's end, where it read as out of line.\n // `accentSoft`, not `brand`. The languages and insurance rows on\n // this card are tonal chips (`neutral` and `info`), so a solid\n // `brand` fill would read as a different class of object rather\n // than the same family. `accentSoft` is the same tonal recipe in\n // the most distinct hue on the card, so the price still leads.\n // `lg` because `md` sets the label at the smallest step of the\n // ramp, and `.theme-accessible` cannot lift it — the one figure\n // patients compare should not be the smallest text on the card.\n rows.push({\n key: 'firstVisitPrice',\n icon: <Banknote aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.firstVisitPrice'),\n value: (\n <Badge variant=\"accentSoft\" size=\"lg\">\n {formattedPrice}\n </Badge>\n ),\n });\n }\n\n if (specializedInFearPatients) {\n rows.push({\n key: 'expertForAnxiousPatients',\n icon: <Heart aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.expertForAnxiousPatients'),\n value: t('contactProfileCard.value.yesShort'),\n });\n }\n\n const specialtyItems =\n specialties && specialties.length > 0 ? specialties : undefined;\n\n if (profession && !specialtyItems) {\n rows.push({\n key: 'profession',\n icon: <Stethoscope aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.profession'),\n value: profession,\n });\n }\n\n // Imperative handle for agent integrations.\n useAgentRegistration(\n contactProfileCardAgent,\n {\n getProfession: () => profession,\n getSpecialtyKeys: () => (specialtyItems ?? []).map((item) => item.key),\n },\n id,\n );\n\n // Embedded static-map thumbnail. Renders only when the consumer\n // supplies BOTH a usable lat/lng pair AND a `googleMapsApiKey`.\n // The d.ts-promised behaviour; without a key the strip is silently\n // omitted and the address row's \"Open in Google Maps\" link still\n // emits as the spatial-cue fallback.\n const showMapThumb =\n !!googleMapsApiKey &&\n address?.lat !== undefined &&\n address?.lng !== undefined;\n const mapThumb = showMapThumb ? (\n <MapThumbStrip\n apiKey={googleMapsApiKey!}\n center={{ lat: address!.lat!, lng: address!.lng! }}\n zoom={mapZoom}\n altText={t('contactProfileCard.map.alt', {\n address: address!.line,\n defaultValue: 'Map showing {{address}}',\n })}\n />\n ) : null;\n\n // Map area: explicit consumer slot wins over the implicit\n // googleMapsApiKey-driven static thumbnail. 0.33.4 introduces the\n // slot so consumers can embed an interactive <MapView> /\n // <PracticeMap> wrapper inside the card chrome instead of the\n // fixed static <img>. When neither is set the area renders as\n // nothing. 0.33.6 moves the area from above the heading to below\n // the data rows — the map reads as the spatial closer (\"here it\n // is on the map\") rather than a stylised hero, and any CTA in\n // footerSlot still lands at the very bottom.\n const mapArea = mapSlot ?? mapThumb;\n\n const body = (\n <>\n {description ? (\n <p dir=\"auto\" className=\"type-body-sm ds:m-0 ds:whitespace-pre-line\">\n {description}\n </p>\n ) : null}\n {rows.length > 0 ? (\n <KeyValueList rowGap=\"md\" semantic={factsAsDefinitionList}>\n {rows.map((row) => (\n <KeyValuePair\n key={row.key}\n icon={row.icon}\n label={row.label}\n value={row.value}\n />\n ))}\n </KeyValueList>\n ) : null}\n {specialtyItems\n ? (() => {\n // Outside the KeyValueList on purpose: its rows are promoted to a\n // three-column subgrid, which a stacked label-above-value row does\n // not fit. The icon gap is the list's column gap (`gap-x-md`), so\n // this label and its list line up with the labels above. In\n // definition-list mode it is still a dt/dd pair, in its own dl.\n const specialtyPair = (\n <KeyValuePair\n layout=\"vertical\"\n className=\"ds:!gap-x-[var(--spacing-md)]\"\n icon={<Stethoscope aria-hidden=\"true\" />}\n label={t('contactProfileCard.label.profession')}\n value={<SpecialtyList items={specialtyItems} />}\n />\n );\n return factsAsDefinitionList ? (\n <SemanticKeyValueGroup>{specialtyPair}</SemanticKeyValueGroup>\n ) : (\n specialtyPair\n );\n })()\n : null}\n {mapArea}\n {footerSlot}\n </>\n );\n\n // `surface=\"flat\"` skips the Card wrapper — the consumer is\n // already inside a Card / Sheet and doesn't want a double border.\n const inner = (\n <>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n {headerSlot}\n <h2\n id={headingId}\n className=\"type-title-card ds:m-0 ds:text-[color:var(--foreground)]\"\n >\n {resolvedHeading}\n </h2>\n </div>\n {body}\n </>\n );\n\n return (\n <div\n ref={ref}\n role=\"region\"\n aria-label={resolvedAriaLabel}\n aria-labelledby={headingId}\n data-component=\"contact-profile-card\"\n data-component-id={id}\n id={id}\n className={rootVariants({ surface, className })}\n {...rest}\n >\n {surface === 'elevated' ? (\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {inner}\n </Card.Body>\n </Card>\n ) : (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {inner}\n </div>\n )}\n </div>\n );\n },\n);\n\nContactProfileCard.displayName = 'ContactProfileCard';\n\n// Helper export so consumers can mirror the kit's row order if they\n// need to compose a partial alternative (rare).\nexport const CONTACT_PROFILE_CARD_ROW_KEYS = [\n 'address',\n 'phone',\n 'whatsapp',\n 'email',\n 'website',\n 'languages',\n 'insurances',\n 'firstVisitPrice',\n 'expertForAnxiousPatients',\n 'profession',\n] as const;\n\n// Defensive icon export so consumers can render the same glyph\n// outside the card if they need it for consistency.\nexport const CONTACT_PROFILE_CARD_ROW_ICONS: Record<\n (typeof CONTACT_PROFILE_CARD_ROW_KEYS)[number],\n LucideIcon\n> = {\n address: MapPin,\n phone: Phone,\n whatsapp: MessageCircle,\n email: Mail,\n website: Globe,\n languages: LanguagesIcon,\n insurances: ShieldCheck,\n firstVisitPrice: Banknote,\n expertForAnxiousPatients: Heart,\n profession: Stethoscope,\n};\n\n// Re-exports of the rootVariants type for downstream typing.\nexport type ContactProfileCardSurface = NonNullable<\n VariantProps<typeof rootVariants>['surface']\n>;\n\n// ExternalLink is exported by lucide-react and used elsewhere in the\n// kit; re-exporting here so consumers don't have to add it as a\n// peer-dep import for icon parity in their own UIs.\nexport { ExternalLink };\n"],"names":["__iconNode","Banknote","createLucideIcon","contactProfileCardAgent","handle","rootVariants","cva","normalisePhone","raw","buildWhatsAppHref","number","message","base","websiteHref","website","value","href","protocol","buildMapHref","address","getStaticMapMarkerHex","match","MapThumbStrip","apiKey","center","zoom","altText","markerHex","src","jsx","ContactProfileCard","forwardRef","heading","description","phone","whatsappNumber","whatsappMessage","email","languages","languageLabels","insurances","firstVisitPriceCents","currencyCode","profession","specialties","specializedInFearPatients","googleMapsApiKey","mapZoom","onPhoneClick","onWhatsAppClick","onMapClick","onEmailClick","headerSlot","footerSlot","mapSlot","factsAsDefinitionList","surface","ariaLabel","id","className","rest","ref","t","i18n","useTranslation","headingId","useId","locale","resolvedHeading","resolvedAriaLabel","formattedPrice","useMemo","formatPriceOrFree","rows","MapPin","jsxs","Link","Phone","MessageCircle","Mail","Globe","resolveLabel","code","key","LanguagesIcon","Badge","ShieldCheck","ins","Heart","specialtyItems","Stethoscope","useAgentRegistration","item","mapThumb","mapArea","body","Fragment","KeyValueList","row","KeyValuePair","specialtyPair","SpecialtyList","SemanticKeyValueGroup","inner","Card","CONTACT_PROFILE_CARD_ROW_KEYS","CONTACT_PROFILE_CARD_ROW_ICONS"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,OAAO,MAAM,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