@guoyg578/k-ui 0.1.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 (179) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +59 -0
  3. package/dist/_virtual/_plugin-vue_export-helper.js +8 -0
  4. package/dist/components/KAlert.js +7 -0
  5. package/dist/components/KAlert.vue.d.ts +40 -0
  6. package/dist/components/KAlert.vue_vue_type_script_setup_true_lang.js +76 -0
  7. package/dist/components/KAvatar.js +7 -0
  8. package/dist/components/KAvatar.vue.d.ts +15 -0
  9. package/dist/components/KAvatar.vue_vue_type_script_setup_true_lang.js +53 -0
  10. package/dist/components/KAvatarGroup.js +7 -0
  11. package/dist/components/KAvatarGroup.vue.d.ts +18 -0
  12. package/dist/components/KAvatarGroup.vue_vue_type_script_setup_true_lang.js +11 -0
  13. package/dist/components/KBreadcrumb.js +7 -0
  14. package/dist/components/KBreadcrumb.vue.d.ts +12 -0
  15. package/dist/components/KBreadcrumb.vue_vue_type_script_setup_true_lang.js +38 -0
  16. package/dist/components/KButton.js +7 -0
  17. package/dist/components/KButton.vue.d.ts +36 -0
  18. package/dist/components/KButton.vue_vue_type_script_setup_true_lang.js +50 -0
  19. package/dist/components/KCard.js +7 -0
  20. package/dist/components/KCard.vue.d.ts +33 -0
  21. package/dist/components/KCard.vue_vue_type_script_setup_true_lang.js +50 -0
  22. package/dist/components/KCarousel.js +7 -0
  23. package/dist/components/KCarousel.vue.d.ts +59 -0
  24. package/dist/components/KCarousel.vue_vue_type_script_setup_true_lang.js +141 -0
  25. package/dist/components/KCheckbox.js +7 -0
  26. package/dist/components/KCheckbox.vue.d.ts +26 -0
  27. package/dist/components/KCheckbox.vue_vue_type_script_setup_true_lang.js +48 -0
  28. package/dist/components/KCheckboxGroup.js +7 -0
  29. package/dist/components/KCheckboxGroup.vue.d.ts +27 -0
  30. package/dist/components/KCheckboxGroup.vue_vue_type_script_setup_true_lang.js +36 -0
  31. package/dist/components/KCombobox.js +8 -0
  32. package/dist/components/KCombobox.vue.d.ts +28 -0
  33. package/dist/components/KCombobox.vue_vue_type_script_setup_true_lang.js +120 -0
  34. package/dist/components/KCommandPalette.js +7 -0
  35. package/dist/components/KCommandPalette.vue.d.ts +31 -0
  36. package/dist/components/KCommandPalette.vue_vue_type_script_setup_true_lang.js +169 -0
  37. package/dist/components/KConfirmDialog.js +6 -0
  38. package/dist/components/KConfirmDialog.vue.d.ts +3 -0
  39. package/dist/components/KConfirmDialog.vue_vue_type_script_setup_true_lang.js +48 -0
  40. package/dist/components/KDataTable.js +7 -0
  41. package/dist/components/KDataTable.vue.d.ts +47 -0
  42. package/dist/components/KDataTable.vue_vue_type_script_setup_true_lang.js +62 -0
  43. package/dist/components/KDatePicker.js +6 -0
  44. package/dist/components/KDatePicker.vue.d.ts +19 -0
  45. package/dist/components/KDatePicker.vue_vue_type_script_setup_true_lang.js +57 -0
  46. package/dist/components/KDialog.js +7 -0
  47. package/dist/components/KDialog.vue.d.ts +52 -0
  48. package/dist/components/KDialog.vue_vue_type_script_setup_true_lang.js +117 -0
  49. package/dist/components/KDiff.js +7 -0
  50. package/dist/components/KDiff.vue.d.ts +13 -0
  51. package/dist/components/KDiff.vue_vue_type_script_setup_true_lang.js +116 -0
  52. package/dist/components/KDrawer.js +7 -0
  53. package/dist/components/KDrawer.vue.d.ts +37 -0
  54. package/dist/components/KDrawer.vue_vue_type_script_setup_true_lang.js +81 -0
  55. package/dist/components/KDropdown.js +7 -0
  56. package/dist/components/KDropdown.vue.d.ts +56 -0
  57. package/dist/components/KDropdown.vue_vue_type_script_setup_true_lang.js +93 -0
  58. package/dist/components/KEmpty.js +5 -0
  59. package/dist/components/KEmpty.vue.d.ts +22 -0
  60. package/dist/components/KEmpty.vue_vue_type_script_setup_true_lang.js +30 -0
  61. package/dist/components/KForm.js +7 -0
  62. package/dist/components/KForm.vue.d.ts +38 -0
  63. package/dist/components/KForm.vue_vue_type_script_setup_true_lang.js +69 -0
  64. package/dist/components/KFormField.js +7 -0
  65. package/dist/components/KFormField.vue.d.ts +32 -0
  66. package/dist/components/KFormField.vue_vue_type_script_setup_true_lang.js +84 -0
  67. package/dist/components/KGridSkeleton.js +5 -0
  68. package/dist/components/KGridSkeleton.vue.d.ts +10 -0
  69. package/dist/components/KGridSkeleton.vue_vue_type_script_setup_true_lang.js +21 -0
  70. package/dist/components/KImage.js +7 -0
  71. package/dist/components/KImage.vue.d.ts +25 -0
  72. package/dist/components/KImage.vue_vue_type_script_setup_true_lang.js +97 -0
  73. package/dist/components/KImageViewer.js +7 -0
  74. package/dist/components/KImageViewer.vue.d.ts +14 -0
  75. package/dist/components/KImageViewer.vue_vue_type_script_setup_true_lang.js +108 -0
  76. package/dist/components/KInput.js +7 -0
  77. package/dist/components/KInput.vue.d.ts +43 -0
  78. package/dist/components/KInput.vue_vue_type_script_setup_true_lang.js +89 -0
  79. package/dist/components/KInputNumber.js +7 -0
  80. package/dist/components/KInputNumber.vue.d.ts +28 -0
  81. package/dist/components/KInputNumber.vue_vue_type_script_setup_true_lang.js +109 -0
  82. package/dist/components/KListSkeleton.js +5 -0
  83. package/dist/components/KListSkeleton.vue.d.ts +8 -0
  84. package/dist/components/KListSkeleton.vue_vue_type_script_setup_true_lang.js +14 -0
  85. package/dist/components/KLoadingOverlay.js +7 -0
  86. package/dist/components/KLoadingOverlay.vue.d.ts +11 -0
  87. package/dist/components/KLoadingOverlay.vue_vue_type_script_setup_true_lang.js +34 -0
  88. package/dist/components/KMessage.d.ts +20 -0
  89. package/dist/components/KMessage.js +55 -0
  90. package/dist/components/KMessageContainer.js +7 -0
  91. package/dist/components/KMessageContainer.vue.d.ts +15 -0
  92. package/dist/components/KMessageContainer.vue_vue_type_script_setup_true_lang.js +41 -0
  93. package/dist/components/KPagination.js +7 -0
  94. package/dist/components/KPagination.vue.d.ts +14 -0
  95. package/dist/components/KPagination.vue_vue_type_script_setup_true_lang.js +104 -0
  96. package/dist/components/KPopover.js +6 -0
  97. package/dist/components/KPopover.vue.d.ts +40 -0
  98. package/dist/components/KPopover.vue_vue_type_script_setup_true_lang.js +63 -0
  99. package/dist/components/KProgress.js +7 -0
  100. package/dist/components/KProgress.vue.d.ts +21 -0
  101. package/dist/components/KProgress.vue_vue_type_script_setup_true_lang.js +108 -0
  102. package/dist/components/KRadio.js +7 -0
  103. package/dist/components/KRadio.vue.d.ts +18 -0
  104. package/dist/components/KRadio.vue_vue_type_script_setup_true_lang.js +26 -0
  105. package/dist/components/KRadioGroup.js +7 -0
  106. package/dist/components/KRadioGroup.vue.d.ts +26 -0
  107. package/dist/components/KRadioGroup.vue_vue_type_script_setup_true_lang.js +32 -0
  108. package/dist/components/KRefetchOverlay.js +5 -0
  109. package/dist/components/KRefetchOverlay.vue.d.ts +8 -0
  110. package/dist/components/KRefetchOverlay.vue_vue_type_script_setup_true_lang.js +26 -0
  111. package/dist/components/KResizablePanel.js +7 -0
  112. package/dist/components/KResizablePanel.vue.d.ts +30 -0
  113. package/dist/components/KResizablePanel.vue_vue_type_script_setup_true_lang.js +57 -0
  114. package/dist/components/KResult.js +7 -0
  115. package/dist/components/KResult.vue.d.ts +29 -0
  116. package/dist/components/KResult.vue_vue_type_script_setup_true_lang.js +82 -0
  117. package/dist/components/KSearchBar.js +5 -0
  118. package/dist/components/KSearchBar.vue.d.ts +11 -0
  119. package/dist/components/KSearchBar.vue_vue_type_script_setup_true_lang.js +38 -0
  120. package/dist/components/KSelect.js +9 -0
  121. package/dist/components/KSelect.vue.d.ts +22 -0
  122. package/dist/components/KSelect.vue_vue_type_script_setup_true_lang.js +96 -0
  123. package/dist/components/KSkeleton.js +7 -0
  124. package/dist/components/KSkeleton.vue.d.ts +14 -0
  125. package/dist/components/KSkeleton.vue_vue_type_script_setup_true_lang.js +27 -0
  126. package/dist/components/KSteps.js +7 -0
  127. package/dist/components/KSteps.vue.d.ts +20 -0
  128. package/dist/components/KSteps.vue_vue_type_script_setup_true_lang.js +39 -0
  129. package/dist/components/KSwitch.js +7 -0
  130. package/dist/components/KSwitch.vue.d.ts +16 -0
  131. package/dist/components/KSwitch.vue_vue_type_script_setup_true_lang.js +35 -0
  132. package/dist/components/KTabs.js +7 -0
  133. package/dist/components/KTabs.vue.d.ts +35 -0
  134. package/dist/components/KTabs.vue_vue_type_script_setup_true_lang.js +47 -0
  135. package/dist/components/KTag.js +7 -0
  136. package/dist/components/KTag.vue.d.ts +32 -0
  137. package/dist/components/KTag.vue_vue_type_script_setup_true_lang.js +40 -0
  138. package/dist/components/KTextarea.js +7 -0
  139. package/dist/components/KTextarea.vue.d.ts +23 -0
  140. package/dist/components/KTextarea.vue_vue_type_script_setup_true_lang.js +51 -0
  141. package/dist/components/KThemeToggleButton.js +7 -0
  142. package/dist/components/KThemeToggleButton.vue.d.ts +14 -0
  143. package/dist/components/KThemeToggleButton.vue_vue_type_script_setup_true_lang.js +48 -0
  144. package/dist/components/KTooltip.js +6 -0
  145. package/dist/components/KTooltip.vue.d.ts +23 -0
  146. package/dist/components/KTooltip.vue_vue_type_script_setup_true_lang.js +49 -0
  147. package/dist/components/KTreeNode.js +7 -0
  148. package/dist/components/KTreeNode.vue.d.ts +8 -0
  149. package/dist/components/KTreeNode.vue_vue_type_script_setup_true_lang.js +47 -0
  150. package/dist/components/KTreeView.js +7 -0
  151. package/dist/components/KTreeView.vue.d.ts +22 -0
  152. package/dist/components/KTreeView.vue_vue_type_script_setup_true_lang.js +45 -0
  153. package/dist/components/KUpload.js +7 -0
  154. package/dist/components/KUpload.vue.d.ts +81 -0
  155. package/dist/components/KUpload.vue_vue_type_script_setup_true_lang.js +181 -0
  156. package/dist/components/KVirtualList.js +7 -0
  157. package/dist/components/KVirtualList.vue.d.ts +31 -0
  158. package/dist/components/KVirtualList.vue_vue_type_script_setup_true_lang.js +41 -0
  159. package/dist/components/form-context.d.ts +25 -0
  160. package/dist/components/form-context.js +4 -0
  161. package/dist/components/tree-context.d.ts +16 -0
  162. package/dist/components/tree-context.js +4 -0
  163. package/dist/composables/useConfirm.d.ts +17 -0
  164. package/dist/composables/useConfirm.js +31 -0
  165. package/dist/directives/index.d.ts +6 -0
  166. package/dist/directives/index.js +8 -0
  167. package/dist/directives/reveal.d.ts +20 -0
  168. package/dist/directives/reveal.js +18 -0
  169. package/dist/directives/spotlight.d.ts +22 -0
  170. package/dist/directives/spotlight.js +25 -0
  171. package/dist/index.d.ts +62 -0
  172. package/dist/index.js +55 -0
  173. package/dist/k-ui.css +2 -0
  174. package/dist/styles/components.css +92 -0
  175. package/dist/styles/index.css +2 -0
  176. package/dist/styles/menu.css +59 -0
  177. package/dist/styles/tokens.css +229 -0
  178. package/dist/types.d.ts +1 -0
  179. package/package.json +79 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 guoyg
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,59 @@
1
+ # k-ui
2
+
3
+ 一套可复用的 Vue 3 组件库(K 前缀),基于 reka-ui(headless)+ Tailwind v4 token。**两种接入:① `pnpm add @guoyg578/k-ui`(推荐);② 整个 `k-ui/` 目录源码拷贝**。两种方式的完整步骤、样式引入(含 Tailwind `@source` 关键步骤)、发布流程见 [INSTALL.md](./INSTALL.md)。
4
+
5
+ > 📦 **接入到新项目** —— 完整步骤、最小集成示例、排错速查见 [INSTALL.md](./INSTALL.md)。
6
+
7
+ ## 组件清单(45+)
8
+
9
+ - **通用 / 输入**:`KButton` · `KInput` · `KTextarea` · `KInputNumber` · `KSearchBar` · `KTag`
10
+ - **选择**:`KSelect` · `KCombobox`(可搜索+多选)· `KDatePicker`
11
+ - **表单**:`KSwitch` · `KCheckbox`(+`KCheckboxGroup`) · `KRadio`(+`KRadioGroup`) · `KForm` · `KFormField`
12
+ - **反馈 / 弹层**:`KConfirmDialog` · `KDialog` · `KDrawer` · `KTooltip` · `KAlert` · `KMessage`(函数式 toast)
13
+ - **数据展示**:`KDataTable` · `KPagination` · `KEmpty` · `KLoadingOverlay` · `KRefetchOverlay` · `KProgress` · `KAvatar`(+`KAvatarGroup`)
14
+ - **骨架屏**:`KSkeleton` · `KListSkeleton` · `KGridSkeleton`
15
+ - **导航**:`KTabs` · `KBreadcrumb`
16
+ - **容器**:`KCard` · `KResult` · `KSteps`
17
+ - **媒体**:`KImage` · `KImageViewer` · `KUpload`
18
+ - **高级**:`KCommandPalette`(Cmd+K)· `KVirtualList` · `KResizablePanel` · `KTreeView` · `KDiff`(LCS 文本对比)
19
+ - **主题**:`KThemeToggleButton`(**无状态**,`v-model:mode`,状态由宿主管理)
20
+ - **指令**:`v-reveal`(滚动入场)/ `v-spotlight`(鼠标跟随光晕),需 `installDirectives(app)`
21
+
22
+ 辅助导出:`useConfirm()`、`KMessage`、`installDirectives`、类型 `ConfirmOptions` / `ThemeMode` / `FormRule` / `FormFieldRef` / `TreeNode` / `CmdItem` / `UploadFile` / `MessageOptions`。
23
+
24
+ > 本库由两套同源组件合并而来:重叠组件(KTooltip / KPagination / KEmpty / KGridSkeleton / KListSkeleton / KRefetchOverlay)以 k-ui 原实现为基准。
25
+
26
+ ## 依赖(peer dependencies)
27
+
28
+ | 依赖 | 用途 |
29
+ |---|---|
30
+ | `vue` ^3.5 | 运行时 |
31
+ | `reka-ui` ^2 | 大量 headless 组件(Dialog / Select / Tooltip / Tabs …) |
32
+ | `lucide-vue-next` ^1 | 图标 |
33
+ | **Tailwind v4** | 工具类 + 设计令牌(`tokens.css` / `components.css`) |
34
+ | `vue-router` ^4+ | **可选** —— 仅 `KBreadcrumb` 用到 |
35
+ | `@vuepic/vue-datepicker` + `date-fns` | **可选** —— 仅 `KDatePicker` 用到(v13 依赖 date-fns 的 zhCN locale) |
36
+
37
+ ## 快速上手
38
+
39
+ ```vue
40
+ <script setup lang="ts">
41
+ import { KButton, KDialog, KMessage } from './k-ui'
42
+ import { ref } from 'vue'
43
+ const open = ref(false)
44
+ </script>
45
+
46
+ <template>
47
+ <KButton type="primary" @click="open = true">打开</KButton>
48
+ <KDialog v-model:open="open" title="示例" footer @confirm="KMessage.success('done')">
49
+ Hello from k-ui.
50
+ </KDialog>
51
+ </template>
52
+ ```
53
+
54
+ > ⚠️ 组件依赖 `k-ui/styles/tokens.css` + `components.css`,**必须在全局 CSS 引入**,否则样式错乱。详见 [INSTALL.md](./INSTALL.md)。
55
+
56
+ ## 备注
57
+
58
+ - 文案中文硬编码(「搜索」「确定」「暂无数据」等),需 i18n 自行替换。
59
+ - 源码拷贝交付,无版本号管理;更新时重新拷贝覆盖。
@@ -0,0 +1,8 @@
1
+ //#region \0plugin-vue:export-helper
2
+ var e = (e, t) => {
3
+ let n = e.__vccOpts || e;
4
+ for (let [e, r] of t) n[e] = r;
5
+ return n;
6
+ };
7
+ //#endregion
8
+ export { e as default };
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./KAlert.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region components/KAlert.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-5a970db1"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,40 @@
1
+ type AlertType = 'info' | 'success' | 'warning' | 'error';
2
+ type __VLS_Props = {
3
+ type?: AlertType;
4
+ variant?: 'tint' | 'outline';
5
+ title?: string;
6
+ description?: string;
7
+ closable?: boolean;
8
+ icon?: boolean;
9
+ /** 受控可见性. 不传时走内部 ref(true), 点 X 即隐藏 (uncontrolled 模式).
10
+ * 传了就受父组件 v-model 控制 — 父组件需自行处理 update:modelValue */
11
+ modelValue?: boolean;
12
+ };
13
+ declare var __VLS_6: {}, __VLS_8: {}, __VLS_10: {};
14
+ type __VLS_Slots = {} & {
15
+ title?: (props: typeof __VLS_6) => any;
16
+ } & {
17
+ default?: (props: typeof __VLS_8) => any;
18
+ } & {
19
+ actions?: (props: typeof __VLS_10) => any;
20
+ };
21
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
22
+ "update:modelValue": (v: boolean) => any;
23
+ close: () => any;
24
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
25
+ "onUpdate:modelValue"?: ((v: boolean) => any) | undefined;
26
+ onClose?: (() => any) | undefined;
27
+ }>, {
28
+ type: AlertType;
29
+ closable: boolean;
30
+ variant: "tint" | "outline";
31
+ icon: boolean;
32
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
33
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
34
+ declare const _default: typeof __VLS_export;
35
+ export default _default;
36
+ type __VLS_WithSlots<T, S> = T & {
37
+ new (): {
38
+ $slots: S;
39
+ };
40
+ };
@@ -0,0 +1,76 @@
1
+ import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, createVNode as o, defineComponent as s, normalizeClass as c, openBlock as l, ref as u, renderSlot as d, resolveDynamicComponent as f, toDisplayString as p, unref as m, watch as h } from "vue";
2
+ import { AlertCircle as g, AlertTriangle as _, CheckCircle2 as v, Info as y, X as b } from "lucide-vue-next";
3
+ //#region components/KAlert.vue?vue&type=script&setup=true&lang.ts
4
+ var x = { class: "k-alert__body" }, S = {
5
+ key: 0,
6
+ class: "k-alert__title"
7
+ }, C = {
8
+ key: 1,
9
+ class: "k-alert__desc"
10
+ }, w = {
11
+ key: 2,
12
+ class: "k-alert__actions"
13
+ }, T = /* @__PURE__ */ s({
14
+ __name: "KAlert",
15
+ props: {
16
+ type: { default: "info" },
17
+ variant: { default: "tint" },
18
+ title: {},
19
+ description: {},
20
+ closable: {
21
+ type: Boolean,
22
+ default: !1
23
+ },
24
+ icon: {
25
+ type: Boolean,
26
+ default: !0
27
+ },
28
+ modelValue: { type: Boolean }
29
+ },
30
+ emits: ["update:modelValue", "close"],
31
+ setup(s, { emit: T }) {
32
+ let E = s, D = T, O = u(!0);
33
+ h(() => [
34
+ E.type,
35
+ E.title,
36
+ E.description
37
+ ], () => {
38
+ E.modelValue === void 0 && (O.value = !0);
39
+ });
40
+ let k = e(() => E.modelValue === void 0 ? O.value : E.modelValue);
41
+ function A() {
42
+ E.modelValue === void 0 ? O.value = !1 : D("update:modelValue", !1), D("close");
43
+ }
44
+ let j = {
45
+ info: y,
46
+ success: v,
47
+ warning: _,
48
+ error: g
49
+ };
50
+ return (e, u) => k.value ? (l(), r("div", {
51
+ key: 0,
52
+ class: c(["k-alert", [`k-alert--${s.type}`, `k-alert--${s.variant}`]]),
53
+ role: "alert"
54
+ }, [
55
+ s.icon ? (l(), t(f(j[s.type]), {
56
+ key: 0,
57
+ size: 16,
58
+ class: "k-alert__icon"
59
+ })) : n("", !0),
60
+ i("div", x, [
61
+ s.title || e.$slots.title ? (l(), r("div", S, [d(e.$slots, "title", {}, () => [a(p(s.title), 1)], !0)])) : n("", !0),
62
+ s.description || e.$slots.default ? (l(), r("div", C, [d(e.$slots, "default", {}, () => [a(p(s.description), 1)], !0)])) : n("", !0),
63
+ e.$slots.actions ? (l(), r("div", w, [d(e.$slots, "actions", {}, void 0, !0)])) : n("", !0)
64
+ ]),
65
+ s.closable ? (l(), r("button", {
66
+ key: 1,
67
+ type: "button",
68
+ class: "k-alert__close",
69
+ "aria-label": "关闭",
70
+ onClick: A
71
+ }, [o(m(b), { size: 14 })])) : n("", !0)
72
+ ], 2)) : n("", !0);
73
+ }
74
+ });
75
+ //#endregion
76
+ export { T as default };
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./KAvatar.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region components/KAvatar.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-14ccf4af"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,15 @@
1
+ type __VLS_Props = {
2
+ src?: string;
3
+ alt?: string;
4
+ name?: string;
5
+ size?: 'sm' | 'md' | 'lg' | 'xl';
6
+ shape?: 'circle' | 'square';
7
+ /** 自定义背景, 否则按 name hash 自动生成 */
8
+ bg?: string;
9
+ };
10
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
11
+ size: "sm" | "md" | "lg" | "xl";
12
+ shape: "circle" | "square";
13
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ declare const _default: typeof __VLS_export;
15
+ export default _default;
@@ -0,0 +1,53 @@
1
+ import { computed as e, createBlock as t, createCommentVNode as n, createTextVNode as r, createVNode as i, defineComponent as a, normalizeClass as o, normalizeStyle as s, openBlock as c, toDisplayString as l, unref as u, withCtx as d } from "vue";
2
+ import { AvatarFallback as f, AvatarImage as p, AvatarRoot as m } from "reka-ui";
3
+ //#region components/KAvatar.vue?vue&type=script&setup=true&lang.ts
4
+ var h = /* @__PURE__ */ a({
5
+ __name: "KAvatar",
6
+ props: {
7
+ src: {},
8
+ alt: {},
9
+ name: {},
10
+ size: { default: "md" },
11
+ shape: { default: "circle" },
12
+ bg: {}
13
+ },
14
+ setup(a) {
15
+ let h = a, g = e(() => {
16
+ if (!h.name) return "?";
17
+ let e = h.name.trim().split(/\s+/);
18
+ return e.length >= 2 ? (e[0][0] + e[1][0]).toUpperCase() : h.name.slice(0, 2).toUpperCase();
19
+ }), _ = [
20
+ "#6366f1",
21
+ "#0ea5e9",
22
+ "#10b981",
23
+ "#f59e0b",
24
+ "#ef4444",
25
+ "#ec4899",
26
+ "#8b5cf6",
27
+ "#14b8a6"
28
+ ], v = e(() => {
29
+ if (h.bg) return h.bg;
30
+ if (!h.name) return "var(--color-ink-300)";
31
+ let e = 0;
32
+ for (let t = 0; t < h.name.length; t++) e = e * 31 + h.name.charCodeAt(t) >>> 0;
33
+ return _[e % _.length];
34
+ });
35
+ return (e, h) => (c(), t(u(m), {
36
+ class: o(["k-avatar", [`k-avatar--${a.size}`, `k-avatar--${a.shape}`]]),
37
+ style: s({ backgroundColor: v.value })
38
+ }, {
39
+ default: d(() => [a.src ? (c(), t(u(p), {
40
+ key: 0,
41
+ src: a.src,
42
+ alt: a.alt || a.name || "",
43
+ class: "k-avatar__img"
44
+ }, null, 8, ["src", "alt"])) : n("", !0), i(u(f), { class: "k-avatar__fallback" }, {
45
+ default: d(() => [r(l(g.value), 1)]),
46
+ _: 1
47
+ })]),
48
+ _: 1
49
+ }, 8, ["class", "style"]));
50
+ }
51
+ });
52
+ //#endregion
53
+ export { h as default };
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./KAvatarGroup.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region components/KAvatarGroup.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-00da4b72"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,18 @@
1
+ type __VLS_Props = {
2
+ size?: 'sm' | 'md' | 'lg' | 'xl';
3
+ };
4
+ declare var __VLS_1: {};
5
+ type __VLS_Slots = {} & {
6
+ default?: (props: typeof __VLS_1) => any;
7
+ };
8
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
9
+ size: "sm" | "md" | "lg" | "xl";
10
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
14
+ type __VLS_WithSlots<T, S> = T & {
15
+ new (): {
16
+ $slots: S;
17
+ };
18
+ };
@@ -0,0 +1,11 @@
1
+ import { createElementBlock as e, defineComponent as t, normalizeClass as n, openBlock as r, renderSlot as i } from "vue";
2
+ //#region components/KAvatarGroup.vue?vue&type=script&setup=true&lang.ts
3
+ var a = /* @__PURE__ */ t({
4
+ __name: "KAvatarGroup",
5
+ props: { size: { default: "md" } },
6
+ setup(t) {
7
+ return (a, o) => (r(), e("div", { class: n(["k-avatar-group", `k-avatar-group--${t.size}`]) }, [i(a.$slots, "default", {}, void 0, !0)], 2));
8
+ }
9
+ });
10
+ //#endregion
11
+ export { a as default };
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./KBreadcrumb.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region components/KBreadcrumb.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-84a26ab7"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,12 @@
1
+ import type { Component } from 'vue';
2
+ interface BreadcrumbItem {
3
+ label: string;
4
+ to?: string;
5
+ icon?: Component;
6
+ }
7
+ type __VLS_Props = {
8
+ items: BreadcrumbItem[];
9
+ };
10
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare const _default: typeof __VLS_export;
12
+ export default _default;
@@ -0,0 +1,38 @@
1
+ import { Fragment as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createTextVNode as i, defineComponent as a, normalizeClass as o, openBlock as s, renderList as c, resolveDynamicComponent as l, toDisplayString as u, unref as d, withCtx as f } from "vue";
2
+ import { ChevronRight as p } from "lucide-vue-next";
3
+ import { RouterLink as m } from "vue-router";
4
+ //#region components/KBreadcrumb.vue?vue&type=script&setup=true&lang.ts
5
+ var h = {
6
+ class: "k-bread",
7
+ "aria-label": "面包屑"
8
+ }, g = /* @__PURE__ */ a({
9
+ __name: "KBreadcrumb",
10
+ props: { items: {} },
11
+ setup(a) {
12
+ return (g, _) => (s(), r("nav", h, [(s(!0), r(e, null, c(a.items, (c, h) => (s(), r(e, { key: h }, [c.to && h < a.items.length - 1 ? (s(), t(d(m), {
13
+ key: 0,
14
+ to: c.to,
15
+ class: "k-bread__item k-bread__item--link"
16
+ }, {
17
+ default: f(() => [c.icon ? (s(), t(l(c.icon), {
18
+ key: 0,
19
+ size: 13,
20
+ class: "k-bread__icon"
21
+ })) : n("", !0), i(" " + u(c.label), 1)]),
22
+ _: 2
23
+ }, 1032, ["to"])) : (s(), r("span", {
24
+ key: 1,
25
+ class: o(["k-bread__item", { "k-bread__item--last": h === a.items.length - 1 }])
26
+ }, [c.icon ? (s(), t(l(c.icon), {
27
+ key: 0,
28
+ size: 13,
29
+ class: "k-bread__icon"
30
+ })) : n("", !0), i(" " + u(c.label), 1)], 2)), h < a.items.length - 1 ? (s(), t(d(p), {
31
+ key: 2,
32
+ size: 14,
33
+ class: "k-bread__sep"
34
+ })) : n("", !0)], 64))), 128))]));
35
+ }
36
+ });
37
+ //#endregion
38
+ export { g as default };
@@ -0,0 +1,7 @@
1
+ import e from "./KButton.vue_vue_type_script_setup_true_lang.js";
2
+ /* empty css */
3
+ import t from "../_virtual/_plugin-vue_export-helper.js";
4
+ //#region components/KButton.vue
5
+ var n = /* @__PURE__ */ t(e, [["__scopeId", "data-v-d6c04ee4"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,36 @@
1
+ type KButtonType = 'primary' | 'secondary' | 'ghost' | 'danger';
2
+ type KButtonSize = 'sm' | 'md' | 'lg';
3
+ type __VLS_Props = {
4
+ type?: KButtonType;
5
+ size?: KButtonSize;
6
+ loading?: boolean;
7
+ disabled?: boolean;
8
+ block?: boolean;
9
+ nativeType?: 'button' | 'submit' | 'reset';
10
+ };
11
+ declare var __VLS_6: {}, __VLS_8: {};
12
+ type __VLS_Slots = {} & {
13
+ icon?: (props: typeof __VLS_6) => any;
14
+ } & {
15
+ default?: (props: typeof __VLS_8) => any;
16
+ };
17
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
18
+ click: (ev: MouseEvent) => any;
19
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
20
+ onClick?: ((ev: MouseEvent) => any) | undefined;
21
+ }>, {
22
+ type: KButtonType;
23
+ size: KButtonSize;
24
+ loading: boolean;
25
+ disabled: boolean;
26
+ block: boolean;
27
+ nativeType: "button" | "submit" | "reset";
28
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
29
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
30
+ declare const _default: typeof __VLS_export;
31
+ export default _default;
32
+ type __VLS_WithSlots<T, S> = T & {
33
+ new (): {
34
+ $slots: S;
35
+ };
36
+ };
@@ -0,0 +1,50 @@
1
+ import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, defineComponent as i, normalizeClass as a, openBlock as o, renderSlot as s, unref as c } from "vue";
2
+ import { Loader2 as l } from "lucide-vue-next";
3
+ //#region components/KButton.vue?vue&type=script&setup=true&lang.ts
4
+ var u = ["type", "disabled"], d = /* @__PURE__ */ i({
5
+ __name: "KButton",
6
+ props: {
7
+ type: { default: "secondary" },
8
+ size: { default: "md" },
9
+ loading: {
10
+ type: Boolean,
11
+ default: !1
12
+ },
13
+ disabled: {
14
+ type: Boolean,
15
+ default: !1
16
+ },
17
+ block: {
18
+ type: Boolean,
19
+ default: !1
20
+ },
21
+ nativeType: { default: "button" }
22
+ },
23
+ emits: ["click"],
24
+ setup(i) {
25
+ let d = i, f = e(() => d.size === "sm" ? 12 : d.size === "lg" ? 16 : 14);
26
+ return (e, d) => (o(), r("button", {
27
+ type: i.nativeType,
28
+ disabled: i.disabled || i.loading,
29
+ class: a(["k-btn", [
30
+ `k-btn--${i.type}`,
31
+ `k-btn--${i.size}`,
32
+ {
33
+ "k-btn--block": i.block,
34
+ "k-btn--loading": i.loading
35
+ }
36
+ ]]),
37
+ onClick: d[0] ||= (t) => e.$emit("click", t)
38
+ }, [
39
+ i.loading ? (o(), t(c(l), {
40
+ key: 0,
41
+ size: f.value,
42
+ class: "k-btn__spinner"
43
+ }, null, 8, ["size"])) : n("", !0),
44
+ s(e.$slots, "icon", {}, void 0, !0),
45
+ s(e.$slots, "default", {}, void 0, !0)
46
+ ], 10, u));
47
+ }
48
+ });
49
+ //#endregion
50
+ export { d as default };
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./KCard.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region components/KCard.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-4ce7c362"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,33 @@
1
+ type __VLS_Props = {
2
+ title?: string;
3
+ subtitle?: string;
4
+ shadow?: 'none' | 'sm' | 'md';
5
+ bordered?: boolean;
6
+ hoverable?: boolean;
7
+ bodyClass?: string;
8
+ };
9
+ declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {}, __VLS_7: {}, __VLS_9: {};
10
+ type __VLS_Slots = {} & {
11
+ title?: (props: typeof __VLS_1) => any;
12
+ } & {
13
+ header?: (props: typeof __VLS_3) => any;
14
+ } & {
15
+ actions?: (props: typeof __VLS_5) => any;
16
+ } & {
17
+ default?: (props: typeof __VLS_7) => any;
18
+ } & {
19
+ footer?: (props: typeof __VLS_9) => any;
20
+ };
21
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
22
+ bordered: boolean;
23
+ hoverable: boolean;
24
+ shadow: "none" | "sm" | "md";
25
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
27
+ declare const _default: typeof __VLS_export;
28
+ export default _default;
29
+ type __VLS_WithSlots<T, S> = T & {
30
+ new (): {
31
+ $slots: S;
32
+ };
33
+ };
@@ -0,0 +1,50 @@
1
+ import { createCommentVNode as e, createElementBlock as t, createElementVNode as n, createTextVNode as r, defineComponent as i, normalizeClass as a, openBlock as o, renderSlot as s, toDisplayString as c } from "vue";
2
+ //#region components/KCard.vue?vue&type=script&setup=true&lang.ts
3
+ var l = {
4
+ key: 0,
5
+ class: "k-card__header"
6
+ }, u = { class: "k-card__title-wrap" }, d = {
7
+ key: 0,
8
+ class: "k-card__title"
9
+ }, f = {
10
+ key: 1,
11
+ class: "k-card__subtitle"
12
+ }, p = {
13
+ key: 0,
14
+ class: "k-card__actions"
15
+ }, m = {
16
+ key: 1,
17
+ class: "k-card__footer"
18
+ }, h = /* @__PURE__ */ i({
19
+ __name: "KCard",
20
+ props: {
21
+ title: {},
22
+ subtitle: {},
23
+ shadow: { default: "sm" },
24
+ bordered: {
25
+ type: Boolean,
26
+ default: !0
27
+ },
28
+ hoverable: {
29
+ type: Boolean,
30
+ default: !1
31
+ },
32
+ bodyClass: {}
33
+ },
34
+ setup(i) {
35
+ return (h, g) => (o(), t("div", { class: a(["k-card", [`k-card--shadow-${i.shadow}`, {
36
+ "k-card--bordered": i.bordered,
37
+ "k-card--hoverable": i.hoverable
38
+ }]]) }, [
39
+ i.title || h.$slots.title || h.$slots.header || h.$slots.actions ? (o(), t("header", l, [n("div", u, [
40
+ i.title || h.$slots.title ? (o(), t("h3", d, [s(h.$slots, "title", {}, () => [r(c(i.title), 1)], !0)])) : e("", !0),
41
+ i.subtitle ? (o(), t("p", f, c(i.subtitle), 1)) : e("", !0),
42
+ s(h.$slots, "header", {}, void 0, !0)
43
+ ]), h.$slots.actions ? (o(), t("div", p, [s(h.$slots, "actions", {}, void 0, !0)])) : e("", !0)])) : e("", !0),
44
+ n("div", { class: a(["k-card__body", i.bodyClass]) }, [s(h.$slots, "default", {}, void 0, !0)], 2),
45
+ h.$slots.footer ? (o(), t("footer", m, [s(h.$slots, "footer", {}, void 0, !0)])) : e("", !0)
46
+ ], 2));
47
+ }
48
+ });
49
+ //#endregion
50
+ export { h as default };
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./KCarousel.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region components/KCarousel.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-173fae98"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,59 @@
1
+ /** 每一项可以是图片地址字符串,或带 alt 的对象;也可用默认插槽渲染任意内容 */
2
+ export type CarouselItem = string | {
3
+ src: string;
4
+ alt?: string;
5
+ };
6
+ declare const __VLS_export: <T = CarouselItem>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
7
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<({
8
+ items: T[];
9
+ /** 自动轮播 */
10
+ autoplay?: boolean;
11
+ /** 自动轮播间隔(ms) */
12
+ interval?: number;
13
+ /** 首尾循环 */
14
+ loop?: boolean;
15
+ /** 左右箭头 */
16
+ arrows?: boolean;
17
+ /** 底部指示器 */
18
+ indicators?: boolean;
19
+ /** 指示器样式:圆点 / 线条 */
20
+ indicatorType?: "dot" | "line";
21
+ /** 切换动画:滑动 / 淡入淡出 */
22
+ transition?: "slide" | "fade";
23
+ /** 宽高比(height 未设置时生效),如 "16 / 9" */
24
+ aspectRatio?: string;
25
+ /** 显式高度,优先于 aspectRatio */
26
+ height?: string;
27
+ /** 悬停时暂停自动轮播 */
28
+ pauseOnHover?: boolean;
29
+ } & {
30
+ modelValue?: number;
31
+ }) & {
32
+ "onUpdate:modelValue"?: ((value: number) => any) | undefined;
33
+ }> & (typeof globalThis extends {
34
+ __VLS_PROPS_FALLBACK: infer P;
35
+ } ? P : {});
36
+ expose: (exposed: import("vue").ShallowUnwrapRef<{
37
+ next: () => void;
38
+ prev: () => void;
39
+ go: (target: number, dir?: "next" | "prev") => void;
40
+ }>) => void;
41
+ attrs: any;
42
+ slots: {
43
+ default?: (props: {
44
+ item: T;
45
+ index: number;
46
+ active: boolean;
47
+ }) => any;
48
+ };
49
+ emit: (event: "update:modelValue", value: number) => void;
50
+ }>) => import("vue").VNode & {
51
+ __ctx?: Awaited<typeof __VLS_setup>;
52
+ };
53
+ declare const _default: typeof __VLS_export;
54
+ export default _default;
55
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
56
+ [K in keyof T]: T[K];
57
+ } : {
58
+ [K in keyof T as K]: T[K];
59
+ }) & {};