@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tedi-design-system/react",
3
- "version": "15.0.0-rc.5",
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.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"),f=require("react"),z=require("../../../../../external/react-animate-height/dist/esm/index.cjs.js"),E=require("../../base/icon/icon.cjs.js"),K=require("../../base/typography/text/text.cjs.js"),A=require("../../misc/print/print.cjs.js"),e=require("./collapse.module.scss.cjs.js"),F=require("../../../helpers/hooks/use-print.cjs.js"),G=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),H=require("../../../providers/label-provider/use-labels.cjs.js"),N=require("../../layout/grid/row.cjs.js"),o=require("../../layout/grid/col.cjs.js"),P=_=>{const{getCurrentBreakpointProps:k}=G.useBreakpointProps(_.defaultServerBreakpoint),{getLabel:x}=H.useLabels(),{id:r,children:h,className:I,openText:w=x("open"),closeText:j=x("close"),hideCollapseText:g=!1,title:b,titleRowProps:$,defaultOpen:O,open:c,onToggle:d,arrowType:n="default",size:i="default",underline:S=!0,toggleLabel:q,...B}=k(_),u=`${r}__trigger`,p=`${r}__content`,M=`${r}__animate`,[y,R]=f.useState(()=>O),m=F.usePrint(),a=f.useMemo(()=>m||(c!==void 0?c:y),[m,c,y]),T=s.default(e.default["tedi-collapse"],i==="small"&&e.default["tedi-collapse--small"],a&&e.default["tedi-collapse--is-open"],g&&e.default["tedi-collapse--icon-only"],e.default[`tedi-collapse--arrow-${n}`],I),C=()=>{const l=!a;R(l),d==null||d(l)},L=l=>{(l.key==="Enter"||l.key===" ")&&!l.repeat&&(l.preventDefault(),C())},D=q||(a?j:w),v=f.useMemo(()=>t.jsx("div",{id:p,role:"region","aria-labelledby":u,className:e.default["tedi-collapse__content"],children:h}),[h,p,u]);return t.jsxs("div",{"data-name":"collapse",...B,className:T,children:[t.jsx("button",{id:u,type:"button","data-name":"collapse-trigger",className:e.default["tedi-collapse__title"],"aria-label":D,"aria-expanded":a,"aria-controls":p,onKeyDown:L,onClick:C,children:t.jsxs(N.Row,{justifyContent:"between",alignItems:"center",wrap:"nowrap",...$,element:"span",children:[b&&t.jsx(o.Col,{"aria-hidden":"true",children:b}),t.jsx(o.Col,{width:"auto",children:t.jsxs(N.Row,{element:"span",alignItems:"center",gutter:0,wrap:"nowrap",children:[t.jsx(A.Print,{visibility:"hide",children:t.jsx(o.Col,{width:"auto",className:s.default({"visually-hidden":g}),children:t.jsx(K.Text,{element:"span",className:s.default(e.default["tedi-collapse__text"],{[e.default["tedi-collapse__text--underline"]]:S}),children:a?j:w})})}),t.jsx(o.Col,{width:"auto",children:t.jsx("div",{className:s.default(e.default["tedi-collapse__icon-wrapper"],e.default[`tedi-collapse__icon-wrapper--${n}`],i==="small"&&e.default["tedi-collapse__icon-wrapper--small"]),children:t.jsx(E.Icon,{className:s.default(e.default["tedi-collapse__icon"],e.default[`tedi-collapse__icon--${n}`],i==="small"&&e.default["tedi-collapse__icon--small"]),name:"expand_more",size:i==="small"||n==="secondary"?18:24})})})]})})]})}),m?v:t.jsx(z.default,{id:M,duration:300,height:a?"auto":0,"data-testid":"collapse-inner",children:v})]})};exports.Collapse=P;exports.default=P;
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 _ } from "react/jsx-runtime";
1
+ import { jsx as t, jsxs as h } from "react/jsx-runtime";
2
2
  import o from "../../../../../external/classnames/index.es.js";
3
- import h from "react";
4
- import E from "../../../../../external/react-animate-height/dist/esm/index.es.js";
5
- import { Icon as K } from "../../base/icon/icon.es.js";
6
- import { Text as A } from "../../base/typography/text/text.es.js";
7
- import { Print as H } from "../../misc/print/print.es.js";
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 q } from "../../../helpers/hooks/use-print.es.js";
10
- import { useBreakpointProps as F } from "../../../helpers/hooks/use-breakpoint-props.es.js";
11
- import { useLabels as G } from "../../../providers/label-provider/use-labels.es.js";
12
- import { Row as P } from "../../layout/grid/row.es.js";
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 ie = (f) => {
15
- const { getCurrentBreakpointProps: $ } = F(f.defaultServerBreakpoint), { getLabel: w } = G(), {
14
+ const se = (w) => {
15
+ const { getCurrentBreakpointProps: O } = J(w.defaultServerBreakpoint), { getLabel: y } = Q(), {
16
16
  id: r,
17
17
  children: g,
18
- className: O,
19
- openText: y = w("open"),
20
- closeText: b = w("close"),
21
- hideCollapseText: x = !1,
22
- title: N,
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: c,
26
- onToggle: d,
27
- arrowType: i = "default",
28
- size: n = "default",
25
+ open: d,
26
+ onToggle: p,
27
+ arrowType: n = "default",
28
+ size: i = "default",
29
29
  underline: T = !0,
30
- toggleLabel: C,
31
- ...j
32
- } = $(f), p = `${r}__trigger`, m = `${r}__content`, D = `${r}__animate`, [v, L] = h.useState(() => S), u = q(), l = h.useMemo(
33
- () => u || (c !== void 0 ? c : v),
34
- [u, c, v]
35
- ), M = o(
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
- n === "small" && e["tedi-collapse--small"],
38
- l && e["tedi-collapse--is-open"],
39
- x && e["tedi-collapse--icon-only"],
40
- e[`tedi-collapse--arrow-${i}`],
41
- O
42
- ), k = () => {
43
- const a = !l;
44
- L(a), d == null || d(a);
45
- }, R = (a) => {
46
- (a.key === "Enter" || a.key === " ") && !a.repeat && (a.preventDefault(), k());
47
- }, z = C || (l ? b : y), I = h.useMemo(
48
- () => /* @__PURE__ */ t("div", { id: m, role: "region", "aria-labelledby": p, className: e["tedi-collapse__content"], children: g }),
49
- [g, m, p]
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__ */ _("div", { "data-name": "collapse", ...j, className: M, children: [
52
+ return /* @__PURE__ */ h("div", { "data-name": "collapse", ...D, className: z, children: [
52
53
  /* @__PURE__ */ t(
53
54
  "button",
54
55
  {
55
- id: p,
56
+ id: m,
56
57
  type: "button",
57
58
  "data-name": "collapse-trigger",
58
59
  className: e["tedi-collapse__title"],
59
- "aria-label": z,
60
- "aria-expanded": l,
61
- "aria-controls": m,
62
- onKeyDown: R,
63
- onClick: k,
64
- children: /* @__PURE__ */ _(P, { justifyContent: "between", alignItems: "center", wrap: "nowrap", ...B, element: "span", children: [
65
- N && /* @__PURE__ */ t(s, { "aria-hidden": "true", children: N }),
66
- /* @__PURE__ */ t(s, { width: "auto", children: /* @__PURE__ */ _(P, { element: "span", alignItems: "center", gutter: 0, wrap: "nowrap", children: [
67
- /* @__PURE__ */ t(H, { visibility: "hide", children: /* @__PURE__ */ t(s, { width: "auto", className: o({ "visually-hidden": x }), children: /* @__PURE__ */ t(
68
- A,
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: l ? b : y
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--${i}`],
83
- n === "small" && e["tedi-collapse__icon-wrapper--small"]
83
+ e[`tedi-collapse__icon-wrapper--${n}`],
84
+ i === "small" && e["tedi-collapse__icon-wrapper--small"]
84
85
  ),
85
86
  children: /* @__PURE__ */ t(
86
- K,
87
+ H,
87
88
  {
88
89
  className: o(
89
90
  e["tedi-collapse__icon"],
90
- e[`tedi-collapse__icon--${i}`],
91
- n === "small" && e["tedi-collapse__icon--small"]
91
+ e[`tedi-collapse__icon--${n}`],
92
+ i === "small" && e["tedi-collapse__icon--small"]
92
93
  ),
93
94
  name: "expand_more",
94
- size: n === "small" || i === "secondary" ? 18 : 24
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
- u ? I : /* @__PURE__ */ t(E, { id: D, duration: 300, height: l ? "auto" : 0, "data-testid": "collapse-inner", children: I })
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
- ie as Collapse,
108
- ie as default
108
+ se as Collapse,
109
+ se as default
109
110
  };
@@ -1 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const D=require("react/jsx-runtime"),h=require("../../../../../external/classnames/index.cjs.js"),l=require("react"),V=require("../../../helpers/hooks/use-scroll.cjs.js"),f=require("./scroll-visibility.module.scss.cjs.js"),y=v=>{const{children:t,enabled:s=!0,className:g,visibility:u="hide",toggleVisibility:b=!1,scrollDistance:r=100,scrollDirection:o="down",scrollContainer:w,animationDirection:p="center"}=v,{scrollTop:e,scrollHeight:c,clientHeight:n}=V.useScroll(w),[q,d]=l.useState(()=>{if(!s)return!1;const i=o==="down"?e:c-n-e;return u==="hide"?i>r:i<=r}),S=l.useRef(o==="down"?e:c-n-e);l.useEffect(()=>{if(!s)return;const i=u==="show",a=o==="down"?e:c-n-e;b&&a<S.current?d(i):a>r?d(!i):d(i),S.current=a},[u,b,r,e,s,o,c,n]);const m=h.default(f.default["tedi-scroll-visibility"],f.default[`tedi-scroll-visibility--${p}`],{[f.default["tedi-scroll-visibility--hidden"]]:s&&q},g);return l.isValidElement(t)?l.cloneElement(t,{className:h.default(t.props.className,m)}):D.jsx("div",{className:m,children:t})};exports.ScrollVisibility=y;exports.default=y;
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
- import { jsx as D } from "react/jsx-runtime";
2
- import h from "../../../../../external/classnames/index.es.js";
3
- import { useState as N, useRef as g, useEffect as E, cloneElement as H, isValidElement as V } from "react";
4
- import { useScroll as x } from "../../../helpers/hooks/use-scroll.es.js";
5
- import m from "./scroll-visibility.module.scss.es.js";
6
- const M = (b) => {
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: s,
9
- enabled: t = !0,
10
- className: y,
9
+ children: t,
10
+ enabled: l = !0,
11
+ className: v,
11
12
  visibility: n = "hide",
12
- toggleVisibility: f = !1,
13
- scrollDistance: l = 100,
14
- scrollDirection: o = "down",
15
- scrollContainer: S,
16
- animationDirection: w = "center"
17
- } = b, { scrollTop: e, scrollHeight: r, clientHeight: c } = x(S), [v, a] = N(() => {
18
- if (!t) return !1;
19
- const i = o === "down" ? e : r - c - e;
20
- return n === "hide" ? i > l : i <= l;
21
- }), u = g(o === "down" ? e : r - c - e);
22
- E(() => {
23
- if (!t) return;
24
- const i = n === "show", d = o === "down" ? e : r - c - e;
25
- f && d < u.current ? a(i) : d > l ? a(!i) : a(i), u.current = d;
26
- }, [n, f, l, e, t, o, r, c]);
27
- const p = h(
28
- m["tedi-scroll-visibility"],
29
- m[`tedi-scroll-visibility--${w}`],
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
- [m["tedi-scroll-visibility--hidden"]]: t && v
43
+ [f["tedi-scroll-visibility--hidden"]]: d && l && E
32
44
  },
33
- y
45
+ v
34
46
  );
35
- return V(s) ? H(s, { className: h(s.props.className, p) }) : /* @__PURE__ */ D("div", { className: p, children: s });
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
- M as ScrollVisibility,
39
- M as default
50
+ k as ScrollVisibility,
51
+ k as default
40
52
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../../../external/lodash-es/throttle.cjs.js"),o=require("react"),n=l=>{const e=l??document.documentElement,[c,r]=o.useState({scrollTop:e.scrollTop,scrollHeight:e.scrollHeight,clientHeight:e.clientHeight});return o.useEffect(()=>{const t=s.default(()=>{r({scrollTop:e.scrollTop,scrollHeight:e.scrollHeight,clientHeight:e.clientHeight})},50);return(l??window).addEventListener("scroll",t),t(),()=>{(l??window).removeEventListener("scroll",t),t.cancel()}},[e,l]),c};exports.useScroll=n;
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,5 +1,7 @@
1
- export declare const useScroll: (element?: HTMLElement) => {
1
+ type ScrollState = {
2
2
  scrollTop: number;
3
3
  scrollHeight: number;
4
4
  clientHeight: number;
5
5
  };
6
+ export declare const useScroll: (element?: HTMLElement) => ScrollState;
7
+ export {};
@@ -1,24 +1,24 @@
1
- import r from "../../../../external/lodash-es/throttle.es.js";
2
- import { useState as s, useEffect as i } from "react";
3
- const g = (o) => {
4
- const l = o ?? document.documentElement, [e, c] = s({
5
- scrollTop: l.scrollTop,
6
- scrollHeight: l.scrollHeight,
7
- clientHeight: l.clientHeight
8
- });
9
- return i(() => {
10
- const t = r(() => {
11
- c({
12
- scrollTop: l.scrollTop,
13
- scrollHeight: l.scrollHeight,
14
- clientHeight: l.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 (o ?? window).addEventListener("scroll", t), t(), () => {
18
- (o ?? window).removeEventListener("scroll", t), t.cancel();
16
+ }, e = n(c, 50);
17
+ return l.addEventListener("scroll", e), c(), () => {
18
+ l.removeEventListener("scroll", e), e.cancel();
19
19
  };
20
- }, [l, o]), e;
20
+ }, [t]), r;
21
21
  };
22
22
  export {
23
- g as useScroll
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 {};