x-next 1.17.0 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/AI_USAGE/catalog.md +1 -1
  2. package/AI_USAGE/components/alert-api.md +1 -1
  3. package/AI_USAGE/components/alert.md +33 -1
  4. package/AI_USAGE/components/bar-chart-api.md +1 -1
  5. package/AI_USAGE/components/bar-chart.md +1 -1
  6. package/AI_USAGE/components/boxicons.md +1 -1
  7. package/AI_USAGE/components/button-api.md +13 -16
  8. package/AI_USAGE/components/button.md +242 -31
  9. package/AI_USAGE/components/charts.md +1 -1
  10. package/AI_USAGE/components/checkbox-api.md +1 -1
  11. package/AI_USAGE/components/checkbox.md +1 -1
  12. package/AI_USAGE/components/color-picker-api.md +1 -1
  13. package/AI_USAGE/components/color-picker.md +1 -1
  14. package/AI_USAGE/components/config-provider-api.md +1 -1
  15. package/AI_USAGE/components/config-provider.md +1 -1
  16. package/AI_USAGE/components/date-picker-api.md +1 -1
  17. package/AI_USAGE/components/date-picker.md +1 -1
  18. package/AI_USAGE/components/dialog-api.md +1 -1
  19. package/AI_USAGE/components/dialog.md +1 -1
  20. package/AI_USAGE/components/draggable-api.md +1 -1
  21. package/AI_USAGE/components/draggable.md +1 -1
  22. package/AI_USAGE/components/drawer-api.md +3 -3
  23. package/AI_USAGE/components/drawer.md +1 -1
  24. package/AI_USAGE/components/dropdown-api.md +3 -3
  25. package/AI_USAGE/components/dropdown.md +1 -1
  26. package/AI_USAGE/components/empty-api.md +1 -1
  27. package/AI_USAGE/components/empty.md +1 -1
  28. package/AI_USAGE/components/finicon.md +1 -1
  29. package/AI_USAGE/components/form-api.md +1 -1
  30. package/AI_USAGE/components/form.md +1 -1
  31. package/AI_USAGE/components/grid-api.md +1 -1
  32. package/AI_USAGE/components/grid.md +1 -1
  33. package/AI_USAGE/components/heatmap-api.md +1 -1
  34. package/AI_USAGE/components/heatmap.md +1 -1
  35. package/AI_USAGE/components/icon-api.md +1 -1
  36. package/AI_USAGE/components/icon.md +1 -1
  37. package/AI_USAGE/components/image-api.md +1 -1
  38. package/AI_USAGE/components/image.md +1 -1
  39. package/AI_USAGE/components/input-api.md +2 -2
  40. package/AI_USAGE/components/input-number-api.md +1 -1
  41. package/AI_USAGE/components/input-number.md +1 -1
  42. package/AI_USAGE/components/input-tag-api.md +1 -1
  43. package/AI_USAGE/components/input-tag.md +1 -1
  44. package/AI_USAGE/components/input.md +1 -1
  45. package/AI_USAGE/components/layout-api.md +1 -1
  46. package/AI_USAGE/components/layout.md +1 -1
  47. package/AI_USAGE/components/line-chart-api.md +1 -1
  48. package/AI_USAGE/components/line-chart.md +1 -1
  49. package/AI_USAGE/components/link-api.md +1 -1
  50. package/AI_USAGE/components/link.md +1 -1
  51. package/AI_USAGE/components/menu-api.md +1 -1
  52. package/AI_USAGE/components/menu.md +1 -1
  53. package/AI_USAGE/components/message-api.md +1 -1
  54. package/AI_USAGE/components/message-box-api.md +1 -1
  55. package/AI_USAGE/components/message-box.md +1 -1
  56. package/AI_USAGE/components/message.md +1 -1
  57. package/AI_USAGE/components/network-api.md +1 -1
  58. package/AI_USAGE/components/network.md +1 -1
  59. package/AI_USAGE/components/notification-api.md +1 -1
  60. package/AI_USAGE/components/notification.md +1 -1
  61. package/AI_USAGE/components/pagination-api.md +1 -1
  62. package/AI_USAGE/components/pagination.md +1 -1
  63. package/AI_USAGE/components/pie-chart-api.md +1 -1
  64. package/AI_USAGE/components/pie-chart.md +1 -1
  65. package/AI_USAGE/components/popconfirm-api.md +3 -3
  66. package/AI_USAGE/components/popconfirm.md +1 -1
  67. package/AI_USAGE/components/popover-api.md +1 -1
  68. package/AI_USAGE/components/popover.md +1 -1
  69. package/AI_USAGE/components/popup-api.md +1 -1
  70. package/AI_USAGE/components/popup.md +1 -1
  71. package/AI_USAGE/components/progress-api.md +1 -1
  72. package/AI_USAGE/components/progress.md +1 -1
  73. package/AI_USAGE/components/radio-api.md +1 -1
  74. package/AI_USAGE/components/radio.md +1 -1
  75. package/AI_USAGE/components/rate-api.md +1 -1
  76. package/AI_USAGE/components/rate.md +1 -1
  77. package/AI_USAGE/components/resize-box-api.md +1 -1
  78. package/AI_USAGE/components/resize-box.md +1 -1
  79. package/AI_USAGE/components/scrollbar-api.md +1 -1
  80. package/AI_USAGE/components/scrollbar.md +1 -1
  81. package/AI_USAGE/components/select-api.md +1 -1
  82. package/AI_USAGE/components/select.md +1 -1
  83. package/AI_USAGE/components/skeleton-api.md +1 -1
  84. package/AI_USAGE/components/skeleton.md +1 -1
  85. package/AI_USAGE/components/slider-api.md +1 -1
  86. package/AI_USAGE/components/slider.md +1 -1
  87. package/AI_USAGE/components/space-api.md +1 -1
  88. package/AI_USAGE/components/space.md +1 -1
  89. package/AI_USAGE/components/spin-api.md +1 -1
  90. package/AI_USAGE/components/spin.md +1 -1
  91. package/AI_USAGE/components/steps-api.md +1 -1
  92. package/AI_USAGE/components/steps.md +1 -1
  93. package/AI_USAGE/components/switch-api.md +1 -1
  94. package/AI_USAGE/components/switch.md +1 -1
  95. package/AI_USAGE/components/table-api.md +1 -1
  96. package/AI_USAGE/components/table.md +1 -1
  97. package/AI_USAGE/components/tabs-api.md +1 -1
  98. package/AI_USAGE/components/tabs.md +1 -1
  99. package/AI_USAGE/components/tag-api.md +1 -1
  100. package/AI_USAGE/components/tag.md +1 -1
  101. package/AI_USAGE/components/textarea-api.md +1 -1
  102. package/AI_USAGE/components/textarea.md +1 -1
  103. package/AI_USAGE/components/time-picker-api.md +1 -1
  104. package/AI_USAGE/components/time-picker.md +1 -1
  105. package/AI_USAGE/components/time-range-selector-api.md +1 -1
  106. package/AI_USAGE/components/time-range-selector.md +1 -1
  107. package/AI_USAGE/components/timeline-api.md +3 -3
  108. package/AI_USAGE/components/timeline.md +1 -1
  109. package/AI_USAGE/components/tooltip-api.md +1 -1
  110. package/AI_USAGE/components/tooltip.md +1 -1
  111. package/AI_USAGE/components/transfer-api.md +1 -1
  112. package/AI_USAGE/components/transfer.md +1 -1
  113. package/AI_USAGE/components/tree-select-api.md +1 -1
  114. package/AI_USAGE/components/tree-select.md +1 -1
  115. package/AI_USAGE/components/trend-chart-api.md +1 -1
  116. package/AI_USAGE/components/trend-chart.md +1 -1
  117. package/AI_USAGE/components/trigger-api.md +1 -1
  118. package/AI_USAGE/components/trigger.md +1 -1
  119. package/AI_USAGE/components/upload-api.md +1 -1
  120. package/AI_USAGE/components/upload.md +1 -1
  121. package/AI_USAGE/components/watermark-api.md +1 -1
  122. package/AI_USAGE/components/watermark.md +1 -1
  123. package/AI_USAGE/core.md +1 -1
  124. package/AI_USAGE/index.md +1 -1
  125. package/AI_USAGE/recipes/form-on-demand.md +1 -1
  126. package/AI_USAGE.md +296 -56
  127. package/CHANGELOG.md +20 -0
  128. package/dist/_styles/palette-aliases.d.ts +1 -0
  129. package/dist/components/button/Button.d.ts +0 -9
  130. package/dist/components/button/appearance.d.ts +7 -0
  131. package/dist/components/button/index.d.ts +0 -16
  132. package/dist/components/button/props.d.ts +2 -6
  133. package/dist/components/color-picker/panel.d.ts +0 -9
  134. package/dist/components/date-picker/DatePicker.vue.d.ts +0 -15
  135. package/dist/components/date-picker/index.d.ts +0 -30
  136. package/dist/components/drawer/index.d.ts +0 -30
  137. package/dist/components/drawer/src/Drawer.vue.d.ts +0 -15
  138. package/dist/components/dropdown/DropdownButton.vue.d.ts +0 -15
  139. package/dist/components/dropdown/index.d.ts +0 -30
  140. package/dist/components/popconfirm/src/popup.vue.d.ts +0 -15
  141. package/dist/components/time-picker/TimePanel.vue.d.ts +0 -15
  142. package/dist/components/time-picker/TimePicker.vue.d.ts +0 -15
  143. package/dist/components/time-picker/index.d.ts +0 -30
  144. package/dist/es/_styles/palette-aliases.js +102 -17
  145. package/dist/es/_utils/palette.js +54 -54
  146. package/dist/es/components/button/Button.js +77 -49
  147. package/dist/es/components/button/appearance.js +7 -0
  148. package/dist/es/components/button/props.js +0 -4
  149. package/dist/es/directives/wave.js +14 -8
  150. package/dist/es/style.css +1 -1
  151. package/dist/index.cjs +3 -3
  152. package/dist/index.umd.js +3 -3
  153. package/dist/style/alert.css +1 -1
  154. package/dist/style/base.css +1 -1
  155. package/dist/style/button.css +1 -1
  156. package/dist/style/color-picker.css +1 -1
  157. package/dist/style/link.css +1 -1
  158. package/dist/style.css +1 -1
  159. package/package.json +1 -1
@@ -1,70 +1,70 @@
1
- import { PALETTE_ALIASES as x, PALETTE_ALIASES_DARK as b } from "../_styles/palette-aliases.js";
2
- const y = 2.05, p = 95.5, d = 22, A = [1, 0.8, 0.6, 0.4, 0.2], _ = [1 / 3, 2 / 3, 1], S = 90, H = 300, u = (r, c, i) => Math.min(i, Math.max(c, r)), P = (r) => {
3
- if (typeof r != "string") return null;
4
- const c = r.trim();
5
- if (c.startsWith("#")) {
6
- const t = c.slice(1);
7
- if (!/^(?:[0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(t)) return null;
8
- const m = t.length === 3 ? [...t].map((a) => a + a).join("") : t.length === 6 || t.length === 8 ? t.slice(0, 6) : null;
9
- return m ? [0, 2, 4].map((a) => parseInt(m.slice(a, a + 2), 16)) : null;
1
+ import { PALETTE_ALIASES as y, PALETTE_ALIASES_DARK as A, DEFAULT_PALETTE_SEEDS as d } from "../_styles/palette-aliases.js";
2
+ const _ = 2.05, g = 95.5, E = 22, S = [1, 0.8, 0.6, 0.4, 0.2], $ = [1 / 3, 2 / 3, 1], H = 90, L = 300, m = (s, i, c) => Math.min(c, Math.max(i, s)), p = (s) => {
3
+ if (typeof s != "string") return null;
4
+ const i = s.trim();
5
+ if (i.startsWith("#")) {
6
+ const e = i.slice(1);
7
+ if (!/^(?:[0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(e)) return null;
8
+ const u = e.length === 3 ? [...e].map((a) => a + a).join("") : e.length === 6 || e.length === 8 ? e.slice(0, 6) : null;
9
+ return u ? [0, 2, 4].map((a) => parseInt(u.slice(a, a + 2), 16)) : null;
10
10
  }
11
- const i = c.match(/^rgba?\(([^)]+)\)$/i);
12
- if (!i) return null;
13
- const n = i[1].trim(), s = n.includes(",") ? n.split(",").map((t) => t.trim()) : n.split(/\s*\/\s*/)[0].split(/\s+/), e = n.includes(",") ? s[3] : n.includes("/") ? n.split("/")[1].trim() : void 0;
14
- if (n.split("/").length > 2 || s.length < 3 || s.length > (n.includes(",") ? 4 : 3)) return null;
15
- const o = /^[+-]?(?:\d+\.?\d*|\.\d+)%?$/;
16
- if (s.slice(0, 3).some((t) => !o.test(t)) || e !== void 0 && !o.test(e)) return null;
17
- const l = s.slice(0, 3).map((t) => t.endsWith("%") ? Math.round(parseFloat(t) / 100 * 255) : Number(t));
18
- return l.some((t) => !Number.isFinite(t)) ? null : l.map((t) => u(Math.round(t), 0, 255));
19
- }, $ = ([r, c, i]) => {
20
- const n = r / 255, s = c / 255, e = i / 255, o = Math.max(n, s, e), l = Math.min(n, s, e), t = o - l, m = (o + l) / 2;
11
+ const c = i.match(/^rgba?\(([^)]+)\)$/i);
12
+ if (!c) return null;
13
+ const r = c[1].trim(), o = r.includes(",") ? r.split(",").map((e) => e.trim()) : r.split(/\s*\/\s*/)[0].split(/\s+/), t = r.includes(",") ? o[3] : r.includes("/") ? r.split("/")[1].trim() : void 0;
14
+ if (r.split("/").length > 2 || o.length < 3 || o.length > (r.includes(",") ? 4 : 3)) return null;
15
+ const n = /^[+-]?(?:\d+\.?\d*|\.\d+)%?$/;
16
+ if (o.slice(0, 3).some((e) => !n.test(e)) || t !== void 0 && !n.test(t)) return null;
17
+ const l = o.slice(0, 3).map((e) => e.endsWith("%") ? Math.round(parseFloat(e) / 100 * 255) : Number(e));
18
+ return l.some((e) => !Number.isFinite(e)) ? null : l.map((e) => m(Math.round(e), 0, 255));
19
+ }, P = ([s, i, c]) => {
20
+ const r = s / 255, o = i / 255, t = c / 255, n = Math.max(r, o, t), l = Math.min(r, o, t), e = n - l, u = (n + l) / 2;
21
21
  let a = 0, h = 0;
22
- return t !== 0 && (h = m > 0.5 ? t / (2 - o - l) : t / (o + l), o === n ? a = (s - e) / t + (s < e ? 6 : 0) : o === s ? a = (e - n) / t + 2 : a = (n - s) / t + 4, a *= 60), { h: a, s: h * 100, l: m * 100 };
23
- }, I = ({ h: r, s: c, l: i }) => {
24
- const n = u(c, 0, 100) / 100, s = u(i, 0, 100) / 100, e = (r % 360 + 360) % 360, o = (1 - Math.abs(2 * s - 1)) * n, l = o * (1 - Math.abs(e / 60 % 2 - 1)), t = s - o / 2;
25
- let m;
26
- return e < 60 ? m = [o, l, 0] : e < 120 ? m = [l, o, 0] : e < 180 ? m = [0, o, l] : e < 240 ? m = [0, l, o] : e < 300 ? m = [l, 0, o] : m = [o, 0, l], m.map((a) => u(Math.round((a + t) * 255), 0, 255));
27
- }, L = (r) => `#${r.map((c) => u(Math.round(c), 0, 255).toString(16).padStart(2, "0")).join("")}`, R = (r) => r <= S || r >= H ? 1 : -1, g = (r, c = {}) => {
28
- const i = P(r);
29
- if (!i)
30
- throw new Error(`[x-next] generatePalette: 无法解析种子色 "${r}"`);
31
- const { h: n, s, l: e } = $(i), o = R(n), { dark: l = !1 } = c, t = l ? Math.min(d, e) : Math.max(p, e), m = l ? Math.max(p, e) : Math.min(d, e), a = [];
22
+ return e !== 0 && (h = u > 0.5 ? e / (2 - n - l) : e / (n + l), n === r ? a = (o - t) / e + (o < t ? 6 : 0) : n === o ? a = (t - r) / e + 2 : a = (r - o) / e + 4, a *= 60), { h: a, s: h * 100, l: u * 100 };
23
+ }, I = ({ h: s, s: i, l: c }) => {
24
+ const r = m(i, 0, 100) / 100, o = m(c, 0, 100) / 100, t = (s % 360 + 360) % 360, n = (1 - Math.abs(2 * o - 1)) * r, l = n * (1 - Math.abs(t / 60 % 2 - 1)), e = o - n / 2;
25
+ let u;
26
+ return t < 60 ? u = [n, l, 0] : t < 120 ? u = [l, n, 0] : t < 180 ? u = [0, n, l] : t < 240 ? u = [0, l, n] : t < 300 ? u = [l, 0, n] : u = [n, 0, l], u.map((a) => m(Math.round((a + e) * 255), 0, 255));
27
+ }, R = (s) => `#${s.map((i) => m(Math.round(i), 0, 255).toString(16).padStart(2, "0")).join("")}`, v = (s) => s <= H || s >= L ? 1 : -1, T = (s, i = {}) => {
28
+ const c = p(s);
29
+ if (!c)
30
+ throw new Error(`[x-next] generatePalette: 无法解析种子色 "${s}"`);
31
+ const { h: r, s: o, l: t } = P(c), n = v(r), { dark: l = !1 } = i, e = l ? Math.min(E, t) : Math.max(g, t), u = l ? Math.max(g, t) : Math.min(E, t), a = [];
32
32
  for (let h = 0; h < 9; h += 1) {
33
33
  let f;
34
- h < 5 ? f = e + (t - e) * A[h] : h === 5 ? f = e : f = e + (m - e) * _[h - 6];
35
- const E = 5 - h, M = o * y * E * (l ? -1 : 1);
36
- a.push(L(I({ h: n + M, s, l: u(f, 0, 100) })));
34
+ h < 5 ? f = t + (e - t) * S[h] : h === 5 ? f = t : f = t + (u - t) * $[h - 6];
35
+ const M = 5 - h, b = n * _ * M * (l ? -1 : 1);
36
+ a.push(R(I({ h: r + b, s: o, l: m(f, 0, 100) })));
37
37
  }
38
38
  return a;
39
- }, G = (r, c = {}) => {
40
- const { name: i = "primary", target: n, dark: s } = c, e = g(r, { dark: s }), o = n ?? (typeof document < "u" ? document.documentElement : null);
41
- if (o) {
42
- o.style.setProperty(`--x-color-${i}`, e[5]), e.forEach((l, t) => {
43
- o.style.setProperty(`--x-color-${i}-${t + 1}`, l);
39
+ }, G = (s, i = {}) => {
40
+ const { name: c = "primary", target: r, dark: o } = i, t = T(s, { dark: o }), n = r ?? (typeof document < "u" ? document.documentElement : null);
41
+ if (n) {
42
+ n.style.setProperty(`--x-color-${c}`, t[5]), t.forEach((l, e) => {
43
+ n.style.setProperty(`--x-color-${c}-${e + 1}`, l);
44
44
  });
45
- for (const [l, t] of Object.entries(T(i, s)))
46
- o.style.setProperty(l, t);
45
+ for (const [l, e] of Object.entries(x(c, o, t[5])))
46
+ n.style.setProperty(l, e);
47
47
  }
48
- return e;
49
- }, T = (r, c) => {
50
- const i = x[r] ?? {}, n = c ? b[r] : void 0;
51
- return Object.fromEntries(
52
- Object.entries(i).map(([s, e]) => [s, (n == null ? void 0 : n[s]) ?? e])
48
+ return t;
49
+ }, x = (s, i, c) => {
50
+ const r = y[s] ?? {}, o = i ? A[s] : void 0, t = Object.fromEntries(
51
+ Object.entries(r).map(([n, l]) => [n, (o == null ? void 0 : o[n]) ?? l])
53
52
  );
54
- }, W = (r, c = !1) => {
55
- const i = g(r, { dark: c });
53
+ return i && c && d[s] && JSON.stringify(p(c)) !== JSON.stringify(p(d[s])) && (t[`--x-color-${s}-subtle`] = `color-mix(in srgb, var(--x-color-${s}-1) 72%, var(--x-color-${s}-8))`), t;
54
+ }, O = (s, i = !1) => {
55
+ const c = T(s, { dark: i });
56
56
  return {
57
- "--x-color-primary": i[5],
58
- ...Object.fromEntries(i.map((n, s) => [`--x-color-primary-${s + 1}`, n])),
59
- ...T("primary", c)
57
+ "--x-color-primary": c[5],
58
+ ...Object.fromEntries(c.map((r, o) => [`--x-color-primary-${o + 1}`, r])),
59
+ ...x("primary", i, c[5])
60
60
  };
61
61
  };
62
62
  export {
63
63
  G as applyThemeColor,
64
- g as generatePalette,
65
- W as getThemeColorStyles,
64
+ T as generatePalette,
65
+ O as getThemeColorStyles,
66
66
  I as hslToRgb,
67
- P as parseColor,
68
- $ as rgbToHsl,
69
- L as toHex
67
+ p as parseColor,
68
+ P as rgbToHsl,
69
+ R as toHex
70
70
  };
@@ -1,84 +1,112 @@
1
- import { defineComponent as C, getCurrentInstance as E, inject as M, reactive as R, computed as r, withDirectives as Z, createVNode as d, resolveDirective as $, isVNode as q, Comment as H, Fragment as J, Text as Q } from "vue";
2
- import { getClassNameMixin as U } from "../../_utils/config.js";
3
- import { buttonProps as W } from "./props.js";
4
- import X from "../../icons/animation/animation-loading.js";
5
- import Y from "../../directives/wave.js";
6
- import { buttonGroupInjectionKey as _ } from "./context.js";
7
- import { useSize as G } from "../../_hooks/use-size.js";
8
- const o = (e) => {
9
- if (Array.isArray(e)) return e.some(o);
1
+ import { defineComponent as M, getCurrentInstance as R, inject as U, reactive as Z, computed as c, onBeforeUnmount as q, withDirectives as H, createVNode as u, resolveDirective as J, isVNode as Q, Comment as W, Fragment as X, Text as Y } from "vue";
2
+ import { getClassNameMixin as _ } from "../../_utils/config.js";
3
+ import { buttonProps as G } from "./props.js";
4
+ import ee from "../../icons/animation/animation-loading.js";
5
+ import ie from "../../directives/wave.js";
6
+ import { buttonGroupInjectionKey as ae } from "./context.js";
7
+ import { useSize as te } from "../../_hooks/use-size.js";
8
+ import { resolveButtonAppearance as ne } from "./appearance.js";
9
+ const d = (e) => {
10
+ if (Array.isArray(e)) return e.some(d);
10
11
  if (e == null || typeof e == "boolean") return !1;
11
12
  if (typeof e == "string") return e.trim().length > 0;
12
- if (q(e)) {
13
- if (e.type === H) return !1;
14
- if (e.type === J || e.type === Q)
15
- return o(e.children);
13
+ if (Q(e)) {
14
+ if (e.type === W) return !1;
15
+ if (e.type === X || e.type === Y)
16
+ return d(e.children);
16
17
  }
17
18
  return !0;
18
- }, re = /* @__PURE__ */ C({
19
+ }, se = /* @__PURE__ */ M({
19
20
  name: "Button",
20
- props: W,
21
+ props: G,
21
22
  // 显式导入插槽
22
23
  slots: Object,
23
24
  directives: {
24
- wave: Y
25
+ wave: ie
25
26
  },
26
27
  emits: ["click"],
27
28
  setup(e, {
28
- slots: n,
29
- emit: T
29
+ slots: t,
30
+ emit: F
30
31
  }) {
31
- const v = E(), a = M(_, void 0), {
32
- mergedSize: F
33
- } = G(void 0, {
32
+ const b = R(), a = U(ae, void 0), {
33
+ mergedSize: L
34
+ } = te(void 0, {
34
35
  defaultValue: "medium"
35
- }), u = R({
36
- clicked: !1,
37
- isDebounce: !1
38
- }), i = U("button"), A = (t) => t.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`), f = (t) => {
39
- const c = (v == null ? void 0 : v.vnode.props) ?? {};
40
- return Object.prototype.hasOwnProperty.call(c, t) || Object.prototype.hasOwnProperty.call(c, A(t));
41
- }, s = r(() => f("type") ? e.type : (a == null ? void 0 : a.type) ?? e.type), w = r(() => f("size") ? e.size : (a == null ? void 0 : a.size) ?? F.value), D = r(() => f("status") ? e.status : (a == null ? void 0 : a.status) ?? e.status), y = r(() => f("shape") ? e.shape : (a == null ? void 0 : a.shape) ?? e.shape), m = r(() => f("disabled") ? e.disabled : (a == null ? void 0 : a.disabled) ?? e.disabled), L = r(() => [i.block, s.value && s.value !== "default" && i.modifier(s.value), w.value && i.modifier(w.value), D.value && i.modifier(D.value), m.value && i.is("disabled"), e.block && i.modifier("block"), e.plain && i.modifier("plain"), y.value && i.modifier(y.value), e.link && i.modifier("link"), !e.border && i.modifier("hide-border"), l.value && i.modifier("loading"), e.narrow && i.modifier("narrow")]), N = () => {
42
- e.debounce > 0 && !u.isDebounce && (u.isDebounce = !0, setTimeout(() => {
43
- u.isDebounce = !1;
36
+ }), o = Z({
37
+ isDebounce: !1,
38
+ nativeActivation: !1
39
+ }), i = _("button"), N = (n) => n.replace(/[A-Z]/g, (r) => `-${r.toLowerCase()}`), f = (n) => {
40
+ const r = (b == null ? void 0 : b.vnode.props) ?? {};
41
+ return Object.prototype.hasOwnProperty.call(r, n) || Object.prototype.hasOwnProperty.call(r, N(n));
42
+ }, m = c(() => f("type") ? e.type : (a == null ? void 0 : a.type) ?? e.type), S = c(() => f("size") ? e.size : (a == null ? void 0 : a.size) ?? L.value), y = c(() => f("status") ? e.status : (a == null ? void 0 : a.status) ?? e.status), h = c(() => f("shape") ? e.shape : (a == null ? void 0 : a.shape) ?? e.shape), s = c(() => f("disabled") ? e.disabled : (a == null ? void 0 : a.disabled) ?? e.disabled), v = c(() => ne(m.value, y.value, e.plain)), V = c(() => [
43
+ i.block,
44
+ m.value && m.value !== "default" && i.modifier(m.value),
45
+ S.value && i.modifier(S.value),
46
+ // Keep legacy semantic classes, but use separate namespaces for style decisions.
47
+ y.value !== "primary" && i.modifier(y.value),
48
+ i.modifier(`appearance-${v.value.appearance}`),
49
+ i.modifier(`color-${v.value.color}`),
50
+ s.value && i.is("disabled"),
51
+ e.block && i.modifier("block"),
52
+ e.plain && i.modifier("plain"),
53
+ h.value && i.modifier(h.value),
54
+ e.border && ["default", "solid", "outline", "dashed"].includes(v.value.appearance) && i.modifier("has-border"),
55
+ !e.border && i.modifier("hide-border"),
56
+ l.value && i.modifier("loading"),
57
+ e.narrow && i.modifier("narrow")
58
+ ]);
59
+ let k, p;
60
+ q(() => {
61
+ clearTimeout(k), clearTimeout(p);
62
+ });
63
+ const $ = () => {
64
+ e.debounce > 0 && !o.isDebounce && (o.isDebounce = !0, k = setTimeout(() => {
65
+ o.isDebounce = !1;
44
66
  }, e.debounce));
45
- }, l = r(() => e.loading || u.clicked || u.isDebounce), V = r(() => m.value || l.value || e.link || s.value === "text"), B = (t) => {
46
- var c;
47
- t.detail > 0 && ((c = t.currentTarget) == null || c.blur()), !(m.value || l.value) && (N(), T("click", t));
67
+ }, l = c(() => e.loading || o.isDebounce), K = c(() => s.value || l.value || v.value.appearance === "text"), C = (n) => {
68
+ var r;
69
+ if (n.detail > 0 && ((r = n.currentTarget) == null || r.blur()), s.value || l.value) {
70
+ n.preventDefault();
71
+ return;
72
+ }
73
+ e.htmlType !== "button" && (o.nativeActivation = !0, clearTimeout(p), p = setTimeout(() => {
74
+ o.nativeActivation = !1;
75
+ }, 0)), $(), F("click", n);
48
76
  };
49
77
  return () => {
50
- var P, j, I, O;
51
- const t = (P = n.default) == null ? void 0 : P.call(n), c = (j = n.prefix) == null ? void 0 : j.call(n), S = (I = n.icon) == null ? void 0 : I.call(n), x = (O = n.suffix) == null ? void 0 : O.call(n), b = o(t), g = o(c), h = o(S), p = o(x), z = !b && !g && h && !p, k = e.loadingFill || l.value && (y.value === "circle" || z), K = l.value && !k && (b || g || h || p);
52
- return Z(d("button", {
53
- class: [L.value, !b && i.modifier("empty-content"), z && i.modifier("only-icon"), k && i.modifier("loading-fill")],
78
+ var j, I, O, B;
79
+ const n = (j = t.default) == null ? void 0 : j.call(t), r = (I = t.prefix) == null ? void 0 : I.call(t), x = (O = t.icon) == null ? void 0 : O.call(t), z = (B = t.suffix) == null ? void 0 : B.call(t), g = d(n), w = d(r), T = d(x), D = d(z), P = !g && !w && T && !D, A = e.loadingFill || l.value && (h.value === "circle" || P), E = l.value && !A && (g || w || T || D);
80
+ return H(u("button", {
81
+ class: [V.value, !g && i.modifier("empty-content"), P && i.modifier("only-icon"), A && i.modifier("loading-fill")],
54
82
  type: e.htmlType,
55
- disabled: m.value || l.value,
83
+ disabled: s.value || l.value && !o.nativeActivation,
56
84
  "aria-busy": l.value || void 0,
57
- onClick: B
58
- }, [d("span", {
85
+ onClick: C
86
+ }, [u("span", {
59
87
  class: i.element("loading"),
60
88
  "aria-hidden": "true",
61
89
  style: {
62
90
  display: "flex",
63
91
  opacity: l.value ? 1 : 0,
64
- width: k ? void 0 : l.value ? "1em" : 0,
65
- marginRight: K ? "4px" : "0",
92
+ width: A ? void 0 : l.value ? "1em" : 0,
93
+ marginRight: E ? "4px" : "0",
66
94
  overflow: "hidden"
67
95
  }
68
- }, [l.value && d(X, null, null)]), g && d("span", {
96
+ }, [l.value && u(ee, null, null)]), w && u("span", {
69
97
  class: i.element("prefix")
70
- }, [c]), h && d("span", {
98
+ }, [r]), T && u("span", {
71
99
  class: i.element("prefix")
72
- }, [S]), d("span", {
100
+ }, [x]), u("span", {
73
101
  class: i.element("content")
74
- }, [t]), p && d("span", {
102
+ }, [n]), D && u("span", {
75
103
  class: i.element("suffix")
76
- }, [x])]), [[$("wave"), {
77
- disabled: V.value
104
+ }, [z])]), [[J("wave"), {
105
+ disabled: K.value
78
106
  }]]);
79
107
  };
80
108
  }
81
109
  });
82
110
  export {
83
- re as default
111
+ se as default
84
112
  };
@@ -0,0 +1,7 @@
1
+ function c(r, e, o) {
2
+ const a = r === "primary" && e === "default" ? "primary" : e, n = r === "primary" ? "solid" : r;
3
+ return o && ["default", "solid"].includes(n) ? { appearance: "subtle", color: a } : { appearance: n, color: a };
4
+ }
5
+ export {
6
+ c as resolveButtonAppearance
7
+ };
@@ -21,10 +21,6 @@ const e = {
21
21
  type: String,
22
22
  default: void 0
23
23
  },
24
- link: {
25
- type: Boolean,
26
- default: !1
27
- },
28
24
  type: {
29
25
  type: String,
30
26
  default: "default"
@@ -1,4 +1,4 @@
1
- const a = "x-wave";
1
+ const i = "x-wave";
2
2
  const n = (e, t) => {
3
3
  const _ = t.value;
4
4
  if (_ === !1 || _ && typeof _ == "object" && _.disabled) return !0;
@@ -10,8 +10,14 @@ const n = (e, t) => {
10
10
  return t !== "transparent" && t !== "rgba(0, 0, 0, 0)" && t !== "rgba(255, 255, 255, 0)" && t !== "rgb(255, 255, 255)" && t !== "#fff" && t !== "#ffffff";
11
11
  }, v = (e) => {
12
12
  const t = getComputedStyle(e);
13
- return [t.borderTopColor, t.borderColor, t.backgroundColor, t.color].find(d) ?? "currentColor";
14
- }, i = (e) => {
13
+ return [
14
+ t.getPropertyValue("--x-button-wave-color").trim(),
15
+ t.borderTopColor,
16
+ t.borderColor,
17
+ t.backgroundColor,
18
+ t.color
19
+ ].find(d) ?? "currentColor";
20
+ }, a = (e) => {
15
21
  e.__wave_timer__ && (clearTimeout(e.__wave_timer__), delete e.__wave_timer__), e.__wave_element__ && (e.__wave_element__.remove(), delete e.__wave_element__);
16
22
  }, s = (e, t) => {
17
23
  e.__wave_disabled__ = n(e, t);
@@ -21,12 +27,12 @@ const n = (e, t) => {
21
27
  const _ = (r) => {
22
28
  if (e.__wave_disabled__)
23
29
  return;
24
- i(e);
30
+ a(e);
25
31
  const o = document.createElement("div");
26
- o.className = a, o.style.setProperty("--x-wave-color", v(e)), e.__wave_element__ = o, e.appendChild(o), requestAnimationFrame(() => {
27
- o.classList.add(`${a}-active`);
32
+ o.className = i, o.style.setProperty("--x-wave-color", v(e)), e.__wave_element__ = o, e.appendChild(o), requestAnimationFrame(() => {
33
+ o.classList.add(`${i}-active`);
28
34
  }), e.__wave_timer__ = window.setTimeout(() => {
29
- i(e);
35
+ a(e);
30
36
  }, 400);
31
37
  };
32
38
  e.__wave_handler__ = _, e.addEventListener("click", _);
@@ -35,7 +41,7 @@ const n = (e, t) => {
35
41
  s(e, t), getComputedStyle(e).position === "static" && (e.__wave_restore_position__ = e.style.position, e.style.position = "relative");
36
42
  },
37
43
  unmounted(e) {
38
- e.__wave_handler__ && (e.removeEventListener("click", e.__wave_handler__), delete e.__wave_handler__), i(e), e.__wave_restore_position__ !== void 0 && (e.style.position = e.__wave_restore_position__, delete e.__wave_restore_position__), delete e.__wave_disabled__;
44
+ e.__wave_handler__ && (e.removeEventListener("click", e.__wave_handler__), delete e.__wave_handler__), a(e), e.__wave_restore_position__ !== void 0 && (e.style.position = e.__wave_restore_position__, delete e.__wave_restore_position__), delete e.__wave_disabled__;
39
45
  }
40
46
  };
41
47
  export {