@ug666/ui-vue 0.1.0 → 0.3.0-beta.1

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 (255) hide show
  1. package/dist/aliases.d.ts +66 -0
  2. package/dist/aliases.d.ts.map +1 -0
  3. package/dist/blocks/feature-grid.vue.d.ts +40 -0
  4. package/dist/blocks/feature-grid.vue.d.ts.map +1 -0
  5. package/dist/blocks/index.cjs +2 -0
  6. package/dist/blocks/index.cjs.map +1 -0
  7. package/dist/blocks/index.d.ts +10 -0
  8. package/dist/blocks/index.d.ts.map +1 -0
  9. package/dist/blocks/index.js +227 -0
  10. package/dist/blocks/index.js.map +1 -0
  11. package/dist/blocks/landing-hero.vue.d.ts +61 -0
  12. package/dist/blocks/landing-hero.vue.d.ts.map +1 -0
  13. package/dist/button-CVw3ryBz.cjs +2 -0
  14. package/dist/button-CVw3ryBz.cjs.map +1 -0
  15. package/dist/button-D_ikOxrp.js +292 -0
  16. package/dist/button-D_ikOxrp.js.map +1 -0
  17. package/dist/cn-CFAiuoYh.cjs +2 -0
  18. package/dist/cn-CFAiuoYh.cjs.map +1 -0
  19. package/dist/cn-Cl2u7rTh.js +10 -0
  20. package/dist/cn-Cl2u7rTh.js.map +1 -0
  21. package/dist/components/accordion.vue.d.ts +29 -6
  22. package/dist/components/accordion.vue.d.ts.map +1 -1
  23. package/dist/components/alert.vue.d.ts +9 -8
  24. package/dist/components/alert.vue.d.ts.map +1 -1
  25. package/dist/components/avatar-group.vue.d.ts +3 -2
  26. package/dist/components/avatar-group.vue.d.ts.map +1 -1
  27. package/dist/components/avatar.vue.d.ts +6 -5
  28. package/dist/components/avatar.vue.d.ts.map +1 -1
  29. package/dist/components/badge.vue.d.ts +9 -16
  30. package/dist/components/badge.vue.d.ts.map +1 -1
  31. package/dist/components/breadcrumb.vue.d.ts +20 -11
  32. package/dist/components/breadcrumb.vue.d.ts.map +1 -1
  33. package/dist/components/button-group.vue.d.ts +92 -0
  34. package/dist/components/button-group.vue.d.ts.map +1 -0
  35. package/dist/components/button.vue.d.ts +77 -39
  36. package/dist/components/button.vue.d.ts.map +1 -1
  37. package/dist/components/card.vue.d.ts +15 -11
  38. package/dist/components/card.vue.d.ts.map +1 -1
  39. package/dist/components/checkbox-group.vue.d.ts +43 -0
  40. package/dist/components/checkbox-group.vue.d.ts.map +1 -0
  41. package/dist/components/checkbox.vue.d.ts +23 -24
  42. package/dist/components/checkbox.vue.d.ts.map +1 -1
  43. package/dist/components/config-provider.vue.d.ts +77 -0
  44. package/dist/components/config-provider.vue.d.ts.map +1 -0
  45. package/dist/components/container.vue.d.ts +141 -0
  46. package/dist/components/container.vue.d.ts.map +1 -0
  47. package/dist/components/context/accordion-context.d.ts +7 -2
  48. package/dist/components/context/accordion-context.d.ts.map +1 -1
  49. package/dist/components/context/button-group.d.ts +40 -0
  50. package/dist/components/context/button-group.d.ts.map +1 -0
  51. package/dist/components/context/checkbox-context.d.ts +14 -0
  52. package/dist/components/context/checkbox-context.d.ts.map +1 -0
  53. package/dist/components/context/context-menu-context.d.ts +4 -0
  54. package/dist/components/context/context-menu-context.d.ts.map +1 -1
  55. package/dist/components/context/drawer-context.d.ts +4 -0
  56. package/dist/components/context/drawer-context.d.ts.map +1 -1
  57. package/dist/components/context/dropdown-context.d.ts +10 -0
  58. package/dist/components/context/dropdown-context.d.ts.map +1 -1
  59. package/dist/components/context/form-context.d.ts +31 -1
  60. package/dist/components/context/form-context.d.ts.map +1 -1
  61. package/dist/components/context/popover-context.d.ts +2 -0
  62. package/dist/components/context/popover-context.d.ts.map +1 -1
  63. package/dist/components/context/radio-context.d.ts +11 -3
  64. package/dist/components/context/radio-context.d.ts.map +1 -1
  65. package/dist/components/context/tabs-context.d.ts +2 -0
  66. package/dist/components/context/tabs-context.d.ts.map +1 -1
  67. package/dist/components/context/tooltip-context.d.ts +2 -0
  68. package/dist/components/context/tooltip-context.d.ts.map +1 -1
  69. package/dist/components/context-menu.vue.d.ts +6 -5
  70. package/dist/components/context-menu.vue.d.ts.map +1 -1
  71. package/dist/components/descriptions.vue.d.ts +12 -18
  72. package/dist/components/descriptions.vue.d.ts.map +1 -1
  73. package/dist/components/dialog.vue.d.ts +5 -3
  74. package/dist/components/dialog.vue.d.ts.map +1 -1
  75. package/dist/components/drawer.vue.d.ts +9 -8
  76. package/dist/components/drawer.vue.d.ts.map +1 -1
  77. package/dist/components/dropdown.vue.d.ts +11 -10
  78. package/dist/components/dropdown.vue.d.ts.map +1 -1
  79. package/dist/components/empty-state.vue.d.ts +16 -17
  80. package/dist/components/empty-state.vue.d.ts.map +1 -1
  81. package/dist/components/form.vue.d.ts +95 -17
  82. package/dist/components/form.vue.d.ts.map +1 -1
  83. package/dist/components/icon.vue.d.ts +28 -0
  84. package/dist/components/icon.vue.d.ts.map +1 -0
  85. package/dist/components/index.cjs +1 -0
  86. package/dist/components/index.d.ts +65 -0
  87. package/dist/components/index.d.ts.map +1 -0
  88. package/dist/components/index.js +5 -0
  89. package/dist/components/input.vue.d.ts +71 -29
  90. package/dist/components/input.vue.d.ts.map +1 -1
  91. package/dist/components/label.vue.d.ts +12 -19
  92. package/dist/components/label.vue.d.ts.map +1 -1
  93. package/dist/components/layout.d.ts +194 -0
  94. package/dist/components/layout.d.ts.map +1 -0
  95. package/dist/components/link.vue.d.ts +55 -0
  96. package/dist/components/link.vue.d.ts.map +1 -0
  97. package/dist/components/modal.vue.d.ts +15 -16
  98. package/dist/components/modal.vue.d.ts.map +1 -1
  99. package/dist/components/navigation-menu.vue.d.ts +30 -14
  100. package/dist/components/navigation-menu.vue.d.ts.map +1 -1
  101. package/dist/components/number-input.vue.d.ts +53 -25
  102. package/dist/components/number-input.vue.d.ts.map +1 -1
  103. package/dist/components/otp-input.vue.d.ts +12 -9
  104. package/dist/components/otp-input.vue.d.ts.map +1 -1
  105. package/dist/components/pagination.vue.d.ts +15 -13
  106. package/dist/components/pagination.vue.d.ts.map +1 -1
  107. package/dist/components/popover.vue.d.ts +9 -8
  108. package/dist/components/popover.vue.d.ts.map +1 -1
  109. package/dist/components/progress.vue.d.ts +7 -5
  110. package/dist/components/progress.vue.d.ts.map +1 -1
  111. package/dist/components/radio-group.vue.d.ts +23 -30
  112. package/dist/components/radio-group.vue.d.ts.map +1 -1
  113. package/dist/components/radio.vue.d.ts +28 -17
  114. package/dist/components/radio.vue.d.ts.map +1 -1
  115. package/dist/components/scrollbar.vue.d.ts +65 -0
  116. package/dist/components/scrollbar.vue.d.ts.map +1 -0
  117. package/dist/components/select.vue.d.ts +83 -33
  118. package/dist/components/select.vue.d.ts.map +1 -1
  119. package/dist/components/separator.vue.d.ts +19 -8
  120. package/dist/components/separator.vue.d.ts.map +1 -1
  121. package/dist/components/sheet.vue.d.ts +15 -16
  122. package/dist/components/sheet.vue.d.ts.map +1 -1
  123. package/dist/components/sidebar.vue.d.ts +37 -25
  124. package/dist/components/sidebar.vue.d.ts.map +1 -1
  125. package/dist/components/skeleton.vue.d.ts +3 -2
  126. package/dist/components/skeleton.vue.d.ts.map +1 -1
  127. package/dist/components/slider.vue.d.ts +56 -22
  128. package/dist/components/slider.vue.d.ts.map +1 -1
  129. package/dist/components/space.vue.d.ts +35 -0
  130. package/dist/components/space.vue.d.ts.map +1 -0
  131. package/dist/components/spinner.vue.d.ts +6 -5
  132. package/dist/components/spinner.vue.d.ts.map +1 -1
  133. package/dist/components/splitter.vue.d.ts +234 -0
  134. package/dist/components/splitter.vue.d.ts.map +1 -0
  135. package/dist/components/statistic.vue.d.ts +12 -15
  136. package/dist/components/statistic.vue.d.ts.map +1 -1
  137. package/dist/components/steps.vue.d.ts +8 -19
  138. package/dist/components/steps.vue.d.ts.map +1 -1
  139. package/dist/components/switch.vue.d.ts +50 -19
  140. package/dist/components/switch.vue.d.ts.map +1 -1
  141. package/dist/components/table.vue.d.ts +6 -5
  142. package/dist/components/table.vue.d.ts.map +1 -1
  143. package/dist/components/tabs.vue.d.ts +26 -9
  144. package/dist/components/tabs.vue.d.ts.map +1 -1
  145. package/dist/components/tag.vue.d.ts +12 -19
  146. package/dist/components/tag.vue.d.ts.map +1 -1
  147. package/dist/components/text.vue.d.ts +32 -0
  148. package/dist/components/text.vue.d.ts.map +1 -0
  149. package/dist/components/textarea.vue.d.ts +58 -26
  150. package/dist/components/textarea.vue.d.ts.map +1 -1
  151. package/dist/components/toast.vue.d.ts +3 -2
  152. package/dist/components/toast.vue.d.ts.map +1 -1
  153. package/dist/components/tooltip.vue.d.ts +7 -6
  154. package/dist/components/tooltip.vue.d.ts.map +1 -1
  155. package/dist/components/types/forms.d.ts +15 -0
  156. package/dist/components/types/forms.d.ts.map +1 -0
  157. package/dist/components/types/foundation.d.ts +5 -0
  158. package/dist/components/types/foundation.d.ts.map +1 -0
  159. package/dist/composables/index.cjs +1 -1
  160. package/dist/composables/index.d.ts +2 -1
  161. package/dist/composables/index.d.ts.map +1 -1
  162. package/dist/composables/index.js +3 -2
  163. package/dist/composables/use-copy-to-clipboard.d.ts.map +1 -1
  164. package/dist/composables/use-event-listener.d.ts.map +1 -1
  165. package/dist/composables/use-form.d.ts +38 -26
  166. package/dist/composables/use-form.d.ts.map +1 -1
  167. package/dist/composables/use-local-storage.d.ts.map +1 -1
  168. package/dist/composables-C-Go-D3m.js +386 -0
  169. package/dist/composables-C-Go-D3m.js.map +1 -0
  170. package/dist/composables-CiWPyBEE.cjs +2 -0
  171. package/dist/composables-CiWPyBEE.cjs.map +1 -0
  172. package/dist/global.cjs +1 -0
  173. package/dist/global.d.ts +124 -0
  174. package/dist/global.d.ts.map +1 -0
  175. package/dist/global.js +0 -0
  176. package/dist/icon-NbssmDYT.js +1561 -0
  177. package/dist/icon-NbssmDYT.js.map +1 -0
  178. package/dist/icon-jF_XZntG.cjs +2 -0
  179. package/dist/icon-jF_XZntG.cjs.map +1 -0
  180. package/dist/index.cjs +1 -1
  181. package/dist/index.cjs.map +1 -1
  182. package/dist/index.d.ts +30 -11
  183. package/dist/index.d.ts.map +1 -1
  184. package/dist/index.js +133 -2937
  185. package/dist/index.js.map +1 -1
  186. package/dist/internal/cn.d.ts +3 -0
  187. package/dist/internal/cn.d.ts.map +1 -0
  188. package/dist/internal/use-overlay-focus.d.ts +3 -0
  189. package/dist/internal/use-overlay-focus.d.ts.map +1 -0
  190. package/dist/internal/use-overlay-lifecycle.d.ts +3 -0
  191. package/dist/internal/use-overlay-lifecycle.d.ts.map +1 -0
  192. package/dist/labs/file-preview.vue.d.ts +42 -0
  193. package/dist/labs/file-preview.vue.d.ts.map +1 -0
  194. package/dist/labs/index.cjs +2 -0
  195. package/dist/labs/index.cjs.map +1 -0
  196. package/dist/labs/index.d.ts +15 -0
  197. package/dist/labs/index.d.ts.map +1 -0
  198. package/dist/labs/index.js +213 -0
  199. package/dist/labs/index.js.map +1 -0
  200. package/dist/labs/model-card.vue.d.ts +46 -0
  201. package/dist/labs/model-card.vue.d.ts.map +1 -0
  202. package/dist/patterns/admin-shell.vue.d.ts +74 -0
  203. package/dist/patterns/admin-shell.vue.d.ts.map +1 -0
  204. package/dist/patterns/confirm-dialog.vue.d.ts +60 -0
  205. package/dist/patterns/confirm-dialog.vue.d.ts.map +1 -0
  206. package/dist/patterns/copy-field.vue.d.ts +48 -0
  207. package/dist/patterns/copy-field.vue.d.ts.map +1 -0
  208. package/dist/patterns/index.cjs +2 -0
  209. package/dist/patterns/index.cjs.map +1 -0
  210. package/dist/patterns/index.d.ts +14 -0
  211. package/dist/patterns/index.d.ts.map +1 -0
  212. package/dist/patterns/index.js +394 -0
  213. package/dist/patterns/index.js.map +1 -0
  214. package/dist/patterns/page-header.vue.d.ts +48 -0
  215. package/dist/patterns/page-header.vue.d.ts.map +1 -0
  216. package/dist/plugin.d.ts +5 -0
  217. package/dist/plugin.d.ts.map +1 -0
  218. package/dist/primitives/index.cjs +1 -0
  219. package/dist/primitives/index.d.ts +26 -0
  220. package/dist/primitives/index.d.ts.map +1 -0
  221. package/dist/primitives/index.js +3 -0
  222. package/dist/resolver.cjs +2 -0
  223. package/dist/resolver.cjs.map +1 -0
  224. package/dist/resolver.d.ts +20 -0
  225. package/dist/resolver.d.ts.map +1 -0
  226. package/dist/resolver.js +34 -0
  227. package/dist/resolver.js.map +1 -0
  228. package/dist/sidebar-DI7FOJiw.cjs +2 -0
  229. package/dist/sidebar-DI7FOJiw.cjs.map +1 -0
  230. package/dist/sidebar-wW1OGS5T.js +442 -0
  231. package/dist/sidebar-wW1OGS5T.js.map +1 -0
  232. package/dist/statistic-1kiSjvCX.cjs +2 -0
  233. package/dist/statistic-1kiSjvCX.cjs.map +1 -0
  234. package/dist/statistic-DBlNBT-A.js +4748 -0
  235. package/dist/statistic-DBlNBT-A.js.map +1 -0
  236. package/dist/styles.css +4343 -0
  237. package/dist/theme.cjs +2 -0
  238. package/dist/theme.cjs.map +1 -0
  239. package/dist/theme.d.ts +173 -0
  240. package/dist/theme.d.ts.map +1 -0
  241. package/dist/theme.js +128 -0
  242. package/dist/theme.js.map +1 -0
  243. package/dist/themes/default.css +80 -0
  244. package/dist/themes/mecha.css +195 -0
  245. package/dist/themes/minimal.css +160 -0
  246. package/dist/toast-state-DZPoRLPw.cjs +2 -0
  247. package/dist/toast-state-DZPoRLPw.cjs.map +1 -0
  248. package/dist/toast-state-DyrVOjSJ.js +50 -0
  249. package/dist/toast-state-DyrVOjSJ.js.map +1 -0
  250. package/dist/tokens.css +1241 -9
  251. package/package.json +66 -14
  252. package/dist/composables-BwdwEG7n.js +0 -296
  253. package/dist/composables-BwdwEG7n.js.map +0 -1
  254. package/dist/composables-Cxcf-3ov.cjs +0 -2
  255. package/dist/composables-Cxcf-3ov.cjs.map +0 -1
package/dist/index.js CHANGED
@@ -1,2941 +1,137 @@
1
- import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g } from "./composables-BwdwEG7n.js";
2
- import { Fragment as _, Teleport as v, computed as y, createBlock as b, createCommentVNode as x, createElementBlock as S, createElementVNode as C, createTextVNode as w, createVNode as T, defineComponent as E, h as D, inject as O, mergeModels as k, mergeProps as ee, nextTick as A, normalizeClass as j, normalizeStyle as M, onBeforeUnmount as N, openBlock as P, provide as F, ref as I, renderList as L, renderSlot as R, resolveDynamicComponent as z, toDisplayString as B, unref as V, useAttrs as te, useId as H, useModel as U, useSlots as ne, watch as W, withModifiers as G } from "vue";
3
- import { AlertCircle as re, AlertTriangle as ie, Check as K, CheckCircle as ae, ChevronDown as oe, ChevronLeft as se, ChevronRight as ce, Info as le, Loader2 as ue, Minus as q, Plus as de, TrendingDown as fe, TrendingUp as pe, User as me, X as J } from "lucide-vue-next";
4
- import { cn as he, cn as Y } from "@ug666/ui-utils";
5
- //#region src/components/button.vue?vue&type=script&setup=true&lang.ts
6
- var ge = ["disabled"], _e = "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", ve = /* @__PURE__ */ E({
7
- __name: "button",
8
- props: {
9
- variant: { default: "default" },
10
- size: { default: "default" },
11
- loading: {
12
- type: Boolean,
13
- default: !1
14
- },
15
- disabled: {
16
- type: Boolean,
17
- default: !1
18
- },
19
- class: {}
20
- },
21
- emits: ["click"],
22
- setup(e, { emit: t }) {
23
- let n = e, r = t, i = {
24
- default: "bg-primary text-primary-fg hover:bg-primary-hover focus-visible:ring-ring",
25
- destructive: "bg-danger text-danger-fg hover:bg-danger-hover focus-visible:ring-danger",
26
- outline: "border border-border-strong bg-surface-1 text-text-primary hover:bg-surface-2 focus-visible:ring-ring/30",
27
- secondary: "bg-surface-2 text-text-primary hover:bg-surface-3 focus-visible:ring-ring/30",
28
- ghost: "text-text-primary hover:bg-surface-2 focus-visible:ring-ring/30",
29
- link: "text-text-primary underline-offset-4 hover:underline focus-visible:ring-ring/30"
30
- }, a = {
31
- default: "h-9 px-4 py-2",
32
- sm: "h-8 rounded-md px-3 text-xs",
33
- lg: "h-12 rounded-md px-6 text-base",
34
- icon: "h-9 w-9"
35
- }, o = y(() => Y(_e, i[n.variant], a[n.size], n.class)), s = y(() => n.disabled || n.loading);
36
- function c(e) {
37
- s.value || r("click", e);
38
- }
39
- return (t, n) => (P(), S("button", {
40
- class: j(o.value),
41
- disabled: s.value,
42
- onClick: c
43
- }, [e.loading ? (P(), b(V(ue), {
44
- key: 0,
45
- class: "animate-spin",
46
- size: 16
47
- })) : x("", !0), R(t.$slots, "default")], 10, ge));
48
- }
49
- }), ye = { class: "flex flex-col gap-1" }, be = ["for"], xe = [
50
- "id",
51
- "value",
52
- "type",
53
- "disabled",
54
- "placeholder"
55
- ], Se = {
56
- key: 1,
57
- class: "text-xs text-danger"
58
- }, Ce = {
59
- key: 2,
60
- class: "text-xs text-text-secondary"
61
- }, we = /* @__PURE__ */ E({
62
- name: "UInput",
63
- inheritAttrs: !1,
64
- __name: "input",
65
- props: /* @__PURE__ */ k({
66
- label: { default: void 0 },
67
- error: { default: void 0 },
68
- helperText: { default: void 0 },
69
- id: { default: void 0 },
70
- type: { default: "text" },
71
- disabled: {
72
- type: Boolean,
73
- default: !1
74
- },
75
- placeholder: { default: void 0 },
76
- class: { default: void 0 }
77
- }, {
78
- modelValue: {},
79
- modelModifiers: {}
80
- }),
81
- emits: /* @__PURE__ */ k([
82
- "blur",
83
- "focus",
84
- "input",
85
- "change"
86
- ], ["update:modelValue"]),
87
- setup(e, { expose: t, emit: n }) {
88
- let r = e, i = n, a = U(e, "modelValue"), o = te(), s = H(), c = y(() => r.id ?? s), l = I(null), u = y(() => Y("flex h-9 w-full rounded-md border bg-surface-1 px-3 py-2 text-sm text-text-primary placeholder:text-text-tertiary", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-1", "disabled:cursor-not-allowed disabled:opacity-50", r.error ? "border-danger focus-visible:ring-danger" : "border-border-strong focus-visible:ring-ring/30", r.class)), d = y(() => {
89
- let e = { ...o };
90
- return delete e.class, e;
91
- });
92
- function f(e) {
93
- a.value = e.target.value, i("input", e);
94
- }
95
- function p(e) {
96
- i("change", e);
97
- }
98
- function m(e) {
99
- i("blur", e);
100
- }
101
- function h(e) {
102
- i("focus", e);
103
- }
104
- function g() {
105
- l.value?.focus();
106
- }
107
- function _() {
108
- l.value?.blur();
109
- }
110
- function v() {
111
- l.value?.select();
112
- }
113
- return t({
114
- focus: g,
115
- blur: _,
116
- select: v,
117
- el: l
118
- }), (t, n) => (P(), S("div", ye, [
119
- e.label ? (P(), S("label", {
120
- key: 0,
121
- for: c.value,
122
- class: "text-sm font-medium text-text-primary"
123
- }, B(e.label), 9, be)) : x("", !0),
124
- C("input", ee({
125
- id: c.value,
126
- ref_key: "inputRef",
127
- ref: l,
128
- value: a.value ?? "",
129
- type: e.type,
130
- disabled: e.disabled,
131
- placeholder: e.placeholder,
132
- class: u.value
133
- }, d.value, {
134
- onInput: f,
135
- onChange: p,
136
- onBlur: m,
137
- onFocus: h
138
- }), null, 16, xe),
139
- e.error ? (P(), S("p", Se, B(e.error), 1)) : e.helperText ? (P(), S("p", Ce, B(e.helperText), 1)) : x("", !0)
140
- ]));
141
- }
142
- }), Te = ["for"], Ee = {
143
- key: 0,
144
- class: "ml-0.5 text-danger",
145
- "aria-hidden": "true"
146
- }, De = /* @__PURE__ */ E({
147
- name: "ULabel",
148
- __name: "label",
149
- props: {
150
- for: { default: void 0 },
151
- required: {
152
- type: Boolean,
153
- default: !1
154
- },
155
- class: { default: void 0 }
156
- },
157
- setup(e) {
158
- let t = e, n = y(() => Y("text-sm font-medium leading-none text-text-primary peer-disabled:cursor-not-allowed peer-disabled:opacity-70", t.class));
159
- return (e, r) => (P(), S("label", {
160
- for: t.for,
161
- class: j(n.value)
162
- }, [R(e.$slots, "default"), t.required ? (P(), S("span", Ee, "*")) : x("", !0)], 10, Te));
163
- }
164
- });
165
- //#endregion
166
- //#region src/components/card.vue?vue&type=script&setup=true&lang.ts
167
- function X(e, t, n) {
168
- return E({
169
- name: e,
170
- props: { class: {
171
- type: String,
172
- default: void 0
173
- } },
174
- setup(e, { attrs: r, slots: i }) {
175
- let a = y(() => Y(n, e.class));
176
- return () => D(t, {
177
- ...r,
178
- class: a.value
179
- }, i.default?.());
180
- }
181
- });
182
- }
183
- var Oe = X("UCardHeader", "div", "flex flex-col gap-1.5 p-6"), ke = X("UCardTitle", "h3", "font-semibold leading-none tracking-tight text-text-primary"), Ae = X("UCardDescription", "p", "text-sm text-text-secondary"), je = X("UCardContent", "div", "p-6 pt-0"), Me = X("UCardFooter", "div", "flex items-center p-6 pt-0"), Ne = /* @__PURE__ */ E({
184
- name: "UCard",
185
- __name: "card",
186
- props: { class: { default: void 0 } },
187
- setup(e) {
188
- let t = e, n = y(() => Y("rounded-lg border border-border-base bg-surface-1 shadow-sm", t.class));
189
- return (e, t) => (P(), S("div", { class: j(n.value) }, [R(e.$slots, "default")], 2));
190
- }
191
- }), Pe = /* @__PURE__ */ E({
192
- name: "UBadge",
193
- __name: "badge",
194
- props: {
195
- variant: { default: "default" },
196
- class: { default: void 0 }
197
- },
198
- setup(e) {
199
- let t = e, n = {
200
- default: "bg-primary text-primary-fg",
201
- secondary: "bg-surface-3 text-text-primary",
202
- destructive: "bg-danger-soft text-danger-soft-fg",
203
- outline: "border border-border-strong bg-transparent text-text-primary",
204
- success: "bg-success-soft text-success-soft-fg",
205
- warning: "bg-warning-soft text-warning-soft-fg"
206
- }, r = y(() => Y("inline-flex items-center rounded-md px-2.5 py-0.5 text-xs font-semibold transition-colors", n[t.variant], t.class));
207
- return (e, t) => (P(), S("span", { class: j(r.value) }, [R(e.$slots, "default")], 2));
208
- }
209
- }), Fe = ["disabled"], Ie = /* @__PURE__ */ E({
210
- name: "UTag",
211
- __name: "tag",
212
- props: {
213
- variant: { default: "default" },
214
- size: { default: "default" },
215
- closable: {
216
- type: Boolean,
217
- default: !1
218
- },
219
- disabled: {
220
- type: Boolean,
221
- default: !1
222
- },
223
- color: { default: void 0 },
224
- class: { default: void 0 }
225
- },
226
- emits: ["close"],
227
- setup(e, { emit: t }) {
228
- let n = e, r = t, i = {
229
- default: "bg-surface-3 text-text-primary",
230
- primary: "bg-success-soft text-success-soft-fg",
231
- success: "bg-success-soft text-success-soft-fg",
232
- warning: "bg-warning-soft text-warning-soft-fg",
233
- destructive: "bg-danger-soft text-danger-soft-fg",
234
- outline: "border border-border-strong bg-transparent text-text-primary"
235
- }, a = {
236
- sm: "px-1.5 py-0 text-xs",
237
- default: "px-2 py-0.5 text-xs"
238
- }, o = y(() => Y("inline-flex items-center gap-1 rounded font-medium transition-colors", i[n.variant], a[n.size], n.disabled && "cursor-not-allowed opacity-50", n.class)), s = y(() => n.color ? {
239
- backgroundColor: n.color,
240
- color: "#fff",
241
- borderColor: n.color
242
- } : void 0);
243
- function c(e) {
244
- n.disabled || r("close", e);
245
- }
246
- return (t, n) => (P(), S("span", {
247
- class: j(o.value),
248
- style: M(s.value)
249
- }, [R(t.$slots, "default"), e.closable ? (P(), S("button", {
250
- key: 0,
251
- type: "button",
252
- disabled: e.disabled,
253
- class: "inline-flex items-center justify-center rounded-sm opacity-60 transition-opacity hover:opacity-100 focus-visible:outline-none disabled:pointer-events-none",
254
- "aria-label": "关闭标签",
255
- onClick: G(c, ["stop"])
256
- }, [T(V(J), {
257
- size: 10,
258
- "stroke-width": 2.5
259
- })], 8, Fe)) : x("", !0)], 6));
260
- }
261
- }), Le = {
262
- key: 0,
263
- class: "flex items-center justify-between border-b border-border-base px-6 py-4"
264
- }, Re = {
265
- key: 0,
266
- class: "text-lg font-semibold text-text-primary"
267
- }, ze = { key: 1 }, Be = { class: "px-6 py-4" }, Ve = {
268
- key: 1,
269
- class: "flex items-center justify-end gap-2 border-t border-border-base px-6 py-4"
270
- }, He = /* @__PURE__ */ E({
271
- name: "UModal",
272
- __name: "modal",
273
- props: /* @__PURE__ */ k({
274
- title: { default: void 0 },
275
- maxWidth: { default: "max-w-lg" },
276
- closeOnOverlay: {
277
- type: Boolean,
278
- default: !0
279
- },
280
- closeOnEsc: {
281
- type: Boolean,
282
- default: !0
283
- },
284
- showCloseButton: {
285
- type: Boolean,
286
- default: !0
287
- },
288
- class: { default: void 0 }
289
- }, {
290
- open: {
291
- type: Boolean,
292
- default: !1
293
- },
294
- openModifiers: {}
295
- }),
296
- emits: /* @__PURE__ */ k(["close", "openChange"], ["update:open"]),
297
- setup(e, { emit: t }) {
298
- let n = e, r = t, i = U(e, "open"), a = y(() => Y("fixed inset-0 z-50 flex items-center justify-center p-4", n.class)), o = y(() => Y("relative z-10 w-full rounded-lg bg-surface-1 shadow-lg", n.maxWidth));
299
- function s(e) {
300
- typeof document > "u" || (document.body.style.overflow = e ? "hidden" : "");
301
- }
302
- function c() {
303
- i.value = !1, r("openChange", !1), r("close");
304
- }
305
- function l() {
306
- n.closeOnOverlay && c();
307
- }
308
- function u(e) {
309
- e.key === "Escape" && n.closeOnEsc && i.value && c();
310
- }
311
- return W(i, (e) => {
312
- if (s(e), e && typeof document < "u") {
313
- document.addEventListener("keydown", u), r("openChange", !0);
314
- return;
315
- }
316
- typeof document < "u" && document.removeEventListener("keydown", u);
317
- }, { immediate: !0 }), N(() => {
318
- s(!1), typeof document < "u" && document.removeEventListener("keydown", u);
319
- }), (t, n) => (P(), b(v, { to: "body" }, [i.value ? (P(), S("div", {
320
- key: 0,
321
- class: j(a.value),
322
- role: "dialog",
323
- "aria-modal": "true"
324
- }, [C("div", {
325
- class: "absolute inset-0 bg-overlay",
326
- "aria-hidden": "true",
327
- onClick: l
328
- }), C("div", {
329
- class: j(o.value),
330
- onClick: n[0] || (n[0] = G(() => {}, ["stop"]))
331
- }, [
332
- e.title || t.$slots.header || e.showCloseButton ? (P(), S("div", Le, [R(t.$slots, "header", {}, () => [e.title ? (P(), S("h2", Re, B(e.title), 1)) : (P(), S("div", ze))]), e.showCloseButton ? (P(), S("button", {
333
- key: 0,
334
- type: "button",
335
- class: "rounded-md p-1 text-text-tertiary transition-colors hover:bg-surface-3 hover:text-text-secondary",
336
- "aria-label": "关闭",
337
- onClick: c
338
- }, [T(V(J), { size: 18 })])) : x("", !0)])) : x("", !0),
339
- C("div", Be, [R(t.$slots, "default")]),
340
- t.$slots.footer ? (P(), S("div", Ve, [R(t.$slots, "footer")])) : x("", !0)
341
- ], 2)], 2)) : x("", !0)]));
342
- }
343
- }), Ue = ["aria-describedby"], We = { class: "px-6 pt-6 pb-4" }, Ge = {
344
- id: "dialog-title",
345
- class: "text-base font-bold text-text-primary"
346
- }, Ke = {
347
- key: 0,
348
- id: "dialog-description",
349
- class: "mt-2 text-sm text-text-secondary"
350
- }, qe = { class: "flex items-center justify-end gap-2 border-t border-border-subtle px-6 py-4" }, Je = /* @__PURE__ */ E({
351
- name: "UDialog",
352
- __name: "dialog",
353
- props: /* @__PURE__ */ k({
354
- title: {},
355
- description: { default: void 0 },
356
- variant: { default: "default" },
357
- cancelText: { default: "取消" },
358
- confirmText: { default: "确认" },
359
- class: { default: void 0 }
360
- }, {
361
- open: {
362
- type: Boolean,
363
- default: !1
364
- },
365
- openModifiers: {}
366
- }),
367
- emits: /* @__PURE__ */ k(["confirm", "cancel"], ["update:open"]),
368
- setup(e, { emit: t }) {
369
- let n = e, r = t, i = U(e, "open"), a = {
370
- default: "bg-primary text-primary-fg hover:bg-primary-hover focus-visible:ring-ring",
371
- destructive: "bg-danger text-danger-fg hover:bg-danger-hover focus-visible:ring-danger"
372
- }, o = y(() => Y("fixed inset-0 z-50 flex items-center justify-center p-4", n.class)), s = y(() => Y("inline-flex h-9 items-center justify-center rounded-md px-4 text-sm font-medium transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2", a[n.variant]));
373
- function c() {
374
- r("cancel"), i.value = !1;
375
- }
376
- function l() {
377
- r("confirm"), i.value = !1;
378
- }
379
- function u(e) {
380
- e.key === "Escape" && i.value && c();
381
- }
382
- return W(i, (e) => {
383
- typeof document > "u" || (e ? (document.body.style.overflow = "hidden", document.addEventListener("keydown", u)) : (document.body.style.overflow = "", document.removeEventListener("keydown", u)));
384
- }, { immediate: !0 }), N(() => {
385
- typeof document > "u" || (document.body.style.overflow = "", document.removeEventListener("keydown", u));
386
- }), (t, n) => (P(), b(v, { to: "body" }, [i.value ? (P(), S("div", {
387
- key: 0,
388
- class: j(o.value),
389
- role: "alertdialog",
390
- "aria-modal": "true",
391
- "aria-labelledby": "dialog-title",
392
- "aria-describedby": e.description ? "dialog-description" : void 0
393
- }, [C("div", {
394
- class: "absolute inset-0 bg-overlay",
395
- "aria-hidden": "true",
396
- onClick: c
397
- }), C("div", {
398
- class: "relative z-10 w-full max-w-sm rounded-lg bg-surface-1 shadow-lg",
399
- onClick: n[0] || (n[0] = G(() => {}, ["stop"]))
400
- }, [C("div", We, [C("h2", Ge, B(e.title), 1), e.description ? (P(), S("p", Ke, B(e.description), 1)) : x("", !0)]), C("div", qe, [C("button", {
401
- type: "button",
402
- class: j(V(Y)("inline-flex h-9 items-center justify-center rounded-md border border-border-strong bg-surface-1 px-4 text-sm font-medium text-text-secondary transition-colors", "hover:bg-surface-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring/30")),
403
- onClick: c
404
- }, B(e.cancelText), 3), C("button", {
405
- type: "button",
406
- class: j(s.value),
407
- onClick: l
408
- }, B(e.confirmText), 3)])])], 10, Ue)) : x("", !0)]));
409
- }
410
- }), Ye = Symbol("ug-drawer-context");
411
- //#endregion
412
- //#region src/components/drawer.vue?vue&type=script&setup=true&lang.ts
413
- function Xe() {
414
- let e = O(Ye);
415
- if (!e) throw Error("Drawer 子组件必须在 <UDrawer> 内使用");
416
- return e;
417
- }
418
- var Ze = {
419
- right: "inset-y-0 right-0 h-full w-80 max-w-full",
420
- left: "inset-y-0 left-0 h-full w-80 max-w-full",
421
- top: "inset-x-0 top-0 w-full max-h-[80vh]",
422
- bottom: "inset-x-0 bottom-0 w-full max-h-[80vh]"
423
- }, Qe = E({
424
- name: "UDrawerContent",
425
- props: { class: {
426
- type: String,
427
- default: void 0
428
- } },
429
- setup(e, { slots: t }) {
430
- let n = Xe(), r = y(() => Y("absolute flex flex-col bg-surface-1 shadow-xl transition-transform duration-300 ease-in-out", Ze[n.side.value], e.class));
431
- return () => n.open.value ? D(v, { to: "body" }, [D("div", {
432
- class: "fixed inset-0 z-50",
433
- role: "dialog",
434
- "aria-modal": "true"
435
- }, [D("div", {
436
- class: "absolute inset-0 bg-overlay transition-opacity",
437
- "aria-hidden": "true",
438
- onClick: () => n.setOpen(!1)
439
- }), D("div", {
440
- class: r.value,
441
- onClick: (e) => e.stopPropagation()
442
- }, t.default?.())])]) : null;
443
- }
444
- }), $e = E({
445
- name: "UDrawerHeader",
446
- props: { class: {
447
- type: String,
448
- default: void 0
449
- } },
450
- setup(e, { slots: t }) {
451
- let n = y(() => Y("flex flex-col gap-1.5 border-b border-border-base px-6 py-4", e.class));
452
- return () => D("div", { class: n.value }, t.default?.());
453
- }
454
- }), et = E({
455
- name: "UDrawerTitle",
456
- props: { class: {
457
- type: String,
458
- default: void 0
459
- } },
460
- setup(e, { slots: t }) {
461
- let n = y(() => Y("text-lg font-semibold text-text-primary", e.class));
462
- return () => D("h2", { class: n.value }, t.default?.());
463
- }
464
- }), tt = E({
465
- name: "UDrawerDescription",
466
- props: { class: {
467
- type: String,
468
- default: void 0
469
- } },
470
- setup(e, { slots: t }) {
471
- let n = y(() => Y("text-sm text-text-secondary", e.class));
472
- return () => D("p", { class: n.value }, t.default?.());
473
- }
474
- }), nt = E({
475
- name: "UDrawerFooter",
476
- props: { class: {
477
- type: String,
478
- default: void 0
479
- } },
480
- setup(e, { slots: t }) {
481
- let n = y(() => Y("mt-auto flex items-center justify-end gap-2 border-t border-border-base px-6 py-4", e.class));
482
- return () => D("div", { class: n.value }, t.default?.());
483
- }
484
- }), rt = E({
485
- name: "UDrawerClose",
486
- props: { class: {
487
- type: String,
488
- default: void 0
489
- } },
490
- emits: { click: (e) => !0 },
491
- setup(e, { emit: t, slots: n }) {
492
- let r = Xe(), i = y(() => Y("inline-flex items-center justify-center rounded-md px-4 py-2 text-sm font-medium text-text-secondary transition-colors hover:bg-surface-3 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/30", e.class));
493
- function a(e) {
494
- r.setOpen(!1), t("click", e);
495
- }
496
- return () => D("button", {
497
- type: "button",
498
- class: i.value,
499
- onClick: a
500
- }, n.default?.() ?? [D(J, { size: 18 })]);
501
- }
502
- }), it = /* @__PURE__ */ E({
503
- name: "UDrawer",
504
- __name: "drawer",
505
- props: /* @__PURE__ */ k({
506
- side: { default: "right" },
507
- class: { default: void 0 }
508
- }, {
509
- open: {
510
- type: Boolean,
511
- default: !1
512
- },
513
- openModifiers: {}
514
- }),
515
- emits: /* @__PURE__ */ k(["openChange"], ["update:open"]),
516
- setup(e, { emit: t }) {
517
- let n = e, r = t, i = U(e, "open"), a = y(() => n.side);
518
- function o(e) {
519
- i.value = e, r("openChange", e);
520
- }
521
- function s(e) {
522
- e.key === "Escape" && i.value && o(!1);
523
- }
524
- return W(i, (e) => {
525
- typeof document > "u" || (document.body.style.overflow = e ? "hidden" : "", e ? document.addEventListener("keydown", s) : document.removeEventListener("keydown", s));
526
- }, { immediate: !0 }), N(() => {
527
- typeof document > "u" || (document.body.style.overflow = "", document.removeEventListener("keydown", s));
528
- }), F(Ye, {
529
- open: i,
530
- side: a,
531
- setOpen: o
532
- }), (e, t) => R(e.$slots, "default");
533
- }
534
- }), at = { class: "w-full overflow-auto" };
535
- function Z(e, t, n) {
536
- return E({
537
- name: e,
538
- props: { class: {
539
- type: String,
540
- default: void 0
541
- } },
542
- setup(e, { attrs: r, slots: i }) {
543
- let a = y(() => Y(n, e.class));
544
- return () => D(t, {
545
- ...r,
546
- class: a.value
547
- }, i.default?.());
548
- }
549
- });
550
- }
551
- var ot = Z("UTableHeader", "thead", "[&_tr]:border-b border-border-base"), st = Z("UTableBody", "tbody", "[&_tr:last-child]:border-0"), ct = Z("UTableRow", "tr", "border-b border-border-base transition-colors hover:bg-surface-2"), lt = Z("UTableHead", "th", "h-10 px-4 text-left align-middle font-medium text-text-secondary [&:has([role=checkbox])]:pr-0"), ut = Z("UTableCell", "td", "px-4 py-3 align-middle text-text-primary [&:has([role=checkbox])]:pr-0"), dt = /* @__PURE__ */ E({
552
- name: "UTable",
553
- __name: "table",
554
- props: { class: { default: void 0 } },
555
- setup(e) {
556
- let t = e, n = y(() => Y("w-full caption-bottom text-sm", t.class));
557
- return (e, t) => (P(), S("div", at, [C("table", { class: j(n.value) }, [R(e.$slots, "default")], 2)]));
558
- }
559
- }), ft = { class: "font-semibold" }, pt = ["onClick"], mt = /* @__PURE__ */ E({
560
- name: "UToaster",
561
- __name: "toast",
562
- props: { class: { default: void 0 } },
563
- setup(t) {
564
- let n = t, r = {
565
- success: "bg-success-soft border-success/30 text-success-soft-fg",
566
- error: "bg-danger-soft border-danger/30 text-danger-soft-fg",
567
- info: "bg-info-soft border-info/30 text-info-soft-fg"
568
- }, i = {
569
- success: "成功",
570
- error: "错误",
571
- info: "提示"
572
- }, { items: a } = e(), s = y(() => Y("fixed right-4 top-4 z-[9999] flex w-80 flex-col gap-2", n.class));
573
- return (e, t) => (P(), b(v, { to: "body" }, [V(a).length ? (P(), S("div", {
574
- key: 0,
575
- class: j(s.value),
576
- role: "region",
577
- "aria-label": "通知"
578
- }, [(P(!0), S(_, null, L(V(a), (e) => (P(), S("div", {
579
- key: e.id,
580
- class: j(V(Y)("flex items-start justify-between gap-2 rounded-md border px-4 py-3 text-sm shadow-md", r[e.type])),
581
- role: "alert"
582
- }, [C("div", null, [C("span", ft, B(i[e.type]) + ":", 1), w(" " + B(e.message), 1)]), C("button", {
583
- type: "button",
584
- class: "mt-0.5 shrink-0 opacity-60 transition-opacity hover:opacity-100",
585
- "aria-label": "关闭通知",
586
- onClick: (t) => V(o)(e.id)
587
- }, [T(V(J), { size: 14 })], 8, pt)], 2))), 128))], 2)) : x("", !0)]));
588
- }
589
- }), ht = ["for"], gt = { class: "relative inline-flex" }, _t = [
590
- "id",
591
- "checked",
592
- "disabled"
593
- ], vt = {
594
- key: 1,
595
- class: "relative inline-flex"
596
- }, yt = [
597
- "id",
598
- "checked",
599
- "disabled"
600
- ], bt = "peer inline-flex shrink-0 items-center justify-center rounded border transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", xt = /* @__PURE__ */ E({
601
- __name: "checkbox",
602
- props: {
603
- modelValue: {
604
- type: Boolean,
605
- default: !1
606
- },
607
- indeterminate: {
608
- type: Boolean,
609
- default: !1
610
- },
611
- size: { default: "default" },
612
- disabled: {
613
- type: Boolean,
614
- default: !1
615
- },
616
- label: {},
617
- id: {},
618
- class: {},
619
- labelClass: {}
620
- },
621
- emits: ["update:modelValue", "change"],
622
- setup(e, { emit: t }) {
623
- let n = e, r = t, i = I(null);
624
- W(() => n.indeterminate, (e) => {
625
- i.value && (i.value.indeterminate = e);
626
- }, { immediate: !0 });
627
- let a = {
628
- sm: "h-3.5 w-3.5",
629
- default: "h-4 w-4",
630
- lg: "h-5 w-5"
631
- }, o = {
632
- unchecked: "border-border-strong bg-surface-1 hover:border-border-strong",
633
- active: "border-primary bg-primary text-primary-fg focus-visible:ring-ring"
634
- }, s = y(() => Y(bt, a[n.size], n.indeterminate || n.modelValue ? o.active : o.unchecked, n.class)), c = y(() => n.size === "sm" ? 10 : n.size === "lg" ? 14 : 12), l = y(() => Y("inline-flex cursor-pointer items-center gap-2 text-sm text-text-primary select-none", n.disabled && "cursor-not-allowed opacity-60", n.labelClass));
635
- function u(e) {
636
- let t = e.target;
637
- r("update:modelValue", t.checked), r("change", t.checked);
638
- }
639
- return (t, n) => e.label === void 0 ? (P(), S("span", vt, [C("input", {
640
- id: e.id,
641
- ref_key: "inputRef",
642
- ref: i,
643
- type: "checkbox",
644
- class: "peer sr-only",
645
- checked: e.modelValue,
646
- disabled: e.disabled,
647
- onChange: u
648
- }, null, 40, yt), C("span", {
649
- "aria-hidden": "true",
650
- class: j(s.value)
651
- }, [e.indeterminate ? (P(), b(V(q), {
652
- key: 0,
653
- size: c.value
654
- }, null, 8, ["size"])) : e.modelValue ? (P(), b(V(K), {
655
- key: 1,
656
- size: c.value
657
- }, null, 8, ["size"])) : x("", !0)], 2)])) : (P(), S("label", {
658
- key: 0,
659
- for: e.id,
660
- class: j(l.value)
661
- }, [C("span", gt, [C("input", {
662
- id: e.id,
663
- ref_key: "inputRef",
664
- ref: i,
665
- type: "checkbox",
666
- class: "peer sr-only",
667
- checked: e.modelValue,
668
- disabled: e.disabled,
669
- onChange: u
670
- }, null, 40, _t), C("span", {
671
- "aria-hidden": "true",
672
- class: j(s.value)
673
- }, [e.indeterminate ? (P(), b(V(q), {
674
- key: 0,
675
- size: c.value
676
- }, null, 8, ["size"])) : e.modelValue ? (P(), b(V(K), {
677
- key: 1,
678
- size: c.value
679
- }, null, 8, ["size"])) : x("", !0)], 2)]), C("span", null, B(e.label), 1)], 10, ht));
680
- }
681
- }), St = Symbol("ug-radio-group-context"), Ct = ["for"], wt = { class: "relative inline-flex" }, Tt = [
682
- "id",
683
- "value",
684
- "checked",
685
- "disabled",
686
- "name"
687
- ], Et = {
688
- key: 1,
689
- class: "relative inline-flex"
690
- }, Dt = [
691
- "id",
692
- "value",
693
- "checked",
694
- "disabled",
695
- "name"
696
- ], Ot = "relative inline-flex shrink-0 items-center justify-center rounded-full border transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2", kt = /* @__PURE__ */ E({
697
- name: "URadio",
698
- __name: "radio",
699
- props: {
700
- value: {},
701
- checked: {
702
- type: Boolean,
703
- default: !1
704
- },
705
- disabled: {
706
- type: Boolean,
707
- default: !1
708
- },
709
- size: { default: "default" },
710
- label: {},
711
- name: {},
712
- class: {}
713
- },
714
- emits: ["change"],
715
- setup(e, { emit: t }) {
716
- let n = e, r = t, i = O(St, null), a = H(), o = y(() => i ? i.value.value === n.value : n.checked), s = y(() => i && i.disabled.value || n.disabled), c = y(() => i ? i.name.value : n.name);
717
- function l() {
718
- s.value || (i ? i.onValueChange(n.value) : r("change", n.value));
719
- }
720
- let u = {
721
- sm: "h-3.5 w-3.5",
722
- default: "h-4 w-4",
723
- lg: "h-5 w-5"
724
- }, d = {
725
- sm: "h-1.5 w-1.5",
726
- default: "h-2 w-2",
727
- lg: "h-2.5 w-2.5"
728
- }, f = y(() => Y(Ot, u[n.size], o.value ? "border-primary bg-primary focus-visible:ring-ring" : "border-border-strong bg-surface-1 hover:border-border-strong", s.value && "cursor-not-allowed opacity-50", n.class)), p = y(() => Y("inline-flex cursor-pointer items-center gap-2 text-sm text-text-primary select-none", s.value && "cursor-not-allowed opacity-60"));
729
- return (t, n) => e.label === void 0 ? (P(), S("span", Et, [C("input", {
730
- id: V(a),
731
- type: "radio",
732
- class: "peer sr-only",
733
- value: e.value,
734
- checked: o.value,
735
- disabled: s.value,
736
- name: c.value,
737
- onChange: l
738
- }, null, 40, Dt), C("span", {
739
- "aria-hidden": "true",
740
- class: j(f.value)
741
- }, [o.value ? (P(), S("span", {
742
- key: 0,
743
- class: j(V(Y)("rounded-full bg-white", d[e.size]))
744
- }, null, 2)) : x("", !0)], 2)])) : (P(), S("label", {
745
- key: 0,
746
- for: V(a),
747
- class: j(p.value)
748
- }, [C("span", wt, [C("input", {
749
- id: V(a),
750
- type: "radio",
751
- class: "peer sr-only",
752
- value: e.value,
753
- checked: o.value,
754
- disabled: s.value,
755
- name: c.value,
756
- onChange: l
757
- }, null, 40, Tt), C("span", {
758
- "aria-hidden": "true",
759
- class: j(f.value)
760
- }, [o.value ? (P(), S("span", {
761
- key: 0,
762
- class: j(V(Y)("rounded-full bg-white", d[e.size]))
763
- }, null, 2)) : x("", !0)], 2)]), C("span", null, B(e.label), 1)], 10, Ct));
764
- }
765
- }), At = /* @__PURE__ */ E({
766
- name: "URadioGroup",
767
- __name: "radio-group",
768
- props: {
769
- modelValue: {},
770
- defaultValue: {},
771
- disabled: {
772
- type: Boolean,
773
- default: !1
774
- },
775
- name: {},
776
- orientation: { default: "vertical" },
777
- class: {}
778
- },
779
- emits: ["update:modelValue", "change"],
780
- setup(e, { emit: t }) {
781
- let n = e, r = t, i = y(() => n.modelValue !== void 0), a = I(n.defaultValue), o = y(() => i.value ? n.modelValue : a.value);
782
- function s(e) {
783
- i.value || (a.value = e), r("update:modelValue", e), r("change", e);
784
- }
785
- F(St, {
786
- value: o,
787
- onValueChange: s,
788
- name: y(() => n.name),
789
- disabled: y(() => n.disabled)
790
- });
791
- let c = y(() => Y("flex", n.orientation === "vertical" ? "flex-col gap-2" : "flex-row flex-wrap gap-4", n.class));
792
- return (e, t) => (P(), S("div", {
793
- role: "radiogroup",
794
- class: j(c.value)
795
- }, [R(e.$slots, "default")], 2));
796
- }
797
- }), jt = {
798
- key: 0,
799
- class: "self-start text-xs font-medium text-text-primary"
800
- }, Mt = { class: "relative flex h-5 w-full items-center" }, Nt = { class: "pointer-events-none absolute h-1.5 w-full overflow-hidden rounded-full bg-surface-3" }, Pt = [
801
- "min",
802
- "max",
803
- "step",
804
- "value",
805
- "disabled"
806
- ], Ft = /* @__PURE__ */ E({
807
- name: "USlider",
808
- __name: "slider",
809
- props: {
810
- modelValue: {},
811
- defaultValue: { default: 0 },
812
- min: { default: 0 },
813
- max: { default: 100 },
814
- step: { default: 1 },
815
- disabled: {
816
- type: Boolean,
817
- default: !1
818
- },
819
- showValue: {
820
- type: Boolean,
821
- default: !1
822
- },
823
- class: {}
824
- },
825
- emits: ["update:modelValue", "change"],
826
- setup(e, { emit: t }) {
827
- let n = e, r = t, i = y(() => n.modelValue !== void 0), a = I(n.defaultValue), o = y(() => i.value ? n.modelValue : a.value), s = y(() => {
828
- let e = n.max - n.min;
829
- return e === 0 ? 0 : (o.value - n.min) / e * 100;
830
- });
831
- function c(e) {
832
- let t = Number(e.target.value);
833
- i.value || (a.value = t), r("update:modelValue", t), r("change", t);
834
- }
835
- let l = y(() => Y("flex flex-col gap-1", n.class));
836
- return (t, n) => (P(), S("div", { class: j(l.value) }, [e.showValue ? (P(), S("span", jt, B(o.value), 1)) : x("", !0), C("div", Mt, [C("div", Nt, [C("div", {
837
- class: "h-full rounded-full bg-primary transition-all",
838
- style: M({ width: `${s.value}%` })
839
- }, null, 4)]), C("input", {
840
- type: "range",
841
- min: e.min,
842
- max: e.max,
843
- step: e.step,
844
- value: o.value,
845
- disabled: e.disabled,
846
- class: j(V(Y)("relative h-5 w-full cursor-pointer appearance-none bg-transparent", "[&::-webkit-slider-thumb]:h-4 [&::-webkit-slider-thumb]:w-4 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-border-strong [&::-webkit-slider-thumb]:bg-surface-1 [&::-webkit-slider-thumb]:shadow-sm [&::-webkit-slider-thumb]:transition-transform [&::-webkit-slider-thumb]:hover:scale-110", "[&::-moz-range-thumb]:h-4 [&::-moz-range-thumb]:w-4 [&::-moz-range-thumb]:appearance-none [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-border-strong [&::-moz-range-thumb]:bg-surface-1 [&::-moz-range-thumb]:shadow-sm", "[&::-webkit-slider-runnable-track]:bg-transparent", "[&::-moz-range-track]:bg-transparent", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", "disabled:cursor-not-allowed disabled:opacity-50")),
847
- onInput: c,
848
- onChange: c
849
- }, null, 42, Pt)])], 2));
850
- }
851
- }), It = ["disabled"], Lt = [
852
- "value",
853
- "disabled",
854
- "placeholder",
855
- "min",
856
- "max",
857
- "step"
858
- ], Rt = ["disabled"], zt = "inline-flex shrink-0 items-center justify-center text-text-secondary transition-colors hover:bg-surface-3 hover:text-text-primary disabled:pointer-events-none disabled:opacity-40", Bt = /* @__PURE__ */ E({
859
- name: "UNumberInput",
860
- __name: "number-input",
861
- props: {
862
- modelValue: {},
863
- defaultValue: { default: 0 },
864
- min: {},
865
- max: {},
866
- step: { default: 1 },
867
- precision: { default: 0 },
868
- disabled: {
869
- type: Boolean,
870
- default: !1
871
- },
872
- placeholder: {},
873
- size: { default: "default" },
874
- class: {}
875
- },
876
- emits: ["update:modelValue", "change"],
877
- setup(e, { emit: t }) {
878
- let n = e, r = t, i = y(() => n.modelValue !== void 0), a = I(n.defaultValue), o = y(() => i.value ? n.modelValue : a.value);
879
- function s(e) {
880
- let t = e;
881
- return n.min !== void 0 && (t = Math.max(n.min, t)), n.max !== void 0 && (t = Math.min(n.max, t)), t;
882
- }
883
- function c(e) {
884
- let t = s(Number(e.toFixed(n.precision)));
885
- i.value || (a.value = t), r("update:modelValue", t), r("change", t);
886
- }
887
- function l() {
888
- n.disabled || c(o.value - n.step);
889
- }
890
- function u() {
891
- n.disabled || c(o.value + n.step);
892
- }
893
- function d(e) {
894
- let t = parseFloat(e.target.value);
895
- Number.isNaN(t) || c(t);
896
- }
897
- function f(e) {
898
- let t = parseFloat(e.target.value);
899
- Number.isNaN(t) || c(t);
900
- }
901
- let p = y(() => n.min !== void 0 && o.value <= n.min), m = y(() => n.max !== void 0 && o.value >= n.max), h = y(() => o.value.toFixed(n.precision)), g = {
902
- sm: "h-8 text-xs",
903
- default: "h-9 text-sm",
904
- lg: "h-11 text-base"
905
- }, _ = {
906
- sm: "h-8 w-7",
907
- default: "h-9 w-8",
908
- lg: "h-11 w-9"
909
- }, v = {
910
- sm: 12,
911
- default: 14,
912
- lg: 16
913
- }, b = y(() => Y("inline-flex items-center rounded-md border border-border-strong bg-surface-1 transition-colors", "focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-1", n.disabled && "pointer-events-none opacity-50", g[n.size], n.class)), x = y(() => Y(zt, _[n.size]));
914
- return (t, n) => (P(), S("div", { class: j(b.value) }, [
915
- C("button", {
916
- type: "button",
917
- "aria-label": "减少数值",
918
- disabled: e.disabled || p.value,
919
- class: j(V(Y)(x.value, "rounded-l-md border-r border-border-base")),
920
- tabindex: "-1",
921
- onClick: l
922
- }, [T(V(q), { size: v[e.size] }, null, 8, ["size"])], 10, It),
923
- C("input", {
924
- type: "number",
925
- value: h.value,
926
- disabled: e.disabled,
927
- placeholder: e.placeholder,
928
- min: e.min,
929
- max: e.max,
930
- step: e.step,
931
- class: "min-w-0 flex-1 bg-transparent text-center text-text-primary outline-none placeholder:text-text-tertiary [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
932
- onInput: d,
933
- onBlur: f
934
- }, null, 40, Lt),
935
- C("button", {
936
- type: "button",
937
- "aria-label": "增加数值",
938
- disabled: e.disabled || m.value,
939
- class: j(V(Y)(x.value, "rounded-r-md border-l border-border-base")),
940
- tabindex: "-1",
941
- onClick: u
942
- }, [T(V(de), { size: v[e.size] }, null, 8, ["size"])], 10, Rt)
943
- ], 2));
944
- }
945
- }), Vt = [
946
- "value",
947
- "disabled",
948
- "aria-label",
949
- "onInput",
950
- "onKeydown"
951
- ], Ht = /* @__PURE__ */ E({
952
- name: "UOTPInput",
953
- __name: "otp-input",
954
- props: /* @__PURE__ */ k({
955
- length: { default: 6 },
956
- disabled: {
957
- type: Boolean,
958
- default: !1
959
- },
960
- class: { default: void 0 }
961
- }, {
962
- modelValue: { default: "" },
963
- modelModifiers: {}
964
- }),
965
- emits: /* @__PURE__ */ k(["complete"], ["update:modelValue"]),
966
- setup(e, { emit: t }) {
967
- let n = e, r = t, i = U(e, "modelValue"), a = I([]), o = y(() => {
968
- let e = i.value.split("").slice(0, n.length);
969
- for (; e.length < n.length;) e.push("");
970
- return e;
971
- });
972
- function s(e) {
973
- A(() => {
974
- let t = a.value[e];
975
- t && (t.focus(), t.setSelectionRange(t.value.length, t.value.length));
976
- });
977
- }
978
- function c(e, t) {
979
- let a = o.value.slice();
980
- a[e] = t;
981
- let s = a.join("");
982
- i.value = s, s.replace(/\s/g, "").length === n.length && !s.includes("") && r("complete", s);
983
- }
984
- function l(e, t) {
985
- let r = t.target, i = r.value.replace(/\D/g, "").slice(-1);
986
- r.value = i, c(e, i), i && e < n.length - 1 && s(e + 1);
987
- }
988
- function u(e, t) {
989
- t.key === "ArrowLeft" ? (t.preventDefault(), e > 0 && s(e - 1)) : t.key === "ArrowRight" ? (t.preventDefault(), e < n.length - 1 && s(e + 1)) : t.key === "Backspace" && (t.preventDefault(), o.value[e] ?? "" ? c(e, "") : e > 0 && (c(e - 1, ""), s(e - 1)));
990
- }
991
- function d(e) {
992
- e.preventDefault();
993
- let t = (e.clipboardData?.getData("text") ?? "").replace(/\D/g, "").slice(0, n.length);
994
- if (!t) return;
995
- let a = t.padEnd(n.length, "").split("").slice(0, n.length).join("");
996
- i.value = a, s(Math.min(t.length, n.length - 1)), t.length === n.length && r("complete", a);
997
- }
998
- function f(e) {
999
- e.target.select();
1000
- }
1001
- let p = y(() => Y("flex items-center gap-2", n.class));
1002
- function m(e) {
1003
- return Y("h-10 w-10 rounded-md border text-center text-sm font-medium text-text-primary transition-colors", "outline-none focus:border-primary focus:ring-2 focus:ring-ring/20", "disabled:cursor-not-allowed disabled:opacity-50", e ? "border-border-strong" : "border-border-base");
1004
- }
1005
- return (t, n) => (P(), S("div", {
1006
- class: j(p.value),
1007
- role: "group",
1008
- "aria-label": "验证码输入"
1009
- }, [(P(!0), S(_, null, L(o.value, (t, n) => (P(), S("input", {
1010
- key: n,
1011
- ref_for: !0,
1012
- ref: (e) => {
1013
- a.value[n] = e;
1014
- },
1015
- type: "text",
1016
- inputmode: "numeric",
1017
- pattern: "[0-9]",
1018
- maxlength: 1,
1019
- value: t,
1020
- disabled: e.disabled,
1021
- "aria-label": `验证码第 ${n + 1} 位`,
1022
- class: j(m(t)),
1023
- onInput: (e) => l(n, e),
1024
- onKeydown: (e) => u(n, e),
1025
- onPaste: d,
1026
- onClick: f
1027
- }, null, 42, Vt))), 128))], 2));
1028
- }
1029
- }), Ut = Symbol("ug-form-field-context");
1030
- //#endregion
1031
- //#region src/components/form.vue?vue&type=script&setup=true&lang.ts
1032
- function Q() {
1033
- let e = O(Ut);
1034
- if (!e) throw Error("FormField 子组件必须在 <UFormField> 内使用");
1035
- return e;
1036
- }
1037
- var Wt = E({
1038
- name: "UFormField",
1039
- props: {
1040
- name: {
1041
- type: String,
1042
- required: !0
1043
- },
1044
- error: {
1045
- type: String,
1046
- default: void 0
1047
- },
1048
- class: {
1049
- type: String,
1050
- default: void 0
1051
- }
1052
- },
1053
- setup(e, { slots: t }) {
1054
- let n = H();
1055
- return F(Ut, {
1056
- name: y(() => e.name),
1057
- error: y(() => e.error),
1058
- id: y(() => `form-field-${n}`)
1059
- }), () => D("div", { class: Y(e.class) }, t.default?.());
1060
- }
1061
- }), Gt = E({
1062
- name: "UFormItem",
1063
- props: { class: {
1064
- type: String,
1065
- default: void 0
1066
- } },
1067
- setup(e, { slots: t }) {
1068
- let n = y(() => Y("flex flex-col gap-1.5", e.class));
1069
- return () => D("div", { class: n.value }, t.default?.());
1070
- }
1071
- }), Kt = E({
1072
- name: "UFormLabel",
1073
- props: {
1074
- required: {
1075
- type: Boolean,
1076
- default: !1
1077
- },
1078
- for: {
1079
- type: String,
1080
- default: void 0
1081
- },
1082
- class: {
1083
- type: String,
1084
- default: void 0
1085
- }
1086
- },
1087
- setup(e, { slots: t }) {
1088
- let n = Q(), r = y(() => Y("leading-none text-sm font-medium text-text-primary", e.class)), i = y(() => e.for ?? n.id.value);
1089
- return () => D("label", {
1090
- for: i.value,
1091
- class: r.value
1092
- }, [t.default?.(), e.required ? D("span", {
1093
- class: "ml-0.5 text-danger",
1094
- "aria-hidden": "true"
1095
- }, "*") : null]);
1096
- }
1097
- }), qt = E({
1098
- name: "UFormControl",
1099
- props: { class: {
1100
- type: String,
1101
- default: void 0
1102
- } },
1103
- setup(e, { slots: t }) {
1104
- let n = Q(), r = y(() => Y(e.class)), i = y(() => `${n.id.value}-description`), a = y(() => `${n.id.value}-message`), o = y(() => n.error.value ? `${i.value} ${a.value}` : i.value);
1105
- return () => D("div", {
1106
- id: n.id.value,
1107
- class: r.value || void 0,
1108
- "aria-describedby": o.value,
1109
- "aria-invalid": n.error.value ? "true" : void 0
1110
- }, t.default?.());
1111
- }
1112
- }), Jt = E({
1113
- name: "UFormDescription",
1114
- props: { class: {
1115
- type: String,
1116
- default: void 0
1117
- } },
1118
- setup(e, { slots: t }) {
1119
- let n = Q(), r = y(() => Y("text-xs text-text-secondary", e.class)), i = y(() => `${n.id.value}-description`);
1120
- return () => D("p", {
1121
- id: i.value,
1122
- class: r.value
1123
- }, t.default?.());
1124
- }
1125
- }), Yt = E({
1126
- name: "UFormMessage",
1127
- props: { class: {
1128
- type: String,
1129
- default: void 0
1130
- } },
1131
- setup(e, { slots: t }) {
1132
- let n = Q(), r = y(() => Y("text-xs text-danger-soft-fg", e.class)), i = y(() => `${n.id.value}-message`);
1133
- return () => {
1134
- let e = n.error.value, a = t.default?.(), o = a && a.length > 0;
1135
- return !e && !o ? null : D("p", {
1136
- id: i.value,
1137
- class: r.value,
1138
- role: "alert"
1139
- }, e ?? a);
1140
- };
1141
- }
1142
- }), Xt = /* @__PURE__ */ E({
1143
- name: "UForm",
1144
- __name: "form",
1145
- props: { class: { default: void 0 } },
1146
- emits: ["submit"],
1147
- setup(e, { emit: t }) {
1148
- let n = e, r = t, i = y(() => Y(n.class));
1149
- function a(e) {
1150
- r("submit", e);
1151
- }
1152
- return (e, t) => (P(), S("form", {
1153
- class: j(i.value),
1154
- onSubmit: G(a, ["prevent"])
1155
- }, [R(e.$slots, "default")], 34));
1156
- }
1157
- }), Zt = Symbol("ug-tabs-context");
1158
- //#endregion
1159
- //#region src/components/tabs.vue?vue&type=script&setup=true&lang.ts
1160
- function Qt() {
1161
- let e = O(Zt);
1162
- if (!e) throw Error("Tabs 子组件必须在 <UTabs> 内使用");
1163
- return e;
1164
- }
1165
- var $t = E({
1166
- name: "UTabsList",
1167
- props: { class: {
1168
- type: String,
1169
- default: void 0
1170
- } },
1171
- setup(e, { slots: t }) {
1172
- let n = y(() => Y("inline-flex w-full items-center gap-0 border-b border-border-base", e.class));
1173
- return () => D("div", {
1174
- role: "tablist",
1175
- class: n.value
1176
- }, t.default?.());
1177
- }
1178
- }), en = E({
1179
- name: "UTabsTrigger",
1180
- props: {
1181
- value: {
1182
- type: String,
1183
- required: !0
1184
- },
1185
- disabled: {
1186
- type: Boolean,
1187
- default: !1
1188
- },
1189
- class: {
1190
- type: String,
1191
- default: void 0
1192
- }
1193
- },
1194
- emits: { click: (e) => !0 },
1195
- setup(e, { emit: t, slots: n }) {
1196
- let r = Qt(), i = y(() => r.modelValue.value === e.value), a = y(() => Y("relative px-4 py-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/30 focus-visible:ring-offset-1 disabled:pointer-events-none disabled:opacity-50", "after:absolute after:bottom-0 after:left-0 after:h-0.5 after:w-full after:transition-colors", i.value ? "text-text-primary after:bg-primary" : "text-text-secondary hover:text-text-primary after:bg-transparent", e.class));
1197
- function o(n) {
1198
- e.disabled || (r.setValue(e.value), t("click", n));
1199
- }
1200
- return () => D("button", {
1201
- type: "button",
1202
- role: "tab",
1203
- "aria-selected": i.value,
1204
- tabindex: i.value ? 0 : -1,
1205
- disabled: e.disabled,
1206
- class: a.value,
1207
- onClick: o
1208
- }, n.default?.());
1209
- }
1210
- }), tn = E({
1211
- name: "UTabsContent",
1212
- props: {
1213
- value: {
1214
- type: String,
1215
- required: !0
1216
- },
1217
- class: {
1218
- type: String,
1219
- default: void 0
1220
- }
1221
- },
1222
- setup(e, { slots: t }) {
1223
- let n = Qt(), r = y(() => n.modelValue.value === e.value), i = y(() => Y("mt-4 focus-visible:outline-none", e.class));
1224
- return () => r.value ? D("div", {
1225
- role: "tabpanel",
1226
- tabindex: 0,
1227
- class: i.value
1228
- }, t.default?.()) : null;
1229
- }
1230
- }), nn = /* @__PURE__ */ E({
1231
- name: "UTabs",
1232
- __name: "tabs",
1233
- props: /* @__PURE__ */ k({ class: { default: void 0 } }, {
1234
- modelValue: { default: "" },
1235
- modelModifiers: {}
1236
- }),
1237
- emits: /* @__PURE__ */ k(["valueChange"], ["update:modelValue"]),
1238
- setup(e, { emit: t }) {
1239
- let n = e, r = U(e, "modelValue"), i = t, a = y(() => Y("w-full", n.class));
1240
- function o(e) {
1241
- r.value = e, i("valueChange", e);
1242
- }
1243
- return F(Zt, {
1244
- modelValue: r,
1245
- setValue: o
1246
- }), (e, t) => (P(), S("div", { class: j(a.value) }, [R(e.$slots, "default")], 2));
1247
- }
1248
- }), rn = Symbol("ug-accordion-context"), an = Symbol("ug-accordion-item-context");
1249
- //#endregion
1250
- //#region src/components/accordion.vue?vue&type=script&setup=true&lang.ts
1251
- function on() {
1252
- let e = O(rn);
1253
- if (!e) throw Error("Accordion 子组件必须在 <UAccordion> 内使用");
1254
- return e;
1255
- }
1256
- function sn() {
1257
- let e = O(an);
1258
- if (!e) throw Error("AccordionTrigger/AccordionContent 必须在 <UAccordionItem> 内使用");
1259
- return e;
1260
- }
1261
- var cn = E({
1262
- name: "UAccordionItem",
1263
- props: {
1264
- value: {
1265
- type: String,
1266
- required: !0
1267
- },
1268
- class: {
1269
- type: String,
1270
- default: void 0
1271
- }
1272
- },
1273
- setup(e, { slots: t }) {
1274
- let n = on(), r = y(() => n.type === "single" ? n.value.value === e.value : n.value.value.includes(e.value));
1275
- F(an, {
1276
- itemValue: e.value,
1277
- isOpen: r
1278
- });
1279
- let i = y(() => Y("", e.class));
1280
- return () => D("div", { class: i.value }, t.default?.());
1281
- }
1282
- }), ln = E({
1283
- name: "UAccordionTrigger",
1284
- props: { class: {
1285
- type: String,
1286
- default: void 0
1287
- } },
1288
- emits: { click: (e) => !0 },
1289
- setup(e, { emit: t, slots: n }) {
1290
- let r = on(), i = sn(), a = y(() => Y("flex w-full items-center justify-between px-4 py-3 text-left text-sm font-medium text-text-primary transition-colors hover:bg-surface-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/30 focus-visible:ring-inset", e.class)), o = y(() => Y("shrink-0 text-text-secondary transition-transform duration-200", i.isOpen.value ? "rotate-180" : ""));
1291
- function s(e) {
1292
- r.onValueChange(i.itemValue), t("click", e);
1293
- }
1294
- return () => D("button", {
1295
- type: "button",
1296
- "aria-expanded": i.isOpen.value,
1297
- class: a.value,
1298
- onClick: s
1299
- }, [...n.default?.() ?? [], D(oe, {
1300
- size: 16,
1301
- class: o.value
1302
- })]);
1303
- }
1304
- }), un = E({
1305
- name: "UAccordionContent",
1306
- props: { class: {
1307
- type: String,
1308
- default: void 0
1309
- } },
1310
- setup(e, { slots: t }) {
1311
- let n = sn(), r = y(() => Y("px-4 pb-4 pt-1 text-sm text-text-secondary", e.class));
1312
- return () => n.isOpen.value ? D("div", { class: r.value }, t.default?.()) : null;
1313
- }
1314
- }), dn = /* @__PURE__ */ E({
1315
- name: "UAccordion",
1316
- __name: "accordion",
1317
- props: {
1318
- type: { default: "single" },
1319
- modelValue: { default: void 0 },
1320
- defaultValue: { default: void 0 },
1321
- collapsible: {
1322
- type: Boolean,
1323
- default: !1
1324
- },
1325
- class: { default: void 0 }
1326
- },
1327
- emits: ["update:modelValue"],
1328
- setup(e, { emit: t }) {
1329
- let n = e, r = t, i = I(n.defaultValue === void 0 ? n.type === "multiple" ? [] : "" : n.defaultValue), a = y(() => n.modelValue !== void 0), o = y(() => a.value ? n.modelValue : i.value), s = y(() => Y("w-full divide-y divide-border-base rounded-md border border-border-base", n.class));
1330
- function c(e) {
1331
- if (n.type === "single") {
1332
- let t = o.value === e && n.collapsible ? "" : e;
1333
- a.value || (i.value = t), r("update:modelValue", t);
1334
- } else {
1335
- let t = o.value, n = t.includes(e) ? t.filter((t) => t !== e) : [...t, e];
1336
- a.value || (i.value = n), r("update:modelValue", n);
1337
- }
1338
- }
1339
- return F(rn, {
1340
- type: n.type,
1341
- value: o,
1342
- onValueChange: c,
1343
- collapsible: n.collapsible
1344
- }), (e, t) => (P(), S("div", { class: j(s.value) }, [R(e.$slots, "default")], 2));
1345
- }
1346
- }), fn = { key: 1 }, pn = /* @__PURE__ */ E({
1347
- __name: "steps",
1348
- props: {
1349
- current: {},
1350
- items: {},
1351
- direction: { default: "horizontal" },
1352
- status: { default: "process" },
1353
- class: {}
1354
- },
1355
- setup(e) {
1356
- let t = e, n = {
1357
- horizontal: "flex items-start",
1358
- vertical: "flex flex-col"
1359
- }, r = y(() => Y(n[t.direction], t.class)), i = y(() => t.direction === "horizontal");
1360
- function a(e) {
1361
- return e < t.current || e === t.current && t.status === "finish";
1362
- }
1363
- function o(e) {
1364
- return e === t.current && t.status !== "finish";
1365
- }
1366
- function s(e) {
1367
- return e === t.current && t.status === "error";
1368
- }
1369
- function c(e) {
1370
- return a(e) ? "border-primary bg-primary text-primary-fg" : s(e) ? "border-red-500 bg-surface-1 text-red-500" : o(e) ? "border-primary bg-surface-1 text-text-primary" : "border-border-strong bg-surface-1 text-text-tertiary";
1371
- }
1372
- function l(e) {
1373
- return s(e) ? "text-red-500" : a(e) || o(e) ? "text-text-primary" : "text-text-tertiary";
1374
- }
1375
- function u(e) {
1376
- return a(e) ? "bg-primary" : "bg-border-base";
1377
- }
1378
- return (t, n) => (P(), S("div", { class: j(r.value) }, [(P(!0), S(_, null, L(e.items, (t, n) => (P(), S("div", {
1379
- key: n,
1380
- class: j(V(Y)(i.value ? "flex flex-1 items-start" : "flex items-start"))
1381
- }, [
1382
- C("div", { class: j(V(Y)("flex", i.value ? "flex-col items-center" : "items-start")) }, [C("div", { class: j(V(Y)("flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 text-sm font-semibold transition-colors", c(n))) }, [a(n) ? (P(), b(V(K), {
1383
- key: 0,
1384
- size: 16,
1385
- "stroke-width": 2.5
1386
- })) : (P(), S("span", fn, B(n + 1), 1))], 2), !i.value && n < e.items.length - 1 ? (P(), S("div", {
1387
- key: 0,
1388
- class: j(V(Y)("ml-[15px] mt-1 w-0.5 flex-1 self-stretch", u(n))),
1389
- style: { "min-height": "24px" }
1390
- }, null, 2)) : x("", !0)], 2),
1391
- C("div", { class: j(V(Y)(i.value ? "mt-2 text-center" : "ml-3", !i.value && n < e.items.length - 1 ? "pb-6" : "")) }, [C("p", { class: j(V(Y)("text-sm font-medium", l(n))) }, B(t.title), 3), t.description ? (P(), S("p", {
1392
- key: 0,
1393
- class: j(V(Y)("mt-0.5 text-xs", s(n) ? "text-red-400" : "text-text-secondary"))
1394
- }, B(t.description), 3)) : x("", !0)], 2),
1395
- i.value && n < e.items.length - 1 ? (P(), S("div", {
1396
- key: 0,
1397
- class: j(V(Y)("mx-2 mt-4 h-0.5 flex-1", u(n)))
1398
- }, null, 2)) : x("", !0)
1399
- ], 2))), 128))], 2));
1400
- }
1401
- }), mn = Symbol("ug-dropdown-context");
1402
- //#endregion
1403
- //#region src/components/dropdown.vue?vue&type=script&setup=true&lang.ts
1404
- function hn() {
1405
- let e = O(mn);
1406
- if (!e) throw Error("Dropdown 子组件必须在 <UDropdown> 内使用");
1407
- return e;
1408
- }
1409
- var gn = E({
1410
- name: "UDropdownTrigger",
1411
- props: { class: {
1412
- type: String,
1413
- default: void 0
1414
- } },
1415
- emits: { click: (e) => !0 },
1416
- setup(e, { emit: t, slots: n }) {
1417
- let r = hn(), i = y(() => Y("inline-flex", e.class));
1418
- function a(e) {
1419
- r.triggerRef.value = e;
1420
- }
1421
- function o(e) {
1422
- r.toggleOpen(), t("click", e);
1423
- }
1424
- return () => D("span", {
1425
- class: i.value,
1426
- onClick: o,
1427
- onVnodeMounted(e) {
1428
- a(e.el);
1429
- },
1430
- onVnodeUpdated(e) {
1431
- a(e.el);
1432
- }
1433
- }, n.default?.());
1434
- }
1435
- }), _n = E({
1436
- name: "UDropdownContent",
1437
- props: {
1438
- align: {
1439
- type: String,
1440
- default: "start"
1441
- },
1442
- class: {
1443
- type: String,
1444
- default: void 0
1445
- }
1446
- },
1447
- setup(e, { slots: t }) {
1448
- let n = hn(), r = I(null), i = I({
1449
- top: 0,
1450
- left: 0
1451
- }), a = y(() => Y("absolute z-50 min-w-40 rounded-md border border-border-base bg-surface-1 py-1 shadow-lg", e.class));
1452
- function o() {
1453
- if (!n.triggerRef.value || typeof window > "u") return;
1454
- let t = n.triggerRef.value.getBoundingClientRect(), a = r.value?.offsetWidth ?? 0;
1455
- i.value = {
1456
- top: t.bottom + window.scrollY + 4,
1457
- left: e.align === "end" ? t.right + window.scrollX - a : t.left + window.scrollX
1458
- };
1459
- }
1460
- function s(e) {
1461
- let t = e.target;
1462
- r.value?.contains(t) || n.triggerRef.value?.contains(t) || n.setOpen(!1);
1463
- }
1464
- function c() {
1465
- window.addEventListener("resize", o), window.addEventListener("scroll", o, !0), document.addEventListener("mousedown", s);
1466
- }
1467
- function l() {
1468
- window.removeEventListener("resize", o), window.removeEventListener("scroll", o, !0), document.removeEventListener("mousedown", s);
1469
- }
1470
- return W(() => n.open.value, async (e) => {
1471
- l(), !(!e || typeof window > "u") && (await A(), o(), c());
1472
- }, { immediate: !0 }), N(() => {
1473
- l();
1474
- }), () => n.open.value ? D(v, { to: "body" }, [D("div", {
1475
- ref: r,
1476
- class: a.value,
1477
- style: {
1478
- top: `${i.value.top}px`,
1479
- left: `${i.value.left}px`
1480
- }
1481
- }, t.default?.())]) : null;
1482
- }
1483
- }), vn = E({
1484
- name: "UDropdownItem",
1485
- props: {
1486
- destructive: {
1487
- type: Boolean,
1488
- default: !1
1489
- },
1490
- disabled: {
1491
- type: Boolean,
1492
- default: !1
1493
- },
1494
- class: {
1495
- type: String,
1496
- default: void 0
1497
- }
1498
- },
1499
- emits: { click: (e) => !0 },
1500
- setup(e, { emit: t, slots: n }) {
1501
- let r = hn(), i = y(() => Y("w-full px-3 py-1.5 text-left text-sm transition-colors focus-visible:bg-surface-3 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50", e.destructive ? "text-red-600 hover:bg-red-50" : "text-text-primary hover:bg-surface-3", e.class));
1502
- function a(n) {
1503
- e.disabled || (r.setOpen(!1), t("click", n));
1504
- }
1505
- return () => D("button", {
1506
- type: "button",
1507
- disabled: e.disabled,
1508
- class: i.value,
1509
- onClick: a
1510
- }, n.default?.());
1511
- }
1512
- }), yn = E({
1513
- name: "UDropdownSeparator",
1514
- props: { class: {
1515
- type: String,
1516
- default: void 0
1517
- } },
1518
- setup(e, { attrs: t }) {
1519
- let n = y(() => Y("my-1 h-px bg-border-base", e.class));
1520
- return () => D("div", {
1521
- ...t,
1522
- class: n.value
1523
- });
1524
- }
1525
- }), bn = /* @__PURE__ */ E({
1526
- name: "UDropdown",
1527
- __name: "dropdown",
1528
- props: /* @__PURE__ */ k({ class: { default: void 0 } }, {
1529
- open: {
1530
- type: Boolean,
1531
- default: !1
1532
- },
1533
- openModifiers: {}
1534
- }),
1535
- emits: /* @__PURE__ */ k(["openChange"], ["update:open"]),
1536
- setup(e, { emit: t }) {
1537
- let n = e, r = U(e, "open"), i = t, a = I(null), o = y(() => Y("relative inline-block", n.class));
1538
- function s(e) {
1539
- r.value = e, i("openChange", e);
1540
- }
1541
- function c() {
1542
- s(!r.value);
1543
- }
1544
- return F(mn, {
1545
- open: r,
1546
- triggerRef: a,
1547
- setOpen: s,
1548
- toggleOpen: c
1549
- }), (e, t) => (P(), S("div", { class: j(o.value) }, [R(e.$slots, "default")], 2));
1550
- }
1551
- }), xn = Symbol("ug-popover-context");
1552
- //#endregion
1553
- //#region src/components/popover.vue?vue&type=script&setup=true&lang.ts
1554
- function Sn() {
1555
- let e = O(xn);
1556
- if (!e) throw Error("Popover 子组件必须在 <UPopover> 内使用");
1557
- return e;
1558
- }
1559
- function Cn(e, t, n, r, i) {
1560
- let a = t.offsetWidth, o = t.offsetHeight, s = 0, c = 0;
1561
- return n === "left" ? (s = e.top + window.scrollY + e.height / 2 - o / 2, c = e.left + window.scrollX - a - i, {
1562
- top: s,
1563
- left: c
1564
- }) : n === "right" ? (s = e.top + window.scrollY + e.height / 2 - o / 2, c = e.right + window.scrollX + i, {
1565
- top: s,
1566
- left: c
1567
- }) : (s = n === "top" ? e.top + window.scrollY - o - i : e.bottom + window.scrollY + i, c = r === "start" ? e.left + window.scrollX : r === "end" ? e.right + window.scrollX - a : e.left + window.scrollX + e.width / 2 - a / 2, {
1568
- top: s,
1569
- left: c
1570
- });
1571
- }
1572
- var wn = E({
1573
- name: "UPopoverTrigger",
1574
- props: { class: {
1575
- type: String,
1576
- default: void 0
1577
- } },
1578
- emits: { click: (e) => !0 },
1579
- setup(e, { emit: t, slots: n }) {
1580
- let r = Sn(), i = y(() => Y("inline-flex", e.class));
1581
- function a(e) {
1582
- r.triggerRef.value = e;
1583
- }
1584
- function o(e) {
1585
- r.toggleOpen(), t("click", e);
1586
- }
1587
- return () => D("span", {
1588
- class: i.value,
1589
- onClick: o,
1590
- onVnodeMounted(e) {
1591
- a(e.el);
1592
- },
1593
- onVnodeUpdated(e) {
1594
- a(e.el);
1595
- }
1596
- }, n.default?.());
1597
- }
1598
- }), Tn = E({
1599
- name: "UPopoverContent",
1600
- props: {
1601
- side: {
1602
- type: String,
1603
- default: "bottom"
1604
- },
1605
- align: {
1606
- type: String,
1607
- default: "center"
1608
- },
1609
- sideOffset: {
1610
- type: Number,
1611
- default: 4
1612
- },
1613
- class: {
1614
- type: String,
1615
- default: void 0
1616
- }
1617
- },
1618
- setup(e, { slots: t }) {
1619
- let n = Sn(), r = I(null), i = I({
1620
- top: 0,
1621
- left: 0
1622
- }), a = y(() => Y("absolute z-50 min-w-40 rounded-md border border-border-base bg-surface-1 p-3 shadow-lg", e.class));
1623
- function o() {
1624
- !n.triggerRef.value || !r.value || typeof window > "u" || (i.value = Cn(n.triggerRef.value.getBoundingClientRect(), r.value, e.side, e.align, e.sideOffset));
1625
- }
1626
- function s(e) {
1627
- let t = e.target;
1628
- r.value?.contains(t) || n.triggerRef.value?.contains(t) || n.setOpen(!1);
1629
- }
1630
- function c() {
1631
- window.addEventListener("resize", o), window.addEventListener("scroll", o, !0), document.addEventListener("mousedown", s);
1632
- }
1633
- function l() {
1634
- window.removeEventListener("resize", o), window.removeEventListener("scroll", o, !0), document.removeEventListener("mousedown", s);
1635
- }
1636
- return W(() => n.open.value, async (e) => {
1637
- l(), !(!e || typeof window > "u") && (await A(), o(), c());
1638
- }, { immediate: !0 }), N(() => {
1639
- l();
1640
- }), () => n.open.value ? D(v, { to: "body" }, [D("div", {
1641
- ref: r,
1642
- class: a.value,
1643
- style: {
1644
- top: `${i.value.top}px`,
1645
- left: `${i.value.left}px`
1646
- }
1647
- }, t.default?.())]) : null;
1648
- }
1649
- }), En = /* @__PURE__ */ E({
1650
- name: "UPopover",
1651
- __name: "popover",
1652
- props: /* @__PURE__ */ k({ class: { default: void 0 } }, {
1653
- open: {
1654
- type: Boolean,
1655
- default: !1
1656
- },
1657
- openModifiers: {}
1658
- }),
1659
- emits: /* @__PURE__ */ k(["openChange"], ["update:open"]),
1660
- setup(e, { emit: t }) {
1661
- let n = t, r = U(e, "open"), i = I(null);
1662
- function a(e) {
1663
- r.value = e, n("openChange", e);
1664
- }
1665
- function o() {
1666
- a(!r.value);
1667
- }
1668
- return F(xn, {
1669
- open: r,
1670
- triggerRef: i,
1671
- setOpen: a,
1672
- toggleOpen: o
1673
- }), (e, t) => R(e.$slots, "default");
1674
- }
1675
- }), Dn = Symbol("ug-context-menu-context");
1676
- //#endregion
1677
- //#region src/components/context-menu.vue?vue&type=script&setup=true&lang.ts
1678
- function On() {
1679
- let e = O(Dn);
1680
- if (!e) throw Error("ContextMenu 子组件必须在 <UContextMenu> 内使用");
1681
- return e;
1682
- }
1683
- var kn = E({
1684
- name: "UContextMenuTrigger",
1685
- props: { class: {
1686
- type: String,
1687
- default: void 0
1688
- } },
1689
- setup(e, { slots: t }) {
1690
- let n = On(), r = y(() => Y(e.class));
1691
- function i(e) {
1692
- e.preventDefault(), n.openAt({
1693
- x: e.clientX,
1694
- y: e.clientY
1695
- });
1696
- }
1697
- return () => D("div", {
1698
- class: r.value || void 0,
1699
- onContextmenu: i
1700
- }, t.default?.());
1701
- }
1702
- }), An = E({
1703
- name: "UContextMenuContent",
1704
- props: { class: {
1705
- type: String,
1706
- default: void 0
1707
- } },
1708
- setup(e, { slots: t }) {
1709
- let n = On(), r = I(null), i = y(() => Y("fixed z-50 min-w-40 rounded-md border border-border-base bg-surface-1 py-1 shadow-lg", e.class));
1710
- function a(e) {
1711
- r.value && !r.value.contains(e.target) && n.setOpen(!1);
1712
- }
1713
- function o(e) {
1714
- e.key === "Escape" && n.setOpen(!1);
1715
- }
1716
- function s() {
1717
- document.addEventListener("mousedown", a), document.addEventListener("keydown", o);
1718
- }
1719
- function c() {
1720
- document.removeEventListener("mousedown", a), document.removeEventListener("keydown", o);
1721
- }
1722
- return W(() => n.open.value, (e) => {
1723
- c(), e && s();
1724
- }, { immediate: !0 }), N(() => {
1725
- c();
1726
- }), () => n.open.value ? D(v, { to: "body" }, [D("div", {
1727
- ref: r,
1728
- class: i.value,
1729
- style: {
1730
- top: `${n.position.value.y}px`,
1731
- left: `${n.position.value.x}px`
1732
- }
1733
- }, t.default?.())]) : null;
1734
- }
1735
- }), jn = E({
1736
- name: "UContextMenuItem",
1737
- props: {
1738
- destructive: {
1739
- type: Boolean,
1740
- default: !1
1741
- },
1742
- disabled: {
1743
- type: Boolean,
1744
- default: !1
1745
- },
1746
- class: {
1747
- type: String,
1748
- default: void 0
1749
- }
1750
- },
1751
- emits: { click: (e) => !0 },
1752
- setup(e, { emit: t, slots: n }) {
1753
- let r = On(), i = y(() => Y("w-full px-3 py-1.5 text-left text-sm transition-colors focus-visible:bg-surface-3 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50", e.destructive ? "text-red-600 hover:bg-red-50" : "text-text-primary hover:bg-surface-3", e.class));
1754
- function a(n) {
1755
- e.disabled || (r.setOpen(!1), t("click", n));
1756
- }
1757
- return () => D("button", {
1758
- type: "button",
1759
- disabled: e.disabled,
1760
- class: i.value,
1761
- onClick: a
1762
- }, n.default?.());
1763
- }
1764
- }), Mn = E({
1765
- name: "UContextMenuSeparator",
1766
- props: { class: {
1767
- type: String,
1768
- default: void 0
1769
- } },
1770
- setup(e) {
1771
- let t = y(() => Y("my-1 h-px bg-border-base", e.class));
1772
- return () => D("div", { class: t.value });
1773
- }
1774
- }), Nn = /* @__PURE__ */ E({
1775
- name: "UContextMenu",
1776
- __name: "context-menu",
1777
- props: { class: { default: void 0 } },
1778
- setup(e) {
1779
- let t = e, n = I(!1), r = I({
1780
- x: 0,
1781
- y: 0
1782
- }), i = y(() => Y("relative", t.class));
1783
- function a(e) {
1784
- n.value = e;
1785
- }
1786
- function o(e) {
1787
- r.value = e, n.value = !0;
1788
- }
1789
- return F(Dn, {
1790
- open: n,
1791
- position: r,
1792
- setOpen: a,
1793
- openAt: o
1794
- }), (e, t) => (P(), S("div", { class: j(i.value) }, [R(e.$slots, "default")], 2));
1795
- }
1796
- }), Pn = Symbol("ug-navigation-menu-context"), Fn = Symbol("ug-navigation-menu-item-context");
1797
- //#endregion
1798
- //#region src/components/navigation-menu.vue?vue&type=script&setup=true&lang.ts
1799
- function In() {
1800
- let e = O(Pn);
1801
- if (!e) throw Error("NavigationMenu 子组件必须在 <UNavigationMenu> 内使用");
1802
- return e;
1803
- }
1804
- function Ln() {
1805
- let e = O(Fn);
1806
- if (!e) throw Error("UNavigationMenuTrigger/UNavigationMenuContent 必须在 <UNavigationMenuItem> 内使用");
1807
- return e;
1808
- }
1809
- var Rn = 0, zn = E({
1810
- name: "UNavigationMenuItem",
1811
- props: { class: {
1812
- type: String,
1813
- default: void 0
1814
- } },
1815
- setup(e, { slots: t }) {
1816
- let n = `nav-item-${++Rn}`, r = In(), i = y(() => r.activeItem.value === n), a = y(() => Y("relative", e.class));
1817
- F(Fn, { itemId: n });
1818
- function o() {
1819
- r.setActiveItem(n);
1820
- }
1821
- function s() {
1822
- r.setActiveItem(null);
1823
- }
1824
- return () => D("div", {
1825
- class: a.value,
1826
- "data-state": i.value ? "open" : "closed",
1827
- onMouseenter: o,
1828
- onMouseleave: s
1829
- }, t.default?.());
1830
- }
1831
- }), Bn = E({
1832
- name: "UNavigationMenuLink",
1833
- props: {
1834
- href: {
1835
- type: String,
1836
- default: void 0
1837
- },
1838
- active: {
1839
- type: Boolean,
1840
- default: !1
1841
- },
1842
- class: {
1843
- type: String,
1844
- default: void 0
1845
- }
1846
- },
1847
- setup(e, { slots: t }) {
1848
- let n = y(() => Y("inline-flex items-center rounded-md px-3 py-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/30 focus-visible:ring-offset-1", e.active ? "bg-surface-3 text-text-primary" : "text-text-secondary hover:bg-surface-3 hover:text-text-primary", e.class));
1849
- return () => D("a", {
1850
- href: e.href,
1851
- class: n.value
1852
- }, t.default?.());
1853
- }
1854
- }), Vn = E({
1855
- name: "UNavigationMenuTrigger",
1856
- props: { class: {
1857
- type: String,
1858
- default: void 0
1859
- } },
1860
- setup(e, { slots: t }) {
1861
- let n = In(), r = Ln(), i = y(() => n.activeItem.value === r.itemId), a = y(() => Y("inline-flex items-center gap-1 rounded-md px-3 py-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/30 focus-visible:ring-offset-1", i.value ? "bg-surface-3 text-text-primary" : "text-text-secondary hover:bg-surface-3 hover:text-text-primary", e.class)), o = y(() => Y("transition-transform duration-200", i.value ? "rotate-180" : ""));
1862
- return () => D("button", {
1863
- type: "button",
1864
- "aria-expanded": i.value,
1865
- class: a.value
1866
- }, [t.default?.(), D(oe, {
1867
- size: 14,
1868
- class: o.value
1869
- })]);
1870
- }
1871
- }), Hn = E({
1872
- name: "UNavigationMenuContent",
1873
- props: { class: {
1874
- type: String,
1875
- default: void 0
1876
- } },
1877
- setup(e, { slots: t }) {
1878
- let n = In(), r = Ln(), i = y(() => n.activeItem.value === r.itemId), a = y(() => Y("absolute left-0 top-full z-50 mt-1 min-w-40 rounded-md border border-border-base bg-surface-1 py-1 shadow-lg", e.class));
1879
- return () => i.value ? D("div", { class: a.value }, t.default?.()) : null;
1880
- }
1881
- }), Un = /* @__PURE__ */ E({
1882
- name: "UNavigationMenu",
1883
- __name: "navigation-menu",
1884
- props: { class: { default: void 0 } },
1885
- setup(e) {
1886
- let t = e, n = I(null), r = y(() => Y("relative flex items-center gap-1", t.class));
1887
- function i(e) {
1888
- n.value = e;
1889
- }
1890
- return F(Pn, {
1891
- activeItem: n,
1892
- setActiveItem: i
1893
- }), (e, t) => (P(), S("nav", { class: j(r.value) }, [R(e.$slots, "default")], 2));
1894
- }
1895
- }), Wn = Symbol("AvatarContext");
1896
- //#endregion
1897
- //#region src/components/avatar.vue?vue&type=script&setup=true&lang.ts
1898
- function Gn(e) {
1899
- let t = O(Wn);
1900
- if (!t) throw Error(`<${e}> 必须在 <UAvatar> 内使用`);
1901
- return t;
1902
- }
1903
- var Kn = E({
1904
- name: "UAvatarImage",
1905
- inheritAttrs: !1,
1906
- props: {
1907
- src: {
1908
- type: String,
1909
- required: !0
1910
- },
1911
- alt: {
1912
- type: String,
1913
- default: ""
1914
- },
1915
- class: {
1916
- type: String,
1917
- default: void 0
1918
- }
1919
- },
1920
- emits: {
1921
- error: (e) => !0,
1922
- load: (e) => !0
1923
- },
1924
- setup(e, { attrs: t, emit: n }) {
1925
- let r = Gn("UAvatarImage");
1926
- W(() => e.src, (e) => {
1927
- r.setImageLoadingStatus(e ? "loading" : "error");
1928
- }, { immediate: !0 });
1929
- function i(e) {
1930
- r.setImageLoadingStatus("error"), n("error", e);
1931
- }
1932
- function a(e) {
1933
- r.setImageLoadingStatus("loaded"), n("load", e);
1934
- }
1935
- return () => {
1936
- let n = r.imageLoadingStatus.value;
1937
- return n !== "loaded" && n !== "loading" ? null : D("img", {
1938
- ...t,
1939
- src: e.src,
1940
- alt: e.alt,
1941
- class: Y("h-full w-full object-cover", n === "loading" && "invisible", e.class),
1942
- onError: i,
1943
- onLoad: a
1944
- });
1945
- };
1946
- }
1947
- }), qn = E({
1948
- name: "UAvatarFallback",
1949
- props: { class: {
1950
- type: String,
1951
- default: void 0
1952
- } },
1953
- setup(e, { attrs: t, slots: n }) {
1954
- let r = Gn("UAvatarFallback"), i = y(() => Y("absolute inset-0 flex items-center justify-center font-medium text-text-secondary", e.class));
1955
- return () => r.imageLoadingStatus.value === "loaded" ? null : D("span", {
1956
- ...t,
1957
- class: i.value
1958
- }, n.default?.() ?? [D(me, { size: 16 })]);
1959
- }
1960
- }), Jn = /* @__PURE__ */ E({
1961
- name: "UAvatar",
1962
- __name: "avatar",
1963
- props: {
1964
- size: { default: "md" },
1965
- class: { default: void 0 }
1966
- },
1967
- setup(e) {
1968
- let t = e, n = {
1969
- sm: "h-8 w-8 text-xs",
1970
- md: "h-10 w-10 text-sm",
1971
- lg: "h-14 w-14 text-base",
1972
- xl: "h-20 w-20 text-xl"
1973
- }, r = y(() => Y("relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-surface-3", n[t.size], t.class)), i = I("idle");
1974
- return F(Wn, {
1975
- imageLoadingStatus: i,
1976
- setImageLoadingStatus: (e) => {
1977
- i.value = e;
1978
- }
1979
- }), (e, t) => (P(), S("span", { class: j(r.value) }, [R(e.$slots, "default")], 2));
1980
- }
1981
- }), Yn = [
1982
- "src",
1983
- "alt",
1984
- "onError"
1985
- ], Xn = {
1986
- key: 1,
1987
- class: "flex h-full w-full items-center justify-center font-medium text-text-secondary"
1988
- }, Zn = ["aria-label"], Qn = /* @__PURE__ */ E({
1989
- name: "UAvatarGroup",
1990
- __name: "avatar-group",
1991
- props: {
1992
- items: {},
1993
- max: { default: 5 },
1994
- size: { default: "default" },
1995
- class: { default: void 0 }
1996
- },
1997
- setup(e) {
1998
- let t = e, n = {
1999
- sm: "h-8 w-8 text-xs",
2000
- default: "h-10 w-10 text-sm",
2001
- lg: "h-14 w-14 text-base"
2002
- }, r = {
2003
- sm: "ring-2",
2004
- default: "ring-2",
2005
- lg: "ring-[3px]"
2006
- }, i = {
2007
- sm: "-ml-2",
2008
- default: "-ml-3",
2009
- lg: "-ml-4"
2010
- }, a = y(() => t.items.slice(0, t.max)), o = y(() => Math.max(0, t.items.length - t.max)), s = y(() => Y("flex items-center", t.class));
2011
- function c(e) {
2012
- return Y("relative inline-flex shrink-0 overflow-hidden rounded-full bg-surface-3 ring-surface-1", n[t.size], r[t.size], e > 0 && i[t.size]);
2013
- }
2014
- let l = y(() => Y("relative inline-flex shrink-0 items-center justify-center rounded-full bg-surface-3 font-medium text-text-secondary ring-surface-1", n[t.size], r[t.size], i[t.size])), u = /* @__PURE__ */ new Map();
2015
- function d(e) {
2016
- u.set(e, !0);
2017
- }
2018
- return (e, t) => (P(), S("div", { class: j(s.value) }, [(P(!0), S(_, null, L(a.value, (e, t) => (P(), S("span", {
2019
- key: t,
2020
- class: j(c(t))
2021
- }, [e.src && !V(u).get(t) ? (P(), S("img", {
2022
- key: 0,
2023
- src: e.src,
2024
- alt: e.alt ?? "",
2025
- class: "h-full w-full object-cover",
2026
- onError: (e) => d(t)
2027
- }, null, 40, Yn)) : (P(), S("span", Xn, [e.fallback ? (P(), S(_, { key: 0 }, [w(B(e.fallback), 1)], 64)) : (P(), b(V(me), {
2028
- key: 1,
2029
- size: 16
2030
- }))]))], 2))), 128)), o.value > 0 ? (P(), S("span", {
2031
- key: 0,
2032
- class: j(l.value),
2033
- "aria-label": `还有 ${o.value} 人`
2034
- }, " +" + B(o.value), 11, Zn)) : x("", !0)], 2));
2035
- }
2036
- }), $n = Symbol("ug-tooltip-context");
2037
- //#endregion
2038
- //#region src/components/tooltip.vue?vue&type=script&setup=true&lang.ts
2039
- function er() {
2040
- let e = O($n);
2041
- if (!e) throw Error("Tooltip 子组件必须在 <UTooltip> 内使用");
2042
- return e;
2043
- }
2044
- var tr = {
2045
- top: "after:absolute after:left-1/2 after:top-full after:-translate-x-1/2 after:border-4 after:border-transparent after:border-t-text-primary",
2046
- bottom: "after:absolute after:bottom-full after:left-1/2 after:-translate-x-1/2 after:border-4 after:border-transparent after:border-b-text-primary",
2047
- left: "after:absolute after:left-full after:top-1/2 after:-translate-y-1/2 after:border-4 after:border-transparent after:border-l-text-primary",
2048
- right: "after:absolute after:right-full after:top-1/2 after:-translate-y-1/2 after:border-4 after:border-transparent after:border-r-text-primary"
2049
- }, nr = E({
2050
- name: "UTooltipTrigger",
2051
- props: { class: {
2052
- type: String,
2053
- default: void 0
2054
- } },
2055
- setup(e, { slots: t }) {
2056
- let n = er(), r = y(() => Y("inline-flex", e.class));
2057
- function i(e) {
2058
- n.triggerRef.value = e;
2059
- }
2060
- function a() {
2061
- typeof window > "u" || (n.delayTimer.value !== null && window.clearTimeout(n.delayTimer.value), n.delayTimer.value = window.setTimeout(() => {
2062
- n.setOpen(!0);
2063
- }, 200));
2064
- }
2065
- function o() {
2066
- typeof window < "u" && n.delayTimer.value !== null && (window.clearTimeout(n.delayTimer.value), n.delayTimer.value = null), n.setOpen(!1);
2067
- }
2068
- return () => D("span", {
2069
- class: r.value,
2070
- onMouseenter: a,
2071
- onMouseleave: o,
2072
- onVnodeMounted(e) {
2073
- i(e.el);
2074
- },
2075
- onVnodeUpdated(e) {
2076
- i(e.el);
2077
- }
2078
- }, t.default?.());
2079
- }
2080
- }), rr = E({
2081
- name: "UTooltipContent",
2082
- props: {
2083
- side: {
2084
- type: String,
2085
- default: "top"
2086
- },
2087
- class: {
2088
- type: String,
2089
- default: void 0
2090
- }
2091
- },
2092
- setup(e, { slots: t }) {
2093
- let n = er(), r = I(null), i = I({
2094
- top: 0,
2095
- left: 0
2096
- }), a = y(() => Y("absolute z-50 rounded-md bg-text-primary px-2.5 py-1.5 text-xs text-surface-1 shadow-md", tr[e.side], e.class));
2097
- function o() {
2098
- if (!n.triggerRef.value || !r.value || typeof window > "u") return;
2099
- let t = n.triggerRef.value.getBoundingClientRect(), a = r.value.offsetWidth, o = r.value.offsetHeight, s = 0, c = 0;
2100
- e.side === "top" ? (s = t.top + window.scrollY - o - 8, c = t.left + window.scrollX + t.width / 2 - a / 2) : e.side === "bottom" ? (s = t.bottom + window.scrollY + 8, c = t.left + window.scrollX + t.width / 2 - a / 2) : e.side === "left" ? (s = t.top + window.scrollY + t.height / 2 - o / 2, c = t.left + window.scrollX - a - 8) : (s = t.top + window.scrollY + t.height / 2 - o / 2, c = t.right + window.scrollX + 8), i.value = {
2101
- top: s,
2102
- left: c
2103
- };
2104
- }
2105
- function s() {
2106
- window.addEventListener("resize", o), window.addEventListener("scroll", o, !0);
2107
- }
2108
- function c() {
2109
- window.removeEventListener("resize", o), window.removeEventListener("scroll", o, !0);
2110
- }
2111
- return W(() => n.open.value, async (e) => {
2112
- c(), !(!e || typeof window > "u") && (await A(), o(), s());
2113
- }, { immediate: !0 }), N(() => {
2114
- c();
2115
- }), () => n.open.value ? D(v, { to: "body" }, [D("div", {
2116
- ref: r,
2117
- class: a.value,
2118
- style: {
2119
- top: `${i.value.top}px`,
2120
- left: `${i.value.left}px`
2121
- }
2122
- }, t.default?.())]) : null;
2123
- }
2124
- }), ir = /* @__PURE__ */ E({
2125
- name: "UTooltip",
2126
- __name: "tooltip",
2127
- props: { class: { default: void 0 } },
2128
- setup(e) {
2129
- let t = e, n = I(!1), r = I(null), i = I(null), a = y(() => Y("relative inline-flex", t.class));
2130
- function o(e) {
2131
- n.value = e;
2132
- }
2133
- return F($n, {
2134
- open: n,
2135
- triggerRef: r,
2136
- delayTimer: i,
2137
- setOpen: o
2138
- }), (e, t) => (P(), S("span", { class: j(a.value) }, [R(e.$slots, "default")], 2));
2139
- }
2140
- }), ar = { class: "flex flex-col gap-0.5" };
2141
- function or(e, t, n) {
2142
- return E({
2143
- name: e,
2144
- props: { class: {
2145
- type: String,
2146
- default: void 0
2147
- } },
2148
- setup(e, { attrs: r, slots: i }) {
2149
- let a = y(() => Y(n, e.class));
2150
- return () => D(t, {
2151
- ...r,
2152
- class: a.value
2153
- }, i.default?.());
2154
- }
1
+ import { t as e } from "./cn-Cl2u7rTh.js";
2
+ import { s as t, t as n } from "./button-D_ikOxrp.js";
3
+ import { C as r, D as i, E as ee, O as a, S as o, T as s, _ as c, a as l, b as u, c as d, d as te, f, g as p, h as m, i as h, l as g, m as _, n as v, o as y, p as b, r as x, s as S, t as C, u as w, v as T, w as E, x as D, y as O } from "./icon-NbssmDYT.js";
4
+ import { n as k, t as A } from "./sidebar-wW1OGS5T.js";
5
+ import { theme as ne } from "./theme.js";
6
+ import { $ as j, A as M, B as N, C as P, Ct as F, D as I, Dt as L, E as R, Et as z, F as B, G as V, H, I as U, J as W, K as G, L as K, M as q, N as J, O as Y, P as X, Q as Z, R as Q, S as re, St as ie, T as ae, Tt as oe, U as se, V as ce, W as le, X as ue, Y as de, Z as fe, _ as pe, _t as me, a as he, at as ge, b as _e, bt as ve, c as ye, ct as be, d as xe, dt as Se, et as Ce, f as we, ft as Te, g as Ee, gt as De, h as Oe, ht as ke, i as Ae, it as je, j as Me, k as Ne, l as Pe, lt as Fe, m as Ie, mt as Le, n as Re, nt as ze, o as Be, ot as Ve, p as He, pt as Ue, q as We, r as Ge, rt as Ke, s as qe, st as Je, t as Ye, tt as Xe, u as Ze, ut as Qe, v as $e, vt as et, w as tt, wt as nt, x as rt, xt as it, y as at, yt as ot, z as $ } from "./statistic-DBlNBT-A.js";
7
+ import { n as st } from "./toast-state-DyrVOjSJ.js";
8
+ import { a as ct, c as lt, d as ut, f as dt, i as ft, l as pt, m as mt, n as ht, o as gt, p as _t, r as vt, s as yt, t as bt, u as xt } from "./composables-C-Go-D3m.js";
9
+ //#region \0rolldown/runtime.js
10
+ var St = Object.defineProperty, Ct = Object.entries(/* @__PURE__ */ ((e, t) => {
11
+ let n = {};
12
+ for (var r in e) St(n, r, {
13
+ get: e[r],
14
+ enumerable: !0
2155
15
  });
2156
- }
2157
- var sr = or("UAlertTitle", "p", "text-sm font-semibold leading-5"), cr = or("UAlertDescription", "p", "text-sm leading-5 opacity-90"), lr = /* @__PURE__ */ E({
2158
- name: "UAlert",
2159
- __name: "alert",
2160
- props: {
2161
- variant: { default: "default" },
2162
- class: { default: void 0 }
2163
- },
2164
- setup(e) {
2165
- let t = e, n = {
2166
- default: "border-l-primary bg-info-soft text-info-soft-fg",
2167
- info: "border-l-info bg-info-soft text-info-soft-fg",
2168
- success: "border-l-success bg-success-soft text-success-soft-fg",
2169
- warning: "border-l-warning bg-warning-soft text-warning-soft-fg",
2170
- destructive: "border-l-danger bg-danger-soft text-danger-soft-fg"
2171
- }, r = {
2172
- default: re,
2173
- info: le,
2174
- success: ae,
2175
- warning: ie,
2176
- destructive: re
2177
- }, i = {
2178
- default: "text-info",
2179
- info: "text-info",
2180
- success: "text-success",
2181
- warning: "text-warning",
2182
- destructive: "text-danger"
2183
- }, a = y(() => Y("relative flex gap-3 rounded-md border-l-4 p-4", n[t.variant], t.class)), o = y(() => r[t.variant]), s = y(() => Y("mt-0.5 shrink-0", i[t.variant]));
2184
- return (e, t) => (P(), S("div", {
2185
- role: "alert",
2186
- class: j(a.value)
2187
- }, [(P(), b(z(o.value), {
2188
- size: 18,
2189
- class: j(s.value)
2190
- }, null, 8, ["class"])), C("div", ar, [R(e.$slots, "default")])], 2));
2191
- }
2192
- }), ur = { class: "flex flex-wrap items-center gap-0 text-sm text-text-secondary" }, dr = E({
2193
- name: "UBreadcrumbItem",
2194
- props: { class: {
2195
- type: String,
2196
- default: void 0
2197
- } },
2198
- setup(e, { attrs: t, slots: n }) {
2199
- let r = y(() => Y("flex items-center gap-1", e.class));
2200
- return () => D("li", {
2201
- ...t,
2202
- class: r.value
2203
- }, n.default?.());
2204
- }
2205
- }), fr = E({
2206
- name: "UBreadcrumbLink",
2207
- inheritAttrs: !1,
2208
- props: {
2209
- current: {
2210
- type: Boolean,
2211
- default: !1
2212
- },
2213
- href: {
2214
- type: String,
2215
- default: void 0
2216
- },
2217
- class: {
2218
- type: String,
2219
- default: void 0
2220
- }
2221
- },
2222
- setup(e, { attrs: t, slots: n }) {
2223
- let r = y(() => Y(e.current ? "font-medium text-text-primary" : "transition-colors hover:text-text-primary", e.class));
2224
- return () => e.current ? D("span", {
2225
- ...t,
2226
- "aria-current": "page",
2227
- class: r.value
2228
- }, n.default?.()) : D("a", {
2229
- ...t,
2230
- href: e.href,
2231
- class: r.value
2232
- }, n.default?.());
2233
- }
2234
- }), pr = E({
2235
- name: "UBreadcrumbSeparator",
2236
- props: { class: {
2237
- type: String,
2238
- default: void 0
2239
- } },
2240
- setup(e, { attrs: t, slots: n }) {
2241
- let r = y(() => Y("text-text-tertiary", e.class));
2242
- return () => D("li", {
2243
- ...t,
2244
- role: "presentation",
2245
- "aria-hidden": "true",
2246
- class: r.value
2247
- }, n.default?.() ?? [D(ce, { size: 14 })]);
2248
- }
2249
- }), mr = /* @__PURE__ */ E({
2250
- name: "UBreadcrumb",
2251
- __name: "breadcrumb",
2252
- props: { class: { default: void 0 } },
2253
- setup(e) {
2254
- let t = e, n = y(() => Y(t.class));
2255
- return (e, t) => (P(), S("nav", {
2256
- "aria-label": "面包屑导航",
2257
- class: j(n.value)
2258
- }, [C("ol", ur, [R(e.$slots, "default")])], 2));
2259
- }
2260
- }), hr = ["for"], gr = {
2261
- key: 0,
2262
- class: "text-sm font-medium text-text-primary"
2263
- }, _r = [
2264
- "id",
2265
- "aria-checked",
2266
- "disabled"
2267
- ], vr = {
2268
- key: 1,
2269
- class: "text-sm font-medium text-text-primary"
2270
- }, yr = [
2271
- "id",
2272
- "aria-checked",
2273
- "disabled"
2274
- ], br = /* @__PURE__ */ E({
2275
- name: "USwitch",
2276
- __name: "switch",
2277
- props: /* @__PURE__ */ k({
2278
- disabled: {
2279
- type: Boolean,
2280
- default: !1
2281
- },
2282
- label: { default: void 0 },
2283
- labelPlacement: { default: "right" },
2284
- id: { default: void 0 },
2285
- class: { default: void 0 }
2286
- }, {
2287
- checked: {
2288
- type: Boolean,
2289
- default: !1
2290
- },
2291
- checkedModifiers: {}
2292
- }),
2293
- emits: /* @__PURE__ */ k(["change"], ["update:checked"]),
2294
- setup(e, { emit: t }) {
2295
- let n = e, r = t, i = U(e, "checked"), a = H(), o = y(() => n.id ?? a), s = y(() => Y("relative inline-flex h-6 w-11 shrink-0 items-center rounded-full border-2 border-transparent transition-colors duration-200", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", "disabled:cursor-not-allowed disabled:opacity-50", i.value ? "bg-primary" : "bg-surface-3", n.class)), c = y(() => Y("inline-flex items-center gap-2", n.disabled && "cursor-not-allowed opacity-50"));
2296
- function l() {
2297
- n.disabled || (i.value = !i.value, r("change", i.value));
2298
- }
2299
- return (t, n) => e.label ? (P(), S("label", {
2300
- key: 0,
2301
- for: o.value,
2302
- class: j(c.value)
2303
- }, [
2304
- e.labelPlacement === "left" ? (P(), S("span", gr, B(e.label), 1)) : x("", !0),
2305
- C("button", {
2306
- id: o.value,
2307
- type: "button",
2308
- role: "switch",
2309
- "aria-checked": i.value,
2310
- disabled: e.disabled,
2311
- class: j(s.value),
2312
- onClick: l
2313
- }, [C("span", { class: j(V(Y)("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-sm ring-0 transition-transform duration-200", i.value ? "translate-x-5" : "translate-x-0")) }, null, 2)], 10, _r),
2314
- e.labelPlacement === "right" ? (P(), S("span", vr, B(e.label), 1)) : x("", !0)
2315
- ], 10, hr)) : (P(), S("button", {
2316
- key: 1,
2317
- id: o.value,
2318
- type: "button",
2319
- role: "switch",
2320
- "aria-checked": i.value,
2321
- disabled: e.disabled,
2322
- class: j(s.value),
2323
- onClick: l
2324
- }, [C("span", { class: j(V(Y)("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-sm ring-0 transition-transform duration-200", i.value ? "translate-x-5" : "translate-x-0")) }, null, 2)], 10, yr));
2325
- }
2326
- }), xr = { class: "flex flex-col gap-1" }, Sr = ["for"], Cr = [
2327
- "id",
2328
- "value",
2329
- "rows",
2330
- "disabled",
2331
- "placeholder"
2332
- ], wr = {
2333
- key: 1,
2334
- class: "text-xs text-danger"
2335
- }, Tr = {
2336
- key: 2,
2337
- class: "text-xs text-text-secondary"
2338
- }, Er = /* @__PURE__ */ E({
2339
- name: "UTextarea",
2340
- inheritAttrs: !1,
2341
- __name: "textarea",
2342
- props: /* @__PURE__ */ k({
2343
- label: { default: void 0 },
2344
- error: { default: void 0 },
2345
- helperText: { default: void 0 },
2346
- id: { default: void 0 },
2347
- rows: { default: 3 },
2348
- disabled: {
2349
- type: Boolean,
2350
- default: !1
2351
- },
2352
- placeholder: { default: void 0 },
2353
- class: { default: void 0 }
2354
- }, {
2355
- modelValue: {},
2356
- modelModifiers: {}
2357
- }),
2358
- emits: /* @__PURE__ */ k([
2359
- "blur",
2360
- "focus",
2361
- "input",
2362
- "change"
2363
- ], ["update:modelValue"]),
2364
- setup(e, { expose: t, emit: n }) {
2365
- let r = e, i = n, a = U(e, "modelValue"), o = te(), s = H(), c = y(() => r.id ?? s), l = I(null), u = y(() => Y("w-full rounded-md border bg-surface-1 px-3 py-2 text-sm text-text-primary placeholder:text-text-tertiary", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-1", "disabled:cursor-not-allowed disabled:opacity-50 resize-y", r.error ? "border-danger focus-visible:ring-danger" : "border-border-strong focus-visible:ring-ring/30", r.class)), d = y(() => {
2366
- let e = { ...o };
2367
- return delete e.class, e;
2368
- });
2369
- function f(e) {
2370
- a.value = e.target.value, i("input", e);
2371
- }
2372
- function p(e) {
2373
- i("change", e);
2374
- }
2375
- function m(e) {
2376
- i("blur", e);
2377
- }
2378
- function h(e) {
2379
- i("focus", e);
2380
- }
2381
- function g() {
2382
- l.value?.focus();
2383
- }
2384
- function _() {
2385
- l.value?.blur();
2386
- }
2387
- return t({
2388
- focus: g,
2389
- blur: _,
2390
- el: l
2391
- }), (t, n) => (P(), S("div", xr, [
2392
- e.label ? (P(), S("label", {
2393
- key: 0,
2394
- for: c.value,
2395
- class: "text-sm font-medium text-text-primary"
2396
- }, B(e.label), 9, Sr)) : x("", !0),
2397
- C("textarea", ee({
2398
- id: c.value,
2399
- ref_key: "textareaRef",
2400
- ref: l,
2401
- value: a.value ?? "",
2402
- rows: e.rows,
2403
- disabled: e.disabled,
2404
- placeholder: e.placeholder,
2405
- class: u.value
2406
- }, d.value, {
2407
- onInput: f,
2408
- onChange: p,
2409
- onBlur: m,
2410
- onFocus: h
2411
- }), null, 16, Cr),
2412
- e.error ? (P(), S("p", wr, B(e.error), 1)) : e.helperText ? (P(), S("p", Tr, B(e.helperText), 1)) : x("", !0)
2413
- ]));
2414
- }
2415
- }), Dr = /* @__PURE__ */ E({
2416
- name: "USkeleton",
2417
- __name: "skeleton",
2418
- props: {
2419
- variant: { default: "rect" },
2420
- class: { default: void 0 }
2421
- },
2422
- setup(e) {
2423
- let t = e, n = {
2424
- text: "h-4 w-full rounded",
2425
- circle: "rounded-full",
2426
- rect: "rounded-md"
2427
- }, r = y(() => Y("animate-pulse bg-surface-3", n[t.variant], t.class));
2428
- return (e, t) => (P(), S("div", {
2429
- class: j(r.value),
2430
- "aria-hidden": "true"
2431
- }, null, 2));
2432
- }
2433
- }), Or = ["aria-valuenow", "aria-valuemax"], kr = {
2434
- key: 0,
2435
- class: "w-9 shrink-0 text-right text-xs font-medium tabular-nums text-text-secondary"
2436
- }, Ar = /* @__PURE__ */ E({
2437
- name: "UProgress",
2438
- __name: "progress",
2439
- props: {
2440
- value: {},
2441
- max: { default: 100 },
2442
- showLabel: {
2443
- type: Boolean,
2444
- default: !1
2445
- },
2446
- color: { default: "bg-indigo-500" },
2447
- class: { default: void 0 }
2448
- },
2449
- setup(e) {
2450
- let t = e, n = y(() => Math.min(Math.max(t.value, 0), t.max)), r = y(() => Math.round(n.value / t.max * 100)), i = y(() => Y("flex items-center gap-3", t.class)), a = y(() => Y("h-full rounded-full transition-all duration-500 ease-out", t.color));
2451
- return (t, o) => (P(), S("div", { class: j(i.value) }, [C("div", {
2452
- role: "progressbar",
2453
- "aria-valuenow": n.value,
2454
- "aria-valuemin": "0",
2455
- "aria-valuemax": e.max,
2456
- class: "h-2 w-full overflow-hidden rounded-full bg-surface-2"
2457
- }, [C("div", {
2458
- class: j(a.value),
2459
- style: M({ width: `${r.value}%` })
2460
- }, null, 6)], 8, Or), e.showLabel ? (P(), S("span", kr, B(r.value) + "% ", 1)) : x("", !0)], 2));
2461
- }
2462
- }), jr = {
2463
- key: 0,
2464
- class: "fixed inset-0 z-50 flex",
2465
- role: "dialog",
2466
- "aria-modal": "true"
2467
- }, Mr = {
2468
- key: 0,
2469
- class: "flex items-center justify-between border-b border-border-base px-5 py-4"
2470
- }, Nr = {
2471
- key: 0,
2472
- class: "text-base font-semibold text-text-primary"
2473
- }, Pr = { key: 1 }, Fr = { class: "flex-1 overflow-y-auto px-5 py-4" }, Ir = {
2474
- key: 1,
2475
- class: "border-t border-border-base px-5 py-4"
2476
- }, Lr = /* @__PURE__ */ E({
2477
- name: "USheet",
2478
- __name: "sheet",
2479
- props: /* @__PURE__ */ k({
2480
- side: { default: "right" },
2481
- title: { default: void 0 },
2482
- closeOnOverlay: {
2483
- type: Boolean,
2484
- default: !0
2485
- },
2486
- closeOnEsc: {
2487
- type: Boolean,
2488
- default: !0
2489
- },
2490
- showCloseButton: {
2491
- type: Boolean,
2492
- default: !0
2493
- },
2494
- class: { default: void 0 }
2495
- }, {
2496
- open: {
2497
- type: Boolean,
2498
- default: !1
2499
- },
2500
- openModifiers: {}
2501
- }),
2502
- emits: /* @__PURE__ */ k(["close", "openChange"], ["update:open"]),
2503
- setup(e, { emit: t }) {
2504
- let n = e, r = t, i = U(e, "open"), a = y(() => Y("relative flex h-full w-80 max-w-full flex-col bg-surface-1 shadow-xl transition-transform duration-300 ease-in-out", n.side === "right" ? "ml-auto" : "mr-auto", n.class));
2505
- function o(e) {
2506
- typeof document > "u" || (document.body.style.overflow = e ? "hidden" : "");
2507
- }
2508
- function s() {
2509
- i.value = !1, r("openChange", !1), r("close");
2510
- }
2511
- function c() {
2512
- n.closeOnOverlay && s();
2513
- }
2514
- function l(e) {
2515
- e.key === "Escape" && n.closeOnEsc && i.value && s();
2516
- }
2517
- return W(i, (e) => {
2518
- if (o(e), e && typeof document < "u") {
2519
- document.addEventListener("keydown", l), r("openChange", !0);
2520
- return;
2521
- }
2522
- typeof document < "u" && document.removeEventListener("keydown", l);
2523
- }, { immediate: !0 }), N(() => {
2524
- o(!1), typeof document < "u" && document.removeEventListener("keydown", l);
2525
- }), (t, n) => (P(), b(v, { to: "body" }, [i.value ? (P(), S("div", jr, [C("div", {
2526
- class: "absolute inset-0 bg-overlay transition-opacity",
2527
- "aria-hidden": "true",
2528
- onClick: c
2529
- }), C("div", {
2530
- class: j(a.value),
2531
- onClick: n[0] || (n[0] = G(() => {}, ["stop"]))
2532
- }, [
2533
- e.title || t.$slots.header || e.showCloseButton ? (P(), S("div", Mr, [R(t.$slots, "header", {}, () => [e.title ? (P(), S("h2", Nr, B(e.title), 1)) : (P(), S("div", Pr))]), e.showCloseButton ? (P(), S("button", {
2534
- key: 0,
2535
- type: "button",
2536
- class: "rounded-md p-1 text-text-tertiary transition-colors hover:bg-surface-3 hover:text-text-secondary",
2537
- "aria-label": "关闭",
2538
- onClick: s
2539
- }, [T(V(J), { size: 18 })])) : x("", !0)])) : x("", !0),
2540
- C("div", Fr, [R(t.$slots, "default")]),
2541
- t.$slots.footer ? (P(), S("div", Ir, [R(t.$slots, "footer")])) : x("", !0)
2542
- ], 2)])) : x("", !0)]));
2543
- }
2544
- }), Rr = {
2545
- key: 0,
2546
- class: "flex h-14 w-14 items-center justify-center rounded-full bg-surface-2"
2547
- }, zr = { class: "flex flex-col gap-1" }, Br = {
2548
- key: 0,
2549
- class: "text-base font-semibold text-text-primary"
2550
- }, Vr = {
2551
- key: 0,
2552
- class: "max-w-xs text-sm text-text-secondary"
2553
- }, Hr = {
2554
- key: 0,
2555
- class: "mt-1"
2556
- }, Ur = /* @__PURE__ */ E({
2557
- name: "UEmptyState",
2558
- __name: "empty-state",
2559
- props: {
2560
- icon: { default: void 0 },
2561
- title: { default: void 0 },
2562
- description: { default: void 0 },
2563
- class: { default: void 0 }
2564
- },
2565
- setup(e) {
2566
- let t = e, n = y(() => Y("flex flex-col items-center justify-center gap-3 py-16 text-center", t.class));
2567
- return (t, r) => (P(), S("div", { class: j(n.value) }, [
2568
- R(t.$slots, "icon", {}, () => [e.icon ? (P(), S("div", Rr, [(P(), b(z(e.icon), {
2569
- size: 28,
2570
- class: "text-text-tertiary"
2571
- }))])) : x("", !0)]),
2572
- C("div", zr, [R(t.$slots, "title", {}, () => [e.title ? (P(), S("p", Br, B(e.title), 1)) : x("", !0)]), R(t.$slots, "description", {}, () => [e.description ? (P(), S("p", Vr, B(e.description), 1)) : x("", !0)])]),
2573
- t.$slots.action ? (P(), S("div", Hr, [R(t.$slots, "action")])) : x("", !0)
2574
- ], 2));
2575
- }
2576
- }), Wr = /* @__PURE__ */ E({
2577
- name: "USpinner",
2578
- __name: "spinner",
2579
- props: {
2580
- size: { default: "md" },
2581
- label: { default: "加载中" },
2582
- class: { default: void 0 }
2583
- },
2584
- setup(e) {
2585
- let t = e, n = {
2586
- sm: "h-4 w-4",
2587
- md: "h-6 w-6",
2588
- lg: "h-10 w-10"
2589
- }, r = y(() => Y("animate-spin text-text-tertiary", n[t.size], t.class));
2590
- return (t, n) => (P(), b(V(ue), {
2591
- class: j(r.value),
2592
- "aria-label": e.label,
2593
- role: "status"
2594
- }, null, 8, ["class", "aria-label"]));
2595
- }
2596
- }), Gr = ["disabled"], Kr = {
2597
- key: 0,
2598
- class: "select-none px-1 text-text-tertiary"
2599
- }, qr = ["aria-current", "onClick"], Jr = ["disabled"], $ = 5, Yr = "inline-flex h-8 min-w-8 items-center justify-center rounded-md px-2 text-sm transition-colors disabled:pointer-events-none disabled:opacity-40", Xr = /* @__PURE__ */ E({
2600
- name: "UPagination",
2601
- __name: "pagination",
2602
- props: /* @__PURE__ */ k({
2603
- totalPages: {},
2604
- class: { default: void 0 }
2605
- }, {
2606
- page: { default: 1 },
2607
- pageModifiers: {}
2608
- }),
2609
- emits: /* @__PURE__ */ k(["pageChange"], ["update:page"]),
2610
- setup(e, { emit: t }) {
2611
- let n = e, r = t, i = U(e, "page"), a = y(() => Y("flex items-center gap-1", n.class)), o = y(() => {
2612
- let e = i.value, t = n.totalPages;
2613
- if (t <= $) return Array.from({ length: t }, (e, t) => t + 1);
2614
- let r = Math.floor($ / 2), a = Math.max(1, e - r), o = Math.min(t, a + $ - 1);
2615
- o - a < $ - 1 && (a = Math.max(1, o - $ + 1));
2616
- let s = [];
2617
- a > 1 && (s.push(1), a > 2 && s.push("..."));
2618
- for (let e = a; e <= o; e += 1) s.push(e);
2619
- return o < t && (o < t - 1 && s.push("..."), s.push(t)), s;
2620
- });
2621
- function s(e) {
2622
- let t = Math.min(Math.max(e, 1), n.totalPages);
2623
- t !== i.value && (i.value = t, r("pageChange", t));
2624
- }
2625
- return (t, n) => (P(), S("div", { class: j(a.value) }, [
2626
- C("button", {
2627
- type: "button",
2628
- class: j(V(Y)(Yr, "border border-border-strong bg-surface-1 text-text-primary hover:bg-surface-3")),
2629
- disabled: i.value <= 1,
2630
- "aria-label": "上一页",
2631
- onClick: n[0] || (n[0] = (e) => s(i.value - 1))
2632
- }, [T(V(se), { size: 16 })], 10, Gr),
2633
- (P(!0), S(_, null, L(o.value, (e, t) => (P(), S(_, { key: `${e}-${t}` }, [e === "..." ? (P(), S("span", Kr, "…")) : (P(), S("button", {
2634
- key: 1,
2635
- type: "button",
2636
- class: j(V(Y)(Yr, e === i.value ? "bg-primary text-primary-fg" : "border border-border-strong bg-surface-1 text-text-primary hover:bg-surface-3")),
2637
- "aria-current": e === i.value ? "page" : void 0,
2638
- onClick: (t) => s(e)
2639
- }, B(e), 11, qr))], 64))), 128)),
2640
- C("button", {
2641
- type: "button",
2642
- class: j(V(Y)(Yr, "border border-border-strong bg-surface-1 text-text-primary hover:bg-surface-3")),
2643
- disabled: i.value >= e.totalPages,
2644
- "aria-label": "下一页",
2645
- onClick: n[1] || (n[1] = (e) => s(i.value + 1))
2646
- }, [T(V(ce), { size: 16 })], 10, Jr)
2647
- ], 2));
2648
- }
2649
- }), Zr = { class: "flex flex-col gap-1" }, Qr = ["for"], $r = [
2650
- "id",
2651
- "value",
2652
- "disabled"
2653
- ], ei = {
2654
- key: 0,
2655
- value: "",
2656
- disabled: ""
2657
- }, ti = ["value"], ni = {
2658
- key: 1,
2659
- class: "text-xs text-danger"
2660
- }, ri = {
2661
- key: 2,
2662
- class: "text-xs text-text-secondary"
2663
- }, ii = /* @__PURE__ */ E({
2664
- name: "USelect",
2665
- inheritAttrs: !1,
2666
- __name: "select",
2667
- props: /* @__PURE__ */ k({
2668
- label: { default: void 0 },
2669
- error: { default: void 0 },
2670
- helperText: { default: void 0 },
2671
- options: {},
2672
- placeholder: { default: void 0 },
2673
- id: { default: void 0 },
2674
- disabled: {
2675
- type: Boolean,
2676
- default: !1
2677
- },
2678
- class: { default: void 0 }
2679
- }, {
2680
- modelValue: {},
2681
- modelModifiers: {}
2682
- }),
2683
- emits: /* @__PURE__ */ k([
2684
- "blur",
2685
- "focus",
2686
- "change"
2687
- ], ["update:modelValue"]),
2688
- setup(e, { expose: t, emit: n }) {
2689
- let r = e, i = n, a = U(e, "modelValue"), o = te(), s = H(), c = y(() => r.id ?? s), l = I(null), u = y(() => Y("flex h-9 w-full rounded-md border bg-surface-1 px-3 py-1.5 text-sm text-text-primary", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-1", "disabled:cursor-not-allowed disabled:opacity-50", r.error ? "border-red-400 focus-visible:ring-red-400" : "border-border-strong focus-visible:ring-ring/30", r.class)), d = y(() => {
2690
- let e = { ...o };
2691
- return delete e.class, e;
2692
- });
2693
- function f(e) {
2694
- a.value = e.target.value, i("change", e);
2695
- }
2696
- function p(e) {
2697
- i("focus", e);
2698
- }
2699
- function m(e) {
2700
- i("blur", e);
2701
- }
2702
- function h() {
2703
- l.value?.focus();
2704
- }
2705
- function g() {
2706
- l.value?.blur();
2707
- }
2708
- return t({
2709
- focus: h,
2710
- blur: g,
2711
- el: l
2712
- }), (t, n) => (P(), S("div", Zr, [
2713
- e.label ? (P(), S("label", {
2714
- key: 0,
2715
- for: c.value,
2716
- class: "text-sm font-medium text-text-primary"
2717
- }, B(e.label), 9, Qr)) : x("", !0),
2718
- C("select", ee({
2719
- id: c.value,
2720
- ref_key: "selectRef",
2721
- ref: l,
2722
- value: a.value ?? "",
2723
- disabled: e.disabled,
2724
- class: u.value
2725
- }, d.value, {
2726
- onChange: f,
2727
- onFocus: p,
2728
- onBlur: m
2729
- }), [e.placeholder ? (P(), S("option", ei, B(e.placeholder), 1)) : x("", !0), (P(!0), S(_, null, L(e.options, (e) => (P(), S("option", {
2730
- key: String(e.value),
2731
- value: e.value
2732
- }, B(e.label), 9, ti))), 128))], 16, $r),
2733
- e.error ? (P(), S("p", ni, B(e.error), 1)) : e.helperText ? (P(), S("p", ri, B(e.helperText), 1)) : x("", !0)
2734
- ]));
2735
- }
2736
- }), ai = { class: "flex-1 overflow-y-auto py-4" }, oi = { class: "flex flex-col gap-1 px-2" }, si = ["href", "title"], ci = {
2737
- key: 0,
2738
- class: "truncate"
2739
- }, li = /* @__PURE__ */ E({
2740
- name: "USidebar",
2741
- __name: "sidebar",
2742
- props: {
2743
- items: {},
2744
- collapsed: {
2745
- type: Boolean,
2746
- default: !1
2747
- },
2748
- class: { default: void 0 }
2749
- },
2750
- setup(e) {
2751
- let t = e, n = y(() => Y("flex flex-col bg-primary text-primary-fg transition-all duration-300", t.collapsed ? "w-16" : "w-60", t.class));
2752
- return (t, r) => (P(), S("aside", { class: j(n.value) }, [C("nav", ai, [C("ul", oi, [(P(!0), S(_, null, L(e.items, (t) => (P(), S("li", { key: t.href }, [C("a", {
2753
- href: t.href,
2754
- title: e.collapsed ? t.label : void 0,
2755
- class: j(V(Y)("flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors", t.active ? "bg-primary-active text-primary-fg font-medium" : "text-primary-fg/70 hover:bg-primary-hover hover:text-primary-fg"))
2756
- }, [(P(), b(z(t.icon), {
2757
- size: 18,
2758
- class: "shrink-0"
2759
- })), e.collapsed ? x("", !0) : (P(), S("span", ci, B(t.label), 1))], 10, si)]))), 128))])]), t.$slots.footer ? (P(), S("div", {
2760
- key: 0,
2761
- class: j(V(Y)("border-t border-primary-active px-2 py-4", e.collapsed && "flex justify-center"))
2762
- }, [R(t.$slots, "footer")], 2)) : x("", !0)], 2));
2763
- }
2764
- }), ui = ["aria-orientation"], di = /* @__PURE__ */ E({
2765
- name: "USeparator",
2766
- __name: "separator",
2767
- props: {
2768
- orientation: { default: "horizontal" },
2769
- class: { default: void 0 }
2770
- },
2771
- setup(e) {
2772
- let t = {
2773
- horizontal: "h-px w-full bg-border-base",
2774
- vertical: "w-px h-full bg-border-base"
2775
- }, n = e, r = y(() => Y(t[n.orientation], n.class));
2776
- return (t, n) => (P(), S("div", {
2777
- role: "separator",
2778
- "aria-orientation": e.orientation,
2779
- class: j(r.value)
2780
- }, null, 10, ui));
2781
- }
2782
- }), fi = {
2783
- key: 0,
2784
- class: "mb-3 text-base font-semibold text-text-primary"
2785
- }, pi = {
2786
- key: 1,
2787
- class: "w-full border-collapse border border-border-base"
2788
- }, mi = ["colspan"], hi = E({
2789
- name: "UDescriptionsItem",
2790
- props: {
2791
- label: {
2792
- type: String,
2793
- required: !0
2794
- },
2795
- span: {
2796
- type: Number,
2797
- default: 1
2798
- },
2799
- class: {
2800
- type: String,
2801
- default: void 0
2802
- }
2803
- },
2804
- setup(e, { slots: t, attrs: n }) {
2805
- return () => D("div", {
2806
- ...n,
2807
- class: Y("flex flex-col gap-0.5", e.class)
2808
- }, [D("span", { class: "text-xs font-medium text-text-secondary" }, e.label), D("span", { class: "text-sm text-text-primary" }, t.default?.())]);
2809
- }
2810
- }), gi = /* @__PURE__ */ E({
2811
- name: "UDescriptions",
2812
- __name: "descriptions",
2813
- props: {
2814
- column: { default: 2 },
2815
- bordered: {
2816
- type: Boolean,
2817
- default: !1
2818
- },
2819
- size: { default: "default" },
2820
- title: { default: void 0 },
2821
- class: { default: void 0 }
2822
- },
2823
- setup(e) {
2824
- let t = e, n = {
2825
- 1: "grid-cols-1",
2826
- 2: "grid-cols-2",
2827
- 3: "grid-cols-3",
2828
- 4: "grid-cols-4"
2829
- }, r = {
2830
- sm: "text-xs py-1 px-2",
2831
- default: "text-sm py-2 px-3",
2832
- lg: "text-base py-3 px-4"
2833
- }, i = {
2834
- sm: "text-xs py-1 px-2",
2835
- default: "text-sm py-2 px-3",
2836
- lg: "text-base py-3 px-4"
2837
- }, a = y(() => Y("w-full", t.class)), o = y(() => Y("grid gap-x-6 gap-y-4", n[t.column])), s = y(() => Y("border border-border-base bg-surface-2 font-medium text-text-secondary", r[t.size])), c = y(() => Y("border border-border-base text-text-primary", i[t.size])), l = ne();
2838
- function u() {
2839
- let e = l.default?.({}) ?? [], t = [];
2840
- for (let n of e) n.type?.name === "UDescriptionsItem" && t.push(n);
2841
- return t;
2842
- }
2843
- let d = y(() => {
2844
- let e = u(), n = [], r = [], i = 0;
2845
- for (let a of e) {
2846
- let e = a.props, o = e?.label ?? "", s = e?.span ?? 1;
2847
- i + s > t.column && (n.push(r), r = [], i = 0), r.push({
2848
- label: o,
2849
- span: s,
2850
- node: a
2851
- }), i += s;
2852
- }
2853
- return r.length > 0 && n.push(r), n;
2854
- }), f = y(() => `${1 / (t.column * 2) * 100}%`);
2855
- return (t, n) => (P(), S("div", { class: j(a.value) }, [e.title ? (P(), S("div", fi, B(e.title), 1)) : x("", !0), e.bordered ? (P(), S("table", pi, [C("tbody", null, [(P(!0), S(_, null, L(d.value, (e, t) => (P(), S("tr", { key: t }, [(P(!0), S(_, null, L(e, (e, t) => (P(), S(_, { key: t }, [C("td", {
2856
- class: j(s.value),
2857
- style: M({ width: f.value })
2858
- }, B(e.label), 7), C("td", {
2859
- class: j(c.value),
2860
- colspan: e.span > 1 ? e.span * 2 - 1 : 1
2861
- }, [(P(), b(z(e.node)))], 10, mi)], 64))), 128))]))), 128))])])) : (P(), S("div", {
2862
- key: 2,
2863
- class: j(o.value)
2864
- }, [R(t.$slots, "default")], 2))], 2));
2865
- }
2866
- }), _i = { class: "flex items-baseline gap-1" }, vi = {
2867
- key: 1,
2868
- class: "flex items-center gap-1"
2869
- }, yi = /* @__PURE__ */ E({
2870
- name: "UStatistic",
2871
- __name: "statistic",
2872
- props: {
2873
- title: { default: void 0 },
2874
- value: {},
2875
- precision: { default: void 0 },
2876
- suffix: { default: void 0 },
2877
- trend: { default: void 0 },
2878
- change: { default: void 0 },
2879
- size: { default: "default" },
2880
- class: { default: void 0 }
2881
- },
2882
- setup(e) {
2883
- let t = e, n = {
2884
- sm: "text-xs",
2885
- default: "text-sm",
2886
- lg: "text-base"
2887
- }, r = {
2888
- sm: "text-2xl",
2889
- default: "text-3xl",
2890
- lg: "text-4xl"
2891
- }, i = {
2892
- sm: "text-xs",
2893
- default: "text-sm",
2894
- lg: "text-base"
2895
- }, a = {
2896
- up: "text-success",
2897
- down: "text-danger",
2898
- flat: "text-text-secondary"
2899
- }, o = {
2900
- up: "text-success",
2901
- down: "text-danger",
2902
- flat: "text-text-secondary"
2903
- }, s = {
2904
- up: pe,
2905
- down: fe,
2906
- flat: q
2907
- }, c = y(() => Y("flex flex-col gap-1", t.class)), l = y(() => Y("font-medium text-text-secondary", n[t.size])), u = y(() => Y("font-bold tabular-nums text-text-primary", r[t.size])), d = y(() => Y("text-text-secondary", i[t.size])), f = y(() => Y("text-text-primary", i[t.size])), p = y(() => t.trend ? a[t.trend] : ""), m = y(() => t.trend ? Y("text-xs font-medium", o[t.trend]) : ""), h = y(() => t.size === "sm" ? 14 : t.size === "lg" ? 18 : 16), g = y(() => t.trend ? s[t.trend] : null), _ = y(() => typeof t.value == "string" ? t.value : new Intl.NumberFormat("zh-CN", {
2908
- minimumFractionDigits: t.precision ?? 0,
2909
- maximumFractionDigits: t.precision ?? 0
2910
- }).format(t.value));
2911
- return (t, n) => (P(), S("div", { class: j(c.value) }, [
2912
- e.title ? (P(), S("span", {
2913
- key: 0,
2914
- class: j(l.value)
2915
- }, B(e.title), 3)) : x("", !0),
2916
- C("div", _i, [
2917
- t.$slots.prefix ? (P(), S("span", {
2918
- key: 0,
2919
- class: j(f.value)
2920
- }, [R(t.$slots, "prefix")], 2)) : x("", !0),
2921
- C("span", { class: j(u.value) }, B(_.value), 3),
2922
- t.$slots.suffix || e.suffix ? (P(), S("span", {
2923
- key: 1,
2924
- class: j(d.value)
2925
- }, [R(t.$slots, "suffix", {}, () => [w(B(e.suffix), 1)])], 2)) : x("", !0)
2926
- ]),
2927
- e.trend || e.change ? (P(), S("div", vi, [g.value ? (P(), b(z(g.value), {
2928
- key: 0,
2929
- size: h.value,
2930
- class: j(p.value)
2931
- }, null, 8, ["size", "class"])) : x("", !0), e.change && e.trend ? (P(), S("span", {
2932
- key: 1,
2933
- class: j(m.value)
2934
- }, B(e.change), 3)) : x("", !0)])) : x("", !0)
2935
- ], 2));
2936
- }
2937
- });
16
+ return t || St(n, Symbol.toStringTag, { value: "Module" }), n;
17
+ })({
18
+ UGAccordion: () => V,
19
+ UGAccordionContent: () => G,
20
+ UGAccordionItem: () => We,
21
+ UGAccordionTrigger: () => W,
22
+ UGAlert: () => Ee,
23
+ UGAlertDescription: () => pe,
24
+ UGAlertTitle: () => $e,
25
+ UGAside: () => l,
26
+ UGAvatar: () => P,
27
+ UGAvatarFallback: () => tt,
28
+ UGAvatarGroup: () => re,
29
+ UGAvatarImage: () => ae,
30
+ UGBadge: () => T,
31
+ UGBreadcrumb: () => we,
32
+ UGBreadcrumbItem: () => He,
33
+ UGBreadcrumbLink: () => Ie,
34
+ UGBreadcrumbSeparator: () => Oe,
35
+ UGButton: () => n,
36
+ UGButtonGroup: () => i,
37
+ UGCard: () => O,
38
+ UGCardContent: () => u,
39
+ UGCardDescription: () => D,
40
+ UGCardFooter: () => o,
41
+ UGCardHeader: () => r,
42
+ UGCardTitle: () => E,
43
+ UGCheckbox: () => Te,
44
+ UGCheckboxGroup: () => Se,
45
+ UGCol: () => g,
46
+ UGConfigProvider: () => a,
47
+ UGContainer: () => h,
48
+ UGContextMenu: () => Me,
49
+ UGContextMenuContent: () => q,
50
+ UGContextMenuItem: () => J,
51
+ UGContextMenuSeparator: () => X,
52
+ UGContextMenuTrigger: () => B,
53
+ UGDescriptions: () => Re,
54
+ UGDescriptionsItem: () => Ge,
55
+ UGDialog: () => L,
56
+ UGDrawer: () => ve,
57
+ UGDrawerClose: () => it,
58
+ UGDrawerContent: () => ie,
59
+ UGDrawerDescription: () => F,
60
+ UGDrawerFooter: () => nt,
61
+ UGDrawerHeader: () => oe,
62
+ UGDrawerTitle: () => z,
63
+ UGDropdown: () => $,
64
+ UGDropdownContent: () => N,
65
+ UGDropdownItem: () => ce,
66
+ UGDropdownMenu: () => $,
67
+ UGDropdownSeparator: () => H,
68
+ UGDropdownTrigger: () => se,
69
+ UGEmptyState: () => Be,
70
+ UGFooter: () => y,
71
+ UGForm: () => j,
72
+ UGFormControl: () => Ce,
73
+ UGFormDescription: () => Xe,
74
+ UGFormField: () => ze,
75
+ UGFormItem: () => Ke,
76
+ UGFormLabel: () => je,
77
+ UGFormMessage: () => ge,
78
+ UGHeader: () => S,
79
+ UGIcon: () => C,
80
+ UGInput: () => ee,
81
+ UGLabel: () => s,
82
+ UGLink: () => _,
83
+ UGMain: () => d,
84
+ UGModal: () => k,
85
+ UGNavigationMenu: () => R,
86
+ UGNavigationMenuContent: () => I,
87
+ UGNavigationMenuItem: () => Y,
88
+ UGNavigationMenuLink: () => Ne,
89
+ UGNavigationMenuTrigger: () => M,
90
+ UGNumberInput: () => be,
91
+ UGOTPInput: () => Ve,
92
+ UGPagination: () => he,
93
+ UGPopover: () => U,
94
+ UGPopoverContent: () => K,
95
+ UGPopoverTrigger: () => Q,
96
+ UGProgress: () => ye,
97
+ UGRadio: () => Qe,
98
+ UGRadioGroup: () => Fe,
99
+ UGRow: () => w,
100
+ UGScrollbar: () => te,
101
+ UGSelect: () => Ae,
102
+ UGSeparator: () => m,
103
+ UGSheet: () => qe,
104
+ UGSidebar: () => A,
105
+ UGSkeleton: () => Pe,
106
+ UGSlider: () => Je,
107
+ UGSpace: () => f,
108
+ UGSpinner: () => p,
109
+ UGSplitter: () => v,
110
+ UGSplitterPanel: () => x,
111
+ UGStatistic: () => Ye,
112
+ UGSteps: () => le,
113
+ UGSwitch: () => xe,
114
+ UGTable: () => Le,
115
+ UGTableBody: () => ke,
116
+ UGTableCell: () => De,
117
+ UGTableHead: () => me,
118
+ UGTableHeader: () => et,
119
+ UGTableRow: () => ot,
120
+ UGTabs: () => de,
121
+ UGTabsContent: () => ue,
122
+ UGTabsList: () => fe,
123
+ UGTabsTrigger: () => Z,
124
+ UGTag: () => c,
125
+ UGText: () => b,
126
+ UGTextarea: () => Ze,
127
+ UGToaster: () => Ue,
128
+ UGTooltip: () => at,
129
+ UGTooltipContent: () => _e,
130
+ UGTooltipTrigger: () => rt
131
+ })), wt = (e) => {
132
+ for (let [t, n] of Ct) e.component(t, n);
133
+ }, Tt = { install: wt };
2938
134
  //#endregion
2939
- export { dn as UAccordion, un as UAccordionContent, cn as UAccordionItem, ln as UAccordionTrigger, lr as UAlert, cr as UAlertDescription, sr as UAlertTitle, Jn as UAvatar, qn as UAvatarFallback, Qn as UAvatarGroup, Kn as UAvatarImage, Pe as UBadge, mr as UBreadcrumb, dr as UBreadcrumbItem, fr as UBreadcrumbLink, pr as UBreadcrumbSeparator, ve as UButton, Ne as UCard, je as UCardContent, Ae as UCardDescription, Me as UCardFooter, Oe as UCardHeader, ke as UCardTitle, xt as UCheckbox, Nn as UContextMenu, An as UContextMenuContent, jn as UContextMenuItem, Mn as UContextMenuSeparator, kn as UContextMenuTrigger, gi as UDescriptions, hi as UDescriptionsItem, Je as UDialog, it as UDrawer, rt as UDrawerClose, Qe as UDrawerContent, tt as UDrawerDescription, nt as UDrawerFooter, $e as UDrawerHeader, et as UDrawerTitle, bn as UDropdown, _n as UDropdownContent, vn as UDropdownItem, yn as UDropdownSeparator, gn as UDropdownTrigger, Ur as UEmptyState, Xt as UForm, qt as UFormControl, Jt as UFormDescription, Wt as UFormField, Gt as UFormItem, Kt as UFormLabel, Yt as UFormMessage, we as UInput, De as ULabel, He as UModal, Un as UNavigationMenu, Hn as UNavigationMenuContent, zn as UNavigationMenuItem, Bn as UNavigationMenuLink, Vn as UNavigationMenuTrigger, Bt as UNumberInput, Ht as UOTPInput, Xr as UPagination, En as UPopover, Tn as UPopoverContent, wn as UPopoverTrigger, Ar as UProgress, kt as URadio, At as URadioGroup, ii as USelect, di as USeparator, Lr as USheet, li as USidebar, Dr as USkeleton, Ft as USlider, Wr as USpinner, yi as UStatistic, pn as USteps, br as USwitch, dt as UTable, st as UTableBody, ut as UTableCell, lt as UTableHead, ot as UTableHeader, ct as UTableRow, nn as UTabs, tn as UTabsContent, $t as UTabsList, en as UTabsTrigger, Ie as UTag, Er as UTextarea, mt as UToaster, ir as UTooltip, rr as UTooltipContent, nr as UTooltipTrigger, he as cn, a as toast, r as useClickOutside, g as useCopyToClipboard, l as useDebounce, h as useEventListener, m as useForm, u as useHotkeys, s as useInterval, f as useLocalStorage, i as useMediaQuery, t as useMounted, n as usePagination, p as useTimeout, d as useToast, c as useToggle };
135
+ export { V as UAccordion, V as UGAccordion, G as UAccordionContent, G as UGAccordionContent, We as UAccordionItem, We as UGAccordionItem, W as UAccordionTrigger, W as UGAccordionTrigger, Ee as UAlert, Ee as UGAlert, pe as UAlertDescription, pe as UGAlertDescription, $e as UAlertTitle, $e as UGAlertTitle, l as UAside, l as UGAside, P as UAvatar, P as UGAvatar, tt as UAvatarFallback, tt as UGAvatarFallback, re as UAvatarGroup, re as UGAvatarGroup, ae as UAvatarImage, ae as UGAvatarImage, T as UBadge, T as UGBadge, we as UBreadcrumb, we as UGBreadcrumb, He as UBreadcrumbItem, He as UGBreadcrumbItem, Ie as UBreadcrumbLink, Ie as UGBreadcrumbLink, Oe as UBreadcrumbSeparator, Oe as UGBreadcrumbSeparator, n as UButton, n as UGButton, i as UButtonGroup, i as UGButtonGroup, O as UCard, O as UGCard, u as UCardContent, u as UGCardContent, D as UCardDescription, D as UGCardDescription, o as UCardFooter, o as UGCardFooter, r as UCardHeader, r as UGCardHeader, E as UCardTitle, E as UGCardTitle, Te as UCheckbox, Te as UGCheckbox, Se as UCheckboxGroup, Se as UGCheckboxGroup, g as UCol, g as UGCol, a as UConfigProvider, a as UGConfigProvider, h as UContainer, h as UGContainer, Me as UContextMenu, Me as UGContextMenu, q as UContextMenuContent, q as UGContextMenuContent, J as UContextMenuItem, J as UGContextMenuItem, X as UContextMenuSeparator, X as UGContextMenuSeparator, B as UContextMenuTrigger, B as UGContextMenuTrigger, Re as UDescriptions, Re as UGDescriptions, Ge as UDescriptionsItem, Ge as UGDescriptionsItem, L as UDialog, L as UGDialog, ve as UDrawer, ve as UGDrawer, it as UDrawerClose, it as UGDrawerClose, ie as UDrawerContent, ie as UGDrawerContent, F as UDrawerDescription, F as UGDrawerDescription, nt as UDrawerFooter, nt as UGDrawerFooter, oe as UDrawerHeader, oe as UGDrawerHeader, z as UDrawerTitle, z as UGDrawerTitle, $ as UDropdown, $ as UGDropdown, $ as UGDropdownMenu, N as UDropdownContent, N as UGDropdownContent, ce as UDropdownItem, ce as UGDropdownItem, H as UDropdownSeparator, H as UGDropdownSeparator, se as UDropdownTrigger, se as UGDropdownTrigger, Be as UEmptyState, Be as UGEmptyState, y as UFooter, y as UGFooter, j as UForm, j as UGForm, Ce as UFormControl, Ce as UGFormControl, Xe as UFormDescription, Xe as UGFormDescription, ze as UFormField, ze as UGFormField, Ke as UFormItem, Ke as UGFormItem, je as UFormLabel, je as UGFormLabel, ge as UFormMessage, ge as UGFormMessage, S as UGHeader, S as UHeader, C as UGIcon, C as UIcon, ee as UGInput, ee as UInput, s as UGLabel, s as ULabel, _ as UGLink, _ as ULink, d as UGMain, d as UMain, k as UGModal, k as UModal, R as UGNavigationMenu, R as UNavigationMenu, I as UGNavigationMenuContent, I as UNavigationMenuContent, Y as UGNavigationMenuItem, Y as UNavigationMenuItem, Ne as UGNavigationMenuLink, Ne as UNavigationMenuLink, M as UGNavigationMenuTrigger, M as UNavigationMenuTrigger, be as UGNumberInput, be as UNumberInput, Ve as UGOTPInput, Ve as UOTPInput, he as UGPagination, he as UPagination, U as UGPopover, U as UPopover, K as UGPopoverContent, K as UPopoverContent, Q as UGPopoverTrigger, Q as UPopoverTrigger, ye as UGProgress, ye as UProgress, Qe as UGRadio, Qe as URadio, Fe as UGRadioGroup, Fe as URadioGroup, w as UGRow, w as URow, te as UGScrollbar, te as UScrollbar, Ae as UGSelect, Ae as USelect, m as UGSeparator, m as USeparator, qe as UGSheet, qe as USheet, A as UGSidebar, A as USidebar, Pe as UGSkeleton, Pe as USkeleton, Je as UGSlider, Je as USlider, f as UGSpace, f as USpace, p as UGSpinner, p as USpinner, v as UGSplitter, v as USplitter, x as UGSplitterPanel, x as USplitterPanel, Ye as UGStatistic, Ye as UStatistic, le as UGSteps, le as USteps, xe as UGSwitch, xe as USwitch, Le as UGTable, Le as UTable, ke as UGTableBody, ke as UTableBody, De as UGTableCell, De as UTableCell, me as UGTableHead, me as UTableHead, et as UGTableHeader, et as UTableHeader, ot as UGTableRow, ot as UTableRow, de as UGTabs, de as UTabs, ue as UGTabsContent, ue as UTabsContent, fe as UGTabsList, fe as UTabsList, Z as UGTabsTrigger, Z as UTabsTrigger, c as UGTag, c as UTag, b as UGText, b as UText, Ze as UGTextarea, Ze as UTextarea, Ue as UGToaster, Ue as UToaster, at as UGTooltip, at as UTooltip, _e as UGTooltipContent, _e as UTooltipContent, rt as UGTooltipTrigger, rt as UTooltipTrigger, e as cn, Tt as default, wt as install, ne as theme, st as toast, ut as useClickOutside, xt as useCopyToClipboard, mt as useDebounce, bt as useEventListener, yt as useForm, ht as useHotkeys, ft as useInterval, _t as useLocalStorage, dt as useMediaQuery, ct as useMounted, lt as usePagination, vt as useTimeout, gt as useToast, pt as useToggle, t as useUIConfig };
2940
136
 
2941
137
  //# sourceMappingURL=index.js.map