@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.mjs CHANGED
@@ -2933,7 +2933,11 @@ var Navbar = ({
2933
2933
  "button",
2934
2934
  {
2935
2935
  ref: langBtnRef,
2936
- className: "navbar__nav-item navbar__lang-btn",
2936
+ className: [
2937
+ "navbar__nav-item",
2938
+ "navbar__lang-btn",
2939
+ hasLangDropdown && langDropdownOpen ? "navbar__nav-item--open" : ""
2940
+ ].filter(Boolean).join(" "),
2937
2941
  onClick: hasLangDropdown ? () => setLangDropdownOpen((o) => !o) : onLanguageClick,
2938
2942
  "aria-haspopup": hasLangDropdown ? "true" : void 0,
2939
2943
  "aria-expanded": hasLangDropdown ? langDropdownOpen : void 0,
@@ -3144,7 +3148,7 @@ var Navbar = ({
3144
3148
  };
3145
3149
 
3146
3150
  // templates/DayNightTransition/DayNightTransition.tsx
3147
- import { useRef as useRef10 } from "react";
3151
+ import { useEffect as useEffect8, useLayoutEffect as useLayoutEffect2, useRef as useRef10, useState as useState10 } from "react";
3148
3152
  import {
3149
3153
  motion as motion3,
3150
3154
  useScroll as useScroll2,
@@ -3152,14 +3156,96 @@ import {
3152
3156
  useTransform as useTransform2,
3153
3157
  useMotionTemplate as useMotionTemplate2
3154
3158
  } from "framer-motion";
3155
- import { jsx as jsx26, jsxs as jsxs24 } from "react/jsx-runtime";
3159
+
3160
+ // templates/DayNightTransition/webflowDayNightV2Ix.ts
3161
+ var DESC_SWATCH = { r: 24, g: 28, b: 37 };
3162
+ var BODY_TEXT = { r: 51, g: 51, b: 51 };
3163
+ var rgb = (r, g, b) => `rgb(${r},${g},${b})`;
3164
+ var lerp = (a, b, u) => a + (b - a) * u;
3165
+ var seg = (t, t0, t1, v0, v1) => {
3166
+ if (t <= t0) return v0;
3167
+ if (t >= t1) return v1;
3168
+ return lerp(v0, v1, (t - t0) / (t1 - t0));
3169
+ };
3170
+ function webflowV2DescriptionColor(t, media) {
3171
+ if (media === "desktop") {
3172
+ const body2 = rgb(BODY_TEXT.r, BODY_TEXT.g, BODY_TEXT.b);
3173
+ const dark2 = rgb(DESC_SWATCH.r, DESC_SWATCH.g, DESC_SWATCH.b);
3174
+ const white2 = rgb(255, 255, 255);
3175
+ if (t < 0.49) return body2;
3176
+ if (t < 0.5) return dark2;
3177
+ return white2;
3178
+ }
3179
+ const white = rgb(255, 255, 255);
3180
+ const dark = rgb(DESC_SWATCH.r, DESC_SWATCH.g, DESC_SWATCH.b);
3181
+ const body = rgb(BODY_TEXT.r, BODY_TEXT.g, BODY_TEXT.b);
3182
+ if (t < 0.58) return body;
3183
+ if (t < 0.59) return dark;
3184
+ return white;
3185
+ }
3186
+ function webflowV2TitleColor(t, media) {
3187
+ if (media === "desktop") {
3188
+ const body2 = rgb(BODY_TEXT.r, BODY_TEXT.g, BODY_TEXT.b);
3189
+ const black = rgb(0, 0, 0);
3190
+ const white2 = rgb(255, 255, 255);
3191
+ if (t < 0.51) return body2;
3192
+ if (t >= 0.52) return white2;
3193
+ return seg(t, 0.51, 0.52, black, white2);
3194
+ }
3195
+ const dark = rgb(DESC_SWATCH.r, DESC_SWATCH.g, DESC_SWATCH.b);
3196
+ const white = rgb(255, 255, 255);
3197
+ const body = rgb(BODY_TEXT.r, BODY_TEXT.g, BODY_TEXT.b);
3198
+ if (t < 0.6) return body;
3199
+ if (t >= 0.61) return white;
3200
+ const u = (t - 0.6) / 0.01;
3201
+ return rgb(
3202
+ lerp(DESC_SWATCH.r, 255, u),
3203
+ lerp(DESC_SWATCH.g, 255, u),
3204
+ lerp(DESC_SWATCH.b, 255, u)
3205
+ );
3206
+ }
3207
+ function webflowV2DayWordOpacity(t, media) {
3208
+ if (media === "desktop") {
3209
+ if (t < 0.51) return 1;
3210
+ if (t >= 0.52) return 0;
3211
+ return seg(t, 0.51, 0.52, 1, 0);
3212
+ }
3213
+ if (t < 0.6) return 1;
3214
+ if (t >= 0.61) return 0;
3215
+ return seg(t, 0.6, 0.61, 1, 0);
3216
+ }
3217
+ function webflowV2NightWordOpacity(t, media) {
3218
+ if (media === "desktop") {
3219
+ if (t < 0.51) return 0;
3220
+ if (t >= 0.52) return 1;
3221
+ return seg(t, 0.51, 0.52, 0, 1);
3222
+ }
3223
+ if (t < 0.6) return 0;
3224
+ if (t >= 0.61) return 1;
3225
+ return seg(t, 0.6, 0.61, 0, 1);
3226
+ }
3227
+ var WEBFLOW_V2_DAY_CLIP_SCROLL_END = 0.65;
3228
+ function webflowV2DayClipPercent(t, media) {
3229
+ if (media === "desktop") return 100;
3230
+ return seg(t, 0, WEBFLOW_V2_DAY_CLIP_SCROLL_END, 100, 0);
3231
+ }
3232
+
3233
+ // templates/DayNightTransition/DayNightTransition.tsx
3234
+ import { Fragment as Fragment3, jsx as jsx26, jsxs as jsxs24 } from "react/jsx-runtime";
3156
3235
  var SPRING2 = { stiffness: 80, damping: 30, restDelta: 1e-3 };
3157
3236
  var FADE_START = 0.35;
3158
3237
  var FADE_END = 0.65;
3159
- var WORD_START = 0.4;
3160
- var WORD_END = 0.6;
3238
+ var V2_TEXT_SCROLL_CROSSFADE_DESKTOP_START = 0.49;
3239
+ var V2_TEXT_SCROLL_CROSSFADE_DESKTOP_END = 0.52;
3240
+ var V2_TEXT_SCROLL_CROSSFADE_MOBILE_START = 0.58;
3241
+ var V2_TEXT_SCROLL_CROSSFADE_MOBILE_END = 0.61;
3161
3242
  var TEXT_CHANNEL_DAY = 0;
3162
3243
  var TEXT_CHANNEL_NIGHT = 255;
3244
+ var seg2 = (t, t0, t1, v0, v1) => {
3245
+ if (t <= t0) return v0;
3246
+ if (t >= t1) return v1;
3247
+ return v0 + (v1 - v0) * ((t - t0) / (t1 - t0));
3248
+ };
3163
3249
  var DayNightTransition = ({
3164
3250
  dayImageUrl,
3165
3251
  nightImageUrl,
@@ -3169,102 +3255,348 @@ var DayNightTransition = ({
3169
3255
  nightDescription = "Description goes here. Description goes here. Description goes here.",
3170
3256
  ctaLabel = "Get started",
3171
3257
  ctaHref = "#",
3258
+ hideCta = false,
3259
+ headlineLevel = "h2",
3260
+ descriptionLevel = "body-md",
3261
+ inlineDayNightHeadline,
3262
+ scrollPreset = "default",
3172
3263
  className,
3173
3264
  ...props
3174
3265
  }) => {
3175
3266
  const wrapperRef = useRef10(null);
3267
+ const dayWordRef = useRef10(null);
3268
+ const [nightMarginStart, setNightMarginStart] = useState10("0px");
3269
+ const [nightMarginEnd, setNightMarginEnd] = useState10("0px");
3270
+ const [ixMedia, setIxMedia] = useState10("desktop");
3271
+ const webflowV2 = scrollPreset === "webflow-day-night-v2";
3272
+ useEffect8(() => {
3273
+ const mq = window.matchMedia("(max-width: 991px)");
3274
+ const sync = () => setIxMedia(mq.matches ? "mobile" : "desktop");
3275
+ sync();
3276
+ mq.addEventListener("change", sync);
3277
+ return () => mq.removeEventListener("change", sync);
3278
+ }, []);
3279
+ const MotionHeadline = headlineLevel === "h1" ? motion3.h1 : motion3.h2;
3280
+ useLayoutEffect2(() => {
3281
+ if (!inlineDayNightHeadline) return;
3282
+ const syncNightPull = () => {
3283
+ const dayEl = dayWordRef.current;
3284
+ if (!dayEl) return;
3285
+ const w = dayEl.offsetWidth;
3286
+ const doc = document.documentElement;
3287
+ const rtl = doc.getAttribute("dir") === "rtl" || doc.lang.toLowerCase().startsWith("ar");
3288
+ if (rtl) {
3289
+ setNightMarginStart("0px");
3290
+ setNightMarginEnd(w ? `-${w}px` : "0px");
3291
+ } else {
3292
+ setNightMarginStart(w ? `-${w}px` : "0px");
3293
+ setNightMarginEnd("0px");
3294
+ }
3295
+ };
3296
+ syncNightPull();
3297
+ const ro = new ResizeObserver(syncNightPull);
3298
+ if (dayWordRef.current) ro.observe(dayWordRef.current);
3299
+ window.addEventListener("resize", syncNightPull);
3300
+ return () => {
3301
+ ro.disconnect();
3302
+ window.removeEventListener("resize", syncNightPull);
3303
+ };
3304
+ }, [
3305
+ inlineDayNightHeadline,
3306
+ inlineDayNightHeadline?.dayWord,
3307
+ inlineDayNightHeadline?.nightWord,
3308
+ inlineDayNightHeadline?.prefix
3309
+ ]);
3176
3310
  const { scrollYProgress } = useScroll2({
3177
3311
  target: wrapperRef,
3178
3312
  offset: ["start end", "end start"]
3179
3313
  });
3180
3314
  const smooth = useSpring2(scrollYProgress, SPRING2);
3181
- const nightOpacity = useTransform2(smooth, [FADE_START, FADE_END], [0, 1]);
3182
- const channel = useTransform2(smooth, [FADE_START, FADE_END], [TEXT_CHANNEL_DAY, TEXT_CHANNEL_NIGHT]);
3315
+ const progress = webflowV2 ? scrollYProgress : smooth;
3316
+ const nightOpacity = useTransform2(progress, [FADE_START, FADE_END], [0, 1]);
3317
+ const channel = useTransform2(progress, [FADE_START, FADE_END], [TEXT_CHANNEL_DAY, TEXT_CHANNEL_NIGHT]);
3183
3318
  const textColor = useMotionTemplate2`rgb(${channel}, ${channel}, ${channel})`;
3184
- const dayOpacity = useTransform2(smooth, [WORD_START, WORD_END], [1, 0]);
3185
- const nightOpacity2 = useTransform2(smooth, [WORD_START, WORD_END], [0, 1]);
3319
+ const dayOpacity = useTransform2(progress, (t) => {
3320
+ if (webflowV2) {
3321
+ return ixMedia === "mobile" ? seg2(
3322
+ t,
3323
+ V2_TEXT_SCROLL_CROSSFADE_MOBILE_START,
3324
+ V2_TEXT_SCROLL_CROSSFADE_MOBILE_END,
3325
+ 1,
3326
+ 0
3327
+ ) : seg2(
3328
+ t,
3329
+ V2_TEXT_SCROLL_CROSSFADE_DESKTOP_START,
3330
+ V2_TEXT_SCROLL_CROSSFADE_DESKTOP_END,
3331
+ 1,
3332
+ 0
3333
+ );
3334
+ }
3335
+ return seg2(t, FADE_START, FADE_END, 1, 0);
3336
+ });
3337
+ const nightOpacity2 = useTransform2(progress, (t) => {
3338
+ if (webflowV2) {
3339
+ return ixMedia === "mobile" ? seg2(
3340
+ t,
3341
+ V2_TEXT_SCROLL_CROSSFADE_MOBILE_START,
3342
+ V2_TEXT_SCROLL_CROSSFADE_MOBILE_END,
3343
+ 0,
3344
+ 1
3345
+ ) : seg2(
3346
+ t,
3347
+ V2_TEXT_SCROLL_CROSSFADE_DESKTOP_START,
3348
+ V2_TEXT_SCROLL_CROSSFADE_DESKTOP_END,
3349
+ 0,
3350
+ 1
3351
+ );
3352
+ }
3353
+ return seg2(t, FADE_START, FADE_END, 0, 1);
3354
+ });
3355
+ const v2DescColor = useTransform2(progress, (t) => webflowV2DescriptionColor(t, ixMedia));
3356
+ const v2TitleColor = useTransform2(progress, (t) => webflowV2TitleColor(t, ixMedia));
3357
+ const v2DayWordOp = useTransform2(progress, (t) => webflowV2DayWordOpacity(t, ixMedia));
3358
+ const v2NightWordOp = useTransform2(progress, (t) => webflowV2NightWordOpacity(t, ixMedia));
3359
+ const v2DayHeight = useTransform2(
3360
+ progress,
3361
+ (t) => ixMedia === "mobile" ? `${webflowV2DayClipPercent(t, ixMedia)}%` : "100vh"
3362
+ );
3186
3363
  const hasDescription = Boolean(dayDescription || nightDescription);
3187
- return /* @__PURE__ */ jsx26(
3364
+ const useInlineHeadline = Boolean(inlineDayNightHeadline);
3365
+ const rootClass = [
3366
+ "dnt",
3367
+ headlineLevel === "h1" && "dnt--headline-h1",
3368
+ descriptionLevel === "body-lg" && "dnt--desc-body-lg",
3369
+ className
3370
+ ].filter(Boolean).join(" ");
3371
+ return /* @__PURE__ */ jsxs24(
3188
3372
  "div",
3189
3373
  {
3190
3374
  ref: wrapperRef,
3191
- className: ["dnt", className].filter(Boolean).join(" "),
3375
+ className: rootClass,
3192
3376
  ...props,
3193
- children: /* @__PURE__ */ jsxs24("div", { className: "dnt__sticky", children: [
3194
- /* @__PURE__ */ jsx26(
3195
- "img",
3196
- {
3197
- className: "dnt__bg dnt__bg--day",
3198
- src: dayImageUrl,
3199
- alt: "",
3200
- loading: "eager",
3201
- draggable: false
3202
- }
3203
- ),
3204
- /* @__PURE__ */ jsx26(
3205
- motion3.img,
3206
- {
3207
- className: "dnt__bg dnt__bg--night",
3208
- src: nightImageUrl,
3209
- alt: "",
3210
- loading: "eager",
3211
- draggable: false,
3212
- style: { opacity: nightOpacity }
3213
- }
3214
- ),
3215
- /* @__PURE__ */ jsx26("div", { className: "dnt__content", children: /* @__PURE__ */ jsx26("div", { className: "dnt__inner", children: /* @__PURE__ */ jsxs24(
3216
- motion3.div,
3217
- {
3218
- className: "dnt__text-wrap",
3219
- style: { color: textColor },
3220
- children: [
3221
- /* @__PURE__ */ jsxs24("div", { className: "dnt__crossfade-wrap", children: [
3222
- /* @__PURE__ */ jsx26(
3223
- motion3.h2,
3224
- {
3225
- className: "dnt__headline",
3226
- style: { opacity: dayOpacity },
3227
- children: dayHeadline
3228
- }
3229
- ),
3230
- /* @__PURE__ */ jsx26(
3231
- motion3.h2,
3232
- {
3233
- className: "dnt__headline",
3234
- "aria-hidden": "true",
3235
- style: { opacity: nightOpacity2 },
3236
- children: nightHeadline
3237
- }
3238
- )
3239
- ] }),
3240
- hasDescription && /* @__PURE__ */ jsxs24("div", { className: "dnt__crossfade-wrap", children: [
3241
- /* @__PURE__ */ jsx26(
3242
- motion3.p,
3243
- {
3244
- className: "dnt__description",
3245
- style: { opacity: dayOpacity },
3246
- children: dayDescription ?? ""
3247
- }
3248
- ),
3249
- /* @__PURE__ */ jsx26(
3250
- motion3.p,
3377
+ children: [
3378
+ webflowV2 && /* @__PURE__ */ jsxs24("div", { className: "dnt__v2-background-wrapper", "aria-hidden": "true", children: [
3379
+ /* @__PURE__ */ jsx26(
3380
+ motion3.div,
3381
+ {
3382
+ className: "dnt__v2-bg-day trade-day-night_background-day is-alternative",
3383
+ style: {
3384
+ backgroundImage: `url(${dayImageUrl})`,
3385
+ height: v2DayHeight
3386
+ }
3387
+ }
3388
+ ),
3389
+ /* @__PURE__ */ jsx26(
3390
+ "div",
3391
+ {
3392
+ className: "dnt__v2-bg-night trade-day-night_background-night is-alternative",
3393
+ style: { backgroundImage: `url(${nightImageUrl})` }
3394
+ }
3395
+ )
3396
+ ] }),
3397
+ /* @__PURE__ */ jsxs24("div", { className: webflowV2 ? "dnt__sticky dnt__sticky--webflow-v2" : "dnt__sticky", children: [
3398
+ !webflowV2 && /* @__PURE__ */ jsxs24(Fragment3, { children: [
3399
+ /* @__PURE__ */ jsx26(
3400
+ "img",
3401
+ {
3402
+ className: "dnt__bg dnt__bg--day",
3403
+ src: dayImageUrl,
3404
+ alt: "",
3405
+ loading: "eager",
3406
+ draggable: false
3407
+ }
3408
+ ),
3409
+ /* @__PURE__ */ jsx26(
3410
+ motion3.img,
3411
+ {
3412
+ className: "dnt__bg dnt__bg--night",
3413
+ src: nightImageUrl,
3414
+ alt: "",
3415
+ loading: "eager",
3416
+ draggable: false,
3417
+ style: { opacity: nightOpacity }
3418
+ }
3419
+ )
3420
+ ] }),
3421
+ /* @__PURE__ */ jsx26("div", { className: "dnt__content", children: /* @__PURE__ */ jsx26("div", { className: "dnt__inner", children: webflowV2 ? /* @__PURE__ */ jsxs24("div", { className: "dnt__text-wrap", children: [
3422
+ useInlineHeadline && inlineDayNightHeadline ? /* @__PURE__ */ jsxs24(
3423
+ MotionHeadline,
3424
+ {
3425
+ className: "dnt__headline dnt__headline--inline-day-night",
3426
+ style: { color: v2TitleColor },
3427
+ "aria-label": `${inlineDayNightHeadline.prefix}${inlineDayNightHeadline.dayWord} / ${inlineDayNightHeadline.prefix}${inlineDayNightHeadline.nightWord}`,
3428
+ children: [
3429
+ /* @__PURE__ */ jsx26("span", { className: "dnt__headline-prefix", children: inlineDayNightHeadline.prefix }),
3430
+ /* @__PURE__ */ jsxs24("span", { className: "dnt__headline-pair", children: [
3431
+ /* @__PURE__ */ jsx26(
3432
+ motion3.span,
3433
+ {
3434
+ ref: dayWordRef,
3435
+ className: "dnt__headline-wday",
3436
+ style: { opacity: v2DayWordOp },
3437
+ children: inlineDayNightHeadline.dayWord
3438
+ }
3439
+ ),
3440
+ /* @__PURE__ */ jsx26(
3441
+ motion3.span,
3442
+ {
3443
+ className: "dnt__headline-wnight",
3444
+ style: {
3445
+ opacity: v2NightWordOp,
3446
+ marginInlineStart: nightMarginStart,
3447
+ marginInlineEnd: nightMarginEnd
3448
+ },
3449
+ children: inlineDayNightHeadline.nightWord
3450
+ }
3451
+ )
3452
+ ] })
3453
+ ]
3454
+ }
3455
+ ) : /* @__PURE__ */ jsxs24("div", { className: "dnt__crossfade-wrap", children: [
3456
+ /* @__PURE__ */ jsx26(
3457
+ MotionHeadline,
3458
+ {
3459
+ className: "dnt__headline",
3460
+ style: { color: v2TitleColor, opacity: dayOpacity },
3461
+ children: dayHeadline
3462
+ }
3463
+ ),
3464
+ /* @__PURE__ */ jsx26(
3465
+ MotionHeadline,
3466
+ {
3467
+ className: "dnt__headline",
3468
+ "aria-hidden": "true",
3469
+ style: { color: v2TitleColor, opacity: nightOpacity2 },
3470
+ children: nightHeadline
3471
+ }
3472
+ )
3473
+ ] }),
3474
+ hasDescription && /* @__PURE__ */ jsxs24("div", { className: "dnt__crossfade-wrap", children: [
3475
+ /* @__PURE__ */ jsx26(
3476
+ motion3.p,
3477
+ {
3478
+ className: "dnt__description",
3479
+ style: {
3480
+ color: v2DescColor,
3481
+ opacity: dayOpacity
3482
+ },
3483
+ children: dayDescription ?? ""
3484
+ }
3485
+ ),
3486
+ /* @__PURE__ */ jsx26(
3487
+ motion3.p,
3488
+ {
3489
+ className: "dnt__description",
3490
+ "aria-hidden": "true",
3491
+ style: {
3492
+ color: v2DescColor,
3493
+ opacity: nightOpacity2
3494
+ },
3495
+ children: nightDescription ?? ""
3496
+ }
3497
+ )
3498
+ ] }),
3499
+ !hideCta && /* @__PURE__ */ jsx26("a", { href: ctaHref, className: "dnt__btn", children: ctaLabel })
3500
+ ] }) : /* @__PURE__ */ jsxs24(
3501
+ motion3.div,
3502
+ {
3503
+ className: "dnt__text-wrap",
3504
+ style: { color: textColor },
3505
+ children: [
3506
+ useInlineHeadline && inlineDayNightHeadline ? /* @__PURE__ */ jsxs24(
3507
+ MotionHeadline,
3251
3508
  {
3252
- className: "dnt__description",
3253
- "aria-hidden": "true",
3254
- style: { opacity: nightOpacity2 },
3255
- children: nightDescription ?? ""
3509
+ className: "dnt__headline dnt__headline--inline-day-night",
3510
+ "aria-label": `${inlineDayNightHeadline.prefix}${inlineDayNightHeadline.dayWord} / ${inlineDayNightHeadline.prefix}${inlineDayNightHeadline.nightWord}`,
3511
+ children: [
3512
+ /* @__PURE__ */ jsx26("span", { className: "dnt__headline-prefix", children: inlineDayNightHeadline.prefix }),
3513
+ /* @__PURE__ */ jsxs24("span", { className: "dnt__headline-pair", children: [
3514
+ /* @__PURE__ */ jsx26(
3515
+ motion3.span,
3516
+ {
3517
+ ref: dayWordRef,
3518
+ className: "dnt__headline-wday",
3519
+ style: { opacity: dayOpacity },
3520
+ children: inlineDayNightHeadline.dayWord
3521
+ }
3522
+ ),
3523
+ /* @__PURE__ */ jsx26(
3524
+ motion3.span,
3525
+ {
3526
+ className: "dnt__headline-wnight",
3527
+ style: {
3528
+ opacity: nightOpacity2,
3529
+ marginInlineStart: nightMarginStart,
3530
+ marginInlineEnd: nightMarginEnd
3531
+ },
3532
+ children: inlineDayNightHeadline.nightWord
3533
+ }
3534
+ )
3535
+ ] })
3536
+ ]
3256
3537
  }
3257
- )
3258
- ] }),
3259
- /* @__PURE__ */ jsx26("a", { href: ctaHref, className: "dnt__btn", children: ctaLabel })
3260
- ]
3261
- }
3262
- ) }) })
3263
- ] })
3538
+ ) : /* @__PURE__ */ jsxs24("div", { className: "dnt__crossfade-wrap", children: [
3539
+ /* @__PURE__ */ jsx26(
3540
+ MotionHeadline,
3541
+ {
3542
+ className: "dnt__headline",
3543
+ style: { opacity: dayOpacity },
3544
+ children: dayHeadline
3545
+ }
3546
+ ),
3547
+ /* @__PURE__ */ jsx26(
3548
+ MotionHeadline,
3549
+ {
3550
+ className: "dnt__headline",
3551
+ "aria-hidden": "true",
3552
+ style: { opacity: nightOpacity2 },
3553
+ children: nightHeadline
3554
+ }
3555
+ )
3556
+ ] }),
3557
+ hasDescription && /* @__PURE__ */ jsxs24("div", { className: "dnt__crossfade-wrap", children: [
3558
+ /* @__PURE__ */ jsx26(
3559
+ motion3.p,
3560
+ {
3561
+ className: "dnt__description",
3562
+ style: { opacity: dayOpacity },
3563
+ children: dayDescription ?? ""
3564
+ }
3565
+ ),
3566
+ /* @__PURE__ */ jsx26(
3567
+ motion3.p,
3568
+ {
3569
+ className: "dnt__description",
3570
+ "aria-hidden": "true",
3571
+ style: { opacity: nightOpacity2 },
3572
+ children: nightDescription ?? ""
3573
+ }
3574
+ )
3575
+ ] }),
3576
+ !hideCta && /* @__PURE__ */ jsx26("a", { href: ctaHref, className: "dnt__btn", children: ctaLabel })
3577
+ ]
3578
+ }
3579
+ ) }) })
3580
+ ] })
3581
+ ]
3264
3582
  }
3265
3583
  );
3266
3584
  };
3267
3585
 
3586
+ // templates/DayNightTransition/dayNightTransitionPresets.ts
3587
+ var dayNightTransitionV2Preset = {
3588
+ className: "dnt--layout-v2 dnt--webflow-v2",
3589
+ scrollPreset: "webflow-day-night-v2",
3590
+ dayImageUrl: "https://cdn.prod.website-files.com/68da5c86c91c54f39c86c28a/68da5c86c91c54f39c86cd8f_trade_day.webp",
3591
+ nightImageUrl: "https://cdn.prod.website-files.com/66585fe0e1dc7e70cc75d440/6757df573bf331c84b6c69fe_trade_night.webp",
3592
+ dayHeadline: "Section title light\n",
3593
+ nightHeadline: "Section title dark\n",
3594
+ 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",
3595
+ 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.",
3596
+ ctaLabel: "Open account",
3597
+ ctaHref: "#"
3598
+ };
3599
+
3268
3600
  // templates/LogoMarquee/LogoMarquee.tsx
3269
3601
  import { useRef as useRef11 } from "react";
3270
3602
  import {
@@ -3584,6 +3916,74 @@ var DownloadBanner = ({
3584
3916
  ] })
3585
3917
  ] }) }) });
3586
3918
  };
3919
+
3920
+ // templates/TextScroll/TextScroll.tsx
3921
+ import { useEffect as useEffect9, useRef as useRef12 } from "react";
3922
+ import { gsap } from "gsap";
3923
+ import { ScrollTrigger } from "gsap/ScrollTrigger";
3924
+ import { jsx as jsx31, jsxs as jsxs28 } from "react/jsx-runtime";
3925
+ gsap.registerPlugin(ScrollTrigger);
3926
+ var TextScroll = ({ text, className }) => {
3927
+ const sectionRef = useRef12(null);
3928
+ const wordsRef = useRef12([]);
3929
+ const words = text.split(/\s+/).filter(Boolean);
3930
+ useEffect9(() => {
3931
+ const section = sectionRef.current;
3932
+ const wordEls = wordsRef.current.filter(Boolean);
3933
+ if (!section || wordEls.length === 0) return;
3934
+ const isMobile = window.matchMedia("(max-width: 767px)").matches;
3935
+ const startValue = isMobile ? "top 35%" : "top center";
3936
+ const endValue = isMobile ? "bottom 90%" : "bottom center";
3937
+ const rafId = requestAnimationFrame(() => {
3938
+ gsap.set(wordEls, { opacity: 0.2 });
3939
+ const tl = gsap.timeline({
3940
+ scrollTrigger: {
3941
+ trigger: section,
3942
+ start: startValue,
3943
+ end: endValue,
3944
+ scrub: 2
3945
+ }
3946
+ });
3947
+ tl.to(wordEls, {
3948
+ opacity: 1,
3949
+ stagger: 0.1,
3950
+ ease: "none"
3951
+ });
3952
+ section._tl = tl;
3953
+ });
3954
+ return () => {
3955
+ cancelAnimationFrame(rafId);
3956
+ const tl = section._tl;
3957
+ if (tl) {
3958
+ tl.scrollTrigger?.kill();
3959
+ tl.kill();
3960
+ }
3961
+ gsap.set(wordEls, { clearProps: "opacity" });
3962
+ };
3963
+ }, [text]);
3964
+ return /* @__PURE__ */ jsx31(
3965
+ "section",
3966
+ {
3967
+ ref: sectionRef,
3968
+ className: ["ts", className].filter(Boolean).join(" "),
3969
+ children: /* @__PURE__ */ jsx31("div", { className: "ts__inner", children: /* @__PURE__ */ jsx31("p", { className: "ts__text", "aria-label": text, children: words.map((word, i) => /* @__PURE__ */ jsxs28(
3970
+ "span",
3971
+ {
3972
+ ref: (el) => {
3973
+ if (el) wordsRef.current[i] = el;
3974
+ },
3975
+ className: "ts__word",
3976
+ "aria-hidden": "true",
3977
+ children: [
3978
+ word,
3979
+ i < words.length - 1 ? " " : ""
3980
+ ]
3981
+ },
3982
+ i
3983
+ )) }) })
3984
+ }
3985
+ );
3986
+ };
3587
3987
  export {
3588
3988
  AVATAR_DATA,
3589
3989
  Accordion,
@@ -3617,6 +4017,8 @@ export {
3617
4017
  StickyStackedCards,
3618
4018
  TEXT_CONTENT,
3619
4019
  Tag,
3620
- TextField
4020
+ TextField,
4021
+ TextScroll,
4022
+ dayNightTransitionV2Preset
3621
4023
  };
3622
4024
  //# sourceMappingURL=index.mjs.map