@sarunyu/system-one 4.7.4 → 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 +18 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -1
- package/dist/src/components/toast.d.ts +17 -0
- package/dist/src/components/toast.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -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;
|