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,67 @@
1
+ # GoogleLogin
2
+
3
+ **Import:** `import { GoogleLogin } from 'vlite3'`
4
+
5
+ ### Description
6
+
7
+ A lightweight component integrating `vue3-google-login` for seamless Google OAuth authentication. Supports native visual styling or custom slot overrides.
8
+
9
+ ### Props
10
+
11
+ | Prop | Type | Default | Description |
12
+ | :--------------- | :-------- | :-------------------- | :-------------------------------- |
13
+ | `clientId` | `string` | required | Google OAuth Client ID |
14
+ | `buttonText` | `string` | `Sign in with Google` | Label text for the default button |
15
+ | `buttonTextI18n` | `string` | — | I18n translation key for text |
16
+ | `btnClass` | `string` | — | Custom class for the button |
17
+ | `variant` | `string` | `outline` | Visual style variant of button |
18
+ | `size` | `string` | `md` | Dimensions scale |
19
+ | `rounded` | `string` | `md` | Border radius |
20
+ | `disabled` | `boolean` | `false` | Disable the interaction |
21
+
22
+ ### Events
23
+
24
+ - `@success`: Emitted when Google login is successfully executed, returning the response object.
25
+ - `@error`: Emitted when Google login fails or throws an error.
26
+
27
+ ### Slots
28
+
29
+ | Slot | Description | Scoped Props |
30
+ | :-------- | :------------------------ | :----------------------------------------------------------- |
31
+ | `default` | Custom button replacement | `{ login: () => void, loading: boolean, disabled: boolean }` |
32
+
33
+ ### Usage
34
+
35
+ #### Basic Usage
36
+
37
+ ```vue
38
+ <script setup>
39
+ import { GoogleLogin } from 'vlite3'
40
+
41
+ const handleSuccess = (response) => {
42
+ console.log('Token received', response)
43
+ }
44
+ </script>
45
+
46
+ <template>
47
+ <GoogleLogin clientId="YOUR_GOOGLE_CLIENT_ID" @success="handleSuccess" @error="console.error" />
48
+ </template>
49
+ ```
50
+
51
+ #### Custom Slot Implementation
52
+
53
+ ```vue
54
+ <GoogleLogin clientId="YOUR_GOOGLE_CLIENT_ID" @success="handleSuccess" @error="handleError">
55
+ <template #default="{ login, loading, disabled }">
56
+ <Button
57
+ variant="primary"
58
+ :loading="loading"
59
+ :disabled="disabled"
60
+ @click="login"
61
+ icon="lucide:log-in"
62
+ >
63
+ Custom Google Sign-in
64
+ </Button>
65
+ </template>
66
+ </GoogleLogin>
67
+ ```
@@ -0,0 +1,128 @@
1
+ # GoogleMap
2
+
3
+ **Import:** `import { GoogleMap, type GoogleMapMarker } from 'vlite3'`
4
+
5
+ `GoogleMap` is a browser-only, responsive Google Maps wrapper. It loads the Google Maps JavaScript
6
+ API only when the first map mounts and shares that load across every map instance on the page. No
7
+ additional package is required.
8
+
9
+ ## API key configuration
10
+
11
+ Enable the **Maps JavaScript API** in Google Cloud, then configure the key once through the existing
12
+ vlite3 plugin:
13
+
14
+ ```ts
15
+ import { createApp } from 'vue'
16
+ import { createVLite } from 'vlite3'
17
+ import App from './App.vue'
18
+
19
+ createApp(App)
20
+ .use(
21
+ createVLite({
22
+ components: {
23
+ googleMap: { apiKey: import.meta.env.VITE_GOOGLE_MAPS_API_KEY },
24
+ },
25
+ })
26
+ )
27
+ .mount('#app')
28
+ ```
29
+
30
+ The local `api-key` prop overrides global configuration. Never commit a key to source control.
31
+ Restrict browser keys by HTTP referrer and restrict their API access to Maps JavaScript API in
32
+ Google Cloud. Client-side keys are visible to browsers by design; restrictions are the security
33
+ boundary.
34
+
35
+ ## Basic coordinate and single marker
36
+
37
+ ```vue
38
+ <script setup lang="ts">
39
+ import { GoogleMap } from 'vlite3'
40
+
41
+ const location = { lat: 24.8607, lng: 67.0011 }
42
+ </script>
43
+
44
+ <template>
45
+ <GoogleMap :center="location" :markers="[{ ...location, title: 'Office', label: 'O' }]" />
46
+ </template>
47
+ ```
48
+
49
+ ## Multiple markers, independent center, and zoom
50
+
51
+ ```vue
52
+ <script setup lang="ts">
53
+ import { ref } from 'vue'
54
+ import { GoogleMap, type GoogleMapMarker } from 'vlite3'
55
+
56
+ const center = { lat: 24.8607, lng: 67.0011 }
57
+ const zoom = ref(11)
58
+ const markers: GoogleMapMarker[] = [
59
+ { id: 1, lat: 24.8607, lng: 67.0011, title: 'Location A', label: 'A' },
60
+ { id: 2, lat: 24.817, lng: 66.985, title: 'Location B', label: 'B' },
61
+ ]
62
+ </script>
63
+
64
+ <template>
65
+ <GoogleMap
66
+ :center="center"
67
+ :markers="markers"
68
+ :zoom="zoom"
69
+ height="clamp(280px, 50vh, 560px)"
70
+ @marker-click="console.log($event.marker)" />
71
+ </template>
72
+ ```
73
+
74
+ If `center` is omitted, the first valid marker is used. Duplicate marker coordinates are valid and
75
+ render independently. Empty markers are valid when a valid center is supplied.
76
+
77
+ ## Props
78
+
79
+ | Prop | Type | Default | Description |
80
+ | :--- | :--- | :--- | :--- |
81
+ | `apiKey` | `string` | global config | Local API-key override. |
82
+ | `center` | `GoogleMapCoordinate \| null` | first valid marker | Map center, independent from markers. |
83
+ | `markers` | `GoogleMapMarker[]` | `[]` | Markers with `lat`, `lng`, optional `id`, `title`, and `label`. |
84
+ | `zoom` | `number` | `12` | Map zoom. Reactive after initialization. |
85
+ | `height` | `string \| number` | `'400px'` | CSS height; numbers are treated as pixels. |
86
+ | `width` | `string \| number` | `'100%'` | CSS width; numbers are treated as pixels. |
87
+ | `options` | `GoogleMapOptions` | `{}` | Essential Google Map options such as controls, dragging, scrolling, or `mapId`. |
88
+ | `ariaLabel` | `string` | `'Interactive Google map'` | Accessible region label. |
89
+ | `loadingText` | `string` | `'Loading map…'` | Default loading message. |
90
+ | `errorText` | `string` | `'The map is unavailable.'` | Prefix for the default failure message. |
91
+
92
+ ## Events
93
+
94
+ | Event | Payload | Description |
95
+ | :--- | :--- | :--- |
96
+ | `ready` | `{ map: unknown }` | Map initialized. The instance is intentionally opaque. |
97
+ | `click` | `{ coordinate, nativeEvent }` | Map surface clicked. |
98
+ | `center-changed` | `GoogleMapCoordinate` | Center changed by props or interaction. |
99
+ | `zoom-changed` | `number` | Zoom changed by props or interaction. |
100
+ | `marker-click` | `{ marker, index, nativeEvent }` | Marker clicked. |
101
+ | `error` | `GoogleMapError` | Validation, SSR, configuration, or load failure. |
102
+
103
+ ## Loading, failure, and slots
104
+
105
+ The component shows an accessible status while loading and an alert when configuration,
106
+ coordinates, or network loading fails. Invalid markers are omitted and announced without crashing
107
+ the map. Customize states with `#loading` and `#error="{ error }"` slots.
108
+
109
+ Coordinate validation requires finite numeric latitude in `-90..90` and longitude in `-180..180`.
110
+ A missing key, invalid center with no valid fallback marker, unavailable browser APIs, and script
111
+ load failure all emit `error` with a stable error code.
112
+
113
+ ## Responsive and lifecycle behavior
114
+
115
+ The default width is responsive. Use CSS values such as `100%`, `50vh`, or `clamp()` for sizing.
116
+ The component observes its container and asks Google Maps to resize without recreating the map.
117
+ Ensure its parent ultimately provides non-zero height; a zero-height value cannot display map
118
+ tiles. Center, zoom, options, and markers update the existing instance.
119
+
120
+ Multiple maps reuse one script request. All map/marker listeners and resize observers are removed
121
+ when an instance unmounts. The loaded Google script remains page-global, as required by Google
122
+ Maps, so later mounts do not download it again.
123
+
124
+ ## SSR limitation
125
+
126
+ The component renders its fallback markup during server rendering and initializes only after a
127
+ browser mount. In SSR applications, render it client-side when possible. A direct loader call
128
+ without `window` rejects with `ssr-unavailable`; it never crashes application rendering.
@@ -0,0 +1,80 @@
1
+ # Heatmap
2
+
3
+ **Import:** `import { Heatmap } from 'vlite3'`
4
+
5
+ ### Description
6
+
7
+ An interactive heatmap suitable for visualizing activity, time-series data, or density across a grid. Supports both calendar-style (sequential) and coordinate-based (grid) layouts.
8
+
9
+ ### Props
10
+
11
+ | Prop | Type | Default | Description |
12
+ | :----------------- | :----------------------- | :--------------------- | :---------------------------------------- |
13
+ | `data` | `HeatmapDataPoint[]` | required | Array of data points |
14
+ | `layout` | `'grid' \| 'sequential'` | `'grid'` | Layout mode |
15
+ | `interactive` | `boolean` | `true` | Enable hover and click effects |
16
+ | `showLegend` | `boolean` | `true` | Show gradient legend at bottom |
17
+ | `showLabels` | `boolean` | `false` | Show values inside cells |
18
+ | `responsive` | `boolean` | `true` | Auto-calculate cell size to fit container |
19
+ | `minValue` | `number` | calculated | Min value for color normalization |
20
+ | `maxValue` | `number` | calculated | Max value for color normalization |
21
+ | `colorConfig` | `HeatmapColorConfig` | `{ scheme: 'github' }` | Color scheme configuration |
22
+ | `gridConfig` | `object` | `{ rows: 7, gap: 3 }` | Config for grid layout |
23
+ | `sequentialConfig` | `object` | `{ itemsPerRow: 7 }` | Config for sequential layout |
24
+ | `tooltipConfig` | `object` | `{ enabled: true }` | Tooltip settings |
25
+ | `minCellSize` | `number` | `8` | Minimum cell size |
26
+ | `maxCellSize` | `number` | `20` | Maximum cell size |
27
+ | `class` | `string` | — | Container class |
28
+ | `cellClass` | `string` | — | Extra class for cells |
29
+ | `emptyCellClass` | `string` | — | Extra class for empty cells |
30
+
31
+ ### Data Format (`HeatmapDataPoint`)
32
+
33
+ ```typescript
34
+ interface HeatmapDataPoint {
35
+ x: number // Column index (or linear index for sequential)
36
+ y: number // Row index
37
+ value: number // Value for intensity
38
+ date?: string // Optional ISO date string
39
+ tooltip?: string // Custom tooltip text
40
+ [key: string]: any // Any other data to pass through
41
+ }
42
+ ```
43
+
44
+ ### Events
45
+
46
+ - `@cell-click` (cell: `HeatmapCell`, event: `MouseEvent`): Emitted when a cell is clicked.
47
+ - `@cell-hover` (cell: `HeatmapCell | null`, event: `MouseEvent`): Emitted on mouse enter/leave.
48
+
49
+ ### Usage
50
+
51
+ #### Basic Activity Grid
52
+
53
+ ```vue
54
+ <script setup>
55
+ const data = [
56
+ { x: 0, y: 0, value: 5 },
57
+ { x: 0, y: 1, value: 10 },
58
+ // ...
59
+ ]
60
+ </script>
61
+
62
+ <template>
63
+ <Heatmap
64
+ :data="data"
65
+ :color-config="{ scheme: 'green' }"
66
+ @cell-click="(cell) => console.log(cell)" />
67
+ </template>
68
+ ```
69
+
70
+ #### Sequential Timeline (Github Style)
71
+
72
+ ```vue
73
+ <Heatmap
74
+ :data="data"
75
+ layout="sequential"
76
+ :sequential-config="{ itemsPerRow: 7, gap: 2 }"
77
+ :tooltip-config="{
78
+ formatter: (cell) => `${cell.value} commits on ${cell.date}`,
79
+ }" />
80
+ ```
@@ -0,0 +1,58 @@
1
+ # IconPicker
2
+
3
+ **Import:** `import { IconPicker } from 'vlite3'`
4
+
5
+ The picker follows the icon mode configured by `createVLite()`:
6
+
7
+ - Online mode preserves the existing remote Iconify catalogue search.
8
+ - Hybrid mode shows registered local icons initially and permits remote search.
9
+ - Offline mode never mounts the remote-search picker. It searches, paginates,
10
+ and renders only icons returned by `listVLiteIcons()`.
11
+
12
+ When no local data is registered, the offline picker displays a clear empty
13
+ state. A selected locally registered identifier continues to render after a
14
+ refresh without network access.
15
+
16
+ ### Props
17
+
18
+ | Prop | Type | Default | Description |
19
+ | :---------------- | :------------------ | :---------------------- | :---------------------------------- |
20
+ | `value` | `string` | `'tabler:icons-filled'` | Selected icon name |
21
+ | `position` | `TooltTipPlacement` | `'bottom'` | Picker dropdown position |
22
+ | `btnProps` | `ButtonProps` | — | Props to pass to the trigger button |
23
+ | `placeholder` | `string` | — | Placeholder for the search input |
24
+ | `placeholderI18n` | `string` | — | I18n key for the placeholder |
25
+
26
+ ### Events
27
+
28
+ - `@onSelect`: Emitted when an icon is selected (`value`, `svg`)
29
+ - `@onTrigger`: Emitted when the trigger button is clicked
30
+ - `@onClose`: Emitted when the picker closes
31
+
32
+ ### Slots
33
+
34
+ | Slot | Description | Props |
35
+ | :--------- | :-------------------------- | :---------- |
36
+ | `default` | Custom trigger element | — |
37
+ | `menu-top` | Content above the icon grid | `{ close }` |
38
+
39
+ ### Usage
40
+
41
+ #### Basic Usage
42
+
43
+ ```vue
44
+ <IconPicker :value="selectedIcon" @on-select="(val) => (selectedIcon = val)" />
45
+
46
+ <Icon :icon="selectedIcon" />
47
+ ```
48
+
49
+ #### Custom Trigger
50
+
51
+ ```vue
52
+ <IconPicker v-model="icon">
53
+ <Button variant="ghost">Select Icon</Button>
54
+ </IconPicker>
55
+ ```
56
+
57
+ For strict offline setup, selected-icon extraction, dynamic identifiers, and
58
+ complete collection bundling, see [Icon](./icon.md).
@@ -0,0 +1,176 @@
1
+ # Icon
2
+
3
+ **Import:** `import { Icon } from 'vlite3'`
4
+
5
+ `Icon` renders Iconify identifiers, directly supplied Iconify data, image sources,
6
+ and emoji. Iconify loading is online by default for backward compatibility.
7
+
8
+ ## Props
9
+
10
+ | Prop | Type | Default | Description |
11
+ | --- | --- | --- | --- |
12
+ | `icon` | `string \| IconifyIcon` | `''` | Iconify ID, local icon data, image URL, data URI, or local image path |
13
+ | `emoji` | `string` | `''` | Native emoji character such as `🚀` |
14
+
15
+ ```vue
16
+ <Icon icon="lucide:settings" class="h-4 w-4" />
17
+ <Icon icon="/assets/logo.svg" class="h-6 w-6" />
18
+ <Icon icon="data:image/svg+xml;base64,..." />
19
+ <Icon emoji="🔥" class="text-xl" />
20
+ ```
21
+
22
+ ## Resolution modes
23
+
24
+ Configure icon behavior synchronously through `createVLite()`:
25
+
26
+ | Mode | Behavior |
27
+ | --- | --- |
28
+ | `online` | Default. Icon strings use normal Iconify API resolution. |
29
+ | `hybrid` | Registered local data is preferred; unknown strings may load online. |
30
+ | `offline` | Only registered data is rendered. Unknown strings never reach Iconify's API loader. |
31
+
32
+ `@iconify/vue` is a `vlite3` runtime dependency with a `^5.0.0` contract and is
33
+ installed automatically. Package-manager deduplication keeps registration and
34
+ rendering on the same Iconify storage instance.
35
+
36
+ ### Complete local collection
37
+
38
+ This is useful for extensions, icon pickers, and runtime-generated icon names:
39
+
40
+ ```ts
41
+ import { createApp } from 'vue'
42
+ import { icons as lucideIcons } from '@iconify-json/lucide'
43
+ import { createVLite } from 'vlite3'
44
+ import App from './App.vue'
45
+
46
+ const app = createApp(App)
47
+
48
+ app.use(
49
+ createVLite({
50
+ icons: {
51
+ mode: 'offline',
52
+ collections: [lucideIcons],
53
+ fallback: 'lucide:circle-help',
54
+ warnOnMissing: true,
55
+ },
56
+ })
57
+ )
58
+
59
+ app.mount('#app')
60
+ ```
61
+
62
+ Collections and individual icons are registered during plugin installation,
63
+ before any component can render. The fallback must also be locally registered
64
+ in offline mode. With no fallback, a missing offline icon renders nothing.
65
+ Warnings are deduplicated by identifier.
66
+
67
+ ### Individual icons and custom collections
68
+
69
+ ```ts
70
+ import {
71
+ registerVLiteIcon,
72
+ registerVLiteIconCollection,
73
+ type VLiteIconData,
74
+ } from 'vlite3'
75
+
76
+ const logo: VLiteIconData = {
77
+ body: '<path d="M2 2h20v20H2z" />',
78
+ width: 24,
79
+ height: 24,
80
+ }
81
+
82
+ registerVLiteIcon('company:logo', logo)
83
+ registerVLiteIconCollection(myPartialCollection)
84
+ ```
85
+
86
+ You can also configure individual data with
87
+ `icons.individualIcons`, either as `{ name, data }[]` or a record keyed by icon
88
+ identifier. Re-registering the same icon or collection is skipped.
89
+
90
+ The stable public registry API includes:
91
+
92
+ - `registerVLiteIcon()`
93
+ - `registerVLiteIconCollection()` and `registerVLiteIconCollections()`
94
+ - `registerVLiteIcons()`
95
+ - `hasVLiteIcon()`
96
+ - `resolveVLiteIcon()`
97
+ - `listVLiteIcons()`
98
+ - `getVLiteIconConfig()`
99
+
100
+ Non-Vite consumers can import a local IconifyJSON collection and use either
101
+ `createVLite()` or these manual registration functions. They do not need to
102
+ call `@iconify/vue` APIs directly.
103
+
104
+ ## Selected-icon Vite bundles
105
+
106
+ For normal applications, bundling selected icons is smaller than including a
107
+ complete collection:
108
+
109
+ ```ts
110
+ // vite.config.ts
111
+ import { defineConfig } from 'vite'
112
+ import vue from '@vitejs/plugin-vue'
113
+ import { vliteIcons } from 'vlite3/vite'
114
+
115
+ export default defineConfig({
116
+ plugins: [
117
+ vue(),
118
+ vliteIcons({
119
+ mode: 'offline',
120
+ include: ['src/**/*.{vue,ts,tsx,js,jsx}'],
121
+ icons: [
122
+ // Explicitly include runtime-generated values.
123
+ 'lucide:settings',
124
+ 'lucide:search',
125
+ 'lucide:circle-alert',
126
+ ],
127
+ }),
128
+ ],
129
+ })
130
+ ```
131
+
132
+ ```ts
133
+ // main.ts
134
+ app.use(
135
+ createVLite({
136
+ icons: {
137
+ mode: 'offline',
138
+ fallback: 'lucide:circle-help',
139
+ warnOnMissing: true,
140
+ },
141
+ })
142
+ )
143
+ ```
144
+
145
+ The Vite integration:
146
+
147
+ - scans configured source files and the installed `vlite3` distribution;
148
+ - reads only installed, version-locked `@iconify-json/<prefix>` packages;
149
+ - generates deterministic partial collections and registers them before HTML
150
+ entry modules execute;
151
+ - deduplicates identifiers and collection data;
152
+ - reports unresolved identifiers;
153
+ - never downloads icon data.
154
+
155
+ Install every scanned collection explicitly, for example:
156
+
157
+ ```bash
158
+ npm install @iconify-json/lucide
159
+ ```
160
+
161
+ Static scanning cannot discover values from APIs, databases, user settings,
162
+ string concatenation, or arbitrary component props. Put those IDs in the
163
+ plugin's `icons` array.
164
+
165
+ To bundle a complete installed collection intentionally:
166
+
167
+ ```ts
168
+ vliteIcons({
169
+ mode: 'offline',
170
+ collections: ['lucide'],
171
+ })
172
+ ```
173
+
174
+ Complete collections are appropriate for icon pickers or unrestricted dynamic
175
+ content, but are never bundled by default. Set `autoRegister: false` only when
176
+ you want to import and control `virtual:vlite-icons` yourself.
@@ -0,0 +1,51 @@
1
+ # ImageComparison
2
+
3
+ **Import:** `import { ImageComparison } from 'vlite3'`
4
+
5
+ A highly optimized before/after slider component to showcase visual differences. Perfect for AI generation apps, photo editing features, and portfolio showcases. Built with multi-touch support and GPU-accelerated smooth animations.
6
+
7
+ ### Props
8
+
9
+ | Prop | Type | Default | Description |
10
+ | :---------------- | :----------------- | :--------- | :--------------------------------------------- |
11
+ | `beforeImage` | `string` | — | URL or path of the "before" image |
12
+ | `afterImage` | `string` | — | URL or path of the "after" image |
13
+ | `beforeLabel` | `string` | `'Before'` | Label text for the before image |
14
+ | `afterLabel` | `string` | `'After'` | Label text for the after image |
15
+ | `initialPosition` | `number` | `50` | Initial position of the slider handle (0-100) |
16
+ | `hover` | `boolean` | `false` | Enable sliding by hovering instead of dragging |
17
+ | `width` | `string \| number` | `'100%'` | Width of the container |
18
+ | `height` | `string \| number` | `'auto'` | Height of the container |
19
+ | `containerClass` | `string` | `''` | Custom CSS class for the root container |
20
+ | `handleClass` | `string` | `''` | Custom CSS class for the slider handle |
21
+ | `showHandle` | `boolean` | `true` | Show or hide the handle icon on the divider |
22
+ | `variant` | `'one' \| 'two'` | `'one'` | Visual style of the comparison slider |
23
+
24
+ ### Usage
25
+
26
+ #### Standard Comparison
27
+
28
+ ```vue
29
+ <template>
30
+ <ImageComparison
31
+ beforeImage="https://cdn.example.com/before.webp"
32
+ afterImage="https://cdn.example.com/after.webp"
33
+ />
34
+ </template>
35
+ ```
36
+
37
+ #### Hover Interaction
38
+
39
+ Set `:hover="true"` to allow users to slide simply by moving their cursor over the image. Perfect for quick exploration.
40
+
41
+ ```vue
42
+ <template>
43
+ <ImageComparison
44
+ beforeImage="https://cdn.example.com/before.webp"
45
+ afterImage="https://cdn.example.com/after.webp"
46
+ :hover="true"
47
+ beforeLabel="Raw Capture"
48
+ afterLabel="AI Enhanced"
49
+ />
50
+ </template>
51
+ ```
@@ -0,0 +1,26 @@
1
+ # ImageMagnifier
2
+
3
+ **Import:** `import { ImageMagnifier } from 'vlite3'`
4
+
5
+ ### Props
6
+
7
+ | Prop | Type | Default | Description |
8
+ | --- | --- | --- | --- |
9
+ | `src` | `string` | **required** | Image source URL |
10
+ | `alt` | `string` | `'Magnifiable Image'` | Image alt text |
11
+ | `zoom` | `number` | `2` | Magnification zoom level |
12
+ | `magnifierSize` | `number` | `120` | Width and height of the magnifier glass in pixels |
13
+ | `glass` | `boolean` | `true` | Apply a subtle backdrop blur effect on the magnifier |
14
+ | `class` | `any` | — | Custom class for the wrapper element |
15
+ | `imageClass` | `any` | — | Custom class for the image element |
16
+
17
+ ### Usage
18
+
19
+ ```vue
20
+ <ImageMagnifier
21
+ src="https://images.unsplash.com/photo-1542291026-7eec264c27ff"
22
+ alt="Red shoes"
23
+ :zoom="2.5"
24
+ :magnifierSize="150"
25
+ />
26
+ ```