@agentero/design-system 0.27.1 → 0.28.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.
Files changed (42) hide show
  1. package/lib/index.d.ts +1 -0
  2. package/lib/index.js +2 -1
  3. package/lib/merge-props.d.ts +42 -0
  4. package/lib/merge-props.js +24 -0
  5. package/mcp/manifests/components.html +796 -71
  6. package/mcp/manifests/components.json +500 -9
  7. package/package.json +10 -1
  8. package/src/alert/alert.js +28 -28
  9. package/src/avatar/avatar.js +22 -22
  10. package/src/avatar-group/avatar-group.js +6 -6
  11. package/src/button/button.js +7 -7
  12. package/src/data-table/data-table.js +36 -36
  13. package/src/field/context.d.ts +62 -0
  14. package/src/field/context.js +6 -0
  15. package/src/field/field.d.ts +214 -0
  16. package/src/field/field.js +129 -0
  17. package/src/field/icons.d.ts +9 -0
  18. package/src/field/icons.js +14 -0
  19. package/src/field/index.d.ts +30 -0
  20. package/src/field/index.js +13 -0
  21. package/src/field-text/field-text.d.ts +28 -0
  22. package/src/field-text/field-text.js +26 -0
  23. package/src/field-text/index.d.ts +2 -0
  24. package/src/field-text/index.js +2 -0
  25. package/src/input/context.d.ts +17 -0
  26. package/src/input/context.js +10 -0
  27. package/src/input/index.d.ts +1 -0
  28. package/src/input/index.js +3 -2
  29. package/src/input/input.d.ts +7 -7
  30. package/src/input/input.js +16 -11
  31. package/src/label/context.d.ts +13 -0
  32. package/src/label/context.js +7 -0
  33. package/src/label/index.d.ts +1 -0
  34. package/src/label/index.js +3 -2
  35. package/src/label/label.d.ts +6 -1
  36. package/src/label/label.js +19 -17
  37. package/src/modal/modal.js +23 -23
  38. package/src/progress/progress.js +9 -9
  39. package/src/switch/switch.js +7 -7
  40. package/src/table/table.js +28 -28
  41. package/src/tabs/tabs.js +26 -26
  42. package/src/tag/tag.js +7 -7
@@ -3,8 +3,8 @@ import { cn as e } from "../../lib/utils.js";
3
3
  import { Button as t } from "../button/button.js";
4
4
  import { IconCheckCircle as n, IconClose as r, IconErrorOutline as i, IconInfoOutline as a, IconStar as o, IconWarning as s } from "./icons.js";
5
5
  import { tv as c } from "tailwind-variants";
6
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
7
- import { Children as d, createContext as f, isValidElement as p, use as m, useId as h } from "react";
6
+ import { Children as l, createContext as u, isValidElement as d, use as f, useId as p } from "react";
7
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
8
8
  //#region src/alert/alert.tsx
9
9
  var g = c({
10
10
  slots: {
@@ -193,8 +193,8 @@ var g = c({
193
193
  size: "sm",
194
194
  ghost: !1
195
195
  }
196
- }), _ = f(null), v = () => {
197
- let e = m(_);
196
+ }), _ = u(null), v = () => {
197
+ let e = f(_);
198
198
  if (!e) throw Error("useAlert must be used within an Alert");
199
199
  return e;
200
200
  }, y = {
@@ -208,7 +208,7 @@ var g = c({
208
208
  playful: a
209
209
  }, b = ({ className: t, children: n, ...r }) => {
210
210
  let { slotsStyles: i, titleId: a } = v();
211
- return /* @__PURE__ */ l("h3", {
211
+ return /* @__PURE__ */ m("h3", {
212
212
  id: a,
213
213
  "data-slot": "alert-title",
214
214
  ...r,
@@ -217,7 +217,7 @@ var g = c({
217
217
  });
218
218
  }, x = ({ className: t, children: n, ...r }) => {
219
219
  let { slotsStyles: i } = v();
220
- return /* @__PURE__ */ l("p", {
220
+ return /* @__PURE__ */ m("p", {
221
221
  "data-slot": "alert-paragraph",
222
222
  ...r,
223
223
  className: e(i.paragraph(), t),
@@ -225,7 +225,7 @@ var g = c({
225
225
  });
226
226
  }, S = ({ html: t, className: n, ...r }) => {
227
227
  let { slotsStyles: i } = v();
228
- return /* @__PURE__ */ l("div", {
228
+ return /* @__PURE__ */ m("div", {
229
229
  "data-slot": "alert-paragraph",
230
230
  ...r,
231
231
  className: e(i.paragraph(), n),
@@ -233,71 +233,71 @@ var g = c({
233
233
  });
234
234
  }, C = ({ className: t, children: n, ...r }) => {
235
235
  let { slotsStyles: i } = v();
236
- return /* @__PURE__ */ l("div", {
236
+ return /* @__PURE__ */ m("div", {
237
237
  "data-slot": "alert-content",
238
238
  ...r,
239
239
  className: e(i.content(), t),
240
240
  children: n
241
241
  });
242
- }, w = ({ className: t, children: n, ...r }) => /* @__PURE__ */ l("div", {
242
+ }, w = ({ className: t, children: n, ...r }) => /* @__PURE__ */ m("div", {
243
243
  "data-slot": "alert-actions",
244
244
  ...r,
245
245
  className: e("ml-auto flex flex-col items-center justify-center gap-2", t),
246
246
  children: n
247
- }), T = ({ className: t, children: n, ...r }) => /* @__PURE__ */ l("div", {
247
+ }), T = ({ className: t, children: n, ...r }) => /* @__PURE__ */ m("div", {
248
248
  ...r,
249
249
  className: e("[&_svg]:h-16! [&_svg]:w-16!", t),
250
250
  children: n
251
- }), E = ({ className: n, ...r }) => /* @__PURE__ */ l(t, {
251
+ }), E = ({ className: n, ...r }) => /* @__PURE__ */ m(t, {
252
252
  variant: "link",
253
253
  className: e("text-current", n),
254
254
  ...r
255
- }), D = (e, t) => d.toArray(e).some((e) => {
256
- if (!p(e)) return !1;
255
+ }), D = (e, t) => l.toArray(e).some((e) => {
256
+ if (!d(e)) return !1;
257
257
  if (e.type === t) return !0;
258
258
  let n = e.props.children;
259
259
  return n ? D(n, t) : !1;
260
- }), O = ({ children: n, onDismiss: i, hasIcon: a = !0, icon: o, color: s = "neutral", size: c = "sm", ghost: d = !1, className: f, ...p }) => {
261
- let m = g({
260
+ }), O = ({ children: n, onDismiss: i, hasIcon: a = !0, icon: o, color: s = "neutral", size: c = "sm", ghost: l = !1, className: u, ...d }) => {
261
+ let f = g({
262
262
  color: s,
263
263
  size: c,
264
- ghost: d
265
- }), v = h(), C = `${v}-title`, w = `${v}-desc`, T = D(n, b), E = D(n, x) || D(n, S), O = o ?? y[s], k = o ? !0 : a;
266
- return /* @__PURE__ */ l(_, {
264
+ ghost: l
265
+ }), v = p(), C = `${v}-title`, w = `${v}-desc`, T = D(n, b), E = D(n, x) || D(n, S), O = o ?? y[s], k = o ? !0 : a;
266
+ return /* @__PURE__ */ m(_, {
267
267
  value: {
268
268
  size: c,
269
- slotsStyles: m,
269
+ slotsStyles: f,
270
270
  titleId: C,
271
271
  descId: w
272
272
  },
273
- children: /* @__PURE__ */ u("div", {
273
+ children: /* @__PURE__ */ h("div", {
274
274
  role: "alert",
275
275
  "aria-labelledby": T ? C : void 0,
276
276
  "aria-describedby": E ? w : void 0,
277
277
  "data-slot": "alert-root",
278
- ...p,
279
- className: e(m.root(), f),
278
+ ...d,
279
+ className: e(f.root(), u),
280
280
  children: [
281
- i && /* @__PURE__ */ l("div", {
281
+ i && /* @__PURE__ */ m("div", {
282
282
  className: e("order-last ml-auto self-center", {
283
283
  "pl-2.5": c === "sm",
284
284
  "pl-0.5": c === "md"
285
285
  }),
286
- children: /* @__PURE__ */ l(t, {
286
+ children: /* @__PURE__ */ m(t, {
287
287
  variant: "ghost",
288
288
  size: c,
289
289
  iconOnly: !0,
290
290
  "aria-label": "Dismiss",
291
291
  className: "text-current",
292
292
  onClick: i,
293
- children: /* @__PURE__ */ l(r, { className: "[&_path]:fill-current" })
293
+ children: /* @__PURE__ */ m(r, { className: "[&_path]:fill-current" })
294
294
  })
295
295
  }),
296
- k && /* @__PURE__ */ l(O, {
297
- className: m.icon(),
296
+ k && /* @__PURE__ */ m(O, {
297
+ className: f.icon(),
298
298
  "data-slot": "alert-icon"
299
299
  }),
300
- /* @__PURE__ */ l("div", {
300
+ /* @__PURE__ */ m("div", {
301
301
  id: w,
302
302
  className: "flex w-full items-center gap-10",
303
303
  children: n
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { cn as e } from "../../lib/utils.js";
3
3
  import { tv as t } from "tailwind-variants";
4
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
5
- import { createContext as i, use as a } from "react";
4
+ import { createContext as n, use as r } from "react";
5
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
6
  import * as o from "@radix-ui/react-avatar";
7
7
  //#region src/avatar/avatar.tsx
8
8
  var s = t({
@@ -126,43 +126,43 @@ var s = t({
126
126
  variant: "circle",
127
127
  type: "photo"
128
128
  }
129
- }), c = i(null), l = () => {
130
- let e = a(c);
129
+ }), c = n(null), l = () => {
130
+ let e = r(c);
131
131
  if (!e) throw Error("useAvatar must be used within an AvatarProvider");
132
132
  return e;
133
- }, u = ({ size: t, variant: r, type: i, ...a }) => {
133
+ }, u = ({ size: t, variant: n, type: r, ...a }) => {
134
134
  let l = s({
135
135
  size: t,
136
- variant: r,
137
- type: i
136
+ variant: n,
137
+ type: r
138
138
  });
139
- return /* @__PURE__ */ n(c, {
139
+ return /* @__PURE__ */ i(c, {
140
140
  value: {
141
141
  size: t,
142
- variant: r,
143
- type: i,
142
+ variant: n,
143
+ type: r,
144
144
  slotsStyles: l
145
145
  },
146
- children: /* @__PURE__ */ n(o.Root, {
146
+ children: /* @__PURE__ */ i(o.Root, {
147
147
  ...a,
148
148
  className: e(l.root(), a.className)
149
149
  })
150
150
  });
151
151
  }, d = (t) => {
152
- let { slotsStyles: r } = l();
153
- return /* @__PURE__ */ n(o.Image, {
152
+ let { slotsStyles: n } = l();
153
+ return /* @__PURE__ */ i(o.Image, {
154
154
  ...t,
155
- className: e(r.image(), t.className)
155
+ className: e(n.image(), t.className)
156
156
  });
157
157
  }, f = (t) => {
158
- let { slotsStyles: r } = l();
159
- return /* @__PURE__ */ n(o.Fallback, {
158
+ let { slotsStyles: n } = l();
159
+ return /* @__PURE__ */ i(o.Fallback, {
160
160
  ...t,
161
- className: e(r.fallback(), t.className)
161
+ className: e(n.fallback(), t.className)
162
162
  });
163
- }, p = ({ alt: e, src: t, fallback: i, colorize: a, size: o, variant: s, type: c, ref: l, ...p }) => {
164
- let m = a ? g(a) : void 0;
165
- return /* @__PURE__ */ r(u, {
163
+ }, p = ({ alt: e, src: t, fallback: n, colorize: r, size: o, variant: s, type: c, ref: l, ...p }) => {
164
+ let m = r ? g(r) : void 0;
165
+ return /* @__PURE__ */ a(u, {
166
166
  ...p,
167
167
  ref: l,
168
168
  size: o,
@@ -172,10 +172,10 @@ var s = t({
172
172
  ...m,
173
173
  ...p.style
174
174
  },
175
- children: [/* @__PURE__ */ n(d, {
175
+ children: [/* @__PURE__ */ i(d, {
176
176
  alt: e,
177
177
  src: t
178
- }), /* @__PURE__ */ n(f, { children: i })]
178
+ }), /* @__PURE__ */ i(f, { children: n })]
179
179
  });
180
180
  }, m = [
181
181
  {
@@ -1,8 +1,8 @@
1
1
  import { cn as e } from "../../lib/utils.js";
2
2
  import { Avatar as t } from "../avatar/avatar.js";
3
3
  import { tv as n } from "tailwind-variants";
4
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
- import { Children as a, cloneElement as o, isValidElement as s } from "react";
4
+ import { Children as r, cloneElement as i, isValidElement as a } from "react";
5
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
6
6
  //#region src/avatar-group/avatar-group.tsx
7
7
  var c = n({
8
8
  slots: {
@@ -21,17 +21,17 @@ var c = n({
21
21
  } },
22
22
  defaultVariants: { size: "md" }
23
23
  }), l = ({ children: n, max: l = 3, size: u = "md", variant: d, className: f, ref: p, ...m }) => {
24
- let h = c({ size: u }), g = h.item(), _ = a.toArray(n).filter(s), v = _.slice(0, Math.max(0, l)), y = _.length - v.length;
25
- return /* @__PURE__ */ i("div", {
24
+ let h = c({ size: u }), g = h.item(), _ = r.toArray(n).filter(a), v = _.slice(0, Math.max(0, l)), y = _.length - v.length;
25
+ return /* @__PURE__ */ s("div", {
26
26
  ref: p,
27
27
  "data-slot": "avatar-group",
28
28
  ...m,
29
29
  className: e(h.root(), f),
30
- children: [v.map((t) => o(t, {
30
+ children: [v.map((t) => i(t, {
31
31
  size: u,
32
32
  variant: d,
33
33
  className: e(g, t.props.className)
34
- })), y > 0 && /* @__PURE__ */ r(t, {
34
+ })), y > 0 && /* @__PURE__ */ o(t, {
35
35
  "data-slot": "avatar-group-overflow",
36
36
  size: u,
37
37
  variant: d,
@@ -1,7 +1,7 @@
1
1
  import { cn as e } from "../../lib/utils.js";
2
2
  import { tv as t } from "tailwind-variants";
3
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
- import { Children as i, isValidElement as a } from "react";
3
+ import { Children as n, isValidElement as r } from "react";
4
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
5
  import { Slot as o, Slottable as s } from "@radix-ui/react-slot";
6
6
  //#region src/button/button.tsx
7
7
  var c = t({
@@ -242,13 +242,13 @@ var c = t({
242
242
  size: "sm",
243
243
  align: "center"
244
244
  }
245
- }), l = () => /* @__PURE__ */ n("span", {
245
+ }), l = () => /* @__PURE__ */ i("span", {
246
246
  "aria-label": "loading",
247
247
  role: "status",
248
248
  className: e("absolute inset-0 grid place-items-center", "rounded-[inherit] bg-inherit", "before:content-[\"\"] before:block before:size-[1em]", "before:border-2 before:border-solid before:rounded-full", "before:border-current before:border-t-transparent", "before:animate-spin before:[animation-duration:0.5s]")
249
249
  }), u = ({ children: t, asChild: u, variant: d, size: f, status: p, loading: m, rounded: h, align: g, fitContent: _, disabled: v, iconOnly: y, ref: b, className: x, ...S }) => {
250
- let C = u ? !!y : i.toArray(t).every((e) => a(e)), w = v || m;
251
- process.env.NODE_ENV !== "production" && (m && d === "link" && console.warn("Button with variant link and loading is not supported"), C && d === "link" && console.warn("Button with no text and variant link is not supported. Use it with variant tertiary instead"), u && y && a(t) && i.toArray(t.props.children).some((e) => !a(e)) && console.warn("Button with asChild and iconOnly should only contain icon children; text found inside the wrapper element"));
250
+ let C = u ? !!y : n.toArray(t).every((e) => r(e)), w = v || m;
251
+ process.env.NODE_ENV !== "production" && (m && d === "link" && console.warn("Button with variant link and loading is not supported"), C && d === "link" && console.warn("Button with no text and variant link is not supported. Use it with variant tertiary instead"), u && y && r(t) && n.toArray(t.props.children).some((e) => !r(e)) && console.warn("Button with asChild and iconOnly should only contain icon children; text found inside the wrapper element"));
252
252
  let T = e(c({
253
253
  variant: d,
254
254
  size: f,
@@ -259,7 +259,7 @@ var c = t({
259
259
  align: g,
260
260
  fitContent: _
261
261
  }), x);
262
- return /* @__PURE__ */ r(u ? o : "button", {
262
+ return /* @__PURE__ */ a(u ? o : "button", {
263
263
  "data-slot": "button",
264
264
  ...u ? {
265
265
  "aria-disabled": w || void 0,
@@ -268,7 +268,7 @@ var c = t({
268
268
  ...S,
269
269
  className: T,
270
270
  ref: b,
271
- children: [m && /* @__PURE__ */ n(l, {}), u ? /* @__PURE__ */ n(s, { children: t }) : t]
271
+ children: [m && /* @__PURE__ */ i(l, {}), u ? /* @__PURE__ */ i(s, { children: t }) : t]
272
272
  });
273
273
  };
274
274
  //#endregion
@@ -4,34 +4,34 @@ import { Pagination as t } from "../pagination/pagination.js";
4
4
  import { Table as n } from "../table/index.js";
5
5
  import { IconArrowUpward as r, IconSwapVert as i } from "./icons.js";
6
6
  import { tv as a } from "tailwind-variants";
7
- import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
8
- import { Fragment as l, createContext as u, use as d, useRef as f } from "react";
7
+ import { Fragment as o, createContext as s, use as c, useRef as l } from "react";
8
+ import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
9
9
  import { flexRender as p, getCoreRowModel as m, useReactTable as h } from "@tanstack/react-table";
10
10
  //#region src/data-table/data-table.tsx
11
- var g = u(null), _ = () => {
12
- let e = d(g);
11
+ var g = s(null), _ = () => {
12
+ let e = c(g);
13
13
  if (!e) throw Error("useDataTable must be used within a DataTable.Root");
14
14
  return e;
15
- }, v = ({ children: e, isLoading: t = !1, onRowClick: n, rowHref: r, linkComponent: i = "a", ...a }) => /* @__PURE__ */ s(g, {
15
+ }, v = ({ children: e, isLoading: t = !1, onRowClick: n, rowHref: r, linkComponent: i = "a", ...a }) => /* @__PURE__ */ d(g, {
16
16
  value: {
17
17
  table: h({
18
18
  ...a,
19
19
  getCoreRowModel: m()
20
20
  }),
21
21
  isLoading: t,
22
- scrollRef: f(null),
22
+ scrollRef: l(null),
23
23
  onRowClick: n,
24
24
  rowHref: r,
25
25
  linkComponent: i
26
26
  },
27
- children: /* @__PURE__ */ s("div", {
27
+ children: /* @__PURE__ */ d("div", {
28
28
  "data-slot": "data-table-root",
29
29
  className: "flex min-h-0 flex-1 flex-col",
30
30
  children: e
31
31
  })
32
32
  });
33
33
  v.displayName = "DataTable.Root";
34
- var y = ({ children: e }) => /* @__PURE__ */ s("div", {
34
+ var y = ({ children: e }) => /* @__PURE__ */ d("div", {
35
35
  "data-slot": "data-table-toolbar",
36
36
  role: "toolbar",
37
37
  className: "flex gap-2 border-b border-border-default-base-primary px-4 py-3",
@@ -57,54 +57,54 @@ var b = a({
57
57
  left: "justify-start"
58
58
  }
59
59
  }
60
- }), S = (e) => !!e.closest("a, button, [role=\"menu\"]"), C = ({ children: t = /* @__PURE__ */ s(w, {}), size: a = "md", sticky: u = "header", embed: d = !0, enclosed: f = !1 }) => {
60
+ }), S = (e) => !!e.closest("a, button, [role=\"menu\"]"), C = ({ children: t = /* @__PURE__ */ d(w, {}), size: a = "md", sticky: s = "header", embed: c = !0, enclosed: l = !1 }) => {
61
61
  let { table: m, isLoading: h, scrollRef: g, onRowClick: v, rowHref: y, linkComponent: C } = _(), T = m.getAllColumns().length;
62
- return /* @__PURE__ */ s("div", {
62
+ return /* @__PURE__ */ d("div", {
63
63
  "data-slot": "data-table-loading-overlay",
64
64
  className: e("flex min-h-0 flex-1 flex-col transition-opacity duration-150", h && "opacity-50"),
65
- children: /* @__PURE__ */ c(n.Root, {
65
+ children: /* @__PURE__ */ f(n.Root, {
66
66
  size: a,
67
- sticky: u,
68
- embed: d,
69
- enclosed: f,
67
+ sticky: s,
68
+ embed: c,
69
+ enclosed: l,
70
70
  ref: g,
71
- children: [/* @__PURE__ */ s(n.Head, { children: m.getHeaderGroups().map((e) => /* @__PURE__ */ s(n.Row, { children: e.headers.map((e) => {
72
- let t = e.column.columnDef.meta, a = e.column.getCanSort(), l = e.column.getIsSorted(), u = t?.style?.textAlign === "right" || t?.className?.includes("text-right") ? "right" : "left", d = e.isPlaceholder ? null : /* @__PURE__ */ c(o, { children: [p(e.column.columnDef.header, e.getContext()), a && /* @__PURE__ */ s("span", {
71
+ children: [/* @__PURE__ */ d(n.Head, { children: m.getHeaderGroups().map((e) => /* @__PURE__ */ d(n.Row, { children: e.headers.map((e) => {
72
+ let t = e.column.columnDef.meta, a = e.column.getCanSort(), o = e.column.getIsSorted(), s = t?.style?.textAlign === "right" || t?.className?.includes("text-right") ? "right" : "left", c = e.isPlaceholder ? null : /* @__PURE__ */ f(u, { children: [p(e.column.columnDef.header, e.getContext()), a && /* @__PURE__ */ d("span", {
73
73
  className: "size-4",
74
- children: l ? /* @__PURE__ */ s(r, { className: b({ direction: l }) }) : /* @__PURE__ */ s(i, { className: "size-4" })
74
+ children: o ? /* @__PURE__ */ d(r, { className: b({ direction: o }) }) : /* @__PURE__ */ d(i, { className: "size-4" })
75
75
  })] });
76
- return /* @__PURE__ */ s(n.Header, {
76
+ return /* @__PURE__ */ d(n.Header, {
77
77
  ...t,
78
- "aria-sort": a ? l === "asc" ? "ascending" : l === "desc" ? "descending" : "none" : void 0,
79
- children: a ? /* @__PURE__ */ s("button", {
78
+ "aria-sort": a ? o === "asc" ? "ascending" : o === "desc" ? "descending" : "none" : void 0,
79
+ children: a ? /* @__PURE__ */ d("button", {
80
80
  type: "button",
81
81
  className: x({
82
82
  canSort: !0,
83
- align: u
83
+ align: s
84
84
  }),
85
85
  onClick: e.column.getToggleSortingHandler(),
86
86
  title: e.column.getNextSortingOrder() === "asc" ? "Sort ascending" : e.column.getNextSortingOrder() === "desc" ? "Sort descending" : "Clear sort",
87
- children: d
88
- }) : /* @__PURE__ */ s("div", {
87
+ children: c
88
+ }) : /* @__PURE__ */ d("div", {
89
89
  className: x({
90
90
  canSort: !1,
91
- align: u
91
+ align: s
92
92
  }),
93
- children: d
93
+ children: c
94
94
  })
95
95
  }, e.id);
96
- }) }, e.id)) }), /* @__PURE__ */ s(n.Body, { children: m.getRowModel().rows.length ? m.getRowModel().rows.map((t) => {
96
+ }) }, e.id)) }), /* @__PURE__ */ d(n.Body, { children: m.getRowModel().rows.length ? m.getRowModel().rows.map((t) => {
97
97
  let r = y?.(t.original), i = !!v || !!r;
98
- return /* @__PURE__ */ s(l, { children: /* @__PURE__ */ s(n.Row, {
98
+ return /* @__PURE__ */ d(o, { children: /* @__PURE__ */ d(n.Row, {
99
99
  className: e("has-aria-expanded:bg-bg-default-base-secondary", i && "cursor-pointer"),
100
100
  onClick: i ? (e) => {
101
101
  S(e.target) || !e.currentTarget.contains(e.target) || (v ? v(t.original) : r && e.currentTarget.querySelector("[data-row-link]")?.click());
102
102
  } : void 0,
103
103
  children: t.getVisibleCells().map((e, t) => {
104
104
  let i = e.column.columnDef.meta;
105
- return /* @__PURE__ */ c(n.Cell, {
105
+ return /* @__PURE__ */ f(n.Cell, {
106
106
  ...i,
107
- children: [t === 0 && r && /* @__PURE__ */ s(C, {
107
+ children: [t === 0 && r && /* @__PURE__ */ d(C, {
108
108
  href: r,
109
109
  "data-row-link": !0,
110
110
  className: "hidden",
@@ -114,9 +114,9 @@ var b = a({
114
114
  }, e.id);
115
115
  })
116
116
  }) }, t.id);
117
- }) : h ? null : /* @__PURE__ */ s(n.Row, { children: /* @__PURE__ */ s(n.Cell, {
117
+ }) : h ? null : /* @__PURE__ */ d(n.Row, { children: /* @__PURE__ */ d(n.Cell, {
118
118
  colSpan: T,
119
- children: /* @__PURE__ */ s("div", {
119
+ children: /* @__PURE__ */ d("div", {
120
120
  "data-slot": "table-empty-state",
121
121
  className: "whitespace-normal",
122
122
  children: t
@@ -126,13 +126,13 @@ var b = a({
126
126
  });
127
127
  };
128
128
  C.displayName = "DataTable.Table";
129
- var w = () => /* @__PURE__ */ s("div", {
129
+ var w = () => /* @__PURE__ */ d("div", {
130
130
  className: "mb-6 flex flex-col items-center gap-4",
131
- children: /* @__PURE__ */ s("div", {
131
+ children: /* @__PURE__ */ d("div", {
132
132
  className: "text-lg",
133
- children: /* @__PURE__ */ s("b", { children: "No results." })
133
+ children: /* @__PURE__ */ d("b", { children: "No results." })
134
134
  })
135
- }), T = ({ children: e }) => /* @__PURE__ */ s("div", {
135
+ }), T = ({ children: e }) => /* @__PURE__ */ d("div", {
136
136
  "data-slot": "data-table-pagination",
137
137
  className: "flex justify-end border-t border-border-default-base-primary px-6 py-3",
138
138
  children: e
@@ -140,7 +140,7 @@ var w = () => /* @__PURE__ */ s("div", {
140
140
  T.displayName = "DataTable.Footer";
141
141
  var E = (e) => {
142
142
  let { scrollRef: n } = _();
143
- return /* @__PURE__ */ s(t, {
143
+ return /* @__PURE__ */ d(t, {
144
144
  ...e,
145
145
  onPageChange: (t) => {
146
146
  n.current?.scrollTo({ top: 0 }), e.onPageChange(t);
@@ -0,0 +1,62 @@
1
+ import { ComponentPropsWithRef, ReactNode } from 'react';
2
+ /** A validation error. Structurally matches a react-hook-form `FieldError`. */
3
+ export type FieldErrorLike = {
4
+ message?: string;
5
+ } | undefined;
6
+ /**
7
+ * State of the surrounding `Field.Root`, shared with the Field family
8
+ * (`Field.Description`, `Field.Error`) and with controls that have no context
9
+ * of their own and connect themselves by hand.
10
+ */
11
+ export type FieldContextValue = {
12
+ /** `id` the control must carry so the label points at it. */
13
+ controlId: string;
14
+ /** `id` the `Field.Description` takes by default. One description per field. */
15
+ descriptionId: string;
16
+ /** `id` the `Field.Error` takes by default. One error element per field. */
17
+ errorId: string;
18
+ /**
19
+ * Ids of the messages currently rendered, ready for the control's
20
+ * `aria-describedby`. `undefined` while there is none, so the attribute is
21
+ * not rendered and never points at an element that does not exist.
22
+ */
23
+ describedBy: string | undefined;
24
+ /**
25
+ * Adds a message element to `describedBy` and returns the function that
26
+ * removes it. `Field.Description` and `Field.Error` call it from a layout
27
+ * effect; a custom message element can do the same.
28
+ */
29
+ registerMessage: (id: string) => () => void;
30
+ invalid: boolean;
31
+ disabled: boolean;
32
+ readOnly: boolean;
33
+ required: boolean;
34
+ /**
35
+ * Errors a bare `<Field.Error />` renders. `Field.Root` leaves it unset; a
36
+ * form adapter re-provides the context with the field's validation errors.
37
+ */
38
+ errors?: FieldErrorLike[];
39
+ };
40
+ export declare const FieldContext: import('react').Context<FieldContextValue | null>;
41
+ /**
42
+ * Reads the surrounding `Field.Root`. Returns `null` outside a field, so a part
43
+ * or a control can read it and still work standalone. Reach for it in a control
44
+ * that has no context of its own; the design system's controls read theirs.
45
+ *
46
+ * @example
47
+ * const field = useFieldContext();
48
+ * <input id={field?.controlId} aria-describedby={field?.describedBy} aria-invalid={field?.invalid || undefined} />
49
+ */
50
+ export declare const useFieldContext: () => FieldContextValue | null;
51
+ /** Props of `Field.Description`: a `<p>`. One per field. */
52
+ export type FieldDescriptionProps = ComponentPropsWithRef<'p'>;
53
+ export type FieldErrorProps = Omit<ComponentPropsWithRef<'div'>, 'children'> & {
54
+ /** Message to render. Takes precedence over `errors`. */
55
+ children?: ReactNode;
56
+ /**
57
+ * Errors to render, de-duplicated by message: one line for a single error, a
58
+ * bulleted list for several. Shaped to take a form library's error objects as
59
+ * they come. Falls back to the `errors` in `FieldContext`.
60
+ */
61
+ errors?: FieldErrorLike[];
62
+ };
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { createContext as e, use as t } from "react";
3
+ //#region src/field/context.ts
4
+ var n = e(null), r = () => t(n);
5
+ //#endregion
6
+ export { n as FieldContext, r as useFieldContext };