@altimateai/ui-components 0.0.29 → 0.0.31-beta.1

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/Stack.js CHANGED
@@ -245,7 +245,7 @@ const I = (e) => {
245
245
  // I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
246
246
  $s.test(e) && !Ws.test(e)
247
247
  ), Jn = () => !1, Zs = (e) => Vs.test(e), Qs = (e) => Bs.test(e), Js = () => {
248
- const e = I("colors"), t = I("spacing"), n = I("blur"), r = I("brightness"), o = I("borderColor"), s = I("borderRadius"), a = I("borderSpacing"), i = I("borderWidth"), c = I("contrast"), u = I("grayscale"), d = I("hueRotate"), f = I("invert"), h = I("gap"), m = I("gradientColorStops"), v = I("gradientColorStopPositions"), p = I("inset"), b = I("margin"), y = I("opacity"), x = I("padding"), C = I("saturate"), w = I("scale"), E = I("sepia"), P = I("skew"), R = I("space"), S = I("translate"), M = () => ["auto", "contain", "none"], D = () => ["auto", "hidden", "clip", "visible", "scroll"], L = () => ["auto", N, t], A = () => [N, t], _ = () => ["", ne, ie], j = () => ["auto", Ee, N], z = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"], T = () => ["solid", "dashed", "dotted", "double", "none"], V = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], O = () => ["start", "end", "center", "between", "around", "evenly", "stretch"], W = () => ["", "0", N], U = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], H = () => [Ee, N];
248
+ const e = I("colors"), t = I("spacing"), n = I("blur"), r = I("brightness"), o = I("borderColor"), s = I("borderRadius"), a = I("borderSpacing"), i = I("borderWidth"), c = I("contrast"), u = I("grayscale"), d = I("hueRotate"), f = I("invert"), h = I("gap"), m = I("gradientColorStops"), v = I("gradientColorStopPositions"), p = I("inset"), b = I("margin"), y = I("opacity"), x = I("padding"), C = I("saturate"), w = I("scale"), E = I("sepia"), P = I("skew"), R = I("space"), S = I("translate"), M = () => ["auto", "contain", "none"], D = () => ["auto", "hidden", "clip", "visible", "scroll"], F = () => ["auto", N, t], A = () => [N, t], L = () => ["", ne, ie], j = () => ["auto", Ee, N], z = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"], T = () => ["solid", "dashed", "dotted", "double", "none"], V = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], O = () => ["start", "end", "center", "between", "around", "evenly", "stretch"], W = () => ["", "0", N], U = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], H = () => [Ee, N];
249
249
  return {
250
250
  cacheSize: 500,
251
251
  separator: ":",
@@ -257,7 +257,7 @@ const I = (e) => {
257
257
  borderColor: [e],
258
258
  borderRadius: ["none", "", "full", le, N],
259
259
  borderSpacing: A(),
260
- borderWidth: _(),
260
+ borderWidth: L(),
261
261
  contrast: H(),
262
262
  grayscale: W(),
263
263
  hueRotate: H(),
@@ -265,8 +265,8 @@ const I = (e) => {
265
265
  gap: A(),
266
266
  gradientColorStops: [e],
267
267
  gradientColorStopPositions: [zs, ie],
268
- inset: L(),
269
- margin: L(),
268
+ inset: F(),
269
+ margin: F(),
270
270
  opacity: H(),
271
271
  padding: A(),
272
272
  saturate: H(),
@@ -498,7 +498,7 @@ const I = (e) => {
498
498
  * @see https://tailwindcss.com/docs/flex-basis
499
499
  */
500
500
  basis: [{
501
- basis: L()
501
+ basis: F()
502
502
  }],
503
503
  /**
504
504
  * Flex Direction
@@ -1577,7 +1577,7 @@ const I = (e) => {
1577
1577
  * @see https://tailwindcss.com/docs/ring-width
1578
1578
  */
1579
1579
  "ring-w": [{
1580
- ring: _()
1580
+ ring: L()
1581
1581
  }],
1582
1582
  /**
1583
1583
  * Ring Width Inset
@@ -2274,7 +2274,7 @@ const I = (e) => {
2274
2274
  }
2275
2275
  };
2276
2276
  }, ea = /* @__PURE__ */ Is(Js);
2277
- function F(...e) {
2277
+ function _(...e) {
2278
2278
  return ea(Bt(e));
2279
2279
  }
2280
2280
  function En(e, t) {
@@ -2404,7 +2404,7 @@ const Rn = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, Pn = Bt, t
2404
2404
  ), ua = l.forwardRef(
2405
2405
  ({ className: e, variant: t, size: n, asChild: r = !1, ...o }, s) => {
2406
2406
  const a = r ? ra : "button";
2407
- return /* @__PURE__ */ g.jsx(a, { className: F(ca({ variant: t, size: n, className: e })), ref: s, ...o });
2407
+ return /* @__PURE__ */ g.jsx(a, { className: _(ca({ variant: t, size: n, className: e })), ref: s, ...o });
2408
2408
  }
2409
2409
  );
2410
2410
  ua.displayName = "Button";
@@ -2821,7 +2821,7 @@ const cr = G(({ className: e, ...t }, n) => /* @__PURE__ */ g.jsx(
2821
2821
  lr,
2822
2822
  {
2823
2823
  ref: n,
2824
- className: F(
2824
+ className: _(
2825
2825
  "al-peer al-h-4 al-w-4 al-shrink-0 al-rounded-xs al-border al-border-primary al-ring-offset-background focus-visible:al-outline-none focus-visible:al-ring-2 focus-visible:al-ring-ring focus-visible:al-ring-offset-2 disabled:al-cursor-not-allowed disabled:al-opacity-50 data-[state=checked]:al-bg-primary data-[state=checked]:al-text-primary-foreground",
2826
2826
  e
2827
2827
  ),
@@ -2829,7 +2829,7 @@ const cr = G(({ className: e, ...t }, n) => /* @__PURE__ */ g.jsx(
2829
2829
  children: /* @__PURE__ */ g.jsx(
2830
2830
  Aa,
2831
2831
  {
2832
- className: F("al-flex al-items-center al-justify-center al-text-current"),
2832
+ className: _("al-flex al-items-center al-justify-center al-text-current"),
2833
2833
  children: /* @__PURE__ */ g.jsx(
2834
2834
  "svg",
2835
2835
  {
@@ -3009,7 +3009,7 @@ var Va = l.forwardRef((e, t) => {
3009
3009
  if (S.target === S.currentTarget && M && !y) {
3010
3010
  const D = new CustomEvent(ht, _a);
3011
3011
  if (S.currentTarget.dispatchEvent(D), !D.defaultPrevented) {
3012
- const L = w().filter((T) => T.focusable), A = L.find((T) => T.active), _ = L.find((T) => T.id === p), z = [A, _, ...L].filter(
3012
+ const F = w().filter((T) => T.focusable), A = F.find((T) => T.active), L = F.find((T) => T.id === p), z = [A, L, ...F].filter(
3013
3013
  Boolean
3014
3014
  ).map((T) => T.ref.current);
3015
3015
  hr(z, d);
@@ -3308,13 +3308,13 @@ var ni = "RadioGroupIndicator", Ar = l.forwardRef(
3308
3308
  );
3309
3309
  Ar.displayName = ni;
3310
3310
  var Nr = Rr, Or = Sr, ri = Ar;
3311
- const oi = G(({ className: e, ...t }, n) => /* @__PURE__ */ g.jsx(Nr, { className: F("al-grid al-gap-2", e), ...t, ref: n }));
3311
+ const oi = G(({ className: e, ...t }, n) => /* @__PURE__ */ g.jsx(Nr, { className: _("al-grid al-gap-2", e), ...t, ref: n }));
3312
3312
  oi.displayName = Nr.displayName;
3313
3313
  const Tr = G(({ className: e, ...t }, n) => /* @__PURE__ */ g.jsx(
3314
3314
  Or,
3315
3315
  {
3316
3316
  ref: n,
3317
- className: F(
3317
+ className: _(
3318
3318
  "al-aspect-square al-h-4 al-w-4 al-rounded-full al-border al-border-primary al-text-primary al-ring-offset-background focus:al-outline-none focus-visible:al-ring-2 focus-visible:al-ring-ring focus-visible:al-ring-offset-2 disabled:al-cursor-not-allowed disabled:al-opacity-50",
3319
3319
  e
3320
3320
  ),
@@ -3324,28 +3324,52 @@ const Tr = G(({ className: e, ...t }, n) => /* @__PURE__ */ g.jsx(
3324
3324
  ));
3325
3325
  Tr.displayName = Or.displayName;
3326
3326
  const si = l.forwardRef(
3327
- ({ className: e, type: t, ...n }, r) => t === "checkbox" ? /* @__PURE__ */ g.jsx(
3327
+ ({ className: e, type: t, icon: n, iconPosition: r = "left", ...o }, s) => t === "checkbox" ? /* @__PURE__ */ g.jsx(
3328
3328
  cr,
3329
3329
  {
3330
3330
  className: e,
3331
- ...n
3331
+ ...o
3332
3332
  }
3333
3333
  ) : t === "radio" ? /* @__PURE__ */ g.jsx(
3334
3334
  Tr,
3335
3335
  {
3336
3336
  className: e,
3337
- ...n
3337
+ ...o
3338
3338
  }
3339
- ) : /* @__PURE__ */ g.jsx(
3339
+ ) : n ? /* @__PURE__ */ g.jsxs("div", { className: "al-relative al-w-full", children: [
3340
+ /* @__PURE__ */ g.jsx(
3341
+ "input",
3342
+ {
3343
+ type: t,
3344
+ className: _(
3345
+ "al-flex al-h-10 al-w-full al-rounded-md al-border al-border-input al-bg-background al-py-2 al-text-base al-ring-offset-background file:al-border-0 file:al-bg-transparent file:al-text-sm file:al-font-medium file:al-text-foreground placeholder:al-text-muted-foreground focus-visible:al-outline-none focus-visible:al-ring-2 focus-visible:al-ring-ring focus-visible:al-ring-offset-2 disabled:al-cursor-not-allowed disabled:al-opacity-50 md:al-text-sm",
3346
+ r === "left" ? "al-pl-10 al-pr-3" : "al-pl-3 al-pr-10",
3347
+ e
3348
+ ),
3349
+ ref: s,
3350
+ ...o
3351
+ }
3352
+ ),
3353
+ /* @__PURE__ */ g.jsx(
3354
+ "div",
3355
+ {
3356
+ className: _(
3357
+ "al-absolute al-top-0 al-flex al-h-10 al-items-center al-pointer-events-none",
3358
+ r === "left" ? "al-left-3" : "al-right-3"
3359
+ ),
3360
+ children: /* @__PURE__ */ g.jsx(n, { size: 16, className: "al-text-muted-foreground" })
3361
+ }
3362
+ )
3363
+ ] }) : /* @__PURE__ */ g.jsx(
3340
3364
  "input",
3341
3365
  {
3342
3366
  type: t,
3343
- className: F(
3367
+ className: _(
3344
3368
  "al-flex al-h-10 al-w-full al-rounded-md al-border al-border-input al-bg-background al-px-3 al-py-2 al-text-base al-ring-offset-background file:al-border-0 file:al-bg-transparent file:al-text-sm file:al-font-medium file:al-text-foreground placeholder:al-text-muted-foreground focus-visible:al-outline-none focus-visible:al-ring-2 focus-visible:al-ring-ring focus-visible:al-ring-offset-2 disabled:al-cursor-not-allowed disabled:al-opacity-50 md:al-text-sm",
3345
3369
  e
3346
3370
  ),
3347
- ref: r,
3348
- ...n
3371
+ ref: s,
3372
+ ...o
3349
3373
  }
3350
3374
  )
3351
3375
  );
@@ -4445,14 +4469,14 @@ mo.displayName = El;
4445
4469
  var go = mo;
4446
4470
  const Rl = tr(
4447
4471
  "al-text-sm al-font-medium al-leading-none peer-disabled:al-cursor-not-allowed peer-disabled:al-opacity-70"
4448
- ), Pl = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ g.jsx(go, { ref: n, className: F(Rl(), e), ...t }));
4472
+ ), Pl = l.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ g.jsx(go, { ref: n, className: _(Rl(), e), ...t }));
4449
4473
  Pl.displayName = go.displayName;
4450
4474
  const Sl = G(
4451
4475
  ({ className: e, ...t }, n) => /* @__PURE__ */ g.jsx(
4452
4476
  "div",
4453
4477
  {
4454
4478
  ref: n,
4455
- className: F(
4479
+ className: _(
4456
4480
  "al-rounded-lg al-border al-bg-card al-text-card-foreground al-shadow-sm",
4457
4481
  e
4458
4482
  ),
@@ -4466,7 +4490,7 @@ const Al = G(
4466
4490
  "div",
4467
4491
  {
4468
4492
  ref: n,
4469
- className: F("al-flex al-flex-col al-space-y-1.5 al-p-6 al-pb-4", e),
4493
+ className: _("al-flex al-flex-col al-space-y-1.5 al-p-6 al-pb-4", e),
4470
4494
  ...t
4471
4495
  }
4472
4496
  )
@@ -4477,29 +4501,29 @@ const Nl = G(
4477
4501
  "div",
4478
4502
  {
4479
4503
  ref: n,
4480
- className: F("al-text-2xl al-font-semibold al-leading-none al-tracking-tight", e),
4504
+ className: _("al-text-2xl al-font-semibold al-leading-none al-tracking-tight", e),
4481
4505
  ...t
4482
4506
  }
4483
4507
  )
4484
4508
  );
4485
4509
  Nl.displayName = "CardTitle";
4486
4510
  const Ol = G(
4487
- ({ className: e, ...t }, n) => /* @__PURE__ */ g.jsx("div", { ref: n, className: F("al-text-sm al-text-muted-foreground", e), ...t })
4511
+ ({ className: e, ...t }, n) => /* @__PURE__ */ g.jsx("div", { ref: n, className: _("al-text-sm al-text-muted-foreground", e), ...t })
4488
4512
  );
4489
4513
  Ol.displayName = "CardDescription";
4490
4514
  const Tl = G(
4491
- ({ className: e, ...t }, n) => /* @__PURE__ */ g.jsx("div", { ref: n, className: F("al-p-6 al-pt-0", e), ...t })
4515
+ ({ className: e, ...t }, n) => /* @__PURE__ */ g.jsx("div", { ref: n, className: _("al-p-6 al-pt-0", e), ...t })
4492
4516
  );
4493
4517
  Tl.displayName = "CardContent";
4494
4518
  const kl = G(
4495
- ({ className: e, ...t }, n) => /* @__PURE__ */ g.jsx("div", { ref: n, className: F("al-flex al-items-center al-p-6 al-pt-0", e), ...t })
4519
+ ({ className: e, ...t }, n) => /* @__PURE__ */ g.jsx("div", { ref: n, className: _("al-flex al-items-center al-p-6 al-pt-0", e), ...t })
4496
4520
  );
4497
4521
  kl.displayName = "CardFooter";
4498
4522
  const Dl = l.forwardRef(
4499
4523
  ({ className: e, ...t }, n) => /* @__PURE__ */ g.jsx(
4500
4524
  "textarea",
4501
4525
  {
4502
- className: F(
4526
+ className: _(
4503
4527
  "al-flex al-min-h-[80px] al-w-full al-rounded-md al-border al-border-input al-bg-background al-px-3 al-py-2 al-text-base al-ring-offset-background placeholder:al-text-muted-foreground focus-visible:al-outline-none focus-visible:al-ring-2 focus-visible:al-ring-ring focus-visible:al-ring-offset-2 disabled:al-cursor-not-allowed disabled:al-opacity-50 md:al-text-sm",
4504
4528
  e
4505
4529
  ),
@@ -4792,7 +4816,7 @@ const Bl = (e) => ({
4792
4816
  }, m = nn(o), v = tn(m), p = await a.getDimensions(u), b = m === "y", y = b ? "top" : "left", x = b ? "bottom" : "right", C = b ? "clientHeight" : "clientWidth", w = s.reference[v] + s.reference[m] - h[m] - s.floating[v], E = h[m] - s.reference[m], P = await (a.getOffsetParent == null ? void 0 : a.getOffsetParent(u));
4793
4817
  let R = P ? P[C] : 0;
4794
4818
  (!R || !await (a.isElement == null ? void 0 : a.isElement(P))) && (R = i.floating[C] || s.floating[v]);
4795
- const S = w / 2 - E / 2, M = R / 2 - p[v] / 2 - 1, D = de(f[y], M), L = de(f[x], M), A = D, _ = R - p[v] - L, j = R / 2 - p[v] / 2 + S, z = Mt(A, j, _), T = !c.arrow && je(o) != null && j !== z && s.reference[v] / 2 - (j < A ? D : L) - p[v] / 2 < 0, V = T ? j < A ? j - A : j - _ : 0;
4819
+ const S = w / 2 - E / 2, M = R / 2 - p[v] / 2 - 1, D = de(f[y], M), F = de(f[x], M), A = D, L = R - p[v] - F, j = R / 2 - p[v] / 2 + S, z = Mt(A, j, L), T = !c.arrow && je(o) != null && j !== z && s.reference[v] / 2 - (j < A ? D : F) - p[v] / 2 < 0, V = T ? j < A ? j - A : j - L : 0;
4796
4820
  return {
4797
4821
  [m]: h[m] + V,
4798
4822
  data: {
@@ -4841,8 +4865,8 @@ const Bl = (e) => ({
4841
4865
  placement: o,
4842
4866
  overflows: M
4843
4867
  }], !M.every((j) => j <= 0)) {
4844
- var L, A;
4845
- const j = (((L = s.flip) == null ? void 0 : L.index) || 0) + 1, z = R[j];
4868
+ var F, A;
4869
+ const j = (((F = s.flip) == null ? void 0 : F.index) || 0) + 1, z = R[j];
4846
4870
  if (z)
4847
4871
  return {
4848
4872
  data: {
@@ -4857,8 +4881,8 @@ const Bl = (e) => ({
4857
4881
  if (!T)
4858
4882
  switch (m) {
4859
4883
  case "bestFit": {
4860
- var _;
4861
- const V = (_ = D.filter((O) => {
4884
+ var L;
4885
+ const V = (L = D.filter((O) => {
4862
4886
  if (P) {
4863
4887
  const W = pe(O.placement);
4864
4888
  return W === x || // Create a bias to the `y` side axis due to horizontal
@@ -4866,7 +4890,7 @@ const Bl = (e) => ({
4866
4890
  W === "y";
4867
4891
  }
4868
4892
  return !0;
4869
- }).map((O) => [O.placement, O.overflows.filter((W) => W > 0).reduce((W, U) => W + U, 0)]).sort((O, W) => O[1] - W[1])[0]) == null ? void 0 : _[0];
4893
+ }).map((O) => [O.placement, O.overflows.filter((W) => W > 0).reduce((W, U) => W + U, 0)]).sort((O, W) => O[1] - W[1])[0]) == null ? void 0 : L[0];
4870
4894
  V && (T = V);
4871
4895
  break;
4872
4896
  }
@@ -5109,8 +5133,8 @@ const Ul = function(e) {
5109
5133
  const x = p - d.top - d.bottom, C = v - d.left - d.right, w = de(p - d[b], x), E = de(v - d[y], C), P = !t.middlewareData.shift;
5110
5134
  let R = w, S = E;
5111
5135
  if ((n = t.middlewareData.shift) != null && n.enabled.x && (S = C), (r = t.middlewareData.shift) != null && r.enabled.y && (R = x), P && !h) {
5112
- const D = K(d.left, 0), L = K(d.right, 0), A = K(d.top, 0), _ = K(d.bottom, 0);
5113
- m ? S = v - 2 * (D !== 0 || L !== 0 ? D + L : K(d.left, d.right)) : R = p - 2 * (A !== 0 || _ !== 0 ? A + _ : K(d.top, d.bottom));
5136
+ const D = K(d.left, 0), F = K(d.right, 0), A = K(d.top, 0), L = K(d.bottom, 0);
5137
+ m ? S = v - 2 * (D !== 0 || F !== 0 ? D + F : K(d.left, d.right)) : R = p - 2 * (A !== 0 || L !== 0 ? A + L : K(d.top, d.bottom));
5114
5138
  }
5115
5139
  await c({
5116
5140
  ...t,
@@ -5675,7 +5699,7 @@ function wc(e) {
5675
5699
  O !== P.current && (P.current = O, p(O));
5676
5700
  }, []), C = l.useCallback((O) => {
5677
5701
  O !== R.current && (R.current = O, y(O));
5678
- }, []), w = s || v, E = a || b, P = l.useRef(null), R = l.useRef(null), S = l.useRef(d), M = c != null, D = Pt(c), L = Pt(o), A = Pt(u), _ = l.useCallback(() => {
5702
+ }, []), w = s || v, E = a || b, P = l.useRef(null), R = l.useRef(null), S = l.useRef(d), M = c != null, D = Pt(c), F = Pt(o), A = Pt(u), L = l.useCallback(() => {
5679
5703
  if (!P.current || !R.current)
5680
5704
  return;
5681
5705
  const O = {
@@ -5683,7 +5707,7 @@ function wc(e) {
5683
5707
  strategy: n,
5684
5708
  middleware: h
5685
5709
  };
5686
- L.current && (O.platform = L.current), xc(P.current, R.current, O).then((W) => {
5710
+ F.current && (O.platform = F.current), xc(P.current, R.current, O).then((W) => {
5687
5711
  const U = {
5688
5712
  ...W,
5689
5713
  // The floating element's position may be recomputed while it's closed
@@ -5696,7 +5720,7 @@ function wc(e) {
5696
5720
  f(U);
5697
5721
  }));
5698
5722
  });
5699
- }, [h, t, n, L, A]);
5723
+ }, [h, t, n, F, A]);
5700
5724
  Je(() => {
5701
5725
  u === !1 && S.current.isPositioned && (S.current.isPositioned = !1, f((O) => ({
5702
5726
  ...O,
@@ -5709,10 +5733,10 @@ function wc(e) {
5709
5733
  }), []), Je(() => {
5710
5734
  if (w && (P.current = w), E && (R.current = E), w && E) {
5711
5735
  if (D.current)
5712
- return D.current(w, E, _);
5713
- _();
5736
+ return D.current(w, E, L);
5737
+ L();
5714
5738
  }
5715
- }, [w, E, _, D, M]);
5739
+ }, [w, E, L, D, M]);
5716
5740
  const z = l.useMemo(() => ({
5717
5741
  reference: P,
5718
5742
  floating: R,
@@ -5744,11 +5768,11 @@ function wc(e) {
5744
5768
  }, [n, i, T.floating, d.x, d.y]);
5745
5769
  return l.useMemo(() => ({
5746
5770
  ...d,
5747
- update: _,
5771
+ update: L,
5748
5772
  refs: z,
5749
5773
  elements: T,
5750
5774
  floatingStyles: V
5751
- }), [d, _, z, T, V]);
5775
+ }), [d, L, z, T, V]);
5752
5776
  }
5753
5777
  const Cc = (e) => {
5754
5778
  function t(n) {
@@ -5841,9 +5865,9 @@ var ln = "PopperContent", [jc, Mc] = Po(ln), To = l.forwardRef(
5841
5865
  updatePositionStrategy: m = "optimized",
5842
5866
  onPlaced: v,
5843
5867
  ...p
5844
- } = e, b = So(ln, n), [y, x] = l.useState(null), C = B(t, (Ie) => x(Ie)), [w, E] = l.useState(null), P = Gt(w), R = (P == null ? void 0 : P.width) ?? 0, S = (P == null ? void 0 : P.height) ?? 0, M = r + (s !== "center" ? "-" + s : ""), D = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, L = Array.isArray(u) ? u : [u], A = L.length > 0, _ = {
5868
+ } = e, b = So(ln, n), [y, x] = l.useState(null), C = B(t, (Ie) => x(Ie)), [w, E] = l.useState(null), P = Gt(w), R = (P == null ? void 0 : P.width) ?? 0, S = (P == null ? void 0 : P.height) ?? 0, M = r + (s !== "center" ? "-" + s : ""), D = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, F = Array.isArray(u) ? u : [u], A = F.length > 0, L = {
5845
5869
  padding: D,
5846
- boundary: L.filter(_c),
5870
+ boundary: F.filter(_c),
5847
5871
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
5848
5872
  altBoundary: A
5849
5873
  }, { refs: j, floatingStyles: z, placement: T, isPositioned: V, middlewareData: O } = wc({
@@ -5862,11 +5886,11 @@ var ln = "PopperContent", [jc, Mc] = Po(ln), To = l.forwardRef(
5862
5886
  mainAxis: !0,
5863
5887
  crossAxis: !1,
5864
5888
  limiter: f === "partial" ? Pc() : void 0,
5865
- ..._
5889
+ ...L
5866
5890
  }),
5867
- c && Sc({ ..._ }),
5891
+ c && Sc({ ...L }),
5868
5892
  Ac({
5869
- ..._,
5893
+ ...L,
5870
5894
  apply: ({ elements: Ie, rects: xn, availableWidth: ps, availableHeight: ms }) => {
5871
5895
  const { width: gs, height: hs } = xn.reference, Ge = Ie.floating.style;
5872
5896
  Ge.setProperty("--radix-popper-available-width", `${ps}px`), Ge.setProperty("--radix-popper-available-height", `${ms}px`), Ge.setProperty("--radix-popper-anchor-width", `${gs}px`), Ge.setProperty("--radix-popper-anchor-height", `${hs}px`);
@@ -5874,7 +5898,7 @@ var ln = "PopperContent", [jc, Mc] = Po(ln), To = l.forwardRef(
5874
5898
  }),
5875
5899
  w && Oc({ element: w, padding: i }),
5876
5900
  Lc({ arrowWidth: R, arrowHeight: S }),
5877
- h && Nc({ strategy: "referenceHidden", ..._ })
5901
+ h && Nc({ strategy: "referenceHidden", ...L })
5878
5902
  ]
5879
5903
  }), [W, U] = jo(T), H = re(v);
5880
5904
  ve(() => {
@@ -6011,7 +6035,7 @@ const Hu = bl, Uu = yl, Fc = xl, Ku = po, Lo = G(({ className: e, ...t }, n) =>
6011
6035
  lo,
6012
6036
  {
6013
6037
  ref: n,
6014
- className: F(
6038
+ className: _(
6015
6039
  "al-fixed al-inset-0 al-z-50 al-bg-black/80 al- data-[state=open]:al-animate-in data-[state=closed]:al-animate-out data-[state=closed]:al-fade-out-0 data-[state=open]:al-fade-in-0",
6016
6040
  e
6017
6041
  ),
@@ -6025,7 +6049,7 @@ const $c = G(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ g.jsxs(
6025
6049
  co,
6026
6050
  {
6027
6051
  ref: r,
6028
- className: F(
6052
+ className: _(
6029
6053
  "al-fixed al-left-[50%] al-top-[50%] al-z-50 al-grid al-w-full al-max-w-lg al-translate-x-[-50%] al-translate-y-[-50%] al-gap-4 al-border al-bg-background al-p-6 al-shadow-lg al-duration-200 data-[state=open]:al-animate-in data-[state=closed]:al-animate-out data-[state=closed]:al-fade-out-0 data-[state=open]:al-fade-in-0 data-[state=closed]:al-zoom-out-95 data-[state=open]:al-zoom-in-95 data-[state=closed]:al-slide-out-to-left-1/2 data-[state=closed]:al-slide-out-to-top-[48%] data-[state=open]:al-slide-in-from-left-1/2 data-[state=open]:al-slide-in-from-top-[48%] sm:al-rounded-lg",
6030
6054
  e
6031
6055
  ),
@@ -6044,7 +6068,7 @@ $c.displayName = co.displayName;
6044
6068
  const Wc = ({ className: e, ...t }) => /* @__PURE__ */ g.jsx(
6045
6069
  "div",
6046
6070
  {
6047
- className: F("al-flex al-flex-col al-space-y-1.5 al-text-center sm:al-text-left", e),
6071
+ className: _("al-flex al-flex-col al-space-y-1.5 al-text-center sm:al-text-left", e),
6048
6072
  ...t
6049
6073
  }
6050
6074
  );
@@ -6052,7 +6076,7 @@ Wc.displayName = "DialogHeader";
6052
6076
  const Vc = ({ className: e, ...t }) => /* @__PURE__ */ g.jsx(
6053
6077
  "div",
6054
6078
  {
6055
- className: F(
6079
+ className: _(
6056
6080
  "al-flex al-flex-col-reverse sm:al-flex-row sm:al-justify-end sm:al-space-x-2",
6057
6081
  e
6058
6082
  ),
@@ -6064,7 +6088,7 @@ const Bc = G(({ className: e, ...t }, n) => /* @__PURE__ */ g.jsx(
6064
6088
  uo,
6065
6089
  {
6066
6090
  ref: n,
6067
- className: F("al-text-lg al-font-semibold al-leading-none al-tracking-tight", e),
6091
+ className: _("al-text-lg al-font-semibold al-leading-none al-tracking-tight", e),
6068
6092
  ...t
6069
6093
  }
6070
6094
  ));
@@ -6073,7 +6097,7 @@ const zc = G(({ className: e, ...t }, n) => /* @__PURE__ */ g.jsx(
6073
6097
  fo,
6074
6098
  {
6075
6099
  ref: n,
6076
- className: F("al-text-sm al-text-muted-foreground", e),
6100
+ className: _("al-text-sm al-text-muted-foreground", e),
6077
6101
  ...t
6078
6102
  }
6079
6103
  ));
@@ -6336,7 +6360,7 @@ const Xu = ru, qu = ou, au = G(({ className: e, align: t = "center", sideOffset:
6336
6360
  ref: o,
6337
6361
  align: t,
6338
6362
  sideOffset: n,
6339
- className: F(
6363
+ className: _(
6340
6364
  "al-z-50 al-w-72 al-rounded-md al-border al-bg-popover al-p-4 al-text-popover-foreground al-shadow-md al-outline-none data-[state=open]:al-animate-in data-[state=closed]:al-animate-out data-[state=closed]:al-fade-out-0 data-[state=open]:al-fade-in-0 data-[state=closed]:al-zoom-out-95 data-[state=open]:al-zoom-in-95 data-[side=bottom]:al-slide-in-from-top-2 data-[side=left]:al-slide-in-from-right-2 data-[side=right]:al-slide-in-from-left-2 data-[side=top]:al-slide-in-from-bottom-2",
6341
6365
  e
6342
6366
  ),
@@ -6780,7 +6804,7 @@ const Ju = Tu, Mu = ku, Iu = Du, is = l.forwardRef(({ className: e, sideOffset:
6780
6804
  {
6781
6805
  ref: r,
6782
6806
  sideOffset: t,
6783
- className: F(
6807
+ className: _(
6784
6808
  "al-z-50 al-overflow-hidden al-rounded-md al-border al-bg-popover al-px-3 al-py-1.5 al-text-sm al-text-popover-foreground al-shadow-md al-animate-in al-fade-in-0 al-zoom-in-95 data-[state=closed]:al-animate-out data-[state=closed]:al-fade-out-0 data-[state=closed]:al-zoom-out-95 data-[side=bottom]:al-slide-in-from-top-2 data-[side=left]:al-slide-in-from-right-2 data-[side=right]:al-slide-in-from-left-2 data-[side=top]:al-slide-in-from-bottom-2",
6785
6809
  e
6786
6810
  ),
@@ -6834,7 +6858,7 @@ const ed = ({
6834
6858
  // 64px
6835
6859
  "8xl": "al-gap-20"
6836
6860
  // 80px
6837
- })[m], h = F(
6861
+ })[m], h = _(
6838
6862
  "al-flex",
6839
6863
  // Direction
6840
6864
  c === "column" ? "al-flex-col" : "al-flex-row",
@@ -6895,8 +6919,8 @@ export {
6895
6919
  td as Z,
6896
6920
  Al as _,
6897
6921
  ae as a,
6898
- ed as a0,
6899
- Zu as a1,
6922
+ Zu as a0,
6923
+ ed as a1,
6900
6924
  Xu as a2,
6901
6925
  qu as a3,
6902
6926
  au as a4,
@@ -6922,7 +6946,7 @@ export {
6922
6946
  Bc as ao,
6923
6947
  zc as ap,
6924
6948
  De as b,
6925
- F as c,
6949
+ _ as c,
6926
6950
  k as d,
6927
6951
  nr as e,
6928
6952
  Gt as f,
@@ -1,6 +1,6 @@
1
1
  import React__default, { FC } from 'react';
2
- import { j as ChatbotProps, k as ChatbotProviderProps, m as ChatState, A as Artifact, n as ContextOption, I as InteractionRequest, o as ChatMessage, p as AgentAction, q as ChatResponse, i as Citation } from '../types-Dr98SsnM.js';
3
- export { E as AgentStreamResponse, s as AssistantMeta, t as ChatSession, v as ChatbotUrls, F as Feedback, u as FileUploadProps, D as FinalResponseData, x as InteractionChoice, w as InteractionType, r as LoadingState, B as ProgressUpdate, y as TodoItem, z as ToolUsageData } from '../types-Dr98SsnM.js';
2
+ import { j as ChatbotProps, k as ChatbotProviderProps, m as ChatState, A as Artifact, n as ContextOption, I as InteractionRequest, o as ChatMessage, p as AgentAction, q as ChatResponse, r as AgentStreamResponse, i as Citation, s as TodoItem } from '../types-rSkEslHb.js';
3
+ export { u as AssistantMeta, v as ChatSession, x as ChatbotUrls, D as Datamate, F as Feedback, w as FileUploadProps, H as FinalResponseData, z as InteractionChoice, y as InteractionType, t as LoadingState, M as Mode, G as ProgressUpdate, E as ToolUsageData, J as agentStreamResponseSchema, B as todoItemSchema } from '../types-rSkEslHb.js';
4
4
  import { UnknownAction } from '@reduxjs/toolkit';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import 'zod';
@@ -96,9 +96,94 @@ declare const useAgentChat: () => {
96
96
  updateContextAndSendMessage: (message: string, context: Record<string, unknown>) => Promise<void>;
97
97
  };
98
98
 
99
+ interface StreamProcessorCallbacks {
100
+ onAction?: (action: AgentAction) => void;
101
+ onCitation?: (citations: Citation[]) => void;
102
+ onTodos?: (todos: TodoItem[]) => void;
103
+ onFinalResponse?: (response: {
104
+ content: string;
105
+ artifacts?: Artifact[];
106
+ heading?: string;
107
+ interaction?: AgentStreamResponse["interaction"];
108
+ }) => void;
109
+ onError?: (error: string) => void;
110
+ onComplete?: () => void;
111
+ }
112
+ interface StreamProcessorOptions {
113
+ isMarkdownResponse?: boolean;
114
+ callbacks?: StreamProcessorCallbacks;
115
+ }
116
+ interface ProcessedStreamResult {
117
+ content: string;
118
+ actions: AgentAction[];
119
+ citations?: Citation[];
120
+ todos?: TodoItem[];
121
+ artifacts?: Artifact[];
122
+ heading?: string;
123
+ interaction?: AgentStreamResponse["interaction"];
124
+ }
125
+ /**
126
+ * Processes a stream of AgentStreamResponse messages
127
+ * @param reader - ReadableStreamDefaultReader for the response stream
128
+ * @param options - Configuration options and callbacks
129
+ * @returns Promise with final processed response
130
+ */
131
+ declare function processAgentStream(reader: ReadableStreamDefaultReader<Uint8Array>, options?: StreamProcessorOptions): Promise<ProcessedStreamResult>;
132
+ /**
133
+ * Converts processed stream response to AgentStreamResponse format
134
+ */
135
+ declare function streamResponseToAgentMessages(streamResponse: ProcessedStreamResult): AgentStreamResponse[];
136
+ /**
137
+ * Processes existing conversation data (not from stream) using the same logic as processAgentStream
138
+ * Useful for loading historical conversations or existing chat data
139
+ */
140
+ declare function processExistingConversation(conversationTurns: Array<{
141
+ role: "user" | "assistant";
142
+ content: AgentStreamResponse[];
143
+ }>): ProcessedStreamResult[];
144
+ /**
145
+ * Processes a single assistant message's content using the same logic as the stream processor
146
+ * This function is used by both processExistingConversation and can be used standalone
147
+ */
148
+ declare function processAgentMessageContent(content: AgentStreamResponse[]): ProcessedStreamResult;
149
+ /**
150
+ * Processes playground session turns into chat sessions format
151
+ * This is specifically for playground usage where we need to convert session turns
152
+ * into a format that can be consumed by the ChatProvider
153
+ */
154
+ declare function processPlaygroundSessionTurns(turns: Array<{
155
+ role: "user" | "assistant";
156
+ content: AgentStreamResponse[];
157
+ id?: string;
158
+ timestamp?: number;
159
+ }>, sessionId: string): Record<string, {
160
+ id: string;
161
+ messages: Array<{
162
+ id: string;
163
+ role: "user" | "assistant";
164
+ content: string;
165
+ timestamp: number;
166
+ heading: string;
167
+ actions?: AgentAction[];
168
+ artifacts?: Artifact[];
169
+ citations?: Citation[];
170
+ todos?: TodoItem[];
171
+ interaction?: AgentStreamResponse["interaction"];
172
+ }>;
173
+ }>;
174
+ /**
175
+ * Helper function to create a fetch request and process the stream
176
+ */
177
+ declare function sendMessageAndProcessStream(url: string, data: Record<string, unknown>, options?: {
178
+ headers?: Record<string, string>;
179
+ signal?: AbortSignal;
180
+ isMarkdownResponse?: boolean;
181
+ callbacks?: StreamProcessorCallbacks;
182
+ }): Promise<ProcessedStreamResult>;
183
+
99
184
  declare const Citations: ({ citations, frontEndUrl, }: {
100
185
  citations?: Citation[];
101
186
  frontEndUrl: string;
102
187
  }) => JSX.Element | null;
103
188
 
104
- export { AgentAction, Artifact, Artifacts, CancelGenerationButton, ChatMessage, ChatProvider, ChatResponse, ChatState, ChatTriggerLink, ChatbotProps, ChatbotProviderProps, Chatbot as ChatbotV2, Citations, CoachAI, ContextOption, ContextPanel, FeedbackButtons, InteractionPrompt, InteractionRequest, LoadingIndicator, MessageItem, MessageList, MessageMenu, QuestionForm, RegenerateButton, StatusUpdates, useAgentChat, useChatContext };
189
+ export { AgentAction, AgentStreamResponse, Artifact, Artifacts, CancelGenerationButton, ChatMessage, ChatProvider, ChatResponse, ChatState, ChatTriggerLink, ChatbotProps, ChatbotProviderProps, Chatbot as ChatbotV2, Citations, CoachAI, ContextOption, ContextPanel, FeedbackButtons, InteractionPrompt, InteractionRequest, LoadingIndicator, MessageItem, MessageList, MessageMenu, QuestionForm, RegenerateButton, StatusUpdates, TodoItem, processAgentMessageContent, processAgentStream, processExistingConversation, processPlaygroundSessionTurns, sendMessageAndProcessStream, streamResponseToAgentMessages, useAgentChat, useChatContext };
@@ -1,23 +1,31 @@
1
- import { A as s, b as e, a as n, g as o, C as i, i as r, c as C, d as g, F as u, I as c, L as d, j as h, M as I, e as L, f as M, Q as m, R as A, S as b, h as f, u as p } from "../CoachForm.js";
1
+ import { A as e, b as t, a as n, g as o, C as r, m as g, c as i, d as c, F as C, I as m, L as d, n as u, M as p, e as h, f as S, Q as A, R as M, S as I, o as L, k as P, p as l, j as x, l as R, s as b, i as f, t as k, h as B, u as F } from "../CoachForm.js";
2
2
  export {
3
- s as Artifacts,
4
- e as CancelGenerationButton,
3
+ e as Artifacts,
4
+ t as CancelGenerationButton,
5
5
  n as ChatProvider,
6
6
  o as ChatTriggerLink,
7
- i as ChatbotV2,
8
- r as Citations,
9
- C as CoachAI,
10
- g as ContextPanel,
11
- u as FeedbackButtons,
12
- c as InteractionPrompt,
7
+ r as ChatbotV2,
8
+ g as Citations,
9
+ i as CoachAI,
10
+ c as ContextPanel,
11
+ C as FeedbackButtons,
12
+ m as InteractionPrompt,
13
13
  d as LoadingIndicator,
14
- h as LoadingState,
15
- I as MessageItem,
16
- L as MessageList,
17
- M as MessageMenu,
18
- m as QuestionForm,
19
- A as RegenerateButton,
20
- b as StatusUpdates,
21
- f as useAgentChat,
22
- p as useChatContext
14
+ u as LoadingState,
15
+ p as MessageItem,
16
+ h as MessageList,
17
+ S as MessageMenu,
18
+ A as QuestionForm,
19
+ M as RegenerateButton,
20
+ I as StatusUpdates,
21
+ L as agentStreamResponseSchema,
22
+ P as processAgentMessageContent,
23
+ l as processAgentStream,
24
+ x as processExistingConversation,
25
+ R as processPlaygroundSessionTurns,
26
+ b as sendMessageAndProcessStream,
27
+ f as streamResponseToAgentMessages,
28
+ k as todoItemSchema,
29
+ B as useAgentChat,
30
+ F as useChatContext
23
31
  };
@@ -1,4 +1,4 @@
1
- import { t as DH, v as wMe, w as gMe, n as K1, m as J1n, x as pMe, s as vMe, y as Y1n, z as mMe, B as kMe, D as Uee, E as yMe, G as Q1n, H as $H, J as jMe, K as EMe } from "./CoachForm.js";
1
+ import { E as DH, G as wMe, H as gMe, x as K1, w as J1n, J as pMe, y as vMe, K as Y1n, N as mMe, O as kMe, P as Uee, T as yMe, U as Q1n, V as $H, W as jMe, X as EMe } from "./CoachForm.js";
2
2
  import { c as Hee, g as CMe, s as bI } from "./redux-toolkit.modern.js";
3
3
  var Wee = { exports: {} };
4
4
  (function(Ae, It) {
package/dist/index.d.ts CHANGED
@@ -2,8 +2,8 @@ import * as React$1 from 'react';
2
2
  import { HTMLAttributes, ButtonHTMLAttributes, ReactNode, FC, MouseEvent } from 'react';
3
3
  import { B as ButtonProps } from './Button-C4jhPGlR.js';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
- import { T as TaskLabels, a as TeamMateContextProps, b as TeamMateState, c as TeamMateConfig, d as TeamMateActionType, e as TeamMateAvailability } from './types-Dr98SsnM.js';
6
- export { i as Citation, f as CoachAiConfirmationResponse, C as CoachAiResponse, g as ContentCategory, L as Learning, P as PersonalizationScope, h as TeamMateComponentProps, l as learningSchema } from './types-Dr98SsnM.js';
5
+ import { T as TaskLabels, a as TeamMateContextProps, b as TeamMateState, c as TeamMateConfig, d as TeamMateActionType, e as TeamMateAvailability } from './types-rSkEslHb.js';
6
+ export { i as Citation, f as CoachAiConfirmationResponse, C as CoachAiResponse, g as ContentCategory, L as Learning, P as PersonalizationScope, h as TeamMateComponentProps, l as learningSchema } from './types-rSkEslHb.js';
7
7
  import * as _reduxjs_toolkit from '@reduxjs/toolkit';
8
8
  import { PayloadAction } from '@reduxjs/toolkit';
9
9
  import * as immer from 'immer';