@kaufmann-lab/ui 0.1.29 → 0.1.30
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.
|
@@ -1240,7 +1240,8 @@ const TONE_ICON = {
|
|
|
1240
1240
|
* El color sale siempre de los tokens (`*-soft`, `*-strong`), nunca de un input.
|
|
1241
1241
|
* Ninguna apariencia lleva borde ni acento lateral de color. El ícono va
|
|
1242
1242
|
* alineado con la primera línea del texto (la del título si lo hay), no
|
|
1243
|
-
* centrado en el bloque: en un aviso de una sola línea ambas cosas coinciden.
|
|
1243
|
+
* centrado en el bloque: en un aviso de una sola línea ambas cosas coinciden. Con
|
|
1244
|
+
* `iconAlign="center"` se centra contra el bloque de título y mensaje.
|
|
1244
1245
|
*
|
|
1245
1246
|
* `appearance` elige cómo se muestra el tono (solo aplica a `variant="card"`):
|
|
1246
1247
|
*
|
|
@@ -1285,6 +1286,22 @@ const TONE_ICON = {
|
|
|
1285
1286
|
* Las acciones de `variant="card"` van siempre bajo el mensaje. Los botones de
|
|
1286
1287
|
* un `<div kfAlertActions>` quedan separados 12px (8px en `solid`).
|
|
1287
1288
|
*
|
|
1289
|
+
* `iconAlign` elige dónde se alinea en vertical el ícono de estado (solo aplica a
|
|
1290
|
+
* `variant="card"`, en las tres apariencias). `start` (default) lo pone en la
|
|
1291
|
+
* primera línea del texto: es lo correcto cuando el contenido es solo texto.
|
|
1292
|
+
* `center` lo centra contra todo el bloque de título y mensaje (sin contar la zona
|
|
1293
|
+
* de acciones): úsalo cuando el contenido proyectado es más alto que una línea de
|
|
1294
|
+
* texto, como una fila con el texto a la izquierda y un `kf-button size="sm"` a la
|
|
1295
|
+
* derecha, donde el texto queda centrado en la fila y un ícono en la primera línea
|
|
1296
|
+
* se vería más arriba. El botón de cerrar sigue la misma regla.
|
|
1297
|
+
*
|
|
1298
|
+
* <kf-alert iconAlign="center" tone="info">
|
|
1299
|
+
* <div class="fila">
|
|
1300
|
+
* <span>Estás viendo la cuenta de Ana Pérez.</span>
|
|
1301
|
+
* <kf-button size="sm" variant="outline">Volver a mi cuenta</kf-button>
|
|
1302
|
+
* </div>
|
|
1303
|
+
* </kf-alert>
|
|
1304
|
+
*
|
|
1288
1305
|
* `open` es two-way: el botón de cerrar lo pone en `false` y el componente
|
|
1289
1306
|
* deja de renderizar. El consumidor puede volver a abrirlo poniéndolo en
|
|
1290
1307
|
* `true` (ej. cuando la validación falla otra vez).
|
|
@@ -1325,6 +1342,13 @@ class Alert {
|
|
|
1325
1342
|
*/
|
|
1326
1343
|
appearance = input('surface', /* @ts-ignore */
|
|
1327
1344
|
...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
|
|
1345
|
+
/**
|
|
1346
|
+
* `start` (default) alinea el ícono y el botón de cerrar con la primera línea del
|
|
1347
|
+
* texto; `center` los centra contra el bloque de título y mensaje. Solo aplica a
|
|
1348
|
+
* `variant="card"`; `bar` la ignora. Se expone en el host como `data-icon-align`.
|
|
1349
|
+
*/
|
|
1350
|
+
iconAlign = input('start', /* @ts-ignore */
|
|
1351
|
+
...(ngDevMode ? [{ debugName: "iconAlign" }] : /* istanbul ignore next */ []));
|
|
1328
1352
|
/**
|
|
1329
1353
|
* Título arriba del mensaje. Vacío deja solo el contenido proyectado y, en
|
|
1330
1354
|
* `surface`, el layout compacto.
|
|
@@ -1344,7 +1368,10 @@ class Alert {
|
|
|
1344
1368
|
/** Glifo de trazo de `kf-icon`: lo usan `bar` y `solid`. `surface`/`elevated` dibujan el suyo relleno. */
|
|
1345
1369
|
toneIcon = computed(() => TONE_ICON[this.tone()], /* @ts-ignore */
|
|
1346
1370
|
...(ngDevMode ? [{ debugName: "toneIcon" }] : /* istanbul ignore next */ []));
|
|
1347
|
-
/**
|
|
1371
|
+
/**
|
|
1372
|
+
* Clases del contenedor: tono, forma (`bar` o `card` + apariencia), si lleva título y,
|
|
1373
|
+
* solo en `card` con `iconAlign="center"`, `kf-alert--icon-center`.
|
|
1374
|
+
*/
|
|
1348
1375
|
rootClass = computed(() => {
|
|
1349
1376
|
const classes = [`kf-alert--${this.tone()}`];
|
|
1350
1377
|
if (this.variant() === 'bar') {
|
|
@@ -1352,6 +1379,9 @@ class Alert {
|
|
|
1352
1379
|
}
|
|
1353
1380
|
else {
|
|
1354
1381
|
classes.push('kf-alert--card', `kf-alert--${this.appearance()}`);
|
|
1382
|
+
if (this.iconAlign() === 'center') {
|
|
1383
|
+
classes.push('kf-alert--icon-center');
|
|
1384
|
+
}
|
|
1355
1385
|
}
|
|
1356
1386
|
if (this.title()) {
|
|
1357
1387
|
classes.push('kf-alert--titled');
|
|
@@ -1360,12 +1390,15 @@ class Alert {
|
|
|
1360
1390
|
}, /* @ts-ignore */
|
|
1361
1391
|
...(ngDevMode ? [{ debugName: "rootClass" }] : /* istanbul ignore next */ []));
|
|
1362
1392
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: Alert, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1363
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: Alert, isStandalone: true, selector: "kf-alert", inputs: { tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, dismissible: { classPropertyName: "dismissible", publicName: "dismissible", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange" }, host: { properties: { "attr.data-appearance": "appearance()" } }, ngImport: i0, template: "@if (open()) {\n <div class=\"kf-alert\" [class]=\"rootClass()\" [attr.role]=\"ariaRole()\">\n <!--\n `bar` y `solid` usan el glifo de trazo de `kf-icon`. `surface` y `elevated`\n dibujan un glifo relleno propio: `kf-icon` solo tiene trazo y una marca\n blanca sobre un relleno exige dos colores en el mismo glifo.\n -->\n @if (variant() === 'bar') {\n <kf-icon class=\"kf-alert__icon\" [name]=\"toneIcon()\" size=\"sm\" />\n } @else if (appearance() === 'solid') {\n <kf-icon class=\"kf-alert__icon\" [name]=\"toneIcon()\" size=\"md\" />\n } @else {\n <span class=\"kf-alert__icon\">\n <svg class=\"kf-alert__glyph\" viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\">\n @switch (tone()) {\n @case ('ok') {\n <circle class=\"kf-alert__shape\" cx=\"12\" cy=\"12\" r=\"9.5\" />\n <path class=\"kf-alert__mark\" d=\"m7.8 12.4 2.8 2.8 5.6-5.8\" />\n }\n @case ('warn') {\n <path\n class=\"kf-alert__shape\"\n d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z\"\n />\n <path class=\"kf-alert__mark\" d=\"M12 9.2v4.2\" />\n <path class=\"kf-alert__mark kf-alert__mark--dot\" d=\"M12 17h.01\" />\n }\n @case ('error') {\n <polygon\n class=\"kf-alert__shape\"\n points=\"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2\"\n />\n <path class=\"kf-alert__mark\" d=\"M12 7.8v4.6\" />\n <path class=\"kf-alert__mark kf-alert__mark--dot\" d=\"M12 16h.01\" />\n }\n @default {\n <circle class=\"kf-alert__shape\" cx=\"12\" cy=\"12\" r=\"9.5\" />\n <path class=\"kf-alert__mark\" d=\"M12 11v5\" />\n <path class=\"kf-alert__mark kf-alert__mark--dot\" d=\"M12 7.6h.01\" />\n }\n }\n </svg>\n </span>\n }\n <div class=\"kf-alert__body\">\n <div class=\"kf-alert__content\">\n @if (title()) {\n <p class=\"kf-alert__title\">{{ title() }}</p>\n }\n <div class=\"kf-alert__message\"><ng-content /></div>\n </div>\n <div class=\"kf-alert__actions\"><ng-content select=\"[kfAlertActions]\" /></div>\n </div>\n @if (dismissible()) {\n <button\n type=\"button\"\n class=\"kf-alert__close\"\n aria-label=\"Cerrar aviso\"\n (click)=\"open.set(false)\"\n >\n <kf-icon name=\"x\" size=\"sm\" />\n </button>\n }\n </div>\n}\n", styles: [":host{display:block;font-family:var(--kf-font-body)}.kf-alert{--_mark: var(--kf-color-white);--_actions-gap: calc(var(--kf-space-sm) + var(--kf-space-xs));display:flex;color:var(--kf-color-text);font-size:var(--kf-font-size-body-sm);line-height:1.5}.kf-alert--info{--_tone: var(--kf-color-info);--_soft: var(--kf-color-info-soft);--_strong: var(--kf-color-info-strong);--_icon: var(--kf-color-info)}.kf-alert--ok{--_tone: var(--kf-color-success);--_soft: var(--kf-color-success-soft);--_strong: var(--kf-color-success-strong);--_icon: color-mix(in srgb, var(--kf-color-success) 60%, var(--kf-color-success-strong))}.kf-alert--warn{--_tone: var(--kf-color-warning);--_soft: var(--kf-color-warning-soft);--_strong: var(--kf-color-warning-strong);--_icon: color-mix(in srgb, var(--kf-color-warning) 35%, var(--kf-color-warning-strong));--_mark: var(--kf-color-ink)}.kf-alert--error{--_tone: var(--kf-color-error);--_soft: var(--kf-color-error-soft);--_strong: var(--kf-color-error-strong);--_icon: var(--kf-color-error)}.kf-alert__body{display:flex;min-width:0}.kf-alert__content{display:flex;flex-direction:column;min-width:0}.kf-alert__title{margin:0;color:var(--kf-color-ink);font-family:var(--kf-font-body);font-size:var(--kf-font-size-body);font-weight:var(--kf-font-weight-medium);line-height:1.5}.kf-alert__message{max-inline-size:72ch;color:var(--kf-color-text);overflow-wrap:anywhere}.kf-alert__message:has(>div,>section,>form,>table){max-inline-size:none}.kf-alert__message:empty{display:none}.kf-alert__actions{display:flex;flex:0 1 auto;flex-wrap:wrap;align-items:center;gap:var(--_actions-gap);min-width:0;max-width:100%}.kf-alert__actions:empty{display:none}.kf-alert__actions>*{max-width:100%;min-width:0}.kf-alert__actions ::ng-deep>:is(div,span,ul)[kfAlertActions]{display:flex;flex-wrap:wrap;align-items:center;gap:var(--_actions-gap);margin:0;padding:0;list-style:none}.kf-alert__close{position:relative;flex:none;display:inline-flex;align-self:center;margin-inline-start:var(--kf-space-sm);padding:2px;border:none;background:transparent;color:var(--kf-color-text-muted);border-radius:var(--kf-radius-xs);cursor:pointer;transition:background-color .14s ease,color .14s ease}.kf-alert__close:after{content:\"\";position:absolute;top:50%;left:calc(-1 * var(--kf-space-sm));width:44px;height:44px;transform:translateY(-50%)}.kf-alert__close:hover{background:var(--kf-color-gray-100);color:var(--kf-color-ink)}.kf-alert__close:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}@media(prefers-reduced-motion:reduce){.kf-alert__close{transition:none}}.kf-alert--bar{align-items:center;gap:var(--kf-space-sm);padding:var(--kf-space-sm) var(--kf-space-md);border:1px solid color-mix(in srgb,var(--_tone) 40%,var(--_soft));border-width:1px 0;border-radius:0;background:var(--_soft)}.kf-alert--bar .kf-alert__icon{align-items:center;justify-content:center;color:var(--_strong)}.kf-alert--bar .kf-alert__body{flex:1 1 0;flex-wrap:wrap;align-items:center;gap:var(--kf-space-sm) var(--kf-space-lg)}.kf-alert--bar .kf-alert__content{flex:1 1 20rem;flex-flow:row wrap;align-items:baseline;gap:2px var(--kf-space-xs)}.kf-alert--bar .kf-alert__title{font-size:inherit}.kf-alert--bar .kf-alert__message{max-inline-size:none}.kf-alert--bar .kf-alert__actions{flex-basis:100%}.kf-alert--bar .kf-alert__close:hover{background:color-mix(in srgb,var(--_strong) 12%,transparent)}.kf-alert--card{--_line: calc(var(--kf-font-size-body-sm) * 1.5);--_content-gap: 0px;align-items:flex-start}.kf-alert--card.kf-alert--titled{--_line: var(--_title-line)}.kf-alert--card .kf-alert__icon{display:flex;flex:none;align-items:center;justify-content:center;inline-size:var(--_glyph);block-size:var(--_line);color:var(--_icon)}.kf-alert--card .kf-alert__body{flex:1 1 0;flex-direction:column;gap:var(--_body-gap)}.kf-alert--card .kf-alert__content{gap:var(--_content-gap)}.kf-alert--card .kf-alert__title{color:inherit;font-size:var(--_title-size);font-weight:var(--_title-weight);line-height:var(--_title-line)}.kf-alert--card .kf-alert__message{color:inherit}.kf-alert--card.kf-alert--titled .kf-alert__message{color:var(--_desc)}.kf-alert--card .kf-alert__close{align-self:flex-start;margin-inline-start:0;margin-inline-end:calc(var(--kf-space-md) - var(--_pad-end));margin-block-start:calc((var(--_line) - 20px) / 2)}.kf-alert__glyph{display:block;flex:none;inline-size:var(--_glyph);block-size:var(--_glyph);fill:none;stroke:none}.kf-alert__shape{fill:currentColor;stroke:currentColor;stroke-width:1;stroke-linejoin:round}.kf-alert__mark{fill:none;stroke:var(--_mark);stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}.kf-alert__mark--dot{stroke-width:2.6}.kf-alert--surface{--_glyph: 16px;--_title-line: calc(var(--kf-font-size-body) * 1.5);--_title-size: var(--kf-font-size-body);--_title-weight: 500;--_body-gap: calc(var(--kf-space-sm) + var(--kf-space-xs));--_desc: var(--kf-color-text);--_pad-end: calc(var(--kf-space-sm) + var(--kf-space-xs));gap:var(--kf-space-sm);padding:var(--kf-space-sm) var(--_pad-end);border:1px solid color-mix(in srgb,var(--_tone) 40%,var(--_soft));border-radius:var(--kf-radius-sm);background:var(--_soft);color:var(--kf-color-ink)}.kf-alert--surface.kf-alert--titled{--_glyph: 24px;--_content-gap: var(--kf-space-sm);--_pad-end: var(--kf-space-lg);gap:calc(var(--kf-space-sm) + var(--kf-space-xs));padding:calc(var(--kf-space-md) + var(--kf-space-xs)) var(--_pad-end)}.kf-alert--surface .kf-alert__close:hover{background:color-mix(in srgb,var(--_strong) 12%,transparent)}.kf-alert--elevated{--_glyph: 24px;--_title-line: var(--kf-space-lg);--_title-size: var(--kf-font-size-body-sm);--_title-weight: var(--kf-font-weight-medium);--_body-gap: var(--kf-space-sm);--_actions-gap: 0px;--_desc: var(--kf-color-text-muted);--_pad-end: var(--kf-space-md);gap:var(--kf-space-md);padding:var(--kf-space-md) var(--_pad-end);border:1px solid var(--kf-color-border);border-radius:var(--kf-radius-sm);background:var(--kf-color-white);box-shadow:var(--kf-shadow-md);color:var(--kf-color-ink)}.kf-alert--elevated .kf-alert__actions{margin-inline-start:calc(-1 * var(--kf-space-sm))}.kf-alert--elevated .kf-alert__actions ::ng-deep>:is(div,span,ul)[kfAlertActions]>*{position:relative}.kf-alert--elevated .kf-alert__actions ::ng-deep>:is(div,span,ul)[kfAlertActions]>:not(:last-child):after{content:\"\\b7\";content:\"\\b7\" / \"\";position:absolute;inset-block:0;inset-inline-start:100%;display:grid;place-items:center;inline-size:0;color:var(--kf-color-text-muted);pointer-events:none}.kf-alert--solid{--_glyph: 20px;--_title-line: calc(var(--kf-space-md) + var(--kf-space-xs));--_title-size: .9375rem;--_title-weight: var(--kf-font-weight-medium);--_body-gap: var(--kf-space-sm);--_actions-gap: var(--kf-space-sm);--_solid: var(--_strong);--_on: var(--kf-color-white);--_btn-fg: var(--_solid);--_desc: var(--_on);--_pad-end: var(--kf-space-sm);gap:calc(var(--kf-space-sm) + var(--kf-space-xs));padding:calc(var(--kf-space-sm) + var(--kf-space-xs)) var(--_pad-end) calc(var(--kf-space-sm) + var(--kf-space-xs)) var(--kf-space-md);border-radius:var(--kf-radius-sm);background:var(--_solid);color:var(--_on)}.kf-alert--solid.kf-alert--warn{--_solid: var(--kf-color-warning);--_on: var(--kf-color-ink);--_btn-fg: var(--kf-color-white)}.kf-alert--solid .kf-alert__icon{color:var(--_on)}.kf-alert--solid:not(.kf-alert--titled) .kf-alert__message{font-weight:500}.kf-alert--solid .kf-alert__close{color:var(--_on)}.kf-alert--solid .kf-alert__close:hover{background:color-mix(in srgb,var(--_on) 16%,transparent);color:var(--_on)}.kf-alert--solid .kf-alert__close:focus-visible{box-shadow:0 0 0 2px var(--_solid),0 0 0 4px var(--_on)}.kf-alert--solid .kf-alert__actions{--kf-color-primary: var(--_on);--kf-color-primary-hover: color-mix(in srgb, var(--_on) 88%, var(--_solid));--kf-color-primary-soft: color-mix(in srgb, var(--_on) 16%, transparent);--kf-color-white: var(--_btn-fg);--kf-color-text: var(--_on);--kf-color-text-muted: var(--_on);--kf-color-border-strong: color-mix(in srgb, var(--_on) 55%, transparent);--kf-color-surface: color-mix(in srgb, var(--_on) 16%, transparent);--kf-shadow-focus: 0 0 0 2px var(--_solid), 0 0 0 4px var(--_on)}\n"], dependencies: [{ kind: "component", type: Icon, selector: "kf-icon", inputs: ["name", "size", "rotate", "filled"] }] });
|
|
1393
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: Alert, isStandalone: true, selector: "kf-alert", inputs: { tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, iconAlign: { classPropertyName: "iconAlign", publicName: "iconAlign", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, dismissible: { classPropertyName: "dismissible", publicName: "dismissible", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange" }, host: { properties: { "attr.data-appearance": "appearance()", "attr.data-icon-align": "iconAlign()" } }, ngImport: i0, template: "@if (open()) {\n <div class=\"kf-alert\" [class]=\"rootClass()\" [attr.role]=\"ariaRole()\">\n <!--\n `bar` y `solid` usan el glifo de trazo de `kf-icon`. `surface` y `elevated`\n dibujan un glifo relleno propio: `kf-icon` solo tiene trazo y una marca\n blanca sobre un relleno exige dos colores en el mismo glifo.\n -->\n @if (variant() === 'bar') {\n <kf-icon class=\"kf-alert__icon\" [name]=\"toneIcon()\" size=\"sm\" />\n } @else if (appearance() === 'solid') {\n <kf-icon class=\"kf-alert__icon\" [name]=\"toneIcon()\" size=\"md\" />\n } @else {\n <span class=\"kf-alert__icon\">\n <svg class=\"kf-alert__glyph\" viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\">\n @switch (tone()) {\n @case ('ok') {\n <circle class=\"kf-alert__shape\" cx=\"12\" cy=\"12\" r=\"9.5\" />\n <path class=\"kf-alert__mark\" d=\"m7.8 12.4 2.8 2.8 5.6-5.8\" />\n }\n @case ('warn') {\n <path\n class=\"kf-alert__shape\"\n d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z\"\n />\n <path class=\"kf-alert__mark\" d=\"M12 9.2v4.2\" />\n <path class=\"kf-alert__mark kf-alert__mark--dot\" d=\"M12 17h.01\" />\n }\n @case ('error') {\n <polygon\n class=\"kf-alert__shape\"\n points=\"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2\"\n />\n <path class=\"kf-alert__mark\" d=\"M12 7.8v4.6\" />\n <path class=\"kf-alert__mark kf-alert__mark--dot\" d=\"M12 16h.01\" />\n }\n @default {\n <circle class=\"kf-alert__shape\" cx=\"12\" cy=\"12\" r=\"9.5\" />\n <path class=\"kf-alert__mark\" d=\"M12 11v5\" />\n <path class=\"kf-alert__mark kf-alert__mark--dot\" d=\"M12 7.6h.01\" />\n }\n }\n </svg>\n </span>\n }\n <div class=\"kf-alert__body\">\n <div class=\"kf-alert__content\">\n @if (title()) {\n <p class=\"kf-alert__title\">{{ title() }}</p>\n }\n <div class=\"kf-alert__message\"><ng-content /></div>\n </div>\n <div class=\"kf-alert__actions\"><ng-content select=\"[kfAlertActions]\" /></div>\n </div>\n @if (dismissible()) {\n <button\n type=\"button\"\n class=\"kf-alert__close\"\n aria-label=\"Cerrar aviso\"\n (click)=\"open.set(false)\"\n >\n <kf-icon name=\"x\" size=\"sm\" />\n </button>\n }\n </div>\n}\n", styles: [":host{display:block;font-family:var(--kf-font-body)}.kf-alert{--_mark: var(--kf-color-white);--_actions-gap: calc(var(--kf-space-sm) + var(--kf-space-xs));display:flex;color:var(--kf-color-text);font-size:var(--kf-font-size-body-sm);line-height:1.5}.kf-alert--info{--_tone: var(--kf-color-info);--_soft: var(--kf-color-info-soft);--_strong: var(--kf-color-info-strong);--_icon: var(--kf-color-info)}.kf-alert--ok{--_tone: var(--kf-color-success);--_soft: var(--kf-color-success-soft);--_strong: var(--kf-color-success-strong);--_icon: color-mix(in srgb, var(--kf-color-success) 60%, var(--kf-color-success-strong))}.kf-alert--warn{--_tone: var(--kf-color-warning);--_soft: var(--kf-color-warning-soft);--_strong: var(--kf-color-warning-strong);--_icon: color-mix(in srgb, var(--kf-color-warning) 35%, var(--kf-color-warning-strong));--_mark: var(--kf-color-ink)}.kf-alert--error{--_tone: var(--kf-color-error);--_soft: var(--kf-color-error-soft);--_strong: var(--kf-color-error-strong);--_icon: var(--kf-color-error)}.kf-alert__body{display:flex;min-width:0}.kf-alert__content{display:flex;flex-direction:column;min-width:0}.kf-alert__title{margin:0;color:var(--kf-color-ink);font-family:var(--kf-font-body);font-size:var(--kf-font-size-body);font-weight:var(--kf-font-weight-medium);line-height:1.5}.kf-alert__message{max-inline-size:72ch;color:var(--kf-color-text);overflow-wrap:anywhere}.kf-alert__message:has(>div,>section,>form,>table){max-inline-size:none}.kf-alert__message:empty{display:none}.kf-alert__actions{display:flex;flex:0 1 auto;flex-wrap:wrap;align-items:center;gap:var(--_actions-gap);min-width:0;max-width:100%}.kf-alert__actions:empty{display:none}.kf-alert__actions>*{max-width:100%;min-width:0}.kf-alert__actions ::ng-deep>:is(div,span,ul)[kfAlertActions]{display:flex;flex-wrap:wrap;align-items:center;gap:var(--_actions-gap);margin:0;padding:0;list-style:none}.kf-alert__close{position:relative;flex:none;display:inline-flex;align-self:center;margin-inline-start:var(--kf-space-sm);padding:2px;border:none;background:transparent;color:var(--kf-color-text-muted);border-radius:var(--kf-radius-xs);cursor:pointer;transition:background-color .14s ease,color .14s ease}.kf-alert__close:after{content:\"\";position:absolute;top:50%;left:calc(-1 * var(--kf-space-sm));width:44px;height:44px;transform:translateY(-50%)}.kf-alert__close:hover{background:var(--kf-color-gray-100);color:var(--kf-color-ink)}.kf-alert__close:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}@media(prefers-reduced-motion:reduce){.kf-alert__close{transition:none}}.kf-alert--bar{align-items:center;gap:var(--kf-space-sm);padding:var(--kf-space-sm) var(--kf-space-md);border:1px solid color-mix(in srgb,var(--_tone) 40%,var(--_soft));border-width:1px 0;border-radius:0;background:var(--_soft)}.kf-alert--bar .kf-alert__icon{align-items:center;justify-content:center;color:var(--_strong)}.kf-alert--bar .kf-alert__body{flex:1 1 0;flex-wrap:wrap;align-items:center;gap:var(--kf-space-sm) var(--kf-space-lg)}.kf-alert--bar .kf-alert__content{flex:1 1 20rem;flex-flow:row wrap;align-items:baseline;gap:2px var(--kf-space-xs)}.kf-alert--bar .kf-alert__title{font-size:inherit}.kf-alert--bar .kf-alert__message{max-inline-size:none}.kf-alert--bar .kf-alert__actions{flex-basis:100%}.kf-alert--bar .kf-alert__close:hover{background:color-mix(in srgb,var(--_strong) 12%,transparent)}.kf-alert--card{--_line: calc(var(--kf-font-size-body-sm) * 1.5);--_content-gap: 0px;align-items:flex-start}.kf-alert--card.kf-alert--titled{--_line: var(--_title-line)}.kf-alert--card .kf-alert__icon{display:flex;flex:none;align-items:center;justify-content:center;inline-size:var(--_glyph);block-size:var(--_line);color:var(--_icon)}.kf-alert--card .kf-alert__body{flex:1 1 0;flex-direction:column;gap:var(--_body-gap)}.kf-alert--card .kf-alert__content{gap:var(--_content-gap)}.kf-alert--card .kf-alert__title{color:inherit;font-size:var(--_title-size);font-weight:var(--_title-weight);line-height:var(--_title-line)}.kf-alert--card .kf-alert__message{color:inherit}.kf-alert--card.kf-alert--titled .kf-alert__message{color:var(--_desc)}.kf-alert--card .kf-alert__close{align-self:flex-start;margin-inline-start:0;margin-inline-end:calc(var(--kf-space-md) - var(--_pad-end));margin-block-start:calc((var(--_line) - 20px) / 2)}.kf-alert__glyph{display:block;flex:none;inline-size:var(--_glyph);block-size:var(--_glyph);fill:none;stroke:none}.kf-alert__shape{fill:currentColor;stroke:currentColor;stroke-width:1;stroke-linejoin:round}.kf-alert__mark{fill:none;stroke:var(--_mark);stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}.kf-alert__mark--dot{stroke-width:2.6}.kf-alert--surface{--_glyph: 16px;--_title-line: calc(var(--kf-font-size-body) * 1.5);--_title-size: var(--kf-font-size-body);--_title-weight: 500;--_body-gap: calc(var(--kf-space-sm) + var(--kf-space-xs));--_desc: var(--kf-color-text);--_pad-end: calc(var(--kf-space-sm) + var(--kf-space-xs));gap:var(--kf-space-sm);padding:var(--kf-space-sm) var(--_pad-end);border:1px solid color-mix(in srgb,var(--_tone) 40%,var(--_soft));border-radius:var(--kf-radius-sm);background:var(--_soft);color:var(--kf-color-ink)}.kf-alert--surface.kf-alert--titled{--_glyph: 24px;--_content-gap: var(--kf-space-sm);--_pad-end: var(--kf-space-lg);gap:calc(var(--kf-space-sm) + var(--kf-space-xs));padding:calc(var(--kf-space-md) + var(--kf-space-xs)) var(--_pad-end)}.kf-alert--surface .kf-alert__close:hover{background:color-mix(in srgb,var(--_strong) 12%,transparent)}.kf-alert--elevated{--_glyph: 24px;--_title-line: var(--kf-space-lg);--_title-size: var(--kf-font-size-body-sm);--_title-weight: var(--kf-font-weight-medium);--_body-gap: var(--kf-space-sm);--_actions-gap: 0px;--_desc: var(--kf-color-text-muted);--_pad-end: var(--kf-space-md);gap:var(--kf-space-md);padding:var(--kf-space-md) var(--_pad-end);border:1px solid var(--kf-color-border);border-radius:var(--kf-radius-sm);background:var(--kf-color-white);box-shadow:var(--kf-shadow-md);color:var(--kf-color-ink)}.kf-alert--elevated .kf-alert__actions{margin-inline-start:calc(-1 * var(--kf-space-sm))}.kf-alert--elevated .kf-alert__actions ::ng-deep>:is(div,span,ul)[kfAlertActions]>*{position:relative}.kf-alert--elevated .kf-alert__actions ::ng-deep>:is(div,span,ul)[kfAlertActions]>:not(:last-child):after{content:\"\\b7\";content:\"\\b7\" / \"\";position:absolute;inset-block:0;inset-inline-start:100%;display:grid;place-items:center;inline-size:0;color:var(--kf-color-text-muted);pointer-events:none}.kf-alert--solid{--_glyph: 20px;--_title-line: calc(var(--kf-space-md) + var(--kf-space-xs));--_title-size: .9375rem;--_title-weight: var(--kf-font-weight-medium);--_body-gap: var(--kf-space-sm);--_actions-gap: var(--kf-space-sm);--_solid: var(--_strong);--_on: var(--kf-color-white);--_btn-fg: var(--_solid);--_desc: var(--_on);--_pad-end: var(--kf-space-sm);gap:calc(var(--kf-space-sm) + var(--kf-space-xs));padding:calc(var(--kf-space-sm) + var(--kf-space-xs)) var(--_pad-end) calc(var(--kf-space-sm) + var(--kf-space-xs)) var(--kf-space-md);border-radius:var(--kf-radius-sm);background:var(--_solid);color:var(--_on)}.kf-alert--solid.kf-alert--warn{--_solid: var(--kf-color-warning);--_on: var(--kf-color-ink);--_btn-fg: var(--kf-color-white)}.kf-alert--solid .kf-alert__icon{color:var(--_on)}.kf-alert--solid:not(.kf-alert--titled) .kf-alert__message{font-weight:500}.kf-alert--solid .kf-alert__close{color:var(--_on)}.kf-alert--solid .kf-alert__close:hover{background:color-mix(in srgb,var(--_on) 16%,transparent);color:var(--_on)}.kf-alert--solid .kf-alert__close:focus-visible{box-shadow:0 0 0 2px var(--_solid),0 0 0 4px var(--_on)}.kf-alert--solid .kf-alert__actions{--kf-color-primary: var(--_on);--kf-color-primary-hover: color-mix(in srgb, var(--_on) 88%, var(--_solid));--kf-color-primary-soft: color-mix(in srgb, var(--_on) 16%, transparent);--kf-color-white: var(--_btn-fg);--kf-color-text: var(--_on);--kf-color-text-muted: var(--_on);--kf-color-border-strong: color-mix(in srgb, var(--_on) 55%, transparent);--kf-color-surface: color-mix(in srgb, var(--_on) 16%, transparent);--kf-shadow-focus: 0 0 0 2px var(--_solid), 0 0 0 4px var(--_on)}.kf-alert--card.kf-alert--icon-center{display:grid;grid-template-columns:auto minmax(0,1fr);row-gap:var(--_body-gap)}.kf-alert--icon-center .kf-alert__body{display:contents}.kf-alert--icon-center .kf-alert__icon{grid-area:1 / 1;align-self:center}.kf-alert--icon-center .kf-alert__content{grid-area:1 / 2}.kf-alert--icon-center .kf-alert__actions{grid-area:2 / 2}.kf-alert--icon-center .kf-alert__close{grid-area:1 / 3;align-self:center;margin-block-start:0}\n"], dependencies: [{ kind: "component", type: Icon, selector: "kf-icon", inputs: ["name", "size", "rotate", "filled"] }] });
|
|
1364
1394
|
}
|
|
1365
1395
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: Alert, decorators: [{
|
|
1366
1396
|
type: Component,
|
|
1367
|
-
args: [{ selector: 'kf-alert', imports: [Icon], host: { '[attr.data-appearance]': 'appearance()' }, template: "@if (open()) {\n <div class=\"kf-alert\" [class]=\"rootClass()\" [attr.role]=\"ariaRole()\">\n <!--\n `bar` y `solid` usan el glifo de trazo de `kf-icon`. `surface` y `elevated`\n dibujan un glifo relleno propio: `kf-icon` solo tiene trazo y una marca\n blanca sobre un relleno exige dos colores en el mismo glifo.\n -->\n @if (variant() === 'bar') {\n <kf-icon class=\"kf-alert__icon\" [name]=\"toneIcon()\" size=\"sm\" />\n } @else if (appearance() === 'solid') {\n <kf-icon class=\"kf-alert__icon\" [name]=\"toneIcon()\" size=\"md\" />\n } @else {\n <span class=\"kf-alert__icon\">\n <svg class=\"kf-alert__glyph\" viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\">\n @switch (tone()) {\n @case ('ok') {\n <circle class=\"kf-alert__shape\" cx=\"12\" cy=\"12\" r=\"9.5\" />\n <path class=\"kf-alert__mark\" d=\"m7.8 12.4 2.8 2.8 5.6-5.8\" />\n }\n @case ('warn') {\n <path\n class=\"kf-alert__shape\"\n d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z\"\n />\n <path class=\"kf-alert__mark\" d=\"M12 9.2v4.2\" />\n <path class=\"kf-alert__mark kf-alert__mark--dot\" d=\"M12 17h.01\" />\n }\n @case ('error') {\n <polygon\n class=\"kf-alert__shape\"\n points=\"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2\"\n />\n <path class=\"kf-alert__mark\" d=\"M12 7.8v4.6\" />\n <path class=\"kf-alert__mark kf-alert__mark--dot\" d=\"M12 16h.01\" />\n }\n @default {\n <circle class=\"kf-alert__shape\" cx=\"12\" cy=\"12\" r=\"9.5\" />\n <path class=\"kf-alert__mark\" d=\"M12 11v5\" />\n <path class=\"kf-alert__mark kf-alert__mark--dot\" d=\"M12 7.6h.01\" />\n }\n }\n </svg>\n </span>\n }\n <div class=\"kf-alert__body\">\n <div class=\"kf-alert__content\">\n @if (title()) {\n <p class=\"kf-alert__title\">{{ title() }}</p>\n }\n <div class=\"kf-alert__message\"><ng-content /></div>\n </div>\n <div class=\"kf-alert__actions\"><ng-content select=\"[kfAlertActions]\" /></div>\n </div>\n @if (dismissible()) {\n <button\n type=\"button\"\n class=\"kf-alert__close\"\n aria-label=\"Cerrar aviso\"\n (click)=\"open.set(false)\"\n >\n <kf-icon name=\"x\" size=\"sm\" />\n </button>\n }\n </div>\n}\n", styles: [":host{display:block;font-family:var(--kf-font-body)}.kf-alert{--_mark: var(--kf-color-white);--_actions-gap: calc(var(--kf-space-sm) + var(--kf-space-xs));display:flex;color:var(--kf-color-text);font-size:var(--kf-font-size-body-sm);line-height:1.5}.kf-alert--info{--_tone: var(--kf-color-info);--_soft: var(--kf-color-info-soft);--_strong: var(--kf-color-info-strong);--_icon: var(--kf-color-info)}.kf-alert--ok{--_tone: var(--kf-color-success);--_soft: var(--kf-color-success-soft);--_strong: var(--kf-color-success-strong);--_icon: color-mix(in srgb, var(--kf-color-success) 60%, var(--kf-color-success-strong))}.kf-alert--warn{--_tone: var(--kf-color-warning);--_soft: var(--kf-color-warning-soft);--_strong: var(--kf-color-warning-strong);--_icon: color-mix(in srgb, var(--kf-color-warning) 35%, var(--kf-color-warning-strong));--_mark: var(--kf-color-ink)}.kf-alert--error{--_tone: var(--kf-color-error);--_soft: var(--kf-color-error-soft);--_strong: var(--kf-color-error-strong);--_icon: var(--kf-color-error)}.kf-alert__body{display:flex;min-width:0}.kf-alert__content{display:flex;flex-direction:column;min-width:0}.kf-alert__title{margin:0;color:var(--kf-color-ink);font-family:var(--kf-font-body);font-size:var(--kf-font-size-body);font-weight:var(--kf-font-weight-medium);line-height:1.5}.kf-alert__message{max-inline-size:72ch;color:var(--kf-color-text);overflow-wrap:anywhere}.kf-alert__message:has(>div,>section,>form,>table){max-inline-size:none}.kf-alert__message:empty{display:none}.kf-alert__actions{display:flex;flex:0 1 auto;flex-wrap:wrap;align-items:center;gap:var(--_actions-gap);min-width:0;max-width:100%}.kf-alert__actions:empty{display:none}.kf-alert__actions>*{max-width:100%;min-width:0}.kf-alert__actions ::ng-deep>:is(div,span,ul)[kfAlertActions]{display:flex;flex-wrap:wrap;align-items:center;gap:var(--_actions-gap);margin:0;padding:0;list-style:none}.kf-alert__close{position:relative;flex:none;display:inline-flex;align-self:center;margin-inline-start:var(--kf-space-sm);padding:2px;border:none;background:transparent;color:var(--kf-color-text-muted);border-radius:var(--kf-radius-xs);cursor:pointer;transition:background-color .14s ease,color .14s ease}.kf-alert__close:after{content:\"\";position:absolute;top:50%;left:calc(-1 * var(--kf-space-sm));width:44px;height:44px;transform:translateY(-50%)}.kf-alert__close:hover{background:var(--kf-color-gray-100);color:var(--kf-color-ink)}.kf-alert__close:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}@media(prefers-reduced-motion:reduce){.kf-alert__close{transition:none}}.kf-alert--bar{align-items:center;gap:var(--kf-space-sm);padding:var(--kf-space-sm) var(--kf-space-md);border:1px solid color-mix(in srgb,var(--_tone) 40%,var(--_soft));border-width:1px 0;border-radius:0;background:var(--_soft)}.kf-alert--bar .kf-alert__icon{align-items:center;justify-content:center;color:var(--_strong)}.kf-alert--bar .kf-alert__body{flex:1 1 0;flex-wrap:wrap;align-items:center;gap:var(--kf-space-sm) var(--kf-space-lg)}.kf-alert--bar .kf-alert__content{flex:1 1 20rem;flex-flow:row wrap;align-items:baseline;gap:2px var(--kf-space-xs)}.kf-alert--bar .kf-alert__title{font-size:inherit}.kf-alert--bar .kf-alert__message{max-inline-size:none}.kf-alert--bar .kf-alert__actions{flex-basis:100%}.kf-alert--bar .kf-alert__close:hover{background:color-mix(in srgb,var(--_strong) 12%,transparent)}.kf-alert--card{--_line: calc(var(--kf-font-size-body-sm) * 1.5);--_content-gap: 0px;align-items:flex-start}.kf-alert--card.kf-alert--titled{--_line: var(--_title-line)}.kf-alert--card .kf-alert__icon{display:flex;flex:none;align-items:center;justify-content:center;inline-size:var(--_glyph);block-size:var(--_line);color:var(--_icon)}.kf-alert--card .kf-alert__body{flex:1 1 0;flex-direction:column;gap:var(--_body-gap)}.kf-alert--card .kf-alert__content{gap:var(--_content-gap)}.kf-alert--card .kf-alert__title{color:inherit;font-size:var(--_title-size);font-weight:var(--_title-weight);line-height:var(--_title-line)}.kf-alert--card .kf-alert__message{color:inherit}.kf-alert--card.kf-alert--titled .kf-alert__message{color:var(--_desc)}.kf-alert--card .kf-alert__close{align-self:flex-start;margin-inline-start:0;margin-inline-end:calc(var(--kf-space-md) - var(--_pad-end));margin-block-start:calc((var(--_line) - 20px) / 2)}.kf-alert__glyph{display:block;flex:none;inline-size:var(--_glyph);block-size:var(--_glyph);fill:none;stroke:none}.kf-alert__shape{fill:currentColor;stroke:currentColor;stroke-width:1;stroke-linejoin:round}.kf-alert__mark{fill:none;stroke:var(--_mark);stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}.kf-alert__mark--dot{stroke-width:2.6}.kf-alert--surface{--_glyph: 16px;--_title-line: calc(var(--kf-font-size-body) * 1.5);--_title-size: var(--kf-font-size-body);--_title-weight: 500;--_body-gap: calc(var(--kf-space-sm) + var(--kf-space-xs));--_desc: var(--kf-color-text);--_pad-end: calc(var(--kf-space-sm) + var(--kf-space-xs));gap:var(--kf-space-sm);padding:var(--kf-space-sm) var(--_pad-end);border:1px solid color-mix(in srgb,var(--_tone) 40%,var(--_soft));border-radius:var(--kf-radius-sm);background:var(--_soft);color:var(--kf-color-ink)}.kf-alert--surface.kf-alert--titled{--_glyph: 24px;--_content-gap: var(--kf-space-sm);--_pad-end: var(--kf-space-lg);gap:calc(var(--kf-space-sm) + var(--kf-space-xs));padding:calc(var(--kf-space-md) + var(--kf-space-xs)) var(--_pad-end)}.kf-alert--surface .kf-alert__close:hover{background:color-mix(in srgb,var(--_strong) 12%,transparent)}.kf-alert--elevated{--_glyph: 24px;--_title-line: var(--kf-space-lg);--_title-size: var(--kf-font-size-body-sm);--_title-weight: var(--kf-font-weight-medium);--_body-gap: var(--kf-space-sm);--_actions-gap: 0px;--_desc: var(--kf-color-text-muted);--_pad-end: var(--kf-space-md);gap:var(--kf-space-md);padding:var(--kf-space-md) var(--_pad-end);border:1px solid var(--kf-color-border);border-radius:var(--kf-radius-sm);background:var(--kf-color-white);box-shadow:var(--kf-shadow-md);color:var(--kf-color-ink)}.kf-alert--elevated .kf-alert__actions{margin-inline-start:calc(-1 * var(--kf-space-sm))}.kf-alert--elevated .kf-alert__actions ::ng-deep>:is(div,span,ul)[kfAlertActions]>*{position:relative}.kf-alert--elevated .kf-alert__actions ::ng-deep>:is(div,span,ul)[kfAlertActions]>:not(:last-child):after{content:\"\\b7\";content:\"\\b7\" / \"\";position:absolute;inset-block:0;inset-inline-start:100%;display:grid;place-items:center;inline-size:0;color:var(--kf-color-text-muted);pointer-events:none}.kf-alert--solid{--_glyph: 20px;--_title-line: calc(var(--kf-space-md) + var(--kf-space-xs));--_title-size: .9375rem;--_title-weight: var(--kf-font-weight-medium);--_body-gap: var(--kf-space-sm);--_actions-gap: var(--kf-space-sm);--_solid: var(--_strong);--_on: var(--kf-color-white);--_btn-fg: var(--_solid);--_desc: var(--_on);--_pad-end: var(--kf-space-sm);gap:calc(var(--kf-space-sm) + var(--kf-space-xs));padding:calc(var(--kf-space-sm) + var(--kf-space-xs)) var(--_pad-end) calc(var(--kf-space-sm) + var(--kf-space-xs)) var(--kf-space-md);border-radius:var(--kf-radius-sm);background:var(--_solid);color:var(--_on)}.kf-alert--solid.kf-alert--warn{--_solid: var(--kf-color-warning);--_on: var(--kf-color-ink);--_btn-fg: var(--kf-color-white)}.kf-alert--solid .kf-alert__icon{color:var(--_on)}.kf-alert--solid:not(.kf-alert--titled) .kf-alert__message{font-weight:500}.kf-alert--solid .kf-alert__close{color:var(--_on)}.kf-alert--solid .kf-alert__close:hover{background:color-mix(in srgb,var(--_on) 16%,transparent);color:var(--_on)}.kf-alert--solid .kf-alert__close:focus-visible{box-shadow:0 0 0 2px var(--_solid),0 0 0 4px var(--_on)}.kf-alert--solid .kf-alert__actions{--kf-color-primary: var(--_on);--kf-color-primary-hover: color-mix(in srgb, var(--_on) 88%, var(--_solid));--kf-color-primary-soft: color-mix(in srgb, var(--_on) 16%, transparent);--kf-color-white: var(--_btn-fg);--kf-color-text: var(--_on);--kf-color-text-muted: var(--_on);--kf-color-border-strong: color-mix(in srgb, var(--_on) 55%, transparent);--kf-color-surface: color-mix(in srgb, var(--_on) 16%, transparent);--kf-shadow-focus: 0 0 0 2px var(--_solid), 0 0 0 4px var(--_on)}\n"] }]
|
|
1368
|
-
|
|
1397
|
+
args: [{ selector: 'kf-alert', imports: [Icon], host: {
|
|
1398
|
+
'[attr.data-appearance]': 'appearance()',
|
|
1399
|
+
'[attr.data-icon-align]': 'iconAlign()',
|
|
1400
|
+
}, template: "@if (open()) {\n <div class=\"kf-alert\" [class]=\"rootClass()\" [attr.role]=\"ariaRole()\">\n <!--\n `bar` y `solid` usan el glifo de trazo de `kf-icon`. `surface` y `elevated`\n dibujan un glifo relleno propio: `kf-icon` solo tiene trazo y una marca\n blanca sobre un relleno exige dos colores en el mismo glifo.\n -->\n @if (variant() === 'bar') {\n <kf-icon class=\"kf-alert__icon\" [name]=\"toneIcon()\" size=\"sm\" />\n } @else if (appearance() === 'solid') {\n <kf-icon class=\"kf-alert__icon\" [name]=\"toneIcon()\" size=\"md\" />\n } @else {\n <span class=\"kf-alert__icon\">\n <svg class=\"kf-alert__glyph\" viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\">\n @switch (tone()) {\n @case ('ok') {\n <circle class=\"kf-alert__shape\" cx=\"12\" cy=\"12\" r=\"9.5\" />\n <path class=\"kf-alert__mark\" d=\"m7.8 12.4 2.8 2.8 5.6-5.8\" />\n }\n @case ('warn') {\n <path\n class=\"kf-alert__shape\"\n d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z\"\n />\n <path class=\"kf-alert__mark\" d=\"M12 9.2v4.2\" />\n <path class=\"kf-alert__mark kf-alert__mark--dot\" d=\"M12 17h.01\" />\n }\n @case ('error') {\n <polygon\n class=\"kf-alert__shape\"\n points=\"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2\"\n />\n <path class=\"kf-alert__mark\" d=\"M12 7.8v4.6\" />\n <path class=\"kf-alert__mark kf-alert__mark--dot\" d=\"M12 16h.01\" />\n }\n @default {\n <circle class=\"kf-alert__shape\" cx=\"12\" cy=\"12\" r=\"9.5\" />\n <path class=\"kf-alert__mark\" d=\"M12 11v5\" />\n <path class=\"kf-alert__mark kf-alert__mark--dot\" d=\"M12 7.6h.01\" />\n }\n }\n </svg>\n </span>\n }\n <div class=\"kf-alert__body\">\n <div class=\"kf-alert__content\">\n @if (title()) {\n <p class=\"kf-alert__title\">{{ title() }}</p>\n }\n <div class=\"kf-alert__message\"><ng-content /></div>\n </div>\n <div class=\"kf-alert__actions\"><ng-content select=\"[kfAlertActions]\" /></div>\n </div>\n @if (dismissible()) {\n <button\n type=\"button\"\n class=\"kf-alert__close\"\n aria-label=\"Cerrar aviso\"\n (click)=\"open.set(false)\"\n >\n <kf-icon name=\"x\" size=\"sm\" />\n </button>\n }\n </div>\n}\n", styles: [":host{display:block;font-family:var(--kf-font-body)}.kf-alert{--_mark: var(--kf-color-white);--_actions-gap: calc(var(--kf-space-sm) + var(--kf-space-xs));display:flex;color:var(--kf-color-text);font-size:var(--kf-font-size-body-sm);line-height:1.5}.kf-alert--info{--_tone: var(--kf-color-info);--_soft: var(--kf-color-info-soft);--_strong: var(--kf-color-info-strong);--_icon: var(--kf-color-info)}.kf-alert--ok{--_tone: var(--kf-color-success);--_soft: var(--kf-color-success-soft);--_strong: var(--kf-color-success-strong);--_icon: color-mix(in srgb, var(--kf-color-success) 60%, var(--kf-color-success-strong))}.kf-alert--warn{--_tone: var(--kf-color-warning);--_soft: var(--kf-color-warning-soft);--_strong: var(--kf-color-warning-strong);--_icon: color-mix(in srgb, var(--kf-color-warning) 35%, var(--kf-color-warning-strong));--_mark: var(--kf-color-ink)}.kf-alert--error{--_tone: var(--kf-color-error);--_soft: var(--kf-color-error-soft);--_strong: var(--kf-color-error-strong);--_icon: var(--kf-color-error)}.kf-alert__body{display:flex;min-width:0}.kf-alert__content{display:flex;flex-direction:column;min-width:0}.kf-alert__title{margin:0;color:var(--kf-color-ink);font-family:var(--kf-font-body);font-size:var(--kf-font-size-body);font-weight:var(--kf-font-weight-medium);line-height:1.5}.kf-alert__message{max-inline-size:72ch;color:var(--kf-color-text);overflow-wrap:anywhere}.kf-alert__message:has(>div,>section,>form,>table){max-inline-size:none}.kf-alert__message:empty{display:none}.kf-alert__actions{display:flex;flex:0 1 auto;flex-wrap:wrap;align-items:center;gap:var(--_actions-gap);min-width:0;max-width:100%}.kf-alert__actions:empty{display:none}.kf-alert__actions>*{max-width:100%;min-width:0}.kf-alert__actions ::ng-deep>:is(div,span,ul)[kfAlertActions]{display:flex;flex-wrap:wrap;align-items:center;gap:var(--_actions-gap);margin:0;padding:0;list-style:none}.kf-alert__close{position:relative;flex:none;display:inline-flex;align-self:center;margin-inline-start:var(--kf-space-sm);padding:2px;border:none;background:transparent;color:var(--kf-color-text-muted);border-radius:var(--kf-radius-xs);cursor:pointer;transition:background-color .14s ease,color .14s ease}.kf-alert__close:after{content:\"\";position:absolute;top:50%;left:calc(-1 * var(--kf-space-sm));width:44px;height:44px;transform:translateY(-50%)}.kf-alert__close:hover{background:var(--kf-color-gray-100);color:var(--kf-color-ink)}.kf-alert__close:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}@media(prefers-reduced-motion:reduce){.kf-alert__close{transition:none}}.kf-alert--bar{align-items:center;gap:var(--kf-space-sm);padding:var(--kf-space-sm) var(--kf-space-md);border:1px solid color-mix(in srgb,var(--_tone) 40%,var(--_soft));border-width:1px 0;border-radius:0;background:var(--_soft)}.kf-alert--bar .kf-alert__icon{align-items:center;justify-content:center;color:var(--_strong)}.kf-alert--bar .kf-alert__body{flex:1 1 0;flex-wrap:wrap;align-items:center;gap:var(--kf-space-sm) var(--kf-space-lg)}.kf-alert--bar .kf-alert__content{flex:1 1 20rem;flex-flow:row wrap;align-items:baseline;gap:2px var(--kf-space-xs)}.kf-alert--bar .kf-alert__title{font-size:inherit}.kf-alert--bar .kf-alert__message{max-inline-size:none}.kf-alert--bar .kf-alert__actions{flex-basis:100%}.kf-alert--bar .kf-alert__close:hover{background:color-mix(in srgb,var(--_strong) 12%,transparent)}.kf-alert--card{--_line: calc(var(--kf-font-size-body-sm) * 1.5);--_content-gap: 0px;align-items:flex-start}.kf-alert--card.kf-alert--titled{--_line: var(--_title-line)}.kf-alert--card .kf-alert__icon{display:flex;flex:none;align-items:center;justify-content:center;inline-size:var(--_glyph);block-size:var(--_line);color:var(--_icon)}.kf-alert--card .kf-alert__body{flex:1 1 0;flex-direction:column;gap:var(--_body-gap)}.kf-alert--card .kf-alert__content{gap:var(--_content-gap)}.kf-alert--card .kf-alert__title{color:inherit;font-size:var(--_title-size);font-weight:var(--_title-weight);line-height:var(--_title-line)}.kf-alert--card .kf-alert__message{color:inherit}.kf-alert--card.kf-alert--titled .kf-alert__message{color:var(--_desc)}.kf-alert--card .kf-alert__close{align-self:flex-start;margin-inline-start:0;margin-inline-end:calc(var(--kf-space-md) - var(--_pad-end));margin-block-start:calc((var(--_line) - 20px) / 2)}.kf-alert__glyph{display:block;flex:none;inline-size:var(--_glyph);block-size:var(--_glyph);fill:none;stroke:none}.kf-alert__shape{fill:currentColor;stroke:currentColor;stroke-width:1;stroke-linejoin:round}.kf-alert__mark{fill:none;stroke:var(--_mark);stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}.kf-alert__mark--dot{stroke-width:2.6}.kf-alert--surface{--_glyph: 16px;--_title-line: calc(var(--kf-font-size-body) * 1.5);--_title-size: var(--kf-font-size-body);--_title-weight: 500;--_body-gap: calc(var(--kf-space-sm) + var(--kf-space-xs));--_desc: var(--kf-color-text);--_pad-end: calc(var(--kf-space-sm) + var(--kf-space-xs));gap:var(--kf-space-sm);padding:var(--kf-space-sm) var(--_pad-end);border:1px solid color-mix(in srgb,var(--_tone) 40%,var(--_soft));border-radius:var(--kf-radius-sm);background:var(--_soft);color:var(--kf-color-ink)}.kf-alert--surface.kf-alert--titled{--_glyph: 24px;--_content-gap: var(--kf-space-sm);--_pad-end: var(--kf-space-lg);gap:calc(var(--kf-space-sm) + var(--kf-space-xs));padding:calc(var(--kf-space-md) + var(--kf-space-xs)) var(--_pad-end)}.kf-alert--surface .kf-alert__close:hover{background:color-mix(in srgb,var(--_strong) 12%,transparent)}.kf-alert--elevated{--_glyph: 24px;--_title-line: var(--kf-space-lg);--_title-size: var(--kf-font-size-body-sm);--_title-weight: var(--kf-font-weight-medium);--_body-gap: var(--kf-space-sm);--_actions-gap: 0px;--_desc: var(--kf-color-text-muted);--_pad-end: var(--kf-space-md);gap:var(--kf-space-md);padding:var(--kf-space-md) var(--_pad-end);border:1px solid var(--kf-color-border);border-radius:var(--kf-radius-sm);background:var(--kf-color-white);box-shadow:var(--kf-shadow-md);color:var(--kf-color-ink)}.kf-alert--elevated .kf-alert__actions{margin-inline-start:calc(-1 * var(--kf-space-sm))}.kf-alert--elevated .kf-alert__actions ::ng-deep>:is(div,span,ul)[kfAlertActions]>*{position:relative}.kf-alert--elevated .kf-alert__actions ::ng-deep>:is(div,span,ul)[kfAlertActions]>:not(:last-child):after{content:\"\\b7\";content:\"\\b7\" / \"\";position:absolute;inset-block:0;inset-inline-start:100%;display:grid;place-items:center;inline-size:0;color:var(--kf-color-text-muted);pointer-events:none}.kf-alert--solid{--_glyph: 20px;--_title-line: calc(var(--kf-space-md) + var(--kf-space-xs));--_title-size: .9375rem;--_title-weight: var(--kf-font-weight-medium);--_body-gap: var(--kf-space-sm);--_actions-gap: var(--kf-space-sm);--_solid: var(--_strong);--_on: var(--kf-color-white);--_btn-fg: var(--_solid);--_desc: var(--_on);--_pad-end: var(--kf-space-sm);gap:calc(var(--kf-space-sm) + var(--kf-space-xs));padding:calc(var(--kf-space-sm) + var(--kf-space-xs)) var(--_pad-end) calc(var(--kf-space-sm) + var(--kf-space-xs)) var(--kf-space-md);border-radius:var(--kf-radius-sm);background:var(--_solid);color:var(--_on)}.kf-alert--solid.kf-alert--warn{--_solid: var(--kf-color-warning);--_on: var(--kf-color-ink);--_btn-fg: var(--kf-color-white)}.kf-alert--solid .kf-alert__icon{color:var(--_on)}.kf-alert--solid:not(.kf-alert--titled) .kf-alert__message{font-weight:500}.kf-alert--solid .kf-alert__close{color:var(--_on)}.kf-alert--solid .kf-alert__close:hover{background:color-mix(in srgb,var(--_on) 16%,transparent);color:var(--_on)}.kf-alert--solid .kf-alert__close:focus-visible{box-shadow:0 0 0 2px var(--_solid),0 0 0 4px var(--_on)}.kf-alert--solid .kf-alert__actions{--kf-color-primary: var(--_on);--kf-color-primary-hover: color-mix(in srgb, var(--_on) 88%, var(--_solid));--kf-color-primary-soft: color-mix(in srgb, var(--_on) 16%, transparent);--kf-color-white: var(--_btn-fg);--kf-color-text: var(--_on);--kf-color-text-muted: var(--_on);--kf-color-border-strong: color-mix(in srgb, var(--_on) 55%, transparent);--kf-color-surface: color-mix(in srgb, var(--_on) 16%, transparent);--kf-shadow-focus: 0 0 0 2px var(--_solid), 0 0 0 4px var(--_on)}.kf-alert--card.kf-alert--icon-center{display:grid;grid-template-columns:auto minmax(0,1fr);row-gap:var(--_body-gap)}.kf-alert--icon-center .kf-alert__body{display:contents}.kf-alert--icon-center .kf-alert__icon{grid-area:1 / 1;align-self:center}.kf-alert--icon-center .kf-alert__content{grid-area:1 / 2}.kf-alert--icon-center .kf-alert__actions{grid-area:2 / 2}.kf-alert--icon-center .kf-alert__close{grid-area:1 / 3;align-self:center;margin-block-start:0}\n"] }]
|
|
1401
|
+
}], propDecorators: { tone: [{ type: i0.Input, args: [{ isSignal: true, alias: "tone", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], iconAlign: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconAlign", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], dismissible: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissible", required: false }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }] } });
|
|
1369
1402
|
|
|
1370
1403
|
/**
|
|
1371
1404
|
* Fila clickeable de una lista de pendientes/alertas: ícono circular con
|