@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
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 KIMA contributors
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 CHANGED
@@ -1,3 +1,210 @@
1
- # Temporary Holding Version
1
+ # KIMA
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ **K**inetic · **I**nteraction · **M**otion · **A**live。
4
+
5
+ KIMA 是面向 Web 应用的 UI 设计系统与组件库,提供 **Vue 组件**与可在原生网页中使用的 **Web Components**。
6
+
7
+ 以 Material You 为设计参考,KIMA 采用大控件、宽松布局和圆角表面,用动效引导注意力,让交互反馈清晰、自然。
8
+
9
+ ## 特性
10
+
11
+ - **两种接入方式**:Vue 中按需导入,或使用自定义元素接入其他 Web 项目。
12
+ - **动态主题**:由单一种子色生成品牌配色,支持深浅主题;成功、警告和危险色保留语义。
13
+ - **交互反馈**:状态层、焦点提示、涟漪与过渡动效,兼顾鼠标、触屏和键盘操作。
14
+ - **从基础到内容**:包含输入、导航、弹层、数据展示,以及代码和富文本编辑等组件。
15
+ - **统一视觉**:通过 CSS 变量控制颜色、字体、形状和间距,适配应用自身的主题。
16
+
17
+ ## 安装
18
+
19
+ 使用 npm、pnpm 或其他兼容 npm 的包管理器:
20
+
21
+ ```sh
22
+ npm install @kernel4632/kima vue
23
+ ```
24
+
25
+ ```sh
26
+ pnpm add @kernel4632/kima vue
27
+ ```
28
+
29
+ Vue 组件需要宿主提供兼容的 Vue 3 运行时,版本要求见 [peerDependencies](https://github.com/kernel4632/kima/blob/main/package.json#L91)。自定义元素入口已内置运行时,页面代码无需调用 Vue API。
30
+
31
+ ## 在 Vue 中使用
32
+
33
+ 按需导入组件,并在应用入口引入一次组件样式:
34
+
35
+ ```vue
36
+ <script setup>
37
+ import { ref } from 'vue';
38
+ import { KimaButton, KimaTextField } from '@kernel4632/kima';
39
+ import '@kernel4632/kima/style.css';
40
+
41
+ const name = ref('');
42
+ const savedName = ref('');
43
+ </script>
44
+
45
+ <template>
46
+ <form @submit.prevent="savedName = name">
47
+ <p>名称</p>
48
+ <KimaTextField
49
+ v-model="name"
50
+ label="名称"
51
+ placeholder="输入名称"
52
+ />
53
+ <KimaButton type="submit">保存</KimaButton>
54
+ <p v-if="savedName">已保存:{{ savedName }}</p>
55
+ </form>
56
+ </template>
57
+ ```
58
+
59
+ 文本框的可访问名不会渲染为可见标签,标签文字由应用自行排版。具名导入支持构建工具移除未使用的组件与内容引擎;组件样式是统一样式文件。
60
+
61
+ ## 在原生网页中使用
62
+
63
+ ### 使用构建工具
64
+
65
+ 在页面的 JavaScript 入口注册核心组件:
66
+
67
+ ```js
68
+ import '@kernel4632/kima/elements/core';
69
+ ```
70
+
71
+ 然后在 HTML 中使用:
72
+
73
+ ```html
74
+ <kima-button variant="filled">保存</kima-button>
75
+ <kima-text-field label="名称" placeholder="输入名称"></kima-text-field>
76
+ ```
77
+
78
+ 需要编辑器等扩展组件时,改用全量入口:
79
+
80
+ ```js
81
+ import '@kernel4632/kima/elements';
82
+ ```
83
+
84
+ 两种注册入口均自带运行时、设计 token 和组件样式,无需额外导入样式文件。通常选择一个入口即可;全量入口包含全部组件与内容引擎,不会根据页面使用的标签自动裁剪。
85
+
86
+ ### 不使用构建工具
87
+
88
+ 将安装包内的核心独立文件 [`dist/kima-elements-core.js`](https://www.npmjs.com/package/@kernel4632/kima?activeTab=code) 复制到网站,并通过 HTTP 服务加载:
89
+
90
+ ```html
91
+ <!doctype html>
92
+ <html lang="zh-CN">
93
+ <head>
94
+ <meta charset="UTF-8">
95
+ <meta name="viewport" content="width=device-width, initial-scale=1">
96
+ <title>KIMA 示例</title>
97
+ <script type="module" src="./kima-elements-core.js"></script>
98
+ </head>
99
+ <body>
100
+ <kima-button variant="filled">保存</kima-button>
101
+ </body>
102
+ </html>
103
+ ```
104
+
105
+ 需要全量组件时换用 [`dist/kima-elements.js`](https://www.npmjs.com/package/@kernel4632/kima?activeTab=code)。复制部署时应一并保留包内的第三方许可证声明。
106
+
107
+ ### 属性与事件
108
+
109
+ 字符串和布尔值可通过 HTML 属性传入;布尔属性存在即表示启用,关闭时移除属性或通过 JavaScript 赋值。数组与对象使用 JavaScript 属性赋值,并在元素完成注册后设置。
110
+
111
+ 自定义组件事件的参数放在事件的参数数组中;按钮点击仍使用普通 DOM 点击事件。例如,读取文本框的值:
112
+
113
+ ```html
114
+ <kima-text-field id="name" label="名称"></kima-text-field>
115
+ <output id="value"></output>
116
+
117
+ <script type="module">
118
+ import '@kernel4632/kima/elements/core';
119
+
120
+ const field = document.getElementById('name');
121
+ const output = document.getElementById('value');
122
+
123
+ field.addEventListener('update:modelValue', (event) => {
124
+ const [value] = event.detail;
125
+ output.textContent = value;
126
+ });
127
+ </script>
128
+ ```
129
+
130
+ ## 主题与样式
131
+
132
+ 默认使用深色主题。在页面根元素设置主题属性可切换默认深浅配色:
133
+
134
+ ```html
135
+ <html lang="zh-CN" data-kima-theme="light">
136
+ ```
137
+
138
+ 也可以在浏览器中用种子色生成并应用配色:
139
+
140
+ ```js
141
+ import { applyPalette, resetPalette } from '@kernel4632/kima/theme';
142
+
143
+ applyPalette('#61afef', { isDark: false });
144
+
145
+ // 清除运行时配色,恢复默认主题。
146
+ resetPalette();
147
+ ```
148
+
149
+ 运行时配色会写入内联变量。自定义种子色后切换深浅模式时,重新应用对应模式;若要回到默认主题属性控制的配色,先清除运行时配色。
150
+
151
+ KIMA 样式使用自身命名空间,不附带页面 reset 或背景。应用可自行组合页面样式,例如:
152
+
153
+ ```css
154
+ body {
155
+ background: var(--kima-color-surface);
156
+ color: var(--kima-color-on-surface);
157
+ font-family: var(--kima-font-family);
158
+ }
159
+ ```
160
+
161
+ 默认字体栈优先使用 Maple Mono NF CN,再回退到系统等宽字体。字体文件不包含在组件包中,可由应用自行加载。
162
+
163
+ 自定义元素采用 light DOM,**不提供 Shadow DOM 样式隔离**,宿主页面的全局样式可能影响组件。
164
+
165
+ ## 入口选择
166
+
167
+ | 入口 | 用途 |
168
+ | --- | --- |
169
+ | 主入口 | Vue 组件的具名导出,以及代码块语言登记工具 |
170
+ | [Vue 样式](https://www.npmjs.com/package/@kernel4632/kima?activeTab=code) | Vue 组件使用的样式与设计 token |
171
+ | [核心元素入口](https://github.com/kernel4632/kima/blob/main/src/elements-core.js) | 常用基础组件,自带运行时和样式 |
172
+ | [全量元素入口](https://github.com/kernel4632/kima/blob/main/src/elements.js) | 全部自定义元素,包含内容引擎 |
173
+ | [主题入口](https://github.com/kernel4632/kima/blob/main/src/utils/theme.js) | 配色生成、应用与重置 |
174
+
175
+ 对应导入路径:
176
+
177
+ ```js
178
+ import { KimaButton } from '@kernel4632/kima';
179
+ import '@kernel4632/kima/style.css';
180
+ import '@kernel4632/kima/elements/core';
181
+ import '@kernel4632/kima/elements';
182
+ import { applyPalette } from '@kernel4632/kima/theme';
183
+ ```
184
+
185
+ 以上是各入口的路径对照,不需要同时导入。Vue 项目通常选择具名组件与样式;原生网页通常选择核心或全量元素入口。
186
+
187
+ ## 文档
188
+
189
+ - [组件索引](https://github.com/kernel4632/kima/blob/main/docs/component-index.md):查找组件与源码。
190
+ - [能力与边界](https://github.com/kernel4632/kima/blob/main/docs/component-comparison.md):了解组件支持的功能。
191
+ - [问题反馈](https://github.com/kernel4632/kima/issues):提交缺陷或功能建议。
192
+
193
+ KIMA 提供 ESM 格式的 JavaScript,不提供 CommonJS 或 TypeScript 类型声明。面向支持自定义元素、原生对话框、ResizeObserver、Web Animations 和现代 CSS 的浏览器。
194
+
195
+ ## 本地开发
196
+
197
+ 克隆仓库后,在项目根目录运行:
198
+
199
+ ```sh
200
+ pnpm install
201
+ pnpm dev
202
+ ```
203
+
204
+ 本地文档站提供组件预览、用法示例和属性参考。
205
+
206
+ ## 许可证
207
+
208
+ KIMA 使用 [MIT 许可证](https://github.com/kernel4632/kima/blob/main/LICENSE)。
209
+
210
+ 独立浏览器包包含第三方代码,其授权文本随包提供于 [`dist/THIRD_PARTY_NOTICES.txt`](https://www.npmjs.com/package/@kernel4632/kima?activeTab=code)。复制或再分发时须保留相应许可证与版权声明。