@alfadocs/ui-kit 0.52.0 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{otp-input-CMphfBxZ.js → otp-input-Chb9r5vf.js} +89 -87
- package/dist/_chunks/{public-header.agent-BY6FH71R.js → public-header.agent-DyVpPwmv.js} +72 -62
- package/dist/_chunks/{sign-document-Bzld9jVM.js → sign-document-BzHTjMVC.js} +2 -2
- package/dist/_chunks/{signature-capture-CpMBhqQ9.js → signature-capture-CHbrKoA_.js} +163 -152
- package/dist/_chunks/signature-field-DhscKdgk.js +152 -0
- package/dist/_chunks/use-signing-session-C5evzYmo.js +108 -0
- package/dist/agent-catalog.json +1 -1
- package/dist/components/index.d.ts +3 -2
- package/dist/components/otp-input/index.js +1 -1
- package/dist/components/otp-input/otp-input.d.ts +6 -0
- package/dist/components/pdf-viewer/index.d.ts +1 -1
- package/dist/components/public-header/index.js +1 -1
- package/dist/components/public-header/public-header.d.ts +1 -1
- package/dist/components/sign-document/index.js +1 -1
- package/dist/components/signature-capture/index.js +1 -1
- package/dist/components/signature-capture/signature-capture.d.ts +7 -0
- package/dist/components/signature-field/index.d.ts +3 -0
- package/dist/components/signature-field/index.js +6 -0
- package/dist/components/signature-field/signature-field.d.ts +35 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +42 -41
- package/dist/hooks/use-signing-session.d.ts +36 -0
- package/dist/i18n/locales/ar.d.ts +8 -0
- package/dist/i18n/locales/ar.js +8 -0
- package/dist/i18n/locales/de.d.ts +8 -0
- package/dist/i18n/locales/de.js +8 -0
- package/dist/i18n/locales/el.d.ts +8 -0
- package/dist/i18n/locales/el.js +8 -0
- package/dist/i18n/locales/en.d.ts +8 -0
- package/dist/i18n/locales/en.js +8 -0
- package/dist/i18n/locales/es.d.ts +8 -0
- package/dist/i18n/locales/es.js +8 -0
- package/dist/i18n/locales/fr.d.ts +8 -0
- package/dist/i18n/locales/fr.js +8 -0
- package/dist/i18n/locales/hi.d.ts +8 -0
- package/dist/i18n/locales/hi.js +8 -0
- package/dist/i18n/locales/it.d.ts +8 -0
- package/dist/i18n/locales/it.js +8 -0
- package/dist/i18n/locales/ja.d.ts +8 -0
- package/dist/i18n/locales/ja.js +8 -0
- package/dist/i18n/locales/nl.d.ts +8 -0
- package/dist/i18n/locales/nl.js +8 -0
- package/dist/i18n/locales/pl.d.ts +8 -0
- package/dist/i18n/locales/pl.js +8 -0
- package/dist/i18n/locales/pt.d.ts +8 -0
- package/dist/i18n/locales/pt.js +8 -0
- package/dist/i18n/locales/ro.d.ts +8 -0
- package/dist/i18n/locales/ro.js +8 -0
- package/dist/i18n/locales/ru.d.ts +8 -0
- package/dist/i18n/locales/ru.js +8 -0
- package/dist/i18n/locales/sq.d.ts +8 -0
- package/dist/i18n/locales/sq.js +8 -0
- package/dist/i18n/locales/sv.d.ts +8 -0
- package/dist/i18n/locales/sv.js +8 -0
- package/dist/i18n/locales/tr.d.ts +8 -0
- package/dist/i18n/locales/tr.js +8 -0
- package/dist/i18n/locales/zh.d.ts +8 -0
- package/dist/i18n/locales/zh.js +8 -0
- package/dist/index.js +701 -697
- package/dist/locales/ar.json +8 -0
- package/dist/locales/de.json +8 -0
- package/dist/locales/el.json +8 -0
- package/dist/locales/en.json +8 -0
- package/dist/locales/es.json +8 -0
- package/dist/locales/fr.json +8 -0
- package/dist/locales/hi.json +8 -0
- package/dist/locales/it.json +8 -0
- package/dist/locales/ja.json +8 -0
- package/dist/locales/nl.json +8 -0
- package/dist/locales/pl.json +8 -0
- package/dist/locales/pt.json +8 -0
- package/dist/locales/ro.json +8 -0
- package/dist/locales/ru.json +8 -0
- package/dist/locales/sq.json +8 -0
- package/dist/locales/sv.json +8 -0
- package/dist/locales/tr.json +8 -0
- package/dist/locales/zh.json +8 -0
- package/dist/tokens.css +1 -1
- package/package.json +5 -1
- package/dist/_chunks/use-scroll-to-first-error-4Za-u5Nw.js +0 -43
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { u as
|
|
6
|
-
import { u as
|
|
7
|
-
import { u as
|
|
8
|
-
import { u as
|
|
9
|
-
const
|
|
1
|
+
import { jsxs as ee, jsx as y } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as te, useId as re, useRef as M, useState as se, useEffect as ae, useCallback as N, useMemo as oe, useImperativeHandle as ie } from "react";
|
|
3
|
+
import { c as S } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as ne } from "react-i18next";
|
|
5
|
+
import { u as ce } from "./use-controllable-state-BiY4xTzM.js";
|
|
6
|
+
import { u as ue } from "./use-web-otp-D_utzp6S.js";
|
|
7
|
+
import { u as le } from "./form-field-context-B3APVHKx.js";
|
|
8
|
+
import { u as de } from "./registry-nPAVE19X.js";
|
|
9
|
+
const pe = {
|
|
10
10
|
id: "otp-input",
|
|
11
11
|
capabilities: ["edit_inline", "submit"],
|
|
12
12
|
state: {
|
|
@@ -62,7 +62,7 @@ const de = {
|
|
|
62
62
|
description: "Sourced from the id prop."
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
},
|
|
65
|
+
}, fe = S("ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]"), me = S(
|
|
66
66
|
[
|
|
67
67
|
"ds:w-[var(--min-target-size)] ds:h-[var(--min-target-size)]",
|
|
68
68
|
"ds:rounded-[var(--radius-sm)]",
|
|
@@ -86,95 +86,96 @@ const de = {
|
|
|
86
86
|
function F(e) {
|
|
87
87
|
return e.replace(/[\u0660-\u0669]/g, (a) => String(a.charCodeAt(0) - 1632)).replace(/[\u06F0-\u06F9]/g, (a) => String(a.charCodeAt(0) - 1776));
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function w(e, a) {
|
|
90
90
|
return F(e).replace(/\D/g, "").slice(0, a);
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
const m =
|
|
92
|
+
function ve(e, a) {
|
|
93
|
+
const m = w(e, a), l = new Array(a).fill("");
|
|
94
94
|
for (let n = 0; n < m.length; n += 1)
|
|
95
95
|
l[n] = m[n];
|
|
96
96
|
return l;
|
|
97
97
|
}
|
|
98
|
-
const
|
|
98
|
+
const be = te(
|
|
99
99
|
({
|
|
100
100
|
length: e = 6,
|
|
101
101
|
value: a,
|
|
102
102
|
defaultValue: m,
|
|
103
103
|
onChange: l,
|
|
104
104
|
onComplete: n,
|
|
105
|
-
disabled:
|
|
106
|
-
error:
|
|
107
|
-
label:
|
|
105
|
+
disabled: H,
|
|
106
|
+
error: $,
|
|
107
|
+
label: I,
|
|
108
108
|
id: K,
|
|
109
|
-
className:
|
|
110
|
-
webOtp:
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
className: j,
|
|
110
|
+
webOtp: z = !1,
|
|
111
|
+
name: C
|
|
112
|
+
}, W) => {
|
|
113
|
+
const { t: _ } = ne(), v = le(), q = re(), O = I ? q : void 0, [G, P] = ce({
|
|
113
114
|
value: a,
|
|
114
|
-
defaultValue:
|
|
115
|
-
}), p =
|
|
115
|
+
defaultValue: w(m ?? "", e)
|
|
116
|
+
}), p = w(G ?? "", e), J = ve(p, e), b = v.disabled || !!H, B = v.invalid || !!$, Q = B ? "error" : "default", E = M([]), h = M(p.length === e), d = M(p);
|
|
116
117
|
d.current = p;
|
|
117
|
-
const
|
|
118
|
-
const
|
|
119
|
-
return
|
|
120
|
-
}, [f,
|
|
121
|
-
|
|
122
|
-
f >= e &&
|
|
118
|
+
const U = () => {
|
|
119
|
+
const r = p.length;
|
|
120
|
+
return r >= e ? e - 1 : r;
|
|
121
|
+
}, [f, k] = se(U);
|
|
122
|
+
ae(() => {
|
|
123
|
+
f >= e && k(e - 1);
|
|
123
124
|
}, [f, e]);
|
|
124
125
|
const c = N(
|
|
125
|
-
(
|
|
126
|
-
const t = Math.max(0, Math.min(e - 1,
|
|
127
|
-
|
|
128
|
-
const
|
|
129
|
-
|
|
126
|
+
(r) => {
|
|
127
|
+
const t = Math.max(0, Math.min(e - 1, r));
|
|
128
|
+
k(t);
|
|
129
|
+
const s = E.current[t];
|
|
130
|
+
s && (s.focus(), s.select());
|
|
130
131
|
},
|
|
131
132
|
[e]
|
|
132
133
|
), u = N(
|
|
133
|
-
(
|
|
134
|
-
const t =
|
|
135
|
-
P(t), d.current = t, l == null || l(t), t.length === e ?
|
|
134
|
+
(r) => {
|
|
135
|
+
const t = w(r, e);
|
|
136
|
+
P(t), d.current = t, l == null || l(t), t.length === e ? h.current || (h.current = !0, n == null || n(t)) : h.current = !1;
|
|
136
137
|
},
|
|
137
138
|
[P, e, l, n]
|
|
138
139
|
);
|
|
139
|
-
|
|
140
|
-
enabled:
|
|
140
|
+
ue({
|
|
141
|
+
enabled: z && !b,
|
|
141
142
|
onCode: u
|
|
142
143
|
});
|
|
143
|
-
const
|
|
144
|
-
const
|
|
144
|
+
const X = (r) => (t) => {
|
|
145
|
+
const s = t.target.value, o = F(s).replace(/\D/g, ""), i = d.current;
|
|
145
146
|
if (o.length === 0) {
|
|
146
|
-
if (
|
|
147
|
-
const
|
|
148
|
-
u(
|
|
147
|
+
if (s === "" && r < i.length) {
|
|
148
|
+
const R = i.slice(0, r) + i.slice(r + 1);
|
|
149
|
+
u(R);
|
|
149
150
|
}
|
|
150
151
|
return;
|
|
151
152
|
}
|
|
152
|
-
const g = i.slice(0,
|
|
153
|
-
u(
|
|
154
|
-
const
|
|
155
|
-
c(
|
|
156
|
-
},
|
|
157
|
-
const
|
|
153
|
+
const g = i.slice(0, r), D = i.slice(r + o.length), T = (g + o + D).slice(0, e);
|
|
154
|
+
u(T);
|
|
155
|
+
const A = Math.min(r + o.length, e - 1);
|
|
156
|
+
c(A);
|
|
157
|
+
}, Y = (r) => (t) => {
|
|
158
|
+
const s = d.current;
|
|
158
159
|
if (t.key === "Backspace") {
|
|
159
|
-
if (r
|
|
160
|
+
if (s[r]) {
|
|
160
161
|
t.preventDefault();
|
|
161
|
-
const o =
|
|
162
|
+
const o = s.slice(0, r) + s.slice(r + 1);
|
|
162
163
|
u(o);
|
|
163
164
|
return;
|
|
164
165
|
}
|
|
165
|
-
if (
|
|
166
|
+
if (r > 0) {
|
|
166
167
|
t.preventDefault();
|
|
167
|
-
const o =
|
|
168
|
-
u(o), c(
|
|
168
|
+
const o = s.slice(0, r - 1) + s.slice(r);
|
|
169
|
+
u(o), c(r - 1);
|
|
169
170
|
}
|
|
170
171
|
return;
|
|
171
172
|
}
|
|
172
173
|
if (t.key === "ArrowLeft") {
|
|
173
|
-
t.preventDefault(),
|
|
174
|
+
t.preventDefault(), r > 0 && c(r - 1);
|
|
174
175
|
return;
|
|
175
176
|
}
|
|
176
177
|
if (t.key === "ArrowRight") {
|
|
177
|
-
t.preventDefault(),
|
|
178
|
+
t.preventDefault(), r < e - 1 && c(r + 1);
|
|
178
179
|
return;
|
|
179
180
|
}
|
|
180
181
|
if (t.key === "Home") {
|
|
@@ -182,51 +183,51 @@ const ve = ee(
|
|
|
182
183
|
return;
|
|
183
184
|
}
|
|
184
185
|
t.key === "End" && (t.preventDefault(), c(e - 1));
|
|
185
|
-
},
|
|
186
|
+
}, Z = (r) => (t) => {
|
|
186
187
|
const o = t.clipboardData.getData("text").replace(/\s+/g, ""), i = F(o);
|
|
187
188
|
if (!/^[0-9]+$/.test(i)) return;
|
|
188
189
|
t.preventDefault();
|
|
189
|
-
const g = d.current,
|
|
190
|
-
u(
|
|
191
|
-
const
|
|
192
|
-
c(
|
|
193
|
-
},
|
|
194
|
-
|
|
195
|
-
}, L = v.id,
|
|
190
|
+
const g = d.current, D = g.slice(0, r), T = g.slice(r + i.length), A = (D + i + T).slice(0, e);
|
|
191
|
+
u(A);
|
|
192
|
+
const R = Math.min(r + i.length, e - 1);
|
|
193
|
+
c(R);
|
|
194
|
+
}, x = (r) => (t) => {
|
|
195
|
+
k(r), t.currentTarget.select();
|
|
196
|
+
}, L = v.id, V = oe(
|
|
196
197
|
() => ({
|
|
197
198
|
getValue: () => d.current,
|
|
198
|
-
setValue: (
|
|
199
|
+
setValue: (r) => u(r),
|
|
199
200
|
clear: () => u(""),
|
|
200
201
|
focus: () => c(f),
|
|
201
202
|
isComplete: () => d.current.length === e
|
|
202
203
|
}),
|
|
203
204
|
[u, c, f, e]
|
|
204
205
|
);
|
|
205
|
-
return
|
|
206
|
-
|
|
206
|
+
return de(pe, V, K), ie(W, () => V, [V]), /* @__PURE__ */ ee("div", { className: fe({ className: j }), children: [
|
|
207
|
+
I ? /* @__PURE__ */ y(
|
|
207
208
|
"label",
|
|
208
209
|
{
|
|
209
|
-
id:
|
|
210
|
+
id: O,
|
|
210
211
|
htmlFor: `${L}-0`,
|
|
211
212
|
className: "type-label ds:text-foreground",
|
|
212
|
-
children:
|
|
213
|
+
children: I
|
|
213
214
|
}
|
|
214
215
|
) : null,
|
|
215
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ y(
|
|
216
217
|
"div",
|
|
217
218
|
{
|
|
218
219
|
role: "group",
|
|
219
220
|
dir: "ltr",
|
|
220
|
-
"aria-labelledby":
|
|
221
|
+
"aria-labelledby": O,
|
|
221
222
|
"aria-invalid": B || void 0,
|
|
222
223
|
"aria-describedby": v.describedBy || void 0,
|
|
223
224
|
"aria-disabled": b || void 0,
|
|
224
225
|
"data-component": "otp-input",
|
|
225
226
|
"data-component-id": K,
|
|
226
227
|
className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]",
|
|
227
|
-
children:
|
|
228
|
-
const
|
|
229
|
-
return /* @__PURE__ */
|
|
228
|
+
children: J.map((r, t) => {
|
|
229
|
+
const s = !b && t === f;
|
|
230
|
+
return /* @__PURE__ */ y(
|
|
230
231
|
"input",
|
|
231
232
|
{
|
|
232
233
|
ref: (o) => {
|
|
@@ -238,29 +239,30 @@ const ve = ee(
|
|
|
238
239
|
pattern: "[0-9]*",
|
|
239
240
|
autoComplete: t === 0 ? "one-time-code" : "off",
|
|
240
241
|
maxLength: 1,
|
|
241
|
-
value:
|
|
242
|
+
value: r,
|
|
242
243
|
disabled: b,
|
|
243
|
-
tabIndex:
|
|
244
|
-
"aria-label":
|
|
244
|
+
tabIndex: s ? 0 : -1,
|
|
245
|
+
"aria-label": _("inputs.otp.digitLabel", {
|
|
245
246
|
current: t + 1,
|
|
246
247
|
total: e
|
|
247
248
|
}),
|
|
248
|
-
onChange:
|
|
249
|
-
onKeyDown:
|
|
250
|
-
onPaste:
|
|
251
|
-
onFocus:
|
|
252
|
-
className:
|
|
249
|
+
onChange: X(t),
|
|
250
|
+
onKeyDown: Y(t),
|
|
251
|
+
onPaste: Z(t),
|
|
252
|
+
onFocus: x(t),
|
|
253
|
+
className: me({ tone: Q })
|
|
253
254
|
},
|
|
254
255
|
t
|
|
255
256
|
);
|
|
256
257
|
})
|
|
257
258
|
}
|
|
258
|
-
)
|
|
259
|
+
),
|
|
260
|
+
C ? /* @__PURE__ */ y("input", { type: "hidden", name: C, value: p, readOnly: !0 }) : null
|
|
259
261
|
] });
|
|
260
262
|
}
|
|
261
263
|
);
|
|
262
|
-
|
|
264
|
+
be.displayName = "OTPInput";
|
|
263
265
|
export {
|
|
264
|
-
|
|
266
|
+
be as O
|
|
265
267
|
};
|
|
266
|
-
//# sourceMappingURL=otp-input-
|
|
268
|
+
//# sourceMappingURL=otp-input-Chb9r5vf.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
1
|
+
import { jsx as s, jsxs as t, Fragment as _ } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as h, useId as Q, useState as y, useCallback as M, useImperativeHandle as U, useContext as N, useEffect as B, useRef as D, createContext as Z } from "react";
|
|
3
3
|
import { c as C } from "./index-D2ZczOXr.js";
|
|
4
4
|
import { useTranslation as ss } from "react-i18next";
|
|
@@ -8,7 +8,7 @@ import { S as f } from "./sheet-xbzu4YiY.js";
|
|
|
8
8
|
import { C as I } from "./chevron-down-BX_NP2Yh.js";
|
|
9
9
|
import { X as ds } from "./x-CCcI3eJp.js";
|
|
10
10
|
import { M as as } from "./menu-XRhW3_99.js";
|
|
11
|
-
const g = Z("desktop"),
|
|
11
|
+
const g = Z("desktop"), rs = C(
|
|
12
12
|
[
|
|
13
13
|
"ds:w-full ds:z-[var(--z-sticky)]",
|
|
14
14
|
"ds:transition-[background-color,box-shadow,transform] ds:duration-[var(--animation-duration)]",
|
|
@@ -48,6 +48,16 @@ const g = Z("desktop"), ns = C(
|
|
|
48
48
|
"ds:h-14 ds:md:h-16",
|
|
49
49
|
"theme-dark ds:bg-[var(--background)] ds:text-[var(--foreground)]"
|
|
50
50
|
].join(" "),
|
|
51
|
+
// brand: on-primary bar for public signer/marketing surfaces —
|
|
52
|
+
// e.g. sign.alfadocs.com signing nav. Tokens only; logo should be
|
|
53
|
+
// <Logo variant="monochrome" tone="inherit" /> to read on the
|
|
54
|
+
// primary fill.
|
|
55
|
+
brand: [
|
|
56
|
+
"ds:flex ds:items-center ds:gap-[var(--spacing-md)]",
|
|
57
|
+
"ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:sm:ps-[var(--spacing-lg)] ds:sm:pe-[var(--spacing-lg)]",
|
|
58
|
+
"ds:h-14 ds:md:h-16",
|
|
59
|
+
"ds:bg-[var(--primary)] ds:text-[var(--primary-foreground)]"
|
|
60
|
+
].join(" "),
|
|
51
61
|
// `pill` matches alfadocs.com's floating rounded-pill header.
|
|
52
62
|
// The outer header is fully transparent (no border, no bg) and
|
|
53
63
|
// simply provides a top-side gutter so the inner container reads
|
|
@@ -73,7 +83,7 @@ const g = Z("desktop"), ns = C(
|
|
|
73
83
|
},
|
|
74
84
|
defaultVariants: { variant: "pill", sticky: "none" }
|
|
75
85
|
}
|
|
76
|
-
),
|
|
86
|
+
), ns = [
|
|
77
87
|
"ds:flex ds:items-center ds:gap-[var(--spacing-md)]",
|
|
78
88
|
"ds:w-full ds:max-w-[1400px] ds:mx-auto",
|
|
79
89
|
"ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:sm:ps-[var(--spacing-lg)] ds:sm:pe-[var(--spacing-lg)]",
|
|
@@ -108,7 +118,7 @@ const g = Z("desktop"), ns = C(
|
|
|
108
118
|
"ds:data-[active=true]:text-[var(--primary)]",
|
|
109
119
|
"ds:data-[active=true]:[box-shadow:inset_0_-2px_0_var(--primary)]"
|
|
110
120
|
].join(" ")
|
|
111
|
-
),
|
|
121
|
+
), is = [
|
|
112
122
|
"ds:group ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
113
123
|
"type-body-sm ds:font-medium",
|
|
114
124
|
// Mirror the navLinkVariants colour + inline padding so triggers and
|
|
@@ -122,7 +132,7 @@ const g = Z("desktop"), ns = C(
|
|
|
122
132
|
"ds:hover:text-[var(--primary)]",
|
|
123
133
|
"ds:data-[state=open]:text-[var(--primary)]",
|
|
124
134
|
"ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none"
|
|
125
|
-
].join(" "),
|
|
135
|
+
].join(" "), ts = [
|
|
126
136
|
"ds:size-3 ds:shrink-0",
|
|
127
137
|
"ds:transition-transform ds:duration-[var(--animation-duration)]",
|
|
128
138
|
"ds:group-data-[state=open]:rotate-180",
|
|
@@ -199,21 +209,21 @@ const g = Z("desktop"), ns = C(
|
|
|
199
209
|
"ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none"
|
|
200
210
|
].join(" ");
|
|
201
211
|
function ps() {
|
|
202
|
-
const [e,
|
|
212
|
+
const [e, r] = y(() => typeof window > "u" || !window.matchMedia ? !1 : window.matchMedia("(prefers-reduced-motion: reduce)").matches);
|
|
203
213
|
return B(() => {
|
|
204
214
|
if (typeof window > "u" || !window.matchMedia) return;
|
|
205
|
-
const d = window.matchMedia("(prefers-reduced-motion: reduce)"), a = () =>
|
|
215
|
+
const d = window.matchMedia("(prefers-reduced-motion: reduce)"), a = () => r(d.matches);
|
|
206
216
|
return d.addEventListener("change", a), () => d.removeEventListener("change", a);
|
|
207
217
|
}, []), e;
|
|
208
218
|
}
|
|
209
|
-
function vs(e,
|
|
210
|
-
const [a,
|
|
219
|
+
function vs(e, r, d) {
|
|
220
|
+
const [a, i] = y(!1), [n, o] = y(!1), c = D(0), p = D(!1);
|
|
211
221
|
return B(() => {
|
|
212
222
|
if (!e || typeof window > "u") return;
|
|
213
223
|
c.current = window.scrollY;
|
|
214
224
|
const l = () => {
|
|
215
225
|
const v = window.scrollY;
|
|
216
|
-
if (
|
|
226
|
+
if (i(v > d), r === "scroll-up") {
|
|
217
227
|
const b = v - c.current;
|
|
218
228
|
b > 4 && v > d ? o(!0) : (b < -4 || v <= d) && o(!1);
|
|
219
229
|
}
|
|
@@ -224,44 +234,44 @@ function vs(e, n, d) {
|
|
|
224
234
|
return window.addEventListener("scroll", u, { passive: !0 }), l(), () => {
|
|
225
235
|
window.removeEventListener("scroll", u);
|
|
226
236
|
};
|
|
227
|
-
}, [e,
|
|
237
|
+
}, [e, r, d]), { stuck: a, hidden: n };
|
|
228
238
|
}
|
|
229
239
|
function R({
|
|
230
240
|
logo: e,
|
|
231
|
-
homeHref:
|
|
241
|
+
homeHref: r,
|
|
232
242
|
resolvedHomeLabel: d,
|
|
233
243
|
resolvedNavLabel: a,
|
|
234
|
-
resolvedMenuLabel:
|
|
235
|
-
navSlot:
|
|
244
|
+
resolvedMenuLabel: i,
|
|
245
|
+
navSlot: n,
|
|
236
246
|
actionsSlot: o,
|
|
237
247
|
menuOpen: c,
|
|
238
248
|
setMenuOpen: p,
|
|
239
249
|
sheetId: l
|
|
240
250
|
}) {
|
|
241
|
-
return /* @__PURE__ */
|
|
251
|
+
return /* @__PURE__ */ t(_, { children: [
|
|
242
252
|
/* @__PURE__ */ s(
|
|
243
253
|
"a",
|
|
244
254
|
{
|
|
245
|
-
href:
|
|
255
|
+
href: r,
|
|
246
256
|
"aria-label": d,
|
|
247
257
|
className: "ds:inline-flex ds:items-center ds:rounded-[var(--radius-sm)] ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
248
258
|
children: e
|
|
249
259
|
}
|
|
250
260
|
),
|
|
251
|
-
|
|
261
|
+
n ? /* @__PURE__ */ s(g.Provider, { value: "desktop", children: /* @__PURE__ */ t(
|
|
252
262
|
m.Root,
|
|
253
263
|
{
|
|
254
264
|
"aria-label": a,
|
|
255
265
|
className: "ds:hidden ds:md:flex ds:relative ds:items-center ds:ms-[var(--spacing-lg)] ds:flex-1 ds:[&>div:first-of-type]:flex ds:[&>div:first-of-type]:flex-1",
|
|
256
266
|
delayDuration: 150,
|
|
257
267
|
children: [
|
|
258
|
-
/* @__PURE__ */ s(m.List, { className: "ds:flex ds:flex-1 ds:items-center ds:justify-center ds:gap-[var(--spacing-md)] ds:list-none ds:m-0 ds:ps-0", children:
|
|
268
|
+
/* @__PURE__ */ s(m.List, { className: "ds:flex ds:flex-1 ds:items-center ds:justify-center ds:gap-[var(--spacing-md)] ds:list-none ds:m-0 ds:ps-0", children: n }),
|
|
259
269
|
/* @__PURE__ */ s("div", { className: "ds:absolute ds:top-full ds:start-0 ds:end-0 ds:flex ds:justify-center ds:pointer-events-none", children: /* @__PURE__ */ s("div", { className: "ds:pointer-events-auto", children: /* @__PURE__ */ s(m.Viewport, { className: ls }) }) })
|
|
260
270
|
]
|
|
261
271
|
}
|
|
262
272
|
) }) : null,
|
|
263
273
|
o ? /* @__PURE__ */ s("div", { className: "ds:hidden ds:md:flex ds:items-center ds:gap-[var(--spacing-sm)] ds:ms-auto", children: o }) : null,
|
|
264
|
-
/* @__PURE__ */
|
|
274
|
+
/* @__PURE__ */ t(f, { open: c, onOpenChange: p, children: [
|
|
265
275
|
/* @__PURE__ */ s(f.Trigger, { asChild: !0, children: /* @__PURE__ */ s(
|
|
266
276
|
es,
|
|
267
277
|
{
|
|
@@ -271,19 +281,19 @@ function R({
|
|
|
271
281
|
icon: c ? /* @__PURE__ */ s(ds, { "aria-hidden": "true" }) : /* @__PURE__ */ s(as, { "aria-hidden": "true" }),
|
|
272
282
|
"aria-controls": l,
|
|
273
283
|
"aria-expanded": c,
|
|
274
|
-
"aria-label":
|
|
284
|
+
"aria-label": i
|
|
275
285
|
}
|
|
276
286
|
) }),
|
|
277
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ t(f.Content, { side: "end", size: "md", id: l, children: [
|
|
278
288
|
/* @__PURE__ */ s(f.Header, { children: /* @__PURE__ */ s(f.Title, { children: a }) }),
|
|
279
|
-
/* @__PURE__ */ s(f.Body, { children: /* @__PURE__ */
|
|
280
|
-
|
|
289
|
+
/* @__PURE__ */ s(f.Body, { children: /* @__PURE__ */ t("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
290
|
+
n ? /* @__PURE__ */ s(g.Provider, { value: "mobile", children: /* @__PURE__ */ s(
|
|
281
291
|
"nav",
|
|
282
292
|
{
|
|
283
293
|
"aria-label": a,
|
|
284
294
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
|
|
285
295
|
"data-mobile-nav": "true",
|
|
286
|
-
children:
|
|
296
|
+
children: n
|
|
287
297
|
}
|
|
288
298
|
) }) : null,
|
|
289
299
|
o ? /* @__PURE__ */ s("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:mt-[var(--spacing-md)]", children: o }) : null
|
|
@@ -295,11 +305,11 @@ function R({
|
|
|
295
305
|
const E = h(
|
|
296
306
|
({
|
|
297
307
|
logo: e,
|
|
298
|
-
homeHref:
|
|
308
|
+
homeHref: r = "/",
|
|
299
309
|
homeLabel: d,
|
|
300
310
|
navSlot: a,
|
|
301
|
-
actionsSlot:
|
|
302
|
-
variant:
|
|
311
|
+
actionsSlot: i,
|
|
312
|
+
variant: n = "pill",
|
|
303
313
|
sticky: o = "none",
|
|
304
314
|
stickyOffset: c = 80,
|
|
305
315
|
menuLabel: p,
|
|
@@ -308,7 +318,7 @@ const E = h(
|
|
|
308
318
|
className: v,
|
|
309
319
|
...b
|
|
310
320
|
}, A) => {
|
|
311
|
-
const { t: x } = ss(), j = ps(), Y = Q(), q = `${u ?? Y}-sheet`, [w, k] = y(!1), F =
|
|
321
|
+
const { t: x } = ss(), j = ps(), Y = Q(), q = `${u ?? Y}-sheet`, [w, k] = y(!1), F = n === "transparent" || o === "scroll-up", { stuck: W, hidden: X } = vs(
|
|
312
322
|
F,
|
|
313
323
|
o,
|
|
314
324
|
c
|
|
@@ -324,12 +334,12 @@ const E = h(
|
|
|
324
334
|
);
|
|
325
335
|
const G = d ?? x("publicHeader.homeLabel", "AlfaDocs — home"), J = l ?? x("publicHeader.primaryNavLabel", "Primary"), K = p ?? (w ? x("publicHeader.closeMenu", "Close menu") : x("publicHeader.openMenu", "Open menu")), P = {
|
|
326
336
|
logo: e,
|
|
327
|
-
homeHref:
|
|
337
|
+
homeHref: r,
|
|
328
338
|
resolvedHomeLabel: G,
|
|
329
339
|
resolvedNavLabel: J,
|
|
330
340
|
resolvedMenuLabel: K,
|
|
331
341
|
navSlot: a,
|
|
332
|
-
actionsSlot:
|
|
342
|
+
actionsSlot: i,
|
|
333
343
|
menuOpen: w,
|
|
334
344
|
setMenuOpen: k,
|
|
335
345
|
sheetId: q
|
|
@@ -340,16 +350,16 @@ const E = h(
|
|
|
340
350
|
...b,
|
|
341
351
|
"data-component": "public-header",
|
|
342
352
|
"data-component-id": u,
|
|
343
|
-
"data-variant":
|
|
353
|
+
"data-variant": n,
|
|
344
354
|
"data-stuck": W ? "true" : void 0,
|
|
345
355
|
"data-hidden": $ ? "true" : void 0,
|
|
346
356
|
"data-state": j ? "reduced-motion" : void 0,
|
|
347
|
-
className:
|
|
348
|
-
children:
|
|
357
|
+
className: rs({ variant: n, sticky: o, className: v }),
|
|
358
|
+
children: n === "pill" ? /* @__PURE__ */ s(
|
|
349
359
|
"div",
|
|
350
360
|
{
|
|
351
361
|
"data-component": "public-header-container",
|
|
352
|
-
className:
|
|
362
|
+
className: ns,
|
|
353
363
|
children: /* @__PURE__ */ s(R, { ...P })
|
|
354
364
|
}
|
|
355
365
|
) : /* @__PURE__ */ s(R, { ...P })
|
|
@@ -358,10 +368,10 @@ const E = h(
|
|
|
358
368
|
}
|
|
359
369
|
);
|
|
360
370
|
E.displayName = "PublicHeader";
|
|
361
|
-
const T = h(({ active: e, className:
|
|
371
|
+
const T = h(({ active: e, className: r, children: d, ...a }, i) => N(g) === "mobile" ? /* @__PURE__ */ s(
|
|
362
372
|
"a",
|
|
363
373
|
{
|
|
364
|
-
ref:
|
|
374
|
+
ref: i,
|
|
365
375
|
...a,
|
|
366
376
|
"data-active": e ? "true" : void 0,
|
|
367
377
|
"aria-current": e ? "page" : void 0,
|
|
@@ -376,30 +386,30 @@ const T = h(({ active: e, className: n, children: d, ...a }, t) => N(g) === "mob
|
|
|
376
386
|
"ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
377
387
|
"ds:data-[active=true]:text-[var(--primary)]",
|
|
378
388
|
"ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
|
|
379
|
-
|
|
389
|
+
r
|
|
380
390
|
].filter(Boolean).join(" "),
|
|
381
391
|
children: d
|
|
382
392
|
}
|
|
383
393
|
) : /* @__PURE__ */ s(m.Item, { children: /* @__PURE__ */ s(m.Link, { asChild: !0, active: e, children: /* @__PURE__ */ s(
|
|
384
394
|
"a",
|
|
385
395
|
{
|
|
386
|
-
ref:
|
|
396
|
+
ref: i,
|
|
387
397
|
...a,
|
|
388
398
|
"data-active": e ? "true" : void 0,
|
|
389
399
|
"aria-current": e ? "page" : void 0,
|
|
390
|
-
className: [os(),
|
|
400
|
+
className: [os(), r].filter(Boolean).join(" "),
|
|
391
401
|
children: d
|
|
392
402
|
}
|
|
393
403
|
) }) }));
|
|
394
404
|
T.displayName = "PublicHeader.NavLink";
|
|
395
|
-
const V = h(({ label: e, wide:
|
|
405
|
+
const V = h(({ label: e, wide: r = !1, children: d, id: a }, i) => N(g) === "mobile" ? /* @__PURE__ */ t(
|
|
396
406
|
"details",
|
|
397
407
|
{
|
|
398
408
|
id: a,
|
|
399
409
|
"data-component": "public-header-nav-dropdown",
|
|
400
410
|
className: "ds:group ds:border-b ds:border-[color:var(--border)]",
|
|
401
411
|
children: [
|
|
402
|
-
/* @__PURE__ */
|
|
412
|
+
/* @__PURE__ */ t(
|
|
403
413
|
"summary",
|
|
404
414
|
{
|
|
405
415
|
className: [
|
|
@@ -425,38 +435,38 @@ const V = h(({ label: e, wide: n = !1, children: d, id: a }, t) => N(g) === "mob
|
|
|
425
435
|
/* @__PURE__ */ s("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:py-[var(--spacing-sm)]", children: d })
|
|
426
436
|
]
|
|
427
437
|
}
|
|
428
|
-
) : /* @__PURE__ */
|
|
429
|
-
/* @__PURE__ */
|
|
438
|
+
) : /* @__PURE__ */ t(m.Item, { "data-component": "public-header-nav-dropdown", children: [
|
|
439
|
+
/* @__PURE__ */ t(
|
|
430
440
|
m.Trigger,
|
|
431
441
|
{
|
|
432
|
-
ref:
|
|
442
|
+
ref: i,
|
|
433
443
|
id: a,
|
|
434
|
-
className:
|
|
444
|
+
className: is,
|
|
435
445
|
children: [
|
|
436
446
|
e,
|
|
437
|
-
/* @__PURE__ */ s(I, { "aria-hidden": "true", className:
|
|
447
|
+
/* @__PURE__ */ s(I, { "aria-hidden": "true", className: ts })
|
|
438
448
|
]
|
|
439
449
|
}
|
|
440
450
|
),
|
|
441
451
|
/* @__PURE__ */ s(
|
|
442
452
|
m.Content,
|
|
443
453
|
{
|
|
444
|
-
className: cs({ wide:
|
|
454
|
+
className: cs({ wide: r }),
|
|
445
455
|
children: d
|
|
446
456
|
}
|
|
447
457
|
)
|
|
448
458
|
] }));
|
|
449
459
|
V.displayName = "PublicHeader.NavDropdown";
|
|
450
|
-
const O = h(({ href: e, title:
|
|
451
|
-
const
|
|
460
|
+
const O = h(({ href: e, title: r, subtitle: d, children: a }, i) => {
|
|
461
|
+
const n = N(g), o = /* @__PURE__ */ s(
|
|
452
462
|
"span",
|
|
453
463
|
{
|
|
454
464
|
"data-card-title": !0,
|
|
455
465
|
className: "type-title-card ds:text-[var(--foreground)] ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
|
|
456
|
-
children:
|
|
466
|
+
children: r
|
|
457
467
|
}
|
|
458
|
-
), l = /* @__PURE__ */
|
|
459
|
-
/* @__PURE__ */
|
|
468
|
+
), l = /* @__PURE__ */ t(_, { children: [
|
|
469
|
+
/* @__PURE__ */ t("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
460
470
|
o,
|
|
461
471
|
d ? /* @__PURE__ */ s("span", { className: "type-body-sm ds:text-[var(--muted-foreground)]", children: d }) : null
|
|
462
472
|
] }),
|
|
@@ -466,7 +476,7 @@ const O = h(({ href: e, title: n, subtitle: d, children: a }, t) => {
|
|
|
466
476
|
"data-card-arrow": !0,
|
|
467
477
|
"aria-hidden": "true",
|
|
468
478
|
className: "ds:flex-none ds:text-[var(--muted-foreground)] ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none ds:rtl:-scale-x-100",
|
|
469
|
-
children: /* @__PURE__ */
|
|
479
|
+
children: /* @__PURE__ */ t(
|
|
470
480
|
"svg",
|
|
471
481
|
{
|
|
472
482
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -488,13 +498,13 @@ const O = h(({ href: e, title: n, subtitle: d, children: a }, t) => {
|
|
|
488
498
|
)
|
|
489
499
|
] });
|
|
490
500
|
let u;
|
|
491
|
-
return e ?
|
|
501
|
+
return e ? n === "mobile" ? u = /* @__PURE__ */ s("a", { href: e, className: z, children: l }) : u = /* @__PURE__ */ s(m.Link, { asChild: !0, children: /* @__PURE__ */ s("a", { href: e, className: z, children: l }) }) : u = /* @__PURE__ */ t("div", { className: us, children: [
|
|
492
502
|
o,
|
|
493
503
|
d ? /* @__PURE__ */ s("span", { className: "ds:block type-body-sm ds:text-[var(--muted-foreground)] ds:mt-[var(--spacing-xs)]", children: d }) : null
|
|
494
|
-
] }), /* @__PURE__ */
|
|
504
|
+
] }), /* @__PURE__ */ t(
|
|
495
505
|
"div",
|
|
496
506
|
{
|
|
497
|
-
ref:
|
|
507
|
+
ref: i,
|
|
498
508
|
"data-component": "public-header-dropdown-card",
|
|
499
509
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
500
510
|
children: [
|
|
@@ -505,19 +515,19 @@ const O = h(({ href: e, title: n, subtitle: d, children: a }, t) => {
|
|
|
505
515
|
);
|
|
506
516
|
});
|
|
507
517
|
O.displayName = "PublicHeader.DropdownCard";
|
|
508
|
-
const S = h(({ active: e, className:
|
|
509
|
-
const
|
|
518
|
+
const S = h(({ active: e, className: r, children: d, ...a }, i) => {
|
|
519
|
+
const n = N(g), o = /* @__PURE__ */ s(
|
|
510
520
|
"a",
|
|
511
521
|
{
|
|
512
|
-
ref:
|
|
522
|
+
ref: i,
|
|
513
523
|
...a,
|
|
514
524
|
"data-active": e ? "true" : void 0,
|
|
515
525
|
"aria-current": e ? "page" : void 0,
|
|
516
|
-
className: [ms,
|
|
526
|
+
className: [ms, r].filter(Boolean).join(" "),
|
|
517
527
|
children: d
|
|
518
528
|
}
|
|
519
529
|
);
|
|
520
|
-
return /* @__PURE__ */ s("li", { "data-component": "public-header-dropdown-link", children:
|
|
530
|
+
return /* @__PURE__ */ s("li", { "data-component": "public-header-dropdown-link", children: n === "mobile" ? o : /* @__PURE__ */ s(m.Link, { asChild: !0, active: e, children: o }) });
|
|
521
531
|
});
|
|
522
532
|
S.displayName = "PublicHeader.DropdownLink";
|
|
523
533
|
const Cs = Object.assign(E, {
|
|
@@ -564,4 +574,4 @@ export {
|
|
|
564
574
|
Cs as P,
|
|
565
575
|
js as p
|
|
566
576
|
};
|
|
567
|
-
//# sourceMappingURL=public-header.agent-
|
|
577
|
+
//# sourceMappingURL=public-header.agent-DyVpPwmv.js.map
|