@ogcio/design-system-react 1.26.0 → 1.28.0

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.
Files changed (34) hide show
  1. package/README.md +27 -11
  2. package/dist/autocomplete/use-autocomplete-controller.js +1 -1
  3. package/dist/browser-support/browser-support.js +1 -1
  4. package/dist/character-count/character-count.d.ts +6 -0
  5. package/dist/character-count/character-count.js +23 -0
  6. package/dist/character-count/types.d.ts +10 -0
  7. package/dist/character-count/types.js +1 -0
  8. package/dist/data-table/editable-table-cell.js +1 -1
  9. package/dist/forms/form-field/form-field.js +1 -1
  10. package/dist/forms/form-field-with-tag/form-field-with-tag.js +1 -1
  11. package/dist/header/header-next/components/menu/components/header-menu-item-button.js +1 -1
  12. package/dist/header/header-next/components/menu/components/header-menu-item-link.js +1 -1
  13. package/dist/hooks/use-focus-trap.js +574 -416
  14. package/dist/i18n/config.js +2 -2
  15. package/dist/i18n/utility.js +1 -1
  16. package/dist/{i18nInstance-D_96ADqd.js → i18nInstance-AYICsHJu.js} +8 -6
  17. package/dist/{i18next-B_GQfCrJ.js → i18next-Bfi2-LyH.js} +125 -117
  18. package/dist/index-D_wwt4P0.js +87 -0
  19. package/dist/index.d.ts +7 -1
  20. package/dist/index.js +232 -229
  21. package/dist/link/link.js +33 -33
  22. package/dist/load-symbols/load-symbols.d.ts +7 -0
  23. package/dist/{load-fonts/load-fonts.js → load-symbols/load-symbols.js} +7 -13
  24. package/dist/{lodash-LsP9-6SV.js → lodash-82PmXrjJ.js} +16 -16
  25. package/dist/pagination/pagination.js +249 -221
  26. package/dist/primitives/anchor.js +1 -1
  27. package/dist/styles.css +1 -1
  28. package/dist/textarea/textarea.d.ts +6 -0
  29. package/dist/textarea/textarea.js +33 -33
  30. package/dist/useTranslation-DiBQuy8S.js +268 -0
  31. package/package.json +2 -2
  32. package/dist/index-2sRBqKFV.js +0 -78
  33. package/dist/load-fonts/load-fonts.d.ts +0 -40
  34. package/dist/useTranslation-BmIU4GBA.js +0 -272
@@ -1,17 +1,17 @@
1
1
  "use client";
2
- import { jsxs as D, jsx as V } from "react/jsx-runtime";
3
- import Z, { createElement as I, isValidElement as W, cloneElement as ee, Children as oe, Fragment as le, useContext as ce, useState as ue, useEffect as pe } from "react";
4
- import { Button as M } from "../button/button.js";
5
- import { useBreakpoint as fe, Breakpoint as Y } from "../hooks/use-breakpoint.js";
6
- import { Icon as G } from "../icon/icon.js";
7
- import { getDisplayPages as Q } from "../utils/utilities.js";
8
- import { w as te, i as z, a as q, b as S, I as me, u as de } from "../useTranslation-BmIU4GBA.js";
9
- import { k as he } from "../i18next-B_GQfCrJ.js";
10
- import { g as ge } from "../_commonjsHelpers-DaMA6jEr.js";
11
- import { g as ne, b as ye } from "../i18nInstance-D_96ADqd.js";
12
- var J, K;
13
- function be() {
14
- return K || (K = 1, J = {
2
+ import { jsxs as R, jsx as j } from "react/jsx-runtime";
3
+ import J, { createElement as z, isValidElement as D, cloneElement as K, Children as de, Fragment as he, useContext as ge, useState as ye, useEffect as ve } from "react";
4
+ import { Button as U } from "../button/button.js";
5
+ import { useBreakpoint as be, Breakpoint as re } from "../hooks/use-breakpoint.js";
6
+ import { Icon as X } from "../icon/icon.js";
7
+ import { getDisplayPages as se } from "../utils/utilities.js";
8
+ import { w as oe, i as L, a as Y, b as _, I as Ne, u as xe } from "../useTranslation-DiBQuy8S.js";
9
+ import { k as Ae } from "../i18next-Bfi2-LyH.js";
10
+ import { g as Ee } from "../_commonjsHelpers-DaMA6jEr.js";
11
+ import { g as le, b as ce, u as $e } from "../i18nInstance-AYICsHJu.js";
12
+ var Q, ae;
13
+ function Te() {
14
+ return ae || (ae = 1, Q = {
15
15
  area: !0,
16
16
  base: !0,
17
17
  br: !0,
@@ -26,273 +26,288 @@ function be() {
26
26
  source: !0,
27
27
  track: !0,
28
28
  wbr: !0
29
- }), J;
29
+ }), Q;
30
30
  }
31
- var ve = be();
32
- const xe = /* @__PURE__ */ ge(ve);
33
- var Ne = /\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;
34
- function P(e) {
31
+ var Ce = Te();
32
+ const ke = /* @__PURE__ */ Ee(Ce);
33
+ var Oe = /\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;
34
+ function ie(e) {
35
35
  var t = { type: "tag", name: "", voidElement: !1, attrs: {}, children: [] }, n = e.match(/<\/?([^\s]+?)[/\s>]/);
36
- if (n && (t.name = n[1], (xe[n[1]] || e.charAt(e.length - 2) === "/") && (t.voidElement = !0), t.name.startsWith("!--"))) {
36
+ if (n && (t.name = n[1], (ke[n[1]] || e.charAt(e.length - 2) === "/") && (t.voidElement = !0), t.name.startsWith("!--"))) {
37
37
  var r = e.indexOf("-->");
38
38
  return { type: "comment", comment: r !== -1 ? e.slice(4, r) : "" };
39
39
  }
40
- for (var a = new RegExp(Ne), s = null; (s = a.exec(e)) !== null; ) if (s[0].trim()) if (s[1]) {
40
+ for (var a = new RegExp(Oe), s = null; (s = a.exec(e)) !== null; ) if (s[0].trim()) if (s[1]) {
41
41
  var o = s[1].trim(), c = [o, ""];
42
42
  o.indexOf("=") > -1 && (c = o.split("=")), t.attrs[c[0]] = c[1], a.lastIndex--;
43
43
  } else s[2] && (t.attrs[s[2]] = s[3].trim().substring(1, s[3].length - 1));
44
44
  return t;
45
45
  }
46
- var Ae = /<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g, $e = /^\s*$/, Ee = /* @__PURE__ */ Object.create(null);
47
- function re(e, t) {
46
+ var Ve = /<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g, je = /^\s*$/, Ie = /* @__PURE__ */ Object.create(null);
47
+ function ue(e, t) {
48
48
  switch (t.type) {
49
49
  case "text":
50
50
  return e + t.content;
51
51
  case "tag":
52
- return e += "<" + t.name + (t.attrs ? function(n) {
52
+ return e += "<" + t.name + (t.attrs ? (function(n) {
53
53
  var r = [];
54
54
  for (var a in n) r.push(a + '="' + n[a] + '"');
55
55
  return r.length ? " " + r.join(" ") : "";
56
- }(t.attrs) : "") + (t.voidElement ? "/>" : ">"), t.voidElement ? e : e + t.children.reduce(re, "") + "</" + t.name + ">";
56
+ })(t.attrs) : "") + (t.voidElement ? "/>" : ">"), t.voidElement ? e : e + t.children.reduce(ue, "") + "</" + t.name + ">";
57
57
  case "comment":
58
58
  return e + "<!--" + t.comment + "-->";
59
59
  }
60
60
  }
61
- var Te = { parse: function(e, t) {
62
- t || (t = {}), t.components || (t.components = Ee);
61
+ var _e = { parse: function(e, t) {
62
+ t || (t = {}), t.components || (t.components = Ie);
63
63
  var n, r = [], a = [], s = -1, o = !1;
64
64
  if (e.indexOf("<") !== 0) {
65
65
  var c = e.indexOf("<");
66
66
  r.push({ type: "text", content: c === -1 ? e : e.substring(0, c) });
67
67
  }
68
- return e.replace(Ae, function(p, f) {
68
+ return e.replace(Ve, function(f, m) {
69
69
  if (o) {
70
- if (p !== "</" + n.name + ">") return;
70
+ if (f !== "</" + n.name + ">") return;
71
71
  o = !1;
72
72
  }
73
- var u, b = p.charAt(1) !== "/", A = p.startsWith("<!--"), g = f + p.length, l = e.charAt(g);
74
- if (A) {
75
- var T = P(p);
76
- return s < 0 ? (r.push(T), r) : ((u = a[s]).children.push(T), r);
73
+ var p, N = f.charAt(1) !== "/", $ = f.startsWith("<!--"), g = m + f.length, l = e.charAt(g);
74
+ if ($) {
75
+ var T = ie(f);
76
+ return s < 0 ? (r.push(T), r) : ((p = a[s]).children.push(T), r);
77
77
  }
78
- if (b && (s++, (n = P(p)).type === "tag" && t.components[n.name] && (n.type = "component", o = !0), n.voidElement || o || !l || l === "<" || n.children.push({ type: "text", content: e.slice(g, e.indexOf("<", g)) }), s === 0 && r.push(n), (u = a[s - 1]) && u.children.push(n), a[s] = n), (!b || n.voidElement) && (s > -1 && (n.voidElement || n.name === p.slice(2, -1)) && (s--, n = s === -1 ? r : a[s]), !o && l !== "<" && l)) {
79
- u = s === -1 ? r : a[s].children;
80
- var m = e.indexOf("<", g), N = e.slice(g, m === -1 ? void 0 : m);
81
- $e.test(N) && (N = " "), (m > -1 && s + u.length >= 0 || N !== " ") && u.push({ type: "text", content: N });
78
+ if (N && (s++, (n = ie(f)).type === "tag" && t.components[n.name] && (n.type = "component", o = !0), n.voidElement || o || !l || l === "<" || n.children.push({ type: "text", content: e.slice(g, e.indexOf("<", g)) }), s === 0 && r.push(n), (p = a[s - 1]) && p.children.push(n), a[s] = n), (!N || n.voidElement) && (s > -1 && (n.voidElement || n.name === f.slice(2, -1)) && (s--, n = s === -1 ? r : a[s]), !o && l !== "<" && l)) {
79
+ p = s === -1 ? r : a[s].children;
80
+ var h = e.indexOf("<", g), x = e.slice(g, h === -1 ? void 0 : h);
81
+ je.test(x) && (x = " "), (h > -1 && s + p.length >= 0 || x !== " ") && p.push({ type: "text", content: x });
82
82
  }
83
83
  }), r;
84
84
  }, stringify: function(e) {
85
85
  return e.reduce(function(t, n) {
86
- return t + re("", n);
86
+ return t + ue("", n);
87
87
  }, "");
88
88
  } };
89
- const X = (e, t) => {
89
+ const G = (e, t) => {
90
90
  var r;
91
91
  if (!e) return !1;
92
92
  const n = ((r = e.props) == null ? void 0 : r.children) ?? e.children;
93
93
  return t ? n.length > 0 : !!n;
94
- }, U = (e) => {
94
+ }, q = (e) => {
95
95
  var n, r;
96
96
  if (!e) return [];
97
97
  const t = ((n = e.props) == null ? void 0 : n.children) ?? e.children;
98
- return (r = e.props) != null && r.i18nIsDynamicList ? L(t) : t;
99
- }, ke = (e) => Array.isArray(e) && e.every(W), L = (e) => Array.isArray(e) ? e : [e], Ce = (e, t) => {
98
+ return (r = e.props) != null && r.i18nIsDynamicList ? S(t) : t;
99
+ }, Se = (e) => Array.isArray(e) && e.every(D), S = (e) => Array.isArray(e) ? e : [e], Le = (e, t) => {
100
100
  const n = {
101
101
  ...t
102
102
  };
103
103
  return n.props = Object.assign(e.props, t.props), n;
104
- }, se = (e, t, n, r) => {
104
+ }, Fe = (e) => {
105
+ const t = {};
106
+ if (!e) return t;
107
+ const n = (r) => {
108
+ S(r).forEach((s) => {
109
+ L(s) || (G(s) ? n(q(s)) : _(s) && !D(s) && Object.assign(t, s));
110
+ });
111
+ };
112
+ return n(e), t;
113
+ }, pe = (e, t, n, r) => {
105
114
  if (!e) return "";
106
115
  let a = "";
107
- const s = L(e), o = t != null && t.transSupportBasicHtmlNodes ? t.transKeepBasicHtmlNodesFor ?? [] : [];
108
- return s.forEach((c, p) => {
109
- if (z(c)) {
116
+ const s = S(e), o = t != null && t.transSupportBasicHtmlNodes ? t.transKeepBasicHtmlNodesFor ?? [] : [];
117
+ return s.forEach((c, f) => {
118
+ if (L(c)) {
110
119
  a += `${c}`;
111
120
  return;
112
121
  }
113
- if (W(c)) {
122
+ if (D(c)) {
114
123
  const {
115
- props: f,
116
- type: u
117
- } = c, b = Object.keys(f).length, A = o.indexOf(u) > -1, g = f.children;
118
- if (!g && A && !b) {
119
- a += `<${u}/>`;
124
+ props: m,
125
+ type: p
126
+ } = c, N = Object.keys(m).length, $ = o.indexOf(p) > -1, g = m.children;
127
+ if (!g && $ && !N) {
128
+ a += `<${p}/>`;
120
129
  return;
121
130
  }
122
- if (!g && (!A || b) || f.i18nIsDynamicList) {
123
- a += `<${p}></${p}>`;
131
+ if (!g && (!$ || N) || m.i18nIsDynamicList) {
132
+ a += `<${f}></${f}>`;
124
133
  return;
125
134
  }
126
- if (A && b === 1 && z(g)) {
127
- a += `<${u}>${g}</${u}>`;
135
+ if ($ && N === 1 && L(g)) {
136
+ a += `<${p}>${g}</${p}>`;
128
137
  return;
129
138
  }
130
- const l = se(g, t, n, r);
131
- a += `<${p}>${l}</${p}>`;
139
+ const l = pe(g, t, n, r);
140
+ a += `<${f}>${l}</${f}>`;
132
141
  return;
133
142
  }
134
143
  if (c === null) {
135
- q(n, "TRANS_NULL_VALUE", "Passed in a null value as child", {
144
+ Y(n, "TRANS_NULL_VALUE", "Passed in a null value as child", {
136
145
  i18nKey: r
137
146
  });
138
147
  return;
139
148
  }
140
- if (S(c)) {
149
+ if (_(c)) {
141
150
  const {
142
- format: f,
143
- ...u
144
- } = c, b = Object.keys(u);
145
- if (b.length === 1) {
146
- const A = f ? `${b[0]}, ${f}` : b[0];
147
- a += `{{${A}}}`;
151
+ format: m,
152
+ ...p
153
+ } = c, N = Object.keys(p);
154
+ if (N.length === 1) {
155
+ const $ = m ? `${N[0]}, ${m}` : N[0];
156
+ a += `{{${$}}}`;
148
157
  return;
149
158
  }
150
- q(n, "TRANS_INVALID_OBJ", "Invalid child - Object should only have keys {{ value, format }} (format is optional).", {
159
+ Y(n, "TRANS_INVALID_OBJ", "Invalid child - Object should only have keys {{ value, format }} (format is optional).", {
151
160
  i18nKey: r,
152
161
  child: c
153
162
  });
154
163
  return;
155
164
  }
156
- q(n, "TRANS_INVALID_VAR", "Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.", {
165
+ Y(n, "TRANS_INVALID_VAR", "Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.", {
157
166
  i18nKey: r,
158
167
  child: c
159
168
  });
160
169
  }), a;
161
- }, Ve = (e, t = [], n = {}) => {
170
+ }, we = (e, t = [], n = {}) => {
162
171
  if (!e) return e;
163
172
  const r = Object.keys(n), a = [...t, ...r];
164
173
  let s = "", o = 0;
165
174
  for (; o < e.length; )
166
175
  if (e[o] === "<") {
167
176
  let c = !1;
168
- const p = e.slice(o).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9-]*)>/);
169
- if (p) {
170
- const f = p[1];
171
- (/^\d+$/.test(f) || a.includes(f)) && (c = !0, s += p[0], o += p[0].length);
177
+ const f = e.slice(o).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);
178
+ if (f) {
179
+ const m = f[1];
180
+ (/^\d+$/.test(m) || a.includes(m)) && (c = !0, s += f[0], o += f[0].length);
172
181
  }
173
182
  if (!c) {
174
- const f = e.slice(o).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);
175
- if (f) {
176
- const u = f[1];
177
- (/^\d+$/.test(u) || a.includes(u)) && (c = !0, s += f[0], o += f[0].length);
183
+ const m = e.slice(o).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);
184
+ if (m) {
185
+ const p = m[1];
186
+ (/^\d+$/.test(p) || a.includes(p)) && (c = !0, s += m[0], o += m[0].length);
178
187
  }
179
188
  }
180
189
  c || (s += "&lt;", o += 1);
181
190
  } else
182
191
  s += e[o], o += 1;
183
192
  return s;
184
- }, je = (e, t, n, r, a, s, o) => {
193
+ }, ze = (e, t, n, r, a, s, o) => {
185
194
  if (n === "") return [];
186
- const c = a.transKeepBasicHtmlNodesFor || [], p = n && new RegExp(c.map((y) => `<${y}`).join("|")).test(n);
187
- if (!e && !t && !p && !o) return [n];
188
- const f = t ?? {}, u = (y) => {
189
- L(y).forEach((h) => {
190
- z(h) || (X(h) ? u(U(h)) : S(h) && !W(h) && Object.assign(f, h));
195
+ const c = a.transKeepBasicHtmlNodesFor || [], f = n && new RegExp(c.map((u) => `<${u}`).join("|")).test(n);
196
+ if (!e && !t && !f && !o) return [n];
197
+ const m = t ?? {}, p = (u) => {
198
+ S(u).forEach((y) => {
199
+ L(y) || (G(y) ? p(q(y)) : _(y) && !D(y) && Object.assign(m, y));
191
200
  });
192
201
  };
193
- u(e);
194
- const b = Ve(n, c, f), A = Te.parse(`<0>${b}</0>`), g = {
195
- ...f,
202
+ p(e);
203
+ const N = we(n, c, m), $ = _e.parse(`<0>${N}</0>`), g = {
204
+ ...m,
196
205
  ...s
197
- }, l = (y, $, h) => {
206
+ }, l = (u, A, y) => {
198
207
  var d;
199
- const E = U(y), j = m(E, $.children, h);
200
- return ke(E) && j.length === 0 || (d = y.props) != null && d.i18nIsDynamicList ? E : j;
201
- }, T = (y, $, h, E, j) => {
202
- y.dummy ? (y.children = $, h.push(ee(y, {
208
+ const E = q(u), I = h(E, A.children, y);
209
+ return Se(E) && I.length === 0 || (d = u.props) != null && d.i18nIsDynamicList ? E : I;
210
+ }, T = (u, A, y, E, I) => {
211
+ u.dummy ? (u.children = A, y.push(K(u, {
203
212
  key: E
204
- }, j ? void 0 : $))) : h.push(...oe.map([y], (d) => {
205
- const i = {
206
- ...d.props
207
- };
208
- return delete i.i18nIsDynamicList, I(d.type, {
209
- ...i,
213
+ }, I ? void 0 : A))) : y.push(...de.map([u], (d) => {
214
+ const i = "data-i18n-is-dynamic-list", O = {
210
215
  key: E,
211
- ref: d.props.ref ?? d.ref
212
- }, j ? null : $);
216
+ [i]: void 0
217
+ };
218
+ return d && d.props && Object.keys(d.props).forEach((C) => {
219
+ C === "ref" || C === "children" || C === "i18nIsDynamicList" || C === i || (O[C] = d.props[C]);
220
+ }), K(d, O, I ? null : A);
213
221
  }));
214
- }, m = (y, $, h) => {
215
- const E = L(y);
216
- return L($).reduce((d, i, C) => {
217
- var w, F;
218
- const O = ((F = (w = i.children) == null ? void 0 : w[0]) == null ? void 0 : F.content) && r.services.interpolator.interpolate(i.children[0].content, g, r.language);
222
+ }, h = (u, A, y) => {
223
+ const E = S(u);
224
+ return S(A).reduce((d, i, O) => {
225
+ var F, H;
226
+ const C = ((H = (F = i.children) == null ? void 0 : F[0]) == null ? void 0 : H.content) && r.services.interpolator.interpolate(i.children[0].content, g, r.language);
219
227
  if (i.type === "tag") {
220
228
  let k = E[parseInt(i.name, 10)];
221
- !k && t && (k = t[i.name]), h.length === 1 && !k && (k = h[0][i.name]), k || (k = {});
222
- const v = Object.keys(i.attrs).length !== 0 ? Ce({
223
- props: i.attrs
224
- }, k) : k, _ = W(v), B = _ && X(i, !0) && !i.voidElement, R = p && S(v) && v.dummy && !_, H = S(t) && Object.hasOwnProperty.call(t, i.name);
225
- if (z(v)) {
226
- const x = r.services.interpolator.interpolate(v, g, r.language);
227
- d.push(x);
228
- } else if (X(v) || B) {
229
- const x = l(v, i, h);
230
- T(v, x, d, C);
231
- } else if (R) {
232
- const x = m(E, i.children, h);
233
- T(v, x, d, C);
229
+ !k && t && (k = t[i.name]), y.length === 1 && !k && (k = y[0][i.name]), k || (k = {});
230
+ const V = {
231
+ ...i.attrs
232
+ };
233
+ o && Object.keys(V).forEach((b) => {
234
+ const B = V[b];
235
+ L(B) && (V[b] = $e(B));
236
+ });
237
+ const v = Object.keys(V).length !== 0 ? Le({
238
+ props: V
239
+ }, k) : k, w = D(v), M = w && G(i, !0) && !i.voidElement, W = f && _(v) && v.dummy && !w, Z = _(t) && Object.hasOwnProperty.call(t, i.name);
240
+ if (L(v)) {
241
+ const b = r.services.interpolator.interpolate(v, g, r.language);
242
+ d.push(b);
243
+ } else if (G(v) || M) {
244
+ const b = l(v, i, y);
245
+ T(v, b, d, O);
246
+ } else if (W) {
247
+ const b = h(E, i.children, y);
248
+ T(v, b, d, O);
234
249
  } else if (Number.isNaN(parseFloat(i.name)))
235
- if (H) {
236
- const x = l(v, i, h);
237
- T(v, x, d, C, i.voidElement);
250
+ if (Z) {
251
+ const b = l(v, i, y);
252
+ T(v, b, d, O, i.voidElement);
238
253
  } else if (a.transSupportBasicHtmlNodes && c.indexOf(i.name) > -1)
239
254
  if (i.voidElement)
240
- d.push(I(i.name, {
241
- key: `${i.name}-${C}`
255
+ d.push(z(i.name, {
256
+ key: `${i.name}-${O}`
242
257
  }));
243
258
  else {
244
- const x = m(E, i.children, h);
245
- d.push(I(i.name, {
246
- key: `${i.name}-${C}`
247
- }, x));
259
+ const b = h(E, i.children, y);
260
+ d.push(z(i.name, {
261
+ key: `${i.name}-${O}`
262
+ }, b));
248
263
  }
249
264
  else if (i.voidElement)
250
265
  d.push(`<${i.name} />`);
251
266
  else {
252
- const x = m(E, i.children, h);
253
- d.push(`<${i.name}>${x}</${i.name}>`);
267
+ const b = h(E, i.children, y);
268
+ d.push(`<${i.name}>${b}</${i.name}>`);
254
269
  }
255
- else if (S(v) && !_) {
256
- const x = i.children[0] ? O : null;
257
- x && d.push(x);
270
+ else if (_(v) && !w) {
271
+ const b = i.children[0] ? C : null;
272
+ b && d.push(b);
258
273
  } else
259
- T(v, O, d, C, i.children.length !== 1 || !O);
274
+ T(v, C, d, O, i.children.length !== 1 || !C);
260
275
  } else if (i.type === "text") {
261
- const k = a.transWrapTextNodes, v = o ? a.unescape(r.services.interpolator.interpolate(i.content, g, r.language)) : r.services.interpolator.interpolate(i.content, g, r.language);
262
- k ? d.push(I(k, {
263
- key: `${i.name}-${C}`
276
+ const k = a.transWrapTextNodes, V = typeof a.unescape == "function" ? a.unescape : ce().unescape, v = o ? V(r.services.interpolator.interpolate(i.content, g, r.language)) : r.services.interpolator.interpolate(i.content, g, r.language);
277
+ k ? d.push(z(k, {
278
+ key: `${i.name}-${O}`
264
279
  }, v)) : d.push(v);
265
280
  }
266
281
  return d;
267
282
  }, []);
268
- }, N = m([{
283
+ }, x = h([{
269
284
  dummy: !0,
270
285
  children: e || []
271
- }], A, L(e || []));
272
- return U(N[0]);
273
- }, ae = (e, t, n) => {
274
- const r = e.key || t, a = ee(e, {
286
+ }], $, S(e || []));
287
+ return q(x[0]);
288
+ }, fe = (e, t, n) => {
289
+ const r = e.key || t, a = K(e, {
275
290
  key: r
276
291
  });
277
292
  if (!a.props || !a.props.children || n.indexOf(`${t}/>`) < 0 && n.indexOf(`${t} />`) < 0)
278
293
  return a;
279
294
  function s() {
280
- return I(le, null, a);
295
+ return z(he, null, a);
281
296
  }
282
- return I(s, {
297
+ return z(s, {
283
298
  key: r
284
299
  });
285
- }, Ie = (e, t) => e.map((n, r) => ae(n, r, t)), Se = (e, t) => {
300
+ }, Be = (e, t) => e.map((n, r) => fe(n, r, t)), Re = (e, t) => {
286
301
  const n = {};
287
302
  return Object.keys(e).forEach((r) => {
288
303
  Object.assign(n, {
289
- [r]: ae(e[r], r, t)
304
+ [r]: fe(e[r], r, t)
290
305
  });
291
306
  }), n;
292
- }, Oe = (e, t, n, r) => e ? Array.isArray(e) ? Ie(e, t) : S(e) ? Se(e, t) : (te(n, "TRANS_INVALID_COMPONENTS", '<Trans /> "components" prop expects an object or array', {
307
+ }, De = (e, t, n, r) => e ? Array.isArray(e) ? Be(e, t) : _(e) ? Re(e, t) : (oe(n, "TRANS_INVALID_COMPONENTS", '<Trans /> "components" prop expects an object or array', {
293
308
  i18nKey: r
294
- }), null) : null, _e = (e) => !S(e) || Array.isArray(e) ? !1 : Object.keys(e).reduce((t, n) => t && Number.isNaN(Number.parseFloat(n)), !0);
295
- function Le({
309
+ }), null) : null, He = (e) => !_(e) || Array.isArray(e) ? !1 : Object.keys(e).reduce((t, n) => t && Number.isNaN(Number.parseFloat(n)), !0);
310
+ function Me({
296
311
  children: e,
297
312
  count: t,
298
313
  parent: n,
@@ -301,58 +316,71 @@ function Le({
301
316
  tOptions: s = {},
302
317
  values: o,
303
318
  defaults: c,
304
- components: p,
305
- ns: f,
306
- i18n: u,
307
- t: b,
308
- shouldUnescape: A,
319
+ components: f,
320
+ ns: m,
321
+ i18n: p,
322
+ t: N,
323
+ shouldUnescape: $,
309
324
  ...g
310
325
  }) {
311
- var v, _, B, R, H, x;
312
- const l = u || ne();
326
+ var b, B, P, ee, te, ne;
327
+ const l = p || le();
313
328
  if (!l)
314
- return te(l, "NO_I18NEXT_INSTANCE", "Trans: You need to pass in an i18next instance using i18nextReactModule", {
329
+ return oe(l, "NO_I18NEXT_INSTANCE", "Trans: You need to pass in an i18next instance using i18nextReactModule", {
315
330
  i18nKey: r
316
331
  }), e;
317
- const T = b || l.t.bind(l) || ((ie) => ie), m = {
318
- ...ye(),
319
- ...(v = l.options) == null ? void 0 : v.react
332
+ const T = N || l.t.bind(l) || ((me) => me), h = {
333
+ ...ce(),
334
+ ...(b = l.options) == null ? void 0 : b.react
320
335
  };
321
- let N = f || T.ns || ((_ = l.options) == null ? void 0 : _.defaultNS);
322
- N = z(N) ? [N] : N || ["translation"];
323
- const y = se(e, m, l, r), $ = c || (s == null ? void 0 : s.defaultValue) || y || m.transEmptyNodeValue || (typeof r == "function" ? he(r) : r), {
324
- hashTransKey: h
325
- } = m, E = r || (h ? h(y || $) : y || $);
326
- (R = (B = l.options) == null ? void 0 : B.interpolation) != null && R.defaultVariables && (o = o && Object.keys(o).length > 0 ? {
327
- ...o,
336
+ let x = m || T.ns || ((B = l.options) == null ? void 0 : B.defaultNS);
337
+ x = L(x) ? [x] : x || ["translation"];
338
+ const {
339
+ transDefaultProps: u
340
+ } = h, A = u != null && u.tOptions ? {
341
+ ...u.tOptions,
342
+ ...s
343
+ } : s, y = $ ?? (u == null ? void 0 : u.shouldUnescape), E = u != null && u.values ? {
344
+ ...u.values,
345
+ ...o
346
+ } : o, I = u != null && u.components ? {
347
+ ...u.components,
348
+ ...f
349
+ } : f, d = pe(e, h, l, r), i = c || (A == null ? void 0 : A.defaultValue) || d || h.transEmptyNodeValue || (typeof r == "function" ? Ae(r) : r), {
350
+ hashTransKey: O
351
+ } = h, C = r || (O ? O(d || i) : d || i);
352
+ (ee = (P = l.options) == null ? void 0 : P.interpolation) != null && ee.defaultVariables ? o = E && Object.keys(E).length > 0 ? {
353
+ ...E,
328
354
  ...l.options.interpolation.defaultVariables
329
355
  } : {
330
356
  ...l.options.interpolation.defaultVariables
331
- });
332
- const j = o || t !== void 0 && !((x = (H = l.options) == null ? void 0 : H.interpolation) != null && x.alwaysFormat) || !e ? s.interpolation : {
357
+ } : o = E;
358
+ const F = Fe(e);
359
+ F && typeof F.count == "number" && t === void 0 && (t = F.count);
360
+ const H = o || t !== void 0 && !((ne = (te = l.options) == null ? void 0 : te.interpolation) != null && ne.alwaysFormat) || !e ? A.interpolation : {
333
361
  interpolation: {
334
- ...s.interpolation,
362
+ ...A.interpolation,
335
363
  prefix: "#$?",
336
364
  suffix: "?$#"
337
365
  }
338
- }, d = {
339
- ...s,
340
- context: a || s.context,
366
+ }, k = {
367
+ ...A,
368
+ context: a || A.context,
341
369
  count: t,
342
370
  ...o,
343
- ...j,
344
- defaultValue: $,
345
- ns: N
371
+ ...H,
372
+ defaultValue: i,
373
+ ns: x
346
374
  };
347
- let i = E ? T(E, d) : $;
348
- i === E && $ && (i = $);
349
- const C = Oe(p, i, l, r);
350
- let O = C || e, w = null;
351
- _e(C) && (w = C, O = e);
352
- const F = je(O, w, i, l, m, d, A), k = n ?? m.defaultTransParent;
353
- return k ? I(k, g, F) : F;
375
+ let V = C ? T(C, k) : i;
376
+ V === C && i && (V = i);
377
+ const v = De(I, V, l, r);
378
+ let w = v || e, M = null;
379
+ He(v) && (M = v, w = e);
380
+ const W = ze(w, M, V, l, h, k, y), Z = n ?? h.defaultTransParent;
381
+ return Z ? z(Z, g, W) : W;
354
382
  }
355
- function we({
383
+ function We({
356
384
  children: e,
357
385
  count: t,
358
386
  parent: n,
@@ -361,19 +389,19 @@ function we({
361
389
  tOptions: s = {},
362
390
  values: o,
363
391
  defaults: c,
364
- components: p,
365
- ns: f,
366
- i18n: u,
367
- t: b,
368
- shouldUnescape: A,
392
+ components: f,
393
+ ns: m,
394
+ i18n: p,
395
+ t: N,
396
+ shouldUnescape: $,
369
397
  ...g
370
398
  }) {
371
- var y;
399
+ var u;
372
400
  const {
373
401
  i18n: l,
374
402
  defaultNS: T
375
- } = ce(me) || {}, m = u || l || ne(), N = b || (m == null ? void 0 : m.t.bind(m));
376
- return Le({
403
+ } = ge(Ne) || {}, h = p || l || le(), x = N || (h == null ? void 0 : h.t.bind(h));
404
+ return Me({
377
405
  children: e,
378
406
  count: t,
379
407
  parent: n,
@@ -382,37 +410,37 @@ function we({
382
410
  tOptions: s,
383
411
  values: o,
384
412
  defaults: c,
385
- components: p,
386
- ns: f || (N == null ? void 0 : N.ns) || T || ((y = m == null ? void 0 : m.options) == null ? void 0 : y.defaultNS),
387
- i18n: m,
388
- t: b,
389
- shouldUnescape: A,
413
+ components: f,
414
+ ns: m || (x == null ? void 0 : x.ns) || T || ((u = h == null ? void 0 : h.options) == null ? void 0 : u.defaultNS),
415
+ i18n: h,
416
+ t: N,
417
+ shouldUnescape: $,
390
418
  ...g
391
419
  });
392
420
  }
393
- const qe = ({
421
+ const et = ({
394
422
  currentPage: e,
395
423
  totalPages: t,
396
424
  onPageChange: n,
397
425
  dataTestid: r
398
426
  }) => {
399
- const { t: a } = de();
427
+ const { t: a } = xe();
400
428
  if (t === 0)
401
429
  return null;
402
- const { breakpoint: s, width: o } = fe(), [c, p] = ue(!1);
403
- pe(() => {
404
- p(!0);
430
+ const { breakpoint: s, width: o } = be(), [c, f] = ye(!1);
431
+ ve(() => {
432
+ f(!0);
405
433
  }, []);
406
- const f = c && s === Y.ExtraSmall, u = c && o !== null && o < 639, b = () => (c && s ? Q(e, t, s) : Q(e, t, Y.Large)).map(
407
- (l, T) => l === -1 || l === -2 ? /* @__PURE__ */ V(Z.Fragment, { children: /* @__PURE__ */ V(
408
- G,
434
+ const m = c && s === re.ExtraSmall, p = c && o !== null && o < 639, N = () => (c && s ? se(e, t, s) : se(e, t, re.Large)).map(
435
+ (l, T) => l === -1 || l === -2 ? /* @__PURE__ */ j(J.Fragment, { children: /* @__PURE__ */ j(
436
+ X,
409
437
  {
410
438
  role: "presentation",
411
439
  className: "gi-text-gray-700",
412
440
  icon: "more_horiz"
413
441
  }
414
- ) }, `ellipsis-${T}`) : /* @__PURE__ */ V(
415
- M,
442
+ ) }, `ellipsis-${T}`) : /* @__PURE__ */ j(
443
+ U,
416
444
  {
417
445
  variant: l === e ? "primary" : "flat",
418
446
  size: "large",
@@ -426,14 +454,14 @@ const qe = ({
426
454
  },
427
455
  l
428
456
  )
429
- ), A = () => /* @__PURE__ */ V("span", { className: "gi-text-md gi-leading-6", "aria-live": "polite", children: /* @__PURE__ */ D(
430
- we,
457
+ ), $ = () => /* @__PURE__ */ j("span", { className: "gi-text-md gi-leading-6", "aria-live": "polite", children: /* @__PURE__ */ R(
458
+ We,
431
459
  {
432
460
  i18nKey: "pagination.page",
433
461
  values: { currentPage: e, totalPages: t },
434
- components: { bold: /* @__PURE__ */ V("span", { className: "gi-font-bold" }) },
462
+ components: { bold: /* @__PURE__ */ j("span", { className: "gi-font-bold" }) },
435
463
  children: [
436
- /* @__PURE__ */ D("span", { className: "gi-font-bold", children: [
464
+ /* @__PURE__ */ R("span", { className: "gi-font-bold", children: [
437
465
  "Page ",
438
466
  e
439
467
  ] }),
@@ -442,7 +470,7 @@ const qe = ({
442
470
  ]
443
471
  }
444
472
  ) });
445
- return /* @__PURE__ */ D(
473
+ return /* @__PURE__ */ R(
446
474
  "div",
447
475
  {
448
476
  className: "gi-pagination",
@@ -454,8 +482,8 @@ const qe = ({
454
482
  }),
455
483
  "data-testid": r,
456
484
  children: [
457
- /* @__PURE__ */ D(
458
- M,
485
+ /* @__PURE__ */ R(
486
+ U,
459
487
  {
460
488
  variant: "flat",
461
489
  size: "large",
@@ -465,17 +493,17 @@ const qe = ({
465
493
  "aria-label": a("pagination.goToPrevious", {
466
494
  defaultValue: "Go to previous"
467
495
  }),
468
- className: u ? "gi-icon-btn-large" : "",
496
+ className: p ? "gi-icon-btn-large" : "",
469
497
  dataTestid: "govie-pagination-prev-btn",
470
498
  children: [
471
- /* @__PURE__ */ V(Z.Fragment, { children: /* @__PURE__ */ V(G, { icon: "arrow_left_alt" }) }, "previous-btn-pagination"),
472
- !u && a("pagination.previous", { defaultValue: "Previous" })
499
+ /* @__PURE__ */ j(J.Fragment, { children: /* @__PURE__ */ j(X, { icon: "arrow_left_alt" }) }, "previous-btn-pagination"),
500
+ !p && a("pagination.previous", { defaultValue: "Previous" })
473
501
  ]
474
502
  }
475
503
  ),
476
- f ? A() : b(),
477
- /* @__PURE__ */ D(
478
- M,
504
+ m ? $() : N(),
505
+ /* @__PURE__ */ R(
506
+ U,
479
507
  {
480
508
  disabled: e === t,
481
509
  variant: "flat",
@@ -483,11 +511,11 @@ const qe = ({
483
511
  appearance: "dark",
484
512
  onClick: () => n(e + 1),
485
513
  "aria-label": a("pagination.goToNext", { defaultValue: "Go to next" }),
486
- className: u ? "gi-icon-btn-large" : "",
514
+ className: p ? "gi-icon-btn-large" : "",
487
515
  dataTestid: "govie-pagination-next-btn",
488
516
  children: [
489
- !u && a("pagination.next", { defaultValue: "Next" }),
490
- /* @__PURE__ */ V(Z.Fragment, { children: /* @__PURE__ */ V(G, { icon: "arrow_right_alt" }) }, "next-btn-pagination")
517
+ !p && a("pagination.next", { defaultValue: "Next" }),
518
+ /* @__PURE__ */ j(J.Fragment, { children: /* @__PURE__ */ j(X, { icon: "arrow_right_alt" }) }, "next-btn-pagination")
491
519
  ]
492
520
  }
493
521
  )
@@ -496,5 +524,5 @@ const qe = ({
496
524
  );
497
525
  };
498
526
  export {
499
- qe as Pagination
527
+ et as Pagination
500
528
  };