@alfadocs/ui-kit 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/{audio-recorder-BdBbU-UK.js → audio-recorder-B60FLnUO.js} +2 -2
- package/dist/_chunks/{freemium-paywall-CrVefV0M.js → freemium-paywall-BA02zIOx.js} +2 -2
- package/dist/_chunks/{payment-form-B_BdHwjb.js → payment-form-BIk2K3i3.js} +2 -2
- package/dist/_chunks/{pdf-viewer-CZIfY08H.js → pdf-viewer-DuPrR5Ty.js} +2 -2
- package/dist/_chunks/use-locale-C5rS3Xon.js +71 -0
- package/dist/_chunks/{warning-stack-VygGHSqC.js → warning-stack-CskQPAQ2.js} +2 -2
- package/dist/_chunks/{workflow-map-Bi5liGzo.js → workflow-map-D6Vsc2nY.js} +2 -2
- package/dist/agent-catalog.json +1 -1
- package/dist/components/alert/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/index.d.ts +2 -2
- 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.js +8 -7
- package/dist/hooks/use-scroll-to-first-error.d.ts +64 -0
- package/dist/index.js +474 -473
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/use-locale-BuXR_Zl9.js +0 -32
|
@@ -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
|
|
@@ -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
|
|
@@ -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
|
|
@@ -3,7 +3,7 @@ import { forwardRef as se, useState as E, useEffect as R, useRef as V, useMemo a
|
|
|
3
3
|
import { c as z } from "./index-D2ZczOXr.js";
|
|
4
4
|
import { useTranslation as q } from "react-i18next";
|
|
5
5
|
import { S as J } from "./spinner-DLaYfLPl.js";
|
|
6
|
-
import { A as W } from "./alert-
|
|
6
|
+
import { A as W } from "./alert-34A3K8y-.js";
|
|
7
7
|
import { loadStripe as de } from "@stripe/stripe-js";
|
|
8
8
|
import { Elements as ce, useStripe as le, useElements as me, PaymentElement as ue, AddressElement as pe } from "@stripe/react-stripe-js";
|
|
9
9
|
import { u as fe } from "./registry-C9nwlNyL.js";
|
|
@@ -587,4 +587,4 @@ export {
|
|
|
587
587
|
ye as p,
|
|
588
588
|
ee as s
|
|
589
589
|
};
|
|
590
|
-
//# sourceMappingURL=payment-form-
|
|
590
|
+
//# sourceMappingURL=payment-form-BIk2K3i3.js.map
|
|
@@ -6,7 +6,7 @@ import { useTranslation as le } from "react-i18next";
|
|
|
6
6
|
import * as X from "@radix-ui/react-popover";
|
|
7
7
|
import Se from "pdfjs-dist/build/pdf.worker.min.mjs?url";
|
|
8
8
|
import { S as Ee } from "./spinner-DLaYfLPl.js";
|
|
9
|
-
import { A as ye } from "./alert-
|
|
9
|
+
import { A as ye } from "./alert-34A3K8y-.js";
|
|
10
10
|
import { u as _e } from "./registry-C9nwlNyL.js";
|
|
11
11
|
import { X as Le } from "./x-CCcI3eJp.js";
|
|
12
12
|
import { C as Ze } from "./chevron-left-CX1jqD2M.js";
|
|
@@ -892,4 +892,4 @@ export {
|
|
|
892
892
|
tt as P,
|
|
893
893
|
Je as p
|
|
894
894
|
};
|
|
895
|
-
//# sourceMappingURL=pdf-viewer-
|
|
895
|
+
//# sourceMappingURL=pdf-viewer-DuPrR5Ty.js.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { useState as w, useEffect as d, useRef as h, useCallback as p } from "react";
|
|
2
|
+
import "../i18n/config.js";
|
|
3
|
+
import i from "i18next";
|
|
4
|
+
function E(e) {
|
|
5
|
+
const [o, r] = w(() => typeof window > "u" || typeof window.matchMedia != "function" ? !1 : window.matchMedia(e).matches);
|
|
6
|
+
return d(() => {
|
|
7
|
+
if (typeof window > "u" || typeof window.matchMedia != "function")
|
|
8
|
+
return;
|
|
9
|
+
const t = window.matchMedia(e);
|
|
10
|
+
r(t.matches);
|
|
11
|
+
const n = (a) => r(a.matches);
|
|
12
|
+
return typeof t.addEventListener == "function" ? (t.addEventListener("change", n), () => t.removeEventListener("change", n)) : (t.addListener(n), () => t.removeListener(n));
|
|
13
|
+
}, [e]), o;
|
|
14
|
+
}
|
|
15
|
+
function S(e) {
|
|
16
|
+
return e != null && e.current ? e.current : typeof document > "u" ? null : document;
|
|
17
|
+
}
|
|
18
|
+
function y(e, o) {
|
|
19
|
+
const r = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : (
|
|
20
|
+
// SSR / jsdom fallback — drop every character that's
|
|
21
|
+
// significant in a CSS attribute selector. Conservative but
|
|
22
|
+
// robust enough for the test environment.
|
|
23
|
+
e.replace(/["'\\[\]]/g, "")
|
|
24
|
+
), t = `[data-error-anchor="${r}"], [name="${r}"], [name$="[${r}]"]`, n = Array.from(o.querySelectorAll(t));
|
|
25
|
+
return n.length === 0 ? null : n.find((s) => s.offsetParent !== null) ?? n[0];
|
|
26
|
+
}
|
|
27
|
+
function M(e, o, r = {}) {
|
|
28
|
+
const {
|
|
29
|
+
scope: t,
|
|
30
|
+
scrollOptions: n = { behavior: "smooth", block: "center" },
|
|
31
|
+
focus: a = !0,
|
|
32
|
+
skipInitialMount: s = !0
|
|
33
|
+
} = r, m = h(!0), c = h(null), u = o.find((l) => !!e[l]) ?? null;
|
|
34
|
+
d(() => {
|
|
35
|
+
if (m.current && (m.current = !1, s)) {
|
|
36
|
+
c.current = u;
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (!u) {
|
|
40
|
+
c.current = null;
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (u === c.current || typeof window > "u") return;
|
|
44
|
+
const l = window.requestAnimationFrame(() => {
|
|
45
|
+
const g = S(t);
|
|
46
|
+
if (!g) return;
|
|
47
|
+
const f = y(u, g);
|
|
48
|
+
f && (f.scrollIntoView(n), a && f.focus({ preventScroll: !0 }), c.current = u);
|
|
49
|
+
});
|
|
50
|
+
return () => window.cancelAnimationFrame(l);
|
|
51
|
+
}, [u]);
|
|
52
|
+
}
|
|
53
|
+
function b() {
|
|
54
|
+
const [e, o] = w(() => i.language);
|
|
55
|
+
d(() => {
|
|
56
|
+
const n = (a) => o(a);
|
|
57
|
+
return i.on("languageChanged", n), i.language !== e && o(i.language), () => {
|
|
58
|
+
i.off("languageChanged", n);
|
|
59
|
+
};
|
|
60
|
+
}, [e]);
|
|
61
|
+
const r = p(async (n) => {
|
|
62
|
+
await i.changeLanguage(n);
|
|
63
|
+
}, []), t = i.dir(e) === "rtl" ? "rtl" : "ltr";
|
|
64
|
+
return { locale: e, dir: t, setLocale: r };
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
E as a,
|
|
68
|
+
M as b,
|
|
69
|
+
b as u
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=use-locale-C5rS3Xon.js.map
|
|
@@ -2,7 +2,7 @@ import { jsxs as l, jsx as a } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as M, useId as N, useState as O, useRef as y, useEffect as V, useMemo as _, useCallback as j } from "react";
|
|
3
3
|
import { c as W } from "./index-D2ZczOXr.js";
|
|
4
4
|
import { useTranslation as q } from "react-i18next";
|
|
5
|
-
import { A as u } from "./alert-
|
|
5
|
+
import { A as u } from "./alert-34A3K8y-.js";
|
|
6
6
|
import { B as F } from "./button-DD_0Xdmr.js";
|
|
7
7
|
import { C as H } from "./chevron-down-BX_NP2Yh.js";
|
|
8
8
|
const L = W(
|
|
@@ -176,4 +176,4 @@ P.displayName = "WarningStack";
|
|
|
176
176
|
export {
|
|
177
177
|
P as W
|
|
178
178
|
};
|
|
179
|
-
//# sourceMappingURL=warning-stack-
|
|
179
|
+
//# sourceMappingURL=warning-stack-CskQPAQ2.js.map
|
|
@@ -10,7 +10,7 @@ import { I as S } from "./icon-button-C4CGcYuz.js";
|
|
|
10
10
|
import { c as _ } from "./createLucideIcon-CrFbzy84.js";
|
|
11
11
|
import { C as Ne } from "./circle-BkqTgYmt.js";
|
|
12
12
|
import { u as Ce } from "./registry-C9nwlNyL.js";
|
|
13
|
-
import { A as V } from "./alert-
|
|
13
|
+
import { A as V } from "./alert-34A3K8y-.js";
|
|
14
14
|
import { B as _e } from "./button-DD_0Xdmr.js";
|
|
15
15
|
import { D as N } from "./dropdown-menu-dyV7gHh_.js";
|
|
16
16
|
import { E } from "./empty-state-3CLJIXSj.js";
|
|
@@ -1412,4 +1412,4 @@ export {
|
|
|
1412
1412
|
ee as r,
|
|
1413
1413
|
D as w
|
|
1414
1414
|
};
|
|
1415
|
-
//# sourceMappingURL=workflow-map-
|
|
1415
|
+
//# sourceMappingURL=workflow-map-D6Vsc2nY.js.map
|
package/dist/agent-catalog.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { usePrefersReducedMotion, useMediaQuery, useLocale, useTheme, resolveTheme, themeClassList, THEME_CLASS, THEME_STORAGE_KEY, ACCESSIBILITY_STORAGE_KEY, } from '../hooks';
|
|
2
|
-
export type { LocaleDir, UseLocaleReturn, ThemePreference, AccessibilityPreference, ResolvedTheme, UseThemeReturn, } from '../hooks';
|
|
1
|
+
export { usePrefersReducedMotion, useMediaQuery, useScrollToFirstError, useLocale, useTheme, resolveTheme, themeClassList, THEME_CLASS, THEME_STORAGE_KEY, ACCESSIBILITY_STORAGE_KEY, } from '../hooks';
|
|
2
|
+
export type { LocaleDir, UseLocaleReturn, UseScrollToFirstErrorOptions, ThemePreference, AccessibilityPreference, ResolvedTheme, UseThemeReturn, } from '../hooks';
|
|
3
3
|
export * from './button';
|
|
4
4
|
export * from './button-group';
|
|
5
5
|
export * from './floating-action-button';
|
|
@@ -9,7 +9,7 @@ type GlyphPreset = keyof typeof GLYPH_PRESETS;
|
|
|
9
9
|
declare const wrapperVariants: (props?: ({
|
|
10
10
|
background?: "solid" | "transparent" | null | undefined;
|
|
11
11
|
vibe?: "ghost" | "terminal" | "clean" | "hologram" | "synthwave" | "oscilloscope" | null | undefined;
|
|
12
|
-
mask?: "
|
|
12
|
+
mask?: "center" | "none" | null | undefined;
|
|
13
13
|
maskRadius?: "sm" | "md" | "lg" | "xl" | "xs" | null | undefined;
|
|
14
14
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
15
15
|
type Tone = 'primary' | 'accent' | 'success' | 'error' | 'info';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as r, f as s, p as m, a as e, s as n, b as o, c as i } from "../../_chunks/payment-form-
|
|
1
|
+
import { P as r, f as s, p as m, a as e, s as n, b as o, c as i } from "../../_chunks/payment-form-BIk2K3i3.js";
|
|
2
2
|
export {
|
|
3
3
|
r as PaymentForm,
|
|
4
4
|
s as formatPaymentAmount,
|
|
@@ -2,7 +2,7 @@ import { type ComponentPropsWithoutRef, type HTMLAttributes, type ReactNode } fr
|
|
|
2
2
|
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
3
3
|
import { type VariantProps } from 'class-variance-authority';
|
|
4
4
|
declare const contentVariants: (props?: ({
|
|
5
|
-
side?: "
|
|
5
|
+
side?: "end" | "start" | "top" | "bottom" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
export interface SheetHandle {
|
|
8
8
|
getIsOpen: () => boolean;
|
|
@@ -3,7 +3,7 @@ import { type VariantProps } from 'class-variance-authority';
|
|
|
3
3
|
declare const statVariants: (props?: ({
|
|
4
4
|
variant?: "default" | "compact" | "outlined" | "elevated" | null | undefined;
|
|
5
5
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
6
|
-
align?: "
|
|
6
|
+
align?: "center" | "end" | "start" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
export interface StatProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof statVariants> {
|
|
9
9
|
/** Metric label rendered above the value. */
|
|
@@ -2,7 +2,7 @@ import { type HTMLAttributes } from 'react';
|
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
import { type AccessibilityPreference, type ThemePreference } from '../../hooks';
|
|
4
4
|
declare const wrapperVariants: (props?: ({
|
|
5
|
-
variant?: "
|
|
5
|
+
variant?: "menu" | "split" | "compact" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
export type ThemeToggleVariant = 'menu' | 'compact' | 'split';
|
|
8
8
|
interface ThemeToggleBaseProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>, VariantProps<typeof wrapperVariants> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as r, W as e, a as s, b as d, c as w, i as t, l as f, m as l, r as i, w as k, d as n, e as A, f as C } from "../../_chunks/workflow-map-
|
|
1
|
+
import { C as r, W as e, a as s, b as d, c as w, i as t, l as f, m as l, r as i, w as k, d as n, e as A, f as C } from "../../_chunks/workflow-map-D6Vsc2nY.js";
|
|
2
2
|
export {
|
|
3
3
|
r as CORE_PATIENT_FIELDS,
|
|
4
4
|
e as WorkflowCard,
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { usePrefersReducedMotion } from './use-prefers-reduced-motion';
|
|
2
2
|
export { useMediaQuery } from './use-media-query';
|
|
3
|
+
export { useScrollToFirstError } from './use-scroll-to-first-error';
|
|
4
|
+
export type { UseScrollToFirstErrorOptions } from './use-scroll-to-first-error';
|
|
3
5
|
export { useLocale } from './use-locale';
|
|
4
6
|
export type { LocaleDir, UseLocaleReturn } from './use-locale';
|
|
5
7
|
export { useTheme, resolveTheme, themeClassList, THEME_STORAGE_KEY, ACCESSIBILITY_STORAGE_KEY, THEME_CLASS, } from './use-theme';
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { u as
|
|
2
|
-
import { u as o, a as u } from "../_chunks/use-locale-
|
|
3
|
-
import { A as
|
|
1
|
+
import { u as r } from "../_chunks/use-prefers-reduced-motion-BMwIQRjB.js";
|
|
2
|
+
import { u as o, a as u, b as E } from "../_chunks/use-locale-C5rS3Xon.js";
|
|
3
|
+
import { A as t, T as S, a as m, r as l, t as A, u as _ } from "../_chunks/use-theme-B1cwAXJR.js";
|
|
4
4
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
t as ACCESSIBILITY_STORAGE_KEY,
|
|
6
|
+
S as THEME_CLASS,
|
|
7
7
|
m as THEME_STORAGE_KEY,
|
|
8
|
-
|
|
8
|
+
l as resolveTheme,
|
|
9
9
|
A as themeClassList,
|
|
10
10
|
o as useLocale,
|
|
11
11
|
u as useMediaQuery,
|
|
12
|
-
|
|
12
|
+
r as usePrefersReducedMotion,
|
|
13
|
+
E as useScrollToFirstError,
|
|
13
14
|
_ as useTheme
|
|
14
15
|
};
|
|
15
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
export interface UseScrollToFirstErrorOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Limits the DOM query to this element. Useful when the page renders
|
|
5
|
+
* more than one form, or when an unrelated component happens to share
|
|
6
|
+
* a field name. Defaults to `document`.
|
|
7
|
+
*/
|
|
8
|
+
scope?: RefObject<HTMLElement | null>;
|
|
9
|
+
/**
|
|
10
|
+
* Forwarded to `scrollIntoView`. Defaults to
|
|
11
|
+
* `{ behavior: 'smooth', block: 'center' }`. Pass
|
|
12
|
+
* `{ behavior: 'auto' }` (or omit `behavior`) on consumers that
|
|
13
|
+
* respect `prefers-reduced-motion` upstream — the kit doesn't shadow
|
|
14
|
+
* the user's motion preference inside the hook, since some consumers
|
|
15
|
+
* deliberately keep a near-instant snap for power-user form flows.
|
|
16
|
+
*/
|
|
17
|
+
scrollOptions?: ScrollIntoViewOptions;
|
|
18
|
+
/**
|
|
19
|
+
* Move keyboard focus to the errored field after scrolling. Default
|
|
20
|
+
* `true`. The focus call uses `preventScroll: true` so the smooth
|
|
21
|
+
* scroll the hook just did isn't replaced by a snap.
|
|
22
|
+
*
|
|
23
|
+
* Setting this `false` defeats the keyboard-user side of WCAG 3.3.1
|
|
24
|
+
* — the viewport will scroll but the active element stays on the
|
|
25
|
+
* submit button, forcing a Shift+Tab back into the form. Only flip
|
|
26
|
+
* this off when an upstream concern (e.g. a custom error summary
|
|
27
|
+
* panel that owns its own focus) is taking responsibility.
|
|
28
|
+
*/
|
|
29
|
+
focus?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* On the very first render, do nothing even if `errors` already has
|
|
32
|
+
* entries. Default `true`. Without this the hook would yank the
|
|
33
|
+
* viewport whenever a form is hydrated with server-rendered errors
|
|
34
|
+
* from a no-JS fallback path — bad UX, since the user landed on the
|
|
35
|
+
* page and hasn't asked for any movement yet. Set `false` only when
|
|
36
|
+
* the consumer explicitly wants the initial-mount scroll (rare).
|
|
37
|
+
*/
|
|
38
|
+
skipInitialMount?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Scrolls the first errored field into view and (by default) focuses
|
|
42
|
+
* it, after `errors` changes. Backs the standard AlfaDocs rebrand
|
|
43
|
+
* validation-error UX: after a 422 with `{ errors: { field: message } }`
|
|
44
|
+
* is rendered inline, the user shouldn't be left staring at red labels
|
|
45
|
+
* they can't see. Implements WCAG 3.3.1 / 3.3.3.
|
|
46
|
+
*
|
|
47
|
+
* The hook is stateless and never mutates the DOM beyond the
|
|
48
|
+
* `scrollIntoView` + `focus` calls.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* const fieldOrder = ['firstName', 'email', 'fiscalCode'] as const;
|
|
52
|
+
* const [errors, setErrors] = useState<Record<string, string>>({});
|
|
53
|
+
* useScrollToFirstError(errors, fieldOrder);
|
|
54
|
+
*
|
|
55
|
+
* @example Radix-based field
|
|
56
|
+
* <Checkbox data-error-anchor="consent" name="consent" />
|
|
57
|
+
* // hook scrolls to the visible <button>, not Radix's hidden input.
|
|
58
|
+
*
|
|
59
|
+
* @example Scoped to one form
|
|
60
|
+
* const formRef = useRef<HTMLFormElement>(null);
|
|
61
|
+
* useScrollToFirstError(errors, fieldOrder, { scope: formRef });
|
|
62
|
+
*/
|
|
63
|
+
export declare function useScrollToFirstError(errors: Readonly<Record<string, string | undefined>>, fieldOrder: ReadonlyArray<string>, options?: UseScrollToFirstErrorOptions): void;
|
|
64
|
+
//# sourceMappingURL=use-scroll-to-first-error.d.ts.map
|