@alfadocs/ui-kit-debug 1.9.0 → 1.9.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/{practice-profile-hero-Bdd0bFqC.js → practice-profile-hero-YQ7h2K4o.js} +8 -2
- package/dist/_chunks/practice-profile-hero-YQ7h2K4o.js.map +1 -0
- package/dist/_chunks/{signature-request-DXhpphlp.js → signature-request-CW30B77U.js} +2 -2
- package/dist/_chunks/{signature-request-DXhpphlp.js.map → signature-request-CW30B77U.js.map} +1 -1
- package/dist/_chunks/{whatsapp-button-BIy6NaJK.js → whatsapp-button-Ca9towA4.js} +61 -43
- package/dist/_chunks/whatsapp-button-Ca9towA4.js.map +1 -0
- package/dist/agent-catalog.json +1 -1
- package/dist/components/practice-profile-hero/index.js +1 -1
- package/dist/components/practice-profile-hero/practice-profile-hero.d.ts +5 -1
- package/dist/components/practice-profile-hero/practice-profile-hero.d.ts.map +1 -1
- package/dist/components/whatsapp-button/index.js +1 -1
- package/dist/components/whatsapp-button/whatsapp-button.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/patterns/signature-request/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/practice-profile-hero-Bdd0bFqC.js.map +0 -1
- package/dist/_chunks/whatsapp-button-BIy6NaJK.js.map +0 -1
package/dist/_chunks/{practice-profile-hero-Bdd0bFqC.js → practice-profile-hero-YQ7h2K4o.js}
RENAMED
|
@@ -119,7 +119,13 @@ const M = {
|
|
|
119
119
|
children: r
|
|
120
120
|
}
|
|
121
121
|
),
|
|
122
|
-
p ?
|
|
122
|
+
p ? (
|
|
123
|
+
// `ms-auto` + `shrink-0` are the desktop contract, and both are
|
|
124
|
+
// wrong once the row wraps on a phone: they stranded the action
|
|
125
|
+
// at the inline-end of a start-aligned stack and stopped a wide
|
|
126
|
+
// control fitting the column. Hence `sm:` and up only.
|
|
127
|
+
/* @__PURE__ */ e("div", { className: "ds:flex ds:min-w-0 ds:items-center ds:gap-[var(--spacing-xs)] ds:sm:ms-auto ds:sm:shrink-0", children: p })
|
|
128
|
+
) : null
|
|
123
129
|
] }),
|
|
124
130
|
c ? /* @__PURE__ */ e("p", { className: "type-body ds:m-0 ds:text-[color:var(--foreground)]", children: c }) : null,
|
|
125
131
|
o ? (
|
|
@@ -184,4 +190,4 @@ export {
|
|
|
184
190
|
E as P,
|
|
185
191
|
M as p
|
|
186
192
|
};
|
|
187
|
-
//# sourceMappingURL=practice-profile-hero-
|
|
193
|
+
//# sourceMappingURL=practice-profile-hero-YQ7h2K4o.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"practice-profile-hero-YQ7h2K4o.js","sources":["../../src/components/practice-profile-hero/practice-profile-hero.agent.ts","../../src/components/practice-profile-hero/practice-profile-hero.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { PracticeProfileHeroHandle } from './practice-profile-hero';\n\nexport const practiceProfileHeroAgent: AgentAdapter<PracticeProfileHeroHandle> =\n {\n id: 'practice-profile-hero',\n // Purely observable hero region — no interactive affordances and no\n // imperative actions on the handle (getName / getHasCover are read-only\n // projections).\n capabilities: [],\n state: {\n name: {\n type: 'string',\n descriptionKey: 'ui.agent.practiceProfileHero.state.name',\n description: 'Practice display name currently rendered.',\n read: (handle) => handle.getName(),\n },\n hasCover: {\n type: 'boolean',\n descriptionKey: 'ui.agent.practiceProfileHero.state.hasCover',\n description:\n 'Whether a cover-image strip is rendered. Structural flag only — never the image URL or any PHI.',\n read: (handle) => handle.getHasCover(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'practice-profile-hero',\n description: 'Marks the PracticeProfileHero 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 useRef,\n type ComponentPropsWithoutRef,\n type ReactNode,\n} from 'react';\nimport { cva } from 'class-variance-authority';\nimport { Avatar } from '../avatar/avatar';\nimport { Badge } from '../badge/badge';\nimport { Card } from '../card/card';\nimport { Rating } from '../rating/rating';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { practiceProfileHeroAgent } from './practice-profile-hero.agent';\n\n/* -------------------------------------------------------------------- */\n/* PracticeProfileHero */\n/* */\n/* The practice-page counterpart to `<OperatorHero>` — the top-of-page */\n/* hero for a practice profile (booking site `/p/<seoUrl>`, marketplace */\n/* practice views). Differences from the operator hero: */\n/* */\n/* - Optional cover strip: renders ONLY when `coverImageUrl` is set. */\n/* A practice without a configured cover image gets no strip at all */\n/* — never an empty brand-gradient band eating page space. */\n/* - Larger avatar at desktop widths (3xl), stepped down to xl and */\n/* stacked above the text on small viewports so the practice name, */\n/* tagline and rating keep the full line width on phones. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* CVA */\n/* -------------------------------------------------------------------- */\n\nconst rootVariants = cva('ds:w-full ds:text-[color:var(--foreground)]', {\n variants: {\n // Matches the kit's other `surface` props (Booking, ReviewsPanel,\n // OperatorHero). `'elevated'` wraps in `<Card>`.\n surface: {\n flat: '',\n elevated: '',\n },\n },\n defaultVariants: {\n surface: 'elevated',\n },\n});\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* -------------------------------------------------------------------- */\n\nexport interface PracticeProfileHeroBadge {\n /** Display key — i18n is up to the consumer. */\n key: string;\n /** Display label. */\n label: string;\n /** Badge variant — falls back to `neutral`. */\n variant?: 'neutral' | 'info' | 'success' | 'warning' | 'error';\n}\n\nexport interface PracticeProfileHeroRating {\n /** Mean rating, 0–5. */\n value: number;\n /** Total number of reviews. */\n count: number;\n}\n\nexport interface PracticeProfileHeroHandle {\n getName: () => string;\n /** Structural flag — whether a cover strip is rendered. No PHI. */\n getHasCover: () => boolean;\n}\n\nexport interface PracticeProfileHeroProps extends Omit<\n ComponentPropsWithoutRef<'div'>,\n 'aria-label' | 'children'\n> {\n /** Practice display name. Rendered as the H1 heading. */\n name: string;\n /** Slogan / tagline subtitle (e.g. \"15 anni di esperienza nel cuore di Brera\"). */\n tagline?: string;\n /**\n * Optional practice photo / logo URL. The kit always renders an\n * `<Avatar>` — when `imageUrl` is missing the avatar falls back to\n * initials.\n */\n imageUrl?: string;\n /**\n * Optional cover image painted as a full-width strip above the body.\n * The strip renders ONLY when this is set — a practice without a cover\n * image gets no strip (and no empty gradient band). While the image\n * loads, the brand gradient shows underneath it.\n */\n coverImageUrl?: string;\n /** Rating summary — when present, renders a Rating + numeric breakdown line. */\n rating?: PracticeProfileHeroRating;\n /**\n * Optional badge row beneath the rating. Use sparingly — 1–3 chips\n * suit the hero's density; longer lists belong in `<ContactProfileCard>`.\n */\n badges?: PracticeProfileHeroBadge[];\n\n /* ----- Slots ----- */\n\n /**\n * Rendered at the inline-end of the heading row (right side on LTR)\n * from `sm` up. The heading row wraps, so on a phone the action drops\n * onto its own line, starts flush with the practice name, and is free\n * to shrink into the column rather than overflow it.\n *\n * Use for a \"Book an appointment\" `<Button>` or a share action.\n */\n actionSlot?: ReactNode;\n\n /* ----- Styling ----- */\n\n /**\n * `elevated` (default) wraps in `<Card variant=\"elevated\">`. `flat`\n * drops the Card — use inside another card / sheet.\n */\n surface?: 'flat' | 'elevated';\n\n /* ----- a11y ----- */\n\n 'aria-label'?: string;\n id?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const PracticeProfileHero = forwardRef<\n HTMLDivElement,\n PracticeProfileHeroProps\n>(\n (\n {\n name,\n tagline,\n imageUrl,\n coverImageUrl,\n rating,\n badges,\n actionSlot,\n surface = 'elevated',\n 'aria-label': ariaLabel,\n id,\n className,\n ...rest\n },\n ref,\n ) => {\n const headingId = useId();\n const hasCover = Boolean(coverImageUrl);\n\n // Memoised so the registry doesn't see a fresh handle identity (and\n // fire unregister+register) on every render — mirrors Booking.\n const agentHandle = useMemo(\n () => ({ getName: () => name, getHasCover: () => hasCover }),\n [name, hasCover],\n );\n useAgentRegistration(practiceProfileHeroAgent, agentHandle, id);\n\n // Cover image URL lands as a component-scoped CSS custom property set\n // imperatively on a ref — mirrors the Avatar `--avatar-color-override`\n // idiom so no `style={{…}}` attribute lands on the JSX (constraint §4).\n const coverRef = useRef<HTMLDivElement>(null);\n useIsomorphicLayoutEffect(() => {\n const el = coverRef.current;\n if (!el) return;\n if (coverImageUrl) {\n el.style.setProperty(\n '--practice-profile-hero-cover',\n `url(\"${coverImageUrl.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"')}\")`,\n );\n } else {\n el.style.removeProperty('--practice-profile-hero-cover');\n }\n }, [coverImageUrl]);\n\n const cover = hasCover ? (\n <div\n ref={coverRef}\n aria-hidden=\"true\"\n data-slot=\"cover\"\n className={[\n 'ds:h-32 ds:sm:h-40 ds:w-full',\n // Cover image layered over the brand gradient — the gradient is\n // the visible underlay while the image streams in (or 404s). The\n // `none` fallback keeps the declaration valid before the layout\n // effect sets the custom property (SSR / first paint).\n 'ds:bg-[image:var(--practice-profile-hero-cover,none),var(--gradient-hero-brand)]',\n 'ds:bg-cover ds:bg-center',\n ].join(' ')}\n />\n ) : null;\n\n const body = (\n <div\n className={[\n // Phones: stacked column, smaller avatar — the practice name,\n // tagline and rating keep the full line width instead of being\n // squeezed beside a 3xl avatar. sm+: classic row layout.\n 'ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-md)]',\n 'ds:sm:flex-row ds:sm:gap-[var(--spacing-lg)]',\n ].join(' ')}\n >\n {/* Responsive avatar — `ds:hidden` removes the inactive size from\n both the layout and the accessibility tree. Both renders are\n aria-hidden: the H1 right beside them already carries the\n practice name, so the avatar is decorative here. */}\n <div className=\"ds:shrink-0 ds:sm:hidden\">\n <Avatar size=\"xl\" name={name} src={imageUrl} aria-hidden=\"true\" />\n </div>\n <div className=\"ds:hidden ds:shrink-0 ds:sm:block\">\n <Avatar size=\"3xl\" name={name} src={imageUrl} aria-hidden=\"true\" />\n </div>\n <div className=\"ds:flex ds:w-full ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <div className=\"ds:flex ds:flex-wrap ds:items-start ds:gap-[var(--spacing-md)]\">\n <h1\n id={headingId}\n className=\"type-title-page ds:m-0 ds:text-[color:var(--foreground)]\"\n >\n {name}\n </h1>\n {actionSlot ? (\n // `ms-auto` + `shrink-0` are the desktop contract, and both are\n // wrong once the row wraps on a phone: they stranded the action\n // at the inline-end of a start-aligned stack and stopped a wide\n // control fitting the column. Hence `sm:` and up only.\n <div className=\"ds:flex ds:min-w-0 ds:items-center ds:gap-[var(--spacing-xs)] ds:sm:ms-auto ds:sm:shrink-0\">\n {actionSlot}\n </div>\n ) : null}\n </div>\n {tagline ? (\n <p className=\"type-body ds:m-0 ds:text-[color:var(--foreground)]\">\n {tagline}\n </p>\n ) : null}\n {rating ? (\n // Rating owns the whole line: locale-formatted value, plural-\n // aware review count, and a single role=\"img\" announcement.\n <Rating\n value={rating.value}\n max={5}\n size=\"md\"\n reviews={{ count: rating.count }}\n />\n ) : null}\n {badges && badges.length > 0 ? (\n <div\n role=\"list\"\n className=\"ds:mt-[var(--spacing-2xs)] ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-2xs)]\"\n >\n {badges.map((badge) => (\n <Badge\n key={badge.key}\n variant={badge.variant ?? 'neutral'}\n role=\"listitem\"\n >\n {badge.label}\n </Badge>\n ))}\n </div>\n ) : null}\n </div>\n </div>\n );\n\n return (\n <div\n ref={ref}\n role=\"region\"\n // A consumer-supplied aria-label wins; otherwise the region is\n // named by the practice-name H1 via aria-labelledby.\n aria-label={ariaLabel}\n aria-labelledby={ariaLabel ? undefined : headingId}\n data-component=\"practice-profile-hero\"\n data-component-id={id}\n data-has-cover={hasCover ? 'true' : 'false'}\n id={id}\n className={rootVariants({ surface, className })}\n {...rest}\n >\n {surface === 'elevated' ? (\n <Card variant=\"elevated\">\n {cover}\n <Card.Body>{body}</Card.Body>\n </Card>\n ) : (\n <>\n {cover}\n <div className=\"ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]\">\n {body}\n </div>\n </>\n )}\n </div>\n );\n },\n);\n\nPracticeProfileHero.displayName = 'PracticeProfileHero';\n"],"names":["practiceProfileHeroAgent","handle","rootVariants","cva","PracticeProfileHero","forwardRef","name","tagline","imageUrl","coverImageUrl","rating","badges","actionSlot","surface","ariaLabel","id","className","rest","ref","headingId","useId","hasCover","agentHandle","useMemo","useAgentRegistration","coverRef","useRef","useIsomorphicLayoutEffect","el","cover","jsx","body","jsxs","Avatar","Rating","badge","Badge","Card","Fragment"],"mappings":";;;;;;;;;AAGO,MAAMA,IACX;AAAA,EACE,IAAI;AAAA;AAAA;AAAA;AAAA,EAIJ,cAAc,CAAA;AAAA,EACd,OAAO;AAAA,IACL,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACC,MAAWA,EAAO,QAAA;AAAA,IAAQ;AAAA,IAEnC,UAAU;AAAA,MACR,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,YAAA;AAAA,IAAY;AAAA,EACvC;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,aAAa;AAAA,IAAA;AAAA,EACf;AAEJ,GCFIC,IAAeC,EAAI,+CAA+C;AAAA,EACtE,UAAU;AAAA;AAAA;AAAA,IAGR,SAAS;AAAA,MACP,MAAM;AAAA,MACN,UAAU;AAAA,IAAA;AAAA,EACZ;AAAA,EAEF,iBAAiB;AAAA,IACf,SAAS;AAAA,EAAA;A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AA,gBAAA,CAMd;AAAA,cAAA;AAAA,YAAA,IAED;AAAA,UAAA,EAAA,CACN;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAIJ,WACE,gBAAAL;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAAZ;AAAA,QACA,MAAK;AAAA,QAGL,cAAYJ;AAAA,QACZ,mBAAiBA,IAAY,SAAYK;AAAA,QACzC,kBAAe;AAAA,QACf,qBAAmBJ;AAAA,QACnB,kBAAgBM,IAAW,SAAS;AAAA,QACpC,IAAAN;AAAA,QACA,WAAWb,EAAa,EAAE,SAAAW,GAAS,WAAAG,GAAW;AAAA,QAC7C,GAAGC;AAAA,QAEH,UAAAJ,MAAY,aACX,gBAAAmB,EAACK,GAAA,EAAK,SAAQ,YACX,UAAA;AAAA,UAAAR;AAAA,UACD,gBAAAC,EAACO,EAAK,MAAL,EAAW,UAAAN,EAAA,CAAK;AAAA,QAAA,EAAA,CACnB,IAEA,gBAAAC,EAAAM,GAAA,EACG,UAAA;AAAA,UAAAT;AAAA,UACD,gBAAAC,EAAC,OAAA,EAAI,WAAU,uDACZ,UAAAC,EAAA,CACH;AAAA,QAAA,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA3B,EAAoB,cAAc;"}
|
|
@@ -5,7 +5,7 @@ import { D as m } from "./dialog-UbKJCi1X.js";
|
|
|
5
5
|
import { B as z } from "./button-nJaPh_HC.js";
|
|
6
6
|
import { I as xe } from "./icon-button-DA2CAGHZ.js";
|
|
7
7
|
import { C as Y } from "./checkbox-BuZ1u__2.js";
|
|
8
|
-
import { a as Re } from "./whatsapp-button-
|
|
8
|
+
import { a as Re } from "./whatsapp-button-Ca9towA4.js";
|
|
9
9
|
import { S as Z } from "./select-BW5ecXlX.js";
|
|
10
10
|
import { S as be } from "./switch-OILsBLWo.js";
|
|
11
11
|
import { A as _ } from "./alert-CiJT540z.js";
|
|
@@ -414,4 +414,4 @@ Me.displayName = "SignatureRequestModal";
|
|
|
414
414
|
export {
|
|
415
415
|
Me as S
|
|
416
416
|
};
|
|
417
|
-
//# sourceMappingURL=signature-request-
|
|
417
|
+
//# sourceMappingURL=signature-request-CW30B77U.js.map
|
package/dist/_chunks/{signature-request-DXhpphlp.js.map → signature-request-CW30B77U.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signature-request-DXhpphlp.js","sources":["../../node_modules/lucide-react/dist/esm/icons/tablet.mjs","../../node_modules/lucide-react/dist/esm/icons/user-plus.mjs","../../src/patterns/signature-request/signature-request.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: \"16\", height: \"20\", x: \"4\", y: \"2\", rx: \"2\", ry: \"2\", key: \"76otgf\" }],\n [\"line\", { x1: \"12\", x2: \"12.01\", y1: \"18\", y2: \"18\", key: \"1dp563\" }]\n];\nconst Tablet = createLucideIcon(\"tablet\", __iconNode);\n\nexport { __iconNode, Tablet as default };\n//# sourceMappingURL=tablet.mjs.map\n","/**\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 [\"path\", { d: \"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\", key: \"1yyitq\" }],\n [\"circle\", { cx: \"9\", cy: \"7\", r: \"4\", key: \"nufk8\" }],\n [\"line\", { x1: \"19\", x2: \"19\", y1: \"8\", y2: \"14\", key: \"1bvyxn\" }],\n [\"line\", { x1: \"22\", x2: \"16\", y1: \"11\", y2: \"11\", key: \"1shjgl\" }]\n];\nconst UserPlus = createLucideIcon(\"user-plus\", __iconNode);\n\nexport { __iconNode, UserPlus as default };\n//# sourceMappingURL=user-plus.mjs.map\n","/**\n * SignatureRequestModal — the practice-side \"Documenti firmati\" modal that\n * dispatches a document-signature request: assign the operator who must\n * counter-sign (or leave the request unassigned) and how their request is\n * delivered (their system-defined default channel arrives pre-checked),\n * build the patient-side signer roster (up to `maxSigners`, each with their\n * own delivery channel and, for on-device signing, an OTP waiver), and send.\n *\n * Runtime pattern: real consuming apps mount this in production (surfaced via\n * `src/patterns/index.ts` and the `./patterns/signature-request` subpath).\n * The component owns the form state — re-seeded from the `initial*` props\n * every time `open` flips back to `true` — while the host owns `open`, the\n * option lists, and what happens on submit. Multiple on-device signers sign\n * sequentially in roster order — the execution side is the Signing pattern's\n * multi-signer flow; this modal only encodes the intents.\n */\nimport {\n forwardRef,\n useEffect,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n Mail,\n MessageSquare,\n PenLine,\n Plus,\n Tablet,\n UserPlus,\n X,\n} from 'lucide-react';\nimport { Dialog } from '../../components/dialog';\nimport { Button } from '../../components/button';\nimport { IconButton } from '../../components/icon-button';\nimport { Checkbox } from '../../components/checkbox';\nimport { WhatsAppGlyph } from '../../components/whatsapp-button';\nimport { Select } from '../../components/select';\nimport { Switch } from '../../components/switch';\nimport { Alert } from '../../components/alert';\nimport { InfoTip } from '../../components/info-tip';\nimport { Separator } from '../../components/separator';\nimport { Avatar } from '../../components/avatar';\n\n/** Delivery channel for one signer's signature request. */\nexport type SignatureChannel = 'sms' | 'email' | 'whatsapp' | 'on-device';\n\n/**\n * Delivery channel for the operator's counter-sign request. The default is\n * system defined — the assigned operator's own `defaultChannel` (e-mail or\n * SMS) arrives pre-checked; `'on-device'` is offerable only while a roster\n * signer also signs on this device.\n */\nexport type OperatorChannel = 'sms' | 'email' | 'on-device';\n\n/** One selectable person/role for the operator or signer selects. */\nexport interface SignerOption {\n value: string;\n label: string;\n /**\n * Delivery channels this person can actually receive. Omit (or pass an\n * empty list) to offer every channel. Hosts gate this from per-patient\n * capability flags — e.g. a patient with no mobile number drops `'sms'`\n * and `'whatsapp'`. Only meaningful for signer options, not operators.\n */\n availableChannels?: SignatureChannel[];\n /**\n * The delivery channel this operator's own settings resolve to — the\n * system-defined default, pre-checked when the operator is assigned.\n * Falls back to `'email'` when omitted. Only meaningful for operator\n * options, not signers.\n */\n defaultChannel?: 'sms' | 'email';\n}\n\n/** One patient-side signer row in the submission. */\nexport interface SignerRequest {\n signerId: string;\n channel: SignatureChannel;\n /** Only meaningful when `channel` is `'on-device'`. */\n skipOtp?: boolean;\n}\n\n/** Payload handed to `onRequestSignature`. */\nexport interface SignatureRequestSubmission {\n /** `null` when the counter-signing operator is left unassigned. */\n operatorId: string | null;\n /**\n * How the operator's counter-sign request is delivered. `null` while the\n * operator is unassigned. Defaults to the operator's own system-defined\n * channel unless explicitly changed in the modal.\n */\n operatorChannel: OperatorChannel | null;\n /** 1..N signers; on-device signers sign sequentially in this order. */\n signers: SignerRequest[];\n}\n\nexport interface SignatureRequestModalProps {\n /** Controlled open state. Reopening re-seeds the form from `initial*`. */\n open: boolean;\n /**\n * Fires when the dialog requests a state change (<kbd>Esc</kbd> or the\n * footer Close button). `false` is the dismiss signal — hosts typically\n * persist a \"dismissed this session\" flag there.\n */\n onOpenChange: (open: boolean) => void;\n /** Operators offered as the counter-signing signer. */\n operators: SignerOption[];\n /** Patient-side people/roles offered in each signer row. */\n signerOptions: SignerOption[];\n /** Enables the \"Assign to me\" shortcut targeting this operator. */\n currentOperatorId?: string;\n /** Offer an \"Assign later\" option in the operator select. Default `true`. */\n allowAssignLater?: boolean;\n /**\n * Preselected operator; `null` preselects \"Assign later\" (honoured only\n * while `allowAssignLater` — otherwise the first operator is seeded).\n */\n initialOperatorId?: string | null;\n /**\n * Preselected operator delivery channel. Defaults to the seeded operator's\n * system-defined `defaultChannel`. `'on-device'` is honoured only while a\n * seeded roster signer also signs on this device.\n */\n initialOperatorChannel?: OperatorChannel;\n /** Seed the signer roster. Defaults to the first option, on-device. */\n initialSigners?: SignerRequest[];\n /** Cap on roster size. Default `2`. */\n maxSigners?: number;\n /**\n * Whether an operator must counter-sign. `false` drops the operator\n * section entirely and submits `operatorId: null` — a host whose document\n * does not require a counter-signature must not be asked for one. Default\n * `true`.\n */\n requireOperator?: boolean;\n /**\n * Whether the patient side signs at all. `false` drops the signer roster\n * and submits an empty `signers` array — for documents only an operator\n * signs. Default `true`. Setting BOTH this and `requireOperator` to false\n * leaves nothing to request, so the primary action stays disabled.\n */\n requirePatient?: boolean;\n /** Disables all inputs and shows the primary action as loading. */\n busy?: boolean;\n /** Consumer-translated error shown above the footer (e.g. server failure). */\n error?: string;\n /** Override the dialog title. Defaults to the `ui.*` string. */\n title?: string;\n /** Override the dialog description. Defaults to the `ui.*` string. */\n description?: string;\n /** Receives the completed submission. The host closes via `onOpenChange`. */\n onRequestSignature: (submission: SignatureRequestSubmission) => void;\n /**\n * Extra attributes for the portaled dialog surface (e.g. `dir`/`lang`\n * when the host pins a locale below `<html>`, or a test id).\n */\n contentProps?: ComponentPropsWithoutRef<'div'>;\n}\n\nconst ASSIGN_LATER = '__assign-later__';\n\n/** Canonical channel display order; per-signer availability filters this. */\nconst CHANNEL_ORDER: SignatureChannel[] = [\n 'sms',\n 'email',\n 'whatsapp',\n 'on-device',\n];\n\n/** Internal roster row — `rowId` keys the DOM so editing a row's person\n * never remounts the row (which would drop keyboard focus). */\ninterface RosterRow extends SignerRequest {\n rowId: number;\n}\n\nfunction labelFor(options: SignerOption[], value: string): string {\n return options.find((option) => option.value === value)?.label ?? '';\n}\n\nexport const SignatureRequestModal = forwardRef<\n HTMLDivElement,\n SignatureRequestModalProps\n>(\n (\n {\n open,\n onOpenChange,\n operators,\n signerOptions,\n currentOperatorId,\n allowAssignLater = true,\n requireOperator = true,\n requirePatient = true,\n initialOperatorId,\n initialOperatorChannel,\n initialSigners,\n maxSigners = 2,\n busy = false,\n error,\n title,\n description,\n onRequestSignature,\n contentProps,\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n const nextRowId = useRef(0);\n const addButtonRef = useRef<HTMLButtonElement>(null);\n\n // Channels a given signer can receive on — the person's `availableChannels`\n // filtered into canonical order; omitted/empty means every channel.\n const channelsFor = (signerId: string): SignatureChannel[] => {\n const allowed = signerOptions.find(\n (option) => option.value === signerId,\n )?.availableChannels;\n return allowed && allowed.length > 0\n ? CHANNEL_ORDER.filter((channel) => allowed.includes(channel))\n : CHANNEL_ORDER;\n };\n\n // First available channel for a signer, preferring `preferred` when offered.\n const resolveChannel = (\n signerId: string,\n preferred: SignatureChannel,\n ): SignatureChannel => {\n const available = channelsFor(signerId);\n return available.includes(preferred) ? preferred : available[0];\n };\n\n const seedOperator = () => {\n if (initialOperatorId === null) {\n return allowAssignLater\n ? ASSIGN_LATER\n : (operators[0]?.value ?? ASSIGN_LATER);\n }\n return (\n initialOperatorId ??\n operators[0]?.value ??\n (allowAssignLater ? ASSIGN_LATER : '')\n );\n };\n const seedRows = (): RosterRow[] => {\n const seed =\n initialSigners && initialSigners.length > 0\n ? initialSigners\n : signerOptions.length > 0\n ? [\n {\n signerId: signerOptions[0].value,\n channel: resolveChannel(signerOptions[0].value, 'on-device'),\n },\n ]\n : [];\n return seed.map((signer) => ({ ...signer, rowId: nextRowId.current++ }));\n };\n\n // System-defined default for one operator — the channel their own\n // settings resolve to.\n const operatorDefaultChannel = (operatorId: string): OperatorChannel =>\n operators.find((option) => option.value === operatorId)?.defaultChannel ??\n 'email';\n\n // Seed clamp: `'on-device'` is honoured only when the seeded roster\n // makes it available, so the option is never checked-and-disabled, not\n // even for a frame.\n const seedOperatorChannel = (\n operatorId: string,\n rows: RosterRow[],\n ): OperatorChannel => {\n if (initialOperatorChannel === 'on-device') {\n return rows.some((signer) => signer.channel === 'on-device')\n ? 'on-device'\n : operatorDefaultChannel(operatorId);\n }\n return initialOperatorChannel ?? operatorDefaultChannel(operatorId);\n };\n\n const [operator, setOperator] = useState<string>(seedOperator);\n const [signers, setSigners] = useState<RosterRow[]>(seedRows);\n const [operatorChannel, setOperatorChannel] = useState<OperatorChannel>(\n () => seedOperatorChannel(operator, signers),\n );\n // Feeds the sr-only live region announcing the automatic channel\n // fallback below; any explicit choice clears it.\n const [revertedTo, setRevertedTo] = useState<OperatorChannel | null>(null);\n\n // Re-seed the form whenever the host reopens the (still-mounted) modal,\n // so a previous request's choices never leak into the next one.\n const wasOpen = useRef(open);\n useEffect(() => {\n if (open && !wasOpen.current) {\n const nextOperator = seedOperator();\n const nextRows = seedRows();\n setOperator(nextOperator);\n setSigners(nextRows);\n setOperatorChannel(seedOperatorChannel(nextOperator, nextRows));\n setRevertedTo(null);\n }\n wasOpen.current = open;\n // The seeds intentionally read the render-time props on the rising\n // edge only — prop changes while open (or closed) don't reset input.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open]);\n\n // Operator on-device signing piggybacks on a patient handover: it is\n // offerable only while a roster signer signs on this device, and falls\n // back to the operator's system default the moment the last on-device\n // row leaves. The fallback is announced via the live region — the\n // trigger lives in the roster section, far from the checkbox it moves.\n const anySignerOnDevice = signers.some(\n (signer) => signer.channel === 'on-device',\n );\n useEffect(() => {\n if (operatorChannel === 'on-device' && !anySignerOnDevice) {\n const fallback = operatorDefaultChannel(operator);\n setOperatorChannel(fallback);\n setRevertedTo(fallback);\n }\n // `operatorDefaultChannel` reads the render-time `operators` prop.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [operatorChannel, anySignerOnDevice, operator]);\n\n const operatorSelectOptions = allowAssignLater\n ? [\n ...operators,\n { value: ASSIGN_LATER, label: t('signatureRequest.assignLater') },\n ]\n : operators;\n const isUnassigned = operator === ASSIGN_LATER;\n\n const channelMeta: Record<\n SignatureChannel,\n { label: string; icon: React.ReactNode }\n > = {\n sms: {\n label: t('signatureRequest.viaSms'),\n icon: <MessageSquare className=\"ds:size-4\" aria-hidden />,\n },\n email: {\n label: t('signatureRequest.viaEmail'),\n icon: <Mail className=\"ds:size-4\" aria-hidden />,\n },\n whatsapp: {\n label: t('signatureRequest.viaWhatsapp'),\n icon: <WhatsAppGlyph className=\"ds:size-4\" aria-hidden />,\n },\n 'on-device': {\n label: t('signatureRequest.onThisDevice'),\n icon: <Tablet className=\"ds:size-4\" aria-hidden />,\n },\n };\n\n // Operator delivery — same checkbox visuals as the signer rows, minus\n // WhatsApp. No \"system defined\" option: the operator's own default\n // (e-mail or SMS per their settings) arrives pre-checked instead.\n // On-device greys out while no patient signer signs on this device;\n // an InfoTip explains why.\n const operatorChannelOptions: Array<{\n value: OperatorChannel;\n label: string;\n icon: React.ReactNode;\n disabled?: boolean;\n hint?: string;\n }> = [\n { value: 'sms', ...channelMeta.sms },\n { value: 'email', ...channelMeta.email },\n {\n value: 'on-device',\n ...channelMeta['on-device'],\n disabled: !anySignerOnDevice,\n hint: anySignerOnDevice\n ? undefined\n : t('signatureRequest.onDeviceUnavailableHint'),\n },\n ];\n\n const chosenIds = signers.map((signer) => signer.signerId);\n const nextFreeOption = signerOptions.find(\n (option) => !chosenIds.includes(option.value),\n );\n const canAddSigner =\n !busy && signers.length < maxSigners && nextFreeOption !== undefined;\n\n const patchSigner = (rowId: number, patch: Partial<SignerRequest>) => {\n setSigners((current) =>\n current.map((signer) =>\n signer.rowId === rowId ? { ...signer, ...patch } : signer,\n ),\n );\n };\n\n const addSigner = () => {\n if (!nextFreeOption) return;\n setSigners((current) => [\n ...current,\n {\n signerId: nextFreeOption.value,\n channel: resolveChannel(nextFreeOption.value, 'sms'),\n rowId: nextRowId.current++,\n },\n ]);\n };\n\n const removeSigner = (rowId: number) => {\n // Move focus BEFORE the row (and the focused remove button) unmounts —\n // otherwise Radix's focus scope dumps focus on the dialog container.\n addButtonRef.current?.focus();\n setSigners((current) =>\n current.filter((signer) => signer.rowId !== rowId),\n );\n };\n\n const handleRequest = () => {\n onRequestSignature({\n operatorId: !requireOperator || isUnassigned ? null : operator,\n operatorChannel:\n !requireOperator || isUnassigned ? null : operatorChannel,\n signers: requirePatient\n ? signers.map(({ rowId: _rowId, ...signer }) => signer)\n : [],\n });\n };\n\n return (\n <div ref={ref} className=\"ds:contents\" data-component=\"signature-request\">\n <Dialog open={open} onOpenChange={onOpenChange}>\n <Dialog.Content size=\"lg\" hideCloseButton {...contentProps}>\n <Dialog.Header>\n <Dialog.Title>\n {title ?? t('signatureRequest.title')}\n </Dialog.Title>\n <Dialog.Description>\n {description ?? t('signatureRequest.noSignedVersions')}\n </Dialog.Description>\n </Dialog.Header>\n\n <Dialog.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {requireOperator ? (\n <section className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n <div className=\"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]\">\n <p className=\"type-eyebrow ds:text-start ds:text-[color:var(--muted-foreground)]\">\n {t('signatureRequest.operatorSection')}\n </p>\n {currentOperatorId !== undefined ? (\n <Button\n intent=\"primary\"\n size=\"sm\"\n startIcon={<UserPlus />}\n disabled={busy}\n onClick={() => {\n setOperator(currentOperatorId);\n setOperatorChannel(\n operatorDefaultChannel(currentOperatorId),\n );\n setRevertedTo(null);\n }}\n >\n {t('signatureRequest.assignToMe')}\n </Button>\n ) : null}\n </div>\n\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n {/* Mirrors the select value — decorative for AT. No name →\n Avatar's built-in placeholder-icon fallback. */}\n <Avatar\n aria-hidden=\"true\"\n name={\n isUnassigned ? undefined : labelFor(operators, operator)\n }\n size=\"sm\"\n />\n <div className=\"ds:min-w-0 ds:flex-1 ds:text-start\">\n <Select\n options={operatorSelectOptions}\n value={operator}\n onValueChange={(value) => {\n if (!value) return;\n setOperator(value);\n // A different operator brings their own system\n // default along.\n setOperatorChannel(\n value === ASSIGN_LATER\n ? 'email'\n : operatorDefaultChannel(value),\n );\n setRevertedTo(null);\n }}\n required\n disabled={busy}\n placeholder={t('signatureRequest.operatorPlaceholder')}\n aria-label={t('signatureRequest.operatorSection')}\n />\n </div>\n </div>\n\n {/* One channel for the operator too — same mutually exclusive\n checkbox visuals as the signer rows. Hidden while the\n request is unassigned: there is nobody to deliver to. */}\n {isUnassigned ? null : (\n <div\n role=\"group\"\n aria-label={t('signatureRequest.operatorChannelLabel')}\n className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-x-[var(--spacing-lg)] ds:gap-y-[var(--spacing-sm)] ds:ps-[var(--spacing-xl)]\"\n >\n {operatorChannelOptions.map((option) => (\n <span\n key={option.value}\n className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]\"\n >\n <Checkbox\n checked={operatorChannel === option.value}\n disabled={busy || option.disabled}\n onCheckedChange={(checked) => {\n if (checked !== true) return;\n setOperatorChannel(option.value);\n setRevertedTo(null);\n }}\n label={\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <span\n aria-hidden=\"true\"\n className=\"ds:text-[var(--accent)]\"\n >\n {option.icon}\n </span>\n {option.label}\n </span>\n }\n />\n {/* Sibling of the checkbox, never inside its label —\n the tip is its own interactive control. The wider\n gap keeps the tip's touch hit-area off the label. */}\n {option.hint ? (\n <InfoTip size=\"sm\" content={option.hint} />\n ) : null}\n </span>\n ))}\n </div>\n )}\n\n {/* Announces the automatic on-device → default fallback: the\n trigger (the patient's channel change) sits in another\n section, so the moved checkmark alone is not enough. */}\n <span role=\"status\" className=\"ds:sr-only\">\n {revertedTo\n ? t('signatureRequest.operatorChannelReverted', {\n channel: channelMeta[revertedTo].label,\n })\n : null}\n </span>\n </section>\n ) : null}\n\n {/* The rule only separates two sections that are both there. */}\n {requireOperator && requirePatient ? (\n <Separator decorative />\n ) : null}\n\n {requirePatient ? (\n <section className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:text-start\">\n <div className=\"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]\">\n <p className=\"type-eyebrow ds:text-[color:var(--muted-foreground)]\">\n {t('signatureRequest.signersSection')}\n </p>\n {/* Offered only when the roster holds more than one\n person. A patient with nobody else to sign for them saw\n a permanently greyed action — a promise the modal could\n never keep. With two or more it stays, greying (not\n hiding) once every seat is taken so the cap reads. */}\n {signerOptions.length > 1 ? (\n <Button\n ref={addButtonRef}\n intent=\"primary\"\n size=\"sm\"\n startIcon={<Plus />}\n disabled={!canAddSigner}\n onClick={addSigner}\n >\n {t('signatureRequest.addSigner')}\n </Button>\n ) : null}\n </div>\n\n {signers.map((signer) => {\n const rowOptions = signerOptions.filter(\n (option) =>\n option.value === signer.signerId ||\n !chosenIds.includes(option.value),\n );\n const rowLabel = labelFor(signerOptions, signer.signerId);\n const rowChannelOptions = channelsFor(signer.signerId).map(\n (channel) => ({\n value: channel,\n ...channelMeta[channel],\n }),\n );\n return (\n <div\n key={signer.rowId}\n role=\"group\"\n aria-label={rowLabel}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\"\n >\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n {/* Mirrors the select value — decorative for AT. */}\n <Avatar\n aria-hidden=\"true\"\n name={rowLabel}\n size=\"sm\"\n />\n <div className=\"ds:min-w-0 ds:flex-1\">\n <Select\n options={rowOptions}\n value={signer.signerId}\n onValueChange={(value) => {\n if (!value) return;\n const channel = resolveChannel(\n value,\n signer.channel,\n );\n patchSigner(signer.rowId, {\n signerId: value,\n channel,\n skipOtp:\n channel === 'on-device'\n ? signer.skipOtp\n : undefined,\n });\n }}\n required\n disabled={busy}\n placeholder={t(\n 'signatureRequest.signerPlaceholder',\n )}\n aria-label={t(\n 'signatureRequest.signerPlaceholder',\n )}\n />\n </div>\n {signers.length > 1 ? (\n <IconButton\n intent=\"ghost\"\n size=\"sm\"\n icon={<X />}\n disabled={busy}\n aria-label={t('signatureRequest.removeSigner')}\n onClick={() => removeSigner(signer.rowId)}\n />\n ) : null}\n </div>\n\n {/* One channel per signer — checkbox visuals, but the\n choice is mutually exclusive: checking a channel\n unchecks the others, and the active one can't be\n unchecked. */}\n <div\n role=\"group\"\n aria-label={t('signatureRequest.channelLabel')}\n className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-x-[var(--spacing-lg)] ds:gap-y-[var(--spacing-sm)] ds:ps-[var(--spacing-xl)]\"\n >\n {rowChannelOptions.map((option) => (\n <Checkbox\n key={option.value}\n checked={signer.channel === option.value}\n disabled={busy}\n onCheckedChange={(checked) =>\n checked === true &&\n patchSigner(signer.rowId, {\n channel: option.value,\n skipOtp: undefined,\n })\n }\n label={\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <span\n aria-hidden=\"true\"\n className=\"ds:text-[var(--accent)]\"\n >\n {option.icon}\n </span>\n {option.label}\n </span>\n }\n />\n ))}\n </div>\n\n {signer.channel === 'on-device' ? (\n <div className=\"ds:ps-[var(--spacing-xl)]\">\n <Switch\n label={t('signatureRequest.noOtp')}\n checked={signer.skipOtp === true}\n disabled={busy}\n onCheckedChange={(checked) =>\n patchSigner(signer.rowId, { skipOtp: checked })\n }\n />\n </div>\n ) : null}\n </div>\n );\n })}\n </section>\n ) : null}\n\n {/* Dedicated alert area — one warning regardless of how many\n signers waive OTP, stacked with any submission error, all at\n the same full width as the operator hint. */}\n {signers.some(\n (signer) =>\n signer.channel === 'on-device' && signer.skipOtp === true,\n ) ? (\n <Alert variant=\"warning\">\n <Alert.Description>\n {t('signatureRequest.noOtpWarning')}\n </Alert.Description>\n </Alert>\n ) : null}\n {error ? (\n <Alert variant=\"error\">\n <Alert.Description>{error}</Alert.Description>\n </Alert>\n ) : null}\n </Dialog.Body>\n\n <Dialog.Footer>\n <Button\n intent=\"primary\"\n startIcon={<PenLine />}\n onClick={handleRequest}\n disabled={\n busy ||\n (requirePatient && signers.length === 0) ||\n (!requirePatient && !requireOperator)\n }\n loading={busy}\n >\n {t('signatureRequest.requestSignature')}\n </Button>\n <Dialog.Close asChild>\n <Button intent=\"outline\" disabled={busy}>\n {t('signatureRequest.close')}\n </Button>\n </Dialog.Close>\n </Dialog.Footer>\n </Dialog.Content>\n </Dialog>\n </div>\n );\n },\n);\nSignatureRequestModal.displayName = 'SignatureRequestModal';\n"],"names":["__iconNode","Tablet","createLucideIcon","UserPlus","ASSIGN_LATER","CHANNEL_ORDER","labelFor","options","value","_a","option","SignatureRequestModal","forwardRef","open","onOpenChange","operators","signerOptions","currentOperatorId","allowAssignLater","requireOperator","requirePatient","initialOperatorId","initialOperatorChannel","initialSigners","maxSigners","busy","error","title","description","onRequestSignature","contentProps","ref","t","useTranslation","nextRowId","useRef","addButtonRef","channelsFor","signerId","allowed","channel","resolveChannel","preferred","available","seedOperator","_b","seedRows","signer","operatorDefaultChannel","operatorId","seedOperatorChannel","rows","operator","setOperator","useState","signers","setSigners","operatorChannel","setOperatorChannel","revertedTo","setRevertedTo","wasOpen","useEffect","nextOperator","nextRows","anySignerOnDevice","fallback","operatorSelectOptions","isUnassigned","channelMeta","jsx","MessageSquare","Mail","WhatsAppGlyph","operatorChannelOptions","chosenIds","nextFreeOption","canAddSigner","patchSigner","rowId","patch","current","addSigner","removeSigner","handleRequest","_rowId","Dialog","jsxs","Button","Avatar","Select","Checkbox","checked","InfoTip","Separator","Plus","rowOptions","rowLabel","rowChannelOptions","IconButton","X","Switch","Alert","PenLine"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,OAAO,MAAM,QAAQ,MAAM,GAAG,KAAK,GAAG,KAAK,IAAI,KAAK,IAAI,KAAK,KAAK,UAAU;AAAA,EACvF,CAAC,QAAQ,EAAE,IAAI,MAAM,IAAI,SAAS,IAAI,MAAM,IAAI,MAAM,KAAK,SAAQ,CAAE;AACvE,GACMC,KAASC,GAAiB,UAAUF,EAAU;ACbpD;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,6CAA6C,KAAK,SAAQ,CAAE;AAAA,EAC1E,CAAC,UAAU,EAAE,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":3,"file":"signature-request-CW30B77U.js","sources":["../../node_modules/lucide-react/dist/esm/icons/tablet.mjs","../../node_modules/lucide-react/dist/esm/icons/user-plus.mjs","../../src/patterns/signature-request/signature-request.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: \"16\", height: \"20\", x: \"4\", y: \"2\", rx: \"2\", ry: \"2\", key: \"76otgf\" }],\n [\"line\", { x1: \"12\", x2: \"12.01\", y1: \"18\", y2: \"18\", key: \"1dp563\" }]\n];\nconst Tablet = createLucideIcon(\"tablet\", __iconNode);\n\nexport { __iconNode, Tablet as default };\n//# sourceMappingURL=tablet.mjs.map\n","/**\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 [\"path\", { d: \"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\", key: \"1yyitq\" }],\n [\"circle\", { cx: \"9\", cy: \"7\", r: \"4\", key: \"nufk8\" }],\n [\"line\", { x1: \"19\", x2: \"19\", y1: \"8\", y2: \"14\", key: \"1bvyxn\" }],\n [\"line\", { x1: \"22\", x2: \"16\", y1: \"11\", y2: \"11\", key: \"1shjgl\" }]\n];\nconst UserPlus = createLucideIcon(\"user-plus\", __iconNode);\n\nexport { __iconNode, UserPlus as default };\n//# sourceMappingURL=user-plus.mjs.map\n","/**\n * SignatureRequestModal — the practice-side \"Documenti firmati\" modal that\n * dispatches a document-signature request: assign the operator who must\n * counter-sign (or leave the request unassigned) and how their request is\n * delivered (their system-defined default channel arrives pre-checked),\n * build the patient-side signer roster (up to `maxSigners`, each with their\n * own delivery channel and, for on-device signing, an OTP waiver), and send.\n *\n * Runtime pattern: real consuming apps mount this in production (surfaced via\n * `src/patterns/index.ts` and the `./patterns/signature-request` subpath).\n * The component owns the form state — re-seeded from the `initial*` props\n * every time `open` flips back to `true` — while the host owns `open`, the\n * option lists, and what happens on submit. Multiple on-device signers sign\n * sequentially in roster order — the execution side is the Signing pattern's\n * multi-signer flow; this modal only encodes the intents.\n */\nimport {\n forwardRef,\n useEffect,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n Mail,\n MessageSquare,\n PenLine,\n Plus,\n Tablet,\n UserPlus,\n X,\n} from 'lucide-react';\nimport { Dialog } from '../../components/dialog';\nimport { Button } from '../../components/button';\nimport { IconButton } from '../../components/icon-button';\nimport { Checkbox } from '../../components/checkbox';\nimport { WhatsAppGlyph } from '../../components/whatsapp-button';\nimport { Select } from '../../components/select';\nimport { Switch } from '../../components/switch';\nimport { Alert } from '../../components/alert';\nimport { InfoTip } from '../../components/info-tip';\nimport { Separator } from '../../components/separator';\nimport { Avatar } from '../../components/avatar';\n\n/** Delivery channel for one signer's signature request. */\nexport type SignatureChannel = 'sms' | 'email' | 'whatsapp' | 'on-device';\n\n/**\n * Delivery channel for the operator's counter-sign request. The default is\n * system defined — the assigned operator's own `defaultChannel` (e-mail or\n * SMS) arrives pre-checked; `'on-device'` is offerable only while a roster\n * signer also signs on this device.\n */\nexport type OperatorChannel = 'sms' | 'email' | 'on-device';\n\n/** One selectable person/role for the operator or signer selects. */\nexport interface SignerOption {\n value: string;\n label: string;\n /**\n * Delivery channels this person can actually receive. Omit (or pass an\n * empty list) to offer every channel. Hosts gate this from per-patient\n * capability flags — e.g. a patient with no mobile number drops `'sms'`\n * and `'whatsapp'`. Only meaningful for signer options, not operators.\n */\n availableChannels?: SignatureChannel[];\n /**\n * The delivery channel this operator's own settings resolve to — the\n * system-defined default, pre-checked when the operator is assigned.\n * Falls back to `'email'` when omitted. Only meaningful for operator\n * options, not signers.\n */\n defaultChannel?: 'sms' | 'email';\n}\n\n/** One patient-side signer row in the submission. */\nexport interface SignerRequest {\n signerId: string;\n channel: SignatureChannel;\n /** Only meaningful when `channel` is `'on-device'`. */\n skipOtp?: boolean;\n}\n\n/** Payload handed to `onRequestSignature`. */\nexport interface SignatureRequestSubmission {\n /** `null` when the counter-signing operator is left unassigned. */\n operatorId: string | null;\n /**\n * How the operator's counter-sign request is delivered. `null` while the\n * operator is unassigned. Defaults to the operator's own system-defined\n * channel unless explicitly changed in the modal.\n */\n operatorChannel: OperatorChannel | null;\n /** 1..N signers; on-device signers sign sequentially in this order. */\n signers: SignerRequest[];\n}\n\nexport interface SignatureRequestModalProps {\n /** Controlled open state. Reopening re-seeds the form from `initial*`. */\n open: boolean;\n /**\n * Fires when the dialog requests a state change (<kbd>Esc</kbd> or the\n * footer Close button). `false` is the dismiss signal — hosts typically\n * persist a \"dismissed this session\" flag there.\n */\n onOpenChange: (open: boolean) => void;\n /** Operators offered as the counter-signing signer. */\n operators: SignerOption[];\n /** Patient-side people/roles offered in each signer row. */\n signerOptions: SignerOption[];\n /** Enables the \"Assign to me\" shortcut targeting this operator. */\n currentOperatorId?: string;\n /** Offer an \"Assign later\" option in the operator select. Default `true`. */\n allowAssignLater?: boolean;\n /**\n * Preselected operator; `null` preselects \"Assign later\" (honoured only\n * while `allowAssignLater` — otherwise the first operator is seeded).\n */\n initialOperatorId?: string | null;\n /**\n * Preselected operator delivery channel. Defaults to the seeded operator's\n * system-defined `defaultChannel`. `'on-device'` is honoured only while a\n * seeded roster signer also signs on this device.\n */\n initialOperatorChannel?: OperatorChannel;\n /** Seed the signer roster. Defaults to the first option, on-device. */\n initialSigners?: SignerRequest[];\n /** Cap on roster size. Default `2`. */\n maxSigners?: number;\n /**\n * Whether an operator must counter-sign. `false` drops the operator\n * section entirely and submits `operatorId: null` — a host whose document\n * does not require a counter-signature must not be asked for one. Default\n * `true`.\n */\n requireOperator?: boolean;\n /**\n * Whether the patient side signs at all. `false` drops the signer roster\n * and submits an empty `signers` array — for documents only an operator\n * signs. Default `true`. Setting BOTH this and `requireOperator` to false\n * leaves nothing to request, so the primary action stays disabled.\n */\n requirePatient?: boolean;\n /** Disables all inputs and shows the primary action as loading. */\n busy?: boolean;\n /** Consumer-translated error shown above the footer (e.g. server failure). */\n error?: string;\n /** Override the dialog title. Defaults to the `ui.*` string. */\n title?: string;\n /** Override the dialog description. Defaults to the `ui.*` string. */\n description?: string;\n /** Receives the completed submission. The host closes via `onOpenChange`. */\n onRequestSignature: (submission: SignatureRequestSubmission) => void;\n /**\n * Extra attributes for the portaled dialog surface (e.g. `dir`/`lang`\n * when the host pins a locale below `<html>`, or a test id).\n */\n contentProps?: ComponentPropsWithoutRef<'div'>;\n}\n\nconst ASSIGN_LATER = '__assign-later__';\n\n/** Canonical channel display order; per-signer availability filters this. */\nconst CHANNEL_ORDER: SignatureChannel[] = [\n 'sms',\n 'email',\n 'whatsapp',\n 'on-device',\n];\n\n/** Internal roster row — `rowId` keys the DOM so editing a row's person\n * never remounts the row (which would drop keyboard focus). */\ninterface RosterRow extends SignerRequest {\n rowId: number;\n}\n\nfunction labelFor(options: SignerOption[], value: string): string {\n return options.find((option) => option.value === value)?.label ?? '';\n}\n\nexport const SignatureRequestModal = forwardRef<\n HTMLDivElement,\n SignatureRequestModalProps\n>(\n (\n {\n open,\n onOpenChange,\n operators,\n signerOptions,\n currentOperatorId,\n allowAssignLater = true,\n requireOperator = true,\n requirePatient = true,\n initialOperatorId,\n initialOperatorChannel,\n initialSigners,\n maxSigners = 2,\n busy = false,\n error,\n title,\n description,\n onRequestSignature,\n contentProps,\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n const nextRowId = useRef(0);\n const addButtonRef = useRef<HTMLButtonElement>(null);\n\n // Channels a given signer can receive on — the person's `availableChannels`\n // filtered into canonical order; omitted/empty means every channel.\n const channelsFor = (signerId: string): SignatureChannel[] => {\n const allowed = signerOptions.find(\n (option) => option.value === signerId,\n )?.availableChannels;\n return allowed && allowed.length > 0\n ? CHANNEL_ORDER.filter((channel) => allowed.includes(channel))\n : CHANNEL_ORDER;\n };\n\n // First available channel for a signer, preferring `preferred` when offered.\n const resolveChannel = (\n signerId: string,\n preferred: SignatureChannel,\n ): SignatureChannel => {\n const available = channelsFor(signerId);\n return available.includes(preferred) ? preferred : available[0];\n };\n\n const seedOperator = () => {\n if (initialOperatorId === null) {\n return allowAssignLater\n ? ASSIGN_LATER\n : (operators[0]?.value ?? ASSIGN_LATER);\n }\n return (\n initialOperatorId ??\n operators[0]?.value ??\n (allowAssignLater ? ASSIGN_LATER : '')\n );\n };\n const seedRows = (): RosterRow[] => {\n const seed =\n initialSigners && initialSigners.length > 0\n ? initialSigners\n : signerOptions.length > 0\n ? [\n {\n signerId: signerOptions[0].value,\n channel: resolveChannel(signerOptions[0].value, 'on-device'),\n },\n ]\n : [];\n return seed.map((signer) => ({ ...signer, rowId: nextRowId.current++ }));\n };\n\n // System-defined default for one operator — the channel their own\n // settings resolve to.\n const operatorDefaultChannel = (operatorId: string): OperatorChannel =>\n operators.find((option) => option.value === operatorId)?.defaultChannel ??\n 'email';\n\n // Seed clamp: `'on-device'` is honoured only when the seeded roster\n // makes it available, so the option is never checked-and-disabled, not\n // even for a frame.\n const seedOperatorChannel = (\n operatorId: string,\n rows: RosterRow[],\n ): OperatorChannel => {\n if (initialOperatorChannel === 'on-device') {\n return rows.some((signer) => signer.channel === 'on-device')\n ? 'on-device'\n : operatorDefaultChannel(operatorId);\n }\n return initialOperatorChannel ?? operatorDefaultChannel(operatorId);\n };\n\n const [operator, setOperator] = useState<string>(seedOperator);\n const [signers, setSigners] = useState<RosterRow[]>(seedRows);\n const [operatorChannel, setOperatorChannel] = useState<OperatorChannel>(\n () => seedOperatorChannel(operator, signers),\n );\n // Feeds the sr-only live region announcing the automatic channel\n // fallback below; any explicit choice clears it.\n const [revertedTo, setRevertedTo] = useState<OperatorChannel | null>(null);\n\n // Re-seed the form whenever the host reopens the (still-mounted) modal,\n // so a previous request's choices never leak into the next one.\n const wasOpen = useRef(open);\n useEffect(() => {\n if (open && !wasOpen.current) {\n const nextOperator = seedOperator();\n const nextRows = seedRows();\n setOperator(nextOperator);\n setSigners(nextRows);\n setOperatorChannel(seedOperatorChannel(nextOperator, nextRows));\n setRevertedTo(null);\n }\n wasOpen.current = open;\n // The seeds intentionally read the render-time props on the rising\n // edge only — prop changes while open (or closed) don't reset input.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open]);\n\n // Operator on-device signing piggybacks on a patient handover: it is\n // offerable only while a roster signer signs on this device, and falls\n // back to the operator's system default the moment the last on-device\n // row leaves. The fallback is announced via the live region — the\n // trigger lives in the roster section, far from the checkbox it moves.\n const anySignerOnDevice = signers.some(\n (signer) => signer.channel === 'on-device',\n );\n useEffect(() => {\n if (operatorChannel === 'on-device' && !anySignerOnDevice) {\n const fallback = operatorDefaultChannel(operator);\n setOperatorChannel(fallback);\n setRevertedTo(fallback);\n }\n // `operatorDefaultChannel` reads the render-time `operators` prop.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [operatorChannel, anySignerOnDevice, operator]);\n\n const operatorSelectOptions = allowAssignLater\n ? [\n ...operators,\n { value: ASSIGN_LATER, label: t('signatureRequest.assignLater') },\n ]\n : operators;\n const isUnassigned = operator === ASSIGN_LATER;\n\n const channelMeta: Record<\n SignatureChannel,\n { label: string; icon: React.ReactNode }\n > = {\n sms: {\n label: t('signatureRequest.viaSms'),\n icon: <MessageSquare className=\"ds:size-4\" aria-hidden />,\n },\n email: {\n label: t('signatureRequest.viaEmail'),\n icon: <Mail className=\"ds:size-4\" aria-hidden />,\n },\n whatsapp: {\n label: t('signatureRequest.viaWhatsapp'),\n icon: <WhatsAppGlyph className=\"ds:size-4\" aria-hidden />,\n },\n 'on-device': {\n label: t('signatureRequest.onThisDevice'),\n icon: <Tablet className=\"ds:size-4\" aria-hidden />,\n },\n };\n\n // Operator delivery — same checkbox visuals as the signer rows, minus\n // WhatsApp. No \"system defined\" option: the operator's own default\n // (e-mail or SMS per their settings) arrives pre-checked instead.\n // On-device greys out while no patient signer signs on this device;\n // an InfoTip explains why.\n const operatorChannelOptions: Array<{\n value: OperatorChannel;\n label: string;\n icon: React.ReactNode;\n disabled?: boolean;\n hint?: string;\n }> = [\n { value: 'sms', ...channelMeta.sms },\n { value: 'email', ...channelMeta.email },\n {\n value: 'on-device',\n ...channelMeta['on-device'],\n disabled: !anySignerOnDevice,\n hint: anySignerOnDevice\n ? undefined\n : t('signatureRequest.onDeviceUnavailableHint'),\n },\n ];\n\n const chosenIds = signers.map((signer) => signer.signerId);\n const nextFreeOption = signerOptions.find(\n (option) => !chosenIds.includes(option.value),\n );\n const canAddSigner =\n !busy && signers.length < maxSigners && nextFreeOption !== undefined;\n\n const patchSigner = (rowId: number, patch: Partial<SignerRequest>) => {\n setSigners((current) =>\n current.map((signer) =>\n signer.rowId === rowId ? { ...signer, ...patch } : signer,\n ),\n );\n };\n\n const addSigner = () => {\n if (!nextFreeOption) return;\n setSigners((current) => [\n ...current,\n {\n signerId: nextFreeOption.value,\n channel: resolveChannel(nextFreeOption.value, 'sms'),\n rowId: nextRowId.current++,\n },\n ]);\n };\n\n const removeSigner = (rowId: number) => {\n // Move focus BEFORE the row (and the focused remove button) unmounts —\n // otherwise Radix's focus scope dumps focus on the dialog container.\n addButtonRef.current?.focus();\n setSigners((current) =>\n current.filter((signer) => signer.rowId !== rowId),\n );\n };\n\n const handleRequest = () => {\n onRequestSignature({\n operatorId: !requireOperator || isUnassigned ? null : operator,\n operatorChannel:\n !requireOperator || isUnassigned ? null : operatorChannel,\n signers: requirePatient\n ? signers.map(({ rowId: _rowId, ...signer }) => signer)\n : [],\n });\n };\n\n return (\n <div ref={ref} className=\"ds:contents\" data-component=\"signature-request\">\n <Dialog open={open} onOpenChange={onOpenChange}>\n <Dialog.Content size=\"lg\" hideCloseButton {...contentProps}>\n <Dialog.Header>\n <Dialog.Title>\n {title ?? t('signatureRequest.title')}\n </Dialog.Title>\n <Dialog.Description>\n {description ?? t('signatureRequest.noSignedVersions')}\n </Dialog.Description>\n </Dialog.Header>\n\n <Dialog.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {requireOperator ? (\n <section className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n <div className=\"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]\">\n <p className=\"type-eyebrow ds:text-start ds:text-[color:var(--muted-foreground)]\">\n {t('signatureRequest.operatorSection')}\n </p>\n {currentOperatorId !== undefined ? (\n <Button\n intent=\"primary\"\n size=\"sm\"\n startIcon={<UserPlus />}\n disabled={busy}\n onClick={() => {\n setOperator(currentOperatorId);\n setOperatorChannel(\n operatorDefaultChannel(currentOperatorId),\n );\n setRevertedTo(null);\n }}\n >\n {t('signatureRequest.assignToMe')}\n </Button>\n ) : null}\n </div>\n\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n {/* Mirrors the select value — decorative for AT. No name →\n Avatar's built-in placeholder-icon fallback. */}\n <Avatar\n aria-hidden=\"true\"\n name={\n isUnassigned ? undefined : labelFor(operators, operator)\n }\n size=\"sm\"\n />\n <div className=\"ds:min-w-0 ds:flex-1 ds:text-start\">\n <Select\n options={operatorSelectOptions}\n value={operator}\n onValueChange={(value) => {\n if (!value) return;\n setOperator(value);\n // A different operator brings their own system\n // default along.\n setOperatorChannel(\n value === ASSIGN_LATER\n ? 'email'\n : operatorDefaultChannel(value),\n );\n setRevertedTo(null);\n }}\n required\n disabled={busy}\n placeholder={t('signatureRequest.operatorPlaceholder')}\n aria-label={t('signatureRequest.operatorSection')}\n />\n </div>\n </div>\n\n {/* One channel for the operator too — same mutually exclusive\n checkbox visuals as the signer rows. Hidden while the\n request is unassigned: there is nobody to deliver to. */}\n {isUnassigned ? null : (\n <div\n role=\"group\"\n aria-label={t('signatureRequest.operatorChannelLabel')}\n className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-x-[var(--spacing-lg)] ds:gap-y-[var(--spacing-sm)] ds:ps-[var(--spacing-xl)]\"\n >\n {operatorChannelOptions.map((option) => (\n <span\n key={option.value}\n className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]\"\n >\n <Checkbox\n checked={operatorChannel === option.value}\n disabled={busy || option.disabled}\n onCheckedChange={(checked) => {\n if (checked !== true) return;\n setOperatorChannel(option.value);\n setRevertedTo(null);\n }}\n label={\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <span\n aria-hidden=\"true\"\n className=\"ds:text-[var(--accent)]\"\n >\n {option.icon}\n </span>\n {option.label}\n </span>\n }\n />\n {/* Sibling of the checkbox, never inside its label —\n the tip is its own interactive control. The wider\n gap keeps the tip's touch hit-area off the label. */}\n {option.hint ? (\n <InfoTip size=\"sm\" content={option.hint} />\n ) : null}\n </span>\n ))}\n </div>\n )}\n\n {/* Announces the automatic on-device → default fallback: the\n trigger (the patient's channel change) sits in another\n section, so the moved checkmark alone is not enough. */}\n <span role=\"status\" className=\"ds:sr-only\">\n {revertedTo\n ? t('signatureRequest.operatorChannelReverted', {\n channel: channelMeta[revertedTo].label,\n })\n : null}\n </span>\n </section>\n ) : null}\n\n {/* The rule only separates two sections that are both there. */}\n {requireOperator && requirePatient ? (\n <Separator decorative />\n ) : null}\n\n {requirePatient ? (\n <section className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:text-start\">\n <div className=\"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]\">\n <p className=\"type-eyebrow ds:text-[color:var(--muted-foreground)]\">\n {t('signatureRequest.signersSection')}\n </p>\n {/* Offered only when the roster holds more than one\n person. A patient with nobody else to sign for them saw\n a permanently greyed action — a promise the modal could\n never keep. With two or more it stays, greying (not\n hiding) once every seat is taken so the cap reads. */}\n {signerOptions.length > 1 ? (\n <Button\n ref={addButtonRef}\n intent=\"primary\"\n size=\"sm\"\n startIcon={<Plus />}\n disabled={!canAddSigner}\n onClick={addSigner}\n >\n {t('signatureRequest.addSigner')}\n </Button>\n ) : null}\n </div>\n\n {signers.map((signer) => {\n const rowOptions = signerOptions.filter(\n (option) =>\n option.value === signer.signerId ||\n !chosenIds.includes(option.value),\n );\n const rowLabel = labelFor(signerOptions, signer.signerId);\n const rowChannelOptions = channelsFor(signer.signerId).map(\n (channel) => ({\n value: channel,\n ...channelMeta[channel],\n }),\n );\n return (\n <div\n key={signer.rowId}\n role=\"group\"\n aria-label={rowLabel}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\"\n >\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n {/* Mirrors the select value — decorative for AT. */}\n <Avatar\n aria-hidden=\"true\"\n name={rowLabel}\n size=\"sm\"\n />\n <div className=\"ds:min-w-0 ds:flex-1\">\n <Select\n options={rowOptions}\n value={signer.signerId}\n onValueChange={(value) => {\n if (!value) return;\n const channel = resolveChannel(\n value,\n signer.channel,\n );\n patchSigner(signer.rowId, {\n signerId: value,\n channel,\n skipOtp:\n channel === 'on-device'\n ? signer.skipOtp\n : undefined,\n });\n }}\n required\n disabled={busy}\n placeholder={t(\n 'signatureRequest.signerPlaceholder',\n )}\n aria-label={t(\n 'signatureRequest.signerPlaceholder',\n )}\n />\n </div>\n {signers.length > 1 ? (\n <IconButton\n intent=\"ghost\"\n size=\"sm\"\n icon={<X />}\n disabled={busy}\n aria-label={t('signatureRequest.removeSigner')}\n onClick={() => removeSigner(signer.rowId)}\n />\n ) : null}\n </div>\n\n {/* One channel per signer — checkbox visuals, but the\n choice is mutually exclusive: checking a channel\n unchecks the others, and the active one can't be\n unchecked. */}\n <div\n role=\"group\"\n aria-label={t('signatureRequest.channelLabel')}\n className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-x-[var(--spacing-lg)] ds:gap-y-[var(--spacing-sm)] ds:ps-[var(--spacing-xl)]\"\n >\n {rowChannelOptions.map((option) => (\n <Checkbox\n key={option.value}\n checked={signer.channel === option.value}\n disabled={busy}\n onCheckedChange={(checked) =>\n checked === true &&\n patchSigner(signer.rowId, {\n channel: option.value,\n skipOtp: undefined,\n })\n }\n label={\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <span\n aria-hidden=\"true\"\n className=\"ds:text-[var(--accent)]\"\n >\n {option.icon}\n </span>\n {option.label}\n </span>\n }\n />\n ))}\n </div>\n\n {signer.channel === 'on-device' ? (\n <div className=\"ds:ps-[var(--spacing-xl)]\">\n <Switch\n label={t('signatureRequest.noOtp')}\n checked={signer.skipOtp === true}\n disabled={busy}\n onCheckedChange={(checked) =>\n patchSigner(signer.rowId, { skipOtp: checked })\n }\n />\n </div>\n ) : null}\n </div>\n );\n })}\n </section>\n ) : null}\n\n {/* Dedicated alert area — one warning regardless of how many\n signers waive OTP, stacked with any submission error, all at\n the same full width as the operator hint. */}\n {signers.some(\n (signer) =>\n signer.channel === 'on-device' && signer.skipOtp === true,\n ) ? (\n <Alert variant=\"warning\">\n <Alert.Description>\n {t('signatureRequest.noOtpWarning')}\n </Alert.Description>\n </Alert>\n ) : null}\n {error ? (\n <Alert variant=\"error\">\n <Alert.Description>{error}</Alert.Description>\n </Alert>\n ) : null}\n </Dialog.Body>\n\n <Dialog.Footer>\n <Button\n intent=\"primary\"\n startIcon={<PenLine />}\n onClick={handleRequest}\n disabled={\n busy ||\n (requirePatient && signers.length === 0) ||\n (!requirePatient && !requireOperator)\n }\n loading={busy}\n >\n {t('signatureRequest.requestSignature')}\n </Button>\n <Dialog.Close asChild>\n <Button intent=\"outline\" disabled={busy}>\n {t('signatureRequest.close')}\n </Button>\n </Dialog.Close>\n </Dialog.Footer>\n </Dialog.Content>\n </Dialog>\n </div>\n );\n },\n);\nSignatureRequestModal.displayName = 'SignatureRequestModal';\n"],"names":["__iconNode","Tablet","createLucideIcon","UserPlus","ASSIGN_LATER","CHANNEL_ORDER","labelFor","options","value","_a","option","SignatureRequestModal","forwardRef","open","onOpenChange","operators","signerOptions","currentOperatorId","allowAssignLater","requireOperator","requirePatient","initialOperatorId","initialOperatorChannel","initialSigners","maxSigners","busy","error","title","description","onRequestSignature","contentProps","ref","t","useTranslation","nextRowId","useRef","addButtonRef","channelsFor","signerId","allowed","channel","resolveChannel","preferred","available","seedOperator","_b","seedRows","signer","operatorDefaultChannel","operatorId","seedOperatorChannel","rows","operator","setOperator","useState","signers","setSigners","operatorChannel","setOperatorChannel","revertedTo","setRevertedTo","wasOpen","useEffect","nextOperator","nextRows","anySignerOnDevice","fallback","operatorSelectOptions","isUnassigned","channelMeta","jsx","MessageSquare","Mail","WhatsAppGlyph","operatorChannelOptions","chosenIds","nextFreeOption","canAddSigner","patchSigner","rowId","patch","current","addSigner","removeSigner","handleRequest","_rowId","Dialog","jsxs","Button","Avatar","Select","Checkbox","checked","InfoTip","Separator","Plus","rowOptions","rowLabel","rowChannelOptions","IconButton","X","Switch","Alert","PenLine"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,OAAO,MAAM,QAAQ,MAAM,GAAG,KAAK,GAAG,KAAK,IAAI,KAAK,IAAI,KAAK,KAAK,UAAU;AAAA,EACvF,CAAC,QAAQ,EAAE,IAAI,MAAM,IAAI,SAAS,IAAI,MAAM,IAAI,MAAM,KAAK,SAAQ,CAAE;AACvE,GACMC,KAASC,GAAiB,UAAUF,EAAU;ACbpD;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,6CAA6C,KAAK,SAAQ,CAAE;AAAA,EAC1E,CAAC,UAAU,EAAE,IAAI,KAAK,IAAI,KAAK,GAAG,KAAK,KAAK,SAAS;AAAA,EACrD,CAAC,QAAQ,EAAE,IAAI,MAAM,IAAI,MAAM,IAAI,KAAK,IAAI,MAAM,KAAK,SAAQ,CAAE;AAAA,EACjE,CAAC,QAAQ,EAAE,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,KA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C;AAAA,QAAA,EAAA,CACH,IACE;AAAA,QAKHQ,EAAQ;AAAA,UACP,CAACR,MACCA,EAAO,YAAY,eAAeA,EAAO,YAAY;AAAA,QAAA,IAEvD,gBAAAuB,EAACgC,GAAA,EAAM,SAAQ,WACb,UAAA,gBAAAhC,EAACgC,EAAM,aAAN,EACE,UAAAtE,EAAE,+BAA+B,EAAA,CACpC,GACF,IACE;AAAA,QACHN,IACC,gBAAA4C,EAACgC,GAAA,EAAM,SAAQ,SACb,UAAA,gBAAAhC,EAACgC,EAAM,aAAN,EAAmB,UAAA5E,EAAA,CAAM,EAAA,CAC5B,IACE;AAAA,MAAA,GACN;AAAA,MAEA,gBAAA6D,EAACD,EAAO,QAAP,EACC,UAAA;AAAA,QAAA,gBAAAhB;AAAA,UAACkB;AAAA,UAAA;AAAA,YACC,QAAO;AAAA,YACP,6BAAYe,IAAA,EAAQ;AAAA,YACpB,SAASnB;AAAA,YACT,UACE3D,KACCL,KAAkBmC,EAAQ,WAAW,KACrC,CAACnC,KAAkB,CAACD;AAAA,YAEvB,SAASM;AAAA,YAER,YAAE,mCAAmC;AAAA,UAAA;AAAA,QAAA;AAAA,QAExC,gBAAA6C,EAACgB,EAAO,OAAP,EAAa,SAAO,IACnB,UAAA,gBAAAhB,EAACkB,GAAA,EAAO,QAAO,WAAU,UAAU/D,GAChC,UAAAO,EAAE,wBAAwB,GAC7B,EAAA,CACF;AAAA,MAAA,EAAA,CACF;AAAA,IAAA,EAAA,CACF,GACF,GACF;AAAA,EAEJ;AACF;AACArB,GAAsB,cAAc;","x_google_ignoreList":[0,1]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsxs as c, jsx as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsxs as c, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as _, useMemo as A } from "react";
|
|
3
3
|
import { c as m } from "./index-D2ZczOXr.js";
|
|
4
|
-
import { useTranslation as
|
|
4
|
+
import { useTranslation as j } from "react-i18next";
|
|
5
5
|
function u({
|
|
6
6
|
className: a
|
|
7
7
|
}) {
|
|
8
|
-
return /* @__PURE__ */
|
|
8
|
+
return /* @__PURE__ */ o(
|
|
9
9
|
"svg",
|
|
10
10
|
{
|
|
11
11
|
"aria-hidden": "true",
|
|
@@ -13,11 +13,11 @@ function u({
|
|
|
13
13
|
fill: "currentColor",
|
|
14
14
|
xmlns: "http://www.w3.org/2000/svg",
|
|
15
15
|
className: a,
|
|
16
|
-
children: /* @__PURE__ */
|
|
16
|
+
children: /* @__PURE__ */ o("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" })
|
|
17
17
|
}
|
|
18
18
|
);
|
|
19
19
|
}
|
|
20
|
-
const
|
|
20
|
+
const C = m(
|
|
21
21
|
[
|
|
22
22
|
// `position` is provided by `positionVariants` below — `static`
|
|
23
23
|
// sets `ds:relative` (so the pseudo-element touch-target anchors),
|
|
@@ -26,7 +26,10 @@ const j = m(
|
|
|
26
26
|
// relative` win against `position: fixed` in the compiled CSS
|
|
27
27
|
// (booking-website was patching with `style={{position:'fixed'}}`).
|
|
28
28
|
"ds:inline-flex ds:items-center ds:justify-center",
|
|
29
|
-
"ds:font-medium
|
|
29
|
+
"ds:font-medium",
|
|
30
|
+
// The pill can shrink, so an unpinned glyph would squash horizontally
|
|
31
|
+
// while its height held, distorting the brand mark.
|
|
32
|
+
"ds:[&_svg]:shrink-0",
|
|
30
33
|
"ds:bg-[var(--brand-whatsapp)] ds:text-[var(--brand-whatsapp-foreground)]",
|
|
31
34
|
"ds:hover:bg-[var(--brand-whatsapp-hover)]",
|
|
32
35
|
"ds:active:opacity-90",
|
|
@@ -50,7 +53,18 @@ const j = m(
|
|
|
50
53
|
variant: {
|
|
51
54
|
// Pill — inline rounded button. Visible label is the brand
|
|
52
55
|
// affordance text; glyph sits leading.
|
|
53
|
-
|
|
56
|
+
//
|
|
57
|
+
// No `whitespace-nowrap`: with it the pill's min-content width was
|
|
58
|
+
// the whole label on one line, so a long label outgrew the viewport
|
|
59
|
+
// and spilled off screen. Wrapping lets shrink-to-fit cap the pill.
|
|
60
|
+
// `text-center` centres the wrapped line, the block padding keeps it
|
|
61
|
+
// off the rounded edges, and `overflow-wrap` breaks a compound word
|
|
62
|
+
// (German especially) that would otherwise still be too wide.
|
|
63
|
+
pill: [
|
|
64
|
+
"ds:rounded-[var(--radius-full)] ds:gap-[var(--spacing-xs)]",
|
|
65
|
+
"ds:text-center ds:py-[var(--spacing-2xs)]",
|
|
66
|
+
"ds:[overflow-wrap:anywhere]"
|
|
67
|
+
].join(" "),
|
|
54
68
|
// FAB — circular floating action button. Glyph only; the
|
|
55
69
|
// label resolves into `aria-label`.
|
|
56
70
|
fab: [
|
|
@@ -68,17 +82,17 @@ const j = m(
|
|
|
68
82
|
{
|
|
69
83
|
variant: "pill",
|
|
70
84
|
size: "sm",
|
|
71
|
-
class: 'ds:
|
|
85
|
+
class: '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'
|
|
72
86
|
},
|
|
73
87
|
{
|
|
74
88
|
variant: "pill",
|
|
75
89
|
size: "md",
|
|
76
|
-
class: "ds:h-10 ds:ps-4 ds:pe-5 ds:text-[length:var(--font-size-base)] ds:[&_svg]:size-5"
|
|
90
|
+
class: "ds:min-h-10 ds:ps-4 ds:pe-5 ds:text-[length:var(--font-size-base)] ds:[&_svg]:size-5"
|
|
77
91
|
},
|
|
78
92
|
{
|
|
79
93
|
variant: "pill",
|
|
80
94
|
size: "lg",
|
|
81
|
-
class: "ds:h-12 ds:ps-5 ds:pe-6 ds:text-[length:var(--font-size-lg)] ds:[&_svg]:size-6"
|
|
95
|
+
class: "ds:min-h-12 ds:ps-5 ds:pe-6 ds:text-[length:var(--font-size-lg)] ds:[&_svg]:size-6"
|
|
82
96
|
},
|
|
83
97
|
// FAB — fixed square dimensions; the `sm` case mirrors the
|
|
84
98
|
// FloatingActionButton's pseudo-target expansion below the
|
|
@@ -105,7 +119,7 @@ const j = m(
|
|
|
105
119
|
size: "md"
|
|
106
120
|
}
|
|
107
121
|
}
|
|
108
|
-
),
|
|
122
|
+
), k = m("", {
|
|
109
123
|
variants: {
|
|
110
124
|
position: {
|
|
111
125
|
// `relative` so the `::before` pseudo touch-target (defined in
|
|
@@ -114,67 +128,71 @@ const j = m(
|
|
|
114
128
|
// this — `position: fixed` is itself a positioning context for
|
|
115
129
|
// descendants and pseudo-elements.
|
|
116
130
|
static: "ds:relative",
|
|
117
|
-
|
|
118
|
-
|
|
131
|
+
// Only ONE inset is set, so the cap must reserve the opposite gutter
|
|
132
|
+
// itself — otherwise a long label pins to its inset edge and spills
|
|
133
|
+
// off the other one. The arbitrary-PROPERTY form is load-bearing:
|
|
134
|
+
// `max-inline-size-[…]` is not a utility and emits nothing.
|
|
135
|
+
"bottom-end": "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))]",
|
|
136
|
+
"bottom-start": "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))]"
|
|
119
137
|
}
|
|
120
138
|
},
|
|
121
139
|
defaultVariants: { position: "static" }
|
|
122
140
|
});
|
|
123
|
-
function
|
|
141
|
+
function B(a, n) {
|
|
124
142
|
const s = a.replace(/\D/g, "");
|
|
125
143
|
if (s.length === 0)
|
|
126
144
|
return null;
|
|
127
|
-
const
|
|
128
|
-
return
|
|
145
|
+
const r = `https://wa.me/${s}`;
|
|
146
|
+
return n ? `${r}?text=${encodeURIComponent(n)}` : r;
|
|
129
147
|
}
|
|
130
|
-
const
|
|
148
|
+
const L = _(
|
|
131
149
|
({
|
|
132
150
|
phoneNumber: a,
|
|
133
|
-
message:
|
|
151
|
+
message: n,
|
|
134
152
|
variant: s = "pill",
|
|
135
|
-
size:
|
|
153
|
+
size: r = "md",
|
|
136
154
|
position: h,
|
|
137
155
|
label: g,
|
|
138
156
|
tone: w = "standard",
|
|
139
|
-
className:
|
|
140
|
-
...
|
|
141
|
-
},
|
|
142
|
-
const { t: p } =
|
|
143
|
-
() =>
|
|
144
|
-
[a,
|
|
157
|
+
className: x,
|
|
158
|
+
...i
|
|
159
|
+
}, z) => {
|
|
160
|
+
const { t: p } = j(), f = A(
|
|
161
|
+
() => B(a, n),
|
|
162
|
+
[a, n]
|
|
145
163
|
), e = g ?? p(s === "fab" ? "whatsApp.fabLabel" : w === "question" ? "whatsApp.questionPrompt" : "whatsApp.label"), y = [
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
].filter(Boolean).join(" "),
|
|
150
|
-
ref:
|
|
151
|
-
...
|
|
164
|
+
C({ variant: s, size: r }),
|
|
165
|
+
k({ position: h }),
|
|
166
|
+
x
|
|
167
|
+
].filter(Boolean).join(" "), d = f === null, v = {
|
|
168
|
+
ref: z,
|
|
169
|
+
...d ? {} : {
|
|
152
170
|
href: f,
|
|
153
171
|
target: "_blank",
|
|
154
172
|
rel: "noopener noreferrer"
|
|
155
173
|
},
|
|
156
|
-
"aria-disabled":
|
|
174
|
+
"aria-disabled": d ? !0 : void 0,
|
|
157
175
|
"data-component": "whatsapp-button",
|
|
158
176
|
"data-variant": s,
|
|
159
177
|
onClick: (l) => {
|
|
160
178
|
var b;
|
|
161
|
-
|
|
179
|
+
d && l.preventDefault(), (b = i.onClick) == null || b.call(i, l);
|
|
162
180
|
},
|
|
163
181
|
className: y
|
|
164
|
-
}, t =
|
|
182
|
+
}, t = d ? null : p("link.opensInNewTab", "Opens in a new tab");
|
|
165
183
|
if (s === "fab") {
|
|
166
184
|
const l = typeof e == "string" ? t ? `${e} — ${t}` : e : void 0;
|
|
167
|
-
return /* @__PURE__ */ c("a", { ...
|
|
168
|
-
/* @__PURE__ */
|
|
185
|
+
return /* @__PURE__ */ c("a", { ...i, ...v, "aria-label": l, children: [
|
|
186
|
+
/* @__PURE__ */ o(u, {}),
|
|
169
187
|
typeof e != "string" ? /* @__PURE__ */ c("span", { className: "ds:sr-only", children: [
|
|
170
188
|
e,
|
|
171
189
|
t ? ` — ${t}` : null
|
|
172
190
|
] }) : null
|
|
173
191
|
] });
|
|
174
192
|
}
|
|
175
|
-
return /* @__PURE__ */ c("a", { ...
|
|
176
|
-
/* @__PURE__ */
|
|
177
|
-
/* @__PURE__ */
|
|
193
|
+
return /* @__PURE__ */ c("a", { ...i, ...v, children: [
|
|
194
|
+
/* @__PURE__ */ o(u, {}),
|
|
195
|
+
/* @__PURE__ */ o("span", { children: e }),
|
|
178
196
|
t ? /* @__PURE__ */ c("span", { className: "ds:sr-only", children: [
|
|
179
197
|
" — ",
|
|
180
198
|
t
|
|
@@ -182,9 +200,9 @@ const N = A(
|
|
|
182
200
|
] });
|
|
183
201
|
}
|
|
184
202
|
);
|
|
185
|
-
|
|
203
|
+
L.displayName = "WhatsAppButton";
|
|
186
204
|
export {
|
|
187
|
-
|
|
205
|
+
L as W,
|
|
188
206
|
u as a
|
|
189
207
|
};
|
|
190
|
-
//# sourceMappingURL=whatsapp-button-
|
|
208
|
+
//# sourceMappingURL=whatsapp-button-Ca9towA4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whatsapp-button-Ca9towA4.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/* 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\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 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 composedClassName = [\n rootVariants({ variant, size }),\n positionVariants({ position }),\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 'aria-disabled': isDisabled ? true : undefined,\n 'data-component': 'whatsapp-button' as const,\n 'data-variant': variant,\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>{resolvedLabel}</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","buildWaMeUrl","phoneNumber","message","digits","base","WhatsAppButton","forwardRef","variant","size","position","label","tone","rest","ref","t","useTranslation","href","useMemo","resolvedLabel","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,GAAE,4lCAA2lC;AAAA,IAAA;AAAA,EAAA;AAGzmC;AAMA,MAAMC,IAAeC;AAAA,EACnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOE;AAAA,IACA;AAAA;AAAA;AAAA,IAGA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA,IACA;AAA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jB;AAAA,MACA,WAAWH;AAAA,IAAA,GAOPK,IAAsBJ,IACxB,OACAN,EAAE,sBAAsB,oBAAoB;AAEhD,QAAIP,MAAY,OAAO;AAKrB,YAAMkB,IACJ,OAAOP,KAAkB,WACrBM,IACE,GAAGN,CAAa,MAAMM,CAAmB,KACzCN,IACF;AACN,+BACG,KAAA,EAAG,GAAGN,GAAO,GAAGS,GAAmB,cAAYI,GAC9C,UAAA;AAAA,QAAA,gBAAA7B,EAACF,GAAA,EAAc;AAAA,QACd,OAAOwB,KAAkB,WACxB,gBAAAQ,EAAC,QAAA,EAAK,WAAU,cACb,UAAA;AAAA,UAAAR;AAAA,UACAM,IAAsB,MAAMA,CAAmB,KAAK;AAAA,QAAA,EAAA,CACvD,IACE;AAAA,MAAA,GACN;AAAA,IAEJ;AAEA,6BACG,KAAA,EAAG,GAAGZ,GAAO,GAAGS,GACf,UAAA;AAAA,MAAA,gBAAAzB,EAACF,GAAA,EAAc;AAAA,MACf,gBAAAE,EAAC,UAAM,UAAAsB,GAAc;AAAA,MACpBM,IACC,gBAAAE,EAAC,QAAA,EAAK,WAAU,cAAa,UAAA;AAAA,QAAA;AAAA,QAAIF;AAAA,MAAA,EAAA,CAAoB,IACnD;AAAA,IAAA,GACN;AAAA,EAEJ;AACF;AACAnB,EAAe,cAAc;"}
|
package/dist/agent-catalog.json
CHANGED
|
@@ -44,7 +44,11 @@ export interface PracticeProfileHeroProps extends Omit<ComponentPropsWithoutRef<
|
|
|
44
44
|
*/
|
|
45
45
|
badges?: PracticeProfileHeroBadge[];
|
|
46
46
|
/**
|
|
47
|
-
* Rendered at the inline-end of the heading row (right side on LTR)
|
|
47
|
+
* Rendered at the inline-end of the heading row (right side on LTR)
|
|
48
|
+
* from `sm` up. The heading row wraps, so on a phone the action drops
|
|
49
|
+
* onto its own line, starts flush with the practice name, and is free
|
|
50
|
+
* to shrink into the column rather than overflow it.
|
|
51
|
+
*
|
|
48
52
|
* Use for a "Book an appointment" `<Button>` or a share action.
|
|
49
53
|
*/
|
|
50
54
|
actionSlot?: ReactNode;
|