@sarunyu/system-one 4.7.3 → 4.7.5

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/index.cjs CHANGED
@@ -3509,7 +3509,7 @@ const Input = React.forwardRef(function Input2({
3509
3509
  const controlled = value !== void 0;
3510
3510
  const currentValue = controlled ? value : internalValue;
3511
3511
  const isDisabled = forceState === "disabled";
3512
- const state = forceState ?? (focused ? "focus" : "default");
3512
+ const state = forceState && forceState !== "default" ? forceState : focused ? "focus" : "default";
3513
3513
  const isError = state === "error";
3514
3514
  const isFocus = state === "focus";
3515
3515
  const isFilled = currentValue.length > 0;
@@ -4222,6 +4222,23 @@ function ToastStack({ items, className, renderItem }) {
4222
4222
  (item) => renderItem ? /* @__PURE__ */ jsxRuntime.jsx("div", { children: renderItem(item) }, item.id) : /* @__PURE__ */ jsxRuntime.jsx(Toast, { ...item }, item.id)
4223
4223
  ) });
4224
4224
  }
4225
+ function Toaster({ items, renderItem, className }) {
4226
+ if (items.length === 0) return null;
4227
+ return /* @__PURE__ */ jsxRuntime.jsx(
4228
+ "div",
4229
+ {
4230
+ className: cn(
4231
+ "fixed z-50 top-4",
4232
+ // desktop: top-right, fixed width
4233
+ "md:right-4 md:w-[360px]",
4234
+ // tablet & mobile: horizontally centered, full width minus padding
4235
+ "max-md:left-1/2 max-md:-translate-x-1/2 max-md:w-[calc(100vw-32px)]",
4236
+ className
4237
+ ),
4238
+ children: /* @__PURE__ */ jsxRuntime.jsx(ToastStack, { items, renderItem })
4239
+ }
4240
+ );
4241
+ }
4225
4242
  const OptionList = React.forwardRef(
4226
4243
  function OptionList2({
4227
4244
  options,
@@ -5882,6 +5899,7 @@ exports.TextArea = TextArea;
5882
5899
  exports.TimeInput = TimeInput;
5883
5900
  exports.Toast = Toast;
5884
5901
  exports.ToastStack = ToastStack;
5902
+ exports.Toaster = Toaster;
5885
5903
  exports.Toggle = Toggle;
5886
5904
  exports.cn = cn;
5887
5905
  exports.useIsMobile = useIsMobile;