@alfadocs/ui-kit-debug 1.26.0 → 1.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"signature-status-chip-n57D-hhv.js","sources":["../../src/components/signature-status-chip/signature-status-chip.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Badge, type BadgeProps } from '../badge';\nimport { Tooltip } from '../tooltip';\n\n/* ------------------------------------------------------------------ */\n/* State vocabulary */\n/* ------------------------------------------------------------------ */\n\n/** One party's standing on the document. */\nexport type SignatureParty = 'signed' | 'pending' | 'notRequired';\n\n/** The chip's derived state. */\nexport type SignatureStatus = 'signed' | 'partial' | 'unsigned' | 'notRequired';\n\n/**\n * The parties a document can require. `secondary` is the second signee on a\n * two-signee envelope (platform: `secondary_signee_id`) — a guardian, parent\n * or co-signer. It is optional: a document that does not need one leaves it\n * `notRequired`, which is the default.\n */\nexport type SignatureRole = 'operator' | 'patient' | 'secondary';\n\ntype RequiredStanding = Exclude<SignatureParty, 'notRequired'>;\n\n/**\n * Who a party is, and — when they cannot sign for themselves — who signs in\n * their place. A minor, or an adult who lacks capacity, is still the party\n * the document is about; the parent, guardian or legal representative signs\n * on their behalf. The standing (`signed` / `pending`) stays on the party,\n * because it is their signature slot that is being filled.\n */\nexport interface SignerRepresentative {\n /** The representative's display name. */\n name: string;\n /**\n * Already-translated relationship to the party, e.g. \"Mother\",\n * \"Legal guardian\". Same contract as `SignerRoster.relationship` — the\n * host translates it, because the set is open.\n */\n relationship?: string;\n /**\n * This representative's own standing. Supply it when representatives can\n * be at different stages — both parents must consent and only one has\n * signed. Omit it and the representative inherits the party's standing,\n * which is the right default when a single person signs.\n */\n standing?: Exclude<SignatureParty, 'notRequired'>;\n}\n\nexport interface SignerIdentity {\n /** The party's own display name. */\n name: string;\n /**\n * Who signs in this party's place, when the party cannot sign for\n * themselves. One representative for the ordinary guardian case; several\n * where every one of them must sign — both parents consenting for a minor,\n * where the minor never signs at all.\n *\n * When representatives carry their own `standing`, they become the source\n * of truth for this party: the slot is `signed` only once every one of\n * them has signed. Pass the same values to {@link signatureStatusOf} so\n * host-side filtering agrees with the chip.\n */\n signedBy?: SignerRepresentative | SignerRepresentative[];\n}\n\n/** Normalise the one-or-many representative shape to a list. */\nfunction representativesOf(\n identity: string | SignerIdentity | undefined,\n): SignerRepresentative[] {\n if (!identity || typeof identity === 'string') return [];\n const by = identity.signedBy;\n if (!by) return [];\n return Array.isArray(by) ? by : [by];\n}\n\n/**\n * A party's effective standing. Representatives that carry their own\n * `standing` override the party value, because they are the signatures that\n * actually have to land: every one of them must sign before the slot is\n * complete.\n */\nexport function effectiveStanding(\n party: SignatureParty,\n identity?: string | SignerIdentity,\n): SignatureParty {\n if (party === 'notRequired') return 'notRequired';\n const reps = representativesOf(identity).filter((r) => r.standing);\n if (reps.length === 0) return party;\n return reps.every((r) => r.standing === 'signed') ? 'signed' : 'pending';\n}\n\n/**\n * Display names for the signers, when the host has them and chooses to show\n * them. A bare string is the common case; pass a {@link SignerIdentity} where\n * someone signs on the party's behalf.\n */\nexport type SignatureSignerNames = Partial<\n Record<SignatureRole, string | SignerIdentity>\n>;\n\n/**\n * The rule, exported so hosts can sort/filter by the same state the chip\n * shows: required = parties not `notRequired`; all signed → `signed`, some\n * signed → `partial`, none signed → `unsigned`, nobody required → `notRequired`.\n *\n * `secondary` is optional and defaults to `notRequired`, so existing\n * two-argument calls keep their exact meaning.\n */\nexport function signatureStatusOf(\n operator: SignatureParty,\n patient: SignatureParty,\n secondary: SignatureParty = 'notRequired',\n names?: SignatureSignerNames,\n): SignatureStatus {\n const required = [\n effectiveStanding(operator, names?.operator),\n effectiveStanding(patient, names?.patient),\n effectiveStanding(secondary, names?.secondary),\n ].filter((p) => p !== 'notRequired');\n if (required.length === 0) return 'notRequired';\n const signed = required.filter((p) => p === 'signed').length;\n if (signed === 0) return 'unsigned';\n return signed === required.length ? 'signed' : 'partial';\n}\n\n// `partial` shares the warning tone with `unsigned` so a half-signed document\n// never reads as done at a glance — only a fully signed one goes green.\nconst STATUS_VARIANT: Record<\n SignatureStatus,\n NonNullable<BadgeProps['variant']>\n> = {\n // Traffic light: green when everyone required has signed, amber when at\n // least one party is still missing, red when nobody has.\n signed: 'success',\n partial: 'warning',\n unsigned: 'error',\n notRequired: 'neutral',\n};\n\nconst ROLE_DEFAULT: Record<SignatureRole, string> = {\n operator: 'Operator',\n patient: 'Patient',\n secondary: 'Second signee',\n};\n\nconst STANDING_DEFAULT: Record<RequiredStanding, string> = {\n signed: 'signed',\n pending: 'pending',\n};\n\n// Flat keys, matching the shipped bundles. i18next splits on '.', so a\n// nested `missing.operator` alongside the existing flat keys would risk a\n// lookup collision — and renaming them would break any host override.\nconst MISSING_KEY: Record<SignatureRole, string> = {\n operator: 'signatureStatusChip.missingOperator',\n patient: 'signatureStatusChip.missingPatient',\n secondary: 'signatureStatusChip.missingSecondary',\n};\n\nconst MISSING_DEFAULT: Record<SignatureRole, string> = {\n operator: 'Operator signature missing',\n patient: 'Patient signature missing',\n secondary: 'Second signee signature missing',\n};\n\n/**\n * Wrap host-supplied names in a Unicode first-strong isolate. Names arrive in\n * an unknown script and are interpolated into a translated frame — a Latin\n * name inside an Arabic sentence reorders the surrounding punctuation without\n * this. FSI … PDI is invisible, and assistive tech treats it as formatting.\n */\nfunction isolate(value: string): string {\n return `\\u2068${value}\\u2069`;\n}\n\nfunction requiredParties(\n operator: SignatureParty,\n patient: SignatureParty,\n secondary: SignatureParty,\n): Array<{ role: SignatureRole; standing: RequiredStanding }> {\n const out: Array<{ role: SignatureRole; standing: RequiredStanding }> = [];\n if (operator !== 'notRequired')\n out.push({ role: 'operator', standing: operator });\n if (patient !== 'notRequired')\n out.push({ role: 'patient', standing: patient });\n if (secondary !== 'notRequired')\n out.push({ role: 'secondary', standing: secondary });\n return out;\n}\n\n/* ------------------------------------------------------------------ */\n/* Props */\n/* ------------------------------------------------------------------ */\n\nexport interface SignatureStatusChipProps extends Omit<\n HTMLAttributes<HTMLSpanElement>,\n 'children'\n> {\n /** The operator's standing. */\n operator: SignatureParty;\n /** The patient's standing. */\n patient: SignatureParty;\n /**\n * The second signee's standing on a two-signee envelope — a guardian,\n * parent or co-signer. Defaults to `notRequired`, so a document with only\n * an operator and a patient behaves exactly as before.\n */\n secondary?: SignatureParty;\n /**\n * Display names for the signers, keyed by role. Supply them and the\n * breakdown reads \"Operator: Dr Rossi (signed)\" instead of \"Operator\n * signed\"; omit them and only the roles are named.\n *\n * A role may be a bare name, or a {@link SignerIdentity} when someone\n * signs on that party's behalf — a parent for a minor, a guardian for an\n * adult who lacks capacity. Then the row reads \"Patient: M. Bianchi,\n * signed by A. Bianchi (Parent)\".\n *\n * A name is shown in the chip's accessible name and its hover title, so\n * pass one only where the viewer is already entitled to see that person —\n * these are real people, and on the patient row usually a patient. Roles\n * with no name fall back to the role alone, so a partial map is fine.\n */\n names?: SignatureSignerNames;\n /** Chip height — maps onto the Badge `sm` / `md` sizes. */\n size?: 'sm' | 'md';\n /**\n * Spell the breakdown in the chip text (\"Signed · Operator signed · Patient\n * signed\") instead of the summary word. Default false — the breakdown is\n * always in the accessible name / title.\n */\n detail?: boolean;\n /**\n * Make the breakdown reachable by keyboard and touch, not only on hover.\n *\n * The chip becomes focusable and the breakdown moves out of the accessible\n * name into the kit's `Tooltip`, which exposes it as the accessible\n * description. Screen readers then hear the summary once and the detail\n * once, instead of the whole string twice.\n *\n * Off by default for two reasons. It adds a tab stop, and a table of forty\n * chips should not add forty; and it **requires a `TooltipProvider` above\n * it** — without one the kit's Tooltip throws. Turn it on where the\n * breakdown is something the user has to act on.\n */\n tooltip?: boolean;\n /** Agent-readiness consumer id, surfaced as `data-component-id`. */\n id?: string;\n}\n\n/* ------------------------------------------------------------------ */\n/* Component */\n/* ------------------------------------------------------------------ */\n\nexport const SignatureStatusChip = forwardRef<\n HTMLSpanElement,\n SignatureStatusChipProps\n>(\n (\n {\n operator,\n patient,\n secondary = 'notRequired',\n names,\n size = 'md',\n detail = false,\n tooltip = false,\n id,\n className,\n 'aria-label': ariaLabelProp,\n title: titleProp,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const status = signatureStatusOf(operator, patient, secondary, names);\n // Each party's standing is the effective one, so a slot held open by an\n // unsigned representative reads as pending here too.\n const parties = requiredParties(\n effectiveStanding(operator, names?.operator),\n effectiveStanding(patient, names?.patient),\n effectiveStanding(secondary, names?.secondary),\n );\n\n // When exactly one required party is outstanding the summary names it,\n // which is more use than a vague \"partially signed\". Two or more can be\n // outstanding once a second signee is in play, and then only the count\n // is worth the chip's width — the breakdown spells out the rest.\n const summary = (() => {\n switch (status) {\n case 'signed':\n return t('signatureStatusChip.signed', { defaultValue: 'Signed' });\n case 'unsigned':\n return t('signatureStatusChip.unsigned', {\n defaultValue: 'Not signed',\n });\n case 'notRequired':\n return t('signatureStatusChip.notRequired', {\n defaultValue: 'No signature required',\n });\n case 'partial': {\n const pending = parties.filter((p) => p.standing === 'pending');\n if (pending.length === 1) {\n const role = pending[0].role;\n return t(MISSING_KEY[role], {\n defaultValue: MISSING_DEFAULT[role],\n });\n }\n return t('signatureStatusChip.missingCount', {\n defaultValue: '{{count}} signatures missing',\n count: pending.length,\n });\n }\n }\n })();\n\n const breakdown = parties\n .map(({ role, standing }) => {\n const roleLabel = t(`signatureStatusChip.party.${role}`, {\n defaultValue: ROLE_DEFAULT[role],\n });\n const state = t(`signatureStatusChip.state.${standing}`, {\n defaultValue: STANDING_DEFAULT[standing],\n });\n const identity = names?.[role];\n if (!identity) {\n return t('signatureStatusChip.breakdownItem', {\n defaultValue: '{{party}} {{state}}',\n party: roleLabel,\n state,\n });\n }\n\n const who =\n typeof identity === 'string' ? { name: identity } : identity;\n\n // Someone signs in the party's place — name the party AND whoever\n // fills their slot, so the reader can see both. Several can be\n // required at once: both parents consenting for a minor.\n const reps = representativesOf(who);\n if (reps.length > 0) {\n const render = (r: SignerRepresentative) =>\n r.relationship\n ? t('signatureStatusChip.representative', {\n defaultValue: '{{name}} ({{relationship}})',\n name: isolate(r.name),\n relationship: r.relationship,\n })\n : isolate(r.name);\n\n // A representative with no standing of its own follows the party.\n const standingOf = (r: SignerRepresentative) =>\n r.standing ?? standing;\n const signed = reps.filter((r) => standingOf(r) === 'signed');\n const awaiting = reps.filter((r) => standingOf(r) === 'pending');\n\n const clauses: string[] = [];\n if (signed.length > 0)\n clauses.push(\n t('signatureStatusChip.signedByList', {\n defaultValue: 'signed by {{signers}}',\n signers: signed.map(render).join(', '),\n }),\n );\n if (awaiting.length > 0)\n clauses.push(\n t('signatureStatusChip.awaitingList', {\n defaultValue: 'awaiting {{signers}}',\n signers: awaiting.map(render).join(', '),\n }),\n );\n\n return t('signatureStatusChip.breakdownItemOnBehalf', {\n defaultValue: '{{party}}: {{name}}, {{detail}}',\n party: roleLabel,\n name: isolate(who.name),\n detail: clauses.join(', '),\n });\n }\n\n return t('signatureStatusChip.breakdownItemNamed', {\n defaultValue: '{{party}}: {{name}} ({{state}})',\n party: roleLabel,\n name: isolate(who.name),\n state,\n });\n })\n .join(' · ');\n\n // The full picture always reaches AT and hover, even in the compact form.\n const label = breakdown ? `${summary}, ${breakdown}` : summary;\n const visible = detail && breakdown ? `${summary} · ${breakdown}` : summary;\n\n // With a tooltip the breakdown becomes the accessible DESCRIPTION, so the\n // name carries only the summary — otherwise assistive tech reads the same\n // detail twice. Without one, the name has to carry everything, because\n // there is nowhere else for it to go.\n const useTooltip = tooltip && breakdown.length > 0;\n const accessibleName = ariaLabelProp ?? (useTooltip ? summary : label);\n\n const chip = (\n <Badge\n ref={ref}\n variant={STATUS_VARIANT[status]}\n size={size}\n withDot\n role=\"img\"\n // One source of truth: an overridden aria-label also becomes the\n // hover text, so the two can never drift apart.\n aria-label={accessibleName}\n // A native title alongside a Tooltip shows two overlapping bubbles,\n // so the Tooltip takes over entirely when it is on.\n title={useTooltip ? titleProp : (titleProp ?? accessibleName)}\n tabIndex={useTooltip ? 0 : undefined}\n data-component=\"signature-status-chip\"\n data-status={status}\n data-component-id={id}\n id={id}\n className={\n useTooltip\n ? [\n 'ds:rounded-[var(--radius-full)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)]',\n 'ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring',\n 'ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n : className\n }\n {...rest}\n >\n {visible}\n </Badge>\n );\n\n if (!useTooltip) return chip;\n\n // Radix's Trigger clones this element, so the chip itself is the trigger:\n // one element, focusable, with the focus ring following the pill shape.\n return <Tooltip label={breakdown}>{chip}</Tooltip>;\n },\n);\n\nSignatureStatusChip.displayName = 'SignatureStatusChip';\n"],"names":["representativesOf","identity","by","effectiveStanding","party","reps","r","signatureStatusOf","operator","patient","secondary","names","required","p","signed","STATUS_VARIANT","ROLE_DEFAULT","STANDING_DEFAULT","MISSING_KEY","MISSING_DEFAULT","isolate","value","requiredParties","out","SignatureStatusChip","forwardRef","size","detail","tooltip","id","className","ariaLabelProp","titleProp","rest","ref","t","useTranslation","status","parties","summary","pending","role","breakdown","standing","roleLabel","state","who","render","standingOf","awaiting","clauses","label","visible","useTooltip","accessibleName","chip","jsx","Badge","Tooltip"],"mappings":";;;;;AAoEA,SAASA,EACPC,GACwB;AACxB,MAAI,CAACA,KAAY,OAAOA,KAAa,iBAAiB,CAAA;AACtD,QAAMC,IAAKD,EAAS;AACpB,SAAKC,IACE,MAAM,QAAQA,CAAE,IAAIA,IAAK,CAACA,CAAE,IADnB,CAAA;AAElB;AAQO,SAASC,EACdC,GACAH,GACgB;AAChB,MAAIG,MAAU,cAAe,QAAO;AACpC,QAAMC,IAAOL,EAAkBC,CAAQ,EAAE,OAAO,CAACK,MAAMA,EAAE,QAAQ;AACjE,SAAID,EAAK,WAAW,IAAUD,IACvBC,EAAK,MAAM,CAACC,MAAMA,EAAE,aAAa,QAAQ,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ature-status-chip-BSatI_Qc.js","sources":["../../src/components/signature-status-chip/signature-status-chip.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Badge, type BadgeProps } from '../badge';\nimport { Tooltip } from '../tooltip';\n\n/* ------------------------------------------------------------------ */\n/* State vocabulary */\n/* ------------------------------------------------------------------ */\n\n/** One party's standing on the document. */\nexport type SignatureParty = 'signed' | 'pending' | 'notRequired';\n\n/** The chip's derived state. */\nexport type SignatureStatus = 'signed' | 'partial' | 'unsigned' | 'notRequired';\n\n/**\n * The parties a document can require. `secondary` is the second signee on a\n * two-signee envelope (platform: `secondary_signee_id`) — a guardian, parent\n * or co-signer. It is optional: a document that does not need one leaves it\n * `notRequired`, which is the default.\n */\nexport type SignatureRole = 'operator' | 'patient' | 'secondary';\n\ntype RequiredStanding = Exclude<SignatureParty, 'notRequired'>;\n\n/**\n * Who a party is, and — when they cannot sign for themselves — who signs in\n * their place. A minor, or an adult who lacks capacity, is still the party\n * the document is about; the parent, guardian or legal representative signs\n * on their behalf. The standing (`signed` / `pending`) stays on the party,\n * because it is their signature slot that is being filled.\n */\nexport interface SignerRepresentative {\n /** The representative's display name. */\n name: string;\n /**\n * Already-translated relationship to the party, e.g. \"Mother\",\n * \"Legal guardian\". Same contract as `SignerRoster.relationship` — the\n * host translates it, because the set is open.\n */\n relationship?: string;\n /**\n * This representative's own standing. Supply it when representatives can\n * be at different stages — both parents must consent and only one has\n * signed. Omit it and the representative inherits the party's standing,\n * which is the right default when a single person signs.\n */\n standing?: Exclude<SignatureParty, 'notRequired'>;\n}\n\nexport interface SignerIdentity {\n /** The party's own display name. */\n name: string;\n /**\n * Who signs in this party's place, when the party cannot sign for\n * themselves. One representative for the ordinary guardian case; several\n * where every one of them must sign — both parents consenting for a minor,\n * where the minor never signs at all.\n *\n * When representatives carry their own `standing`, they become the source\n * of truth for this party: the slot is `signed` only once every one of\n * them has signed. Pass the same values to {@link signatureStatusOf} so\n * host-side filtering agrees with the chip.\n */\n signedBy?: SignerRepresentative | SignerRepresentative[];\n}\n\n/** Normalise the one-or-many representative shape to a list. */\nfunction representativesOf(\n identity: string | SignerIdentity | undefined,\n): SignerRepresentative[] {\n if (!identity || typeof identity === 'string') return [];\n const by = identity.signedBy;\n if (!by) return [];\n return Array.isArray(by) ? by : [by];\n}\n\n/**\n * A party's effective standing. Representatives that carry their own\n * `standing` override the party value, because they are the signatures that\n * actually have to land: every one of them must sign before the slot is\n * complete.\n */\nexport function effectiveStanding(\n party: SignatureParty,\n identity?: string | SignerIdentity,\n): SignatureParty {\n if (party === 'notRequired') return 'notRequired';\n const reps = representativesOf(identity).filter((r) => r.standing);\n if (reps.length === 0) return party;\n return reps.every((r) => r.standing === 'signed') ? 'signed' : 'pending';\n}\n\n/**\n * Display names for the signers, when the host has them and chooses to show\n * them. A bare string is the common case; pass a {@link SignerIdentity} where\n * someone signs on the party's behalf.\n */\nexport type SignatureSignerNames = Partial<\n Record<SignatureRole, string | SignerIdentity>\n>;\n\n/**\n * The rule, exported so hosts can sort/filter by the same state the chip\n * shows: required = parties not `notRequired`; all signed → `signed`, some\n * signed → `partial`, none signed → `unsigned`, nobody required → `notRequired`.\n *\n * `secondary` is optional and defaults to `notRequired`, so existing\n * two-argument calls keep their exact meaning.\n */\nexport function signatureStatusOf(\n operator: SignatureParty,\n patient: SignatureParty,\n secondary: SignatureParty = 'notRequired',\n names?: SignatureSignerNames,\n): SignatureStatus {\n const required = [\n effectiveStanding(operator, names?.operator),\n effectiveStanding(patient, names?.patient),\n effectiveStanding(secondary, names?.secondary),\n ].filter((p) => p !== 'notRequired');\n if (required.length === 0) return 'notRequired';\n const signed = required.filter((p) => p === 'signed').length;\n if (signed === 0) return 'unsigned';\n return signed === required.length ? 'signed' : 'partial';\n}\n\n// `partial` shares the warning tone with `unsigned` so a half-signed document\n// never reads as done at a glance — only a fully signed one goes green.\nconst STATUS_VARIANT: Record<\n SignatureStatus,\n NonNullable<BadgeProps['variant']>\n> = {\n // Traffic light: green when everyone required has signed, amber when at\n // least one party is still missing, red when nobody has.\n signed: 'success',\n partial: 'warning',\n unsigned: 'error',\n notRequired: 'neutral',\n};\n\nconst ROLE_DEFAULT: Record<SignatureRole, string> = {\n operator: 'Operator',\n patient: 'Patient',\n secondary: 'Second signee',\n};\n\nconst STANDING_DEFAULT: Record<RequiredStanding, string> = {\n signed: 'signed',\n pending: 'pending',\n};\n\n// Flat keys, matching the shipped bundles. i18next splits on '.', so a\n// nested `missing.operator` alongside the existing flat keys would risk a\n// lookup collision — and renaming them would break any host override.\nconst MISSING_KEY: Record<SignatureRole, string> = {\n operator: 'signatureStatusChip.missingOperator',\n patient: 'signatureStatusChip.missingPatient',\n secondary: 'signatureStatusChip.missingSecondary',\n};\n\nconst MISSING_DEFAULT: Record<SignatureRole, string> = {\n operator: 'Operator signature missing',\n patient: 'Patient signature missing',\n secondary: 'Second signee signature missing',\n};\n\n/**\n * Wrap host-supplied names in a Unicode first-strong isolate. Names arrive in\n * an unknown script and are interpolated into a translated frame — a Latin\n * name inside an Arabic sentence reorders the surrounding punctuation without\n * this. FSI … PDI is invisible, and assistive tech treats it as formatting.\n */\nfunction isolate(value: string): string {\n return `\\u2068${value}\\u2069`;\n}\n\nfunction requiredParties(\n operator: SignatureParty,\n patient: SignatureParty,\n secondary: SignatureParty,\n): Array<{ role: SignatureRole; standing: RequiredStanding }> {\n const out: Array<{ role: SignatureRole; standing: RequiredStanding }> = [];\n if (operator !== 'notRequired')\n out.push({ role: 'operator', standing: operator });\n if (patient !== 'notRequired')\n out.push({ role: 'patient', standing: patient });\n if (secondary !== 'notRequired')\n out.push({ role: 'secondary', standing: secondary });\n return out;\n}\n\n/* ------------------------------------------------------------------ */\n/* Props */\n/* ------------------------------------------------------------------ */\n\nexport interface SignatureStatusChipProps extends Omit<\n HTMLAttributes<HTMLSpanElement>,\n 'children'\n> {\n /** The operator's standing. */\n operator: SignatureParty;\n /** The patient's standing. */\n patient: SignatureParty;\n /**\n * The second signee's standing on a two-signee envelope — a guardian,\n * parent or co-signer. Defaults to `notRequired`, so a document with only\n * an operator and a patient behaves exactly as before.\n */\n secondary?: SignatureParty;\n /**\n * Display names for the signers, keyed by role. Supply them and the\n * breakdown reads \"Operator: Dr Rossi (signed)\" instead of \"Operator\n * signed\"; omit them and only the roles are named.\n *\n * A role may be a bare name, or a {@link SignerIdentity} when someone\n * signs on that party's behalf — a parent for a minor, a guardian for an\n * adult who lacks capacity. Then the row reads \"Patient: M. Bianchi,\n * signed by A. Bianchi (Parent)\".\n *\n * A name is shown in the chip's accessible name and its hover title, so\n * pass one only where the viewer is already entitled to see that person —\n * these are real people, and on the patient row usually a patient. Roles\n * with no name fall back to the role alone, so a partial map is fine.\n */\n names?: SignatureSignerNames;\n /** Chip height — maps onto the Badge `sm` / `md` sizes. */\n size?: 'sm' | 'md';\n /**\n * Spell the breakdown in the chip text (\"Signed · Operator signed · Patient\n * signed\") instead of the summary word. Default false — the breakdown is\n * always in the accessible name / title.\n */\n detail?: boolean;\n /**\n * Make the breakdown reachable by keyboard and touch, not only on hover.\n *\n * The chip becomes focusable and the breakdown moves out of the accessible\n * name into the kit's `Tooltip`, which exposes it as the accessible\n * description. Screen readers then hear the summary once and the detail\n * once, instead of the whole string twice.\n *\n * Off by default for two reasons. It adds a tab stop, and a table of forty\n * chips should not add forty; and it **requires a `TooltipProvider` above\n * it** — without one the kit's Tooltip throws. Turn it on where the\n * breakdown is something the user has to act on.\n */\n tooltip?: boolean;\n /** Agent-readiness consumer id, surfaced as `data-component-id`. */\n id?: string;\n}\n\n/* ------------------------------------------------------------------ */\n/* Component */\n/* ------------------------------------------------------------------ */\n\nexport const SignatureStatusChip = forwardRef<\n HTMLSpanElement,\n SignatureStatusChipProps\n>(\n (\n {\n operator,\n patient,\n secondary = 'notRequired',\n names,\n size = 'md',\n detail = false,\n tooltip = false,\n id,\n className,\n 'aria-label': ariaLabelProp,\n title: titleProp,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const status = signatureStatusOf(operator, patient, secondary, names);\n // Each party's standing is the effective one, so a slot held open by an\n // unsigned representative reads as pending here too.\n const parties = requiredParties(\n effectiveStanding(operator, names?.operator),\n effectiveStanding(patient, names?.patient),\n effectiveStanding(secondary, names?.secondary),\n );\n\n // When exactly one required party is outstanding the summary names it,\n // which is more use than a vague \"partially signed\". Two or more can be\n // outstanding once a second signee is in play, and then only the count\n // is worth the chip's width — the breakdown spells out the rest.\n const summary = (() => {\n switch (status) {\n case 'signed':\n return t('signatureStatusChip.signed', { defaultValue: 'Signed' });\n case 'unsigned':\n return t('signatureStatusChip.unsigned', {\n defaultValue: 'Not signed',\n });\n case 'notRequired':\n return t('signatureStatusChip.notRequired', {\n defaultValue: 'No signature required',\n });\n case 'partial': {\n const pending = parties.filter((p) => p.standing === 'pending');\n if (pending.length === 1) {\n const role = pending[0].role;\n return t(MISSING_KEY[role], {\n defaultValue: MISSING_DEFAULT[role],\n });\n }\n return t('signatureStatusChip.missingCount', {\n defaultValue: '{{count}} signatures missing',\n count: pending.length,\n });\n }\n }\n })();\n\n // Two breakdowns, deliberately. The chip is a pill: its visible text\n // names roles only, so it stays the length it was before names existed.\n // Names go where there is room for them — the tooltip, or the accessible\n // name when there is no tooltip. A named three-party chip spelled out\n // visibly ran to 138 characters, which is a paragraph, not a chip.\n const buildBreakdown = (withNames: boolean) =>\n parties\n .map(({ role, standing }) => {\n const roleLabel = t(`signatureStatusChip.party.${role}`, {\n defaultValue: ROLE_DEFAULT[role],\n });\n const state = t(`signatureStatusChip.state.${standing}`, {\n defaultValue: STANDING_DEFAULT[standing],\n });\n const identity = withNames ? names?.[role] : undefined;\n if (!identity) {\n return t('signatureStatusChip.breakdownItem', {\n defaultValue: '{{party}} {{state}}',\n party: roleLabel,\n state,\n });\n }\n\n const who =\n typeof identity === 'string' ? { name: identity } : identity;\n\n // Someone signs in the party's place — name the party AND whoever\n // fills their slot, so the reader can see both. Several can be\n // required at once: both parents consenting for a minor.\n const reps = representativesOf(who);\n if (reps.length > 0) {\n const render = (r: SignerRepresentative) =>\n r.relationship\n ? t('signatureStatusChip.representative', {\n defaultValue: '{{name}} ({{relationship}})',\n name: isolate(r.name),\n relationship: r.relationship,\n })\n : isolate(r.name);\n\n // A representative with no standing of its own follows the party.\n const standingOf = (r: SignerRepresentative) =>\n r.standing ?? standing;\n const signed = reps.filter((r) => standingOf(r) === 'signed');\n const awaiting = reps.filter((r) => standingOf(r) === 'pending');\n\n const clauses: string[] = [];\n if (signed.length > 0)\n clauses.push(\n t('signatureStatusChip.signedByList', {\n defaultValue: 'signed by {{signers}}',\n signers: signed.map(render).join(', '),\n }),\n );\n if (awaiting.length > 0)\n clauses.push(\n t('signatureStatusChip.awaitingList', {\n defaultValue: 'awaiting {{signers}}',\n signers: awaiting.map(render).join(', '),\n }),\n );\n\n return t('signatureStatusChip.breakdownItemOnBehalf', {\n defaultValue: '{{party}}: {{name}}, {{detail}}',\n party: roleLabel,\n name: isolate(who.name),\n detail: clauses.join(', '),\n });\n }\n\n return t('signatureStatusChip.breakdownItemNamed', {\n defaultValue: '{{party}}: {{name}} ({{state}})',\n party: roleLabel,\n name: isolate(who.name),\n state,\n });\n })\n .join(' · ');\n\n const breakdownNamed = buildBreakdown(true);\n const breakdownRoles = buildBreakdown(false);\n\n // The full picture always reaches AT and hover, even in the compact form.\n const label = breakdownNamed ? `${summary}, ${breakdownNamed}` : summary;\n // Visible text: roles only, never names.\n const visible =\n detail && breakdownRoles ? `${summary} · ${breakdownRoles}` : summary;\n\n // With a tooltip the breakdown becomes the accessible DESCRIPTION, so the\n // name carries only the summary — otherwise assistive tech reads the same\n // detail twice. Without one, the name has to carry everything, because\n // there is nowhere else for it to go.\n const useTooltip = tooltip && breakdownNamed.length > 0;\n const accessibleName = ariaLabelProp ?? (useTooltip ? summary : label);\n\n const chip = (\n <Badge\n ref={ref}\n variant={STATUS_VARIANT[status]}\n size={size}\n withDot\n role=\"img\"\n // One source of truth: an overridden aria-label also becomes the\n // hover text, so the two can never drift apart.\n aria-label={accessibleName}\n // A native title alongside a Tooltip shows two overlapping bubbles,\n // so the Tooltip takes over entirely when it is on.\n title={useTooltip ? titleProp : (titleProp ?? accessibleName)}\n tabIndex={useTooltip ? 0 : undefined}\n data-component=\"signature-status-chip\"\n data-status={status}\n data-component-id={id}\n id={id}\n className={\n useTooltip\n ? [\n 'ds:rounded-[var(--radius-full)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)]',\n 'ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring',\n 'ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n : className\n }\n {...rest}\n >\n {visible}\n </Badge>\n );\n\n if (!useTooltip) return chip;\n\n // Radix's Trigger clones this element, so the chip itself is the trigger:\n // one element, focusable, with the focus ring following the pill shape.\n return <Tooltip label={breakdownNamed}>{chip}</Tooltip>;\n },\n);\n\nSignatureStatusChip.displayName = 'SignatureStatusChip';\n"],"names":["representativesOf","identity","by","effectiveStanding","party","reps","r","signatureStatusOf","operator","patient","secondary","names","required","p","signed","STATUS_VARIANT","ROLE_DEFAULT","STANDING_DEFAULT","MISSING_KEY","MISSING_DEFAULT","isolate","value","requiredParties","out","SignatureStatusChip","forwardRef","size","detail","tooltip","id","className","ariaLabelProp","titleProp","rest","ref","t","useTranslation","status","parties","summary","pending","role","buildBreakdown","withNames","standing","roleLabel","state","who","render","standingOf","awaiting","clauses","breakdownNamed","breakdownRoles","label","visible","useTooltip","accessibleName","chip","jsx","Badge","Tooltip"],"mappings":";;;;;AAoEA,SAASA,EACPC,GACwB;AACxB,MAAI,CAACA,KAAY,OAAOA,KAAa,iBAAiB,CAAA;AACtD,QAAMC,IAAKD,EAAS;AACpB,SAAKC,IACE,MAAM,QAAQA,CAAE,IAAIA,IAAK,CAACA,CAAE,IADnB,CAAA;AAElB;AAQO,SAASC,EACdC,GACAH,GACgB;AAChB,MAAIG,MAAU,cAAe,QAAO;AAC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A,EAEC,OAAO,OAAO,EACd,KAAK,GAAG,IACXA;AAAA,QAEL,GAAGG;AAAA,QAEH,UAAAsB;AAAA,MAAA;AAAA,IAAA;AAIL,WAAKC,IAIE,gBAAAG,EAACE,GAAA,EAAQ,OAAOT,GAAiB,UAAAM,GAAK,IAJrBA;AAAA,EAK1B;AACF;AAEAlC,GAAoB,cAAc;"}
@@ -1,8 +1,8 @@
1
1
  import { jsxs as c, jsx as r } from "react/jsx-runtime";
2
- import { forwardRef as _, useMemo as A } from "react";
3
- import { c as m } from "./index-D2ZczOXr.js";
4
- import { useTranslation as j } from "react-i18next";
5
- function u({
2
+ import { forwardRef as B, useMemo as A } from "react";
3
+ import { c as p } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as C } from "react-i18next";
5
+ function h({
6
6
  className: a
7
7
  }) {
8
8
  return /* @__PURE__ */ r(
@@ -17,7 +17,7 @@ function u({
17
17
  }
18
18
  );
19
19
  }
20
- const k = m(
20
+ const j = p(
21
21
  [
22
22
  // `position` is provided by `positionVariants` below — `static`
23
23
  // sets `ds:relative` (so the pseudo-element touch-target anchors),
@@ -119,7 +119,7 @@ const k = m(
119
119
  size: "md"
120
120
  }
121
121
  }
122
- ), C = m("", {
122
+ ), k = p("", {
123
123
  variants: {
124
124
  position: {
125
125
  // `relative` so the `::before` pseudo touch-target (defined in
@@ -137,36 +137,92 @@ const k = m(
137
137
  }
138
138
  },
139
139
  defaultVariants: { position: "static" }
140
- });
141
- function B(a, n) {
140
+ }), N = p("", {
141
+ variants: {
142
+ collapseLabelBelow: {
143
+ sm: "ds:max-sm:gap-0 ds:max-sm:p-0 ds:max-sm:min-h-0 ds:max-sm:rounded-full ds:max-sm:shadow-[var(--shadow-lg)]",
144
+ md: "ds:max-md:gap-0 ds:max-md:p-0 ds:max-md:min-h-0 ds:max-md:rounded-full ds:max-md:shadow-[var(--shadow-lg)]"
145
+ },
146
+ size: {
147
+ sm: "",
148
+ md: "",
149
+ lg: ""
150
+ }
151
+ },
152
+ compoundVariants: [
153
+ // Mirrors the `fab` size ladder above. The `sm` circle keeps the
154
+ // pseudo touch-target the `pill sm` compound already paints below
155
+ // the `sm:` breakpoint, so 40px still hits 44/48px on a phone.
156
+ {
157
+ collapseLabelBelow: "sm",
158
+ size: "sm",
159
+ class: "ds:max-sm:h-10 ds:max-sm:w-10 ds:max-sm:[&_svg]:size-5"
160
+ },
161
+ {
162
+ collapseLabelBelow: "sm",
163
+ size: "md",
164
+ class: "ds:max-sm:h-14 ds:max-sm:w-14 ds:max-sm:[&_svg]:size-7"
165
+ },
166
+ {
167
+ collapseLabelBelow: "sm",
168
+ size: "lg",
169
+ class: "ds:max-sm:h-16 ds:max-sm:w-16 ds:max-sm:[&_svg]:size-8"
170
+ },
171
+ // The `pill sm` pseudo touch-target only paints below `sm:`, so a
172
+ // 40px circle collapsed at `md` would sit under the target minimum
173
+ // between the two breakpoints. Size that one circle to the minimum
174
+ // itself (44px, 48px in the accessible themes) instead.
175
+ {
176
+ collapseLabelBelow: "md",
177
+ size: "sm",
178
+ class: "ds:max-md:h-[var(--min-target-size)] ds:max-md:w-[var(--min-target-size)] ds:max-md:[&_svg]:size-5"
179
+ },
180
+ {
181
+ collapseLabelBelow: "md",
182
+ size: "md",
183
+ class: "ds:max-md:h-14 ds:max-md:w-14 ds:max-md:[&_svg]:size-7"
184
+ },
185
+ {
186
+ collapseLabelBelow: "md",
187
+ size: "lg",
188
+ class: "ds:max-md:h-16 ds:max-md:w-16 ds:max-md:[&_svg]:size-8"
189
+ }
190
+ ]
191
+ }), V = {
192
+ sm: "ds:max-sm:sr-only",
193
+ md: "ds:max-md:sr-only"
194
+ };
195
+ function $(a, o) {
142
196
  const s = a.replace(/\D/g, "");
143
197
  if (s.length === 0)
144
198
  return null;
145
- const d = `https://wa.me/${s}`;
146
- return n ? `${d}?text=${encodeURIComponent(n)}` : d;
199
+ const l = `https://wa.me/${s}`;
200
+ return o ? `${l}?text=${encodeURIComponent(o)}` : l;
147
201
  }
148
- const L = _(
202
+ const T = B(
149
203
  ({
150
204
  phoneNumber: a,
151
- message: n,
205
+ message: o,
152
206
  variant: s = "pill",
153
- size: d = "md",
154
- position: h,
155
- label: g,
207
+ size: l = "md",
208
+ position: u,
209
+ label: x,
156
210
  tone: w = "standard",
157
- className: x,
211
+ collapseLabelBelow: z,
212
+ className: _,
158
213
  ...i
159
- }, z) => {
160
- const { t: p } = j(), f = A(
161
- () => B(a, n),
162
- [a, n]
163
- ), e = g ?? p(s === "fab" ? "whatsApp.fabLabel" : w === "question" ? "whatsApp.questionPrompt" : "whatsApp.label"), y = [
164
- k({ variant: s, size: d }),
165
- C({ position: h }),
166
- x
167
- ].filter(Boolean).join(" "), o = f === null, v = {
168
- ref: z,
169
- ...o ? {} : {
214
+ }, y) => {
215
+ const { t: v } = C(), f = A(
216
+ () => $(a, o),
217
+ [a, o]
218
+ ), e = x ?? v(s === "fab" ? "whatsApp.fabLabel" : w === "question" ? "whatsApp.questionPrompt" : "whatsApp.label"), n = s === "pill" ? z : void 0, L = [
219
+ j({ variant: s, size: l }),
220
+ k({ position: u }),
221
+ n ? N({ collapseLabelBelow: n, size: l }) : "",
222
+ _
223
+ ].filter(Boolean).join(" "), t = f === null, b = {
224
+ ref: y,
225
+ ...t ? {} : {
170
226
  href: f,
171
227
  target: "_blank",
172
228
  rel: "noopener noreferrer"
@@ -178,39 +234,40 @@ const L = _(
178
234
  /* `tabIndex` too: an <a> without href is not focusable, and
179
235
  `aria-disabled` presupposes something focus CAN reach — otherwise
180
236
  the reason the control is disabled never reaches a keyboard. */
181
- ...o ? { role: "link", tabIndex: 0 } : {},
182
- "aria-disabled": o ? !0 : void 0,
237
+ ...t ? { role: "link", tabIndex: 0 } : {},
238
+ "aria-disabled": t ? !0 : void 0,
183
239
  "data-component": "whatsapp-button",
184
240
  "data-variant": s,
185
- onClick: (l) => {
186
- var b;
187
- o && l.preventDefault(), (b = i.onClick) == null || b.call(i, l);
241
+ "data-collapse-label-below": n,
242
+ onClick: (m) => {
243
+ var g;
244
+ t && m.preventDefault(), (g = i.onClick) == null || g.call(i, m);
188
245
  },
189
- className: y
190
- }, t = o ? null : p("link.opensInNewTab", "Opens in a new tab");
246
+ className: L
247
+ }, d = t ? null : v("link.opensInNewTab", "Opens in a new tab");
191
248
  if (s === "fab") {
192
- const l = typeof e == "string" ? t ? `${e} — ${t}` : e : void 0;
193
- return /* @__PURE__ */ c("a", { ...i, ...v, "aria-label": l, children: [
194
- /* @__PURE__ */ r(u, {}),
249
+ const m = typeof e == "string" ? d ? `${e} — ${d}` : e : void 0;
250
+ return /* @__PURE__ */ c("a", { ...i, ...b, "aria-label": m, children: [
251
+ /* @__PURE__ */ r(h, {}),
195
252
  typeof e != "string" ? /* @__PURE__ */ c("span", { className: "ds:sr-only", children: [
196
253
  e,
197
- t ? ` — ${t}` : null
254
+ d ? ` — ${d}` : null
198
255
  ] }) : null
199
256
  ] });
200
257
  }
201
- return /* @__PURE__ */ c("a", { ...i, ...v, children: [
202
- /* @__PURE__ */ r(u, {}),
203
- /* @__PURE__ */ r("span", { children: e }),
204
- t ? /* @__PURE__ */ c("span", { className: "ds:sr-only", children: [
258
+ return /* @__PURE__ */ c("a", { ...i, ...b, children: [
259
+ /* @__PURE__ */ r(h, {}),
260
+ /* @__PURE__ */ r("span", { className: n ? V[n] : void 0, children: e }),
261
+ d ? /* @__PURE__ */ c("span", { className: "ds:sr-only", children: [
205
262
  " — ",
206
- t
263
+ d
207
264
  ] }) : null
208
265
  ] });
209
266
  }
210
267
  );
211
- L.displayName = "WhatsAppButton";
268
+ T.displayName = "WhatsAppButton";
212
269
  export {
213
- L as W,
214
- u as a
270
+ T as W,
271
+ h as a
215
272
  };
216
- //# sourceMappingURL=whatsapp-button-CuFIHJzG.js.map
273
+ //# sourceMappingURL=whatsapp-button-Ai4YAVkl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"whatsapp-button-Ai4YAVkl.js","sources":["../../src/components/whatsapp-button/whatsapp-button.tsx"],"sourcesContent":["/* ------------------------------------------------------------------ */\n/* WhatsAppButton — kit-tokened Click-to-Chat affordance. */\n/* */\n/* Replaces the booking website's loose green-circle-with-caption */\n/* combo (see HTP screenshot in the rebrand discussion) with a single */\n/* well-anchored affordance. Two variants: */\n/* */\n/* - `pill` — inline rounded button, brand green + white glyph + */\n/* label. Drops anywhere in card / header chrome. */\n/* - `fab` — circular floating action button, glyph only, */\n/* persistently anchored in the page corner. Carries an */\n/* `aria-label` so the SR announcement is \"Open WhatsApp */\n/* chat\" without rendering a loose visible caption. */\n/* */\n/* WhatsApp brand guidance requires the canonical #25D366 surface and */\n/* the official phone-bubble glyph — those live in `--brand-whatsapp` */\n/* tokens (added under `src/tokens/index.css`) so all four themes can */\n/* shift the green for accessible contrast without bleeding the brand */\n/* requirement into component code. */\n/* ------------------------------------------------------------------ */\n\nimport {\n forwardRef,\n useMemo,\n type AnchorHTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\n\n/* ------------------------------------------------------------------ */\n/* WhatsApp glyph */\n/* */\n/* Inlined SVG — no external icon dep. The path matches WhatsApp's */\n/* official brand mark (speech bubble + phone). `currentColor` lets */\n/* the kit's `--brand-whatsapp-foreground` paint the glyph from a */\n/* single CVA class, so accessible-theme shifts apply without code. */\n/* ------------------------------------------------------------------ */\n\nexport function WhatsAppGlyph({\n className,\n}: {\n className?: string;\n}): ReactNode {\n return (\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={className}\n >\n <path d=\"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.149-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.71.306 1.263.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413Z\" />\n </svg>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst rootVariants = cva(\n [\n // `position` is provided by `positionVariants` below — `static`\n // sets `ds:relative` (so the pseudo-element touch-target anchors),\n // `bottom-end` / `bottom-start` set `ds:fixed`. Keeping `relative`\n // off the base avoids the cascade conflict that made `position:\n // relative` win against `position: fixed` in the compiled CSS\n // (booking-website was patching with `style={{position:'fixed'}}`).\n 'ds:inline-flex ds:items-center ds:justify-center',\n 'ds:font-medium',\n // The pill can shrink, so an unpinned glyph would squash horizontally\n // while its height held, distorting the brand mark.\n 'ds:[&_svg]:shrink-0',\n 'ds:bg-[var(--brand-whatsapp)] ds:text-[var(--brand-whatsapp-foreground)]',\n 'ds:hover:bg-[var(--brand-whatsapp-hover)]',\n 'ds:active:opacity-90',\n 'ds:transition-[background-color,box-shadow,opacity]',\n 'ds:duration-[var(--animation-duration)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n // Focus ring colour is `var(--ring)` (= `--primary` in light, ditto\n // through theme cascade) — NOT `--brand-whatsapp`. Painting the\n // ring brand-green on a brand-green surface makes it invisible.\n 'ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n // Under Windows High Contrast Mode the bg + shadow are stripped;\n // repaint a solid border + swap the focus ring to CanvasText so\n // the affordance stays identifiable.\n 'ds:forced-colors:border ds:forced-colors:border-[ButtonBorder]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n 'ds:disabled:opacity-50 ds:disabled:cursor-not-allowed',\n 'ds:motion-reduce:transition-none',\n ].join(' '),\n {\n variants: {\n variant: {\n // Pill — inline rounded button. Visible label is the brand\n // affordance text; glyph sits leading.\n //\n // No `whitespace-nowrap`: with it the pill's min-content width was\n // the whole label on one line, so a long label outgrew the viewport\n // and spilled off screen. Wrapping lets shrink-to-fit cap the pill.\n // `text-center` centres the wrapped line, the block padding keeps it\n // off the rounded edges, and `overflow-wrap` breaks a compound word\n // (German especially) that would otherwise still be too wide.\n pill: [\n 'ds:rounded-[var(--radius-full)] ds:gap-[var(--spacing-xs)]',\n 'ds:text-center ds:py-[var(--spacing-2xs)]',\n 'ds:[overflow-wrap:anywhere]',\n ].join(' '),\n // FAB — circular floating action button. Glyph only; the\n // label resolves into `aria-label`.\n fab: [\n 'ds:rounded-full ds:shadow-[var(--shadow-lg)]',\n 'ds:hover:shadow-[var(--shadow-xl)] ds:active:shadow-[var(--shadow-md)]',\n ].join(' '),\n },\n size: {\n sm: '',\n md: '',\n lg: '',\n },\n },\n compoundVariants: [\n {\n variant: 'pill',\n size: 'sm',\n class:\n 'ds:ps-3 ds:pe-3.5 ds:text-[length:var(--font-size-sm)] ds:[&_svg]:size-4 ds:min-h-[var(--min-target-size)] ds:sm:min-h-9 ds:before:absolute ds:before:inset-x-[calc((var(--min-target-size)-100%)/-2)] ds:before:inset-y-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[\"\"] ds:sm:before:hidden',\n },\n {\n variant: 'pill',\n size: 'md',\n class:\n 'ds:min-h-10 ds:ps-4 ds:pe-5 ds:text-[length:var(--font-size-base)] ds:[&_svg]:size-5',\n },\n {\n variant: 'pill',\n size: 'lg',\n class:\n 'ds:min-h-12 ds:ps-5 ds:pe-6 ds:text-[length:var(--font-size-lg)] ds:[&_svg]:size-6',\n },\n // FAB — fixed square dimensions; the `sm` case mirrors the\n // FloatingActionButton's pseudo-target expansion below the\n // `sm:` breakpoint so a 40px circle still hits 44/48 px on\n // mobile.\n {\n variant: 'fab',\n size: 'sm',\n class:\n 'ds:h-10 ds:w-10 ds:[&_svg]:size-5 ds:before:absolute ds:before:inset-x-[calc((var(--min-target-size)-100%)/-2)] ds:before:inset-y-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[\"\"] ds:sm:before:hidden',\n },\n {\n variant: 'fab',\n size: 'md',\n class: 'ds:h-14 ds:w-14 ds:[&_svg]:size-7',\n },\n {\n variant: 'fab',\n size: 'lg',\n class: 'ds:h-16 ds:w-16 ds:[&_svg]:size-8',\n },\n ],\n defaultVariants: {\n variant: 'pill',\n size: 'md',\n },\n },\n);\n\nconst positionVariants = cva('', {\n variants: {\n position: {\n // `relative` so the `::before` pseudo touch-target (defined in\n // the `pill sm` / `fab sm` compound variants) anchors to the\n // button's box. The fixed-positioning variants below don't need\n // this — `position: fixed` is itself a positioning context for\n // descendants and pseudo-elements.\n static: 'ds:relative',\n // Only ONE inset is set, so the cap must reserve the opposite gutter\n // itself — otherwise a long label pins to its inset edge and spills\n // off the other one. The arbitrary-PROPERTY form is load-bearing:\n // `max-inline-size-[…]` is not a utility and emits nothing.\n 'bottom-end':\n 'ds:fixed ds:z-[var(--z-fixed)] ds:bottom-[calc(var(--spacing-lg)+env(safe-area-inset-bottom,0px))] ds:end-[var(--spacing-lg)] ds:[max-inline-size:calc(100%_-_(var(--spacing-lg)_*_2))]',\n 'bottom-start':\n 'ds:fixed ds:z-[var(--z-fixed)] ds:bottom-[calc(var(--spacing-lg)+env(safe-area-inset-bottom,0px))] ds:start-[var(--spacing-lg)] ds:[max-inline-size:calc(100%_-_(var(--spacing-lg)_*_2))]',\n },\n },\n defaultVariants: { position: 'static' },\n});\n\n/* ------------------------------------------------------------------ */\n/* Collapse — pill on wide viewports, glyph-only circle on narrow ones */\n/* */\n/* The booking site wants the pill with its question copy on desktop */\n/* and just the glyph on a phone. Doing it in CSS (`max-sm:` / */\n/* `max-md:`) instead of a JS media query means the server render and */\n/* the first paint already agree, so there is no flash of the wrong */\n/* shape. Below the breakpoint the root takes the `fab` chrome of the */\n/* same size and the label drops to `sr-only`, so the accessible name */\n/* is unchanged. Tailwind needs literal class strings, hence one entry */\n/* per breakpoint × size rather than a template. */\n/* ------------------------------------------------------------------ */\n\nconst collapseVariants = cva('', {\n variants: {\n collapseLabelBelow: {\n sm: 'ds:max-sm:gap-0 ds:max-sm:p-0 ds:max-sm:min-h-0 ds:max-sm:rounded-full ds:max-sm:shadow-[var(--shadow-lg)]',\n md: 'ds:max-md:gap-0 ds:max-md:p-0 ds:max-md:min-h-0 ds:max-md:rounded-full ds:max-md:shadow-[var(--shadow-lg)]',\n },\n size: {\n sm: '',\n md: '',\n lg: '',\n },\n },\n compoundVariants: [\n // Mirrors the `fab` size ladder above. The `sm` circle keeps the\n // pseudo touch-target the `pill sm` compound already paints below\n // the `sm:` breakpoint, so 40px still hits 44/48px on a phone.\n {\n collapseLabelBelow: 'sm',\n size: 'sm',\n class: 'ds:max-sm:h-10 ds:max-sm:w-10 ds:max-sm:[&_svg]:size-5',\n },\n {\n collapseLabelBelow: 'sm',\n size: 'md',\n class: 'ds:max-sm:h-14 ds:max-sm:w-14 ds:max-sm:[&_svg]:size-7',\n },\n {\n collapseLabelBelow: 'sm',\n size: 'lg',\n class: 'ds:max-sm:h-16 ds:max-sm:w-16 ds:max-sm:[&_svg]:size-8',\n },\n // The `pill sm` pseudo touch-target only paints below `sm:`, so a\n // 40px circle collapsed at `md` would sit under the target minimum\n // between the two breakpoints. Size that one circle to the minimum\n // itself (44px, 48px in the accessible themes) instead.\n {\n collapseLabelBelow: 'md',\n size: 'sm',\n class:\n 'ds:max-md:h-[var(--min-target-size)] ds:max-md:w-[var(--min-target-size)] ds:max-md:[&_svg]:size-5',\n },\n {\n collapseLabelBelow: 'md',\n size: 'md',\n class: 'ds:max-md:h-14 ds:max-md:w-14 ds:max-md:[&_svg]:size-7',\n },\n {\n collapseLabelBelow: 'md',\n size: 'lg',\n class: 'ds:max-md:h-16 ds:max-md:w-16 ds:max-md:[&_svg]:size-8',\n },\n ],\n});\n\nconst collapsedLabelClass = {\n sm: 'ds:max-sm:sr-only',\n md: 'ds:max-md:sr-only',\n} as const;\n\n/* ------------------------------------------------------------------ */\n/* URL builder */\n/* ------------------------------------------------------------------ */\n\n/**\n * Build a `wa.me` deep-link from an E.164 phone number and an\n * optional prefilled message. The number is stripped to digits — the\n * `wa.me` host requires digits only (no `+`, no separators).\n *\n * Returns `null` (not an empty `wa.me/` URL) when the input contains\n * no digits — the caller is then responsible for rendering a disabled\n * affordance rather than shipping a broken link. In dev a `console.warn`\n * fires so the typo is visible during development.\n */\nfunction buildWaMeUrl(phoneNumber: string, message?: string): string | null {\n const digits = phoneNumber.replace(/\\D/g, '');\n if (digits.length === 0) {\n if (\n typeof import.meta !== 'undefined' &&\n typeof import.meta.env !== 'undefined' &&\n import.meta.env.DEV === true\n ) {\n console.warn(\n `[WhatsAppButton] phoneNumber \"${phoneNumber}\" contains no digits — ` +\n `the affordance will render disabled. Pass an E.164 number ` +\n `(e.g. \"+393331234567\") to fix.`,\n );\n }\n return null;\n }\n const base = `https://wa.me/${digits}`;\n if (!message) return base;\n return `${base}?text=${encodeURIComponent(message)}`;\n}\n\n/* ------------------------------------------------------------------ */\n/* Props */\n/* ------------------------------------------------------------------ */\n\nexport interface WhatsAppButtonProps\n extends\n Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'children'>,\n VariantProps<typeof rootVariants>,\n VariantProps<typeof positionVariants> {\n /**\n * Phone number to chat to. E.164 format is recommended\n * (e.g. `+393331234567`). Any non-digit characters are stripped\n * before the URL is built — `wa.me` requires digits only.\n */\n phoneNumber: string;\n /**\n * Optional prefilled message. The receiver sees this in their\n * compose box. Keep it short and human — long pasted text is the\n * single most common reason consumers drop the affordance.\n */\n message?: string;\n /**\n * Override the visible / accessible label. Defaults to\n * `t('whatsApp.label')` (or `t('whatsApp.questionPrompt')` when\n * `tone=\"question\"`) for the pill variant, and\n * `t('whatsApp.fabLabel')` for the FAB.\n */\n label?: ReactNode;\n /**\n * Copy tone for the pill variant.\n * - `standard` (default) — brief \"Chat on WhatsApp\" affordance.\n * - `question` — invitational \"Have questions? Chat on WhatsApp\"\n * copy. Routes through `t('whatsApp.questionPrompt')`. Use on\n * public-facing surfaces (booking pages, marketing) where the\n * button is the only prompt encouraging engagement.\n *\n * Ignored for `variant=\"fab\"` — the floating action button is\n * glyph-only and its `aria-label` stays concise via `fabLabel`.\n */\n tone?: 'standard' | 'question';\n /**\n * Pill only. Below the named Tailwind breakpoint the pill becomes a\n * glyph-only circle (the `fab` chrome of the same `size`) and the\n * label moves to screen-reader-only text, so the accessible name is\n * unchanged. Pure CSS, so server render and first paint agree.\n * Use it where the pill's copy earns its space on desktop but would\n * crowd a phone: the booking site's practice page passes `\"sm\"`.\n *\n * Ignored for `variant=\"fab\"`, which is glyph-only already.\n */\n collapseLabelBelow?: 'sm' | 'md';\n}\n\n/* ------------------------------------------------------------------ */\n/* WhatsAppButton */\n/* ------------------------------------------------------------------ */\n\nexport const WhatsAppButton = forwardRef<\n HTMLAnchorElement,\n WhatsAppButtonProps\n>(\n (\n {\n phoneNumber,\n message,\n variant = 'pill',\n size = 'md',\n position,\n label,\n tone = 'standard',\n collapseLabelBelow,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const href = useMemo(\n () => buildWaMeUrl(phoneNumber, message),\n [phoneNumber, message],\n );\n // Default-label cascade:\n // FAB → `whatsApp.fabLabel` (always concise)\n // pill, tone=question → `whatsApp.questionPrompt` (invitational)\n // pill, tone=standard → `whatsApp.label` (default)\n // Consumer's `label` prop overrides any of the above.\n const defaultLabelKey =\n variant === 'fab'\n ? 'whatsApp.fabLabel'\n : tone === 'question'\n ? 'whatsApp.questionPrompt'\n : 'whatsApp.label';\n const resolvedLabel = label ?? t(defaultLabelKey);\n\n const collapse = variant === 'pill' ? collapseLabelBelow : undefined;\n const composedClassName = [\n rootVariants({ variant, size }),\n positionVariants({ position }),\n collapse ? collapseVariants({ collapseLabelBelow: collapse, size }) : '',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n // When the input has no digits, render an `aria-disabled` anchor\n // with the same chrome but no `href` — assistive tech announces the\n // disabled state and click does nothing. `buildWaMeUrl` already\n // emitted a dev-mode warning above. `target` / `rel` are stripped\n // too because they're meaningless without `href`.\n const isDisabled = href === null;\n const commonAnchorProps = {\n ref,\n ...(isDisabled\n ? {}\n : {\n href: href as string,\n target: '_blank' as const,\n rel: 'noopener noreferrer' as const,\n }),\n /* An <a> without href has NO implicit role, and `aria-disabled` is\n prohibited on a roleless element (axe aria-prohibited-attr). Give\n the disabled anchor an explicit link role so the state is legal\n and assistive tech still announces it. */\n /* `tabIndex` too: an <a> without href is not focusable, and\n `aria-disabled` presupposes something focus CAN reach — otherwise\n the reason the control is disabled never reaches a keyboard. */\n ...(isDisabled ? { role: 'link' as const, tabIndex: 0 } : {}),\n 'aria-disabled': isDisabled ? true : undefined,\n 'data-component': 'whatsapp-button' as const,\n 'data-variant': variant,\n 'data-collapse-label-below': collapse,\n onClick: (event: React.MouseEvent<HTMLAnchorElement>) => {\n if (isDisabled) event.preventDefault();\n rest.onClick?.(event);\n },\n className: composedClassName,\n };\n\n // Screen-reader cue for the new-tab behaviour. WCAG 3.2.5 / G201:\n // user-initiated link openings to a new context should be\n // announced. Reused `link.opensInNewTab` from the kit's `ui` ns —\n // single source of truth across every external-link affordance.\n const opensInNewTabSrText = isDisabled\n ? null\n : t('link.opensInNewTab', 'Opens in a new tab');\n\n if (variant === 'fab') {\n // FAB — circular, glyph-only. The accessible name lives on the\n // anchor's `aria-label` (resolved label). No visible caption,\n // which is exactly what the redesign fixes vs. the legacy\n // green-circle-with-loose-text affordance.\n const fabAriaLabel =\n typeof resolvedLabel === 'string'\n ? opensInNewTabSrText\n ? `${resolvedLabel} — ${opensInNewTabSrText}`\n : resolvedLabel\n : undefined;\n return (\n <a {...rest} {...commonAnchorProps} aria-label={fabAriaLabel}>\n <WhatsAppGlyph />\n {typeof resolvedLabel !== 'string' ? (\n <span className=\"ds:sr-only\">\n {resolvedLabel}\n {opensInNewTabSrText ? ` — ${opensInNewTabSrText}` : null}\n </span>\n ) : null}\n </a>\n );\n }\n\n return (\n <a {...rest} {...commonAnchorProps}>\n <WhatsAppGlyph />\n <span className={collapse ? collapsedLabelClass[collapse] : undefined}>\n {resolvedLabel}\n </span>\n {opensInNewTabSrText ? (\n <span className=\"ds:sr-only\"> — {opensInNewTabSrText}</span>\n ) : null}\n </a>\n );\n },\n);\nWhatsAppButton.displayName = 'WhatsAppButton';\n"],"names":["WhatsAppGlyph","className","jsx","rootVariants","cva","positionVariants","collapseVariants","collapsedLabelClass","buildWaMeUrl","phoneNumber","message","digits","base","WhatsAppButton","forwardRef","variant","size","position","label","tone","collapseLabelBelow","rest","ref","t","useTranslation","href","useMemo","resolvedLabel","collapse","composedClassName","isDisabled","commonAnchorProps","event","_a","opensInNewTabSrText","fabAriaLabel","jsxs"],"mappings":";;;;AAuCO,SAASA,EAAc;AAAA,EAC5B,WAAAC;AACF,GAEc;AACZ,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,eAAY;AAAA,MACZ,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,OAAM;AAAA,MACN,WAAAD;AAAA,MAEA,UAAA,gBAAAC,EAAC,QAAA,EAAK,GAA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gBf;AAAA,MAChB,6BAA6Ba;AAAA,MAC7B,SAAS,CAACI,MAA+C;;AACvD,QAAIF,OAAkB,eAAA,IACtBG,IAAAZ,EAAK,YAAL,QAAAY,EAAA,KAAAZ,GAAeW;AAAA,MACjB;AAAA,MACA,WAAWH;AAAA,IAAA,GAOPK,IAAsBJ,IACxB,OACAP,EAAE,sBAAsB,oBAAoB;AAEhD,QAAIR,MAAY,OAAO;AAKrB,YAAMoB,IACJ,OAAOR,KAAkB,WACrBO,IACE,GAAGP,CAAa,MAAMO,CAAmB,KACzCP,IACF;AACN,+BACG,KAAA,EAAG,GAAGN,GAAO,GAAGU,GAAmB,cAAYI,GAC9C,UAAA;AAAA,QAAA,gBAAAjC,EAACF,GAAA,EAAc;AAAA,QACd,OAAO2B,KAAkB,WACxB,gBAAAS,EAAC,QAAA,EAAK,WAAU,cACb,UAAA;AAAA,UAAAT;AAAA,UACAO,IAAsB,MAAMA,CAAmB,KAAK;AAAA,QAAA,EAAA,CACvD,IACE;AAAA,MAAA,GACN;AAAA,IAEJ;AAEA,6BACG,KAAA,EAAG,GAAGb,GAAO,GAAGU,GACf,UAAA;AAAA,MAAA,gBAAA7B,EAACF,GAAA,EAAc;AAAA,MACf,gBAAAE,EAAC,UAAK,WAAW0B,IAAWrB,EAAoBqB,CAAQ,IAAI,QACzD,UAAAD,GACH;AAAA,MACCO,IACC,gBAAAE,EAAC,QAAA,EAAK,WAAU,cAAa,UAAA;AAAA,QAAA;AAAA,QAAIF;AAAA,MAAA,EAAA,CAAoB,IACnD;AAAA,IAAA,GACN;AAAA,EAEJ;AACF;AACArB,EAAe,cAAc;"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "packageVersion": "1.26.0",
3
+ "packageVersion": "1.27.0",
4
4
  "components": [
5
5
  {
6
6
  "kind": "component",
@@ -1,4 +1,4 @@
1
- import { S as e, e as s, s as i } from "../../_chunks/signature-status-chip-n57D-hhv.js";
1
+ import { S as e, e as s, s as i } from "../../_chunks/signature-status-chip-BSatI_Qc.js";
2
2
  export {
3
3
  e as SignatureStatusChip,
4
4
  s as effectiveStanding,
@@ -1 +1 @@
1
- {"version":3,"file":"signature-status-chip.d.ts","sourceRoot":"","sources":["../../../src/components/signature-status-chip/signature-status-chip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AASxD,4CAA4C;AAC5C,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,SAAS,GAAG,aAAa,CAAC;AAElE,gCAAgC;AAChC,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,CAAC;AAEhF;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW,CAAC;AAIjE;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC;CACnD;AAED,MAAM,WAAW,cAAc;IAC7B,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAE,oBAAoB,GAAG,oBAAoB,EAAE,CAAC;CAC1D;AAYD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,cAAc,EACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,cAAc,GACjC,cAAc,CAKhB;AAED;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,OAAO,CACxC,MAAM,CAAC,aAAa,EAAE,MAAM,GAAG,cAAc,CAAC,CAC/C,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,cAAc,EACvB,SAAS,GAAE,cAA8B,EACzC,KAAK,CAAC,EAAE,oBAAoB,GAC3B,eAAe,CAUjB;AAuED,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CACpD,cAAc,CAAC,eAAe,CAAC,EAC/B,UAAU,CACX;IACC,+BAA+B;IAC/B,QAAQ,EAAE,cAAc,CAAC;IACzB,8BAA8B;IAC9B,OAAO,EAAE,cAAc,CAAC;IACxB;;;;OAIG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAC7B,2DAA2D;IAC3D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,oEAAoE;IACpE,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAMD,eAAO,MAAM,mBAAmB,sHA+L/B,CAAC"}
1
+ {"version":3,"file":"signature-status-chip.d.ts","sourceRoot":"","sources":["../../../src/components/signature-status-chip/signature-status-chip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AASxD,4CAA4C;AAC5C,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,SAAS,GAAG,aAAa,CAAC;AAElE,gCAAgC;AAChC,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,CAAC;AAEhF;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW,CAAC;AAIjE;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;OAKG;IACH,QAAQ,CAAC,EA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../../_chunks/whatsapp-button-CuFIHJzG.js";
1
+ import { W as t, a as s } from "../../_chunks/whatsapp-button-Ai4YAVkl.js";
2
2
  export {
3
3
  t as WhatsAppButton,
4
4
  s as WhatsAppGlyph
@@ -42,6 +42,17 @@ export interface WhatsAppButtonProps extends Omit<AnchorHTMLAttributes<HTMLAncho
42
42
  * glyph-only and its `aria-label` stays concise via `fabLabel`.
43
43
  */
44
44
  tone?: 'standard' | 'question';
45
+ /**
46
+ * Pill only. Below the named Tailwind breakpoint the pill becomes a
47
+ * glyph-only circle (the `fab` chrome of the same `size`) and the
48
+ * label moves to screen-reader-only text, so the accessible name is
49
+ * unchanged. Pure CSS, so server render and first paint agree.
50
+ * Use it where the pill's copy earns its space on desktop but would
51
+ * crowd a phone: the booking site's practice page passes `"sm"`.
52
+ *
53
+ * Ignored for `variant="fab"`, which is glyph-only already.
54
+ */
55
+ collapseLabelBelow?: 'sm' | 'md';
45
56
  }
46
57
  export declare const WhatsAppButton: import("react").ForwardRefExoticComponent<WhatsAppButtonProps & import("react").RefAttributes<HTMLAnchorElement>>;
47
58
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"whatsapp-button.d.ts","sourceRoot":"","sources":["../../../src/components/whatsapp-button/whatsapp-button.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAYlE,wBAAgB,aAAa,CAAC,EAC5B,SAAS,GACV,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,SAAS,CAYZ;AAMD,QAAA,MAAM,YAAY;;;8EA0GjB,CAAC;AAEF,QAAA,MAAM,gBAAgB;;8EAoBpB,CAAC;AAyCH,MAAM,WAAW,mBACf,SACE,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC,EAClE,YAAY,CAAC,OAAO,YAAY,CAAC,EACjC,YAAY,CAAC,OAAO,gBAAgB,CAAC;IACvC;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;CAChC;AAMD,eAAO,MAAM,cAAc,mHAuH1B,CAAC"}
1
+ {"version":3,"file":"whatsapp-button.d.ts","sourceRoot":"","sources":["../../../src/components/whatsapp-button/whatsapp-button.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAYlE,wBAAgB,aAAa,CAAC,EAC5B,SAAS,GACV,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,SAAS,CAYZ;AAMD,QAAA,MAAM,YAAY;;;8EA0GjB,CAAC;AAEF,QAAA,MAAM,gBAAgB;;8EAoBpB,CAAC;AAiHH,MAAM,WAAW,mBACf,SACE,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC,EAClE,YAAY,CAAC,OAAO,YAAY,CAAC,EACjC,YAAY,CAAC,OAAO,gBAAgB,CAAC;IACvC;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IAC/B;;;;;;;;;OASG;IACH,kBAAkB,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CAClC;AAMD,eAAO,MAAM,cAAc,mHA6H1B,CAAC"}
package/dist/index.js CHANGED
@@ -211,7 +211,7 @@ import { R as hf, r as Of, w as Ff } from "./_chunks/rich-text-editor-lSCiE0Zz.j
211
211
  import { E as Mf } from "./_chunks/editor-overlay-DEc5yYwo.js";
212
212
  import { S as kf, s as Bf } from "./_chunks/signature-capture-D6ut9_IR.js";
213
213
  import { S as vf, s as Hf } from "./_chunks/signature-field-0rFODJlW.js";
214
- import { S as Uf, e as Vf, s as Wf } from "./_chunks/signature-status-chip-n57D-hhv.js";
214
+ import { S as Uf, e as Vf, s as Wf } from "./_chunks/signature-status-chip-BSatI_Qc.js";
215
215
  import { S as Yf, s as Xf } from "./_chunks/sign-document-jF4fZDJ5.js";
216
216
  import { S as zf, f as jf, i as Qf, s as Jf } from "./_chunks/slot-grid-BuZOKfcd.js";
217
217
  import { A as $f, F as ag, a as eg, b as sg, c as rg, d as og, e as tg, I as ng, f as ig, g as pg, h as mg, i as lg, j as dg, k as Ag, l as cg, m as fg, n as gg, o as Sg, p as Cg, q as Tg, r as xg, s as ug, t as Pg, u as Ig } from "./_chunks/face-scheme-DA2vjqaM.js";
@@ -219,14 +219,14 @@ import { T as Rg, t as _g, r as bg } from "./_chunks/tooth-scheme-C9jssOmy.js";
219
219
  import { C as Dg, a as hg, b as Og, c as Fg, d as Lg, e as Mg, F as yg, f as kg, g as Bg, h as Gg, I as vg, P as Hg, i as wg, S as Ug, j as Vg, k as Wg, l as Kg, m as Yg, n as Xg, T as qg, o as zg, p as jg, q as Qg, r as Jg, s as Zg, t as $g, u as aS, v as eS, w as sS, x as rS, y as oS, z as tS, A as nS, B as iS, D as pS, E as mS, G as lS, H as dS, J as AS, K as cS, L as fS, M as gS, N as SS, O as CS, Q as TS, R as xS, U as uS, V as PS, W as IS, X as ES, Y as RS, Z as _S, _ as bS, $ as NS } from "./_chunks/tooth-data-DR8Kdnup.js";
220
220
  import { C as hS, D as OS, T as FS, t as LS, a as MS } from "./_chunks/tooth-finding-palette-vqC-D2Ye.js";
221
221
  import { T as kS } from "./_chunks/transaction-chip-DJCstquX.js";
222
- import { W as GS, a as vS } from "./_chunks/whatsapp-button-CuFIHJzG.js";
222
+ import { W as GS, a as vS } from "./_chunks/whatsapp-button-Ai4YAVkl.js";
223
223
  import { C as wS, W as US, a as VS, b as WS, c as KS, i as YS, l as XS, m as qS, r as zS, w as jS, d as QS, e as JS, f as ZS } from "./_chunks/workflow-map-dNzJjBWG.js";
224
224
  import { A as aC, a as eC, b as sC, c as rC } from "./_chunks/alia-sidebar-BWcWZivN.js";
225
225
  import { A as tC, a as nC, L as iC, P as pC, S as mC, T as lC, b as dC, c as AC, d as cC, e as fC, f as gC, g as SC, h as CC, i as TC, j as xC, k as uC, l as PC, m as IC, n as EC, o as RC, p as _C, r as bC, q as NC, s as DC, t as hC, u as OC } from "./_chunks/anamnesis-summary-rows-DwjqZgR5.js";
226
- import { C as LC, a as MC, b as yC, D as kC, c as BC, S as GC, V as vC, W as HC, d as wC, i as UC, m as VC, r as WC, u as KC, e as YC, f as XC } from "./_chunks/calendar-workspace-CTXjHC4R.js";
226
+ import { C as LC, a as MC, b as yC, D as kC, c as BC, S as GC, V as vC, W as HC, d as wC, i as UC, m as VC, r as WC, u as KC, e as YC, f as XC } from "./_chunks/calendar-workspace-Cs4hNB40.js";
227
227
  import { C as zC, M as jC, P as QC } from "./_chunks/marketplace-app-shell-C4AjQmvz.js";
228
228
  import { P as ZC } from "./_chunks/payment-automation-upsell-DwQW2fRp.js";
229
- import { S as aT } from "./_chunks/signature-request-CwlAmVLw.js";
229
+ import { S as aT } from "./_chunks/signature-request-C-IsbkPf.js";
230
230
  import { D as sT, d as rT } from "./_chunks/dependent-selector-cJlJFAKD.js";
231
231
  import { D as tT, d as nT } from "./_chunks/document-preview-CDb-n_W7.js";
232
232
  import { D as pT, d as mT } from "./_chunks/document-scanner-C5Vrbu21.js";
@@ -1,4 +1,4 @@
1
- import { C as s, a as r, b as E, D as P, c as t, S, V as A, W as C, d, i as o, m as D, r as i, u as n, e as W, f as _ } from "../../_chunks/calendar-workspace-CTXjHC4R.js";
1
+ import { C as s, a as r, b as E, D as P, c as t, S, V as A, W as C, d, i as o, m as D, r as i, u as n, e as W, f as _ } from "../../_chunks/calendar-workspace-Cs4hNB40.js";
2
2
  export {
3
3
  s as CALENDAR_PREFERENCE_KEYS,
4
4
  r as CalendarDataProvider,
@@ -1,4 +1,4 @@
1
- import { S as o } from "../../_chunks/signature-request-CwlAmVLw.js";
1
+ import { S as o } from "../../_chunks/signature-request-C-IsbkPf.js";
2
2
  export {
3
3
  o as SignatureRequestModal
4
4
  };