@primereact/core 11.0.0-alpha.9 → 11.0.0-rc.1

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.
Files changed (46) hide show
  1. package/LICENSE.md +45 -0
  2. package/README.md +43 -0
  3. package/base/index.d.mts +1 -1
  4. package/base/index.mjs +1 -1
  5. package/base/index.mjs.map +1 -1
  6. package/component/index.d.mts +11 -9
  7. package/component/index.mjs +1 -1
  8. package/component/index.mjs.map +1 -1
  9. package/config/index.mjs +1 -1
  10. package/config/index.mjs.map +1 -1
  11. package/dnd/index.d.mts +69 -0
  12. package/dnd/index.mjs +2 -0
  13. package/dnd/index.mjs.map +1 -0
  14. package/headless/index.d.mts +1 -1
  15. package/headless/index.mjs +1 -1
  16. package/headless/index.mjs.map +1 -1
  17. package/icon/index.d.mts +3 -3
  18. package/icon/index.mjs +1 -46
  19. package/icon/index.mjs.map +1 -1
  20. package/index.d.mts +3 -0
  21. package/index.mjs +1 -1
  22. package/index.mjs.map +1 -1
  23. package/license/index.d.mts +22 -0
  24. package/license/index.mjs +2 -0
  25. package/license/index.mjs.map +1 -0
  26. package/locale/index.mjs +1 -1
  27. package/locale/index.mjs.map +1 -1
  28. package/motion/index.d.mts +24 -10
  29. package/motion/index.mjs +1 -1
  30. package/motion/index.mjs.map +1 -1
  31. package/overlay-manager/index.d.mts +84 -0
  32. package/overlay-manager/index.mjs +2 -0
  33. package/overlay-manager/index.mjs.map +1 -0
  34. package/package.json +13 -15
  35. package/passthrough/index.mjs +1 -1
  36. package/passthrough/index.mjs.map +1 -1
  37. package/theme/index.mjs +1 -1
  38. package/theme/index.mjs.map +1 -1
  39. package/umd/index.js +7 -212
  40. package/umd/index.js.map +1 -1
  41. package/use-style/index.mjs +1 -1
  42. package/use-style/index.mjs.map +1 -1
  43. package/utils/index.d.mts +73 -4
  44. package/utils/index.mjs +1 -1
  45. package/utils/index.mjs.map +1 -1
  46. package/LICENSE +0 -21
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/locale/Locale.context.tsx","../../src/locale/Locale.props.ts","../../src/locale/useLocale.ts"],"sourcesContent":["import { useProps } from '@primereact/hooks';\nimport type { LocaleProps } from '@primereact/types/core';\nimport { resolve } from '@primeuix/utils';\nimport * as React from 'react';\nimport { defaultLocaleProps } from './Locale.props';\n\nexport const LocaleContext = React.createContext<LocaleProps | undefined>(undefined);\n\nexport const LocaleProvider = (inProps: React.PropsWithChildren<LocaleProps> = {}) => {\n const { attrs } = useProps(inProps, defaultLocaleProps as LocaleProps);\n const value = undefined;\n\n return <LocaleContext.Provider value={value}>{resolve(attrs.children, value)}</LocaleContext.Provider>;\n};\n","import type { LocaleProps } from '@primereact/types/core';\n\nexport const defaultLocaleProps: LocaleProps = {\n lang: 'en'\n};\n","import * as React from 'react';\nimport { LocaleContext } from './Locale.context';\n\nexport function useLocale() {\n const context = React.useContext(LocaleContext);\n\n if (context === undefined) {\n throw new Error('Context must be used within a LocaleProvider');\n }\n\n return context;\n}\n"],"mappings":"AAAA,OAAS,YAAAA,MAAgB,oBAEzB,OAAS,WAAAC,MAAe,kBACxB,UAAYC,MAAW,QCDhB,IAAMC,EAAkC,CAC3C,KAAM,IACV,EDEO,IAAMC,EAAsB,gBAAuC,MAAS,EAEtEC,EAAiB,CAACC,EAAgD,CAAC,IAAM,CAClF,GAAM,CAAE,MAAAC,CAAM,EAAIC,EAASF,EAASG,CAAiC,EAC/DC,EAAQ,OAEd,OAAO,gBAACN,EAAc,SAAd,CAAuB,MAAOM,GAAQC,EAAQJ,EAAM,SAAUG,CAAK,CAAE,CACjF,EEbA,UAAYE,MAAW,QAGhB,SAASC,GAAY,CACxB,IAAMC,EAAgB,aAAWC,CAAa,EAE9C,GAAID,IAAY,OACZ,MAAM,IAAI,MAAM,8CAA8C,EAGlE,OAAOA,CACX","names":["useProps","resolve","React","defaultLocaleProps","LocaleContext","LocaleProvider","inProps","attrs","useProps","defaultLocaleProps","value","resolve","React","useLocale","context","LocaleContext"]}
1
+ {"version":3,"sources":["../../src/locale/Locale.context.tsx","../../src/locale/Locale.props.ts","../../src/locale/useLocale.ts"],"sourcesContent":["'use client';\nimport { useProps } from '@primereact/hooks';\nimport type { LocaleProps } from '@primereact/types/core';\nimport { resolve } from '@primeuix/utils';\nimport * as React from 'react';\nimport { defaultLocaleProps } from './Locale.props';\n\nexport const LocaleContext = React.createContext<LocaleProps | undefined>(undefined);\n\nexport const LocaleProvider = (inProps: React.PropsWithChildren<LocaleProps> = {}) => {\n const { attrs } = useProps(defaultLocaleProps as LocaleProps, inProps);\n const value = undefined;\n const resolvedChildren = React.useMemo(() => resolve(attrs.children, value) as React.ReactNode, [attrs.children, value]);\n\n return <LocaleContext.Provider value={value}>{resolvedChildren}</LocaleContext.Provider>;\n};\n","import type { LocaleProps } from '@primereact/types/core';\n\nexport const defaultLocaleProps: LocaleProps = {\n lang: 'en'\n};\n","import * as React from 'react';\nimport { LocaleContext } from './Locale.context';\n\nexport function useLocale() {\n const context = React.useContext(LocaleContext);\n\n if (context === undefined) {\n throw new Error('Context must be used within a LocaleProvider');\n }\n\n return context;\n}\n"],"mappings":"AACA,OAAS,YAAAA,MAAgB,oBAEzB,OAAS,WAAAC,MAAe,kBACxB,UAAYC,MAAW,QCFhB,IAAMC,EAAkC,CAC3C,KAAM,IACV,EDGO,IAAMC,EAAsB,gBAAuC,MAAS,EAEtEC,EAAiB,CAACC,EAAgD,CAAC,IAAM,CAClF,GAAM,CAAE,MAAAC,CAAM,EAAIC,EAASC,EAAmCH,CAAO,EAC/DI,EAAQ,OACRC,EAAyB,UAAQ,IAAMC,EAAQL,EAAM,SAAUG,CAAK,EAAsB,CAACH,EAAM,SAAUG,CAAK,CAAC,EAEvH,OAAO,gBAACN,EAAc,SAAd,CAAuB,MAAOM,GAAQC,CAAiB,CACnE,EEfA,UAAYE,MAAW,QAGhB,SAASC,GAAY,CACxB,IAAMC,EAAgB,aAAWC,CAAa,EAE9C,GAAID,IAAY,OACZ,MAAM,IAAI,MAAM,8CAA8C,EAGlE,OAAOA,CACX","names":["useProps","resolve","React","defaultLocaleProps","LocaleContext","LocaleProvider","inProps","attrs","useProps","defaultLocaleProps","value","resolvedChildren","resolve","React","useLocale","context","LocaleContext"]}
@@ -1,11 +1,12 @@
1
- import * as _primereact_types_shared_motion from '@primereact/types/shared/motion';
2
- import { MotionInstance, MotionProps, useMotionProps } from '@primereact/types/shared/motion';
3
- import * as _primereact_types_shared from '@primereact/types/shared';
1
+ import * as _primereact_types_primitive_motion from '@primereact/types/primitive/motion';
2
+ import { MotionInstance, MotionProps } from '@primereact/types/primitive/motion';
3
+ import * as _primereact_types_index from '@primereact/types/index';
4
4
  import * as _primereact_types_core from '@primereact/types/core';
5
5
  import * as React$1 from 'react';
6
- import { MotionInstance as MotionInstance$1 } from '@primeuix/motion';
6
+ import { UseMotionProps } from '@primereact/types/headless/motion';
7
+ import { MotionOptions, MotionInstance as MotionInstance$1 } from '@primeuix/motion';
7
8
 
8
- declare const Motion: (<I extends _primereact_types_core.ComponentInstance, T extends React$1.ElementType>(inProps?: (_primereact_types_core.GlobalComponentProps<I, unknown, T, unknown, unknown> & {} & {} & Omit<_primereact_types_shared.ExtractProps<T>, keyof _primereact_types_core.GlobalComponentProps<I_1, P, T_1, unknown, unknown>> & _primereact_types_shared_motion.MotionProps) | undefined) => React$1.JSX.Element | null) & Record<string, unknown> & React$1.FC<{}>;
9
+ declare const Motion: (<I extends _primereact_types_core.ComponentInstance, T extends React$1.ElementType>(inProps?: (_primereact_types_core.GlobalComponentProps<I, unknown, T, unknown, unknown> & {} & {} & Omit<_primereact_types_index.ExtractProps<T>, keyof _primereact_types_core.GlobalComponentProps<I_1, P, T_1, unknown, unknown>> & _primereact_types_primitive_motion.MotionProps) | undefined) => React$1.JSX.Element | null) & Record<string, unknown> & React$1.FC<{}>;
9
10
 
10
11
  declare const MotionProvider: ({ value, children }: {
11
12
  value: MotionInstance;
@@ -15,14 +16,27 @@ declare const useMotionContext: () => MotionInstance | undefined;
15
16
 
16
17
  declare const defaultMotionProps: MotionProps;
17
18
 
18
- declare const useMotion: (inProps?: unknown) => _primereact_types_core.HeadlessInstance<useMotionProps, unknown, {
19
- motionRef: React$1.RefObject<MotionInstance$1 | null>;
19
+ declare const DEFAULT_MOTION_OPTIONS: MotionOptions;
20
+ /**
21
+ * Creates a MotionInstance for the given element with the specified options.
22
+ * @param element - The target element for motion effects.
23
+ * @param options - Configuration options for the motion instance.
24
+ * @returns A MotionInstance that can be used to control the motion.
25
+ */
26
+ declare function createMotion2(element: Element, options?: MotionOptions): MotionInstance$1;
27
+ declare const useMotion: (inProps?: unknown) => _primereact_types_core.HeadlessInstance<UseMotionProps, unknown, {
28
+ state: {
29
+ rendered: boolean;
30
+ };
20
31
  enter: () => Promise<void | (() => void)> | undefined;
21
32
  leave: () => Promise<void | (() => void)> | undefined;
22
33
  cancel: () => void | undefined;
23
- update: (element: Element, motionProps?: useMotionProps) => void;
34
+ update: (element?: Element, motionProps?: UseMotionProps) => void;
35
+ rootProps: {
36
+ style?: React$1.CSSProperties;
37
+ };
24
38
  }>;
25
39
 
26
- declare const defaultUseMotionProps: useMotionProps;
40
+ declare const defaultUseMotionProps: UseMotionProps;
27
41
 
28
- export { Motion, MotionProvider, defaultMotionProps, defaultUseMotionProps, useMotion, useMotionContext };
42
+ export { DEFAULT_MOTION_OPTIONS, Motion, MotionProvider, createMotion2, defaultMotionProps, defaultUseMotionProps, useMotion, useMotionContext };
package/motion/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- "use client";var I=Object.defineProperty,L=Object.defineProperties;var k=Object.getOwnPropertyDescriptors;var x=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var h=(a,e,t)=>e in a?I(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,f=(a,e)=>{for(var t in e||(e={}))S.call(e,t)&&h(a,t,e[t]);if(x)for(var t of x(e))A.call(e,t)&&h(a,t,e[t]);return a},p=(a,e)=>L(a,k(e));import{Component as H}from"@primereact/core/component";import{mergeProps as B,nextFrame as K}from"@primeuix/utils";import{withComponent as b}from"@primereact/core/component";import{styles as D}from"@primereact/styles/base";var E=({name:a="UnknownComponent",defaultProps:e,styles:t=p(f({},D),{name:"global"}),components:i,setup:u,render:r})=>b({name:a,defaultProps:e,styles:t,components:i,setup:u,render:r});import*as o from"react";import{createOptionalContext as F}from"@primereact/core/utils";var[N,V]=F();var y={name:void 0,type:void 0,safe:!1,appear:!1,enter:!0,leave:!0,duration:void 0,enterFromClassName:void 0,enterToClassName:void 0,enterActiveClassName:void 0,leaveFromClassName:void 0,leaveToClassName:void 0,leaveActiveClassName:void 0,onBeforeEnter:void 0,onEnter:void 0,onAfterEnter:void 0,onEnterCancelled:void 0,onBeforeLeave:void 0,onLeave:void 0,onAfterLeave:void 0,onLeaveCancelled:void 0};var O=p(f({},y),{as:"div",in:!1,mountOnEnter:!0,unmountOnLeave:!0});import{withHeadless as U}from"@primereact/core/headless";import{createMotion as g}from"@primeuix/motion";import*as l from"react";var w=U({name:"useMotion",defaultProps:y,setup({props:a,elementRef:e}){let t=l.useRef(null),i=l.useCallback(()=>{var s;return(s=t.current)==null?void 0:s.enter()},[t.current]),u=l.useCallback(()=>{var s;return(s=t.current)==null?void 0:s.leave()},[t.current]),r=l.useCallback(()=>{var s;return(s=t.current)==null?void 0:s.cancel()},[t.current]),c=l.useCallback((s,n)=>{var m;let d=p(f({},n),{name:n==null?void 0:n.name,enterClass:{from:n==null?void 0:n.enterFromClassName,to:n==null?void 0:n.enterToClassName,active:n==null?void 0:n.enterActiveClassName},leaveClass:{from:n==null?void 0:n.leaveFromClassName,to:n==null?void 0:n.leaveToClassName,active:n==null?void 0:n.leaveActiveClassName}});t.current?(m=t.current)==null||m.update(s,d):t.current=g(s,d)},[t.current]);return l.useLayoutEffect(()=>{e.current&&c(e.current,a)},[]),{motionRef:t,enter:i,leave:u,cancel:r,update:c}}});var ue=E({name:"Motion",defaultProps:O,setup(a){let{props:e}=a,[t,i]=o.useState(()=>e.in||!e.mountOnEnter),u=o.useRef(!0),r=w(e);return o.useEffect(()=>{e.in&&!t&&i(!0)},[e.in]),o.useLayoutEffect(()=>{var d,m,C,M,v;let c=(d=r==null?void 0:r.elementRef)==null?void 0:d.current;if(!c||!t){u.current=!1;return}let s=!1,n=u.current&&e.in&&e.appear;return c.style.display="",(m=r.update)==null||m.call(r,c,e),e.in?(n||!u.current)&&((C=r.enter)==null||C.call(r)):(v=(M=r.leave)==null?void 0:M.call(r))==null||v.then(()=>{!c||s||e.in||(e.unmountOnLeave?(c.style.display="none",K().then(()=>{s||i(!1)})):c.style.display="none")}),u.current=!1,()=>{var R;s=!0,(R=r.cancel)==null||R.call(r)}},[e.in,t,e.unmountOnLeave,e.appear]),o.useEffect(()=>()=>{u.current=!0},[]),p(f({},r),{rendered:t})},render(a){let{id:e,props:t,ptmi:i,rendered:u}=a,r=B({id:e},i("root"));return o.createElement(N,{value:a},o.createElement(H,{pIf:u,instance:a,attrs:r,children:t.children}))}});export{ue as Motion,N as MotionProvider,O as defaultMotionProps,y as defaultUseMotionProps,w as useMotion,V as useMotionContext};
1
+ var B=Object.defineProperty,G=Object.defineProperties;var J=Object.getOwnPropertyDescriptors;var w=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable;var V=(e,n,t)=>n in e?B(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,h=(e,n)=>{for(var t in n||(n={}))K.call(n,t)&&V(e,t,n[t]);if(w)for(var t of w(n))Q.call(n,t)&&V(e,t,n[t]);return e},E=(e,n)=>G(e,J(n));var k=(e,n,t)=>new Promise((u,m)=>{var o=a=>{try{y(t.next(a))}catch(f){m(f)}},c=a=>{try{y(t.throw(a))}catch(f){m(f)}},y=a=>a.done?u(a.value):Promise.resolve(a.value).then(o,c);y((t=t.apply(e,n)).next())});import{Component as Me,withComponent as pe}from"@primereact/core/component";import{mergeProps as he}from"@primeuix/utils";import*as R from"react";import{createOptionalContext as X}from"@primereact/core/utils";var[_,be]=X();var S={elementRef:void 0,visible:!1,mountOnEnter:!0,unmountOnLeave:!0,name:void 0,type:void 0,safe:!1,disabled:!1,appear:!1,enter:!0,leave:!0,duration:void 0,hideStrategy:"display",cssVarPrefix:void 0,enterFromClassName:void 0,enterToClassName:void 0,enterActiveClassName:void 0,leaveFromClassName:void 0,leaveToClassName:void 0,leaveActiveClassName:void 0,onBeforeEnter:void 0,onEnter:void 0,onAfterEnter:void 0,onEnterCancelled:void 0,onBeforeLeave:void 0,onLeave:void 0,onAfterLeave:void 0,onLeaveCancelled:void 0};var D=E(h({},S),{as:"div"});import{withHeadless as te}from"@primereact/core/headless";import{nextFrame as j,toElement as ie}from"@primeuix/utils";import*as l from"react";var C=new WeakMap,$=Object.freeze({display:"none"}),ee=Object.freeze({visibility:"hidden",maxHeight:"0"});function L(e){switch(e){case"display":return $;case"visibility":return ee;default:return}}function x(e,n){if(!e)return;C.has(e)||C.set(e,{display:e.style.display==="none"?"":e.style.display,visibility:e.style.visibility==="hidden"?"":e.style.visibility,maxHeight:e.style.maxHeight==="0"?"":e.style.maxHeight});let t=L(n);t&&Object.assign(e.style,t)}function g(e,n){var u,m,o;if(!e)return;let t=C.get(e);switch(n){case"display":e.style.display=(u=t==null?void 0:t.display)!=null?u:"";break;case"visibility":e.style.visibility=(m=t==null?void 0:t.visibility)!=null?m:"",e.style.maxHeight=(o=t==null?void 0:t.maxHeight)!=null?o:"";break}C.delete(e)}import{getMotionHooks as oe,getMotionMetadata as se,mergeOptions as re,removeMotionPhase as U,removeMotionState as ae,resolveClassNames as le,resolveCSSVarName as H,resolveDuration as de,setAutoDimensionVariables as A,setDimensionVariables as T,setMotionPhase as ue,setMotionState as W,shouldSkipMotion as ce}from"@primeuix/motion";import{addClass as O,removeClass as F}from"@primeuix/utils";var ne=Object.freeze({}),fe={name:"p",safe:!0,disabled:!1,enter:!0,leave:!0,autoHeight:!0,autoWidth:!1};function me(e,n){if(!e)throw new Error("Element is required.");let t={},u=!1,m={},o=null,c={},y=s=>{if(Object.assign(t,re(s,fe)),!t.enter&&!t.leave)throw new Error("Enter or leave must be true.");c=oe(t),u=ce(t),m=le(t),o=null},a=s=>k(null,null,function*(){o==null||o();let{onBefore:r,onStart:M,onAfter:i,onCancelled:d}=c[s]||{},v={element:e};if(ue(e,s),u){r==null||r(v),M==null||M(v),i==null||i(v),U(e);return}let{from:p,active:P,to:b}=m[s]||{};return r==null||r(v),s==="enter"?T(e,t,"0px"):A(e,t),O(e,p),O(e,P),W(e,s,"from"),yield j(),s==="enter"?A(e,t):T(e,t,"0px"),F(e,p),O(e,b),W(e,s,"to"),M==null||M(v),new Promise(N=>{let z=de(t.duration,s),I=()=>{F(e,[b,P]),o=null,ae(e),U(e)},q=()=>{I(),i==null||i(v),N(),s==="enter"&&T(e,t,"auto")};o=()=>{I(),d==null||d(v),N()},ve(e,t.type,z,q)})});y(n);let f={enter:()=>t.enter?a("enter"):Promise.resolve(),leave:()=>t.leave?a("leave"):Promise.resolve(),cancel:()=>{o==null||o(),o=null},update:(s,r)=>{if(!s)throw new Error("Element is required.");e=s,f.cancel(),y(r)}};return t.appear&&f.enter(),f}var ye=0;function ve(e,n,t,u){let m=e._motionEndId=++ye,o=()=>{m===e._motionEndId&&u()};if(t!=null)return setTimeout(o,t);let{type:c,timeout:y,count:a}=se(e,n);if(!c){u();return}let f=c+"end",s=0,r=()=>{e.removeEventListener(f,M,!0),o()},M=i=>{i.target===e&&++s>=a&&r()};e.addEventListener(f,M,{capture:!0,once:!0}),setTimeout(()=>{s<a&&r()},y+1)}var Y=te({name:"useMotion",defaultProps:S,setup({props:e,elementRef:n}){let[t,u]=l.useState(()=>e.visible&&e.mountOnEnter||!e.mountOnEnter),m={rendered:t},o=l.useRef(void 0),c=l.useRef(!0),y=l.useCallback(()=>{var i;return(i=ie(e.elementRef))!=null?i:n==null?void 0:n.current},[e.elementRef,n]),a=l.useCallback(()=>{var i;return(i=o.current)==null?void 0:i.enter()},[]),f=l.useCallback(()=>{var i;return(i=o.current)==null?void 0:i.leave()},[]),s=l.useCallback(()=>{var i;return(i=o.current)==null?void 0:i.cancel()},[]),r=l.useCallback((i,d={})=>{var p;if(!i)return;let v=E(h({},d),{enterClass:{from:d.enterFromClassName,to:d.enterToClassName,active:d.enterActiveClassName},leaveClass:{from:d.leaveFromClassName,to:d.leaveToClassName,active:d.leaveActiveClassName}});o.current?(p=o.current)==null||p.update(i,v):o.current=me(i,v)},[]);l.useLayoutEffect(()=>()=>{let i=y();g(i,e.hideStrategy),c.current=!0},[]),l.useLayoutEffect(()=>{e.visible&&!t&&u(!0)},[e.visible]),l.useLayoutEffect(()=>{let i=y();r==null||r(i,e)},[]),l.useLayoutEffect(()=>{var p;let i=y();if(!i||!t){i&&!e.visible&&x(i,e.hideStrategy),c.current=!1;return}let d=!1,v=c.current&&e.visible&&e.appear;if(g(i,e.hideStrategy),r==null||r(i,e),e.visible){if(v||!c.current)a==null||a();else if(e.cssVarPrefix){let P=H(e.cssVarPrefix,"width"),b=H(e.cssVarPrefix,"height");i.style.setProperty(P,"auto"),i.style.setProperty(b,"auto")}}else(p=f==null?void 0:f())==null||p.then(()=>{!i||d||e.visible||(e.unmountOnLeave?(x(i,e.hideStrategy),j().then(()=>{d||u(!1)})):x(i,e.hideStrategy))});return c.current=!1,()=>{d=!0,s==null||s()}},[e.visible,t,e.unmountOnLeave,e.appear,y]);let M=l.useMemo(()=>{if(!e.visible&&!t){let i=H(e.cssVarPrefix,"width"),d=H(e.cssVarPrefix,"height");return{style:E(h({},L(e.hideStrategy)),{[i]:"0px",[d]:"0px"})}}return ne},[e.visible,t,e.hideStrategy,e.cssVarPrefix]);return{state:m,enter:a,leave:f,cancel:s,update:r,rootProps:M}}});var Ae=pe({name:"Motion",defaultProps:D,setup(e){return Y(e.inProps)},render(e){let{id:n,props:t,state:u,ptmi:m,rootProps:o}=e,c=he({id:n},m("root"),o);return R.createElement(_,{value:e},R.createElement(Me,{pIf:u.rendered,instance:e,attrs:c,children:t.children}))}});export{fe as DEFAULT_MOTION_OPTIONS,Ae as Motion,_ as MotionProvider,me as createMotion2,D as defaultMotionProps,S as defaultUseMotionProps,Y as useMotion,be as useMotionContext};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/motion/Motion.tsx","../../../primereact/src/base/index.ts","../../src/motion/Motion.context.ts","../../src/motion/useMotion.props.ts","../../src/motion/Motion.props.ts","../../src/motion/useMotion.ts"],"sourcesContent":["'use client';\nimport { Component } from '@primereact/core/component';\nimport { mergeProps, nextFrame } from '@primeuix/utils';\nimport { withComponent } from 'primereact/base';\nimport * as React from 'react';\nimport { MotionProvider } from './Motion.context';\nimport { defaultMotionProps } from './Motion.props';\nimport { useMotion } from './useMotion';\n\nexport const Motion = withComponent({\n name: 'Motion',\n defaultProps: defaultMotionProps,\n setup(instance) {\n const { props } = instance;\n\n const [rendered, setRendered] = React.useState(() => props.in || !props.mountOnEnter);\n const isInitialMount = React.useRef(true);\n const motion = useMotion(props);\n\n React.useEffect(() => {\n if (props.in && !rendered) {\n setRendered(true);\n }\n }, [props.in]);\n\n React.useLayoutEffect(() => {\n const element = motion?.elementRef?.current;\n\n if (!element || !rendered) {\n isInitialMount.current = false;\n\n return;\n }\n\n let cancelled = false;\n const shouldAppear = isInitialMount.current && props.in && props.appear;\n\n element.style.display = '';\n motion.update?.(element, props);\n\n if (props.in) {\n if (shouldAppear || !isInitialMount.current) {\n motion.enter?.();\n }\n } else {\n motion.leave?.()?.then(() => {\n if (!element || cancelled || props.in) return;\n\n if (props.unmountOnLeave) {\n element.style.display = 'none';\n nextFrame().then(() => {\n if (!cancelled) setRendered(false);\n });\n } else {\n element.style.display = 'none';\n }\n });\n }\n\n isInitialMount.current = false;\n\n return () => {\n cancelled = true;\n motion.cancel?.();\n };\n }, [props.in, rendered, props.unmountOnLeave, props.appear]);\n\n React.useEffect(() => {\n return () => {\n isInitialMount.current = true;\n };\n }, []);\n\n return {\n ...motion,\n rendered\n };\n },\n render(instance) {\n const { id, props, ptmi, rendered } = instance;\n\n const rootProps = mergeProps(\n {\n id\n },\n ptmi('root')\n );\n\n return (\n <MotionProvider value={instance}>\n <Component pIf={rendered} instance={instance} attrs={rootProps} children={props.children} />\n </MotionProvider>\n );\n }\n});\n","import { withComponent as withComponentInCore } from '@primereact/core/component';\nimport { styles as baseStyles } from '@primereact/styles/base';\nimport type { withComponentOptions } from '@primereact/types/core';\nimport type { StylesOptions } from '@primereact/types/styles';\n\nexport const withComponent = <IProps, DProps, Exposes extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>, Styles = StylesOptions, CData = Record<string, unknown>>({\n name = 'UnknownComponent',\n defaultProps,\n styles = {\n ...baseStyles,\n name: 'global'\n } as Styles,\n components,\n setup,\n render\n}: withComponentOptions<IProps, DProps, Exposes, Styles, CData>) => {\n return withComponentInCore<IProps, DProps, Exposes, Styles, CData>({\n name,\n defaultProps,\n styles,\n components,\n setup,\n render\n });\n};\n","import { createOptionalContext } from '@primereact/core/utils';\nimport type { MotionInstance } from '@primereact/types/shared/motion';\n\nexport const [MotionProvider, useMotionContext] = createOptionalContext<MotionInstance>();\n","import type { useMotionProps } from '@primereact/types/shared/motion';\n\nexport const defaultUseMotionProps: useMotionProps = {\n name: undefined,\n type: undefined,\n safe: false,\n appear: false,\n enter: true,\n leave: true,\n duration: undefined,\n enterFromClassName: undefined,\n enterToClassName: undefined,\n enterActiveClassName: undefined,\n leaveFromClassName: undefined,\n leaveToClassName: undefined,\n leaveActiveClassName: undefined,\n onBeforeEnter: undefined,\n onEnter: undefined,\n onAfterEnter: undefined,\n onEnterCancelled: undefined,\n onBeforeLeave: undefined,\n onLeave: undefined,\n onAfterLeave: undefined,\n onLeaveCancelled: undefined\n};\n","import type { MotionProps } from '@primereact/types/shared/motion';\nimport * as HeadlessMotion from './useMotion.props';\n\nexport const defaultMotionProps: MotionProps = {\n ...HeadlessMotion.defaultUseMotionProps,\n as: 'div',\n in: false,\n mountOnEnter: true,\n unmountOnLeave: true\n};\n","import { withHeadless } from '@primereact/core/headless';\nimport type { useMotionProps } from '@primereact/types/shared/motion';\nimport { createMotion, type MotionInstance, type MotionOptions } from '@primeuix/motion';\nimport * as React from 'react';\nimport { defaultUseMotionProps } from './useMotion.props';\n\nexport const useMotion = withHeadless({\n name: 'useMotion',\n defaultProps: defaultUseMotionProps,\n setup({ props, elementRef }) {\n const motionRef = React.useRef<MotionInstance | null>(null);\n\n // methods\n const enter = React.useCallback(() => motionRef.current?.enter(), [motionRef.current]);\n const leave = React.useCallback(() => motionRef.current?.leave(), [motionRef.current]);\n const cancel = React.useCallback(() => motionRef.current?.cancel(), [motionRef.current]);\n const update = React.useCallback(\n (element: Element, motionProps?: useMotionProps) => {\n const options: MotionOptions = {\n ...motionProps,\n name: motionProps?.name,\n enterClass: {\n from: motionProps?.enterFromClassName,\n to: motionProps?.enterToClassName,\n active: motionProps?.enterActiveClassName\n },\n leaveClass: {\n from: motionProps?.leaveFromClassName,\n to: motionProps?.leaveToClassName,\n active: motionProps?.leaveActiveClassName\n }\n };\n\n if (!motionRef.current) {\n motionRef.current = createMotion(element, options);\n } else {\n motionRef.current?.update(element, options);\n }\n },\n [motionRef.current]\n );\n\n React.useLayoutEffect(() => {\n if (elementRef.current) {\n update(elementRef.current, props);\n }\n }, []);\n\n return {\n motionRef,\n // methods\n enter,\n leave,\n cancel,\n update\n };\n }\n});\n"],"mappings":"0bACA,OAAS,aAAAA,MAAiB,6BAC1B,OAAS,cAAAC,EAAY,aAAAC,MAAiB,kBCFtC,OAAS,iBAAiBC,MAA2B,6BACrD,OAAS,UAAUC,MAAkB,0BAI9B,IAAMC,EAAgB,CAAuJ,CAChL,KAAAC,EAAO,mBACP,aAAAC,EACA,OAAAC,EAASC,EAAAC,EAAA,GACFC,GADE,CAEL,KAAM,QACV,GACA,WAAAC,EACA,MAAAC,EACA,OAAAC,CACJ,IACWC,EAA4D,CAC/D,KA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OAAAW,EAAQ,MAAM,QAAU,IACxBJ,EAAAH,EAAO,SAAP,MAAAG,EAAA,KAAAH,EAAgBO,EAASX,GAErBA,EAAM,IACFa,GAAgB,CAACV,EAAe,YAChCK,EAAAJ,EAAO,QAAP,MAAAI,EAAA,KAAAJ,KAGJM,GAAAD,EAAAL,EAAO,QAAP,YAAAK,EAAA,KAAAL,KAAA,MAAAM,EAAkB,KAAK,IAAM,CACrB,CAACC,GAAWC,GAAaZ,EAAM,KAE/BA,EAAM,gBACNW,EAAQ,MAAM,QAAU,OACxBG,EAAU,EAAE,KAAK,IAAM,CACdF,GAAWV,EAAY,EAAK,CACrC,CAAC,GAEDS,EAAQ,MAAM,QAAU,OAEhC,GAGJR,EAAe,QAAU,GAElB,IAAM,CA7DzB,IAAAG,EA8DgBM,EAAY,IACZN,EAAAF,EAAO,SAAP,MAAAE,EAAA,KAAAF,EACJ,CACJ,EAAG,CAACJ,EAAM,GAAIC,EAAUD,EAAM,eAAgBA,EAAM,MAAM,CAAC,EAErD,YAAU,IACL,IAAM,CACTG,EAAe,QAAU,EAC7B,EACD,CAAC,CAAC,EAEEY,EAAAC,EAAA,GACAZ,GADA,CAEH,SAAAH,CACJ,EACJ,EACA,OAAOF,EAAU,CACb,GAAM,CAAE,GAAAkB,EAAI,MAAAjB,EAAO,KAAAkB,EAAM,SAAAjB,CAAS,EAAIF,EAEhCoB,EAAYC,EACd,CACI,GAAAH,CACJ,EACAC,EAAK,MAAM,CACf,EAEA,OACI,gBAACG,EAAA,CAAe,MAAOtB,GACnB,gBAACuB,EAAA,CAAU,IAAKrB,EAAU,SAAUF,EAAU,MAAOoB,EAAW,SAAUnB,EAAM,SAAU,CAC9F,CAER,CACJ,CAAC","names":["Component","mergeProps","nextFrame","withComponentInCore","baseStyles","withComponent","name","defaultProps","styles","__spreadProps","__spreadValues","baseStyles","components","setup","render","withComponentInCore","React","createOptionalContext","MotionProvider","useMotionContext","defaultUseMotionProps","defaultMotionProps","__spreadProps","__spreadValues","defaultUseMotionProps","withHeadless","createMotion","React","useMotion","withHeadless","defaultUseMotionProps","props","elementRef","motionRef","enter","_a","leave","cancel","update","element","motionProps","options","__spreadProps","__spreadValues","createMotion","Motion","withComponent","defaultMotionProps","instance","props","rendered","setRendered","isInitialMount","motion","useMotion","_a","_b","_c","_d","_e","element","cancelled","shouldAppear","nextFrame","__spreadProps","__spreadValues","id","ptmi","rootProps","mergeProps","MotionProvider","Component"]}
1
+ {"version":3,"sources":["../../src/motion/Motion.tsx","../../src/motion/Motion.context.ts","../../src/motion/useMotion.props.ts","../../src/motion/Motion.props.ts","../../src/motion/useMotion.ts","../../src/motion/Motion.utils.ts"],"sourcesContent":["'use client';\nimport { Component, withComponent } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport * as React from 'react';\nimport { MotionProvider } from './Motion.context';\nimport { defaultMotionProps } from './Motion.props';\nimport { useMotion } from './useMotion';\n\nexport const Motion = withComponent({\n name: 'Motion',\n defaultProps: defaultMotionProps,\n setup(instance) {\n const motion = useMotion(instance.inProps);\n\n return motion;\n },\n render(instance) {\n const { id, props, state, ptmi, rootProps: headlessRootProps } = instance;\n\n const rootProps = mergeProps(\n {\n id\n },\n ptmi('root'),\n headlessRootProps\n );\n\n return (\n <MotionProvider value={instance}>\n <Component pIf={state.rendered} instance={instance} attrs={rootProps} children={props.children} />\n </MotionProvider>\n );\n }\n});\n","'use client';\nimport { createOptionalContext } from '@primereact/core/utils';\nimport type { MotionInstance } from '@primereact/types/primitive/motion';\n\nexport const [MotionProvider, useMotionContext] = createOptionalContext<MotionInstance>();\n","import type { UseMotionProps } from '@primereact/types/headless/motion';\n\nexport const defaultUseMotionProps: UseMotionProps = {\n elementRef: undefined,\n visible: false,\n mountOnEnter: true,\n unmountOnLeave: true,\n name: undefined,\n type: undefined,\n safe: false,\n disabled: false,\n appear: false,\n enter: true,\n leave: true,\n duration: undefined,\n hideStrategy: 'display',\n cssVarPrefix: undefined,\n enterFromClassName: undefined,\n enterToClassName: undefined,\n enterActiveClassName: undefined,\n leaveFromClassName: undefined,\n leaveToClassName: undefined,\n leaveActiveClassName: undefined,\n onBeforeEnter: undefined,\n onEnter: undefined,\n onAfterEnter: undefined,\n onEnterCancelled: undefined,\n onBeforeLeave: undefined,\n onLeave: undefined,\n onAfterLeave: undefined,\n onLeaveCancelled: undefined\n};\n","import type { MotionProps } from '@primereact/types/primitive/motion';\nimport * as HeadlessMotion from './useMotion.props';\n\nexport const defaultMotionProps: MotionProps = {\n ...HeadlessMotion.defaultUseMotionProps,\n as: 'div'\n};\n","import { withHeadless } from '@primereact/core/headless';\nimport { UseMotionProps } from '@primereact/types/headless/motion';\nimport { nextFrame, toElement } from '@primeuix/utils';\nimport * as React from 'react';\nimport { applyHiddenStyles, getHiddenStyle, resetStyles } from './Motion.utils';\nimport { defaultUseMotionProps } from './useMotion.props';\n\nconst EMPTY_ROOT_PROPS: { style?: React.CSSProperties } = Object.freeze({});\n\nimport type { MotionClassNamesWithPhase, MotionHooksWithPhase, MotionInstance, MotionOptions, MotionPhase, MotionType } from '@primeuix/motion';\nimport {\n getMotionHooks,\n getMotionMetadata,\n mergeOptions,\n removeMotionPhase,\n removeMotionState,\n resolveClassNames,\n resolveCSSVarName,\n resolveDuration,\n setAutoDimensionVariables,\n setDimensionVariables,\n setMotionPhase,\n setMotionState,\n shouldSkipMotion\n} from '@primeuix/motion';\nimport { addClass, removeClass } from '@primeuix/utils';\n\nexport const DEFAULT_MOTION_OPTIONS: MotionOptions = {\n name: 'p',\n safe: true,\n disabled: false,\n enter: true,\n leave: true,\n autoHeight: true,\n autoWidth: false\n};\n\n/**\n * Creates a MotionInstance for the given element with the specified options.\n * @param element - The target element for motion effects.\n * @param options - Configuration options for the motion instance.\n * @returns A MotionInstance that can be used to control the motion.\n */\nexport function createMotion2(element: Element, options?: MotionOptions): MotionInstance {\n if (!element) throw new Error('Element is required.');\n\n const opts: MotionOptions = {};\n let skipMotion = false;\n let classNames: MotionClassNamesWithPhase = {} as MotionClassNamesWithPhase;\n let cancelCurrent: (() => void) | null = null;\n let hooks: MotionHooksWithPhase = {};\n\n const init = (newOpts?: MotionOptions) => {\n Object.assign(opts, mergeOptions(newOpts, DEFAULT_MOTION_OPTIONS));\n if (!opts.enter && !opts.leave) throw new Error('Enter or leave must be true.');\n\n hooks = getMotionHooks(opts);\n skipMotion = shouldSkipMotion(opts);\n classNames = resolveClassNames(opts);\n cancelCurrent = null;\n };\n\n const run = async (phase: MotionPhase): Promise<void> => {\n cancelCurrent?.();\n\n const { onBefore, onStart, onAfter, onCancelled } = hooks[phase] || {};\n const event = { element };\n\n setMotionPhase(element as HTMLElement, phase);\n\n if (skipMotion) {\n onBefore?.(event);\n onStart?.(event);\n onAfter?.(event);\n\n removeMotionPhase(element as HTMLElement);\n\n return;\n }\n\n const { from: fromClass, active: activeClass, to: toClass } = classNames[phase] || {};\n\n onBefore?.(event);\n\n // Set initial dimension variables: enter starts at 0, leave starts at current size\n if (phase === 'enter') {\n setDimensionVariables(element as HTMLElement, opts, '0px');\n } else {\n setAutoDimensionVariables(element as HTMLElement, opts);\n }\n\n addClass(element, fromClass);\n addClass(element, activeClass);\n setMotionState(element as HTMLElement, phase, 'from');\n\n await nextFrame();\n\n // Set target dimension variables: enter goes to auto, leave goes to 0\n if (phase === 'enter') {\n setAutoDimensionVariables(element as HTMLElement, opts);\n } else {\n setDimensionVariables(element as HTMLElement, opts, '0px');\n }\n\n removeClass(element, fromClass);\n addClass(element, toClass);\n setMotionState(element as HTMLElement, phase, 'to');\n onStart?.(event);\n\n return new Promise((resolve) => {\n const duration = resolveDuration(opts.duration, phase);\n\n const cleanup = () => {\n removeClass(element, [toClass, activeClass]);\n cancelCurrent = null;\n removeMotionState(element as HTMLElement);\n removeMotionPhase(element as HTMLElement);\n };\n\n const onDone = () => {\n cleanup();\n onAfter?.(event);\n resolve();\n\n // After enter: set to auto so content can resize naturally\n if (phase === 'enter') {\n setDimensionVariables(element as HTMLElement, opts, 'auto');\n }\n };\n\n cancelCurrent = () => {\n cleanup();\n onCancelled?.(event);\n resolve();\n };\n\n whenEnd(element, opts.type, duration, onDone);\n });\n };\n\n init(options);\n\n const instance: MotionInstance = {\n enter: () => {\n if (!opts.enter) return Promise.resolve();\n\n return run('enter');\n },\n leave: () => {\n if (!opts.leave) return Promise.resolve();\n\n return run('leave');\n },\n cancel: () => {\n cancelCurrent?.();\n cancelCurrent = null;\n },\n update: (newElement?: Element, newOptions?: MotionOptions) => {\n if (!newElement) throw new Error('Element is required.');\n\n element = newElement as HTMLElement;\n instance.cancel();\n init(newOptions);\n }\n };\n\n if (opts.appear) instance.enter();\n\n return instance;\n}\n\nlet endId = 0;\n\n/**\n * Ported from Vue.js Transition Component;\n * @see https://github.com/vuejs/core/blob/main/packages/runtime-dom/src/components/Transition.ts#L348\n *\n * When the transition is triggered, it waits for the end of the motion (transition or animation)\n * @param element - The element to wait for the motion end.\n * @param expectedType - The expected type of motion (transition or animation).\n * @param explicitTimeout - An optional explicit timeout in milliseconds.\n * @param resolve - A function to call when the motion ends.\n * @returns A timeout ID if an explicit timeout is provided, otherwise undefined.\n */\nfunction whenEnd(element: Element & { _motionEndId?: number }, expectedType: MotionType | undefined, explicitTimeout: number | null, resolve: () => void) {\n const id = (element._motionEndId = ++endId);\n\n const resolveIfNotStale = () => {\n if (id === element._motionEndId) {\n resolve();\n }\n };\n\n if (explicitTimeout != null) {\n return setTimeout(resolveIfNotStale, explicitTimeout);\n }\n\n const { type, timeout, count } = getMotionMetadata(element, expectedType);\n\n if (!type) {\n resolve();\n\n return;\n }\n\n const endEvent = type + 'end';\n let ended = 0;\n\n const end = () => {\n element.removeEventListener(endEvent, onEnd, true);\n resolveIfNotStale();\n };\n\n const onEnd = (event: Event) => {\n if (event.target === element && ++ended >= count) {\n end();\n }\n };\n\n element.addEventListener(endEvent, onEnd, { capture: true, once: true });\n setTimeout(() => {\n if (ended < count) {\n end();\n }\n }, timeout + 1);\n}\n\nexport const useMotion = withHeadless({\n name: 'useMotion',\n defaultProps: defaultUseMotionProps,\n setup({ props, elementRef }) {\n const [renderedState, setRenderedState] = React.useState(() => (props.visible && props.mountOnEnter) || !props.mountOnEnter);\n\n const state = {\n rendered: renderedState\n };\n\n // refs\n const motionRef = React.useRef<MotionInstance | undefined>(undefined);\n const isInitialMount = React.useRef(true);\n\n // helpers\n const getElement = React.useCallback(() => toElement(props.elementRef) ?? elementRef?.current, [props.elementRef, elementRef]);\n\n // methods\n const enter = React.useCallback(() => motionRef.current?.enter(), []);\n const leave = React.useCallback(() => motionRef.current?.leave(), []);\n const cancel = React.useCallback(() => motionRef.current?.cancel(), []);\n const update = React.useCallback((element?: Element, motionProps: UseMotionProps = {}) => {\n if (!element) {\n return;\n }\n\n const options: MotionOptions = {\n ...motionProps,\n enterClass: {\n from: motionProps.enterFromClassName,\n to: motionProps.enterToClassName,\n active: motionProps.enterActiveClassName\n },\n leaveClass: {\n from: motionProps.leaveFromClassName,\n to: motionProps.leaveToClassName,\n active: motionProps.leaveActiveClassName\n }\n };\n\n if (!motionRef.current) {\n motionRef.current = createMotion2(element, options);\n } else {\n motionRef.current?.update(element, options);\n }\n }, []);\n\n // effects\n React.useLayoutEffect(() => {\n return () => {\n const element = getElement();\n\n resetStyles(element, props.hideStrategy);\n\n isInitialMount.current = true;\n };\n }, []);\n\n React.useLayoutEffect(() => {\n if (props.visible && !renderedState) {\n setRenderedState(true);\n }\n }, [props.visible]);\n\n React.useLayoutEffect(() => {\n const element = getElement();\n\n update?.(element, props);\n }, []);\n\n React.useLayoutEffect(() => {\n const element = getElement();\n\n if (!element || !renderedState) {\n if (element && !props.visible) {\n applyHiddenStyles(element, props.hideStrategy);\n }\n\n isInitialMount.current = false;\n\n return;\n }\n\n let cancelled = false;\n const shouldAppear = isInitialMount.current && props.visible && props.appear;\n\n resetStyles(element, props.hideStrategy);\n update?.(element, props);\n\n if (props.visible) {\n if (shouldAppear || !isInitialMount.current) {\n enter?.();\n } else if (props.cssVarPrefix) {\n // Initial mount with visible=true and no appear animation.\n // createMotion sets CSS vars to 0px, so we need to override them to auto\n // to ensure the content is visible immediately.\n const widthVar = resolveCSSVarName(props.cssVarPrefix, 'width');\n const heightVar = resolveCSSVarName(props.cssVarPrefix, 'height');\n\n element.style.setProperty(widthVar, 'auto');\n element.style.setProperty(heightVar, 'auto');\n }\n } else {\n leave?.()?.then(() => {\n if (!element || cancelled || props.visible) return;\n\n if (props.unmountOnLeave) {\n applyHiddenStyles(element, props.hideStrategy);\n nextFrame().then(() => {\n if (!cancelled) setRenderedState(false);\n });\n } else {\n applyHiddenStyles(element, props.hideStrategy);\n }\n });\n }\n\n isInitialMount.current = false;\n\n return () => {\n cancelled = true;\n cancel?.();\n };\n }, [props.visible, renderedState, props.unmountOnLeave, props.appear, getElement]);\n\n const rootProps = React.useMemo<{ style?: React.CSSProperties }>(() => {\n if (!props.visible && !renderedState) {\n const widthVar = resolveCSSVarName(props.cssVarPrefix, 'width');\n const heightVar = resolveCSSVarName(props.cssVarPrefix, 'height');\n\n return {\n style: {\n ...getHiddenStyle(props.hideStrategy),\n [widthVar]: '0px',\n [heightVar]: '0px'\n } as React.CSSProperties\n };\n }\n\n return EMPTY_ROOT_PROPS;\n }, [props.visible, renderedState, props.hideStrategy, props.cssVarPrefix]);\n\n return {\n state,\n // methods\n enter,\n leave,\n cancel,\n update,\n // props getters\n rootProps\n };\n }\n});\n","import type * as React from 'react';\n\nconst originalStyles = new WeakMap<HTMLElement, { display?: string; visibility?: string; maxHeight?: string }>();\n\nconst HIDDEN_STYLE_DISPLAY: React.CSSProperties = Object.freeze({ display: 'none' });\nconst HIDDEN_STYLE_VISIBILITY: React.CSSProperties = Object.freeze({ visibility: 'hidden', maxHeight: '0' });\n\nexport function getHiddenStyle(strategy?: 'display' | 'visibility' | 'none'): React.CSSProperties | undefined {\n switch (strategy) {\n case 'display':\n return HIDDEN_STYLE_DISPLAY;\n case 'visibility':\n return HIDDEN_STYLE_VISIBILITY;\n default:\n return undefined;\n }\n}\n\nexport function applyHiddenStyles(element?: HTMLElement, strategy?: 'display' | 'visibility' | 'none') {\n if (!element) return;\n\n if (!originalStyles.has(element)) {\n originalStyles.set(element, {\n display: element.style.display === 'none' ? '' : element.style.display,\n visibility: element.style.visibility === 'hidden' ? '' : element.style.visibility,\n maxHeight: element.style.maxHeight === '0' ? '' : element.style.maxHeight\n });\n }\n\n const hiddenStyle = getHiddenStyle(strategy);\n\n if (hiddenStyle) {\n Object.assign(element.style, hiddenStyle);\n }\n}\n\nexport function resetStyles(element?: HTMLElement, strategy?: 'display' | 'visibility' | 'none') {\n if (!element) return;\n\n const original = originalStyles.get(element);\n\n switch (strategy) {\n case 'display':\n element.style.display = original?.display ?? '';\n break;\n case 'visibility':\n element.style.visibility = original?.visibility ?? '';\n element.style.maxHeight = original?.maxHeight ?? '';\n break;\n }\n\n originalStyles.delete(element);\n}\n"],"mappings":"0nBACA,OAAS,aAAAA,GAAW,iBAAAC,OAAqB,6BACzC,OAAS,cAAAC,OAAkB,kBAC3B,UAAYC,MAAW,QCFvB,OAAS,yBAAAC,MAA6B,yBAG/B,GAAM,CAACC,EAAgBC,EAAgB,EAAIF,EAAsC,ECFjF,IAAMG,EAAwC,CACjD,WAAY,OACZ,QAAS,GACT,aAAc,GACd,eAAgB,GAChB,KAAM,OACN,KAAM,OACN,KAAM,GACN,SAAU,GACV,OAAQ,GACR,MAAO,GACP,MAAO,GACP,SAAU,OACV,aAAc,UACd,aAAc,OACd,mBAAoB,OACpB,iBAAkB,OAClB,qBAAsB,OACtB,mBAAoB,OACpB,iBAAkB,OAClB,qBAAsB,OACtB,cAAe,OACf,QAAS,OACT,aAAc,OACd,iBAAkB,OAClB,cAAe,OACf,QAAS,OACT,aAAc,OACd,iBAAkB,MACtB,EC5BO,IAAMC,EAAkCC,EAAAC,EAAA,GACzBC,GADyB,CAE3C,GAAI,KACR,GCNA,OAAS,gBAAAC,OAAoB,4BAE7B,OAAS,aAAAC,EAAW,aAAAC,OAAiB,kBACrC,UAAYC,MAAW,Q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E,CAAS,EAAG,KACjB,EACJ,CACJ,CAEA,OAAOpF,EACX,EAAG,CAAC6D,EAAM,QAASE,EAAeF,EAAM,aAAcA,EAAM,YAAY,CAAC,EAEzE,MAAO,CACH,MAAAI,EAEA,MAAAM,EACA,MAAAC,EACA,OAAAC,EACA,OAAAC,EAEA,UAAAW,CACJ,CACJ,CACJ,CAAC,EJpXM,IAAME,GAASC,GAAc,CAChC,KAAM,SACN,aAAcC,EACd,MAAMC,EAAU,CAGZ,OAFeC,EAAUD,EAAS,OAAO,CAG7C,EACA,OAAOA,EAAU,CACb,GAAM,CAAE,GAAAE,EAAI,MAAAC,EAAO,MAAAC,EAAO,KAAAC,EAAM,UAAWC,CAAkB,EAAIN,EAE3DO,EAAYC,GACd,CACI,GAAAN,CACJ,EACAG,EAAK,MAAM,EACXC,CACJ,EAEA,OACI,gBAACG,EAAA,CAAe,MAAOT,GACnB,gBAACU,GAAA,CAAU,IAAKN,EAAM,SAAU,SAAUJ,EAAU,MAAOO,EAAW,SAAUJ,EAAM,SAAU,CACpG,CAER,CACJ,CAAC","names":["Component","withComponent","mergeProps","React","createOptionalContext","MotionProvider","useMotionContext","defaultUseMotionProps","defaultMotionProps","__spreadProps","__spreadValues","defaultUseMotionProps","withHeadless","nextFrame","toElement","React","originalStyles","HIDDEN_STYLE_DISPLAY","HIDDEN_STYLE_VISIBILITY","getHiddenStyle","strategy","applyHiddenStyles","element","hiddenStyle","resetStyles","_a","_b","_c","original","getMotionHooks","getMotionMetadata","mergeOptions","removeMotionPhase","removeMotionState","resolveClassNames","resolveCSSVarName","resolveDuration","setAutoDimensionVariables","setDimensionVariables","setMotionPhase","setMotionState","shouldSkipMotion","addClass","removeClass","EMPTY_ROOT_PROPS","DEFAULT_MOTION_OPTIONS","createMotion2","element","options","opts","skipMotion","classNames","cancelCurrent","hooks","init","newOpts","mergeOptions","getMotionHooks","shouldSkipMotion","resolveClassNames","run","phase","__async","onBefore","onStart","onAfter","onCancelled","event","setMotionPhase","removeMotionPhase","fromClass","activeClass","toClass","setDimensionVariables","setAutoDimensionVariables","addClass","setMotionState","nextFrame","removeClass","resolve","duration","resolveDuration","cleanup","removeMotionState","onDone","whenEnd","instance","newElement","newOptions","endId","expectedType","explicitTimeout","id","resolveIfNotStale","type","timeout","count","getMotionMetadata","endEvent","ended","end","onEnd","useMotion","withHeadless","defaultUseMotionProps","props","elementRef","renderedState","setRenderedState","state","motionRef","isInitialMount","getElement","_a","toElement","enter","leave","cancel","update","motionProps","__spreadProps","__spreadValues","resetStyles","applyHiddenStyles","cancelled","shouldAppear","widthVar","resolveCSSVarName","heightVar","rootProps","getHiddenStyle","Motion","withComponent","defaultMotionProps","instance","useMotion","id","props","state","ptmi","headlessRootProps","rootProps","mergeProps","MotionProvider","Component"]}
@@ -0,0 +1,84 @@
1
+ import * as React from 'react';
2
+
3
+ interface OverlayOpenChangeEvent {
4
+ value: boolean | undefined;
5
+ }
6
+ interface OverlayEntry<P> {
7
+ id: string;
8
+ props: P;
9
+ open: boolean;
10
+ }
11
+ /**
12
+ * Props the manager injects into every overlay's prop bag. Spread these onto the overlay's
13
+ * root component (e.g. `<Dialog.Root {...rest}>`) — the manager owns open state and lifecycle,
14
+ * so the render function should not wire any of these manually.
15
+ */
16
+ interface OverlayInjectedProps {
17
+ /** Stable id of the overlay entry. */
18
+ overlayId: string;
19
+ /** Whether the overlay should currently be open. The manager owns this value. */
20
+ open: boolean;
21
+ /** Fired by the overlay when its open state changes. The manager listens for `value: false` to begin closing the entry. */
22
+ onOpenChange: (event: OverlayOpenChangeEvent) => void;
23
+ /** Fired by the overlay once its leave transition completes. The manager removes the entry from the store. */
24
+ onExitComplete: () => void;
25
+ }
26
+ /** Render function passed to `createOverlayManager`. */
27
+ type OverlayRenderFn<P> = (props: P & OverlayInjectedProps) => React.ReactNode;
28
+ /** Options for `createOverlayManager`. */
29
+ interface OverlayManagerOptions<P> {
30
+ /** Default props merged under every entry's caller-supplied props. */
31
+ props?: Partial<P>;
32
+ }
33
+ /** Public instance returned from `createOverlayManager`. */
34
+ interface OverlayManagerInstance<P> {
35
+ /** Opens (or replaces) the overlay entry under `id`. */
36
+ open: (id: string, props: P) => void;
37
+ /**
38
+ * Begins closing the entry (sets injected `open` to false). The entry is not removed until
39
+ * the overlay's exit transition completes — this lets exit animations finish. Pass no `id`
40
+ * to close every open entry.
41
+ */
42
+ close: (id?: string) => void;
43
+ /**
44
+ * Updates the props of an existing overlay entry. Manager-owned keys (`open`, `onOpenChange`,
45
+ * `onExitComplete`, `overlayId`) are stripped to prevent accidental clobbering.
46
+ */
47
+ update: (id: string, props: Partial<P>) => void;
48
+ /** Removes an entry immediately, skipping the exit animation. */
49
+ remove: (id: string) => void;
50
+ /** Removes every entry immediately. */
51
+ removeAll: () => void;
52
+ /** Whether the entry under `id` is currently open. */
53
+ isOpen: (id: string) => boolean;
54
+ /** Whether any entry is currently open. */
55
+ isAnyOpen: () => boolean;
56
+ /** Returns the user-supplied props for the entry under `id`, or undefined if not found. */
57
+ get: (id: string) => P | undefined;
58
+ /** Returns a snapshot of all current entries (id, open, props). */
59
+ getSnapshot: () => readonly OverlayEntry<P>[];
60
+ /** Replaces the render function. Useful for HMR or per-route render swaps. */
61
+ setRender: (render: OverlayRenderFn<P>) => void;
62
+ /** Renderer component. Mount as `<instance.Viewport />` once in the layout. */
63
+ Viewport: React.ComponentType;
64
+ }
65
+ /**
66
+ * Creates an overlay manager. Mount `<instance.Viewport />` once in the layout, then call
67
+ * `instance.open(id, props)` from anywhere to drive overlays imperatively.
68
+ *
69
+ * @example
70
+ * ```tsx
71
+ * const dialog = createOverlayManager<{ title: string }>(
72
+ * ({ title, ...rest }) => <Dialog.Root {...rest}>{title}</Dialog.Root>
73
+ * );
74
+ *
75
+ * // Layout
76
+ * <dialog.Viewport />
77
+ *
78
+ * // Anywhere
79
+ * dialog.open('greeting', { title: 'Hi' });
80
+ * ```
81
+ */
82
+ declare function createOverlayManager<P extends Record<string, any> = Record<string, never>>(render: OverlayRenderFn<P>, options?: OverlayManagerOptions<P>): OverlayManagerInstance<P>;
83
+
84
+ export { type OverlayEntry, type OverlayInjectedProps, type OverlayManagerInstance, type OverlayManagerOptions, type OverlayOpenChangeEvent, type OverlayRenderFn, createOverlayManager };
@@ -0,0 +1,2 @@
1
+ var g=Object.defineProperty,O=Object.defineProperties;var m=Object.getOwnPropertyDescriptors;var P=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable;var f=(e,t,n)=>t in e?g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,p=(e,t)=>{for(var n in t||(t={}))R.call(t,n)&&f(e,n,t[n]);if(P)for(var n of P(t))h.call(t,n)&&f(e,n,t[n]);return e},c=(e,t)=>O(e,m(t));import*as a from"react";var E=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n].id!==t[n].id||e[n].open!==t[n].open)return!1;return!0};function S(){let e=new Map,t=new Set,n=[],l=[],d=()=>{let r=Array.from(e.values()),o=r.map(s=>({id:s.id,open:s.open}));return E(l,o)&&r.length===n.length&&!r.some((v,y)=>{var u;return v.props!==((u=n[y])==null?void 0:u.props)})?!1:(n=r,l=o,!0)},i=()=>{d()&&t.forEach(r=>r())};return{subscribe(r){return t.add(r),()=>{t.delete(r)}},getSnapshot(){return n},open(r,o){e.set(r,{id:r,props:o,open:!0}),i()},close(r){if(r===void 0){let s=!1;e.forEach((v,y)=>{v.open&&(e.set(y,c(p({},v),{open:!1})),s=!0)}),s&&i();return}let o=e.get(r);o!=null&&o.open&&(e.set(r,c(p({},o),{open:!1})),i())},remove(r){e.delete(r)&&i()},removeAll(){e.size!==0&&(e.clear(),i())},update(r,o){let s=e.get(r);s&&(e.set(r,c(p({},s),{props:p(p({},s.props),o)})),i())},getItem(r){return e.get(r)},isOpen(r){var o,s;return(s=(o=e.get(r))==null?void 0:o.open)!=null?s:!1},isAnyOpen(){for(let r of e.values())if(r.open)return!0;return!1}}}function b({item:e,store:t,render:n,defaults:l}){let[d,i]=a.useState(!1);a.useEffect(()=>{i(!0)},[]);let r=a.useCallback(s=>{s.value||t.close(e.id)},[e.id,t]),o=a.useCallback(()=>{t.remove(e.id)},[e.id,t]);return a.createElement(a.Fragment,null,n.current(c(p(p({},l.current),e.props),{overlayId:e.id,open:d?e.open:!1,onOpenChange:r,onExitComplete:o})))}var I=(e,t,n)=>{let l=()=>{let d=a.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot);return a.createElement(a.Fragment,null,d.map(i=>a.createElement(b,{key:i.id,item:i,store:e,render:t,defaults:n})))};return l.displayName="OverlayManagerRender",l},C=["open","onOpenChange","onExitComplete","overlayId"];function x(e){let t=p({},e);for(let n of C)delete t[n];return t}function M(e,t={}){let n=S(),l={current:e},d={current:t.props},i=I(n,l,d);return{open:n.open,close:n.close,remove:n.remove,removeAll:n.removeAll,update:(r,o)=>n.update(r,x(o)),isOpen:n.isOpen,isAnyOpen:n.isAnyOpen,get:r=>{var o;return(o=n.getItem(r))==null?void 0:o.props},getSnapshot:n.getSnapshot,setRender:r=>{l.current=r},Viewport:i}}export{M as createOverlayManager};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/overlay-manager/OverlayManager.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport interface OverlayOpenChangeEvent {\n value: boolean | undefined;\n}\n\nexport interface OverlayEntry<P> {\n id: string;\n props: P;\n open: boolean;\n}\n\ntype OverlayItem<P> = OverlayEntry<P>;\n\ninterface OverlaySnapshotEntry {\n id: string;\n open: boolean;\n}\n\ninterface OverlayStore<P> {\n subscribe(listener: () => void): () => void;\n getSnapshot(): OverlayItem<P>[];\n open(id: string, props: P): void;\n close(id?: string): void;\n remove(id: string): void;\n removeAll(): void;\n update(id: string, props: Partial<P>): void;\n getItem(id: string): OverlayItem<P> | undefined;\n isOpen(id: string): boolean;\n isAnyOpen(): boolean;\n}\n\nconst isShallowEqualEntries = (prev: OverlaySnapshotEntry[], next: OverlaySnapshotEntry[]): boolean => {\n if (prev.length !== next.length) return false;\n\n for (let i = 0; i < prev.length; i++) {\n if (prev[i].id !== next[i].id || prev[i].open !== next[i].open) return false;\n }\n\n return true;\n};\n\nfunction createOverlayStore<P>(): OverlayStore<P> {\n const items = new Map<string, OverlayItem<P>>();\n const listeners = new Set<() => void>();\n let snapshot: OverlayItem<P>[] = [];\n let lastEntries: OverlaySnapshotEntry[] = [];\n\n const buildSnapshot = (): boolean => {\n const next = Array.from(items.values());\n const entries = next.map((item) => ({ id: item.id, open: item.open }));\n\n if (isShallowEqualEntries(lastEntries, entries) && next.length === snapshot.length) {\n // Items array updated but identity-stable (same ids + open states + props refs).\n // Still update props references so renders see latest props.\n const propsChanged = next.some((item, i) => item.props !== snapshot[i]?.props);\n\n if (!propsChanged) return false;\n }\n\n snapshot = next;\n lastEntries = entries;\n\n return true;\n };\n\n const emit = () => {\n if (buildSnapshot()) {\n listeners.forEach((l) => l());\n }\n };\n\n return {\n subscribe(listener) {\n listeners.add(listener);\n\n return () => {\n listeners.delete(listener);\n };\n },\n getSnapshot() {\n return snapshot;\n },\n open(id, props) {\n items.set(id, { id, props, open: true });\n emit();\n },\n close(id) {\n if (id === undefined) {\n let changed = false;\n\n items.forEach((item, key) => {\n if (item.open) {\n items.set(key, { ...item, open: false });\n changed = true;\n }\n });\n\n if (changed) emit();\n\n return;\n }\n\n const item = items.get(id);\n\n if (!item?.open) return;\n\n items.set(id, { ...item, open: false });\n emit();\n },\n remove(id) {\n if (items.delete(id)) emit();\n },\n removeAll() {\n if (items.size === 0) return;\n\n items.clear();\n emit();\n },\n update(id, props) {\n const item = items.get(id);\n\n if (!item) return;\n\n items.set(id, { ...item, props: { ...item.props, ...props } });\n emit();\n },\n getItem(id) {\n return items.get(id);\n },\n isOpen(id) {\n return items.get(id)?.open ?? false;\n },\n isAnyOpen() {\n for (const item of items.values()) if (item.open) return true;\n\n return false;\n }\n };\n}\n\n/**\n * Props the manager injects into every overlay's prop bag. Spread these onto the overlay's\n * root component (e.g. `<Dialog.Root {...rest}>`) — the manager owns open state and lifecycle,\n * so the render function should not wire any of these manually.\n */\nexport interface OverlayInjectedProps {\n /** Stable id of the overlay entry. */\n overlayId: string;\n /** Whether the overlay should currently be open. The manager owns this value. */\n open: boolean;\n /** Fired by the overlay when its open state changes. The manager listens for `value: false` to begin closing the entry. */\n onOpenChange: (event: OverlayOpenChangeEvent) => void;\n /** Fired by the overlay once its leave transition completes. The manager removes the entry from the store. */\n onExitComplete: () => void;\n}\n\n/** Render function passed to `createOverlayManager`. */\nexport type OverlayRenderFn<P> = (props: P & OverlayInjectedProps) => React.ReactNode;\n\n/** Options for `createOverlayManager`. */\nexport interface OverlayManagerOptions<P> {\n /** Default props merged under every entry's caller-supplied props. */\n props?: Partial<P>;\n}\n\n/** Public instance returned from `createOverlayManager`. */\nexport interface OverlayManagerInstance<P> {\n /** Opens (or replaces) the overlay entry under `id`. */\n open: (id: string, props: P) => void;\n /**\n * Begins closing the entry (sets injected `open` to false). The entry is not removed until\n * the overlay's exit transition completes — this lets exit animations finish. Pass no `id`\n * to close every open entry.\n */\n close: (id?: string) => void;\n /**\n * Updates the props of an existing overlay entry. Manager-owned keys (`open`, `onOpenChange`,\n * `onExitComplete`, `overlayId`) are stripped to prevent accidental clobbering.\n */\n update: (id: string, props: Partial<P>) => void;\n /** Removes an entry immediately, skipping the exit animation. */\n remove: (id: string) => void;\n /** Removes every entry immediately. */\n removeAll: () => void;\n /** Whether the entry under `id` is currently open. */\n isOpen: (id: string) => boolean;\n /** Whether any entry is currently open. */\n isAnyOpen: () => boolean;\n /** Returns the user-supplied props for the entry under `id`, or undefined if not found. */\n get: (id: string) => P | undefined;\n /** Returns a snapshot of all current entries (id, open, props). */\n getSnapshot: () => readonly OverlayEntry<P>[];\n /** Replaces the render function. Useful for HMR or per-route render swaps. */\n setRender: (render: OverlayRenderFn<P>) => void;\n /** Renderer component. Mount as `<instance.Viewport />` once in the layout. */\n Viewport: React.ComponentType;\n}\n\ninterface OverlayItemRendererProps<P> {\n item: OverlayItem<P>;\n store: OverlayStore<P>;\n render: { current: OverlayRenderFn<P> };\n defaults: { current: Partial<P> | undefined };\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction OverlayItemRenderer<P extends Record<string, any>>({ item, store, render, defaults }: OverlayItemRendererProps<P>) {\n const [mounted, setMounted] = React.useState(false);\n\n React.useEffect(() => {\n setMounted(true);\n }, []);\n\n const onOpenChange = React.useCallback(\n (event: OverlayOpenChangeEvent) => {\n if (!event.value) store.close(item.id);\n },\n [item.id, store]\n );\n\n const onExitComplete = React.useCallback(() => {\n store.remove(item.id);\n }, [item.id, store]);\n\n return (\n <>\n {render.current({\n ...(defaults.current as P | undefined),\n ...item.props,\n overlayId: item.id,\n open: mounted ? item.open : false,\n onOpenChange,\n onExitComplete\n } as P & OverlayInjectedProps)}\n </>\n );\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst buildRenderComponent = <P extends Record<string, any>>(store: OverlayStore<P>, renderHolder: { current: OverlayRenderFn<P> }, defaultsHolder: { current: Partial<P> | undefined }): React.ComponentType => {\n const OverlayManagerRender: React.FC = () => {\n const items = React.useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);\n\n return (\n <>\n {items.map((item) => (\n <OverlayItemRenderer key={item.id} item={item} store={store} render={renderHolder} defaults={defaultsHolder} />\n ))}\n </>\n );\n };\n\n OverlayManagerRender.displayName = 'OverlayManagerRender';\n\n return OverlayManagerRender;\n};\n\nconst RESERVED_KEYS = ['open', 'onOpenChange', 'onExitComplete', 'overlayId'] as const;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AnyProps = Record<string, any>;\n\nfunction stripReservedKeys<P extends AnyProps>(props: Partial<P>): Partial<P> {\n const next = { ...props } as AnyProps;\n\n for (const key of RESERVED_KEYS) delete next[key];\n\n return next as Partial<P>;\n}\n\n/**\n * Creates an overlay manager. Mount `<instance.Viewport />` once in the layout, then call\n * `instance.open(id, props)` from anywhere to drive overlays imperatively.\n *\n * @example\n * ```tsx\n * const dialog = createOverlayManager<{ title: string }>(\n * ({ title, ...rest }) => <Dialog.Root {...rest}>{title}</Dialog.Root>\n * );\n *\n * // Layout\n * <dialog.Viewport />\n *\n * // Anywhere\n * dialog.open('greeting', { title: 'Hi' });\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function createOverlayManager<P extends Record<string, any> = Record<string, never>>(render: OverlayRenderFn<P>, options: OverlayManagerOptions<P> = {}): OverlayManagerInstance<P> {\n const store = createOverlayStore<P>();\n const renderHolder = { current: render };\n const defaultsHolder = { current: options.props };\n const Viewport = buildRenderComponent(store, renderHolder, defaultsHolder);\n\n return {\n open: store.open,\n close: store.close,\n remove: store.remove,\n removeAll: store.removeAll,\n update: (id, props) => store.update(id, stripReservedKeys(props)),\n isOpen: store.isOpen,\n isAnyOpen: store.isAnyOpen,\n get: (id) => store.getItem(id)?.props,\n getSnapshot: store.getSnapshot,\n setRender: (next) => {\n renderHolder.current = next;\n },\n Viewport\n };\n}\n"],"mappings":"6aAAA,UAAYA,MAAW,QAgCvB,IAAMC,EAAwB,CAACC,EAA8BC,IAA0C,CACnG,GAAID,EAAK,SAAWC,EAAK,OAAQ,MAAO,GAExC,QAASC,EAAI,EAAGA,EAAIF,EAAK,OAAQE,IAC7B,GAAIF,EAAKE,CAAC,EAAE,KAAOD,EAAKC,CAAC,EAAE,IAAMF,EAAKE,CAAC,EAAE,OAASD,EAAKC,CAAC,EAAE,KAAM,MAAO,GAG3E,MAAO,EACX,EAEA,SAASC,GAAyC,CAC9C,IAAMC,EAAQ,IAAI,IACZC,EAAY,IAAI,IAClBC,EAA6B,CAAC,EAC9BC,EAAsC,CAAC,EAErCC,EAAgB,IAAe,CACjC,IAAMP,EAAO,MAAM,KAAKG,EAAM,OAAO,CAAC,EAChCK,EAAUR,EAAK,IAAKS,IAAU,CAAE,GAAIA,EAAK,GAAI,K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B,IAAKZ,EAAK,GAAI,KAAMA,EAAM,MAAOa,EAAO,OAAQS,EAAc,SAAUC,EAAgB,CAChH,CACL,CAER,EAEA,OAAAC,EAAqB,YAAc,uBAE5BA,CACX,EAEMC,EAAgB,CAAC,OAAQ,eAAgB,iBAAkB,WAAW,EAK5E,SAASC,EAAsCpB,EAA+B,CAC1E,IAAMf,EAAOmB,EAAA,GAAKJ,GAElB,QAAWE,KAAOiB,EAAe,OAAOlC,EAAKiB,CAAG,EAEhD,OAAOjB,CACX,CAoBO,SAASoC,EAA4Eb,EAA4Bc,EAAoC,CAAC,EAA8B,CACvL,IAAMf,EAAQpB,EAAsB,EAC9B6B,EAAe,CAAE,QAASR,CAAO,EACjCS,EAAiB,CAAE,QAASK,EAAQ,KAAM,EAC1CC,EAAWR,EAAqBR,EAAOS,EAAcC,CAAc,EAEzE,MAAO,CACH,KAAMV,EAAM,KACZ,MAAOA,EAAM,MACb,OAAQA,EAAM,OACd,UAAWA,EAAM,UACjB,OAAQ,CAACR,EAAIC,IAAUO,EAAM,OAAOR,EAAIqB,EAAkBpB,CAAK,CAAC,EAChE,OAAQO,EAAM,OACd,UAAWA,EAAM,UACjB,IAAMR,GAAI,CA/SlB,IAAAJ,EA+SqB,OAAAA,EAAAY,EAAM,QAAQR,CAAE,IAAhB,YAAAJ,EAAmB,OAChC,YAAaY,EAAM,YACnB,UAAYtB,GAAS,CACjB+B,EAAa,QAAU/B,CAC3B,EACA,SAAAsC,CACJ,CACJ","names":["React","isShallowEqualEntries","prev","next","i","createOverlayStore","items","listeners","snapshot","lastEntries","buildSnapshot","entries","item","_a","emit","l","listener","id","props","changed","key","__spreadProps","__spreadValues","_b","OverlayItemRenderer","store","render","defaults","mounted","setMounted","onOpenChange","event","onExitComplete","buildRenderComponent","renderHolder","defaultsHolder","OverlayManagerRender","RESERVED_KEYS","stripReservedKeys","createOverlayManager","options","Viewport"]}
package/package.json CHANGED
@@ -1,17 +1,12 @@
1
1
  {
2
2
  "name": "@primereact/core",
3
- "version": "11.0.0-alpha.9",
3
+ "version": "11.0.0-rc.1",
4
4
  "author": "PrimeTek Informatics",
5
- "description": "",
6
- "homepage": "https://primereact.org/",
7
- "license": "MIT",
8
- "repository": {
9
- "type": "git",
10
- "url": "git+https://github.com/primefaces/primereact.git",
11
- "directory": "packages/core"
12
- },
5
+ "description": "Core components for PrimeReact.",
6
+ "homepage": "https://primereact.dev",
7
+ "license": "SEE LICENSE IN LICENSE.md",
13
8
  "bugs": {
14
- "url": "https://github.com/primefaces/primereact/issues"
9
+ "url": "https://support.primeui.dev"
15
10
  },
16
11
  "main": "./index.mjs",
17
12
  "module": "./index.mjs",
@@ -32,12 +27,15 @@
32
27
  "access": "public"
33
28
  },
34
29
  "dependencies": {
35
- "@primeuix/styled": "^0.7.4",
36
- "@primeuix/utils": "^0.6.2",
37
- "@primeuix/motion": "^0.0.10",
38
- "@primereact/hooks": "11.0.0-alpha.9"
30
+ "@primeui/license-manager": "^1.0.0-rc.1",
31
+ "@primeuix/styled": "^1.0.0-rc.1",
32
+ "@primeuix/utils": "^0.7.2",
33
+ "@primeuix/motion": "^1.0.0-rc.1",
34
+ "@primereact/hooks": "11.0.0-rc.1",
35
+ "@primereact/types": "11.0.0-rc.1"
39
36
  },
40
37
  "peerDependencies": {
41
38
  "react": ">=19.0.0"
42
- }
39
+ },
40
+ "repository": {}
43
41
  }
@@ -1,2 +1,2 @@
1
- var u=Object.getOwnPropertySymbols;var c=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;var h=(r,t)=>{var e={};for(var o in r)c.call(r,o)&&t.indexOf(o)<0&&(e[o]=r[o]);if(r!=null&&u)for(var o of u(r))t.indexOf(o)<0&&f.call(r,o)&&(e[o]=r[o]);return e};import{useProps as d}from"@primereact/hooks";import{resolve as g}from"@primeuix/utils";import*as s from"react";var P={value:void 0,mergeProps:!1,mergeSections:!0};var p=s.createContext(void 0),R=(r={})=>{let{props:t,attrs:e}=d(r,P),a=t,{value:o}=a,m=h(a,["value"]),n={value:o,options:m};return s.createElement(p.Provider,{value:n},g(e.children,n))};import*as i from"react";function E(){let r=i.useContext(p);if(r===void 0)throw new Error("Context must be used within a PassThroughProvider");return r}export{p as PassThroughContext,R as PassThroughProvider,P as defaultPTProps,E as usePassThrough};
1
+ import{useProps as c}from"@primereact/hooks";import{resolve as m}from"@primeuix/utils";import*as e from"react";var u={value:void 0,mergeProps:!1,mergeSections:!0};var t=e.createContext(void 0),T=(r={})=>{let{props:i,attrs:s}=c(u,r),{value:n,mergeProps:p,mergeSections:a}=i,o=e.useMemo(()=>({value:n,options:{mergeProps:p,mergeSections:a}}),[n,p,a]),P=e.useMemo(()=>m(s.children,o),[s.children,o]);return e.createElement(t.Provider,{value:o},P)};import*as h from"react";function R(){let r=h.useContext(t);if(r===void 0)throw new Error("Context must be used within a PassThroughProvider");return r}export{t as PassThroughContext,T as PassThroughProvider,u as defaultPTProps,R as usePassThrough};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/passthrough/PassThrough.context.tsx","../../src/passthrough/PassThrough.props.ts","../../src/passthrough/usePassThrough.ts"],"sourcesContent":["import { useProps } from '@primereact/hooks';\nimport type { PassThroughProps } from '@primereact/types/core';\nimport { resolve } from '@primeuix/utils';\nimport * as React from 'react';\nimport { defaultPTProps } from './PassThrough.props';\n\nexport const PassThroughContext = React.createContext<PassThroughProps | undefined>(undefined);\n\nexport const PassThroughProvider = (inProps: React.PropsWithChildren<PassThroughProps> = {}) => {\n const { props, attrs } = useProps(inProps, defaultPTProps as PassThroughProps);\n const { value, ...rest } = props;\n\n const pt = {\n value,\n options: rest\n };\n\n return <PassThroughContext.Provider value={pt}>{resolve(attrs.children, pt)}</PassThroughContext.Provider>;\n};\n","import type { PassThroughProps } from '@primereact/types/core';\n\nexport const defaultPTProps: PassThroughProps = {\n value: undefined,\n mergeProps: false,\n mergeSections: true\n};\n","import * as React from 'react';\nimport { PassThroughContext } from './PassThrough.context';\n\nexport function usePassThrough() {\n const context = React.useContext(PassThroughContext);\n\n if (context === undefined) {\n throw new Error('Context must be used within a PassThroughProvider');\n }\n\n return context;\n}\n"],"mappings":"mRAAA,OAAS,YAAAA,MAAgB,oBAEzB,OAAS,WAAAC,MAAe,kBACxB,UAAYC,MAAW,QCDhB,IAAMC,EAAmC,CAC5C,MAAO,OACP,WAAY,GACZ,cAAe,EACnB,EDAO,IAAMC,EAA2B,gBAA4C,MAAS,EAEhFC,EAAsB,CAACC,EAAqD,CAAC,IAAM,CAC5F,GAAM,CAAE,MAAAC,EAAO,MAAAC,CAAM,EAAIC,EAASH,EAASI,CAAkC,EAClDC,EAAAJ,EAAnB,OAAAK,CAVZ,EAU+BD,EAATE,EAAAC,EAASH,EAAT,CAAV,UAEFI,EAAK,CACP,MAAAH,EACA,QAASC,CACb,EAEA,OAAO,gBAACT,EAAmB,SAAnB,CAA4B,MAAOW,GAAKC,EAAQR,EAAM,SAAUO,CAAE,CAAE,CAChF,EElBA,UAAYE,MAAW,QAGhB,SAASC,GAAiB,CAC7B,IAAMC,EAAgB,aAAWC,CAAkB,EAEnD,GAAID,IAAY,OACZ,MAAM,IAAI,MAAM,mDAAmD,EAGvE,OAAOA,CACX","names":["useProps","resolve","React","defaultPTProps","PassThroughContext","PassThroughProvider","inProps","props","attrs","useProps","defaultPTProps","_a","value","rest","__objRest","pt","resolve","React","usePassThrough","context","PassThroughContext"]}
1
+ {"version":3,"sources":["../../src/passthrough/PassThrough.context.tsx","../../src/passthrough/PassThrough.props.ts","../../src/passthrough/usePassThrough.ts"],"sourcesContent":["'use client';\nimport { useProps } from '@primereact/hooks';\nimport type { PassThroughProps } from '@primereact/types/core';\nimport { resolve } from '@primeuix/utils';\nimport * as React from 'react';\nimport { defaultPTProps } from './PassThrough.props';\n\nexport const PassThroughContext = React.createContext<PassThroughProps | undefined>(undefined);\n\nexport const PassThroughProvider = (inProps: React.PropsWithChildren<PassThroughProps> = {}) => {\n const { props, attrs } = useProps(defaultPTProps as PassThroughProps, inProps);\n const { value, mergeProps, mergeSections } = props;\n\n const pt = React.useMemo(\n () => ({\n value,\n options: {\n mergeProps,\n mergeSections\n }\n }),\n [value, mergeProps, mergeSections]\n );\n\n const resolvedChildren = React.useMemo(() => resolve(attrs.children, pt) as React.ReactNode, [attrs.children, pt]);\n\n return <PassThroughContext.Provider value={pt}>{resolvedChildren}</PassThroughContext.Provider>;\n};\n","import type { PassThroughProps } from '@primereact/types/core';\n\nexport const defaultPTProps: PassThroughProps = {\n value: undefined,\n mergeProps: false,\n mergeSections: true\n};\n","import * as React from 'react';\nimport { PassThroughContext } from './PassThrough.context';\n\nexport function usePassThrough() {\n const context = React.useContext(PassThroughContext);\n\n if (context === undefined) {\n throw new Error('Context must be used within a PassThroughProvider');\n }\n\n return context;\n}\n"],"mappings":"AACA,OAAS,YAAAA,MAAgB,oBAEzB,OAAS,WAAAC,MAAe,kBACxB,UAAYC,MAAW,QCFhB,IAAMC,EAAmC,CAC5C,MAAO,OACP,WAAY,GACZ,cAAe,EACnB,EDCO,IAAMC,EAA2B,gBAA4C,MAAS,EAEhFC,EAAsB,CAACC,EAAqD,CAAC,IAAM,CAC5F,GAAM,CAAE,MAAAC,EAAO,MAAAC,CAAM,EAAIC,EAASC,EAAoCJ,CAAO,EACvE,CAAE,MAAAK,EAAO,WAAAC,EAAY,cAAAC,CAAc,EAAIN,EAEvCO,EAAW,UACb,KAAO,CACH,MAAAH,EACA,QAAS,CACL,WAAAC,EACA,cAAAC,CACJ,CACJ,GACA,CAACF,EAAOC,EAAYC,CAAa,CACrC,EAEME,EAAyB,UAAQ,IAAMC,EAAQR,EAAM,SAAUM,CAAE,EAAsB,CAACN,EAAM,SAAUM,CAAE,CAAC,EAEjH,OAAO,gBAACV,EAAmB,SAAnB,CAA4B,MAAOU,GAAKC,CAAiB,CACrE,EE3BA,UAAYE,MAAW,QAGhB,SAASC,GAAiB,CAC7B,IAAMC,EAAgB,aAAWC,CAAkB,EAEnD,GAAID,IAAY,OACZ,MAAM,IAAI,MAAM,mDAAmD,EAGvE,OAAOA,CACX","names":["useProps","resolve","React","defaultPTProps","PassThroughContext","PassThroughProvider","inProps","props","attrs","useProps","defaultPTProps","value","mergeProps","mergeSections","pt","resolvedChildren","resolve","React","usePassThrough","context","PassThroughContext"]}
package/theme/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- var l=Object.defineProperty;var m=Object.getOwnPropertySymbols;var h=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;var f=(e,t,r)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,u=(e,t)=>{for(var r in t||(t={}))h.call(t,r)&&f(e,r,t[r]);if(m)for(var r of m(t))a.call(t,r)&&f(e,r,t[r]);return e};var d=(e,t)=>{var r={};for(var o in e)h.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&m)for(var o of m(e))t.indexOf(o)<0&&a.call(e,o)&&(r[o]=e[o]);return r};import{useProps as P}from"@primereact/hooks";import{Theme as y}from"@primeuix/styled";import{resolve as v}from"@primeuix/utils";import*as s from"react";var x={preset:void 0,prefix:"p",darkModeSelector:"system",cssLayer:!1,stylesheet:void 0};var p=s.createContext(null),L=(e={})=>{let{props:t}=P(e,x),c=t,{stylesheet:r,preset:o}=c,n=d(c,["stylesheet","preset"]),i=u({preset:o,stylesheet:r},n);return y.setTheme({preset:o,options:n}),s.createElement(p.Provider,{value:i},v(e.children,i))};import*as T from"react";function j(){let e=T.useContext(p);if(e===void 0)throw new Error("Context must be used within a ThemeProvider");return e}export{p as ThemeContext,L as ThemeProvider,x as defaultThemeProps,j as useTheme};
1
+ var S=Object.defineProperty;var m=Object.getOwnPropertySymbols;var d=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;var l=(e,r,t)=>r in e?S(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,h=(e,r)=>{for(var t in r||(r={}))d.call(r,t)&&l(e,t,r[t]);if(m)for(var t of m(r))u.call(r,t)&&l(e,t,r[t]);return e};var y=(e,r)=>{var t={};for(var o in e)d.call(e,o)&&r.indexOf(o)<0&&(t[o]=e[o]);if(e!=null&&m)for(var o of m(e))r.indexOf(o)<0&&u.call(e,o)&&(t[o]=e[o]);return t};import{styles as C}from"@primereact/core/icon";import{addStylePreloadsToStyleSheet as R,StylePreloadRegistry as p,upsertStylePreloadsToHead as v}from"@primereact/core/utils";import{useProps as g}from"@primereact/hooks";import{css as b,Theme as w}from"@primeuix/styled";import{isClient as x,isNotEmpty as E,minifyCSS as M,resolve as F}from"@primeuix/utils";import*as s from"react";var T={preset:void 0,prefix:"p",darkModeSelector:"system",cssLayer:!1,cssVariables:!0,scoped:!1,stylesheet:void 0};var n=s.createContext(null),q=(e={})=>{let{props:r}=g(T,e),f=r,{stylesheet:t,preset:o}=f,c=y(f,["stylesheet","preset"]),a=h({preset:o,stylesheet:t},c);w.setTheme({preset:o,options:c});let i=s.useMemo(()=>M(b`${C.css}`)||"",[]);return s.useMemo(()=>{E(i)&&p.register({id:"icon",css:i,phase:"both",priority:10})},[i]),x()||R(t,p.getForSSR()),s.useInsertionEffect(()=>{x()&&v(p.getForClient())},[]),s.createElement(n.Provider,{value:a},F(e.children,a))};import*as P from"react";function D(){let e=P.useContext(n);if(e===void 0)throw new Error("Context must be used within a ThemeProvider");return e}export{n as ThemeContext,q as ThemeProvider,T as defaultThemeProps,D as useTheme};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/theme/Theme.context.tsx","../../src/theme/Theme.props.ts","../../src/theme/useTheme.ts"],"sourcesContent":["import { useProps } from '@primereact/hooks';\nimport type { ThemeProps } from '@primereact/types/core';\nimport { Theme } from '@primeuix/styled';\nimport { resolve } from '@primeuix/utils';\nimport * as React from 'react';\nimport { defaultThemeProps } from './Theme.props';\n\nexport const ThemeContext = React.createContext<ThemeProps | null>(null);\n\nexport const ThemeProvider = (inProps: ThemeProps = {}) => {\n const { props } = useProps(inProps, defaultThemeProps);\n const { stylesheet, preset, ...rest } = props;\n\n const value = {\n preset,\n stylesheet,\n ...rest\n };\n\n Theme.setTheme({ preset, options: rest });\n\n return <ThemeContext.Provider value={value}>{resolve(inProps.children, value)}</ThemeContext.Provider>;\n};\n","import type { ThemeProps } from '@primereact/types/core';\n\nexport const defaultThemeProps: ThemeProps = {\n preset: undefined,\n prefix: 'p',\n darkModeSelector: 'system',\n cssLayer: false,\n stylesheet: undefined\n};\n","import * as React from 'react';\nimport { ThemeContext } from './Theme.context';\n\nexport function useTheme() {\n const context = React.useContext(ThemeContext);\n\n if (context === undefined) {\n throw new Error('Context must be used within a ThemeProvider');\n }\n\n return context;\n}\n"],"mappings":"2fAAA,OAAS,YAAAA,MAAgB,oBAEzB,OAAS,SAAAC,MAAa,mBACtB,OAAS,WAAAC,MAAe,kBACxB,UAAYC,MAAW,QCFhB,IAAMC,EAAgC,CACzC,OAAQ,OACR,OAAQ,IACR,iBAAkB,SAClB,SAAU,GACV,WAAY,MAChB,EDDO,IAAMC,EAAqB,gBAAiC,IAAI,EAE1DC,EAAgB,CAACC,EAAsB,CAAC,IAAM,CACvD,GAAM,CAAE,MAAAC,CAAM,EAAIC,EAASF,EAASG,CAAiB,EACbC,EAAAH,EAAhC,YAAAI,EAAY,OAAAC,CAXxB,EAW4CF,EAATG,EAAAC,EAASJ,EAAT,CAAvB,aAAY,WAEdK,EAAQC,EAAA,CACV,OAAAJ,EACA,WAAAD,GACGE,GAGP,OAAAI,EAAM,SAAS,CAAE,OAAAL,EAAQ,QAASC,CAAK,CAAC,EAEjC,gBAACT,EAAa,SAAb,CAAsB,MAAOW,GAAQG,EAAQZ,EAAQ,SAAUS,CAAK,CAAE,CAClF,EEtBA,UAAYI,MAAW,QAGhB,SAASC,GAAW,CACvB,IAAMC,EAAgB,aAAWC,CAAY,EAE7C,GAAID,IAAY,OACZ,MAAM,IAAI,MAAM,6CAA6C,EAGjE,OAAOA,CACX","names":["useProps","Theme","resolve","React","defaultThemeProps","ThemeContext","ThemeProvider","inProps","props","useProps","defaultThemeProps","_a","stylesheet","preset","rest","__objRest","value","__spreadValues","Theme","resolve","React","useTheme","context","ThemeContext"]}
1
+ {"version":3,"sources":["../../src/theme/Theme.context.tsx","../../src/theme/Theme.props.ts","../../src/theme/useTheme.ts"],"sourcesContent":["'use client';\nimport { styles as iconStyles } from '@primereact/core/icon';\nimport { addStylePreloadsToStyleSheet, StylePreloadRegistry, upsertStylePreloadsToHead } from '@primereact/core/utils';\nimport { useProps } from '@primereact/hooks';\nimport type { ThemeProps } from '@primereact/types/core';\nimport { css as Css, Theme } from '@primeuix/styled';\nimport { isClient, isNotEmpty, minifyCSS, resolve } from '@primeuix/utils';\nimport * as React from 'react';\nimport { defaultThemeProps } from './Theme.props';\n\nexport const ThemeContext = React.createContext<ThemeProps | null>(null);\n\nexport const ThemeProvider = (inProps: ThemeProps = {}) => {\n const { props } = useProps(defaultThemeProps, inProps);\n const { stylesheet, preset, ...rest } = props;\n\n const value = {\n preset,\n stylesheet,\n ...rest\n };\n\n Theme.setTheme({ preset, options: rest });\n\n const iconPreloadCSS = React.useMemo(() => minifyCSS(Css`${iconStyles.css}` as string) || '', []);\n\n React.useMemo(() => {\n if (isNotEmpty(iconPreloadCSS)) {\n StylePreloadRegistry.register({\n id: 'icon',\n css: iconPreloadCSS,\n phase: 'both',\n priority: 10\n });\n }\n }, [iconPreloadCSS]);\n\n if (!isClient()) {\n addStylePreloadsToStyleSheet(stylesheet, StylePreloadRegistry.getForSSR());\n }\n\n React.useInsertionEffect(() => {\n if (!isClient()) {\n return;\n }\n\n upsertStylePreloadsToHead(StylePreloadRegistry.getForClient());\n }, []);\n\n return <ThemeContext.Provider value={value}>{resolve(inProps.children, value)}</ThemeContext.Provider>;\n};\n","import type { ThemeProps } from '@primereact/types/core';\n\nexport const defaultThemeProps: ThemeProps = {\n preset: undefined,\n prefix: 'p',\n darkModeSelector: 'system',\n cssLayer: false,\n cssVariables: true,\n scoped: false,\n stylesheet: undefined\n};\n","import * as React from 'react';\nimport { ThemeContext } from './Theme.context';\n\nexport function useTheme() {\n const context = React.useContext(ThemeContext);\n\n if (context === undefined) {\n throw new Error('Context must be used within a ThemeProvider');\n }\n\n return context;\n}\n"],"mappings":"2fACA,OAAS,UAAUA,MAAkB,wBACrC,OAAS,gCAAAC,EAA8B,wBAAAC,EAAsB,6BAAAC,MAAiC,yBAC9F,OAAS,YAAAC,MAAgB,oBAEzB,OAAS,OAAOC,EAAK,SAAAC,MAAa,mBAClC,OAAS,YAAAC,EAAU,cAAAC,EAAY,aAAAC,EAAW,WAAAC,MAAe,kBACzD,UAAYC,MAAW,QCLhB,IAAMC,EAAgC,CACzC,OAAQ,OACR,OAAQ,IACR,iBAAkB,SAClB,SAAU,GACV,aAAc,GACd,OAAQ,GACR,WAAY,MAChB,EDAO,IAAMC,EAAqB,gBAAiC,IAAI,EAE1DC,EAAgB,CAACC,EAAsB,CAAC,IAAM,CACvD,GAAM,CAAE,MAAAC,CAAM,EAAIC,EAASC,EAAmBH,CAAO,EACbI,EAAAH,EAAhC,YAAAI,EAAY,OAAAC,CAdxB,EAc4CF,EAATG,EAAAC,EAASJ,EAAT,CAAvB,aAAY,WAEdK,EAAQC,EAAA,CACV,OAAAJ,EACA,WAAAD,GACGE,GAGPI,EAAM,SAAS,CAAE,OAAAL,EAAQ,QAASC,CAAK,CAAC,EAExC,IAAMK,EAAuB,UAAQ,IAAMC,EAAUC,IAAMC,EAAW,GAAG,EAAY,GAAK,GAAI,CAAC,CAAC,EAEhG,OAAM,UAAQ,IAAM,CACZC,EAAWJ,CAAc,GACzBK,EAAqB,SAAS,CAC1B,GAAI,OACJ,IAAKL,EACL,MAAO,OACP,SAAU,EACd,CAAC,CAET,EAAG,CAACA,CAAc,CAAC,EAEdM,EAAS,GACVC,EAA6Bd,EAAYY,EAAqB,UAAU,CAAC,EAGvE,qBAAmB,IAAM,CACtBC,EAAS,GAIdE,EAA0BH,EAAqB,aAAa,CAAC,CACjE,EAAG,CAAC,CAAC,EAEE,gBAACnB,EAAa,SAAb,CAAsB,MAAOW,GAAQY,EAAQrB,EAAQ,SAAUS,CAAK,CAAE,CAClF,EElDA,UAAYa,MAAW,QAGhB,SAASC,GAAW,CACvB,IAAMC,EAAgB,aAAWC,CAAY,EAE7C,GAAID,IAAY,OACZ,MAAM,IAAI,MAAM,6CAA6C,EAGjE,OAAOA,CACX","names":["iconStyles","addStylePreloadsToStyleSheet","StylePreloadRegistry","upsertStylePreloadsToHead","useProps","Css","Theme","isClient","isNotEmpty","minifyCSS","resolve","React","defaultThemeProps","ThemeContext","ThemeProvider","inProps","props","useProps","defaultThemeProps","_a","stylesheet","preset","rest","__objRest","value","__spreadValues","Theme","iconPreloadCSS","minifyCSS","Css","iconStyles","isNotEmpty","StylePreloadRegistry","isClient","addStylePreloadsToStyleSheet","upsertStylePreloadsToHead","resolve","React","useTheme","context","ThemeContext"]}