@alfadocs/ui-kit-debug 0.31.7 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{agenda-card-DtGlQde1.js → agenda-card-CFyWSX7Z.js} +2 -2
- package/dist/_chunks/{agenda-card-DtGlQde1.js.map → agenda-card-CFyWSX7Z.js.map} +1 -1
- package/dist/_chunks/{agenda-tray-CXmlwt2K.js → agenda-tray-By_asPN9.js} +2 -2
- package/dist/_chunks/{agenda-tray-CXmlwt2K.js.map → agenda-tray-By_asPN9.js.map} +1 -1
- package/dist/_chunks/{badge-B9Cr6iEB.js → badge-zsf5i5bH.js} +9 -2
- package/dist/_chunks/badge-zsf5i5bH.js.map +1 -0
- package/dist/_chunks/{benefit-card-B86DH-PE.js → benefit-card-_Sc-MGha.js} +18 -8
- package/dist/_chunks/benefit-card-_Sc-MGha.js.map +1 -0
- package/dist/_chunks/{booking-A4o9xI2n.js → booking-h_kBZM6M.js} +24 -26
- package/dist/_chunks/{booking-A4o9xI2n.js.map → booking-h_kBZM6M.js.map} +1 -1
- package/dist/_chunks/{card-CNri9ssR.js → card-DPmk26CL.js} +2 -2
- package/dist/_chunks/{card-CNri9ssR.js.map → card-DPmk26CL.js.map} +1 -1
- package/dist/_chunks/{contact-card-Dos7Tley.js → contact-card-Cf8Ktyt3.js} +2 -2
- package/dist/_chunks/{contact-card-Dos7Tley.js.map → contact-card-Cf8Ktyt3.js.map} +1 -1
- package/dist/_chunks/contact-profile-card-Ce-LIDU8.js +342 -0
- package/dist/_chunks/contact-profile-card-Ce-LIDU8.js.map +1 -0
- package/dist/_chunks/{editable-currency-cell-renderer-YvTwkFrD.js → editable-currency-cell-renderer-B9VRSV_S.js} +2 -2
- package/dist/_chunks/{editable-currency-cell-renderer-YvTwkFrD.js.map → editable-currency-cell-renderer-B9VRSV_S.js.map} +1 -1
- package/dist/_chunks/{key-value-pair-CYE7NSpM.js → key-value-pair-CkQIb9EG.js} +42 -32
- package/dist/_chunks/key-value-pair-CkQIb9EG.js.map +1 -0
- package/dist/_chunks/{map-view-WEWqXzof.js → map-view-knHSNLoe.js} +140 -128
- package/dist/_chunks/{map-view-WEWqXzof.js.map → map-view-knHSNLoe.js.map} +1 -1
- package/dist/_chunks/{operator-hero-BsjE-kJF.js → operator-hero-7LiiP7zi.js} +4 -4
- package/dist/_chunks/operator-hero-7LiiP7zi.js.map +1 -0
- package/dist/_chunks/{patient-search-CSDru7QW.js → patient-search-CBq62kmL.js} +2 -2
- package/dist/_chunks/{patient-search-CSDru7QW.js.map → patient-search-CBq62kmL.js.map} +1 -1
- package/dist/_chunks/{practice-results-CIkAdwRm.js → practice-results-Bw5fJTYF.js} +4 -4
- package/dist/_chunks/practice-results-Bw5fJTYF.js.map +1 -0
- package/dist/_chunks/{reviews-panel-Cjys8G8K.js → reviews-panel-B-18RBSn.js} +39 -36
- package/dist/_chunks/reviews-panel-B-18RBSn.js.map +1 -0
- package/dist/_chunks/{timeline-BZC7qGdy.js → timeline-DQa5Tyz4.js} +2 -2
- package/dist/_chunks/{timeline-BZC7qGdy.js.map → timeline-DQa5Tyz4.js.map} +1 -1
- package/dist/_chunks/{workflow-map-DfpjDZHK.js → workflow-map-uSiHbOWQ.js} +4 -4
- package/dist/_chunks/{workflow-map-DfpjDZHK.js.map → workflow-map-uSiHbOWQ.js.map} +1 -1
- package/dist/agent-catalog.json +28 -28
- package/dist/components/agenda-card/index.js +1 -1
- package/dist/components/agenda-tray/index.js +1 -1
- package/dist/components/badge/badge.d.ts.map +1 -1
- package/dist/components/badge/index.js +1 -1
- package/dist/components/benefit-card/benefit-card.d.ts.map +1 -1
- package/dist/components/benefit-card/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/card/card.d.ts.map +1 -1
- package/dist/components/card/index.js +1 -1
- package/dist/components/contact-card/index.js +1 -1
- package/dist/components/contact-profile-card/contact-profile-card.agent.d.ts +4 -0
- package/dist/components/contact-profile-card/contact-profile-card.agent.d.ts.map +1 -0
- package/dist/components/{practice-profile-card/practice-profile-card.d.ts → contact-profile-card/contact-profile-card.d.ts} +29 -9
- package/dist/components/contact-profile-card/contact-profile-card.d.ts.map +1 -0
- package/dist/components/contact-profile-card/index.d.ts +4 -0
- package/dist/components/contact-profile-card/index.d.ts.map +1 -0
- package/dist/components/contact-profile-card/index.js +8 -0
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/key-value-pair/index.js +1 -1
- package/dist/components/key-value-pair/key-value-pair.d.ts.map +1 -1
- package/dist/components/map-view/index.js +1 -1
- package/dist/components/map-view/map-view.d.ts +1 -1
- package/dist/components/map-view/map-view.d.ts.map +1 -1
- package/dist/components/operator-hero/index.js +1 -1
- package/dist/components/operator-hero/operator-hero.d.ts +1 -1
- package/dist/components/patient-search/index.js +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/practice-results/practice-results.d.ts.map +1 -1
- package/dist/components/reviews-panel/index.js +1 -1
- package/dist/components/reviews-panel/reviews-panel.d.ts.map +1 -1
- package/dist/components/timeline/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +4 -1
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +5 -2
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +4 -1
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +5 -2
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +4 -1
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +5 -2
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +4 -1
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +5 -2
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +4 -1
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +5 -2
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +4 -1
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +5 -2
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +4 -1
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +5 -2
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +4 -1
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +5 -2
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +4 -1
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +5 -2
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +4 -1
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +5 -2
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +4 -1
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +5 -2
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +4 -1
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +5 -2
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +4 -1
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +5 -2
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +4 -1
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +5 -2
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +4 -1
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +5 -2
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +4 -1
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +5 -2
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +4 -1
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +5 -2
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +4 -1
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +5 -2
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +112 -112
- package/dist/locales/ar.json +4 -1
- package/dist/locales/de.json +4 -1
- package/dist/locales/el.json +4 -1
- package/dist/locales/en.json +4 -1
- package/dist/locales/es.json +4 -1
- package/dist/locales/fr.json +4 -1
- package/dist/locales/hi.json +4 -1
- package/dist/locales/it.json +4 -1
- package/dist/locales/ja.json +4 -1
- package/dist/locales/nl.json +4 -1
- package/dist/locales/pl.json +4 -1
- package/dist/locales/pt.json +4 -1
- package/dist/locales/ro.json +4 -1
- package/dist/locales/ru.json +4 -1
- package/dist/locales/sq.json +4 -1
- package/dist/locales/sv.json +4 -1
- package/dist/locales/tr.json +4 -1
- package/dist/locales/zh.json +4 -1
- package/dist/tokens.css +1 -1
- package/package.json +4 -4
- package/dist/_chunks/badge-B9Cr6iEB.js.map +0 -1
- package/dist/_chunks/benefit-card-B86DH-PE.js.map +0 -1
- package/dist/_chunks/key-value-pair-CYE7NSpM.js.map +0 -1
- package/dist/_chunks/operator-hero-BsjE-kJF.js.map +0 -1
- package/dist/_chunks/practice-profile-card-DwZo7ggW.js +0 -305
- package/dist/_chunks/practice-profile-card-DwZo7ggW.js.map +0 -1
- package/dist/_chunks/practice-results-CIkAdwRm.js.map +0 -1
- package/dist/_chunks/reviews-panel-Cjys8G8K.js.map +0 -1
- package/dist/components/practice-profile-card/index.d.ts +0 -4
- package/dist/components/practice-profile-card/index.d.ts.map +0 -1
- package/dist/components/practice-profile-card/index.js +0 -8
- package/dist/components/practice-profile-card/practice-profile-card.agent.d.ts +0 -4
- package/dist/components/practice-profile-card/practice-profile-card.agent.d.ts.map +0 -1
- package/dist/components/practice-profile-card/practice-profile-card.d.ts.map +0 -1
- /package/dist/components/{practice-profile-card → contact-profile-card}/index.js.map +0 -0
|
@@ -147,7 +147,7 @@ const h = t(
|
|
|
147
147
|
"div",
|
|
148
148
|
{
|
|
149
149
|
ref: r,
|
|
150
|
-
className: ["ds:p-[var(--spacing-md)] ds:flex-1
|
|
150
|
+
className: ["ds:p-[var(--spacing-md)] ds:flex-1", a].filter(Boolean).join(" "),
|
|
151
151
|
...e
|
|
152
152
|
}
|
|
153
153
|
)
|
|
@@ -176,4 +176,4 @@ const O = Object.assign(m, {
|
|
|
176
176
|
export {
|
|
177
177
|
O as C
|
|
178
178
|
};
|
|
179
|
-
//# sourceMappingURL=card-
|
|
179
|
+
//# sourceMappingURL=card-DPmk26CL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card-CNri9ssR.js","sources":["../../src/components/card/card.tsx"],"sourcesContent":["import {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useId,\n useState,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n} from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\n/* ------------------------------------------------------------------ */\n/* Context */\n/* ------------------------------------------------------------------ */\n\ninterface CardContextValue {\n headerId: string;\n interactive: boolean;\n registerHeader: () => void;\n}\n\nconst CardContext = createContext<CardContextValue>({\n headerId: '',\n interactive: false,\n registerHeader: () => {},\n});\n\n/* ------------------------------------------------------------------ */\n/* Variants */\n/* ------------------------------------------------------------------ */\n\nconst cardVariants = cva(\n [\n 'ds:rounded-[var(--radius-lg)] ds:text-[var(--card-foreground)]',\n 'ds:overflow-hidden',\n 'ds:flex ds:flex-col',\n ].join(' '),\n {\n variants: {\n // 0.31.5: accessible-theme bumps the border from 1px → 2px so\n // the boundary reads at the strict-AA / AAA contrast bar — at\n // 1px the `--card-border` (#00000080 light / #ffffff52 dark)\n // clears 3:1 luminance but reads as a hairline on tall cards.\n // Light + dark keep 1px. Forced-colours users get `border-2 +\n // CanvasText` as a parallel safety net.\n variant: {\n default:\n 'ds:bg-[var(--card)] ds:border ds:border-[color:var(--card-border)] ds:[.theme-accessible_&]:border-2',\n outlined:\n 'ds:bg-[var(--card)] ds:border ds:border-[color:var(--border)] ds:[.theme-accessible_&]:border-2',\n elevated:\n 'ds:bg-[var(--card)] ds:border ds:border-[color:var(--card-border)] ds:shadow-[var(--shadow-card)] ds:[.theme-accessible_&]:border-2',\n },\n interactive: {\n true: [\n 'ds:cursor-pointer',\n 'ds:transition-shadow ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:hover:shadow-[var(--shadow-hover)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:min-h-[var(--min-target-size)]',\n ].join(' '),\n false: '',\n },\n // `stretch: true` fills the parent layout cell (grid / flex) so a\n // row of Cards ends up with matching heights. Combined with the\n // `flex-1` on `Card.Body`, the footer naturally pins to the bottom.\n stretch: {\n true: 'ds:h-full ds:self-stretch',\n false: '',\n },\n },\n defaultVariants: {\n variant: 'default',\n interactive: false,\n stretch: false,\n },\n },\n);\n\n/* ------------------------------------------------------------------ */\n/* Types */\n/* ------------------------------------------------------------------ */\n\nexport interface CardProps\n extends\n Omit<HTMLAttributes<HTMLElement>, 'role'>,\n VariantProps<typeof cardVariants> {\n variant?: 'default' | 'outlined' | 'elevated';\n interactive?: boolean;\n /**\n * Stretch the Card to fill its parent layout cell. Use on every Card in\n * a dashboard row so siblings end up with matching heights, and the\n * `Card.Body` + `Card.Footer` flex naturally pin the footer to the\n * bottom. Grid cells already `align-items: stretch` by default, but an\n * explicit `h-full` keeps the behaviour robust under flex parents too.\n */\n stretch?: boolean;\n asChild?: boolean;\n children: ReactNode;\n}\n\n/* ------------------------------------------------------------------ */\n/* Root */\n/* ------------------------------------------------------------------ */\n\nconst CardRoot = forwardRef<HTMLElement, CardProps>(\n (\n {\n variant = 'default',\n interactive = false,\n stretch = false,\n asChild = false,\n className,\n children,\n onClick,\n onKeyDown,\n ...props\n },\n ref,\n ) => {\n const headerId = useId();\n const [hasHeader, setHasHeader] = useState(false);\n const registerHeader = useCallback(() => setHasHeader(true), []);\n\n const handleKeyDown = (e: KeyboardEvent<HTMLElement>) => {\n if (interactive && (e.key === 'Enter' || e.key === ' ')) {\n e.preventDefault();\n (e.currentTarget as HTMLElement).click();\n }\n onKeyDown?.(e);\n };\n\n // When asChild=true the consumer provides its own element (<a>, <button>)\n // which already carries the correct role and tabIndex — don't override them.\n const interactiveProps = interactive\n ? {\n ...(asChild ? {} : { role: 'button' as const, tabIndex: 0 }),\n onKeyDown: handleKeyDown,\n onClick,\n }\n : { onClick };\n\n // `<article>` is the default semantic root, but axe's\n // `aria-allowed-role` rule forbids `role=\"button\"` on `<article>`.\n // When the card is interactive we switch to `<div>` so the explicit\n // role is valid. Consumers can still pass `asChild` to provide their\n // own anchor / button element when they want stronger semantics.\n const Comp = asChild ? Slot : interactive ? 'div' : 'article';\n\n return (\n <CardContext.Provider\n value={{ headerId, interactive: interactive ?? false, registerHeader }}\n >\n <Comp\n ref={ref as React.Ref<HTMLDivElement>}\n aria-labelledby={hasHeader ? headerId : undefined}\n data-component=\"card\"\n className={cardVariants({\n variant,\n interactive: interactive ?? false,\n stretch: stretch ?? false,\n className,\n })}\n {...interactiveProps}\n {...props}\n >\n {children}\n </Comp>\n </CardContext.Provider>\n );\n },\n);\nCardRoot.displayName = 'Card';\n\n/* ------------------------------------------------------------------ */\n/* Header */\n/* ------------------------------------------------------------------ */\n\nconst CardHeader = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const { headerId, registerHeader } = useContext(CardContext);\n\n // Notify root that a header is present so aria-labelledby is applied.\n const callbackRef = useCallback(\n (node: HTMLDivElement | null) => {\n if (node) registerHeader();\n if (typeof ref === 'function') ref(node);\n else if (ref)\n (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;\n },\n [ref, registerHeader],\n );\n\n return (\n <div\n ref={callbackRef}\n id={headerId}\n className={[\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:p-[var(--spacing-md)] ds:pb-0',\n // Wrap policy for header text content. Scoped to DIRECT children\n // (h1–h6 / p / div) and using `break-word` instead of `anywhere`\n // so natural-language titles wrap at word boundaries first; only\n // genuinely unbreakable strings (URLs, hashes) break mid-word\n // when they'd otherwise overflow. The previous `[&_*]:` cascade\n // applied `overflow-wrap: anywhere` to every descendant, which\n // chopped natural-language labels mid-character inside narrow\n // contexts (DescriptionList rows in a Carousel slide).\n 'ds:[&>*]:break-normal ds:[&>*]:[overflow-wrap:break-word]',\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n {...props}\n />\n );\n },\n);\nCardHeader.displayName = 'Card.Header';\n\n/* ------------------------------------------------------------------ */\n/* Media */\n/* ------------------------------------------------------------------ */\n\nconst CardMedia = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={[\n 'ds:overflow-hidden ds:[&_img]:w-full ds:[&_img]:h-auto ds:[&_img]:[object-fit:cover] ds:[&_video]:w-full',\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n {...props}\n />\n ),\n);\nCardMedia.displayName = 'Card.Media';\n\n/* ------------------------------------------------------------------ */\n/* Body */\n/* ------------------------------------------------------------------ */\n\nconst CardBody = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={['ds:p-[var(--spacing-md)] ds:flex-1 ds:text-start', className]\n .filter(Boolean)\n .join(' ')}\n {...props}\n />\n ),\n);\nCardBody.displayName = 'Card.Body';\n\n/* ------------------------------------------------------------------ */\n/* Footer */\n/* ------------------------------------------------------------------ */\n\nconst CardFooter = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={[\n 'ds:flex ds:items-center ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)] ds:pt-0',\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n {...props}\n />\n ),\n);\nCardFooter.displayName = 'Card.Footer';\n\n/* ------------------------------------------------------------------ */\n/* Compound export */\n/* ------------------------------------------------------------------ */\n\nexport const Card = Object.assign(CardRoot, {\n Header: CardHeader,\n Media: CardMedia,\n Body: CardBody,\n Footer: CardFooter,\n});\n\nexport type { VariantProps as CardVariantProps };\n"],"names":["CardContext","createContext","cardVariants","cva","CardRoot","forwardRef","variant","interactive","stretch","asChild","className","children","onClick","onKeyDown","props","ref","headerId","useId","hasHeader","setHasHeader","useState","registerHeader","useCallback","interactiveProps","e","Comp","Slot","jsx","CardHeader","useContext","callbackRef","node","CardMedia","CardBody","CardFooter","Card"],"mappings":";;;;AAwBA,MAAMA,IAAcC,EAAgC;AAAA,EAClD,UAAU;AAAA,EACV,aAAa;AAAA,EACb,gBAAgB,MAAM;AAAA,EAAC;AACzB,CAAC,GAMKC,IAAeC;AAAA,EACnB;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,EAAA,EACA,KAAK,GAAG;AAAA,EACV;AAAA,IACE,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAOR,SAAS;AAAA,QACP,SACE;AAAA,QACF,UACE;AAAA,QACF,UACE;AAAA,MAAA;AAAA,MAEJ,aAAa;AAAA,QACX,MAAM;AAAA,UACJ;AAAA,UACA;AAAA,UACA;AA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EAAU,cAAc;AAMxB,MAAMC,IAAW5B;AAAA,EACf,CAAC,EAAE,WAAAK,GAAW,GAAGI,EAAA,GAASC,MACxB,gBAAAY;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAZ;AAAA,MACA,WAAW,CAAC,oDAAoDL,CAAS,EACtE,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,MACV,GAAGI;AAAA,IAAA;AAAA,EAAA;AAGV;AACAmB,EAAS,cAAc;AAMvB,MAAMC,IAAa7B;AAAA,EACjB,CAAC,EAAE,WAAAK,GAAW,GAAGI,EAAA,GAASC,MACxB,gBAAAY;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAZ;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACAL;AAAA,MAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,MACV,GAAGI;AAAA,IAAA;AAAA,EAAA;AAGV;AACAoB,EAAW,cAAc;AAMlB,MAAMC,IAAO,OAAO,OAAO/B,GAAU;AAAA,EAC1C,QAAQwB;AAAA,EACR,OAAOI;AAAA,EACP,MAAMC;AAAA,EACN,QAAQC;AACV,CAAC;"}
|
|
1
|
+
{"version":3,"file":"card-DPmk26CL.js","sources":["../../src/components/card/card.tsx"],"sourcesContent":["import {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useId,\n useState,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactNode,\n} from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\n/* ------------------------------------------------------------------ */\n/* Context */\n/* ------------------------------------------------------------------ */\n\ninterface CardContextValue {\n headerId: string;\n interactive: boolean;\n registerHeader: () => void;\n}\n\nconst CardContext = createContext<CardContextValue>({\n headerId: '',\n interactive: false,\n registerHeader: () => {},\n});\n\n/* ------------------------------------------------------------------ */\n/* Variants */\n/* ------------------------------------------------------------------ */\n\nconst cardVariants = cva(\n [\n 'ds:rounded-[var(--radius-lg)] ds:text-[var(--card-foreground)]',\n 'ds:overflow-hidden',\n 'ds:flex ds:flex-col',\n ].join(' '),\n {\n variants: {\n // 0.31.5: accessible-theme bumps the border from 1px → 2px so\n // the boundary reads at the strict-AA / AAA contrast bar — at\n // 1px the `--card-border` (#00000080 light / #ffffff52 dark)\n // clears 3:1 luminance but reads as a hairline on tall cards.\n // Light + dark keep 1px. Forced-colours users get `border-2 +\n // CanvasText` as a parallel safety net.\n variant: {\n default:\n 'ds:bg-[var(--card)] ds:border ds:border-[color:var(--card-border)] ds:[.theme-accessible_&]:border-2',\n outlined:\n 'ds:bg-[var(--card)] ds:border ds:border-[color:var(--border)] ds:[.theme-accessible_&]:border-2',\n elevated:\n 'ds:bg-[var(--card)] ds:border ds:border-[color:var(--card-border)] ds:shadow-[var(--shadow-card)] ds:[.theme-accessible_&]:border-2',\n },\n interactive: {\n true: [\n 'ds:cursor-pointer',\n 'ds:transition-shadow ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:hover:shadow-[var(--shadow-hover)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:min-h-[var(--min-target-size)]',\n ].join(' '),\n false: '',\n },\n // `stretch: true` fills the parent layout cell (grid / flex) so a\n // row of Cards ends up with matching heights. Combined with the\n // `flex-1` on `Card.Body`, the footer naturally pins to the bottom.\n stretch: {\n true: 'ds:h-full ds:self-stretch',\n false: '',\n },\n },\n defaultVariants: {\n variant: 'default',\n interactive: false,\n stretch: false,\n },\n },\n);\n\n/* ------------------------------------------------------------------ */\n/* Types */\n/* ------------------------------------------------------------------ */\n\nexport interface CardProps\n extends\n Omit<HTMLAttributes<HTMLElement>, 'role'>,\n VariantProps<typeof cardVariants> {\n variant?: 'default' | 'outlined' | 'elevated';\n interactive?: boolean;\n /**\n * Stretch the Card to fill its parent layout cell. Use on every Card in\n * a dashboard row so siblings end up with matching heights, and the\n * `Card.Body` + `Card.Footer` flex naturally pin the footer to the\n * bottom. Grid cells already `align-items: stretch` by default, but an\n * explicit `h-full` keeps the behaviour robust under flex parents too.\n */\n stretch?: boolean;\n asChild?: boolean;\n children: ReactNode;\n}\n\n/* ------------------------------------------------------------------ */\n/* Root */\n/* ------------------------------------------------------------------ */\n\nconst CardRoot = forwardRef<HTMLElement, CardProps>(\n (\n {\n variant = 'default',\n interactive = false,\n stretch = false,\n asChild = false,\n className,\n children,\n onClick,\n onKeyDown,\n ...props\n },\n ref,\n ) => {\n const headerId = useId();\n const [hasHeader, setHasHeader] = useState(false);\n const registerHeader = useCallback(() => setHasHeader(true), []);\n\n const handleKeyDown = (e: KeyboardEvent<HTMLElement>) => {\n if (interactive && (e.key === 'Enter' || e.key === ' ')) {\n e.preventDefault();\n (e.currentTarget as HTMLElement).click();\n }\n onKeyDown?.(e);\n };\n\n // When asChild=true the consumer provides its own element (<a>, <button>)\n // which already carries the correct role and tabIndex — don't override them.\n const interactiveProps = interactive\n ? {\n ...(asChild ? {} : { role: 'button' as const, tabIndex: 0 }),\n onKeyDown: handleKeyDown,\n onClick,\n }\n : { onClick };\n\n // `<article>` is the default semantic root, but axe's\n // `aria-allowed-role` rule forbids `role=\"button\"` on `<article>`.\n // When the card is interactive we switch to `<div>` so the explicit\n // role is valid. Consumers can still pass `asChild` to provide their\n // own anchor / button element when they want stronger semantics.\n const Comp = asChild ? Slot : interactive ? 'div' : 'article';\n\n return (\n <CardContext.Provider\n value={{ headerId, interactive: interactive ?? false, registerHeader }}\n >\n <Comp\n ref={ref as React.Ref<HTMLDivElement>}\n aria-labelledby={hasHeader ? headerId : undefined}\n data-component=\"card\"\n className={cardVariants({\n variant,\n interactive: interactive ?? false,\n stretch: stretch ?? false,\n className,\n })}\n {...interactiveProps}\n {...props}\n >\n {children}\n </Comp>\n </CardContext.Provider>\n );\n },\n);\nCardRoot.displayName = 'Card';\n\n/* ------------------------------------------------------------------ */\n/* Header */\n/* ------------------------------------------------------------------ */\n\nconst CardHeader = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const { headerId, registerHeader } = useContext(CardContext);\n\n // Notify root that a header is present so aria-labelledby is applied.\n const callbackRef = useCallback(\n (node: HTMLDivElement | null) => {\n if (node) registerHeader();\n if (typeof ref === 'function') ref(node);\n else if (ref)\n (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;\n },\n [ref, registerHeader],\n );\n\n return (\n <div\n ref={callbackRef}\n id={headerId}\n className={[\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:p-[var(--spacing-md)] ds:pb-0',\n // Wrap policy for header text content. Scoped to DIRECT children\n // (h1–h6 / p / div) and using `break-word` instead of `anywhere`\n // so natural-language titles wrap at word boundaries first; only\n // genuinely unbreakable strings (URLs, hashes) break mid-word\n // when they'd otherwise overflow. The previous `[&_*]:` cascade\n // applied `overflow-wrap: anywhere` to every descendant, which\n // chopped natural-language labels mid-character inside narrow\n // contexts (DescriptionList rows in a Carousel slide).\n 'ds:[&>*]:break-normal ds:[&>*]:[overflow-wrap:break-word]',\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n {...props}\n />\n );\n },\n);\nCardHeader.displayName = 'Card.Header';\n\n/* ------------------------------------------------------------------ */\n/* Media */\n/* ------------------------------------------------------------------ */\n\nconst CardMedia = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={[\n 'ds:overflow-hidden ds:[&_img]:w-full ds:[&_img]:h-auto ds:[&_img]:[object-fit:cover] ds:[&_video]:w-full',\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n {...props}\n />\n ),\n);\nCardMedia.displayName = 'Card.Media';\n\n/* ------------------------------------------------------------------ */\n/* Body */\n/* ------------------------------------------------------------------ */\n\nconst CardBody = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n // `text-start` is INTENTIONALLY OMITTED from the baseline so a\n // consumer `className=\"ds:text-center\"` (or `text-end`) wins the\n // cascade without source-order trickery. Tailwind 4 emits its\n // utilities in alphabetical-ish order in tokens.css, so a kit\n // baseline `text-start` would land AFTER a consumer\n // `text-center` and override it — exactly the cascade trap that\n // bit Badge `bg-muted/20` earlier. Without a baseline, the body\n // inherits its parent's `text-align` (always `start` in\n // browsers' default cascade — same render as before for every\n // existing consumer), and consumer overrides apply with no\n // surprises. Pass `className=\"ds:text-start\"` explicitly if you\n // need to override a parent that set `text-center`.\n className={['ds:p-[var(--spacing-md)] ds:flex-1', className]\n .filter(Boolean)\n .join(' ')}\n {...props}\n />\n ),\n);\nCardBody.displayName = 'Card.Body';\n\n/* ------------------------------------------------------------------ */\n/* Footer */\n/* ------------------------------------------------------------------ */\n\nconst CardFooter = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={[\n 'ds:flex ds:items-center ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)] ds:pt-0',\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n {...props}\n />\n ),\n);\nCardFooter.displayName = 'Card.Footer';\n\n/* ------------------------------------------------------------------ */\n/* Compound export */\n/* ------------------------------------------------------------------ */\n\nexport const Card = Object.assign(CardRoot, {\n Header: CardHeader,\n Media: CardMedia,\n Body: CardBody,\n Footer: CardFooter,\n});\n\nexport type { VariantProps as CardVariantProps };\n"],"names":["CardContext","createContext","cardVariants","cva","CardRoot","forwardRef","variant","interactive","stretch","asChild","className","children","onClick","onKeyDown","props","ref","headerId","useId","hasHeader","setHasHeader","useState","registerHeader","useCallback","interactiveProps","e","Comp","Slot","jsx","CardHeader","useContext","callbackRef","node","CardMedia","CardBody","CardFooter","Card"],"mappings":";;;;AAwBA,MAAMA,IAAcC,EAAgC;AAAA,EAClD,UAAU;AAAA,EACV,aAAa;AAAA,EACb,gBAAgB,MAAM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AAAA,IAAA;AAAA,EAGV;AACF;AACAc,EAAW,cAAc;AAMzB,MAAMI,IAAY3B;AAAA,EAChB,CAAC,EAAE,WAAAK,GAAW,GAAGI,EAAA,GAASC,MACxB,gBAAAY;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAZ;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACAL;AAAA,MAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,MACV,GAAGI;AAAA,IAAA;AAAA,EAAA;AAGV;AACAkB,EAAU,cAAc;AAMxB,MAAMC,IAAW5B;AAAA,EACf,CAAC,EAAE,WAAAK,GAAW,GAAGI,EAAA,GAASC,MACxB,gBAAAY;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAZ;AAAA,MAaA,WAAW,CAAC,sCAAsCL,CAAS,EACxD,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,MACV,GAAGI;AAAA,IAAA;AAAA,EAAA;AAGV;AACAmB,EAAS,cAAc;AAMvB,MAAMC,IAAa7B;AAAA,EACjB,CAAC,EAAE,WAAAK,GAAW,GAAGI,EAAA,GAASC,MACxB,gBAAAY;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAZ;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACAL;AAAA,MAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,MACV,GAAGI;AAAA,IAAA;AAAA,EAAA;AAGV;AACAoB,EAAW,cAAc;AAMlB,MAAMC,IAAO,OAAO,OAAO/B,GAAU;AAAA,EAC1C,QAAQwB;AAAA,EACR,OAAOI;AAAA,EACP,MAAMC;AAAA,EACN,QAAQC;AACV,CAAC;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as t, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as i, Fragment as b } from "react";
|
|
3
3
|
import { useTranslation as k } from "react-i18next";
|
|
4
|
-
import { C as o } from "./card-
|
|
4
|
+
import { C as o } from "./card-DPmk26CL.js";
|
|
5
5
|
import { L as p } from "./link-DrD_cRUg.js";
|
|
6
6
|
import { M as v } from "./map-pin-B8STOPMJ.js";
|
|
7
7
|
function L(s) {
|
|
@@ -118,4 +118,4 @@ const M = Object.assign(f, {
|
|
|
118
118
|
export {
|
|
119
119
|
M as C
|
|
120
120
|
};
|
|
121
|
-
//# sourceMappingURL=contact-card-
|
|
121
|
+
//# sourceMappingURL=contact-card-Cf8Ktyt3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contact-card-Dos7Tley.js","sources":["../../src/components/contact-card/contact-card.tsx"],"sourcesContent":["import {\n forwardRef,\n Fragment,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { MapPin } from 'lucide-react';\nimport { Card } from '../card/card';\nimport { Link } from '../link/link';\n\n/* ------------------------------------------------------------------ */\n/* Phone helper */\n/* ------------------------------------------------------------------ */\n\n/**\n * Strip everything that's not a digit or a leading `+` so the display\n * string (`\"+49 (0)89 51871478\"`) becomes a valid `tel:` URI target\n * (`\"tel:+498951871478\"`). RFC 3966 allows visual separators, but most\n * dialer apps still trip on them — collapsing to a strict E.164-ish\n * form is the safe default. The `(0)` trunk-prefix convention is\n * intentionally dropped: it's not a real digit in international\n * dialling, only a hint for in-country dialling.\n */\nfunction buildTelHref(display: string): string {\n const trunkStripped = display.replace(/\\(0\\)/g, '');\n const digits = trunkStripped.replace(/[^\\d+]/g, '');\n return `tel:${digits}`;\n}\n\n/* ------------------------------------------------------------------ */\n/* Root */\n/* ------------------------------------------------------------------ */\n\nexport interface ContactCardProps extends Omit<\n HTMLAttributes<HTMLElement>,\n 'title'\n> {\n /**\n * Optional card heading rendered inside `Card.Header` as an `<h2>` —\n * e.g. \"Contact information\" above one or more office blocks. Omit\n * when the card sits inside a section that already has a heading.\n */\n title?: ReactNode;\n /**\n * `Card` variant. Defaults to `default` (subtle border on `--card`\n * surface) to match the marketing site's treatment.\n */\n variant?: 'default' | 'outlined' | 'elevated';\n children: ReactNode;\n}\n\nconst ContactCardRoot = forwardRef<HTMLElement, ContactCardProps>(\n ({ title, variant = 'default', className, children, ...props }, ref) => (\n <Card\n ref={ref}\n variant={variant}\n data-component=\"contact-card\"\n className={className}\n {...props}\n >\n {title !== undefined ? (\n <Card.Header>\n <h2 className=\"type-title-card ds:text-foreground\">{title}</h2>\n </Card.Header>\n ) : null}\n <Card.Body\n className={[\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-md)]',\n // Tighten the body padding-block-start when a header sits\n // above so the whole card reads as one cohesive block rather\n // than two stacked sections — Card.Header already paints\n // bottom padding via `pb-0` + Card.Body's `p-md`.\n ].join(' ')}\n >\n {children}\n </Card.Body>\n </Card>\n ),\n);\nContactCardRoot.displayName = 'ContactCard';\n\n/* ------------------------------------------------------------------ */\n/* Office */\n/* ------------------------------------------------------------------ */\n\nexport interface ContactCardOfficeProps extends Omit<\n HTMLAttributes<HTMLElement>,\n 'children'\n> {\n /**\n * Office name — rendered as the block's bold label next to the pin\n * glyph. Not a heading element by default so a card with multiple\n * offices doesn't fragment the heading outline; pass `nameAs=\"h3\"`\n * (or `h4` etc.) when the consuming page wants a real heading.\n */\n name: ReactNode;\n /**\n * Address lines in document order, one per `<br>`-equivalent. Country\n * / region / postcode formatting is the consumer's responsibility —\n * the kit only inserts the line breaks.\n */\n lines: ReadonlyArray<string>;\n /**\n * VAT / tax-ID number. Rendered on its own line with the kit-owned\n * `ui.contactCard.vatNumberLabel` prefix.\n */\n vatNumber?: string;\n /**\n * Phone number as it should display (with separators, parens, trunk\n * prefix). The kit normalises this into a `tel:` URI internally —\n * see `buildTelHref` for the rules.\n */\n phone?: string;\n /** Heading element used for `name`. Defaults to a non-heading `<p>`. */\n nameAs?: 'p' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n}\n\nconst ContactCardOffice = forwardRef<HTMLElement, ContactCardOfficeProps>(\n (\n { name, lines, vatNumber, phone, nameAs = 'p', className, ...props },\n ref,\n ) => {\n const { t } = useTranslation();\n const NameTag = nameAs as 'p';\n\n return (\n <address\n ref={ref as React.Ref<HTMLElement>}\n data-component=\"contact-card-office\"\n className={[\n // `not-italic` overrides the UA default for `<address>` since\n // the kit's type ramp already encodes intent — italic would\n // double up with a heading-bold name and read as emphasis.\n 'ds:not-italic ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]',\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n {...props}\n >\n <NameTag className=\"ds:m-0 ds:flex ds:items-center ds:gap-[var(--spacing-xs)] type-label ds:font-semibold ds:text-foreground\">\n <MapPin\n aria-hidden=\"true\"\n className=\"ds:size-[1.25em] ds:text-primary ds:shrink-0\"\n />\n <span>{name}</span>\n </NameTag>\n <div className=\"type-body-sm ds:text-foreground ds:[unicode-bidi:isolate]\">\n {lines.map((line, i) => (\n <Fragment key={i}>\n {line}\n {i < lines.length - 1 ? <br /> : null}\n </Fragment>\n ))}\n </div>\n {vatNumber ? (\n <div className=\"type-body-sm ds:text-muted-foreground\">\n <span className=\"ds:me-[var(--spacing-2xs)]\">\n {t('contactCard.vatNumberLabel')}\n </span>\n <span className=\"ds:[unicode-bidi:isolate]\">{vatNumber}</span>\n </div>\n ) : null}\n {phone ? (\n <div className=\"type-body-sm ds:text-muted-foreground ds:inline-flex ds:items-baseline ds:gap-[var(--spacing-2xs)] ds:flex-wrap\">\n <span>{t('contactCard.phoneLabel')}</span>\n <Link href={buildTelHref(phone)} intent=\"default\">\n <span className=\"ds:[unicode-bidi:isolate]\">{phone}</span>\n </Link>\n </div>\n ) : null}\n </address>\n );\n },\n);\nContactCardOffice.displayName = 'ContactCard.Office';\n\n/* ------------------------------------------------------------------ */\n/* Links */\n/* ------------------------------------------------------------------ */\n\nexport type ContactCardLinksProps = HTMLAttributes<HTMLUListElement>;\n\nconst ContactCardLinks = forwardRef<HTMLUListElement, ContactCardLinksProps>(\n ({ className, children, ...props }, ref) => (\n <ul\n ref={ref}\n data-component=\"contact-card-links\"\n className={[\n 'ds:m-0 ds:p-0 ds:list-none',\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]',\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n {...props}\n >\n {children}\n </ul>\n ),\n);\nContactCardLinks.displayName = 'ContactCard.Links';\n\n/* ------------------------------------------------------------------ */\n/* Link */\n/* ------------------------------------------------------------------ */\n\nexport interface ContactCardLinkProps {\n href: string;\n /**\n * Leading glyph. Rendered with `--primary` so the link list reads as\n * a coloured-icon menu (matches the marketing site's treatment).\n * Consumers pass a bare lucide-react icon; the kit handles colour /\n * size / aria-hidden.\n */\n icon: ReactNode;\n /** Open in a new tab — adds `target=\"_blank\"` and `rel` via `Link`. */\n external?: boolean;\n children: ReactNode;\n}\n\nconst ContactCardLink = forwardRef<HTMLLIElement, ContactCardLinkProps>(\n ({ href, icon, external, children }, ref) => (\n <li ref={ref} className=\"ds:m-0\">\n <Link\n href={href}\n external={external}\n // Wrap in a `text-primary` span so the lucide glyph (which uses\n // `currentColor`) picks up the brand tint without the consumer\n // having to thread a className through every icon. Link adds\n // its own aria-hidden wrapper + `[&_svg]:size-[1em]` outside\n // this; the colour cascades through.\n startIcon={<span className=\"ds:text-primary\">{icon}</span>}\n >\n {children}\n </Link>\n </li>\n ),\n);\nContactCardLink.displayName = 'ContactCard.Link';\n\n/* ------------------------------------------------------------------ */\n/* Compound export */\n/* ------------------------------------------------------------------ */\n\nexport const ContactCard = Object.assign(ContactCardRoot, {\n Office: ContactCardOffice,\n Links: ContactCardLinks,\n Link: ContactCardLink,\n});\n\nexport { buildTelHref as __buildTelHref };\n"],"names":["buildTelHref","display","ContactCardRoot","forwardRef","title","variant","className","children","props","ref","jsxs","Card","jsx","ContactCardOffice","name","lines","vatNumber","phone","nameAs","t","useTranslation","NameTag","MapPin","line","i","Fragment","Link","ContactCardLinks","ContactCardLink","href","icon","external","ContactCard"],"mappings":";;;;;;AAwBA,SAASA,EAAaC,GAAyB;AAG7C,SAAO,OAFeA,E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AAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,MACV,GAAGE;AAAA,MAEH,UAAAD;AAAA,IAAA;AAAA,EAAA;AAGP;AACAoB,EAAiB,cAAc;AAoB/B,MAAMC,IAAkBzB;AAAA,EACtB,CAAC,EAAE,MAAA0B,GAAM,MAAAC,GAAM,UAAAC,GAAU,UAAAxB,EAAA,GAAYE,MACnC,gBAAAG,EAAC,MAAA,EAAG,KAAAH,GAAU,WAAU,UACtB,UAAA,gBAAAG;AAAA,IAACc;AAAA,IAAA;AAAA,MACC,MAAAG;AAAA,MACA,UAAAE;AAAA,MAMA,WAAW,gBAAAnB,EAAC,QAAA,EAAK,WAAU,mBAAmB,UAAAkB,GAAK;AAAA,MAElD,UAAAvB;AAAA,IAAA;AAAA,EAAA,EACH,CACF;AAEJ;AACAqB,EAAgB,cAAc;AAMvB,MAAMI,IAAc,OAAO,OAAO9B,GAAiB;AAAA,EACxD,QAAQW;AAAA,EACR,OAAOc;AAAA,EACP,MAAMC;AACR,CAAC;"}
|
|
1
|
+
{"version":3,"file":"contact-card-Cf8Ktyt3.js","sources":["../../src/components/contact-card/contact-card.tsx"],"sourcesContent":["import {\n forwardRef,\n Fragment,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { MapPin } from 'lucide-react';\nimport { Card } from '../card/card';\nimport { Link } from '../link/link';\n\n/* ------------------------------------------------------------------ */\n/* Phone helper */\n/* ------------------------------------------------------------------ */\n\n/**\n * Strip everything that's not a digit or a leading `+` so the display\n * string (`\"+49 (0)89 51871478\"`) becomes a valid `tel:` URI target\n * (`\"tel:+498951871478\"`). RFC 3966 allows visual separators, but most\n * dialer apps still trip on them — collapsing to a strict E.164-ish\n * form is the safe default. The `(0)` trunk-prefix convention is\n * intentionally dropped: it's not a real digit in international\n * dialling, only a hint for in-country dialling.\n */\nfunction buildTelHref(display: string): string {\n const trunkStripped = display.replace(/\\(0\\)/g, '');\n const digits = trunkStripped.replace(/[^\\d+]/g, '');\n return `tel:${digits}`;\n}\n\n/* ------------------------------------------------------------------ */\n/* Root */\n/* ------------------------------------------------------------------ */\n\nexport interface ContactCardProps extends Omit<\n HTMLAttributes<HTMLElement>,\n 'title'\n> {\n /**\n * Optional card heading rendered inside `Card.Header` as an `<h2>` —\n * e.g. \"Contact information\" above one or more office blocks. Omit\n * when the card sits inside a section that already has a heading.\n */\n title?: ReactNode;\n /**\n * `Card` variant. Defaults to `default` (subtle border on `--card`\n * surface) to match the marketing site's treatment.\n */\n variant?: 'default' | 'outlined' | 'elevated';\n children: ReactNode;\n}\n\nconst ContactCardRoot = forwardRef<HTMLElement, ContactCardProps>(\n ({ title, variant = 'default', className, children, ...props }, ref) => (\n <Card\n ref={ref}\n variant={variant}\n data-component=\"contact-card\"\n className={className}\n {...props}\n >\n {title !== undefined ? (\n <Card.Header>\n <h2 className=\"type-title-card ds:text-foreground\">{title}</h2>\n </Card.Header>\n ) : null}\n <Card.Body\n className={[\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-md)]',\n // Tighten the body padding-block-start when a header sits\n // above so the whole card reads as one cohesive block rather\n // than two stacked sections — Card.Header already paints\n // bottom padding via `pb-0` + Card.Body's `p-md`.\n ].join(' ')}\n >\n {children}\n </Card.Body>\n </Card>\n ),\n);\nContactCardRoot.displayName = 'ContactCard';\n\n/* ------------------------------------------------------------------ */\n/* Office */\n/* ------------------------------------------------------------------ */\n\nexport interface ContactCardOfficeProps extends Omit<\n HTMLAttributes<HTMLElement>,\n 'children'\n> {\n /**\n * Office name — rendered as the block's bold label next to the pin\n * glyph. Not a heading element by default so a card with multiple\n * offices doesn't fragment the heading outline; pass `nameAs=\"h3\"`\n * (or `h4` etc.) when the consuming page wants a real heading.\n */\n name: ReactNode;\n /**\n * Address lines in document order, one per `<br>`-equivalent. Country\n * / region / postcode formatting is the consumer's responsibility —\n * the kit only inserts the line breaks.\n */\n lines: ReadonlyArray<string>;\n /**\n * VAT / tax-ID number. Rendered on its own line with the kit-owned\n * `ui.contactCard.vatNumberLabel` prefix.\n */\n vatNumber?: string;\n /**\n * Phone number as it should display (with separators, parens, trunk\n * prefix). The kit normalises this into a `tel:` URI internally —\n * see `buildTelHref` for the rules.\n */\n phone?: string;\n /** Heading element used for `name`. Defaults to a non-heading `<p>`. */\n nameAs?: 'p' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n}\n\nconst ContactCardOffice = forwardRef<HTMLElement, ContactCardOfficeProps>(\n (\n { name, lines, vatNumber, phone, nameAs = 'p', className, ...props },\n ref,\n ) => {\n const { t } = useTranslation();\n const NameTag = nameAs as 'p';\n\n return (\n <address\n ref={ref as React.Ref<HTMLElement>}\n data-component=\"contact-card-office\"\n className={[\n // `not-italic` overrides the UA default for `<address>` since\n // the kit's type ramp already encodes intent — italic would\n // double up with a heading-bold name and read as emphasis.\n 'ds:not-italic ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]',\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n {...props}\n >\n <NameTag className=\"ds:m-0 ds:flex ds:items-center ds:gap-[var(--spacing-xs)] type-label ds:font-semibold ds:text-foreground\">\n <MapPin\n aria-hidden=\"true\"\n className=\"ds:size-[1.25em] ds:text-primary ds:shrink-0\"\n />\n <span>{name}</span>\n </NameTag>\n <div className=\"type-body-sm ds:text-foreground ds:[unicode-bidi:isolate]\">\n {lines.map((line, i) => (\n <Fragment key={i}>\n {line}\n {i < lines.length - 1 ? <br /> : null}\n </Fragment>\n ))}\n </div>\n {vatNumber ? (\n <div className=\"type-body-sm ds:text-muted-foreground\">\n <span className=\"ds:me-[var(--spacing-2xs)]\">\n {t('contactCard.vatNumberLabel')}\n </span>\n <span className=\"ds:[unicode-bidi:isolate]\">{vatNumber}</span>\n </div>\n ) : null}\n {phone ? (\n <div className=\"type-body-sm ds:text-muted-foreground ds:inline-flex ds:items-baseline ds:gap-[var(--spacing-2xs)] ds:flex-wrap\">\n <span>{t('contactCard.phoneLabel')}</span>\n <Link href={buildTelHref(phone)} intent=\"default\">\n <span className=\"ds:[unicode-bidi:isolate]\">{phone}</span>\n </Link>\n </div>\n ) : null}\n </address>\n );\n },\n);\nContactCardOffice.displayName = 'ContactCard.Office';\n\n/* ------------------------------------------------------------------ */\n/* Links */\n/* ------------------------------------------------------------------ */\n\nexport type ContactCardLinksProps = HTMLAttributes<HTMLUListElement>;\n\nconst ContactCardLinks = forwardRef<HTMLUListElement, ContactCardLinksProps>(\n ({ className, children, ...props }, ref) => (\n <ul\n ref={ref}\n data-component=\"contact-card-links\"\n className={[\n 'ds:m-0 ds:p-0 ds:list-none',\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]',\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n {...props}\n >\n {children}\n </ul>\n ),\n);\nContactCardLinks.displayName = 'ContactCard.Links';\n\n/* ------------------------------------------------------------------ */\n/* Link */\n/* ------------------------------------------------------------------ */\n\nexport interface ContactCardLinkProps {\n href: string;\n /**\n * Leading glyph. Rendered with `--primary` so the link list reads as\n * a coloured-icon menu (matches the marketing site's treatment).\n * Consumers pass a bare lucide-react icon; the kit handles colour /\n * size / aria-hidden.\n */\n icon: ReactNode;\n /** Open in a new tab — adds `target=\"_blank\"` and `rel` via `Link`. */\n external?: boolean;\n children: ReactNode;\n}\n\nconst ContactCardLink = forwardRef<HTMLLIElement, ContactCardLinkProps>(\n ({ href, icon, external, children }, ref) => (\n <li ref={ref} className=\"ds:m-0\">\n <Link\n href={href}\n external={external}\n // Wrap in a `text-primary` span so the lucide glyph (which uses\n // `currentColor`) picks up the brand tint without the consumer\n // having to thread a className through every icon. Link adds\n // its own aria-hidden wrapper + `[&_svg]:size-[1em]` outside\n // this; the colour cascades through.\n startIcon={<span className=\"ds:text-primary\">{icon}</span>}\n >\n {children}\n </Link>\n </li>\n ),\n);\nContactCardLink.displayName = 'ContactCard.Link';\n\n/* ------------------------------------------------------------------ */\n/* Compound export */\n/* ------------------------------------------------------------------ */\n\nexport const ContactCard = Object.assign(ContactCardRoot, {\n Office: ContactCardOffice,\n Links: ContactCardLinks,\n Link: ContactCardLink,\n});\n\nexport { buildTelHref as __buildTelHref };\n"],"names":["buildTelHref","display","ContactCardRoot","forwardRef","title","variant","className","children","props","ref","jsxs","Card","jsx","ContactCardOffice","name","lines","vatNumber","phone","nameAs","t","useTranslation","NameTag","MapPin","line","i","Fragment","Link","ContactCardLinks","ContactCardLink","href","icon","external","ContactCard"],"mappings":";;;;;;AAwBA,SAASA,EAAaC,GAAyB;AAG7C,SAAO,OAFeA,EAAQ,QAAQ,UAAU,EAAE,EACrB,QAAQ,WAAW,EAAE,CAC9B;AACtB;AAwBA,MAAMC,IAAkBC;AAAA,EACtB,CAAC,EAAE,OAAAC,GAAO,SAAAC,IAAU,WAAW,WAAAC,GAAW,UAAAC,GAAU,GAAGC,KAASC,MAC9D,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAAF;AAAA,MACA,SAAAJ;AAAA,MACA,kBAAe;AAAA,MACf,WAAAC;AAAA,MACC,GAAGE;AAAA,MAEH,UAAA;AAAA,QAAAJ,MAAU,SACT,gBAAAQ,EAACD,EAAK,QAAL,EACC,UAAA,gBAAAC,EAAC,MAAA,EAAG,WAAU,sCAAsC,UAAAR,EAAA,CAAM,EAAA,CAC5D,IACE;AAAA,QACJ,gBAAAQ;AAAA,UAACD,EAAK;AAAA,UAAL;AAAA,YACC,WAAW;AAAA,cACT;AAAA;AAAA;AAAA;AAAA;AAAA,YAAA,EAKA,KAAK,GAAG;AAAA,YAET,UAAAJ;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAGN;AACAL,EAAgB,cAAc;AAsC9B,MAAMW,IAAoBV;AAAA,EACxB,CACE,EAAE,MAAAW,GAAM,OAAAC,GAAO,WAAAC,GAAW,OAAAC,GAAO,QAAAC,IAAS,KAAK,WAAAZ,GAAW,GAAGE,EAAA,GAC7DC,MACG;AACH,UAAM,EAAE,GAAAU,EAAA,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ACrD;AAAA,UAAA,EAAA,CACF,IACE;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AACAC,EAAkB,cAAc;AAQhC,MAAMc,IAAmBxB;AAAA,EACvB,CAAC,EAAE,WAAAG,GAAW,UAAAC,GAAU,GAAGC,EAAA,GAASC,MAClC,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAH;AAAA,MACA,kBAAe;AAAA,MACf,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACAH;AAAA,MAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,MACV,GAAGE;AAAA,MAEH,UAAAD;AAAA,IAAA;AAAA,EAAA;AAGP;AACAoB,EAAiB,cAAc;AAoB/B,MAAMC,IAAkBzB;AAAA,EACtB,CAAC,EAAE,MAAA0B,GAAM,MAAAC,GAAM,UAAAC,GAAU,UAAAxB,EAAA,GAAYE,MACnC,gBAAAG,EAAC,MAAA,EAAG,KAAAH,GAAU,WAAU,UACtB,UAAA,gBAAAG;AAAA,IAACc;AAAA,IAAA;AAAA,MACC,MAAAG;AAAA,MACA,UAAAE;AAAA,MAMA,WAAW,gBAAAnB,EAAC,QAAA,EAAK,WAAU,mBAAmB,UAAAkB,GAAK;AAAA,MAElD,UAAAvB;AAAA,IAAA;AAAA,EAAA,EACH,CACF;AAEJ;AACAqB,EAAgB,cAAc;AAMvB,MAAMI,IAAc,OAAO,OAAO9B,GAAiB;AAAA,EACxD,QAAQW;AAAA,EACR,OAAOc;AAAA,EACP,MAAMC;AACR,CAAC;"}
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import { jsxs as u, jsx as e, Fragment as R } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as ie, useId as le, useMemo as ce } from "react";
|
|
3
|
+
import { c as se } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as de } from "react-i18next";
|
|
5
|
+
import { B as S } from "./badge-zsf5i5bH.js";
|
|
6
|
+
import { C as F } from "./card-DPmk26CL.js";
|
|
7
|
+
import { K as pe, a as ue } from "./key-value-pair-CkQIb9EG.js";
|
|
8
|
+
import { L as d } from "./link-DrD_cRUg.js";
|
|
9
|
+
import { u as fe } from "./registry-nPAVE19X.js";
|
|
10
|
+
import { S as T } from "./stethoscope-DT5qCW8Y.js";
|
|
11
|
+
import { H, S as V, L as z } from "./shield-check-BhHyReu8.js";
|
|
12
|
+
import { c as O } from "./createLucideIcon-CrFbzy84.js";
|
|
13
|
+
import { G as E } from "./globe-BkEFMNSg.js";
|
|
14
|
+
import { M as K } from "./mail-C8irm52s.js";
|
|
15
|
+
import { M as L } from "./message-circle-C23eicgb.js";
|
|
16
|
+
import { M as U } from "./map-pin-B8STOPMJ.js";
|
|
17
|
+
/**
|
|
18
|
+
* @license lucide-react v1.8.0 - ISC
|
|
19
|
+
*
|
|
20
|
+
* This source code is licensed under the ISC license.
|
|
21
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
22
|
+
*/
|
|
23
|
+
const me = [
|
|
24
|
+
["rect", { width: "20", height: "12", x: "2", y: "6", rx: "2", key: "9lu3g6" }],
|
|
25
|
+
["circle", { cx: "12", cy: "12", r: "2", key: "1c9p78" }],
|
|
26
|
+
["path", { d: "M6 12h.01M18 12h.01", key: "113zkx" }]
|
|
27
|
+
], j = O("banknote", me);
|
|
28
|
+
/**
|
|
29
|
+
* @license lucide-react v1.8.0 - ISC
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the ISC license.
|
|
32
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/
|
|
34
|
+
const he = [
|
|
35
|
+
[
|
|
36
|
+
"path",
|
|
37
|
+
{
|
|
38
|
+
d: "M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",
|
|
39
|
+
key: "9njp5v"
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
], B = O("phone", he), ge = {
|
|
43
|
+
id: "contact-profile-card",
|
|
44
|
+
capabilities: ["view_change"],
|
|
45
|
+
state: {
|
|
46
|
+
profession: {
|
|
47
|
+
type: "string",
|
|
48
|
+
descriptionKey: "ui.agent.contactProfileCard.state.profession",
|
|
49
|
+
description: "Profession string the card is currently rendering — undefined when the consumer omitted it.",
|
|
50
|
+
read: (t) => t.getProfession()
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
actions: {},
|
|
54
|
+
domHooks: {
|
|
55
|
+
root: {
|
|
56
|
+
attr: "data-component",
|
|
57
|
+
value: "contact-profile-card",
|
|
58
|
+
description: "Marks the ContactProfileCard root region."
|
|
59
|
+
},
|
|
60
|
+
instanceId: {
|
|
61
|
+
attr: "data-component-id",
|
|
62
|
+
sourceProp: "id",
|
|
63
|
+
description: "Sourced from the id prop."
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}, ve = se(
|
|
67
|
+
"ds:w-full ds:text-[color:var(--foreground)] ds:[--key-value-pair-icon-color:var(--accent)]",
|
|
68
|
+
{
|
|
69
|
+
variants: {
|
|
70
|
+
// Matches the kit's other `surface` props (Booking, ReviewsPanel).
|
|
71
|
+
// The card itself renders `<Card variant="elevated">` so the
|
|
72
|
+
// `surface="flat"` opt-out is rare — most consumers want the
|
|
73
|
+
// boundary.
|
|
74
|
+
surface: {
|
|
75
|
+
flat: "",
|
|
76
|
+
elevated: ""
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
defaultVariants: { surface: "elevated" }
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
function xe(t) {
|
|
83
|
+
return t.replace(/[^\d+]/g, "");
|
|
84
|
+
}
|
|
85
|
+
function ye(t, r) {
|
|
86
|
+
const a = `https://wa.me/${t}`;
|
|
87
|
+
return r ? `${a}?text=${encodeURIComponent(r)}` : a;
|
|
88
|
+
}
|
|
89
|
+
function Ce(t) {
|
|
90
|
+
return `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(t.line)}`;
|
|
91
|
+
}
|
|
92
|
+
function be(t, r, a) {
|
|
93
|
+
try {
|
|
94
|
+
return new Intl.NumberFormat(a, {
|
|
95
|
+
style: "currency",
|
|
96
|
+
currency: r
|
|
97
|
+
}).format(t / 100);
|
|
98
|
+
} catch {
|
|
99
|
+
return (t / 100).toFixed(2);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function Pe() {
|
|
103
|
+
if (typeof document > "u") return "4945a3";
|
|
104
|
+
const t = getComputedStyle(document.documentElement).getPropertyValue("--map-marker-color").trim(), r = /^#?([0-9a-fA-F]{6})$/.exec(t);
|
|
105
|
+
return r ? r[1] : "4945a3";
|
|
106
|
+
}
|
|
107
|
+
function ke({ apiKey: t, center: r, zoom: a, altText: c }) {
|
|
108
|
+
const s = Pe(), f = `https://maps.googleapis.com/maps/api/staticmap?center=${r.lat},${r.lng}&zoom=${a}&size=640x192&scale=2&markers=color:0x${s}%7C${r.lat},${r.lng}&key=${encodeURIComponent(t)}`;
|
|
109
|
+
return /* @__PURE__ */ e(
|
|
110
|
+
"img",
|
|
111
|
+
{
|
|
112
|
+
src: f,
|
|
113
|
+
alt: c,
|
|
114
|
+
loading: "lazy",
|
|
115
|
+
decoding: "async",
|
|
116
|
+
width: 640,
|
|
117
|
+
height: 192,
|
|
118
|
+
className: "ds:block ds:inline-size-full ds:block-size-[12rem] ds:[object-fit:cover] ds:rounded-[var(--radius-md)]"
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
const we = ie(
|
|
123
|
+
({
|
|
124
|
+
heading: t,
|
|
125
|
+
description: r,
|
|
126
|
+
address: a,
|
|
127
|
+
phone: c,
|
|
128
|
+
whatsappNumber: s,
|
|
129
|
+
whatsappMessage: f,
|
|
130
|
+
email: m,
|
|
131
|
+
website: h,
|
|
132
|
+
languages: g,
|
|
133
|
+
languageLabels: p,
|
|
134
|
+
insurances: v,
|
|
135
|
+
firstVisitPriceCents: x,
|
|
136
|
+
currencyCode: b = "EUR",
|
|
137
|
+
profession: y,
|
|
138
|
+
specializedInFearPatients: G,
|
|
139
|
+
googleMapsApiKey: P,
|
|
140
|
+
mapZoom: q = 14,
|
|
141
|
+
onPhoneClick: W,
|
|
142
|
+
onWhatsAppClick: D,
|
|
143
|
+
onMapClick: Y,
|
|
144
|
+
onEmailClick: J,
|
|
145
|
+
headerSlot: Q,
|
|
146
|
+
footerSlot: X,
|
|
147
|
+
surface: k = "elevated",
|
|
148
|
+
"aria-label": Z,
|
|
149
|
+
id: C,
|
|
150
|
+
className: ee,
|
|
151
|
+
...ae
|
|
152
|
+
}, te) => {
|
|
153
|
+
const { t: n, i18n: w } = de(), M = le(), $ = w.language ?? "en", N = t ?? n("contactProfileCard.heading"), re = Z ?? N, A = ce(() => {
|
|
154
|
+
if (x != null)
|
|
155
|
+
return be(x, b, $);
|
|
156
|
+
}, [x, b, $]), o = [];
|
|
157
|
+
if (a && o.push({
|
|
158
|
+
key: "address",
|
|
159
|
+
icon: /* @__PURE__ */ e(U, { "aria-hidden": "true" }),
|
|
160
|
+
label: n("contactProfileCard.label.address"),
|
|
161
|
+
value: /* @__PURE__ */ u("span", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
|
|
162
|
+
/* @__PURE__ */ e("span", { children: a.line }),
|
|
163
|
+
a.lat != null && a.lng != null ? /* @__PURE__ */ e(
|
|
164
|
+
d,
|
|
165
|
+
{
|
|
166
|
+
href: Ce(a),
|
|
167
|
+
external: !0,
|
|
168
|
+
intent: "default",
|
|
169
|
+
onClick: Y,
|
|
170
|
+
children: n("contactProfileCard.openInGoogleMaps")
|
|
171
|
+
}
|
|
172
|
+
) : null
|
|
173
|
+
] })
|
|
174
|
+
}), c && o.push({
|
|
175
|
+
key: "phone",
|
|
176
|
+
icon: /* @__PURE__ */ e(B, { "aria-hidden": "true" }),
|
|
177
|
+
label: n("contactProfileCard.label.phone"),
|
|
178
|
+
value: /* @__PURE__ */ e(
|
|
179
|
+
d,
|
|
180
|
+
{
|
|
181
|
+
href: `tel:${xe(c)}`,
|
|
182
|
+
intent: "default",
|
|
183
|
+
onClick: W,
|
|
184
|
+
children: c
|
|
185
|
+
}
|
|
186
|
+
)
|
|
187
|
+
}), s && o.push({
|
|
188
|
+
key: "whatsapp",
|
|
189
|
+
icon: /* @__PURE__ */ e(L, { "aria-hidden": "true" }),
|
|
190
|
+
label: n("contactProfileCard.label.whatsapp"),
|
|
191
|
+
value: /* @__PURE__ */ e(
|
|
192
|
+
d,
|
|
193
|
+
{
|
|
194
|
+
href: ye(s, f),
|
|
195
|
+
external: !0,
|
|
196
|
+
intent: "default",
|
|
197
|
+
onClick: D,
|
|
198
|
+
children: s
|
|
199
|
+
}
|
|
200
|
+
)
|
|
201
|
+
}), m && o.push({
|
|
202
|
+
key: "email",
|
|
203
|
+
icon: /* @__PURE__ */ e(K, { "aria-hidden": "true" }),
|
|
204
|
+
label: n("contactProfileCard.label.email"),
|
|
205
|
+
value: /* @__PURE__ */ e(
|
|
206
|
+
d,
|
|
207
|
+
{
|
|
208
|
+
href: `mailto:${m}`,
|
|
209
|
+
intent: "default",
|
|
210
|
+
onClick: J,
|
|
211
|
+
children: m
|
|
212
|
+
}
|
|
213
|
+
)
|
|
214
|
+
}), h && o.push({
|
|
215
|
+
key: "website",
|
|
216
|
+
icon: /* @__PURE__ */ e(E, { "aria-hidden": "true" }),
|
|
217
|
+
label: n("contactProfileCard.label.website"),
|
|
218
|
+
value: /* @__PURE__ */ e(d, { href: h, external: !0, intent: "default", children: h })
|
|
219
|
+
}), g && g.length > 0) {
|
|
220
|
+
const i = (l) => {
|
|
221
|
+
if (p != null && p[l]) return p[l];
|
|
222
|
+
const I = `languages.${l}`;
|
|
223
|
+
return w.exists(I) ? n(I) : l.toUpperCase();
|
|
224
|
+
};
|
|
225
|
+
o.push({
|
|
226
|
+
key: "languages",
|
|
227
|
+
icon: /* @__PURE__ */ e(z, { "aria-hidden": "true" }),
|
|
228
|
+
label: n("contactProfileCard.label.languages"),
|
|
229
|
+
value: /* @__PURE__ */ e("span", { className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]", children: g.map((l) => /* @__PURE__ */ e(S, { variant: "neutral", children: i(l) }, l)) })
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
v && v.length > 0 && o.push({
|
|
233
|
+
key: "insurances",
|
|
234
|
+
icon: /* @__PURE__ */ e(V, { "aria-hidden": "true" }),
|
|
235
|
+
label: n("contactProfileCard.label.insurances"),
|
|
236
|
+
value: /* @__PURE__ */ e("span", { className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]", children: v.map((i) => /* @__PURE__ */ e(S, { variant: "info", children: i }, i)) })
|
|
237
|
+
}), A && o.push({
|
|
238
|
+
key: "firstVisitPrice",
|
|
239
|
+
icon: /* @__PURE__ */ e(j, { "aria-hidden": "true" }),
|
|
240
|
+
label: n("contactProfileCard.label.firstVisitPrice"),
|
|
241
|
+
value: A
|
|
242
|
+
}), G && o.push({
|
|
243
|
+
key: "expertForAnxiousPatients",
|
|
244
|
+
icon: /* @__PURE__ */ e(H, { "aria-hidden": "true" }),
|
|
245
|
+
label: n("contactProfileCard.label.expertForAnxiousPatients"),
|
|
246
|
+
value: n("contactProfileCard.value.yesShort")
|
|
247
|
+
}), y && o.push({
|
|
248
|
+
key: "profession",
|
|
249
|
+
icon: /* @__PURE__ */ e(T, { "aria-hidden": "true" }),
|
|
250
|
+
label: n("contactProfileCard.label.profession"),
|
|
251
|
+
value: y
|
|
252
|
+
}), fe(
|
|
253
|
+
ge,
|
|
254
|
+
{ getProfession: () => y },
|
|
255
|
+
C
|
|
256
|
+
);
|
|
257
|
+
const ne = /* @__PURE__ */ u(R, { children: [
|
|
258
|
+
r ? /* @__PURE__ */ e("p", { className: "type-body-sm ds:m-0 ds:whitespace-pre-line", children: r }) : null,
|
|
259
|
+
o.length > 0 ? /* @__PURE__ */ e(pe, { rowGap: "md", children: o.map((i) => /* @__PURE__ */ e(
|
|
260
|
+
ue,
|
|
261
|
+
{
|
|
262
|
+
icon: i.icon,
|
|
263
|
+
label: i.label,
|
|
264
|
+
value: i.value
|
|
265
|
+
},
|
|
266
|
+
i.key
|
|
267
|
+
)) }) : null,
|
|
268
|
+
X
|
|
269
|
+
] }), oe = !!P && (a == null ? void 0 : a.lat) !== void 0 && (a == null ? void 0 : a.lng) !== void 0 ? /* @__PURE__ */ e(
|
|
270
|
+
ke,
|
|
271
|
+
{
|
|
272
|
+
apiKey: P,
|
|
273
|
+
center: { lat: a.lat, lng: a.lng },
|
|
274
|
+
zoom: q,
|
|
275
|
+
altText: n("contactProfileCard.map.alt", {
|
|
276
|
+
address: a.line,
|
|
277
|
+
defaultValue: "Map showing {{address}}"
|
|
278
|
+
})
|
|
279
|
+
}
|
|
280
|
+
) : null, _ = /* @__PURE__ */ u(R, { children: [
|
|
281
|
+
oe,
|
|
282
|
+
/* @__PURE__ */ u("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
283
|
+
Q,
|
|
284
|
+
/* @__PURE__ */ e(
|
|
285
|
+
"h2",
|
|
286
|
+
{
|
|
287
|
+
id: M,
|
|
288
|
+
className: "type-title-card ds:m-0 ds:text-[color:var(--foreground)]",
|
|
289
|
+
children: N
|
|
290
|
+
}
|
|
291
|
+
)
|
|
292
|
+
] }),
|
|
293
|
+
ne
|
|
294
|
+
] });
|
|
295
|
+
return /* @__PURE__ */ e(
|
|
296
|
+
"div",
|
|
297
|
+
{
|
|
298
|
+
ref: te,
|
|
299
|
+
role: "region",
|
|
300
|
+
"aria-label": re,
|
|
301
|
+
"aria-labelledby": M,
|
|
302
|
+
"data-component": "contact-profile-card",
|
|
303
|
+
"data-component-id": C,
|
|
304
|
+
id: C,
|
|
305
|
+
className: ve({ surface: k, className: ee }),
|
|
306
|
+
...ae,
|
|
307
|
+
children: k === "elevated" ? /* @__PURE__ */ e(F, { variant: "elevated", children: /* @__PURE__ */ e(F.Body, { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: _ }) }) : /* @__PURE__ */ e("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: _ })
|
|
308
|
+
}
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
);
|
|
312
|
+
we.displayName = "ContactProfileCard";
|
|
313
|
+
const Ue = [
|
|
314
|
+
"address",
|
|
315
|
+
"phone",
|
|
316
|
+
"whatsapp",
|
|
317
|
+
"email",
|
|
318
|
+
"website",
|
|
319
|
+
"languages",
|
|
320
|
+
"insurances",
|
|
321
|
+
"firstVisitPrice",
|
|
322
|
+
"expertForAnxiousPatients",
|
|
323
|
+
"profession"
|
|
324
|
+
], je = {
|
|
325
|
+
address: U,
|
|
326
|
+
phone: B,
|
|
327
|
+
whatsapp: L,
|
|
328
|
+
email: K,
|
|
329
|
+
website: E,
|
|
330
|
+
languages: z,
|
|
331
|
+
insurances: V,
|
|
332
|
+
firstVisitPrice: j,
|
|
333
|
+
expertForAnxiousPatients: H,
|
|
334
|
+
profession: T
|
|
335
|
+
};
|
|
336
|
+
export {
|
|
337
|
+
je as C,
|
|
338
|
+
Ue as a,
|
|
339
|
+
we as b,
|
|
340
|
+
ge as c
|
|
341
|
+
};
|
|
342
|
+
//# sourceMappingURL=contact-profile-card-Ce-LIDU8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contact-profile-card-Ce-LIDU8.js","sources":["../../node_modules/lucide-react/dist/esm/icons/banknote.js","../../node_modules/lucide-react/dist/esm/icons/phone.js","../../src/components/contact-profile-card/contact-profile-card.agent.ts","../../src/components/contact-profile-card/contact-profile-card.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.8.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.js';\n\nconst __iconNode = [\n [\"rect\", { width: \"20\", height: \"12\", x: \"2\", y: \"6\", rx: \"2\", key: \"9lu3g6\" }],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"2\", key: \"1c9p78\" }],\n [\"path\", { d: \"M6 12h.01M18 12h.01\", key: \"113zkx\" }]\n];\nconst Banknote = createLucideIcon(\"banknote\", __iconNode);\n\nexport { __iconNode, Banknote as default };\n//# sourceMappingURL=banknote.js.map\n","/**\n * @license lucide-react v1.8.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.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384\",\n key: \"9njp5v\"\n }\n ]\n];\nconst Phone = createLucideIcon(\"phone\", __iconNode);\n\nexport { __iconNode, Phone as default };\n//# sourceMappingURL=phone.js.map\n","import type { AgentAdapter } from '../../agent/types';\nimport type { ContactProfileCardHandle } from './contact-profile-card';\n\n/* -------------------------------------------------------------------- */\n/* Agent adapter — ContactProfileCard */\n/* */\n/* Read-only adapter. Surfaces the rendered profession field so an */\n/* agent / MCP runtime can resolve \"what kind of practice is this?\" */\n/* without re-parsing the DOM. No actions yet — the card is a passive */\n/* presentation surface; navigation lives on the consumer's page. */\n/* -------------------------------------------------------------------- */\n\nexport const contactProfileCardAgent: AgentAdapter<ContactProfileCardHandle> = {\n id: 'contact-profile-card',\n capabilities: ['view_change'],\n state: {\n profession: {\n type: 'string',\n descriptionKey: 'ui.agent.contactProfileCard.state.profession',\n description:\n 'Profession string the card is currently rendering — undefined when the consumer omitted it.',\n read: (handle) => handle.getProfession(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'contact-profile-card',\n description: 'Marks the ContactProfileCard root region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n forwardRef,\n useId,\n useMemo,\n type ComponentPropsWithoutRef,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport {\n Banknote,\n ExternalLink,\n Globe,\n Heart,\n Languages as LanguagesIcon,\n Mail,\n MapPin,\n MessageCircle,\n Phone,\n ShieldCheck,\n Stethoscope,\n type LucideIcon,\n} from 'lucide-react';\nimport { Badge } from '../badge/badge';\nimport { Card } from '../card/card';\nimport { KeyValueList, KeyValuePair } from '../key-value-pair/key-value-pair';\nimport { Link } from '../link/link';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { contactProfileCardAgent } from './contact-profile-card.agent';\n\n/* -------------------------------------------------------------------- */\n/* ContactProfileCard */\n/* */\n/* Replaces the bespoke \"Profilo\" / \"Practice info\" cards that every */\n/* AlfaDocs surface composes by hand (booking-website PracticeInfoCard, */\n/* alfascribe operator pages, builders docs example, …). Composes Card */\n/* + KeyValueList + KeyValuePair so the labels share a column (no */\n/* zigzag values) and every row uses the same lucide icon family. */\n/* */\n/* The component is intentionally opinionated: every field is optional, */\n/* but the ORDER, ICONS, and LABELS are owned by the kit. Consumers */\n/* pass the data; the kit owns the visual + i18n. */\n/* */\n/* All visible text flows through `useTranslation('ui')` against the */\n/* `contactProfileCard.*` namespace. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* CVA */\n/* -------------------------------------------------------------------- */\n\n// Override the KVP icon colour at the card root so every inner row's\n// leading glyph paints with `--accent` (brand magenta/violet) instead\n// of the default `--muted-foreground`. The ContactProfileCard is a\n// marketing surface — muted icons read as disabled against the\n// otherwise saturated card chrome. Scoped via CSS custom property so\n// only this card's icons shift; standalone KVPs elsewhere keep\n// `--muted-foreground`.\nconst rootVariants = cva(\n 'ds:w-full ds:text-[color:var(--foreground)] ds:[--key-value-pair-icon-color:var(--accent)]',\n {\n variants: {\n // Matches the kit's other `surface` props (Booking, ReviewsPanel).\n // The card itself renders `<Card variant=\"elevated\">` so the\n // `surface=\"flat\"` opt-out is rare — most consumers want the\n // boundary.\n surface: {\n flat: '',\n elevated: '',\n },\n },\n defaultVariants: { surface: 'elevated' },\n },\n);\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* -------------------------------------------------------------------- */\n\nexport interface ContactProfileCardAddress {\n /** Display text — already formatted by the consumer (street, postcode, city). */\n line: string;\n /** Optional lat/lng — drives the static-map link + the embedded thumbnail. */\n lat?: number;\n lng?: number;\n}\n\nexport interface ContactProfileCardHandle {\n /** Resolved consumer-supplied data — useful for agent introspection. */\n getProfession: () => string | undefined;\n}\n\nexport interface ContactProfileCardProps extends Omit<\n ComponentPropsWithoutRef<'div'>,\n 'aria-label' | 'children' | 'children'\n> {\n /**\n * Override the localised \"Profilo\" / \"Profile\" heading. Most\n * consumers leave this unset.\n */\n heading?: string;\n /**\n * Free-text intro paragraph rendered above the data rows (e.g.\n * the practice's `bookingDescription` field). When omitted, the\n * card jumps straight into the data rows.\n */\n description?: string;\n\n /* ----- Identity rows ----- */\n\n /** Street + postcode + city, with optional lat/lng for the map link. */\n address?: ContactProfileCardAddress;\n /** Phone number, displayed as-is. Compiled into a `tel:` link. */\n phone?: string;\n /**\n * WhatsApp number — digits only (no `+`, no spaces). Compiled into\n * a `https://wa.me/<number>` link with an optional pre-filled message.\n */\n whatsappNumber?: string;\n /** Optional pre-filled WhatsApp message. Consumer-localised. */\n whatsappMessage?: string;\n /** Public-facing email. Compiled into a `mailto:` link. */\n email?: string;\n /** Practice website (already an absolute URL with protocol). */\n website?: string;\n\n /* ----- Embedded map thumbnail ----- */\n\n /**\n * Google Maps Static API key. When provided alongside `address.lat`\n * and `address.lng`, renders a static-map thumbnail at the top of\n * the card — a single one-shot `<img>` fetch, no JS SDK boot, no\n * consent gate needed (the same pattern PracticeResults uses).\n *\n * Without it (or without coords), the card renders info rows only —\n * the address row's \"Open in Google Maps\" link is still emitted as\n * a real `<a>` so the spatial cue isn't lost.\n *\n * Additive — existing consumers that don't pass this prop see the\n * same render as before.\n */\n googleMapsApiKey?: string;\n /**\n * Zoom level for the embedded map thumbnail. Default `14` —\n * neighbourhood-level, shows the pin in context. Ignored when the\n * thumbnail isn't rendered.\n */\n mapZoom?: number;\n\n /* ----- Profile metadata ----- */\n\n /**\n * ISO 639-1 language codes the practice speaks. Rendered as\n * `<Badge variant=\"neutral\">` chips. Each code is auto-resolved\n * into the active locale's native language name via the kit's\n * built-in `languages.<iso>` i18n bundle (18 ISO codes × 18\n * locales). For example `languages={['it', 'en']}` with\n * `i18n.language === 'it'` renders \"Italiano\" + \"Inglese\".\n *\n * Unknown / unbundled codes fall back to the uppercase ISO code\n * (`'xyz'` → `'XYZ'`). To override a specific label — regional\n * dialect, brand-voice variant, codes the kit doesn't ship — pass\n * `languageLabels`.\n */\n languages?: string[];\n /**\n * Override map from ISO code → display label, applied on top of\n * the kit's i18n auto-resolution. Only set when you need a\n * consumer-specific label for a code — the typical case is\n * regional dialect / brand-voice variants / non-ISO codes.\n *\n * Resolution order: `languageLabels[code]` > `t('languages.<code>')`\n * > `code.toUpperCase()`.\n */\n languageLabels?: Record<string, string>;\n /**\n * Insurance / convention strings (consumer-supplied, free text).\n * Rendered as `<Badge variant=\"info\">` chips.\n */\n insurances?: string[];\n /**\n * First-visit price in the smallest currency unit (cents / centesimi).\n * Formatted via `Intl.NumberFormat`. Omit when the consumer doesn't\n * want to show the price.\n */\n firstVisitPriceCents?: number;\n /** ISO-4217 currency code for the price formatter. Defaults to `EUR`. */\n currencyCode?: string;\n /** Profession line — single value or already-joined comma list. */\n profession?: string;\n /** Show the \"expert for anxious patients\" row when true. */\n specializedInFearPatients?: boolean;\n\n /* ----- Telemetry hooks ----- */\n\n /**\n * Fires when the patient clicks the phone link. The kit emits a\n * `track('practice_profile_card_phone_click')` event before\n * invoking this — gate consumer-side analytics on the same event\n * to avoid duplicate fires.\n */\n onPhoneClick?: () => void;\n /** Fires when the patient clicks the WhatsApp link. */\n onWhatsAppClick?: () => void;\n /** Fires when the patient clicks the static-map link. */\n onMapClick?: () => void;\n /** Fires when the patient clicks the email mailto link. */\n onEmailClick?: () => void;\n\n /* ----- Slots ----- */\n\n /**\n * Rendered above the heading — e.g. a `<Avatar>` for the operator\n * variant, or a coloured chip strip. Optional.\n */\n headerSlot?: ReactNode;\n /**\n * Rendered at the end of the card body, below the rows. Use for\n * a \"Book now\" `<Button>` or a \"View full profile\" link.\n */\n footerSlot?: ReactNode;\n\n /* ----- Styling ----- */\n\n /**\n * `'elevated'` (default) wraps the card in `<Card variant=\"elevated\">`\n * for a defined surface — what most consumers want when the card\n * stands alone on a page. `'flat'` drops the Card chrome so the\n * content sits naked — use when an outer card / sheet already\n * provides the boundary (e.g. embedded inside a `<Sheet>` or a\n * parent `<Card.Body>`).\n */\n surface?: 'flat' | 'elevated';\n\n /* ----- a11y ----- */\n\n /** Override the default region aria-label. */\n 'aria-label'?: string;\n /** Agent-readiness consumer id, surfaced as `data-component-id`. */\n id?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Helpers */\n/* -------------------------------------------------------------------- */\n\n/** Strip everything except digits + leading `+` for `tel:` URLs. */\nfunction normalisePhone(raw: string): string {\n return raw.replace(/[^\\d+]/g, '');\n}\n\n/** Build the WhatsApp `wa.me` URL. Number must already be digits-only. */\nfunction buildWhatsAppHref(number: string, message?: string): string {\n const base = `https://wa.me/${number}`;\n if (!message) return base;\n return `${base}?text=${encodeURIComponent(message)}`;\n}\n\n/** Google Maps search query — works without an API key. */\nfunction buildMapHref(address: ContactProfileCardAddress): string {\n const q = encodeURIComponent(address.line);\n return `https://www.google.com/maps/search/?api=1&query=${q}`;\n}\n\n/** Format price (cents → currency string) using the consumer's locale. */\nfunction formatPrice(cents: number, currency: string, locale: string): string {\n try {\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n }).format(cents / 100);\n } catch {\n // Locale or currency code rejected — fall back to a plain decimal.\n return (cents / 100).toFixed(2);\n }\n}\n\n/* -------------------------------------------------------------------- */\n/* MapThumbStrip — embedded Google Static Maps image */\n/* */\n/* Full-width strip rendered at the top of the card when the consumer */\n/* supplies both `address.lat`/`lng` and `googleMapsApiKey`. Same */\n/* one-shot `<img>` strategy as PracticeResults' StaticMapThumb (no JS */\n/* SDK boot → no consent gate needed), but full-card-width instead of */\n/* a 12rem aside. */\n/* -------------------------------------------------------------------- */\n\ninterface MapThumbStripProps {\n apiKey: string;\n center: { lat: number; lng: number };\n zoom: number;\n altText: string;\n}\n\n/**\n * Resolve the kit's `--map-marker-color` token to a six-character hex\n * string (no leading `#`) for Google Static Maps' `markers=color:` URL\n * parameter, which requires a literal hex value at fetch time.\n *\n * SSR-safe: when `document` is undefined we fall back to the kit's\n * brand violet. Same helper as PracticeResults — keep in sync if you\n * touch one.\n */\nfunction getStaticMapMarkerHex(): string {\n if (typeof document === 'undefined') return '4945a3';\n const raw = getComputedStyle(document.documentElement)\n .getPropertyValue('--map-marker-color')\n .trim();\n const match = /^#?([0-9a-fA-F]{6})$/.exec(raw);\n return match ? match[1] : '4945a3';\n}\n\nfunction MapThumbStrip({ apiKey, center, zoom, altText }: MapThumbStripProps) {\n // 640×192 keeps the asset under Google's 1MP free tier at scale=2\n // (1280×384 actual) and matches the strip's 12rem height at a\n // ~3.33:1 aspect ratio. Marker colour resolves from the kit's\n // `--map-marker-color` token at runtime so the value still lives\n // in `src/tokens/**` per the closed-palette constraint.\n const markerHex = getStaticMapMarkerHex();\n const src =\n `https://maps.googleapis.com/maps/api/staticmap` +\n `?center=${center.lat},${center.lng}` +\n `&zoom=${zoom}` +\n `&size=640x192&scale=2` +\n `&markers=color:0x${markerHex}%7C${center.lat},${center.lng}` +\n `&key=${encodeURIComponent(apiKey)}`;\n return (\n <img\n src={src}\n alt={altText}\n loading=\"lazy\"\n decoding=\"async\"\n width={640}\n height={192}\n className=\"ds:block ds:inline-size-full ds:block-size-[12rem] ds:[object-fit:cover] ds:rounded-[var(--radius-md)]\"\n />\n );\n}\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const ContactProfileCard = forwardRef<\n HTMLDivElement,\n ContactProfileCardProps\n>(\n (\n {\n heading,\n description,\n address,\n phone,\n whatsappNumber,\n whatsappMessage,\n email,\n website,\n languages,\n languageLabels,\n insurances,\n firstVisitPriceCents,\n currencyCode = 'EUR',\n profession,\n specializedInFearPatients,\n googleMapsApiKey,\n mapZoom = 14,\n onPhoneClick,\n onWhatsAppClick,\n onMapClick,\n onEmailClick,\n headerSlot,\n footerSlot,\n surface = 'elevated',\n 'aria-label': ariaLabel,\n id,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const headingId = useId();\n const locale = i18n.language ?? 'en';\n\n const resolvedHeading = heading ?? t('contactProfileCard.heading');\n const resolvedAriaLabel = ariaLabel ?? resolvedHeading;\n\n const formattedPrice = useMemo(() => {\n if (firstVisitPriceCents == null) return undefined;\n return formatPrice(firstVisitPriceCents, currencyCode, locale);\n }, [firstVisitPriceCents, currencyCode, locale]);\n\n // Compose the rows in display order. Each `row` carries the icon +\n // localised label + the rendered value. Skipping a field is just\n // omitting the row — `KeyValueList` collapses the subgrid cleanly.\n const rows: Array<{\n key: string;\n icon: ReactElement;\n label: string;\n value: ReactNode;\n }> = [];\n\n if (address) {\n rows.push({\n key: 'address',\n icon: <MapPin aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.address'),\n value: (\n <span className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)]\">\n <span>{address.line}</span>\n {address.lat != null && address.lng != null ? (\n <Link\n href={buildMapHref(address)}\n external\n intent=\"default\"\n onClick={onMapClick}\n >\n {t('contactProfileCard.openInGoogleMaps')}\n </Link>\n ) : null}\n </span>\n ),\n });\n }\n\n if (phone) {\n rows.push({\n key: 'phone',\n icon: <Phone aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.phone'),\n value: (\n <Link\n href={`tel:${normalisePhone(phone)}`}\n intent=\"default\"\n onClick={onPhoneClick}\n >\n {phone}\n </Link>\n ),\n });\n }\n\n if (whatsappNumber) {\n rows.push({\n key: 'whatsapp',\n icon: <MessageCircle aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.whatsapp'),\n value: (\n <Link\n href={buildWhatsAppHref(whatsappNumber, whatsappMessage)}\n external\n intent=\"default\"\n onClick={onWhatsAppClick}\n >\n {whatsappNumber}\n </Link>\n ),\n });\n }\n\n if (email) {\n rows.push({\n key: 'email',\n icon: <Mail aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.email'),\n value: (\n <Link\n href={`mailto:${email}`}\n intent=\"default\"\n onClick={onEmailClick}\n >\n {email}\n </Link>\n ),\n });\n }\n\n if (website) {\n rows.push({\n key: 'website',\n icon: <Globe aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.website'),\n value: (\n <Link href={website} external intent=\"default\">\n {website}\n </Link>\n ),\n });\n }\n\n if (languages && languages.length > 0) {\n // Resolution order, highest to lowest:\n // 1. consumer `languageLabels` override — for regional dialects,\n // brand-voice variants, or codes the kit doesn't ship.\n // 2. kit i18n bundle (`languages.<iso>`) — auto-resolves the 18\n // ISO codes the kit ships into the active locale's native\n // language name. Retires consumer-side ISO→label plumbing.\n // 3. uppercase fallback for unknown codes that the consumer\n // didn't override.\n const resolveLabel = (code: string): string => {\n if (languageLabels?.[code]) return languageLabels[code];\n const key = `languages.${code}`;\n if (i18n.exists(key)) return t(key);\n return code.toUpperCase();\n };\n rows.push({\n key: 'languages',\n icon: <LanguagesIcon aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.languages'),\n value: (\n <span className=\"ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]\">\n {languages.map((code) => (\n <Badge key={code} variant=\"neutral\">\n {resolveLabel(code)}\n </Badge>\n ))}\n </span>\n ),\n });\n }\n\n if (insurances && insurances.length > 0) {\n rows.push({\n key: 'insurances',\n icon: <ShieldCheck aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.insurances'),\n value: (\n <span className=\"ds:flex ds:flex-wrap ds:gap-[var(--spacing-2xs)]\">\n {insurances.map((ins) => (\n <Badge key={ins} variant=\"info\">\n {ins}\n </Badge>\n ))}\n </span>\n ),\n });\n }\n\n if (formattedPrice) {\n rows.push({\n key: 'firstVisitPrice',\n icon: <Banknote aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.firstVisitPrice'),\n value: formattedPrice,\n });\n }\n\n if (specializedInFearPatients) {\n rows.push({\n key: 'expertForAnxiousPatients',\n icon: <Heart aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.expertForAnxiousPatients'),\n value: t('contactProfileCard.value.yesShort'),\n });\n }\n\n if (profession) {\n rows.push({\n key: 'profession',\n icon: <Stethoscope aria-hidden=\"true\" />,\n label: t('contactProfileCard.label.profession'),\n value: profession,\n });\n }\n\n // Imperative handle for agent integrations.\n useAgentRegistration(\n contactProfileCardAgent,\n { getProfession: () => profession },\n id,\n );\n\n const body = (\n <>\n {description ? (\n <p className=\"type-body-sm ds:m-0 ds:whitespace-pre-line\">\n {description}\n </p>\n ) : null}\n {rows.length > 0 ? (\n <KeyValueList rowGap=\"md\">\n {rows.map((row) => (\n <KeyValuePair\n key={row.key}\n icon={row.icon}\n label={row.label}\n value={row.value}\n />\n ))}\n </KeyValueList>\n ) : null}\n {footerSlot}\n </>\n );\n\n // Embedded static-map thumbnail. Renders only when the consumer\n // supplies BOTH a usable lat/lng pair AND a `googleMapsApiKey`.\n // The d.ts-promised behaviour; without a key the strip is silently\n // omitted and the address row's \"Open in Google Maps\" link still\n // emits as the spatial-cue fallback.\n const showMapThumb =\n !!googleMapsApiKey &&\n address?.lat !== undefined &&\n address?.lng !== undefined;\n const mapThumb = showMapThumb ? (\n <MapThumbStrip\n apiKey={googleMapsApiKey!}\n center={{ lat: address!.lat!, lng: address!.lng! }}\n zoom={mapZoom}\n altText={t('contactProfileCard.map.alt', {\n address: address!.line,\n defaultValue: 'Map showing {{address}}',\n })}\n />\n ) : null;\n\n // `surface=\"flat\"` skips the Card wrapper — the consumer is\n // already inside a Card / Sheet and doesn't want a double border.\n const inner = (\n <>\n {mapThumb}\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n {headerSlot}\n <h2\n id={headingId}\n className=\"type-title-card ds:m-0 ds:text-[color:var(--foreground)]\"\n >\n {resolvedHeading}\n </h2>\n </div>\n {body}\n </>\n );\n\n return (\n <div\n ref={ref}\n role=\"region\"\n aria-label={resolvedAriaLabel}\n aria-labelledby={headingId}\n data-component=\"contact-profile-card\"\n data-component-id={id}\n id={id}\n className={rootVariants({ surface, className })}\n {...rest}\n >\n {surface === 'elevated' ? (\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {inner}\n </Card.Body>\n </Card>\n ) : (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n {inner}\n </div>\n )}\n </div>\n );\n },\n);\n\nContactProfileCard.displayName = 'ContactProfileCard';\n\n// Helper export so consumers can mirror the kit's row order if they\n// need to compose a partial alternative (rare).\nexport const CONTACT_PROFILE_CARD_ROW_KEYS = [\n 'address',\n 'phone',\n 'whatsapp',\n 'email',\n 'website',\n 'languages',\n 'insurances',\n 'firstVisitPrice',\n 'expertForAnxiousPatients',\n 'profession',\n] as const;\n\n// Defensive icon export so consumers can render the same glyph\n// outside the card if they need it for consistency.\nexport const CONTACT_PROFILE_CARD_ROW_ICONS: Record<\n (typeof CONTACT_PROFILE_CARD_ROW_KEYS)[number],\n LucideIcon\n> = {\n address: MapPin,\n phone: Phone,\n whatsapp: MessageCircle,\n email: Mail,\n website: Globe,\n languages: LanguagesIcon,\n insurances: ShieldCheck,\n firstVisitPrice: Banknote,\n expertForAnxiousPatients: Heart,\n profession: Stethoscope,\n};\n\n// Re-exports of the rootVariants type for downstream typing.\nexport type ContactProfileCardSurface = NonNullable<\n VariantProps<typeof rootVariants>['surface']\n>;\n\n// ExternalLink is exported by lucide-react and used elsewhere in the\n// kit; re-exporting here so consumers don't have to add it as a\n// peer-dep import for icon parity in their own UIs.\nexport { ExternalLink };\n"],"names":["__iconNode","Banknote","createLucideIcon","Phone","contactProfileCardAgent","handle","rootVariants","cva","normalisePhone","raw","buildWhatsAppHref","number","message","base","buildMapHref","address","formatPrice","cents","currency","locale","getStaticMapMarkerHex","match","MapThumbStrip","apiKey","center","zoom","altText","markerHex","src","jsx","ContactProfileCard","forwardRef","heading","description","phone","whatsappNumber","whatsappMessage","email","website","languages","languageLabels","insurances","firstVisitPriceCents","currencyCode","profession","specializedInFearPatients","googleMapsApiKey","mapZoom","onPhoneClick","onWhatsAppClick","onMapClick","onEmailClick","headerSlot","footerSlot","surface","ariaLabel","id","className","rest","ref","t","i18n","useTranslation","headingId","useId","resolvedHeading","resolvedAriaLabel","formattedPrice","useMemo","rows","MapPin","jsxs","Link","MessageCircle","Mail","Globe","resolveLabel","code","key","LanguagesIcon","Badge","ShieldCheck","ins","Heart","Stethoscope","useAgentRegistration","body","Fragment","KeyValueList","row","KeyValuePair","mapThumb","inner","Card","CONTACT_PROFILE_CARD_ROW_KEYS","CONTACT_PROFILE_CARD_ROW_ICONS"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,OAAO,MAAM,QAAQ,MAAM,GAAG,KAAK,GAAG,KAAK,IAAI,KAAK,KAAK,SAAQ,CAAE;AAAA,EAC9E,CAAC,UAAU,EAAE,IAAI,MAAM,IAAI,MAAM,GAAG,KAAK,KAAK,UAAU;AAAA,EACxD,CAAC,QAAQ,EAAE,GAAG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AA,QACD,gBAAAvB;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,IAAIkC;AAAA,YACJ,WAAU;AAAA,YAET,UAAAE;AAAA,UAAA;AAAA,QAAA;AAAA,MACH,GACF;AAAA,MACCqB;AAAA,IAAA,GACH;AAGF,WACE,gBAAAzD;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAA8B;AAAA,QACA,MAAK;AAAA,QACL,cAAYO;AAAA,QACZ,mBAAiBH;AAAA,QACjB,kBAAe;AAAA,QACf,qBAAmBP;AAAA,QACnB,IAAAA;AAAA,QACA,WAAWlD,GAAa,EAAE,SAAAgD,GAAS,WAAAG,IAAW;AAAA,QAC7C,GAAGC;AAAA,QAEH,gBAAY,aACX,gBAAA7B,EAACgE,KAAK,SAAQ,YACZ,4BAACA,EAAK,MAAL,EAAU,WAAU,kDAClB,aACH,EAAA,CACF,sBAEC,OAAA,EAAI,WAAU,kDACZ,UAAAD,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEA9D,GAAmB,cAAc;AAI1B,MAAMgE,KAAgC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAIaC,KAGT;AAAA,EACF,SAASzB;AAAA,EACT,OAAOnE;AAAA,EACP,UAAUsE;AAAA,EACV,OAAOC;AAAA,EACP,SAASC;AAAA,EACT,WAAWI;AAAAA,EACX,YAAYE;AAAA,EACZ,iBAAiBhF;AAAA,EACjB,0BAA0BkF;AAAA,EAC1B,YAAYC;AACd;","x_google_ignoreList":[0,1]}
|
|
@@ -30,7 +30,7 @@ import { D as ze } from "./date-range-picker-D4dgDlLU.js";
|
|
|
30
30
|
import { M as Ot } from "./multi-select-DOLO3K_z.js";
|
|
31
31
|
import { A as Ae } from "./autocomplete-DIgdhCGJ.js";
|
|
32
32
|
import { N as ee } from "./number-input-Dj5L3pXK.js";
|
|
33
|
-
import { B as Mt } from "./badge-
|
|
33
|
+
import { B as Mt } from "./badge-zsf5i5bH.js";
|
|
34
34
|
import { A as Pe } from "./avatar-BNQNhoyL.js";
|
|
35
35
|
import { T as jt } from "./tooltip-DvmfrNvB.js";
|
|
36
36
|
import { T as he } from "./timestamp-BV2lC-wV.js";
|
|
@@ -2332,4 +2332,4 @@ export {
|
|
|
2332
2332
|
Be as q,
|
|
2333
2333
|
xn as u
|
|
2334
2334
|
};
|
|
2335
|
-
//# sourceMappingURL=editable-currency-cell-renderer-
|
|
2335
|
+
//# sourceMappingURL=editable-currency-cell-renderer-B9VRSV_S.js.map
|