@deriv-web-design/ui 0.0.24 → 0.0.25
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 +89 -82
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -26
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1027,18 +1027,25 @@ var Tabs = ({
|
|
|
1027
1027
|
};
|
|
1028
1028
|
|
|
1029
1029
|
// templates/FaqAccordion/FaqAccordion.tsx
|
|
1030
|
+
import { useState as useState5 } from "react";
|
|
1030
1031
|
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1031
1032
|
var FaqAccordion = ({
|
|
1032
1033
|
title,
|
|
1033
1034
|
items,
|
|
1034
1035
|
colorScheme = "white"
|
|
1035
1036
|
}) => {
|
|
1037
|
+
const [openIndex, setOpenIndex] = useState5(null);
|
|
1038
|
+
const handleToggle = (index) => (isOpen) => {
|
|
1039
|
+
setOpenIndex(isOpen ? index : null);
|
|
1040
|
+
};
|
|
1036
1041
|
return /* @__PURE__ */ jsx17("section", { className: ["faq-accordion", `faq-accordion--${colorScheme}`].join(" "), children: /* @__PURE__ */ jsxs15("div", { className: "faq-accordion__container", children: [
|
|
1037
1042
|
/* @__PURE__ */ jsx17("div", { className: "faq-accordion__header", children: /* @__PURE__ */ jsx17("h2", { className: "faq-accordion__title", children: title }) }),
|
|
1038
1043
|
/* @__PURE__ */ jsx17("div", { className: "faq-accordion__list", children: items.map((item, index) => /* @__PURE__ */ jsx17(
|
|
1039
1044
|
Accordion,
|
|
1040
1045
|
{
|
|
1041
1046
|
title: item.question,
|
|
1047
|
+
open: openIndex === index,
|
|
1048
|
+
onToggle: handleToggle(index),
|
|
1042
1049
|
showTopDivider: index === 0,
|
|
1043
1050
|
showBottomDivider: true,
|
|
1044
1051
|
children: item.answer
|
|
@@ -1304,7 +1311,7 @@ var FeatureBullets = ({
|
|
|
1304
1311
|
};
|
|
1305
1312
|
|
|
1306
1313
|
// components/Footer/Footer.tsx
|
|
1307
|
-
import { useState as
|
|
1314
|
+
import { useState as useState6 } from "react";
|
|
1308
1315
|
import { Fragment as Fragment2, jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1309
1316
|
var ExternalLinkIcon = () => /* @__PURE__ */ jsx21(
|
|
1310
1317
|
"svg",
|
|
@@ -1419,7 +1426,7 @@ var Footer = ({
|
|
|
1419
1426
|
...props
|
|
1420
1427
|
}) => {
|
|
1421
1428
|
const allSections = navColumns.flat();
|
|
1422
|
-
const [openSections, setOpenSections] =
|
|
1429
|
+
const [openSections, setOpenSections] = useState6(/* @__PURE__ */ new Set());
|
|
1423
1430
|
const toggleSection = (index) => {
|
|
1424
1431
|
setOpenSections((prev) => {
|
|
1425
1432
|
const next = new Set(prev);
|
|
@@ -1906,7 +1913,7 @@ var Header = ({
|
|
|
1906
1913
|
};
|
|
1907
1914
|
|
|
1908
1915
|
// templates/Stats/Stats.tsx
|
|
1909
|
-
import { useEffect as useEffect4, useRef as useRef4, useState as
|
|
1916
|
+
import { useEffect as useEffect4, useRef as useRef4, useState as useState7 } from "react";
|
|
1910
1917
|
import { jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1911
1918
|
var INTERVAL_MS = 2e3;
|
|
1912
1919
|
var TRANSITION = "transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1)";
|
|
@@ -1944,7 +1951,7 @@ var Stats = ({
|
|
|
1944
1951
|
className,
|
|
1945
1952
|
...props
|
|
1946
1953
|
}) => {
|
|
1947
|
-
const [activeIndex, setActiveIndex] =
|
|
1954
|
+
const [activeIndex, setActiveIndex] = useState7(0);
|
|
1948
1955
|
const intervalRef = useRef4(null);
|
|
1949
1956
|
const sectionRef = useRef4(null);
|
|
1950
1957
|
const leftColRef = useRef4(null);
|
|
@@ -2037,10 +2044,10 @@ var Stats = ({
|
|
|
2037
2044
|
};
|
|
2038
2045
|
|
|
2039
2046
|
// templates/FeatureScroll/FeatureScroll.tsx
|
|
2040
|
-
import { useLayoutEffect, useRef as useRef6, useState as
|
|
2047
|
+
import { useLayoutEffect, useRef as useRef6, useState as useState9 } from "react";
|
|
2041
2048
|
|
|
2042
2049
|
// components/DotLottieInView/DotLottieInView.tsx
|
|
2043
|
-
import { useEffect as useEffect5, useRef as useRef5, useState as
|
|
2050
|
+
import { useEffect as useEffect5, useRef as useRef5, useState as useState8 } from "react";
|
|
2044
2051
|
import { DotLottieReact } from "@lottiefiles/dotlottie-react";
|
|
2045
2052
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
2046
2053
|
function DotLottieInView({
|
|
@@ -2052,8 +2059,8 @@ function DotLottieInView({
|
|
|
2052
2059
|
...dotProps
|
|
2053
2060
|
}) {
|
|
2054
2061
|
const wrapRef = useRef5(null);
|
|
2055
|
-
const [inView, setInView] =
|
|
2056
|
-
const [dotLottie, setDotLottie] =
|
|
2062
|
+
const [inView, setInView] = useState8(false);
|
|
2063
|
+
const [dotLottie, setDotLottie] = useState8(null);
|
|
2057
2064
|
useEffect5(() => {
|
|
2058
2065
|
const el = wrapRef.current;
|
|
2059
2066
|
if (!el) return;
|
|
@@ -2200,7 +2207,7 @@ var FeatureScroll = ({
|
|
|
2200
2207
|
className,
|
|
2201
2208
|
...props
|
|
2202
2209
|
}) => {
|
|
2203
|
-
const [activeIndex, setActiveIndex] =
|
|
2210
|
+
const [activeIndex, setActiveIndex] = useState9(0);
|
|
2204
2211
|
const titleRefs = useRef6([]);
|
|
2205
2212
|
const mediaColRef = useRef6(null);
|
|
2206
2213
|
useLayoutEffect(() => {
|
|
@@ -2797,7 +2804,7 @@ var CTABanner = ({
|
|
|
2797
2804
|
};
|
|
2798
2805
|
|
|
2799
2806
|
// components/Navbar/Navbar.tsx
|
|
2800
|
-
import { useRef as useRef9, useState as
|
|
2807
|
+
import { useRef as useRef9, useState as useState10, useEffect as useEffect7, useCallback as useCallback2 } from "react";
|
|
2801
2808
|
import { motion as motion2, AnimatePresence } from "framer-motion";
|
|
2802
2809
|
|
|
2803
2810
|
// assets/icon-globe.svg
|
|
@@ -3035,12 +3042,12 @@ var Navbar = ({
|
|
|
3035
3042
|
className,
|
|
3036
3043
|
...props
|
|
3037
3044
|
}) => {
|
|
3038
|
-
const [openDropdown, setOpenDropdown] =
|
|
3039
|
-
const [mobileOpen, setMobileOpen] =
|
|
3040
|
-
const [mobileExpanded, setMobileExpanded] =
|
|
3041
|
-
const [scrolled, setScrolled] =
|
|
3042
|
-
const [langDropdownOpen, setLangDropdownOpen] =
|
|
3043
|
-
const [mobileLangOpen, setMobileLangOpen] =
|
|
3045
|
+
const [openDropdown, setOpenDropdown] = useState10(null);
|
|
3046
|
+
const [mobileOpen, setMobileOpen] = useState10(false);
|
|
3047
|
+
const [mobileExpanded, setMobileExpanded] = useState10(null);
|
|
3048
|
+
const [scrolled, setScrolled] = useState10(false);
|
|
3049
|
+
const [langDropdownOpen, setLangDropdownOpen] = useState10(false);
|
|
3050
|
+
const [mobileLangOpen, setMobileLangOpen] = useState10(false);
|
|
3044
3051
|
const hoverTimeoutRef = useRef9(null);
|
|
3045
3052
|
const langHoverTimeoutRef = useRef9(null);
|
|
3046
3053
|
const pillAreaRef = useRef9(null);
|
|
@@ -3391,7 +3398,7 @@ var Navbar = ({
|
|
|
3391
3398
|
};
|
|
3392
3399
|
|
|
3393
3400
|
// templates/DayNightTransition/DayNightTransition.tsx
|
|
3394
|
-
import { useEffect as useEffect8, useLayoutEffect as useLayoutEffect2, useRef as useRef10, useState as
|
|
3401
|
+
import { useEffect as useEffect8, useLayoutEffect as useLayoutEffect2, useRef as useRef10, useState as useState11 } from "react";
|
|
3395
3402
|
import {
|
|
3396
3403
|
motion as motion3,
|
|
3397
3404
|
useScroll as useScroll2,
|
|
@@ -3508,9 +3515,9 @@ var DayNightTransition = ({
|
|
|
3508
3515
|
}) => {
|
|
3509
3516
|
const wrapperRef = useRef10(null);
|
|
3510
3517
|
const dayWordRef = useRef10(null);
|
|
3511
|
-
const [nightMarginStart, setNightMarginStart] =
|
|
3512
|
-
const [nightMarginEnd, setNightMarginEnd] =
|
|
3513
|
-
const [ixMedia, setIxMedia] =
|
|
3518
|
+
const [nightMarginStart, setNightMarginStart] = useState11("0px");
|
|
3519
|
+
const [nightMarginEnd, setNightMarginEnd] = useState11("0px");
|
|
3520
|
+
const [ixMedia, setIxMedia] = useState11("desktop");
|
|
3514
3521
|
const webflowV2 = scrollPreset === "webflow-day-night-v2";
|
|
3515
3522
|
useEffect8(() => {
|
|
3516
3523
|
const mq = window.matchMedia("(max-width: 991px)");
|
|
@@ -4383,7 +4390,7 @@ var StickyMarketCards = ({
|
|
|
4383
4390
|
};
|
|
4384
4391
|
|
|
4385
4392
|
// templates/Table/Table.tsx
|
|
4386
|
-
import { useState as
|
|
4393
|
+
import { useState as useState12, useMemo } from "react";
|
|
4387
4394
|
import { Fragment as Fragment4, jsx as jsx37, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
4388
4395
|
var InfoIcon = ({ className }) => /* @__PURE__ */ jsxs33("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", className, children: [
|
|
4389
4396
|
/* @__PURE__ */ jsx37("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
@@ -4401,9 +4408,9 @@ var Table = ({
|
|
|
4401
4408
|
className,
|
|
4402
4409
|
...props
|
|
4403
4410
|
}) => {
|
|
4404
|
-
const [search, setSearch] =
|
|
4405
|
-
const [page, setPage] =
|
|
4406
|
-
const [tooltip, setTooltip] =
|
|
4411
|
+
const [search, setSearch] = useState12("");
|
|
4412
|
+
const [page, setPage] = useState12(1);
|
|
4413
|
+
const [tooltip, setTooltip] = useState12({ visible: false, heading: "", description: "", x: 0, y: 0, arrowOffset: 0 });
|
|
4407
4414
|
const mainKey = mainColumnKey ?? columns.find((c) => c.width === "main")?.key ?? columns[0]?.key;
|
|
4408
4415
|
const filtered = useMemo(() => {
|
|
4409
4416
|
const q = search.trim().toLowerCase();
|
|
@@ -4573,7 +4580,7 @@ var Table = ({
|
|
|
4573
4580
|
};
|
|
4574
4581
|
|
|
4575
4582
|
// templates/Leaders/Leaders.tsx
|
|
4576
|
-
import { useState as
|
|
4583
|
+
import { useState as useState13 } from "react";
|
|
4577
4584
|
import { Fragment as Fragment5, jsx as jsx38, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
4578
4585
|
var LinkedInIcon = () => /* @__PURE__ */ jsx38("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ jsx38("path", { d: "M14.816 0H1.18C0.528 0 0 0.516 0 1.153V14.846C0 15.484 0.528 16 1.18 16H14.816C15.468 16 16 15.484 16 14.846V1.153C16 0.516 15.468 0 14.816 0ZM4.744 13.642H2.368V5.996H4.744V13.642ZM3.556 4.952C2.796 4.952 2.18 4.336 2.18 3.576C2.18 2.816 2.796 2.2 3.556 2.2C4.316 2.2 4.932 2.816 4.932 3.576C4.932 4.336 4.316 4.952 3.556 4.952ZM13.642 13.642H11.266V9.924C11.266 9.038 11.25 7.896 10.032 7.896C8.814 7.896 8.626 8.846 8.626 9.86V13.642H6.25V5.996H8.53V7.04H8.562C8.88 6.44 9.534 5.806 10.686 5.806C12.958 5.806 13.642 7.3 13.642 9.386V13.642Z", fill: "currentColor" }) });
|
|
4579
4586
|
var ChevronDownIcon4 = () => /* @__PURE__ */ jsx38("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ jsx38("path", { d: "M4 6L8 10L12 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
@@ -4615,7 +4622,7 @@ var Leaders = ({
|
|
|
4615
4622
|
className,
|
|
4616
4623
|
...props
|
|
4617
4624
|
}) => {
|
|
4618
|
-
const [isExpanded, setIsExpanded] =
|
|
4625
|
+
const [isExpanded, setIsExpanded] = useState13(false);
|
|
4619
4626
|
const hasMore = items.length > initialVisibleCount;
|
|
4620
4627
|
const visibleItems = items.slice(0, initialVisibleCount);
|
|
4621
4628
|
const extraItems = items.slice(initialVisibleCount);
|