@ug666/ui-vue 0.2.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 (262) hide show
  1. package/dist/aliases.d.ts +38 -21
  2. package/dist/aliases.d.ts.map +1 -1
  3. package/dist/blocks/feature-grid.vue.d.ts +9 -13
  4. package/dist/blocks/feature-grid.vue.d.ts.map +1 -1
  5. package/dist/blocks/index.cjs +1 -1
  6. package/dist/blocks/index.cjs.map +1 -1
  7. package/dist/blocks/index.js +155 -65
  8. package/dist/blocks/index.js.map +1 -1
  9. package/dist/blocks/landing-hero.vue.d.ts +21 -19
  10. package/dist/blocks/landing-hero.vue.d.ts.map +1 -1
  11. package/dist/button-CVw3ryBz.cjs +2 -0
  12. package/dist/button-CVw3ryBz.cjs.map +1 -0
  13. package/dist/button-D_ikOxrp.js +292 -0
  14. package/dist/button-D_ikOxrp.js.map +1 -0
  15. package/dist/cn-CFAiuoYh.cjs +2 -0
  16. package/dist/cn-CFAiuoYh.cjs.map +1 -0
  17. package/dist/cn-Cl2u7rTh.js +10 -0
  18. package/dist/cn-Cl2u7rTh.js.map +1 -0
  19. package/dist/components/accordion.vue.d.ts +29 -6
  20. package/dist/components/accordion.vue.d.ts.map +1 -1
  21. package/dist/components/alert.vue.d.ts +9 -8
  22. package/dist/components/alert.vue.d.ts.map +1 -1
  23. package/dist/components/avatar-group.vue.d.ts +3 -2
  24. package/dist/components/avatar-group.vue.d.ts.map +1 -1
  25. package/dist/components/avatar.vue.d.ts +6 -5
  26. package/dist/components/avatar.vue.d.ts.map +1 -1
  27. package/dist/components/badge.vue.d.ts +9 -16
  28. package/dist/components/badge.vue.d.ts.map +1 -1
  29. package/dist/components/breadcrumb.vue.d.ts +20 -11
  30. package/dist/components/breadcrumb.vue.d.ts.map +1 -1
  31. package/dist/components/button-group.vue.d.ts +92 -0
  32. package/dist/components/button-group.vue.d.ts.map +1 -0
  33. package/dist/components/button.vue.d.ts +77 -39
  34. package/dist/components/button.vue.d.ts.map +1 -1
  35. package/dist/components/card.vue.d.ts +15 -11
  36. package/dist/components/card.vue.d.ts.map +1 -1
  37. package/dist/components/checkbox-group.vue.d.ts +43 -0
  38. package/dist/components/checkbox-group.vue.d.ts.map +1 -0
  39. package/dist/components/checkbox.vue.d.ts +23 -24
  40. package/dist/components/checkbox.vue.d.ts.map +1 -1
  41. package/dist/components/config-provider.vue.d.ts +77 -0
  42. package/dist/components/config-provider.vue.d.ts.map +1 -0
  43. package/dist/components/container.vue.d.ts +141 -0
  44. package/dist/components/container.vue.d.ts.map +1 -0
  45. package/dist/components/context/accordion-context.d.ts +7 -2
  46. package/dist/components/context/accordion-context.d.ts.map +1 -1
  47. package/dist/components/context/button-group.d.ts +40 -0
  48. package/dist/components/context/button-group.d.ts.map +1 -0
  49. package/dist/components/context/checkbox-context.d.ts +14 -0
  50. package/dist/components/context/checkbox-context.d.ts.map +1 -0
  51. package/dist/components/context/context-menu-context.d.ts +4 -0
  52. package/dist/components/context/context-menu-context.d.ts.map +1 -1
  53. package/dist/components/context/drawer-context.d.ts +4 -0
  54. package/dist/components/context/drawer-context.d.ts.map +1 -1
  55. package/dist/components/context/dropdown-context.d.ts +10 -0
  56. package/dist/components/context/dropdown-context.d.ts.map +1 -1
  57. package/dist/components/context/form-context.d.ts +31 -1
  58. package/dist/components/context/form-context.d.ts.map +1 -1
  59. package/dist/components/context/popover-context.d.ts +2 -0
  60. package/dist/components/context/popover-context.d.ts.map +1 -1
  61. package/dist/components/context/radio-context.d.ts +11 -3
  62. package/dist/components/context/radio-context.d.ts.map +1 -1
  63. package/dist/components/context/tabs-context.d.ts +2 -0
  64. package/dist/components/context/tabs-context.d.ts.map +1 -1
  65. package/dist/components/context/tooltip-context.d.ts +2 -0
  66. package/dist/components/context/tooltip-context.d.ts.map +1 -1
  67. package/dist/components/context-menu.vue.d.ts +6 -5
  68. package/dist/components/context-menu.vue.d.ts.map +1 -1
  69. package/dist/components/descriptions.vue.d.ts +12 -18
  70. package/dist/components/descriptions.vue.d.ts.map +1 -1
  71. package/dist/components/dialog.vue.d.ts +5 -3
  72. package/dist/components/dialog.vue.d.ts.map +1 -1
  73. package/dist/components/drawer.vue.d.ts +9 -8
  74. package/dist/components/drawer.vue.d.ts.map +1 -1
  75. package/dist/components/dropdown.vue.d.ts +11 -10
  76. package/dist/components/dropdown.vue.d.ts.map +1 -1
  77. package/dist/components/empty-state.vue.d.ts +16 -17
  78. package/dist/components/empty-state.vue.d.ts.map +1 -1
  79. package/dist/components/form.vue.d.ts +95 -17
  80. package/dist/components/form.vue.d.ts.map +1 -1
  81. package/dist/components/icon.vue.d.ts +28 -0
  82. package/dist/components/icon.vue.d.ts.map +1 -0
  83. package/dist/components/index.cjs +1 -1
  84. package/dist/components/index.d.ts +21 -6
  85. package/dist/components/index.d.ts.map +1 -1
  86. package/dist/components/index.js +5 -5
  87. package/dist/components/input.vue.d.ts +71 -29
  88. package/dist/components/input.vue.d.ts.map +1 -1
  89. package/dist/components/label.vue.d.ts +12 -19
  90. package/dist/components/label.vue.d.ts.map +1 -1
  91. package/dist/components/layout.d.ts +194 -0
  92. package/dist/components/layout.d.ts.map +1 -0
  93. package/dist/components/link.vue.d.ts +55 -0
  94. package/dist/components/link.vue.d.ts.map +1 -0
  95. package/dist/components/modal.vue.d.ts +15 -16
  96. package/dist/components/modal.vue.d.ts.map +1 -1
  97. package/dist/components/navigation-menu.vue.d.ts +30 -14
  98. package/dist/components/navigation-menu.vue.d.ts.map +1 -1
  99. package/dist/components/number-input.vue.d.ts +53 -25
  100. package/dist/components/number-input.vue.d.ts.map +1 -1
  101. package/dist/components/otp-input.vue.d.ts +12 -9
  102. package/dist/components/otp-input.vue.d.ts.map +1 -1
  103. package/dist/components/pagination.vue.d.ts +15 -13
  104. package/dist/components/pagination.vue.d.ts.map +1 -1
  105. package/dist/components/popover.vue.d.ts +9 -8
  106. package/dist/components/popover.vue.d.ts.map +1 -1
  107. package/dist/components/progress.vue.d.ts +3 -2
  108. package/dist/components/progress.vue.d.ts.map +1 -1
  109. package/dist/components/radio-group.vue.d.ts +23 -30
  110. package/dist/components/radio-group.vue.d.ts.map +1 -1
  111. package/dist/components/radio.vue.d.ts +28 -17
  112. package/dist/components/radio.vue.d.ts.map +1 -1
  113. package/dist/components/scrollbar.vue.d.ts +65 -0
  114. package/dist/components/scrollbar.vue.d.ts.map +1 -0
  115. package/dist/components/select.vue.d.ts +83 -35
  116. package/dist/components/select.vue.d.ts.map +1 -1
  117. package/dist/components/separator.vue.d.ts +19 -8
  118. package/dist/components/separator.vue.d.ts.map +1 -1
  119. package/dist/components/sheet.vue.d.ts +15 -16
  120. package/dist/components/sheet.vue.d.ts.map +1 -1
  121. package/dist/components/sidebar.vue.d.ts +13 -35
  122. package/dist/components/sidebar.vue.d.ts.map +1 -1
  123. package/dist/components/skeleton.vue.d.ts +3 -2
  124. package/dist/components/skeleton.vue.d.ts.map +1 -1
  125. package/dist/components/slider.vue.d.ts +56 -22
  126. package/dist/components/slider.vue.d.ts.map +1 -1
  127. package/dist/components/space.vue.d.ts +35 -0
  128. package/dist/components/space.vue.d.ts.map +1 -0
  129. package/dist/components/spinner.vue.d.ts +6 -5
  130. package/dist/components/spinner.vue.d.ts.map +1 -1
  131. package/dist/components/splitter.vue.d.ts +234 -0
  132. package/dist/components/splitter.vue.d.ts.map +1 -0
  133. package/dist/components/statistic.vue.d.ts +12 -15
  134. package/dist/components/statistic.vue.d.ts.map +1 -1
  135. package/dist/components/steps.vue.d.ts +8 -19
  136. package/dist/components/steps.vue.d.ts.map +1 -1
  137. package/dist/components/switch.vue.d.ts +50 -19
  138. package/dist/components/switch.vue.d.ts.map +1 -1
  139. package/dist/components/table.vue.d.ts +6 -5
  140. package/dist/components/table.vue.d.ts.map +1 -1
  141. package/dist/components/tabs.vue.d.ts +26 -9
  142. package/dist/components/tabs.vue.d.ts.map +1 -1
  143. package/dist/components/tag.vue.d.ts +11 -18
  144. package/dist/components/tag.vue.d.ts.map +1 -1
  145. package/dist/components/text.vue.d.ts +32 -0
  146. package/dist/components/text.vue.d.ts.map +1 -0
  147. package/dist/components/textarea.vue.d.ts +58 -26
  148. package/dist/components/textarea.vue.d.ts.map +1 -1
  149. package/dist/components/toast.vue.d.ts +3 -2
  150. package/dist/components/toast.vue.d.ts.map +1 -1
  151. package/dist/components/tooltip.vue.d.ts +7 -6
  152. package/dist/components/tooltip.vue.d.ts.map +1 -1
  153. package/dist/components/types/forms.d.ts +15 -0
  154. package/dist/components/types/forms.d.ts.map +1 -0
  155. package/dist/components/types/foundation.d.ts +5 -0
  156. package/dist/components/types/foundation.d.ts.map +1 -0
  157. package/dist/composables/index.cjs +1 -1
  158. package/dist/composables/index.d.ts +2 -1
  159. package/dist/composables/index.d.ts.map +1 -1
  160. package/dist/composables/index.js +2 -2
  161. package/dist/composables/use-copy-to-clipboard.d.ts.map +1 -1
  162. package/dist/composables/use-event-listener.d.ts.map +1 -1
  163. package/dist/composables/use-form.d.ts +38 -26
  164. package/dist/composables/use-form.d.ts.map +1 -1
  165. package/dist/composables/use-local-storage.d.ts.map +1 -1
  166. package/dist/composables-C-Go-D3m.js +386 -0
  167. package/dist/composables-C-Go-D3m.js.map +1 -0
  168. package/dist/composables-CiWPyBEE.cjs +2 -0
  169. package/dist/composables-CiWPyBEE.cjs.map +1 -0
  170. package/dist/global.d.ts +17 -0
  171. package/dist/global.d.ts.map +1 -1
  172. package/dist/icon-NbssmDYT.js +1561 -0
  173. package/dist/icon-NbssmDYT.js.map +1 -0
  174. package/dist/icon-jF_XZntG.cjs +2 -0
  175. package/dist/icon-jF_XZntG.cjs.map +1 -0
  176. package/dist/index.cjs +1 -1
  177. package/dist/index.cjs.map +1 -1
  178. package/dist/index.d.ts +26 -11
  179. package/dist/index.d.ts.map +1 -1
  180. package/dist/index.js +134 -332
  181. package/dist/index.js.map +1 -1
  182. package/dist/internal/use-overlay-focus.d.ts +3 -0
  183. package/dist/internal/use-overlay-focus.d.ts.map +1 -0
  184. package/dist/internal/use-overlay-lifecycle.d.ts +3 -0
  185. package/dist/internal/use-overlay-lifecycle.d.ts.map +1 -0
  186. package/dist/labs/file-preview.vue.d.ts +42 -0
  187. package/dist/labs/file-preview.vue.d.ts.map +1 -0
  188. package/dist/labs/index.cjs +1 -1
  189. package/dist/labs/index.cjs.map +1 -1
  190. package/dist/labs/index.d.ts +7 -2
  191. package/dist/labs/index.d.ts.map +1 -1
  192. package/dist/labs/index.js +209 -5
  193. package/dist/labs/index.js.map +1 -1
  194. package/dist/labs/model-card.vue.d.ts +46 -0
  195. package/dist/labs/model-card.vue.d.ts.map +1 -0
  196. package/dist/patterns/admin-shell.vue.d.ts +18 -17
  197. package/dist/patterns/admin-shell.vue.d.ts.map +1 -1
  198. package/dist/patterns/confirm-dialog.vue.d.ts +13 -15
  199. package/dist/patterns/confirm-dialog.vue.d.ts.map +1 -1
  200. package/dist/patterns/copy-field.vue.d.ts +12 -15
  201. package/dist/patterns/copy-field.vue.d.ts.map +1 -1
  202. package/dist/patterns/index.cjs +1 -1
  203. package/dist/patterns/index.cjs.map +1 -1
  204. package/dist/patterns/index.js +178 -79
  205. package/dist/patterns/index.js.map +1 -1
  206. package/dist/patterns/page-header.vue.d.ts +25 -23
  207. package/dist/patterns/page-header.vue.d.ts.map +1 -1
  208. package/dist/primitives/index.cjs +1 -1
  209. package/dist/primitives/index.d.ts +13 -1
  210. package/dist/primitives/index.d.ts.map +1 -1
  211. package/dist/primitives/index.js +3 -3
  212. package/dist/resolver.cjs +1 -1
  213. package/dist/resolver.cjs.map +1 -1
  214. package/dist/resolver.d.ts.map +1 -1
  215. package/dist/resolver.js +13 -12
  216. package/dist/resolver.js.map +1 -1
  217. package/dist/sidebar-DI7FOJiw.cjs +2 -0
  218. package/dist/sidebar-DI7FOJiw.cjs.map +1 -0
  219. package/dist/sidebar-wW1OGS5T.js +442 -0
  220. package/dist/sidebar-wW1OGS5T.js.map +1 -0
  221. package/dist/statistic-1kiSjvCX.cjs +2 -0
  222. package/dist/statistic-1kiSjvCX.cjs.map +1 -0
  223. package/dist/statistic-DBlNBT-A.js +4748 -0
  224. package/dist/statistic-DBlNBT-A.js.map +1 -0
  225. package/dist/styles.css +2797 -956
  226. package/dist/theme.cjs +2 -0
  227. package/dist/theme.cjs.map +1 -0
  228. package/dist/theme.d.ts +172 -76
  229. package/dist/theme.d.ts.map +1 -1
  230. package/dist/theme.js +128 -0
  231. package/dist/theme.js.map +1 -0
  232. package/dist/themes/default.css +80 -0
  233. package/dist/themes/mecha.css +195 -0
  234. package/dist/themes/minimal.css +160 -0
  235. package/dist/{toast-state-BBoVvR0u.cjs → toast-state-DZPoRLPw.cjs} +2 -2
  236. package/dist/{toast-state-BBoVvR0u.cjs.map → toast-state-DZPoRLPw.cjs.map} +1 -1
  237. package/dist/{toast-state-Crugc-IE.js → toast-state-DyrVOjSJ.js} +1 -1
  238. package/dist/{toast-state-Crugc-IE.js.map → toast-state-DyrVOjSJ.js.map} +1 -1
  239. package/dist/tokens.css +1173 -18
  240. package/package.json +24 -12
  241. package/dist/aliases-CKe0wVQy.cjs +0 -2
  242. package/dist/aliases-CKe0wVQy.cjs.map +0 -1
  243. package/dist/aliases-u3xep8jx.js +0 -2732
  244. package/dist/aliases-u3xep8jx.js.map +0 -1
  245. package/dist/button-C10AiP5_.cjs +0 -2
  246. package/dist/button-C10AiP5_.cjs.map +0 -1
  247. package/dist/button-Sy9e0tiI.js +0 -1742
  248. package/dist/button-Sy9e0tiI.js.map +0 -1
  249. package/dist/component-layers.d.ts +0 -199
  250. package/dist/component-layers.d.ts.map +0 -1
  251. package/dist/composables-GXmQiqgg.cjs +0 -2
  252. package/dist/composables-GXmQiqgg.cjs.map +0 -1
  253. package/dist/composables-YMNfao5g.js +0 -251
  254. package/dist/composables-YMNfao5g.js.map +0 -1
  255. package/dist/separator-BnNQAp6A.js +0 -259
  256. package/dist/separator-BnNQAp6A.js.map +0 -1
  257. package/dist/separator-Bynwn-we.cjs +0 -2
  258. package/dist/separator-Bynwn-we.cjs.map +0 -1
  259. package/dist/sidebar-BnZB7vlK.js +0 -344
  260. package/dist/sidebar-BnZB7vlK.js.map +0 -1
  261. package/dist/sidebar-xKPzL0NQ.cjs +0 -2
  262. package/dist/sidebar-xKPzL0NQ.cjs.map +0 -1
@@ -0,0 +1,1561 @@
1
+ import { t as e } from "./cn-Cl2u7rTh.js";
2
+ import { a as t, n, o as r, r as i, s as a } from "./button-D_ikOxrp.js";
3
+ import { Comment as o, Fragment as s, Text as c, cloneVNode as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createTextVNode as h, createVNode as g, defineComponent as _, h as v, mergeModels as y, mergeProps as b, nextTick as x, normalizeClass as S, normalizeStyle as C, onBeforeUnmount as w, onMounted as T, openBlock as E, provide as D, ref as O, renderList as k, renderSlot as A, resolveDynamicComponent as j, toDisplayString as M, toRef as N, unref as P, useAttrs as ee, useId as te, useModel as ne, useSlots as F, watch as re, withCtx as I, withModifiers as L } from "vue";
4
+ import { ExternalLink as R, Eye as ie, EyeOff as ae, Loader2 as z, X as oe } from "@lucide/vue";
5
+ import { countTextCharacters as se, limitTextByCount as ce } from "@ug666/ui-core";
6
+ //#region src/components/config-provider.vue
7
+ var le = i, ue = {
8
+ horizontal: "[&>[data-ug=button]]:[border-radius:0] [&>[data-ug=button]:first-child]:[border-radius:var(--radius-control)_0_0_var(--radius-control)] [&>[data-ug=button]:last-child]:[border-radius:0_var(--radius-control)_var(--radius-control)_0] [&>[data-ug=button]+[data-ug=button]]:-ml-px",
9
+ vertical: "[&>[data-ug=button]]:[border-radius:0] [&>[data-ug=button]:first-child]:[border-radius:var(--radius-control)_var(--radius-control)_0_0] [&>[data-ug=button]:last-child]:[border-radius:0_0_var(--radius-control)_var(--radius-control)] [&>[data-ug=button]+[data-ug=button]]:-mt-px"
10
+ }, de = {
11
+ small: "sm",
12
+ medium: "default",
13
+ large: "lg"
14
+ }, fe = _({
15
+ name: "UButtonGroup",
16
+ inheritAttrs: !1,
17
+ props: {
18
+ variant: String,
19
+ tone: String,
20
+ size: String,
21
+ shape: String,
22
+ disabled: {
23
+ type: Boolean,
24
+ default: void 0
25
+ },
26
+ orientation: {
27
+ type: String,
28
+ default: "horizontal"
29
+ },
30
+ attached: {
31
+ type: Boolean,
32
+ default: !1
33
+ },
34
+ class: String
35
+ },
36
+ setup(t, { attrs: i, slots: o }) {
37
+ let s = a(), c = u(() => t.size ?? de[s.value.size]), l = u(() => r(t.disabled, s.value.disabled));
38
+ D(n, {
39
+ variant: N(t, "variant"),
40
+ tone: N(t, "tone"),
41
+ size: c,
42
+ shape: N(t, "shape"),
43
+ disabled: l
44
+ });
45
+ let d = u(() => e("inline-flex", t.orientation === "horizontal" ? "flex-row items-center" : "flex-col items-stretch", t.attached ? ue[t.orientation] : "gap-2", t.class));
46
+ return () => v("div", {
47
+ ...i,
48
+ class: d.value,
49
+ role: "group",
50
+ "aria-disabled": l.value || void 0,
51
+ "aria-orientation": t.orientation,
52
+ "data-ug": "button-group",
53
+ "data-ug-slot": "root",
54
+ "data-state": l.value ? "disabled" : "default",
55
+ "data-variant": t.variant,
56
+ "data-tone": t.tone,
57
+ "data-size": c.value,
58
+ "data-shape": t.shape,
59
+ "data-orientation": t.orientation,
60
+ "data-attached": t.attached ? "true" : "false",
61
+ "data-ug-namespace": s.value.namespace
62
+ }, o.default?.());
63
+ }
64
+ }), pe = ["data-size", "data-state"], me = ["for"], he = {
65
+ class: "flex w-full min-w-0",
66
+ "data-ug-slot": "group"
67
+ }, ge = ["data-has-append", "data-has-prepend"], _e = [
68
+ "id",
69
+ "aria-describedby",
70
+ "aria-invalid",
71
+ "disabled",
72
+ "maxlength",
73
+ "placeholder",
74
+ "readonly",
75
+ "type",
76
+ "value"
77
+ ], ve = {
78
+ key: 1,
79
+ "aria-hidden": "true",
80
+ class: "shrink-0 whitespace-nowrap text-xs tabular-nums text-text-tertiary",
81
+ "data-ug-slot": "count"
82
+ }, ye = ["aria-label", "aria-pressed"], be = [
83
+ "disabled",
84
+ "form",
85
+ "name",
86
+ "value"
87
+ ], xe = {
88
+ key: 2,
89
+ "aria-hidden": "true",
90
+ class: "self-end text-xs tabular-nums text-text-tertiary",
91
+ "data-ug-slot": "count"
92
+ }, Se = ["id"], Ce = ["id"], we = /* @__PURE__ */ _({
93
+ name: "UInput",
94
+ inheritAttrs: !1,
95
+ __name: "input",
96
+ props: /*@__PURE__*/ y({
97
+ label: { default: void 0 },
98
+ error: { default: void 0 },
99
+ helperText: { default: void 0 },
100
+ id: { default: void 0 },
101
+ type: { default: "text" },
102
+ disabled: {
103
+ type: Boolean,
104
+ default: void 0
105
+ },
106
+ readonly: {
107
+ type: Boolean,
108
+ default: !1
109
+ },
110
+ size: { default: void 0 },
111
+ placeholder: { default: void 0 },
112
+ prefixIcon: { default: void 0 },
113
+ suffixIcon: { default: void 0 },
114
+ clearIcon: { default: void 0 },
115
+ passwordVisibleIcon: { default: void 0 },
116
+ passwordHiddenIcon: { default: void 0 },
117
+ clearable: {
118
+ type: Boolean,
119
+ default: !1
120
+ },
121
+ showPassword: {
122
+ type: Boolean,
123
+ default: !1
124
+ },
125
+ showWordLimit: {
126
+ type: Boolean,
127
+ default: !1
128
+ },
129
+ wordLimitPosition: { default: "inside" },
130
+ countCharacters: { default: void 0 },
131
+ maxlength: { default: void 0 },
132
+ formatter: {
133
+ type: Function,
134
+ default: void 0
135
+ },
136
+ parser: {
137
+ type: Function,
138
+ default: void 0
139
+ },
140
+ class: { default: void 0 }
141
+ }, {
142
+ modelValue: {},
143
+ modelModifiers: {}
144
+ }),
145
+ emits: /*@__PURE__*/ y([
146
+ "blur",
147
+ "focus",
148
+ "input",
149
+ "change",
150
+ "clear",
151
+ "compositionend",
152
+ "compositionstart"
153
+ ], ["update:modelValue"]),
154
+ setup(n, { expose: i, emit: o }) {
155
+ let s = n, c = o, l = ne(n, "modelValue"), h = ee(), g = a(), _ = te(), v = O(null), y = O(!1), C = O(!1), D = O(!1), k = null, N = u(() => s.id ?? _), I = u(() => `${N.value}-message`), L = u(() => r(s.disabled, g.value.disabled)), R = u(() => t(s.size, g.value.size)), z = u(() => l.value === void 0 || l.value === null ? "" : String(l.value)), le = u(() => s.formatter && !C.value && z.value !== "" ? s.formatter(z.value) : z.value), ue = u(() => s.clearable && z.value.length > 0 && !L.value && !s.readonly), de = u(() => s.showPassword && s.type === "password" && !L.value), fe = u(() => s.showPassword && s.type === "password" && D.value ? "text" : s.type), we = u(() => !!(s.error || s.helperText || s.showWordLimit && s.maxlength)), Te = u(() => se(z.value, s.countCharacters)), Ee = u(() => s.showWordLimit && s.maxlength && s.wordLimitPosition === "inside"), De = u(() => !!(s.formatter && h.name)), Oe = u(() => [
156
+ L.value && "disabled",
157
+ s.error && "invalid",
158
+ s.readonly && "readonly",
159
+ y.value && "focused"
160
+ ].filter(Boolean).join(" ") || "default"), B = u(() => ({
161
+ "h-[var(--control-height-sm)] text-xs": R.value === "sm",
162
+ "h-[var(--control-height-md)] text-sm": R.value === "default",
163
+ "h-[var(--control-height-lg)] text-base": R.value === "lg"
164
+ })), V = u(() => ({
165
+ "px-[var(--control-padding-x-sm)]": R.value === "sm",
166
+ "px-[var(--control-padding-x-md)]": R.value === "default",
167
+ "px-[var(--control-padding-x-lg)]": R.value === "lg"
168
+ })), ke = u(() => e("flex min-w-0 flex-1 items-center rounded-[var(--radius-control)] border bg-surface-1", B.value, "transition-[background,border-color,box-shadow] duration-[var(--motion-duration-base)] ease-[var(--motion-easing-standard)] motion-reduce:transition-none", "focus-within:ring-2 focus-within:ring-offset-1", s.error ? "border-danger focus-within:ring-danger/30" : "border-border-strong focus-within:border-primary focus-within:ring-ring/30", L.value && "cursor-not-allowed opacity-50", s.readonly && "bg-surface-2", H.prepend && "[border-end-start-radius:0] [border-start-start-radius:0]", H.append && "[border-end-end-radius:0] [border-start-end-radius:0]")), Ae = u(() => e("h-full min-w-0 flex-1 border-0 bg-transparent py-0 text-text-primary outline-none placeholder:text-text-tertiary", V.value, (H.prefix || s.prefixIcon) && "pl-2", (H.suffix || s.suffixIcon || ue.value || de.value || Ee.value) && "pr-2", L.value && "cursor-not-allowed", s.class)), je = u(() => typeof h["aria-describedby"] == "string" ? h["aria-describedby"] : we.value ? I.value : void 0), Me = u(() => {
169
+ let e = h["aria-invalid"];
170
+ return typeof e == "boolean" || e === "true" || e === "false" || e === "grammar" || e === "spelling" ? e : s.error ? !0 : void 0;
171
+ }), Ne = u(() => {
172
+ let e = { ...h };
173
+ return delete e.class, delete e["aria-describedby"], delete e["aria-invalid"], De.value && delete e.name, e;
174
+ }), H = F();
175
+ function Pe(e) {
176
+ let t = e.target, n = C.value || !s.parser ? t.value : s.parser(t.value), r = C.value ? n : ce(n, s.maxlength, s.countCharacters);
177
+ r !== t.value && (t.value = r), l.value = r, c("input", e);
178
+ }
179
+ function Fe(e) {
180
+ C.value = !0, c("compositionstart", e);
181
+ }
182
+ function Ie(e) {
183
+ C.value = !1;
184
+ let t = e.target, n = ce(s.parser ? s.parser(t.value) : t.value, s.maxlength, s.countCharacters);
185
+ n !== t.value && (t.value = n), l.value = n, c("compositionend", e);
186
+ }
187
+ function Le(e) {
188
+ c("change", e);
189
+ }
190
+ function Re(e) {
191
+ y.value = !1, c("blur", e);
192
+ }
193
+ function ze(e) {
194
+ y.value = !0, c("focus", e);
195
+ }
196
+ function Be() {
197
+ l.value = "", c("clear"), v.value?.focus();
198
+ }
199
+ function Ve() {
200
+ v.value?.focus();
201
+ }
202
+ function He() {
203
+ v.value?.blur();
204
+ }
205
+ function Ue() {
206
+ v.value?.select();
207
+ }
208
+ function U() {
209
+ D.value = !1;
210
+ }
211
+ function We() {
212
+ let e = v.value?.form ?? null;
213
+ k !== e && (k?.removeEventListener("reset", U), k = e, k?.addEventListener("reset", U));
214
+ }
215
+ return T(() => void x(We)), re(() => h.form, () => void x(We)), w(() => k?.removeEventListener("reset", U)), i({
216
+ focus: Ve,
217
+ blur: He,
218
+ select: Ue,
219
+ clear: Be,
220
+ el: v
221
+ }), (t, r) => (E(), p("div", {
222
+ class: "flex min-w-0 flex-col gap-1",
223
+ "data-size": R.value,
224
+ "data-state": Oe.value,
225
+ "data-ug": "input",
226
+ "data-ug-slot": "root",
227
+ "data-variant": "default"
228
+ }, [
229
+ n.label ? (E(), p("label", {
230
+ key: 0,
231
+ for: N.value,
232
+ class: "text-sm font-medium text-text-primary",
233
+ "data-ug-slot": "label"
234
+ }, M(n.label), 9, me)) : f("", !0),
235
+ m("div", he, [
236
+ t.$slots.prepend ? (E(), p("span", {
237
+ key: 0,
238
+ class: S(P(e)("inline-flex shrink-0 items-center border border-r-0 border-border-strong bg-surface-2 text-text-secondary [border-end-start-radius:var(--radius-control)] [border-start-start-radius:var(--radius-control)]", B.value, V.value)),
239
+ "data-ug-slot": "prepend"
240
+ }, [A(t.$slots, "prepend")], 2)) : f("", !0),
241
+ m("div", {
242
+ class: S(ke.value),
243
+ "data-has-append": t.$slots.append ? "true" : void 0,
244
+ "data-has-prepend": t.$slots.prepend ? "true" : void 0,
245
+ "data-ug-slot": "wrapper"
246
+ }, [
247
+ t.$slots.prefix || n.prefixIcon ? (E(), p("span", {
248
+ key: 0,
249
+ "aria-hidden": "true",
250
+ class: S(P(e)("inline-flex shrink-0 items-center pr-0 text-text-secondary", V.value)),
251
+ "data-ug-slot": "prefix"
252
+ }, [A(t.$slots, "prefix", {}, () => [(E(), d(j(n.prefixIcon)))])], 2)) : f("", !0),
253
+ m("input", b(Ne.value, {
254
+ id: N.value,
255
+ ref_key: "inputRef",
256
+ ref: v,
257
+ "aria-describedby": je.value,
258
+ "aria-invalid": Me.value,
259
+ class: Ae.value,
260
+ "data-ug-slot": "control",
261
+ disabled: L.value,
262
+ maxlength: n.countCharacters ? void 0 : n.maxlength,
263
+ placeholder: n.placeholder,
264
+ readonly: n.readonly,
265
+ type: fe.value,
266
+ value: le.value,
267
+ onBlur: Re,
268
+ onChange: Le,
269
+ onCompositionend: Ie,
270
+ onCompositionstart: Fe,
271
+ onFocus: ze,
272
+ onInput: Pe
273
+ }), null, 16, _e),
274
+ Ee.value ? (E(), p("span", ve, M(Te.value) + "/" + M(n.maxlength), 1)) : f("", !0),
275
+ ue.value ? (E(), p("button", {
276
+ key: 2,
277
+ "aria-label": "清空输入",
278
+ class: "inline-flex h-full shrink-0 items-center justify-center px-[calc(var(--control-padding-x-sm)*0.5)] text-text-secondary hover:text-text-primary",
279
+ "data-ug-slot": "clear",
280
+ tabindex: "-1",
281
+ type: "button",
282
+ onClick: Be
283
+ }, [A(t.$slots, "clearIcon", {}, () => [(E(), d(j(n.clearIcon || P(oe)), {
284
+ "aria-hidden": "true",
285
+ size: 14
286
+ }))])])) : f("", !0),
287
+ de.value ? (E(), p("button", {
288
+ key: 3,
289
+ "aria-label": D.value ? "隐藏密码" : "显示密码",
290
+ "aria-pressed": D.value,
291
+ class: "inline-flex h-full shrink-0 items-center justify-center px-[calc(var(--control-padding-x-sm)*0.5)] text-text-secondary hover:text-text-primary",
292
+ "data-ug-slot": "password-toggle",
293
+ tabindex: "-1",
294
+ type: "button",
295
+ onClick: r[0] || (r[0] = (e) => D.value = !D.value)
296
+ }, [D.value ? A(t.$slots, "passwordVisibleIcon", {}, () => [(E(), d(j(n.passwordVisibleIcon || P(ae)), {
297
+ "aria-hidden": "true",
298
+ size: 15
299
+ }))], void 0, 0) : A(t.$slots, "passwordHiddenIcon", {}, () => [(E(), d(j(n.passwordHiddenIcon || P(ie)), {
300
+ "aria-hidden": "true",
301
+ size: 15
302
+ }))], void 0, 1)], 8, ye)) : f("", !0),
303
+ t.$slots.suffix || n.suffixIcon ? (E(), p("span", {
304
+ key: 4,
305
+ "aria-hidden": "true",
306
+ class: S(P(e)("inline-flex shrink-0 items-center pl-0 text-text-secondary", V.value)),
307
+ "data-ug-slot": "suffix"
308
+ }, [A(t.$slots, "suffix", {}, () => [(E(), d(j(n.suffixIcon)))])], 2)) : f("", !0)
309
+ ], 10, ge),
310
+ t.$slots.append ? (E(), p("span", {
311
+ key: 1,
312
+ class: S(P(e)("inline-flex shrink-0 items-center border border-l-0 border-border-strong bg-surface-2 text-text-secondary [border-end-end-radius:var(--radius-control)] [border-start-end-radius:var(--radius-control)]", B.value, V.value)),
313
+ "data-ug-slot": "append"
314
+ }, [A(t.$slots, "append")], 2)) : f("", !0)
315
+ ]),
316
+ De.value ? (E(), p("input", {
317
+ key: 1,
318
+ disabled: L.value,
319
+ form: typeof P(h).form == "string" ? P(h).form : void 0,
320
+ name: typeof P(h).name == "string" ? P(h).name : void 0,
321
+ type: "hidden",
322
+ value: z.value
323
+ }, null, 8, be)) : f("", !0),
324
+ n.showWordLimit && n.maxlength && n.wordLimitPosition === "outside" ? (E(), p("span", xe, M(Te.value) + "/" + M(n.maxlength), 1)) : f("", !0),
325
+ n.error ? (E(), p("p", {
326
+ key: 3,
327
+ id: I.value,
328
+ class: "text-xs text-danger",
329
+ "data-ug-slot": "message"
330
+ }, M(n.error), 9, Se)) : n.helperText ? (E(), p("p", {
331
+ key: 4,
332
+ id: I.value,
333
+ class: "text-xs text-text-secondary",
334
+ "data-ug-slot": "message"
335
+ }, M(n.helperText), 9, Ce)) : f("", !0)
336
+ ], 8, pe));
337
+ }
338
+ }), Te = [
339
+ "for",
340
+ "data-state",
341
+ "data-required",
342
+ "data-size",
343
+ "aria-disabled"
344
+ ], Ee = { "data-ug-slot": "label" }, De = {
345
+ key: 0,
346
+ class: "ml-[calc(var(--content-gap)*0.125)] text-danger",
347
+ "aria-hidden": "true",
348
+ "data-ug-slot": "marker"
349
+ }, Oe = /* @__PURE__ */ _({
350
+ name: "ULabel",
351
+ __name: "label",
352
+ props: {
353
+ for: { default: void 0 },
354
+ required: {
355
+ type: Boolean,
356
+ default: !1
357
+ },
358
+ size: {},
359
+ disabled: { type: Boolean },
360
+ class: { default: void 0 }
361
+ },
362
+ setup(n) {
363
+ let i = n, o = a(), s = u(() => t(i.size, o.value.size)), c = u(() => r(i.disabled, o.value.disabled)), l = u(() => e("font-medium leading-none text-text-primary", c.value && "cursor-not-allowed opacity-60", {
364
+ "text-xs": s.value === "sm",
365
+ "text-sm": s.value === "default",
366
+ "text-base": s.value === "lg"
367
+ }, i.class)), d = u(() => c.value ? "disabled" : i.required ? "required" : "default");
368
+ return (e, t) => (E(), p("label", {
369
+ for: i.for,
370
+ class: S(l.value),
371
+ "data-ug": "label",
372
+ "data-state": d.value,
373
+ "data-required": i.required || void 0,
374
+ "data-variant": "default",
375
+ "data-size": s.value,
376
+ "aria-disabled": c.value || void 0
377
+ }, [m("span", Ee, [A(e.$slots, "default")]), i.required ? (E(), p("span", De, "*")) : f("", !0)], 10, Te));
378
+ }
379
+ });
380
+ //#endregion
381
+ //#region src/components/card.vue?vue&type=script&setup=true&lang.ts
382
+ function B(t, n, r, i) {
383
+ return _({
384
+ name: t,
385
+ props: { class: {
386
+ type: String,
387
+ default: void 0
388
+ } },
389
+ setup(t, { attrs: a, slots: o }) {
390
+ let s = u(() => e(i, t.class));
391
+ return () => v(n, {
392
+ ...a,
393
+ class: s.value,
394
+ "data-ug-slot": r
395
+ }, o.default?.());
396
+ }
397
+ });
398
+ }
399
+ var V = B("UCardHeader", "div", "header", "flex flex-col gap-1.5 p-[var(--content-gap)] pb-[calc(var(--content-gap)*0.5)]"), ke = B("UCardTitle", "h3", "title", "font-semibold leading-none text-text-primary"), Ae = B("UCardDescription", "p", "description", "text-sm text-text-secondary"), je = B("UCardContent", "div", "content", "px-[var(--content-gap)] pb-[var(--content-gap)] pt-[calc(var(--content-gap)*0.5)]"), Me = B("UCardFooter", "div", "footer", "flex items-center gap-2 px-[var(--content-gap)] pb-[var(--content-gap)]"), Ne = /* @__PURE__ */ _({
400
+ name: "UCard",
401
+ __name: "card",
402
+ props: { class: { default: void 0 } },
403
+ setup(t) {
404
+ let n = t, r = u(() => e("overflow-hidden rounded-[var(--radius-panel)] border border-border-base bg-surface-1 shadow-sm", n.class));
405
+ return (e, t) => (E(), p("div", {
406
+ class: S(r.value),
407
+ "data-ug": "card",
408
+ "data-state": "default",
409
+ "data-variant": "default",
410
+ "data-size": "md"
411
+ }, [A(e.$slots, "default")], 2));
412
+ }
413
+ }), H = ["data-variant"], Pe = { "data-ug-slot": "label" }, Fe = /* @__PURE__ */ _({
414
+ name: "UBadge",
415
+ __name: "badge",
416
+ props: {
417
+ variant: { default: "default" },
418
+ class: { default: void 0 }
419
+ },
420
+ setup(t) {
421
+ let n = t, r = {
422
+ default: "border border-primary/20 bg-primary-soft text-primary-soft-fg",
423
+ secondary: "border border-border-base bg-surface-2 text-text-primary",
424
+ destructive: "border border-danger/20 bg-danger-soft text-danger-soft-fg",
425
+ outline: "border border-border-strong bg-transparent text-text-primary",
426
+ success: "border border-success/20 bg-success-soft text-success-soft-fg",
427
+ warning: "border border-warning/20 bg-warning-soft text-warning-soft-fg"
428
+ }, i = u(() => e("inline-flex min-h-[calc(var(--control-height-sm)*0.75)] items-center rounded-[var(--radius-control)] px-[var(--control-padding-x-sm)] py-[calc(var(--content-gap)*0.125)] text-xs font-semibold leading-none transition-colors", r[n.variant], n.class));
429
+ return (e, n) => (E(), p("span", {
430
+ class: S(i.value),
431
+ "data-ug": "badge",
432
+ "data-state": "default",
433
+ "data-variant": t.variant,
434
+ "data-size": "md"
435
+ }, [m("span", Pe, [A(e.$slots, "default")])], 10, H));
436
+ }
437
+ }), Ie = [
438
+ "data-state",
439
+ "data-variant",
440
+ "data-size"
441
+ ], Le = { "data-ug-slot": "label" }, Re = [
442
+ "disabled",
443
+ "data-state",
444
+ "data-variant",
445
+ "data-size"
446
+ ], ze = /* @__PURE__ */ _({
447
+ name: "UTag",
448
+ __name: "tag",
449
+ props: {
450
+ variant: { default: "default" },
451
+ size: { default: "default" },
452
+ closable: {
453
+ type: Boolean,
454
+ default: !1
455
+ },
456
+ disabled: {
457
+ type: Boolean,
458
+ default: !1
459
+ },
460
+ color: { default: void 0 },
461
+ class: { default: void 0 }
462
+ },
463
+ emits: ["close"],
464
+ setup(t, { emit: n }) {
465
+ let r = t, i = n, a = {
466
+ default: "border border-border-base bg-surface-2 text-text-primary",
467
+ primary: "border border-primary/20 bg-primary-soft text-primary-soft-fg",
468
+ success: "border border-success/20 bg-success-soft text-success-soft-fg",
469
+ warning: "border border-warning/20 bg-warning-soft text-warning-soft-fg",
470
+ destructive: "border border-danger/20 bg-danger-soft text-danger-soft-fg",
471
+ outline: "border border-border-strong bg-transparent text-text-primary"
472
+ }, o = {
473
+ sm: "min-h-[calc(var(--control-height-sm)*0.75)] px-[var(--control-padding-x-sm)] text-[11px]",
474
+ default: "min-h-[calc(var(--control-height-sm)*0.875)] px-[var(--control-padding-x-sm)] text-xs"
475
+ }, s = u(() => e("inline-flex items-center gap-1.5 rounded-[var(--radius-control)] font-medium leading-none transition-colors", a[r.variant], o[r.size], r.disabled && "cursor-not-allowed opacity-50", r.class)), c = u(() => r.disabled ? "disabled" : "default"), l = u(() => r.color ? {
476
+ backgroundColor: r.color,
477
+ color: "hsl(var(--primary-fg))",
478
+ borderColor: r.color
479
+ } : void 0);
480
+ function d(e) {
481
+ r.disabled || i("close", e);
482
+ }
483
+ return (e, n) => (E(), p("span", {
484
+ class: S(s.value),
485
+ style: C(l.value),
486
+ "data-ug": "tag",
487
+ "data-state": c.value,
488
+ "data-variant": t.variant,
489
+ "data-size": t.size
490
+ }, [m("span", Le, [A(e.$slots, "default")]), t.closable ? (E(), p("button", {
491
+ key: 0,
492
+ type: "button",
493
+ disabled: t.disabled,
494
+ class: "-mr-[calc(var(--control-padding-x-sm)*0.33)] inline-flex h-[calc(var(--control-height-sm)*0.5)] w-[calc(var(--control-height-sm)*0.5)] items-center justify-center rounded-[calc(var(--radius-control)*0.5)] opacity-70 transition hover:bg-surface-3 hover:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-current disabled:pointer-events-none",
495
+ "aria-label": "关闭标签",
496
+ "data-ug-slot": "close",
497
+ "data-state": c.value,
498
+ "data-variant": t.variant,
499
+ "data-size": t.size,
500
+ onClick: L(d, ["stop"])
501
+ }, [g(P(oe), {
502
+ size: 10,
503
+ "stroke-width": 2.5
504
+ })], 8, Re)) : f("", !0)], 14, Ie));
505
+ }
506
+ }), Be = /* @__PURE__ */ _({
507
+ name: "USpinner",
508
+ __name: "spinner",
509
+ props: {
510
+ size: { default: "md" },
511
+ label: { default: "加载中" },
512
+ class: { default: void 0 }
513
+ },
514
+ setup(t) {
515
+ let n = t, r = {
516
+ sm: "h-[calc(var(--control-height-sm)*0.5)] w-[calc(var(--control-height-sm)*0.5)]",
517
+ md: "h-[calc(var(--control-height-md)*0.6)] w-[calc(var(--control-height-md)*0.6)]",
518
+ lg: "h-[calc(var(--control-height-lg)*0.75)] w-[calc(var(--control-height-lg)*0.75)]"
519
+ }, i = u(() => e("animate-spin text-text-tertiary", r[n.size], n.class));
520
+ return (e, n) => (E(), d(P(z), {
521
+ class: S(i.value),
522
+ "aria-label": t.label,
523
+ role: "status",
524
+ "data-ug": "spinner",
525
+ "data-ug-slot": "icon",
526
+ "data-state": "loading",
527
+ "data-variant": "default",
528
+ "data-size": t.size
529
+ }, null, 8, [
530
+ "class",
531
+ "aria-label",
532
+ "data-size"
533
+ ]));
534
+ }
535
+ }), Ve = ["aria-orientation", "data-variant"], He = {
536
+ key: 0,
537
+ class: "shrink-0",
538
+ "data-ug-slot": "content"
539
+ }, Ue = /* @__PURE__ */ _({
540
+ name: "USeparator",
541
+ __name: "separator",
542
+ props: {
543
+ orientation: { default: "horizontal" },
544
+ lineStyle: { default: "solid" },
545
+ contentPosition: { default: "center" },
546
+ class: { default: void 0 }
547
+ },
548
+ setup(t) {
549
+ let n = t, r = F(), i = u(() => n.orientation === "horizontal" && (r.default?.() ?? []).some((e) => e.type === o ? !1 : e.type !== c || String(e.children ?? "").trim().length > 0)), a = {
550
+ start: "after:flex-[1_1_auto] before:flex-[0_1_5%]",
551
+ center: "after:flex-1 before:flex-1",
552
+ end: "after:flex-[0_1_5%] before:flex-[1_1_auto]"
553
+ }, s = {
554
+ solid: "border-solid before:border-solid after:border-solid",
555
+ dashed: "border-dashed before:border-dashed after:border-dashed",
556
+ dotted: "border-dotted before:border-dotted after:border-dotted"
557
+ }, l = u(() => e(n.orientation === "vertical" ? "h-full min-h-[1em] w-0 shrink-0 border-l border-border-base" : i.value ? "flex w-full items-center gap-3 text-xs text-text-secondary before:min-w-4 before:border-t before:border-border-base after:min-w-4 after:border-t after:border-border-base" : "w-full border-t border-border-base", i.value && a[n.contentPosition], s[n.lineStyle], n.class));
558
+ return (e, n) => (E(), p("div", {
559
+ role: "separator",
560
+ "aria-orientation": t.orientation,
561
+ class: S(l.value),
562
+ "data-ug": "separator",
563
+ "data-ug-slot": "line",
564
+ "data-state": "default",
565
+ "data-variant": `${t.orientation} ${t.lineStyle}`,
566
+ "data-size": "md"
567
+ }, [i.value ? (E(), p("span", He, [A(e.$slots, "default")])) : f("", !0)], 10, Ve));
568
+ }
569
+ }), U = [
570
+ "aria-disabled",
571
+ "data-external",
572
+ "data-size",
573
+ "data-state",
574
+ "data-tone",
575
+ "data-variant",
576
+ "href",
577
+ "rel",
578
+ "tabindex",
579
+ "target"
580
+ ], We = {
581
+ key: 0,
582
+ "aria-hidden": "true",
583
+ class: "inline-flex shrink-0",
584
+ "data-ug-slot": "start-icon"
585
+ }, Ge = {
586
+ key: 1,
587
+ "aria-hidden": "true",
588
+ class: "inline-flex shrink-0",
589
+ "data-ug-slot": "end-icon"
590
+ }, Ke = /* @__PURE__ */ _({
591
+ name: "ULink",
592
+ inheritAttrs: !1,
593
+ __name: "link",
594
+ props: {
595
+ startIcon: { default: void 0 },
596
+ endIcon: { default: void 0 },
597
+ href: { default: void 0 },
598
+ underline: { default: void 0 },
599
+ tone: { default: void 0 },
600
+ disabled: {
601
+ type: Boolean,
602
+ default: void 0
603
+ },
604
+ external: {
605
+ type: Boolean,
606
+ default: !1
607
+ },
608
+ showExternalIcon: {
609
+ type: Boolean,
610
+ default: !1
611
+ },
612
+ size: {},
613
+ rel: { default: void 0 },
614
+ target: { default: void 0 },
615
+ tabindex: { default: void 0 },
616
+ class: { default: void 0 }
617
+ },
618
+ emits: ["click"],
619
+ setup(n, { expose: i, emit: o }) {
620
+ let s = n, c = o, l = O(null), m = a(), h = u(() => r(s.disabled, m.value.disabled)), g = u(() => t(s.size, m.value.size)), _ = u(() => s.tone ?? m.value.link.tone ?? "primary"), v = u(() => s.underline ?? m.value.link.underline ?? "hover"), y = u(() => s.external ? s.target ?? "_blank" : s.target), x = u(() => {
621
+ if (y.value !== "_blank") return s.rel;
622
+ let e = new Set(s.rel?.split(/\s+/).filter(Boolean) ?? []);
623
+ return e.add("noopener"), e.add("noreferrer"), Array.from(e).join(" ");
624
+ }), S = {
625
+ neutral: "text-[hsl(var(--link-neutral))]",
626
+ primary: "text-[hsl(var(--link-primary))]",
627
+ success: "text-[hsl(var(--link-success))]",
628
+ warning: "text-[hsl(var(--link-warning))]",
629
+ danger: "text-[hsl(var(--link-danger))]",
630
+ info: "text-[hsl(var(--link-info))]",
631
+ inherit: "text-inherit"
632
+ }, C = u(() => e("inline-flex items-center gap-1 rounded-[var(--radius-sm)] outline-none transition-[color,text-decoration-color,opacity] duration-[var(--motion-duration-base)] ease-[var(--motion-easing-standard)] motion-reduce:transition-none", {
633
+ "text-xs": g.value === "sm",
634
+ "text-sm": g.value === "default",
635
+ "text-base": g.value === "lg"
636
+ }, S[_.value], "focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 focus-visible:ring-offset-background", v.value === "always" && "underline decoration-current underline-offset-4", v.value === "hover" && "decoration-transparent underline underline-offset-4 hover:decoration-current", v.value === "never" && "no-underline", h.value && "cursor-not-allowed opacity-50", s.class));
637
+ function w(e) {
638
+ if (h.value) {
639
+ e.preventDefault(), e.stopPropagation();
640
+ return;
641
+ }
642
+ c("click", e);
643
+ }
644
+ function T(e) {
645
+ l.value?.focus(e);
646
+ }
647
+ function D() {
648
+ l.value?.blur();
649
+ }
650
+ return i({
651
+ focus: T,
652
+ blur: D,
653
+ el: l
654
+ }), (e, t) => (E(), p("a", b(e.$attrs, {
655
+ ref_key: "anchorRef",
656
+ ref: l,
657
+ "aria-disabled": h.value || void 0,
658
+ class: C.value,
659
+ "data-external": n.external || void 0,
660
+ "data-size": g.value,
661
+ "data-state": h.value ? "disabled" : "default",
662
+ "data-tone": _.value,
663
+ "data-ug": "link",
664
+ "data-ug-slot": "root",
665
+ "data-variant": v.value,
666
+ href: h.value ? void 0 : n.href,
667
+ rel: x.value,
668
+ tabindex: h.value ? -1 : n.tabindex,
669
+ target: y.value,
670
+ onClick: w
671
+ }), [
672
+ e.$slots.startIcon || n.startIcon ? (E(), p("span", We, [A(e.$slots, "startIcon", {}, () => [(E(), d(j(n.startIcon)))])])) : f("", !0),
673
+ A(e.$slots, "default"),
674
+ e.$slots.endIcon || n.endIcon ? (E(), p("span", Ge, [A(e.$slots, "endIcon", {}, () => [(E(), d(j(n.endIcon)))])])) : f("", !0),
675
+ n.external && n.showExternalIcon ? (E(), d(P(R), {
676
+ key: 2,
677
+ "aria-hidden": "true",
678
+ class: "h-[1em] w-[1em]",
679
+ "data-ug-slot": "external-icon",
680
+ size: 16,
681
+ "stroke-width": 1.8
682
+ })) : f("", !0)
683
+ ], 16, U));
684
+ }
685
+ }), qe = /* @__PURE__ */ _({
686
+ name: "UText",
687
+ inheritAttrs: !1,
688
+ __name: "text",
689
+ props: {
690
+ as: { default: "span" },
691
+ tone: { default: "default" },
692
+ size: { default: void 0 },
693
+ truncate: {
694
+ type: Boolean,
695
+ default: !1
696
+ },
697
+ lineClamp: { default: void 0 },
698
+ class: { default: void 0 }
699
+ },
700
+ setup(n) {
701
+ let r = n, i = {
702
+ default: "text-text-primary",
703
+ primary: "text-primary",
704
+ secondary: "text-text-secondary",
705
+ tertiary: "text-text-tertiary",
706
+ success: "text-success",
707
+ warning: "text-warning",
708
+ danger: "text-danger",
709
+ info: "text-info",
710
+ inherit: "text-inherit"
711
+ }, o = {
712
+ xs: "text-[11px]",
713
+ sm: "text-xs",
714
+ default: "text-sm",
715
+ md: "text-[15px]",
716
+ lg: "text-base"
717
+ }, s = a(), c = u(() => r.size ?? t(void 0, s.value.size)), l = u(() => {
718
+ if (r.lineClamp === void 0 || r.lineClamp === null || r.lineClamp === "") return;
719
+ let e = typeof r.lineClamp == "number" ? r.lineClamp : Number(r.lineClamp);
720
+ return Number.isFinite(e) && e > 0 ? Math.floor(e) : void 0;
721
+ }), f = u(() => e(i[r.tone], o[c.value], r.truncate && !l.value && "inline-block min-w-0 max-w-full truncate align-bottom", r.class)), p = u(() => l.value ? {
722
+ display: "-webkit-box",
723
+ WebkitBoxOrient: "vertical",
724
+ WebkitLineClamp: l.value,
725
+ overflow: "hidden"
726
+ } : void 0);
727
+ return (e, t) => (E(), d(j(n.as), b(e.$attrs, {
728
+ class: f.value,
729
+ style: p.value,
730
+ "data-size": c.value,
731
+ "data-state": n.truncate || l.value ? "truncated" : "default",
732
+ "data-ug": "text",
733
+ "data-ug-slot": "root",
734
+ "data-variant": n.tone
735
+ }), {
736
+ default: I(() => [A(e.$slots, "default")]),
737
+ _: 3
738
+ }, 16, [
739
+ "class",
740
+ "style",
741
+ "data-size",
742
+ "data-state",
743
+ "data-variant"
744
+ ]));
745
+ }
746
+ }), Je = [
747
+ "data-fill",
748
+ "data-size",
749
+ "data-state",
750
+ "data-variant"
751
+ ], Ye = {
752
+ key: 0,
753
+ "aria-hidden": "true",
754
+ class: "inline-flex shrink-0 items-center text-text-tertiary",
755
+ "data-ug-slot": "separator"
756
+ }, Xe = /* @__PURE__ */ _({
757
+ name: "USpace",
758
+ inheritAttrs: !1,
759
+ __name: "space",
760
+ props: {
761
+ direction: { default: "horizontal" },
762
+ align: { default: "center" },
763
+ size: { default: "default" },
764
+ wrap: {
765
+ type: Boolean,
766
+ default: !1
767
+ },
768
+ inline: {
769
+ type: Boolean,
770
+ default: !1
771
+ },
772
+ separator: { default: void 0 },
773
+ fill: {
774
+ type: Boolean,
775
+ default: !1
776
+ },
777
+ fillRatio: { default: 100 }
778
+ },
779
+ setup(t) {
780
+ let n = t, r = ee(), i = F(), a = _({
781
+ props: { node: {
782
+ type: Object,
783
+ required: !0
784
+ } },
785
+ setup(e) {
786
+ return () => e.node;
787
+ }
788
+ }), l = {
789
+ xs: 4,
790
+ sm: 8,
791
+ md: 12,
792
+ lg: 16,
793
+ small: 8,
794
+ default: 12,
795
+ large: 16
796
+ }, v = {
797
+ start: "items-start",
798
+ center: "items-center",
799
+ end: "items-end",
800
+ baseline: "items-baseline",
801
+ stretch: "items-stretch"
802
+ };
803
+ function y(e) {
804
+ return typeof e == "number" ? Number.isFinite(e) ? Math.max(0, e) : 0 : l[e];
805
+ }
806
+ function x(e) {
807
+ return e.flatMap((e) => e.type === o || e.type === c && String(e.children ?? "").trim() === "" ? [] : e.type === s && Array.isArray(e.children) ? x(e.children) : [e]);
808
+ }
809
+ let S = u(() => x(i.default?.() ?? [])), w = u(() => !!i.separator || n.separator !== void 0), T = u(() => n.fill || w.value), D = u(() => {
810
+ if (Array.isArray(n.size)) return [y(n.size[0]), y(n.size[1])];
811
+ let e = y(n.size);
812
+ return [e, e];
813
+ }), O = u(() => e(n.inline ? "inline-flex" : "flex", n.direction === "vertical" && "flex-col", v[n.align], n.wrap && "flex-wrap")), j = u(() => {
814
+ let e = w.value ? 2 : 1;
815
+ return [{
816
+ columnGap: `${D.value[0] / e}px`,
817
+ rowGap: `${D.value[1] / e}px`
818
+ }, r.style];
819
+ }), N = u(() => {
820
+ if (!n.fill) return;
821
+ let e = Number.isFinite(n.fillRatio) ? Math.min(100, Math.max(1, n.fillRatio)) : 100;
822
+ return n.direction === "horizontal" ? {
823
+ flex: `1 1 ${e}%`,
824
+ minWidth: 0
825
+ } : { width: `${e}%` };
826
+ });
827
+ return (e, n) => (E(), p("div", b(P(r), {
828
+ class: O.value,
829
+ style: j.value,
830
+ "data-fill": t.fill ? "true" : "false",
831
+ "data-size": typeof t.size == "string" ? t.size : "custom",
832
+ "data-state": t.wrap ? "wrap" : "default",
833
+ "data-ug": "space",
834
+ "data-ug-slot": "root",
835
+ "data-variant": t.direction
836
+ }), [T.value ? (E(!0), p(s, { key: 0 }, k(S.value, (n, r) => (E(), p(s, { key: n.key ?? r }, [r > 0 && w.value ? (E(), p("span", Ye, [A(e.$slots, "separator", {}, () => [h(M(t.separator), 1)])])) : f("", !0), m("div", {
837
+ "data-ug-slot": "item",
838
+ style: C(N.value)
839
+ }, [g(P(a), { node: n }, null, 8, ["node"])], 4)], 64))), 128)) : (E(!0), p(s, { key: 1 }, k(S.value, (e, t) => (E(), d(P(a), {
840
+ key: e.key ?? t,
841
+ node: e
842
+ }, null, 8, ["node"]))), 128))], 16, Je));
843
+ }
844
+ }), Ze = ["data-variant", "tabindex"], Qe = /* @__PURE__ */ _({
845
+ name: "UScrollbar",
846
+ inheritAttrs: !1,
847
+ __name: "scrollbar",
848
+ props: {
849
+ height: { default: void 0 },
850
+ maxHeight: { default: void 0 },
851
+ width: { default: void 0 },
852
+ maxWidth: { default: void 0 },
853
+ orientation: { default: void 0 },
854
+ horizontal: {
855
+ type: Boolean,
856
+ default: !1
857
+ },
858
+ scrollbar: { default: "thin" },
859
+ overscroll: { default: "contain" },
860
+ distance: { default: 0 },
861
+ class: { default: void 0 },
862
+ style: { default: void 0 }
863
+ },
864
+ emits: ["scroll", "endReached"],
865
+ setup(t, { expose: n, emit: r }) {
866
+ let i = ee(), a = t, o = r, s = O(null), c = /* @__PURE__ */ new Set(), l = {
867
+ vertical: "overflow-y-auto overflow-x-hidden",
868
+ horizontal: "overflow-x-auto overflow-y-hidden",
869
+ both: "overflow-auto"
870
+ }, d = {
871
+ auto: "[scrollbar-width:auto]",
872
+ thin: "[scrollbar-color:var(--color-border-strong)_transparent] [scrollbar-width:thin]",
873
+ hidden: "[scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
874
+ }, f = {
875
+ auto: "overscroll-auto",
876
+ contain: "overscroll-contain",
877
+ none: "overscroll-none"
878
+ }, m = u(() => a.orientation ?? (a.horizontal ? "horizontal" : "vertical")), h = u(() => e(l[m.value], d[a.scrollbar], f[a.overscroll], a.class)), g = u(() => {
879
+ let e = i.tabindex;
880
+ return typeof e == "number" || typeof e == "string" ? e : 0;
881
+ }), _ = (e) => typeof e == "number" ? Number.isFinite(e) ? `${Math.max(0, e)}px` : void 0 : e, v = (e) => Number.isFinite(e) ? Math.max(0, e) : 0, y = u(() => [{
882
+ height: _(a.height),
883
+ maxHeight: _(a.maxHeight),
884
+ width: _(a.width),
885
+ maxWidth: _(a.maxWidth)
886
+ }, a.style]);
887
+ function x(e) {
888
+ let t = e.currentTarget;
889
+ if (!(t instanceof HTMLDivElement)) return;
890
+ o("scroll", {
891
+ scrollTop: t.scrollTop,
892
+ scrollLeft: t.scrollLeft
893
+ });
894
+ let n = v(a.distance), r = [], i = /* @__PURE__ */ new Set();
895
+ m.value !== "horizontal" && t.scrollHeight > t.clientHeight && (i.add("top"), i.add("bottom"), r.push(["top", t.scrollTop <= n], ["bottom", t.scrollHeight - t.clientHeight - t.scrollTop <= n])), m.value !== "vertical" && t.scrollWidth > t.clientWidth && (i.add("left"), i.add("right"), r.push(["left", t.scrollLeft <= n], ["right", t.scrollWidth - t.clientWidth - t.scrollLeft <= n])), c.forEach((e) => {
896
+ i.has(e) || c.delete(e);
897
+ }), r.forEach(([e, t]) => {
898
+ if (!t) {
899
+ c.delete(e);
900
+ return;
901
+ }
902
+ c.has(e) || (c.add(e), o("endReached", e));
903
+ });
904
+ }
905
+ function S(e, t) {
906
+ if (typeof e == "number") {
907
+ s.value?.scrollTo(e, t ?? 0);
908
+ return;
909
+ }
910
+ s.value?.scrollTo(e);
911
+ }
912
+ function C(e) {
913
+ s.value && (s.value.scrollTop = e);
914
+ }
915
+ function w(e) {
916
+ s.value && (s.value.scrollLeft = e);
917
+ }
918
+ function T(e, t) {
919
+ if (typeof e == "number") {
920
+ s.value?.scrollBy(e, t ?? 0);
921
+ return;
922
+ }
923
+ s.value?.scrollBy(e);
924
+ }
925
+ function D() {
926
+ return {
927
+ scrollTop: s.value?.scrollTop ?? 0,
928
+ scrollLeft: s.value?.scrollLeft ?? 0
929
+ };
930
+ }
931
+ return n({
932
+ viewportRef: s,
933
+ scrollTo: S,
934
+ scrollBy: T,
935
+ setScrollTop: C,
936
+ setScrollLeft: w,
937
+ getScrollPosition: D
938
+ }), (e, t) => (E(), p("div", b(e.$attrs, {
939
+ ref_key: "viewportRef",
940
+ ref: s,
941
+ class: h.value,
942
+ style: y.value,
943
+ "data-size": "auto",
944
+ "data-state": "default",
945
+ "data-ug": "scrollbar",
946
+ "data-ug-slot": "viewport",
947
+ "data-variant": m.value,
948
+ tabindex: g.value,
949
+ onScroll: x
950
+ }), [A(e.$slots, "default")], 16, Ze));
951
+ }
952
+ }), $e = {
953
+ start: "justify-start",
954
+ center: "justify-center",
955
+ end: "justify-end",
956
+ between: "justify-between",
957
+ around: "justify-around",
958
+ evenly: "justify-evenly"
959
+ }, et = {
960
+ start: "items-start",
961
+ center: "items-center",
962
+ end: "items-end",
963
+ stretch: "items-stretch"
964
+ }, W = (e, t) => {
965
+ let n = e ?? t;
966
+ return Number.isFinite(n) ? Math.min(24, Math.max(0, Math.round(n))) : t;
967
+ }, tt = (e) => Number.isFinite(e) ? Math.max(0, e ?? 0) : 0, G = (e) => `${e / 24 * 100}%`, K = ({ pull: e, push: t }) => `${(t - e) / 24 * 100}%`;
968
+ function q(e, t) {
969
+ return typeof e == "number" ? {
970
+ ...t,
971
+ span: W(e, t.span)
972
+ } : {
973
+ span: W(e?.span, t.span),
974
+ offset: W(e?.offset, t.offset),
975
+ push: W(e?.push, t.push),
976
+ pull: W(e?.pull, t.pull)
977
+ };
978
+ }
979
+ var nt = _({
980
+ name: "URow",
981
+ props: {
982
+ as: {
983
+ type: [
984
+ String,
985
+ Object,
986
+ Function
987
+ ],
988
+ default: "div"
989
+ },
990
+ gutter: {
991
+ type: [Number, Array],
992
+ default: 0
993
+ },
994
+ justify: {
995
+ type: String,
996
+ default: "start"
997
+ },
998
+ align: {
999
+ type: String,
1000
+ default: "stretch"
1001
+ },
1002
+ wrap: {
1003
+ type: Boolean,
1004
+ default: !0
1005
+ },
1006
+ class: {
1007
+ type: String,
1008
+ default: void 0
1009
+ }
1010
+ },
1011
+ setup(t, { attrs: n, slots: r }) {
1012
+ let i = u(() => tt(Array.isArray(t.gutter) ? t.gutter[0] : t.gutter)), a = u(() => tt(Array.isArray(t.gutter) ? t.gutter[1] : 0)), o = u(() => e("flex", $e[t.justify], et[t.align], t.wrap && "flex-wrap", t.class));
1013
+ return () => v(t.as, {
1014
+ ...n,
1015
+ class: o.value,
1016
+ "data-size": "24",
1017
+ "data-state": t.wrap ? "wrap" : "default",
1018
+ "data-ug": "layout",
1019
+ "data-ug-slot": "row",
1020
+ "data-variant": "grid",
1021
+ style: [{
1022
+ marginInlineStart: i.value ? `${-i.value / 2}px` : void 0,
1023
+ marginInlineEnd: i.value ? `${-i.value / 2}px` : void 0,
1024
+ rowGap: `${a.value}px`,
1025
+ "--ug-row-gutter": `${i.value}px`
1026
+ }, n.style]
1027
+ }, r.default?.());
1028
+ }
1029
+ }), rt = _({
1030
+ name: "UCol",
1031
+ props: {
1032
+ as: {
1033
+ type: [
1034
+ String,
1035
+ Object,
1036
+ Function
1037
+ ],
1038
+ default: "div"
1039
+ },
1040
+ span: {
1041
+ type: Number,
1042
+ default: 24
1043
+ },
1044
+ offset: {
1045
+ type: Number,
1046
+ default: 0
1047
+ },
1048
+ push: {
1049
+ type: Number,
1050
+ default: 0
1051
+ },
1052
+ pull: {
1053
+ type: Number,
1054
+ default: 0
1055
+ },
1056
+ xs: {
1057
+ type: [Number, Object],
1058
+ default: void 0
1059
+ },
1060
+ sm: {
1061
+ type: [Number, Object],
1062
+ default: void 0
1063
+ },
1064
+ md: {
1065
+ type: [Number, Object],
1066
+ default: void 0
1067
+ },
1068
+ lg: {
1069
+ type: [Number, Object],
1070
+ default: void 0
1071
+ },
1072
+ xl: {
1073
+ type: [Number, Object],
1074
+ default: void 0
1075
+ },
1076
+ class: {
1077
+ type: String,
1078
+ default: void 0
1079
+ }
1080
+ },
1081
+ setup(t, { attrs: n, slots: r }) {
1082
+ let i = u(() => q({
1083
+ span: t.span,
1084
+ offset: t.offset,
1085
+ push: t.push,
1086
+ pull: t.pull
1087
+ }, {
1088
+ span: 24,
1089
+ offset: 0,
1090
+ push: 0,
1091
+ pull: 0
1092
+ })), a = u(() => q(t.xs, i.value)), o = u(() => q(t.sm, a.value)), s = u(() => q(t.md, o.value)), c = u(() => q(t.lg, s.value)), l = u(() => q(t.xl, c.value));
1093
+ return () => v(t.as, {
1094
+ ...n,
1095
+ class: e("relative min-w-0 flex-none px-[calc(var(--ug-row-gutter,0px)/2)]", "[flex-basis:var(--ug-col-base)] [max-width:var(--ug-col-base)]", "[display:var(--ug-col-display-base)]", "[margin-inline-start:var(--ug-col-offset-base)] [inset-inline-start:var(--ug-col-shift-base)]", "max-sm:[flex-basis:var(--ug-col-xs)] max-sm:[max-width:var(--ug-col-xs)]", "max-sm:[display:var(--ug-col-display-xs)]", "max-sm:[margin-inline-start:var(--ug-col-offset-xs)] max-sm:[inset-inline-start:var(--ug-col-shift-xs)]", "sm:[flex-basis:var(--ug-col-sm)] sm:[max-width:var(--ug-col-sm)]", "sm:[display:var(--ug-col-display-sm)]", "sm:[margin-inline-start:var(--ug-col-offset-sm)] sm:[inset-inline-start:var(--ug-col-shift-sm)]", "md:[flex-basis:var(--ug-col-md)] md:[max-width:var(--ug-col-md)]", "md:[display:var(--ug-col-display-md)]", "md:[margin-inline-start:var(--ug-col-offset-md)] md:[inset-inline-start:var(--ug-col-shift-md)]", "lg:[flex-basis:var(--ug-col-lg)] lg:[max-width:var(--ug-col-lg)]", "lg:[display:var(--ug-col-display-lg)]", "lg:[margin-inline-start:var(--ug-col-offset-lg)] lg:[inset-inline-start:var(--ug-col-shift-lg)]", "xl:[flex-basis:var(--ug-col-xl)] xl:[max-width:var(--ug-col-xl)]", "xl:[display:var(--ug-col-display-xl)]", "xl:[margin-inline-start:var(--ug-col-offset-xl)] xl:[inset-inline-start:var(--ug-col-shift-xl)]", t.class),
1096
+ "data-size": i.value.span,
1097
+ "data-state": "default",
1098
+ "data-ug": "layout",
1099
+ "data-ug-slot": "col",
1100
+ "data-variant": "grid",
1101
+ style: [{
1102
+ "--ug-col-base": G(i.value.span),
1103
+ "--ug-col-display-base": i.value.span === 0 ? "none" : "block",
1104
+ "--ug-col-offset-base": G(i.value.offset),
1105
+ "--ug-col-shift-base": K(i.value),
1106
+ "--ug-col-xs": G(a.value.span),
1107
+ "--ug-col-display-xs": a.value.span === 0 ? "none" : "block",
1108
+ "--ug-col-offset-xs": G(a.value.offset),
1109
+ "--ug-col-shift-xs": K(a.value),
1110
+ "--ug-col-sm": G(o.value.span),
1111
+ "--ug-col-display-sm": o.value.span === 0 ? "none" : "block",
1112
+ "--ug-col-offset-sm": G(o.value.offset),
1113
+ "--ug-col-shift-sm": K(o.value),
1114
+ "--ug-col-md": G(s.value.span),
1115
+ "--ug-col-display-md": s.value.span === 0 ? "none" : "block",
1116
+ "--ug-col-offset-md": G(s.value.offset),
1117
+ "--ug-col-shift-md": K(s.value),
1118
+ "--ug-col-lg": G(c.value.span),
1119
+ "--ug-col-display-lg": c.value.span === 0 ? "none" : "block",
1120
+ "--ug-col-offset-lg": G(c.value.offset),
1121
+ "--ug-col-shift-lg": K(c.value),
1122
+ "--ug-col-xl": G(l.value.span),
1123
+ "--ug-col-display-xl": l.value.span === 0 ? "none" : "block",
1124
+ "--ug-col-offset-xl": G(l.value.offset),
1125
+ "--ug-col-shift-xl": K(l.value)
1126
+ }, n.style]
1127
+ }, r.default?.());
1128
+ }
1129
+ }), it = (e) => typeof e == "number" ? Number.isFinite(e) ? `${Math.max(0, e)}px` : void 0 : e;
1130
+ function J(t, n, r, i, a) {
1131
+ return _({
1132
+ name: t,
1133
+ props: {
1134
+ as: {
1135
+ type: [
1136
+ String,
1137
+ Object,
1138
+ Function
1139
+ ],
1140
+ default: n
1141
+ },
1142
+ class: {
1143
+ type: String,
1144
+ default: void 0
1145
+ },
1146
+ ...a ? { [a]: {
1147
+ type: [Number, String],
1148
+ default: a === "width" ? 300 : 60
1149
+ } } : {}
1150
+ },
1151
+ setup(t, { attrs: n, slots: o }) {
1152
+ return () => {
1153
+ let s = a ? { [a]: it(t[a]) } : void 0;
1154
+ return v(t.as, {
1155
+ ...n,
1156
+ class: e(i, t.class),
1157
+ style: [s, n.style],
1158
+ "data-ug-slot": r
1159
+ }, o.default?.());
1160
+ };
1161
+ }
1162
+ });
1163
+ }
1164
+ var at = J("UHeader", "header", "header", "shrink-0", "height"), ot = J("UAside", "aside", "aside", "min-h-[0] shrink-0", "width"), st = J("UMain", "main", "main", "min-h-[0] min-w-0 flex-1"), ct = J("UFooter", "footer", "footer", "shrink-0", "height"), lt = /* @__PURE__ */ _({
1165
+ name: "UContainer",
1166
+ inheritAttrs: !1,
1167
+ __name: "container",
1168
+ props: {
1169
+ as: { default: "div" },
1170
+ direction: { default: "auto" },
1171
+ class: { default: void 0 }
1172
+ },
1173
+ setup(t) {
1174
+ let n = t, r = F();
1175
+ function i(e) {
1176
+ return e.some((e) => {
1177
+ if (e.type === s && Array.isArray(e.children)) return i(e.children);
1178
+ let t = e.type, n = typeof t == "string" ? t : t.name ?? t.__name;
1179
+ return n === "UHeader" || n === "UFooter";
1180
+ });
1181
+ }
1182
+ let a = u(() => n.direction === "auto" ? i(r.default?.() ?? []) ? "vertical" : "horizontal" : n.direction), o = u(() => e("flex min-h-[0] min-w-0 flex-1", a.value === "vertical" ? "flex-col" : "flex-row", n.class));
1183
+ return (e, n) => (E(), d(j(t.as), b(e.$attrs, {
1184
+ class: o.value,
1185
+ "data-size": "auto",
1186
+ "data-state": "default",
1187
+ "data-ug": "container",
1188
+ "data-ug-slot": "root",
1189
+ "data-variant": a.value
1190
+ }), {
1191
+ default: I(() => [A(e.$slots, "default")]),
1192
+ _: 3
1193
+ }, 16, ["class", "data-variant"]));
1194
+ }
1195
+ }), Y = (e, t, n) => Math.min(n, Math.max(t, Number.isFinite(e) ? e : t));
1196
+ function ut(e, t) {
1197
+ if (t <= 0) return [];
1198
+ let n = Array.from({ length: t }, (t, n) => Math.max(0, e[n] ?? 0)), r = n.reduce((e, t) => e + t, 0);
1199
+ return r <= 0 ? Array.from({ length: t }, () => 100 / t) : n.map((e) => e / r * 100);
1200
+ }
1201
+ function X(e, t) {
1202
+ if (t.length === 0) return [];
1203
+ let n = ut(e, t.length), r = t.map((e, t) => {
1204
+ let r = e.collapsible && (n[t] ?? 0) <= e.collapsedSize + .01 ? e.collapsedSize : e.min;
1205
+ return Math.min(r, e.max);
1206
+ }), i = t.map((e) => Math.max(e.min, e.max)), a = r.reduce((e, t) => e + t, 0), o = i.reduce((e, t) => e + t, 0), s = a > 100 ? r.map((e) => e / a * 100) : r, c = o < 100 ? i.map((e) => e / o * 100) : i, l = n.map((e, t) => Y(e, s[t] ?? 0, c[t] ?? 100));
1207
+ for (let e = 0; e < t.length * 2; e += 1) {
1208
+ let e = 100 - l.reduce((e, t) => e + t, 0);
1209
+ if (Math.abs(e) < 1e-4) break;
1210
+ let t = l.map((t, n) => e > 0 ? Math.max(0, (c[n] ?? 100) - t) : Math.max(0, t - (s[n] ?? 0))), n = t.reduce((e, t) => e + t, 0);
1211
+ if (n <= 0) break;
1212
+ l.forEach((r, i) => {
1213
+ l[i] = r + e * ((t[i] ?? 0) / n);
1214
+ });
1215
+ }
1216
+ return ut(l, t.length);
1217
+ }
1218
+ function dt(e, t) {
1219
+ let n = e.map((e, n) => t?.[n] ?? e.defaultSize), r = n.reduce((e, t) => e + (t ?? 0), 0), i = n.filter((e) => e === void 0).length, a = Math.max(0, 100 - r), o = i > 0 ? a / i : 0;
1220
+ return X(n.map((e) => e ?? o), e);
1221
+ }
1222
+ function Z(e, t, n, r, i) {
1223
+ let a = t[n], o = t[n + 1];
1224
+ if (!a || !o || !a.resizable || !o.resizable) return [...e];
1225
+ let s = (e[n] ?? 0) + (e[n + 1] ?? 0), c = i?.firstMin ?? a.min, l = i?.secondMin ?? o.min, u = Y(r, Math.max(c, s - o.max), Math.min(a.max, s - l)), d = [...e];
1226
+ return d[n] = u, d[n + 1] = s - u, d;
1227
+ }
1228
+ function ft(e, t) {
1229
+ return e.collapsible && t <= e.collapsedSize + .01 ? e.collapsedSize : e.min;
1230
+ }
1231
+ function pt(e, t, n) {
1232
+ let r = t[n], i = t[n + 1];
1233
+ if (!r || !i) return {
1234
+ min: 0,
1235
+ max: 100
1236
+ };
1237
+ let a = (e[n] ?? 0) + (e[n + 1] ?? 0), o = e.slice(0, n).reduce((e, t) => e + t, 0), s = ft(r, e[n] ?? 0), c = ft(i, e[n + 1] ?? 0);
1238
+ return {
1239
+ min: o + Math.max(s, a - i.max),
1240
+ max: o + Math.min(r.max, a - c)
1241
+ };
1242
+ }
1243
+ function mt(e) {
1244
+ return e.flatMap((e) => e.type === s && Array.isArray(e.children) ? mt(e.children) : [e]);
1245
+ }
1246
+ function Q(e, t, n) {
1247
+ let r = e.props?.[t] ?? e.props?.[n];
1248
+ return typeof r == "number" ? r : void 0;
1249
+ }
1250
+ function ht(e, t, n, r) {
1251
+ let i = e.props?.[t] ?? e.props?.[n];
1252
+ return typeof i == "boolean" ? i : r;
1253
+ }
1254
+ var $ = _({
1255
+ name: "USplitterPanel",
1256
+ inheritAttrs: !1,
1257
+ props: {
1258
+ defaultSize: {
1259
+ type: Number,
1260
+ default: void 0
1261
+ },
1262
+ min: {
1263
+ type: Number,
1264
+ default: 0
1265
+ },
1266
+ max: {
1267
+ type: Number,
1268
+ default: 100
1269
+ },
1270
+ collapsible: {
1271
+ type: Boolean,
1272
+ default: !1
1273
+ },
1274
+ collapsedSize: {
1275
+ type: Number,
1276
+ default: 0
1277
+ },
1278
+ resizable: {
1279
+ type: Boolean,
1280
+ default: !0
1281
+ },
1282
+ class: {
1283
+ type: String,
1284
+ default: void 0
1285
+ }
1286
+ },
1287
+ emits: { collapseChange: (e) => !0 },
1288
+ setup(t, { attrs: n, slots: r }) {
1289
+ return () => v("div", {
1290
+ ...n,
1291
+ class: e("min-h-[0] min-w-[0] overflow-auto", t.class, n.class),
1292
+ "data-ug-slot": "panel",
1293
+ style: [n.style]
1294
+ }, r.default?.());
1295
+ }
1296
+ }), gt = _({
1297
+ name: "USplitter",
1298
+ inheritAttrs: !1,
1299
+ props: {
1300
+ direction: {
1301
+ type: String,
1302
+ default: "horizontal"
1303
+ },
1304
+ defaultSizes: {
1305
+ type: Array,
1306
+ default: void 0
1307
+ },
1308
+ sizes: {
1309
+ type: Array,
1310
+ default: void 0
1311
+ },
1312
+ keyboardStep: {
1313
+ type: Number,
1314
+ default: 2
1315
+ },
1316
+ lazy: {
1317
+ type: Boolean,
1318
+ default: !1
1319
+ },
1320
+ class: {
1321
+ type: String,
1322
+ default: void 0
1323
+ },
1324
+ defaultSize: {
1325
+ type: Number,
1326
+ default: 50
1327
+ },
1328
+ modelValue: {
1329
+ type: Number,
1330
+ default: void 0
1331
+ },
1332
+ min: {
1333
+ type: Number,
1334
+ default: 10
1335
+ },
1336
+ max: {
1337
+ type: Number,
1338
+ default: 90
1339
+ }
1340
+ },
1341
+ emits: {
1342
+ "update:modelValue": (e) => !0,
1343
+ "update:sizes": (e) => !0,
1344
+ change: (e) => !0,
1345
+ sizesChange: (e) => !0,
1346
+ collapse: (e) => !0,
1347
+ resizeStart: (e) => !0,
1348
+ resize: (e) => !0,
1349
+ resizeEnd: (e) => !0
1350
+ },
1351
+ setup(t, { attrs: n, emit: r, slots: i }) {
1352
+ let a = O(null), o = O(null), s = /* @__PURE__ */ new Map(), c = te(), d = u(() => {
1353
+ let e = mt(i.default?.() ?? []).filter((e) => e.type === $);
1354
+ return (e.length > 0 ? e : [v($, {
1355
+ key: "legacy-first",
1356
+ defaultSize: t.defaultSize,
1357
+ min: t.min,
1358
+ max: t.max
1359
+ }, { default: i.first }), v($, {
1360
+ key: "legacy-second",
1361
+ min: 100 - t.max,
1362
+ max: 100 - t.min
1363
+ }, { default: i.second })]).map((e) => {
1364
+ let t = Y(Q(e, "min", "min") ?? 0, 0, 100), n = Y(Q(e, "max", "max") ?? 100, 0, 100), r = Math.min(t, n);
1365
+ return {
1366
+ vnode: e,
1367
+ min: r,
1368
+ max: Math.max(t, n),
1369
+ defaultSize: Q(e, "defaultSize", "default-size"),
1370
+ collapsible: ht(e, "collapsible", "collapsible", !1),
1371
+ collapsedSize: Y(Q(e, "collapsedSize", "collapsed-size") ?? 0, 0, r),
1372
+ resizable: ht(e, "resizable", "resizable", !0)
1373
+ };
1374
+ });
1375
+ }), f = O([]), p = "", m = u(() => {
1376
+ if (t.sizes) return X(t.sizes, d.value);
1377
+ if (t.modelValue !== void 0 && d.value.length === 2) {
1378
+ let e = Y(t.modelValue, t.min, t.max);
1379
+ return X([e, 100 - e], d.value);
1380
+ }
1381
+ return f.value;
1382
+ });
1383
+ function h(e, n, i) {
1384
+ let a = X(e, d.value);
1385
+ !t.sizes && t.modelValue === void 0 && (f.value = a), r("update:sizes", a), r("sizesChange", a), r("update:modelValue", a[0] ?? 0), r("change", a[0] ?? 0);
1386
+ let o = {
1387
+ separatorIndex: n,
1388
+ sizes: a
1389
+ };
1390
+ return i === "resize" && r("resize", o), i === "end" && r("resizeEnd", o), a;
1391
+ }
1392
+ function g(e) {
1393
+ let t = o.value;
1394
+ t && (o.value = null, h(t.latestSizes, e, "end"));
1395
+ }
1396
+ function _(e, t) {
1397
+ let n = e.vnode.props?.onCollapseChange ?? e.vnode.props?.["onCollapse-change"];
1398
+ typeof n == "function" && n(t);
1399
+ }
1400
+ function y(e) {
1401
+ let t = d.value, n = t[e]?.collapsible ? e : t[e + 1]?.collapsible ? e + 1 : -1;
1402
+ if (n < 0) return;
1403
+ let i = t[n], a = m.value, o = a[n];
1404
+ if (!i || o === void 0) return;
1405
+ let c = o <= i.collapsedSize + .01, l = (a[e] ?? 0) + (a[e + 1] ?? 0), u;
1406
+ n === e ? (c || s.set(n, o), u = c ? s.get(n) ?? i.defaultSize ?? l / 2 : i.collapsedSize) : (c || s.set(n, o), u = l - (c ? s.get(n) ?? i.defaultSize ?? l / 2 : i.collapsedSize));
1407
+ let f = Z(a, t, e, u, c ? void 0 : n === e ? { firstMin: i.collapsedSize } : { secondMin: i.collapsedSize }), p = (f[n] ?? 0) <= i.collapsedSize + .01;
1408
+ p !== c && (h(f, e, "change"), _(i, p), r("collapse", {
1409
+ panelIndex: n,
1410
+ collapsed: p,
1411
+ sizes: f
1412
+ }));
1413
+ }
1414
+ function b(n) {
1415
+ let i = d.value, s = i[n], l = i[n + 1];
1416
+ if (!s || !l) return null;
1417
+ let u = !s.resizable || !l.resizable, f = m.value.slice(0, n + 1).reduce((e, t) => e + t, 0), p = pt(m.value, i, n), _ = s.vnode.props?.id ?? `${c}-panel-${n}`, b = l.vnode.props?.id ?? `${c}-panel-${n + 1}`;
1418
+ return v("div", {
1419
+ key: `${c}-separator-${n}`,
1420
+ "aria-controls": `${_} ${b}`,
1421
+ "aria-disabled": u || void 0,
1422
+ "aria-label": `调整第 ${n + 1} 与第 ${n + 2} 个面板`,
1423
+ "aria-orientation": t.direction,
1424
+ "aria-valuemax": Math.round(p.max),
1425
+ "aria-valuemin": Math.round(p.min),
1426
+ "aria-valuenow": Math.round(f),
1427
+ class: e("group relative shrink-0 touch-none bg-border-base outline-none", !u && "focus-visible:bg-primary", t.direction === "horizontal" ? "w-[var(--control-border-width)] cursor-col-resize" : "h-[var(--control-border-width)] cursor-row-resize", u && "cursor-default opacity-disabled"),
1428
+ "data-ug-slot": "separator",
1429
+ role: "separator",
1430
+ tabindex: u ? -1 : 0,
1431
+ onDblclick: () => y(n),
1432
+ onKeydown: (e) => {
1433
+ if (u) return;
1434
+ let r = t.direction === "horizontal" ? "ArrowLeft" : "ArrowUp", a = t.direction === "horizontal" ? "ArrowRight" : "ArrowDown";
1435
+ e.key === r || e.key === a ? (e.preventDefault(), h(Z(m.value, i, n, (m.value[n] ?? 0) + (e.key === a ? t.keyboardStep : -t.keyboardStep)), n, "change")) : e.key === "Home" ? (e.preventDefault(), h(Z(m.value, i, n, s.min), n, "change")) : e.key === "End" ? (e.preventDefault(), h(Z(m.value, i, n, s.max), n, "change")) : e.key === "Enter" && (e.preventDefault(), y(n));
1436
+ },
1437
+ onLostpointercapture: () => g(n),
1438
+ onPointercancel: () => g(n),
1439
+ onPointerdown: (e) => {
1440
+ u || !a.value || (e.preventDefault(), o.value = {
1441
+ pointerId: e.pointerId,
1442
+ separatorIndex: n,
1443
+ pointerStart: t.direction === "horizontal" ? e.clientX : e.clientY,
1444
+ sizes: [...m.value],
1445
+ latestSizes: [...m.value]
1446
+ }, e.currentTarget.setPointerCapture(e.pointerId), r("resizeStart", {
1447
+ separatorIndex: n,
1448
+ sizes: [...m.value]
1449
+ }));
1450
+ },
1451
+ onPointermove: (e) => {
1452
+ let s = o.value;
1453
+ if (!s || s.pointerId !== e.pointerId || s.separatorIndex !== n || !a.value) return;
1454
+ let c = a.value.getBoundingClientRect(), l = t.direction === "horizontal" ? c.width : c.height;
1455
+ if (l <= 0) return;
1456
+ let u = ((t.direction === "horizontal" ? e.clientX : e.clientY) - s.pointerStart) / l * 100, d = Z(s.sizes, i, n, (s.sizes[n] ?? 0) + u);
1457
+ if (s.latestSizes = d, t.lazy) {
1458
+ r("resize", {
1459
+ separatorIndex: n,
1460
+ sizes: ut(d, i.length)
1461
+ });
1462
+ return;
1463
+ }
1464
+ h(d, n, "resize");
1465
+ },
1466
+ onPointerup: (e) => {
1467
+ let t = e.currentTarget;
1468
+ t.hasPointerCapture(e.pointerId) && t.releasePointerCapture(e.pointerId), g(n);
1469
+ }
1470
+ }, [v("span", { class: e("absolute rounded-full bg-border-strong transition-colors duration-150 group-hover:bg-primary", t.direction === "horizontal" ? "left-1/2 top-1/2 h-[var(--control-height-sm)] w-[calc(var(--control-border-width)*4)] -translate-x-1/2 -translate-y-1/2" : "left-1/2 top-1/2 h-[calc(var(--control-border-width)*4)] w-[var(--control-height-sm)] -translate-x-1/2 -translate-y-1/2") })]);
1471
+ }
1472
+ return () => {
1473
+ let r = d.value, i = r.map((e) => `${e.defaultSize ?? ""}:${e.min}:${e.max}`).join("|");
1474
+ i !== p && (f.value = f.value.length === r.length ? X(f.value, r) : dt(r, t.defaultSizes), p = i);
1475
+ let o = [];
1476
+ return r.forEach((e, t) => {
1477
+ let n = e.vnode.props?.id ?? `${c}-panel-${t}`, i = m.value[t] ?? 0, a = i <= e.collapsedSize + .01;
1478
+ if (o.push(l(e.vnode, {
1479
+ id: n,
1480
+ "aria-hidden": a || void 0,
1481
+ "data-state": a ? "collapsed" : "expanded",
1482
+ style: [e.vnode.props?.style, {
1483
+ flexBasis: `${i}%`,
1484
+ flexGrow: 0,
1485
+ flexShrink: 0
1486
+ }]
1487
+ })), t < r.length - 1) {
1488
+ let e = b(t);
1489
+ e && o.push(e);
1490
+ }
1491
+ }), v("div", {
1492
+ ...n,
1493
+ ref: a,
1494
+ class: e("flex min-h-[0] min-w-[0] overflow-hidden", t.direction === "vertical" && "flex-col", t.class, n.class),
1495
+ "data-panel-count": r.length,
1496
+ "data-size": "auto",
1497
+ "data-state": "default",
1498
+ "data-ug": "splitter",
1499
+ "data-ug-slot": "root",
1500
+ "data-variant": t.direction
1501
+ }, o);
1502
+ };
1503
+ }
1504
+ }), _t = [
1505
+ "aria-hidden",
1506
+ "data-size",
1507
+ "data-state",
1508
+ "data-variant",
1509
+ "role"
1510
+ ], vt = {
1511
+ key: 1,
1512
+ "aria-hidden": "true",
1513
+ class: "contents"
1514
+ }, yt = /* @__PURE__ */ _({
1515
+ name: "UIcon",
1516
+ __name: "icon",
1517
+ props: {
1518
+ icon: {},
1519
+ color: { default: void 0 },
1520
+ size: { default: 16 },
1521
+ strokeWidth: { default: 2 },
1522
+ decorative: {
1523
+ type: Boolean,
1524
+ default: !0
1525
+ },
1526
+ spin: {
1527
+ type: Boolean,
1528
+ default: !1
1529
+ },
1530
+ class: { default: void 0 }
1531
+ },
1532
+ setup(t) {
1533
+ let n = t, r = u(() => e("inline-flex shrink-0 items-center justify-center text-current [&_svg]:h-[1em] [&_svg]:w-[1em]", n.spin && "animate-spin motion-reduce:animate-none", n.class));
1534
+ return (e, n) => (E(), p("span", {
1535
+ "aria-hidden": t.decorative || void 0,
1536
+ class: S(r.value),
1537
+ "data-size": t.size,
1538
+ "data-state": t.spin ? "spinning" : "default",
1539
+ "data-ug": "icon",
1540
+ "data-ug-slot": "root",
1541
+ "data-variant": t.decorative ? "decorative" : "semantic",
1542
+ role: t.decorative ? void 0 : "img",
1543
+ style: C({
1544
+ color: t.color,
1545
+ fontSize: t.size,
1546
+ height: t.size,
1547
+ width: t.size
1548
+ })
1549
+ }, [t.icon ? (E(), d(j(t.icon), {
1550
+ key: 0,
1551
+ "aria-hidden": "true",
1552
+ focusable: "false",
1553
+ size: t.size,
1554
+ "stroke-width": t.strokeWidth
1555
+ }, null, 8, ["size", "stroke-width"])) : (E(), p("span", vt, [A(e.$slots, "default")]))], 14, _t));
1556
+ }
1557
+ });
1558
+ //#endregion
1559
+ export { V as C, fe as D, we as E, le as O, Me as S, Oe as T, ze as _, ot as a, je as b, st as c, Qe as d, Xe as f, Be as g, Ue as h, lt as i, rt as l, Ke as m, gt as n, ct as o, qe as p, $ as r, at as s, yt as t, nt as u, Fe as v, ke as w, Ae as x, Ne as y };
1560
+
1561
+ //# sourceMappingURL=icon-NbssmDYT.js.map