@stlhorizon/vue-ui 2.9.0 → 2.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +62 -1
- package/dist/index.esm.js +3140 -2888
- package/dist/index.js +21 -21
- package/dist/src/components/DataTableFilters.vue.d.ts +7 -1
- package/dist/src/components/DataTableFilters.vue.d.ts.map +1 -1
- package/dist/src/components/StepperItem.vue.d.ts +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/vue-ui.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -170,10 +170,71 @@ describe('Component', () => {
|
|
|
170
170
|
|
|
171
171
|
# Component Usage Documentation
|
|
172
172
|
|
|
173
|
-
This document provides comprehensive usage examples and API reference for all Vue components in the STL Horizon Vue Atomic UI library.
|
|
173
|
+
This document provides comprehensive usage examples and API reference for all Vue components and directives in the STL Horizon Vue Atomic UI library.
|
|
174
|
+
|
|
175
|
+
## Tooltip Directive
|
|
176
|
+
|
|
177
|
+
A custom Vue directive for displaying tooltips on hover with customizable positioning and styling.
|
|
178
|
+
|
|
179
|
+
### Usage
|
|
180
|
+
|
|
181
|
+
```vue
|
|
182
|
+
<template>
|
|
183
|
+
<div>
|
|
184
|
+
<!-- Basic tooltip -->
|
|
185
|
+
<Button v-tooltip="'This is a tooltip'">Hover me</Button>
|
|
186
|
+
|
|
187
|
+
<!-- Tooltip with position modifier -->
|
|
188
|
+
<Button v-tooltip.bottom="'Tooltip at bottom'">Hover me</Button>
|
|
189
|
+
<Button v-tooltip.left="'Tooltip on left'">Hover me</Button>
|
|
190
|
+
<Button v-tooltip.right="'Tooltip on right'">Hover me</Button>
|
|
191
|
+
<Button v-tooltip.top="'Tooltip on top'">Hover me</Button>
|
|
192
|
+
</div>
|
|
193
|
+
</template>
|
|
194
|
+
|
|
195
|
+
<script setup>
|
|
196
|
+
import Button from '@/components/Button.vue'
|
|
197
|
+
</script>
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Position Modifiers
|
|
201
|
+
|
|
202
|
+
- `v-tooltip` or `v-tooltip.top` - Tooltip appears above the element
|
|
203
|
+
- `v-tooltip.bottom` - Tooltip appears below the element
|
|
204
|
+
- `v-tooltip.left` - Tooltip appears to the left of the element
|
|
205
|
+
- `v-tooltip.right` - Tooltip appears to the right of the element
|
|
206
|
+
|
|
207
|
+
### Features
|
|
208
|
+
|
|
209
|
+
- **Automatic positioning**: Tooltips are positioned automatically based on available space
|
|
210
|
+
- **Smooth animations**: Fade in/out transitions for better UX
|
|
211
|
+
- **Arrow indicators**: Visual arrows pointing to the target element
|
|
212
|
+
- **Accessibility**: Proper ARIA attributes and keyboard support
|
|
213
|
+
- **Customizable styling**: Black background with white text, easily customizable via CSS
|
|
214
|
+
- **Event handling**: Shows on mouseenter, hides on mouseleave and click
|
|
215
|
+
|
|
216
|
+
### Styling
|
|
217
|
+
|
|
218
|
+
The tooltip uses the following default styles:
|
|
219
|
+
- Background: Semi-transparent black (`rgba(0, 0, 0, 0.9)`)
|
|
220
|
+
- Text color: White
|
|
221
|
+
- Padding: 6px 12px
|
|
222
|
+
- Border radius: 4px
|
|
223
|
+
- Font size: 14px
|
|
224
|
+
- Z-index: 9999
|
|
225
|
+
|
|
226
|
+
You can customize the appearance by targeting the `.tooltip-custom` class in your CSS.
|
|
227
|
+
|
|
228
|
+
### Implementation Details
|
|
229
|
+
|
|
230
|
+
The directive creates a tooltip element dynamically and positions it relative to the viewport. It includes cleanup on component unmount to prevent memory leaks.
|
|
231
|
+
|
|
232
|
+
or else import in the main.js as
|
|
233
|
+
### app.directive('tooltip', tooltip)
|
|
174
234
|
|
|
175
235
|
## Table of Contents
|
|
176
236
|
|
|
237
|
+
- [Tooltip Directive](#tooltip-directive)
|
|
177
238
|
- [Accordion](#accordion)
|
|
178
239
|
- [AccordionItem](#accordionitem)
|
|
179
240
|
- [Alert](#alert)
|