vlite3 1.5.12 → 1.5.14

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 (124) hide show
  1. package/README.md +20 -8
  2. package/components/Accordion/AccordionContent.vue.js +2 -2
  3. package/components/CommandPalette/CommandPaletteContent2.vue.js +1 -1
  4. package/components/CommandPalette/{CommandPaletteItem2.vue.js → CommandPaletteItem.vue.js} +1 -1
  5. package/components/Form/AccordionView2.vue.js +1 -1
  6. package/components/Form/Form.vue.js +2 -2
  7. package/components/NavbarCommandPalette.vue.js +1 -1
  8. package/components/PanZoomViewport/PanZoomViewport.vue.d.ts +7 -7
  9. package/components/PanZoomViewport/PanZoomViewport.vue.js +1 -1
  10. package/components/Tabes/Tabes.vue.js +2 -2
  11. package/docs/README.md +16 -0
  12. package/docs/component-index.md +313 -0
  13. package/docs/components/accordion.md +52 -0
  14. package/docs/components/alert.md +34 -0
  15. package/docs/components/app-shell.md +371 -0
  16. package/docs/components/async-select.md +264 -0
  17. package/docs/components/attachments-list.md +231 -0
  18. package/docs/components/avatar-group.md +74 -0
  19. package/docs/components/avatar-uploader.md +61 -0
  20. package/docs/components/avatar.md +28 -0
  21. package/docs/components/badge.md +81 -0
  22. package/docs/components/barcode.md +42 -0
  23. package/docs/components/beacon.md +29 -0
  24. package/docs/components/breadcrumb.md +317 -0
  25. package/docs/components/button-group.md +35 -0
  26. package/docs/components/button.md +86 -0
  27. package/docs/components/calendar.md +95 -0
  28. package/docs/components/carousel.md +122 -0
  29. package/docs/components/cart.md +533 -0
  30. package/docs/components/category-manager.md +269 -0
  31. package/docs/components/category-menu.md +251 -0
  32. package/docs/components/charts.md +1456 -0
  33. package/docs/components/chat.md +330 -0
  34. package/docs/components/checkbox.md +31 -0
  35. package/docs/components/chip.md +137 -0
  36. package/docs/components/choice-box.md +40 -0
  37. package/docs/components/clipboard.md +105 -0
  38. package/docs/components/clock.md +70 -0
  39. package/docs/components/color-picker.md +82 -0
  40. package/docs/components/command-palette.md +214 -0
  41. package/docs/components/comment-thread.md +171 -0
  42. package/docs/components/confirmation-modal.md +50 -0
  43. package/docs/components/custom-fields-display.md +94 -0
  44. package/docs/components/custom-fields.md +97 -0
  45. package/docs/components/data-list.md +93 -0
  46. package/docs/components/data-table.md +922 -0
  47. package/docs/components/date-picker.md +58 -0
  48. package/docs/components/date-range-picker.md +24 -0
  49. package/docs/components/date-time.md +104 -0
  50. package/docs/components/dropdown.md +740 -0
  51. package/docs/components/empty.md +100 -0
  52. package/docs/components/export-data.md +320 -0
  53. package/docs/components/file-picker.md +83 -0
  54. package/docs/components/file-preview.md +42 -0
  55. package/docs/components/file-tree.md +144 -0
  56. package/docs/components/footer.md +251 -0
  57. package/docs/components/forms.md +776 -0
  58. package/docs/components/gantt-chart.md +767 -0
  59. package/docs/components/google-login.md +67 -0
  60. package/docs/components/google-map.md +128 -0
  61. package/docs/components/heatmap.md +80 -0
  62. package/docs/components/icon-picker.md +58 -0
  63. package/docs/components/icon.md +176 -0
  64. package/docs/components/image-comparison.md +51 -0
  65. package/docs/components/image-magnifier.md +26 -0
  66. package/docs/components/import-data.md +521 -0
  67. package/docs/components/input.md +58 -0
  68. package/docs/components/invoice.md +339 -0
  69. package/docs/components/kanban.md +302 -0
  70. package/docs/components/label.md +25 -0
  71. package/docs/components/list.md +419 -0
  72. package/docs/components/masonry.md +55 -0
  73. package/docs/components/modal.md +133 -0
  74. package/docs/components/multi-select.md +54 -0
  75. package/docs/components/navbar.md +403 -0
  76. package/docs/components/number-input.md +41 -0
  77. package/docs/components/otp-input.md +68 -0
  78. package/docs/components/pagination.md +83 -0
  79. package/docs/components/pan-zoom-viewport.md +245 -0
  80. package/docs/components/permission-editor.md +322 -0
  81. package/docs/components/persona.md +56 -0
  82. package/docs/components/price.md +106 -0
  83. package/docs/components/pricing-plan.md +68 -0
  84. package/docs/components/progress-bar.md +53 -0
  85. package/docs/components/qr-code.md +59 -0
  86. package/docs/components/rating.md +59 -0
  87. package/docs/components/rich-text-editor.md +210 -0
  88. package/docs/components/scale-generator.md +101 -0
  89. package/docs/components/screen.md +208 -0
  90. package/docs/components/seo-provider.md +189 -0
  91. package/docs/components/side-panel.md +94 -0
  92. package/docs/components/sidebar-menu.md +422 -0
  93. package/docs/components/skeleton.md +115 -0
  94. package/docs/components/slider.md +48 -0
  95. package/docs/components/spinner.md +27 -0
  96. package/docs/components/splitter.md +97 -0
  97. package/docs/components/stats.md +234 -0
  98. package/docs/components/status-chip.md +232 -0
  99. package/docs/components/switch.md +23 -0
  100. package/docs/components/tabs.md +335 -0
  101. package/docs/components/tag-input.md +55 -0
  102. package/docs/components/textarea.md +31 -0
  103. package/docs/components/theme-provider.md +130 -0
  104. package/docs/components/theme-toggle.md +36 -0
  105. package/docs/components/thumbnail-selector.md +186 -0
  106. package/docs/components/timeline.md +225 -0
  107. package/docs/components/toast-notification.md +89 -0
  108. package/docs/components/tooltip.md +31 -0
  109. package/docs/components/workbook.md +102 -0
  110. package/docs/composables/use-theme.md +59 -0
  111. package/docs/getting-started/setup.md +176 -0
  112. package/docs/guides/draggable.md +211 -0
  113. package/docs/guides/internationalization.md +281 -0
  114. package/docs/guides/performance.md +118 -0
  115. package/docs/guides/testing-forms.md +154 -0
  116. package/docs/guides/testing-overlays.md +131 -0
  117. package/docs/guides/theming.md +124 -0
  118. package/docs/utilities/search.md +580 -0
  119. package/docs/utilities/utilities.md +371 -0
  120. package/docs-manifest.json +336 -0
  121. package/package.json +5 -13
  122. package/scripts/generate-docs-manifest.js +207 -0
  123. package/scripts/sync-docs.js +754 -0
  124. package/style.css +1 -1
@@ -0,0 +1,70 @@
1
+ # Clock
2
+
3
+ **Import:** `import { Clock } from 'vlite3'`
4
+
5
+ A live, auto-updating clock component powered by `dayjs`. Displays the current time and date with
6
+ a clean, minimal layout. Every aspect — format, visibility, and styling — is fully controllable
7
+ through props. The `tickInterval` prop is **reactive**: changing it at runtime will immediately
8
+ restart the internal timer with the new interval.
9
+
10
+ ---
11
+
12
+ ## Props
13
+
14
+ | Prop | Type | Default | Description |
15
+ | :------------- | :-------- | :---------------------- | :---------------------------------------------------------------------- |
16
+ | `timeFormat` | `string` | `'hh:mm:ss A'` | `dayjs`-compatible format string for the time portion |
17
+ | `dateFormat` | `string` | `'dddd, MMMM D, YYYY'` | `dayjs`-compatible format string for the date portion |
18
+ | `showTime` | `boolean` | `true` | Whether to render the time heading |
19
+ | `showDate` | `boolean` | `true` | Whether to render the date paragraph |
20
+ | `tickInterval` | `number` | `1000` | ms between each tick. Reactive — changing it restarts the interval |
21
+ | `timeClass` | `string` | `''` | Additional Tailwind/CSS classes applied to the time `<h2>` element |
22
+ | `dateClass` | `string` | `''` | Additional Tailwind/CSS classes applied to the date `<p>` element |
23
+ | `wrapperClass` | `string` | `''` | Additional Tailwind/CSS classes applied to the root wrapper `<div>` |
24
+
25
+ ---
26
+
27
+ ## Usage
28
+
29
+ ### Default
30
+ ```vue
31
+ <script setup lang="ts">
32
+ import { Clock } from 'vlite3'
33
+ </script>
34
+
35
+ <template>
36
+ <Clock />
37
+ </template>
38
+ ```
39
+
40
+ ### Custom Formats
41
+ ```vue
42
+ <template>
43
+ <!-- 24-hour time, European date -->
44
+ <Clock time-format="HH:mm:ss" date-format="DD/MM/YYYY" />
45
+ </template>
46
+ ```
47
+
48
+ ### Show Time Only
49
+ ```vue
50
+ <template>
51
+ <Clock :show-date="false" />
52
+ </template>
53
+ ```
54
+
55
+ ### Custom Styling
56
+ ```vue
57
+ <template>
58
+ <Clock
59
+ time-class="text-primary text-5xl font-bold"
60
+ date-class="text-primary/60 text-base font-medium mt-2" />
61
+ </template>
62
+ ```
63
+
64
+ ### Slower Refresh (reactive interval)
65
+ ```vue
66
+ <template>
67
+ <!-- Refresh every 5 seconds — interval restarts immediately if the prop changes -->
68
+ <Clock :tick-interval="5000" time-format="hh:mm A" />
69
+ </template>
70
+ ```
@@ -0,0 +1,82 @@
1
+ # ColorPicker
2
+
3
+ **Import:** `import { ColorPicker } from 'vlite3'`
4
+
5
+ The lower-level `ColorPickerCanvas` primitive is also exported for inline color-editing experiences that should not open a dropdown.
6
+
7
+ ### Props
8
+
9
+ | Prop | Type | Default | Description |
10
+ | :----------- | :--------------------- | :---------- | :---------------------------------------------------------------------- |
11
+ | `modelValue` | `string` | `'#000000'` | Hex color binding |
12
+ | `size` | `'sm' \| 'md' \| 'lg'` | `md` | Picker size |
13
+ | `position` | `TooltipPlacement` | `bottom` | Popover placement |
14
+ | `disabled` | `boolean` | `false` | Disable picker |
15
+ | `btnProps` | `ButtonProps` | — | Overrides for dropdown button |
16
+ | `showInput` | `boolean` | `true` | Show hex input and eyedropper |
17
+ | `trigger` | `'input' \| 'button' \| 'swatch'` | `'input'` | Trigger style for picker |
18
+ | `isOpen` | `boolean` | — | Optional controlled popover visibility; omit for internal state |
19
+ | `offset` | `[number, number]` | `[0, 8]` | Popover offset passed to the underlying Dropdown |
20
+ | `teleport` | `boolean` | `true` | Teleport the popover outside the trigger's DOM hierarchy |
21
+ | `allowReset` | `boolean` | `false` | Show reset controls; reset sets the value to `#0000` (transparent) |
22
+
23
+ ### Events
24
+
25
+ | Event | Payload | Description |
26
+ | :------------------ | :------- | :----------------------------------------------- |
27
+ | `update:modelValue` | `string` | Emitted when the color changes |
28
+ | `change` | `string` | Emitted when the color changes |
29
+ | `reset` | `string` | Emitted when reset is used (always `#0000`) |
30
+ | `update:isOpen` | `boolean` | Emitted whenever popover visibility changes |
31
+ | `open` | — | Emitted when the popover opens |
32
+ | `close` | — | Emitted when the popover closes |
33
+
34
+ ### Slots
35
+
36
+ | Name | Slot Props | Description |
37
+ | :-------- | :----------------------- | :-------------------------------------------- |
38
+ | `trigger` | `{ isOpen: boolean }` | Custom trigger element for the color picker |
39
+
40
+ ### Usage
41
+
42
+ ```vue
43
+ <ColorPicker v-model="accentColor" />
44
+ ```
45
+
46
+ ### Controlled visibility
47
+
48
+ Bind `v-model:is-open` when multiple pickers need coordinated visibility. Existing consumers can omit it and keep the default internally managed behavior.
49
+
50
+ ```vue
51
+ <ColorPicker
52
+ v-model="accentColor"
53
+ v-model:is-open="accentPickerOpen"
54
+ position="right-start"
55
+ :offset="[0, 10]"
56
+ />
57
+ ```
58
+
59
+ ### Reset to transparent
60
+
61
+ Enable `allowReset` to show a clear control on the trigger and a reset button inside the picker menu. Reset writes `#0000` (transparent).
62
+
63
+ ```vue
64
+ <ColorPicker v-model="backgroundColor" allow-reset />
65
+ ```
66
+
67
+ ### Inline color canvas
68
+
69
+ Use the shared `ColorPickerCanvas` primitive when the picker must render inline. It provides the same color canvas, sliders, eyedropper, sizing, and cleanup behavior used internally by `ColorPicker`.
70
+
71
+ ```vue
72
+ <script setup lang="ts">
73
+ import { ColorPickerCanvas } from 'vlite3'
74
+ </script>
75
+
76
+ <ColorPickerCanvas
77
+ :color="accentColor"
78
+ show-header
79
+ @update:color="accentColor = $event"
80
+ @close="closeInlineEditor"
81
+ />
82
+ ```
@@ -0,0 +1,214 @@
1
+ # CommandPalette (NavbarCommandPalette)
2
+
3
+ **Import:** `import { NavbarCommandPalette } from 'vlite3'`
4
+
5
+ > **Note:** The component is exported as `NavbarCommandPalette` but also referred to as the "Command Palette" in the UI. It is designed to be placed inside the `#header` slot of `Navbar`, but it works as a standalone component anywhere in your app.
6
+
7
+ `NavbarCommandPalette` renders a search trigger button that opens a full-screen command palette modal. It integrates with your existing `SidebarMenuItemSchema` tree (auto-flatten + group) or accepts a flat `CommandPaletteItem[]` list. The modal is opened via a keyboard shortcut (`⌘K` / `Ctrl+K` by default) or by clicking the trigger button.
8
+
9
+ ---
10
+
11
+ ## Props
12
+
13
+ | Prop | Type | Default | Description |
14
+ | :------------------- | :------------------------ | :------------------------------------------ | :--------------------------------------------------------------------------------------------------------------- |
15
+ | `items` | `CommandPaletteItem[]` | `[]` | Static flat list of command palette items. Merged with any items derived from `menuItems`. |
16
+ | `menuItems` | `SidebarMenuItemSchema[]` | `[]` | Raw sidebar menu tree. The palette auto-flattens and groups these into searchable entries. |
17
+ | `shortcutKey` | `string` | `'k'` | The key used with `Meta` (Mac) or `Ctrl` (Windows/Linux) to open the palette (e.g. `'k'` → `⌘K` / `Ctrl+K`). |
18
+ | `placeholder` | `string` | `'Search commands, pages, and actions...'` | Placeholder text for the search input inside the palette. |
19
+ | `placeholderI18n` | `string` | `—` | i18n translation key for the placeholder. Overrides `placeholder` if the key resolves. |
20
+ | `maxResultsPerGroup` | `number` | `10` | Maximum number of results displayed per group in the results list. |
21
+ | `enabled` | `boolean` | `true` | When `false`, the trigger button is not rendered, keyboard shortcut is not registered, and the modal cannot open. |
22
+
23
+ ---
24
+
25
+ ## Types
26
+
27
+ ```ts
28
+ export interface CommandPaletteItem {
29
+ id: string
30
+ label: string
31
+ labelI18n?: string
32
+ description?: string
33
+ descriptionI18n?: string
34
+ icon?: string
35
+ group?: string
36
+ to?: string
37
+ href?: string
38
+ action?: () => void
39
+ keywords?: string[]
40
+ disabled?: boolean
41
+ }
42
+
43
+ export interface CommandPaletteGroup {
44
+ key: string
45
+ label: string
46
+ items: CommandPaletteItem[]
47
+ }
48
+ ```
49
+
50
+ ---
51
+
52
+ ## Behavior
53
+
54
+ ### Trigger Button
55
+
56
+ The trigger button is:
57
+
58
+ - Hidden on screens smaller than `md` (`hidden md:inline-flex`).
59
+ - Displays the first segment of `placeholder` text (before the first comma) as a compact label.
60
+ - Displays the keyboard shortcut badge (`⌘K` or `Ctrl+K`) on `lg` and larger screens.
61
+ - Auto-detects the platform: uses `⌘` on Mac, `Ctrl` on Windows/Linux.
62
+
63
+ ### Keyboard Shortcut
64
+
65
+ When `enabled` is `true`, the component registers a `keydown` event listener on `window` during `onMounted`. The shortcut fires when `(e.metaKey || e.ctrlKey) && e.key === shortcutKey`. The listener is cleaned up on `onUnmounted` and re-registered/removed when `enabled` changes reactively.
66
+
67
+ ### Modal
68
+
69
+ The palette opens as a `<Modal>` with `maxWidth="max-w-2xl"`. The actual search UI is rendered inside `CommandPaletteContent`, which receives `items`, `menuItems`, `placeholder`, `placeholderI18n`, and `maxResultsPerGroup` as `bodyProps`.
70
+
71
+ ### Auto-flattening `menuItems`
72
+
73
+ When `menuItems` is provided, the palette traverses the full `SidebarMenuItemSchema` tree and creates one `CommandPaletteItem` per navigable leaf node:
74
+
75
+ - Items with `to` or `href` are included.
76
+ - Items with only `action` and no children are included.
77
+ - Parent group items (with children but no `to`/`href`/`action`) are excluded.
78
+ - The `group` field on each derived item is set to the top-level ancestor's `label`.
79
+
80
+ ---
81
+
82
+ ## Usage
83
+
84
+ ### Inside Navbar Header (Recommended)
85
+
86
+ ```vue
87
+ <Navbar variant="sidebar">
88
+ <template #header="{ toggle }">
89
+ <div class="h-16 border-b bg-white flex items-center justify-between px-6 w-full">
90
+ <div class="flex items-center gap-4">
91
+ <button class="md:hidden" @click="toggle">
92
+ <Icon icon="lucide:menu" />
93
+ </button>
94
+ <span class="font-bold text-lg">My App</span>
95
+
96
+ <!-- Command Palette trigger — powered by the sidebar menu tree -->
97
+ <NavbarCommandPalette
98
+ :enabled="true"
99
+ :menu-items="menuItems"
100
+ placeholder="Search components..."
101
+ shortcut-key="k" />
102
+ </div>
103
+ <div class="flex items-center gap-3">
104
+ <Avatar fallback="JD" />
105
+ </div>
106
+ </div>
107
+ </template>
108
+
109
+ <template #default>
110
+ <SidebarMenu :items="menuItems" />
111
+ </template>
112
+
113
+ <template #main>
114
+ <RouterView />
115
+ </template>
116
+ </Navbar>
117
+ ```
118
+
119
+ ### Standalone (Outside Navbar)
120
+
121
+ ```vue
122
+ <template>
123
+ <div class="flex items-center gap-4">
124
+ <NavbarCommandPalette
125
+ :enabled="true"
126
+ :menu-items="menuItems"
127
+ placeholder="Search pages and commands..."
128
+ shortcut-key="p" />
129
+ </div>
130
+ </template>
131
+ ```
132
+
133
+ ### With Static Items Only
134
+
135
+ Use the `items` prop for custom command entries that are not part of the sidebar menu tree.
136
+
137
+ ```vue
138
+ <NavbarCommandPalette
139
+ :enabled="true"
140
+ :items="[
141
+ {
142
+ id: 'new-project',
143
+ label: 'New Project',
144
+ description: 'Create a new project workspace',
145
+ icon: 'lucide:folder-plus',
146
+ group: 'Actions',
147
+ action: () => openNewProjectModal(),
148
+ keywords: ['create', 'add', 'workspace'],
149
+ },
150
+ {
151
+ id: 'docs',
152
+ label: 'Open Documentation',
153
+ icon: 'lucide:book-open',
154
+ group: 'Links',
155
+ href: 'https://docs.example.com',
156
+ },
157
+ {
158
+ id: 'theme',
159
+ label: 'Toggle Theme',
160
+ icon: 'lucide:sun-moon',
161
+ group: 'Settings',
162
+ action: () => toggleDarkMode(),
163
+ },
164
+ ]"
165
+ placeholder="Search commands..." />
166
+ ```
167
+
168
+ ### Combined: Sidebar Tree + Custom Items
169
+
170
+ The `items` and `menuItems` props are merged together in the results list.
171
+
172
+ ```vue
173
+ <NavbarCommandPalette
174
+ :enabled="true"
175
+ :menu-items="sidebarMenuItems"
176
+ :items="[
177
+ {
178
+ id: 'logout',
179
+ label: 'Log Out',
180
+ icon: 'lucide:log-out',
181
+ group: 'Account',
182
+ action: () => logout(),
183
+ },
184
+ ]"
185
+ placeholder="Search pages and commands..." />
186
+ ```
187
+
188
+ ### Disabling the Palette
189
+
190
+ Pass `:enabled="false"` to fully disable the component — no button, no shortcut listener, no modal.
191
+
192
+ ```vue
193
+ <!-- Hidden from guests -->
194
+ <NavbarCommandPalette :enabled="isAuthenticated" :menu-items="menuItems" />
195
+ ```
196
+
197
+ ### Custom Shortcut Key
198
+
199
+ Change the trigger shortcut to `⌘P` / `Ctrl+P`:
200
+
201
+ ```vue
202
+ <NavbarCommandPalette :menu-items="menuItems" shortcut-key="p" placeholder="Go to..." />
203
+ ```
204
+
205
+ ---
206
+
207
+ ## Notes & Best Practices
208
+
209
+ - Place `NavbarCommandPalette` inside `#header` when using Layout Mode so it is always visible to the user.
210
+ - The trigger button is automatically hidden on mobile (`hidden md:inline-flex`). If you need mobile command palette access, add a separate mobile button that calls an `open()` function or reuses the keyboard shortcut.
211
+ - `maxResultsPerGroup` prevents the palette from showing hundreds of results when a broad search matches many items. Set it higher (e.g. `20`) for large navigation trees.
212
+ - Use `keywords` on static `CommandPaletteItem` entries to improve search discoverability for items that might be searched by synonyms.
213
+ - The `action` callback on static items fires immediately on selection and closes the palette. Pair it with router navigation if needed.
214
+ - `labelI18n` on static items follows the same convention as `SidebarMenuItemSchema.labelI18n` — the i18n key is resolved at render time.
@@ -0,0 +1,171 @@
1
+ # Comment Thread
2
+
3
+ An interactive, completely abstracted discussion interface perfectly suited for GitHub PRs, Jira tickets, documentation platforms, or complex collaborative SaaS environments.
4
+
5
+ ## Architecture
6
+
7
+ Unlike the traditional `Chat` feature (which handles real-time, flat sequential messages), the `CommentThread` specializes in deep contextual nesting (infinite trees of replies). It natively understands the nested payload and recursively builds its own DOM structures visually linking discussions with vertical line indenting.
8
+
9
+ It includes out-of-the-box integration with:
10
+ - Nested Inline Replies
11
+ - Nested Inline Edits
12
+ - Rich File Attachment Previews
13
+ - Native Internal Pagination (Facebook / Instagram style deep nested load-more)
14
+ - Double-confirm "Delete" logic (Click to prep, click again to confirm).
15
+
16
+ ## Usage
17
+
18
+ ```vue
19
+ <script setup lang="ts">
20
+ import { ref } from 'vue'
21
+ import { CommentThread, type CommentNode } from 'vlite3'
22
+
23
+ const currentUser = { id: 'me_1', name: 'Admin', avatar: 'https://i.pravatar.cc/150' }
24
+
25
+ const myThreads = ref<CommentNode[]>([
26
+ {
27
+ id: 1,
28
+ text: "Parent Comment with a file",
29
+ author: { id: 'u1', name: 'John Doe' },
30
+ attachments: [
31
+ { fileName: 'spec.pdf', fileUrl: 'https://...', fileSize: 1024 }
32
+ ],
33
+ replies: [
34
+ {
35
+ id: 2,
36
+ text: "Nested child Reply",
37
+ author: { id: 'u2', name: 'Jane Doe' },
38
+ replies: []
39
+ }
40
+ ]
41
+ }
42
+ ])
43
+
44
+ const handleAdd = (payload) => { /* logic to unshift/push comment based on payload.parentId */ }
45
+ const handleEdit = (updatedComment) => { /* logic to update comment tree deep */ }
46
+ const handleDelete = (id) => { /* logic to remove comment deep */ }
47
+ </script>
48
+
49
+ <template>
50
+ <CommentThread
51
+ :comments="myThreads"
52
+ :current-user="currentUser"
53
+ @add="handleAdd"
54
+ @edit="handleEdit"
55
+ @delete="handleDelete"
56
+ />
57
+ </template>
58
+ ```
59
+
60
+ ## Props (`CommentThread.vue`)
61
+
62
+ | Prop | Type | Default | Description |
63
+ |:-----|:-----|:--------|:------------|
64
+ | `comments` | `CommentNode[]` | `[]` | A recursive tree payload mapping the threaded discussion. |
65
+ | `currentUser` | `CommentAuthor \| null` | `null` | Crucial context! Determines permission views, edit/delete abilities, and your own Avatar display picture. |
66
+ | `inputPosition` | `'top' \| 'bottom' \| 'hidden'` | `'top'` | Where to automatically attach the `<CommentEditor>`. |
67
+ | `threaded` | `boolean` | `true` | Visually draws the vertical joining line between deep replies. |
68
+ | `allowDelete` | `boolean` | `true` | Show the Trash action icon. |
69
+ | `allowEdit` | `boolean` | `true` | Show the Pencil action icon. |
70
+ | `allowReply` | `boolean` | `true` | Show the Reply action icon. |
71
+ | `allowFileUpload` | `boolean` | `true` | Show the Attachment picker context. |
72
+ | `confirmDelete` | `boolean` | `true` | Requires the user to double click the trash can to prevent accidental drops! |
73
+ | `folderId` | `string` | `undefined` | Target upload folder for server connections. |
74
+ | `maxFileSize` | `number` | `undefined` | Upload size limit in bytes. |
75
+ | `hasMore` | `boolean` | `false` | Display the root thread "View more comments" pagination pattern. |
76
+ | `loadingMore` | `boolean` | `false` | Enables spinner on the root thread pagination button. |
77
+
78
+ ### Translation Props (i18n)
79
+
80
+ Every bit of text relies on robust global translation `$t` fallbacks, making it effortlessly customizable locally if you don't provide anything.
81
+ If you want to use your own localized dictionaries, you can simply pass the keys to your localization tool directly in the vue bindings like `:empty-text="$t('my.custom.key')"`.
82
+
83
+ - `emptyText`
84
+ - `placeholder`
85
+ - `replyPlaceholder`
86
+ - `editPlaceholder`
87
+ - `replyText`
88
+ - `editedText`
89
+ - `editingText`
90
+ - `cancelText`
91
+ - `cancelEditText`
92
+ - `loadMoreText`
93
+ - `loadMoreRepliesText`
94
+
95
+ ## Payload (`CommentNode` interface)
96
+
97
+ Your payload objects should strictly match this shape:
98
+
99
+ ```ts
100
+ export interface CommentNode {
101
+ id: string | number
102
+ text: string
103
+ author: {
104
+ id: string | number
105
+ name: string
106
+ avatar?: string
107
+ role?: string
108
+ }
109
+ timestamp?: string | number | Date
110
+ isEdited?: boolean
111
+ attachments?: any[]
112
+ replies?: CommentNode[]
113
+
114
+ // -- Pagination fields --
115
+ hasMoreReplies?: boolean
116
+ loadingMoreReplies?: boolean
117
+ replyCount?: number
118
+ }
119
+ ```
120
+
121
+ ## Events
122
+
123
+ The Comment component does *not* mutate your source array; it tells your application what users intended to do natively.
124
+
125
+ | Event | Payload | Description |
126
+ |:------|:--------|:------------|
127
+ | `add` | `{ text, attachments, parentId? }` | Fired when a submittal occurs. If `parentId` is provided, user clicked inline-reply; if omitted, they clicked the root thread box. |
128
+ | `edit` | `CommentNode` | Returns the entirety of the updated object with the new `.text` applied. |
129
+ | `delete` | `string \| number` | Fired when the trash button is confirmed. |
130
+ | `load-more` | `void` | Fired when root thread pagination is clicked. |
131
+ | `load-more-replies`| `string \| number` | Returns ID of the comment node that user wants to expand deep nested pagination replies for! |
132
+
133
+ ## Pagination (Facebook / Instagram Style)
134
+
135
+ The `CommentThread` interface seamlessly supports deep infinite nested pagination out-of-the-box, leveraging standard industry patterns seen on Facebook/Instagram.
136
+
137
+ When a payload includes a deeply nested item that you don't want to over-fetch, simply mock its parent using metadata:
138
+ ```ts
139
+ {
140
+ id: 'c1',
141
+ text: "Parent Comment",
142
+ hasMoreReplies: true,
143
+ replyCount: 5,
144
+ replies: []
145
+ }
146
+ ```
147
+ This signals the interface to render an inline, horizontal dashed action button: `—— View 5 more replies`. When clicked it emits `@load-more-replies`. Set `.loadingMoreReplies = true`, fetch your data, and use standard Vue reactivity `parent.replies.push(...)` and it smoothly animates them into the inline tree!
148
+
149
+ ## External Editor Abstraction
150
+
151
+ Did you want to render the text Editor on a sticky footer out-of-context, but render the thread comments elsewhere?
152
+
153
+ You don't need a custom interface for it. Simply load `CommentThread` with `inputPosition="hidden"`, then anywhere else simply instantiate the native `CommentEditor` component:
154
+
155
+ ```vue
156
+ <script setup>
157
+ import { CommentThread, CommentEditor } from 'vlite3'
158
+ </script>
159
+
160
+ <template>
161
+ <!-- Renders Comments ONLY (handles nested replies internally still!) -->
162
+ <CommentThread input-position="hidden" :comments="data" />
163
+
164
+ <!-- Load the standalone CommentEditor elsewhere -->
165
+ <CommentEditor
166
+ variant="root"
167
+ :current-user="currentUser"
168
+ @submit="(text, attts) => handleAdd({ text, attachments: attts })"
169
+ />
170
+ </template>
171
+ ```
@@ -0,0 +1,50 @@
1
+ # ConfirmationModal
2
+
3
+ **Import:** `import { ConfirmationModal } from 'vlite3'`
4
+
5
+ ### Props
6
+
7
+ | Prop | Type | Default | Description |
8
+ | :---------------- | :-------- | :---------- | :---------------------------------------------------- |
9
+ | `show` | `boolean` | `false` | Binding (`v-model:show`) |
10
+ | `title` | `string` | required | Modal title |
11
+ | `titleI18n` | `string` | — | I18n Translation key for title |
12
+ | `description` | `string` | required | Description text |
13
+ | `descriptionI18n` | `string` | — | I18n Translation key for description |
14
+ | `loading` | `boolean` | `false` | Show loading spinner on confirm button |
15
+ | `confirmText` | `string` | `'Confirm'` | Text for confirm button |
16
+ | `confirmTextI18n` | `string` | — | I18n translation key for confirm button |
17
+ | `cancelText` | `string` | `'Cancel'` | Text for cancel button |
18
+ | `cancelTextI18n` | `string` | — | I18n translation key for cancel button |
19
+ | `variant` | `string` | `'danger'` | Button variant (`primary`, `danger`, `warning`, etc.) |
20
+
21
+ ### Events
22
+
23
+ - `@confirm`: Emitted when the confirm button is clicked
24
+ - `@cancel`: Emitted when cancel button or backdrop is clicked
25
+ - `@update:show`: Emitted to update v-model
26
+
27
+ ### Slots
28
+
29
+ | Slot | Description | Props |
30
+ | :-------- | :--------------------------------- | :---- |
31
+ | `trigger` | Element that opens the modal | — |
32
+ | `default` | Custom content override (optional) | — |
33
+
34
+ ### Usage
35
+
36
+ ```vue
37
+ <ConfirmationModal
38
+ v-model:show="showConfirm"
39
+ title="Delete Account"
40
+ description="Are you sure? This action cannot be undone."
41
+ confirm-text="Yes, Delete"
42
+ variant="danger"
43
+ :loading="isDeleting"
44
+ @confirm="deleteAccount"
45
+ @cancel="showConfirm = false">
46
+ <template #trigger>
47
+ <Button variant="danger">Delete Account</Button>
48
+ </template>
49
+ </ConfirmationModal>
50
+ ```
@@ -0,0 +1,94 @@
1
+ # Custom Fields Display
2
+
3
+ **Import:** `import { CustomFieldsDisplay } from 'vlite3'`
4
+
5
+ ### Description
6
+
7
+ A versatile display component for rendering arrays of key-value pairs (custom fields) in various layouts. It supports grid, list, card, and inline variants, complete with an optional header and icon.
8
+
9
+ ---
10
+
11
+ ### Props
12
+
13
+ | Prop | Type | Default | Description |
14
+ | :--- | :--- | :--- | :--- |
15
+ | `fields` | `CustomFieldItem[]` | `[]` | Array of field data objects. |
16
+ | `variant` | `CustomFieldsDisplayVariant` | `'grid'` | Layout style: `'grid' \| 'list' \| 'card' \| 'inline'`. |
17
+ | `columns` | `1 \| 2 \| 3 \| 4` | `2` | Number of columns (used for grid/card variants). |
18
+ | `title` | `string?` | `''` | Display title for the header. |
19
+ | `titleI18n` | `string?` | `''` | i18n key for the title. |
20
+ | `icon` | `string?` | `''` | Icon name for the header. |
21
+ | `emptyText` | `string` | `'--'` | Text to show if the `fields` array is empty. |
22
+ | `keyProp` | `string` | `'key'` | Property name for the field label. |
23
+ | `valueProp` | `string` | `'value'` | Property name for the field value. |
24
+ | `class` | `string?` | `''` | Additional CSS class for the container. |
25
+ | `listValueThreshold` | `number` | `50` | (List Variant) Character count threshold to stack label and value vertically. |
26
+
27
+ ---
28
+
29
+ ### Layout Variants
30
+
31
+ | Variant | Best Use Case | Appearance |
32
+ | :--- | :--- | :--- |
33
+ | `grid` | Standard dashboard info displays. | Label (uppercase text-xs) above the value (text-sm). |
34
+ | `list` | Sidebars or mobile-first property lists. | Horizontal row with label on the left and value on the right. |
35
+ | `card` | High-emphasis feature or project details. | Each field rendered in a bordered card with `bg-card`. |
36
+ | `inline` | Compact tags or metadata pills. | Pill-shaped items with label and value separated by a colon. |
37
+
38
+ ---
39
+
40
+ ### Slots
41
+
42
+ | Slot Name | Scoped Props | Description |
43
+ | :--- | :--- | :--- |
44
+ | `title` | `—` | Replace the entire header content. |
45
+ | `key` | `{ field, index }` | Customize the rendering of the label for each item. |
46
+ | `value` | `{ field, index }` | Customize the rendering of the value for each item. |
47
+ | `empty` | `—` | Replace the default empty state UI. |
48
+
49
+ ---
50
+
51
+ ### Implementation Examples
52
+
53
+ #### 1. Basic List with Header
54
+
55
+ ```vue
56
+ <script setup>
57
+ import { CustomFieldsDisplay } from 'vlite3'
58
+
59
+ const stats = [
60
+ { key: 'Department', value: 'Engineering' },
61
+ { key: 'Location', value: 'Remote' },
62
+ ]
63
+ </script>
64
+
65
+ <template>
66
+ <CustomFieldsDisplay
67
+ title="Employee Info"
68
+ icon="lucide:user"
69
+ :fields="stats"
70
+ variant="list"
71
+ />
72
+ </template>
73
+ ```
74
+
75
+ #### 2. Grid Layout with 3 Columns
76
+
77
+ ```vue
78
+ <template>
79
+ <CustomFieldsDisplay
80
+ :fields="data"
81
+ variant="grid"
82
+ :columns="3"
83
+ />
84
+ </template>
85
+ ```
86
+
87
+ ---
88
+
89
+ ### Senior Engineer's Notes
90
+
91
+ 1. **Dynamic Keys/Values**: Use `keyProp` and `valueProp` to map the component to existing data models without restructuring your arrays.
92
+ 2. **Adaptive List Layout**: In the `list` variant, the component automatically switches from horizontal to vertical stacking if a value exceeds the `listValueThreshold` (default: 50 characters). This prevents layout breakage for long descriptions.
93
+ 3. **Automatic Formatting**: The component handles booleans (`true` → "Yes") and arrays (`['A', 'B']` → "A, B") automatically. For complex objects, it falls back to a JSON-serialized string.
94
+ 4. **Semantic Styling**: Labels in `grid` and `card` variants are automatically transformed to uppercase with tracking-wider for a "metadata" look.