@kakadu/components 6.0.3 → 6.1.1

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 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("../jsx-runtime-BB_1_6y_.js"),E=require("react"),y=require("@kuma-ui/core"),b=require("../theme.js"),l=require("./flex.js"),k=require("./text.js"),w=require("./logos/kakadu-logo.js"),q=require("./aria-text.js"),N=require("./wrapper.js"),_="kakadu-components-975968984",x=["services","results","about","compliance"],R={services:["kakaduGuide","kakaduPlay"],results:["caseStudies","impactMeasurement"],about:["ourStory","contact"],compliance:["privacyPolicy","ethicalGuidelines","status"]},P={services:{text:"Services",links:{kakaduGuide:{text:"Kakadu Guide",href:"https://guide.kakadu.no"},kakaduPlay:{text:"Kakadu Play",href:"https://play.kakadu.no"}}},results:{text:"Results",links:{caseStudies:{text:"Case studies",href:"https://utforsk.kakadu.no/case-studies"},impactMeasurement:{text:"Impact measurement",href:"https://utforsk.kakadu.no/impact-measurement"}}},about:{text:"About us",links:{ourStory:{text:"Our story",href:"https://utforsk.kakadu.no/our-story"},contact:{text:"Contact",href:"https://utforsk.kakadu.no/kontakt-oss"}}},compliance:{text:"Compliance",links:{privacyPolicy:{text:"Privacy policy",href:"https://utforsk.kakadu.no/personvernerklaering"},ethicalGuidelines:{text:"Ethical guidelines",href:"https://utforsk.kakadu.no/etiske-retningslinjer"},status:{text:"Status",href:"https://kakadu.instatus.com",rel:"noopener noreferrer",target:"_blank"}}}};function p(e,r,u){if(u!==!1&&(u==null?void 0:u.index)!==void 0)return u.index;const t=r.indexOf(e);return t===-1?r.length+1:t+1}function S(e,r={},u=[]){var d,m,f,h;const t=new Set([...Object.keys(r),...Object.keys(e)]),a=[];for(const i of t){const o=e[i];if(o===!1)continue;const j=(o==null?void 0:o.text)??((d=r[i])==null?void 0:d.text),g=(o==null?void 0:o.href)??((m=r[i])==null?void 0:m.href);j===void 0||g===void 0||a.push({key:i,text:j,href:g,rel:(o==null?void 0:o.rel)??((f=r[i])==null?void 0:f.rel),target:(o==null?void 0:o.target)??((h=r[i])==null?void 0:h.target)})}const n=new Set(a.map(i=>i.key)),c=u.filter(i=>n.has(i));return a.toSorted((i,o)=>p(i.key,c,e[i.key])-p(o.key,c,e[o.key]))}function L(e){const r=x.filter(t=>(e==null?void 0:e[t])!==!1),u=[];for(const t of x){if((e==null?void 0:e[t])===!1)continue;const a=P[t],n=e==null?void 0:e[t];u.push({key:t,title:(n==null?void 0:n.text)??a.text,links:S((n==null?void 0:n.links)??{},a.links,R[t]),index:p(t,r,n)})}for(const[t,a]of Object.entries(e??{})){if(x.includes(t)||a===!1)continue;const n=S(a.links??{});n.length===0&&a.text===void 0||u.push({key:t,title:a.text??t,links:n,index:p(t,r,a)})}return u.toSorted((t,a)=>t.index-a.index)}function M({width:e="page",sections:r,attribution:u,className:t}){const a=E.useMemo(()=>L(r),[r]);return s.jsxRuntimeExports.jsxs(N.default,{as:"footer",gap:2,width:e,className:y.cx("kakadu-components-3130980543",t),children:[s.jsxRuntimeExports.jsxs(l.default,{wrap:!0,"data-theme":"dark",direction:"row",gap:4,className:y.cx(b.default,"kakadu-components-82784222"),children:[a.map(n=>n.links.length>0?s.jsxRuntimeExports.jsxs(l.default,{direction:"column",preset:"start",gap:.5,children:[s.jsxRuntimeExports.jsx(k.Paragraph,{children:s.jsxRuntimeExports.jsx("strong",{children:n.title})}),s.jsxRuntimeExports.jsx(k.Paragraph,{as:"ul",className:_,children:n.links.map(c=>s.jsxRuntimeExports.jsx("li",{children:s.jsxRuntimeExports.jsx("a",{href:c.href,rel:c.rel,target:c.target,children:c.text})},c.key))})]},n.key):null),s.jsxRuntimeExports.jsx(l.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,className:"kakadu-components-2329568054"})})})]}),s.jsxRuntimeExports.jsxs(l.default,{wrap:!0,direction:"row-reverse",gap:2,alignment:"flex-end",distribution:"space-between",children:[u?s.jsxRuntimeExports.jsx(k.Span,{className:"kakadu-components-1667529929",children:u}):null,s.jsxRuntimeExports.jsxs(l.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(w.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=M;exports.footerSectionLinks=R;exports.footerSections=x;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("../jsx-runtime-BB_1_6y_.js"),b=require("react"),y=require("@kuma-ui/core"),S=require("../theme.js"),l=require("./flex.js"),k=require("./text.js"),w=require("./logos/kakadu-logo.js"),N=require("./aria-text.js"),q=require("./wrapper.js"),_="kakadu-components-975968984",x=["services","results","about","compliance"],E={services:["kakaduGuide","kakaduPlay"],results:["caseStudies","impactMeasurement"],about:["ourStory","contact"],compliance:["privacyPolicy","ethicalGuidelines","status"]},P={services:{text:"Services",links:{kakaduGuide:{text:"Kakadu Guide",href:"https://guide.kakadu.no"},kakaduPlay:{text:"Kakadu Play",href:"https://play.kakadu.no"}}},results:{text:"Results",links:{caseStudies:{text:"Case studies",href:"https://utforsk.kakadu.no/case-studies"},impactMeasurement:{text:"Impact measurement",href:"https://utforsk.kakadu.no/impact-measurement"}}},about:{text:"About us",links:{ourStory:{text:"Our story",href:"https://utforsk.kakadu.no/our-story"},contact:{text:"Contact",href:"https://utforsk.kakadu.no/kontakt-oss"}}},compliance:{text:"Compliance",links:{privacyPolicy:{text:"Privacy policy",href:"https://utforsk.kakadu.no/personvernerklaering"},ethicalGuidelines:{text:"Ethical guidelines",href:"https://utforsk.kakadu.no/etiske-retningslinjer"},status:{text:"Status",href:"https://kakadu.instatus.com",rel:"noopener noreferrer",target:"_blank"}}}};function p(e,r,u){if(u!==!1&&(u==null?void 0:u.index)!==void 0)return u.index;const t=r.indexOf(e);return t===-1?r.length+1:t+1}function R(e,r={},u=[]){var d,m,f,h;const t=new Set([...Object.keys(r),...Object.keys(e)]),a=[];for(const i of t){const o=e[i];if(o===!1)continue;const j=(o==null?void 0:o.text)??((d=r[i])==null?void 0:d.text),g=(o==null?void 0:o.href)??((m=r[i])==null?void 0:m.href);j===void 0||g===void 0||a.push({key:i,text:j,href:g,rel:(o==null?void 0:o.rel)??((f=r[i])==null?void 0:f.rel),target:(o==null?void 0:o.target)??((h=r[i])==null?void 0:h.target)})}const n=new Set(a.map(i=>i.key)),c=u.filter(i=>n.has(i));return a.toSorted((i,o)=>p(i.key,c,e[i.key])-p(o.key,c,e[o.key]))}function L(e){const r=x.filter(t=>(e==null?void 0:e[t])!==!1),u=[];for(const t of x){if((e==null?void 0:e[t])===!1)continue;const a=P[t],n=e==null?void 0:e[t];u.push({key:t,title:(n==null?void 0:n.text)??a.text,links:R((n==null?void 0:n.links)??{},a.links,E[t]),index:p(t,r,n)})}for(const[t,a]of Object.entries(e??{})){if(x.includes(t)||a===!1)continue;const n=R(a.links??{});n.length===0&&a.text===void 0||u.push({key:t,title:a.text??t,links:n,index:p(t,r,a)})}return u.toSorted((t,a)=>t.index-a.index)}function M({width:e="page",sections:r,attribution:u,className:t}){const a=b.useMemo(()=>L(r),[r]);return s.jsxRuntimeExports.jsxs(q.default,{as:"footer",gap:2,width:e,className:y.cx("kakadu-components-3130980543",t),children:[s.jsxRuntimeExports.jsxs(l.default,{wrap:!0,"data-theme":"dark",direction:"row",gap:4,className:y.cx(S.default,"kakadu-components-82784222"),children:[a.map(n=>n.links.length>0?s.jsxRuntimeExports.jsxs(l.default,{direction:"column",preset:"start",gap:.5,children:[s.jsxRuntimeExports.jsx(k.Paragraph,{children:s.jsxRuntimeExports.jsx("strong",{children:n.title})}),s.jsxRuntimeExports.jsx(k.Paragraph,{as:"ul",className:_,children:n.links.map(c=>s.jsxRuntimeExports.jsx("li",{children:s.jsxRuntimeExports.jsx("a",{href:c.href,rel:c.rel,target:c.target,children:c.text})},c.key))})]},n.key):null),s.jsxRuntimeExports.jsx(l.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,className:"kakadu-components-2329568054"})})})]}),s.jsxRuntimeExports.jsxs(l.default,{wrap:!0,"data-theme":"dark",direction:"row-reverse",gap:2,alignment:"flex-end",distribution:"space-between",className:S.default,children:[u?s.jsxRuntimeExports.jsx(k.Span,{className:"kakadu-components-1667529929",children:u}):null,s.jsxRuntimeExports.jsxs(l.default,{fill:!0,direction:"row",gap:1,alignment:"center",children:[s.jsxRuntimeExports.jsxs("a",{href:"https://kakadu.no",children:[s.jsxRuntimeExports.jsx(N.default,{children:"Kakadu"}),s.jsxRuntimeExports.jsx(w.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=M;exports.footerSectionLinks=E;exports.footerSections=x;
@@ -1,13 +1,13 @@
1
1
  import { j as a } from "../jsx-runtime-B4hRZ52C.mjs";
2
- import { useMemo as b } from "react";
2
+ import { useMemo as N } from "react";
3
3
  import { cx as y } from "@kuma-ui/core";
4
- import N from "../theme.mjs";
4
+ import j from "../theme.mjs";
5
5
  import u from "./flex.mjs";
6
- import { Paragraph as j, Span as S } from "./text.mjs";
6
+ import { Paragraph as S, Span as w } from "./text.mjs";
7
7
  import P from "./logos/kakadu-logo.mjs";
8
8
  import G from "./aria-text.mjs";
9
9
  import K from "./wrapper.mjs";
10
- const L = "kakadu-components-975968984", p = ["services", "results", "about", "compliance"], O = {
10
+ const L = "kakadu-components-975968984", d = ["services", "results", "about", "compliance"], O = {
11
11
  services: ["kakaduGuide", "kakaduPlay"],
12
12
  results: ["caseStudies", "impactMeasurement"],
13
13
  about: ["ourStory", "contact"],
@@ -78,14 +78,14 @@ function k(e, r, i) {
78
78
  const t = r.indexOf(e);
79
79
  return t === -1 ? r.length + 1 : t + 1;
80
80
  }
81
- function w(e, r = {}, i = []) {
82
- var d, m, f, h;
81
+ function b(e, r = {}, i = []) {
82
+ var m, p, f, h;
83
83
  const t = /* @__PURE__ */ new Set([...Object.keys(r), ...Object.keys(e)]), s = [];
84
84
  for (const c of t) {
85
85
  const o = e[c];
86
86
  if (o === !1)
87
87
  continue;
88
- const x = (o == null ? void 0 : o.text) ?? ((d = r[c]) == null ? void 0 : d.text), g = (o == null ? void 0 : o.href) ?? ((m = r[c]) == null ? void 0 : m.href);
88
+ const x = (o == null ? void 0 : o.text) ?? ((m = r[c]) == null ? void 0 : m.text), g = (o == null ? void 0 : o.href) ?? ((p = r[c]) == null ? void 0 : p.href);
89
89
  x === void 0 || g === void 0 || s.push({
90
90
  key: c,
91
91
  text: x,
@@ -98,22 +98,22 @@ function w(e, r = {}, i = []) {
98
98
  return s.toSorted((c, o) => k(c.key, l, e[c.key]) - k(o.key, l, e[o.key]));
99
99
  }
100
100
  function M(e) {
101
- const r = p.filter((t) => (e == null ? void 0 : e[t]) !== !1), i = [];
102
- for (const t of p) {
101
+ const r = d.filter((t) => (e == null ? void 0 : e[t]) !== !1), i = [];
102
+ for (const t of d) {
103
103
  if ((e == null ? void 0 : e[t]) === !1)
104
104
  continue;
105
105
  const s = I[t], n = e == null ? void 0 : e[t];
106
106
  i.push({
107
107
  key: t,
108
108
  title: (n == null ? void 0 : n.text) ?? s.text,
109
- links: w((n == null ? void 0 : n.links) ?? {}, s.links, O[t]),
109
+ links: b((n == null ? void 0 : n.links) ?? {}, s.links, O[t]),
110
110
  index: k(t, r, n)
111
111
  });
112
112
  }
113
113
  for (const [t, s] of Object.entries(e ?? {})) {
114
- if (p.includes(t) || s === !1)
114
+ if (d.includes(t) || s === !1)
115
115
  continue;
116
- const n = w(s.links ?? {});
116
+ const n = b(s.links ?? {});
117
117
  n.length === 0 && s.text === void 0 || i.push({
118
118
  key: t,
119
119
  title: s.text ?? t,
@@ -129,23 +129,23 @@ function Y({
129
129
  attribution: i,
130
130
  className: t
131
131
  }) {
132
- const s = b(() => M(r), [r]);
132
+ const s = N(() => M(r), [r]);
133
133
  return /* @__PURE__ */ a.jsxs(K, { as: "footer", gap: 2, width: e, className: y("kakadu-components-3130980543", t), children: [
134
- /* @__PURE__ */ a.jsxs(u, { wrap: !0, "data-theme": "dark", direction: "row", gap: 4, className: y(N, "kakadu-components-82784222"), children: [
134
+ /* @__PURE__ */ a.jsxs(u, { wrap: !0, "data-theme": "dark", direction: "row", gap: 4, className: y(j, "kakadu-components-82784222"), children: [
135
135
  s.map((n) => n.links.length > 0 ? /* @__PURE__ */ a.jsxs(u, { direction: "column", preset: "start", gap: 0.5, children: [
136
- /* @__PURE__ */ a.jsx(j, { children: /* @__PURE__ */ a.jsx("strong", { children: n.title }) }),
137
- /* @__PURE__ */ a.jsx(j, { as: "ul", className: L, children: n.links.map((l) => /* @__PURE__ */ a.jsx("li", { children: /* @__PURE__ */ a.jsx("a", { href: l.href, rel: l.rel, target: l.target, children: l.text }) }, l.key)) })
136
+ /* @__PURE__ */ a.jsx(S, { children: /* @__PURE__ */ a.jsx("strong", { children: n.title }) }),
137
+ /* @__PURE__ */ a.jsx(S, { as: "ul", className: L, children: n.links.map((l) => /* @__PURE__ */ a.jsx("li", { children: /* @__PURE__ */ a.jsx("a", { href: l.href, rel: l.rel, target: l.target, children: l.text }) }, l.key)) })
138
138
  ] }, n.key) : null),
139
139
  /* @__PURE__ */ a.jsx(u, { fill: !0, className: "kakadu-components-3520395370", children: /* @__PURE__ */ a.jsx("a", { href: "https://businessnorway.com/companies/kakadu-ignite-as", target: "_blank", rel: "noopener noreferrer", className: "kakadu-components-3521477705", children: /* @__PURE__ */ a.jsx("img", { alt: "Made in Norway", src: "https://components.kakadu.no/images/made-in-norway.png", width: 76, className: "kakadu-components-2329568054" }) }) })
140
140
  ] }),
141
- /* @__PURE__ */ a.jsxs(u, { wrap: !0, direction: "row-reverse", gap: 2, alignment: "flex-end", distribution: "space-between", children: [
142
- i ? /* @__PURE__ */ a.jsx(S, { className: "kakadu-components-1667529929", children: i }) : null,
141
+ /* @__PURE__ */ a.jsxs(u, { wrap: !0, "data-theme": "dark", direction: "row-reverse", gap: 2, alignment: "flex-end", distribution: "space-between", className: j, children: [
142
+ i ? /* @__PURE__ */ a.jsx(w, { className: "kakadu-components-1667529929", children: i }) : null,
143
143
  /* @__PURE__ */ a.jsxs(u, { fill: !0, direction: "row", gap: 1, alignment: "center", children: [
144
144
  /* @__PURE__ */ a.jsxs("a", { href: "https://kakadu.no", children: [
145
145
  /* @__PURE__ */ a.jsx(G, { children: "Kakadu" }),
146
146
  /* @__PURE__ */ a.jsx(P, { width: 90, className: "kakadu-components-3103582715" })
147
147
  ] }),
148
- /* @__PURE__ */ a.jsxs(S, { className: "kakadu-components-250962410", children: [
148
+ /* @__PURE__ */ a.jsxs(w, { className: "kakadu-components-250962410", children: [
149
149
  "© ",
150
150
  (/* @__PURE__ */ new Date()).getFullYear(),
151
151
  " Kakadu Ignite AS"
@@ -157,5 +157,5 @@ function Y({
157
157
  export {
158
158
  Y as default,
159
159
  O as footerSectionLinks,
160
- p as footerSections
160
+ d as footerSections
161
161
  };
@@ -1,6 +1,6 @@
1
1
  import { type RefObject } from 'react';
2
- export default function useIsInView(reference: RefObject<Element | null>): boolean | undefined;
3
- export declare function useHasBeenInView(reference: RefObject<Element | null>): {
2
+ export default function useIsInView(reference: RefObject<Element | null>, options?: IntersectionObserverInit): boolean | undefined;
3
+ export declare function useHasBeenInView(reference: RefObject<Element | null>, options?: IntersectionObserverInit): {
4
4
  isInView: boolean | undefined;
5
5
  hasBeenInView: boolean;
6
6
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react");function o(s){const[t,i]=n.useState(void 0);return n.useEffect(()=>{const e=s.current;if(e){const c=I=>{const[u]=I;u&&i(u.isIntersecting)},r=new IntersectionObserver(c);return r.observe(e),()=>{r.disconnect()}}},[s]),t}function a(s){const[t,i]=n.useState(!1),e=o(s);return n.useEffect(()=>{e&&i(!0)},[e]),n.useMemo(()=>({isInView:e,hasBeenInView:t}),[e,t])}exports.default=o;exports.useHasBeenInView=a;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react");function c(s,t){const[i,r]=n.useState(void 0);return n.useEffect(()=>{const e=s.current;if(e){const I=a=>{const[o]=a;o&&r(o.isIntersecting)},u=new IntersectionObserver(I,t);return u.observe(e),()=>{u.disconnect()}}},[s,t]),i}function f(s,t){const[i,r]=n.useState(!1),e=c(s,t);return n.useEffect(()=>{e&&r(!0)},[e]),n.useMemo(()=>({isInView:e,hasBeenInView:i}),[e,i])}exports.default=c;exports.useHasBeenInView=f;
@@ -1,26 +1,26 @@
1
- import { useState as o, useEffect as c, useMemo as f } from "react";
2
- function w(n) {
3
- const [s, t] = o(void 0);
4
- return c(() => {
1
+ import { useState as c, useEffect as u, useMemo as w } from "react";
2
+ function a(n, s) {
3
+ const [t, i] = c(void 0);
4
+ return u(() => {
5
5
  const e = n.current;
6
6
  if (e) {
7
- const u = (I) => {
8
- const [r] = I;
9
- r && t(r.isIntersecting);
10
- }, i = new IntersectionObserver(u);
11
- return i.observe(e), () => {
12
- i.disconnect();
7
+ const I = (f) => {
8
+ const [o] = f;
9
+ o && i(o.isIntersecting);
10
+ }, r = new IntersectionObserver(I, s);
11
+ return r.observe(e), () => {
12
+ r.disconnect();
13
13
  };
14
14
  }
15
- }, [n]), s;
15
+ }, [n, s]), t;
16
16
  }
17
- function V(n) {
18
- const [s, t] = o(!1), e = w(n);
19
- return c(() => {
20
- e && t(!0);
21
- }, [e]), f(() => ({ isInView: e, hasBeenInView: s }), [e, s]);
17
+ function l(n, s) {
18
+ const [t, i] = c(!1), e = a(n, s);
19
+ return u(() => {
20
+ e && i(!0);
21
+ }, [e]), w(() => ({ isInView: e, hasBeenInView: t }), [e, t]);
22
22
  }
23
23
  export {
24
- w as default,
25
- V as useHasBeenInView
24
+ a as default,
25
+ l as useHasBeenInView
26
26
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kakadu/components",
3
- "version": "6.0.3",
3
+ "version": "6.1.1",
4
4
  "description": "Kakadu components library",
5
5
  "license": "MIT",
6
6
  "main": "./build/index.js",