@primereact/core 11.0.0-alpha.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 (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/api/index.d.mts +28 -0
  4. package/api/index.mjs +2 -0
  5. package/api/index.mjs.map +1 -0
  6. package/base/index.d.mts +17 -0
  7. package/base/index.mjs +2 -0
  8. package/base/index.mjs.map +1 -0
  9. package/component/index.d.mts +69 -0
  10. package/component/index.mjs +2 -0
  11. package/component/index.mjs.map +1 -0
  12. package/config/index.d.mts +17 -0
  13. package/config/index.mjs +2 -0
  14. package/config/index.mjs.map +1 -0
  15. package/headless/index.d.mts +28 -0
  16. package/headless/index.mjs +2 -0
  17. package/headless/index.mjs.map +1 -0
  18. package/icon/index.d.mts +40 -0
  19. package/icon/index.mjs +46 -0
  20. package/icon/index.mjs.map +1 -0
  21. package/index.d.mts +13 -0
  22. package/index.mjs +2 -0
  23. package/index.mjs.map +1 -0
  24. package/locale/index.d.mts +12 -0
  25. package/locale/index.mjs +2 -0
  26. package/locale/index.mjs.map +1 -0
  27. package/motion/index.d.mts +28 -0
  28. package/motion/index.mjs +2 -0
  29. package/motion/index.mjs.map +1 -0
  30. package/package.json +43 -0
  31. package/passthrough/index.d.mts +12 -0
  32. package/passthrough/index.mjs +2 -0
  33. package/passthrough/index.mjs.map +1 -0
  34. package/stylesheet/index.d.mts +10 -0
  35. package/stylesheet/index.mjs +2 -0
  36. package/stylesheet/index.mjs.map +1 -0
  37. package/theme/index.d.mts +12 -0
  38. package/theme/index.mjs +2 -0
  39. package/theme/index.mjs.map +1 -0
  40. package/umd/index.js +224 -0
  41. package/umd/index.js.map +1 -0
  42. package/use-style/index.d.mts +7 -0
  43. package/use-style/index.mjs +2 -0
  44. package/use-style/index.mjs.map +1 -0
  45. package/utils/index.d.mts +25 -0
  46. package/utils/index.mjs +2 -0
  47. package/utils/index.mjs.map +1 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 PrimeTek
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # PrimeReact Core
@@ -0,0 +1,28 @@
1
+ declare const FilterMatchMode: Readonly<{
2
+ readonly STARTS_WITH: "startsWith";
3
+ readonly CONTAINS: "contains";
4
+ readonly NOT_CONTAINS: "notContains";
5
+ readonly ENDS_WITH: "endsWith";
6
+ readonly EQUALS: "equals";
7
+ readonly NOT_EQUALS: "notEquals";
8
+ readonly IN: "in";
9
+ readonly LESS_THAN: "lt";
10
+ readonly LESS_THAN_OR_EQUAL_TO: "lte";
11
+ readonly GREATER_THAN: "gt";
12
+ readonly GREATER_THAN_OR_EQUAL_TO: "gte";
13
+ readonly BETWEEN: "between";
14
+ readonly DATE_IS: "dateIs";
15
+ readonly DATE_IS_NOT: "dateIsNot";
16
+ readonly DATE_BEFORE: "dateBefore";
17
+ readonly DATE_AFTER: "dateAfter";
18
+ readonly CUSTOM: "custom";
19
+ }>;
20
+ declare type FilterMatchModeType = (typeof FilterMatchMode)[keyof typeof FilterMatchMode];
21
+
22
+ declare const FilterOperator: Readonly<{
23
+ AND: "and";
24
+ OR: "or";
25
+ }>;
26
+ declare type FilterOperatorType = (typeof FilterOperator)[keyof typeof FilterOperator];
27
+
28
+ export { FilterMatchMode, type FilterMatchModeType, FilterOperator, type FilterOperatorType };
package/api/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ var e=Object.freeze({STARTS_WITH:"startsWith",CONTAINS:"contains",NOT_CONTAINS:"notContains",ENDS_WITH:"endsWith",EQUALS:"equals",NOT_EQUALS:"notEquals",IN:"in",LESS_THAN:"lt",LESS_THAN_OR_EQUAL_TO:"lte",GREATER_THAN:"gt",GREATER_THAN_OR_EQUAL_TO:"gte",BETWEEN:"between",DATE_IS:"dateIs",DATE_IS_NOT:"dateIsNot",DATE_BEFORE:"dateBefore",DATE_AFTER:"dateAfter",CUSTOM:"custom"});var o=Object.freeze({AND:"and",OR:"or"});export{e as FilterMatchMode,o as FilterOperator};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/api/FilterMatchMode.ts","../../src/api/FilterOperator.ts"],"sourcesContent":["export const FilterMatchMode = Object.freeze({\n STARTS_WITH: 'startsWith',\n CONTAINS: 'contains',\n NOT_CONTAINS: 'notContains',\n ENDS_WITH: 'endsWith',\n EQUALS: 'equals',\n NOT_EQUALS: 'notEquals',\n IN: 'in',\n LESS_THAN: 'lt',\n LESS_THAN_OR_EQUAL_TO: 'lte',\n GREATER_THAN: 'gt',\n GREATER_THAN_OR_EQUAL_TO: 'gte',\n BETWEEN: 'between',\n DATE_IS: 'dateIs',\n DATE_IS_NOT: 'dateIsNot',\n DATE_BEFORE: 'dateBefore',\n DATE_AFTER: 'dateAfter',\n CUSTOM: 'custom'\n} as const);\n\nexport declare type FilterMatchModeType = (typeof FilterMatchMode)[keyof typeof FilterMatchMode];\n","export const FilterOperator = Object.freeze({ AND: 'and', OR: 'or' });\n\nexport declare type FilterOperatorType = (typeof FilterOperator)[keyof typeof FilterOperator];\n"],"mappings":"AAAO,IAAMA,EAAkB,OAAO,OAAO,CACzC,YAAa,aACb,SAAU,WACV,aAAc,cACd,UAAW,WACX,OAAQ,SACR,WAAY,YACZ,GAAI,KACJ,UAAW,KACX,sBAAuB,MACvB,aAAc,KACd,yBAA0B,MAC1B,QAAS,UACT,QAAS,SACT,YAAa,YACb,YAAa,aACb,WAAY,YACZ,OAAQ,QACZ,CAAU,EClBH,IAAMC,EAAiB,OAAO,OAAO,CAAE,IAAK,MAAO,GAAI,IAAK,CAAC","names":["FilterMatchMode","FilterOperator"]}
@@ -0,0 +1,17 @@
1
+ import { useBaseOptions, Instance } from '@primereact/types/core';
2
+ import * as React from 'react';
3
+
4
+ /**
5
+ * A custom hook for creating a base instance.
6
+ * This hook is used to initialize a base instance with common properties and methods.
7
+ * It handles props, attributes, and provides a setup function for additional configuration.
8
+ * @param name The name of the base instance.
9
+ * @param options The options for the base instance.
10
+ * @returns The base instance.
11
+ */
12
+ declare const useBase: <IProps extends {
13
+ id?: string;
14
+ ref?: React.Ref<unknown>;
15
+ }, DProps, Exposes extends Record<PropertyKey, unknown>>(name: string | undefined, options: useBaseOptions<IProps, DProps, Exposes>) => Instance<Pick<IProps & DProps, keyof DProps>, IProps, Record<PropertyKey, unknown>, Exposes>;
16
+
17
+ export { useBase };
package/base/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ var S=Object.defineProperty,b=Object.defineProperties;var v=Object.getOwnPropertyDescriptors;var k=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var C=(t,o,e)=>o in t?S(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e,c=(t,o)=>{for(var e in o||(o={}))K.call(o,e)&&C(t,e,o[e]);if(k)for(var e of k(o))T.call(o,e)&&C(t,e,o[e]);return t},R=(t,o)=>b(t,v(o));import{usePrimeReact as j}from"@primereact/core/config";import{combinedRefs as A}from"@primereact/core/utils";import{useAttrSelector as U,useId as _,useProps as h}from"@primereact/hooks";import{resolve as H}from"@primeuix/utils";import*as n from"react";var N=(t="UnknownBase",o)=>{var x,E,B;let e=j(),{inProps:s,defaultProps:l,setup:L}=o||{},d=_(s==null?void 0:s.id),I=U("pc_"),a=n.useRef((x=s==null?void 0:s.ref)!=null?x:null),i=n.useRef(null),f=n.useMemo(()=>({ref:a,elementRef:i,id:d,name:t,inProps:s,$attrSelector:I,$primereact:e}),[d,s,I,e]),O=n.useMemo(()=>{var M,g,w,D;let p=H(((g=(M=e==null?void 0:e.config)==null?void 0:M.defaults)==null?void 0:g[t])||((D=(w=e==null?void 0:e.config)==null?void 0:w.defaults)==null?void 0:D[t.toLowerCase()]),f);return c(c({},l),p==null?void 0:p.props)},[l,(B=(E=e==null?void 0:e.config)==null?void 0:E.defaults)==null?void 0:B[t]]),{props:y,attrs:P}=h(s,O),u=n.useMemo(()=>R(c({},f),{props:y,attrs:P}),[f,y,P]),r=H(L,u),m=n.useMemo(()=>{var p;return R(c(c({state:{},$computedSetup:r},r),u),{elementRef:(p=r==null?void 0:r.elementRef)!=null?p:i})},[r,u]);return n.useEffect(()=>{A(a,s==null?void 0:s.ref)},[a,s==null?void 0:s.ref]),n.useImperativeHandle(a,()=>m,[m]),m};export{N as useBase};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/base/useBase.ts"],"sourcesContent":["import { usePrimeReact } from '@primereact/core/config';\nimport { combinedRefs } from '@primereact/core/utils';\nimport { useAttrSelector, useId, useProps } from '@primereact/hooks';\nimport type { BaseInstance, BaseSetup, CommonInstance, Instance, useBaseOptions } from '@primereact/types/core';\nimport { resolve } from '@primeuix/utils';\nimport * as React from 'react';\n\n/**\n * A custom hook for creating a base instance.\n * This hook is used to initialize a base instance with common properties and methods.\n * It handles props, attributes, and provides a setup function for additional configuration.\n * @param name The name of the base instance.\n * @param options The options for the base instance.\n * @returns The base instance.\n */\nexport const useBase = <IProps extends { id?: string; ref?: React.Ref<unknown> }, DProps, Exposes extends Record<PropertyKey, unknown>>(name: string = 'UnknownBase', options: useBaseOptions<IProps, DProps, Exposes>) => {\n const $primereact = usePrimeReact();\n const { inProps, defaultProps, setup } = options || {};\n\n const id = useId(inProps?.id as string | undefined);\n const $attrSelector = useAttrSelector('pc_');\n\n const ref = React.useRef(inProps?.ref ?? null);\n const elementRef = React.useRef<HTMLElement | null>(null);\n\n const base = React.useMemo<BaseInstance<IProps>>(\n () => ({\n ref,\n elementRef,\n id,\n name,\n inProps,\n $attrSelector,\n $primereact\n }),\n [id, inProps, $attrSelector, $primereact]\n );\n\n const computedDefaultProps = React.useMemo<DProps>(() => {\n const globalDefaults = resolve($primereact?.config?.defaults?.[name] || $primereact?.config?.defaults?.[name.toLowerCase()], base) as { props?: DProps } | undefined;\n\n return { ...defaultProps, ...globalDefaults?.props } as DProps;\n }, [defaultProps, $primereact?.config?.defaults?.[name]]);\n\n const { props, attrs } = useProps(inProps, computedDefaultProps);\n\n const common = React.useMemo<CommonInstance<typeof props, IProps>>(\n () => ({\n ...base,\n props,\n attrs\n }),\n [base, props, attrs]\n );\n\n const $computedSetup = resolve(setup as BaseSetup<typeof props, IProps, Exposes>, common) as Exposes;\n\n const instance = React.useMemo<Instance<typeof props, IProps, Record<PropertyKey, unknown>, Exposes>>(\n () => ({\n state: {},\n $computedSetup,\n ...$computedSetup,\n ...common,\n elementRef: ($computedSetup?.elementRef ?? elementRef) as React.RefObject<HTMLElement | null>\n }),\n [$computedSetup, common]\n );\n\n React.useEffect(() => {\n combinedRefs(ref, inProps?.ref);\n }, [ref, inProps?.ref]);\n\n React.useImperativeHandle(ref as React.Ref<Instance<typeof props, IProps, typeof instance.state, Exposes>>, () => instance, [instance]);\n\n return instance;\n};\n"],"mappings":"6aAAA,OAA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EAAA,GACAL,GADA,CAEH,MAAAM,EACA,MAAAC,CACJ,GACA,CAACP,EAAMM,EAAOC,CAAK,CACvB,EAEMI,EAAiBP,EAAQX,EAAmDgB,CAAM,EAElFG,EAAiB,UACnB,IAAG,CA1DX,IAAA1B,EA0De,OAAAwB,EAAAL,IAAA,CACH,MAAO,CAAC,EACR,eAAAM,GACGA,GACAF,GAJA,CAKH,YAAavB,EAAAyB,GAAA,YAAAA,EAAgB,aAAhB,KAAAzB,EAA8Ba,CAC/C,IACA,CAACY,EAAgBF,CAAM,CAC3B,EAEA,OAAM,YAAU,IAAM,CAClBI,EAAaf,EAAKP,GAAA,YAAAA,EAAS,GAAG,CAClC,EAAG,CAACO,EAAKP,GAAA,YAAAA,EAAS,GAAG,CAAC,EAEhB,sBAAoBO,EAAkF,IAAMc,EAAU,CAACA,CAAQ,CAAC,EAE/HA,CACX","names":["usePrimeReact","combinedRefs","useAttrSelector","useId","useProps","resolve","React","useBase","name","options","_a","_b","_c","$primereact","usePrimeReact","inProps","defaultProps","setup","id","useId","$attrSelector","useAttrSelector","ref","elementRef","base","computedDefaultProps","_d","globalDefaults","resolve","__spreadValues","props","attrs","useProps","common","__spreadProps","$computedSetup","instance","combinedRefs"]}
@@ -0,0 +1,69 @@
1
+ import * as _primereact_types_core from '@primereact/types/core';
2
+ import { ComponentInstance, ComponentProps, GlobalComponentProps, useComponentOptions, InComponentInstance, withComponentOptions } from '@primereact/types/core';
3
+ import * as React from 'react';
4
+ import * as _primereact_types_index from '@primereact/types/index';
5
+ import * as _primereact_types_styles from '@primereact/types/styles';
6
+ import { StylesOptions } from '@primereact/types/styles';
7
+ import * as _primereact_types_shared from '@primereact/types/shared';
8
+
9
+ /**
10
+ * A component wrapper for rendering elements with additional props and attributes.
11
+ * @param inProps The properties to pass to the component.
12
+ * @returns A React element or null if `pIf` is false.
13
+ */
14
+ declare function Component<I extends ComponentInstance = ComponentInstance>(inProps?: ComponentProps<I>): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<React.ReactNode> | React.JSX.Element | null | undefined;
15
+ declare namespace Component {
16
+ var displayName: string;
17
+ }
18
+
19
+ declare const globalProps: GlobalComponentProps;
20
+ declare const defaultComponentProps: ComponentProps;
21
+
22
+ /**
23
+ * A hook for creating a component instance.
24
+ * This hook initializes a component with properties, attributes, and styles, and provides methods for handling pass-through options and styles.
25
+ * It also supports custom setup functions for additional configuration.
26
+ *
27
+ * @param name The name of the component, used for debugging and identification.
28
+ * @param options The options to customize the component instance.
29
+ * @returns The component instance.
30
+ */
31
+ declare function useComponent<IProps, DProps, Exposes extends Record<PropertyKey, unknown>, Styles>(name?: string, options?: useComponentOptions<IProps, DProps, Exposes, Styles>): InComponentInstance<_primereact_types_index.SafeRecord<Pick<IProps & {
32
+ id?: string;
33
+ ref?: React.Ref<unknown>;
34
+ } & {
35
+ ref?: React.Ref<unknown> | undefined;
36
+ pIf?: boolean | undefined;
37
+ style?: React.CSSProperties | ((instance?: _primereact_types_core.ComponentInstance<Record<PropertyKey, unknown>, Record<PropertyKey, unknown>, Record<PropertyKey, unknown>> | undefined) => React.CSSProperties | undefined) | undefined;
38
+ className?: string | ((instance?: _primereact_types_core.ComponentInstance<Record<PropertyKey, unknown>, Record<PropertyKey, unknown>, Record<PropertyKey, unknown>> | undefined) => string | undefined) | undefined;
39
+ as?: string | number | bigint | boolean | React.ComponentClass<any, any> | React.FunctionComponent<any> | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
40
+ asChild?: boolean | undefined;
41
+ pt?: Record<PropertyKey, unknown> | undefined;
42
+ ptOptions?: _primereact_types_core.PassThroughOptions | undefined;
43
+ unstyled?: boolean | undefined;
44
+ dt?: unknown;
45
+ styles?: _primereact_types_styles.StylesOptions | undefined;
46
+ children?: React.ReactNode | ((instance: _primereact_types_core.ComponentInstance<Record<PropertyKey, unknown>, Record<PropertyKey, unknown>, Record<PropertyKey, unknown>>) => React.ReactNode);
47
+ }, "dt" | "style" | "ref" | "pIf" | "className" | "as" | "asChild" | "pt" | "ptOptions" | "unstyled" | "styles" | "children">>, IProps, Record<PropertyKey, unknown>, Exposes>;
48
+
49
+ /**
50
+ * A higher-order component for enhancing a component with additional features.
51
+ *
52
+ * @template IProps The interface for the component's input properties.
53
+ * @template DProps The interface for the component's default properties.
54
+ * @template Exposes The interface for the properties that the component exposes.
55
+ * @template Styles The styles options for the component.
56
+ * @template CData Additional data to expose on the component.
57
+ *
58
+ * @param options The options for the component.
59
+ * @param options.name The name of the component, used for debugging and identification.
60
+ * @param options.defaultProps The default properties for the component.
61
+ * @param options.styles The styles to apply to the component.
62
+ * @param options.components Additional components to include in the component.
63
+ * @param options.setup A setup function for additional configuration of the component.
64
+ * @param options.render A render function for the component.
65
+ * @returns A React component wrapped with the specified options.
66
+ */
67
+ declare function withComponent<IProps, DProps, Exposes extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>, Styles = StylesOptions, CData = Record<string, unknown>>({ name, defaultProps, styles, components, setup, render }: withComponentOptions<IProps, DProps, Exposes, Styles, CData>): (<I extends ComponentInstance, T extends React.ElementType>(inProps?: IProps & _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> | keyof IProps> & DProps) => React.JSX.Element | null) & CData & React.FC<{}>;
68
+
69
+ export { Component, defaultComponentProps, globalProps, useComponent, withComponent };
@@ -0,0 +1,2 @@
1
+ var Ce=Object.defineProperty,Pe=Object.defineProperties;var Se=Object.getOwnPropertyDescriptors;var J=Object.getOwnPropertySymbols;var pe=Object.prototype.hasOwnProperty,ie=Object.prototype.propertyIsEnumerable;var ce=(p,i,u)=>i in p?Ce(p,i,{enumerable:!0,configurable:!0,writable:!0,value:u}):p[i]=u,s=(p,i)=>{for(var u in i||(i={}))pe.call(i,u)&&ce(p,u,i[u]);if(J)for(var u of J(i))ie.call(i,u)&&ce(p,u,i[u]);return p},I=(p,i)=>Pe(p,Se(i));var $=(p,i)=>{var u={};for(var r in p)pe.call(p,r)&&i.indexOf(r)<0&&(u[r]=p[r]);if(p!=null&&J)for(var r of J(p))i.indexOf(r)<0&&ie.call(p,r)&&(u[r]=p[r]);return u};import{isValidElement as he}from"@primereact/core/utils";import{cn as be,resolve as Q}from"@primeuix/utils";import*as U from"react";function we(p={}){var d,h,T,k;let B=p,{pIf:i=!0,style:u,className:r,as:a,asChild:R,instance:n}=B,e=$(B,["pIf","style","className","as","asChild","instance"]);if(i===!1)return null;let m=a||((d=n==null?void 0:n.props)==null?void 0:d.as)||U.Fragment,l=R||((h=n==null?void 0:n.props)==null?void 0:h.asChild),P=m===U.Fragment,w=e,{ref:C=n==null?void 0:n.elementRef,children:f,attrs:O}=w,M=$(w,["ref","children","attrs"]),N=s(s({},O),M),j=Q(f,n,N),D=Q(u||((T=n==null?void 0:n.props)==null?void 0:T.style),n),A=Q(r||((k=n==null?void 0:n.props)==null?void 0:k.className),n);return l||P?U.createElement(U.Fragment,null,j):he(m)?Q(m,n):U.createElement(m,I(s({},N),{ref:C,style:s(s({},N.style),D),className:be(N.className,A)}),j)}we.displayName="PrimeReact.Component";import{omit as ke}from"@primeuix/utils";var ee={ref:void 0,pIf:!0,style:void 0,className:void 0,as:void 0,asChild:!1,pt:void 0,ptOptions:void 0,unstyled:void 0,dt:void 0,children:void 0},He=I(s({},ke(ee,"pt","ptOptions","dt","styles")),{instance:void 0,attrs:void 0});import{useBase as je}from"@primereact/core/base";import*as W from"react";import{useMountEffect as Te,useUnmountEffect as Ie,useUpdateEffect as xe}from"@primereact/hooks";import{mergeProps as ne}from"@primeuix/utils/mergeprops";import{getKeyValue as X,isArray as Oe,isFunction as _e,isNotEmpty as Ee,isString as te,resolve as ue,toFlatCase as q}from"@primeuix/utils/object";import*as g from"react";function me(p,i){var L,G,z;let{id:u,name:r,props:a,attrs:R,$primereact:n,$attrSelector:e}=p||{},m=g.useCallback(t=>{let o=M(O(a.pt,r),X,`hooks.${t}`),c=h(X,`hooks.${t}`);o==null||o(),c==null||c()},[a.pt,r]),l=g.useCallback((t,...o)=>_e(t)?t(...o):t?ne(...o):Object.assign({},...o),[]),P=g.useCallback((t={},o="",c={},y=!0)=>{var ae;let b=/./g.test(o)&&!!c[o.split(".")[0]],{mergeSections:F=!0,mergeProps:S=!1}=(a==null?void 0:a.ptOptions)||((ae=n.config)==null?void 0:ae.ptOptions)||{},K=y?b?d(f,o,c):h(f,o,c):void 0,_=b?void 0:B(t,f,o,I(s({},c),{global:K||{}})),E=C(o);return F||!F&&_?l(S,K,_,E):s(s({},_),E)},[a.ptOptions,l]),C=g.useCallback((t="")=>{var y,b;let o="data-pc-",c=t==="root"&&Ee((y=a==null?void 0:a.pt)==null?void 0:y["data-pc-section"]);return t!=="transition"&&I(s({},t==="root"&&I(s({[`${o}name`]:q(c?(b=a.pt)==null?void 0:b["data-pc-section"]:r)},c&&{[`${o}extend`]:q(r)}),{[`${e}`]:""})),{[`${o}section`]:q(t)})},[a.pt,e]),f=g.useCallback((t={},o="",c)=>{let y=X(t,o,c);return te(y)||Oe(y)?{className:y}:y},[]),O=g.useCallback((t,o="",c)=>{let y=(b,F=!1)=>{var E;let S=c?c(b):b,K=q(o),_=q(r);return(E=F?K!==_?S==null?void 0:S[K]:void 0:S==null?void 0:S[K])!=null?E:S};return t&&Object.hasOwn(t,"_usept")?{_usept:t._usept,originalValue:y(t.originalValue),value:y(t.value)}:y(t,!0)},[]),M=g.useCallback((t,o,c="",y)=>{var F;let b=S=>o(S,c,y);if(t&&Object.hasOwn(t,"_usept")){let{mergeSections:S=!0,mergeProps:K=!1}=t._usept||((F=n.config)==null?void 0:F.ptOptions)||{},_=b(t.originalValue),E=b(t.value);return _===void 0&&E===void 0?void 0:te(E)?E:te(_)?_:S||!S&&E?l(K,_,E):E}return b(t)},[(L=n.config)==null?void 0:L.ptOptions,l]),N=g.useMemo(()=>{var t;return O((t=n==null?void 0:n.config)==null?void 0:t.pt,void 0,o=>ue(o,p))},[(G=n==null?void 0:n.config)==null?void 0:G.pt]),j=g.useMemo(()=>{var t;return O((t=n==null?void 0:n.config)==null?void 0:t.pt,void 0,o=>X(o,r,p)||ue(o,p))},[(z=n==null?void 0:n.config)==null?void 0:z.pt]),D=g.useMemo(()=>Object.entries(R||{}).filter(([t])=>t==null?void 0:t.startsWith("pt-")).reduce((t,[o,c])=>{let[,y,...b]=o.split("-");return[y,b==null?void 0:b.join("-")].reduce((F,S,K,_)=>(F[S]||(F[S]=K===_.length-1?c:{}),F[S]),t),t},{}),[R]),A=g.useMemo(()=>Object.entries(R||{}).filter(([t])=>!(t!=null&&t.startsWith("pt-"))).reduce((t,[o,c])=>(t[o]=c,t),{}),[R]),B=g.useCallback((t={},o,c="",y)=>ne(M(O(t,r),o,c,y),M(D,o,c,y)),[D]),d=g.useCallback((t,o="",c)=>M(N,t,o,c),[N]),h=g.useCallback((t,o,c)=>M(j,t,o,c),[j]),w=g.useCallback((t="",o={})=>P(a.pt,t,s(s({},i),o)),[a.pt,i]),T=g.useCallback((t="",o={})=>{var y;let c=ne(A,w(t,o));return c&&Object.hasOwn(c,"id")&&((y=c.id)!=null||(c.id=u)),c},[w,u,A]),k=g.useCallback((t={},o="",c={})=>P(t,o,s(s({},i),c),!1),[i]);return Te(()=>m("onMounted")),xe(()=>m("onUpdated")),Ie(()=>m("onUnmounted")),g.useMemo(()=>({ptm:w,ptmi:T,ptmo:k}),[w,T,k])}import{StyleRegistry as Y}from"@primereact/core/utils";import{Theme as H,ThemeService as Ke}from"@primeuix/styled";import{cn as ve,getKeyValue as re}from"@primeuix/utils";import*as x from"react";import{ThemeContext as Me}from"@primereact/core/theme";import{useStyle as Ne}from"@primereact/core/use-style";import{css as oe,dt as le,Theme as v}from"@primeuix/styled";import{isNotEmpty as Fe,minifyCSS as se,resolve as de,toElement as Le}from"@primeuix/utils";import*as V from"react";function fe(p,i){let u=V.useContext(Me),[r]=Ne(),a=V.useCallback((R,n)=>r({name:n==null?void 0:n.name,css:R,element:Le(i),options:n}),[r,i]);return V.useMemo(()=>{let R=I(s({name:"base"},p),{load(n="",e={},m="",l=!1){let P=e.name||R.name,C=oe`${n}${m}`,f=l?v.transformCSS(P,C):C;return Fe(f)?a(se(f),s({name:P},e)):{}},loadCSS(n){return this.load(this.css,n)},loadStyle(n,e=""){return this.load(this.style,n,e,!0)},getCommonTheme(n){return v.getCommon(this.name,n)},getComponentTheme(n){return v.getComponent(this.name,n)},getPresetTheme(n,e,m){return v.getCustomPreset(this.name,n,e,m)},getLayerOrderThemeCSS(){return v.getLayerOrderCSS(this.name)},getStyleSheet(n="",e={}){if(this.css){let m=de(this.css,{dt:le}),l=se(oe`${m}${n}`),P=Object.entries(e).reduce((C,[f,O])=>(C.push(`${f}="${O}"`),C),[]).join(" ");return`<style type="text/css" data-primereact-style-id="${this.name}" ${P}>${l}</style>`}return""},getCommonThemeStyleSheet(n,e={}){return v.getCommonStyleSheet(this.name,n,e)},getThemeStyleSheet(n,e={}){let m=[v.getStyleSheet(this.name,n,e)];if(u){let l=this.name==="base"?"global-style":`${this.name}-style`,P=oe`${de(u,{dt:le})}`,C=se(v.transformCSS(this.name,P)),f=Object.entries(e).reduce((O,[M,N])=>(O.push(`${M}="${N}"`),O),[]).join(" ");m.push(`<style type="text/css" data-primereact-style-id="${l}" ${f}>${C}</style>`)}return m.join("")}});return R},[p,u,a])}function ye(p,i,u){var B;let{props:r={unstyled:!1,dt:void 0},$primereact:a,$attrSelector:R,elementRef:n}=p||{},e=fe(i,n),m=x.useRef(null),l=x.useCallback(()=>{if(!Y.isStyleNameLoaded("base")){let{css:d}=e.baseStyles||{};e.load(d,s({name:"base"},f)),Y.setLoadedStyleName("base")}M()},[e]),P=x.useCallback(()=>{l(),j(l)},[l]),C=x.useMemo(()=>{var d;return r.unstyled!==void 0?r.unstyled:(d=a==null?void 0:a.config)==null?void 0:d.unstyled},[r,a==null?void 0:a.config]),f=x.useMemo(()=>{var d,h;return{nonce:(h=(d=a==null?void 0:a.config)==null?void 0:d.csp)==null?void 0:h.nonce}},[a==null?void 0:a.config]),O=x.useCallback(()=>{if(!Y.isStyleNameLoaded(e==null?void 0:e.name)&&(e!=null&&e.name)){let d=e.name==="global"?"base":e.name;e.loadCSS(s({name:d},f)),Y.setLoadedStyleName(e.name)}},[e,f]),M=x.useCallback(()=>{var d,h,w,T;if(!(C||(a==null?void 0:a.theme)==="none")){if(!H.isStyleNameLoaded("common")){let{primitive:k,semantic:L,global:G,style:z}=((d=e==null?void 0:e.getCommonTheme)==null?void 0:d.call(e))||{};e.load(k==null?void 0:k.css,s({name:"primitive-variables"},f)),e.load(L==null?void 0:L.css,s({name:"semantic-variables"},f)),e.load(G==null?void 0:G.css,s({name:"global-variables"},f)),e.load((h=e.baseStyles)==null?void 0:h.style,s({name:"global-style"},f),z,!0),H.setLoadedStyleName("common")}if(!H.isStyleNameLoaded(e==null?void 0:e.name)&&(e!=null&&e.name)){let{css:k,style:L}=((w=e==null?void 0:e.getComponentTheme)==null?void 0:w.call(e))||{};e.load(k,s({name:`${e.name}-variables`},f)),e.loadStyle(s({name:`${e.name}-style`},f),L),H.setLoadedStyleName(e.name)}if(!H.isStyleNameLoaded("layer-order")){let k=(T=e==null?void 0:e.getLayerOrderThemeCSS)==null?void 0:T.call(e);e.load(k,s({name:"layer-order",first:!0},f)),H.setLoadedStyleName("layer-order")}}},[C,e,f]),N=d=>{var T;let{css:h}=((T=e==null?void 0:e.getPresetTheme)==null?void 0:T.call(e,d,`[${R}]`))||{},w=e==null?void 0:e.load(h,s({name:`${R}-${e.name}`},f));m.current=w},j=x.useCallback((d=()=>{})=>{Ke.on("theme:change",d)},[]),D=x.useCallback((d="",h={})=>C?void 0:ve(re(e.classes,d,I(s({},u),{context:h}))),[C,p,e.classes]),A=x.useCallback((d="",h=!0,w={})=>{var T;if(h){let k=re(e.inlineStyles,d,I(s({},u),{context:w})),L=re((T=e.baseStyles)==null?void 0:T.inlineStyles,d,I(s({},u),{context:w}));return s(s({},L),k)}},[e.inlineStyles,(B=e.baseStyles)==null?void 0:B.inlineStyles,p]);return C||(O(),P(),N(r.dt)),x.useMemo(()=>({cx:D,sx:A,isUnstyled:C,$style:e}),[D,A,C,e])}function Re(p="UnknownComponent",i={}){let u=W.useMemo(()=>s(s({},ee),i.defaultProps),[i.defaultProps]),r=je(p,{inProps:i.inProps,defaultProps:u,setup:i.setup}),{ref:a,props:R}=r,n=W.useMemo(()=>({instance:r,props:r.props,attrs:r.attrs,state:r.state}),[r.props,r.attrs,r.state]),e=me(r,n),m=ye(r,R.styles||i.styles,n),l=W.useMemo(()=>s(s(s({},r),e),m),[r,e,m]);return W.useImperativeHandle(a,()=>l,[l]),l}import{isObject as ge}from"@primeuix/utils";import*as Z from"react";function Pn({name:p="UnknownComponent",defaultProps:i,styles:u,components:r,setup:a,render:R}){let e=Z.memo(m=>{let l=Re(p,{inProps:m,defaultProps:i,styles:u,setup:a}),P=R!=null?R:()=>null;return l.props.pIf?Z.createElement(P,s({},l)):null},(m,l)=>!ge(m)||!ge(l)?!1:m===l&&Object.keys(i||{}).every(P=>m[P]===l[P]));return e.displayName=`PrimeReact.${p}`,Object.entries(r||{}).forEach(([m,l])=>{e[m]=l}),e}export{we as Component,He as defaultComponentProps,ee as globalProps,Re as useComponent,Pn as withComponent};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/component/Component.tsx","../../src/component/Component.props.ts","../../src/component/useComponent.ts","../../src/component/useComponentPT.ts","../../src/component/useComponentStyle.ts","../../src/component/useComponentStyleHandler.ts","../../src/component/withComponent.tsx"],"sourcesContent":["import { isValidElement } from '@primereact/core/utils';\nimport type { ComponentInstance, ComponentProps } from '@primereact/types/core';\nimport { cn, resolve } from '@primeuix/utils';\nimport * as React from 'react';\n\n/**\n * A component wrapper for rendering elements with additional props and attributes.\n * @param inProps The properties to pass to the component.\n * @returns A React element or null if `pIf` is false.\n */\nexport function Component<I extends ComponentInstance = ComponentInstance>(inProps: ComponentProps<I> = {}) {\n const { pIf = true, style, className, as, asChild, instance, ...props } = inProps;\n\n if (pIf === false) return null;\n\n const AsComponent = (as || instance?.props?.as || React.Fragment) as React.ElementType;\n const renderAsChild = asChild || instance?.props?.asChild;\n const isFragment = AsComponent === React.Fragment;\n\n const { ref = instance?.elementRef, children, attrs: inAttrs, ...restAttrs } = props;\n const attrs = { ...inAttrs, ...restAttrs } as React.HTMLAttributes<HTMLElement>;\n // @ts-expect-error: Update resolve to handle attrs correctly\n const content = resolve(children, instance, attrs) as React.ReactNode;\n const styles = resolve(style || instance?.props?.style, instance) as React.CSSProperties | undefined;\n const classNames = resolve(className || instance?.props?.className, instance) as string | undefined;\n\n return renderAsChild || isFragment ? (\n <React.Fragment>{content}</React.Fragment>\n ) : isValidElement(AsComponent) ? (\n resolve(AsComponent, instance)\n ) : (\n <AsComponent {...attrs} ref={ref} style={{ ...attrs.style, ...styles }} className={cn(attrs.className, classNames)}>\n {content}\n </AsComponent>\n );\n}\n\nComponent.displayName = 'PrimeReact.Component';\n","import type { ComponentProps, GlobalComponentProps } from '@primereact/types/core';\nimport { omit } from '@primeuix/utils';\n\nexport const globalProps: GlobalComponentProps = {\n ref: undefined,\n pIf: true,\n style: undefined,\n className: undefined,\n as: undefined,\n asChild: false,\n pt: undefined,\n ptOptions: undefined,\n unstyled: undefined,\n dt: undefined,\n children: undefined\n};\n\nexport const defaultComponentProps: ComponentProps = {\n ...(omit(globalProps, 'pt', 'ptOptions', 'dt', 'styles') as Record<PropertyKey, unknown>),\n instance: undefined,\n attrs: undefined\n};\n","import { useBase } from '@primereact/core/base';\nimport type { InComponentInstance, useBaseOptions, useComponentOptions } from '@primereact/types/core';\nimport * as React from 'react';\nimport { globalProps } from './Component.props';\nimport { useComponentPT } from './useComponentPT';\nimport { useComponentStyle } from './useComponentStyle';\n\n/**\n * A hook for creating a component instance.\n * This hook initializes a component with properties, attributes, and styles, and provides methods for handling pass-through options and styles.\n * It also supports custom setup functions for additional configuration.\n *\n * @param name The name of the component, used for debugging and identification.\n * @param options The options to customize the component instance.\n * @returns The component instance.\n */\nexport function useComponent<IProps, DProps, Exposes extends Record<PropertyKey, unknown>, Styles>(name: string = 'UnknownComponent', options: useComponentOptions<IProps, DProps, Exposes, Styles> = {}) {\n const defaultProps = React.useMemo(() => ({ ...globalProps, ...options.defaultProps }), [options.defaultProps]);\n const baseInstance = useBase(name, {\n inProps: options.inProps,\n defaultProps,\n setup: options.setup\n } as useBaseOptions<IProps & { id?: string; ref?: React.Ref<unknown> }, typeof defaultProps, Exposes>);\n\n const { ref, props } = baseInstance;\n const $params = React.useMemo(() => {\n return {\n instance: baseInstance,\n props: baseInstance.props,\n attrs: baseInstance.attrs,\n state: baseInstance.state\n };\n }, [baseInstance.props, baseInstance.attrs, baseInstance.state]);\n\n const ptx = useComponentPT(baseInstance, $params);\n const stx = useComponentStyle(baseInstance, props.styles || options.styles, $params);\n\n const instance = React.useMemo<InComponentInstance<typeof props, IProps, typeof baseInstance.state, Exposes>>(\n () => ({\n ...baseInstance,\n ...ptx,\n ...stx\n }),\n [baseInstance, ptx, stx]\n );\n\n React.useImperativeHandle(ref as React.Ref<InComponentInstance<typeof props, IProps, typeof baseInstance.state, Exposes>>, () => instance, [instance]);\n\n return instance;\n}\n","import { useMountEffect, useUnmountEffect, useUpdateEffect } from '@primereact/hooks';\nimport type { GlobalComponentProps, Instance, PassThroughOptions, useComponentPTReturnType } from '@primereact/types/core';\nimport { mergeProps } from '@primeuix/utils/mergeprops';\nimport { getKeyValue, isArray, isFunction, isNotEmpty, isString, resolve, toFlatCase } from '@primeuix/utils/object';\nimport * as React from 'react';\n\n/**\n * A hook for managing pass-through options for a component.\n *\n * @param instance The instance of the component.\n * @param $params Additional parameters for the hook.\n * @returns An object containing the pass-through options.\n */\nexport function useComponentPT<Props extends GlobalComponentProps, IProps, Params>(instance: Instance<Props, IProps>, $params?: Params): useComponentPTReturnType {\n const { id, name, props, attrs, $primereact, $attrSelector } = instance || {};\n\n // methods\n const _hook = React.useCallback(\n (hookName: string) => {\n const selfHook = _usePT(_getPT(props.pt, name), getKeyValue, `hooks.${hookName}`) as (() => void) | undefined;\n const defaultHook = _useDefaultPT(getKeyValue, `hooks.${hookName}`) as (() => void) | undefined;\n\n selfHook?.();\n defaultHook?.();\n },\n [props.pt, name]\n );\n\n const _mergeProps = React.useCallback(<T extends unknown[], R = Record<PropertyKey, unknown>>(fn: ((...args: T) => R | undefined) | boolean, ...args: T): R => {\n return (isFunction(fn) ? fn(...args) : fn ? mergeProps(...args) : Object.assign({}, ...args)) as R;\n }, []);\n\n const _getPTValue = React.useCallback(\n (obj = {}, key = '', params: Record<string, unknown> = {}, searchInDefaultPT = true) => {\n const searchOut = /./g.test(key) && !!params[key.split('.')[0]];\n const { mergeSections = true, mergeProps: useMergeProps = false } = props?.ptOptions || $primereact.config?.ptOptions || {};\n const global = searchInDefaultPT ? (searchOut ? _useGlobalPT(_getPTClassValue, key, params) : _useDefaultPT(_getPTClassValue, key, params)) : undefined;\n const self = searchOut ? undefined : _getPTSelf(obj, _getPTClassValue, key, { ...params, global: global || {} });\n const datasets = _getPTDatasets(key);\n\n return mergeSections || (!mergeSections && self) ? _mergeProps(useMergeProps, global, self, datasets) : { ...self, ...datasets };\n },\n [props.ptOptions, _mergeProps]\n );\n\n const _getPTDatasets = React.useCallback(\n (key = '') => {\n const datasetPrefix = 'data-pc-';\n const isExtended = key === 'root' && isNotEmpty(props?.pt?.['data-pc-section']);\n\n return (\n key !== 'transition' && {\n ...(key === 'root' && {\n [`${datasetPrefix}name`]: toFlatCase((isExtended ? props.pt?.['data-pc-section'] : name) as string),\n ...(isExtended && { [`${datasetPrefix}extend`]: toFlatCase(name!) }),\n [`${$attrSelector}`]: ''\n }),\n [`${datasetPrefix}section`]: toFlatCase(key)\n }\n );\n },\n [props.pt, $attrSelector]\n );\n\n const _getPTClassValue = React.useCallback((obj: Record<string, unknown> = {}, key = '', params?: Record<string, unknown>) => {\n const value = getKeyValue(obj, key, params);\n\n return isString(value) || isArray(value) ? { className: value } : value;\n }, []);\n\n const _getPT = React.useCallback(<Fn extends (...args: unknown[]) => unknown>(pt?: Record<string, unknown>, key = '', fn?: Fn) => {\n const getValue = (value: unknown, checkSameKey = false) => {\n const computedValue = (fn ? fn(value) : value) as Record<string, unknown>;\n const _key = toFlatCase(key);\n const _cKey = toFlatCase(name!);\n\n return ((checkSameKey ? (_key !== _cKey ? computedValue?.[_key] : undefined) : computedValue?.[_key]) ?? computedValue) as Record<string, unknown>;\n };\n\n return pt && Object.hasOwn(pt, '_usept')\n ? {\n _usept: pt['_usept'],\n originalValue: getValue(pt.originalValue),\n value: getValue(pt.value)\n }\n : getValue(pt, true);\n }, []);\n\n const _usePT = React.useCallback(\n <Fn>(pt: Record<string, unknown>, fn: Fn, key: string = '', params?: Record<string, unknown>) => {\n const vfn = (value: unknown) => (fn as (...args: unknown[]) => unknown)(value, key, params);\n\n if (pt && Object.hasOwn(pt, '_usept')) {\n const { mergeSections = true, mergeProps: useMergeProps = false } = (pt['_usept'] || $primereact.config?.ptOptions || {}) as PassThroughOptions;\n const originalValue = vfn(pt.originalValue);\n const value = vfn(pt.value);\n\n if (originalValue === undefined && value === undefined) return undefined;\n else if (isString(value)) return value;\n else if (isString(originalValue)) return originalValue;\n\n return mergeSections || (!mergeSections && value) ? _mergeProps(useMergeProps, originalValue, value) : value;\n }\n\n return vfn(pt);\n },\n [$primereact.config?.ptOptions, _mergeProps]\n );\n\n // computed values\n const $globalPT = React.useMemo(() => _getPT($primereact?.config?.pt, undefined, (value) => resolve(value, instance)), [$primereact?.config?.pt]);\n const $defaultPT = React.useMemo(() => _getPT($primereact?.config?.pt, undefined, (value) => getKeyValue(value as Record<string, unknown>, name, instance) || resolve(value, instance)), [$primereact?.config?.pt]);\n const $attrsPT = React.useMemo(() => {\n return Object.entries(attrs || {})\n .filter(([key]) => key?.startsWith('pt-'))\n .reduce<Record<string, unknown>>((result, [key, value]) => {\n const [, slot, ...rest] = key.split('-');\n\n [slot, rest?.join('-')]?.reduce((currentObj, nestedKey, index, array) => {\n if (!currentObj[nestedKey]) {\n currentObj[nestedKey] = index === array.length - 1 ? value : {};\n }\n\n return currentObj[nestedKey] as Record<string, unknown>;\n }, result);\n\n return result;\n }, {});\n }, [attrs]);\n const $attrsWithoutPT = React.useMemo(() => {\n return Object.entries(attrs || {})\n .filter(([key]) => !key?.startsWith('pt-'))\n .reduce<Record<string, unknown>>((acc, [key, value]) => {\n acc[key] = value;\n\n return acc;\n }, {});\n }, [attrs]);\n\n // helpers\n const _getPTSelf = React.useCallback(\n <Fn>(obj: Record<string, unknown> = {}, fn: Fn, key: string = '', params?: Record<string, unknown>) => {\n return mergeProps(\n _usePT(_getPT(obj, name), fn, key, params), // Exp; <PRComponent pt={{ [passthrough_key]: { [attribute]: value } }}>\n _usePT($attrsPT, fn, key, params) // Exp; <PRComponent pt:[passthrough_key]:[attribute]={value}> or <PRComponent pt:[passthrough_key]={() =>{value}}>\n );\n },\n [$attrsPT]\n );\n\n const _useGlobalPT = React.useCallback(\n <Fn>(fn: Fn, key: string = '', params?: Record<string, unknown>) => {\n return _usePT($globalPT, fn, key, params);\n },\n [$globalPT]\n );\n\n const _useDefaultPT = React.useCallback(\n <Fn>(fn: Fn, key: string, params?: Record<string, unknown>) => {\n return _usePT($defaultPT, fn, key, params);\n },\n [$defaultPT]\n );\n\n // exposed methods\n const ptm = React.useCallback(\n (key = '', params: Record<string, unknown> | undefined = {}) => {\n return _getPTValue(props.pt, key, { ...$params, ...params }) as Record<string, unknown>;\n },\n [props.pt, $params]\n );\n\n const ptmi = React.useCallback(\n (key = '', params: Record<string, unknown> | undefined = {}) => {\n const _attrs = mergeProps($attrsWithoutPT, ptm(key, params)) as Record<string, unknown>;\n\n if (_attrs && Object.hasOwn(_attrs, 'id')) {\n _attrs.id ??= id;\n }\n\n return _attrs as Record<string, unknown>;\n },\n [ptm, id, $attrsWithoutPT]\n );\n\n const ptmo = React.useCallback(\n (obj: Record<string, unknown> = {}, key = '', params: Record<string, unknown> | undefined = {}) => {\n return _getPTValue(obj, key, { ...$params, ...params }, false) as Record<string, unknown>;\n },\n [$params]\n );\n\n // hooks\n useMountEffect(() => _hook('onMounted'));\n useUpdateEffect(() => _hook('onUpdated'));\n useUnmountEffect(() => _hook('onUnmounted'));\n\n return React.useMemo(\n () => ({\n ptm,\n ptmi,\n ptmo\n }),\n [ptm, ptmi, ptmo]\n );\n}\n","import { StyleRegistry } from '@primereact/core/utils';\nimport type { GlobalComponentProps, Instance, useComponentStyleReturnType } from '@primereact/types/core';\nimport { Theme, ThemeService } from '@primeuix/styled';\nimport { cn, getKeyValue } from '@primeuix/utils';\nimport * as React from 'react';\nimport { useComponentStyleHandler } from './useComponentStyleHandler';\n\n/**\n * A hook for managing component styles.\n *\n * @param instance The instance of the component.\n * @param styles The styles to apply to the component.\n * @param $params Additional parameters for the hook.\n * @returns An object containing the component styles.\n */\nexport function useComponentStyle<Props extends GlobalComponentProps, IProps, Styles, Params>(instance: Instance<Props, IProps>, styles?: Styles, $params?: Params): useComponentStyleReturnType {\n const { props = { unstyled: false, dt: undefined }, $primereact, $attrSelector, elementRef } = instance || {};\n const $style = useComponentStyleHandler(styles, elementRef);\n\n // refs\n const scopedStyleRef = React.useRef<HTMLStyleElement | null>(null);\n\n // methods\n const _load = React.useCallback(() => {\n if (!StyleRegistry.isStyleNameLoaded('base')) {\n const { css } = $style.baseStyles || {};\n\n $style.load(css, { name: 'base', ...$styleOptions });\n\n StyleRegistry.setLoadedStyleName('base');\n }\n\n _loadThemeStyles();\n }, [$style]);\n\n const _loadStyles = React.useCallback(() => {\n _load();\n _themeChangeListener(_load);\n }, [_load]);\n\n // computed values\n const $isUnstyled = React.useMemo(() => (props.unstyled !== undefined ? props.unstyled : $primereact?.config?.unstyled), [props, $primereact?.config]);\n const $styleOptions = React.useMemo(() => ({ nonce: $primereact?.config?.csp?.nonce }), [$primereact?.config]);\n\n // helpers\n const _loadCoreStyles = React.useCallback(() => {\n if (!StyleRegistry.isStyleNameLoaded($style?.name) && $style?.name) {\n const name = $style.name === 'global' ? 'base' : $style.name;\n\n $style.loadCSS({ name, ...$styleOptions });\n\n StyleRegistry.setLoadedStyleName($style.name);\n }\n }, [$style, $styleOptions]);\n\n const _loadThemeStyles = React.useCallback(() => {\n if ($isUnstyled || $primereact?.theme === 'none') return;\n\n // common\n if (!Theme.isStyleNameLoaded('common')) {\n const { primitive, semantic, global, style } = $style?.getCommonTheme?.() || {};\n\n $style.load(primitive?.css, { name: 'primitive-variables', ...$styleOptions });\n $style.load(semantic?.css, { name: 'semantic-variables', ...$styleOptions });\n $style.load(global?.css, { name: 'global-variables', ...$styleOptions });\n $style.load($style.baseStyles?.style, { name: 'global-style', ...$styleOptions }, style, true);\n\n Theme.setLoadedStyleName('common');\n }\n\n // component\n if (!Theme.isStyleNameLoaded($style?.name) && $style?.name) {\n const { css, style } = $style?.getComponentTheme?.() || {};\n\n $style.load(css, { name: `${$style.name}-variables`, ...$styleOptions });\n $style.loadStyle({ name: `${$style.name}-style`, ...$styleOptions }, style);\n\n Theme.setLoadedStyleName($style.name);\n }\n\n // layer order\n if (!Theme.isStyleNameLoaded('layer-order')) {\n const layerOrder = $style?.getLayerOrderThemeCSS?.();\n\n $style.load(layerOrder, { name: 'layer-order', first: true, ...$styleOptions });\n\n Theme.setLoadedStyleName('layer-order');\n }\n }, [$isUnstyled, $style, $styleOptions]);\n\n const _loadScopedThemeStyles = (preset: unknown) => {\n const { css } = $style?.getPresetTheme?.(preset, `[${$attrSelector}]`) || {};\n const scopedStyle = $style?.load(css, { name: `${$attrSelector}-${$style.name}`, ...$styleOptions });\n\n scopedStyleRef.current = scopedStyle as HTMLStyleElement;\n };\n\n /*const _unloadScopedThemeStyles = () => {\n scopedStyleRef.current?.remove();\n };*/\n\n const _themeChangeListener = React.useCallback((callback = () => {}) => {\n //if (!StyleRegistry.isStyleNameLoaded('base')) {\n //StyleRegistry.clearLoadedStyleNames();\n ThemeService.on('theme:change', callback);\n //}\n }, []);\n\n /*const _removeThemeListeners = () => {\n ThemeService.off('theme:change', _loadCoreStyles);\n ThemeService.off('theme:change', _load);\n ThemeService.off('theme:change', _themeScopedListener);\n };*/\n\n // exposed methods\n const cx = React.useCallback(\n (key = '', params = {}) => {\n return !$isUnstyled ? cn(getKeyValue($style.classes as Record<string, string>, key, { ...$params, context: params })) : undefined;\n },\n [$isUnstyled, instance, $style.classes]\n );\n\n const sx = React.useCallback(\n (key = '', when = true, params = {}) => {\n if (when) {\n const self = getKeyValue($style.inlineStyles as Record<string, React.CSSProperties>, key, { ...$params, context: params }) as React.CSSProperties;\n const base = getKeyValue($style.baseStyles?.inlineStyles as Record<string, React.CSSProperties>, key, { ...$params, context: params }) as React.CSSProperties;\n\n return { ...base, ...self };\n }\n\n return undefined;\n },\n [$style.inlineStyles, $style.baseStyles?.inlineStyles, instance]\n );\n\n // effects\n if (!$isUnstyled) {\n // @todo - remove\n //Theme.clearLoadedStyleNames();\n //StyleRegistry.clearLoadedStyleNames();\n _loadCoreStyles();\n _loadStyles();\n _loadScopedThemeStyles(props.dt);\n }\n\n return React.useMemo(\n () => ({\n cx,\n sx,\n isUnstyled: $isUnstyled,\n $style\n }),\n [cx, sx, $isUnstyled, $style]\n );\n}\n","import { ThemeContext } from '@primereact/core/theme';\nimport { useStyle } from '@primereact/core/use-style';\nimport type { StylesOptions, StyleType } from '@primereact/types/styles';\nimport { css as Css, dt, Theme } from '@primeuix/styled';\nimport { isNotEmpty, minifyCSS, resolve, toElement } from '@primeuix/utils';\nimport * as React from 'react';\n\n/**\n * A custom hook for managing component styles.\n *\n * @param styles The styles to apply to the component.\n * @param elementRef A reference to the HTML element.\n * @returns An object containing methods to load and manage styles.\n */\nexport function useComponentStyleHandler<Styles>(styles?: Styles, elementRef?: React.Ref<HTMLElement>) {\n const theme = React.useContext(ThemeContext);\n const [load] = useStyle();\n\n const _load = React.useCallback(\n (css?: string, options?: Record<PropertyKey, unknown>) => {\n return load({ name: options?.name as string | undefined, css, element: toElement(elementRef), options });\n },\n [load, elementRef]\n );\n\n return React.useMemo(() => {\n const handler = {\n name: 'base',\n ...(styles as StylesOptions),\n load(style: StyleType = '', options: Record<PropertyKey, unknown> & { name?: string } = {}, extendedStyle = '', enableThemeTransform = false) {\n const name = options.name || handler.name;\n const resolvedStyle = Css`${style}${extendedStyle}` as string;\n const computedStyle = enableThemeTransform ? Theme.transformCSS(name, resolvedStyle) : resolvedStyle;\n\n return isNotEmpty(computedStyle) ? _load(minifyCSS(computedStyle), { name, ...options }) : {};\n },\n loadCSS(options?: Record<PropertyKey, unknown>) {\n return this.load(this.css, options);\n },\n loadStyle(options?: Record<PropertyKey, unknown>, extendedStyle = '') {\n return this.load(this.style, options, extendedStyle, true);\n },\n getCommonTheme(params?: Record<PropertyKey, unknown>) {\n return Theme.getCommon(this.name, params);\n },\n getComponentTheme(params?: Record<PropertyKey, unknown>) {\n return Theme.getComponent(this.name, params);\n },\n // @todo: preset type\n getPresetTheme(preset: unknown, selector: string, params?: Record<PropertyKey, unknown>) {\n return Theme.getCustomPreset(this.name, preset, selector, params);\n },\n getLayerOrderThemeCSS() {\n return Theme.getLayerOrderCSS(this.name);\n },\n getStyleSheet(extendedCSS = '', props = {}) {\n if (this.css) {\n // @ts-expect-error: update dt definition in primeuix/styled\n const _css = resolve(this.css, { dt }) as string;\n const _style = minifyCSS(Css`${_css}${extendedCSS}`);\n const _props = Object.entries(props)\n .reduce<string[]>((acc, [k, v]) => {\n acc.push(`${k}=\"${v}\"`);\n\n return acc;\n }, [])\n .join(' ');\n\n return `<style type=\"text/css\" data-primereact-style-id=\"${this.name}\" ${_props}>${_style}</style>`;\n }\n\n return '';\n },\n getCommonThemeStyleSheet(params?: Record<PropertyKey, unknown>, props: Record<PropertyKey, unknown> = {}) {\n return Theme.getCommonStyleSheet(this.name, params, props);\n },\n getThemeStyleSheet(params?: Record<PropertyKey, unknown>, props: Record<PropertyKey, unknown> = {}) {\n const cssArr = [Theme.getStyleSheet(this.name, params, props)];\n\n if (theme) {\n const _name = this.name === 'base' ? 'global-style' : `${this.name}-style`;\n const _css = Css`${resolve(theme, { dt })}` as string;\n const _style = minifyCSS(Theme.transformCSS(this.name, _css));\n const _props = Object.entries(props)\n .reduce<string[]>((acc, [k, v]) => {\n acc.push(`${k}=\"${v}\"`);\n\n return acc;\n }, [])\n .join(' ');\n\n cssArr.push(`<style type=\"text/css\" data-primereact-style-id=\"${_name}\" ${_props}>${_style}</style>`);\n }\n\n return cssArr.join('');\n }\n };\n\n return handler;\n }, [styles, theme, _load]);\n}\n","import type { ComponentInstance, InComponentInstance, useComponentOptions, withComponentOptions } from '@primereact/types/core';\nimport type { BaseComponentProps } from '@primereact/types/shared';\nimport type { StylesOptions } from '@primereact/types/styles';\nimport { isObject } from '@primeuix/utils';\nimport * as React from 'react';\nimport { useComponent } from './useComponent';\n\n/**\n * A higher-order component for enhancing a component with additional features.\n *\n * @template IProps The interface for the component's input properties.\n * @template DProps The interface for the component's default properties.\n * @template Exposes The interface for the properties that the component exposes.\n * @template Styles The styles options for the component.\n * @template CData Additional data to expose on the component.\n *\n * @param options The options for the component.\n * @param options.name The name of the component, used for debugging and identification.\n * @param options.defaultProps The default properties for the component.\n * @param options.styles The styles to apply to the component.\n * @param options.components Additional components to include in the component.\n * @param options.setup A setup function for additional configuration of the component.\n * @param options.render A render function for the component.\n * @returns A React component wrapped with the specified options.\n */\nexport function 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 components,\n setup,\n render\n}: withComponentOptions<IProps, DProps, Exposes, Styles, CData>) {\n type InProps<I extends ComponentInstance, T extends React.ElementType> = BaseComponentProps<I, IProps, unknown, T> & DProps;\n\n const BaseComponent = <I extends ComponentInstance, T extends React.ElementType>(inProps?: InProps<I, T>) => {\n const instance = useComponent(name, { inProps, defaultProps, styles, setup } as useComponentOptions<InProps<I, T>, DProps, Exposes, Styles>);\n\n type RenderedComponentProps = InComponentInstance<typeof instance.props, InProps<I, T>, typeof instance.state, Exposes>;\n\n const RenderedComponent = (render as React.FC<RenderedComponentProps>) ?? (() => null);\n\n return instance.props.pIf ? <RenderedComponent {...(instance as RenderedComponentProps)} /> : null;\n };\n\n const Component = React.memo(BaseComponent, (prevProps, nextProps) => {\n if (!isObject(prevProps) || !isObject(nextProps)) {\n return false;\n }\n\n // Compare shallow equality for all defaultProps keys\n return prevProps === nextProps && Object.keys(defaultProps || {}).every((key) => (prevProps as Record<string, unknown>)[key] === (nextProps as Record<string, unknown>)[key]);\n }) as unknown as typeof BaseComponent & CData & React.FC;\n\n Component.displayName = `PrimeReact.${name}`;\n Object.entries(components || {}).forEach(([key, value]) => {\n (Component as Record<string, unknown>)[key] = value;\n });\n\n return Component;\n}\n"],"mappings":"8lBAAA,OAAS,kBAAAA,OAAsB,yBAE/B,OAAS,MAAAC,GAAI,WAAAC,MAAe,kBAC5B,UAAYC,MAAW,QAOhB,SAASC,GAA2DC,EAA6B,CAAC,EAAG,CAV5G,IAAAC,EAAAC,EAAAC,EAAAC,EAWI,IAA0EC,EAAAL,EAAlE,KAAAM,EAAM,GAAM,MAAAC,EAAO,UAAAC,EAAW,GAAAC,EAAI,QAAAC,EAAS,SAAAC,CAXvD,EAW8EN,EAAVO,EAAAC,EAAUR,EAAV,CAAxD,MAAY,QAAO,YAAW,KAAI,UAAS,aAEnD,GAAIC,IAAQ,GAAO,OAAO,KAE1B,IAAMQ,EAAeL,KAAMR,EAAAU,GAAA,YAAAA,EAAU,QAAV,YAAAV,EAAiB,KAAY,WAClDc,EAAgBL,KAAWR,EAAAS,GAAA,YAAAA,EAAU,QAAV,YAAAT,EAAiB,SAC5Cc,EAAaF,IAAsB,WAEsCG,EAAAL,EAAv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ACA,CAAQ,CAAC,EAE9IA,CACX,CI9CA,OAAS,YAAAC,OAAgB,kBACzB,UAAYC,MAAW,QAqBhB,SAASC,GAAoK,CAChL,KAAAC,EAAO,mBACP,aAAAC,EACA,OAAAC,EACA,WAAAC,EACA,MAAAC,EACA,OAAAC,CACJ,EAAiE,CAa7D,IAAMC,EAAkB,OAVyDC,GAA4B,CACzG,IAAMC,EAAWC,GAAaT,EAAM,CAAE,QAAAO,EAAS,aAAAN,EAAc,OAAAC,EAAQ,MAAAE,CAAM,CAAgE,EAIrIM,EAAqBL,GAAA,KAAAA,EAAgD,IAAM,KAEjF,OAAOG,EAAS,MAAM,IAAM,gBAACE,EAAAC,EAAA,GAAuBH,EAAqC,EAAK,IAClG,EAE4C,CAACI,EAAWC,IAChD,CAACC,GAASF,CAAS,GAAK,CAACE,GAASD,CAAS,EACpC,GAIJD,IAAcC,GAAa,OAAO,KAAKZ,GAAgB,CAAC,CAAC,EAAE,MAAOc,GAASH,EAAsCG,CAAG,IAAOF,EAAsCE,CAAG,CAAC,CAC/K,EAED,OAAAT,EAAU,YAAc,cAAcN,CAAI,GAC1C,OAAO,QAAQG,GAAc,CAAC,CAAC,EAAE,QAAQ,CAAC,CAACY,EAAKC,CAAK,IAAM,CACtDV,EAAsCS,CAAG,EAAIC,CAClD,CAAC,EAEMV,CACX","names":["isValidElement","cn","resolve","React","Component","inProps","_b","_c","_e","_f","_a","pIf","style","className","as","asChild","instance","props","__objRest","AsComponent","renderAsChild","isFragment","_d","ref","children","inAttrs","restAttrs","attrs","__spreadValues","content","resolve","styles","classNames","isValidElement","__spreadProps","cn","omit","globalProps","defaultComponentProps","__spreadProps","__spreadValues","omit","useBase","React","useMountEffect","useUnmountEffect","useUpdateEffect","mergeProps","getKeyValue","isArray","isFunction","isNotEmpty","isString","resolve","toFlatCase","React","useComponentPT","instance","$params","_a","_b","_c","id","name","props","attrs","$primereact","$attrSelector","_hook","hookName","selfHook","_usePT","_getPT","getKeyValue","defaultHook","_useDefaultPT","_mergeProps","fn","args","isFunction","mergeProps","_getPTValue","obj","key","params","searchInDefaultPT","searchOut","mergeSections","useMergeProps","global","_useGlobalPT","_getPTClassValue","self","_getPTSelf","__spreadProps","__spreadValues","datasets","_getPTDatasets","datasetPrefix","isExtended","isNotEmpty","toFlatCase","value","isString","isArray","pt","getValue","checkSameKey","computedValue","_key","_cKey","vfn","originalValue","$globalPT","resolve","$defaultPT","$attrsPT","result","slot","rest","currentObj","nestedKey","index","array","$attrsWithoutPT","acc","ptm","ptmi","_attrs","ptmo","useMountEffect","useUpdateEffect","useUnmountEffect","StyleRegistry","Theme","ThemeService","cn","getKeyValue","React","ThemeContext","useStyle","Css","dt","Theme","isNotEmpty","minifyCSS","resolve","toElement","React","useComponentStyleHandler","styles","elementRef","theme","ThemeContext","load","useStyle","_load","css","options","toElement","handler","__spreadProps","__spreadValues","style","extendedStyle","enableThemeTransform","name","resolvedStyle","Css","computedStyle","Theme","isNotEmpty","minifyCSS","params","preset","selector","extendedCSS","props","_css","resolve","dt","_style","_props","acc","k","v","cssArr","_name","useComponentStyle","instance","styles","$params","_a","props","$primereact","$attrSelector","elementRef","$style","useComponentStyleHandler","scopedStyleRef","_load","StyleRegistry","css","__spreadValues","$styleOptions","_loadThemeStyles","_loadStyles","_themeChangeListener","$isUnstyled","_b","_loadCoreStyles","name","_c","_d","Theme","primitive","semantic","global","style","layerOrder","_loadScopedThemeStyles","preset","scopedStyle","callback","ThemeService","cx","key","params","cn","getKeyValue","__spreadProps","sx","when","self","base","useComponent","name","options","defaultProps","__spreadValues","globalProps","baseInstance","useBase","ref","props","$params","ptx","useComponentPT","stx","useComponentStyle","instance","isObject","React","withComponent","name","defaultProps","styles","components","setup","render","Component","inProps","instance","useComponent","RenderedComponent","__spreadValues","prevProps","nextProps","isObject","key","value"]}
@@ -0,0 +1,17 @@
1
+ import * as _primereact_types_core from '@primereact/types/core';
2
+ import { PrimeReactProps } from '@primereact/types/core';
3
+ import * as React from 'react';
4
+
5
+ declare const PrimeReactContext: React.Context<PrimeReactProps | undefined>;
6
+ declare function PrimeReactProvider(inProps?: React.PropsWithChildren<PrimeReactProps>): React.JSX.Element;
7
+
8
+ declare const defaultConfigProps: PrimeReactProps;
9
+
10
+ declare function usePrimeReact(): {
11
+ config: _primereact_types_core.PrimeReactProps;
12
+ locale: _primereact_types_core.LocaleProps | undefined;
13
+ passthrough: _primereact_types_core.PassThroughProps | undefined;
14
+ theme: _primereact_types_core.ThemeProps | null;
15
+ };
16
+
17
+ export { PrimeReactContext, PrimeReactProvider, defaultConfigProps, usePrimeReact };
@@ -0,0 +1,2 @@
1
+ "use client";var h=Object.defineProperty;var f=Object.getOwnPropertySymbols;var x=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var d=(o,e,r)=>e in o?h(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,a=(o,e)=>{for(var r in e||(e={}))x.call(e,r)&&d(o,r,e[r]);if(f)for(var r of f(e))E.call(e,r)&&d(o,r,e[r]);return o};import{LocaleProvider as A}from"@primereact/core/locale";import{PassThroughProvider as _}from"@primereact/core/passthrough";import{ThemeProvider as S}from"@primereact/core/theme";import{useProps as C}from"@primereact/hooks";import{resolve as v}from"@primeuix/utils";import*as i from"react";import{FilterMatchMode as t}from"@primereact/core/api";var l={csp:{nonce:void 0},defaults:void 0,filterMatchModeOptions:{text:[t.STARTS_WITH,t.CONTAINS,t.NOT_CONTAINS,t.ENDS_WITH,t.EQUALS,t.NOT_EQUALS],numeric:[t.EQUALS,t.NOT_EQUALS,t.LESS_THAN,t.LESS_THAN_OR_EQUAL_TO,t.GREATER_THAN,t.GREATER_THAN_OR_EQUAL_TO],date:[t.DATE_IS,t.DATE_IS_NOT,t.DATE_BEFORE,t.DATE_AFTER]},inputVariant:void 0,locale:"en",pt:void 0,ptOptions:{mergeSections:!0,mergeProps:!1},ripple:!1,theme:void 0,stylesheet:void 0,unstyled:!1,zIndex:{modal:1100,overlay:1e3,menu:1e3,tooltip:1100}};var m=i.createContext(void 0);function w(o={}){var c,u;let{props:e,attrs:r}=C(o,l),[s,P]=i.useState(e.inputVariant),[R,T]=i.useState(e.defaults),p={inputVariant:s,setInputVariant:P,defaults:R,setDefaults:T};return i.createElement(m.Provider,{value:p},i.createElement(A,{lang:e.locale},i.createElement(_,a({value:e.pt},e.ptOptions),i.createElement(S,a({preset:(c=e.theme)==null?void 0:c.preset,stylesheet:e.stylesheet},(u=e.theme)==null?void 0:u.options),v(r.children,p)))))}import{LocaleContext as O}from"@primereact/core/locale";import{PassThroughContext as N}from"@primereact/core/passthrough";import{ThemeContext as L}from"@primereact/core/theme";import*as n from"react";function j(){let o=n.useContext(m),e=n.useContext(O),r=n.useContext(N),s=n.useContext(L);if(o===void 0)throw new Error("Context must be used within a PrimeReactProvider");return{config:o,locale:e,passthrough:r,theme:s}}export{m as PrimeReactContext,w as PrimeReactProvider,l as defaultConfigProps,j as usePrimeReact};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/config/PrimeReact.context.tsx","../../src/config/PrimeReact.props.ts","../../src/config/usePrimeReact.ts"],"sourcesContent":["import { LocaleProvider } from '@primereact/core/locale';\nimport { PassThroughProvider } from '@primereact/core/passthrough';\nimport { ThemeProvider } from '@primereact/core/theme';\nimport { useProps } from '@primereact/hooks';\nimport type { PrimeReactProps } from '@primereact/types/core';\nimport { resolve } from '@primeuix/utils';\nimport * as React from 'react';\nimport { defaultConfigProps } from './PrimeReact.props';\n\nexport const PrimeReactContext = React.createContext<PrimeReactProps | undefined>(undefined);\n\nexport function PrimeReactProvider(inProps: React.PropsWithChildren<PrimeReactProps> = {}) {\n const { props, attrs } = useProps(inProps, defaultConfigProps);\n\n // states\n const [inputVariant, setInputVariant] = React.useState(props.inputVariant);\n const [defaults, setDefaults] = React.useState(props.defaults);\n\n const value = {\n inputVariant,\n setInputVariant,\n defaults,\n setDefaults\n };\n\n return (\n <PrimeReactContext.Provider value={value}>\n <LocaleProvider lang={props.locale}>\n <PassThroughProvider value={props.pt} {...props.ptOptions}>\n <ThemeProvider preset={props.theme?.preset} stylesheet={props.stylesheet} {...props.theme?.options}>\n {resolve(attrs.children, value)}\n </ThemeProvider>\n </PassThroughProvider>\n </LocaleProvider>\n </PrimeReactContext.Provider>\n );\n}\n","import { FilterMatchMode } from '@primereact/core/api';\nimport type { PrimeReactProps } from '@primereact/types/core';\n\nexport const defaultConfigProps: PrimeReactProps = {\n csp: { nonce: undefined },\n defaults: undefined,\n filterMatchModeOptions: {\n text: [FilterMatchMode.STARTS_WITH, FilterMatchMode.CONTAINS, FilterMatchMode.NOT_CONTAINS, FilterMatchMode.ENDS_WITH, FilterMatchMode.EQUALS, FilterMatchMode.NOT_EQUALS],\n numeric: [FilterMatchMode.EQUALS, FilterMatchMode.NOT_EQUALS, FilterMatchMode.LESS_THAN, FilterMatchMode.LESS_THAN_OR_EQUAL_TO, FilterMatchMode.GREATER_THAN, FilterMatchMode.GREATER_THAN_OR_EQUAL_TO],\n date: [FilterMatchMode.DATE_IS, FilterMatchMode.DATE_IS_NOT, FilterMatchMode.DATE_BEFORE, FilterMatchMode.DATE_AFTER]\n },\n inputVariant: undefined,\n locale: 'en',\n pt: undefined,\n ptOptions: { mergeSections: true, mergeProps: false },\n ripple: false,\n theme: undefined,\n stylesheet: undefined,\n unstyled: false,\n zIndex: { modal: 1100, overlay: 1000, menu: 1000, tooltip: 1100 }\n};\n","import { LocaleContext } from '@primereact/core/locale';\nimport { PassThroughContext } from '@primereact/core/passthrough';\nimport { ThemeContext } from '@primereact/core/theme';\nimport * as React from 'react';\nimport { PrimeReactContext } from './PrimeReact.context';\n\nexport function usePrimeReact() {\n const config = React.useContext(PrimeReactContext);\n const locale = React.useContext(LocaleContext);\n const passthrough = React.useContext(PassThroughContext);\n const theme = React.useContext(ThemeContext);\n\n if (config === undefined) {\n throw new Error('Context must be used within a PrimeReactProvider');\n }\n\n return {\n config,\n locale,\n passthrough,\n theme\n };\n}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B,MAAOX,EAAM,IAAQA,EAAM,WAC5C,gBAACY,EAAAD,EAAA,CAAc,QAAQb,EAAAE,EAAM,QAAN,YAAAF,EAAa,OAAQ,WAAYE,EAAM,aAAgBD,EAAAC,EAAM,QAAN,YAAAD,EAAa,SACtFc,EAAQZ,EAAM,SAAUO,CAAK,CAClC,CACJ,CACJ,CACJ,CAER,CEpCA,OAAS,iBAAAM,MAAqB,0BAC9B,OAAS,sBAAAC,MAA0B,+BACnC,OAAS,gBAAAC,MAAoB,yBAC7B,UAAYC,MAAW,QAGhB,SAASC,GAAgB,CAC5B,IAAMC,EAAe,aAAWC,CAAiB,EAC3CC,EAAe,aAAWC,CAAa,EACvCC,EAAoB,aAAWC,CAAkB,EACjDC,EAAc,aAAWC,CAAY,EAE3C,GAAIP,IAAW,OACX,MAAM,IAAI,MAAM,kDAAkD,EAGtE,MAAO,CACH,OAAAA,EACA,OAAAE,EACA,YAAAE,EACA,MAAAE,CACJ,CACJ","names":["LocaleProvider","PassThroughProvider","ThemeProvider","useProps","resolve","React","FilterMatchMode","defaultConfigProps","PrimeReactContext","PrimeReactProvider","inProps","_a","_b","props","attrs","useProps","defaultConfigProps","inputVariant","setInputVariant","defaults","setDefaults","value","LocaleProvider","PassThroughProvider","__spreadValues","ThemeProvider","resolve","LocaleContext","PassThroughContext","ThemeContext","React","usePrimeReact","config","PrimeReactContext","locale","LocaleContext","passthrough","PassThroughContext","theme","ThemeContext"]}
@@ -0,0 +1,28 @@
1
+ import * as _primereact_types_core from '@primereact/types/core';
2
+ import { useHeadlessOptions, HeadlessInstance, withHeadlessOptions } from '@primereact/types/core';
3
+
4
+ /**
5
+ * A custom hook for using headless components.
6
+ *
7
+ * @param name The name of the headless component.
8
+ * @param options Options for the headless component.
9
+ * @returns The headless instance.
10
+ */
11
+ declare function useHeadless<IProps, DProps, Exposes extends Record<PropertyKey, unknown>>(name?: string, options?: useHeadlessOptions<IProps, DProps, Exposes>): HeadlessInstance<DProps, IProps, Exposes>;
12
+
13
+ /**
14
+ * Higher-order component for using headless components.
15
+ *
16
+ * @template IProps The input properties type for the headless component.
17
+ * @template DProps The default properties type for the headless component.
18
+ * @template Exposes The properties that the headless component exposes.
19
+ *
20
+ * @param options The options for the headless component.
21
+ * @param options.name The name of the headless component.
22
+ * @param options.defaultProps The default properties for the headless component.
23
+ * @param options.setup The setup function for the headless component.
24
+ * @returns A function that takes in props and returns the headless instance.
25
+ */
26
+ declare function withHeadless<IProps, DProps, Exposes extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>>({ name, defaultProps, setup }: withHeadlessOptions<IProps, DProps, Exposes>): (inProps?: IProps) => _primereact_types_core.HeadlessInstance<DProps, IProps, Exposes>;
27
+
28
+ export { useHeadless, withHeadless };
@@ -0,0 +1,2 @@
1
+ import{useBase as t}from"@primereact/core/base";function r(e="UnknownHeadless",s={}){return t(e,s)}function d({name:e,defaultProps:s,setup:o}){return p=>r(e,{inProps:p,defaultProps:s,setup:o})}export{r as useHeadless,d as withHeadless};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/headless/useHeadless.ts","../../src/headless/withHeadless.ts"],"sourcesContent":["import { useBase } from '@primereact/core/base';\nimport type { HeadlessInstance, useHeadlessOptions } from '@primereact/types/core';\n\n/**\n * A custom hook for using headless components.\n *\n * @param name The name of the headless component.\n * @param options Options for the headless component.\n * @returns The headless instance.\n */\nexport function useHeadless<IProps, DProps, Exposes extends Record<PropertyKey, unknown>>(name: string = 'UnknownHeadless', options: useHeadlessOptions<IProps, DProps, Exposes> = {}) {\n const baseInstance = useBase(name, options as useHeadlessOptions<IProps & { id?: string; ref?: React.Ref<unknown> }, typeof options.defaultProps & DProps, Exposes>);\n\n return baseInstance as HeadlessInstance<DProps, IProps, Exposes>;\n}\n","import type { withHeadlessOptions } from '@primereact/types/core';\nimport { useHeadless } from './useHeadless';\n\n/**\n * Higher-order component for using headless components.\n *\n * @template IProps The input properties type for the headless component.\n * @template DProps The default properties type for the headless component.\n * @template Exposes The properties that the headless component exposes.\n *\n * @param options The options for the headless component.\n * @param options.name The name of the headless component.\n * @param options.defaultProps The default properties for the headless component.\n * @param options.setup The setup function for the headless component.\n * @returns A function that takes in props and returns the headless instance.\n */\nexport function withHeadless<IProps, DProps, Exposes extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>>({ name, defaultProps, setup }: withHeadlessOptions<IProps, DProps, Exposes>) {\n return (inProps?: IProps) => {\n return useHeadless(name, { inProps, defaultProps, setup });\n };\n}\n"],"mappings":"AAAA,OAAS,WAAAA,MAAe,wBAUjB,SAASC,EAA0EC,EAAe,kBAAmBC,EAAuD,CAAC,EAAG,CAGnL,OAFqBH,EAAQE,EAAMC,CAAgI,CAGvK,CCEO,SAASC,EAA0G,CAAE,KAAAC,EAAM,aAAAC,EAAc,MAAAC,CAAM,EAAiD,CACnM,OAAQC,GACGC,EAAYJ,EAAM,CAAE,QAAAG,EAAS,aAAAF,EAAc,MAAAC,CAAM,CAAC,CAEjE","names":["useBase","useHeadless","name","options","withHeadless","name","defaultProps","setup","inProps","useHeadless"]}
@@ -0,0 +1,40 @@
1
+ import * as _primereact_types_shared from '@primereact/types/shared';
2
+ import * as _primereact_types_core from '@primereact/types/core';
3
+ import { IconProps, withComponentOptions, IconExposes } from '@primereact/types/core';
4
+ import * as React from 'react';
5
+ import { StylesOptions } from '@primereact/types/styles';
6
+
7
+ declare const Icon: (<I extends _primereact_types_core.ComponentInstance, T extends React.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_core.IconProps) | undefined) => React.JSX.Element | null) & Record<string, unknown> & React.FC<{}>;
8
+
9
+ declare const defaultIconProps: IconProps;
10
+
11
+ declare const styles: StylesOptions;
12
+
13
+ declare const useIcon: (inProps?: unknown) => _primereact_types_core.HeadlessInstance<unknown, unknown, {
14
+ pti: () => {
15
+ role: string | undefined;
16
+ 'aria-hidden': boolean;
17
+ };
18
+ }>;
19
+
20
+ /**
21
+ * Higher-order component for enhancing icon components.
22
+ *
23
+ * @template IProps - The interface for the icon component's props.
24
+ * @template DProps - The interface for the default properties of the icon component.
25
+ * @template Exposes - The interface for the properties exposed by the icon component.
26
+ * @template Styles - The styles options for the icon component.
27
+ * @template CData - The context data for the icon component.
28
+ *
29
+ * @param options - The options for the icon component.
30
+ * @param options.name - The name of the icon component.
31
+ * @param options.defaultProps - The default properties for the icon component.
32
+ * @param options.styles - The styles options for the icon component.
33
+ * @param options.components - The components to be used within the icon component.
34
+ * @param options.setup - The setup function for the icon component.
35
+ * @param options.render - The render function for the icon component.
36
+ * @returns A React component wrapped with the specified options.
37
+ */
38
+ declare function withIcon<IProps, DProps, Exposes extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>, Styles = StylesOptions, CData = Record<string, unknown>>({ name, defaultProps, styles, components, setup, render }: withComponentOptions<IProps, DProps, Exposes & IconExposes, Styles, CData>): (<I extends _primereact_types_core.ComponentInstance, T extends React.ElementType>(inProps?: (IProps & _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> | keyof IProps> & DProps) | undefined) => React.JSX.Element | null) & CData & React.FC<{}>;
39
+
40
+ export { Icon, defaultIconProps, styles, useIcon, withIcon };
package/icon/index.mjs ADDED
@@ -0,0 +1,46 @@
1
+ "use client";var h=Object.defineProperty;var c=Object.getOwnPropertySymbols;var g=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var f=(o,e,t)=>e in o?h(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,n=(o,e)=>{for(var t in e||(e={}))g.call(e,t)&&f(o,t,e[t]);if(c)for(var t of c(e))k.call(e,t)&&f(o,t,e[t]);return o};import{Component as C}from"@primereact/core/component";import{mergeProps as D}from"@primeuix/utils";import*as P from"react";var l={as:"i",size:void 0,rotate:void 0,flip:void 0,spin:!1};import{$dt as d}from"@primeuix/styled";var b=`
2
+ .p-icon {
3
+ display: inline-block;
4
+ vertical-align: baseline;
5
+ font-size: dt('icon.size');
6
+ width: dt('icon.size');
7
+ height: dt('icon.size');
8
+ transform: rotate(dt('icon.rotate'));
9
+ }
10
+
11
+ .p-icon-flip-horizontal {
12
+ transform: scaleX(-1);
13
+ }
14
+
15
+ .p-icon-flip-vertical {
16
+ transform: scaleY(-1);
17
+ }
18
+
19
+ .p-icon-spin {
20
+ -webkit-animation: p-icon-spin 2s infinite linear;
21
+ animation: p-icon-spin 2s infinite linear;
22
+ }
23
+
24
+ @-webkit-keyframes p-icon-spin {
25
+ 0% {
26
+ -webkit-transform: rotate(0deg);
27
+ transform: rotate(0deg);
28
+ }
29
+ 100% {
30
+ -webkit-transform: rotate(359deg);
31
+ transform: rotate(359deg);
32
+ }
33
+ }
34
+
35
+ @keyframes p-icon-spin {
36
+ 0% {
37
+ -webkit-transform: rotate(0deg);
38
+ transform: rotate(0deg);
39
+ }
40
+ 100% {
41
+ -webkit-transform: rotate(359deg);
42
+ transform: rotate(359deg);
43
+ }
44
+ }
45
+ `,y={name:"icon",css:b,classes:{root:({props:o})=>["p-icon",{"p-icon-spin":o.spin,"p-icon-flip-horizontal":o.flip==="horizontal","p-icon-flip-vertical":o.flip==="vertical"}]},inlineStyles:{root:({props:o})=>n(n({},o.size?{[d("icon.size").name]:o.size}:void 0),o.rotate?{[d("icon.rotate").name]:`${o.rotate}deg`}:void 0)}};import{withComponent as S}from"@primereact/core/component";import{resolve as E}from"@primeuix/utils";import*as I from"react";import{withHeadless as z}from"@primereact/core/headless";import{isEmpty as u}from"@primeuix/utils";var x=z({name:"useIcon",setup({attrs:o}){return{pti:()=>{let t=u(o["aria-label"]);return{role:t?void 0:"img","aria-hidden":u(o.tabIndex)&&t}}}}});function w({name:o,defaultProps:e,styles:t,components:p,setup:i,render:a}){return S({name:`${o!=null?o:"Unknown"}Icon`,defaultProps:e,styles:t,components:p,setup(r){let s=x(r==null?void 0:r.inProps),m=E(i,r);return I.useMemo(()=>n(n({},s),m),[s,m])},render:a})}var J=w({name:"Icon",styles:y,defaultProps:l,render(o){let{id:e,props:t,ptmi:p,pti:i,cx:a,sx:r}=o,s=D({id:e,style:r("root"),className:a("root")},i==null?void 0:i(),p("root"));return P.createElement(C,{instance:o,attrs:s,children:t.children})}});export{J as Icon,l as defaultIconProps,y as styles,x as useIcon,w as withIcon};
46
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/icon/Icon.tsx","../../src/icon/Icon.props.ts","../../src/icon/Icon.style.ts","../../src/icon/withIcon.tsx","../../src/icon/useIcon.ts"],"sourcesContent":["import { Component } from '@primereact/core/component';\nimport { mergeProps } from '@primeuix/utils';\nimport * as React from 'react';\nimport { defaultIconProps } from './Icon.props';\nimport { styles } from './Icon.style';\nimport { withIcon } from './withIcon';\n\nexport const Icon = withIcon({\n name: 'Icon',\n styles,\n defaultProps: defaultIconProps,\n render(instance) {\n const { id, props, ptmi, pti, cx, sx } = instance;\n\n const rootProps = mergeProps(\n {\n id,\n style: sx('root'),\n className: cx('root')\n },\n pti?.(),\n ptmi('root')\n );\n\n return <Component instance={instance} attrs={rootProps} children={props.children} />;\n }\n});\n","import type { IconProps } from '@primereact/types/core';\n\nexport const defaultIconProps: IconProps = {\n as: 'i',\n size: undefined,\n rotate: undefined,\n flip: undefined,\n spin: false\n};\n","import type { StylesOptions } from '@primereact/types/styles';\nimport { $dt } from '@primeuix/styled';\n\nconst css = /*css*/ `\n.p-icon {\n display: inline-block;\n vertical-align: baseline;\n font-size: dt('icon.size');\n width: dt('icon.size');\n height: dt('icon.size');\n transform: rotate(dt('icon.rotate'));\n}\n\n.p-icon-flip-horizontal {\n transform: scaleX(-1);\n}\n\n.p-icon-flip-vertical {\n transform: scaleY(-1);\n}\n\n.p-icon-spin {\n -webkit-animation: p-icon-spin 2s infinite linear;\n animation: p-icon-spin 2s infinite linear;\n}\n\n@-webkit-keyframes p-icon-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n\n@keyframes p-icon-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n`;\n\nexport const styles = {\n name: 'icon',\n css,\n classes: {\n root: ({ props }) => [\n 'p-icon',\n {\n 'p-icon-spin': props.spin,\n 'p-icon-flip-horizontal': props.flip === 'horizontal',\n 'p-icon-flip-vertical': props.flip === 'vertical'\n }\n ]\n },\n inlineStyles: {\n root: ({ props }) => ({\n ...(props.size ? { [$dt('icon.size').name]: props.size } : undefined),\n ...(props.rotate ? { [$dt('icon.rotate').name]: `${props.rotate}deg` } : undefined)\n })\n }\n} as StylesOptions;\n","import { withComponent } from '@primereact/core/component';\nimport type { BaseSetup, IconExposes, withComponentOptions } from '@primereact/types/core';\nimport type { StylesOptions } from '@primereact/types/styles';\nimport { resolve } from '@primeuix/utils';\nimport * as React from 'react';\nimport { useIcon } from './useIcon';\n\n/**\n * Higher-order component for enhancing icon components.\n *\n * @template IProps - The interface for the icon component's props.\n * @template DProps - The interface for the default properties of the icon component.\n * @template Exposes - The interface for the properties exposed by the icon component.\n * @template Styles - The styles options for the icon component.\n * @template CData - The context data for the icon component.\n *\n * @param options - The options for the icon component.\n * @param options.name - The name of the icon component.\n * @param options.defaultProps - The default properties for the icon component.\n * @param options.styles - The styles options for the icon component.\n * @param options.components - The components to be used within the icon component.\n * @param options.setup - The setup function for the icon component.\n * @param options.render - The render function for the icon component.\n * @returns A React component wrapped with the specified options.\n */\nexport function withIcon<IProps, DProps, Exposes extends Record<PropertyKey, unknown> = Record<PropertyKey, unknown>, Styles = StylesOptions, CData = Record<string, unknown>>({\n name,\n defaultProps,\n styles,\n components,\n setup,\n render\n}: withComponentOptions<IProps, DProps, Exposes & IconExposes, Styles, CData>) {\n return withComponent<IProps, DProps, Exposes & IconExposes, Styles, CData>({\n name: `${name ?? 'Unknown'}Icon`,\n defaultProps,\n styles,\n components,\n setup(instance) {\n const icon = useIcon(instance?.inProps);\n const computedSetup = resolve(setup as BaseSetup<typeof instance.props, IProps, Exposes>, instance) as Exposes;\n\n return React.useMemo(\n () => ({\n ...icon,\n ...computedSetup\n }),\n [icon, computedSetup]\n );\n },\n render\n });\n}\n","import { withHeadless } from '@primereact/core/headless';\nimport { isEmpty } from '@primeuix/utils';\n\nexport const useIcon = withHeadless({\n name: 'useIcon',\n setup({ attrs }) {\n const pti = () => {\n const isAriaLabelEmpty = isEmpty(attrs['aria-label']);\n\n return {\n role: !isAriaLabelEmpty ? 'img' : undefined,\n 'aria-hidden': isEmpty(attrs.tabIndex) && isAriaLabelEmpty\n };\n };\n\n return {\n pti\n };\n }\n});\n"],"mappings":"sWAAA,OAAS,aAAAA,MAAiB,6BAC1B,OAAS,cAAAC,MAAkB,kBAC3B,UAAYC,MAAW,QCAhB,IAAMC,EAA8B,CACvC,GAAI,IACJ,KAAM,OACN,OAAQ,OACR,KAAM,OACN,KAAM,EACV,ECPA,OAAS,OAAAC,MAAW,mBAEpB,IAAMC,EAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA8CPC,EAAS,CAClB,KAAM,OACN,IAAAD,EACA,QAAS,CACL,KAAM,CAAC,CAAE,MAAAE,CAAM,IAAM,CACjB,SACA,CACI,cAAeA,EAA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C,EAAU,CACb,GAAM,CAAE,GAAAC,EAAI,MAAAC,EAAO,KAAAC,EAAM,IAAAC,EAAK,GAAAC,EAAI,GAAAC,CAAG,EAAIN,EAEnCO,EAAYC,EACd,CACI,GAAAP,EACA,MAAOK,EAAG,MAAM,EAChB,UAAWD,EAAG,MAAM,CACxB,EACAD,GAAA,YAAAA,IACAD,EAAK,MAAM,CACf,EAEA,OAAO,gBAACM,EAAA,CAAU,SAAUT,EAAU,MAAOO,EAAW,SAAUL,EAAM,SAAU,CACtF,CACJ,CAAC","names":["Component","mergeProps","React","defaultIconProps","$dt","css","styles","props","__spreadValues","$dt","withComponent","resolve","React","withHeadless","isEmpty","useIcon","attrs","isAriaLabelEmpty","withIcon","name","defaultProps","styles","components","setup","render","withComponent","instance","icon","useIcon","computedSetup","resolve","__spreadValues","Icon","withIcon","styles","defaultIconProps","instance","id","props","ptmi","pti","cx","sx","rootProps","mergeProps","Component"]}
package/index.d.mts ADDED
@@ -0,0 +1,13 @@
1
+ export * from '@primereact/core/api';
2
+ export * from '@primereact/core/base';
3
+ export * from '@primereact/core/component';
4
+ export * from '@primereact/core/config';
5
+ export * from '@primereact/core/headless';
6
+ export * from '@primereact/core/icon';
7
+ export * from '@primereact/core/locale';
8
+ export * from '@primereact/core/motion';
9
+ export * from '@primereact/core/passthrough';
10
+ export * from '@primereact/core/stylesheet';
11
+ export * from '@primereact/core/theme';
12
+ export * from '@primereact/core/use-style';
13
+ export * from '@primereact/core/utils';
package/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ export*from"@primereact/core/api";export*from"@primereact/core/base";export*from"@primereact/core/component";export*from"@primereact/core/config";export*from"@primereact/core/headless";export*from"@primereact/core/icon";export*from"@primereact/core/locale";export*from"@primereact/core/motion";export*from"@primereact/core/passthrough";export*from"@primereact/core/stylesheet";export*from"@primereact/core/theme";export*from"@primereact/core/use-style";export*from"@primereact/core/utils";
2
+ //# sourceMappingURL=index.mjs.map
package/index.mjs.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/***************** PrimeReact Core (Auto-Generated) *****************/\n\nexport * from '@primereact/core/api';\nexport * from '@primereact/core/base';\nexport * from '@primereact/core/component';\nexport * from '@primereact/core/config';\nexport * from '@primereact/core/headless';\nexport * from '@primereact/core/icon';\nexport * from '@primereact/core/locale';\nexport * from '@primereact/core/motion';\nexport * from '@primereact/core/passthrough';\nexport * from '@primereact/core/stylesheet';\nexport * from '@primereact/core/theme';\nexport * from '@primereact/core/use-style';\nexport * from '@primereact/core/utils';\n"],"mappings":"AAEA,WAAc,uBACd,WAAc,wBACd,WAAc,6BACd,WAAc,0BACd,WAAc,4BACd,WAAc,wBACd,WAAc,0BACd,WAAc,0BACd,WAAc,+BACd,WAAc,8BACd,WAAc,yBACd,WAAc,6BACd,WAAc","names":[]}
@@ -0,0 +1,12 @@
1
+ import * as _primereact_types_core from '@primereact/types/core';
2
+ import { LocaleProps } from '@primereact/types/core';
3
+ import * as React from 'react';
4
+
5
+ declare const LocaleContext: React.Context<LocaleProps | undefined>;
6
+ declare const LocaleProvider: (inProps?: React.PropsWithChildren<LocaleProps>) => React.JSX.Element;
7
+
8
+ declare const defaultLocaleProps: LocaleProps;
9
+
10
+ declare function useLocale(): _primereact_types_core.LocaleProps;
11
+
12
+ export { LocaleContext, LocaleProvider, defaultLocaleProps, useLocale };
@@ -0,0 +1,2 @@
1
+ import{useProps as p}from"@primereact/hooks";import{resolve as s}from"@primeuix/utils";import*as o from"react";var c={lang:"en"};var r=o.createContext(void 0),d=(e={})=>{let{attrs:n}=p(e,c),t=void 0;return o.createElement(r.Provider,{value:t},s(n.children,t))};import*as a from"react";function L(){let e=a.useContext(r);if(e===void 0)throw new Error("Context must be used within a LocaleProvider");return e}export{r as LocaleContext,d as LocaleProvider,c as defaultLocaleProps,L as useLocale};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +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"]}