@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.
Files changed (272) hide show
  1. package/dist/components/controls/Dropdown/types.d.ts +5 -0
  2. package/dist/components/controls/Dropdown/types.d.ts.map +1 -0
  3. package/dist/components/controls/Dropdown/types.js +1 -0
  4. package/dist/components/controls/SegmentedControl/types.d.ts +6 -0
  5. package/dist/components/controls/SegmentedControl/types.d.ts.map +1 -0
  6. package/dist/components/controls/SegmentedControl/types.js +1 -0
  7. package/dist/components/dialogs/Alert/types.d.ts +7 -0
  8. package/dist/components/dialogs/Alert/types.d.ts.map +1 -0
  9. package/dist/components/dialogs/Alert/types.js +1 -0
  10. package/dist/components/dialogs/Toast/types.d.ts +34 -0
  11. package/dist/components/dialogs/Toast/types.d.ts.map +1 -0
  12. package/dist/components/dialogs/Toast/types.js +10 -0
  13. package/dist/components/dialogs/Toast/useToast.d.ts +36 -0
  14. package/dist/components/dialogs/Toast/useToast.d.ts.map +1 -0
  15. package/dist/components/dialogs/Toast/useToast.js +90 -0
  16. package/dist/components/indicators/Tooltip/tooltip.d.ts +3 -0
  17. package/dist/components/indicators/Tooltip/tooltip.d.ts.map +1 -0
  18. package/dist/components/indicators/Tooltip/tooltip.js +33 -0
  19. package/dist/components/indicators/Tooltip/types.d.ts +14 -0
  20. package/dist/components/indicators/Tooltip/types.d.ts.map +1 -0
  21. package/dist/components/indicators/Tooltip/types.js +1 -0
  22. package/dist/components/indicators/Tooltip/useTooltip.d.ts +18 -0
  23. package/dist/components/indicators/Tooltip/useTooltip.d.ts.map +1 -0
  24. package/dist/components/indicators/Tooltip/useTooltip.js +57 -0
  25. package/dist/components/inputs/Tags/tag-bar-styles.d.ts +14 -0
  26. package/dist/components/inputs/Tags/tag-bar-styles.d.ts.map +1 -0
  27. package/dist/components/inputs/Tags/tag-bar-styles.js +313 -0
  28. package/dist/components/inputs/Tags/types.d.ts +93 -0
  29. package/dist/components/inputs/Tags/types.d.ts.map +1 -0
  30. package/dist/components/inputs/Tags/types.js +216 -0
  31. package/dist/components/inputs/search/types.d.ts +9 -0
  32. package/dist/components/inputs/search/types.d.ts.map +1 -0
  33. package/dist/components/inputs/search/types.js +1 -0
  34. package/dist/components/navigation/adaptive/types.d.ts +16 -0
  35. package/dist/components/navigation/adaptive/types.d.ts.map +1 -0
  36. package/dist/components/navigation/adaptive/types.js +1 -0
  37. package/dist/components/navigation/adaptive/useAdaptiveLayout.d.ts +27 -0
  38. package/dist/components/navigation/adaptive/useAdaptiveLayout.d.ts.map +1 -0
  39. package/dist/components/navigation/adaptive/useAdaptiveLayout.js +40 -0
  40. package/dist/components/navigation/adaptive/useBreakpoints.d.ts +6 -0
  41. package/dist/components/navigation/adaptive/useBreakpoints.d.ts.map +1 -0
  42. package/dist/components/navigation/adaptive/useBreakpoints.js +37 -0
  43. package/dist/components/navigation/adaptive/useContainerMonitor.d.ts +93 -0
  44. package/dist/components/navigation/adaptive/useContainerMonitor.d.ts.map +1 -0
  45. package/dist/components/navigation/adaptive/useContainerMonitor.js +145 -0
  46. package/dist/components/navigation/adaptive/useViewAnimation.d.ts +31 -0
  47. package/dist/components/navigation/adaptive/useViewAnimation.d.ts.map +1 -0
  48. package/dist/components/navigation/adaptive/useViewAnimation.js +591 -0
  49. package/dist/components/navigation/adaptive/useViewResize.d.ts +52 -0
  50. package/dist/components/navigation/adaptive/useViewResize.d.ts.map +1 -0
  51. package/dist/components/navigation/adaptive/useViewResize.js +146 -0
  52. package/dist/components/navigation/navstack/useNavigationStack.d.ts +25 -0
  53. package/dist/components/navigation/navstack/useNavigationStack.d.ts.map +1 -0
  54. package/dist/components/navigation/navstack/useNavigationStack.js +133 -0
  55. package/dist/components/navigation/slideover/useSlideoverController.d.ts +20 -0
  56. package/dist/components/navigation/slideover/useSlideoverController.d.ts.map +1 -0
  57. package/dist/components/navigation/slideover/useSlideoverController.js +267 -0
  58. package/dist/components/navigation/splitview/useSplitViewController.d.ts +20 -0
  59. package/dist/components/navigation/splitview/useSplitViewController.d.ts.map +1 -0
  60. package/dist/components/navigation/splitview/useSplitViewController.js +325 -0
  61. package/dist/components/navigation/tabcontroller/types.d.ts +21 -0
  62. package/dist/components/navigation/tabcontroller/types.d.ts.map +1 -0
  63. package/dist/components/navigation/tabcontroller/types.js +1 -0
  64. package/dist/components/navigation/tabcontroller/useTabController.d.ts +5 -0
  65. package/dist/components/navigation/tabcontroller/useTabController.d.ts.map +1 -0
  66. package/dist/components/navigation/tabcontroller/useTabController.js +10 -0
  67. package/dist/components/navigation/types.d.ts +8 -0
  68. package/dist/components/navigation/types.d.ts.map +1 -0
  69. package/dist/components/navigation/types.js +1 -0
  70. package/dist/components/pickers/CollectionPicker/types.d.ts +11 -0
  71. package/dist/components/pickers/CollectionPicker/types.d.ts.map +1 -0
  72. package/dist/components/pickers/CollectionPicker/types.js +1 -0
  73. package/dist/components/pickers/ColorPicker/colors.d.ts +13 -0
  74. package/dist/components/pickers/ColorPicker/colors.d.ts.map +1 -0
  75. package/dist/components/pickers/ColorPicker/colors.js +266 -0
  76. package/dist/components/pickers/FilePicker/types.d.ts +10 -0
  77. package/dist/components/pickers/FilePicker/types.d.ts.map +1 -0
  78. package/dist/components/pickers/FilePicker/types.js +1 -0
  79. package/dist/index.d.ts +91 -0
  80. package/dist/index.d.ts.map +1 -0
  81. package/dist/index.js +196 -0
  82. package/dist/theme.d.ts +73 -0
  83. package/dist/theme.d.ts.map +1 -0
  84. package/dist/theme.js +279 -0
  85. package/dist/themes/blank.d.ts +7 -0
  86. package/dist/themes/blank.d.ts.map +1 -0
  87. package/dist/themes/blank.js +543 -0
  88. package/dist/themes/crimson-dark.d.ts +4 -0
  89. package/dist/themes/crimson-dark.d.ts.map +1 -0
  90. package/dist/themes/crimson-dark.js +552 -0
  91. package/dist/themes/cyan-light.d.ts +4 -0
  92. package/dist/themes/cyan-light.d.ts.map +1 -0
  93. package/dist/themes/cyan-light.js +552 -0
  94. package/dist/themes/dark.d.ts +4 -0
  95. package/dist/themes/dark.d.ts.map +1 -0
  96. package/dist/themes/dark.js +551 -0
  97. package/dist/themes/gold-dark.d.ts +4 -0
  98. package/dist/themes/gold-dark.d.ts.map +1 -0
  99. package/dist/themes/gold-dark.js +552 -0
  100. package/dist/themes/grass-dark.d.ts +4 -0
  101. package/dist/themes/grass-dark.d.ts.map +1 -0
  102. package/dist/themes/grass-dark.js +552 -0
  103. package/dist/themes/indigo.d.ts +4 -0
  104. package/dist/themes/indigo.d.ts.map +1 -0
  105. package/dist/themes/indigo.js +552 -0
  106. package/dist/themes/light.d.ts +4 -0
  107. package/dist/themes/light.d.ts.map +1 -0
  108. package/dist/themes/light.js +551 -0
  109. package/dist/themes/orange-dark.d.ts +4 -0
  110. package/dist/themes/orange-dark.d.ts.map +1 -0
  111. package/dist/themes/orange-dark.js +551 -0
  112. package/dist/themes/orange-light.d.ts +4 -0
  113. package/dist/themes/orange-light.d.ts.map +1 -0
  114. package/dist/themes/orange-light.js +551 -0
  115. package/package.json +62 -0
  116. package/src/components/controls/Button/Button.vue +417 -0
  117. package/src/components/controls/Button/README.md +348 -0
  118. package/src/components/controls/Button/theme.css +200 -0
  119. package/src/components/controls/Checkbox/Checkbox.vue +164 -0
  120. package/src/components/controls/Checkbox/README.md +441 -0
  121. package/src/components/controls/Checkbox/theme.css +36 -0
  122. package/src/components/controls/Dropdown/Dropdown.vue +476 -0
  123. package/src/components/controls/Dropdown/README.md +370 -0
  124. package/src/components/controls/Dropdown/theme.css +50 -0
  125. package/src/components/controls/Dropdown/types.ts +6 -0
  126. package/src/components/controls/IconButton/IconButton.vue +267 -0
  127. package/src/components/controls/IconButton/README.md +502 -0
  128. package/src/components/controls/IconButton/theme.css +89 -0
  129. package/src/components/controls/Radio/README.md +591 -0
  130. package/src/components/controls/Radio/Radio.vue +89 -0
  131. package/src/components/controls/Radio/theme.css +14 -0
  132. package/src/components/controls/RangeSlider/README.md +608 -0
  133. package/src/components/controls/RangeSlider/RangeSlider.vue +535 -0
  134. package/src/components/controls/RangeSlider/theme.css +80 -0
  135. package/src/components/controls/SegmentedControl/README.md +587 -0
  136. package/src/components/controls/SegmentedControl/SegmentedControl.vue +284 -0
  137. package/src/components/controls/SegmentedControl/theme.css +60 -0
  138. package/src/components/controls/SegmentedControl/types.ts +5 -0
  139. package/src/components/controls/Slider/README.md +627 -0
  140. package/src/components/controls/Slider/Slider.vue +260 -0
  141. package/src/components/controls/Slider/theme.css +74 -0
  142. package/src/components/controls/Stepper/README.md +601 -0
  143. package/src/components/controls/Stepper/Stepper.vue +103 -0
  144. package/src/components/controls/Stepper/theme.css +53 -0
  145. package/src/components/controls/Switch/README.md +667 -0
  146. package/src/components/controls/Switch/Switch.vue +127 -0
  147. package/src/components/controls/Switch/theme.css +42 -0
  148. package/src/components/dialogs/Alert/Alert.vue +218 -0
  149. package/src/components/dialogs/Alert/README.md +450 -0
  150. package/src/components/dialogs/Alert/theme.css +44 -0
  151. package/src/components/dialogs/Alert/types.ts +11 -0
  152. package/src/components/dialogs/Toast/README.md +522 -0
  153. package/src/components/dialogs/Toast/Toast.vue +296 -0
  154. package/src/components/dialogs/Toast/ToastContainer.vue +330 -0
  155. package/src/components/dialogs/Toast/theme.css +44 -0
  156. package/src/components/dialogs/Toast/types.ts +46 -0
  157. package/src/components/dialogs/Toast/useToast.ts +127 -0
  158. package/src/components/indicators/ProgressBar/ProgressBar.vue +98 -0
  159. package/src/components/indicators/ProgressBar/README.md +744 -0
  160. package/src/components/indicators/ProgressBar/theme.css +36 -0
  161. package/src/components/indicators/Tooltip/README.md +723 -0
  162. package/src/components/indicators/Tooltip/TooltipProvider.vue +142 -0
  163. package/src/components/indicators/Tooltip/theme.css +18 -0
  164. package/src/components/indicators/Tooltip/tooltip.ts +48 -0
  165. package/src/components/indicators/Tooltip/types.ts +15 -0
  166. package/src/components/indicators/Tooltip/useTooltip.ts +71 -0
  167. package/src/components/inputs/AutogrowTextView/AutogrowTextView.vue +110 -0
  168. package/src/components/inputs/AutogrowTextView/README.md +643 -0
  169. package/src/components/inputs/AutogrowTextView/theme.css +28 -0
  170. package/src/components/inputs/InputCard/InputCard.vue +600 -0
  171. package/src/components/inputs/InputCard/README.md +636 -0
  172. package/src/components/inputs/InputEmail/InputEmail.vue +698 -0
  173. package/src/components/inputs/InputEmail/README.md +764 -0
  174. package/src/components/inputs/InputNumber/InputNumber.vue +300 -0
  175. package/src/components/inputs/InputNumber/README.md +749 -0
  176. package/src/components/inputs/InputPhone/InputPhone.vue +645 -0
  177. package/src/components/inputs/InputPhone/README.md +636 -0
  178. package/src/components/inputs/InputSecure/InputSecure.vue +646 -0
  179. package/src/components/inputs/InputSecure/README.md +771 -0
  180. package/src/components/inputs/InputText/InputText.vue +225 -0
  181. package/src/components/inputs/InputText/README.md +844 -0
  182. package/src/components/inputs/OTP/OTP.vue +349 -0
  183. package/src/components/inputs/OTP/README.md +736 -0
  184. package/src/components/inputs/OTP/theme.css +50 -0
  185. package/src/components/inputs/StringCapture/README.md +718 -0
  186. package/src/components/inputs/StringCapture/StringCapture.vue +315 -0
  187. package/src/components/inputs/StringCapture/theme.css +86 -0
  188. package/src/components/inputs/Tags/README.md +897 -0
  189. package/src/components/inputs/Tags/TagBar.vue +793 -0
  190. package/src/components/inputs/Tags/TagCreation.vue +219 -0
  191. package/src/components/inputs/Tags/TagPicker.vue +380 -0
  192. package/src/components/inputs/Tags/tag-bar-styles.ts +354 -0
  193. package/src/components/inputs/Tags/theme.css +121 -0
  194. package/src/components/inputs/Tags/types.ts +346 -0
  195. package/src/components/inputs/search/README.md +759 -0
  196. package/src/components/inputs/search/SearchBar.vue +394 -0
  197. package/src/components/inputs/search/SearchResults.vue +310 -0
  198. package/src/components/inputs/search/theme.css +187 -0
  199. package/src/components/inputs/search/types.ts +8 -0
  200. package/src/components/inputs/theme.css +102 -0
  201. package/src/components/menus/ActionMenu/ActionMenu.vue +383 -0
  202. package/src/components/menus/ActionMenu/README.md +825 -0
  203. package/src/components/menus/ActionMenu/theme.css +93 -0
  204. package/src/components/models/Popover/Popover.vue +551 -0
  205. package/src/components/models/Popover/README.md +885 -0
  206. package/src/components/models/Popover/theme.css +52 -0
  207. package/src/components/models/Sheet/README.md +1159 -0
  208. package/src/components/models/Sheet/Sheet.vue +465 -0
  209. package/src/components/models/Sheet/theme.css +72 -0
  210. package/src/components/models/Sidebar/README.md +1228 -0
  211. package/src/components/models/Sidebar/Sidebar.vue +480 -0
  212. package/src/components/models/Sidebar/theme.css +90 -0
  213. package/src/components/navigation/adaptive/AdaptiveLayout.vue +779 -0
  214. package/src/components/navigation/adaptive/AdaptiveLayoutBreadcrumbs.vue +192 -0
  215. package/src/components/navigation/adaptive/AdaptiveLayoutMenuButton.vue +149 -0
  216. package/src/components/navigation/adaptive/README.md +768 -0
  217. package/src/components/navigation/adaptive/types.ts +19 -0
  218. package/src/components/navigation/adaptive/useAdaptiveLayout.ts +89 -0
  219. package/src/components/navigation/adaptive/useBreakpoints.ts +41 -0
  220. package/src/components/navigation/adaptive/useContainerMonitor.ts +214 -0
  221. package/src/components/navigation/adaptive/useViewAnimation.ts +721 -0
  222. package/src/components/navigation/adaptive/useViewResize.ts +211 -0
  223. package/src/components/navigation/navstack/NavigationStack.vue +180 -0
  224. package/src/components/navigation/navstack/README.md +994 -0
  225. package/src/components/navigation/navstack/useNavigationStack.ts +164 -0
  226. package/src/components/navigation/slideover/README.md +1275 -0
  227. package/src/components/navigation/slideover/SlideoverController.vue +287 -0
  228. package/src/components/navigation/slideover/useSlideoverController.ts +320 -0
  229. package/src/components/navigation/splitview/README.md +1115 -0
  230. package/src/components/navigation/splitview/SplitViewController.vue +176 -0
  231. package/src/components/navigation/splitview/useSplitViewController.ts +388 -0
  232. package/src/components/navigation/tabcontroller/README.md +919 -0
  233. package/src/components/navigation/tabcontroller/TabController.vue +307 -0
  234. package/src/components/navigation/tabcontroller/TabItem.vue +57 -0
  235. package/src/components/navigation/tabcontroller/types.ts +24 -0
  236. package/src/components/navigation/tabcontroller/useTabController.ts +18 -0
  237. package/src/components/navigation/theme.css +91 -0
  238. package/src/components/navigation/types.ts +7 -0
  239. package/src/components/pickers/CollectionPicker/CollectionPicker.vue +398 -0
  240. package/src/components/pickers/CollectionPicker/README.md +1115 -0
  241. package/src/components/pickers/CollectionPicker/theme.css +14 -0
  242. package/src/components/pickers/CollectionPicker/types.ts +11 -0
  243. package/src/components/pickers/ColorPicker/ColorPicker.vue +376 -0
  244. package/src/components/pickers/ColorPicker/README.md +1439 -0
  245. package/src/components/pickers/ColorPicker/colors.ts +299 -0
  246. package/src/components/pickers/ColorPicker/theme.css +32 -0
  247. package/src/components/pickers/DatePicker/DatePicker.vue +660 -0
  248. package/src/components/pickers/DatePicker/README.md +1195 -0
  249. package/src/components/pickers/DatePicker/theme.css +22 -0
  250. package/src/components/pickers/FilePicker/FilePicker.vue +534 -0
  251. package/src/components/pickers/FilePicker/README.md +1542 -0
  252. package/src/components/pickers/FilePicker/theme.css +48 -0
  253. package/src/components/pickers/FilePicker/types.ts +10 -0
  254. package/src/components/pickers/IconPicker/IconPicker.vue +327 -0
  255. package/src/components/pickers/IconPicker/README.md +1161 -0
  256. package/src/components/pickers/IconPicker/theme.css +28 -0
  257. package/src/components/pickers/theme.css +82 -0
  258. package/src/components/views/MarkdownViewer/MarkdownViewer.vue +442 -0
  259. package/src/components/views/MarkdownViewer/README.md +833 -0
  260. package/src/components/views/MarkdownViewer/theme.css +130 -0
  261. package/src/index.ts +263 -0
  262. package/src/theme.ts +378 -0
  263. package/src/themes/crimson-dark.ts +556 -0
  264. package/src/themes/cyan-light.ts +556 -0
  265. package/src/themes/dark.ts +557 -0
  266. package/src/themes/gold-dark.ts +556 -0
  267. package/src/themes/grass-dark.ts +556 -0
  268. package/src/themes/indigo.ts +556 -0
  269. package/src/themes/light.ts +557 -0
  270. package/src/themes/orange-dark.ts +557 -0
  271. package/src/themes/orange-light.ts +557 -0
  272. package/src/vue.d.ts +45 -0
@@ -0,0 +1,844 @@
1
+ # InputText
2
+
3
+ A versatile text input component built with Vue 3 Composition API and TypeScript. The InputText component provides a clean, accessible text input with multiple states, size variants, and visual feedback with smooth animations and proper theming support.
4
+
5
+ ## Installation/Import
6
+
7
+ ```typescript
8
+ import { InputText } from "@umbra-ui/core";
9
+ ```
10
+
11
+ **Dependencies:**
12
+
13
+ - Vue 3.x
14
+ - @umbra-ui/icons (for ripple animation and lock icons)
15
+
16
+ ## Basic Usage
17
+
18
+ ```vue
19
+ <script setup lang="ts">
20
+ import { ref } from "vue";
21
+ import { InputText } from "@umbra-ui/core";
22
+
23
+ const text = ref("");
24
+
25
+ const handleTextUpdate = (value: string) => {
26
+ console.log("Text:", value);
27
+ text.value = value;
28
+ };
29
+ </script>
30
+
31
+ <template>
32
+ <div>
33
+ <InputText
34
+ v-model:value="text"
35
+ placeholder="Enter your text"
36
+ state="normal"
37
+ size="normal"
38
+ />
39
+ </div>
40
+ </template>
41
+ ```
42
+
43
+ ## Props
44
+
45
+ | Prop Name | Type | Required | Default | Description |
46
+ | ------------- | ------------------------------------------------------------- | -------- | -------------- | ------------------------------------- |
47
+ | `value` | `string` | No | `""` | The text value |
48
+ | `placeholder` | `string` | No | `"Enter text"` | Placeholder text displayed when empty |
49
+ | `state` | `"normal" \| "active" \| "disabled" \| "readonly" \| "error"` | No | `"normal"` | Current state of the input field |
50
+ | `size` | `"compact" \| "normal"` | No | `"normal"` | Size variant of the input field |
51
+
52
+ ## Events
53
+
54
+ | Event Name | Payload Type | Description |
55
+ | -------------- | ------------ | ----------------------------------- |
56
+ | `update:value` | `string` | Emitted when the text value changes |
57
+
58
+ ## Slots
59
+
60
+ This component does not provide any slots.
61
+
62
+ ## Exposed Methods/Refs
63
+
64
+ This component does not expose any methods or refs.
65
+
66
+ ## CSS Customization
67
+
68
+ The InputText component uses CSS custom properties for theming and customization:
69
+
70
+ ### Input Container Variables
71
+
72
+ ```css
73
+ --input-border: 1px solid var(--input-border-color);
74
+ --input-border-radius: 0.588rem;
75
+ --input-focus-border: var(--input-focus-color);
76
+ --input-background-normal: var(--input-bg-normal);
77
+ --input-background-filled: var(--input-bg-filled);
78
+ --input-border-filled: var(--input-border-filled-color);
79
+ --input-text-empty: var(--input-text-empty-color);
80
+ --input-text-filled: var(--input-text-filled-color);
81
+ --input-placeholder: var(--input-placeholder-color);
82
+ --input-placeholder-filled: var(--input-placeholder-filled-color);
83
+ ```
84
+
85
+ ### State-Specific Variables
86
+
87
+ ```css
88
+ /* Disabled State */
89
+ --input-disabled-bg: var(--input-disabled-background);
90
+ --input-disabled-text: var(--input-disabled-text-color);
91
+ --input-disabled-border: var(--input-disabled-border-color);
92
+ --input-disabled-placeholder: var(--input-disabled-placeholder-color);
93
+
94
+ /* Readonly State */
95
+ --input-readonly-bg: var(--input-readonly-background);
96
+ --input-readonly-text: var(--input-readonly-text-color);
97
+ --input-readonly-border: var(--input-readonly-border-color);
98
+ --input-readonly-placeholder: var(--input-readonly-placeholder-color);
99
+
100
+ /* Error State */
101
+ --input-error-bg: var(--input-error-background);
102
+ --input-error-text: var(--input-error-text-color);
103
+ --input-error-border: var(--input-error-border-color);
104
+ ```
105
+
106
+ ## Key Features
107
+
108
+ ### Input States
109
+
110
+ - **Normal**: Standard input state with clean styling
111
+ - **Active**: Shows animated ripple icon for active state
112
+ - **Disabled**: Non-interactive state with muted appearance
113
+ - **Readonly**: Read-only state with lock icon
114
+ - **Error**: Error state with error message display
115
+
116
+ ### Size Variants
117
+
118
+ - **Normal**: Standard padding and spacing
119
+ - **Compact**: Reduced padding for space-constrained layouts
120
+
121
+ ### Visual Feedback
122
+
123
+ - **Dynamic Background**: Background color changes based on input state
124
+ - **Focus States**: Clear focus indication with border color changes
125
+ - **Icon Indicators**: Contextual icons for different states
126
+ - **Error Messages**: Built-in error message display
127
+
128
+ ### Accessibility
129
+
130
+ - **Keyboard Navigation**: Full keyboard support
131
+ - **Screen Reader Support**: Proper ARIA attributes
132
+ - **Focus Management**: Clear focus indicators
133
+ - **Responsive Design**: Mobile-friendly with proper font scaling
134
+
135
+ ## Examples
136
+
137
+ ### Basic Text Input
138
+
139
+ ```vue
140
+ <script setup lang="ts">
141
+ import { ref } from "vue";
142
+ import { InputText } from "@umbra-ui/core";
143
+
144
+ const text = ref("");
145
+ </script>
146
+
147
+ <template>
148
+ <div class="text-form">
149
+ <h3>Basic Text Input</h3>
150
+
151
+ <div class="form-group">
152
+ <label>Name</label>
153
+ <InputText
154
+ v-model:value="text"
155
+ placeholder="Enter your name"
156
+ state="normal"
157
+ size="normal"
158
+ />
159
+ </div>
160
+
161
+ <div class="text-display">
162
+ <p>Entered: {{ text }}</p>
163
+ </div>
164
+ </div>
165
+ </template>
166
+
167
+ <style module>
168
+ .text-form {
169
+ max-width: 400px;
170
+ padding: 1.5rem;
171
+ border: 1px solid #e0e0e0;
172
+ border-radius: 0.5rem;
173
+ }
174
+
175
+ .form-group {
176
+ margin-bottom: 1rem;
177
+ }
178
+
179
+ .form-group label {
180
+ display: block;
181
+ margin-bottom: 0.5rem;
182
+ font-weight: 500;
183
+ }
184
+
185
+ .text-display {
186
+ margin-top: 1rem;
187
+ padding: 1rem;
188
+ background-color: #f5f5f5;
189
+ border-radius: 0.25rem;
190
+ }
191
+ </style>
192
+ ```
193
+
194
+ ### Different States
195
+
196
+ ```vue
197
+ <script setup lang="ts">
198
+ import { ref } from "vue";
199
+ import { InputText } from "@umbra-ui/core";
200
+
201
+ const normalText = ref("");
202
+ const activeText = ref("Active state");
203
+ const disabledText = ref("Disabled text");
204
+ const readonlyText = ref("Readonly text");
205
+ const errorText = ref("Error text");
206
+ </script>
207
+
208
+ <template>
209
+ <div class="states-example">
210
+ <h3>Input States</h3>
211
+
212
+ <div class="state-group">
213
+ <label>Normal State</label>
214
+ <InputText
215
+ v-model:value="normalText"
216
+ placeholder="Enter text"
217
+ state="normal"
218
+ size="normal"
219
+ />
220
+ </div>
221
+
222
+ <div class="state-group">
223
+ <label>Active State</label>
224
+ <InputText v-model:value="activeText" state="active" size="normal" />
225
+ </div>
226
+
227
+ <div class="state-group">
228
+ <label>Disabled State</label>
229
+ <InputText v-model:value="disabledText" state="disabled" size="normal" />
230
+ </div>
231
+
232
+ <div class="state-group">
233
+ <label>Readonly State</label>
234
+ <InputText v-model:value="readonlyText" state="readonly" size="normal" />
235
+ </div>
236
+
237
+ <div class="state-group">
238
+ <label>Error State</label>
239
+ <InputText
240
+ v-model:value="errorText"
241
+ placeholder="Enter valid text"
242
+ state="error"
243
+ size="normal"
244
+ />
245
+ </div>
246
+ </div>
247
+ </template>
248
+
249
+ <style module>
250
+ .states-example {
251
+ max-width: 500px;
252
+ padding: 1.5rem;
253
+ border: 1px solid #e0e0e0;
254
+ border-radius: 0.5rem;
255
+ }
256
+
257
+ .state-group {
258
+ margin-bottom: 1.5rem;
259
+ }
260
+
261
+ .state-group label {
262
+ display: block;
263
+ margin-bottom: 0.5rem;
264
+ font-weight: 500;
265
+ color: #333;
266
+ }
267
+ </style>
268
+ ```
269
+
270
+ ### Size Variants
271
+
272
+ ```vue
273
+ <script setup lang="ts">
274
+ import { ref } from "vue";
275
+ import { InputText } from "@umbra-ui/core";
276
+
277
+ const normalSize = ref("");
278
+ const compactSize = ref("");
279
+ </script>
280
+
281
+ <template>
282
+ <div class="size-examples">
283
+ <h3>Size Variants</h3>
284
+
285
+ <div class="size-group">
286
+ <label>Normal Size</label>
287
+ <InputText
288
+ v-model:value="normalSize"
289
+ placeholder="Normal size input"
290
+ state="normal"
291
+ size="normal"
292
+ />
293
+ <p class="size-description">Standard padding and spacing</p>
294
+ </div>
295
+
296
+ <div class="size-group">
297
+ <label>Compact Size</label>
298
+ <InputText
299
+ v-model:value="compactSize"
300
+ placeholder="Compact size input"
301
+ state="normal"
302
+ size="compact"
303
+ />
304
+ <p class="size-description">
305
+ Reduced padding for space-constrained layouts
306
+ </p>
307
+ </div>
308
+ </div>
309
+ </template>
310
+
311
+ <style module>
312
+ .size-examples {
313
+ max-width: 500px;
314
+ padding: 1.5rem;
315
+ border: 1px solid #e0e0e0;
316
+ border-radius: 0.5rem;
317
+ }
318
+
319
+ .size-group {
320
+ margin-bottom: 2rem;
321
+ }
322
+
323
+ .size-group label {
324
+ display: block;
325
+ margin-bottom: 0.5rem;
326
+ font-weight: 500;
327
+ color: #333;
328
+ }
329
+
330
+ .size-description {
331
+ margin-top: 0.5rem;
332
+ font-size: 0.875rem;
333
+ color: #666;
334
+ font-style: italic;
335
+ }
336
+ </style>
337
+ ```
338
+
339
+ ### Contact Form Integration
340
+
341
+ ```vue
342
+ <script setup lang="ts">
343
+ import { ref, computed } from "vue";
344
+ import { InputText } from "@umbra-ui/core";
345
+
346
+ interface ContactForm {
347
+ firstName: string;
348
+ lastName: string;
349
+ email: string;
350
+ subject: string;
351
+ message: string;
352
+ }
353
+
354
+ const form = ref<ContactForm>({
355
+ firstName: "",
356
+ lastName: "",
357
+ email: "",
358
+ subject: "",
359
+ message: "",
360
+ });
361
+
362
+ const isFormValid = computed(() => {
363
+ return (
364
+ form.value.firstName &&
365
+ form.value.lastName &&
366
+ form.value.email &&
367
+ form.value.subject &&
368
+ form.value.message
369
+ );
370
+ });
371
+
372
+ const handleSubmit = () => {
373
+ if (isFormValid.value) {
374
+ console.log("Form submitted:", form.value);
375
+ // Handle form submission
376
+ }
377
+ };
378
+ </script>
379
+
380
+ <template>
381
+ <div class="contact-form">
382
+ <h3>Contact Us</h3>
383
+
384
+ <form @submit.prevent="handleSubmit">
385
+ <div class="form-row">
386
+ <div class="form-group">
387
+ <label>First Name *</label>
388
+ <InputText
389
+ v-model:value="form.firstName"
390
+ placeholder="Enter first name"
391
+ state="normal"
392
+ size="normal"
393
+ required
394
+ />
395
+ </div>
396
+
397
+ <div class="form-group">
398
+ <label>Last Name *</label>
399
+ <InputText
400
+ v-model:value="form.lastName"
401
+ placeholder="Enter last name"
402
+ state="normal"
403
+ size="normal"
404
+ required
405
+ />
406
+ </div>
407
+ </div>
408
+
409
+ <div class="form-group">
410
+ <label>Email *</label>
411
+ <InputText
412
+ v-model:value="form.email"
413
+ placeholder="your@email.com"
414
+ state="normal"
415
+ size="normal"
416
+ required
417
+ />
418
+ </div>
419
+
420
+ <div class="form-group">
421
+ <label>Subject *</label>
422
+ <InputText
423
+ v-model:value="form.subject"
424
+ placeholder="Enter subject"
425
+ state="normal"
426
+ size="normal"
427
+ required
428
+ />
429
+ </div>
430
+
431
+ <div class="form-group">
432
+ <label>Message *</label>
433
+ <textarea
434
+ v-model="form.message"
435
+ placeholder="Enter your message"
436
+ rows="4"
437
+ required
438
+ ></textarea>
439
+ </div>
440
+
441
+ <button type="submit" :disabled="!isFormValid" class="submit-button">
442
+ Send Message
443
+ </button>
444
+ </form>
445
+ </div>
446
+ </template>
447
+
448
+ <style module>
449
+ .contact-form {
450
+ max-width: 600px;
451
+ padding: 2rem;
452
+ border: 1px solid #e0e0e0;
453
+ border-radius: 0.5rem;
454
+ background-color: #fff;
455
+ }
456
+
457
+ .form-row {
458
+ display: grid;
459
+ grid-template-columns: 1fr 1fr;
460
+ gap: 1rem;
461
+ margin-bottom: 1.5rem;
462
+ }
463
+
464
+ .form-group {
465
+ margin-bottom: 1.5rem;
466
+ }
467
+
468
+ .form-group label {
469
+ display: block;
470
+ margin-bottom: 0.5rem;
471
+ font-weight: 500;
472
+ color: #333;
473
+ }
474
+
475
+ .form-group textarea {
476
+ width: 100%;
477
+ padding: 0.75rem;
478
+ border: 1px solid #ddd;
479
+ border-radius: 0.25rem;
480
+ font-size: 1rem;
481
+ font-family: inherit;
482
+ resize: vertical;
483
+ }
484
+
485
+ .form-group textarea:focus {
486
+ outline: none;
487
+ border-color: #007bff;
488
+ box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
489
+ }
490
+
491
+ .submit-button {
492
+ width: 100%;
493
+ padding: 0.75rem;
494
+ background-color: #007bff;
495
+ color: white;
496
+ border: none;
497
+ border-radius: 0.25rem;
498
+ font-size: 1rem;
499
+ cursor: pointer;
500
+ transition: background-color 0.2s;
501
+ }
502
+
503
+ .submit-button:hover:not(:disabled) {
504
+ background-color: #0056b3;
505
+ }
506
+
507
+ .submit-button:disabled {
508
+ background-color: #6c757d;
509
+ cursor: not-allowed;
510
+ }
511
+ </style>
512
+ ```
513
+
514
+ ### Search Interface
515
+
516
+ ```vue
517
+ <script setup lang="ts">
518
+ import { ref, computed } from "vue";
519
+ import { InputText } from "@umbra-ui/core";
520
+
521
+ const searchQuery = ref("");
522
+ const searchResults = ref<string[]>([]);
523
+
524
+ const isSearching = computed(() => {
525
+ return searchQuery.value.length > 0;
526
+ });
527
+
528
+ const handleSearch = () => {
529
+ if (searchQuery.value.trim()) {
530
+ // Simulate search results
531
+ searchResults.value = [
532
+ `Result 1 for "${searchQuery.value}"`,
533
+ `Result 2 for "${searchQuery.value}"`,
534
+ `Result 3 for "${searchQuery.value}"`,
535
+ ];
536
+ } else {
537
+ searchResults.value = [];
538
+ }
539
+ };
540
+
541
+ const clearSearch = () => {
542
+ searchQuery.value = "";
543
+ searchResults.value = [];
544
+ };
545
+ </script>
546
+
547
+ <template>
548
+ <div class="search-interface">
549
+ <h3>Search Interface</h3>
550
+
551
+ <div class="search-container">
552
+ <div class="search-input-group">
553
+ <InputText
554
+ v-model:value="searchQuery"
555
+ placeholder="Search for something..."
556
+ state="normal"
557
+ size="normal"
558
+ @update:value="handleSearch"
559
+ />
560
+ <button
561
+ v-if="isSearching"
562
+ @click="clearSearch"
563
+ class="clear-button"
564
+ title="Clear search"
565
+ >
566
+ ×
567
+ </button>
568
+ </div>
569
+
570
+ <div v-if="searchResults.length > 0" class="search-results">
571
+ <h4>Search Results</h4>
572
+ <ul>
573
+ <li v-for="(result, index) in searchResults" :key="index">
574
+ {{ result }}
575
+ </li>
576
+ </ul>
577
+ </div>
578
+
579
+ <div v-else-if="isSearching" class="no-results">
580
+ <p>No results found for "{{ searchQuery }}"</p>
581
+ </div>
582
+ </div>
583
+ </div>
584
+ </template>
585
+
586
+ <style module>
587
+ .search-interface {
588
+ max-width: 500px;
589
+ padding: 1.5rem;
590
+ border: 1px solid #e0e0e0;
591
+ border-radius: 0.5rem;
592
+ }
593
+
594
+ .search-container {
595
+ display: flex;
596
+ flex-direction: column;
597
+ gap: 1rem;
598
+ }
599
+
600
+ .search-input-group {
601
+ position: relative;
602
+ display: flex;
603
+ align-items: center;
604
+ }
605
+
606
+ .clear-button {
607
+ position: absolute;
608
+ right: 0.5rem;
609
+ width: 2rem;
610
+ height: 2rem;
611
+ border: none;
612
+ background: none;
613
+ cursor: pointer;
614
+ font-size: 1.5rem;
615
+ color: #666;
616
+ display: flex;
617
+ align-items: center;
618
+ justify-content: center;
619
+ border-radius: 50%;
620
+ transition: background-color 0.2s;
621
+ }
622
+
623
+ .clear-button:hover {
624
+ background-color: #f0f0f0;
625
+ }
626
+
627
+ .search-results {
628
+ padding: 1rem;
629
+ background-color: #f8f9fa;
630
+ border-radius: 0.25rem;
631
+ }
632
+
633
+ .search-results h4 {
634
+ margin: 0 0 0.5rem 0;
635
+ color: #333;
636
+ }
637
+
638
+ .search-results ul {
639
+ margin: 0;
640
+ padding-left: 1.5rem;
641
+ }
642
+
643
+ .search-results li {
644
+ margin-bottom: 0.25rem;
645
+ color: #666;
646
+ }
647
+
648
+ .no-results {
649
+ padding: 1rem;
650
+ text-align: center;
651
+ color: #666;
652
+ font-style: italic;
653
+ }
654
+ </style>
655
+ ```
656
+
657
+ ### Settings Panel
658
+
659
+ ```vue
660
+ <script setup lang="ts">
661
+ import { ref, computed } from "vue";
662
+ import { InputText } from "@umbra-ui/core";
663
+
664
+ interface Settings {
665
+ username: string;
666
+ displayName: string;
667
+ organization: string;
668
+ department: string;
669
+ }
670
+
671
+ const settings = ref<Settings>({
672
+ username: "john.doe",
673
+ displayName: "John Doe",
674
+ organization: "Acme Corp",
675
+ department: "Engineering",
676
+ });
677
+
678
+ const hasChanges = computed(() => {
679
+ // Check if any settings have been modified
680
+ return Object.values(settings.value).some((value) => value.trim() !== "");
681
+ });
682
+
683
+ const handleSave = () => {
684
+ console.log("Settings saved:", settings.value);
685
+ // Handle settings save
686
+ };
687
+
688
+ const handleReset = () => {
689
+ settings.value = {
690
+ username: "john.doe",
691
+ displayName: "John Doe",
692
+ organization: "Acme Corp",
693
+ department: "Engineering",
694
+ };
695
+ };
696
+ </script>
697
+
698
+ <template>
699
+ <div class="settings-panel">
700
+ <h3>User Settings</h3>
701
+
702
+ <form @submit.prevent="handleSave">
703
+ <div class="settings-grid">
704
+ <div class="setting-group">
705
+ <label>Username</label>
706
+ <InputText
707
+ v-model:value="settings.username"
708
+ placeholder="Enter username"
709
+ state="readonly"
710
+ size="normal"
711
+ />
712
+ <p class="setting-description">Username cannot be changed</p>
713
+ </div>
714
+
715
+ <div class="setting-group">
716
+ <label>Display Name</label>
717
+ <InputText
718
+ v-model:value="settings.displayName"
719
+ placeholder="Enter display name"
720
+ state="normal"
721
+ size="normal"
722
+ />
723
+ </div>
724
+
725
+ <div class="setting-group">
726
+ <label>Organization</label>
727
+ <InputText
728
+ v-model:value="settings.organization"
729
+ placeholder="Enter organization"
730
+ state="normal"
731
+ size="normal"
732
+ />
733
+ </div>
734
+
735
+ <div class="setting-group">
736
+ <label>Department</label>
737
+ <InputText
738
+ v-model:value="settings.department"
739
+ placeholder="Enter department"
740
+ state="normal"
741
+ size="normal"
742
+ />
743
+ </div>
744
+ </div>
745
+
746
+ <div class="settings-actions">
747
+ <button type="button" @click="handleReset" class="reset-button">
748
+ Reset
749
+ </button>
750
+ <button type="submit" :disabled="!hasChanges" class="save-button">
751
+ Save Changes
752
+ </button>
753
+ </div>
754
+ </form>
755
+ </div>
756
+ </template>
757
+
758
+ <style module>
759
+ .settings-panel {
760
+ max-width: 600px;
761
+ padding: 2rem;
762
+ border: 1px solid #e0e0e0;
763
+ border-radius: 0.5rem;
764
+ background-color: #fff;
765
+ }
766
+
767
+ .settings-grid {
768
+ display: grid;
769
+ grid-template-columns: 1fr 1fr;
770
+ gap: 1.5rem;
771
+ margin-bottom: 2rem;
772
+ }
773
+
774
+ .setting-group {
775
+ display: flex;
776
+ flex-direction: column;
777
+ }
778
+
779
+ .setting-group label {
780
+ margin-bottom: 0.5rem;
781
+ font-weight: 500;
782
+ color: #333;
783
+ }
784
+
785
+ .setting-description {
786
+ margin-top: 0.25rem;
787
+ font-size: 0.875rem;
788
+ color: #666;
789
+ font-style: italic;
790
+ }
791
+
792
+ .settings-actions {
793
+ display: flex;
794
+ gap: 1rem;
795
+ justify-content: flex-end;
796
+ }
797
+
798
+ .reset-button {
799
+ padding: 0.75rem 1.5rem;
800
+ background-color: #6c757d;
801
+ color: white;
802
+ border: none;
803
+ border-radius: 0.25rem;
804
+ cursor: pointer;
805
+ font-size: 1rem;
806
+ transition: background-color 0.2s;
807
+ }
808
+
809
+ .reset-button:hover {
810
+ background-color: #5a6268;
811
+ }
812
+
813
+ .save-button {
814
+ padding: 0.75rem 1.5rem;
815
+ background-color: #007bff;
816
+ color: white;
817
+ border: none;
818
+ border-radius: 0.25rem;
819
+ cursor: pointer;
820
+ font-size: 1rem;
821
+ transition: background-color 0.2s;
822
+ }
823
+
824
+ .save-button:hover:not(:disabled) {
825
+ background-color: #0056b3;
826
+ }
827
+
828
+ .save-button:disabled {
829
+ background-color: #6c757d;
830
+ cursor: not-allowed;
831
+ }
832
+ </style>
833
+ ```
834
+
835
+ ## Technical Notes
836
+
837
+ - InputText provides a clean, accessible text input with multiple states and size variants
838
+ - State management includes normal, active, disabled, readonly, and error states
839
+ - Size variants include normal and compact for different layout needs
840
+ - Visual feedback includes dynamic background colors, focus states, and contextual icons
841
+ - Error states display built-in error messages below the input
842
+ - Responsive design prevents zoom on mobile devices with proper font scaling
843
+ - Full keyboard navigation and screen reader support
844
+ - CSS custom properties enable easy theming and customization