@mastra/playground-ui 32.0.2 → 33.0.0-alpha.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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @mastra/playground-ui
2
2
 
3
+ ## 33.0.0-alpha.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Added native switch thumb icons so checked and unchecked states can show their own icon without custom overlay code. ([#17569](https://github.com/mastra-ai/mastra/pull/17569))
8
+
9
+ ### Patch Changes
10
+
11
+ - Fixed input focus borders so hovering no longer overrides the focused state. ([#17570](https://github.com/mastra-ai/mastra/pull/17570))
12
+
13
+ - Updated dependencies [[`d468acb`](https://github.com/mastra-ai/mastra/commit/d468acb07aec1bb19a2cb0ada8042b05b46746b2), [`e9be4e7`](https://github.com/mastra-ai/mastra/commit/e9be4e747ec3d8b65548bff92f9377db06105376), [`95482bf`](https://github.com/mastra-ai/mastra/commit/95482bf8a5c2b38022d4e2fee8ee07488c5f6262), [`d53cfc2`](https://github.com/mastra-ai/mastra/commit/d53cfc2c7f8d78343a4aa84ec4e129ba25f3325e), [`65799d4`](https://github.com/mastra-ai/mastra/commit/65799d4d549e5ebb9c848fbe3f51ac090f64becf), [`c268c89`](https://github.com/mastra-ai/mastra/commit/c268c89f4c63a93ee474d3cffdf3ea60bf00d4f2), [`d468acb`](https://github.com/mastra-ai/mastra/commit/d468acb07aec1bb19a2cb0ada8042b05b46746b2), [`0c72f03`](https://github.com/mastra-ai/mastra/commit/0c72f032abb13254df5a7856d64be2f207b8006d), [`3b45ea9`](https://github.com/mastra-ai/mastra/commit/3b45ea95015557a6cb9d70dc5252af54ab1b78ac), [`f084be1`](https://github.com/mastra-ai/mastra/commit/f084be1fcbe33ad7480913e44d6130c421c0976f), [`65d3320`](https://github.com/mastra-ai/mastra/commit/65d3320bade087db166caff07eb461c008590ee8), [`44d2c09`](https://github.com/mastra-ai/mastra/commit/44d2c0989186b7294d624bc6dd17722bdb2dcf72), [`b3e9781`](https://github.com/mastra-ai/mastra/commit/b3e9781a93a18e8e492849040016ddf239c00d9c)]:
14
+ - @mastra/core@1.42.0-alpha.0
15
+ - @mastra/client-js@1.24.0-alpha.0
16
+ - @mastra/react@0.5.3-alpha.0
17
+
3
18
  ## 32.0.2
4
19
 
5
20
  ### Patch Changes
package/dist/index.cjs.js CHANGED
@@ -3647,9 +3647,10 @@ const sharedFormElementFocusStyle = "outline-hidden focus-visible:outline-hidden
3647
3647
  const sharedFormElementDisabledStyle = "disabled:opacity-50 disabled:cursor-not-allowed";
3648
3648
  const inputFocusBorderVisible = "focus-visible:border-neutral5/50";
3649
3649
  const inputFocusBorderWithin = "focus-within:border-neutral5/50";
3650
+ const inputHoverBorderVisible = "[&:hover:not(:focus-visible)]:border-border2";
3650
3651
  const inputHoverBorderWithin = "[&:hover:not(:focus-within)]:border-border2";
3651
- const inputSurfaceAndFocusStyle = "bg-surface-overlay-soft border border-border1 text-neutral5 hover:text-neutral6 hover:bg-surface-overlay-strong hover:border-border2 outline-hidden focus-visible:outline-hidden focus-visible:bg-surface-overlay-strong " + inputFocusBorderVisible;
3652
- const inputOutlineAndFocusStyle = "bg-transparent border border-border1 text-neutral5 hover:text-neutral6 hover:border-border2 outline-hidden focus-visible:outline-hidden " + inputFocusBorderVisible;
3652
+ const inputSurfaceAndFocusStyle = "bg-surface-overlay-soft border border-border1 text-neutral5 hover:text-neutral6 hover:bg-surface-overlay-strong " + inputHoverBorderVisible + " outline-hidden focus-visible:outline-hidden focus-visible:bg-surface-overlay-strong " + inputFocusBorderVisible;
3653
+ const inputOutlineAndFocusStyle = "bg-transparent border border-border1 text-neutral5 hover:text-neutral6 " + inputHoverBorderVisible + " outline-hidden focus-visible:outline-hidden " + inputFocusBorderVisible;
3653
3654
  const unstyledFormElementStyle = "border-0 bg-transparent outline-hidden focus-visible:outline-hidden";
3654
3655
 
3655
3656
  const TEXT_MODE_ADORNMENTS = cn(
@@ -9990,49 +9991,101 @@ function BrandLoader({ className, size = "md", "aria-label": ariaLabel = "Loadin
9990
9991
  );
9991
9992
  }
9992
9993
 
9993
- const Switch = React__namespace.forwardRef(({ className, asChild, children, ...props }, ref) => {
9994
- const renderProps = asChild && React__namespace.isValidElement(children) ? { render: children } : { render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button" }), nativeButton: true };
9995
- return /* @__PURE__ */ jsxRuntime.jsxs(
9996
- _switch.Switch.Root,
9997
- {
9998
- ref,
9999
- "data-slot": "switch",
10000
- className: cn(
10001
- "peer group/switch inline-flex h-5 w-9 shrink-0 cursor-pointer items-center overflow-hidden rounded-full border-0 bg-neutral6/[0.14] p-0.5 outline-hidden",
10002
- "transition-colors duration-normal ease-out-custom motion-reduce:transition-none",
10003
- "hover:bg-neutral6/[0.18]",
10004
- "active:bg-neutral6/[0.22]",
10005
- "focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-neutral5/55",
10006
- "data-[checked]:bg-neutral6/[0.92]",
10007
- "data-[checked]:hover:bg-neutral6",
10008
- "data-[checked]:active:bg-neutral5",
10009
- "data-[disabled]:cursor-not-allowed data-[disabled]:bg-neutral6/[0.16] data-[disabled]:hover:bg-neutral6/[0.16]",
10010
- "data-[disabled]:data-[checked]:bg-neutral6/[0.3] data-[disabled]:data-[checked]:hover:bg-neutral6/[0.3]",
10011
- className
10012
- ),
10013
- ...renderProps,
10014
- ...props,
10015
- children: [
10016
- asChild ? void 0 : children,
10017
- /* @__PURE__ */ jsxRuntime.jsx(
10018
- _switch.Switch.Thumb,
10019
- {
10020
- "data-slot": "switch-thumb",
10021
- className: cn(
10022
- "switch-thumb-motion pointer-events-none block h-4 w-5 rounded-full bg-neutral6",
10023
- "transition-[background-color,translate,width,transform] duration-normal ease-out-custom motion-reduce:transition-none",
10024
- "group-active/switch:w-6 group-data-[disabled]/switch:w-5",
10025
- "data-[checked]:translate-x-3 data-[checked]:bg-surface1 data-[unchecked]:translate-x-0",
10026
- "group-active/switch:data-[checked]:translate-x-2",
10027
- "data-[disabled]:data-[unchecked]:bg-neutral6/[0.42] data-[disabled]:data-[checked]:bg-surface1/80"
10028
- )
10029
- }
10030
- )
10031
- ]
10032
- }
10033
- );
10034
- });
9994
+ const Switch = React__namespace.forwardRef(
9995
+ ({ className, asChild, children, icon, checkedIcon, uncheckedIcon, ...props }, ref) => {
9996
+ const shouldRenderStateIcons = checkedIcon !== void 0 || uncheckedIcon !== void 0;
9997
+ const shouldRenderIcon = icon !== void 0 || shouldRenderStateIcons;
9998
+ const singleIcon = shouldRenderStateIcons ? void 0 : icon;
9999
+ const onIcon = checkedIcon ?? icon;
10000
+ const offIcon = uncheckedIcon ?? icon;
10001
+ const renderProps = asChild && React__namespace.isValidElement(children) ? { render: children } : { render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button" }), nativeButton: true };
10002
+ return /* @__PURE__ */ jsxRuntime.jsxs(
10003
+ _switch.Switch.Root,
10004
+ {
10005
+ ref,
10006
+ "data-slot": "switch",
10007
+ className: cn(
10008
+ "peer group/switch inline-flex h-5 w-9 shrink-0 cursor-pointer items-center overflow-hidden rounded-full border-0 bg-neutral6/[0.14] p-0.5 outline-hidden",
10009
+ "transition-colors duration-normal ease-out-custom motion-reduce:transition-none",
10010
+ "hover:bg-neutral6/[0.18]",
10011
+ "active:bg-neutral6/[0.22]",
10012
+ "focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-neutral5/55",
10013
+ "data-[checked]:bg-neutral6/[0.92]",
10014
+ "data-[checked]:hover:bg-neutral6",
10015
+ "data-[checked]:active:bg-neutral5",
10016
+ "data-[disabled]:cursor-not-allowed data-[disabled]:bg-neutral6/[0.16] data-[disabled]:hover:bg-neutral6/[0.16]",
10017
+ "data-[disabled]:data-[checked]:bg-neutral6/[0.3] data-[disabled]:data-[checked]:hover:bg-neutral6/[0.3]",
10018
+ className
10019
+ ),
10020
+ ...renderProps,
10021
+ ...props,
10022
+ children: [
10023
+ asChild ? void 0 : children,
10024
+ /* @__PURE__ */ jsxRuntime.jsx(
10025
+ _switch.Switch.Thumb,
10026
+ {
10027
+ "data-slot": "switch-thumb",
10028
+ className: cn(
10029
+ "switch-thumb-motion pointer-events-none relative block h-4 w-5 rounded-full bg-neutral6",
10030
+ "transition-[background-color,translate,width,transform] duration-normal ease-out-custom motion-reduce:transition-none",
10031
+ "group-active/switch:w-6 group-data-[disabled]/switch:w-5",
10032
+ "data-[checked]:translate-x-3 data-[checked]:bg-surface1 data-[unchecked]:translate-x-0",
10033
+ "group-active/switch:data-[checked]:translate-x-2",
10034
+ "data-[disabled]:data-[unchecked]:bg-neutral6/[0.42] data-[disabled]:data-[checked]:bg-surface1/80"
10035
+ ),
10036
+ children: shouldRenderIcon ? /* @__PURE__ */ jsxRuntime.jsx(SwitchThumbIcon, { checkedIcon: onIcon, icon: singleIcon, uncheckedIcon: offIcon }) : null
10037
+ }
10038
+ )
10039
+ ]
10040
+ }
10041
+ );
10042
+ }
10043
+ );
10035
10044
  Switch.displayName = "Switch";
10045
+ function SwitchThumbIcon({
10046
+ checkedIcon,
10047
+ icon,
10048
+ uncheckedIcon
10049
+ }) {
10050
+ const iconClassName = cn(
10051
+ "absolute inset-0 flex items-center justify-center text-surface1",
10052
+ "transition-[color,opacity] duration-normal ease-out-custom motion-reduce:transition-none",
10053
+ "[&_svg]:size-2.5 [&_svg]:stroke-[2.5]"
10054
+ );
10055
+ if (icon !== void 0) {
10056
+ return /* @__PURE__ */ jsxRuntime.jsx(
10057
+ "span",
10058
+ {
10059
+ "aria-hidden": true,
10060
+ "data-slot": "switch-thumb-icon",
10061
+ className: cn(iconClassName, "group-data-[checked]/switch:text-neutral6"),
10062
+ children: icon
10063
+ }
10064
+ );
10065
+ }
10066
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
10067
+ uncheckedIcon !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
10068
+ "span",
10069
+ {
10070
+ "aria-hidden": true,
10071
+ "data-slot": "switch-thumb-icon",
10072
+ "data-switch-icon": "unchecked",
10073
+ className: cn(iconClassName, "opacity-100 group-data-[checked]/switch:opacity-0"),
10074
+ children: uncheckedIcon
10075
+ }
10076
+ ) : null,
10077
+ checkedIcon !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
10078
+ "span",
10079
+ {
10080
+ "aria-hidden": true,
10081
+ "data-slot": "switch-thumb-icon",
10082
+ "data-switch-icon": "checked",
10083
+ className: cn(iconClassName, "text-neutral6 opacity-0 group-data-[checked]/switch:opacity-100"),
10084
+ children: checkedIcon
10085
+ }
10086
+ ) : null
10087
+ ] });
10088
+ }
10036
10089
 
10037
10090
  const DEFAULT_OPTIONS = [
10038
10091
  { value: "system", label: "System", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Monitor, {}) },
@@ -14591,11 +14644,12 @@ function DefaultErrorFallback({
14591
14644
  );
14592
14645
  }
14593
14646
 
14594
- function ErrorState({ title, message }) {
14647
+ function ErrorState({ title, message, action }) {
14595
14648
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-[30vh]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center text-center py-10 px-6", children: [
14596
14649
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-4", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleXIcon, { className: "h-8 w-8 text-red-900" }) }),
14597
14650
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-medium text-neutral4 text-ui-md", children: title }),
14598
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1.5 text-neutral2 text-ui-md max-w-md", children: message })
14651
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1.5 text-neutral2 text-ui-md max-w-md", children: message }),
14652
+ action && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pt-4 flex items-center justify-center", children: action })
14599
14653
  ] }) });
14600
14654
  }
14601
14655
 
@@ -22934,6 +22988,7 @@ exports.highlight = highlight;
22934
22988
  exports.hoverEffects = hoverEffects;
22935
22989
  exports.inputFocusBorderVisible = inputFocusBorderVisible;
22936
22990
  exports.inputFocusBorderWithin = inputFocusBorderWithin;
22991
+ exports.inputHoverBorderVisible = inputHoverBorderVisible;
22937
22992
  exports.inputHoverBorderWithin = inputHoverBorderWithin;
22938
22993
  exports.inputOutlineAndFocusStyle = inputOutlineAndFocusStyle;
22939
22994
  exports.inputSurfaceAndFocusStyle = inputSurfaceAndFocusStyle;