@umbra.ui/core 0.1.0
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/dist/components/controls/Dropdown/types.d.ts +5 -0
- package/dist/components/controls/Dropdown/types.d.ts.map +1 -0
- package/dist/components/controls/Dropdown/types.js +1 -0
- package/dist/components/controls/SegmentedControl/types.d.ts +6 -0
- package/dist/components/controls/SegmentedControl/types.d.ts.map +1 -0
- package/dist/components/controls/SegmentedControl/types.js +1 -0
- package/dist/components/dialogs/Alert/types.d.ts +7 -0
- package/dist/components/dialogs/Alert/types.d.ts.map +1 -0
- package/dist/components/dialogs/Alert/types.js +1 -0
- package/dist/components/dialogs/Toast/types.d.ts +34 -0
- package/dist/components/dialogs/Toast/types.d.ts.map +1 -0
- package/dist/components/dialogs/Toast/types.js +10 -0
- package/dist/components/dialogs/Toast/useToast.d.ts +36 -0
- package/dist/components/dialogs/Toast/useToast.d.ts.map +1 -0
- package/dist/components/dialogs/Toast/useToast.js +90 -0
- package/dist/components/indicators/Tooltip/tooltip.d.ts +3 -0
- package/dist/components/indicators/Tooltip/tooltip.d.ts.map +1 -0
- package/dist/components/indicators/Tooltip/tooltip.js +33 -0
- package/dist/components/indicators/Tooltip/types.d.ts +14 -0
- package/dist/components/indicators/Tooltip/types.d.ts.map +1 -0
- package/dist/components/indicators/Tooltip/types.js +1 -0
- package/dist/components/indicators/Tooltip/useTooltip.d.ts +18 -0
- package/dist/components/indicators/Tooltip/useTooltip.d.ts.map +1 -0
- package/dist/components/indicators/Tooltip/useTooltip.js +57 -0
- package/dist/components/inputs/Tags/tag-bar-styles.d.ts +14 -0
- package/dist/components/inputs/Tags/tag-bar-styles.d.ts.map +1 -0
- package/dist/components/inputs/Tags/tag-bar-styles.js +313 -0
- package/dist/components/inputs/Tags/types.d.ts +93 -0
- package/dist/components/inputs/Tags/types.d.ts.map +1 -0
- package/dist/components/inputs/Tags/types.js +216 -0
- package/dist/components/inputs/search/types.d.ts +9 -0
- package/dist/components/inputs/search/types.d.ts.map +1 -0
- package/dist/components/inputs/search/types.js +1 -0
- package/dist/components/navigation/adaptive/types.d.ts +16 -0
- package/dist/components/navigation/adaptive/types.d.ts.map +1 -0
- package/dist/components/navigation/adaptive/types.js +1 -0
- package/dist/components/navigation/adaptive/useAdaptiveLayout.d.ts +27 -0
- package/dist/components/navigation/adaptive/useAdaptiveLayout.d.ts.map +1 -0
- package/dist/components/navigation/adaptive/useAdaptiveLayout.js +40 -0
- package/dist/components/navigation/adaptive/useBreakpoints.d.ts +6 -0
- package/dist/components/navigation/adaptive/useBreakpoints.d.ts.map +1 -0
- package/dist/components/navigation/adaptive/useBreakpoints.js +37 -0
- package/dist/components/navigation/adaptive/useContainerMonitor.d.ts +93 -0
- package/dist/components/navigation/adaptive/useContainerMonitor.d.ts.map +1 -0
- package/dist/components/navigation/adaptive/useContainerMonitor.js +145 -0
- package/dist/components/navigation/adaptive/useViewAnimation.d.ts +31 -0
- package/dist/components/navigation/adaptive/useViewAnimation.d.ts.map +1 -0
- package/dist/components/navigation/adaptive/useViewAnimation.js +591 -0
- package/dist/components/navigation/adaptive/useViewResize.d.ts +52 -0
- package/dist/components/navigation/adaptive/useViewResize.d.ts.map +1 -0
- package/dist/components/navigation/adaptive/useViewResize.js +146 -0
- package/dist/components/navigation/navstack/useNavigationStack.d.ts +25 -0
- package/dist/components/navigation/navstack/useNavigationStack.d.ts.map +1 -0
- package/dist/components/navigation/navstack/useNavigationStack.js +133 -0
- package/dist/components/navigation/slideover/useSlideoverController.d.ts +20 -0
- package/dist/components/navigation/slideover/useSlideoverController.d.ts.map +1 -0
- package/dist/components/navigation/slideover/useSlideoverController.js +267 -0
- package/dist/components/navigation/splitview/useSplitViewController.d.ts +20 -0
- package/dist/components/navigation/splitview/useSplitViewController.d.ts.map +1 -0
- package/dist/components/navigation/splitview/useSplitViewController.js +325 -0
- package/dist/components/navigation/tabcontroller/types.d.ts +21 -0
- package/dist/components/navigation/tabcontroller/types.d.ts.map +1 -0
- package/dist/components/navigation/tabcontroller/types.js +1 -0
- package/dist/components/navigation/tabcontroller/useTabController.d.ts +5 -0
- package/dist/components/navigation/tabcontroller/useTabController.d.ts.map +1 -0
- package/dist/components/navigation/tabcontroller/useTabController.js +10 -0
- package/dist/components/navigation/types.d.ts +8 -0
- package/dist/components/navigation/types.d.ts.map +1 -0
- package/dist/components/navigation/types.js +1 -0
- package/dist/components/pickers/CollectionPicker/types.d.ts +11 -0
- package/dist/components/pickers/CollectionPicker/types.d.ts.map +1 -0
- package/dist/components/pickers/CollectionPicker/types.js +1 -0
- package/dist/components/pickers/ColorPicker/colors.d.ts +13 -0
- package/dist/components/pickers/ColorPicker/colors.d.ts.map +1 -0
- package/dist/components/pickers/ColorPicker/colors.js +266 -0
- package/dist/components/pickers/FilePicker/types.d.ts +10 -0
- package/dist/components/pickers/FilePicker/types.d.ts.map +1 -0
- package/dist/components/pickers/FilePicker/types.js +1 -0
- package/dist/index.d.ts +91 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +196 -0
- package/dist/theme.d.ts +73 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +279 -0
- package/dist/themes/blank.d.ts +7 -0
- package/dist/themes/blank.d.ts.map +1 -0
- package/dist/themes/blank.js +543 -0
- package/dist/themes/crimson-dark.d.ts +4 -0
- package/dist/themes/crimson-dark.d.ts.map +1 -0
- package/dist/themes/crimson-dark.js +552 -0
- package/dist/themes/cyan-light.d.ts +4 -0
- package/dist/themes/cyan-light.d.ts.map +1 -0
- package/dist/themes/cyan-light.js +552 -0
- package/dist/themes/dark.d.ts +4 -0
- package/dist/themes/dark.d.ts.map +1 -0
- package/dist/themes/dark.js +551 -0
- package/dist/themes/gold-dark.d.ts +4 -0
- package/dist/themes/gold-dark.d.ts.map +1 -0
- package/dist/themes/gold-dark.js +552 -0
- package/dist/themes/grass-dark.d.ts +4 -0
- package/dist/themes/grass-dark.d.ts.map +1 -0
- package/dist/themes/grass-dark.js +552 -0
- package/dist/themes/indigo.d.ts +4 -0
- package/dist/themes/indigo.d.ts.map +1 -0
- package/dist/themes/indigo.js +552 -0
- package/dist/themes/light.d.ts +4 -0
- package/dist/themes/light.d.ts.map +1 -0
- package/dist/themes/light.js +551 -0
- package/dist/themes/orange-dark.d.ts +4 -0
- package/dist/themes/orange-dark.d.ts.map +1 -0
- package/dist/themes/orange-dark.js +551 -0
- package/dist/themes/orange-light.d.ts +4 -0
- package/dist/themes/orange-light.d.ts.map +1 -0
- package/dist/themes/orange-light.js +551 -0
- package/package.json +62 -0
- package/src/components/controls/Button/Button.vue +417 -0
- package/src/components/controls/Button/README.md +348 -0
- package/src/components/controls/Button/theme.css +200 -0
- package/src/components/controls/Checkbox/Checkbox.vue +164 -0
- package/src/components/controls/Checkbox/README.md +441 -0
- package/src/components/controls/Checkbox/theme.css +36 -0
- package/src/components/controls/Dropdown/Dropdown.vue +476 -0
- package/src/components/controls/Dropdown/README.md +370 -0
- package/src/components/controls/Dropdown/theme.css +50 -0
- package/src/components/controls/Dropdown/types.ts +6 -0
- package/src/components/controls/IconButton/IconButton.vue +267 -0
- package/src/components/controls/IconButton/README.md +502 -0
- package/src/components/controls/IconButton/theme.css +89 -0
- package/src/components/controls/Radio/README.md +591 -0
- package/src/components/controls/Radio/Radio.vue +89 -0
- package/src/components/controls/Radio/theme.css +14 -0
- package/src/components/controls/RangeSlider/README.md +608 -0
- package/src/components/controls/RangeSlider/RangeSlider.vue +535 -0
- package/src/components/controls/RangeSlider/theme.css +80 -0
- package/src/components/controls/SegmentedControl/README.md +587 -0
- package/src/components/controls/SegmentedControl/SegmentedControl.vue +284 -0
- package/src/components/controls/SegmentedControl/theme.css +60 -0
- package/src/components/controls/SegmentedControl/types.ts +5 -0
- package/src/components/controls/Slider/README.md +627 -0
- package/src/components/controls/Slider/Slider.vue +260 -0
- package/src/components/controls/Slider/theme.css +74 -0
- package/src/components/controls/Stepper/README.md +601 -0
- package/src/components/controls/Stepper/Stepper.vue +103 -0
- package/src/components/controls/Stepper/theme.css +53 -0
- package/src/components/controls/Switch/README.md +667 -0
- package/src/components/controls/Switch/Switch.vue +127 -0
- package/src/components/controls/Switch/theme.css +42 -0
- package/src/components/dialogs/Alert/Alert.vue +218 -0
- package/src/components/dialogs/Alert/README.md +450 -0
- package/src/components/dialogs/Alert/theme.css +44 -0
- package/src/components/dialogs/Alert/types.ts +11 -0
- package/src/components/dialogs/Toast/README.md +522 -0
- package/src/components/dialogs/Toast/Toast.vue +296 -0
- package/src/components/dialogs/Toast/ToastContainer.vue +330 -0
- package/src/components/dialogs/Toast/theme.css +44 -0
- package/src/components/dialogs/Toast/types.ts +46 -0
- package/src/components/dialogs/Toast/useToast.ts +127 -0
- package/src/components/indicators/ProgressBar/ProgressBar.vue +98 -0
- package/src/components/indicators/ProgressBar/README.md +744 -0
- package/src/components/indicators/ProgressBar/theme.css +36 -0
- package/src/components/indicators/Tooltip/README.md +723 -0
- package/src/components/indicators/Tooltip/TooltipProvider.vue +142 -0
- package/src/components/indicators/Tooltip/theme.css +18 -0
- package/src/components/indicators/Tooltip/tooltip.ts +48 -0
- package/src/components/indicators/Tooltip/types.ts +15 -0
- package/src/components/indicators/Tooltip/useTooltip.ts +71 -0
- package/src/components/inputs/AutogrowTextView/AutogrowTextView.vue +110 -0
- package/src/components/inputs/AutogrowTextView/README.md +643 -0
- package/src/components/inputs/AutogrowTextView/theme.css +28 -0
- package/src/components/inputs/InputCard/InputCard.vue +600 -0
- package/src/components/inputs/InputCard/README.md +636 -0
- package/src/components/inputs/InputEmail/InputEmail.vue +698 -0
- package/src/components/inputs/InputEmail/README.md +764 -0
- package/src/components/inputs/InputNumber/InputNumber.vue +300 -0
- package/src/components/inputs/InputNumber/README.md +749 -0
- package/src/components/inputs/InputPhone/InputPhone.vue +645 -0
- package/src/components/inputs/InputPhone/README.md +636 -0
- package/src/components/inputs/InputSecure/InputSecure.vue +646 -0
- package/src/components/inputs/InputSecure/README.md +771 -0
- package/src/components/inputs/InputText/InputText.vue +225 -0
- package/src/components/inputs/InputText/README.md +844 -0
- package/src/components/inputs/OTP/OTP.vue +349 -0
- package/src/components/inputs/OTP/README.md +736 -0
- package/src/components/inputs/OTP/theme.css +50 -0
- package/src/components/inputs/StringCapture/README.md +718 -0
- package/src/components/inputs/StringCapture/StringCapture.vue +315 -0
- package/src/components/inputs/StringCapture/theme.css +86 -0
- package/src/components/inputs/Tags/README.md +897 -0
- package/src/components/inputs/Tags/TagBar.vue +793 -0
- package/src/components/inputs/Tags/TagCreation.vue +219 -0
- package/src/components/inputs/Tags/TagPicker.vue +380 -0
- package/src/components/inputs/Tags/tag-bar-styles.ts +354 -0
- package/src/components/inputs/Tags/theme.css +121 -0
- package/src/components/inputs/Tags/types.ts +346 -0
- package/src/components/inputs/search/README.md +759 -0
- package/src/components/inputs/search/SearchBar.vue +394 -0
- package/src/components/inputs/search/SearchResults.vue +310 -0
- package/src/components/inputs/search/theme.css +187 -0
- package/src/components/inputs/search/types.ts +8 -0
- package/src/components/inputs/theme.css +102 -0
- package/src/components/menus/ActionMenu/ActionMenu.vue +383 -0
- package/src/components/menus/ActionMenu/README.md +825 -0
- package/src/components/menus/ActionMenu/theme.css +93 -0
- package/src/components/models/Popover/Popover.vue +551 -0
- package/src/components/models/Popover/README.md +885 -0
- package/src/components/models/Popover/theme.css +52 -0
- package/src/components/models/Sheet/README.md +1159 -0
- package/src/components/models/Sheet/Sheet.vue +465 -0
- package/src/components/models/Sheet/theme.css +72 -0
- package/src/components/models/Sidebar/README.md +1228 -0
- package/src/components/models/Sidebar/Sidebar.vue +480 -0
- package/src/components/models/Sidebar/theme.css +90 -0
- package/src/components/navigation/adaptive/AdaptiveLayout.vue +779 -0
- package/src/components/navigation/adaptive/AdaptiveLayoutBreadcrumbs.vue +192 -0
- package/src/components/navigation/adaptive/AdaptiveLayoutMenuButton.vue +149 -0
- package/src/components/navigation/adaptive/README.md +768 -0
- package/src/components/navigation/adaptive/types.ts +19 -0
- package/src/components/navigation/adaptive/useAdaptiveLayout.ts +89 -0
- package/src/components/navigation/adaptive/useBreakpoints.ts +41 -0
- package/src/components/navigation/adaptive/useContainerMonitor.ts +214 -0
- package/src/components/navigation/adaptive/useViewAnimation.ts +721 -0
- package/src/components/navigation/adaptive/useViewResize.ts +211 -0
- package/src/components/navigation/navstack/NavigationStack.vue +180 -0
- package/src/components/navigation/navstack/README.md +994 -0
- package/src/components/navigation/navstack/useNavigationStack.ts +164 -0
- package/src/components/navigation/slideover/README.md +1275 -0
- package/src/components/navigation/slideover/SlideoverController.vue +287 -0
- package/src/components/navigation/slideover/useSlideoverController.ts +320 -0
- package/src/components/navigation/splitview/README.md +1115 -0
- package/src/components/navigation/splitview/SplitViewController.vue +176 -0
- package/src/components/navigation/splitview/useSplitViewController.ts +388 -0
- package/src/components/navigation/tabcontroller/README.md +919 -0
- package/src/components/navigation/tabcontroller/TabController.vue +307 -0
- package/src/components/navigation/tabcontroller/TabItem.vue +57 -0
- package/src/components/navigation/tabcontroller/types.ts +24 -0
- package/src/components/navigation/tabcontroller/useTabController.ts +18 -0
- package/src/components/navigation/theme.css +91 -0
- package/src/components/navigation/types.ts +7 -0
- package/src/components/pickers/CollectionPicker/CollectionPicker.vue +398 -0
- package/src/components/pickers/CollectionPicker/README.md +1115 -0
- package/src/components/pickers/CollectionPicker/theme.css +14 -0
- package/src/components/pickers/CollectionPicker/types.ts +11 -0
- package/src/components/pickers/ColorPicker/ColorPicker.vue +376 -0
- package/src/components/pickers/ColorPicker/README.md +1439 -0
- package/src/components/pickers/ColorPicker/colors.ts +299 -0
- package/src/components/pickers/ColorPicker/theme.css +32 -0
- package/src/components/pickers/DatePicker/DatePicker.vue +660 -0
- package/src/components/pickers/DatePicker/README.md +1195 -0
- package/src/components/pickers/DatePicker/theme.css +22 -0
- package/src/components/pickers/FilePicker/FilePicker.vue +534 -0
- package/src/components/pickers/FilePicker/README.md +1542 -0
- package/src/components/pickers/FilePicker/theme.css +48 -0
- package/src/components/pickers/FilePicker/types.ts +10 -0
- package/src/components/pickers/IconPicker/IconPicker.vue +327 -0
- package/src/components/pickers/IconPicker/README.md +1161 -0
- package/src/components/pickers/IconPicker/theme.css +28 -0
- package/src/components/pickers/theme.css +82 -0
- package/src/components/views/MarkdownViewer/MarkdownViewer.vue +442 -0
- package/src/components/views/MarkdownViewer/README.md +833 -0
- package/src/components/views/MarkdownViewer/theme.css +130 -0
- package/src/index.ts +263 -0
- package/src/theme.ts +378 -0
- package/src/themes/crimson-dark.ts +556 -0
- package/src/themes/cyan-light.ts +556 -0
- package/src/themes/dark.ts +557 -0
- package/src/themes/gold-dark.ts +556 -0
- package/src/themes/grass-dark.ts +556 -0
- package/src/themes/indigo.ts +556 -0
- package/src/themes/light.ts +557 -0
- package/src/themes/orange-dark.ts +557 -0
- package/src/themes/orange-light.ts +557 -0
- package/src/vue.d.ts +45 -0
|
@@ -0,0 +1,627 @@
|
|
|
1
|
+
# Slider
|
|
2
|
+
|
|
3
|
+
A single-thumb slider component built with Vue 3 Composition API and TypeScript. The Slider component provides an intuitive interface for selecting a single value with customizable styles, interactive HUDs, and smooth animations.
|
|
4
|
+
|
|
5
|
+
## Installation/Import
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { Slider } from "@umbra-ui/core";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Dependencies:**
|
|
12
|
+
|
|
13
|
+
- Vue 3.x
|
|
14
|
+
|
|
15
|
+
## Basic Usage
|
|
16
|
+
|
|
17
|
+
```vue
|
|
18
|
+
<script setup lang="ts">
|
|
19
|
+
import { ref } from "vue";
|
|
20
|
+
import { Slider } from "@umbra-ui/core";
|
|
21
|
+
|
|
22
|
+
const sliderValue = ref(50);
|
|
23
|
+
|
|
24
|
+
const handleValueChange = (value: number) => {
|
|
25
|
+
console.log("Slider value changed:", value);
|
|
26
|
+
sliderValue.value = value;
|
|
27
|
+
};
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<Slider
|
|
32
|
+
:min="0"
|
|
33
|
+
:max="100"
|
|
34
|
+
:value="sliderValue"
|
|
35
|
+
@update:value="handleValueChange"
|
|
36
|
+
/>
|
|
37
|
+
</template>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Props
|
|
41
|
+
|
|
42
|
+
| Prop Name | Type | Required | Default | Description |
|
|
43
|
+
| ------------- | ------------------------------------- | -------- | ----------- | ---------------------------------- |
|
|
44
|
+
| `sliderStyle` | `"default" \| "capline" \| "capsule"` | No | `"default"` | Visual style variant of the slider |
|
|
45
|
+
| `min` | `number` | No | `0` | Minimum value of the slider range |
|
|
46
|
+
| `max` | `number` | No | `100` | Maximum value of the slider range |
|
|
47
|
+
| `value` | `number` | Yes | `50` | Current value of the slider |
|
|
48
|
+
|
|
49
|
+
### Slider Styles
|
|
50
|
+
|
|
51
|
+
- **`default`**: Standard slider with circular thumb and filled progress track
|
|
52
|
+
- **`capline`**: Capsule-style slider with pill-shaped thumb
|
|
53
|
+
- **`capsule`**: Full capsule design with bordered track and rounded thumb
|
|
54
|
+
|
|
55
|
+
## Events
|
|
56
|
+
|
|
57
|
+
| Event Name | Payload Type | Description |
|
|
58
|
+
| -------------- | ------------ | ------------------------------------- |
|
|
59
|
+
| `update:value` | `number` | Emitted when the slider value changes |
|
|
60
|
+
|
|
61
|
+
### Event Examples
|
|
62
|
+
|
|
63
|
+
```vue
|
|
64
|
+
<script setup lang="ts">
|
|
65
|
+
import { ref } from "vue";
|
|
66
|
+
import { Slider } from "@umbra-ui/core";
|
|
67
|
+
|
|
68
|
+
const sliderValue = ref(75);
|
|
69
|
+
|
|
70
|
+
const handleValueChange = (value: number) => {
|
|
71
|
+
console.log("Slider value updated:", value);
|
|
72
|
+
sliderValue.value = value;
|
|
73
|
+
};
|
|
74
|
+
</script>
|
|
75
|
+
|
|
76
|
+
<template>
|
|
77
|
+
<Slider
|
|
78
|
+
:min="0"
|
|
79
|
+
:max="100"
|
|
80
|
+
:value="sliderValue"
|
|
81
|
+
@update:value="handleValueChange"
|
|
82
|
+
/>
|
|
83
|
+
</template>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Slots
|
|
87
|
+
|
|
88
|
+
This component does not use slots. All content is controlled via props.
|
|
89
|
+
|
|
90
|
+
## Exposed Methods/Refs
|
|
91
|
+
|
|
92
|
+
This component does not expose any methods or refs via `defineExpose`.
|
|
93
|
+
|
|
94
|
+
## CSS Customization
|
|
95
|
+
|
|
96
|
+
The Slider component uses CSS custom properties that can be overridden to customize the appearance:
|
|
97
|
+
|
|
98
|
+
### Color Variables
|
|
99
|
+
|
|
100
|
+
```css
|
|
101
|
+
/* Slider label colors */
|
|
102
|
+
--slider-label-color: #1a1d23;
|
|
103
|
+
|
|
104
|
+
/* Slider track colors */
|
|
105
|
+
--slider-track-default-bg: #cecece;
|
|
106
|
+
--slider-track-capsule-border: #0090ff;
|
|
107
|
+
--slider-track-capline-bg: #e3e5e8;
|
|
108
|
+
|
|
109
|
+
/* Slider thumb colors */
|
|
110
|
+
--slider-thumb-default-bg: white;
|
|
111
|
+
--slider-thumb-capsule-bg: #0090ff;
|
|
112
|
+
--slider-thumb-capline-bg: white;
|
|
113
|
+
|
|
114
|
+
/* Slider thumb border colors */
|
|
115
|
+
--slider-thumb-default-border: 1px solid #cecece;
|
|
116
|
+
--slider-thumb-capsule-border: 0.12rem solid white;
|
|
117
|
+
--slider-thumb-capline-border: 1px solid #cecece;
|
|
118
|
+
|
|
119
|
+
/* Slider progress colors */
|
|
120
|
+
--slider-progress-default-bg: #0090ff;
|
|
121
|
+
--slider-progress-capsule-bg: #acd8fc;
|
|
122
|
+
--slider-progress-capsule-border-top: white;
|
|
123
|
+
--slider-progress-capsule-border-bottom: white;
|
|
124
|
+
--slider-progress-capsule-border-left: white;
|
|
125
|
+
--slider-progress-capline-bg: #0090ff;
|
|
126
|
+
|
|
127
|
+
/* Slider HUD colors */
|
|
128
|
+
--slider-hud-default-bg: #8b8d98;
|
|
129
|
+
--slider-hud-default-text: #ffffff;
|
|
130
|
+
--slider-hud-capsule-bg: #0090ff;
|
|
131
|
+
--slider-hud-capsule-text: #ffffff;
|
|
132
|
+
--slider-hud-capline-bg: #8b8d98;
|
|
133
|
+
--slider-hud-capline-text: #ffffff;
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Custom Styling Example
|
|
137
|
+
|
|
138
|
+
```vue
|
|
139
|
+
<template>
|
|
140
|
+
<Slider :min="0" :max="100" :value="sliderValue" class="custom-slider" />
|
|
141
|
+
</template>
|
|
142
|
+
|
|
143
|
+
<style>
|
|
144
|
+
.custom-slider {
|
|
145
|
+
--slider-progress-default-bg: #ff6b6b;
|
|
146
|
+
--slider-thumb-default-bg: #ff5252;
|
|
147
|
+
--slider-hud-default-bg: #ff6b6b;
|
|
148
|
+
}
|
|
149
|
+
</style>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Examples
|
|
153
|
+
|
|
154
|
+
### Basic Slider
|
|
155
|
+
|
|
156
|
+
```vue
|
|
157
|
+
<script setup lang="ts">
|
|
158
|
+
import { ref } from "vue";
|
|
159
|
+
import { Slider } from "@umbra-ui/core";
|
|
160
|
+
|
|
161
|
+
const sliderValue = ref(50);
|
|
162
|
+
</script>
|
|
163
|
+
|
|
164
|
+
<template>
|
|
165
|
+
<Slider
|
|
166
|
+
:min="0"
|
|
167
|
+
:max="100"
|
|
168
|
+
:value="sliderValue"
|
|
169
|
+
@update:value="(value) => (sliderValue = value)"
|
|
170
|
+
/>
|
|
171
|
+
</template>
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Different Slider Styles
|
|
175
|
+
|
|
176
|
+
```vue
|
|
177
|
+
<script setup lang="ts">
|
|
178
|
+
import { ref } from "vue";
|
|
179
|
+
import { Slider } from "@umbra-ui/core";
|
|
180
|
+
|
|
181
|
+
const defaultValue = ref(50);
|
|
182
|
+
const caplineValue = ref(60);
|
|
183
|
+
const capsuleValue = ref(70);
|
|
184
|
+
</script>
|
|
185
|
+
|
|
186
|
+
<template>
|
|
187
|
+
<div class="style-examples">
|
|
188
|
+
<div class="example">
|
|
189
|
+
<h3>Default Style</h3>
|
|
190
|
+
<Slider
|
|
191
|
+
:min="0"
|
|
192
|
+
:max="100"
|
|
193
|
+
:value="defaultValue"
|
|
194
|
+
slider-style="default"
|
|
195
|
+
@update:value="(value) => (defaultValue = value)"
|
|
196
|
+
/>
|
|
197
|
+
</div>
|
|
198
|
+
|
|
199
|
+
<div class="example">
|
|
200
|
+
<h3>Capline Style</h3>
|
|
201
|
+
<Slider
|
|
202
|
+
:min="0"
|
|
203
|
+
:max="100"
|
|
204
|
+
:value="caplineValue"
|
|
205
|
+
slider-style="capline"
|
|
206
|
+
@update:value="(value) => (caplineValue = value)"
|
|
207
|
+
/>
|
|
208
|
+
</div>
|
|
209
|
+
|
|
210
|
+
<div class="example">
|
|
211
|
+
<h3>Capsule Style</h3>
|
|
212
|
+
<Slider
|
|
213
|
+
:min="0"
|
|
214
|
+
:max="100"
|
|
215
|
+
:value="capsuleValue"
|
|
216
|
+
slider-style="capsule"
|
|
217
|
+
@update:value="(value) => (capsuleValue = value)"
|
|
218
|
+
/>
|
|
219
|
+
</div>
|
|
220
|
+
</div>
|
|
221
|
+
</template>
|
|
222
|
+
|
|
223
|
+
<style module>
|
|
224
|
+
.style-examples {
|
|
225
|
+
display: flex;
|
|
226
|
+
flex-direction: column;
|
|
227
|
+
gap: 2rem;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.example {
|
|
231
|
+
display: flex;
|
|
232
|
+
flex-direction: column;
|
|
233
|
+
gap: 1rem;
|
|
234
|
+
}
|
|
235
|
+
</style>
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Volume Control
|
|
239
|
+
|
|
240
|
+
```vue
|
|
241
|
+
<script setup lang="ts">
|
|
242
|
+
import { ref } from "vue";
|
|
243
|
+
import { Slider } from "@umbra-ui/core";
|
|
244
|
+
|
|
245
|
+
const volume = ref(75);
|
|
246
|
+
|
|
247
|
+
const formatVolume = (value: number) => {
|
|
248
|
+
return `${value}%`;
|
|
249
|
+
};
|
|
250
|
+
</script>
|
|
251
|
+
|
|
252
|
+
<template>
|
|
253
|
+
<div class="volume-control">
|
|
254
|
+
<h3>Volume Control</h3>
|
|
255
|
+
<div class="volume-display">
|
|
256
|
+
{{ formatVolume(volume) }}
|
|
257
|
+
</div>
|
|
258
|
+
|
|
259
|
+
<Slider
|
|
260
|
+
:min="0"
|
|
261
|
+
:max="100"
|
|
262
|
+
:value="volume"
|
|
263
|
+
slider-style="capline"
|
|
264
|
+
@update:value="(value) => (volume = value)"
|
|
265
|
+
/>
|
|
266
|
+
</div>
|
|
267
|
+
</template>
|
|
268
|
+
|
|
269
|
+
<style module>
|
|
270
|
+
.volume-control {
|
|
271
|
+
display: flex;
|
|
272
|
+
flex-direction: column;
|
|
273
|
+
gap: 1rem;
|
|
274
|
+
max-width: 300px;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.volume-display {
|
|
278
|
+
text-align: center;
|
|
279
|
+
font-weight: 500;
|
|
280
|
+
font-size: 1.2rem;
|
|
281
|
+
}
|
|
282
|
+
</style>
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### Brightness Control
|
|
286
|
+
|
|
287
|
+
```vue
|
|
288
|
+
<script setup lang="ts">
|
|
289
|
+
import { ref } from "vue";
|
|
290
|
+
import { Slider } from "@umbra-ui/core";
|
|
291
|
+
|
|
292
|
+
const brightness = ref(80);
|
|
293
|
+
|
|
294
|
+
const formatBrightness = (value: number) => {
|
|
295
|
+
return `${value}%`;
|
|
296
|
+
};
|
|
297
|
+
</script>
|
|
298
|
+
|
|
299
|
+
<template>
|
|
300
|
+
<div class="brightness-control">
|
|
301
|
+
<h3>Screen Brightness</h3>
|
|
302
|
+
<div class="brightness-display">
|
|
303
|
+
{{ formatBrightness(brightness) }}
|
|
304
|
+
</div>
|
|
305
|
+
|
|
306
|
+
<Slider
|
|
307
|
+
:min="10"
|
|
308
|
+
:max="100"
|
|
309
|
+
:value="brightness"
|
|
310
|
+
slider-style="capsule"
|
|
311
|
+
@update:value="(value) => (brightness = value)"
|
|
312
|
+
/>
|
|
313
|
+
</div>
|
|
314
|
+
</template>
|
|
315
|
+
|
|
316
|
+
<style module>
|
|
317
|
+
.brightness-control {
|
|
318
|
+
display: flex;
|
|
319
|
+
flex-direction: column;
|
|
320
|
+
gap: 1rem;
|
|
321
|
+
max-width: 300px;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.brightness-display {
|
|
325
|
+
text-align: center;
|
|
326
|
+
font-weight: 500;
|
|
327
|
+
font-size: 1.2rem;
|
|
328
|
+
}
|
|
329
|
+
</style>
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
### Form Integration
|
|
333
|
+
|
|
334
|
+
```vue
|
|
335
|
+
<script setup lang="ts">
|
|
336
|
+
import { ref } from "vue";
|
|
337
|
+
import { Slider } from "@umbra-ui/core";
|
|
338
|
+
|
|
339
|
+
interface FormData {
|
|
340
|
+
satisfaction: number;
|
|
341
|
+
difficulty: number;
|
|
342
|
+
recommendation: number;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
const formData = ref<FormData>({
|
|
346
|
+
satisfaction: 75,
|
|
347
|
+
difficulty: 50,
|
|
348
|
+
recommendation: 80,
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
const submitForm = () => {
|
|
352
|
+
console.log("Form submitted:", formData.value);
|
|
353
|
+
};
|
|
354
|
+
</script>
|
|
355
|
+
|
|
356
|
+
<template>
|
|
357
|
+
<form class="feedback-form" @submit.prevent="submitForm">
|
|
358
|
+
<div class="form-group">
|
|
359
|
+
<label>Satisfaction Level</label>
|
|
360
|
+
<div class="slider-value">{{ formData.satisfaction }}%</div>
|
|
361
|
+
<Slider
|
|
362
|
+
:min="0"
|
|
363
|
+
:max="100"
|
|
364
|
+
:value="formData.satisfaction"
|
|
365
|
+
@update:value="(value) => (formData.satisfaction = value)"
|
|
366
|
+
/>
|
|
367
|
+
</div>
|
|
368
|
+
|
|
369
|
+
<div class="form-group">
|
|
370
|
+
<label>Difficulty Level</label>
|
|
371
|
+
<div class="slider-value">{{ formData.difficulty }}%</div>
|
|
372
|
+
<Slider
|
|
373
|
+
:min="0"
|
|
374
|
+
:max="100"
|
|
375
|
+
:value="formData.difficulty"
|
|
376
|
+
@update:value="(value) => (formData.difficulty = value)"
|
|
377
|
+
/>
|
|
378
|
+
</div>
|
|
379
|
+
|
|
380
|
+
<div class="form-group">
|
|
381
|
+
<label>Recommendation Score</label>
|
|
382
|
+
<div class="slider-value">{{ formData.recommendation }}%</div>
|
|
383
|
+
<Slider
|
|
384
|
+
:min="0"
|
|
385
|
+
:max="100"
|
|
386
|
+
:value="formData.recommendation"
|
|
387
|
+
@update:value="(value) => (formData.recommendation = value)"
|
|
388
|
+
/>
|
|
389
|
+
</div>
|
|
390
|
+
|
|
391
|
+
<button type="submit">Submit Feedback</button>
|
|
392
|
+
</form>
|
|
393
|
+
</template>
|
|
394
|
+
|
|
395
|
+
<style module>
|
|
396
|
+
.feedback-form {
|
|
397
|
+
display: flex;
|
|
398
|
+
flex-direction: column;
|
|
399
|
+
gap: 2rem;
|
|
400
|
+
max-width: 400px;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.form-group {
|
|
404
|
+
display: flex;
|
|
405
|
+
flex-direction: column;
|
|
406
|
+
gap: 0.5rem;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.slider-value {
|
|
410
|
+
font-weight: 500;
|
|
411
|
+
color: #666;
|
|
412
|
+
text-align: center;
|
|
413
|
+
}
|
|
414
|
+
</style>
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
### Settings Panel
|
|
418
|
+
|
|
419
|
+
```vue
|
|
420
|
+
<script setup lang="ts">
|
|
421
|
+
import { ref } from "vue";
|
|
422
|
+
import { Slider } from "@umbra-ui/core";
|
|
423
|
+
|
|
424
|
+
const fontSize = ref(16);
|
|
425
|
+
const lineHeight = ref(1.5);
|
|
426
|
+
const opacity = ref(100);
|
|
427
|
+
|
|
428
|
+
const saveSettings = () => {
|
|
429
|
+
const settings = {
|
|
430
|
+
fontSize: fontSize.value,
|
|
431
|
+
lineHeight: lineHeight.value,
|
|
432
|
+
opacity: opacity.value,
|
|
433
|
+
};
|
|
434
|
+
console.log("Settings saved:", settings);
|
|
435
|
+
};
|
|
436
|
+
</script>
|
|
437
|
+
|
|
438
|
+
<template>
|
|
439
|
+
<div class="settings-panel">
|
|
440
|
+
<h2>Display Settings</h2>
|
|
441
|
+
|
|
442
|
+
<div class="setting-group">
|
|
443
|
+
<label>Font Size: {{ fontSize }}px</label>
|
|
444
|
+
<Slider
|
|
445
|
+
:min="12"
|
|
446
|
+
:max="24"
|
|
447
|
+
:value="fontSize"
|
|
448
|
+
@update:value="(value) => (fontSize = value)"
|
|
449
|
+
/>
|
|
450
|
+
</div>
|
|
451
|
+
|
|
452
|
+
<div class="setting-group">
|
|
453
|
+
<label>Line Height: {{ lineHeight }}</label>
|
|
454
|
+
<Slider
|
|
455
|
+
:min="1"
|
|
456
|
+
:max="2"
|
|
457
|
+
:value="lineHeight"
|
|
458
|
+
@update:value="(value) => (lineHeight = value)"
|
|
459
|
+
/>
|
|
460
|
+
</div>
|
|
461
|
+
|
|
462
|
+
<div class="setting-group">
|
|
463
|
+
<label>Opacity: {{ opacity }}%</label>
|
|
464
|
+
<Slider
|
|
465
|
+
:min="50"
|
|
466
|
+
:max="100"
|
|
467
|
+
:value="opacity"
|
|
468
|
+
slider-style="capline"
|
|
469
|
+
@update:value="(value) => (opacity = value)"
|
|
470
|
+
/>
|
|
471
|
+
</div>
|
|
472
|
+
|
|
473
|
+
<button @click="saveSettings">Save Settings</button>
|
|
474
|
+
</div>
|
|
475
|
+
</template>
|
|
476
|
+
|
|
477
|
+
<style module>
|
|
478
|
+
.settings-panel {
|
|
479
|
+
display: flex;
|
|
480
|
+
flex-direction: column;
|
|
481
|
+
gap: 2rem;
|
|
482
|
+
max-width: 400px;
|
|
483
|
+
padding: 2rem;
|
|
484
|
+
background-color: #f5f5f5;
|
|
485
|
+
border-radius: 0.5rem;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
.setting-group {
|
|
489
|
+
display: flex;
|
|
490
|
+
flex-direction: column;
|
|
491
|
+
gap: 1rem;
|
|
492
|
+
}
|
|
493
|
+
</style>
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
### Audio Equalizer
|
|
497
|
+
|
|
498
|
+
```vue
|
|
499
|
+
<script setup lang="ts">
|
|
500
|
+
import { ref } from "vue";
|
|
501
|
+
import { Slider } from "@umbra-ui/core";
|
|
502
|
+
|
|
503
|
+
const frequencies = ref({
|
|
504
|
+
bass: 50,
|
|
505
|
+
mid: 60,
|
|
506
|
+
treble: 70,
|
|
507
|
+
presence: 55,
|
|
508
|
+
});
|
|
509
|
+
|
|
510
|
+
const resetEqualizer = () => {
|
|
511
|
+
frequencies.value = {
|
|
512
|
+
bass: 50,
|
|
513
|
+
mid: 50,
|
|
514
|
+
treble: 50,
|
|
515
|
+
presence: 50,
|
|
516
|
+
};
|
|
517
|
+
};
|
|
518
|
+
</script>
|
|
519
|
+
|
|
520
|
+
<template>
|
|
521
|
+
<div class="equalizer">
|
|
522
|
+
<h3>Audio Equalizer</h3>
|
|
523
|
+
|
|
524
|
+
<div class="frequency-controls">
|
|
525
|
+
<div class="frequency-group">
|
|
526
|
+
<label>Bass</label>
|
|
527
|
+
<Slider
|
|
528
|
+
:min="0"
|
|
529
|
+
:max="100"
|
|
530
|
+
:value="frequencies.bass"
|
|
531
|
+
slider-style="capsule"
|
|
532
|
+
@update:value="(value) => (frequencies.bass = value)"
|
|
533
|
+
/>
|
|
534
|
+
</div>
|
|
535
|
+
|
|
536
|
+
<div class="frequency-group">
|
|
537
|
+
<label>Mid</label>
|
|
538
|
+
<Slider
|
|
539
|
+
:min="0"
|
|
540
|
+
:max="100"
|
|
541
|
+
:value="frequencies.mid"
|
|
542
|
+
slider-style="capsule"
|
|
543
|
+
@update:value="(value) => (frequencies.mid = value)"
|
|
544
|
+
/>
|
|
545
|
+
</div>
|
|
546
|
+
|
|
547
|
+
<div class="frequency-group">
|
|
548
|
+
<label>Treble</label>
|
|
549
|
+
<Slider
|
|
550
|
+
:min="0"
|
|
551
|
+
:max="100"
|
|
552
|
+
:value="frequencies.treble"
|
|
553
|
+
slider-style="capsule"
|
|
554
|
+
@update:value="(value) => (frequencies.treble = value)"
|
|
555
|
+
/>
|
|
556
|
+
</div>
|
|
557
|
+
|
|
558
|
+
<div class="frequency-group">
|
|
559
|
+
<label>Presence</label>
|
|
560
|
+
<Slider
|
|
561
|
+
:min="0"
|
|
562
|
+
:max="100"
|
|
563
|
+
:value="frequencies.presence"
|
|
564
|
+
slider-style="capsule"
|
|
565
|
+
@update:value="(value) => (frequencies.presence = value)"
|
|
566
|
+
/>
|
|
567
|
+
</div>
|
|
568
|
+
</div>
|
|
569
|
+
|
|
570
|
+
<button @click="resetEqualizer">Reset</button>
|
|
571
|
+
</div>
|
|
572
|
+
</template>
|
|
573
|
+
|
|
574
|
+
<style module>
|
|
575
|
+
.equalizer {
|
|
576
|
+
display: flex;
|
|
577
|
+
flex-direction: column;
|
|
578
|
+
gap: 2rem;
|
|
579
|
+
max-width: 500px;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
.frequency-controls {
|
|
583
|
+
display: grid;
|
|
584
|
+
grid-template-columns: repeat(2, 1fr);
|
|
585
|
+
gap: 2rem;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
.frequency-group {
|
|
589
|
+
display: flex;
|
|
590
|
+
flex-direction: column;
|
|
591
|
+
gap: 1rem;
|
|
592
|
+
}
|
|
593
|
+
</style>
|
|
594
|
+
```
|
|
595
|
+
|
|
596
|
+
## Interactive Features
|
|
597
|
+
|
|
598
|
+
### HUD (Heads-Up Display)
|
|
599
|
+
|
|
600
|
+
- Value tooltip appears above the thumb when dragging
|
|
601
|
+
- Automatically hides after 500ms when interaction ends
|
|
602
|
+
- Shows current rounded value for easy reading
|
|
603
|
+
|
|
604
|
+
### Touch Support
|
|
605
|
+
|
|
606
|
+
- Full touch device support with proper event handling
|
|
607
|
+
- Smooth dragging experience on mobile devices
|
|
608
|
+
- Prevents default touch behaviors for better control
|
|
609
|
+
|
|
610
|
+
### Progress Visualization
|
|
611
|
+
|
|
612
|
+
- Visual progress bar shows current value position
|
|
613
|
+
- Different styles for different slider variants
|
|
614
|
+
- Smooth animations during value changes
|
|
615
|
+
|
|
616
|
+
## Notes
|
|
617
|
+
|
|
618
|
+
- The component includes smooth animations and transitions
|
|
619
|
+
- HUD tooltip shows rounded values for better readability
|
|
620
|
+
- The slider automatically constrains values within the min/max range
|
|
621
|
+
- Touch and mouse events are both supported for cross-platform compatibility
|
|
622
|
+
- The component uses percentage-based positioning for smooth value interpolation
|
|
623
|
+
- Different slider styles provide various visual appearances for different use cases
|
|
624
|
+
- The component supports both light and dark themes
|
|
625
|
+
- All interactions are fully accessible with proper event handling
|
|
626
|
+
- The slider provides immediate visual feedback during dragging
|
|
627
|
+
- The component is optimized for performance with efficient event handling
|