@devjuliovilla/jv-ui 1.13.0 → 1.15.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 CHANGED
@@ -1,994 +1,1035 @@
1
- # @devjuliovilla/jv-ui
2
-
3
- Accessibility-first Angular component library built with signals and standalone APIs. Includes components, forms, data grids, dialogs, layout primitives, services, and i18n infrastructure.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install @devjuliovilla/jv-ui
9
- ```
10
-
11
- Import the theme CSS in your `angular.json` or `styles` array:
12
- ```json
13
- "styles": ["@devjuliovilla/jv-ui/styles/jv-theme.css"]
14
- ```
15
-
16
- ## Quick start
17
-
18
- ```typescript
19
- import { ApplicationConfig } from '@angular/core';
20
- import { provideJvUi } from '@devjuliovilla/jv-ui';
21
-
22
- export const appConfig: ApplicationConfig = {
23
- providers: [provideJvUi({ messagesLocale: 'en', formatLocale: 'en-US' })],
24
- };
25
- ```
26
-
27
- ```typescript
28
- import { Component } from '@angular/core';
29
- import { JvButtonComponent } from '@devjuliovilla/jv-ui';
30
-
31
- @Component({
32
- selector: 'app-root',
33
- standalone: true,
34
- imports: [JvButtonComponent],
35
- template: '<jv-button variant="primary">Hello</jv-button>',
36
- })
37
- export class App {}
38
- ```
39
-
40
- ## Components
41
-
42
- | Category | Components |
43
- |---|---|
44
- | Buttons | `JvButton`, `JvButtonGroup`, `JvIconButton` |
45
- | Calendar | `JvMonthCalendar`, `JvDayPlanner` — reusable month view and agenda primitives, usable together or independently |
46
- | Forms | `JvInput`, `JvTextarea`, `JvCode`, `JvSelect`, `JvCheckbox`, `JvRadio`, `JvSwitch`, `JvDatePicker`, `JvModalSelector`, `JvFileInput`, `JvFormContainer` |
47
- | Data Grid | `JvGrid` — full-featured data table (see below) |
48
- | Containers | `JvCard`, `JvSection`, `JvDivider` |
49
- | List | `JvList`, `JvListItem` — list with title, description, icons, badges, and interactive items |
50
- | Tabs | `JvTabs`, `JvTabPanelDirective` — horizontal tabs with keyboard navigation and animated transitions |
51
- | Slider | `JvImageSlider` — responsive image slider with thumbnails and keyboard navigation |
52
- | Gallery | `JvImageGallery` — horizontal image gallery with wheel scrolling and full-screen viewer |
53
- | Feedback | `JvAlert`, `JvBadge`, `JvLoader`, `JvToast` |
54
- | Dialogs | `JvDialog`, `JvConfirmDialog`, `JvWindowModal` — compact dialogs plus a larger workflow overlay surface |
55
- | Layout | `JvDashboardShell`, `JvSidebar`, `JvTopbar`, `JvBreadcrumb`, `JvPage` |
56
- | Auth Pages | `JvLoginPage`, `JvForgotPasswordPage`, `JvChangePasswordPage` |
57
- | Icon | `JvIcon` — Lucide-based icon component with 1500+ auto-generated icons |
58
- | Pagination | `JvPagination` — standalone pagination with i18n |
59
-
60
- ## Calendar API
61
-
62
- The scheduling primitives are split into **two separate components**:
63
-
64
- - `JvMonthCalendar`: inline month grid with selection, navigation, and day markers
65
- - `JvDayPlanner`: agenda / list view for scheduled items with optional grouping and expandable details
66
-
67
- You can use either one on its own, or compose both together in a master-detail scheduling layout.
68
-
69
- ### JvMonthCalendar
70
-
71
- ```typescript
72
- import {
73
- JvMonthCalendarComponent,
74
- JvMonthCalendarDayDirective,
75
- JvMonthCalendarDayMeta,
76
- } from '@devjuliovilla/jv-ui';
77
- ```
78
-
79
- **Inputs:**
80
-
81
- | Input | Type | Default | Description |
82
- |---|---|---|---|
83
- | `value` | `Date \| string \| null` | `undefined` | Selected day |
84
- | `visibleMonth` | `Date \| string \| null` | `undefined` | Controlled visible month independent from the selected day |
85
- | `dayMeta` | `JvMonthCalendarDayMeta[]` | `[]` | Marker/counter metadata per day |
86
- | `ariaLabel` | `string` | localized default | Accessible label for the grid |
87
- | `monthLabel` | `string` | `Month` | Accessible label for the month selector |
88
- | `yearLabel` | `string` | `Year` | Accessible label for the year selector |
89
- | `minYear` | `number` | current year - 10 | Lower year bound for the year selector |
90
- | `maxYear` | `number` | current year + 10 | Upper year bound for the year selector |
91
- | `navigation` | `{ previousMonth?: boolean; nextMonth?: boolean; previousYear?: boolean; nextYear?: boolean }` | `{ previousMonth: true, nextMonth: true, previousYear: false, nextYear: false }` | Controls which month/year navigation buttons are rendered |
92
-
93
- **Outputs:**
94
-
95
- | Output | Type |
96
- |---|---|
97
- | `selectionChange` | `Date` |
98
- | `visibleMonthChange` | `Date` |
99
-
100
- **Day metadata:**
101
-
102
- | Property | Type | Description |
103
- |---|---|---|
104
- | `date` | `Date \| string` | Day associated with the marker |
105
- | `count` | `number` | Optional numeric badge rendered inside the cell |
106
- | `tone` | `'primary' \| 'secondary' \| 'success' \| 'warning' \| 'danger' \| 'info' \| 'neutral'` | Visual tone for the badge or dot |
107
- | `label` | `string` | Extra accessibility text appended to the day `aria-label` |
108
-
109
- **Template hook:**
110
-
111
- Use `ng-template[jvMonthCalendarDay]` to fully customize the day cell.
112
-
113
- **Standalone example:**
114
-
115
- ```typescript
116
- import { Component, signal } from '@angular/core';
117
- import { JvMonthCalendarComponent, JvMonthCalendarDayMeta } from '@devjuliovilla/jv-ui';
118
-
119
- @Component({
120
- selector: 'app-calendar-only',
121
- standalone: true,
122
- imports: [JvMonthCalendarComponent],
123
- template: `
124
- <jv-month-calendar
125
- [value]="selectedDate()"
126
- [dayMeta]="calendarMeta"
127
- (selectionChange)="selectedDate.set($event)"
128
- />
129
- `,
130
- })
131
- export class CalendarOnlyComponent {
132
- readonly selectedDate = signal(new Date(2026, 5, 15));
133
- readonly calendarMeta: JvMonthCalendarDayMeta[] = [
134
- { date: '2026-06-15', count: 2, tone: 'primary', label: '2 activities' },
135
- { date: '2026-06-16', count: 1, tone: 'secondary', label: '1 activity' },
136
- ];
137
- }
138
- ```
139
-
140
- ### JvDayPlanner
141
-
142
- ```typescript
143
- import {
144
- JvDayPlannerComponent,
145
- JvDayPlannerDetailDirective,
146
- JvDayPlannerItem,
147
- JvDayPlannerItemDirective,
148
- } from '@devjuliovilla/jv-ui';
149
- ```
150
-
151
- **Inputs:**
152
-
153
- | Input | Type | Default | Description |
154
- |---|---|---|---|
155
- | `items` | `JvDayPlannerItem[]` | `[]` | Agenda items |
156
- | `groupByDate` | `boolean` | `false` | Group items under a date heading |
157
- | `emptyMessage` | `string` | localized default | Empty state copy |
158
- | `ariaLabel` | `string` | localized default | Accessible label for the agenda |
159
- | `defaultExpandedItemIds` | `(string \| number)[]` | `[]` | Items whose detail should start expanded |
160
-
161
- **Outputs:**
162
-
163
- | Output | Type |
164
- |---|---|
165
- | `itemSelect` | `JvDayPlannerItem` |
166
-
167
- **Planner item shape:**
168
-
169
- | Property | Type | Description |
170
- |---|---|---|
171
- | `id` | `string \| number` | Stable identity |
172
- | `title` | `string` | Primary label |
173
- | `date` | `Date \| string \| null` | Logical day when start time is not enough |
174
- | `start` | `Date \| string \| null` | Optional start datetime |
175
- | `end` | `Date \| string \| null` | Optional end datetime |
176
- | `status` | `string` | Status badge label |
177
- | `statusTone` | `JvTone` | Visual tone for status badge |
178
- | `type` | `string` | Type/category badge label |
179
- | `typeTone` | `JvTone` | Visual tone for type badge |
180
- | `responsible` | `string` | Responsible person |
181
- | `location` | `string` | Location metadata |
182
- | `details` | `string` | Expandable detail text |
183
- | `completed` | `boolean` | Reduced emphasis for completed items |
184
-
185
- **Template hooks:**
186
-
187
- - `ng-template[jvDayPlannerItem]` customizes the visible item row
188
- - `ng-template[jvDayPlannerDetail]` customizes the expanded detail panel
189
-
190
- **Standalone example:**
191
-
192
- ```typescript
193
- import { Component } from '@angular/core';
194
- import { JvDayPlannerComponent, JvDayPlannerItem } from '@devjuliovilla/jv-ui';
195
-
196
- @Component({
197
- selector: 'app-planner-only',
198
- standalone: true,
199
- imports: [JvDayPlannerComponent],
200
- template: `
201
- <jv-day-planner
202
- [items]="items"
203
- [groupByDate]="true"
204
- (itemSelect)="handleSelect($event)"
205
- />
206
- `,
207
- })
208
- export class PlannerOnlyComponent {
209
- readonly items: JvDayPlannerItem[] = [
210
- {
211
- id: 1,
212
- title: 'Venue setup',
213
- start: '2026-06-15T08:30:00',
214
- end: '2026-06-15T10:00:00',
215
- status: 'Scheduled',
216
- statusTone: 'primary',
217
- type: 'Logistics',
218
- responsible: 'Ana Lopez',
219
- location: 'Main hall',
220
- details: 'Prepare seating and signage.',
221
- },
222
- ];
223
-
224
- handleSelect(item: JvDayPlannerItem) {
225
- console.log(item);
226
- }
227
- }
228
- ```
229
-
230
- ### Combined example
231
-
232
- Use both components together when you need a left-side month selector and a right-side agenda:
233
-
234
- ```html
235
- <jv-month-calendar
236
- [value]="selectedDate()"
237
- [dayMeta]="calendarMeta()"
238
- (selectionChange)="selectedDate.set($event)"
239
- />
240
-
241
- <jv-day-planner
242
- [items]="filteredItems()"
243
- [groupByDate]="showAll()"
244
- (itemSelect)="selectedItem.set($event)"
245
- />
246
- ```
247
-
248
- ## Grid Features
249
-
250
- | Feature | Description |
251
- |---|---|
252
- | Sorting | Client-side multi-column sorting with sort icons and `aria-sort` |
253
- | Search | Global text search across visible columns |
254
- | Pagination | Configurable page size, page range buttons, first/last/prev/next |
255
- | Selection | Checkbox row selection with `selectedIds` / `selectionChange` |
256
- | Row actions | Custom action buttons per row |
257
- | Density modes | Compact, normal, comfortable |
258
- | Sticky columns | Pin columns to left or right |
259
- | Column resizing | Drag column header borders to resize |
260
- | Column reordering | Drag & drop column headers |
261
- | Grouped headers | Multi-row header with `colspan` via `children` |
262
- | Per-column filters | Filter input row with operators |
263
- | Inline editing | Double-click or Enter to edit: text, number, select, boolean |
264
- | Virtual scrolling | Render only visible rows for large datasets |
265
- | CSV/Excel export | Built-in toolbar buttons, no external deps |
266
- | Server-side mode | Delegate sort/filter/page to parent component |
267
- | TrackBy | Custom trackBy key or function |
268
- | i18n | All labels configurable via translation dictionary |
269
-
270
- ### Grid API
271
-
272
- ```typescript
273
- import { JvGridComponent } from '@devjuliovilla/jv-ui';
274
- ```
275
-
276
- **Inputs:**
277
-
278
- | Input | Type | Default | Description |
279
- |---|---|---|---|
280
- | `data` | `T[]` | `[]` | Row data array |
281
- | `columns` | `JvGridColumn<T>[]` | `[]` | Column definitions |
282
- | `actions` | `JvGridAction<T>[]` | `[]` | Row action button configs |
283
- | `options` | `Partial<JvGridOptions>` | `{}` | Feature toggles and config |
284
- | `trackBy` | `keyof T \| Function \| null` | `null` | Row identity |
285
- | `selectedIds` | `(string \| number)[]` | `[]` | Controlled selection IDs |
286
-
287
- **Outputs:**
288
-
289
- | Output | Type |
290
- |---|---|
291
- | `rowClick` | `T` |
292
- | `rowDoubleClick` | `T` |
293
- | `actionClick` | `{ actionId: string; row: T }` |
294
- | `selectionChange` | `(string \| number)[]` |
295
- | `pageChange` | `{ pageIndex: number; pageSize: number }` |
296
- | `searchChange` | `string` |
297
- | `sortChange` | `{ columnKey: string; direction: 'asc' \| 'desc' \| null }` |
298
- | `columnFilter` | `{ columnKey: string; value: string }` |
299
- | `columnResize` | `{ columnKey: string; width: string }` |
300
- | `columnReorder` | `{ columnKey: string; newIndex: number }` |
301
- | `rowEdit` | `{ row: T; column: JvGridColumn<T>; value: unknown }` |
302
-
303
- **JvGridColumn options:**
304
-
305
- | Property | Type | Description |
306
- |---|---|---|
307
- | `key` | `keyof T \| string` | Data field key |
308
- | `header` | `string` | Column display header |
309
- | `sortable` | `boolean` | Enable column sorting |
310
- | `searchable` | `boolean` | Include in global search |
311
- | `filterable` | `boolean` | Show per-column filter input |
312
- | `hidden` | `boolean` | Hide column from display |
313
- | `sticky` | `'left' \| 'right'` | Pin column position |
314
- | `editable` | `boolean` | Allow inline cell editing |
315
- | `editType` | `'text' \| 'number' \| 'select' \| 'boolean'` | Editor type |
316
- | `editOptions` | `{ label: string; value: unknown }[]` | Options for select editor |
317
- | `width` | `string` | Column width (e.g. '8rem') |
318
- | `align` | `'start' \| 'center' \| 'end'` | Text alignment |
319
- | `type` | `'text' \| 'integer' \| 'number' \| 'currency' \| 'percent' \| 'date' \| 'time' \| 'datetime' \| 'boolean'` | Data type for formatting |
320
- | `formatOptions` | `Intl.NumberFormatOptions & Intl.DateTimeFormatOptions` | Per-column formatting overrides |
321
- | `format` | `(value, row) => string` | Custom display formatter |
322
- | `children` | `JvGridColumn<T>[]` | Child columns for grouped headers |
323
- | `resizable` | `boolean` | Allow column resize |
324
- | `cellClass` | `string` | CSS class for cells |
325
- | `headerClass` | `string` | CSS class for header |
326
-
327
- **JvGridOptions:**
328
-
329
- | Option | Type | Default | Description |
330
- |---|---|---|---|
331
- | `searchable` | `boolean` | `true` | Show search bar |
332
- | `sortable` | `boolean` | `true` | Enable column sorting |
333
- | `pageable` | `boolean` | `true` | Enable pagination |
334
- | `selectable` | `boolean` | `false` | Show selection checkboxes |
335
- | `pageSize` | `number` | `20` | Default page size |
336
- | `pageSizeOptions` | `number[]` | `[10, 20, 50, 100]` | Page size selector options |
337
- | `density` | `'compact' \| 'normal' \| 'comfortable'` | `'normal'` | Row density |
338
- | `loading` | `boolean` | `false` | Show loading spinner |
339
- | `emptyMessage` | `string` | — | Empty state message |
340
- | `exportable` | `boolean` | `false` | Show CSV/Excel export buttons |
341
- | `exportFileName` | `string` | `''` | Base filename used for CSV/Excel exports; the component applies the correct extension |
342
- | `serverSide` | `boolean` | `false` | Disable client-side processing |
343
- | `totalItems` | `number` | `0` | Total items for server-side mode |
344
- | `stickyColumns` | `boolean` | `false` | Enable sticky column support |
345
- | `resizableColumns` | `boolean` | `false` | Enable column resizing |
346
- | `reorderableColumns` | `boolean` | `false` | Enable column reordering |
347
- | `editable` | `boolean` | `false` | Enable inline editing |
348
- | `virtualScroll` | `boolean` | `false` | Enable virtual scrolling |
349
- | `virtualScrollRowHeight` | `number` | `48` | Row height for virtual scroll |
350
- | `columnFilters` | `boolean` | `false` | Show filter row below headers |
351
- | `rowDoubleClick` | `boolean` | `false` | Enable row double-click event |
352
- | `ariaLabel` | `string` | — | Accessible label for the grid |
353
-
354
- ### Grid example
355
-
356
- ```typescript
357
- import { Component } from '@angular/core';
358
- import { JvGridComponent, JvGridColumn, JvGridOptions } from '@devjuliovilla/jv-ui';
359
-
360
- interface Product {
361
- id: number;
362
- name: string;
363
- price: number;
364
- status: string;
365
- }
366
-
367
- @Component({
368
- selector: 'app-products',
369
- standalone: true,
370
- imports: [JvGridComponent],
371
- template: `
372
- <jv-grid
373
- [data]="products"
374
- [columns]="columns"
375
- [options]="{ selectable: true, exportable: true, exportFileName: 'products', pageSize: 10 }"
376
- [trackBy]="'id'"
377
- [selectedIds]="selectedIds"
378
- (selectionChange)="selectedIds = $event"
379
- />
380
- `,
381
- })
382
- export class ProductsComponent {
383
- products: Product[] = [ /* ... */ ];
384
- selectedIds: (string | number)[] = [];
385
- columns: JvGridColumn<Product>[] = [
386
- { key: 'id', header: 'ID', width: '4rem' },
387
- { key: 'name', header: 'Product', sortable: true, filterable: true },
388
- { key: 'price', header: 'Price', type: 'number', align: 'end', format: (v) => '$' + v },
389
- { key: 'status', header: 'Status', sortable: true },
390
- ];
391
- }
392
- ```
393
-
394
- ## List API
395
-
396
- ```typescript
397
- import { JvListComponent, JvListItemComponent } from '@devjuliovilla/jv-ui';
398
- ```
399
-
400
- **JvList inputs:**
401
-
402
- | Input | Type | Default | Description |
403
- |---|---|---|---|
404
- | `role` | `'list' \| 'navigation'` | `'list'` | ARIA role for the list |
405
- | `variant` | `'bordered' \| null` | `null` | Outer border + border-radius around the list (items always have bottom border) |
406
- | `ariaLabel` | `string` | `''` | Accessible label |
407
-
408
- **JvListItem inputs:**
409
-
410
- | Input | Type | Default | Description |
411
- |---|---|---|---|
412
- | `title` | `string` (required) | — | Primary text |
413
- | `description` | `string` | `''` | Secondary text below title |
414
- | `leadingIcon` | `string \| null` | `null` | Lucide icon name on the left |
415
- | `disabled` | `boolean` | `false` | Gray out and block interaction |
416
- | `active` | `boolean` | `false` | Highlight with primary color and left border |
417
-
418
- **JvListItem outputs:**
419
-
420
- | Output | Type |
421
- |---|---|
422
- | `activated` | `void` |
423
-
424
- **Content projection:** use the `meta` attribute selector for badges, icons, or any content on the right side:
425
-
426
- ```html
427
- <jv-list-item title="Inbox" description="New messages">
428
- <jv-badge tone="primary" meta>3</jv-badge>
429
- <jv-icon name="chevron-right" meta />
430
- </jv-list-item>
431
- ```
432
-
433
- ### Example
434
-
435
- ```typescript
436
- import { Component } from '@angular/core';
437
- import { JvListComponent, JvListItemComponent, JvBadgeComponent } from '@devjuliovilla/jv-ui';
438
-
439
- @Component({
440
- selector: 'app-nav-list',
441
- standalone: true,
442
- imports: [JvListComponent, JvListItemComponent, JvBadgeComponent],
443
- template: `
444
- <jv-list variant="bordered">
445
- <jv-list-item
446
- title="Dashboard"
447
- description="Main overview"
448
- leadingIcon="layout-dashboard"
449
- [active]="true"
450
- />
451
- <jv-list-item
452
- title="Notifications"
453
- description="3 pending"
454
- (activated)="onOpen()"
455
- >
456
- <jv-badge tone="primary" meta>3</jv-badge>
457
- </jv-list-item>
458
- <jv-list-item
459
- title="Reports"
460
- description="Coming soon"
461
- [disabled]="true"
462
- />
463
- </jv-list>
464
- `,
465
- })
466
- export class NavListComponent {
467
- onOpen() { /* handle activation */ }
468
- }
469
- ```
470
-
471
- ## Pagination API
472
-
473
- ```typescript
474
- import { JvPaginationComponent } from '@devjuliovilla/jv-ui';
475
- ```
476
-
477
- | Input | Type | Default | Description |
478
- |---|---|---|---|
479
- | `totalItems` | `number` | `0` | Total items |
480
- | `pageSize` | `number` | `20` | Items per page |
481
- | `pageSizeOptions` | `number[]` | `[10, 20, 50, 100]` | Page size options |
482
- | `pageIndex` | `number` | `0` | Current page (0-based) |
483
- | `maxVisiblePages` | `number` | `5` | Max page buttons to show |
484
-
485
- | Output | Type |
486
- |---|---|
487
- | `pageChange` | `{ pageIndex: number; pageSize: number }` |
488
-
489
- ## Tabs API
490
-
491
- ```typescript
492
- import { JvTabsComponent, JvTabPanelDirective, JvTabItem } from '@devjuliovilla/jv-ui';
493
- ```
494
-
495
- **Inputs:**
496
-
497
- | Input | Type | Default | Description |
498
- |---|---|---|---|
499
- | `tabs` | `JvTabItem[]` | `[]` | Tab definitions (`{ id, label, icon?, disabled? }`) |
500
- | `activeTabId` | `string \| null` | `null` | Controlled active tab ID |
501
- | `keepMounted` | `boolean` | `true` | Keep all panels in DOM; `false` renders only active panel |
502
- | `transition` | `'none' \| 'fade' \| 'slide' \| null` | `null` | Panel transition animation (falls back to global config) |
503
-
504
- **Outputs:**
505
-
506
- | Output | Type |
507
- |---|---|
508
- | `activeTabChange` | `string` |
509
-
510
- **Content projection:** use `jvTabPanel` directive on `ng-template` to define panel content:
511
-
512
- ```html
513
- <jv-tabs [tabs]="tabs" [activeTabId]="activeTabId()" (activeTabChange)="activeTabId.set($event)">
514
- <ng-template jvTabPanel="overview">
515
- <p>Overview content</p>
516
- </ng-template>
517
- <ng-template jvTabPanel="analytics">
518
- <p>Analytics content</p>
519
- </ng-template>
520
- </jv-tabs>
521
- ```
522
-
523
- ### Tab Transitions
524
-
525
- Tabs support animated transitions between panels. Configure globally via `provideJvUi()` or per-instance via the `transition` input:
526
-
527
- ```typescript
528
- // Global default
529
- provideJvUi({ tabsTransition: 'fade' })
530
- ```
531
-
532
- ```typescript
533
- // Per-instance override
534
- <jv-tabs transition="slide" [keepMounted]="false">...</jv-tabs>
535
- ```
536
-
537
- | Transition | `keepMounted=true` | `keepMounted=false` | Description |
538
- |---|---|---|---|
539
- | `'none'` | Instant switch | Instant switch | No animation |
540
- | `'fade'` | Opacity cross-fade | Opacity cross-fade | Smooth fade between panels |
541
- | `'slide'` | Falls back to `'fade'` | Directional slide | Slides left/right based on tab index |
542
-
543
- **Note:** `slide` requires `keepMounted=false` because it needs to animate both entering and exiting panels simultaneously. When used with `keepMounted=true`, it automatically falls back to `fade`.
544
-
545
- ### Tabs Example
546
-
547
- ```typescript
548
- import { Component, signal } from '@angular/core';
549
- import { JvTabItem, JvTabPanelDirective, JvTabsComponent } from '@devjuliovilla/jv-ui';
550
-
551
- @Component({
552
- standalone: true,
553
- imports: [JvTabsComponent, JvTabPanelDirective],
554
- template: `
555
- <jv-tabs
556
- [tabs]="tabs"
557
- [activeTabId]="activeTabId()"
558
- transition="fade"
559
- (activeTabChange)="activeTabId.set($event)"
560
- >
561
- <ng-template jvTabPanel="overview">
562
- <p>Overview content</p>
563
- </ng-template>
564
- <ng-template jvTabPanel="analytics">
565
- <p>Analytics content</p>
566
- </ng-template>
567
- </jv-tabs>
568
- `,
569
- })
570
- export class TabsExampleComponent {
571
- readonly activeTabId = signal('overview');
572
- readonly tabs: JvTabItem[] = [
573
- { id: 'overview', label: 'Overview' },
574
- { id: 'analytics', label: 'Analytics', icon: 'chart-column' },
575
- ];
576
- }
577
- ```
578
-
579
- ## Image Slider API
580
-
581
- ```typescript
582
- import { JvImageSliderComponent, JvSliderImage } from '@devjuliovilla/jv-ui';
583
- ```
584
-
585
- **JvSliderImage:**
586
-
587
- | Property | Type | Required | Description |
588
- |---|---|---|---|
589
- | `src` | `string` | Yes | Image URL |
590
- | `alt` | `string` | Yes | Alternative text for accessibility |
591
- | `description` | `string` | No | Caption displayed below the image |
592
- | `thumbnail` | `string` | No | Custom thumbnail URL (defaults to `src`) |
593
-
594
- **Inputs:**
595
-
596
- | Input | Type | Default | Description |
597
- |---|---|---|---|
598
- | `images` | `JvSliderImage[]` | `[]` | Array of images to display |
599
- | `showThumbnails` | `boolean` | `true` | Show thumbnail strip below slider |
600
- | `showDescription` | `boolean` | `true` | Show image description |
601
-
602
- **Outputs:**
603
-
604
- | Output | Type | Description |
605
- |---|---|---|
606
- | `imageChange` | `number` | Emits index when active image changes |
607
-
608
- **i18n support:**
609
-
610
- The component automatically translates aria labels using `JvTranslationService`:
611
-
612
- | Key | English | Spanish |
613
- |---|---|---|
614
- | `slider.prevImage` | Previous image | Imagen anterior |
615
- | `slider.nextImage` | Next image | Imagen siguiente |
616
- | `slider.thumbnailList` | Image thumbnails | Miniaturas de imagenes |
617
-
618
- ### Features
619
-
620
- - **Keyboard navigation:** ArrowLeft/ArrowRight to navigate, Home/End for first/last image
621
- - **Responsive:** Images scale to fit container with `object-fit: contain`
622
- - **Thumbnails:** Scrollable thumbnail strip with active state indicator
623
- - **Single image mode:** Navigation controls hidden when only one image is provided
624
- - **Lazy loading:** Images use native `loading="lazy"` attribute
625
- - **i18n:** Aria labels automatically translated based on configured locale
626
-
627
- ### Example
628
-
629
- ```typescript
630
- import { Component } from '@angular/core';
631
- import { JvImageSliderComponent, JvSliderImage } from '@devjuliovilla/jv-ui';
632
-
633
- @Component({
634
- standalone: true,
635
- imports: [JvImageSliderComponent],
636
- template: `
637
- <jv-image-slider
638
- [images]="images"
639
- [showThumbnails]="true"
640
- [showDescription]="true"
641
- (imageChange)="onImageChange($event)"
642
- />
643
- `,
644
- })
645
- export class SliderComponent {
646
- readonly images: JvSliderImage[] = [
647
- { src: 'photo1.jpg', alt: 'Sunset', description: 'Beautiful sunset over the ocean' },
648
- { src: 'photo2.jpg', alt: 'Mountain', description: 'Snow-capped mountain peak' },
649
- { src: 'photo3.jpg', alt: 'Forest', description: 'Dense forest trail' },
650
- ];
651
-
652
- onImageChange(index: number) {
653
- console.log('Viewing image:', index);
654
- }
655
- }
656
- ```
657
-
658
- ## Image Gallery API
659
-
660
- ```typescript
661
- import { JvImageGalleryComponent, JvGalleryImage, JvGalleryAction } from '@devjuliovilla/jv-ui';
662
- ```
663
-
664
- **JvGalleryImage:**
665
-
666
- | Property | Type | Required | Description |
667
- |---|---|---|---|
668
- | `src` | `string` | Yes | Image URL |
669
- | `alt` | `string` | Yes | Alternative text for accessibility |
670
- | `thumbnail` | `string` | No | Custom thumbnail URL (defaults to `src`) |
671
-
672
- **JvGalleryAction:**
673
-
674
- | Property | Type | Required | Description |
675
- |---|---|---|---|
676
- | `id` | `string` | Yes | Unique action identifier |
677
- | `label` | `string` | Yes | Button label text |
678
- | `icon` | `string` | No | Lucide icon name |
679
- | `tone` | `JvIntent` | No | Button variant |
680
-
681
- **Inputs:**
682
-
683
- | Input | Type | Default | Description |
684
- |---|---|---|---|
685
- | `images` | `JvGalleryImage[]` | `[]` | Array of images to display |
686
- | `stripHeightVh` | `number` | `25` | Height of the thumbnail strip in viewport-height units, clamped between `0` and `100` |
687
- | `actions` | `JvGalleryAction[]` | `[]` | Action buttons shown in dialog footer |
688
-
689
- **Outputs:**
690
-
691
- | Output | Type | Description |
692
- |---|---|---|
693
- | `imageClick` | `JvGalleryImage` | Emits when an image is clicked |
694
- | `actionClick` | `{ actionId: string; image: JvGalleryImage }` | Emits when an action button is clicked |
695
-
696
- ### Features
697
-
698
- - **Horizontal strip:** Scrollable thumbnail strip with configurable height in `vh`
699
- - **Full-screen viewer:** Click any image to open in a dialog with dark background
700
- - **Navigation:** Prev/next buttons and keyboard arrows (← →) in the viewer
701
- - **Configurable actions:** Action buttons in dialog footer (favorite, edit, delete, etc.)
702
- - **Responsive:** Shows multiple columns on desktop, single column with scroll on mobile
703
- - **Lazy loading:** All images use native `loading="lazy"` attribute
704
- - **i18n:** Close and navigation labels automatically translated
705
-
706
- ### Example
707
-
708
- ```typescript
709
- import { Component } from '@angular/core';
710
- import { JvImageGalleryComponent, JvGalleryImage, JvGalleryAction } from '@devjuliovilla/jv-ui';
711
-
712
- @Component({
713
- standalone: true,
714
- imports: [JvImageGalleryComponent],
715
- template: `
716
- <jv-image-gallery
717
- [images]="images"
718
- [stripHeightVh]="30"
719
- [actions]="actions"
720
- (imageClick)="onImageClick($event)"
721
- (actionClick)="onActionClick($event)"
722
- />
723
- `,
724
- })
725
- export class GalleryComponent {
726
- readonly images: JvGalleryImage[] = [
727
- { src: 'photo1.jpg', alt: 'Sunset' },
728
- { src: 'photo2.jpg', alt: 'Mountain' },
729
- { src: 'photo3.jpg', alt: 'Forest' },
730
- ];
731
-
732
- readonly actions: JvGalleryAction[] = [
733
- { id: 'favorite', label: 'Favorite', icon: 'heart', tone: 'danger' },
734
- { id: 'edit', label: 'Edit', icon: 'pencil' },
735
- { id: 'delete', label: 'Delete', icon: 'trash-2', tone: 'danger' },
736
- ];
737
-
738
- onImageClick(image: JvGalleryImage) {
739
- console.log('Viewing:', image.alt);
740
- }
741
-
742
- onActionClick(event: { actionId: string; image: JvGalleryImage }) {
743
- console.log(event.actionId, 'on', event.image.alt);
744
- }
745
- }
746
- ```
747
-
748
- ## Textarea API
749
-
750
- ```typescript
751
- import { JvTextareaComponent } from '@devjuliovilla/jv-ui';
752
- ```
753
-
754
- | Input | Type | Default | Description |
755
- |---|---|---|---|
756
- | `placeholder` | `string` | `''` | Placeholder text |
757
- | `required` | `boolean` | `false` | Mark field as required |
758
- | `invalid` | `boolean` | `false` | Show invalid state |
759
- | `readonly` | `boolean` | `false` | Make textarea read-only |
760
- | `rows` | `number` | `3` | Visible number of rows |
761
- | `cols` | `number` | — | Visible width in columns |
762
- | `maxlength` | `number` | — | Maximum character length |
763
- | `describedBy` | `string` | `''` | ID of description/error element for aria-describedby |
764
- | `inputId` | `string` | `jv-textarea-{n}` | Auto-generated unique ID |
765
-
766
- Implements `ControlValueAccessor` — compatible with `[(ngModel)]` and reactive forms via `formControlName`.
767
-
768
- ### Example
769
-
770
- ```typescript
771
- import { Component } from '@angular/core';
772
- import { JvTextareaComponent } from '@devjuliovilla/jv-ui';
773
- import { ReactiveFormsModule, FormBuilder } from '@angular/forms';
774
-
775
- @Component({
776
- selector: 'app-profile',
777
- standalone: true,
778
- imports: [ReactiveFormsModule, JvTextareaComponent],
779
- template: `
780
- <jv-textarea
781
- formControlName="bio"
782
- placeholder="Tell us about yourself..."
783
- [rows]="4"
784
- [maxlength]="500"
785
- />
786
- `,
787
- })
788
- export class ProfileComponent {
789
- form = inject(FormBuilder).group({ bio: [''] });
790
- }
791
- ```
792
-
793
- ## Code API
794
-
795
- ```typescript
796
- import { JvCodeComponent } from '@devjuliovilla/jv-ui';
797
- ```
798
-
799
- | Input | Type | Default | Description |
800
- |---|---|---|---|
801
- | `code` | `string` | — | Code or text content to render |
802
- | `language` | `string` | `''` | Optional language badge |
803
- | `title` | `string` | `''` | Optional header title |
804
- | `font` | `'jetbrains-mono' \| 'fira-code' \| 'cascadia' \| 'consolas' \| 'system'` | `'jetbrains-mono'` | Mono font preset for the rendered block |
805
- | `editable` | `boolean` | `false` | Renders a textarea-style editing surface instead of read-only preview |
806
- | `width` | `string` | `'100%'` | CSS width applied to the component |
807
- | `height` | `string` | `'auto'` | CSS height for the editable surface or minimum preview height |
808
-
809
- Use `JvCode` for read-only payloads or long single-line content where horizontal scrolling should be preserved instead of wrapping.
810
- The library does not bundle font files. `JvCode` references common mono families and will use any web font you load at the application level.
811
-
812
- When `editable` is enabled, `JvCode` emits `codeChange` on every edit so the parent can keep the source text in sync.
813
-
814
- ### Example
815
-
816
- ```typescript
817
- import { Component } from '@angular/core';
818
- import { JvCodeComponent } from '@devjuliovilla/jv-ui';
819
-
820
- @Component({
821
- selector: 'app-payload-preview',
822
- standalone: true,
823
- imports: [JvCodeComponent],
824
- template: `
825
- <jv-code
826
- [code]="payload"
827
- language="json"
828
- title="HTTP payload preview"
829
- font="fira-code"
830
- [editable]="true"
831
- width="100%"
832
- height="18rem"
833
- (codeChange)="payload = $event"
834
- />
835
- `,
836
- })
837
- export class PayloadPreviewComponent {
838
- payload = '{"status":"ok"}';
839
- }
840
- ```
841
-
842
- If you want hosted fonts without shipping them in your package, load them at the app level, for example:
843
-
844
- ```css
845
- @import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');
846
- ```
847
-
848
- ## Confirm Dialog Labels
849
-
850
- `JvDialogService.confirm()` already supports `confirmLabel` and `cancelLabel` overrides per dialog. If you omit them, the defaults come from the active translation dictionary using `dialog.confirm` and `dialog.cancel`.
851
-
852
- This lets you either:
853
-
854
- - override labels directly for a specific action like `Guardar evento` / `Descartar cambios`
855
- - or register translated defaults in your i18n dictionary for each supported language
856
-
857
- Example with business copy:
858
-
859
- ```typescript
860
- const confirmed = await dialogService.confirm({
861
- title: 'Guardar evento',
862
- message: 'Se aplicaran cambios a la agenda del equipo.',
863
- confirmLabel: 'Guardar evento',
864
- cancelLabel: 'Descartar cambios',
865
- tone: 'primary',
866
- });
867
-
868
- if (confirmed) {
869
- saveEvent();
870
- }
871
- ```
872
-
873
- Example using translated defaults from your dictionary:
874
-
875
- ```typescript
876
- await dialogService.confirm({
877
- message: 'This action will publish the current draft.',
878
- tone: 'primary',
879
- });
880
- ```
881
-
882
- ## Icon System
883
-
884
- ```typescript
885
- import { JvIconComponent, JV_LUCIDE_ICON_REGISTRY } from '@devjuliovilla/jv-ui';
886
- ```
887
-
888
- | Input | Type | Default | Description |
889
- |---|---|---|---|
890
- | `name` | `string` | — | Icon name (from auto-generated Lucide registry) |
891
- | `size` | `number` | `24` | Width and height in pixels |
892
- | `strokeWidth` | `number` | `2` | SVG stroke width |
893
- | `decorative` | `boolean` | `true` | `aria-hidden="true"` when decorative |
894
- | `ariaLabel` | `string` | — | Accessible label when not decorative |
895
-
896
- Icons are auto-generated from [lucide-static](https://www.npmjs.com/package/lucide-static) via:
897
-
898
- ```bash
899
- node tools/generate-icons.mjs
900
- ```
901
-
902
- This reads all SVG files from `lucide-static/icons` and produces `jv-icon-registry.ts` with the complete set (~1500 icons). Run it after updating `lucide-static` to keep icons in sync.
903
-
904
- ## Layout API
905
-
906
- ### JvDashboardShell
907
-
908
- ```typescript
909
- import { JvDashboardShellComponent } from '@devjuliovilla/jv-ui';
910
- ```
911
-
912
- | Input | Type | Default | Description |
913
- |---|---|---|---|
914
- | `title` | `string` | — | App / brand title |
915
- | `sidebarSubtitle` | `string` | `''` | Subtitle below brand |
916
- | `brandIcon` | `string` | `'monitor'` | Brand Lucide icon |
917
- | `navItems` | `JvNavItem[]` | `[]` | Navigation items (supports nested children) |
918
- | `sidebarCollapsed` | `boolean` | `false` | Desktop sidebar collapsed state |
919
- | `mobileSidebarOpen` | `boolean` | `false` | Mobile sidebar open/closed |
920
- | `topbarTitle` | `string` | `''` | Topbar page title |
921
- | `topbarSubtitle` | `string` | `''` | Topbar subtitle |
922
- | `currentTheme` | `JvTheme` | `'light'` | Active theme value |
923
- | `themeOptions` | `JvThemeOption[]` | `[]` | Theme selector options |
924
- | `topbarActions` | `JvTopbarAction[]` | `[]` | Icon buttons in topbar |
925
- | `showThemeSelector` | `boolean` | `true` | Show theme pills |
926
-
927
- | Output | Description |
928
- |---|---|
929
- | `menuClick` | Hamburger button clicked — toggle mobile sidebar |
930
- | `mobileClose` | Backdrop clicked or navigation selected — close mobile sidebar |
931
- | `sidebarCollapseToggle` | Collapse toggle clicked — collapse/expand sidebar |
932
- | `themeChange` | Theme pill clicked |
933
- | `topbarActionClick` | Topbar action button clicked |
934
-
935
- **Mobile behavior:** at viewports ≤ 900px the sidebar becomes a fixed overlay with slide-in animation (`transform: translateX`) and a semi-transparent backdrop. The sidebar emits `mobileClose` when the backdrop is clicked or a nav link is followed.
936
-
937
- ### JvSidebar
938
-
939
- | Input | Type | Default | Description |
940
- |---|---|---|---|
941
- | `title` | `string` | — | Brand title |
942
- | `subtitle` | `string` | `''` | Brand subtitle |
943
- | `brandIcon` | `string` | `'monitor'` | Brand icon |
944
- | `items` | `JvNavItem[]` | `[]` | Navigation items |
945
- | `collapsed` | `boolean` | `false` | Collapse to icon-only |
946
- | `mobileOpen` | `boolean` | `false` | Show on mobile |
947
- | `ariaLabel` | `string` | `'Sidebar navigation'` | Accessible label |
948
-
949
- | Output | Description |
950
- |---|---|
951
- | `collapseToggle` | Collapse button clicked |
952
- | `mobileClose` | Backdrop or nav item interaction — request close |
953
-
954
- ## Responsive Design
955
-
956
- The library includes basic responsive behavior:
957
-
958
- - **Breakpoints** defined as CSS custom properties: `--jv-breakpoint-sm` (640px), `--jv-breakpoint-md` (768px), `--jv-breakpoint-lg` (1024px), `--jv-breakpoint-xl` (1280px)
959
- - **Dashboard shell** collapses to single column at ≤ 900px; sidebar becomes a slide-in overlay with backdrop
960
- - **Topbar** stacks vertically at ≤ 900px
961
- - **Grid** pagination and toolbar stack at ≤ 640px; table scrolls horizontally with `overflow-x: auto`
962
- - **Flex-wrap** is used extensively for natural overflow handling
963
- - **Dialog** and **Toast** constrain width with `min()` to never exceed the viewport
964
-
965
- ## Services
966
-
967
- | Service | Import Path | Description |
968
- |---|---|---|
969
- | `JvThemeService` | `@devjuliovilla/jv-ui` | Light / dark / high-contrast theme switching |
970
- | `JvTranslationService` | `@devjuliovilla/jv-ui` | Dictionary-based i18n (en/es) |
971
- | `JvToastService` | `@devjuliovilla/jv-ui` | Toast notification system |
972
- | `JvLoaderService` | `@devjuliovilla/jv-ui` | Full-screen loader with request counter |
973
- | `JvDialogService` | `@devjuliovilla/jv-ui` | Programmatic confirm dialogs |
974
- | `JvAnnouncementService` | `@devjuliovilla/jv-ui` | Screen-reader live-region announcements |
975
-
976
- ## Accessibility
977
-
978
- - WCAG 2.2 AA target
979
- - Keyboard navigation for all interactive components
980
- - Focus management with visible focus indicators
981
- - Screen reader announcements (loading, empty states, page changes)
982
- - `aria-sort` on sortable grid headers
983
- - `aria-selected` on selectable grid rows
984
- - `aria-label` and `aria-labelledby` on interactive controls
985
- - Supports `prefers-reduced-motion`
986
-
987
- ## Requirements
988
-
989
- - Angular 21.2+
990
- - TypeScript 5.9+
991
-
992
- ## License
993
-
994
- MIT
1
+ # @devjuliovilla/jv-ui
2
+
3
+ Accessibility-first Angular component library built with signals and standalone APIs. Includes components, forms, data grids, dialogs, layout primitives, services, and i18n infrastructure.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @devjuliovilla/jv-ui
9
+ ```
10
+
11
+ This release line targets Angular 21. Future package changes will be tracked in the repository [CHANGELOG.md](https://github.com/devjuliovilla/JV_UI/blob/develop/CHANGELOG.md).
12
+
13
+ Import the theme CSS in your `angular.json` or `styles` array:
14
+
15
+ ```json
16
+ "styles": ["@devjuliovilla/jv-ui/styles/jv-theme.css"]
17
+ ```
18
+
19
+ ## Quick start
20
+
21
+ ```typescript
22
+ import { ApplicationConfig } from '@angular/core';
23
+ import { provideJvUi } from '@devjuliovilla/jv-ui';
24
+
25
+ export const appConfig: ApplicationConfig = {
26
+ providers: [provideJvUi({ messagesLocale: 'en', formatLocale: 'en-US' })],
27
+ };
28
+ ```
29
+
30
+ ```typescript
31
+ import { Component } from '@angular/core';
32
+ import { JvButtonComponent } from '@devjuliovilla/jv-ui';
33
+
34
+ @Component({
35
+ selector: 'app-root',
36
+ standalone: true,
37
+ imports: [JvButtonComponent],
38
+ template: '<jv-button variant="primary">Hello</jv-button>',
39
+ })
40
+ export class App {}
41
+ ```
42
+
43
+ ## Components
44
+
45
+ | Category | Components |
46
+ | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
47
+ | Buttons | `JvButton`, `JvButtonGroup`, `JvIconButton` |
48
+ | Calendar | `JvMonthCalendar`, `JvDayPlanner` — reusable month view and agenda primitives, usable together or independently |
49
+ | Forms | `JvInput`, `JvTextarea`, `JvCode`, `JvSelect`, `JvCheckbox`, `JvRadio`, `JvSwitch`, `JvDatePicker`, `JvModalSelector`, `JvFileInput`, `JvFormContainer` |
50
+ | Data Grid | `JvGrid` — full-featured data table (see below) |
51
+ | Containers | `JvCard`, `JvSection`, `JvDivider` |
52
+ | List | `JvList`, `JvListItem` — list with title, description, icons, badges, and interactive items |
53
+ | Tabs | `JvTabs`, `JvTabPanelDirective` — horizontal tabs with keyboard navigation and animated transitions |
54
+ | Slider | `JvImageSlider` — responsive image slider with thumbnails and keyboard navigation |
55
+ | Gallery | `JvImageGallery` — horizontal image gallery with wheel scrolling and full-screen viewer |
56
+ | Feedback | `JvAlert`, `JvBadge`, `JvLoader`, `JvToast` |
57
+ | Dialogs | `JvDialog`, `JvConfirmDialog`, `JvWindowModal` — compact dialogs plus a larger workflow overlay surface |
58
+ | Layout | `JvDashboardShell`, `JvSidebar`, `JvTopbar`, `JvBreadcrumb`, `JvPage` |
59
+ | Auth Pages | `JvLoginPage`, `JvForgotPasswordPage`, `JvChangePasswordPage` |
60
+ | Icon | `JvIcon` — Lucide-based icon component with 1500+ auto-generated icons |
61
+ | Pagination | `JvPagination` — standalone pagination with i18n |
62
+
63
+ ## Calendar API
64
+
65
+ The scheduling primitives are split into **two separate components**:
66
+
67
+ - `JvMonthCalendar`: inline month grid with selection, navigation, and day markers
68
+ - `JvDayPlanner`: agenda / list view for scheduled items with optional grouping and expandable details
69
+
70
+ You can use either one on its own, or compose both together in a master-detail scheduling layout.
71
+
72
+ ### JvMonthCalendar
73
+
74
+ ```typescript
75
+ import {
76
+ JvMonthCalendarComponent,
77
+ JvMonthCalendarDayDirective,
78
+ JvMonthCalendarDayMeta,
79
+ } from '@devjuliovilla/jv-ui';
80
+ ```
81
+
82
+ **Inputs:**
83
+
84
+ | Input | Type | Default | Description |
85
+ | -------------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ---------------------------------------------------------- |
86
+ | `value` | `Date \| string \| null` | `undefined` | Selected day |
87
+ | `visibleMonth` | `Date \| string \| null` | `undefined` | Controlled visible month independent from the selected day |
88
+ | `dayMeta` | `JvMonthCalendarDayMeta[]` | `[]` | Marker/counter metadata per day |
89
+ | `ariaLabel` | `string` | localized default | Accessible label for the grid |
90
+ | `monthLabel` | `string` | `Month` | Accessible label for the month selector |
91
+ | `yearLabel` | `string` | `Year` | Accessible label for the year selector |
92
+ | `minYear` | `number` | current year - 10 | Lower year bound for the year selector |
93
+ | `maxYear` | `number` | current year + 10 | Upper year bound for the year selector |
94
+ | `navigation` | `{ previousMonth?: boolean; nextMonth?: boolean; previousYear?: boolean; nextYear?: boolean }` | `{ previousMonth: true, nextMonth: true, previousYear: false, nextYear: false }` | Controls which month/year navigation buttons are rendered |
95
+
96
+ **Outputs:**
97
+
98
+ | Output | Type |
99
+ | -------------------- | ------ |
100
+ | `selectionChange` | `Date` |
101
+ | `visibleMonthChange` | `Date` |
102
+
103
+ **Day metadata:**
104
+
105
+ | Property | Type | Description |
106
+ | -------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------- |
107
+ | `date` | `Date \| string` | Day associated with the marker |
108
+ | `count` | `number` | Optional numeric badge rendered inside the cell |
109
+ | `tone` | `'primary' \| 'secondary' \| 'success' \| 'warning' \| 'danger' \| 'info' \| 'neutral'` | Visual tone for the badge or dot |
110
+ | `label` | `string` | Extra accessibility text appended to the day `aria-label` |
111
+
112
+ **Template hook:**
113
+
114
+ Use `ng-template[jvMonthCalendarDay]` to fully customize the day cell.
115
+
116
+ **Standalone example:**
117
+
118
+ ```typescript
119
+ import { Component, signal } from '@angular/core';
120
+ import { JvMonthCalendarComponent, JvMonthCalendarDayMeta } from '@devjuliovilla/jv-ui';
121
+
122
+ @Component({
123
+ selector: 'app-calendar-only',
124
+ standalone: true,
125
+ imports: [JvMonthCalendarComponent],
126
+ template: `
127
+ <jv-month-calendar
128
+ [value]="selectedDate()"
129
+ [dayMeta]="calendarMeta"
130
+ (selectionChange)="selectedDate.set($event)"
131
+ />
132
+ `,
133
+ })
134
+ export class CalendarOnlyComponent {
135
+ readonly selectedDate = signal(new Date(2026, 5, 15));
136
+ readonly calendarMeta: JvMonthCalendarDayMeta[] = [
137
+ { date: '2026-06-15', count: 2, tone: 'primary', label: '2 activities' },
138
+ { date: '2026-06-16', count: 1, tone: 'secondary', label: '1 activity' },
139
+ ];
140
+ }
141
+ ```
142
+
143
+ ### JvDayPlanner
144
+
145
+ ```typescript
146
+ import {
147
+ JvDayPlannerComponent,
148
+ JvDayPlannerDetailDirective,
149
+ JvDayPlannerItem,
150
+ JvDayPlannerItemDirective,
151
+ } from '@devjuliovilla/jv-ui';
152
+ ```
153
+
154
+ **Inputs:**
155
+
156
+ | Input | Type | Default | Description |
157
+ | ------------------------ | ---------------------- | ----------------- | ---------------------------------------- |
158
+ | `items` | `JvDayPlannerItem[]` | `[]` | Agenda items |
159
+ | `groupByDate` | `boolean` | `false` | Group items under a date heading |
160
+ | `emptyMessage` | `string` | localized default | Empty state copy |
161
+ | `ariaLabel` | `string` | localized default | Accessible label for the agenda |
162
+ | `defaultExpandedItemIds` | `(string \| number)[]` | `[]` | Items whose detail should start expanded |
163
+
164
+ **Outputs:**
165
+
166
+ | Output | Type |
167
+ | ------------ | ------------------ |
168
+ | `itemSelect` | `JvDayPlannerItem` |
169
+
170
+ **Planner item shape:**
171
+
172
+ | Property | Type | Description |
173
+ | ------------- | ------------------------ | ----------------------------------------- |
174
+ | `id` | `string \| number` | Stable identity |
175
+ | `title` | `string` | Primary label |
176
+ | `date` | `Date \| string \| null` | Logical day when start time is not enough |
177
+ | `start` | `Date \| string \| null` | Optional start datetime |
178
+ | `end` | `Date \| string \| null` | Optional end datetime |
179
+ | `status` | `string` | Status badge label |
180
+ | `statusTone` | `JvTone` | Visual tone for status badge |
181
+ | `type` | `string` | Type/category badge label |
182
+ | `typeTone` | `JvTone` | Visual tone for type badge |
183
+ | `responsible` | `string` | Responsible person |
184
+ | `location` | `string` | Location metadata |
185
+ | `details` | `string` | Expandable detail text |
186
+ | `completed` | `boolean` | Reduced emphasis for completed items |
187
+
188
+ **Template hooks:**
189
+
190
+ - `ng-template[jvDayPlannerItem]` customizes the visible item row
191
+ - `ng-template[jvDayPlannerDetail]` customizes the expanded detail panel
192
+
193
+ **Standalone example:**
194
+
195
+ ```typescript
196
+ import { Component } from '@angular/core';
197
+ import { JvDayPlannerComponent, JvDayPlannerItem } from '@devjuliovilla/jv-ui';
198
+
199
+ @Component({
200
+ selector: 'app-planner-only',
201
+ standalone: true,
202
+ imports: [JvDayPlannerComponent],
203
+ template: `
204
+ <jv-day-planner [items]="items" [groupByDate]="true" (itemSelect)="handleSelect($event)" />
205
+ `,
206
+ })
207
+ export class PlannerOnlyComponent {
208
+ readonly items: JvDayPlannerItem[] = [
209
+ {
210
+ id: 1,
211
+ title: 'Venue setup',
212
+ start: '2026-06-15T08:30:00',
213
+ end: '2026-06-15T10:00:00',
214
+ status: 'Scheduled',
215
+ statusTone: 'primary',
216
+ type: 'Logistics',
217
+ responsible: 'Ana Lopez',
218
+ location: 'Main hall',
219
+ details: 'Prepare seating and signage.',
220
+ },
221
+ ];
222
+
223
+ handleSelect(item: JvDayPlannerItem) {
224
+ console.log(item);
225
+ }
226
+ }
227
+ ```
228
+
229
+ ### Combined example
230
+
231
+ Use both components together when you need a left-side month selector and a right-side agenda:
232
+
233
+ ```html
234
+ <jv-month-calendar
235
+ [value]="selectedDate()"
236
+ [dayMeta]="calendarMeta()"
237
+ (selectionChange)="selectedDate.set($event)"
238
+ />
239
+
240
+ <jv-day-planner
241
+ [items]="filteredItems()"
242
+ [groupByDate]="showAll()"
243
+ (itemSelect)="selectedItem.set($event)"
244
+ />
245
+ ```
246
+
247
+ ## Grid Features
248
+
249
+ | Feature | Description |
250
+ | ------------------ | ---------------------------------------------------------------- |
251
+ | Sorting | Client-side multi-column sorting with sort icons and `aria-sort` |
252
+ | Search | Global text search across visible columns |
253
+ | Pagination | Configurable page size, page range buttons, first/last/prev/next |
254
+ | Selection | Checkbox row selection with `selectedIds` / `selectionChange` |
255
+ | Row actions | Custom action buttons per row |
256
+ | Density modes | Compact, normal, comfortable |
257
+ | Sticky columns | Pin columns to left or right |
258
+ | Column resizing | Drag column header borders to resize |
259
+ | Column reordering | Drag & drop column headers |
260
+ | Grouped headers | Multi-row header with `colspan` via `children` |
261
+ | Per-column filters | Filter input row with operators |
262
+ | Inline editing | Double-click or Enter to edit: text, number, select, boolean |
263
+ | Virtual scrolling | Render only visible rows for large datasets |
264
+ | CSV/Excel export | Built-in toolbar buttons, no external deps |
265
+ | Server-side mode | Delegate sort/filter/page to parent component |
266
+ | TrackBy | Custom trackBy key or function |
267
+ | i18n | All labels configurable via translation dictionary |
268
+
269
+ ### Grid API
270
+
271
+ ```typescript
272
+ import { JvGridComponent } from '@devjuliovilla/jv-ui';
273
+ ```
274
+
275
+ **Inputs:**
276
+
277
+ | Input | Type | Default | Description |
278
+ | ------------- | ----------------------------- | ------- | -------------------------- |
279
+ | `data` | `T[]` | `[]` | Row data array |
280
+ | `columns` | `JvGridColumn<T>[]` | `[]` | Column definitions |
281
+ | `actions` | `JvGridAction<T>[]` | `[]` | Row action button configs |
282
+ | `options` | `Partial<JvGridOptions>` | `{}` | Feature toggles and config |
283
+ | `trackBy` | `keyof T \| Function \| null` | `null` | Row identity |
284
+ | `selectedIds` | `(string \| number)[]` | `[]` | Controlled selection IDs |
285
+
286
+ **Outputs:**
287
+
288
+ | Output | Type |
289
+ | ----------------- | ----------------------------------------------------------- |
290
+ | `rowClick` | `T` |
291
+ | `rowDoubleClick` | `T` |
292
+ | `actionClick` | `{ actionId: string; row: T }` |
293
+ | `selectionChange` | `(string \| number)[]` |
294
+ | `pageChange` | `{ pageIndex: number; pageSize: number }` |
295
+ | `searchChange` | `string` |
296
+ | `sortChange` | `{ columnKey: string; direction: 'asc' \| 'desc' \| null }` |
297
+ | `columnFilter` | `{ columnKey: string; value: string }` |
298
+ | `columnResize` | `{ columnKey: string; width: string }` |
299
+ | `columnReorder` | `{ columnKey: string; newIndex: number }` |
300
+ | `rowEdit` | `{ row: T; column: JvGridColumn<T>; value: unknown }` |
301
+
302
+ **JvGridColumn options:**
303
+
304
+ | Property | Type | Description |
305
+ | --------------- | ----------------------------------------------------------------------------------------------------------- | --------------------------------- |
306
+ | `key` | `keyof T \| string` | Data field key |
307
+ | `header` | `string` | Column display header |
308
+ | `sortable` | `boolean` | Enable column sorting |
309
+ | `searchable` | `boolean` | Include in global search |
310
+ | `filterable` | `boolean` | Show per-column filter input |
311
+ | `hidden` | `boolean` | Hide column from display |
312
+ | `sticky` | `'left' \| 'right'` | Pin column position |
313
+ | `editable` | `boolean` | Allow inline cell editing |
314
+ | `editType` | `'text' \| 'number' \| 'select' \| 'boolean'` | Editor type |
315
+ | `editOptions` | `{ label: string; value: unknown }[]` | Options for select editor |
316
+ | `width` | `string` | Column width (e.g. '8rem') |
317
+ | `align` | `'start' \| 'center' \| 'end'` | Text alignment |
318
+ | `type` | `'text' \| 'integer' \| 'number' \| 'currency' \| 'percent' \| 'date' \| 'time' \| 'datetime' \| 'boolean'` | Data type for formatting |
319
+ | `formatOptions` | `Intl.NumberFormatOptions & Intl.DateTimeFormatOptions` | Per-column formatting overrides |
320
+ | `format` | `(value, row) => string` | Custom display formatter |
321
+ | `children` | `JvGridColumn<T>[]` | Child columns for grouped headers |
322
+ | `resizable` | `boolean` | Allow column resize |
323
+ | `cellClass` | `string` | CSS class for cells |
324
+ | `headerClass` | `string` | CSS class for header |
325
+
326
+ **JvGridOptions:**
327
+
328
+ | Option | Type | Default | Description |
329
+ | ------------------------ | ---------------------------------------- | ------------------- | ------------------------------------------------------------------------------------- |
330
+ | `searchable` | `boolean` | `true` | Show search bar |
331
+ | `sortable` | `boolean` | `true` | Enable column sorting |
332
+ | `pageable` | `boolean` | `true` | Enable pagination |
333
+ | `selectable` | `boolean` | `false` | Show selection checkboxes |
334
+ | `pageSize` | `number` | `20` | Default page size |
335
+ | `pageSizeOptions` | `number[]` | `[10, 20, 50, 100]` | Page size selector options |
336
+ | `density` | `'compact' \| 'normal' \| 'comfortable'` | `'normal'` | Row density |
337
+ | `loading` | `boolean` | `false` | Show loading spinner |
338
+ | `emptyMessage` | `string` | — | Empty state message |
339
+ | `exportable` | `boolean` | `false` | Show CSV/Excel export buttons |
340
+ | `exportFileName` | `string` | `''` | Base filename used for CSV/Excel exports; the component applies the correct extension |
341
+ | `serverSide` | `boolean` | `false` | Disable client-side processing |
342
+ | `totalItems` | `number` | `0` | Total items for server-side mode |
343
+ | `stickyColumns` | `boolean` | `false` | Enable sticky column support |
344
+ | `resizableColumns` | `boolean` | `false` | Enable column resizing |
345
+ | `reorderableColumns` | `boolean` | `false` | Enable column reordering |
346
+ | `editable` | `boolean` | `false` | Enable inline editing |
347
+ | `virtualScroll` | `boolean` | `false` | Enable virtual scrolling |
348
+ | `virtualScrollRowHeight` | `number` | `48` | Row height for virtual scroll |
349
+ | `columnFilters` | `boolean` | `false` | Show filter row below headers |
350
+ | `rowDoubleClick` | `boolean` | `false` | Enable row double-click event |
351
+ | `keyboardNavigation` | `boolean` | `false` | Enable arrow-key cell navigation and `F2` editing flow |
352
+ | `ariaLabel` | `string` | — | Accessible label for the grid |
353
+
354
+ ### Grid example
355
+
356
+ ```typescript
357
+ import { Component } from '@angular/core';
358
+ import { JvGridComponent, JvGridColumn, JvGridOptions } from '@devjuliovilla/jv-ui';
359
+
360
+ interface Product {
361
+ id: number;
362
+ name: string;
363
+ price: number;
364
+ status: string;
365
+ }
366
+
367
+ @Component({
368
+ selector: 'app-products',
369
+ standalone: true,
370
+ imports: [JvGridComponent],
371
+ template: `
372
+ <jv-grid
373
+ [data]="products"
374
+ [columns]="columns"
375
+ [options]="{ selectable: true, exportable: true, exportFileName: 'products', pageSize: 10 }"
376
+ [trackBy]="'id'"
377
+ [selectedIds]="selectedIds"
378
+ (selectionChange)="selectedIds = $event"
379
+ />
380
+ `,
381
+ })
382
+ export class ProductsComponent {
383
+ products: Product[] = [
384
+ /* ... */
385
+ ];
386
+ selectedIds: (string | number)[] = [];
387
+ columns: JvGridColumn<Product>[] = [
388
+ { key: 'id', header: 'ID', width: '4rem' },
389
+ { key: 'name', header: 'Product', sortable: true, filterable: true },
390
+ { key: 'price', header: 'Price', type: 'number', align: 'end', format: (v) => '$' + v },
391
+ { key: 'status', header: 'Status', sortable: true },
392
+ ];
393
+ }
394
+ ```
395
+
396
+ ### Grid behavior notes
397
+
398
+ - **Row identity:** when `trackBy` is not provided, rows with an `id` property use that value as their identity. Provide `[trackBy]` when the row identity uses another field or a custom function.
399
+ - **Controlled selection:** use `[selectedIds]` together with `(selectionChange)` when the parent owns selection state. The component accepts an empty array, so selection can start fully controlled without special initialization.
400
+ - **Pagination:** `pageSize` is clamped to the configured `pageSizeOptions`, and page indexes are clamped when the data or page size changes. Use `(pageChange)` to synchronize server-side pagination.
401
+ - **Grouped headers:** define parent columns with `children`. The grouped header is rendered with `colspan`, while sorting, filtering, editing, resizing, reordering, and export operate on the leaf columns.
402
+ - **Virtual scrolling:** place the grid inside a container with a constrained height and set `virtualScroll: true`. The default row height is `48`; set `virtualScrollRowHeight` to the actual rendered row height when it differs.
403
+ - **Formatting:** column `type` and `formatOptions` affect display only. Sorting and export use the raw field value, not the localized text shown in the cell.
404
+ - **Inline editing:** set both `editable: true` in `options` and `editable: true` on the column. `select` editors emit the configured option value, while `boolean` editors emit a boolean. Press `F2` to start, `Enter` to commit, and `Escape` to cancel when keyboard navigation is enabled.
405
+
406
+ ### Keyboard navigation example
407
+
408
+ ```typescript
409
+ const gridOptions: JvGridOptions = {
410
+ keyboardNavigation: true,
411
+ editable: true,
412
+ pageable: false,
413
+ };
414
+
415
+ const columns: JvGridColumn<Product>[] = [
416
+ { key: 'name', header: 'Product', editable: true, editType: 'text' },
417
+ {
418
+ key: 'status',
419
+ header: 'Status',
420
+ editable: true,
421
+ editType: 'select',
422
+ editOptions: [
423
+ { label: 'Active', value: 'active' },
424
+ { label: 'Paused', value: 'paused' },
425
+ ],
426
+ },
427
+ ];
428
+ ```
429
+
430
+ ```html
431
+ <jv-grid
432
+ [data]="products"
433
+ [columns]="columns"
434
+ [options]="gridOptions"
435
+ (rowEdit)="onRowEdit($event)"
436
+ />
437
+ ```
438
+
439
+ With `keyboardNavigation` enabled, arrow keys move between data cells without trapping row action buttons. `Tab` continues to the row actions, `F2` starts editing, `Enter` commits, and `Escape` cancels.
440
+
441
+ ## List API
442
+
443
+ ```typescript
444
+ import { JvListComponent, JvListItemComponent } from '@devjuliovilla/jv-ui';
445
+ ```
446
+
447
+ **JvList inputs:**
448
+
449
+ | Input | Type | Default | Description |
450
+ | ----------- | ------------------------ | -------- | ------------------------------------------------------------------------------ |
451
+ | `role` | `'list' \| 'navigation'` | `'list'` | ARIA role for the list |
452
+ | `variant` | `'bordered' \| null` | `null` | Outer border + border-radius around the list (items always have bottom border) |
453
+ | `ariaLabel` | `string` | `''` | Accessible label |
454
+
455
+ **JvListItem inputs:**
456
+
457
+ | Input | Type | Default | Description |
458
+ | ------------- | ------------------- | ------- | -------------------------------------------- |
459
+ | `title` | `string` (required) | — | Primary text |
460
+ | `description` | `string` | `''` | Secondary text below title |
461
+ | `leadingIcon` | `string \| null` | `null` | Lucide icon name on the left |
462
+ | `disabled` | `boolean` | `false` | Gray out and block interaction |
463
+ | `active` | `boolean` | `false` | Highlight with primary color and left border |
464
+
465
+ **JvListItem outputs:**
466
+
467
+ | Output | Type |
468
+ | ----------- | ------ |
469
+ | `activated` | `void` |
470
+
471
+ **Content projection:** use the `meta` attribute selector for badges, icons, or any content on the right side:
472
+
473
+ ```html
474
+ <jv-list-item title="Inbox" description="New messages">
475
+ <jv-badge tone="primary" meta>3</jv-badge>
476
+ <jv-icon name="chevron-right" meta />
477
+ </jv-list-item>
478
+ ```
479
+
480
+ ### Example
481
+
482
+ ```typescript
483
+ import { Component } from '@angular/core';
484
+ import { JvListComponent, JvListItemComponent, JvBadgeComponent } from '@devjuliovilla/jv-ui';
485
+
486
+ @Component({
487
+ selector: 'app-nav-list',
488
+ standalone: true,
489
+ imports: [JvListComponent, JvListItemComponent, JvBadgeComponent],
490
+ template: `
491
+ <jv-list variant="bordered">
492
+ <jv-list-item
493
+ title="Dashboard"
494
+ description="Main overview"
495
+ leadingIcon="layout-dashboard"
496
+ [active]="true"
497
+ />
498
+ <jv-list-item title="Notifications" description="3 pending" (activated)="onOpen()">
499
+ <jv-badge tone="primary" meta>3</jv-badge>
500
+ </jv-list-item>
501
+ <jv-list-item title="Reports" description="Coming soon" [disabled]="true" />
502
+ </jv-list>
503
+ `,
504
+ })
505
+ export class NavListComponent {
506
+ onOpen() {
507
+ /* handle activation */
508
+ }
509
+ }
510
+ ```
511
+
512
+ ## Pagination API
513
+
514
+ ```typescript
515
+ import { JvPaginationComponent } from '@devjuliovilla/jv-ui';
516
+ ```
517
+
518
+ | Input | Type | Default | Description |
519
+ | ----------------- | ---------- | ------------------- | ------------------------ |
520
+ | `totalItems` | `number` | `0` | Total items |
521
+ | `pageSize` | `number` | `20` | Items per page |
522
+ | `pageSizeOptions` | `number[]` | `[10, 20, 50, 100]` | Page size options |
523
+ | `pageIndex` | `number` | `0` | Current page (0-based) |
524
+ | `maxVisiblePages` | `number` | `5` | Max page buttons to show |
525
+
526
+ | Output | Type |
527
+ | ------------ | ----------------------------------------- |
528
+ | `pageChange` | `{ pageIndex: number; pageSize: number }` |
529
+
530
+ ## Tabs API
531
+
532
+ ```typescript
533
+ import { JvTabsComponent, JvTabPanelDirective, JvTabItem } from '@devjuliovilla/jv-ui';
534
+ ```
535
+
536
+ **Inputs:**
537
+
538
+ | Input | Type | Default | Description |
539
+ | ------------- | ------------------------------------- | ------- | --------------------------------------------------------- |
540
+ | `tabs` | `JvTabItem[]` | `[]` | Tab definitions (`{ id, label, icon?, disabled? }`) |
541
+ | `activeTabId` | `string \| null` | `null` | Controlled active tab ID |
542
+ | `keepMounted` | `boolean` | `true` | Keep all panels in DOM; `false` renders only active panel |
543
+ | `transition` | `'none' \| 'fade' \| 'slide' \| null` | `null` | Panel transition animation (falls back to global config) |
544
+
545
+ **Outputs:**
546
+
547
+ | Output | Type |
548
+ | ----------------- | -------- |
549
+ | `activeTabChange` | `string` |
550
+
551
+ **Content projection:** use `jvTabPanel` directive on `ng-template` to define panel content:
552
+
553
+ ```html
554
+ <jv-tabs [tabs]="tabs" [activeTabId]="activeTabId()" (activeTabChange)="activeTabId.set($event)">
555
+ <ng-template jvTabPanel="overview">
556
+ <p>Overview content</p>
557
+ </ng-template>
558
+ <ng-template jvTabPanel="analytics">
559
+ <p>Analytics content</p>
560
+ </ng-template>
561
+ </jv-tabs>
562
+ ```
563
+
564
+ ### Tab Transitions
565
+
566
+ Tabs support animated transitions between panels. Configure globally via `provideJvUi()` or per-instance via the `transition` input:
567
+
568
+ ```typescript
569
+ // Global default
570
+ provideJvUi({ tabsTransition: 'fade' });
571
+ ```
572
+
573
+ ```typescript
574
+ // Per-instance override
575
+ <jv-tabs transition="slide" [keepMounted]="false">...</jv-tabs>
576
+ ```
577
+
578
+ | Transition | `keepMounted=true` | `keepMounted=false` | Description |
579
+ | ---------- | ---------------------- | ------------------- | ------------------------------------ |
580
+ | `'none'` | Instant switch | Instant switch | No animation |
581
+ | `'fade'` | Opacity cross-fade | Opacity cross-fade | Smooth fade between panels |
582
+ | `'slide'` | Falls back to `'fade'` | Directional slide | Slides left/right based on tab index |
583
+
584
+ **Note:** `slide` requires `keepMounted=false` because it needs to animate both entering and exiting panels simultaneously. When used with `keepMounted=true`, it automatically falls back to `fade`.
585
+
586
+ ### Tabs Example
587
+
588
+ ```typescript
589
+ import { Component, signal } from '@angular/core';
590
+ import { JvTabItem, JvTabPanelDirective, JvTabsComponent } from '@devjuliovilla/jv-ui';
591
+
592
+ @Component({
593
+ standalone: true,
594
+ imports: [JvTabsComponent, JvTabPanelDirective],
595
+ template: `
596
+ <jv-tabs
597
+ [tabs]="tabs"
598
+ [activeTabId]="activeTabId()"
599
+ transition="fade"
600
+ (activeTabChange)="activeTabId.set($event)"
601
+ >
602
+ <ng-template jvTabPanel="overview">
603
+ <p>Overview content</p>
604
+ </ng-template>
605
+ <ng-template jvTabPanel="analytics">
606
+ <p>Analytics content</p>
607
+ </ng-template>
608
+ </jv-tabs>
609
+ `,
610
+ })
611
+ export class TabsExampleComponent {
612
+ readonly activeTabId = signal('overview');
613
+ readonly tabs: JvTabItem[] = [
614
+ { id: 'overview', label: 'Overview' },
615
+ { id: 'analytics', label: 'Analytics', icon: 'chart-column' },
616
+ ];
617
+ }
618
+ ```
619
+
620
+ ## Image Slider API
621
+
622
+ ```typescript
623
+ import { JvImageSliderComponent, JvSliderImage } from '@devjuliovilla/jv-ui';
624
+ ```
625
+
626
+ **JvSliderImage:**
627
+
628
+ | Property | Type | Required | Description |
629
+ | ------------- | -------- | -------- | ---------------------------------------- |
630
+ | `src` | `string` | Yes | Image URL |
631
+ | `alt` | `string` | Yes | Alternative text for accessibility |
632
+ | `description` | `string` | No | Caption displayed below the image |
633
+ | `thumbnail` | `string` | No | Custom thumbnail URL (defaults to `src`) |
634
+
635
+ **Inputs:**
636
+
637
+ | Input | Type | Default | Description |
638
+ | ----------------- | ----------------- | ------- | --------------------------------- |
639
+ | `images` | `JvSliderImage[]` | `[]` | Array of images to display |
640
+ | `showThumbnails` | `boolean` | `true` | Show thumbnail strip below slider |
641
+ | `showDescription` | `boolean` | `true` | Show image description |
642
+
643
+ **Outputs:**
644
+
645
+ | Output | Type | Description |
646
+ | ------------- | -------- | ------------------------------------- |
647
+ | `imageChange` | `number` | Emits index when active image changes |
648
+
649
+ **i18n support:**
650
+
651
+ The component automatically translates aria labels using `JvTranslationService`:
652
+
653
+ | Key | English | Spanish |
654
+ | ---------------------- | ---------------- | ---------------------- |
655
+ | `slider.prevImage` | Previous image | Imagen anterior |
656
+ | `slider.nextImage` | Next image | Imagen siguiente |
657
+ | `slider.thumbnailList` | Image thumbnails | Miniaturas de imagenes |
658
+
659
+ ### Features
660
+
661
+ - **Keyboard navigation:** ArrowLeft/ArrowRight to navigate, Home/End for first/last image
662
+ - **Responsive:** Images scale to fit container with `object-fit: contain`
663
+ - **Thumbnails:** Scrollable thumbnail strip with active state indicator
664
+ - **Single image mode:** Navigation controls hidden when only one image is provided
665
+ - **Lazy loading:** Images use native `loading="lazy"` attribute
666
+ - **i18n:** Aria labels automatically translated based on configured locale
667
+
668
+ ### Example
669
+
670
+ ```typescript
671
+ import { Component } from '@angular/core';
672
+ import { JvImageSliderComponent, JvSliderImage } from '@devjuliovilla/jv-ui';
673
+
674
+ @Component({
675
+ standalone: true,
676
+ imports: [JvImageSliderComponent],
677
+ template: `
678
+ <jv-image-slider
679
+ [images]="images"
680
+ [showThumbnails]="true"
681
+ [showDescription]="true"
682
+ (imageChange)="onImageChange($event)"
683
+ />
684
+ `,
685
+ })
686
+ export class SliderComponent {
687
+ readonly images: JvSliderImage[] = [
688
+ { src: 'photo1.jpg', alt: 'Sunset', description: 'Beautiful sunset over the ocean' },
689
+ { src: 'photo2.jpg', alt: 'Mountain', description: 'Snow-capped mountain peak' },
690
+ { src: 'photo3.jpg', alt: 'Forest', description: 'Dense forest trail' },
691
+ ];
692
+
693
+ onImageChange(index: number) {
694
+ console.log('Viewing image:', index);
695
+ }
696
+ }
697
+ ```
698
+
699
+ ## Image Gallery API
700
+
701
+ ```typescript
702
+ import { JvImageGalleryComponent, JvGalleryImage, JvGalleryAction } from '@devjuliovilla/jv-ui';
703
+ ```
704
+
705
+ **JvGalleryImage:**
706
+
707
+ | Property | Type | Required | Description |
708
+ | ----------- | -------- | -------- | ---------------------------------------- |
709
+ | `src` | `string` | Yes | Image URL |
710
+ | `alt` | `string` | Yes | Alternative text for accessibility |
711
+ | `thumbnail` | `string` | No | Custom thumbnail URL (defaults to `src`) |
712
+
713
+ **JvGalleryAction:**
714
+
715
+ | Property | Type | Required | Description |
716
+ | -------- | ---------- | -------- | ------------------------ |
717
+ | `id` | `string` | Yes | Unique action identifier |
718
+ | `label` | `string` | Yes | Button label text |
719
+ | `icon` | `string` | No | Lucide icon name |
720
+ | `tone` | `JvIntent` | No | Button variant |
721
+
722
+ **Inputs:**
723
+
724
+ | Input | Type | Default | Description |
725
+ | --------------- | ------------------- | ------- | ------------------------------------------------------------------------------------- |
726
+ | `images` | `JvGalleryImage[]` | `[]` | Array of images to display |
727
+ | `stripHeightVh` | `number` | `25` | Height of the thumbnail strip in viewport-height units, clamped between `0` and `100` |
728
+ | `actions` | `JvGalleryAction[]` | `[]` | Action buttons shown in dialog footer |
729
+
730
+ **Outputs:**
731
+
732
+ | Output | Type | Description |
733
+ | ------------- | --------------------------------------------- | -------------------------------------- |
734
+ | `imageClick` | `JvGalleryImage` | Emits when an image is clicked |
735
+ | `actionClick` | `{ actionId: string; image: JvGalleryImage }` | Emits when an action button is clicked |
736
+
737
+ ### Features
738
+
739
+ - **Horizontal strip:** Scrollable thumbnail strip with configurable height in `vh`
740
+ - **Full-screen viewer:** Click any image to open in a dialog with dark background
741
+ - **Navigation:** Prev/next buttons and keyboard arrows (← →) in the viewer
742
+ - **Configurable actions:** Action buttons in dialog footer (favorite, edit, delete, etc.)
743
+ - **Responsive:** Shows multiple columns on desktop, single column with scroll on mobile
744
+ - **Lazy loading:** All images use native `loading="lazy"` attribute
745
+ - **i18n:** Close and navigation labels automatically translated
746
+
747
+ ### Example
748
+
749
+ ```typescript
750
+ import { Component } from '@angular/core';
751
+ import { JvImageGalleryComponent, JvGalleryImage, JvGalleryAction } from '@devjuliovilla/jv-ui';
752
+
753
+ @Component({
754
+ standalone: true,
755
+ imports: [JvImageGalleryComponent],
756
+ template: `
757
+ <jv-image-gallery
758
+ [images]="images"
759
+ [stripHeightVh]="30"
760
+ [actions]="actions"
761
+ (imageClick)="onImageClick($event)"
762
+ (actionClick)="onActionClick($event)"
763
+ />
764
+ `,
765
+ })
766
+ export class GalleryComponent {
767
+ readonly images: JvGalleryImage[] = [
768
+ { src: 'photo1.jpg', alt: 'Sunset' },
769
+ { src: 'photo2.jpg', alt: 'Mountain' },
770
+ { src: 'photo3.jpg', alt: 'Forest' },
771
+ ];
772
+
773
+ readonly actions: JvGalleryAction[] = [
774
+ { id: 'favorite', label: 'Favorite', icon: 'heart', tone: 'danger' },
775
+ { id: 'edit', label: 'Edit', icon: 'pencil' },
776
+ { id: 'delete', label: 'Delete', icon: 'trash-2', tone: 'danger' },
777
+ ];
778
+
779
+ onImageClick(image: JvGalleryImage) {
780
+ console.log('Viewing:', image.alt);
781
+ }
782
+
783
+ onActionClick(event: { actionId: string; image: JvGalleryImage }) {
784
+ console.log(event.actionId, 'on', event.image.alt);
785
+ }
786
+ }
787
+ ```
788
+
789
+ ## Textarea API
790
+
791
+ ```typescript
792
+ import { JvTextareaComponent } from '@devjuliovilla/jv-ui';
793
+ ```
794
+
795
+ | Input | Type | Default | Description |
796
+ | ------------- | --------- | ----------------- | ---------------------------------------------------- |
797
+ | `placeholder` | `string` | `''` | Placeholder text |
798
+ | `required` | `boolean` | `false` | Mark field as required |
799
+ | `invalid` | `boolean` | `false` | Show invalid state |
800
+ | `readonly` | `boolean` | `false` | Make textarea read-only |
801
+ | `rows` | `number` | `3` | Visible number of rows |
802
+ | `cols` | `number` | — | Visible width in columns |
803
+ | `maxlength` | `number` | — | Maximum character length |
804
+ | `describedBy` | `string` | `''` | ID of description/error element for aria-describedby |
805
+ | `inputId` | `string` | `jv-textarea-{n}` | Auto-generated unique ID |
806
+
807
+ Implements `ControlValueAccessor` — compatible with `[(ngModel)]` and reactive forms via `formControlName`.
808
+
809
+ ### Example
810
+
811
+ ```typescript
812
+ import { Component } from '@angular/core';
813
+ import { JvTextareaComponent } from '@devjuliovilla/jv-ui';
814
+ import { ReactiveFormsModule, FormBuilder } from '@angular/forms';
815
+
816
+ @Component({
817
+ selector: 'app-profile',
818
+ standalone: true,
819
+ imports: [ReactiveFormsModule, JvTextareaComponent],
820
+ template: `
821
+ <jv-textarea
822
+ formControlName="bio"
823
+ placeholder="Tell us about yourself..."
824
+ [rows]="4"
825
+ [maxlength]="500"
826
+ />
827
+ `,
828
+ })
829
+ export class ProfileComponent {
830
+ form = inject(FormBuilder).group({ bio: [''] });
831
+ }
832
+ ```
833
+
834
+ ## Code API
835
+
836
+ ```typescript
837
+ import { JvCodeComponent } from '@devjuliovilla/jv-ui';
838
+ ```
839
+
840
+ | Input | Type | Default | Description |
841
+ | ---------- | ------------------------------------------------------------------------- | ------------------ | --------------------------------------------------------------------- |
842
+ | `code` | `string` | — | Code or text content to render |
843
+ | `language` | `string` | `''` | Optional language badge |
844
+ | `title` | `string` | `''` | Optional header title |
845
+ | `font` | `'jetbrains-mono' \| 'fira-code' \| 'cascadia' \| 'consolas' \| 'system'` | `'jetbrains-mono'` | Mono font preset for the rendered block |
846
+ | `editable` | `boolean` | `false` | Renders a textarea-style editing surface instead of read-only preview |
847
+ | `width` | `string` | `'100%'` | CSS width applied to the component |
848
+ | `height` | `string` | `'auto'` | CSS height for the editable surface or minimum preview height |
849
+
850
+ Use `JvCode` for read-only payloads or long single-line content where horizontal scrolling should be preserved instead of wrapping.
851
+ The library does not bundle font files. `JvCode` references common mono families and will use any web font you load at the application level.
852
+
853
+ When `editable` is enabled, `JvCode` emits `codeChange` on every edit so the parent can keep the source text in sync.
854
+
855
+ ### Example
856
+
857
+ ```typescript
858
+ import { Component } from '@angular/core';
859
+ import { JvCodeComponent } from '@devjuliovilla/jv-ui';
860
+
861
+ @Component({
862
+ selector: 'app-payload-preview',
863
+ standalone: true,
864
+ imports: [JvCodeComponent],
865
+ template: `
866
+ <jv-code
867
+ [code]="payload"
868
+ language="json"
869
+ title="HTTP payload preview"
870
+ font="fira-code"
871
+ [editable]="true"
872
+ width="100%"
873
+ height="18rem"
874
+ (codeChange)="payload = $event"
875
+ />
876
+ `,
877
+ })
878
+ export class PayloadPreviewComponent {
879
+ payload = '{"status":"ok"}';
880
+ }
881
+ ```
882
+
883
+ If you want hosted fonts without shipping them in your package, load them at the app level, for example:
884
+
885
+ ```css
886
+ @import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');
887
+ ```
888
+
889
+ ## Confirm Dialog Labels
890
+
891
+ `JvDialogService.confirm()` already supports `confirmLabel` and `cancelLabel` overrides per dialog. If you omit them, the defaults come from the active translation dictionary using `dialog.confirm` and `dialog.cancel`.
892
+
893
+ This lets you either:
894
+
895
+ - override labels directly for a specific action like `Guardar evento` / `Descartar cambios`
896
+ - or register translated defaults in your i18n dictionary for each supported language
897
+
898
+ Example with business copy:
899
+
900
+ ```typescript
901
+ const confirmed = await dialogService.confirm({
902
+ title: 'Guardar evento',
903
+ message: 'Se aplicaran cambios a la agenda del equipo.',
904
+ confirmLabel: 'Guardar evento',
905
+ cancelLabel: 'Descartar cambios',
906
+ tone: 'primary',
907
+ });
908
+
909
+ if (confirmed) {
910
+ saveEvent();
911
+ }
912
+ ```
913
+
914
+ Example using translated defaults from your dictionary:
915
+
916
+ ```typescript
917
+ await dialogService.confirm({
918
+ message: 'This action will publish the current draft.',
919
+ tone: 'primary',
920
+ });
921
+ ```
922
+
923
+ ## Icon System
924
+
925
+ ```typescript
926
+ import { JvIconComponent, JV_LUCIDE_ICON_REGISTRY } from '@devjuliovilla/jv-ui';
927
+ ```
928
+
929
+ | Input | Type | Default | Description |
930
+ | ------------- | --------- | ------- | ----------------------------------------------- |
931
+ | `name` | `string` | — | Icon name (from auto-generated Lucide registry) |
932
+ | `size` | `number` | `24` | Width and height in pixels |
933
+ | `strokeWidth` | `number` | `2` | SVG stroke width |
934
+ | `decorative` | `boolean` | `true` | `aria-hidden="true"` when decorative |
935
+ | `ariaLabel` | `string` | — | Accessible label when not decorative |
936
+
937
+ Icons are auto-generated from [lucide-static](https://www.npmjs.com/package/lucide-static) via:
938
+
939
+ ```bash
940
+ node tools/generate-icons.mjs
941
+ ```
942
+
943
+ This reads all SVG files from `lucide-static/icons` and produces `jv-icon-registry.ts` with the complete set (~1500 icons). Run it after updating `lucide-static` to keep icons in sync.
944
+
945
+ ## Layout API
946
+
947
+ ### JvDashboardShell
948
+
949
+ ```typescript
950
+ import { JvDashboardShellComponent } from '@devjuliovilla/jv-ui';
951
+ ```
952
+
953
+ | Input | Type | Default | Description |
954
+ | ------------------- | ------------------ | ----------- | ------------------------------------------- |
955
+ | `title` | `string` | — | App / brand title |
956
+ | `sidebarSubtitle` | `string` | `''` | Subtitle below brand |
957
+ | `brandIcon` | `string` | `'monitor'` | Brand Lucide icon |
958
+ | `navItems` | `JvNavItem[]` | `[]` | Navigation items (supports nested children) |
959
+ | `sidebarCollapsed` | `boolean` | `false` | Desktop sidebar collapsed state |
960
+ | `mobileSidebarOpen` | `boolean` | `false` | Mobile sidebar open/closed |
961
+ | `topbarTitle` | `string` | `''` | Topbar page title |
962
+ | `topbarSubtitle` | `string` | `''` | Topbar subtitle |
963
+ | `currentTheme` | `JvTheme` | `'light'` | Active theme value |
964
+ | `themeOptions` | `JvThemeOption[]` | `[]` | Theme selector options |
965
+ | `topbarActions` | `JvTopbarAction[]` | `[]` | Icon buttons in topbar |
966
+ | `showThemeSelector` | `boolean` | `true` | Show theme pills |
967
+
968
+ | Output | Description |
969
+ | ----------------------- | -------------------------------------------------------------- |
970
+ | `menuClick` | Hamburger button clicked — toggle mobile sidebar |
971
+ | `mobileClose` | Backdrop clicked or navigation selected — close mobile sidebar |
972
+ | `sidebarCollapseToggle` | Collapse toggle clicked — collapse/expand sidebar |
973
+ | `themeChange` | Theme pill clicked |
974
+ | `topbarActionClick` | Topbar action button clicked |
975
+
976
+ **Mobile behavior:** at viewports ≤ 900px the sidebar becomes a fixed overlay with slide-in animation (`transform: translateX`) and a semi-transparent backdrop. The sidebar emits `mobileClose` when the backdrop is clicked or a nav link is followed.
977
+
978
+ ### JvSidebar
979
+
980
+ | Input | Type | Default | Description |
981
+ | ------------ | ------------- | ---------------------- | --------------------- |
982
+ | `title` | `string` | — | Brand title |
983
+ | `subtitle` | `string` | `''` | Brand subtitle |
984
+ | `brandIcon` | `string` | `'monitor'` | Brand icon |
985
+ | `items` | `JvNavItem[]` | `[]` | Navigation items |
986
+ | `collapsed` | `boolean` | `false` | Collapse to icon-only |
987
+ | `mobileOpen` | `boolean` | `false` | Show on mobile |
988
+ | `ariaLabel` | `string` | `'Sidebar navigation'` | Accessible label |
989
+
990
+ | Output | Description |
991
+ | ---------------- | ------------------------------------------------ |
992
+ | `collapseToggle` | Collapse button clicked |
993
+ | `mobileClose` | Backdrop or nav item interaction — request close |
994
+
995
+ ## Responsive Design
996
+
997
+ The library includes basic responsive behavior:
998
+
999
+ - **Breakpoints** defined as CSS custom properties: `--jv-breakpoint-sm` (640px), `--jv-breakpoint-md` (768px), `--jv-breakpoint-lg` (1024px), `--jv-breakpoint-xl` (1280px)
1000
+ - **Dashboard shell** collapses to single column at ≤ 900px; sidebar becomes a slide-in overlay with backdrop
1001
+ - **Topbar** stacks vertically at ≤ 900px
1002
+ - **Grid** pagination and toolbar stack at ≤ 640px; table scrolls horizontally with `overflow-x: auto`
1003
+ - **Flex-wrap** is used extensively for natural overflow handling
1004
+ - **Dialog** and **Toast** constrain width with `min()` to never exceed the viewport
1005
+
1006
+ ## Services
1007
+
1008
+ | Service | Import Path | Description |
1009
+ | ----------------------- | ---------------------- | -------------------------------------------- |
1010
+ | `JvThemeService` | `@devjuliovilla/jv-ui` | Light / dark / high-contrast theme switching |
1011
+ | `JvTranslationService` | `@devjuliovilla/jv-ui` | Dictionary-based i18n (en/es) |
1012
+ | `JvToastService` | `@devjuliovilla/jv-ui` | Toast notification system |
1013
+ | `JvLoaderService` | `@devjuliovilla/jv-ui` | Full-screen loader with request counter |
1014
+ | `JvDialogService` | `@devjuliovilla/jv-ui` | Programmatic confirm dialogs |
1015
+ | `JvAnnouncementService` | `@devjuliovilla/jv-ui` | Screen-reader live-region announcements |
1016
+
1017
+ ## Accessibility
1018
+
1019
+ - WCAG 2.2 AA target
1020
+ - Keyboard navigation for all interactive components
1021
+ - Focus management with visible focus indicators
1022
+ - Screen reader announcements (loading, empty states, page changes)
1023
+ - `aria-sort` on sortable grid headers
1024
+ - `aria-selected` on selectable grid rows
1025
+ - `aria-label` and `aria-labelledby` on interactive controls
1026
+ - Supports `prefers-reduced-motion`
1027
+
1028
+ ## Requirements
1029
+
1030
+ - Angular 21.2+
1031
+ - TypeScript 5.9+
1032
+
1033
+ ## License
1034
+
1035
+ MIT