@kakadu/components 3.15.5 → 4.0.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.
- package/build/components/button-tooltip.d.ts +2 -4
- package/build/components/button-tooltip.js +1 -1
- package/build/components/button-tooltip.mjs +11 -11
- package/build/components/button.d.ts +2 -6
- package/build/components/button.js +1 -1
- package/build/components/button.mjs +51 -51
- package/build/components/card.js +1 -1
- package/build/components/card.mjs +22 -22
- package/build/components/combobox.d.ts +25 -0
- package/build/components/combobox.js +1 -0
- package/build/components/combobox.mjs +322 -0
- package/build/components/copy-icon-button.js +1 -1
- package/build/components/copy-icon-button.mjs +20 -21
- package/build/components/datum.js +1 -1
- package/build/components/datum.mjs +12 -12
- package/build/components/flex.d.ts +13 -9
- package/build/components/flex.js +1 -1
- package/build/components/flex.mjs +25 -15
- package/build/components/footer.d.ts +3 -6
- package/build/components/footer.js +1 -1
- package/build/components/footer.mjs +33 -33
- package/build/components/header.js +1 -1
- package/build/components/header.mjs +4 -5
- package/build/components/icon-button.d.ts +2 -6
- package/build/components/icon-button.js +1 -1
- package/build/components/icon-button.mjs +41 -41
- package/build/components/input.d.ts +12 -19
- package/build/components/input.js +2 -2
- package/build/components/input.mjs +122 -147
- package/build/components/kakadu-guide-logo.d.ts +2 -4
- package/build/components/kakadu-guide-logo.js +1 -1
- package/build/components/kakadu-guide-logo.mjs +13 -13
- package/build/components/modal.js +1 -1
- package/build/components/modal.mjs +65 -66
- package/build/components/notice.d.ts +2 -7
- package/build/components/notice.js +1 -1
- package/build/components/notice.mjs +16 -16
- package/build/components/notification.d.ts +2 -1
- package/build/components/notification.js +1 -1
- package/build/components/notification.mjs +9 -9
- package/build/components/popover-menu.js +1 -1
- package/build/components/popover-menu.mjs +98 -106
- package/build/components/popover.js +1 -1
- package/build/components/popover.mjs +1 -1
- package/build/components/select.d.ts +12 -0
- package/build/components/select.js +1 -0
- package/build/components/select.mjs +36 -0
- package/build/components/separator.js +1 -1
- package/build/components/separator.mjs +25 -25
- package/build/components/text-button.d.ts +2 -4
- package/build/components/text-button.js +1 -1
- package/build/components/text-button.mjs +26 -27
- package/build/components/text.d.ts +1 -1
- package/build/components/text.js +1 -1
- package/build/components/text.mjs +29 -30
- package/build/components/theme-setter.d.ts +1 -1
- package/build/components/wrapper.d.ts +3 -6
- package/build/components/wrapper.js +1 -1
- package/build/components/wrapper.mjs +25 -23
- package/build/components.css +1 -1
- package/build/{focus-trap-react-CcpTuiJi.js → focus-trap-react-CkKg4ubd.js} +5 -5
- package/build/{focus-trap-react-DYXrtbDH.mjs → focus-trap-react-DATIi_Ob.mjs} +34 -29
- package/build/hooks/use-synchronized-value.d.ts +4 -0
- package/build/icons/icon.d.ts +4 -42
- package/build/icons/icon.js +1 -1
- package/build/icons/icon.mjs +76 -76
- package/build/index.d.ts +4 -0
- package/build/index.js +1 -1
- package/build/index.mjs +248 -241
- package/build/use-synchronized-value-D0_rS5Wp.js +1 -0
- package/build/use-synchronized-value-XnIpeq1s.mjs +28 -0
- package/package.json +3 -1
|
@@ -1,87 +1,79 @@
|
|
|
1
1
|
import { j as e } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
-
import { cx as
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import { buttonResetStyles as
|
|
2
|
+
import { cx as F } from "@kuma-ui/core";
|
|
3
|
+
import { useMemo as j, useState as A, useCallback as h, useEffect as K, useRef as z } from "react";
|
|
4
|
+
import { buttonResetStyles as C } from "../theme.mjs";
|
|
5
5
|
import b from "../icons/icon.mjs";
|
|
6
|
-
import
|
|
6
|
+
import { u as D } from "../use-synchronized-value-XnIpeq1s.mjs";
|
|
7
|
+
import V, { PopoverContainer as H, usePopover as T, usePopoverContext as N } from "./popover.mjs";
|
|
7
8
|
import R from "./atom.mjs";
|
|
8
|
-
import { Span as
|
|
9
|
+
import { Span as M } from "./text.mjs";
|
|
9
10
|
import B, { normalBlendStyles as G } from "./hover-gradient.mjs";
|
|
10
11
|
import U from "./click-ripples.mjs";
|
|
11
12
|
import q from "./separator.mjs";
|
|
12
13
|
import J from "./decorators.mjs";
|
|
13
|
-
import
|
|
14
|
+
import I from "./spinner.mjs";
|
|
14
15
|
import { SkeletonInstance as O } from "./skeleton.mjs";
|
|
15
16
|
import Q from "./aria-text.mjs";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}, []);
|
|
23
|
-
return S(() => {
|
|
24
|
-
const a = (t) => {
|
|
25
|
-
r(t);
|
|
26
|
-
};
|
|
27
|
-
return w.add(a), () => {
|
|
28
|
-
w.delete(a);
|
|
29
|
-
};
|
|
30
|
-
}, []), h(() => ({
|
|
17
|
+
function E() {
|
|
18
|
+
const {
|
|
19
|
+
value: n,
|
|
20
|
+
setValue: t
|
|
21
|
+
} = D("isKeyboardNavigating");
|
|
22
|
+
return j(() => ({
|
|
31
23
|
isKeyboardNavigating: n,
|
|
32
|
-
setIsKeyboardNavigating:
|
|
33
|
-
}), [n,
|
|
24
|
+
setIsKeyboardNavigating: t
|
|
25
|
+
}), [n, t]);
|
|
34
26
|
}
|
|
35
|
-
const
|
|
27
|
+
const fe = "kakadu-components-949294122";
|
|
36
28
|
function W({
|
|
37
29
|
isLoading: n,
|
|
38
|
-
label:
|
|
39
|
-
iconLeft:
|
|
40
|
-
iconRight:
|
|
41
|
-
href:
|
|
42
|
-
target:
|
|
43
|
-
shouldCloseOnClick:
|
|
44
|
-
decorators:
|
|
45
|
-
submenu:
|
|
30
|
+
label: t,
|
|
31
|
+
iconLeft: a,
|
|
32
|
+
iconRight: u,
|
|
33
|
+
href: o,
|
|
34
|
+
target: l,
|
|
35
|
+
shouldCloseOnClick: x = !0,
|
|
36
|
+
decorators: i = [],
|
|
37
|
+
submenu: r,
|
|
46
38
|
className: d,
|
|
47
|
-
onClick:
|
|
39
|
+
onClick: c,
|
|
48
40
|
...m
|
|
49
41
|
}) {
|
|
50
42
|
const {
|
|
51
43
|
isVisible: f,
|
|
52
|
-
isPreparingFocus:
|
|
53
|
-
isFocused:
|
|
54
|
-
close:
|
|
55
|
-
} =
|
|
56
|
-
isKeyboardNavigating:
|
|
57
|
-
} =
|
|
58
|
-
y.current =
|
|
59
|
-
}, [
|
|
60
|
-
!
|
|
61
|
-
}, [
|
|
62
|
-
/* @__PURE__ */ e.jsx(
|
|
63
|
-
/* @__PURE__ */ e.jsx(Q, { children:
|
|
64
|
-
|
|
44
|
+
isPreparingFocus: p,
|
|
45
|
+
isFocused: s,
|
|
46
|
+
close: k
|
|
47
|
+
} = N(), {
|
|
48
|
+
isKeyboardNavigating: v
|
|
49
|
+
} = E(), y = z(!0), w = h(() => {
|
|
50
|
+
y.current = s;
|
|
51
|
+
}, [s]), g = h((S) => {
|
|
52
|
+
!v && !y.current || s && (c == null || c(S), r ? r.show() : x && (k == null || k()));
|
|
53
|
+
}, [v, s, c, r, x, k]), P = j(() => /* @__PURE__ */ e.jsxs(R, { as: o && !n ? "a" : "button", ...m, type: o && !n ? void 0 : "button", role: "menuitem", href: o, target: l, inert: !f && !p || n, disabled: o ? void 0 : !f && !p || n, className: F(C, "kakadu-components-1772835671", s && "kakadu-components-3160069815", v ? "kakadu-components-2254977234" : s && "kakadu-components-278139688", d), onClick: g, onPointerDownCapture: w, children: [
|
|
54
|
+
/* @__PURE__ */ e.jsx(M, { className: "kakadu-components-1109353535", children: n ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
55
|
+
/* @__PURE__ */ e.jsx(Q, { children: t }),
|
|
56
|
+
a ? /* @__PURE__ */ e.jsx(I, { size: 12 }) : null,
|
|
65
57
|
/* @__PURE__ */ e.jsx(O, { height: "1em", width: "100%" }),
|
|
66
|
-
|
|
58
|
+
u ? /* @__PURE__ */ e.jsx(I, { size: 12 }) : null
|
|
67
59
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
68
|
-
|
|
69
|
-
/* @__PURE__ */ e.jsx("span", { className: "kakadu-components-4055589237", children:
|
|
70
|
-
|
|
60
|
+
a ? /* @__PURE__ */ e.jsx(b, { width: 12, height: 12, type: a }) : null,
|
|
61
|
+
/* @__PURE__ */ e.jsx("span", { className: "kakadu-components-4055589237", children: t }),
|
|
62
|
+
u ? /* @__PURE__ */ e.jsx(b, { width: 12, height: 12, type: u }) : null
|
|
71
63
|
] }) }),
|
|
72
|
-
|
|
73
|
-
/* @__PURE__ */ e.jsx(U, { isActive:
|
|
74
|
-
/* @__PURE__ */ e.jsx(B, { isActive:
|
|
64
|
+
v || n ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
65
|
+
/* @__PURE__ */ e.jsx(U, { isActive: s, size: 100 }),
|
|
66
|
+
/* @__PURE__ */ e.jsx(B, { isActive: s, size: 150, className: G })
|
|
75
67
|
] })
|
|
76
|
-
] }), [
|
|
77
|
-
return /* @__PURE__ */ e.jsx(J, { decorators:
|
|
68
|
+
] }), [o, n, m, l, f, p, s, v, d, g, w, a, t, u]);
|
|
69
|
+
return /* @__PURE__ */ e.jsx(J, { decorators: i, children: r ? /* @__PURE__ */ e.jsx(_, { menu: r.popoverMenu, className: "kakadu-components-1861176543", children: P }) : P });
|
|
78
70
|
}
|
|
79
71
|
function X(n) {
|
|
80
72
|
if ("type" in n) {
|
|
81
73
|
if (n.type === "separator")
|
|
82
74
|
return /* @__PURE__ */ e.jsx(q, {});
|
|
83
75
|
if (n.type === "group")
|
|
84
|
-
return /* @__PURE__ */ e.jsx(
|
|
76
|
+
return /* @__PURE__ */ e.jsx(M, { className: "kakadu-components-1499037363", children: n.label });
|
|
85
77
|
}
|
|
86
78
|
return /* @__PURE__ */ e.jsx(W, { ...n });
|
|
87
79
|
}
|
|
@@ -89,31 +81,31 @@ function Y({
|
|
|
89
81
|
items: n
|
|
90
82
|
}) {
|
|
91
83
|
const {
|
|
92
|
-
isFocused:
|
|
93
|
-
} =
|
|
94
|
-
setIsKeyboardNavigating:
|
|
95
|
-
} =
|
|
96
|
-
|
|
97
|
-
}, []),
|
|
98
|
-
|
|
99
|
-
}, [
|
|
100
|
-
return
|
|
101
|
-
if (!
|
|
84
|
+
isFocused: t
|
|
85
|
+
} = N(), [a, u] = A([]), {
|
|
86
|
+
setIsKeyboardNavigating: o
|
|
87
|
+
} = E(), l = h((i) => {
|
|
88
|
+
i && u((r) => r.includes(i) ? r : [...r, i]);
|
|
89
|
+
}, []), x = h((i) => {
|
|
90
|
+
t && (i.currentTarget.focus(), o(!1));
|
|
91
|
+
}, [t, o]);
|
|
92
|
+
return K(() => {
|
|
93
|
+
if (!t)
|
|
102
94
|
return;
|
|
103
|
-
const
|
|
104
|
-
const d =
|
|
105
|
-
if (
|
|
95
|
+
const i = (r) => {
|
|
96
|
+
const d = a.filter((s) => s.isConnected), c = d.length;
|
|
97
|
+
if (c === 0)
|
|
106
98
|
return;
|
|
107
99
|
let m;
|
|
108
100
|
const f = document.activeElement;
|
|
109
|
-
let
|
|
110
|
-
switch (
|
|
101
|
+
let p = f ? d.indexOf(f) : -1;
|
|
102
|
+
switch (p === -1 && (p = 0), r.key) {
|
|
111
103
|
case "ArrowDown": {
|
|
112
|
-
m = (
|
|
104
|
+
m = (p + 1) % c;
|
|
113
105
|
break;
|
|
114
106
|
}
|
|
115
107
|
case "ArrowUp": {
|
|
116
|
-
m = (
|
|
108
|
+
m = (p - 1 + c) % c;
|
|
117
109
|
break;
|
|
118
110
|
}
|
|
119
111
|
case "Home": {
|
|
@@ -121,71 +113,71 @@ function Y({
|
|
|
121
113
|
break;
|
|
122
114
|
}
|
|
123
115
|
case "End": {
|
|
124
|
-
m =
|
|
116
|
+
m = c - 1;
|
|
125
117
|
break;
|
|
126
118
|
}
|
|
127
119
|
case "Tab": {
|
|
128
|
-
|
|
120
|
+
o(!0);
|
|
129
121
|
return;
|
|
130
122
|
}
|
|
131
123
|
}
|
|
132
124
|
if (m !== void 0) {
|
|
133
|
-
|
|
134
|
-
const
|
|
135
|
-
|
|
125
|
+
r.preventDefault(), r.stopPropagation();
|
|
126
|
+
const s = d[m];
|
|
127
|
+
s && (s.focus(), o(!0));
|
|
136
128
|
}
|
|
137
129
|
};
|
|
138
|
-
return window.addEventListener("keydown",
|
|
130
|
+
return window.addEventListener("keydown", i, {
|
|
139
131
|
capture: !0
|
|
140
132
|
}), () => {
|
|
141
|
-
window.removeEventListener("keydown",
|
|
133
|
+
window.removeEventListener("keydown", i, {
|
|
142
134
|
capture: !0
|
|
143
135
|
});
|
|
144
136
|
};
|
|
145
|
-
}, [
|
|
137
|
+
}, [t, a, o]), /* @__PURE__ */ e.jsx(e.Fragment, { children: n.map((i, r) => /* @__PURE__ */ e.jsx(
|
|
146
138
|
X,
|
|
147
139
|
{
|
|
148
|
-
...
|
|
149
|
-
reference:
|
|
150
|
-
onMouseEnter:
|
|
140
|
+
...i,
|
|
141
|
+
reference: l,
|
|
142
|
+
onMouseEnter: x
|
|
151
143
|
},
|
|
152
|
-
|
|
144
|
+
r
|
|
153
145
|
)) });
|
|
154
146
|
}
|
|
155
147
|
function Z({
|
|
156
148
|
items: n,
|
|
157
|
-
...
|
|
149
|
+
...t
|
|
158
150
|
}) {
|
|
159
|
-
return /* @__PURE__ */ e.jsx(
|
|
151
|
+
return /* @__PURE__ */ e.jsx(V, { ...t, as: "nav", role: "menu", innerClassName: "kakadu-components-3600436535", children: /* @__PURE__ */ e.jsx(Y, { items: n }) });
|
|
160
152
|
}
|
|
161
|
-
function
|
|
162
|
-
const
|
|
153
|
+
function ve(n) {
|
|
154
|
+
const t = j(() => ({
|
|
163
155
|
items: n
|
|
164
156
|
}), [n]), {
|
|
165
|
-
isVisible:
|
|
166
|
-
show:
|
|
167
|
-
close:
|
|
168
|
-
popover:
|
|
169
|
-
} =
|
|
170
|
-
return
|
|
171
|
-
isVisible:
|
|
172
|
-
show:
|
|
173
|
-
close:
|
|
174
|
-
popoverMenu:
|
|
175
|
-
}), [
|
|
157
|
+
isVisible: a,
|
|
158
|
+
show: u,
|
|
159
|
+
close: o,
|
|
160
|
+
popover: l
|
|
161
|
+
} = T(Z, t);
|
|
162
|
+
return j(() => ({
|
|
163
|
+
isVisible: a,
|
|
164
|
+
show: u,
|
|
165
|
+
close: o,
|
|
166
|
+
popoverMenu: l
|
|
167
|
+
}), [a, u, o, l]);
|
|
176
168
|
}
|
|
177
169
|
function _({
|
|
178
170
|
menu: n,
|
|
179
|
-
className:
|
|
180
|
-
children:
|
|
171
|
+
className: t,
|
|
172
|
+
children: a
|
|
181
173
|
}) {
|
|
182
|
-
return /* @__PURE__ */ e.jsxs(
|
|
183
|
-
|
|
174
|
+
return /* @__PURE__ */ e.jsxs(H, { className: t, children: [
|
|
175
|
+
a,
|
|
184
176
|
n
|
|
185
177
|
] });
|
|
186
178
|
}
|
|
187
179
|
export {
|
|
188
|
-
|
|
180
|
+
fe as dangerPopoverMenuItemStyles,
|
|
189
181
|
_ as default,
|
|
190
|
-
|
|
182
|
+
ve as usePopoverMenu
|
|
191
183
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("../jsx-runtime-BB_1_6y_.js"),f=require("@kuma-ui/core"),e=require("react"),K=require("../focus-trap-react-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("../jsx-runtime-BB_1_6y_.js"),f=require("@kuma-ui/core"),e=require("react"),K=require("../focus-trap-react-CkKg4ubd.js"),R=require("./atom.js"),$=e.createContext({isVisible:!1,isPreparingFocus:!1,isFocused:!1}),{Provider:Q}=$;function X(){return e.useContext($)}function Y({as:i,className:s,...o}){return n.jsxRuntimeExports.jsx(R.default,{as:i??R.defaultAtomElementType,...o,className:f.cx("kakadu-components-2845019685",s)})}function Z({as:i,isVisible:s,label:o,shouldCloseOnOutsideClick:d=!0,shouldCloseOnEscapePress:a=!0,children:p,className:u,innerClassName:x,onClose:r,...v}){const I=e.useRef(null),S=e.useRef(null),[q,h]=e.useState(!1),[A,k]=e.useState(!1),[C,H]=e.useState(!1),[c,g]=e.useState(!1),[U,j]=e.useState(!1),M=e.useCallback(t=>{I.current=t,g(!1)},[]),E=e.useRef(null),N=e.useCallback(t=>{t&&(E.current=t)},[]),G=e.useMemo(()=>({initialFocus:()=>E.current??void 0,onPostActivate(){var t;k(!0),h(!1),(t=E.current)==null||t.focus()},clickOutsideDeactivates:d,escapeDeactivates:a,onPostUnpause(){k(!0)},onPause(){k(!1)},onDeactivate(){j(!1),g(!1),k(!1)}}),[d,a]),[L,O]=e.useState(s??!1),J=e.useMemo(()=>({isVisible:L,isPreparingFocus:q,isFocused:A,setInitialFocus:N,close:M}),[L,q,A,N,M]),[l,y]=e.useState("center");return e.useEffect(()=>{const t=S.current;if(t){const P=()=>{const D=t.offsetParent,F=D instanceof HTMLElement?D.getBoundingClientRect():null,V=t.getBoundingClientRect();if(!F){y("center");return}const T=16,_=window.innerWidth-T,b=F.left+F.width/2-V.width/2,z=b+V.width,B=b<T,W=z>_;let m="center";if(B&&W){const w=T-b;m=z-_>w?"right":"left"}else W?m="right":B&&(m="left");y(w=>w===m?w:m)};return P(),window.addEventListener("resize",P),()=>{window.removeEventListener("resize",P)}}},[]),e.useEffect(()=>{s&&(H(!0),O(!0))},[s]),e.useEffect(()=>{if(s){const t=setTimeout(()=>{g(!0)},100);return()=>{clearTimeout(t)}}g(!1)},[s]),e.useEffect(()=>{if(!c){j(!1),h(!1);return}h(!0);const t=window.requestAnimationFrame(()=>{j(!0)});return()=>{window.cancelAnimationFrame(t)}},[c]),e.useEffect(()=>{if(C&&!c){const t=setTimeout(()=>{r==null||r(I.current??void 0),O(!1)},370);return()=>{clearTimeout(t)}}},[C,c,r]),n.jsxRuntimeExports.jsx(R.default,{reference:S,as:i??R.defaultAtomElementType,role:"dialog","aria-hidden":!c,"aria-label":o??"Popover",...v,className:f.cx("kakadu-components-3920007758",l==="left"&&"kakadu-components-611400930",l==="right"&&"kakadu-components-944244368",c&&"kakadu-components-1399012551",u),children:n.jsxRuntimeExports.jsxs("div",{className:f.cx("kakadu-components-1118152266",c&&"kakadu-components-231244945"),children:[n.jsxRuntimeExports.jsx("div",{className:f.cx("kakadu-components-1951789226",l==="left"&&"kakadu-components-1495725644",l==="right"&&"kakadu-components-4235689197")}),n.jsxRuntimeExports.jsx(K.focusTrapReactExports.FocusTrap,{active:U,focusTrapOptions:G,children:n.jsxRuntimeExports.jsxs("div",{className:f.cx("kakadu-components-2488426662",x),children:[n.jsxRuntimeExports.jsx(Q,{value:J,children:p}),n.jsxRuntimeExports.jsx("div",{className:f.cx("kakadu-components-3252390100",l==="left"&&"kakadu-components-3754561431",l==="right"&&"kakadu-components-2265262600")})]})})]})})}function ee(i,s){const[o,d]=e.useState(!1),a=e.useRef(void 0),p=e.useCallback(async()=>(d(!0),new Promise(r=>{a.current=r})),[]),u=e.useCallback(r=>{var v;d(!1),(v=a.current)==null||v.call(a,r),a.current=void 0},[]),x=e.useMemo(()=>n.jsxRuntimeExports.jsx(i,{...s,isVisible:o,onClose:u}),[i,s,o,u]);return e.useMemo(()=>({isVisible:o,show:p,close:u,popover:x}),[o,p,u,x])}exports.PopoverContainer=Y;exports.default=Z;exports.usePopover=ee;exports.usePopoverContext=X;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as s } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
2
|
import { cx as f } from "@kuma-ui/core";
|
|
3
3
|
import { createContext as ee, useRef as F, useState as r, useCallback as P, useMemo as j, useEffect as p, useContext as te } from "react";
|
|
4
|
-
import { f as se } from "../focus-trap-react-
|
|
4
|
+
import { f as se } from "../focus-trap-react-DATIi_Ob.mjs";
|
|
5
5
|
import K, { defaultAtomElementType as Q } from "./atom.mjs";
|
|
6
6
|
const X = ee({
|
|
7
7
|
isVisible: !1,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ChangeEvent, type HTMLProps, type ReactNode } from 'react';
|
|
2
|
+
import { type InputLabelControllerProperties } from './input';
|
|
3
|
+
export type SelectOption<Type extends string = string> = {
|
|
4
|
+
readonly value: Type;
|
|
5
|
+
readonly label: ReactNode | string;
|
|
6
|
+
readonly disabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type SelectProperties<Type extends string = string> = Omit<InputLabelControllerProperties & HTMLProps<HTMLSelectElement>, 'onChange'> & {
|
|
9
|
+
readonly options: Array<SelectOption<Type>>;
|
|
10
|
+
readonly onChange?: (value: Type, event: ChangeEvent<HTMLSelectElement>) => void;
|
|
11
|
+
};
|
|
12
|
+
export default function Select<Type extends string = string>({ label, options, error, warning, information, footnote, className, onChange, ...properties }: SelectProperties<Type>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("../jsx-runtime-BB_1_6y_.js"),r=require("react"),S=require("@kuma-ui/core"),$=require("../icons/chevron-up.js"),p=require("./input.js");function B({label:h,options:I,error:l,warning:u,information:c,footnote:q,className:E,onChange:t,...d}){const o=r.useId(),m=`${o}-error`,x=`${o}-warning`,v=`${o}-information`,s=!!l,i=!s&&!!u,b=!s&&!i&&!!c,g=s?m:i?x:b?v:void 0,{value:n}=d,[k,f]=r.useState(""),y=n??k;r.useEffect(()=>{f(typeof n=="string"?n:"")},[n]);const R=r.useCallback(e=>{const{value:j}=e.target;f(j),t==null||t(j,e)},[t]);return a.jsxRuntimeExports.jsxs(p.InputLabel,{label:h,error:l,errorId:m,warning:u,warningId:x,information:c,informationId:v,footnote:q,children:[a.jsxRuntimeExports.jsx("select",{...d,value:y,"aria-invalid":s,"data-warning":i,"data-information":b,"aria-describedby":g,className:S.cx(p.inputStyles,"kakadu-components-4228384787",E),onChange:R,children:I.map(e=>a.jsxRuntimeExports.jsx("option",{value:e.value,disabled:e.disabled,children:e.label},e.value))}),a.jsxRuntimeExports.jsx($.default,{width:14,height:14,className:"kakadu-components-158931186"})]})}exports.default=B;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { j as n } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
+
import { useId as S, useState as w, useEffect as E, useCallback as V } from "react";
|
|
3
|
+
import { cx as $ } from "@kuma-ui/core";
|
|
4
|
+
import N from "../icons/chevron-up.mjs";
|
|
5
|
+
import { InputLabel as L, inputStyles as R } from "./input.mjs";
|
|
6
|
+
function D({
|
|
7
|
+
label: b,
|
|
8
|
+
options: h,
|
|
9
|
+
error: l,
|
|
10
|
+
warning: i,
|
|
11
|
+
information: c,
|
|
12
|
+
footnote: I,
|
|
13
|
+
className: j,
|
|
14
|
+
onChange: e,
|
|
15
|
+
...d
|
|
16
|
+
}) {
|
|
17
|
+
const o = S(), u = `${o}-error`, m = `${o}-warning`, f = `${o}-information`, t = !!l, r = !t && !!i, p = !t && !r && !!c, k = t ? u : r ? m : p ? f : void 0, {
|
|
18
|
+
value: s
|
|
19
|
+
} = d, [g, v] = w(""), y = s ?? g;
|
|
20
|
+
E(() => {
|
|
21
|
+
v(typeof s == "string" ? s : "");
|
|
22
|
+
}, [s]);
|
|
23
|
+
const B = V((a) => {
|
|
24
|
+
const {
|
|
25
|
+
value: x
|
|
26
|
+
} = a.target;
|
|
27
|
+
v(x), e == null || e(x, a);
|
|
28
|
+
}, [e]);
|
|
29
|
+
return /* @__PURE__ */ n.jsxs(L, { label: b, error: l, errorId: u, warning: i, warningId: m, information: c, informationId: f, footnote: I, children: [
|
|
30
|
+
/* @__PURE__ */ n.jsx("select", { ...d, value: y, "aria-invalid": t, "data-warning": r, "data-information": p, "aria-describedby": k, className: $(R, "kakadu-components-4228384787", j), onChange: B, children: h.map((a) => /* @__PURE__ */ n.jsx("option", { value: a.value, disabled: a.disabled, children: a.label }, a.value)) }),
|
|
31
|
+
/* @__PURE__ */ n.jsx(N, { width: 14, height: 14, className: "kakadu-components-158931186" })
|
|
32
|
+
] });
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
D as default
|
|
36
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("../jsx-runtime-BB_1_6y_.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("../jsx-runtime-BB_1_6y_.js"),s=require("@kuma-ui/core"),o=require("./flex.js"),u=require("./text.js");function a({className:e,...t}){return r.jsxRuntimeExports.jsx("hr",{...t,className:s.cx("kakadu-components-175326694",e)})}function c({className:e,...t}){return r.jsxRuntimeExports.jsx("hr",{...t,className:s.cx("kakadu-components-3380219127",e)})}function x({label:e,className:t,...n}){return r.jsxRuntimeExports.jsxs(o.default,{gap:2,direction:"row",preset:"center",className:s.cx("kakadu-components-1250376591",t),children:[r.jsxRuntimeExports.jsx(a,{...n}),r.jsxRuntimeExports.jsx(u.Label,{children:e}),r.jsxRuntimeExports.jsx(a,{...n})]})}function i({className:e,...t}){return r.jsxRuntimeExports.jsx("hr",{...t,className:s.cx("kakadu-components-2653569622",e)})}exports.SeparatorLabel=x;exports.SmallSeparator=c;exports.VerticalSeparator=i;exports.default=a;
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import { j as e } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
-
import { cx as
|
|
3
|
-
import s
|
|
2
|
+
import { cx as o } from "@kuma-ui/core";
|
|
3
|
+
import s from "./flex.mjs";
|
|
4
4
|
import { Label as c } from "./text.mjs";
|
|
5
|
-
function
|
|
6
|
-
className:
|
|
7
|
-
...
|
|
5
|
+
function n({
|
|
6
|
+
className: r,
|
|
7
|
+
...a
|
|
8
8
|
}) {
|
|
9
|
-
return /* @__PURE__ */ e.jsx("hr", { ...
|
|
9
|
+
return /* @__PURE__ */ e.jsx("hr", { ...a, className: o("kakadu-components-175326694", r) });
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
className:
|
|
13
|
-
...
|
|
11
|
+
function l({
|
|
12
|
+
className: r,
|
|
13
|
+
...a
|
|
14
14
|
}) {
|
|
15
|
-
return /* @__PURE__ */ e.jsx("hr", { ...
|
|
15
|
+
return /* @__PURE__ */ e.jsx("hr", { ...a, className: o("kakadu-components-3380219127", r) });
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
label:
|
|
19
|
-
className:
|
|
17
|
+
function x({
|
|
18
|
+
label: r,
|
|
19
|
+
className: a,
|
|
20
20
|
...t
|
|
21
21
|
}) {
|
|
22
|
-
return /* @__PURE__ */ e.jsxs(s, { gap: 2, direction: "row",
|
|
23
|
-
/* @__PURE__ */ e.jsx(
|
|
24
|
-
/* @__PURE__ */ e.jsx(c, { children:
|
|
25
|
-
/* @__PURE__ */ e.jsx(
|
|
22
|
+
return /* @__PURE__ */ e.jsxs(s, { gap: 2, direction: "row", preset: "center", className: o("kakadu-components-1250376591", a), children: [
|
|
23
|
+
/* @__PURE__ */ e.jsx(n, { ...t }),
|
|
24
|
+
/* @__PURE__ */ e.jsx(c, { children: r }),
|
|
25
|
+
/* @__PURE__ */ e.jsx(n, { ...t })
|
|
26
26
|
] });
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
className:
|
|
30
|
-
...
|
|
28
|
+
function f({
|
|
29
|
+
className: r,
|
|
30
|
+
...a
|
|
31
31
|
}) {
|
|
32
|
-
return /* @__PURE__ */ e.jsx("hr", { ...
|
|
32
|
+
return /* @__PURE__ */ e.jsx("hr", { ...a, className: o("kakadu-components-2653569622", r) });
|
|
33
33
|
}
|
|
34
34
|
export {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
x as SeparatorLabel,
|
|
36
|
+
l as SmallSeparator,
|
|
37
|
+
f as VerticalSeparator,
|
|
38
|
+
n as default
|
|
39
39
|
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { type HTMLProps, type ReactNode } from 'react';
|
|
2
2
|
import { type ButtonTooltipPosition } from './button-tooltip';
|
|
3
|
-
export declare
|
|
4
|
-
|
|
5
|
-
delete = "delete"
|
|
6
|
-
}
|
|
3
|
+
export declare const textButtonVariants: readonly ["primary", "delete"];
|
|
4
|
+
export type TextButtonVariant = (typeof textButtonVariants)[number];
|
|
7
5
|
type BaseTextButtonProperties = Omit<HTMLProps<HTMLButtonElement>, 'children'> & {
|
|
8
6
|
readonly iconLeft?: ReactNode;
|
|
9
7
|
readonly iconRight?: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../jsx-runtime-BB_1_6y_.js"),a=require("@kuma-ui/core"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../jsx-runtime-BB_1_6y_.js"),a=require("@kuma-ui/core"),c=require("../icons/icon.js"),q=require("./flex.js"),_=require("./text.js"),h=require("./click-ripples.js"),l=require("./hover-gradient.js"),f=require("./button-tooltip.js"),b=require("./aria-text.js"),N=require("./atom.js"),g=require("./skeleton.js"),w=["primary","delete"],S="kakadu-components-4017654514";function T({iconLeft:n,iconRight:o,variant:m="primary",tooltip:x,tooltipPosition:d,href:i,target:p,rel:j,disabled:k,hasUnderline:E=!0,isSkeleton:u,isSkeletonAnimated:v=!0,className:R,children:t,label:y,...B}){const r=!!k||!!u,s=i&&!u;return e.jsxRuntimeExports.jsxs("div",{className:a.cx("kakadu-components-989891841",t&&(n||o)?a.cx(!!n&&"kakadu-components-497190725",!!o&&"kakadu-components-3729381008"):"kakadu-components-3866032606"),children:[e.jsxRuntimeExports.jsxs(N.default,{...B,as:s?"a":"button",type:s?void 0:"button",href:s?i:void 0,target:s?p:void 0,rel:s?j:void 0,disabled:s?void 0:r,inert:s?r:void 0,className:a.cx(_.textShadowStyles,"kakadu-components-2081390622",m==="delete"&&S,u&&"kakadu-components-2662775151",R),children:[e.jsxRuntimeExports.jsxs(q.default,{direction:"row",gap:.5,preset:"center",children:[n?e.jsxRuntimeExports.jsx("div",{className:a.cx("kakadu-components-743909038",t?"kakadu-components-1285017646":"kakadu-components-1475172827"),children:typeof n=="string"?e.jsxRuntimeExports.jsx(c.default,{width:14,height:14,type:n}):n}):null,t?e.jsxRuntimeExports.jsx("span",{className:a.cx("kakadu-components-743909038",E&&"kakadu-components-2703794515"),children:t}):e.jsxRuntimeExports.jsx(b.default,{children:y}),o?e.jsxRuntimeExports.jsx("div",{className:a.cx("kakadu-components-743909038",t?"kakadu-components-2421728947":"kakadu-components-1475172827"),children:typeof o=="string"?e.jsxRuntimeExports.jsx(c.default,{width:14,height:14,type:o}):o}):null]}),e.jsxRuntimeExports.jsxs("span",{className:"kakadu-components-1970948853",children:[r?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(h.default,{size:t?void 0:50}),e.jsxRuntimeExports.jsx(l.default,{size:t?void 0:50,className:l.normalBlendStyles})]}),x?e.jsxRuntimeExports.jsx(f.default,{label:x,position:d}):null]})]}),u?e.jsxRuntimeExports.jsx("div",{className:"kakadu-components-1970948853",children:e.jsxRuntimeExports.jsx(g.SkeletonInstance,{width:"100%",height:"100%",isAnimated:v})}):null]})}exports.default=T;exports.textButtonVariants=w;
|
|
@@ -1,54 +1,53 @@
|
|
|
1
1
|
import { j as o } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
2
|
import { cx as n } from "@kuma-ui/core";
|
|
3
3
|
import p from "../icons/icon.mjs";
|
|
4
|
-
import h
|
|
5
|
-
import { textShadowStyles as
|
|
6
|
-
import
|
|
4
|
+
import h from "./flex.mjs";
|
|
5
|
+
import { textShadowStyles as N } from "./text.mjs";
|
|
6
|
+
import b from "./click-ripples.mjs";
|
|
7
7
|
import w, { normalBlendStyles as A } from "./hover-gradient.mjs";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { SkeletonInstance as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
function U({
|
|
8
|
+
import g from "./button-tooltip.mjs";
|
|
9
|
+
import T from "./aria-text.mjs";
|
|
10
|
+
import z from "./atom.mjs";
|
|
11
|
+
import { SkeletonInstance as C } from "./skeleton.mjs";
|
|
12
|
+
const O = ["primary", "delete"], D = "kakadu-components-4017654514";
|
|
13
|
+
function P({
|
|
15
14
|
iconLeft: e,
|
|
16
|
-
iconRight:
|
|
15
|
+
iconRight: s,
|
|
17
16
|
variant: i = "primary",
|
|
18
|
-
tooltip:
|
|
17
|
+
tooltip: d,
|
|
19
18
|
tooltipPosition: u,
|
|
20
|
-
href:
|
|
19
|
+
href: l,
|
|
21
20
|
target: k,
|
|
22
21
|
rel: c,
|
|
23
22
|
disabled: x,
|
|
24
23
|
hasUnderline: j = !0,
|
|
25
24
|
isSkeleton: m,
|
|
26
25
|
isSkeletonAnimated: v = !0,
|
|
27
|
-
className:
|
|
26
|
+
className: B,
|
|
28
27
|
children: a,
|
|
29
|
-
label:
|
|
30
|
-
...
|
|
28
|
+
label: y,
|
|
29
|
+
...f
|
|
31
30
|
}) {
|
|
32
|
-
const r = !!x || !!m,
|
|
33
|
-
return /* @__PURE__ */ o.jsxs("div", { className: n("kakadu-components-989891841", a && (e ||
|
|
34
|
-
/* @__PURE__ */ o.jsxs(
|
|
35
|
-
/* @__PURE__ */ o.jsxs(h, { direction: "row", gap: 0.5,
|
|
31
|
+
const r = !!x || !!m, t = l && !m;
|
|
32
|
+
return /* @__PURE__ */ o.jsxs("div", { className: n("kakadu-components-989891841", a && (e || s) ? n(!!e && "kakadu-components-497190725", !!s && "kakadu-components-3729381008") : "kakadu-components-3866032606"), children: [
|
|
33
|
+
/* @__PURE__ */ o.jsxs(z, { ...f, as: t ? "a" : "button", type: t ? void 0 : "button", href: t ? l : void 0, target: t ? k : void 0, rel: t ? c : void 0, disabled: t ? void 0 : r, inert: t ? r : void 0, className: n(N, "kakadu-components-2081390622", i === "delete" && D, m && "kakadu-components-2662775151", B), children: [
|
|
34
|
+
/* @__PURE__ */ o.jsxs(h, { direction: "row", gap: 0.5, preset: "center", children: [
|
|
36
35
|
e ? /* @__PURE__ */ o.jsx("div", { className: n("kakadu-components-743909038", a ? "kakadu-components-1285017646" : "kakadu-components-1475172827"), children: typeof e == "string" ? /* @__PURE__ */ o.jsx(p, { width: 14, height: 14, type: e }) : e }) : null,
|
|
37
|
-
a ? /* @__PURE__ */ o.jsx("span", { className: n("kakadu-components-743909038", j && "kakadu-components-2703794515"), children: a }) : /* @__PURE__ */ o.jsx(
|
|
38
|
-
|
|
36
|
+
a ? /* @__PURE__ */ o.jsx("span", { className: n("kakadu-components-743909038", j && "kakadu-components-2703794515"), children: a }) : /* @__PURE__ */ o.jsx(T, { children: y }),
|
|
37
|
+
s ? /* @__PURE__ */ o.jsx("div", { className: n("kakadu-components-743909038", a ? "kakadu-components-2421728947" : "kakadu-components-1475172827"), children: typeof s == "string" ? /* @__PURE__ */ o.jsx(p, { width: 14, height: 14, type: s }) : s }) : null
|
|
39
38
|
] }),
|
|
40
39
|
/* @__PURE__ */ o.jsxs("span", { className: "kakadu-components-1970948853", children: [
|
|
41
40
|
r ? null : /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
42
|
-
/* @__PURE__ */ o.jsx(
|
|
41
|
+
/* @__PURE__ */ o.jsx(b, { size: a ? void 0 : 50 }),
|
|
43
42
|
/* @__PURE__ */ o.jsx(w, { size: a ? void 0 : 50, className: A })
|
|
44
43
|
] }),
|
|
45
|
-
|
|
44
|
+
d ? /* @__PURE__ */ o.jsx(g, { label: d, position: u }) : null
|
|
46
45
|
] })
|
|
47
46
|
] }),
|
|
48
|
-
m ? /* @__PURE__ */ o.jsx("div", { className: "kakadu-components-1970948853", children: /* @__PURE__ */ o.jsx(
|
|
47
|
+
m ? /* @__PURE__ */ o.jsx("div", { className: "kakadu-components-1970948853", children: /* @__PURE__ */ o.jsx(C, { width: "100%", height: "100%", isAnimated: v }) }) : null
|
|
49
48
|
] });
|
|
50
49
|
}
|
|
51
50
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
P as default,
|
|
52
|
+
O as textButtonVariants
|
|
54
53
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AtomElementType, type AtomProperties } from './atom';
|
|
2
|
-
import { WrapperWidth } from './wrapper';
|
|
2
|
+
import { type WrapperWidth } from './wrapper';
|
|
3
3
|
export declare const textShadowStyles: string;
|
|
4
4
|
export type DefaultHeadingElementType = 'h1';
|
|
5
5
|
export declare const defaultHeadingElementType = "h1";
|
package/build/components/text.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 s=require("../jsx-runtime-BB_1_6y_.js"),a=require("@kuma-ui/core"),j=require("../theme.js"),c=require("./atom.js"),u="kakadu-components-1538322784",x="kakadu-components-739732526",m="h1";function l({reference:t,as:e,className:n,...o}){return s.jsxRuntimeExports.jsx(c.default,{reference:t,as:e??m,...o,className:a.cx(j.overflowProtectionStyles,u,"kakadu-components-1669332734",x,n)})}function f({as:t,id:e,children:n,className:o,...k}){return s.jsxRuntimeExports.jsx(l,{as:t??"h1",id:e,...k,className:a.cx(o),children:s.jsxRuntimeExports.jsx("a",{href:`#${e}`,className:"kakadu-components-1038708690",children:n})})}const r=a.cx("kakadu-components-1923397960",u,x);function p({as:t,className:e,...n}){return s.jsxRuntimeExports.jsx(c.default,{as:t??"span",...n,className:a.cx(r,e)})}function i({as:t,className:e,...n}){return s.jsxRuntimeExports.jsx(c.default,{as:t??"p",...n,className:a.cx(r,"kakadu-components-621160204",e)})}function S({as:t,className:e,...n}){return s.jsxRuntimeExports.jsx(i,{as:t??"small",...n,className:a.cx("kakadu-components-1696055534",e)})}function g({as:t,className:e,...n}){return s.jsxRuntimeExports.jsx(p,{as:t??"span",...n,className:a.cx("kakadu-components-1329768068",e)})}function d({as:t,width:e="text",className:n,...o}){return s.jsxRuntimeExports.jsx(c.default,{as:t??"div",...o,className:a.cx("kakadu-components-3565378821",e==="page"&&"kakadu-components-2433581593",e==="text"&&"kakadu-components-958855245",e==="content"&&"kakadu-components-797764377",n)})}function E(t){const{className:e}=t;return s.jsxRuntimeExports.jsx(d,{...t,className:a.cx("kakadu-components-323682454",e)})}exports.AnchorHeading=f;exports.Footnote=S;exports.Heading=l;exports.Hero=E;exports.Label=g;exports.Paragraph=i;exports.Span=p;exports.default=d;exports.defaultHeadingElementType=m;exports.spanStyles=r;exports.textShadowStyles=u;
|