@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,643 @@
|
|
|
1
|
+
# AutogrowTextView
|
|
2
|
+
|
|
3
|
+
A text input component that automatically grows in height as the user types, built with Vue 3 Composition API and TypeScript. The AutogrowTextView component provides a seamless text editing experience with automatic height adjustment, customizable styling, and smooth transitions.
|
|
4
|
+
|
|
5
|
+
## Installation/Import
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { AutogrowTextView } from "@umbra-ui/core";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Dependencies:**
|
|
12
|
+
|
|
13
|
+
- Vue 3.x
|
|
14
|
+
- autosize (for automatic height adjustment)
|
|
15
|
+
|
|
16
|
+
## Basic Usage
|
|
17
|
+
|
|
18
|
+
```vue
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import { ref } from "vue";
|
|
21
|
+
import { AutogrowTextView } from "@umbra-ui/core";
|
|
22
|
+
|
|
23
|
+
const text = ref("");
|
|
24
|
+
|
|
25
|
+
const handleTextUpdate = (newText: string) => {
|
|
26
|
+
console.log("Text updated:", newText);
|
|
27
|
+
text.value = newText;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const handleBlur = (text: string) => {
|
|
31
|
+
console.log("Text on blur:", text);
|
|
32
|
+
};
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<div>
|
|
37
|
+
<AutogrowTextView
|
|
38
|
+
v-model:text="text"
|
|
39
|
+
placeholder="Start typing..."
|
|
40
|
+
@update:text="handleTextUpdate"
|
|
41
|
+
@onBlur="handleBlur"
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Props
|
|
48
|
+
|
|
49
|
+
| Prop Name | Type | Required | Default | Description |
|
|
50
|
+
| ------------- | -------- | -------- | ---------------- | ---------------------------------------------------- |
|
|
51
|
+
| `text` | `string` | No | `""` | The text content of the textarea |
|
|
52
|
+
| `placeholder` | `string` | No | `"Type Here..."` | Placeholder text displayed when empty |
|
|
53
|
+
| `fontStyle` | `string` | No | `"body"` | CSS class for font styling (e.g., "body", "caption") |
|
|
54
|
+
|
|
55
|
+
## Events
|
|
56
|
+
|
|
57
|
+
| Event Name | Payload Type | Description |
|
|
58
|
+
| ------------- | ------------ | ------------------------------------- |
|
|
59
|
+
| `update:text` | `string` | Emitted when the text content changes |
|
|
60
|
+
| `onBlur` | `string` | Emitted when the textarea loses focus |
|
|
61
|
+
|
|
62
|
+
## Slots
|
|
63
|
+
|
|
64
|
+
This component does not use slots.
|
|
65
|
+
|
|
66
|
+
## Exposed Methods/Refs
|
|
67
|
+
|
|
68
|
+
This component does not expose any methods or refs.
|
|
69
|
+
|
|
70
|
+
## CSS Customization
|
|
71
|
+
|
|
72
|
+
The AutogrowTextView component uses CSS custom properties for easy theming and customization:
|
|
73
|
+
|
|
74
|
+
```css
|
|
75
|
+
/* AutogrowTextView colors */
|
|
76
|
+
--autogrow-bg: #ffffff;
|
|
77
|
+
--autogrow-border: #d9d9d9;
|
|
78
|
+
--autogrow-focus-border: #0090ff;
|
|
79
|
+
--autogrow-text-color: #202020;
|
|
80
|
+
--autogrow-placeholder-color: rgba(26, 29, 35, 0.5);
|
|
81
|
+
|
|
82
|
+
/* Customizable properties */
|
|
83
|
+
--autogrow-padding: 1.176rem;
|
|
84
|
+
--autogrow-border-radius: 0.706rem;
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Examples
|
|
88
|
+
|
|
89
|
+
### Basic Text Input
|
|
90
|
+
|
|
91
|
+
```vue
|
|
92
|
+
<script setup lang="ts">
|
|
93
|
+
import { ref } from "vue";
|
|
94
|
+
import { AutogrowTextView } from "@umbra-ui/core";
|
|
95
|
+
|
|
96
|
+
const message = ref("");
|
|
97
|
+
|
|
98
|
+
const handleSubmit = () => {
|
|
99
|
+
if (message.value.trim()) {
|
|
100
|
+
console.log("Sending message:", message.value);
|
|
101
|
+
message.value = "";
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
</script>
|
|
105
|
+
|
|
106
|
+
<template>
|
|
107
|
+
<div class="message-composer">
|
|
108
|
+
<h3>Compose Message</h3>
|
|
109
|
+
|
|
110
|
+
<AutogrowTextView
|
|
111
|
+
v-model:text="message"
|
|
112
|
+
placeholder="Type your message here..."
|
|
113
|
+
fontStyle="body"
|
|
114
|
+
/>
|
|
115
|
+
|
|
116
|
+
<button @click="handleSubmit" :disabled="!message.trim()">
|
|
117
|
+
Send Message
|
|
118
|
+
</button>
|
|
119
|
+
</div>
|
|
120
|
+
</template>
|
|
121
|
+
|
|
122
|
+
<style module>
|
|
123
|
+
.message-composer {
|
|
124
|
+
max-width: 500px;
|
|
125
|
+
padding: 1.5rem;
|
|
126
|
+
border: 1px solid #e0e0e0;
|
|
127
|
+
border-radius: 8px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
button {
|
|
131
|
+
margin-top: 1rem;
|
|
132
|
+
padding: 0.5rem 1rem;
|
|
133
|
+
background-color: #007bff;
|
|
134
|
+
color: white;
|
|
135
|
+
border: none;
|
|
136
|
+
border-radius: 4px;
|
|
137
|
+
cursor: pointer;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
button:disabled {
|
|
141
|
+
background-color: #ccc;
|
|
142
|
+
cursor: not-allowed;
|
|
143
|
+
}
|
|
144
|
+
</style>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Different Font Styles
|
|
148
|
+
|
|
149
|
+
```vue
|
|
150
|
+
<script setup lang="ts">
|
|
151
|
+
import { ref } from "vue";
|
|
152
|
+
import { AutogrowTextView } from "@umbra-ui/core";
|
|
153
|
+
|
|
154
|
+
const bodyText = ref("");
|
|
155
|
+
const captionText = ref("");
|
|
156
|
+
const headlineText = ref("");
|
|
157
|
+
</script>
|
|
158
|
+
|
|
159
|
+
<template>
|
|
160
|
+
<div class="font-styles">
|
|
161
|
+
<h3>Font Style Examples</h3>
|
|
162
|
+
|
|
163
|
+
<div class="style-group">
|
|
164
|
+
<label>Body Text</label>
|
|
165
|
+
<AutogrowTextView
|
|
166
|
+
v-model:text="bodyText"
|
|
167
|
+
placeholder="Body style text..."
|
|
168
|
+
fontStyle="body"
|
|
169
|
+
/>
|
|
170
|
+
</div>
|
|
171
|
+
|
|
172
|
+
<div class="style-group">
|
|
173
|
+
<label>Caption Text</label>
|
|
174
|
+
<AutogrowTextView
|
|
175
|
+
v-model:text="captionText"
|
|
176
|
+
placeholder="Caption style text..."
|
|
177
|
+
fontStyle="caption"
|
|
178
|
+
/>
|
|
179
|
+
</div>
|
|
180
|
+
|
|
181
|
+
<div class="style-group">
|
|
182
|
+
<label>Headline Text</label>
|
|
183
|
+
<AutogrowTextView
|
|
184
|
+
v-model:text="headlineText"
|
|
185
|
+
placeholder="Headline style text..."
|
|
186
|
+
fontStyle="headline"
|
|
187
|
+
/>
|
|
188
|
+
</div>
|
|
189
|
+
</div>
|
|
190
|
+
</template>
|
|
191
|
+
|
|
192
|
+
<style module>
|
|
193
|
+
.font-styles {
|
|
194
|
+
max-width: 600px;
|
|
195
|
+
padding: 1.5rem;
|
|
196
|
+
border: 1px solid #e0e0e0;
|
|
197
|
+
border-radius: 8px;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.style-group {
|
|
201
|
+
margin-bottom: 1.5rem;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
label {
|
|
205
|
+
display: block;
|
|
206
|
+
margin-bottom: 0.5rem;
|
|
207
|
+
font-weight: 500;
|
|
208
|
+
color: #333;
|
|
209
|
+
}
|
|
210
|
+
</style>
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Form Integration
|
|
214
|
+
|
|
215
|
+
```vue
|
|
216
|
+
<script setup lang="ts">
|
|
217
|
+
import { ref } from "vue";
|
|
218
|
+
import { AutogrowTextView } from "@umbra-ui/core";
|
|
219
|
+
|
|
220
|
+
const formData = ref({
|
|
221
|
+
title: "",
|
|
222
|
+
description: "",
|
|
223
|
+
notes: "",
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
const handleSubmit = () => {
|
|
227
|
+
console.log("Form submitted:", formData.value);
|
|
228
|
+
// Reset form
|
|
229
|
+
formData.value = {
|
|
230
|
+
title: "",
|
|
231
|
+
description: "",
|
|
232
|
+
notes: "",
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
</script>
|
|
236
|
+
|
|
237
|
+
<template>
|
|
238
|
+
<div class="form-example">
|
|
239
|
+
<h3>Create Post</h3>
|
|
240
|
+
|
|
241
|
+
<form @submit.prevent="handleSubmit">
|
|
242
|
+
<div class="form-group">
|
|
243
|
+
<label>Title</label>
|
|
244
|
+
<input
|
|
245
|
+
v-model="formData.title"
|
|
246
|
+
type="text"
|
|
247
|
+
placeholder="Enter post title"
|
|
248
|
+
required
|
|
249
|
+
/>
|
|
250
|
+
</div>
|
|
251
|
+
|
|
252
|
+
<div class="form-group">
|
|
253
|
+
<label>Description</label>
|
|
254
|
+
<AutogrowTextView
|
|
255
|
+
v-model:text="formData.description"
|
|
256
|
+
placeholder="Enter post description..."
|
|
257
|
+
fontStyle="body"
|
|
258
|
+
/>
|
|
259
|
+
</div>
|
|
260
|
+
|
|
261
|
+
<div class="form-group">
|
|
262
|
+
<label>Notes (Optional)</label>
|
|
263
|
+
<AutogrowTextView
|
|
264
|
+
v-model:text="formData.notes"
|
|
265
|
+
placeholder="Add any additional notes..."
|
|
266
|
+
fontStyle="caption"
|
|
267
|
+
/>
|
|
268
|
+
</div>
|
|
269
|
+
|
|
270
|
+
<button type="submit">Create Post</button>
|
|
271
|
+
</form>
|
|
272
|
+
</div>
|
|
273
|
+
</template>
|
|
274
|
+
|
|
275
|
+
<style module>
|
|
276
|
+
.form-example {
|
|
277
|
+
max-width: 600px;
|
|
278
|
+
padding: 1.5rem;
|
|
279
|
+
border: 1px solid #e0e0e0;
|
|
280
|
+
border-radius: 8px;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.form-group {
|
|
284
|
+
margin-bottom: 1.5rem;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
label {
|
|
288
|
+
display: block;
|
|
289
|
+
margin-bottom: 0.5rem;
|
|
290
|
+
font-weight: 500;
|
|
291
|
+
color: #333;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
input {
|
|
295
|
+
width: 100%;
|
|
296
|
+
padding: 0.5rem;
|
|
297
|
+
border: 1px solid #ddd;
|
|
298
|
+
border-radius: 4px;
|
|
299
|
+
font-size: 1rem;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
button {
|
|
303
|
+
padding: 0.75rem 1.5rem;
|
|
304
|
+
background-color: #28a745;
|
|
305
|
+
color: white;
|
|
306
|
+
border: none;
|
|
307
|
+
border-radius: 4px;
|
|
308
|
+
cursor: pointer;
|
|
309
|
+
font-size: 1rem;
|
|
310
|
+
}
|
|
311
|
+
</style>
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### Comment System
|
|
315
|
+
|
|
316
|
+
```vue
|
|
317
|
+
<script setup lang="ts">
|
|
318
|
+
import { ref } from "vue";
|
|
319
|
+
import { AutogrowTextView } from "@umbra-ui/core";
|
|
320
|
+
|
|
321
|
+
const newComment = ref("");
|
|
322
|
+
const comments = ref([
|
|
323
|
+
{
|
|
324
|
+
id: 1,
|
|
325
|
+
text: "This is a great article!",
|
|
326
|
+
author: "John Doe",
|
|
327
|
+
timestamp: "2 hours ago",
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
id: 2,
|
|
331
|
+
text: "I learned a lot from this. Thank you for sharing!",
|
|
332
|
+
author: "Jane Smith",
|
|
333
|
+
timestamp: "1 hour ago",
|
|
334
|
+
},
|
|
335
|
+
]);
|
|
336
|
+
|
|
337
|
+
const addComment = () => {
|
|
338
|
+
if (newComment.value.trim()) {
|
|
339
|
+
comments.value.push({
|
|
340
|
+
id: comments.value.length + 1,
|
|
341
|
+
text: newComment.value,
|
|
342
|
+
author: "Current User",
|
|
343
|
+
timestamp: "Just now",
|
|
344
|
+
});
|
|
345
|
+
newComment.value = "";
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
</script>
|
|
349
|
+
|
|
350
|
+
<template>
|
|
351
|
+
<div class="comment-system">
|
|
352
|
+
<h3>Comments</h3>
|
|
353
|
+
|
|
354
|
+
<div class="comments-list">
|
|
355
|
+
<div v-for="comment in comments" :key="comment.id" class="comment">
|
|
356
|
+
<div class="comment-header">
|
|
357
|
+
<strong>{{ comment.author }}</strong>
|
|
358
|
+
<span class="timestamp">{{ comment.timestamp }}</span>
|
|
359
|
+
</div>
|
|
360
|
+
<p class="comment-text">{{ comment.text }}</p>
|
|
361
|
+
</div>
|
|
362
|
+
</div>
|
|
363
|
+
|
|
364
|
+
<div class="add-comment">
|
|
365
|
+
<AutogrowTextView
|
|
366
|
+
v-model:text="newComment"
|
|
367
|
+
placeholder="Add a comment..."
|
|
368
|
+
fontStyle="body"
|
|
369
|
+
@onBlur="() => console.log('Comment input lost focus')"
|
|
370
|
+
/>
|
|
371
|
+
<button @click="addComment" :disabled="!newComment.trim()">
|
|
372
|
+
Add Comment
|
|
373
|
+
</button>
|
|
374
|
+
</div>
|
|
375
|
+
</div>
|
|
376
|
+
</template>
|
|
377
|
+
|
|
378
|
+
<style module>
|
|
379
|
+
.comment-system {
|
|
380
|
+
max-width: 600px;
|
|
381
|
+
padding: 1.5rem;
|
|
382
|
+
border: 1px solid #e0e0e0;
|
|
383
|
+
border-radius: 8px;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.comments-list {
|
|
387
|
+
margin-bottom: 1.5rem;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.comment {
|
|
391
|
+
padding: 1rem;
|
|
392
|
+
margin-bottom: 1rem;
|
|
393
|
+
background-color: #f8f9fa;
|
|
394
|
+
border-radius: 6px;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
.comment-header {
|
|
398
|
+
display: flex;
|
|
399
|
+
justify-content: space-between;
|
|
400
|
+
margin-bottom: 0.5rem;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.timestamp {
|
|
404
|
+
color: #666;
|
|
405
|
+
font-size: 0.9rem;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
.comment-text {
|
|
409
|
+
margin: 0;
|
|
410
|
+
line-height: 1.5;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.add-comment {
|
|
414
|
+
border-top: 1px solid #e0e0e0;
|
|
415
|
+
padding-top: 1rem;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
button {
|
|
419
|
+
margin-top: 0.5rem;
|
|
420
|
+
padding: 0.5rem 1rem;
|
|
421
|
+
background-color: #007bff;
|
|
422
|
+
color: white;
|
|
423
|
+
border: none;
|
|
424
|
+
border-radius: 4px;
|
|
425
|
+
cursor: pointer;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
button:disabled {
|
|
429
|
+
background-color: #ccc;
|
|
430
|
+
cursor: not-allowed;
|
|
431
|
+
}
|
|
432
|
+
</style>
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
### Notes App
|
|
436
|
+
|
|
437
|
+
```vue
|
|
438
|
+
<script setup lang="ts">
|
|
439
|
+
import { ref } from "vue";
|
|
440
|
+
import { AutogrowTextView } from "@umbra-ui/core";
|
|
441
|
+
|
|
442
|
+
const notes = ref([
|
|
443
|
+
{
|
|
444
|
+
id: 1,
|
|
445
|
+
title: "Meeting Notes",
|
|
446
|
+
content: "Discuss project timeline and deliverables for Q1.",
|
|
447
|
+
lastModified: "2024-01-15",
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
id: 2,
|
|
451
|
+
title: "Ideas",
|
|
452
|
+
content:
|
|
453
|
+
"New feature ideas for the mobile app:\n- Dark mode\n- Offline support\n- Push notifications",
|
|
454
|
+
lastModified: "2024-01-14",
|
|
455
|
+
},
|
|
456
|
+
]);
|
|
457
|
+
|
|
458
|
+
const newNote = ref({
|
|
459
|
+
title: "",
|
|
460
|
+
content: "",
|
|
461
|
+
});
|
|
462
|
+
|
|
463
|
+
const addNote = () => {
|
|
464
|
+
if (newNote.value.title.trim() && newNote.value.content.trim()) {
|
|
465
|
+
notes.value.push({
|
|
466
|
+
id: notes.value.length + 1,
|
|
467
|
+
title: newNote.value.title,
|
|
468
|
+
content: newNote.value.content,
|
|
469
|
+
lastModified: new Date().toISOString().split("T")[0],
|
|
470
|
+
});
|
|
471
|
+
newNote.value = { title: "", content: "" };
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
</script>
|
|
475
|
+
|
|
476
|
+
<template>
|
|
477
|
+
<div class="notes-app">
|
|
478
|
+
<h3>My Notes</h3>
|
|
479
|
+
|
|
480
|
+
<div class="notes-list">
|
|
481
|
+
<div v-for="note in notes" :key="note.id" class="note">
|
|
482
|
+
<h4>{{ note.title }}</h4>
|
|
483
|
+
<p class="note-content">{{ note.content }}</p>
|
|
484
|
+
<span class="note-date">{{ note.lastModified }}</span>
|
|
485
|
+
</div>
|
|
486
|
+
</div>
|
|
487
|
+
|
|
488
|
+
<div class="add-note">
|
|
489
|
+
<h4>Add New Note</h4>
|
|
490
|
+
|
|
491
|
+
<div class="note-form">
|
|
492
|
+
<input
|
|
493
|
+
v-model="newNote.title"
|
|
494
|
+
type="text"
|
|
495
|
+
placeholder="Note title"
|
|
496
|
+
class="note-title"
|
|
497
|
+
/>
|
|
498
|
+
|
|
499
|
+
<AutogrowTextView
|
|
500
|
+
v-model:text="newNote.content"
|
|
501
|
+
placeholder="Write your note here..."
|
|
502
|
+
fontStyle="body"
|
|
503
|
+
/>
|
|
504
|
+
|
|
505
|
+
<button
|
|
506
|
+
@click="addNote"
|
|
507
|
+
:disabled="!newNote.title.trim() || !newNote.content.trim()"
|
|
508
|
+
>
|
|
509
|
+
Add Note
|
|
510
|
+
</button>
|
|
511
|
+
</div>
|
|
512
|
+
</div>
|
|
513
|
+
</div>
|
|
514
|
+
</template>
|
|
515
|
+
|
|
516
|
+
<style module>
|
|
517
|
+
.notes-app {
|
|
518
|
+
max-width: 700px;
|
|
519
|
+
padding: 1.5rem;
|
|
520
|
+
border: 1px solid #e0e0e0;
|
|
521
|
+
border-radius: 8px;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
.notes-list {
|
|
525
|
+
margin-bottom: 2rem;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
.note {
|
|
529
|
+
padding: 1rem;
|
|
530
|
+
margin-bottom: 1rem;
|
|
531
|
+
background-color: #f8f9fa;
|
|
532
|
+
border-radius: 6px;
|
|
533
|
+
border-left: 4px solid #007bff;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
.note h4 {
|
|
537
|
+
margin: 0 0 0.5rem 0;
|
|
538
|
+
color: #333;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
.note-content {
|
|
542
|
+
margin: 0 0 0.5rem 0;
|
|
543
|
+
line-height: 1.5;
|
|
544
|
+
white-space: pre-line;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
.note-date {
|
|
548
|
+
color: #666;
|
|
549
|
+
font-size: 0.9rem;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
.add-note {
|
|
553
|
+
border-top: 1px solid #e0e0e0;
|
|
554
|
+
padding-top: 1.5rem;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
.note-form {
|
|
558
|
+
display: flex;
|
|
559
|
+
flex-direction: column;
|
|
560
|
+
gap: 1rem;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
.note-title {
|
|
564
|
+
padding: 0.5rem;
|
|
565
|
+
border: 1px solid #ddd;
|
|
566
|
+
border-radius: 4px;
|
|
567
|
+
font-size: 1rem;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
button {
|
|
571
|
+
padding: 0.75rem 1rem;
|
|
572
|
+
background-color: #28a745;
|
|
573
|
+
color: white;
|
|
574
|
+
border: none;
|
|
575
|
+
border-radius: 4px;
|
|
576
|
+
cursor: pointer;
|
|
577
|
+
font-size: 1rem;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
button:disabled {
|
|
581
|
+
background-color: #ccc;
|
|
582
|
+
cursor: not-allowed;
|
|
583
|
+
}
|
|
584
|
+
</style>
|
|
585
|
+
```
|
|
586
|
+
|
|
587
|
+
### Custom Styling
|
|
588
|
+
|
|
589
|
+
```vue
|
|
590
|
+
<script setup lang="ts">
|
|
591
|
+
import { ref } from "vue";
|
|
592
|
+
import { AutogrowTextView } from "@umbra-ui/core";
|
|
593
|
+
|
|
594
|
+
const customText = ref("");
|
|
595
|
+
</script>
|
|
596
|
+
|
|
597
|
+
<template>
|
|
598
|
+
<div class="custom-styling">
|
|
599
|
+
<h3>Custom Styled AutogrowTextView</h3>
|
|
600
|
+
|
|
601
|
+
<div class="custom-container">
|
|
602
|
+
<AutogrowTextView
|
|
603
|
+
v-model:text="customText"
|
|
604
|
+
placeholder="This textarea has custom styling..."
|
|
605
|
+
fontStyle="body"
|
|
606
|
+
/>
|
|
607
|
+
</div>
|
|
608
|
+
</div>
|
|
609
|
+
</template>
|
|
610
|
+
|
|
611
|
+
<style module>
|
|
612
|
+
.custom-styling {
|
|
613
|
+
max-width: 500px;
|
|
614
|
+
padding: 1.5rem;
|
|
615
|
+
border: 1px solid #e0e0e0;
|
|
616
|
+
border-radius: 8px;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
.custom-container {
|
|
620
|
+
/* Override CSS custom properties for custom styling */
|
|
621
|
+
--autogrow-bg: #f0f8ff;
|
|
622
|
+
--autogrow-border: #4a90e2;
|
|
623
|
+
--autogrow-focus-border: #2c5aa0;
|
|
624
|
+
--autogrow-text-color: #1a365d;
|
|
625
|
+
--autogrow-placeholder-color: rgba(26, 54, 93, 0.6);
|
|
626
|
+
--autogrow-padding: 1.5rem;
|
|
627
|
+
--autogrow-border-radius: 12px;
|
|
628
|
+
}
|
|
629
|
+
</style>
|
|
630
|
+
```
|
|
631
|
+
|
|
632
|
+
## Notes
|
|
633
|
+
|
|
634
|
+
- The component automatically adjusts its height based on content using the `autosize` library
|
|
635
|
+
- The textarea is not resizable by the user (resize: none)
|
|
636
|
+
- The component includes smooth border color transitions on focus
|
|
637
|
+
- The entire container is clickable to focus the textarea
|
|
638
|
+
- The component supports v-model binding with the `text` prop
|
|
639
|
+
- Font styling can be customized through the `fontStyle` prop
|
|
640
|
+
- The component includes proper cleanup of the autosize functionality on unmount
|
|
641
|
+
- The component supports both light and dark themes through CSS custom properties
|
|
642
|
+
- The component is fully accessible and supports keyboard navigation
|
|
643
|
+
- The autosize functionality is automatically updated when the text prop changes externally
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* Light theme */
|
|
2
|
+
:root {
|
|
3
|
+
/* AutogrowTextView colors - using primary/default values from original */
|
|
4
|
+
--autogrow-bg: #ffffff;
|
|
5
|
+
--autogrow-border: #d9d9d9;
|
|
6
|
+
--autogrow-focus-border: #0090ff;
|
|
7
|
+
--autogrow-text-color: #202020;
|
|
8
|
+
--autogrow-placeholder-color: rgba(26, 29, 35, 0.5);
|
|
9
|
+
|
|
10
|
+
/* Customizable properties */
|
|
11
|
+
--autogrow-padding: 1.176rem;
|
|
12
|
+
--autogrow-border-radius: 0.706rem;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/* Dark theme */
|
|
16
|
+
.dark,
|
|
17
|
+
.dark-theme {
|
|
18
|
+
/* AutogrowTextView colors - using primary/default values from original */
|
|
19
|
+
--autogrow-bg: #484848;
|
|
20
|
+
--autogrow-border: #606060;
|
|
21
|
+
--autogrow-focus-border: #0090ff;
|
|
22
|
+
--autogrow-text-color: #eeeeee;
|
|
23
|
+
--autogrow-placeholder-color: rgba(238, 238, 238, 0.5);
|
|
24
|
+
|
|
25
|
+
/* Customizable properties */
|
|
26
|
+
--autogrow-padding: 1.176rem;
|
|
27
|
+
--autogrow-border-radius: 0.706rem;
|
|
28
|
+
}
|