@elliemae/ds-props-helpers 3.53.0-alpha.1 → 3.53.0-alpha.3
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/cjs/globalProps/useGetGlobalAttributes.js.map +2 -2
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/useDeprecateComponent/index.js.map +2 -2
- package/dist/cjs/xstyledProps/index.js +1 -0
- package/dist/cjs/xstyledProps/index.js.map +2 -2
- package/dist/cjs/xstyledProps/useGetXstyledProps.js +10 -11
- package/dist/cjs/xstyledProps/useGetXstyledProps.js.map +2 -2
- package/dist/esm/globalProps/useGetGlobalAttributes.js.map +2 -2
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/useDeprecateComponent/index.js.map +2 -2
- package/dist/esm/xstyledProps/index.js +2 -1
- package/dist/esm/xstyledProps/index.js.map +2 -2
- package/dist/esm/xstyledProps/useGetXstyledProps.js +10 -11
- package/dist/esm/xstyledProps/useGetXstyledProps.js.map +2 -2
- package/dist/types/globalProps/useGetGlobalAttributes.d.ts +6 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/propTypes/describeGuards.d.ts +8 -9
- package/dist/types/xstyledProps/index.d.ts +1 -1
- package/dist/types/xstyledProps/useGetXstyledProps.d.ts +1 -0
- package/package.json +5 -5
- package/dist/cjs/tests/globalProps/TestComponent.js +0 -41
- package/dist/cjs/tests/globalProps/TestComponent.js.map +0 -7
- package/dist/cjs/tests/validation/test.schema.js +0 -79
- package/dist/cjs/tests/validation/test.schema.js.map +0 -7
- package/dist/cjs/tests/xstyledProps/TestComponent.js +0 -42
- package/dist/cjs/tests/xstyledProps/TestComponent.js.map +0 -7
- package/dist/esm/tests/globalProps/TestComponent.js +0 -11
- package/dist/esm/tests/globalProps/TestComponent.js.map +0 -7
- package/dist/esm/tests/validation/test.schema.js +0 -49
- package/dist/esm/tests/validation/test.schema.js.map +0 -7
- package/dist/esm/tests/xstyledProps/TestComponent.js +0 -12
- package/dist/esm/tests/xstyledProps/TestComponent.js.map +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/globalProps/useGetGlobalAttributes.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useMemo } from 'react';\nimport type { GlobalAttributes } from './constants.js';\nimport { getGlobalAttributes } from './getGlobalAttributes.js';\nimport type { GlobalAttributesT } from './getGlobalAttributes.js';\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwB;AAExB,iCAAoC;
|
|
4
|
+
"sourcesContent": ["import { useMemo } from 'react';\nimport type { GlobalAttributes } from './constants.js';\nimport { getGlobalAttributes } from './getGlobalAttributes.js';\nimport type { GlobalAttributesT } from './getGlobalAttributes.js';\n/**\n * Extracts global attributes from the props object and if overrides are provided, for functions invoke both the original and the override, for other attributes, the override takes precedence.\n * @param props - The props object from which to extract global attributes.\n * @param overrides - An optional object containing overrides for specific global attributes. NOTE: for functions, both the original and the override will be invoked.\n * @returns An object containing the extracted global attributes, with overrides applied where specified.\n */\nexport const useGetGlobalAttributes = <\n Props extends object,\n ElementType extends Element = Element,\n CustomAttributes extends object = object,\n>(\n props: Props,\n overrides?: Partial<GlobalAttributes<CallableFunction>>,\n): GlobalAttributesT<ElementType, CustomAttributes> => {\n const componentGlobalAttributes: GlobalAttributesT<ElementType, CustomAttributes> = useMemo(\n () => getGlobalAttributes<Props, ElementType, CustomAttributes>(props, overrides),\n [props, overrides],\n );\n return componentGlobalAttributes;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwB;AAExB,iCAAoC;AAQ7B,MAAM,yBAAyB,CAKpC,OACA,cACqD;AACrD,QAAM,gCAA8E;AAAA,IAClF,UAAM,gDAA0D,OAAO,SAAS;AAAA,IAChF,CAAC,OAAO,SAAS;AAAA,EACnB;AACA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -36,6 +36,7 @@ __export(index_exports, {
|
|
|
36
36
|
getPropsPerDatatestIdPropTypes: () => import_propsPerDataTestId.getPropsPerDatatestIdPropTypes,
|
|
37
37
|
getPropsPerDatatestid: () => import_propsPerDataTestId.getPropsPerDatatestid,
|
|
38
38
|
getPropsPerSlotPropTypes: () => import_propsPerSlot.getPropsPerSlotPropTypes,
|
|
39
|
+
getXstyledProps: () => import_xstyledProps.getXstyledProps,
|
|
39
40
|
globalAttributesPropTypes: () => import_globalProps.globalAttributesPropTypes,
|
|
40
41
|
throwRequiredError: () => import_validation.throwRequiredError,
|
|
41
42
|
throwTypeError: () => import_validation.throwTypeError,
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export { useMemoMergePropsWithDefault } from './defaultProps/index.js';\nexport { getAriaProps, getDataProps } from './getProps/index.js';\nexport {\n getGlobalAttributes,\n useGetGlobalAttributes,\n globalAttributesPropTypes,\n type GlobalAttributesT,\n} from './globalProps/index.js';\nexport { describe, PropTypes, type DSPropTypesSchema } from './propTypes/index.js';\nexport type { ValidationMap } from 'prop-types';\nexport {\n throwTypeError,\n throwRequiredError,\n useValidateTypescriptPropTypes,\n validateTypescriptPropTypesImplementation,\n} from './validation/index.js';\nexport { type XstyledProps, useGetXstyledProps, xstyledPropTypes } from './xstyledProps/index.js';\nexport { useDeprecateComponent } from './useDeprecateComponent/index.js';\n\nexport { getPropsPerDatatestid, getPropsPerDatatestIdPropTypes } from './propsPerDataTestId/index.js';\nexport { getPropsPerSlotPropTypes } from './propsPerSlot/index.js';\nexport { useOwnerProps } from './useOwnerProps/index.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0BAA6C;AAC7C,sBAA2C;AAC3C,yBAKO;AACP,uBAA4D;AAE5D,wBAKO;AACP,
|
|
4
|
+
"sourcesContent": ["export { useMemoMergePropsWithDefault } from './defaultProps/index.js';\nexport { getAriaProps, getDataProps } from './getProps/index.js';\nexport {\n getGlobalAttributes,\n useGetGlobalAttributes,\n globalAttributesPropTypes,\n type GlobalAttributesT,\n} from './globalProps/index.js';\nexport { describe, PropTypes, type DSPropTypesSchema } from './propTypes/index.js';\nexport type { ValidationMap } from 'prop-types';\nexport {\n throwTypeError,\n throwRequiredError,\n useValidateTypescriptPropTypes,\n validateTypescriptPropTypesImplementation,\n} from './validation/index.js';\nexport { type XstyledProps, useGetXstyledProps, xstyledPropTypes, getXstyledProps } from './xstyledProps/index.js';\nexport { useDeprecateComponent } from './useDeprecateComponent/index.js';\n\nexport { getPropsPerDatatestid, getPropsPerDatatestIdPropTypes } from './propsPerDataTestId/index.js';\nexport { getPropsPerSlotPropTypes } from './propsPerSlot/index.js';\nexport { useOwnerProps } from './useOwnerProps/index.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0BAA6C;AAC7C,sBAA2C;AAC3C,yBAKO;AACP,uBAA4D;AAE5D,wBAKO;AACP,0BAAyF;AACzF,mCAAsC;AAEtC,gCAAsE;AACtE,0BAAyC;AACzC,2BAA8B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/useDeprecateComponent/index.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable no-console */\nimport { useEffect } from 'react';\n\ninterface Props {\n componentName: string;\n version: string;\n}\n\nexport const useDeprecateComponent = ({ componentName, version }: Props) => {\n useEffect(() => {\n if (process.env.NODE_ENV !== 'production')\n console.warn(`Warning: ${componentName}:: this component will be deprecated in version: ${version}.`);\n }, [componentName, version]);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAA0B;AAOnB,MAAM,wBAAwB,CAAC,EAAE,eAAe,QAAQ,MAAa;AAC1E,8BAAU,MAAM;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable no-console */\nimport { useEffect } from 'react';\n\ninterface Props {\n componentName: string;\n version: string;\n}\n\nexport const useDeprecateComponent = ({ componentName, version }: Props) => {\n useEffect(() => {\n /*\n https://esbuild.github.io/api/#platform\n When using the build API, all process.env.NODE_ENV expressions are automatically defined to \"production\" if all minification options are enabled and \"development\" otherwise.\n This only happens if process, process.env, and process.env.NODE_ENV are not already defined.\n This substitution is necessary to avoid React-based code crashing instantly (since process is a node API, not a web API).\n */\n if (process.env.NODE_ENV !== 'production')\n console.warn(`Warning: ${componentName}:: this component will be deprecated in version: ${version}.`);\n }, [componentName, version]);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAA0B;AAOnB,MAAM,wBAAwB,CAAC,EAAE,eAAe,QAAQ,MAAa;AAC1E,8BAAU,MAAM;AAOd,QAAI;AACF,cAAQ,KAAK,YAAY,aAAa,oDAAoD,OAAO,GAAG;AAAA,EACxG,GAAG,CAAC,eAAe,OAAO,CAAC;AAC7B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -28,6 +28,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var xstyledProps_exports = {};
|
|
30
30
|
__export(xstyledProps_exports, {
|
|
31
|
+
getXstyledProps: () => import_useGetXstyledProps.getXstyledProps,
|
|
31
32
|
useGetXstyledProps: () => import_useGetXstyledProps.useGetXstyledProps,
|
|
32
33
|
xstyledPropTypes: () => import_xstyledPropTypes.xstyledPropTypes
|
|
33
34
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/xstyledProps/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export { type XstyledProps, useGetXstyledProps } from './useGetXstyledProps.js';\nexport { xstyledPropTypes } from './xstyledPropTypes.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,
|
|
4
|
+
"sourcesContent": ["export { type XstyledProps, useGetXstyledProps, getXstyledProps } from './useGetXstyledProps.js';\nexport { xstyledPropTypes } from './xstyledPropTypes.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,gCAAuE;AACvE,8BAAiC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -28,22 +28,21 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var useGetXstyledProps_exports = {};
|
|
30
30
|
__export(useGetXstyledProps_exports, {
|
|
31
|
+
getXstyledProps: () => getXstyledProps,
|
|
31
32
|
useGetXstyledProps: () => useGetXstyledProps
|
|
32
33
|
});
|
|
33
34
|
module.exports = __toCommonJS(useGetXstyledProps_exports);
|
|
34
35
|
var React = __toESM(require("react"));
|
|
35
36
|
var import_react = require("react");
|
|
36
37
|
var import_constants = require("./constants.js");
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return xstyledPropsObject;
|
|
46
|
-
}, [props]);
|
|
47
|
-
return componentXstyledProps;
|
|
38
|
+
const getXstyledProps = (props) => {
|
|
39
|
+
const xstyledPropsObject = {};
|
|
40
|
+
Object.entries(props).forEach(([key, value]) => {
|
|
41
|
+
if (key in import_constants.xstyledKeys) {
|
|
42
|
+
xstyledPropsObject[key] = value;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
return xstyledPropsObject;
|
|
48
46
|
};
|
|
47
|
+
const useGetXstyledProps = (props) => (0, import_react.useMemo)(() => getXstyledProps(props), [props]);
|
|
49
48
|
//# sourceMappingURL=useGetXstyledProps.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/xstyledProps/useGetXstyledProps.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useMemo } from 'react';\nimport type {\n SizingProps,\n SpaceProps,\n LayoutProps,\n BoxShadowProps,\n BorderProps,\n BackgroundProps,\n FontWeightProps,\n TextAlignProps,\n} from '@elliemae/ds-system';\nimport { xstyledKeys } from './constants.js';\n\nexport interface XstyledProps\n extends SpaceProps,\n SizingProps,\n LayoutProps,\n BoxShadowProps,\n BorderProps,\n BackgroundProps,\n FontWeightProps,\n TextAlignProps {}\n\ntype PropsWithXstyled<T> = T & XstyledProps;\n\nexport const
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwB;AAWxB,uBAA4B;AAcrB,MAAM,
|
|
4
|
+
"sourcesContent": ["import { useMemo } from 'react';\nimport type {\n SizingProps,\n SpaceProps,\n LayoutProps,\n BoxShadowProps,\n BorderProps,\n BackgroundProps,\n FontWeightProps,\n TextAlignProps,\n} from '@elliemae/ds-system';\nimport { xstyledKeys } from './constants.js';\n\nexport interface XstyledProps\n extends SpaceProps,\n SizingProps,\n LayoutProps,\n BoxShadowProps,\n BorderProps,\n BackgroundProps,\n FontWeightProps,\n TextAlignProps {}\n\ntype PropsWithXstyled<T> = T & XstyledProps;\n\nexport const getXstyledProps = <T,>(props: PropsWithXstyled<T>): XstyledProps => {\n const xstyledPropsObject: Record<string, unknown> = {};\n Object.entries(props).forEach(([key, value]) => {\n if (key in xstyledKeys) {\n xstyledPropsObject[key] = value;\n }\n });\n return xstyledPropsObject;\n};\n\nexport const useGetXstyledProps = <T,>(props: PropsWithXstyled<T>): XstyledProps =>\n useMemo(() => getXstyledProps(props), [props]);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwB;AAWxB,uBAA4B;AAcrB,MAAM,kBAAkB,CAAK,UAA6C;AAC/E,QAAM,qBAA8C,CAAC;AACrD,SAAO,QAAQ,KAAK,EAAE,QAAQ,CAAC,CAAC,KAAK,KAAK,MAAM;AAC9C,QAAI,OAAO,8BAAa;AACtB,yBAAmB,GAAG,IAAI;AAAA,IAC5B;AAAA,EACF,CAAC;AACD,SAAO;AACT;AAEO,MAAM,qBAAqB,CAAK,cACrC,sBAAQ,MAAM,gBAAgB,KAAK,GAAG,CAAC,KAAK,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/globalProps/useGetGlobalAttributes.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemo } from 'react';\nimport type { GlobalAttributes } from './constants.js';\nimport { getGlobalAttributes } from './getGlobalAttributes.js';\nimport type { GlobalAttributesT } from './getGlobalAttributes.js';\n
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,eAAe;AAExB,SAAS,2BAA2B;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemo } from 'react';\nimport type { GlobalAttributes } from './constants.js';\nimport { getGlobalAttributes } from './getGlobalAttributes.js';\nimport type { GlobalAttributesT } from './getGlobalAttributes.js';\n/**\n * Extracts global attributes from the props object and if overrides are provided, for functions invoke both the original and the override, for other attributes, the override takes precedence.\n * @param props - The props object from which to extract global attributes.\n * @param overrides - An optional object containing overrides for specific global attributes. NOTE: for functions, both the original and the override will be invoked.\n * @returns An object containing the extracted global attributes, with overrides applied where specified.\n */\nexport const useGetGlobalAttributes = <\n Props extends object,\n ElementType extends Element = Element,\n CustomAttributes extends object = object,\n>(\n props: Props,\n overrides?: Partial<GlobalAttributes<CallableFunction>>,\n): GlobalAttributesT<ElementType, CustomAttributes> => {\n const componentGlobalAttributes: GlobalAttributesT<ElementType, CustomAttributes> = useMemo(\n () => getGlobalAttributes<Props, ElementType, CustomAttributes>(props, overrides),\n [props, overrides],\n );\n return componentGlobalAttributes;\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,eAAe;AAExB,SAAS,2BAA2B;AAQ7B,MAAM,yBAAyB,CAKpC,OACA,cACqD;AACrD,QAAM,4BAA8E;AAAA,IAClF,MAAM,oBAA0D,OAAO,SAAS;AAAA,IAChF,CAAC,OAAO,SAAS;AAAA,EACnB;AACA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
useValidateTypescriptPropTypes,
|
|
14
14
|
validateTypescriptPropTypesImplementation
|
|
15
15
|
} from "./validation/index.js";
|
|
16
|
-
import { useGetXstyledProps, xstyledPropTypes } from "./xstyledProps/index.js";
|
|
16
|
+
import { useGetXstyledProps, xstyledPropTypes, getXstyledProps } from "./xstyledProps/index.js";
|
|
17
17
|
import { useDeprecateComponent } from "./useDeprecateComponent/index.js";
|
|
18
18
|
import { getPropsPerDatatestid, getPropsPerDatatestIdPropTypes } from "./propsPerDataTestId/index.js";
|
|
19
19
|
import { getPropsPerSlotPropTypes } from "./propsPerSlot/index.js";
|
|
@@ -27,6 +27,7 @@ export {
|
|
|
27
27
|
getPropsPerDatatestIdPropTypes,
|
|
28
28
|
getPropsPerDatatestid,
|
|
29
29
|
getPropsPerSlotPropTypes,
|
|
30
|
+
getXstyledProps,
|
|
30
31
|
globalAttributesPropTypes,
|
|
31
32
|
throwRequiredError,
|
|
32
33
|
throwTypeError,
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { useMemoMergePropsWithDefault } from './defaultProps/index.js';\nexport { getAriaProps, getDataProps } from './getProps/index.js';\nexport {\n getGlobalAttributes,\n useGetGlobalAttributes,\n globalAttributesPropTypes,\n type GlobalAttributesT,\n} from './globalProps/index.js';\nexport { describe, PropTypes, type DSPropTypesSchema } from './propTypes/index.js';\nexport type { ValidationMap } from 'prop-types';\nexport {\n throwTypeError,\n throwRequiredError,\n useValidateTypescriptPropTypes,\n validateTypescriptPropTypesImplementation,\n} from './validation/index.js';\nexport { type XstyledProps, useGetXstyledProps, xstyledPropTypes } from './xstyledProps/index.js';\nexport { useDeprecateComponent } from './useDeprecateComponent/index.js';\n\nexport { getPropsPerDatatestid, getPropsPerDatatestIdPropTypes } from './propsPerDataTestId/index.js';\nexport { getPropsPerSlotPropTypes } from './propsPerSlot/index.js';\nexport { useOwnerProps } from './useOwnerProps/index.js';\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,oCAAoC;AAC7C,SAAS,cAAc,oBAAoB;AAC3C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,UAAU,iBAAyC;AAE5D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAA4B,oBAAoB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { useMemoMergePropsWithDefault } from './defaultProps/index.js';\nexport { getAriaProps, getDataProps } from './getProps/index.js';\nexport {\n getGlobalAttributes,\n useGetGlobalAttributes,\n globalAttributesPropTypes,\n type GlobalAttributesT,\n} from './globalProps/index.js';\nexport { describe, PropTypes, type DSPropTypesSchema } from './propTypes/index.js';\nexport type { ValidationMap } from 'prop-types';\nexport {\n throwTypeError,\n throwRequiredError,\n useValidateTypescriptPropTypes,\n validateTypescriptPropTypesImplementation,\n} from './validation/index.js';\nexport { type XstyledProps, useGetXstyledProps, xstyledPropTypes, getXstyledProps } from './xstyledProps/index.js';\nexport { useDeprecateComponent } from './useDeprecateComponent/index.js';\n\nexport { getPropsPerDatatestid, getPropsPerDatatestIdPropTypes } from './propsPerDataTestId/index.js';\nexport { getPropsPerSlotPropTypes } from './propsPerSlot/index.js';\nexport { useOwnerProps } from './useOwnerProps/index.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,oCAAoC;AAC7C,SAAS,cAAc,oBAAoB;AAC3C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,UAAU,iBAAyC;AAE5D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAA4B,oBAAoB,kBAAkB,uBAAuB;AACzF,SAAS,6BAA6B;AAEtC,SAAS,uBAAuB,sCAAsC;AACtE,SAAS,gCAAgC;AACzC,SAAS,qBAAqB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/useDeprecateComponent/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-console */\nimport { useEffect } from 'react';\n\ninterface Props {\n componentName: string;\n version: string;\n}\n\nexport const useDeprecateComponent = ({ componentName, version }: Props) => {\n useEffect(() => {\n if (process.env.NODE_ENV !== 'production')\n console.warn(`Warning: ${componentName}:: this component will be deprecated in version: ${version}.`);\n }, [componentName, version]);\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,iBAAiB;AAOnB,MAAM,wBAAwB,CAAC,EAAE,eAAe,QAAQ,MAAa;AAC1E,YAAU,MAAM;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-console */\nimport { useEffect } from 'react';\n\ninterface Props {\n componentName: string;\n version: string;\n}\n\nexport const useDeprecateComponent = ({ componentName, version }: Props) => {\n useEffect(() => {\n /*\n https://esbuild.github.io/api/#platform\n When using the build API, all process.env.NODE_ENV expressions are automatically defined to \"production\" if all minification options are enabled and \"development\" otherwise.\n This only happens if process, process.env, and process.env.NODE_ENV are not already defined.\n This substitution is necessary to avoid React-based code crashing instantly (since process is a node API, not a web API).\n */\n if (process.env.NODE_ENV !== 'production')\n console.warn(`Warning: ${componentName}:: this component will be deprecated in version: ${version}.`);\n }, [componentName, version]);\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,iBAAiB;AAOnB,MAAM,wBAAwB,CAAC,EAAE,eAAe,QAAQ,MAAa;AAC1E,YAAU,MAAM;AAOd,QAAI;AACF,cAAQ,KAAK,YAAY,aAAa,oDAAoD,OAAO,GAAG;AAAA,EACxG,GAAG,CAAC,eAAe,OAAO,CAAC;AAC7B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { useGetXstyledProps } from "./useGetXstyledProps.js";
|
|
2
|
+
import { useGetXstyledProps, getXstyledProps } from "./useGetXstyledProps.js";
|
|
3
3
|
import { xstyledPropTypes } from "./xstyledPropTypes.js";
|
|
4
4
|
export {
|
|
5
|
+
getXstyledProps,
|
|
5
6
|
useGetXstyledProps,
|
|
6
7
|
xstyledPropTypes
|
|
7
8
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/xstyledProps/index.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { type XstyledProps, useGetXstyledProps } from './useGetXstyledProps.js';\nexport { xstyledPropTypes } from './xstyledPropTypes.js';\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAA4B,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { type XstyledProps, useGetXstyledProps, getXstyledProps } from './useGetXstyledProps.js';\nexport { xstyledPropTypes } from './xstyledPropTypes.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAA4B,oBAAoB,uBAAuB;AACvE,SAAS,wBAAwB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
3
|
import { xstyledKeys } from "./constants.js";
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return xstyledPropsObject;
|
|
13
|
-
}, [props]);
|
|
14
|
-
return componentXstyledProps;
|
|
4
|
+
const getXstyledProps = (props) => {
|
|
5
|
+
const xstyledPropsObject = {};
|
|
6
|
+
Object.entries(props).forEach(([key, value]) => {
|
|
7
|
+
if (key in xstyledKeys) {
|
|
8
|
+
xstyledPropsObject[key] = value;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
return xstyledPropsObject;
|
|
15
12
|
};
|
|
13
|
+
const useGetXstyledProps = (props) => useMemo(() => getXstyledProps(props), [props]);
|
|
16
14
|
export {
|
|
15
|
+
getXstyledProps,
|
|
17
16
|
useGetXstyledProps
|
|
18
17
|
};
|
|
19
18
|
//# sourceMappingURL=useGetXstyledProps.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/xstyledProps/useGetXstyledProps.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemo } from 'react';\nimport type {\n SizingProps,\n SpaceProps,\n LayoutProps,\n BoxShadowProps,\n BorderProps,\n BackgroundProps,\n FontWeightProps,\n TextAlignProps,\n} from '@elliemae/ds-system';\nimport { xstyledKeys } from './constants.js';\n\nexport interface XstyledProps\n extends SpaceProps,\n SizingProps,\n LayoutProps,\n BoxShadowProps,\n BorderProps,\n BackgroundProps,\n FontWeightProps,\n TextAlignProps {}\n\ntype PropsWithXstyled<T> = T & XstyledProps;\n\nexport const
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,eAAe;AAWxB,SAAS,mBAAmB;AAcrB,MAAM,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemo } from 'react';\nimport type {\n SizingProps,\n SpaceProps,\n LayoutProps,\n BoxShadowProps,\n BorderProps,\n BackgroundProps,\n FontWeightProps,\n TextAlignProps,\n} from '@elliemae/ds-system';\nimport { xstyledKeys } from './constants.js';\n\nexport interface XstyledProps\n extends SpaceProps,\n SizingProps,\n LayoutProps,\n BoxShadowProps,\n BorderProps,\n BackgroundProps,\n FontWeightProps,\n TextAlignProps {}\n\ntype PropsWithXstyled<T> = T & XstyledProps;\n\nexport const getXstyledProps = <T,>(props: PropsWithXstyled<T>): XstyledProps => {\n const xstyledPropsObject: Record<string, unknown> = {};\n Object.entries(props).forEach(([key, value]) => {\n if (key in xstyledKeys) {\n xstyledPropsObject[key] = value;\n }\n });\n return xstyledPropsObject;\n};\n\nexport const useGetXstyledProps = <T,>(props: PropsWithXstyled<T>): XstyledProps =>\n useMemo(() => getXstyledProps(props), [props]);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,eAAe;AAWxB,SAAS,mBAAmB;AAcrB,MAAM,kBAAkB,CAAK,UAA6C;AAC/E,QAAM,qBAA8C,CAAC;AACrD,SAAO,QAAQ,KAAK,EAAE,QAAQ,CAAC,CAAC,KAAK,KAAK,MAAM;AAC9C,QAAI,OAAO,aAAa;AACtB,yBAAmB,GAAG,IAAI;AAAA,IAC5B;AAAA,EACF,CAAC;AACD,SAAO;AACT;AAEO,MAAM,qBAAqB,CAAK,UACrC,QAAQ,MAAM,gBAAgB,KAAK,GAAG,CAAC,KAAK,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import type { GlobalAttributes } from './constants.js';
|
|
2
2
|
import type { GlobalAttributesT } from './getGlobalAttributes.js';
|
|
3
|
+
/**
|
|
4
|
+
* Extracts global attributes from the props object and if overrides are provided, for functions invoke both the original and the override, for other attributes, the override takes precedence.
|
|
5
|
+
* @param props - The props object from which to extract global attributes.
|
|
6
|
+
* @param overrides - An optional object containing overrides for specific global attributes. NOTE: for functions, both the original and the override will be invoked.
|
|
7
|
+
* @returns An object containing the extracted global attributes, with overrides applied where specified.
|
|
8
|
+
*/
|
|
3
9
|
export declare const useGetGlobalAttributes: <Props extends object, ElementType extends Element = Element, CustomAttributes extends object = object>(props: Props, overrides?: Partial<GlobalAttributes<CallableFunction>>) => GlobalAttributesT<ElementType, CustomAttributes>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { getGlobalAttributes, useGetGlobalAttributes, globalAttributesPropTypes,
|
|
|
4
4
|
export { describe, PropTypes, type DSPropTypesSchema } from './propTypes/index.js';
|
|
5
5
|
export type { ValidationMap } from 'prop-types';
|
|
6
6
|
export { throwTypeError, throwRequiredError, useValidateTypescriptPropTypes, validateTypescriptPropTypesImplementation, } from './validation/index.js';
|
|
7
|
-
export { type XstyledProps, useGetXstyledProps, xstyledPropTypes } from './xstyledProps/index.js';
|
|
7
|
+
export { type XstyledProps, useGetXstyledProps, xstyledPropTypes, getXstyledProps } from './xstyledProps/index.js';
|
|
8
8
|
export { useDeprecateComponent } from './useDeprecateComponent/index.js';
|
|
9
9
|
export { getPropsPerDatatestid, getPropsPerDatatestIdPropTypes } from './propsPerDataTestId/index.js';
|
|
10
10
|
export { getPropsPerSlotPropTypes } from './propsPerSlot/index.js';
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import type { AllPropTypes, ParametizedPropTypes, ReactDescT } from './types.js';
|
|
1
|
+
import type { AllPropTypes, ArrayOfT, ExactT, InstanceOfT, ObjectOfT, OneOfT, OneOfTypeT, ParametizedPropTypes, ReactDescT, ShapeT } from './types.js';
|
|
3
2
|
export declare const hasArguments: (propType: ReactDescT, realPropType: AllPropTypes) => realPropType is ParametizedPropTypes;
|
|
4
|
-
export declare const isOneOfType: (propType: ReactDescT, realPropType: AllPropTypes) => realPropType is
|
|
5
|
-
export declare const isArrayOf: (propType: ReactDescT, realPropType: AllPropTypes) => realPropType is
|
|
6
|
-
export declare const isShape: (propType: ReactDescT, realPropType: AllPropTypes) => realPropType is
|
|
7
|
-
export declare const isInstanceOf: (propType: ReactDescT, realPropType: AllPropTypes) => realPropType is
|
|
8
|
-
export declare const isOneOf: (propType: ReactDescT, realPropType: AllPropTypes) => realPropType is
|
|
9
|
-
export declare const isObjectOf: (propType: ReactDescT, realPropType: AllPropTypes) => realPropType is
|
|
10
|
-
export declare const isExact: (propType: ReactDescT, realPropType: AllPropTypes) => realPropType is
|
|
3
|
+
export declare const isOneOfType: (propType: ReactDescT, realPropType: AllPropTypes) => realPropType is OneOfTypeT;
|
|
4
|
+
export declare const isArrayOf: (propType: ReactDescT, realPropType: AllPropTypes) => realPropType is ArrayOfT;
|
|
5
|
+
export declare const isShape: (propType: ReactDescT, realPropType: AllPropTypes) => realPropType is ShapeT;
|
|
6
|
+
export declare const isInstanceOf: (propType: ReactDescT, realPropType: AllPropTypes) => realPropType is InstanceOfT;
|
|
7
|
+
export declare const isOneOf: (propType: ReactDescT, realPropType: AllPropTypes) => realPropType is OneOfT;
|
|
8
|
+
export declare const isObjectOf: (propType: ReactDescT, realPropType: AllPropTypes) => realPropType is ObjectOfT;
|
|
9
|
+
export declare const isExact: (propType: ReactDescT, realPropType: AllPropTypes) => realPropType is ExactT;
|
|
11
10
|
export declare const isReactDesc: (reactDesc: object) => reactDesc is ReactDescT;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { type XstyledProps, useGetXstyledProps } from './useGetXstyledProps.js';
|
|
1
|
+
export { type XstyledProps, useGetXstyledProps, getXstyledProps } from './useGetXstyledProps.js';
|
|
2
2
|
export { xstyledPropTypes } from './xstyledPropTypes.js';
|
|
@@ -2,5 +2,6 @@ import type { SizingProps, SpaceProps, LayoutProps, BoxShadowProps, BorderProps,
|
|
|
2
2
|
export interface XstyledProps extends SpaceProps, SizingProps, LayoutProps, BoxShadowProps, BorderProps, BackgroundProps, FontWeightProps, TextAlignProps {
|
|
3
3
|
}
|
|
4
4
|
type PropsWithXstyled<T> = T & XstyledProps;
|
|
5
|
+
export declare const getXstyledProps: <T>(props: PropsWithXstyled<T>) => XstyledProps;
|
|
5
6
|
export declare const useGetXstyledProps: <T>(props: PropsWithXstyled<T>) => XstyledProps;
|
|
6
7
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-props-helpers",
|
|
3
|
-
"version": "3.53.0-alpha.
|
|
3
|
+
"version": "3.53.0-alpha.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Props Helpers",
|
|
6
6
|
"files": [
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"fast-deep-equal": "~3.1.3",
|
|
37
37
|
"prop-types": "~15.8.1",
|
|
38
|
-
"@elliemae/ds-system": "3.53.0-alpha.
|
|
39
|
-
"@elliemae/ds-typescript-helpers": "3.53.0-alpha.
|
|
38
|
+
"@elliemae/ds-system": "3.53.0-alpha.3",
|
|
39
|
+
"@elliemae/ds-typescript-helpers": "3.53.0-alpha.3"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@elliemae/pui-cli": "9.0.0-next.
|
|
42
|
+
"@elliemae/pui-cli": "9.0.0-next.65",
|
|
43
43
|
"jest": "~29.7.0",
|
|
44
44
|
"jest-cli": "~29.7.0",
|
|
45
|
-
"@elliemae/ds-monorepo-devops": "3.53.0-alpha.
|
|
45
|
+
"@elliemae/ds-monorepo-devops": "3.53.0-alpha.3"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"lodash-es": "^4.17.21",
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var TestComponent_exports = {};
|
|
30
|
-
__export(TestComponent_exports, {
|
|
31
|
-
TestComponent: () => TestComponent
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(TestComponent_exports);
|
|
34
|
-
var React = __toESM(require("react"));
|
|
35
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
-
var import_useGetGlobalAttributes = require("../../globalProps/useGetGlobalAttributes");
|
|
37
|
-
const TestComponent = (props) => {
|
|
38
|
-
const globalAttributes = (0, import_useGetGlobalAttributes.useGetGlobalAttributes)(props);
|
|
39
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...globalAttributes, children: "Some random div" });
|
|
40
|
-
};
|
|
41
|
-
//# sourceMappingURL=TestComponent.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/tests/globalProps/TestComponent.js", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["// eslint-disable-next-line import/extensions\nimport { useGetGlobalAttributes } from '../../globalProps/useGetGlobalAttributes';\n\nexport const TestComponent = (props) => {\n const globalAttributes = useGetGlobalAttributes(props);\n\n return <div {...globalAttributes}>Some random div</div>;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADMd;AALT,oCAAuC;AAEhC,MAAM,gBAAgB,CAAC,UAAU;AACtC,QAAM,uBAAmB,sDAAuB,KAAK;AAErD,SAAO,4CAAC,SAAK,GAAG,kBAAkB,6BAAe;AACnD;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var test_schema_exports = {};
|
|
30
|
-
__export(test_schema_exports, {
|
|
31
|
-
TypescriptSchema: () => TypescriptSchema
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(test_schema_exports);
|
|
34
|
-
var React = __toESM(require("react"));
|
|
35
|
-
var import_propTypes = require("../../propTypes/index.ts");
|
|
36
|
-
const TestSchema = {
|
|
37
|
-
string: import_propTypes.PropTypes.string.description("String"),
|
|
38
|
-
number: import_propTypes.PropTypes.number.description("Number"),
|
|
39
|
-
boolean: import_propTypes.PropTypes.bool.description("Boolean"),
|
|
40
|
-
any: import_propTypes.PropTypes.any.description("Any"),
|
|
41
|
-
union: import_propTypes.PropTypes.oneOfType([import_propTypes.PropTypes.string, import_propTypes.PropTypes.number]).description("Union"),
|
|
42
|
-
union2: import_propTypes.PropTypes.oneOf(["A", "B"]).description("Union 2"),
|
|
43
|
-
union3: import_propTypes.PropTypes.oneOfType([
|
|
44
|
-
import_propTypes.PropTypes.string,
|
|
45
|
-
import_propTypes.PropTypes.arrayOf(import_propTypes.PropTypes.string),
|
|
46
|
-
import_propTypes.PropTypes.shape({ string: import_propTypes.PropTypes.string })
|
|
47
|
-
]).description("Union 3"),
|
|
48
|
-
array: import_propTypes.PropTypes.arrayOf(import_propTypes.PropTypes.string).description("Array"),
|
|
49
|
-
object: import_propTypes.PropTypes.object.description("Object"),
|
|
50
|
-
shape: import_propTypes.PropTypes.shape({
|
|
51
|
-
string: import_propTypes.PropTypes.string.description("String").isRequired,
|
|
52
|
-
number: import_propTypes.PropTypes.number.description("Number"),
|
|
53
|
-
boolean: import_propTypes.PropTypes.bool.description("Boolean"),
|
|
54
|
-
anotherShape: import_propTypes.PropTypes.shape({
|
|
55
|
-
string: import_propTypes.PropTypes.string.description("String").isRequired,
|
|
56
|
-
number: import_propTypes.PropTypes.number.description("Number"),
|
|
57
|
-
boolean: import_propTypes.PropTypes.bool.description("Boolean")
|
|
58
|
-
}).description("Another shape")
|
|
59
|
-
}).description("Shape"),
|
|
60
|
-
function: import_propTypes.PropTypes.func.description("Function"),
|
|
61
|
-
jsx: import_propTypes.PropTypes.element.description("JSX"),
|
|
62
|
-
node: import_propTypes.PropTypes.node.description("Node"),
|
|
63
|
-
something: import_propTypes.PropTypes.oneOf(["thing", "object"]).description("something"),
|
|
64
|
-
isRequiredIf: import_propTypes.PropTypes.string.description("isRequiredIf").isRequiredIf((props) => props.something === "thing"),
|
|
65
|
-
objectOf: import_propTypes.PropTypes.objectOf(import_propTypes.PropTypes.string).description("Object of"),
|
|
66
|
-
objectOfArray: import_propTypes.PropTypes.objectOf(import_propTypes.PropTypes.arrayOf(import_propTypes.PropTypes.string)).description("Object of array"),
|
|
67
|
-
shapeWithObjectOf: import_propTypes.PropTypes.shape({
|
|
68
|
-
objectOf: import_propTypes.PropTypes.objectOf(import_propTypes.PropTypes.string).description("Object of")
|
|
69
|
-
}).description("Shape with object of"),
|
|
70
|
-
shapeWithObjectOfAndSignature: import_propTypes.PropTypes.shape({
|
|
71
|
-
signature: import_propTypes.PropTypes.func.signature("((a: string, b: number, c: Record<string, number>) => void)").description("Signature"),
|
|
72
|
-
objectOf: import_propTypes.PropTypes.objectOf(import_propTypes.PropTypes.string).description("Object of")
|
|
73
|
-
}).description("Shape with object of and signature")
|
|
74
|
-
};
|
|
75
|
-
const TestComponent = () => null;
|
|
76
|
-
const TestComponentWithSchema = (0, import_propTypes.describe)(TestComponent).description("Test Component");
|
|
77
|
-
TestComponentWithSchema.propTypes = TestSchema;
|
|
78
|
-
const TypescriptSchema = TestComponentWithSchema.toTypescript();
|
|
79
|
-
//# sourceMappingURL=test.schema.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/tests/validation/test.schema.js", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { PropTypes, describe } from '../../propTypes/index.ts';\n\nconst TestSchema = {\n string: PropTypes.string.description('String'),\n number: PropTypes.number.description('Number'),\n boolean: PropTypes.bool.description('Boolean'),\n any: PropTypes.any.description('Any'),\n union: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('Union'),\n union2: PropTypes.oneOf(['A', 'B']).description('Union 2'),\n union3: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string),\n PropTypes.shape({ string: PropTypes.string }),\n ]).description('Union 3'),\n array: PropTypes.arrayOf(PropTypes.string).description('Array'),\n object: PropTypes.object.description('Object'),\n shape: PropTypes.shape({\n string: PropTypes.string.description('String').isRequired,\n number: PropTypes.number.description('Number'),\n boolean: PropTypes.bool.description('Boolean'),\n anotherShape: PropTypes.shape({\n string: PropTypes.string.description('String').isRequired,\n number: PropTypes.number.description('Number'),\n boolean: PropTypes.bool.description('Boolean'),\n }).description('Another shape'),\n }).description('Shape'),\n function: PropTypes.func.description('Function'),\n jsx: PropTypes.element.description('JSX'),\n node: PropTypes.node.description('Node'),\n something: PropTypes.oneOf(['thing', 'object']).description('something'),\n isRequiredIf: PropTypes.string.description('isRequiredIf').isRequiredIf((props) => props.something === 'thing'),\n objectOf: PropTypes.objectOf(PropTypes.string).description('Object of'),\n objectOfArray: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string)).description('Object of array'),\n shapeWithObjectOf: PropTypes.shape({\n objectOf: PropTypes.objectOf(PropTypes.string).description('Object of'),\n }).description('Shape with object of'),\n shapeWithObjectOfAndSignature: PropTypes.shape({\n signature: PropTypes.func\n .signature('((a: string, b: number, c: Record<string, number>) => void)')\n .description('Signature'),\n objectOf: PropTypes.objectOf(PropTypes.string).description('Object of'),\n }).description('Shape with object of and signature'),\n};\n\nconst TestComponent = () => null;\n\nconst TestComponentWithSchema = describe(TestComponent).description('Test Component');\n\nTestComponentWithSchema.propTypes = TestSchema;\n\nexport const TypescriptSchema = TestComponentWithSchema.toTypescript();\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAoC;AAEpC,MAAM,aAAa;AAAA,EACjB,QAAQ,2BAAU,OAAO,YAAY,QAAQ;AAAA,EAC7C,QAAQ,2BAAU,OAAO,YAAY,QAAQ;AAAA,EAC7C,SAAS,2BAAU,KAAK,YAAY,SAAS;AAAA,EAC7C,KAAK,2BAAU,IAAI,YAAY,KAAK;AAAA,EACpC,OAAO,2BAAU,UAAU,CAAC,2BAAU,QAAQ,2BAAU,MAAM,CAAC,EAAE,YAAY,OAAO;AAAA,EACpF,QAAQ,2BAAU,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,YAAY,SAAS;AAAA,EACzD,QAAQ,2BAAU,UAAU;AAAA,IAC1B,2BAAU;AAAA,IACV,2BAAU,QAAQ,2BAAU,MAAM;AAAA,IAClC,2BAAU,MAAM,EAAE,QAAQ,2BAAU,OAAO,CAAC;AAAA,EAC9C,CAAC,EAAE,YAAY,SAAS;AAAA,EACxB,OAAO,2BAAU,QAAQ,2BAAU,MAAM,EAAE,YAAY,OAAO;AAAA,EAC9D,QAAQ,2BAAU,OAAO,YAAY,QAAQ;AAAA,EAC7C,OAAO,2BAAU,MAAM;AAAA,IACrB,QAAQ,2BAAU,OAAO,YAAY,QAAQ,EAAE;AAAA,IAC/C,QAAQ,2BAAU,OAAO,YAAY,QAAQ;AAAA,IAC7C,SAAS,2BAAU,KAAK,YAAY,SAAS;AAAA,IAC7C,cAAc,2BAAU,MAAM;AAAA,MAC5B,QAAQ,2BAAU,OAAO,YAAY,QAAQ,EAAE;AAAA,MAC/C,QAAQ,2BAAU,OAAO,YAAY,QAAQ;AAAA,MAC7C,SAAS,2BAAU,KAAK,YAAY,SAAS;AAAA,IAC/C,CAAC,EAAE,YAAY,eAAe;AAAA,EAChC,CAAC,EAAE,YAAY,OAAO;AAAA,EACtB,UAAU,2BAAU,KAAK,YAAY,UAAU;AAAA,EAC/C,KAAK,2BAAU,QAAQ,YAAY,KAAK;AAAA,EACxC,MAAM,2BAAU,KAAK,YAAY,MAAM;AAAA,EACvC,WAAW,2BAAU,MAAM,CAAC,SAAS,QAAQ,CAAC,EAAE,YAAY,WAAW;AAAA,EACvE,cAAc,2BAAU,OAAO,YAAY,cAAc,EAAE,aAAa,CAAC,UAAU,MAAM,cAAc,OAAO;AAAA,EAC9G,UAAU,2BAAU,SAAS,2BAAU,MAAM,EAAE,YAAY,WAAW;AAAA,EACtE,eAAe,2BAAU,SAAS,2BAAU,QAAQ,2BAAU,MAAM,CAAC,EAAE,YAAY,iBAAiB;AAAA,EACpG,mBAAmB,2BAAU,MAAM;AAAA,IACjC,UAAU,2BAAU,SAAS,2BAAU,MAAM,EAAE,YAAY,WAAW;AAAA,EACxE,CAAC,EAAE,YAAY,sBAAsB;AAAA,EACrC,+BAA+B,2BAAU,MAAM;AAAA,IAC7C,WAAW,2BAAU,KAClB,UAAU,6DAA6D,EACvE,YAAY,WAAW;AAAA,IAC1B,UAAU,2BAAU,SAAS,2BAAU,MAAM,EAAE,YAAY,WAAW;AAAA,EACxE,CAAC,EAAE,YAAY,oCAAoC;AACrD;AAEA,MAAM,gBAAgB,MAAM;AAE5B,MAAM,8BAA0B,2BAAS,aAAa,EAAE,YAAY,gBAAgB;AAEpF,wBAAwB,YAAY;AAE7B,MAAM,mBAAmB,wBAAwB,aAAa;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var TestComponent_exports = {};
|
|
30
|
-
__export(TestComponent_exports, {
|
|
31
|
-
TestComponent: () => TestComponent
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(TestComponent_exports);
|
|
34
|
-
var React = __toESM(require("react"));
|
|
35
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
-
var import_xstyledProps = require("../../xstyledProps");
|
|
37
|
-
const TestComponent = (props) => {
|
|
38
|
-
const xstyledProps = (0, import_xstyledProps.useGetXstyledProps)(props);
|
|
39
|
-
props.signal(xstyledProps);
|
|
40
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...xstyledProps, "data-testid": "xstyled-div", children: "Some random div" });
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=TestComponent.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/tests/xstyledProps/TestComponent.js", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable react/prop-types */\n// eslint-disable-next-line import/extensions\nimport { useGetXstyledProps } from '../../xstyledProps';\n\nexport const TestComponent = (props) => {\n const xstyledProps = useGetXstyledProps(props);\n\n props.signal(xstyledProps);\n\n return (\n <div {...xstyledProps} data-testid=\"xstyled-div\">\n Some random div\n </div>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADUnB;AARJ,0BAAmC;AAE5B,MAAM,gBAAgB,CAAC,UAAU;AACtC,QAAM,mBAAe,wCAAmB,KAAK;AAE7C,QAAM,OAAO,YAAY;AAEzB,SACE,4CAAC,SAAK,GAAG,cAAc,eAAY,eAAc,6BAEjD;AAEJ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { useGetGlobalAttributes } from "../../globalProps/useGetGlobalAttributes";
|
|
4
|
-
const TestComponent = (props) => {
|
|
5
|
-
const globalAttributes = useGetGlobalAttributes(props);
|
|
6
|
-
return /* @__PURE__ */ jsx("div", { ...globalAttributes, children: "Some random div" });
|
|
7
|
-
};
|
|
8
|
-
export {
|
|
9
|
-
TestComponent
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=TestComponent.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/tests/globalProps/TestComponent.js"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "// eslint-disable-next-line import/extensions\nimport { useGetGlobalAttributes } from '../../globalProps/useGetGlobalAttributes';\n\nexport const TestComponent = (props) => {\n const globalAttributes = useGetGlobalAttributes(props);\n\n return <div {...globalAttributes}>Some random div</div>;\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACMd;AALT,SAAS,8BAA8B;AAEhC,MAAM,gBAAgB,CAAC,UAAU;AACtC,QAAM,mBAAmB,uBAAuB,KAAK;AAErD,SAAO,oBAAC,SAAK,GAAG,kBAAkB,6BAAe;AACnD;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { PropTypes, describe } from "../../propTypes/index.ts";
|
|
3
|
-
const TestSchema = {
|
|
4
|
-
string: PropTypes.string.description("String"),
|
|
5
|
-
number: PropTypes.number.description("Number"),
|
|
6
|
-
boolean: PropTypes.bool.description("Boolean"),
|
|
7
|
-
any: PropTypes.any.description("Any"),
|
|
8
|
-
union: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description("Union"),
|
|
9
|
-
union2: PropTypes.oneOf(["A", "B"]).description("Union 2"),
|
|
10
|
-
union3: PropTypes.oneOfType([
|
|
11
|
-
PropTypes.string,
|
|
12
|
-
PropTypes.arrayOf(PropTypes.string),
|
|
13
|
-
PropTypes.shape({ string: PropTypes.string })
|
|
14
|
-
]).description("Union 3"),
|
|
15
|
-
array: PropTypes.arrayOf(PropTypes.string).description("Array"),
|
|
16
|
-
object: PropTypes.object.description("Object"),
|
|
17
|
-
shape: PropTypes.shape({
|
|
18
|
-
string: PropTypes.string.description("String").isRequired,
|
|
19
|
-
number: PropTypes.number.description("Number"),
|
|
20
|
-
boolean: PropTypes.bool.description("Boolean"),
|
|
21
|
-
anotherShape: PropTypes.shape({
|
|
22
|
-
string: PropTypes.string.description("String").isRequired,
|
|
23
|
-
number: PropTypes.number.description("Number"),
|
|
24
|
-
boolean: PropTypes.bool.description("Boolean")
|
|
25
|
-
}).description("Another shape")
|
|
26
|
-
}).description("Shape"),
|
|
27
|
-
function: PropTypes.func.description("Function"),
|
|
28
|
-
jsx: PropTypes.element.description("JSX"),
|
|
29
|
-
node: PropTypes.node.description("Node"),
|
|
30
|
-
something: PropTypes.oneOf(["thing", "object"]).description("something"),
|
|
31
|
-
isRequiredIf: PropTypes.string.description("isRequiredIf").isRequiredIf((props) => props.something === "thing"),
|
|
32
|
-
objectOf: PropTypes.objectOf(PropTypes.string).description("Object of"),
|
|
33
|
-
objectOfArray: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string)).description("Object of array"),
|
|
34
|
-
shapeWithObjectOf: PropTypes.shape({
|
|
35
|
-
objectOf: PropTypes.objectOf(PropTypes.string).description("Object of")
|
|
36
|
-
}).description("Shape with object of"),
|
|
37
|
-
shapeWithObjectOfAndSignature: PropTypes.shape({
|
|
38
|
-
signature: PropTypes.func.signature("((a: string, b: number, c: Record<string, number>) => void)").description("Signature"),
|
|
39
|
-
objectOf: PropTypes.objectOf(PropTypes.string).description("Object of")
|
|
40
|
-
}).description("Shape with object of and signature")
|
|
41
|
-
};
|
|
42
|
-
const TestComponent = () => null;
|
|
43
|
-
const TestComponentWithSchema = describe(TestComponent).description("Test Component");
|
|
44
|
-
TestComponentWithSchema.propTypes = TestSchema;
|
|
45
|
-
const TypescriptSchema = TestComponentWithSchema.toTypescript();
|
|
46
|
-
export {
|
|
47
|
-
TypescriptSchema
|
|
48
|
-
};
|
|
49
|
-
//# sourceMappingURL=test.schema.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/tests/validation/test.schema.js"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes, describe } from '../../propTypes/index.ts';\n\nconst TestSchema = {\n string: PropTypes.string.description('String'),\n number: PropTypes.number.description('Number'),\n boolean: PropTypes.bool.description('Boolean'),\n any: PropTypes.any.description('Any'),\n union: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description('Union'),\n union2: PropTypes.oneOf(['A', 'B']).description('Union 2'),\n union3: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string),\n PropTypes.shape({ string: PropTypes.string }),\n ]).description('Union 3'),\n array: PropTypes.arrayOf(PropTypes.string).description('Array'),\n object: PropTypes.object.description('Object'),\n shape: PropTypes.shape({\n string: PropTypes.string.description('String').isRequired,\n number: PropTypes.number.description('Number'),\n boolean: PropTypes.bool.description('Boolean'),\n anotherShape: PropTypes.shape({\n string: PropTypes.string.description('String').isRequired,\n number: PropTypes.number.description('Number'),\n boolean: PropTypes.bool.description('Boolean'),\n }).description('Another shape'),\n }).description('Shape'),\n function: PropTypes.func.description('Function'),\n jsx: PropTypes.element.description('JSX'),\n node: PropTypes.node.description('Node'),\n something: PropTypes.oneOf(['thing', 'object']).description('something'),\n isRequiredIf: PropTypes.string.description('isRequiredIf').isRequiredIf((props) => props.something === 'thing'),\n objectOf: PropTypes.objectOf(PropTypes.string).description('Object of'),\n objectOfArray: PropTypes.objectOf(PropTypes.arrayOf(PropTypes.string)).description('Object of array'),\n shapeWithObjectOf: PropTypes.shape({\n objectOf: PropTypes.objectOf(PropTypes.string).description('Object of'),\n }).description('Shape with object of'),\n shapeWithObjectOfAndSignature: PropTypes.shape({\n signature: PropTypes.func\n .signature('((a: string, b: number, c: Record<string, number>) => void)')\n .description('Signature'),\n objectOf: PropTypes.objectOf(PropTypes.string).description('Object of'),\n }).description('Shape with object of and signature'),\n};\n\nconst TestComponent = () => null;\n\nconst TestComponentWithSchema = describe(TestComponent).description('Test Component');\n\nTestComponentWithSchema.propTypes = TestSchema;\n\nexport const TypescriptSchema = TestComponentWithSchema.toTypescript();\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,WAAW,gBAAgB;AAEpC,MAAM,aAAa;AAAA,EACjB,QAAQ,UAAU,OAAO,YAAY,QAAQ;AAAA,EAC7C,QAAQ,UAAU,OAAO,YAAY,QAAQ;AAAA,EAC7C,SAAS,UAAU,KAAK,YAAY,SAAS;AAAA,EAC7C,KAAK,UAAU,IAAI,YAAY,KAAK;AAAA,EACpC,OAAO,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE,YAAY,OAAO;AAAA,EACpF,QAAQ,UAAU,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,YAAY,SAAS;AAAA,EACzD,QAAQ,UAAU,UAAU;AAAA,IAC1B,UAAU;AAAA,IACV,UAAU,QAAQ,UAAU,MAAM;AAAA,IAClC,UAAU,MAAM,EAAE,QAAQ,UAAU,OAAO,CAAC;AAAA,EAC9C,CAAC,EAAE,YAAY,SAAS;AAAA,EACxB,OAAO,UAAU,QAAQ,UAAU,MAAM,EAAE,YAAY,OAAO;AAAA,EAC9D,QAAQ,UAAU,OAAO,YAAY,QAAQ;AAAA,EAC7C,OAAO,UAAU,MAAM;AAAA,IACrB,QAAQ,UAAU,OAAO,YAAY,QAAQ,EAAE;AAAA,IAC/C,QAAQ,UAAU,OAAO,YAAY,QAAQ;AAAA,IAC7C,SAAS,UAAU,KAAK,YAAY,SAAS;AAAA,IAC7C,cAAc,UAAU,MAAM;AAAA,MAC5B,QAAQ,UAAU,OAAO,YAAY,QAAQ,EAAE;AAAA,MAC/C,QAAQ,UAAU,OAAO,YAAY,QAAQ;AAAA,MAC7C,SAAS,UAAU,KAAK,YAAY,SAAS;AAAA,IAC/C,CAAC,EAAE,YAAY,eAAe;AAAA,EAChC,CAAC,EAAE,YAAY,OAAO;AAAA,EACtB,UAAU,UAAU,KAAK,YAAY,UAAU;AAAA,EAC/C,KAAK,UAAU,QAAQ,YAAY,KAAK;AAAA,EACxC,MAAM,UAAU,KAAK,YAAY,MAAM;AAAA,EACvC,WAAW,UAAU,MAAM,CAAC,SAAS,QAAQ,CAAC,EAAE,YAAY,WAAW;AAAA,EACvE,cAAc,UAAU,OAAO,YAAY,cAAc,EAAE,aAAa,CAAC,UAAU,MAAM,cAAc,OAAO;AAAA,EAC9G,UAAU,UAAU,SAAS,UAAU,MAAM,EAAE,YAAY,WAAW;AAAA,EACtE,eAAe,UAAU,SAAS,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE,YAAY,iBAAiB;AAAA,EACpG,mBAAmB,UAAU,MAAM;AAAA,IACjC,UAAU,UAAU,SAAS,UAAU,MAAM,EAAE,YAAY,WAAW;AAAA,EACxE,CAAC,EAAE,YAAY,sBAAsB;AAAA,EACrC,+BAA+B,UAAU,MAAM;AAAA,IAC7C,WAAW,UAAU,KAClB,UAAU,6DAA6D,EACvE,YAAY,WAAW;AAAA,IAC1B,UAAU,UAAU,SAAS,UAAU,MAAM,EAAE,YAAY,WAAW;AAAA,EACxE,CAAC,EAAE,YAAY,oCAAoC;AACrD;AAEA,MAAM,gBAAgB,MAAM;AAE5B,MAAM,0BAA0B,SAAS,aAAa,EAAE,YAAY,gBAAgB;AAEpF,wBAAwB,YAAY;AAE7B,MAAM,mBAAmB,wBAAwB,aAAa;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { useGetXstyledProps } from "../../xstyledProps";
|
|
4
|
-
const TestComponent = (props) => {
|
|
5
|
-
const xstyledProps = useGetXstyledProps(props);
|
|
6
|
-
props.signal(xstyledProps);
|
|
7
|
-
return /* @__PURE__ */ jsx("div", { ...xstyledProps, "data-testid": "xstyled-div", children: "Some random div" });
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
TestComponent
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=TestComponent.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/tests/xstyledProps/TestComponent.js"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\n// eslint-disable-next-line import/extensions\nimport { useGetXstyledProps } from '../../xstyledProps';\n\nexport const TestComponent = (props) => {\n const xstyledProps = useGetXstyledProps(props);\n\n props.signal(xstyledProps);\n\n return (\n <div {...xstyledProps} data-testid=\"xstyled-div\">\n Some random div\n </div>\n );\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACUnB;AARJ,SAAS,0BAA0B;AAE5B,MAAM,gBAAgB,CAAC,UAAU;AACtC,QAAM,eAAe,mBAAmB,KAAK;AAE7C,QAAM,OAAO,YAAY;AAEzB,SACE,oBAAC,SAAK,GAAG,cAAc,eAAY,eAAc,6BAEjD;AAEJ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|