@kernel4632/kima 0.0.0-stage → 0.6.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 (168) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +209 -2
  3. package/dist/THIRD_PARTY_NOTICES.txt +2676 -0
  4. package/dist/kima-elements-core.js +53209 -0
  5. package/dist/kima-elements.js +126371 -0
  6. package/dist/kima-theme.js +1583 -0
  7. package/dist/kima.js +141 -0
  8. package/dist/style.css +2 -0
  9. package/dist/vue/_virtual/_plugin-vue_export-helper.js +7 -0
  10. package/dist/vue/components/advanced-input/calendar.ce.js +216 -0
  11. package/dist/vue/components/advanced-input/date-range-picker.ce.js +224 -0
  12. package/dist/vue/components/advanced-input/editable.ce.js +160 -0
  13. package/dist/vue/components/advanced-input/mention.ce.js +181 -0
  14. package/dist/vue/components/advanced-input/range-slider.ce.js +111 -0
  15. package/dist/vue/components/advanced-input/time-range-picker.ce.js +120 -0
  16. package/dist/vue/components/advanced-input/transfer.ce.js +192 -0
  17. package/dist/vue/components/content/chart.ce.js +282 -0
  18. package/dist/vue/components/content/code-editor.ce.js +309 -0
  19. package/dist/vue/components/content/equation.ce.js +69 -0
  20. package/dist/vue/components/content/heatmap.ce.js +148 -0
  21. package/dist/vue/components/content/rich-text-editor.ce.js +319 -0
  22. package/dist/vue/components/core/badge.ce.js +66 -0
  23. package/dist/vue/components/core/button-group.ce.js +142 -0
  24. package/dist/vue/components/core/button.ce.js +73 -0
  25. package/dist/vue/components/core/card.ce.js +73 -0
  26. package/dist/vue/components/core/cascader.ce.js +329 -0
  27. package/dist/vue/components/core/checkbox.ce.js +116 -0
  28. package/dist/vue/components/core/code-block.ce.js +108 -0
  29. package/dist/vue/components/core/combobox.ce.js +354 -0
  30. package/dist/vue/components/core/date-picker.ce.js +433 -0
  31. package/dist/vue/components/core/dialog.ce.js +118 -0
  32. package/dist/vue/components/core/divider.ce.js +49 -0
  33. package/dist/vue/components/core/drawer.ce.js +235 -0
  34. package/dist/vue/components/core/empty-state.ce.js +58 -0
  35. package/dist/vue/components/core/icon-button.ce.js +93 -0
  36. package/dist/vue/components/core/icon.ce.js +42 -0
  37. package/dist/vue/components/core/layout.ce.js +68 -0
  38. package/dist/vue/components/core/menu.ce.js +178 -0
  39. package/dist/vue/components/core/notification.ce.js +158 -0
  40. package/dist/vue/components/core/pagination.ce.js +158 -0
  41. package/dist/vue/components/core/progress.ce.js +49 -0
  42. package/dist/vue/components/core/select.ce.js +325 -0
  43. package/dist/vue/components/core/slider.ce.js +116 -0
  44. package/dist/vue/components/core/switch.ce.js +100 -0
  45. package/dist/vue/components/core/tabs.ce.js +193 -0
  46. package/dist/vue/components/core/text-field.ce.js +194 -0
  47. package/dist/vue/components/core/time-picker.ce.js +486 -0
  48. package/dist/vue/components/core/tooltip.ce.js +125 -0
  49. package/dist/vue/components/core/tree.ce.js +248 -0
  50. package/dist/vue/components/core/virtual-scroll.ce.js +176 -0
  51. package/dist/vue/components/data/copy-button.ce.js +75 -0
  52. package/dist/vue/components/data/image-preview.ce.js +226 -0
  53. package/dist/vue/components/data/infinite-scroll.ce.js +126 -0
  54. package/dist/vue/components/data/long-text.ce.js +70 -0
  55. package/dist/vue/components/data/relative-time.ce.js +77 -0
  56. package/dist/vue/components/data/ring-progress.ce.js +87 -0
  57. package/dist/vue/components/data/table.ce.js +491 -0
  58. package/dist/vue/components/data/virtual-table.ce.js +178 -0
  59. package/dist/vue/components/data/virtual-tree.ce.js +213 -0
  60. package/dist/vue/components/display/alert.ce.js +101 -0
  61. package/dist/vue/components/display/avatar-group.ce.js +65 -0
  62. package/dist/vue/components/display/avatar.ce.js +84 -0
  63. package/dist/vue/components/display/blockquote.ce.js +44 -0
  64. package/dist/vue/components/display/countdown.ce.js +77 -0
  65. package/dist/vue/components/display/descriptions.ce.js +43 -0
  66. package/dist/vue/components/display/highlight.ce.js +48 -0
  67. package/dist/vue/components/display/image.ce.js +146 -0
  68. package/dist/vue/components/display/list.ce.js +68 -0
  69. package/dist/vue/components/display/result.ce.js +57 -0
  70. package/dist/vue/components/display/skeleton.ce.js +67 -0
  71. package/dist/vue/components/display/spinner.ce.js +42 -0
  72. package/dist/vue/components/display/statistic.ce.js +71 -0
  73. package/dist/vue/components/display/timeline.ce.js +59 -0
  74. package/dist/vue/components/form-completion/angle-slider.ce.js +103 -0
  75. package/dist/vue/components/form-completion/color-picker.ce.js +286 -0
  76. package/dist/vue/components/form-completion/date-field.ce.js +131 -0
  77. package/dist/vue/components/form-completion/dynamic-input.ce.js +158 -0
  78. package/dist/vue/components/form-completion/form.ce.js +248 -0
  79. package/dist/vue/components/form-completion/json-input.ce.js +114 -0
  80. package/dist/vue/components/form-completion/masked-input.ce.js +88 -0
  81. package/dist/vue/components/form-completion/period-picker.ce.js +147 -0
  82. package/dist/vue/components/form-completion/time-field.ce.js +120 -0
  83. package/dist/vue/components/form-completion/upload-manager.ce.js +223 -0
  84. package/dist/vue/components/foundation/banner.ce.js +106 -0
  85. package/dist/vue/components/foundation/error-state.ce.js +108 -0
  86. package/dist/vue/components/foundation/field-group.ce.js +146 -0
  87. package/dist/vue/components/foundation/flex.ce.js +60 -0
  88. package/dist/vue/components/foundation/grid.ce.js +52 -0
  89. package/dist/vue/components/foundation/input-group.ce.js +34 -0
  90. package/dist/vue/components/foundation/page-header.ce.js +55 -0
  91. package/dist/vue/components/foundation/time-display.ce.js +129 -0
  92. package/dist/vue/components/foundation/typography.ce.js +71 -0
  93. package/dist/vue/components/input/checkbox-group.ce.js +93 -0
  94. package/dist/vue/components/input/field.ce.js +74 -0
  95. package/dist/vue/components/input/file-upload.ce.js +142 -0
  96. package/dist/vue/components/input/number-field.ce.js +103 -0
  97. package/dist/vue/components/input/pin-input.ce.js +112 -0
  98. package/dist/vue/components/input/radio-group.ce.js +96 -0
  99. package/dist/vue/components/input/rating.ce.js +115 -0
  100. package/dist/vue/components/input/tags-input.ce.js +153 -0
  101. package/dist/vue/components/input/textarea.ce.js +180 -0
  102. package/dist/vue/components/input/toggle.ce.js +58 -0
  103. package/dist/vue/components/interaction/chip.ce.js +95 -0
  104. package/dist/vue/components/interaction/command.ce.js +161 -0
  105. package/dist/vue/components/interaction/context-menu.ce.js +113 -0
  106. package/dist/vue/components/interaction/hover-card.ce.js +92 -0
  107. package/dist/vue/components/interaction/loading-overlay.ce.js +70 -0
  108. package/dist/vue/components/interaction/menubar.ce.js +134 -0
  109. package/dist/vue/components/interaction/multi-select.ce.js +264 -0
  110. package/dist/vue/components/interaction/popconfirm.ce.js +95 -0
  111. package/dist/vue/components/interaction/popover.ce.js +83 -0
  112. package/dist/vue/components/interaction/tree-select.ce.js +195 -0
  113. package/dist/vue/components/navigation/accordion.ce.js +114 -0
  114. package/dist/vue/components/navigation/anchor.ce.js +125 -0
  115. package/dist/vue/components/navigation/back-top.ce.js +67 -0
  116. package/dist/vue/components/navigation/breadcrumb.ce.js +48 -0
  117. package/dist/vue/components/navigation/carousel.ce.js +114 -0
  118. package/dist/vue/components/navigation/collapsible.ce.js +57 -0
  119. package/dist/vue/components/navigation/link.ce.js +62 -0
  120. package/dist/vue/components/navigation/navigation-menu.ce.js +91 -0
  121. package/dist/vue/components/navigation/overflow-list.ce.js +67 -0
  122. package/dist/vue/components/navigation/scroll-area.ce.js +47 -0
  123. package/dist/vue/components/navigation/splitter.ce.js +131 -0
  124. package/dist/vue/components/navigation/stepper.ce.js +74 -0
  125. package/dist/vue/components/navigation/toolbar.ce.js +93 -0
  126. package/dist/vue/components/navigation/visually-hidden.ce.js +16 -0
  127. package/dist/vue/components/shell/app-shell.ce.js +87 -0
  128. package/dist/vue/components/shell/config-provider.ce.js +110 -0
  129. package/dist/vue/components/shell/marquee.ce.js +92 -0
  130. package/dist/vue/components/shell/masonry.ce.js +50 -0
  131. package/dist/vue/components/shell/sidebar.ce.js +125 -0
  132. package/dist/vue/components/utility/affix.ce.js +64 -0
  133. package/dist/vue/components/utility/alert-dialog.ce.js +124 -0
  134. package/dist/vue/components/utility/animated-number.ce.js +66 -0
  135. package/dist/vue/components/utility/float-button.ce.js +104 -0
  136. package/dist/vue/components/utility/listbox.ce.js +81 -0
  137. package/dist/vue/components/utility/loading-bar.ce.js +85 -0
  138. package/dist/vue/components/utility/log-viewer.ce.js +124 -0
  139. package/dist/vue/components/utility/notification-queue.ce.js +109 -0
  140. package/dist/vue/components/utility/progress-group.ce.js +59 -0
  141. package/dist/vue/components/utility/qr-code.ce.js +62 -0
  142. package/dist/vue/components/utility/tag-group.ce.js +124 -0
  143. package/dist/vue/components/utility/tour.ce.js +214 -0
  144. package/dist/vue/components/utility/virtual-select.ce.js +207 -0
  145. package/dist/vue/components/utility/watermark.ce.js +44 -0
  146. package/dist/vue/internal/menu-items.js +184 -0
  147. package/dist/vue/internal/navigation-items.js +110 -0
  148. package/dist/vue/utils/code-highlight.js +142 -0
  149. package/dist/vue/utils/config.js +47 -0
  150. package/dist/vue/utils/content-motion.js +37 -0
  151. package/dist/vue/utils/content.js +83 -0
  152. package/dist/vue/utils/display-status.js +31 -0
  153. package/dist/vue/utils/foundation.js +65 -0
  154. package/dist/vue/utils/input-state.js +38 -0
  155. package/dist/vue/utils/interaction.js +103 -0
  156. package/dist/vue/utils/local-date.js +48 -0
  157. package/dist/vue/utils/motion.js +80 -0
  158. package/dist/vue/utils/native-slots.js +30 -0
  159. package/dist/vue/utils/navigation.js +44 -0
  160. package/dist/vue/utils/notifications.js +60 -0
  161. package/dist/vue/utils/qr.js +20 -0
  162. package/dist/vue/utils/remote-options.js +65 -0
  163. package/dist/vue/utils/ripple.js +20 -0
  164. package/dist/vue/utils/scoped-slots.js +22 -0
  165. package/dist/vue/utils/shell.js +43 -0
  166. package/dist/vue/utils/theme.js +50 -0
  167. package/dist/vue/utils/utility-choice.js +56 -0
  168. package/package.json +105 -4
@@ -0,0 +1,235 @@
1
+ import { useNativeSlots as e } from "../../utils/native-slots.js";
2
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
3
+ import n from "./icon.ce.js";
4
+ /* empty css */
5
+ import { computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as ee, mergeProps as te, nextTick as s, normalizeStyle as ne, onBeforeUnmount as re, onMounted as ie, openBlock as c, ref as l, renderSlot as u, toDisplayString as d, unref as f, useAttrs as ae, useId as p, watch as m, withModifiers as h } from "vue";
6
+ import { Cancel01Icon as oe } from "@hugeicons/core-free-icons";
7
+ // src/components/core/drawer.ce.vue
8
+ var se = ["aria-labelledby", "aria-describedby"], ce = {
9
+ key: 1,
10
+ class: "kima-drawer__header"
11
+ }, le = { class: "kima-drawer__heading" }, g = {
12
+ key: 1,
13
+ class: "kima-drawer__header-slot"
14
+ }, ue = {
15
+ key: 3,
16
+ class: "kima-drawer__body"
17
+ }, de = {
18
+ key: 4,
19
+ class: "kima-drawer__footer"
20
+ }, _ = /*#__PURE__*/ t(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
21
+ __name: "drawer.ce",
22
+ props: {
23
+ open: {
24
+ type: Boolean,
25
+ default: !1
26
+ },
27
+ placement: {
28
+ type: String,
29
+ default: "bottom"
30
+ },
31
+ description: {
32
+ type: String,
33
+ default: ""
34
+ },
35
+ closeOnEscape: {
36
+ type: Boolean,
37
+ default: !0
38
+ },
39
+ closeOnBackdrop: {
40
+ type: Boolean,
41
+ default: !0
42
+ },
43
+ snapPoints: {
44
+ type: Array,
45
+ default: () => []
46
+ },
47
+ activeSnapPoint: {
48
+ type: Number,
49
+ default: null
50
+ }
51
+ },
52
+ emits: [
53
+ "update:open",
54
+ "close",
55
+ "update:activeSnapPoint"
56
+ ],
57
+ setup(t, { emit: _ }) {
58
+ let v = t, y = _, b = ae(), x = l(null), S = l(null), { hasNativeSlot: C, isCustomElement: w } = e(x), fe = r(() => w ? {
59
+ ...b,
60
+ id: void 0
61
+ } : b), T = l(v.open), E = r(() => [
62
+ "bottom",
63
+ "left",
64
+ "right"
65
+ ].includes(v.placement) ? v.placement : "bottom"), D = p(), O = `kima-drawer-title-${D}`, k = `kima-drawer-description-${D}`, A = l(0), j = l(!1), M = 0, N = r(() => E.value !== "bottom" || !v.snapPoints.length ? [] : [...new Set(v.snapPoints.map(Number))].filter((e) => Number.isFinite(e) && e > 0 && e <= 1).sort((e, t) => e - t)), P = l(null), F = r(() => v.activeSnapPoint == null ? P.value == null ? N.value[0] ?? null : P.value : v.activeSnapPoint), I = l(typeof window > "u" ? 0 : window.innerHeight);
66
+ function L() {
67
+ I.value = window.innerHeight;
68
+ }
69
+ let R = r(() => {
70
+ if (E.value !== "bottom" || F.value == null) return null;
71
+ let e = F.value * I.value;
72
+ return j.value ? Math.max(0, e - A.value) : e;
73
+ });
74
+ function z(e) {
75
+ E.value === "bottom" && e.button === 0 && (j.value = !0, M = e.clientY, e.currentTarget.setPointerCapture(e.pointerId));
76
+ }
77
+ function B(e) {
78
+ if (!j.value) return;
79
+ let t = e.clientY - M;
80
+ A.value = N.value.length ? t : Math.max(0, t);
81
+ }
82
+ function V() {
83
+ if (!j.value) return;
84
+ j.value = !1;
85
+ let e = A.value;
86
+ if (A.value = 0, E.value !== "bottom") return;
87
+ if (!N.value.length) {
88
+ e > (S.value?.offsetHeight ?? 300) * .4 && Q("drag");
89
+ return;
90
+ }
91
+ let t = I.value || 1, n = F.value * t - e;
92
+ n < N.value[0] * t * .6 ? Q("drag") : H(N.value.reduce((e, r) => Math.abs(r * t - n) < Math.abs(e * t - n) ? r : e));
93
+ }
94
+ function H(e) {
95
+ P.value = e, y("update:activeSnapPoint", e);
96
+ }
97
+ let pe = r(() => {
98
+ let e = {};
99
+ if (G.value && (e.transform = U.value, G.value === "entering" && (e.transition = "none")), E.value !== "bottom") return e;
100
+ if (N.value.length) {
101
+ let t = R.value;
102
+ return t != null && (e.height = `${t}px`, j.value && (e.transition = "none")), e;
103
+ }
104
+ return !G.value && A.value > 0 && (e.transform = `translateY(${A.value}px)`, j.value && (e.transition = "none")), e;
105
+ }), U = l("translateY(100%)");
106
+ function W() {
107
+ let e = S.value;
108
+ if (!e) return;
109
+ let { width: t, height: n } = e.getBoundingClientRect();
110
+ E.value === "bottom" ? U.value = `translateY(${n}px)` : E.value === "right" ? U.value = `translateX(${t}px)` : U.value = `translateX(-${t}px)`;
111
+ }
112
+ let G = l(""), me = r(() => G.value ? `kima-drawer--${G.value}` : ""), K = 0, q, J = !1, Y = "";
113
+ function X(e) {
114
+ if (e === J) return;
115
+ J = e;
116
+ let t = document.documentElement;
117
+ if (e) {
118
+ let e = window.innerWidth - t.clientWidth;
119
+ Y = t.style.paddingRight, e > 0 && (t.style.paddingRight = `${e}px`), t.style.overflowY = "hidden";
120
+ } else t.style.overflowY = "", t.style.paddingRight = Y, Y = "";
121
+ }
122
+ function Z() {
123
+ return new Promise((e) => {
124
+ requestAnimationFrame(() => requestAnimationFrame(e));
125
+ });
126
+ }
127
+ async function he(e) {
128
+ let t, n = new Promise((e) => {
129
+ t = e;
130
+ });
131
+ q = t;
132
+ try {
133
+ for (; e === K && S.value;) {
134
+ let e = S.value.getAnimations().filter((e) => e.transitionProperty === "transform" && e.playState !== "finished");
135
+ if (!e.length) return;
136
+ await Promise.race([Promise.allSettled(e.map((e) => e.finished)), n]);
137
+ }
138
+ } finally {
139
+ q === t && (q = void 0);
140
+ }
141
+ }
142
+ async function ge() {
143
+ let e = x.value;
144
+ if (!e) return;
145
+ let t = ++K;
146
+ q?.(), e.open || (X(!0), e.showModal()), W(), G.value = "entering", await s(), await Z(), t === K && G.value === "entering" && (G.value = "");
147
+ }
148
+ async function _e() {
149
+ let e = x.value;
150
+ if (!e?.open) return;
151
+ let t = ++K;
152
+ W(), G.value = "leaving", await s(), t === K && (await he(t), t === K && (await Z(), t === K && (e.open && e.close(), await s(), t === K && (G.value = "", N.value.length && v.activeSnapPoint == null && (P.value = null), X(!1)))));
153
+ }
154
+ function Q(e = "close") {
155
+ T.value && (A.value = 0, T.value = !1, y("update:open", !1), y("close", e));
156
+ }
157
+ function $() {
158
+ x.value && (T.value ? ge() : _e());
159
+ }
160
+ m(() => v.open, (e) => {
161
+ T.value = e;
162
+ });
163
+ function ve(e) {
164
+ e.preventDefault(), v.closeOnEscape && Q("escape");
165
+ }
166
+ function ye() {
167
+ x.value && !x.value.open && (X(!1), Q("native"));
168
+ }
169
+ function be(e) {
170
+ if (e.key !== "Tab" || !x.value) return;
171
+ let t = [...x.value.querySelectorAll("button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex='-1'])")];
172
+ if (!t.length) return;
173
+ let n = t[0], r = t[t.length - 1];
174
+ e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus());
175
+ }
176
+ return m(T, $, { flush: "post" }), ie(() => {
177
+ $(), window.addEventListener("resize", L);
178
+ }), re(() => {
179
+ ++K, q?.(), S.value?.getAnimations().forEach((e) => e.cancel()), window.removeEventListener("resize", L), x.value?.open && x.value.close(), X(!1);
180
+ }), (e, r) => (c(), a("dialog", te({
181
+ ref_key: "dialog",
182
+ ref: x
183
+ }, fe.value, {
184
+ title: void 0,
185
+ class: ["kima-drawer", [
186
+ `kima-drawer--${E.value}`,
187
+ { "kima-drawer--snapping": N.value.length > 0 },
188
+ me.value
189
+ ]],
190
+ "aria-labelledby": f(b).title ? O : f(b)["aria-labelledby"],
191
+ "aria-describedby": [f(b)["aria-describedby"], t.description ? k : void 0].filter(Boolean).join(" ") || void 0,
192
+ onCancel: h(ve, ["stop"]),
193
+ onClose: h(ye, ["stop"]),
194
+ onKeydown: be,
195
+ onClick: r[1] ||= h((e) => t.closeOnBackdrop && Q("backdrop"), ["self"])
196
+ }), [o("div", {
197
+ ref_key: "panel",
198
+ ref: S,
199
+ class: "kima-drawer__panel",
200
+ style: ne(pe.value)
201
+ }, [
202
+ E.value === "bottom" ? (c(), a("div", {
203
+ key: 0,
204
+ class: "kima-drawer__handle",
205
+ "aria-hidden": "true",
206
+ onPointerdown: z,
207
+ onPointermove: B,
208
+ onPointerup: V,
209
+ onPointercancel: V
210
+ }, null, 32)) : i("", !0),
211
+ f(b).title || e.$slots.header || f(C)("header") ? (c(), a("header", ce, [o("div", le, [f(b).title ? (c(), a("h2", {
212
+ key: 0,
213
+ id: O,
214
+ class: "kima-drawer__title"
215
+ }, d(f(b).title), 1)) : i("", !0), e.$slots.header || f(C)("header") ? (c(), a("div", g, [u(e.$slots, "header", {}, void 0, !0)])) : i("", !0)]), o("button", {
216
+ class: "kima-drawer__close",
217
+ type: "button",
218
+ "aria-label": "关闭",
219
+ onClick: r[0] ||= (e) => Q("button")
220
+ }, [ee(n, {
221
+ icon: f(oe),
222
+ size: 20,
223
+ color: "currentColor"
224
+ }, null, 8, ["icon"])])])) : i("", !0),
225
+ t.description ? (c(), a("p", {
226
+ key: 2,
227
+ id: k,
228
+ class: "kima-drawer__description"
229
+ }, d(t.description), 1)) : i("", !0),
230
+ e.$slots.default || f(C)("default") ? (c(), a("div", ue, [u(e.$slots, "default", {}, void 0, !0)])) : i("", !0),
231
+ e.$slots.footer || f(C)("footer") ? (c(), a("footer", de, [u(e.$slots, "footer", {}, void 0, !0)])) : i("", !0)
232
+ ], 4)], 16, se));
233
+ }
234
+ }), [["__scopeId", "data-v-f4c35e3a"]]);
235
+ export { _ as default };
@@ -0,0 +1,58 @@
1
+ import { useNativeSlots as e } from "../../utils/native-slots.js";
2
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
3
+ /* empty css */
4
+ import { computed as n, createCommentVNode as r, createElementBlock as i, mergeProps as a, openBlock as o, ref as s, renderSlot as c, toDisplayString as l, unref as u, useAttrs as d } from "vue";
5
+ // src/components/core/empty-state.ce.vue
6
+ var f = {
7
+ key: 0,
8
+ class: "kima-empty-state__icon",
9
+ "aria-hidden": "true"
10
+ }, p = {
11
+ key: 1,
12
+ class: "kima-empty-state__title"
13
+ }, m = {
14
+ key: 2,
15
+ class: "kima-empty-state__description"
16
+ }, h = {
17
+ key: 3,
18
+ class: "kima-empty-state__action"
19
+ }, g = /*#__PURE__*/ t(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
20
+ __name: "empty-state.ce",
21
+ props: {
22
+ heading: {
23
+ type: String,
24
+ default: void 0
25
+ },
26
+ description: {
27
+ type: String,
28
+ default: ""
29
+ },
30
+ compact: Boolean
31
+ },
32
+ setup(t) {
33
+ let g = d(), _ = s(null), { hasNativeSlot: v, isCustomElement: y } = e(_), b = n(() => y ? {
34
+ ...g,
35
+ id: void 0
36
+ } : g);
37
+ return (e, n) => (o(), i("section", a({
38
+ ref_key: "root",
39
+ ref: _
40
+ }, {
41
+ ...b.value,
42
+ title: void 0
43
+ }, {
44
+ class: ["kima-empty-state", {
45
+ "kima-empty-state--compact": t.compact,
46
+ "kima-empty-state--native": u(y)
47
+ }],
48
+ role: "status",
49
+ "aria-atomic": "true"
50
+ }), [
51
+ e.$slots.icon || e.$slots.default || u(v)("icon") || u(v)("default") || u(y) ? (o(), i("div", f, [c(e.$slots, "icon", {}, () => [c(e.$slots, "default", {}, void 0, !0)], !0)])) : r("", !0),
52
+ t.heading ?? u(g).title ?? "暂无内容" ? (o(), i("h2", p, l(t.heading ?? u(g).title ?? "暂无内容"), 1)) : r("", !0),
53
+ t.description ? (o(), i("p", m, l(t.description), 1)) : r("", !0),
54
+ e.$slots.action || u(v)("action") || u(y) ? (o(), i("div", h, [c(e.$slots, "action", {}, void 0, !0)])) : r("", !0)
55
+ ], 16));
56
+ }
57
+ }), [["__scopeId", "data-v-6fcab7b8"]]);
58
+ export { g as default };
@@ -0,0 +1,93 @@
1
+ import { useRipple as e } from "../../utils/ripple.js";
2
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
3
+ import n from "./icon.ce.js";
4
+ /* empty css */
5
+ import { Transition as r, computed as i, createElementBlock as a, createElementVNode as o, createVNode as s, getCurrentInstance as c, mergeProps as l, openBlock as u, ref as d, renderSlot as f, unref as p, useAttrs as m, withCtx as h } from "vue";
6
+ import { Settings01Icon as g } from "@hugeicons/core-free-icons";
7
+ // src/components/core/icon-button.ce.vue
8
+ var _ = [
9
+ "type",
10
+ "disabled",
11
+ "aria-label",
12
+ "aria-busy",
13
+ "title"
14
+ ], v = {
15
+ class: "kima-icon-button__visual",
16
+ "aria-hidden": "true"
17
+ }, y = {
18
+ key: "spinner",
19
+ class: "kima-icon-button__spinner"
20
+ }, b = {
21
+ key: "icon",
22
+ class: "kima-icon-button__icon"
23
+ }, x = /*#__PURE__*/ t(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
24
+ __name: "icon-button.ce",
25
+ props: {
26
+ icon: {
27
+ type: [Object, Array],
28
+ default: null
29
+ },
30
+ label: {
31
+ type: String,
32
+ default: ""
33
+ },
34
+ variant: {
35
+ type: String,
36
+ default: "standard"
37
+ },
38
+ size: {
39
+ type: String,
40
+ default: "default"
41
+ },
42
+ disabled: Boolean,
43
+ loading: Boolean,
44
+ type: {
45
+ type: String,
46
+ default: "button"
47
+ }
48
+ },
49
+ setup(t) {
50
+ let x = t, S = m(), C = d(null), w = !!c()?.ce, T = i(() => w ? {
51
+ ...S,
52
+ id: void 0
53
+ } : S);
54
+ e(C);
55
+ let E = i(() => [
56
+ "standard",
57
+ "filled",
58
+ "tonal",
59
+ "outlined",
60
+ "text"
61
+ ].includes(x.variant) ? x.variant : "standard"), D = i(() => [
62
+ "small",
63
+ "default",
64
+ "large"
65
+ ].includes(x.size) ? x.size : "default");
66
+ function O() {
67
+ return x.label || S["aria-label"] || S.ariaLabel || S.title || "图标按钮";
68
+ }
69
+ let k = i(() => x.icon || g), A = i(() => ({
70
+ small: 20,
71
+ default: 24,
72
+ large: 24
73
+ })[D.value]);
74
+ return (e, i) => (u(), a("button", l({
75
+ ref_key: "root",
76
+ ref: C
77
+ }, T.value, {
78
+ class: ["kima-icon-button", [`kima-icon-button--${E.value}`, `kima-icon-button--${D.value}`]],
79
+ type: t.type,
80
+ disabled: t.disabled || t.loading,
81
+ "aria-label": O(),
82
+ "aria-busy": t.loading || void 0,
83
+ title: p(S).title || O()
84
+ }), [o("span", v, [s(r, { name: "kima-fade" }, {
85
+ default: h(() => [t.loading ? (u(), a("span", y)) : (u(), a("span", b, [f(e.$slots, "default", {}, () => [s(n, {
86
+ icon: k.value,
87
+ size: A.value
88
+ }, null, 8, ["icon", "size"])], !0)]))]),
89
+ _: 3
90
+ })])], 16, _));
91
+ }
92
+ }), [["__scopeId", "data-v-a18b4478"]]);
93
+ export { x as default };
@@ -0,0 +1,42 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ /* empty css */
3
+ import { createBlock as t, openBlock as n, unref as r } from "vue";
4
+ import { HugeiconsIcon as i } from "@hugeicons/vue";
5
+ var a = /*#__PURE__*/ e({
6
+ __name: "icon.ce",
7
+ props: {
8
+ icon: {
9
+ type: [Object, Array],
10
+ required: !0
11
+ },
12
+ size: {
13
+ type: [Number, String],
14
+ default: 24
15
+ },
16
+ color: {
17
+ type: String,
18
+ default: "currentColor"
19
+ },
20
+ strokeWidth: {
21
+ type: Number,
22
+ default: 2
23
+ }
24
+ },
25
+ setup(e) {
26
+ let a = e;
27
+ return (e, o) => (n(), t(r(i), {
28
+ class: "kima-icon",
29
+ icon: a.icon,
30
+ size: a.size,
31
+ color: a.color,
32
+ "stroke-width": a.strokeWidth,
33
+ "absolute-stroke-width": ""
34
+ }, null, 8, [
35
+ "icon",
36
+ "size",
37
+ "color",
38
+ "stroke-width"
39
+ ]));
40
+ }
41
+ }, [["__scopeId", "data-v-5c94f2ca"]]);
42
+ export { a as default };
@@ -0,0 +1,68 @@
1
+ import { useNativeSlots as e } from "../../utils/native-slots.js";
2
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
3
+ /* empty css */
4
+ import { computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, mergeProps as o, openBlock as s, ref as c, renderSlot as l, resolveDynamicComponent as u, unref as d, useAttrs as f, withCtx as p } from "vue";
5
+ // src/components/core/layout.ce.vue
6
+ var m = {
7
+ key: 0,
8
+ class: "kima-layout__header"
9
+ }, h = {
10
+ key: 1,
11
+ class: "kima-layout__content"
12
+ }, g = {
13
+ key: 2,
14
+ class: "kima-layout__footer"
15
+ }, _ = /*#__PURE__*/ t(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
16
+ __name: "layout.ce",
17
+ props: {
18
+ as: {
19
+ type: String,
20
+ default: "main"
21
+ },
22
+ variant: {
23
+ type: String,
24
+ default: "page"
25
+ },
26
+ maxWidth: {
27
+ type: [String, Number],
28
+ default: 920
29
+ },
30
+ gap: {
31
+ type: [String, Number],
32
+ default: 24
33
+ },
34
+ padding: {
35
+ type: [String, Number],
36
+ default: void 0
37
+ }
38
+ },
39
+ setup(t) {
40
+ let _ = t, v = f(), y = c(null), { hasNativeSlot: b, isCustomElement: x } = e(y), S = n(() => x ? {
41
+ ...v,
42
+ id: void 0
43
+ } : v), C = n(() => [
44
+ "main",
45
+ "section",
46
+ "div"
47
+ ].includes(_.as) ? _.as : "main"), w = n(() => ["page", "panel"].includes(_.variant) ? _.variant : "page"), T = (e) => typeof e == "number" || typeof e == "string" && /^\d+(?:\.\d+)?$/.test(e.trim()) ? `${e}px` : e, E = n(() => ({
48
+ "--kima-layout-max-width": T(_.maxWidth),
49
+ "--kima-layout-gap": T(_.gap),
50
+ "--kima-layout-padding": _.padding === void 0 ? void 0 : T(_.padding)
51
+ }));
52
+ return (e, t) => (s(), r(u(C.value), o({
53
+ ref_key: "root",
54
+ ref: y
55
+ }, S.value, {
56
+ class: ["kima-layout", `kima-layout--${w.value}`],
57
+ style: E.value
58
+ }), {
59
+ default: p(() => [
60
+ e.$slots.header || d(b)("header") ? (s(), a("header", m, [l(e.$slots, "header", {}, void 0, !0)])) : i("", !0),
61
+ e.$slots.default || d(b)("default") ? (s(), a("div", h, [l(e.$slots, "default", {}, void 0, !0)])) : i("", !0),
62
+ e.$slots.footer || d(b)("footer") ? (s(), a("footer", g, [l(e.$slots, "footer", {}, void 0, !0)])) : i("", !0)
63
+ ]),
64
+ _: 3
65
+ }, 16, ["class", "style"]));
66
+ }
67
+ }), [["__scopeId", "data-v-c0d57820"]]);
68
+ export { _ as default };
@@ -0,0 +1,178 @@
1
+ import { useRipple as e } from "../../utils/ripple.js";
2
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
3
+ import n from "./icon.ce.js";
4
+ import { presenceTransition as r } from "../../utils/motion.js";
5
+ import { dismissInteraction as ee, flattenChoices as i, useInteractionRoot as a, usePlacement as o } from "../../utils/interaction.js";
6
+ import { useMenuChecks as s, useShellModel as c } from "../../utils/shell.js";
7
+ import te from "../../internal/menu-items.js";
8
+ /* empty css */
9
+ import { Transition as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createVNode as h, mergeProps as g, nextTick as _, openBlock as v, ref as y, renderSlot as b, toDisplayString as x, unref as S, useId as C, vModelText as w, watch as T, withCtx as E, withDirectives as ne, withModifiers as D } from "vue";
10
+ import { DropdownMenuContent as re, DropdownMenuRoot as O, DropdownMenuTrigger as k } from "reka-ui";
11
+ import { ArrowDown01Icon as A, Search01Icon as j } from "@hugeicons/core-free-icons";
12
+ // src/components/core/menu.ce.vue
13
+ var M = ["disabled"], N = {
14
+ key: 0,
15
+ class: "kima-menu__search-wrap"
16
+ }, P = {
17
+ key: 1,
18
+ role: "status"
19
+ }, F = /*#__PURE__*/ t(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
20
+ __name: "menu.ce",
21
+ props: {
22
+ open: Boolean,
23
+ modelValue: {
24
+ type: [
25
+ String,
26
+ Number,
27
+ Boolean,
28
+ Object,
29
+ Array
30
+ ],
31
+ default: null
32
+ },
33
+ items: {
34
+ type: Array,
35
+ default: () => []
36
+ },
37
+ label: {
38
+ type: String,
39
+ default: "选择项目"
40
+ },
41
+ disabled: Boolean,
42
+ placement: {
43
+ type: String,
44
+ default: "bottom-start"
45
+ },
46
+ searchable: Boolean,
47
+ checked: {
48
+ type: Object,
49
+ default: () => ({})
50
+ }
51
+ },
52
+ emits: [
53
+ "update:open",
54
+ "update:modelValue",
55
+ "change",
56
+ "select",
57
+ "update:checked",
58
+ "check"
59
+ ],
60
+ setup(t, { emit: F }) {
61
+ let I = t, L = F, { root: R, forwardedAttrs: z } = a(), [B, V] = c(I, "open", L), [H, U] = c(I, "modelValue", L), { checked: W, check: G } = s(I, L), K = y(null), q = y(null), J = y("");
62
+ e(K);
63
+ let Y = `kima-menu-${C()}`, ie = o(I), X = u(() => i(I.items).find((e) => Object.is(e.value, H.value)) || null);
64
+ function Z(e, t) {
65
+ return e.flatMap((e) => {
66
+ let n = e.children ? Z(e.children, t) : [];
67
+ return `${e.label} ${e.description || ""}`.toLocaleLowerCase().includes(t) ? [e] : n.length ? [{
68
+ ...e,
69
+ children: n
70
+ }] : [];
71
+ });
72
+ }
73
+ let Q = u(() => Z(I.items, J.value.trim().toLocaleLowerCase()));
74
+ function $(e) {
75
+ e && I.disabled || (e && (J.value = ""), V(e));
76
+ }
77
+ function ae(e) {
78
+ I.disabled || e.disabled || (Object.is(H.value, e.value) || (U(e.value), L("change", e.value)), L("select", e.value, e), $(!1));
79
+ }
80
+ function oe(e) {
81
+ if (e.key === "Escape") e.preventDefault(), $(!1), K.value?.focus();
82
+ else if (e.key === "Tab") $(!1);
83
+ else if ([
84
+ "ArrowDown",
85
+ "ArrowUp",
86
+ "Enter"
87
+ ].includes(e.key)) {
88
+ e.preventDefault();
89
+ let t = R.value.querySelectorAll("[role^=\"menuitem\"]:not([data-disabled])"), n = e.key === "ArrowUp" ? t[t.length - 1] : t[0];
90
+ e.key === "Enter" ? n?.click() : n?.focus();
91
+ }
92
+ }
93
+ return T(() => I.disabled, (e) => {
94
+ e && $(!1);
95
+ }), T(B, (e) => {
96
+ e && I.searchable && _(() => q.value?.focus());
97
+ }), (e, i) => (v(), p("div", g({
98
+ ref_key: "root",
99
+ ref: R
100
+ }, S(z), { class: ["kima-menu", { "kima-menu--open": S(B) }] }), [h(S(O), {
101
+ open: S(B) && !t.disabled,
102
+ modal: !1,
103
+ "onUpdate:open": $
104
+ }, {
105
+ default: E(() => [h(S(k), { "as-child": "" }, {
106
+ default: E(() => [m("button", {
107
+ ref_key: "trigger",
108
+ ref: K,
109
+ type: "button",
110
+ class: "kima-menu__trigger",
111
+ disabled: t.disabled
112
+ }, [b(e.$slots, "trigger", {
113
+ open: S(B),
114
+ selectedItem: X.value,
115
+ value: S(H)
116
+ }, () => [m("span", null, x(X.value?.label || t.label), 1)], !0), h(n, {
117
+ icon: S(A),
118
+ size: 20,
119
+ "aria-hidden": "true"
120
+ }, null, 8, ["icon"])], 8, M)]),
121
+ _: 3
122
+ }), h(l, g({ name: "kima-popup" }, S(r)), {
123
+ default: E(() => [S(B) && !t.disabled ? (v(), d(S(re), g({
124
+ key: 0,
125
+ id: Y,
126
+ "force-mount": ""
127
+ }, S(ie), {
128
+ class: "kima-menu__popup",
129
+ "aria-label": t.label,
130
+ loop: "",
131
+ onEscapeKeyDown: i[3] ||= (e) => S(ee)(e, () => $(!1)),
132
+ onOpenAutoFocus: i[4] ||= (e) => {
133
+ t.searchable && (e.preventDefault(), _(() => q.value?.focus()));
134
+ }
135
+ }), {
136
+ default: E(() => [
137
+ t.searchable ? (v(), p("div", N, [h(n, {
138
+ icon: S(j),
139
+ size: 18,
140
+ "aria-hidden": "true"
141
+ }, null, 8, ["icon"]), ne(m("input", {
142
+ ref_key: "searchInput",
143
+ ref: q,
144
+ "onUpdate:modelValue": i[0] ||= (e) => J.value = e,
145
+ type: "search",
146
+ class: "kima-menu__search",
147
+ role: "searchbox",
148
+ "aria-label": "搜索菜单项",
149
+ onInput: i[1] ||= D(() => {}, ["stop"]),
150
+ onChange: i[2] ||= D(() => {}, ["stop"]),
151
+ onKeydown: D(oe, ["stop"])
152
+ }, null, 544), [[w, J.value]])])) : f("", !0),
153
+ h(te, {
154
+ items: Q.value,
155
+ checked: S(W),
156
+ "model-value": S(H),
157
+ selection: "",
158
+ disabled: t.disabled,
159
+ onSelect: ae,
160
+ onCheck: S(G)
161
+ }, null, 8, [
162
+ "items",
163
+ "checked",
164
+ "model-value",
165
+ "disabled",
166
+ "onCheck"
167
+ ]),
168
+ Q.value.length ? f("", !0) : (v(), p("div", P, "没有匹配项目"))
169
+ ]),
170
+ _: 1
171
+ }, 16, ["aria-label"])) : f("", !0)]),
172
+ _: 1
173
+ }, 16)]),
174
+ _: 3
175
+ }, 8, ["open"])], 16));
176
+ }
177
+ }), [["__scopeId", "data-v-754442d3"]]);
178
+ export { F as default };