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,186 @@
1
+ # Thumbnail Selector
2
+
3
+ **Import:** `import { ThumbnailSelector } from 'vlite3'`
4
+
5
+ ### Description
6
+
7
+ A full-featured image picker and thumbnail manager for Vue 3. Users can upload multiple images, drag-and-drop to reorder them, and designate one as the primary thumbnail.
8
+
9
+ Use it as a **standalone component** with `v-model:images` / `v-model:thumbnail`, or as a **Form field** via `type: 'thumbnailSelector'`. Both modes integrate with the global upload service — the same pipeline used by [`AvatarUploader`](../basic/avatar-uploader.md) (`avatarUpload`) and `fileUploader`.
10
+
11
+ ---
12
+
13
+ ### Props
14
+
15
+ | Prop | Type | Default | Description |
16
+ | :---------- | :--------------- | :---------- | :----------------------------------------------------------------------------- |
17
+ | `images` | `string[]` | `[]` | Array of currently loaded image URLs. Bind with `v-model:images`. |
18
+ | `thumbnail` | `string \| null` | `null` | The currently selected thumbnail URL. Bind with `v-model:thumbnail`. |
19
+ | `label` | `string?` | `undefined` | An optional label rendered above the component. |
20
+ | `disabled` | `boolean` | `false` | Disables all interactions: uploading, clicking, removing, and reordering. |
21
+ | `loading` | `boolean` | `false` | Shows a spinner on the upload button and disables interactions. |
22
+ | `maxSize` | `number?` | `undefined` | Maximum file size in **MB** per image. Forwarded to the internal `FilePicker`. |
23
+
24
+ ---
25
+
26
+ ### Emits
27
+
28
+ | Event | Payload | Description |
29
+ | :----------------- | :------------------------------------------------ | :------------------------------------------------------------------ |
30
+ | `update:images` | `string[]` | Emitted when the images array changes (upload, remove, or reorder). |
31
+ | `update:thumbnail` | `string \| null` | Emitted when the selected thumbnail changes. |
32
+ | `change` | `{ images: string[]; thumbnail: string \| null }` | Convenience event that consolidates both values in one payload. |
33
+
34
+ ---
35
+
36
+ ### Implementation Examples
37
+
38
+ #### 1. Standalone with v-model
39
+
40
+ ```vue
41
+ <script setup>
42
+ import { ref } from 'vue'
43
+ import { ThumbnailSelector } from 'vlite3'
44
+
45
+ const images = ref(['https://cdn.example.com/img1.jpg', 'https://cdn.example.com/img2.jpg'])
46
+ const thumbnail = ref(images.value[0])
47
+ </script>
48
+
49
+ <template>
50
+ <ThumbnailSelector
51
+ v-model:images="images"
52
+ v-model:thumbnail="thumbnail"
53
+ label="Product Images"
54
+ :max-size="5" />
55
+ </template>
56
+ ```
57
+
58
+ #### 2. Schema-driven inside Form (recommended)
59
+
60
+ Declare a field with `type: 'thumbnailSelector'` in your Form schema. Upload processing is handled automatically by `useForm` before `onSubmit` fires.
61
+
62
+ In **non-multi-step** forms (flat or grouped), Form automatically hoists the field into a **side panel**: right on large screens (`min-w` ~350px), stacked above the fields on small screens. In **multi-step** wizards it stays inline with the step fields.
63
+
64
+ ```vue
65
+ <script setup>
66
+ import { Form } from 'vlite3'
67
+
68
+ const schema = [
69
+ { name: 'title', type: 'text', label: 'Product Title', required: true },
70
+ {
71
+ name: 'media',
72
+ type: 'thumbnailSelector',
73
+ label: 'Product Images',
74
+ maxFileSize: 5, // MB — forwarded as ThumbnailSelector `maxSize`
75
+ },
76
+ ]
77
+
78
+ const handleSubmit = ({ values }) => {
79
+ /**
80
+ * values.media = {
81
+ * images: ['https://cdn.example.com/img1.jpg'],
82
+ * thumbnail: 'https://cdn.example.com/img1.jpg'
83
+ * }
84
+ * base64 data URIs are resolved to URLs before this fires.
85
+ */
86
+ console.log(values)
87
+ }
88
+ </script>
89
+
90
+ <template>
91
+ <Form :schema="schema" submit-text="Save" @onSubmit="handleSubmit" />
92
+ </template>
93
+ ```
94
+
95
+ #### 3. With initial values
96
+
97
+ ```vue
98
+ <script setup>
99
+ import { Form } from 'vlite3'
100
+
101
+ const schema = [
102
+ { name: 'title', type: 'text', label: 'Product Title' },
103
+ {
104
+ name: 'media',
105
+ type: 'thumbnailSelector',
106
+ label: 'Product Images',
107
+ maxFileSize: 5,
108
+ },
109
+ ]
110
+
111
+ const values = {
112
+ title: 'Existing product',
113
+ media: {
114
+ images: ['https://cdn.example.com/img1.jpg', 'https://cdn.example.com/img2.jpg'],
115
+ thumbnail: 'https://cdn.example.com/img1.jpg',
116
+ },
117
+ }
118
+ </script>
119
+
120
+ <template>
121
+ <Form :schema="schema" :values="values" is-update submit-text="Update" @onSubmit="handleSubmit" />
122
+ </template>
123
+ ```
124
+
125
+ ---
126
+
127
+ ### Form Field Integration
128
+
129
+ When declared as a field in a `Form` schema with `type: 'thumbnailSelector'`, the value stored in `useForm` is a structured object:
130
+
131
+ ```ts
132
+ {
133
+ images: string[] // all image URLs (or pending base64 data URIs)
134
+ thumbnail: string | null // the selected thumbnail URL
135
+ }
136
+ ```
137
+
138
+ | Schema property | Maps to ThumbnailSelector prop | Notes |
139
+ | :-------------- | :----------------------------- | :----------------------------------------- |
140
+ | `label` | `label` | Shown above the preview |
141
+ | `maxFileSize` | `maxSize` | Size limit in **MB** |
142
+ | `disabled` | `disabled` | Supports static boolean or `(ctx) => bool` |
143
+ | `when` | — | Conditionally show/hide the whole field |
144
+
145
+ The global upload service automatically detects any `base64` data URIs in `images[]` and uploads them before `onSubmit` fires. The `thumbnail` reference is updated to the resolved CDN URL in the same pass — identical to how `avatarUpload` and `fileUploader` fields work.
146
+
147
+ Pass `folderId` on the Form to store uploads under a specific folder.
148
+
149
+ > **Layout note:** Only the first `thumbnailSelector` field is extracted into the side panel. Multi-step schemas always render the field inline (no side panel) to avoid layout issues across tabs.
150
+
151
+ ---
152
+
153
+ ### Accepted File Types
154
+
155
+ The component only accepts images. The following MIME types are supported:
156
+
157
+ | Format | MIME type |
158
+ | :----- | :-------------- |
159
+ | JPEG | `image/jpeg` |
160
+ | PNG | `image/png` |
161
+ | WebP | `image/webp` |
162
+ | GIF | `image/gif` |
163
+ | SVG | `image/svg+xml` |
164
+
165
+ ---
166
+
167
+ ### Testing
168
+
169
+ Automatic `data-testid` resolution:
170
+
171
+ | Attribute | Format | Fallback | Example |
172
+ | :-------------- | :------------------ | :-------------------- | :---------------------------------------- |
173
+ | `data-testid` | `thumbnail-{name}` | `thumbnail-selector` | `[data-testid="thumbnail-media"]` |
174
+
175
+ Override by passing `data-testid` via schema `props` or as an attribute on the standalone component.
176
+
177
+ ---
178
+
179
+ ### Senior Engineer's Notes
180
+
181
+ 1. **Auto-thumbnail selection**: When a user uploads their first image and no thumbnail is set, the component auto-selects it. Subsequent uploads do not change the active selection.
182
+ 2. **Drag-to-reorder**: All images in the grid can be reordered by dragging the grip handle that appears on hover. The `update:images` event fires with the new sorted array and the `thumbnail` selection is preserved.
183
+ 3. **Disabled vs Loading**: Use `disabled` for read-only display (e.g., view mode). Use `loading` during an upload in progress — it shows a spinner on the upload button but still displays the image grid.
184
+ 4. **Delete logic**: Deleting the currently selected thumbnail automatically promotes the first remaining image to thumbnail, or sets it to `null` if the gallery is empty.
185
+ 5. **Pending uploads**: Newly picked files are stored as `data:` URIs so `collectFileFields` / `processFileUploads` can upload them on submit. Blob URLs are used only as a preview fallback when base64 is unavailable.
186
+ 6. **Hover isolation**: The delete and drag-handle buttons use scoped CSS selectors (not Tailwind's `group-hover`) to ensure hover effects are isolated to the individual card being pointed at.
@@ -0,0 +1,225 @@
1
+ # Timeline
2
+
3
+ **Import:** `import { Timeline } from 'vlite3'`
4
+
5
+ ---
6
+
7
+ ### Props
8
+
9
+ | Prop | Type | Default | Description |
10
+ | :-------------- | :---------------------- | :----------- | :-------------------------------------------------- |
11
+ | `steps` | `TimelineStep[]` | required | Array of steps to display |
12
+ | `activeStep` | `number` | `0` | Index of current active step |
13
+ | `direction` | `TimelineDirection` | `horizontal` | Layout direction (`horizontal` or `vertical`) |
14
+ | `textPosition` | `TimelineTextPosition` | `bottom` | Position of text relative to step (horizontal only) |
15
+ | `lineStyle` | `TimelineLineStyle` | `solid` | Connector line style (`solid` or `dashed`) |
16
+ | `indicatorType` | `TimelineIndicatorType` | `icon` | Indicator style (`icon`, `number`, or `dot`) |
17
+ | `clickable` | `boolean` | `false` | Enable click events on steps |
18
+ | `class` | `string` | — | Custom class for the wrapper element |
19
+
20
+ ---
21
+
22
+ ### Types
23
+
24
+ ```ts
25
+ export type TimelineProgressStatus = 'completed' | 'current' | 'upcoming'
26
+ export type TimelineDirection = 'horizontal' | 'vertical'
27
+ export type TimelineTextPosition = 'bottom' | 'right'
28
+ export type TimelineLineStyle = 'solid' | 'dashed'
29
+ export type TimelineIndicatorType = 'icon' | 'number' | 'dot'
30
+
31
+ export interface TimelineStep {
32
+ id: string | number
33
+ title?: string
34
+ titleI18n?: string
35
+ subtitle?: string
36
+ subtitleI18n?: string
37
+ description?: string
38
+ descriptionI18n?: string
39
+ date?: string
40
+ icon?: string
41
+ status?: string // Business-logic badge label (e.g. 'Pending', 'Approved')
42
+ progressStatus?: TimelineProgressStatus // Explicit visual override
43
+ component?: any // Dynamic component rendered in the body slot
44
+ componentProps?: Record<string, any>
45
+ [key: string]: any // Any extra payload your slot templates need
46
+ }
47
+ ```
48
+
49
+ ---
50
+
51
+ ### Events
52
+
53
+ | Event | Payload | Description |
54
+ | :----------- | :------------------------------------ | :---------------------------------------------------- |
55
+ | `step-click` | `(step: TimelineStep, index: number)` | Emitted when a step is clicked (`clickable` required) |
56
+
57
+ ---
58
+
59
+ ### Slots
60
+
61
+ Every slot receives the current `step` object and its `index` as slot props.
62
+
63
+ | Slot | Scope | Description |
64
+ | :---------- | :---------------- | :------------------------------------------------------------------------- |
65
+ | `indicator` | `{ step, index }` | Replaces the entire indicator (icon / number / dot) |
66
+ | `title` | `{ step, index }` | Replaces the step title text |
67
+ | `subtitle` | `{ step, index }` | Replaces the subtitle / date line beneath the title |
68
+ | `status` | `{ step, index }` | Replaces the status badge shown to the right of the title row |
69
+ | `body` | `{ step, index }` | Injected below the title/subtitle block — great for cards, avatars, extras |
70
+ | `content` | `{ step, index }` | Takes over the **entire** text area; use when you need full layout freedom |
71
+
72
+ > **Slot priority:** `content` overrides everything inside the text area.
73
+ > `title`, `subtitle`, `status`, and `body` are composable sub-slots within the default layout.
74
+
75
+ ---
76
+
77
+ ### Usage
78
+
79
+ #### Basic Horizontal
80
+
81
+ ```vue
82
+ <Timeline
83
+ :steps="[
84
+ { id: 1, title: 'Ordered', icon: 'lucide:shopping-cart' },
85
+ { id: 2, title: 'Processing', icon: 'lucide:settings' },
86
+ { id: 3, title: 'Shipped', icon: 'lucide:truck' },
87
+ { id: 4, title: 'Delivered', icon: 'lucide:check' },
88
+ ]"
89
+ :active-step="1"
90
+ direction="horizontal" />
91
+ ```
92
+
93
+ ---
94
+
95
+ #### Vertical — Numbered + Dashed Line + `#body` Slot
96
+
97
+ Use `#body` to inject content **below** the title/subtitle without replacing the header row.
98
+ Extra fields on each step object (e.g. `user`) are passed through to your template via slot props.
99
+
100
+ ```vue
101
+ <script setup lang="ts">
102
+ import type { TimelineStep } from 'vlite3'
103
+
104
+ const approvalSteps: TimelineStep[] = [
105
+ {
106
+ id: 1,
107
+ title: 'step',
108
+ subtitle: 'Initial Review',
109
+ status: 'Pending',
110
+ user: { name: 'Private Development Corp', role: 'Project Owner', initials: 'PD' },
111
+ },
112
+ {
113
+ id: 2,
114
+ title: 'step',
115
+ subtitle: 'Technical Review',
116
+ status: 'Pending',
117
+ user: {
118
+ name: 'XYZ Builders',
119
+ role: 'Project Contractor',
120
+ img: 'https://i.pravatar.cc/150?u=1',
121
+ },
122
+ },
123
+ {
124
+ id: 3,
125
+ title: 'step',
126
+ subtitle: 'Final Review',
127
+ status: 'Pending',
128
+ user: { name: 'Employee 1', role: 'Consultant', img: 'https://i.pravatar.cc/150?u=2' },
129
+ },
130
+ ]
131
+ </script>
132
+
133
+ <template>
134
+ <Timeline
135
+ :steps="approvalSteps"
136
+ :active-step="1"
137
+ direction="vertical"
138
+ indicator-type="number"
139
+ line-style="dashed">
140
+ <!-- #body is rendered below title+subtitle, above the connector line -->
141
+ <template #body="{ step }">
142
+ <div class="mt-4 flex items-center gap-4 p-4 bg-muted/20 rounded-xl border">
143
+ <img v-if="step.user.img" :src="step.user.img" class="w-12 h-12 rounded-lg object-cover" />
144
+ <div
145
+ v-else
146
+ class="w-12 h-12 rounded-lg bg-muted flex items-center justify-center font-bold">
147
+ {{ step.user.initials }}
148
+ </div>
149
+ <div class="flex flex-col">
150
+ <span class="text-sm font-semibold">{{ step.user.name }}</span>
151
+ <span class="text-xs text-muted-foreground">{{ step.user.role }}</span>
152
+ </div>
153
+ </div>
154
+ </template>
155
+ </Timeline>
156
+ </template>
157
+ ```
158
+
159
+ ---
160
+
161
+ #### Vertical — Dot Indicator + Full `#content` Override
162
+
163
+ Use `#content` when you need **complete control** over the entire text area (title, status badge, body — everything).
164
+
165
+ ```vue
166
+ <script setup lang="ts">
167
+ import type { TimelineStep } from 'vlite3'
168
+
169
+ const reviewSteps: TimelineStep[] = [
170
+ {
171
+ id: 1,
172
+ label: 'Step 1',
173
+ title: 'Step completed, moving forward',
174
+ date: '06 March 2026 1:26 am',
175
+ status: 'Completed',
176
+ logo: 'lucide:history',
177
+ },
178
+ {
179
+ id: 2,
180
+ label: 'Step 1',
181
+ title: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
182
+ date: '06 March 2026 1:26 am',
183
+ status: 'Approved',
184
+ logo: 'lucide:check',
185
+ },
186
+ {
187
+ id: 3,
188
+ label: 'Step 1',
189
+ title: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
190
+ date: '06 March 2026 1:26 am',
191
+ status: 'In Progress',
192
+ logo: 'lucide:loader-2',
193
+ },
194
+ ]
195
+ </script>
196
+
197
+ <template>
198
+ <Timeline :steps="reviewSteps" :active-step="2" direction="vertical" indicator-type="dot">
199
+ <!-- #content replaces the entire text area for each step -->
200
+ <template #content="{ step }">
201
+ <div class="border rounded-xl p-5 bg-card shadow-sm mb-2 hover:shadow-md transition-shadow">
202
+ <div class="flex justify-between items-start">
203
+ <div class="flex gap-4 items-center mb-4">
204
+ <div class="h-12 w-12 rounded-xl border bg-background flex items-center justify-center">
205
+ <Icon :icon="step.logo" class="h-6 w-6 text-muted-foreground" />
206
+ </div>
207
+ <div class="flex flex-col">
208
+ <span class="text-sm font-semibold">Acme</span>
209
+ <span class="text-xs text-muted-foreground">{{ step.label }}</span>
210
+ </div>
211
+ </div>
212
+ <span
213
+ class="inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-medium border">
214
+ {{ step.status }}
215
+ </span>
216
+ </div>
217
+ <div class="flex justify-between items-end mt-2">
218
+ <p class="text-sm max-w-md">{{ step.title }}</p>
219
+ <span class="text-xs text-muted-foreground">{{ step.date }}</span>
220
+ </div>
221
+ </div>
222
+ </template>
223
+ </Timeline>
224
+ </template>
225
+ ```
@@ -0,0 +1,89 @@
1
+ # ToastNotification
2
+
3
+ **Composable:** `import { useNotifications, showToast, toast } from 'vlite3'`
4
+ **Component:** `import { ToastNotification } from 'vlite3'`
5
+
6
+ `<ToastNotification />` provides a global, animated toast notification container supporting stacked alerts, multiple position anchors, and rich toast variants. Place `<ToastNotification />` once in your root layout (e.g., `App.vue`).
7
+
8
+ ---
9
+
10
+ ### Component Props
11
+
12
+ | Prop | Type | Default | Description |
13
+ | :--- | :--- | :--- | :--- |
14
+ | `position` | `ToastPosition` | — | Override default global notification position |
15
+ | `expand` | `boolean` | `false` | Force expanded list view of stacked toasts |
16
+
17
+ `ToastPosition` can be one of:
18
+ `'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'`
19
+
20
+ ---
21
+
22
+ ### Toast Variants
23
+
24
+ | Variant | Helper Method | Use Case | Visual Style |
25
+ | :--- | :--- | :--- | :--- |
26
+ | `success` | `toast.success(msg, options)` | Confirmed operations & positive updates | Green background (`bg-success`) with check icon |
27
+ | `error` | `toast.error(msg, options)` | Critical failures & system exceptions | Red background (`bg-danger`) with octagon X icon |
28
+ | `warning` | `toast.warning(msg, options)` | Non-critical warnings & soft blocks | Amber background (`bg-warning`) with alert icon |
29
+ | `info` | `toast.info(msg, options)` | Neutral status notices & announcements | Blue background (`bg-info`) with info icon |
30
+ | `default` | `toast(msg, options)` | Standard notifications & generic messages | Neutral background (`bg-gray-100`) with bell icon |
31
+
32
+ ---
33
+
34
+ ### Options Interface
35
+
36
+ ```ts
37
+ export interface ToastOptions {
38
+ description?: string
39
+ duration?: number // Milliseconds (use Infinity for persistent toasts)
40
+ action?: {
41
+ label: string
42
+ onClick: () => void
43
+ }
44
+ position?: ToastPosition
45
+ }
46
+ ```
47
+
48
+ ---
49
+
50
+ ### Composable Usage
51
+
52
+ ```ts
53
+ import { useNotifications, showToast, toast } from 'vlite3'
54
+
55
+ const { configure } = useNotifications()
56
+
57
+ // Configure global defaults
58
+ configure({
59
+ position: 'bottom-right',
60
+ duration: 4000,
61
+ variant: 'default',
62
+ })
63
+
64
+ // 1. Variant Helpers
65
+ toast.success('Profile updated', { description: 'Your changes have been saved.' })
66
+ toast.error('Payment failed', { description: 'Card declined. Please try another card.' })
67
+ toast.warning('Storage limit near', { description: 'You are using 90% of disk quota.' })
68
+ toast.info('Update available', { description: 'vLite3 v1.5.0 is ready to install.' })
69
+ toast('New message received', { description: 'Alex sent you a message.' })
70
+
71
+ // 2. Toast with Action Button
72
+ toast.warning('File deleted', {
73
+ description: 'Item will be permanently removed.',
74
+ action: {
75
+ label: 'Undo',
76
+ onClick: () => toast.success('Deletion canceled'),
77
+ },
78
+ })
79
+
80
+ // 3. Promise Wrapper
81
+ toast.promise(saveData(), {
82
+ loading: 'Saving changes...',
83
+ success: (data) => `Saved ${data.name} successfully`,
84
+ error: (err) => `Failed to save: ${err.message}`,
85
+ })
86
+
87
+ // 4. Low-level Direct Function Call
88
+ showToast('Operation status', 'info', { position: 'top-center', duration: 3000 })
89
+ ```
@@ -0,0 +1,31 @@
1
+ # Tooltip
2
+
3
+ **Import:** `import { Tooltip } from 'vlite3'`
4
+
5
+ ### Props
6
+
7
+ | Prop | Type | Default | Description |
8
+ | :------------- | :--------------------------------------- | :------ | :------------------- |
9
+ | `content` | `string` | — | Tooltip text |
10
+ | `contentI18n` | `string` | — | I18n key for text |
11
+ | `placement` | `'top' \| 'bottom' \| 'left' \| 'right'` | `top` | Position |
12
+ | `class` | `string` | — | Custom wrapper class |
13
+ | `className` | `string` | — | Tooltip popup class |
14
+ | `teleport` | `boolean` | `true` | Teleport to body |
15
+ | `arrow` | `boolean` | `true` | Show tooltip arrow |
16
+ | `contentClass` | `string` | `...` | Class for content |
17
+ | `triggerClass` | `string` | — | Class for trigger |
18
+ | `disabled` | `boolean` | `false` | Disable tooltip |
19
+
20
+ ### Slots
21
+
22
+ - `default`: Trigger element
23
+ - `content`: Custom HTML content (overrides `content` prop)
24
+
25
+ ### Usage
26
+
27
+ ```vue
28
+ <Tooltip content="Edit item">
29
+ <Button icon="lucide:edit" />
30
+ </Tooltip>
31
+ ```
@@ -0,0 +1,102 @@
1
+ # Workbook
2
+
3
+ **Import:** `import { Workbook } from 'vlite3'`
4
+
5
+ ### Description
6
+
7
+ A spreadsheet-like tab interface supporting drag-and-drop reordering, inline editing (renaming), duplication, and dynamic sheet management. It features horizontal overflow support, meaning that when the number of tabs exceeds the available width, the tabs area becomes scrollable while keeping the layout and Add button accessible.
8
+
9
+ ### Props
10
+
11
+ | Prop | Type | Default | Description |
12
+ | :------------------ | :------------------------------------------- | :-------------- | :-------------------------------------- |
13
+ | `sheets` | `WorkbookSheet[]` | `[]` | Array of sheet objects (v-model:sheets) |
14
+ | `modelValue` | `string` | `''` | Active sheet ID (v-model) |
15
+ | `editable` | `boolean` | `true` | Enable renaming and context menus |
16
+ | `addable` | `boolean` | `true` | Show add button |
17
+ | `draggable` | `boolean` | `true` | Enable drag-and-drop reordering |
18
+ | `addButtonPosition` | `'attached' \| 'fixed-right'` | `'fixed-right'` | Position of the add button |
19
+ | `allowIconChange` | `boolean` | `true` | Allow changing icons via context menu |
20
+ | `variant` | `'chrome' \| 'folder' \| 'simple' \| 'card'` | `'chrome'` | Visual style variant |
21
+ | `maxSheets` | `number` | `50` | Maximum number of sheets |
22
+ | `confirmDelete` | `boolean` | `false` | Show delete confirmation modal |
23
+ | `confirmDeleteTexts`| `object` | — | Custom text for delete confirmation |
24
+ | `class` | `string` | — | Custom wrapper class |
25
+ | `itemClass` | `string` | — | Class for sheet tabs |
26
+ | `activeItemClass` | `string` | — | Class for active sheet tab |
27
+ | `inactiveItemClass` | `string` | — | Class for inactive sheet tabs |
28
+
29
+ ### Slots
30
+
31
+ - `default`: The main content area displayed below the tabs.
32
+ - `left-addons`: Rendered to the left of the tabs container. Useful for global controls.
33
+ - `right-addons`: Rendered to the extreme right of the header, alongside the `fixed-right` add button.
34
+
35
+ ### Sheet Object (`WorkbookSheet`)
36
+
37
+ ```typescript
38
+ interface WorkbookSheet {
39
+ id: string
40
+ title: string
41
+ titleI18n?: string
42
+ icon?: string
43
+ closable?: boolean
44
+ disabled?: boolean
45
+ [key: string]: any // Custom data
46
+ }
47
+ ```
48
+
49
+ ### Events
50
+
51
+ - `@update:modelValue` (id: `string`): Emitted when active sheet changes (v-model binding).
52
+ - `@update:sheets` (sheets: `WorkbookSheet[]`): Emitted on reorder or property change.
53
+ - `@change` (id: `string`): Emitted when active sheet changes.
54
+ - `@add` (): Emitted when the add button is clicked.
55
+ - `@delete` (id: `string`): Emitted when a sheet is deleted.
56
+ - `@duplicate` (id: `string`): Emitted when "Duplicate" is selected.
57
+ - `@edit-start` (id: `string`): Emitted when renaming starts.
58
+ - `@edit-end` (id: `string`): Emitted when renaming ends.
59
+
60
+ ### Usage
61
+
62
+ #### Basic Workbook
63
+
64
+ ```vue
65
+ <script setup>
66
+ import { ref } from 'vue'
67
+
68
+ const activeSheet = ref('1')
69
+ const sheets = ref([
70
+ { id: '1', title: 'Dashboard', icon: 'lucide:layout' },
71
+ { id: '2', title: 'Settings', icon: 'lucide:settings' },
72
+ ])
73
+
74
+ const handleAdd = () => {
75
+ const id = Date.now().toString()
76
+ sheets.value.push({ id, title: 'New Sheet', icon: 'lucide:file' })
77
+ activeSheet.value = id
78
+ }
79
+ </script>
80
+
81
+ <template>
82
+ <Workbook v-model="activeSheet" v-model:sheets="sheets" @add="handleAdd">
83
+ <div class="p-4">Active Content: {{ activeSheet }}</div>
84
+ </Workbook>
85
+ </template>
86
+ ```
87
+
88
+ #### Full Featured (Draggable & Editable)
89
+
90
+ ```vue
91
+ <Workbook
92
+ v-model="activeId"
93
+ v-model:sheets="sheets"
94
+ editable
95
+ draggable
96
+ add-button-position="attached"
97
+ @add="handleAdd"
98
+ @delete="(id) => removeSheet(id)"
99
+ @duplicate="(id) => duplicateSheet(id)">
100
+ <!-- Content -->
101
+ </Workbook>
102
+ ```