@ogcio/design-system-react 1.22.1 → 1.24.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 (95) hide show
  1. package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
  2. package/dist/accordion/accordion-item.d.ts +3 -5
  3. package/dist/accordion/accordion-item.js +32 -28
  4. package/dist/accordion/accordion.d.ts +3 -5
  5. package/dist/accordion/accordion.js +22 -33
  6. package/dist/alert/alert.js +19 -20
  7. package/dist/autocomplete/autocomplete.js +167 -169
  8. package/dist/autocomplete/use-autocomplete-controller.js +1 -1
  9. package/dist/browser-support/runtime.js +2 -3
  10. package/dist/button/button.js +11 -12
  11. package/dist/button-group/button-group.js +4 -5
  12. package/dist/card/card-next.js +122 -125
  13. package/dist/card/card.js +4 -5
  14. package/dist/checkbox/checkbox-group.js +3 -4
  15. package/dist/checkbox/checkbox.js +4 -5
  16. package/dist/chip/chip.js +11 -12
  17. package/dist/clsx-OuTLNxxd.js +16 -0
  18. package/dist/cn.js +4 -16
  19. package/dist/combo-box/dropdown-item.js +2 -3
  20. package/dist/cookie-banner/cookie-banner.js +6 -7
  21. package/dist/data-table/editable-table-cell.js +3 -4
  22. package/dist/data-table/index.d.ts +7 -0
  23. package/dist/data-table/index.js +20 -0
  24. package/dist/details/details.js +6 -7
  25. package/dist/drawer/drawer.js +18 -19
  26. package/dist/footer/footer.js +2 -3
  27. package/dist/forms/form-field/form-field.js +2 -3
  28. package/dist/header/components/header-menu.js +17 -18
  29. package/dist/header/header-legacy.js +2 -3
  30. package/dist/header/header-next/components/header-logo.js +3 -4
  31. package/dist/header/header-next/components/header-title.js +0 -1
  32. package/dist/header/header-next/components/menu/components/header-menu-item-button.js +4 -5
  33. package/dist/header/header-next/components/menu/components/header-menu-item-link.js +0 -1
  34. package/dist/header/header-next/components/menu/components/header-menu-item-separator.js +4 -5
  35. package/dist/header/header-next/components/menu/components/header-menu-item-slot.js +0 -1
  36. package/dist/header/header-next/components/menu/header-menu-context.js +9 -10
  37. package/dist/header/header-next/components/menu/header-primary-menu.js +4 -5
  38. package/dist/header/header-next/components/menu/header-secondary-menu.js +0 -1
  39. package/dist/header/header-next/header-context.js +4 -5
  40. package/dist/header/header-next/header-next.js +2 -3
  41. package/dist/hooks/use-breakpoint.js +7 -8
  42. package/dist/hooks/use-toggle-map.js +12 -13
  43. package/dist/i18n/config.d.ts +1 -1
  44. package/dist/i18n/config.js +14 -11
  45. package/dist/i18n/utility.js +1 -1
  46. package/dist/i18nInstance-D_96ADqd.js +48 -0
  47. package/dist/i18next-B_GQfCrJ.js +1362 -0
  48. package/dist/icon/icon.d.ts +16 -4
  49. package/dist/icon/icon.js +79 -167
  50. package/dist/icon-button/icon-button.js +4 -5
  51. package/dist/index.d.ts +2 -5
  52. package/dist/index.js +231 -220
  53. package/dist/input-checkbox/input-checkbox.js +15 -16
  54. package/dist/input-checkbox-group/input-checkbox-group.js +9 -10
  55. package/dist/input-password/input-password.js +0 -1
  56. package/dist/input-radio/input-radio.js +11 -12
  57. package/dist/input-radio-group/input-radio-group.js +8 -9
  58. package/dist/input-text/input-text.js +2 -3
  59. package/dist/{lodash-D1c5hFAM.js → lodash-LsP9-6SV.js} +1343 -1342
  60. package/dist/modal/modal.js +4 -5
  61. package/dist/pagination/pagination.js +713 -58
  62. package/dist/phase-banner/phase-banner.js +2 -3
  63. package/dist/popover/popover.js +2 -3
  64. package/dist/radio/radio-group.js +0 -1
  65. package/dist/radio/radio.js +0 -1
  66. package/dist/score-select/score-select.js +3 -4
  67. package/dist/select/select-menu.js +43 -41
  68. package/dist/select/select-next.js +193 -161
  69. package/dist/select/select.js +3 -4
  70. package/dist/side-nav/side-nav.js +9 -10
  71. package/dist/spinner/spinner.js +2 -3
  72. package/dist/stack/stack.js +20 -21
  73. package/dist/styles.css +1 -1
  74. package/dist/summary-list/summary-list-action.js +6 -7
  75. package/dist/summary-list/summary-list-context.js +4 -5
  76. package/dist/summary-list/summary-list-header.js +12 -13
  77. package/dist/summary-list/summary-list-row.js +17 -18
  78. package/dist/summary-list/summary-list-value.js +0 -1
  79. package/dist/summary-list/summary-list.js +4 -5
  80. package/dist/table/table-data.js +11 -12
  81. package/dist/table/table-header.js +2 -3
  82. package/dist/tabs/tab-item.d.ts +1 -1
  83. package/dist/tabs/tab-item.js +0 -1
  84. package/dist/tabs/tab-list.js +23 -24
  85. package/dist/tag/tag.d.ts +9 -3
  86. package/dist/tag/tag.js +35 -18
  87. package/dist/text-input/text-input.js +0 -1
  88. package/dist/textarea/textarea.js +12 -13
  89. package/dist/toast/ds-toast.js +10 -11
  90. package/dist/toast/toast.js +15 -16
  91. package/dist/tooltip/tooltip.js +12 -13
  92. package/dist/utilities.d.ts +4 -1
  93. package/dist/utilities.js +29 -16
  94. package/package.json +6 -5
  95. package/dist/i18next-DxWa09nx.js +0 -1395
@@ -1,98 +1,753 @@
1
1
  "use client";
2
- import "@ogcio/design-system-react/browser-check";
3
- import { jsxs as p, jsx as a } from "react/jsx-runtime";
4
- import d, { useState as V, useEffect as T } from "react";
5
- import { Button as m } from "../button/button.js";
6
- import { useBreakpoint as _, Breakpoint as u } from "../hooks/use-breakpoint.js";
7
- import { translate as t } from "../i18n/utility.js";
8
- import { Icon as c } from "../icon/icon.js";
9
- import { getDisplayPages as g } from "../utils/utilities.js";
10
- const S = ({
11
- currentPage: i,
12
- totalPages: n,
13
- onPageChange: l,
14
- dataTestid: b
2
+ import { jsxs as z, jsx as I } from "react/jsx-runtime";
3
+ import B, { createElement as R, isValidElement as q, cloneElement as me, Children as Oe, Fragment as Te, createContext as Ae, useContext as ge, useMemo as Z, useRef as H, useCallback as ae, useState as he, useEffect as ye } from "react";
4
+ import { Button as K } from "../button/button.js";
5
+ import { useBreakpoint as Le, Breakpoint as se } from "../hooks/use-breakpoint.js";
6
+ import { Icon as X } from "../icon/icon.js";
7
+ import { getDisplayPages as oe } from "../utils/utilities.js";
8
+ import { g as re, b as ve } from "../i18nInstance-D_96ADqd.js";
9
+ import { k as we } from "../i18next-B_GQfCrJ.js";
10
+ import { g as Ce } from "../_commonjsHelpers-DaMA6jEr.js";
11
+ var Y, ie;
12
+ function $e() {
13
+ return ie || (ie = 1, Y = {
14
+ area: !0,
15
+ base: !0,
16
+ br: !0,
17
+ col: !0,
18
+ embed: !0,
19
+ hr: !0,
20
+ img: !0,
21
+ input: !0,
22
+ link: !0,
23
+ meta: !0,
24
+ param: !0,
25
+ source: !0,
26
+ track: !0,
27
+ wbr: !0
28
+ }), Y;
29
+ }
30
+ var ke = $e();
31
+ const Ie = /* @__PURE__ */ Ce(ke);
32
+ var je = /\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;
33
+ function ce(e) {
34
+ var t = { type: "tag", name: "", voidElement: !1, attrs: {}, children: [] }, n = e.match(/<\/?([^\s]+?)[/\s>]/);
35
+ if (n && (t.name = n[1], (Ie[n[1]] || e.charAt(e.length - 2) === "/") && (t.voidElement = !0), t.name.startsWith("!--"))) {
36
+ var a = e.indexOf("-->");
37
+ return { type: "comment", comment: a !== -1 ? e.slice(4, a) : "" };
38
+ }
39
+ for (var s = new RegExp(je), r = null; (r = s.exec(e)) !== null; ) if (r[0].trim()) if (r[1]) {
40
+ var i = r[1].trim(), u = [i, ""];
41
+ i.indexOf("=") > -1 && (u = i.split("=")), t.attrs[u[0]] = u[1], s.lastIndex--;
42
+ } else r[2] && (t.attrs[r[2]] = r[3].trim().substring(1, r[3].length - 1));
43
+ return t;
44
+ }
45
+ var Ve = /<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g, Re = /^\s*$/, De = /* @__PURE__ */ Object.create(null);
46
+ function Se(e, t) {
47
+ switch (t.type) {
48
+ case "text":
49
+ return e + t.content;
50
+ case "tag":
51
+ return e += "<" + t.name + (t.attrs ? function(n) {
52
+ var a = [];
53
+ for (var s in n) a.push(s + '="' + n[s] + '"');
54
+ return a.length ? " " + a.join(" ") : "";
55
+ }(t.attrs) : "") + (t.voidElement ? "/>" : ">"), t.voidElement ? e : e + t.children.reduce(Se, "") + "</" + t.name + ">";
56
+ case "comment":
57
+ return e + "<!--" + t.comment + "-->";
58
+ }
59
+ }
60
+ var ze = { parse: function(e, t) {
61
+ t || (t = {}), t.components || (t.components = De);
62
+ var n, a = [], s = [], r = -1, i = !1;
63
+ if (e.indexOf("<") !== 0) {
64
+ var u = e.indexOf("<");
65
+ a.push({ type: "text", content: u === -1 ? e : e.substring(0, u) });
66
+ }
67
+ return e.replace(Ve, function(d, f) {
68
+ if (i) {
69
+ if (d !== "</" + n.name + ">") return;
70
+ i = !1;
71
+ }
72
+ var h, m = d.charAt(1) !== "/", y = d.startsWith("<!--"), c = f + d.length, o = e.charAt(c);
73
+ if (y) {
74
+ var v = ce(d);
75
+ return r < 0 ? (a.push(v), a) : ((h = s[r]).children.push(v), a);
76
+ }
77
+ if (m && (r++, (n = ce(d)).type === "tag" && t.components[n.name] && (n.type = "component", i = !0), n.voidElement || i || !o || o === "<" || n.children.push({ type: "text", content: e.slice(c, e.indexOf("<", c)) }), r === 0 && a.push(n), (h = s[r - 1]) && h.children.push(n), s[r] = n), (!m || n.voidElement) && (r > -1 && (n.voidElement || n.name === d.slice(2, -1)) && (r--, n = r === -1 ? a : s[r]), !i && o !== "<" && o)) {
78
+ h = r === -1 ? a : s[r].children;
79
+ var g = e.indexOf("<", c), S = e.slice(c, g === -1 ? void 0 : g);
80
+ Re.test(S) && (S = " "), (g > -1 && r + h.length >= 0 || S !== " ") && h.push({ type: "text", content: S });
81
+ }
82
+ }), a;
83
+ }, stringify: function(e) {
84
+ return e.reduce(function(t, n) {
85
+ return t + Se("", n);
86
+ }, "");
87
+ } };
88
+ const M = (e, t, n, a) => {
89
+ var r, i, u, d;
90
+ const s = [n, {
91
+ code: t,
92
+ ...a || {}
93
+ }];
94
+ if ((i = (r = e == null ? void 0 : e.services) == null ? void 0 : r.logger) != null && i.forward)
95
+ return e.services.logger.forward(s, "warn", "react-i18next::", !0);
96
+ $(s[0]) && (s[0] = `react-i18next:: ${s[0]}`), (d = (u = e == null ? void 0 : e.services) == null ? void 0 : u.logger) != null && d.warn ? e.services.logger.warn(...s) : console != null && console.warn && console.warn(...s);
97
+ }, le = {}, P = (e, t, n, a) => {
98
+ $(n) && le[n] || ($(n) && (le[n] = /* @__PURE__ */ new Date()), M(e, t, n, a));
99
+ }, Ee = (e, t) => () => {
100
+ if (e.isInitialized)
101
+ t();
102
+ else {
103
+ const n = () => {
104
+ setTimeout(() => {
105
+ e.off("initialized", n);
106
+ }, 0), t();
107
+ };
108
+ e.on("initialized", n);
109
+ }
110
+ }, ne = (e, t, n) => {
111
+ e.loadNamespaces(t, Ee(e, n));
112
+ }, ue = (e, t, n, a) => {
113
+ if ($(n) && (n = [n]), e.options.preload && e.options.preload.indexOf(t) > -1) return ne(e, n, a);
114
+ n.forEach((s) => {
115
+ e.options.ns.indexOf(s) < 0 && e.options.ns.push(s);
116
+ }), e.loadLanguages(t, Ee(e, a));
117
+ }, Be = (e, t, n = {}) => !t.languages || !t.languages.length ? (P(t, "NO_LANGUAGES", "i18n.languages were undefined or empty", {
118
+ languages: t.languages
119
+ }), !0) : t.hasLoadedNamespace(e, {
120
+ lng: n.lng,
121
+ precheck: (a, s) => {
122
+ if (n.bindI18n && n.bindI18n.indexOf("languageChanging") > -1 && a.services.backendConnector.backend && a.isLanguageChangingTo && !s(a.isLanguageChangingTo, e)) return !1;
123
+ }
124
+ }), $ = (e) => typeof e == "string", V = (e) => typeof e == "object" && e !== null, J = (e, t) => {
125
+ var a;
126
+ if (!e) return !1;
127
+ const n = ((a = e.props) == null ? void 0 : a.children) ?? e.children;
128
+ return t ? n.length > 0 : !!n;
129
+ }, Q = (e) => {
130
+ var n, a;
131
+ if (!e) return [];
132
+ const t = ((n = e.props) == null ? void 0 : n.children) ?? e.children;
133
+ return (a = e.props) != null && a.i18nIsDynamicList ? D(t) : t;
134
+ }, Fe = (e) => Array.isArray(e) && e.every(q), D = (e) => Array.isArray(e) ? e : [e], Ge = (e, t) => {
135
+ const n = {
136
+ ...t
137
+ };
138
+ return n.props = Object.assign(e.props, t.props), n;
139
+ }, be = (e, t, n, a) => {
140
+ if (!e) return "";
141
+ let s = "";
142
+ const r = D(e), i = t != null && t.transSupportBasicHtmlNodes ? t.transKeepBasicHtmlNodesFor ?? [] : [];
143
+ return r.forEach((u, d) => {
144
+ if ($(u)) {
145
+ s += `${u}`;
146
+ return;
147
+ }
148
+ if (q(u)) {
149
+ const {
150
+ props: f,
151
+ type: h
152
+ } = u, m = Object.keys(f).length, y = i.indexOf(h) > -1, c = f.children;
153
+ if (!c && y && !m) {
154
+ s += `<${h}/>`;
155
+ return;
156
+ }
157
+ if (!c && (!y || m) || f.i18nIsDynamicList) {
158
+ s += `<${d}></${d}>`;
159
+ return;
160
+ }
161
+ if (y && m === 1 && $(c)) {
162
+ s += `<${h}>${c}</${h}>`;
163
+ return;
164
+ }
165
+ const o = be(c, t, n, a);
166
+ s += `<${d}>${o}</${d}>`;
167
+ return;
168
+ }
169
+ if (u === null) {
170
+ M(n, "TRANS_NULL_VALUE", "Passed in a null value as child", {
171
+ i18nKey: a
172
+ });
173
+ return;
174
+ }
175
+ if (V(u)) {
176
+ const {
177
+ format: f,
178
+ ...h
179
+ } = u, m = Object.keys(h);
180
+ if (m.length === 1) {
181
+ const y = f ? `${m[0]}, ${f}` : m[0];
182
+ s += `{{${y}}}`;
183
+ return;
184
+ }
185
+ M(n, "TRANS_INVALID_OBJ", "Invalid child - Object should only have keys {{ value, format }} (format is optional).", {
186
+ i18nKey: a,
187
+ child: u
188
+ });
189
+ return;
190
+ }
191
+ M(n, "TRANS_INVALID_VAR", "Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.", {
192
+ i18nKey: a,
193
+ child: u
194
+ });
195
+ }), s;
196
+ }, Ue = (e, t = [], n = {}) => {
197
+ if (!e) return e;
198
+ const a = Object.keys(n), s = [...t, ...a];
199
+ let r = "", i = 0;
200
+ for (; i < e.length; )
201
+ if (e[i] === "<") {
202
+ let u = !1;
203
+ const d = e.slice(i).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9-]*)>/);
204
+ if (d) {
205
+ const f = d[1];
206
+ (/^\d+$/.test(f) || s.includes(f)) && (u = !0, r += d[0], i += d[0].length);
207
+ }
208
+ if (!u) {
209
+ const f = e.slice(i).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);
210
+ if (f) {
211
+ const h = f[1];
212
+ (/^\d+$/.test(h) || s.includes(h)) && (u = !0, r += f[0], i += f[0].length);
213
+ }
214
+ }
215
+ u || (r += "&lt;", i += 1);
216
+ } else
217
+ r += e[i], i += 1;
218
+ return r;
219
+ }, He = (e, t, n, a, s, r, i) => {
220
+ if (n === "") return [];
221
+ const u = s.transKeepBasicHtmlNodesFor || [], d = n && new RegExp(u.map((b) => `<${b}`).join("|")).test(n);
222
+ if (!e && !t && !d && !i) return [n];
223
+ const f = t ?? {}, h = (b) => {
224
+ D(b).forEach((x) => {
225
+ $(x) || (J(x) ? h(Q(x)) : V(x) && !q(x) && Object.assign(f, x));
226
+ });
227
+ };
228
+ h(e);
229
+ const m = Ue(n, u, f), y = ze.parse(`<0>${m}</0>`), c = {
230
+ ...f,
231
+ ...r
232
+ }, o = (b, A, x) => {
233
+ var _;
234
+ const w = Q(b), k = g(w, A.children, x);
235
+ return Fe(w) && k.length === 0 || (_ = b.props) != null && _.i18nIsDynamicList ? w : k;
236
+ }, v = (b, A, x, w, k) => {
237
+ b.dummy ? (b.children = A, x.push(me(b, {
238
+ key: w
239
+ }, k ? void 0 : A))) : x.push(...Oe.map([b], (_) => {
240
+ const l = {
241
+ ..._.props
242
+ };
243
+ return delete l.i18nIsDynamicList, R(_.type, {
244
+ ...l,
245
+ key: w,
246
+ ref: _.props.ref ?? _.ref
247
+ }, k ? null : A);
248
+ }));
249
+ }, g = (b, A, x) => {
250
+ const w = D(b);
251
+ return D(A).reduce((_, l, p) => {
252
+ var N, O;
253
+ const E = ((O = (N = l.children) == null ? void 0 : N[0]) == null ? void 0 : O.content) && a.services.interpolator.interpolate(l.children[0].content, c, a.language);
254
+ if (l.type === "tag") {
255
+ let L = w[parseInt(l.name, 10)];
256
+ !L && t && (L = t[l.name]), x.length === 1 && !L && (L = x[0][l.name]), L || (L = {});
257
+ const T = Object.keys(l.attrs).length !== 0 ? Ge({
258
+ props: l.attrs
259
+ }, L) : L, j = q(T), F = j && J(l, !0) && !l.voidElement, G = d && V(T) && T.dummy && !j, U = V(t) && Object.hasOwnProperty.call(t, l.name);
260
+ if ($(T)) {
261
+ const C = a.services.interpolator.interpolate(T, c, a.language);
262
+ _.push(C);
263
+ } else if (J(T) || F) {
264
+ const C = o(T, l, x);
265
+ v(T, C, _, p);
266
+ } else if (G) {
267
+ const C = g(w, l.children, x);
268
+ v(T, C, _, p);
269
+ } else if (Number.isNaN(parseFloat(l.name)))
270
+ if (U) {
271
+ const C = o(T, l, x);
272
+ v(T, C, _, p, l.voidElement);
273
+ } else if (s.transSupportBasicHtmlNodes && u.indexOf(l.name) > -1)
274
+ if (l.voidElement)
275
+ _.push(R(l.name, {
276
+ key: `${l.name}-${p}`
277
+ }));
278
+ else {
279
+ const C = g(w, l.children, x);
280
+ _.push(R(l.name, {
281
+ key: `${l.name}-${p}`
282
+ }, C));
283
+ }
284
+ else if (l.voidElement)
285
+ _.push(`<${l.name} />`);
286
+ else {
287
+ const C = g(w, l.children, x);
288
+ _.push(`<${l.name}>${C}</${l.name}>`);
289
+ }
290
+ else if (V(T) && !j) {
291
+ const C = l.children[0] ? E : null;
292
+ C && _.push(C);
293
+ } else
294
+ v(T, E, _, p, l.children.length !== 1 || !E);
295
+ } else if (l.type === "text") {
296
+ const L = s.transWrapTextNodes, T = i ? s.unescape(a.services.interpolator.interpolate(l.content, c, a.language)) : a.services.interpolator.interpolate(l.content, c, a.language);
297
+ L ? _.push(R(L, {
298
+ key: `${l.name}-${p}`
299
+ }, T)) : _.push(T);
300
+ }
301
+ return _;
302
+ }, []);
303
+ }, S = g([{
304
+ dummy: !0,
305
+ children: e || []
306
+ }], y, D(e || []));
307
+ return Q(S[0]);
308
+ }, _e = (e, t, n) => {
309
+ const a = e.key || t, s = me(e, {
310
+ key: a
311
+ });
312
+ if (!s.props || !s.props.children || n.indexOf(`${t}/>`) < 0 && n.indexOf(`${t} />`) < 0)
313
+ return s;
314
+ function r() {
315
+ return R(Te, null, s);
316
+ }
317
+ return R(r, {
318
+ key: a
319
+ });
320
+ }, We = (e, t) => e.map((n, a) => _e(n, a, t)), Me = (e, t) => {
321
+ const n = {};
322
+ return Object.keys(e).forEach((a) => {
323
+ Object.assign(n, {
324
+ [a]: _e(e[a], a, t)
325
+ });
326
+ }), n;
327
+ }, qe = (e, t, n, a) => e ? Array.isArray(e) ? We(e, t) : V(e) ? Me(e, t) : (P(n, "TRANS_INVALID_COMPONENTS", '<Trans /> "components" prop expects an object or array', {
328
+ i18nKey: a
329
+ }), null) : null, Pe = (e) => !V(e) || Array.isArray(e) ? !1 : Object.keys(e).reduce((t, n) => t && Number.isNaN(Number.parseFloat(n)), !0);
330
+ function Ze({
331
+ children: e,
332
+ count: t,
333
+ parent: n,
334
+ i18nKey: a,
335
+ context: s,
336
+ tOptions: r = {},
337
+ values: i,
338
+ defaults: u,
339
+ components: d,
340
+ ns: f,
341
+ i18n: h,
342
+ t: m,
343
+ shouldUnescape: y,
344
+ ...c
345
+ }) {
346
+ var T, j, F, G, U, C;
347
+ const o = h || re();
348
+ if (!o)
349
+ return P(o, "NO_I18NEXT_INSTANCE", "Trans: You need to pass in an i18next instance using i18nextReactModule", {
350
+ i18nKey: a
351
+ }), e;
352
+ const v = m || o.t.bind(o) || ((Ne) => Ne), g = {
353
+ ...ve(),
354
+ ...(T = o.options) == null ? void 0 : T.react
355
+ };
356
+ let S = f || v.ns || ((j = o.options) == null ? void 0 : j.defaultNS);
357
+ S = $(S) ? [S] : S || ["translation"];
358
+ const b = be(e, g, o, a), A = u || (r == null ? void 0 : r.defaultValue) || b || g.transEmptyNodeValue || (typeof a == "function" ? we(a) : a), {
359
+ hashTransKey: x
360
+ } = g, w = a || (x ? x(b || A) : b || A);
361
+ (G = (F = o.options) == null ? void 0 : F.interpolation) != null && G.defaultVariables && (i = i && Object.keys(i).length > 0 ? {
362
+ ...i,
363
+ ...o.options.interpolation.defaultVariables
364
+ } : {
365
+ ...o.options.interpolation.defaultVariables
366
+ });
367
+ const k = i || t !== void 0 && !((C = (U = o.options) == null ? void 0 : U.interpolation) != null && C.alwaysFormat) || !e ? r.interpolation : {
368
+ interpolation: {
369
+ ...r.interpolation,
370
+ prefix: "#$?",
371
+ suffix: "?$#"
372
+ }
373
+ }, _ = {
374
+ ...r,
375
+ context: s || r.context,
376
+ count: t,
377
+ ...i,
378
+ ...k,
379
+ defaultValue: A,
380
+ ns: S
381
+ };
382
+ let l = w ? v(w, _) : A;
383
+ l === w && A && (l = A);
384
+ const p = qe(d, l, o, a);
385
+ let E = p || e, N = null;
386
+ Pe(p) && (N = p, E = e);
387
+ const O = He(E, N, l, o, g, _, y), L = n ?? g.defaultTransParent;
388
+ return L ? R(L, c, O) : O;
389
+ }
390
+ const xe = Ae();
391
+ class Ke {
392
+ constructor() {
393
+ this.usedNamespaces = {};
394
+ }
395
+ addUsedNamespaces(t) {
396
+ t.forEach((n) => {
397
+ this.usedNamespaces[n] || (this.usedNamespaces[n] = !0);
398
+ });
399
+ }
400
+ getUsedNamespaces() {
401
+ return Object.keys(this.usedNamespaces);
402
+ }
403
+ }
404
+ function Xe({
405
+ children: e,
406
+ count: t,
407
+ parent: n,
408
+ i18nKey: a,
409
+ context: s,
410
+ tOptions: r = {},
411
+ values: i,
412
+ defaults: u,
413
+ components: d,
414
+ ns: f,
415
+ i18n: h,
416
+ t: m,
417
+ shouldUnescape: y,
418
+ ...c
419
+ }) {
420
+ var b;
421
+ const {
422
+ i18n: o,
423
+ defaultNS: v
424
+ } = ge(xe) || {}, g = h || o || re(), S = m || (g == null ? void 0 : g.t.bind(g));
425
+ return Ze({
426
+ children: e,
427
+ count: t,
428
+ parent: n,
429
+ i18nKey: a,
430
+ context: s,
431
+ tOptions: r,
432
+ values: i,
433
+ defaults: u,
434
+ components: d,
435
+ ns: f || (S == null ? void 0 : S.ns) || v || ((b = g == null ? void 0 : g.options) == null ? void 0 : b.defaultNS),
436
+ i18n: g,
437
+ t: m,
438
+ shouldUnescape: y,
439
+ ...c
440
+ });
441
+ }
442
+ var W = { exports: {} }, ee = {};
443
+ /**
444
+ * @license React
445
+ * use-sync-external-store-shim.production.js
446
+ *
447
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
448
+ *
449
+ * This source code is licensed under the MIT license found in the
450
+ * LICENSE file in the root directory of this source tree.
451
+ */
452
+ var fe;
453
+ function Ye() {
454
+ if (fe) return ee;
455
+ fe = 1;
456
+ var e = B;
457
+ function t(m, y) {
458
+ return m === y && (m !== 0 || 1 / m === 1 / y) || m !== m && y !== y;
459
+ }
460
+ var n = typeof Object.is == "function" ? Object.is : t, a = e.useState, s = e.useEffect, r = e.useLayoutEffect, i = e.useDebugValue;
461
+ function u(m, y) {
462
+ var c = y(), o = a({ inst: { value: c, getSnapshot: y } }), v = o[0].inst, g = o[1];
463
+ return r(
464
+ function() {
465
+ v.value = c, v.getSnapshot = y, d(v) && g({ inst: v });
466
+ },
467
+ [m, c, y]
468
+ ), s(
469
+ function() {
470
+ return d(v) && g({ inst: v }), m(function() {
471
+ d(v) && g({ inst: v });
472
+ });
473
+ },
474
+ [m]
475
+ ), i(c), c;
476
+ }
477
+ function d(m) {
478
+ var y = m.getSnapshot;
479
+ m = m.value;
480
+ try {
481
+ var c = y();
482
+ return !n(m, c);
483
+ } catch {
484
+ return !0;
485
+ }
486
+ }
487
+ function f(m, y) {
488
+ return y();
489
+ }
490
+ var h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? f : u;
491
+ return ee.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : h, ee;
492
+ }
493
+ var te = {};
494
+ /**
495
+ * @license React
496
+ * use-sync-external-store-shim.development.js
497
+ *
498
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
499
+ *
500
+ * This source code is licensed under the MIT license found in the
501
+ * LICENSE file in the root directory of this source tree.
502
+ */
503
+ var pe;
504
+ function Je() {
505
+ return pe || (pe = 1, process.env.NODE_ENV !== "production" && function() {
506
+ function e(c, o) {
507
+ return c === o && (c !== 0 || 1 / c === 1 / o) || c !== c && o !== o;
508
+ }
509
+ function t(c, o) {
510
+ h || s.startTransition === void 0 || (h = !0, console.error(
511
+ "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
512
+ ));
513
+ var v = o();
514
+ if (!m) {
515
+ var g = o();
516
+ r(v, g) || (console.error(
517
+ "The result of getSnapshot should be cached to avoid an infinite loop"
518
+ ), m = !0);
519
+ }
520
+ g = i({
521
+ inst: { value: v, getSnapshot: o }
522
+ });
523
+ var S = g[0].inst, b = g[1];
524
+ return d(
525
+ function() {
526
+ S.value = v, S.getSnapshot = o, n(S) && b({ inst: S });
527
+ },
528
+ [c, v, o]
529
+ ), u(
530
+ function() {
531
+ return n(S) && b({ inst: S }), c(function() {
532
+ n(S) && b({ inst: S });
533
+ });
534
+ },
535
+ [c]
536
+ ), f(v), v;
537
+ }
538
+ function n(c) {
539
+ var o = c.getSnapshot;
540
+ c = c.value;
541
+ try {
542
+ var v = o();
543
+ return !r(c, v);
544
+ } catch {
545
+ return !0;
546
+ }
547
+ }
548
+ function a(c, o) {
549
+ return o();
550
+ }
551
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
552
+ var s = B, r = typeof Object.is == "function" ? Object.is : e, i = s.useState, u = s.useEffect, d = s.useLayoutEffect, f = s.useDebugValue, h = !1, m = !1, y = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? a : t;
553
+ te.useSyncExternalStore = s.useSyncExternalStore !== void 0 ? s.useSyncExternalStore : y, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
554
+ }()), te;
555
+ }
556
+ var de;
557
+ function Qe() {
558
+ return de || (de = 1, process.env.NODE_ENV === "production" ? W.exports = Ye() : W.exports = Je()), W.exports;
559
+ }
560
+ var et = Qe();
561
+ const tt = (e, t) => $(t) ? t : V(t) && $(t.defaultValue) ? t.defaultValue : Array.isArray(e) ? e[e.length - 1] : e, nt = {
562
+ t: tt,
563
+ ready: !1
564
+ }, rt = () => () => {
565
+ }, at = (e, t = {}) => {
566
+ var _, l;
567
+ const {
568
+ i18n: n
569
+ } = t, {
570
+ i18n: a,
571
+ defaultNS: s
572
+ } = ge(xe) || {}, r = n || a || re();
573
+ r && !r.reportNamespaces && (r.reportNamespaces = new Ke()), r || P(r, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
574
+ const i = Z(() => {
575
+ var p;
576
+ return {
577
+ ...ve(),
578
+ ...(p = r == null ? void 0 : r.options) == null ? void 0 : p.react,
579
+ ...t
580
+ };
581
+ }, [r, t]), {
582
+ useSuspense: u,
583
+ keyPrefix: d
584
+ } = i, f = Z(() => {
585
+ var E;
586
+ const p = s || ((E = r == null ? void 0 : r.options) == null ? void 0 : E.defaultNS);
587
+ return $(p) ? [p] : p || ["translation"];
588
+ }, [e, s, r]);
589
+ (l = (_ = r == null ? void 0 : r.reportNamespaces) == null ? void 0 : _.addUsedNamespaces) == null || l.call(_, f);
590
+ const h = H(0), m = ae((p) => {
591
+ if (!r) return rt;
592
+ const {
593
+ bindI18n: E,
594
+ bindI18nStore: N
595
+ } = i, O = () => {
596
+ h.current += 1, p();
597
+ };
598
+ return E && r.on(E, O), N && r.store.on(N, O), () => {
599
+ E && E.split(" ").forEach((L) => r.off(L, O)), N && N.split(" ").forEach((L) => r.store.off(L, O));
600
+ };
601
+ }, [r, i]), y = H(), c = ae(() => {
602
+ if (!r)
603
+ return nt;
604
+ const p = !!(r.isInitialized || r.initializedStoreOnce) && f.every((j) => Be(j, r, i)), E = t.lng || r.language, N = h.current, O = y.current;
605
+ if (O && O.ready === p && O.lng === E && O.keyPrefix === d && O.revision === N)
606
+ return O;
607
+ const T = {
608
+ t: r.getFixedT(E, i.nsMode === "fallback" ? f : f[0], d),
609
+ ready: p,
610
+ lng: E,
611
+ keyPrefix: d,
612
+ revision: N
613
+ };
614
+ return y.current = T, T;
615
+ }, [r, f, d, i, t.lng]), [o, v] = he(0), {
616
+ t: g,
617
+ ready: S
618
+ } = et.useSyncExternalStore(m, c, c);
619
+ ye(() => {
620
+ if (r && !S && !u) {
621
+ const p = () => v((E) => E + 1);
622
+ t.lng ? ue(r, t.lng, f, p) : ne(r, f, p);
623
+ }
624
+ }, [r, t.lng, f, S, u, o]);
625
+ const b = r || {}, A = H(null), x = H(), w = (p) => {
626
+ const E = Object.getOwnPropertyDescriptors(p);
627
+ E.__original && delete E.__original;
628
+ const N = Object.create(Object.getPrototypeOf(p), E);
629
+ if (!Object.prototype.hasOwnProperty.call(N, "__original"))
630
+ try {
631
+ Object.defineProperty(N, "__original", {
632
+ value: p,
633
+ writable: !1,
634
+ enumerable: !1,
635
+ configurable: !1
636
+ });
637
+ } catch {
638
+ }
639
+ return N;
640
+ }, k = Z(() => {
641
+ const p = b, E = p == null ? void 0 : p.language;
642
+ let N = p;
643
+ p && (A.current && A.current.__original === p ? x.current !== E ? (N = w(p), A.current = N, x.current = E) : N = A.current : (N = w(p), A.current = N, x.current = E));
644
+ const O = [g, N, S];
645
+ return O.t = g, O.i18n = N, O.ready = S, O;
646
+ }, [g, b, S, b.resolvedLanguage, b.language, b.languages]);
647
+ if (r && u && !S)
648
+ throw new Promise((p) => {
649
+ const E = () => p();
650
+ t.lng ? ue(r, t.lng, f, E) : ne(r, f, E);
651
+ });
652
+ return k;
653
+ }, mt = ({
654
+ currentPage: e,
655
+ totalPages: t,
656
+ onPageChange: n,
657
+ dataTestid: a
15
658
  }) => {
16
- if (n === 0)
659
+ const { t: s } = at();
660
+ if (t === 0)
17
661
  return null;
18
- const { breakpoint: r, width: f } = _(), [s, v] = V(!1);
19
- T(() => {
20
- v(!0);
662
+ const { breakpoint: r, width: i } = Le(), [u, d] = he(!1);
663
+ ye(() => {
664
+ d(!0);
21
665
  }, []);
22
- const x = s && r === u.ExtraSmall, o = s && f !== null && f < 639, h = () => (s && r ? g(i, n, r) : g(i, n, u.Large)).map(
23
- (e, N) => e === -1 || e === -2 ? /* @__PURE__ */ a(d.Fragment, { children: /* @__PURE__ */ a(
24
- c,
666
+ const f = u && r === se.ExtraSmall, h = u && i !== null && i < 639, m = () => (u && r ? oe(e, t, r) : oe(e, t, se.Large)).map(
667
+ (o, v) => o === -1 || o === -2 ? /* @__PURE__ */ I(B.Fragment, { children: /* @__PURE__ */ I(
668
+ X,
25
669
  {
26
670
  role: "presentation",
27
671
  className: "gi-text-gray-700",
28
672
  icon: "more_horiz"
29
673
  }
30
- ) }, `ellipsis-${N}`) : /* @__PURE__ */ a(
31
- m,
674
+ ) }, `ellipsis-${v}`) : /* @__PURE__ */ I(
675
+ K,
32
676
  {
33
- variant: e === i ? "primary" : "flat",
677
+ variant: o === e ? "primary" : "flat",
34
678
  size: "large",
35
679
  appearance: "dark",
36
- onClick: () => l(e),
37
- "aria-label": t("pagination.goToPage", {
38
- page: e,
39
- defaultValue: `Go to page ${e}`
680
+ onClick: () => n(o),
681
+ "aria-label": s("pagination.goToPage", {
682
+ page: o,
683
+ defaultValue: `Go to page ${o}`
40
684
  }),
41
- children: e
685
+ children: o
42
686
  },
43
- e
687
+ o
44
688
  )
45
- ), k = () => /* @__PURE__ */ a("span", { className: "gi-text-md", "aria-live": "polite", children: /* @__PURE__ */ a("span", { className: "gi-font-bold", children: t("pagination.page", {
46
- currentPage: i,
47
- totalPages: n,
48
- defaultValue: `Page ${i} of ${n}`
49
- }) }) });
50
- return /* @__PURE__ */ p(
689
+ ), y = () => /* @__PURE__ */ I("span", { className: "gi-text-md gi-leading-6", "aria-live": "polite", children: /* @__PURE__ */ z(
690
+ Xe,
691
+ {
692
+ i18nKey: "pagination.page",
693
+ values: { currentPage: e, totalPages: t },
694
+ components: { bold: /* @__PURE__ */ I("span", { className: "gi-font-bold" }) },
695
+ children: [
696
+ /* @__PURE__ */ z("span", { className: "gi-font-bold", children: [
697
+ "Page ",
698
+ e
699
+ ] }),
700
+ " of ",
701
+ t
702
+ ]
703
+ }
704
+ ) });
705
+ return /* @__PURE__ */ z(
51
706
  "div",
52
707
  {
53
708
  className: "gi-pagination",
54
709
  role: "navigation",
55
- "aria-label": t("pagination.page", {
56
- currentPage: i,
57
- totalPages: n,
58
- defaultValue: `Page ${i} of ${n}`
710
+ "aria-label": s("pagination.page", {
711
+ currentPage: e,
712
+ totalPages: t,
713
+ defaultValue: `Page ${e} of ${t}`
59
714
  }),
60
- "data-testid": b,
715
+ "data-testid": a,
61
716
  children: [
62
- /* @__PURE__ */ p(
63
- m,
717
+ /* @__PURE__ */ z(
718
+ K,
64
719
  {
65
720
  variant: "flat",
66
721
  size: "large",
67
722
  appearance: "dark",
68
- disabled: i === 1,
69
- onClick: () => l(i - 1),
70
- "aria-label": t("pagination.goToPrevious", {
723
+ disabled: e === 1,
724
+ onClick: () => n(e - 1),
725
+ "aria-label": s("pagination.goToPrevious", {
71
726
  defaultValue: "Go to previous"
72
727
  }),
73
- className: o ? "gi-icon-btn-large" : "",
728
+ className: h ? "gi-icon-btn-large" : "",
74
729
  dataTestid: "govie-pagination-prev-btn",
75
730
  children: [
76
- /* @__PURE__ */ a(d.Fragment, { children: /* @__PURE__ */ a(c, { icon: "arrow_left_alt" }) }, "previous-btn-pagination"),
77
- !o && t("pagination.previous", { defaultValue: "Previous" })
731
+ /* @__PURE__ */ I(B.Fragment, { children: /* @__PURE__ */ I(X, { icon: "arrow_left_alt" }) }, "previous-btn-pagination"),
732
+ !h && s("pagination.previous", { defaultValue: "Previous" })
78
733
  ]
79
734
  }
80
735
  ),
81
- x ? k() : h(),
82
- /* @__PURE__ */ p(
83
- m,
736
+ f ? y() : m(),
737
+ /* @__PURE__ */ z(
738
+ K,
84
739
  {
85
- disabled: i === n,
740
+ disabled: e === t,
86
741
  variant: "flat",
87
742
  size: "large",
88
743
  appearance: "dark",
89
- onClick: () => l(i + 1),
90
- "aria-label": t("pagination.goToNext", { defaultValue: "Go to next" }),
91
- className: o ? "gi-icon-btn-large" : "",
744
+ onClick: () => n(e + 1),
745
+ "aria-label": s("pagination.goToNext", { defaultValue: "Go to next" }),
746
+ className: h ? "gi-icon-btn-large" : "",
92
747
  dataTestid: "govie-pagination-next-btn",
93
748
  children: [
94
- !o && t("pagination.next", { defaultValue: "Next" }),
95
- /* @__PURE__ */ a(d.Fragment, { children: /* @__PURE__ */ a(c, { icon: "arrow_right_alt" }) }, "next-btn-pagination")
749
+ !h && s("pagination.next", { defaultValue: "Next" }),
750
+ /* @__PURE__ */ I(B.Fragment, { children: /* @__PURE__ */ I(X, { icon: "arrow_right_alt" }) }, "next-btn-pagination")
96
751
  ]
97
752
  }
98
753
  )
@@ -101,5 +756,5 @@ const S = ({
101
756
  );
102
757
  };
103
758
  export {
104
- S as Pagination
759
+ mt as Pagination
105
760
  };