@kakadu/components 6.3.9 → 6.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { type HTMLAttributeAnchorTarget, type ReactNode } from 'react';
|
|
1
|
+
import React, { type HTMLAttributeAnchorTarget, type MouseEventHandler, type ReactNode } from 'react';
|
|
2
2
|
import { type WrapperWidth } from './wrapper';
|
|
3
3
|
export declare const footerSections: readonly ["services", "results", "about", "compliance"];
|
|
4
4
|
export declare const footerSectionLinks: {
|
|
@@ -14,6 +14,7 @@ type BaseFooterLink = {
|
|
|
14
14
|
href: string;
|
|
15
15
|
rel?: string;
|
|
16
16
|
target?: HTMLAttributeAnchorTarget;
|
|
17
|
+
onClick?: MouseEventHandler<HTMLAnchorElement>;
|
|
17
18
|
};
|
|
18
19
|
export type FooterLink = false | (Partial<BaseFooterLink> & {
|
|
19
20
|
index?: number;
|
|
@@ -24,7 +25,7 @@ type KnownFooterSection<KnownLinks extends string = never> = false | {
|
|
|
24
25
|
links?: Partial<Record<KnownLinks, FooterLink>> & Record<string, FooterLink>;
|
|
25
26
|
};
|
|
26
27
|
type KnownFooterSections = {
|
|
27
|
-
[
|
|
28
|
+
[Key in FooterSection]?: Key extends FooterSectionLinks ? KnownFooterSection<(typeof footerSectionLinks)[Key][number]> : KnownFooterSection;
|
|
28
29
|
};
|
|
29
30
|
export type FooterSections = KnownFooterSections & Record<string, KnownFooterSection>;
|
|
30
31
|
export type FooterProperties = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("../jsx-runtime-BB_1_6y_.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("../jsx-runtime-BB_1_6y_.js"),w=require("react"),R=require("@kuma-ui/core"),S=require("../theme.js"),u=require("./flex.js"),k=require("./text.js"),N=require("./logos/kakadu-logo.js"),q=require("./aria-text.js"),P=require("./wrapper.js"),_="kakadu-components-975968984",x=["services","results","about","compliance"],b={services:["kakaduPlay","kakaduGuide","kakaduAcademy"],results:["press","articles"],about:["contact","home"],compliance:["privacyPolicy","ethicalGuidelines","status"]},C={services:{text:"Services",links:{kakaduPlay:{text:"Kakadu Play",href:"https://kakadu.no/veiledninger"},kakaduGuide:{text:"Kakadu Guide",href:"https://guide.kakadu.no"},kakaduAcademy:{text:"Kakadu Academy",href:"https://academy.kakadu.no"}}},results:{text:"Results",links:{press:{text:"Press",href:"https://kakadu.no/press"},articles:{text:"Articles",href:"https://kakadu.no/articles"}}},about:{text:"About",links:{contact:{text:"Contact us",href:"https://kakadu.no/contact"},home:{text:"Home",href:"https://kakadu.no"}}},compliance:{text:"Compliance",links:{privacyPolicy:{text:"Privacy policy",href:"https://kakadu.no/legal/privacy-policy"},ethicalGuidelines:{text:"Ethical guidelines",href:"https://kakadu.no/legal/ethical-guidelines"},status:{text:"Status",href:"https://kakadu.instatus.com",rel:"noopener noreferrer",target:"_blank"}}}};function d(t,i,r){if(r!==!1&&(r==null?void 0:r.index)!==void 0)return r.index;const e=i.indexOf(t);return e===-1?i.length+1:e+1}function E(t,i={},r=[]){var p,m,h,f,j;const e=new Set([...Object.keys(i),...Object.keys(t)]),o=[];for(const c of e){const n=t[c];if(n===!1)continue;const g=(n==null?void 0:n.text)??((p=i[c])==null?void 0:p.text),y=(n==null?void 0:n.href)??((m=i[c])==null?void 0:m.href);g===void 0||y===void 0||o.push({key:c,text:g,href:y,rel:(n==null?void 0:n.rel)??((h=i[c])==null?void 0:h.rel),target:(n==null?void 0:n.target)??((f=i[c])==null?void 0:f.target),onClick:(n==null?void 0:n.onClick)??((j=i[c])==null?void 0:j.onClick)})}const a=new Set(o.map(c=>c.key)),l=r.filter(c=>a.has(c));return o.toSorted((c,n)=>d(c.key,l,t[c.key])-d(n.key,l,t[n.key]))}function A(t){const i=x.filter(e=>(t==null?void 0:t[e])!==!1),r=[];for(const e of x){if((t==null?void 0:t[e])===!1)continue;const o=C[e],a=t==null?void 0:t[e];r.push({key:e,title:(a==null?void 0:a.text)??o.text,links:E((a==null?void 0:a.links)??{},o.links,b[e]),index:d(e,i,a)})}for(const[e,o]of Object.entries(t??{})){if(x.includes(e)||o===!1)continue;const a=E(o.links??{});a.length===0&&o.text===void 0||r.push({key:e,title:o.text??e,links:a,index:d(e,i,o)})}return r.toSorted((e,o)=>e.index-o.index)}function L({width:t="page",sections:i,attribution:r,className:e}){const o=w.useMemo(()=>A(i),[i]);return s.jsxRuntimeExports.jsxs(P.default,{as:"footer",gap:2,width:t,className:R.cx("kakadu-components-3130980543",e),children:[s.jsxRuntimeExports.jsxs(u.default,{wrap:!0,"data-theme":"dark",direction:"row",gap:4,className:R.cx(S.default,"kakadu-components-82784222"),children:[o.map(a=>a.links.length>0?s.jsxRuntimeExports.jsxs(u.default,{direction:"column",preset:"start",gap:.5,children:[s.jsxRuntimeExports.jsx(k.Paragraph,{children:s.jsxRuntimeExports.jsx("strong",{children:a.title})}),s.jsxRuntimeExports.jsx(k.Paragraph,{as:"ul",className:_,children:a.links.map(l=>s.jsxRuntimeExports.jsx("li",{children:s.jsxRuntimeExports.jsx("a",{href:l.href,rel:l.rel,target:l.target,onClick:l.onClick,children:l.text})},l.key))})]},a.key):null),s.jsxRuntimeExports.jsx(u.default,{fill:!0,className:"kakadu-components-3520395370",children:s.jsxRuntimeExports.jsx("a",{href:"https://businessnorway.com/companies/kakadu-ignite-as",target:"_blank",rel:"noopener noreferrer",className:"kakadu-components-3521477705",children:s.jsxRuntimeExports.jsx("img",{alt:"Made in Norway",src:"https://components.kakadu.no/images/made-in-norway.png",width:"76",height:"93",className:"kakadu-components-2329568054"})})})]}),s.jsxRuntimeExports.jsxs(u.default,{wrap:!0,"data-theme":"dark",direction:"row-reverse",gap:2,alignment:"flex-end",distribution:"space-between",className:S.default,children:[r?s.jsxRuntimeExports.jsx(k.Span,{className:"kakadu-components-1667529929",children:r}):null,s.jsxRuntimeExports.jsxs(u.default,{fill:!0,direction:"row",gap:1,alignment:"center",children:[s.jsxRuntimeExports.jsxs("a",{href:"https://kakadu.no",children:[s.jsxRuntimeExports.jsx(q.default,{children:"Kakadu"}),s.jsxRuntimeExports.jsx(N.default,{width:90,className:"kakadu-components-3103582715"})]}),s.jsxRuntimeExports.jsxs(k.Span,{className:"kakadu-components-250962410",children:["© ",new Date().getFullYear()," Kakadu Ignite AS"]})]})]})]})}exports.default=L;exports.footerSectionLinks=b;exports.footerSections=x;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { cx as
|
|
4
|
-
import
|
|
1
|
+
import { j as n } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
+
import { useMemo as P } from "react";
|
|
3
|
+
import { cx as j } from "@kuma-ui/core";
|
|
4
|
+
import S from "../theme.mjs";
|
|
5
5
|
import k from "./flex.mjs";
|
|
6
|
-
import { Paragraph as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
6
|
+
import { Paragraph as w, Span as b } from "./text.mjs";
|
|
7
|
+
import A from "./logos/kakadu-logo.mjs";
|
|
8
|
+
import C from "./aria-text.mjs";
|
|
9
9
|
import K from "./wrapper.mjs";
|
|
10
10
|
const G = "kakadu-components-975968984", d = ["services", "results", "about", "compliance"], L = {
|
|
11
11
|
services: ["kakaduPlay", "kakaduGuide", "kakaduAcademy"],
|
|
@@ -76,80 +76,81 @@ const G = "kakadu-components-975968984", d = ["services", "results", "about", "c
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
|
-
function u(
|
|
80
|
-
if (
|
|
81
|
-
return
|
|
82
|
-
const
|
|
83
|
-
return
|
|
79
|
+
function u(e, i, l) {
|
|
80
|
+
if (l !== !1 && (l == null ? void 0 : l.index) !== void 0)
|
|
81
|
+
return l.index;
|
|
82
|
+
const t = i.indexOf(e);
|
|
83
|
+
return t === -1 ? i.length + 1 : t + 1;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
var p, h, m, f;
|
|
87
|
-
const
|
|
88
|
-
for (const
|
|
89
|
-
const
|
|
90
|
-
if (
|
|
85
|
+
function N(e, i = {}, l = []) {
|
|
86
|
+
var p, h, m, f, x;
|
|
87
|
+
const t = /* @__PURE__ */ new Set([...Object.keys(i), ...Object.keys(e)]), o = [];
|
|
88
|
+
for (const c of t) {
|
|
89
|
+
const a = e[c];
|
|
90
|
+
if (a === !1)
|
|
91
91
|
continue;
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
key:
|
|
95
|
-
text:
|
|
96
|
-
href:
|
|
97
|
-
rel: (
|
|
98
|
-
target: (
|
|
92
|
+
const g = (a == null ? void 0 : a.text) ?? ((p = i[c]) == null ? void 0 : p.text), y = (a == null ? void 0 : a.href) ?? ((h = i[c]) == null ? void 0 : h.href);
|
|
93
|
+
g === void 0 || y === void 0 || o.push({
|
|
94
|
+
key: c,
|
|
95
|
+
text: g,
|
|
96
|
+
href: y,
|
|
97
|
+
rel: (a == null ? void 0 : a.rel) ?? ((m = i[c]) == null ? void 0 : m.rel),
|
|
98
|
+
target: (a == null ? void 0 : a.target) ?? ((f = i[c]) == null ? void 0 : f.target),
|
|
99
|
+
onClick: (a == null ? void 0 : a.onClick) ?? ((x = i[c]) == null ? void 0 : x.onClick)
|
|
99
100
|
});
|
|
100
101
|
}
|
|
101
|
-
const
|
|
102
|
-
return
|
|
102
|
+
const s = new Set(o.map((c) => c.key)), r = l.filter((c) => s.has(c));
|
|
103
|
+
return o.toSorted((c, a) => u(c.key, r, e[c.key]) - u(a.key, r, e[a.key]));
|
|
103
104
|
}
|
|
104
|
-
function F(
|
|
105
|
-
const
|
|
106
|
-
for (const
|
|
107
|
-
if ((
|
|
105
|
+
function F(e) {
|
|
106
|
+
const i = d.filter((t) => (e == null ? void 0 : e[t]) !== !1), l = [];
|
|
107
|
+
for (const t of d) {
|
|
108
|
+
if ((e == null ? void 0 : e[t]) === !1)
|
|
108
109
|
continue;
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
key:
|
|
112
|
-
title: (
|
|
113
|
-
links:
|
|
114
|
-
index: u(
|
|
110
|
+
const o = O[t], s = e == null ? void 0 : e[t];
|
|
111
|
+
l.push({
|
|
112
|
+
key: t,
|
|
113
|
+
title: (s == null ? void 0 : s.text) ?? o.text,
|
|
114
|
+
links: N((s == null ? void 0 : s.links) ?? {}, o.links, L[t]),
|
|
115
|
+
index: u(t, i, s)
|
|
115
116
|
});
|
|
116
117
|
}
|
|
117
|
-
for (const [
|
|
118
|
-
if (d.includes(
|
|
118
|
+
for (const [t, o] of Object.entries(e ?? {})) {
|
|
119
|
+
if (d.includes(t) || o === !1)
|
|
119
120
|
continue;
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
key:
|
|
123
|
-
title:
|
|
124
|
-
links:
|
|
125
|
-
index: u(
|
|
121
|
+
const s = N(o.links ?? {});
|
|
122
|
+
s.length === 0 && o.text === void 0 || l.push({
|
|
123
|
+
key: t,
|
|
124
|
+
title: o.text ?? t,
|
|
125
|
+
links: s,
|
|
126
|
+
index: u(t, i, o)
|
|
126
127
|
});
|
|
127
128
|
}
|
|
128
|
-
return
|
|
129
|
+
return l.toSorted((t, o) => t.index - o.index);
|
|
129
130
|
}
|
|
130
|
-
function
|
|
131
|
-
width:
|
|
132
|
-
sections:
|
|
133
|
-
attribution:
|
|
134
|
-
className:
|
|
131
|
+
function Y({
|
|
132
|
+
width: e = "page",
|
|
133
|
+
sections: i,
|
|
134
|
+
attribution: l,
|
|
135
|
+
className: t
|
|
135
136
|
}) {
|
|
136
|
-
const
|
|
137
|
-
return /* @__PURE__ */
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
-
/* @__PURE__ */
|
|
142
|
-
] },
|
|
143
|
-
/* @__PURE__ */
|
|
137
|
+
const o = P(() => F(i), [i]);
|
|
138
|
+
return /* @__PURE__ */ n.jsxs(K, { as: "footer", gap: 2, width: e, className: j("kakadu-components-3130980543", t), children: [
|
|
139
|
+
/* @__PURE__ */ n.jsxs(k, { wrap: !0, "data-theme": "dark", direction: "row", gap: 4, className: j(S, "kakadu-components-82784222"), children: [
|
|
140
|
+
o.map((s) => s.links.length > 0 ? /* @__PURE__ */ n.jsxs(k, { direction: "column", preset: "start", gap: 0.5, children: [
|
|
141
|
+
/* @__PURE__ */ n.jsx(w, { children: /* @__PURE__ */ n.jsx("strong", { children: s.title }) }),
|
|
142
|
+
/* @__PURE__ */ n.jsx(w, { as: "ul", className: G, children: s.links.map((r) => /* @__PURE__ */ n.jsx("li", { children: /* @__PURE__ */ n.jsx("a", { href: r.href, rel: r.rel, target: r.target, onClick: r.onClick, children: r.text }) }, r.key)) })
|
|
143
|
+
] }, s.key) : null),
|
|
144
|
+
/* @__PURE__ */ n.jsx(k, { fill: !0, className: "kakadu-components-3520395370", children: /* @__PURE__ */ n.jsx("a", { href: "https://businessnorway.com/companies/kakadu-ignite-as", target: "_blank", rel: "noopener noreferrer", className: "kakadu-components-3521477705", children: /* @__PURE__ */ n.jsx("img", { alt: "Made in Norway", src: "https://components.kakadu.no/images/made-in-norway.png", width: "76", height: "93", className: "kakadu-components-2329568054" }) }) })
|
|
144
145
|
] }),
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
|
|
147
|
-
/* @__PURE__ */
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ n.jsxs(k, { wrap: !0, "data-theme": "dark", direction: "row-reverse", gap: 2, alignment: "flex-end", distribution: "space-between", className: S, children: [
|
|
147
|
+
l ? /* @__PURE__ */ n.jsx(b, { className: "kakadu-components-1667529929", children: l }) : null,
|
|
148
|
+
/* @__PURE__ */ n.jsxs(k, { fill: !0, direction: "row", gap: 1, alignment: "center", children: [
|
|
149
|
+
/* @__PURE__ */ n.jsxs("a", { href: "https://kakadu.no", children: [
|
|
150
|
+
/* @__PURE__ */ n.jsx(C, { children: "Kakadu" }),
|
|
151
|
+
/* @__PURE__ */ n.jsx(A, { width: 90, className: "kakadu-components-3103582715" })
|
|
151
152
|
] }),
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ n.jsxs(b, { className: "kakadu-components-250962410", children: [
|
|
153
154
|
"© ",
|
|
154
155
|
(/* @__PURE__ */ new Date()).getFullYear(),
|
|
155
156
|
" Kakadu Ignite AS"
|
|
@@ -159,7 +160,7 @@ function W({
|
|
|
159
160
|
] });
|
|
160
161
|
}
|
|
161
162
|
export {
|
|
162
|
-
|
|
163
|
+
Y as default,
|
|
163
164
|
L as footerSectionLinks,
|
|
164
165
|
d as footerSections
|
|
165
166
|
};
|
|
@@ -11,7 +11,7 @@ export declare function useJsonFetcher<Type = unknown>(handler?: (json: unknown)
|
|
|
11
11
|
response: Type | undefined;
|
|
12
12
|
error: Error | undefined;
|
|
13
13
|
};
|
|
14
|
-
type FetchParameters = {
|
|
14
|
+
export type FetchParameters = {
|
|
15
15
|
/** The time to live for the cache in milliseconds.
|
|
16
16
|
* @default 30_000 */
|
|
17
17
|
cacheLifetime?: number;
|