@alfadocs/ui-kit 0.16.0 → 0.17.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/benefit-card-DXmrAyfn.js +219 -0
- package/dist/_chunks/{carousel.agent-OTn-kMQg.js → carousel.agent-Xuw9LPZN.js} +14 -7
- package/dist/_chunks/copy-field-BCHAZ8QV.js +298 -0
- package/dist/_chunks/{navigation-menu-Bav1d_wA.js → navigation-menu-DdufF-_4.js} +18 -18
- package/dist/_chunks/{pagination-OQBlnb1H.js → pagination-F1ei4khE.js} +180 -158
- package/dist/_chunks/public-header.agent-BIBQzkeV.js +557 -0
- package/dist/agent-catalog.json +37 -1
- package/dist/components/benefit-card/index.js +1 -1
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/copy-field/copy-field.agent.d.ts +16 -0
- package/dist/components/copy-field/copy-field.d.ts +50 -0
- package/dist/components/copy-field/index.d.ts +5 -0
- package/dist/components/copy-field/index.js +6 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/navigation-menu/index.js +1 -1
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/public-header/index.d.ts +1 -1
- package/dist/components/public-header/index.js +1 -1
- package/dist/components/public-header/public-header.d.ts +36 -1
- package/dist/hooks/use-controllable-state.d.ts +10 -0
- package/dist/hooks/use-copy-to-clipboard.d.ts +45 -0
- package/dist/i18n/config.js +21 -0
- package/dist/i18n/resources.d.ts +21 -0
- package/dist/index.js +458 -455
- package/dist/locales/de.json +7 -0
- package/dist/locales/en.json +7 -0
- package/dist/locales/it.json +7 -0
- package/dist/tokens.css +1 -1
- package/package.json +5 -1
- package/dist/_chunks/benefit-card-Czs0oXdi.js +0 -161
- package/dist/_chunks/public-header.agent-ZLBAQ30j.js +0 -242
|
@@ -0,0 +1,557 @@
|
|
|
1
|
+
import { jsx as s, jsxs as t, Fragment as _ } from "react/jsx-runtime";
|
|
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
|
+
import { c as C } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as ss } from "react-i18next";
|
|
5
|
+
import * as m from "@radix-ui/react-navigation-menu";
|
|
6
|
+
import { I as es } from "./icon-button-C4CGcYuz.js";
|
|
7
|
+
import { S as f } from "./sheet-BT0izeoI.js";
|
|
8
|
+
import { C as I } from "./chevron-down-BX_NP2Yh.js";
|
|
9
|
+
import { X as ds } from "./x-CCcI3eJp.js";
|
|
10
|
+
import { M as as } from "./menu-XRhW3_99.js";
|
|
11
|
+
const g = Z("desktop"), ns = C(
|
|
12
|
+
[
|
|
13
|
+
"ds:w-full ds:z-[var(--z-sticky)]",
|
|
14
|
+
"ds:transition-[background-color,box-shadow,transform] ds:duration-[var(--animation-duration)]",
|
|
15
|
+
"ds:motion-reduce:transition-none"
|
|
16
|
+
].join(" "),
|
|
17
|
+
{
|
|
18
|
+
variants: {
|
|
19
|
+
variant: {
|
|
20
|
+
// Transparent fades to a solid pill chrome once data-stuck="true"
|
|
21
|
+
// (set by the rAF scroll listener). The fade is handled via the
|
|
22
|
+
// same background utility so `data-stuck` swaps cleanly between
|
|
23
|
+
// states.
|
|
24
|
+
transparent: [
|
|
25
|
+
"ds:flex ds:items-center ds:gap-[var(--spacing-md)]",
|
|
26
|
+
"ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:sm:ps-[var(--spacing-lg)] ds:sm:pe-[var(--spacing-lg)]",
|
|
27
|
+
"ds:h-14 ds:md:h-16",
|
|
28
|
+
"ds:bg-transparent ds:text-[var(--foreground)]",
|
|
29
|
+
"ds:data-[stuck=true]:bg-[var(--card)]",
|
|
30
|
+
"ds:data-[stuck=true]:shadow-[var(--shadow-md)]",
|
|
31
|
+
"ds:forced-colors:border-b ds:forced-colors:border-[CanvasText]"
|
|
32
|
+
].join(" "),
|
|
33
|
+
// `dark` flips its own scope into the dark token set so nav
|
|
34
|
+
// links + buttons inside read off-white text on the blue-800
|
|
35
|
+
// surface. Without the `theme-dark` scope the children inherit
|
|
36
|
+
// the light-theme `--foreground` (blue-500) and fail
|
|
37
|
+
// color-contrast at ~1.3:1.
|
|
38
|
+
dark: [
|
|
39
|
+
"ds:flex ds:items-center ds:gap-[var(--spacing-md)]",
|
|
40
|
+
"ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:sm:ps-[var(--spacing-lg)] ds:sm:pe-[var(--spacing-lg)]",
|
|
41
|
+
"ds:h-14 ds:md:h-16",
|
|
42
|
+
"theme-dark ds:bg-[var(--color-blue-800)] ds:text-[var(--foreground)]"
|
|
43
|
+
].join(" "),
|
|
44
|
+
// `pill` matches alfadocs.com's floating rounded-pill header.
|
|
45
|
+
// The outer header is fully transparent (no border, no bg) and
|
|
46
|
+
// simply provides a top-side gutter so the inner container reads
|
|
47
|
+
// as floating. The inner `data-component="public-header-container"`
|
|
48
|
+
// div is the visible chrome — border, rounded, card background.
|
|
49
|
+
pill: [
|
|
50
|
+
"ds:bg-transparent",
|
|
51
|
+
"ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:pt-[var(--spacing-md)]",
|
|
52
|
+
"ds:sm:ps-[var(--spacing-lg)] ds:sm:pe-[var(--spacing-lg)] ds:sm:pt-[var(--spacing-md)]"
|
|
53
|
+
].join(" ")
|
|
54
|
+
},
|
|
55
|
+
sticky: {
|
|
56
|
+
none: "",
|
|
57
|
+
top: "ds:sticky ds:top-0",
|
|
58
|
+
// `scroll-up` is sticky but translates off-screen when scrolling
|
|
59
|
+
// down past `stickyOffset` (handled by data-hidden="true") and
|
|
60
|
+
// slides back in when scrolling up.
|
|
61
|
+
"scroll-up": [
|
|
62
|
+
"ds:sticky ds:top-0",
|
|
63
|
+
"ds:data-[hidden=true]:-translate-y-full"
|
|
64
|
+
].join(" ")
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
defaultVariants: { variant: "pill", sticky: "none" }
|
|
68
|
+
}
|
|
69
|
+
), rs = [
|
|
70
|
+
"ds:flex ds:items-center ds:gap-[var(--spacing-md)]",
|
|
71
|
+
"ds:w-full ds:max-w-[1400px] ds:mx-auto",
|
|
72
|
+
"ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:sm:ps-[var(--spacing-lg)] ds:sm:pe-[var(--spacing-lg)]",
|
|
73
|
+
// 76px isn't a kit token; the closest is h-16 (64px) which reads tight
|
|
74
|
+
// against alfadocs.com's chrome — keep an explicit min-block-size so
|
|
75
|
+
// the pill reads as substantial without bloating beyond live reference.
|
|
76
|
+
"ds:min-h-16 ds:md:min-h-[76px]",
|
|
77
|
+
"ds:bg-[var(--card)] ds:text-[var(--foreground)]",
|
|
78
|
+
"ds:rounded-[var(--radius-lg)]",
|
|
79
|
+
// `--card-border` is the kit's subtle surface-border token (Card uses
|
|
80
|
+
// the same). Mirrors alfadocs.com's slate-200 pill border far closer
|
|
81
|
+
// than `--border` (the heavier component-input outline).
|
|
82
|
+
"ds:border ds:border-[color:var(--card-border)]",
|
|
83
|
+
"ds:transition-colors ds:duration-[var(--animation-duration)]",
|
|
84
|
+
"ds:motion-reduce:transition-none"
|
|
85
|
+
].join(" "), os = C(
|
|
86
|
+
[
|
|
87
|
+
"ds:inline-flex ds:items-center",
|
|
88
|
+
"type-body-sm ds:font-medium",
|
|
89
|
+
// Muted-foreground reads as secondary text and matches alfadocs.com's
|
|
90
|
+
// nav-link colour (`#545875`). `--foreground` was too dark vs the ref.
|
|
91
|
+
"ds:text-[var(--muted-foreground)]",
|
|
92
|
+
"ds:rounded-[var(--radius-sm)]",
|
|
93
|
+
"ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:py-[var(--spacing-xs)]",
|
|
94
|
+
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
95
|
+
"ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
96
|
+
"ds:hover:text-[var(--primary)]",
|
|
97
|
+
"ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
|
|
98
|
+
"ds:data-[active=true]:text-[var(--primary)]",
|
|
99
|
+
"ds:data-[active=true]:[box-shadow:inset_0_-2px_0_var(--primary)]"
|
|
100
|
+
].join(" ")
|
|
101
|
+
), is = [
|
|
102
|
+
"ds:group ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
103
|
+
"type-body-sm ds:font-medium",
|
|
104
|
+
// Mirror the navLinkVariants colour + inline padding so triggers and
|
|
105
|
+
// plain links share weight, colour and target size.
|
|
106
|
+
"ds:text-[var(--muted-foreground)]",
|
|
107
|
+
"ds:rounded-[var(--radius-sm)]",
|
|
108
|
+
"ds:bg-transparent ds:border-0 ds:cursor-pointer",
|
|
109
|
+
"ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:py-[var(--spacing-xs)]",
|
|
110
|
+
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
111
|
+
"ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
112
|
+
"ds:hover:text-[var(--primary)]",
|
|
113
|
+
"ds:data-[state=open]:text-[var(--primary)]",
|
|
114
|
+
"ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none"
|
|
115
|
+
].join(" "), ts = [
|
|
116
|
+
"ds:size-3 ds:shrink-0",
|
|
117
|
+
"ds:transition-transform ds:duration-[var(--animation-duration)]",
|
|
118
|
+
"ds:group-data-[state=open]:rotate-180",
|
|
119
|
+
"ds:motion-reduce:transition-none"
|
|
120
|
+
].join(" "), cs = C(
|
|
121
|
+
[
|
|
122
|
+
// Radix portals Content into the Viewport; sizing + position is
|
|
123
|
+
// governed by the Viewport — keep Content's own paint to padding
|
|
124
|
+
// + inner layout so motion / position stay consistent across
|
|
125
|
+
// trigger placements.
|
|
126
|
+
"ds:data-[motion=from-start]:animate-in ds:data-[motion=from-start]:fade-in-0",
|
|
127
|
+
"ds:data-[motion=from-end]:animate-in ds:data-[motion=from-end]:fade-in-0",
|
|
128
|
+
"ds:data-[motion=to-start]:animate-out ds:data-[motion=to-start]:fade-out-0",
|
|
129
|
+
"ds:data-[motion=to-end]:animate-out ds:data-[motion=to-end]:fade-out-0",
|
|
130
|
+
"ds:motion-reduce:animate-none"
|
|
131
|
+
].join(" "),
|
|
132
|
+
{
|
|
133
|
+
variants: {
|
|
134
|
+
wide: {
|
|
135
|
+
true: [
|
|
136
|
+
"ds:grid ds:grid-cols-2 ds:lg:grid-cols-4",
|
|
137
|
+
"ds:gap-[var(--spacing-lg)]",
|
|
138
|
+
"ds:p-[var(--spacing-lg)]",
|
|
139
|
+
"ds:w-screen ds:max-w-[1400px]"
|
|
140
|
+
].join(" "),
|
|
141
|
+
false: ["ds:p-[var(--spacing-md)]", "ds:min-w-[280px]"].join(" ")
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
defaultVariants: { wide: !1 }
|
|
145
|
+
}
|
|
146
|
+
), ls = [
|
|
147
|
+
// Position the Viewport flush below the pill / nav row. Radix sets
|
|
148
|
+
// `--radix-navigation-menu-viewport-width` and `…-height` so the
|
|
149
|
+
// panel sizes itself to whichever Content is currently active.
|
|
150
|
+
"ds:absolute ds:top-full ds:start-1/2 ds:-translate-x-1/2",
|
|
151
|
+
"ds:mt-[var(--spacing-sm)]",
|
|
152
|
+
"ds:w-[var(--radix-navigation-menu-viewport-width)]",
|
|
153
|
+
"ds:h-[var(--radix-navigation-menu-viewport-height)]",
|
|
154
|
+
"ds:overflow-hidden",
|
|
155
|
+
"ds:bg-[var(--card)] ds:text-[var(--foreground)]",
|
|
156
|
+
"ds:rounded-[var(--radius-lg)] ds:border ds:border-[color:var(--border)]",
|
|
157
|
+
"ds:shadow-[var(--shadow-lg)]",
|
|
158
|
+
"ds:data-[state=open]:animate-in ds:data-[state=closed]:animate-out",
|
|
159
|
+
"ds:data-[state=open]:fade-in-0 ds:data-[state=closed]:fade-out-0",
|
|
160
|
+
"ds:data-[state=open]:zoom-in-95 ds:data-[state=closed]:zoom-out-95",
|
|
161
|
+
"ds:origin-top ds:transition-[width,height] ds:duration-[var(--animation-duration)]",
|
|
162
|
+
"ds:motion-reduce:animate-none ds:motion-reduce:transition-none"
|
|
163
|
+
].join(" "), z = [
|
|
164
|
+
"ds:flex ds:items-start ds:justify-between ds:gap-[var(--spacing-sm)]",
|
|
165
|
+
"ds:no-underline ds:text-[var(--foreground)]",
|
|
166
|
+
"ds:pb-[var(--spacing-sm)]",
|
|
167
|
+
// alfadocs.com renders the card header flush against the sub-list with
|
|
168
|
+
// no separator rule — match that by dropping the border-b that earlier
|
|
169
|
+
// versions of this component carried.
|
|
170
|
+
"ds:rounded-[var(--radius-sm)]",
|
|
171
|
+
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
172
|
+
"ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
173
|
+
"ds:hover:[&_[data-card-title]]:text-[var(--primary)]",
|
|
174
|
+
"ds:hover:[&_[data-card-arrow]]:text-[var(--primary)]",
|
|
175
|
+
"ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
|
|
176
|
+
"ds:group/cardlink"
|
|
177
|
+
].join(" "), us = [
|
|
178
|
+
"ds:pb-[var(--spacing-sm)]"
|
|
179
|
+
// Match the linked-card variant: no separator rule under the title.
|
|
180
|
+
].join(" "), ms = [
|
|
181
|
+
"ds:block ds:no-underline",
|
|
182
|
+
"type-body-sm ds:font-medium ds:text-[var(--muted-foreground)]",
|
|
183
|
+
"ds:rounded-[var(--radius-sm)]",
|
|
184
|
+
"ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:py-[var(--spacing-xs)]",
|
|
185
|
+
"ds:hover:bg-[var(--muted)]/30 ds:hover:text-[var(--primary)]",
|
|
186
|
+
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
187
|
+
"ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
188
|
+
"ds:data-[active=true]:text-[var(--primary)]",
|
|
189
|
+
"ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none"
|
|
190
|
+
].join(" ");
|
|
191
|
+
function ps() {
|
|
192
|
+
const [e, n] = y(() => typeof window > "u" || !window.matchMedia ? !1 : window.matchMedia("(prefers-reduced-motion: reduce)").matches);
|
|
193
|
+
return B(() => {
|
|
194
|
+
if (typeof window > "u" || !window.matchMedia) return;
|
|
195
|
+
const d = window.matchMedia("(prefers-reduced-motion: reduce)"), a = () => n(d.matches);
|
|
196
|
+
return d.addEventListener("change", a), () => d.removeEventListener("change", a);
|
|
197
|
+
}, []), e;
|
|
198
|
+
}
|
|
199
|
+
function vs(e, n, d) {
|
|
200
|
+
const [a, i] = y(!1), [r, o] = y(!1), c = D(0), p = D(!1);
|
|
201
|
+
return B(() => {
|
|
202
|
+
if (!e || typeof window > "u") return;
|
|
203
|
+
c.current = window.scrollY;
|
|
204
|
+
const l = () => {
|
|
205
|
+
const v = window.scrollY;
|
|
206
|
+
if (i(v > d), n === "scroll-up") {
|
|
207
|
+
const b = v - c.current;
|
|
208
|
+
b > 4 && v > d ? o(!0) : (b < -4 || v <= d) && o(!1);
|
|
209
|
+
}
|
|
210
|
+
c.current = v, p.current = !1;
|
|
211
|
+
}, u = () => {
|
|
212
|
+
p.current || (p.current = !0, window.requestAnimationFrame(l));
|
|
213
|
+
};
|
|
214
|
+
return window.addEventListener("scroll", u, { passive: !0 }), l(), () => {
|
|
215
|
+
window.removeEventListener("scroll", u);
|
|
216
|
+
};
|
|
217
|
+
}, [e, n, d]), { stuck: a, hidden: r };
|
|
218
|
+
}
|
|
219
|
+
function R({
|
|
220
|
+
logo: e,
|
|
221
|
+
homeHref: n,
|
|
222
|
+
resolvedHomeLabel: d,
|
|
223
|
+
resolvedNavLabel: a,
|
|
224
|
+
resolvedMenuLabel: i,
|
|
225
|
+
navSlot: r,
|
|
226
|
+
actionsSlot: o,
|
|
227
|
+
menuOpen: c,
|
|
228
|
+
setMenuOpen: p,
|
|
229
|
+
sheetId: l
|
|
230
|
+
}) {
|
|
231
|
+
return /* @__PURE__ */ t(_, { children: [
|
|
232
|
+
/* @__PURE__ */ s(
|
|
233
|
+
"a",
|
|
234
|
+
{
|
|
235
|
+
href: n,
|
|
236
|
+
"aria-label": d,
|
|
237
|
+
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)]",
|
|
238
|
+
children: e
|
|
239
|
+
}
|
|
240
|
+
),
|
|
241
|
+
r ? /* @__PURE__ */ s(g.Provider, { value: "desktop", children: /* @__PURE__ */ t(
|
|
242
|
+
m.Root,
|
|
243
|
+
{
|
|
244
|
+
"aria-label": a,
|
|
245
|
+
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",
|
|
246
|
+
delayDuration: 150,
|
|
247
|
+
children: [
|
|
248
|
+
/* @__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: r }),
|
|
249
|
+
/* @__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 }) }) })
|
|
250
|
+
]
|
|
251
|
+
}
|
|
252
|
+
) }) : null,
|
|
253
|
+
o ? /* @__PURE__ */ s("div", { className: "ds:hidden ds:md:flex ds:items-center ds:gap-[var(--spacing-sm)] ds:ms-auto", children: o }) : null,
|
|
254
|
+
/* @__PURE__ */ t(f, { open: c, onOpenChange: p, children: [
|
|
255
|
+
/* @__PURE__ */ s(f.Trigger, { asChild: !0, children: /* @__PURE__ */ s(
|
|
256
|
+
es,
|
|
257
|
+
{
|
|
258
|
+
size: "md",
|
|
259
|
+
intent: "ghost",
|
|
260
|
+
className: "ds:ms-auto ds:md:hidden",
|
|
261
|
+
icon: c ? /* @__PURE__ */ s(ds, { "aria-hidden": "true" }) : /* @__PURE__ */ s(as, { "aria-hidden": "true" }),
|
|
262
|
+
"aria-controls": l,
|
|
263
|
+
"aria-expanded": c,
|
|
264
|
+
"aria-label": i
|
|
265
|
+
}
|
|
266
|
+
) }),
|
|
267
|
+
/* @__PURE__ */ t(f.Content, { side: "end", size: "md", id: l, children: [
|
|
268
|
+
/* @__PURE__ */ s(f.Header, { children: /* @__PURE__ */ s(f.Title, { children: a }) }),
|
|
269
|
+
/* @__PURE__ */ s(f.Body, { children: /* @__PURE__ */ t("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
270
|
+
r ? /* @__PURE__ */ s(g.Provider, { value: "mobile", children: /* @__PURE__ */ s(
|
|
271
|
+
"nav",
|
|
272
|
+
{
|
|
273
|
+
"aria-label": a,
|
|
274
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
|
|
275
|
+
"data-mobile-nav": "true",
|
|
276
|
+
children: r
|
|
277
|
+
}
|
|
278
|
+
) }) : null,
|
|
279
|
+
o ? /* @__PURE__ */ s("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:mt-[var(--spacing-md)]", children: o }) : null
|
|
280
|
+
] }) })
|
|
281
|
+
] })
|
|
282
|
+
] })
|
|
283
|
+
] });
|
|
284
|
+
}
|
|
285
|
+
const E = h(
|
|
286
|
+
({
|
|
287
|
+
logo: e,
|
|
288
|
+
homeHref: n = "/",
|
|
289
|
+
homeLabel: d,
|
|
290
|
+
navSlot: a,
|
|
291
|
+
actionsSlot: i,
|
|
292
|
+
variant: r = "pill",
|
|
293
|
+
sticky: o = "none",
|
|
294
|
+
stickyOffset: c = 80,
|
|
295
|
+
menuLabel: p,
|
|
296
|
+
navLabel: l,
|
|
297
|
+
id: u,
|
|
298
|
+
className: v,
|
|
299
|
+
...b
|
|
300
|
+
}, A) => {
|
|
301
|
+
const { t: x } = ss(), j = ps(), Y = Q(), q = `${u ?? Y}-sheet`, [w, k] = y(!1), F = r === "transparent" || o === "scroll-up", { stuck: W, hidden: X } = vs(
|
|
302
|
+
F,
|
|
303
|
+
o,
|
|
304
|
+
c
|
|
305
|
+
), $ = j ? !1 : X, H = M(() => k(!0), []), L = M(() => k(!1), []);
|
|
306
|
+
U(
|
|
307
|
+
A,
|
|
308
|
+
() => ({
|
|
309
|
+
openMenu: H,
|
|
310
|
+
closeMenu: L,
|
|
311
|
+
getMenuOpen: () => w
|
|
312
|
+
}),
|
|
313
|
+
[H, L, w]
|
|
314
|
+
);
|
|
315
|
+
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 = {
|
|
316
|
+
logo: e,
|
|
317
|
+
homeHref: n,
|
|
318
|
+
resolvedHomeLabel: G,
|
|
319
|
+
resolvedNavLabel: J,
|
|
320
|
+
resolvedMenuLabel: K,
|
|
321
|
+
navSlot: a,
|
|
322
|
+
actionsSlot: i,
|
|
323
|
+
menuOpen: w,
|
|
324
|
+
setMenuOpen: k,
|
|
325
|
+
sheetId: q
|
|
326
|
+
};
|
|
327
|
+
return /* @__PURE__ */ s(
|
|
328
|
+
"header",
|
|
329
|
+
{
|
|
330
|
+
...b,
|
|
331
|
+
"data-component": "public-header",
|
|
332
|
+
"data-component-id": u,
|
|
333
|
+
"data-variant": r,
|
|
334
|
+
"data-stuck": W ? "true" : void 0,
|
|
335
|
+
"data-hidden": $ ? "true" : void 0,
|
|
336
|
+
"data-state": j ? "reduced-motion" : void 0,
|
|
337
|
+
className: ns({ variant: r, sticky: o, className: v }),
|
|
338
|
+
children: r === "pill" ? /* @__PURE__ */ s(
|
|
339
|
+
"div",
|
|
340
|
+
{
|
|
341
|
+
"data-component": "public-header-container",
|
|
342
|
+
className: rs,
|
|
343
|
+
children: /* @__PURE__ */ s(R, { ...P })
|
|
344
|
+
}
|
|
345
|
+
) : /* @__PURE__ */ s(R, { ...P })
|
|
346
|
+
}
|
|
347
|
+
);
|
|
348
|
+
}
|
|
349
|
+
);
|
|
350
|
+
E.displayName = "PublicHeader";
|
|
351
|
+
const T = h(({ active: e, className: n, children: d, ...a }, i) => N(g) === "mobile" ? /* @__PURE__ */ s(
|
|
352
|
+
"a",
|
|
353
|
+
{
|
|
354
|
+
ref: i,
|
|
355
|
+
...a,
|
|
356
|
+
"data-active": e ? "true" : void 0,
|
|
357
|
+
"aria-current": e ? "page" : void 0,
|
|
358
|
+
className: [
|
|
359
|
+
"ds:block ds:no-underline",
|
|
360
|
+
"type-body-sm ds:font-medium",
|
|
361
|
+
"ds:text-[var(--foreground)]",
|
|
362
|
+
"ds:rounded-[var(--radius-sm)]",
|
|
363
|
+
"ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:py-[var(--spacing-sm)]",
|
|
364
|
+
"ds:hover:bg-[var(--muted)]/30 ds:hover:text-[var(--primary)]",
|
|
365
|
+
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
366
|
+
"ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
367
|
+
"ds:data-[active=true]:text-[var(--primary)]",
|
|
368
|
+
"ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
|
|
369
|
+
n
|
|
370
|
+
].filter(Boolean).join(" "),
|
|
371
|
+
children: d
|
|
372
|
+
}
|
|
373
|
+
) : /* @__PURE__ */ s(m.Item, { children: /* @__PURE__ */ s(m.Link, { asChild: !0, active: e, children: /* @__PURE__ */ s(
|
|
374
|
+
"a",
|
|
375
|
+
{
|
|
376
|
+
ref: i,
|
|
377
|
+
...a,
|
|
378
|
+
"data-active": e ? "true" : void 0,
|
|
379
|
+
"aria-current": e ? "page" : void 0,
|
|
380
|
+
className: [os(), n].filter(Boolean).join(" "),
|
|
381
|
+
children: d
|
|
382
|
+
}
|
|
383
|
+
) }) }));
|
|
384
|
+
T.displayName = "PublicHeader.NavLink";
|
|
385
|
+
const V = h(({ label: e, wide: n = !1, children: d, id: a }, i) => N(g) === "mobile" ? /* @__PURE__ */ t(
|
|
386
|
+
"details",
|
|
387
|
+
{
|
|
388
|
+
id: a,
|
|
389
|
+
"data-component": "public-header-nav-dropdown",
|
|
390
|
+
className: "ds:group ds:border-b ds:border-[color:var(--border)]",
|
|
391
|
+
children: [
|
|
392
|
+
/* @__PURE__ */ t(
|
|
393
|
+
"summary",
|
|
394
|
+
{
|
|
395
|
+
className: [
|
|
396
|
+
"ds:flex ds:items-center ds:justify-between ds:cursor-pointer",
|
|
397
|
+
"type-body-sm ds:font-medium ds:text-[var(--foreground)]",
|
|
398
|
+
"ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:py-[var(--spacing-sm)]",
|
|
399
|
+
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
400
|
+
"ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
401
|
+
"ds:list-none ds:[&::-webkit-details-marker]:hidden"
|
|
402
|
+
].join(" "),
|
|
403
|
+
children: [
|
|
404
|
+
/* @__PURE__ */ s("span", { children: e }),
|
|
405
|
+
/* @__PURE__ */ s(
|
|
406
|
+
I,
|
|
407
|
+
{
|
|
408
|
+
"aria-hidden": "true",
|
|
409
|
+
className: "ds:size-3 ds:shrink-0 ds:transition-transform ds:duration-[var(--animation-duration)] ds:group-[[open]]:rotate-180 ds:motion-reduce:transition-none"
|
|
410
|
+
}
|
|
411
|
+
)
|
|
412
|
+
]
|
|
413
|
+
}
|
|
414
|
+
),
|
|
415
|
+
/* @__PURE__ */ s("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:py-[var(--spacing-sm)]", children: d })
|
|
416
|
+
]
|
|
417
|
+
}
|
|
418
|
+
) : /* @__PURE__ */ t(m.Item, { "data-component": "public-header-nav-dropdown", children: [
|
|
419
|
+
/* @__PURE__ */ t(
|
|
420
|
+
m.Trigger,
|
|
421
|
+
{
|
|
422
|
+
ref: i,
|
|
423
|
+
id: a,
|
|
424
|
+
className: is,
|
|
425
|
+
children: [
|
|
426
|
+
e,
|
|
427
|
+
/* @__PURE__ */ s(I, { "aria-hidden": "true", className: ts })
|
|
428
|
+
]
|
|
429
|
+
}
|
|
430
|
+
),
|
|
431
|
+
/* @__PURE__ */ s(
|
|
432
|
+
m.Content,
|
|
433
|
+
{
|
|
434
|
+
className: cs({ wide: n }),
|
|
435
|
+
children: d
|
|
436
|
+
}
|
|
437
|
+
)
|
|
438
|
+
] }));
|
|
439
|
+
V.displayName = "PublicHeader.NavDropdown";
|
|
440
|
+
const O = h(({ href: e, title: n, subtitle: d, children: a }, i) => {
|
|
441
|
+
const r = N(g), o = /* @__PURE__ */ s(
|
|
442
|
+
"span",
|
|
443
|
+
{
|
|
444
|
+
"data-card-title": !0,
|
|
445
|
+
className: "type-title-card ds:text-[var(--foreground)] ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
|
|
446
|
+
children: n
|
|
447
|
+
}
|
|
448
|
+
), l = /* @__PURE__ */ t(_, { children: [
|
|
449
|
+
/* @__PURE__ */ t("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
450
|
+
o,
|
|
451
|
+
d ? /* @__PURE__ */ s("span", { className: "type-body-sm ds:text-[var(--muted-foreground)]", children: d }) : null
|
|
452
|
+
] }),
|
|
453
|
+
/* @__PURE__ */ s(
|
|
454
|
+
"span",
|
|
455
|
+
{
|
|
456
|
+
"data-card-arrow": !0,
|
|
457
|
+
"aria-hidden": "true",
|
|
458
|
+
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",
|
|
459
|
+
children: /* @__PURE__ */ t(
|
|
460
|
+
"svg",
|
|
461
|
+
{
|
|
462
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
463
|
+
width: "20",
|
|
464
|
+
height: "20",
|
|
465
|
+
viewBox: "0 0 24 24",
|
|
466
|
+
fill: "none",
|
|
467
|
+
stroke: "currentColor",
|
|
468
|
+
strokeWidth: "2",
|
|
469
|
+
strokeLinecap: "round",
|
|
470
|
+
strokeLinejoin: "round",
|
|
471
|
+
children: [
|
|
472
|
+
/* @__PURE__ */ s("path", { d: "M5 12h14" }),
|
|
473
|
+
/* @__PURE__ */ s("path", { d: "m12 5 7 7-7 7" })
|
|
474
|
+
]
|
|
475
|
+
}
|
|
476
|
+
)
|
|
477
|
+
}
|
|
478
|
+
)
|
|
479
|
+
] });
|
|
480
|
+
let u;
|
|
481
|
+
return e ? r === "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: [
|
|
482
|
+
o,
|
|
483
|
+
d ? /* @__PURE__ */ s("span", { className: "ds:block type-body-sm ds:text-[var(--muted-foreground)] ds:mt-[var(--spacing-xs)]", children: d }) : null
|
|
484
|
+
] }), /* @__PURE__ */ t(
|
|
485
|
+
"div",
|
|
486
|
+
{
|
|
487
|
+
ref: i,
|
|
488
|
+
"data-component": "public-header-dropdown-card",
|
|
489
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
490
|
+
children: [
|
|
491
|
+
u,
|
|
492
|
+
a ? /* @__PURE__ */ s("ul", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:list-none ds:m-0 ds:ps-0", children: a }) : null
|
|
493
|
+
]
|
|
494
|
+
}
|
|
495
|
+
);
|
|
496
|
+
});
|
|
497
|
+
O.displayName = "PublicHeader.DropdownCard";
|
|
498
|
+
const S = h(({ active: e, className: n, children: d, ...a }, i) => {
|
|
499
|
+
const r = N(g), o = /* @__PURE__ */ s(
|
|
500
|
+
"a",
|
|
501
|
+
{
|
|
502
|
+
ref: i,
|
|
503
|
+
...a,
|
|
504
|
+
"data-active": e ? "true" : void 0,
|
|
505
|
+
"aria-current": e ? "page" : void 0,
|
|
506
|
+
className: [ms, n].filter(Boolean).join(" "),
|
|
507
|
+
children: d
|
|
508
|
+
}
|
|
509
|
+
);
|
|
510
|
+
return /* @__PURE__ */ s("li", { "data-component": "public-header-dropdown-link", children: r === "mobile" ? o : /* @__PURE__ */ s(m.Link, { asChild: !0, active: e, children: o }) });
|
|
511
|
+
});
|
|
512
|
+
S.displayName = "PublicHeader.DropdownLink";
|
|
513
|
+
const Cs = Object.assign(E, {
|
|
514
|
+
NavLink: T,
|
|
515
|
+
NavDropdown: V,
|
|
516
|
+
DropdownCard: O,
|
|
517
|
+
DropdownLink: S
|
|
518
|
+
}), js = {
|
|
519
|
+
id: "public-header",
|
|
520
|
+
capabilities: ["open", "close"],
|
|
521
|
+
state: {
|
|
522
|
+
menuOpen: {
|
|
523
|
+
type: "boolean",
|
|
524
|
+
description: "Whether the mobile drawer is currently open.",
|
|
525
|
+
read: (e) => e.getMenuOpen()
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
actions: {
|
|
529
|
+
open_menu: {
|
|
530
|
+
safety: "read",
|
|
531
|
+
description: "Open the mobile drawer.",
|
|
532
|
+
invoke: (e) => {
|
|
533
|
+
e.openMenu();
|
|
534
|
+
}
|
|
535
|
+
},
|
|
536
|
+
close_menu: {
|
|
537
|
+
safety: "read",
|
|
538
|
+
description: "Close the mobile drawer.",
|
|
539
|
+
invoke: (e) => {
|
|
540
|
+
e.closeMenu();
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
},
|
|
544
|
+
domHooks: {
|
|
545
|
+
root: { attr: "data-component", value: "public-header" },
|
|
546
|
+
instanceId: {
|
|
547
|
+
attr: "data-component-id",
|
|
548
|
+
sourceProp: "id",
|
|
549
|
+
description: "Sourced from the id prop on PublicHeader."
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
};
|
|
553
|
+
export {
|
|
554
|
+
Cs as P,
|
|
555
|
+
js as p
|
|
556
|
+
};
|
|
557
|
+
//# sourceMappingURL=public-header.agent-BIBQzkeV.js.map
|
package/dist/agent-catalog.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"packageVersion": "0.
|
|
3
|
+
"packageVersion": "0.17.1",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
6
6
|
"kind": "component",
|
|
@@ -1038,6 +1038,42 @@
|
|
|
1038
1038
|
}
|
|
1039
1039
|
}
|
|
1040
1040
|
},
|
|
1041
|
+
{
|
|
1042
|
+
"kind": "component",
|
|
1043
|
+
"id": "copy-field",
|
|
1044
|
+
"capabilities": [],
|
|
1045
|
+
"state": [
|
|
1046
|
+
{
|
|
1047
|
+
"name": "value",
|
|
1048
|
+
"type": "string",
|
|
1049
|
+
"description": "The value displayed in the read-only field."
|
|
1050
|
+
},
|
|
1051
|
+
{
|
|
1052
|
+
"name": "copied",
|
|
1053
|
+
"type": "boolean",
|
|
1054
|
+
"description": "True for the brief window after a successful copy."
|
|
1055
|
+
}
|
|
1056
|
+
],
|
|
1057
|
+
"actions": [
|
|
1058
|
+
{
|
|
1059
|
+
"name": "copy",
|
|
1060
|
+
"safety": "write",
|
|
1061
|
+
"description": "Programmatically trigger the clipboard write."
|
|
1062
|
+
}
|
|
1063
|
+
],
|
|
1064
|
+
"domHooks": {
|
|
1065
|
+
"root": {
|
|
1066
|
+
"attr": "data-component",
|
|
1067
|
+
"value": "copy-field",
|
|
1068
|
+
"description": "Marks the CopyField root. The trailing button uses `aria-label` keyed off the copy / copied state."
|
|
1069
|
+
},
|
|
1070
|
+
"instanceId": {
|
|
1071
|
+
"attr": "data-component-id",
|
|
1072
|
+
"sourceProp": "id",
|
|
1073
|
+
"description": "Sourced from the id prop, when provided."
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
},
|
|
1041
1077
|
{
|
|
1042
1078
|
"kind": "component",
|
|
1043
1079
|
"id": "data-table",
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AgentAdapter } from '../../agent/types';
|
|
2
|
+
/**
|
|
3
|
+
* Imperative handle for CopyField — agents can read the value and trigger a
|
|
4
|
+
* programmatic copy. State stays scoped to identifiers + transient UI state;
|
|
5
|
+
* never PHI (per PRS §Security).
|
|
6
|
+
*/
|
|
7
|
+
export interface CopyFieldHandle {
|
|
8
|
+
/** Returns the read-only value currently displayed. */
|
|
9
|
+
getValue: () => string;
|
|
10
|
+
/** Triggers the clipboard write side-effect. */
|
|
11
|
+
copy: () => Promise<boolean>;
|
|
12
|
+
/** Returns true for the brief window after a successful copy. */
|
|
13
|
+
isCopied: () => boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const copyFieldAgent: AgentAdapter<CopyFieldHandle>;
|
|
16
|
+
//# sourceMappingURL=copy-field.agent.d.ts.map
|