@elliemae/ds-props-helpers 3.56.0-rc.1 → 3.57.0-next.10
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/xstyledProps/index.d.ts +1 -1
- package/dist/types/xstyledProps/useGetXstyledProps.d.ts +1 -0
- package/package.json +4 -4
|
@@ -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,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.
|
|
3
|
+
"version": "3.57.0-next.10",
|
|
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.
|
|
39
|
-
"@elliemae/ds-typescript-helpers": "3.
|
|
38
|
+
"@elliemae/ds-system": "3.57.0-next.10",
|
|
39
|
+
"@elliemae/ds-typescript-helpers": "3.57.0-next.10"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
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.
|
|
45
|
+
"@elliemae/ds-monorepo-devops": "3.57.0-next.10"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"lodash-es": "^4.17.21",
|