@mcistudio/unoui-vue 1.0.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 (187) hide show
  1. package/README.md +95 -0
  2. package/dist/alert/Alert.vue.d.ts +67 -0
  3. package/dist/alert/index.d.ts +40 -0
  4. package/dist/alert/index.js +2 -0
  5. package/dist/attrs.d.ts +11 -0
  6. package/dist/attrs.js +16 -0
  7. package/dist/attrs.js.map +1 -0
  8. package/dist/badge/Badge.vue.d.ts +57 -0
  9. package/dist/badge/BadgeRibbon.vue.d.ts +34 -0
  10. package/dist/badge/index.d.ts +42 -0
  11. package/dist/badge/index.js +2 -0
  12. package/dist/build.d.ts +2 -0
  13. package/dist/button/Button.vue.d.ts +46 -0
  14. package/dist/button/ButtonGroup.vue.d.ts +13 -0
  15. package/dist/button/index.d.ts +13 -0
  16. package/dist/button/index.js +2 -0
  17. package/dist/checkbox/Checkbox.vue.d.ts +47 -0
  18. package/dist/checkbox/CheckboxGroup.vue.d.ts +38 -0
  19. package/dist/checkbox/index.d.ts +30 -0
  20. package/dist/checkbox/index.js +2 -0
  21. package/dist/chunks/Progress-BL4KZ3HE.js +271 -0
  22. package/dist/chunks/Progress-BL4KZ3HE.js.map +1 -0
  23. package/dist/chunks/Skeleton-ohStUD4M.js +153 -0
  24. package/dist/chunks/Skeleton-ohStUD4M.js.map +1 -0
  25. package/dist/chunks/Table-DhXmuKQd.js +330 -0
  26. package/dist/chunks/Table-DhXmuKQd.js.map +1 -0
  27. package/dist/chunks/_plugin-vue_export-helper-B3ysoDQm.js +8 -0
  28. package/dist/chunks/alert-CczW_DKs.js +190 -0
  29. package/dist/chunks/alert-CczW_DKs.js.map +1 -0
  30. package/dist/chunks/badge-BHOZeImh.js +287 -0
  31. package/dist/chunks/badge-BHOZeImh.js.map +1 -0
  32. package/dist/chunks/button-pDObrN_X.js +168 -0
  33. package/dist/chunks/button-pDObrN_X.js.map +1 -0
  34. package/dist/chunks/checkbox-9_0oR4kg.js +260 -0
  35. package/dist/chunks/checkbox-9_0oR4kg.js.map +1 -0
  36. package/dist/chunks/colorpicker-CcizUCQv.js +594 -0
  37. package/dist/chunks/colorpicker-CcizUCQv.js.map +1 -0
  38. package/dist/chunks/datepicker-Cy808x7X.js +1414 -0
  39. package/dist/chunks/datepicker-Cy808x7X.js.map +1 -0
  40. package/dist/chunks/drawer-C3JZ28Xo.js +193 -0
  41. package/dist/chunks/drawer-C3JZ28Xo.js.map +1 -0
  42. package/dist/chunks/dropdown-0l967g7D.js +329 -0
  43. package/dist/chunks/dropdown-0l967g7D.js.map +1 -0
  44. package/dist/chunks/form-Qeqkd-HH.js +642 -0
  45. package/dist/chunks/form-Qeqkd-HH.js.map +1 -0
  46. package/dist/chunks/input-BDOXVCrK.js +1281 -0
  47. package/dist/chunks/input-BDOXVCrK.js.map +1 -0
  48. package/dist/chunks/inputOtp-Dyxj9lNj.js +261 -0
  49. package/dist/chunks/inputOtp-Dyxj9lNj.js.map +1 -0
  50. package/dist/chunks/message-xPfuG0EX.js +107 -0
  51. package/dist/chunks/message-xPfuG0EX.js.map +1 -0
  52. package/dist/chunks/millercolumns-Dp3fBrq6.js +426 -0
  53. package/dist/chunks/millercolumns-Dp3fBrq6.js.map +1 -0
  54. package/dist/chunks/modal-D6l1iIvE.js +81 -0
  55. package/dist/chunks/modal-D6l1iIvE.js.map +1 -0
  56. package/dist/chunks/pagination-Bc583AQX.js +265 -0
  57. package/dist/chunks/pagination-Bc583AQX.js.map +1 -0
  58. package/dist/chunks/popconfirm-D6lUfSxG.js +343 -0
  59. package/dist/chunks/popconfirm-D6lUfSxG.js.map +1 -0
  60. package/dist/chunks/qrcode-B0t_pZna.js +1099 -0
  61. package/dist/chunks/qrcode-B0t_pZna.js.map +1 -0
  62. package/dist/chunks/radio-DnYm59xH.js +477 -0
  63. package/dist/chunks/radio-DnYm59xH.js.map +1 -0
  64. package/dist/chunks/rate-0sme__Kb.js +309 -0
  65. package/dist/chunks/rate-0sme__Kb.js.map +1 -0
  66. package/dist/chunks/select-ChTfQM5u.js +417 -0
  67. package/dist/chunks/select-ChTfQM5u.js.map +1 -0
  68. package/dist/chunks/slider-C-W5GzTP.js +724 -0
  69. package/dist/chunks/slider-C-W5GzTP.js.map +1 -0
  70. package/dist/chunks/splitter-CgfiXY65.js +524 -0
  71. package/dist/chunks/splitter-CgfiXY65.js.map +1 -0
  72. package/dist/chunks/switch-BULGbODP.js +327 -0
  73. package/dist/chunks/switch-BULGbODP.js.map +1 -0
  74. package/dist/chunks/tab-Dxfg1_To.js +663 -0
  75. package/dist/chunks/tab-Dxfg1_To.js.map +1 -0
  76. package/dist/chunks/tag-BYmNsrZC.js +167 -0
  77. package/dist/chunks/tag-BYmNsrZC.js.map +1 -0
  78. package/dist/chunks/timepicker-DsGIdcf8.js +1059 -0
  79. package/dist/chunks/timepicker-DsGIdcf8.js.map +1 -0
  80. package/dist/chunks/tooltip-DMhiAqto.js +242 -0
  81. package/dist/chunks/tooltip-DMhiAqto.js.map +1 -0
  82. package/dist/colorpicker/ColorPicker.vue.d.ts +30 -0
  83. package/dist/colorpicker/color.d.ts +56 -0
  84. package/dist/colorpicker/color.js +99 -0
  85. package/dist/colorpicker/color.js.map +1 -0
  86. package/dist/colorpicker/index.d.ts +12 -0
  87. package/dist/colorpicker/index.js +2 -0
  88. package/dist/config.d.ts +55 -0
  89. package/dist/config.js +260 -0
  90. package/dist/config.js.map +1 -0
  91. package/dist/datepicker/DatePicker.vue.d.ts +82 -0
  92. package/dist/datepicker/RangePicker.vue.d.ts +87 -0
  93. package/dist/datepicker/index.d.ts +59 -0
  94. package/dist/datepicker/index.js +2 -0
  95. package/dist/drawer/Drawer.vue.d.ts +86 -0
  96. package/dist/drawer/index.d.ts +23 -0
  97. package/dist/drawer/index.js +2 -0
  98. package/dist/dropdown/Dropdown.vue.d.ts +118 -0
  99. package/dist/dropdown/index.d.ts +2 -0
  100. package/dist/dropdown/index.js +2 -0
  101. package/dist/form/Form.vue.d.ts +170 -0
  102. package/dist/form/FormItem.vue.d.ts +83 -0
  103. package/dist/form/index.d.ts +176 -0
  104. package/dist/form/index.js +2 -0
  105. package/dist/index.d.ts +31 -0
  106. package/dist/index.js +32 -0
  107. package/dist/input/Autocomplete.vue.d.ts +121 -0
  108. package/dist/input/Input.vue.d.ts +142 -0
  109. package/dist/input/InputI18n.vue.d.ts +80 -0
  110. package/dist/input/InputTag.vue.d.ts +114 -0
  111. package/dist/input/index.d.ts +41 -0
  112. package/dist/input/index.js +2 -0
  113. package/dist/inputOtp/InputOtp.vue.d.ts +60 -0
  114. package/dist/inputOtp/index.d.ts +21 -0
  115. package/dist/inputOtp/index.js +2 -0
  116. package/dist/message/MessageContainer.vue.d.ts +11 -0
  117. package/dist/message/index.d.ts +20 -0
  118. package/dist/message/index.js +2 -0
  119. package/dist/message/types.d.ts +25 -0
  120. package/dist/millercolumns/MillerColumns.vue.d.ts +88 -0
  121. package/dist/millercolumns/index.d.ts +39 -0
  122. package/dist/millercolumns/index.js +2 -0
  123. package/dist/modal/Modal.vue.d.ts +54 -0
  124. package/dist/modal/index.d.ts +2 -0
  125. package/dist/modal/index.js +2 -0
  126. package/dist/pagination/Pagination.vue.d.ts +70 -0
  127. package/dist/pagination/index.d.ts +12 -0
  128. package/dist/pagination/index.js +2 -0
  129. package/dist/popconfirm/Popconfirm.vue.d.ts +104 -0
  130. package/dist/popconfirm/index.d.ts +36 -0
  131. package/dist/popconfirm/index.js +2 -0
  132. package/dist/progress/Progress.vue.d.ts +64 -0
  133. package/dist/progress/index.d.ts +26 -0
  134. package/dist/progress/index.js +2 -0
  135. package/dist/qrcode/QRCode.vue.d.ts +87 -0
  136. package/dist/qrcode/index.d.ts +43 -0
  137. package/dist/qrcode/index.js +2 -0
  138. package/dist/qrcode/qr.d.ts +51 -0
  139. package/dist/qrcode/qrcodegen.d.ts +94 -0
  140. package/dist/radio/Radio.vue.d.ts +52 -0
  141. package/dist/radio/RadioGroup.vue.d.ts +44 -0
  142. package/dist/radio/index.d.ts +55 -0
  143. package/dist/radio/index.js +2 -0
  144. package/dist/rate/Rate.vue.d.ts +100 -0
  145. package/dist/rate/index.d.ts +38 -0
  146. package/dist/rate/index.js +2 -0
  147. package/dist/select/Select.vue.d.ts +129 -0
  148. package/dist/select/index.d.ts +33 -0
  149. package/dist/select/index.js +2 -0
  150. package/dist/skeleton/Skeleton.vue.d.ts +31 -0
  151. package/dist/skeleton/index.d.ts +2 -0
  152. package/dist/skeleton/index.js +2 -0
  153. package/dist/slider/Slider.vue.d.ts +81 -0
  154. package/dist/slider/index.d.ts +61 -0
  155. package/dist/slider/index.js +2 -0
  156. package/dist/splitter/Splitter.vue.d.ts +63 -0
  157. package/dist/splitter/SplitterPanel.vue.d.ts +53 -0
  158. package/dist/splitter/index.d.ts +39 -0
  159. package/dist/splitter/index.js +2 -0
  160. package/dist/style.css +2 -0
  161. package/dist/switch/Switch.vue.d.ts +97 -0
  162. package/dist/switch/index.d.ts +31 -0
  163. package/dist/switch/index.js +2 -0
  164. package/dist/tab/TabPane.vue.d.ts +32 -0
  165. package/dist/tab/Tabs.vue.d.ts +87 -0
  166. package/dist/tab/index.d.ts +78 -0
  167. package/dist/tab/index.js +2 -0
  168. package/dist/table/Table.vue.d.ts +96 -0
  169. package/dist/table/index.d.ts +3 -0
  170. package/dist/table/index.js +2 -0
  171. package/dist/table/types.d.ts +35 -0
  172. package/dist/table/types.js +0 -0
  173. package/dist/tag/Tag.vue.d.ts +46 -0
  174. package/dist/tag/index.d.ts +11 -0
  175. package/dist/tag/index.js +2 -0
  176. package/dist/timepicker/TimePicker.vue.d.ts +92 -0
  177. package/dist/timepicker/TimeRangePicker.vue.d.ts +90 -0
  178. package/dist/timepicker/index.d.ts +39 -0
  179. package/dist/timepicker/index.js +2 -0
  180. package/dist/tooltip/Tooltip.vue.d.ts +79 -0
  181. package/dist/tooltip/index.d.ts +14 -0
  182. package/dist/tooltip/index.js +2 -0
  183. package/dist/uno.d.ts +32 -0
  184. package/dist/uno.js +83 -0
  185. package/dist/uno.js.map +1 -0
  186. package/dist/utils/DnD.d.ts +38 -0
  187. package/package.json +115 -0
@@ -0,0 +1,309 @@
1
+ import { getUiAttrClass as e, getUiAttrStyle as t, getUiExposeAttrs as n } from "../attrs.js";
2
+ import { r } from "./tooltip-DMhiAqto.js";
3
+ import { cva as i } from "class-variance-authority";
4
+ import { Fragment as a, computed as o, createBlock as s, createElementBlock as c, createElementVNode as l, defineComponent as u, mergeProps as d, nextTick as f, normalizeClass as p, normalizeStyle as m, onMounted as h, openBlock as g, ref as _, renderList as ee, renderSlot as v, toDisplayString as y, unref as b, useAttrs as x, watch as S, withCtx as te } from "vue";
5
+ import { clsx as ne } from "clsx";
6
+ //#region src/rate/Rate.vue?vue&type=script&setup=true&lang.ts
7
+ var re = ["aria-disabled", "tabindex"], ie = [
8
+ "aria-checked",
9
+ "aria-label",
10
+ "aria-posinset",
11
+ "aria-setsize",
12
+ "disabled",
13
+ "onMousemove",
14
+ "onClick"
15
+ ], ae = {
16
+ key: 0,
17
+ class: "inline-grid size-[1em] place-items-center"
18
+ }, C = {
19
+ key: 1,
20
+ class: "i-ant-design:star-filled block size-[1em]"
21
+ }, w = {
22
+ key: 0,
23
+ class: "inline-grid size-[1em] place-items-center"
24
+ }, T = {
25
+ key: 1,
26
+ class: "i-ant-design:star-filled block size-[1em]"
27
+ }, E = {
28
+ key: 0,
29
+ class: "inline-grid size-[1em] place-items-center"
30
+ }, D = {
31
+ key: 1,
32
+ class: "i-ant-design:star-filled block size-[1em]"
33
+ }, O = /* @__PURE__ */ u({
34
+ inheritAttrs: !1,
35
+ __name: "Rate",
36
+ props: {
37
+ modelValue: { default: void 0 },
38
+ count: { default: 5 },
39
+ allowHalf: {
40
+ type: Boolean,
41
+ default: !1
42
+ },
43
+ clearable: {
44
+ type: Boolean,
45
+ default: !0
46
+ },
47
+ autofocus: {
48
+ type: Boolean,
49
+ default: !1
50
+ },
51
+ character: { default: "" },
52
+ disabled: {
53
+ type: Boolean,
54
+ default: !1
55
+ },
56
+ tooltips: { default: void 0 },
57
+ size: { default: "md" },
58
+ tabindex: { default: 0 }
59
+ },
60
+ emits: [
61
+ "update:modelValue",
62
+ "change",
63
+ "hoverChange",
64
+ "focus",
65
+ "blur",
66
+ "keydown"
67
+ ],
68
+ setup(i, { expose: u, emit: O }) {
69
+ let P = i, F = O, I = x(), L = _(null), R = _(!1), z = _(void 0), B = _(0), V = o(() => Number.isFinite(P.count) ? Math.max(0, Math.floor(P.count)) : 0), H = o(() => P.modelValue === void 0 ? B.value : q(P.modelValue)), U = o(() => z.value ?? H.value), W = o(() => P.disabled ? -1 : P.tabindex), G = o(() => ne(e(I), k({
70
+ size: P.size,
71
+ disabled: P.disabled,
72
+ focused: R.value
73
+ }))), K = o(() => Array.from({ length: V.value }, (e, t) => {
74
+ let n = t + 1, r = U.value >= n, i = P.allowHalf && U.value + .5 >= n && U.value < n;
75
+ return {
76
+ index: t,
77
+ count: V.value,
78
+ value: U.value,
79
+ active: r,
80
+ half: i,
81
+ disabled: P.disabled,
82
+ fillPercent: r ? 100 : i ? 50 : 0,
83
+ fullActive: r,
84
+ tooltip: P.tooltips?.[t]
85
+ };
86
+ }));
87
+ S([() => P.modelValue, V], () => {
88
+ if (P.modelValue !== void 0) {
89
+ B.value = q(P.modelValue);
90
+ return;
91
+ }
92
+ B.value = q(B.value);
93
+ }, { immediate: !0 }), h(() => {
94
+ !P.autofocus || P.disabled || f(() => $());
95
+ });
96
+ function q(e) {
97
+ return Number.isFinite(e) ? Math.min(V.value, Math.max(0, e)) : 0;
98
+ }
99
+ function J(e) {
100
+ return A({
101
+ size: P.size,
102
+ active: e.active || e.half,
103
+ disabled: P.disabled
104
+ });
105
+ }
106
+ function oe() {
107
+ return M({ tone: P.disabled ? "disabledBase" : "base" });
108
+ }
109
+ function Y() {
110
+ return M({ tone: P.disabled ? "disabledActive" : "active" });
111
+ }
112
+ function se() {
113
+ return N({ kind: "half" });
114
+ }
115
+ function ce() {
116
+ return N({ kind: "full" });
117
+ }
118
+ function le(e) {
119
+ return { opacity: +!!e.half };
120
+ }
121
+ function X(e) {
122
+ return { opacity: +!!e.fullActive };
123
+ }
124
+ function ue(e) {
125
+ return e.tooltip || `${e.index + 1} 分`;
126
+ }
127
+ function de(e) {
128
+ return {
129
+ ...e,
130
+ active: !1,
131
+ half: !1
132
+ };
133
+ }
134
+ function Z(e, t) {
135
+ if (!P.allowHalf) return q(e + 1);
136
+ let n = t.currentTarget, r = n?.getBoundingClientRect(), i = r?.width || n?.offsetWidth || 1, a = r?.left ?? 0;
137
+ return q(t.clientX - a <= i / 2 ? e + .5 : e + 1);
138
+ }
139
+ function Q(e, t) {
140
+ let n = q(e);
141
+ B.value = n, F("update:modelValue", n), F("change", n, t);
142
+ }
143
+ function fe(e, t) {
144
+ if (P.disabled) return;
145
+ let n = Z(t, e);
146
+ z.value = n, F("hoverChange", n);
147
+ }
148
+ function pe() {
149
+ P.disabled || (z.value = void 0, F("hoverChange", void 0));
150
+ }
151
+ function me(e, t) {
152
+ if (P.disabled) return;
153
+ L.value?.focus();
154
+ let n = Z(t, e), r = P.clearable && n === H.value;
155
+ z.value = void 0, F("hoverChange", void 0), Q(r ? 0 : n, e);
156
+ }
157
+ function he(e) {
158
+ if (P.disabled) return;
159
+ let t = P.allowHalf ? .5 : 1, n = H.value;
160
+ if (e.key === "ArrowRight" || e.key === "ArrowUp") n += t;
161
+ else if (e.key === "ArrowLeft" || e.key === "ArrowDown") n -= t;
162
+ else if (e.key === "Home") n = 0;
163
+ else if (e.key === "End") n = V.value;
164
+ else {
165
+ F("keydown", e);
166
+ return;
167
+ }
168
+ n = q(n), n !== H.value && (e.preventDefault(), Q(n, e)), F("keydown", e);
169
+ }
170
+ function ge(e) {
171
+ R.value = !0, F("focus", e);
172
+ }
173
+ function _e(e) {
174
+ R.value = !1, F("blur", e);
175
+ }
176
+ function $() {
177
+ P.disabled || L.value?.focus();
178
+ }
179
+ function ve() {
180
+ P.disabled || L.value?.blur();
181
+ }
182
+ return u({
183
+ focus: $,
184
+ blur: ve
185
+ }), (e, o) => (g(), c("div", d(b(n)(b(I)), {
186
+ ref_key: "rateRef",
187
+ ref: L,
188
+ "data-ui-rate": "true",
189
+ role: "radiogroup",
190
+ "aria-disabled": i.disabled,
191
+ tabindex: W.value,
192
+ class: G.value,
193
+ style: b(t)(b(I)),
194
+ onMouseleave: pe,
195
+ onFocus: ge,
196
+ onBlur: _e,
197
+ onKeydown: he
198
+ }), [(g(!0), c(a, null, ee(K.value, (t) => (g(), s(b(r), {
199
+ key: t.index,
200
+ title: t.tooltip,
201
+ disabled: i.disabled || !t.tooltip,
202
+ "mouse-enter-delay": 0,
203
+ "mouse-leave-delay": 0,
204
+ placement: "top"
205
+ }, {
206
+ default: te(() => [l("button", {
207
+ type: "button",
208
+ "data-ui-rate-item": "true",
209
+ role: "radio",
210
+ "aria-checked": U.value > t.index,
211
+ "aria-label": ue(t),
212
+ "aria-posinset": t.index + 1,
213
+ "aria-setsize": t.count,
214
+ tabindex: -1,
215
+ disabled: i.disabled,
216
+ class: p(J(t)),
217
+ onMousemove: (e) => fe(e, t.index),
218
+ onClick: (e) => me(e, t.index)
219
+ }, [l("span", { class: p(b(j)({ disabled: i.disabled })) }, [
220
+ l("span", {
221
+ class: p(oe()),
222
+ "aria-hidden": "true"
223
+ }, [v(e.$slots, "character", d({ ref_for: !0 }, de(t)), () => [i.character ? (g(), c("span", ae, y(i.character), 1)) : (g(), c("span", C))])], 2),
224
+ l("span", {
225
+ "aria-hidden": "true",
226
+ class: p(se()),
227
+ style: m(le(t))
228
+ }, [l("span", { class: p(Y()) }, [v(e.$slots, "character", d({ ref_for: !0 }, t), () => [i.character ? (g(), c("span", w, y(i.character), 1)) : (g(), c("span", T))])], 2)], 6),
229
+ l("span", {
230
+ "aria-hidden": "true",
231
+ class: p(ce()),
232
+ style: m(X(t))
233
+ }, [l("span", { class: p(Y()) }, [v(e.$slots, "character", d({ ref_for: !0 }, t), () => [i.character ? (g(), c("span", E, y(i.character), 1)) : (g(), c("span", D))])], 2)], 6)
234
+ ], 2)], 42, ie)]),
235
+ _: 2
236
+ }, 1032, ["title", "disabled"]))), 128))], 16, re));
237
+ }
238
+ }), k = i("inline-flex w-fit items-center rounded outline-none transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-brand-400 focus-visible:ring-offset-2 focus-visible:ring-offset-primary", {
239
+ variants: {
240
+ size: {
241
+ sm: "gap-1.5 text-xl/5",
242
+ md: "gap-2 text-2xl/6",
243
+ lg: "gap-2.5 text-3xl/7"
244
+ },
245
+ disabled: {
246
+ true: "cursor-not-allowed opacity-70",
247
+ false: "cursor-pointer"
248
+ },
249
+ focused: {
250
+ true: "",
251
+ false: ""
252
+ }
253
+ },
254
+ compoundVariants: [{
255
+ focused: !0,
256
+ disabled: !1,
257
+ class: "text-brand-500"
258
+ }],
259
+ defaultVariants: {
260
+ size: "md",
261
+ disabled: !1,
262
+ focused: !1
263
+ }
264
+ }), A = i("group/ui-rate-item relative inline-flex shrink-0 items-center justify-center rounded-sm border-0 bg-transparent p-0 text-inherit outline-none", {
265
+ variants: {
266
+ size: {
267
+ sm: "size-5",
268
+ md: "size-6",
269
+ lg: "size-7.5"
270
+ },
271
+ active: {
272
+ true: "",
273
+ false: ""
274
+ },
275
+ disabled: {
276
+ true: "cursor-not-allowed",
277
+ false: "cursor-pointer"
278
+ }
279
+ },
280
+ defaultVariants: {
281
+ size: "md",
282
+ active: !1,
283
+ disabled: !1
284
+ }
285
+ }), j = i("relative inline-grid size-[1em] place-items-center select-none leading-none", {
286
+ variants: { disabled: {
287
+ true: "",
288
+ false: "transition-transform duration-200 ease-out group-hover/ui-rate-item:scale-110 group-active/ui-rate-item:scale-100 group-focus-visible/ui-rate-item:scale-110"
289
+ } },
290
+ defaultVariants: { disabled: !1 }
291
+ }), M = i("inline-grid size-[1em] place-items-center leading-none transition-colors duration-150", {
292
+ variants: { tone: {
293
+ base: "text-zinc-300 dark:text-zinc-700",
294
+ active: "text-amber-400 dark:text-amber-300",
295
+ disabledBase: "text-zinc-300 dark:text-zinc-700",
296
+ disabledActive: "text-zinc-400 dark:text-zinc-500"
297
+ } },
298
+ defaultVariants: { tone: "base" }
299
+ }), N = i("absolute inset-y-0 left-0 overflow-hidden opacity-0 transition-opacity duration-200 ease-out", {
300
+ variants: { kind: {
301
+ half: "w-1/2",
302
+ full: "w-full"
303
+ } },
304
+ defaultVariants: { kind: "full" }
305
+ });
306
+ //#endregion
307
+ export { k as a, A as i, j as n, O as o, M as r, N as t };
308
+
309
+ //# sourceMappingURL=rate-0sme__Kb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rate-0sme__Kb.js","names":[],"sources":["../../src/rate/Rate.vue","../../src/rate/Rate.vue","../../src/rate/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport { clsx } from 'clsx'\nimport { computed, nextTick, onMounted, ref, useAttrs, watch } from 'vue'\n\nimport { getUiAttrClass, getUiAttrStyle, getUiExposeAttrs } from '../attrs'\nimport { Tooltip } from '../tooltip'\n\nimport { rateActiveLayer, rateCharacter, rateCharacterLayer, rateItem, rateRoot, type RateCharacterSlotProps, type RateProps } from '.'\n\ndefineOptions({\n inheritAttrs: false\n})\n\ninterface RateItemState extends RateCharacterSlotProps {\n fillPercent: number\n fullActive: boolean\n tooltip?: string\n}\n\nconst props = withDefaults(\n defineProps<{\n /** modelValue 是本地 v-model 绑定值。 */\n modelValue?: number\n /** count 是评分字符总数。 */\n count?: number\n /** allowHalf 表示是否允许半选。 */\n allowHalf?: boolean\n /** clearable 表示再次点击当前值时是否清空。 */\n clearable?: boolean\n /** autofocus 表示挂载后自动聚焦。 */\n autofocus?: boolean\n /** character 是自定义评分字符;更复杂内容可使用 character 插槽。 */\n character?: string\n /** disabled 表示只读禁用。 */\n disabled?: boolean\n /** tooltips 是每个评分字符对应的悬浮提示。 */\n tooltips?: string[]\n /** size 表示评分字符尺寸。 */\n size?: RateProps['size']\n /** tabindex 是根节点键盘聚焦顺序,禁用时固定为 -1。 */\n tabindex?: number | string\n }>(),\n {\n modelValue: undefined,\n count: 5,\n allowHalf: false,\n clearable: true,\n autofocus: false,\n character: '',\n disabled: false,\n tooltips: undefined,\n size: 'md',\n tabindex: 0\n }\n)\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: number): void\n (e: 'change', value: number, event?: MouseEvent | KeyboardEvent): void\n (e: 'hoverChange', value: number | undefined): void\n (e: 'focus', event: FocusEvent): void\n (e: 'blur', event: FocusEvent): void\n (e: 'keydown', event: KeyboardEvent): void\n}>()\n\nconst attrs = useAttrs()\nconst rateRef = ref<HTMLElement | null>(null)\nconst focused = ref(false)\nconst hoverValue = ref<number | undefined>(undefined)\nconst internalValue = ref(0)\n\nconst normalizedCount = computed(() => {\n if (!Number.isFinite(props.count)) return 0\n return Math.max(0, Math.floor(props.count))\n})\nconst currentValue = computed(() => (props.modelValue === undefined ? internalValue.value : normalizeValue(props.modelValue)))\nconst displayValue = computed(() => hoverValue.value ?? currentValue.value)\nconst rootTabindex = computed(() => (props.disabled ? -1 : props.tabindex))\nconst rootClass = computed(() =>\n clsx(\n getUiAttrClass(attrs),\n rateRoot({\n size: props.size,\n disabled: props.disabled,\n focused: focused.value\n })\n )\n)\nconst items = computed<RateItemState[]>(() =>\n Array.from({ length: normalizedCount.value }, (_, index) => {\n const itemValue = index + 1\n const active = displayValue.value >= itemValue\n const half = props.allowHalf && displayValue.value + 0.5 >= itemValue && displayValue.value < itemValue\n return {\n index,\n count: normalizedCount.value,\n value: displayValue.value,\n active,\n half,\n disabled: props.disabled,\n fillPercent: active ? 100 : half ? 50 : 0,\n fullActive: active,\n tooltip: props.tooltips?.[index]\n }\n })\n)\n\nwatch(\n [() => props.modelValue, normalizedCount],\n () => {\n if (props.modelValue !== undefined) {\n internalValue.value = normalizeValue(props.modelValue)\n return\n }\n internalValue.value = normalizeValue(internalValue.value)\n },\n { immediate: true }\n)\n\nonMounted(() => {\n if (!props.autofocus || props.disabled) return\n void nextTick(() => focus())\n})\n\nfunction normalizeValue(value: number) {\n if (!Number.isFinite(value)) return 0\n return Math.min(normalizedCount.value, Math.max(0, value))\n}\n\nfunction getItemClass(item: RateItemState) {\n return rateItem({\n size: props.size,\n active: item.active || item.half,\n disabled: props.disabled\n })\n}\n\nfunction getBaseLayerClass() {\n return rateCharacterLayer({\n tone: props.disabled ? 'disabledBase' : 'base'\n })\n}\n\nfunction getActiveLayerClass() {\n return rateCharacterLayer({\n tone: props.disabled ? 'disabledActive' : 'active'\n })\n}\n\nfunction getHalfLayerClass() {\n return rateActiveLayer({\n kind: 'half'\n })\n}\n\nfunction getFullLayerClass() {\n return rateActiveLayer({\n kind: 'full'\n })\n}\n\nfunction getHalfLayerStyle(item: RateItemState) {\n return {\n opacity: item.half ? 1 : 0\n }\n}\n\nfunction getFullLayerStyle(item: RateItemState) {\n return {\n opacity: item.fullActive ? 1 : 0\n }\n}\n\nfunction getItemAriaLabel(item: RateItemState) {\n return item.tooltip || `${item.index + 1} 分`\n}\n\nfunction getBaseSlotProps(item: RateItemState): RateItemState {\n return {\n ...item,\n active: false,\n half: false\n }\n}\n\nfunction getStarValue(index: number, event: MouseEvent) {\n if (!props.allowHalf) return normalizeValue(index + 1)\n const target = event.currentTarget as HTMLElement | null\n const rect = target?.getBoundingClientRect()\n const width = rect?.width || target?.offsetWidth || 1\n const left = rect?.left ?? 0\n return normalizeValue(event.clientX - left <= width / 2 ? index + 0.5 : index + 1)\n}\n\nfunction commitValue(value: number, event?: MouseEvent | KeyboardEvent) {\n const nextValue = normalizeValue(value)\n internalValue.value = nextValue\n emit('update:modelValue', nextValue)\n emit('change', nextValue, event)\n}\n\nfunction handleMouseMove(event: MouseEvent, index: number) {\n if (props.disabled) return\n const nextValue = getStarValue(index, event)\n hoverValue.value = nextValue\n emit('hoverChange', nextValue)\n}\n\nfunction handleMouseLeave() {\n if (props.disabled) return\n hoverValue.value = undefined\n emit('hoverChange', undefined)\n}\n\nfunction handleClick(event: MouseEvent, index: number) {\n if (props.disabled) return\n rateRef.value?.focus()\n const nextValue = getStarValue(index, event)\n const shouldClear = props.clearable && nextValue === currentValue.value\n hoverValue.value = undefined\n emit('hoverChange', undefined)\n commitValue(shouldClear ? 0 : nextValue, event)\n}\n\n/**\n * 键盘交互按评分组件常见语义推进:方向键调整值,Home/End 快速清零或满分。\n */\nfunction handleKeydown(event: KeyboardEvent) {\n if (props.disabled) return\n const step = props.allowHalf ? 0.5 : 1\n let nextValue = currentValue.value\n if (event.key === 'ArrowRight' || event.key === 'ArrowUp') {\n nextValue += step\n } else if (event.key === 'ArrowLeft' || event.key === 'ArrowDown') {\n nextValue -= step\n } else if (event.key === 'Home') {\n nextValue = 0\n } else if (event.key === 'End') {\n nextValue = normalizedCount.value\n } else {\n emit('keydown', event)\n return\n }\n nextValue = normalizeValue(nextValue)\n if (nextValue !== currentValue.value) {\n event.preventDefault()\n commitValue(nextValue, event)\n }\n emit('keydown', event)\n}\n\nfunction handleFocus(event: FocusEvent) {\n focused.value = true\n emit('focus', event)\n}\n\nfunction handleBlur(event: FocusEvent) {\n focused.value = false\n emit('blur', event)\n}\n\nfunction focus() {\n if (props.disabled) return\n rateRef.value?.focus()\n}\n\nfunction blur() {\n if (props.disabled) return\n rateRef.value?.blur()\n}\n\ndefineExpose({\n focus,\n blur\n})\n</script>\n\n<template>\n <div\n v-bind=\"getUiExposeAttrs(attrs)\"\n ref=\"rateRef\"\n data-ui-rate=\"true\"\n role=\"radiogroup\"\n :aria-disabled=\"disabled\"\n :tabindex=\"rootTabindex\"\n :class=\"rootClass\"\n :style=\"getUiAttrStyle(attrs)\"\n @mouseleave=\"handleMouseLeave\"\n @focus=\"handleFocus\"\n @blur=\"handleBlur\"\n @keydown=\"handleKeydown\"\n >\n <Tooltip v-for=\"item in items\" :key=\"item.index\" :title=\"item.tooltip\" :disabled=\"disabled || !item.tooltip\" :mouse-enter-delay=\"0\" :mouse-leave-delay=\"0\" placement=\"top\">\n <button\n type=\"button\"\n data-ui-rate-item=\"true\"\n role=\"radio\"\n :aria-checked=\"displayValue > item.index\"\n :aria-label=\"getItemAriaLabel(item)\"\n :aria-posinset=\"item.index + 1\"\n :aria-setsize=\"item.count\"\n :tabindex=\"-1\"\n :disabled=\"disabled\"\n :class=\"getItemClass(item)\"\n @mousemove=\"handleMouseMove($event, item.index)\"\n @click=\"handleClick($event, item.index)\"\n >\n <span :class=\"rateCharacter({ disabled })\">\n <span :class=\"getBaseLayerClass()\" aria-hidden=\"true\">\n <slot name=\"character\" v-bind=\"getBaseSlotProps(item)\">\n <span v-if=\"character\" class=\"inline-grid size-[1em] place-items-center\">{{ character }}</span>\n <span v-else class=\"i-ant-design:star-filled block size-[1em]\"></span>\n </slot>\n </span>\n <span aria-hidden=\"true\" :class=\"getHalfLayerClass()\" :style=\"getHalfLayerStyle(item)\">\n <span :class=\"getActiveLayerClass()\">\n <slot name=\"character\" v-bind=\"item\">\n <span v-if=\"character\" class=\"inline-grid size-[1em] place-items-center\">{{ character }}</span>\n <span v-else class=\"i-ant-design:star-filled block size-[1em]\"></span>\n </slot>\n </span>\n </span>\n <span aria-hidden=\"true\" :class=\"getFullLayerClass()\" :style=\"getFullLayerStyle(item)\">\n <span :class=\"getActiveLayerClass()\">\n <slot name=\"character\" v-bind=\"item\">\n <span v-if=\"character\" class=\"inline-grid size-[1em] place-items-center\">{{ character }}</span>\n <span v-else class=\"i-ant-design:star-filled block size-[1em]\"></span>\n </slot>\n </span>\n </span>\n </span>\n </button>\n </Tooltip>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { clsx } from 'clsx'\nimport { computed, nextTick, onMounted, ref, useAttrs, watch } from 'vue'\n\nimport { getUiAttrClass, getUiAttrStyle, getUiExposeAttrs } from '../attrs'\nimport { Tooltip } from '../tooltip'\n\nimport { rateActiveLayer, rateCharacter, rateCharacterLayer, rateItem, rateRoot, type RateCharacterSlotProps, type RateProps } from '.'\n\ndefineOptions({\n inheritAttrs: false\n})\n\ninterface RateItemState extends RateCharacterSlotProps {\n fillPercent: number\n fullActive: boolean\n tooltip?: string\n}\n\nconst props = withDefaults(\n defineProps<{\n /** modelValue 是本地 v-model 绑定值。 */\n modelValue?: number\n /** count 是评分字符总数。 */\n count?: number\n /** allowHalf 表示是否允许半选。 */\n allowHalf?: boolean\n /** clearable 表示再次点击当前值时是否清空。 */\n clearable?: boolean\n /** autofocus 表示挂载后自动聚焦。 */\n autofocus?: boolean\n /** character 是自定义评分字符;更复杂内容可使用 character 插槽。 */\n character?: string\n /** disabled 表示只读禁用。 */\n disabled?: boolean\n /** tooltips 是每个评分字符对应的悬浮提示。 */\n tooltips?: string[]\n /** size 表示评分字符尺寸。 */\n size?: RateProps['size']\n /** tabindex 是根节点键盘聚焦顺序,禁用时固定为 -1。 */\n tabindex?: number | string\n }>(),\n {\n modelValue: undefined,\n count: 5,\n allowHalf: false,\n clearable: true,\n autofocus: false,\n character: '',\n disabled: false,\n tooltips: undefined,\n size: 'md',\n tabindex: 0\n }\n)\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: number): void\n (e: 'change', value: number, event?: MouseEvent | KeyboardEvent): void\n (e: 'hoverChange', value: number | undefined): void\n (e: 'focus', event: FocusEvent): void\n (e: 'blur', event: FocusEvent): void\n (e: 'keydown', event: KeyboardEvent): void\n}>()\n\nconst attrs = useAttrs()\nconst rateRef = ref<HTMLElement | null>(null)\nconst focused = ref(false)\nconst hoverValue = ref<number | undefined>(undefined)\nconst internalValue = ref(0)\n\nconst normalizedCount = computed(() => {\n if (!Number.isFinite(props.count)) return 0\n return Math.max(0, Math.floor(props.count))\n})\nconst currentValue = computed(() => (props.modelValue === undefined ? internalValue.value : normalizeValue(props.modelValue)))\nconst displayValue = computed(() => hoverValue.value ?? currentValue.value)\nconst rootTabindex = computed(() => (props.disabled ? -1 : props.tabindex))\nconst rootClass = computed(() =>\n clsx(\n getUiAttrClass(attrs),\n rateRoot({\n size: props.size,\n disabled: props.disabled,\n focused: focused.value\n })\n )\n)\nconst items = computed<RateItemState[]>(() =>\n Array.from({ length: normalizedCount.value }, (_, index) => {\n const itemValue = index + 1\n const active = displayValue.value >= itemValue\n const half = props.allowHalf && displayValue.value + 0.5 >= itemValue && displayValue.value < itemValue\n return {\n index,\n count: normalizedCount.value,\n value: displayValue.value,\n active,\n half,\n disabled: props.disabled,\n fillPercent: active ? 100 : half ? 50 : 0,\n fullActive: active,\n tooltip: props.tooltips?.[index]\n }\n })\n)\n\nwatch(\n [() => props.modelValue, normalizedCount],\n () => {\n if (props.modelValue !== undefined) {\n internalValue.value = normalizeValue(props.modelValue)\n return\n }\n internalValue.value = normalizeValue(internalValue.value)\n },\n { immediate: true }\n)\n\nonMounted(() => {\n if (!props.autofocus || props.disabled) return\n void nextTick(() => focus())\n})\n\nfunction normalizeValue(value: number) {\n if (!Number.isFinite(value)) return 0\n return Math.min(normalizedCount.value, Math.max(0, value))\n}\n\nfunction getItemClass(item: RateItemState) {\n return rateItem({\n size: props.size,\n active: item.active || item.half,\n disabled: props.disabled\n })\n}\n\nfunction getBaseLayerClass() {\n return rateCharacterLayer({\n tone: props.disabled ? 'disabledBase' : 'base'\n })\n}\n\nfunction getActiveLayerClass() {\n return rateCharacterLayer({\n tone: props.disabled ? 'disabledActive' : 'active'\n })\n}\n\nfunction getHalfLayerClass() {\n return rateActiveLayer({\n kind: 'half'\n })\n}\n\nfunction getFullLayerClass() {\n return rateActiveLayer({\n kind: 'full'\n })\n}\n\nfunction getHalfLayerStyle(item: RateItemState) {\n return {\n opacity: item.half ? 1 : 0\n }\n}\n\nfunction getFullLayerStyle(item: RateItemState) {\n return {\n opacity: item.fullActive ? 1 : 0\n }\n}\n\nfunction getItemAriaLabel(item: RateItemState) {\n return item.tooltip || `${item.index + 1} 分`\n}\n\nfunction getBaseSlotProps(item: RateItemState): RateItemState {\n return {\n ...item,\n active: false,\n half: false\n }\n}\n\nfunction getStarValue(index: number, event: MouseEvent) {\n if (!props.allowHalf) return normalizeValue(index + 1)\n const target = event.currentTarget as HTMLElement | null\n const rect = target?.getBoundingClientRect()\n const width = rect?.width || target?.offsetWidth || 1\n const left = rect?.left ?? 0\n return normalizeValue(event.clientX - left <= width / 2 ? index + 0.5 : index + 1)\n}\n\nfunction commitValue(value: number, event?: MouseEvent | KeyboardEvent) {\n const nextValue = normalizeValue(value)\n internalValue.value = nextValue\n emit('update:modelValue', nextValue)\n emit('change', nextValue, event)\n}\n\nfunction handleMouseMove(event: MouseEvent, index: number) {\n if (props.disabled) return\n const nextValue = getStarValue(index, event)\n hoverValue.value = nextValue\n emit('hoverChange', nextValue)\n}\n\nfunction handleMouseLeave() {\n if (props.disabled) return\n hoverValue.value = undefined\n emit('hoverChange', undefined)\n}\n\nfunction handleClick(event: MouseEvent, index: number) {\n if (props.disabled) return\n rateRef.value?.focus()\n const nextValue = getStarValue(index, event)\n const shouldClear = props.clearable && nextValue === currentValue.value\n hoverValue.value = undefined\n emit('hoverChange', undefined)\n commitValue(shouldClear ? 0 : nextValue, event)\n}\n\n/**\n * 键盘交互按评分组件常见语义推进:方向键调整值,Home/End 快速清零或满分。\n */\nfunction handleKeydown(event: KeyboardEvent) {\n if (props.disabled) return\n const step = props.allowHalf ? 0.5 : 1\n let nextValue = currentValue.value\n if (event.key === 'ArrowRight' || event.key === 'ArrowUp') {\n nextValue += step\n } else if (event.key === 'ArrowLeft' || event.key === 'ArrowDown') {\n nextValue -= step\n } else if (event.key === 'Home') {\n nextValue = 0\n } else if (event.key === 'End') {\n nextValue = normalizedCount.value\n } else {\n emit('keydown', event)\n return\n }\n nextValue = normalizeValue(nextValue)\n if (nextValue !== currentValue.value) {\n event.preventDefault()\n commitValue(nextValue, event)\n }\n emit('keydown', event)\n}\n\nfunction handleFocus(event: FocusEvent) {\n focused.value = true\n emit('focus', event)\n}\n\nfunction handleBlur(event: FocusEvent) {\n focused.value = false\n emit('blur', event)\n}\n\nfunction focus() {\n if (props.disabled) return\n rateRef.value?.focus()\n}\n\nfunction blur() {\n if (props.disabled) return\n rateRef.value?.blur()\n}\n\ndefineExpose({\n focus,\n blur\n})\n</script>\n\n<template>\n <div\n v-bind=\"getUiExposeAttrs(attrs)\"\n ref=\"rateRef\"\n data-ui-rate=\"true\"\n role=\"radiogroup\"\n :aria-disabled=\"disabled\"\n :tabindex=\"rootTabindex\"\n :class=\"rootClass\"\n :style=\"getUiAttrStyle(attrs)\"\n @mouseleave=\"handleMouseLeave\"\n @focus=\"handleFocus\"\n @blur=\"handleBlur\"\n @keydown=\"handleKeydown\"\n >\n <Tooltip v-for=\"item in items\" :key=\"item.index\" :title=\"item.tooltip\" :disabled=\"disabled || !item.tooltip\" :mouse-enter-delay=\"0\" :mouse-leave-delay=\"0\" placement=\"top\">\n <button\n type=\"button\"\n data-ui-rate-item=\"true\"\n role=\"radio\"\n :aria-checked=\"displayValue > item.index\"\n :aria-label=\"getItemAriaLabel(item)\"\n :aria-posinset=\"item.index + 1\"\n :aria-setsize=\"item.count\"\n :tabindex=\"-1\"\n :disabled=\"disabled\"\n :class=\"getItemClass(item)\"\n @mousemove=\"handleMouseMove($event, item.index)\"\n @click=\"handleClick($event, item.index)\"\n >\n <span :class=\"rateCharacter({ disabled })\">\n <span :class=\"getBaseLayerClass()\" aria-hidden=\"true\">\n <slot name=\"character\" v-bind=\"getBaseSlotProps(item)\">\n <span v-if=\"character\" class=\"inline-grid size-[1em] place-items-center\">{{ character }}</span>\n <span v-else class=\"i-ant-design:star-filled block size-[1em]\"></span>\n </slot>\n </span>\n <span aria-hidden=\"true\" :class=\"getHalfLayerClass()\" :style=\"getHalfLayerStyle(item)\">\n <span :class=\"getActiveLayerClass()\">\n <slot name=\"character\" v-bind=\"item\">\n <span v-if=\"character\" class=\"inline-grid size-[1em] place-items-center\">{{ character }}</span>\n <span v-else class=\"i-ant-design:star-filled block size-[1em]\"></span>\n </slot>\n </span>\n </span>\n <span aria-hidden=\"true\" :class=\"getFullLayerClass()\" :style=\"getFullLayerStyle(item)\">\n <span :class=\"getActiveLayerClass()\">\n <slot name=\"character\" v-bind=\"item\">\n <span v-if=\"character\" class=\"inline-grid size-[1em] place-items-center\">{{ character }}</span>\n <span v-else class=\"i-ant-design:star-filled block size-[1em]\"></span>\n </slot>\n </span>\n </span>\n </span>\n </button>\n </Tooltip>\n </div>\n</template>\n","import { cva } from 'class-variance-authority'\nimport type { VariantProps } from 'class-variance-authority'\n\nexport { default as Rate } from './Rate.vue'\n\n/** RateCharacterSlotProps 是自定义评分字符插槽接收的上下文。 */\nexport interface RateCharacterSlotProps {\n index: number\n count: number\n value: number\n active: boolean\n half: boolean\n disabled: boolean\n}\n\n/** rateRoot 定义管理端 Rate 根节点的排列、尺寸和焦点样式。 */\nexport const rateRoot = cva('inline-flex w-fit items-center rounded outline-none transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-brand-400 focus-visible:ring-offset-2 focus-visible:ring-offset-primary', {\n variants: {\n size: {\n sm: 'gap-1.5 text-xl/5',\n md: 'gap-2 text-2xl/6',\n lg: 'gap-2.5 text-3xl/7'\n },\n disabled: {\n true: 'cursor-not-allowed opacity-70',\n false: 'cursor-pointer'\n },\n focused: {\n true: '',\n false: ''\n }\n },\n compoundVariants: [{ focused: true, disabled: false, class: 'text-brand-500' }],\n defaultVariants: {\n size: 'md',\n disabled: false,\n focused: false\n }\n})\n\n/** rateItem 定义单个评分字符的交互热区。 */\nexport const rateItem = cva('group/ui-rate-item relative inline-flex shrink-0 items-center justify-center rounded-sm border-0 bg-transparent p-0 text-inherit outline-none', {\n variants: {\n size: {\n sm: 'size-5',\n md: 'size-6',\n lg: 'size-7.5'\n },\n active: {\n true: '',\n false: ''\n },\n disabled: {\n true: 'cursor-not-allowed',\n false: 'cursor-pointer'\n }\n },\n defaultVariants: {\n size: 'md',\n active: false,\n disabled: false\n }\n})\n\n/** rateCharacter 定义评分字符容器,支持半选时裁切前景层。 */\nexport const rateCharacter = cva('relative inline-grid size-[1em] place-items-center select-none leading-none', {\n variants: {\n disabled: {\n true: '',\n false: 'transition-transform duration-200 ease-out group-hover/ui-rate-item:scale-110 group-active/ui-rate-item:scale-100 group-focus-visible/ui-rate-item:scale-110'\n }\n },\n defaultVariants: {\n disabled: false\n }\n})\n\n/** rateCharacterLayer 定义评分字符的未选/已选前景层。 */\nexport const rateCharacterLayer = cva('inline-grid size-[1em] place-items-center leading-none transition-colors duration-150', {\n variants: {\n tone: {\n base: 'text-zinc-300 dark:text-zinc-700',\n active: 'text-amber-400 dark:text-amber-300',\n disabledBase: 'text-zinc-300 dark:text-zinc-700',\n disabledActive: 'text-zinc-400 dark:text-zinc-500'\n }\n },\n defaultVariants: {\n tone: 'base'\n }\n})\n\n/** rateActiveLayer 定义 Ant 风格的半星/整星激活层淡入淡出动画。 */\nexport const rateActiveLayer = cva('absolute inset-y-0 left-0 overflow-hidden opacity-0 transition-opacity duration-200 ease-out', {\n variants: {\n kind: {\n half: 'w-1/2',\n full: 'w-full'\n }\n },\n defaultVariants: {\n kind: 'full'\n }\n})\n\n/** RateProps 是 rateRoot 变体推导出的组件属性类型。 */\nexport type RateProps = VariantProps<typeof rateRoot>\nexport type RateSize = NonNullable<RateProps['size']>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBA,IAAM,IAAQ,GAqCR,IAAO,GASP,IAAQ,EAAS,GACjB,IAAU,EAAwB,IAAI,GACtC,IAAU,EAAI,EAAK,GACnB,IAAa,EAAwB,KAAA,CAAS,GAC9C,IAAgB,EAAI,CAAC,GAErB,IAAkB,QACjB,OAAO,SAAS,EAAM,KAAK,IACzB,KAAK,IAAI,GAAG,KAAK,MAAM,EAAM,KAAK,CAAC,IADA,CAE3C,GACK,IAAe,QAAgB,EAAM,eAAe,KAAA,IAAY,EAAc,QAAQ,EAAe,EAAM,UAAU,CAAE,GACvH,IAAe,QAAe,EAAW,SAAS,EAAa,KAAK,GACpE,IAAe,QAAgB,EAAM,WAAW,KAAK,EAAM,QAAS,GACpE,IAAY,QAChB,GACE,EAAe,CAAK,GACpB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