@alfadocs/ui-kit 1.98.0 → 1.99.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.
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as d, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
2
|
+
import { forwardRef as E, useState as F, useRef as o, useEffect as M, useMemo as O } from "react";
|
|
3
|
+
import { c as H } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as V } from "react-i18next";
|
|
5
5
|
import { P as l } from "./popover-CN5IsOeS.js";
|
|
6
|
-
import { L as
|
|
7
|
-
import { S as
|
|
8
|
-
import { c as
|
|
9
|
-
import { u as
|
|
10
|
-
import { I as
|
|
11
|
-
const
|
|
6
|
+
import { L as q } from "./link-DtCfnLnF.js";
|
|
7
|
+
import { S as B } from "./scroll-area-CY5SLYNw.js";
|
|
8
|
+
import { c as G } from "./compose-refs-C0k0tdqF.js";
|
|
9
|
+
import { u as J } from "./registry-DvAUVLHh.js";
|
|
10
|
+
import { I as Q } from "./info-CGn22peZ.js";
|
|
11
|
+
const U = {
|
|
12
12
|
id: "info-tip",
|
|
13
13
|
capabilities: ["open", "close"],
|
|
14
14
|
state: {
|
|
@@ -51,7 +51,7 @@ const Q = {
|
|
|
51
51
|
description: "Sourced from the id prop on InfoTip."
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
},
|
|
54
|
+
}, W = H(
|
|
55
55
|
[
|
|
56
56
|
"ds:relative ds:inline-flex ds:shrink-0 ds:items-center ds:justify-center",
|
|
57
57
|
"ds:rounded-[var(--radius-full)]",
|
|
@@ -90,26 +90,27 @@ const Q = {
|
|
|
90
90
|
size: "md"
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
),
|
|
93
|
+
), X = E(
|
|
94
94
|
({
|
|
95
95
|
content: n,
|
|
96
96
|
heading: r,
|
|
97
97
|
size: u = "md",
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
cardSize: D,
|
|
99
|
+
side: z = "top",
|
|
100
|
+
align: C = "center",
|
|
101
|
+
"aria-label": L,
|
|
101
102
|
id: g,
|
|
102
|
-
className:
|
|
103
|
+
className: S,
|
|
103
104
|
formula: b,
|
|
104
105
|
learnMoreHref: y,
|
|
105
|
-
learnMoreLabel:
|
|
106
|
-
onLearnMore:
|
|
106
|
+
learnMoreLabel: A,
|
|
107
|
+
onLearnMore: K
|
|
107
108
|
}, x) => {
|
|
108
|
-
const { t: m } =
|
|
109
|
-
|
|
109
|
+
const { t: m } = V("ui"), [f, p] = F(!1), i = o(f);
|
|
110
|
+
M(() => {
|
|
110
111
|
i.current = f;
|
|
111
112
|
}, [f]);
|
|
112
|
-
const
|
|
113
|
+
const P = O(
|
|
113
114
|
() => ({
|
|
114
115
|
getIsOpen: () => i.current,
|
|
115
116
|
open: () => p(!0),
|
|
@@ -117,20 +118,20 @@ const Q = {
|
|
|
117
118
|
}),
|
|
118
119
|
[]
|
|
119
120
|
);
|
|
120
|
-
|
|
121
|
+
J(U, P, g);
|
|
121
122
|
const v = o(null), T = () => {
|
|
122
123
|
v.current = i.current;
|
|
123
|
-
}, w = y != null, k = o(null),
|
|
124
|
-
() =>
|
|
124
|
+
}, w = y != null, k = o(null), j = O(
|
|
125
|
+
() => G(x, k),
|
|
125
126
|
[x]
|
|
126
|
-
), I = o(null), R = o(null), N = o(null), h =
|
|
127
|
+
), I = o(null), R = o(null), N = o(null), h = L ?? m("infoTip.triggerLabel", "More information");
|
|
127
128
|
return /* @__PURE__ */ d(l, { openOn: "hover-or-click", open: f, onOpenChange: p, children: [
|
|
128
129
|
/* @__PURE__ */ t(
|
|
129
130
|
l.Trigger,
|
|
130
131
|
{
|
|
131
|
-
ref:
|
|
132
|
+
ref: j,
|
|
132
133
|
"aria-label": h,
|
|
133
|
-
className:
|
|
134
|
+
className: W({ size: u, className: S }),
|
|
134
135
|
"data-component": "info-tip",
|
|
135
136
|
"data-component-id": g,
|
|
136
137
|
onPointerDown: T,
|
|
@@ -144,7 +145,7 @@ const Q = {
|
|
|
144
145
|
v.current = null, s === !1 && i.current && e.preventDefault();
|
|
145
146
|
},
|
|
146
147
|
children: /* @__PURE__ */ t(
|
|
147
|
-
|
|
148
|
+
Q,
|
|
148
149
|
{
|
|
149
150
|
"aria-hidden": "true",
|
|
150
151
|
className: u === "sm" ? "ds:size-5" : "ds:size-6"
|
|
@@ -156,9 +157,9 @@ const Q = {
|
|
|
156
157
|
l.Content,
|
|
157
158
|
{
|
|
158
159
|
ref: R,
|
|
159
|
-
side:
|
|
160
|
-
align:
|
|
161
|
-
size: u === "sm" ? "sm" : "md",
|
|
160
|
+
side: z,
|
|
161
|
+
align: C,
|
|
162
|
+
size: D ?? (u === "sm" ? "sm" : "md"),
|
|
162
163
|
className: "ds:flex ds:flex-col ds:max-h-[var(--radix-popover-content-available-height)]",
|
|
163
164
|
"aria-label": r == null ? h : void 0,
|
|
164
165
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
@@ -171,7 +172,7 @@ const Q = {
|
|
|
171
172
|
children: [
|
|
172
173
|
r != null && /* @__PURE__ */ t(l.Heading, { children: r }),
|
|
173
174
|
/* @__PURE__ */ t(l.Description, { className: "ds:flex ds:min-h-0 ds:flex-col", children: /* @__PURE__ */ d(
|
|
174
|
-
|
|
175
|
+
B,
|
|
175
176
|
{
|
|
176
177
|
ref: N,
|
|
177
178
|
type: "native",
|
|
@@ -203,14 +204,14 @@ const Q = {
|
|
|
203
204
|
"data-slot": "footer",
|
|
204
205
|
className: "ds:mt-[var(--spacing-sm)] ds:flex ds:justify-end",
|
|
205
206
|
children: /* @__PURE__ */ t(
|
|
206
|
-
|
|
207
|
+
q,
|
|
207
208
|
{
|
|
208
209
|
ref: I,
|
|
209
210
|
href: y,
|
|
210
|
-
onClick:
|
|
211
|
+
onClick: K,
|
|
211
212
|
weight: "strong",
|
|
212
213
|
className: "type-body-sm",
|
|
213
|
-
children:
|
|
214
|
+
children: A ?? m("infoTip.learnMore", "Learn more")
|
|
214
215
|
}
|
|
215
216
|
)
|
|
216
217
|
}
|
|
@@ -221,9 +222,9 @@ const Q = {
|
|
|
221
222
|
] });
|
|
222
223
|
}
|
|
223
224
|
);
|
|
224
|
-
|
|
225
|
+
X.displayName = "InfoTip";
|
|
225
226
|
export {
|
|
226
|
-
|
|
227
|
-
|
|
227
|
+
X as I,
|
|
228
|
+
U as i
|
|
228
229
|
};
|
|
229
|
-
//# sourceMappingURL=info-tip-
|
|
230
|
+
//# sourceMappingURL=info-tip-1Xsq9GLi.js.map
|
package/dist/agent-catalog.json
CHANGED
|
@@ -10,10 +10,17 @@ export interface InfoTipProps {
|
|
|
10
10
|
/** Optional heading rendered above the body. */
|
|
11
11
|
heading?: ReactNode;
|
|
12
12
|
/**
|
|
13
|
-
* Trigger diameter. Also
|
|
14
|
-
* `sm` → `--popover-size-sm`, `md` → `--popover-size-md`.
|
|
13
|
+
* Trigger diameter. Also sets the floating card width unless `cardSize`
|
|
14
|
+
* is given: `sm` → `--popover-size-sm`, `md` → `--popover-size-md`.
|
|
15
15
|
*/
|
|
16
16
|
size?: 'sm' | 'md';
|
|
17
|
+
/**
|
|
18
|
+
* Width of the floating card, when it should differ from the trigger size:
|
|
19
|
+
* `sm` → `--popover-size-sm`, `md` → `--popover-size-md`, `lg` →
|
|
20
|
+
* `--popover-size-lg`. Defaults to the width that matches `size`, so a
|
|
21
|
+
* small trigger can open a wider card for a longer explanation.
|
|
22
|
+
*/
|
|
23
|
+
cardSize?: 'sm' | 'md' | 'lg';
|
|
17
24
|
/** Logical side the card opens on. Default `'top'`. */
|
|
18
25
|
side?: 'start' | 'top' | 'end' | 'bottom';
|
|
19
26
|
/** Alignment along the side axis. Default `'center'`. */
|
package/dist/index.js
CHANGED
|
@@ -158,7 +158,7 @@ import { E as Um } from "./_chunks/error-boundary-tAn_GuCu.js";
|
|
|
158
158
|
import { E as Km } from "./_chunks/error-summary-mGxIyDAY.js";
|
|
159
159
|
import { F as Xm } from "./_chunks/finished-terminal-DXVAfhRr.js";
|
|
160
160
|
import { H as zm, h as jm, u as Qm } from "./_chunks/hover-card-CuRIA4wN.js";
|
|
161
|
-
import { I as Jm, i as $m } from "./_chunks/info-tip-
|
|
161
|
+
import { I as Jm, i as $m } from "./_chunks/info-tip-1Xsq9GLi.js";
|
|
162
162
|
import { L as el } from "./_chunks/live-region-C41SO3cA.js";
|
|
163
163
|
import { M as rl } from "./_chunks/matrix-rain-sDOUUwZp.js";
|
|
164
164
|
import { M as tl } from "./_chunks/message-card-BzJEITml.js";
|
package/package.json
CHANGED