@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.
@@ -1,178 +1,190 @@
1
1
  import { j as e } from "../jsx-runtime-B4hRZ52C.mjs";
2
- import { useRef as P, useId as Q, useState as I, useLayoutEffect as ue, useMemo as O, useEffect as X, useCallback as b } from "react";
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 me from "../icons/chevron-up.mjs";
5
- import { a as U, S as pe } from "../icon-C6X3pQX0.mjs";
6
- import z from "../utilities/copy-to-clipboard.mjs";
7
- import { buttonResetStyles as ke, overflowProtectionStyles as Y } from "../theme.mjs";
8
- import fe from "./button-tooltip.mjs";
9
- import D from "./text-button.mjs";
10
- import { Span as R, Paragraph as G } from "./text.mjs";
11
- import he from "./collapsible.mjs";
12
- import q from "./click-ripples.mjs";
13
- import J from "./hover-gradient.mjs";
14
- import { useCreateNotification as xe } from "./notification.mjs";
15
- import { NoticeType as je } from "./notice.mjs";
16
- const be = "kakadu-components-922159086", ve = "kakadu-components-2436386418", w = "kakadu-components-930080479", Z = "kakadu-components-4056037255", ye = i(Z, "kakadu-components-3245407458"), ge = i(Z, "kakadu-components-1117160492");
17
- function Ne({
18
- as: u,
19
- className: a,
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(R, { as: u ?? "span", ...d, className: i("kakadu-components-3574036749", a) });
22
+ return /* @__PURE__ */ e.jsx(M, { as: m ?? "span", ...d, className: i("kakadu-components-3574036749", s) });
23
23
  }
24
- function _({
25
- label: u,
26
- error: a,
24
+ function ee({
25
+ label: m,
26
+ error: s,
27
27
  errorId: d,
28
- warning: s,
28
+ warning: o,
29
29
  warningId: v,
30
30
  footnote: n,
31
- attachments: o,
32
- className: m,
33
- children: x,
34
- ...p
31
+ attachments: l,
32
+ className: p,
33
+ children: k,
34
+ ...y
35
35
  }) {
36
- const k = !!a, l = !!s, h = !!n;
37
- return /* @__PURE__ */ e.jsx("label", { ...p, className: i(be, m), children: /* @__PURE__ */ e.jsxs("div", { className: "kakadu-components-3146929190", children: [
38
- /* @__PURE__ */ e.jsx(R, { className: i(Y, ve), children: /* @__PURE__ */ e.jsx("span", { children: u }) }),
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
- x,
41
- h ? /* @__PURE__ */ e.jsx(Ne, { className: "kakadu-components-613632806", children: n }) : null,
42
- o
40
+ k,
41
+ x ? /* @__PURE__ */ e.jsx(Ee, { className: "kakadu-components-613632806", children: n }) : null,
42
+ l
43
43
  ] }),
44
- k || l ? /* @__PURE__ */ e.jsx("div", { className: "kakadu-components-2927674627", children: k ? /* @__PURE__ */ e.jsx(G, { id: d, className: ye, children: a instanceof Error ? a.message : a }) : l ? /* @__PURE__ */ e.jsx(G, { id: v, className: ge, children: s instanceof Error ? s.message : s }) : null }) : null
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 We({
48
- label: u,
49
- options: a,
47
+ function Ue({
48
+ label: m,
49
+ options: s,
50
50
  error: d,
51
- warning: s,
51
+ warning: o,
52
52
  footnote: v,
53
53
  className: n,
54
- onChange: o,
55
- ...m
54
+ onChange: l,
55
+ ...p
56
56
  }) {
57
- const x = Q(), p = `${x}-error`, k = `${x}-warning`, l = !!d, h = !l && !!s, g = l ? p : h ? k : void 0, {
58
- value: f
59
- } = m, [N, y] = I(""), C = f ?? N;
60
- X(() => {
61
- y(typeof f == "string" ? f : "");
62
- }, [f]);
63
- const T = b((t) => {
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: S
66
- } = t.target;
67
- y(S), o == null || o(S, t);
68
- }, [o]);
69
- return /* @__PURE__ */ e.jsxs(_, { label: u, error: d, warning: s, footnote: v, children: [
70
- /* @__PURE__ */ e.jsx("select", { ...m, value: C, "aria-invalid": l, "data-warning": h, "aria-describedby": g, className: i(w, "kakadu-components-4228384787", n), onChange: T, children: a.map((t) => /* @__PURE__ */ e.jsx("option", { value: t.value, children: t.label }, t.value)) }),
71
- /* @__PURE__ */ e.jsx(me, { width: 14, height: 14, className: "kakadu-components-158931186" })
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 Se = 36, K = "kakadu-components-4233741488";
75
- function Oe({
76
- type: u,
77
- label: a,
74
+ const Ce = 40, $ = "kakadu-components-4233741488";
75
+ function ze({
76
+ type: m,
77
+ label: s,
78
78
  error: d,
79
- warning: s,
79
+ warning: o,
80
80
  footnote: v,
81
81
  suggestion: n,
82
- hasCopyButton: o,
83
- hasClearButton: m,
84
- isMultiline: x,
85
- onChange: p,
86
- className: k,
87
- ...l
82
+ actions: l = [],
83
+ hasCopyButton: p,
84
+ hasClearButton: k,
85
+ isMultiline: y,
86
+ onChange: u,
87
+ className: c,
88
+ ...x
88
89
  }) {
89
- const h = P(null), g = P(null), f = P(null), N = xe(), y = Q(), C = `${y}-error`, T = `${y}-warning`, {
90
- value: t,
91
- disabled: S
92
- } = l, [ee, V] = I(""), c = t ?? ee, [ne, te] = I(), ae = u === "textarea" || !!x;
93
- ue(() => {
94
- typeof c == "string" && f.current && te(f.current.scrollHeight);
95
- }, [c]);
96
- const H = O(() => typeof c == "string" ? `${c} `.split(`
97
- `) : [], [c]), se = O(() => H.length, [H]), E = !!d, L = !E && !!s, $ = E ? C : L ? T : void 0;
98
- X(() => {
99
- V(typeof t == "string" ? t : "");
100
- }, [t]);
101
- const M = b((j) => {
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: r
104
- } = j.target;
105
- V(r), p == null || p(r, j);
106
- }, [p]), oe = b(() => {
107
- typeof c == "string" && (z(c), N({
108
- type: je.success,
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
- }, [c, N]), B = b((j) => {
112
- var F;
113
- const r = g.current ?? h.current ?? void 0;
114
- if (r) {
115
- const W = (F = Object.getOwnPropertyDescriptor(r instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLInputElement.prototype, "value")) == null ? void 0 : F.set;
116
- if (W) {
117
- W.call(r, j);
118
- const de = new Event("input", {
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
- r.dispatchEvent(de), r.focus();
122
+ t.dispatchEvent(me), t.focus();
122
123
  return;
123
124
  }
124
125
  }
125
126
  throw new Error("Unable to set value.");
126
- }, []), le = b(() => {
127
+ }, []), re = b(() => {
127
128
  B("");
128
- }, [B]), [ce, re] = I(""), A = !!n && ce !== n, ie = 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
- z(n);
134
+ q(n);
134
135
  }
135
- re(n);
136
+ de(n);
136
137
  }
137
- }, [n, B]);
138
- return /* @__PURE__ */ e.jsxs(_, { label: a, error: d, warning: s, footnote: v, attachments: /* @__PURE__ */ e.jsx(he, { isCollapsed: !A, children: A ? /* @__PURE__ */ e.jsxs("button", { type: "button", className: i(ke, Y, "kakadu-components-2355856341"), onClick: ie, children: [
139
- /* @__PURE__ */ e.jsx(fe, { label: "Apply suggestion" }),
140
- /* @__PURE__ */ e.jsx(pe, { width: 13, height: 13, className: "kakadu-components-1021263934" }),
141
- /* @__PURE__ */ e.jsx(R, { className: "kakadu-components-1585874956", children: n }),
142
- /* @__PURE__ */ e.jsx(q, { className: "kakadu-components-3448565402" }),
143
- /* @__PURE__ */ e.jsx(J, {})
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": `${Se * ((o ? 1 : 0) + (m ? 1 : 0))}px`
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
- ae ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
149
- /* @__PURE__ */ e.jsxs("span", { ref: f, "aria-hidden": !0, className: i(w, k, "kakadu-components-2033521835"), children: [
150
- H.map((j, r) => (
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
- j,
154
- se > 1 ? /* @__PURE__ */ e.jsx("br", {}) : null
155
- ] }, r)
154
+ a,
155
+ le > 1 ? /* @__PURE__ */ e.jsx("br", {}) : null
156
+ ] }, t)
156
157
  )),
157
158
  " "
158
159
  ] }),
159
- /* @__PURE__ */ e.jsx("textarea", { ...l, ref: g, rows: 1, "aria-invalid": E, "data-warning": L, "aria-describedby": $, value: c, className: i(w, k, "kakadu-components-2119524139"), style: {
160
- minHeight: ne
161
- }, onChange: M })
162
- ] }) : /* @__PURE__ */ e.jsx("input", { ...l, ref: h, type: u ?? "text", value: c, "aria-invalid": E, "data-warning": L, "aria-describedby": $, className: i(w, k), onChange: M }),
163
- S ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
164
- /* @__PURE__ */ e.jsx(q, { className: "kakadu-components-616311160" }),
165
- /* @__PURE__ */ e.jsx(J, { className: "kakadu-components-1962999040" })
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
- o || m ? /* @__PURE__ */ e.jsxs("div", { className: "kakadu-components-131986363", children: [
169
- o ? /* @__PURE__ */ e.jsx(D, { iconLeft: U.copy, label: "Copy", tooltip: "Copy", className: K, onClick: oe }) : null,
170
- m ? /* @__PURE__ */ e.jsx(D, { iconLeft: U.times, label: "Clear", tooltip: "Clear", className: K, onClick: le }) : null
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
- We as Select,
176
- Oe as default,
177
- ye as errorParagraph
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-Dw7yhWuE.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:{}};/*!
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-C6X3pQX0.mjs";
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-Dw7yhWuE.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
+ "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-C6X3pQX0.mjs";
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-Dw7yhWuE.js"),m=require("./flex.js"),y=require("./text.js"),R=require("./click-ripples.js"),l=require("./hover-gradient.js"),q=require("./button-tooltip.js"),_=require("./aria-text.js"),v=require("./atom.js");var p=(t=>(t.primary="primary",t.delete="delete",t))(p||{});const B="kakadu-components-4017654514";function N({iconLeft:t,iconRight:n,variant:c="primary",tooltip:u,href:a,target:i,rel:d,disabled:r,className:j,children:s,label:k,...E}){return e.jsxRuntimeExports.jsxs(v.default,{...E,as:a?"a":"button",type:a?void 0:"button",href:a,target:i,rel:d,disabled:r,className:o.cx(y.textShadowStyles,"kakadu-components-1202323410",s&&(t||n)?o.cx(!!t&&"kakadu-components-497190725",!!n&&"kakadu-components-3729381008"):"kakadu-components-3866032606",c==="delete"&&B,j),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(_.default,{children:k}),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(R.default,{size:s?void 0:50}),e.jsxRuntimeExports.jsx(l.default,{size:s?void 0:50,className:l.normalBlendStyles})]}),u?e.jsxRuntimeExports.jsx(q.default,{label:u}):null]})]})}exports.TextButtonVariant=p;exports.default=N;
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-C6X3pQX0.mjs";
4
- import c, { FlexAlignment as j } from "./flex.mjs";
5
- import { textShadowStyles as y } from "./text.mjs";
6
- import B from "./click-ripples.mjs";
7
- import f, { normalBlendStyles as v } from "./hover-gradient.mjs";
8
- import N from "./button-tooltip.mjs";
9
- import w from "./aria-text.mjs";
10
- import S from "./atom.mjs";
11
- var g = /* @__PURE__ */ ((e) => (e.primary = "primary", e.delete = "delete", e))(g || {});
12
- const A = "kakadu-components-4017654514";
13
- function H({
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: d,
20
- rel: k,
20
+ target: k,
21
+ rel: u,
21
22
  disabled: r,
22
- className: u,
23
+ className: i,
23
24
  children: a,
24
25
  label: x,
25
- ...i
26
+ ...c
26
27
  }) {
27
- return /* @__PURE__ */ o.jsxs(S, { ...i, as: n ? "a" : "button", type: n ? void 0 : "button", href: n, target: d, rel: k, disabled: r, className: t(y, "kakadu-components-1202323410", a && (e || s) ? t(!!e && "kakadu-components-497190725", !!s && "kakadu-components-3729381008") : "kakadu-components-3866032606", l === "delete" && A, u), children: [
28
- /* @__PURE__ */ o.jsxs(c, { direction: "row", gap: 0.5, alignment: j.center, children: [
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(w, { children: x }),
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(B, { size: a ? void 0 : 50 }),
36
- /* @__PURE__ */ o.jsx(f, { size: a ? void 0 : 50, className: v })
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(N, { label: m }) : null
39
+ m ? /* @__PURE__ */ o.jsx(w, { label: m, position: d }) : null
39
40
  ] })
40
41
  ] });
41
42
  }
42
43
  export {
43
- g as TextButtonVariant,
44
- H as default
44
+ A as TextButtonVariant,
45
+ q as default
45
46
  };