@adamosuiteservices/ui 1.2.3 → 1.2.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.
@@ -1 +1 @@
1
- @theme{ --animate-toast-slide-up: toast-slide-up .2s ease-out; --animate-toast-slide-down: toast-slide-down .2s ease-out; @keyframes toast-slide-up { 0% { transform: translateY(100%); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } } @keyframes toast-slide-down { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(100%); opacity: 0; } } }
1
+ @theme{ --animate-toast-slide-up: toast-slide-up .2s ease-out; --animate-toast-slide-down: toast-slide-down .2s ease-out forwards; @keyframes toast-slide-up { 0% { transform: translateY(100%); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } } @keyframes toast-slide-down { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(100%); opacity: 0; } } }
@@ -1 +1 @@
1
- @theme inline{ --font-sans: "Open Sans", ui-sans-serif, system-ui, sans-serif; }@theme inline{ --color-background: var(--background); --color-foreground: var(--foreground); --color-card: var(--card); --color-card-foreground: var(--card-foreground); --color-popover: var(--popover); --color-popover-foreground: var(--popover-foreground); --color-primary: var(--primary); --color-primary-foreground: var(--primary-foreground); --color-secondary: var(--secondary); --color-secondary-foreground: var(--secondary-foreground); --color-muted: var(--muted); --color-muted-foreground: var(--muted-foreground); --color-accent: var(--accent); --color-accent-foreground: var(--accent-foreground); --color-destructive: var(--destructive); --color-destructive-foreground: var(--destructive-foreground); --color-border: var(--border); --color-input: var(--input); --color-ring: var(--ring); --color-chart-1: var(--chart-1); --color-chart-2: var(--chart-2); --color-chart-3: var(--chart-3); --color-chart-4: var(--chart-4); --color-chart-5: var(--chart-5); --color-sidebar: var(--sidebar); --color-sidebar-foreground: var(--sidebar-foreground); --color-sidebar-primary: var(--sidebar-primary); --color-sidebar-primary-foreground: var(--sidebar-primary-foreground); --color-sidebar-accent: var(--sidebar-accent); --color-sidebar-accent-foreground: var(--sidebar-accent-foreground); --color-sidebar-border: var(--sidebar-border); --color-sidebar-ring: var(--sidebar-ring); --color-warning: var(--warning); --color-warning-foreground: oklch(1 0 0); --color-success: var(--success); --color-success-foreground: oklch(1 0 0); --color-waiting: var(--waiting); --color-waiting-foreground: oklch(1 0 0); --color-primary-25: var(--primary-25); --color-primary-50: var(--primary-50); --color-primary-100: var(--primary-100); --color-primary-200: var(--primary-200); --color-primary-300: var(--primary-300); --color-primary-400: var(--primary-400); --color-primary-500: var(--primary-500); --color-primary-600: var(--primary-600); --color-primary-700: var(--primary-700); --color-primary-800: var(--primary-800); --color-primary-900: var(--primary-900); --color-sign: var(--sign); --color-sign-25: var(--sign-25); --color-sign-50: var(--sign-50); --color-sign-100: var(--sign-100); --color-sign-200: var(--sign-200); --color-sign-300: var(--sign-300); --color-sign-400: var(--sign-400); --color-sign-500: var(--sign-500); --color-sign-600: var(--sign-600); --color-sign-700: var(--sign-700); --color-sign-800: var(--sign-800); --color-sign-900: var(--sign-900); --color-id: var(--id); --color-id-25: var(--id-25); --color-id-50: var(--id-50); --color-id-100: var(--id-100); --color-id-200: var(--id-200); --color-id-300: var(--id-300); --color-id-400: var(--id-400); --color-id-500: var(--id-500); --color-id-600: var(--id-600); --color-id-700: var(--id-700); --color-id-800: var(--id-800); --color-id-900: var(--id-900); --color-pay: var(--pay); --color-pay-25: var(--pay-25); --color-pay-50: var(--pay-50); --color-pay-100: var(--pay-100); --color-pay-200: var(--pay-200); --color-pay-300: var(--pay-300); --color-pay-400: var(--pay-400); --color-pay-500: var(--pay-500); --color-pay-600: var(--pay-600); --color-pay-700: var(--pay-700); --color-pay-800: var(--pay-800); --color-pay-900: var(--pay-900); --color-risk: var(--risk); --color-risk-25: var(--risk-25); --color-risk-50: var(--risk-50); --color-risk-100: var(--risk-100); --color-risk-200: var(--risk-200); --color-risk-300: var(--risk-300); --color-risk-400: var(--risk-400); --color-risk-500: var(--risk-500); --color-risk-600: var(--risk-600); --color-risk-700: var(--risk-700); --color-risk-800: var(--risk-800); --color-risk-900: var(--risk-900); --color-neutrals: var(--neutrals); --color-neutrals-25: var(--neutrals-25); --color-neutrals-50: var(--neutrals-50); --color-neutrals-100: var(--neutrals-100); --color-neutrals-200: var(--neutrals-200); --color-neutrals-300: var(--neutrals-300); --color-neutrals-400: var(--neutrals-400); --color-neutrals-500: var(--neutrals-500); --color-neutrals-600: var(--neutrals-600); --color-neutrals-700: var(--neutrals-700); --color-neutrals-800: var(--neutrals-800); --color-neutrals-900: var(--neutrals-900); --color-error: var(--error); --color-error-25: var(--error-25); --color-error-50: var(--error-50); --color-error-100: var(--error-100); --color-error-200: var(--error-200); --color-error-300: var(--error-300); --color-error-400: var(--error-400); --color-error-500: var(--error-500); --color-error-600: var(--error-600); --color-error-700: var(--error-700); --color-error-800: var(--error-800); --color-error-900: var(--error-900); --color-destructive-25: var(--destructive-25); --color-destructive-50: var(--destructive-50); --color-destructive-100: var(--destructive-100); --color-destructive-200: var(--destructive-200); --color-destructive-300: var(--destructive-300); --color-destructive-400: var(--destructive-400); --color-destructive-500: var(--destructive-500); --color-destructive-600: var(--destructive-600); --color-destructive-700: var(--destructive-700); --color-destructive-800: var(--destructive-800); --color-destructive-900: var(--destructive-900); --color-warning: var(--warning); --color-warning-25: var(--warning-25); --color-warning-50: var(--warning-50); --color-warning-100: var(--warning-100); --color-warning-200: var(--warning-200); --color-warning-300: var(--warning-300); --color-warning-400: var(--warning-400); --color-warning-500: var(--warning-500); --color-warning-600: var(--warning-600); --color-warning-700: var(--warning-700); --color-warning-800: var(--warning-800); --color-warning-900: var(--warning-900); --color-success: var(--success); --color-success-25: var(--success-25); --color-success-50: var(--success-50); --color-success-100: var(--success-100); --color-success-200: var(--success-200); --color-success-300: var(--success-300); --color-success-400: var(--success-400); --color-success-500: var(--success-500); --color-success-600: var(--success-600); --color-success-700: var(--success-700); --color-success-800: var(--success-800); --color-success-900: var(--success-900); --color-waiting: var(--waiting); --color-waiting-25: var(--waiting-25); --color-waiting-50: var(--waiting-50); --color-waiting-100: var(--waiting-100); --color-waiting-200: var(--waiting-200); --color-waiting-300: var(--waiting-300); --color-waiting-400: var(--waiting-400); --color-waiting-500: var(--waiting-500); --color-waiting-600: var(--waiting-600); --color-waiting-700: var(--waiting-700); --color-waiting-800: var(--waiting-800); --color-waiting-900: var(--waiting-900); }@theme inline{ --spacing: var(--space); }@theme inline{ --radius-sm: calc(var(--radius) - 4px); --radius-md: calc(var(--radius) - 2px); --radius-lg: var(--radius); --radius-xl: calc(var(--radius) + 4px); }@theme{ --animate-toast-slide-up: toast-slide-up .2s ease-out; --animate-toast-slide-down: toast-slide-down .2s ease-out; @keyframes toast-slide-up { 0% { transform: translateY(100%); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } } @keyframes toast-slide-down { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(100%); opacity: 0; } } }
1
+ @theme inline{ --font-sans: "Open Sans", ui-sans-serif, system-ui, sans-serif; }@theme inline{ --color-background: var(--background); --color-foreground: var(--foreground); --color-card: var(--card); --color-card-foreground: var(--card-foreground); --color-popover: var(--popover); --color-popover-foreground: var(--popover-foreground); --color-primary: var(--primary); --color-primary-foreground: var(--primary-foreground); --color-secondary: var(--secondary); --color-secondary-foreground: var(--secondary-foreground); --color-muted: var(--muted); --color-muted-foreground: var(--muted-foreground); --color-accent: var(--accent); --color-accent-foreground: var(--accent-foreground); --color-destructive: var(--destructive); --color-destructive-foreground: var(--destructive-foreground); --color-border: var(--border); --color-input: var(--input); --color-ring: var(--ring); --color-chart-1: var(--chart-1); --color-chart-2: var(--chart-2); --color-chart-3: var(--chart-3); --color-chart-4: var(--chart-4); --color-chart-5: var(--chart-5); --color-sidebar: var(--sidebar); --color-sidebar-foreground: var(--sidebar-foreground); --color-sidebar-primary: var(--sidebar-primary); --color-sidebar-primary-foreground: var(--sidebar-primary-foreground); --color-sidebar-accent: var(--sidebar-accent); --color-sidebar-accent-foreground: var(--sidebar-accent-foreground); --color-sidebar-border: var(--sidebar-border); --color-sidebar-ring: var(--sidebar-ring); --color-warning: var(--warning); --color-warning-foreground: oklch(1 0 0); --color-success: var(--success); --color-success-foreground: oklch(1 0 0); --color-waiting: var(--waiting); --color-waiting-foreground: oklch(1 0 0); --color-primary-25: var(--primary-25); --color-primary-50: var(--primary-50); --color-primary-100: var(--primary-100); --color-primary-200: var(--primary-200); --color-primary-300: var(--primary-300); --color-primary-400: var(--primary-400); --color-primary-500: var(--primary-500); --color-primary-600: var(--primary-600); --color-primary-700: var(--primary-700); --color-primary-800: var(--primary-800); --color-primary-900: var(--primary-900); --color-sign: var(--sign); --color-sign-25: var(--sign-25); --color-sign-50: var(--sign-50); --color-sign-100: var(--sign-100); --color-sign-200: var(--sign-200); --color-sign-300: var(--sign-300); --color-sign-400: var(--sign-400); --color-sign-500: var(--sign-500); --color-sign-600: var(--sign-600); --color-sign-700: var(--sign-700); --color-sign-800: var(--sign-800); --color-sign-900: var(--sign-900); --color-id: var(--id); --color-id-25: var(--id-25); --color-id-50: var(--id-50); --color-id-100: var(--id-100); --color-id-200: var(--id-200); --color-id-300: var(--id-300); --color-id-400: var(--id-400); --color-id-500: var(--id-500); --color-id-600: var(--id-600); --color-id-700: var(--id-700); --color-id-800: var(--id-800); --color-id-900: var(--id-900); --color-pay: var(--pay); --color-pay-25: var(--pay-25); --color-pay-50: var(--pay-50); --color-pay-100: var(--pay-100); --color-pay-200: var(--pay-200); --color-pay-300: var(--pay-300); --color-pay-400: var(--pay-400); --color-pay-500: var(--pay-500); --color-pay-600: var(--pay-600); --color-pay-700: var(--pay-700); --color-pay-800: var(--pay-800); --color-pay-900: var(--pay-900); --color-risk: var(--risk); --color-risk-25: var(--risk-25); --color-risk-50: var(--risk-50); --color-risk-100: var(--risk-100); --color-risk-200: var(--risk-200); --color-risk-300: var(--risk-300); --color-risk-400: var(--risk-400); --color-risk-500: var(--risk-500); --color-risk-600: var(--risk-600); --color-risk-700: var(--risk-700); --color-risk-800: var(--risk-800); --color-risk-900: var(--risk-900); --color-neutrals: var(--neutrals); --color-neutrals-25: var(--neutrals-25); --color-neutrals-50: var(--neutrals-50); --color-neutrals-100: var(--neutrals-100); --color-neutrals-200: var(--neutrals-200); --color-neutrals-300: var(--neutrals-300); --color-neutrals-400: var(--neutrals-400); --color-neutrals-500: var(--neutrals-500); --color-neutrals-600: var(--neutrals-600); --color-neutrals-700: var(--neutrals-700); --color-neutrals-800: var(--neutrals-800); --color-neutrals-900: var(--neutrals-900); --color-error: var(--error); --color-error-25: var(--error-25); --color-error-50: var(--error-50); --color-error-100: var(--error-100); --color-error-200: var(--error-200); --color-error-300: var(--error-300); --color-error-400: var(--error-400); --color-error-500: var(--error-500); --color-error-600: var(--error-600); --color-error-700: var(--error-700); --color-error-800: var(--error-800); --color-error-900: var(--error-900); --color-destructive-25: var(--destructive-25); --color-destructive-50: var(--destructive-50); --color-destructive-100: var(--destructive-100); --color-destructive-200: var(--destructive-200); --color-destructive-300: var(--destructive-300); --color-destructive-400: var(--destructive-400); --color-destructive-500: var(--destructive-500); --color-destructive-600: var(--destructive-600); --color-destructive-700: var(--destructive-700); --color-destructive-800: var(--destructive-800); --color-destructive-900: var(--destructive-900); --color-warning: var(--warning); --color-warning-25: var(--warning-25); --color-warning-50: var(--warning-50); --color-warning-100: var(--warning-100); --color-warning-200: var(--warning-200); --color-warning-300: var(--warning-300); --color-warning-400: var(--warning-400); --color-warning-500: var(--warning-500); --color-warning-600: var(--warning-600); --color-warning-700: var(--warning-700); --color-warning-800: var(--warning-800); --color-warning-900: var(--warning-900); --color-success: var(--success); --color-success-25: var(--success-25); --color-success-50: var(--success-50); --color-success-100: var(--success-100); --color-success-200: var(--success-200); --color-success-300: var(--success-300); --color-success-400: var(--success-400); --color-success-500: var(--success-500); --color-success-600: var(--success-600); --color-success-700: var(--success-700); --color-success-800: var(--success-800); --color-success-900: var(--success-900); --color-waiting: var(--waiting); --color-waiting-25: var(--waiting-25); --color-waiting-50: var(--waiting-50); --color-waiting-100: var(--waiting-100); --color-waiting-200: var(--waiting-200); --color-waiting-300: var(--waiting-300); --color-waiting-400: var(--waiting-400); --color-waiting-500: var(--waiting-500); --color-waiting-600: var(--waiting-600); --color-waiting-700: var(--waiting-700); --color-waiting-800: var(--waiting-800); --color-waiting-900: var(--waiting-900); }@theme inline{ --spacing: var(--space); }@theme inline{ --radius-sm: calc(var(--radius) - 4px); --radius-md: calc(var(--radius) - 2px); --radius-lg: var(--radius); --radius-xl: calc(var(--radius) + 4px); }@theme{ --animate-toast-slide-up: toast-slide-up .2s ease-out; --animate-toast-slide-down: toast-slide-down .2s ease-out forwards; @keyframes toast-slide-up { 0% { transform: translateY(100%); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } } @keyframes toast-slide-down { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(100%); opacity: 0; } } }
package/dist/toaster.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("./jsx-runtime-BB_1_6y_.cjs"),e=require("react"),j=require("./index-Ce3QBKyj.cjs"),E=require("./index-BTzZJcis.cjs"),C=require("./index-DoxiiusW.cjs"),S=E.cva("adm:w-full adm:h-14 adm:p-4 adm:inline-flex adm:justify-center adm:items-center adm:gap-6 adm:shadow-sm",{variants:{variant:{default:"adm:bg-primary-200 adm:text-neutrals-700",destructive:"adm:bg-destructive-50 adm:text-destructive",success:"adm:bg-success-50 adm:text-success",warning:"adm:bg-warning-50 adm:text-warning"}}}),v=e.createContext(void 0);function p({children:n}){const[r,s]=e.useState(!1),[d,o]=e.useState(""),[l,i]=e.useState("default"),[T,u]=e.useState(3e3),[t,m]=e.useState(""),[a,f]=e.useState(null),h=e.useCallback(c=>{const w=c.id||`${Date.now()}-${Math.random()}`;r?(f({...c,id:w}),s(!1)):(o(c.message),i(c.variant||"default"),u(c.autoClose??3e3),m(w),s(!0))},[r]),g=e.useCallback(()=>s(!1),[]);return e.useEffect(()=>{!r&&a&&setTimeout(()=>{o(a.message),i(a.variant||"default"),u(a.autoClose??3e3),m(a.id),s(!0),f(null)},200)},[r,a]),e.createElement(v.Provider,{value:{showToast:h,closeToast:g}},[n,e.createElement(b,{key:t,message:d,variant:l,open:r,autoClose:T,onClose:g})])}function b({message:n,variant:r,open:s=!0,autoClose:d,onClose:o}){const[l,i]=e.useState(s),[T,u]=e.useState(!1),t=e.useRef(null);e.useEffect(()=>(s?(i(!0),u(!1),t.current&&clearTimeout(t.current),d&&o&&(t.current=setTimeout(()=>m(),d))):l&&(setTimeout(()=>u(!0),100),t.current=setTimeout(()=>i(!1),200)),()=>{t.current&&clearTimeout(t.current)}),[s,d,n]);const m=()=>{setTimeout(()=>{u(!0)},100),t.current=setTimeout(()=>{i(!1),o&&o()},200)},a=f=>{f.animationName==="toast-slide-down"&&i(!1)};return l?x.jsxRuntimeExports.jsx(j.Portal,{children:x.jsxRuntimeExports.jsx("div",{onAnimationEnd:a,className:"adm:fixed adm:bottom-0 adm:left-0 adm:w-full adm:z-50 adm:pointer-events-none",children:x.jsxRuntimeExports.jsx("div",{className:C.cn(S({variant:r}),"adm:w-full adm:pointer-events-auto",T?"adm:animate-toast-slide-down":"adm:animate-toast-slide-up"),children:x.jsxRuntimeExports.jsx("div",{className:"adm:flex-1 adm:text-center adm:text-sm",children:n})})})}):null}function P(){const n=e.useContext(v);if(!n)throw new Error("useToast must be used within a ToastProvider");return n}exports.Toast=b;exports.ToasterContext=v;exports.ToasterProvider=p;exports.useToast=P;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./jsx-runtime-BB_1_6y_.cjs"),i=require("react"),f=require("./index-Ce3QBKyj.cjs"),T=require("./index-BTzZJcis.cjs"),x=require("./index-DoxiiusW.cjs");class g{subscribers=[];subscribe(t){return this.subscribers.push(t),()=>{this.subscribers=this.subscribers.filter(s=>s!==t)}}emit(t){this.subscribers.forEach(s=>s(t))}}const d=new g,m=T.cva("adm:fixed adm:bottom-0 adm:left-0 adm:right-0 adm:z-50 adm:w-full adm:p-4 adm:flex adm:justify-center",{variants:{variant:{default:"adm:bg-primary-200 adm:text-neutrals-700",success:"adm:bg-success-50 adm:text-success",warning:"adm:bg-warning-50 adm:text-warning",destructive:"adm:bg-destructive-50 adm:text-destructive"}},defaultVariants:{variant:"default"}}),l=3e3;function v(){const[e,t]=i.useState(null),[s,a]=i.useState(!1);i.useEffect(()=>{const n=d.subscribe(u=>{t(u),a(!1)});return()=>{n()}},[]);const r=n=>{n.animationName==="toast-slide-down"&&(t(null),a(!1))};return e?o.jsxRuntimeExports.jsx(f.Portal,{children:o.jsxRuntimeExports.jsx(b,{closing:s,onClosing:()=>a(!0),animationEnded:r,...e})},e.id):null}function b({variant:e,message:t,autoClose:s,onClose:a,closing:r,onClosing:n,animationEnded:u}){return i.useEffect(()=>{let c;return c=setTimeout(()=>{n(),a&&a()},s||l),()=>{clearTimeout(c)}},[]),o.jsxRuntimeExports.jsx("div",{onAnimationEnd:u,className:x.cn(m({variant:e}),{"adm:animate-toast-slide-up":!r,"adm:animate-toast-slide-down":r}),children:o.jsxRuntimeExports.jsx("p",{children:t})})}class E{show(t){const s=t.id||`${Date.now()}-${Math.random()}`;d.emit({...t,id:s})}}const h=new E;exports.TOAST_AUTO_CLOSE_DEFAULT=l;exports.Toast=b;exports.ToastManager=h;exports.ToastObservable=d;exports.Toaster=v;exports.toastVariants=m;
package/dist/toaster.js CHANGED
@@ -1,87 +1,101 @@
1
- import { j as v } from "./jsx-runtime-BzflLqGi.js";
2
- import { createContext as j, useState as a, useRef as E, useEffect as p, useCallback as w, createElement as h, useContext as P } from "react";
3
- import { P as N } from "./index-yR-v1A4G.js";
4
- import { c as y } from "./index-BqtVL8d-.js";
5
- import { c as A } from "./index-CRiPKpXj.js";
6
- const I = y(
7
- "adm:w-full adm:h-14 adm:p-4 adm:inline-flex adm:justify-center adm:items-center adm:gap-6 adm:shadow-sm",
1
+ import { j as n } from "./jsx-runtime-BzflLqGi.js";
2
+ import { useState as d, useEffect as u } from "react";
3
+ import { P as l } from "./index-yR-v1A4G.js";
4
+ import { c as f } from "./index-BqtVL8d-.js";
5
+ import { c as b } from "./index-CRiPKpXj.js";
6
+ class x {
7
+ subscribers = [];
8
+ subscribe(t) {
9
+ return this.subscribers.push(t), () => {
10
+ this.subscribers = this.subscribers.filter((s) => s !== t);
11
+ };
12
+ }
13
+ emit(t) {
14
+ this.subscribers.forEach((s) => s(t));
15
+ }
16
+ }
17
+ const c = new x(), T = f(
18
+ "adm:fixed adm:bottom-0 adm:left-0 adm:right-0 adm:z-50 adm:w-full adm:p-4 adm:flex adm:justify-center",
8
19
  {
9
20
  variants: {
10
21
  variant: {
11
22
  default: "adm:bg-primary-200 adm:text-neutrals-700",
12
- destructive: "adm:bg-destructive-50 adm:text-destructive",
13
23
  success: "adm:bg-success-50 adm:text-success",
14
- warning: "adm:bg-warning-50 adm:text-warning"
24
+ warning: "adm:bg-warning-50 adm:text-warning",
25
+ destructive: "adm:bg-destructive-50 adm:text-destructive"
15
26
  }
27
+ },
28
+ defaultVariants: {
29
+ variant: "default"
16
30
  }
17
31
  }
18
- ), b = j(void 0);
19
- function D({ children: n }) {
20
- const [r, t] = a(!1), [d, o] = a(""), [l, i] = a("default"), [x, m] = a(3e3), [e, c] = a(""), [s, f] = a(null), C = w((u) => {
21
- const g = u.id || `${Date.now()}-${Math.random()}`;
22
- r ? (f({ ...u, id: g }), t(!1)) : (o(u.message), i(u.variant || "default"), m(u.autoClose ?? 3e3), c(g), t(!0));
23
- }, [r]), T = w(() => t(!1), []);
24
- return p(() => {
25
- !r && s && setTimeout(() => {
26
- o(s.message), i(s.variant || "default"), m(s.autoClose ?? 3e3), c(s.id), t(!0), f(null);
27
- }, 200);
28
- }, [r, s]), h(
29
- b.Provider,
30
- { value: { showToast: C, closeToast: T } },
31
- [
32
- n,
33
- h(V, {
34
- key: e,
35
- message: d,
36
- variant: l,
37
- open: r,
38
- autoClose: x,
39
- onClose: T
40
- })
41
- ]
42
- );
32
+ ), g = 3e3;
33
+ function _() {
34
+ const [a, t] = d(null), [s, e] = d(!1);
35
+ u(() => {
36
+ const r = c.subscribe((o) => {
37
+ t(o), e(!1);
38
+ });
39
+ return () => {
40
+ r();
41
+ };
42
+ }, []);
43
+ const i = (r) => {
44
+ r.animationName === "toast-slide-down" && (t(null), e(!1));
45
+ };
46
+ return a ? /* @__PURE__ */ n.jsx(l, { children: /* @__PURE__ */ n.jsx(
47
+ h,
48
+ {
49
+ closing: s,
50
+ onClosing: () => e(!0),
51
+ animationEnded: i,
52
+ ...a
53
+ }
54
+ ) }, a.id) : null;
43
55
  }
44
- function V({
45
- message: n,
46
- variant: r,
47
- open: t = !0,
48
- autoClose: d,
49
- onClose: o
56
+ function h({
57
+ variant: a,
58
+ message: t,
59
+ autoClose: s,
60
+ onClose: e,
61
+ closing: i,
62
+ onClosing: r,
63
+ animationEnded: o
50
64
  }) {
51
- const [l, i] = a(t), [x, m] = a(!1), e = E(null);
52
- p(() => (t ? (i(!0), m(!1), e.current && clearTimeout(e.current), d && o && (e.current = setTimeout(() => c(), d))) : l && (setTimeout(() => m(!0), 100), e.current = setTimeout(() => i(!1), 200)), () => {
53
- e.current && clearTimeout(e.current);
54
- }), [t, d, n]);
55
- const c = () => {
56
- setTimeout(() => {
57
- m(!0);
58
- }, 100), e.current = setTimeout(() => {
59
- i(!1), o && o();
60
- }, 200);
61
- }, s = (f) => {
62
- f.animationName === "toast-slide-down" && i(!1);
63
- };
64
- return l ? /* @__PURE__ */ v.jsx(N, { children: /* @__PURE__ */ v.jsx("div", { onAnimationEnd: s, className: "adm:fixed adm:bottom-0 adm:left-0 adm:w-full adm:z-50 adm:pointer-events-none", children: /* @__PURE__ */ v.jsx(
65
+ return u(() => {
66
+ let m;
67
+ return m = setTimeout(() => {
68
+ r(), e && e();
69
+ }, s || g), () => {
70
+ clearTimeout(m);
71
+ };
72
+ }, []), /* @__PURE__ */ n.jsx(
65
73
  "div",
66
74
  {
67
- className: A(
68
- I({ variant: r }),
69
- "adm:w-full adm:pointer-events-auto",
70
- x ? "adm:animate-toast-slide-down" : "adm:animate-toast-slide-up"
75
+ onAnimationEnd: o,
76
+ className: b(
77
+ T({ variant: a }),
78
+ {
79
+ "adm:animate-toast-slide-up": !i,
80
+ "adm:animate-toast-slide-down": i
81
+ }
71
82
  ),
72
- children: /* @__PURE__ */ v.jsx("div", { className: "adm:flex-1 adm:text-center adm:text-sm", children: n })
83
+ children: /* @__PURE__ */ n.jsx("p", { children: t })
73
84
  }
74
- ) }) }) : null;
85
+ );
75
86
  }
76
- function O() {
77
- const n = P(b);
78
- if (!n)
79
- throw new Error("useToast must be used within a ToastProvider");
80
- return n;
87
+ class p {
88
+ show(t) {
89
+ const s = t.id || `${Date.now()}-${Math.random()}`;
90
+ c.emit({ ...t, id: s });
91
+ }
81
92
  }
93
+ const A = new p();
82
94
  export {
83
- V as Toast,
84
- b as ToasterContext,
85
- D as ToasterProvider,
86
- O as useToast
95
+ g as TOAST_AUTO_CLOSE_DEFAULT,
96
+ h as Toast,
97
+ A as ToastManager,
98
+ c as ToastObservable,
99
+ _ as Toaster,
100
+ T as toastVariants
87
101
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./jsx-runtime-BB_1_6y_.cjs"),d=require("./index-DoxiiusW.cjs"),i=require("./index-BTzZJcis.cjs"),o=require("./index-BKbK2GzY.cjs"),m=i.cva("adm:text-neutrals-700",{variants:{variant:{lg:"adm:text-lg adm:leading-1",md:"adm:text-base adm:leading-0.5",sm:"adm:text-sm adm:leading",xs:"adm:text-xs adm:leading-[20px]",caption:"adm:text-[11px] adm:leading-[18px]"}}});function x({className:t,variant:a,asChild:e=!1,...n}){const s=e?o.Slot:"p";return r.jsxRuntimeExports.jsx(s,{"data-slot":"typography",className:d.cn(m({variant:a,className:t})),...n})}exports.Typography=x;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./jsx-runtime-BB_1_6y_.cjs"),o=require("./index-DoxiiusW.cjs"),i=require("./index-BTzZJcis.cjs"),x=require("./index-BKbK2GzY.cjs"),m=i.cva("adm:text-neutrals-700",{variants:{variant:{lg:"adm:text-lg",md:"adm:text-base",sm:"adm:text-sm",xs:"adm:text-xs",caption:"adm:text-[11px]"}}});function p({className:t,variant:e,asChild:a=!1,...s}){const r=a?x.Slot:"p";return n.jsxRuntimeExports.jsx(r,{"data-slot":"typography",className:o.cn(m({variant:e,className:t})),...s})}exports.Typography=p;
@@ -1,34 +1,34 @@
1
1
  import { j as r } from "./jsx-runtime-BzflLqGi.js";
2
- import { c as d } from "./index-CRiPKpXj.js";
2
+ import { c as p } from "./index-CRiPKpXj.js";
3
3
  import { c as e } from "./index-BqtVL8d-.js";
4
- import { S as p } from "./index-6oTEokEx.js";
4
+ import { S as x } from "./index-6oTEokEx.js";
5
5
  const n = e("adm:text-neutrals-700", {
6
6
  variants: {
7
7
  variant: {
8
- lg: "adm:text-lg adm:leading-1",
9
- md: "adm:text-base adm:leading-0.5",
10
- sm: "adm:text-sm adm:leading",
11
- xs: "adm:text-xs adm:leading-[20px]",
12
- caption: "adm:text-[11px] adm:leading-[18px]"
8
+ lg: "adm:text-lg",
9
+ md: "adm:text-base",
10
+ sm: "adm:text-sm",
11
+ xs: "adm:text-xs",
12
+ caption: "adm:text-[11px]"
13
13
  }
14
14
  }
15
15
  });
16
- function c({
17
- className: a,
18
- variant: t,
19
- asChild: m = !1,
20
- ...s
16
+ function f({
17
+ className: t,
18
+ variant: a,
19
+ asChild: s = !1,
20
+ ...m
21
21
  }) {
22
- const o = m ? p : "p";
22
+ const o = s ? x : "p";
23
23
  return /* @__PURE__ */ r.jsx(
24
24
  o,
25
25
  {
26
26
  "data-slot": "typography",
27
- className: d(n({ variant: t, className: a })),
28
- ...s
27
+ className: p(n({ variant: a, className: t })),
28
+ ...m
29
29
  }
30
30
  );
31
31
  }
32
32
  export {
33
- c as Typography
33
+ f as Typography
34
34
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adamosuiteservices/ui",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1 +0,0 @@
1
- export declare function useToast(): import('./toaster').ToastContextType;