@gspa/ui 0.1.3 → 0.2.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 (280) hide show
  1. package/README.md +35 -0
  2. package/dist/Button.vue_vue_type_script_setup_true_lang-B3TkBTvG.js +205 -0
  3. package/dist/Button.vue_vue_type_script_setup_true_lang-DZxttvYH.cjs +1 -0
  4. package/dist/DataTable.css +1 -0
  5. package/dist/DataTableToolBar.css +1 -0
  6. package/dist/FormField.vue_vue_type_script_setup_true_lang-DimMUyA-.js +205 -0
  7. package/dist/FormField.vue_vue_type_script_setup_true_lang-mEO-VA6R.cjs +1 -0
  8. package/dist/Header.css +1 -0
  9. package/dist/Input.vue_vue_type_script_setup_true_lang-C1OQn24h.cjs +1 -0
  10. package/dist/Input.vue_vue_type_script_setup_true_lang-CpBoY97r.js +137 -0
  11. package/dist/Loader.css +1 -0
  12. package/dist/ReminderConfig.css +1 -0
  13. package/dist/ReusableForm.css +1 -0
  14. package/dist/Sidebar.css +1 -0
  15. package/dist/Toast.css +1 -0
  16. package/dist/_plugin-vue_export-helper-BHFhmbuH.cjs +1 -0
  17. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  18. package/dist/components/Accordion.cjs +1 -0
  19. package/dist/components/Accordion.js +192 -0
  20. package/dist/components/AccordionItem.cjs +1 -0
  21. package/dist/components/AccordionItem.js +109 -0
  22. package/dist/components/AddReminderModal.cjs +1 -0
  23. package/dist/components/AddReminderModal.js +107 -0
  24. package/dist/components/Alert.cjs +1 -0
  25. package/dist/components/Alert.js +227 -0
  26. package/dist/components/Avatar.cjs +1 -0
  27. package/dist/components/Avatar.js +86 -0
  28. package/dist/components/Badge.cjs +1 -0
  29. package/dist/components/Badge.js +109 -0
  30. package/dist/components/Breadcrumb.cjs +1 -0
  31. package/dist/components/Breadcrumb.js +72 -0
  32. package/dist/components/Button.cjs +1 -0
  33. package/dist/components/Button.js +4 -0
  34. package/dist/components/ButtonGroup.cjs +1 -0
  35. package/dist/components/ButtonGroup.js +46 -0
  36. package/dist/components/Calendar.cjs +1 -0
  37. package/dist/components/Calendar.js +341 -0
  38. package/dist/components/Card.cjs +1 -0
  39. package/dist/components/Card.js +316 -0
  40. package/dist/components/CardBody.cjs +1 -0
  41. package/dist/components/CardBody.js +34 -0
  42. package/dist/components/CardContent.cjs +1 -0
  43. package/dist/components/CardContent.js +17 -0
  44. package/dist/components/CardFooter.cjs +1 -0
  45. package/dist/components/CardFooter.js +34 -0
  46. package/dist/components/CardHeader.cjs +1 -0
  47. package/dist/components/CardHeader.js +91 -0
  48. package/dist/components/CardTitle.cjs +1 -0
  49. package/dist/components/CardTitle.js +17 -0
  50. package/dist/components/Checkbox.cjs +1 -0
  51. package/dist/components/Checkbox.js +185 -0
  52. package/dist/components/CircularProgress.cjs +1 -0
  53. package/dist/components/CircularProgress.js +141 -0
  54. package/dist/components/DataTable.cjs +1 -0
  55. package/dist/components/DataTable.js +863 -0
  56. package/dist/components/DataTableCell.cjs +1 -0
  57. package/dist/components/DataTableCell.js +95 -0
  58. package/dist/components/DataTableFilters.cjs +1 -0
  59. package/dist/components/DataTableFilters.js +519 -0
  60. package/dist/components/DataTableHeader.cjs +1 -0
  61. package/dist/components/DataTableHeader.js +116 -0
  62. package/dist/components/DataTablePagination.cjs +1 -0
  63. package/dist/components/DataTablePagination.js +290 -0
  64. package/dist/components/DataTableRow.cjs +1 -0
  65. package/dist/components/DataTableRow.js +199 -0
  66. package/dist/components/DataTableToolBar.cjs +1 -0
  67. package/dist/components/DataTableToolBar.js +477 -0
  68. package/dist/components/DatePicker.cjs +1 -0
  69. package/dist/components/DatePicker.js +401 -0
  70. package/dist/components/Divider.cjs +1 -0
  71. package/dist/components/Divider.js +103 -0
  72. package/dist/components/Dropdown.cjs +1 -0
  73. package/dist/components/Dropdown.js +104 -0
  74. package/dist/components/DropdownItem.cjs +1 -0
  75. package/dist/components/DropdownItem.js +60 -0
  76. package/dist/components/EventsCalendar.cjs +1 -0
  77. package/dist/components/EventsCalendar.js +863 -0
  78. package/dist/components/FileUpload.cjs +1 -0
  79. package/dist/components/FileUpload.js +195 -0
  80. package/dist/components/FilterDrawer.cjs +1 -0
  81. package/dist/components/FilterDrawer.js +412 -0
  82. package/dist/components/Footer.cjs +1 -0
  83. package/dist/components/Footer.js +157 -0
  84. package/dist/components/FormField.cjs +1 -0
  85. package/dist/components/FormField.js +4 -0
  86. package/dist/components/Graph.cjs +1 -0
  87. package/dist/components/Graph.js +164 -0
  88. package/dist/components/GraphFilters.cjs +1 -0
  89. package/dist/components/GraphFilters.js +305 -0
  90. package/dist/components/Header.cjs +1 -0
  91. package/dist/components/Header.js +674 -0
  92. package/dist/components/Icon.cjs +1 -0
  93. package/dist/components/Icon.js +58 -0
  94. package/dist/components/Image.cjs +1 -0
  95. package/dist/components/Image.js +112 -0
  96. package/dist/components/Input.cjs +1 -0
  97. package/dist/components/Input.js +4 -0
  98. package/dist/components/InputGroup.cjs +1 -0
  99. package/dist/components/InputGroup.js +45 -0
  100. package/dist/components/Label.cjs +1 -0
  101. package/dist/components/Label.js +46 -0
  102. package/dist/components/Link.cjs +1 -0
  103. package/dist/components/Link.js +119 -0
  104. package/dist/components/ListItem.cjs +1 -0
  105. package/dist/components/ListItem.js +89 -0
  106. package/dist/components/Loader.cjs +1 -0
  107. package/dist/components/Loader.js +154 -0
  108. package/dist/components/Logo.cjs +1 -0
  109. package/dist/components/Logo.js +67 -0
  110. package/dist/components/MenuItem.cjs +1 -0
  111. package/dist/components/MenuItem.js +66 -0
  112. package/dist/components/Modal.cjs +1 -0
  113. package/dist/components/Modal.js +110 -0
  114. package/dist/components/ModalBody.cjs +1 -0
  115. package/dist/components/ModalBody.js +33 -0
  116. package/dist/components/ModalFooter.cjs +1 -0
  117. package/dist/components/ModalFooter.js +33 -0
  118. package/dist/components/ModalHeader.cjs +1 -0
  119. package/dist/components/ModalHeader.js +24 -0
  120. package/dist/components/MultiSelect.cjs +1 -0
  121. package/dist/components/MultiSelect.js +211 -0
  122. package/dist/components/Notification.cjs +1 -0
  123. package/dist/components/Notification.js +121 -0
  124. package/dist/components/Option.cjs +1 -0
  125. package/dist/components/Option.js +44 -0
  126. package/dist/components/Progress.cjs +1 -0
  127. package/dist/components/Progress.js +77 -0
  128. package/dist/components/ProgressBar.cjs +1 -0
  129. package/dist/components/ProgressBar.js +101 -0
  130. package/dist/components/Radio.cjs +1 -0
  131. package/dist/components/Radio.js +81 -0
  132. package/dist/components/RailNav.cjs +1 -0
  133. package/dist/components/RailNav.js +124 -0
  134. package/dist/components/ReminderConfig.cjs +1 -0
  135. package/dist/components/ReminderConfig.js +375 -0
  136. package/dist/components/ReusableForm.cjs +1 -0
  137. package/dist/components/ReusableForm.js +686 -0
  138. package/dist/components/ReusableFormModal.cjs +1 -0
  139. package/dist/components/ReusableFormModal.js +112 -0
  140. package/dist/components/RightDrawer.cjs +1 -0
  141. package/dist/components/RightDrawer.js +143 -0
  142. package/dist/components/Search.cjs +1 -0
  143. package/dist/components/Search.js +252 -0
  144. package/dist/components/Select.cjs +1 -0
  145. package/dist/components/Select.js +243 -0
  146. package/dist/components/Sidebar.cjs +1 -0
  147. package/dist/components/Sidebar.js +372 -0
  148. package/dist/components/Slider.cjs +1 -0
  149. package/dist/components/Slider.js +42 -0
  150. package/dist/components/Spinner.cjs +1 -0
  151. package/dist/components/Spinner.js +87 -0
  152. package/dist/components/Stepper.cjs +1 -0
  153. package/dist/components/Stepper.js +12 -0
  154. package/dist/components/StepperItem.cjs +1 -0
  155. package/dist/components/StepperItem.js +33 -0
  156. package/dist/components/Switch.cjs +1 -0
  157. package/dist/components/Switch.js +112 -0
  158. package/dist/components/Tab.cjs +1 -0
  159. package/dist/components/Tab.js +134 -0
  160. package/dist/components/TabPanel.cjs +1 -0
  161. package/dist/components/TabPanel.js +49 -0
  162. package/dist/components/Text.cjs +1 -0
  163. package/dist/components/Text.js +84 -0
  164. package/dist/components/Textarea.cjs +1 -0
  165. package/dist/components/Textarea.js +102 -0
  166. package/dist/components/ThemeConfigurator.cjs +1 -0
  167. package/dist/components/ThemeConfigurator.js +73 -0
  168. package/dist/components/Timeline.cjs +1 -0
  169. package/dist/components/Timeline.js +24 -0
  170. package/dist/components/TimelineItem.cjs +1 -0
  171. package/dist/components/TimelineItem.js +63 -0
  172. package/dist/components/Toast.cjs +1 -0
  173. package/dist/components/Toast.js +231 -0
  174. package/dist/components/Tooltip.cjs +1 -0
  175. package/dist/components/Tooltip.js +124 -0
  176. package/dist/components/Typography.cjs +1 -0
  177. package/dist/components/Typography.js +267 -0
  178. package/dist/components/charts/BarChart.cjs +1 -0
  179. package/dist/components/charts/BarChart.js +323 -0
  180. package/dist/components/charts/LineChart.cjs +1 -0
  181. package/dist/components/charts/LineChart.js +322 -0
  182. package/dist/components/charts/PieChart.cjs +1 -0
  183. package/dist/components/charts/PieChart.js +311 -0
  184. package/dist/components/charts/StackedBarChart.cjs +1 -0
  185. package/dist/components/charts/StackedBarChart.js +348 -0
  186. package/dist/components/widgets/DashboardWidget.cjs +1 -0
  187. package/dist/components/widgets/DashboardWidget.js +309 -0
  188. package/dist/directives/tooltip.cjs +47 -0
  189. package/dist/directives/tooltip.js +115 -0
  190. package/dist/gspa-ui.css +1 -1
  191. package/dist/index.cjs +1 -0
  192. package/dist/index.esm.js +315 -19546
  193. package/dist/layouts/AuthLayout.cjs +1 -0
  194. package/dist/layouts/AuthLayout.js +188 -0
  195. package/dist/layouts/DashboardLayout.cjs +1 -0
  196. package/dist/layouts/DashboardLayout.js +244 -0
  197. package/dist/layouts/DefaultLayout.cjs +1 -0
  198. package/dist/layouts/DefaultLayout.js +94 -0
  199. package/dist/layouts/ErrorLayout.cjs +1 -0
  200. package/dist/layouts/ErrorLayout.js +452 -0
  201. package/dist/lib/auth.cjs +1 -0
  202. package/dist/lib/auth.js +4 -0
  203. package/dist/lib/form-field.cjs +1 -0
  204. package/dist/lib/form-field.js +4 -0
  205. package/dist/lib/icon.cjs +1 -0
  206. package/dist/lib/icon.js +4 -0
  207. package/dist/lib/theme.cjs +1 -0
  208. package/dist/lib/theme.js +145 -0
  209. package/dist/lib/toast.cjs +1 -0
  210. package/dist/lib/toast.js +81 -0
  211. package/dist/src/components/Alert.vue.d.ts.map +1 -1
  212. package/dist/src/components/Button.vue.d.ts +127 -29
  213. package/dist/src/components/Button.vue.d.ts.map +1 -1
  214. package/dist/src/components/Checkbox.vue.d.ts +2 -2
  215. package/dist/src/components/DataTable.vue.d.ts +1 -1
  216. package/dist/src/components/FormField.vue.d.ts +106 -38
  217. package/dist/src/components/FormField.vue.d.ts.map +1 -1
  218. package/dist/src/components/Icon.vue.d.ts.map +1 -1
  219. package/dist/src/components/Input.vue.d.ts +137 -33
  220. package/dist/src/components/Input.vue.d.ts.map +1 -1
  221. package/dist/src/components/ReusableForm.vue.d.ts +1 -1
  222. package/dist/src/components/ReusableForm.vue.d.ts.map +1 -1
  223. package/dist/src/components/ReusableFormModal.vue.d.ts +1 -1
  224. package/dist/src/components/Textarea.vue.d.ts +2 -2
  225. package/dist/src/index.d.ts +9 -4
  226. package/dist/src/index.d.ts.map +1 -1
  227. package/dist/src/layouts/AuthLayout.vue.d.ts +2 -0
  228. package/dist/src/layouts/AuthLayout.vue.d.ts.map +1 -1
  229. package/dist/src/lib/form-field.d.ts +2 -0
  230. package/dist/src/lib/form-field.d.ts.map +1 -0
  231. package/dist/src/lib/icon.d.ts +2 -0
  232. package/dist/src/lib/icon.d.ts.map +1 -0
  233. package/dist/src/lib/theme.d.ts +4 -0
  234. package/dist/src/lib/theme.d.ts.map +1 -1
  235. package/dist/src/types.d.ts +44 -0
  236. package/dist/src/types.d.ts.map +1 -0
  237. package/dist/styles/auth-layout.css +1 -0
  238. package/dist/styles/button.css +1 -0
  239. package/dist/styles/form-field.css +1 -0
  240. package/dist/styles/input.css +1 -0
  241. package/dist/styles/tokens.css +1 -0
  242. package/dist/tsconfig.tsbuildinfo +1 -1
  243. package/dist/utils/cn.cjs +1 -0
  244. package/dist/utils/cn.js +7 -0
  245. package/package.json +45 -8
  246. package/dist/index.js +0 -605
  247. package/dist/src/__tests__/Alert.spec.d.ts +0 -2
  248. package/dist/src/__tests__/Alert.spec.d.ts.map +0 -1
  249. package/dist/src/__tests__/App.spec.d.ts +0 -2
  250. package/dist/src/__tests__/App.spec.d.ts.map +0 -1
  251. package/dist/src/__tests__/AuthLayout.spec.d.ts +0 -2
  252. package/dist/src/__tests__/AuthLayout.spec.d.ts.map +0 -1
  253. package/dist/src/__tests__/Badge.spec.d.ts +0 -2
  254. package/dist/src/__tests__/Badge.spec.d.ts.map +0 -1
  255. package/dist/src/__tests__/Button.spec.d.ts +0 -2
  256. package/dist/src/__tests__/Button.spec.d.ts.map +0 -1
  257. package/dist/src/__tests__/Card.spec.d.ts +0 -2
  258. package/dist/src/__tests__/Card.spec.d.ts.map +0 -1
  259. package/dist/src/__tests__/Checkbox.spec.d.ts +0 -2
  260. package/dist/src/__tests__/Checkbox.spec.d.ts.map +0 -1
  261. package/dist/src/__tests__/Dropdown.spec.d.ts +0 -2
  262. package/dist/src/__tests__/Dropdown.spec.d.ts.map +0 -1
  263. package/dist/src/__tests__/Input.spec.d.ts +0 -2
  264. package/dist/src/__tests__/Input.spec.d.ts.map +0 -1
  265. package/dist/src/__tests__/Modal.spec.d.ts +0 -2
  266. package/dist/src/__tests__/Modal.spec.d.ts.map +0 -1
  267. package/dist/src/__tests__/Radio.spec.d.ts +0 -2
  268. package/dist/src/__tests__/Radio.spec.d.ts.map +0 -1
  269. package/dist/src/__tests__/ReusableForm.spec.d.ts +0 -2
  270. package/dist/src/__tests__/ReusableForm.spec.d.ts.map +0 -1
  271. package/dist/src/__tests__/Tabs.spec.d.ts +0 -2
  272. package/dist/src/__tests__/Tabs.spec.d.ts.map +0 -1
  273. package/dist/src/__tests__/integration/CardIntegration.spec.d.ts +0 -2
  274. package/dist/src/__tests__/integration/CardIntegration.spec.d.ts.map +0 -1
  275. package/dist/src/__tests__/integration/FormIntegration.spec.d.ts +0 -2
  276. package/dist/src/__tests__/integration/FormIntegration.spec.d.ts.map +0 -1
  277. package/dist/src/__tests__/integration/ModalIntegration.spec.d.ts +0 -2
  278. package/dist/src/__tests__/integration/ModalIntegration.spec.d.ts.map +0 -1
  279. package/dist/src/__tests__/integration/NavigationIntegration.spec.d.ts +0 -2
  280. package/dist/src/__tests__/integration/NavigationIntegration.spec.d.ts.map +0 -1
@@ -0,0 +1,102 @@
1
+ import { ref as x, computed as o, useId as h, watch as z, nextTick as u, createElementBlock as w, openBlock as B, normalizeClass as k } from "vue";
2
+ import { cva as R } from "class-variance-authority";
3
+ import { cn as S } from "../utils/cn.js";
4
+ const V = ["id", "value", "placeholder", "disabled", "readonly", "required", "rows", "maxlength", "aria-describedby", "aria-invalid"], E = {
5
+ __name: "Textarea",
6
+ props: {
7
+ modelValue: { type: String, default: "" },
8
+ placeholder: { type: String, default: "" },
9
+ disabled: { type: Boolean, default: !1 },
10
+ readonly: { type: Boolean, default: !1 },
11
+ required: { type: Boolean, default: !1 },
12
+ rows: { type: Number, default: 3 },
13
+ maxlength: { type: Number, default: null },
14
+ resize: {
15
+ type: String,
16
+ default: "vertical",
17
+ validator: (e) => ["none", "vertical", "horizontal", "both"].includes(e)
18
+ },
19
+ autoResize: { type: Boolean, default: !1 },
20
+ size: {
21
+ type: String,
22
+ default: "md",
23
+ validator: (e) => ["sm", "md", "lg"].includes(e)
24
+ },
25
+ variant: {
26
+ type: String,
27
+ default: "default",
28
+ validator: (e) => ["default", "error", "success"].includes(e)
29
+ },
30
+ error: { type: String, default: null },
31
+ id: { type: String, default: null }
32
+ },
33
+ emits: ["update:modelValue", "blur", "focus", "keydown"],
34
+ setup(e, { expose: n, emit: d }) {
35
+ const t = e, l = d, r = x(null), s = o(() => t.id || h()), c = (a) => {
36
+ l("update:modelValue", a.target.value), t.autoResize && u(() => i());
37
+ }, f = (a) => l("blur", a), m = (a) => l("focus", a), y = (a) => l("keydown", a), b = o(() => !!t.error || t.variant === "error"), v = o(
38
+ () => t.error ? `${s.value}-error` : void 0
39
+ ), p = R(
40
+ "block w-full rounded-lg border ui-surface transition-colors duration-200 placeholder:text-(--ui-text-muted) focus:outline-none focus:ring-2 focus:ring-offset-0 disabled:bg-(--ui-surface) disabled:text-(--ui-text) disabled:cursor-not-allowed",
41
+ {
42
+ variants: {
43
+ size: {
44
+ sm: "px-3 py-1.5 text-sm",
45
+ md: "px-3 py-2 text-sm",
46
+ lg: "px-4 py-3 text-base"
47
+ },
48
+ variant: {
49
+ default: "ui-border-strong focus:border-(--ui-primary) focus:ring-(--ui-primary)",
50
+ error: "border-(--ui-danger-soft) focus:border-(--ui-danger) focus:ring-(--ui-danger)",
51
+ success: "border-(--ui-success-soft) focus:border-(--ui-success) focus:ring-(--ui-success)"
52
+ },
53
+ resize: {
54
+ none: "resize-none",
55
+ vertical: "resize-y",
56
+ horizontal: "resize-x",
57
+ both: "resize"
58
+ }
59
+ },
60
+ defaultVariants: {
61
+ size: "md",
62
+ variant: "default",
63
+ resize: "vertical"
64
+ }
65
+ }
66
+ ), g = o(
67
+ () => S(p({ size: t.size, variant: t.variant, resize: t.resize }))
68
+ ), i = () => {
69
+ if (!r.value || !t.autoResize) return;
70
+ const a = r.value;
71
+ a.style.height = "auto", a.style.height = `${a.scrollHeight}px`;
72
+ };
73
+ return z(() => t.modelValue, () => {
74
+ t.autoResize && u(() => i());
75
+ }, { immediate: !0 }), n({
76
+ focus: () => r.value?.focus(),
77
+ blur: () => r.value?.blur(),
78
+ select: () => r.value?.select()
79
+ }), (a, q) => (B(), w("textarea", {
80
+ id: s.value,
81
+ ref_key: "textareaRef",
82
+ ref: r,
83
+ value: e.modelValue,
84
+ placeholder: e.placeholder,
85
+ disabled: e.disabled,
86
+ readonly: e.readonly,
87
+ required: e.required,
88
+ rows: e.rows,
89
+ maxlength: e.maxlength,
90
+ class: k(g.value),
91
+ "aria-describedby": v.value,
92
+ "aria-invalid": b.value,
93
+ onInput: c,
94
+ onBlur: f,
95
+ onFocus: m,
96
+ onKeydown: y
97
+ }, null, 42, V));
98
+ }
99
+ };
100
+ export {
101
+ E as default
102
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("../lib/theme.cjs"),u=require("./Option.cjs"),d=require("./Select.cjs"),i={class:"ui-surface-strong fixed bottom-5 rounded-2xl right-5 z-50"},m={key:0,class:"mt-3 ui-surface w-72 rounded-xl border ui-border-strong p-4 shadow-xl"},f={class:"mt-3 space-y-3"},p={class:"block text-xs font-medium ui-text"},x={class:"block text-xs font-medium ui-text"},v={__name:"ThemeConfigurator",setup(k){const c=["light","dark"],n=e.ref(!1),a=e.ref(l.getMode()||"light"),s=e.ref(l.getTheme()?.preset||"academy");return e.watch(a,r=>{l.setMode(r)}),e.watch(s,r=>{l.setTheme({preset:r})}),(r,t)=>(e.openBlock(),e.createElementBlock("div",i,[e.createElementVNode("button",{class:"rounded-full ui-text-inverse px-4 py-2 text-sm font-semibold shadow-sm hover:brightness-105",onClick:t[0]||(t[0]=o=>n.value=!n.value)}," Appearance "),n.value?(e.openBlock(),e.createElementBlock("div",m,[t[5]||(t[5]=e.createElementVNode("div",{class:"text-sm font-semibold ui-text"}," Appearance ",-1)),e.createElementVNode("div",f,[e.createElementVNode("label",p,[t[3]||(t[3]=e.createTextVNode(" Mode ",-1)),e.createVNode(d.default,{modelValue:a.value,"onUpdate:modelValue":t[1]||(t[1]=o=>a.value=o),class:"mt-1 w-full"},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(c,o=>e.createVNode(u.default,{key:o,value:o},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o),1)]),_:2},1032,["value"])),64))]),_:1},8,["modelValue"])]),e.createElementVNode("label",x,[t[4]||(t[4]=e.createTextVNode(" Theme ",-1)),e.createVNode(d.default,{modelValue:s.value,"onUpdate:modelValue":t[2]||(t[2]=o=>s.value=o),class:"mt-1 w-full"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l.THEME_PRESETS),o=>(e.openBlock(),e.createBlock(u.default,{key:o.key,value:o.key},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.name),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])])])])):e.createCommentVNode("",!0)]))}};exports.default=v;
@@ -0,0 +1,73 @@
1
+ import { ref as i, watch as c, createElementBlock as r, openBlock as o, createElementVNode as l, createCommentVNode as g, createTextVNode as a, createVNode as f, withCtx as u, Fragment as p, renderList as x, toDisplayString as v, unref as V, createBlock as y } from "vue";
2
+ import { getMode as h, getTheme as w, setMode as T, setTheme as E, THEME_PRESETS as M } from "../lib/theme.js";
3
+ import _ from "./Option.js";
4
+ import k from "./Select.js";
5
+ const C = { class: "ui-surface-strong fixed bottom-5 rounded-2xl right-5 z-50" }, N = {
6
+ key: 0,
7
+ class: "mt-3 ui-surface w-72 rounded-xl border ui-border-strong p-4 shadow-xl"
8
+ }, B = { class: "mt-3 space-y-3" }, S = { class: "block text-xs font-medium ui-text" }, $ = { class: "block text-xs font-medium ui-text" }, F = {
9
+ __name: "ThemeConfigurator",
10
+ setup(A) {
11
+ const b = ["light", "dark"], n = i(!1), d = i(h() || "light"), m = i(w()?.preset || "academy");
12
+ return c(d, (s) => {
13
+ T(s);
14
+ }), c(m, (s) => {
15
+ E({ preset: s });
16
+ }), (s, e) => (o(), r("div", C, [
17
+ l("button", {
18
+ class: "rounded-full ui-text-inverse px-4 py-2 text-sm font-semibold shadow-sm hover:brightness-105",
19
+ onClick: e[0] || (e[0] = (t) => n.value = !n.value)
20
+ }, " Appearance "),
21
+ n.value ? (o(), r("div", N, [
22
+ e[5] || (e[5] = l("div", { class: "text-sm font-semibold ui-text" }, " Appearance ", -1)),
23
+ l("div", B, [
24
+ l("label", S, [
25
+ e[3] || (e[3] = a(" Mode ", -1)),
26
+ f(k, {
27
+ modelValue: d.value,
28
+ "onUpdate:modelValue": e[1] || (e[1] = (t) => d.value = t),
29
+ class: "mt-1 w-full"
30
+ }, {
31
+ default: u(() => [
32
+ (o(), r(p, null, x(b, (t) => f(_, {
33
+ key: t,
34
+ value: t
35
+ }, {
36
+ default: u(() => [
37
+ a(v(t), 1)
38
+ ]),
39
+ _: 2
40
+ }, 1032, ["value"])), 64))
41
+ ]),
42
+ _: 1
43
+ }, 8, ["modelValue"])
44
+ ]),
45
+ l("label", $, [
46
+ e[4] || (e[4] = a(" Theme ", -1)),
47
+ f(k, {
48
+ modelValue: m.value,
49
+ "onUpdate:modelValue": e[2] || (e[2] = (t) => m.value = t),
50
+ class: "mt-1 w-full"
51
+ }, {
52
+ default: u(() => [
53
+ (o(!0), r(p, null, x(V(M), (t) => (o(), y(_, {
54
+ key: t.key,
55
+ value: t.key
56
+ }, {
57
+ default: u(() => [
58
+ a(v(t.name), 1)
59
+ ]),
60
+ _: 2
61
+ }, 1032, ["value"]))), 128))
62
+ ]),
63
+ _: 1
64
+ }, 8, ["modelValue"])
65
+ ])
66
+ ])
67
+ ])) : g("", !0)
68
+ ]));
69
+ }
70
+ };
71
+ export {
72
+ F as default
73
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r={__name:"Timeline",props:{orientation:{type:String,default:"vertical",validator:t=>["vertical","horizontal"].includes(t)}},setup(t){return(l,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative flex ui-text",t.orientation==="vertical"?"flex-col":"flex-row"])},[e.renderSlot(l.$slots,"default")],2))}};exports.default=r;
@@ -0,0 +1,24 @@
1
+ import { createElementBlock as l, openBlock as r, normalizeClass as a, renderSlot as o } from "vue";
2
+ const c = {
3
+ __name: "Timeline",
4
+ props: {
5
+ orientation: {
6
+ type: String,
7
+ default: "vertical",
8
+ validator: (e) => ["vertical", "horizontal"].includes(e)
9
+ }
10
+ },
11
+ setup(e) {
12
+ return (t, i) => (r(), l("div", {
13
+ class: a([
14
+ "relative flex ui-text",
15
+ e.orientation === "vertical" ? "flex-col" : "flex-row"
16
+ ])
17
+ }, [
18
+ o(t.$slots, "default")
19
+ ], 2));
20
+ }
21
+ };
22
+ export {
23
+ c as default
24
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r={key:0,class:"absolute left-3 top-0 w-0.5 h-full ui-bg"},o={class:"z-10 flex items-center justify-center w-6 h-6 rounded-full border-2 border-(--ui-primary) ui-surface ui-primary"},s={class:"ui-text font-medium"},n={key:0,class:"ui-text text-sm"},a={class:"mt-2 ui-text text-sm"},c={__name:"TimelineItem",props:{title:{type:String,required:!0},subtitle:{type:String,default:""},orientation:{type:String,default:"vertical",validator:t=>["vertical","horizontal"].includes(t)}},setup(t){return(l,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative flex",t.orientation==="vertical"?"items-start mb-8 last:mb-0":"flex-col items-center mx-8 last:mx-0"])},[t.orientation==="vertical"?(e.openBlock(),e.createElementBlock("div",r)):e.createCommentVNode("",!0),e.createElementVNode("div",o,[e.renderSlot(l.$slots,"icon",{},()=>[i[0]||(i[0]=e.createElementVNode("div",{class:"w-2 h-2 rounded-full ui-primary-bg"},null,-1))])]),e.createElementVNode("div",{class:e.normalizeClass(["ml-6",t.orientation==="horizontal"?"mt-2 text-center":""])},[e.createElementVNode("h3",s,[e.renderSlot(l.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])]),t.subtitle?(e.openBlock(),e.createElementBlock("p",n,[e.renderSlot(l.$slots,"subtitle",{},()=>[e.createTextVNode(e.toDisplayString(t.subtitle),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",a,[e.renderSlot(l.$slots,"default")])],2)],2))}};exports.default=c;
@@ -0,0 +1,63 @@
1
+ import { createElementBlock as s, openBlock as r, normalizeClass as a, createCommentVNode as n, createElementVNode as e, renderSlot as l, createTextVNode as u, toDisplayString as d } from "vue";
2
+ const c = {
3
+ key: 0,
4
+ class: "absolute left-3 top-0 w-0.5 h-full ui-bg"
5
+ }, m = { class: "z-10 flex items-center justify-center w-6 h-6 rounded-full border-2 border-(--ui-primary) ui-surface ui-primary" }, f = { class: "ui-text font-medium" }, v = {
6
+ key: 0,
7
+ class: "ui-text text-sm"
8
+ }, b = { class: "mt-2 ui-text text-sm" }, x = {
9
+ __name: "TimelineItem",
10
+ props: {
11
+ title: {
12
+ type: String,
13
+ required: !0
14
+ },
15
+ subtitle: {
16
+ type: String,
17
+ default: ""
18
+ },
19
+ orientation: {
20
+ type: String,
21
+ default: "vertical",
22
+ validator: (t) => ["vertical", "horizontal"].includes(t)
23
+ }
24
+ },
25
+ setup(t) {
26
+ return (i, o) => (r(), s("div", {
27
+ class: a([
28
+ "relative flex",
29
+ t.orientation === "vertical" ? "items-start mb-8 last:mb-0" : "flex-col items-center mx-8 last:mx-0"
30
+ ])
31
+ }, [
32
+ t.orientation === "vertical" ? (r(), s("div", c)) : n("", !0),
33
+ e("div", m, [
34
+ l(i.$slots, "icon", {}, () => [
35
+ o[0] || (o[0] = e("div", { class: "w-2 h-2 rounded-full ui-primary-bg" }, null, -1))
36
+ ])
37
+ ]),
38
+ e("div", {
39
+ class: a([
40
+ "ml-6",
41
+ t.orientation === "horizontal" ? "mt-2 text-center" : ""
42
+ ])
43
+ }, [
44
+ e("h3", f, [
45
+ l(i.$slots, "title", {}, () => [
46
+ u(d(t.title), 1)
47
+ ])
48
+ ]),
49
+ t.subtitle ? (r(), s("p", v, [
50
+ l(i.$slots, "subtitle", {}, () => [
51
+ u(d(t.subtitle), 1)
52
+ ])
53
+ ])) : n("", !0),
54
+ e("div", b, [
55
+ l(i.$slots, "default")
56
+ ])
57
+ ], 2)
58
+ ], 2));
59
+ }
60
+ };
61
+ export {
62
+ x as default
63
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),S=require("class-variance-authority"),o=require("../utils/cn.cjs"),q=require("../lib/toast.cjs"),s=require("./Icon.cjs"),I=require("../_plugin-vue_export-helper-BHFhmbuH.cjs"),P=["aria-live"],j={class:"flex-1 min-w-0 pt-0.5"},A=["onClick"],$=["onClick"],K={key:2,class:"absolute bottom-0 left-0 right-0 h-0.5 overflow-hidden"},L={__name:"Toast",props:{position:{type:String,default:"top-right",validator:i=>["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"].includes(i)},hotkey:{type:Array,default:()=>["altKey","KeyT"]},richColors:{type:Boolean,default:!0},expand:{type:Boolean,default:!1},visibleToasts:{type:Number,default:3},closeButton:{type:Boolean,default:!0}},setup(i){const n=i,{toasts:p,dismiss:v}=q.useToaster(),x=e.computed(()=>p.value.slice(0,n.visibleToasts)),w={"top-left":"top-0 left-0 flex-col items-start","top-center":"top-0 left-1/2 -translate-x-1/2 flex-col items-center","top-right":"top-0 right-0 flex-col items-end","bottom-left":"bottom-0 left-0 flex-col-reverse items-start","bottom-center":"bottom-0 left-1/2 -translate-x-1/2 flex-col-reverse items-center","bottom-right":"bottom-0 right-0 flex-col-reverse items-end"},b=e.computed(()=>o.cn(w[n.position])),k=S.cva("group pointer-events-auto relative flex w-full items-start gap-3 overflow-hidden rounded-xl border p-4 transition-all duration-200 hover:-translate-y-0.5",{variants:{variant:{default:"ui-surface ui-border-strong ui-text shadow-lg shadow-black/5 dark:shadow-black/30",info:"border-blue-700 bg-blue-700 ui-text-inverse shadow-lg shadow-blue-900/25",success:"border-green-700 bg-green-700 ui-text-inverse shadow-lg shadow-green-900/25",warning:"border-amber-600 bg-amber-600 ui-text-inverse shadow-lg shadow-amber-900/25",error:"border-red-700 bg-red-700 ui-text-inverse shadow-lg shadow-red-900/25",loading:"ui-surface ui-border-strong ui-text shadow-lg shadow-black/5 dark:shadow-black/30"}},defaultVariants:{variant:"default"}}),y=r=>o.cn(k({variant:r.variant})),l={default:"bell",info:"info",success:"check-circle",warning:"triangle-exclamation",error:"circle-xmark",loading:"loader-circle"},c={default:"ui-primary",info:"text-white",success:"text-white",warning:"text-white",error:"text-white",loading:"ui-primary"},u={default:"ui-surface-muted border ui-border",info:"bg-white/15 ring-1 ring-white/25",success:"bg-white/15 ring-1 ring-white/25",warning:"bg-white/15 ring-1 ring-white/25",error:"bg-white/15 ring-1 ring-white/25",loading:"ui-surface-muted border ui-border"},d={default:"bg-(--ui-primary)",info:"bg-white/70",success:"bg-white/70",warning:"bg-white/70",error:"bg-white/70",loading:"bg-(--ui-primary)"},h={default:"ui-primary hover:text-(--ui-primary-strong) underline-offset-4 hover:underline",info:"text-white/90 hover:text-white underline-offset-4 hover:underline",success:"text-white/90 hover:text-white underline-offset-4 hover:underline",warning:"text-white/90 hover:text-white underline-offset-4 hover:underline",error:"text-white/90 hover:text-white underline-offset-4 hover:underline",loading:"ui-primary hover:text-(--ui-primary-strong) underline-offset-4 hover:underline"},m={default:"ui-text",info:"text-white",success:"text-white",warning:"text-white",error:"text-white",loading:"ui-text"},f={default:"ui-text-muted",info:"text-white/90",success:"text-white/90",warning:"text-white/90",error:"text-white/90",loading:"ui-text-muted"},g={default:"ui-text-soft hover:bg-black/5 dark:hover:bg-white/10 hover:text-(--ui-text)",info:"text-white/80 hover:text-white hover:bg-white/15",success:"text-white/80 hover:text-white hover:bg-white/15",warning:"text-white/80 hover:text-white hover:bg-white/15",error:"text-white/80 hover:text-white hover:bg-white/15",loading:"ui-text hover:bg-black/5 dark:hover:bg-white/5 hover:text-(--ui-text)"},C=r=>r.icon||l[r.variant]||l.default,B=r=>{const a=c[r.variant]||c.default;return r.variant==="loading"?`${a} animate-spin`:a},_=r=>u[r.variant]||u.default,V=r=>d[r.variant]||d.default,N=r=>h[r.variant]||h.default,T=r=>m[r.variant]||m.default,z=r=>f[r.variant]||f.default,E=r=>g[r.variant]||g.default,M=r=>r.icon!==!1,D=r=>r.dismissible!==!1&&(r.closeButton||n.closeButton||r.dismissible);return(r,a)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(o.cn)(b.value,"fixed z-[10000] flex max-h-screen w-full p-4 md:max-w-[420px] pointer-events-none"))},[e.createVNode(e.TransitionGroup,{"enter-active-class":"transition-all duration-400 ease-[cubic-bezier(0.16,1,0.3,1)]","enter-from-class":"transform translate-x-full opacity-0 scale-90","enter-to-class":"transform translate-x-0 opacity-100 scale-100","leave-active-class":"transition-all duration-300 ease-[cubic-bezier(0.4,0,1,1)]","leave-from-class":"transform translate-x-0 opacity-100 scale-100","leave-to-class":"transform translate-x-full opacity-0 scale-90","move-class":"transition-all duration-300 ease-out",tag:"div",class:"w-full space-y-3"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,t=>(e.openBlock(),e.createElementBlock("div",{key:t.id,class:e.normalizeClass(y(t)),role:"alert","aria-live":t.variant==="error"?"assertive":"polite"},[M(t)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(o.cn)("relative flex h-10 w-10 shrink-0 items-center justify-center rounded-lg transition-all duration-300",_(t)))},[e.createVNode(s.default,{icon:C(t),class:e.normalizeClass(e.unref(o.cn)("h-5 w-5 transition-transform duration-300 group-hover:scale-110",B(t)))},null,8,["icon","class"])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",j,[t.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(o.cn)("text-md font-semibold leading-tight mb-1",T(t)))},e.toDisplayString(t.title),3)):e.createCommentVNode("",!0),t.message||t.description?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(o.cn)("text-md leading-relaxed",z(t)))},e.toDisplayString(t.message||t.description),3)):e.createCommentVNode("",!0),t.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.component),e.mergeProps({key:2,ref_for:!0},t.componentProps,{class:"mt-3"}),null,16)):e.createCommentVNode("",!0),t.action?(e.openBlock(),e.createElementBlock("button",{key:3,class:e.normalizeClass(["mt-3 inline-flex items-center gap-1.5 text-sm font-medium transition-colors",N(t)]),onClick:t.action.onClick},[e.createTextVNode(e.toDisplayString(t.action.label)+" ",1),e.createVNode(s.default,{icon:"arrow-right",class:"h-3 w-3 transition-transform duration-200 group-hover:translate-x-0.5"})],10,A)):e.createCommentVNode("",!0)]),D(t)?(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(e.unref(o.cn)("absolute right-2 top-2 flex h-7 w-7 shrink-0 items-center justify-center rounded-md opacity-70 transition-all hover:opacity-100 focus:opacity-100 focus:outline-none focus:ring-2 focus:ring-(--ui-ring)",E(t))),"aria-label":"Dismiss",onClick:G=>e.unref(v)(t.id)},[e.createVNode(s.default,{icon:"x",class:"h-4 w-4"})],10,$)):e.createCommentVNode("",!0),t.duration&&t.duration>0?(e.openBlock(),e.createElementBlock("div",K,[e.createElementVNode("div",{class:e.normalizeClass(e.unref(o.cn)("h-full origin-left animate-toast-progress",V(t))),style:e.normalizeStyle({animationDuration:`${t.duration}ms`})},null,6)])):e.createCommentVNode("",!0)],10,P))),128))]),_:1})],2)]))}},F=I._export_sfc(L,[["__scopeId","data-v-8acde4d1"]]);exports.default=F;
@@ -0,0 +1,231 @@
1
+ import { computed as _, createBlock as C, openBlock as r, Teleport as G, createElementVNode as h, normalizeClass as i, unref as n, createVNode as l, TransitionGroup as q, withCtx as H, createElementBlock as s, Fragment as J, renderList as O, createCommentVNode as a, toDisplayString as f, resolveDynamicComponent as Q, mergeProps as R, createTextVNode as U, normalizeStyle as W } from "vue";
2
+ import { cva as X } from "class-variance-authority";
3
+ import { cn as o } from "../utils/cn.js";
4
+ import { useToaster as Y } from "../lib/toast.js";
5
+ import g from "./Icon.js";
6
+ import { _ as Z } from "../_plugin-vue_export-helper-CHgC5LLL.js";
7
+ const ee = ["aria-live"], te = { class: "flex-1 min-w-0 pt-0.5" }, re = ["onClick"], ie = ["onClick"], oe = {
8
+ key: 2,
9
+ class: "absolute bottom-0 left-0 right-0 h-0.5 overflow-hidden"
10
+ }, ne = {
11
+ __name: "Toast",
12
+ props: {
13
+ position: {
14
+ type: String,
15
+ default: "top-right",
16
+ validator: (c) => [
17
+ "top-left",
18
+ "top-center",
19
+ "top-right",
20
+ "bottom-left",
21
+ "bottom-center",
22
+ "bottom-right"
23
+ ].includes(c)
24
+ },
25
+ hotkey: {
26
+ type: Array,
27
+ default: () => ["altKey", "KeyT"]
28
+ },
29
+ richColors: {
30
+ type: Boolean,
31
+ default: !0
32
+ },
33
+ expand: {
34
+ type: Boolean,
35
+ default: !1
36
+ },
37
+ visibleToasts: {
38
+ type: Number,
39
+ default: 3
40
+ },
41
+ closeButton: {
42
+ type: Boolean,
43
+ default: !0
44
+ }
45
+ },
46
+ setup(c) {
47
+ const u = c, { toasts: B, dismiss: T } = Y(), M = _(
48
+ () => B.value.slice(0, u.visibleToasts)
49
+ ), N = {
50
+ "top-left": "top-0 left-0 flex-col items-start",
51
+ "top-center": "top-0 left-1/2 -translate-x-1/2 flex-col items-center",
52
+ "top-right": "top-0 right-0 flex-col items-end",
53
+ "bottom-left": "bottom-0 left-0 flex-col-reverse items-start",
54
+ "bottom-center": "bottom-0 left-1/2 -translate-x-1/2 flex-col-reverse items-center",
55
+ "bottom-right": "bottom-0 right-0 flex-col-reverse items-end"
56
+ }, V = _(
57
+ () => o(N[u.position])
58
+ ), z = X(
59
+ "group pointer-events-auto relative flex w-full items-start gap-3 overflow-hidden rounded-xl border p-4 transition-all duration-200 hover:-translate-y-0.5",
60
+ {
61
+ variants: {
62
+ variant: {
63
+ default: "ui-surface ui-border-strong ui-text shadow-lg shadow-black/5 dark:shadow-black/30",
64
+ info: "border-blue-700 bg-blue-700 ui-text-inverse shadow-lg shadow-blue-900/25",
65
+ success: "border-green-700 bg-green-700 ui-text-inverse shadow-lg shadow-green-900/25",
66
+ warning: "border-amber-600 bg-amber-600 ui-text-inverse shadow-lg shadow-amber-900/25",
67
+ error: "border-red-700 bg-red-700 ui-text-inverse shadow-lg shadow-red-900/25",
68
+ loading: "ui-surface ui-border-strong ui-text shadow-lg shadow-black/5 dark:shadow-black/30"
69
+ }
70
+ },
71
+ defaultVariants: { variant: "default" }
72
+ }
73
+ ), D = (t) => o(z({ variant: t.variant })), m = {
74
+ default: "bell",
75
+ info: "info",
76
+ success: "check-circle",
77
+ warning: "triangle-exclamation",
78
+ error: "circle-xmark",
79
+ loading: "loader-circle"
80
+ }, p = {
81
+ default: "ui-primary",
82
+ info: "text-white",
83
+ success: "text-white",
84
+ warning: "text-white",
85
+ error: "text-white",
86
+ loading: "ui-primary"
87
+ }, v = {
88
+ default: "ui-surface-muted border ui-border",
89
+ info: "bg-white/15 ring-1 ring-white/25",
90
+ success: "bg-white/15 ring-1 ring-white/25",
91
+ warning: "bg-white/15 ring-1 ring-white/25",
92
+ error: "bg-white/15 ring-1 ring-white/25",
93
+ loading: "ui-surface-muted border ui-border"
94
+ }, x = {
95
+ default: "bg-(--ui-primary)",
96
+ info: "bg-white/70",
97
+ success: "bg-white/70",
98
+ warning: "bg-white/70",
99
+ error: "bg-white/70",
100
+ loading: "bg-(--ui-primary)"
101
+ }, w = {
102
+ default: "ui-primary hover:text-(--ui-primary-strong) underline-offset-4 hover:underline",
103
+ info: "text-white/90 hover:text-white underline-offset-4 hover:underline",
104
+ success: "text-white/90 hover:text-white underline-offset-4 hover:underline",
105
+ warning: "text-white/90 hover:text-white underline-offset-4 hover:underline",
106
+ error: "text-white/90 hover:text-white underline-offset-4 hover:underline",
107
+ loading: "ui-primary hover:text-(--ui-primary-strong) underline-offset-4 hover:underline"
108
+ }, b = {
109
+ default: "ui-text",
110
+ info: "text-white",
111
+ success: "text-white",
112
+ warning: "text-white",
113
+ error: "text-white",
114
+ loading: "ui-text"
115
+ }, y = {
116
+ default: "ui-text-muted",
117
+ info: "text-white/90",
118
+ success: "text-white/90",
119
+ warning: "text-white/90",
120
+ error: "text-white/90",
121
+ loading: "ui-text-muted"
122
+ }, k = {
123
+ default: "ui-text-soft hover:bg-black/5 dark:hover:bg-white/10 hover:text-(--ui-text)",
124
+ info: "text-white/80 hover:text-white hover:bg-white/15",
125
+ success: "text-white/80 hover:text-white hover:bg-white/15",
126
+ warning: "text-white/80 hover:text-white hover:bg-white/15",
127
+ error: "text-white/80 hover:text-white hover:bg-white/15",
128
+ loading: "ui-text hover:bg-black/5 dark:hover:bg-white/5 hover:text-(--ui-text)"
129
+ }, I = (t) => t.icon || m[t.variant] || m.default, $ = (t) => {
130
+ const d = p[t.variant] || p.default;
131
+ return t.variant === "loading" ? `${d} animate-spin` : d;
132
+ }, P = (t) => v[t.variant] || v.default, S = (t) => x[t.variant] || x.default, j = (t) => w[t.variant] || w.default, A = (t) => b[t.variant] || b.default, E = (t) => y[t.variant] || y.default, K = (t) => k[t.variant] || k.default, L = (t) => t.icon !== !1, F = (t) => t.dismissible !== !1 && (t.closeButton || u.closeButton || t.dismissible);
133
+ return (t, d) => (r(), C(G, { to: "body" }, [
134
+ h("div", {
135
+ class: i(n(o)(
136
+ V.value,
137
+ "fixed z-[10000] flex max-h-screen w-full p-4 md:max-w-[420px] pointer-events-none"
138
+ ))
139
+ }, [
140
+ l(q, {
141
+ "enter-active-class": "transition-all duration-400 ease-[cubic-bezier(0.16,1,0.3,1)]",
142
+ "enter-from-class": "transform translate-x-full opacity-0 scale-90",
143
+ "enter-to-class": "transform translate-x-0 opacity-100 scale-100",
144
+ "leave-active-class": "transition-all duration-300 ease-[cubic-bezier(0.4,0,1,1)]",
145
+ "leave-from-class": "transform translate-x-0 opacity-100 scale-100",
146
+ "leave-to-class": "transform translate-x-full opacity-0 scale-90",
147
+ "move-class": "transition-all duration-300 ease-out",
148
+ tag: "div",
149
+ class: "w-full space-y-3"
150
+ }, {
151
+ default: H(() => [
152
+ (r(!0), s(J, null, O(M.value, (e) => (r(), s("div", {
153
+ key: e.id,
154
+ class: i(D(e)),
155
+ role: "alert",
156
+ "aria-live": e.variant === "error" ? "assertive" : "polite"
157
+ }, [
158
+ L(e) ? (r(), s("div", {
159
+ key: 0,
160
+ class: i(n(o)(
161
+ "relative flex h-10 w-10 shrink-0 items-center justify-center rounded-lg transition-all duration-300",
162
+ P(e)
163
+ ))
164
+ }, [
165
+ l(g, {
166
+ icon: I(e),
167
+ class: i(n(o)(
168
+ "h-5 w-5 transition-transform duration-300 group-hover:scale-110",
169
+ $(e)
170
+ ))
171
+ }, null, 8, ["icon", "class"])
172
+ ], 2)) : a("", !0),
173
+ h("div", te, [
174
+ e.title ? (r(), s("div", {
175
+ key: 0,
176
+ class: i(n(o)("text-md font-semibold leading-tight mb-1", A(e)))
177
+ }, f(e.title), 3)) : a("", !0),
178
+ e.message || e.description ? (r(), s("div", {
179
+ key: 1,
180
+ class: i(n(o)("text-md leading-relaxed", E(e)))
181
+ }, f(e.message || e.description), 3)) : a("", !0),
182
+ e.component ? (r(), C(Q(e.component), R({
183
+ key: 2,
184
+ ref_for: !0
185
+ }, e.componentProps, { class: "mt-3" }), null, 16)) : a("", !0),
186
+ e.action ? (r(), s("button", {
187
+ key: 3,
188
+ class: i(["mt-3 inline-flex items-center gap-1.5 text-sm font-medium transition-colors", j(e)]),
189
+ onClick: e.action.onClick
190
+ }, [
191
+ U(f(e.action.label) + " ", 1),
192
+ l(g, {
193
+ icon: "arrow-right",
194
+ class: "h-3 w-3 transition-transform duration-200 group-hover:translate-x-0.5"
195
+ })
196
+ ], 10, re)) : a("", !0)
197
+ ]),
198
+ F(e) ? (r(), s("button", {
199
+ key: 1,
200
+ class: i(n(o)(
201
+ "absolute right-2 top-2 flex h-7 w-7 shrink-0 items-center justify-center rounded-md opacity-70 transition-all hover:opacity-100 focus:opacity-100 focus:outline-none focus:ring-2 focus:ring-(--ui-ring)",
202
+ K(e)
203
+ )),
204
+ "aria-label": "Dismiss",
205
+ onClick: (se) => n(T)(e.id)
206
+ }, [
207
+ l(g, {
208
+ icon: "x",
209
+ class: "h-4 w-4"
210
+ })
211
+ ], 10, ie)) : a("", !0),
212
+ e.duration && e.duration > 0 ? (r(), s("div", oe, [
213
+ h("div", {
214
+ class: i(n(o)(
215
+ "h-full origin-left animate-toast-progress",
216
+ S(e)
217
+ )),
218
+ style: W({ animationDuration: `${e.duration}ms` })
219
+ }, null, 6)
220
+ ])) : a("", !0)
221
+ ], 10, ee))), 128))
222
+ ]),
223
+ _: 1
224
+ })
225
+ ], 2)
226
+ ]));
227
+ }
228
+ }, fe = /* @__PURE__ */ Z(ne, [["__scopeId", "data-v-8acde4d1"]]);
229
+ export {
230
+ fe as default
231
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),m=require("class-variance-authority"),x=require("../utils/cn.cjs"),S={__name:"Tooltip",props:{content:{type:String,required:!0},placement:{type:String,default:"top",validator:s=>["top","bottom","left","right"].includes(s)},delay:{type:Number,default:0},class:String},setup(s){const n=s,u=t.ref(!1),p=t.ref(null),f=t.ref(null),d=t.ref({});let r=null;const h=m.cva("fixed z-[9999] px-3 py-1.5 text-sm ui-text ui-surface rounded-md shadow-lg pointer-events-none whitespace-nowrap",{variants:{placement:{top:"",bottom:"",left:"",right:""}}}),g=m.cva("absolute w-2 h-2 bg-primary transform rotate-45",{variants:{placement:{top:"top-full left-1/2 transform -translate-x-1/2 -mt-1",bottom:"bottom-full left-1/2 transform -translate-x-1/2 -mb-1",left:"left-full top-1/2 transform -translate-y-1/2 -ml-1",right:"right-full top-1/2 transform -translate-y-1/2 -mr-1"}}}),v=t.computed(()=>x.cn(h({placement:n.placement}),n.class)),y=t.computed(()=>g({placement:n.placement})),w=()=>{if(!p.value||!f.value)return;const e=p.value.getBoundingClientRect(),o=f.value.getBoundingClientRect();let a=0,l=0;const c=8;switch(n.placement){case"top":a=e.top-o.height-c,l=e.left+e.width/2-o.width/2;break;case"bottom":a=e.bottom+c,l=e.left+e.width/2-o.width/2;break;case"left":a=e.top+e.height/2-o.height/2,l=e.left-o.width-c;break;case"right":a=e.top+e.height/2-o.height/2,l=e.right+c;break}const i=8;l<i&&(l=i),l+o.width>window.innerWidth-i&&(l=window.innerWidth-o.width-i),a<i&&(a=i),a+o.height>window.innerHeight-i&&(a=window.innerHeight-o.height-i),d.value={top:`${a}px`,left:`${l}px`}},b=()=>{r&&clearTimeout(r),r=setTimeout(async()=>{u.value=!0,await t.nextTick(),w()},n.delay)},k=()=>{r&&clearTimeout(r),u.value=!1};return(e,o)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"triggerRef",ref:p,class:"relative inline-block",onMouseenter:b,onMouseleave:k},[t.renderSlot(e.$slots,"default"),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{"enter-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:t.withCtx(()=>[u.value?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"tooltipRef",ref:f,class:t.normalizeClass(v.value),style:t.normalizeStyle(d.value),role:"tooltip"},[t.createTextVNode(t.toDisplayString(s.content)+" ",1),t.createElementVNode("div",{class:t.normalizeClass(y.value)},null,2)],6)):t.createCommentVNode("",!0)]),_:1})]))],544))}};exports.default=S;
@@ -0,0 +1,124 @@
1
+ import { ref as c, computed as h, createElementBlock as g, openBlock as m, renderSlot as S, createBlock as V, Teleport as _, createVNode as B, Transition as N, withCtx as z, createCommentVNode as $, normalizeStyle as E, normalizeClass as v, createTextVNode as H, createElementVNode as M, toDisplayString as W, nextTick as q } from "vue";
2
+ import { cva as w } from "class-variance-authority";
3
+ import { cn as D } from "../utils/cn.js";
4
+ const A = {
5
+ __name: "Tooltip",
6
+ props: {
7
+ content: {
8
+ type: String,
9
+ required: !0
10
+ },
11
+ placement: {
12
+ type: String,
13
+ default: "top",
14
+ validator: (r) => ["top", "bottom", "left", "right"].includes(r)
15
+ },
16
+ delay: {
17
+ type: Number,
18
+ default: 0
19
+ },
20
+ class: String
21
+ },
22
+ setup(r) {
23
+ const i = r, p = c(!1), f = c(null), u = c(null), d = c({});
24
+ let n = null;
25
+ const y = w(
26
+ "fixed z-[9999] px-3 py-1.5 text-sm ui-text ui-surface rounded-md shadow-lg pointer-events-none whitespace-nowrap",
27
+ {
28
+ variants: {
29
+ placement: {
30
+ top: "",
31
+ bottom: "",
32
+ left: "",
33
+ right: ""
34
+ }
35
+ }
36
+ }
37
+ ), b = w(
38
+ "absolute w-2 h-2 bg-primary transform rotate-45",
39
+ {
40
+ variants: {
41
+ placement: {
42
+ top: "top-full left-1/2 transform -translate-x-1/2 -mt-1",
43
+ bottom: "bottom-full left-1/2 transform -translate-x-1/2 -mb-1",
44
+ left: "left-full top-1/2 transform -translate-y-1/2 -ml-1",
45
+ right: "right-full top-1/2 transform -translate-y-1/2 -mr-1"
46
+ }
47
+ }
48
+ }
49
+ ), k = h(
50
+ () => D(y({ placement: i.placement }), i.class)
51
+ ), x = h(
52
+ () => b({ placement: i.placement })
53
+ ), R = () => {
54
+ if (!f.value || !u.value) return;
55
+ const t = f.value.getBoundingClientRect(), e = u.value.getBoundingClientRect();
56
+ let o = 0, a = 0;
57
+ const s = 8;
58
+ switch (i.placement) {
59
+ case "top":
60
+ o = t.top - e.height - s, a = t.left + t.width / 2 - e.width / 2;
61
+ break;
62
+ case "bottom":
63
+ o = t.bottom + s, a = t.left + t.width / 2 - e.width / 2;
64
+ break;
65
+ case "left":
66
+ o = t.top + t.height / 2 - e.height / 2, a = t.left - e.width - s;
67
+ break;
68
+ case "right":
69
+ o = t.top + t.height / 2 - e.height / 2, a = t.right + s;
70
+ break;
71
+ }
72
+ const l = 8;
73
+ a < l && (a = l), a + e.width > window.innerWidth - l && (a = window.innerWidth - e.width - l), o < l && (o = l), o + e.height > window.innerHeight - l && (o = window.innerHeight - e.height - l), d.value = {
74
+ top: `${o}px`,
75
+ left: `${a}px`
76
+ };
77
+ }, T = () => {
78
+ n && clearTimeout(n), n = setTimeout(async () => {
79
+ p.value = !0, await q(), R();
80
+ }, i.delay);
81
+ }, C = () => {
82
+ n && clearTimeout(n), p.value = !1;
83
+ };
84
+ return (t, e) => (m(), g("div", {
85
+ ref_key: "triggerRef",
86
+ ref: f,
87
+ class: "relative inline-block",
88
+ onMouseenter: T,
89
+ onMouseleave: C
90
+ }, [
91
+ S(t.$slots, "default"),
92
+ (m(), V(_, { to: "body" }, [
93
+ B(N, {
94
+ "enter-active-class": "transition-opacity duration-200",
95
+ "enter-from-class": "opacity-0",
96
+ "enter-to-class": "opacity-100",
97
+ "leave-active-class": "transition-opacity duration-200",
98
+ "leave-from-class": "opacity-100",
99
+ "leave-to-class": "opacity-0"
100
+ }, {
101
+ default: z(() => [
102
+ p.value ? (m(), g("div", {
103
+ key: 0,
104
+ ref_key: "tooltipRef",
105
+ ref: u,
106
+ class: v(k.value),
107
+ style: E(d.value),
108
+ role: "tooltip"
109
+ }, [
110
+ H(W(r.content) + " ", 1),
111
+ M("div", {
112
+ class: v(x.value)
113
+ }, null, 2)
114
+ ], 6)) : $("", !0)
115
+ ]),
116
+ _: 1
117
+ })
118
+ ]))
119
+ ], 544));
120
+ }
121
+ };
122
+ export {
123
+ A as default
124
+ };