@alfadocs/ui-kit 0.16.0 → 0.17.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-DXmrAyfn.js +219 -0
- 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-sDi9N9su.js +562 -0
- package/dist/agent-catalog.json +37 -1
- package/dist/components/benefit-card/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,219 @@
|
|
|
1
|
+
import { jsxs as v, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as _, useContext as w, Children as k, createContext as y } from "react";
|
|
3
|
+
import { c as s } from "./index-D2ZczOXr.js";
|
|
4
|
+
const b = [
|
|
5
|
+
"violet",
|
|
6
|
+
"purple",
|
|
7
|
+
"magenta",
|
|
8
|
+
"blue",
|
|
9
|
+
"green",
|
|
10
|
+
"red"
|
|
11
|
+
], m = y(null), C = s("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 = s(
|
|
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:motion-safe:hover:-translate-y-1"
|
|
33
|
+
].join(" "),
|
|
34
|
+
{
|
|
35
|
+
variants: {
|
|
36
|
+
variant: {
|
|
37
|
+
elevated: "ds:shadow-[var(--shadow-card)]",
|
|
38
|
+
outlined: "ds:border ds:border-[color:var(--card-border)]"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
defaultVariants: { variant: "elevated" }
|
|
42
|
+
}
|
|
43
|
+
), V = s(
|
|
44
|
+
"ds:absolute ds:inset-inline-0 ds:top-0 ds:h-[4px] ds:pointer-events-none",
|
|
45
|
+
{
|
|
46
|
+
variants: {
|
|
47
|
+
accent: {
|
|
48
|
+
primary: "ds:bg-linear-to-r ds:from-[var(--primary)] ds:to-[var(--accent)]",
|
|
49
|
+
accent: "ds:bg-linear-to-r ds:from-[var(--accent)] ds:to-[var(--primary)]",
|
|
50
|
+
info: "ds:bg-linear-to-r ds:from-[var(--info)] ds:to-[var(--info)]",
|
|
51
|
+
success: "ds:bg-linear-to-r ds:from-[var(--success)] ds:to-[var(--success)]",
|
|
52
|
+
warning: "ds:bg-linear-to-r ds:from-[var(--warning)] ds:to-[var(--warning)]",
|
|
53
|
+
violet: "ds:bg-linear-to-r ds:from-[var(--color-violet-500)] ds:to-[var(--color-purple-500)]",
|
|
54
|
+
purple: "ds:bg-linear-to-r ds:from-[var(--color-purple-500)] ds:to-[var(--color-magenta-500)]",
|
|
55
|
+
magenta: "ds:bg-linear-to-r ds:from-[var(--color-magenta-500)] ds:to-[var(--color-violet-500)]",
|
|
56
|
+
blue: "ds:bg-linear-to-r ds:from-[var(--color-blue-500)] ds:to-[var(--color-green-500)]",
|
|
57
|
+
green: "ds:bg-linear-to-r ds:from-[var(--color-green-500)] ds:to-[var(--color-red-500)]",
|
|
58
|
+
red: "ds:bg-linear-to-r ds:from-[var(--color-red-500)] ds:to-[var(--color-blue-500)]"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
defaultVariants: { accent: "primary" }
|
|
62
|
+
}
|
|
63
|
+
), j = s("", {
|
|
64
|
+
variants: {
|
|
65
|
+
accent: {
|
|
66
|
+
primary: "ds:hover:shadow-[0_20px_40px_color-mix(in_srgb,var(--primary)_18%,transparent)]",
|
|
67
|
+
accent: "ds:hover:shadow-[0_20px_40px_color-mix(in_srgb,var(--accent)_18%,transparent)]",
|
|
68
|
+
info: "ds:hover:shadow-[0_20px_40px_color-mix(in_srgb,var(--info)_18%,transparent)]",
|
|
69
|
+
success: "ds:hover:shadow-[0_20px_40px_color-mix(in_srgb,var(--success)_18%,transparent)]",
|
|
70
|
+
warning: "ds:hover:shadow-[0_20px_40px_color-mix(in_srgb,var(--warning)_18%,transparent)]",
|
|
71
|
+
violet: "ds:hover:shadow-[0_20px_40px_color-mix(in_srgb,var(--color-violet-500)_18%,transparent)]",
|
|
72
|
+
purple: "ds:hover:shadow-[0_20px_40px_color-mix(in_srgb,var(--color-purple-500)_18%,transparent)]",
|
|
73
|
+
magenta: "ds:hover:shadow-[0_20px_40px_color-mix(in_srgb,var(--color-magenta-500)_18%,transparent)]",
|
|
74
|
+
blue: "ds:hover:shadow-[0_20px_40px_color-mix(in_srgb,var(--color-blue-500)_18%,transparent)]",
|
|
75
|
+
green: "ds:hover:shadow-[0_20px_40px_color-mix(in_srgb,var(--color-green-500)_18%,transparent)]",
|
|
76
|
+
red: "ds:hover:shadow-[0_20px_40px_color-mix(in_srgb,var(--color-red-500)_18%,transparent)]"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
defaultVariants: { accent: "primary" }
|
|
80
|
+
}), B = s(
|
|
81
|
+
[
|
|
82
|
+
"ds:inline-flex ds:items-center ds:justify-center",
|
|
83
|
+
"ds:size-14 ds:rounded-[var(--radius-md)] ds:shrink-0",
|
|
84
|
+
"ds:[&>svg]:size-7",
|
|
85
|
+
"ds:shadow-[inset_0_1px_0_color-mix(in_srgb,white_40%,transparent)]"
|
|
86
|
+
].join(" "),
|
|
87
|
+
{
|
|
88
|
+
variants: {
|
|
89
|
+
accent: {
|
|
90
|
+
primary: "ds:text-[color:var(--primary)] ds:bg-linear-to-br ds:from-[color-mix(in_srgb,var(--primary)_22%,var(--background))] ds:to-[color-mix(in_srgb,var(--accent)_8%,var(--background))]",
|
|
91
|
+
accent: "ds:text-[color:var(--accent)] ds:bg-linear-to-br ds:from-[color-mix(in_srgb,var(--accent)_22%,var(--background))] ds:to-[color-mix(in_srgb,var(--primary)_8%,var(--background))]",
|
|
92
|
+
info: "ds:text-[color:var(--info)] ds:bg-linear-to-br ds:from-[color-mix(in_srgb,var(--info)_22%,var(--background))] ds:to-[color-mix(in_srgb,var(--info)_8%,var(--background))]",
|
|
93
|
+
success: "ds:text-[color:var(--success)] ds:bg-linear-to-br ds:from-[color-mix(in_srgb,var(--success)_22%,var(--background))] ds:to-[color-mix(in_srgb,var(--success)_8%,var(--background))]",
|
|
94
|
+
warning: "ds:text-[color:var(--warning)] ds:bg-linear-to-br ds:from-[color-mix(in_srgb,var(--warning)_22%,var(--background))] ds:to-[color-mix(in_srgb,var(--warning)_8%,var(--background))]",
|
|
95
|
+
violet: "ds:text-[color:var(--color-violet-500)] ds:bg-linear-to-br ds:from-[color-mix(in_srgb,var(--color-violet-500)_22%,var(--background))] ds:to-[color-mix(in_srgb,var(--color-purple-500)_8%,var(--background))]",
|
|
96
|
+
purple: "ds:text-[color:var(--color-purple-500)] ds:bg-linear-to-br ds:from-[color-mix(in_srgb,var(--color-purple-500)_22%,var(--background))] ds:to-[color-mix(in_srgb,var(--color-magenta-500)_8%,var(--background))]",
|
|
97
|
+
magenta: "ds:text-[color:var(--color-magenta-500)] ds:bg-linear-to-br ds:from-[color-mix(in_srgb,var(--color-magenta-500)_22%,var(--background))] ds:to-[color-mix(in_srgb,var(--color-violet-500)_8%,var(--background))]",
|
|
98
|
+
blue: "ds:text-[color:var(--color-blue-500)] ds:bg-linear-to-br ds:from-[color-mix(in_srgb,var(--color-blue-500)_22%,var(--background))] ds:to-[color-mix(in_srgb,var(--color-green-500)_8%,var(--background))]",
|
|
99
|
+
green: "ds:text-[color:var(--color-green-500)] ds:bg-linear-to-br ds:from-[color-mix(in_srgb,var(--color-green-500)_22%,var(--background))] ds:to-[color-mix(in_srgb,var(--color-red-500)_8%,var(--background))]",
|
|
100
|
+
red: "ds:text-[color:var(--color-red-500)] ds:bg-linear-to-br ds:from-[color-mix(in_srgb,var(--color-red-500)_22%,var(--background))] ds:to-[color-mix(in_srgb,var(--color-blue-500)_8%,var(--background))]"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
defaultVariants: { accent: "primary" }
|
|
104
|
+
}
|
|
105
|
+
), R = s(
|
|
106
|
+
[
|
|
107
|
+
"type-eyebrow",
|
|
108
|
+
"ds:rounded-[var(--radius-full)]",
|
|
109
|
+
"ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:py-[var(--spacing-xs)]"
|
|
110
|
+
].join(" "),
|
|
111
|
+
{
|
|
112
|
+
variants: {
|
|
113
|
+
accent: {
|
|
114
|
+
primary: "ds:text-[color:var(--color-violet-700)] ds:bg-[color-mix(in_srgb,var(--primary)_12%,var(--background))] ds:[border:1px_solid_color-mix(in_srgb,var(--primary)_30%,transparent)]",
|
|
115
|
+
accent: "ds:text-[color:var(--color-magenta-700)] ds:bg-[color-mix(in_srgb,var(--accent)_12%,var(--background))] ds:[border:1px_solid_color-mix(in_srgb,var(--accent)_30%,transparent)]",
|
|
116
|
+
info: "ds:text-[color:var(--color-blue-700)] ds:bg-[color-mix(in_srgb,var(--info)_12%,var(--background))] ds:[border:1px_solid_color-mix(in_srgb,var(--info)_30%,transparent)]",
|
|
117
|
+
success: "ds:text-[color:var(--color-green-700)] ds:bg-[color-mix(in_srgb,var(--success)_12%,var(--background))] ds:[border:1px_solid_color-mix(in_srgb,var(--success)_30%,transparent)]",
|
|
118
|
+
warning: "ds:text-[color:var(--color-red-700)] ds:bg-[color-mix(in_srgb,var(--warning)_12%,var(--background))] ds:[border:1px_solid_color-mix(in_srgb,var(--warning)_30%,transparent)]",
|
|
119
|
+
violet: "ds:text-[color:var(--color-violet-700)] ds:bg-[color-mix(in_srgb,var(--color-violet-500)_12%,var(--background))] ds:[border:1px_solid_color-mix(in_srgb,var(--color-violet-500)_30%,transparent)]",
|
|
120
|
+
purple: "ds:text-[color:var(--color-purple-700)] ds:bg-[color-mix(in_srgb,var(--color-purple-500)_12%,var(--background))] ds:[border:1px_solid_color-mix(in_srgb,var(--color-purple-500)_30%,transparent)]",
|
|
121
|
+
magenta: "ds:text-[color:var(--color-magenta-700)] ds:bg-[color-mix(in_srgb,var(--color-magenta-500)_12%,var(--background))] ds:[border:1px_solid_color-mix(in_srgb,var(--color-magenta-500)_30%,transparent)]",
|
|
122
|
+
blue: "ds:text-[color:var(--color-blue-700)] ds:bg-[color-mix(in_srgb,var(--color-blue-500)_12%,var(--background))] ds:[border:1px_solid_color-mix(in_srgb,var(--color-blue-500)_30%,transparent)]",
|
|
123
|
+
green: "ds:text-[color:var(--color-green-700)] ds:bg-[color-mix(in_srgb,var(--color-green-500)_12%,var(--background))] ds:[border:1px_solid_color-mix(in_srgb,var(--color-green-500)_30%,transparent)]",
|
|
124
|
+
red: "ds:text-[color:var(--color-red-700)] ds:bg-[color-mix(in_srgb,var(--color-red-500)_12%,var(--background))] ds:[border:1px_solid_color-mix(in_srgb,var(--color-red-500)_30%,transparent)]"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
defaultVariants: { accent: "primary" }
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
function S(a, o) {
|
|
131
|
+
return a !== "auto" ? a : o ? b[o.index % b.length] : "primary";
|
|
132
|
+
}
|
|
133
|
+
const p = _(
|
|
134
|
+
({ columns: a = 3, children: o, className: i, ...n }, c) => {
|
|
135
|
+
const l = k.toArray(o);
|
|
136
|
+
return /* @__PURE__ */ r(
|
|
137
|
+
"div",
|
|
138
|
+
{
|
|
139
|
+
ref: c,
|
|
140
|
+
"data-component": "benefit-card-row",
|
|
141
|
+
className: C({ columns: a, className: i }),
|
|
142
|
+
...n,
|
|
143
|
+
children: l.map((d, t) => /* @__PURE__ */ r(m.Provider, { value: { index: t }, children: d }, t))
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
p.displayName = "BenefitCard.Row";
|
|
149
|
+
const x = _(
|
|
150
|
+
({
|
|
151
|
+
step: a,
|
|
152
|
+
icon: o,
|
|
153
|
+
title: i,
|
|
154
|
+
cta: n,
|
|
155
|
+
variant: c = "elevated",
|
|
156
|
+
accent: l = "auto",
|
|
157
|
+
children: d,
|
|
158
|
+
className: t,
|
|
159
|
+
...u
|
|
160
|
+
}, f) => {
|
|
161
|
+
const h = w(m), e = S(l, h), g = typeof a == "number";
|
|
162
|
+
return /* @__PURE__ */ v(
|
|
163
|
+
"article",
|
|
164
|
+
{
|
|
165
|
+
ref: f,
|
|
166
|
+
"data-component": "benefit-card",
|
|
167
|
+
"data-accent": e,
|
|
168
|
+
className: [
|
|
169
|
+
N({ variant: c }),
|
|
170
|
+
j({ accent: e }),
|
|
171
|
+
t
|
|
172
|
+
].filter(Boolean).join(" "),
|
|
173
|
+
...u,
|
|
174
|
+
children: [
|
|
175
|
+
/* @__PURE__ */ r(
|
|
176
|
+
"span",
|
|
177
|
+
{
|
|
178
|
+
"aria-hidden": "true",
|
|
179
|
+
"data-part": "accent-strip",
|
|
180
|
+
className: V({ accent: e })
|
|
181
|
+
}
|
|
182
|
+
),
|
|
183
|
+
/* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-lg)] ds:flex-1", children: [
|
|
184
|
+
(o || g) && /* @__PURE__ */ v("div", { className: "ds:flex ds:items-start ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
|
|
185
|
+
o ? /* @__PURE__ */ r(
|
|
186
|
+
"span",
|
|
187
|
+
{
|
|
188
|
+
"aria-hidden": "true",
|
|
189
|
+
className: B({ accent: e }),
|
|
190
|
+
children: o
|
|
191
|
+
}
|
|
192
|
+
) : /* @__PURE__ */ r("span", { "aria-hidden": "true" }),
|
|
193
|
+
g ? /* @__PURE__ */ r(
|
|
194
|
+
"span",
|
|
195
|
+
{
|
|
196
|
+
"aria-hidden": "true",
|
|
197
|
+
"data-part": "step",
|
|
198
|
+
className: R({ accent: e }),
|
|
199
|
+
children: String(a).padStart(2, "0")
|
|
200
|
+
}
|
|
201
|
+
) : null
|
|
202
|
+
] }),
|
|
203
|
+
/* @__PURE__ */ r("h3", { className: "type-title-card ds:text-[var(--foreground)]", children: i }),
|
|
204
|
+
d ? /* @__PURE__ */ r("div", { className: "type-body ds:text-[var(--muted-foreground)] ds:flex-1", children: d }) : null,
|
|
205
|
+
n ? /* @__PURE__ */ r("div", { className: "ds:mt-[var(--spacing-xs)]", children: n }) : null
|
|
206
|
+
] })
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
);
|
|
212
|
+
x.displayName = "BenefitCard";
|
|
213
|
+
const H = Object.assign(x, {
|
|
214
|
+
Row: p
|
|
215
|
+
});
|
|
216
|
+
export {
|
|
217
|
+
H as B
|
|
218
|
+
};
|
|
219
|
+
//# sourceMappingURL=benefit-card-DXmrAyfn.js.map
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { jsxs as P, jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as m, useEffect as V, useState as A, useCallback as y, forwardRef as _, useMemo as H } from "react";
|
|
3
|
+
import { c as x } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as O } from "react-i18next";
|
|
5
|
+
import { B as W } from "./button-DD_0Xdmr.js";
|
|
6
|
+
import { u as q } from "./registry-C9nwlNyL.js";
|
|
7
|
+
import { C as D } from "./check-DPdL_Sm7.js";
|
|
8
|
+
import { C as G } from "./copy-B00HK7tj.js";
|
|
9
|
+
const J = typeof navigator < "u" && typeof navigator.clipboard < "u" && typeof navigator.clipboard.writeText == "function";
|
|
10
|
+
function Q(t = {}) {
|
|
11
|
+
const { resetAfterMs: e = 2e3, writer: s } = t, o = m(s);
|
|
12
|
+
V(() => {
|
|
13
|
+
o.current = s;
|
|
14
|
+
}, [s]);
|
|
15
|
+
const [C, i] = A("idle"), [T, u] = A(null), n = m(null), a = y(() => {
|
|
16
|
+
n.current !== null && (clearTimeout(n.current), n.current = null);
|
|
17
|
+
}, []), d = y(() => {
|
|
18
|
+
a(), i("idle"), u(null);
|
|
19
|
+
}, [a]), z = y(
|
|
20
|
+
async (c) => {
|
|
21
|
+
a();
|
|
22
|
+
const h = o.current;
|
|
23
|
+
let l = !1;
|
|
24
|
+
if (h)
|
|
25
|
+
try {
|
|
26
|
+
l = await h(c);
|
|
27
|
+
} catch {
|
|
28
|
+
l = !1;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
if (!(J || typeof navigator < "u" && typeof navigator.clipboard < "u" && typeof navigator.clipboard.writeText == "function"))
|
|
32
|
+
return i("error"), u(null), !1;
|
|
33
|
+
try {
|
|
34
|
+
await navigator.clipboard.writeText(c), l = !0;
|
|
35
|
+
} catch {
|
|
36
|
+
l = !1;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return l ? (i("copied"), u(c), e > 0 && (n.current = setTimeout(() => {
|
|
40
|
+
n.current = null, i("idle");
|
|
41
|
+
}, e)), !0) : (i("error"), u(null), !1);
|
|
42
|
+
},
|
|
43
|
+
[a, e]
|
|
44
|
+
);
|
|
45
|
+
return V(() => a, [a]), { status: C, copiedValue: T, copy: z, reset: d };
|
|
46
|
+
}
|
|
47
|
+
const U = {
|
|
48
|
+
id: "copy-field",
|
|
49
|
+
capabilities: [],
|
|
50
|
+
state: {
|
|
51
|
+
value: {
|
|
52
|
+
type: "string",
|
|
53
|
+
descriptionKey: "ui.agent.copyField.state.value",
|
|
54
|
+
description: "The value displayed in the read-only field.",
|
|
55
|
+
read: (t) => t.getValue()
|
|
56
|
+
},
|
|
57
|
+
copied: {
|
|
58
|
+
type: "boolean",
|
|
59
|
+
descriptionKey: "ui.agent.copyField.state.copied",
|
|
60
|
+
description: "True for the brief window after a successful copy.",
|
|
61
|
+
read: (t) => t.isCopied()
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
actions: {
|
|
65
|
+
copy: {
|
|
66
|
+
safety: "write",
|
|
67
|
+
descriptionKey: "ui.agent.copyField.actions.copy",
|
|
68
|
+
description: "Programmatically trigger the clipboard write.",
|
|
69
|
+
invoke: (t) => t.copy()
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
domHooks: {
|
|
73
|
+
root: {
|
|
74
|
+
attr: "data-component",
|
|
75
|
+
value: "copy-field",
|
|
76
|
+
description: "Marks the CopyField root. The trailing button uses `aria-label` keyed off the copy / copied state."
|
|
77
|
+
},
|
|
78
|
+
instanceId: {
|
|
79
|
+
attr: "data-component-id",
|
|
80
|
+
sourceProp: "id",
|
|
81
|
+
description: "Sourced from the id prop, when provided."
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
async function X(t) {
|
|
86
|
+
var o;
|
|
87
|
+
if (typeof navigator < "u" && ((o = navigator.clipboard) != null && o.writeText))
|
|
88
|
+
try {
|
|
89
|
+
return await navigator.clipboard.writeText(t), !0;
|
|
90
|
+
} catch {
|
|
91
|
+
}
|
|
92
|
+
if (typeof document > "u") return !1;
|
|
93
|
+
const e = document.createElement("textarea");
|
|
94
|
+
e.value = t, e.setAttribute("readonly", ""), e.style.position = "absolute", e.style.setProperty("inset-inline-start", "-9999px"), document.body.appendChild(e), e.select();
|
|
95
|
+
let s = !1;
|
|
96
|
+
try {
|
|
97
|
+
s = document.execCommand("copy");
|
|
98
|
+
} catch {
|
|
99
|
+
s = !1;
|
|
100
|
+
}
|
|
101
|
+
return document.body.removeChild(e), s;
|
|
102
|
+
}
|
|
103
|
+
const Y = x(
|
|
104
|
+
[
|
|
105
|
+
"ds:inline-flex ds:items-stretch ds:w-full",
|
|
106
|
+
"ds:rounded-[var(--radius-sm)] ds:bg-input ds:text-foreground",
|
|
107
|
+
"ds:border ds:border-border",
|
|
108
|
+
"ds:shadow-[var(--shadow-input)]",
|
|
109
|
+
"ds:focus-within:outline-[length:var(--focus-ring-width)] ds:focus-within:outline-solid",
|
|
110
|
+
"ds:focus-within:outline-ring ds:focus-within:outline-offset-[length:var(--focus-ring-offset)]",
|
|
111
|
+
"ds:forced-colors:focus-within:outline-[CanvasText]",
|
|
112
|
+
"ds:transition-[colors,box-shadow] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
|
|
113
|
+
"ds:overflow-hidden"
|
|
114
|
+
].join(" "),
|
|
115
|
+
{
|
|
116
|
+
variants: {
|
|
117
|
+
size: {
|
|
118
|
+
sm: "ds:h-8 ds:text-[var(--font-size-sm)]",
|
|
119
|
+
md: "ds:h-[var(--min-target-size)] ds:text-[var(--font-size-base)]",
|
|
120
|
+
lg: "ds:h-12 ds:text-[var(--font-size-lg)]"
|
|
121
|
+
},
|
|
122
|
+
disabled: {
|
|
123
|
+
true: "ds:opacity-50 ds:cursor-not-allowed",
|
|
124
|
+
false: ""
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
defaultVariants: { size: "md", disabled: !1 }
|
|
128
|
+
}
|
|
129
|
+
), Z = x(
|
|
130
|
+
[
|
|
131
|
+
"ds:flex-1 ds:min-w-0 ds:bg-transparent ds:border-0 ds:outline-none",
|
|
132
|
+
"ds:text-foreground",
|
|
133
|
+
"ds:disabled:cursor-not-allowed"
|
|
134
|
+
].join(" "),
|
|
135
|
+
{
|
|
136
|
+
variants: {
|
|
137
|
+
intent: {
|
|
138
|
+
default: "",
|
|
139
|
+
// `--primary` is calibrated for foreground use (violet-500 light,
|
|
140
|
+
// magenta-500 dark) — both pass AA against their input backgrounds.
|
|
141
|
+
primary: "ds:text-primary ds:font-medium"
|
|
142
|
+
},
|
|
143
|
+
size: {
|
|
144
|
+
sm: "ds:text-[var(--font-size-sm)]",
|
|
145
|
+
md: "ds:text-[var(--font-size-base)]",
|
|
146
|
+
lg: "ds:text-[var(--font-size-lg)]"
|
|
147
|
+
},
|
|
148
|
+
wrap: {
|
|
149
|
+
true: "ds:[overflow-wrap:anywhere] ds:whitespace-normal",
|
|
150
|
+
false: "ds:overflow-hidden ds:text-ellipsis ds:whitespace-nowrap"
|
|
151
|
+
},
|
|
152
|
+
hasStartIcon: {
|
|
153
|
+
true: "",
|
|
154
|
+
false: ""
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
// Explicit pairs decide the leading padding — single ps-* per cell, so
|
|
158
|
+
// there's no fight between size + hasStartIcon under Tailwind's flat
|
|
159
|
+
// utility precedence.
|
|
160
|
+
compoundVariants: [
|
|
161
|
+
{ size: "sm", hasStartIcon: !1, class: "ds:ps-[var(--spacing-sm)]" },
|
|
162
|
+
{ size: "md", hasStartIcon: !1, class: "ds:ps-[var(--spacing-sm)]" },
|
|
163
|
+
{ size: "lg", hasStartIcon: !1, class: "ds:ps-[var(--spacing-md)]" },
|
|
164
|
+
{ size: "sm", hasStartIcon: !0, class: "ds:ps-[var(--spacing-xs)]" },
|
|
165
|
+
{ size: "md", hasStartIcon: !0, class: "ds:ps-[var(--spacing-xs)]" },
|
|
166
|
+
{ size: "lg", hasStartIcon: !0, class: "ds:ps-[var(--spacing-sm)]" }
|
|
167
|
+
],
|
|
168
|
+
defaultVariants: {
|
|
169
|
+
intent: "default",
|
|
170
|
+
size: "md",
|
|
171
|
+
wrap: !1,
|
|
172
|
+
hasStartIcon: !1
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
), $ = x(
|
|
176
|
+
[
|
|
177
|
+
"ds:inline-flex ds:items-center ds:justify-center ds:shrink-0",
|
|
178
|
+
"ds:text-muted-foreground",
|
|
179
|
+
"ds:[&_svg]:size-4"
|
|
180
|
+
].join(" "),
|
|
181
|
+
{
|
|
182
|
+
variants: {
|
|
183
|
+
size: {
|
|
184
|
+
sm: "ds:ps-[var(--spacing-sm)]",
|
|
185
|
+
md: "ds:ps-[var(--spacing-sm)]",
|
|
186
|
+
lg: "ds:ps-[var(--spacing-md)]"
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
defaultVariants: { size: "md" }
|
|
190
|
+
}
|
|
191
|
+
), ee = x(
|
|
192
|
+
[
|
|
193
|
+
"ds:shrink-0 ds:rounded-none",
|
|
194
|
+
"ds:focus-visible:outline-none",
|
|
195
|
+
"ds:h-full",
|
|
196
|
+
"ds:gap-[var(--spacing-xs)]"
|
|
197
|
+
].join(" ")
|
|
198
|
+
), te = _(
|
|
199
|
+
({
|
|
200
|
+
value: t,
|
|
201
|
+
size: e = "md",
|
|
202
|
+
intent: s = "default",
|
|
203
|
+
startIcon: o,
|
|
204
|
+
wrap: C = !1,
|
|
205
|
+
copyLabel: i,
|
|
206
|
+
copiedLabel: T,
|
|
207
|
+
copiedDuration: u = 2e3,
|
|
208
|
+
ariaLabel: n,
|
|
209
|
+
onCopy: a,
|
|
210
|
+
disabled: d = !1,
|
|
211
|
+
className: z,
|
|
212
|
+
id: c,
|
|
213
|
+
...h
|
|
214
|
+
}, l) => {
|
|
215
|
+
const { t: r } = O(), g = m(t);
|
|
216
|
+
g.current = t;
|
|
217
|
+
const v = m(a);
|
|
218
|
+
v.current = a;
|
|
219
|
+
const { status: w, copy: I } = Q({
|
|
220
|
+
resetAfterMs: u,
|
|
221
|
+
writer: X
|
|
222
|
+
}), f = w === "copied", R = m(!1);
|
|
223
|
+
R.current = f;
|
|
224
|
+
const [B, F] = A("");
|
|
225
|
+
V(() => {
|
|
226
|
+
F(w === "copied" ? r("copyField.copySuccess") : w === "error" ? r("copyField.copyFailed") : "");
|
|
227
|
+
}, [w, r]);
|
|
228
|
+
const b = y(async () => {
|
|
229
|
+
var j;
|
|
230
|
+
if (d) return !1;
|
|
231
|
+
const L = await I(g.current);
|
|
232
|
+
return L && ((j = v.current) == null || j.call(v, g.current)), L;
|
|
233
|
+
}, [d, I]), N = y(() => {
|
|
234
|
+
b();
|
|
235
|
+
}, [b]), K = H(
|
|
236
|
+
() => ({
|
|
237
|
+
getValue: () => g.current,
|
|
238
|
+
copy: () => b(),
|
|
239
|
+
isCopied: () => R.current
|
|
240
|
+
}),
|
|
241
|
+
[b]
|
|
242
|
+
);
|
|
243
|
+
q(U, K, c);
|
|
244
|
+
const M = n ?? r("copyField.valueLabel"), S = i ?? r("copyField.copy"), k = T ?? r("copyField.copied"), E = f ? typeof k == "string" ? k : r("copyField.copied") : typeof S == "string" ? S : r("copyField.copy");
|
|
245
|
+
return /* @__PURE__ */ P(
|
|
246
|
+
"div",
|
|
247
|
+
{
|
|
248
|
+
ref: l,
|
|
249
|
+
className: Y({ size: e, disabled: d, className: z }),
|
|
250
|
+
"data-component": "copy-field",
|
|
251
|
+
"data-component-id": c,
|
|
252
|
+
"data-copied": f ? "true" : void 0,
|
|
253
|
+
...h,
|
|
254
|
+
children: [
|
|
255
|
+
o ? /* @__PURE__ */ p("span", { "aria-hidden": "true", className: $({ size: e }), children: o }) : null,
|
|
256
|
+
/* @__PURE__ */ p(
|
|
257
|
+
"input",
|
|
258
|
+
{
|
|
259
|
+
id: c,
|
|
260
|
+
type: "text",
|
|
261
|
+
readOnly: !0,
|
|
262
|
+
value: t,
|
|
263
|
+
disabled: d,
|
|
264
|
+
"aria-label": M,
|
|
265
|
+
className: Z({
|
|
266
|
+
intent: s,
|
|
267
|
+
size: e,
|
|
268
|
+
wrap: C,
|
|
269
|
+
hasStartIcon: !!o
|
|
270
|
+
})
|
|
271
|
+
}
|
|
272
|
+
),
|
|
273
|
+
/* @__PURE__ */ p(
|
|
274
|
+
W,
|
|
275
|
+
{
|
|
276
|
+
type: "button",
|
|
277
|
+
intent: "ghost",
|
|
278
|
+
size: e,
|
|
279
|
+
onClick: N,
|
|
280
|
+
disabled: d,
|
|
281
|
+
"aria-label": E,
|
|
282
|
+
className: ee(),
|
|
283
|
+
startIcon: f ? /* @__PURE__ */ p(D, { "aria-hidden": "true" }) : /* @__PURE__ */ p(G, { "aria-hidden": "true" }),
|
|
284
|
+
children: /* @__PURE__ */ p("span", { className: "type-label", children: f ? k : S })
|
|
285
|
+
}
|
|
286
|
+
),
|
|
287
|
+
/* @__PURE__ */ p("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: B })
|
|
288
|
+
]
|
|
289
|
+
}
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
);
|
|
293
|
+
te.displayName = "CopyField";
|
|
294
|
+
export {
|
|
295
|
+
te as C,
|
|
296
|
+
U as c
|
|
297
|
+
};
|
|
298
|
+
//# sourceMappingURL=copy-field-BCHAZ8QV.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as p, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as n, useRef as I, useState as k, useCallback as z, useMemo as C, useImperativeHandle as B } from "react";
|
|
3
3
|
import * as o from "@radix-ui/react-navigation-menu";
|
|
4
|
-
import { Slot as
|
|
5
|
-
import { c as
|
|
4
|
+
import { Slot as L } from "@radix-ui/react-slot";
|
|
5
|
+
import { c as R } from "./index-D2ZczOXr.js";
|
|
6
6
|
import { useTranslation as T } from "react-i18next";
|
|
7
7
|
import { u as A } from "./use-direction-D6rvvG9G.js";
|
|
8
8
|
import { u as K } from "./registry-C9nwlNyL.js";
|
|
@@ -77,18 +77,18 @@ const S = {
|
|
|
77
77
|
className: t,
|
|
78
78
|
children: a,
|
|
79
79
|
id: i,
|
|
80
|
-
value:
|
|
80
|
+
value: m,
|
|
81
81
|
defaultValue: h,
|
|
82
|
-
onValueChange:
|
|
82
|
+
onValueChange: c,
|
|
83
83
|
...b
|
|
84
84
|
}, N) => {
|
|
85
|
-
const { t: w } = T(), u = I(null), y = A(u), v =
|
|
85
|
+
const { t: w } = T(), u = I(null), y = A(u), v = m !== void 0, [M, x] = k(
|
|
86
86
|
h ?? ""
|
|
87
|
-
), r = v ?
|
|
87
|
+
), r = v ? m : M, l = z(
|
|
88
88
|
(d) => {
|
|
89
|
-
v ||
|
|
89
|
+
v || x(d), c == null || c(d);
|
|
90
90
|
},
|
|
91
|
-
[v,
|
|
91
|
+
[v, c]
|
|
92
92
|
), j = C(
|
|
93
93
|
() => ({
|
|
94
94
|
getActiveItem: () => r || null,
|
|
@@ -139,9 +139,9 @@ const D = [
|
|
|
139
139
|
}
|
|
140
140
|
));
|
|
141
141
|
H.displayName = "NavigationMenuList";
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
const
|
|
142
|
+
const P = n(({ navId: e, ...t }, a) => /* @__PURE__ */ s(o.Item, { ref: a, "data-nav-id": e, ...t }));
|
|
143
|
+
P.displayName = "NavigationMenuItem";
|
|
144
|
+
const _ = [
|
|
145
145
|
"ds:group ds:inline-flex ds:items-center ds:justify-center",
|
|
146
146
|
"ds:min-h-[var(--min-target-size)]",
|
|
147
147
|
"ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-sm)]",
|
|
@@ -163,7 +163,7 @@ const P = [
|
|
|
163
163
|
o.Trigger,
|
|
164
164
|
{
|
|
165
165
|
ref: i,
|
|
166
|
-
className: [
|
|
166
|
+
className: [_, e].filter(Boolean).join(" "),
|
|
167
167
|
...a,
|
|
168
168
|
children: [
|
|
169
169
|
t,
|
|
@@ -188,7 +188,7 @@ const F = [
|
|
|
188
188
|
"ds:data-[motion=to-start]:slide-out-to-left-52 ds:rtl:data-[motion=to-start]:slide-out-to-right-52",
|
|
189
189
|
"ds:data-[motion=to-end]:slide-out-to-right-52 ds:rtl:data-[motion=to-end]:slide-out-to-left-52",
|
|
190
190
|
"ds:motion-reduce:animate-none"
|
|
191
|
-
].join(" "), G =
|
|
191
|
+
].join(" "), G = R(F, {
|
|
192
192
|
variants: {
|
|
193
193
|
layout: {
|
|
194
194
|
simple: "ds:min-w-[16rem]",
|
|
@@ -220,14 +220,14 @@ const g = [
|
|
|
220
220
|
"ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
|
|
221
221
|
"ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
222
222
|
"ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none"
|
|
223
|
-
].join(" "), Q = n(({ asChild: e = !1, className: t, children: a, ...i },
|
|
223
|
+
].join(" "), Q = n(({ asChild: e = !1, className: t, children: a, ...i }, m) => /* @__PURE__ */ s(
|
|
224
224
|
o.Link,
|
|
225
225
|
{
|
|
226
|
-
ref:
|
|
226
|
+
ref: m,
|
|
227
227
|
asChild: e,
|
|
228
228
|
className: e ? void 0 : [g, t].filter(Boolean).join(" "),
|
|
229
229
|
...i,
|
|
230
|
-
children: e ? /* @__PURE__ */ s(
|
|
230
|
+
children: e ? /* @__PURE__ */ s(L, { className: [g, t].filter(Boolean).join(" "), children: a }) : a
|
|
231
231
|
}
|
|
232
232
|
));
|
|
233
233
|
Q.displayName = "NavigationMenuLink";
|
|
@@ -269,11 +269,11 @@ export {
|
|
|
269
269
|
q as N,
|
|
270
270
|
J as a,
|
|
271
271
|
X as b,
|
|
272
|
-
|
|
272
|
+
P as c,
|
|
273
273
|
Q as d,
|
|
274
274
|
H as e,
|
|
275
275
|
E as f,
|
|
276
276
|
f as g,
|
|
277
277
|
S as n
|
|
278
278
|
};
|
|
279
|
-
//# sourceMappingURL=navigation-menu-
|
|
279
|
+
//# sourceMappingURL=navigation-menu-DdufF-_4.js.map
|