@kakadu/components 3.11.1 → 3.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,7 @@ import { type IconType } from '../icons/icon';
3
3
  export declare enum NoticeType {
4
4
  default = "default",
5
5
  success = "success",
6
+ information = "information",
6
7
  warning = "warning",
7
8
  danger = "danger"
8
9
  }
@@ -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"),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
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../jsx-runtime-BB_1_6y_.js"),t=require("@kuma-ui/core"),c=require("../icons/icon.js"),p=require("./text.js");var r=(n=>(n.default="default",n.success="success",n.information="information",n.warning="warning",n.danger="danger",n))(r||{});function j({type:n="default",icon:a,className:u,children:o,...i}){const d=n==="success",m=n==="information",k=n==="warning",l=n==="danger",s=!!a,x=!!o;return e.jsxRuntimeExports.jsxs("aside",{...i,className:t.cx("kakadu-components-925362255",s&&"kakadu-components-2945174293",d&&(s?"kakadu-components-2585123369":"kakadu-components-1387450724"),m&&(s?"kakadu-components-3663522234":"kakadu-components-728842914"),k&&(s?"kakadu-components-3502407303":"kakadu-components-1612824642"),l&&(s?"kakadu-components-314765189":"kakadu-components-4209515987"),u),children:[e.jsxRuntimeExports.jsx("div",{"data-theme":"dark",className:t.cx("kakadu-components-3327291559",s&&"kakadu-components-3906762683"),children:a&&e.jsxRuntimeExports.jsx(c.default,{width:14,height:14,type:a,className:c.iconShadowStyles})}),e.jsxRuntimeExports.jsx(p.Span,{className:"kakadu-components-1969958615",children:x?o:e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:" "})})]})}exports.NoticeType=r;exports.default=j;
@@ -1,22 +1,22 @@
1
- import { j as n } from "../jsx-runtime-B4hRZ52C.mjs";
2
- import { cx as t } from "@kuma-ui/core";
3
- import i, { iconShadowStyles as l } from "../icons/icon.mjs";
4
- import { Span as p } from "./text.mjs";
5
- var h = /* @__PURE__ */ ((a) => (a.default = "default", a.success = "success", a.warning = "warning", a.danger = "danger", a))(h || {});
6
- function w({
7
- type: a = "default",
1
+ import { j as s } from "../jsx-runtime-B4hRZ52C.mjs";
2
+ import { cx as e } from "@kuma-ui/core";
3
+ import l, { iconShadowStyles as p } from "../icons/icon.mjs";
4
+ import { Span as f } from "./text.mjs";
5
+ var h = /* @__PURE__ */ ((n) => (n.default = "default", n.success = "success", n.information = "information", n.warning = "warning", n.danger = "danger", n))(h || {});
6
+ function S({
7
+ type: n = "default",
8
8
  icon: o,
9
- className: c,
10
- children: e,
11
- ...r
9
+ className: r,
10
+ children: t,
11
+ ...c
12
12
  }) {
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: " " }) })
13
+ const m = n === "success", d = n === "information", k = n === "warning", i = n === "danger", a = !!o, u = !!t;
14
+ return /* @__PURE__ */ s.jsxs("aside", { ...c, className: e("kakadu-components-925362255", a && "kakadu-components-2945174293", m && (a ? "kakadu-components-2585123369" : "kakadu-components-1387450724"), d && (a ? "kakadu-components-3663522234" : "kakadu-components-728842914"), k && (a ? "kakadu-components-3502407303" : "kakadu-components-1612824642"), i && (a ? "kakadu-components-314765189" : "kakadu-components-4209515987"), r), children: [
15
+ /* @__PURE__ */ s.jsx("div", { "data-theme": "dark", className: e("kakadu-components-3327291559", a && "kakadu-components-3906762683"), children: o && /* @__PURE__ */ s.jsx(l, { width: 14, height: 14, type: o, className: p }) }),
16
+ /* @__PURE__ */ s.jsx(f, { className: "kakadu-components-1969958615", children: u ? t : /* @__PURE__ */ s.jsx(s.Fragment, { children: " " }) })
17
17
  ] });
18
18
  }
19
19
  export {
20
20
  h as NoticeType,
21
- w as default
21
+ S as default
22
22
  };
@@ -1,6 +1,7 @@
1
1
  import { type MouseEvent, type ReactNode, type Ref } from 'react';
2
2
  import { type IconType } from '../icons/icon';
3
3
  import { type DecoratorType } from './decorators';
4
+ export declare const dangerPopoverMenuItemStyles: string;
4
5
  type PopoverMenuItemElementType = HTMLButtonElement | HTMLAnchorElement;
5
6
  export type PopoverMenuItemProperties = {
6
7
  type: 'separator';
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../jsx-runtime-BB_1_6y_.js"),I=require("@kuma-ui/core"),a=require("react"),N=require("../theme.js"),b=require("../icons/icon.js"),j=require("./popover.js"),S=require("./atom.js"),w=require("./text.js"),y=require("./hover-gradient.js"),_=require("./click-ripples.js"),C=require("./separator.js"),K=require("./decorators.js"),k=new Set;function M(){const[e,n]=a.useState(!1),u=a.useCallback(s=>{n(s);for(const o of k)o(s)},[]);return a.useEffect(()=>{const s=o=>{n(o)};return k.add(s),()=>{k.delete(s)}},[]),a.useMemo(()=>({isKeyboardNavigating:e,setIsKeyboardNavigating:u}),[e,u])}function F({label:e,iconLeft:n,iconRight:u,href:s,shouldCloseOnClick:o=!0,decorators:v=[],submenu:m,className:i,onClick:r,...f}){const{isVisible:d,isPreparingFocus:l,isFocused:c,close:x}=j.usePopoverContext(),{isKeyboardNavigating:p}=M(),E=a.useRef(!0),R=a.useCallback(()=>{E.current=c},[c]),g=a.useCallback(q=>{!p&&!E.current||c&&(r==null||r(q),m?m.show():o&&(x==null||x()))},[p,c,r,m,o,x]),h=a.useMemo(()=>t.jsxRuntimeExports.jsxs(S.default,{as:s?"a":"button",...f,type:s?void 0:"button",role:"menuitem",href:s,inert:!d&&!l,disabled:s?void 0:!d&&!l,className:I.cx(N.buttonResetStyles,"kakadu-components-1567150544",c&&"kakadu-components-3160069815",p?"kakadu-components-2254977234":c&&"kakadu-components-278139688",i),onClick:g,onPointerDownCapture:R,children:[t.jsxRuntimeExports.jsxs(w.Span,{className:"kakadu-components-1109353535",children:[n?t.jsxRuntimeExports.jsx(b.default,{width:12,height:12,type:n}):null,t.jsxRuntimeExports.jsx("span",{className:"kakadu-components-913703148",children:e}),u?t.jsxRuntimeExports.jsx(b.default,{width:12,height:12,type:u}):null]}),p?null:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(_.default,{isActive:c,size:100}),t.jsxRuntimeExports.jsx(y.default,{isActive:c,size:150,className:y.normalBlendStyles})]})]}),[s,f,d,l,p,i,g,R,n,e,u,c]);return t.jsxRuntimeExports.jsx(K.default,{decorators:v,children:m?t.jsxRuntimeExports.jsx(P,{menu:m.popoverMenu,className:"kakadu-components-1861176543",children:h}):h})}function A(e){if("type"in e){if(e.type==="separator")return t.jsxRuntimeExports.jsx(C.default,{});if(e.type==="group")return t.jsxRuntimeExports.jsx(w.Span,{className:"kakadu-components-1499037363",children:e.label})}return t.jsxRuntimeExports.jsx(F,{...e})}function D({items:e}){const{isFocused:n}=j.usePopoverContext(),[u,s]=a.useState([]),{setIsKeyboardNavigating:o}=M(),v=a.useCallback(i=>{i&&s(r=>r.includes(i)?r:[...r,i])},[]),m=a.useCallback(i=>{n&&(i.currentTarget.focus(),o(!1))},[n,o]);return a.useEffect(()=>{if(!n)return;const i=r=>{const f=u.filter(p=>p.isConnected),d=f.length;if(d===0)return;let l;const c=document.activeElement;let x=c?f.indexOf(c):-1;switch(x===-1&&(x=0),r.key){case"ArrowDown":{l=(x+1)%d;break}case"ArrowUp":{l=(x-1+d)%d;break}case"Home":{l=0;break}case"End":{l=d-1;break}case"Tab":{o(!0);return}}if(l!==void 0){r.preventDefault(),r.stopPropagation();const p=f[l];p&&(p.focus(),o(!0))}};return window.addEventListener("keydown",i,{capture:!0}),()=>{window.removeEventListener("keydown",i,{capture:!0})}},[n,u,o]),t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:e.map((i,r)=>t.jsxRuntimeExports.jsx(A,{...i,reference:v,onMouseEnter:m},r))})}function T({items:e,...n}){return t.jsxRuntimeExports.jsx(j.default,{...n,as:"nav",role:"menu",innerClassName:"kakadu-components-3600436535",children:t.jsxRuntimeExports.jsx(D,{items:e})})}function z(e){const n=a.useMemo(()=>({items:e}),[e]),{show:u,close:s,popover:o}=j.usePopover(T,n);return a.useMemo(()=>({show:u,close:s,popoverMenu:o}),[u,s,o])}function P({menu:e,className:n,children:u}){return t.jsxRuntimeExports.jsxs(j.PopoverContainer,{className:n,children:[u,e]})}exports.default=P;exports.usePopoverMenu=z;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../jsx-runtime-BB_1_6y_.js"),q=require("@kuma-ui/core"),a=require("react"),N=require("../theme.js"),y=require("../icons/icon.js"),j=require("./popover.js"),S=require("./atom.js"),w=require("./text.js"),b=require("./hover-gradient.js"),_=require("./click-ripples.js"),C=require("./separator.js"),K=require("./decorators.js"),k=new Set;function M(){const[e,n]=a.useState(!1),u=a.useCallback(s=>{n(s);for(const o of k)o(s)},[]);return a.useEffect(()=>{const s=o=>{n(o)};return k.add(s),()=>{k.delete(s)}},[]),a.useMemo(()=>({isKeyboardNavigating:e,setIsKeyboardNavigating:u}),[e,u])}const F="kakadu-components-3931722929";function A({label:e,iconLeft:n,iconRight:u,href:s,shouldCloseOnClick:o=!0,decorators:v=[],submenu:m,className:i,onClick:r,...f}){const{isVisible:d,isPreparingFocus:l,isFocused:c,close:x}=j.usePopoverContext(),{isKeyboardNavigating:p}=M(),E=a.useRef(!0),g=a.useCallback(()=>{E.current=c},[c]),R=a.useCallback(I=>{!p&&!E.current||c&&(r==null||r(I),m?m.show():o&&(x==null||x()))},[p,c,r,m,o,x]),h=a.useMemo(()=>t.jsxRuntimeExports.jsxs(S.default,{as:s?"a":"button",...f,type:s?void 0:"button",role:"menuitem",href:s,inert:!d&&!l,disabled:s?void 0:!d&&!l,className:q.cx(N.buttonResetStyles,"kakadu-components-1567150544",c&&"kakadu-components-3160069815",p?"kakadu-components-2254977234":c&&"kakadu-components-278139688",i),onClick:R,onPointerDownCapture:g,children:[t.jsxRuntimeExports.jsxs(w.Span,{className:"kakadu-components-1109353535",children:[n?t.jsxRuntimeExports.jsx(y.default,{width:12,height:12,type:n}):null,t.jsxRuntimeExports.jsx("span",{className:"kakadu-components-913703148",children:e}),u?t.jsxRuntimeExports.jsx(y.default,{width:12,height:12,type:u}):null]}),p?null:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(_.default,{isActive:c,size:100}),t.jsxRuntimeExports.jsx(b.default,{isActive:c,size:150,className:b.normalBlendStyles})]})]}),[s,f,d,l,p,i,R,g,n,e,u,c]);return t.jsxRuntimeExports.jsx(K.default,{decorators:v,children:m?t.jsxRuntimeExports.jsx(P,{menu:m.popoverMenu,className:"kakadu-components-1861176543",children:h}):h})}function D(e){if("type"in e){if(e.type==="separator")return t.jsxRuntimeExports.jsx(C.default,{});if(e.type==="group")return t.jsxRuntimeExports.jsx(w.Span,{className:"kakadu-components-1499037363",children:e.label})}return t.jsxRuntimeExports.jsx(A,{...e})}function T({items:e}){const{isFocused:n}=j.usePopoverContext(),[u,s]=a.useState([]),{setIsKeyboardNavigating:o}=M(),v=a.useCallback(i=>{i&&s(r=>r.includes(i)?r:[...r,i])},[]),m=a.useCallback(i=>{n&&(i.currentTarget.focus(),o(!1))},[n,o]);return a.useEffect(()=>{if(!n)return;const i=r=>{const f=u.filter(p=>p.isConnected),d=f.length;if(d===0)return;let l;const c=document.activeElement;let x=c?f.indexOf(c):-1;switch(x===-1&&(x=0),r.key){case"ArrowDown":{l=(x+1)%d;break}case"ArrowUp":{l=(x-1+d)%d;break}case"Home":{l=0;break}case"End":{l=d-1;break}case"Tab":{o(!0);return}}if(l!==void 0){r.preventDefault(),r.stopPropagation();const p=f[l];p&&(p.focus(),o(!0))}};return window.addEventListener("keydown",i,{capture:!0}),()=>{window.removeEventListener("keydown",i,{capture:!0})}},[n,u,o]),t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:e.map((i,r)=>t.jsxRuntimeExports.jsx(D,{...i,reference:v,onMouseEnter:m},r))})}function z({items:e,...n}){return t.jsxRuntimeExports.jsx(j.default,{...n,as:"nav",role:"menu",innerClassName:"kakadu-components-3600436535",children:t.jsxRuntimeExports.jsx(T,{items:e})})}function H(e){const n=a.useMemo(()=>({items:e}),[e]),{show:u,close:s,popover:o}=j.usePopover(z,n);return a.useMemo(()=>({show:u,close:s,popoverMenu:o}),[u,s,o])}function P({menu:e,className:n,children:u}){return t.jsxRuntimeExports.jsxs(j.PopoverContainer,{className:n,children:[u,e]})}exports.dangerPopoverMenuItemStyles=F;exports.default=P;exports.usePopoverMenu=H;
@@ -1,6 +1,6 @@
1
1
  import { j as n } from "../jsx-runtime-B4hRZ52C.mjs";
2
2
  import { cx as K } from "@kuma-ui/core";
3
- import { useMemo as x, useState as b, useCallback as v, useEffect as I, useRef as A } from "react";
3
+ import { useMemo as x, useState as I, useCallback as v, useEffect as b, useRef as A } from "react";
4
4
  import { buttonResetStyles as C } from "../theme.mjs";
5
5
  import P from "../icons/icon.mjs";
6
6
  import D, { PopoverContainer as F, usePopover as H, usePopoverContext as N } from "./popover.mjs";
@@ -12,12 +12,12 @@ import V from "./separator.mjs";
12
12
  import B from "./decorators.mjs";
13
13
  const g = /* @__PURE__ */ new Set();
14
14
  function E() {
15
- const [e, t] = b(!1), a = v((o) => {
15
+ const [e, t] = I(!1), a = v((o) => {
16
16
  t(o);
17
17
  for (const r of g)
18
18
  r(o);
19
19
  }, []);
20
- return I(() => {
20
+ return b(() => {
21
21
  const o = (r) => {
22
22
  t(r);
23
23
  };
@@ -29,6 +29,7 @@ function E() {
29
29
  setIsKeyboardNavigating: a
30
30
  }), [e, a]);
31
31
  }
32
+ const se = "kakadu-components-3931722929";
32
33
  function G({
33
34
  label: e,
34
35
  iconLeft: t,
@@ -36,7 +37,7 @@ function G({
36
37
  href: o,
37
38
  shouldCloseOnClick: r = !0,
38
39
  decorators: k = [],
39
- submenu: p,
40
+ submenu: l,
40
41
  className: i,
41
42
  onClick: s,
42
43
  ...f
@@ -45,14 +46,14 @@ function G({
45
46
  isVisible: m,
46
47
  isPreparingFocus: u,
47
48
  isFocused: c,
48
- close: l
49
+ close: p
49
50
  } = N(), {
50
51
  isKeyboardNavigating: d
51
52
  } = E(), j = A(!0), h = v(() => {
52
53
  j.current = c;
53
- }, [c]), w = v((S) => {
54
- !d && !j.current || c && (s == null || s(S), p ? p.show() : r && (l == null || l()));
55
- }, [d, c, s, p, r, l]), y = x(() => /* @__PURE__ */ n.jsxs(R, { as: o ? "a" : "button", ...f, type: o ? void 0 : "button", role: "menuitem", href: o, inert: !m && !u, disabled: o ? void 0 : !m && !u, className: K(C, "kakadu-components-1567150544", c && "kakadu-components-3160069815", d ? "kakadu-components-2254977234" : c && "kakadu-components-278139688", i), onClick: w, onPointerDownCapture: h, children: [
54
+ }, [c]), y = v((S) => {
55
+ !d && !j.current || c && (s == null || s(S), l ? l.show() : r && (p == null || p()));
56
+ }, [d, c, s, l, r, p]), w = x(() => /* @__PURE__ */ n.jsxs(R, { as: o ? "a" : "button", ...f, type: o ? void 0 : "button", role: "menuitem", href: o, inert: !m && !u, disabled: o ? void 0 : !m && !u, className: K(C, "kakadu-components-1567150544", c && "kakadu-components-3160069815", d ? "kakadu-components-2254977234" : c && "kakadu-components-278139688", i), onClick: y, onPointerDownCapture: h, children: [
56
57
  /* @__PURE__ */ n.jsxs(M, { className: "kakadu-components-1109353535", children: [
57
58
  t ? /* @__PURE__ */ n.jsx(P, { width: 12, height: 12, type: t }) : null,
58
59
  /* @__PURE__ */ n.jsx("span", { className: "kakadu-components-913703148", children: e }),
@@ -62,8 +63,8 @@ function G({
62
63
  /* @__PURE__ */ n.jsx(T, { isActive: c, size: 100 }),
63
64
  /* @__PURE__ */ n.jsx(z, { isActive: c, size: 150, className: L })
64
65
  ] })
65
- ] }), [o, f, m, u, d, i, w, h, t, e, a, c]);
66
- return /* @__PURE__ */ n.jsx(B, { decorators: k, children: p ? /* @__PURE__ */ n.jsx(O, { menu: p.popoverMenu, className: "kakadu-components-1861176543", children: y }) : y });
66
+ ] }), [o, f, m, u, d, i, y, h, t, e, a, c]);
67
+ return /* @__PURE__ */ n.jsx(B, { decorators: k, children: l ? /* @__PURE__ */ n.jsx(O, { menu: l.popoverMenu, className: "kakadu-components-1861176543", children: w }) : w });
67
68
  }
68
69
  function U(e) {
69
70
  if ("type" in e) {
@@ -79,14 +80,14 @@ function q({
79
80
  }) {
80
81
  const {
81
82
  isFocused: t
82
- } = N(), [a, o] = b([]), {
83
+ } = N(), [a, o] = I([]), {
83
84
  setIsKeyboardNavigating: r
84
85
  } = E(), k = v((i) => {
85
86
  i && o((s) => s.includes(i) ? s : [...s, i]);
86
- }, []), p = v((i) => {
87
+ }, []), l = v((i) => {
87
88
  t && (i.currentTarget.focus(), r(!1));
88
89
  }, [t, r]);
89
- return I(() => {
90
+ return b(() => {
90
91
  if (!t)
91
92
  return;
92
93
  const i = (s) => {
@@ -95,14 +96,14 @@ function q({
95
96
  return;
96
97
  let u;
97
98
  const c = document.activeElement;
98
- let l = c ? f.indexOf(c) : -1;
99
- switch (l === -1 && (l = 0), s.key) {
99
+ let p = c ? f.indexOf(c) : -1;
100
+ switch (p === -1 && (p = 0), s.key) {
100
101
  case "ArrowDown": {
101
- u = (l + 1) % m;
102
+ u = (p + 1) % m;
102
103
  break;
103
104
  }
104
105
  case "ArrowUp": {
105
- u = (l - 1 + m) % m;
106
+ u = (p - 1 + m) % m;
106
107
  break;
107
108
  }
108
109
  case "Home": {
@@ -136,7 +137,7 @@ function q({
136
137
  {
137
138
  ...i,
138
139
  reference: k,
139
- onMouseEnter: p
140
+ onMouseEnter: l
140
141
  },
141
142
  s
142
143
  )) });
@@ -147,7 +148,7 @@ function J({
147
148
  }) {
148
149
  return /* @__PURE__ */ n.jsx(D, { ...t, as: "nav", role: "menu", innerClassName: "kakadu-components-3600436535", children: /* @__PURE__ */ n.jsx(q, { items: e }) });
149
150
  }
150
- function se(e) {
151
+ function ae(e) {
151
152
  const t = x(() => ({
152
153
  items: e
153
154
  }), [e]), {
@@ -172,6 +173,7 @@ function O({
172
173
  ] });
173
174
  }
174
175
  export {
176
+ se as dangerPopoverMenuItemStyles,
175
177
  O as default,
176
- se as usePopoverMenu
178
+ ae as usePopoverMenu
177
179
  };
@@ -1,4 +1,4 @@
1
- import { type HTMLAttributes } from 'react';
1
+ import { type AtomElementType, type AtomProperties } from './atom';
2
2
  export declare function getDeterministicSkeletonWidth(a: number, b: number, { minimum, maximum }: {
3
3
  readonly minimum: number;
4
4
  readonly maximum: number;
@@ -9,8 +9,8 @@ type SkeletonProperties = {
9
9
  readonly height?: string | number;
10
10
  readonly className?: string;
11
11
  readonly isAnimated?: boolean;
12
- } & HTMLAttributes<HTMLDivElement>;
13
- export declare function SkeletonInstance({ label, width, height, className, children, isAnimated, ...parameters }: SkeletonProperties): import("react/jsx-runtime").JSX.Element;
12
+ };
13
+ export declare function SkeletonInstance<Type extends AtomElementType = 'span'>({ as, label, width, height, className, children, isAnimated, ...properties }: SkeletonProperties & AtomProperties<Type>): import("react/jsx-runtime").JSX.Element;
14
14
  export default function Skeleton({ label, lines, isDeterministic, isAnimated, }: {
15
15
  readonly label?: string;
16
16
  readonly lines?: number;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("../jsx-runtime-BB_1_6y_.js"),x=require("react"),l=require("@kuma-ui/core");function c(o,e,{minimum:t,maximum:s}){const a=o*374761393+e*668265263+2147483647,u=Math.imul(a,1274126177),r=s-t+1;return t+Math.abs(u)%r}function i({label:o,width:e,height:t,className:s,children:a,isAnimated:u=!0,...r}){return n.jsxRuntimeExports.jsx("span",{...r,"aria-label":o,className:l.cx("kakadu-components-4254676273",u&&"kakadu-components-574297718",s),style:{width:e,height:t},children:a??n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{children:" "})})}const m="kakadu-components-3140855657";function h({label:o,lines:e=1,isDeterministic:t=!1,isAnimated:s=!0}){const a=x.useMemo(()=>{const u=[];if(e<=1)return u;for(let r=1;r<e;r+=1)u.push(n.jsxRuntimeExports.jsx(i,{"aria-hidden":!0,width:t?`${c(r,e,{minimum:90,maximum:100})}%`:"100%",height:"1em",isAnimated:s,className:m},r));return u},[e,t,s]);return e<1?null:e===1?n.jsxRuntimeExports.jsx(i,{"aria-busy":!0,label:o,width:"100%",height:"1em",isAnimated:s,role:"status",className:m}):n.jsxRuntimeExports.jsxs(n.jsxRuntimeExports.Fragment,{children:[a,n.jsxRuntimeExports.jsx(i,{"aria-busy":!0,label:o,width:t?`${c(e,e,{minimum:50,maximum:60})}%`:"60%",height:"1em",isAnimated:s,role:"status",className:m})]})}exports.SkeletonInstance=i;exports.default=h;exports.getDeterministicSkeletonWidth=c;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("../jsx-runtime-BB_1_6y_.js"),l=require("react"),h=require("@kuma-ui/core"),d=require("./atom.js");function c(o,e,{minimum:t,maximum:s}){const a=o*374761393+e*668265263+2147483647,u=Math.imul(a,1274126177),n=s-t+1;return t+Math.abs(u)%n}function i({as:o,label:e,width:t,height:s,className:a,children:u,isAnimated:n=!0,...x}){return r.jsxRuntimeExports.jsx(d.default,{...x,as:o??"span","aria-label":e,className:h.cx("kakadu-components-4254676273",n&&"kakadu-components-574297718",a),style:{width:t,height:s},children:u??r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:" "})})}const m="kakadu-components-3140855657";function j({label:o,lines:e=1,isDeterministic:t=!1,isAnimated:s=!0}){const a=l.useMemo(()=>{const u=[];if(e<=1)return u;for(let n=1;n<e;n+=1)u.push(r.jsxRuntimeExports.jsx(i,{"aria-hidden":!0,width:t?`${c(n,e,{minimum:90,maximum:100})}%`:"100%",height:"1em",isAnimated:s,className:m},n));return u},[e,t,s]);return e<1?null:e===1?r.jsxRuntimeExports.jsx(i,{"aria-busy":!0,label:o,width:"100%",height:"1em",isAnimated:s,role:"status",className:m}):r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[a,r.jsxRuntimeExports.jsx(i,{"aria-busy":!0,label:o,width:t?`${c(e,e,{minimum:50,maximum:60})}%`:"60%",height:"1em",isAnimated:s,role:"status",className:m})]})}exports.SkeletonInstance=i;exports.default=j;exports.getDeterministicSkeletonWidth=c;
@@ -1,48 +1,50 @@
1
1
  import { j as s } from "../jsx-runtime-B4hRZ52C.mjs";
2
2
  import { useMemo as l } from "react";
3
- import { cx as i } from "@kuma-ui/core";
4
- function h(o, t, {
3
+ import { cx as f } from "@kuma-ui/core";
4
+ import d from "./atom.mjs";
5
+ function h(n, t, {
5
6
  minimum: e,
6
7
  maximum: r
7
8
  }) {
8
- const u = o * 374761393 + t * 668265263 + 2147483647, n = Math.imul(u, 1274126177), a = r - e + 1;
9
- return e + Math.abs(n) % a;
9
+ const u = n * 374761393 + t * 668265263 + 2147483647, o = Math.imul(u, 1274126177), a = r - e + 1;
10
+ return e + Math.abs(o) % a;
10
11
  }
11
12
  function m({
12
- label: o,
13
- width: t,
14
- height: e,
15
- className: r,
16
- children: u,
17
- isAnimated: n = !0,
18
- ...a
13
+ as: n,
14
+ label: t,
15
+ width: e,
16
+ height: r,
17
+ className: u,
18
+ children: o,
19
+ isAnimated: a = !0,
20
+ ...i
19
21
  }) {
20
- return /* @__PURE__ */ s.jsx("span", { ...a, "aria-label": o, className: i("kakadu-components-4254676273", n && "kakadu-components-574297718", r), style: {
21
- width: t,
22
- height: e
23
- }, children: u ?? /* @__PURE__ */ s.jsx(s.Fragment, { children: " " }) });
22
+ return /* @__PURE__ */ s.jsx(d, { ...i, as: n ?? "span", "aria-label": t, className: f("kakadu-components-4254676273", a && "kakadu-components-574297718", u), style: {
23
+ width: e,
24
+ height: r
25
+ }, children: o ?? /* @__PURE__ */ s.jsx(s.Fragment, { children: " " }) });
24
26
  }
25
27
  const c = "kakadu-components-3140855657";
26
- function k({
27
- label: o,
28
+ function g({
29
+ label: n,
28
30
  lines: t = 1,
29
31
  isDeterministic: e = !1,
30
32
  isAnimated: r = !0
31
33
  }) {
32
34
  const u = l(() => {
33
- const n = [];
35
+ const o = [];
34
36
  if (t <= 1)
35
- return n;
37
+ return o;
36
38
  for (let a = 1; a < t; a += 1)
37
- n.push(/* @__PURE__ */ s.jsx(m, { "aria-hidden": !0, width: e ? `${h(a, t, {
39
+ o.push(/* @__PURE__ */ s.jsx(m, { "aria-hidden": !0, width: e ? `${h(a, t, {
38
40
  minimum: 90,
39
41
  maximum: 100
40
42
  })}%` : "100%", height: "1em", isAnimated: r, className: c }, a));
41
- return n;
43
+ return o;
42
44
  }, [t, e, r]);
43
- return t < 1 ? null : t === 1 ? /* @__PURE__ */ s.jsx(m, { "aria-busy": !0, label: o, width: "100%", height: "1em", isAnimated: r, role: "status", className: c }) : /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
45
+ return t < 1 ? null : t === 1 ? /* @__PURE__ */ s.jsx(m, { "aria-busy": !0, label: n, width: "100%", height: "1em", isAnimated: r, role: "status", className: c }) : /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
44
46
  u,
45
- /* @__PURE__ */ s.jsx(m, { "aria-busy": !0, label: o, width: e ? `${h(t, t, {
47
+ /* @__PURE__ */ s.jsx(m, { "aria-busy": !0, label: n, width: e ? `${h(t, t, {
46
48
  minimum: 50,
47
49
  maximum: 60
48
50
  })}%` : "60%", height: "1em", isAnimated: r, role: "status", className: c })
@@ -50,6 +52,6 @@ function k({
50
52
  }
51
53
  export {
52
54
  m as SkeletonInstance,
53
- k as default,
55
+ g as default,
54
56
  h as getDeterministicSkeletonWidth
55
57
  };