@alfadocs/ui-kit-debug 0.6.1 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{alert-B1sj8Ss0.js → alert-34A3K8y-.js} +79 -69
- package/dist/_chunks/alert-34A3K8y-.js.map +1 -0
- package/dist/_chunks/{audio-recorder-BdBbU-UK.js → audio-recorder-B60FLnUO.js} +2 -2
- package/dist/_chunks/{audio-recorder-BdBbU-UK.js.map → audio-recorder-B60FLnUO.js.map} +1 -1
- package/dist/_chunks/contact-card-DNyATxKv.js.map +1 -1
- package/dist/_chunks/{freemium-paywall-CrVefV0M.js → freemium-paywall-BA02zIOx.js} +2 -2
- package/dist/_chunks/{freemium-paywall-CrVefV0M.js.map → freemium-paywall-BA02zIOx.js.map} +1 -1
- package/dist/_chunks/{payment-form-B_BdHwjb.js → payment-form-BIk2K3i3.js} +2 -2
- package/dist/_chunks/{payment-form-B_BdHwjb.js.map → payment-form-BIk2K3i3.js.map} +1 -1
- package/dist/_chunks/{pdf-viewer-CZIfY08H.js → pdf-viewer-DuPrR5Ty.js} +2 -2
- package/dist/_chunks/{pdf-viewer-CZIfY08H.js.map → pdf-viewer-DuPrR5Ty.js.map} +1 -1
- package/dist/_chunks/use-locale-C5rS3Xon.js +71 -0
- package/dist/_chunks/use-locale-C5rS3Xon.js.map +1 -0
- package/dist/_chunks/{warning-stack-VygGHSqC.js → warning-stack-CskQPAQ2.js} +2 -2
- package/dist/_chunks/{warning-stack-VygGHSqC.js.map → warning-stack-CskQPAQ2.js.map} +1 -1
- package/dist/_chunks/{workflow-map-Bi5liGzo.js → workflow-map-D6Vsc2nY.js} +2 -2
- package/dist/_chunks/{workflow-map-Bi5liGzo.js.map → workflow-map-D6Vsc2nY.js.map} +1 -1
- package/dist/agent-catalog.json +1 -1
- package/dist/components/alert/alert.d.ts.map +1 -1
- package/dist/components/alert/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/contact-card/contact-card.d.ts.map +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/matrix-rain/matrix-rain.d.ts +1 -1
- package/dist/components/payment-form/index.js +1 -1
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/sheet/sheet.d.ts +1 -1
- package/dist/components/stat/stat.d.ts +1 -1
- package/dist/components/theme-toggle/theme-toggle.d.ts +1 -1
- package/dist/components/warning-stack/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +8 -7
- package/dist/hooks/use-scroll-to-first-error.d.ts +64 -0
- package/dist/hooks/use-scroll-to-first-error.d.ts.map +1 -0
- package/dist/index.js +474 -473
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/alert-B1sj8Ss0.js.map +0 -1
- package/dist/_chunks/use-locale-BuXR_Zl9.js +0 -32
- package/dist/_chunks/use-locale-BuXR_Zl9.js.map +0 -1
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import { jsxs as D, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { X
|
|
6
|
-
import { C as
|
|
7
|
-
import { T as
|
|
8
|
-
import { C as
|
|
9
|
-
import { I as
|
|
10
|
-
const
|
|
2
|
+
import { forwardRef as i, useState as _, useRef as R, useCallback as V, Children as O, isValidElement as F } from "react";
|
|
3
|
+
import { c as L } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as W } from "react-i18next";
|
|
5
|
+
import { X } from "./x-CCcI3eJp.js";
|
|
6
|
+
import { C as G } from "./circle-x-Du2CmjaU.js";
|
|
7
|
+
import { T as H } from "./triangle-alert-CBPUIzQo.js";
|
|
8
|
+
import { C as M } from "./circle-check-9AeSgJD_.js";
|
|
9
|
+
import { I as P } from "./info-B9XNKn05.js";
|
|
10
|
+
const U = L(
|
|
11
11
|
[
|
|
12
|
-
|
|
12
|
+
// Default `items-center` keeps the icon + dismiss optically aligned
|
|
13
|
+
// with a single-line description. The `data-[has-title=true]`
|
|
14
|
+
// selector flips to `items-start` when an `<Alert.Title>` is
|
|
15
|
+
// present so the icon anchors to the heading's top instead of
|
|
16
|
+
// floating against the centre of the title+description block.
|
|
17
|
+
// For multi-line descriptions without a title, `items-center` still
|
|
18
|
+
// looks right at 2–3 lines and matches Toast / Notification.
|
|
19
|
+
"ds:flex ds:items-center ds:data-[has-title=true]:items-start ds:gap-[var(--spacing-md)]",
|
|
13
20
|
"ds:rounded-[var(--radius-md)]",
|
|
14
21
|
"ds:border ds:border-[length:var(--border-width-sm)]",
|
|
15
22
|
"ds:p-[var(--spacing-md)]",
|
|
@@ -57,7 +64,7 @@ const M = E(
|
|
|
57
64
|
variant: "info"
|
|
58
65
|
}
|
|
59
66
|
}
|
|
60
|
-
),
|
|
67
|
+
), h = "ds:shrink-0 ds:size-5", $ = `${h} ds:mt-0.5`, q = [
|
|
61
68
|
"ds:ms-auto ds:shrink-0 ds:inline-flex ds:items-center ds:justify-center",
|
|
62
69
|
"ds:rounded-[var(--radius-sm)]",
|
|
63
70
|
"ds:min-h-[var(--min-target-size)] ds:min-w-[var(--min-target-size)]",
|
|
@@ -68,92 +75,95 @@ const M = E(
|
|
|
68
75
|
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
69
76
|
"ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
70
77
|
"ds:forced-colors:focus-visible:outline-[CanvasText]"
|
|
71
|
-
].join(" "),
|
|
72
|
-
info: { icon: /* @__PURE__ */ t(
|
|
78
|
+
].join(" "), J = {
|
|
79
|
+
info: { icon: /* @__PURE__ */ t(P, { "aria-hidden": "true" }), role: "status", live: "polite" },
|
|
73
80
|
success: {
|
|
74
|
-
icon: /* @__PURE__ */ t(
|
|
81
|
+
icon: /* @__PURE__ */ t(M, { "aria-hidden": "true" }),
|
|
75
82
|
role: "status",
|
|
76
83
|
live: "polite"
|
|
77
84
|
},
|
|
78
85
|
warning: {
|
|
79
|
-
icon: /* @__PURE__ */ t(
|
|
86
|
+
icon: /* @__PURE__ */ t(H, { "aria-hidden": "true" }),
|
|
80
87
|
role: "alert",
|
|
81
88
|
live: "assertive"
|
|
82
89
|
},
|
|
83
90
|
error: {
|
|
84
|
-
icon: /* @__PURE__ */ t(
|
|
91
|
+
icon: /* @__PURE__ */ t(G, { "aria-hidden": "true" }),
|
|
85
92
|
role: "alert",
|
|
86
93
|
live: "assertive"
|
|
87
94
|
}
|
|
88
|
-
},
|
|
89
|
-
({ as: s = "h5", className:
|
|
95
|
+
}, c = i(
|
|
96
|
+
({ as: s = "h5", className: o, ...e }, r) => /* @__PURE__ */ t(
|
|
90
97
|
s,
|
|
91
98
|
{
|
|
92
|
-
ref:
|
|
93
|
-
className: ["type-title-item",
|
|
94
|
-
...
|
|
99
|
+
ref: r,
|
|
100
|
+
className: ["type-title-item", o].filter(Boolean).join(" "),
|
|
101
|
+
...e
|
|
95
102
|
}
|
|
96
103
|
)
|
|
97
104
|
);
|
|
98
|
-
|
|
99
|
-
const
|
|
105
|
+
c.displayName = "Alert.Title";
|
|
106
|
+
const w = i(({ className: s, ...o }, e) => /* @__PURE__ */ t(
|
|
100
107
|
"p",
|
|
101
108
|
{
|
|
102
|
-
ref:
|
|
109
|
+
ref: e,
|
|
103
110
|
className: ["ds:mt-[var(--spacing-xs)] type-body-sm", s].filter(Boolean).join(" "),
|
|
104
|
-
...
|
|
111
|
+
...o
|
|
105
112
|
}
|
|
106
113
|
));
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
({ className: s, ...
|
|
114
|
+
w.displayName = "Alert.Description";
|
|
115
|
+
const A = i(
|
|
116
|
+
({ className: s, ...o }, e) => /* @__PURE__ */ t(
|
|
110
117
|
"div",
|
|
111
118
|
{
|
|
112
|
-
ref:
|
|
119
|
+
ref: e,
|
|
113
120
|
className: [
|
|
114
121
|
"ds:mt-[var(--spacing-sm)] ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]",
|
|
115
122
|
s
|
|
116
123
|
].filter(Boolean).join(" "),
|
|
117
|
-
...
|
|
124
|
+
...o
|
|
118
125
|
}
|
|
119
126
|
)
|
|
120
127
|
);
|
|
121
|
-
|
|
122
|
-
const
|
|
128
|
+
A.displayName = "Alert.Action";
|
|
129
|
+
const N = i(
|
|
123
130
|
({
|
|
124
131
|
variant: s = "info",
|
|
125
|
-
dismissible:
|
|
126
|
-
open:
|
|
127
|
-
onOpenChange:
|
|
128
|
-
icon:
|
|
129
|
-
live:
|
|
130
|
-
className:
|
|
131
|
-
children:
|
|
132
|
-
...
|
|
132
|
+
dismissible: o = !1,
|
|
133
|
+
open: e,
|
|
134
|
+
onOpenChange: r,
|
|
135
|
+
icon: m,
|
|
136
|
+
live: y,
|
|
137
|
+
className: T,
|
|
138
|
+
children: u,
|
|
139
|
+
...C
|
|
133
140
|
}, j) => {
|
|
134
|
-
const { t:
|
|
141
|
+
const { t: I } = W(), [k, S] = _(!0), [f, v] = _(!1), n = R(null), g = e !== void 0, E = g ? e : k, z = V(() => {
|
|
135
142
|
if (typeof window > "u") return 200;
|
|
136
|
-
const
|
|
137
|
-
if (!
|
|
138
|
-
const
|
|
139
|
-
return Number.isFinite(
|
|
143
|
+
const a = window.getComputedStyle(document.documentElement).getPropertyValue("--animation-duration");
|
|
144
|
+
if (!a) return 200;
|
|
145
|
+
const x = a.trim(), l = parseFloat(x);
|
|
146
|
+
return Number.isFinite(l) ? x.endsWith("ms") ? l : l * 1e3 : 200;
|
|
140
147
|
}, []);
|
|
141
|
-
if (!
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
148
|
+
if (!E) return null;
|
|
149
|
+
const d = J[s], p = m !== void 0 ? m : d.icon, b = O.toArray(u).some(
|
|
150
|
+
(a) => F(a) && a.type === c
|
|
151
|
+
), B = () => {
|
|
152
|
+
f || (v(!0), n.current && clearTimeout(n.current), n.current = setTimeout(() => {
|
|
153
|
+
v(!1), g || S(!1), r == null || r(!1);
|
|
154
|
+
}, z()));
|
|
146
155
|
};
|
|
147
156
|
return /* @__PURE__ */ D(
|
|
148
157
|
"div",
|
|
149
158
|
{
|
|
150
159
|
ref: j,
|
|
151
|
-
role:
|
|
152
|
-
"aria-live":
|
|
160
|
+
role: d.role,
|
|
161
|
+
"aria-live": y ?? d.live,
|
|
153
162
|
"data-component": "alert",
|
|
154
|
-
"data-
|
|
163
|
+
"data-has-title": b ? "true" : "false",
|
|
164
|
+
"data-state": f ? "closing" : "open",
|
|
155
165
|
className: [
|
|
156
|
-
|
|
166
|
+
U({ variant: s, className: T }),
|
|
157
167
|
// Entry: fade + slide-down on mount. Exit: fade + slide-up + slight
|
|
158
168
|
// scale when dismissed. Driven by `tw-animate-css`. Respects
|
|
159
169
|
// `prefers-reduced-motion` via `motion-safe:` and zeroes under the
|
|
@@ -167,18 +177,18 @@ const w = a(
|
|
|
167
177
|
"ds:motion-safe:data-[state=closing]:fill-mode-forwards",
|
|
168
178
|
"ds:motion-safe:duration-[var(--animation-duration)]"
|
|
169
179
|
].join(" "),
|
|
170
|
-
...
|
|
180
|
+
...C,
|
|
171
181
|
children: [
|
|
172
|
-
|
|
173
|
-
/* @__PURE__ */ t("div", { className: "ds:flex-1 ds:min-w-0", children:
|
|
174
|
-
|
|
182
|
+
p ? /* @__PURE__ */ t("span", { className: b ? $ : h, children: p }) : null,
|
|
183
|
+
/* @__PURE__ */ t("div", { className: "ds:flex-1 ds:min-w-0", children: u }),
|
|
184
|
+
o ? /* @__PURE__ */ t(
|
|
175
185
|
"button",
|
|
176
186
|
{
|
|
177
187
|
type: "button",
|
|
178
|
-
"aria-label":
|
|
179
|
-
onClick:
|
|
180
|
-
className:
|
|
181
|
-
children: /* @__PURE__ */ t(
|
|
188
|
+
"aria-label": I("ui.common.close", "Close"),
|
|
189
|
+
onClick: B,
|
|
190
|
+
className: q,
|
|
191
|
+
children: /* @__PURE__ */ t(X, { "aria-hidden": "true", className: "ds:size-4" })
|
|
182
192
|
}
|
|
183
193
|
) : null
|
|
184
194
|
]
|
|
@@ -186,13 +196,13 @@ const w = a(
|
|
|
186
196
|
);
|
|
187
197
|
}
|
|
188
198
|
);
|
|
189
|
-
|
|
190
|
-
const
|
|
191
|
-
Title:
|
|
192
|
-
Description:
|
|
193
|
-
Action:
|
|
199
|
+
N.displayName = "Alert";
|
|
200
|
+
const at = Object.assign(N, {
|
|
201
|
+
Title: c,
|
|
202
|
+
Description: w,
|
|
203
|
+
Action: A
|
|
194
204
|
});
|
|
195
205
|
export {
|
|
196
|
-
|
|
206
|
+
at as A
|
|
197
207
|
};
|
|
198
|
-
//# sourceMappingURL=alert-
|
|
208
|
+
//# sourceMappingURL=alert-34A3K8y-.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-34A3K8y-.js","sources":["../../src/components/alert/alert.tsx"],"sourcesContent":["import {\n Children,\n forwardRef,\n isValidElement,\n useCallback,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Info, CircleCheck, TriangleAlert, CircleX, X } from 'lucide-react';\n\nconst alertVariants = cva(\n [\n // Default `items-center` keeps the icon + dismiss optically aligned\n // with a single-line description. The `data-[has-title=true]`\n // selector flips to `items-start` when an `<Alert.Title>` is\n // present so the icon anchors to the heading's top instead of\n // floating against the centre of the title+description block.\n // For multi-line descriptions without a title, `items-center` still\n // looks right at 2–3 lines and matches Toast / Notification.\n 'ds:flex ds:items-center ds:data-[has-title=true]:items-start ds:gap-[var(--spacing-md)]',\n 'ds:rounded-[var(--radius-md)]',\n 'ds:border ds:border-[length:var(--border-width-sm)]',\n 'ds:p-[var(--spacing-md)]',\n 'ds:break-words',\n ].join(' '),\n {\n variants: {\n // Each variant paints `<Button intent=\"tonal\">` descendants via a\n // child selector — the button carries `data-intent=\"tonal\"`, the\n // Alert applies the matching tint (`*-foreground` for bg + the\n // surface `--background` for fg). Descendant selectors sidestep\n // custom-property inheritance and are rock-solid across themes.\n variant: {\n info: [\n 'ds:border-[color:var(--info)]',\n 'ds:bg-[color-mix(in_srgb,var(--info)_10%,transparent)]',\n 'ds:text-[var(--info-foreground)]',\n 'ds:[&_[data-intent=tonal]]:bg-[color:var(--info-foreground)]',\n 'ds:[&_[data-intent=tonal]]:text-[color:var(--background)]',\n ].join(' '),\n success: [\n 'ds:border-[color:var(--success)]',\n 'ds:bg-[color-mix(in_srgb,var(--success)_10%,transparent)]',\n 'ds:text-[var(--success-foreground)]',\n 'ds:[&_[data-intent=tonal]]:bg-[color:var(--success-foreground)]',\n 'ds:[&_[data-intent=tonal]]:text-[color:var(--background)]',\n ].join(' '),\n warning: [\n 'ds:border-[color:var(--warning)]',\n 'ds:bg-[color-mix(in_srgb,var(--warning)_10%,transparent)]',\n 'ds:text-[var(--warning-foreground)]',\n 'ds:[&_[data-intent=tonal]]:bg-[color:var(--warning-foreground)]',\n 'ds:[&_[data-intent=tonal]]:text-[color:var(--background)]',\n ].join(' '),\n error: [\n 'ds:border-[color:var(--error)]',\n 'ds:bg-[color-mix(in_srgb,var(--error)_10%,transparent)]',\n 'ds:text-[var(--error-foreground)]',\n 'ds:[&_[data-intent=tonal]]:bg-[color:var(--error-foreground)]',\n 'ds:[&_[data-intent=tonal]]:text-[color:var(--background)]',\n ].join(' '),\n },\n },\n defaultVariants: {\n variant: 'info',\n },\n },\n);\n\n// Icon stays `mt-0.5` only when an `<Alert.Title>` is present — that\n// offset compensates for the title's cap-height vs. line-box origin so\n// the glyph aligns with the heading's caps. Without a title, the\n// container uses `items-center` and the offset would push the icon\n// 2px off the optical axis.\nconst ICON_BASE = 'ds:shrink-0 ds:size-5';\nconst ICON_WITH_TITLE = `${ICON_BASE} ds:mt-0.5`;\n\nconst CLOSE_BUTTON_CLASSES = [\n 'ds:ms-auto ds:shrink-0 ds:inline-flex ds:items-center ds:justify-center',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:min-h-[var(--min-target-size)] ds:min-w-[var(--min-target-size)]',\n 'ds:-mt-[var(--spacing-xs)] ds:-me-[var(--spacing-xs)]',\n 'ds:text-current ds:opacity-70',\n 'ds:hover:opacity-100',\n 'ds:transition-opacity ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\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:forced-colors:focus-visible:outline-[CanvasText]',\n].join(' ');\n\nconst VARIANT_CONFIG = {\n info: { icon: <Info aria-hidden=\"true\" />, role: 'status', live: 'polite' },\n success: {\n icon: <CircleCheck aria-hidden=\"true\" />,\n role: 'status',\n live: 'polite',\n },\n warning: {\n icon: <TriangleAlert aria-hidden=\"true\" />,\n role: 'alert',\n live: 'assertive',\n },\n error: {\n icon: <CircleX aria-hidden=\"true\" />,\n role: 'alert',\n live: 'assertive',\n },\n} as const;\n\ninterface AlertTitleProps extends HTMLAttributes<HTMLHeadingElement> {\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span';\n}\n\nconst AlertTitle = forwardRef<HTMLHeadingElement, AlertTitleProps>(\n ({ as: Tag = 'h5', className, ...props }, ref) => (\n <Tag\n ref={ref}\n className={['type-title-item', className].filter(Boolean).join(' ')}\n {...props}\n />\n ),\n);\nAlertTitle.displayName = 'Alert.Title';\n\nconst AlertDescription = forwardRef<\n HTMLParagraphElement,\n HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p\n ref={ref}\n className={['ds:mt-[var(--spacing-xs)] type-body-sm', className]\n .filter(Boolean)\n .join(' ')}\n {...props}\n />\n));\nAlertDescription.displayName = 'Alert.Description';\n\nconst AlertAction = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={[\n 'ds:mt-[var(--spacing-sm)] ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]',\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n {...props}\n />\n ),\n);\nAlertAction.displayName = 'Alert.Action';\n\nexport interface AlertProps\n extends\n Omit<HTMLAttributes<HTMLDivElement>, 'role'>,\n VariantProps<typeof alertVariants> {\n variant?: 'info' | 'success' | 'warning' | 'error';\n dismissible?: boolean;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n icon?: ReactNode;\n live?: 'assertive' | 'polite' | 'off';\n}\n\nexport type { AlertTitleProps };\n\nconst AlertRoot = forwardRef<HTMLDivElement, AlertProps>(\n (\n {\n variant = 'info',\n dismissible = false,\n open: controlledOpen,\n onOpenChange,\n icon,\n live,\n className,\n children,\n ...props\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const [internalOpen, setInternalOpen] = useState(true);\n const [isClosing, setIsClosing] = useState(false);\n const closeTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const isControlled = controlledOpen !== undefined;\n const isOpen = isControlled ? controlledOpen : internalOpen;\n\n const animationDurationMs = useCallback((): number => {\n if (typeof window === 'undefined') return 200;\n const raw = window\n .getComputedStyle(document.documentElement)\n .getPropertyValue('--animation-duration');\n if (!raw) return 200;\n const trimmed = raw.trim();\n const n = parseFloat(trimmed);\n if (!Number.isFinite(n)) return 200;\n return trimmed.endsWith('ms') ? n : n * 1000;\n }, []);\n\n if (!isOpen) return null;\n\n const config = VARIANT_CONFIG[variant];\n const effectiveIcon = icon !== undefined ? icon : config.icon;\n\n // Detect an `<Alert.Title>` anywhere in the immediate children so\n // the root can flip its cross-axis alignment. Nested wrappers\n // around a Title aren't supported — keep the API as flat as the\n // existing `Alert.Title` / `Alert.Description` convention.\n const hasTitle = Children.toArray(children).some(\n (child) => isValidElement(child) && child.type === AlertTitle,\n );\n\n const handleDismiss = () => {\n if (isClosing) return;\n setIsClosing(true);\n if (closeTimerRef.current) clearTimeout(closeTimerRef.current);\n closeTimerRef.current = setTimeout(() => {\n setIsClosing(false);\n if (!isControlled) setInternalOpen(false);\n onOpenChange?.(false);\n }, animationDurationMs());\n };\n\n return (\n <div\n ref={ref}\n role={config.role}\n aria-live={live ?? config.live}\n data-component=\"alert\"\n data-has-title={hasTitle ? 'true' : 'false'}\n data-state={isClosing ? 'closing' : 'open'}\n className={[\n alertVariants({ variant, className }),\n // Entry: fade + slide-down on mount. Exit: fade + slide-up + slight\n // scale when dismissed. Driven by `tw-animate-css`. Respects\n // `prefers-reduced-motion` via `motion-safe:` and zeroes under the\n // accessible theme (`--animation-duration: 0ms`).\n 'ds:motion-safe:animate-in ds:motion-safe:fade-in-0 ds:motion-safe:slide-in-from-top-2',\n 'ds:motion-safe:data-[state=closing]:animate-out ds:motion-safe:data-[state=closing]:fade-out-0',\n 'ds:motion-safe:data-[state=closing]:slide-out-to-top-2 ds:motion-safe:data-[state=closing]:zoom-out-95',\n // Pin the exit's end-state until React unmounts. Without\n // `fill-mode-forwards` the element snaps back to opacity:1 for one\n // paint frame after the animation ends.\n 'ds:motion-safe:data-[state=closing]:fill-mode-forwards',\n 'ds:motion-safe:duration-[var(--animation-duration)]',\n ].join(' ')}\n {...props}\n >\n {effectiveIcon ? (\n <span className={hasTitle ? ICON_WITH_TITLE : ICON_BASE}>\n {effectiveIcon}\n </span>\n ) : null}\n\n <div className=\"ds:flex-1 ds:min-w-0\">{children}</div>\n\n {dismissible ? (\n <button\n type=\"button\"\n aria-label={t('ui.common.close', 'Close')}\n onClick={handleDismiss}\n className={CLOSE_BUTTON_CLASSES}\n >\n <X aria-hidden=\"true\" className=\"ds:size-4\" />\n </button>\n ) : null}\n </div>\n );\n },\n);\n\nAlertRoot.displayName = 'Alert';\n\nexport const Alert = Object.assign(AlertRoot, {\n Title: AlertTitle,\n Description: AlertDescription,\n Action: AlertAction,\n});\n"],"names":["alertVariants","cva","ICON_BASE","ICON_WITH_TITLE","CLOSE_BUTTON_CLASSES","VARIANT_CONFIG","jsx","Info","CircleCheck","TriangleAlert","CircleX","AlertTitle","forwardRef","Tag","className","props","ref","AlertDescription","AlertAction","AlertRoot","variant","dismissible","controlledOpen","onOpenChange","icon","live","children","t","useTranslation","internalOpen","setInternalOpen","useState","isClosing","setIsClosing","closeTimerRef","useRef","isControlled","isOpen","animationDurationMs","useCallback","raw","trimmed","n","config","effectiveIcon","hasTitle","Children","child","isValidElement","handleDismiss","jsxs","Alert"],"mappings":";;;;;;;;;AAcA,MAAMA,IAAgBC;AAAA,EACpB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,EACA,KAAK,GAAG;AAAA,EACV;AAAA,IACE,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMR,SAAS;AAAA,QACP,MAAM;AAAA,UACJ;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA,EACA,KAAK,GAAG;AAAA,QACV,SAAS;AAAA,UACP;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA,EACA,KAAK,GAAG;AAAA,QACV,SAAS;AAAA,UACP;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA,EACA,KAAK,GAAG;AAAA,QACV,OAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA,EACA,KAAK,GAAG;AAAA,MAAA;AAAA,IACZ;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ,GAOMC,IAAY,yBACZC,IAAkB,GAAGD,CAAS,cAE9BE,IAAuB;AA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,EAC5C,OAAOR;AAAA,EACP,aAAaM;AAAA,EACb,QAAQC;AACV,CAAC;"}
|
|
@@ -6,7 +6,7 @@ import { B as G } from "./button-DD_0Xdmr.js";
|
|
|
6
6
|
import { I as N } from "./icon-button-C4CGcYuz.js";
|
|
7
7
|
import { S as ue } from "./select-BOU_Osnf.js";
|
|
8
8
|
import { A as pe } from "./audio-visualiser-ByDEFLNm.js";
|
|
9
|
-
import { A as F } from "./alert-
|
|
9
|
+
import { A as F } from "./alert-34A3K8y-.js";
|
|
10
10
|
import { u as le } from "./registry-C9nwlNyL.js";
|
|
11
11
|
import { c as V } from "./createLucideIcon-CrFbzy84.js";
|
|
12
12
|
import { S as me } from "./square-CZoGU14v.js";
|
|
@@ -454,4 +454,4 @@ export {
|
|
|
454
454
|
Ne as A,
|
|
455
455
|
Re as a
|
|
456
456
|
};
|
|
457
|
-
//# sourceMappingURL=audio-recorder-
|
|
457
|
+
//# sourceMappingURL=audio-recorder-B60FLnUO.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audio-recorder-BdBbU-UK.js","sources":["../../node_modules/lucide-react/dist/esm/icons/mic.js","../../node_modules/lucide-react/dist/esm/icons/pause.js","../../node_modules/lucide-react/dist/esm/icons/play.js","../../src/components/audio-recorder/audio-recorder.agent.ts","../../src/components/audio-recorder/audio-recorder.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 [\"path\", { d: \"M12 19v3\", key: \"npa21l\" }],\n [\"path\", { d: \"M19 10v2a7 7 0 0 1-14 0v-2\", key: \"1vc78b\" }],\n [\"rect\", { x: \"9\", y: \"2\", width: \"6\", height: \"13\", rx: \"3\", key: \"s6n7sd\" }]\n];\nconst Mic = createLucideIcon(\"mic\", __iconNode);\n\nexport { __iconNode, Mic as default };\n//# sourceMappingURL=mic.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 [\"rect\", { x: \"14\", y: \"3\", width: \"5\", height: \"18\", rx: \"1\", key: \"kaeet6\" }],\n [\"rect\", { x: \"5\", y: \"3\", width: \"5\", height: \"18\", rx: \"1\", key: \"1wsw3u\" }]\n];\nconst Pause = createLucideIcon(\"pause\", __iconNode);\n\nexport { __iconNode, Pause as default };\n//# sourceMappingURL=pause.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: \"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\",\n key: \"10ikf1\"\n }\n ]\n];\nconst Play = createLucideIcon(\"play\", __iconNode);\n\nexport { __iconNode, Play as default };\n//# sourceMappingURL=play.js.map\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — AudioRecorder. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { AudioRecorderHandle } from './audio-recorder';\n\nexport const audioRecorderAgent: AgentAdapter<AudioRecorderHandle> = {\n id: 'audio-recorder',\n capabilities: ['submit'],\n state: {\n isRecording: {\n type: 'boolean',\n descriptionKey: 'ui.agent.audioRecorder.state.isRecording',\n description: 'True while actively capturing audio (not paused).',\n read: (handle) => handle.isRecording(),\n },\n duration: {\n type: 'number',\n descriptionKey: 'ui.agent.audioRecorder.state.duration',\n description:\n 'Elapsed recording time in milliseconds (paused time excluded).',\n read: (handle) => handle.getDuration(),\n },\n hasRecording: {\n type: 'boolean',\n descriptionKey: 'ui.agent.audioRecorder.state.hasRecording',\n description:\n 'True when a completed recording is available for submission.',\n read: (handle) => handle.hasRecording(),\n },\n },\n actions: {\n start_recording: {\n safety: 'write',\n descriptionKey: 'ui.agent.audioRecorder.actions.startRecording',\n description: 'Request microphone permission and begin recording.',\n invoke: (handle) => handle.startRecording(),\n },\n stop_recording: {\n safety: 'write',\n descriptionKey: 'ui.agent.audioRecorder.actions.stopRecording',\n description: 'Stop the current recording and finalise the blob.',\n invoke: (handle) => {\n handle.stopRecording();\n },\n },\n discard: {\n safety: 'destructive',\n descriptionKey: 'ui.agent.audioRecorder.actions.discard',\n description:\n 'Cancel the recording. Irreversible — the captured audio is dropped.',\n invoke: (handle) => {\n handle.discard();\n },\n },\n submit: {\n safety: 'write',\n descriptionKey: 'ui.agent.audioRecorder.actions.submit',\n description:\n 'Stop the active recording, finalising it via onRecordingComplete.',\n invoke: (handle) => {\n handle.stopRecording();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'audio-recorder',\n description: 'Marks the AudioRecorder wrapper.',\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 useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useReducer,\n useRef,\n useState,\n type HTMLAttributes,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Mic, Pause, Play, Square, X } from 'lucide-react';\nimport { IconButton, Button } from '../button';\nimport { Select, type SelectOption } from '../select/select';\nimport { AudioVisualiser } from '../audio-visualiser';\nimport { Alert } from '../alert';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { audioRecorderAgent } from './audio-recorder.agent';\n\ntype State =\n | { kind: 'idle' }\n | { kind: 'requesting' }\n | { kind: 'recording'; startedAt: number; pausedMs: number }\n | { kind: 'paused'; startedAt: number; pausedMs: number; pausedAt: number }\n | { kind: 'stopped'; duration: number }\n | {\n kind: 'error';\n type:\n | 'permission-denied'\n | 'no-device'\n | 'unsupported'\n | 'capture-failed';\n };\n\ntype Action =\n | { type: 'request' }\n | { type: 'start' }\n | { type: 'pause' }\n | { type: 'resume' }\n | { type: 'stop'; duration: number }\n | { type: 'cancel' }\n | {\n type: 'error';\n kind:\n | 'permission-denied'\n | 'no-device'\n | 'unsupported'\n | 'capture-failed';\n }\n | { type: 'reset' };\n\nfunction reducer(state: State, action: Action): State {\n switch (action.type) {\n case 'request':\n return { kind: 'requesting' };\n case 'start':\n return { kind: 'recording', startedAt: Date.now(), pausedMs: 0 };\n case 'pause':\n if (state.kind !== 'recording') return state;\n return {\n kind: 'paused',\n startedAt: state.startedAt,\n pausedMs: state.pausedMs,\n pausedAt: Date.now(),\n };\n case 'resume':\n if (state.kind !== 'paused') return state;\n return {\n kind: 'recording',\n startedAt: state.startedAt,\n pausedMs: state.pausedMs + (Date.now() - state.pausedAt),\n };\n case 'stop':\n return { kind: 'stopped', duration: action.duration };\n case 'cancel':\n return { kind: 'idle' };\n case 'error':\n return { kind: 'error', type: action.kind };\n case 'reset':\n return { kind: 'idle' };\n default:\n return state;\n }\n}\n\nconst rootVariants = cva(\n [\n 'ds:inline-flex ds:flex-col ds:items-stretch ds:gap-[var(--spacing-sm)]',\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-border',\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]',\n 'ds:bg-background',\n ].join(' '),\n {\n variants: {\n size: {\n sm: '',\n md: '',\n lg: '',\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\nconst MIME_PREFERENCES = [\n 'audio/webm;codecs=opus',\n 'audio/webm',\n 'audio/mp4',\n 'audio/ogg;codecs=opus',\n];\n\nfunction pickMimeType(): string | undefined {\n if (typeof MediaRecorder === 'undefined') return undefined;\n for (const mime of MIME_PREFERENCES) {\n if (MediaRecorder.isTypeSupported(mime)) return mime;\n }\n return undefined;\n}\n\nfunction formatTimer(ms: number, locale: string): string {\n const total = Math.max(0, Math.floor(ms / 1000));\n const minutes = Math.floor(total / 60);\n const seconds = total % 60;\n const fmt = (n: number) =>\n new Intl.NumberFormat(locale, { minimumIntegerDigits: 2 }).format(n);\n return `${fmt(minutes)}:${fmt(seconds)}`;\n}\n\n/** Curated imperative handle for agent / external automation. */\nexport interface AudioRecorderHandle {\n isRecording: () => boolean;\n getDuration: () => number;\n hasRecording: () => boolean;\n startRecording: () => Promise<void> | void;\n stopRecording: () => void;\n discard: () => void;\n}\n\nexport interface AudioRecorderProps\n extends\n Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'onError'>,\n VariantProps<typeof rootVariants> {\n /** Called on stop with the final blob + duration in ms. */\n onRecordingComplete?: (blob: Blob, durationMs: number) => void;\n /** Called when recording is cancelled. */\n onCancel?: () => void;\n /** Called when an error occurs. */\n onError?: (\n error:\n | 'permission-denied'\n | 'no-device'\n | 'unsupported'\n | 'capture-failed'\n | 'max-duration'\n | 'max-size',\n ) => void;\n /**\n * Auto-stop after this many milliseconds of active recording. Default\n * 30 minutes. Set `null` to disable.\n */\n maxDurationMs?: number | null;\n /**\n * Auto-stop when the accumulated blob chunks exceed this many bytes.\n * Default 250 MB. Set `null` to disable.\n */\n maxBytes?: number | null;\n}\n\nexport const AudioRecorder = forwardRef<\n AudioRecorderHandle,\n AudioRecorderProps\n>(\n (\n {\n size = 'md',\n onRecordingComplete,\n onCancel,\n onError,\n maxDurationMs = 30 * 60 * 1000,\n maxBytes = 250 * 1024 * 1024,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const [state, dispatch] = useReducer(reducer, { kind: 'idle' });\n const [stream, setStream] = useState<MediaStream | null>(null);\n const [now, setNow] = useState<number>(Date.now());\n const [devices, setDevices] = useState<MediaDeviceInfo[]>([]);\n const [selectedDeviceId, setSelectedDeviceId] = useState<string>('');\n\n const recorderRef = useRef<MediaRecorder | null>(null);\n const chunksRef = useRef<Blob[]>([]);\n // Running total of bytes accumulated in `chunksRef` — reading\n // `chunksRef.current.reduce(...)` on every ondataavailable scales\n // poorly; maintain the sum incrementally instead.\n const byteCountRef = useRef<number>(0);\n const durationAtStopRef = useRef<number>(0);\n // Tracks the *currently-held* MediaStream in a ref so the unmount\n // cleanup effect (which closes over [] deps) sees the latest value.\n // Without this, a unmount while getUserMedia is pending would never\n // stop() tracks and the browser mic indicator stays on.\n const streamRef = useRef<MediaStream | null>(null);\n // Flips to true on unmount; consulted inside the getUserMedia promise\n // resolution so we don't try to setStream() on a dead component and\n // so the freshly-acquired tracks get released immediately.\n const unmountedRef = useRef<boolean>(false);\n // Flips to true when cancel() is called; the onstop handler reads it\n // so `onRecordingComplete` is NOT invoked on a cancel path with a blank\n // blob. Reset on each recording start.\n const cancelledRef = useRef<boolean>(false);\n\n const supported = typeof MediaRecorder !== 'undefined';\n\n /* ── Enumerate devices once (after any prior permission grant) ── */\n useEffect(() => {\n if (!supported || !navigator.mediaDevices?.enumerateDevices) return;\n navigator.mediaDevices\n .enumerateDevices()\n .then((list) => {\n const mics = list.filter((d) => d.kind === 'audioinput');\n setDevices(mics);\n })\n .catch(() => {\n /* ignore */\n });\n }, [supported]);\n\n /* ── Timer tick ── */\n useEffect(() => {\n if (state.kind !== 'recording') return;\n const handle = window.setInterval(() => setNow(Date.now()), 250);\n return () => window.clearInterval(handle);\n }, [state.kind]);\n\n const cleanupStream = useCallback(() => {\n const held = streamRef.current ?? stream;\n held?.getTracks().forEach((t) => t.stop());\n streamRef.current = null;\n setStream(null);\n }, [stream]);\n\n const requestAndStart = useCallback(async () => {\n if (!supported) {\n dispatch({ type: 'error', kind: 'unsupported' });\n onError?.('unsupported');\n return;\n }\n dispatch({ type: 'request' });\n cancelledRef.current = false;\n try {\n const nextStream = await navigator.mediaDevices.getUserMedia({\n audio: selectedDeviceId\n ? { deviceId: { exact: selectedDeviceId } }\n : true,\n });\n // Guard against the component unmounting between the permission\n // prompt and the promise resolution — otherwise the freshly-acquired\n // tracks leak and the browser's mic indicator stays live.\n if (unmountedRef.current) {\n nextStream.getTracks().forEach((tr) => tr.stop());\n return;\n }\n streamRef.current = nextStream;\n setStream(nextStream);\n const mimeType = pickMimeType();\n const recorder = new MediaRecorder(\n nextStream,\n mimeType ? { mimeType } : undefined,\n );\n recorderRef.current = recorder;\n chunksRef.current = [];\n byteCountRef.current = 0;\n recorder.ondataavailable = (event) => {\n if (event.data && event.data.size > 0) {\n chunksRef.current.push(event.data);\n byteCountRef.current += event.data.size;\n // Byte-cap: auto-stop if the recording would exceed maxBytes.\n // Cheaper than summing on every tick; stop once and bail.\n if (\n typeof maxBytes === 'number' &&\n byteCountRef.current >= maxBytes &&\n recorderRef.current?.state === 'recording'\n ) {\n onError?.('max-size');\n try {\n recorderRef.current.stop();\n } catch {\n /* ignore */\n }\n }\n }\n };\n recorder.onstop = () => {\n // Cancel path: drop the blob on the floor — consumers who called\n // cancel() must not receive a silent empty recording.\n if (!cancelledRef.current) {\n const blob = new Blob(chunksRef.current, {\n type: mimeType ?? 'audio/webm',\n });\n onRecordingComplete?.(blob, durationAtStopRef.current);\n }\n chunksRef.current = [];\n recorderRef.current = null;\n nextStream.getTracks().forEach((tr) => tr.stop());\n streamRef.current = null;\n setStream(null);\n cancelledRef.current = false;\n };\n recorder.start(1000);\n dispatch({ type: 'start' });\n } catch (err: unknown) {\n const errorName = err instanceof Error ? err.name : '';\n if (errorName === 'NotAllowedError' || errorName === 'SecurityError') {\n dispatch({ type: 'error', kind: 'permission-denied' });\n onError?.('permission-denied');\n } else if (\n errorName === 'NotFoundError' ||\n errorName === 'OverconstrainedError'\n ) {\n dispatch({ type: 'error', kind: 'no-device' });\n onError?.('no-device');\n } else {\n dispatch({ type: 'error', kind: 'capture-failed' });\n onError?.('capture-failed');\n }\n }\n }, [onError, onRecordingComplete, selectedDeviceId, supported]);\n\n const pause = useCallback(() => {\n recorderRef.current?.pause();\n dispatch({ type: 'pause' });\n }, []);\n\n const resume = useCallback(() => {\n recorderRef.current?.resume();\n dispatch({ type: 'resume' });\n }, []);\n\n const stop = useCallback(() => {\n if (state.kind === 'recording' || state.kind === 'paused') {\n const started = state.startedAt;\n const pausedMs = state.pausedMs;\n const duration = Date.now() - started - pausedMs;\n durationAtStopRef.current = Math.max(0, duration);\n dispatch({ type: 'stop', duration: duration });\n }\n try {\n recorderRef.current?.stop();\n } catch {\n /* stop() throws on non-recording state; safe to swallow */\n }\n }, [state]);\n\n const cancel = useCallback(() => {\n // Flip the cancelled flag BEFORE asking MediaRecorder to stop so the\n // async onstop handler sees it and skips onRecordingComplete.\n cancelledRef.current = true;\n try {\n recorderRef.current?.stop();\n } catch {\n /* ignore */\n }\n chunksRef.current = [];\n recorderRef.current = null;\n cleanupStream();\n dispatch({ type: 'cancel' });\n onCancel?.();\n }, [cleanupStream, onCancel]);\n\n /* ── Max-duration auto-stop ── */\n useEffect(() => {\n if (state.kind !== 'recording') return;\n if (typeof maxDurationMs !== 'number' || maxDurationMs <= 0) return;\n const alreadyElapsed = Date.now() - state.startedAt - state.pausedMs;\n const remaining = Math.max(0, maxDurationMs - alreadyElapsed);\n const handle = window.setTimeout(() => {\n if (recorderRef.current?.state === 'recording') {\n onError?.('max-duration');\n try {\n recorderRef.current.stop();\n } catch {\n /* ignore */\n }\n }\n }, remaining);\n return () => window.clearTimeout(handle);\n }, [state, maxDurationMs, onError]);\n\n /* ── Unmount cleanup: release mic if still held ── */\n useEffect(() => {\n return () => {\n unmountedRef.current = true;\n try {\n recorderRef.current?.stop();\n } catch {\n /* ignore */\n }\n // Use streamRef so we see a stream that was acquired by an\n // in-flight getUserMedia resolution — not just the one captured\n // by the closure at mount.\n streamRef.current?.getTracks().forEach((tr) => tr.stop());\n streamRef.current = null;\n };\n }, []);\n\n const elapsedMs =\n state.kind === 'recording'\n ? now - state.startedAt - state.pausedMs\n : state.kind === 'paused'\n ? state.pausedAt - state.startedAt - state.pausedMs\n : state.kind === 'stopped'\n ? state.duration\n : 0;\n\n const agentHandle = useMemo<AudioRecorderHandle>(\n () => ({\n isRecording: () => state.kind === 'recording',\n getDuration: () => elapsedMs,\n hasRecording: () => state.kind === 'stopped',\n startRecording: () => requestAndStart(),\n stopRecording: () => stop(),\n discard: () => cancel(),\n }),\n [state, elapsedMs, requestAndStart, stop, cancel],\n );\n useImperativeHandle(ref, () => agentHandle, [agentHandle]);\n useAgentRegistration(audioRecorderAgent, agentHandle, rest.id);\n\n const deviceOptions: SelectOption<string>[] = devices.map((d) => ({\n value: d.deviceId,\n label: d.label || t('ui.chat.audio.selectDevice'),\n }));\n\n const statusText = (() => {\n switch (state.kind) {\n case 'idle':\n return t('ui.chat.audio.idle');\n case 'requesting':\n return t('ui.common.loading');\n case 'recording':\n return t('ui.chat.audio.recording');\n case 'paused':\n return t('ui.chat.audio.paused');\n case 'stopped':\n return t('ui.chat.audio.idle');\n case 'error':\n if (state.type === 'permission-denied')\n return t('ui.chat.audio.permissionDenied');\n if (state.type === 'unsupported')\n return t('ui.chat.audio.unsupported');\n return t('ui.chat.audio.idle');\n }\n })();\n\n const isRecording = state.kind === 'recording';\n const isPaused = state.kind === 'paused';\n const hasError = state.kind === 'error';\n\n return (\n <div\n data-component=\"audio-recorder\"\n data-component-id={rest.id}\n className={rootVariants({ size, className })}\n {...rest}\n >\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n <span\n aria-hidden=\"true\"\n className={[\n 'ds:relative ds:inline-flex ds:size-3 ds:items-center ds:justify-center ds:rounded-[var(--radius-full)]',\n isRecording\n ? 'ds:bg-[color:var(--destructive)]'\n : 'ds:bg-[color:var(--muted)]',\n ].join(' ')}\n >\n {isRecording ? (\n <span\n className={[\n 'ds:absolute ds:inset-0 ds:rounded-[var(--radius-full)]',\n 'ds:bg-[color:var(--destructive)]',\n 'ds:motion-safe:animate-[recorder-pulse_1.2s_ease-out_infinite]',\n 'ds:[.theme-accessible_&]:animate-none',\n ].join(' ')}\n />\n ) : null}\n </span>\n <AudioVisualiser\n stream={stream}\n size=\"sm\"\n aria-hidden=\"true\"\n className=\"ds:flex-1\"\n />\n <time\n dir=\"ltr\"\n aria-hidden=\"true\"\n className=\"ds:tabular-nums type-meta ds:text-[color:var(--muted-foreground)]\"\n >\n {formatTimer(elapsedMs, i18n.language)}\n </time>\n </div>\n\n <span role=\"status\" aria-live=\"polite\" className=\"ds:sr-only\">\n {statusText}\n </span>\n\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n {state.kind === 'idle' || state.kind === 'stopped' || hasError ? (\n <Button\n intent=\"primary\"\n size=\"sm\"\n startIcon={<Mic />}\n onClick={requestAndStart}\n disabled={!supported}\n >\n {t('ui.chat.audio.record')}\n </Button>\n ) : null}\n {isRecording ? (\n <IconButton\n icon={<Pause />}\n aria-label={t('ui.chat.audio.pause')}\n intent=\"secondary\"\n size=\"sm\"\n onClick={pause}\n />\n ) : null}\n {isPaused ? (\n <IconButton\n icon={<Play />}\n aria-label={t('ui.chat.audio.resume')}\n intent=\"secondary\"\n size=\"sm\"\n onClick={resume}\n />\n ) : null}\n {isRecording || isPaused ? (\n <>\n <IconButton\n icon={<Square />}\n aria-label={t('ui.chat.audio.stop')}\n intent=\"primary\"\n size=\"sm\"\n onClick={stop}\n />\n <IconButton\n icon={<X />}\n aria-label={t('ui.chat.audio.cancel')}\n intent=\"ghost\"\n size=\"sm\"\n onClick={cancel}\n />\n </>\n ) : null}\n {state.kind === 'idle' && deviceOptions.length > 1 ? (\n <div className=\"ds:ms-auto ds:min-w-[160px]\">\n <Select\n aria-label={t('ui.chat.audio.selectDevice')}\n options={deviceOptions}\n value={selectedDeviceId}\n onValueChange={(v) => setSelectedDeviceId(v)}\n size=\"sm\"\n clearable\n />\n </div>\n ) : null}\n </div>\n\n {hasError && state.kind === 'error' ? (\n <Alert variant=\"error\" live=\"polite\">\n <Alert.Description>{statusText}</Alert.Description>\n {state.type === 'permission-denied' ? (\n <Alert.Action>\n <Button intent=\"ghost\" size=\"sm\" onClick={requestAndStart}>\n {t('ui.chat.audio.retry')}\n </Button>\n </Alert.Action>\n ) : null}\n </Alert>\n ) : null}\n </div>\n );\n },\n);\n\nAudioRecorder.displayName = 'AudioRecorder';\n"],"names":["__iconNode","Mic","createLucideIcon","Pause","Play","audioRecorderAgent","handle","reducer","state","action","rootVariants","cva","MIME_PREFERENCES","pickMimeType","mime","formatTimer","ms","locale","total","minutes","seconds","fmt","n","AudioRecorder","forwardRef","size","onRecordingComplete","onCancel","onError","maxDurationMs","maxBytes","className","rest","ref","t","i18n","useTranslation","dispatch","useReducer","stream","setStream","useState","now","setNow","devices","setDevices","selectedDeviceId","setSelectedDeviceId","recorderRef","useRef","chunksRef","byteCountRef","durationAtStopRef","streamRef","unmountedRef","cancelledRef","supported","useEffect","_a","list","mics","d","cleanupStream","useCallback","held","requestAndStart","nextStream","tr","mimeType","recorder","event","blob","err","errorName","pause","resume","stop","started","pausedMs","duration","cancel","alreadyElapsed","remaining","_b","elapsedMs","agentHandle","useMemo","useImperativeHandle","useAgentRegistration","deviceOptions","statusText","isRecording","isPaused","hasError","jsxs","jsx","AudioVisualiser","Button","IconButton","Fragment","Square","X","Select","v","Alert"],"mappings":";;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAAA,EACzC,CAAC,QAAQ,EAAE,GAAG,8BAA8B,KAAK,SAAQ,CAAE;AAAA,EAC3D,CAAC,QAAQ,EAAE,GAAG,KAAK,GAAG,KAAK,OAAO,KAAK,QAAQ,MAAM,IAAI,KAAK,KAAK,SAAQ,CAAE;AAC/E,GACMC,KAAMC,EAAiB,OAAOF,EAAU;ACd9C;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,MAAM,GAAG,KAAK,OAAO,KAAK,QAAQ,MAAM,IAAI,KAAK,KAAK,SAAQ,CAAE;AAAA,EAC9E,CAAC,QAAQ,EAAE,GAAG,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IACE;AAAA,UAAA,GACN;AAAA,UAECV,KAAYrF,EAAM,SAAS,4BACzBgG,GAAA,EAAM,SAAQ,SAAQ,MAAK,UAC1B,UAAA;AAAA,YAAA,gBAAAT,EAACS,EAAM,aAAN,EAAmB,UAAAd,EAAA,CAAW;AAAA,YAC9BlF,EAAM,SAAS,wCACbgG,EAAM,QAAN,EACC,UAAA,gBAAAT,EAACE,GAAA,EAAO,QAAO,SAAQ,MAAK,MAAK,SAAShC,GACvC,YAAE,qBAAqB,GAC1B,GACF,IACE;AAAA,UAAA,EAAA,CACN,IACE;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEA1C,GAAc,cAAc;","x_google_ignoreList":[0,1,2]}
|
|
1
|
+
{"version":3,"file":"audio-recorder-B60FLnUO.js","sources":["../../node_modules/lucide-react/dist/esm/icons/mic.js","../../node_modules/lucide-react/dist/esm/icons/pause.js","../../node_modules/lucide-react/dist/esm/icons/play.js","../../src/components/audio-recorder/audio-recorder.agent.ts","../../src/components/audio-recorder/audio-recorder.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 [\"path\", { d: \"M12 19v3\", key: \"npa21l\" }],\n [\"path\", { d: \"M19 10v2a7 7 0 0 1-14 0v-2\", key: \"1vc78b\" }],\n [\"rect\", { x: \"9\", y: \"2\", width: \"6\", height: \"13\", rx: \"3\", key: \"s6n7sd\" }]\n];\nconst Mic = createLucideIcon(\"mic\", __iconNode);\n\nexport { __iconNode, Mic as default };\n//# sourceMappingURL=mic.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 [\"rect\", { x: \"14\", y: \"3\", width: \"5\", height: \"18\", rx: \"1\", key: \"kaeet6\" }],\n [\"rect\", { x: \"5\", y: \"3\", width: \"5\", height: \"18\", rx: \"1\", key: \"1wsw3u\" }]\n];\nconst Pause = createLucideIcon(\"pause\", __iconNode);\n\nexport { __iconNode, Pause as default };\n//# sourceMappingURL=pause.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: \"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\",\n key: \"10ikf1\"\n }\n ]\n];\nconst Play = createLucideIcon(\"play\", __iconNode);\n\nexport { __iconNode, Play as default };\n//# sourceMappingURL=play.js.map\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — AudioRecorder. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { AudioRecorderHandle } from './audio-recorder';\n\nexport const audioRecorderAgent: AgentAdapter<AudioRecorderHandle> = {\n id: 'audio-recorder',\n capabilities: ['submit'],\n state: {\n isRecording: {\n type: 'boolean',\n descriptionKey: 'ui.agent.audioRecorder.state.isRecording',\n description: 'True while actively capturing audio (not paused).',\n read: (handle) => handle.isRecording(),\n },\n duration: {\n type: 'number',\n descriptionKey: 'ui.agent.audioRecorder.state.duration',\n description:\n 'Elapsed recording time in milliseconds (paused time excluded).',\n read: (handle) => handle.getDuration(),\n },\n hasRecording: {\n type: 'boolean',\n descriptionKey: 'ui.agent.audioRecorder.state.hasRecording',\n description:\n 'True when a completed recording is available for submission.',\n read: (handle) => handle.hasRecording(),\n },\n },\n actions: {\n start_recording: {\n safety: 'write',\n descriptionKey: 'ui.agent.audioRecorder.actions.startRecording',\n description: 'Request microphone permission and begin recording.',\n invoke: (handle) => handle.startRecording(),\n },\n stop_recording: {\n safety: 'write',\n descriptionKey: 'ui.agent.audioRecorder.actions.stopRecording',\n description: 'Stop the current recording and finalise the blob.',\n invoke: (handle) => {\n handle.stopRecording();\n },\n },\n discard: {\n safety: 'destructive',\n descriptionKey: 'ui.agent.audioRecorder.actions.discard',\n description:\n 'Cancel the recording. Irreversible — the captured audio is dropped.',\n invoke: (handle) => {\n handle.discard();\n },\n },\n submit: {\n safety: 'write',\n descriptionKey: 'ui.agent.audioRecorder.actions.submit',\n description:\n 'Stop the active recording, finalising it via onRecordingComplete.',\n invoke: (handle) => {\n handle.stopRecording();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'audio-recorder',\n description: 'Marks the AudioRecorder wrapper.',\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 useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useReducer,\n useRef,\n useState,\n type HTMLAttributes,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Mic, Pause, Play, Square, X } from 'lucide-react';\nimport { IconButton, Button } from '../button';\nimport { Select, type SelectOption } from '../select/select';\nimport { AudioVisualiser } from '../audio-visualiser';\nimport { Alert } from '../alert';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { audioRecorderAgent } from './audio-recorder.agent';\n\ntype State =\n | { kind: 'idle' }\n | { kind: 'requesting' }\n | { kind: 'recording'; startedAt: number; pausedMs: number }\n | { kind: 'paused'; startedAt: number; pausedMs: number; pausedAt: number }\n | { kind: 'stopped'; duration: number }\n | {\n kind: 'error';\n type:\n | 'permission-denied'\n | 'no-device'\n | 'unsupported'\n | 'capture-failed';\n };\n\ntype Action =\n | { type: 'request' }\n | { type: 'start' }\n | { type: 'pause' }\n | { type: 'resume' }\n | { type: 'stop'; duration: number }\n | { type: 'cancel' }\n | {\n type: 'error';\n kind:\n | 'permission-denied'\n | 'no-device'\n | 'unsupported'\n | 'capture-failed';\n }\n | { type: 'reset' };\n\nfunction reducer(state: State, action: Action): State {\n switch (action.type) {\n case 'request':\n return { kind: 'requesting' };\n case 'start':\n return { kind: 'recording', startedAt: Date.now(), pausedMs: 0 };\n case 'pause':\n if (state.kind !== 'recording') return state;\n return {\n kind: 'paused',\n startedAt: state.startedAt,\n pausedMs: state.pausedMs,\n pausedAt: Date.now(),\n };\n case 'resume':\n if (state.kind !== 'paused') return state;\n return {\n kind: 'recording',\n startedAt: state.startedAt,\n pausedMs: state.pausedMs + (Date.now() - state.pausedAt),\n };\n case 'stop':\n return { kind: 'stopped', duration: action.duration };\n case 'cancel':\n return { kind: 'idle' };\n case 'error':\n return { kind: 'error', type: action.kind };\n case 'reset':\n return { kind: 'idle' };\n default:\n return state;\n }\n}\n\nconst rootVariants = cva(\n [\n 'ds:inline-flex ds:flex-col ds:items-stretch ds:gap-[var(--spacing-sm)]',\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-border',\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]',\n 'ds:bg-background',\n ].join(' '),\n {\n variants: {\n size: {\n sm: '',\n md: '',\n lg: '',\n },\n },\n defaultVariants: { size: 'md' },\n },\n);\n\nconst MIME_PREFERENCES = [\n 'audio/webm;codecs=opus',\n 'audio/webm',\n 'audio/mp4',\n 'audio/ogg;codecs=opus',\n];\n\nfunction pickMimeType(): string | undefined {\n if (typeof MediaRecorder === 'undefined') return undefined;\n for (const mime of MIME_PREFERENCES) {\n if (MediaRecorder.isTypeSupported(mime)) return mime;\n }\n return undefined;\n}\n\nfunction formatTimer(ms: number, locale: string): string {\n const total = Math.max(0, Math.floor(ms / 1000));\n const minutes = Math.floor(total / 60);\n const seconds = total % 60;\n const fmt = (n: number) =>\n new Intl.NumberFormat(locale, { minimumIntegerDigits: 2 }).format(n);\n return `${fmt(minutes)}:${fmt(seconds)}`;\n}\n\n/** Curated imperative handle for agent / external automation. */\nexport interface AudioRecorderHandle {\n isRecording: () => boolean;\n getDuration: () => number;\n hasRecording: () => boolean;\n startRecording: () => Promise<void> | void;\n stopRecording: () => void;\n discard: () => void;\n}\n\nexport interface AudioRecorderProps\n extends\n Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'onError'>,\n VariantProps<typeof rootVariants> {\n /** Called on stop with the final blob + duration in ms. */\n onRecordingComplete?: (blob: Blob, durationMs: number) => void;\n /** Called when recording is cancelled. */\n onCancel?: () => void;\n /** Called when an error occurs. */\n onError?: (\n error:\n | 'permission-denied'\n | 'no-device'\n | 'unsupported'\n | 'capture-failed'\n | 'max-duration'\n | 'max-size',\n ) => void;\n /**\n * Auto-stop after this many milliseconds of active recording. Default\n * 30 minutes. Set `null` to disable.\n */\n maxDurationMs?: number | null;\n /**\n * Auto-stop when the accumulated blob chunks exceed this many bytes.\n * Default 250 MB. Set `null` to disable.\n */\n maxBytes?: number | null;\n}\n\nexport const AudioRecorder = forwardRef<\n AudioRecorderHandle,\n AudioRecorderProps\n>(\n (\n {\n size = 'md',\n onRecordingComplete,\n onCancel,\n onError,\n maxDurationMs = 30 * 60 * 1000,\n maxBytes = 250 * 1024 * 1024,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t, i18n } = useTranslation();\n const [state, dispatch] = useReducer(reducer, { kind: 'idle' });\n const [stream, setStream] = useState<MediaStream | null>(null);\n const [now, setNow] = useState<number>(Date.now());\n const [devices, setDevices] = useState<MediaDeviceInfo[]>([]);\n const [selectedDeviceId, setSelectedDeviceId] = useState<string>('');\n\n const recorderRef = useRef<MediaRecorder | null>(null);\n const chunksRef = useRef<Blob[]>([]);\n // Running total of bytes accumulated in `chunksRef` — reading\n // `chunksRef.current.reduce(...)` on every ondataavailable scales\n // poorly; maintain the sum incrementally instead.\n const byteCountRef = useRef<number>(0);\n const durationAtStopRef = useRef<number>(0);\n // Tracks the *currently-held* MediaStream in a ref so the unmount\n // cleanup effect (which closes over [] deps) sees the latest value.\n // Without this, a unmount while getUserMedia is pending would never\n // stop() tracks and the browser mic indicator stays on.\n const streamRef = useRef<MediaStream | null>(null);\n // Flips to true on unmount; consulted inside the getUserMedia promise\n // resolution so we don't try to setStream() on a dead component and\n // so the freshly-acquired tracks get released immediately.\n const unmountedRef = useRef<boolean>(false);\n // Flips to true when cancel() is called; the onstop handler reads it\n // so `onRecordingComplete` is NOT invoked on a cancel path with a blank\n // blob. Reset on each recording start.\n const cancelledRef = useRef<boolean>(false);\n\n const supported = typeof MediaRecorder !== 'undefined';\n\n /* ── Enumerate devices once (after any prior permission grant) ── */\n useEffect(() => {\n if (!supported || !navigator.mediaDevices?.enumerateDevices) return;\n navigator.mediaDevices\n .enumerateDevices()\n .then((list) => {\n const mics = list.filter((d) => d.kind === 'audioinput');\n setDevices(mics);\n })\n .catch(() => {\n /* ignore */\n });\n }, [supported]);\n\n /* ── Timer tick ── */\n useEffect(() => {\n if (state.kind !== 'recording') return;\n const handle = window.setInterval(() => setNow(Date.now()), 250);\n return () => window.clearInterval(handle);\n }, [state.kind]);\n\n const cleanupStream = useCallback(() => {\n const held = streamRef.current ?? stream;\n held?.getTracks().forEach((t) => t.stop());\n streamRef.current = null;\n setStream(null);\n }, [stream]);\n\n const requestAndStart = useCallback(async () => {\n if (!supported) {\n dispatch({ type: 'error', kind: 'unsupported' });\n onError?.('unsupported');\n return;\n }\n dispatch({ type: 'request' });\n cancelledRef.current = false;\n try {\n const nextStream = await navigator.mediaDevices.getUserMedia({\n audio: selectedDeviceId\n ? { deviceId: { exact: selectedDeviceId } }\n : true,\n });\n // Guard against the component unmounting between the permission\n // prompt and the promise resolution — otherwise the freshly-acquired\n // tracks leak and the browser's mic indicator stays live.\n if (unmountedRef.current) {\n nextStream.getTracks().forEach((tr) => tr.stop());\n return;\n }\n streamRef.current = nextStream;\n setStream(nextStream);\n const mimeType = pickMimeType();\n const recorder = new MediaRecorder(\n nextStream,\n mimeType ? { mimeType } : undefined,\n );\n recorderRef.current = recorder;\n chunksRef.current = [];\n byteCountRef.current = 0;\n recorder.ondataavailable = (event) => {\n if (event.data && event.data.size > 0) {\n chunksRef.current.push(event.data);\n byteCountRef.current += event.data.size;\n // Byte-cap: auto-stop if the recording would exceed maxBytes.\n // Cheaper than summing on every tick; stop once and bail.\n if (\n typeof maxBytes === 'number' &&\n byteCountRef.current >= maxBytes &&\n recorderRef.current?.state === 'recording'\n ) {\n onError?.('max-size');\n try {\n recorderRef.current.stop();\n } catch {\n /* ignore */\n }\n }\n }\n };\n recorder.onstop = () => {\n // Cancel path: drop the blob on the floor — consumers who called\n // cancel() must not receive a silent empty recording.\n if (!cancelledRef.current) {\n const blob = new Blob(chunksRef.current, {\n type: mimeType ?? 'audio/webm',\n });\n onRecordingComplete?.(blob, durationAtStopRef.current);\n }\n chunksRef.current = [];\n recorderRef.current = null;\n nextStream.getTracks().forEach((tr) => tr.stop());\n streamRef.current = null;\n setStream(null);\n cancelledRef.current = false;\n };\n recorder.start(1000);\n dispatch({ type: 'start' });\n } catch (err: unknown) {\n const errorName = err instanceof Error ? err.name : '';\n if (errorName === 'NotAllowedError' || errorName === 'SecurityError') {\n dispatch({ type: 'error', kind: 'permission-denied' });\n onError?.('permission-denied');\n } else if (\n errorName === 'NotFoundError' ||\n errorName === 'OverconstrainedError'\n ) {\n dispatch({ type: 'error', kind: 'no-device' });\n onError?.('no-device');\n } else {\n dispatch({ type: 'error', kind: 'capture-failed' });\n onError?.('capture-failed');\n }\n }\n }, [onError, onRecordingComplete, selectedDeviceId, supported]);\n\n const pause = useCallback(() => {\n recorderRef.current?.pause();\n dispatch({ type: 'pause' });\n }, []);\n\n const resume = useCallback(() => {\n recorderRef.current?.resume();\n dispatch({ type: 'resume' });\n }, []);\n\n const stop = useCallback(() => {\n if (state.kind === 'recording' || state.kind === 'paused') {\n const started = state.startedAt;\n const pausedMs = state.pausedMs;\n const duration = Date.now() - started - pausedMs;\n durationAtStopRef.current = Math.max(0, duration);\n dispatch({ type: 'stop', duration: duration });\n }\n try {\n recorderRef.current?.stop();\n } catch {\n /* stop() throws on non-recording state; safe to swallow */\n }\n }, [state]);\n\n const cancel = useCallback(() => {\n // Flip the cancelled flag BEFORE asking MediaRecorder to stop so the\n // async onstop handler sees it and skips onRecordingComplete.\n cancelledRef.current = true;\n try {\n recorderRef.current?.stop();\n } catch {\n /* ignore */\n }\n chunksRef.current = [];\n recorderRef.current = null;\n cleanupStream();\n dispatch({ type: 'cancel' });\n onCancel?.();\n }, [cleanupStream, onCancel]);\n\n /* ── Max-duration auto-stop ── */\n useEffect(() => {\n if (state.kind !== 'recording') return;\n if (typeof maxDurationMs !== 'number' || maxDurationMs <= 0) return;\n const alreadyElapsed = Date.now() - state.startedAt - state.pausedMs;\n const remaining = Math.max(0, maxDurationMs - alreadyElapsed);\n const handle = window.setTimeout(() => {\n if (recorderRef.current?.state === 'recording') {\n onError?.('max-duration');\n try {\n recorderRef.current.stop();\n } catch {\n /* ignore */\n }\n }\n }, remaining);\n return () => window.clearTimeout(handle);\n }, [state, maxDurationMs, onError]);\n\n /* ── Unmount cleanup: release mic if still held ── */\n useEffect(() => {\n return () => {\n unmountedRef.current = true;\n try {\n recorderRef.current?.stop();\n } catch {\n /* ignore */\n }\n // Use streamRef so we see a stream that was acquired by an\n // in-flight getUserMedia resolution — not just the one captured\n // by the closure at mount.\n streamRef.current?.getTracks().forEach((tr) => tr.stop());\n streamRef.current = null;\n };\n }, []);\n\n const elapsedMs =\n state.kind === 'recording'\n ? now - state.startedAt - state.pausedMs\n : state.kind === 'paused'\n ? state.pausedAt - state.startedAt - state.pausedMs\n : state.kind === 'stopped'\n ? state.duration\n : 0;\n\n const agentHandle = useMemo<AudioRecorderHandle>(\n () => ({\n isRecording: () => state.kind === 'recording',\n getDuration: () => elapsedMs,\n hasRecording: () => state.kind === 'stopped',\n startRecording: () => requestAndStart(),\n stopRecording: () => stop(),\n discard: () => cancel(),\n }),\n [state, elapsedMs, requestAndStart, stop, cancel],\n );\n useImperativeHandle(ref, () => agentHandle, [agentHandle]);\n useAgentRegistration(audioRecorderAgent, agentHandle, rest.id);\n\n const deviceOptions: SelectOption<string>[] = devices.map((d) => ({\n value: d.deviceId,\n label: d.label || t('ui.chat.audio.selectDevice'),\n }));\n\n const statusText = (() => {\n switch (state.kind) {\n case 'idle':\n return t('ui.chat.audio.idle');\n case 'requesting':\n return t('ui.common.loading');\n case 'recording':\n return t('ui.chat.audio.recording');\n case 'paused':\n return t('ui.chat.audio.paused');\n case 'stopped':\n return t('ui.chat.audio.idle');\n case 'error':\n if (state.type === 'permission-denied')\n return t('ui.chat.audio.permissionDenied');\n if (state.type === 'unsupported')\n return t('ui.chat.audio.unsupported');\n return t('ui.chat.audio.idle');\n }\n })();\n\n const isRecording = state.kind === 'recording';\n const isPaused = state.kind === 'paused';\n const hasError = state.kind === 'error';\n\n return (\n <div\n data-component=\"audio-recorder\"\n data-component-id={rest.id}\n className={rootVariants({ size, className })}\n {...rest}\n >\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n <span\n aria-hidden=\"true\"\n className={[\n 'ds:relative ds:inline-flex ds:size-3 ds:items-center ds:justify-center ds:rounded-[var(--radius-full)]',\n isRecording\n ? 'ds:bg-[color:var(--destructive)]'\n : 'ds:bg-[color:var(--muted)]',\n ].join(' ')}\n >\n {isRecording ? (\n <span\n className={[\n 'ds:absolute ds:inset-0 ds:rounded-[var(--radius-full)]',\n 'ds:bg-[color:var(--destructive)]',\n 'ds:motion-safe:animate-[recorder-pulse_1.2s_ease-out_infinite]',\n 'ds:[.theme-accessible_&]:animate-none',\n ].join(' ')}\n />\n ) : null}\n </span>\n <AudioVisualiser\n stream={stream}\n size=\"sm\"\n aria-hidden=\"true\"\n className=\"ds:flex-1\"\n />\n <time\n dir=\"ltr\"\n aria-hidden=\"true\"\n className=\"ds:tabular-nums type-meta ds:text-[color:var(--muted-foreground)]\"\n >\n {formatTimer(elapsedMs, i18n.language)}\n </time>\n </div>\n\n <span role=\"status\" aria-live=\"polite\" className=\"ds:sr-only\">\n {statusText}\n </span>\n\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n {state.kind === 'idle' || state.kind === 'stopped' || hasError ? (\n <Button\n intent=\"primary\"\n size=\"sm\"\n startIcon={<Mic />}\n onClick={requestAndStart}\n disabled={!supported}\n >\n {t('ui.chat.audio.record')}\n </Button>\n ) : null}\n {isRecording ? (\n <IconButton\n icon={<Pause />}\n aria-label={t('ui.chat.audio.pause')}\n intent=\"secondary\"\n size=\"sm\"\n onClick={pause}\n />\n ) : null}\n {isPaused ? (\n <IconButton\n icon={<Play />}\n aria-label={t('ui.chat.audio.resume')}\n intent=\"secondary\"\n size=\"sm\"\n onClick={resume}\n />\n ) : null}\n {isRecording || isPaused ? (\n <>\n <IconButton\n icon={<Square />}\n aria-label={t('ui.chat.audio.stop')}\n intent=\"primary\"\n size=\"sm\"\n onClick={stop}\n />\n <IconButton\n icon={<X />}\n aria-label={t('ui.chat.audio.cancel')}\n intent=\"ghost\"\n size=\"sm\"\n onClick={cancel}\n />\n </>\n ) : null}\n {state.kind === 'idle' && deviceOptions.length > 1 ? (\n <div className=\"ds:ms-auto ds:min-w-[160px]\">\n <Select\n aria-label={t('ui.chat.audio.selectDevice')}\n options={deviceOptions}\n value={selectedDeviceId}\n onValueChange={(v) => setSelectedDeviceId(v)}\n size=\"sm\"\n clearable\n />\n </div>\n ) : null}\n </div>\n\n {hasError && state.kind === 'error' ? (\n <Alert variant=\"error\" live=\"polite\">\n <Alert.Description>{statusText}</Alert.Description>\n {state.type === 'permission-denied' ? (\n <Alert.Action>\n <Button intent=\"ghost\" size=\"sm\" onClick={requestAndStart}>\n {t('ui.chat.audio.retry')}\n </Button>\n </Alert.Action>\n ) : null}\n </Alert>\n ) : null}\n </div>\n );\n },\n);\n\nAudioRecorder.displayName = 'AudioRecorder';\n"],"names":["__iconNode","Mic","createLucideIcon","Pause","Play","audioRecorderAgent","handle","reducer","state","action","rootVariants","cva","MIME_PREFERENCES","pickMimeType","mime","formatTimer","ms","locale","total","minutes","seconds","fmt","n","AudioRecorder","forwardRef","size","onRecordingComplete","onCancel","onError","maxDurationMs","maxBytes","className","rest","ref","t","i18n","useTranslation","dispatch","useReducer","stream","setStream","useState","now","setNow","devices","setDevices","selectedDeviceId","setSelectedDeviceId","recorderRef","useRef","chunksRef","byteCountRef","durationAtStopRef","streamRef","unmountedRef","cancelledRef","supported","useEffect","_a","list","mics","d","cleanupStream","useCallback","held","requestAndStart","nextStream","tr","mimeType","recorder","event","blob","err","errorName","pause","resume","stop","started","pausedMs","duration","cancel","alreadyElapsed","remaining","_b","elapsedMs","agentHandle","useMemo","useImperativeHandle","useAgentRegistration","deviceOptions","statusText","isRecording","isPaused","hasError","jsxs","jsx","AudioVisualiser","Button","IconButton","Fragment","Square","X","Select","v","Alert"],"mappings":";;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAAA,EACzC,CAAC,QAAQ,EAAE,GAAG,8BAA8B,KAAK,SAAQ,CAAE;AAAA,EAC3D,CAAC,QAAQ,EAAE,GAAG,KAAK,GAAG,KAAK,OAAO,KAAK,QAAQ,MAAM,IAAI,KAAK,KAAK,SAAQ,CAAE;AAC/E,GACMC,KAAMC,EAAiB,OAAOF,EAAU;ACd9C;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,MAAM,GAAG,KAAK,OAAO,KAAK,QAAQ,MAAM,IAAI,KAAK,KAAK,SAAQ,CAAE;AAAA,EAC9E,CAAC,QAAQ,EAAE,GAAG,KAAK,GAAG,KAAK,OAAO,KAAK,QAAQ,MAAM,IAAI,KAAK,KAAK,SAAQ,CAAE;AAC/E,GACMG,KAAQD,EAAiB,SAASF,EAAU;ACblD;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB;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YAC9BlF,EAAM,SAAS,wCACbgG,EAAM,QAAN,EACC,UAAA,gBAAAT,EAACE,GAAA,EAAO,QAAO,SAAQ,MAAK,MAAK,SAAShC,GACvC,YAAE,qBAAqB,GAC1B,GACF,IACE;AAAA,UAAA,EAAA,CACN,IACE;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AAEA1C,GAAc,cAAc;","x_google_ignoreList":[0,1,2]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contact-card-DNyATxKv.js","sources":["../../node_modules/lucide-react/dist/esm/icons/map-pin.js","../../src/components/contact-card/contact-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 [\n \"path\",\n {\n d: \"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0\",\n key: \"1r0f0z\"\n }\n ],\n [\"circle\", { cx: \"12\", cy: \"10\", r: \"3\", key: \"ilqhr7\" }]\n];\nconst MapPin = createLucideIcon(\"map-pin\", __iconNode);\n\nexport { __iconNode, MapPin as default };\n//# sourceMappingURL=map-pin.js.map\n","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\n extends Omit<HTMLAttributes<HTMLElement>, 'title'> {\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\n extends Omit<HTMLAttributes<HTMLElement>, 'children'> {\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('ui.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('ui.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":["__iconNode","MapPin","createLucideIcon","buildTelHref","display","ContactCardRoot","forwardRef","title","variant","className","children","props","ref","jsxs","Card","jsx","ContactCardOffice","name","lines","vatNumber","phone","nameAs","t","useTranslation","NameTag","line","i","Fragment","Link","ContactCardLinks","ContactCardLink","href","icon","external","ContactCard"],"mappings":";;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AAAA,EACE,CAAC,UAAU,EAAE,IAAI,MAAM,IAAI,MAAM,GAAG,KAAK,KAAK,SAAQ,CAAE;AAC1D,GACMC,IAASC,EAAiB,WAAWF,CAAU;ACKrD,SAASG,EAAaC,GAAyB;AAG7C,SAAO,OAFeA,EAAQ,QAAQ,UAAU,EAAE,EACrB,QAAQ,WAAW,EAAE,CAC9B;AACtB;AAsBA,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;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EAAgB,cAAc;AAMvB,MAAMI,IAAc,OAAO,OAAO7B,GAAiB;AAAA,EACxD,QAAQW;AAAA,EACR,OAAOa;AAAA,EACP,MAAMC;AACR,CAAC;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"contact-card-DNyATxKv.js","sources":["../../node_modules/lucide-react/dist/esm/icons/map-pin.js","../../src/components/contact-card/contact-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 [\n \"path\",\n {\n d: \"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0\",\n key: \"1r0f0z\"\n }\n ],\n [\"circle\", { cx: \"12\", cy: \"10\", r: \"3\", key: \"ilqhr7\" }]\n];\nconst MapPin = createLucideIcon(\"map-pin\", __iconNode);\n\nexport { __iconNode, MapPin as default };\n//# sourceMappingURL=map-pin.js.map\n","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('ui.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('ui.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":["__iconNode","MapPin","createLucideIcon","buildTelHref","display","ContactCardRoot","forwardRef","title","variant","className","children","props","ref","jsxs","Card","jsx","ContactCardOffice","name","lines","vatNumber","phone","nameAs","t","useTranslation","NameTag","line","i","Fragment","Link","ContactCardLinks","ContactCardLink","href","icon","external","ContactCard"],"mappings":";;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AAAA,EACE,CAAC,UAAU,EAAE,IAAI,MAAM,IAAI,MAAM,GAAG,KAAK,KAAK,SAAQ,CAAE;AAC1D,GACMC,IAASC,EAAiB,WAAWF,CAAU;ACKrD,SAASG,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,MAC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@@ -7,7 +7,7 @@ import { useTranslation as Z } from "react-i18next";
|
|
|
7
7
|
import { u as $ } from "./registry-C9nwlNyL.js";
|
|
8
8
|
import { B as j } from "./button-DD_0Xdmr.js";
|
|
9
9
|
import { P as ee } from "./progress-C11tqhoI.js";
|
|
10
|
-
import { f as se } from "./payment-form-
|
|
10
|
+
import { f as se } from "./payment-form-BIk2K3i3.js";
|
|
11
11
|
import { T as ae } from "./triangle-alert-CBPUIzQo.js";
|
|
12
12
|
import { C as re } from "./check-DPdL_Sm7.js";
|
|
13
13
|
const te = {
|
|
@@ -264,4 +264,4 @@ export {
|
|
|
264
264
|
de as F,
|
|
265
265
|
te as f
|
|
266
266
|
};
|
|
267
|
-
//# sourceMappingURL=freemium-paywall-
|
|
267
|
+
//# sourceMappingURL=freemium-paywall-BA02zIOx.js.map
|