@kakadu/components 1.7.11 → 1.7.13
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 +6 -1
- package/build/components/button-tooltip.js +1 -1
- package/build/components/button-tooltip.mjs +10 -7
- package/build/components/button.d.ts +3 -1
- package/build/components/button.js +1 -1
- package/build/components/button.mjs +37 -36
- package/build/components/card.js +1 -1
- package/build/components/card.mjs +1 -1
- package/build/components/datum.js +1 -1
- package/build/components/datum.mjs +1 -1
- package/build/components/icon-button.d.ts +3 -1
- package/build/components/icon-button.js +1 -1
- package/build/components/icon-button.mjs +25 -24
- package/build/components/input.d.ts +8 -1
- package/build/components/input.js +2 -2
- package/build/components/input.mjs +135 -123
- package/build/components/modal.js +1 -1
- package/build/components/modal.mjs +1 -1
- package/build/components/notice.js +1 -1
- package/build/components/notice.mjs +1 -1
- package/build/components/text-button.d.ts +3 -1
- package/build/components/text-button.js +1 -1
- package/build/components/text-button.mjs +24 -23
- package/build/components.css +1 -1
- package/build/icon-B__SNDvD.js +1 -0
- package/build/{icon-C6X3pQX0.mjs → icon-BscWXhKi.mjs} +53 -31
- package/build/icons/icon.d.ts +1 -0
- package/build/icons/icon.js +1 -1
- package/build/icons/icon.mjs +1 -1
- package/build/icons/select.d.ts +2 -0
- package/build/index.js +1 -1
- package/build/index.mjs +154 -153
- package/package.json +1 -1
- package/build/icon-Dw7yhWuE.js +0 -1
|
@@ -1,178 +1,190 @@
|
|
|
1
1
|
import { j as e } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
|
-
import { useRef as P, useId as
|
|
2
|
+
import { useRef as P, useId as X, useState as I, useLayoutEffect as pe, useMemo as R, useEffect as Y, useCallback as b } from "react";
|
|
3
3
|
import { cx as i } from "@kuma-ui/core";
|
|
4
|
-
import
|
|
5
|
-
import { a as
|
|
6
|
-
import
|
|
7
|
-
import { buttonResetStyles as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { Span as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { useCreateNotification as
|
|
15
|
-
import { NoticeType as
|
|
16
|
-
const
|
|
17
|
-
function
|
|
18
|
-
as:
|
|
19
|
-
className:
|
|
4
|
+
import ke from "../icons/chevron-up.mjs";
|
|
5
|
+
import { a as G, S as xe } from "../icon-BscWXhKi.mjs";
|
|
6
|
+
import q from "../utilities/copy-to-clipboard.mjs";
|
|
7
|
+
import { buttonResetStyles as fe, overflowProtectionStyles as Z } from "../theme.mjs";
|
|
8
|
+
import he from "./button-tooltip.mjs";
|
|
9
|
+
import V from "./text-button.mjs";
|
|
10
|
+
import { Span as M, Paragraph as J } from "./text.mjs";
|
|
11
|
+
import je from "./collapsible.mjs";
|
|
12
|
+
import K from "./click-ripples.mjs";
|
|
13
|
+
import Q from "./hover-gradient.mjs";
|
|
14
|
+
import { useCreateNotification as be } from "./notification.mjs";
|
|
15
|
+
import { NoticeType as ve } from "./notice.mjs";
|
|
16
|
+
const ye = "kakadu-components-922159086", ge = "kakadu-components-2436386418", w = "kakadu-components-1816130686", _ = "kakadu-components-4056037255", Ne = i(_, "kakadu-components-3245407458"), Se = i(_, "kakadu-components-1117160492");
|
|
17
|
+
function Ee({
|
|
18
|
+
as: m,
|
|
19
|
+
className: s,
|
|
20
20
|
...d
|
|
21
21
|
}) {
|
|
22
|
-
return /* @__PURE__ */ e.jsx(
|
|
22
|
+
return /* @__PURE__ */ e.jsx(M, { as: m ?? "span", ...d, className: i("kakadu-components-3574036749", s) });
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
label:
|
|
26
|
-
error:
|
|
24
|
+
function ee({
|
|
25
|
+
label: m,
|
|
26
|
+
error: s,
|
|
27
27
|
errorId: d,
|
|
28
|
-
warning:
|
|
28
|
+
warning: o,
|
|
29
29
|
warningId: v,
|
|
30
30
|
footnote: n,
|
|
31
|
-
attachments:
|
|
32
|
-
className:
|
|
33
|
-
children:
|
|
34
|
-
...
|
|
31
|
+
attachments: l,
|
|
32
|
+
className: p,
|
|
33
|
+
children: k,
|
|
34
|
+
...y
|
|
35
35
|
}) {
|
|
36
|
-
const
|
|
37
|
-
return /* @__PURE__ */ e.jsx("label", { ...
|
|
38
|
-
/* @__PURE__ */ e.jsx(
|
|
36
|
+
const u = !!s, c = !!o, x = !!n;
|
|
37
|
+
return /* @__PURE__ */ e.jsx("label", { ...y, className: i(ye, p), children: /* @__PURE__ */ e.jsxs("div", { className: "kakadu-components-3146929190", children: [
|
|
38
|
+
/* @__PURE__ */ e.jsx(M, { className: i(Z, ge), children: /* @__PURE__ */ e.jsx("span", { children: m }) }),
|
|
39
39
|
/* @__PURE__ */ e.jsxs("span", { className: "kakadu-components-3298764637", children: [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
k,
|
|
41
|
+
x ? /* @__PURE__ */ e.jsx(Ee, { className: "kakadu-components-613632806", children: n }) : null,
|
|
42
|
+
l
|
|
43
43
|
] }),
|
|
44
|
-
|
|
44
|
+
u || c ? /* @__PURE__ */ e.jsx("div", { className: "kakadu-components-2927674627", children: u ? /* @__PURE__ */ e.jsx(J, { id: d, className: Ne, children: s instanceof Error ? s.message : s }) : c ? /* @__PURE__ */ e.jsx(J, { id: v, className: Se, children: o instanceof Error ? o.message : o }) : null }) : null
|
|
45
45
|
] }) });
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
label:
|
|
49
|
-
options:
|
|
47
|
+
function Ue({
|
|
48
|
+
label: m,
|
|
49
|
+
options: s,
|
|
50
50
|
error: d,
|
|
51
|
-
warning:
|
|
51
|
+
warning: o,
|
|
52
52
|
footnote: v,
|
|
53
53
|
className: n,
|
|
54
|
-
onChange:
|
|
55
|
-
...
|
|
54
|
+
onChange: l,
|
|
55
|
+
...p
|
|
56
56
|
}) {
|
|
57
|
-
const
|
|
58
|
-
value:
|
|
59
|
-
} =
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}, [
|
|
63
|
-
const T = b((
|
|
57
|
+
const k = X(), y = `${k}-error`, u = `${k}-warning`, c = !!d, x = !c && !!o, S = c ? y : x ? u : void 0, {
|
|
58
|
+
value: h
|
|
59
|
+
} = p, [g, N] = I(""), E = h ?? g;
|
|
60
|
+
Y(() => {
|
|
61
|
+
N(typeof h == "string" ? h : "");
|
|
62
|
+
}, [h]);
|
|
63
|
+
const T = b((f) => {
|
|
64
64
|
const {
|
|
65
|
-
value:
|
|
66
|
-
} =
|
|
67
|
-
|
|
68
|
-
}, [
|
|
69
|
-
return /* @__PURE__ */ e.jsxs(
|
|
70
|
-
/* @__PURE__ */ e.jsx("select", { ...
|
|
71
|
-
/* @__PURE__ */ e.jsx(
|
|
65
|
+
value: j
|
|
66
|
+
} = f.target;
|
|
67
|
+
N(j), l == null || l(j, f);
|
|
68
|
+
}, [l]);
|
|
69
|
+
return /* @__PURE__ */ e.jsxs(ee, { label: m, error: d, warning: o, footnote: v, children: [
|
|
70
|
+
/* @__PURE__ */ e.jsx("select", { ...p, value: E, "aria-invalid": c, "data-warning": x, "aria-describedby": S, className: i(w, "kakadu-components-4228384787", n), onChange: T, children: s.map((f) => /* @__PURE__ */ e.jsx("option", { value: f.value, children: f.label }, f.value)) }),
|
|
71
|
+
/* @__PURE__ */ e.jsx(ke, { width: 14, height: 14, className: "kakadu-components-158931186" })
|
|
72
72
|
] });
|
|
73
73
|
}
|
|
74
|
-
const
|
|
75
|
-
function
|
|
76
|
-
type:
|
|
77
|
-
label:
|
|
74
|
+
const Ce = 40, $ = "kakadu-components-4233741488";
|
|
75
|
+
function ze({
|
|
76
|
+
type: m,
|
|
77
|
+
label: s,
|
|
78
78
|
error: d,
|
|
79
|
-
warning:
|
|
79
|
+
warning: o,
|
|
80
80
|
footnote: v,
|
|
81
81
|
suggestion: n,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
actions: l = [],
|
|
83
|
+
hasCopyButton: p,
|
|
84
|
+
hasClearButton: k,
|
|
85
|
+
isMultiline: y,
|
|
86
|
+
onChange: u,
|
|
87
|
+
className: c,
|
|
88
|
+
...x
|
|
88
89
|
}) {
|
|
89
|
-
const
|
|
90
|
-
value:
|
|
91
|
-
disabled:
|
|
92
|
-
} =
|
|
93
|
-
|
|
94
|
-
typeof
|
|
95
|
-
}, [
|
|
96
|
-
const
|
|
97
|
-
`) : [], [
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}, [
|
|
101
|
-
const
|
|
90
|
+
const S = P(null), h = P(null), g = P(null), N = be(), E = X(), T = `${E}-error`, f = `${E}-warning`, {
|
|
91
|
+
value: j,
|
|
92
|
+
disabled: ne
|
|
93
|
+
} = x, [ae, A] = I(""), r = j ?? ae, [te, se] = I(), oe = m === "textarea" || !!y;
|
|
94
|
+
pe(() => {
|
|
95
|
+
typeof r == "string" && g.current && se(g.current.scrollHeight);
|
|
96
|
+
}, [r]);
|
|
97
|
+
const L = R(() => typeof r == "string" ? `${r} `.split(`
|
|
98
|
+
`) : [], [r]), le = R(() => L.length, [L]), C = !!d, H = !C && !!o, F = C ? T : H ? f : void 0;
|
|
99
|
+
Y(() => {
|
|
100
|
+
A(typeof j == "string" ? j : "");
|
|
101
|
+
}, [j]);
|
|
102
|
+
const W = b((a) => {
|
|
102
103
|
const {
|
|
103
|
-
value:
|
|
104
|
-
} =
|
|
105
|
-
|
|
106
|
-
}, [
|
|
107
|
-
typeof
|
|
108
|
-
type:
|
|
104
|
+
value: t
|
|
105
|
+
} = a.target;
|
|
106
|
+
A(t), u == null || u(t, a);
|
|
107
|
+
}, [u]), ce = b(() => {
|
|
108
|
+
typeof r == "string" && (q(r), N({
|
|
109
|
+
type: ve.success,
|
|
109
110
|
children: "Copied to clipboard."
|
|
110
111
|
}));
|
|
111
|
-
}, [
|
|
112
|
-
var
|
|
113
|
-
const
|
|
114
|
-
if (
|
|
115
|
-
const
|
|
116
|
-
if (
|
|
117
|
-
|
|
118
|
-
const
|
|
112
|
+
}, [r, N]), B = b((a) => {
|
|
113
|
+
var z;
|
|
114
|
+
const t = h.current ?? S.current ?? void 0;
|
|
115
|
+
if (t) {
|
|
116
|
+
const D = (z = Object.getOwnPropertyDescriptor(t instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLInputElement.prototype, "value")) == null ? void 0 : z.set;
|
|
117
|
+
if (D) {
|
|
118
|
+
D.call(t, a);
|
|
119
|
+
const me = new Event("input", {
|
|
119
120
|
bubbles: !0
|
|
120
121
|
});
|
|
121
|
-
|
|
122
|
+
t.dispatchEvent(me), t.focus();
|
|
122
123
|
return;
|
|
123
124
|
}
|
|
124
125
|
}
|
|
125
126
|
throw new Error("Unable to set value.");
|
|
126
|
-
}, []),
|
|
127
|
+
}, []), re = b(() => {
|
|
127
128
|
B("");
|
|
128
|
-
}, [B]), [
|
|
129
|
+
}, [B]), [ie, de] = I(""), O = !!n && ie !== n, ue = b(() => {
|
|
129
130
|
if (n) {
|
|
130
131
|
try {
|
|
131
132
|
B(n);
|
|
132
133
|
} catch {
|
|
133
|
-
|
|
134
|
+
q(n);
|
|
134
135
|
}
|
|
135
|
-
|
|
136
|
+
de(n);
|
|
136
137
|
}
|
|
137
|
-
}, [n, B]);
|
|
138
|
-
return /* @__PURE__ */ e.jsxs(
|
|
139
|
-
/* @__PURE__ */ e.jsx(
|
|
140
|
-
/* @__PURE__ */ e.jsx(
|
|
141
|
-
/* @__PURE__ */ e.jsx(
|
|
142
|
-
/* @__PURE__ */ e.jsx(
|
|
143
|
-
/* @__PURE__ */ e.jsx(
|
|
138
|
+
}, [n, B]), U = R(() => l.length, [l]);
|
|
139
|
+
return /* @__PURE__ */ e.jsxs(ee, { label: s, error: d, warning: o, footnote: v, attachments: /* @__PURE__ */ e.jsx(je, { isCollapsed: !O, children: O ? /* @__PURE__ */ e.jsxs("button", { type: "button", className: i(fe, Z, "kakadu-components-2355856341"), onClick: ue, children: [
|
|
140
|
+
/* @__PURE__ */ e.jsx(he, { label: "Apply suggestion" }),
|
|
141
|
+
/* @__PURE__ */ e.jsx(xe, { width: 13, height: 13, className: "kakadu-components-1021263934" }),
|
|
142
|
+
/* @__PURE__ */ e.jsx(M, { className: "kakadu-components-1585874956", children: n }),
|
|
143
|
+
/* @__PURE__ */ e.jsx(K, { className: "kakadu-components-3448565402" }),
|
|
144
|
+
/* @__PURE__ */ e.jsx(Q, {})
|
|
144
145
|
] }) : null }), style: {
|
|
145
|
-
"--button-padding":
|
|
146
|
+
"--button-padding": `calc(${Ce * ((p ? 1 : 0) + (k ? 1 : 0) + U)}px + 6px)`
|
|
146
147
|
}, children: [
|
|
147
148
|
/* @__PURE__ */ e.jsxs("div", { className: "kakadu-components-3146929190", children: [
|
|
148
|
-
|
|
149
|
-
/* @__PURE__ */ e.jsxs("span", { ref:
|
|
150
|
-
|
|
149
|
+
oe ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
150
|
+
/* @__PURE__ */ e.jsxs("span", { ref: g, "aria-hidden": !0, className: i(w, c, "kakadu-components-2033521835"), children: [
|
|
151
|
+
L.map((a, t) => (
|
|
151
152
|
// eslint-disable-next-line react/no-array-index-key
|
|
152
153
|
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
] },
|
|
154
|
+
a,
|
|
155
|
+
le > 1 ? /* @__PURE__ */ e.jsx("br", {}) : null
|
|
156
|
+
] }, t)
|
|
156
157
|
)),
|
|
157
158
|
" "
|
|
158
159
|
] }),
|
|
159
|
-
/* @__PURE__ */ e.jsx("textarea", { ...
|
|
160
|
-
minHeight:
|
|
161
|
-
}, onChange:
|
|
162
|
-
] }) : /* @__PURE__ */ e.jsx("input", { ...
|
|
163
|
-
|
|
164
|
-
/* @__PURE__ */ e.jsx(
|
|
165
|
-
/* @__PURE__ */ e.jsx(
|
|
160
|
+
/* @__PURE__ */ e.jsx("textarea", { ...x, ref: h, rows: 1, "aria-invalid": C, "data-warning": H, "aria-describedby": F, value: r, className: i(w, c, "kakadu-components-2119524139"), style: {
|
|
161
|
+
minHeight: te
|
|
162
|
+
}, onChange: W })
|
|
163
|
+
] }) : /* @__PURE__ */ e.jsx("input", { ...x, ref: S, type: m ?? "text", value: r, "aria-invalid": C, "data-warning": H, "aria-describedby": F, className: i(w, c), onChange: W }),
|
|
164
|
+
ne ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
165
|
+
/* @__PURE__ */ e.jsx(K, { className: "kakadu-components-616311160" }),
|
|
166
|
+
/* @__PURE__ */ e.jsx(Q, { className: "kakadu-components-1962999040" })
|
|
166
167
|
] })
|
|
167
168
|
] }),
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
p || k || U > 0 ? /* @__PURE__ */ e.jsxs("div", { className: "kakadu-components-131986363", children: [
|
|
170
|
+
l.map((a, t) => /* @__PURE__ */ e.jsx(
|
|
171
|
+
V,
|
|
172
|
+
{
|
|
173
|
+
iconLeft: a.icon,
|
|
174
|
+
label: a.label,
|
|
175
|
+
tooltip: a.label,
|
|
176
|
+
className: $,
|
|
177
|
+
onClick: a.onClick
|
|
178
|
+
},
|
|
179
|
+
a.label + t
|
|
180
|
+
)),
|
|
181
|
+
p ? /* @__PURE__ */ e.jsx(V, { iconLeft: G.copy, label: "Copy", tooltip: "Copy", className: $, onClick: ce }) : null,
|
|
182
|
+
k ? /* @__PURE__ */ e.jsx(V, { iconLeft: G.times, label: "Clear", tooltip: "Clear", className: $, onClick: re }) : null
|
|
171
183
|
] }) : null
|
|
172
184
|
] });
|
|
173
185
|
}
|
|
174
186
|
export {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
187
|
+
Ue as Select,
|
|
188
|
+
ze as default,
|
|
189
|
+
Ne as errorParagraph
|
|
178
190
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const N=require("../jsx-runtime-BB_1_6y_.js"),O=require("react"),le=require("@kuma-ui/core"),xe=require("react-dom"),je=require("../icon-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const N=require("../jsx-runtime-BB_1_6y_.js"),O=require("react"),le=require("@kuma-ui/core"),xe=require("react-dom"),je=require("../icon-B__SNDvD.js"),Pe=require("./text-button.js");function me(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var e=r.default;if(typeof e=="function"){var t=function a(){return this instanceof a?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(a){var s=Object.getOwnPropertyDescriptor(r,a);Object.defineProperty(t,a,s.get?s:{enumerable:!0,get:function(){return r[a]}})}),t}var J={exports:{}};/*!
|
|
2
2
|
* tabbable 6.4.0
|
|
3
3
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
4
4
|
*/var ge=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],te=ge.join(","),Te=typeof Element>"u",Y=Te?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,re=!Te&&Element.prototype.getRootNode?function(r){var e;return r==null||(e=r.getRootNode)===null||e===void 0?void 0:e.call(r)}:function(r){return r==null?void 0:r.ownerDocument},ae=function(e,t){var a;t===void 0&&(t=!0);var s=e==null||(a=e.getAttribute)===null||a===void 0?void 0:a.call(e,"inert"),c=s===""||s==="true",n=c||t&&e&&(typeof e.closest=="function"?e.closest("[inert]"):ae(e.parentNode));return n},Ce=function(e){var t,a=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return a===""||a==="true"},we=function(e,t,a){if(ae(e))return[];var s=Array.prototype.slice.apply(e.querySelectorAll(te));return t&&Y.call(e,te)&&s.unshift(e),s=s.filter(a),s},ne=function(e,t,a){for(var s=[],c=Array.from(e);c.length;){var n=c.shift();if(!ae(n,!1))if(n.tagName==="SLOT"){var p=n.assignedElements(),y=p.length?p:n.children,E=ne(y,!0,a);a.flatten?s.push.apply(s,E):s.push({scopeParent:n,candidates:E})}else{var F=Y.call(n,te);F&&a.filter(n)&&(t||!e.includes(n))&&s.push(n);var D=n.shadowRoot||typeof a.getShadowRoot=="function"&&a.getShadowRoot(n),x=!ae(D,!1)&&(!a.shadowRootFilter||a.shadowRootFilter(n));if(D&&x){var A=ne(D===!0?n.children:D.children,!0,a);a.flatten?s.push.apply(s,A):s.push({scopeParent:n,candidates:A})}else c.unshift.apply(c,n.children)}}return s},Ee=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},q=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Ce(e))&&!Ee(e)?0:e.tabIndex},Ie=function(e,t){var a=q(e);return a<0&&t&&!Ee(e)?0:a},Ae=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ke=function(e){return e.tagName==="INPUT"},_e=function(e){return ke(e)&&e.type==="hidden"},Le=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(a){return a.tagName==="SUMMARY"});return t},Me=function(e,t){for(var a=0;a<e.length;a++)if(e[a].checked&&e[a].form===t)return e[a]},Be=function(e){if(!e.name)return!0;var t=e.form||re(e),a=function(p){return t.querySelectorAll('input[type="radio"][name="'+p+'"]')},s;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")s=a(window.CSS.escape(e.name));else try{s=a(e.name)}catch(n){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",n.message),!1}var c=Me(s,e.form);return!c||c===e},Ke=function(e){return ke(e)&&e.type==="radio"},qe=function(e){return Ke(e)&&!Be(e)},Ve=function(e){var t,a=e&&re(e),s=(t=a)===null||t===void 0?void 0:t.host,c=!1;if(a&&a!==e){var n,p,y;for(c=!!((n=s)!==null&&n!==void 0&&(p=n.ownerDocument)!==null&&p!==void 0&&p.contains(s)||e!=null&&(y=e.ownerDocument)!==null&&y!==void 0&&y.contains(e));!c&&s;){var E,F,D;a=re(s),s=(E=a)===null||E===void 0?void 0:E.host,c=!!((F=s)!==null&&F!==void 0&&(D=F.ownerDocument)!==null&&D!==void 0&&D.contains(s))}}return c},fe=function(e){var t=e.getBoundingClientRect(),a=t.width,s=t.height;return a===0&&s===0},$e=function(e,t){var a=t.displayCheck,s=t.getShadowRoot;if(a==="full-native"&&"checkVisibility"in e){var c=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!c}if(getComputedStyle(e).visibility==="hidden")return!0;var n=Y.call(e,"details>summary:first-of-type"),p=n?e.parentElement:e;if(Y.call(p,"details:not([open]) *"))return!0;if(!a||a==="full"||a==="full-native"||a==="legacy-full"){if(typeof s=="function"){for(var y=e;e;){var E=e.parentElement,F=re(e);if(E&&!E.shadowRoot&&s(E)===!0)return fe(e);e.assignedSlot?e=e.assignedSlot:!E&&F!==e.ownerDocument?e=F.host:e=E}e=y}if(Ve(e))return!e.getClientRects().length;if(a!=="legacy-full")return!0}else if(a==="non-zero-area")return fe(e);return!1},Ge=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var a=0;a<t.children.length;a++){var s=t.children.item(a);if(s.tagName==="LEGEND")return Y.call(t,"fieldset[disabled] *")?!0:!s.contains(e)}return!0}t=t.parentElement}return!1},ie=function(e,t){return!(t.disabled||_e(t)||$e(t,e)||Le(t)||Ge(t))},se=function(e,t){return!(qe(t)||q(t)<0||!ie(e,t))},Ue=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Se=function(e){var t=[],a=[];return e.forEach(function(s,c){var n=!!s.scopeParent,p=n?s.scopeParent:s,y=Ie(p,n),E=n?Se(s.candidates):p;y===0?n?t.push.apply(t,E):t.push(p):a.push({documentOrder:c,tabIndex:y,item:s,isScope:n,content:E})}),a.sort(Ae).reduce(function(s,c){return c.isScope?s.push.apply(s,c.content):s.push(c.content),s},[]).concat(t)},Fe=function(e,t){t=t||{};var a;return t.getShadowRoot?a=ne([e],t.includeContainer,{filter:se.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Ue}):a=we(e,t.includeContainer,se.bind(null,t)),Se(a)},Oe=function(e,t){t=t||{};var a;return t.getShadowRoot?a=ne([e],t.includeContainer,{filter:ie.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):a=we(e,t.includeContainer,ie.bind(null,t)),a},z=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return Y.call(e,te)===!1?!1:se(t,e)},We=ge.concat("iframe:not([inert]):not([inert] *)").join(","),ee=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return Y.call(e,We)===!1?!1:ie(t,e)};const ze=Object.freeze(Object.defineProperty({__proto__:null,focusable:Oe,getTabIndex:q,isFocusable:ee,isTabbable:z,tabbable:Fe},Symbol.toStringTag,{value:"Module"}));/*!
|
|
@@ -2,7 +2,7 @@ import { j as N } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
|
2
2
|
import Ie, { createContext as Ae, useRef as te, useState as re, useCallback as J, useMemo as ne, useEffect as H, useContext as xe } from "react";
|
|
3
3
|
import { cx as pe } from "@kuma-ui/core";
|
|
4
4
|
import { createPortal as _e } from "react-dom";
|
|
5
|
-
import { a as Le } from "../icon-
|
|
5
|
+
import { a as Le } from "../icon-BscWXhKi.mjs";
|
|
6
6
|
import Be from "./text-button.mjs";
|
|
7
7
|
function ke(r) {
|
|
8
8
|
if (Object.prototype.hasOwnProperty.call(r, "__esModule")) return r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("../jsx-runtime-BB_1_6y_.js"),t=require("@kuma-ui/core"),c=require("../icon-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("../jsx-runtime-BB_1_6y_.js"),t=require("@kuma-ui/core"),c=require("../icon-B__SNDvD.js"),l=require("./text.js");var r=(s=>(s.default="default",s.success="success",s.warning="warning",s.danger="danger",s))(r||{});function p({type:s="default",icon:a,className:u,children:o,...d}){const i=s==="success",m=s==="warning",k=s==="danger",e=!!a,x=!!o;return n.jsxRuntimeExports.jsxs("aside",{...d,className:t.cx("kakadu-components-925362255",e&&"kakadu-components-2945174293",i&&(e?"kakadu-components-2585123369":"kakadu-components-1387450724"),m&&(e?"kakadu-components-3502407303":"kakadu-components-1612824642"),k&&(e?"kakadu-components-314765189":"kakadu-components-4209515987"),u),children:[n.jsxRuntimeExports.jsx("div",{"data-theme":"dark",className:t.cx("kakadu-components-3327291559",e&&"kakadu-components-3906762683"),children:a&&n.jsxRuntimeExports.jsx(c.Icon,{width:14,height:14,type:a,className:c.iconShadowStyles})}),n.jsxRuntimeExports.jsx(l.Span,{className:"kakadu-components-1969958615",children:x?o:n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{children:" "})})]})}exports.NoticeType=r;exports.default=p;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as s } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
2
|
import { cx as t } from "@kuma-ui/core";
|
|
3
|
-
import { I as i, i as l } from "../icon-
|
|
3
|
+
import { I as i, i as l } from "../icon-BscWXhKi.mjs";
|
|
4
4
|
import { Span as p } from "./text.mjs";
|
|
5
5
|
var h = /* @__PURE__ */ ((a) => (a.default = "default", a.success = "success", a.warning = "warning", a.danger = "danger", a))(h || {});
|
|
6
6
|
function w({
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type HTMLProps, type ReactNode } from 'react';
|
|
2
|
+
import { type ButtonTooltipPosition } from './button-tooltip';
|
|
2
3
|
export declare enum TextButtonVariant {
|
|
3
4
|
primary = "primary",
|
|
4
5
|
delete = "delete"
|
|
@@ -8,6 +9,7 @@ type BaseTextButtonProperties = Omit<HTMLProps<HTMLButtonElement>, 'children'> &
|
|
|
8
9
|
readonly iconRight?: ReactNode;
|
|
9
10
|
readonly variant?: TextButtonVariant;
|
|
10
11
|
readonly tooltip?: string;
|
|
12
|
+
readonly tooltipPosition?: ButtonTooltipPosition;
|
|
11
13
|
};
|
|
12
14
|
export type TextButtonProperties = BaseTextButtonProperties & ({
|
|
13
15
|
children: ReactNode;
|
|
@@ -16,5 +18,5 @@ export type TextButtonProperties = BaseTextButtonProperties & ({
|
|
|
16
18
|
children?: never;
|
|
17
19
|
label: string;
|
|
18
20
|
});
|
|
19
|
-
export default function TextButton({ iconLeft, iconRight, variant, tooltip, href, target, rel, disabled, className, children, label, ...properties }: TextButtonProperties): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export default function TextButton({ iconLeft, iconRight, variant, tooltip, tooltipPosition, href, target, rel, disabled, className, children, label, ...properties }: TextButtonProperties): import("react/jsx-runtime").JSX.Element;
|
|
20
22
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../jsx-runtime-BB_1_6y_.js"),o=require("@kuma-ui/core"),x=require("../icon-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../jsx-runtime-BB_1_6y_.js"),o=require("@kuma-ui/core"),x=require("../icon-B__SNDvD.js"),m=require("./flex.js"),R=require("./text.js"),q=require("./click-ripples.js"),p=require("./hover-gradient.js"),_=require("./button-tooltip.js"),v=require("./aria-text.js"),B=require("./atom.js");var l=(t=>(t.primary="primary",t.delete="delete",t))(l||{});const N="kakadu-components-4017654514";function S({iconLeft:t,iconRight:n,variant:c="primary",tooltip:u,tooltipPosition:i,href:a,target:d,rel:j,disabled:r,className:k,children:s,label:E,...y}){return e.jsxRuntimeExports.jsxs(B.default,{...y,as:a?"a":"button",type:a?void 0:"button",href:a,target:d,rel:j,disabled:r,className:o.cx(R.textShadowStyles,"kakadu-components-1202323410",s&&(t||n)?o.cx(!!t&&"kakadu-components-497190725",!!n&&"kakadu-components-3729381008"):"kakadu-components-3866032606",c==="delete"&&N,k),children:[e.jsxRuntimeExports.jsxs(m.default,{direction:"row",gap:.5,alignment:m.FlexAlignment.center,children:[t?e.jsxRuntimeExports.jsx("div",{className:o.cx("kakadu-components-2031441451",s?"kakadu-components-2885581246":"kakadu-components-611756781"),children:typeof t=="string"?e.jsxRuntimeExports.jsx(x.Icon,{width:14,height:14,type:t}):t}):null,s?e.jsxRuntimeExports.jsx("span",{className:"kakadu-components-2362298521",children:s}):e.jsxRuntimeExports.jsx(v.default,{children:E}),n?e.jsxRuntimeExports.jsx("div",{className:o.cx("kakadu-components-2031441451",s?"kakadu-components-2285425267":"kakadu-components-611756781"),children:typeof n=="string"?e.jsxRuntimeExports.jsx(x.Icon,{width:14,height:14,type:n}):n}):null]}),e.jsxRuntimeExports.jsxs("span",{className:"kakadu-components-1343580459",children:[r?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(q.default,{size:s?void 0:50}),e.jsxRuntimeExports.jsx(p.default,{size:s?void 0:50,className:p.normalBlendStyles})]}),u?e.jsxRuntimeExports.jsx(_.default,{label:u,position:i}):null]})]})}exports.TextButtonVariant=l;exports.default=S;
|
|
@@ -1,45 +1,46 @@
|
|
|
1
1
|
import { j as o } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
2
|
import { cx as t } from "@kuma-ui/core";
|
|
3
|
-
import { I as p } from "../icon-
|
|
4
|
-
import
|
|
5
|
-
import { textShadowStyles as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
var
|
|
12
|
-
const
|
|
13
|
-
function
|
|
3
|
+
import { I as p } from "../icon-BscWXhKi.mjs";
|
|
4
|
+
import j, { FlexAlignment as y } from "./flex.mjs";
|
|
5
|
+
import { textShadowStyles as B } from "./text.mjs";
|
|
6
|
+
import f from "./click-ripples.mjs";
|
|
7
|
+
import v, { normalBlendStyles as N } from "./hover-gradient.mjs";
|
|
8
|
+
import w from "./button-tooltip.mjs";
|
|
9
|
+
import S from "./aria-text.mjs";
|
|
10
|
+
import g from "./atom.mjs";
|
|
11
|
+
var A = /* @__PURE__ */ ((e) => (e.primary = "primary", e.delete = "delete", e))(A || {});
|
|
12
|
+
const F = "kakadu-components-4017654514";
|
|
13
|
+
function q({
|
|
14
14
|
iconLeft: e,
|
|
15
15
|
iconRight: s,
|
|
16
16
|
variant: l = "primary",
|
|
17
17
|
tooltip: m,
|
|
18
|
+
tooltipPosition: d,
|
|
18
19
|
href: n,
|
|
19
|
-
target:
|
|
20
|
-
rel:
|
|
20
|
+
target: k,
|
|
21
|
+
rel: u,
|
|
21
22
|
disabled: r,
|
|
22
|
-
className:
|
|
23
|
+
className: i,
|
|
23
24
|
children: a,
|
|
24
25
|
label: x,
|
|
25
|
-
...
|
|
26
|
+
...c
|
|
26
27
|
}) {
|
|
27
|
-
return /* @__PURE__ */ o.jsxs(
|
|
28
|
-
/* @__PURE__ */ o.jsxs(
|
|
28
|
+
return /* @__PURE__ */ o.jsxs(g, { ...c, as: n ? "a" : "button", type: n ? void 0 : "button", href: n, target: k, rel: u, disabled: r, className: t(B, "kakadu-components-1202323410", a && (e || s) ? t(!!e && "kakadu-components-497190725", !!s && "kakadu-components-3729381008") : "kakadu-components-3866032606", l === "delete" && F, i), children: [
|
|
29
|
+
/* @__PURE__ */ o.jsxs(j, { direction: "row", gap: 0.5, alignment: y.center, children: [
|
|
29
30
|
e ? /* @__PURE__ */ o.jsx("div", { className: t("kakadu-components-2031441451", a ? "kakadu-components-2885581246" : "kakadu-components-611756781"), children: typeof e == "string" ? /* @__PURE__ */ o.jsx(p, { width: 14, height: 14, type: e }) : e }) : null,
|
|
30
|
-
a ? /* @__PURE__ */ o.jsx("span", { className: "kakadu-components-2362298521", children: a }) : /* @__PURE__ */ o.jsx(
|
|
31
|
+
a ? /* @__PURE__ */ o.jsx("span", { className: "kakadu-components-2362298521", children: a }) : /* @__PURE__ */ o.jsx(S, { children: x }),
|
|
31
32
|
s ? /* @__PURE__ */ o.jsx("div", { className: t("kakadu-components-2031441451", a ? "kakadu-components-2285425267" : "kakadu-components-611756781"), children: typeof s == "string" ? /* @__PURE__ */ o.jsx(p, { width: 14, height: 14, type: s }) : s }) : null
|
|
32
33
|
] }),
|
|
33
34
|
/* @__PURE__ */ o.jsxs("span", { className: "kakadu-components-1343580459", children: [
|
|
34
35
|
r ? null : /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
35
|
-
/* @__PURE__ */ o.jsx(
|
|
36
|
-
/* @__PURE__ */ o.jsx(
|
|
36
|
+
/* @__PURE__ */ o.jsx(f, { size: a ? void 0 : 50 }),
|
|
37
|
+
/* @__PURE__ */ o.jsx(v, { size: a ? void 0 : 50, className: N })
|
|
37
38
|
] }),
|
|
38
|
-
m ? /* @__PURE__ */ o.jsx(
|
|
39
|
+
m ? /* @__PURE__ */ o.jsx(w, { label: m, position: d }) : null
|
|
39
40
|
] })
|
|
40
41
|
] });
|
|
41
42
|
}
|
|
42
43
|
export {
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
A as TextButtonVariant,
|
|
45
|
+
q as default
|
|
45
46
|
};
|