@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.js CHANGED
@@ -3490,7 +3490,7 @@ const Input = forwardRef(function Input2({
3490
3490
  const controlled = value !== void 0;
3491
3491
  const currentValue = controlled ? value : internalValue;
3492
3492
  const isDisabled = forceState === "disabled";
3493
- const state = forceState ?? (focused ? "focus" : "default");
3493
+ const state = forceState && forceState !== "default" ? forceState : focused ? "focus" : "default";
3494
3494
  const isError = state === "error";
3495
3495
  const isFocus = state === "focus";
3496
3496
  const isFilled = currentValue.length > 0;
@@ -4203,6 +4203,23 @@ function ToastStack({ items, className, renderItem }) {
4203
4203
  (item) => renderItem ? /* @__PURE__ */ jsx("div", { children: renderItem(item) }, item.id) : /* @__PURE__ */ jsx(Toast, { ...item }, item.id)
4204
4204
  ) });
4205
4205
  }
4206
+ function Toaster({ items, renderItem, className }) {
4207
+ if (items.length === 0) return null;
4208
+ return /* @__PURE__ */ jsx(
4209
+ "div",
4210
+ {
4211
+ className: cn(
4212
+ "fixed z-50 top-4",
4213
+ // desktop: top-right, fixed width
4214
+ "md:right-4 md:w-[360px]",
4215
+ // tablet & mobile: horizontally centered, full width minus padding
4216
+ "max-md:left-1/2 max-md:-translate-x-1/2 max-md:w-[calc(100vw-32px)]",
4217
+ className
4218
+ ),
4219
+ children: /* @__PURE__ */ jsx(ToastStack, { items, renderItem })
4220
+ }
4221
+ );
4222
+ }
4206
4223
  const OptionList = forwardRef(
4207
4224
  function OptionList2({
4208
4225
  options,
@@ -5864,6 +5881,7 @@ export {
5864
5881
  TimeInput,
5865
5882
  Toast,
5866
5883
  ToastStack,
5884
+ Toaster,
5867
5885
  Toggle,
5868
5886
  cn,
5869
5887
  useIsMobile