@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,601 @@
|
|
|
1
|
+
# Stepper
|
|
2
|
+
|
|
3
|
+
A numeric stepper component built with Vue 3 Composition API and TypeScript. The Stepper component provides an intuitive interface for incrementing and decrementing numeric values with customizable ranges, steps, and visual feedback.
|
|
4
|
+
|
|
5
|
+
## Installation/Import
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { Stepper } from "@umbra-ui/core";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Dependencies:**
|
|
12
|
+
|
|
13
|
+
- Vue 3.x
|
|
14
|
+
- @umbra-ui/icons (for plus and minus icons)
|
|
15
|
+
|
|
16
|
+
## Basic Usage
|
|
17
|
+
|
|
18
|
+
```vue
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import { ref } from "vue";
|
|
21
|
+
import { Stepper } from "@umbra-ui/core";
|
|
22
|
+
|
|
23
|
+
const stepperValue = ref(5);
|
|
24
|
+
|
|
25
|
+
const handleValueChange = (value: number) => {
|
|
26
|
+
console.log("Stepper value changed:", value);
|
|
27
|
+
stepperValue.value = value;
|
|
28
|
+
};
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<Stepper
|
|
33
|
+
:min="0"
|
|
34
|
+
:max="10"
|
|
35
|
+
:step="1"
|
|
36
|
+
:value="stepperValue"
|
|
37
|
+
@update:value="handleValueChange"
|
|
38
|
+
/>
|
|
39
|
+
</template>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Props
|
|
43
|
+
|
|
44
|
+
| Prop Name | Type | Required | Default | Description |
|
|
45
|
+
| --------- | -------- | -------- | ------- | ----------------------------- |
|
|
46
|
+
| `value` | `number` | No | `0` | Current value of the stepper |
|
|
47
|
+
| `min` | `number` | No | `0` | Minimum allowed value |
|
|
48
|
+
| `max` | `number` | No | `100` | Maximum allowed value |
|
|
49
|
+
| `step` | `number` | No | `1` | Increment/decrement step size |
|
|
50
|
+
|
|
51
|
+
## Events
|
|
52
|
+
|
|
53
|
+
| Event Name | Payload Type | Description |
|
|
54
|
+
| -------------- | ------------ | -------------------------------------- |
|
|
55
|
+
| `update:value` | `number` | Emitted when the stepper value changes |
|
|
56
|
+
|
|
57
|
+
### Event Examples
|
|
58
|
+
|
|
59
|
+
```vue
|
|
60
|
+
<script setup lang="ts">
|
|
61
|
+
import { ref } from "vue";
|
|
62
|
+
import { Stepper } from "@umbra-ui/core";
|
|
63
|
+
|
|
64
|
+
const stepperValue = ref(10);
|
|
65
|
+
|
|
66
|
+
const handleValueChange = (value: number) => {
|
|
67
|
+
console.log("Stepper value updated:", value);
|
|
68
|
+
stepperValue.value = value;
|
|
69
|
+
};
|
|
70
|
+
</script>
|
|
71
|
+
|
|
72
|
+
<template>
|
|
73
|
+
<Stepper
|
|
74
|
+
:min="0"
|
|
75
|
+
:max="20"
|
|
76
|
+
:step="2"
|
|
77
|
+
:value="stepperValue"
|
|
78
|
+
@update:value="handleValueChange"
|
|
79
|
+
/>
|
|
80
|
+
</template>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Slots
|
|
84
|
+
|
|
85
|
+
This component does not use slots. All content is controlled via props.
|
|
86
|
+
|
|
87
|
+
## Exposed Methods/Refs
|
|
88
|
+
|
|
89
|
+
This component does not expose any methods or refs via `defineExpose`.
|
|
90
|
+
|
|
91
|
+
## CSS Customization
|
|
92
|
+
|
|
93
|
+
The Stepper component uses CSS custom properties that can be overridden to customize the appearance:
|
|
94
|
+
|
|
95
|
+
### Color Variables
|
|
96
|
+
|
|
97
|
+
```css
|
|
98
|
+
/* Stepper container colors */
|
|
99
|
+
--stepper-container-bg: white;
|
|
100
|
+
--stepper-container-border: 1px solid #d9d9d9;
|
|
101
|
+
--stepper-container-shadow-dark: none;
|
|
102
|
+
--stepper-container-shadow-light: none;
|
|
103
|
+
|
|
104
|
+
/* Stepper value colors */
|
|
105
|
+
--stepper-value-color: #1a1d23;
|
|
106
|
+
|
|
107
|
+
/* Stepper icon colors */
|
|
108
|
+
--stepper-icon-opacity: 0.6;
|
|
109
|
+
--stepper-icon-hover-opacity: 1;
|
|
110
|
+
|
|
111
|
+
/* Stepper value border colors */
|
|
112
|
+
--stepper-value-border: #d9d9d9;
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Custom Styling Example
|
|
116
|
+
|
|
117
|
+
```vue
|
|
118
|
+
<template>
|
|
119
|
+
<Stepper :min="0" :max="100" :value="stepperValue" class="custom-stepper" />
|
|
120
|
+
</template>
|
|
121
|
+
|
|
122
|
+
<style>
|
|
123
|
+
.custom-stepper {
|
|
124
|
+
--stepper-container-bg: #f8f9fa;
|
|
125
|
+
--stepper-value-color: #ff6b6b;
|
|
126
|
+
--stepper-icon-opacity: 0.8;
|
|
127
|
+
}
|
|
128
|
+
</style>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Examples
|
|
132
|
+
|
|
133
|
+
### Basic Stepper
|
|
134
|
+
|
|
135
|
+
```vue
|
|
136
|
+
<script setup lang="ts">
|
|
137
|
+
import { ref } from "vue";
|
|
138
|
+
import { Stepper } from "@umbra-ui/core";
|
|
139
|
+
|
|
140
|
+
const count = ref(0);
|
|
141
|
+
</script>
|
|
142
|
+
|
|
143
|
+
<template>
|
|
144
|
+
<Stepper
|
|
145
|
+
:min="0"
|
|
146
|
+
:max="10"
|
|
147
|
+
:step="1"
|
|
148
|
+
:value="count"
|
|
149
|
+
@update:value="(value) => (count = value)"
|
|
150
|
+
/>
|
|
151
|
+
</template>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Quantity Selector
|
|
155
|
+
|
|
156
|
+
```vue
|
|
157
|
+
<script setup lang="ts">
|
|
158
|
+
import { ref } from "vue";
|
|
159
|
+
import { Stepper } from "@umbra-ui/core";
|
|
160
|
+
|
|
161
|
+
const quantity = ref(1);
|
|
162
|
+
|
|
163
|
+
const addToCart = () => {
|
|
164
|
+
console.log(`Added ${quantity.value} items to cart`);
|
|
165
|
+
};
|
|
166
|
+
</script>
|
|
167
|
+
|
|
168
|
+
<template>
|
|
169
|
+
<div class="quantity-selector">
|
|
170
|
+
<label>Quantity</label>
|
|
171
|
+
<Stepper
|
|
172
|
+
:min="1"
|
|
173
|
+
:max="99"
|
|
174
|
+
:step="1"
|
|
175
|
+
:value="quantity"
|
|
176
|
+
@update:value="(value) => (quantity = value)"
|
|
177
|
+
/>
|
|
178
|
+
<button @click="addToCart">Add to Cart</button>
|
|
179
|
+
</div>
|
|
180
|
+
</template>
|
|
181
|
+
|
|
182
|
+
<style module>
|
|
183
|
+
.quantity-selector {
|
|
184
|
+
display: flex;
|
|
185
|
+
align-items: center;
|
|
186
|
+
gap: 1rem;
|
|
187
|
+
}
|
|
188
|
+
</style>
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Rating Stepper
|
|
192
|
+
|
|
193
|
+
```vue
|
|
194
|
+
<script setup lang="ts">
|
|
195
|
+
import { ref } from "vue";
|
|
196
|
+
import { Stepper } from "@umbra-ui/core";
|
|
197
|
+
|
|
198
|
+
const rating = ref(3);
|
|
199
|
+
|
|
200
|
+
const submitRating = () => {
|
|
201
|
+
console.log(`Rating submitted: ${rating.value}/5`);
|
|
202
|
+
};
|
|
203
|
+
</script>
|
|
204
|
+
|
|
205
|
+
<template>
|
|
206
|
+
<div class="rating-stepper">
|
|
207
|
+
<label>Rate this item (1-5 stars)</label>
|
|
208
|
+
<Stepper
|
|
209
|
+
:min="1"
|
|
210
|
+
:max="5"
|
|
211
|
+
:step="1"
|
|
212
|
+
:value="rating"
|
|
213
|
+
@update:value="(value) => (rating = value)"
|
|
214
|
+
/>
|
|
215
|
+
<div class="rating-display">
|
|
216
|
+
{{ "★".repeat(rating) }}{{ "☆".repeat(5 - rating) }}
|
|
217
|
+
</div>
|
|
218
|
+
<button @click="submitRating">Submit Rating</button>
|
|
219
|
+
</div>
|
|
220
|
+
</template>
|
|
221
|
+
|
|
222
|
+
<style module>
|
|
223
|
+
.rating-stepper {
|
|
224
|
+
display: flex;
|
|
225
|
+
flex-direction: column;
|
|
226
|
+
gap: 1rem;
|
|
227
|
+
align-items: center;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.rating-display {
|
|
231
|
+
font-size: 1.5rem;
|
|
232
|
+
color: #ffd700;
|
|
233
|
+
}
|
|
234
|
+
</style>
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Form Integration
|
|
238
|
+
|
|
239
|
+
```vue
|
|
240
|
+
<script setup lang="ts">
|
|
241
|
+
import { ref } from "vue";
|
|
242
|
+
import { Stepper } from "@umbra-ui/core";
|
|
243
|
+
|
|
244
|
+
interface FormData {
|
|
245
|
+
age: number;
|
|
246
|
+
experience: number;
|
|
247
|
+
teamSize: number;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
const formData = ref<FormData>({
|
|
251
|
+
age: 25,
|
|
252
|
+
experience: 2,
|
|
253
|
+
teamSize: 5,
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
const submitForm = () => {
|
|
257
|
+
console.log("Form submitted:", formData.value);
|
|
258
|
+
};
|
|
259
|
+
</script>
|
|
260
|
+
|
|
261
|
+
<template>
|
|
262
|
+
<form class="profile-form" @submit.prevent="submitForm">
|
|
263
|
+
<div class="form-group">
|
|
264
|
+
<label>Age</label>
|
|
265
|
+
<Stepper
|
|
266
|
+
:min="18"
|
|
267
|
+
:max="65"
|
|
268
|
+
:step="1"
|
|
269
|
+
:value="formData.age"
|
|
270
|
+
@update:value="(value) => (formData.age = value)"
|
|
271
|
+
/>
|
|
272
|
+
</div>
|
|
273
|
+
|
|
274
|
+
<div class="form-group">
|
|
275
|
+
<label>Years of Experience</label>
|
|
276
|
+
<Stepper
|
|
277
|
+
:min="0"
|
|
278
|
+
:max="20"
|
|
279
|
+
:step="1"
|
|
280
|
+
:value="formData.experience"
|
|
281
|
+
@update:value="(value) => (formData.experience = value)"
|
|
282
|
+
/>
|
|
283
|
+
</div>
|
|
284
|
+
|
|
285
|
+
<div class="form-group">
|
|
286
|
+
<label>Team Size</label>
|
|
287
|
+
<Stepper
|
|
288
|
+
:min="1"
|
|
289
|
+
:max="50"
|
|
290
|
+
:step="1"
|
|
291
|
+
:value="formData.teamSize"
|
|
292
|
+
@update:value="(value) => (formData.teamSize = value)"
|
|
293
|
+
/>
|
|
294
|
+
</div>
|
|
295
|
+
|
|
296
|
+
<button type="submit">Save Profile</button>
|
|
297
|
+
</form>
|
|
298
|
+
</template>
|
|
299
|
+
|
|
300
|
+
<style module>
|
|
301
|
+
.profile-form {
|
|
302
|
+
display: flex;
|
|
303
|
+
flex-direction: column;
|
|
304
|
+
gap: 2rem;
|
|
305
|
+
max-width: 400px;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.form-group {
|
|
309
|
+
display: flex;
|
|
310
|
+
flex-direction: column;
|
|
311
|
+
gap: 0.5rem;
|
|
312
|
+
}
|
|
313
|
+
</style>
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### Settings Panel
|
|
317
|
+
|
|
318
|
+
```vue
|
|
319
|
+
<script setup lang="ts">
|
|
320
|
+
import { ref } from "vue";
|
|
321
|
+
import { Stepper } from "@umbra-ui/core";
|
|
322
|
+
|
|
323
|
+
const fontSize = ref(16);
|
|
324
|
+
const lineSpacing = ref(1.5);
|
|
325
|
+
const maxConnections = ref(10);
|
|
326
|
+
|
|
327
|
+
const saveSettings = () => {
|
|
328
|
+
const settings = {
|
|
329
|
+
fontSize: fontSize.value,
|
|
330
|
+
lineSpacing: lineSpacing.value,
|
|
331
|
+
maxConnections: maxConnections.value,
|
|
332
|
+
};
|
|
333
|
+
console.log("Settings saved:", settings);
|
|
334
|
+
};
|
|
335
|
+
</script>
|
|
336
|
+
|
|
337
|
+
<template>
|
|
338
|
+
<div class="settings-panel">
|
|
339
|
+
<h2>Application Settings</h2>
|
|
340
|
+
|
|
341
|
+
<div class="setting-group">
|
|
342
|
+
<label>Font Size: {{ fontSize }}px</label>
|
|
343
|
+
<Stepper
|
|
344
|
+
:min="12"
|
|
345
|
+
:max="24"
|
|
346
|
+
:step="1"
|
|
347
|
+
:value="fontSize"
|
|
348
|
+
@update:value="(value) => (fontSize = value)"
|
|
349
|
+
/>
|
|
350
|
+
</div>
|
|
351
|
+
|
|
352
|
+
<div class="setting-group">
|
|
353
|
+
<label>Line Spacing: {{ lineSpacing }}</label>
|
|
354
|
+
<Stepper
|
|
355
|
+
:min="1"
|
|
356
|
+
:max="3"
|
|
357
|
+
:step="0.1"
|
|
358
|
+
:value="lineSpacing"
|
|
359
|
+
@update:value="(value) => (lineSpacing = value)"
|
|
360
|
+
/>
|
|
361
|
+
</div>
|
|
362
|
+
|
|
363
|
+
<div class="setting-group">
|
|
364
|
+
<label>Max Connections: {{ maxConnections }}</label>
|
|
365
|
+
<Stepper
|
|
366
|
+
:min="1"
|
|
367
|
+
:max="100"
|
|
368
|
+
:step="1"
|
|
369
|
+
:value="maxConnections"
|
|
370
|
+
@update:value="(value) => (maxConnections = value)"
|
|
371
|
+
/>
|
|
372
|
+
</div>
|
|
373
|
+
|
|
374
|
+
<button @click="saveSettings">Save Settings</button>
|
|
375
|
+
</div>
|
|
376
|
+
</template>
|
|
377
|
+
|
|
378
|
+
<style module>
|
|
379
|
+
.settings-panel {
|
|
380
|
+
display: flex;
|
|
381
|
+
flex-direction: column;
|
|
382
|
+
gap: 2rem;
|
|
383
|
+
max-width: 400px;
|
|
384
|
+
padding: 2rem;
|
|
385
|
+
background-color: #f5f5f5;
|
|
386
|
+
border-radius: 0.5rem;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.setting-group {
|
|
390
|
+
display: flex;
|
|
391
|
+
flex-direction: column;
|
|
392
|
+
gap: 1rem;
|
|
393
|
+
}
|
|
394
|
+
</style>
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
### Timer Controls
|
|
398
|
+
|
|
399
|
+
```vue
|
|
400
|
+
<script setup lang="ts">
|
|
401
|
+
import { ref } from "vue";
|
|
402
|
+
import { Stepper } from "@umbra-ui/core";
|
|
403
|
+
|
|
404
|
+
const hours = ref(0);
|
|
405
|
+
const minutes = ref(30);
|
|
406
|
+
const seconds = ref(0);
|
|
407
|
+
|
|
408
|
+
const formatTime = (value: number) => {
|
|
409
|
+
return value.toString().padStart(2, "0");
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
const startTimer = () => {
|
|
413
|
+
const totalSeconds = hours.value * 3600 + minutes.value * 60 + seconds.value;
|
|
414
|
+
console.log(`Timer started for ${totalSeconds} seconds`);
|
|
415
|
+
};
|
|
416
|
+
</script>
|
|
417
|
+
|
|
418
|
+
<template>
|
|
419
|
+
<div class="timer-controls">
|
|
420
|
+
<h3>Set Timer</h3>
|
|
421
|
+
|
|
422
|
+
<div class="time-inputs">
|
|
423
|
+
<div class="time-group">
|
|
424
|
+
<label>Hours</label>
|
|
425
|
+
<Stepper
|
|
426
|
+
:min="0"
|
|
427
|
+
:max="23"
|
|
428
|
+
:step="1"
|
|
429
|
+
:value="hours"
|
|
430
|
+
@update:value="(value) => (hours = value)"
|
|
431
|
+
/>
|
|
432
|
+
<span class="time-label">{{ formatTime(hours) }}</span>
|
|
433
|
+
</div>
|
|
434
|
+
|
|
435
|
+
<div class="time-group">
|
|
436
|
+
<label>Minutes</label>
|
|
437
|
+
<Stepper
|
|
438
|
+
:min="0"
|
|
439
|
+
:max="59"
|
|
440
|
+
:step="1"
|
|
441
|
+
:value="minutes"
|
|
442
|
+
@update:value="(value) => (minutes = value)"
|
|
443
|
+
/>
|
|
444
|
+
<span class="time-label">{{ formatTime(minutes) }}</span>
|
|
445
|
+
</div>
|
|
446
|
+
|
|
447
|
+
<div class="time-group">
|
|
448
|
+
<label>Seconds</label>
|
|
449
|
+
<Stepper
|
|
450
|
+
:min="0"
|
|
451
|
+
:max="59"
|
|
452
|
+
:step="1"
|
|
453
|
+
:value="seconds"
|
|
454
|
+
@update:value="(value) => (seconds = value)"
|
|
455
|
+
/>
|
|
456
|
+
<span class="time-label">{{ formatTime(seconds) }}</span>
|
|
457
|
+
</div>
|
|
458
|
+
</div>
|
|
459
|
+
|
|
460
|
+
<button @click="startTimer">Start Timer</button>
|
|
461
|
+
</div>
|
|
462
|
+
</template>
|
|
463
|
+
|
|
464
|
+
<style module>
|
|
465
|
+
.timer-controls {
|
|
466
|
+
display: flex;
|
|
467
|
+
flex-direction: column;
|
|
468
|
+
gap: 2rem;
|
|
469
|
+
align-items: center;
|
|
470
|
+
max-width: 500px;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.time-inputs {
|
|
474
|
+
display: flex;
|
|
475
|
+
gap: 2rem;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
.time-group {
|
|
479
|
+
display: flex;
|
|
480
|
+
flex-direction: column;
|
|
481
|
+
gap: 0.5rem;
|
|
482
|
+
align-items: center;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
.time-label {
|
|
486
|
+
font-family: monospace;
|
|
487
|
+
font-size: 1.2rem;
|
|
488
|
+
font-weight: bold;
|
|
489
|
+
}
|
|
490
|
+
</style>
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
### Multi-Step Configuration
|
|
494
|
+
|
|
495
|
+
```vue
|
|
496
|
+
<script setup lang="ts">
|
|
497
|
+
import { ref, computed } from "vue";
|
|
498
|
+
import { Stepper } from "@umbra-ui/core";
|
|
499
|
+
|
|
500
|
+
const baseValue = ref(10);
|
|
501
|
+
const multiplier = ref(2);
|
|
502
|
+
|
|
503
|
+
const result = computed(() => {
|
|
504
|
+
return baseValue.value * multiplier.value;
|
|
505
|
+
});
|
|
506
|
+
|
|
507
|
+
const reset = () => {
|
|
508
|
+
baseValue.value = 10;
|
|
509
|
+
multiplier.value = 2;
|
|
510
|
+
};
|
|
511
|
+
</script>
|
|
512
|
+
|
|
513
|
+
<template>
|
|
514
|
+
<div class="multi-step-config">
|
|
515
|
+
<h3>Configuration</h3>
|
|
516
|
+
|
|
517
|
+
<div class="config-group">
|
|
518
|
+
<label>Base Value: {{ baseValue }}</label>
|
|
519
|
+
<Stepper
|
|
520
|
+
:min="1"
|
|
521
|
+
:max="100"
|
|
522
|
+
:step="1"
|
|
523
|
+
:value="baseValue"
|
|
524
|
+
@update:value="(value) => (baseValue = value)"
|
|
525
|
+
/>
|
|
526
|
+
</div>
|
|
527
|
+
|
|
528
|
+
<div class="config-group">
|
|
529
|
+
<label>Multiplier: {{ multiplier }}</label>
|
|
530
|
+
<Stepper
|
|
531
|
+
:min="1"
|
|
532
|
+
:max="10"
|
|
533
|
+
:step="1"
|
|
534
|
+
:value="multiplier"
|
|
535
|
+
@update:value="(value) => (multiplier = value)"
|
|
536
|
+
/>
|
|
537
|
+
</div>
|
|
538
|
+
|
|
539
|
+
<div class="result-display">
|
|
540
|
+
<h4>Result: {{ result }}</h4>
|
|
541
|
+
</div>
|
|
542
|
+
|
|
543
|
+
<button @click="reset">Reset</button>
|
|
544
|
+
</div>
|
|
545
|
+
</template>
|
|
546
|
+
|
|
547
|
+
<style module>
|
|
548
|
+
.multi-step-config {
|
|
549
|
+
display: flex;
|
|
550
|
+
flex-direction: column;
|
|
551
|
+
gap: 2rem;
|
|
552
|
+
max-width: 400px;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
.config-group {
|
|
556
|
+
display: flex;
|
|
557
|
+
flex-direction: column;
|
|
558
|
+
gap: 1rem;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
.result-display {
|
|
562
|
+
padding: 1rem;
|
|
563
|
+
background-color: #e3f2fd;
|
|
564
|
+
border-radius: 0.25rem;
|
|
565
|
+
text-align: center;
|
|
566
|
+
}
|
|
567
|
+
</style>
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
## Interactive Features
|
|
571
|
+
|
|
572
|
+
### Hover Effects
|
|
573
|
+
|
|
574
|
+
- Icons scale up slightly on hover for better visual feedback
|
|
575
|
+
- Opacity changes provide clear interactive states
|
|
576
|
+
- Smooth transitions enhance the user experience
|
|
577
|
+
|
|
578
|
+
### Value Constraints
|
|
579
|
+
|
|
580
|
+
- Automatically enforces min/max boundaries
|
|
581
|
+
- Prevents values from going below minimum or above maximum
|
|
582
|
+
- Provides immediate visual feedback when limits are reached
|
|
583
|
+
|
|
584
|
+
### Step Control
|
|
585
|
+
|
|
586
|
+
- Configurable step size for different use cases
|
|
587
|
+
- Supports decimal steps for precise control
|
|
588
|
+
- Maintains value precision during calculations
|
|
589
|
+
|
|
590
|
+
## Notes
|
|
591
|
+
|
|
592
|
+
- The component includes smooth hover animations with scale transforms
|
|
593
|
+
- Icons are provided by the @umbra-ui/icons package
|
|
594
|
+
- The component automatically constrains values within the min/max range
|
|
595
|
+
- All interactions are fully accessible with proper click handling
|
|
596
|
+
- The component supports both light and dark themes
|
|
597
|
+
- The stepper provides immediate visual feedback during interactions
|
|
598
|
+
- The component is optimized for performance with efficient event handling
|
|
599
|
+
- The value display is centered and clearly visible
|
|
600
|
+
- The component uses consistent spacing and typography
|
|
601
|
+
- The stepper is designed to work well in forms and settings panels
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { MinusIcon, PlusIcon } from "@umbra-ui/icons";
|
|
3
|
+
import { ref, watch } from "vue";
|
|
4
|
+
import "./theme.css";
|
|
5
|
+
|
|
6
|
+
export interface Props {
|
|
7
|
+
value?: number;
|
|
8
|
+
min?: number;
|
|
9
|
+
max?: number;
|
|
10
|
+
step?: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
14
|
+
value: 0,
|
|
15
|
+
min: 0,
|
|
16
|
+
max: 100,
|
|
17
|
+
step: 1,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const emit = defineEmits<{
|
|
21
|
+
"update:value": [value: number];
|
|
22
|
+
}>();
|
|
23
|
+
|
|
24
|
+
// Reactive state for the stepper value
|
|
25
|
+
const internalValue = ref(props.value);
|
|
26
|
+
|
|
27
|
+
// Watch for changes to value prop
|
|
28
|
+
watch(
|
|
29
|
+
() => props.value,
|
|
30
|
+
(newValue) => {
|
|
31
|
+
internalValue.value = newValue;
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
// Methods to increment and decrement the value
|
|
36
|
+
const increment = () => {
|
|
37
|
+
const newValue = Math.min(props.max, internalValue.value + props.step);
|
|
38
|
+
internalValue.value = newValue;
|
|
39
|
+
emit("update:value", newValue);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const decrement = () => {
|
|
43
|
+
const newValue = Math.max(props.min, internalValue.value - props.step);
|
|
44
|
+
internalValue.value = newValue;
|
|
45
|
+
emit("update:value", newValue);
|
|
46
|
+
};
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<template>
|
|
50
|
+
<div :class="$style.container">
|
|
51
|
+
<MinusIcon :class="$style.icon" @click="decrement" />
|
|
52
|
+
<div :class="$style.value">{{ internalValue }}</div>
|
|
53
|
+
<PlusIcon :class="$style.icon" @click="increment" />
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<style module>
|
|
58
|
+
.container {
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
justify-content: space-between;
|
|
62
|
+
background-color: var(--stepper-container-bg);
|
|
63
|
+
border-radius: 0.353rem;
|
|
64
|
+
height: 2.5rem;
|
|
65
|
+
box-shadow: 0px 1px 0px 0px var(--stepper-container-shadow-dark),
|
|
66
|
+
inset 0px 1px 0px 0px var(--stepper-container-shadow-light);
|
|
67
|
+
width: fit-content;
|
|
68
|
+
border: var(--stepper-container-border);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.icon {
|
|
72
|
+
transition: transform 0.2s ease, opacity 0.2s ease;
|
|
73
|
+
user-select: none;
|
|
74
|
+
opacity: var(--stepper-icon-opacity);
|
|
75
|
+
padding: 0.588rem;
|
|
76
|
+
width: 3.5rem;
|
|
77
|
+
height: 100%;
|
|
78
|
+
}
|
|
79
|
+
.icon:hover {
|
|
80
|
+
transform: scale(1.1);
|
|
81
|
+
opacity: var(--stepper-icon-hover-opacity);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.value {
|
|
85
|
+
user-select: none;
|
|
86
|
+
cursor: default;
|
|
87
|
+
color: var(--stepper-value-color);
|
|
88
|
+
font-size: 1rem;
|
|
89
|
+
padding: 0.588rem;
|
|
90
|
+
width: 3.5rem;
|
|
91
|
+
height: 2.5rem;
|
|
92
|
+
display: flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
justify-content: center;
|
|
95
|
+
transition: transform 0.2s ease, opacity 0.2s ease,
|
|
96
|
+
background-color 0.2s ease-in-out;
|
|
97
|
+
background-color: transparent;
|
|
98
|
+
border-left: 1px solid var(--stepper-value-border);
|
|
99
|
+
border-right: 1px solid var(--stepper-value-border);
|
|
100
|
+
margin-top: 2px;
|
|
101
|
+
margin-bottom: 2px;
|
|
102
|
+
}
|
|
103
|
+
</style>
|