@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
@@ -0,0 +1,61 @@
1
+ import { Component } from 'vue';
2
+ type ButtonVariant = 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link';
3
+ interface HeroAction {
4
+ label: string;
5
+ href?: string;
6
+ icon?: Component;
7
+ variant?: ButtonVariant;
8
+ disabled?: boolean;
9
+ onClick?: (event: MouseEvent) => void;
10
+ }
11
+ interface HeroStat {
12
+ value: string;
13
+ label: string;
14
+ }
15
+ interface Props {
16
+ /** 顶部短标签 */
17
+ eyebrow?: string;
18
+ /** 主标题 */
19
+ title: string;
20
+ /** 描述文案 */
21
+ description?: string;
22
+ /** 主行动 */
23
+ primaryAction?: HeroAction;
24
+ /** 次行动 */
25
+ secondaryAction?: HeroAction;
26
+ /** 关键指标 */
27
+ stats?: HeroStat[];
28
+ /** 容器额外 CSS 类名 */
29
+ class?: string;
30
+ }
31
+ declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {}, __VLS_7: {}, __VLS_9: {}, __VLS_47: {};
32
+ type __VLS_Slots = {} & {
33
+ media?: (props: typeof __VLS_1) => any;
34
+ } & {
35
+ eyebrow?: (props: typeof __VLS_3) => any;
36
+ } & {
37
+ title?: (props: typeof __VLS_5) => any;
38
+ } & {
39
+ description?: (props: typeof __VLS_7) => any;
40
+ } & {
41
+ actions?: (props: typeof __VLS_9) => any;
42
+ } & {
43
+ default?: (props: typeof __VLS_47) => any;
44
+ };
45
+ declare const __VLS_base: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
46
+ class: string;
47
+ description: string;
48
+ eyebrow: string;
49
+ primaryAction: HeroAction;
50
+ secondaryAction: HeroAction;
51
+ stats: HeroStat[];
52
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
53
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
54
+ declare const _default: typeof __VLS_export;
55
+ export default _default;
56
+ type __VLS_WithSlots<T, S> = T & {
57
+ new (): {
58
+ $slots: S;
59
+ };
60
+ };
61
+ //# sourceMappingURL=landing-hero.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"landing-hero.vue.d.ts","sourceRoot":"","sources":["../../src/blocks/landing-hero.vue"],"names":[],"mappings":"AAKA;AAuJA,OAAO,EAAY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,GAAG,CAAA;CAAE,GAC1C;IAAE,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAChD;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC5C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAKhD,QAAA,MAAM,UAAU;WAnYN,MAAM;iBARA,MAAM;aAJV,MAAM;mBAMA,UAAU;qBAER,UAAU;WAEpB,QAAQ,EAAE;6EAwYlB,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -0,0 +1,2 @@
1
+ const e=require("./cn-CFAiuoYh.cjs");let t=require("vue"),n=require("@lucide/vue");var r={small:`sm`,medium:`default`,large:`lg`},i={sm:`small`,default:`medium`,lg:`large`};function a(e,t){return e??r[t]}function o(e,t){return e??t}function s(e){return i[e]}var c={namespace:`ug`,size:`medium`,disabled:!1,button:{},link:{}},l=Symbol(`ug-ui-config`);function u(e,t){let n={...e};return t&&Object.entries(t).forEach(([e,t])=>{t!==void 0&&Object.assign(n,{[e]:t})}),n}var d=(0,t.defineComponent)({name:`UConfigProvider`,inheritAttrs:!1,props:{namespace:{type:String,default:void 0},size:{type:String,default:void 0},disabled:{type:Boolean,default:void 0},button:{type:Object,default:void 0},link:{type:Object,default:void 0}},setup(e,{attrs:n,slots:r}){let i=(0,t.inject)(l,(0,t.computed)(()=>c)),a=(0,t.computed)(()=>({namespace:e.namespace??i.value.namespace,size:e.size??i.value.size,disabled:e.disabled??i.value.disabled,button:u(i.value.button,e.button),link:u(i.value.link,e.link)}));return(0,t.provide)(l,a),()=>(0,t.h)(`div`,{...n,class:[`[display:contents]`,n.class],"data-size":a.value.size,"data-state":a.value.disabled?`disabled`:`default`,"data-ug":`config-provider`,"data-ug-namespace":a.value.namespace,"data-ug-slot":`root`,"data-variant":`default`},r.default?.())}});function f(){return(0,t.inject)(l,(0,t.computed)(()=>c))}var p=Symbol(`UGButtonGroup`),m=[`type`,`disabled`,`aria-busy`,`data-state`,`data-variant`,`data-tone`,`data-size`,`data-shape`,`data-block`,`data-ug-namespace`],h={key:0,"data-ug-slot":`loader`,class:`inline-flex shrink-0 items-center justify-center`,"aria-hidden":`true`},g={"data-ug-slot":`label`,class:`inline-flex min-w-0 items-center justify-center gap-[var(--button-icon-gap)]`},_={key:1,"data-ug-slot":`loader`,class:`inline-flex shrink-0 items-center justify-center`,"aria-hidden":`true`},v=(0,t.defineComponent)({__name:`button`,props:{variant:String,tone:String,size:String,shape:String,block:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},loadingText:String,loadingPlacement:{type:String,default:`start`},disabled:{type:Boolean,default:void 0},nativeType:{type:String,default:`button`},class:String,style:[String,Object,Array]},emits:[`click`],setup(r,{expose:i,emit:a}){let s=r,c=a,l={solid:``,soft:``,primary:`bg-[var(--button-primary-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-primary-solid-hover)] active:bg-[var(--button-primary-solid-active)] focus-visible:ring-primary`,success:`bg-[var(--button-success-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-success-solid-hover)] active:bg-[var(--button-success-solid-active)] focus-visible:ring-success`,warning:`bg-[var(--button-warning-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-warning-solid-hover)] active:bg-[var(--button-warning-solid-active)] focus-visible:ring-warning`,danger:`bg-[var(--button-danger-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-danger-solid-hover)] active:bg-[var(--button-danger-solid-active)] focus-visible:ring-danger`,destructive:`bg-[var(--button-danger-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-danger-solid-hover)] active:bg-[var(--button-danger-solid-active)] focus-visible:ring-danger`,info:`bg-[var(--button-info-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-info-solid-hover)] active:bg-[var(--button-info-solid-active)] focus-visible:ring-info`,default:`border-border-base bg-surface-1 text-text-primary shadow-xs hover:border-primary active:bg-surface-2 focus-visible:ring-primary/40`,secondary:`border-border-base bg-surface-2 text-text-primary shadow-xs hover:bg-surface-3 active:bg-surface-3 focus-visible:ring-primary/40`,outline:`bg-transparent`,dashed:`border-dashed bg-transparent`,ghost:``,text:``,link:``},u={default:`h-[var(--control-height-md)] px-[var(--control-padding-x-md)] py-0`,sm:`h-[var(--control-height-sm)] px-[var(--control-padding-x-sm)] py-0`,lg:`h-[var(--control-height-lg)] px-[var(--control-padding-x-lg)] py-0`,icon:`h-[var(--control-height-md)] w-[var(--control-height-md)] p-0`},d={default:`rounded-[var(--radius-control)]`,circle:`!rounded-full !p-0 aspect-square`,round:`!rounded-full`},v={neutral:{solid:`border-border-strong bg-surface-3 text-text-primary shadow-xs hover:bg-surface-2 active:bg-surface-3 focus-visible:ring-primary/40`,soft:`bg-surface-2 text-text-primary shadow-xs hover:bg-surface-3 active:bg-surface-3 focus-visible:ring-primary/40`,outline:`border-border-strong bg-transparent text-text-primary shadow-xs hover:border-primary active:bg-surface-2 focus-visible:ring-primary/40`,dashed:`border-border-strong text-text-primary hover:border-primary active:bg-surface-2 focus-visible:ring-primary/40`,ghost:`text-text-primary hover:bg-surface-2 active:bg-surface-3 focus-visible:ring-primary/40`,text:`text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-primary/40`,link:`text-text-primary focus-visible:ring-primary/40`},primary:{solid:`bg-[var(--button-primary-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-primary-solid-hover)] active:bg-[var(--button-primary-solid-active)] focus-visible:ring-primary`,soft:`bg-primary-soft text-text-primary hover:shadow-sm active:bg-primary-soft focus-visible:ring-primary/40`,outline:`border-primary bg-transparent text-text-primary hover:bg-primary-soft active:bg-primary-soft focus-visible:ring-primary/40`,dashed:`border-primary text-text-primary hover:bg-primary-soft active:bg-primary-soft focus-visible:ring-primary/40`,ghost:`text-text-primary hover:bg-primary-soft active:bg-primary-soft focus-visible:ring-primary/40`,text:`text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-primary/40`,link:`text-text-primary focus-visible:ring-primary/40`},success:{solid:`bg-[var(--button-success-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-success-solid-hover)] active:bg-[var(--button-success-solid-active)] focus-visible:ring-success`,soft:`bg-success-soft text-text-primary hover:shadow-sm active:bg-success-soft focus-visible:ring-success/40`,outline:`border-success bg-transparent text-text-primary hover:bg-success-soft active:bg-success-soft focus-visible:ring-success/40`,dashed:`border-success text-text-primary hover:bg-success-soft active:bg-success-soft focus-visible:ring-success/40`,ghost:`text-text-primary hover:bg-success-soft active:bg-success-soft focus-visible:ring-success/40`,text:`text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-success/40`,link:`text-text-primary focus-visible:ring-success/40`},warning:{solid:`bg-[var(--button-warning-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-warning-solid-hover)] active:bg-[var(--button-warning-solid-active)] focus-visible:ring-warning`,soft:`bg-warning-soft text-text-primary hover:shadow-sm active:bg-warning-soft focus-visible:ring-warning/40`,outline:`border-warning bg-transparent text-text-primary hover:bg-warning-soft active:bg-warning-soft focus-visible:ring-warning/40`,dashed:`border-warning text-text-primary hover:bg-warning-soft active:bg-warning-soft focus-visible:ring-warning/40`,ghost:`text-text-primary hover:bg-warning-soft active:bg-warning-soft focus-visible:ring-warning/40`,text:`text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-warning/40`,link:`text-text-primary focus-visible:ring-warning/40`},danger:{solid:`bg-[var(--button-danger-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-danger-solid-hover)] active:bg-[var(--button-danger-solid-active)] focus-visible:ring-danger`,soft:`bg-danger-soft text-text-primary hover:shadow-sm active:bg-danger-soft focus-visible:ring-danger/40`,outline:`border-danger bg-transparent text-text-primary hover:bg-danger-soft active:bg-danger-soft focus-visible:ring-danger/40`,dashed:`border-danger text-text-primary hover:bg-danger-soft active:bg-danger-soft focus-visible:ring-danger/40`,ghost:`text-text-primary hover:bg-danger-soft active:bg-danger-soft focus-visible:ring-danger/40`,text:`text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-danger/40`,link:`text-text-primary focus-visible:ring-danger/40`},info:{solid:`bg-[var(--button-info-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-info-solid-hover)] active:bg-[var(--button-info-solid-active)] focus-visible:ring-info`,soft:`bg-info-soft text-text-primary hover:shadow-sm active:bg-info-soft focus-visible:ring-info/40`,outline:`border-info bg-transparent text-text-primary hover:bg-info-soft active:bg-info-soft focus-visible:ring-info/40`,dashed:`border-info text-text-primary hover:bg-info-soft active:bg-info-soft focus-visible:ring-info/40`,ghost:`text-text-primary hover:bg-info-soft active:bg-info-soft focus-visible:ring-info/40`,text:`text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-info/40`,link:`text-text-primary focus-visible:ring-info/40`}},y={text:`px-[var(--control-padding-x-sm)]`,link:`h-auto p-0 underline-offset-4 hover:underline`},b={small:`sm`,medium:`default`,large:`lg`},x={primary:`primary`,success:`success`,warning:`warning`,danger:`danger`,destructive:`danger`,info:`info`},S=(0,t.inject)(p,void 0),C=f(),w=(0,t.ref)(null),T=(0,t.computed)(()=>s.variant??S?.variant.value??C.value.button.variant??`default`),E=(0,t.computed)(()=>s.tone??S?.tone.value??C.value.button.tone??x[T.value]??(T.value===`solid`||T.value===`soft`?`primary`:`neutral`)),D=(0,t.computed)(()=>s.size??S?.size.value??b[C.value.size]),O=(0,t.computed)(()=>s.shape??S?.shape.value??C.value.button.shape??`default`),k=(0,t.computed)(()=>{let e=T.value;if([`solid`,`soft`,`outline`,`dashed`,`ghost`,`text`,`link`].includes(e))return v[E.value][e]}),A=(0,t.computed)(()=>e.t(`inline-flex items-center justify-center gap-[var(--button-icon-gap)] whitespace-nowrap border-solid border-transparent font-[var(--button-font-weight)] transition-[background,border-color,color,box-shadow,opacity] duration-[var(--motion-duration-base)] ease-[var(--motion-easing-standard)] motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-[length:var(--button-focus-ring-width)] focus-visible:ring-offset-[length:var(--button-focus-ring-offset)] disabled:pointer-events-none disabled:cursor-not-allowed select-none`,l[T.value],v[E.value]&&k.value,u[D.value],d[O.value],s.block&&`w-full flex`,y[T.value],s.class)),j=(0,t.computed)(()=>[{fontWeight:`var(--button-font-weight)`},s.style]),M=(0,t.computed)(()=>o(s.disabled,S?.disabled.value??C.value.disabled)||s.loading),N=(0,t.computed)(()=>{let e=[];return s.loading&&e.push(`loading`),M.value&&e.push(`disabled`),e.length>0?e.join(` `):void 0});function P(e){M.value||c(`click`,e)}return i({ref:w}),(e,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{ref_key:`buttonRef`,ref:w,class:(0,t.normalizeClass)(A.value),style:(0,t.normalizeStyle)(j.value),type:r.nativeType,disabled:M.value,"aria-busy":r.loading||void 0,"data-ug":`button`,"data-state":N.value,"data-variant":T.value,"data-tone":E.value,"data-size":D.value,"data-shape":O.value,"data-block":r.block?`true`:void 0,"data-ug-namespace":(0,t.unref)(C).namespace,onClick:P},[r.loading&&r.loadingPlacement===`start`?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,h,[(0,t.renderSlot)(e.$slots,`loading`,{},()=>[(0,t.createVNode)((0,t.unref)(n.Loader2),{class:`animate-spin motion-reduce:animate-none`,size:D.value===`sm`?14:16},null,8,[`size`])])])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,g,[r.loading&&r.loadingText!==void 0?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createTextVNode)((0,t.toDisplayString)(r.loadingText),1)],64)):(0,t.renderSlot)(e.$slots,`default`,{},void 0,void 0,1)]),r.loading&&r.loadingPlacement===`end`?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,_,[(0,t.renderSlot)(e.$slots,`loading`,{},()=>[(0,t.createVNode)((0,t.unref)(n.Loader2),{class:`animate-spin motion-reduce:animate-none`,size:D.value===`sm`?14:16},null,8,[`size`])])])):(0,t.createCommentVNode)(``,!0)],14,m))}});Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return v}});
2
+ //# sourceMappingURL=button-CVw3ryBz.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button-CVw3ryBz.cjs","names":[],"sources":["../src/components/config-provider.vue","../src/components/context/button-group.ts","../src/components/button.vue","../src/components/button.vue"],"sourcesContent":["<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n h,\n inject,\n provide,\n type ComputedRef,\n type InjectionKey,\n type PropType,\n} from 'vue'\n\nexport type ComponentSize = 'small' | 'medium' | 'large'\nexport type ControlSize = 'sm' | 'default' | 'lg'\n\nconst CONFIG_SIZE_TO_CONTROL_SIZE: Record<ComponentSize, ControlSize> = {\n small: 'sm',\n medium: 'default',\n large: 'lg',\n}\n\nconst CONTROL_SIZE_TO_CONFIG_SIZE: Record<ControlSize, ComponentSize> = {\n sm: 'small',\n default: 'medium',\n lg: 'large',\n}\n\nexport function resolveControlSize(\n size: ControlSize | undefined,\n configSize: ComponentSize,\n): ControlSize {\n return size ?? CONFIG_SIZE_TO_CONTROL_SIZE[configSize]\n}\n\nexport function resolveDisabled(\n disabled: boolean | undefined,\n configDisabled: boolean,\n): boolean {\n return disabled ?? configDisabled\n}\n\nexport function controlSizeToComponentSize(size: ControlSize): ComponentSize {\n return CONTROL_SIZE_TO_CONFIG_SIZE[size]\n}\n\nexport interface UIConfig {\n namespace: string\n size: ComponentSize\n disabled: boolean\n button: ButtonDefaults\n link: LinkDefaults\n}\n\nexport interface ButtonDefaults {\n variant?:\n | 'solid'\n | 'soft'\n | 'primary'\n | 'success'\n | 'warning'\n | 'danger'\n | 'info'\n | 'default'\n | 'secondary'\n | 'outline'\n | 'dashed'\n | 'ghost'\n | 'text'\n | 'link'\n | 'destructive'\n tone?: 'neutral' | 'primary' | 'success' | 'warning' | 'danger' | 'info'\n shape?: 'default' | 'circle' | 'round'\n}\n\nexport interface LinkDefaults {\n underline?: 'always' | 'hover' | 'never'\n tone?: 'neutral' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'inherit'\n}\n\nconst defaultConfig: UIConfig = {\n namespace: 'ug',\n size: 'medium',\n disabled: false,\n button: {},\n link: {},\n}\nconst CONFIG_KEY: InjectionKey<ComputedRef<UIConfig>> = Symbol('ug-ui-config')\n\nfunction mergeDefined<T extends object>(parent: T, current?: Partial<T>): T {\n const merged = { ...parent }\n if (!current) return merged\n\n Object.entries(current).forEach(([key, value]) => {\n if (value !== undefined) Object.assign(merged, { [key]: value })\n })\n return merged\n}\n\nconst UConfigProvider = defineComponent({\n name: 'UConfigProvider',\n inheritAttrs: false,\n props: {\n namespace: { type: String, default: undefined },\n size: { type: String as PropType<ComponentSize>, default: undefined },\n disabled: { type: Boolean, default: undefined },\n button: { type: Object as PropType<Partial<ButtonDefaults>>, default: undefined },\n link: { type: Object as PropType<Partial<LinkDefaults>>, default: undefined },\n },\n setup(props, { attrs, slots }) {\n const parent = inject(CONFIG_KEY, computed(() => defaultConfig))\n const config = computed<UIConfig>(() => ({\n namespace: props.namespace ?? parent.value.namespace,\n size: props.size ?? parent.value.size,\n disabled: props.disabled ?? parent.value.disabled,\n button: mergeDefined(parent.value.button, props.button),\n link: mergeDefined(parent.value.link, props.link),\n }))\n provide(CONFIG_KEY, config)\n return () => h(\n 'div',\n {\n ...attrs,\n class: ['[display:contents]', attrs.class],\n 'data-size': config.value.size,\n 'data-state': config.value.disabled ? 'disabled' : 'default',\n 'data-ug': 'config-provider',\n 'data-ug-namespace': config.value.namespace,\n 'data-ug-slot': 'root',\n 'data-variant': 'default',\n },\n slots.default?.(),\n )\n },\n})\n\nexport function useUIConfig(): ComputedRef<UIConfig> {\n return inject(CONFIG_KEY, computed(() => defaultConfig))\n}\n\nexport default UConfigProvider\n</script>\n","/**\n * @description: Vue Button 与 ButtonGroup 共享类型和依赖注入合同\n * @author: UG - 一个斗码大陆苦逼的三段码之气的少年,并没有神秘戒指中码老的帮助,但总有一天,我会成为斗码大陆中码帝一样的存在。三十年河东,三十年河西,莫欺少年穷。\n * @date: 2026-07-25\n */\nimport type { InjectionKey, Ref, StyleValue } from 'vue'\n\nexport type ButtonVariant =\n | 'solid'\n | 'soft'\n | 'primary'\n | 'success'\n | 'warning'\n | 'danger'\n | 'info'\n | 'default'\n | 'secondary'\n | 'outline'\n | 'dashed'\n | 'ghost'\n | 'text'\n | 'link'\n | 'destructive'\n\nexport type ButtonTone = 'neutral' | 'primary' | 'success' | 'warning' | 'danger' | 'info'\nexport type ButtonSize = 'default' | 'sm' | 'lg' | 'icon'\nexport type ButtonShape = 'default' | 'circle' | 'round'\nexport type ButtonNativeType = 'button' | 'submit' | 'reset'\nexport type ButtonLoadingPlacement = 'start' | 'end'\n\nexport interface ButtonProps {\n variant?: ButtonVariant\n tone?: ButtonTone\n size?: ButtonSize\n shape?: ButtonShape\n block?: boolean\n loading?: boolean\n loadingText?: string\n loadingPlacement?: ButtonLoadingPlacement\n disabled?: boolean\n nativeType?: ButtonNativeType\n class?: string\n style?: StyleValue\n}\n\nexport interface ButtonGroupProps {\n variant?: ButtonVariant\n tone?: ButtonTone\n size?: ButtonSize\n shape?: ButtonShape\n disabled?: boolean\n orientation?: 'horizontal' | 'vertical'\n attached?: boolean\n class?: string\n}\n\nexport interface ButtonGroupContextValue {\n variant: Ref<ButtonVariant | undefined>\n tone: Ref<ButtonTone | undefined>\n size: Ref<ButtonSize | undefined>\n shape: Ref<ButtonShape | undefined>\n disabled: Ref<boolean>\n}\n\nexport const BUTTON_GROUP_KEY: InjectionKey<ButtonGroupContextValue> = Symbol('UGButtonGroup')\n","/**\n * @description: UButton 按钮组件,统一处理外观、语义色、尺寸、状态与组合\n * @author: UG - 一个斗码大陆苦逼的三段码之气的少年,并没有神秘戒指中码老的帮助,但总有一天,我会成为斗码大陆中码帝一样的存在。三十年河东,三十年河西,莫欺少年穷。\n * @date: 2026-07-22\n */\n<script lang=\"ts\">\nexport type {\n ButtonLoadingPlacement,\n ButtonNativeType,\n ButtonProps,\n ButtonShape,\n ButtonSize,\n ButtonTone,\n ButtonVariant,\n} from './context/button-group'\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, inject, ref, type PropType, type StyleValue } from 'vue'\nimport { Loader2 } from '@lucide/vue'\nimport { cn } from '../internal/cn'\nimport {\n resolveDisabled,\n useUIConfig,\n type ComponentSize,\n} from './config-provider.vue'\nimport {\n BUTTON_GROUP_KEY,\n type ButtonLoadingPlacement,\n type ButtonNativeType,\n type ButtonShape,\n type ButtonSize,\n type ButtonTone,\n type ButtonVariant,\n} from './context/button-group'\n\nconst props = defineProps({\n variant: String as PropType<ButtonVariant>,\n tone: String as PropType<ButtonTone>,\n size: String as PropType<ButtonSize>,\n shape: String as PropType<ButtonShape>,\n block: { type: Boolean, default: false },\n loading: { type: Boolean, default: false },\n loadingText: String,\n loadingPlacement: {\n type: String as PropType<ButtonLoadingPlacement>,\n default: 'start',\n },\n disabled: { type: Boolean, default: undefined },\n nativeType: {\n type: String as PropType<ButtonNativeType>,\n default: 'button',\n },\n class: String,\n style: [String, Object, Array] as PropType<StyleValue>,\n})\n\nconst emit = defineEmits<{\n click: [event: MouseEvent]\n}>()\n\nconst VARIANT_CLASSES: Record<ButtonVariant, string> = {\n solid: '',\n soft: '',\n primary: 'bg-[var(--button-primary-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-primary-solid-hover)] active:bg-[var(--button-primary-solid-active)] focus-visible:ring-primary',\n success: 'bg-[var(--button-success-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-success-solid-hover)] active:bg-[var(--button-success-solid-active)] focus-visible:ring-success',\n warning: 'bg-[var(--button-warning-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-warning-solid-hover)] active:bg-[var(--button-warning-solid-active)] focus-visible:ring-warning',\n danger: 'bg-[var(--button-danger-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-danger-solid-hover)] active:bg-[var(--button-danger-solid-active)] focus-visible:ring-danger',\n destructive: 'bg-[var(--button-danger-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-danger-solid-hover)] active:bg-[var(--button-danger-solid-active)] focus-visible:ring-danger',\n info: 'bg-[var(--button-info-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-info-solid-hover)] active:bg-[var(--button-info-solid-active)] focus-visible:ring-info',\n default: 'border-border-base bg-surface-1 text-text-primary shadow-xs hover:border-primary active:bg-surface-2 focus-visible:ring-primary/40',\n secondary: 'border-border-base bg-surface-2 text-text-primary shadow-xs hover:bg-surface-3 active:bg-surface-3 focus-visible:ring-primary/40',\n outline: 'bg-transparent',\n dashed: 'border-dashed bg-transparent',\n ghost: '',\n text: '',\n link: '',\n}\n\nconst SIZE_CLASSES: Record<ButtonSize, string> = {\n default: 'h-[var(--control-height-md)] px-[var(--control-padding-x-md)] py-0',\n sm: 'h-[var(--control-height-sm)] px-[var(--control-padding-x-sm)] py-0',\n lg: 'h-[var(--control-height-lg)] px-[var(--control-padding-x-lg)] py-0',\n icon: 'h-[var(--control-height-md)] w-[var(--control-height-md)] p-0',\n}\n\nconst SHAPE_CLASSES: Record<ButtonShape, string> = {\n default: 'rounded-[var(--radius-control)]',\n circle: '!rounded-full !p-0 aspect-square',\n round: '!rounded-full',\n}\n\nconst BASE_CLASS = 'inline-flex items-center justify-center gap-[var(--button-icon-gap)] whitespace-nowrap border-solid border-transparent font-[var(--button-font-weight)] transition-[background,border-color,color,box-shadow,opacity] duration-[var(--motion-duration-base)] ease-[var(--motion-easing-standard)] motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-[length:var(--button-focus-ring-width)] focus-visible:ring-offset-[length:var(--button-focus-ring-offset)] disabled:pointer-events-none disabled:cursor-not-allowed select-none'\n\ntype ToneVariant = 'solid' | 'soft' | 'outline' | 'dashed' | 'ghost' | 'text' | 'link'\n\nconst TONE_VARIANT_CLASSES: Record<ButtonTone, Record<ToneVariant, string>> = {\n neutral: {\n solid: 'border-border-strong bg-surface-3 text-text-primary shadow-xs hover:bg-surface-2 active:bg-surface-3 focus-visible:ring-primary/40',\n soft: 'bg-surface-2 text-text-primary shadow-xs hover:bg-surface-3 active:bg-surface-3 focus-visible:ring-primary/40',\n outline: 'border-border-strong bg-transparent text-text-primary shadow-xs hover:border-primary active:bg-surface-2 focus-visible:ring-primary/40',\n dashed: 'border-border-strong text-text-primary hover:border-primary active:bg-surface-2 focus-visible:ring-primary/40',\n ghost: 'text-text-primary hover:bg-surface-2 active:bg-surface-3 focus-visible:ring-primary/40',\n text: 'text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-primary/40',\n link: 'text-text-primary focus-visible:ring-primary/40',\n },\n primary: {\n solid: 'bg-[var(--button-primary-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-primary-solid-hover)] active:bg-[var(--button-primary-solid-active)] focus-visible:ring-primary',\n soft: 'bg-primary-soft text-text-primary hover:shadow-sm active:bg-primary-soft focus-visible:ring-primary/40',\n outline: 'border-primary bg-transparent text-text-primary hover:bg-primary-soft active:bg-primary-soft focus-visible:ring-primary/40',\n dashed: 'border-primary text-text-primary hover:bg-primary-soft active:bg-primary-soft focus-visible:ring-primary/40',\n ghost: 'text-text-primary hover:bg-primary-soft active:bg-primary-soft focus-visible:ring-primary/40',\n text: 'text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-primary/40',\n link: 'text-text-primary focus-visible:ring-primary/40',\n },\n success: {\n solid: 'bg-[var(--button-success-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-success-solid-hover)] active:bg-[var(--button-success-solid-active)] focus-visible:ring-success',\n soft: 'bg-success-soft text-text-primary hover:shadow-sm active:bg-success-soft focus-visible:ring-success/40',\n outline: 'border-success bg-transparent text-text-primary hover:bg-success-soft active:bg-success-soft focus-visible:ring-success/40',\n dashed: 'border-success text-text-primary hover:bg-success-soft active:bg-success-soft focus-visible:ring-success/40',\n ghost: 'text-text-primary hover:bg-success-soft active:bg-success-soft focus-visible:ring-success/40',\n text: 'text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-success/40',\n link: 'text-text-primary focus-visible:ring-success/40',\n },\n warning: {\n solid: 'bg-[var(--button-warning-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-warning-solid-hover)] active:bg-[var(--button-warning-solid-active)] focus-visible:ring-warning',\n soft: 'bg-warning-soft text-text-primary hover:shadow-sm active:bg-warning-soft focus-visible:ring-warning/40',\n outline: 'border-warning bg-transparent text-text-primary hover:bg-warning-soft active:bg-warning-soft focus-visible:ring-warning/40',\n dashed: 'border-warning text-text-primary hover:bg-warning-soft active:bg-warning-soft focus-visible:ring-warning/40',\n ghost: 'text-text-primary hover:bg-warning-soft active:bg-warning-soft focus-visible:ring-warning/40',\n text: 'text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-warning/40',\n link: 'text-text-primary focus-visible:ring-warning/40',\n },\n danger: {\n solid: 'bg-[var(--button-danger-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-danger-solid-hover)] active:bg-[var(--button-danger-solid-active)] focus-visible:ring-danger',\n soft: 'bg-danger-soft text-text-primary hover:shadow-sm active:bg-danger-soft focus-visible:ring-danger/40',\n outline: 'border-danger bg-transparent text-text-primary hover:bg-danger-soft active:bg-danger-soft focus-visible:ring-danger/40',\n dashed: 'border-danger text-text-primary hover:bg-danger-soft active:bg-danger-soft focus-visible:ring-danger/40',\n ghost: 'text-text-primary hover:bg-danger-soft active:bg-danger-soft focus-visible:ring-danger/40',\n text: 'text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-danger/40',\n link: 'text-text-primary focus-visible:ring-danger/40',\n },\n info: {\n solid: 'bg-[var(--button-info-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-info-solid-hover)] active:bg-[var(--button-info-solid-active)] focus-visible:ring-info',\n soft: 'bg-info-soft text-text-primary hover:shadow-sm active:bg-info-soft focus-visible:ring-info/40',\n outline: 'border-info bg-transparent text-text-primary hover:bg-info-soft active:bg-info-soft focus-visible:ring-info/40',\n dashed: 'border-info text-text-primary hover:bg-info-soft active:bg-info-soft focus-visible:ring-info/40',\n ghost: 'text-text-primary hover:bg-info-soft active:bg-info-soft focus-visible:ring-info/40',\n text: 'text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-info/40',\n link: 'text-text-primary focus-visible:ring-info/40',\n },\n}\n\nconst VARIANT_LAYOUT_CLASSES: Partial<Record<ButtonVariant, string>> = {\n text: 'px-[var(--control-padding-x-sm)]',\n link: 'h-auto p-0 underline-offset-4 hover:underline',\n}\n\nconst CONFIG_SIZE_TO_BUTTON_SIZE: Record<ComponentSize, ButtonSize> = {\n small: 'sm',\n medium: 'default',\n large: 'lg',\n}\n\nconst LEGACY_VARIANT_TONES: Partial<Record<ButtonVariant, ButtonTone>> = {\n primary: 'primary',\n success: 'success',\n warning: 'warning',\n danger: 'danger',\n destructive: 'danger',\n info: 'info',\n}\n\nconst group = inject(BUTTON_GROUP_KEY, undefined)\nconst config = useUIConfig()\nconst buttonRef = ref<HTMLButtonElement | null>(null)\nconst resolvedVariant = computed<ButtonVariant>(() =>\n props.variant ?? group?.variant.value ?? config.value.button.variant ?? 'default',\n)\nconst resolvedTone = computed<ButtonTone>(() =>\n props.tone\n ?? group?.tone.value\n ?? config.value.button.tone\n ?? LEGACY_VARIANT_TONES[resolvedVariant.value]\n ?? (resolvedVariant.value === 'solid' || resolvedVariant.value === 'soft' ? 'primary' : 'neutral'),\n)\nconst resolvedSize = computed<ButtonSize>(() =>\n props.size ?? group?.size.value ?? CONFIG_SIZE_TO_BUTTON_SIZE[config.value.size],\n)\nconst resolvedShape = computed<ButtonShape>(() =>\n props.shape ?? group?.shape.value ?? config.value.button.shape ?? 'default',\n)\nconst toneClasses = computed(() => {\n const variant = resolvedVariant.value\n if (!['solid', 'soft', 'outline', 'dashed', 'ghost', 'text', 'link'].includes(variant)) return undefined\n return TONE_VARIANT_CLASSES[resolvedTone.value][variant as ToneVariant]\n})\n\nconst classes = computed(() =>\n cn(\n BASE_CLASS,\n VARIANT_CLASSES[resolvedVariant.value],\n TONE_VARIANT_CLASSES[resolvedTone.value] && toneClasses.value,\n SIZE_CLASSES[resolvedSize.value],\n SHAPE_CLASSES[resolvedShape.value],\n props.block && 'w-full flex',\n VARIANT_LAYOUT_CLASSES[resolvedVariant.value],\n props.class,\n ),\n)\nconst buttonStyle = computed<StyleValue>(() => [\n { fontWeight: 'var(--button-font-weight)' },\n props.style,\n])\n\nconst isDisabled = computed(\n () =>\n resolveDisabled(\n props.disabled,\n group?.disabled.value ?? config.value.disabled,\n ) || props.loading,\n)\nconst state = computed(() => {\n const states: string[] = []\n if (props.loading) states.push('loading')\n if (isDisabled.value) states.push('disabled')\n return states.length > 0 ? states.join(' ') : undefined\n})\n\nfunction handleClick(event: MouseEvent) {\n if (!isDisabled.value) {\n emit('click', event)\n }\n}\n\ndefineExpose({\n ref: buttonRef,\n})\n</script>\n\n<template>\n <button\n ref=\"buttonRef\"\n :class=\"classes\"\n :style=\"buttonStyle\"\n :type=\"nativeType\"\n :disabled=\"isDisabled\"\n :aria-busy=\"loading || undefined\"\n data-ug=\"button\"\n :data-state=\"state\"\n :data-variant=\"resolvedVariant\"\n :data-tone=\"resolvedTone\"\n :data-size=\"resolvedSize\"\n :data-shape=\"resolvedShape\"\n :data-block=\"block ? 'true' : undefined\"\n :data-ug-namespace=\"config.namespace\"\n @click=\"handleClick\"\n >\n <span\n v-if=\"loading && loadingPlacement === 'start'\"\n data-ug-slot=\"loader\"\n class=\"inline-flex shrink-0 items-center justify-center\"\n aria-hidden=\"true\"\n >\n <slot name=\"loading\">\n <Loader2 class=\"animate-spin motion-reduce:animate-none\" :size=\"resolvedSize === 'sm' ? 14 : 16\" />\n </slot>\n </span>\n <span data-ug-slot=\"label\" class=\"inline-flex min-w-0 items-center justify-center gap-[var(--button-icon-gap)]\">\n <template v-if=\"loading && loadingText !== undefined\">{{ loadingText }}</template>\n <slot v-else />\n </span>\n <span\n v-if=\"loading && loadingPlacement === 'end'\"\n data-ug-slot=\"loader\"\n class=\"inline-flex shrink-0 items-center justify-center\"\n aria-hidden=\"true\"\n >\n <slot name=\"loading\">\n <Loader2 class=\"animate-spin motion-reduce:animate-none\" :size=\"resolvedSize === 'sm' ? 14 : 16\" />\n </slot>\n </span>\n </button>\n</template>\n","/**\n * @description: UButton 按钮组件,统一处理外观、语义色、尺寸、状态与组合\n * @author: UG - 一个斗码大陆苦逼的三段码之气的少年,并没有神秘戒指中码老的帮助,但总有一天,我会成为斗码大陆中码帝一样的存在。三十年河东,三十年河西,莫欺少年穷。\n * @date: 2026-07-22\n */\n<script lang=\"ts\">\nexport type {\n ButtonLoadingPlacement,\n ButtonNativeType,\n ButtonProps,\n ButtonShape,\n ButtonSize,\n ButtonTone,\n ButtonVariant,\n} from './context/button-group'\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, inject, ref, type PropType, type StyleValue } from 'vue'\nimport { Loader2 } from '@lucide/vue'\nimport { cn } from '../internal/cn'\nimport {\n resolveDisabled,\n useUIConfig,\n type ComponentSize,\n} from './config-provider.vue'\nimport {\n BUTTON_GROUP_KEY,\n type ButtonLoadingPlacement,\n type ButtonNativeType,\n type ButtonShape,\n type ButtonSize,\n type ButtonTone,\n type ButtonVariant,\n} from './context/button-group'\n\nconst props = defineProps({\n variant: String as PropType<ButtonVariant>,\n tone: String as PropType<ButtonTone>,\n size: String as PropType<ButtonSize>,\n shape: String as PropType<ButtonShape>,\n block: { type: Boolean, default: false },\n loading: { type: Boolean, default: false },\n loadingText: String,\n loadingPlacement: {\n type: String as PropType<ButtonLoadingPlacement>,\n default: 'start',\n },\n disabled: { type: Boolean, default: undefined },\n nativeType: {\n type: String as PropType<ButtonNativeType>,\n default: 'button',\n },\n class: String,\n style: [String, Object, Array] as PropType<StyleValue>,\n})\n\nconst emit = defineEmits<{\n click: [event: MouseEvent]\n}>()\n\nconst VARIANT_CLASSES: Record<ButtonVariant, string> = {\n solid: '',\n soft: '',\n primary: 'bg-[var(--button-primary-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-primary-solid-hover)] active:bg-[var(--button-primary-solid-active)] focus-visible:ring-primary',\n success: 'bg-[var(--button-success-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-success-solid-hover)] active:bg-[var(--button-success-solid-active)] focus-visible:ring-success',\n warning: 'bg-[var(--button-warning-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-warning-solid-hover)] active:bg-[var(--button-warning-solid-active)] focus-visible:ring-warning',\n danger: 'bg-[var(--button-danger-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-danger-solid-hover)] active:bg-[var(--button-danger-solid-active)] focus-visible:ring-danger',\n destructive: 'bg-[var(--button-danger-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-danger-solid-hover)] active:bg-[var(--button-danger-solid-active)] focus-visible:ring-danger',\n info: 'bg-[var(--button-info-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-info-solid-hover)] active:bg-[var(--button-info-solid-active)] focus-visible:ring-info',\n default: 'border-border-base bg-surface-1 text-text-primary shadow-xs hover:border-primary active:bg-surface-2 focus-visible:ring-primary/40',\n secondary: 'border-border-base bg-surface-2 text-text-primary shadow-xs hover:bg-surface-3 active:bg-surface-3 focus-visible:ring-primary/40',\n outline: 'bg-transparent',\n dashed: 'border-dashed bg-transparent',\n ghost: '',\n text: '',\n link: '',\n}\n\nconst SIZE_CLASSES: Record<ButtonSize, string> = {\n default: 'h-[var(--control-height-md)] px-[var(--control-padding-x-md)] py-0',\n sm: 'h-[var(--control-height-sm)] px-[var(--control-padding-x-sm)] py-0',\n lg: 'h-[var(--control-height-lg)] px-[var(--control-padding-x-lg)] py-0',\n icon: 'h-[var(--control-height-md)] w-[var(--control-height-md)] p-0',\n}\n\nconst SHAPE_CLASSES: Record<ButtonShape, string> = {\n default: 'rounded-[var(--radius-control)]',\n circle: '!rounded-full !p-0 aspect-square',\n round: '!rounded-full',\n}\n\nconst BASE_CLASS = 'inline-flex items-center justify-center gap-[var(--button-icon-gap)] whitespace-nowrap border-solid border-transparent font-[var(--button-font-weight)] transition-[background,border-color,color,box-shadow,opacity] duration-[var(--motion-duration-base)] ease-[var(--motion-easing-standard)] motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-[length:var(--button-focus-ring-width)] focus-visible:ring-offset-[length:var(--button-focus-ring-offset)] disabled:pointer-events-none disabled:cursor-not-allowed select-none'\n\ntype ToneVariant = 'solid' | 'soft' | 'outline' | 'dashed' | 'ghost' | 'text' | 'link'\n\nconst TONE_VARIANT_CLASSES: Record<ButtonTone, Record<ToneVariant, string>> = {\n neutral: {\n solid: 'border-border-strong bg-surface-3 text-text-primary shadow-xs hover:bg-surface-2 active:bg-surface-3 focus-visible:ring-primary/40',\n soft: 'bg-surface-2 text-text-primary shadow-xs hover:bg-surface-3 active:bg-surface-3 focus-visible:ring-primary/40',\n outline: 'border-border-strong bg-transparent text-text-primary shadow-xs hover:border-primary active:bg-surface-2 focus-visible:ring-primary/40',\n dashed: 'border-border-strong text-text-primary hover:border-primary active:bg-surface-2 focus-visible:ring-primary/40',\n ghost: 'text-text-primary hover:bg-surface-2 active:bg-surface-3 focus-visible:ring-primary/40',\n text: 'text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-primary/40',\n link: 'text-text-primary focus-visible:ring-primary/40',\n },\n primary: {\n solid: 'bg-[var(--button-primary-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-primary-solid-hover)] active:bg-[var(--button-primary-solid-active)] focus-visible:ring-primary',\n soft: 'bg-primary-soft text-text-primary hover:shadow-sm active:bg-primary-soft focus-visible:ring-primary/40',\n outline: 'border-primary bg-transparent text-text-primary hover:bg-primary-soft active:bg-primary-soft focus-visible:ring-primary/40',\n dashed: 'border-primary text-text-primary hover:bg-primary-soft active:bg-primary-soft focus-visible:ring-primary/40',\n ghost: 'text-text-primary hover:bg-primary-soft active:bg-primary-soft focus-visible:ring-primary/40',\n text: 'text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-primary/40',\n link: 'text-text-primary focus-visible:ring-primary/40',\n },\n success: {\n solid: 'bg-[var(--button-success-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-success-solid-hover)] active:bg-[var(--button-success-solid-active)] focus-visible:ring-success',\n soft: 'bg-success-soft text-text-primary hover:shadow-sm active:bg-success-soft focus-visible:ring-success/40',\n outline: 'border-success bg-transparent text-text-primary hover:bg-success-soft active:bg-success-soft focus-visible:ring-success/40',\n dashed: 'border-success text-text-primary hover:bg-success-soft active:bg-success-soft focus-visible:ring-success/40',\n ghost: 'text-text-primary hover:bg-success-soft active:bg-success-soft focus-visible:ring-success/40',\n text: 'text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-success/40',\n link: 'text-text-primary focus-visible:ring-success/40',\n },\n warning: {\n solid: 'bg-[var(--button-warning-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-warning-solid-hover)] active:bg-[var(--button-warning-solid-active)] focus-visible:ring-warning',\n soft: 'bg-warning-soft text-text-primary hover:shadow-sm active:bg-warning-soft focus-visible:ring-warning/40',\n outline: 'border-warning bg-transparent text-text-primary hover:bg-warning-soft active:bg-warning-soft focus-visible:ring-warning/40',\n dashed: 'border-warning text-text-primary hover:bg-warning-soft active:bg-warning-soft focus-visible:ring-warning/40',\n ghost: 'text-text-primary hover:bg-warning-soft active:bg-warning-soft focus-visible:ring-warning/40',\n text: 'text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-warning/40',\n link: 'text-text-primary focus-visible:ring-warning/40',\n },\n danger: {\n solid: 'bg-[var(--button-danger-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-danger-solid-hover)] active:bg-[var(--button-danger-solid-active)] focus-visible:ring-danger',\n soft: 'bg-danger-soft text-text-primary hover:shadow-sm active:bg-danger-soft focus-visible:ring-danger/40',\n outline: 'border-danger bg-transparent text-text-primary hover:bg-danger-soft active:bg-danger-soft focus-visible:ring-danger/40',\n dashed: 'border-danger text-text-primary hover:bg-danger-soft active:bg-danger-soft focus-visible:ring-danger/40',\n ghost: 'text-text-primary hover:bg-danger-soft active:bg-danger-soft focus-visible:ring-danger/40',\n text: 'text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-danger/40',\n link: 'text-text-primary focus-visible:ring-danger/40',\n },\n info: {\n solid: 'bg-[var(--button-info-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-info-solid-hover)] active:bg-[var(--button-info-solid-active)] focus-visible:ring-info',\n soft: 'bg-info-soft text-text-primary hover:shadow-sm active:bg-info-soft focus-visible:ring-info/40',\n outline: 'border-info bg-transparent text-text-primary hover:bg-info-soft active:bg-info-soft focus-visible:ring-info/40',\n dashed: 'border-info text-text-primary hover:bg-info-soft active:bg-info-soft focus-visible:ring-info/40',\n ghost: 'text-text-primary hover:bg-info-soft active:bg-info-soft focus-visible:ring-info/40',\n text: 'text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-info/40',\n link: 'text-text-primary focus-visible:ring-info/40',\n },\n}\n\nconst VARIANT_LAYOUT_CLASSES: Partial<Record<ButtonVariant, string>> = {\n text: 'px-[var(--control-padding-x-sm)]',\n link: 'h-auto p-0 underline-offset-4 hover:underline',\n}\n\nconst CONFIG_SIZE_TO_BUTTON_SIZE: Record<ComponentSize, ButtonSize> = {\n small: 'sm',\n medium: 'default',\n large: 'lg',\n}\n\nconst LEGACY_VARIANT_TONES: Partial<Record<ButtonVariant, ButtonTone>> = {\n primary: 'primary',\n success: 'success',\n warning: 'warning',\n danger: 'danger',\n destructive: 'danger',\n info: 'info',\n}\n\nconst group = inject(BUTTON_GROUP_KEY, undefined)\nconst config = useUIConfig()\nconst buttonRef = ref<HTMLButtonElement | null>(null)\nconst resolvedVariant = computed<ButtonVariant>(() =>\n props.variant ?? group?.variant.value ?? config.value.button.variant ?? 'default',\n)\nconst resolvedTone = computed<ButtonTone>(() =>\n props.tone\n ?? group?.tone.value\n ?? config.value.button.tone\n ?? LEGACY_VARIANT_TONES[resolvedVariant.value]\n ?? (resolvedVariant.value === 'solid' || resolvedVariant.value === 'soft' ? 'primary' : 'neutral'),\n)\nconst resolvedSize = computed<ButtonSize>(() =>\n props.size ?? group?.size.value ?? CONFIG_SIZE_TO_BUTTON_SIZE[config.value.size],\n)\nconst resolvedShape = computed<ButtonShape>(() =>\n props.shape ?? group?.shape.value ?? config.value.button.shape ?? 'default',\n)\nconst toneClasses = computed(() => {\n const variant = resolvedVariant.value\n if (!['solid', 'soft', 'outline', 'dashed', 'ghost', 'text', 'link'].includes(variant)) return undefined\n return TONE_VARIANT_CLASSES[resolvedTone.value][variant as ToneVariant]\n})\n\nconst classes = computed(() =>\n cn(\n BASE_CLASS,\n VARIANT_CLASSES[resolvedVariant.value],\n TONE_VARIANT_CLASSES[resolvedTone.value] && toneClasses.value,\n SIZE_CLASSES[resolvedSize.value],\n SHAPE_CLASSES[resolvedShape.value],\n props.block && 'w-full flex',\n VARIANT_LAYOUT_CLASSES[resolvedVariant.value],\n props.class,\n ),\n)\nconst buttonStyle = computed<StyleValue>(() => [\n { fontWeight: 'var(--button-font-weight)' },\n props.style,\n])\n\nconst isDisabled = computed(\n () =>\n resolveDisabled(\n props.disabled,\n group?.disabled.value ?? config.value.disabled,\n ) || props.loading,\n)\nconst state = computed(() => {\n const states: string[] = []\n if (props.loading) states.push('loading')\n if (isDisabled.value) states.push('disabled')\n return states.length > 0 ? states.join(' ') : undefined\n})\n\nfunction handleClick(event: MouseEvent) {\n if (!isDisabled.value) {\n emit('click', event)\n }\n}\n\ndefineExpose({\n ref: buttonRef,\n})\n</script>\n\n<template>\n <button\n ref=\"buttonRef\"\n :class=\"classes\"\n :style=\"buttonStyle\"\n :type=\"nativeType\"\n :disabled=\"isDisabled\"\n :aria-busy=\"loading || undefined\"\n data-ug=\"button\"\n :data-state=\"state\"\n :data-variant=\"resolvedVariant\"\n :data-tone=\"resolvedTone\"\n :data-size=\"resolvedSize\"\n :data-shape=\"resolvedShape\"\n :data-block=\"block ? 'true' : undefined\"\n :data-ug-namespace=\"config.namespace\"\n @click=\"handleClick\"\n >\n <span\n v-if=\"loading && loadingPlacement === 'start'\"\n data-ug-slot=\"loader\"\n class=\"inline-flex shrink-0 items-center justify-center\"\n aria-hidden=\"true\"\n >\n <slot name=\"loading\">\n <Loader2 class=\"animate-spin motion-reduce:animate-none\" :size=\"resolvedSize === 'sm' ? 14 : 16\" />\n </slot>\n </span>\n <span data-ug-slot=\"label\" class=\"inline-flex min-w-0 items-center justify-center gap-[var(--button-icon-gap)]\">\n <template v-if=\"loading && loadingText !== undefined\">{{ loadingText }}</template>\n <slot v-else />\n </span>\n <span\n v-if=\"loading && loadingPlacement === 'end'\"\n data-ug-slot=\"loader\"\n class=\"inline-flex shrink-0 items-center justify-center\"\n aria-hidden=\"true\"\n >\n <slot name=\"loading\">\n <Loader2 class=\"animate-spin motion-reduce:animate-none\" :size=\"resolvedSize === 'sm' ? 14 : 16\" />\n </slot>\n </span>\n </button>\n</template>\n"],"mappings":"mFAeA,IAAM,EAAkE,CACtE,MAAO,KACP,OAAQ,UACR,MAAO,IACT,EAEM,EAAkE,CACtE,GAAI,QACJ,QAAS,SACT,GAAI,OACN,EAEA,SAAgB,EACd,EACA,EACa,CACb,OAAO,GAAQ,EAA4B,EAC7C,CAEA,SAAgB,EACd,EACA,EACS,CACT,OAAO,GAAY,CACrB,CAEA,SAAgB,EAA2B,EAAkC,CAC3E,OAAO,EAA4B,EACrC,CAoCA,IAAM,EAA0B,CAC9B,UAAW,KACX,KAAM,SACN,SAAU,GACV,OAAQ,CAAC,EACT,KAAM,CAAC,CACT,EACM,EAAkD,OAAO,cAAc,EAE7E,SAAS,EAA+B,EAAW,EAAyB,CAC1E,IAAM,EAAS,CAAE,GAAG,CAAO,EAM3B,OALK,GAEL,OAAO,QAAQ,CAAO,CAAC,CAAC,SAAS,CAAC,EAAK,KAAW,CAC5C,IAAU,IAAA,IAAW,OAAO,OAAO,EAAQ,EAAG,GAAM,CAAM,CAAC,CACjE,CAAC,EAJoB,CAMvB,CAEA,IAAM,GAAA,EAAA,EAAA,gBAAA,CAAkC,CACtC,KAAM,kBACN,aAAc,GACd,MAAO,CACL,UAAW,CAAE,KAAM,OAAQ,QAAS,IAAA,EAAU,EAC9C,KAAM,CAAE,KAAM,OAAmC,QAAS,IAAA,EAAU,EACpE,SAAU,CAAE,KAAM,QAAS,QAAS,IAAA,EAAU,EAC9C,OAAQ,CAAE,KAAM,OAA6C,QAAS,IAAA,EAAU,EAChF,KAAM,CAAE,KAAM,OAA2C,QAAS,IAAA,EAAU,CAC9E,EACA,MAAM,EAAO,CAAE,QAAO,SAAS,CAC7B,IAAM,GAAA,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AAA,MAAK,OAAY,IAAA,GAC7B,qBAAA,EAAA,EAAA,MAAA,CAAmB,CAAA,CAAM,CAAC,UAC1B,QAAO,IAGA,EAAA,SAAW,EAAA,mBAAgB,UAAA,EAAA,EAAA,UAAA,CAAA,GAAA,EAAA,EAAA,mBAAA,CAQ5B,OATP,EASO,EAAA,EAAA,EAAA,WAAA,CADE,EAAA,OAAA,UAAA,CAAA,MAAA,EAAA,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,MAAA,CAD8F,EAAA,OAAA,EAAA,CAA1F,MAAM,0CAA2C,KAAM,EAAA,QAAY,KAAA,GAAA,mFAMzE,OAHP,EAGO,CAFW,EAAA,SAAW,EAAA,cAAgB,IAAA,KAAA,EAAA,EAAA,UAAA,CAAA,GAAA,EAAA,EAAA,mBAAA,CAAuC,EAAA,SAAA,CAAA,IAAA,CAAA,EAAA,EAAA,EAAA,EAAA,gBAAA,EAAA,EAAA,EAAA,gBAAA,CAAzB,EAAA,WAAW,EAAA,CAAA,CAAA,EAAA,EAAA,IAAA,EAAA,EAAA,WAAA,CACrD,EAAA,OAAA,UAAA,CAAA,EAAA,IAAA,GAAA,IAAA,GAAA,CAAA,CAAA,CAAA,EAGT,EAAA,SAAW,EAAA,mBAAgB,QAAA,EAAA,EAAA,UAAA,CAAA,GAAA,EAAA,EAAA,mBAAA,CAQ5B,OATP,EASO,EAAA,EAAA,EAAA,WAAA,CADE,EAAA,OAAA,UAAA,CAAA,MAAA,EAAA,EAAA,EAAA,YAAA,EAAA,EAAA,EAAA,MAAA,CAD8F,EAAA,OAAA,EAAA,CAA1F,MAAM,0CAA2C,KAAM,EAAA,QAAY,KAAA,GAAA"}
@@ -0,0 +1,292 @@
1
+ import { t as e } from "./cn-Cl2u7rTh.js";
2
+ import { Fragment as t, computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, h as l, inject as u, normalizeClass as d, normalizeStyle as f, openBlock as p, provide as m, ref as h, renderSlot as g, toDisplayString as _, unref as v } from "vue";
3
+ import { Loader2 as y } from "@lucide/vue";
4
+ //#region src/components/config-provider.vue?vue&type=script&lang.ts
5
+ var b = {
6
+ small: "sm",
7
+ medium: "default",
8
+ large: "lg"
9
+ }, x = {
10
+ sm: "small",
11
+ default: "medium",
12
+ lg: "large"
13
+ };
14
+ function S(e, t) {
15
+ return e ?? b[t];
16
+ }
17
+ function C(e, t) {
18
+ return e ?? t;
19
+ }
20
+ function w(e) {
21
+ return x[e];
22
+ }
23
+ var T = {
24
+ namespace: "ug",
25
+ size: "medium",
26
+ disabled: !1,
27
+ button: {},
28
+ link: {}
29
+ }, E = Symbol("ug-ui-config");
30
+ function D(e, t) {
31
+ let n = { ...e };
32
+ return t && Object.entries(t).forEach(([e, t]) => {
33
+ t !== void 0 && Object.assign(n, { [e]: t });
34
+ }), n;
35
+ }
36
+ var O = c({
37
+ name: "UConfigProvider",
38
+ inheritAttrs: !1,
39
+ props: {
40
+ namespace: {
41
+ type: String,
42
+ default: void 0
43
+ },
44
+ size: {
45
+ type: String,
46
+ default: void 0
47
+ },
48
+ disabled: {
49
+ type: Boolean,
50
+ default: void 0
51
+ },
52
+ button: {
53
+ type: Object,
54
+ default: void 0
55
+ },
56
+ link: {
57
+ type: Object,
58
+ default: void 0
59
+ }
60
+ },
61
+ setup(e, { attrs: t, slots: r }) {
62
+ let i = u(E, n(() => T)), a = n(() => ({
63
+ namespace: e.namespace ?? i.value.namespace,
64
+ size: e.size ?? i.value.size,
65
+ disabled: e.disabled ?? i.value.disabled,
66
+ button: D(i.value.button, e.button),
67
+ link: D(i.value.link, e.link)
68
+ }));
69
+ return m(E, a), () => l("div", {
70
+ ...t,
71
+ class: ["[display:contents]", t.class],
72
+ "data-size": a.value.size,
73
+ "data-state": a.value.disabled ? "disabled" : "default",
74
+ "data-ug": "config-provider",
75
+ "data-ug-namespace": a.value.namespace,
76
+ "data-ug-slot": "root",
77
+ "data-variant": "default"
78
+ }, r.default?.());
79
+ }
80
+ });
81
+ function k() {
82
+ return u(E, n(() => T));
83
+ }
84
+ //#endregion
85
+ //#region src/components/context/button-group.ts
86
+ var A = Symbol("UGButtonGroup"), j = [
87
+ "type",
88
+ "disabled",
89
+ "aria-busy",
90
+ "data-state",
91
+ "data-variant",
92
+ "data-tone",
93
+ "data-size",
94
+ "data-shape",
95
+ "data-block",
96
+ "data-ug-namespace"
97
+ ], M = {
98
+ key: 0,
99
+ "data-ug-slot": "loader",
100
+ class: "inline-flex shrink-0 items-center justify-center",
101
+ "aria-hidden": "true"
102
+ }, N = {
103
+ "data-ug-slot": "label",
104
+ class: "inline-flex min-w-0 items-center justify-center gap-[var(--button-icon-gap)]"
105
+ }, P = {
106
+ key: 1,
107
+ "data-ug-slot": "loader",
108
+ class: "inline-flex shrink-0 items-center justify-center",
109
+ "aria-hidden": "true"
110
+ }, F = /* @__PURE__ */ c({
111
+ __name: "button",
112
+ props: {
113
+ variant: String,
114
+ tone: String,
115
+ size: String,
116
+ shape: String,
117
+ block: {
118
+ type: Boolean,
119
+ default: !1
120
+ },
121
+ loading: {
122
+ type: Boolean,
123
+ default: !1
124
+ },
125
+ loadingText: String,
126
+ loadingPlacement: {
127
+ type: String,
128
+ default: "start"
129
+ },
130
+ disabled: {
131
+ type: Boolean,
132
+ default: void 0
133
+ },
134
+ nativeType: {
135
+ type: String,
136
+ default: "button"
137
+ },
138
+ class: String,
139
+ style: [
140
+ String,
141
+ Object,
142
+ Array
143
+ ]
144
+ },
145
+ emits: ["click"],
146
+ setup(c, { expose: l, emit: m }) {
147
+ let b = c, x = m, S = {
148
+ solid: "",
149
+ soft: "",
150
+ primary: "bg-[var(--button-primary-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-primary-solid-hover)] active:bg-[var(--button-primary-solid-active)] focus-visible:ring-primary",
151
+ success: "bg-[var(--button-success-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-success-solid-hover)] active:bg-[var(--button-success-solid-active)] focus-visible:ring-success",
152
+ warning: "bg-[var(--button-warning-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-warning-solid-hover)] active:bg-[var(--button-warning-solid-active)] focus-visible:ring-warning",
153
+ danger: "bg-[var(--button-danger-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-danger-solid-hover)] active:bg-[var(--button-danger-solid-active)] focus-visible:ring-danger",
154
+ destructive: "bg-[var(--button-danger-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-danger-solid-hover)] active:bg-[var(--button-danger-solid-active)] focus-visible:ring-danger",
155
+ info: "bg-[var(--button-info-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-info-solid-hover)] active:bg-[var(--button-info-solid-active)] focus-visible:ring-info",
156
+ default: "border-border-base bg-surface-1 text-text-primary shadow-xs hover:border-primary active:bg-surface-2 focus-visible:ring-primary/40",
157
+ secondary: "border-border-base bg-surface-2 text-text-primary shadow-xs hover:bg-surface-3 active:bg-surface-3 focus-visible:ring-primary/40",
158
+ outline: "bg-transparent",
159
+ dashed: "border-dashed bg-transparent",
160
+ ghost: "",
161
+ text: "",
162
+ link: ""
163
+ }, w = {
164
+ default: "h-[var(--control-height-md)] px-[var(--control-padding-x-md)] py-0",
165
+ sm: "h-[var(--control-height-sm)] px-[var(--control-padding-x-sm)] py-0",
166
+ lg: "h-[var(--control-height-lg)] px-[var(--control-padding-x-lg)] py-0",
167
+ icon: "h-[var(--control-height-md)] w-[var(--control-height-md)] p-0"
168
+ }, T = {
169
+ default: "rounded-[var(--radius-control)]",
170
+ circle: "!rounded-full !p-0 aspect-square",
171
+ round: "!rounded-full"
172
+ }, E = {
173
+ neutral: {
174
+ solid: "border-border-strong bg-surface-3 text-text-primary shadow-xs hover:bg-surface-2 active:bg-surface-3 focus-visible:ring-primary/40",
175
+ soft: "bg-surface-2 text-text-primary shadow-xs hover:bg-surface-3 active:bg-surface-3 focus-visible:ring-primary/40",
176
+ outline: "border-border-strong bg-transparent text-text-primary shadow-xs hover:border-primary active:bg-surface-2 focus-visible:ring-primary/40",
177
+ dashed: "border-border-strong text-text-primary hover:border-primary active:bg-surface-2 focus-visible:ring-primary/40",
178
+ ghost: "text-text-primary hover:bg-surface-2 active:bg-surface-3 focus-visible:ring-primary/40",
179
+ text: "text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-primary/40",
180
+ link: "text-text-primary focus-visible:ring-primary/40"
181
+ },
182
+ primary: {
183
+ solid: "bg-[var(--button-primary-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-primary-solid-hover)] active:bg-[var(--button-primary-solid-active)] focus-visible:ring-primary",
184
+ soft: "bg-primary-soft text-text-primary hover:shadow-sm active:bg-primary-soft focus-visible:ring-primary/40",
185
+ outline: "border-primary bg-transparent text-text-primary hover:bg-primary-soft active:bg-primary-soft focus-visible:ring-primary/40",
186
+ dashed: "border-primary text-text-primary hover:bg-primary-soft active:bg-primary-soft focus-visible:ring-primary/40",
187
+ ghost: "text-text-primary hover:bg-primary-soft active:bg-primary-soft focus-visible:ring-primary/40",
188
+ text: "text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-primary/40",
189
+ link: "text-text-primary focus-visible:ring-primary/40"
190
+ },
191
+ success: {
192
+ solid: "bg-[var(--button-success-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-success-solid-hover)] active:bg-[var(--button-success-solid-active)] focus-visible:ring-success",
193
+ soft: "bg-success-soft text-text-primary hover:shadow-sm active:bg-success-soft focus-visible:ring-success/40",
194
+ outline: "border-success bg-transparent text-text-primary hover:bg-success-soft active:bg-success-soft focus-visible:ring-success/40",
195
+ dashed: "border-success text-text-primary hover:bg-success-soft active:bg-success-soft focus-visible:ring-success/40",
196
+ ghost: "text-text-primary hover:bg-success-soft active:bg-success-soft focus-visible:ring-success/40",
197
+ text: "text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-success/40",
198
+ link: "text-text-primary focus-visible:ring-success/40"
199
+ },
200
+ warning: {
201
+ solid: "bg-[var(--button-warning-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-warning-solid-hover)] active:bg-[var(--button-warning-solid-active)] focus-visible:ring-warning",
202
+ soft: "bg-warning-soft text-text-primary hover:shadow-sm active:bg-warning-soft focus-visible:ring-warning/40",
203
+ outline: "border-warning bg-transparent text-text-primary hover:bg-warning-soft active:bg-warning-soft focus-visible:ring-warning/40",
204
+ dashed: "border-warning text-text-primary hover:bg-warning-soft active:bg-warning-soft focus-visible:ring-warning/40",
205
+ ghost: "text-text-primary hover:bg-warning-soft active:bg-warning-soft focus-visible:ring-warning/40",
206
+ text: "text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-warning/40",
207
+ link: "text-text-primary focus-visible:ring-warning/40"
208
+ },
209
+ danger: {
210
+ solid: "bg-[var(--button-danger-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-danger-solid-hover)] active:bg-[var(--button-danger-solid-active)] focus-visible:ring-danger",
211
+ soft: "bg-danger-soft text-text-primary hover:shadow-sm active:bg-danger-soft focus-visible:ring-danger/40",
212
+ outline: "border-danger bg-transparent text-text-primary hover:bg-danger-soft active:bg-danger-soft focus-visible:ring-danger/40",
213
+ dashed: "border-danger text-text-primary hover:bg-danger-soft active:bg-danger-soft focus-visible:ring-danger/40",
214
+ ghost: "text-text-primary hover:bg-danger-soft active:bg-danger-soft focus-visible:ring-danger/40",
215
+ text: "text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-danger/40",
216
+ link: "text-text-primary focus-visible:ring-danger/40"
217
+ },
218
+ info: {
219
+ solid: "bg-[var(--button-info-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-info-solid-hover)] active:bg-[var(--button-info-solid-active)] focus-visible:ring-info",
220
+ soft: "bg-info-soft text-text-primary hover:shadow-sm active:bg-info-soft focus-visible:ring-info/40",
221
+ outline: "border-info bg-transparent text-text-primary hover:bg-info-soft active:bg-info-soft focus-visible:ring-info/40",
222
+ dashed: "border-info text-text-primary hover:bg-info-soft active:bg-info-soft focus-visible:ring-info/40",
223
+ ghost: "text-text-primary hover:bg-info-soft active:bg-info-soft focus-visible:ring-info/40",
224
+ text: "text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-info/40",
225
+ link: "text-text-primary focus-visible:ring-info/40"
226
+ }
227
+ }, D = {
228
+ text: "px-[var(--control-padding-x-sm)]",
229
+ link: "h-auto p-0 underline-offset-4 hover:underline"
230
+ }, O = {
231
+ small: "sm",
232
+ medium: "default",
233
+ large: "lg"
234
+ }, F = {
235
+ primary: "primary",
236
+ success: "success",
237
+ warning: "warning",
238
+ danger: "danger",
239
+ destructive: "danger",
240
+ info: "info"
241
+ }, I = u(A, void 0), L = k(), R = h(null), z = n(() => b.variant ?? I?.variant.value ?? L.value.button.variant ?? "default"), B = n(() => b.tone ?? I?.tone.value ?? L.value.button.tone ?? F[z.value] ?? (z.value === "solid" || z.value === "soft" ? "primary" : "neutral")), V = n(() => b.size ?? I?.size.value ?? O[L.value.size]), H = n(() => b.shape ?? I?.shape.value ?? L.value.button.shape ?? "default"), U = n(() => {
242
+ let e = z.value;
243
+ if ([
244
+ "solid",
245
+ "soft",
246
+ "outline",
247
+ "dashed",
248
+ "ghost",
249
+ "text",
250
+ "link"
251
+ ].includes(e)) return E[B.value][e];
252
+ }), W = n(() => e("inline-flex items-center justify-center gap-[var(--button-icon-gap)] whitespace-nowrap border-solid border-transparent font-[var(--button-font-weight)] transition-[background,border-color,color,box-shadow,opacity] duration-[var(--motion-duration-base)] ease-[var(--motion-easing-standard)] motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-[length:var(--button-focus-ring-width)] focus-visible:ring-offset-[length:var(--button-focus-ring-offset)] disabled:pointer-events-none disabled:cursor-not-allowed select-none", S[z.value], E[B.value] && U.value, w[V.value], T[H.value], b.block && "w-full flex", D[z.value], b.class)), G = n(() => [{ fontWeight: "var(--button-font-weight)" }, b.style]), K = n(() => C(b.disabled, I?.disabled.value ?? L.value.disabled) || b.loading), q = n(() => {
253
+ let e = [];
254
+ return b.loading && e.push("loading"), K.value && e.push("disabled"), e.length > 0 ? e.join(" ") : void 0;
255
+ });
256
+ function J(e) {
257
+ K.value || x("click", e);
258
+ }
259
+ return l({ ref: R }), (e, n) => (p(), i("button", {
260
+ ref_key: "buttonRef",
261
+ ref: R,
262
+ class: d(W.value),
263
+ style: f(G.value),
264
+ type: c.nativeType,
265
+ disabled: K.value,
266
+ "aria-busy": c.loading || void 0,
267
+ "data-ug": "button",
268
+ "data-state": q.value,
269
+ "data-variant": z.value,
270
+ "data-tone": B.value,
271
+ "data-size": V.value,
272
+ "data-shape": H.value,
273
+ "data-block": c.block ? "true" : void 0,
274
+ "data-ug-namespace": v(L).namespace,
275
+ onClick: J
276
+ }, [
277
+ c.loading && c.loadingPlacement === "start" ? (p(), i("span", M, [g(e.$slots, "loading", {}, () => [s(v(y), {
278
+ class: "animate-spin motion-reduce:animate-none",
279
+ size: V.value === "sm" ? 14 : 16
280
+ }, null, 8, ["size"])])])) : r("", !0),
281
+ a("span", N, [c.loading && c.loadingText !== void 0 ? (p(), i(t, { key: 0 }, [o(_(c.loadingText), 1)], 64)) : g(e.$slots, "default", {}, void 0, void 0, 1)]),
282
+ c.loading && c.loadingPlacement === "end" ? (p(), i("span", P, [g(e.$slots, "loading", {}, () => [s(v(y), {
283
+ class: "animate-spin motion-reduce:animate-none",
284
+ size: V.value === "sm" ? 14 : 16
285
+ }, null, 8, ["size"])])])) : r("", !0)
286
+ ], 14, j));
287
+ }
288
+ });
289
+ //#endregion
290
+ export { S as a, w as i, A as n, C as o, O as r, k as s, F as t };
291
+
292
+ //# sourceMappingURL=button-D_ikOxrp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button-D_ikOxrp.js","names":[],"sources":["../src/components/config-provider.vue","../src/components/context/button-group.ts","../src/components/button.vue","../src/components/button.vue"],"sourcesContent":["<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n h,\n inject,\n provide,\n type ComputedRef,\n type InjectionKey,\n type PropType,\n} from 'vue'\n\nexport type ComponentSize = 'small' | 'medium' | 'large'\nexport type ControlSize = 'sm' | 'default' | 'lg'\n\nconst CONFIG_SIZE_TO_CONTROL_SIZE: Record<ComponentSize, ControlSize> = {\n small: 'sm',\n medium: 'default',\n large: 'lg',\n}\n\nconst CONTROL_SIZE_TO_CONFIG_SIZE: Record<ControlSize, ComponentSize> = {\n sm: 'small',\n default: 'medium',\n lg: 'large',\n}\n\nexport function resolveControlSize(\n size: ControlSize | undefined,\n configSize: ComponentSize,\n): ControlSize {\n return size ?? CONFIG_SIZE_TO_CONTROL_SIZE[configSize]\n}\n\nexport function resolveDisabled(\n disabled: boolean | undefined,\n configDisabled: boolean,\n): boolean {\n return disabled ?? configDisabled\n}\n\nexport function controlSizeToComponentSize(size: ControlSize): ComponentSize {\n return CONTROL_SIZE_TO_CONFIG_SIZE[size]\n}\n\nexport interface UIConfig {\n namespace: string\n size: ComponentSize\n disabled: boolean\n button: ButtonDefaults\n link: LinkDefaults\n}\n\nexport interface ButtonDefaults {\n variant?:\n | 'solid'\n | 'soft'\n | 'primary'\n | 'success'\n | 'warning'\n | 'danger'\n | 'info'\n | 'default'\n | 'secondary'\n | 'outline'\n | 'dashed'\n | 'ghost'\n | 'text'\n | 'link'\n | 'destructive'\n tone?: 'neutral' | 'primary' | 'success' | 'warning' | 'danger' | 'info'\n shape?: 'default' | 'circle' | 'round'\n}\n\nexport interface LinkDefaults {\n underline?: 'always' | 'hover' | 'never'\n tone?: 'neutral' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'inherit'\n}\n\nconst defaultConfig: UIConfig = {\n namespace: 'ug',\n size: 'medium',\n disabled: false,\n button: {},\n link: {},\n}\nconst CONFIG_KEY: InjectionKey<ComputedRef<UIConfig>> = Symbol('ug-ui-config')\n\nfunction mergeDefined<T extends object>(parent: T, current?: Partial<T>): T {\n const merged = { ...parent }\n if (!current) return merged\n\n Object.entries(current).forEach(([key, value]) => {\n if (value !== undefined) Object.assign(merged, { [key]: value })\n })\n return merged\n}\n\nconst UConfigProvider = defineComponent({\n name: 'UConfigProvider',\n inheritAttrs: false,\n props: {\n namespace: { type: String, default: undefined },\n size: { type: String as PropType<ComponentSize>, default: undefined },\n disabled: { type: Boolean, default: undefined },\n button: { type: Object as PropType<Partial<ButtonDefaults>>, default: undefined },\n link: { type: Object as PropType<Partial<LinkDefaults>>, default: undefined },\n },\n setup(props, { attrs, slots }) {\n const parent = inject(CONFIG_KEY, computed(() => defaultConfig))\n const config = computed<UIConfig>(() => ({\n namespace: props.namespace ?? parent.value.namespace,\n size: props.size ?? parent.value.size,\n disabled: props.disabled ?? parent.value.disabled,\n button: mergeDefined(parent.value.button, props.button),\n link: mergeDefined(parent.value.link, props.link),\n }))\n provide(CONFIG_KEY, config)\n return () => h(\n 'div',\n {\n ...attrs,\n class: ['[display:contents]', attrs.class],\n 'data-size': config.value.size,\n 'data-state': config.value.disabled ? 'disabled' : 'default',\n 'data-ug': 'config-provider',\n 'data-ug-namespace': config.value.namespace,\n 'data-ug-slot': 'root',\n 'data-variant': 'default',\n },\n slots.default?.(),\n )\n },\n})\n\nexport function useUIConfig(): ComputedRef<UIConfig> {\n return inject(CONFIG_KEY, computed(() => defaultConfig))\n}\n\nexport default UConfigProvider\n</script>\n","/**\n * @description: Vue Button 与 ButtonGroup 共享类型和依赖注入合同\n * @author: UG - 一个斗码大陆苦逼的三段码之气的少年,并没有神秘戒指中码老的帮助,但总有一天,我会成为斗码大陆中码帝一样的存在。三十年河东,三十年河西,莫欺少年穷。\n * @date: 2026-07-25\n */\nimport type { InjectionKey, Ref, StyleValue } from 'vue'\n\nexport type ButtonVariant =\n | 'solid'\n | 'soft'\n | 'primary'\n | 'success'\n | 'warning'\n | 'danger'\n | 'info'\n | 'default'\n | 'secondary'\n | 'outline'\n | 'dashed'\n | 'ghost'\n | 'text'\n | 'link'\n | 'destructive'\n\nexport type ButtonTone = 'neutral' | 'primary' | 'success' | 'warning' | 'danger' | 'info'\nexport type ButtonSize = 'default' | 'sm' | 'lg' | 'icon'\nexport type ButtonShape = 'default' | 'circle' | 'round'\nexport type ButtonNativeType = 'button' | 'submit' | 'reset'\nexport type ButtonLoadingPlacement = 'start' | 'end'\n\nexport interface ButtonProps {\n variant?: ButtonVariant\n tone?: ButtonTone\n size?: ButtonSize\n shape?: ButtonShape\n block?: boolean\n loading?: boolean\n loadingText?: string\n loadingPlacement?: ButtonLoadingPlacement\n disabled?: boolean\n nativeType?: ButtonNativeType\n class?: string\n style?: StyleValue\n}\n\nexport interface ButtonGroupProps {\n variant?: ButtonVariant\n tone?: ButtonTone\n size?: ButtonSize\n shape?: ButtonShape\n disabled?: boolean\n orientation?: 'horizontal' | 'vertical'\n attached?: boolean\n class?: string\n}\n\nexport interface ButtonGroupContextValue {\n variant: Ref<ButtonVariant | undefined>\n tone: Ref<ButtonTone | undefined>\n size: Ref<ButtonSize | undefined>\n shape: Ref<ButtonShape | undefined>\n disabled: Ref<boolean>\n}\n\nexport const BUTTON_GROUP_KEY: InjectionKey<ButtonGroupContextValue> = Symbol('UGButtonGroup')\n","/**\n * @description: UButton 按钮组件,统一处理外观、语义色、尺寸、状态与组合\n * @author: UG - 一个斗码大陆苦逼的三段码之气的少年,并没有神秘戒指中码老的帮助,但总有一天,我会成为斗码大陆中码帝一样的存在。三十年河东,三十年河西,莫欺少年穷。\n * @date: 2026-07-22\n */\n<script lang=\"ts\">\nexport type {\n ButtonLoadingPlacement,\n ButtonNativeType,\n ButtonProps,\n ButtonShape,\n ButtonSize,\n ButtonTone,\n ButtonVariant,\n} from './context/button-group'\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, inject, ref, type PropType, type StyleValue } from 'vue'\nimport { Loader2 } from '@lucide/vue'\nimport { cn } from '../internal/cn'\nimport {\n resolveDisabled,\n useUIConfig,\n type ComponentSize,\n} from './config-provider.vue'\nimport {\n BUTTON_GROUP_KEY,\n type ButtonLoadingPlacement,\n type ButtonNativeType,\n type ButtonShape,\n type ButtonSize,\n type ButtonTone,\n type ButtonVariant,\n} from './context/button-group'\n\nconst props = defineProps({\n variant: String as PropType<ButtonVariant>,\n tone: String as PropType<ButtonTone>,\n size: String as PropType<ButtonSize>,\n shape: String as PropType<ButtonShape>,\n block: { type: Boolean, default: false },\n loading: { type: Boolean, default: false },\n loadingText: String,\n loadingPlacement: {\n type: String as PropType<ButtonLoadingPlacement>,\n default: 'start',\n },\n disabled: { type: Boolean, default: undefined },\n nativeType: {\n type: String as PropType<ButtonNativeType>,\n default: 'button',\n },\n class: String,\n style: [String, Object, Array] as PropType<StyleValue>,\n})\n\nconst emit = defineEmits<{\n click: [event: MouseEvent]\n}>()\n\nconst VARIANT_CLASSES: Record<ButtonVariant, string> = {\n solid: '',\n soft: '',\n primary: 'bg-[var(--button-primary-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-primary-solid-hover)] active:bg-[var(--button-primary-solid-active)] focus-visible:ring-primary',\n success: 'bg-[var(--button-success-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-success-solid-hover)] active:bg-[var(--button-success-solid-active)] focus-visible:ring-success',\n warning: 'bg-[var(--button-warning-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-warning-solid-hover)] active:bg-[var(--button-warning-solid-active)] focus-visible:ring-warning',\n danger: 'bg-[var(--button-danger-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-danger-solid-hover)] active:bg-[var(--button-danger-solid-active)] focus-visible:ring-danger',\n destructive: 'bg-[var(--button-danger-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-danger-solid-hover)] active:bg-[var(--button-danger-solid-active)] focus-visible:ring-danger',\n info: 'bg-[var(--button-info-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-info-solid-hover)] active:bg-[var(--button-info-solid-active)] focus-visible:ring-info',\n default: 'border-border-base bg-surface-1 text-text-primary shadow-xs hover:border-primary active:bg-surface-2 focus-visible:ring-primary/40',\n secondary: 'border-border-base bg-surface-2 text-text-primary shadow-xs hover:bg-surface-3 active:bg-surface-3 focus-visible:ring-primary/40',\n outline: 'bg-transparent',\n dashed: 'border-dashed bg-transparent',\n ghost: '',\n text: '',\n link: '',\n}\n\nconst SIZE_CLASSES: Record<ButtonSize, string> = {\n default: 'h-[var(--control-height-md)] px-[var(--control-padding-x-md)] py-0',\n sm: 'h-[var(--control-height-sm)] px-[var(--control-padding-x-sm)] py-0',\n lg: 'h-[var(--control-height-lg)] px-[var(--control-padding-x-lg)] py-0',\n icon: 'h-[var(--control-height-md)] w-[var(--control-height-md)] p-0',\n}\n\nconst SHAPE_CLASSES: Record<ButtonShape, string> = {\n default: 'rounded-[var(--radius-control)]',\n circle: '!rounded-full !p-0 aspect-square',\n round: '!rounded-full',\n}\n\nconst BASE_CLASS = 'inline-flex items-center justify-center gap-[var(--button-icon-gap)] whitespace-nowrap border-solid border-transparent font-[var(--button-font-weight)] transition-[background,border-color,color,box-shadow,opacity] duration-[var(--motion-duration-base)] ease-[var(--motion-easing-standard)] motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-[length:var(--button-focus-ring-width)] focus-visible:ring-offset-[length:var(--button-focus-ring-offset)] disabled:pointer-events-none disabled:cursor-not-allowed select-none'\n\ntype ToneVariant = 'solid' | 'soft' | 'outline' | 'dashed' | 'ghost' | 'text' | 'link'\n\nconst TONE_VARIANT_CLASSES: Record<ButtonTone, Record<ToneVariant, string>> = {\n neutral: {\n solid: 'border-border-strong bg-surface-3 text-text-primary shadow-xs hover:bg-surface-2 active:bg-surface-3 focus-visible:ring-primary/40',\n soft: 'bg-surface-2 text-text-primary shadow-xs hover:bg-surface-3 active:bg-surface-3 focus-visible:ring-primary/40',\n outline: 'border-border-strong bg-transparent text-text-primary shadow-xs hover:border-primary active:bg-surface-2 focus-visible:ring-primary/40',\n dashed: 'border-border-strong text-text-primary hover:border-primary active:bg-surface-2 focus-visible:ring-primary/40',\n ghost: 'text-text-primary hover:bg-surface-2 active:bg-surface-3 focus-visible:ring-primary/40',\n text: 'text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-primary/40',\n link: 'text-text-primary focus-visible:ring-primary/40',\n },\n primary: {\n solid: 'bg-[var(--button-primary-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-primary-solid-hover)] active:bg-[var(--button-primary-solid-active)] focus-visible:ring-primary',\n soft: 'bg-primary-soft text-text-primary hover:shadow-sm active:bg-primary-soft focus-visible:ring-primary/40',\n outline: 'border-primary bg-transparent text-text-primary hover:bg-primary-soft active:bg-primary-soft focus-visible:ring-primary/40',\n dashed: 'border-primary text-text-primary hover:bg-primary-soft active:bg-primary-soft focus-visible:ring-primary/40',\n ghost: 'text-text-primary hover:bg-primary-soft active:bg-primary-soft focus-visible:ring-primary/40',\n text: 'text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-primary/40',\n link: 'text-text-primary focus-visible:ring-primary/40',\n },\n success: {\n solid: 'bg-[var(--button-success-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-success-solid-hover)] active:bg-[var(--button-success-solid-active)] focus-visible:ring-success',\n soft: 'bg-success-soft text-text-primary hover:shadow-sm active:bg-success-soft focus-visible:ring-success/40',\n outline: 'border-success bg-transparent text-text-primary hover:bg-success-soft active:bg-success-soft focus-visible:ring-success/40',\n dashed: 'border-success text-text-primary hover:bg-success-soft active:bg-success-soft focus-visible:ring-success/40',\n ghost: 'text-text-primary hover:bg-success-soft active:bg-success-soft focus-visible:ring-success/40',\n text: 'text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-success/40',\n link: 'text-text-primary focus-visible:ring-success/40',\n },\n warning: {\n solid: 'bg-[var(--button-warning-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-warning-solid-hover)] active:bg-[var(--button-warning-solid-active)] focus-visible:ring-warning',\n soft: 'bg-warning-soft text-text-primary hover:shadow-sm active:bg-warning-soft focus-visible:ring-warning/40',\n outline: 'border-warning bg-transparent text-text-primary hover:bg-warning-soft active:bg-warning-soft focus-visible:ring-warning/40',\n dashed: 'border-warning text-text-primary hover:bg-warning-soft active:bg-warning-soft focus-visible:ring-warning/40',\n ghost: 'text-text-primary hover:bg-warning-soft active:bg-warning-soft focus-visible:ring-warning/40',\n text: 'text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-warning/40',\n link: 'text-text-primary focus-visible:ring-warning/40',\n },\n danger: {\n solid: 'bg-[var(--button-danger-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-danger-solid-hover)] active:bg-[var(--button-danger-solid-active)] focus-visible:ring-danger',\n soft: 'bg-danger-soft text-text-primary hover:shadow-sm active:bg-danger-soft focus-visible:ring-danger/40',\n outline: 'border-danger bg-transparent text-text-primary hover:bg-danger-soft active:bg-danger-soft focus-visible:ring-danger/40',\n dashed: 'border-danger text-text-primary hover:bg-danger-soft active:bg-danger-soft focus-visible:ring-danger/40',\n ghost: 'text-text-primary hover:bg-danger-soft active:bg-danger-soft focus-visible:ring-danger/40',\n text: 'text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-danger/40',\n link: 'text-text-primary focus-visible:ring-danger/40',\n },\n info: {\n solid: 'bg-[var(--button-info-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-info-solid-hover)] active:bg-[var(--button-info-solid-active)] focus-visible:ring-info',\n soft: 'bg-info-soft text-text-primary hover:shadow-sm active:bg-info-soft focus-visible:ring-info/40',\n outline: 'border-info bg-transparent text-text-primary hover:bg-info-soft active:bg-info-soft focus-visible:ring-info/40',\n dashed: 'border-info text-text-primary hover:bg-info-soft active:bg-info-soft focus-visible:ring-info/40',\n ghost: 'text-text-primary hover:bg-info-soft active:bg-info-soft focus-visible:ring-info/40',\n text: 'text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-info/40',\n link: 'text-text-primary focus-visible:ring-info/40',\n },\n}\n\nconst VARIANT_LAYOUT_CLASSES: Partial<Record<ButtonVariant, string>> = {\n text: 'px-[var(--control-padding-x-sm)]',\n link: 'h-auto p-0 underline-offset-4 hover:underline',\n}\n\nconst CONFIG_SIZE_TO_BUTTON_SIZE: Record<ComponentSize, ButtonSize> = {\n small: 'sm',\n medium: 'default',\n large: 'lg',\n}\n\nconst LEGACY_VARIANT_TONES: Partial<Record<ButtonVariant, ButtonTone>> = {\n primary: 'primary',\n success: 'success',\n warning: 'warning',\n danger: 'danger',\n destructive: 'danger',\n info: 'info',\n}\n\nconst group = inject(BUTTON_GROUP_KEY, undefined)\nconst config = useUIConfig()\nconst buttonRef = ref<HTMLButtonElement | null>(null)\nconst resolvedVariant = computed<ButtonVariant>(() =>\n props.variant ?? group?.variant.value ?? config.value.button.variant ?? 'default',\n)\nconst resolvedTone = computed<ButtonTone>(() =>\n props.tone\n ?? group?.tone.value\n ?? config.value.button.tone\n ?? LEGACY_VARIANT_TONES[resolvedVariant.value]\n ?? (resolvedVariant.value === 'solid' || resolvedVariant.value === 'soft' ? 'primary' : 'neutral'),\n)\nconst resolvedSize = computed<ButtonSize>(() =>\n props.size ?? group?.size.value ?? CONFIG_SIZE_TO_BUTTON_SIZE[config.value.size],\n)\nconst resolvedShape = computed<ButtonShape>(() =>\n props.shape ?? group?.shape.value ?? config.value.button.shape ?? 'default',\n)\nconst toneClasses = computed(() => {\n const variant = resolvedVariant.value\n if (!['solid', 'soft', 'outline', 'dashed', 'ghost', 'text', 'link'].includes(variant)) return undefined\n return TONE_VARIANT_CLASSES[resolvedTone.value][variant as ToneVariant]\n})\n\nconst classes = computed(() =>\n cn(\n BASE_CLASS,\n VARIANT_CLASSES[resolvedVariant.value],\n TONE_VARIANT_CLASSES[resolvedTone.value] && toneClasses.value,\n SIZE_CLASSES[resolvedSize.value],\n SHAPE_CLASSES[resolvedShape.value],\n props.block && 'w-full flex',\n VARIANT_LAYOUT_CLASSES[resolvedVariant.value],\n props.class,\n ),\n)\nconst buttonStyle = computed<StyleValue>(() => [\n { fontWeight: 'var(--button-font-weight)' },\n props.style,\n])\n\nconst isDisabled = computed(\n () =>\n resolveDisabled(\n props.disabled,\n group?.disabled.value ?? config.value.disabled,\n ) || props.loading,\n)\nconst state = computed(() => {\n const states: string[] = []\n if (props.loading) states.push('loading')\n if (isDisabled.value) states.push('disabled')\n return states.length > 0 ? states.join(' ') : undefined\n})\n\nfunction handleClick(event: MouseEvent) {\n if (!isDisabled.value) {\n emit('click', event)\n }\n}\n\ndefineExpose({\n ref: buttonRef,\n})\n</script>\n\n<template>\n <button\n ref=\"buttonRef\"\n :class=\"classes\"\n :style=\"buttonStyle\"\n :type=\"nativeType\"\n :disabled=\"isDisabled\"\n :aria-busy=\"loading || undefined\"\n data-ug=\"button\"\n :data-state=\"state\"\n :data-variant=\"resolvedVariant\"\n :data-tone=\"resolvedTone\"\n :data-size=\"resolvedSize\"\n :data-shape=\"resolvedShape\"\n :data-block=\"block ? 'true' : undefined\"\n :data-ug-namespace=\"config.namespace\"\n @click=\"handleClick\"\n >\n <span\n v-if=\"loading && loadingPlacement === 'start'\"\n data-ug-slot=\"loader\"\n class=\"inline-flex shrink-0 items-center justify-center\"\n aria-hidden=\"true\"\n >\n <slot name=\"loading\">\n <Loader2 class=\"animate-spin motion-reduce:animate-none\" :size=\"resolvedSize === 'sm' ? 14 : 16\" />\n </slot>\n </span>\n <span data-ug-slot=\"label\" class=\"inline-flex min-w-0 items-center justify-center gap-[var(--button-icon-gap)]\">\n <template v-if=\"loading && loadingText !== undefined\">{{ loadingText }}</template>\n <slot v-else />\n </span>\n <span\n v-if=\"loading && loadingPlacement === 'end'\"\n data-ug-slot=\"loader\"\n class=\"inline-flex shrink-0 items-center justify-center\"\n aria-hidden=\"true\"\n >\n <slot name=\"loading\">\n <Loader2 class=\"animate-spin motion-reduce:animate-none\" :size=\"resolvedSize === 'sm' ? 14 : 16\" />\n </slot>\n </span>\n </button>\n</template>\n","/**\n * @description: UButton 按钮组件,统一处理外观、语义色、尺寸、状态与组合\n * @author: UG - 一个斗码大陆苦逼的三段码之气的少年,并没有神秘戒指中码老的帮助,但总有一天,我会成为斗码大陆中码帝一样的存在。三十年河东,三十年河西,莫欺少年穷。\n * @date: 2026-07-22\n */\n<script lang=\"ts\">\nexport type {\n ButtonLoadingPlacement,\n ButtonNativeType,\n ButtonProps,\n ButtonShape,\n ButtonSize,\n ButtonTone,\n ButtonVariant,\n} from './context/button-group'\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, inject, ref, type PropType, type StyleValue } from 'vue'\nimport { Loader2 } from '@lucide/vue'\nimport { cn } from '../internal/cn'\nimport {\n resolveDisabled,\n useUIConfig,\n type ComponentSize,\n} from './config-provider.vue'\nimport {\n BUTTON_GROUP_KEY,\n type ButtonLoadingPlacement,\n type ButtonNativeType,\n type ButtonShape,\n type ButtonSize,\n type ButtonTone,\n type ButtonVariant,\n} from './context/button-group'\n\nconst props = defineProps({\n variant: String as PropType<ButtonVariant>,\n tone: String as PropType<ButtonTone>,\n size: String as PropType<ButtonSize>,\n shape: String as PropType<ButtonShape>,\n block: { type: Boolean, default: false },\n loading: { type: Boolean, default: false },\n loadingText: String,\n loadingPlacement: {\n type: String as PropType<ButtonLoadingPlacement>,\n default: 'start',\n },\n disabled: { type: Boolean, default: undefined },\n nativeType: {\n type: String as PropType<ButtonNativeType>,\n default: 'button',\n },\n class: String,\n style: [String, Object, Array] as PropType<StyleValue>,\n})\n\nconst emit = defineEmits<{\n click: [event: MouseEvent]\n}>()\n\nconst VARIANT_CLASSES: Record<ButtonVariant, string> = {\n solid: '',\n soft: '',\n primary: 'bg-[var(--button-primary-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-primary-solid-hover)] active:bg-[var(--button-primary-solid-active)] focus-visible:ring-primary',\n success: 'bg-[var(--button-success-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-success-solid-hover)] active:bg-[var(--button-success-solid-active)] focus-visible:ring-success',\n warning: 'bg-[var(--button-warning-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-warning-solid-hover)] active:bg-[var(--button-warning-solid-active)] focus-visible:ring-warning',\n danger: 'bg-[var(--button-danger-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-danger-solid-hover)] active:bg-[var(--button-danger-solid-active)] focus-visible:ring-danger',\n destructive: 'bg-[var(--button-danger-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-danger-solid-hover)] active:bg-[var(--button-danger-solid-active)] focus-visible:ring-danger',\n info: 'bg-[var(--button-info-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-info-solid-hover)] active:bg-[var(--button-info-solid-active)] focus-visible:ring-info',\n default: 'border-border-base bg-surface-1 text-text-primary shadow-xs hover:border-primary active:bg-surface-2 focus-visible:ring-primary/40',\n secondary: 'border-border-base bg-surface-2 text-text-primary shadow-xs hover:bg-surface-3 active:bg-surface-3 focus-visible:ring-primary/40',\n outline: 'bg-transparent',\n dashed: 'border-dashed bg-transparent',\n ghost: '',\n text: '',\n link: '',\n}\n\nconst SIZE_CLASSES: Record<ButtonSize, string> = {\n default: 'h-[var(--control-height-md)] px-[var(--control-padding-x-md)] py-0',\n sm: 'h-[var(--control-height-sm)] px-[var(--control-padding-x-sm)] py-0',\n lg: 'h-[var(--control-height-lg)] px-[var(--control-padding-x-lg)] py-0',\n icon: 'h-[var(--control-height-md)] w-[var(--control-height-md)] p-0',\n}\n\nconst SHAPE_CLASSES: Record<ButtonShape, string> = {\n default: 'rounded-[var(--radius-control)]',\n circle: '!rounded-full !p-0 aspect-square',\n round: '!rounded-full',\n}\n\nconst BASE_CLASS = 'inline-flex items-center justify-center gap-[var(--button-icon-gap)] whitespace-nowrap border-solid border-transparent font-[var(--button-font-weight)] transition-[background,border-color,color,box-shadow,opacity] duration-[var(--motion-duration-base)] ease-[var(--motion-easing-standard)] motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-[length:var(--button-focus-ring-width)] focus-visible:ring-offset-[length:var(--button-focus-ring-offset)] disabled:pointer-events-none disabled:cursor-not-allowed select-none'\n\ntype ToneVariant = 'solid' | 'soft' | 'outline' | 'dashed' | 'ghost' | 'text' | 'link'\n\nconst TONE_VARIANT_CLASSES: Record<ButtonTone, Record<ToneVariant, string>> = {\n neutral: {\n solid: 'border-border-strong bg-surface-3 text-text-primary shadow-xs hover:bg-surface-2 active:bg-surface-3 focus-visible:ring-primary/40',\n soft: 'bg-surface-2 text-text-primary shadow-xs hover:bg-surface-3 active:bg-surface-3 focus-visible:ring-primary/40',\n outline: 'border-border-strong bg-transparent text-text-primary shadow-xs hover:border-primary active:bg-surface-2 focus-visible:ring-primary/40',\n dashed: 'border-border-strong text-text-primary hover:border-primary active:bg-surface-2 focus-visible:ring-primary/40',\n ghost: 'text-text-primary hover:bg-surface-2 active:bg-surface-3 focus-visible:ring-primary/40',\n text: 'text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-primary/40',\n link: 'text-text-primary focus-visible:ring-primary/40',\n },\n primary: {\n solid: 'bg-[var(--button-primary-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-primary-solid-hover)] active:bg-[var(--button-primary-solid-active)] focus-visible:ring-primary',\n soft: 'bg-primary-soft text-text-primary hover:shadow-sm active:bg-primary-soft focus-visible:ring-primary/40',\n outline: 'border-primary bg-transparent text-text-primary hover:bg-primary-soft active:bg-primary-soft focus-visible:ring-primary/40',\n dashed: 'border-primary text-text-primary hover:bg-primary-soft active:bg-primary-soft focus-visible:ring-primary/40',\n ghost: 'text-text-primary hover:bg-primary-soft active:bg-primary-soft focus-visible:ring-primary/40',\n text: 'text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-primary/40',\n link: 'text-text-primary focus-visible:ring-primary/40',\n },\n success: {\n solid: 'bg-[var(--button-success-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-success-solid-hover)] active:bg-[var(--button-success-solid-active)] focus-visible:ring-success',\n soft: 'bg-success-soft text-text-primary hover:shadow-sm active:bg-success-soft focus-visible:ring-success/40',\n outline: 'border-success bg-transparent text-text-primary hover:bg-success-soft active:bg-success-soft focus-visible:ring-success/40',\n dashed: 'border-success text-text-primary hover:bg-success-soft active:bg-success-soft focus-visible:ring-success/40',\n ghost: 'text-text-primary hover:bg-success-soft active:bg-success-soft focus-visible:ring-success/40',\n text: 'text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-success/40',\n link: 'text-text-primary focus-visible:ring-success/40',\n },\n warning: {\n solid: 'bg-[var(--button-warning-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-warning-solid-hover)] active:bg-[var(--button-warning-solid-active)] focus-visible:ring-warning',\n soft: 'bg-warning-soft text-text-primary hover:shadow-sm active:bg-warning-soft focus-visible:ring-warning/40',\n outline: 'border-warning bg-transparent text-text-primary hover:bg-warning-soft active:bg-warning-soft focus-visible:ring-warning/40',\n dashed: 'border-warning text-text-primary hover:bg-warning-soft active:bg-warning-soft focus-visible:ring-warning/40',\n ghost: 'text-text-primary hover:bg-warning-soft active:bg-warning-soft focus-visible:ring-warning/40',\n text: 'text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-warning/40',\n link: 'text-text-primary focus-visible:ring-warning/40',\n },\n danger: {\n solid: 'bg-[var(--button-danger-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-danger-solid-hover)] active:bg-[var(--button-danger-solid-active)] focus-visible:ring-danger',\n soft: 'bg-danger-soft text-text-primary hover:shadow-sm active:bg-danger-soft focus-visible:ring-danger/40',\n outline: 'border-danger bg-transparent text-text-primary hover:bg-danger-soft active:bg-danger-soft focus-visible:ring-danger/40',\n dashed: 'border-danger text-text-primary hover:bg-danger-soft active:bg-danger-soft focus-visible:ring-danger/40',\n ghost: 'text-text-primary hover:bg-danger-soft active:bg-danger-soft focus-visible:ring-danger/40',\n text: 'text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-danger/40',\n link: 'text-text-primary focus-visible:ring-danger/40',\n },\n info: {\n solid: 'bg-[var(--button-info-solid)] text-[hsl(var(--button-solid-fg))] shadow-xs hover:bg-[var(--button-info-solid-hover)] active:bg-[var(--button-info-solid-active)] focus-visible:ring-info',\n soft: 'bg-info-soft text-text-primary hover:shadow-sm active:bg-info-soft focus-visible:ring-info/40',\n outline: 'border-info bg-transparent text-text-primary hover:bg-info-soft active:bg-info-soft focus-visible:ring-info/40',\n dashed: 'border-info text-text-primary hover:bg-info-soft active:bg-info-soft focus-visible:ring-info/40',\n ghost: 'text-text-primary hover:bg-info-soft active:bg-info-soft focus-visible:ring-info/40',\n text: 'text-text-primary hover:opacity-80 active:opacity-70 focus-visible:ring-info/40',\n link: 'text-text-primary focus-visible:ring-info/40',\n },\n}\n\nconst VARIANT_LAYOUT_CLASSES: Partial<Record<ButtonVariant, string>> = {\n text: 'px-[var(--control-padding-x-sm)]',\n link: 'h-auto p-0 underline-offset-4 hover:underline',\n}\n\nconst CONFIG_SIZE_TO_BUTTON_SIZE: Record<ComponentSize, ButtonSize> = {\n small: 'sm',\n medium: 'default',\n large: 'lg',\n}\n\nconst LEGACY_VARIANT_TONES: Partial<Record<ButtonVariant, ButtonTone>> = {\n primary: 'primary',\n success: 'success',\n warning: 'warning',\n danger: 'danger',\n destructive: 'danger',\n info: 'info',\n}\n\nconst group = inject(BUTTON_GROUP_KEY, undefined)\nconst config = useUIConfig()\nconst buttonRef = ref<HTMLButtonElement | null>(null)\nconst resolvedVariant = computed<ButtonVariant>(() =>\n props.variant ?? group?.variant.value ?? config.value.button.variant ?? 'default',\n)\nconst resolvedTone = computed<ButtonTone>(() =>\n props.tone\n ?? group?.tone.value\n ?? config.value.button.tone\n ?? LEGACY_VARIANT_TONES[resolvedVariant.value]\n ?? (resolvedVariant.value === 'solid' || resolvedVariant.value === 'soft' ? 'primary' : 'neutral'),\n)\nconst resolvedSize = computed<ButtonSize>(() =>\n props.size ?? group?.size.value ?? CONFIG_SIZE_TO_BUTTON_SIZE[config.value.size],\n)\nconst resolvedShape = computed<ButtonShape>(() =>\n props.shape ?? group?.shape.value ?? config.value.button.shape ?? 'default',\n)\nconst toneClasses = computed(() => {\n const variant = resolvedVariant.value\n if (!['solid', 'soft', 'outline', 'dashed', 'ghost', 'text', 'link'].includes(variant)) return undefined\n return TONE_VARIANT_CLASSES[resolvedTone.value][variant as ToneVariant]\n})\n\nconst classes = computed(() =>\n cn(\n BASE_CLASS,\n VARIANT_CLASSES[resolvedVariant.value],\n TONE_VARIANT_CLASSES[resolvedTone.value] && toneClasses.value,\n SIZE_CLASSES[resolvedSize.value],\n SHAPE_CLASSES[resolvedShape.value],\n props.block && 'w-full flex',\n VARIANT_LAYOUT_CLASSES[resolvedVariant.value],\n props.class,\n ),\n)\nconst buttonStyle = computed<StyleValue>(() => [\n { fontWeight: 'var(--button-font-weight)' },\n props.style,\n])\n\nconst isDisabled = computed(\n () =>\n resolveDisabled(\n props.disabled,\n group?.disabled.value ?? config.value.disabled,\n ) || props.loading,\n)\nconst state = computed(() => {\n const states: string[] = []\n if (props.loading) states.push('loading')\n if (isDisabled.value) states.push('disabled')\n return states.length > 0 ? states.join(' ') : undefined\n})\n\nfunction handleClick(event: MouseEvent) {\n if (!isDisabled.value) {\n emit('click', event)\n }\n}\n\ndefineExpose({\n ref: buttonRef,\n})\n</script>\n\n<template>\n <button\n ref=\"buttonRef\"\n :class=\"classes\"\n :style=\"buttonStyle\"\n :type=\"nativeType\"\n :disabled=\"isDisabled\"\n :aria-busy=\"loading || undefined\"\n data-ug=\"button\"\n :data-state=\"state\"\n :data-variant=\"resolvedVariant\"\n :data-tone=\"resolvedTone\"\n :data-size=\"resolvedSize\"\n :data-shape=\"resolvedShape\"\n :data-block=\"block ? 'true' : undefined\"\n :data-ug-namespace=\"config.namespace\"\n @click=\"handleClick\"\n >\n <span\n v-if=\"loading && loadingPlacement === 'start'\"\n data-ug-slot=\"loader\"\n class=\"inline-flex shrink-0 items-center justify-center\"\n aria-hidden=\"true\"\n >\n <slot name=\"loading\">\n <Loader2 class=\"animate-spin motion-reduce:animate-none\" :size=\"resolvedSize === 'sm' ? 14 : 16\" />\n </slot>\n </span>\n <span data-ug-slot=\"label\" class=\"inline-flex min-w-0 items-center justify-center gap-[var(--button-icon-gap)]\">\n <template v-if=\"loading && loadingText !== undefined\">{{ loadingText }}</template>\n <slot v-else />\n </span>\n <span\n v-if=\"loading && loadingPlacement === 'end'\"\n data-ug-slot=\"loader\"\n class=\"inline-flex shrink-0 items-center justify-center\"\n aria-hidden=\"true\"\n >\n <slot name=\"loading\">\n <Loader2 class=\"animate-spin motion-reduce:animate-none\" :size=\"resolvedSize === 'sm' ? 14 : 16\" />\n </slot>\n </span>\n </button>\n</template>\n"],"mappings":";;;;AAeA,IAAM,IAAkE;CACtE,OAAO;CACP,QAAQ;CACR,OAAO;AACT,GAEM,IAAkE;CACtE,IAAI;CACJ,SAAS;CACT,IAAI;AACN;AAEA,SAAgB,EACd,GACA,GACa;CACb,OAAO,KAAQ,EAA4B;AAC7C;AAEA,SAAgB,EACd,GACA,GACS;CACT,OAAO,KAAY;AACrB;AAEA,SAAgB,EAA2B,GAAkC;CAC3E,OAAO,EAA4B;AACrC;AAoCA,IAAM,IAA0B;CAC9B,WAAW;CACX,MAAM;CACN,UAAU;CACV,QAAQ,CAAC;CACT,MAAM,CAAC;AACT,GACM,IAAkD,OAAO,cAAc;AAE7E,SAAS,EAA+B,GAAW,GAAyB;CAC1E,IAAM,IAAS,EAAE,GAAG,EAAO;CAM3B,OALK,KAEL,OAAO,QAAQ,CAAO,CAAC,CAAC,SAAS,CAAC,GAAK,OAAW;EAChD,AAAI,MAAU,KAAA,KAAW,OAAO,OAAO,GAAQ,GAAG,IAAM,EAAM,CAAC;CAC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,EAAA;GACX,cAAY,EAAA;GACZ,cAAY,EAAA,QAAK,SAAY,KAAA;GAC7B,qBAAmB,EAAA,CAAA,CAAM,CAAC;GAC1B,SAAO;;GAGA,EAAA,WAAW,EAAA,qBAAgB,WAAA,EAAA,GADnC,EASO,QATP,GASO,CAHL,EAEO,EAAA,QAAA,WAAA,CAAA,SAAA,CADL,EAAmG,EAAA,CAAA,GAAA;IAA1F,OAAM;IAA2C,MAAM,EAAA,UAAY,OAAA,KAAA;;GAGhF,EAGO,QAHP,GAGO,CAFW,EAAA,WAAW,EAAA,gBAAgB,KAAA,KAAA,EAAA,GAA3C,EAAkF,GAAA,EAAA,KAAA,EAAA,GAAA,CAAA,EAAA,EAAzB,EAAA,WAAW,GAAA,CAAA,CAAA,GAAA,EAAA,KACpE,EAAe,EAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,KAAA,GAAA,CAAA,CAAA,CAAA;GAGT,EAAA,WAAW,EAAA,qBAAgB,SAAA,EAAA,GADnC,EASO,QATP,GASO,CAHL,EAEO,EAAA,QAAA,WAAA,CAAA,SAAA,CADL,EAAmG,EAAA,CAAA,GAAA;IAA1F,OAAM;IAA2C,MAAM,EAAA,UAAY,OAAA,KAAA"}
@@ -0,0 +1,2 @@
1
+ let e=require("clsx"),t=require("tailwind-merge");function n(...n){return(0,t.twMerge)((0,e.clsx)(n))}Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
2
+ //# sourceMappingURL=cn-CFAiuoYh.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cn-CFAiuoYh.cjs","names":[],"sources":["../src/internal/cn.ts"],"sourcesContent":["/**\n * @description: Vue 包内部类名合并工具\n * @author: UG - 一个斗码大陆苦逼的三段码之气的少年,并没有神秘戒指中码老的帮助,但总有一天,我会成为斗码大陆中码帝一样的存在。三十年河东,三十年河西,莫欺少年穷。\n * @date: 2026-05-27\n */\nimport { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs))\n}\n"],"mappings":"kDAQA,SAAgB,EAAG,GAAG,EAA8B,CAClD,OAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,KAAA,CAAoB,CAAM,CAAC,CAC7B"}
@@ -0,0 +1,10 @@
1
+ import { clsx as e } from "clsx";
2
+ import { twMerge as t } from "tailwind-merge";
3
+ //#region src/internal/cn.ts
4
+ function n(...n) {
5
+ return t(e(n));
6
+ }
7
+ //#endregion
8
+ export { n as t };
9
+
10
+ //# sourceMappingURL=cn-Cl2u7rTh.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cn-Cl2u7rTh.js","names":[],"sources":["../src/internal/cn.ts"],"sourcesContent":["/**\n * @description: Vue 包内部类名合并工具\n * @author: UG - 一个斗码大陆苦逼的三段码之气的少年,并没有神秘戒指中码老的帮助,但总有一天,我会成为斗码大陆中码帝一样的存在。三十年河东,三十年河西,莫欺少年穷。\n * @date: 2026-05-27\n */\nimport { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";;;AAQA,SAAgB,EAAG,GAAG,GAA8B;CAClD,OAAO,EAAQ,EAAK,CAAM,CAAC;AAC7B"}