mood-ui 0.1.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/LICENSE +21 -0
- package/README.OLD.md +5 -0
- package/README.md +84 -0
- package/dist/components/ModoProvider.vue.d.ts +61 -0
- package/dist/components/data-display/Card.vue.d.ts +26 -0
- package/dist/components/data-display/Typography.vue.d.ts +21 -0
- package/dist/components/data-display/avatar/Avatar.vue.d.ts +9 -0
- package/dist/components/data-display/avatar/AvatarGroup.vue.d.ts +7 -0
- package/dist/components/data-display/calendar/AgendaView.vue.d.ts +76 -0
- package/dist/components/data-display/calendar/Calendar.vue.d.ts +25 -0
- package/dist/components/data-display/calendar/CalendarEventTooltip.vue.d.ts +34 -0
- package/dist/components/data-display/calendar/CalendarHeader.vue.d.ts +67 -0
- package/dist/components/data-display/calendar/DayView.vue.d.ts +91 -0
- package/dist/components/data-display/calendar/MonthView.vue.d.ts +71 -0
- package/dist/components/data-display/calendar/Scheduler.vue.d.ts +102 -0
- package/dist/components/data-display/calendar/WeekView.vue.d.ts +101 -0
- package/dist/components/data-display/date-picker/DateRangePicker.vue.d.ts +18 -0
- package/dist/components/data-display/date-picker/DateTimePicker.vue.d.ts +17 -0
- package/dist/components/data-display/table/Table.vue.d.ts +75 -0
- package/dist/components/data-display/table/TableColumn.vue.d.ts +26 -0
- package/dist/components/data-display/table/TablePagination.vue.d.ts +14 -0
- package/dist/components/feedback/Badge.vue.d.ts +24 -0
- package/dist/components/feedback/Banner.vue.d.ts +28 -0
- package/dist/components/feedback/Chip.vue.d.ts +22 -0
- package/dist/components/feedback/ConfirmDialog.vue.d.ts +4 -0
- package/dist/components/feedback/Drawer.vue.d.ts +43 -0
- package/dist/components/feedback/EmptyState.vue.d.ts +19 -0
- package/dist/components/feedback/Loader.vue.d.ts +7 -0
- package/dist/components/feedback/Modal.vue.d.ts +44 -0
- package/dist/components/feedback/ProgressBar.vue.d.ts +10 -0
- package/dist/components/feedback/Skeleton.vue.d.ts +10 -0
- package/dist/components/feedback/Toast.vue.d.ts +19 -0
- package/dist/components/feedback/ToastContainer.vue.d.ts +11 -0
- package/dist/components/feedback/Tooltip.vue.d.ts +35 -0
- package/dist/components/forms/Button.vue.d.ts +24 -0
- package/dist/components/forms/ButtonGroup.vue.d.ts +16 -0
- package/dist/components/forms/Checkbox.vue.d.ts +22 -0
- package/dist/components/forms/Combobox.vue.d.ts +48 -0
- package/dist/components/forms/DateField.vue.d.ts +30 -0
- package/dist/components/forms/DateRangeField.vue.d.ts +32 -0
- package/dist/components/forms/DateTimeField.vue.d.ts +34 -0
- package/dist/components/forms/FileInput.vue.d.ts +33 -0
- package/dist/components/forms/FormField.vue.d.ts +30 -0
- package/dist/components/forms/Input.vue.d.ts +33 -0
- package/dist/components/forms/MultiSelect.vue.d.ts +51 -0
- package/dist/components/forms/NumberInput.vue.d.ts +35 -0
- package/dist/components/forms/PasswordInput.vue.d.ts +40 -0
- package/dist/components/forms/Radio.vue.d.ts +16 -0
- package/dist/components/forms/RadioGroup.vue.d.ts +27 -0
- package/dist/components/forms/RangeSlider.vue.d.ts +27 -0
- package/dist/components/forms/SearchInput.vue.d.ts +37 -0
- package/dist/components/forms/Select.vue.d.ts +46 -0
- package/dist/components/forms/Slider.vue.d.ts +26 -0
- package/dist/components/forms/Switch.vue.d.ts +22 -0
- package/dist/components/forms/Textarea.vue.d.ts +36 -0
- package/dist/components/layout/AppShell.vue.d.ts +124 -0
- package/dist/components/layout/Canvas.vue.d.ts +21 -0
- package/dist/components/layout/Container.vue.d.ts +21 -0
- package/dist/components/layout/Divider.vue.d.ts +21 -0
- package/dist/components/layout/HStack.vue.d.ts +14 -0
- package/dist/components/layout/PageHeader.vue.d.ts +34 -0
- package/dist/components/layout/PopoverPanel.vue.d.ts +29 -0
- package/dist/components/layout/Sidebar.vue.d.ts +39 -0
- package/dist/components/layout/SidebarRow.vue.d.ts +31 -0
- package/dist/components/layout/SidebarRowContent.vue.d.ts +27 -0
- package/dist/components/layout/Stack.vue.d.ts +24 -0
- package/dist/components/layout/Topbar.vue.d.ts +36 -0
- package/dist/components/layout/VStack.vue.d.ts +14 -0
- package/dist/components/navigation/Breadcrumbs.vue.d.ts +13 -0
- package/dist/components/navigation/DropdownMenu.vue.d.ts +36 -0
- package/dist/components/navigation/Pagination.vue.d.ts +18 -0
- package/dist/components/navigation/Tabs.vue.d.ts +37 -0
- package/dist/composables/eventColors.d.ts +13 -0
- package/dist/composables/useAutoScroll.d.ts +11 -0
- package/dist/composables/useCalendar.d.ts +44 -0
- package/dist/composables/useCalendarKeyboard.d.ts +17 -0
- package/dist/composables/useCalendarTheme.d.ts +22 -0
- package/dist/composables/useColorMode.d.ts +28 -0
- package/dist/composables/useConfirm.d.ts +146 -0
- package/dist/composables/useCurrentTimeLine.d.ts +5 -0
- package/dist/composables/useEventHover.d.ts +29 -0
- package/dist/composables/useField.d.ts +89 -0
- package/dist/composables/useModoConfig.d.ts +29 -0
- package/dist/composables/usePopover.d.ts +59 -0
- package/dist/composables/useTable.d.ts +29 -0
- package/dist/composables/useTableColumnsState.d.ts +52 -0
- package/dist/composables/useTableFilter.d.ts +39 -0
- package/dist/composables/useTableKeyboard.d.ts +38 -0
- package/dist/composables/useTablePagination.d.ts +44 -0
- package/dist/composables/useTableQuery.d.ts +90 -0
- package/dist/composables/useTableSelection.d.ts +40 -0
- package/dist/composables/useTableSort.d.ts +41 -0
- package/dist/composables/useTableTree.d.ts +55 -0
- package/dist/composables/useTableUrlSync.d.ts +66 -0
- package/dist/composables/useTableVirtual.d.ts +43 -0
- package/dist/composables/useTimeGrid.d.ts +22 -0
- package/dist/composables/useToast.d.ts +176 -0
- package/dist/config/ModoConfig.d.ts +32 -0
- package/dist/config/ModoLocale.d.ts +212 -0
- package/dist/config/colorPrimitives.d.ts +13 -0
- package/dist/config/createModoUI.d.ts +85 -0
- package/dist/config/palettes.d.ts +30 -0
- package/dist/index.d.ts +130 -0
- package/dist/interfaces/data-display/Card.interface.d.ts +8 -0
- package/dist/interfaces/data-display/Typography.interface.d.ts +12 -0
- package/dist/interfaces/data-display/avatar/Avatar.interface.d.ts +24 -0
- package/dist/interfaces/data-display/avatar/AvatarGroup.interface.d.ts +8 -0
- package/dist/interfaces/data-display/calendar/AgendaView.interface.d.ts +29 -0
- package/dist/interfaces/data-display/calendar/Calendar.interface.d.ts +16 -0
- package/dist/interfaces/data-display/calendar/DayView.interface.d.ts +43 -0
- package/dist/interfaces/data-display/calendar/MonthView.interface.d.ts +41 -0
- package/dist/interfaces/data-display/calendar/Scheduler.interface.d.ts +63 -0
- package/dist/interfaces/data-display/calendar/WeekView.interface.d.ts +65 -0
- package/dist/interfaces/data-display/date-picker/DateRangePicker.interface.d.ts +20 -0
- package/dist/interfaces/data-display/date-picker/DateTimePicker.interface.d.ts +16 -0
- package/dist/interfaces/data-display/table/Table.interface.d.ts +615 -0
- package/dist/interfaces/data-display/table/TableColumn.interface.d.ts +10 -0
- package/dist/interfaces/data-display/table/TablePagination.interface.d.ts +33 -0
- package/dist/interfaces/feedback/Badge.interface.d.ts +14 -0
- package/dist/interfaces/feedback/Banner.interface.d.ts +14 -0
- package/dist/interfaces/feedback/Chip.interface.d.ts +35 -0
- package/dist/interfaces/feedback/ConfirmDialog.interface.d.ts +49 -0
- package/dist/interfaces/feedback/Drawer.interface.d.ts +49 -0
- package/dist/interfaces/feedback/EmptyState.interface.d.ts +31 -0
- package/dist/interfaces/feedback/Loader.interface.d.ts +7 -0
- package/dist/interfaces/feedback/Modal.interface.d.ts +50 -0
- package/dist/interfaces/feedback/ProgressBar.interface.d.ts +31 -0
- package/dist/interfaces/feedback/Skeleton.interface.d.ts +123 -0
- package/dist/interfaces/feedback/Toast.interface.d.ts +86 -0
- package/dist/interfaces/feedback/Tooltip.interface.d.ts +38 -0
- package/dist/interfaces/forms/Button.interface.d.ts +26 -0
- package/dist/interfaces/forms/ButtonGroup.interface.d.ts +9 -0
- package/dist/interfaces/forms/Checkbox.interface.d.ts +32 -0
- package/dist/interfaces/forms/Combobox.interface.d.ts +57 -0
- package/dist/interfaces/forms/DateField.interface.d.ts +39 -0
- package/dist/interfaces/forms/DateRangeField.interface.d.ts +41 -0
- package/dist/interfaces/forms/DateTimeField.interface.d.ts +44 -0
- package/dist/interfaces/forms/FileInput.interface.d.ts +105 -0
- package/dist/interfaces/forms/FormField.interface.d.ts +55 -0
- package/dist/interfaces/forms/Input.interface.d.ts +68 -0
- package/dist/interfaces/forms/NumberInput.interface.d.ts +77 -0
- package/dist/interfaces/forms/PasswordInput.interface.d.ts +84 -0
- package/dist/interfaces/forms/Radio.interface.d.ts +54 -0
- package/dist/interfaces/forms/RadioGroup.context.d.ts +13 -0
- package/dist/interfaces/forms/RangeSlider.interface.d.ts +30 -0
- package/dist/interfaces/forms/SearchInput.interface.d.ts +59 -0
- package/dist/interfaces/forms/Select.interface.d.ts +145 -0
- package/dist/interfaces/forms/Slider.interface.d.ts +36 -0
- package/dist/interfaces/forms/Switch.interface.d.ts +30 -0
- package/dist/interfaces/forms/Textarea.interface.d.ts +64 -0
- package/dist/interfaces/layout/AppShell.interface.d.ts +56 -0
- package/dist/interfaces/layout/Canvas.interface.d.ts +39 -0
- package/dist/interfaces/layout/Container.interface.d.ts +8 -0
- package/dist/interfaces/layout/Divider.interface.d.ts +53 -0
- package/dist/interfaces/layout/PageHeader.interface.d.ts +23 -0
- package/dist/interfaces/layout/Sidebar.interface.d.ts +88 -0
- package/dist/interfaces/layout/Stack.interface.d.ts +42 -0
- package/dist/interfaces/layout/Topbar.interface.d.ts +28 -0
- package/dist/interfaces/navigation/Breadcrumbs.interface.d.ts +38 -0
- package/dist/interfaces/navigation/DropdownMenu.interface.d.ts +72 -0
- package/dist/interfaces/navigation/Pagination.interface.d.ts +37 -0
- package/dist/interfaces/navigation/Tabs.interface.d.ts +74 -0
- package/dist/mood-ui.cjs +4 -0
- package/dist/mood-ui.cjs.map +1 -0
- package/dist/mood-ui.css +2 -0
- package/dist/mood-ui.mjs +19832 -0
- package/dist/mood-ui.mjs.map +1 -0
- package/package.json +72 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
/** Formato de display del valor en el input. */
|
|
3
|
+
export type DateDisplayFormat = 'short' | 'medium' | 'long' | 'iso' | ((value: Date) => string);
|
|
4
|
+
export interface DateField {
|
|
5
|
+
modelValue?: Date | null;
|
|
6
|
+
/** Formato del texto en el trigger. @default 'medium' */
|
|
7
|
+
displayFormat?: DateDisplayFormat;
|
|
8
|
+
locale?: string;
|
|
9
|
+
firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
10
|
+
minDate?: Date;
|
|
11
|
+
maxDate?: Date;
|
|
12
|
+
disabledDates?: Date[];
|
|
13
|
+
showOutsideDays?: boolean;
|
|
14
|
+
/** Campo estándar. */
|
|
15
|
+
label?: string;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
helperText?: string;
|
|
18
|
+
errorText?: string;
|
|
19
|
+
variant?: 'outline' | 'filled' | 'ghost';
|
|
20
|
+
color?: 'default' | 'primary' | 'danger' | 'success' | 'warning';
|
|
21
|
+
size?: 'small' | 'medium' | 'large';
|
|
22
|
+
radius?: 'none' | 'small' | 'medium' | 'large' | 'full';
|
|
23
|
+
/** Estilo del halo persistente. Hereda del ModoProvider si se omite. */
|
|
24
|
+
halo?: 'tinted' | 'neutral' | 'off';
|
|
25
|
+
fullWidth?: boolean;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
readonly?: boolean;
|
|
28
|
+
required?: boolean;
|
|
29
|
+
loading?: boolean;
|
|
30
|
+
clearable?: boolean;
|
|
31
|
+
/** Cierra el popover al seleccionar una fecha. @default true */
|
|
32
|
+
closeOnSelect?: boolean;
|
|
33
|
+
/** Icono a la izquierda. @default CalendarIcon */
|
|
34
|
+
iconLeft?: Component;
|
|
35
|
+
id?: string;
|
|
36
|
+
name?: string;
|
|
37
|
+
autofocus?: boolean;
|
|
38
|
+
ariaLabel?: string;
|
|
39
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
import { DateDisplayFormat } from './DateField.interface';
|
|
3
|
+
import { RangePreset } from '../data-display/date-picker/DateRangePicker.interface';
|
|
4
|
+
export type { RangePreset };
|
|
5
|
+
export interface DateRangeField {
|
|
6
|
+
modelValue?: [Date | null, Date | null];
|
|
7
|
+
displayFormat?: DateDisplayFormat;
|
|
8
|
+
/** Separador entre inicio y fin. @default ' → ' */
|
|
9
|
+
separator?: string;
|
|
10
|
+
locale?: string;
|
|
11
|
+
firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
12
|
+
minDate?: Date;
|
|
13
|
+
maxDate?: Date;
|
|
14
|
+
disabledDates?: Date[];
|
|
15
|
+
months?: 1 | 2;
|
|
16
|
+
showPresets?: boolean;
|
|
17
|
+
presets?: RangePreset[];
|
|
18
|
+
minRange?: number;
|
|
19
|
+
maxRange?: number;
|
|
20
|
+
label?: string;
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
helperText?: string;
|
|
23
|
+
errorText?: string;
|
|
24
|
+
variant?: 'outline' | 'filled' | 'ghost';
|
|
25
|
+
color?: 'default' | 'primary' | 'danger' | 'success' | 'warning';
|
|
26
|
+
size?: 'small' | 'medium' | 'large';
|
|
27
|
+
radius?: 'none' | 'small' | 'medium' | 'large' | 'full';
|
|
28
|
+
/** Estilo del halo persistente. Hereda del ModoProvider si se omite. */
|
|
29
|
+
halo?: 'tinted' | 'neutral' | 'off';
|
|
30
|
+
fullWidth?: boolean;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
readonly?: boolean;
|
|
33
|
+
required?: boolean;
|
|
34
|
+
loading?: boolean;
|
|
35
|
+
clearable?: boolean;
|
|
36
|
+
iconLeft?: Component;
|
|
37
|
+
id?: string;
|
|
38
|
+
name?: string;
|
|
39
|
+
autofocus?: boolean;
|
|
40
|
+
ariaLabel?: string;
|
|
41
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
import { DateDisplayFormat } from './DateField.interface';
|
|
3
|
+
export type TimeDisplayFormat = 'short' | 'medium' | ((d: Date) => string);
|
|
4
|
+
export interface DateTimeField {
|
|
5
|
+
modelValue?: Date | null;
|
|
6
|
+
/** Formato del bloque de fecha. @default 'medium' */
|
|
7
|
+
dateFormat?: DateDisplayFormat;
|
|
8
|
+
/** Formato del bloque de hora. @default 'short' */
|
|
9
|
+
timeFormat?: TimeDisplayFormat;
|
|
10
|
+
/** Separador entre fecha y hora. @default ' · ' */
|
|
11
|
+
separator?: string;
|
|
12
|
+
locale?: string;
|
|
13
|
+
firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
14
|
+
minDate?: Date;
|
|
15
|
+
maxDate?: Date;
|
|
16
|
+
disabledDates?: Date[];
|
|
17
|
+
/** '12h' | '24h' */
|
|
18
|
+
format?: '12h' | '24h';
|
|
19
|
+
step?: number;
|
|
20
|
+
showSeconds?: boolean;
|
|
21
|
+
minTime?: string;
|
|
22
|
+
maxTime?: string;
|
|
23
|
+
label?: string;
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
helperText?: string;
|
|
26
|
+
errorText?: string;
|
|
27
|
+
variant?: 'outline' | 'filled' | 'ghost';
|
|
28
|
+
color?: 'default' | 'primary' | 'danger' | 'success' | 'warning';
|
|
29
|
+
size?: 'small' | 'medium' | 'large';
|
|
30
|
+
radius?: 'none' | 'small' | 'medium' | 'large' | 'full';
|
|
31
|
+
/** Estilo del halo persistente. Hereda del ModoProvider si se omite. */
|
|
32
|
+
halo?: 'tinted' | 'neutral' | 'off';
|
|
33
|
+
fullWidth?: boolean;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
readonly?: boolean;
|
|
36
|
+
required?: boolean;
|
|
37
|
+
loading?: boolean;
|
|
38
|
+
clearable?: boolean;
|
|
39
|
+
iconLeft?: Component;
|
|
40
|
+
id?: string;
|
|
41
|
+
name?: string;
|
|
42
|
+
autofocus?: boolean;
|
|
43
|
+
ariaLabel?: string;
|
|
44
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
export interface FileInputFile {
|
|
3
|
+
file: File;
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
size: number;
|
|
7
|
+
type: string;
|
|
8
|
+
/** URL local creada con URL.createObjectURL (si es imagen). */
|
|
9
|
+
previewUrl?: string;
|
|
10
|
+
/** Progreso 0–100 (cuando se provee externamente). */
|
|
11
|
+
progress?: number;
|
|
12
|
+
/** Error de validación o upload. */
|
|
13
|
+
error?: string;
|
|
14
|
+
}
|
|
15
|
+
/** Código semántico de rechazo — estable y pensado para i18n. */
|
|
16
|
+
export type FileInputRejectCode = 'size' | 'type' | 'count';
|
|
17
|
+
/** Contexto pasado al resolver un mensaje de rechazo. */
|
|
18
|
+
export interface FileInputRejectContext {
|
|
19
|
+
file: File;
|
|
20
|
+
code: FileInputRejectCode;
|
|
21
|
+
/** Para `'size'`: bytes; para `'count'`: número; para `'type'`: string `accept`. */
|
|
22
|
+
limit?: number | string;
|
|
23
|
+
/** Helper para formatear bytes a una cadena legible (e.g. "5.0 MB"). */
|
|
24
|
+
formatBytes: (n: number) => string;
|
|
25
|
+
}
|
|
26
|
+
/** Payload emitido por `@reject`. */
|
|
27
|
+
export interface FileInputRejection {
|
|
28
|
+
file: File;
|
|
29
|
+
code: FileInputRejectCode;
|
|
30
|
+
message: string;
|
|
31
|
+
limit?: number | string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Override de los mensajes por defecto. Cada entrada puede ser:
|
|
35
|
+
* - `string` literal (usa `{limit}` como placeholder opcional).
|
|
36
|
+
* - función que recibe el contexto y devuelve el string.
|
|
37
|
+
*/
|
|
38
|
+
export type FileInputRejectMessages = Partial<Record<FileInputRejectCode, string | ((ctx: FileInputRejectContext) => string)>>;
|
|
39
|
+
export interface FileInput {
|
|
40
|
+
/** Lista actual de archivos. v-model. */
|
|
41
|
+
modelValue?: File[] | null;
|
|
42
|
+
/** Permite selección múltiple. @default false */
|
|
43
|
+
multiple?: boolean;
|
|
44
|
+
/** MIME types / extensiones aceptadas (ej. 'image/*', '.pdf'). */
|
|
45
|
+
accept?: string;
|
|
46
|
+
/** Tamaño máximo por archivo en bytes. */
|
|
47
|
+
maxSize?: number;
|
|
48
|
+
/** Cantidad máxima de archivos cuando `multiple`. */
|
|
49
|
+
maxFiles?: number;
|
|
50
|
+
/**
|
|
51
|
+
* Mensajes custom para los rechazos (i18n). El componente emite también
|
|
52
|
+
* un `code` semántico en `@reject`, así que los consumidores pueden
|
|
53
|
+
* ignorar estos textos si usan vue-i18n u otro mecanismo.
|
|
54
|
+
*/
|
|
55
|
+
rejectMessages?: FileInputRejectMessages;
|
|
56
|
+
/** Muestra preview de thumbnails para imágenes. @default true */
|
|
57
|
+
previews?: boolean;
|
|
58
|
+
/** Habilita drag & drop sobre el área. @default true */
|
|
59
|
+
dropzone?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Presentación del área de drop.
|
|
62
|
+
* - `'inline'` (default): fila compacta estilo input con botón Browse.
|
|
63
|
+
* - `'area'`: área prominente tipo "drop zone" con icono grande y call-to-action.
|
|
64
|
+
* @default 'inline'
|
|
65
|
+
*/
|
|
66
|
+
dropzoneVariant?: 'inline' | 'area';
|
|
67
|
+
/** Altura mínima del área cuando `dropzoneVariant='area'`. @default 'medium' */
|
|
68
|
+
dropzoneHeight?: 'small' | 'medium' | 'large';
|
|
69
|
+
/**
|
|
70
|
+
* Usa borde punteado en el área. Ideal para hacer evidente la
|
|
71
|
+
* "drop zone". @default false
|
|
72
|
+
*/
|
|
73
|
+
dashed?: boolean;
|
|
74
|
+
/** Texto principal del área (solo `dropzoneVariant='area'`). */
|
|
75
|
+
dropzoneLabel?: string;
|
|
76
|
+
/** Texto secundario del área (solo `dropzoneVariant='area'`). */
|
|
77
|
+
dropzoneHint?: string;
|
|
78
|
+
/** Al hacer click en el área completa abre el picker. @default true */
|
|
79
|
+
clickToSelect?: boolean;
|
|
80
|
+
/** Progreso externo por archivo (0–100). Mapa id → progress. */
|
|
81
|
+
progress?: Record<string, number>;
|
|
82
|
+
/** Error externo por archivo. Mapa id → mensaje. */
|
|
83
|
+
errors?: Record<string, string>;
|
|
84
|
+
/** Campo estándar. */
|
|
85
|
+
label?: string;
|
|
86
|
+
placeholder?: string;
|
|
87
|
+
helperText?: string;
|
|
88
|
+
errorText?: string;
|
|
89
|
+
variant?: 'outline' | 'filled' | 'ghost';
|
|
90
|
+
color?: 'default' | 'primary' | 'danger' | 'success' | 'warning';
|
|
91
|
+
size?: 'small' | 'medium' | 'large';
|
|
92
|
+
radius?: 'none' | 'small' | 'medium' | 'large' | 'full';
|
|
93
|
+
/** Estilo del halo persistente. Hereda del ModoProvider si se omite. */
|
|
94
|
+
halo?: 'tinted' | 'neutral' | 'off';
|
|
95
|
+
fullWidth?: boolean;
|
|
96
|
+
disabled?: boolean;
|
|
97
|
+
readonly?: boolean;
|
|
98
|
+
required?: boolean;
|
|
99
|
+
loading?: boolean;
|
|
100
|
+
iconLeft?: Component;
|
|
101
|
+
id?: string;
|
|
102
|
+
name?: string;
|
|
103
|
+
autofocus?: boolean;
|
|
104
|
+
ariaLabel?: string;
|
|
105
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export interface FormField {
|
|
2
|
+
/** Visible label text. Skipped if both `label` and `#label` slot are absent. */
|
|
3
|
+
label?: string;
|
|
4
|
+
/** Optional helper text shown below the control. Hidden when `errorText` is set. */
|
|
5
|
+
helperText?: string;
|
|
6
|
+
/** Error text. When present the field announces `aria-invalid` and uses the danger color. */
|
|
7
|
+
errorText?: string;
|
|
8
|
+
/** Adds the red asterisk and `aria-required` on the control. */
|
|
9
|
+
required?: boolean;
|
|
10
|
+
/** Marks the control as disabled — purely visual (`for` label still wired). */
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Explicit id wired between label and control. If omitted, a unique id is
|
|
14
|
+
* generated and exposed via the default slot for the consumer to bind.
|
|
15
|
+
*/
|
|
16
|
+
id?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Layout orientation. `vertical` stacks label/control/helper; `horizontal`
|
|
19
|
+
* places the label on the left and the control on the right.
|
|
20
|
+
* @default 'vertical'
|
|
21
|
+
*/
|
|
22
|
+
orientation?: 'vertical' | 'horizontal';
|
|
23
|
+
/**
|
|
24
|
+
* Width of the label column when `orientation="horizontal"` (CSS length).
|
|
25
|
+
* @default '10rem'
|
|
26
|
+
*/
|
|
27
|
+
labelWidth?: string;
|
|
28
|
+
/** Apply `w-full` to the wrapper. */
|
|
29
|
+
fullWidth?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Right-aligned hint shown next to the label (e.g. `'Optional'`, `'1/4'`).
|
|
32
|
+
* Decorative — not announced to screen readers.
|
|
33
|
+
*/
|
|
34
|
+
hint?: string;
|
|
35
|
+
/** Tag rendered for the wrapper. @default 'div' */
|
|
36
|
+
as?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Slot bindings exposed by `<FormField>`'s default slot. Spread these onto
|
|
40
|
+
* the inner control to wire label/aria automatically.
|
|
41
|
+
*/
|
|
42
|
+
export interface FormFieldSlotProps {
|
|
43
|
+
/** Id wired to the rendered `<label for>`. Pass to the control's `id` prop. */
|
|
44
|
+
id: string;
|
|
45
|
+
/** ARIA-describedby string with helper/error ids. May be `undefined`. */
|
|
46
|
+
describedBy: string | undefined;
|
|
47
|
+
/** Mirrors `errorText`-driven invalid state. */
|
|
48
|
+
invalid: boolean;
|
|
49
|
+
/** Mirrors `disabled`. */
|
|
50
|
+
disabled: boolean;
|
|
51
|
+
/** Mirrors `required`. */
|
|
52
|
+
required: boolean;
|
|
53
|
+
/** Convenience: `'danger'` if invalid, `undefined` otherwise. Pass to a `color` prop. */
|
|
54
|
+
color: 'danger' | undefined;
|
|
55
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
export interface Input {
|
|
3
|
+
/** v-model */
|
|
4
|
+
modelValue?: string | number | null;
|
|
5
|
+
/** Etiqueta visible encima del input. */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Texto de placeholder. */
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
/** Texto de ayuda bajo el input (oculto si hay `errorText`). */
|
|
10
|
+
helperText?: string;
|
|
11
|
+
/** Mensaje de error bajo el input. Si se provee, el input se marca como inválido. */
|
|
12
|
+
errorText?: string;
|
|
13
|
+
/** Tipo HTML del input. */
|
|
14
|
+
type?: 'text' | 'email' | 'url' | 'tel' | 'search';
|
|
15
|
+
/** Estilo visual. */
|
|
16
|
+
variant?: 'outline' | 'filled' | 'ghost';
|
|
17
|
+
/** Familia semántica para el estado de foco/acento. */
|
|
18
|
+
color?: 'default' | 'primary' | 'danger' | 'success' | 'warning';
|
|
19
|
+
/** Tamaño. */
|
|
20
|
+
size?: 'small' | 'medium' | 'large';
|
|
21
|
+
/** Radio de esquinas. */
|
|
22
|
+
radius?: 'none' | 'small' | 'medium' | 'large' | 'full';
|
|
23
|
+
/**
|
|
24
|
+
* Estilo del halo persistente (ring). Si se omite, hereda del ModoProvider.
|
|
25
|
+
* - `'tinted'`: gris en idle, tintado al color en focus (default)
|
|
26
|
+
* - `'neutral'`: gris en idle y focus (más discreto)
|
|
27
|
+
* - `'off'`: sin halo persistente
|
|
28
|
+
*/
|
|
29
|
+
halo?: 'tinted' | 'neutral' | 'off';
|
|
30
|
+
/** Aplica w-full al root. */
|
|
31
|
+
fullWidth?: boolean;
|
|
32
|
+
/** Deshabilitado. */
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
/** Solo lectura (mantiene color normal, no se puede editar). */
|
|
35
|
+
readonly?: boolean;
|
|
36
|
+
/** Requerido (añade indicador visual y atributo). */
|
|
37
|
+
required?: boolean;
|
|
38
|
+
/** Estado cargando (muestra loader a la derecha, input deshabilitado). */
|
|
39
|
+
loading?: boolean;
|
|
40
|
+
/** Muestra botón "X" para limpiar el valor cuando hay contenido. */
|
|
41
|
+
clearable?: boolean;
|
|
42
|
+
/** Longitud máxima. Activa el contador si `showCounter`. */
|
|
43
|
+
maxLength?: number;
|
|
44
|
+
/** Muestra contador de caracteres (requiere `maxLength`). */
|
|
45
|
+
showCounter?: boolean;
|
|
46
|
+
/** Icono a la izquierda del input (componente Vue). */
|
|
47
|
+
iconLeft?: Component;
|
|
48
|
+
/** Icono a la derecha del input (componente Vue). */
|
|
49
|
+
iconRight?: Component;
|
|
50
|
+
/** Texto fijo a la izquierda del input (ej. "$", "https://"). */
|
|
51
|
+
prefix?: string;
|
|
52
|
+
/** Texto fijo a la derecha del input (ej. ".com", "kg"). */
|
|
53
|
+
suffix?: string;
|
|
54
|
+
/** id del input (autogenerado si se omite). */
|
|
55
|
+
id?: string;
|
|
56
|
+
/** name HTML. */
|
|
57
|
+
name?: string;
|
|
58
|
+
/** autocomplete HTML. */
|
|
59
|
+
autocomplete?: string;
|
|
60
|
+
/** autofocus HTML. */
|
|
61
|
+
autofocus?: boolean;
|
|
62
|
+
/** Accessible name cuando no hay `label` visible. */
|
|
63
|
+
ariaLabel?: string;
|
|
64
|
+
/** Fuerza el estado inválido sin renderizar `errorText`. Útil al envolver con `FormField`. */
|
|
65
|
+
invalid?: boolean;
|
|
66
|
+
/** IDs adicionales para concatenar en `aria-describedby` (ej. provistos por `FormField`). */
|
|
67
|
+
ariaDescribedBy?: string;
|
|
68
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
export interface NumberInput {
|
|
3
|
+
/** v-model (number o null cuando el input está vacío). */
|
|
4
|
+
modelValue?: number | null;
|
|
5
|
+
/** Etiqueta visible. */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Placeholder. */
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
/** Texto de ayuda (oculto si hay `errorText`). */
|
|
10
|
+
helperText?: string;
|
|
11
|
+
/** Mensaje de error. */
|
|
12
|
+
errorText?: string;
|
|
13
|
+
/** Estilo visual. */
|
|
14
|
+
variant?: 'outline' | 'filled' | 'ghost';
|
|
15
|
+
/** Familia semántica para foco/acento. */
|
|
16
|
+
color?: 'default' | 'primary' | 'danger' | 'success' | 'warning';
|
|
17
|
+
/** Tamaño. */
|
|
18
|
+
size?: 'small' | 'medium' | 'large';
|
|
19
|
+
/** Radio de esquinas. */
|
|
20
|
+
radius?: 'none' | 'small' | 'medium' | 'large' | 'full';
|
|
21
|
+
/** Estilo del halo persistente. Hereda del ModoProvider si se omite. */
|
|
22
|
+
halo?: 'tinted' | 'neutral' | 'off';
|
|
23
|
+
/** Aplica w-full al root. */
|
|
24
|
+
fullWidth?: boolean;
|
|
25
|
+
/** Deshabilitado. */
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/** Solo lectura (sin steppers ni edición). */
|
|
28
|
+
readonly?: boolean;
|
|
29
|
+
/** Requerido. */
|
|
30
|
+
required?: boolean;
|
|
31
|
+
/** Estado cargando. */
|
|
32
|
+
loading?: boolean;
|
|
33
|
+
/** Mínimo permitido. */
|
|
34
|
+
min?: number;
|
|
35
|
+
/** Máximo permitido. */
|
|
36
|
+
max?: number;
|
|
37
|
+
/** Incremento de los steppers y flechas de teclado. @default 1 */
|
|
38
|
+
step?: number;
|
|
39
|
+
/** Decimales forzados en el display al formatear (blur). */
|
|
40
|
+
precision?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Muestra botones +/- para incrementar/decrementar.
|
|
43
|
+
* @default true
|
|
44
|
+
*/
|
|
45
|
+
steppers?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Posición de los steppers:
|
|
48
|
+
* - `right`: ambos apilados a la derecha.
|
|
49
|
+
* - `split`: `−` a la izquierda y `+` a la derecha.
|
|
50
|
+
* @default 'right'
|
|
51
|
+
*/
|
|
52
|
+
stepperPosition?: 'right' | 'split';
|
|
53
|
+
/**
|
|
54
|
+
* Si `true`, permite valores fuera de min/max mientras se escribe
|
|
55
|
+
* (se clampean al blur). Si `false`, se clampea en tiempo real.
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
allowInvalid?: boolean;
|
|
59
|
+
/** Formatea con separador de miles al blur (solo display). */
|
|
60
|
+
thousandSeparator?: boolean;
|
|
61
|
+
/** Texto fijo a la izquierda (ej. `$`). */
|
|
62
|
+
prefix?: string;
|
|
63
|
+
/** Texto fijo a la derecha (ej. `%`, `kg`). */
|
|
64
|
+
suffix?: string;
|
|
65
|
+
/** Icono a la izquierda. */
|
|
66
|
+
iconLeft?: Component;
|
|
67
|
+
/** id (autogenerado si se omite). */
|
|
68
|
+
id?: string;
|
|
69
|
+
/** name HTML. */
|
|
70
|
+
name?: string;
|
|
71
|
+
/** autocomplete HTML. */
|
|
72
|
+
autocomplete?: string;
|
|
73
|
+
/** autofocus HTML. */
|
|
74
|
+
autofocus?: boolean;
|
|
75
|
+
/** Accessible name cuando no hay `label` visible. */
|
|
76
|
+
ariaLabel?: string;
|
|
77
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
/** Score heurístico expuesto por `PasswordInput` (0 = vacío · 4 = strong). */
|
|
3
|
+
export type PasswordStrengthScore = 0 | 1 | 2 | 3 | 4;
|
|
4
|
+
/**
|
|
5
|
+
* Labels para cada nivel del strength meter. Todos son opcionales —
|
|
6
|
+
* las claves que falten usan el fallback en inglés. El score `0` se
|
|
7
|
+
* reserva para estado vacío y normalmente se deja como string vacío.
|
|
8
|
+
*/
|
|
9
|
+
export type PasswordStrengthLabels = Partial<Record<PasswordStrengthScore, string>>;
|
|
10
|
+
export interface PasswordInput {
|
|
11
|
+
/** v-model */
|
|
12
|
+
modelValue?: string | null;
|
|
13
|
+
/** Etiqueta visible encima del input. */
|
|
14
|
+
label?: string;
|
|
15
|
+
/** Texto de placeholder. */
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
/** Texto de ayuda bajo el input (oculto si hay `errorText`). */
|
|
18
|
+
helperText?: string;
|
|
19
|
+
/** Mensaje de error bajo el input. */
|
|
20
|
+
errorText?: string;
|
|
21
|
+
/** Estilo visual. */
|
|
22
|
+
variant?: 'outline' | 'filled' | 'ghost';
|
|
23
|
+
/** Familia semántica para el estado de foco/acento. */
|
|
24
|
+
color?: 'default' | 'primary' | 'danger' | 'success' | 'warning';
|
|
25
|
+
/** Tamaño. */
|
|
26
|
+
size?: 'small' | 'medium' | 'large';
|
|
27
|
+
/** Radio de esquinas. */
|
|
28
|
+
radius?: 'none' | 'small' | 'medium' | 'large' | 'full';
|
|
29
|
+
/** Estilo del halo persistente. Hereda del ModoProvider si se omite. */
|
|
30
|
+
halo?: 'tinted' | 'neutral' | 'off';
|
|
31
|
+
/** Aplica w-full al root. */
|
|
32
|
+
fullWidth?: boolean;
|
|
33
|
+
/** Deshabilitado. */
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
/** Solo lectura. */
|
|
36
|
+
readonly?: boolean;
|
|
37
|
+
/** Requerido. */
|
|
38
|
+
required?: boolean;
|
|
39
|
+
/** Estado cargando. */
|
|
40
|
+
loading?: boolean;
|
|
41
|
+
/** Longitud máxima. */
|
|
42
|
+
maxLength?: number;
|
|
43
|
+
/** Muestra contador de caracteres (requiere `maxLength`). */
|
|
44
|
+
showCounter?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Muestra botón para alternar la visibilidad del password.
|
|
47
|
+
* @default true
|
|
48
|
+
*/
|
|
49
|
+
toggleVisibility?: boolean;
|
|
50
|
+
/** Si el contenido arranca visible. */
|
|
51
|
+
defaultVisible?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Muestra barra de fortaleza debajo del input.
|
|
54
|
+
* Calcula score heurístico (longitud + clases de caracteres).
|
|
55
|
+
*/
|
|
56
|
+
strengthMeter?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Labels custom para el strength meter (i18n). Si no se provee o alguna
|
|
59
|
+
* clave falta, se usa el fallback en inglés
|
|
60
|
+
* (`'' | 'Weak' | 'Fair' | 'Good' | 'Strong'`).
|
|
61
|
+
*
|
|
62
|
+
* El score numérico también se emite vía `@strength-change`, así que
|
|
63
|
+
* los consumidores con i18n externo pueden ignorar este prop y traducir
|
|
64
|
+
* ellos mismos basándose en el evento.
|
|
65
|
+
*/
|
|
66
|
+
strengthLabels?: PasswordStrengthLabels;
|
|
67
|
+
/** Icono a la izquierda del input (componente Vue). */
|
|
68
|
+
iconLeft?: Component;
|
|
69
|
+
/** Texto fijo a la izquierda del input. */
|
|
70
|
+
prefix?: string;
|
|
71
|
+
/** id (autogenerado si se omite). */
|
|
72
|
+
id?: string;
|
|
73
|
+
/** name HTML. */
|
|
74
|
+
name?: string;
|
|
75
|
+
/**
|
|
76
|
+
* autocomplete HTML.
|
|
77
|
+
* @default 'current-password'
|
|
78
|
+
*/
|
|
79
|
+
autocomplete?: string;
|
|
80
|
+
/** autofocus HTML. */
|
|
81
|
+
autofocus?: boolean;
|
|
82
|
+
/** Accessible name cuando no hay `label` visible. */
|
|
83
|
+
ariaLabel?: string;
|
|
84
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export interface RadioOption {
|
|
2
|
+
value: string | number;
|
|
3
|
+
label: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface Radio {
|
|
8
|
+
/** v-model — se compara contra `value` para determinar checked. */
|
|
9
|
+
modelValue?: string | number | null;
|
|
10
|
+
/** Valor que emite este radio al seleccionarse. */
|
|
11
|
+
value: string | number;
|
|
12
|
+
/** Etiqueta visible a la derecha del control. */
|
|
13
|
+
label?: string;
|
|
14
|
+
/** Texto descriptivo secundario bajo el label. */
|
|
15
|
+
description?: string;
|
|
16
|
+
/** Familia semántica para el estado checked. */
|
|
17
|
+
color?: 'default' | 'primary' | 'danger' | 'success' | 'warning';
|
|
18
|
+
/** Tamaño. */
|
|
19
|
+
size?: 'small' | 'medium' | 'large';
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
required?: boolean;
|
|
22
|
+
loading?: boolean;
|
|
23
|
+
/** id del input (autogenerado si se omite). */
|
|
24
|
+
id?: string;
|
|
25
|
+
/** name HTML. Si está dentro de un `RadioGroup`, se hereda. */
|
|
26
|
+
name?: string;
|
|
27
|
+
/** Accessible name cuando no hay `label` visible. */
|
|
28
|
+
ariaLabel?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface RadioGroup {
|
|
31
|
+
/** v-model — valor seleccionado. */
|
|
32
|
+
modelValue?: string | number | null;
|
|
33
|
+
/** name HTML compartido por los radios del grupo. */
|
|
34
|
+
name?: string;
|
|
35
|
+
/** Opciones declarativas (alternativa a slot). */
|
|
36
|
+
options?: RadioOption[];
|
|
37
|
+
/** Etiqueta del grupo (fieldset > legend). */
|
|
38
|
+
label?: string;
|
|
39
|
+
/** Texto de ayuda bajo el grupo (oculto si hay `errorText`). */
|
|
40
|
+
helperText?: string;
|
|
41
|
+
/** Mensaje de error bajo el grupo. */
|
|
42
|
+
errorText?: string;
|
|
43
|
+
/** Dirección del grupo. */
|
|
44
|
+
orientation?: 'vertical' | 'horizontal';
|
|
45
|
+
/** Familia semántica aplicada a todos los radios. */
|
|
46
|
+
color?: 'default' | 'primary' | 'danger' | 'success' | 'warning';
|
|
47
|
+
/** Tamaño aplicado a todos los radios. */
|
|
48
|
+
size?: 'small' | 'medium' | 'large';
|
|
49
|
+
disabled?: boolean;
|
|
50
|
+
required?: boolean;
|
|
51
|
+
loading?: boolean;
|
|
52
|
+
/** Accessible name cuando no hay `label` visible. */
|
|
53
|
+
ariaLabel?: string;
|
|
54
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { InjectionKey, Ref, ComputedRef } from 'vue';
|
|
2
|
+
export interface RadioGroupContext {
|
|
3
|
+
name: Ref<string>;
|
|
4
|
+
value: Ref<string | number | null>;
|
|
5
|
+
color: ComputedRef<'default' | 'primary' | 'danger' | 'success' | 'warning'>;
|
|
6
|
+
size: ComputedRef<'small' | 'medium' | 'large'>;
|
|
7
|
+
disabled: ComputedRef<boolean>;
|
|
8
|
+
required: ComputedRef<boolean>;
|
|
9
|
+
hasError: ComputedRef<boolean>;
|
|
10
|
+
describedBy: ComputedRef<string | undefined>;
|
|
11
|
+
select: (value: string | number) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const RADIO_GROUP_KEY: InjectionKey<RadioGroupContext>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface RangeSlider {
|
|
2
|
+
/** Valor [from, to]. v-model. */
|
|
3
|
+
modelValue?: [number, number];
|
|
4
|
+
min?: number;
|
|
5
|
+
max?: number;
|
|
6
|
+
step?: number;
|
|
7
|
+
/** Mínima distancia entre los dos thumbs. */
|
|
8
|
+
minDistance?: number;
|
|
9
|
+
showValue?: boolean;
|
|
10
|
+
formatValue?: (v: number) => string;
|
|
11
|
+
marks?: boolean | number[] | {
|
|
12
|
+
value: number;
|
|
13
|
+
label?: string;
|
|
14
|
+
}[];
|
|
15
|
+
orientation?: 'horizontal' | 'vertical';
|
|
16
|
+
label?: string;
|
|
17
|
+
helperText?: string;
|
|
18
|
+
errorText?: string;
|
|
19
|
+
color?: 'default' | 'primary' | 'danger' | 'success' | 'warning';
|
|
20
|
+
size?: 'small' | 'medium' | 'large';
|
|
21
|
+
/** Track radius. Cascades from `ModoProvider`. @default 'full' (pill) */
|
|
22
|
+
radius?: 'none' | 'small' | 'medium' | 'large' | 'full';
|
|
23
|
+
fullWidth?: boolean;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
readonly?: boolean;
|
|
26
|
+
required?: boolean;
|
|
27
|
+
id?: string;
|
|
28
|
+
name?: string;
|
|
29
|
+
ariaLabel?: string;
|
|
30
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export interface SearchInput {
|
|
2
|
+
/** v-model */
|
|
3
|
+
modelValue?: string | null;
|
|
4
|
+
/** Etiqueta visible. */
|
|
5
|
+
label?: string;
|
|
6
|
+
/** Placeholder. @default 'Search…' */
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
/** Texto de ayuda (oculto si hay `errorText`). */
|
|
9
|
+
helperText?: string;
|
|
10
|
+
/** Mensaje de error. */
|
|
11
|
+
errorText?: string;
|
|
12
|
+
/** Estilo visual. */
|
|
13
|
+
variant?: 'outline' | 'filled' | 'ghost';
|
|
14
|
+
/** Familia semántica para foco/acento. */
|
|
15
|
+
color?: 'default' | 'primary' | 'danger' | 'success' | 'warning';
|
|
16
|
+
/** Tamaño. */
|
|
17
|
+
size?: 'small' | 'medium' | 'large';
|
|
18
|
+
/** Radio de esquinas. */
|
|
19
|
+
radius?: 'none' | 'small' | 'medium' | 'large' | 'full';
|
|
20
|
+
/** Estilo del halo persistente. Hereda del ModoProvider si se omite. */
|
|
21
|
+
halo?: 'tinted' | 'neutral' | 'off';
|
|
22
|
+
/** Aplica w-full al root. */
|
|
23
|
+
fullWidth?: boolean;
|
|
24
|
+
/** Deshabilitado. */
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
/** Solo lectura. */
|
|
27
|
+
readonly?: boolean;
|
|
28
|
+
/** Requerido. */
|
|
29
|
+
required?: boolean;
|
|
30
|
+
/** Estado cargando (muestra spinner en lugar del clear). */
|
|
31
|
+
loading?: boolean;
|
|
32
|
+
/** Longitud máxima. */
|
|
33
|
+
maxLength?: number;
|
|
34
|
+
/** Muestra contador (requiere `maxLength`). */
|
|
35
|
+
showCounter?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Tiempo (ms) de debounce antes de emitir `search` mientras se escribe.
|
|
38
|
+
* - `0` o `undefined` = solo emite `search` al presionar Enter.
|
|
39
|
+
* @default 0
|
|
40
|
+
*/
|
|
41
|
+
debounce?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Atajo de teclado global que enfoca el input. Se muestra como hint `<kbd>`
|
|
44
|
+
* a la derecha cuando el input no tiene foco ni valor.
|
|
45
|
+
*
|
|
46
|
+
* Formatos aceptados:
|
|
47
|
+
* - Tecla única: `'/'`, `'k'`
|
|
48
|
+
* - Combinación: `'cmd+k'` (auto-traduce a Ctrl+K en Windows)
|
|
49
|
+
*/
|
|
50
|
+
shortcut?: string;
|
|
51
|
+
/** id (autogenerado si se omite). */
|
|
52
|
+
id?: string;
|
|
53
|
+
/** name HTML. */
|
|
54
|
+
name?: string;
|
|
55
|
+
/** autofocus HTML. */
|
|
56
|
+
autofocus?: boolean;
|
|
57
|
+
/** Accessible name cuando no hay `label` visible. */
|
|
58
|
+
ariaLabel?: string;
|
|
59
|
+
}
|