@mastra/playground-ui 22.1.3-alpha.3 → 22.2.0-alpha.9

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/CHANGELOG.md CHANGED
@@ -1,5 +1,73 @@
1
1
  # @mastra/playground-ui
2
2
 
3
+ ## 22.2.0-alpha.9
4
+
5
+ ### Minor Changes
6
+
7
+ - Added new Logo component to the playground-ui design system. Supports two sizes (sm, md), uses currentColor for theming, and includes an optional outline-on-hover animation that respects prefers-reduced-motion. ([#15513](https://github.com/mastra-ai/mastra/pull/15513))
8
+
9
+ ### Patch Changes
10
+
11
+ - dependencies updates: ([#15525](https://github.com/mastra-ai/mastra/pull/15525))
12
+ - Updated dependency [`prettier@^3.8.3` ↗︎](https://www.npmjs.com/package/prettier/v/3.8.3) (from `^3.8.1`, in `dependencies`)
13
+ - Updated dependencies [[`16e34ca`](https://github.com/mastra-ai/mastra/commit/16e34caa98b9a114b17a6125e4e3fd87f169d0d0)]:
14
+ - @mastra/core@1.26.0-alpha.9
15
+ - @mastra/client-js@1.13.5-alpha.9
16
+ - @mastra/react@0.2.27-alpha.9
17
+
18
+ ## 22.2.0-alpha.8
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [[`1bd5104`](https://github.com/mastra-ai/mastra/commit/1bd51048b6da93507276d6623e3fd96a9e1a8944)]:
23
+ - @mastra/core@1.26.0-alpha.8
24
+ - @mastra/client-js@1.13.5-alpha.8
25
+ - @mastra/react@0.2.27-alpha.8
26
+
27
+ ## 22.2.0-alpha.7
28
+
29
+ ### Minor Changes
30
+
31
+ - Added BrandLoader, a branded pulse-wave loader component for brand moments like app boot or agent thinking. Complements Spinner, which remains the inline utility loader. ([#15490](https://github.com/mastra-ai/mastra/pull/15490))
32
+
33
+ ### Patch Changes
34
+
35
+ - Updated dependencies [[`8786a61`](https://github.com/mastra-ai/mastra/commit/8786a61fa54ba265f85eeff9985ca39863d18bb6), [`8fb2405`](https://github.com/mastra-ai/mastra/commit/8fb2405138f2d208b7962ad03f121ca25bcc28c5)]:
36
+ - @mastra/core@1.26.0-alpha.7
37
+ - @mastra/client-js@1.13.5-alpha.7
38
+ - @mastra/react@0.2.27-alpha.7
39
+
40
+ ## 22.1.3-alpha.6
41
+
42
+ ### Patch Changes
43
+
44
+ - Updated dependencies [[`6315317`](https://github.com/mastra-ai/mastra/commit/63153175fe9a7b224e5be7c209bbebc01dd9b0d5), [`9d3b24b`](https://github.com/mastra-ai/mastra/commit/9d3b24b19407ae9c09586cf7766d38dc4dff4a69)]:
45
+ - @mastra/core@1.26.0-alpha.6
46
+ - @mastra/client-js@1.13.5-alpha.6
47
+ - @mastra/react@0.2.27-alpha.6
48
+
49
+ ## 22.1.3-alpha.5
50
+
51
+ ### Patch Changes
52
+
53
+ - Added a Foundations/Tokens page to the @mastra/playground-ui Storybook so you can browse all typography, color, spacing, radius, shadow, and animation tokens in one place. ([#15475](https://github.com/mastra-ai/mastra/pull/15475))
54
+
55
+ - Added `ScoresDataList` for rendering lists of score evaluation results. ([#15339](https://github.com/mastra-ai/mastra/pull/15339))
56
+
57
+ - Updated dependencies [[`92dcf02`](https://github.com/mastra-ai/mastra/commit/92dcf029294210ac91b090900c1a0555a425c57a)]:
58
+ - @mastra/core@1.26.0-alpha.5
59
+ - @mastra/client-js@1.13.5-alpha.5
60
+ - @mastra/react@0.2.27-alpha.5
61
+
62
+ ## 22.1.3-alpha.4
63
+
64
+ ### Patch Changes
65
+
66
+ - Updated dependencies [[`0474c2b`](https://github.com/mastra-ai/mastra/commit/0474c2b2e7c7e1ad8691dca031284841391ff1ef), [`f607106`](https://github.com/mastra-ai/mastra/commit/f607106854c6416c4a07d4082604b9f66d047221), [`62919a6`](https://github.com/mastra-ai/mastra/commit/62919a6ee0fbf3779ad21a97b1ec6696515d5104), [`0fd90a2`](https://github.com/mastra-ai/mastra/commit/0fd90a215caf5fca8099c15a67ca03e4427747a3)]:
67
+ - @mastra/core@1.26.0-alpha.4
68
+ - @mastra/client-js@1.13.5-alpha.4
69
+ - @mastra/react@0.2.27-alpha.4
70
+
3
71
  ## 22.1.3-alpha.3
4
72
 
5
73
  ### Patch Changes
package/dist/index.cjs.js CHANGED
@@ -3386,7 +3386,7 @@ function cn(...inputs) {
3386
3386
  return twMerge(clsx(inputs));
3387
3387
  }
3388
3388
 
3389
- const sizeClasses$4 = {
3389
+ const sizeClasses$6 = {
3390
3390
  sm: `${formElementSizes.sm} text-ui-sm px-[.75em]`,
3391
3391
  md: `${formElementSizes.md} text-ui-md px-[.75em]`,
3392
3392
  default: `${formElementSizes.default} text-ui-md px-[.85em] `,
@@ -3419,7 +3419,7 @@ function resolveVariant(variant) {
3419
3419
  function buttonVariants(options) {
3420
3420
  const variant = resolveVariant(options?.variant || "default");
3421
3421
  const size = options?.size || "default";
3422
- return cn(sharedStyles, sizeClasses$4[size], variantClasses$4[variant], options?.iconOnly && "[&>svg]:opacity-75");
3422
+ return cn(sharedStyles, sizeClasses$6[size], variantClasses$4[variant], options?.iconOnly && "[&>svg]:opacity-75");
3423
3423
  }
3424
3424
  function flattenChildren(children) {
3425
3425
  const result = [];
@@ -4797,7 +4797,7 @@ const AlertDescription = ({ children, as: As = "p" }) => {
4797
4797
  return /* @__PURE__ */ jsxRuntime.jsx(Txt, { as: As, variant: "ui-sm", children });
4798
4798
  };
4799
4799
 
4800
- const sizeClasses$3 = {
4800
+ const sizeClasses$5 = {
4801
4801
  sm: "h-avatar-sm w-avatar-sm",
4802
4802
  md: "h-avatar-md w-avatar-md",
4803
4803
  lg: "h-avatar-lg w-avatar-lg"
@@ -4807,7 +4807,7 @@ const Avatar = ({ src, name, size = "sm", interactive = false }) => {
4807
4807
  "div",
4808
4808
  {
4809
4809
  className: cn(
4810
- sizeClasses$3[size],
4810
+ sizeClasses$5[size],
4811
4811
  "border border-border1 bg-surface3 shrink-0 overflow-hidden rounded-full flex items-center justify-center",
4812
4812
  transitions.all,
4813
4813
  interactive && "cursor-pointer hover:scale-105 hover:border-neutral2 hover:shadow-sm"
@@ -5622,6 +5622,59 @@ const LogoWithoutText = (props) => /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns
5622
5622
  }
5623
5623
  ) });
5624
5624
 
5625
+ const PATH_D = "M4.49805 11.6934C6.98237 11.6934 8.99609 13.7081 8.99609 16.1924C8.9959 18.6765 6.98225 20.6904 4.49805 20.6904C2.01394 20.6903 0.000196352 18.6765 0 16.1924C0 13.7081 2.01382 11.6935 4.49805 11.6934ZM10.3867 0C12.8709 0 14.8846 2.01388 14.8848 4.49805C14.8848 4.8377 14.847 5.16846 14.7755 5.48643C14.4618 6.88139 14.1953 8.4633 14.9928 9.65L16.2575 11.5319C16.3363 11.6491 16.4727 11.7115 16.6137 11.703C16.7369 11.6957 16.8525 11.6343 16.9214 11.5318L18.1876 9.64717C18.9772 8.47198 18.7236 6.90783 18.4205 5.52484C18.3523 5.21392 18.3164 4.89094 18.3164 4.55957C18.3167 2.07546 20.3313 0.0615234 22.8154 0.0615234C25.2994 0.0617476 27.3132 2.0756 27.3135 4.55957C27.3135 4.93883 27.2665 5.30712 27.178 5.65896C26.8547 6.94441 26.5817 8.37932 27.2446 9.52714L28.459 11.6301C28.4819 11.6697 28.5245 11.6934 28.5703 11.6934C31.0545 11.6935 33.0684 13.7081 33.0684 16.1924C33.0682 18.6765 31.0544 20.6903 28.5703 20.6904C26.0861 20.6904 24.0725 18.6765 24.0723 16.1924C24.0723 15.8049 24.1212 15.4288 24.2133 15.0701C24.5458 13.7746 24.8298 12.3251 24.1609 11.1668L23.0044 9.16384C22.9656 9.09659 22.8931 9.05859 22.8154 9.05859C22.7983 9.05859 22.7824 9.06614 22.7728 9.08033L21.4896 10.9895C20.686 12.1851 20.9622 13.781 21.284 15.1851C21.3582 15.5089 21.3975 15.8461 21.3975 16.1924C21.3973 18.6764 19.3834 20.6902 16.8994 20.6904C14.4152 20.6904 12.4006 18.6765 12.4004 16.1924C12.4004 15.932 12.4226 15.6768 12.4651 15.4286C12.6859 14.14 12.8459 12.7122 12.1167 11.6271L11.2419 10.3253C10.6829 9.49347 9.71913 9.05932 8.78286 8.70188C7.0906 8.05584 5.88867 6.41734 5.88867 4.49805C5.88886 2.0139 7.90254 3.29835e-05 10.3867 0Z";
5626
+ const sizeClasses$4 = {
5627
+ sm: "w-6",
5628
+ md: "w-10"
5629
+ };
5630
+ function prefersReducedMotion() {
5631
+ if (typeof window === "undefined" || !window.matchMedia) return false;
5632
+ return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
5633
+ }
5634
+ function Logo({ className, size = "md", animateOnHover = false, "aria-label": ariaLabel = "Mastra" }) {
5635
+ const reactId = React.useId();
5636
+ const clipId = `logo-clip-${reactId.replace(/[^a-zA-Z0-9_-]/g, "")}`;
5637
+ const [playing, setPlaying] = React.useState(false);
5638
+ const handleMouseEnter = animateOnHover ? () => {
5639
+ if (prefersReducedMotion()) return;
5640
+ setPlaying(true);
5641
+ } : void 0;
5642
+ const handleAnimationEnd = animateOnHover && playing ? (e) => {
5643
+ if (e.animationName !== "logo-stroke-cycle") return;
5644
+ setPlaying(false);
5645
+ } : void 0;
5646
+ return /* @__PURE__ */ jsxRuntime.jsx(
5647
+ "div",
5648
+ {
5649
+ role: "img",
5650
+ "aria-label": ariaLabel,
5651
+ onMouseEnter: handleMouseEnter,
5652
+ onAnimationEnd: handleAnimationEnd,
5653
+ className: cn(
5654
+ "logo inline-block text-neutral6",
5655
+ sizeClasses$4[size],
5656
+ animateOnHover && playing && "logo-animate-on-hover",
5657
+ className
5658
+ ),
5659
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
5660
+ "svg",
5661
+ {
5662
+ xmlns: "http://www.w3.org/2000/svg",
5663
+ viewBox: "0 0 34 21",
5664
+ fill: "none",
5665
+ className: "logo-svg block w-full h-auto",
5666
+ "aria-hidden": "true",
5667
+ children: [
5668
+ /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("clipPath", { id: clipId, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: PATH_D }) }) }),
5669
+ /* @__PURE__ */ jsxRuntime.jsx("path", { className: "logo-fill", d: PATH_D }),
5670
+ /* @__PURE__ */ jsxRuntime.jsx("path", { className: "logo-stroke", d: PATH_D, clipPath: `url(#${clipId})` })
5671
+ ]
5672
+ }
5673
+ )
5674
+ }
5675
+ );
5676
+ }
5677
+
5625
5678
  const rowSize = {
5626
5679
  default: "[&>tbody>tr]:h-table-row",
5627
5680
  small: "[&>tbody>tr]:h-table-row-small"
@@ -7043,7 +7096,7 @@ function SelectFieldBlock({
7043
7096
  ] });
7044
7097
  }
7045
7098
 
7046
- const sizeClasses$2 = {
7099
+ const sizeClasses$3 = {
7047
7100
  sm: `${formElementSizes.sm} w-form-sm`,
7048
7101
  md: `${formElementSizes.md} w-form-md`,
7049
7102
  lg: `${formElementSizes.lg} w-form-lg`,
@@ -7076,7 +7129,7 @@ const IconButton = React.forwardRef(
7076
7129
  baseButtonStyles,
7077
7130
  formElementFocus,
7078
7131
  variantClasses$1[variant],
7079
- sizeClasses$2[size],
7132
+ sizeClasses$3[size],
7080
7133
  disabled && "active:scale-100",
7081
7134
  className
7082
7135
  ),
@@ -7240,7 +7293,7 @@ function MetricsCardError({
7240
7293
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex flex-col gap-3 items-center justify-center", className), children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-ui-sm text-accent2", children: message }) });
7241
7294
  }
7242
7295
 
7243
- const sizeClasses$1 = {
7296
+ const sizeClasses$2 = {
7244
7297
  sm: "w-4 h-4",
7245
7298
  md: "w-6 h-6",
7246
7299
  lg: "w-8 h-8"
@@ -7249,7 +7302,7 @@ function Spinner({ color, className, size = "md" }) {
7249
7302
  return /* @__PURE__ */ jsxRuntime.jsx(
7250
7303
  "svg",
7251
7304
  {
7252
- className: cn("animate-spin", sizeClasses$1[size], className),
7305
+ className: cn("animate-spin", sizeClasses$2[size], className),
7253
7306
  style: { animationDuration: "800ms", animationTimingFunction: "cubic-bezier(0.4, 0, 0.2, 1)" },
7254
7307
  xmlns: "http://www.w3.org/2000/svg",
7255
7308
  width: "24",
@@ -7661,6 +7714,49 @@ const Slider = React__namespace.forwardRef(({ className, ...props }, ref) => /*
7661
7714
  ));
7662
7715
  Slider.displayName = SliderPrimitive__namespace.Root.displayName;
7663
7716
 
7717
+ const sizeClasses$1 = {
7718
+ sm: "w-6",
7719
+ md: "w-10",
7720
+ lg: "w-16"
7721
+ };
7722
+ function BrandLoader({ className, size = "md", "aria-label": ariaLabel = "Loading" }) {
7723
+ const reactId = React.useId();
7724
+ const filterId = `brand-loader-${reactId.replace(/[^a-zA-Z0-9_-]/g, "")}`;
7725
+ return /* @__PURE__ */ jsxRuntime.jsx(
7726
+ "div",
7727
+ {
7728
+ role: "status",
7729
+ "aria-label": ariaLabel,
7730
+ className: cn("brand-loader inline-block text-neutral6", sizeClasses$1[size], className),
7731
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
7732
+ "svg",
7733
+ {
7734
+ xmlns: "http://www.w3.org/2000/svg",
7735
+ viewBox: "0 0 34 21",
7736
+ className: "block w-full h-auto overflow-visible",
7737
+ "aria-hidden": "true",
7738
+ children: [
7739
+ /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsxs("filter", { id: filterId, children: [
7740
+ /* @__PURE__ */ jsxRuntime.jsx("feGaussianBlur", { in: "SourceGraphic", stdDeviation: "0.55" }),
7741
+ /* @__PURE__ */ jsxRuntime.jsx("feColorMatrix", { values: "1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -7" })
7742
+ ] }) }),
7743
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { filter: `url(#${filterId})`, children: [
7744
+ /* @__PURE__ */ jsxRuntime.jsx("line", { className: "brand-loader-ln23", x1: "10.4", y1: "4.5", x2: "16.8", y2: "16.2" }),
7745
+ /* @__PURE__ */ jsxRuntime.jsx("line", { className: "brand-loader-ln34", x1: "16.8", y1: "16.2", x2: "23.2", y2: "4.5" }),
7746
+ /* @__PURE__ */ jsxRuntime.jsx("line", { className: "brand-loader-ln45", x1: "23.2", y1: "4.5", x2: "29.5", y2: "16.2" }),
7747
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { className: "brand-loader-b1", cx: "4.5", cy: "16.2", r: "4.5" }),
7748
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { className: "brand-loader-b2", cx: "10.4", cy: "4.5", r: "4.5" }),
7749
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { className: "brand-loader-b3", cx: "16.8", cy: "16.2", r: "4.5" }),
7750
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { className: "brand-loader-b4", cx: "23.2", cy: "4.5", r: "4.5" }),
7751
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { className: "brand-loader-b5", cx: "29.5", cy: "16.2", r: "4.5" })
7752
+ ] })
7753
+ ]
7754
+ }
7755
+ )
7756
+ }
7757
+ );
7758
+ }
7759
+
7664
7760
  const Switch = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
7665
7761
  SwitchPrimitives__namespace.Root,
7666
7762
  {
@@ -11347,6 +11443,45 @@ function DataListSkeleton({ columns = "auto 1fr auto auto", numberOfRows = 3 })
11347
11443
  )) });
11348
11444
  }
11349
11445
 
11446
+ function toDate$2(value) {
11447
+ const date = value instanceof Date ? value : new Date(value);
11448
+ return isNaN(date.getTime()) ? null : date;
11449
+ }
11450
+ function ScoresDataListDateCell({ timestamp }) {
11451
+ const date = toDate$2(timestamp);
11452
+ return /* @__PURE__ */ jsxRuntime.jsx(DataListCell, { height: "compact", className: "text-ui-smd text-neutral2", children: date ? dateFns.isToday(date) ? "Today" : dateFns.format(date, "MMM dd") : "-" });
11453
+ }
11454
+ function ScoresDataListTimeCell({ timestamp }) {
11455
+ const date = toDate$2(timestamp);
11456
+ return /* @__PURE__ */ jsxRuntime.jsx(DataListCell, { height: "compact", className: "text-ui-smd text-neutral3", children: date ? dateFns.format(date, "h:mm:ss aaa") : "-" });
11457
+ }
11458
+ function ScoresDataListInputCell({ input }) {
11459
+ return /* @__PURE__ */ jsxRuntime.jsx(DataListCell, { height: "compact", className: "min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block text-neutral3 text-ui-smd font-mono truncate", children: input != null ? JSON.stringify(input) : "-" }) });
11460
+ }
11461
+ function ScoresDataListEntityCell({ entityId }) {
11462
+ return /* @__PURE__ */ jsxRuntime.jsx(DataListCell, { height: "compact", className: "min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block text-ui-smd truncate", children: entityId || "-" }) });
11463
+ }
11464
+ function ScoresDataListScoreCell({ score }) {
11465
+ const display = score == null ? "-" : typeof score === "object" ? JSON.stringify(score) : String(score);
11466
+ return /* @__PURE__ */ jsxRuntime.jsx(DataListCell, { height: "compact", className: "text-ui-smd font-mono text-neutral3", children: display });
11467
+ }
11468
+
11469
+ function ScoresDataListRoot(props) {
11470
+ return /* @__PURE__ */ jsxRuntime.jsx(DataListRoot, { ...props });
11471
+ }
11472
+ const ScoresDataList = Object.assign(ScoresDataListRoot, {
11473
+ Top: DataListTop,
11474
+ TopCell: DataListTopCell,
11475
+ RowButton: DataListRowButton,
11476
+ NoMatch: DataListNoMatch,
11477
+ NextPageLoading: DataListNextPageLoading,
11478
+ DateCell: ScoresDataListDateCell,
11479
+ TimeCell: ScoresDataListTimeCell,
11480
+ InputCell: ScoresDataListInputCell,
11481
+ EntityCell: ScoresDataListEntityCell,
11482
+ ScoreCell: ScoresDataListScoreCell
11483
+ });
11484
+
11350
11485
  function toDate$1(value) {
11351
11486
  const date = value instanceof Date ? value : new Date(value);
11352
11487
  return isNaN(date.getTime()) ? null : date;
@@ -11409,7 +11544,10 @@ function TracesDataListStatusCell({ status }) {
11409
11544
  return /* @__PURE__ */ jsxRuntime.jsx(DataListCell, { height: "compact", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "uppercase text-ui-sm font-semibold", style: { color: config.color }, children: config.label }) });
11410
11545
  }
11411
11546
 
11412
- const TracesDataList = Object.assign(DataListRoot, {
11547
+ function TracesDataListRoot(props) {
11548
+ return /* @__PURE__ */ jsxRuntime.jsx(DataListRoot, { ...props });
11549
+ }
11550
+ const TracesDataList = Object.assign(TracesDataListRoot, {
11413
11551
  Top: DataListTop,
11414
11552
  TopCell: DataListTopCell,
11415
11553
  RowButton: DataListRowButton,
@@ -14128,6 +14266,7 @@ exports.Avatar = Avatar;
14128
14266
  exports.AzureIcon = AzureIcon;
14129
14267
  exports.Badge = Badge;
14130
14268
  exports.BranchIcon = BranchIcon;
14269
+ exports.BrandLoader = BrandLoader;
14131
14270
  exports.Breadcrumb = Breadcrumb;
14132
14271
  exports.Button = Button;
14133
14272
  exports.ButtonWithTooltip = ButtonWithTooltip;
@@ -14254,6 +14393,7 @@ exports.KeyValueList = KeyValueList;
14254
14393
  exports.Label = Label;
14255
14394
  exports.LatencyIcon = LatencyIcon;
14256
14395
  exports.ListSearch = ListSearch;
14396
+ exports.Logo = Logo;
14257
14397
  exports.LogoWithoutText = LogoWithoutText;
14258
14398
  exports.LogsDataList = LogsDataList;
14259
14399
  exports.LogsDataListSkeleton = DataListSkeleton;
@@ -14310,6 +14450,7 @@ exports.RuleFieldSelect = RuleFieldSelect;
14310
14450
  exports.RuleOperatorSelect = RuleOperatorSelect;
14311
14451
  exports.RuleRow = RuleRow;
14312
14452
  exports.RuleValueInput = RuleValueInput;
14453
+ exports.ScoresDataList = ScoresDataList;
14313
14454
  exports.ScrollArea = ScrollArea;
14314
14455
  exports.ScrollBar = ScrollBar;
14315
14456
  exports.ScrollableContainer = ScrollableContainer;