@kakadu/components 3.8.0 → 3.9.0
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/build/components/modal.d.ts +1 -0
- package/build/components/modal.js +1 -1
- package/build/components/modal.mjs +87 -79
- package/build/hooks/use-fetch.d.ts +3 -0
- package/build/hooks/use-fetch.js +1 -1
- package/build/hooks/use-fetch.mjs +113 -90
- package/build/index.js +1 -1
- package/build/index.mjs +163 -162
- package/package.json +1 -1
|
@@ -13,6 +13,7 @@ type ModalProviderProperties<Data = any> = {
|
|
|
13
13
|
export declare function useModalContext<Data = any>(): ModalProviderProperties<Data>;
|
|
14
14
|
export declare function ModalContent<Type extends AtomElementType = DefaultAtomElementType>(properties: FlexProperties<Type>): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export declare function ModalHeading<Type extends AtomElementType = DefaultHeadingElementType>({ as, className, ...properties }: AtomProperties<Type>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function ModalActions<Type extends AtomElementType = DefaultAtomElementType>({ as, ...properties }: FlexProperties<Type>): import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
export type ModalProperties<Data = any> = {
|
|
17
18
|
readonly root?: HTMLElement | ShadowRoot;
|
|
18
19
|
readonly outerDecorators?: DecoratorType[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("../jsx-runtime-BB_1_6y_.js"),e=require("react"),k=require("@kuma-ui/core"),P=require("react-dom"),$=require("../focus-trap-react-CcpTuiJi.js"),B=require("../icons/icon.js"),D=require("./text-button.js"),I=require("./decorators.js"),v=require("./flex.js"),z=require("./atom.js"),C=require("./text.js"),y=e.createContext({isVisible:!1,isInteractive:!1}),{Provider:G}=y;function _(){return e.useContext(y)}function J(){const{isInteractive:s,close:o}=_(),r=e.useCallback(()=>{o==null||o()},[o]);return n.jsxRuntimeExports.jsx("div",{className:"kakadu-components-2566044647",children:n.jsxRuntimeExports.jsx(D.default,{iconLeft:B.IconType.times,label:"Close",disabled:!s,onClick:r})})}function K(s){return n.jsxRuntimeExports.jsx(v.default,{gap:2,...s})}function Q({as:s,className:o,...r}){return n.jsxRuntimeExports.jsx(C.Heading,{...r,as:s??C.defaultHeadingElementType,className:k.cx("kakadu-components-4275938488",o)})}function U({as:s,...o}){return n.jsxRuntimeExports.jsx(v.default,{direction:"row",gap:1,alignment:v.FlexAlignment.end,...o,as:s??z.defaultAtomElementType})}function V({root:s,outerDecorators:o=[],innerDecorators:r=[],label:m,maxWidth:c,className:f,isVisible:a,isFullWidth:l=!1,shouldCloseOnOutsideClick:i=!0,shouldCloseOnEscapePress:d=!0,showCloseButton:L=!0,onClose:p,children:N}){const R=e.useRef(null),M=e.useRef(null),[g,S]=e.useState(!1),[u,x]=e.useState(!1),q=e.useCallback(t=>{R.current=t,x(!1)},[]),E=e.useRef(null),T=e.useCallback(t=>{t&&(E.current=t)},[]),[b,h]=e.useState(a??!1),A=e.useMemo(()=>({isVisible:b,isInteractive:u,setInitialFocus:T,close:q}),[b,u,T,q]);e.useEffect(()=>{a&&(S(!0),h(!0))},[a]),e.useEffect(()=>{if(a){const t=setTimeout(()=>{x(!0)},100);return()=>{clearTimeout(t)}}x(!1)},[a]),e.useEffect(()=>{if(g&&!u){const t=setTimeout(()=>{p==null||p(R.current??void 0),h(!1)},370);return()=>{clearTimeout(t)}}},[g,u,p]),e.useEffect(()=>{const t=M.current;if(a&&i&&t){const j=H=>{t===H.target&&x(!1)};return t.addEventListener("click",j),()=>{t.removeEventListener("click",j)}}},[a,i]),e.useEffect(()=>{if(!a||!d)return;const t=j=>{j.key==="Escape"&&x(!1)};return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}},[a,d]);const F=e.useMemo(()=>({initialFocus:()=>E.current??void 0,onActivate:()=>{var t;return(t=E.current)==null?void 0:t.focus()}}),[]),w=n.jsxRuntimeExports.jsx(I.default,{decorators:o,children:n.jsxRuntimeExports.jsx("div",{"aria-hidden":!u,style:{"--max-width":c?`${c}px`:void 0},className:k.cx("kakadu-components-4119461136",u&&"kakadu-components-2522346797",f),children:n.jsxRuntimeExports.jsx(I.default,{decorators:r,children:n.jsxRuntimeExports.jsx($.focusTrapReactExports.FocusTrap,{active:u,focusTrapOptions:F,children:n.jsxRuntimeExports.jsx("div",{ref:M,className:"kakadu-components-4011815997",children:n.jsxRuntimeExports.jsx("div",{role:"dialog","aria-modal":"true","aria-label":m??"Modal",className:k.cx("kakadu-components-3324483532",l&&"kakadu-components-3799971070",u&&"kakadu-components-968755580"),children:n.jsxRuntimeExports.jsxs(G,{value:A,children:[L?n.jsxRuntimeExports.jsx(J,{}):null,n.jsxRuntimeExports.jsx("div",{className:k.cx("kakadu-components-633990035",l&&"kakadu-components-171969824"),children:N})]})})})})})})});return s?P.createPortal(w,s):w}function X(s,o){const[r,m]=e.useState(!1),c=e.useRef(void 0),f=e.useCallback(async()=>(m(!0),new Promise(i=>{c.current=i})),[]),a=e.useCallback(i=>{var d;m(!1),(d=c.current)==null||d.call(c,i),c.current=void 0},[]),l=e.useMemo(()=>n.jsxRuntimeExports.jsx(s,{...o,isVisible:r,onClose:a}),[s,o,r,a]);return e.useMemo(()=>({isVisible:r,show:f,modal:l}),[r,f,l])}exports.ModalActions=U;exports.ModalContent=K;exports.ModalHeading=Q;exports.default=V;exports.useModal=X;exports.useModalContext=_;
|
|
@@ -1,70 +1,77 @@
|
|
|
1
1
|
import { j as t } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { cx as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { f as
|
|
6
|
-
import { IconType as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
|
|
2
|
+
import { createContext as q, useRef as j, useState as h, useCallback as f, useMemo as I, useEffect as m, useContext as z } from "react";
|
|
3
|
+
import { cx as w } from "@kuma-ui/core";
|
|
4
|
+
import { createPortal as G } from "react-dom";
|
|
5
|
+
import { f as J } from "../focus-trap-react-DYXrtbDH.mjs";
|
|
6
|
+
import { IconType as K } from "../icons/icon.mjs";
|
|
7
|
+
import Q from "./text-button.mjs";
|
|
8
|
+
import b from "./decorators.mjs";
|
|
9
|
+
import A, { FlexAlignment as U } from "./flex.mjs";
|
|
10
|
+
import { defaultAtomElementType as V } from "./atom.mjs";
|
|
11
|
+
import { Heading as X, defaultHeadingElementType as Y } from "./text.mjs";
|
|
12
|
+
const C = q({
|
|
12
13
|
isVisible: !1,
|
|
13
14
|
isInteractive: !1
|
|
14
15
|
}), {
|
|
15
|
-
Provider:
|
|
16
|
+
Provider: Z
|
|
16
17
|
} = C;
|
|
17
|
-
function
|
|
18
|
-
return
|
|
18
|
+
function _() {
|
|
19
|
+
return z(C);
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
+
function W() {
|
|
21
22
|
const {
|
|
22
|
-
isInteractive:
|
|
23
|
-
close:
|
|
24
|
-
} =
|
|
25
|
-
|
|
26
|
-
}, [
|
|
27
|
-
return /* @__PURE__ */ t.jsx("div", { className: "kakadu-components-2566044647", children: /* @__PURE__ */ t.jsx(
|
|
23
|
+
isInteractive: n,
|
|
24
|
+
close: o
|
|
25
|
+
} = _(), s = f(() => {
|
|
26
|
+
o == null || o();
|
|
27
|
+
}, [o]);
|
|
28
|
+
return /* @__PURE__ */ t.jsx("div", { className: "kakadu-components-2566044647", children: /* @__PURE__ */ t.jsx(Q, { iconLeft: K.times, label: "Close", disabled: !n, onClick: s }) });
|
|
28
29
|
}
|
|
29
|
-
function
|
|
30
|
-
return /* @__PURE__ */ t.jsx(
|
|
30
|
+
function ue(n) {
|
|
31
|
+
return /* @__PURE__ */ t.jsx(A, { gap: 2, ...n });
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
-
as:
|
|
34
|
-
className:
|
|
35
|
-
...
|
|
33
|
+
function de({
|
|
34
|
+
as: n,
|
|
35
|
+
className: o,
|
|
36
|
+
...s
|
|
36
37
|
}) {
|
|
37
|
-
return /* @__PURE__ */ t.jsx(
|
|
38
|
+
return /* @__PURE__ */ t.jsx(X, { ...s, as: n ?? Y, className: w("kakadu-components-4275938488", o) });
|
|
38
39
|
}
|
|
39
|
-
function
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
function me({
|
|
41
|
+
as: n,
|
|
42
|
+
...o
|
|
43
|
+
}) {
|
|
44
|
+
return /* @__PURE__ */ t.jsx(A, { direction: "row", gap: 1, alignment: U.end, ...o, as: n ?? V });
|
|
45
|
+
}
|
|
46
|
+
function fe({
|
|
47
|
+
root: n,
|
|
48
|
+
outerDecorators: o = [],
|
|
49
|
+
innerDecorators: s = [],
|
|
43
50
|
label: p,
|
|
44
51
|
maxWidth: a,
|
|
45
|
-
className:
|
|
46
|
-
isVisible:
|
|
47
|
-
isFullWidth:
|
|
52
|
+
className: x,
|
|
53
|
+
isVisible: r,
|
|
54
|
+
isFullWidth: l = !1,
|
|
48
55
|
shouldCloseOnOutsideClick: i = !0,
|
|
49
|
-
shouldCloseOnEscapePress:
|
|
56
|
+
shouldCloseOnEscapePress: u = !0,
|
|
50
57
|
showCloseButton: H = !0,
|
|
51
|
-
onClose:
|
|
58
|
+
onClose: k,
|
|
52
59
|
children: B
|
|
53
60
|
}) {
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
}, []), T = j(null),
|
|
61
|
+
const g = j(null), E = j(null), [M, P] = h(!1), [c, d] = h(!1), y = f((e) => {
|
|
62
|
+
g.current = e, d(!1);
|
|
63
|
+
}, []), T = j(null), F = f((e) => {
|
|
57
64
|
e && (T.current = e);
|
|
58
|
-
}, []), [
|
|
59
|
-
isVisible:
|
|
65
|
+
}, []), [L, N] = h(r ?? !1), D = I(() => ({
|
|
66
|
+
isVisible: L,
|
|
60
67
|
isInteractive: c,
|
|
61
|
-
setInitialFocus:
|
|
68
|
+
setInitialFocus: F,
|
|
62
69
|
close: y
|
|
63
|
-
}), [
|
|
70
|
+
}), [L, c, F, y]);
|
|
64
71
|
m(() => {
|
|
65
|
-
|
|
66
|
-
}, [
|
|
67
|
-
if (
|
|
72
|
+
r && (P(!0), N(!0));
|
|
73
|
+
}, [r]), m(() => {
|
|
74
|
+
if (r) {
|
|
68
75
|
const e = setTimeout(() => {
|
|
69
76
|
d(!0);
|
|
70
77
|
}, 100);
|
|
@@ -73,27 +80,27 @@ function ue({
|
|
|
73
80
|
};
|
|
74
81
|
}
|
|
75
82
|
d(!1);
|
|
76
|
-
}, [
|
|
77
|
-
if (
|
|
83
|
+
}, [r]), m(() => {
|
|
84
|
+
if (M && !c) {
|
|
78
85
|
const e = setTimeout(() => {
|
|
79
|
-
|
|
86
|
+
k == null || k(g.current ?? void 0), N(!1);
|
|
80
87
|
}, 370);
|
|
81
88
|
return () => {
|
|
82
89
|
clearTimeout(e);
|
|
83
90
|
};
|
|
84
91
|
}
|
|
85
|
-
}, [
|
|
86
|
-
const e =
|
|
87
|
-
if (
|
|
88
|
-
const v = (
|
|
89
|
-
e ===
|
|
92
|
+
}, [M, c, k]), m(() => {
|
|
93
|
+
const e = E.current;
|
|
94
|
+
if (r && i && e) {
|
|
95
|
+
const v = ($) => {
|
|
96
|
+
e === $.target && d(!1);
|
|
90
97
|
};
|
|
91
98
|
return e.addEventListener("click", v), () => {
|
|
92
99
|
e.removeEventListener("click", v);
|
|
93
100
|
};
|
|
94
101
|
}
|
|
95
|
-
}, [
|
|
96
|
-
if (!
|
|
102
|
+
}, [r, i]), m(() => {
|
|
103
|
+
if (!r || !u)
|
|
97
104
|
return;
|
|
98
105
|
const e = (v) => {
|
|
99
106
|
v.key === "Escape" && d(!1);
|
|
@@ -101,38 +108,39 @@ function ue({
|
|
|
101
108
|
return window.addEventListener("keydown", e), () => {
|
|
102
109
|
window.removeEventListener("keydown", e);
|
|
103
110
|
};
|
|
104
|
-
}, [
|
|
105
|
-
const
|
|
111
|
+
}, [r, u]);
|
|
112
|
+
const S = I(() => ({
|
|
106
113
|
initialFocus: () => T.current ?? void 0,
|
|
107
114
|
onActivate: () => {
|
|
108
115
|
var e;
|
|
109
116
|
return (e = T.current) == null ? void 0 : e.focus();
|
|
110
117
|
}
|
|
111
|
-
}), []),
|
|
118
|
+
}), []), R = /* @__PURE__ */ t.jsx(b, { decorators: o, children: /* @__PURE__ */ t.jsx("div", { "aria-hidden": !c, style: {
|
|
112
119
|
"--max-width": a ? `${a}px` : void 0
|
|
113
|
-
}, className:
|
|
114
|
-
H ? /* @__PURE__ */ t.jsx(
|
|
115
|
-
/* @__PURE__ */ t.jsx("div", { className:
|
|
120
|
+
}, className: w("kakadu-components-4119461136", c && "kakadu-components-2522346797", x), children: /* @__PURE__ */ t.jsx(b, { decorators: s, children: /* @__PURE__ */ t.jsx(J.FocusTrap, { active: c, focusTrapOptions: S, children: /* @__PURE__ */ t.jsx("div", { ref: E, className: "kakadu-components-4011815997", children: /* @__PURE__ */ t.jsx("div", { role: "dialog", "aria-modal": "true", "aria-label": p ?? "Modal", className: w("kakadu-components-3324483532", l && "kakadu-components-3799971070", c && "kakadu-components-968755580"), children: /* @__PURE__ */ t.jsxs(Z, { value: D, children: [
|
|
121
|
+
H ? /* @__PURE__ */ t.jsx(W, {}) : null,
|
|
122
|
+
/* @__PURE__ */ t.jsx("div", { className: w("kakadu-components-633990035", l && "kakadu-components-171969824"), children: B })
|
|
116
123
|
] }) }) }) }) }) }) });
|
|
117
|
-
return
|
|
124
|
+
return n ? G(R, n) : R;
|
|
118
125
|
}
|
|
119
|
-
function
|
|
120
|
-
const [
|
|
126
|
+
function pe(n, o) {
|
|
127
|
+
const [s, p] = h(!1), a = j(void 0), x = f(async () => (p(!0), new Promise((i) => {
|
|
121
128
|
a.current = i;
|
|
122
|
-
})), []),
|
|
123
|
-
var
|
|
124
|
-
p(!1), (
|
|
125
|
-
}, []),
|
|
126
|
-
return
|
|
127
|
-
isVisible:
|
|
128
|
-
show:
|
|
129
|
-
modal:
|
|
130
|
-
}), [
|
|
129
|
+
})), []), r = f((i) => {
|
|
130
|
+
var u;
|
|
131
|
+
p(!1), (u = a.current) == null || u.call(a, i), a.current = void 0;
|
|
132
|
+
}, []), l = I(() => /* @__PURE__ */ t.jsx(n, { ...o, isVisible: s, onClose: r }), [n, o, s, r]);
|
|
133
|
+
return I(() => ({
|
|
134
|
+
isVisible: s,
|
|
135
|
+
show: x,
|
|
136
|
+
modal: l
|
|
137
|
+
}), [s, x, l]);
|
|
131
138
|
}
|
|
132
139
|
export {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
140
|
+
me as ModalActions,
|
|
141
|
+
ue as ModalContent,
|
|
142
|
+
de as ModalHeading,
|
|
143
|
+
fe as default,
|
|
144
|
+
pe as useModal,
|
|
145
|
+
_ as useModalContext
|
|
138
146
|
};
|
|
@@ -13,17 +13,20 @@ export declare function useJsonFetcher<Type = unknown>(handler?: (json: unknown)
|
|
|
13
13
|
};
|
|
14
14
|
type FetchParameters = {
|
|
15
15
|
cacheLifetime?: number;
|
|
16
|
+
shouldFetch?: boolean;
|
|
16
17
|
};
|
|
17
18
|
export default function useFetch<Type>(url?: string, options?: RequestInit, handler?: (response: Response) => PromiseOrValue<Type | undefined>, parameters?: FetchParameters): {
|
|
18
19
|
isReady: boolean;
|
|
19
20
|
isLoading: boolean;
|
|
20
21
|
response: Type | undefined;
|
|
21
22
|
error: Error | undefined;
|
|
23
|
+
purge: () => void;
|
|
22
24
|
};
|
|
23
25
|
export declare function useJsonFetch<Type = unknown>(url?: string, options?: RequestInit, handler?: (json: unknown) => PromiseOrValue<Type | undefined>, parameters?: FetchParameters): {
|
|
24
26
|
isReady: boolean;
|
|
25
27
|
isLoading: boolean;
|
|
26
28
|
response: Type | undefined;
|
|
27
29
|
error: Error | undefined;
|
|
30
|
+
purge: () => void;
|
|
28
31
|
};
|
|
29
32
|
export {};
|
package/build/hooks/use-fetch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react"),C=new Map,M=new Map,L=new Map,p=new Map;function R(t,s){let e=L.get(t);return e||(e=new Set,L.set(t,e)),e.add(s),()=>{e==null||e.delete(s),e&&e.size===0&&L.delete(t)}}function I(t,s){M.set(t,{timestamp:Date.now(),response:s});const e=L.get(t);if(e)for(const a of e)a(s)}function G(t,s){let e=p.get(t);return e||(e=new Set,p.set(t,e)),e.add(s),()=>{e==null||e.delete(s),e&&e.size===0&&p.delete(t)}}function U(t){M.delete(t);const s=p.get(t);if(s)for(const e of s)e()}function q(t){const[s,e]=n.useState(!1),[a,v]=n.useState(),[f,d]=n.useState(),g=n.useCallback(async(b,S)=>{try{d(void 0),e(!0);const l=await fetch(b,S),u=t?await t(l):l;return v(u),u}catch(l){const u=l instanceof Error?l:new Error("Unknown error");throw d(u),u}finally{e(!1)}},[t]);return n.useMemo(()=>({isLoading:s,fetch:g,response:a,error:f}),[s,g,a,f])}function k(t){const s=n.useCallback(async e=>{const a=await e.json();return t?t(a):a},[t]);return q(s)}function J(t,s,e,a){const{cacheLifetime:v=1e3*30,shouldFetch:f=!0}=a??{},[d,g]=n.useState(0),[b,S]=n.useState(()=>!!t),[l,u]=n.useState(()=>!!t&&f),o=n.useMemo(()=>t?JSON.stringify({url:t,options:s}):"",[t,s]),w=n.useCallback(()=>{if(!o)return;const c=M.get(o);if(c){if(Date.now()-c.timestamp>v){M.delete(o);return}return c.response}},[o,v]),[F,E]=n.useState(()=>w()),[y,m]=n.useState(),h=n.useMemo(()=>{var c;return((c=s==null?void 0:s.method)==null?void 0:c.toUpperCase())??"GET"},[s])==="GET";n.useEffect(()=>{if(!h)return;let c;const i=()=>{clearTimeout(c),!document.hidden&&(c=setTimeout(()=>{g(r=>r+1)},0))};return document.addEventListener("visibilitychange",i),window.addEventListener("focus",i),()=>{document.removeEventListener("visibilitychange",i),window.removeEventListener("focus",i),clearTimeout(c)}},[h]),n.useEffect(()=>{if(!t||!o){S(!1),E(void 0);return}const c=w();S(!0),c===void 0?(E(void 0),m(void 0)):(E(c),m(void 0));const i=R(o,r=>{E(r),m(void 0)});return()=>{i()}},[t,o,w]),n.useEffect(()=>{if(!t||!o)return;const c=G(o,()=>{g(i=>i+1)});return()=>{c()}},[t,o]),n.useEffect(()=>{if(!t||!o||d<0||!f){u(!1);return}if(h&&w()!==void 0){u(!1);return}let c=!0;m(void 0),u(!0);let i=h&&C.has(o)?C.get(o):void 0;if(!i){const r=fetch(t,s);C.set(o,r),r.then(()=>{C.delete(o)}),i=r}return i.then(async r=>{if(c){const j=e?await e(r):r;h&&I(o,j),E(j),m(void 0)}}).catch(r=>{c&&m(r)}).finally(()=>{c&&u(!1)}),()=>{c=!1}},[t,o,d,f,h,w,s,e]);const T=n.useCallback(()=>{h&&o&&U(o)},[o,h]);return n.useMemo(()=>({isReady:b,isLoading:l,response:F,error:y,purge:T}),[b,l,F,y,T])}function z(t,s,e,a){const v=n.useCallback(async f=>{const d=await f.json();return e?e(d):d},[e]);return J(t,s,v,a)}exports.default=J;exports.useFetcher=q;exports.useJsonFetch=z;exports.useJsonFetcher=k;
|
|
@@ -1,147 +1,170 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
let
|
|
5
|
-
return
|
|
6
|
-
|
|
1
|
+
import { useState as v, useMemo as F, useCallback as p, useEffect as b } from "react";
|
|
2
|
+
const y = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map();
|
|
3
|
+
function G(t, n) {
|
|
4
|
+
let e = M.get(t);
|
|
5
|
+
return e || (e = /* @__PURE__ */ new Set(), M.set(t, e)), e.add(n), () => {
|
|
6
|
+
e == null || e.delete(n), e && e.size === 0 && M.delete(t);
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
13
|
-
for (const
|
|
14
|
-
|
|
9
|
+
function J(t, n) {
|
|
10
|
+
T.set(t, { timestamp: Date.now(), response: n });
|
|
11
|
+
const e = M.get(t);
|
|
12
|
+
if (e)
|
|
13
|
+
for (const i of e)
|
|
14
|
+
i(n);
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
function U(t, n) {
|
|
17
|
+
let e = R.get(t);
|
|
18
|
+
return e || (e = /* @__PURE__ */ new Set(), R.set(t, e)), e.add(n), () => {
|
|
19
|
+
e == null || e.delete(n), e && e.size === 0 && R.delete(t);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function z(t) {
|
|
23
|
+
T.delete(t);
|
|
24
|
+
const n = R.get(t);
|
|
25
|
+
if (n)
|
|
26
|
+
for (const e of n)
|
|
27
|
+
e();
|
|
28
|
+
}
|
|
29
|
+
function B(t) {
|
|
30
|
+
const [n, e] = v(!1), [i, m] = v(), [u, f] = v(), g = p(
|
|
31
|
+
async (L, C) => {
|
|
19
32
|
try {
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
return
|
|
23
|
-
} catch (
|
|
24
|
-
const
|
|
25
|
-
throw
|
|
33
|
+
f(void 0), e(!0);
|
|
34
|
+
const d = await fetch(L, C), a = t ? await t(d) : d;
|
|
35
|
+
return m(a), a;
|
|
36
|
+
} catch (d) {
|
|
37
|
+
const a = d instanceof Error ? d : new Error("Unknown error");
|
|
38
|
+
throw f(a), a;
|
|
26
39
|
} finally {
|
|
27
|
-
|
|
40
|
+
e(!1);
|
|
28
41
|
}
|
|
29
42
|
},
|
|
30
|
-
[
|
|
43
|
+
[t]
|
|
31
44
|
);
|
|
32
|
-
return
|
|
33
|
-
() => ({ isLoading: n, fetch:
|
|
34
|
-
[n,
|
|
45
|
+
return F(
|
|
46
|
+
() => ({ isLoading: n, fetch: g, response: i, error: u }),
|
|
47
|
+
[n, g, i, u]
|
|
35
48
|
);
|
|
36
49
|
}
|
|
37
|
-
function
|
|
38
|
-
const n =
|
|
39
|
-
async (
|
|
40
|
-
const
|
|
41
|
-
return
|
|
50
|
+
function N(t) {
|
|
51
|
+
const n = p(
|
|
52
|
+
async (e) => {
|
|
53
|
+
const i = await e.json();
|
|
54
|
+
return t ? t(i) : i;
|
|
42
55
|
},
|
|
43
|
-
[
|
|
56
|
+
[t]
|
|
44
57
|
);
|
|
45
|
-
return
|
|
58
|
+
return B(n);
|
|
46
59
|
}
|
|
47
|
-
function
|
|
48
|
-
const { cacheLifetime:
|
|
49
|
-
() =>
|
|
50
|
-
[
|
|
51
|
-
), l =
|
|
60
|
+
function D(t, n, e, i) {
|
|
61
|
+
const { cacheLifetime: m = 1e3 * 30, shouldFetch: u = !0 } = i ?? {}, [f, g] = v(0), [L, C] = v(() => !!t), [d, a] = v(() => !!t && u), s = F(
|
|
62
|
+
() => t ? JSON.stringify({ url: t, options: n }) : "",
|
|
63
|
+
[t, n]
|
|
64
|
+
), l = p(() => {
|
|
52
65
|
if (!s)
|
|
53
66
|
return;
|
|
54
|
-
const o =
|
|
67
|
+
const o = T.get(s);
|
|
55
68
|
if (o) {
|
|
56
|
-
if (Date.now() - o.timestamp >
|
|
57
|
-
|
|
69
|
+
if (Date.now() - o.timestamp > m) {
|
|
70
|
+
T.delete(s);
|
|
58
71
|
return;
|
|
59
72
|
}
|
|
60
73
|
return o.response;
|
|
61
74
|
}
|
|
62
|
-
}, [s,
|
|
75
|
+
}, [s, m]), [j, E] = v(() => l()), [I, w] = v(), h = F(
|
|
63
76
|
() => {
|
|
64
77
|
var o;
|
|
65
78
|
return ((o = n == null ? void 0 : n.method) == null ? void 0 : o.toUpperCase()) ?? "GET";
|
|
66
79
|
},
|
|
67
80
|
[n]
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
if (
|
|
81
|
+
) === "GET";
|
|
82
|
+
b(() => {
|
|
83
|
+
if (!h)
|
|
71
84
|
return;
|
|
72
85
|
let o;
|
|
73
86
|
const c = () => {
|
|
74
87
|
clearTimeout(o), !document.hidden && (o = setTimeout(() => {
|
|
75
|
-
|
|
88
|
+
g((r) => r + 1);
|
|
76
89
|
}, 0));
|
|
77
90
|
};
|
|
78
91
|
return document.addEventListener("visibilitychange", c), window.addEventListener("focus", c), () => {
|
|
79
92
|
document.removeEventListener("visibilitychange", c), window.removeEventListener("focus", c), clearTimeout(o);
|
|
80
93
|
};
|
|
81
|
-
}, [
|
|
82
|
-
if (!
|
|
83
|
-
|
|
94
|
+
}, [h]), b(() => {
|
|
95
|
+
if (!t || !s) {
|
|
96
|
+
C(!1), E(void 0);
|
|
84
97
|
return;
|
|
85
98
|
}
|
|
86
99
|
const o = l();
|
|
87
|
-
|
|
88
|
-
const c =
|
|
89
|
-
|
|
100
|
+
C(!0), o === void 0 ? (E(void 0), w(void 0)) : (E(o), w(void 0));
|
|
101
|
+
const c = G(s, (r) => {
|
|
102
|
+
E(r), w(void 0);
|
|
90
103
|
});
|
|
91
104
|
return () => {
|
|
92
105
|
c();
|
|
93
106
|
};
|
|
94
|
-
}, [
|
|
95
|
-
if (!
|
|
96
|
-
i(!1);
|
|
107
|
+
}, [t, s, l]), b(() => {
|
|
108
|
+
if (!t || !s)
|
|
97
109
|
return;
|
|
98
|
-
|
|
99
|
-
|
|
110
|
+
const o = U(s, () => {
|
|
111
|
+
g((c) => c + 1);
|
|
112
|
+
});
|
|
113
|
+
return () => {
|
|
114
|
+
o();
|
|
115
|
+
};
|
|
116
|
+
}, [t, s]), b(() => {
|
|
117
|
+
if (!t || !s || f < 0 || !u) {
|
|
118
|
+
a(!1);
|
|
100
119
|
return;
|
|
101
|
-
|
|
102
|
-
if (
|
|
103
|
-
|
|
120
|
+
}
|
|
121
|
+
if (h && l() !== void 0) {
|
|
122
|
+
a(!1);
|
|
104
123
|
return;
|
|
105
124
|
}
|
|
106
|
-
let
|
|
107
|
-
|
|
108
|
-
let
|
|
109
|
-
if (!
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}),
|
|
125
|
+
let o = !0;
|
|
126
|
+
w(void 0), a(!0);
|
|
127
|
+
let c = h && y.has(s) ? y.get(s) : void 0;
|
|
128
|
+
if (!c) {
|
|
129
|
+
const r = fetch(t, n);
|
|
130
|
+
y.set(s, r), r.then(() => {
|
|
131
|
+
y.delete(s);
|
|
132
|
+
}), c = r;
|
|
114
133
|
}
|
|
115
|
-
return
|
|
116
|
-
if (
|
|
117
|
-
const
|
|
118
|
-
|
|
134
|
+
return c.then(async (r) => {
|
|
135
|
+
if (o) {
|
|
136
|
+
const q = e ? await e(r) : r;
|
|
137
|
+
h && J(s, q), E(q), w(void 0);
|
|
119
138
|
}
|
|
120
|
-
}).catch((
|
|
121
|
-
|
|
139
|
+
}).catch((r) => {
|
|
140
|
+
o && w(r);
|
|
122
141
|
}).finally(() => {
|
|
123
|
-
|
|
142
|
+
o && a(!1);
|
|
124
143
|
}), () => {
|
|
125
|
-
|
|
144
|
+
o = !1;
|
|
126
145
|
};
|
|
127
|
-
}, [
|
|
128
|
-
|
|
129
|
-
|
|
146
|
+
}, [t, s, f, u, h, l, n, e]);
|
|
147
|
+
const S = p(() => {
|
|
148
|
+
h && s && z(s);
|
|
149
|
+
}, [s, h]);
|
|
150
|
+
return F(
|
|
151
|
+
() => ({ isReady: L, isLoading: d, response: j, error: I, purge: S }),
|
|
152
|
+
[L, d, j, I, S]
|
|
130
153
|
);
|
|
131
154
|
}
|
|
132
|
-
function
|
|
133
|
-
const
|
|
134
|
-
async (
|
|
135
|
-
const
|
|
136
|
-
return
|
|
155
|
+
function O(t, n, e, i) {
|
|
156
|
+
const m = p(
|
|
157
|
+
async (u) => {
|
|
158
|
+
const f = await u.json();
|
|
159
|
+
return e ? e(f) : f;
|
|
137
160
|
},
|
|
138
|
-
[
|
|
161
|
+
[e]
|
|
139
162
|
);
|
|
140
|
-
return
|
|
163
|
+
return D(t, n, m, i);
|
|
141
164
|
}
|
|
142
165
|
export {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
166
|
+
D as default,
|
|
167
|
+
B as useFetcher,
|
|
168
|
+
O as useJsonFetch,
|
|
169
|
+
N as useJsonFetcher
|
|
147
170
|
};
|
package/build/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./theme.js"),f=require("./components/aria-text.js"),g=require("./components/atom.js"),b=require("./components/bankid-logo.js"),B=require("./components/box.js"),t=require("./components/button.js"),S=require("./components/button-tooltip.js"),P=require("./components/card.js"),x=require("./components/click-ripples.js"),w=require("./components/collapsible.js"),I=require("./components/copy-icon-button.js"),M=require("./components/datum.js"),G=require("./components/decorators.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./theme.js"),f=require("./components/aria-text.js"),g=require("./components/atom.js"),b=require("./components/bankid-logo.js"),B=require("./components/box.js"),t=require("./components/button.js"),S=require("./components/button-tooltip.js"),P=require("./components/card.js"),x=require("./components/click-ripples.js"),w=require("./components/collapsible.js"),I=require("./components/copy-icon-button.js"),M=require("./components/datum.js"),G=require("./components/decorators.js"),A=require("./components/dnb-logo.js"),D=require("./components/dot.js"),m=require("./components/flex.js"),q=require("./components/footer.js"),F=require("./components/gauge.js"),R=require("./components/gjensidige-logo.js"),H=require("./components/header.js"),_=require("./components/hover-gradient.js"),v=require("./components/icon-button.js"),c=require("./components/input.js"),E=require("./components/kakadu-guide-icon.js"),i=require("./components/kakadu-guide-logo.js"),K=require("./components/kakadu-index-logo.js"),V=require("./components/kakadu-academy-logo.js"),N=require("./components/kakadu-logo.js"),r=require("./components/modal.js"),U=require("./components/moving-gradients.js"),W=require("./components/moving-stars.js"),l=require("./components/notice.js"),d=require("./components/notification.js"),h=require("./components/popover-menu.js"),a=require("./components/popover.js"),y=require("./components/revealer.js"),u=require("./components/separator.js"),k=require("./components/skeleton.js"),J=require("./components/sparebank1-logo.js"),L=require("./components/spinner.js"),j=require("./components/sto-logo.js"),Q=require("./components/storebrand-logo.js"),e=require("./components/text.js"),T=require("./components/text-button.js"),n=require("./components/theme-setter.js"),O=require("./components/veil.js"),C=require("./components/wrapper.js"),p=require("./icons/icon.js"),z=require("./icons/kakadu-guide-icon.js"),X=require("./icons/kakadu-guide-glyph.js"),Y=require("./icons/dots.js"),Z=require("./icons/menu.js"),$=require("./icons/check.js"),ee=require("./icons/plus.js"),oe=require("./icons/times.js"),te=require("./icons/chevron-up.js"),ne=require("./icons/chevron-right.js"),re=require("./icons/chevron-down.js"),ae=require("./icons/chevron-left.js"),ue=require("./icons/caret-up.js"),se=require("./icons/caret-right.js"),ce=require("./icons/caret-down.js"),ie=require("./icons/caret-left.js"),le=require("./icons/arrow-up.js"),de=require("./icons/arrow-right.js"),pe=require("./icons/arrow-down.js"),fe=require("./icons/arrow-left.js"),ge=require("./icons/anchor-up.js"),Se=require("./icons/anchor-down.js"),me=require("./icons/trend-up.js"),qe=require("./icons/eye.js"),_e=require("./icons/edit.js"),ve=require("./icons/cog.js"),he=require("./icons/copy.js"),ye=require("./icons/document.js"),ke=require("./icons/select.js"),Le=require("./icons/test.js"),Te=require("./icons/share.js"),Ce=require("./icons/package.js"),be=require("./icons/external.js"),Be=require("./icons/exclamation-triangle.js"),Pe=require("./icons/sparkle.js"),xe=require("./icons/trash.js"),we=require("./icons/chrome-browser-logo.js"),Ie=require("./icons/edge-browser-logo.js"),Me=require("./hooks/use-media-query.js"),s=require("./hooks/use-fetch.js"),Ge=require("./utilities/copy-to-clipboard.js"),Ae=require("./utilities/generate-random-id.js"),De=require("./utilities/scale.js");exports.FontFamilyHead=o.FontFamilyHead;exports.buttonResetStyles=o.buttonResetStyles;exports.darkBackgroundColor=o.darkBackgroundColor;exports.effectStyles=o.effectStyles;exports.font=o.font;exports.lightBackgroundColor=o.lightBackgroundColor;exports.nonInteractiveEffectStyles=o.nonInteractiveEffectStyles;exports.overflowProtectionStyles=o.overflowProtectionStyles;exports.theme=o.default;exports.AriaText=f.default;exports.ariaTextStyles=f.ariaTextStyles;exports.Atom=g.default;exports.defaultAtomElementType=g.defaultAtomElementType;exports.BankidLogo=b.default;exports.Box=B.default;exports.Button=t.default;exports.ButtonLoader=t.ButtonLoader;exports.ButtonVariant=t.ButtonVariant;exports.buttonDangerStyles=t.buttonDangerStyles;exports.buttonSecondaryStyles=t.buttonSecondaryStyles;exports.buttonSuccessStyles=t.buttonSuccessStyles;exports.buttonWarningStyles=t.buttonWarningStyles;exports.ButtonTooltip=S.default;exports.ButtonTooltipPosition=S.ButtonTooltipPosition;exports.Card=P.default;exports.ClickRipples=x.default;exports.Collapsible=w.default;exports.CopyIconButton=I.default;exports.Datum=M.default;exports.Decorators=G.default;exports.DnbLogo=A.default;exports.Dot=D.default;exports.Flex=m.default;exports.FlexAlignment=m.FlexAlignment;exports.Footer=q.default;exports.FooterLinkItem=q.FooterLinkItem;exports.Gauge=F.default;exports.GjensidigeLogo=R.default;exports.Header=H.default;exports.HoverGradient=_.default;exports.normalBlendStyles=_.normalBlendStyles;exports.IconButton=v.default;exports.IconButtonVariant=v.IconButtonVariant;exports.Input=c.default;exports.Select=c.Select;exports.errorParagraph=c.errorParagraph;exports.KakaduGuideIcon=E.default;exports.KakaduGuideLogo=i.default;exports.KakaduGuideLogoSvg=i.KakaduGuideLogoSvg;exports.KakaduGuideLogoVariant=i.KakaduGuideLogoVariant;exports.KakaduIndexLogo=K.default;exports.KakaduAcademyLogo=V.default;exports.KakaduLogo=N.default;exports.Modal=r.default;exports.ModalActions=r.ModalActions;exports.ModalContent=r.ModalContent;exports.ModalHeading=r.ModalHeading;exports.useModal=r.useModal;exports.useModalContext=r.useModalContext;exports.MovingGradients=U.default;exports.MovingStars=W.default;exports.Notice=l.default;exports.NoticeType=l.NoticeType;exports.NotificationType=l.NoticeType;exports.Notification=d.default;exports.NotificationProvider=d.NotificationProvider;exports.useCreateNotification=d.useCreateNotification;exports.PopoverMenu=h.default;exports.usePopoverMenu=h.usePopoverMenu;exports.Popover=a.default;exports.PopoverContainer=a.PopoverContainer;exports.usePopover=a.usePopover;exports.usePopoverContext=a.usePopoverContext;exports.Revealer=y.default;exports.useRevealer=y.useRevealer;exports.Separator=u.default;exports.SeparatorLabel=u.SeparatorLabel;exports.SmallSeparator=u.SmallSeparator;exports.VerticalSeparator=u.VerticalSeparator;exports.Skeleton=k.default;exports.SkeletonInstance=k.SkeletonInstance;exports.Sparebank1Logo=J.default;exports.RevealSpinner=L.RevealSpinner;exports.Spinner=L.default;exports.StoLogo=j.default;exports.StorebrandLogo=Q.default;exports.AnchorHeading=e.AnchorHeading;exports.Heading=e.Heading;exports.Hero=e.Hero;exports.Label=e.Label;exports.Paragraph=e.Paragraph;exports.Span=e.Span;exports.Text=e.default;exports.defaultHeadingElementType=e.defaultHeadingElementType;exports.spanStyles=e.spanStyles;exports.textShadowStyles=e.textShadowStyles;exports.TextButton=T.default;exports.TextButtonVariant=T.TextButtonVariant;exports.ThemeSetter=n.default;exports.getThemePreference=n.getThemePreference;exports.setThemePreference=n.setThemePreference;exports.themePreferences=n.themePreferences;exports.useIsDarkMode=n.useIsDarkMode;exports.useIsLightMode=n.useIsLightMode;exports.useTheme=n.useTheme;exports.Veil=O.default;exports.Wrapper=C.default;exports.WrapperWidth=C.WrapperWidth;exports.Icon=p.default;exports.IconType=p.IconType;exports.iconShadowStyles=p.iconShadowStyles;exports.KakaduGuideIconSvg=z.default;exports.KakaduGuideGlyphSvg=X.default;exports.DotsSvg=Y.default;exports.MenuSvg=Z.default;exports.CheckSvg=$.default;exports.PlusSvg=ee.default;exports.TimesSvg=oe.default;exports.ChevronUpSvg=te.default;exports.ChevronRightSvg=ne.default;exports.ChevronDownSvg=re.default;exports.ChevronLeftSvg=ae.default;exports.CaretUpSvg=ue.default;exports.CaretRightSvg=se.default;exports.CaretDownSvg=ce.default;exports.CaretLeftSvg=ie.default;exports.ArrowUpSvg=le.default;exports.ArrowRightSvg=de.default;exports.ArrowDownSvg=pe.default;exports.ArrowLeftSvg=fe.default;exports.AnchorUpSvg=ge.default;exports.AnchorDownSvg=Se.default;exports.TrendUpSvg=me.default;exports.EyeSvg=qe.default;exports.EditSvg=_e.default;exports.CogSvg=ve.default;exports.CopySvg=he.default;exports.DocumentSvg=ye.default;exports.SelectSvg=ke.default;exports.TestSvg=Le.default;exports.ShareSvg=Te.default;exports.PackageSvg=Ce.default;exports.ExternalSvg=be.default;exports.ExclamationTriangleSvg=Be.default;exports.SparkleSvg=Pe.default;exports.TrashSvg=xe.default;exports.ChromeBrowserLogoSvg=we.default;exports.EdgeBrowserLogoSvg=Ie.default;exports.useMediaQuery=Me.default;exports.useFetch=s.default;exports.useFetcher=s.useFetcher;exports.useJsonFetch=s.useJsonFetch;exports.useJsonFetcher=s.useJsonFetcher;exports.copyToClipboard=Ge.default;exports.generateRandomId=Ae.default;exports.scale=De.default;
|
package/build/index.mjs
CHANGED
|
@@ -3,8 +3,8 @@ import { default as n, ariaTextStyles as x } from "./components/aria-text.mjs";
|
|
|
3
3
|
import { default as S, defaultAtomElementType as i } from "./components/atom.mjs";
|
|
4
4
|
import { default as c } from "./components/bankid-logo.mjs";
|
|
5
5
|
import { default as y } from "./components/box.mjs";
|
|
6
|
-
import { default as T, ButtonLoader as k, ButtonVariant as L, buttonDangerStyles as B, buttonSecondaryStyles as P, buttonSuccessStyles as I, buttonWarningStyles as
|
|
7
|
-
import { default as
|
|
6
|
+
import { default as T, ButtonLoader as k, ButtonVariant as L, buttonDangerStyles as B, buttonSecondaryStyles as P, buttonSuccessStyles as I, buttonWarningStyles as M } from "./components/button.mjs";
|
|
7
|
+
import { default as A, ButtonTooltipPosition as b } from "./components/button-tooltip.mjs";
|
|
8
8
|
import { default as G } from "./components/card.mjs";
|
|
9
9
|
import { default as K } from "./components/click-ripples.mjs";
|
|
10
10
|
import { default as E } from "./components/collapsible.mjs";
|
|
@@ -26,112 +26,112 @@ import { default as he, KakaduGuideLogoSvg as ye, KakaduGuideLogoVariant as Ce }
|
|
|
26
26
|
import { default as ke } from "./components/kakadu-index-logo.mjs";
|
|
27
27
|
import { default as Be } from "./components/kakadu-academy-logo.mjs";
|
|
28
28
|
import { default as Ie } from "./components/kakadu-logo.mjs";
|
|
29
|
-
import { default as
|
|
30
|
-
import { default as
|
|
31
|
-
import { default as
|
|
32
|
-
import { default as
|
|
33
|
-
import { default as
|
|
34
|
-
import { default as
|
|
35
|
-
import { default as
|
|
36
|
-
import { default as
|
|
37
|
-
import { default as
|
|
38
|
-
import { default as
|
|
39
|
-
import { default as
|
|
40
|
-
import { RevealSpinner as
|
|
41
|
-
import { default as
|
|
42
|
-
import { default as
|
|
43
|
-
import { AnchorHeading as
|
|
44
|
-
import { default as
|
|
45
|
-
import { default as
|
|
46
|
-
import { default as
|
|
47
|
-
import { default as
|
|
48
|
-
import { default as
|
|
49
|
-
import { default as
|
|
50
|
-
import { default as
|
|
51
|
-
import { default as
|
|
52
|
-
import { default as
|
|
53
|
-
import { default as
|
|
54
|
-
import { default as
|
|
55
|
-
import { default as
|
|
56
|
-
import { default as
|
|
57
|
-
import { default as
|
|
58
|
-
import { default as
|
|
59
|
-
import { default as
|
|
60
|
-
import { default as
|
|
61
|
-
import { default as
|
|
62
|
-
import { default as
|
|
63
|
-
import { default as
|
|
64
|
-
import { default as
|
|
65
|
-
import { default as
|
|
66
|
-
import { default as
|
|
67
|
-
import { default as
|
|
68
|
-
import { default as
|
|
69
|
-
import { default as
|
|
70
|
-
import { default as
|
|
71
|
-
import { default as
|
|
72
|
-
import { default as
|
|
73
|
-
import { default as
|
|
74
|
-
import { default as
|
|
75
|
-
import { default as
|
|
76
|
-
import { default as
|
|
77
|
-
import { default as
|
|
78
|
-
import { default as
|
|
79
|
-
import { default as
|
|
80
|
-
import { default as
|
|
81
|
-
import { default as
|
|
82
|
-
import { default as
|
|
83
|
-
import { default as
|
|
84
|
-
import { default as
|
|
85
|
-
import { default as
|
|
86
|
-
import { default as
|
|
87
|
-
import { default as
|
|
88
|
-
import { default as
|
|
29
|
+
import { default as we, ModalActions as Ae, ModalContent as be, ModalHeading as De, useModal as Ge, useModalContext as Fe } from "./components/modal.mjs";
|
|
30
|
+
import { default as Re } from "./components/moving-gradients.mjs";
|
|
31
|
+
import { default as He } from "./components/moving-stars.mjs";
|
|
32
|
+
import { default as Ve, NoticeType as Ue, NoticeType as We } from "./components/notice.mjs";
|
|
33
|
+
import { default as je, NotificationProvider as Qe, useCreateNotification as qe } from "./components/notification.mjs";
|
|
34
|
+
import { default as Oe, usePopoverMenu as Xe } from "./components/popover-menu.mjs";
|
|
35
|
+
import { default as Ze, PopoverContainer as _e, usePopover as $e, usePopoverContext as eo } from "./components/popover.mjs";
|
|
36
|
+
import { default as to, useRevealer as ao } from "./components/revealer.mjs";
|
|
37
|
+
import { default as fo, SeparatorLabel as lo, SmallSeparator as uo, VerticalSeparator as so } from "./components/separator.mjs";
|
|
38
|
+
import { default as mo, SkeletonInstance as no } from "./components/skeleton.mjs";
|
|
39
|
+
import { default as go } from "./components/sparebank1-logo.mjs";
|
|
40
|
+
import { RevealSpinner as io, default as vo } from "./components/spinner.mjs";
|
|
41
|
+
import { default as ho } from "./components/sto-logo.mjs";
|
|
42
|
+
import { default as Co } from "./components/storebrand-logo.mjs";
|
|
43
|
+
import { AnchorHeading as ko, Heading as Lo, Hero as Bo, Label as Po, Paragraph as Io, Span as Mo, default as wo, defaultHeadingElementType as Ao, spanStyles as bo, textShadowStyles as Do } from "./components/text.mjs";
|
|
44
|
+
import { default as Fo, TextButtonVariant as Ko } from "./components/text-button.mjs";
|
|
45
|
+
import { default as Eo, getThemePreference as Ho, setThemePreference as No, themePreferences as Vo, useIsDarkMode as Uo, useIsLightMode as Wo, useTheme as Jo } from "./components/theme-setter.mjs";
|
|
46
|
+
import { default as Qo } from "./components/veil.mjs";
|
|
47
|
+
import { default as zo, WrapperWidth as Oo } from "./components/wrapper.mjs";
|
|
48
|
+
import { default as Yo, IconType as Zo, iconShadowStyles as _o } from "./icons/icon.mjs";
|
|
49
|
+
import { default as et } from "./icons/kakadu-guide-icon.mjs";
|
|
50
|
+
import { default as tt } from "./icons/kakadu-guide-glyph.mjs";
|
|
51
|
+
import { default as rt } from "./icons/dots.mjs";
|
|
52
|
+
import { default as lt } from "./icons/menu.mjs";
|
|
53
|
+
import { default as dt } from "./icons/check.mjs";
|
|
54
|
+
import { default as pt } from "./icons/plus.mjs";
|
|
55
|
+
import { default as nt } from "./icons/times.mjs";
|
|
56
|
+
import { default as gt } from "./icons/chevron-up.mjs";
|
|
57
|
+
import { default as it } from "./icons/chevron-right.mjs";
|
|
58
|
+
import { default as ct } from "./icons/chevron-down.mjs";
|
|
59
|
+
import { default as yt } from "./icons/chevron-left.mjs";
|
|
60
|
+
import { default as Tt } from "./icons/caret-up.mjs";
|
|
61
|
+
import { default as Lt } from "./icons/caret-right.mjs";
|
|
62
|
+
import { default as Pt } from "./icons/caret-down.mjs";
|
|
63
|
+
import { default as Mt } from "./icons/caret-left.mjs";
|
|
64
|
+
import { default as At } from "./icons/arrow-up.mjs";
|
|
65
|
+
import { default as Dt } from "./icons/arrow-right.mjs";
|
|
66
|
+
import { default as Ft } from "./icons/arrow-down.mjs";
|
|
67
|
+
import { default as Rt } from "./icons/arrow-left.mjs";
|
|
68
|
+
import { default as Ht } from "./icons/anchor-up.mjs";
|
|
69
|
+
import { default as Vt } from "./icons/anchor-down.mjs";
|
|
70
|
+
import { default as Wt } from "./icons/trend-up.mjs";
|
|
71
|
+
import { default as jt } from "./icons/eye.mjs";
|
|
72
|
+
import { default as qt } from "./icons/edit.mjs";
|
|
73
|
+
import { default as Ot } from "./icons/cog.mjs";
|
|
74
|
+
import { default as Yt } from "./icons/copy.mjs";
|
|
75
|
+
import { default as _t } from "./icons/document.mjs";
|
|
76
|
+
import { default as ea } from "./icons/select.mjs";
|
|
77
|
+
import { default as ta } from "./icons/test.mjs";
|
|
78
|
+
import { default as ra } from "./icons/share.mjs";
|
|
79
|
+
import { default as la } from "./icons/package.mjs";
|
|
80
|
+
import { default as da } from "./icons/external.mjs";
|
|
81
|
+
import { default as pa } from "./icons/exclamation-triangle.mjs";
|
|
82
|
+
import { default as na } from "./icons/sparkle.mjs";
|
|
83
|
+
import { default as ga } from "./icons/trash.mjs";
|
|
84
|
+
import { default as ia } from "./icons/chrome-browser-logo.mjs";
|
|
85
|
+
import { default as ca } from "./icons/edge-browser-logo.mjs";
|
|
86
|
+
import { default as ya } from "./hooks/use-media-query.mjs";
|
|
87
|
+
import { default as Ta, useFetcher as ka, useJsonFetch as La, useJsonFetcher as Ba } from "./hooks/use-fetch.mjs";
|
|
88
|
+
import { default as Ia } from "./utilities/copy-to-clipboard.mjs";
|
|
89
89
|
import { default as wa } from "./utilities/generate-random-id.mjs";
|
|
90
90
|
import { default as ba } from "./utilities/scale.mjs";
|
|
91
91
|
export {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
Vt as AnchorDownSvg,
|
|
93
|
+
ko as AnchorHeading,
|
|
94
|
+
Ht as AnchorUpSvg,
|
|
95
95
|
n as AriaText,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
Ft as ArrowDownSvg,
|
|
97
|
+
Rt as ArrowLeftSvg,
|
|
98
|
+
Dt as ArrowRightSvg,
|
|
99
|
+
At as ArrowUpSvg,
|
|
100
100
|
S as Atom,
|
|
101
101
|
c as BankidLogo,
|
|
102
102
|
y as Box,
|
|
103
103
|
T as Button,
|
|
104
104
|
k as ButtonLoader,
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
A as ButtonTooltip,
|
|
106
|
+
b as ButtonTooltipPosition,
|
|
107
107
|
L as ButtonVariant,
|
|
108
108
|
G as Card,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
109
|
+
Pt as CaretDownSvg,
|
|
110
|
+
Mt as CaretLeftSvg,
|
|
111
|
+
Lt as CaretRightSvg,
|
|
112
|
+
Tt as CaretUpSvg,
|
|
113
|
+
dt as CheckSvg,
|
|
114
|
+
ct as ChevronDownSvg,
|
|
115
|
+
yt as ChevronLeftSvg,
|
|
116
|
+
it as ChevronRightSvg,
|
|
117
|
+
gt as ChevronUpSvg,
|
|
118
|
+
ia as ChromeBrowserLogoSvg,
|
|
119
119
|
K as ClickRipples,
|
|
120
|
-
|
|
120
|
+
Ot as CogSvg,
|
|
121
121
|
E as Collapsible,
|
|
122
122
|
N as CopyIconButton,
|
|
123
|
-
|
|
123
|
+
Yt as CopySvg,
|
|
124
124
|
U as Datum,
|
|
125
125
|
J as Decorators,
|
|
126
126
|
Q as DnbLogo,
|
|
127
|
-
|
|
127
|
+
_t as DocumentSvg,
|
|
128
128
|
z as Dot,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
129
|
+
rt as DotsSvg,
|
|
130
|
+
ca as EdgeBrowserLogoSvg,
|
|
131
|
+
qt as EditSvg,
|
|
132
|
+
pa as ExclamationTriangleSvg,
|
|
133
|
+
da as ExternalSvg,
|
|
134
|
+
jt as EyeSvg,
|
|
135
135
|
X as Flex,
|
|
136
136
|
Y as FlexAlignment,
|
|
137
137
|
t as FontFamilyHead,
|
|
@@ -140,108 +140,109 @@ export {
|
|
|
140
140
|
oe as Gauge,
|
|
141
141
|
ae as GjensidigeLogo,
|
|
142
142
|
fe as Header,
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
Lo as Heading,
|
|
144
|
+
Bo as Hero,
|
|
145
145
|
ue as HoverGradient,
|
|
146
|
-
|
|
146
|
+
Yo as Icon,
|
|
147
147
|
pe as IconButton,
|
|
148
148
|
me as IconButtonVariant,
|
|
149
|
-
|
|
149
|
+
Zo as IconType,
|
|
150
150
|
xe as Input,
|
|
151
151
|
Be as KakaduAcademyLogo,
|
|
152
|
-
|
|
152
|
+
tt as KakaduGuideGlyphSvg,
|
|
153
153
|
ve as KakaduGuideIcon,
|
|
154
|
-
|
|
154
|
+
et as KakaduGuideIconSvg,
|
|
155
155
|
he as KakaduGuideLogo,
|
|
156
156
|
ye as KakaduGuideLogoSvg,
|
|
157
157
|
Ce as KakaduGuideLogoVariant,
|
|
158
158
|
ke as KakaduIndexLogo,
|
|
159
159
|
Ie as KakaduLogo,
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
Po as Label,
|
|
161
|
+
lt as MenuSvg,
|
|
162
|
+
we as Modal,
|
|
163
|
+
Ae as ModalActions,
|
|
163
164
|
be as ModalContent,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
165
|
+
De as ModalHeading,
|
|
166
|
+
Re as MovingGradients,
|
|
167
|
+
He as MovingStars,
|
|
168
|
+
Ve as Notice,
|
|
169
|
+
Ue as NoticeType,
|
|
170
|
+
je as Notification,
|
|
171
|
+
Qe as NotificationProvider,
|
|
172
|
+
We as NotificationType,
|
|
173
|
+
la as PackageSvg,
|
|
174
|
+
Io as Paragraph,
|
|
175
|
+
pt as PlusSvg,
|
|
176
|
+
Ze as Popover,
|
|
177
|
+
_e as PopoverContainer,
|
|
178
|
+
Oe as PopoverMenu,
|
|
179
|
+
io as RevealSpinner,
|
|
180
|
+
to as Revealer,
|
|
180
181
|
ge as Select,
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
182
|
+
ea as SelectSvg,
|
|
183
|
+
fo as Separator,
|
|
184
|
+
lo as SeparatorLabel,
|
|
185
|
+
ra as ShareSvg,
|
|
186
|
+
mo as Skeleton,
|
|
187
|
+
no as SkeletonInstance,
|
|
188
|
+
uo as SmallSeparator,
|
|
189
|
+
Mo as Span,
|
|
190
|
+
go as Sparebank1Logo,
|
|
191
|
+
na as SparkleSvg,
|
|
192
|
+
vo as Spinner,
|
|
193
|
+
ho as StoLogo,
|
|
194
|
+
Co as StorebrandLogo,
|
|
195
|
+
ta as TestSvg,
|
|
195
196
|
wo as Text,
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
197
|
+
Fo as TextButton,
|
|
198
|
+
Ko as TextButtonVariant,
|
|
199
|
+
Eo as ThemeSetter,
|
|
200
|
+
nt as TimesSvg,
|
|
201
|
+
ga as TrashSvg,
|
|
202
|
+
Wt as TrendUpSvg,
|
|
203
|
+
Qo as Veil,
|
|
204
|
+
so as VerticalSeparator,
|
|
205
|
+
zo as Wrapper,
|
|
206
|
+
Oo as WrapperWidth,
|
|
206
207
|
x as ariaTextStyles,
|
|
207
208
|
B as buttonDangerStyles,
|
|
208
209
|
a as buttonResetStyles,
|
|
209
210
|
P as buttonSecondaryStyles,
|
|
210
211
|
I as buttonSuccessStyles,
|
|
211
|
-
|
|
212
|
-
|
|
212
|
+
M as buttonWarningStyles,
|
|
213
|
+
Ia as copyToClipboard,
|
|
213
214
|
r as darkBackgroundColor,
|
|
214
215
|
i as defaultAtomElementType,
|
|
215
|
-
|
|
216
|
+
Ao as defaultHeadingElementType,
|
|
216
217
|
f as effectStyles,
|
|
217
218
|
Se as errorParagraph,
|
|
218
219
|
l as font,
|
|
219
220
|
wa as generateRandomId,
|
|
220
|
-
|
|
221
|
-
|
|
221
|
+
Ho as getThemePreference,
|
|
222
|
+
_o as iconShadowStyles,
|
|
222
223
|
u as lightBackgroundColor,
|
|
223
224
|
d as nonInteractiveEffectStyles,
|
|
224
225
|
de as normalBlendStyles,
|
|
225
226
|
s as overflowProtectionStyles,
|
|
226
227
|
ba as scale,
|
|
227
|
-
|
|
228
|
+
No as setThemePreference,
|
|
228
229
|
bo as spanStyles,
|
|
229
|
-
|
|
230
|
+
Do as textShadowStyles,
|
|
230
231
|
p as theme,
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
232
|
+
Vo as themePreferences,
|
|
233
|
+
qe as useCreateNotification,
|
|
234
|
+
Ta as useFetch,
|
|
235
|
+
ka as useFetcher,
|
|
236
|
+
Uo as useIsDarkMode,
|
|
237
|
+
Wo as useIsLightMode,
|
|
238
|
+
La as useJsonFetch,
|
|
239
|
+
Ba as useJsonFetcher,
|
|
240
|
+
ya as useMediaQuery,
|
|
241
|
+
Ge as useModal,
|
|
242
|
+
Fe as useModalContext,
|
|
243
|
+
$e as usePopover,
|
|
244
|
+
eo as usePopoverContext,
|
|
245
|
+
Xe as usePopoverMenu,
|
|
246
|
+
ao as useRevealer,
|
|
247
|
+
Jo as useTheme
|
|
247
248
|
};
|