@elliemae/ds-wizard 3.37.2 → 3.38.0-rc.0
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/WizardSteps.js +3 -2
- package/dist/cjs/WizardSteps.js.map +3 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/typescript-testing/typescript-wizard-valid.js +78 -0
- package/dist/cjs/typescript-testing/typescript-wizard-valid.js.map +7 -0
- package/dist/esm/WizardSteps.js +3 -2
- package/dist/esm/WizardSteps.js.map +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/typescript-testing/typescript-wizard-valid.js +55 -0
- package/dist/esm/typescript-testing/typescript-wizard-valid.js.map +7 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/react-desc-prop-types.d.ts +2 -2
- package/dist/types/typescript-testing/typescript-wizard-valid.d.ts +1 -0
- package/package.json +7 -7
package/dist/cjs/WizardSteps.js
CHANGED
|
@@ -36,6 +36,7 @@ var React = __toESM(require("react"));
|
|
|
36
36
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
37
|
var import_react = __toESM(require("react"));
|
|
38
38
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
39
|
+
var import_uuid = require("uuid");
|
|
39
40
|
var import_WizardStep = __toESM(require("./WizardStep.js"));
|
|
40
41
|
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
41
42
|
var import_styled = require("./styled.js");
|
|
@@ -50,9 +51,9 @@ const WizardSteps = (props) => {
|
|
|
50
51
|
active: current === index,
|
|
51
52
|
completed: index < current
|
|
52
53
|
});
|
|
53
|
-
return steps ? steps.map((step, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_WizardStep.default, { ...step, ...mergeStepProps(index) },
|
|
54
|
+
return steps ? steps.map((step, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_WizardStep.default, { ...step, ...mergeStepProps(index) }, (0, import_uuid.v4)())) : import_react.default.Children.map(children, (item, index) => {
|
|
54
55
|
if (item === void 0) return null;
|
|
55
|
-
return (0, import_react.cloneElement)(item, mergeStepProps(index));
|
|
56
|
+
return (0, import_react.cloneElement)(item, { key: (0, import_uuid.v4)(), ...mergeStepProps(index) });
|
|
56
57
|
});
|
|
57
58
|
}, [current, children, steps]);
|
|
58
59
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledStepsWrapper, { className: "em-ds-wizard-steps-indicator", ...xstyledProps, ...globalAttributes, children: items });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/WizardSteps.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { cloneElement, useMemo } from 'react';\nimport {\n describe,\n useGetGlobalAttributes,\n useGetXstyledProps,\n useMemoMergePropsWithDefault,\n} from '@elliemae/ds-props-helpers';\nimport WizardStep from './WizardStep.js';\nimport { DSWizardPropTypesSchema, defaultProps, type DSWizardT } from './react-desc-prop-types.js';\nimport { StyledStepsWrapper } from './styled.js';\n\nconst WizardSteps = (props: DSWizardT.Props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSWizardT.InternalProps>(props, defaultProps);\n\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n\n const { children, steps, current } = propsWithDefault;\n\n const items = useMemo(() => {\n const mergeStepProps = (index: number) => ({\n index,\n active: current === index,\n completed: index < current,\n });\n\n return steps\n ? steps.map((step, index) => <WizardStep key={
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
6
|
-
"names": ["WizardStep", "React"]
|
|
4
|
+
"sourcesContent": ["import React, { cloneElement, useMemo } from 'react';\nimport {\n describe,\n useGetGlobalAttributes,\n useGetXstyledProps,\n useMemoMergePropsWithDefault,\n} from '@elliemae/ds-props-helpers';\nimport { v4 as uuidv4 } from 'uuid';\nimport WizardStep from './WizardStep.js';\nimport { DSWizardPropTypesSchema, defaultProps, type DSWizardT } from './react-desc-prop-types.js';\nimport { StyledStepsWrapper } from './styled.js';\n\nconst WizardSteps = (props: DSWizardT.Props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSWizardT.InternalProps>(props, defaultProps);\n\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n\n const { children, steps, current } = propsWithDefault;\n\n const items = useMemo(() => {\n const mergeStepProps = (index: number) => ({\n index,\n active: current === index,\n completed: index < current,\n });\n\n return steps\n ? steps.map((step, index) => <WizardStep key={uuidv4()} {...step} {...mergeStepProps(index)} />)\n : React.Children.map(children, (item, index) => {\n if (item === undefined) return null;\n return cloneElement(item, { key: uuidv4(), ...mergeStepProps(index) });\n });\n }, [current, children, steps]);\n\n return (\n <StyledStepsWrapper className=\"em-ds-wizard-steps-indicator\" {...xstyledProps} {...globalAttributes}>\n {items}\n </StyledStepsWrapper>\n );\n};\n\nWizardSteps.Item = WizardStep;\n\nWizardSteps.displayName = 'WizardSteps';\nconst WizzardWithSchema = describe(WizardSteps);\nWizzardWithSchema.propTypes = DSWizardPropTypesSchema;\n\nexport { WizzardWithSchema };\nexport default WizardSteps;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD6BY;AA7BnC,mBAA6C;AAC7C,8BAKO;AACP,kBAA6B;AAC7B,wBAAuB;AACvB,mCAAsE;AACtE,oBAAmC;AAEnC,MAAM,cAAc,CAAC,UAA2B;AAC9C,QAAM,uBAAmB,sDAAsD,OAAO,yCAAY;AAElG,QAAM,mBAAe,4CAAmB,gBAAgB;AAExD,QAAM,uBAAmB,gDAAuB,gBAAgB;AAEhE,QAAM,EAAE,UAAU,OAAO,QAAQ,IAAI;AAErC,QAAM,YAAQ,sBAAQ,MAAM;AAC1B,UAAM,iBAAiB,CAAC,WAAmB;AAAA,MACzC;AAAA,MACA,QAAQ,YAAY;AAAA,MACpB,WAAW,QAAQ;AAAA,IACrB;AAEA,WAAO,QACH,MAAM,IAAI,CAAC,MAAM,UAAU,4CAAC,kBAAAA,SAAA,EAA2B,GAAG,MAAO,GAAG,eAAe,KAAK,SAA5C,YAAAC,IAAO,CAAwC,CAAE,IAC7F,aAAAC,QAAM,SAAS,IAAI,UAAU,CAAC,MAAM,UAAU;AAC5C,UAAI,SAAS,OAAW,QAAO;AAC/B,iBAAO,2BAAa,MAAM,EAAE,SAAK,YAAAD,IAAO,GAAG,GAAG,eAAe,KAAK,EAAE,CAAC;AAAA,IACvE,CAAC;AAAA,EACP,GAAG,CAAC,SAAS,UAAU,KAAK,CAAC;AAE7B,SACE,4CAAC,oCAAmB,WAAU,gCAAgC,GAAG,cAAe,GAAG,kBAChF,iBACH;AAEJ;AAEA,YAAY,OAAO,kBAAAD;AAEnB,YAAY,cAAc;AAC1B,MAAM,wBAAoB,kCAAS,WAAW;AAC9C,kBAAkB,YAAY;AAG9B,IAAO,sBAAQ;",
|
|
6
|
+
"names": ["WizardStep", "uuidv4", "React"]
|
|
7
7
|
}
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import WizardStepsIndicator, { WizzardWithSchema } from './WizardSteps.js';\nimport WizardStep, { WizzardStepWithSchema } from './WizardStep.js';\nimport useWizard from './useWizard.js';\
|
|
4
|
+
"sourcesContent": ["import WizardStepsIndicator, { WizzardWithSchema } from './WizardSteps.js';\nimport WizardStep, { WizzardStepWithSchema } from './WizardStep.js';\nimport useWizard from './useWizard.js';\nexport type { DSWizardT } from './react-desc-prop-types.js';\nexport { useWizard, WizardStepsIndicator, WizardStep, WizzardWithSchema, WizzardStepWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,sCAAAA;AAAA,EAAA,+CAAAC;AAAA,EAAA;AAAA;AAAA,oCAAAC;AAAA;AAAA;ACAA,YAAuB;ADAvB,yBAAwD;AACxD,wBAAkD;AAClD,uBAAsB;",
|
|
6
6
|
"names": ["WizardStep", "WizardStepsIndicator", "useWizard"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/react-desc-prop-types.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-empty-interface */\nimport React from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport { Checkmark } from '@elliemae/ds-icons';\nimport type { WeakValidationMap } from 'react';\n\nexport declare namespace DSWizardT {\n export interface WizardStep {\n content: React.ComponentType;\n }\n\n export interface RequiredProps {}\n\n export interface DefaultProps {\n current: number;\n }\n\n export interface OptionalProps {\n steps?: WizardStep[];\n children?: React.ReactElement[];\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-empty-interface */\nimport React from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport { Checkmark } from '@elliemae/ds-icons';\nimport type { WeakValidationMap } from 'react';\n\nexport declare namespace DSWizardT {\n export interface WizardStep {\n content: React.ComponentType;\n }\n\n export interface RequiredProps {}\n\n export interface DefaultProps {\n current: number;\n }\n\n export interface OptionalProps {\n steps?: WizardStep[];\n children?: React.ReactElement[];\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface StepProps {\n label?: string;\n icon?: React.ReactNode;\n iconCompleted?: React.ReactNode;\n iconActive?: React.ReactNode;\n active?: boolean;\n completed?: boolean;\n index?: number;\n }\n}\n\nexport const defaultProps: DSWizardT.DefaultProps = {\n current: 0,\n};\n\nexport const defaultStepProps: Required<DSWizardT.StepProps> = {\n label: '',\n icon: null,\n iconCompleted: <Checkmark />,\n iconActive: null,\n active: false,\n completed: false,\n index: 0,\n};\n\nexport const DSWizardPropTypes: DSPropTypesSchema<DSWizardT.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n current: PropTypes.number.description('Current active state index').defaultValue(0),\n steps: PropTypes.arrayOf(PropTypes.shape({})).description('Array of steps objects'),\n children: PropTypes.arrayOf(PropTypes.node).description('List of WizardStep components'),\n};\n\nexport const DSWizardPropTypesSchema = DSWizardPropTypes as unknown as WeakValidationMap<DSWizardT.Props>;\n\nexport const DSWizardStepPropsTypes = {\n label: PropTypes.string.description('Step label'),\n icon: PropTypes.oneOfType([PropTypes.element, PropTypes.string]).description('Default icon or number'),\n iconCompleted: PropTypes.element.description('Icon when the step is completed').defaultValue('Checkmark'),\n iconActive: PropTypes.element.description('Icon when the step is active'),\n active: PropTypes.bool.description('Whether the step is active or not').defaultValue(false),\n completed: PropTypes.bool.description('Whether the step is completed or not').defaultValue(false),\n index: PropTypes.number.description('Current item index'),\n};\n\nexport const DSWizardStepPropsTypesSchema = DSWizardStepPropsTypes as unknown as WeakValidationMap<DSWizardT.StepProps>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADuDN;AApDjB,8BAAuE;AACvE,sBAA0B;AA4CnB,MAAM,eAAuC;AAAA,EAClD,SAAS;AACX;AAEO,MAAM,mBAAkD;AAAA,EAC7D,OAAO;AAAA,EACP,MAAM;AAAA,EACN,eAAe,4CAAC,6BAAU;AAAA,EAC1B,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,OAAO;AACT;AAEO,MAAM,oBAAwD;AAAA,EACnE,GAAG;AAAA,EACH,GAAG;AAAA,EACH,SAAS,kCAAU,OAAO,YAAY,4BAA4B,EAAE,aAAa,CAAC;AAAA,EAClF,OAAO,kCAAU,QAAQ,kCAAU,MAAM,CAAC,CAAC,CAAC,EAAE,YAAY,wBAAwB;AAAA,EAClF,UAAU,kCAAU,QAAQ,kCAAU,IAAI,EAAE,YAAY,+BAA+B;AACzF;AAEO,MAAM,0BAA0B;AAEhC,MAAM,yBAAyB;AAAA,EACpC,OAAO,kCAAU,OAAO,YAAY,YAAY;AAAA,EAChD,MAAM,kCAAU,UAAU,CAAC,kCAAU,SAAS,kCAAU,MAAM,CAAC,EAAE,YAAY,wBAAwB;AAAA,EACrG,eAAe,kCAAU,QAAQ,YAAY,iCAAiC,EAAE,aAAa,WAAW;AAAA,EACxG,YAAY,kCAAU,QAAQ,YAAY,8BAA8B;AAAA,EACxE,QAAQ,kCAAU,KAAK,YAAY,mCAAmC,EAAE,aAAa,KAAK;AAAA,EAC1F,WAAW,kCAAU,KAAK,YAAY,sCAAsC,EAAE,aAAa,KAAK;AAAA,EAChG,OAAO,kCAAU,OAAO,YAAY,oBAAoB;AAC1D;AAEO,MAAM,+BAA+B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,78 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
12
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
24
|
+
var React = __toESM(require("react"));
|
|
25
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import__ = require("../index.js");
|
|
27
|
+
const testRequiredProps = {
|
|
28
|
+
current: 0
|
|
29
|
+
};
|
|
30
|
+
const testOptionalProps = {
|
|
31
|
+
steps: [{ content: import__.WizardStepsIndicator }],
|
|
32
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.WizardStepsIndicator, {})]
|
|
33
|
+
};
|
|
34
|
+
const testPartialDefaults = {
|
|
35
|
+
current: 1
|
|
36
|
+
};
|
|
37
|
+
const testProps = {
|
|
38
|
+
...testRequiredProps,
|
|
39
|
+
...testOptionalProps,
|
|
40
|
+
...testPartialDefaults
|
|
41
|
+
};
|
|
42
|
+
const testPropsAsSyntax = {
|
|
43
|
+
...testRequiredProps,
|
|
44
|
+
...testOptionalProps,
|
|
45
|
+
...testPartialDefaults
|
|
46
|
+
};
|
|
47
|
+
const testCompleteDefaults = {
|
|
48
|
+
current: 1
|
|
49
|
+
};
|
|
50
|
+
const testInternalProps = {
|
|
51
|
+
...testRequiredProps,
|
|
52
|
+
...testOptionalProps,
|
|
53
|
+
...testCompleteDefaults
|
|
54
|
+
};
|
|
55
|
+
const testInternalPropsAsSyntax = {
|
|
56
|
+
...testRequiredProps,
|
|
57
|
+
...testOptionalProps,
|
|
58
|
+
...testCompleteDefaults
|
|
59
|
+
};
|
|
60
|
+
const testExplicitDefinition = {
|
|
61
|
+
current: 1,
|
|
62
|
+
steps: [{ content: import__.WizardStepsIndicator }]
|
|
63
|
+
};
|
|
64
|
+
const testInferedTypeCompatibility = {
|
|
65
|
+
current: 1,
|
|
66
|
+
steps: [{ content: import__.WizardStepsIndicator }]
|
|
67
|
+
};
|
|
68
|
+
const testDefinitionAsConst = {
|
|
69
|
+
current: 1,
|
|
70
|
+
steps: [{ content: import__.WizardStepsIndicator }]
|
|
71
|
+
};
|
|
72
|
+
const ExampleUsageComponent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.WizardStepsIndicator, { ...testExplicitDefinition }),
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.WizardStepsIndicator, { ...testInferedTypeCompatibility }),
|
|
75
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.WizardStepsIndicator, { ...testDefinitionAsConst }),
|
|
76
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.WizardStepsIndicator, { current: 1 })
|
|
77
|
+
] });
|
|
78
|
+
//# sourceMappingURL=typescript-wizard-valid.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-wizard-valid.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { createRef } from 'react';\nimport { WizardStepsIndicator } from '../index.js';\nimport type { DSWizardT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSWizardT.Props;\ntype ComponentPropsInternals = DSWizardT.InternalProps;\ntype ComponentPropsDefaultProps = DSWizardT.DefaultProps;\ntype ComponentPropsOptionalProps = DSWizardT.OptionalProps;\ntype ComponentPropsRequiredProps = DSWizardT.RequiredProps;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {\n current: 0,\n};\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n steps: [{ content: WizardStepsIndicator }],\n children: [<WizardStepsIndicator />],\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {\n current: 1,\n};\n\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n current: 1,\n};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\n\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n current: 1,\n steps: [{ content: WizardStepsIndicator }],\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n current: 1,\n steps: [{ content: WizardStepsIndicator }],\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n current: 1,\n steps: [{ content: WizardStepsIndicator }] as DSWizardT.WizardStep[],\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <WizardStepsIndicator {...testExplicitDefinition} />\n <WizardStepsIndicator {...testInferedTypeCompatibility} />\n <WizardStepsIndicator {...testDefinitionAsConst} />\n {/* works with inline values */}\n <WizardStepsIndicator current={1} />\n </>\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,YAAuB;ACkBV;AAhBb,eAAqC;AAUrC,MAAM,oBAAiD;AAAA,EACrD,SAAS;AACX;AAEA,MAAM,oBAAiD;AAAA,EACrD,OAAO,CAAC,EAAE,SAAS,8BAAqB,CAAC;AAAA,EACzC,UAAU,CAAC,4CAAC,iCAAqB,CAAE;AACrC;AAIA,MAAM,sBAA2D;AAAA,EAC/D,SAAS;AACX;AAEA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,uBAA6D;AAAA,EACjE,SAAS;AACX;AAEA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,SAAS;AAAA,EACT,OAAO,CAAC,EAAE,SAAS,8BAAqB,CAAC;AAC3C;AAGA,MAAM,+BAA+B;AAAA,EACnC,SAAS;AAAA,EACT,OAAO,CAAC,EAAE,SAAS,8BAAqB,CAAC;AAC3C;AAEA,MAAM,wBAAwB;AAAA,EAC5B,SAAS;AAAA,EACT,OAAO,CAAC,EAAE,SAAS,8BAAqB,CAAC;AAC3C;AAEA,MAAM,wBAAwB,MAC5B,4EAEE;AAAA,8CAAC,iCAAsB,GAAG,wBAAwB;AAAA,EAClD,4CAAC,iCAAsB,GAAG,8BAA8B;AAAA,EACxD,4CAAC,iCAAsB,GAAG,uBAAuB;AAAA,EAEjD,4CAAC,iCAAqB,SAAS,GAAG;AAAA,GACpC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/esm/WizardSteps.js
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
useGetXstyledProps,
|
|
8
8
|
useMemoMergePropsWithDefault
|
|
9
9
|
} from "@elliemae/ds-props-helpers";
|
|
10
|
+
import { v4 as uuidv4 } from "uuid";
|
|
10
11
|
import WizardStep from "./WizardStep.js";
|
|
11
12
|
import { DSWizardPropTypesSchema, defaultProps } from "./react-desc-prop-types.js";
|
|
12
13
|
import { StyledStepsWrapper } from "./styled.js";
|
|
@@ -21,9 +22,9 @@ const WizardSteps = (props) => {
|
|
|
21
22
|
active: current === index,
|
|
22
23
|
completed: index < current
|
|
23
24
|
});
|
|
24
|
-
return steps ? steps.map((step, index) => /* @__PURE__ */ jsx(WizardStep, { ...step, ...mergeStepProps(index) },
|
|
25
|
+
return steps ? steps.map((step, index) => /* @__PURE__ */ jsx(WizardStep, { ...step, ...mergeStepProps(index) }, uuidv4())) : React2.Children.map(children, (item, index) => {
|
|
25
26
|
if (item === void 0) return null;
|
|
26
|
-
return cloneElement(item, mergeStepProps(index));
|
|
27
|
+
return cloneElement(item, { key: uuidv4(), ...mergeStepProps(index) });
|
|
27
28
|
});
|
|
28
29
|
}, [current, children, steps]);
|
|
29
30
|
return /* @__PURE__ */ jsx(StyledStepsWrapper, { className: "em-ds-wizard-steps-indicator", ...xstyledProps, ...globalAttributes, children: items });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/WizardSteps.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { cloneElement, useMemo } from 'react';\nimport {\n describe,\n useGetGlobalAttributes,\n useGetXstyledProps,\n useMemoMergePropsWithDefault,\n} from '@elliemae/ds-props-helpers';\nimport WizardStep from './WizardStep.js';\nimport { DSWizardPropTypesSchema, defaultProps, type DSWizardT } from './react-desc-prop-types.js';\nimport { StyledStepsWrapper } from './styled.js';\n\nconst WizardSteps = (props: DSWizardT.Props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSWizardT.InternalProps>(props, defaultProps);\n\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n\n const { children, steps, current } = propsWithDefault;\n\n const items = useMemo(() => {\n const mergeStepProps = (index: number) => ({\n index,\n active: current === index,\n completed: index < current,\n });\n\n return steps\n ? steps.map((step, index) => <WizardStep key={
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { cloneElement, useMemo } from 'react';\nimport {\n describe,\n useGetGlobalAttributes,\n useGetXstyledProps,\n useMemoMergePropsWithDefault,\n} from '@elliemae/ds-props-helpers';\nimport { v4 as uuidv4 } from 'uuid';\nimport WizardStep from './WizardStep.js';\nimport { DSWizardPropTypesSchema, defaultProps, type DSWizardT } from './react-desc-prop-types.js';\nimport { StyledStepsWrapper } from './styled.js';\n\nconst WizardSteps = (props: DSWizardT.Props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSWizardT.InternalProps>(props, defaultProps);\n\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n\n const { children, steps, current } = propsWithDefault;\n\n const items = useMemo(() => {\n const mergeStepProps = (index: number) => ({\n index,\n active: current === index,\n completed: index < current,\n });\n\n return steps\n ? steps.map((step, index) => <WizardStep key={uuidv4()} {...step} {...mergeStepProps(index)} />)\n : React.Children.map(children, (item, index) => {\n if (item === undefined) return null;\n return cloneElement(item, { key: uuidv4(), ...mergeStepProps(index) });\n });\n }, [current, children, steps]);\n\n return (\n <StyledStepsWrapper className=\"em-ds-wizard-steps-indicator\" {...xstyledProps} {...globalAttributes}>\n {items}\n </StyledStepsWrapper>\n );\n};\n\nWizardSteps.Item = WizardStep;\n\nWizardSteps.displayName = 'WizardSteps';\nconst WizzardWithSchema = describe(WizardSteps);\nWizzardWithSchema.propTypes = DSWizardPropTypesSchema;\n\nexport { WizzardWithSchema };\nexport default WizardSteps;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC6BY;AA7BnC,OAAOA,UAAS,cAAc,eAAe;AAC7C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,MAAM,cAAc;AAC7B,OAAO,gBAAgB;AACvB,SAAS,yBAAyB,oBAAoC;AACtE,SAAS,0BAA0B;AAEnC,MAAM,cAAc,CAAC,UAA2B;AAC9C,QAAM,mBAAmB,6BAAsD,OAAO,YAAY;AAElG,QAAM,eAAe,mBAAmB,gBAAgB;AAExD,QAAM,mBAAmB,uBAAuB,gBAAgB;AAEhE,QAAM,EAAE,UAAU,OAAO,QAAQ,IAAI;AAErC,QAAM,QAAQ,QAAQ,MAAM;AAC1B,UAAM,iBAAiB,CAAC,WAAmB;AAAA,MACzC;AAAA,MACA,QAAQ,YAAY;AAAA,MACpB,WAAW,QAAQ;AAAA,IACrB;AAEA,WAAO,QACH,MAAM,IAAI,CAAC,MAAM,UAAU,oBAAC,cAA2B,GAAG,MAAO,GAAG,eAAe,KAAK,KAA5C,OAAO,CAAwC,CAAE,IAC7FA,OAAM,SAAS,IAAI,UAAU,CAAC,MAAM,UAAU;AAC5C,UAAI,SAAS,OAAW,QAAO;AAC/B,aAAO,aAAa,MAAM,EAAE,KAAK,OAAO,GAAG,GAAG,eAAe,KAAK,EAAE,CAAC;AAAA,IACvE,CAAC;AAAA,EACP,GAAG,CAAC,SAAS,UAAU,KAAK,CAAC;AAE7B,SACE,oBAAC,sBAAmB,WAAU,gCAAgC,GAAG,cAAe,GAAG,kBAChF,iBACH;AAEJ;AAEA,YAAY,OAAO;AAEnB,YAAY,cAAc;AAC1B,MAAM,oBAAoB,SAAS,WAAW;AAC9C,kBAAkB,YAAY;AAG9B,IAAO,sBAAQ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
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.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import WizardStepsIndicator, { WizzardWithSchema } from './WizardSteps.js';\nimport WizardStep, { WizzardStepWithSchema } from './WizardStep.js';\nimport useWizard from './useWizard.js';\
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import WizardStepsIndicator, { WizzardWithSchema } from './WizardSteps.js';\nimport WizardStep, { WizzardStepWithSchema } from './WizardStep.js';\nimport useWizard from './useWizard.js';\nexport type { DSWizardT } from './react-desc-prop-types.js';\nexport { useWizard, WizardStepsIndicator, WizardStep, WizzardWithSchema, WizzardStepWithSchema };\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAO,wBAAwB,yBAAyB;AACxD,OAAO,cAAc,6BAA6B;AAClD,OAAO,eAAe;",
|
|
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/react-desc-prop-types.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-empty-interface */\nimport React from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport { Checkmark } from '@elliemae/ds-icons';\nimport type { WeakValidationMap } from 'react';\n\nexport declare namespace DSWizardT {\n export interface WizardStep {\n content: React.ComponentType;\n }\n\n export interface RequiredProps {}\n\n export interface DefaultProps {\n current: number;\n }\n\n export interface OptionalProps {\n steps?: WizardStep[];\n children?: React.ReactElement[];\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-empty-interface */\nimport React from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport { Checkmark } from '@elliemae/ds-icons';\nimport type { WeakValidationMap } from 'react';\n\nexport declare namespace DSWizardT {\n export interface WizardStep {\n content: React.ComponentType;\n }\n\n export interface RequiredProps {}\n\n export interface DefaultProps {\n current: number;\n }\n\n export interface OptionalProps {\n steps?: WizardStep[];\n children?: React.ReactElement[];\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface StepProps {\n label?: string;\n icon?: React.ReactNode;\n iconCompleted?: React.ReactNode;\n iconActive?: React.ReactNode;\n active?: boolean;\n completed?: boolean;\n index?: number;\n }\n}\n\nexport const defaultProps: DSWizardT.DefaultProps = {\n current: 0,\n};\n\nexport const defaultStepProps: Required<DSWizardT.StepProps> = {\n label: '',\n icon: null,\n iconCompleted: <Checkmark />,\n iconActive: null,\n active: false,\n completed: false,\n index: 0,\n};\n\nexport const DSWizardPropTypes: DSPropTypesSchema<DSWizardT.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n current: PropTypes.number.description('Current active state index').defaultValue(0),\n steps: PropTypes.arrayOf(PropTypes.shape({})).description('Array of steps objects'),\n children: PropTypes.arrayOf(PropTypes.node).description('List of WizardStep components'),\n};\n\nexport const DSWizardPropTypesSchema = DSWizardPropTypes as unknown as WeakValidationMap<DSWizardT.Props>;\n\nexport const DSWizardStepPropsTypes = {\n label: PropTypes.string.description('Step label'),\n icon: PropTypes.oneOfType([PropTypes.element, PropTypes.string]).description('Default icon or number'),\n iconCompleted: PropTypes.element.description('Icon when the step is completed').defaultValue('Checkmark'),\n iconActive: PropTypes.element.description('Icon when the step is active'),\n active: PropTypes.bool.description('Whether the step is active or not').defaultValue(false),\n completed: PropTypes.bool.description('Whether the step is completed or not').defaultValue(false),\n index: PropTypes.number.description('Current item index'),\n};\n\nexport const DSWizardStepPropsTypesSchema = DSWizardStepPropsTypes as unknown as WeakValidationMap<DSWizardT.StepProps>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACuDN;AApDjB,SAAS,WAAW,2BAA2B,wBAAwB;AACvE,SAAS,iBAAiB;AA4CnB,MAAM,eAAuC;AAAA,EAClD,SAAS;AACX;AAEO,MAAM,mBAAkD;AAAA,EAC7D,OAAO;AAAA,EACP,MAAM;AAAA,EACN,eAAe,oBAAC,aAAU;AAAA,EAC1B,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,OAAO;AACT;AAEO,MAAM,oBAAwD;AAAA,EACnE,GAAG;AAAA,EACH,GAAG;AAAA,EACH,SAAS,UAAU,OAAO,YAAY,4BAA4B,EAAE,aAAa,CAAC;AAAA,EAClF,OAAO,UAAU,QAAQ,UAAU,MAAM,CAAC,CAAC,CAAC,EAAE,YAAY,wBAAwB;AAAA,EAClF,UAAU,UAAU,QAAQ,UAAU,IAAI,EAAE,YAAY,+BAA+B;AACzF;AAEO,MAAM,0BAA0B;AAEhC,MAAM,yBAAyB;AAAA,EACpC,OAAO,UAAU,OAAO,YAAY,YAAY;AAAA,EAChD,MAAM,UAAU,UAAU,CAAC,UAAU,SAAS,UAAU,MAAM,CAAC,EAAE,YAAY,wBAAwB;AAAA,EACrG,eAAe,UAAU,QAAQ,YAAY,iCAAiC,EAAE,aAAa,WAAW;AAAA,EACxG,YAAY,UAAU,QAAQ,YAAY,8BAA8B;AAAA,EACxE,QAAQ,UAAU,KAAK,YAAY,mCAAmC,EAAE,aAAa,KAAK;AAAA,EAC1F,WAAW,UAAU,KAAK,YAAY,sCAAsC,EAAE,aAAa,KAAK;AAAA,EAChG,OAAO,UAAU,OAAO,YAAY,oBAAoB;AAC1D;AAEO,MAAM,+BAA+B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { WizardStepsIndicator } from "../index.js";
|
|
4
|
+
const testRequiredProps = {
|
|
5
|
+
current: 0
|
|
6
|
+
};
|
|
7
|
+
const testOptionalProps = {
|
|
8
|
+
steps: [{ content: WizardStepsIndicator }],
|
|
9
|
+
children: [/* @__PURE__ */ jsx(WizardStepsIndicator, {})]
|
|
10
|
+
};
|
|
11
|
+
const testPartialDefaults = {
|
|
12
|
+
current: 1
|
|
13
|
+
};
|
|
14
|
+
const testProps = {
|
|
15
|
+
...testRequiredProps,
|
|
16
|
+
...testOptionalProps,
|
|
17
|
+
...testPartialDefaults
|
|
18
|
+
};
|
|
19
|
+
const testPropsAsSyntax = {
|
|
20
|
+
...testRequiredProps,
|
|
21
|
+
...testOptionalProps,
|
|
22
|
+
...testPartialDefaults
|
|
23
|
+
};
|
|
24
|
+
const testCompleteDefaults = {
|
|
25
|
+
current: 1
|
|
26
|
+
};
|
|
27
|
+
const testInternalProps = {
|
|
28
|
+
...testRequiredProps,
|
|
29
|
+
...testOptionalProps,
|
|
30
|
+
...testCompleteDefaults
|
|
31
|
+
};
|
|
32
|
+
const testInternalPropsAsSyntax = {
|
|
33
|
+
...testRequiredProps,
|
|
34
|
+
...testOptionalProps,
|
|
35
|
+
...testCompleteDefaults
|
|
36
|
+
};
|
|
37
|
+
const testExplicitDefinition = {
|
|
38
|
+
current: 1,
|
|
39
|
+
steps: [{ content: WizardStepsIndicator }]
|
|
40
|
+
};
|
|
41
|
+
const testInferedTypeCompatibility = {
|
|
42
|
+
current: 1,
|
|
43
|
+
steps: [{ content: WizardStepsIndicator }]
|
|
44
|
+
};
|
|
45
|
+
const testDefinitionAsConst = {
|
|
46
|
+
current: 1,
|
|
47
|
+
steps: [{ content: WizardStepsIndicator }]
|
|
48
|
+
};
|
|
49
|
+
const ExampleUsageComponent = () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
50
|
+
/* @__PURE__ */ jsx(WizardStepsIndicator, { ...testExplicitDefinition }),
|
|
51
|
+
/* @__PURE__ */ jsx(WizardStepsIndicator, { ...testInferedTypeCompatibility }),
|
|
52
|
+
/* @__PURE__ */ jsx(WizardStepsIndicator, { ...testDefinitionAsConst }),
|
|
53
|
+
/* @__PURE__ */ jsx(WizardStepsIndicator, { current: 1 })
|
|
54
|
+
] });
|
|
55
|
+
//# sourceMappingURL=typescript-wizard-valid.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/typescript-testing/typescript-wizard-valid.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars, no-unused-vars */\nimport { createRef } from 'react';\nimport { WizardStepsIndicator } from '../index.js';\nimport type { DSWizardT } from '../index.js';\n\n// test we expose the namespace and the namespace follows our deliverable conventions\ntype ComponentPropsForApp = DSWizardT.Props;\ntype ComponentPropsInternals = DSWizardT.InternalProps;\ntype ComponentPropsDefaultProps = DSWizardT.DefaultProps;\ntype ComponentPropsOptionalProps = DSWizardT.OptionalProps;\ntype ComponentPropsRequiredProps = DSWizardT.RequiredProps;\n\nconst testRequiredProps: ComponentPropsRequiredProps = {\n current: 0,\n};\n\nconst testOptionalProps: ComponentPropsOptionalProps = {\n steps: [{ content: WizardStepsIndicator }],\n children: [<WizardStepsIndicator />],\n};\n\n// difference Props and InternalProps is that InternalProps has all the default props filled in\n// Props allows for partial defaults\nconst testPartialDefaults: Partial<ComponentPropsDefaultProps> = {\n current: 1,\n};\n\nconst testProps: ComponentPropsForApp = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n};\n\nconst testPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testPartialDefaults,\n} as ComponentPropsForApp;\n\n// InternalProps requires all defaults to be filled in\nconst testCompleteDefaults: Required<ComponentPropsDefaultProps> = {\n current: 1,\n};\n\nconst testInternalProps: ComponentPropsInternals = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n};\n\nconst testInternalPropsAsSyntax = {\n ...testRequiredProps,\n ...testOptionalProps,\n ...testCompleteDefaults,\n} as ComponentPropsInternals;\n\n// using the explicit type definition, if there is an error, it will be marked on the key that is wrong\nconst testExplicitDefinition: ComponentPropsForApp = {\n current: 1,\n steps: [{ content: WizardStepsIndicator }],\n};\n\n// using the \"as\" syntax, if there is an error, it will be marking the whole object as wrong because it is not compatible with the type\nconst testInferedTypeCompatibility = {\n current: 1,\n steps: [{ content: WizardStepsIndicator }],\n} as ComponentPropsForApp;\n\nconst testDefinitionAsConst = {\n current: 1,\n steps: [{ content: WizardStepsIndicator }] as DSWizardT.WizardStep[],\n} as const;\n\nconst ExampleUsageComponent = () => (\n <>\n {/* works with explicitly casted props, all syntaxes */}\n <WizardStepsIndicator {...testExplicitDefinition} />\n <WizardStepsIndicator {...testInferedTypeCompatibility} />\n <WizardStepsIndicator {...testDefinitionAsConst} />\n {/* works with inline values */}\n <WizardStepsIndicator current={1} />\n </>\n);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACkBV,SAwDX,UAxDW,KAwDX,YAxDW;AAhBb,SAAS,4BAA4B;AAUrC,MAAM,oBAAiD;AAAA,EACrD,SAAS;AACX;AAEA,MAAM,oBAAiD;AAAA,EACrD,OAAO,CAAC,EAAE,SAAS,qBAAqB,CAAC;AAAA,EACzC,UAAU,CAAC,oBAAC,wBAAqB,CAAE;AACrC;AAIA,MAAM,sBAA2D;AAAA,EAC/D,SAAS;AACX;AAEA,MAAM,YAAkC;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,oBAAoB;AAAA,EACxB,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,uBAA6D;AAAA,EACjE,SAAS;AACX;AAEA,MAAM,oBAA6C;AAAA,EACjD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,4BAA4B;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAGA,MAAM,yBAA+C;AAAA,EACnD,SAAS;AAAA,EACT,OAAO,CAAC,EAAE,SAAS,qBAAqB,CAAC;AAC3C;AAGA,MAAM,+BAA+B;AAAA,EACnC,SAAS;AAAA,EACT,OAAO,CAAC,EAAE,SAAS,qBAAqB,CAAC;AAC3C;AAEA,MAAM,wBAAwB;AAAA,EAC5B,SAAS;AAAA,EACT,OAAO,CAAC,EAAE,SAAS,qBAAqB,CAAC;AAC3C;AAEA,MAAM,wBAAwB,MAC5B,iCAEE;AAAA,sBAAC,wBAAsB,GAAG,wBAAwB;AAAA,EAClD,oBAAC,wBAAsB,GAAG,8BAA8B;AAAA,EACxD,oBAAC,wBAAsB,GAAG,uBAAuB;AAAA,EAEjD,oBAAC,wBAAqB,SAAS,GAAG;AAAA,GACpC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import WizardStepsIndicator, { WizzardWithSchema } from './WizardSteps.js';
|
|
2
2
|
import WizardStep, { WizzardStepWithSchema } from './WizardStep.js';
|
|
3
3
|
import useWizard from './useWizard.js';
|
|
4
|
+
export type { DSWizardT } from './react-desc-prop-types.js';
|
|
4
5
|
export { useWizard, WizardStepsIndicator, WizardStep, WizzardWithSchema, WizzardStepWithSchema };
|
|
@@ -13,9 +13,9 @@ export declare namespace DSWizardT {
|
|
|
13
13
|
steps?: WizardStep[];
|
|
14
14
|
children?: React.ReactElement[];
|
|
15
15
|
}
|
|
16
|
-
interface Props extends Partial<DefaultProps>, OptionalProps, Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof
|
|
16
|
+
interface Props extends Partial<DefaultProps>, OptionalProps, Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>, XstyledProps, RequiredProps {
|
|
17
17
|
}
|
|
18
|
-
interface InternalProps extends DefaultProps, OptionalProps, Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof
|
|
18
|
+
interface InternalProps extends DefaultProps, OptionalProps, Omit<GlobalAttributesT<HTMLDivElement>, keyof DefaultProps | keyof OptionalProps | keyof XstyledProps>, XstyledProps, RequiredProps {
|
|
19
19
|
}
|
|
20
20
|
interface StepProps {
|
|
21
21
|
label?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-wizard",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.38.0-rc.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Wizard",
|
|
6
6
|
"files": [
|
|
@@ -56,15 +56,15 @@
|
|
|
56
56
|
"indent": 4
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@elliemae/ds-classnames": "3.
|
|
60
|
-
"@elliemae/ds-
|
|
61
|
-
"@elliemae/ds-
|
|
62
|
-
"@elliemae/ds-
|
|
59
|
+
"@elliemae/ds-classnames": "3.38.0-rc.0",
|
|
60
|
+
"@elliemae/ds-props-helpers": "3.38.0-rc.0",
|
|
61
|
+
"@elliemae/ds-icons": "3.38.0-rc.0",
|
|
62
|
+
"@elliemae/ds-system": "3.38.0-rc.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@elliemae/pui-cli": "9.0.0-next.50",
|
|
66
66
|
"styled-components": "~5.3.9",
|
|
67
|
-
"@elliemae/ds-monorepo-devops": "3.
|
|
67
|
+
"@elliemae/ds-monorepo-devops": "3.38.0-rc.0"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"lodash": "^4.17.21",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
},
|
|
74
74
|
"publishConfig": {
|
|
75
75
|
"access": "public",
|
|
76
|
-
"typeSafety":
|
|
76
|
+
"typeSafety": true
|
|
77
77
|
},
|
|
78
78
|
"scripts": {
|
|
79
79
|
"dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
|