@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,522 @@
1
+ # Toast
2
+
3
+ A comprehensive toast notification system built with Vue 3 Composition API and TypeScript. The Toast component provides a flexible interface for displaying temporary messages, notifications, and user feedback with smooth animations, multiple styles, and global state management.
4
+
5
+ ## Installation/Import
6
+
7
+ ```typescript
8
+ import { Toast, ToastContainer, useToast, ToastPlugin } from "@umbra-ui/core";
9
+ ```
10
+
11
+ **Dependencies:**
12
+
13
+ - Vue 3.x
14
+ - @umbra-ui/core (IconButton component)
15
+ - @umbra-ui/icons (for icons)
16
+ - GSAP (for animations)
17
+ - tinycolor2 (for color calculations)
18
+
19
+ ## Basic Usage
20
+
21
+ ### Setup (App Level)
22
+
23
+ ```vue
24
+ <script setup lang="ts">
25
+ import { createApp } from "vue";
26
+ import { ToastPlugin } from "@umbra-ui/core";
27
+ import App from "./App.vue";
28
+
29
+ const app = createApp(App);
30
+ app.use(ToastPlugin);
31
+ app.mount("#app");
32
+ </script>
33
+ ```
34
+
35
+ ### Using the Composable
36
+
37
+ ```vue
38
+ <script setup lang="ts">
39
+ import { useToast } from "@umbra-ui/core";
40
+
41
+ const { showSuccess, showError, showWarning, showInfo } = useToast();
42
+
43
+ const handleSuccess = () => {
44
+ showSuccess("Success!", "Your action was completed successfully.");
45
+ };
46
+
47
+ const handleError = () => {
48
+ showError("Error", "Something went wrong. Please try again.");
49
+ };
50
+
51
+ const handleWarning = () => {
52
+ showWarning("Warning", "Please review your input before proceeding.");
53
+ };
54
+
55
+ const handleInfo = () => {
56
+ showInfo("Information", "Here's some helpful information for you.");
57
+ };
58
+ </script>
59
+
60
+ <template>
61
+ <div>
62
+ <button @click="handleSuccess">Show Success</button>
63
+ <button @click="handleError">Show Error</button>
64
+ <button @click="handleWarning">Show Warning</button>
65
+ <button @click="handleInfo">Show Info</button>
66
+ </div>
67
+ </template>
68
+ ```
69
+
70
+ ### Include ToastContainer
71
+
72
+ ```vue
73
+ <template>
74
+ <div>
75
+ <!-- Your app content -->
76
+ <ToastContainer />
77
+ </div>
78
+ </template>
79
+ ```
80
+
81
+ ## Props
82
+
83
+ ### Toast Component
84
+
85
+ | Prop Name | Type | Required | Default | Description |
86
+ | ------------ | ----------------------------------- | -------- | ------- | --------------------------------------------------- |
87
+ | `toast` | `ToastInstance` | Yes | - | Toast instance data containing all toast properties |
88
+ | `toastStyle` | `"bar" \| "full" \| "notification"` | No | `"bar"` | Visual style variant of the toast |
89
+
90
+ ### ToastContainer Component
91
+
92
+ This component does not accept props. It automatically manages all toasts through the global toast manager.
93
+
94
+ ## Events
95
+
96
+ ### Toast Component
97
+
98
+ | Event Name | Payload Type | Description |
99
+ | ---------- | ------------ | --------------------------------------------------------- |
100
+ | `dismiss` | `string` | Emitted when the toast is dismissed, returns the toast ID |
101
+
102
+ ## Slots
103
+
104
+ These components do not use slots.
105
+
106
+ ## Exposed Methods/Refs
107
+
108
+ ### useToast Composable
109
+
110
+ The `useToast` composable provides the following methods:
111
+
112
+ | Method Name | Parameters | Return Type | Description |
113
+ | ----------------- | ------------------------------------------------------------------------ | ----------------- | ----------------------------------- |
114
+ | `addToast` | `(options: ToastOptions)` | `Promise<string>` | Adds a new toast and returns its ID |
115
+ | `removeToast` | `(id: string)` | `void` | Removes a toast by ID |
116
+ | `removeAllToasts` | `()` | `void` | Removes all active toasts |
117
+ | `setToastStyle` | `(style: "bar" \| "full" \| "notification")` | `void` | Sets the global toast style |
118
+ | `showSuccess` | `(title: string, description?: string, options?: Partial<ToastOptions>)` | `Promise<string>` | Shows a success toast |
119
+ | `showError` | `(title: string, description?: string, options?: Partial<ToastOptions>)` | `Promise<string>` | Shows an error toast |
120
+ | `showWarning` | `(title: string, description?: string, options?: Partial<ToastOptions>)` | `Promise<string>` | Shows a warning toast |
121
+ | `showInfo` | `(title: string, description?: string, options?: Partial<ToastOptions>)` | `Promise<string>` | Shows an info toast |
122
+
123
+ ## Types
124
+
125
+ ### ToastOptions
126
+
127
+ ```typescript
128
+ interface ToastOptions {
129
+ title: string;
130
+ description?: string;
131
+ iconName?: string;
132
+ position?: "Top" | "Bottom";
133
+ toastType?: "success" | "error" | "warning" | "info" | string;
134
+ duration?: number; // Auto dismiss duration in ms (0 = no auto dismiss)
135
+ dismissible?: boolean;
136
+ actions?: ToastAction[];
137
+ onDismiss?: () => void;
138
+ className?: string;
139
+ role?: "alert" | "status";
140
+ }
141
+ ```
142
+
143
+ ### ToastAction
144
+
145
+ ```typescript
146
+ interface ToastAction {
147
+ label: string;
148
+ action: () => void;
149
+ style?: "primary" | "secondary";
150
+ }
151
+ ```
152
+
153
+ ### ToastInstance
154
+
155
+ ```typescript
156
+ interface ToastInstance
157
+ extends Required<
158
+ Omit<ToastOptions, "actions" | "onDismiss" | "className" | "role">
159
+ > {
160
+ id: string;
161
+ show: boolean;
162
+ actions?: ToastAction[];
163
+ onDismiss?: () => void;
164
+ className?: string;
165
+ role?: "alert" | "status";
166
+ }
167
+ ```
168
+
169
+ ## CSS Customization
170
+
171
+ The Toast component uses CSS custom properties for easy theming and customization:
172
+
173
+ ```css
174
+ /* Toast type colors */
175
+ --toast-success-bg: #30a46c;
176
+ --toast-error-bg: #e5484d;
177
+ --toast-warning-bg: #ffe629;
178
+ --toast-info-bg: #5b5bd6;
179
+ --toast-custom-bg: #6b7280;
180
+
181
+ /* Toast shadow colors */
182
+ --toast-shadow: rgba(0, 0, 0, 0.08);
183
+ --toast-border: rgba(0, 0, 0, 0.08);
184
+
185
+ /* Toast description opacity */
186
+ --toast-description-opacity: 0.8;
187
+ ```
188
+
189
+ ## Examples
190
+
191
+ ### Basic Toast Types
192
+
193
+ ```vue
194
+ <script setup lang="ts">
195
+ import { useToast } from "@umbra-ui/core";
196
+
197
+ const { showSuccess, showError, showWarning, showInfo } = useToast();
198
+
199
+ const showToasts = () => {
200
+ showSuccess("Success!", "Operation completed successfully.");
201
+ showError("Error", "Something went wrong.");
202
+ showWarning("Warning", "Please check your input.");
203
+ showInfo("Info", "Here's some information.");
204
+ };
205
+ </script>
206
+
207
+ <template>
208
+ <div>
209
+ <button @click="showToasts">Show All Toast Types</button>
210
+ </div>
211
+ </template>
212
+ ```
213
+
214
+ ### Custom Toast with Actions
215
+
216
+ ```vue
217
+ <script setup lang="ts">
218
+ import { useToast } from "@umbra-ui/core";
219
+
220
+ const { addToast } = useToast();
221
+
222
+ const showCustomToast = () => {
223
+ addToast({
224
+ title: "File Uploaded",
225
+ description: "Your file has been uploaded successfully.",
226
+ toastType: "success",
227
+ duration: 0, // Persistent
228
+ actions: [
229
+ {
230
+ label: "View",
231
+ action: () => console.log("View file"),
232
+ style: "primary",
233
+ },
234
+ {
235
+ label: "Dismiss",
236
+ action: () => console.log("Dismissed"),
237
+ style: "secondary",
238
+ },
239
+ ],
240
+ });
241
+ };
242
+ </script>
243
+
244
+ <template>
245
+ <div>
246
+ <button @click="showCustomToast">Show Custom Toast</button>
247
+ </div>
248
+ </template>
249
+ ```
250
+
251
+ ### Different Toast Styles
252
+
253
+ ```vue
254
+ <script setup lang="ts">
255
+ import { useToast } from "@umbra-ui/core";
256
+
257
+ const { addToast, setToastStyle } = useToast();
258
+
259
+ const showBarToast = () => {
260
+ setToastStyle("bar");
261
+ addToast({
262
+ title: "Bar Style Toast",
263
+ description: "This is a bar-style toast notification.",
264
+ toastType: "info",
265
+ });
266
+ };
267
+
268
+ const showFullToast = () => {
269
+ setToastStyle("full");
270
+ addToast({
271
+ title: "Full Style Toast",
272
+ description: "This is a full-width toast notification.",
273
+ toastType: "success",
274
+ });
275
+ };
276
+
277
+ const showNotificationToast = () => {
278
+ setToastStyle("notification");
279
+ addToast({
280
+ title: "Notification Style Toast",
281
+ description: "This is a notification-style toast.",
282
+ toastType: "warning",
283
+ });
284
+ };
285
+ </script>
286
+
287
+ <template>
288
+ <div>
289
+ <button @click="showBarToast">Bar Style</button>
290
+ <button @click="showFullToast">Full Style</button>
291
+ <button @click="showNotificationToast">Notification Style</button>
292
+ </div>
293
+ </template>
294
+ ```
295
+
296
+ ### Custom Colors and Icons
297
+
298
+ ```vue
299
+ <script setup lang="ts">
300
+ import { useToast } from "@umbra-ui/core";
301
+
302
+ const { addToast } = useToast();
303
+
304
+ const showCustomColorToast = () => {
305
+ addToast({
306
+ title: "Custom Color Toast",
307
+ description: "This toast uses a custom color.",
308
+ toastType: "#8b5cf6", // Custom purple color
309
+ iconName: "star",
310
+ });
311
+ };
312
+
313
+ const showCustomIconToast = () => {
314
+ addToast({
315
+ title: "Custom Icon Toast",
316
+ description: "This toast uses a custom icon.",
317
+ toastType: "info",
318
+ iconName: "heart",
319
+ });
320
+ };
321
+ </script>
322
+
323
+ <template>
324
+ <div>
325
+ <button @click="showCustomColorToast">Custom Color</button>
326
+ <button @click="showCustomIconToast">Custom Icon</button>
327
+ </div>
328
+ </template>
329
+ ```
330
+
331
+ ### Form Validation Toasts
332
+
333
+ ```vue
334
+ <script setup lang="ts">
335
+ import { ref } from "vue";
336
+ import { useToast } from "@umbra-ui/core";
337
+
338
+ const { showSuccess, showError } = useToast();
339
+ const email = ref("");
340
+ const password = ref("");
341
+
342
+ const validateForm = () => {
343
+ const errors = [];
344
+
345
+ if (!email.value) {
346
+ errors.push("Email is required");
347
+ }
348
+
349
+ if (!password.value) {
350
+ errors.push("Password is required");
351
+ }
352
+
353
+ if (password.value.length < 8) {
354
+ errors.push("Password must be at least 8 characters");
355
+ }
356
+
357
+ if (errors.length > 0) {
358
+ errors.forEach((error) => {
359
+ showError("Validation Error", error);
360
+ });
361
+ } else {
362
+ showSuccess("Success", "Form submitted successfully!");
363
+ }
364
+ };
365
+ </script>
366
+
367
+ <template>
368
+ <form @submit.prevent="validateForm">
369
+ <input v-model="email" type="email" placeholder="Email" />
370
+ <input v-model="password" type="password" placeholder="Password" />
371
+ <button type="submit">Submit</button>
372
+ </form>
373
+ </template>
374
+ ```
375
+
376
+ ### API Response Toasts
377
+
378
+ ```vue
379
+ <script setup lang="ts">
380
+ import { useToast } from "@umbra-ui/core";
381
+
382
+ const { showSuccess, showError, showInfo } = useToast();
383
+
384
+ const simulateApiCall = async () => {
385
+ showInfo("Loading", "Sending request to server...");
386
+
387
+ try {
388
+ // Simulate API call
389
+ await new Promise((resolve) => setTimeout(resolve, 2000));
390
+
391
+ // Simulate success
392
+ showSuccess("Success", "Data saved successfully!");
393
+ } catch (error) {
394
+ showError("Error", "Failed to save data. Please try again.");
395
+ }
396
+ };
397
+ </script>
398
+
399
+ <template>
400
+ <div>
401
+ <button @click="simulateApiCall">Save Data</button>
402
+ </div>
403
+ </template>
404
+ ```
405
+
406
+ ### Persistent Toasts
407
+
408
+ ```vue
409
+ <script setup lang="ts">
410
+ import { useToast } from "@umbra-ui/core";
411
+
412
+ const { addToast } = useToast();
413
+
414
+ const showPersistentToast = () => {
415
+ addToast({
416
+ title: "Important Notice",
417
+ description: "This toast will not auto-dismiss. Click the X to close it.",
418
+ toastType: "warning",
419
+ duration: 0, // No auto-dismiss
420
+ dismissible: true,
421
+ });
422
+ };
423
+
424
+ const showNonDismissibleToast = () => {
425
+ addToast({
426
+ title: "Critical Alert",
427
+ description: "This toast cannot be dismissed manually.",
428
+ toastType: "error",
429
+ duration: 0,
430
+ dismissible: false,
431
+ });
432
+ };
433
+ </script>
434
+
435
+ <template>
436
+ <div>
437
+ <button @click="showPersistentToast">Persistent Toast</button>
438
+ <button @click="showNonDismissibleToast">Non-Dismissible Toast</button>
439
+ </div>
440
+ </template>
441
+ ```
442
+
443
+ ### Toast Management
444
+
445
+ ```vue
446
+ <script setup lang="ts">
447
+ import { useToast } from "@umbra-ui/core";
448
+
449
+ const { addToast, removeAllToasts, toasts } = useToast();
450
+
451
+ const addMultipleToasts = () => {
452
+ for (let i = 1; i <= 5; i++) {
453
+ addToast({
454
+ title: `Toast ${i}`,
455
+ description: `This is toast number ${i}`,
456
+ toastType: "info",
457
+ });
458
+ }
459
+ };
460
+
461
+ const clearAllToasts = () => {
462
+ removeAllToasts();
463
+ };
464
+ </script>
465
+
466
+ <template>
467
+ <div>
468
+ <button @click="addMultipleToasts">Add 5 Toasts</button>
469
+ <button @click="clearAllToasts">Clear All Toasts</button>
470
+ <p>Active toasts: {{ toasts.length }}</p>
471
+ </div>
472
+ </template>
473
+ ```
474
+
475
+ ### Different Positions
476
+
477
+ ```vue
478
+ <script setup lang="ts">
479
+ import { useToast } from "@umbra-ui/core";
480
+
481
+ const { addToast } = useToast();
482
+
483
+ const showTopToast = () => {
484
+ addToast({
485
+ title: "Top Position",
486
+ description: "This toast appears at the top.",
487
+ toastType: "info",
488
+ position: "Top",
489
+ });
490
+ };
491
+
492
+ const showBottomToast = () => {
493
+ addToast({
494
+ title: "Bottom Position",
495
+ description: "This toast appears at the bottom.",
496
+ toastType: "success",
497
+ position: "Bottom",
498
+ });
499
+ };
500
+ </script>
501
+
502
+ <template>
503
+ <div>
504
+ <button @click="showTopToast">Top Toast</button>
505
+ <button @click="showBottomToast">Bottom Toast</button>
506
+ </div>
507
+ </template>
508
+ ```
509
+
510
+ ## Notes
511
+
512
+ - The Toast system uses Vue's `Teleport` to render toasts outside the component tree for proper z-index layering
513
+ - Toasts include smooth GSAP animations for enter/exit transitions
514
+ - The system supports multiple toast styles: bar, full, and notification
515
+ - Toasts can be positioned at the top or bottom of the screen
516
+ - The component automatically handles text color contrast based on background color
517
+ - Toasts support custom colors, icons, and actions
518
+ - The system includes accessibility features with proper ARIA labels and roles
519
+ - Auto-dismiss functionality is built-in with configurable duration
520
+ - The toast manager is a singleton that can be used throughout the application
521
+ - Toasts are automatically stacked and animated when multiple are present
522
+ - The system supports both light and dark themes through CSS custom properties