@kiva/kv-components 7.0.0 → 7.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.
@@ -1 +1 @@
1
- @media (min-width: 64rem){.aside-controls-content[data-v-bb42b5ff]{width:82%}}.circle-slide[data-v-bb42b5ff]{width:auto}.circle-slide.is-selected[data-v-bb42b5ff]{opacity:1;transform:scale(1.2);max-width:300px}.circle-slide[data-v-bb42b5ff]:not(.is-selected){opacity:.5;transform:scale(.7)}.circle-carousel[data-v-bb42b5ff]{margin:0 auto}
1
+ @media (min-width: 64rem){.aside-controls-content[data-v-7c085f82]{width:82%}}.circle-slide[data-v-7c085f82]{width:auto}.circle-slide.is-selected[data-v-7c085f82]{opacity:1;transform:scale(1.2);max-width:300px}.circle-slide[data-v-7c085f82]:not(.is-selected){opacity:.5;transform:scale(.7)}.circle-carousel[data-v-7c085f82]{margin:0 auto}
@@ -1,12 +1,13 @@
1
- import { mdiArrowLeft as L, mdiArrowRight as B, mdiChevronLeft as U, mdiChevronRight as V } from "@mdi/js";
2
- import { carouselUtil as E } from "../utils/carousels.js";
3
- import K from "./KvMaterialIcon.js";
4
- import { resolveComponent as M, openBlock as n, createElementBlock as a, normalizeClass as w, createElementVNode as i, Fragment as f, renderList as b, normalizeStyle as N, renderSlot as O, createVNode as c, toDisplayString as y, createCommentVNode as g } from "vue";
1
+ import { mdiArrowLeft as j, mdiArrowRight as A, mdiChevronLeft as B, mdiChevronRight as L } from "@mdi/js";
2
+ import { carouselUtil as K } from "../utils/carousels.js";
3
+ import U from "./KvMaterialIcon.js";
4
+ import { resolveComponent as V, openBlock as r, createElementBlock as n, normalizeClass as d, createElementVNode as i, Fragment as u, renderList as g, normalizeStyle as E, renderSlot as M, createVNode as c, toDisplayString as h, createCommentVNode as f } from "vue";
5
5
  import "./KvCarousel.css";
6
- import R from "../_virtual/_plugin-vue_export-helper.js";
7
- const W = {
6
+ import N from "../_virtual/_plugin-vue_export-helper.js";
7
+ const O = {
8
+ name: "KvCarousel",
8
9
  components: {
9
- KvMaterialIcon: K
10
+ KvMaterialIcon: U
10
11
  },
11
12
  props: {
12
13
  /**
@@ -52,7 +53,7 @@ const W = {
52
53
  slidesToScroll: {
53
54
  type: String,
54
55
  default: "auto",
55
- validator: (s) => ["visible", "auto"].indexOf(s) !== -1
56
+ validator: (w) => ["visible", "auto"].indexOf(w) !== -1
56
57
  },
57
58
  /**
58
59
  * CSS value and unit to set the max width on responsive slides.
@@ -83,164 +84,182 @@ const W = {
83
84
  inCircle: {
84
85
  type: Boolean,
85
86
  default: !1
87
+ },
88
+ /**
89
+ * Position carousel controls in the top right corner
90
+ * */
91
+ controlsTopRight: {
92
+ type: Boolean,
93
+ default: !1
86
94
  }
87
95
  },
88
96
  emits: [
89
97
  "change",
90
98
  "interact-carousel"
91
99
  ],
92
- setup(s, { emit: e, slots: l }) {
100
+ setup(w, { emit: l, slots: e }) {
93
101
  const {
94
102
  componentSlotKeys: t,
95
103
  currentIndex: m,
96
- embla: u,
97
- goToSlide: d,
98
- handleUserInteraction: r,
99
- isAriaHidden: o,
100
- isAutoplaying: x,
101
- nextIndex: h,
104
+ embla: b,
105
+ goToSlide: s,
106
+ handleUserInteraction: o,
107
+ isAriaHidden: a,
108
+ isAutoplaying: y,
109
+ nextIndex: x,
102
110
  previousIndex: v,
103
111
  reInit: C,
104
112
  reInitVisible: I,
105
113
  rootEl: k,
106
114
  slideIndicatorCount: S,
107
115
  slideIndicatorListLength: _,
108
- slides: A,
109
- toggleAutoPlay: j
110
- } = E(s, { emit: e, slots: l });
116
+ slides: R,
117
+ toggleAutoPlay: T
118
+ } = K(w, { emit: l, slots: e });
111
119
  return {
112
120
  componentSlotKeys: t,
113
121
  currentIndex: m,
114
- embla: u,
115
- goToSlide: d,
116
- handleUserInteraction: r,
117
- isAriaHidden: o,
118
- isAutoplaying: x,
119
- mdiArrowLeft: L,
120
- mdiArrowRight: B,
121
- mdiChevronLeft: U,
122
- mdiChevronRight: V,
123
- nextIndex: h,
122
+ embla: b,
123
+ goToSlide: s,
124
+ handleUserInteraction: o,
125
+ isAriaHidden: a,
126
+ isAutoplaying: y,
127
+ mdiArrowLeft: j,
128
+ mdiArrowRight: A,
129
+ mdiChevronLeft: B,
130
+ mdiChevronRight: L,
131
+ nextIndex: x,
124
132
  previousIndex: v,
125
133
  reInit: C,
126
134
  reInitVisible: I,
127
135
  rootEl: k,
128
136
  slideIndicatorCount: S,
129
137
  slideIndicatorListLength: _,
130
- slides: A,
131
- toggleAutoPlay: j
138
+ slides: R,
139
+ toggleAutoPlay: T
132
140
  };
133
141
  }
134
- }, D = ["aria-label", "aria-current", "aria-hidden", "tab-index"], H = ["disabled"], P = ["aria-label"], T = ["disabled"], z = {
142
+ }, W = ["aria-label", "aria-current", "aria-hidden", "tab-index"], D = ["disabled"], H = ["aria-label"], P = ["disabled"], z = {
135
143
  key: 1,
136
144
  class: "kv-carousel__controls tw-flex tw-justify-center tw-items-center tw-gap-1.5 tw-mt-4 tw-w-full"
137
- }, F = ["onClick"], p = {
145
+ }, F = ["onClick"], q = {
138
146
  class: "tw-hidden lg:tw-flex tw-absolute tw-h-full tw-top-0 tw-items-center",
139
147
  style: { background: "linear-gradient(90deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 100%)", width: "8%" }
140
- }, q = ["disabled"], G = {
148
+ }, G = ["disabled"], J = {
141
149
  class: "tw-hidden lg:tw-flex tw-absolute tw-h-full tw-top-0 tw-right-0 tw-items-center tw-justify-end tw-w-16",
142
150
  style: { background: "linear-gradient(270deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 100%)", width: "8%" }
143
- }, J = ["disabled"];
144
- function Q(s, e, l, t, m, u) {
145
- const d = M("kv-material-icon");
146
- return n(), a("section", {
151
+ }, Q = ["disabled"];
152
+ function X(w, l, e, t, m, b) {
153
+ const s = V("kv-material-icon");
154
+ return r(), n("section", {
147
155
  ref: "rootEl",
148
- class: w(["kv-carousel tw-overflow-hidden tw-w-full", { "lg:tw-relative": l.asideControls }]),
156
+ class: d(["kv-carousel tw-overflow-hidden tw-w-full", { "lg:tw-relative": e.asideControls, "tw-relative tw-pt-8": e.controlsTopRight }]),
149
157
  "aria-label": "carousel"
150
158
  }, [
151
159
  i("div", {
152
- class: w(["tw-flex tw-gap-x-4", {
153
- "tw-mx-auto aside-controls-content": l.asideControls,
154
- "circle-carousel": l.inCircle
160
+ class: d(["tw-flex tw-gap-x-4", {
161
+ "tw-mx-auto aside-controls-content": e.asideControls,
162
+ "circle-carousel": e.inCircle
155
163
  }])
156
164
  }, [
157
- (n(!0), a(f, null, b(t.componentSlotKeys, (r, o) => (n(), a("div", {
158
- key: o,
159
- class: w(["tw-flex-none tw-relative", { "tw-w-full": !l.multipleSlidesVisible || l.slideMaxWidth, "circle-slide": l.inCircle }]),
165
+ (r(!0), n(u, null, g(t.componentSlotKeys, (o, a) => (r(), n("div", {
166
+ key: a,
167
+ class: d(["tw-flex-none tw-relative", { "tw-w-full": !e.multipleSlidesVisible || e.slideMaxWidth, "circle-slide": e.inCircle }]),
160
168
  role: "group",
161
- "aria-label": `slide ${o + 1} of ${t.componentSlotKeys.length}`,
162
- "aria-current": t.currentIndex === o ? "true" : "false",
163
- "aria-hidden": t.isAriaHidden(o) ? "true" : "false",
164
- "tab-index": t.isAriaHidden(o) ? "-1" : !1,
165
- style: N(l.slideMaxWidth ? `max-width:${l.slideMaxWidth}` : "")
169
+ "aria-label": `slide ${a + 1} of ${t.componentSlotKeys.length}`,
170
+ "aria-current": t.currentIndex === a ? "true" : "false",
171
+ "aria-hidden": t.isAriaHidden(a) ? "true" : "false",
172
+ "tab-index": t.isAriaHidden(a) ? "-1" : !1,
173
+ style: E(e.slideMaxWidth ? `max-width:${e.slideMaxWidth}` : "")
166
174
  }, [
167
- O(s.$slots, r, {}, void 0, !0)
168
- ], 14, D))), 128))
175
+ M(w.$slots, o, {}, void 0, !0)
176
+ ], 14, W))), 128))
169
177
  ], 2),
170
- t.slideIndicatorCount > 1 && !l.isDotted ? (n(), a("div", {
178
+ t.slideIndicatorCount > 1 && !e.isDotted ? (r(), n("div", {
171
179
  key: 0,
172
- class: w(["kv-carousel__controls tw-flex tw-justify-between md:tw-justify-center tw-items-center tw-mt-4 tw-w-full", { "lg:tw-hidden": l.asideControls }])
180
+ class: d(["kv-carousel__controls tw-flex tw-justify-between tw-items-center tw-w-full", {
181
+ "lg:tw-hidden": e.asideControls,
182
+ "tw-mt-4 md:tw-justify-center": !e.controlsTopRight,
183
+ "md:tw-justify-end tw-absolute tw-top-0 tw-right-0 tw-w-auto tw-gap-2 tw-pr-1": e.controlsTopRight
184
+ }])
173
185
  }, [
174
186
  i("button", {
175
- class: "tw-text-primary tw-rounded-full tw-border-2 tw-border-primary tw-h-4 tw-w-4 tw-flex tw-items-center tw-justify-center disabled:tw-opacity-low disabled:tw-cursor-default",
187
+ class: d(["tw-text-primary tw-h-4 tw-w-4 tw-rounded-full tw-border-primary tw-flex tw-items-center tw-justify-center disabled:tw-opacity-low disabled:tw-cursor-default", {
188
+ "tw-border-2": !e.controlsTopRight,
189
+ "tw-bg-white tw-shadow-lg": e.controlsTopRight
190
+ }]),
176
191
  disabled: t.embla && !t.embla.canScrollPrev(),
177
- onClick: e[0] || (e[0] = (r) => t.handleUserInteraction(t.previousIndex, "click-left-arrow"))
192
+ onClick: l[0] || (l[0] = (o) => t.handleUserInteraction(t.previousIndex, "click-left-arrow"))
178
193
  }, [
179
- c(d, {
194
+ c(s, {
180
195
  class: "tw-w-4",
181
- icon: l.asideControls ? t.mdiArrowLeft : t.mdiChevronLeft
196
+ icon: e.asideControls ? t.mdiArrowLeft : t.mdiChevronLeft
182
197
  }, null, 8, ["icon"]),
183
- e[4] || (e[4] = i("span", { class: "tw-sr-only" }, "Show previous slide", -1))
184
- ], 8, H),
185
- i("div", {
198
+ l[4] || (l[4] = i("span", { class: "tw-sr-only" }, "Show previous slide", -1))
199
+ ], 10, D),
200
+ e.controlsTopRight ? f("", !0) : (r(), n("div", {
201
+ key: 0,
186
202
  "aria-label": `screen ${t.currentIndex + 1} of ${t.slideIndicatorCount}`,
187
203
  class: "tw-mx-2 md:tw-mx-3 lg:tw-mx-4 tw-invisible md:tw-visible"
188
- }, y(t.currentIndex + 1) + "/" + y(t.slideIndicatorCount), 9, P),
204
+ }, h(t.currentIndex + 1) + "/" + h(t.slideIndicatorCount), 9, H)),
189
205
  i("button", {
190
- class: "tw-text-primary tw-rounded-full tw-border-2 tw-border-primary tw-h-4 tw-w-4 tw-flex tw-items-center tw-justify-center disabled:tw-opacity-low disabled:tw-cursor-default",
206
+ class: d(["tw-text-primary tw-h-4 tw-w-4 tw-rounded-full tw-border-primary tw-flex tw-items-center tw-justify-center disabled:tw-opacity-low disabled:tw-cursor-default", {
207
+ "tw-border-2": !e.controlsTopRight,
208
+ "tw-bg-white tw-shadow-lg": e.controlsTopRight
209
+ }]),
191
210
  disabled: t.embla && !t.embla.canScrollNext(),
192
- onClick: e[1] || (e[1] = (r) => t.handleUserInteraction(t.nextIndex, "click-right-arrow"))
211
+ onClick: l[1] || (l[1] = (o) => t.handleUserInteraction(t.nextIndex, "click-right-arrow"))
193
212
  }, [
194
- c(d, {
213
+ c(s, {
195
214
  class: "tw-w-4",
196
- icon: l.asideControls ? t.mdiArrowRight : t.mdiChevronRight
215
+ icon: e.asideControls ? t.mdiArrowRight : t.mdiChevronRight
197
216
  }, null, 8, ["icon"]),
198
- e[5] || (e[5] = i("span", { class: "tw-sr-only" }, "Show next slide", -1))
199
- ], 8, T)
200
- ], 2)) : t.slideIndicatorCount > 1 ? (n(), a("div", z, [
201
- (n(!0), a(f, null, b(t.slideIndicatorCount, (r) => (n(), a("button", {
202
- key: r,
203
- onClick: (o) => t.goToSlide(r - 1)
217
+ l[5] || (l[5] = i("span", { class: "tw-sr-only" }, "Show next slide", -1))
218
+ ], 10, P)
219
+ ], 2)) : t.slideIndicatorCount > 1 ? (r(), n("div", z, [
220
+ (r(!0), n(u, null, g(t.slideIndicatorCount, (o) => (r(), n("button", {
221
+ key: o,
222
+ onClick: (a) => t.goToSlide(o - 1)
204
223
  }, [
205
224
  i("div", {
206
- class: w(["tw-rounded-full tw-border tw-transition tw-duration-500 tw-ease-in-out", [
207
- { "tw-bg-black tw-border-black tw-h-1.5 tw-w-1.5": t.currentIndex === r - 1 },
208
- { "tw-bg-tertiary tw-border-tertiary tw-h-1 tw-w-1": t.currentIndex !== r - 1 }
225
+ class: d(["tw-rounded-full tw-border tw-transition tw-duration-500 tw-ease-in-out", [
226
+ { "tw-bg-black tw-border-black tw-h-1.5 tw-w-1.5": t.currentIndex === o - 1 },
227
+ { "tw-bg-tertiary tw-border-tertiary tw-h-1 tw-w-1": t.currentIndex !== o - 1 }
209
228
  ]])
210
229
  }, null, 2)
211
230
  ], 8, F))), 128))
212
- ])) : g("", !0),
213
- l.asideControls ? (n(), a(f, { key: 2 }, [
214
- i("div", p, [
231
+ ])) : f("", !0),
232
+ e.asideControls ? (r(), n(u, { key: 2 }, [
233
+ i("div", q, [
215
234
  i("button", {
216
235
  class: "tw-text-primary tw-bg-gray-100 tw-rounded-full tw-h-6 tw-w-6 tw-ml-3 tw-flex tw-items-center tw-justify-center disabled:tw-opacity-low disabled:tw-cursor-default",
217
236
  disabled: t.embla && !t.embla.canScrollPrev(),
218
- onClick: e[2] || (e[2] = (r) => t.handleUserInteraction(t.previousIndex, "click-left-arrow"))
237
+ onClick: l[2] || (l[2] = (o) => t.handleUserInteraction(t.previousIndex, "click-left-arrow"))
219
238
  }, [
220
- c(d, {
239
+ c(s, {
221
240
  class: "tw-w-4",
222
241
  icon: t.mdiArrowLeft
223
242
  }, null, 8, ["icon"]),
224
- e[6] || (e[6] = i("span", { class: "tw-sr-only" }, "Show previous slide", -1))
225
- ], 8, q)
243
+ l[6] || (l[6] = i("span", { class: "tw-sr-only" }, "Show previous slide", -1))
244
+ ], 8, G)
226
245
  ]),
227
- i("div", G, [
246
+ i("div", J, [
228
247
  i("button", {
229
248
  class: "tw-text-primary tw-bg-gray-100 tw-rounded-full tw-h-6 tw-w-6 tw-mr-3 tw-flex tw-items-center tw-justify-center disabled:tw-opacity-low disabled:tw-cursor-default",
230
249
  disabled: t.embla && !t.embla.canScrollNext(),
231
- onClick: e[3] || (e[3] = (r) => t.handleUserInteraction(t.nextIndex, "click-right-arrow"))
250
+ onClick: l[3] || (l[3] = (o) => t.handleUserInteraction(t.nextIndex, "click-right-arrow"))
232
251
  }, [
233
- c(d, {
252
+ c(s, {
234
253
  class: "tw-w-4",
235
254
  icon: t.mdiArrowRight
236
255
  }, null, 8, ["icon"]),
237
- e[7] || (e[7] = i("span", { class: "tw-sr-only" }, "Show next slide", -1))
238
- ], 8, J)
256
+ l[7] || (l[7] = i("span", { class: "tw-sr-only" }, "Show next slide", -1))
257
+ ], 8, Q)
239
258
  ])
240
- ], 64)) : g("", !0)
259
+ ], 64)) : f("", !0)
241
260
  ], 2);
242
261
  }
243
- const lt = /* @__PURE__ */ R(W, [["render", Q], ["__scopeId", "data-v-bb42b5ff"]]);
262
+ const lt = /* @__PURE__ */ N(O, [["render", X], ["__scopeId", "data-v-7c085f82"]]);
244
263
  export {
245
264
  lt as default
246
265
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "7.0.0",
3
+ "version": "7.1.0",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -114,5 +114,5 @@
114
114
  "embla-carousel-fade",
115
115
  "popper.js"
116
116
  ],
117
- "gitHead": "d1d979db0ae3e33f4b8b8a1d04a802ffb0c733ee"
117
+ "gitHead": "e89d40ce0dda4f00cdfb43b62d7d6e3938ca621b"
118
118
  }