@apliteni/apliteni-ui 0.47.0 → 0.49.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.
@@ -218,8 +218,10 @@ export function switchToggle({ checked = false, disabled = false, name, label =
218
218
  }
219
219
 
220
220
  // ---- Callout / toast / success ------------------------------------------
221
- export function callout({ variant, icon: ic = 'info', body } = {}) {
222
- return `<div class="${esc(cx('ui-callout', variant && `ui-callout--${variant}`))}"><span class="ui-callout__icon">${icon(ic)}</span><div>${body}</div></div>`;
221
+ export const calloutIcons = { info: 'info', success: 'check', warn: 'alert', danger: 'alert', neutral: 'info' };
222
+
223
+ export function callout({ variant, icon: ic = calloutIcons[variant] || 'info', body, actions } = {}) {
224
+ return `<div class="${esc(cx('ui-callout', variant && variant !== 'neutral' && `ui-callout--${variant}`))}"><span class="ui-callout__icon">${icon(ic)}</span><div class="ui-callout__body">${body}${actions != null ? `<div class="ui-toolbar ui-callout__actions">${actions}</div>` : ''}</div></div>`;
223
225
  }
224
226
  // Default icon per status — overridable with `icon`. The circle family is not
225
227
  // decoration: a circled glyph is a STATE the system reports, a bare one is an
@@ -12,6 +12,8 @@
12
12
  line-height: 1.55;
13
13
  color: var(--text);
14
14
  }
15
+ .ui-callout__body { min-width: 0; overflow-wrap: break-word; }
16
+ .ui-callout__actions { margin-top: 15px; }
15
17
  .ui-callout__icon { width: 18px; height: 18px; flex: none; margin-top: 1px; /* muted-ink: glyph — nonverbal callout icon */ color: var(--muted); }
16
18
  .ui-callout__icon svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 2.1; } /* 2.1 of a 24 box drawn at 18px = 1.58 CSS px, which is what buys the 3:1 graphic bar rather than the 4.5:1 text one. docs/specification.md#icons-and-glyphs */
17
19
  .ui-callout b { color: var(--text); font-weight: var(--weight-semibold); }
@@ -21,6 +23,7 @@
21
23
  .ui-callout--info .ui-callout__icon { color: var(--chip-info-ink); } /* the chip inks, not the raw signals: in light the raw signal cleared the graphic bar by a tenth on its own wash and read as a smudge, and a stroke is read the way text is. The two are the same value in dark by construction, so only light moves. #206 */
22
24
  .ui-callout--success { --ring-gap: inherit; background: var(--glow-green); /* ring-gap: inherit — translucent wash retains the opaque containing gap. */ }
23
25
  .ui-callout--success .ui-callout__icon { color: var(--chip-success-ink); }
26
+ .ui-callout--success a { /* muted-ink: state — opaque accent/text blend keeps links above 4.5:1 on the success wash. */ color: color-mix(in srgb, var(--accent) 95%, var(--text)); }
24
27
  .ui-callout--warn { --ring-gap: inherit; background: color-mix(in srgb, var(--amber) 13%, transparent); /* ring-gap: inherit — translucent wash retains the opaque containing gap. */ }
25
28
  .ui-callout--warn .ui-callout__icon { color: var(--chip-warn-ink); }
26
29
  .ui-callout--danger { --ring-gap: inherit; background: var(--glow-pink); /* ring-gap: inherit — translucent wash retains the opaque containing gap. */ }