@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
|
@@ -26,65 +26,72 @@ const B = P("ds:flex", {
|
|
|
26
26
|
}
|
|
27
27
|
}), _ = g(
|
|
28
28
|
({
|
|
29
|
-
label:
|
|
30
|
-
value:
|
|
31
|
-
layout:
|
|
29
|
+
label: o,
|
|
30
|
+
value: e,
|
|
31
|
+
layout: s = "horizontal",
|
|
32
32
|
mono: r = !1,
|
|
33
33
|
copyable: l = !1,
|
|
34
34
|
copyText: v,
|
|
35
35
|
icon: d,
|
|
36
36
|
className: h,
|
|
37
|
-
...
|
|
38
|
-
},
|
|
39
|
-
const { t:
|
|
37
|
+
...k
|
|
38
|
+
}, x) => {
|
|
39
|
+
const { t: n } = I(), [C, m] = y(!1), [N, t] = y(""), c = v ?? (typeof e == "string" ? e : void 0), V = z(async () => {
|
|
40
40
|
if (c)
|
|
41
41
|
try {
|
|
42
|
-
await navigator.clipboard.writeText(c),
|
|
43
|
-
|
|
42
|
+
await navigator.clipboard.writeText(c), m(!0), t(n("keyValuePair.copied")), setTimeout(() => {
|
|
43
|
+
m(!1), t("");
|
|
44
44
|
}, 2e3);
|
|
45
45
|
} catch {
|
|
46
|
-
n(
|
|
46
|
+
t(n("keyValuePair.notAvailable")), setTimeout(() => t(""), 3e3);
|
|
47
47
|
}
|
|
48
|
-
}, [c,
|
|
48
|
+
}, [c, n]), b = [
|
|
49
49
|
"type-body ds:text-foreground ds:min-w-0 ds:shrink ds:[unicode-bidi:isolate]",
|
|
50
|
+
// `flex-1` lets the value absorb the remaining inline space
|
|
51
|
+
// when the KVP root flexes the icon / label / value as direct
|
|
52
|
+
// siblings (`hasIcon && layout === 'horizontal'`). Without it,
|
|
53
|
+
// the value would shrink to its content width and the row
|
|
54
|
+
// would leave inline-end whitespace. Vertical layout doesn't
|
|
55
|
+
// need it because the value is below the label, not beside it.
|
|
56
|
+
s === "horizontal" ? "ds:flex-1" : "",
|
|
50
57
|
r ? "ds:font-[family-name:var(--font-mono)]" : ""
|
|
51
|
-
].filter(Boolean).join(" "),
|
|
58
|
+
].filter(Boolean).join(" "), u = d != null, w = "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:min-w-0 ds:flex-1", p = /* @__PURE__ */ i(f, { children: [
|
|
52
59
|
/* @__PURE__ */ i("span", { className: "type-label ds:text-muted-foreground ds:shrink-0", children: [
|
|
53
|
-
|
|
60
|
+
o,
|
|
54
61
|
/* @__PURE__ */ a("span", { className: "ds:sr-only", children: ": " })
|
|
55
62
|
] }),
|
|
56
|
-
/* @__PURE__ */ a("span", { className:
|
|
63
|
+
/* @__PURE__ */ a("span", { className: b, children: e }),
|
|
57
64
|
l && /* @__PURE__ */ a(
|
|
58
65
|
K,
|
|
59
66
|
{
|
|
60
67
|
icon: C ? /* @__PURE__ */ a(T, {}) : /* @__PURE__ */ a(j, {}),
|
|
61
68
|
size: "sm",
|
|
62
|
-
"aria-label":
|
|
63
|
-
onClick:
|
|
69
|
+
"aria-label": n("keyValuePair.copy", { label: o }),
|
|
70
|
+
onClick: V,
|
|
64
71
|
intent: "ghost",
|
|
65
|
-
className:
|
|
72
|
+
className: s === "horizontal" ? "ds:ms-auto ds:shrink-0" : "ds:self-start"
|
|
66
73
|
}
|
|
67
74
|
)
|
|
68
75
|
] });
|
|
69
76
|
return /* @__PURE__ */ i(
|
|
70
77
|
"div",
|
|
71
78
|
{
|
|
72
|
-
ref:
|
|
73
|
-
className: B({ layout:
|
|
79
|
+
ref: x,
|
|
80
|
+
className: B({ layout: s, hasIcon: u, className: h }),
|
|
74
81
|
"data-component": "key-value-pair",
|
|
75
|
-
...
|
|
82
|
+
...k,
|
|
76
83
|
children: [
|
|
77
|
-
|
|
84
|
+
u ? /* @__PURE__ */ i(f, { children: [
|
|
78
85
|
/* @__PURE__ */ a(
|
|
79
86
|
"span",
|
|
80
87
|
{
|
|
81
88
|
"aria-hidden": "true",
|
|
82
|
-
className: "ds:inline-flex ds:shrink-0 ds:
|
|
89
|
+
className: "ds:inline-flex ds:shrink-0 ds:translate-y-0.5 ds:text-[color:var(--key-value-pair-icon-color)] ds:[&_svg]:size-4",
|
|
83
90
|
children: d
|
|
84
91
|
}
|
|
85
92
|
),
|
|
86
|
-
/* @__PURE__ */ a("div", { className:
|
|
87
|
-
] }) :
|
|
93
|
+
s === "horizontal" ? p : /* @__PURE__ */ a("div", { className: w, children: p })
|
|
94
|
+
] }) : p,
|
|
88
95
|
/* @__PURE__ */ a("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: N })
|
|
89
96
|
]
|
|
90
97
|
}
|
|
@@ -97,7 +104,7 @@ const A = {
|
|
|
97
104
|
md: "ds:gap-y-[var(--spacing-md)]",
|
|
98
105
|
lg: "ds:gap-y-[var(--spacing-lg)]"
|
|
99
106
|
}, L = g(
|
|
100
|
-
({ children:
|
|
107
|
+
({ children: o, className: e, rowGap: s = "md", ...r }, l) => /* @__PURE__ */ a(
|
|
101
108
|
"div",
|
|
102
109
|
{
|
|
103
110
|
ref: l,
|
|
@@ -105,7 +112,7 @@ const A = {
|
|
|
105
112
|
className: [
|
|
106
113
|
"ds:grid ds:grid-cols-[auto_auto_minmax(0,1fr)]",
|
|
107
114
|
"ds:gap-x-[var(--spacing-md)]",
|
|
108
|
-
A[
|
|
115
|
+
A[s],
|
|
109
116
|
// Each direct `data-component="key-value-pair"` child becomes
|
|
110
117
|
// a subgrid row spanning all three columns. The KVP's own
|
|
111
118
|
// flex layout still works inside the cell (icon shrinks-0,
|
|
@@ -115,14 +122,17 @@ const A = {
|
|
|
115
122
|
'ds:[&>[data-component="key-value-pair"]]:grid-cols-subgrid',
|
|
116
123
|
'ds:[&>[data-component="key-value-pair"]]:col-span-3',
|
|
117
124
|
'ds:[&>[data-component="key-value-pair"]]:items-baseline',
|
|
118
|
-
//
|
|
119
|
-
//
|
|
120
|
-
//
|
|
121
|
-
'
|
|
122
|
-
|
|
125
|
+
// Unset the KVP's intra-row `gap-sm` so the subgrid inherits
|
|
126
|
+
// the parent KeyValueList's `gap-x-md` for every track gap
|
|
127
|
+
// (icon→label and label→value). `gap-0` here would override
|
|
128
|
+
// the parent's gap and crowd the icon against the label;
|
|
129
|
+
// `[gap:normal]` is the subgrid-spec way to defer to the
|
|
130
|
+
// parent.
|
|
131
|
+
'ds:[&>[data-component="key-value-pair"]]:[gap:normal]',
|
|
132
|
+
e
|
|
123
133
|
].filter(Boolean).join(" "),
|
|
124
134
|
...r,
|
|
125
|
-
children:
|
|
135
|
+
children: o
|
|
126
136
|
}
|
|
127
137
|
)
|
|
128
138
|
);
|
|
@@ -131,4 +141,4 @@ export {
|
|
|
131
141
|
L as K,
|
|
132
142
|
_ as a
|
|
133
143
|
};
|
|
134
|
-
//# sourceMappingURL=key-value-pair-
|
|
144
|
+
//# sourceMappingURL=key-value-pair-CkQIb9EG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key-value-pair-CkQIb9EG.js","sources":["../../src/components/key-value-pair/key-value-pair.tsx"],"sourcesContent":["import { forwardRef, useState, useCallback, type HTMLAttributes } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Copy, Check } from 'lucide-react';\nimport { IconButton } from '../button/icon-button';\n\n/* ------------------------------------------------------------------ */\n/* CVA — root wrapper */\n/* */\n/* The layout variants below describe the LOGICAL flow of label/value. */\n/* When an `icon` prop is supplied, the root flips to `flex-row` and */\n/* renders the icon at the leading edge regardless of the chosen */\n/* layout — the layout then governs the inner label/value stack. Cap- */\n/* height alignment is handled by `items-start` + a small `mt` offset */\n/* on the icon wrapper so a wrapping value doesn't push the icon */\n/* downward. */\n/* ------------------------------------------------------------------ */\n\nconst keyValuePairVariants = cva('ds:flex', {\n variants: {\n layout: {\n horizontal: 'ds:flex-row ds:items-center ds:gap-[var(--spacing-sm)]',\n vertical: 'ds:flex-col ds:gap-[var(--spacing-xs)]',\n },\n /** Internal — flips the root to a horizontal flex when an icon\n is present so the icon can sit at the leading edge of both\n horizontal and vertical inner stacks. `items-start` keeps the\n icon anchored to the label row even when the value wraps. */\n hasIcon: {\n true: 'ds:flex-row ds:items-start ds:gap-[var(--spacing-sm)]',\n false: '',\n },\n },\n defaultVariants: {\n layout: 'horizontal',\n hasIcon: false,\n },\n});\n\n/* ------------------------------------------------------------------ */\n/* KeyValuePairProps */\n/* ------------------------------------------------------------------ */\n\nexport interface KeyValuePairProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n Omit<VariantProps<typeof keyValuePairVariants>, 'hasIcon'> {\n /** The label (term) */\n label: string;\n /** The value — accepts plain text, Badge, Tag, monospace code, any ReactNode */\n value: React.ReactNode;\n /** Layout direction */\n layout?: 'horizontal' | 'vertical';\n /** Render value in monospace font */\n mono?: boolean;\n /** Show a copy-to-clipboard IconButton beside the value */\n copyable?: boolean;\n /** The text to copy — defaults to `value` if value is a string */\n copyText?: string;\n /**\n * Optional decorative icon rendered at the leading edge of the pair.\n * Pass a `lucide-react` icon (or any single React element) for\n * visual consistency. The wrapper applies `aria-hidden=\"true\"` and\n * paints the icon with `var(--key-value-pair-icon-color)` (defaults\n * to `--muted-foreground`); consumers can recolour the slot via\n * that token without forking the component.\n *\n * Cap-height alignment with the label is automatic — the wrapper\n * uses `mt-0.5` so the glyph rides the label row, not the\n * geometric centre of a wrapping value.\n *\n * Type is `ReactElement` (not the broader `ReactNode`) so the\n * intent is clear at the call site: this slot is for a single\n * SVG/icon, not arbitrary fragments, strings, or numbers.\n */\n icon?: React.ReactElement | null;\n}\n\n/* ------------------------------------------------------------------ */\n/* KeyValuePair */\n/* ------------------------------------------------------------------ */\n\nexport const KeyValuePair = forwardRef<HTMLDivElement, KeyValuePairProps>(\n (\n {\n label,\n value,\n layout = 'horizontal',\n mono = false,\n copyable = false,\n copyText,\n icon,\n className,\n ...props\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const [copied, setCopied] = useState(false);\n const [announcement, setAnnouncement] = useState('');\n\n const textToCopy =\n copyText ?? (typeof value === 'string' ? value : undefined);\n\n const handleCopy = useCallback(async () => {\n if (!textToCopy) {\n if (import.meta.env.DEV) {\n console.warn(\n 'KeyValuePair: copyable is true but no copyText was provided and value is not a string. Copy no-op.',\n );\n }\n return;\n }\n\n try {\n await navigator.clipboard.writeText(textToCopy);\n setCopied(true);\n setAnnouncement(t('keyValuePair.copied'));\n setTimeout(() => {\n setCopied(false);\n setAnnouncement('');\n }, 2000);\n } catch {\n setAnnouncement(t('keyValuePair.notAvailable'));\n setTimeout(() => setAnnouncement(''), 3000);\n }\n }, [textToCopy, t]);\n\n const valueClasses = [\n 'type-body ds:text-foreground ds:min-w-0 ds:shrink ds:[unicode-bidi:isolate]',\n // `flex-1` lets the value absorb the remaining inline space\n // when the KVP root flexes the icon / label / value as direct\n // siblings (`hasIcon && layout === 'horizontal'`). Without it,\n // the value would shrink to its content width and the row\n // would leave inline-end whitespace. Vertical layout doesn't\n // need it because the value is below the label, not beside it.\n layout === 'horizontal' ? 'ds:flex-1' : '',\n mono ? 'ds:font-[family-name:var(--font-mono)]' : '',\n ]\n .filter(Boolean)\n .join(' ');\n\n const hasIcon = icon !== undefined && icon !== null;\n\n // Inner stack — used ONLY for `layout=\"vertical\"` when an icon is\n // present (icon on the leading edge, label-on-top-of-value stacked\n // next to it). For `layout=\"horizontal\"` we render the icon /\n // label / value as direct flex children of the root — wrapping\n // them in a single `<div>` would break the KeyValueList subgrid\n // (the subgrid's 3 tracks would collapse to 2: the wrapper +\n // icon). See the conditional below.\n const innerStackClass =\n 'ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:min-w-0 ds:flex-1';\n\n const stack = (\n <>\n <span className=\"type-label ds:text-muted-foreground ds:shrink-0\">\n {label}\n <span className=\"ds:sr-only\">: </span>\n </span>\n <span className={valueClasses}>{value}</span>\n {copyable && (\n <IconButton\n icon={copied ? <Check /> : <Copy />}\n size=\"sm\"\n aria-label={t('keyValuePair.copy', { label })}\n onClick={handleCopy}\n intent=\"ghost\"\n className={\n layout === 'horizontal'\n ? 'ds:ms-auto ds:shrink-0'\n : 'ds:self-start'\n }\n />\n )}\n </>\n );\n\n return (\n <div\n ref={ref}\n className={keyValuePairVariants({ layout, hasIcon, className })}\n data-component=\"key-value-pair\"\n {...props}\n >\n {hasIcon ? (\n <>\n {/* Decorative icon wrapper. `aria-hidden` so SR users only\n hear \"<label>: <value>\" — the icon is brand polish,\n not semantic content.\n\n `translate-y` shifts the icon down by 2px visually so\n its centre lines up with the label's x-height centre.\n In a baseline-aligned subgrid row, the icon's margin-\n box bottom pins to the label's text baseline — that\n leaves the 16px SVG sitting visually 3-4px above the\n label's centre. `translate-y` adjusts only the paint\n position; the underlying baseline math still holds,\n so multi-line value cells (e.g. address + map link)\n stay correctly aligned with the FIRST line of the\n value. */}\n <span\n aria-hidden=\"true\"\n className=\"ds:inline-flex ds:shrink-0 ds:translate-y-0.5 ds:text-[color:var(--key-value-pair-icon-color)] ds:[&_svg]:size-4\"\n >\n {icon}\n </span>\n {/* `horizontal` layout: render label / value / copy as\n direct flex children of the root so each piece falls\n into its own track when this KVP is promoted to a\n subgrid row by `<KeyValueList>`. Wrapping them in a\n `<div>` here would collapse the subgrid's 3 tracks\n (icon | label | value) to 2 (icon | wrapper) and labels\n across rows would no longer share a column. The root's\n `flex flex-row` + `gap-sm` keeps the standalone visual\n identical.\n\n `vertical` layout still needs the wrapper because the\n stack is column-flow — label-on-top-of-value next to\n the icon. */}\n {layout === 'horizontal' ? (\n stack\n ) : (\n <div className={innerStackClass}>{stack}</div>\n )}\n </>\n ) : (\n stack\n )}\n <span role=\"status\" aria-live=\"polite\" className=\"ds:sr-only\">\n {announcement}\n </span>\n </div>\n );\n },\n);\n\nKeyValuePair.displayName = 'KeyValuePair';\n\n/* ------------------------------------------------------------------ */\n/* KeyValueList — subgrid alignment for a column of KVP rows */\n/* */\n/* When several `<KeyValuePair>` rows live in the same card (practice */\n/* profile, settings panel, contact card, etc.), the per-row flex */\n/* layout means each row's label column has a different width. The */\n/* values end up zigzagged. Wrapping in `<KeyValueList>` puts all rows */\n/* into a single 3-column CSS subgrid (icon | label | value), so */\n/* labels share a column across rows and values start at the same */\n/* inline-start edge. */\n/* */\n/* Standalone `<KeyValuePair>` instances outside a `<KeyValueList>` */\n/* keep their existing per-row flex layout — no behaviour change for */\n/* consumers that didn't opt in. */\n/* ------------------------------------------------------------------ */\n\nexport interface KeyValueListProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Gap between rows. Maps to spacing tokens — defaults to `md`.\n * Smaller gaps suit dense settings panels; larger gaps suit\n * profile cards.\n */\n rowGap?: 'sm' | 'md' | 'lg';\n}\n\nconst rowGapClassMap: Record<\n NonNullable<KeyValueListProps['rowGap']>,\n string\n> = {\n sm: 'ds:gap-y-[var(--spacing-sm)]',\n md: 'ds:gap-y-[var(--spacing-md)]',\n lg: 'ds:gap-y-[var(--spacing-lg)]',\n};\n\nexport const KeyValueList = forwardRef<HTMLDivElement, KeyValueListProps>(\n ({ children, className, rowGap = 'md', ...props }, ref) => {\n // Three-column subgrid: icon | label | value.\n // - col 1: `auto` — width of the widest icon (or 0 if no rows have icons)\n // - col 2: `auto` — width of the widest label, shared across all rows\n // - col 3: `minmax(0, 1fr)` — value flexes; `minmax` prevents the\n // value from forcing the grid wider than its container when the\n // value contains a long unbroken string (e.g. an email or URL).\n //\n // Each child `<KeyValuePair>` (which renders as a `<div>` with a\n // `data-component=\"key-value-pair\"` marker) is promoted into a\n // subgrid row by the CSS below — the cell boundaries align across\n // every direct child.\n //\n // We render as `<div>` (not `<dl>`): axe enforces \"dl can only\n // contain dt/dd\" and the inner KVP renders as a `<div>`. The KVP's\n // own SR markup (label + `<span class=\"sr-only\">: </span>` + value)\n // already conveys term-value semantics — wrapping in a `<dl>`\n // doesn't add anything the screen reader doesn't already get.\n return (\n <div\n ref={ref}\n data-component=\"key-value-list\"\n className={[\n 'ds:grid ds:grid-cols-[auto_auto_minmax(0,1fr)]',\n 'ds:gap-x-[var(--spacing-md)]',\n rowGapClassMap[rowGap],\n // Each direct `data-component=\"key-value-pair\"` child becomes\n // a subgrid row spanning all three columns. The KVP's own\n // flex layout still works inside the cell (icon shrinks-0,\n // label shrinks-0, value flexes) — subgrid just aligns the\n // boundaries between siblings.\n 'ds:[&>[data-component=\"key-value-pair\"]]:grid',\n 'ds:[&>[data-component=\"key-value-pair\"]]:grid-cols-subgrid',\n 'ds:[&>[data-component=\"key-value-pair\"]]:col-span-3',\n 'ds:[&>[data-component=\"key-value-pair\"]]:items-baseline',\n // Unset the KVP's intra-row `gap-sm` so the subgrid inherits\n // the parent KeyValueList's `gap-x-md` for every track gap\n // (icon→label and label→value). `gap-0` here would override\n // the parent's gap and crowd the icon against the label;\n // `[gap:normal]` is the subgrid-spec way to defer to the\n // parent.\n 'ds:[&>[data-component=\"key-value-pair\"]]:[gap:normal]',\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n {...props}\n >\n {children}\n </div>\n );\n },\n);\n\nKeyValueList.displayName = 'KeyValueList';\n"],"names":["keyValuePairVariants","cva","KeyValuePair","forwardRef","label","value","layout","mono","copyable","copyText","icon","className","props","ref","t","useTranslation","copied","setCopied","useState","announcement","setAnnouncement","textToCopy","handleCopy","useCallback","valueClasses","hasIcon","innerStackClass","stack","jsxs","Fragment","jsx","IconButton","Check","Copy","rowGapClassMap","KeyValueList","children","rowGap"],"mappings":";;;;;;;AAkBA,MAAMA,IAAuBC,EAAI,WAAW;AAAA,EAC1C,UAAU;AAAA,IACR,QAAQ;AAAA,MACN,YAAY;AAAA,MACZ,UAAU;AAAA,IAAA;AAAA;AAAA;AAAA;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