@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,116 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ /* empty css */
3
+ import { computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, getCurrentInstance as a, mergeProps as o, normalizeClass as s, onBeforeUnmount as c, onMounted as l, openBlock as u, ref as d, toDisplayString as f, useAttrs as p, watch as m, withModifiers as h } from "vue";
4
+ // src/components/core/slider.ce.vue
5
+ var g = {
6
+ key: 0,
7
+ class: "kima-slider__header"
8
+ }, _ = { class: "kima-slider__value" }, v = [
9
+ "value",
10
+ "min",
11
+ "max",
12
+ "step",
13
+ "disabled",
14
+ "required",
15
+ "name",
16
+ "aria-label"
17
+ ], y = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
18
+ __name: "slider.ce",
19
+ props: {
20
+ modelValue: {
21
+ type: Number,
22
+ default: 0
23
+ },
24
+ min: {
25
+ type: Number,
26
+ default: 0
27
+ },
28
+ max: {
29
+ type: Number,
30
+ default: 100
31
+ },
32
+ step: {
33
+ type: Number,
34
+ default: 1
35
+ },
36
+ disabled: {
37
+ type: Boolean,
38
+ default: !1
39
+ },
40
+ required: {
41
+ type: Boolean,
42
+ default: !1
43
+ },
44
+ name: {
45
+ type: String,
46
+ default: void 0
47
+ },
48
+ label: {
49
+ type: String,
50
+ default: ""
51
+ },
52
+ showValue: {
53
+ type: Boolean,
54
+ default: !1
55
+ }
56
+ },
57
+ emits: ["update:modelValue", "change"],
58
+ setup(e, { emit: y }) {
59
+ let b = e, x = y, S = p(), C = !!a()?.ce, w = t(() => C ? {
60
+ ...S,
61
+ id: void 0
62
+ } : S), T = d(null), E, D, O = t(() => Number.isFinite(b.min) ? b.min : 0), k = t(() => Number.isFinite(b.max) ? Math.max(O.value, b.max) : O.value + 100);
63
+ function A(e) {
64
+ let t = Number(e);
65
+ return Number.isFinite(t) ? Math.max(O.value, Math.min(k.value, t)) : O.value;
66
+ }
67
+ let j = d(A(b.modelValue));
68
+ m([
69
+ () => b.modelValue,
70
+ () => b.min,
71
+ () => b.max
72
+ ], () => {
73
+ j.value = A(b.modelValue);
74
+ });
75
+ let M = t(() => {
76
+ let e = k.value - O.value;
77
+ if (e <= 0) return "0%";
78
+ let t = (j.value - O.value) / e;
79
+ return `${Math.max(0, Math.min(1, t)) * 100}%`;
80
+ });
81
+ function N(e) {
82
+ j.value = A(e.target.value), x("update:modelValue", j.value);
83
+ }
84
+ function P(e) {
85
+ j.value = A(e.target.value), x("change", j.value);
86
+ }
87
+ function F(e) {
88
+ e.target === T.value.form && queueMicrotask(() => {
89
+ if (e.defaultPrevented || !T.value) return;
90
+ let t = A(E), n = j.value !== t;
91
+ j.value = t, T.value.value = String(t), n && x("update:modelValue", t);
92
+ });
93
+ }
94
+ return l(() => {
95
+ j.value = A(T.value.valueAsNumber), E = j.value, T.value.defaultValue = String(E), D = T.value.ownerDocument, D.addEventListener("reset", F, !0);
96
+ }), c(() => D.removeEventListener("reset", F, !0)), (t, a) => (u(), r("label", { class: s(["kima-slider", { "kima-slider--disabled": e.disabled }]) }, [e.showValue ? (u(), r("span", g, [i("output", _, f(j.value), 1)])) : n("", !0), i("input", o({
97
+ ref_key: "input",
98
+ ref: T
99
+ }, w.value, {
100
+ class: "kima-slider__input",
101
+ type: "range",
102
+ value: j.value,
103
+ min: O.value,
104
+ max: k.value,
105
+ step: e.step,
106
+ disabled: e.disabled,
107
+ required: e.required,
108
+ name: e.name,
109
+ "aria-label": e.label || void 0,
110
+ style: { "--kima-slider-fill": M.value },
111
+ onInput: h(N, ["stop"]),
112
+ onChange: h(P, ["stop"])
113
+ }), null, 16, v)], 2));
114
+ }
115
+ }), [["__scopeId", "data-v-746583af"]]);
116
+ export { y as default };
@@ -0,0 +1,100 @@
1
+ import { useNativeSlots as e } from "../../utils/native-slots.js";
2
+ import { useRipple as t } from "../../utils/ripple.js";
3
+ import n from "../../_virtual/_plugin-vue_export-helper.js";
4
+ import r from "./icon.ce.js";
5
+ /* empty css */
6
+ import { computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, mergeProps as l, normalizeClass as u, onBeforeUnmount as d, onMounted as f, openBlock as p, ref as m, renderSlot as h, unref as g, useAttrs as _, watch as v, withModifiers as y } from "vue";
7
+ import { Tick02Icon as b } from "@hugeicons/core-free-icons";
8
+ // src/components/core/switch.ce.vue
9
+ var x = [
10
+ "checked",
11
+ "disabled",
12
+ "required",
13
+ "name",
14
+ "value"
15
+ ], S = { class: "kima-switch__track" }, C = { class: "kima-switch__thumb" }, w = {
16
+ key: 0,
17
+ class: "kima-switch__label"
18
+ }, T = /*#__PURE__*/ n(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
19
+ __name: "switch.ce",
20
+ props: {
21
+ modelValue: {
22
+ type: Boolean,
23
+ default: !1
24
+ },
25
+ disabled: {
26
+ type: Boolean,
27
+ default: !1
28
+ },
29
+ required: {
30
+ type: Boolean,
31
+ default: !1
32
+ },
33
+ name: {
34
+ type: String,
35
+ default: void 0
36
+ },
37
+ value: {
38
+ type: String,
39
+ default: "on"
40
+ }
41
+ },
42
+ emits: ["update:modelValue", "change"],
43
+ setup(n, { emit: T }) {
44
+ let E = n, D = T, O = _(), k = m(null), A = m(null), j = m(null), { hasNativeSlot: M, isCustomElement: N } = e(k), P = i(() => N ? {
45
+ ...O,
46
+ id: void 0
47
+ } : O), F = m(E.modelValue || O.checked === "" || O.checked === !0), I, L;
48
+ t(A), v(() => E.modelValue, (e) => {
49
+ F.value = e;
50
+ });
51
+ function R(e) {
52
+ F.value = e.target.checked, D("update:modelValue", F.value), D("change", F.value);
53
+ }
54
+ function z(e) {
55
+ e.target === j.value.form && queueMicrotask(() => {
56
+ if (e.defaultPrevented || !j.value) return;
57
+ let t = F.value !== I;
58
+ F.value = I, j.value.checked = I, t && D("update:modelValue", I);
59
+ });
60
+ }
61
+ return f(() => {
62
+ I = F.value, j.value.defaultChecked = I, L = j.value.ownerDocument, L.addEventListener("reset", z, !0);
63
+ }), d(() => L.removeEventListener("reset", z, !0)), (e, t) => (p(), o("label", {
64
+ ref_key: "root",
65
+ ref: k,
66
+ class: u(["kima-switch", {
67
+ "kima-switch--checked": F.value,
68
+ "kima-switch--disabled": n.disabled
69
+ }])
70
+ }, [
71
+ s("input", l({
72
+ ref_key: "input",
73
+ ref: j
74
+ }, P.value, {
75
+ class: "kima-switch__input",
76
+ type: "checkbox",
77
+ role: "switch",
78
+ checked: F.value,
79
+ disabled: n.disabled,
80
+ required: n.required,
81
+ name: n.name,
82
+ value: n.value,
83
+ onInput: t[0] ||= y(() => {}, ["stop"]),
84
+ onChange: y(R, ["stop"])
85
+ }), null, 16, x),
86
+ s("span", {
87
+ ref_key: "control",
88
+ ref: A,
89
+ class: "kima-switch__control",
90
+ "aria-hidden": "true"
91
+ }, [s("span", S, [s("span", C, [c(r, {
92
+ class: "kima-switch__check",
93
+ icon: g(b),
94
+ size: 16
95
+ }, null, 8, ["icon"])])])], 512),
96
+ e.$slots.default || g(M)("default") ? (p(), o("span", w, [h(e.$slots, "default", {}, void 0, !0)])) : a("", !0)
97
+ ], 2));
98
+ }
99
+ }), [["__scopeId", "data-v-2bcc172e"]]);
100
+ export { T as default };
@@ -0,0 +1,193 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import { presenceTransition as t } from "../../utils/motion.js";
3
+ import { useContentMotion as n } from "../../utils/content-motion.js";
4
+ /* empty css */
5
+ import { Fragment as r, Transition as i, computed as a, createBlock as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, mergeProps as u, nextTick as d, normalizeClass as f, normalizeStyle as p, onBeforeUnmount as m, onMounted as h, openBlock as g, ref as _, renderList as v, renderSlot as y, shallowRef as b, toDisplayString as x, unref as S, useId as C, vShow as w, watch as T, withCtx as E, withDirectives as D } from "vue";
6
+ // src/components/core/tabs.ce.vue
7
+ var O = ["aria-orientation"], k = [
8
+ "id",
9
+ "aria-selected",
10
+ "aria-controls",
11
+ "aria-disabled",
12
+ "disabled",
13
+ "tabindex",
14
+ "onClick",
15
+ "onKeydown"
16
+ ], A = [
17
+ "id",
18
+ "aria-labelledby",
19
+ "inert",
20
+ "aria-hidden",
21
+ "tabindex"
22
+ ], j = /*#__PURE__*/ e({
23
+ __name: "tabs.ce",
24
+ props: {
25
+ modelValue: {
26
+ type: [
27
+ String,
28
+ Number,
29
+ Boolean,
30
+ Object,
31
+ Array
32
+ ],
33
+ default: null
34
+ },
35
+ items: {
36
+ type: Array,
37
+ default: () => []
38
+ },
39
+ orientation: {
40
+ type: String,
41
+ default: "horizontal"
42
+ }
43
+ },
44
+ emits: ["update:modelValue", "change"],
45
+ setup(e, { emit: j }) {
46
+ let M = e, N = j, P = _([]), F = _(null), I = _(null), L = _({ opacity: 0 }), R = _(!1), z, B;
47
+ function V() {
48
+ let e = P.value[G.value];
49
+ if (!F.value || !e) {
50
+ L.value = { opacity: 0 };
51
+ return;
52
+ }
53
+ let t = W.value === "vertical";
54
+ L.value = {
55
+ opacity: 1,
56
+ width: t ? "var(--kima-tabs-indicator-height)" : `${Math.min(40, e.offsetWidth)}px`,
57
+ height: t ? "24px" : "var(--kima-tabs-indicator-height)",
58
+ transform: t ? `translate(${e.offsetLeft + e.offsetWidth}px, ${e.offsetTop + e.offsetHeight / 2}px) translate(-100%, -50%)` : `translate(${e.offsetLeft + e.offsetWidth / 2}px, ${e.offsetTop + e.offsetHeight}px) translate(-50%, -100%)`
59
+ };
60
+ for (let e of P.value) e && z?.observe(e);
61
+ }
62
+ h(() => {
63
+ let e = F.value.ownerDocument.defaultView;
64
+ e.ResizeObserver && (z = new e.ResizeObserver(V), z.observe(F.value)), V(), B = e.requestAnimationFrame(() => {
65
+ R.value = !0;
66
+ });
67
+ }), m(() => {
68
+ z?.disconnect(), F.value?.ownerDocument.defaultView.cancelAnimationFrame(B);
69
+ });
70
+ let H = b(M.modelValue), U = `kima-tabs-${C()}`, W = a(() => M.orientation === "vertical" ? "vertical" : "horizontal"), G = a(() => {
71
+ let e = M.items.findIndex((e) => Object.is(K(e), H.value) && !J(e));
72
+ return e >= 0 ? e : M.items.findIndex((e) => !J(e));
73
+ });
74
+ n(I, () => G.value, { opacity: !1 });
75
+ function K(e) {
76
+ return e && typeof e == "object" && Object.prototype.hasOwnProperty.call(e, "value") ? e.value : e;
77
+ }
78
+ function q(e) {
79
+ return String(e && typeof e == "object" ? e.label ?? e.text ?? e.title ?? e.value ?? "" : e ?? "");
80
+ }
81
+ function J(e) {
82
+ return !!(e && typeof e == "object" && e.disabled);
83
+ }
84
+ function Y(e) {
85
+ if (J(e)) return;
86
+ let t = K(e);
87
+ Object.is(t, H.value) || (H.value = t, N("update:modelValue", t), N("change", t));
88
+ }
89
+ function X(e, t) {
90
+ let n = M.items.length;
91
+ if (!n) return -1;
92
+ let r = e;
93
+ for (let e = 0; e < n; e += 1) {
94
+ if (r >= 0 && r < n && !J(M.items[r])) return r;
95
+ r = (r + t + n) % n;
96
+ }
97
+ return -1;
98
+ }
99
+ function Z(e) {
100
+ if (e < 0) return;
101
+ let t = M.items[e];
102
+ d(() => P.value[e]?.focus()), Y(t);
103
+ }
104
+ function Q(e, t) {
105
+ if (t.isComposing) return;
106
+ let n = W.value === "horizontal", r = n ? t.key === "ArrowRight" : t.key === "ArrowDown", i = n ? t.key === "ArrowLeft" : t.key === "ArrowUp";
107
+ if (t.key === "Home") {
108
+ t.preventDefault(), Z(X(0, 1));
109
+ return;
110
+ }
111
+ if (t.key === "End") {
112
+ t.preventDefault(), Z(X(M.items.length - 1, -1));
113
+ return;
114
+ }
115
+ if (t.key === "Enter" || t.key === " ") {
116
+ t.preventDefault(), Y(M.items[e]);
117
+ return;
118
+ }
119
+ if (!r && !i) return;
120
+ t.preventDefault();
121
+ let a = r ? 1 : -1;
122
+ Z(X((e + a + M.items.length) % M.items.length, a));
123
+ }
124
+ return T(() => M.modelValue, (e) => {
125
+ H.value = e;
126
+ }), T(() => [
127
+ G.value,
128
+ W.value,
129
+ M.items
130
+ ], () => d(V), {
131
+ deep: !0,
132
+ flush: "post"
133
+ }), (n, a) => (g(), s("div", { class: f(["kima-tabs", `kima-tabs--${W.value}`]) }, [c("div", {
134
+ ref_key: "tabList",
135
+ ref: F,
136
+ class: "kima-tabs__list",
137
+ role: "tablist",
138
+ "aria-orientation": W.value
139
+ }, [c("span", {
140
+ class: f(["kima-tabs__marker", { "kima-tabs__marker--ready": R.value }]),
141
+ style: p(L.value),
142
+ "aria-hidden": "true"
143
+ }, null, 6), (g(!0), s(r, null, v(e.items, (e, t) => (g(), s("button", {
144
+ id: `${U}-tab-${t}`,
145
+ key: K(e) ?? t,
146
+ ref_for: !0,
147
+ ref: (e) => {
148
+ P.value[t] = e;
149
+ },
150
+ class: "kima-tabs__tab",
151
+ type: "button",
152
+ role: "tab",
153
+ "aria-selected": t === G.value,
154
+ "aria-controls": `${U}-panel-${t}`,
155
+ "aria-disabled": J(e) || void 0,
156
+ disabled: J(e),
157
+ tabindex: t === G.value ? 0 : -1,
158
+ onClick: (t) => Y(e),
159
+ onKeydown: (e) => Q(t, e)
160
+ }, [y(n.$slots, "tab", {
161
+ item: e,
162
+ index: t,
163
+ selected: t === G.value
164
+ }, () => [l(x(q(e)), 1)], !0)], 40, k))), 128))], 8, O), c("div", {
165
+ ref_key: "panels",
166
+ ref: I,
167
+ class: "kima-tabs__panels"
168
+ }, [(g(!0), s(r, null, v(e.items, (e, r) => (g(), o(i, u({
169
+ key: K(e) ?? r,
170
+ name: "kima-content"
171
+ }, { ref_for: !0 }, S(t)), {
172
+ default: E(() => [D(c("section", {
173
+ id: `${U}-panel-${r}`,
174
+ class: "kima-tabs__panel",
175
+ role: "tabpanel",
176
+ "aria-labelledby": `${U}-tab-${r}`,
177
+ inert: r !== G.value,
178
+ "aria-hidden": r !== G.value || void 0,
179
+ tabindex: r === G.value ? 0 : -1
180
+ }, [y(n.$slots, "panel", {
181
+ item: e,
182
+ index: r,
183
+ value: K(e)
184
+ }, () => [y(n.$slots, "default", {
185
+ item: e,
186
+ index: r,
187
+ value: K(e)
188
+ }, void 0, !0)], !0)], 8, A), [[w, r === G.value]])]),
189
+ _: 2
190
+ }, 1040))), 128))], 512)], 2));
191
+ }
192
+ }, [["__scopeId", "data-v-9535a533"]]);
193
+ export { j as default };
@@ -0,0 +1,194 @@
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 { collapseTransition as r, presenceTransition as i } from "../../utils/motion.js";
5
+ /* empty css */
6
+ import { Transition as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createVNode as d, isRef as f, mergeProps as p, nextTick as m, normalizeClass as h, normalizeStyle as g, onBeforeUnmount as _, onMounted as v, openBlock as y, ref as b, toDisplayString as x, unref as S, useAttrs as C, useId as w, vShow as T, watch as E, withCtx as D, withDirectives as O, withModifiers as k } from "vue";
7
+ import { Cancel01Icon as A, ViewIcon as ee, ViewOffIcon as te } from "@hugeicons/core-free-icons";
8
+ // src/components/core/text-field.ce.vue
9
+ var ne = ["aria-disabled"], re = [
10
+ "name",
11
+ "type",
12
+ "value",
13
+ "required",
14
+ "disabled",
15
+ "readonly",
16
+ "placeholder",
17
+ "aria-label",
18
+ "aria-describedby",
19
+ "aria-invalid",
20
+ "aria-required"
21
+ ], ie = {
22
+ key: 0,
23
+ class: "kima-text-field__actions"
24
+ }, ae = ["aria-label", "disabled"], oe = ["disabled"], se = ["disabled"], j = ["inert", "aria-hidden"], M = ["id", "role"], N = /*#__PURE__*/ t(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
25
+ __name: "text-field.ce",
26
+ props: {
27
+ label: {
28
+ type: String,
29
+ default: ""
30
+ },
31
+ hint: {
32
+ type: String,
33
+ default: ""
34
+ },
35
+ error: {
36
+ type: String,
37
+ default: ""
38
+ },
39
+ modelValue: {
40
+ type: String,
41
+ default: ""
42
+ },
43
+ type: {
44
+ type: String,
45
+ default: "text"
46
+ },
47
+ name: String,
48
+ required: Boolean,
49
+ disabled: Boolean,
50
+ readonly: Boolean,
51
+ placeholder: {
52
+ type: String,
53
+ default: ""
54
+ },
55
+ clearable: Boolean
56
+ },
57
+ emits: ["update:modelValue", "change"],
58
+ setup(t, { expose: N, emit: P }) {
59
+ let F = t, I = P, L = C(), R = w(), z = b(null), B = b(null);
60
+ e(B);
61
+ let V = b(!1), H = b(F.modelValue), U = !1, W, G, K = `kima-text-field-${R}-hint`, q = `kima-text-field-${R}-error`, J = o(() => F.error.length > 0), Y = o(() => F.clearable && H.value.length > 0 && !F.readonly), ce = o(() => F.type === "password" && V.value ? "text" : F.type);
62
+ function le() {
63
+ let e = [];
64
+ return F.error ? e.push(q) : F.hint && e.push(K), L["aria-describedby"] && e.push(L["aria-describedby"]), e.length > 0 ? e.join(" ") : void 0;
65
+ }
66
+ function ue() {
67
+ return L["aria-label"] || L.ariaLabel || F.label || F.placeholder || void 0;
68
+ }
69
+ function de() {
70
+ let e = { ...L };
71
+ return delete e.id, delete e.class, delete e.style, delete e["aria-describedby"], delete e["aria-label"], delete e.ariaLabel, e;
72
+ }
73
+ E(() => F.modelValue, (e) => {
74
+ e !== H.value && (H.value = e);
75
+ });
76
+ function X(e) {
77
+ U || e.isComposing || e.target.value === H.value || (H.value = e.target.value, I("update:modelValue", H.value));
78
+ }
79
+ function Z() {
80
+ I("change", H.value);
81
+ }
82
+ function Q() {
83
+ F.disabled || F.readonly || !H.value || (H.value = "", I("update:modelValue", H.value), I("change", H.value), m(() => z.value?.focus()));
84
+ }
85
+ function fe() {
86
+ z.value?.focus();
87
+ }
88
+ N({ focus: fe });
89
+ function $(e) {
90
+ e.target === z.value.form && queueMicrotask(() => {
91
+ if (e.defaultPrevented || !z.value) return;
92
+ U = !1;
93
+ let t = H.value !== W;
94
+ H.value = W, z.value.value = W, t && I("update:modelValue", W);
95
+ });
96
+ }
97
+ return v(() => {
98
+ W = H.value, z.value.defaultValue = W, G = z.value.ownerDocument, G.addEventListener("reset", $, !0);
99
+ }), _(() => G.removeEventListener("reset", $, !0)), (e, o) => (y(), l("div", {
100
+ class: h(["kima-text-field", [{
101
+ "kima-text-field--error": J.value,
102
+ "kima-text-field--disabled": t.disabled,
103
+ "kima-text-field--readonly": t.readonly
104
+ }, S(L).class]]),
105
+ style: g(S(L).style)
106
+ }, [u("div", {
107
+ ref_key: "control",
108
+ ref: B,
109
+ class: "kima-text-field__control",
110
+ "aria-disabled": t.disabled || void 0
111
+ }, [u("input", p({
112
+ ref_key: "input",
113
+ ref: z
114
+ }, de(), {
115
+ name: t.name,
116
+ type: ce.value,
117
+ value: H.value,
118
+ required: t.required,
119
+ disabled: t.disabled,
120
+ readonly: t.readonly,
121
+ placeholder: t.placeholder,
122
+ "aria-label": ue(),
123
+ "aria-describedby": le(),
124
+ "aria-invalid": J.value || void 0,
125
+ "aria-required": t.required || void 0,
126
+ onInput: k(X, ["stop"]),
127
+ onCompositionstart: o[0] ||= (e) => f(U) ? U.value = !0 : U = !0,
128
+ onCompositionend: o[1] ||= (e) => {
129
+ f(U) ? U.value = !1 : U = !1, X(e);
130
+ },
131
+ onChange: k(Z, ["stop"])
132
+ }), null, 16, re), t.type === "password" ? (y(), l("div", ie, [u("button", {
133
+ class: "kima-text-field__action",
134
+ type: "button",
135
+ "aria-label": V.value ? "隐藏密码" : "显示密码",
136
+ disabled: t.disabled,
137
+ onClick: o[2] ||= (e) => V.value = !V.value
138
+ }, [d(n, {
139
+ icon: V.value ? S(te) : S(ee),
140
+ size: 18,
141
+ color: "currentColor"
142
+ }, null, 8, ["icon"])], 8, ae), d(a, p({ name: "kima-fade" }, S(i)), {
143
+ default: D(() => [Y.value ? (y(), l("button", {
144
+ key: 0,
145
+ class: "kima-text-field__action",
146
+ type: "button",
147
+ "aria-label": "清除内容",
148
+ disabled: t.disabled,
149
+ onClick: Q
150
+ }, [d(n, {
151
+ icon: S(A),
152
+ size: 18,
153
+ color: "currentColor"
154
+ }, null, 8, ["icon"])], 8, oe)) : c("", !0)]),
155
+ _: 1
156
+ }, 16)])) : (y(), s(a, p({
157
+ key: 1,
158
+ name: "kima-fade"
159
+ }, S(i)), {
160
+ default: D(() => [Y.value ? (y(), l("button", {
161
+ key: 0,
162
+ class: "kima-text-field__action kima-text-field__action--clear",
163
+ type: "button",
164
+ "aria-label": "清除内容",
165
+ disabled: t.disabled,
166
+ onClick: Q
167
+ }, [d(n, {
168
+ icon: S(A),
169
+ size: 18,
170
+ color: "currentColor"
171
+ }, null, 8, ["icon"])], 8, se)) : c("", !0)]),
172
+ _: 1
173
+ }, 16))], 8, ne), d(a, p({ css: !1 }, {
174
+ ...S(r),
175
+ ...S(i)
176
+ }), {
177
+ default: D(() => [O(u("div", {
178
+ class: "kima-text-field__message-wrap",
179
+ inert: !(t.error || t.hint),
180
+ "aria-hidden": !(t.error || t.hint) || void 0
181
+ }, [d(a, p({ name: "kima-fade" }, S(i)), {
182
+ default: D(() => [t.error || t.hint ? (y(), l("p", {
183
+ key: `${t.error ? "error" : "hint"}:${t.error || t.hint}`,
184
+ class: h(["kima-text-field__message", { "kima-text-field__message--error": !!t.error }]),
185
+ id: t.error ? q : K,
186
+ role: t.error ? "alert" : void 0
187
+ }, x(t.error || t.hint), 11, M)) : c("", !0)]),
188
+ _: 1
189
+ }, 16)], 8, j), [[T, t.error || t.hint]])]),
190
+ _: 1
191
+ }, 16)], 6));
192
+ }
193
+ }), [["__scopeId", "data-v-7334ab60"]]);
194
+ export { N as default };