adverich-kun-ui 0.1.643 → 0.1.644

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/AGENTS.md CHANGED
@@ -811,6 +811,10 @@ autoplay:play, autoplay:stop, autoplay:interaction
811
811
 
812
812
  **Slots:** default (slides), #prev, #next, #dots
813
813
 
814
+ **Clicks post-drag:** se suprimen automáticamente en captura; el contenido
815
+ puede usar `useKunCarousel()` (inyecta `{ api, didDrag, selectedIndex,
816
+ isDragging, isSettled }`) para no cablear refs en grillas/cards.
817
+
814
818
  **Showcase:** `/examples/KunCarousel` es una única página con todos los demos
815
819
  juntos, uno debajo del otro (Default, Loop, RightToLeft, SlidesToScroll,
816
820
  DragFree, Align, VariableWidths, YAxis, SlidesPerView, Thumbnails,
package/dist/AGENTS.md CHANGED
@@ -811,6 +811,10 @@ autoplay:play, autoplay:stop, autoplay:interaction
811
811
 
812
812
  **Slots:** default (slides), #prev, #next, #dots
813
813
 
814
+ **Clicks post-drag:** se suprimen automáticamente en captura; el contenido
815
+ puede usar `useKunCarousel()` (inyecta `{ api, didDrag, selectedIndex,
816
+ isDragging, isSettled }`) para no cablear refs en grillas/cards.
817
+
814
818
  **Showcase:** `/examples/KunCarousel` es una única página con todos los demos
815
819
  juntos, uno debajo del otro (Default, Loop, RightToLeft, SlidesToScroll,
816
820
  DragFree, Align, VariableWidths, YAxis, SlidesPerView, Thumbnails,
@@ -1,10 +1,11 @@
1
1
  import { __exportAll as e } from "../../../../_virtual/_rolldown/runtime.js";
2
2
  import t from "../composables/kunCarouselProps.js";
3
3
  import n from "../composables/useKunCarouselEngine.js";
4
+ import { KUN_CAROUSEL_KEY as r } from "../composables/kunCarouselContext.js";
4
5
  /* empty css */
5
- import { Fragment as r, computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, normalizeClass as c, normalizeStyle as l, openBlock as u, ref as d, renderList as f, renderSlot as p, unref as m } from "vue";
6
+ import { Fragment as i, computed as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, normalizeClass as l, normalizeStyle as u, openBlock as d, provide as f, ref as p, renderList as m, renderSlot as h, unref as g } from "vue";
6
7
  //#region src/components/KunCarousel/src/components/KunCarousel.vue
7
- var h = /* @__PURE__ */ e({ default: () => k }), g = ["aria-label"], _ = ["disabled", "aria-label"], v = {
8
+ var _ = /* @__PURE__ */ e({ default: () => k }), v = ["aria-label"], y = ["disabled", "aria-label"], b = {
8
9
  key: 1,
9
10
  xmlns: "http://www.w3.org/2000/svg",
10
11
  viewBox: "0 0 24 24",
@@ -14,7 +15,7 @@ var h = /* @__PURE__ */ e({ default: () => k }), g = ["aria-label"], _ = ["disab
14
15
  "stroke-linecap": "round",
15
16
  "stroke-linejoin": "round",
16
17
  class: "w-5 h-5"
17
- }, y = ["disabled", "aria-label"], b = {
18
+ }, x = ["disabled", "aria-label"], S = {
18
19
  key: 1,
19
20
  xmlns: "http://www.w3.org/2000/svg",
20
21
  viewBox: "0 0 24 24",
@@ -24,10 +25,10 @@ var h = /* @__PURE__ */ e({ default: () => k }), g = ["aria-label"], _ = ["disab
24
25
  "stroke-linecap": "round",
25
26
  "stroke-linejoin": "round",
26
27
  class: "w-5 h-5"
27
- }, x = {
28
+ }, ee = {
28
29
  key: 1,
29
30
  class: "mt-3 flex items-center justify-center gap-3"
30
- }, S = ["disabled", "aria-label"], C = {
31
+ }, te = ["disabled", "aria-label"], C = {
31
32
  key: 0,
32
33
  d: "m15 18-6-6 6-6"
33
34
  }, w = {
@@ -77,17 +78,25 @@ var h = /* @__PURE__ */ e({ default: () => k }), g = ["aria-label"], _ = ["disab
77
78
  "autoplay:stop",
78
79
  "autoplay:interaction"
79
80
  ],
80
- setup(e, { expose: t, emit: h }) {
81
- let k = e, A = h, j = d(null), M = d(null), { api: N, selectedIndex: P, previousIndex: F, snaps: I, inView: L, scrollProgress: R, canPrev: z, canNext: B, isDragging: V, isSettled: H, autoplayPlaying: U, effectiveOptions: W, reInit: G } = n({
81
+ setup(e, { expose: t, emit: _ }) {
82
+ let k = e, A = _, j = p(null), M = p(null), { api: N, selectedIndex: P, previousIndex: F, snaps: I, inView: L, scrollProgress: R, canPrev: z, canNext: B, isDragging: V, isSettled: H, didDrag: U, autoplayPlaying: W, effectiveOptions: G, reInit: ne } = n({
82
83
  props: k,
83
84
  emit: A,
84
85
  viewportRef: j,
85
86
  containerRef: M
86
- }), K = i(() => W.value.axis === "y"), q = i(() => !K.value && W.value.direction === "rtl"), J = i(() => ({
87
+ });
88
+ f(r, {
89
+ api: N,
90
+ didDrag: U,
91
+ selectedIndex: P,
92
+ isDragging: V,
93
+ isSettled: H
94
+ });
95
+ let K = a(() => G.value.axis === "y"), q = a(() => !K.value && G.value.direction === "rtl"), J = a(() => ({
87
96
  ...K.value ? { height: k.height } : {},
88
97
  direction: q.value ? "rtl" : "ltr",
89
98
  touchAction: K.value ? "pan-x" : "pan-y"
90
- })), Y = i(() => ({
99
+ })), Y = a(() => ({
91
100
  "--kun-slide-size": k.slideSize,
92
101
  gap: k.gap
93
102
  }));
@@ -140,42 +149,43 @@ var h = /* @__PURE__ */ e({ default: () => k }), g = ["aria-label"], _ = ["disab
140
149
  canNext: B,
141
150
  isDragging: V,
142
151
  isSettled: H,
143
- autoplayPlaying: U,
144
- options: W
145
- }), (t, n) => (u(), o("div", { class: c(["kun-carousel relative w-full", k.wrapperClass]) }, [
146
- s("div", {
152
+ didDrag: U,
153
+ autoplayPlaying: W,
154
+ options: G
155
+ }), (t, n) => (d(), s("div", { class: l(["kun-carousel relative w-full", k.wrapperClass]) }, [
156
+ c("div", {
147
157
  ref_key: "viewportRef",
148
158
  ref: j,
149
159
  tabindex: "0",
150
- class: c([
160
+ class: l([
151
161
  "kun-carousel__viewport overflow-hidden outline-none select-none",
152
162
  K.value ? "" : "w-full",
153
163
  t.axis === "x" ? "kun-carousel__viewport--x" : "kun-carousel__viewport--y",
154
- m(V) ? "cursor-grabbing" : "cursor-grab",
164
+ g(V) ? "cursor-grabbing" : "cursor-grab",
155
165
  k.viewportClass
156
166
  ]),
157
- style: l(J.value),
167
+ style: u(J.value),
158
168
  role: "region",
159
169
  "aria-roledescription": "carousel",
160
170
  "aria-label": e.ariaLabel
161
- }, [s("div", {
171
+ }, [c("div", {
162
172
  ref_key: "containerRef",
163
173
  ref: M,
164
- class: c([
174
+ class: l([
165
175
  "kun-carousel__container flex will-change-transform",
166
176
  K.value ? "flex-col" : "flex-row",
167
177
  k.containerClass
168
178
  ]),
169
- style: l(Y.value)
170
- }, [p(t.$slots, "default")], 6)], 14, g),
171
- k.showArrows && k.arrowsPosition === "sides" ? (u(), o(r, { key: 0 }, [p(t.$slots, "prev", {
179
+ style: u(Y.value)
180
+ }, [h(t.$slots, "default")], 6)], 14, v),
181
+ k.showArrows && k.arrowsPosition === "sides" ? (d(), s(i, { key: 0 }, [h(t.$slots, "prev", {
172
182
  goToPrev: Z,
173
- disabled: !m(z),
174
- canGoToPrev: m(z)
175
- }, () => [s("button", {
183
+ disabled: !g(z),
184
+ canGoToPrev: g(z)
185
+ }, () => [c("button", {
176
186
  type: "button",
177
- disabled: !m(z),
178
- class: c([
187
+ disabled: !g(z),
188
+ class: l([
179
189
  "kun-carousel__arrow kun-carousel__arrow--prev",
180
190
  "absolute top-1/2 -translate-y-1/2 left-2 z-10",
181
191
  "flex items-center justify-center w-9 h-9 rounded-full",
@@ -185,7 +195,7 @@ var h = /* @__PURE__ */ e({ default: () => k }), g = ["aria-label"], _ = ["disab
185
195
  ]),
186
196
  "aria-label": e.prevLabel,
187
197
  onClick: Z
188
- }, [K.value ? (u(), o("svg", v, [...n[1] ||= [s("path", { d: "m18 15-6-6-6 6" }, null, -1)]])) : (u(), o("svg", {
198
+ }, [K.value ? (d(), s("svg", b, [...n[1] ||= [c("path", { d: "m18 15-6-6-6 6" }, null, -1)]])) : (d(), s("svg", {
189
199
  key: 0,
190
200
  xmlns: "http://www.w3.org/2000/svg",
191
201
  viewBox: "0 0 24 24",
@@ -194,15 +204,15 @@ var h = /* @__PURE__ */ e({ default: () => k }), g = ["aria-label"], _ = ["disab
194
204
  "stroke-width": "2",
195
205
  "stroke-linecap": "round",
196
206
  "stroke-linejoin": "round",
197
- class: c(["w-5 h-5", { "rotate-180": q.value }])
198
- }, [...n[0] ||= [s("path", { d: "m15 18-6-6 6-6" }, null, -1)]], 2))], 10, _)]), p(t.$slots, "next", {
207
+ class: l(["w-5 h-5", { "rotate-180": q.value }])
208
+ }, [...n[0] ||= [c("path", { d: "m15 18-6-6 6-6" }, null, -1)]], 2))], 10, y)]), h(t.$slots, "next", {
199
209
  goToNext: Q,
200
- disabled: !m(B),
201
- canGoToNext: m(B)
202
- }, () => [s("button", {
210
+ disabled: !g(B),
211
+ canGoToNext: g(B)
212
+ }, () => [c("button", {
203
213
  type: "button",
204
- disabled: !m(B),
205
- class: c([
214
+ disabled: !g(B),
215
+ class: l([
206
216
  "kun-carousel__arrow kun-carousel__arrow--next",
207
217
  "absolute top-1/2 -translate-y-1/2 right-2 z-10",
208
218
  "flex items-center justify-center w-9 h-9 rounded-full",
@@ -212,7 +222,7 @@ var h = /* @__PURE__ */ e({ default: () => k }), g = ["aria-label"], _ = ["disab
212
222
  ]),
213
223
  "aria-label": e.nextLabel,
214
224
  onClick: Q
215
- }, [K.value ? (u(), o("svg", b, [...n[3] ||= [s("path", { d: "m6 9 6 6 6-6" }, null, -1)]])) : (u(), o("svg", {
225
+ }, [K.value ? (d(), s("svg", S, [...n[3] ||= [c("path", { d: "m6 9 6 6 6-6" }, null, -1)]])) : (d(), s("svg", {
216
226
  key: 0,
217
227
  xmlns: "http://www.w3.org/2000/svg",
218
228
  viewBox: "0 0 24 24",
@@ -221,17 +231,17 @@ var h = /* @__PURE__ */ e({ default: () => k }), g = ["aria-label"], _ = ["disab
221
231
  "stroke-width": "2",
222
232
  "stroke-linecap": "round",
223
233
  "stroke-linejoin": "round",
224
- class: c(["w-5 h-5", { "rotate-180": q.value }])
225
- }, [...n[2] ||= [s("path", { d: "m9 18 6-6-6-6" }, null, -1)]], 2))], 10, y)])], 64)) : a("", !0),
226
- k.showArrows && k.arrowsPosition === "bottom" || k.showDots ? (u(), o("div", x, [
227
- k.showArrows && k.arrowsPosition === "bottom" ? p(t.$slots, "prev", {
234
+ class: l(["w-5 h-5", { "rotate-180": q.value }])
235
+ }, [...n[2] ||= [c("path", { d: "m9 18 6-6-6-6" }, null, -1)]], 2))], 10, x)])], 64)) : o("", !0),
236
+ k.showArrows && k.arrowsPosition === "bottom" || k.showDots ? (d(), s("div", ee, [
237
+ k.showArrows && k.arrowsPosition === "bottom" ? h(t.$slots, "prev", {
228
238
  goToPrev: Z,
229
- disabled: !m(z),
230
- canGoToPrev: m(z)
231
- }, () => [s("button", {
239
+ disabled: !g(z),
240
+ canGoToPrev: g(z)
241
+ }, () => [c("button", {
232
242
  type: "button",
233
- disabled: !m(z),
234
- class: c([
243
+ disabled: !g(z),
244
+ class: l([
235
245
  "kun-carousel__arrow kun-carousel__arrow--prev",
236
246
  "flex items-center justify-center w-8 h-8 rounded-full",
237
247
  "bg-surface-dark text-ui border border-surface cursor-pointer",
@@ -240,7 +250,7 @@ var h = /* @__PURE__ */ e({ default: () => k }), g = ["aria-label"], _ = ["disab
240
250
  ]),
241
251
  "aria-label": e.prevLabel,
242
252
  onClick: Z
243
- }, [(u(), o("svg", {
253
+ }, [(d(), s("svg", {
244
254
  xmlns: "http://www.w3.org/2000/svg",
245
255
  viewBox: "0 0 24 24",
246
256
  fill: "none",
@@ -248,33 +258,33 @@ var h = /* @__PURE__ */ e({ default: () => k }), g = ["aria-label"], _ = ["disab
248
258
  "stroke-width": "2",
249
259
  "stroke-linecap": "round",
250
260
  "stroke-linejoin": "round",
251
- class: c(["w-4 h-4", { "rotate-180": q.value && !K.value }])
252
- }, [K.value ? (u(), o("path", w)) : (u(), o("path", C))], 2))], 10, S)], void 0, 0) : a("", !0),
253
- k.showDots ? p(t.$slots, "dots", {
254
- snaps: m(I),
255
- selectedIndex: m(P),
261
+ class: l(["w-4 h-4", { "rotate-180": q.value && !K.value }])
262
+ }, [K.value ? (d(), s("path", w)) : (d(), s("path", C))], 2))], 10, te)], void 0, 0) : o("", !0),
263
+ k.showDots ? h(t.$slots, "dots", {
264
+ snaps: g(I),
265
+ selectedIndex: g(P),
256
266
  goTo: $
257
- }, () => [s("div", {
258
- class: c(["flex items-center gap-2", k.dotsClass]),
267
+ }, () => [c("div", {
268
+ class: l(["flex items-center gap-2", k.dotsClass]),
259
269
  role: "tablist",
260
270
  "aria-label": "Slides"
261
- }, [(u(!0), o(r, null, f(m(I), (e, t) => (u(), o("button", {
271
+ }, [(d(!0), s(i, null, m(g(I), (e, t) => (d(), s("button", {
262
272
  key: t,
263
273
  type: "button",
264
274
  role: "tab",
265
- "aria-selected": t === m(P),
275
+ "aria-selected": t === g(P),
266
276
  "aria-label": `Ir al slide ${t + 1}`,
267
- class: c(["h-2 rounded-full transition-all cursor-pointer", t === m(P) ? "w-6 bg-primary" : "w-2 bg-surface-light hover:bg-surface"]),
277
+ class: l(["h-2 rounded-full transition-all cursor-pointer", t === g(P) ? "w-6 bg-primary" : "w-2 bg-surface-light hover:bg-surface"]),
268
278
  onClick: (e) => $(t)
269
- }, null, 10, T))), 128))], 2)], void 0, 1) : a("", !0),
270
- k.showArrows && k.arrowsPosition === "bottom" ? p(t.$slots, "next", {
279
+ }, null, 10, T))), 128))], 2)], void 0, 1) : o("", !0),
280
+ k.showArrows && k.arrowsPosition === "bottom" ? h(t.$slots, "next", {
271
281
  goToNext: Q,
272
- disabled: !m(B),
273
- canGoToNext: m(B)
274
- }, () => [s("button", {
282
+ disabled: !g(B),
283
+ canGoToNext: g(B)
284
+ }, () => [c("button", {
275
285
  type: "button",
276
- disabled: !m(B),
277
- class: c([
286
+ disabled: !g(B),
287
+ class: l([
278
288
  "kun-carousel__arrow kun-carousel__arrow--next",
279
289
  "flex items-center justify-center w-8 h-8 rounded-full",
280
290
  "bg-surface-dark text-ui border border-surface cursor-pointer",
@@ -283,7 +293,7 @@ var h = /* @__PURE__ */ e({ default: () => k }), g = ["aria-label"], _ = ["disab
283
293
  ]),
284
294
  "aria-label": e.nextLabel,
285
295
  onClick: Q
286
- }, [(u(), o("svg", {
296
+ }, [(d(), s("svg", {
287
297
  xmlns: "http://www.w3.org/2000/svg",
288
298
  viewBox: "0 0 24 24",
289
299
  fill: "none",
@@ -291,11 +301,11 @@ var h = /* @__PURE__ */ e({ default: () => k }), g = ["aria-label"], _ = ["disab
291
301
  "stroke-width": "2",
292
302
  "stroke-linecap": "round",
293
303
  "stroke-linejoin": "round",
294
- class: c(["w-4 h-4", { "rotate-180": q.value && !K.value }])
295
- }, [K.value ? (u(), o("path", O)) : (u(), o("path", D))], 2))], 10, E)], void 0, 2) : a("", !0)
296
- ])) : a("", !0)
304
+ class: l(["w-4 h-4", { "rotate-180": q.value && !K.value }])
305
+ }, [K.value ? (d(), s("path", O)) : (d(), s("path", D))], 2))], 10, E)], void 0, 2) : o("", !0)
306
+ ])) : o("", !0)
297
307
  ], 2));
298
308
  }
299
309
  };
300
310
  //#endregion
301
- export { h as KunCarousel_exports, k as default };
311
+ export { _ as KunCarousel_exports, k as default };
@@ -0,0 +1,8 @@
1
+ import { inject as e } from "vue";
2
+ //#region src/components/KunCarousel/src/composables/kunCarouselContext.js
3
+ var t = Symbol("kun-carousel");
4
+ function n() {
5
+ return e(t, null);
6
+ }
7
+ //#endregion
8
+ export { t as KUN_CAROUSEL_KEY, n as default, n as useKunCarousel };