@radix-ui/react-primitive 0.0.12 → 0.0.13
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.
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.module.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as Polymorphic from "@radix-ui/react-polymorphic";
|
|
2
2
|
import * as React from "react";
|
|
3
|
+
declare const DEFAULT_TAG = "div";
|
|
3
4
|
type PrimitiveOwnProps = {};
|
|
4
|
-
export
|
|
5
|
-
export const
|
|
6
|
-
|
|
5
|
+
export type PrimitivePrimitive = Polymorphic.ForwardRefComponent<typeof DEFAULT_TAG, PrimitiveOwnProps>;
|
|
6
|
+
export const Primitive: PrimitivePrimitive;
|
|
7
|
+
export const Root: PrimitivePrimitive;
|
|
8
|
+
export type ExtendedPrimitive<C, As> = Polymorphic.ForwardRefComponent<As, Polymorphic.OwnProps<C>>;
|
|
7
9
|
type DefaultProps<C, As> = {
|
|
8
10
|
as?: As;
|
|
9
11
|
} & Omit<Partial<React.ComponentProps<ExtendedPrimitive<C, As>>>, 'as'>;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"A;A;
|
|
1
|
+
{"mappings":"A;A;AASA,QAAA,MAAM,mBAAmB,CAAC;AAE1B,yBAAyB,EAAE,CAAC;AAC5B,iCAA0B,YAAY,mBAAmB,CAAC,kBAAkB,EAAE,iBAAiB,CAAC,CAAC;AAEjG,OAAA,MAAM,6BAGkB,CAAC;AAMzB,OAAA,MAAM,wBAAgB,CAAC;ACnBvB,8BAAuB,CAAC,EAAE,EAAE,IAAI,YAAY,mBAAmB,CAAC,EAAE,EAAE,YAAY,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7F,kBAAkB,CAAC,EAAE,EAAE,IAAI;IAAE,EAAE,CAAC,EAAE,EAAE,CAAA;CAAE,GAAG,IAAI,CAC3C,OAAO,CAAC,MAAM,cAAc,CAAC,kBAAkB,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EACvD,IAAI,CACL,CAAC;AAEF,gCACE,CAAC,SAAS,YAAY,mBAAmB,CAAC,GAAG,EAAE,GAAG,CAAC,EACnD,SAAS,SAAS,MAAM,WAAW,GAAG,YAAY,gBAAgB,CAAC,CAAC,CAAC,EACrE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,aAAa,CAAC,EAAE,SAAS,CAAC,CAAA;CAAE,mCASrF","sources":["./packages/react/primitive/src/packages/react/primitive/src/Primitive.tsx","./packages/react/primitive/src/packages/react/primitive/src/extendPrimitive.tsx","./packages/react/primitive/src/packages/react/primitive/src/index.ts"],"sourcesContent":[null,null,null],"names":[],"version":3,"file":"index.d.ts.map"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"IAYgCA,EAAMC,EAZNC,KAYAF,KAAMC,mBACpCE,OAAOC,KAAKH,GAAQI,SAAQ,SAASC,GACvB,YAARA,GAA6B,eAARA,GAIzBH,OAAOI,eAAeP,EAAMM,EAAK,CAC/BE,YAAY,EACZC,IAAK,WACH,OAAOR,EAAOK,SAKbN,MA1BuBE,8CAClBA,EAAEQ,WAAaR,EAAES,QAAUT,ECOzC,MACMU,EAAc,
|
|
1
|
+
{"mappings":"IAYgCA,EAAMC,EAZNC,KAYAF,KAAMC,mBACpCE,OAAOC,KAAKH,GAAQI,SAAQ,SAASC,GACvB,YAARA,GAA6B,eAARA,GAIzBH,OAAOI,eAAeP,EAAMM,EAAK,CAC/BE,YAAY,EACZC,IAAK,WACH,OAAOR,EAAOK,SAKbN,MA1BuBE,8CAClBA,EAAEQ,WAAaR,EAAES,QAAUT,ECOzC,MACMU,EAAc,MAKdC,eAAYC,EAAMC,YAAW,CAACC,EAAOC,KACzC,MAAQC,GAAIC,EAAOP,KAAgBQ,GAAmBJ,eACtD,OAAOK,EAAAC,cAACH,EAADI,EAAA,GAAUH,EAAV,CAA0BI,IAAKP,4BAOxC,MAAMQ,EAAOZ,yCCbb,SAGEM,EAASO,GACT,MAAMC,eAAWb,EAAMC,YAAW,CAACC,EAAOC,KACxC,MAAMW,EAAKT,EACLU,EAAoB,IAAKH,EAAOI,gBAAiBd,gBACvD,OAAOK,EAAAC,cAACM,EAADL,EAAA,GAAQM,EAAR,CAA2BL,IAAKP,QAIzC,OADAU,EAASI,YAAcL,EAAOK,aAAe,WAAaZ,EAAKY,YACxDJ","sources":["./node_modules/@parcel/scope-hoisting/lib/helpers.js","./packages/react/primitive/src/Primitive.tsx","./packages/react/primitive/src/extendPrimitive.tsx"],"sourcesContent":["function $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$defineInteropFlag(a) {\n Object.defineProperty(a, '__esModule', {value: true});\n}\n\nfunction $parcel$reexport(e, n, v) {\n Object.defineProperty(e, n, {get: v, enumerable: true});\n}\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule') {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n },\n });\n });\n\n return dest;\n}\n\nfunction $parcel$missingModule(name) {\n var err = new Error(\"Cannot find module '\" + name + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n}\n\nvar $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n","import * as React from 'react';\n\nimport type * as Polymorphic from '@radix-ui/react-polymorphic';\n\n/* -------------------------------------------------------------------------------------------------\n * Primitive\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAME = 'Primitive';\nconst DEFAULT_TAG = 'div';\n\ntype PrimitiveOwnProps = {};\ntype PrimitivePrimitive = Polymorphic.ForwardRefComponent<typeof DEFAULT_TAG, PrimitiveOwnProps>;\n\nconst Primitive = React.forwardRef((props, forwardedRef) => {\n const { as: Comp = DEFAULT_TAG, ...primitiveProps } = props;\n return <Comp {...primitiveProps} ref={forwardedRef} />;\n}) as PrimitivePrimitive;\n\nPrimitive.displayName = NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Primitive;\n\nexport {\n Primitive,\n //\n Root,\n};\nexport type { PrimitivePrimitive };\n","import * as React from 'react';\n\nimport type * as Polymorphic from '@radix-ui/react-polymorphic';\n\ntype ExtendedPrimitive<C, As> = Polymorphic.ForwardRefComponent<As, Polymorphic.OwnProps<C>>;\ntype DefaultProps<C, As> = { as?: As } & Omit<\n Partial<React.ComponentProps<ExtendedPrimitive<C, As>>>,\n 'as'\n>;\n\nfunction extendPrimitive<\n C extends Polymorphic.ForwardRefComponent<any, any>,\n DefaultAs extends React.ElementType = Polymorphic.IntrinsicElement<C>\n>(Comp: C, config: { displayName?: string; defaultProps?: DefaultProps<C, DefaultAs> }) {\n const Extended = React.forwardRef((props, forwardedRef) => {\n const As = Comp as any;\n const propsWithDefaults = { ...config.defaultProps, ...props };\n return <As {...propsWithDefaults} ref={forwardedRef} />;\n });\n\n Extended.displayName = config.displayName || 'Extended' + Comp.displayName;\n return Extended as ExtendedPrimitive<C, DefaultAs>;\n}\n\nexport { extendPrimitive };\nexport type { ExtendedPrimitive };\n"],"names":["dest","source","a","Object","keys","forEach","key","defineProperty","enumerable","get","__esModule","default","DEFAULT_TAG","Primitive","React","forwardRef","props","forwardedRef","as","Comp","primitiveProps","_react","createElement","_babelRuntimeHelpersExtends","ref","Root","config","Extended","As","propsWithDefaults","defaultProps","displayName"],"version":3,"file":"index.js.map"}
|
package/dist/index.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"0EAQA,MACMA,EAAc,
|
|
1
|
+
{"mappings":"0EAQA,MACMA,EAAc,aAKpB,MAAMC,uBAAYC,EAAMC,YAAW,CAACC,EAAOC,KACzC,MAAQC,GAAIC,EAAOP,KAAgBQ,GAAmBJ,eACtD,OAAOK,EAAAC,cAACH,EAADI,EAAA,GAAUH,EAAV,CAA0BI,IAAKP,4BAOxC,MAAMQ,KAAOZ,iBCbb,SAASa,gBAGPP,EAASQ,GACT,MAAMC,eAAWd,EAAMC,YAAW,CAACC,EAAOC,KACxC,MAAMY,EAAKV,EACLW,EAAoB,IAAKH,EAAOI,gBAAiBf,gBACvD,OAAOK,EAAAC,cAACO,EAADN,EAAA,GAAQO,EAAR,CAA2BN,IAAKP,QAIzC,OADAW,EAASI,YAAcL,EAAOK,aAAe,WAAab,EAAKa,YACxDJ","sources":["./packages/react/primitive/src/Primitive.tsx","./packages/react/primitive/src/extendPrimitive.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport type * as Polymorphic from '@radix-ui/react-polymorphic';\n\n/* -------------------------------------------------------------------------------------------------\n * Primitive\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAME = 'Primitive';\nconst DEFAULT_TAG = 'div';\n\ntype PrimitiveOwnProps = {};\ntype PrimitivePrimitive = Polymorphic.ForwardRefComponent<typeof DEFAULT_TAG, PrimitiveOwnProps>;\n\nconst Primitive = React.forwardRef((props, forwardedRef) => {\n const { as: Comp = DEFAULT_TAG, ...primitiveProps } = props;\n return <Comp {...primitiveProps} ref={forwardedRef} />;\n}) as PrimitivePrimitive;\n\nPrimitive.displayName = NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Primitive;\n\nexport {\n Primitive,\n //\n Root,\n};\nexport type { PrimitivePrimitive };\n","import * as React from 'react';\n\nimport type * as Polymorphic from '@radix-ui/react-polymorphic';\n\ntype ExtendedPrimitive<C, As> = Polymorphic.ForwardRefComponent<As, Polymorphic.OwnProps<C>>;\ntype DefaultProps<C, As> = { as?: As } & Omit<\n Partial<React.ComponentProps<ExtendedPrimitive<C, As>>>,\n 'as'\n>;\n\nfunction extendPrimitive<\n C extends Polymorphic.ForwardRefComponent<any, any>,\n DefaultAs extends React.ElementType = Polymorphic.IntrinsicElement<C>\n>(Comp: C, config: { displayName?: string; defaultProps?: DefaultProps<C, DefaultAs> }) {\n const Extended = React.forwardRef((props, forwardedRef) => {\n const As = Comp as any;\n const propsWithDefaults = { ...config.defaultProps, ...props };\n return <As {...propsWithDefaults} ref={forwardedRef} />;\n });\n\n Extended.displayName = config.displayName || 'Extended' + Comp.displayName;\n return Extended as ExtendedPrimitive<C, DefaultAs>;\n}\n\nexport { extendPrimitive };\nexport type { ExtendedPrimitive };\n"],"names":["DEFAULT_TAG","Primitive","React","forwardRef","props","forwardedRef","as","Comp","primitiveProps","_react","createElement","_babelRuntimeHelpersEsmExtends","ref","Root","extendPrimitive","config","Extended","As","propsWithDefaults","defaultProps","displayName"],"version":3,"file":"index.module.js.map"}
|