@alfadocs/ui-kit 0.15.1 → 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/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/index.d.ts +1 -0
- 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
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { jsx as r, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as u, useContext as k, Children as y, createContext as w } from "react";
|
|
3
|
+
import { c as l } from "./index-D2ZczOXr.js";
|
|
4
|
+
const b = [
|
|
5
|
+
"violet",
|
|
6
|
+
"purple",
|
|
7
|
+
"magenta",
|
|
8
|
+
"blue",
|
|
9
|
+
"green",
|
|
10
|
+
"red"
|
|
11
|
+
], m = w(null), C = l("ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-lg)]", {
|
|
12
|
+
variants: {
|
|
13
|
+
columns: {
|
|
14
|
+
1: "ds:md:grid-cols-1",
|
|
15
|
+
2: "ds:md:grid-cols-2",
|
|
16
|
+
3: "ds:md:grid-cols-3",
|
|
17
|
+
4: "ds:md:grid-cols-4"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: { columns: 3 }
|
|
21
|
+
}), N = l(
|
|
22
|
+
[
|
|
23
|
+
"ds:relative ds:rounded-[var(--radius-lg)] ds:overflow-hidden",
|
|
24
|
+
"ds:flex ds:flex-col ds:h-full",
|
|
25
|
+
"ds:bg-[var(--card)] ds:text-[var(--card-foreground)]",
|
|
26
|
+
// Hover lift — the transform is gated through `motion-safe:` so users
|
|
27
|
+
// with `prefers-reduced-motion: reduce` see only the shadow change.
|
|
28
|
+
// `--animation-duration` is pinned to 0ms in the accessible theme,
|
|
29
|
+
// which collapses the transition without dropping the rule entirely.
|
|
30
|
+
"ds:transition-[transform,box-shadow] ds:duration-[var(--animation-duration)]",
|
|
31
|
+
"ds:motion-reduce:transition-none",
|
|
32
|
+
"ds:hover:shadow-[var(--shadow-hover)]",
|
|
33
|
+
"ds:motion-safe:hover:-translate-y-0.5"
|
|
34
|
+
].join(" "),
|
|
35
|
+
{
|
|
36
|
+
variants: {
|
|
37
|
+
variant: {
|
|
38
|
+
elevated: "ds:shadow-[var(--shadow-card)]",
|
|
39
|
+
outlined: "ds:border ds:border-[color:var(--border)]"
|
|
40
|
+
},
|
|
41
|
+
// 4px accent strip via the logical `border-block-start` shorthand.
|
|
42
|
+
// Tailwind v4 doesn't ship per-side logical-border utilities, so the
|
|
43
|
+
// bracketed CSS shorthand is the kit's idiom (mirrors patterns at
|
|
44
|
+
// `src/patterns/operator-profile/operator-profile.tsx`).
|
|
45
|
+
accent: {
|
|
46
|
+
primary: "ds:[border-block-start:4px_solid_var(--primary)]",
|
|
47
|
+
accent: "ds:[border-block-start:4px_solid_var(--accent)]",
|
|
48
|
+
info: "ds:[border-block-start:4px_solid_var(--info)]",
|
|
49
|
+
success: "ds:[border-block-start:4px_solid_var(--success)]",
|
|
50
|
+
warning: "ds:[border-block-start:4px_solid_var(--warning)]",
|
|
51
|
+
violet: "ds:[border-block-start:4px_solid_var(--color-violet-500)]",
|
|
52
|
+
purple: "ds:[border-block-start:4px_solid_var(--color-purple-500)]",
|
|
53
|
+
magenta: "ds:[border-block-start:4px_solid_var(--color-magenta-500)]",
|
|
54
|
+
blue: "ds:[border-block-start:4px_solid_var(--color-blue-500)]",
|
|
55
|
+
green: "ds:[border-block-start:4px_solid_var(--color-green-500)]",
|
|
56
|
+
red: "ds:[border-block-start:4px_solid_var(--color-red-500)]"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
defaultVariants: { variant: "elevated", accent: "primary" }
|
|
60
|
+
}
|
|
61
|
+
), j = l(
|
|
62
|
+
[
|
|
63
|
+
"ds:inline-flex ds:items-center ds:justify-center",
|
|
64
|
+
"ds:size-12 ds:rounded-[var(--radius-md)] ds:shrink-0",
|
|
65
|
+
"ds:[&>svg]:size-6"
|
|
66
|
+
].join(" "),
|
|
67
|
+
{
|
|
68
|
+
variants: {
|
|
69
|
+
accent: {
|
|
70
|
+
primary: "ds:text-[color:var(--primary)] ds:bg-[color-mix(in_srgb,var(--primary)_12%,var(--background))]",
|
|
71
|
+
accent: "ds:text-[color:var(--accent)] ds:bg-[color-mix(in_srgb,var(--accent)_12%,var(--background))]",
|
|
72
|
+
info: "ds:text-[color:var(--info)] ds:bg-[color-mix(in_srgb,var(--info)_12%,var(--background))]",
|
|
73
|
+
success: "ds:text-[color:var(--success)] ds:bg-[color-mix(in_srgb,var(--success)_12%,var(--background))]",
|
|
74
|
+
warning: "ds:text-[color:var(--warning)] ds:bg-[color-mix(in_srgb,var(--warning)_12%,var(--background))]",
|
|
75
|
+
violet: "ds:text-[color:var(--color-violet-500)] ds:bg-[color-mix(in_srgb,var(--color-violet-500)_12%,var(--background))]",
|
|
76
|
+
purple: "ds:text-[color:var(--color-purple-500)] ds:bg-[color-mix(in_srgb,var(--color-purple-500)_12%,var(--background))]",
|
|
77
|
+
magenta: "ds:text-[color:var(--color-magenta-500)] ds:bg-[color-mix(in_srgb,var(--color-magenta-500)_12%,var(--background))]",
|
|
78
|
+
blue: "ds:text-[color:var(--color-blue-500)] ds:bg-[color-mix(in_srgb,var(--color-blue-500)_12%,var(--background))]",
|
|
79
|
+
green: "ds:text-[color:var(--color-green-500)] ds:bg-[color-mix(in_srgb,var(--color-green-500)_12%,var(--background))]",
|
|
80
|
+
red: "ds:text-[color:var(--color-red-500)] ds:bg-[color-mix(in_srgb,var(--color-red-500)_12%,var(--background))]"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
defaultVariants: { accent: "primary" }
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
function B(o, a) {
|
|
87
|
+
return o !== "auto" ? o : a ? b[a.index % b.length] : "primary";
|
|
88
|
+
}
|
|
89
|
+
const p = u(
|
|
90
|
+
({ columns: o = 3, children: a, className: t, ...s }, n) => {
|
|
91
|
+
const c = y.toArray(a);
|
|
92
|
+
return /* @__PURE__ */ r(
|
|
93
|
+
"div",
|
|
94
|
+
{
|
|
95
|
+
ref: n,
|
|
96
|
+
"data-component": "benefit-card-row",
|
|
97
|
+
className: C({ columns: o, className: t }),
|
|
98
|
+
...s,
|
|
99
|
+
children: c.map((e, d) => /* @__PURE__ */ r(m.Provider, { value: { index: d }, children: e }, d))
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
p.displayName = "BenefitCard.Row";
|
|
105
|
+
const x = u(
|
|
106
|
+
({
|
|
107
|
+
step: o,
|
|
108
|
+
icon: a,
|
|
109
|
+
title: t,
|
|
110
|
+
cta: s,
|
|
111
|
+
variant: n = "elevated",
|
|
112
|
+
accent: c = "auto",
|
|
113
|
+
children: e,
|
|
114
|
+
className: d,
|
|
115
|
+
..._
|
|
116
|
+
}, f) => {
|
|
117
|
+
const h = k(m), i = B(c, h), v = typeof o == "number";
|
|
118
|
+
return /* @__PURE__ */ r(
|
|
119
|
+
"article",
|
|
120
|
+
{
|
|
121
|
+
ref: f,
|
|
122
|
+
"data-component": "benefit-card",
|
|
123
|
+
"data-accent": i,
|
|
124
|
+
className: N({ variant: n, accent: i, className: d }),
|
|
125
|
+
..._,
|
|
126
|
+
children: /* @__PURE__ */ g("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-lg)] ds:flex-1", children: [
|
|
127
|
+
(a || v) && /* @__PURE__ */ g("div", { className: "ds:flex ds:items-start ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
|
|
128
|
+
a ? /* @__PURE__ */ r(
|
|
129
|
+
"span",
|
|
130
|
+
{
|
|
131
|
+
"aria-hidden": "true",
|
|
132
|
+
className: j({ accent: i }),
|
|
133
|
+
children: a
|
|
134
|
+
}
|
|
135
|
+
) : /* @__PURE__ */ r("span", { "aria-hidden": "true" }),
|
|
136
|
+
v ? /* @__PURE__ */ r(
|
|
137
|
+
"span",
|
|
138
|
+
{
|
|
139
|
+
"aria-hidden": "true",
|
|
140
|
+
"data-part": "step",
|
|
141
|
+
className: "type-eyebrow ds:rounded-[var(--radius-full)] ds:bg-[var(--muted)] ds:text-[var(--muted-foreground)] ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:py-[var(--spacing-xs)]",
|
|
142
|
+
children: String(o).padStart(2, "0")
|
|
143
|
+
}
|
|
144
|
+
) : null
|
|
145
|
+
] }),
|
|
146
|
+
/* @__PURE__ */ r("h3", { className: "type-title-card ds:text-[var(--foreground)]", children: t }),
|
|
147
|
+
e ? /* @__PURE__ */ r("div", { className: "type-body ds:text-[var(--muted-foreground)] ds:flex-1", children: e }) : null,
|
|
148
|
+
s ? /* @__PURE__ */ r("div", { className: "ds:mt-[var(--spacing-xs)]", children: s }) : null
|
|
149
|
+
] })
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
x.displayName = "BenefitCard";
|
|
155
|
+
const E = Object.assign(x, {
|
|
156
|
+
Row: p
|
|
157
|
+
});
|
|
158
|
+
export {
|
|
159
|
+
E as B
|
|
160
|
+
};
|
|
161
|
+
//# sourceMappingURL=benefit-card-Czs0oXdi.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;
|