@kakadu/components 3.2.6 → 3.4.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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("../jsx-runtime-BB_1_6y_.js"),u=require("@kuma-ui/core");var a=(t=>(t.top="top",t.bottom="bottom",t))(a||{});function s({id:t,label:r,position:o="top",className:e}){return n.jsxRuntimeExports.jsx("div",{id:t,role:"tooltip",className:u.cx("kakadu-components-982005200",o==="top"&&"kakadu-components-430823771",o==="bottom"&&"kakadu-components-2189175034",e),children:n.jsxRuntimeExports.jsx("span",{className:u.cx("kakadu-components-2032235075",o==="top"&&"kakadu-components-2481216458",o==="bottom"&&"kakadu-components-637471806",e),children:r})})}exports.ButtonTooltipPosition=a;exports.default=s;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("../jsx-runtime-BB_1_6y_.js"),u=require("@kuma-ui/core");var a=(t=>(t.top="top",t.bottom="bottom",t))(a||{});function s({id:t,label:r,position:o="top",className:e}){return n.jsxRuntimeExports.jsx("div",{id:t,role:"tooltip",className:u.cx("kakadu-components-982005200",o==="top"&&"kakadu-components-430823771",o==="bottom"&&"kakadu-components-2189175034",e),children:n.jsxRuntimeExports.jsx("span",{className:u.cx("kakadu-components-3316581213",o==="top"&&"kakadu-components-2481216458",o==="bottom"&&"kakadu-components-637471806",e),children:r})})}exports.ButtonTooltipPosition=a;exports.default=s;
@@ -7,7 +7,7 @@ function c({
7
7
  position: t = "top",
8
8
  className: a
9
9
  }) {
10
- return /* @__PURE__ */ m.jsx("div", { id: o, role: "tooltip", className: n("kakadu-components-982005200", t === "top" && "kakadu-components-430823771", t === "bottom" && "kakadu-components-2189175034", a), children: /* @__PURE__ */ m.jsx("span", { className: n("kakadu-components-2032235075", t === "top" && "kakadu-components-2481216458", t === "bottom" && "kakadu-components-637471806", a), children: e }) });
10
+ return /* @__PURE__ */ m.jsx("div", { id: o, role: "tooltip", className: n("kakadu-components-982005200", t === "top" && "kakadu-components-430823771", t === "bottom" && "kakadu-components-2189175034", a), children: /* @__PURE__ */ m.jsx("span", { className: n("kakadu-components-3316581213", t === "top" && "kakadu-components-2481216458", t === "bottom" && "kakadu-components-637471806", a), children: e }) });
11
11
  }
12
12
  export {
13
13
  p as ButtonTooltipPosition,
@@ -1,2 +1,4 @@
1
1
  import { type HTMLProps } from 'react';
2
- export default function ClickRipples({ size, className, ...properties }: HTMLProps<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
2
+ export default function ClickRipples({ isActive, size, className, ...properties }: HTMLProps<HTMLDivElement> & {
3
+ readonly isActive?: boolean;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("../jsx-runtime-BB_1_6y_.js"),n=require("react"),k=require("@kuma-ui/core");function v({id:s,x:r,y:i,onEnd:t}){return n.useEffect(()=>{const o=setTimeout(()=>{t(s)},370);return()=>{clearTimeout(o)}},[t,s]),a.jsxRuntimeExports.jsx("div",{style:{top:i,left:r},className:"kakadu-components-3828473824"})}function w({size:s=150,className:r,...i}){const t=n.useRef(null),[o,f]=n.useState([]);n.useEffect(()=>{const e=u=>{if(t.current){const c=t.current.getBoundingClientRect(),{clientX:l,clientY:d}=u,{left:m,right:j,top:x,bottom:E}=c;l>m&&l<j&&d>x&&d<E&&f(R=>[...R,{id:Date.now()+Math.random()*1e3,x:l-m,y:d-x}])}};return window.addEventListener("pointerdown",e),()=>{window.removeEventListener("pointerdown",e)}},[]);const p=n.useCallback(e=>{f(u=>u.filter(c=>c.id!==e))},[]);return a.jsxRuntimeExports.jsx("div",{...i,ref:t,style:{"--size":`${s}px`},className:k.cx("kakadu-components-4189236582",r),children:o.map(e=>a.jsxRuntimeExports.jsx(v,{id:e.id,x:e.x,y:e.y,onEnd:p},e.id))})}exports.default=w;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("../jsx-runtime-BB_1_6y_.js"),r=require("react"),w=require("@kuma-ui/core");function v({id:t,x:o,y:i,onEnd:s}){return r.useEffect(()=>{const n=setTimeout(()=>{s(t)},370);return()=>{clearTimeout(n)}},[s,t]),a.jsxRuntimeExports.jsx("div",{style:{top:i,left:o},className:"kakadu-components-3828473824"})}function y({isActive:t=!0,size:o=150,className:i,...s}){const n=r.useRef(null),[p,f]=r.useState([]);r.useEffect(()=>{if(!t)return;const e=u=>{if(n.current){const c=n.current.getBoundingClientRect(),{clientX:l,clientY:d}=u,{left:m,right:E,top:x,bottom:R}=c;l>m&&l<E&&d>x&&d<R&&f(k=>[...k,{id:Date.now()+Math.random()*1e3,x:l-m,y:d-x}])}};return window.addEventListener("pointerdown",e),()=>{window.removeEventListener("pointerdown",e)}},[t]);const j=r.useCallback(e=>{f(u=>u.filter(c=>c.id!==e))},[]);return a.jsxRuntimeExports.jsx("div",{...s,ref:n,style:{"--size":`${o}px`},className:w.cx("kakadu-components-4189236582",i),children:p.map(e=>a.jsxRuntimeExports.jsx(v,{id:e.id,x:e.x,y:e.y,onEnd:j},e.id))})}exports.default=y;
@@ -1,60 +1,63 @@
1
1
  import { j as a } from "../jsx-runtime-B4hRZ52C.mjs";
2
- import { useRef as v, useState as y, useEffect as p, useCallback as E } from "react";
3
- import { cx as R } from "@kuma-ui/core";
4
- function h({
5
- id: n,
6
- x: o,
2
+ import { useRef as E, useState as R, useEffect as p, useCallback as h } from "react";
3
+ import { cx as v } from "@kuma-ui/core";
4
+ function C({
5
+ id: t,
6
+ x: r,
7
7
  y: s,
8
- onEnd: t
8
+ onEnd: o
9
9
  }) {
10
10
  return p(() => {
11
- const i = setTimeout(() => {
12
- t(n);
11
+ const n = setTimeout(() => {
12
+ o(t);
13
13
  }, 370);
14
14
  return () => {
15
- clearTimeout(i);
15
+ clearTimeout(n);
16
16
  };
17
- }, [t, n]), /* @__PURE__ */ a.jsx("div", { style: {
17
+ }, [o, t]), /* @__PURE__ */ a.jsx("div", { style: {
18
18
  top: s,
19
- left: o
19
+ left: r
20
20
  }, className: "kakadu-components-3828473824" });
21
21
  }
22
- function L({
23
- size: n = 150,
24
- className: o,
25
- ...s
22
+ function N({
23
+ isActive: t = !0,
24
+ size: r = 150,
25
+ className: s,
26
+ ...o
26
27
  }) {
27
- const t = v(null), [i, d] = y([]);
28
+ const n = E(null), [x, d] = R([]);
28
29
  p(() => {
29
- const e = (r) => {
30
- if (t.current) {
31
- const c = t.current.getBoundingClientRect(), {
32
- clientX: l,
33
- clientY: u
34
- } = r, {
30
+ if (!t)
31
+ return;
32
+ const e = (i) => {
33
+ if (n.current) {
34
+ const c = n.current.getBoundingClientRect(), {
35
+ clientX: u,
36
+ clientY: l
37
+ } = i, {
35
38
  left: m,
36
- right: k,
39
+ right: w,
37
40
  top: f,
38
- bottom: w
41
+ bottom: j
39
42
  } = c;
40
- l > m && l < k && u > f && u < w && d((j) => [...j, {
43
+ u > m && u < w && l > f && l < j && d((y) => [...y, {
41
44
  id: Date.now() + Math.random() * 1e3,
42
- x: l - m,
43
- y: u - f
45
+ x: u - m,
46
+ y: l - f
44
47
  }]);
45
48
  }
46
49
  };
47
50
  return window.addEventListener("pointerdown", e), () => {
48
51
  window.removeEventListener("pointerdown", e);
49
52
  };
53
+ }, [t]);
54
+ const k = h((e) => {
55
+ d((i) => i.filter((c) => c.id !== e));
50
56
  }, []);
51
- const x = E((e) => {
52
- d((r) => r.filter((c) => c.id !== e));
53
- }, []);
54
- return /* @__PURE__ */ a.jsx("div", { ...s, ref: t, style: {
55
- "--size": `${n}px`
56
- }, className: R("kakadu-components-4189236582", o), children: i.map((e) => /* @__PURE__ */ a.jsx(h, { id: e.id, x: e.x, y: e.y, onEnd: x }, e.id)) });
57
+ return /* @__PURE__ */ a.jsx("div", { ...o, ref: n, style: {
58
+ "--size": `${r}px`
59
+ }, className: v("kakadu-components-4189236582", s), children: x.map((e) => /* @__PURE__ */ a.jsx(C, { id: e.id, x: e.x, y: e.y, onEnd: k }, e.id)) });
57
60
  }
58
61
  export {
59
- L as default
62
+ N as default
60
63
  };
@@ -1,5 +1,6 @@
1
1
  import { type HTMLProps } from 'react';
2
2
  export declare const normalBlendStyles: string;
3
- export default function HoverGradient({ size, className, ...properties }: HTMLProps<HTMLDivElement> & {
3
+ export default function HoverGradient({ isActive, size, className, ...properties }: HTMLProps<HTMLDivElement> & {
4
+ readonly isActive?: boolean;
4
5
  readonly size?: number;
5
6
  }): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("../jsx-runtime-BB_1_6y_.js"),t=require("react"),p=require("@kuma-ui/core"),R="kakadu-components-2608453841";function $({size:x=200,className:k,...E}){const i=t.useRef(null),n=t.useRef(null),[g,u]=t.useState(!1),[s,b]=t.useState();return t.useEffect(()=>{const c=i.current;if(!c)return;n.current||(n.current=c.parentElement);const e=n.current;if(!e)return;const l=m=>{const j=m.target;if(!e.contains(j))return;const S=e.getBoundingClientRect(),{clientX:o,clientY:r}=m,{left:d,right:y,top:f,bottom:L}=S;o>d&&o<y&&r>f&&r<L&&(u(!0),b([o-d,r-f]))},a=()=>{u(!1)};return e.addEventListener("mousemove",l),e.addEventListener("mouseleave",a),()=>{e.removeEventListener("mousemove",l),e.removeEventListener("mouseleave",a)}},[]),v.jsxRuntimeExports.jsx("div",{...E,ref:i,className:p.cx("kakadu-components-1237006455",k),children:s?v.jsxRuntimeExports.jsx("div",{style:{"--size":`${x}px`,"--offset-x":`${s[0]}px`,"--offset-y":`${s[1]}px`},className:p.cx("kakadu-components-611160091",g&&"kakadu-components-3627966847")}):null})}exports.default=$;exports.normalBlendStyles=R;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("../jsx-runtime-BB_1_6y_.js"),t=require("react"),p=require("@kuma-ui/core"),$="kakadu-components-2608453841";function q({isActive:x=!0,size:k=200,className:E,...g}){const i=t.useRef(null),n=t.useRef(null),[b,s]=t.useState(!1),[o,j]=t.useState();return t.useEffect(()=>{if(!x){s(!1);return}const c=i.current;if(!c)return;n.current||(n.current=c.parentElement);const e=n.current;if(!e)return;const l=m=>{const S=m.target;if(!e.contains(S))return;const y=e.getBoundingClientRect(),{clientX:r,clientY:u}=m,{left:f,right:L,top:d,bottom:R}=y;r>f&&r<L&&u>d&&u<R&&(s(!0),j([r-f,u-d]))},a=()=>{s(!1)};return e.addEventListener("mousemove",l),e.addEventListener("mouseleave",a),()=>{e.removeEventListener("mousemove",l),e.removeEventListener("mouseleave",a)}},[]),v.jsxRuntimeExports.jsx("div",{...g,ref:i,className:p.cx("kakadu-components-1237006455",E),children:o?v.jsxRuntimeExports.jsx("div",{style:{"--size":`${k}px`,"--offset-x":`${o[0]}px`,"--offset-y":`${o[1]}px`},className:p.cx("kakadu-components-611160091",b&&"kakadu-components-3627966847")}):null})}exports.default=q;exports.normalBlendStyles=$;
@@ -1,48 +1,53 @@
1
1
  import { j as d } from "../jsx-runtime-B4hRZ52C.mjs";
2
- import { useRef as p, useState as v, useEffect as B } from "react";
2
+ import { useRef as p, useState as v, useEffect as N } from "react";
3
3
  import { cx as x } from "@kuma-ui/core";
4
- const V = "kakadu-components-2608453841";
5
- function z({
6
- size: k = 200,
7
- className: E,
8
- ...g
4
+ const z = "kakadu-components-2608453841";
5
+ function C({
6
+ isActive: k = !0,
7
+ size: E = 200,
8
+ className: g,
9
+ ...L
9
10
  }) {
10
- const r = p(null), t = p(null), [L, i] = v(!1), [n, b] = v();
11
- return B(() => {
12
- const c = r.current;
13
- if (!c)
11
+ const i = p(null), t = p(null), [b, n] = v(!1), [s, j] = v();
12
+ return N(() => {
13
+ if (!k) {
14
+ n(!1);
14
15
  return;
15
- t.current || (t.current = c.parentElement);
16
+ }
17
+ const a = i.current;
18
+ if (!a)
19
+ return;
20
+ t.current || (t.current = a.parentElement);
16
21
  const e = t.current;
17
22
  if (!e)
18
23
  return;
19
- const a = (u) => {
20
- const j = u.target;
21
- if (!e.contains(j))
24
+ const c = (l) => {
25
+ const y = l.target;
26
+ if (!e.contains(y))
22
27
  return;
23
- const y = e.getBoundingClientRect(), {
24
- clientX: s,
25
- clientY: o
26
- } = u, {
28
+ const $ = e.getBoundingClientRect(), {
29
+ clientX: o,
30
+ clientY: r
31
+ } = l, {
27
32
  left: m,
28
- right: $,
33
+ right: h,
29
34
  top: f,
30
- bottom: h
31
- } = y;
32
- s > m && s < $ && o > f && o < h && (i(!0), b([s - m, o - f]));
33
- }, l = () => {
34
- i(!1);
35
+ bottom: B
36
+ } = $;
37
+ o > m && o < h && r > f && r < B && (n(!0), j([o - m, r - f]));
38
+ }, u = () => {
39
+ n(!1);
35
40
  };
36
- return e.addEventListener("mousemove", a), e.addEventListener("mouseleave", l), () => {
37
- e.removeEventListener("mousemove", a), e.removeEventListener("mouseleave", l);
41
+ return e.addEventListener("mousemove", c), e.addEventListener("mouseleave", u), () => {
42
+ e.removeEventListener("mousemove", c), e.removeEventListener("mouseleave", u);
38
43
  };
39
- }, []), /* @__PURE__ */ d.jsx("div", { ...g, ref: r, className: x("kakadu-components-1237006455", E), children: n ? /* @__PURE__ */ d.jsx("div", { style: {
40
- "--size": `${k}px`,
41
- "--offset-x": `${n[0]}px`,
42
- "--offset-y": `${n[1]}px`
43
- }, className: x("kakadu-components-611160091", L && "kakadu-components-3627966847") }) : null });
44
+ }, []), /* @__PURE__ */ d.jsx("div", { ...L, ref: i, className: x("kakadu-components-1237006455", g), children: s ? /* @__PURE__ */ d.jsx("div", { style: {
45
+ "--size": `${E}px`,
46
+ "--offset-x": `${s[0]}px`,
47
+ "--offset-y": `${s[1]}px`
48
+ }, className: x("kakadu-components-611160091", b && "kakadu-components-3627966847") }) : null });
44
49
  }
45
50
  export {
46
- z as default,
47
- V as normalBlendStyles
51
+ C as default,
52
+ z as normalBlendStyles
48
53
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../jsx-runtime-BB_1_6y_.js"),M=require("@kuma-ui/core"),i=require("react"),q=require("../theme.js"),R=require("../icons/icon.js"),f=require("./popover.js"),P=require("./atom.js"),h=require("./text.js"),g=require("./hover-gradient.js"),I=require("./click-ripples.js"),N=require("./separator.js"),S=require("./decorators.js"),E=new Set;function y(){const[e,n]=i.useState(!1),r=i.useCallback(s=>{n(s);for(const a of E)a(s)},[]);return i.useEffect(()=>{const s=a=>{n(a)};return E.add(s),()=>{E.delete(s)}},[]),i.useMemo(()=>({isKeyboardNavigating:e,setIsKeyboardNavigating:r}),[e,r])}function _({label:e,iconLeft:n,iconRight:r,href:s,shouldCloseOnClick:a=!0,decorators:v=[],submenu:x,className:u,onClick:o,...j}){const{isVisible:l,isFocused:c,close:p}=f.usePopoverContext(),{isKeyboardNavigating:d}=y(),m=i.useCallback(w=>{c&&(o==null||o(w),x?x.show():a&&(p==null||p()))},[c,o,x,a,p]),k=i.useMemo(()=>t.jsxRuntimeExports.jsxs(P.default,{as:s?"a":"button",...j,type:s?void 0:"button",role:"menuitem",href:s,disabled:s?void 0:!l,className:M.cx(q.buttonResetStyles,"kakadu-components-3114599304",d?"kakadu-components-4096376656":"kakadu-components-2554182777",u),onClick:m,children:[t.jsxRuntimeExports.jsxs(h.Span,{className:"kakadu-components-1109353535",children:[n?t.jsxRuntimeExports.jsx(R.default,{width:12,height:12,type:n}):null,t.jsxRuntimeExports.jsx("span",{className:"kakadu-components-913703148",children:e}),r?t.jsxRuntimeExports.jsx(R.default,{width:12,height:12,type:r}):null]}),d?null:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(g.default,{size:150,className:g.normalBlendStyles}),t.jsxRuntimeExports.jsx(I.default,{size:100})]})]}),[s,j,l,d,u,m,n,e,r]);return t.jsxRuntimeExports.jsx(S.default,{decorators:v,children:x?t.jsxRuntimeExports.jsx(b,{menu:x.popoverMenu,className:"kakadu-components-1861176543",children:k}):k})}function K(e){if("type"in e){if(e.type==="separator")return t.jsxRuntimeExports.jsx(N.default,{});if(e.type==="group")return t.jsxRuntimeExports.jsx(h.Span,{className:"kakadu-components-1499037363",children:e.label})}return t.jsxRuntimeExports.jsx(_,{...e})}function C({items:e}){const{isFocused:n}=f.usePopoverContext(),[r,s]=i.useState([]),{setIsKeyboardNavigating:a}=y(),v=i.useCallback(u=>{u&&s(o=>o.includes(u)?o:[...o,u])},[]),x=i.useCallback(u=>{n&&(u.currentTarget.focus(),a(!1))},[n,a]);return i.useEffect(()=>{if(!n)return;const u=o=>{const j=r.filter(m=>m.isConnected),l=j.length;if(l===0)return;let c;const p=document.activeElement;let d=p?j.indexOf(p):-1;switch(d===-1&&(d=0),o.key){case"ArrowDown":{c=(d+1)%l;break}case"ArrowUp":{c=(d-1+l)%l;break}case"Home":{c=0;break}case"End":{c=l-1;break}case"Tab":{a(!0);return}}if(c!==void 0){o.preventDefault(),o.stopPropagation();const m=j[c];m&&(m.focus(),a(!0))}};return window.addEventListener("keydown",u,{capture:!0}),()=>{window.removeEventListener("keydown",u,{capture:!0})}},[n,r,a]),t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:e.map((u,o)=>t.jsxRuntimeExports.jsx(K,{...u,reference:v,onMouseEnter:x},o))})}function F({items:e,...n}){return t.jsxRuntimeExports.jsx(f.default,{...n,as:"nav",role:"menu",innerClassName:"kakadu-components-3600436535",children:t.jsxRuntimeExports.jsx(C,{items:e})})}function T(e){const n=i.useMemo(()=>({items:e}),[e]),{show:r,popover:s}=f.usePopover(F,n);return i.useMemo(()=>({show:r,popoverMenu:s}),[r,s])}function b({menu:e,className:n,children:r}){return t.jsxRuntimeExports.jsxs(f.PopoverContainer,{className:n,children:[r,e]})}exports.default=b;exports.usePopoverMenu=T;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("../jsx-runtime-BB_1_6y_.js"),M=require("@kuma-ui/core"),c=require("react"),q=require("../theme.js"),R=require("../icons/icon.js"),f=require("./popover.js"),P=require("./atom.js"),h=require("./text.js"),g=require("./hover-gradient.js"),I=require("./click-ripples.js"),N=require("./separator.js"),S=require("./decorators.js"),E=new Set;function y(){const[e,n]=c.useState(!1),r=c.useCallback(s=>{n(s);for(const i of E)i(s)},[]);return c.useEffect(()=>{const s=i=>{n(i)};return E.add(s),()=>{E.delete(s)}},[]),c.useMemo(()=>({isKeyboardNavigating:e,setIsKeyboardNavigating:r}),[e,r])}function _({label:e,iconLeft:n,iconRight:r,href:s,shouldCloseOnClick:i=!0,decorators:v=[],submenu:x,className:u,onClick:o,...j}){const{isVisible:l,isFocused:a,close:p}=f.usePopoverContext(),{isKeyboardNavigating:d}=y(),m=c.useCallback(w=>{a&&(o==null||o(w),x?x.show():i&&(p==null||p()))},[a,o,x,i,p]),k=c.useMemo(()=>t.jsxRuntimeExports.jsxs(P.default,{as:s?"a":"button",...j,type:s?void 0:"button",role:"menuitem",href:s,disabled:s?void 0:!l,className:M.cx(q.buttonResetStyles,"kakadu-components-4075327442",a&&"kakadu-components-3160069815",d?"kakadu-components-2043829669":a&&"kakadu-components-2862719809",u),onClick:m,children:[t.jsxRuntimeExports.jsxs(h.Span,{className:"kakadu-components-1109353535",children:[n?t.jsxRuntimeExports.jsx(R.default,{width:12,height:12,type:n}):null,t.jsxRuntimeExports.jsx("span",{className:"kakadu-components-913703148",children:e}),r?t.jsxRuntimeExports.jsx(R.default,{width:12,height:12,type:r}):null]}),d?null:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(I.default,{isActive:a,size:100}),t.jsxRuntimeExports.jsx(g.default,{isActive:a,size:150,className:g.normalBlendStyles})]})]}),[s,j,l,d,u,m,n,e,r]);return t.jsxRuntimeExports.jsx(S.default,{decorators:v,children:x?t.jsxRuntimeExports.jsx(b,{menu:x.popoverMenu,className:"kakadu-components-1861176543",children:k}):k})}function K(e){if("type"in e){if(e.type==="separator")return t.jsxRuntimeExports.jsx(N.default,{});if(e.type==="group")return t.jsxRuntimeExports.jsx(h.Span,{className:"kakadu-components-1499037363",children:e.label})}return t.jsxRuntimeExports.jsx(_,{...e})}function C({items:e}){const{isFocused:n}=f.usePopoverContext(),[r,s]=c.useState([]),{setIsKeyboardNavigating:i}=y(),v=c.useCallback(u=>{u&&s(o=>o.includes(u)?o:[...o,u])},[]),x=c.useCallback(u=>{n&&(u.currentTarget.focus(),i(!1))},[n,i]);return c.useEffect(()=>{if(!n)return;const u=o=>{const j=r.filter(m=>m.isConnected),l=j.length;if(l===0)return;let a;const p=document.activeElement;let d=p?j.indexOf(p):-1;switch(d===-1&&(d=0),o.key){case"ArrowDown":{a=(d+1)%l;break}case"ArrowUp":{a=(d-1+l)%l;break}case"Home":{a=0;break}case"End":{a=l-1;break}case"Tab":{i(!0);return}}if(a!==void 0){o.preventDefault(),o.stopPropagation();const m=j[a];m&&(m.focus(),i(!0))}};return window.addEventListener("keydown",u,{capture:!0}),()=>{window.removeEventListener("keydown",u,{capture:!0})}},[n,r,i]),t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:e.map((u,o)=>t.jsxRuntimeExports.jsx(K,{...u,reference:v,onMouseEnter:x},o))})}function A({items:e,...n}){return t.jsxRuntimeExports.jsx(f.default,{...n,as:"nav",role:"menu",innerClassName:"kakadu-components-3600436535",children:t.jsxRuntimeExports.jsx(C,{items:e})})}function F(e){const n=c.useMemo(()=>({items:e}),[e]),{show:r,popover:s}=f.usePopover(A,n);return c.useMemo(()=>({show:r,popoverMenu:s}),[r,s])}function b({menu:e,className:n,children:r}){return t.jsxRuntimeExports.jsxs(f.PopoverContainer,{className:n,children:[r,e]})}exports.default=b;exports.usePopoverMenu=F;
@@ -3,8 +3,8 @@ import { cx as M } from "@kuma-ui/core";
3
3
  import { useMemo as v, useState as y, useCallback as x, useEffect as w } from "react";
4
4
  import { buttonResetStyles as E } from "../theme.mjs";
5
5
  import h from "../icons/icon.mjs";
6
- import S, { PopoverContainer as K, usePopover as F, usePopoverContext as b } from "./popover.mjs";
7
- import A from "./atom.mjs";
6
+ import S, { PopoverContainer as K, usePopover as A, usePopoverContext as b } from "./popover.mjs";
7
+ import F from "./atom.mjs";
8
8
  import { Span as I } from "./text.mjs";
9
9
  import D, { normalBlendStyles as H } from "./hover-gradient.mjs";
10
10
  import z from "./click-ripples.mjs";
@@ -14,12 +14,12 @@ const j = /* @__PURE__ */ new Set();
14
14
  function N() {
15
15
  const [e, t] = y(!1), s = x((o) => {
16
16
  t(o);
17
- for (const i of j)
18
- i(o);
17
+ for (const c of j)
18
+ c(o);
19
19
  }, []);
20
20
  return w(() => {
21
- const o = (i) => {
22
- t(i);
21
+ const o = (c) => {
22
+ t(c);
23
23
  };
24
24
  return j.add(o), () => {
25
25
  j.delete(o);
@@ -34,7 +34,7 @@ function R({
34
34
  iconLeft: t,
35
35
  iconRight: s,
36
36
  href: o,
37
- shouldCloseOnClick: i = !0,
37
+ shouldCloseOnClick: c = !0,
38
38
  decorators: k = [],
39
39
  submenu: m,
40
40
  className: a,
@@ -43,21 +43,21 @@ function R({
43
43
  }) {
44
44
  const {
45
45
  isVisible: u,
46
- isFocused: c,
46
+ isFocused: i,
47
47
  close: l
48
48
  } = b(), {
49
49
  isKeyboardNavigating: d
50
50
  } = N(), p = x((P) => {
51
- c && (r == null || r(P), m ? m.show() : i && (l == null || l()));
52
- }, [c, r, m, i, l]), g = v(() => /* @__PURE__ */ n.jsxs(A, { as: o ? "a" : "button", ...f, type: o ? void 0 : "button", role: "menuitem", href: o, disabled: o ? void 0 : !u, className: M(E, "kakadu-components-3114599304", d ? "kakadu-components-4096376656" : "kakadu-components-2554182777", a), onClick: p, children: [
51
+ i && (r == null || r(P), m ? m.show() : c && (l == null || l()));
52
+ }, [i, r, m, c, l]), g = v(() => /* @__PURE__ */ n.jsxs(F, { as: o ? "a" : "button", ...f, type: o ? void 0 : "button", role: "menuitem", href: o, disabled: o ? void 0 : !u, className: M(E, "kakadu-components-4075327442", i && "kakadu-components-3160069815", d ? "kakadu-components-2043829669" : i && "kakadu-components-2862719809", a), onClick: p, children: [
53
53
  /* @__PURE__ */ n.jsxs(I, { className: "kakadu-components-1109353535", children: [
54
54
  t ? /* @__PURE__ */ n.jsx(h, { width: 12, height: 12, type: t }) : null,
55
55
  /* @__PURE__ */ n.jsx("span", { className: "kakadu-components-913703148", children: e }),
56
56
  s ? /* @__PURE__ */ n.jsx(h, { width: 12, height: 12, type: s }) : null
57
57
  ] }),
58
58
  d ? null : /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
59
- /* @__PURE__ */ n.jsx(D, { size: 150, className: H }),
60
- /* @__PURE__ */ n.jsx(z, { size: 100 })
59
+ /* @__PURE__ */ n.jsx(z, { isActive: i, size: 100 }),
60
+ /* @__PURE__ */ n.jsx(D, { isActive: i, size: 150, className: H })
61
61
  ] })
62
62
  ] }), [o, f, u, d, a, p, t, e, s]);
63
63
  return /* @__PURE__ */ n.jsx(L, { decorators: k, children: m ? /* @__PURE__ */ n.jsx(U, { menu: m.popoverMenu, className: "kakadu-components-1861176543", children: g }) : g });
@@ -77,12 +77,12 @@ function B({
77
77
  const {
78
78
  isFocused: t
79
79
  } = b(), [s, o] = y([]), {
80
- setIsKeyboardNavigating: i
80
+ setIsKeyboardNavigating: c
81
81
  } = N(), k = x((a) => {
82
82
  a && o((r) => r.includes(a) ? r : [...r, a]);
83
83
  }, []), m = x((a) => {
84
- t && (a.currentTarget.focus(), i(!1));
85
- }, [t, i]);
84
+ t && (a.currentTarget.focus(), c(!1));
85
+ }, [t, c]);
86
86
  return w(() => {
87
87
  if (!t)
88
88
  return;
@@ -90,35 +90,35 @@ function B({
90
90
  const f = s.filter((p) => p.isConnected), u = f.length;
91
91
  if (u === 0)
92
92
  return;
93
- let c;
93
+ let i;
94
94
  const l = document.activeElement;
95
95
  let d = l ? f.indexOf(l) : -1;
96
96
  switch (d === -1 && (d = 0), r.key) {
97
97
  case "ArrowDown": {
98
- c = (d + 1) % u;
98
+ i = (d + 1) % u;
99
99
  break;
100
100
  }
101
101
  case "ArrowUp": {
102
- c = (d - 1 + u) % u;
102
+ i = (d - 1 + u) % u;
103
103
  break;
104
104
  }
105
105
  case "Home": {
106
- c = 0;
106
+ i = 0;
107
107
  break;
108
108
  }
109
109
  case "End": {
110
- c = u - 1;
110
+ i = u - 1;
111
111
  break;
112
112
  }
113
113
  case "Tab": {
114
- i(!0);
114
+ c(!0);
115
115
  return;
116
116
  }
117
117
  }
118
- if (c !== void 0) {
118
+ if (i !== void 0) {
119
119
  r.preventDefault(), r.stopPropagation();
120
- const p = f[c];
121
- p && (p.focus(), i(!0));
120
+ const p = f[i];
121
+ p && (p.focus(), c(!0));
122
122
  }
123
123
  };
124
124
  return window.addEventListener("keydown", a, {
@@ -128,7 +128,7 @@ function B({
128
128
  capture: !0
129
129
  });
130
130
  };
131
- }, [t, s, i]), /* @__PURE__ */ n.jsx(n.Fragment, { children: e.map((a, r) => /* @__PURE__ */ n.jsx(
131
+ }, [t, s, c]), /* @__PURE__ */ n.jsx(n.Fragment, { children: e.map((a, r) => /* @__PURE__ */ n.jsx(
132
132
  T,
133
133
  {
134
134
  ...a,
@@ -150,7 +150,7 @@ function ne(e) {
150
150
  }), [e]), {
151
151
  show: s,
152
152
  popover: o
153
- } = F(G, t);
153
+ } = A(G, t);
154
154
  return v(() => ({
155
155
  show: s,
156
156
  popoverMenu: o
@@ -1,5 +1,6 @@
1
1
  import { type ComponentRef, type Ref, type ElementType } from 'react';
2
2
  import { type AtomProperties } from './atom';
3
+ import { WrapperWidth } from './wrapper';
3
4
  export declare const textShadowStyles: string;
4
5
  export declare function Heading<Type extends ElementType = 'h1'>({ reference, as, className, ...properties }: AtomProperties<Type> & {
5
6
  readonly reference?: Ref<ComponentRef<Type>>;
@@ -11,5 +12,8 @@ export declare const spanStyles: string;
11
12
  export declare function Span<Type extends ElementType = 'span'>({ as, className, ...properties }: AtomProperties<Type>): import("react/jsx-runtime").JSX.Element;
12
13
  export declare function Paragraph<Type extends ElementType = 'p'>({ as, className, ...properties }: AtomProperties<Type>): import("react/jsx-runtime").JSX.Element;
13
14
  export declare function Label<Type extends ElementType = 'span'>({ as, className, ...properties }: AtomProperties<Type>): import("react/jsx-runtime").JSX.Element;
14
- export default function Text<Type extends ElementType = 'div'>({ as, className, ...properties }: AtomProperties<Type>): import("react/jsx-runtime").JSX.Element;
15
- export declare function Hero<Type extends ElementType = 'div'>({ as, className, ...properties }: AtomProperties<Type>): import("react/jsx-runtime").JSX.Element;
15
+ export type TextProperties<Type extends ElementType = 'div'> = Omit<AtomProperties<Type>, 'width'> & {
16
+ readonly width?: WrapperWidth;
17
+ };
18
+ export default function Text<Type extends ElementType = 'div'>({ as, width, className, ...properties }: TextProperties<Type>): import("react/jsx-runtime").JSX.Element;
19
+ export declare function Hero<Type extends ElementType = 'div'>(properties: TextProperties<Type>): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("../jsx-runtime-BB_1_6y_.js"),a=require("@kuma-ui/core"),d=require("../theme.js"),o=require("./atom.js"),c="kakadu-components-1538322784",x="kakadu-components-739732526";function i({reference:s,as:e,className:t,...r}){return n.jsxRuntimeExports.jsx(o.default,{reference:s,as:e??"h1",...r,className:a.cx(d.overflowProtectionStyles,c,"kakadu-components-1669332734",x,t)})}function k({as:s,id:e,children:t,className:r,...p}){return n.jsxRuntimeExports.jsx(i,{as:s??"h1",id:e,...p,className:a.cx(r),children:n.jsxRuntimeExports.jsx("a",{href:`#${e}`,className:"kakadu-components-1038708690",children:t})})}const u=a.cx("kakadu-components-1923397960",c,x);function m({as:s,className:e,...t}){return n.jsxRuntimeExports.jsx(o.default,{as:s??"span",...t,className:a.cx(u,e)})}function j({as:s,className:e,...t}){return n.jsxRuntimeExports.jsx(o.default,{as:s??"p",...t,className:a.cx(u,"kakadu-components-621160204",e)})}function f({as:s,className:e,...t}){return n.jsxRuntimeExports.jsx(m,{as:s??"span",...t,className:a.cx("kakadu-components-1329768068",e)})}function l({as:s,className:e,...t}){return n.jsxRuntimeExports.jsx(o.default,{as:s??"div",...t,className:a.cx("kakadu-components-1082504586",e)})}function h({as:s,className:e,...t}){return n.jsxRuntimeExports.jsx(l,{as:s??"div",...t,className:a.cx("kakadu-components-323682454",e)})}exports.AnchorHeading=k;exports.Heading=i;exports.Hero=h;exports.Label=f;exports.Paragraph=j;exports.Span=m;exports.default=l;exports.spanStyles=u;exports.textShadowStyles=c;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("../jsx-runtime-BB_1_6y_.js"),a=require("@kuma-ui/core"),k=require("../theme.js"),c=require("./atom.js"),r=require("./wrapper.js"),u="kakadu-components-1538322784",x="kakadu-components-739732526";function m({reference:t,as:e,className:n,...o}){return s.jsxRuntimeExports.jsx(c.default,{reference:t,as:e??"h1",...o,className:a.cx(k.overflowProtectionStyles,u,"kakadu-components-1669332734",x,n)})}function j({as:t,id:e,children:n,className:o,...l}){return s.jsxRuntimeExports.jsx(m,{as:t??"h1",id:e,...l,className:a.cx(o),children:s.jsxRuntimeExports.jsx("a",{href:`#${e}`,className:"kakadu-components-1038708690",children:n})})}const p=a.cx("kakadu-components-1923397960",u,x);function i({as:t,className:e,...n}){return s.jsxRuntimeExports.jsx(c.default,{as:t??"span",...n,className:a.cx(p,e)})}function f({as:t,className:e,...n}){return s.jsxRuntimeExports.jsx(c.default,{as:t??"p",...n,className:a.cx(p,"kakadu-components-621160204",e)})}function h({as:t,className:e,...n}){return s.jsxRuntimeExports.jsx(i,{as:t??"span",...n,className:a.cx("kakadu-components-1329768068",e)})}function d({as:t,width:e=r.WrapperWidth.text,className:n,...o}){return s.jsxRuntimeExports.jsx(c.default,{as:t??"div",...o,className:a.cx("kakadu-components-1437359321",e===r.WrapperWidth.page&&"kakadu-components-2433581593",e===r.WrapperWidth.text&&"kakadu-components-958855245",e===r.WrapperWidth.content&&"kakadu-components-797764377",n)})}function S(t){const{className:e}=t;return s.jsxRuntimeExports.jsx(d,{...t,className:a.cx("kakadu-components-323682454",e)})}exports.AnchorHeading=j;exports.Heading=m;exports.Hero=S;exports.Label=h;exports.Paragraph=f;exports.Span=i;exports.default=d;exports.spanStyles=p;exports.textShadowStyles=u;
@@ -1,69 +1,70 @@
1
1
  import { j as t } from "../jsx-runtime-B4hRZ52C.mjs";
2
2
  import { cx as o } from "@kuma-ui/core";
3
3
  import { overflowProtectionStyles as i } from "../theme.mjs";
4
- import e from "./atom.mjs";
5
- const c = "kakadu-components-1538322784", m = "kakadu-components-739732526";
6
- function k({
7
- reference: s,
4
+ import r from "./atom.mjs";
5
+ import { WrapperWidth as c } from "./wrapper.mjs";
6
+ const m = "kakadu-components-1538322784", u = "kakadu-components-739732526";
7
+ function l({
8
+ reference: n,
8
9
  as: a,
9
- className: n,
10
- ...r
10
+ className: s,
11
+ ...e
11
12
  }) {
12
- return /* @__PURE__ */ t.jsx(e, { reference: s, as: a ?? "h1", ...r, className: o(i, c, "kakadu-components-1669332734", m, n) });
13
+ return /* @__PURE__ */ t.jsx(r, { reference: n, as: a ?? "h1", ...e, className: o(i, m, "kakadu-components-1669332734", u, s) });
13
14
  }
14
- function N({
15
- as: s,
15
+ function g({
16
+ as: n,
16
17
  id: a,
17
- children: n,
18
- className: r,
19
- ...p
18
+ children: s,
19
+ className: e,
20
+ ...k
20
21
  }) {
21
- return /* @__PURE__ */ t.jsx(k, { as: s ?? "h1", id: a, ...p, className: o(r), children: /* @__PURE__ */ t.jsx("a", { href: `#${a}`, className: "kakadu-components-1038708690", children: n }) });
22
+ return /* @__PURE__ */ t.jsx(l, { as: n ?? "h1", id: a, ...k, className: o(e), children: /* @__PURE__ */ t.jsx("a", { href: `#${a}`, className: "kakadu-components-1038708690", children: s }) });
22
23
  }
23
- const u = o("kakadu-components-1923397960", c, m);
24
- function l({
25
- as: s,
24
+ const p = o("kakadu-components-1923397960", m, u);
25
+ function x({
26
+ as: n,
26
27
  className: a,
27
- ...n
28
+ ...s
28
29
  }) {
29
- return /* @__PURE__ */ t.jsx(e, { as: s ?? "span", ...n, className: o(u, a) });
30
+ return /* @__PURE__ */ t.jsx(r, { as: n ?? "span", ...s, className: o(p, a) });
30
31
  }
31
- function S({
32
- as: s,
32
+ function y({
33
+ as: n,
33
34
  className: a,
34
- ...n
35
+ ...s
35
36
  }) {
36
- return /* @__PURE__ */ t.jsx(e, { as: s ?? "p", ...n, className: o(u, "kakadu-components-621160204", a) });
37
+ return /* @__PURE__ */ t.jsx(r, { as: n ?? "p", ...s, className: o(p, "kakadu-components-621160204", a) });
37
38
  }
38
- function y({
39
- as: s,
39
+ function H({
40
+ as: n,
40
41
  className: a,
41
- ...n
42
+ ...s
42
43
  }) {
43
- return /* @__PURE__ */ t.jsx(l, { as: s ?? "span", ...n, className: o("kakadu-components-1329768068", a) });
44
+ return /* @__PURE__ */ t.jsx(x, { as: n ?? "span", ...s, className: o("kakadu-components-1329768068", a) });
44
45
  }
45
46
  function d({
46
- as: s,
47
- className: a,
48
- ...n
47
+ as: n,
48
+ width: a = c.text,
49
+ className: s,
50
+ ...e
49
51
  }) {
50
- return /* @__PURE__ */ t.jsx(e, { as: s ?? "div", ...n, className: o("kakadu-components-1082504586", a) });
52
+ return /* @__PURE__ */ t.jsx(r, { as: n ?? "div", ...e, className: o("kakadu-components-1437359321", a === c.page && "kakadu-components-2433581593", a === c.text && "kakadu-components-958855245", a === c.content && "kakadu-components-797764377", s) });
51
53
  }
52
- function g({
53
- as: s,
54
- className: a,
55
- ...n
56
- }) {
57
- return /* @__PURE__ */ t.jsx(d, { as: s ?? "div", ...n, className: o("kakadu-components-323682454", a) });
54
+ function W(n) {
55
+ const {
56
+ className: a
57
+ } = n;
58
+ return /* @__PURE__ */ t.jsx(d, { ...n, className: o("kakadu-components-323682454", a) });
58
59
  }
59
60
  export {
60
- N as AnchorHeading,
61
- k as Heading,
62
- g as Hero,
63
- y as Label,
64
- S as Paragraph,
65
- l as Span,
61
+ g as AnchorHeading,
62
+ l as Heading,
63
+ W as Hero,
64
+ H as Label,
65
+ y as Paragraph,
66
+ x as Span,
66
67
  d as default,
67
- u as spanStyles,
68
- c as textShadowStyles
68
+ p as spanStyles,
69
+ m as textShadowStyles
69
70
  };