@rikstv/shared-components 3.3.14 → 3.3.15-alpha.1

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.
@@ -1,199 +1,197 @@
1
- import { R as C } from "./components/core/RiksTV-CxHetJcp.mjs";
2
- import { S as F } from "./components/core/Strim-C1ajVDCm.mjs";
3
- import { L as D } from "./components/core/LightMode-DPAa0Pv9.mjs";
4
- import { G as k } from "./components/spacing/Gutter-PXX_UdiX.mjs";
5
- import { G as N } from "./components/spacing/GutterPadding-Bd7tSm3F.mjs";
6
- import { N as Q } from "./components/notificationDot/NotificationDot-C2_j4FdL.mjs";
7
- import { A as _ } from "./components/accordion/Accordion-rewqLwCV.mjs";
8
- import { P as U } from "./components/panel/Panel-3hKyYFKO.mjs";
9
- import { A as z } from "./components/alert/Alert-Bib0anpB.mjs";
10
- import { B as K, a as X } from "./components/breadcrumb/Breadcrumb-BJNLZ7iB.mjs";
11
- import { P as Z } from "./components/progress/Progress-CjnegHvC.mjs";
12
- import { L as re } from "./components/loader/Loader-gjL6yh1f.mjs";
13
- import { C as ne } from "./components/progress/CircularProgress-BKmJjWRu.mjs";
14
- import { D as se } from "./components/dropdown/Dropdown-CWVW7rKD.mjs";
15
- import { G as ae, P as ce, S as ue, T as de } from "./components/button/Button-DGXKZhwG.mjs";
16
- import { G as fe, P as le, S as xe, T as ge } from "./components/button/ArrowButton-DqViaPQ-.mjs";
17
- import { G as ye, P as Te, S as ve, T as Be } from "./components/button/IconButton-DVEZ8K3d.mjs";
18
- import { T as we } from "./components/toggleButton/ToggleButton-CGLyQll6.mjs";
19
- import { T as Ie } from "./components/toggleInlineButton/ToggleInlineButton-Cnet1doK.mjs";
20
- import { T as be } from "./components/toggleLinkButton/ToggleLinkButton-BzwzqRHv.mjs";
21
- import { C as Pe } from "./components/checkbox/Checkbox-Cl4PCYXu.mjs";
22
- import { R as Se } from "./components/toggle/RadioToggle-C_79eEFl.mjs";
23
- import { F as Ce } from "./components/toggle/FieldSet-BM_JN_UL.mjs";
24
- import { T as Fe } from "./components/textfield/TextField-Ct-ceRzE.mjs";
25
- import { P as De } from "./components/textfield/PasswordTextField-BfvT8zYj.mjs";
26
- import { B as ke, d as Ve, D as Ne, a as $e, b as Qe, c as We, H as _e, L as qe, M as Ue, S as je, e as ze, f as Je, g as Ke, T as Xe } from "./components/typography/Typography-CXNJ1SFo.mjs";
27
- import { L as Ze } from "./components/list/List-4jHnUXn_.mjs";
28
- import { C as rr } from "./components/list/CheckmarkListItem-DE0v1Zhg.mjs";
29
- import { L as nr } from "./components/list/ListItem-ClQsSisn.mjs";
30
- import { C as sr } from "./components/list/CrossmarkListItem-DFXTjZR6.mjs";
31
- import { O as ar } from "./components/list/OrderedListItem-CphW2Aa0.mjs";
32
- import { useState as x, useEffect as m, useRef as c, useCallback as g, useLayoutEffect as y } from "react";
33
- import { I as ur } from "./components/icons/Icons-CgcqUFmH.mjs";
34
- import { B as mr } from "./components/button/BaseLinkButton-niQ474XP.mjs";
35
- const h = "(prefers-reduced-motion: reduce)", T = (e) => typeof window < "u" && window.matchMedia ? window.matchMedia(e).matches : !1, v = (e, t) => {
36
- typeof e.addEventListener < "u" && e.addEventListener("change", t);
37
- }, B = () => {
38
- const [e, t] = x(T(h));
39
- return m(() => {
40
- typeof window < "u" && window.matchMedia && v(window.matchMedia(h), (n) => {
41
- t(n.matches);
1
+ import { R as A } from "./components/core/RiksTV-D1wr-aYp.mjs";
2
+ import { S as k } from "./components/core/Strim-1ocLRXTP.mjs";
3
+ import { L as F } from "./components/core/LightMode-DPAa0Pv9.mjs";
4
+ import { G as D } from "./components/spacing/Gutter-PXX_UdiX.mjs";
5
+ import { G as V } from "./components/spacing/GutterPadding-Bd7tSm3F.mjs";
6
+ import { N as $ } from "./components/notificationDot/NotificationDot-C2_j4FdL.mjs";
7
+ import { A as W } from "./components/accordion/Accordion-rewqLwCV.mjs";
8
+ import { P as q } from "./components/panel/Panel-D2Nkdd54.mjs";
9
+ import { A as j } from "./components/alert/Alert-BvwcxnzO.mjs";
10
+ import { B as J, a as K } from "./components/breadcrumb/Breadcrumb-BJNLZ7iB.mjs";
11
+ import { P as Y } from "./components/progress/Progress-CjnegHvC.mjs";
12
+ import { L as ee } from "./components/loader/Loader-gjL6yh1f.mjs";
13
+ import { C as re } from "./components/progress/CircularProgress-BKmJjWRu.mjs";
14
+ import { D as ne } from "./components/dropdown/Dropdown-c9wdxVoJ.mjs";
15
+ import { G as ie, P as ae, S as ce, T as ue } from "./components/button/Button-DGXKZhwG.mjs";
16
+ import { G as fe, P as me, S as le, T as pe } from "./components/button/ArrowButton-DqViaPQ-.mjs";
17
+ import { G as ge, P as he, S as ye, T as ve } from "./components/button/IconButton-DVEZ8K3d.mjs";
18
+ import { T as be } from "./components/toggleButton/ToggleButton-Dhxp8g2g.mjs";
19
+ import { T as we } from "./components/toggleInlineButton/ToggleInlineButton-9ZcLN5Lf.mjs";
20
+ import { T as Ie } from "./components/toggleLinkButton/ToggleLinkButton-B01oBGAX.mjs";
21
+ import { C as Me } from "./components/checkbox/Checkbox-Cl4PCYXu.mjs";
22
+ import { R as Re } from "./components/toggle/RadioToggle-C_79eEFl.mjs";
23
+ import { F as Ae } from "./components/toggle/FieldSet-BM_JN_UL.mjs";
24
+ import { T as ke } from "./components/textfield/TextField-Ct-ceRzE.mjs";
25
+ import { P as Fe } from "./components/textfield/PasswordTextField-BfvT8zYj.mjs";
26
+ import { B as De, d as Oe, D as Ve, a as Ne, b as $e, c as Qe, H as We, L as _e, M as qe, S as Ue, e as je, f as ze, g as Je, T as Ke } from "./components/typography/Typography-CXNJ1SFo.mjs";
27
+ import { L as Ye } from "./components/list/List-4jHnUXn_.mjs";
28
+ import { C as et } from "./components/list/CheckmarkListItem-DE0v1Zhg.mjs";
29
+ import { L as rt } from "./components/list/ListItem-ClQsSisn.mjs";
30
+ import { C as nt } from "./components/list/CrossmarkListItem-DFXTjZR6.mjs";
31
+ import { O as it } from "./components/list/OrderedListItem-CphW2Aa0.mjs";
32
+ import { useState as l, useEffect as f, useRef as a, useCallback as p, useLayoutEffect as g } from "react";
33
+ import { I as ct } from "./components/icons/Icons-CgcqUFmH.mjs";
34
+ import { B as dt } from "./components/button/BaseLinkButton-niQ474XP.mjs";
35
+ const x = "(prefers-reduced-motion: reduce)", h = (e) => typeof window < "u" && window.matchMedia ? window.matchMedia(e).matches : !1, y = (e, r) => {
36
+ typeof e.addEventListener < "u" && e.addEventListener("change", r);
37
+ }, v = () => {
38
+ const [e, r] = l(h(x));
39
+ return f(() => {
40
+ typeof window < "u" && window.matchMedia && y(window.matchMedia(x), (n) => {
41
+ r(n.matches);
42
42
  });
43
43
  }, []), { prefersReducedMotion: e };
44
44
  };
45
- function b(e, t) {
46
- const n = c(null), s = c(null), o = c(null), a = c(!0), { prefersReducedMotion: u } = B();
47
- function d(r) {
48
- var l;
49
- const i = o.current;
50
- i && r.target === i && (i.removeAttribute("style"), (l = t == null ? void 0 : t.onTransitionEnd) == null || l.call(t, e));
45
+ function I(e, r) {
46
+ const n = a(null), s = a(null), o = a(null), i = a(!0), { prefersReducedMotion: c } = v();
47
+ function u(t) {
48
+ const d = o.current;
49
+ d && t.target === d && (d.removeAttribute("style"), r?.onTransitionEnd?.(e));
51
50
  }
52
- const f = g(() => {
53
- var i, l;
54
- if (a.current)
51
+ const m = p(() => {
52
+ if (i.current)
55
53
  return;
56
- if ((i = t == null ? void 0 : t.onTransitionStart) == null || i.call(t, e), u) {
57
- (l = t == null ? void 0 : t.onTransitionEnd) == null || l.call(t, e);
54
+ if (r?.onTransitionStart?.(e), c) {
55
+ r?.onTransitionEnd?.(e);
58
56
  return;
59
57
  }
60
- const r = o.current;
61
- if (r)
62
- if (r.style.display = "block", r.style.overflow = "hidden", e)
63
- r.style.height = "0", r.style.height = `${r.scrollHeight}px`;
58
+ const t = o.current;
59
+ if (t)
60
+ if (t.style.display = "block", t.style.overflow = "hidden", e)
61
+ t.style.height = "0", t.style.height = `${t.scrollHeight}px`;
64
62
  else {
65
- if (r.scrollHeight === 0) {
66
- r.removeAttribute("style");
63
+ if (t.scrollHeight === 0) {
64
+ t.removeAttribute("style");
67
65
  return;
68
66
  }
69
- r.style.height = `${r.scrollHeight}px`, n.current = requestAnimationFrame(() => {
67
+ t.style.height = `${t.scrollHeight}px`, n.current = requestAnimationFrame(() => {
70
68
  s.current = requestAnimationFrame(() => {
71
- r.style.height = "0px";
69
+ t.style.height = "0px";
72
70
  });
73
71
  });
74
72
  }
75
- }, [e, t, u]);
76
- return y(() => {
77
- f();
78
- }, [e, f]), m(() => {
79
- const r = o.current;
80
- return r && r.addEventListener("transitionend", d), () => {
81
- r && r.removeEventListener("transitionend", d);
73
+ }, [e, r, c]);
74
+ return g(() => {
75
+ m();
76
+ }, [e, m]), f(() => {
77
+ const t = o.current;
78
+ return t && t.addEventListener("transitionend", u), () => {
79
+ t && t.removeEventListener("transitionend", u);
82
80
  };
83
- }, [e]), m(() => {
84
- const r = n.current, i = s.current;
85
- return a.current = !1, () => {
86
- r && cancelAnimationFrame(r), i && cancelAnimationFrame(i);
81
+ }, [e]), f(() => {
82
+ const t = n.current, d = s.current;
83
+ return i.current = !1, () => {
84
+ t && cancelAnimationFrame(t), d && cancelAnimationFrame(d);
87
85
  };
88
- }, [n, s]), [o, f];
86
+ }, [n, s]), [o, m];
89
87
  }
90
- const M = ({ ref: e, callback: t, condition: n = !0 }) => {
91
- const s = g(
88
+ const E = ({ ref: e, callback: r, condition: n = !0 }) => {
89
+ const s = p(
92
90
  (o) => {
93
- e != null && e.current && !e.current.contains(o.target) && t(o);
91
+ e?.current && !e.current.contains(o.target) && r(o);
94
92
  },
95
- [t, e]
93
+ [r, e]
96
94
  );
97
- m(() => (e && n && document && document.addEventListener("click", s), () => {
95
+ f(() => (e && n && document && document.addEventListener("click", s), () => {
98
96
  document && document.removeEventListener("click", s);
99
97
  }), [e, n, s]);
100
- }, p = (() => {
98
+ }, T = (() => {
101
99
  const e = globalThis.IntersectionObserverEntry;
102
100
  return "IntersectionObserver" in globalThis && e && "isIntersecting" in e.prototype;
103
- })(), w = () => {
104
- }, L = (e, t = {}, n = w, s = !0) => {
105
- const [o, a] = x(null), u = g((r) => a(r), [a]), d = c(t), f = c(null);
106
- return m(() => {
107
- if (!p) {
108
- n == null || n();
101
+ })(), b = () => {
102
+ }, B = (e, r = {}, n = b, s = !0) => {
103
+ const [o, i] = l(null), c = p((t) => i(t), [i]), u = a(r), m = a(null);
104
+ return f(() => {
105
+ if (!T) {
106
+ n?.();
109
107
  return;
110
108
  }
111
- let r = f.current;
112
- return r == null || r.disconnect(), o && s && (r = new IntersectionObserver(e, d.current), r.observe(o)), () => {
113
- r == null || r.disconnect();
109
+ let t = m.current;
110
+ return t?.disconnect(), o && s && (t = new IntersectionObserver(e, u.current), t.observe(o)), () => {
111
+ t?.disconnect();
114
112
  };
115
- }, [o, e, n, s]), [u];
116
- }, P = (e = { rootMargin: "150px" }, t = !0) => {
117
- const [n, s] = x(!1), [o] = L(
118
- (a) => {
119
- const u = a.some((d) => d.isIntersecting);
120
- s(u);
113
+ }, [o, e, n, s]), [c];
114
+ }, M = (e = { rootMargin: "150px" }, r = !0) => {
115
+ const [n, s] = l(!1), [o] = B(
116
+ (i) => {
117
+ const c = i.some((u) => u.isIntersecting);
118
+ s(c);
121
119
  },
122
120
  e,
123
121
  void 0,
124
- t
122
+ r
125
123
  );
126
124
  return [o, n];
127
- }, I = () => typeof window < "u" && typeof MutationObserver < "u", R = (e, t, n) => {
128
- const s = c(n);
129
- m(() => {
130
- if (I() && e) {
131
- const o = new MutationObserver(t);
125
+ }, w = () => typeof window < "u" && typeof MutationObserver < "u", P = (e, r, n) => {
126
+ const s = a(n);
127
+ f(() => {
128
+ if (w() && e) {
129
+ const o = new MutationObserver(r);
132
130
  return "current" in e ? e.current && o.observe(e.current, s.current) : o.observe(e, s.current), () => o.disconnect();
133
131
  }
134
- }, [e, t]);
132
+ }, [e, r]);
135
133
  };
136
134
  export {
137
- _ as Accordion,
138
- z as Alert,
139
- mr as BaseLinkButton,
140
- ke as Body,
141
- Ve as Bold,
142
- K as Breadcrumb,
143
- X as BreadcrumbCurrent,
144
- Pe as Checkbox,
145
- rr as CheckmarkListItem,
146
- ne as CircularProgress,
147
- sr as CrossmarkListItem,
148
- Ne as DisplayTitle,
149
- se as Dropdown,
150
- Ce as FieldSet,
135
+ W as Accordion,
136
+ j as Alert,
137
+ dt as BaseLinkButton,
138
+ De as Body,
139
+ Oe as Bold,
140
+ J as Breadcrumb,
141
+ K as BreadcrumbCurrent,
142
+ Me as Checkbox,
143
+ et as CheckmarkListItem,
144
+ re as CircularProgress,
145
+ nt as CrossmarkListItem,
146
+ Ve as DisplayTitle,
147
+ ne as Dropdown,
148
+ Ae as FieldSet,
151
149
  fe as GhostArrowButton,
152
- ae as GhostButton,
153
- ye as GhostIconButton,
154
- k as Gutter,
155
- N as GutterPadding,
156
- $e as H1,
157
- Qe as H2,
158
- We as H3,
159
- _e as H4,
160
- ur as Icons,
161
- qe as Lead,
162
- D as LightMode,
163
- Ze as List,
164
- nr as ListItem,
165
- re as Loader,
166
- Ue as Meta,
167
- Q as NotificationDot,
168
- ar as OrderedListItem,
169
- U as Panel,
170
- De as PasswordTextField,
171
- le as PrimaryArrowButton,
172
- ce as PrimaryButton,
173
- Te as PrimaryIconButton,
174
- Z as Progress,
175
- Se as RadioToggleInput,
176
- C as RiksTVProvider,
177
- xe as SecondaryArrowButton,
178
- ue as SecondaryButton,
179
- ve as SecondaryIconButton,
180
- je as Span,
181
- F as StrimProvider,
182
- ze as SubBody,
183
- Je as SubTitle2,
184
- Ke as SubTitle3,
185
- Xe as Tag,
186
- ge as TertiaryArrowButton,
187
- de as TertiaryButton,
188
- Be as TertiaryIconButton,
189
- Fe as TextField,
190
- we as ToggleButton,
191
- Ie as ToggleInlineButton,
192
- be as ToggleLinkButton,
193
- b as useAnimatedHeight,
194
- B as useBrowserPreferences,
195
- M as useClickOutsideListener,
196
- P as useElementVisible,
197
- L as useIntersectionObserver,
198
- R as useMutationObserver
150
+ ie as GhostButton,
151
+ ge as GhostIconButton,
152
+ D as Gutter,
153
+ V as GutterPadding,
154
+ Ne as H1,
155
+ $e as H2,
156
+ Qe as H3,
157
+ We as H4,
158
+ ct as Icons,
159
+ _e as Lead,
160
+ F as LightMode,
161
+ Ye as List,
162
+ rt as ListItem,
163
+ ee as Loader,
164
+ qe as Meta,
165
+ $ as NotificationDot,
166
+ it as OrderedListItem,
167
+ q as Panel,
168
+ Fe as PasswordTextField,
169
+ me as PrimaryArrowButton,
170
+ ae as PrimaryButton,
171
+ he as PrimaryIconButton,
172
+ Y as Progress,
173
+ Re as RadioToggleInput,
174
+ A as RiksTVProvider,
175
+ le as SecondaryArrowButton,
176
+ ce as SecondaryButton,
177
+ ye as SecondaryIconButton,
178
+ Ue as Span,
179
+ k as StrimProvider,
180
+ je as SubBody,
181
+ ze as SubTitle2,
182
+ Je as SubTitle3,
183
+ Ke as Tag,
184
+ pe as TertiaryArrowButton,
185
+ ue as TertiaryButton,
186
+ ve as TertiaryIconButton,
187
+ ke as TextField,
188
+ be as ToggleButton,
189
+ we as ToggleInlineButton,
190
+ Ie as ToggleLinkButton,
191
+ I as useAnimatedHeight,
192
+ v as useBrowserPreferences,
193
+ E as useClickOutsideListener,
194
+ M as useElementVisible,
195
+ B as useIntersectionObserver,
196
+ P as useMutationObserver
199
197
  };