vlite3 1.5.11 → 1.5.13

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.
Files changed (132) hide show
  1. package/README.md +20 -8
  2. package/components/Accordion/AccordionContent.vue.js +2 -2
  3. package/components/CategoryManager/CategoryManager2.vue.js +1 -1
  4. package/components/CommandPalette/CommandPaletteContent2.vue.js +1 -1
  5. package/components/CommandPalette/{CommandPaletteItem2.vue.js → CommandPaletteItem.vue.js} +1 -1
  6. package/components/Dropdown/DropdownMenu.vue.js +1 -1
  7. package/components/Form/{AccordionView.vue.js → AccordionView2.vue.js} +2 -2
  8. package/components/Form/Form.vue.js +2 -2
  9. package/components/Form/index2.vue.js +1 -1
  10. package/components/NavbarCommandPalette.vue.js +1 -1
  11. package/components/PanZoomViewport/PanZoomViewport.vue.d.ts +7 -7
  12. package/components/PanZoomViewport/PanZoomViewport.vue.js +1 -1
  13. package/components/Screen/ScreenFilter.vue.js +1 -1
  14. package/components/Splitter/Splitter.vue.d.ts +7 -0
  15. package/components/Splitter/Splitter.vue.js +33 -29
  16. package/components/Tabes/Tabes.vue.js +2 -2
  17. package/docs/README.md +17 -0
  18. package/docs/all-components.md +89 -0
  19. package/docs/component-index.md +313 -0
  20. package/docs/components/accordion.md +52 -0
  21. package/docs/components/alert.md +34 -0
  22. package/docs/components/app-shell.md +371 -0
  23. package/docs/components/async-select.md +264 -0
  24. package/docs/components/attachments-list.md +231 -0
  25. package/docs/components/avatar-group.md +74 -0
  26. package/docs/components/avatar-uploader.md +61 -0
  27. package/docs/components/avatar.md +28 -0
  28. package/docs/components/badge.md +81 -0
  29. package/docs/components/barcode.md +42 -0
  30. package/docs/components/beacon.md +29 -0
  31. package/docs/components/breadcrumb.md +317 -0
  32. package/docs/components/button-group.md +35 -0
  33. package/docs/components/button.md +86 -0
  34. package/docs/components/calendar.md +95 -0
  35. package/docs/components/carousel.md +122 -0
  36. package/docs/components/cart.md +533 -0
  37. package/docs/components/category-manager.md +269 -0
  38. package/docs/components/category-menu.md +251 -0
  39. package/docs/components/charts.md +1456 -0
  40. package/docs/components/chat.md +330 -0
  41. package/docs/components/checkbox.md +31 -0
  42. package/docs/components/chip.md +137 -0
  43. package/docs/components/choice-box.md +40 -0
  44. package/docs/components/clipboard.md +105 -0
  45. package/docs/components/clock.md +70 -0
  46. package/docs/components/color-picker.md +82 -0
  47. package/docs/components/command-palette.md +214 -0
  48. package/docs/components/comment-thread.md +171 -0
  49. package/docs/components/confirmation-modal.md +50 -0
  50. package/docs/components/custom-fields-display.md +94 -0
  51. package/docs/components/custom-fields.md +97 -0
  52. package/docs/components/data-list.md +93 -0
  53. package/docs/components/data-table.md +922 -0
  54. package/docs/components/date-picker.md +58 -0
  55. package/docs/components/date-range-picker.md +24 -0
  56. package/docs/components/date-time.md +104 -0
  57. package/docs/components/dropdown.md +740 -0
  58. package/docs/components/empty.md +100 -0
  59. package/docs/components/export-data.md +320 -0
  60. package/docs/components/file-picker.md +83 -0
  61. package/docs/components/file-preview.md +42 -0
  62. package/docs/components/file-tree.md +144 -0
  63. package/docs/components/footer.md +251 -0
  64. package/docs/components/forms.md +776 -0
  65. package/docs/components/gantt-chart.md +767 -0
  66. package/docs/components/google-login.md +67 -0
  67. package/docs/components/google-map.md +128 -0
  68. package/docs/components/heatmap.md +80 -0
  69. package/docs/components/icon-picker.md +58 -0
  70. package/docs/components/icon.md +176 -0
  71. package/docs/components/image-comparison.md +51 -0
  72. package/docs/components/image-magnifier.md +26 -0
  73. package/docs/components/import-data.md +521 -0
  74. package/docs/components/input.md +58 -0
  75. package/docs/components/invoice.md +339 -0
  76. package/docs/components/kanban.md +302 -0
  77. package/docs/components/label.md +25 -0
  78. package/docs/components/list.md +419 -0
  79. package/docs/components/masonry.md +55 -0
  80. package/docs/components/modal.md +133 -0
  81. package/docs/components/multi-select.md +54 -0
  82. package/docs/components/navbar.md +403 -0
  83. package/docs/components/number-input.md +41 -0
  84. package/docs/components/otp-input.md +68 -0
  85. package/docs/components/pagination.md +83 -0
  86. package/docs/components/pan-zoom-viewport.md +245 -0
  87. package/docs/components/permission-editor.md +322 -0
  88. package/docs/components/persona.md +56 -0
  89. package/docs/components/price.md +106 -0
  90. package/docs/components/pricing-plan.md +68 -0
  91. package/docs/components/progress-bar.md +53 -0
  92. package/docs/components/qr-code.md +59 -0
  93. package/docs/components/rating.md +59 -0
  94. package/docs/components/rich-text-editor.md +210 -0
  95. package/docs/components/scale-generator.md +101 -0
  96. package/docs/components/screen.md +208 -0
  97. package/docs/components/seo-provider.md +189 -0
  98. package/docs/components/side-panel.md +94 -0
  99. package/docs/components/sidebar-menu.md +422 -0
  100. package/docs/components/skeleton.md +115 -0
  101. package/docs/components/slider.md +48 -0
  102. package/docs/components/spinner.md +27 -0
  103. package/docs/components/splitter.md +97 -0
  104. package/docs/components/stats.md +234 -0
  105. package/docs/components/status-chip.md +232 -0
  106. package/docs/components/switch.md +23 -0
  107. package/docs/components/tabs.md +335 -0
  108. package/docs/components/tag-input.md +55 -0
  109. package/docs/components/textarea.md +31 -0
  110. package/docs/components/theme-provider.md +130 -0
  111. package/docs/components/theme-toggle.md +36 -0
  112. package/docs/components/thumbnail-selector.md +186 -0
  113. package/docs/components/timeline.md +225 -0
  114. package/docs/components/toast-notification.md +89 -0
  115. package/docs/components/tooltip.md +31 -0
  116. package/docs/components/workbook.md +102 -0
  117. package/docs/composables/use-theme.md +59 -0
  118. package/docs/getting-started/setup.md +176 -0
  119. package/docs/guides/draggable.md +211 -0
  120. package/docs/guides/internationalization.md +281 -0
  121. package/docs/guides/performance.md +118 -0
  122. package/docs/guides/testing-forms.md +154 -0
  123. package/docs/guides/testing-overlays.md +131 -0
  124. package/docs/guides/theming.md +124 -0
  125. package/docs/utilities/search.md +580 -0
  126. package/docs/utilities/utilities.md +371 -0
  127. package/docs-manifest.json +339 -0
  128. package/package.json +6 -15
  129. package/scripts/generate-docs-manifest.js +207 -0
  130. package/scripts/sync-docs.js +754 -0
  131. package/style.css +1 -1
  132. /package/components/Dropdown/{DropdownMenu2.vue.js → DropdownMenu3.vue.js} +0 -0
@@ -0,0 +1,371 @@
1
+ # AppShell
2
+
3
+ **Import:** `import { AppShell } from 'vlite3'`
4
+
5
+ The `AppShell` component is a high-level layout orchestrator designed to serve as the foundational structure of your web application. It handles the dynamic arrangement of sidebars, main content areas, headers, and mobile drawers (SidePanel) gracefully.
6
+
7
+ By using `AppShell`, you separate the concern of *where* your UI elements live from *what* they are, utilizing semantic slots.
8
+
9
+ ---
10
+
11
+ ## Props
12
+
13
+ | Prop | Type | Default | Description |
14
+ | :------------------- | :------------------------------------------------------ | :---------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
15
+ | `layoutMode` | `'variant1' \| 'variant2' \| 'variant3' \| 'variant4' \| 'variant5' \| 'variant6'` | `'variant1'` | Controls the layout structure. <br>• `variant1`: Sidebar spans full height... <br>• `variant6`: Slot-based storefront header. |
16
+ | `variant` | `'sidebar' \| 'header'` | `'sidebar'` | The root layout mode behavior. `'sidebar'` provides left-nav layout, `'header'` provides top-nav structures. |
17
+ | `position` | `'fixed' \| 'sticky' \| 'relative' \| 'absolute'` | `'sticky'` | Controls the CSS position of the layout components (header/sidebar). |
18
+ | `glass` | `boolean` | `false` | Enables an Apple-like frosted glass blur effect (`backdrop-blur`) on the header and floating elements. |
19
+ | `border` | `boolean` | `true` | Enables separating borders on the layout regions. |
20
+ | `floating` | `boolean` | `false` | Adds margins and rounding to create a "floating" app shell visual effect. |
21
+ | `height` | `string` | `'h-16'` | Tailwind class to dictate the height of the top header bar. |
22
+ | `compact` | `boolean` | `false` | Enables compact/collapsed mode for the main sidebar. Passed via provide/inject to child `SidebarMenu` components. |
23
+ | `hideSidebar` | `boolean` | `false` | Hides the sidebar (using `v-show`). Keeps `renderNestedTabs` functioning even if hidden. |
24
+ | `hideHeader` | `boolean` | `false` | Hides the header (using `v-show`). Keeps `renderNestedTabs` functioning even if hidden. |
25
+ | `sidebarToggle` | `boolean` | `false` | Enables the desktop sidebar toggle feature. Renders a toggle if configured via `#header`. Preference is persisted in `localStorage`. |
26
+ | `renderNestedTabs` | `boolean` | `false` | When `true`, clicking a top-level sidebar item with children extracts those children and renders them as a `NavbarTabs` bar at the top of `#main`. |
27
+ | `mobileBreakpoint` | `'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | The Tailwind breakpoint at which the layout switches from mobile (hamburger drawer) to the full desktop sidebar layout. |
28
+ | `contentClass` | `string` | `''` | Additional CSS classes applied to the main scrollable area. |
29
+ | `rightClass` | `string` | `''` | Additional CSS classes applied to the bottom-pinned footer area (`#sidebar-footer`) or right header section. |
30
+ | `menuClass` | `string` | `''` | Additional CSS classes applied to the menu wrapper. |
31
+ | `mobileTriggerClass` | `string` | `''` | Additional CSS classes applied to the mobile hamburger menu toggle button. |
32
+ | `mobileMenuVariant` | `'sidepanel' \| ...` | `'sidepanel'` | Determines the rendering strategy for the mobile menu container. |
33
+ | `breadcrumb` | `boolean` | `false` | When `true`, auto-generates a `Breadcrumb` using current route data. |
34
+ | `breadcrumbPosition` | `'header' \| 'main'` | `'header'` | Where to render the breadcrumb automatically: inside the scoped header slot or auto-injected above the main content. |
35
+ | `breadcrumbVariant` | `BreadcrumbVariant` | `'default'` | Visual variant forwarded to the internal `<Breadcrumb>` component. |
36
+ | `breadcrumbSeparator`| `BreadcrumbSeparator` | `'chevron'` | Separator style (`'chevron'`, `'slash'`, etc.) forwarded to `<Breadcrumb>`. |
37
+ | `breadcrumbSize` | `BreadcrumbSize` | `'sm'` | Size forwarded to `<Breadcrumb>`. |
38
+ | `breadcrumbHomeIcon` | `string` | `'lucide:home'` | Icon name for the root breadcrumb link. |
39
+ | `breadcrumbClass` | `string` | `''` | Additional CSS classes for the breadcrumb wrapper. |
40
+ | `breadcrumbLabels` | `Record<string, string>` | `—` | Override auto-generated route labels by path, e.g. `{ '/settings': 'Preferences' }`. |
41
+ | `categoryRoutePrefix`| `string` | `''` | Storefront helper. Provides a category route prefix to nested `CategoryMenu` instances and exposes it to the `#categories` slot. |
42
+
43
+ ---
44
+
45
+ ## Slots
46
+
47
+ The `AppShell` uses an advanced slot architecture. You declare the elements for your desktop layout, and they are automatically carried over to your mobile drawer—with the option to independently override the mobile drawer content if desired.
48
+
49
+ ### App Structure Slots
50
+ | Slot | Description | Scoped Props |
51
+ | :---------------- | :------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------- |
52
+ | `#header` | Renders the top application header. | `{ isOpen, toggle, sidebarVisible, toggleSidebar, breadcrumbItems, pageTitle }` |
53
+ | `#main` | Renders the main content area (e.g., your `<RouterView>`). | — |
54
+
55
+ ### Desktop Sidebar Slots
56
+ | Slot | Description | Scoped Props |
57
+ | :---------------- | :------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------- |
58
+ | `#sidebar-header` | The top section of the desktop sidebar (e.g., Branding or Logo). | — |
59
+ | `#sidebar` | Primary scrollable content area of the desktop sidebar (typically a `<SidebarMenu>`). | — |
60
+ | `#sidebar-footer` | Bottom-pinned footer of the desktop sidebar (e.g. Account Switcher, Logout, Theme Toggles). | — |
61
+
62
+ ### Mobile Drawer (SidePanel) Slots
63
+ *By default, if you don't define these mobile slots, they perfectly mirror their desktop counterparts (`#sidebar-header`, `#sidebar`, `#sidebar-footer`). Use these only if your mobile menu needs a highly different structural format.*
64
+
65
+ | Slot | Description |
66
+ | :---------------- | :------------------------------------------------------------------------------------------------------------------------------------- |
67
+ | `#mobile-sidebar-header` | Overrides `#sidebar-header` in mobile view. |
68
+ | `#mobile-sidebar` | Overrides `#sidebar` in mobile view. |
69
+ | `#mobile-sidebar-footer` | Overrides `#sidebar-footer` in mobile view. |
70
+
71
+ ### Storefront Layout Slots (`layout-mode="variant6"`)
72
+ The storefront layout provides structural regions for maximum flexibility. Use standard Tailwind classes (e.g., `hidden md:flex`) within these slots to handle responsive visibility.
73
+
74
+ | Slot | Description |
75
+ | :---------------- | :------------------------------------------------------------------------------------------------------------------------------------- |
76
+ | `#announcement` | Optional full-width bar above the storefront header. |
77
+ | `#mobile-trigger` | Overrides the mobile drawer trigger. Scoped with `{ isOpen, toggle }`. |
78
+ | `#left` | Left region of the main header (typically used for Brand/Logo). |
79
+ | `#center` | Center region of the main header (typically used for desktop navigation). |
80
+ | `#right` | Right region of the main header (typically used for search, cart, and profile actions). |
81
+ | `#mobile-bottom` | An optional full-width row underneath the main header, visible on mobile (typically used for mobile search inputs). |
82
+ | `#categories` | Desktop category/navigation rail below the main header row. Scoped with `{ categoryRoutePrefix }`. |
83
+ | `#mobile-sidebar-header`| Top locked section of the mobile sidepanel (typically used for the mobile logo). |
84
+ | `#mobile-sidebar` | Scrollable body of the mobile sidepanel (typically used for mobile navigation and categories). Scoped with `{ categoryRoutePrefix }`. |
85
+ | `#mobile-sidebar-footer`| Bottom locked section of the mobile sidepanel (typically used for locale or login buttons). |
86
+ | `#footer` | Optional footer below the scrollable main area. |
87
+
88
+
89
+ ### Scoped Props in `#header`
90
+
91
+ When using the `<template #header>` slot, you are granted several powerful scoped properties to build your own custom functional top-bar:
92
+
93
+ | Prop | Type | Description |
94
+ | :--------------- | :----------- | :------------------------------------------------------------------ |
95
+ | `isOpen` | `boolean` | Current state of the mobile side drawer. |
96
+ | `toggle` | `() => void` | Toggles the mobile side drawer open/closed. Attach this to a hamburger icon! |
97
+ | `sidebarVisible` | `boolean` | Whether the desktop sidebar is currently visible (requires `sidebarToggle`). |
98
+ | `toggleSidebar` | `() => void` | Show/hide the desktop sidebar dynamically. |
99
+ | `breadcrumbItems`| `BreadcrumbItem[]` | Auto-generated breadcrumb array from the current route. To be fed into `<Breadcrumb>`. |
100
+ | `pageTitle` | `string` | The page title inferred automatically from `route.meta.title` or `route.name`. |
101
+
102
+ ---
103
+
104
+ ## Layout Modes Overview
105
+
106
+ The `AppShell` offers six uniquely distinct orchestrations for your application via the `layout-mode` prop.
107
+
108
+ ### 1. `variant1` (Default)
109
+ The sidebar spans the entire full height of the viewport on the left. The `header` and `main` content are stacked vertically on the right side.
110
+
111
+ ### 2. `variant4`
112
+ The `header` spans the full width of the screen at the very top. The `sidebar` and `main` content are grouped together beneath the header.
113
+
114
+ ### 3. `variant2`
115
+ Creates a sophisticated "floating panel" aesthetic. The primary app wrapper receives a muted tone color, while the sidebar, header, and main content fields are distinct, rounded, white cards separated by subtle gaps and styling. Ideal for modern SaaS apps.
116
+
117
+ ### 4. `variant3`
118
+ A minimalist floating sidebar that behaves similarly to a macOS dock. The sidebar is vertically centered, and dynamically bounds its height only to the content placed within it. Highly suited for compact application navigation.
119
+
120
+ ### 5. `variant5`
121
+ The sidebar is flush against the left, top, and bottom edges of the screen with no gaps or rounded corners. The header and main content sit to the right of the sidebar inside a floating, rounded card container. This creates a premium "shell" aesthetic where the sidebar acts as a solid anchor while the content area feels modern and elevated. Supports both expanded and compact sidebar modes.
122
+
123
+ ### 6. `variant6`
124
+ A slot-based storefront layout for commerce, marketplace, and product-led experiences. It provides an announcement region, responsive header grid, centered logo region, desktop navigation, search, right-side actions, category rail, mobile drawer, main content, and footer slots. The shell does not hardcode commerce-specific content such as carts, account buttons, category data, or search state.
125
+
126
+ When `category-route-prefix` is set, nested `CategoryMenu` components can inherit it and generate Vue Router category links from raw category data.
127
+
128
+ ```vue
129
+ <AppShell layout-mode="variant6" category-route-prefix="/products">
130
+ <template #categories>
131
+ <CategoryMenu :items="categories" variant="mega" />
132
+ </template>
133
+ </AppShell>
134
+ ```
135
+
136
+ ---
137
+
138
+ ## Usage Example
139
+
140
+ ### Standard AppShell Implementation
141
+
142
+ ```vue
143
+ <AppShell variant="sidebar" layout-mode="variant2">
144
+ <template #sidebar-header>
145
+ <div class="font-bold text-lg p-2">Vlite3 App</div>
146
+ </template>
147
+
148
+ <template #sidebar>
149
+ <SidebarMenu :items="menuItems" />
150
+ </template>
151
+
152
+ <template #sidebar-footer>
153
+ <div class="p-2 border-t">
154
+ <Button variant="ghost" class="w-full justify-start" icon="lucide:log-out">
155
+ Logout
156
+ </Button>
157
+ </div>
158
+ </template>
159
+
160
+ <template #header="{ toggle, pageTitle }">
161
+ <div class="h-16 border-b bg-white flex items-center justify-between px-6 w-full">
162
+ <div class="flex items-center gap-4">
163
+ <button class="md:hidden" @click="toggle">
164
+ <Icon icon="lucide:menu" />
165
+ </button>
166
+ <span class="font-bold text-lg">{{ pageTitle || 'Overview' }}</span>
167
+ </div>
168
+ <Avatar fallback="JD" />
169
+ </div>
170
+ </template>
171
+
172
+ <template #main>
173
+ <div class="p-6">
174
+ <RouterView />
175
+ </div>
176
+ </template>
177
+ </AppShell>
178
+ ```
179
+
180
+ ### Advanced Usage with Breadcrumbs and Mobile Overrides
181
+
182
+ ```vue
183
+ <AppShell
184
+ layout-mode="variant1"
185
+ mobileBreakpoint="lg"
186
+ breadcrumb
187
+ >
188
+ <template #sidebar>
189
+ <SidebarMenu :items="desktopItems" />
190
+ </template>
191
+
192
+ <template #mobile-sidebar>
193
+ <div class="text-xs text-muted-foreground p-2">Mobile Menu</div>
194
+ <SidebarMenu :items="mobileOptimizedItems" />
195
+ </template>
196
+
197
+ <template #header="{ toggle, breadcrumbItems }">
198
+ <div class="h-14 border-b flex items-center px-4 w-full gap-4">
199
+ <button class="lg:hidden" @click="toggle">
200
+ <Icon icon="lucide:menu" />
201
+ </button>
202
+
203
+ <Breadcrumb
204
+ v-if="breadcrumbItems.length > 1"
205
+ :items="breadcrumbItems"
206
+ separator="slash"
207
+ />
208
+ </div>
209
+ </template>
210
+
211
+ <template #main>
212
+ <RouterView />
213
+ </template>
214
+ </AppShell>
215
+ ```
216
+
217
+ ### Storefront Shell Usage (`variant6`)
218
+
219
+ The Storefront variant provides semantic slots (`#left`, `#center`, `#right`, `#categories`, `#announcement`, etc.) allowing you to quickly build robust consumer e-commerce headers while relying on standard Tailwind CSS classes to manage visibility between breakpoints.
220
+
221
+ ```vue
222
+ <AppShell
223
+ variant="header"
224
+ layout-mode="variant6"
225
+ category-route-prefix="/collections"
226
+ mobile-breakpoint="md"
227
+ >
228
+ <!-- 1. Top Announcement Bar -->
229
+ <template #announcement>
230
+ <div class="bg-foreground text-background text-center text-xs py-1.5 px-4 font-medium">
231
+ Free shipping on orders over $150
232
+ </div>
233
+ </template>
234
+
235
+ <!-- 2. Header Left (Logo/Brand) -->
236
+ <template #left>
237
+ <div class="flex items-center gap-2">
238
+ <span class="w-8 h-8 rounded-md bg-emerald-600 text-white flex items-center justify-center font-bold">M</span>
239
+ <span class="font-black text-lg">Mellow</span>
240
+ </div>
241
+ </template>
242
+
243
+ <!-- 3. Header Center (Desktop Nav) -->
244
+ <template #center>
245
+ <nav class="hidden md:flex items-center gap-2">
246
+ <Button variant="ghost" size="sm">Shop</Button>
247
+ <Button variant="ghost" size="sm">Rooms</Button>
248
+ <Button variant="ghost" size="sm">Journal</Button>
249
+ </nav>
250
+ </template>
251
+
252
+ <!-- 4. Header Right (Search, Cart, Profile) -->
253
+ <template #right>
254
+ <div class="flex items-center gap-2">
255
+ <div class="hidden lg:block">
256
+ <Input placeholder="Search" icon-left="lucide:search" size="sm" />
257
+ </div>
258
+ <Button variant="ghost" size="icon"><Icon icon="lucide:user" /></Button>
259
+ <Button variant="ghost" size="icon" class="relative">
260
+ <Icon icon="lucide:shopping-bag" />
261
+ <span class="absolute top-0 right-0 bg-emerald-600 text-white text-[10px] w-4 h-4 rounded-full flex items-center justify-center">3</span>
262
+ </Button>
263
+ </div>
264
+ </template>
265
+
266
+ <!-- 5. Desktop Mega Menu Categories -->
267
+ <template #categories>
268
+ <!-- The AppShell provides 'categoryRoutePrefix' via injection to CategoryMenu -->
269
+ <CategoryMenu :items="categories" variant="mega" />
270
+ </template>
271
+
272
+ <!-- 6. Mobile Sidebar Overrides -->
273
+ <template #mobile-sidebar-header>
274
+ <div class="font-bold text-lg flex items-center gap-2">
275
+ <span class="w-6 h-6 rounded bg-emerald-600 text-white text-xs flex items-center justify-center">M</span>
276
+ Mellow
277
+ </div>
278
+ </template>
279
+
280
+ <template #mobile-sidebar>
281
+ <div class="space-y-2 mb-4">
282
+ <Button variant="ghost" class="w-full justify-start text-base">Shop</Button>
283
+ <Button variant="ghost" class="w-full justify-start text-base">Rooms</Button>
284
+ </div>
285
+ <div class="pt-4 border-t border-border">
286
+ <div class="text-xs font-semibold text-muted-foreground uppercase tracking-wider mb-2 px-3">Categories</div>
287
+ <CategoryMenu :items="categories" variant="sidebar" />
288
+ </div>
289
+ </template>
290
+
291
+ <!-- 7. Main scrollable content -->
292
+ <template #main>
293
+ <div class="min-h-full bg-slate-50">
294
+ <RouterView />
295
+ </div>
296
+ </template>
297
+
298
+ <!-- 8. Footer -->
299
+ <template #footer>
300
+ <div class="p-4 text-center text-xs text-muted-foreground border-t bg-background">
301
+ © 2026 Mellow Inc. All rights reserved.
302
+ </div>
303
+ </template>
304
+ </AppShell>
305
+ ```
306
+
307
+ ### Immersive / Transparent Header Usage
308
+
309
+ By leveraging the `position="absolute"` prop alongside a dynamic `:class` and a scroll observer, you can create an immersive layout where the header floats transparently over a cinematic hero image, becoming solid only when the user scrolls down past a certain threshold.
310
+
311
+ ```vue
312
+ <script setup lang="ts">
313
+ import { ref } from 'vue'
314
+ import { useIntersectionObserver } from '@vueuse/core'
315
+
316
+ const isScrolled = ref(false)
317
+ const scrollTarget = ref(null)
318
+
319
+ // When the invisible 50px tall target leaves the viewport, the header becomes solid.
320
+ useIntersectionObserver(
321
+ scrollTarget,
322
+ ([{ isIntersecting }]) => {
323
+ isScrolled.value = !isIntersecting
324
+ },
325
+ { threshold: 0 }
326
+ )
327
+ </script>
328
+
329
+ <template>
330
+ <AppShell
331
+ variant="header"
332
+ layout-mode="variant6"
333
+ position="absolute"
334
+ :border="false"
335
+ :class="`text-foreground transition-colors duration-300 ${isScrolled ? 'bg-background border-b shadow-sm' : 'bg-transparent border-b border-white/10 text-white'}`"
336
+ >
337
+ <!-- Header Logo -->
338
+ <template #left>
339
+ <div class="font-serif text-2xl tracking-widest">LUXE</div>
340
+ </template>
341
+
342
+ <template #main>
343
+ <!-- Invisible target at the very top to detect scrolling -->
344
+ <div ref="scrollTarget" class="absolute top-0 start-0 w-full h-[50px] pointer-events-none"></div>
345
+
346
+ <!-- Full-bleed cinematic hero section -->
347
+ <section class="h-[80vh] flex items-center justify-center relative overflow-hidden bg-zinc-950">
348
+ <img src="hero-image.jpg" class="absolute inset-0 w-full h-full object-cover opacity-60" />
349
+ <h1 class="relative z-10 text-white text-5xl">New Collection</h1>
350
+ </section>
351
+
352
+ <!-- Content grid that pushes scroll -->
353
+ <section class="p-8 h-screen bg-background">
354
+ <!-- Products... -->
355
+ </section>
356
+ </template>
357
+ </AppShell>
358
+ </template>
359
+ ```
360
+
361
+ ---
362
+
363
+ ## RTL
364
+
365
+ Set `dir="rtl"` on `html` (or a wrapping ancestor). AppShell then:
366
+
367
+ - Places the desktop sidebar on **inline-start** (right in RTL)
368
+ - Uses logical borders (`border-e`) and slide transforms that originate from the start edge
369
+ - Opens the mobile `SidePanel` on the start side (`position="left"` maps to inline-start via logical insets)
370
+
371
+ Slot names `#left` / `#right` keep their API names but align as start/end regions under `dir`.
@@ -0,0 +1,264 @@
1
+ # AsyncSelect (Async Dropdowns)
2
+
3
+ **Import:** `import { createAsyncSelect } from 'vlite3'`
4
+
5
+ Welcome to `AsyncSelect`! If you have a dropdown that needs to load data from your database (like a list of thousands of Customers or Products), standard dropdowns will slow down your app.
6
+
7
+ `AsyncSelect` solves this by creating a smart dropdown that automatically handles:
8
+
9
+ - **Pagination:** Only loads a few items at a time (infinite scroll).
10
+ - **Search:** Searches your database instantly as the user types.
11
+ - **Hydration:** Automatically fetches the correct display name if your form is initialized with just an ID.
12
+
13
+ ---
14
+
15
+ ## 🛠️ Step 1: Prepare Your Data Source (GraphQL Composable)
16
+
17
+ Before creating the select component, you need a GraphQL query composable. `AsyncSelect` expects your composable to accept `pagination` and `search` variables to work automatically.
18
+
19
+ Here is an example of what your generated composable should look like to be compatible:
20
+
21
+ ```ts
22
+ /**
23
+ * __useGetCrmCustomersQuery__
24
+ *
25
+ * @example
26
+ * const { result, loading, error, refetch } = useGetCrmCustomersQuery({
27
+ * pagination: { page: 1, limit: 20 },
28
+ * search: 'John', // AsyncSelect updates this automatically when the user types
29
+ * sort: { field: 'createdAt', order: 'DESC' },
30
+ * filter: { status: 'ACTIVE' } // You can pass dynamic filters later
31
+ * });
32
+ */
33
+ ```
34
+
35
+ ---
36
+
37
+ ## 🏗️ Step 2: Create Your Reusable Component
38
+
39
+ Instead of writing complex logic every time you need a Customer dropdown, you create it **once** using the `createAsyncSelect` factory.
40
+
41
+ Create a file (e.g., `Selects.ts`) and define your dropdowns:
42
+
43
+ ```ts
44
+ // src/components/Selects.ts
45
+ import { createAsyncSelect } from 'vlite3'
46
+ import { useGetCrmCustomersQuery } from '@/graphql'
47
+
48
+ export const SelectCustomer = createAsyncSelect({
49
+ name: 'SelectCustomer', // The name for Vue DevTools
50
+ useQuery: useGetCrmCustomersQuery, // Your generated GraphQL hook
51
+ queryName: 'getCrmCustomers', // The exact root key returned by your GraphQL response
52
+ labelKey: 'name', // Which database field to show as the main text
53
+ descriptionKey: 'email', // (Optional) Smaller text to display below the name
54
+ iconKey: 'profilePicture', // (Optional) Avatar URL or icon string
55
+ })
56
+ ```
57
+
58
+ 🎉 That's it! You now have a fully functional `<SelectCustomer />` component that you can reuse anywhere in your project.
59
+
60
+ ---
61
+
62
+ ## 🚀 Step 3: Define Your Form Schema
63
+
64
+ You can now drop `SelectCustomer` directly into any `vlite3` Form Schema. The form will handle saving the selected `id` automatically!
65
+
66
+ **What happens here?** When the user selects "John Doe" from the dropdown, your form values will automatically update to `{ customerId: "123-abc" }`.
67
+
68
+ ---
69
+
70
+ ## 🖥️ Step 4: Rendering the Form & Initial Values
71
+
72
+ Now that you have your schema, pass it to the `vlite3` `<Form>` component.
73
+
74
+ If you are editing an existing record, pass the initial data to the `:values` prop. `AsyncSelect` will detect the ID (e.g., `customerId: "123-abc"`) and automatically fetch the user's name in the background so the dropdown doesn't just show a raw ID!
75
+
76
+ ```vue
77
+ <script setup lang="ts">
78
+ import { ref } from 'vue'
79
+ import { Form } from 'vlite3'
80
+ import { SelectCustomer } from '@/components/Selects'
81
+
82
+ export const orderSchema: IForm[] = [
83
+ {
84
+ name: 'customerId', // This key gets saved to your form values
85
+ label: 'Select a Customer',
86
+ type: SelectCustomer, // 👈 Pass your new component directly here!
87
+ required: true,
88
+ placeholder: 'Search customers...',
89
+ },
90
+ ]
91
+ // Example: Data fetched from your API when editing an order
92
+ const initialData = ref({
93
+ id: 'order_999',
94
+ customerId: '123-abc', // AsyncSelect will hydrate this automatically!
95
+ })
96
+
97
+ const handleSubmit = async (payload: any) => {
98
+ console.log('Form submitted with values:', payload.values)
99
+ // Example output: { customerId: '123-abc', branchIds: [...] }
100
+ }
101
+ </script>
102
+
103
+ <template>
104
+ <Form
105
+ :schema="orderSchema"
106
+ :values="initialData"
107
+ submit-text="Save Order"
108
+ @on-submit="handleSubmit" />
109
+ </template>
110
+ ```
111
+
112
+ ---
113
+
114
+ ## 💡 Advanced Features
115
+
116
+ ### 1. Selecting Multiple Items
117
+
118
+ Want to select multiple customers? Just add `multiple: true` to the props. This will turn the component into a `MultiSelect` and save an array of IDs (e.g., `['id_1', 'id_2']`).
119
+
120
+ ```ts
121
+ {
122
+ name: 'customerId',
123
+ label: 'Select a Customer',
124
+ type: SelectCustomer,
125
+ props: {
126
+ multiple: true,
127
+ }
128
+ }
129
+ ```
130
+
131
+ ### 2. Dynamic Filtering (Dependent Dropdowns)
132
+
133
+ `filter` accepts two shapes — pick whichever fits the situation:
134
+
135
+ **Static filter** — apply the same filter regardless of form state:
136
+
137
+ ```ts
138
+ {
139
+ name: 'categoryId',
140
+ label: 'Category',
141
+ type: SelectCategory,
142
+ props: {
143
+ filter: { status: 'ACTIVE' }
144
+ }
145
+ }
146
+ ```
147
+
148
+ **Dynamic filter function** — derive the filter from the current form values.
149
+ The function receives `{ values }` (the full form state) and must return a
150
+ filter object, or `undefined` to clear the filter. The query automatically
151
+ refetches whenever the resolved filter changes, and pagination restarts from
152
+ page 1 so you never land on a page that no longer exists.
153
+
154
+ ```ts
155
+ {
156
+ name: 'contactId',
157
+ label: 'Primary Contact',
158
+ type: SelectContact,
159
+ // Only show contacts that belong to the selected customer.
160
+ // The query refetches automatically when `customerId` changes.
161
+ props: {
162
+ filter: ({ values }) => ({ customerId: values.customerId })
163
+ },
164
+ }
165
+ ```
166
+
167
+ #### Dependent dropdown example (your filter, your way)
168
+
169
+ A common pattern: pick a quotation type, then the vehicle type list should
170
+ narrow to tankers only for water delivery.
171
+
172
+ ```ts
173
+ {
174
+ name: 'vehicleTypeId',
175
+ label: 'Vehicle Type',
176
+ type: SelectVehicleType,
177
+ props: {
178
+ // values.quotationType is read from the parent form
179
+ filter: ({ values }) =>
180
+ values.quotationType === 'WATER_DELIVERY'
181
+ ? { isTanker: true }
182
+ : undefined // clears the filter for all other quotation types
183
+ },
184
+ }
185
+ ```
186
+
187
+ A few things worth knowing:
188
+
189
+ - Returning `undefined` (or any non-object) is treated as "no filter".
190
+ - **The function is only re-invoked when one of the keys it actually reads
191
+ changes.** We run it once with a tracking Proxy to discover which
192
+ top-level keys of `values` you read, and then watch *only those keys*.
193
+ Reading `values.quotationType` will not cause the function to re-run when
194
+ `values.cargoQuantityDelivered` changes — even though the parent form
195
+ replaces the whole `values` object on every field change. Top-level keys
196
+ only; nested paths like `values.pricing.amount` won't auto-track, so
197
+ prefer reading from the top level when you can.
198
+ - If the function throws, the error is logged and the dropdown falls back to
199
+ an empty filter instead of breaking the UI.
200
+ - When the resolved filter changes mid-pagination, the dropdown resets to
201
+ page 1.
202
+
203
+ ### 3. Auto-filling other form fields
204
+
205
+ If picking a customer should automatically fill in their billing address, use the `updateValues` hook. The `data` parameter gives you the **full database record** of the selected item.
206
+
207
+ ```ts
208
+ {
209
+ name: 'customerId',
210
+ label: 'Customer',
211
+ type: SelectCustomer,
212
+ updateValues: ({ values, data }) => {
213
+ // 'data' holds the complete customer object returned from the API
214
+ if (data) {
215
+ return {
216
+ ...values,
217
+ // Auto-fill the billing address field based on the selected customer
218
+ billingAddress: data.billingAddress ?? values.billingAddress,
219
+ shippingAddress: data.shippingAddress ?? values.shippingAddress,
220
+ }
221
+ }
222
+ return values
223
+ }
224
+ }
225
+ ```
226
+
227
+ ### 4. Inline Item Creation (Add New)
228
+
229
+ If a user needs to select an item that hasn't been created yet, you can pass an `addNewConfig` inside `props` to allow them to create the item directly from the dropdown. This renders an "Add New" button at the bottom of the dropdown that opens a modal with your provided component.
230
+
231
+ ```ts
232
+ import CreateCategoryForm from '../../components/category/CreateCategoryForm.vue'
233
+
234
+ {
235
+ name: 'categoryId',
236
+ label: 'Product Category',
237
+ type: SelectCategory,
238
+ props: {
239
+ addNewConfig: {
240
+ component: CreateCategoryForm, // Your form component to create the item
241
+ label: 'Add Category', // Text for the button and modal title
242
+ labelI18n: 'common.addCategory', // Optional i18n key
243
+ props: { // Optional props to pass down to the component
244
+ // any additional props your form component expects
245
+ }
246
+ }
247
+ }
248
+ }
249
+ ```
250
+
251
+ When the item is successfully created, ensure your custom component calls the `close()` function passed down to it as a prop. This will close the modal and automatically trigger `AsyncSelect` to refetch its data.
252
+
253
+ ```vue
254
+ <script setup lang="ts">
255
+ // Inside your CreateCategoryForm.vue
256
+ const props = defineProps<{ close?: () => void }>()
257
+
258
+ const handleSave = async (payload: any) => {
259
+ await createCategory(payload)
260
+ // Important: Call close() to dismiss the modal and trigger the dropdown data refresh
261
+ props.close?.()
262
+ }
263
+ </script>
264
+ ```