@tedi-design-system/react 15.0.0-rc.5 → 15.0.0-rc.7
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/bundle-stats.html +1 -1
- package/index.css +1 -1
- package/package.json +3 -3
- package/src/tedi/components/buttons/collapse/collapse.cjs.js +1 -1
- package/src/tedi/components/buttons/collapse/collapse.d.ts +6 -0
- package/src/tedi/components/buttons/collapse/collapse.es.js +63 -62
- package/src/tedi/components/misc/scroll-visibility/scroll-visibility.cjs.js +2 -1
- package/src/tedi/components/misc/scroll-visibility/scroll-visibility.es.js +44 -32
- package/src/tedi/helpers/hooks/use-scroll.cjs.js +1 -1
- package/src/tedi/helpers/hooks/use-scroll.d.ts +3 -1
- package/src/tedi/helpers/hooks/use-scroll.es.js +19 -19
- package/src/tedi/providers/storybook-provider/storybook-provider.d.ts +0 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tedi-design-system/react",
|
|
3
|
-
"version": "15.0.0-rc.
|
|
3
|
+
"version": "15.0.0-rc.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"exports": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"build": "rm -rf dist && vite build --config vite.config.ts && replace-in-file //fonts//g \"./fonts/\" dist/index.css --isRegex",
|
|
23
23
|
"build:sb": "storybook build -c .storybook -o dist/storybook-static",
|
|
24
24
|
"lint": "npx stylelint \"src/**/*.scss\" --fix && eslint \"src/**/*.{ts,tsx}\" --no-ignore --fix",
|
|
25
|
-
"lint:ci": "npx stylelint \"src/**/*.scss\" && eslint --quiet",
|
|
25
|
+
"lint:ci": "npx stylelint \"src/**/*.scss\" --quiet && npx eslint . --quiet",
|
|
26
26
|
"test": "jest --config ./jest.config.ts --passWithNoTests",
|
|
27
27
|
"test:coverage": "jest --config ./jest.config.ts --coverage",
|
|
28
28
|
"release": "npx semantic-release",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@mui/material": "^5.15.13",
|
|
44
44
|
"@mui/x-date-pickers": "^5.0.20",
|
|
45
45
|
"@tanstack/react-table": "^8.13.2",
|
|
46
|
-
"@tedi-design-system/core": "3.0.
|
|
46
|
+
"@tedi-design-system/core": "3.0.1",
|
|
47
47
|
"classnames": "^2.5.1",
|
|
48
48
|
"draft-js": "^0.11.7",
|
|
49
49
|
"draftjs-md-converter": "^1.5.2",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),s=require("../../../../../external/classnames/index.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),s=require("../../../../../external/classnames/index.cjs.js"),_=require("react"),K=require("../../../../../external/react-animate-height/dist/esm/index.cjs.js"),A=require("../../base/icon/icon.cjs.js"),F=require("../../base/typography/text/text.cjs.js"),G=require("../../misc/print/print.cjs.js"),e=require("./collapse.module.scss.cjs.js"),H=require("../../../helpers/hooks/use-print.cjs.js"),J=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),Q=require("../../../providers/label-provider/use-labels.cjs.js"),v=require("../../layout/grid/row.cjs.js"),i=require("../../layout/grid/col.cjs.js"),N=x=>{const{getCurrentBreakpointProps:P}=J.useBreakpointProps(x.defaultServerBreakpoint),{getLabel:h}=Q.useLabels(),{id:r,children:w,className:k,openText:j=h("open"),closeText:g=h("close"),hideCollapseText:I=!1,title:c,titleRowProps:O,defaultOpen:$,open:d,onToggle:u,arrowType:n="default",size:o="default",underline:S=!0,toggleLabel:y,iconOnly:B=!1,...M}=P(x),p=`${r}__trigger`,f=`${r}__content`,R=`${r}__animate`,[b,T]=_.useState(()=>$),m=H.usePrint(),a=_.useMemo(()=>m||(d!==void 0?d:b),[m,d,b]),L=B===!0&&!c,D=s.default(e.default["tedi-collapse"],o==="small"&&e.default["tedi-collapse--small"],a&&e.default["tedi-collapse--is-open"],L&&e.default["tedi-collapse--icon-only"],e.default[`tedi-collapse--arrow-${n}`],k),q=()=>{const l=!a;T(l),u==null||u(l)},z=l=>{(l.key==="Enter"||l.key===" ")&&!l.repeat&&(l.preventDefault(),q())},E=y||(a?g:j),C=_.useMemo(()=>t.jsx("div",{id:f,role:"region","aria-labelledby":p,className:e.default["tedi-collapse__content"],children:w}),[w,f,p]);return t.jsxs("div",{"data-name":"collapse",...M,className:D,children:[t.jsx("button",{id:p,type:"button","data-name":"collapse-trigger",className:e.default["tedi-collapse__title"],"aria-label":E,"aria-expanded":a,"aria-controls":f,onKeyDown:z,onClick:q,children:t.jsxs(v.Row,{justifyContent:"between",alignItems:"center",wrap:"nowrap",...O,element:"span",children:[c&&t.jsx(i.Col,{"aria-hidden":"true",children:c}),t.jsx(i.Col,{width:"auto",children:t.jsxs(v.Row,{element:"span",alignItems:"center",gutter:0,wrap:"nowrap",children:[t.jsx(G.Print,{visibility:"hide",children:t.jsx(i.Col,{width:"auto",className:s.default({"visually-hidden":I}),children:t.jsx(F.Text,{element:"span",className:s.default(e.default["tedi-collapse__text"],{[e.default["tedi-collapse__text--underline"]]:S}),children:a?g:j})})}),t.jsx(i.Col,{width:"auto",children:t.jsx("div",{className:s.default(e.default["tedi-collapse__icon-wrapper"],e.default[`tedi-collapse__icon-wrapper--${n}`],o==="small"&&e.default["tedi-collapse__icon-wrapper--small"]),children:t.jsx(A.Icon,{className:s.default(e.default["tedi-collapse__icon"],e.default[`tedi-collapse__icon--${n}`],o==="small"&&e.default["tedi-collapse__icon--small"]),name:"expand_more",size:o==="small"||n==="secondary"?18:24})})})]})})]})}),m?C:t.jsx(K.default,{id:R,duration:300,height:a?"auto":0,"data-testid":"collapse-inner",children:C})]})};exports.Collapse=N;exports.default=N;
|
|
@@ -34,6 +34,12 @@ type CollapseBreakpointProps = {
|
|
|
34
34
|
*/
|
|
35
35
|
size?: 'default' | 'small';
|
|
36
36
|
underline?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Render collapse as icon-only toggle.
|
|
39
|
+
* Icon-only styles are applied ONLY when no title is provided.
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
iconOnly?: boolean;
|
|
37
43
|
};
|
|
38
44
|
export interface CollapseProps extends BreakpointSupport<CollapseBreakpointProps> {
|
|
39
45
|
/**
|
|
@@ -1,77 +1,78 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
1
|
+
import { jsx as t, jsxs as h } from "react/jsx-runtime";
|
|
2
2
|
import o from "../../../../../external/classnames/index.es.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { Icon as
|
|
6
|
-
import { Text as
|
|
7
|
-
import { Print as
|
|
3
|
+
import f from "react";
|
|
4
|
+
import A from "../../../../../external/react-animate-height/dist/esm/index.es.js";
|
|
5
|
+
import { Icon as H } from "../../base/icon/icon.es.js";
|
|
6
|
+
import { Text as q } from "../../base/typography/text/text.es.js";
|
|
7
|
+
import { Print as F } from "../../misc/print/print.es.js";
|
|
8
8
|
import e from "./collapse.module.scss.es.js";
|
|
9
|
-
import { usePrint as
|
|
10
|
-
import { useBreakpointProps as
|
|
11
|
-
import { useLabels as
|
|
12
|
-
import { Row as
|
|
9
|
+
import { usePrint as G } from "../../../helpers/hooks/use-print.es.js";
|
|
10
|
+
import { useBreakpointProps as J } from "../../../helpers/hooks/use-breakpoint-props.es.js";
|
|
11
|
+
import { useLabels as Q } from "../../../providers/label-provider/use-labels.es.js";
|
|
12
|
+
import { Row as k } from "../../layout/grid/row.es.js";
|
|
13
13
|
import { Col as s } from "../../layout/grid/col.es.js";
|
|
14
|
-
const
|
|
15
|
-
const { getCurrentBreakpointProps:
|
|
14
|
+
const se = (w) => {
|
|
15
|
+
const { getCurrentBreakpointProps: O } = J(w.defaultServerBreakpoint), { getLabel: y } = Q(), {
|
|
16
16
|
id: r,
|
|
17
17
|
children: g,
|
|
18
|
-
className:
|
|
19
|
-
openText:
|
|
20
|
-
closeText:
|
|
21
|
-
hideCollapseText:
|
|
22
|
-
title:
|
|
18
|
+
className: P,
|
|
19
|
+
openText: b = y("open"),
|
|
20
|
+
closeText: x = y("close"),
|
|
21
|
+
hideCollapseText: $ = !1,
|
|
22
|
+
title: c,
|
|
23
23
|
titleRowProps: B,
|
|
24
24
|
defaultOpen: S,
|
|
25
|
-
open:
|
|
26
|
-
onToggle:
|
|
27
|
-
arrowType:
|
|
28
|
-
size:
|
|
25
|
+
open: d,
|
|
26
|
+
onToggle: p,
|
|
27
|
+
arrowType: n = "default",
|
|
28
|
+
size: i = "default",
|
|
29
29
|
underline: T = !0,
|
|
30
|
-
toggleLabel:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
toggleLabel: N,
|
|
31
|
+
iconOnly: j = !1,
|
|
32
|
+
...D
|
|
33
|
+
} = O(w), m = `${r}__trigger`, u = `${r}__content`, L = `${r}__animate`, [C, M] = f.useState(() => S), _ = G(), a = f.useMemo(
|
|
34
|
+
() => _ || (d !== void 0 ? d : C),
|
|
35
|
+
[_, d, C]
|
|
36
|
+
), R = j === !0 && !c, z = o(
|
|
36
37
|
e["tedi-collapse"],
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
e[`tedi-collapse--arrow-${
|
|
41
|
-
|
|
42
|
-
),
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
(
|
|
47
|
-
},
|
|
48
|
-
() => /* @__PURE__ */ t("div", { id:
|
|
49
|
-
[g,
|
|
38
|
+
i === "small" && e["tedi-collapse--small"],
|
|
39
|
+
a && e["tedi-collapse--is-open"],
|
|
40
|
+
R && e["tedi-collapse--icon-only"],
|
|
41
|
+
e[`tedi-collapse--arrow-${n}`],
|
|
42
|
+
P
|
|
43
|
+
), v = () => {
|
|
44
|
+
const l = !a;
|
|
45
|
+
M(l), p == null || p(l);
|
|
46
|
+
}, E = (l) => {
|
|
47
|
+
(l.key === "Enter" || l.key === " ") && !l.repeat && (l.preventDefault(), v());
|
|
48
|
+
}, K = N || (a ? x : b), I = f.useMemo(
|
|
49
|
+
() => /* @__PURE__ */ t("div", { id: u, role: "region", "aria-labelledby": m, className: e["tedi-collapse__content"], children: g }),
|
|
50
|
+
[g, u, m]
|
|
50
51
|
);
|
|
51
|
-
return /* @__PURE__ */
|
|
52
|
+
return /* @__PURE__ */ h("div", { "data-name": "collapse", ...D, className: z, children: [
|
|
52
53
|
/* @__PURE__ */ t(
|
|
53
54
|
"button",
|
|
54
55
|
{
|
|
55
|
-
id:
|
|
56
|
+
id: m,
|
|
56
57
|
type: "button",
|
|
57
58
|
"data-name": "collapse-trigger",
|
|
58
59
|
className: e["tedi-collapse__title"],
|
|
59
|
-
"aria-label":
|
|
60
|
-
"aria-expanded":
|
|
61
|
-
"aria-controls":
|
|
62
|
-
onKeyDown:
|
|
63
|
-
onClick:
|
|
64
|
-
children: /* @__PURE__ */
|
|
65
|
-
|
|
66
|
-
/* @__PURE__ */ t(s, { width: "auto", children: /* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */ t(
|
|
68
|
-
|
|
60
|
+
"aria-label": K,
|
|
61
|
+
"aria-expanded": a,
|
|
62
|
+
"aria-controls": u,
|
|
63
|
+
onKeyDown: E,
|
|
64
|
+
onClick: v,
|
|
65
|
+
children: /* @__PURE__ */ h(k, { justifyContent: "between", alignItems: "center", wrap: "nowrap", ...B, element: "span", children: [
|
|
66
|
+
c && /* @__PURE__ */ t(s, { "aria-hidden": "true", children: c }),
|
|
67
|
+
/* @__PURE__ */ t(s, { width: "auto", children: /* @__PURE__ */ h(k, { element: "span", alignItems: "center", gutter: 0, wrap: "nowrap", children: [
|
|
68
|
+
/* @__PURE__ */ t(F, { visibility: "hide", children: /* @__PURE__ */ t(s, { width: "auto", className: o({ "visually-hidden": $ }), children: /* @__PURE__ */ t(
|
|
69
|
+
q,
|
|
69
70
|
{
|
|
70
71
|
element: "span",
|
|
71
72
|
className: o(e["tedi-collapse__text"], {
|
|
72
73
|
[e["tedi-collapse__text--underline"]]: T
|
|
73
74
|
}),
|
|
74
|
-
children:
|
|
75
|
+
children: a ? x : b
|
|
75
76
|
}
|
|
76
77
|
) }) }),
|
|
77
78
|
/* @__PURE__ */ t(s, { width: "auto", children: /* @__PURE__ */ t(
|
|
@@ -79,19 +80,19 @@ const ie = (f) => {
|
|
|
79
80
|
{
|
|
80
81
|
className: o(
|
|
81
82
|
e["tedi-collapse__icon-wrapper"],
|
|
82
|
-
e[`tedi-collapse__icon-wrapper--${
|
|
83
|
-
|
|
83
|
+
e[`tedi-collapse__icon-wrapper--${n}`],
|
|
84
|
+
i === "small" && e["tedi-collapse__icon-wrapper--small"]
|
|
84
85
|
),
|
|
85
86
|
children: /* @__PURE__ */ t(
|
|
86
|
-
|
|
87
|
+
H,
|
|
87
88
|
{
|
|
88
89
|
className: o(
|
|
89
90
|
e["tedi-collapse__icon"],
|
|
90
|
-
e[`tedi-collapse__icon--${
|
|
91
|
-
|
|
91
|
+
e[`tedi-collapse__icon--${n}`],
|
|
92
|
+
i === "small" && e["tedi-collapse__icon--small"]
|
|
92
93
|
),
|
|
93
94
|
name: "expand_more",
|
|
94
|
-
size:
|
|
95
|
+
size: i === "small" || n === "secondary" ? 18 : 24
|
|
95
96
|
}
|
|
96
97
|
)
|
|
97
98
|
}
|
|
@@ -100,10 +101,10 @@ const ie = (f) => {
|
|
|
100
101
|
] })
|
|
101
102
|
}
|
|
102
103
|
),
|
|
103
|
-
|
|
104
|
+
_ ? I : /* @__PURE__ */ t(A, { id: L, duration: 300, height: a ? "auto" : 0, "data-testid": "collapse-inner", children: I })
|
|
104
105
|
] });
|
|
105
106
|
};
|
|
106
107
|
export {
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
se as Collapse,
|
|
109
|
+
se as default
|
|
109
110
|
};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
"use
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const M=require("react/jsx-runtime"),v=require("../../../../../external/classnames/index.cjs.js"),t=require("react"),V=require("../../../helpers/hooks/use-scroll.cjs.js"),b=require("./scroll-visibility.module.scss.cjs.js"),g=w=>{const{children:l,enabled:o=!0,className:H,visibility:n="hide",toggleVisibility:h=!1,scrollDistance:c=100,scrollDirection:u="down",scrollContainer:p,animationDirection:q="center"}=w,[d,D]=t.useState(!1),{scrollTop:i=0,scrollHeight:a=0,clientHeight:f=0}=V.useScroll(p)??{},[E,m]=t.useState(!1),S=t.useRef(0);t.useEffect(()=>{if(D(!0),!o)return;const e=u==="down"?i:a-f-i,s=n==="hide"?e>c:e<=c;m(s),S.current=e},[]),t.useEffect(()=>{if(!d||!o)return;const e=n==="show",s=u==="down"?i:a-f-i;let r;h&&s<S.current?r=e:s>c?r=!e:r=e,m(r),S.current=s},[d,o,n,h,c,i,u,a,f]);const y=v.default(b.default["tedi-scroll-visibility"],b.default[`tedi-scroll-visibility--${q}`],{[b.default["tedi-scroll-visibility--hidden"]]:d&&o&&E},H);return t.isValidElement(l)?t.cloneElement(l,{className:v.default(l.props.className,y)}):M.jsx("div",{className:y,children:l})};exports.ScrollVisibility=g;exports.default=g;
|
|
@@ -1,40 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as M } from "react/jsx-runtime";
|
|
3
|
+
import y from "../../../../../external/classnames/index.es.js";
|
|
4
|
+
import { useState as S, useRef as V, useEffect as w, cloneElement as x, isValidElement as I } from "react";
|
|
5
|
+
import { useScroll as T } from "../../../helpers/hooks/use-scroll.es.js";
|
|
6
|
+
import f from "./scroll-visibility.module.scss.es.js";
|
|
7
|
+
const k = (H) => {
|
|
7
8
|
const {
|
|
8
|
-
children:
|
|
9
|
-
enabled:
|
|
10
|
-
className:
|
|
9
|
+
children: t,
|
|
10
|
+
enabled: l = !0,
|
|
11
|
+
className: v,
|
|
11
12
|
visibility: n = "hide",
|
|
12
|
-
toggleVisibility:
|
|
13
|
-
scrollDistance:
|
|
14
|
-
scrollDirection:
|
|
15
|
-
scrollContainer:
|
|
16
|
-
animationDirection:
|
|
17
|
-
} =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (!
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
13
|
+
toggleVisibility: h = !1,
|
|
14
|
+
scrollDistance: o = 100,
|
|
15
|
+
scrollDirection: c = "down",
|
|
16
|
+
scrollContainer: D,
|
|
17
|
+
animationDirection: N = "center"
|
|
18
|
+
} = H, [d, g] = S(!1), { scrollTop: s = 0, scrollHeight: a = 0, clientHeight: u = 0 } = T(D) ?? {}, [E, p] = S(!1), m = V(0);
|
|
19
|
+
w(() => {
|
|
20
|
+
if (g(!0), !l) return;
|
|
21
|
+
const e = c === "down" ? s : a - u - s, i = n === "hide" ? e > o : e <= o;
|
|
22
|
+
p(i), m.current = e;
|
|
23
|
+
}, []), w(() => {
|
|
24
|
+
if (!d || !l) return;
|
|
25
|
+
const e = n === "show", i = c === "down" ? s : a - u - s;
|
|
26
|
+
let r;
|
|
27
|
+
h && i < m.current ? r = e : i > o ? r = !e : r = e, p(r), m.current = i;
|
|
28
|
+
}, [
|
|
29
|
+
d,
|
|
30
|
+
l,
|
|
31
|
+
n,
|
|
32
|
+
h,
|
|
33
|
+
o,
|
|
34
|
+
s,
|
|
35
|
+
c,
|
|
36
|
+
a,
|
|
37
|
+
u
|
|
38
|
+
]);
|
|
39
|
+
const b = y(
|
|
40
|
+
f["tedi-scroll-visibility"],
|
|
41
|
+
f[`tedi-scroll-visibility--${N}`],
|
|
30
42
|
{
|
|
31
|
-
[
|
|
43
|
+
[f["tedi-scroll-visibility--hidden"]]: d && l && E
|
|
32
44
|
},
|
|
33
|
-
|
|
45
|
+
v
|
|
34
46
|
);
|
|
35
|
-
return
|
|
47
|
+
return I(t) ? x(t, { className: y(t.props.className, b) }) : /* @__PURE__ */ M("div", { className: b, children: t });
|
|
36
48
|
};
|
|
37
49
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
50
|
+
k as ScrollVisibility,
|
|
51
|
+
k as default
|
|
40
52
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../../../external/lodash-es/throttle.cjs.js"),r=require("react"),u={scrollTop:0,scrollHeight:0,clientHeight:0},a=t=>{const[s,n]=r.useState(u);return r.useEffect(()=>{const e=t??document.documentElement,o=t??window,c=()=>{n({scrollTop:e.scrollTop,scrollHeight:e.scrollHeight,clientHeight:e.clientHeight})},l=i.default(c,50);return o.addEventListener("scroll",l),c(),()=>{o.removeEventListener("scroll",l),l.cancel()}},[t]),s};exports.useScroll=a;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useState as
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return
|
|
10
|
-
const t =
|
|
11
|
-
|
|
12
|
-
scrollTop:
|
|
13
|
-
scrollHeight:
|
|
14
|
-
clientHeight:
|
|
1
|
+
import n from "../../../../external/lodash-es/throttle.es.js";
|
|
2
|
+
import { useState as i, useEffect as g } from "react";
|
|
3
|
+
const u = {
|
|
4
|
+
scrollTop: 0,
|
|
5
|
+
scrollHeight: 0,
|
|
6
|
+
clientHeight: 0
|
|
7
|
+
}, a = (t) => {
|
|
8
|
+
const [r, s] = i(u);
|
|
9
|
+
return g(() => {
|
|
10
|
+
const o = t ?? document.documentElement, l = t ?? window, c = () => {
|
|
11
|
+
s({
|
|
12
|
+
scrollTop: o.scrollTop,
|
|
13
|
+
scrollHeight: o.scrollHeight,
|
|
14
|
+
clientHeight: o.clientHeight
|
|
15
15
|
});
|
|
16
|
-
}, 50);
|
|
17
|
-
return
|
|
18
|
-
|
|
16
|
+
}, e = n(c, 50);
|
|
17
|
+
return l.addEventListener("scroll", e), c(), () => {
|
|
18
|
+
l.removeEventListener("scroll", e), e.cancel();
|
|
19
19
|
};
|
|
20
|
-
}, [
|
|
20
|
+
}, [t]), r;
|
|
21
21
|
};
|
|
22
22
|
export {
|
|
23
|
-
|
|
23
|
+
a as useScroll
|
|
24
24
|
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
interface TextRowProps {
|
|
3
|
-
desktopText: React.ReactNode;
|
|
4
|
-
mobileText: React.ReactNode;
|
|
5
|
-
isLink?: boolean;
|
|
6
|
-
noUnderline?: boolean;
|
|
7
|
-
className?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare const TextRow: React.FC<TextRowProps>;
|
|
10
|
-
export {};
|