react-strawberry-toast 1.3.0 → 1.4.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/dist/headless.d.mts +2 -0
- package/dist/headless.d.ts +2 -0
- package/dist/index.d.mts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
package/dist/headless.d.mts
CHANGED
package/dist/headless.d.ts
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
1
|
+
import React$1, { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
type Position = 'bottom-left' | 'bottom-center' | 'bottom-right' | 'top-left' | 'top-center' | 'top-right';
|
|
4
4
|
type ToastType = 'default' | 'custom' | 'success' | 'error' | 'loading' | 'warn';
|
|
@@ -6,6 +6,8 @@ interface BaseOptions {
|
|
|
6
6
|
toastId?: string;
|
|
7
7
|
timeOut?: number;
|
|
8
8
|
removeTimeOut?: number;
|
|
9
|
+
className?: string;
|
|
10
|
+
style?: React.CSSProperties;
|
|
9
11
|
}
|
|
10
12
|
interface ToastBaseState {
|
|
11
13
|
toastId: string;
|
|
@@ -77,14 +79,14 @@ declare const toast: {
|
|
|
77
79
|
|
|
78
80
|
interface ToastContainerProps {
|
|
79
81
|
className?: string;
|
|
80
|
-
style?: React.CSSProperties;
|
|
82
|
+
style?: React$1.CSSProperties;
|
|
81
83
|
position?: Position;
|
|
82
84
|
containerId?: string;
|
|
83
85
|
reverse?: boolean;
|
|
84
86
|
gap?: number;
|
|
85
87
|
pauseOnActivate?: boolean;
|
|
86
88
|
}
|
|
87
|
-
declare function ToastContainer({ className, style, position: globalPosition, containerId, gap, reverse, pauseOnActivate, }: ToastContainerProps): React.JSX.Element;
|
|
89
|
+
declare function ToastContainer({ className, style, position: globalPosition, containerId, gap, reverse, pauseOnActivate, }: ToastContainerProps): React$1.JSX.Element;
|
|
88
90
|
|
|
89
91
|
declare const useToasts: () => Array<NonHeadlessToastState>;
|
|
90
92
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
1
|
+
import React$1, { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
type Position = 'bottom-left' | 'bottom-center' | 'bottom-right' | 'top-left' | 'top-center' | 'top-right';
|
|
4
4
|
type ToastType = 'default' | 'custom' | 'success' | 'error' | 'loading' | 'warn';
|
|
@@ -6,6 +6,8 @@ interface BaseOptions {
|
|
|
6
6
|
toastId?: string;
|
|
7
7
|
timeOut?: number;
|
|
8
8
|
removeTimeOut?: number;
|
|
9
|
+
className?: string;
|
|
10
|
+
style?: React.CSSProperties;
|
|
9
11
|
}
|
|
10
12
|
interface ToastBaseState {
|
|
11
13
|
toastId: string;
|
|
@@ -77,14 +79,14 @@ declare const toast: {
|
|
|
77
79
|
|
|
78
80
|
interface ToastContainerProps {
|
|
79
81
|
className?: string;
|
|
80
|
-
style?: React.CSSProperties;
|
|
82
|
+
style?: React$1.CSSProperties;
|
|
81
83
|
position?: Position;
|
|
82
84
|
containerId?: string;
|
|
83
85
|
reverse?: boolean;
|
|
84
86
|
gap?: number;
|
|
85
87
|
pauseOnActivate?: boolean;
|
|
86
88
|
}
|
|
87
|
-
declare function ToastContainer({ className, style, position: globalPosition, containerId, gap, reverse, pauseOnActivate, }: ToastContainerProps): React.JSX.Element;
|
|
89
|
+
declare function ToastContainer({ className, style, position: globalPosition, containerId, gap, reverse, pauseOnActivate, }: ToastContainerProps): React$1.JSX.Element;
|
|
88
90
|
|
|
89
91
|
declare const useToasts: () => Array<NonHeadlessToastState>;
|
|
90
92
|
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var
|
|
2
|
+
"use strict";var J=Object.create;var I=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,tt=Object.prototype.hasOwnProperty;var et=(t,o)=>{for(var e in o)I(t,e,{get:o[e],enumerable:!0})},L=(t,o,e,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of Q(o))!tt.call(t,i)&&i!==e&&I(t,i,{get:()=>o[i],enumerable:!(c=K(o,i))||c.enumerable});return t};var N=(t,o,e)=>(e=t!=null?J(Z(t)):{},L(o||!t||!t.__esModule?I(e,"default",{value:t,enumerable:!0}):e,t)),ot=t=>L(I({},"__esModule",{value:!0}),t);var ct={};et(ct,{ToastContainer:()=>it,toast:()=>a,toastStore:()=>l,useToasts:()=>k});module.exports=ot(ct);var z=()=>{let t=0;return()=>String(t++)};var P=class{state=[];listeners=new Set;activatedToasts=new Set;toastTimers=new Map;constructor(){}subscribe(o){return this.listeners.add(o),()=>{this.listeners.delete(o)}}setState(o){this.state=typeof o=="function"?o(this.state):o,this.listeners.forEach(e=>e())}getSnapShot(){return this.state}};var d="react-strawberry-toast";var H=t=>{let o=r=>{let s=t.toastTimers.get(r);clearTimeout(s),t.toastTimers.delete(r)},e=r=>{t.activatedToasts.add(r)},c=r=>t.activatedToasts.has(r),i=(r,s=200)=>{c(r)&&(t.activatedToasts.delete(r),setTimeout(()=>{t.state=t.state.filter(n=>n.toastId!==r),t.setState([...t.state])},s),o(r))},u=()=>{t.setState([])},T=(r,s,n)=>{t.state=t.state.map(b=>b.toastId===r?{...b,...n,updated:new Date().getTime(),data:s}:b),t.setState([...t.state])},y=r=>{let s=new Date().getTime();t.state=t.state.map(n=>n.toastId===r?{...n,pausedAt:s}:n),o(r),t.setState([...t.state])},_=(r,s)=>{let n=setTimeout(()=>{var A;t.state=t.state.map(v=>v.toastId===r?{...v,isVisible:!1}:v),t.setState([...t.state]);let b=(A=t.state.find(v=>v.toastId===r))==null?void 0:A.removeTimeOut;i(r,b)},s>2147483647?2147483647:s);t.toastTimers.set(r,n)};return{setActive:e,isActive:c,disappear:_,resume:r=>{if(t.toastTimers.has(r))return;let s=t.state.find(b=>b.toastId===r);if(!s)return;let n=s.createdAt+(s.timeOut||3e3)-(s.pausedAt||0);_(r,n)},pause:y,replace:T,remove:i,allClear:u}};var l=new P,rt=z(),g=(t="default")=>(o,e={})=>{let{timeOut:c=3e3,removeTimeOut:i=200,pauseOnHover:u=!0,toastId:T,className:y,style:_}=e,p=T||rt();if(a.isActive(p))throw new Error("A duplicate custom ID is not available.");let r=new Date().getTime(),s={updated:null,pausedAt:null,className:y||"",style:_||{},icon:e.icon||null,containerId:e.containerId||null,position:e.position||null,timeOut:c>2147483647?2147483647:c,toastId:p,data:o,createdAt:r,toastType:t,pauseOnHover:u,removeTimeOut:i,isVisible:!0};return l.state.push(s),l.setState([...l.state]),p},a=(t,o={})=>g()(t,o),w=H(l);a.setActive=w.setActive;a.isActive=w.isActive;a.disappear=w.disappear;a.resume=w.resume;a.pause=w.pause;a.replace=w.replace;a.remove=w.remove;a.allClear=w.allClear;a.success=g("success");a.error=g("error");a.warn=g("warn");a.loading=g("loading");a.custom=g("custom");a.promise=(t,o,e={})=>{let{loading:c,success:i,error:u}=o,T=a.loading(c,{...e,timeOut:2147483647});t.then(y=>{a.replace(T,typeof i=="function"?i(y):i,{...e,timeOut:e.timeOut||3e3,toastType:"success"})}).catch(y=>{a.replace(T,typeof u=="function"?u(y):u,{...e,timeOut:e.timeOut||3e3,toastType:"error"})})};var O=N(require("react"));var f=N(require("react"));var D=require("react");function W({condition:t,children:o}){let e=D.Children.toArray(o);if(e.length>2)throw new Error("The number of children exceeds two.");return e.find(c=>t?c.key===".0":c.key===".1")}function Y({children:t}){return t}function U({children:t}){return t}var V=({isVisible:t,position:o})=>t?/top/i.test(o)?`${d}__fade-in`:`${d}__fade-in-reverse`:/bottom/i.test(o)?`${d}__fade-out-reverse`:`${d}__fade-out`;var m=N(require("react"));function at(){return m.default.createElement("svg",{stroke:"none",fill:"none",strokeWidth:"2",viewBox:"0 0 24 24",strokeLinecap:"round",strokeLinejoin:"round",height:"22",width:"22",xmlns:"http://www.w3.org/2000/svg"},m.default.createElement("path",{stroke:"none",d:"M0 0h24v24H0z"}),m.default.createElement("path",{d:"M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z",strokeWidth:"0",fill:"#1ab173"}))}function st(){return m.default.createElement("svg",{stroke:"none",fill:"#eb2639",strokeWidth:"2",viewBox:"0 0 24 24",height:"22",width:"22",xmlns:"http://www.w3.org/2000/svg"},m.default.createElement("path",{d:"M11.953 2C6.465 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.493 2 11.953 2zM13 17h-2v-2h2v2zm0-4h-2V7h2v6z"}))}function nt(){return m.default.createElement("svg",{stroke:"none",fill:"#fcba03",strokeWidth:"0",viewBox:"0 0 1024 1024",height:"22",width:"22",xmlns:"http://www.w3.org/2000/svg"},m.default.createElement("path",{d:"M955.7 856l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zM480 416c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v184c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V416zm32 352a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z"}))}var S={success:m.default.createElement(at,null),error:m.default.createElement(st,null),loading:m.default.createElement("div",{className:`${d}__loading`}),warn:m.default.createElement(nt,null)};function X({toastProps:t,pauseOnActivate:o}){let{toastId:e,isVisible:c,timeOut:i,containerId:u,className:T,style:y,icon:_,updated:p,toastType:r,position:s,data:n,pauseOnHover:b}=t,A=V({isVisible:c,position:s}),v=typeof n=="function"?n({toastId:e,close:()=>a.disappear(e,0),immediatelyClose:()=>{a.disappear(e,0),a.remove(e,0)},icons:{success:S.success,error:S.error,warn:S.warn,loading:S.loading},isVisible:c}):n,R=()=>{b&&a.pause(e)},G=()=>{b&&a.resume(e)};(0,f.useEffect)(()=>{if(!o)return;let E=()=>{a.resume(e)},$=()=>{a.pause(e)};return window.addEventListener("focus",E),window.addEventListener("blur",$),()=>{window.removeEventListener("focus",E),window.removeEventListener("blur",$)}},[]),(0,f.useEffect)(()=>{a.isActive(e)||(a.setActive(e),a.disappear(e,i))},[e]),(0,f.useEffect)(()=>{if(p!==null){let E=i>=2147483647?3e3:i;a.disappear(e,E)}},[p]);let C=_||(r==="custom"||r==="default"?null:S[r]),q=/center/i.test(s)?"-center":/left/i.test(s)?"-left":"-right",F=r==="custom"?"":`${d}__toast${q} ${A}`;return f.default.createElement("div",{role:"alert",className:F,"data-testid":`container-${u||"default"}`,onMouseEnter:R,onMouseLeave:G},f.default.createElement(W,{condition:r!=="custom"},f.default.createElement(Y,null,f.default.createElement("div",{className:T||`${d}__toast-content`,style:y},C&&f.default.createElement("span",{className:`${d}__toast-icon`},C),v)),f.default.createElement(U,null,v)))}var j=require("react");var k=()=>(0,j.useSyncExternalStore)(l.subscribe.bind(l),l.getSnapShot.bind(l),l.getSnapShot.bind(l));var B=({position:t,reverse:o=!1})=>/top/i.test(t)?o?"column-reverse":"column":/bottom/i.test(t)?o?"column":"column-reverse":"column";function it({className:t,style:o,position:e="top-center",containerId:c="",gap:i=9,reverse:u=!1,pauseOnActivate:T=!0}){let _=k().reduce((p,r)=>{let s=r.position||e;return r.position=s,p[s]=p[s]||[],p[s].push(r),p},{});return O.default.createElement("div",{id:`${d}__root`},Object.entries(_).map(([p,r])=>{let s=B({position:p,reverse:u});return O.default.createElement("div",{key:p,"data-testid":p,className:`${`${d}__z9999`} ${t||`${d}__toast-container ${d}__${p}`}`,style:{flexDirection:s,gap:i,...o}},r.filter(n=>c?n.containerId===c:!n.containerId).map(n=>O.default.createElement(X,{key:n.toastId,toastProps:n,pauseOnActivate:T})))}))}
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var
|
|
2
|
+
var C=()=>{let t=0;return()=>String(t++)};var I=class{state=[];listeners=new Set;activatedToasts=new Set;toastTimers=new Map;constructor(){}subscribe(s){return this.listeners.add(s),()=>{this.listeners.delete(s)}}setState(s){this.state=typeof s=="function"?s(this.state):s,this.listeners.forEach(o=>o())}getSnapShot(){return this.state}};var p="react-strawberry-toast";var $=t=>{let s=e=>{let a=t.toastTimers.get(e);clearTimeout(a),t.toastTimers.delete(e)},o=e=>{t.activatedToasts.add(e)},c=e=>t.activatedToasts.has(e),d=(e,a=200)=>{c(e)&&(t.activatedToasts.delete(e),setTimeout(()=>{t.state=t.state.filter(n=>n.toastId!==e),t.setState([...t.state])},a),s(e))},l=()=>{t.setState([])},f=(e,a,n)=>{t.state=t.state.map(y=>y.toastId===e?{...y,...n,updated:new Date().getTime(),data:a}:y),t.setState([...t.state])},T=e=>{let a=new Date().getTime();t.state=t.state.map(n=>n.toastId===e?{...n,pausedAt:a}:n),s(e),t.setState([...t.state])},b=(e,a)=>{let n=setTimeout(()=>{var A;t.state=t.state.map(_=>_.toastId===e?{..._,isVisible:!1}:_),t.setState([...t.state]);let y=(A=t.state.find(_=>_.toastId===e))==null?void 0:A.removeTimeOut;d(e,y)},a>2147483647?2147483647:a);t.toastTimers.set(e,n)};return{setActive:o,isActive:c,disappear:b,resume:e=>{if(t.toastTimers.has(e))return;let a=t.state.find(y=>y.toastId===e);if(!a)return;let n=a.createdAt+(a.timeOut||3e3)-(a.pausedAt||0);b(e,n)},pause:T,replace:f,remove:d,allClear:l}};var m=new I,R=C(),x=(t="default")=>(s,o={})=>{let{timeOut:c=3e3,removeTimeOut:d=200,pauseOnHover:l=!0,toastId:f,className:T,style:b}=o,i=f||R();if(r.isActive(i))throw new Error("A duplicate custom ID is not available.");let e=new Date().getTime(),a={updated:null,pausedAt:null,className:T||"",style:b||{},icon:o.icon||null,containerId:o.containerId||null,position:o.position||null,timeOut:c>2147483647?2147483647:c,toastId:i,data:s,createdAt:e,toastType:t,pauseOnHover:l,removeTimeOut:d,isVisible:!0};return m.state.push(a),m.setState([...m.state]),i},r=(t,s={})=>x()(t,s),h=$(m);r.setActive=h.setActive;r.isActive=h.isActive;r.disappear=h.disappear;r.resume=h.resume;r.pause=h.pause;r.replace=h.replace;r.remove=h.remove;r.allClear=h.allClear;r.success=x("success");r.error=x("error");r.warn=x("warn");r.loading=x("loading");r.custom=x("custom");r.promise=(t,s,o={})=>{let{loading:c,success:d,error:l}=s,f=r.loading(c,{...o,timeOut:2147483647});t.then(T=>{r.replace(f,typeof d=="function"?d(T):d,{...o,timeOut:o.timeOut||3e3,toastType:"success"})}).catch(T=>{r.replace(f,typeof l=="function"?l(T):l,{...o,timeOut:o.timeOut||3e3,toastType:"error"})})};import N from"react";import S,{useEffect as O}from"react";import{Children as G}from"react";function L({condition:t,children:s}){let o=G.toArray(s);if(o.length>2)throw new Error("The number of children exceeds two.");return o.find(c=>t?c.key===".0":c.key===".1")}function z({children:t}){return t}function H({children:t}){return t}var D=({isVisible:t,position:s})=>t?/top/i.test(s)?`${p}__fade-in`:`${p}__fade-in-reverse`:/bottom/i.test(s)?`${p}__fade-out-reverse`:`${p}__fade-out`;import u from"react";function q(){return u.createElement("svg",{stroke:"none",fill:"none",strokeWidth:"2",viewBox:"0 0 24 24",strokeLinecap:"round",strokeLinejoin:"round",height:"22",width:"22",xmlns:"http://www.w3.org/2000/svg"},u.createElement("path",{stroke:"none",d:"M0 0h24v24H0z"}),u.createElement("path",{d:"M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z",strokeWidth:"0",fill:"#1ab173"}))}function F(){return u.createElement("svg",{stroke:"none",fill:"#eb2639",strokeWidth:"2",viewBox:"0 0 24 24",height:"22",width:"22",xmlns:"http://www.w3.org/2000/svg"},u.createElement("path",{d:"M11.953 2C6.465 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.493 2 11.953 2zM13 17h-2v-2h2v2zm0-4h-2V7h2v6z"}))}function J(){return u.createElement("svg",{stroke:"none",fill:"#fcba03",strokeWidth:"0",viewBox:"0 0 1024 1024",height:"22",width:"22",xmlns:"http://www.w3.org/2000/svg"},u.createElement("path",{d:"M955.7 856l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zM480 416c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v184c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V416zm32 352a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z"}))}var g={success:u.createElement(q,null),error:u.createElement(F,null),loading:u.createElement("div",{className:`${p}__loading`}),warn:u.createElement(J,null)};function W({toastProps:t,pauseOnActivate:s}){let{toastId:o,isVisible:c,timeOut:d,containerId:l,className:f,style:T,icon:b,updated:i,toastType:e,position:a,data:n,pauseOnHover:y}=t,A=D({isVisible:c,position:a}),_=typeof n=="function"?n({toastId:o,close:()=>r.disappear(o,0),immediatelyClose:()=>{r.disappear(o,0),r.remove(o,0)},icons:{success:g.success,error:g.error,warn:g.warn,loading:g.loading},isVisible:c}):n,V=()=>{y&&r.pause(o)},X=()=>{y&&r.resume(o)};O(()=>{if(!s)return;let E=()=>{r.resume(o)},k=()=>{r.pause(o)};return window.addEventListener("focus",E),window.addEventListener("blur",k),()=>{window.removeEventListener("focus",E),window.removeEventListener("blur",k)}},[]),O(()=>{r.isActive(o)||(r.setActive(o),r.disappear(o,d))},[o]),O(()=>{if(i!==null){let E=d>=2147483647?3e3:d;r.disappear(o,E)}},[i]);let M=b||(e==="custom"||e==="default"?null:g[e]),j=/center/i.test(a)?"-center":/left/i.test(a)?"-left":"-right",B=e==="custom"?"":`${p}__toast${j} ${A}`;return S.createElement("div",{role:"alert",className:B,"data-testid":`container-${l||"default"}`,onMouseEnter:V,onMouseLeave:X},S.createElement(L,{condition:e!=="custom"},S.createElement(z,null,S.createElement("div",{className:f||`${p}__toast-content`,style:T},M&&S.createElement("span",{className:`${p}__toast-icon`},M),_)),S.createElement(H,null,_)))}import{useSyncExternalStore as K}from"react";var Y=()=>K(m.subscribe.bind(m),m.getSnapShot.bind(m),m.getSnapShot.bind(m));var U=({position:t,reverse:s=!1})=>/top/i.test(t)?s?"column-reverse":"column":/bottom/i.test(t)?s?"column":"column-reverse":"column";function $t({className:t,style:s,position:o="top-center",containerId:c="",gap:d=9,reverse:l=!1,pauseOnActivate:f=!0}){let b=Y().reduce((i,e)=>{let a=e.position||o;return e.position=a,i[a]=i[a]||[],i[a].push(e),i},{});return N.createElement("div",{id:`${p}__root`},Object.entries(b).map(([i,e])=>{let a=U({position:i,reverse:l});return N.createElement("div",{key:i,"data-testid":i,className:`${`${p}__z9999`} ${t||`${p}__toast-container ${p}__${i}`}`,style:{flexDirection:a,gap:d,...s}},e.filter(n=>c?n.containerId===c:!n.containerId).map(n=>N.createElement(W,{key:n.toastId,toastProps:n,pauseOnActivate:f})))}))}export{$t as ToastContainer,r as toast,m as toastStore,Y as useToasts};
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@keyframes l3{to{transform:rotate(1turn)}}@keyframes react-strawberry-toast_fade-in{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes react-strawberry-toast_fade-out{0%{transform:translateY(0);opacity:1}to{transform:translateY(-100%);opacity:0}}@keyframes react-strawberry-toast_fade-in-reverse{0%{transform:translateY(100%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes react-strawberry-toast_fade-out-reverse{0%{transform:translateY(0);opacity:1}to{transform:translateY(100%);opacity:0}}.react-strawberry-toast__z9999{z-index:9999}.react-strawberry-toast__toast-container{pointer-events:auto;position:fixed;z-index:9999;display:flex}.react-strawberry-toast__top-left{top:16px;left:16px}.react-strawberry-toast__top-center{top:16px;left:50%;transform:translate(-50%)}.react-strawberry-toast__top-right{top:16px;right:16px}.react-strawberry-toast__bottom-left{bottom:16px;left:16px}.react-strawberry-toast__bottom-center{bottom:16px;left:50%;transform:translate(-50%)}.react-strawberry-toast__bottom-right{bottom:16px;right:16px}.react-strawberry-toast__toast{display:flex}.react-strawberry-toast__toast-center{display:flex;justify-content:center}.react-strawberry-toast__toast-content{box-sizing:border-box;background-color:#fff;padding:10px;display:flex;align-items:center;gap:5px;border-radius:8px;box-shadow:2px 4px 10px #0000001a;min-height:47px}.react-strawberry-toast__toast-icon{width:20px}.react-strawberry-toast__fade-in{animation:react-strawberry-toast_fade-in .3s
|
|
1
|
+
@keyframes l3{to{transform:rotate(1turn)}}@keyframes react-strawberry-toast_fade-in{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes react-strawberry-toast_fade-out{0%{transform:translateY(0);opacity:1}to{transform:translateY(-100%);opacity:0}}@keyframes react-strawberry-toast_fade-in-reverse{0%{transform:translateY(100%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes react-strawberry-toast_fade-out-reverse{0%{transform:translateY(0);opacity:1}to{transform:translateY(100%);opacity:0}}.react-strawberry-toast__z9999{z-index:9999}.react-strawberry-toast__toast-container{pointer-events:auto;position:fixed;z-index:9999;display:flex}.react-strawberry-toast__top-left{top:16px;left:16px}.react-strawberry-toast__top-center{top:16px;left:50%;transform:translate(-50%)}.react-strawberry-toast__top-right{top:16px;right:16px}.react-strawberry-toast__bottom-left{bottom:16px;left:16px}.react-strawberry-toast__bottom-center{bottom:16px;left:50%;transform:translate(-50%)}.react-strawberry-toast__bottom-right{bottom:16px;right:16px}.react-strawberry-toast__toast-left{display:flex}.react-strawberry-toast__toast-center{display:flex;justify-content:center}.react-strawberry-toast__toast-right{display:flex;justify-content:flex-end}.react-strawberry-toast__toast-content{box-sizing:border-box;background-color:#fff;padding:10px;display:flex;align-items:center;gap:5px;border-radius:8px;box-shadow:2px 4px 10px #0000001a;min-height:47px}.react-strawberry-toast__toast-icon{width:20px}.react-strawberry-toast__fade-in{animation:react-strawberry-toast_fade-in .3s cubic-bezier(.43,.14,.2,1.05)}.react-strawberry-toast__fade-out{animation:react-strawberry-toast_fade-out .3s cubic-bezier(.43,.14,.2,1.05)}.react-strawberry-toast__fade-in-reverse{animation:react-strawberry-toast_fade-in-reverse .3s cubic-bezier(.43,.14,.2,1.05)}.react-strawberry-toast__fade-out-reverse{animation:react-strawberry-toast_fade-out-reverse .3s cubic-bezier(.43,.14,.2,1.05)}.react-strawberry-toast__loading{width:18px;padding:3.5px;aspect-ratio:1;border-radius:50%;background:#6f6f70;--_m: conic-gradient(#0000 10%, #000), linear-gradient(#000 0 0) content-box;-webkit-mask:var(--_m);mask:var(--_m);-webkit-mask-composite:source-out;mask-composite:subtract;animation:l3 1s infinite linear}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-strawberry-toast",
|
|
3
3
|
"description": "A simple and customizable React toast library",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.4.0",
|
|
5
5
|
"author": "dkpark10",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"keywords": [
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"test:ui": "vitest --ui",
|
|
58
58
|
"test:coverage": "vitest --coverage",
|
|
59
59
|
"prepare": "husky install",
|
|
60
|
-
"deploy": "pnpm run test && pnpm run build && npm publish --access=public"
|
|
60
|
+
"deploy": "pnpm run test --run && pnpm run build && npm publish --access=public"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@commitlint/cli": "^19.6.1",
|