@scrippsproduct/networks-ui-library 1.0.16 → 1.0.17-dev.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.
- package/dist/Carousel.module-CzL9vVtu.mjs +14 -0
- package/dist/assets/Carousel.css +1 -0
- package/dist/components/Carousel/Carousel.d.ts +1 -0
- package/dist/components/Carousel/Carousel.js +123 -127
- package/dist/components/Carousel/navigations/Pagination.js +6 -9
- package/dist/components/Carousel/types.d.js +1 -0
- package/package.json +2 -2
- package/dist/assets/Pagination.css +0 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import './assets/Carousel.css';const _ = "_carousel_idy2d_1", o = "_carousel__scroller_idy2d_11", s = {
|
|
2
|
+
carousel: _,
|
|
3
|
+
carousel__scroller: o,
|
|
4
|
+
"carousel-controls": "_carousel-controls_idy2d_39",
|
|
5
|
+
"carousel-controls__btn": "_carousel-controls__btn_idy2d_43",
|
|
6
|
+
"carousel-controls__previous": "_carousel-controls__previous_idy2d_68",
|
|
7
|
+
"carousel-controls__next": "_carousel-controls__next_idy2d_75",
|
|
8
|
+
"carousel-nav": "_carousel-nav_idy2d_87",
|
|
9
|
+
"carousel-nav__list": "_carousel-nav__list_idy2d_91",
|
|
10
|
+
"carousel-nav__item": "_carousel-nav__item_idy2d_100"
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
s as c
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._carousel_idy2d_1{--_carousel-scrollbar-gutter: 1.75rem;--_carousel-pagination-size: 1rem;--_slide-gap: 1.5rem;position:relative;display:grid;grid-template-columns:1fr;grid-template-rows:[carousel-scroller] 1fr [carousel-pagination]}._carousel__scroller_idy2d_11{display:flex;box-sizing:border-box;overflow-x:auto;scroll-behavior:smooth;overscroll-behavior-x:contain;scroll-snap-type:x mandatory;scroll-snap-align:center;scroll-padding-inline:var(--_carousel-gutters);padding-inline:var(--_carousel-gutters);scrollbar-width:none;list-style:none;margin:0}._carousel__scroller_idy2d_11[data-scrollbar=true]{scrollbar-width:auto;overflow-x:scroll}._carousel__scroller_idy2d_11:not([data-scrollbar=true])::-webkit-scrollbar{display:none}._carousel__scroller_idy2d_11::-webkit-scrollbar{display:auto}._carousel-controls_idy2d_39{display:contents}._carousel-controls__btn_idy2d_43{position:absolute;top:50%;transform:translateY(var(--_controls-transform));border-radius:50%;background-color:#fff6;color:#000;aspect-ratio:1;border:1px solid transparent;padding:0;overflow:hidden;z-index:1;cursor:pointer;transition:opacity .325s ease-out}._carousel-controls__btn_idy2d_43>i>svg{display:block;block-size:auto;max-inline-size:100%;stroke:currentColor}._carousel-controls__btn_idy2d_43[disabled]{opacity:0}._carousel-controls__previous_idy2d_68{inset-inline-start:var(--_control-btns-offset-x)}._carousel-controls__previous_idy2d_68 svg{transform:translate(-2px)}._carousel-controls__next_idy2d_75{inset-inline-end:var(--_control-btns-offset-x)}._carousel-controls__next_idy2d_75 svg{transform:translate(2px)}._carousel-controls__btn_idy2d_43[disabled]{cursor:not-allowed;transition-delay:0s}._carousel-nav_idy2d_87{margin-top:0}._carousel-nav__list_idy2d_91{display:flex;gap:1rem;justify-content:center;align-items:flex-start;list-style:none;padding:0}._carousel-nav__item_idy2d_100{flex-basis:1rem;min-width:1rem;max-width:1rem;height:1rem;background-color:transparent;border-radius:50%;border:1px solid rgba(65,65,65,.1)}._carousel-nav__item_idy2d_100[data-current=true]{background-color:#8080801a}
|
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as c, useState as
|
|
3
|
-
import
|
|
1
|
+
import { jsx as o, Fragment as W, jsxs as O } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as c, useState as A, useEffect as V, useCallback as u } from "react";
|
|
3
|
+
import q from "./CarouselUtils.class.js";
|
|
4
4
|
import { CarouselSlide as J } from "../CarouselSlide/CarouselSlide.js";
|
|
5
|
-
import { chunkArray as Q, classes as
|
|
5
|
+
import { chunkArray as Q, classes as z } from "../../utils/helpers.js";
|
|
6
|
+
import { c as a } from "../../Carousel.module-CzL9vVtu.mjs";
|
|
6
7
|
import { C as X } from "../../chevron-left-DmvQntvu.mjs";
|
|
7
8
|
import { C as Y } from "../../chevron-right-CaAz6ISN.mjs";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"carousel-controls__btn": "_carousel-controls__btn_1booq_42",
|
|
13
|
-
"carousel-controls__previous": "_carousel-controls__previous_1booq_67",
|
|
14
|
-
"carousel-controls__next": "_carousel-controls__next_1booq_74",
|
|
15
|
-
"carousel-nav": "_carousel-nav_1booq_86",
|
|
16
|
-
"carousel-nav__list": "_carousel-nav__list_1booq_90",
|
|
17
|
-
"carousel-nav__item": "_carousel-nav__item_1booq_99"
|
|
18
|
-
}, re = window.matchMedia("(max-width: 600px)"), te = window.matchMedia("(max-width: 800px"), le = window.matchMedia("(max-width: 1024px"), oe = window.matchMedia("(max-width: 1280px");
|
|
19
|
-
function fe({
|
|
20
|
-
id: A,
|
|
21
|
-
slides: z,
|
|
9
|
+
const Z = window.matchMedia("(max-width: 600px)"), ee = window.matchMedia("(max-width: 800px"), re = window.matchMedia("(max-width: 1024px"), te = window.matchMedia("(max-width: 1280px");
|
|
10
|
+
function de({
|
|
11
|
+
id: _,
|
|
12
|
+
slides: b,
|
|
22
13
|
options: x = {
|
|
23
14
|
paginationType: "dots",
|
|
24
15
|
showControls: !0,
|
|
@@ -37,13 +28,14 @@ function fe({
|
|
|
37
28
|
cellsPerSlide: 1,
|
|
38
29
|
cellAspectRatio: "4/2",
|
|
39
30
|
cellsPosition: "center",
|
|
31
|
+
groupSlides: !0,
|
|
40
32
|
wrapAround: !0
|
|
41
33
|
}
|
|
42
34
|
}) {
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
((
|
|
46
|
-
|
|
35
|
+
const m = c(`carousel-${_}`), R = c(null), i = c(null), I = c(null), w = c(b), E = c(null), g = c(null), t = c(null), e = c(x), $ = c(x.showPagination), T = c("-50%"), [N, j] = A([]), [r, d] = A(null), [k, B] = A([]);
|
|
36
|
+
V(() => {
|
|
37
|
+
(() => {
|
|
38
|
+
Z.matches ? (d({
|
|
47
39
|
...e.current,
|
|
48
40
|
showControls: !1,
|
|
49
41
|
showPagination: !1,
|
|
@@ -57,7 +49,7 @@ function fe({
|
|
|
57
49
|
cellsPerSlide: 1,
|
|
58
50
|
cellsPosition: e.current.wrapAround ? "center" : "flex-start",
|
|
59
51
|
gutterSize: 10
|
|
60
|
-
}, $.current = !1) :
|
|
52
|
+
}, $.current = !1) : ee.matches ? e.current.cellsPerSlide > 2 ? (d({
|
|
61
53
|
...e.current,
|
|
62
54
|
cellsPerSlide: 2,
|
|
63
55
|
showControls: !1,
|
|
@@ -75,7 +67,7 @@ function fe({
|
|
|
75
67
|
...e.current,
|
|
76
68
|
showControls: !1,
|
|
77
69
|
gutterSize: 10
|
|
78
|
-
}) :
|
|
70
|
+
}) : re.matches ? e.current.cellsPerSlide > 3 ? (d({
|
|
79
71
|
...e.current,
|
|
80
72
|
cellsPerSlide: 3,
|
|
81
73
|
showControls: !1,
|
|
@@ -93,7 +85,7 @@ function fe({
|
|
|
93
85
|
...e.current,
|
|
94
86
|
showControls: !1,
|
|
95
87
|
gutterSize: 10
|
|
96
|
-
}) :
|
|
88
|
+
}) : te.matches && e.current.showPagination ? (d({
|
|
97
89
|
...e.current,
|
|
98
90
|
showControls: !1
|
|
99
91
|
}), e.current = {
|
|
@@ -104,106 +96,106 @@ function fe({
|
|
|
104
96
|
});
|
|
105
97
|
})();
|
|
106
98
|
}, []);
|
|
107
|
-
const L = u((
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
let
|
|
111
|
-
for (let s = 0; s <=
|
|
112
|
-
|
|
113
|
-
for (let
|
|
114
|
-
|
|
115
|
-
props:
|
|
99
|
+
const L = u((l, n) => {
|
|
100
|
+
const p = Q(n, l);
|
|
101
|
+
B([...p]);
|
|
102
|
+
let f = [];
|
|
103
|
+
for (let s = 0; s <= p.length - 1; s++) {
|
|
104
|
+
f[s] = {}, f[s].ariaLabel = `${s + 1} of ${p.length}`, f[s].layout = p[s][0].layout, f[s].cells = [];
|
|
105
|
+
for (let S = 0; S <= p[s].length - 1; S++)
|
|
106
|
+
f[s].cells[S] = {
|
|
107
|
+
props: p[s][S].props
|
|
116
108
|
};
|
|
117
109
|
}
|
|
118
|
-
const
|
|
119
|
-
return
|
|
120
|
-
}, []),
|
|
121
|
-
e.current.autoplay &&
|
|
122
|
-
}, []),
|
|
123
|
-
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
}, [
|
|
127
|
-
|
|
128
|
-
|
|
110
|
+
const P = [...f], y = [...f], K = P.slice(-1), F = P.slice(0);
|
|
111
|
+
return y.push(F[0]), y.unshift(K[0]), e.current.wrapAround && l.length > n ? y : P;
|
|
112
|
+
}, []), h = u(() => {
|
|
113
|
+
e.current.autoplay && t.current.clearTimer();
|
|
114
|
+
}, []), G = u((l) => {
|
|
115
|
+
h();
|
|
116
|
+
const n = l.key;
|
|
117
|
+
n === "ArrowLeft" ? (l.preventDefault(), t.current.determineScrollAction(-1)) : n === "ArrowRight" && (l.preventDefault(), t.current.determineScrollAction(1));
|
|
118
|
+
}, [h]), H = u(() => {
|
|
119
|
+
h(), i.current.addEventListener("scrollend", () => {
|
|
120
|
+
t.current.handleScrollEnd();
|
|
129
121
|
}, { once: !0 });
|
|
130
|
-
}, [
|
|
131
|
-
|
|
132
|
-
|
|
122
|
+
}, [h]), v = u(() => {
|
|
123
|
+
h(), i.current.addEventListener("scrollend", () => {
|
|
124
|
+
t.current.handleScrollEnd(), i.current.addEventListener("scroll", v, { once: !0 });
|
|
133
125
|
}, { once: !0 });
|
|
134
|
-
}, [
|
|
135
|
-
|
|
136
|
-
},
|
|
126
|
+
}, [h]), U = () => {
|
|
127
|
+
t.current && e.current.autoplay && t.current.clearTimer();
|
|
128
|
+
}, C = u(() => {
|
|
137
129
|
//! make sure class is only instantiated once because of reacts
|
|
138
130
|
//! "strict" mode double do hocus pocus
|
|
139
|
-
|
|
131
|
+
t.current === null && (t.current = new q({
|
|
140
132
|
carouselEl: R.current,
|
|
141
133
|
scrollerEl: i.current,
|
|
142
134
|
paginationEl: I.current,
|
|
143
|
-
slides:
|
|
135
|
+
slides: w.current,
|
|
144
136
|
navBtnEls: {
|
|
145
137
|
next: E.current,
|
|
146
|
-
previous:
|
|
138
|
+
previous: g.current
|
|
147
139
|
},
|
|
148
|
-
id:
|
|
140
|
+
id: m.current,
|
|
149
141
|
options: {
|
|
150
142
|
autoplay: e.current.autoplay,
|
|
151
|
-
wrapAround: e.current.wrapAround &&
|
|
143
|
+
wrapAround: e.current.wrapAround && w.current.length > e.current.cellsPerSlide,
|
|
152
144
|
showPagination: e.current.showPagination,
|
|
153
145
|
delay: e.current.autoplayDelay,
|
|
154
146
|
slideGutterSize: e.current.gutterSize,
|
|
155
147
|
slideAspectRatio: e.current.slideAspectRatio,
|
|
156
|
-
showControls: e.current.showControls &&
|
|
148
|
+
showControls: e.current.showControls && w.current.length > e.current.cellsPerSlide,
|
|
157
149
|
cellsPerSlide: e.current.cellsPerSlide
|
|
158
150
|
}
|
|
159
151
|
}));
|
|
160
152
|
}, []), M = u(() => {
|
|
161
|
-
i.current.addEventListener("scroll",
|
|
162
|
-
}, [
|
|
163
|
-
if (
|
|
164
|
-
let
|
|
165
|
-
i.current !== null && (
|
|
153
|
+
i.current.addEventListener("scroll", v, { once: !0 });
|
|
154
|
+
}, [v]), D = u(() => {
|
|
155
|
+
if (j(L(w.current, e.current.cellsPerSlide)), w.current.length > e.current.cellsPerSlide) {
|
|
156
|
+
let l = setInterval(() => {
|
|
157
|
+
i.current !== null && (g.current !== null && e.current.showControls || !e.current.showControls) && (clearInterval(l), M(), C());
|
|
166
158
|
}, 100);
|
|
167
159
|
} else {
|
|
168
|
-
let
|
|
169
|
-
i.current !== null && (clearInterval(
|
|
160
|
+
let l = setInterval(() => {
|
|
161
|
+
i.current !== null && (clearInterval(l), C());
|
|
170
162
|
}, 100);
|
|
171
163
|
}
|
|
172
|
-
}, [L, M,
|
|
173
|
-
return
|
|
174
|
-
if (
|
|
175
|
-
if (
|
|
176
|
-
let
|
|
177
|
-
|
|
164
|
+
}, [L, M, C]);
|
|
165
|
+
return V(() => {
|
|
166
|
+
if (r !== null) {
|
|
167
|
+
if (r.showControls) {
|
|
168
|
+
let l = 0;
|
|
169
|
+
r.showPagination && (l = l + 25), r.showScrollbar && (l = l + 6), T.current = `calc(-50% - ${l}px)`;
|
|
178
170
|
}
|
|
179
|
-
|
|
171
|
+
D();
|
|
180
172
|
}
|
|
181
173
|
return () => {
|
|
182
|
-
|
|
174
|
+
U();
|
|
183
175
|
};
|
|
184
|
-
}, [
|
|
176
|
+
}, [D, r]), /* @__PURE__ */ o(W, { children: r !== null && /* @__PURE__ */ O(
|
|
185
177
|
"div",
|
|
186
178
|
{
|
|
187
179
|
className: a.carousel,
|
|
188
|
-
id:
|
|
180
|
+
id: m.current,
|
|
189
181
|
ref: R,
|
|
190
182
|
tabIndex: -1,
|
|
191
183
|
role: "region",
|
|
192
184
|
"aria-roledescription": "carousel",
|
|
193
|
-
"aria-label":
|
|
194
|
-
onKeyDown:
|
|
185
|
+
"aria-label": r.title,
|
|
186
|
+
onKeyDown: G,
|
|
195
187
|
style: {
|
|
196
|
-
"--_carousel-gutters":
|
|
197
|
-
"--_slide-aspect-ratio":
|
|
198
|
-
"--_cell-aspect-ratio":
|
|
199
|
-
"--_slide-cell-size": `${100 /
|
|
200
|
-
"--_cells-position":
|
|
201
|
-
"--_control-btns-offset-x": `${
|
|
202
|
-
"--_slide-gap": `${
|
|
188
|
+
"--_carousel-gutters": r.wrapAround ? `${r.gutterSize <= 25 ? r.gutterSize : 25}%` : `0 ${r.gutterSize <= 25 ? r.gutterSize : 25}%`,
|
|
189
|
+
"--_slide-aspect-ratio": r.slideAspectRatio,
|
|
190
|
+
"--_cell-aspect-ratio": r.cellAspectRatio,
|
|
191
|
+
"--_slide-cell-size": `${100 / r.cellsPerSlide}%`,
|
|
192
|
+
"--_cells-position": r.cellsPosition,
|
|
193
|
+
"--_control-btns-offset-x": `${r.controlButtonsOffset}rem`,
|
|
194
|
+
"--_slide-gap": `${r.slideGap}rem`,
|
|
203
195
|
"--_controls-transform": T.current
|
|
204
196
|
},
|
|
205
197
|
children: [
|
|
206
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ o(
|
|
207
199
|
"ol",
|
|
208
200
|
{
|
|
209
201
|
className: a.carousel__scroller,
|
|
@@ -212,87 +204,91 @@ function fe({
|
|
|
212
204
|
"aria-label": "Items Scroller",
|
|
213
205
|
"aria-live": "Polite",
|
|
214
206
|
tabIndex: 0,
|
|
215
|
-
onMouseEnter: (
|
|
216
|
-
e.current.autoplay &&
|
|
207
|
+
onMouseEnter: () => {
|
|
208
|
+
e.current.autoplay && t.current !== null && t.current.clearTimer();
|
|
217
209
|
},
|
|
218
|
-
onMouseLeave: (
|
|
219
|
-
e.current.autoplay &&
|
|
210
|
+
onMouseLeave: () => {
|
|
211
|
+
e.current.autoplay && t.current !== null && t.current.startTimer();
|
|
220
212
|
},
|
|
221
|
-
onTouchStart:
|
|
222
|
-
"data-scrollbar":
|
|
223
|
-
children: N.length > 0 && N.map((
|
|
213
|
+
onTouchStart: H,
|
|
214
|
+
"data-scrollbar": r.showScrollbar,
|
|
215
|
+
children: N.length > 0 && N.map((l, n) => /* @__PURE__ */ o(
|
|
224
216
|
J,
|
|
225
217
|
{
|
|
226
|
-
slide:
|
|
227
|
-
index:
|
|
228
|
-
currentIndex:
|
|
229
|
-
variableHeight:
|
|
218
|
+
slide: l,
|
|
219
|
+
index: n,
|
|
220
|
+
currentIndex: r.wrapAround ? 1 : 0,
|
|
221
|
+
variableHeight: r.variableHeight
|
|
230
222
|
},
|
|
231
|
-
`carousel${
|
|
223
|
+
`carousel${_}-slide${n}`
|
|
232
224
|
))
|
|
233
225
|
}
|
|
234
226
|
),
|
|
235
|
-
|
|
236
|
-
/* @__PURE__ */
|
|
227
|
+
r.showControls && b.length > e.current.cellsPerSlide && /* @__PURE__ */ O("div", { className: a["carousel-controls"], children: [
|
|
228
|
+
/* @__PURE__ */ o(
|
|
237
229
|
"button",
|
|
238
230
|
{
|
|
239
231
|
type: "button",
|
|
240
|
-
ref:
|
|
232
|
+
ref: g,
|
|
241
233
|
title: "Previous Item",
|
|
242
|
-
className:
|
|
243
|
-
|
|
234
|
+
className: z([
|
|
235
|
+
a["carousel-controls__btn"],
|
|
236
|
+
a["carousel-controls__previous"],
|
|
237
|
+
"carousel-controls__previous"
|
|
238
|
+
]),
|
|
239
|
+
"aria-controls": m.current,
|
|
244
240
|
"aria-label": "Previous Item",
|
|
245
|
-
onClick: (
|
|
246
|
-
|
|
241
|
+
onClick: () => {
|
|
242
|
+
t.current.determineScrollAction(-1);
|
|
247
243
|
},
|
|
248
|
-
onMouseEnter: (
|
|
249
|
-
e.current.autoplay &&
|
|
244
|
+
onMouseEnter: () => {
|
|
245
|
+
e.current.autoplay && t.current !== null && t.current.clearTimer();
|
|
250
246
|
},
|
|
251
|
-
onMouseLeave: (
|
|
252
|
-
e.current.autoplay &&
|
|
247
|
+
onMouseLeave: () => {
|
|
248
|
+
e.current.autoplay && t.current !== null && t.current.startTimer();
|
|
253
249
|
},
|
|
254
|
-
children: /* @__PURE__ */
|
|
250
|
+
children: /* @__PURE__ */ o("i", { "aria-hidden": "true", children: /* @__PURE__ */ o(X, { width: r.controlArrowSize, height: r.controlArrowSize }) })
|
|
255
251
|
}
|
|
256
252
|
),
|
|
257
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ o(
|
|
258
254
|
"button",
|
|
259
255
|
{
|
|
260
256
|
type: "button",
|
|
261
257
|
ref: E,
|
|
262
258
|
title: "Next Item",
|
|
263
|
-
className:
|
|
264
|
-
"aria-controls":
|
|
259
|
+
className: z([a["carousel-controls__btn"], a["carousel-controls__next"], "carousel-controls__next"]),
|
|
260
|
+
"aria-controls": m.current,
|
|
265
261
|
"aria-label": "Next Item",
|
|
266
|
-
onClick: (
|
|
267
|
-
|
|
262
|
+
onClick: () => {
|
|
263
|
+
t.current.determineScrollAction(1);
|
|
268
264
|
},
|
|
269
|
-
onMouseEnter: (
|
|
270
|
-
e.current.autoplay &&
|
|
265
|
+
onMouseEnter: () => {
|
|
266
|
+
e.current.autoplay && t.current !== null && t.current.clearTimer();
|
|
271
267
|
},
|
|
272
|
-
onMouseLeave: (
|
|
273
|
-
e.current.autoplay &&
|
|
268
|
+
onMouseLeave: () => {
|
|
269
|
+
e.current.autoplay && t.current !== null && t.current.startTimer();
|
|
274
270
|
},
|
|
275
|
-
children: /* @__PURE__ */
|
|
271
|
+
children: /* @__PURE__ */ o("i", { "aria-hidden": "true", children: /* @__PURE__ */ o(Y, { width: r.controlArrowSize, height: r.controlArrowSize }) })
|
|
276
272
|
}
|
|
277
273
|
)
|
|
278
274
|
] }),
|
|
279
|
-
$.current && k.length > 1 && /* @__PURE__ */
|
|
275
|
+
$.current && k.length > 1 && /* @__PURE__ */ o("div", { className: [a["carousel-nav"], "carousel-nav"].join(" "), children: /* @__PURE__ */ o("ol", { className: a["carousel-nav__list"], ref: I, children: k.map((l, n) => /* @__PURE__ */ o(
|
|
280
276
|
"li",
|
|
281
277
|
{
|
|
282
|
-
className:
|
|
283
|
-
"data-current":
|
|
284
|
-
onClick: (
|
|
285
|
-
|
|
278
|
+
className: z([a["carousel-nav__item"], "carousel-nav__item"]),
|
|
279
|
+
"data-current": n === 0 ? "true" : "false",
|
|
280
|
+
onClick: () => {
|
|
281
|
+
t.current.navigateToIndex(n);
|
|
286
282
|
},
|
|
287
|
-
title: `Navigate to slide ${
|
|
283
|
+
title: `Navigate to slide ${n + 1}`
|
|
288
284
|
},
|
|
289
|
-
`carousel${
|
|
285
|
+
`carousel${m}-nav-${n}`
|
|
290
286
|
)) }) })
|
|
291
287
|
]
|
|
292
288
|
}
|
|
293
289
|
) });
|
|
294
290
|
}
|
|
295
291
|
export {
|
|
296
|
-
|
|
297
|
-
|
|
292
|
+
de as Carousel,
|
|
293
|
+
de as default
|
|
298
294
|
};
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
"carousel-nav__list": "_carousel-nav__list_1booq_90",
|
|
6
|
-
"carousel-nav__item": "_carousel-nav__item_1booq_99"
|
|
7
|
-
}, v = t.forwardRef(({ slides: o, carouselId: r, CarouselUtil: _, scrollerRef: c }, s) => /* @__PURE__ */ e("div", { className: `${l["carousel-nav"]} carousel-nav`, children: /* @__PURE__ */ e("ol", { className: l["carousel-nav__list"], ref: s, children: o.map((u, a) => /* @__PURE__ */ e(
|
|
2
|
+
import o from "react";
|
|
3
|
+
import { c as r } from "../../../Carousel.module-CzL9vVtu.mjs";
|
|
4
|
+
const n = o.forwardRef(({ slides: t, carouselId: l }, s) => /* @__PURE__ */ e("div", { className: `${r["carousel-nav"]} carousel-nav`, children: /* @__PURE__ */ e("ol", { className: r["carousel-nav__list"], ref: s, children: t.map((c, a) => /* @__PURE__ */ e(
|
|
8
5
|
"li",
|
|
9
6
|
{
|
|
10
|
-
className: `${
|
|
7
|
+
className: `${r["carousel-nav__item"]} carousel-nav__item`,
|
|
11
8
|
"data-current": a === 0 ? "true" : "false",
|
|
12
9
|
title: `Navigate to slide ${a + 1}`
|
|
13
10
|
},
|
|
14
|
-
`carousel${
|
|
11
|
+
`carousel${l}-nav-${a}`
|
|
15
12
|
)) }) }));
|
|
16
13
|
export {
|
|
17
|
-
|
|
14
|
+
n as default
|
|
18
15
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.0.
|
|
2
|
+
"version": "1.0.17-dev.0",
|
|
3
3
|
"name": "@scrippsproduct/networks-ui-library",
|
|
4
4
|
"description": "React Component Library for use in Scripps Networks external applications",
|
|
5
5
|
"author": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"storybook": "storybook dev -p 6006 --no-open",
|
|
24
24
|
"build-storybook": "storybook build",
|
|
25
25
|
"chromatic": "npx chromatic --project-token=f011f556f41a",
|
|
26
|
-
"create-component": "node componentFolderBuilder.js"
|
|
26
|
+
"create-component": "node scripts/componentFolderBuilder.js"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"date-fns": "^3.6.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._carousel_1booq_1{--_carousel-scrollbar-gutter: 1.75rem;--_carousel-pagination-size: 1rem;--_slide-gap: 1.5rem;position:relative;display:grid;grid-template-columns:1fr;grid-template-rows:[carousel-scroller] 1fr [carousel-pagination]}._carousel__scroller_1booq_11{display:flex;box-sizing:border-box;overflow-x:auto;scroll-behavior:smooth;overscroll-behavior-x:contain;scroll-snap-type:x mandatory;scroll-snap-align:center;scroll-padding-inline:var(--_carousel-gutters);padding-inline:var(--_carousel-gutters);scrollbar-width:none;list-style:none;margin:0}._carousel__scroller_1booq_11[data-scrollbar=true]{scrollbar-width:auto}._carousel__scroller_1booq_11:not([data-scrollbar=true])::-webkit-scrollbar{display:none}._carousel__scroller_1booq_11::-webkit-scrollbar{display:auto}._carousel-controls_1booq_38{display:contents}._carousel-controls__btn_1booq_42{position:absolute;top:50%;transform:translateY(var(--_controls-transform));border-radius:50%;background-color:#fff6;color:#000;aspect-ratio:1;border:1px solid transparent;padding:0;overflow:hidden;z-index:1;cursor:pointer;transition:opacity .325s ease-out}._carousel-controls__btn_1booq_42>i>svg{display:block;block-size:auto;max-inline-size:100%;stroke:currentColor}._carousel-controls__btn_1booq_42[disabled]{opacity:0}._carousel-controls__previous_1booq_67{inset-inline-start:var(--_control-btns-offset-x)}._carousel-controls__previous_1booq_67 svg{transform:translate(-2px)}._carousel-controls__next_1booq_74{inset-inline-end:var(--_control-btns-offset-x)}._carousel-controls__next_1booq_74 svg{transform:translate(2px)}._carousel-controls__btn_1booq_42[disabled]{cursor:not-allowed;transition-delay:0s}._carousel-nav_1booq_86{margin-top:0}._carousel-nav__list_1booq_90{display:flex;gap:1rem;justify-content:center;align-items:flex-start;list-style:none;padding:0}._carousel-nav__item_1booq_99{flex-basis:1rem;min-width:1rem;max-width:1rem;height:1rem;background-color:transparent;border-radius:50%;border:1px solid rgba(65,65,65,.1)}._carousel-nav__item_1booq_99[data-current=true]{background-color:#8080801a}
|