@keepui/ui 0.1.7 → 0.3.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.
- package/README.md +299 -131
- package/fesm2022/keepui-ui.mjs +297 -44
- package/fesm2022/keepui-ui.mjs.map +1 -1
- package/lib/components/button/button.component.d.ts.map +1 -1
- package/lib/components/card/card.component.d.ts +33 -10
- package/lib/components/card/card.component.d.ts.map +1 -1
- package/lib/components/card/card.types.d.ts +4 -0
- package/lib/components/card/card.types.d.ts.map +1 -0
- package/lib/components/icon/icon.component.d.ts +39 -0
- package/lib/components/icon/icon.component.d.ts.map +1 -0
- package/lib/components/icon-action-button/icon-action-button.component.d.ts +52 -0
- package/lib/components/icon-action-button/icon-action-button.component.d.ts.map +1 -0
- package/lib/components/icon-action-button/icon-action-button.types.d.ts +3 -0
- package/lib/components/icon-action-button/icon-action-button.types.d.ts.map +1 -0
- package/package.json +1 -1
- package/public-api.d.ts +4 -0
- package/public-api.d.ts.map +1 -1
- package/styles/index.css +86 -40
- package/styles/prebuilt.css +1 -1
- package/styles/themes.css +226 -117
package/fesm2022/keepui-ui.mjs
CHANGED
|
@@ -123,7 +123,7 @@ class ButtonComponent {
|
|
|
123
123
|
'min-h-[2.75rem] text-sm font-medium cursor-pointer select-none',
|
|
124
124
|
'transition-colors duration-200',
|
|
125
125
|
'focus-visible:outline-none focus-visible:ring-2',
|
|
126
|
-
'focus-visible:ring-
|
|
126
|
+
'focus-visible:ring-ku-primary-border focus-visible:ring-offset-2',
|
|
127
127
|
'disabled:opacity-50 disabled:cursor-not-allowed',
|
|
128
128
|
].join(' ');
|
|
129
129
|
const sizeClass = this.fullWidth()
|
|
@@ -137,25 +137,24 @@ class ButtonComponent {
|
|
|
137
137
|
};
|
|
138
138
|
const variantMap = {
|
|
139
139
|
primary: [
|
|
140
|
-
'bg-
|
|
141
|
-
'enabled:hover:
|
|
142
|
-
'enabled:active:
|
|
140
|
+
'bg-ku-action-primary text-white border border-ku-action-primary',
|
|
141
|
+
'enabled:hover:opacity-90',
|
|
142
|
+
'enabled:active:opacity-80',
|
|
143
143
|
].join(' '),
|
|
144
144
|
secondary: [
|
|
145
|
-
'bg-
|
|
146
|
-
'enabled:hover:bg-
|
|
147
|
-
'disabled:text-keepui-text-disabled',
|
|
145
|
+
'bg-ku-primary text-ku-action-primary border border-ku-action-primary',
|
|
146
|
+
'enabled:hover:bg-ku-action-background transition-colors',
|
|
148
147
|
].join(' '),
|
|
149
148
|
outline: [
|
|
150
|
-
'bg-
|
|
151
|
-
'enabled:hover:
|
|
149
|
+
'bg-ku-primary border border-ku-secondary-border text-ku-gray-text',
|
|
150
|
+
'enabled:hover:text-ku-action-primary enabled:hover:border-ku-action-primary transition-colors',
|
|
152
151
|
].join(' '),
|
|
153
152
|
ghost: [
|
|
154
|
-
'bg-transparent border border-
|
|
155
|
-
'enabled:hover:bg-
|
|
153
|
+
'bg-transparent border border-ku-action-primary text-ku-action-primary',
|
|
154
|
+
'enabled:hover:bg-ku-action-background',
|
|
156
155
|
].join(' '),
|
|
157
156
|
danger: [
|
|
158
|
-
'bg-
|
|
157
|
+
'bg-ku-error-primary text-white border border-ku-error-primary',
|
|
159
158
|
'enabled:hover:opacity-90',
|
|
160
159
|
'enabled:active:opacity-80',
|
|
161
160
|
].join(' '),
|
|
@@ -224,60 +223,314 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
224
223
|
}] });
|
|
225
224
|
|
|
226
225
|
/**
|
|
227
|
-
*
|
|
226
|
+
* Contenedor versátil con soporte de variante, padding, color, estado clickable,
|
|
227
|
+
* seleccionado y scrollable.
|
|
228
|
+
*
|
|
229
|
+
* `padding="screen"` aplica padding lateral y superior pero omite el inferior
|
|
230
|
+
* intencionadamente para que el contenido parezca continuar más allá del área visible,
|
|
231
|
+
* invitando al usuario a hacer scroll. Un `div` espaciador se inserta automáticamente
|
|
232
|
+
* al final del contenido proyectado: cuando el usuario llega al fondo, el espaciador
|
|
233
|
+
* reproduce el padding inferior correcto sin que el consumidor deba declararlo.
|
|
228
234
|
*
|
|
229
235
|
* ```html
|
|
230
|
-
* <keepui-card>
|
|
231
|
-
* <h2>Title</h2>
|
|
232
|
-
* <p>Some content</p>
|
|
233
|
-
* </keepui-card>
|
|
236
|
+
* <keepui-card>Contenido</keepui-card>
|
|
234
237
|
*
|
|
235
|
-
* <keepui-card [
|
|
236
|
-
*
|
|
238
|
+
* <keepui-card variant="flat" padding="lg" [clickable]="true" (clicked)="onSelect()">
|
|
239
|
+
* Card clicable
|
|
237
240
|
* </keepui-card>
|
|
241
|
+
*
|
|
242
|
+
* <div class="h-screen overflow-hidden">
|
|
243
|
+
* <keepui-card padding="screen" [scrollable]="true" [fullHeight]="true">
|
|
244
|
+
* Contenido largo — el padding inferior se gestiona automáticamente
|
|
245
|
+
* </keepui-card>
|
|
246
|
+
* </div>
|
|
238
247
|
* ```
|
|
239
248
|
*/
|
|
240
249
|
class CardComponent {
|
|
241
250
|
constructor() {
|
|
242
|
-
|
|
243
|
-
this.
|
|
251
|
+
this.BASE_CLASS = 'rounded-xl transition-colors overflow-hidden';
|
|
252
|
+
this.VARIANT_CLASS_MAP = {
|
|
253
|
+
flat: '',
|
|
254
|
+
outlined: 'border border-ku-secondary-border',
|
|
255
|
+
};
|
|
256
|
+
this.SELECTED_VARIANT_CLASS_MAP = {
|
|
257
|
+
flat: 'border border-ku-brand-border',
|
|
258
|
+
outlined: 'border border-ku-brand-border',
|
|
259
|
+
};
|
|
260
|
+
this.PADDING_CLASS_MAP = {
|
|
261
|
+
none: '',
|
|
262
|
+
sm: 'p-3',
|
|
263
|
+
md: 'p-4',
|
|
264
|
+
lg: 'p-6',
|
|
265
|
+
screen: 'px-4 pt-4',
|
|
266
|
+
};
|
|
267
|
+
this.COLORS_CLASS_MAP = {
|
|
268
|
+
primary: 'bg-ku-primary',
|
|
269
|
+
secondary: 'bg-ku-secondary',
|
|
270
|
+
};
|
|
271
|
+
this.variant = input('outlined');
|
|
272
|
+
this.padding = input('md');
|
|
273
|
+
this.colors = input('primary');
|
|
274
|
+
this.clickable = input(false);
|
|
275
|
+
this.selected = input(false);
|
|
276
|
+
this.scrollable = input(false);
|
|
277
|
+
this.fullHeight = input(false);
|
|
278
|
+
this.clicked = output();
|
|
244
279
|
this.cardClass = computed(() => {
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
280
|
+
const variantClass = this.selected()
|
|
281
|
+
? this.SELECTED_VARIANT_CLASS_MAP[this.variant()]
|
|
282
|
+
: this.VARIANT_CLASS_MAP[this.variant()];
|
|
283
|
+
const classes = [
|
|
284
|
+
this.BASE_CLASS,
|
|
285
|
+
this.COLORS_CLASS_MAP[this.colors()],
|
|
286
|
+
variantClass,
|
|
287
|
+
this.PADDING_CLASS_MAP[this.padding()],
|
|
288
|
+
];
|
|
289
|
+
if (this.clickable()) {
|
|
290
|
+
classes.push('cursor-pointer hover:bg-ku-primary-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-ku-brand-border focus-visible:ring-offset-2');
|
|
291
|
+
}
|
|
292
|
+
if (this.scrollable()) {
|
|
293
|
+
classes.push('overflow-y-auto', 'overflow-x-auto');
|
|
294
|
+
}
|
|
295
|
+
if (this.fullHeight()) {
|
|
296
|
+
classes.push('h-full');
|
|
297
|
+
}
|
|
298
|
+
return classes.filter(Boolean).join(' ');
|
|
258
299
|
});
|
|
259
300
|
}
|
|
301
|
+
onCardClick() {
|
|
302
|
+
if (this.clickable()) {
|
|
303
|
+
this.clicked.emit();
|
|
304
|
+
}
|
|
305
|
+
}
|
|
260
306
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
261
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
262
|
-
<div
|
|
307
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: CardComponent, isStandalone: true, selector: "keepui-card", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null }, colors: { classPropertyName: "colors", publicName: "colors", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, scrollable: { classPropertyName: "scrollable", publicName: "scrollable", isSignal: true, isRequired: false, transformFunction: null }, fullHeight: { classPropertyName: "fullHeight", publicName: "fullHeight", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, host: { properties: { "class.h-full": "fullHeight()" }, classAttribute: "block" }, ngImport: i0, template: `
|
|
308
|
+
<div
|
|
309
|
+
[class]="cardClass()"
|
|
310
|
+
(click)="onCardClick()"
|
|
311
|
+
[attr.role]="clickable() ? 'button' : null"
|
|
312
|
+
[attr.tabindex]="clickable() ? 0 : null"
|
|
313
|
+
(keydown.enter)="onCardClick()"
|
|
314
|
+
(keydown.space)="onCardClick()"
|
|
315
|
+
>
|
|
263
316
|
<ng-content />
|
|
317
|
+
@if (padding() === 'screen') {
|
|
318
|
+
<div class="h-4 shrink-0" aria-hidden="true"></div>
|
|
319
|
+
}
|
|
264
320
|
</div>
|
|
265
|
-
`, isInline: true }); }
|
|
321
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
266
322
|
}
|
|
267
323
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: CardComponent, decorators: [{
|
|
268
324
|
type: Component,
|
|
269
325
|
args: [{
|
|
270
326
|
selector: 'keepui-card',
|
|
271
327
|
standalone: true,
|
|
272
|
-
|
|
328
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
329
|
+
host: {
|
|
330
|
+
class: 'block',
|
|
331
|
+
'[class.h-full]': 'fullHeight()',
|
|
332
|
+
},
|
|
273
333
|
template: `
|
|
274
|
-
<div
|
|
334
|
+
<div
|
|
335
|
+
[class]="cardClass()"
|
|
336
|
+
(click)="onCardClick()"
|
|
337
|
+
[attr.role]="clickable() ? 'button' : null"
|
|
338
|
+
[attr.tabindex]="clickable() ? 0 : null"
|
|
339
|
+
(keydown.enter)="onCardClick()"
|
|
340
|
+
(keydown.space)="onCardClick()"
|
|
341
|
+
>
|
|
275
342
|
<ng-content />
|
|
343
|
+
@if (padding() === 'screen') {
|
|
344
|
+
<div class="h-4 shrink-0" aria-hidden="true"></div>
|
|
345
|
+
}
|
|
276
346
|
</div>
|
|
277
347
|
`,
|
|
278
348
|
}]
|
|
279
349
|
}] });
|
|
280
350
|
|
|
351
|
+
/**
|
|
352
|
+
* Generic SVG sprite icon renderer.
|
|
353
|
+
*
|
|
354
|
+
* Renders a `<use href="#name">` reference pointing to an SVG symbol pre-registered
|
|
355
|
+
* in the DOM by the consuming application (e.g. via `IconRegistryService`).
|
|
356
|
+
*
|
|
357
|
+
* Accessibility:
|
|
358
|
+
* - When used decoratively (default), the SVG carries `aria-hidden="true"` automatically.
|
|
359
|
+
* - When used as a standalone meaningful icon, supply an `ariaLabel` — the SVG will
|
|
360
|
+
* receive `role="img"` and `aria-label` accordingly.
|
|
361
|
+
*
|
|
362
|
+
* ```html
|
|
363
|
+
* <!-- Decorative — hidden from screen readers -->
|
|
364
|
+
* <keepui-icon name="check-icon" [size]="20" aria-hidden="true" />
|
|
365
|
+
*
|
|
366
|
+
* <!-- Meaningful standalone icon -->
|
|
367
|
+
* <keepui-icon name="close-icon" ariaLabel="Cerrar" />
|
|
368
|
+
* ```
|
|
369
|
+
*/
|
|
370
|
+
class IconComponent {
|
|
371
|
+
constructor() {
|
|
372
|
+
/** ID of the SVG symbol to render (without the `#` prefix). */
|
|
373
|
+
this.name = input.required();
|
|
374
|
+
/** Width and height of the icon in pixels. @default 24 */
|
|
375
|
+
this.size = input(24);
|
|
376
|
+
/** `viewBox` attribute forwarded to the `<svg>` element. @default '0 0 24 24' */
|
|
377
|
+
this.viewBox = input('0 0 24 24');
|
|
378
|
+
/**
|
|
379
|
+
* Accessible label for standalone icons.
|
|
380
|
+
* When provided, sets `role="img"` and `aria-label` on the SVG.
|
|
381
|
+
* When omitted, the SVG is marked `aria-hidden="true"` (decorative).
|
|
382
|
+
* @default ''
|
|
383
|
+
*/
|
|
384
|
+
this.ariaLabel = input('');
|
|
385
|
+
this.href = computed(() => `#${this.name()}`);
|
|
386
|
+
}
|
|
387
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: IconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
388
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.20", type: IconComponent, isStandalone: true, selector: "keepui-icon", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, viewBox: { classPropertyName: "viewBox", publicName: "viewBox", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "inline-flex items-center justify-center" }, ngImport: i0, template: `
|
|
389
|
+
<svg
|
|
390
|
+
class="block"
|
|
391
|
+
[attr.width]="size()"
|
|
392
|
+
[attr.height]="size()"
|
|
393
|
+
[attr.viewBox]="viewBox()"
|
|
394
|
+
[attr.aria-hidden]="ariaLabel() ? null : true"
|
|
395
|
+
[attr.aria-label]="ariaLabel() || null"
|
|
396
|
+
[attr.role]="ariaLabel() ? 'img' : null"
|
|
397
|
+
>
|
|
398
|
+
<use [attr.href]="href()" />
|
|
399
|
+
</svg>
|
|
400
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
401
|
+
}
|
|
402
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: IconComponent, decorators: [{
|
|
403
|
+
type: Component,
|
|
404
|
+
args: [{
|
|
405
|
+
selector: 'keepui-icon',
|
|
406
|
+
standalone: true,
|
|
407
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
408
|
+
host: {
|
|
409
|
+
class: 'inline-flex items-center justify-center',
|
|
410
|
+
},
|
|
411
|
+
template: `
|
|
412
|
+
<svg
|
|
413
|
+
class="block"
|
|
414
|
+
[attr.width]="size()"
|
|
415
|
+
[attr.height]="size()"
|
|
416
|
+
[attr.viewBox]="viewBox()"
|
|
417
|
+
[attr.aria-hidden]="ariaLabel() ? null : true"
|
|
418
|
+
[attr.aria-label]="ariaLabel() || null"
|
|
419
|
+
[attr.role]="ariaLabel() ? 'img' : null"
|
|
420
|
+
>
|
|
421
|
+
<use [attr.href]="href()" />
|
|
422
|
+
</svg>
|
|
423
|
+
`,
|
|
424
|
+
}]
|
|
425
|
+
}] });
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Circular icon-only action button with `default` and `danger` variants,
|
|
429
|
+
* loading state, and full accessibility support.
|
|
430
|
+
*
|
|
431
|
+
* Because this button renders no visible text, `ariaLabel` is **required** to
|
|
432
|
+
* satisfy WCAG 2.1 SC 4.1.2 (Name, Role, Value).
|
|
433
|
+
*
|
|
434
|
+
* The icon color is inherited automatically via `currentColor` from the button's
|
|
435
|
+
* text color, so SVG symbols defined with `stroke="currentColor"` will adapt to
|
|
436
|
+
* both variants and themes without extra classes.
|
|
437
|
+
*
|
|
438
|
+
* ```html
|
|
439
|
+
* <keepui-icon-action-button icon="edit-icon" ariaLabel="Editar" />
|
|
440
|
+
*
|
|
441
|
+
* <keepui-icon-action-button
|
|
442
|
+
* icon="trash-icon"
|
|
443
|
+
* variant="danger"
|
|
444
|
+
* ariaLabel="Eliminar elemento"
|
|
445
|
+
* [loading]="isDeleting()"
|
|
446
|
+
* />
|
|
447
|
+
* ```
|
|
448
|
+
*/
|
|
449
|
+
class IconActionButtonComponent {
|
|
450
|
+
constructor() {
|
|
451
|
+
/** ID of the SVG symbol to render (without the `#` prefix). */
|
|
452
|
+
this.icon = input.required();
|
|
453
|
+
/**
|
|
454
|
+
* Accessible label for the button. Always required — icon-only buttons must
|
|
455
|
+
* have a programmatic name for screen readers (WCAG 2.1 SC 4.1.2).
|
|
456
|
+
*/
|
|
457
|
+
this.ariaLabel = input.required();
|
|
458
|
+
/** Visual style variant. @default 'default' */
|
|
459
|
+
this.variant = input('default');
|
|
460
|
+
/** Size of the inner icon in pixels. @default 20 */
|
|
461
|
+
this.iconSize = input(20);
|
|
462
|
+
/** HTML `type` attribute of the inner `<button>`. @default 'button' */
|
|
463
|
+
this.type = input('button');
|
|
464
|
+
/** Disables the button when `true`. @default false */
|
|
465
|
+
this.disabled = input(false);
|
|
466
|
+
/**
|
|
467
|
+
* Shows an animated spinner and disables the button.
|
|
468
|
+
* Also sets `aria-busy="true"` on the element.
|
|
469
|
+
* @default false
|
|
470
|
+
*/
|
|
471
|
+
this.loading = input(false);
|
|
472
|
+
this.isDisabled = computed(() => this.disabled() || this.loading());
|
|
473
|
+
this.buttonClass = computed(() => {
|
|
474
|
+
const base = [
|
|
475
|
+
'inline-flex items-center justify-center shrink-0 cursor-pointer',
|
|
476
|
+
'size-11 rounded-full border transition-colors',
|
|
477
|
+
'focus-visible:outline-none focus-visible:ring-2',
|
|
478
|
+
'focus-visible:ring-ku-primary-border focus-visible:ring-offset-2',
|
|
479
|
+
'disabled:cursor-not-allowed disabled:opacity-50',
|
|
480
|
+
].join(' ');
|
|
481
|
+
const variantMap = {
|
|
482
|
+
default: [
|
|
483
|
+
'border-ku-secondary-border bg-ku-primary text-ku-gray-text',
|
|
484
|
+
'enabled:hover:bg-ku-action-background enabled:hover:border-ku-action-primary',
|
|
485
|
+
'enabled:hover:text-ku-action-primary',
|
|
486
|
+
].join(' '),
|
|
487
|
+
danger: [
|
|
488
|
+
'border-ku-secondary-border bg-ku-primary text-ku-gray-text',
|
|
489
|
+
'enabled:hover:bg-ku-error-background enabled:hover:border-ku-error-primary enabled:hover:text-ku-error-primary',
|
|
490
|
+
'enabled:hover:opacity-90',
|
|
491
|
+
].join(' '),
|
|
492
|
+
};
|
|
493
|
+
return `${base} ${variantMap[this.variant()]}`;
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: IconActionButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
497
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: IconActionButtonComponent, isStandalone: true, selector: "keepui-icon-action-button", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: true, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: true, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
498
|
+
<button
|
|
499
|
+
[attr.type]="type()"
|
|
500
|
+
[disabled]="isDisabled()"
|
|
501
|
+
[attr.aria-disabled]="isDisabled() ? true : null"
|
|
502
|
+
[attr.aria-busy]="loading() ? true : null"
|
|
503
|
+
[attr.aria-label]="ariaLabel()"
|
|
504
|
+
[class]="buttonClass()"
|
|
505
|
+
>
|
|
506
|
+
@if (loading()) {
|
|
507
|
+
<span class="keepui-iab-spinner" aria-hidden="true"></span>
|
|
508
|
+
} @else {
|
|
509
|
+
<keepui-icon [name]="icon()" [size]="iconSize()" />
|
|
510
|
+
}
|
|
511
|
+
</button>
|
|
512
|
+
`, isInline: true, styles: [".keepui-iab-spinner{display:inline-block;width:1.25em;height:1.25em;border:2px solid currentColor;border-top-color:transparent;border-radius:50%;animation:keepui-iab-spin .65s linear infinite;flex-shrink:0}@keyframes keepui-iab-spin{to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "keepui-icon", inputs: ["name", "size", "viewBox", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
513
|
+
}
|
|
514
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: IconActionButtonComponent, decorators: [{
|
|
515
|
+
type: Component,
|
|
516
|
+
args: [{ selector: 'keepui-icon-action-button', standalone: true, imports: [IconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
517
|
+
<button
|
|
518
|
+
[attr.type]="type()"
|
|
519
|
+
[disabled]="isDisabled()"
|
|
520
|
+
[attr.aria-disabled]="isDisabled() ? true : null"
|
|
521
|
+
[attr.aria-busy]="loading() ? true : null"
|
|
522
|
+
[attr.aria-label]="ariaLabel()"
|
|
523
|
+
[class]="buttonClass()"
|
|
524
|
+
>
|
|
525
|
+
@if (loading()) {
|
|
526
|
+
<span class="keepui-iab-spinner" aria-hidden="true"></span>
|
|
527
|
+
} @else {
|
|
528
|
+
<keepui-icon [name]="icon()" [size]="iconSize()" />
|
|
529
|
+
}
|
|
530
|
+
</button>
|
|
531
|
+
`, styles: [".keepui-iab-spinner{display:inline-block;width:1.25em;height:1.25em;border:2px solid currentColor;border-top-color:transparent;border-radius:50%;animation:keepui-iab-spin .65s linear infinite;flex-shrink:0}@keyframes keepui-iab-spin{to{transform:rotate(360deg)}}\n"] }]
|
|
532
|
+
}] });
|
|
533
|
+
|
|
281
534
|
/**
|
|
282
535
|
* Typed constants for every translation key used in @keepui/ui.
|
|
283
536
|
*
|
|
@@ -375,7 +628,7 @@ class ImagePreviewComponent {
|
|
|
375
628
|
@if (imageUrl()) {
|
|
376
629
|
<div class="max-w-full">
|
|
377
630
|
<img
|
|
378
|
-
class="max-w-full h-auto rounded border border-
|
|
631
|
+
class="max-w-full h-auto rounded border border-ku-secondary-border"
|
|
379
632
|
[src]="imageUrl()"
|
|
380
633
|
[attr.alt]="keys.PREVIEW_ALT | transloco"
|
|
381
634
|
/>
|
|
@@ -383,7 +636,7 @@ class ImagePreviewComponent {
|
|
|
383
636
|
}
|
|
384
637
|
|
|
385
638
|
@if (error()) {
|
|
386
|
-
<p class="text-
|
|
639
|
+
<p class="text-ku-red-text text-sm m-0" role="alert">{{ error() }}</p>
|
|
387
640
|
}
|
|
388
641
|
|
|
389
642
|
</div>
|
|
@@ -421,7 +674,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
421
674
|
@if (imageUrl()) {
|
|
422
675
|
<div class="max-w-full">
|
|
423
676
|
<img
|
|
424
|
-
class="max-w-full h-auto rounded border border-
|
|
677
|
+
class="max-w-full h-auto rounded border border-ku-secondary-border"
|
|
425
678
|
[src]="imageUrl()"
|
|
426
679
|
[attr.alt]="keys.PREVIEW_ALT | transloco"
|
|
427
680
|
/>
|
|
@@ -429,7 +682,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
429
682
|
}
|
|
430
683
|
|
|
431
684
|
@if (error()) {
|
|
432
|
-
<p class="text-
|
|
685
|
+
<p class="text-ku-red-text text-sm m-0" role="alert">{{ error() }}</p>
|
|
433
686
|
}
|
|
434
687
|
|
|
435
688
|
</div>
|
|
@@ -652,5 +905,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
652
905
|
* Generated bundle index. Do not edit.
|
|
653
906
|
*/
|
|
654
907
|
|
|
655
|
-
export { ButtonComponent, CardComponent, FILE_PORT, ImagePreviewComponent, KEEPUI_AVAILABLE_LANGUAGES, KEEPUI_TRANSLATIONS, KEEPUI_TRANSLATION_KEYS, KeepUiLanguageService, MockFileService, WebFileService, provideKeepUi, provideKeepUiI18n };
|
|
908
|
+
export { ButtonComponent, CardComponent, FILE_PORT, IconActionButtonComponent, IconComponent, ImagePreviewComponent, KEEPUI_AVAILABLE_LANGUAGES, KEEPUI_TRANSLATIONS, KEEPUI_TRANSLATION_KEYS, KeepUiLanguageService, MockFileService, WebFileService, provideKeepUi, provideKeepUiI18n };
|
|
656
909
|
//# sourceMappingURL=keepui-ui.mjs.map
|