@planetaexo/design-system 0.74.1 → 0.76.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/index.cjs +65 -59
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +65 -59
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12168,9 +12168,9 @@ function FeedLightbox({
|
|
|
12168
12168
|
var _a2;
|
|
12169
12169
|
frame = 0;
|
|
12170
12170
|
if (!userMoved) {
|
|
12171
|
-
(_a2 = itemRefs.current[initialIndex]) == null ? void 0 : _a2.scrollIntoView({ block: "
|
|
12171
|
+
(_a2 = itemRefs.current[initialIndex]) == null ? void 0 : _a2.scrollIntoView({ block: "center" });
|
|
12172
12172
|
}
|
|
12173
|
-
const anchorY = root.getBoundingClientRect().top +
|
|
12173
|
+
const anchorY = root.getBoundingClientRect().top + root.clientHeight / 2;
|
|
12174
12174
|
let current = 0;
|
|
12175
12175
|
itemRefs.current.forEach((el, i) => {
|
|
12176
12176
|
if (el && el.getBoundingClientRect().top <= anchorY) current = i;
|
|
@@ -12203,24 +12203,81 @@ function FeedLightbox({
|
|
|
12203
12203
|
if (frame) cancelAnimationFrame(frame);
|
|
12204
12204
|
};
|
|
12205
12205
|
}, []);
|
|
12206
|
-
return /* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-50
|
|
12207
|
-
/* @__PURE__ */
|
|
12206
|
+
return /* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-50 bg-zinc-950 text-white", children: [
|
|
12207
|
+
/* @__PURE__ */ jsx(
|
|
12208
|
+
"div",
|
|
12209
|
+
{
|
|
12210
|
+
ref: scrollRef,
|
|
12211
|
+
className: "absolute inset-0 overflow-y-auto overscroll-contain",
|
|
12212
|
+
children: /* @__PURE__ */ jsx("div", { className: "mx-auto flex w-full max-w-3xl flex-col", children: items.map(({ photo, index, sectionLabel, isSectionStart }) => {
|
|
12213
|
+
var _a2;
|
|
12214
|
+
const isFocused = index === active;
|
|
12215
|
+
return /* @__PURE__ */ jsxs(
|
|
12216
|
+
"figure",
|
|
12217
|
+
{
|
|
12218
|
+
"data-index": index,
|
|
12219
|
+
ref: (el) => {
|
|
12220
|
+
itemRefs.current[index] = el;
|
|
12221
|
+
},
|
|
12222
|
+
className: cn(
|
|
12223
|
+
"group relative transition-opacity duration-500",
|
|
12224
|
+
// The focused (centred / hovered) photo is at full opacity;
|
|
12225
|
+
// every other photo is dimmed a touch so the eye lands on it.
|
|
12226
|
+
isFocused ? "opacity-100" : "opacity-[0.65] hover:opacity-100"
|
|
12227
|
+
),
|
|
12228
|
+
children: [
|
|
12229
|
+
/* @__PURE__ */ jsx("div", { className: "overflow-hidden bg-white/5", children: /* @__PURE__ */ jsx(
|
|
12230
|
+
Picture,
|
|
12231
|
+
{
|
|
12232
|
+
src: photo.src,
|
|
12233
|
+
alt: (_a2 = photo.alt) != null ? _a2 : `Photo ${index + 1}`,
|
|
12234
|
+
title: photo.caption,
|
|
12235
|
+
className: "block h-auto w-full",
|
|
12236
|
+
eager: index < 2,
|
|
12237
|
+
rootMargin: "800px"
|
|
12238
|
+
}
|
|
12239
|
+
) }),
|
|
12240
|
+
sectionLabel && isSectionStart && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-x-0 top-0 bg-gradient-to-b from-black/60 via-black/20 to-transparent px-3 pb-12 pt-3 sm:px-4", children: /* @__PURE__ */ jsx("h2", { className: "font-heading text-lg font-bold uppercase tracking-wide text-white drop-shadow-md", children: sectionLabel }) }),
|
|
12241
|
+
(photo.caption || photo.credit) && /* @__PURE__ */ jsxs(
|
|
12242
|
+
"figcaption",
|
|
12243
|
+
{
|
|
12244
|
+
className: cn(
|
|
12245
|
+
"pointer-events-none absolute inset-x-0 bottom-0 flex flex-col items-end gap-0.5 bg-gradient-to-t from-black/60 via-black/20 to-transparent px-3 pb-3 pt-12 text-right transition-opacity duration-500 sm:px-4",
|
|
12246
|
+
isFocused ? "opacity-100" : "opacity-0 group-hover:opacity-100"
|
|
12247
|
+
),
|
|
12248
|
+
children: [
|
|
12249
|
+
photo.caption && /* @__PURE__ */ jsx("p", { className: "font-ui text-sm font-medium leading-snug text-white drop-shadow-md", children: photo.caption }),
|
|
12250
|
+
photo.credit && /* @__PURE__ */ jsxs("p", { className: "font-ui text-xs text-white/80 drop-shadow-md", children: [
|
|
12251
|
+
"\xA9 ",
|
|
12252
|
+
photo.credit
|
|
12253
|
+
] })
|
|
12254
|
+
]
|
|
12255
|
+
}
|
|
12256
|
+
)
|
|
12257
|
+
]
|
|
12258
|
+
},
|
|
12259
|
+
index
|
|
12260
|
+
);
|
|
12261
|
+
}) })
|
|
12262
|
+
}
|
|
12263
|
+
),
|
|
12264
|
+
/* @__PURE__ */ jsxs("div", { className: "pointer-events-none absolute inset-x-0 top-0 z-10 flex items-center gap-3 bg-gradient-to-b from-black/70 via-black/30 to-transparent px-3 pb-10 pt-2.5", children: [
|
|
12208
12265
|
/* @__PURE__ */ jsx(
|
|
12209
12266
|
"button",
|
|
12210
12267
|
{
|
|
12211
12268
|
type: "button",
|
|
12212
12269
|
onClick: onClose,
|
|
12213
|
-
className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-full text-white transition-colors hover:bg-white/
|
|
12270
|
+
className: "pointer-events-auto flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-black/25 text-white backdrop-blur-sm transition-colors hover:bg-white/15 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/60",
|
|
12214
12271
|
"aria-label": (_a = labels == null ? void 0 : labels.close) != null ? _a : "Close lightbox",
|
|
12215
12272
|
children: /* @__PURE__ */ jsx(XIcon, { className: "h-5 w-5" })
|
|
12216
12273
|
}
|
|
12217
12274
|
),
|
|
12218
|
-
activeLabel && /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate text-center font-heading text-sm font-bold uppercase tracking-wide text-white", children: activeLabel }),
|
|
12275
|
+
activeLabel && /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate text-center font-heading text-sm font-bold uppercase tracking-wide text-white drop-shadow-md", children: activeLabel }),
|
|
12219
12276
|
total > 1 && /* @__PURE__ */ jsxs(
|
|
12220
12277
|
"span",
|
|
12221
12278
|
{
|
|
12222
12279
|
className: cn(
|
|
12223
|
-
"shrink-0 font-ui text-sm font-medium tabular-nums text-white/
|
|
12280
|
+
"shrink-0 font-ui text-sm font-medium tabular-nums text-white/80 drop-shadow-md",
|
|
12224
12281
|
!activeLabel && "ml-auto"
|
|
12225
12282
|
),
|
|
12226
12283
|
children: [
|
|
@@ -12230,58 +12287,7 @@ function FeedLightbox({
|
|
|
12230
12287
|
]
|
|
12231
12288
|
}
|
|
12232
12289
|
)
|
|
12233
|
-
] })
|
|
12234
|
-
/* @__PURE__ */ jsx(
|
|
12235
|
-
"div",
|
|
12236
|
-
{
|
|
12237
|
-
ref: scrollRef,
|
|
12238
|
-
className: "flex-1 overflow-y-auto overscroll-contain",
|
|
12239
|
-
children: /* @__PURE__ */ jsx("div", { className: "mx-auto flex w-full max-w-3xl flex-col gap-3 py-4", children: items.map(({ photo, index, sectionLabel, isSectionStart }) => {
|
|
12240
|
-
var _a2;
|
|
12241
|
-
return /* @__PURE__ */ jsxs(React20.Fragment, { children: [
|
|
12242
|
-
sectionLabel && isSectionStart && /* @__PURE__ */ jsx(
|
|
12243
|
-
"h2",
|
|
12244
|
-
{
|
|
12245
|
-
className: cn(
|
|
12246
|
-
"px-3 font-heading text-lg font-bold uppercase tracking-wide text-white sm:px-4",
|
|
12247
|
-
index > 0 && "mt-3"
|
|
12248
|
-
),
|
|
12249
|
-
children: sectionLabel
|
|
12250
|
-
}
|
|
12251
|
-
),
|
|
12252
|
-
/* @__PURE__ */ jsxs(
|
|
12253
|
-
"figure",
|
|
12254
|
-
{
|
|
12255
|
-
"data-index": index,
|
|
12256
|
-
ref: (el) => {
|
|
12257
|
-
itemRefs.current[index] = el;
|
|
12258
|
-
},
|
|
12259
|
-
children: [
|
|
12260
|
-
/* @__PURE__ */ jsx("div", { className: "overflow-hidden bg-white/5", children: /* @__PURE__ */ jsx(
|
|
12261
|
-
Picture,
|
|
12262
|
-
{
|
|
12263
|
-
src: photo.src,
|
|
12264
|
-
alt: (_a2 = photo.alt) != null ? _a2 : `Photo ${index + 1}`,
|
|
12265
|
-
title: photo.caption,
|
|
12266
|
-
className: "block h-auto w-full",
|
|
12267
|
-
eager: index < 2,
|
|
12268
|
-
rootMargin: "800px"
|
|
12269
|
-
}
|
|
12270
|
-
) }),
|
|
12271
|
-
(photo.caption || photo.credit) && /* @__PURE__ */ jsxs("figcaption", { className: "px-3 pt-2 sm:px-4", children: [
|
|
12272
|
-
photo.caption && /* @__PURE__ */ jsx("p", { className: "font-ui text-sm leading-snug text-white/70", children: photo.caption }),
|
|
12273
|
-
photo.credit && /* @__PURE__ */ jsxs("p", { className: "font-ui text-xs text-white/50", children: [
|
|
12274
|
-
"\xA9 ",
|
|
12275
|
-
photo.credit
|
|
12276
|
-
] })
|
|
12277
|
-
] })
|
|
12278
|
-
]
|
|
12279
|
-
}
|
|
12280
|
-
)
|
|
12281
|
-
] }, index);
|
|
12282
|
-
}) })
|
|
12283
|
-
}
|
|
12284
|
-
)
|
|
12290
|
+
] })
|
|
12285
12291
|
] });
|
|
12286
12292
|
}
|
|
12287
12293
|
var PhotoTourContext = React20.createContext(null);
|