@kaufmann-lab/ui 0.1.1 → 0.1.2
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 +37 -26
- package/fesm2022/kaufmann-lab-ui.mjs +68 -8
- package/fesm2022/kaufmann-lab-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/kaufmann-lab-ui.d.ts +38 -3
package/package.json
CHANGED
|
@@ -2,8 +2,14 @@ import * as _angular_core from '@angular/core';
|
|
|
2
2
|
import { AfterContentInit, TemplateRef, AfterViewInit } from '@angular/core';
|
|
3
3
|
import { ControlValueAccessor } from '@angular/forms';
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Nombre de cada ícono del design system. Página 5 del PDF fija un set de
|
|
7
|
+
* 59; `eye-off` es una extensión propia por fuera de ese set, agregada para
|
|
8
|
+
* el toggle de mostrar/ocultar contraseña de `Input` — no hay un ícono de
|
|
9
|
+
* "ojo tachado" en la spec original porque esa interacción no estaba
|
|
10
|
+
* contemplada ahí.
|
|
11
|
+
*/
|
|
12
|
+
type IconName = 'activity' | 'alert-circle' | 'alert-octagon' | 'alert-triangle' | 'award' | 'bar-chart' | 'bell' | 'bus' | 'calculator' | 'calendar' | 'car' | 'cart' | 'check' | 'check-circle' | 'check-square' | 'chevron-down' | 'chevron-left' | 'chevron-left-bar' | 'chevron-right' | 'clipboard' | 'clock' | 'credit-card' | 'download' | 'edit' | 'external-link' | 'eye' | 'eye-off' | 'file' | 'filter' | 'gauge' | 'gift' | 'grid' | 'history' | 'inbox' | 'layers' | 'list' | 'map' | 'map-pin' | 'menu' | 'mic' | 'mic-off' | 'more-vertical' | 'pause' | 'phone' | 'play' | 'plus' | 'search' | 'settings' | 'shield-check' | 'sort' | 'star' | 'ticket' | 'tool' | 'trash' | 'truck' | 'upload-cloud' | 'user' | 'user-search' | 'video' | 'x';
|
|
7
13
|
type IconSize = 'sm' | 'md' | 'lg';
|
|
8
14
|
/**
|
|
9
15
|
* Ícono de trazo del design system — 59 glyphs (página 5), grilla 24×24,
|
|
@@ -780,6 +786,16 @@ declare class FolderTabs {
|
|
|
780
786
|
* <kf-input label="Correo" formControlName="email"
|
|
781
787
|
* [invalid]="email.invalid && email.touched"
|
|
782
788
|
* [errorMessage]="email.touched && email.hasError('required') ? 'Ingresa tu correo.' : undefined" />
|
|
789
|
+
*
|
|
790
|
+
* `toggleable` solo tiene efecto cuando `type="password"`: agrega un botón
|
|
791
|
+
* de ojo al final del campo que alterna la visibilidad del valor tipeado
|
|
792
|
+
* (cambia el `type` real del `<input>` nativo entre `password` y `text`,
|
|
793
|
+
* nunca expone el valor en el DOM de otra forma). El botón es `type="button"`
|
|
794
|
+
* — nunca dispara submit del form contenedor — y anuncia su acción con
|
|
795
|
+
* `aria-label` dinámico y `aria-pressed`, ya que es un toggle, no un botón
|
|
796
|
+
* de una sola acción.
|
|
797
|
+
*
|
|
798
|
+
* <kf-input type="password" label="Contraseña" toggleable formControlName="password" />
|
|
783
799
|
*/
|
|
784
800
|
declare class Input implements ControlValueAccessor, AfterViewInit {
|
|
785
801
|
private static nextId;
|
|
@@ -798,6 +814,8 @@ declare class Input implements ControlValueAccessor, AfterViewInit {
|
|
|
798
814
|
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
799
815
|
readonly type: _angular_core.InputSignal<string>;
|
|
800
816
|
readonly placeholder: _angular_core.InputSignal<string>;
|
|
817
|
+
/** Agrega el botón de mostrar/ocultar — sin efecto si `type` no es `"password"`. */
|
|
818
|
+
readonly toggleable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
801
819
|
protected readonly inputId: string;
|
|
802
820
|
protected readonly hintId: string;
|
|
803
821
|
protected readonly errorId: string;
|
|
@@ -807,6 +825,17 @@ declare class Input implements ControlValueAccessor, AfterViewInit {
|
|
|
807
825
|
private readonly disabledByForm;
|
|
808
826
|
/** Disabled real: por input() directo o por el FormControl asociado. */
|
|
809
827
|
protected readonly isDisabled: _angular_core.Signal<boolean>;
|
|
828
|
+
/** Estado interno del toggle — irrelevante si `showPasswordToggle()` es false. */
|
|
829
|
+
protected readonly passwordVisible: _angular_core.WritableSignal<boolean>;
|
|
830
|
+
/** El botón solo tiene sentido si el campo realmente es de contraseña. */
|
|
831
|
+
protected readonly showPasswordToggle: _angular_core.Signal<boolean>;
|
|
832
|
+
/**
|
|
833
|
+
* `type` real que recibe el `<input>` nativo: igual a `type()` salvo
|
|
834
|
+
* cuando el toggle está activo y visible, donde pasa a `text` para
|
|
835
|
+
* mostrar el valor en claro sin cambiar `type()` en sí (evita que un
|
|
836
|
+
* consumidor que lee `type()` desde afuera vea un valor inconsistente).
|
|
837
|
+
*/
|
|
838
|
+
protected readonly effectiveType: _angular_core.Signal<string>;
|
|
810
839
|
private onChange;
|
|
811
840
|
private onTouched;
|
|
812
841
|
ngAfterViewInit(): void;
|
|
@@ -816,8 +845,14 @@ declare class Input implements ControlValueAccessor, AfterViewInit {
|
|
|
816
845
|
setDisabledState(isDisabled: boolean): void;
|
|
817
846
|
protected onInput(rawValue: string): void;
|
|
818
847
|
protected onBlur(): void;
|
|
848
|
+
/**
|
|
849
|
+
* Alterna la visibilidad del valor. No dispara `onBlur`/pierde el foco:
|
|
850
|
+
* el botón vive dentro del mismo `.kf-input__field`, así que un click acá
|
|
851
|
+
* no debe tratarse como si el usuario hubiese abandonado el campo.
|
|
852
|
+
*/
|
|
853
|
+
protected onTogglePasswordVisibility(): void;
|
|
819
854
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<Input, never>;
|
|
820
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<Input, "kf-input", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "suffix": { "alias": "suffix"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
855
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<Input, "kf-input", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "suffix": { "alias": "suffix"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "toggleable": { "alias": "toggleable"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
821
856
|
}
|
|
822
857
|
|
|
823
858
|
/**
|