@oslokommune/punkt-react 20.0.4 → 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,82 +1,82 @@
|
|
|
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 {
|
|
5
|
+
import "../../shared-types/index.js";
|
|
6
|
+
import { fetchHeaderFooterData as r } from "../../shared-utils/header-footer/fetch-header-footer-data.js";
|
|
7
|
+
import { selectLocaleData as i } from "../../shared-utils/header-footer/select-megamenu.js";
|
|
9
8
|
import { getDeepActiveElement as ee, getFocusableElementsDeep as te } from "../../shared-utils/focus-trap/index.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { PktSearchInput as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}, [A]), u(() => {
|
|
9
|
+
import { useHeaderChrome as a } from "../../hooks/useHeaderChrome.js";
|
|
10
|
+
import { useScrollLock as o } from "../../hooks/useScrollLock.js";
|
|
11
|
+
import { PktButton as s } from "../button/Button.js";
|
|
12
|
+
import { PktHeaderMenu as ne } from "../header-menu/HeaderMenu.js";
|
|
13
|
+
import { PktHeaderUserMenu as c } from "../headerUserMenu/UserMenu.js";
|
|
14
|
+
import { PktIcon as l } from "../icon/Icon.js";
|
|
15
|
+
import { PktSearchInput as u } from "../searchinput/SearchInput.js";
|
|
16
|
+
import { usePktStrings as re } from "../../hooks/usePktStrings.js";
|
|
17
|
+
import { forwardRef as d, useCallback as f, useEffect as p, useLayoutEffect as ie, useMemo as ae, useRef as m, useState as h } from "react";
|
|
18
|
+
import { Fragment as oe, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
19
|
+
// src/components/header/HeaderGlobal.tsx
|
|
20
|
+
var v = /* @__PURE__ */ e(n(), 1), se = "https://punkt-cdn.oslo.kommune.no/latest/logos/";
|
|
21
|
+
typeof window < "u" && (window.pktLogoPath = window.pktLogoPath || se);
|
|
22
|
+
var y = "pkt-header-global-menu", b = "pkt-header-global-menu-toggle", x = "pkt-header-global-search-panel", S = "pkt-header-global-search-toggle", C = d(({ className: e, "data-mode": n, dataUrl: d, data: C, locale: w = "nb-NO", logoLink: T = t, logoClick: ce, logoPath: E = typeof window < "u" ? window.pktLogoPath : se, showSearch: le = !0, searchPlaceholder: D, onSearch: ue, showContact: de = !0, user: O, userMenu: fe, representing: pe, canChangeRepresentation: me = !1, changeRepresentation: he, logOutButtonPlacement: ge = "none", logOut: _e, position: ve = "fixed", scrollBehavior: k = "hide", mobileBreakpoint: A = 768, tabletBreakpoint: ye = 1024, onDataLoaded: j, onDataError: M, strings: N }, be) => {
|
|
23
|
+
let xe = k === "hide", [P, F] = h("none"), [Se, Ce] = h(void 0), [we, I] = h(!1), L = m(j), R = m(M);
|
|
24
|
+
p(() => {
|
|
27
25
|
L.current = j;
|
|
28
|
-
}, [j])
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
}, [j]), p(() => {
|
|
27
|
+
R.current = M;
|
|
28
|
+
}, [M]);
|
|
29
|
+
let { setRef: Te, isMobile: z, isTablet: B, isFixed: Ee, isSticky: De, hidden: Oe, captureFocus: ke, flagRestoreFocus: Ae, restoreFocus: je } = a({
|
|
30
|
+
forwardedRef: be,
|
|
31
|
+
mobileBreakpoint: A,
|
|
32
|
+
tabletBreakpoint: ye,
|
|
33
|
+
position: ve,
|
|
34
|
+
scrollBehavior: k,
|
|
35
|
+
pauseScrollHide: P !== "none"
|
|
36
36
|
});
|
|
37
|
-
|
|
38
|
-
let Me =
|
|
39
|
-
Me.current = e,
|
|
40
|
-
}, [
|
|
41
|
-
|
|
42
|
-
if (
|
|
43
|
-
let e = document.getElementById(
|
|
37
|
+
o(P === "menu" || P === "search");
|
|
38
|
+
let Me = m(null), Ne = f((e) => {
|
|
39
|
+
Me.current = e, Te(e);
|
|
40
|
+
}, [Te]);
|
|
41
|
+
ie(() => {
|
|
42
|
+
if (P !== "menu" && P !== "search") return;
|
|
43
|
+
let e = document.getElementById(P === "menu" ? y : x), t = Me.current?.getBoundingClientRect();
|
|
44
44
|
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`));
|
|
45
45
|
}, [
|
|
46
|
-
|
|
46
|
+
P,
|
|
47
47
|
z,
|
|
48
48
|
B
|
|
49
|
-
]),
|
|
50
|
-
|
|
51
|
-
}, [
|
|
52
|
-
if (
|
|
49
|
+
]), p(() => {
|
|
50
|
+
C && L.current?.(C);
|
|
51
|
+
}, [C]), p(() => {
|
|
52
|
+
if (C) return;
|
|
53
53
|
let e = new AbortController();
|
|
54
|
-
return
|
|
55
|
-
e.signal.aborted || (
|
|
54
|
+
return r(d, e.signal).then((t) => {
|
|
55
|
+
e.signal.aborted || (Ce(t), I(!1), L.current?.(t));
|
|
56
56
|
}).catch((e) => {
|
|
57
|
-
e.name !== "AbortError" && (
|
|
57
|
+
e.name !== "AbortError" && (I(!0), R.current?.(e));
|
|
58
58
|
}), () => e.abort();
|
|
59
|
-
}, [
|
|
60
|
-
let V =
|
|
61
|
-
|
|
59
|
+
}, [C, d]);
|
|
60
|
+
let V = C ?? Se, H = ae(() => i(V, w), [V, w]);
|
|
61
|
+
p(() => {
|
|
62
62
|
let e = (e) => {
|
|
63
63
|
let t = e.target;
|
|
64
|
-
|
|
64
|
+
P === "user" && !t.closest(".pkt-header-global__user-container") && !t.closest(".pkt-header-global__user-menu") && F("none"), P === "menu" && !t.closest(".pkt-header-menu") && !t.closest(`#${b}`) && F("none"), P === "search" && !t.closest(".pkt-header-global__search-panel-inner") && !t.closest(`#${S}`) && F("none");
|
|
65
65
|
}, t = (e) => {
|
|
66
|
-
e.key === "Escape" &&
|
|
66
|
+
e.key === "Escape" && P !== "none" && (e.preventDefault(), Ae(), F("none"));
|
|
67
67
|
};
|
|
68
|
-
if (
|
|
68
|
+
if (P !== "none") return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
|
|
69
69
|
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
|
|
70
70
|
};
|
|
71
71
|
je();
|
|
72
72
|
}, [
|
|
73
|
-
|
|
73
|
+
P,
|
|
74
74
|
je,
|
|
75
75
|
Ae
|
|
76
|
-
]),
|
|
77
|
-
if (
|
|
78
|
-
let e =
|
|
79
|
-
|
|
76
|
+
]), p(() => {
|
|
77
|
+
if (P !== "menu" && P !== "search") return;
|
|
78
|
+
let e = P === "menu" ? y : x, t = P === "menu" ? b : S, n = () => document.getElementById(e), r = () => document.getElementById(t), i = (e) => {
|
|
79
|
+
F("none"), (e.querySelector("button") ?? e).focus();
|
|
80
80
|
}, a = (e) => {
|
|
81
81
|
if (e.key !== "Tab") return;
|
|
82
82
|
let t = n(), a = r();
|
|
@@ -87,79 +87,79 @@ var _ = "pkt-header-global-menu", v = "pkt-header-global-menu-toggle", y = "pkt-
|
|
|
87
87
|
return;
|
|
88
88
|
}
|
|
89
89
|
if (o.length === 0) return;
|
|
90
|
-
let ne = o[0],
|
|
91
|
-
(
|
|
90
|
+
let ne = o[0], c = o[o.length - 1], l = !e.shiftKey && s === c, u = e.shiftKey && s === ne;
|
|
91
|
+
(l || u) && (e.preventDefault(), i(a));
|
|
92
92
|
}, o = (e) => {
|
|
93
93
|
let t = e.target;
|
|
94
94
|
if (!t) return;
|
|
95
95
|
let i = n();
|
|
96
96
|
if (!i) return;
|
|
97
|
-
let
|
|
98
|
-
i.contains(t) ||
|
|
97
|
+
let ee = r();
|
|
98
|
+
i.contains(t) || ee?.contains(t) || F("none");
|
|
99
99
|
};
|
|
100
100
|
return document.addEventListener("keydown", a), document.addEventListener("focusin", o), () => {
|
|
101
101
|
document.removeEventListener("keydown", a), document.removeEventListener("focusin", o);
|
|
102
102
|
};
|
|
103
|
-
}, [
|
|
104
|
-
let Pe =
|
|
105
|
-
if (
|
|
103
|
+
}, [P]);
|
|
104
|
+
let Pe = ae(() => {
|
|
105
|
+
if (O?.lastLoggedIn) return typeof O.lastLoggedIn == "string" ? O.lastLoggedIn : new Date(O.lastLoggedIn).toLocaleString("nb-NO", {
|
|
106
106
|
year: "numeric",
|
|
107
107
|
month: "long",
|
|
108
108
|
day: "numeric"
|
|
109
109
|
});
|
|
110
|
-
}, [
|
|
111
|
-
|
|
112
|
-
}, [ke]), Fe =
|
|
113
|
-
className: (0,
|
|
110
|
+
}, [O?.lastLoggedIn]), U = f((e) => {
|
|
111
|
+
F((t) => t === e ? "none" : (ke(), e));
|
|
112
|
+
}, [ke]), Fe = ge === "userMenu" || ge === "both", W = re(["header"], N).header, G = H?.search, K = H?.header?.contact, Ie = H?.i18n?.menu || W.menu, q = H?.i18n?.search || W.search, J = P === "menu", Y = P === "user", X = P === "search", Z = z, Q = !!(le && G), Le = G?.input.id || "pkt-header-global-search", Re = !H && !we, ze = /* @__PURE__ */ _("header", {
|
|
113
|
+
className: (0, v.default)("pkt-header-global", z && "pkt-header-global--mobile", B && "pkt-header-global--tablet", Ee && "pkt-header-global--fixed", De && "pkt-header-global--sticky", xe && "pkt-header-global--scroll-to-hide", Oe && "pkt-header-global--hidden", e),
|
|
114
114
|
"data-mode": n,
|
|
115
115
|
ref: Ne,
|
|
116
116
|
children: [
|
|
117
|
-
/* @__PURE__ */
|
|
117
|
+
/* @__PURE__ */ g("div", {
|
|
118
118
|
className: "pkt-header-global__logo-area",
|
|
119
|
-
children:
|
|
119
|
+
children: T ? /* @__PURE__ */ g("span", {
|
|
120
120
|
className: "pkt-header-global__logo",
|
|
121
|
-
children: /* @__PURE__ */
|
|
122
|
-
href:
|
|
121
|
+
children: /* @__PURE__ */ g("a", {
|
|
122
|
+
href: T,
|
|
123
123
|
"aria-label": W.logoLabel,
|
|
124
|
-
onClick:
|
|
125
|
-
children: /* @__PURE__ */
|
|
124
|
+
onClick: ce,
|
|
125
|
+
children: /* @__PURE__ */ g(l, {
|
|
126
126
|
name: "oslologo",
|
|
127
127
|
"aria-hidden": "true",
|
|
128
|
-
path:
|
|
128
|
+
path: E
|
|
129
129
|
})
|
|
130
130
|
})
|
|
131
|
-
}) : /* @__PURE__ */
|
|
131
|
+
}) : /* @__PURE__ */ g("span", {
|
|
132
132
|
className: "pkt-header-global__logo",
|
|
133
133
|
role: "img",
|
|
134
134
|
"aria-label": W.logoAlt,
|
|
135
|
-
children: /* @__PURE__ */
|
|
135
|
+
children: /* @__PURE__ */ g(l, {
|
|
136
136
|
name: "oslologo",
|
|
137
137
|
"aria-hidden": "true",
|
|
138
|
-
path:
|
|
138
|
+
path: E
|
|
139
139
|
})
|
|
140
140
|
})
|
|
141
141
|
}),
|
|
142
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ _("div", {
|
|
143
143
|
className: "pkt-header-global__content",
|
|
144
144
|
children: [
|
|
145
|
-
!Z && Q && G && /* @__PURE__ */
|
|
145
|
+
!Z && Q && G && /* @__PURE__ */ g("div", {
|
|
146
146
|
className: "pkt-header-global__search",
|
|
147
|
-
children: /* @__PURE__ */
|
|
147
|
+
children: /* @__PURE__ */ g(u, {
|
|
148
148
|
appearance: "global",
|
|
149
149
|
inputSize: B ? "small" : "medium",
|
|
150
150
|
fullwidth: !0,
|
|
151
151
|
id: Le,
|
|
152
152
|
name: G.input.name,
|
|
153
153
|
"aria-label": q,
|
|
154
|
-
placeholder:
|
|
154
|
+
placeholder: D ?? G.input.placeholder,
|
|
155
155
|
action: G.endpoint,
|
|
156
156
|
method: "get",
|
|
157
|
-
onSearch:
|
|
157
|
+
onSearch: ue,
|
|
158
158
|
onChange: () => {}
|
|
159
159
|
})
|
|
160
160
|
}),
|
|
161
|
-
Z && Q && /* @__PURE__ */
|
|
162
|
-
id:
|
|
161
|
+
Z && Q && /* @__PURE__ */ g(s, {
|
|
162
|
+
id: S,
|
|
163
163
|
className: "pkt-header-global__search-toggle",
|
|
164
164
|
skin: "primary",
|
|
165
165
|
color: X ? void 0 : "yellow",
|
|
@@ -168,12 +168,12 @@ var _ = "pkt-header-global-menu", v = "pkt-header-global-menu-toggle", y = "pkt-
|
|
|
168
168
|
size: z ? "small" : "medium",
|
|
169
169
|
state: X ? "active" : "normal",
|
|
170
170
|
"aria-expanded": X,
|
|
171
|
-
"aria-controls":
|
|
171
|
+
"aria-controls": x,
|
|
172
172
|
onClick: () => U("search"),
|
|
173
173
|
children: q
|
|
174
174
|
}),
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
id:
|
|
175
|
+
/* @__PURE__ */ g(s, {
|
|
176
|
+
id: b,
|
|
177
177
|
className: "pkt-header-global__menu-toggle",
|
|
178
178
|
skin: Z ? "tertiary" : "secondary",
|
|
179
179
|
variant: Z ? "icon-only" : "icon-right",
|
|
@@ -181,26 +181,26 @@ var _ = "pkt-header-global-menu", v = "pkt-header-global-menu-toggle", y = "pkt-
|
|
|
181
181
|
size: B ? "small" : "medium",
|
|
182
182
|
state: J ? "active" : "normal",
|
|
183
183
|
"aria-expanded": J,
|
|
184
|
-
"aria-controls":
|
|
184
|
+
"aria-controls": y,
|
|
185
185
|
disabled: Re,
|
|
186
186
|
onClick: () => U("menu"),
|
|
187
187
|
children: Ie
|
|
188
188
|
}),
|
|
189
|
-
!Z &&
|
|
190
|
-
className: (0,
|
|
189
|
+
!Z && de && K && !O && /* @__PURE__ */ g("a", {
|
|
190
|
+
className: (0, v.default)("pkt-header-global__contact", "pkt-btn", "pkt-btn--secondary", "pkt-btn--label-only", B ? "pkt-btn--small" : "pkt-btn--medium"),
|
|
191
191
|
href: K.url,
|
|
192
|
-
children: /* @__PURE__ */
|
|
192
|
+
children: /* @__PURE__ */ g("span", {
|
|
193
193
|
className: "pkt-btn__text",
|
|
194
194
|
children: K.text
|
|
195
195
|
})
|
|
196
196
|
})
|
|
197
197
|
]
|
|
198
198
|
}),
|
|
199
|
-
|
|
199
|
+
O && /* @__PURE__ */ g("div", {
|
|
200
200
|
className: "pkt-header-global__user",
|
|
201
|
-
children: /* @__PURE__ */
|
|
202
|
-
className: (0,
|
|
203
|
-
children: [/* @__PURE__ */
|
|
201
|
+
children: /* @__PURE__ */ _("div", {
|
|
202
|
+
className: (0, v.default)("pkt-header-global__user-container", Y && "is-open"),
|
|
203
|
+
children: [/* @__PURE__ */ _(s, {
|
|
204
204
|
className: "pkt-header-global__user-button",
|
|
205
205
|
skin: "secondary",
|
|
206
206
|
size: B ? "small" : "medium",
|
|
@@ -209,79 +209,78 @@ var _ = "pkt-header-global-menu", v = "pkt-header-global-menu-toggle", y = "pkt-
|
|
|
209
209
|
iconName: "user",
|
|
210
210
|
secondIconName: Y ? "chevron-thin-up" : "chevron-thin-down",
|
|
211
211
|
onClick: () => U("user"),
|
|
212
|
-
children: [/* @__PURE__ */
|
|
212
|
+
children: [/* @__PURE__ */ _("span", {
|
|
213
213
|
className: "pkt-sr-only",
|
|
214
214
|
children: [W.userMenuButton, " "]
|
|
215
|
-
}), /* @__PURE__ */
|
|
215
|
+
}), /* @__PURE__ */ g("span", {
|
|
216
216
|
translate: "no",
|
|
217
|
-
children:
|
|
217
|
+
children: pe?.name || O.name
|
|
218
218
|
})]
|
|
219
|
-
}), Y && /* @__PURE__ */
|
|
219
|
+
}), Y && /* @__PURE__ */ g("div", {
|
|
220
220
|
className: "pkt-header-global__user-menu is-open",
|
|
221
|
-
children: /* @__PURE__ */
|
|
222
|
-
strings:
|
|
223
|
-
user:
|
|
221
|
+
children: /* @__PURE__ */ g(c, {
|
|
222
|
+
strings: N,
|
|
223
|
+
user: O,
|
|
224
224
|
formattedLastLoggedIn: Pe,
|
|
225
|
-
representing:
|
|
226
|
-
userMenu:
|
|
227
|
-
canChangeRepresentation:
|
|
228
|
-
changeRepresentation:
|
|
229
|
-
logoutOnClick: Fe ?
|
|
225
|
+
representing: pe,
|
|
226
|
+
userMenu: fe,
|
|
227
|
+
canChangeRepresentation: me,
|
|
228
|
+
changeRepresentation: he,
|
|
229
|
+
logoutOnClick: Fe ? _e : void 0
|
|
230
230
|
})
|
|
231
231
|
})]
|
|
232
232
|
})
|
|
233
233
|
})
|
|
234
234
|
]
|
|
235
|
-
}), Be = J && /* @__PURE__ */
|
|
236
|
-
className: (0,
|
|
237
|
-
id:
|
|
238
|
-
children: H ? /* @__PURE__ */
|
|
235
|
+
}), Be = J && /* @__PURE__ */ g("div", {
|
|
236
|
+
className: (0, v.default)("pkt-header-global__menu", z && "pkt-header-global__menu--mobile", B && !z && "pkt-header-global__menu--tablet"),
|
|
237
|
+
id: y,
|
|
238
|
+
children: H ? /* @__PURE__ */ g(ne, {
|
|
239
239
|
data: V,
|
|
240
|
-
locale:
|
|
240
|
+
locale: w,
|
|
241
241
|
open: !0,
|
|
242
|
-
mobileBreakpoint:
|
|
243
|
-
strings:
|
|
244
|
-
}) : /* @__PURE__ */
|
|
242
|
+
mobileBreakpoint: A,
|
|
243
|
+
strings: N
|
|
244
|
+
}) : /* @__PURE__ */ g("nav", {
|
|
245
245
|
className: "pkt-header-menu pkt-header-menu--open",
|
|
246
|
-
children: /* @__PURE__ */
|
|
246
|
+
children: /* @__PURE__ */ g("p", {
|
|
247
247
|
className: "pkt-header-menu__error",
|
|
248
248
|
children: W.menuLoadError
|
|
249
249
|
})
|
|
250
250
|
})
|
|
251
|
-
}), $ = X && Q && G && /* @__PURE__ */
|
|
252
|
-
className: (0,
|
|
253
|
-
id:
|
|
254
|
-
children: /* @__PURE__ */
|
|
251
|
+
}), $ = X && Q && G && /* @__PURE__ */ g("div", {
|
|
252
|
+
className: (0, v.default)("pkt-header-global__search-panel", z && "pkt-header-global__search-panel--mobile", B && !z && "pkt-header-global__search-panel--tablet"),
|
|
253
|
+
id: x,
|
|
254
|
+
children: /* @__PURE__ */ g("div", {
|
|
255
255
|
className: "pkt-header-global__search-panel-inner",
|
|
256
|
-
children: /* @__PURE__ */
|
|
256
|
+
children: /* @__PURE__ */ g(u, {
|
|
257
257
|
appearance: "global",
|
|
258
258
|
fullwidth: !0,
|
|
259
259
|
id: Le,
|
|
260
260
|
name: G.input.name,
|
|
261
261
|
"aria-label": q,
|
|
262
|
-
placeholder:
|
|
262
|
+
placeholder: D ?? G.input.placeholder,
|
|
263
263
|
action: G.endpoint,
|
|
264
264
|
method: "get",
|
|
265
|
-
onSearch:
|
|
265
|
+
onSearch: ue,
|
|
266
266
|
onChange: () => {},
|
|
267
267
|
autoFocus: !0
|
|
268
268
|
})
|
|
269
269
|
})
|
|
270
270
|
});
|
|
271
|
-
return Ee ? /* @__PURE__ */
|
|
271
|
+
return Ee ? /* @__PURE__ */ _("div", {
|
|
272
272
|
className: "pkt-header-global-wrapper",
|
|
273
273
|
children: [
|
|
274
274
|
ze,
|
|
275
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ g("div", { className: (0, v.default)("pkt-header-global-spacer", z && "pkt-header-global-spacer--mobile", B && !z && "pkt-header-global-spacer--tablet", O && "pkt-header-global-spacer--has-user") }),
|
|
276
276
|
$,
|
|
277
277
|
Be
|
|
278
278
|
]
|
|
279
|
-
}) : /* @__PURE__ */
|
|
279
|
+
}) : /* @__PURE__ */ _(oe, { children: [
|
|
280
280
|
ze,
|
|
281
281
|
$,
|
|
282
282
|
Be
|
|
283
283
|
] });
|
|
284
284
|
});
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
export { x as PktHeaderGlobal };
|
|
285
|
+
C.displayName = "PktHeaderGlobal";
|
|
286
|
+
export { C as PktHeaderGlobal };
|