@deriv-web-design/ui 0.0.15 → 0.0.17

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.js CHANGED
@@ -52,7 +52,9 @@ __export(index_exports, {
52
52
  StickyStackedCards: () => StickyStackedCards,
53
53
  TEXT_CONTENT: () => TEXT_CONTENT,
54
54
  Tag: () => Tag,
55
- TextField: () => TextField
55
+ TextField: () => TextField,
56
+ TextScroll: () => TextScroll,
57
+ dayNightTransitionV2Preset: () => dayNightTransitionV2Preset
56
58
  });
57
59
  module.exports = __toCommonJS(index_exports);
58
60
 
@@ -2985,7 +2987,11 @@ var Navbar = ({
2985
2987
  "button",
2986
2988
  {
2987
2989
  ref: langBtnRef,
2988
- className: "navbar__nav-item navbar__lang-btn",
2990
+ className: [
2991
+ "navbar__nav-item",
2992
+ "navbar__lang-btn",
2993
+ hasLangDropdown && langDropdownOpen ? "navbar__nav-item--open" : ""
2994
+ ].filter(Boolean).join(" "),
2989
2995
  onClick: hasLangDropdown ? () => setLangDropdownOpen((o) => !o) : onLanguageClick,
2990
2996
  "aria-haspopup": hasLangDropdown ? "true" : void 0,
2991
2997
  "aria-expanded": hasLangDropdown ? langDropdownOpen : void 0,
@@ -3198,14 +3204,96 @@ var Navbar = ({
3198
3204
  // templates/DayNightTransition/DayNightTransition.tsx
3199
3205
  var import_react15 = require("react");
3200
3206
  var import_framer_motion3 = require("framer-motion");
3207
+
3208
+ // templates/DayNightTransition/webflowDayNightV2Ix.ts
3209
+ var DESC_SWATCH = { r: 24, g: 28, b: 37 };
3210
+ var BODY_TEXT = { r: 51, g: 51, b: 51 };
3211
+ var rgb = (r, g, b) => `rgb(${r},${g},${b})`;
3212
+ var lerp = (a, b, u) => a + (b - a) * u;
3213
+ var seg = (t, t0, t1, v0, v1) => {
3214
+ if (t <= t0) return v0;
3215
+ if (t >= t1) return v1;
3216
+ return lerp(v0, v1, (t - t0) / (t1 - t0));
3217
+ };
3218
+ function webflowV2DescriptionColor(t, media) {
3219
+ if (media === "desktop") {
3220
+ const body2 = rgb(BODY_TEXT.r, BODY_TEXT.g, BODY_TEXT.b);
3221
+ const dark2 = rgb(DESC_SWATCH.r, DESC_SWATCH.g, DESC_SWATCH.b);
3222
+ const white2 = rgb(255, 255, 255);
3223
+ if (t < 0.49) return body2;
3224
+ if (t < 0.5) return dark2;
3225
+ return white2;
3226
+ }
3227
+ const white = rgb(255, 255, 255);
3228
+ const dark = rgb(DESC_SWATCH.r, DESC_SWATCH.g, DESC_SWATCH.b);
3229
+ const body = rgb(BODY_TEXT.r, BODY_TEXT.g, BODY_TEXT.b);
3230
+ if (t < 0.58) return body;
3231
+ if (t < 0.59) return dark;
3232
+ return white;
3233
+ }
3234
+ function webflowV2TitleColor(t, media) {
3235
+ if (media === "desktop") {
3236
+ const body2 = rgb(BODY_TEXT.r, BODY_TEXT.g, BODY_TEXT.b);
3237
+ const black = rgb(0, 0, 0);
3238
+ const white2 = rgb(255, 255, 255);
3239
+ if (t < 0.51) return body2;
3240
+ if (t >= 0.52) return white2;
3241
+ return seg(t, 0.51, 0.52, black, white2);
3242
+ }
3243
+ const dark = rgb(DESC_SWATCH.r, DESC_SWATCH.g, DESC_SWATCH.b);
3244
+ const white = rgb(255, 255, 255);
3245
+ const body = rgb(BODY_TEXT.r, BODY_TEXT.g, BODY_TEXT.b);
3246
+ if (t < 0.6) return body;
3247
+ if (t >= 0.61) return white;
3248
+ const u = (t - 0.6) / 0.01;
3249
+ return rgb(
3250
+ lerp(DESC_SWATCH.r, 255, u),
3251
+ lerp(DESC_SWATCH.g, 255, u),
3252
+ lerp(DESC_SWATCH.b, 255, u)
3253
+ );
3254
+ }
3255
+ function webflowV2DayWordOpacity(t, media) {
3256
+ if (media === "desktop") {
3257
+ if (t < 0.51) return 1;
3258
+ if (t >= 0.52) return 0;
3259
+ return seg(t, 0.51, 0.52, 1, 0);
3260
+ }
3261
+ if (t < 0.6) return 1;
3262
+ if (t >= 0.61) return 0;
3263
+ return seg(t, 0.6, 0.61, 1, 0);
3264
+ }
3265
+ function webflowV2NightWordOpacity(t, media) {
3266
+ if (media === "desktop") {
3267
+ if (t < 0.51) return 0;
3268
+ if (t >= 0.52) return 1;
3269
+ return seg(t, 0.51, 0.52, 0, 1);
3270
+ }
3271
+ if (t < 0.6) return 0;
3272
+ if (t >= 0.61) return 1;
3273
+ return seg(t, 0.6, 0.61, 0, 1);
3274
+ }
3275
+ var WEBFLOW_V2_DAY_CLIP_SCROLL_END = 0.65;
3276
+ function webflowV2DayClipPercent(t, media) {
3277
+ if (media === "desktop") return 100;
3278
+ return seg(t, 0, WEBFLOW_V2_DAY_CLIP_SCROLL_END, 100, 0);
3279
+ }
3280
+
3281
+ // templates/DayNightTransition/DayNightTransition.tsx
3201
3282
  var import_jsx_runtime26 = require("react/jsx-runtime");
3202
3283
  var SPRING2 = { stiffness: 80, damping: 30, restDelta: 1e-3 };
3203
3284
  var FADE_START = 0.35;
3204
3285
  var FADE_END = 0.65;
3205
- var WORD_START = 0.4;
3206
- var WORD_END = 0.6;
3286
+ var V2_TEXT_SCROLL_CROSSFADE_DESKTOP_START = 0.49;
3287
+ var V2_TEXT_SCROLL_CROSSFADE_DESKTOP_END = 0.52;
3288
+ var V2_TEXT_SCROLL_CROSSFADE_MOBILE_START = 0.58;
3289
+ var V2_TEXT_SCROLL_CROSSFADE_MOBILE_END = 0.61;
3207
3290
  var TEXT_CHANNEL_DAY = 0;
3208
3291
  var TEXT_CHANNEL_NIGHT = 255;
3292
+ var seg2 = (t, t0, t1, v0, v1) => {
3293
+ if (t <= t0) return v0;
3294
+ if (t >= t1) return v1;
3295
+ return v0 + (v1 - v0) * ((t - t0) / (t1 - t0));
3296
+ };
3209
3297
  var DayNightTransition = ({
3210
3298
  dayImageUrl,
3211
3299
  nightImageUrl,
@@ -3215,102 +3303,348 @@ var DayNightTransition = ({
3215
3303
  nightDescription = "Description goes here. Description goes here. Description goes here.",
3216
3304
  ctaLabel = "Get started",
3217
3305
  ctaHref = "#",
3306
+ hideCta = false,
3307
+ headlineLevel = "h2",
3308
+ descriptionLevel = "body-md",
3309
+ inlineDayNightHeadline,
3310
+ scrollPreset = "default",
3218
3311
  className,
3219
3312
  ...props
3220
3313
  }) => {
3221
3314
  const wrapperRef = (0, import_react15.useRef)(null);
3315
+ const dayWordRef = (0, import_react15.useRef)(null);
3316
+ const [nightMarginStart, setNightMarginStart] = (0, import_react15.useState)("0px");
3317
+ const [nightMarginEnd, setNightMarginEnd] = (0, import_react15.useState)("0px");
3318
+ const [ixMedia, setIxMedia] = (0, import_react15.useState)("desktop");
3319
+ const webflowV2 = scrollPreset === "webflow-day-night-v2";
3320
+ (0, import_react15.useEffect)(() => {
3321
+ const mq = window.matchMedia("(max-width: 991px)");
3322
+ const sync = () => setIxMedia(mq.matches ? "mobile" : "desktop");
3323
+ sync();
3324
+ mq.addEventListener("change", sync);
3325
+ return () => mq.removeEventListener("change", sync);
3326
+ }, []);
3327
+ const MotionHeadline = headlineLevel === "h1" ? import_framer_motion3.motion.h1 : import_framer_motion3.motion.h2;
3328
+ (0, import_react15.useLayoutEffect)(() => {
3329
+ if (!inlineDayNightHeadline) return;
3330
+ const syncNightPull = () => {
3331
+ const dayEl = dayWordRef.current;
3332
+ if (!dayEl) return;
3333
+ const w = dayEl.offsetWidth;
3334
+ const doc = document.documentElement;
3335
+ const rtl = doc.getAttribute("dir") === "rtl" || doc.lang.toLowerCase().startsWith("ar");
3336
+ if (rtl) {
3337
+ setNightMarginStart("0px");
3338
+ setNightMarginEnd(w ? `-${w}px` : "0px");
3339
+ } else {
3340
+ setNightMarginStart(w ? `-${w}px` : "0px");
3341
+ setNightMarginEnd("0px");
3342
+ }
3343
+ };
3344
+ syncNightPull();
3345
+ const ro = new ResizeObserver(syncNightPull);
3346
+ if (dayWordRef.current) ro.observe(dayWordRef.current);
3347
+ window.addEventListener("resize", syncNightPull);
3348
+ return () => {
3349
+ ro.disconnect();
3350
+ window.removeEventListener("resize", syncNightPull);
3351
+ };
3352
+ }, [
3353
+ inlineDayNightHeadline,
3354
+ inlineDayNightHeadline?.dayWord,
3355
+ inlineDayNightHeadline?.nightWord,
3356
+ inlineDayNightHeadline?.prefix
3357
+ ]);
3222
3358
  const { scrollYProgress } = (0, import_framer_motion3.useScroll)({
3223
3359
  target: wrapperRef,
3224
3360
  offset: ["start end", "end start"]
3225
3361
  });
3226
3362
  const smooth = (0, import_framer_motion3.useSpring)(scrollYProgress, SPRING2);
3227
- const nightOpacity = (0, import_framer_motion3.useTransform)(smooth, [FADE_START, FADE_END], [0, 1]);
3228
- const channel = (0, import_framer_motion3.useTransform)(smooth, [FADE_START, FADE_END], [TEXT_CHANNEL_DAY, TEXT_CHANNEL_NIGHT]);
3363
+ const progress = webflowV2 ? scrollYProgress : smooth;
3364
+ const nightOpacity = (0, import_framer_motion3.useTransform)(progress, [FADE_START, FADE_END], [0, 1]);
3365
+ const channel = (0, import_framer_motion3.useTransform)(progress, [FADE_START, FADE_END], [TEXT_CHANNEL_DAY, TEXT_CHANNEL_NIGHT]);
3229
3366
  const textColor = import_framer_motion3.useMotionTemplate`rgb(${channel}, ${channel}, ${channel})`;
3230
- const dayOpacity = (0, import_framer_motion3.useTransform)(smooth, [WORD_START, WORD_END], [1, 0]);
3231
- const nightOpacity2 = (0, import_framer_motion3.useTransform)(smooth, [WORD_START, WORD_END], [0, 1]);
3367
+ const dayOpacity = (0, import_framer_motion3.useTransform)(progress, (t) => {
3368
+ if (webflowV2) {
3369
+ return ixMedia === "mobile" ? seg2(
3370
+ t,
3371
+ V2_TEXT_SCROLL_CROSSFADE_MOBILE_START,
3372
+ V2_TEXT_SCROLL_CROSSFADE_MOBILE_END,
3373
+ 1,
3374
+ 0
3375
+ ) : seg2(
3376
+ t,
3377
+ V2_TEXT_SCROLL_CROSSFADE_DESKTOP_START,
3378
+ V2_TEXT_SCROLL_CROSSFADE_DESKTOP_END,
3379
+ 1,
3380
+ 0
3381
+ );
3382
+ }
3383
+ return seg2(t, FADE_START, FADE_END, 1, 0);
3384
+ });
3385
+ const nightOpacity2 = (0, import_framer_motion3.useTransform)(progress, (t) => {
3386
+ if (webflowV2) {
3387
+ return ixMedia === "mobile" ? seg2(
3388
+ t,
3389
+ V2_TEXT_SCROLL_CROSSFADE_MOBILE_START,
3390
+ V2_TEXT_SCROLL_CROSSFADE_MOBILE_END,
3391
+ 0,
3392
+ 1
3393
+ ) : seg2(
3394
+ t,
3395
+ V2_TEXT_SCROLL_CROSSFADE_DESKTOP_START,
3396
+ V2_TEXT_SCROLL_CROSSFADE_DESKTOP_END,
3397
+ 0,
3398
+ 1
3399
+ );
3400
+ }
3401
+ return seg2(t, FADE_START, FADE_END, 0, 1);
3402
+ });
3403
+ const v2DescColor = (0, import_framer_motion3.useTransform)(progress, (t) => webflowV2DescriptionColor(t, ixMedia));
3404
+ const v2TitleColor = (0, import_framer_motion3.useTransform)(progress, (t) => webflowV2TitleColor(t, ixMedia));
3405
+ const v2DayWordOp = (0, import_framer_motion3.useTransform)(progress, (t) => webflowV2DayWordOpacity(t, ixMedia));
3406
+ const v2NightWordOp = (0, import_framer_motion3.useTransform)(progress, (t) => webflowV2NightWordOpacity(t, ixMedia));
3407
+ const v2DayHeight = (0, import_framer_motion3.useTransform)(
3408
+ progress,
3409
+ (t) => ixMedia === "mobile" ? `${webflowV2DayClipPercent(t, ixMedia)}%` : "100vh"
3410
+ );
3232
3411
  const hasDescription = Boolean(dayDescription || nightDescription);
3233
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3412
+ const useInlineHeadline = Boolean(inlineDayNightHeadline);
3413
+ const rootClass = [
3414
+ "dnt",
3415
+ headlineLevel === "h1" && "dnt--headline-h1",
3416
+ descriptionLevel === "body-lg" && "dnt--desc-body-lg",
3417
+ className
3418
+ ].filter(Boolean).join(" ");
3419
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
3234
3420
  "div",
3235
3421
  {
3236
3422
  ref: wrapperRef,
3237
- className: ["dnt", className].filter(Boolean).join(" "),
3423
+ className: rootClass,
3238
3424
  ...props,
3239
- children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "dnt__sticky", children: [
3240
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3241
- "img",
3242
- {
3243
- className: "dnt__bg dnt__bg--day",
3244
- src: dayImageUrl,
3245
- alt: "",
3246
- loading: "eager",
3247
- draggable: false
3248
- }
3249
- ),
3250
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3251
- import_framer_motion3.motion.img,
3252
- {
3253
- className: "dnt__bg dnt__bg--night",
3254
- src: nightImageUrl,
3255
- alt: "",
3256
- loading: "eager",
3257
- draggable: false,
3258
- style: { opacity: nightOpacity }
3259
- }
3260
- ),
3261
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "dnt__content", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "dnt__inner", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
3262
- import_framer_motion3.motion.div,
3263
- {
3264
- className: "dnt__text-wrap",
3265
- style: { color: textColor },
3266
- children: [
3267
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "dnt__crossfade-wrap", children: [
3268
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3269
- import_framer_motion3.motion.h2,
3270
- {
3271
- className: "dnt__headline",
3272
- style: { opacity: dayOpacity },
3273
- children: dayHeadline
3274
- }
3275
- ),
3276
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3277
- import_framer_motion3.motion.h2,
3278
- {
3279
- className: "dnt__headline",
3280
- "aria-hidden": "true",
3281
- style: { opacity: nightOpacity2 },
3282
- children: nightHeadline
3283
- }
3284
- )
3285
- ] }),
3286
- hasDescription && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "dnt__crossfade-wrap", children: [
3287
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3288
- import_framer_motion3.motion.p,
3289
- {
3290
- className: "dnt__description",
3291
- style: { opacity: dayOpacity },
3292
- children: dayDescription ?? ""
3293
- }
3294
- ),
3295
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3296
- import_framer_motion3.motion.p,
3425
+ children: [
3426
+ webflowV2 && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "dnt__v2-background-wrapper", "aria-hidden": "true", children: [
3427
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3428
+ import_framer_motion3.motion.div,
3429
+ {
3430
+ className: "dnt__v2-bg-day trade-day-night_background-day is-alternative",
3431
+ style: {
3432
+ backgroundImage: `url(${dayImageUrl})`,
3433
+ height: v2DayHeight
3434
+ }
3435
+ }
3436
+ ),
3437
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3438
+ "div",
3439
+ {
3440
+ className: "dnt__v2-bg-night trade-day-night_background-night is-alternative",
3441
+ style: { backgroundImage: `url(${nightImageUrl})` }
3442
+ }
3443
+ )
3444
+ ] }),
3445
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: webflowV2 ? "dnt__sticky dnt__sticky--webflow-v2" : "dnt__sticky", children: [
3446
+ !webflowV2 && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
3447
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3448
+ "img",
3449
+ {
3450
+ className: "dnt__bg dnt__bg--day",
3451
+ src: dayImageUrl,
3452
+ alt: "",
3453
+ loading: "eager",
3454
+ draggable: false
3455
+ }
3456
+ ),
3457
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3458
+ import_framer_motion3.motion.img,
3459
+ {
3460
+ className: "dnt__bg dnt__bg--night",
3461
+ src: nightImageUrl,
3462
+ alt: "",
3463
+ loading: "eager",
3464
+ draggable: false,
3465
+ style: { opacity: nightOpacity }
3466
+ }
3467
+ )
3468
+ ] }),
3469
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "dnt__content", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "dnt__inner", children: webflowV2 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "dnt__text-wrap", children: [
3470
+ useInlineHeadline && inlineDayNightHeadline ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
3471
+ MotionHeadline,
3472
+ {
3473
+ className: "dnt__headline dnt__headline--inline-day-night",
3474
+ style: { color: v2TitleColor },
3475
+ "aria-label": `${inlineDayNightHeadline.prefix}${inlineDayNightHeadline.dayWord} / ${inlineDayNightHeadline.prefix}${inlineDayNightHeadline.nightWord}`,
3476
+ children: [
3477
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "dnt__headline-prefix", children: inlineDayNightHeadline.prefix }),
3478
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "dnt__headline-pair", children: [
3479
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3480
+ import_framer_motion3.motion.span,
3481
+ {
3482
+ ref: dayWordRef,
3483
+ className: "dnt__headline-wday",
3484
+ style: { opacity: v2DayWordOp },
3485
+ children: inlineDayNightHeadline.dayWord
3486
+ }
3487
+ ),
3488
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3489
+ import_framer_motion3.motion.span,
3490
+ {
3491
+ className: "dnt__headline-wnight",
3492
+ style: {
3493
+ opacity: v2NightWordOp,
3494
+ marginInlineStart: nightMarginStart,
3495
+ marginInlineEnd: nightMarginEnd
3496
+ },
3497
+ children: inlineDayNightHeadline.nightWord
3498
+ }
3499
+ )
3500
+ ] })
3501
+ ]
3502
+ }
3503
+ ) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "dnt__crossfade-wrap", children: [
3504
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3505
+ MotionHeadline,
3506
+ {
3507
+ className: "dnt__headline",
3508
+ style: { color: v2TitleColor, opacity: dayOpacity },
3509
+ children: dayHeadline
3510
+ }
3511
+ ),
3512
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3513
+ MotionHeadline,
3514
+ {
3515
+ className: "dnt__headline",
3516
+ "aria-hidden": "true",
3517
+ style: { color: v2TitleColor, opacity: nightOpacity2 },
3518
+ children: nightHeadline
3519
+ }
3520
+ )
3521
+ ] }),
3522
+ hasDescription && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "dnt__crossfade-wrap", children: [
3523
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3524
+ import_framer_motion3.motion.p,
3525
+ {
3526
+ className: "dnt__description",
3527
+ style: {
3528
+ color: v2DescColor,
3529
+ opacity: dayOpacity
3530
+ },
3531
+ children: dayDescription ?? ""
3532
+ }
3533
+ ),
3534
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3535
+ import_framer_motion3.motion.p,
3536
+ {
3537
+ className: "dnt__description",
3538
+ "aria-hidden": "true",
3539
+ style: {
3540
+ color: v2DescColor,
3541
+ opacity: nightOpacity2
3542
+ },
3543
+ children: nightDescription ?? ""
3544
+ }
3545
+ )
3546
+ ] }),
3547
+ !hideCta && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("a", { href: ctaHref, className: "dnt__btn", children: ctaLabel })
3548
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
3549
+ import_framer_motion3.motion.div,
3550
+ {
3551
+ className: "dnt__text-wrap",
3552
+ style: { color: textColor },
3553
+ children: [
3554
+ useInlineHeadline && inlineDayNightHeadline ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
3555
+ MotionHeadline,
3297
3556
  {
3298
- className: "dnt__description",
3299
- "aria-hidden": "true",
3300
- style: { opacity: nightOpacity2 },
3301
- children: nightDescription ?? ""
3557
+ className: "dnt__headline dnt__headline--inline-day-night",
3558
+ "aria-label": `${inlineDayNightHeadline.prefix}${inlineDayNightHeadline.dayWord} / ${inlineDayNightHeadline.prefix}${inlineDayNightHeadline.nightWord}`,
3559
+ children: [
3560
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "dnt__headline-prefix", children: inlineDayNightHeadline.prefix }),
3561
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { className: "dnt__headline-pair", children: [
3562
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3563
+ import_framer_motion3.motion.span,
3564
+ {
3565
+ ref: dayWordRef,
3566
+ className: "dnt__headline-wday",
3567
+ style: { opacity: dayOpacity },
3568
+ children: inlineDayNightHeadline.dayWord
3569
+ }
3570
+ ),
3571
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3572
+ import_framer_motion3.motion.span,
3573
+ {
3574
+ className: "dnt__headline-wnight",
3575
+ style: {
3576
+ opacity: nightOpacity2,
3577
+ marginInlineStart: nightMarginStart,
3578
+ marginInlineEnd: nightMarginEnd
3579
+ },
3580
+ children: inlineDayNightHeadline.nightWord
3581
+ }
3582
+ )
3583
+ ] })
3584
+ ]
3302
3585
  }
3303
- )
3304
- ] }),
3305
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("a", { href: ctaHref, className: "dnt__btn", children: ctaLabel })
3306
- ]
3307
- }
3308
- ) }) })
3309
- ] })
3586
+ ) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "dnt__crossfade-wrap", children: [
3587
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3588
+ MotionHeadline,
3589
+ {
3590
+ className: "dnt__headline",
3591
+ style: { opacity: dayOpacity },
3592
+ children: dayHeadline
3593
+ }
3594
+ ),
3595
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3596
+ MotionHeadline,
3597
+ {
3598
+ className: "dnt__headline",
3599
+ "aria-hidden": "true",
3600
+ style: { opacity: nightOpacity2 },
3601
+ children: nightHeadline
3602
+ }
3603
+ )
3604
+ ] }),
3605
+ hasDescription && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "dnt__crossfade-wrap", children: [
3606
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3607
+ import_framer_motion3.motion.p,
3608
+ {
3609
+ className: "dnt__description",
3610
+ style: { opacity: dayOpacity },
3611
+ children: dayDescription ?? ""
3612
+ }
3613
+ ),
3614
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3615
+ import_framer_motion3.motion.p,
3616
+ {
3617
+ className: "dnt__description",
3618
+ "aria-hidden": "true",
3619
+ style: { opacity: nightOpacity2 },
3620
+ children: nightDescription ?? ""
3621
+ }
3622
+ )
3623
+ ] }),
3624
+ !hideCta && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("a", { href: ctaHref, className: "dnt__btn", children: ctaLabel })
3625
+ ]
3626
+ }
3627
+ ) }) })
3628
+ ] })
3629
+ ]
3310
3630
  }
3311
3631
  );
3312
3632
  };
3313
3633
 
3634
+ // templates/DayNightTransition/dayNightTransitionPresets.ts
3635
+ var dayNightTransitionV2Preset = {
3636
+ className: "dnt--layout-v2 dnt--webflow-v2",
3637
+ scrollPreset: "webflow-day-night-v2",
3638
+ dayImageUrl: "https://cdn.prod.website-files.com/68da5c86c91c54f39c86c28a/68da5c86c91c54f39c86cd8f_trade_day.webp",
3639
+ nightImageUrl: "https://cdn.prod.website-files.com/66585fe0e1dc7e70cc75d440/6757df573bf331c84b6c69fe_trade_night.webp",
3640
+ dayHeadline: "Section title light\n",
3641
+ nightHeadline: "Section title dark\n",
3642
+ dayDescription: "This section is designed to give your visitors a quick overview of why your solution is the right choice. Use this space to provide high-level context.\n",
3643
+ nightDescription: "This section is designed to give your visitors a quick overview of why your solution is the right choice. Use this space to provide high-level context.",
3644
+ ctaLabel: "Open account",
3645
+ ctaHref: "#"
3646
+ };
3647
+
3314
3648
  // templates/LogoMarquee/LogoMarquee.tsx
3315
3649
  var import_react16 = require("react");
3316
3650
  var import_framer_motion4 = require("framer-motion");
@@ -3624,6 +3958,74 @@ var DownloadBanner = ({
3624
3958
  ] })
3625
3959
  ] }) }) });
3626
3960
  };
3961
+
3962
+ // templates/TextScroll/TextScroll.tsx
3963
+ var import_react17 = require("react");
3964
+ var import_gsap = require("gsap");
3965
+ var import_ScrollTrigger = require("gsap/ScrollTrigger");
3966
+ var import_jsx_runtime31 = require("react/jsx-runtime");
3967
+ import_gsap.gsap.registerPlugin(import_ScrollTrigger.ScrollTrigger);
3968
+ var TextScroll = ({ text, className }) => {
3969
+ const sectionRef = (0, import_react17.useRef)(null);
3970
+ const wordsRef = (0, import_react17.useRef)([]);
3971
+ const words = text.split(/\s+/).filter(Boolean);
3972
+ (0, import_react17.useEffect)(() => {
3973
+ const section = sectionRef.current;
3974
+ const wordEls = wordsRef.current.filter(Boolean);
3975
+ if (!section || wordEls.length === 0) return;
3976
+ const isMobile = window.matchMedia("(max-width: 767px)").matches;
3977
+ const startValue = isMobile ? "top 35%" : "top center";
3978
+ const endValue = isMobile ? "bottom 90%" : "bottom center";
3979
+ const rafId = requestAnimationFrame(() => {
3980
+ import_gsap.gsap.set(wordEls, { opacity: 0.2 });
3981
+ const tl = import_gsap.gsap.timeline({
3982
+ scrollTrigger: {
3983
+ trigger: section,
3984
+ start: startValue,
3985
+ end: endValue,
3986
+ scrub: 2
3987
+ }
3988
+ });
3989
+ tl.to(wordEls, {
3990
+ opacity: 1,
3991
+ stagger: 0.1,
3992
+ ease: "none"
3993
+ });
3994
+ section._tl = tl;
3995
+ });
3996
+ return () => {
3997
+ cancelAnimationFrame(rafId);
3998
+ const tl = section._tl;
3999
+ if (tl) {
4000
+ tl.scrollTrigger?.kill();
4001
+ tl.kill();
4002
+ }
4003
+ import_gsap.gsap.set(wordEls, { clearProps: "opacity" });
4004
+ };
4005
+ }, [text]);
4006
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4007
+ "section",
4008
+ {
4009
+ ref: sectionRef,
4010
+ className: ["ts", className].filter(Boolean).join(" "),
4011
+ children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "ts__inner", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "ts__text", "aria-label": text, children: words.map((word, i) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
4012
+ "span",
4013
+ {
4014
+ ref: (el) => {
4015
+ if (el) wordsRef.current[i] = el;
4016
+ },
4017
+ className: "ts__word",
4018
+ "aria-hidden": "true",
4019
+ children: [
4020
+ word,
4021
+ i < words.length - 1 ? " " : ""
4022
+ ]
4023
+ },
4024
+ i
4025
+ )) }) })
4026
+ }
4027
+ );
4028
+ };
3627
4029
  // Annotate the CommonJS export names for ESM import in node:
3628
4030
  0 && (module.exports = {
3629
4031
  AVATAR_DATA,
@@ -3658,6 +4060,8 @@ var DownloadBanner = ({
3658
4060
  StickyStackedCards,
3659
4061
  TEXT_CONTENT,
3660
4062
  Tag,
3661
- TextField
4063
+ TextField,
4064
+ TextScroll,
4065
+ dayNightTransitionV2Preset
3662
4066
  });
3663
4067
  //# sourceMappingURL=index.js.map