@kernel4632/kima 0.9.6 → 0.9.8
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.
- package/dist/components/display/list.ce.vue_vue_type_style_index_0_scoped_88e398dc_lang.css +1 -0
- package/dist/components/interaction/multi-select.ce.vue_vue_type_style_index_0_scoped_0b8ec686_lang.css +1 -0
- package/dist/components/utility/tag-group.ce.vue_vue_type_style_index_0_scoped_de9894bd_lang.css +1 -0
- package/dist/kima-elements-core.js +71 -50
- package/dist/kima-elements.js +12325 -12271
- package/dist/style.css +4 -4
- package/dist/styles/_tokens.css +1 -1
- package/dist/styles/list.css +1 -1
- package/dist/styles/multi-select.css +1 -1
- package/dist/styles/tag-group.css +1 -1
- package/dist/vue/components/display/list.ce.js +12 -18
- package/dist/vue/components/interaction/multi-select.ce.js +96 -94
- package/dist/vue/components/utility/tag-group.ce.js +46 -53
- package/dist/vue/utils/content-motion.js +80 -48
- package/dist/vue/utils/motion.js +137 -106
- package/package.json +1 -1
- package/dist/components/display/list.ce.vue_vue_type_style_index_0_scoped_df3ec98f_lang.css +0 -1
- package/dist/components/interaction/multi-select.ce.vue_vue_type_style_index_0_scoped_cf70a212_lang.css +0 -1
- package/dist/components/utility/tag-group.ce.vue_vue_type_style_index_0_scoped_b575c982_lang.css +0 -1
package/dist/vue/utils/motion.js
CHANGED
|
@@ -1,84 +1,115 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { nextTick as e, onBeforeUnmount as t, watch as n } from "vue";
|
|
2
2
|
// src/utils/motion.js
|
|
3
|
-
var
|
|
4
|
-
function
|
|
5
|
-
let
|
|
6
|
-
function
|
|
7
|
-
let e =
|
|
3
|
+
var r = /* @__PURE__ */ new WeakMap();
|
|
4
|
+
function i(r, i) {
|
|
5
|
+
let a = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = 0;
|
|
6
|
+
function u() {
|
|
7
|
+
let e = r.value;
|
|
8
8
|
return e?.nodeType === 1 ? e : e?.$el?.nodeType === 1 ? e.$el : null;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
|
|
10
|
+
function d() {
|
|
11
|
+
for (let e of c.values()) e.cancel();
|
|
12
|
+
c.clear();
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
e
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
return n(i, () => {
|
|
15
|
+
l++;
|
|
16
|
+
let e = u();
|
|
17
|
+
if (!e) return;
|
|
18
|
+
let t = e.getBoundingClientRect();
|
|
19
|
+
a = new Map([...e.children].filter((e) => !e.inert).map((e) => {
|
|
20
|
+
let n = e.getBoundingClientRect();
|
|
21
|
+
return [e, {
|
|
22
|
+
rect: n,
|
|
23
|
+
x: n.x - t.x,
|
|
24
|
+
y: n.y - t.y
|
|
21
25
|
}];
|
|
22
|
-
})));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
26
|
+
})), d();
|
|
27
|
+
}, {
|
|
28
|
+
flush: "pre",
|
|
29
|
+
deep: !0
|
|
30
|
+
}), n(i, async () => {
|
|
31
|
+
let t = l;
|
|
32
|
+
if (await e(), t !== l) return;
|
|
33
|
+
let n = u();
|
|
34
|
+
if (!n || o(n) || !n.animate) {
|
|
35
|
+
a.clear();
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
let r = getComputedStyle(n), i = s(r.getPropertyValue("--kima-duration-slow")), d = s(r.getPropertyValue("--kima-duration-fast")), f = r.getPropertyValue("--kima-curve-emphasized").trim() || "ease-out", p = n.getBoundingClientRect(), m = [...n.children].filter((e) => !e.inert && a.has(e)).map((e) => {
|
|
39
|
+
let t = e.getBoundingClientRect(), n = a.get(e);
|
|
40
|
+
return {
|
|
41
|
+
node: e,
|
|
42
|
+
dx: n.x - (t.x - p.x),
|
|
43
|
+
dy: n.y - (t.y - p.y)
|
|
44
|
+
};
|
|
45
|
+
}), h = m.some(({ dy: e }) => e < -.5);
|
|
46
|
+
for (let { node: e, dx: t, dy: n } of m) {
|
|
47
|
+
if (!i || Math.abs(t) + Math.abs(n) < .5) continue;
|
|
48
|
+
let r = [
|
|
49
|
+
{
|
|
50
|
+
transform: `translate(${t}px, ${n}px)`,
|
|
51
|
+
offset: 0,
|
|
52
|
+
easing: f
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
transform: h ? `translate(${t}px, 0)` : `translate(0, ${n}px)`,
|
|
56
|
+
offset: .5,
|
|
57
|
+
easing: f
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
transform: "translate(0, 0)",
|
|
61
|
+
offset: 1
|
|
43
62
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
63
|
+
], a = e.animate(r, {
|
|
64
|
+
duration: i,
|
|
65
|
+
delay: d,
|
|
66
|
+
fill: "backwards"
|
|
67
|
+
});
|
|
68
|
+
c.set(e, a), a.finished.then(() => {
|
|
69
|
+
c.get(e) === a && c.delete(e);
|
|
70
|
+
}).catch(() => {});
|
|
71
|
+
}
|
|
72
|
+
a.clear();
|
|
73
|
+
}, {
|
|
74
|
+
flush: "post",
|
|
75
|
+
deep: !0
|
|
76
|
+
}), t(() => {
|
|
77
|
+
l++, d();
|
|
50
78
|
}), {
|
|
51
|
-
|
|
52
|
-
|
|
79
|
+
beforeLeave(e) {
|
|
80
|
+
p(e, a.get(e)?.rect);
|
|
81
|
+
},
|
|
82
|
+
beforeEnter: f,
|
|
83
|
+
leaveCancelled: f
|
|
53
84
|
};
|
|
54
85
|
}
|
|
55
|
-
var
|
|
56
|
-
function
|
|
86
|
+
var a = /* @__PURE__ */ new WeakMap();
|
|
87
|
+
function o(e) {
|
|
57
88
|
return (e?.closest?.("[data-kima-reduced-motion]"))?.getAttribute("data-kima-reduced-motion") === "reduce" ? !0 : e?.ownerDocument?.defaultView?.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? !1;
|
|
58
89
|
}
|
|
59
|
-
function
|
|
90
|
+
function s(e) {
|
|
60
91
|
let t = parseFloat(e) || 0;
|
|
61
92
|
return e.trim().endsWith("ms") ? t : t * 1e3;
|
|
62
93
|
}
|
|
63
|
-
function
|
|
94
|
+
function c(e) {
|
|
64
95
|
e.inert = !0, e.setAttribute("aria-hidden", "true");
|
|
65
96
|
}
|
|
66
|
-
function
|
|
97
|
+
function l(e) {
|
|
67
98
|
e.inert = !1, e.removeAttribute("aria-hidden");
|
|
68
99
|
}
|
|
69
|
-
var
|
|
70
|
-
onBeforeEnter:
|
|
71
|
-
onBeforeLeave:
|
|
72
|
-
},
|
|
73
|
-
function
|
|
74
|
-
let t =
|
|
75
|
-
t && (Object.assign(e.style, t),
|
|
100
|
+
var u = {
|
|
101
|
+
onBeforeEnter: l,
|
|
102
|
+
onBeforeLeave: c
|
|
103
|
+
}, d = /* @__PURE__ */ new WeakMap();
|
|
104
|
+
function f(e) {
|
|
105
|
+
let t = d.get(e);
|
|
106
|
+
t && (Object.assign(e.style, t), d.delete(e)), l(e);
|
|
76
107
|
}
|
|
77
|
-
function
|
|
78
|
-
let
|
|
79
|
-
if (!
|
|
80
|
-
let
|
|
81
|
-
e.ownerDocument.defaultView.getComputedStyle(
|
|
108
|
+
function p(e, t) {
|
|
109
|
+
let n = e.parentElement;
|
|
110
|
+
if (!n) return;
|
|
111
|
+
let r = t ?? e.getBoundingClientRect(), i = n.getBoundingClientRect();
|
|
112
|
+
e.ownerDocument.defaultView.getComputedStyle(n).position === "static" && (n.style.position = "relative"), d.has(e) || d.set(e, Object.fromEntries([
|
|
82
113
|
"position",
|
|
83
114
|
"top",
|
|
84
115
|
"left",
|
|
@@ -90,36 +121,36 @@ function d(e) {
|
|
|
90
121
|
"margin"
|
|
91
122
|
].map((t) => [t, e.style[t]]))), Object.assign(e.style, {
|
|
92
123
|
position: "absolute",
|
|
93
|
-
top: `${
|
|
94
|
-
left: `${
|
|
124
|
+
top: `${r.top - i.top - n.clientTop + n.scrollTop}px`,
|
|
125
|
+
left: `${r.left - i.left - n.clientLeft + n.scrollLeft}px`,
|
|
95
126
|
right: "auto",
|
|
96
127
|
bottom: "auto",
|
|
97
|
-
width: `${
|
|
98
|
-
height: `${
|
|
128
|
+
width: `${r.width}px`,
|
|
129
|
+
height: `${r.height}px`,
|
|
99
130
|
boxSizing: "border-box",
|
|
100
131
|
margin: "0"
|
|
101
|
-
}),
|
|
132
|
+
}), c(e);
|
|
102
133
|
}
|
|
103
|
-
var
|
|
104
|
-
function
|
|
134
|
+
var m = /* @__PURE__ */ new WeakMap();
|
|
135
|
+
function h(e) {
|
|
105
136
|
let t = e?.getBoundingClientRect().height || 0;
|
|
106
|
-
t > 0 &&
|
|
137
|
+
t > 0 && m.set(e, t);
|
|
107
138
|
}
|
|
108
|
-
function
|
|
109
|
-
let
|
|
110
|
-
|
|
139
|
+
function g(e) {
|
|
140
|
+
let t = r.get(e);
|
|
141
|
+
t && (a.set(e, {
|
|
111
142
|
height: e.getBoundingClientRect().height,
|
|
112
143
|
opacity: getComputedStyle(e).opacity
|
|
113
|
-
}),
|
|
144
|
+
}), t.observer?.disconnect(), r.delete(e), t.animation?.cancel(), e.style.overflow = t.overflow);
|
|
114
145
|
}
|
|
115
|
-
function
|
|
116
|
-
let
|
|
117
|
-
|
|
118
|
-
let l =
|
|
119
|
-
|
|
120
|
-
let d = e.getBoundingClientRect().height ||
|
|
121
|
-
if (!
|
|
122
|
-
|
|
146
|
+
function _(e, t, n) {
|
|
147
|
+
let i = e.ownerDocument.defaultView, c = e.style.display === "none" || i.getComputedStyle(e).display === "none";
|
|
148
|
+
n && c && (e.style.display = "");
|
|
149
|
+
let l = i.getComputedStyle(e), u = a.get(e);
|
|
150
|
+
a.delete(e);
|
|
151
|
+
let d = e.getBoundingClientRect().height || m.get(e) || 0, f = o(e) ? 0 : s(l.getPropertyValue("--kima-duration-slow") || "300ms"), p = l.getPropertyValue("--kima-curve-emphasized").trim() || "ease-out";
|
|
152
|
+
if (!f || !e.animate) {
|
|
153
|
+
t();
|
|
123
154
|
return;
|
|
124
155
|
}
|
|
125
156
|
let h = {
|
|
@@ -127,38 +158,38 @@ function h(e, n, o) {
|
|
|
127
158
|
animation: null,
|
|
128
159
|
observer: null
|
|
129
160
|
};
|
|
130
|
-
|
|
131
|
-
let g =
|
|
132
|
-
function _(
|
|
133
|
-
let
|
|
134
|
-
height: `${
|
|
135
|
-
opacity:
|
|
161
|
+
r.set(e, h), e.style.overflow = "clip";
|
|
162
|
+
let g = n ? d : 0;
|
|
163
|
+
function _(i, a) {
|
|
164
|
+
let o = e.animate([{
|
|
165
|
+
height: `${i}px`,
|
|
166
|
+
opacity: a
|
|
136
167
|
}, {
|
|
137
168
|
height: `${g}px`,
|
|
138
|
-
opacity: +!!
|
|
169
|
+
opacity: +!!n
|
|
139
170
|
}], {
|
|
140
|
-
duration:
|
|
141
|
-
easing:
|
|
171
|
+
duration: f,
|
|
172
|
+
easing: p,
|
|
142
173
|
fill: "both"
|
|
143
174
|
});
|
|
144
|
-
h.animation =
|
|
145
|
-
|
|
175
|
+
h.animation = o, o.finished.then(() => {
|
|
176
|
+
r.get(e) === h && h.animation === o && (h.observer?.disconnect(), r.delete(e), e.style.overflow = h.overflow, t(), o.cancel());
|
|
146
177
|
}).catch(() => {});
|
|
147
178
|
}
|
|
148
|
-
if (_(u?.height ?? (
|
|
149
|
-
let
|
|
150
|
-
h.observer = new
|
|
151
|
-
let
|
|
152
|
-
if (Math.abs(
|
|
153
|
-
let
|
|
154
|
-
g +=
|
|
179
|
+
if (_(u?.height ?? (n ? 0 : d), u?.opacity ?? (n ? 0 : l.opacity)), n && i.ResizeObserver && e.firstElementChild) {
|
|
180
|
+
let t = e.firstElementChild.getBoundingClientRect().height;
|
|
181
|
+
h.observer = new i.ResizeObserver(() => {
|
|
182
|
+
let n = e.firstElementChild?.getBoundingClientRect().height ?? t;
|
|
183
|
+
if (Math.abs(n - t) < .5 || r.get(e) !== h) return;
|
|
184
|
+
let a = e.getBoundingClientRect().height, o = i.getComputedStyle(e).opacity;
|
|
185
|
+
g += n - t, t = n, h.animation.cancel(), _(a, o);
|
|
155
186
|
}), h.observer.observe(e.firstElementChild);
|
|
156
187
|
}
|
|
157
188
|
}
|
|
158
|
-
var
|
|
159
|
-
onEnter: (e, t) =>
|
|
160
|
-
onLeave: (e, t) =>
|
|
161
|
-
onEnterCancelled:
|
|
162
|
-
onLeaveCancelled:
|
|
189
|
+
var v = {
|
|
190
|
+
onEnter: (e, t) => _(e, t, !0),
|
|
191
|
+
onLeave: (e, t) => _(e, t, !1),
|
|
192
|
+
onEnterCancelled: g,
|
|
193
|
+
onLeaveCancelled: g
|
|
163
194
|
};
|
|
164
|
-
export {
|
|
195
|
+
export { l as activateMotionElement, v as collapseTransition, p as freezeLeaveLayout, o as prefersReducedMotion, u as presenceTransition, h as rememberCollapseHeight, f as restoreLeaveLayout, c as retireMotionElement, i as useLayoutFlip };
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@keyframes kima-ripple-glow-df3ec98f{0%{opacity:.14}55%{opacity:.1}to{opacity:0}}.kima-list[data-v-df3ec98f]{box-sizing:border-box;min-width:0;font-family:var(--kima-font-family);font-size:var(--kima-font-size-body-medium);font-weight:var(--kima-font-weight-semi-bold);line-height:var(--kima-line-height-normal);color:var(--kima-color-on-surface);overflow-wrap:anywhere;gap:var(--kima-list-gap,var(--kima-space-3));width:100%;min-width:0;margin:0;padding:0;list-style-position:inside;display:grid}.kima-list[data-v-df3ec98f]:is(ul){list-style:none}.kima-list__item[data-v-df3ec98f]{background:var(--kima-color-layer-1);min-height:var(--kima-list-item-height);padding:var(--kima-space-5);border-radius:var(--kima-radius-m);border:0}.kima-list--plain .kima-list__item[data-v-df3ec98f]{background:0 0;border-radius:0;min-height:0;padding:0}.kima-list:is(ul) .kima-list__item[data-v-df3ec98f]{align-items:center;gap:var(--kima-space-4);display:flex}.kima-list__body[data-v-df3ec98f]{flex:1;min-width:0}.kima-list p[data-v-df3ec98f]{margin:var(--kima-space-2) 0 0;color:var(--kima-color-on-surface-variant)}.kima-list__action[data-v-df3ec98f]{gap:var(--kima-space-2);flex-wrap:wrap;display:flex}.kima-list__empty[data-v-df3ec98f]{padding:var(--kima-space-6);color:var(--kima-color-on-surface-variant);list-style:none}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@keyframes kima-ripple-glow-cf70a212{0%{opacity:.14}55%{opacity:.1}to{opacity:0}}.kima-multi-select[data-v-cf70a212]{min-width:0;color:var(--kima-color-on-surface);font-family:var(--kima-font-family);font-size:var(--kima-font-size-body-medium);gap:var(--kima-space-3);max-width:100%;line-height:1.5;display:grid;position:relative}.kima-multi-select__control[data-v-cf70a212],.kima-multi-select__chips[data-v-cf70a212]{align-items:center;gap:var(--kima-space-2);flex-wrap:wrap;grid-column:1/-1;display:flex}.kima-multi-select__chip[data-v-cf70a212],.kima-multi-select__clear[data-v-cf70a212]{display:inline-flex}.kima-multi-select__chips[data-v-cf70a212]:empty{display:none}.kima-multi-select__search[data-v-cf70a212]{box-sizing:border-box;width:100%;min-height:48px;margin-bottom:var(--kima-space-2);padding:var(--kima-space-3);border-radius:var(--kima-radius-m);background:var(--kima-color-layer-2);color:var(--kima-color-on-surface);font:inherit;border:0}.kima-multi-select__search[data-v-cf70a212]:focus{outline:var(--kima-focus-ring-width) solid var(--kima-color-primary);outline-offset:-2px}.kima-multi-select__list[data-v-cf70a212]{outline:none}.kima-multi-select__item[data-v-cf70a212]:focus-visible{outline:var(--kima-focus-ring-width) solid var(--kima-color-primary);outline-offset:var(--kima-focus-ring-offset)}.kima-multi-select__item[data-v-cf70a212]:disabled,.kima-multi-select__item[aria-disabled=true][data-v-cf70a212]{cursor:not-allowed;opacity:var(--kima-opacity-disabled)}.kima-multi-select__item[data-v-cf70a212]{box-sizing:border-box;justify-content:space-between;align-items:center;gap:var(--kima-space-3);width:100%;min-height:48px;padding:var(--kima-space-2) var(--kima-space-3);border-radius:var(--kima-radius-s);background:var(--kima-color-transparent);color:var(--kima-color-on-surface);font:inherit;text-align:start;cursor:pointer;transition:background-color var(--kima-duration-effects) var(--kima-curve-standard), color var(--kima-duration-effects) var(--kima-curve-standard);border:0;display:flex}.kima-multi-select__item[data-v-cf70a212]:hover:not([aria-disabled=true]):not([data-disabled]),.kima-multi-select__item[data-highlighted][data-v-cf70a212],.kima-multi-select__item[data-active=true][data-v-cf70a212]{background:var(--kima-color-layer-3)}.kima-multi-select__item[aria-selected=true][data-v-cf70a212]{color:var(--kima-color-on-primary-container);background:var(--kima-color-primary-container)}.kima-multi-select__item[aria-selected=true][data-v-cf70a212]:hover,.kima-multi-select__item[aria-selected=true][data-active=true][data-v-cf70a212]{background:var(--kima-color-primary-container-hover)}.kima-multi-select__item[data-disabled][data-v-cf70a212]{opacity:var(--kima-opacity-disabled);cursor:not-allowed}.kima-multi-select__native[data-v-cf70a212]{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:0;padding:0;position:absolute;overflow:hidden}.kima-multi-select small[data-v-cf70a212]{color:var(--kima-color-on-surface-variant);display:block}.kima-multi-select__popup{min-width:0;color:var(--kima-color-on-surface);font-family:var(--kima-font-family);font-size:var(--kima-font-size-body-medium);background:var(--kima-color-popup);box-shadow:var(--kima-elevation-3);box-sizing:border-box;z-index:60;width:min(360px,100vw - 24px);max-height:min(70vh, var(--reka-popper-available-height,70vh));padding:var(--kima-space-4);border-radius:var(--kima-radius-l);padding:var(--kima-space-2);border:0;outline:none;line-height:1.5;overflow:auto}
|
package/dist/components/utility/tag-group.ce.vue_vue_type_style_index_0_scoped_b575c982_lang.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.kima-tag-group[data-v-b575c982]{color:var(--kima-color-on-surface);font-family:var(--kima-font-family)}.kima-tag-group__items[data-v-b575c982]{gap:var(--kima-space-2);flex-wrap:wrap;display:flex;position:relative}
|