@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.
@@ -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