anentrypoint-design 0.0.350 → 0.0.352

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anentrypoint-design",
3
- "version": "0.0.350",
3
+ "version": "0.0.352",
4
4
  "description": "247420 design system SDK — webjsx + modified ripple-ui, single-file ESM bundle for reproducible use of the AnEntrypoint design.",
5
5
  "type": "module",
6
6
  "main": "./dist/247420.js",
@@ -634,20 +634,32 @@ function ensureToastHost() {
634
634
  return _toastHostEl;
635
635
  }
636
636
 
637
- export function toast({ message, kind = 'info', duration = 3000 } = {}) {
637
+ export function toast({ message, kind = 'info', duration = 3000, actionLabel, onAction } = {}) {
638
638
  const host = ensureToastHost();
639
639
  if (!host) return () => {};
640
640
  const el = document.createElement('div');
641
641
  el.className = 'ds-ep-toast kind-' + kind;
642
642
  el.setAttribute('role', 'status');
643
643
  el.setAttribute('aria-live', 'polite');
644
- el.textContent = message;
645
- host.appendChild(el);
644
+ const text = document.createElement('span');
645
+ text.className = 'ds-ep-toast-msg';
646
+ text.textContent = message;
647
+ el.appendChild(text);
646
648
  const dismiss = () => {
647
649
  if (!el.parentNode) return;
648
650
  el.classList.add('leaving');
649
651
  setTimeout(() => { el.parentNode && el.parentNode.removeChild(el); }, 200);
650
652
  };
653
+ if (actionLabel && onAction) {
654
+ el.classList.add('has-action');
655
+ const btn = document.createElement('button');
656
+ btn.type = 'button';
657
+ btn.className = 'ds-ep-toast-action';
658
+ btn.textContent = actionLabel;
659
+ btn.onclick = () => onAction(dismiss);
660
+ el.appendChild(btn);
661
+ }
662
+ host.appendChild(el);
651
663
  if (duration > 0) setTimeout(dismiss, duration);
652
664
  return dismiss;
653
665
  }