@oslokommune/punkt-react 19.16.1 → 19.16.2

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,5 +1,5 @@
1
1
  //#region \0rolldown/runtime.js
2
- var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, i, o, s) => {
2
+ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t, t.exports), e = null), t.exports), s = (e, i, o, s) => {
3
3
  if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
4
4
  get: ((e) => i[e]).bind(null, d),
5
5
  enumerable: !(s = n(i, d)) || s.enumerable
@@ -82,11 +82,7 @@ function p(p) {
82
82
  g,
83
83
  j.length
84
84
  ]), Z = l(() => typeof j == "string" ? j.split(",") : j, [j]), Ae = l((e) => {
85
- if (!_ || M.length !== 1 || !ae(e, M, O, x) || M[0] >= e) {
86
- B(null);
87
- return;
88
- }
89
- B(e), z(c(M[0], e));
85
+ !_ || M.length !== 1 || !ae(e, M, O, x) || M[0] >= e ? B(null) : (B(e), z(c(M[0], e)));
90
86
  }, [
91
87
  _,
92
88
  M,
@@ -237,12 +237,9 @@ function ue(ue, de) {
237
237
  return;
238
238
  }
239
239
  let t = re(e.key, e.shiftKey, b);
240
- if (t && !(e.key === "Tab" && !R)) {
241
- if (t === "focusListbox" && e.key === "Tab" && !j.current?.querySelector("[role=\"option\"]:not([data-disabled]), [data-type=\"new-option\"]")) {
242
- $();
243
- return;
244
- }
245
- switch (e.preventDefault(), t) {
240
+ if (t && (e.key !== "Tab" || R)) {
241
+ if (t === "focusListbox" && e.key === "Tab" && !j.current?.querySelector("[role=\"option\"]:not([data-disabled]), [data-type=\"new-option\"]")) $();
242
+ else switch (e.preventDefault(), t) {
246
243
  case "addValue": {
247
244
  let e = O.current?.value.trim() || "";
248
245
  if (V(e), e && I.includes(e)) {
@@ -276,13 +273,7 @@ function ue(ue, de) {
276
273
  Q,
277
274
  N
278
275
  ]), Tt = m(() => {
279
- if (!E) {
280
- if (lt(!1), K.current) {
281
- K.current = !1, G(!0);
282
- return;
283
- }
284
- !b && I[0] && O.current && O.current.type !== "hidden" && (dt(!0), O.current.value = l(I[0], L, T)), G(!0), V(""), z(!0);
285
- }
276
+ E || (lt(!1), K.current ? (K.current = !1, G(!0)) : (!b && I[0] && O.current && O.current.type !== "hidden" && (dt(!0), O.current.value = l(I[0], L, T)), G(!0), V(""), z(!0)));
286
277
  }, [
287
278
  E,
288
279
  b,
@@ -300,11 +291,8 @@ function ue(ue, de) {
300
291
  R,
301
292
  $
302
293
  ]), Ot = m((e) => {
303
- if (E) {
304
- e.preventDefault(), e.stopPropagation();
305
- return;
306
- }
307
- if (D) O.current?.focus();
294
+ if (E) e.preventDefault(), e.stopPropagation();
295
+ else if (D) O.current?.focus();
308
296
  else {
309
297
  e.stopPropagation(), e.preventDefault();
310
298
  let t = !R;
@@ -58,7 +58,7 @@ var s = null, c = () => s || (s = new Promise((e, t) => {
58
58
  cancelable: !0
59
59
  }));
60
60
  let r = window.cookieBanner, a = window.__cookieEvents;
61
- !r || !a || r.cookieConsent.validateConsentCookie().then((o) => {
61
+ r && a && r.cookieConsent.validateConsentCookie().then((o) => {
62
62
  if (e || !o) return;
63
63
  let s = r.cookieConsent.getConsentCookie();
64
64
  window.clearTimeout(n), n = window.setTimeout(() => {
@@ -41,11 +41,7 @@ var h = /* @__PURE__ */ e(t(), 1), g = a(({ id: e, multiple: t, value: a, onFile
41
41
  g(e.map((e) => new i(e))), D.current && (D.current.value = "");
42
42
  }, [g]), I = (e) => {
43
43
  let t = e.target.files;
44
- if (t.length === 0) {
45
- P(a);
46
- return;
47
- }
48
- F(Array.from(t));
44
+ t.length === 0 ? P(a) : F(Array.from(t));
49
45
  }, L = (e) => {
50
46
  F(e);
51
47
  }, R = (e) => {
@@ -180,11 +180,8 @@ var _ = (e) => {
180
180
  return f(() => {
181
181
  if (!r) return;
182
182
  let e = (e) => {
183
- if (e.key === "Tab") {
184
- i(e, _.current);
185
- return;
186
- }
187
- switch (e.key) {
183
+ if (e.key === "Tab") i(e, _.current);
184
+ else switch (e.key) {
188
185
  case "ArrowLeft":
189
186
  e.preventDefault(), m("prev");
190
187
  break;
@@ -40,7 +40,7 @@ var _ = "pkt-header-global-menu", v = "pkt-header-global-menu-toggle", y = "pkt-
40
40
  se(() => {
41
41
  if (N !== "menu" && N !== "search") return;
42
42
  let e = document.getElementById(N === "menu" ? _ : y), t = Me.current?.getBoundingClientRect();
43
- !e || !t || (e.style.setProperty("--pkt-header-global-top", `${t.top}px`), e.style.setProperty("--pkt-header-global-left", `${t.left}px`), e.style.setProperty("--pkt-header-global-width", `${t.width}px`));
43
+ e && t && (e.style.setProperty("--pkt-header-global-top", `${t.top}px`), e.style.setProperty("--pkt-header-global-left", `${t.left}px`), e.style.setProperty("--pkt-header-global-width", `${t.width}px`));
44
44
  }, [
45
45
  N,
46
46
  z,
@@ -83,7 +83,7 @@ var g = s(({ mobileBreakpoint: e = 768, tabletBreakpoint: n = 1280, children: s,
83
83
  }, [K, G]), Oe = c((e) => {
84
84
  if (!K || R !== "slot") return;
85
85
  let t = e.target.closest("a[href], button, [role=\"link\"], [role=\"button\"], [role=\"menuitem\"], [role=\"menuitemradio\"], [role=\"menuitemcheckbox\"]");
86
- !t || !U.current?.contains(t) || t.closest("[data-pkt-header-keep-open]") || t.disabled || t.getAttribute("aria-disabled") === "true" || z("none");
86
+ t && U.current?.contains(t) && (t.closest("[data-pkt-header-keep-open]") || t.disabled || t.getAttribute("aria-disabled") === "true" || z("none"));
87
87
  }, [K, R]), $ = c((e) => {
88
88
  R === "none" ? (Y(), z(e)) : z("none");
89
89
  }, [R, Y]);
@@ -6,7 +6,7 @@ import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
6
6
  var o = /* @__PURE__ */ e(t(), 1), s = ({ href: e, iconName: t, className: s, iconPosition: c, external: l, target: u, renderLink: d, children: f, ...p }) => {
7
7
  let m = {
8
8
  "pkt-link": !0,
9
- "pkt-link--icon-left": !!t && c === "left" || !!(t && !c),
9
+ "pkt-link--icon-left": !!t && c === "left" || !(!t || c),
10
10
  "pkt-link--icon-right": !!t && c === "right",
11
11
  "pkt-link--external": l
12
12
  }, h = /* @__PURE__ */ a(r, { children: [t && /* @__PURE__ */ i(n, {
@@ -11,18 +11,10 @@ var s = r(({ children: r, active: s, disabled: c = !1, href: l, onClick: u, icon
11
11
  "aria-controls": f,
12
12
  role: _ ? "tab" : void 0,
13
13
  onKeyDown: (e) => {
14
- if (c && (e.key === "Enter" || e.key === " " || e.key === "Spacebar")) {
15
- e.preventDefault(), e.stopPropagation();
16
- return;
17
- }
18
- y(h, e);
14
+ c && (e.key === "Enter" || e.key === " " || e.key === "Spacebar") ? (e.preventDefault(), e.stopPropagation()) : y(h, e);
19
15
  },
20
16
  onClick: (e) => {
21
- if (c) {
22
- e.preventDefault(), e.stopPropagation();
23
- return;
24
- }
25
- b(h), u?.(e);
17
+ c ? (e.preventDefault(), e.stopPropagation()) : (b(h), u?.(e));
26
18
  },
27
19
  tabIndex: c ? -1 : x || !_ ? void 0 : -1,
28
20
  ref: (e) => {
@@ -2,7 +2,7 @@ import e from "../toDate.js";
2
2
  //#region ../../node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
3
3
  function t(t) {
4
4
  let n = e(t), r = new Date(Date.UTC(n.getFullYear(), n.getMonth(), n.getDate(), n.getHours(), n.getMinutes(), n.getSeconds(), n.getMilliseconds()));
5
- return r.setUTCFullYear(n.getFullYear()), t - +r;
5
+ return r.setUTCFullYear(n.getFullYear()), +t - r;
6
6
  }
7
7
  //#endregion
8
8
  export { t as getTimezoneOffsetInMilliseconds };
@@ -1,10 +1,6 @@
1
1
  //#region ../../node_modules/date-fns/constants.js
2
- var e = 365.2425, t = 10 ** 8 * 24 * 60 * 60 * 1e3;
3
- -t;
4
- var n = 6048e5, r = 864e5, i = 3600, a = i * 24;
5
- a * 7;
6
- var o = a * e, s = o / 12;
7
- s * 3;
8
- var c = Symbol.for("constructDateFrom");
2
+ var e = 10 ** 8 * 24 * 60 * 60 * 1e3;
3
+ -e;
4
+ var t = 6048e5, n = 864e5, r = Symbol.for("constructDateFrom");
9
5
  //#endregion
10
- export { c as constructFromSymbol, e as daysInYear, t as maxTime, r as millisecondsInDay, n as millisecondsInWeek, a as secondsInDay, i as secondsInHour, s as secondsInMonth, o as secondsInYear };
6
+ export { r as constructFromSymbol, e as maxTime, n as millisecondsInDay, t as millisecondsInWeek };
@@ -4,7 +4,7 @@ import n from "./startOfISOWeek.js";
4
4
  import r from "./startOfISOWeekYear.js";
5
5
  //#region ../../node_modules/date-fns/getISOWeek.js
6
6
  function i(i, a) {
7
- let o = t(i, a?.in), s = n(o) - +r(o);
7
+ let o = t(i, a?.in), s = +n(o) - r(o);
8
8
  return Math.round(s / e) + 1;
9
9
  }
10
10
  //#endregion
@@ -4,7 +4,7 @@ import n from "./startOfWeek.js";
4
4
  import r from "./startOfWeekYear.js";
5
5
  //#region ../../node_modules/date-fns/getWeek.js
6
6
  function i(i, a) {
7
- let o = t(i, a?.in), s = n(o, a) - +r(o, a);
7
+ let o = t(i, a?.in), s = +n(o, a) - r(o, a);
8
8
  return Math.round(s / e) + 1;
9
9
  }
10
10
  //#endregion