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

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 (120) hide show
  1. package/LICENSE.md +45 -0
  2. package/README.md +43 -0
  3. package/api/{index.d.mts → FilterMatchMode.d.ts} +2 -10
  4. package/api/FilterOperator.d.ts +5 -0
  5. package/api/index.d.ts +2 -0
  6. package/api/index.mjs +0 -1
  7. package/base/index.d.ts +1 -0
  8. package/base/index.mjs +1 -2
  9. package/base/{index.d.mts → useBase.d.ts} +3 -6
  10. package/component/Component.d.ts +11 -0
  11. package/component/Component.props.d.ts +3 -0
  12. package/component/Component.utils.d.ts +12 -0
  13. package/component/index.d.ts +4 -0
  14. package/component/index.mjs +1 -2
  15. package/component/useComponent.d.ts +30 -0
  16. package/component/useComponentPT.d.ts +9 -0
  17. package/component/useComponentStyle.d.ts +10 -0
  18. package/component/useComponentStyleHandler.d.ts +51 -0
  19. package/component/withComponent.d.ts +22 -0
  20. package/config/PrimeReact.context.d.ts +4 -0
  21. package/config/PrimeReact.props.d.ts +2 -0
  22. package/config/index.d.ts +3 -0
  23. package/config/index.mjs +3 -2
  24. package/config/usePrimeReact.d.ts +6 -0
  25. package/dnd/announcements.d.ts +5 -0
  26. package/dnd/collision.d.ts +39 -0
  27. package/dnd/createDnd.d.ts +15 -0
  28. package/dnd/index.d.ts +3 -0
  29. package/dnd/index.mjs +1 -0
  30. package/dnd/sortable.d.ts +56 -0
  31. package/dnd/utils.d.ts +21 -0
  32. package/headless/index.d.ts +2 -0
  33. package/headless/index.mjs +1 -2
  34. package/headless/useHeadless.d.ts +9 -0
  35. package/headless/withHeadless.d.ts +15 -0
  36. package/icon/Icon.d.ts +2 -0
  37. package/icon/Icon.props.d.ts +2 -0
  38. package/icon/Icon.style.d.ts +2 -0
  39. package/icon/index.d.ts +5 -0
  40. package/icon/index.mjs +2 -46
  41. package/icon/useIcon.d.ts +6 -0
  42. package/icon/withIcon.d.ts +22 -0
  43. package/{index.d.mts → index.d.ts} +4 -0
  44. package/index.mjs +1 -2
  45. package/license/index.d.ts +1 -0
  46. package/license/index.mjs +1 -0
  47. package/license/licensebanner.d.ts +20 -0
  48. package/locale/Locale.context.d.ts +4 -0
  49. package/locale/Locale.props.d.ts +2 -0
  50. package/locale/defaultLocale.d.ts +125 -0
  51. package/locale/index.d.ts +5 -0
  52. package/locale/index.mjs +3 -2
  53. package/locale/useLocale.d.ts +6 -0
  54. package/motion/Motion.context.d.ts +5 -0
  55. package/motion/Motion.d.ts +2 -0
  56. package/motion/Motion.props.d.ts +2 -0
  57. package/motion/Motion.utils.d.ts +4 -0
  58. package/motion/index.d.ts +5 -0
  59. package/motion/index.mjs +3 -2
  60. package/motion/useMotion.d.ts +23 -0
  61. package/motion/useMotion.props.d.ts +2 -0
  62. package/overlay-manager/OverlayManager.d.ts +81 -0
  63. package/overlay-manager/index.d.ts +1 -0
  64. package/overlay-manager/index.mjs +1 -0
  65. package/package.json +19 -18
  66. package/passthrough/PassThrough.context.d.ts +4 -0
  67. package/passthrough/PassThrough.props.d.ts +2 -0
  68. package/passthrough/index.d.ts +3 -0
  69. package/passthrough/index.mjs +3 -2
  70. package/passthrough/usePassThrough.d.ts +1 -0
  71. package/stylesheet/PrimeReactStyleSheet.d.ts +7 -0
  72. package/stylesheet/index.d.ts +1 -0
  73. package/stylesheet/index.mjs +1 -2
  74. package/theme/Theme.context.d.ts +4 -0
  75. package/theme/Theme.props.d.ts +2 -0
  76. package/theme/index.d.ts +3 -0
  77. package/theme/index.mjs +3 -2
  78. package/theme/useTheme.d.ts +1 -0
  79. package/umd/index.js +9 -213
  80. package/use-style/index.d.ts +2 -0
  81. package/use-style/index.mjs +1 -2
  82. package/use-style/useStyle.d.ts +2 -0
  83. package/use-style/useStyle.props.d.ts +1 -0
  84. package/utils/ConnectedOverlayScrollHandler.d.ts +10 -0
  85. package/utils/combinedRefs.d.ts +2 -0
  86. package/utils/createContext.d.ts +9 -0
  87. package/utils/env.d.ts +1 -0
  88. package/utils/index.d.ts +10 -0
  89. package/utils/index.mjs +3 -2
  90. package/utils/mergeRefs.d.ts +11 -0
  91. package/utils/overlayEventBus.d.ts +9 -0
  92. package/utils/stylePreloadRegistry.d.ts +33 -0
  93. package/utils/styleRegistry.d.ts +19 -0
  94. package/LICENSE +0 -21
  95. package/api/index.mjs.map +0 -1
  96. package/base/index.mjs.map +0 -1
  97. package/component/index.d.mts +0 -69
  98. package/component/index.mjs.map +0 -1
  99. package/config/index.d.mts +0 -17
  100. package/config/index.mjs.map +0 -1
  101. package/headless/index.d.mts +0 -28
  102. package/headless/index.mjs.map +0 -1
  103. package/icon/index.d.mts +0 -40
  104. package/icon/index.mjs.map +0 -1
  105. package/index.mjs.map +0 -1
  106. package/locale/index.d.mts +0 -12
  107. package/locale/index.mjs.map +0 -1
  108. package/motion/index.d.mts +0 -28
  109. package/motion/index.mjs.map +0 -1
  110. package/passthrough/index.d.mts +0 -12
  111. package/passthrough/index.mjs.map +0 -1
  112. package/stylesheet/index.d.mts +0 -10
  113. package/stylesheet/index.mjs.map +0 -1
  114. package/theme/index.d.mts +0 -12
  115. package/theme/index.mjs.map +0 -1
  116. package/umd/index.js.map +0 -1
  117. package/use-style/index.d.mts +0 -7
  118. package/use-style/index.mjs.map +0 -1
  119. package/utils/index.d.mts +0 -35
  120. package/utils/index.mjs.map +0 -1
@@ -1 +0,0 @@
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,KAAAT,EACA,aAAAC,EACA,OAAAC,EACA,WAAAI,EACA,MAAAC,EACA,OAAAC,CACJ,CAAC,EDnBL,UAAYE,MAAW,QEJvB,OAAS,yBAAAC,MAA6B,yBAG/B,GAAM,CAACC,EAAgBC,CAAgB,EAAIF,EAAsC,ECDjF,IAAMG,EAAwC,CACjD,KAAM,OACN,KAAM,OACN,KAAM,GACN,OAAQ,GACR,MAAO,GACP,MAAO,GACP,SAAU,OACV,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,ECrBO,IAAMC,EAAkCC,EAAAC,EAAA,GACzBC,GADyB,CAE3C,GAAI,MACJ,GAAI,GACJ,aAA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F,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,12 +0,0 @@
1
- import * as _primereact_types_core from '@primereact/types/core';
2
- import { PassThroughProps } from '@primereact/types/core';
3
- import * as React from 'react';
4
-
5
- declare const PassThroughContext: React.Context<PassThroughProps | undefined>;
6
- declare const PassThroughProvider: (inProps?: React.PropsWithChildren<PassThroughProps>) => React.JSX.Element;
7
-
8
- declare const defaultPTProps: PassThroughProps;
9
-
10
- declare function usePassThrough(): _primereact_types_core.PassThroughProps;
11
-
12
- export { PassThroughContext, PassThroughProvider, defaultPTProps, usePassThrough };
@@ -1 +0,0 @@
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,10 +0,0 @@
1
- import { StyleSheet, StyleSheetProps, StyleMeta } from '@primeuix/styled';
2
- import * as React from 'react';
3
-
4
- declare class PrimeReactStyleSheet extends StyleSheet<React.DetailedHTMLProps<React.StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement>> {
5
- constructor({ attrs }?: StyleSheetProps);
6
- has(key: string): boolean;
7
- createStyleElement(meta?: StyleMeta): React.JSX.Element | undefined;
8
- }
9
-
10
- export { PrimeReactStyleSheet };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/stylesheet/PrimeReactStyleSheet.tsx"],"sourcesContent":["import { StyleSheet, type StyleMeta, type StyleSheetProps } from '@primeuix/styled';\nimport { isEmpty } from '@primeuix/utils';\nimport * as React from 'react';\n\nexport class PrimeReactStyleSheet extends StyleSheet<React.DetailedHTMLProps<React.StyleHTMLAttributes<HTMLStyleElement>, HTMLStyleElement>> {\n constructor({ attrs }: StyleSheetProps = {}) {\n super({ attrs });\n this._styles.set('layer-order', {});\n }\n has(key: string) {\n if (key === 'layer-order') {\n return this._styles.get(key)?.css !== undefined;\n }\n\n return this._styles.has(key);\n }\n createStyleElement(meta: StyleMeta = {}) {\n const { css, attrs, name } = meta;\n\n if (isEmpty(name)) return undefined;\n\n return (\n <style {...attrs} data-primereact-style-id={name} key={name}>\n {css}\n </style>\n );\n }\n}\n"],"mappings":"6aAAA,OAAS,cAAAA,MAAwD,mBACjE,OAAS,WAAAC,MAAe,kBACxB,UAAYC,MAAW,QAEhB,IAAMC,EAAN,cAAmCC,CAAmG,CACzI,YAAY,CAAE,MAAAC,CAAM,EAAqB,CAAC,EAAG,CACzC,MAAM,CAAE,MAAAA,CAAM,CAAC,EACf,KAAK,QAAQ,IAAI,cAAe,CAAC,CAAC,CACtC,CACA,IAAIC,EAAa,CATrB,IAAAC,EAUQ,OAAID,IAAQ,gBACDC,EAAA,KAAK,QAAQ,IAAID,CAAG,IAApB,YAAAC,EAAuB,OAAQ,OAGnC,KAAK,QAAQ,IAAID,CAAG,CAC/B,CACA,mBAAmBE,EAAkB,CAAC,EAAG,CACrC,GAAM,CAAE,IAAAC,EAAK,MAAAJ,EAAO,KAAAK,CAAK,EAAIF,EAE7B,GAAI,CAAAG,EAAQD,CAAI,EAEhB,OACI,gBAAC,QAAAE,EAAAC,EAAA,GAAUR,GAAV,CAAiB,2BAA0BK,EAAM,IAAKA,IAClDD,CACL,CAER,CACJ","names":["StyleSheet","isEmpty","React","PrimeReactStyleSheet","StyleSheet","attrs","key","_a","meta","css","name","isEmpty","__spreadProps","__spreadValues"]}
package/theme/index.d.mts DELETED
@@ -1,12 +0,0 @@
1
- import * as _primereact_types_core from '@primereact/types/core';
2
- import { ThemeProps } from '@primereact/types/core';
3
- import * as React from 'react';
4
-
5
- declare const ThemeContext: React.Context<ThemeProps | null>;
6
- declare const ThemeProvider: (inProps?: ThemeProps) => React.JSX.Element;
7
-
8
- declare const defaultThemeProps: ThemeProps;
9
-
10
- declare function useTheme(): _primereact_types_core.ThemeProps | null;
11
-
12
- export { ThemeContext, ThemeProvider, defaultThemeProps, useTheme };
@@ -1 +0,0 @@
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"]}