@kakadu/components 1.7.12 → 1.7.14
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 +12 -12
- package/build/components/datum.js +1 -1
- package/build/components/datum.mjs +7 -7
- 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 +6 -5
- package/build/components/input.js +2 -2
- package/build/components/input.mjs +39 -38
- 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 +6 -6
- 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/icons/dots.js +1 -0
- package/build/icons/dots.mjs +25 -0
- package/build/icons/external.js +1 -0
- package/build/icons/external.mjs +24 -0
- package/build/icons/icon.d.ts +1 -0
- package/build/icons/icon.js +1 -1
- package/build/icons/icon.mjs +76 -29
- package/build/icons/select.js +1 -0
- package/build/icons/select.mjs +25 -0
- package/build/icons/share.js +1 -0
- package/build/icons/share.mjs +24 -0
- package/build/icons/sparkle.js +1 -0
- package/build/icons/sparkle.mjs +27 -0
- package/build/icons/trash.d.ts +2 -0
- package/build/icons/trash.js +1 -0
- package/build/icons/trash.mjs +24 -0
- package/build/icons/trend-up.js +1 -0
- package/build/icons/trend-up.mjs +48 -0
- package/build/index.d.ts +50 -36
- package/build/index.js +1 -1
- package/build/index.mjs +173 -158
- package/package.json +1 -1
- package/build/icon-B__SNDvD.js +0 -1
- package/build/icon-BscWXhKi.mjs +0 -220
|
@@ -2,9 +2,10 @@ import { j as e } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
|
2
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
4
|
import ke from "../icons/chevron-up.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { IconType as G } from "../icons/icon.mjs";
|
|
6
6
|
import q from "../utilities/copy-to-clipboard.mjs";
|
|
7
7
|
import { buttonResetStyles as fe, overflowProtectionStyles as Z } from "../theme.mjs";
|
|
8
|
+
import xe from "../icons/sparkle.mjs";
|
|
8
9
|
import he from "./button-tooltip.mjs";
|
|
9
10
|
import V from "./text-button.mjs";
|
|
10
11
|
import { Span as M, Paragraph as J } from "./text.mjs";
|
|
@@ -33,18 +34,18 @@ function ee({
|
|
|
33
34
|
children: k,
|
|
34
35
|
...y
|
|
35
36
|
}) {
|
|
36
|
-
const u = !!s, c = !!o,
|
|
37
|
+
const u = !!s, c = !!o, f = !!n;
|
|
37
38
|
return /* @__PURE__ */ e.jsx("label", { ...y, className: i(ye, p), children: /* @__PURE__ */ e.jsxs("div", { className: "kakadu-components-3146929190", children: [
|
|
38
39
|
/* @__PURE__ */ e.jsx(M, { className: i(Z, ge), children: /* @__PURE__ */ e.jsx("span", { children: m }) }),
|
|
39
40
|
/* @__PURE__ */ e.jsxs("span", { className: "kakadu-components-3298764637", children: [
|
|
40
41
|
k,
|
|
41
|
-
|
|
42
|
+
f ? /* @__PURE__ */ e.jsx(Ee, { className: "kakadu-components-613632806", children: n }) : null,
|
|
42
43
|
l
|
|
43
44
|
] }),
|
|
44
45
|
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
46
|
] }) });
|
|
46
47
|
}
|
|
47
|
-
function
|
|
48
|
+
function ze({
|
|
48
49
|
label: m,
|
|
49
50
|
options: s,
|
|
50
51
|
error: d,
|
|
@@ -54,25 +55,25 @@ function Ue({
|
|
|
54
55
|
onChange: l,
|
|
55
56
|
...p
|
|
56
57
|
}) {
|
|
57
|
-
const k = X(), y = `${k}-error`, u = `${k}-warning`, c = !!d,
|
|
58
|
+
const k = X(), y = `${k}-error`, u = `${k}-warning`, c = !!d, f = !c && !!o, S = c ? y : f ? u : void 0, {
|
|
58
59
|
value: h
|
|
59
60
|
} = p, [g, N] = I(""), E = h ?? g;
|
|
60
61
|
Y(() => {
|
|
61
62
|
N(typeof h == "string" ? h : "");
|
|
62
63
|
}, [h]);
|
|
63
|
-
const T = b((
|
|
64
|
+
const T = b((x) => {
|
|
64
65
|
const {
|
|
65
66
|
value: j
|
|
66
|
-
} =
|
|
67
|
-
N(j), l == null || l(j,
|
|
67
|
+
} = x.target;
|
|
68
|
+
N(j), l == null || l(j, x);
|
|
68
69
|
}, [l]);
|
|
69
70
|
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":
|
|
71
|
+
/* @__PURE__ */ e.jsx("select", { ...p, value: E, "aria-invalid": c, "data-warning": f, "aria-describedby": S, className: i(w, "kakadu-components-4228384787", n), onChange: T, children: s.map((x) => /* @__PURE__ */ e.jsx("option", { value: x.value, children: x.label }, x.value)) }),
|
|
71
72
|
/* @__PURE__ */ e.jsx(ke, { width: 14, height: 14, className: "kakadu-components-158931186" })
|
|
72
73
|
] });
|
|
73
74
|
}
|
|
74
75
|
const Ce = 40, $ = "kakadu-components-4233741488";
|
|
75
|
-
function
|
|
76
|
+
function De({
|
|
76
77
|
type: m,
|
|
77
78
|
label: s,
|
|
78
79
|
error: d,
|
|
@@ -85,41 +86,41 @@ function ze({
|
|
|
85
86
|
isMultiline: y,
|
|
86
87
|
onChange: u,
|
|
87
88
|
className: c,
|
|
88
|
-
...
|
|
89
|
+
...f
|
|
89
90
|
}) {
|
|
90
|
-
const S = P(null), h = P(null), g = P(null), N = be(), E = X(), T = `${E}-error`,
|
|
91
|
+
const S = P(null), h = P(null), g = P(null), N = be(), E = X(), T = `${E}-error`, x = `${E}-warning`, {
|
|
91
92
|
value: j,
|
|
92
93
|
disabled: ne
|
|
93
|
-
} =
|
|
94
|
+
} = f, [te, A] = I(""), r = j ?? te, [ae, se] = I(), oe = m === "textarea" || !!y;
|
|
94
95
|
pe(() => {
|
|
95
96
|
typeof r == "string" && g.current && se(g.current.scrollHeight);
|
|
96
97
|
}, [r]);
|
|
97
98
|
const L = R(() => typeof r == "string" ? `${r} `.split(`
|
|
98
|
-
`) : [], [r]), le = R(() => L.length, [L]), C = !!d, H = !C && !!o, F = C ? T : H ?
|
|
99
|
+
`) : [], [r]), le = R(() => L.length, [L]), C = !!d, H = !C && !!o, F = C ? T : H ? x : void 0;
|
|
99
100
|
Y(() => {
|
|
100
101
|
A(typeof j == "string" ? j : "");
|
|
101
102
|
}, [j]);
|
|
102
|
-
const W = b((
|
|
103
|
+
const W = b((t) => {
|
|
103
104
|
const {
|
|
104
|
-
value:
|
|
105
|
-
} =
|
|
106
|
-
A(
|
|
105
|
+
value: a
|
|
106
|
+
} = t.target;
|
|
107
|
+
A(a), u == null || u(a, t);
|
|
107
108
|
}, [u]), ce = b(() => {
|
|
108
109
|
typeof r == "string" && (q(r), N({
|
|
109
110
|
type: ve.success,
|
|
110
111
|
children: "Copied to clipboard."
|
|
111
112
|
}));
|
|
112
|
-
}, [r, N]), B = b((
|
|
113
|
+
}, [r, N]), B = b((t) => {
|
|
113
114
|
var z;
|
|
114
|
-
const
|
|
115
|
-
if (
|
|
116
|
-
const D = (z = Object.getOwnPropertyDescriptor(
|
|
115
|
+
const a = h.current ?? S.current ?? void 0;
|
|
116
|
+
if (a) {
|
|
117
|
+
const D = (z = Object.getOwnPropertyDescriptor(a instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLInputElement.prototype, "value")) == null ? void 0 : z.set;
|
|
117
118
|
if (D) {
|
|
118
|
-
D.call(
|
|
119
|
+
D.call(a, t);
|
|
119
120
|
const me = new Event("input", {
|
|
120
121
|
bubbles: !0
|
|
121
122
|
});
|
|
122
|
-
|
|
123
|
+
a.dispatchEvent(me), a.focus();
|
|
123
124
|
return;
|
|
124
125
|
}
|
|
125
126
|
}
|
|
@@ -148,35 +149,35 @@ function ze({
|
|
|
148
149
|
/* @__PURE__ */ e.jsxs("div", { className: "kakadu-components-3146929190", children: [
|
|
149
150
|
oe ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
150
151
|
/* @__PURE__ */ e.jsxs("span", { ref: g, "aria-hidden": !0, className: i(w, c, "kakadu-components-2033521835"), children: [
|
|
151
|
-
L.map((
|
|
152
|
+
L.map((t, a) => (
|
|
152
153
|
// eslint-disable-next-line react/no-array-index-key
|
|
153
154
|
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
154
|
-
|
|
155
|
+
t,
|
|
155
156
|
le > 1 ? /* @__PURE__ */ e.jsx("br", {}) : null
|
|
156
|
-
] },
|
|
157
|
+
] }, a)
|
|
157
158
|
)),
|
|
158
159
|
" "
|
|
159
160
|
] }),
|
|
160
|
-
/* @__PURE__ */ e.jsx("textarea", { ...
|
|
161
|
-
minHeight:
|
|
161
|
+
/* @__PURE__ */ e.jsx("textarea", { ...f, ref: h, rows: 1, "aria-invalid": C, "data-warning": H, "aria-describedby": F, value: r, className: i(w, c, "kakadu-components-2119524139"), style: {
|
|
162
|
+
minHeight: ae
|
|
162
163
|
}, onChange: W })
|
|
163
|
-
] }) : /* @__PURE__ */ e.jsx("input", { ...
|
|
164
|
+
] }) : /* @__PURE__ */ e.jsx("input", { ...f, ref: S, type: m ?? "text", value: r, "aria-invalid": C, "data-warning": H, "aria-describedby": F, className: i(w, c), onChange: W }),
|
|
164
165
|
ne ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
165
166
|
/* @__PURE__ */ e.jsx(K, { className: "kakadu-components-616311160" }),
|
|
166
167
|
/* @__PURE__ */ e.jsx(Q, { className: "kakadu-components-1962999040" })
|
|
167
168
|
] })
|
|
168
169
|
] }),
|
|
169
170
|
p || k || U > 0 ? /* @__PURE__ */ e.jsxs("div", { className: "kakadu-components-131986363", children: [
|
|
170
|
-
l.map((
|
|
171
|
+
l.map((t, a) => /* @__PURE__ */ e.jsx(
|
|
171
172
|
V,
|
|
172
173
|
{
|
|
173
|
-
iconLeft:
|
|
174
|
-
label:
|
|
175
|
-
tooltip:
|
|
174
|
+
iconLeft: t.icon,
|
|
175
|
+
label: t.label,
|
|
176
|
+
tooltip: t.label,
|
|
176
177
|
className: $,
|
|
177
|
-
onClick:
|
|
178
|
+
onClick: t.onClick
|
|
178
179
|
},
|
|
179
|
-
|
|
180
|
+
t.label + a
|
|
180
181
|
)),
|
|
181
182
|
p ? /* @__PURE__ */ e.jsx(V, { iconLeft: G.copy, label: "Copy", tooltip: "Copy", className: $, onClick: ce }) : null,
|
|
182
183
|
k ? /* @__PURE__ */ e.jsx(V, { iconLeft: G.times, label: "Clear", tooltip: "Clear", className: $, onClick: re }) : null
|
|
@@ -184,7 +185,7 @@ function ze({
|
|
|
184
185
|
] });
|
|
185
186
|
}
|
|
186
187
|
export {
|
|
187
|
-
|
|
188
|
-
|
|
188
|
+
ze as Select,
|
|
189
|
+
De as default,
|
|
189
190
|
Ne as errorParagraph
|
|
190
191
|
};
|
|
@@ -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("../icons/icon.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 {
|
|
5
|
+
import { IconType as Le } from "../icons/icon.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
|
|
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"),c=require("../icons/icon.js"),x=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:t,...d}){const i=s==="success",m=s==="warning",k=s==="danger",n=!!a,l=!!t;return e.jsxRuntimeExports.jsxs("aside",{...d,className:o.cx("kakadu-components-925362255",n&&"kakadu-components-2945174293",i&&(n?"kakadu-components-2585123369":"kakadu-components-1387450724"),m&&(n?"kakadu-components-3502407303":"kakadu-components-1612824642"),k&&(n?"kakadu-components-314765189":"kakadu-components-4209515987"),u),children:[e.jsxRuntimeExports.jsx("div",{"data-theme":"dark",className:o.cx("kakadu-components-3327291559",n&&"kakadu-components-3906762683"),children:a&&e.jsxRuntimeExports.jsx(c.default,{width:14,height:14,type:a,className:c.iconShadowStyles})}),e.jsxRuntimeExports.jsx(x.Span,{className:"kakadu-components-1969958615",children:l?t:e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:" "})})]})}exports.NoticeType=r;exports.default=p;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as n } from "../jsx-runtime-B4hRZ52C.mjs";
|
|
2
2
|
import { cx as t } from "@kuma-ui/core";
|
|
3
|
-
import
|
|
3
|
+
import i, { iconShadowStyles as l } from "../icons/icon.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({
|
|
@@ -10,10 +10,10 @@ function w({
|
|
|
10
10
|
children: e,
|
|
11
11
|
...r
|
|
12
12
|
}) {
|
|
13
|
-
const d = a === "success", m = a === "warning", k = a === "danger",
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */
|
|
16
|
-
/* @__PURE__ */
|
|
13
|
+
const d = a === "success", m = a === "warning", k = a === "danger", s = !!o, u = !!e;
|
|
14
|
+
return /* @__PURE__ */ n.jsxs("aside", { ...r, className: t("kakadu-components-925362255", s && "kakadu-components-2945174293", d && (s ? "kakadu-components-2585123369" : "kakadu-components-1387450724"), m && (s ? "kakadu-components-3502407303" : "kakadu-components-1612824642"), k && (s ? "kakadu-components-314765189" : "kakadu-components-4209515987"), c), children: [
|
|
15
|
+
/* @__PURE__ */ n.jsx("div", { "data-theme": "dark", className: t("kakadu-components-3327291559", s && "kakadu-components-3906762683"), children: o && /* @__PURE__ */ n.jsx(i, { width: 14, height: 14, type: o, className: l }) }),
|
|
16
|
+
/* @__PURE__ */ n.jsx(p, { className: "kakadu-components-1969958615", children: u ? e : /* @__PURE__ */ n.jsx(n.Fragment, { children: " " }) })
|
|
17
17
|
] });
|
|
18
18
|
}
|
|
19
19
|
export {
|
|
@@ -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("../icons/icon.js"),l=require("./flex.js"),R=require("./text.js"),q=require("./click-ripples.js"),m=require("./hover-gradient.js"),_=require("./button-tooltip.js"),v=require("./aria-text.js"),B=require("./atom.js");var p=(t=>(t.primary="primary",t.delete="delete",t))(p||{});const f="kakadu-components-4017654514";function N({iconLeft:t,iconRight:n,variant:i="primary",tooltip:u,tooltipPosition:c,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",i==="delete"&&f,k),children:[e.jsxRuntimeExports.jsxs(l.default,{direction:"row",gap:.5,alignment:l.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.default,{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.default,{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(m.default,{size:s?void 0:50,className:m.normalBlendStyles})]}),u?e.jsxRuntimeExports.jsx(_.default,{label:u,position:c}):null]})]})}exports.TextButtonVariant=p;exports.default=N;
|
|
@@ -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
|
|
4
|
-
import
|
|
5
|
-
import { textShadowStyles as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
var
|
|
12
|
-
const
|
|
13
|
-
function
|
|
3
|
+
import p from "../icons/icon.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
|
};
|