@mrfylke/contact-form 0.1.5 → 0.1.7
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/README.md +17 -0
- package/lib/components/button/button.module.css +151 -139
- package/lib/components/checkbox/checkbox.module.css +40 -37
- package/lib/components/error-message/error-message.module.css +2 -2
- package/lib/components/external-link-page.module.css +15 -15
- package/lib/components/form/fieldset/fieldset.module.css +15 -15
- package/lib/components/form/form-component-label/form-component-label.module.css +4 -4
- package/lib/components/form/form.module.css +324 -308
- package/lib/components/loading/loading.module.css +9 -9
- package/lib/components/section-card/section-card.module.css +10 -10
- package/lib/contact.module.css +37 -36
- package/lib/error-content/error-content.module.css +7 -7
- package/lib/layouts/container.module.css +10 -10
- package/lib/layouts/layout.module.css +46 -45
- package/lib/modules/config/types.d.ts +2 -32
- package/lib/modules/config/types.d.ts.map +1 -1
- package/lib/modules/transport-mode/filter/filter.module.css +51 -49
- package/lib/modules/transport-mode/icon/icon.module.css +14 -14
- package/lib/success-content/success-content.module.css +7 -7
- package/lib/translations/modules/index.d.ts +0 -1
- package/lib/translations/modules/index.d.ts.map +1 -1
- package/lib/translations/modules/index.js +1 -3
- package/package.json +2 -3
- package/lib/layouts/contact-form-footer.d.ts +0 -5
- package/lib/layouts/contact-form-footer.d.ts.map +0 -1
- package/lib/layouts/contact-form-footer.js +0 -75
- package/lib/layouts/contact-form-header.d.ts +0 -9
- package/lib/layouts/contact-form-header.d.ts.map +0 -1
- package/lib/layouts/contact-form-header.js +0 -50
- package/lib/layouts/footer.module.css +0 -109
- package/lib/layouts/header.module.css +0 -39
- package/lib/translations/modules/layout.d.ts +0 -73
- package/lib/translations/modules/layout.d.ts.map +0 -1
- package/lib/translations/modules/layout.js +0 -106
- package/lib/utils/use-localstorage.d.ts +0 -2
- package/lib/utils/use-localstorage.d.ts.map +0 -1
- package/lib/utils/use-localstorage.js +0 -40
- package/lib/utils/user-media-query.d.ts +0 -2
- package/lib/utils/user-media-query.d.ts.map +0 -1
- package/lib/utils/user-media-query.js +0 -36
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Situation = exports.SearchTime =
|
|
4
|
-
var layout_1 = require("./layout");
|
|
5
|
-
Object.defineProperty(exports, "Layout", { enumerable: true, get: function () { return layout_1.Layout; } });
|
|
3
|
+
exports.Situation = exports.SearchTime = void 0;
|
|
6
4
|
var search_time_1 = require("./search-time");
|
|
7
5
|
Object.defineProperty(exports, "SearchTime", { enumerable: true, get: function () { return search_time_1.SearchTime; } });
|
|
8
6
|
var situation_1 = require("./situation");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrfylke/contact-form",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -45,8 +45,7 @@
|
|
|
45
45
|
"clean": "rm -rf lib",
|
|
46
46
|
"lint": "eslint \"src/**/*.{ts,tsx}\"",
|
|
47
47
|
"format": "prettier --write \"src/**/*.{ts,tsx,json,md}\"",
|
|
48
|
-
"format:check": "prettier --check \"src/**/*.{ts,tsx,json,md}\""
|
|
49
|
-
"publish": "npm publish --access public"
|
|
48
|
+
"format:check": "prettier --check \"src/**/*.{ts,tsx,json,md}\""
|
|
50
49
|
},
|
|
51
50
|
"devDependencies": {
|
|
52
51
|
"@graphql-codegen/cli": "^5.0.7",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contact-form-footer.d.ts","sourceRoot":"","sources":["../../src/layouts/contact-form-footer.tsx"],"names":[],"mappings":"AAYA,MAAM,MAAM,sBAAsB,GAAG;IACnC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAqBF,wBAAgB,iBAAiB,CAAC,EAChC,eAAuB,GACxB,EAAE,sBAAsB,2CAqPxB"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ContactFormFooter = ContactFormFooter;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const react_1 = __importDefault(require("react"));
|
|
9
|
-
const translations_1 = require("../translations");
|
|
10
|
-
const language_context_1 = require("../translations/language-context");
|
|
11
|
-
const theme_1 = require("../modules/theme");
|
|
12
|
-
const config_1 = require("../modules/config");
|
|
13
|
-
const footer_module_css_1 = __importDefault(require("./footer.module.css"));
|
|
14
|
-
function getAccentColor(theme) {
|
|
15
|
-
const accent = theme?.color?.background?.accent;
|
|
16
|
-
const accent4 = accent?.[4];
|
|
17
|
-
if (accent4?.foreground?.primary)
|
|
18
|
-
return accent4.foreground.primary;
|
|
19
|
-
const neutral = theme?.color?.background?.neutral;
|
|
20
|
-
return neutral?.[0]?.foreground?.primary ?? 'inherit';
|
|
21
|
-
}
|
|
22
|
-
function ContactFormFooter({ withoutSettings = false, }) {
|
|
23
|
-
const { t, language } = (0, translations_1.useTranslation)();
|
|
24
|
-
const { isDarkMode, toggleDarkmode, theme, isThemeForced } = (0, theme_1.useTheme)();
|
|
25
|
-
const { org, layout } = (0, config_1.useContactFormConfig)();
|
|
26
|
-
const { setLanguage } = (0, language_context_1.useLanguageSettings)();
|
|
27
|
-
const footerUrls = layout?.footerUrls;
|
|
28
|
-
const footerLinksOverride = layout?.footerLinksOverride;
|
|
29
|
-
const buttonStyle = {
|
|
30
|
-
color: getAccentColor(theme),
|
|
31
|
-
borderColor: getAccentColor(theme),
|
|
32
|
-
};
|
|
33
|
-
const basePath = layout?.basePath ?? '/contact';
|
|
34
|
-
const supportHref = footerUrls?.help ?? basePath;
|
|
35
|
-
// Group override links by section if section is provided
|
|
36
|
-
const groupedOverrideLinks = footerLinksOverride
|
|
37
|
-
? footerLinksOverride.reduce((acc, link) => {
|
|
38
|
-
const section = link.section || 'default';
|
|
39
|
-
if (!acc[section])
|
|
40
|
-
acc[section] = [];
|
|
41
|
-
acc[section].push(link);
|
|
42
|
-
return acc;
|
|
43
|
-
}, {})
|
|
44
|
-
: null;
|
|
45
|
-
return ((0, jsx_runtime_1.jsx)("footer", { className: footer_module_css_1.default.footer, children: (0, jsx_runtime_1.jsxs)("div", { className: footer_module_css_1.default.footer__content, children: [(0, jsx_runtime_1.jsxs)("div", { className: footer_module_css_1.default.footer__top, children: [footerLinksOverride ? (
|
|
46
|
-
// Render override links, grouped by section
|
|
47
|
-
Object.entries(groupedOverrideLinks).map(([sectionKey, links]) => ((0, jsx_runtime_1.jsxs)("section", { className: footer_module_css_1.default.footer__section, children: [sectionKey !== 'default' && ((0, jsx_runtime_1.jsx)("h3", { className: footer_module_css_1.default.footer__title, children: sectionKey })), (0, jsx_runtime_1.jsx)("ul", { className: footer_module_css_1.default.footer__linkList, children: links.map((link, index) => ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)("a", { href: link.href, target: "_blank", rel: "noreferrer", children: t(link.label) }) }, index))) })] }, sectionKey)))) : (
|
|
48
|
-
// Standard behavior: fixed sections
|
|
49
|
-
(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("section", { className: footer_module_css_1.default.footer__section, children: [(0, jsx_runtime_1.jsx)("h3", { className: footer_module_css_1.default.footer__title, children: t(translations_1.ModuleText.Layout.base.footer.sections.general.header) }), (0, jsx_runtime_1.jsx)("ul", { className: footer_module_css_1.default.footer__linkList, children: footerUrls?.tickets && ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)("a", { href: footerUrls.tickets, target: "_blank", rel: "noreferrer", children: t(translations_1.ModuleText.Layout.base.footer.sections.general
|
|
50
|
-
.ticketPricesPageLink) }) })) })] }), (0, jsx_runtime_1.jsxs)("section", { className: footer_module_css_1.default.footer__section, children: [(0, jsx_runtime_1.jsx)("h3", { className: footer_module_css_1.default.footer__title, children: t(translations_1.ModuleText.Layout.base.footer.sections.contact.header) }), (0, jsx_runtime_1.jsx)("ul", { className: footer_module_css_1.default.footer__linkList, children: (0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)("a", { href: supportHref, children: t(translations_1.ModuleText.Layout.base.footer.sections.general
|
|
51
|
-
.supportPageLink) }) }) })] })] })), !withoutSettings && ((0, jsx_runtime_1.jsxs)("section", { className: footer_module_css_1.default.footer__section, children: [(0, jsx_runtime_1.jsx)("h3", { className: footer_module_css_1.default.footer__title, children: t(!isThemeForced
|
|
52
|
-
? translations_1.ModuleText.Layout.base.footer.sections.settings.header
|
|
53
|
-
: translations_1.ModuleText.Layout.base.footer.sections.settings
|
|
54
|
-
.forcedThemeHeader) }), (0, jsx_runtime_1.jsxs)("ul", { className: footer_module_css_1.default.footer__linkList, children: [language !== translations_1.Language.Norwegian && ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)("button", { className: footer_module_css_1.default.buttonLink, onClick: () => setLanguage(translations_1.Language.Norwegian), style: buttonStyle, children: t(translations_1.ModuleText.Layout.base.footer.sections.settings
|
|
55
|
-
.setLanguage.norsk) }) })), language !== translations_1.Language.English && ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)("button", { className: footer_module_css_1.default.buttonLink, onClick: () => setLanguage(translations_1.Language.English), style: buttonStyle, children: t(translations_1.ModuleText.Layout.base.footer.sections.settings
|
|
56
|
-
.setLanguage.english) }) })), language !== translations_1.Language.Nynorsk && ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)("button", { className: footer_module_css_1.default.buttonLink, onClick: () => setLanguage(translations_1.Language.Nynorsk), style: buttonStyle, children: t(translations_1.ModuleText.Layout.base.footer.sections.settings
|
|
57
|
-
.setLanguage.nynorsk) }) })), !isThemeForced && ((0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)("button", { className: footer_module_css_1.default.buttonLink, style: buttonStyle, onClick: () => toggleDarkmode(!isDarkMode), children: isDarkMode
|
|
58
|
-
? t(translations_1.ModuleText.Layout.base.footer.sections.settings
|
|
59
|
-
.toggleLightMode)
|
|
60
|
-
: t(translations_1.ModuleText.Layout.base.footer.sections.settings
|
|
61
|
-
.toggleDarkMode) }) }))] }), (0, jsx_runtime_1.jsx)("p", { className: footer_module_css_1.default.footer__cookieWarning, children: t(!isThemeForced
|
|
62
|
-
? translations_1.ModuleText.Layout.base.footer.sections.settings
|
|
63
|
-
.cookiesWarning
|
|
64
|
-
: translations_1.ModuleText.Layout.base.footer.sections.settings
|
|
65
|
-
.languageCookiesWarning) })] }))] }), (0, jsx_runtime_1.jsx)("hr", {}), (0, jsx_runtime_1.jsxs)("section", { className: footer_module_css_1.default.footer__bottomLinks, children: [footerLinksOverride
|
|
66
|
-
? // When override is set, bottom links come from override (filter by section if needed)
|
|
67
|
-
// For now, render all override links that don't have a section or have section='bottom'
|
|
68
|
-
(() => {
|
|
69
|
-
const bottomLinks = footerLinksOverride.filter((link) => !link.section || link.section === 'bottom');
|
|
70
|
-
return (bottomLinks.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: footer_module_css_1.default.footer__bottomLinks__mid, children: bottomLinks.map((link, index) => ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [index > 0 && (0, jsx_runtime_1.jsx)("span", { "aria-hidden": "true", children: "\u2022" }), (0, jsx_runtime_1.jsx)("a", { href: link.href, target: "_blank", rel: "noreferrer", children: t(link.label) })] }, index))) })));
|
|
71
|
-
})()
|
|
72
|
-
: // Standard behavior: privacy and accessibility from footerUrls
|
|
73
|
-
(footerUrls?.privacy || footerUrls?.accessibility) && ((0, jsx_runtime_1.jsxs)("div", { className: footer_module_css_1.default.footer__bottomLinks__mid, children: [footerUrls?.privacy && ((0, jsx_runtime_1.jsx)("a", { href: footerUrls.privacy, target: "_blank", rel: "noreferrer", children: t(translations_1.ModuleText.Layout.base.footer.bottomLinks.privacy) })), footerUrls?.privacy && footerUrls?.accessibility && ((0, jsx_runtime_1.jsx)("span", { "aria-hidden": "true", children: "\u2022" })), footerUrls?.accessibility && ((0, jsx_runtime_1.jsx)("a", { href: footerUrls.accessibility, target: "_blank", rel: "noreferrer", children: t(translations_1.ModuleText.Layout.base.footer.bottomLinks
|
|
74
|
-
.accessibilityStatement) }))] })), org.logo && ((0, jsx_runtime_1.jsx)("img", { className: footer_module_css_1.default.footer__orgLogo, src: org.logo.accentBar ?? org.logo.srcDark ?? org.logo.src, alt: org.logo.alt }))] })] }) }));
|
|
75
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export type ContactFormHeaderProps = {
|
|
2
|
-
/** Override home page URL for the "Go to X" button. Uses layout.footerUrls.homePage when not set. */
|
|
3
|
-
homeUrl?: {
|
|
4
|
-
href: string;
|
|
5
|
-
name: string;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
export declare function ContactFormHeader({ homeUrl }: ContactFormHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
//# sourceMappingURL=contact-form-header.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contact-form-header.d.ts","sourceRoot":"","sources":["../../src/layouts/contact-form-header.tsx"],"names":[],"mappings":"AASA,MAAM,MAAM,sBAAsB,GAAG;IACnC,qGAAqG;IACrG,OAAO,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAC1C,CAAC;AA0BF,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE,sBAAsB,2CA2DpE"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ContactFormHeader = ContactFormHeader;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const link_1 = __importDefault(require("next/link"));
|
|
9
|
-
const translations_1 = require("../translations");
|
|
10
|
-
const config_1 = require("../modules/config");
|
|
11
|
-
const theme_1 = require("../modules/theme");
|
|
12
|
-
const button_1 = require("../components/button");
|
|
13
|
-
const translations_2 = require("../translations");
|
|
14
|
-
const header_module_css_1 = __importDefault(require("./header.module.css"));
|
|
15
|
-
function getAccentContrastColor(theme) {
|
|
16
|
-
const accent = theme?.color?.background?.accent;
|
|
17
|
-
const accent4 = accent?.[4];
|
|
18
|
-
if (accent4 && typeof accent4 === 'object' && 'foreground' in accent4) {
|
|
19
|
-
const fg = accent4.foreground
|
|
20
|
-
?.primary;
|
|
21
|
-
if (fg) {
|
|
22
|
-
return {
|
|
23
|
-
background: accent4.background ?? 'transparent',
|
|
24
|
-
foreground: { primary: fg, secondary: fg, disabled: fg },
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return {
|
|
29
|
-
background: 'transparent',
|
|
30
|
-
foreground: {
|
|
31
|
-
primary: 'currentColor',
|
|
32
|
-
secondary: 'currentColor',
|
|
33
|
-
disabled: 'currentColor',
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
function ContactFormHeader({ homeUrl }) {
|
|
38
|
-
const { t } = (0, translations_1.useTranslation)();
|
|
39
|
-
const { org, layout } = (0, config_1.useContactFormConfig)();
|
|
40
|
-
const { theme } = (0, theme_1.useTheme)();
|
|
41
|
-
const accentColor = getAccentContrastColor(theme);
|
|
42
|
-
// Use override links if provided, otherwise fall back to standard behavior
|
|
43
|
-
const headerLinks = layout?.headerLinksOverride;
|
|
44
|
-
const standardHome = homeUrl ?? layout?.footerUrls?.homePage;
|
|
45
|
-
return ((0, jsx_runtime_1.jsx)("header", { className: header_module_css_1.default.pageHeader, children: (0, jsx_runtime_1.jsxs)("div", { className: header_module_css_1.default.pageHeader__content, children: [(0, jsx_runtime_1.jsx)("h1", { className: header_module_css_1.default.pageHeader__logo, children: (0, jsx_runtime_1.jsx)(link_1.default, { href: layout?.basePath ?? '/contact', className: header_module_css_1.default.pageHeader__logoLink, "data-testid": "homeButton", children: org.logo ? ((0, jsx_runtime_1.jsx)("img", { className: header_module_css_1.default.pageHeader__logoImg, src: org.logo.accentBar ?? org.logo.srcDark ?? org.logo.src, alt: org.logo.alt })) : ((0, jsx_runtime_1.jsx)("span", { children: org.name })) }) }), headerLinks
|
|
46
|
-
? // Render override links
|
|
47
|
-
headerLinks.map((link, index) => ((0, jsx_runtime_1.jsx)(button_1.ButtonLink, { href: link.href, title: t(link.label), mode: "secondary", backgroundColor: accentColor, radiusSize: "circular", size: "pill", aProps: { target: '_blank', rel: 'noreferrer' } }, index)))
|
|
48
|
-
: // Standard behavior: single optional home link
|
|
49
|
-
standardHome && ((0, jsx_runtime_1.jsx)(button_1.ButtonLink, { href: standardHome.href, title: t(translations_2.CommonText.Layout.homeLink(standardHome.name)), mode: "secondary", backgroundColor: accentColor, radiusSize: "circular", size: "pill", aProps: { target: '_blank', rel: 'noreferrer' } }))] }) }));
|
|
50
|
-
}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
.footer {
|
|
2
|
-
background-color: token('color.background.accent.4.background');
|
|
3
|
-
color: token('color.background.accent.4.foreground.primary');
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.footer__content {
|
|
7
|
-
margin: 0 auto;
|
|
8
|
-
padding: token('spacing.large');
|
|
9
|
-
max-width: var(--maxPageWidth, 976px);
|
|
10
|
-
box-sizing: border-box;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.footer__top {
|
|
14
|
-
display: grid;
|
|
15
|
-
gap: token('spacing.xLarge');
|
|
16
|
-
grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.footer__content hr {
|
|
20
|
-
border: 0;
|
|
21
|
-
border-bottom: token('border.width.slim') solid token('color.background.accent.4.foreground.primary');
|
|
22
|
-
margin: token('spacing.xLarge') 0;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.footer__title {
|
|
26
|
-
margin-bottom: token('spacing.small');
|
|
27
|
-
font-size: 1rem;
|
|
28
|
-
font-weight: 600;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.footer__section {
|
|
32
|
-
padding: token('spacing.medium') 0;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.footer__linkList {
|
|
36
|
-
list-style-type: none;
|
|
37
|
-
margin: 0;
|
|
38
|
-
padding: 0;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.footer__linkList li {
|
|
42
|
-
margin-bottom: token('spacing.small');
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.footer a {
|
|
46
|
-
text-decoration: none;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.footer a,
|
|
50
|
-
.footer a:visited {
|
|
51
|
-
transition: opacity 100ms ease-in;
|
|
52
|
-
color: token('color.background.accent.4.foreground.primary');
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.footer a:hover {
|
|
56
|
-
opacity: 0.75;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.footer__bottomLinks {
|
|
60
|
-
width: 100%;
|
|
61
|
-
display: flex;
|
|
62
|
-
justify-content: space-between;
|
|
63
|
-
align-items: center;
|
|
64
|
-
gap: token('spacing.medium');
|
|
65
|
-
flex-wrap: wrap;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.footer__bottomLinks > div:only-child {
|
|
69
|
-
margin: 0 auto;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.footer__bottomLinks__mid {
|
|
73
|
-
text-align: center;
|
|
74
|
-
display: flex;
|
|
75
|
-
gap: token('spacing.medium');
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.footer__cookieWarning {
|
|
79
|
-
margin-top: token('spacing.medium');
|
|
80
|
-
font-size: 0.875rem;
|
|
81
|
-
color: token('color.background.accent.4.foreground.primary');
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.buttonLink {
|
|
85
|
-
color: token('color.background.accent.4.foreground.primary');
|
|
86
|
-
font-size: 1rem;
|
|
87
|
-
background-color: transparent;
|
|
88
|
-
border: 0;
|
|
89
|
-
cursor: pointer;
|
|
90
|
-
transition: opacity 100ms ease-in;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.buttonLink:hover {
|
|
94
|
-
opacity: 0.75;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.footer__orgLogo {
|
|
98
|
-
height: 2.5rem;
|
|
99
|
-
width: auto;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
@media (max-width: 650px) {
|
|
103
|
-
.footer__bottomLinks {
|
|
104
|
-
justify-content: center;
|
|
105
|
-
align-items: center;
|
|
106
|
-
flex-direction: column;
|
|
107
|
-
gap: token('spacing.xLarge');
|
|
108
|
-
}
|
|
109
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
.pageHeader {
|
|
2
|
-
background-color: token('color.background.accent.4.background');
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.pageHeader__content {
|
|
6
|
-
width: 100%;
|
|
7
|
-
max-width: var(--maxPageWidth, 976px);
|
|
8
|
-
margin: 0 auto;
|
|
9
|
-
padding: token('spacing.medium');
|
|
10
|
-
display: flex;
|
|
11
|
-
align-items: center;
|
|
12
|
-
justify-content: space-between;
|
|
13
|
-
box-sizing: border-box;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.pageHeader__logo {
|
|
17
|
-
margin: 0;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.pageHeader__logoLink {
|
|
21
|
-
display: flex;
|
|
22
|
-
align-items: center;
|
|
23
|
-
gap: token('spacing.medium');
|
|
24
|
-
padding: token('spacing.medium');
|
|
25
|
-
padding-left: 0;
|
|
26
|
-
color: token('color.background.accent.4.foreground.primary');
|
|
27
|
-
text-decoration: none;
|
|
28
|
-
transition: opacity 200ms ease-in-out;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.pageHeader__logoLink:hover,
|
|
32
|
-
.pageHeader__logoLink:active {
|
|
33
|
-
opacity: 0.8;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.pageHeader__logoImg {
|
|
37
|
-
height: 2rem;
|
|
38
|
-
width: auto;
|
|
39
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
export declare const LayoutInternal: {
|
|
2
|
-
base: {
|
|
3
|
-
footer: {
|
|
4
|
-
sections: {
|
|
5
|
-
general: {
|
|
6
|
-
header: import("../../translations/commons").TranslatedString;
|
|
7
|
-
supportPageLink: import("../../translations/commons").TranslatedString;
|
|
8
|
-
helpPageLink: import("../../translations/commons").TranslatedString;
|
|
9
|
-
ticketPricesPageLink: import("../../translations/commons").TranslatedString;
|
|
10
|
-
};
|
|
11
|
-
contact: {
|
|
12
|
-
header: import("../../translations/commons").TranslatedString;
|
|
13
|
-
contactLink: import("../../translations/commons").TranslatedString;
|
|
14
|
-
};
|
|
15
|
-
settings: {
|
|
16
|
-
header: import("../../translations/commons").TranslatedString;
|
|
17
|
-
forcedThemeHeader: import("../../translations/commons").TranslatedString;
|
|
18
|
-
setLanguage: {
|
|
19
|
-
norsk: import("../../translations/commons").TranslatedString;
|
|
20
|
-
english: import("../../translations/commons").TranslatedString;
|
|
21
|
-
nynorsk: import("../../translations/commons").TranslatedString;
|
|
22
|
-
};
|
|
23
|
-
toggleDarkMode: import("../../translations/commons").TranslatedString;
|
|
24
|
-
toggleLightMode: import("../../translations/commons").TranslatedString;
|
|
25
|
-
cookiesWarning: import("../../translations/commons").TranslatedString;
|
|
26
|
-
languageCookiesWarning: import("../../translations/commons").TranslatedString;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
bottomLinks: {
|
|
30
|
-
privacy: import("../../translations/commons").TranslatedString;
|
|
31
|
-
accessibilityStatement: import("../../translations/commons").TranslatedString;
|
|
32
|
-
termsOfUse: import("../../translations/commons").TranslatedString;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
export declare const Layout: {
|
|
38
|
-
base: {
|
|
39
|
-
footer: {
|
|
40
|
-
sections: {
|
|
41
|
-
general: {
|
|
42
|
-
header: import("../../translations/commons").TranslatedString;
|
|
43
|
-
supportPageLink: import("../../translations/commons").TranslatedString;
|
|
44
|
-
helpPageLink: import("../../translations/commons").TranslatedString;
|
|
45
|
-
ticketPricesPageLink: import("../../translations/commons").TranslatedString;
|
|
46
|
-
};
|
|
47
|
-
contact: {
|
|
48
|
-
header: import("../../translations/commons").TranslatedString;
|
|
49
|
-
contactLink: import("../../translations/commons").TranslatedString;
|
|
50
|
-
};
|
|
51
|
-
settings: {
|
|
52
|
-
header: import("../../translations/commons").TranslatedString;
|
|
53
|
-
forcedThemeHeader: import("../../translations/commons").TranslatedString;
|
|
54
|
-
setLanguage: {
|
|
55
|
-
norsk: import("../../translations/commons").TranslatedString;
|
|
56
|
-
english: import("../../translations/commons").TranslatedString;
|
|
57
|
-
nynorsk: import("../../translations/commons").TranslatedString;
|
|
58
|
-
};
|
|
59
|
-
toggleDarkMode: import("../../translations/commons").TranslatedString;
|
|
60
|
-
toggleLightMode: import("../../translations/commons").TranslatedString;
|
|
61
|
-
cookiesWarning: import("../../translations/commons").TranslatedString;
|
|
62
|
-
languageCookiesWarning: import("../../translations/commons").TranslatedString;
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
bottomLinks: {
|
|
66
|
-
privacy: import("../../translations/commons").TranslatedString;
|
|
67
|
-
accessibilityStatement: import("../../translations/commons").TranslatedString;
|
|
68
|
-
termsOfUse: import("../../translations/commons").TranslatedString;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/translations/modules/layout.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmF1B,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwFjB,CAAC"}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Layout = exports.LayoutInternal = void 0;
|
|
4
|
-
const commons_1 = require("../../translations/commons");
|
|
5
|
-
const utils_1 = require("../utils");
|
|
6
|
-
exports.LayoutInternal = {
|
|
7
|
-
base: {
|
|
8
|
-
footer: {
|
|
9
|
-
sections: {
|
|
10
|
-
general: {
|
|
11
|
-
header: (0, commons_1.translation)('Reiseplanlegger', 'Travel Planner', 'Reiseplanleggar'),
|
|
12
|
-
supportPageLink: (0, commons_1.translation)('Hjelp og kontakt', 'Help and contact', 'Hjelp og kontakt'),
|
|
13
|
-
helpPageLink: (0, commons_1.translation)('Hjelp til reiseplanleggeren', 'Help for the travel planner', 'Hjelp for reiseplanleggaren'),
|
|
14
|
-
ticketPricesPageLink: (0, commons_1.translation)('Billetter og priser', 'Tickets and prices', 'Billettar og prisar'),
|
|
15
|
-
},
|
|
16
|
-
contact: {
|
|
17
|
-
header: (0, commons_1.translation)('Kontakt AtB', 'Contact AtB', 'Kontakt AtB'),
|
|
18
|
-
contactLink: (0, commons_1.translation)('Kontakt AtB', 'Contact AtB', 'Kontakt AtB'),
|
|
19
|
-
},
|
|
20
|
-
settings: {
|
|
21
|
-
header: (0, commons_1.translation)('Språk og utseende', 'Language and appearance', 'Språk og utsjånad'),
|
|
22
|
-
forcedThemeHeader: (0, commons_1.translation)('Språk', 'Language', 'Språk'),
|
|
23
|
-
setLanguage: {
|
|
24
|
-
norsk: (0, commons_1.translation)('Endre til norsk (bokmål)', 'Endre til norsk (bokmål)', 'Endre til norsk (bokmål)'),
|
|
25
|
-
english: (0, commons_1.translation)('Switch to English', 'Switch to English', 'Switch to English'),
|
|
26
|
-
nynorsk: (0, commons_1.translation)('Endre til norsk (nynorsk)', 'Endre til norsk (nynorsk)', 'Endre til norsk (nynorsk)'),
|
|
27
|
-
},
|
|
28
|
-
toggleDarkMode: (0, commons_1.translation)('Bytt til mørkt utseende', 'Change to dark mode', 'Byt til mørk utsjånad'),
|
|
29
|
-
toggleLightMode: (0, commons_1.translation)('Bytt til lyst utseende', 'Change to light mode', 'Byt til lys utsjånad'),
|
|
30
|
-
cookiesWarning: (0, commons_1.translation)('* Overstyring av språk og utseende krever bruk av cookies.', '* Overriding language and appearance requires cookies.', '* Overstyring av språk og utsjånad krev bruk av cookies.'),
|
|
31
|
-
languageCookiesWarning: (0, commons_1.translation)('* Overstyring av språk krever bruk av cookies.', '* Overriding language requires cookies.', '* Overstyring av språk krev bruk av cookies.'),
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
bottomLinks: {
|
|
35
|
-
privacy: (0, commons_1.translation)('Personvern', 'Privacy', 'Personvern'),
|
|
36
|
-
accessibilityStatement: (0, commons_1.translation)('Tilgjengelighetserklæring', 'Accessibility statement', 'Tilgjengelegheitserklæring'),
|
|
37
|
-
termsOfUse: (0, commons_1.translation)('Bruksvilkår', 'Terms of use', 'Bruksvilkår'),
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
exports.Layout = (0, utils_1.orgSpecificTranslations)(exports.LayoutInternal, {
|
|
43
|
-
nfk: {
|
|
44
|
-
base: {
|
|
45
|
-
footer: {
|
|
46
|
-
sections: {
|
|
47
|
-
contact: {
|
|
48
|
-
header: (0, commons_1.translation)('Kontakt Reis Nordland', 'Contact Reis Nordland', 'Kontakt Reis Nordland'),
|
|
49
|
-
contactLink: (0, commons_1.translation)('Kontakt Reis Nordland', 'Contact Reis Nordland', 'Kontakt Reis Nordland'),
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
fram: {
|
|
56
|
-
base: {
|
|
57
|
-
footer: {
|
|
58
|
-
sections: {
|
|
59
|
-
contact: {
|
|
60
|
-
header: (0, commons_1.translation)('Kontakt', 'Contact', 'Kontakt'),
|
|
61
|
-
contactLink: (0, commons_1.translation)('Kontakt FRAM', 'Contact FRAM', 'Kontakt FRAM'),
|
|
62
|
-
},
|
|
63
|
-
general: {
|
|
64
|
-
supportPageLink: (0, commons_1.translation)('Kontaktskjema', 'Contact form', 'Kontaktskjema'),
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
troms: {
|
|
71
|
-
base: {
|
|
72
|
-
footer: {
|
|
73
|
-
sections: {
|
|
74
|
-
contact: {
|
|
75
|
-
header: (0, commons_1.translation)('Kontakt Svipper', 'Contact Svipper', 'Kontakt Svipper'),
|
|
76
|
-
contactLink: (0, commons_1.translation)('Kontakt Svipper', 'Contact Svipper', 'Kontakt Svipper'),
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
vkt: {
|
|
83
|
-
base: {
|
|
84
|
-
footer: {
|
|
85
|
-
sections: {
|
|
86
|
-
contact: {
|
|
87
|
-
header: (0, commons_1.translation)('Kontakt Vestfold Kollektivtrafikk', 'Contact Vestfold Kollektivtrafikk', 'Kontakt Vestfold Kollektivtrafikk'),
|
|
88
|
-
contactLink: (0, commons_1.translation)('Kontakt Vestfold Kollektivtrafikk', 'Contact Vestfold Kollektivtrafikk', 'Kontakt Vestfold Kollektivtrafikk'),
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
farte: {
|
|
95
|
-
base: {
|
|
96
|
-
footer: {
|
|
97
|
-
sections: {
|
|
98
|
-
contact: {
|
|
99
|
-
header: (0, commons_1.translation)('Kontakt Farte', 'Contact Farte', 'Kontakt Farte'),
|
|
100
|
-
contactLink: (0, commons_1.translation)('Kontakt Farte', 'Contact Farte', 'Kontakt Farte'),
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-localstorage.d.ts","sourceRoot":"","sources":["../../src/utils/use-localstorage.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,CAAC,EACvC,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,CAAC,GACd,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,CAqCzB"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = useLocalStorage;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
function useLocalStorage(key, initialValue) {
|
|
6
|
-
const [storedValue, setStoredValue] = (0, react_1.useState)(() => {
|
|
7
|
-
if (typeof window === 'undefined') {
|
|
8
|
-
return initialValue;
|
|
9
|
-
}
|
|
10
|
-
try {
|
|
11
|
-
// Get from local storage by key
|
|
12
|
-
const item = window.localStorage.getItem(key);
|
|
13
|
-
// Parse stored json or if none return initialValue
|
|
14
|
-
return item ? JSON.parse(item) : initialValue;
|
|
15
|
-
}
|
|
16
|
-
catch (error) {
|
|
17
|
-
// If error also return initialValue
|
|
18
|
-
console.log(error);
|
|
19
|
-
return initialValue;
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
// Return a wrapped version of useState's setter function that ...
|
|
23
|
-
// ... persists the new value to localStorage.
|
|
24
|
-
const setValue = (0, react_1.useCallback)((value) => {
|
|
25
|
-
try {
|
|
26
|
-
// Allow value to be a function so we have same API as useState
|
|
27
|
-
const valueToStore = value instanceof Function ? value(storedValue) : value;
|
|
28
|
-
// Save state
|
|
29
|
-
setStoredValue(valueToStore);
|
|
30
|
-
// Save to local storage
|
|
31
|
-
if (typeof window !== 'undefined') {
|
|
32
|
-
window.localStorage.setItem(key, JSON.stringify(valueToStore));
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
catch (error) {
|
|
36
|
-
console.log(error);
|
|
37
|
-
}
|
|
38
|
-
}, [key, storedValue]);
|
|
39
|
-
return [storedValue, setValue];
|
|
40
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user-media-query.d.ts","sourceRoot":"","sources":["../../src/utils/user-media-query.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,UAAU,EAAE,MAAM,WAkBvD"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = useMediaQuery;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
function useMediaQuery(mediaQuery) {
|
|
6
|
-
const [isMatched, setMatched] = (0, react_1.useState)(() => {
|
|
7
|
-
if (!hasWindow())
|
|
8
|
-
return false;
|
|
9
|
-
return Boolean(window.matchMedia(mediaQuery).matches);
|
|
10
|
-
});
|
|
11
|
-
(0, react_1.useEffect)(() => {
|
|
12
|
-
if (!hasWindow())
|
|
13
|
-
return;
|
|
14
|
-
const mediaQueryList = window.matchMedia(mediaQuery);
|
|
15
|
-
const documentChangeHandler = () => setMatched(Boolean(mediaQueryList.matches));
|
|
16
|
-
listenTo(mediaQueryList, documentChangeHandler);
|
|
17
|
-
documentChangeHandler();
|
|
18
|
-
return () => removeListener(mediaQueryList, documentChangeHandler);
|
|
19
|
-
}, [mediaQuery]);
|
|
20
|
-
return isMatched;
|
|
21
|
-
}
|
|
22
|
-
function hasWindow() {
|
|
23
|
-
return typeof window !== 'undefined';
|
|
24
|
-
}
|
|
25
|
-
function listenTo(matcher, cb) {
|
|
26
|
-
if ('addEventListener' in matcher) {
|
|
27
|
-
return matcher.addEventListener('change', cb);
|
|
28
|
-
}
|
|
29
|
-
return matcher.addListener(cb);
|
|
30
|
-
}
|
|
31
|
-
function removeListener(matcher, cb) {
|
|
32
|
-
if ('removeEventListener' in matcher) {
|
|
33
|
-
return matcher.removeEventListener('change', cb);
|
|
34
|
-
}
|
|
35
|
-
return matcher.removeListener(cb);
|
|
36
|
-
}
|