@oslokommune/punkt-react 20.0.3 → 20.0.5
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.
- package/CHANGELOG.md +5 -0
- package/dist/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/defineProperty.js +1 -2
- package/dist/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/toPrimitive.js +1 -2
- package/dist/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/toPropertyKey.js +1 -2
- package/dist/_virtual/{_@oxc-project_runtime@0.154.0 → _@oxc-project_runtime@0.156.0}/helpers/esm/typeof.js +1 -2
- package/dist/_virtual/_rolldown/runtime.js +1 -2
- package/dist/components/accordion/Accordion.js +1 -2
- package/dist/components/accordion/AccordionItem.js +9 -10
- package/dist/components/alert/Alert.js +7 -8
- package/dist/components/backlink/BackLink.js +1 -2
- package/dist/components/breadcrumbs/Breadcrumbs.js +1 -2
- package/dist/components/button/Button.js +1 -2
- package/dist/components/calendar/Calendar.js +1 -2
- package/dist/components/calendar/CalendarGrid.js +1 -2
- package/dist/components/calendar/CalendarNav.js +5 -6
- package/dist/components/calendar/calendar-utils.js +1 -2
- package/dist/components/calendar/useCalendarState.js +90 -91
- package/dist/components/card/Card.js +14 -15
- package/dist/components/checkbox/Checkbox.js +3 -8
- package/dist/components/checkboxgroup/CheckboxGroup.js +10 -11
- package/dist/components/checkboxgroup/CheckboxGroupContext.js +1 -2
- package/dist/components/combobox/Combobox.js +5 -6
- package/dist/components/combobox/ComboboxInput.js +6 -7
- package/dist/components/combobox/ComboboxTags.js +11 -12
- package/dist/components/combobox/Listbox.js +25 -26
- package/dist/components/combobox/useComboboxState.js +38 -39
- package/dist/components/consent/Consent.js +6 -7
- package/dist/components/datepicker/DateTags.js +14 -15
- package/dist/components/datepicker/Datepicker.js +1 -2
- package/dist/components/datepicker/DatepickerInputs.js +1 -2
- package/dist/components/datepicker/DatepickerPopup.js +5 -6
- package/dist/components/datepicker/useDatepickerState.js +20 -21
- package/dist/components/fileupload/DropZone.js +6 -7
- package/dist/components/fileupload/FileUpload.js +36 -37
- package/dist/components/fileupload/FileUploadContext.js +1 -2
- package/dist/components/fileupload/QueueDisplay.js +12 -13
- package/dist/components/fileupload/QueueItemContent.js +14 -15
- package/dist/components/fileupload/Subcomponents.js +70 -71
- package/dist/components/fileupload/Truncate.js +1 -2
- package/dist/components/fileupload/extensions/Comments.js +21 -22
- package/dist/components/fileupload/extensions/Remove.js +1 -2
- package/dist/components/fileupload/extensions/Rename.js +8 -9
- package/dist/components/fileupload/hooks/useFileAttributes.js +1 -2
- package/dist/components/fileupload/hooks/useImageObjectUrl.js +1 -2
- package/dist/components/fileupload/hooks/useImagePreview.js +1 -2
- package/dist/components/fileupload/hooks/useOperationState.js +1 -2
- package/dist/components/fileupload/hooks/useRequiredFormValidation.js +1 -2
- package/dist/components/fileupload/types.js +4 -5
- package/dist/components/footer/Footer.js +23 -24
- package/dist/components/footer/FooterGlobal.js +24 -25
- package/dist/components/footerSimple/FooterSimple.js +5 -6
- package/dist/components/header/Header.js +1 -2
- package/dist/components/header/HeaderGlobal.js +127 -128
- package/dist/components/header/HeaderService.js +84 -85
- package/dist/components/header-menu/HeaderMenu.js +34 -35
- package/dist/components/headerUserMenu/UserMenu.js +14 -15
- package/dist/components/heading/Heading.js +1 -2
- package/dist/components/helptext/Helptext.js +5 -6
- package/dist/components/icon/Icon.js +2 -3
- package/dist/components/input/Input.js +1 -2
- package/dist/components/inputwrapper/InputWrapper.js +12 -17
- package/dist/components/link/Link.js +1 -2
- package/dist/components/linkcard/LinkCard.js +2 -3
- package/dist/components/loader/Loader.js +2 -3
- package/dist/components/messagebox/Messagebox.js +6 -7
- package/dist/components/modal/Modal.js +13 -14
- package/dist/components/progressbar/Progressbar.js +5 -6
- package/dist/components/radio/RadioButton.js +3 -8
- package/dist/components/radiogroup/RadioGroup.js +1 -2
- package/dist/components/radiogroup/RadioGroupContext.js +1 -2
- package/dist/components/searchinput/SearchInput.js +11 -12
- package/dist/components/select/Select.js +6 -7
- package/dist/components/stepper/Step.js +1 -2
- package/dist/components/stepper/Stepper.js +1 -2
- package/dist/components/strings/PktStringsProvider.js +1 -2
- package/dist/components/table/Table.js +2 -3
- package/dist/components/table/TableBody.js +1 -2
- package/dist/components/table/TableDataCell.js +1 -2
- package/dist/components/table/TableHeader.js +1 -2
- package/dist/components/table/TableHeaderCell.js +1 -2
- package/dist/components/table/TableRow.js +1 -2
- package/dist/components/tabs/TabItem.js +1 -2
- package/dist/components/tabs/Tabs.js +5 -6
- package/dist/components/tag/Tag.js +6 -7
- package/dist/components/textarea/Textarea.js +5 -6
- package/dist/components/textinput/Textinput.js +6 -7
- package/dist/components/timepicker/Timepicker.js +6 -7
- package/dist/components/timepicker/useTimepickerState.js +27 -28
- package/dist/hooks/useElementWidth.js +1 -2
- package/dist/hooks/useFocusModality.js +1 -2
- package/dist/hooks/useGeneratedId.js +1 -2
- package/dist/hooks/useHeaderChrome.js +1 -2
- package/dist/hooks/useOptionGroupField.js +1 -2
- package/dist/hooks/useOwnerForm.js +1 -2
- package/dist/hooks/usePktStrings.js +1 -2
- package/dist/hooks/useScrollLock.js +1 -2
- package/dist/node_modules/@date-fns/tz/date/index.js +1 -2
- package/dist/node_modules/@date-fns/tz/date/mini.js +1 -2
- package/dist/node_modules/@date-fns/tz/index.js +3 -3
- package/dist/node_modules/@date-fns/tz/tzName/index.js +1 -2
- package/dist/node_modules/@date-fns/tz/tzOffset/index.js +1 -2
- package/dist/node_modules/classnames/index.js +1 -2
- package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +1 -2
- package/dist/node_modules/date-fns/_lib/defaultOptions.js +1 -2
- package/dist/node_modules/date-fns/_lib/format/formatters.js +18 -19
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +1 -2
- package/dist/node_modules/date-fns/_lib/format/longFormatters.js +1 -2
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +1 -2
- package/dist/node_modules/date-fns/_lib/normalizeDates.js +1 -2
- package/dist/node_modules/date-fns/_lib/normalizeInterval.js +1 -2
- package/dist/node_modules/date-fns/_lib/protectedTokens.js +1 -2
- package/dist/node_modules/date-fns/addDays.js +1 -2
- package/dist/node_modules/date-fns/constants.js +1 -2
- package/dist/node_modules/date-fns/constructFrom.js +1 -2
- package/dist/node_modules/date-fns/differenceInCalendarDays.js +6 -7
- package/dist/node_modules/date-fns/eachDayOfInterval.js +5 -6
- package/dist/node_modules/date-fns/endOfDay.js +1 -2
- package/dist/node_modules/date-fns/format.js +15 -16
- package/dist/node_modules/date-fns/getDayOfYear.js +6 -7
- package/dist/node_modules/date-fns/getISODay.js +1 -2
- package/dist/node_modules/date-fns/getISOWeek.js +5 -6
- package/dist/node_modules/date-fns/getISOWeekYear.js +6 -7
- package/dist/node_modules/date-fns/getWeek.js +5 -6
- package/dist/node_modules/date-fns/getWeekYear.js +8 -9
- package/dist/node_modules/date-fns/isDate.js +1 -2
- package/dist/node_modules/date-fns/isValid.js +4 -5
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +1 -2
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +1 -2
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +1 -2
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +1 -2
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +1 -2
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +0 -1
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +1 -2
- package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +0 -1
- package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +0 -1
- package/dist/node_modules/date-fns/locale/en-US.js +1 -2
- package/dist/node_modules/date-fns/startOfDay.js +1 -2
- package/dist/node_modules/date-fns/startOfISOWeek.js +1 -2
- package/dist/node_modules/date-fns/startOfISOWeekYear.js +5 -6
- package/dist/node_modules/date-fns/startOfWeek.js +4 -5
- package/dist/node_modules/date-fns/startOfWeekYear.js +7 -8
- package/dist/node_modules/date-fns/startOfYear.js +1 -2
- package/dist/node_modules/date-fns/toDate.js +1 -2
- package/dist/punkt-react.cjs +1 -1
- package/dist/shared-strings/consent.js +1 -2
- package/dist/shared-strings/format.js +1 -2
- package/dist/shared-strings/nb.js +1 -2
- package/dist/shared-strings/resolve.js +1 -2
- package/dist/shared-strings/store.js +1 -2
- package/dist/shared-types/accordion.js +1 -2
- package/dist/shared-types/calendar.js +1 -2
- package/dist/shared-types/card.js +1 -2
- package/dist/shared-types/checkbox.js +1 -2
- package/dist/shared-types/combobox.js +1 -2
- package/dist/shared-types/consent.js +1 -2
- package/dist/shared-types/footer.js +1 -2
- package/dist/shared-types/header-footer.js +1 -2
- package/dist/shared-types/icon.js +1 -2
- package/dist/shared-types/input-wrapper.js +1 -2
- package/dist/shared-types/linkcard.js +1 -2
- package/dist/shared-types/loader.js +1 -2
- package/dist/shared-types/messagebox.js +1 -2
- package/dist/shared-types/option-group.js +1 -2
- package/dist/shared-types/progressbar.js +1 -2
- package/dist/shared-types/radiobutton.js +1 -2
- package/dist/shared-types/select.js +1 -2
- package/dist/shared-types/size.js +1 -2
- package/dist/shared-types/table.js +1 -2
- package/dist/shared-types/tag.js +1 -2
- package/dist/shared-types/textarea.js +1 -2
- package/dist/shared-types/textinput.js +1 -2
- package/dist/shared-utils/calendar/calendar-grid.js +4 -5
- package/dist/shared-utils/calendar/date-validation.js +1 -2
- package/dist/shared-utils/calendar/keyboard-navigation.js +1 -2
- package/dist/shared-utils/calendar/selection-manager.js +31 -32
- package/dist/shared-utils/combobox/input-utils.js +1 -2
- package/dist/shared-utils/combobox/keyboard-navigation.js +1 -2
- package/dist/shared-utils/combobox/option-utils.js +1 -2
- package/dist/shared-utils/date-utils.js +10 -11
- package/dist/shared-utils/datepicker-utils.js +4 -5
- package/dist/shared-utils/device-utils.js +1 -2
- package/dist/shared-utils/fileupload/announcements.js +1 -2
- package/dist/shared-utils/fileupload/filename.js +1 -2
- package/dist/shared-utils/fileupload/formats.js +1 -2
- package/dist/shared-utils/fileupload/navigation.js +1 -2
- package/dist/shared-utils/fileupload/size.js +1 -2
- package/dist/shared-utils/fileupload/transfers.js +1 -2
- package/dist/shared-utils/fileupload/truncate.js +1 -2
- package/dist/shared-utils/fileupload/validation.js +8 -9
- package/dist/shared-utils/focus-trap/index.js +13 -31
- package/dist/shared-utils/forms/described-by.js +1 -2
- package/dist/shared-utils/header-footer/external-domain.js +1 -2
- package/dist/shared-utils/header-footer/fetch-header-footer-data.js +1 -2
- package/dist/shared-utils/header-footer/icon-map.js +1 -2
- package/dist/shared-utils/header-footer/select-megamenu.js +1 -2
- package/dist/shared-utils/scroll-lock/index.js +1 -2
- package/dist/shared-utils/timepicker/options.js +1 -2
- package/dist/shared-utils/timepicker/stepper.js +1 -2
- package/dist/shared-utils/timepicker/time-utils.js +1 -2
- package/dist/shared-utils/value-utils.js +1 -2
- package/dist/utils/nativeInputValue.js +1 -2
- package/dist/utils/stableKeys.js +1 -2
- package/dist/utils/stringutils.js +1 -2
- package/package.json +20 -21
- package/src/components/accordion/Accordion.test.tsx +2 -4
- package/src/components/tag/Tag.tsx +0 -1
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { __toESM as e } from "../../_virtual/_rolldown/runtime.js";
|
|
3
3
|
import { DEFAULT_HEADER_LOGO_LINK as t } from "../../shared-types/header-footer.js";
|
|
4
|
-
import "../../shared-types/index.js";
|
|
5
4
|
import { require_classnames as n } from "../../node_modules/classnames/index.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { PktLink as
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
import { useHeaderChrome as r } from "../../hooks/useHeaderChrome.js";
|
|
6
|
+
import { useScrollLock as i } from "../../hooks/useScrollLock.js";
|
|
7
|
+
import { PktButton as a } from "../button/Button.js";
|
|
8
|
+
import { PktHeaderUserMenu as ee } from "../headerUserMenu/UserMenu.js";
|
|
9
|
+
import { PktIcon as o } from "../icon/Icon.js";
|
|
10
|
+
import { PktLink as te } from "../link/Link.js";
|
|
11
|
+
import { PktTextinput as s } from "../textinput/Textinput.js";
|
|
12
|
+
import "../../shared-types/index.js";
|
|
13
|
+
import { usePktStrings as ne } from "../../hooks/usePktStrings.js";
|
|
14
|
+
import { forwardRef as c, useCallback as l, useEffect as u, useMemo as re, useRef as d, useState as f } from "react";
|
|
15
|
+
import { Fragment as ie, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
16
|
+
// src/components/header/HeaderService.tsx
|
|
17
|
+
var h = /* @__PURE__ */ e(n(), 1), g = "https://punkt-cdn.oslo.kommune.no/latest/logos/";
|
|
18
|
+
typeof window < "u" && (window.pktLogoPath = window.pktLogoPath || g);
|
|
19
|
+
var _ = c(({ mobileBreakpoint: e = 768, tabletBreakpoint: n = 1280, children: c, className: _, compact: v = !1, "data-mode": ae, logOutButtonPlacement: y = "none", logOut: b, openedMenu: x, showSearch: S = !1, onSearch: C, onSearchChange: w, searchValue: oe, searchPlaceholder: se, representing: T, serviceLink: E, serviceClick: D, serviceName: O, user: k, userMenu: ce, userMenuFooter: A, userOptions: j, canChangeRepresentation: le = !1, changeRepresentation: ue, hideLogo: de = !1, logoLink: M = t, logoClick: fe, logoPath: N = typeof window < "u" ? window.pktLogoPath : g, position: pe = "fixed", scrollBehavior: P = "hide", slotMenuVariant: me = "icon-only", slotMenuText: he, strings: F }, ge) => {
|
|
20
20
|
let _e = P === "hide";
|
|
21
|
-
|
|
21
|
+
u(() => {
|
|
22
22
|
A && console.warn("PktHeaderService: The \"userMenuFooter\" prop is deprecated and will be removed in a future version. Please use \"userMenu\" instead.");
|
|
23
23
|
}, [A]);
|
|
24
|
-
let I =
|
|
25
|
-
|
|
24
|
+
let I = ne(["header"], F).header, L = se ?? I.search;
|
|
25
|
+
u(() => {
|
|
26
26
|
j && console.warn("PktHeaderService: The \"userOptions\" prop is no longer available. Please use \"userMenu\" instead.");
|
|
27
|
-
}, [j]),
|
|
27
|
+
}, [j]), u(() => {
|
|
28
28
|
k?.shortname && console.warn("PktHeaderService: The \"shortname\" property on the user object is deprecated and will be removed in a future version."), T?.shortname && console.warn("PktHeaderService: The \"shortname\" property on the representing object is deprecated and will be removed in a future version.");
|
|
29
29
|
}, [k?.shortname, T?.shortname]);
|
|
30
|
-
let ve =
|
|
30
|
+
let ve = re(() => {
|
|
31
31
|
if (k?.lastLoggedIn) return typeof k.lastLoggedIn == "string" ? k.lastLoggedIn : new Date(k.lastLoggedIn).toLocaleString("nb-NO", {
|
|
32
32
|
year: "numeric",
|
|
33
33
|
month: "long",
|
|
34
34
|
day: "numeric"
|
|
35
35
|
});
|
|
36
|
-
}, [k?.lastLoggedIn]), [R, z] =
|
|
37
|
-
|
|
38
|
-
let [xe, Se] =
|
|
36
|
+
}, [k?.lastLoggedIn]), [R, z] = f(x || "none"), [ye, be] = f(x);
|
|
37
|
+
x !== ye && (be(x), x !== void 0 && z(x));
|
|
38
|
+
let [xe, Se] = f(!1), [Ce, we] = f(!1), B = d(null), V = d(null), H = d(null), U = d(null), W = d(null), { setRef: Te, isMobile: G, isTablet: K, isFixed: q, isSticky: J, hidden: Ee, captureFocus: Y, flagRestoreFocus: X, restoreFocus: Z } = r({
|
|
39
39
|
forwardedRef: ge,
|
|
40
40
|
mobileBreakpoint: e,
|
|
41
41
|
tabletBreakpoint: n,
|
|
42
42
|
position: pe,
|
|
43
43
|
scrollBehavior: P
|
|
44
44
|
});
|
|
45
|
-
|
|
46
|
-
let Q =
|
|
45
|
+
i((q || J) && G && R !== "none");
|
|
46
|
+
let Q = l((e, t) => {
|
|
47
47
|
let n = e.relatedTarget, r;
|
|
48
48
|
switch (t) {
|
|
49
49
|
case "user":
|
|
@@ -58,9 +58,9 @@ var g = s(({ mobileBreakpoint: e = 768, tabletBreakpoint: n = 1280, children: s,
|
|
|
58
58
|
default: return;
|
|
59
59
|
}
|
|
60
60
|
let i = r.current;
|
|
61
|
-
i && (
|
|
61
|
+
i && (n && i.contains(n) || z("none"));
|
|
62
62
|
}, []);
|
|
63
|
-
|
|
63
|
+
u(() => {
|
|
64
64
|
let e = (e) => {
|
|
65
65
|
k && R === "user" && !e.target.closest(".pkt-header-service__user-container") && z("none"), R === "slot" && !e.target.closest(".pkt-header-service__slot-container") && z("none"), R === "search" && !e.target.closest(".pkt-header-service__search-container") && !e.target.closest(".pkt-header-service__search-input") && z("none");
|
|
66
66
|
}, t = (e) => {
|
|
@@ -76,76 +76,76 @@ var g = s(({ mobileBreakpoint: e = 768, tabletBreakpoint: n = 1280, children: s,
|
|
|
76
76
|
Z,
|
|
77
77
|
X
|
|
78
78
|
]);
|
|
79
|
-
let De =
|
|
79
|
+
let De = l((e) => {
|
|
80
80
|
let t = e === "slot" ? V : H, n = e === "slot" ? U : W;
|
|
81
81
|
if (!t.current || !n.current || !K || G) return;
|
|
82
82
|
let r = t.current.getBoundingClientRect(), i = n.current.offsetWidth, a = r.left + i > window.innerWidth;
|
|
83
83
|
e === "slot" ? Se(a) : we(a);
|
|
84
|
-
}, [K, G]), Oe =
|
|
84
|
+
}, [K, G]), Oe = l((e) => {
|
|
85
85
|
if (!K || R !== "slot") return;
|
|
86
86
|
let t = e.target.closest("a[href], button, [role=\"link\"], [role=\"button\"], [role=\"menuitem\"], [role=\"menuitemradio\"], [role=\"menuitemcheckbox\"]");
|
|
87
87
|
t && U.current?.contains(t) && (t.closest("[data-pkt-header-keep-open]") || t.disabled || t.getAttribute("aria-disabled") === "true" || z("none"));
|
|
88
|
-
}, [K, R]), $ =
|
|
88
|
+
}, [K, R]), $ = l((e) => {
|
|
89
89
|
R === "none" ? (Y(), z(e)) : z("none");
|
|
90
90
|
}, [R, Y]);
|
|
91
|
-
|
|
91
|
+
u(() => {
|
|
92
92
|
(R === "slot" || R === "search") && requestAnimationFrame(() => {
|
|
93
93
|
De(R);
|
|
94
94
|
});
|
|
95
95
|
}, [R, De]);
|
|
96
|
-
let ke = /* @__PURE__ */
|
|
97
|
-
className: (0,
|
|
98
|
-
"data-mode":
|
|
96
|
+
let ke = /* @__PURE__ */ m("header", {
|
|
97
|
+
className: (0, h.default)("pkt-header-service", v && "pkt-header-service--compact", G && "pkt-header-service--mobile", K && "pkt-header-service--tablet", q && "pkt-header-service--fixed", J && "pkt-header-service--sticky", _e && "pkt-header-service--scroll-to-hide", Ee && "pkt-header-service--hidden", _),
|
|
98
|
+
"data-mode": ae,
|
|
99
99
|
ref: Te,
|
|
100
100
|
children: [
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
className: (0,
|
|
103
|
-
children: [!de && (M ? /* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ m("div", {
|
|
102
|
+
className: (0, h.default)("pkt-header-service__logo-area", (!O || O === "") && "pkt-header-service__logo-area--without-service"),
|
|
103
|
+
children: [!de && (M ? /* @__PURE__ */ p("span", {
|
|
104
104
|
className: "pkt-header-service__logo",
|
|
105
|
-
children: /* @__PURE__ */
|
|
105
|
+
children: /* @__PURE__ */ p("a", {
|
|
106
106
|
href: M,
|
|
107
107
|
"aria-label": I.logoLabel,
|
|
108
108
|
onClick: fe,
|
|
109
|
-
children: /* @__PURE__ */
|
|
109
|
+
children: /* @__PURE__ */ p(o, {
|
|
110
110
|
name: "oslologo",
|
|
111
111
|
"aria-hidden": "true",
|
|
112
112
|
path: N
|
|
113
113
|
})
|
|
114
114
|
})
|
|
115
|
-
}) : /* @__PURE__ */
|
|
115
|
+
}) : /* @__PURE__ */ p("span", {
|
|
116
116
|
className: "pkt-header-service__logo",
|
|
117
117
|
role: "img",
|
|
118
118
|
"aria-label": I.logoAlt,
|
|
119
|
-
children: /* @__PURE__ */
|
|
119
|
+
children: /* @__PURE__ */ p(o, {
|
|
120
120
|
name: "oslologo",
|
|
121
121
|
"aria-hidden": "true",
|
|
122
122
|
path: N
|
|
123
123
|
})
|
|
124
|
-
})), O && /* @__PURE__ */
|
|
124
|
+
})), O && /* @__PURE__ */ p("span", {
|
|
125
125
|
className: "pkt-header-service__service-name",
|
|
126
126
|
translate: "no",
|
|
127
|
-
children: E ? /* @__PURE__ */
|
|
127
|
+
children: E ? /* @__PURE__ */ p(te, {
|
|
128
128
|
href: E,
|
|
129
129
|
className: "pkt-header-service__service-link ",
|
|
130
130
|
children: O
|
|
131
|
-
}) : D ? /* @__PURE__ */
|
|
131
|
+
}) : D ? /* @__PURE__ */ p("button", {
|
|
132
132
|
className: "pkt-link-button pkt-link pkt-header-service__service-link",
|
|
133
133
|
onClick: D,
|
|
134
134
|
children: O
|
|
135
|
-
}) : /* @__PURE__ */
|
|
135
|
+
}) : /* @__PURE__ */ p("span", {
|
|
136
136
|
className: "pkt-header-service__service-link",
|
|
137
137
|
children: O
|
|
138
138
|
})
|
|
139
139
|
})]
|
|
140
140
|
}),
|
|
141
|
-
|
|
141
|
+
c || S || K && b && (y === "header" || y === "both") ? /* @__PURE__ */ m("div", {
|
|
142
142
|
className: "pkt-header-service__content",
|
|
143
143
|
children: [
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
className: (0,
|
|
144
|
+
/* @__PURE__ */ m("div", {
|
|
145
|
+
className: (0, h.default)("pkt-header-service__slot-container", R === "slot" && "is-open"),
|
|
146
146
|
onBlur: (e) => Q(e, "slot"),
|
|
147
147
|
ref: V,
|
|
148
|
-
children: [K &&
|
|
148
|
+
children: [K && c && /* @__PURE__ */ p(a, {
|
|
149
149
|
skin: "secondary",
|
|
150
150
|
variant: me,
|
|
151
151
|
iconName: "menu",
|
|
@@ -156,24 +156,24 @@ var g = s(({ mobileBreakpoint: e = 768, tabletBreakpoint: n = 1280, children: s,
|
|
|
156
156
|
"aria-controls": "mobile-slot-menu",
|
|
157
157
|
"aria-label": I.openMenu,
|
|
158
158
|
children: he ?? I.menu
|
|
159
|
-
}), /* @__PURE__ */
|
|
160
|
-
className: (0,
|
|
159
|
+
}), /* @__PURE__ */ p("div", {
|
|
160
|
+
className: (0, h.default)("pkt-header-service__slot-content", xe && "align-right"),
|
|
161
161
|
id: "mobile-slot-menu",
|
|
162
162
|
role: K ? "group" : void 0,
|
|
163
163
|
"aria-label": K ? I.menu : void 0,
|
|
164
164
|
ref: U,
|
|
165
165
|
onClick: Oe,
|
|
166
|
-
children: /* @__PURE__ */
|
|
166
|
+
children: /* @__PURE__ */ p("div", {
|
|
167
167
|
className: "pkt-contents",
|
|
168
|
-
children:
|
|
168
|
+
children: c
|
|
169
169
|
})
|
|
170
170
|
})]
|
|
171
171
|
}),
|
|
172
|
-
|
|
173
|
-
className: (0,
|
|
172
|
+
S && /* @__PURE__ */ p(ie, { children: K ? /* @__PURE__ */ m("div", {
|
|
173
|
+
className: (0, h.default)("pkt-header-service__search-container", R === "search" && "is-open"),
|
|
174
174
|
onBlur: (e) => Q(e, "search"),
|
|
175
175
|
ref: H,
|
|
176
|
-
children: [/* @__PURE__ */
|
|
176
|
+
children: [/* @__PURE__ */ p(a, {
|
|
177
177
|
skin: "secondary",
|
|
178
178
|
variant: "icon-only",
|
|
179
179
|
iconName: "magnifying-glass-big",
|
|
@@ -184,56 +184,56 @@ var g = s(({ mobileBreakpoint: e = 768, tabletBreakpoint: n = 1280, children: s,
|
|
|
184
184
|
"aria-controls": "mobile-search-menu",
|
|
185
185
|
"aria-label": I.openSearch,
|
|
186
186
|
children: I.search
|
|
187
|
-
}), /* @__PURE__ */
|
|
188
|
-
className: (0,
|
|
187
|
+
}), /* @__PURE__ */ p("div", {
|
|
188
|
+
className: (0, h.default)("pkt-header-service__mobile-menu", R === "search" && "is-open", Ce && "align-right"),
|
|
189
189
|
ref: W,
|
|
190
|
-
children: R === "search" && /* @__PURE__ */
|
|
190
|
+
children: R === "search" && /* @__PURE__ */ p(s, {
|
|
191
191
|
id: "mobile-search-menu",
|
|
192
192
|
className: "pkt-header-service__search-input",
|
|
193
193
|
type: "search",
|
|
194
194
|
label: I.search,
|
|
195
195
|
useWrapper: !1,
|
|
196
196
|
placeholder: L,
|
|
197
|
-
value:
|
|
197
|
+
value: oe,
|
|
198
198
|
autoFocus: !0,
|
|
199
199
|
fullwidth: !0,
|
|
200
|
-
onChange: (e) =>
|
|
200
|
+
onChange: (e) => w?.(e.target.value),
|
|
201
201
|
onKeyDown: (e) => {
|
|
202
|
-
e.key === "Enter" &&
|
|
202
|
+
e.key === "Enter" && C?.(e.target.value);
|
|
203
203
|
}
|
|
204
204
|
})
|
|
205
205
|
})]
|
|
206
|
-
}) : /* @__PURE__ */
|
|
206
|
+
}) : /* @__PURE__ */ p(s, {
|
|
207
207
|
id: "header-service-search",
|
|
208
208
|
className: "pkt-header-service__search-input",
|
|
209
209
|
type: "search",
|
|
210
210
|
label: I.search,
|
|
211
211
|
useWrapper: !1,
|
|
212
212
|
placeholder: L,
|
|
213
|
-
value:
|
|
214
|
-
onChange: (e) =>
|
|
213
|
+
value: oe,
|
|
214
|
+
onChange: (e) => w?.(e.target.value),
|
|
215
215
|
onKeyDown: (e) => {
|
|
216
|
-
e.key === "Enter" &&
|
|
216
|
+
e.key === "Enter" && C?.(e.target.value);
|
|
217
217
|
}
|
|
218
218
|
}) }),
|
|
219
|
-
G &&
|
|
219
|
+
G && b && (y === "header" || y === "both") && /* @__PURE__ */ p(a, {
|
|
220
220
|
skin: "secondary",
|
|
221
221
|
size: G ? "small" : "medium",
|
|
222
222
|
variant: "icon-only",
|
|
223
223
|
iconName: "exit",
|
|
224
|
-
onClick:
|
|
224
|
+
onClick: b,
|
|
225
225
|
children: I.logOut
|
|
226
226
|
})
|
|
227
227
|
]
|
|
228
228
|
}) : null,
|
|
229
|
-
(k || !G &&
|
|
229
|
+
(k || !G && b && (y === "header" || y === "both")) && /* @__PURE__ */ m("div", {
|
|
230
230
|
className: "pkt-header-service__user",
|
|
231
|
-
children: [k && /* @__PURE__ */
|
|
231
|
+
children: [k && /* @__PURE__ */ m("div", {
|
|
232
232
|
className: "pkt-header-service__user-container",
|
|
233
233
|
onBlur: (e) => Q(e, "user"),
|
|
234
234
|
ref: B,
|
|
235
|
-
children: [/* @__PURE__ */
|
|
236
|
-
className: (0,
|
|
235
|
+
children: [/* @__PURE__ */ m(a, {
|
|
236
|
+
className: (0, h.default)("pkt-header-service__user-button", G && "pkt-header-service__user-button--mobile"),
|
|
237
237
|
skin: "secondary",
|
|
238
238
|
size: G ? "small" : "medium",
|
|
239
239
|
state: R === "user" ? "active" : "normal",
|
|
@@ -241,16 +241,16 @@ var g = s(({ mobileBreakpoint: e = 768, tabletBreakpoint: n = 1280, children: s,
|
|
|
241
241
|
iconName: "user",
|
|
242
242
|
secondIconName: R === "user" ? "chevron-thin-up" : "chevron-thin-down",
|
|
243
243
|
onClick: () => $("user"),
|
|
244
|
-
children: [/* @__PURE__ */
|
|
244
|
+
children: [/* @__PURE__ */ m("span", {
|
|
245
245
|
className: "pkt-sr-only",
|
|
246
246
|
children: [I.userMenuButton, " "]
|
|
247
|
-
}), /* @__PURE__ */
|
|
247
|
+
}), /* @__PURE__ */ p("span", {
|
|
248
248
|
translate: "no",
|
|
249
249
|
children: T?.name || k.name
|
|
250
250
|
})]
|
|
251
|
-
}), R === "user" && k && /* @__PURE__ */
|
|
252
|
-
className: (0,
|
|
253
|
-
children: /* @__PURE__ */
|
|
251
|
+
}), R === "user" && k && /* @__PURE__ */ p("div", {
|
|
252
|
+
className: (0, h.default)(G ? "pkt-header-service__mobile-menu" : "pkt-header-service__user-menu", "is-open"),
|
|
253
|
+
children: /* @__PURE__ */ p(ee, {
|
|
254
254
|
strings: F,
|
|
255
255
|
user: k,
|
|
256
256
|
formattedLastLoggedIn: ve,
|
|
@@ -258,25 +258,24 @@ var g = s(({ mobileBreakpoint: e = 768, tabletBreakpoint: n = 1280, children: s,
|
|
|
258
258
|
userMenu: ce,
|
|
259
259
|
canChangeRepresentation: le,
|
|
260
260
|
changeRepresentation: ue,
|
|
261
|
-
logoutOnClick:
|
|
261
|
+
logoutOnClick: y === "userMenu" || y === "both" ? b : void 0
|
|
262
262
|
})
|
|
263
263
|
})]
|
|
264
|
-
}), !G &&
|
|
264
|
+
}), !G && b && (y === "header" || y === "both") && /* @__PURE__ */ p(a, {
|
|
265
265
|
skin: "tertiary",
|
|
266
266
|
size: "medium",
|
|
267
267
|
variant: "icon-right",
|
|
268
268
|
iconName: "exit",
|
|
269
|
-
onClick:
|
|
269
|
+
onClick: b,
|
|
270
270
|
children: I.logOut
|
|
271
271
|
})]
|
|
272
272
|
})
|
|
273
273
|
]
|
|
274
274
|
});
|
|
275
|
-
return q ? /* @__PURE__ */
|
|
275
|
+
return q ? /* @__PURE__ */ m("div", {
|
|
276
276
|
className: "pkt-header-service-wrapper",
|
|
277
|
-
children: [ke, /* @__PURE__ */
|
|
277
|
+
children: [ke, /* @__PURE__ */ p("div", { className: (0, h.default)("pkt-header-service-spacer", v && "pkt-header-service-spacer--compact", k && "pkt-header-service-spacer--has-user", G && "pkt-header-service-spacer--mobile", K && "pkt-header-service-spacer--tablet") })]
|
|
278
278
|
}) : ke;
|
|
279
279
|
});
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
export { g as PktHeaderService };
|
|
280
|
+
_.displayName = "PktHeaderService";
|
|
281
|
+
export { _ as PktHeaderService };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { PktAccordion as e } from "../accordion/Accordion.js";
|
|
3
|
-
import { DEFAULT_HEADER_FOOTER_URL as t } from "../../shared-types/header-footer.js";
|
|
4
2
|
import "../../shared-types/index.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
3
|
+
import { DEFAULT_HEADER_FOOTER_URL as e } from "../../shared-types/header-footer.js";
|
|
4
|
+
import { deriveSocialIcon as t, mapOdsIcon as n } from "../../shared-utils/header-footer/icon-map.js";
|
|
5
|
+
import { fetchHeaderFooterData as r } from "../../shared-utils/header-footer/fetch-header-footer-data.js";
|
|
6
|
+
import { selectLocaleData as i } from "../../shared-utils/header-footer/select-megamenu.js";
|
|
7
|
+
import { useElementWidth as a } from "../../hooks/useElementWidth.js";
|
|
8
|
+
import { usePktStrings as o } from "../../hooks/usePktStrings.js";
|
|
9
|
+
import { PktAccordion as s } from "../accordion/Accordion.js";
|
|
10
|
+
import { PktAccordionItem as c } from "../accordion/AccordionItem.js";
|
|
11
|
+
import { PktIcon as l } from "../icon/Icon.js";
|
|
12
12
|
import { useCallback as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
13
13
|
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
14
|
-
|
|
15
|
-
var v = ({ dataUrl:
|
|
16
|
-
let k =
|
|
14
|
+
// src/components/header-menu/HeaderMenu.tsx
|
|
15
|
+
var v = ({ dataUrl: t = e, data: n, locale: s = "nb-NO", open: c = !1, mobileBreakpoint: l = 768, className: v, onDataLoaded: y, onDataError: w, ref: E, strings: D, ...O }) => {
|
|
16
|
+
let k = o(["header"], D).header, [A, j] = m("loading"), [M, N] = m(void 0), P = n ? "ready" : A, F = p(y), I = p(w);
|
|
17
17
|
d(() => {
|
|
18
18
|
F.current = y;
|
|
19
19
|
}, [y]), d(() => {
|
|
@@ -21,21 +21,21 @@ var v = ({ dataUrl: e = t, data: n, locale: r = "nb-NO", open: a = !1, mobileBre
|
|
|
21
21
|
}, [w]);
|
|
22
22
|
let L = p(null), R = u((e) => {
|
|
23
23
|
L.current = e, typeof E == "function" ? E(e) : E && (E.current = e);
|
|
24
|
-
}, [E]), z =
|
|
24
|
+
}, [E]), z = a(L) < l;
|
|
25
25
|
d(() => {
|
|
26
26
|
n && F.current?.(n);
|
|
27
27
|
}, [n]), d(() => {
|
|
28
28
|
if (n) return;
|
|
29
|
-
let
|
|
30
|
-
return
|
|
31
|
-
|
|
29
|
+
let e = new AbortController();
|
|
30
|
+
return r(t, e.signal).then((t) => {
|
|
31
|
+
e.signal.aborted || (N(t), j("ready"), F.current?.(t));
|
|
32
32
|
}).catch((e) => {
|
|
33
33
|
e.name !== "AbortError" && (j("error"), I.current?.(e));
|
|
34
|
-
}), () =>
|
|
35
|
-
}, [n,
|
|
36
|
-
let B = n ?? M, V = f(() =>
|
|
34
|
+
}), () => e.abort();
|
|
35
|
+
}, [n, t]);
|
|
36
|
+
let B = n ?? M, V = f(() => i(B, s), [B, s]), H = [
|
|
37
37
|
"pkt-header-menu",
|
|
38
|
-
|
|
38
|
+
c && "pkt-header-menu--open",
|
|
39
39
|
v
|
|
40
40
|
].filter(Boolean).join(" ");
|
|
41
41
|
if (P === "loading") return /* @__PURE__ */ g("nav", {
|
|
@@ -52,7 +52,7 @@ var v = ({ dataUrl: e = t, data: n, locale: r = "nb-NO", open: a = !1, mobileBre
|
|
|
52
52
|
...O,
|
|
53
53
|
ref: R,
|
|
54
54
|
className: H,
|
|
55
|
-
"aria-hidden": !
|
|
55
|
+
"aria-hidden": !c,
|
|
56
56
|
children: /* @__PURE__ */ g("p", {
|
|
57
57
|
className: "pkt-header-menu__error",
|
|
58
58
|
children: k.menuLoadError
|
|
@@ -93,9 +93,9 @@ var v = ({ dataUrl: e = t, data: n, locale: r = "nb-NO", open: a = !1, mobileBre
|
|
|
93
93
|
children: /* @__PURE__ */ _("a", {
|
|
94
94
|
className: "pkt-header-menu__service-link",
|
|
95
95
|
href: e.url,
|
|
96
|
-
children: [/* @__PURE__ */ g(
|
|
96
|
+
children: [/* @__PURE__ */ g(l, {
|
|
97
97
|
className: "pkt-header-menu__service-icon",
|
|
98
|
-
name:
|
|
98
|
+
name: n(e.icon),
|
|
99
99
|
"aria-hidden": "true"
|
|
100
100
|
}), /* @__PURE__ */ g("span", {
|
|
101
101
|
className: "pkt-header-menu__service-text",
|
|
@@ -103,19 +103,19 @@ var v = ({ dataUrl: e = t, data: n, locale: r = "nb-NO", open: a = !1, mobileBre
|
|
|
103
103
|
})]
|
|
104
104
|
})
|
|
105
105
|
}, e.url))
|
|
106
|
-
}), b = ({ services:
|
|
106
|
+
}), b = ({ services: e, sections: t }) => /* @__PURE__ */ g("div", {
|
|
107
107
|
className: "pkt-header-menu__sections",
|
|
108
|
-
children: /* @__PURE__ */ _(
|
|
108
|
+
children: /* @__PURE__ */ _(s, {
|
|
109
109
|
className: "pkt-header-menu__sections-inner",
|
|
110
110
|
skin: "plus-minus",
|
|
111
111
|
name: "header-menu-accordion",
|
|
112
|
-
children: [/* @__PURE__ */ g(
|
|
112
|
+
children: [/* @__PURE__ */ g(c, {
|
|
113
113
|
className: "pkt-header-menu__section",
|
|
114
114
|
skin: "plus-minus",
|
|
115
115
|
id: "pkt-header-menu-services",
|
|
116
|
-
title:
|
|
117
|
-
children: /* @__PURE__ */ g(y, { services:
|
|
118
|
-
}),
|
|
116
|
+
title: e.title,
|
|
117
|
+
children: /* @__PURE__ */ g(y, { services: e })
|
|
118
|
+
}), t.map((e, t) => /* @__PURE__ */ g(c, {
|
|
119
119
|
className: "pkt-header-menu__section",
|
|
120
120
|
skin: "plus-minus",
|
|
121
121
|
id: `pkt-header-menu-section-${t}`,
|
|
@@ -137,9 +137,9 @@ var v = ({ dataUrl: e = t, data: n, locale: r = "nb-NO", open: a = !1, mobileBre
|
|
|
137
137
|
children: e.map((e) => /* @__PURE__ */ _("a", {
|
|
138
138
|
className: "pkt-btn pkt-btn--secondary pkt-btn--icon-right pkt-btn--small",
|
|
139
139
|
href: e.url,
|
|
140
|
-
children: [/* @__PURE__ */ g(
|
|
140
|
+
children: [/* @__PURE__ */ g(l, {
|
|
141
141
|
className: "pkt-btn__icon",
|
|
142
|
-
name: e.iconName ?
|
|
142
|
+
name: e.iconName ? n(e.iconName) : "user",
|
|
143
143
|
"aria-hidden": "true"
|
|
144
144
|
}), /* @__PURE__ */ g("span", {
|
|
145
145
|
className: "pkt-btn__text",
|
|
@@ -183,16 +183,15 @@ var v = ({ dataUrl: e = t, data: n, locale: r = "nb-NO", open: a = !1, mobileBre
|
|
|
183
183
|
})]
|
|
184
184
|
});
|
|
185
185
|
}, E = ({ entry: e }) => {
|
|
186
|
-
let
|
|
186
|
+
let n = t(e.url, e.text);
|
|
187
187
|
return /* @__PURE__ */ g("li", { children: /* @__PURE__ */ g("a", {
|
|
188
188
|
className: "pkt-header-menu__social-link",
|
|
189
189
|
href: e.url,
|
|
190
190
|
"aria-label": e.text,
|
|
191
|
-
children:
|
|
192
|
-
name:
|
|
191
|
+
children: n ? /* @__PURE__ */ g(l, {
|
|
192
|
+
name: n,
|
|
193
193
|
"aria-hidden": "true"
|
|
194
194
|
}) : /* @__PURE__ */ g("span", { children: e.text })
|
|
195
195
|
}) });
|
|
196
196
|
};
|
|
197
|
-
//#endregion
|
|
198
197
|
export { v as PktHeaderMenu };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { __toESM as e } from "../../_virtual/_rolldown/runtime.js";
|
|
3
3
|
import { require_classnames as t } from "../../node_modules/classnames/index.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { formatString as n } from "../../shared-strings/format.js";
|
|
5
|
+
import { usePktStrings as r } from "../../hooks/usePktStrings.js";
|
|
6
|
+
import { PktIcon as i } from "../icon/Icon.js";
|
|
7
|
+
import { PktLink as a } from "../link/Link.js";
|
|
8
|
+
import { withStableKeys as o } from "../../utils/stableKeys.js";
|
|
9
9
|
import { forwardRef as s } from "react";
|
|
10
10
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
11
|
-
|
|
11
|
+
// src/components/headerUserMenu/UserMenu.tsx
|
|
12
12
|
var u = /* @__PURE__ */ e(t(), 1), d = (e) => typeof e.target == "string" ? {
|
|
13
13
|
title: e.title,
|
|
14
14
|
iconName: e.iconName,
|
|
@@ -17,7 +17,7 @@ var u = /* @__PURE__ */ e(t(), 1), d = (e) => typeof e.target == "string" ? {
|
|
|
17
17
|
title: e.title,
|
|
18
18
|
iconName: e.iconName,
|
|
19
19
|
onClick: e.target
|
|
20
|
-
}, f = ({ item: e, className: t }) => "href" in e ? /* @__PURE__ */ c(
|
|
20
|
+
}, f = ({ item: e, className: t }) => "href" in e ? /* @__PURE__ */ c(a, {
|
|
21
21
|
iconName: e.iconName,
|
|
22
22
|
href: e.href,
|
|
23
23
|
className: (0, u.default)("pkt-user-menu__link", t),
|
|
@@ -28,19 +28,19 @@ var u = /* @__PURE__ */ e(t(), 1), d = (e) => typeof e.target == "string" ? {
|
|
|
28
28
|
onClick: () => {
|
|
29
29
|
"onClick" in e && typeof e.onClick == "function" ? e.onClick() : console.error("UserMenuButton item is missing onClick handler or onClick is not a function:", e);
|
|
30
30
|
},
|
|
31
|
-
children: [e.iconName && /* @__PURE__ */ c(
|
|
31
|
+
children: [e.iconName && /* @__PURE__ */ c(i, {
|
|
32
32
|
name: e.iconName,
|
|
33
33
|
className: "pkt-link__icon",
|
|
34
34
|
"aria-hidden": "true"
|
|
35
35
|
}), e.title]
|
|
36
36
|
}), p = ({ links: e }) => /* @__PURE__ */ c("ul", {
|
|
37
37
|
className: "pkt-user-menu__sublist",
|
|
38
|
-
children:
|
|
38
|
+
children: o(e, (e) => `${"href" in e ? e.href : ""}|${e.title}`).map(({ item: e, key: t }) => /* @__PURE__ */ c("li", {
|
|
39
39
|
className: "pkt-user-menu__subitem",
|
|
40
40
|
children: /* @__PURE__ */ c(f, { item: e })
|
|
41
41
|
}, t))
|
|
42
|
-
}), m = s(({ strings: e, user: t, formattedLastLoggedIn:
|
|
43
|
-
let g =
|
|
42
|
+
}), m = s(({ strings: e, user: t, formattedLastLoggedIn: i, representing: a, userMenu: o, canChangeRepresentation: s, changeRepresentation: u, logoutOnClick: m }, h) => {
|
|
43
|
+
let g = r(["header"], e).header, _ = o?.map(d);
|
|
44
44
|
return /* @__PURE__ */ c("nav", {
|
|
45
45
|
className: "pkt-user-menu",
|
|
46
46
|
ref: h,
|
|
@@ -60,12 +60,12 @@ var u = /* @__PURE__ */ e(t(), 1), d = (e) => typeof e.target == "string" ? {
|
|
|
60
60
|
translate: "no",
|
|
61
61
|
children: t.name
|
|
62
62
|
}),
|
|
63
|
-
|
|
63
|
+
i && /* @__PURE__ */ l("div", {
|
|
64
64
|
className: "pkt-user-menu__last-logged-in",
|
|
65
65
|
children: [
|
|
66
66
|
g.lastLoggedIn,
|
|
67
67
|
" ",
|
|
68
|
-
/* @__PURE__ */ c("time", { children:
|
|
68
|
+
/* @__PURE__ */ c("time", { children: i })
|
|
69
69
|
]
|
|
70
70
|
})
|
|
71
71
|
]
|
|
@@ -88,7 +88,7 @@ var u = /* @__PURE__ */ e(t(), 1), d = (e) => typeof e.target == "string" ? {
|
|
|
88
88
|
}),
|
|
89
89
|
a.orgNumber && /* @__PURE__ */ c("div", {
|
|
90
90
|
className: "pkt-user-menu__org-number",
|
|
91
|
-
children:
|
|
91
|
+
children: n(g.orgNumber, { number: a.orgNumber })
|
|
92
92
|
}),
|
|
93
93
|
s && u && /* @__PURE__ */ c("ul", {
|
|
94
94
|
className: "pkt-user-menu__sublist mt-size-16",
|
|
@@ -130,5 +130,4 @@ var u = /* @__PURE__ */ e(t(), 1), d = (e) => typeof e.target == "string" ? {
|
|
|
130
130
|
});
|
|
131
131
|
});
|
|
132
132
|
m.displayName = "PktHeaderUserMenu";
|
|
133
|
-
//#endregion
|
|
134
133
|
export { m as PktHeaderUserMenu };
|
|
@@ -2,7 +2,7 @@ import { __toESM as e } from "../../_virtual/_rolldown/runtime.js";
|
|
|
2
2
|
import { require_classnames as t } from "../../node_modules/classnames/index.js";
|
|
3
3
|
import { forwardRef as n } from "react";
|
|
4
4
|
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
-
|
|
5
|
+
// src/components/heading/Heading.tsx
|
|
6
6
|
var i = /* @__PURE__ */ e(t(), 1), a = (e) => {
|
|
7
7
|
switch (e) {
|
|
8
8
|
case 1: return "xlarge";
|
|
@@ -33,5 +33,4 @@ var i = /* @__PURE__ */ e(t(), 1), a = (e) => {
|
|
|
33
33
|
});
|
|
34
34
|
});
|
|
35
35
|
s.displayName = "PktHeading";
|
|
36
|
-
//#endregion
|
|
37
36
|
export { s as PktHeading };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { __toESM as e } from "../../_virtual/_rolldown/runtime.js";
|
|
3
3
|
import { require_classnames as t } from "../../node_modules/classnames/index.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { useGeneratedId as n } from "../../hooks/useGeneratedId.js";
|
|
5
|
+
import { PktIcon as r } from "../icon/Icon.js";
|
|
6
6
|
import { forwardRef as i, useState as a } from "react";
|
|
7
7
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
|
-
|
|
8
|
+
// src/components/helptext/Helptext.tsx
|
|
9
9
|
var c = /* @__PURE__ */ e(t(), 1), l = "Les mer <span class='pkt-sr-only'>om feltet</span>", u = (e) => e == null || e === "" ? null : typeof e == "string" ? /* @__PURE__ */ o("span", { dangerouslySetInnerHTML: { __html: e } }) : e, d = i(function({ helptext: e, helptextDropdown: t, helptextDropdownButton: i, forId: d, onToggleHelpText: f, className: p, children: m, ...h }, g) {
|
|
10
|
-
let [_, v] = a(!1), y =
|
|
10
|
+
let [_, v] = a(!1), y = n(d), b = () => {
|
|
11
11
|
let e = !_;
|
|
12
12
|
v(e), f?.(e);
|
|
13
13
|
}, x = (0, c.default)("pkt-inputwrapper__helptext-container", !!(e || t || m) && "pkt-inputwrapper__has-helptext", p);
|
|
@@ -30,7 +30,7 @@ var c = /* @__PURE__ */ e(t(), 1), l = "Les mer <span class='pkt-sr-only'>om fel
|
|
|
30
30
|
"aria-expanded": _,
|
|
31
31
|
"aria-controls": `${y}-helptext-expandable`,
|
|
32
32
|
onClick: b,
|
|
33
|
-
children: [/* @__PURE__ */ o(
|
|
33
|
+
children: [/* @__PURE__ */ o(r, {
|
|
34
34
|
className: "pkt-btn__icon",
|
|
35
35
|
name: _ ? "chevron-thin-up" : "chevron-thin-down"
|
|
36
36
|
}), /* @__PURE__ */ o("span", {
|
|
@@ -46,5 +46,4 @@ var c = /* @__PURE__ */ e(t(), 1), l = "Les mer <span class='pkt-sr-only'>om fel
|
|
|
46
46
|
});
|
|
47
47
|
});
|
|
48
48
|
d.displayName = "PktHelptext";
|
|
49
|
-
//#endregion
|
|
50
49
|
export { d as PktHelptext };
|