@kakadu/components 6.1.0 → 6.2.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/aria-text.d.ts +2 -1
- package/build/components/box.d.ts +2 -1
- package/build/components/button-tooltip.d.ts +2 -1
- package/build/components/button.d.ts +3 -3
- package/build/components/button.js +1 -1
- package/build/components/button.mjs +27 -25
- package/build/components/card.d.ts +2 -2
- package/build/components/click-ripples.d.ts +2 -2
- package/build/components/collapsible.d.ts +2 -2
- package/build/components/combobox.d.ts +2 -2
- package/build/components/copy-icon-button.d.ts +2 -1
- package/build/components/datum.d.ts +2 -2
- package/build/components/dot.d.ts +2 -2
- package/build/components/flex.d.ts +2 -1
- package/build/components/footer.d.ts +2 -2
- package/build/components/footer.js +1 -1
- package/build/components/footer.mjs +20 -20
- package/build/components/gauge.d.ts +2 -1
- package/build/components/header.d.ts +2 -1
- package/build/components/hover-gradient.d.ts +2 -2
- package/build/components/icon-button.d.ts +2 -2
- package/build/components/input.d.ts +3 -3
- package/build/components/input.js +2 -2
- package/build/components/input.mjs +21 -21
- package/build/components/logos/akt-logo.d.ts +2 -2
- package/build/components/logos/amedia-logo.d.ts +2 -2
- package/build/components/logos/bankaxept-logo.d.ts +2 -2
- package/build/components/logos/bankid-logo.d.ts +2 -2
- package/build/components/logos/dnb-logo.d.ts +2 -2
- package/build/components/logos/entur-logo.d.ts +2 -2
- package/build/components/logos/gjensidige-logo.d.ts +2 -2
- package/build/components/logos/kakadu-academy-logo.d.ts +2 -2
- package/build/components/logos/kakadu-guide-icon.d.ts +2 -1
- package/build/components/logos/kakadu-guide-logo.d.ts +3 -3
- package/build/components/logos/kakadu-index-logo.d.ts +2 -2
- package/build/components/logos/kakadu-logo.d.ts +2 -2
- package/build/components/logos/kakadu-play-logo.d.ts +2 -2
- package/build/components/logos/kolumbus-logo.d.ts +2 -2
- package/build/components/logos/nordea-logo.d.ts +2 -2
- package/build/components/logos/norsk-tipping-logo.d.ts +2 -2
- package/build/components/logos/ruter-logo.d.ts +2 -2
- package/build/components/logos/senteret-for-et-aldersvennlig-norge-logo.d.ts +2 -2
- package/build/components/logos/sparebank1-logo.d.ts +2 -2
- package/build/components/logos/sparebanken-norge-logo.d.ts +2 -2
- package/build/components/logos/sto-logo.d.ts +2 -2
- package/build/components/logos/storebrand-logo.d.ts +2 -2
- package/build/components/modal.d.ts +6 -6
- package/build/components/notice.d.ts +2 -2
- package/build/components/notification.d.ts +8 -6
- package/build/components/notification.js +1 -1
- package/build/components/notification.mjs +87 -71
- package/build/components/popover-menu.d.ts +3 -3
- package/build/components/popover.d.ts +4 -4
- package/build/components/revealer.d.ts +2 -2
- package/build/components/select.d.ts +2 -2
- package/build/components/separator.d.ts +5 -5
- package/build/components/skeleton.d.ts +3 -2
- package/build/components/spinner.d.ts +3 -2
- package/build/components/text-button.d.ts +2 -2
- package/build/components/text.d.ts +9 -8
- package/build/components/theme-setter.d.ts +2 -2
- package/build/components/veil.d.ts +2 -1
- package/build/components/wrapper.d.ts +2 -2
- package/build/components.css +1 -1
- package/build/icons/anchor-down.d.ts +2 -2
- package/build/icons/anchor-up.d.ts +2 -2
- package/build/icons/arrow-down.d.ts +2 -2
- package/build/icons/arrow-left.d.ts +2 -2
- package/build/icons/arrow-right.d.ts +2 -2
- package/build/icons/arrow-up.d.ts +2 -2
- package/build/icons/caret-down.d.ts +2 -2
- package/build/icons/caret-left.d.ts +2 -2
- package/build/icons/caret-right.d.ts +2 -2
- package/build/icons/caret-up.d.ts +2 -2
- package/build/icons/check.d.ts +2 -2
- package/build/icons/chevron-down.d.ts +2 -2
- package/build/icons/chevron-left.d.ts +2 -2
- package/build/icons/chevron-right.d.ts +2 -2
- package/build/icons/chevron-up.d.ts +2 -2
- package/build/icons/chrome-browser-logo.d.ts +2 -2
- package/build/icons/cog.d.ts +2 -2
- package/build/icons/copy.d.ts +2 -2
- package/build/icons/document.d.ts +2 -2
- package/build/icons/dots.d.ts +2 -2
- package/build/icons/drag.d.ts +2 -2
- package/build/icons/edge-browser-logo.d.ts +2 -2
- package/build/icons/edit.d.ts +2 -2
- package/build/icons/exclamation-triangle.d.ts +2 -2
- package/build/icons/external.d.ts +2 -2
- package/build/icons/eye.d.ts +2 -2
- package/build/icons/icon.d.ts +2 -2
- package/build/icons/information.d.ts +2 -2
- package/build/icons/kakadu-guide-glyph.d.ts +2 -2
- package/build/icons/kakadu-guide-icon.d.ts +2 -2
- package/build/icons/menu.d.ts +2 -2
- package/build/icons/package.d.ts +2 -2
- package/build/icons/plus.d.ts +2 -2
- package/build/icons/select.d.ts +2 -2
- package/build/icons/share.d.ts +2 -2
- package/build/icons/sparkle.d.ts +2 -2
- package/build/icons/test.d.ts +2 -2
- package/build/icons/times.d.ts +2 -2
- package/build/icons/trash.d.ts +2 -2
- package/build/icons/trend-up.d.ts +2 -2
- package/build/theme.d.ts +2 -1
- package/package.json +16 -22
|
@@ -26,9 +26,9 @@ function we({
|
|
|
26
26
|
warning: c,
|
|
27
27
|
warningId: x,
|
|
28
28
|
information: r,
|
|
29
|
-
informationId:
|
|
29
|
+
informationId: C,
|
|
30
30
|
footnote: a,
|
|
31
|
-
attachments:
|
|
31
|
+
attachments: S,
|
|
32
32
|
className: p,
|
|
33
33
|
children: u,
|
|
34
34
|
...k
|
|
@@ -39,9 +39,9 @@ function we({
|
|
|
39
39
|
/* @__PURE__ */ e.jsxs("span", { className: "kakadu-components-3298764637", children: [
|
|
40
40
|
u,
|
|
41
41
|
f ? /* @__PURE__ */ e.jsx(Be, { className: "kakadu-components-613632806", children: a }) : null,
|
|
42
|
-
|
|
42
|
+
S
|
|
43
43
|
] }),
|
|
44
|
-
j || i || b ? /* @__PURE__ */ e.jsx("div", { className: "kakadu-components-2927674627", children: j ? /* @__PURE__ */ e.jsx(M, { id: m, className: Se, children: l instanceof Error ? l.message : l }) : i ? /* @__PURE__ */ e.jsx(M, { id: x, className: Ee, children: c instanceof Error ? c.message : c }) : b ? /* @__PURE__ */ e.jsx(M, { id:
|
|
44
|
+
j || i || b ? /* @__PURE__ */ e.jsx("div", { className: "kakadu-components-2927674627", children: j ? /* @__PURE__ */ e.jsx(M, { id: m, className: Se, children: l instanceof Error ? l.message : l }) : i ? /* @__PURE__ */ e.jsx(M, { id: x, className: Ee, children: c instanceof Error ? c.message : c }) : b ? /* @__PURE__ */ e.jsx(M, { id: C, className: Ie, children: r instanceof Error ? r.message : r }) : null }) : null
|
|
45
45
|
] }) });
|
|
46
46
|
}
|
|
47
47
|
const Le = 40, A = "kakadu-components-4233741488";
|
|
@@ -52,9 +52,9 @@ function Ge({
|
|
|
52
52
|
error: c,
|
|
53
53
|
warning: x,
|
|
54
54
|
information: r,
|
|
55
|
-
footnote:
|
|
55
|
+
footnote: C,
|
|
56
56
|
suggestion: a,
|
|
57
|
-
attachments:
|
|
57
|
+
attachments: S,
|
|
58
58
|
actions: p = [],
|
|
59
59
|
hasCopyButton: u,
|
|
60
60
|
hasClearButton: k,
|
|
@@ -62,20 +62,20 @@ function Ge({
|
|
|
62
62
|
onChange: i,
|
|
63
63
|
children: b,
|
|
64
64
|
className: f,
|
|
65
|
-
...
|
|
65
|
+
...y
|
|
66
66
|
}) {
|
|
67
67
|
const O = P(null), W = P(null), E = P(null), z = Ne(), I = fe(), D = `${I}-error`, G = `${I}-warning`, U = `${I}-information`, {
|
|
68
|
-
value:
|
|
68
|
+
value: g,
|
|
69
69
|
disabled: ae
|
|
70
|
-
} =
|
|
70
|
+
} = y, [se, q] = T(""), s = g ?? se, [oe, le] = T(), ce = l === "textarea" || !!j;
|
|
71
71
|
he(() => {
|
|
72
72
|
typeof s == "string" && E.current && le(E.current.scrollHeight);
|
|
73
73
|
}, [s]);
|
|
74
74
|
const B = H(() => typeof s == "string" ? `${s} `.split(`
|
|
75
|
-
`) : [], [s]), re = H(() => B.length, [B]),
|
|
75
|
+
`) : [], [s]), re = H(() => B.length, [B]), N = !!c, w = !N && !!x, L = !!r, J = N ? D : w ? G : L ? U : void 0;
|
|
76
76
|
xe(() => {
|
|
77
|
-
q(typeof
|
|
78
|
-
}, [
|
|
77
|
+
q(typeof g == "string" ? g : "");
|
|
78
|
+
}, [g]);
|
|
79
79
|
const K = h((n) => {
|
|
80
80
|
const {
|
|
81
81
|
value: t
|
|
@@ -86,7 +86,7 @@ function Ge({
|
|
|
86
86
|
type: "success",
|
|
87
87
|
children: "Copied to clipboard."
|
|
88
88
|
}));
|
|
89
|
-
}, [s, z]),
|
|
89
|
+
}, [s, z]), v = h((n) => {
|
|
90
90
|
var Y;
|
|
91
91
|
const t = W.current ?? O.current ?? void 0;
|
|
92
92
|
if (t) {
|
|
@@ -102,18 +102,18 @@ function Ge({
|
|
|
102
102
|
}
|
|
103
103
|
throw new Error("Unable to set value.");
|
|
104
104
|
}, []), de = h(() => {
|
|
105
|
-
|
|
106
|
-
}, [
|
|
105
|
+
v("");
|
|
106
|
+
}, [v]), [me, pe] = T(""), Q = !!a && me !== a, ue = h(() => {
|
|
107
107
|
if (a) {
|
|
108
108
|
try {
|
|
109
|
-
|
|
109
|
+
v(a);
|
|
110
110
|
} catch {
|
|
111
111
|
_(a);
|
|
112
112
|
}
|
|
113
113
|
pe(a);
|
|
114
114
|
}
|
|
115
|
-
}, [a,
|
|
116
|
-
return /* @__PURE__ */ e.jsxs(we, { ref: d, label: m, error: c, errorId: D, warning: x, warningId: G, information: r, informationId: U, footnote:
|
|
115
|
+
}, [a, v]), X = H(() => p.length, [p]);
|
|
116
|
+
return /* @__PURE__ */ e.jsxs(we, { ref: d, label: m, error: c, errorId: D, warning: x, warningId: G, information: r, informationId: U, footnote: C, attachments: /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
117
117
|
/* @__PURE__ */ e.jsx(ge, { isCollapsed: !Q, children: Q ? /* @__PURE__ */ e.jsxs("button", { type: "button", className: o(je, te, "kakadu-components-4141839293"), onClick: ue, children: [
|
|
118
118
|
/* @__PURE__ */ e.jsx(ye, { label: "Apply suggestion" }),
|
|
119
119
|
/* @__PURE__ */ e.jsx(be, { width: 13, height: 13, className: "kakadu-components-1417828741" }),
|
|
@@ -121,7 +121,7 @@ function Ge({
|
|
|
121
121
|
/* @__PURE__ */ e.jsx(ee, { className: "kakadu-components-2744733744" }),
|
|
122
122
|
/* @__PURE__ */ e.jsx(ne, {})
|
|
123
123
|
] }) : null }),
|
|
124
|
-
|
|
124
|
+
S
|
|
125
125
|
] }), style: {
|
|
126
126
|
"--button-padding": `calc(${Le * ((u ? 1 : 0) + (k ? 1 : 0) + X)}px + 6px)`
|
|
127
127
|
}, children: [
|
|
@@ -137,10 +137,10 @@ function Ge({
|
|
|
137
137
|
)),
|
|
138
138
|
" "
|
|
139
139
|
] }),
|
|
140
|
-
/* @__PURE__ */ e.jsx("textarea", { ...
|
|
140
|
+
/* @__PURE__ */ e.jsx("textarea", { ...y, ref: W, rows: y.rows ?? 1, "aria-invalid": N, "data-warning": w, "data-information": L, "aria-describedby": J, value: s, className: o($, f, "kakadu-components-2119524139"), style: {
|
|
141
141
|
minHeight: oe
|
|
142
142
|
}, onChange: K })
|
|
143
|
-
] }) : /* @__PURE__ */ e.jsx("input", { ...
|
|
143
|
+
] }) : /* @__PURE__ */ e.jsx("input", { ...y, ref: O, type: l ?? "text", value: s, "aria-invalid": N, "data-warning": w, "data-information": L, "aria-describedby": J, className: o($, f), onChange: K }),
|
|
144
144
|
ae ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
145
145
|
/* @__PURE__ */ e.jsx(ee, { className: "kakadu-components-616311160" }),
|
|
146
146
|
/* @__PURE__ */ e.jsx(ne, { className: "kakadu-components-1962999040" })
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function AktLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function AktLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function AmediaLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function AmediaLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function BankAxeptLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function BankAxeptLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function BankIdLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function BankIdLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function DnbLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function DnbLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function EnturLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function EnturLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function GjensidigeLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function GjensidigeLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function KakaduAcademyLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function KakaduAcademyLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export declare function KakaduGuideLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export declare function KakaduGuideLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
3
3
|
export declare const kakaduGuideLogoVariants: readonly ["default", "flat"];
|
|
4
4
|
export type KakaduGuideLogoVariant = (typeof kakaduGuideLogoVariants)[number];
|
|
5
5
|
export default function KakaduGuideLogo({ variant, height, }: {
|
|
6
6
|
readonly variant?: KakaduGuideLogoVariant;
|
|
7
7
|
readonly height?: number;
|
|
8
|
-
}):
|
|
8
|
+
}): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function KakaduIndexLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function KakaduIndexLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function KakaduLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function KakaduLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function KakaduPlayLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function KakaduPlayLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function KolumbusLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function KolumbusLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function NordeaLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function NordeaLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function NorskTippingLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function NorskTippingLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function RuterLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function RuterLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function SenteretForEtAldersvennligNorgeLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function SenteretForEtAldersvennligNorgeLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function Sparebank1LogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function Sparebank1LogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function SparebankenNorgeLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function SparebankenNorgeLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function StoLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function StoLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
export default function StorebrandLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>):
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export default function StorebrandLogoSvg({ fill, ...properties }: ComponentPropsWithoutRef<'svg'>): React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentType, type ReactNode } from 'react';
|
|
1
|
+
import React, { type ComponentType, type ReactNode } from 'react';
|
|
2
2
|
import { type DecoratorType } from './decorators';
|
|
3
3
|
import { type FlexProperties } from './flex';
|
|
4
4
|
import { type AtomProperties, type AtomElementType, type DefaultAtomElementType } from './atom';
|
|
@@ -11,9 +11,9 @@ type ModalProviderProperties<Data = any> = {
|
|
|
11
11
|
close?: (data?: Data) => void;
|
|
12
12
|
};
|
|
13
13
|
export declare function useModalContext<Data = any>(): ModalProviderProperties<Data>;
|
|
14
|
-
export declare function ModalContent<Type extends AtomElementType = DefaultAtomElementType>(properties: FlexProperties<Type>):
|
|
15
|
-
export declare function ModalHeading<Type extends AtomElementType = DefaultHeadingElementType>({ as, className, ...properties }: AtomProperties<Type>):
|
|
16
|
-
export declare function ModalActions<Type extends AtomElementType = DefaultAtomElementType>({ as, ...properties }: FlexProperties<Type>):
|
|
14
|
+
export declare function ModalContent<Type extends AtomElementType = DefaultAtomElementType>(properties: FlexProperties<Type>): React.JSX.Element;
|
|
15
|
+
export declare function ModalHeading<Type extends AtomElementType = DefaultHeadingElementType>({ as, className, ...properties }: AtomProperties<Type>): React.JSX.Element;
|
|
16
|
+
export declare function ModalActions<Type extends AtomElementType = DefaultAtomElementType>({ as, ...properties }: FlexProperties<Type>): React.JSX.Element;
|
|
17
17
|
export type ModalProperties<Data = any> = {
|
|
18
18
|
readonly root?: HTMLElement | ShadowRoot;
|
|
19
19
|
readonly outerDecorators?: DecoratorType[];
|
|
@@ -30,11 +30,11 @@ export type ModalProperties<Data = any> = {
|
|
|
30
30
|
readonly children?: ReactNode;
|
|
31
31
|
};
|
|
32
32
|
type ModalBaseProperties<ModalResult> = Omit<ModalProperties<ModalResult>, 'isVisible' | 'onClose'>;
|
|
33
|
-
export default function Modal<Data = any>({ root, outerDecorators, innerDecorators, label, maxWidth, className, isVisible, isFullWidth, shouldCloseOnOutsideClick, shouldCloseOnEscapePress, showCloseButton, onClose, children, }: ModalProperties<Data>):
|
|
33
|
+
export default function Modal<Data = any>({ root, outerDecorators, innerDecorators, label, maxWidth, className, isVisible, isFullWidth, shouldCloseOnOutsideClick, shouldCloseOnEscapePress, showCloseButton, onClose, children, }: ModalProperties<Data>): React.JSX.Element | null;
|
|
34
34
|
export declare function useModal<ModalResult, ModalProperties = ModalBaseProperties<ModalResult>>(ModalComponent: ComponentType<ModalProperties>, properties?: ModalProperties): {
|
|
35
35
|
isVisible: boolean;
|
|
36
36
|
show: () => Promise<ModalResult | undefined>;
|
|
37
37
|
close: (result?: ModalResult) => void;
|
|
38
|
-
modal:
|
|
38
|
+
modal: React.JSX.Element | null;
|
|
39
39
|
};
|
|
40
40
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type HTMLProps } from 'react';
|
|
1
|
+
import React, { type HTMLProps } from 'react';
|
|
2
2
|
import { type IconType } from '../icons/icon';
|
|
3
3
|
export declare const noticeTypes: readonly ["default", "success", "information", "warning", "danger"];
|
|
4
4
|
export type NoticeType = (typeof noticeTypes)[number];
|
|
@@ -6,4 +6,4 @@ export type NoticeProperties = HTMLProps<HTMLDivElement> & {
|
|
|
6
6
|
readonly type?: NoticeType;
|
|
7
7
|
readonly icon?: IconType;
|
|
8
8
|
};
|
|
9
|
-
export default function Notice({ type, icon, className, children, ...properties }: NoticeProperties):
|
|
9
|
+
export default function Notice({ type, icon, className, children, ...properties }: NoticeProperties): React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type HTMLProps, type ReactNode } from 'react';
|
|
1
|
+
import React, { type HTMLProps, type ReactNode } from 'react';
|
|
2
2
|
import { type IconType } from '../icons/icon';
|
|
3
3
|
import { type NoticeType } from './notice';
|
|
4
4
|
export { noticeTypes as notificationTypes } from './notice';
|
|
@@ -8,12 +8,14 @@ export type NotificationProperties = {
|
|
|
8
8
|
readonly type?: NoticeType;
|
|
9
9
|
readonly icon?: IconType;
|
|
10
10
|
readonly children: ReactNode;
|
|
11
|
-
readonly onDismiss?: (
|
|
11
|
+
readonly onDismiss?: (id: string) => void;
|
|
12
12
|
};
|
|
13
|
-
export default function Notification({ type, icon, index, className, children, onDismiss, ...properties }: NotificationProperties & {
|
|
13
|
+
export default function Notification({ type, icon, id, index: inputIndex, shouldDismiss, className, children, onDismiss, ...properties }: NotificationProperties & {
|
|
14
14
|
readonly index?: number;
|
|
15
|
-
|
|
15
|
+
readonly shouldDismiss?: boolean;
|
|
16
|
+
} & HTMLProps<HTMLDivElement>): React.JSX.Element;
|
|
16
17
|
export declare function useCreateNotification(): (notification: NotificationProperties) => void;
|
|
17
|
-
export declare function NotificationProvider({ children, }: {
|
|
18
|
+
export declare function NotificationProvider({ limit, children, }: {
|
|
19
|
+
readonly limit?: number;
|
|
18
20
|
readonly children: ReactNode;
|
|
19
|
-
}):
|
|
21
|
+
}): React.JSX.Element;
|
|
@@ -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 f=require("../jsx-runtime-BB_1_6y_.js"),e=require("react"),E=require("@kuma-ui/core"),I=require("../utilities/generate-random-id.js"),T=require("./notice.js");function R({type:i,icon:p,id:u,index:d,shouldDismiss:r,className:k,children:N,onDismiss:c,...s}){const[t,a]=e.useState(!1),[o,m]=e.useState(!1),[n,x]=e.useState(!1),v=d??0,[h,M]=e.useState(v);e.useEffect(()=>{if(r||o)return;const l=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(l)}},[r,o]);const j=e.useRef(0),C=e.useRef(0),S=e.useCallback(()=>{x(!0)},[]),q=e.useCallback(()=>{x(!1)},[]);return e.useEffect(()=>{if(n){C.current+=Date.now()-j.current;return}if(t){j.current=Date.now();const l=6e3-C.current,w=setTimeout(()=>{a(!1),m(!0)},l);return()=>{clearTimeout(w)}}},[n,t]),e.useEffect(()=>{r&&!o&&(a(!1),m(!0))},[r,o]),e.useEffect(()=>{if(o&&!t){const l=setTimeout(()=>{u&&(c==null||c(u))},300);return()=>{clearTimeout(l)}}},[u,o,t,c]),e.useEffect(()=>{n||M(v)},[v,n]),f.jsxRuntimeExports.jsx("div",{...s,style:{"--index":h},className:E.cx("kakadu-components-1727618227",t&&"kakadu-components-3003995416",k),children:f.jsxRuntimeExports.jsxs(T.default,{role:"status","aria-live":"polite","aria-atomic":"true",type:i,icon:p,className:E.cx("kakadu-components-3951461646",t&&"kakadu-components-2837603142"),onMouseEnter:S,onMouseLeave:q,children:[N,f.jsxRuntimeExports.jsx("div",{className:"kakadu-components-2751825161",children:f.jsxRuntimeExports.jsx("div",{className:E.cx("kakadu-components-4050948330",n?"kakadu-components-758522476":"kakadu-components-3914681513")})})]})})}const b=e.createContext({createNotification(){throw new Error("useCreateNotification must be used within a NotificationProvider")}});function g(){const{createNotification:i}=e.useContext(b);return i}function P({limit:i=5,children:p}){const[u,d]=e.useState([]),r=e.useCallback(s=>{const t=I.default();d(a=>{const o=[...a,{...s,id:t}];if(o.length<=i)return o;const m=o.length-i;return o.map((n,x)=>x<m?{...n,shouldDismiss:!0}:n)})},[i]),k=e.useCallback(s=>{d(t=>t.filter(a=>a.id!==s))},[]),N=e.useMemo(()=>({createNotification:r}),[r]),c=e.useMemo(()=>[...u].reverse(),[u]);return f.jsxRuntimeExports.jsxs(b.Provider,{value:N,children:[p,c.map((s,t)=>f.jsxRuntimeExports.jsx(R,{...s,index:t,onDismiss:k},s.id))]})}exports.notificationTypes=T.noticeTypes;exports.NotificationProvider=P;exports.default=R;exports.useCreateNotification=g;
|
|
@@ -1,97 +1,113 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { cx as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { noticeTypes as
|
|
7
|
-
function
|
|
8
|
-
type:
|
|
9
|
-
icon:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { j as u } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
+
import { createContext as H, useState as d, useEffect as m, useRef as E, useCallback as k, useContext as L, useMemo as I } from "react";
|
|
3
|
+
import { cx as j } from "@kuma-ui/core";
|
|
4
|
+
import S from "../utilities/generate-random-id.mjs";
|
|
5
|
+
import V from "./notice.mjs";
|
|
6
|
+
import { noticeTypes as Q } from "./notice.mjs";
|
|
7
|
+
function B({
|
|
8
|
+
type: i,
|
|
9
|
+
icon: N,
|
|
10
|
+
id: a,
|
|
11
|
+
index: l,
|
|
12
|
+
shouldDismiss: s,
|
|
13
|
+
className: v,
|
|
14
|
+
children: T,
|
|
15
|
+
onDismiss: c,
|
|
16
|
+
...o
|
|
15
17
|
}) {
|
|
16
|
-
const [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
const [e, r] = d(!1), [t, p] = d(!1), [n, x] = d(!1), h = l ?? 0, [b, g] = d(h);
|
|
19
|
+
m(() => {
|
|
20
|
+
if (s || t)
|
|
21
|
+
return;
|
|
22
|
+
const f = setTimeout(() => {
|
|
23
|
+
r(!0);
|
|
24
|
+
}, 100);
|
|
21
25
|
return () => {
|
|
22
|
-
clearTimeout(
|
|
26
|
+
clearTimeout(f);
|
|
23
27
|
};
|
|
28
|
+
}, [s, t]);
|
|
29
|
+
const C = E(0), w = E(0), y = k(() => {
|
|
30
|
+
x(!0);
|
|
31
|
+
}, []), P = k(() => {
|
|
32
|
+
x(!1);
|
|
24
33
|
}, []);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
v(!1);
|
|
29
|
-
}, []);
|
|
30
|
-
x(() => {
|
|
31
|
-
if (p) {
|
|
32
|
-
h.current += Date.now() - T.current;
|
|
34
|
+
return m(() => {
|
|
35
|
+
if (n) {
|
|
36
|
+
w.current += Date.now() - C.current;
|
|
33
37
|
return;
|
|
34
38
|
}
|
|
35
|
-
if (
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
},
|
|
39
|
+
if (e) {
|
|
40
|
+
C.current = Date.now();
|
|
41
|
+
const f = 6e3 - w.current, R = setTimeout(() => {
|
|
42
|
+
r(!1), p(!0);
|
|
43
|
+
}, f);
|
|
40
44
|
return () => {
|
|
41
|
-
clearTimeout(
|
|
45
|
+
clearTimeout(R);
|
|
42
46
|
};
|
|
43
47
|
}
|
|
44
|
-
}, [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (
|
|
48
|
-
const
|
|
49
|
-
|
|
48
|
+
}, [n, e]), m(() => {
|
|
49
|
+
s && !t && (r(!1), p(!0));
|
|
50
|
+
}, [s, t]), m(() => {
|
|
51
|
+
if (t && !e) {
|
|
52
|
+
const f = setTimeout(() => {
|
|
53
|
+
a && (c == null || c(a));
|
|
50
54
|
}, 300);
|
|
51
55
|
return () => {
|
|
52
|
-
clearTimeout(
|
|
56
|
+
clearTimeout(f);
|
|
53
57
|
};
|
|
54
58
|
}
|
|
55
|
-
}, [
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
}, [a, t, e, c]), m(() => {
|
|
60
|
+
n || g(h);
|
|
61
|
+
}, [h, n]), /* @__PURE__ */ u.jsx("div", { ...o, style: {
|
|
62
|
+
"--index": b
|
|
63
|
+
}, className: j("kakadu-components-1727618227", e && "kakadu-components-3003995416", v), children: /* @__PURE__ */ u.jsxs(V, { role: "status", "aria-live": "polite", "aria-atomic": "true", type: i, icon: N, className: j("kakadu-components-3951461646", e && "kakadu-components-2837603142"), onMouseEnter: y, onMouseLeave: P, children: [
|
|
64
|
+
T,
|
|
65
|
+
/* @__PURE__ */ u.jsx("div", { className: "kakadu-components-2751825161", children: /* @__PURE__ */ u.jsx("div", { className: j("kakadu-components-4050948330", n ? "kakadu-components-758522476" : "kakadu-components-3914681513") }) })
|
|
60
66
|
] }) });
|
|
61
67
|
}
|
|
62
|
-
const
|
|
68
|
+
const M = H({
|
|
63
69
|
createNotification() {
|
|
64
70
|
throw new Error("useCreateNotification must be used within a NotificationProvider");
|
|
65
71
|
}
|
|
66
72
|
});
|
|
67
|
-
function
|
|
73
|
+
function G() {
|
|
68
74
|
const {
|
|
69
|
-
createNotification:
|
|
70
|
-
} =
|
|
71
|
-
return
|
|
75
|
+
createNotification: i
|
|
76
|
+
} = L(M);
|
|
77
|
+
return i;
|
|
72
78
|
}
|
|
73
|
-
function
|
|
74
|
-
|
|
79
|
+
function J({
|
|
80
|
+
limit: i = 5,
|
|
81
|
+
children: N
|
|
75
82
|
}) {
|
|
76
|
-
const [
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
...
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
83
|
+
const [a, l] = d([]), s = k((o) => {
|
|
84
|
+
const e = S();
|
|
85
|
+
l((r) => {
|
|
86
|
+
const t = [...r, {
|
|
87
|
+
...o,
|
|
88
|
+
id: e
|
|
89
|
+
}];
|
|
90
|
+
if (t.length <= i)
|
|
91
|
+
return t;
|
|
92
|
+
const p = t.length - i;
|
|
93
|
+
return t.map((n, x) => x < p ? {
|
|
94
|
+
...n,
|
|
95
|
+
shouldDismiss: !0
|
|
96
|
+
} : n);
|
|
97
|
+
});
|
|
98
|
+
}, [i]), v = k((o) => {
|
|
99
|
+
l((e) => e.filter((r) => r.id !== o));
|
|
100
|
+
}, []), T = I(() => ({
|
|
101
|
+
createNotification: s
|
|
102
|
+
}), [s]), c = I(() => [...a].reverse(), [a]);
|
|
103
|
+
return /* @__PURE__ */ u.jsxs(M.Provider, { value: T, children: [
|
|
104
|
+
N,
|
|
105
|
+
c.map((o, e) => /* @__PURE__ */ u.jsx(B, { ...o, index: e, onDismiss: v }, o.id))
|
|
90
106
|
] });
|
|
91
107
|
}
|
|
92
108
|
export {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
109
|
+
J as NotificationProvider,
|
|
110
|
+
B as default,
|
|
111
|
+
Q as notificationTypes,
|
|
112
|
+
G as useCreateNotification
|
|
97
113
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type HTMLAttributeAnchorTarget, type MouseEvent, type ReactNode, type Ref } from 'react';
|
|
1
|
+
import React, { type HTMLAttributeAnchorTarget, type MouseEvent, type ReactNode, type Ref } from 'react';
|
|
2
2
|
import { type IconType } from '../icons/icon';
|
|
3
3
|
import { type DecoratorType } from './decorators';
|
|
4
4
|
export declare const dangerPopoverMenuItemStyles: string;
|
|
@@ -28,12 +28,12 @@ export declare function usePopoverMenu(items: PopoverMenuItemProperties[]): {
|
|
|
28
28
|
isVisible: boolean;
|
|
29
29
|
show: () => Promise<void | undefined>;
|
|
30
30
|
close: (result?: void | undefined) => void;
|
|
31
|
-
popoverMenu:
|
|
31
|
+
popoverMenu: React.JSX.Element | null;
|
|
32
32
|
};
|
|
33
33
|
export type PopoverMenuProperties = {
|
|
34
34
|
readonly menu: ReactNode;
|
|
35
35
|
readonly className?: string;
|
|
36
36
|
readonly children?: ReactNode;
|
|
37
37
|
};
|
|
38
|
-
export default function PopoverMenu({ menu, className, children, }: PopoverMenuProperties):
|
|
38
|
+
export default function PopoverMenu({ menu, className, children, }: PopoverMenuProperties): React.JSX.Element;
|
|
39
39
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentType } from 'react';
|
|
1
|
+
import React, { type ComponentType } from 'react';
|
|
2
2
|
import { type AtomElementType, type AtomProperties, type DefaultAtomElementType } from './atom';
|
|
3
3
|
type InitialFocusElement = HTMLElement | null;
|
|
4
4
|
type PopoverProviderProperties<Data = any> = {
|
|
@@ -9,7 +9,7 @@ type PopoverProviderProperties<Data = any> = {
|
|
|
9
9
|
close?: (data?: Data) => void;
|
|
10
10
|
};
|
|
11
11
|
export declare function usePopoverContext<Data = any>(): PopoverProviderProperties<Data>;
|
|
12
|
-
export declare function PopoverContainer<Type extends AtomElementType = DefaultAtomElementType>({ as, className, ...properties }: AtomProperties<Type>):
|
|
12
|
+
export declare function PopoverContainer<Type extends AtomElementType = DefaultAtomElementType>({ as, className, ...properties }: AtomProperties<Type>): React.JSX.Element;
|
|
13
13
|
export type PopoverProperties<Data = any, Type extends AtomElementType = DefaultAtomElementType> = AtomProperties<Type> & {
|
|
14
14
|
readonly innerClassName?: string;
|
|
15
15
|
readonly label?: string;
|
|
@@ -20,11 +20,11 @@ export type PopoverProperties<Data = any, Type extends AtomElementType = Default
|
|
|
20
20
|
readonly onClose?: (data?: Data) => void;
|
|
21
21
|
};
|
|
22
22
|
type PopoverBaseProperties<PopoverResult> = Omit<PopoverProperties<PopoverResult>, 'isVisible' | 'onClose'>;
|
|
23
|
-
export default function Popover<Data = any, Type extends AtomElementType = DefaultAtomElementType>({ as, isVisible, label, shouldCloseOnOutsideClick, shouldCloseOnEscapePress, children, className, innerClassName, onClose, ...properties }: PopoverProperties<Data, Type>):
|
|
23
|
+
export default function Popover<Data = any, Type extends AtomElementType = DefaultAtomElementType>({ as, isVisible, label, shouldCloseOnOutsideClick, shouldCloseOnEscapePress, children, className, innerClassName, onClose, ...properties }: PopoverProperties<Data, Type>): React.JSX.Element | null;
|
|
24
24
|
export declare function usePopover<PopoverResult, PopoverProperties = PopoverBaseProperties<PopoverResult>>(PopoverComponent: ComponentType<PopoverProperties>, properties?: PopoverProperties): {
|
|
25
25
|
isVisible: boolean;
|
|
26
26
|
show: () => Promise<PopoverResult | undefined>;
|
|
27
27
|
close: (result?: PopoverResult) => void;
|
|
28
|
-
popover:
|
|
28
|
+
popover: React.JSX.Element | null;
|
|
29
29
|
};
|
|
30
30
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CSSProperties, type RefObject } from 'react';
|
|
1
|
+
import React, { type CSSProperties, type RefObject } from 'react';
|
|
2
2
|
import { type AtomElementType, type AtomProperties } from './atom';
|
|
3
3
|
type RevealerOptions = {
|
|
4
4
|
readonly delay?: number;
|
|
@@ -15,5 +15,5 @@ export declare function useRevealer(reference: RefObject<HTMLElement | null>, op
|
|
|
15
15
|
style: CSSProperties;
|
|
16
16
|
className: string;
|
|
17
17
|
};
|
|
18
|
-
export default function Revealer<Type extends AtomElementType = 'span'>({ as, delay, animationDelay, duration, threshold, distance, isMoving, isCentered, shouldReveal, children, className, ...properties }: AtomProperties<Type> & RevealerOptions):
|
|
18
|
+
export default function Revealer<Type extends AtomElementType = 'span'>({ as, delay, animationDelay, duration, threshold, distance, isMoving, isCentered, shouldReveal, children, className, ...properties }: AtomProperties<Type> & RevealerOptions): React.JSX.Element;
|
|
19
19
|
export {};
|