@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,272 +0,0 @@
1
- import H, { createContext as F, useContext as Y, useMemo as R, useRef as N, useCallback as k, useState as X, useEffect as J } from "react";
2
- import { g as Q, b as Z } from "./i18nInstance-D_96ADqd.js";
3
- const ee = (e, n, r, g) => {
4
- var t, y, O, h;
5
- const s = [r, {
6
- code: n,
7
- ...g || {}
8
- }];
9
- if ((y = (t = e == null ? void 0 : e.services) == null ? void 0 : t.logger) != null && y.forward)
10
- return e.services.logger.forward(s, "warn", "react-i18next::", !0);
11
- w(s[0]) && (s[0] = `react-i18next:: ${s[0]}`), (h = (O = e == null ? void 0 : e.services) == null ? void 0 : O.logger) != null && h.warn ? e.services.logger.warn(...s) : console != null && console.warn && console.warn(...s);
12
- }, P = {}, K = (e, n, r, g) => {
13
- w(r) && P[r] || (w(r) && (P[r] = /* @__PURE__ */ new Date()), ee(e, n, r, g));
14
- }, M = (e, n) => () => {
15
- if (e.isInitialized)
16
- n();
17
- else {
18
- const r = () => {
19
- setTimeout(() => {
20
- e.off("initialized", r);
21
- }, 0), n();
22
- };
23
- e.on("initialized", r);
24
- }
25
- }, j = (e, n, r) => {
26
- e.loadNamespaces(n, M(e, r));
27
- }, V = (e, n, r, g) => {
28
- if (w(r) && (r = [r]), e.options.preload && e.options.preload.indexOf(n) > -1) return j(e, r, g);
29
- r.forEach((s) => {
30
- e.options.ns.indexOf(s) < 0 && e.options.ns.push(s);
31
- }), e.loadLanguages(n, M(e, g));
32
- }, te = (e, n, r = {}) => !n.languages || !n.languages.length ? (K(n, "NO_LANGUAGES", "i18n.languages were undefined or empty", {
33
- languages: n.languages
34
- }), !0) : n.hasLoadedNamespace(e, {
35
- lng: r.lng,
36
- precheck: (g, s) => {
37
- if (r.bindI18n && r.bindI18n.indexOf("languageChanging") > -1 && g.services.backendConnector.backend && g.isLanguageChangingTo && !s(g.isLanguageChangingTo, e)) return !1;
38
- }
39
- }), w = (e) => typeof e == "string", ne = (e) => typeof e == "object" && e !== null, re = F();
40
- class ae {
41
- constructor() {
42
- this.usedNamespaces = {};
43
- }
44
- addUsedNamespaces(n) {
45
- n.forEach((r) => {
46
- this.usedNamespaces[r] || (this.usedNamespaces[r] = !0);
47
- });
48
- }
49
- getUsedNamespaces() {
50
- return Object.keys(this.usedNamespaces);
51
- }
52
- }
53
- var T = { exports: {} }, I = {};
54
- /**
55
- * @license React
56
- * use-sync-external-store-shim.production.js
57
- *
58
- * Copyright (c) Meta Platforms, Inc. and affiliates.
59
- *
60
- * This source code is licensed under the MIT license found in the
61
- * LICENSE file in the root directory of this source tree.
62
- */
63
- var q;
64
- function oe() {
65
- if (q) return I;
66
- q = 1;
67
- var e = H;
68
- function n(u, d) {
69
- return u === d && (u !== 0 || 1 / u === 1 / d) || u !== u && d !== d;
70
- }
71
- var r = typeof Object.is == "function" ? Object.is : n, g = e.useState, s = e.useEffect, t = e.useLayoutEffect, y = e.useDebugValue;
72
- function O(u, d) {
73
- var o = d(), i = g({ inst: { value: o, getSnapshot: d } }), l = i[0].inst, E = i[1];
74
- return t(
75
- function() {
76
- l.value = o, l.getSnapshot = d, h(l) && E({ inst: l });
77
- },
78
- [u, o, d]
79
- ), s(
80
- function() {
81
- return h(l) && E({ inst: l }), u(function() {
82
- h(l) && E({ inst: l });
83
- });
84
- },
85
- [u]
86
- ), y(o), o;
87
- }
88
- function h(u) {
89
- var d = u.getSnapshot;
90
- u = u.value;
91
- try {
92
- var o = d();
93
- return !r(u, o);
94
- } catch {
95
- return !0;
96
- }
97
- }
98
- function _(u, d) {
99
- return d();
100
- }
101
- var v = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? _ : O;
102
- return I.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : v, I;
103
- }
104
- var A = {};
105
- /**
106
- * @license React
107
- * use-sync-external-store-shim.development.js
108
- *
109
- * Copyright (c) Meta Platforms, Inc. and affiliates.
110
- *
111
- * This source code is licensed under the MIT license found in the
112
- * LICENSE file in the root directory of this source tree.
113
- */
114
- var z;
115
- function se() {
116
- return z || (z = 1, process.env.NODE_ENV !== "production" && function() {
117
- function e(o, i) {
118
- return o === i && (o !== 0 || 1 / o === 1 / i) || o !== o && i !== i;
119
- }
120
- function n(o, i) {
121
- v || s.startTransition === void 0 || (v = !0, console.error(
122
- "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."
123
- ));
124
- var l = i();
125
- if (!u) {
126
- var E = i();
127
- t(l, E) || (console.error(
128
- "The result of getSnapshot should be cached to avoid an infinite loop"
129
- ), u = !0);
130
- }
131
- E = y({
132
- inst: { value: l, getSnapshot: i }
133
- });
134
- var S = E[0].inst, m = E[1];
135
- return h(
136
- function() {
137
- S.value = l, S.getSnapshot = i, r(S) && m({ inst: S });
138
- },
139
- [o, l, i]
140
- ), O(
141
- function() {
142
- return r(S) && m({ inst: S }), o(function() {
143
- r(S) && m({ inst: S });
144
- });
145
- },
146
- [o]
147
- ), _(l), l;
148
- }
149
- function r(o) {
150
- var i = o.getSnapshot;
151
- o = o.value;
152
- try {
153
- var l = i();
154
- return !t(o, l);
155
- } catch {
156
- return !0;
157
- }
158
- }
159
- function g(o, i) {
160
- return i();
161
- }
162
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
163
- var s = H, t = typeof Object.is == "function" ? Object.is : e, y = s.useState, O = s.useEffect, h = s.useLayoutEffect, _ = s.useDebugValue, v = !1, u = !1, d = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? g : n;
164
- A.useSyncExternalStore = s.useSyncExternalStore !== void 0 ? s.useSyncExternalStore : d, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
165
- }()), A;
166
- }
167
- var B;
168
- function ce() {
169
- return B || (B = 1, process.env.NODE_ENV === "production" ? T.exports = oe() : T.exports = se()), T.exports;
170
- }
171
- var ue = ce();
172
- const ie = (e, n) => w(n) ? n : ne(n) && w(n.defaultValue) ? n.defaultValue : Array.isArray(e) ? e[e.length - 1] : e, le = {
173
- t: ie,
174
- ready: !1
175
- }, fe = () => () => {
176
- }, ge = (e, n = {}) => {
177
- var x, D;
178
- const {
179
- i18n: r
180
- } = n, {
181
- i18n: g,
182
- defaultNS: s
183
- } = Y(re) || {}, t = r || g || Q();
184
- t && !t.reportNamespaces && (t.reportNamespaces = new ae()), t || K(t, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
185
- const y = R(() => {
186
- var a;
187
- return {
188
- ...Z(),
189
- ...(a = t == null ? void 0 : t.options) == null ? void 0 : a.react,
190
- ...n
191
- };
192
- }, [t, n]), {
193
- useSuspense: O,
194
- keyPrefix: h
195
- } = y, _ = R(() => {
196
- var c;
197
- const a = s || ((c = t == null ? void 0 : t.options) == null ? void 0 : c.defaultNS);
198
- return w(a) ? [a] : a || ["translation"];
199
- }, [e, s, t]);
200
- (D = (x = t == null ? void 0 : t.reportNamespaces) == null ? void 0 : x.addUsedNamespaces) == null || D.call(x, _);
201
- const v = N(0), u = k((a) => {
202
- if (!t) return fe;
203
- const {
204
- bindI18n: c,
205
- bindI18nStore: f
206
- } = y, p = () => {
207
- v.current += 1, a();
208
- };
209
- return c && t.on(c, p), f && t.store.on(f, p), () => {
210
- c && c.split(" ").forEach((b) => t.off(b, p)), f && f.split(" ").forEach((b) => t.store.off(b, p));
211
- };
212
- }, [t, y]), d = N(), o = k(() => {
213
- if (!t)
214
- return le;
215
- const a = !!(t.isInitialized || t.initializedStoreOnce) && _.every(($) => te($, t, y)), c = n.lng || t.language, f = v.current, p = d.current;
216
- if (p && p.ready === a && p.lng === c && p.keyPrefix === h && p.revision === f)
217
- return p;
218
- const G = {
219
- t: t.getFixedT(c, y.nsMode === "fallback" ? _ : _[0], h),
220
- ready: a,
221
- lng: c,
222
- keyPrefix: h,
223
- revision: f
224
- };
225
- return d.current = G, G;
226
- }, [t, _, h, y, n.lng]), [i, l] = X(0), {
227
- t: E,
228
- ready: S
229
- } = ue.useSyncExternalStore(u, o, o);
230
- J(() => {
231
- if (t && !S && !O) {
232
- const a = () => l((c) => c + 1);
233
- n.lng ? V(t, n.lng, _, a) : j(t, _, a);
234
- }
235
- }, [t, n.lng, _, S, O, i]);
236
- const m = t || {}, L = N(null), C = N(), U = (a) => {
237
- const c = Object.getOwnPropertyDescriptors(a);
238
- c.__original && delete c.__original;
239
- const f = Object.create(Object.getPrototypeOf(a), c);
240
- if (!Object.prototype.hasOwnProperty.call(f, "__original"))
241
- try {
242
- Object.defineProperty(f, "__original", {
243
- value: a,
244
- writable: !1,
245
- enumerable: !1,
246
- configurable: !1
247
- });
248
- } catch {
249
- }
250
- return f;
251
- }, W = R(() => {
252
- const a = m, c = a == null ? void 0 : a.language;
253
- let f = a;
254
- a && (L.current && L.current.__original === a ? C.current !== c ? (f = U(a), L.current = f, C.current = c) : f = L.current : (f = U(a), L.current = f, C.current = c));
255
- const p = [E, f, S];
256
- return p.t = E, p.i18n = f, p.ready = S, p;
257
- }, [E, m, S, m.resolvedLanguage, m.language, m.languages]);
258
- if (t && O && !S)
259
- throw new Promise((a) => {
260
- const c = () => a();
261
- n.lng ? V(t, n.lng, _, c) : j(t, _, c);
262
- });
263
- return W;
264
- };
265
- export {
266
- re as I,
267
- ee as a,
268
- ne as b,
269
- w as i,
270
- ge as u,
271
- K as w
272
- };