anentrypoint-design 0.0.349 → 0.0.351

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.349",
3
+ "version": "0.0.351",
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",
@@ -473,7 +473,7 @@ export function AgentChat(props = {}) {
473
473
  : null;
474
474
 
475
475
  const threadBody = h('div', { class: 'agentchat-thread-wrap' },
476
- h('div', { class: 'agentchat-thread', ref: threadRef(messages.length), role: 'log', 'aria-label': 'conversation' },
476
+ h('div', { class: 'agentchat-thread', ref: threadRef(messages.length), role: 'log', 'aria-label': 'conversation', 'aria-live': 'polite', 'aria-relevant': 'additions' },
477
477
  emptyState,
478
478
  earlierRow,
479
479
  ...rows.filter(Boolean),
@@ -530,7 +530,7 @@ export function Chat({ title = 'chat', sub, messages = [], composer, header, sug
530
530
  ? h('span', { class: 'sub', 'aria-live': 'polite' }, msgCount + (msgCount === 1 ? ' message' : ' messages'))
531
531
  : null
532
532
  ),
533
- h('div', { class: 'chat-thread', ref: threadRef, role: 'log', 'aria-label': 'chat messages' },
533
+ h('div', { class: 'chat-thread', ref: threadRef, role: 'log', 'aria-label': 'chat messages', 'aria-live': 'polite', 'aria-relevant': 'additions' },
534
534
  messages.length === 0
535
535
  ? h('div', { key: '_empty', class: 'chat-empty', role: 'status' },
536
536
  h('p', { class: 'chat-empty-title' }, t('chat.startConversation', 'start a conversation')),
@@ -578,7 +578,7 @@ export function AICat({ name = 'aicat', messages = [], thinking, composer, statu
578
578
  ? h('span', { class: 'sub', 'aria-live': 'polite' }, messages.length + (messages.length === 1 ? ' turn' : ' turns'))
579
579
  : null
580
580
  ),
581
- h('div', { class: 'chat-thread', ref: threadRef, role: 'log', 'aria-label': 'conversation turns' },
581
+ h('div', { class: 'chat-thread', ref: threadRef, role: 'log', 'aria-label': 'conversation turns', 'aria-live': 'polite', 'aria-relevant': 'additions' },
582
582
  ...all.map((m, i) => ChatMessage({ ...m, key: m.key != null ? m.key : i }))
583
583
  ),
584
584
  composer || null
@@ -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
  }