@devjuliovilla/jv-ui 1.16.0 → 1.18.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 +80 -16
- package/fesm2022/devjuliovilla-jv-ui.mjs +715 -367
- package/fesm2022/devjuliovilla-jv-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/devjuliovilla-jv-ui.d.ts +52 -12
package/README.md
CHANGED
|
@@ -974,20 +974,21 @@ This reads all SVG files from `lucide-static/icons` and produces `jv-icon-regist
|
|
|
974
974
|
import { JvDashboardShellComponent } from '@devjuliovilla/jv-ui';
|
|
975
975
|
```
|
|
976
976
|
|
|
977
|
-
| Input | Type
|
|
978
|
-
| ------------------- |
|
|
979
|
-
| `title` | `string`
|
|
980
|
-
| `
|
|
981
|
-
| `
|
|
982
|
-
| `
|
|
983
|
-
| `
|
|
984
|
-
| `
|
|
985
|
-
| `
|
|
986
|
-
| `
|
|
987
|
-
| `
|
|
988
|
-
| `
|
|
989
|
-
| `
|
|
990
|
-
| `
|
|
977
|
+
| Input | Type | Default | Description |
|
|
978
|
+
| ------------------- | ----------------------- | ----------- | ------------------------------------------- |
|
|
979
|
+
| `title` | `string` | — | App / brand title |
|
|
980
|
+
| `navigationMode` | `'sidebar' \| 'topbar'` | `'sidebar'` | Main navigation presentation |
|
|
981
|
+
| `sidebarSubtitle` | `string` | `''` | Subtitle below brand |
|
|
982
|
+
| `brandIcon` | `string` | `'monitor'` | Brand Lucide icon |
|
|
983
|
+
| `navItems` | `JvNavItem[]` | `[]` | Navigation items (supports nested children) |
|
|
984
|
+
| `sidebarCollapsed` | `boolean` | `false` | Desktop sidebar collapsed state |
|
|
985
|
+
| `mobileSidebarOpen` | `boolean` | `false` | Mobile sidebar open/closed |
|
|
986
|
+
| `topbarTitle` | `string` | `''` | Topbar page title |
|
|
987
|
+
| `topbarSubtitle` | `string` | `''` | Topbar subtitle |
|
|
988
|
+
| `currentTheme` | `JvTheme` | `'light'` | Active theme value |
|
|
989
|
+
| `themeOptions` | `JvThemeOption[]` | `[]` | Theme selector options |
|
|
990
|
+
| `topbarActions` | `JvTopbarAction[]` | `[]` | Icon buttons in topbar |
|
|
991
|
+
| `showThemeSelector` | `boolean` | `true` | Show theme pills |
|
|
991
992
|
|
|
992
993
|
| Output | Description |
|
|
993
994
|
| ----------------------- | -------------------------------------------------------------- |
|
|
@@ -997,7 +998,27 @@ import { JvDashboardShellComponent } from '@devjuliovilla/jv-ui';
|
|
|
997
998
|
| `themeChange` | Theme pill clicked |
|
|
998
999
|
| `topbarActionClick` | Topbar action button clicked |
|
|
999
1000
|
|
|
1000
|
-
**Mobile behavior:** at viewports ≤ 900px the
|
|
1001
|
+
**Mobile behavior:** at viewports ≤ 900px the selected navigation becomes a fixed overlay with slide-in animation (`transform: translateX`) and a semi-transparent backdrop. The selected navigation emits `mobileClose` when the backdrop is clicked or a nav link is followed.
|
|
1002
|
+
|
|
1003
|
+
Use `navigationMode="topbar"` to render the brand, expandable navigation sections, and right-side actions in a horizontal menu. The default `sidebar` mode preserves the desktop sidebar and contextual topbar composition.
|
|
1004
|
+
|
|
1005
|
+
#### Switch an existing shell to topbar
|
|
1006
|
+
|
|
1007
|
+
The navigation data does not change. Keep the same `navItems` and set the mode explicitly:
|
|
1008
|
+
|
|
1009
|
+
```html
|
|
1010
|
+
<jv-dashboard-shell
|
|
1011
|
+
title="Admin"
|
|
1012
|
+
navigationMode="topbar"
|
|
1013
|
+
[navItems]="navItems"
|
|
1014
|
+
[topbarActions]="topbarActions"
|
|
1015
|
+
(topbarActionClick)="onTopbarAction($event)"
|
|
1016
|
+
>
|
|
1017
|
+
<router-outlet />
|
|
1018
|
+
</jv-dashboard-shell>
|
|
1019
|
+
```
|
|
1020
|
+
|
|
1021
|
+
This renders one navigation surface at a time. `sidebar` remains the default, so existing shell integrations do not need to change.
|
|
1001
1022
|
|
|
1002
1023
|
### JvSidebar
|
|
1003
1024
|
|
|
@@ -1016,13 +1037,55 @@ import { JvDashboardShellComponent } from '@devjuliovilla/jv-ui';
|
|
|
1016
1037
|
| `collapseToggle` | Collapse button clicked |
|
|
1017
1038
|
| `mobileClose` | Backdrop or nav item interaction — request close |
|
|
1018
1039
|
|
|
1040
|
+
### JvTopbarMenu
|
|
1041
|
+
|
|
1042
|
+
Use this component directly when the application has its own shell instead of `JvDashboardShell`:
|
|
1043
|
+
|
|
1044
|
+
```typescript
|
|
1045
|
+
import { JvTopbarMenuComponent } from '@devjuliovilla/jv-ui';
|
|
1046
|
+
```
|
|
1047
|
+
|
|
1048
|
+
```html
|
|
1049
|
+
<jv-topbar-menu
|
|
1050
|
+
title="Admin"
|
|
1051
|
+
[items]="navItems"
|
|
1052
|
+
[actions]="topbarActions"
|
|
1053
|
+
[mobileOpen]="mobileMenuOpen"
|
|
1054
|
+
(menuClick)="mobileMenuOpen = !mobileMenuOpen"
|
|
1055
|
+
(mobileClose)="mobileMenuOpen = false"
|
|
1056
|
+
(actionClick)="onTopbarAction($event)"
|
|
1057
|
+
>
|
|
1058
|
+
</jv-topbar-menu>
|
|
1059
|
+
```
|
|
1060
|
+
|
|
1061
|
+
| Input | Type | Default | Description |
|
|
1062
|
+
| ------------------- | ------------------ | ----------- | ------------------------------------------ |
|
|
1063
|
+
| `title` | `string` | — | Brand title |
|
|
1064
|
+
| `subtitle` | `string` | `''` | Brand subtitle |
|
|
1065
|
+
| `brandIcon` | `string` | `'monitor'` | Brand icon |
|
|
1066
|
+
| `items` | `JvNavItem[]` | `[]` | Horizontal navigation with nested sections |
|
|
1067
|
+
| `mobileOpen` | `boolean` | `false` | Mobile navigation panel state |
|
|
1068
|
+
| `currentTheme` | `JvTheme` | `'light'` | Active theme value |
|
|
1069
|
+
| `themeOptions` | `JvThemeOption[]` | `[]` | Theme selector options |
|
|
1070
|
+
| `actions` | `JvTopbarAction[]` | `[]` | Right-side action buttons |
|
|
1071
|
+
| `showThemeSelector` | `boolean` | `true` | Show theme pills |
|
|
1072
|
+
|
|
1073
|
+
| Output | Description |
|
|
1074
|
+
| ------------- | ------------------------------------------ |
|
|
1075
|
+
| `menuClick` | Mobile menu button clicked |
|
|
1076
|
+
| `mobileClose` | Backdrop or navigation item requests close |
|
|
1077
|
+
| `themeChange` | Theme option clicked |
|
|
1078
|
+
| `actionClick` | Right-side action clicked; emits its `id` |
|
|
1079
|
+
|
|
1080
|
+
The topbar keeps one expandable section open at a time. Selecting a child route closes its dropdown. At mobile widths, the navigation becomes a slide-in panel.
|
|
1081
|
+
|
|
1019
1082
|
## Responsive Design
|
|
1020
1083
|
|
|
1021
1084
|
The library includes basic responsive behavior:
|
|
1022
1085
|
|
|
1023
1086
|
- **Breakpoints** defined as CSS custom properties: `--jv-breakpoint-sm` (640px), `--jv-breakpoint-md` (768px), `--jv-breakpoint-lg` (1024px), `--jv-breakpoint-xl` (1280px)
|
|
1024
1087
|
- **Dashboard shell** collapses to single column at ≤ 900px; sidebar becomes a slide-in overlay with backdrop
|
|
1025
|
-
- **Topbar**
|
|
1088
|
+
- **Topbar menu** keeps the brand and actions visible and changes navigation to a slide-in panel at ≤ 900px
|
|
1026
1089
|
- **Grid** pagination and toolbar stack at ≤ 640px; table scrolls horizontally with `overflow-x: auto`
|
|
1027
1090
|
- **Flex-wrap** is used extensively for natural overflow handling
|
|
1028
1091
|
- **Dialog** and **Toast** constrain width with `min()` to never exceed the viewport
|
|
@@ -1047,6 +1110,7 @@ The library includes basic responsive behavior:
|
|
|
1047
1110
|
- `aria-sort` on sortable grid headers
|
|
1048
1111
|
- `aria-selected` on selectable grid rows
|
|
1049
1112
|
- `aria-label` and `aria-labelledby` on interactive controls
|
|
1113
|
+
- Icon actions expose a visible text label alongside the icon and provide a hover/focus tooltip for screen readers
|
|
1050
1114
|
- Supports `prefers-reduced-motion`
|
|
1051
1115
|
|
|
1052
1116
|
## Requirements
|