@alfadocs/ui-kit 0.15.0 → 0.16.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/benefit-card-Czs0oXdi.js +161 -0
- package/dist/_chunks/{carousel.agent-2dXpQoqp.js → carousel.agent-OTn-kMQg.js} +432 -424
- package/dist/_chunks/{public-header.agent-AzJSINlU.js → public-header.agent-ZLBAQ30j.js} +21 -16
- package/dist/_chunks/{stat-DEkZx0Mx.js → stat-CYEx8sIR.js} +31 -32
- package/dist/agent-catalog.json +15 -1
- package/dist/components/benefit-card/benefit-card.d.ts +35 -0
- package/dist/components/benefit-card/index.d.ts +3 -0
- package/dist/components/benefit-card/index.js +5 -0
- package/dist/components/card/card.d.ts +1 -1
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/public-header/index.js +1 -1
- package/dist/components/stat/index.js +1 -1
- package/dist/components/stat/stat.d.ts +1 -1
- package/dist/index.js +371 -369
- package/dist/tokens.css +1 -1
- package/package.json +5 -1
|
@@ -28,7 +28,12 @@ const X = C(
|
|
|
28
28
|
"ds:data-[stuck=true]:shadow-[var(--shadow-md)]",
|
|
29
29
|
"ds:forced-colors:border-b ds:forced-colors:border-[CanvasText]"
|
|
30
30
|
].join(" "),
|
|
31
|
-
dark
|
|
31
|
+
// `dark` flips its own scope into the dark token set so nav
|
|
32
|
+
// links + buttons inside read off-white text on the blue-800
|
|
33
|
+
// surface. Without the `theme-dark` scope the children inherit
|
|
34
|
+
// the light-theme `--foreground` (blue-500) and fail
|
|
35
|
+
// color-contrast at ~1.3:1.
|
|
36
|
+
dark: "theme-dark ds:bg-[var(--color-blue-800)] ds:text-[var(--foreground)]"
|
|
32
37
|
},
|
|
33
38
|
sticky: {
|
|
34
39
|
none: "",
|
|
@@ -68,7 +73,7 @@ function G() {
|
|
|
68
73
|
}, []), e;
|
|
69
74
|
}
|
|
70
75
|
function J(e, d, r) {
|
|
71
|
-
const [n, a] = b(!1), [
|
|
76
|
+
const [n, a] = b(!1), [p, o] = b(!1), l = L(0), u = L(!1);
|
|
72
77
|
return j(() => {
|
|
73
78
|
if (!e || typeof window > "u") return;
|
|
74
79
|
l.current = window.scrollY;
|
|
@@ -79,13 +84,13 @@ function J(e, d, r) {
|
|
|
79
84
|
v > 4 && t > r ? o(!0) : (v < -4 || t <= r) && o(!1);
|
|
80
85
|
}
|
|
81
86
|
l.current = t, u.current = !1;
|
|
82
|
-
},
|
|
87
|
+
}, m = () => {
|
|
83
88
|
u.current || (u.current = !0, window.requestAnimationFrame(f));
|
|
84
89
|
};
|
|
85
|
-
return window.addEventListener("scroll",
|
|
86
|
-
window.removeEventListener("scroll",
|
|
90
|
+
return window.addEventListener("scroll", m, { passive: !0 }), f(), () => {
|
|
91
|
+
window.removeEventListener("scroll", m);
|
|
87
92
|
};
|
|
88
|
-
}, [e, d, r]), { stuck: n, hidden:
|
|
93
|
+
}, [e, d, r]), { stuck: n, hidden: p };
|
|
89
94
|
}
|
|
90
95
|
const I = P(
|
|
91
96
|
({
|
|
@@ -94,28 +99,28 @@ const I = P(
|
|
|
94
99
|
homeLabel: r,
|
|
95
100
|
navSlot: n,
|
|
96
101
|
actionsSlot: a,
|
|
97
|
-
variant:
|
|
102
|
+
variant: p = "default",
|
|
98
103
|
sticky: o = "none",
|
|
99
104
|
stickyOffset: l = 80,
|
|
100
105
|
menuLabel: u,
|
|
101
106
|
navLabel: f,
|
|
102
|
-
id:
|
|
107
|
+
id: m,
|
|
103
108
|
className: t,
|
|
104
109
|
...v
|
|
105
110
|
}, E) => {
|
|
106
|
-
const { t: h } = S(), y = G(), O = Y(), H = `${
|
|
111
|
+
const { t: h } = S(), y = G(), O = Y(), H = `${m ?? O}-sheet`, [i, w] = b(!1), _ = p === "transparent" || o === "scroll-up", { stuck: z, hidden: T } = J(
|
|
107
112
|
_,
|
|
108
113
|
o,
|
|
109
114
|
l
|
|
110
|
-
), A = y ? !1 : T,
|
|
115
|
+
), A = y ? !1 : T, k = N(() => w(!0), []), M = N(() => w(!1), []);
|
|
111
116
|
q(
|
|
112
117
|
E,
|
|
113
118
|
() => ({
|
|
114
|
-
openMenu:
|
|
115
|
-
closeMenu:
|
|
119
|
+
openMenu: k,
|
|
120
|
+
closeMenu: M,
|
|
116
121
|
getMenuOpen: () => i
|
|
117
122
|
}),
|
|
118
|
-
[
|
|
123
|
+
[k, M, i]
|
|
119
124
|
);
|
|
120
125
|
const B = r ?? h("publicHeader.homeLabel", "AlfaDocs — home"), x = f ?? h("publicHeader.primaryNavLabel", "Primary"), V = u ?? (i ? h("publicHeader.closeMenu", "Close menu") : h("publicHeader.openMenu", "Open menu"));
|
|
121
126
|
return /* @__PURE__ */ g(
|
|
@@ -123,11 +128,11 @@ const I = P(
|
|
|
123
128
|
{
|
|
124
129
|
...v,
|
|
125
130
|
"data-component": "public-header",
|
|
126
|
-
"data-component-id":
|
|
131
|
+
"data-component-id": m,
|
|
127
132
|
"data-stuck": z ? "true" : void 0,
|
|
128
133
|
"data-hidden": A ? "true" : void 0,
|
|
129
134
|
"data-state": y ? "reduced-motion" : void 0,
|
|
130
|
-
className: X({ variant:
|
|
135
|
+
className: X({ variant: p, sticky: o, className: t }),
|
|
131
136
|
children: [
|
|
132
137
|
/* @__PURE__ */ s(
|
|
133
138
|
"a",
|
|
@@ -234,4 +239,4 @@ export {
|
|
|
234
239
|
de as P,
|
|
235
240
|
ae as p
|
|
236
241
|
};
|
|
237
|
-
//# sourceMappingURL=public-header.agent-
|
|
242
|
+
//# sourceMappingURL=public-header.agent-ZLBAQ30j.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as z, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as Q, useId as X, useCallback as L, useRef as Z, useMemo as tt } from "react";
|
|
3
|
-
import { c as
|
|
3
|
+
import { c as V } from "./index-D2ZczOXr.js";
|
|
4
4
|
import { useTranslation as U } from "react-i18next";
|
|
5
5
|
import { u as et } from "./use-count-up-BLLetaZ8.js";
|
|
6
|
-
const O =
|
|
6
|
+
const O = V("ds:flex ds:flex-col", {
|
|
7
7
|
variants: {
|
|
8
8
|
variant: {
|
|
9
9
|
default: "ds:gap-[var(--spacing-xs)]",
|
|
@@ -48,7 +48,7 @@ const O = S("ds:flex ds:flex-col", {
|
|
|
48
48
|
size: "md",
|
|
49
49
|
align: "start"
|
|
50
50
|
}
|
|
51
|
-
}), P =
|
|
51
|
+
}), P = V("type-metric ds:text-[var(--foreground)]", {
|
|
52
52
|
variants: {
|
|
53
53
|
size: {
|
|
54
54
|
sm: "ds:[--type-metric-size:var(--font-size-xl)]",
|
|
@@ -83,7 +83,7 @@ const O = S("ds:flex ds:flex-col", {
|
|
|
83
83
|
size: "md",
|
|
84
84
|
variant: "default"
|
|
85
85
|
}
|
|
86
|
-
}), st =
|
|
86
|
+
}), st = V(
|
|
87
87
|
"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)] type-label",
|
|
88
88
|
{
|
|
89
89
|
variants: {
|
|
@@ -127,21 +127,21 @@ function it(d, t) {
|
|
|
127
127
|
l && (o = l[0], e = e.slice(0, -1).trimEnd());
|
|
128
128
|
let m = "", u = ".";
|
|
129
129
|
try {
|
|
130
|
-
const
|
|
131
|
-
for (const n of
|
|
130
|
+
const b = new Intl.NumberFormat(t).formatToParts(12345.6);
|
|
131
|
+
for (const n of b)
|
|
132
132
|
n.type === "group" ? m = n.value : n.type === "decimal" && (u = n.value);
|
|
133
133
|
} catch {
|
|
134
134
|
}
|
|
135
|
-
const
|
|
136
|
-
if (
|
|
135
|
+
const g = e.match(/^(\d+)\.(\d+)$/);
|
|
136
|
+
if (g && !(g[2].length === 3 && m === ".")) {
|
|
137
137
|
const n = Number.parseFloat(e);
|
|
138
138
|
if (Number.isFinite(n))
|
|
139
139
|
return { target: n, sign: a, suffix: o };
|
|
140
140
|
}
|
|
141
141
|
let s = e;
|
|
142
142
|
m !== "" && (s = s.split(m).join("")), u !== "." && (s = s.split(u).join(".")), s = s.replace(/[\s\u00A0\u202F]/g, "");
|
|
143
|
-
const
|
|
144
|
-
return Number.isFinite(
|
|
143
|
+
const v = Number.parseFloat(s);
|
|
144
|
+
return Number.isFinite(v) ? { target: v, sign: a, suffix: o } : null;
|
|
145
145
|
}
|
|
146
146
|
const dt = Q(
|
|
147
147
|
({
|
|
@@ -154,12 +154,12 @@ const dt = Q(
|
|
|
154
154
|
delta: l,
|
|
155
155
|
deltaFormat: m = "decimal",
|
|
156
156
|
icon: u,
|
|
157
|
-
loading:
|
|
157
|
+
loading: g = !1,
|
|
158
158
|
animate: s = !1,
|
|
159
|
-
animateOnEveryView:
|
|
160
|
-
animateDurationMs:
|
|
159
|
+
animateOnEveryView: v = !1,
|
|
160
|
+
animateDurationMs: b = 1600,
|
|
161
161
|
animateLocale: n,
|
|
162
|
-
animateSeparators:
|
|
162
|
+
animateSeparators: h,
|
|
163
163
|
variant: x = "default",
|
|
164
164
|
size: y = "md",
|
|
165
165
|
align: I = "start",
|
|
@@ -191,46 +191,45 @@ const dt = Q(
|
|
|
191
191
|
(w) => {
|
|
192
192
|
const C = (() => {
|
|
193
193
|
try {
|
|
194
|
-
return new Intl.NumberFormat(
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
);
|
|
194
|
+
return new Intl.NumberFormat(N, {
|
|
195
|
+
useGrouping: !0
|
|
196
|
+
});
|
|
198
197
|
} catch {
|
|
199
198
|
return null;
|
|
200
199
|
}
|
|
201
200
|
})();
|
|
202
|
-
let
|
|
201
|
+
let p;
|
|
203
202
|
if (C)
|
|
204
|
-
if (
|
|
205
|
-
const W = Math.abs(w), A = Math.trunc(W), D = W - A, H =
|
|
203
|
+
if (h) {
|
|
204
|
+
const W = Math.abs(w), A = Math.trunc(W), D = W - A, H = h.thousand ?? "", S = String(A).replace(
|
|
206
205
|
/\B(?=(\d{3})+(?!\d))/g,
|
|
207
206
|
H
|
|
208
207
|
);
|
|
209
208
|
if (D === 0)
|
|
210
|
-
|
|
209
|
+
p = S;
|
|
211
210
|
else {
|
|
212
|
-
const G = D.toFixed(6).replace(/0+$/, "").slice(2), J =
|
|
213
|
-
|
|
211
|
+
const G = D.toFixed(6).replace(/0+$/, "").slice(2), J = h.decimal ?? ".";
|
|
212
|
+
p = G ? S + J + G : S;
|
|
214
213
|
}
|
|
215
214
|
} else
|
|
216
|
-
|
|
215
|
+
p = C.format(Math.abs(w));
|
|
217
216
|
else
|
|
218
|
-
|
|
217
|
+
p = String(Math.abs(w));
|
|
219
218
|
let E = F;
|
|
220
|
-
return F === "" && w < 0 && (E = "-"), `${E}${
|
|
219
|
+
return F === "" && w < 0 && (E = "-"), `${E}${p}${T}`;
|
|
221
220
|
},
|
|
222
|
-
[N,
|
|
221
|
+
[N, h, F, T]
|
|
223
222
|
), $ = et({
|
|
224
223
|
to: _,
|
|
225
224
|
from: 0,
|
|
226
|
-
durationMs:
|
|
225
|
+
durationMs: b,
|
|
227
226
|
startOnVisible: !0,
|
|
228
|
-
retriggerOnReEntry:
|
|
227
|
+
retriggerOnReEntry: v,
|
|
229
228
|
// `formatter` is the only path we use — it owns both the locale
|
|
230
229
|
// formatting and the sign/suffix re-application.
|
|
231
230
|
formatter: q
|
|
232
231
|
});
|
|
233
|
-
return
|
|
232
|
+
return g ? /* @__PURE__ */ z(
|
|
234
233
|
"div",
|
|
235
234
|
{
|
|
236
235
|
ref: k,
|
|
@@ -315,4 +314,4 @@ dt.displayName = "Stat";
|
|
|
315
314
|
export {
|
|
316
315
|
dt as S
|
|
317
316
|
};
|
|
318
|
-
//# sourceMappingURL=stat-
|
|
317
|
+
//# sourceMappingURL=stat-CYEx8sIR.js.map
|
package/dist/agent-catalog.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"packageVersion": "0.
|
|
3
|
+
"packageVersion": "0.16.0",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
6
6
|
"kind": "component",
|
|
@@ -387,6 +387,20 @@
|
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
389
|
},
|
|
390
|
+
{
|
|
391
|
+
"kind": "component",
|
|
392
|
+
"id": "benefit-card",
|
|
393
|
+
"capabilities": [],
|
|
394
|
+
"state": [],
|
|
395
|
+
"actions": [],
|
|
396
|
+
"domHooks": {
|
|
397
|
+
"root": {
|
|
398
|
+
"attr": "data-component",
|
|
399
|
+
"value": "benefit-card",
|
|
400
|
+
"description": "Marks the BenefitCard root. Presentational — no agent-driven state."
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
},
|
|
390
404
|
{
|
|
391
405
|
"kind": "component",
|
|
392
406
|
"id": "breadcrumb",
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
declare const ACCENT_WHEEL: readonly ["violet", "purple", "magenta", "blue", "green", "red"];
|
|
3
|
+
type WheelAccent = (typeof ACCENT_WHEEL)[number];
|
|
4
|
+
type SemanticAccent = 'primary' | 'accent' | 'info' | 'success' | 'warning';
|
|
5
|
+
type AccentProp = SemanticAccent | WheelAccent | 'auto';
|
|
6
|
+
export interface BenefitCardProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
|
|
7
|
+
/** Step number; rendered as a zero-padded chip ("01", "02", …). Omit to hide. */
|
|
8
|
+
step?: number;
|
|
9
|
+
/** Icon node — usually an `<svg>` 24-32px. Rendered inside a tinted square chip. */
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
/** Card heading. Always rendered inside an `<h3>` — pass only inline / phrasing content. */
|
|
12
|
+
title: ReactNode;
|
|
13
|
+
/** Optional CTA — usually a `<Button intent="link">` or kit `<Link>`. Rendered at the block-end. */
|
|
14
|
+
cta?: ReactNode;
|
|
15
|
+
/** Surface treatment. */
|
|
16
|
+
variant?: 'elevated' | 'outlined';
|
|
17
|
+
/**
|
|
18
|
+
* Accent colour. `auto` (default inside a `<BenefitCard.Row>`) rotates through the brand
|
|
19
|
+
* palette by row index: violet → purple → magenta → blue → green → red, then wraps.
|
|
20
|
+
* Outside a Row, `auto` falls back to `primary`.
|
|
21
|
+
*/
|
|
22
|
+
accent?: AccentProp;
|
|
23
|
+
/** Body content (description / list / inline copy). */
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
export interface BenefitCardRowProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
27
|
+
/** Number of columns at md+; defaults to 3. Collapses to 1 at < md. */
|
|
28
|
+
columns?: 1 | 2 | 3 | 4;
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
}
|
|
31
|
+
export declare const BenefitCard: import("react").ForwardRefExoticComponent<BenefitCardProps & import("react").RefAttributes<HTMLElement>> & {
|
|
32
|
+
Row: import("react").ForwardRefExoticComponent<BenefitCardRowProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=benefit-card.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const cardVariants: (props?: ({
|
|
4
|
-
variant?: "default" | "
|
|
4
|
+
variant?: "default" | "elevated" | "outlined" | null | undefined;
|
|
5
5
|
interactive?: boolean | null | undefined;
|
|
6
6
|
stretch?: boolean | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const statVariants: (props?: ({
|
|
4
|
-
variant?: "default" | "compact" | "
|
|
4
|
+
variant?: "default" | "compact" | "elevated" | "outlined" | null | undefined;
|
|
5
5
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
6
6
|
align?: "center" | "end" | "start" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|