@elliemae/ds-legacy-stepper 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DSStepperDefinitions.js +38 -0
- package/dist/cjs/DSStepperDefinitions.js.map +7 -0
- package/dist/cjs/Stepper.js +65 -0
- package/dist/cjs/Stepper.js.map +7 -0
- package/dist/cjs/StepperButton.js +73 -0
- package/dist/cjs/StepperButton.js.map +7 -0
- package/dist/cjs/index.js +31 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/props.js +74 -0
- package/dist/cjs/props.js.map +7 -0
- package/dist/cjs/styled.js +70 -0
- package/dist/cjs/styled.js.map +7 -0
- package/dist/esm/DSStepperDefinitions.js +8 -0
- package/dist/esm/DSStepperDefinitions.js.map +7 -0
- package/dist/esm/Stepper.js +40 -0
- package/dist/esm/Stepper.js.map +7 -0
- package/dist/esm/StepperButton.js +48 -0
- package/dist/esm/StepperButton.js.map +7 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/package.json +7 -0
- package/dist/esm/props.js +44 -0
- package/dist/esm/props.js.map +7 -0
- package/dist/esm/styled.js +40 -0
- package/dist/esm/styled.js.map +7 -0
- package/dist/types/DSStepperDefinitions.d.ts +2 -0
- package/dist/types/Stepper.d.ts +9 -0
- package/dist/types/StepperButton.d.ts +9 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/props.d.ts +45 -0
- package/dist/types/tests/Stepper.global-attributes.test.d.ts +1 -0
- package/dist/types/tests/Stepper.test.d.ts +1 -0
- package/dist/types/tests/StepperButton.global-attributes.test.d.ts +1 -0
- package/package.json +88 -0
|
@@ -0,0 +1,38 @@
|
|
|
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 DSStepperDefinitions_exports = {};
|
|
30
|
+
__export(DSStepperDefinitions_exports, {
|
|
31
|
+
DSStepperButtonName: () => DSStepperButtonName,
|
|
32
|
+
DSStepperName: () => DSStepperName
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(DSStepperDefinitions_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
const DSStepperName = "DSStepper";
|
|
37
|
+
const DSStepperButtonName = "DSStepperButton";
|
|
38
|
+
//# sourceMappingURL=DSStepperDefinitions.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/DSStepperDefinitions.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export const DSStepperName = 'DSStepper';\n\nexport const DSStepperButtonName = 'DSStepperButton';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,gBAAgB;AAEtB,MAAM,sBAAsB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
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 Stepper_exports = {};
|
|
30
|
+
__export(Stepper_exports, {
|
|
31
|
+
DSStepper: () => DSStepper,
|
|
32
|
+
StepperWithSchema: () => StepperWithSchema
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Stepper_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_uid = require("uid");
|
|
39
|
+
var import_ds_legacy_props_helpers = require("@elliemae/ds-legacy-props-helpers");
|
|
40
|
+
var import_props = require("./props.js");
|
|
41
|
+
var import_styled = require("./styled.js");
|
|
42
|
+
var import_DSStepperDefinitions = require("./DSStepperDefinitions.js");
|
|
43
|
+
const DSStepper = (props) => {
|
|
44
|
+
const propsWithDefaults = (0, import_ds_legacy_props_helpers.useMemoMergePropsWithDefault)(props, import_props.defaultProps);
|
|
45
|
+
(0, import_ds_legacy_props_helpers.useValidateTypescriptPropTypes)(propsWithDefaults, import_props.dsStepperProps, import_DSStepperDefinitions.DSStepperName);
|
|
46
|
+
const { steps, current, visited } = propsWithDefaults;
|
|
47
|
+
const stepsArray = import_react.default.useMemo(() => new Array(steps).fill(1), [steps]);
|
|
48
|
+
const globalAttributes = (0, import_ds_legacy_props_helpers.useGetGlobalAttributes)(propsWithDefaults);
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StepperWrapper, { steps, current, visited, ...globalAttributes, children: stepsArray.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
50
|
+
import_styled.Step,
|
|
51
|
+
{
|
|
52
|
+
active: current === index,
|
|
53
|
+
visited: visited.includes(index),
|
|
54
|
+
"data-testid": props["data-testid"] ? `${props["data-testid"]}-step` : void 0,
|
|
55
|
+
"data-active": current === index,
|
|
56
|
+
"data-visited": visited.includes(index)
|
|
57
|
+
},
|
|
58
|
+
`${(0, import_uid.uid)(4)}step-key-${index}`
|
|
59
|
+
)) });
|
|
60
|
+
};
|
|
61
|
+
DSStepper.propTypes = import_props.dsStepperProps;
|
|
62
|
+
DSStepper.displayName = import_DSStepperDefinitions.DSStepperName;
|
|
63
|
+
const StepperWithSchema = (0, import_ds_legacy_props_helpers.describe)(DSStepper);
|
|
64
|
+
StepperWithSchema.propTypes = import_props.dsStepperProps;
|
|
65
|
+
//# sourceMappingURL=Stepper.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/Stepper.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { uid } from 'uid';\nimport {\n describe,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n} from '@elliemae/ds-legacy-props-helpers';\nimport type { DSStepperInternalsT } from './props.js';\nimport { dsStepperProps, defaultProps } from './props.js';\nimport { Step, StepperWrapper } from './styled.js';\nimport { DSStepperName } from './DSStepperDefinitions.js';\n\nconst DSStepper = (props: DSStepperInternalsT.StepperPropsT) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultProps) as DSStepperInternalsT.StepperPropsT;\n useValidateTypescriptPropTypes(propsWithDefaults, dsStepperProps, DSStepperName);\n\n const { steps, current, visited } = propsWithDefaults;\n const stepsArray = React.useMemo(() => new Array(steps).fill(1) as number[], [steps]);\n const globalAttributes = useGetGlobalAttributes(propsWithDefaults);\n\n return (\n <StepperWrapper steps={steps} current={current} visited={visited} {...globalAttributes}>\n {stepsArray.map((item, index) => (\n <Step\n // eslint-disable-next-line react/no-array-index-key\n key={`${uid(4)}step-key-${index}`}\n active={current === index}\n visited={visited.includes(index)}\n data-testid={props['data-testid'] ? `${props['data-testid'] as string}-step` : undefined}\n data-active={current === index}\n data-visited={visited.includes(index)}\n />\n ))}\n </StepperWrapper>\n );\n};\n\nDSStepper.propTypes = dsStepperProps;\nDSStepper.displayName = DSStepperName;\nconst StepperWithSchema = describe(DSStepper);\nStepperWithSchema.propTypes = dsStepperProps;\n\nexport { DSStepper, StepperWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADwBf;AAxBR,mBAAkB;AAClB,iBAAoB;AACpB,qCAKO;AAEP,mBAA6C;AAC7C,oBAAqC;AACrC,kCAA8B;AAE9B,MAAM,YAAY,CAAC,UAA6C;AAC9D,QAAM,wBAAoB,6DAA6B,OAAO,yBAAY;AAC1E,qEAA+B,mBAAmB,6BAAgB,yCAAa;AAE/E,QAAM,EAAE,OAAO,SAAS,QAAQ,IAAI;AACpC,QAAM,aAAa,aAAAA,QAAM,QAAQ,MAAM,IAAI,MAAM,KAAK,EAAE,KAAK,CAAC,GAAe,CAAC,KAAK,CAAC;AACpF,QAAM,uBAAmB,uDAAuB,iBAAiB;AAEjE,SACE,4CAAC,gCAAe,OAAc,SAAkB,SAAmB,GAAG,kBACnE,qBAAW,IAAI,CAAC,MAAM,UACrB;AAAA,IAAC;AAAA;AAAA,MAGC,QAAQ,YAAY;AAAA,MACpB,SAAS,QAAQ,SAAS,KAAK;AAAA,MAC/B,eAAa,MAAM,aAAa,IAAI,GAAG,MAAM,aAAa,WAAqB;AAAA,MAC/E,eAAa,YAAY;AAAA,MACzB,gBAAc,QAAQ,SAAS,KAAK;AAAA;AAAA,IAL/B,OAAG,gBAAI,CAAC,aAAa;AAAA,EAM5B,CACD,GACH;AAEJ;AAEA,UAAU,YAAY;AACtB,UAAU,cAAc;AACxB,MAAM,wBAAoB,yCAAS,SAAS;AAC5C,kBAAkB,YAAY;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
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 StepperButton_exports = {};
|
|
30
|
+
__export(StepperButton_exports, {
|
|
31
|
+
DSStepperButton: () => DSStepperButton,
|
|
32
|
+
DSStepperButtonWithSchema: () => DSStepperButtonWithSchema
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(StepperButton_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
+
var import_ds_legacy_props_helpers = require("@elliemae/ds-legacy-props-helpers");
|
|
38
|
+
var import_ds_legacy_button_v2 = require("@elliemae/ds-legacy-button-v2");
|
|
39
|
+
var import_ds_legacy_icons = require("@elliemae/ds-legacy-icons");
|
|
40
|
+
var import_props = require("./props.js");
|
|
41
|
+
var import_styled = require("./styled.js");
|
|
42
|
+
var import_DSStepperDefinitions = require("./DSStepperDefinitions.js");
|
|
43
|
+
const DSStepperButton = (props) => {
|
|
44
|
+
const propsWithDefaults = (0, import_ds_legacy_props_helpers.useMemoMergePropsWithDefault)(
|
|
45
|
+
props,
|
|
46
|
+
import_props.defaultButtonProps
|
|
47
|
+
);
|
|
48
|
+
(0, import_ds_legacy_props_helpers.useValidateTypescriptPropTypes)(propsWithDefaults, import_props.dsStepperButtonProps, import_DSStepperDefinitions.DSStepperButtonName);
|
|
49
|
+
const { chevron, fontSize, label, disabled, onClick, innerRef } = propsWithDefaults;
|
|
50
|
+
const globalAttributes = (0, import_ds_legacy_props_helpers.useGetGlobalAttributes)(propsWithDefaults);
|
|
51
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
52
|
+
import_styled.StyledButton,
|
|
53
|
+
{
|
|
54
|
+
disabled,
|
|
55
|
+
onClick,
|
|
56
|
+
innerRef,
|
|
57
|
+
buttonType: import_ds_legacy_button_v2.BUTTON_TYPES.TEXT,
|
|
58
|
+
fontSize,
|
|
59
|
+
"data-testid": "ds-stepper-btn",
|
|
60
|
+
...globalAttributes,
|
|
61
|
+
children: [
|
|
62
|
+
chevron === "left" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_legacy_icons.ChevronLeft, {}) : null,
|
|
63
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.Label, { value: label }),
|
|
64
|
+
chevron === "right" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_legacy_icons.ChevronRight, {}) : null
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
DSStepperButton.propTypes = import_props.dsStepperButtonProps;
|
|
70
|
+
DSStepperButton.displayName = import_DSStepperDefinitions.DSStepperButtonName;
|
|
71
|
+
const DSStepperButtonWithSchema = (0, import_ds_legacy_props_helpers.describe)(DSStepperButton);
|
|
72
|
+
DSStepperButtonWithSchema.propTypes = import_props.dsStepperButtonProps;
|
|
73
|
+
//# sourceMappingURL=StepperButton.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/StepperButton.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport {\n describe,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n} from '@elliemae/ds-legacy-props-helpers';\nimport { BUTTON_TYPES } from '@elliemae/ds-legacy-button-v2';\nimport { ChevronLeft, ChevronRight } from '@elliemae/ds-legacy-icons';\nimport type { DSStepperInternalsT } from './props.js';\nimport { dsStepperButtonProps, defaultButtonProps } from './props.js';\nimport { StyledButton, Label } from './styled.js';\nimport { DSStepperButtonName } from './DSStepperDefinitions.js';\n\nconst DSStepperButton = (props: DSStepperInternalsT.StepperButtonPropsT) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(\n props,\n defaultButtonProps,\n ) as DSStepperInternalsT.StepperButtonPropsT;\n useValidateTypescriptPropTypes(propsWithDefaults, dsStepperButtonProps, DSStepperButtonName);\n\n const { chevron, fontSize, label, disabled, onClick, innerRef } = propsWithDefaults;\n const globalAttributes = useGetGlobalAttributes(propsWithDefaults);\n\n return (\n <StyledButton\n disabled={disabled}\n onClick={onClick}\n innerRef={innerRef}\n buttonType={BUTTON_TYPES.TEXT}\n fontSize={fontSize}\n data-testid=\"ds-stepper-btn\"\n {...globalAttributes}\n >\n {chevron === 'left' ? <ChevronLeft /> : null}\n <Label value={label} />\n {chevron === 'right' ? <ChevronRight /> : null}\n </StyledButton>\n );\n};\n\nDSStepperButton.propTypes = dsStepperButtonProps;\nDSStepperButton.displayName = DSStepperButtonName;\nconst DSStepperButtonWithSchema = describe(DSStepperButton);\nDSStepperButtonWithSchema.propTypes = dsStepperButtonProps;\n\nexport { DSStepperButton, DSStepperButtonWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADyBnB;AAxBJ,qCAKO;AACP,iCAA6B;AAC7B,6BAA0C;AAE1C,mBAAyD;AACzD,oBAAoC;AACpC,kCAAoC;AAEpC,MAAM,kBAAkB,CAAC,UAAmD;AAC1E,QAAM,wBAAoB;AAAA,IACxB;AAAA,IACA;AAAA,EACF;AACA,qEAA+B,mBAAmB,mCAAsB,+CAAmB;AAE3F,QAAM,EAAE,SAAS,UAAU,OAAO,UAAU,SAAS,SAAS,IAAI;AAClE,QAAM,uBAAmB,uDAAuB,iBAAiB;AAEjE,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,YAAY,wCAAa;AAAA,MACzB;AAAA,MACA,eAAY;AAAA,MACX,GAAG;AAAA,MAEH;AAAA,oBAAY,SAAS,4CAAC,sCAAY,IAAK;AAAA,QACxC,4CAAC,uBAAM,OAAO,OAAO;AAAA,QACpB,YAAY,UAAU,4CAAC,uCAAa,IAAK;AAAA;AAAA;AAAA,EAC5C;AAEJ;AAEA,gBAAgB,YAAY;AAC5B,gBAAgB,cAAc;AAC9B,MAAM,gCAA4B,yCAAS,eAAe;AAC1D,0BAA0B,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
17
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
19
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
20
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
21
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
22
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
23
|
+
mod
|
|
24
|
+
));
|
|
25
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
26
|
+
var src_exports = {};
|
|
27
|
+
module.exports = __toCommonJS(src_exports);
|
|
28
|
+
var React = __toESM(require("react"));
|
|
29
|
+
__reExport(src_exports, require("./Stepper.js"), module.exports);
|
|
30
|
+
__reExport(src_exports, require("./StepperButton.js"), module.exports);
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export * from './Stepper.js';\nexport * from './StepperButton.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc,yBAAd;AACA,wBAAc,+BADd;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
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 props_exports = {};
|
|
30
|
+
__export(props_exports, {
|
|
31
|
+
defaultButtonProps: () => defaultButtonProps,
|
|
32
|
+
defaultProps: () => defaultProps,
|
|
33
|
+
dsStepperButtonProps: () => dsStepperButtonProps,
|
|
34
|
+
dsStepperProps: () => dsStepperProps
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(props_exports);
|
|
37
|
+
var React = __toESM(require("react"));
|
|
38
|
+
var import_ds_legacy_props_helpers = require("@elliemae/ds-legacy-props-helpers");
|
|
39
|
+
const BUTTON_SIZES = {
|
|
40
|
+
normal: "normal",
|
|
41
|
+
large: "large"
|
|
42
|
+
};
|
|
43
|
+
const CHEVRON_TYPE = {
|
|
44
|
+
left: "left",
|
|
45
|
+
right: "right"
|
|
46
|
+
};
|
|
47
|
+
const defaultProps = {
|
|
48
|
+
steps: 5,
|
|
49
|
+
current: void 0,
|
|
50
|
+
visited: []
|
|
51
|
+
};
|
|
52
|
+
const dsStepperProps = {
|
|
53
|
+
...import_ds_legacy_props_helpers.globalAttributesPropTypes,
|
|
54
|
+
steps: import_ds_legacy_props_helpers.PropTypes.number.description("Number of steps").isRequired,
|
|
55
|
+
current: import_ds_legacy_props_helpers.PropTypes.number.description("Index of active step"),
|
|
56
|
+
visited: import_ds_legacy_props_helpers.PropTypes.arrayOf(import_ds_legacy_props_helpers.PropTypes.number).description("Array of visited steps").isRequired
|
|
57
|
+
};
|
|
58
|
+
const defaultButtonProps = {
|
|
59
|
+
chevron: void 0,
|
|
60
|
+
fontSize: BUTTON_SIZES.normal,
|
|
61
|
+
disabled: false,
|
|
62
|
+
onClick: () => {
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const dsStepperButtonProps = {
|
|
66
|
+
...import_ds_legacy_props_helpers.globalAttributesPropTypes,
|
|
67
|
+
chevron: import_ds_legacy_props_helpers.PropTypes.oneOf(["left", "right", null]).description("Chevron icon position, if null/undefined no chevron will be shown").defaultValue(null),
|
|
68
|
+
fontSize: import_ds_legacy_props_helpers.PropTypes.oneOf(["normal", "large"]).description("Label size, used for marking last step").defaultValue("normal"),
|
|
69
|
+
innerRef: import_ds_legacy_props_helpers.PropTypes.oneOfType([import_ds_legacy_props_helpers.PropTypes.object, import_ds_legacy_props_helpers.PropTypes.func]).description("Inner ref to button component."),
|
|
70
|
+
disabled: import_ds_legacy_props_helpers.PropTypes.bool.description("Adds disabled state."),
|
|
71
|
+
onClick: import_ds_legacy_props_helpers.PropTypes.func.description("OnClick callback handler.").defaultValue("()=>{}"),
|
|
72
|
+
label: import_ds_legacy_props_helpers.PropTypes.string.description("Text Label, this only accepts text, no custom JSX").isRequired
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=props.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/props.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport { PropTypes, globalAttributesPropTypes } from '@elliemae/ds-legacy-props-helpers';\n\nconst BUTTON_SIZES = {\n normal: 'normal',\n large: 'large',\n} as const;\n\ntype ButtonSizesT = (typeof BUTTON_SIZES)[keyof typeof BUTTON_SIZES];\n\nconst CHEVRON_TYPE = {\n left: 'left',\n right: 'right',\n} as const;\n\ntype ChevronT = (typeof CHEVRON_TYPE)[keyof typeof CHEVRON_TYPE];\n\nexport declare namespace DSStepperInternalsT {\n export interface StepperPropsT {\n [property: string]: unknown;\n steps: number;\n current: number | null;\n visited: number[];\n }\n\n export interface StepperButtonPropsT {\n [property: string]: unknown;\n chevron?: ChevronT;\n fontSize?: ButtonSizesT;\n label: string;\n disabled?: boolean;\n onClick: VoidFunction;\n innerRef?: React.MutableRefObject<HTMLButtonElement> | ((_ref: HTMLButtonElement) => void);\n 'aria-label'?: string;\n 'aria-pressed'?: boolean;\n 'data-testid'?: string;\n }\n}\nexport const defaultProps = {\n steps: 5,\n current: undefined,\n visited: [],\n};\n\nexport const dsStepperProps = {\n ...globalAttributesPropTypes,\n steps: PropTypes.number.description('Number of steps').isRequired,\n current: PropTypes.number.description('Index of active step'),\n visited: PropTypes.arrayOf(PropTypes.number).description('Array of visited steps').isRequired,\n} as WeakValidationMap<unknown>;\n\nexport const defaultButtonProps = {\n chevron: undefined,\n fontSize: BUTTON_SIZES.normal,\n disabled: false,\n onClick: () => {},\n};\n\nexport const dsStepperButtonProps = {\n ...globalAttributesPropTypes,\n chevron: PropTypes.oneOf(['left', 'right', null])\n .description('Chevron icon position, if null/undefined no chevron will be shown')\n .defaultValue(null),\n fontSize: PropTypes.oneOf(['normal', 'large'])\n .description('Label size, used for marking last step')\n .defaultValue('normal'),\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description('Inner ref to button component.'),\n disabled: PropTypes.bool.description('Adds disabled state.'),\n onClick: PropTypes.func.description('OnClick callback handler.').defaultValue('()=>{}'),\n label: PropTypes.string.description('Text Label, this only accepts text, no custom JSX').isRequired,\n} as WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,qCAAqD;AAErD,MAAM,eAAe;AAAA,EACnB,QAAQ;AAAA,EACR,OAAO;AACT;AAIA,MAAM,eAAe;AAAA,EACnB,MAAM;AAAA,EACN,OAAO;AACT;AAyBO,MAAM,eAAe;AAAA,EAC1B,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS,CAAC;AACZ;AAEO,MAAM,iBAAiB;AAAA,EAC5B,GAAG;AAAA,EACH,OAAO,yCAAU,OAAO,YAAY,iBAAiB,EAAE;AAAA,EACvD,SAAS,yCAAU,OAAO,YAAY,sBAAsB;AAAA,EAC5D,SAAS,yCAAU,QAAQ,yCAAU,MAAM,EAAE,YAAY,wBAAwB,EAAE;AACrF;AAEO,MAAM,qBAAqB;AAAA,EAChC,SAAS;AAAA,EACT,UAAU,aAAa;AAAA,EACvB,UAAU;AAAA,EACV,SAAS,MAAM;AAAA,EAAC;AAClB;AAEO,MAAM,uBAAuB;AAAA,EAClC,GAAG;AAAA,EACH,SAAS,yCAAU,MAAM,CAAC,QAAQ,SAAS,IAAI,CAAC,EAC7C,YAAY,mEAAmE,EAC/E,aAAa,IAAI;AAAA,EACpB,UAAU,yCAAU,MAAM,CAAC,UAAU,OAAO,CAAC,EAC1C,YAAY,wCAAwC,EACpD,aAAa,QAAQ;AAAA,EACxB,UAAU,yCAAU,UAAU,CAAC,yCAAU,QAAQ,yCAAU,IAAI,CAAC,EAAE,YAAY,gCAAgC;AAAA,EAC9G,UAAU,yCAAU,KAAK,YAAY,sBAAsB;AAAA,EAC3D,SAAS,yCAAU,KAAK,YAAY,2BAA2B,EAAE,aAAa,QAAQ;AAAA,EACtF,OAAO,yCAAU,OAAO,YAAY,mDAAmD,EAAE;AAC3F;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
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 styled_exports = {};
|
|
30
|
+
__export(styled_exports, {
|
|
31
|
+
Label: () => Label,
|
|
32
|
+
Step: () => Step,
|
|
33
|
+
StepperWrapper: () => StepperWrapper,
|
|
34
|
+
StyledButton: () => StyledButton
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(styled_exports);
|
|
37
|
+
var React = __toESM(require("react"));
|
|
38
|
+
var import_ds_legacy_system = require("@elliemae/ds-legacy-system");
|
|
39
|
+
var import_ds_legacy_button_v2 = require("@elliemae/ds-legacy-button-v2");
|
|
40
|
+
var import_ds_legacy_truncated_tooltip_text = require("@elliemae/ds-legacy-truncated-tooltip-text");
|
|
41
|
+
const StepperWrapper = import_ds_legacy_system.styled.div`
|
|
42
|
+
display: grid;
|
|
43
|
+
align-items: center;
|
|
44
|
+
grid-template-columns repeat(${(props) => props.steps}, 1fr);
|
|
45
|
+
column-gap: ${(props) => props.steps >= 8 ? props.theme.space.xxxs : props.theme.space.xxs};
|
|
46
|
+
`;
|
|
47
|
+
const Step = import_ds_legacy_system.styled.div`
|
|
48
|
+
display: grid;
|
|
49
|
+
border-radius: 1px;
|
|
50
|
+
height: ${(props) => props.active ? "5px" : "3px"};
|
|
51
|
+
background: ${(props) => props.active || props.visited ? props.theme.colors.brand[700] : "#A9B1BE"};
|
|
52
|
+
`;
|
|
53
|
+
const Label = (0, import_ds_legacy_system.styled)(import_ds_legacy_truncated_tooltip_text.SimpleTruncatedTooltipText)`
|
|
54
|
+
position: relative;
|
|
55
|
+
top: 1px;
|
|
56
|
+
`;
|
|
57
|
+
const StyledButton = (0, import_ds_legacy_system.styled)(import_ds_legacy_button_v2.DSButtonV2)`
|
|
58
|
+
white-space: nowrap;
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
max-width: 100%;
|
|
61
|
+
padding-left: ${(props) => props.theme.space.xxs};
|
|
62
|
+
padding-right: ${(props) => props.theme.space.xxs};
|
|
63
|
+
color: ${(props) => props.theme.colors.brand[600]};
|
|
64
|
+
& > span:not(.em-ds-icon) {
|
|
65
|
+
position: relative;
|
|
66
|
+
top: ${(props) => props.fontSize === "large" ? "2px" : "1px"};
|
|
67
|
+
font-size: ${(props) => props.fontSize === "large" ? "22px" : "18px"};
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
70
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/styled.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { styled } from '@elliemae/ds-legacy-system';\nimport { DSButtonV2 } from '@elliemae/ds-legacy-button-v2';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-legacy-truncated-tooltip-text';\nimport type { DSStepperInternalsT } from './props.js';\n\nexport const StepperWrapper = styled.div`\n display: grid;\n align-items: center;\n grid-template-columns repeat(${(props: DSStepperInternalsT.StepperPropsT) => props.steps}, 1fr);\n column-gap: ${(props) => (props.steps >= 8 ? props.theme.space.xxxs : props.theme.space.xxs)};\n`;\n\ninterface StepProps {\n active: boolean;\n visited: boolean;\n}\n\nexport const Step = styled.div<StepProps>`\n display: grid;\n border-radius: 1px;\n height: ${(props) => (props.active ? '5px' : '3px')};\n background: ${(props) => (props.active || props.visited ? props.theme.colors.brand[700] : '#A9B1BE')};\n`;\n\nexport const Label = styled(SimpleTruncatedTooltipText)`\n position: relative;\n top: 1px;\n`;\n\nexport const StyledButton = styled(DSButtonV2)`\n white-space: nowrap;\n overflow: hidden;\n max-width: 100%;\n padding-left: ${(props) => props.theme.space.xxs};\n padding-right: ${(props) => props.theme.space.xxs};\n color: ${(props) => props.theme.colors.brand[600]};\n & > span:not(.em-ds-icon) {\n position: relative;\n top: ${(props: DSStepperInternalsT.StepperButtonPropsT) => (props.fontSize === 'large' ? '2px' : '1px')};\n font-size: ${(props: DSStepperInternalsT.StepperButtonPropsT) => (props.fontSize === 'large' ? '22px' : '18px')};\n }\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAAuB;AACvB,iCAA2B;AAC3B,8CAA2C;AAGpC,MAAM,iBAAiB,+BAAO;AAAA;AAAA;AAAA,mCAGF,CAAC,UAA6C,MAAM;AAAA,kBACrE,CAAC,UAAW,MAAM,SAAS,IAAI,MAAM,MAAM,MAAM,OAAO,MAAM,MAAM,MAAM;AAAA;AAQrF,MAAM,OAAO,+BAAO;AAAA;AAAA;AAAA,YAGf,CAAC,UAAW,MAAM,SAAS,QAAQ;AAAA,gBAC/B,CAAC,UAAW,MAAM,UAAU,MAAM,UAAU,MAAM,MAAM,OAAO,MAAM,GAAG,IAAI;AAAA;AAGrF,MAAM,YAAQ,gCAAO,kEAA0B;AAAA;AAAA;AAAA;AAK/C,MAAM,mBAAe,gCAAO,qCAAU;AAAA;AAAA;AAAA;AAAA,kBAI3B,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA,mBAC5B,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA,WACrC,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA,WAGvC,CAAC,UAAoD,MAAM,aAAa,UAAU,QAAQ;AAAA,iBACpF,CAAC,UAAoD,MAAM,aAAa,UAAU,SAAS;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSStepperDefinitions.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DSStepperName = 'DSStepper';\n\nexport const DSStepperButtonName = 'DSStepperButton';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,gBAAgB;AAEtB,MAAM,sBAAsB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import React2 from "react";
|
|
4
|
+
import { uid } from "uid";
|
|
5
|
+
import {
|
|
6
|
+
describe,
|
|
7
|
+
useMemoMergePropsWithDefault,
|
|
8
|
+
useValidateTypescriptPropTypes,
|
|
9
|
+
useGetGlobalAttributes
|
|
10
|
+
} from "@elliemae/ds-legacy-props-helpers";
|
|
11
|
+
import { dsStepperProps, defaultProps } from "./props.js";
|
|
12
|
+
import { Step, StepperWrapper } from "./styled.js";
|
|
13
|
+
import { DSStepperName } from "./DSStepperDefinitions.js";
|
|
14
|
+
const DSStepper = (props) => {
|
|
15
|
+
const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultProps);
|
|
16
|
+
useValidateTypescriptPropTypes(propsWithDefaults, dsStepperProps, DSStepperName);
|
|
17
|
+
const { steps, current, visited } = propsWithDefaults;
|
|
18
|
+
const stepsArray = React2.useMemo(() => new Array(steps).fill(1), [steps]);
|
|
19
|
+
const globalAttributes = useGetGlobalAttributes(propsWithDefaults);
|
|
20
|
+
return /* @__PURE__ */ jsx(StepperWrapper, { steps, current, visited, ...globalAttributes, children: stepsArray.map((item, index) => /* @__PURE__ */ jsx(
|
|
21
|
+
Step,
|
|
22
|
+
{
|
|
23
|
+
active: current === index,
|
|
24
|
+
visited: visited.includes(index),
|
|
25
|
+
"data-testid": props["data-testid"] ? `${props["data-testid"]}-step` : void 0,
|
|
26
|
+
"data-active": current === index,
|
|
27
|
+
"data-visited": visited.includes(index)
|
|
28
|
+
},
|
|
29
|
+
`${uid(4)}step-key-${index}`
|
|
30
|
+
)) });
|
|
31
|
+
};
|
|
32
|
+
DSStepper.propTypes = dsStepperProps;
|
|
33
|
+
DSStepper.displayName = DSStepperName;
|
|
34
|
+
const StepperWithSchema = describe(DSStepper);
|
|
35
|
+
StepperWithSchema.propTypes = dsStepperProps;
|
|
36
|
+
export {
|
|
37
|
+
DSStepper,
|
|
38
|
+
StepperWithSchema
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=Stepper.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/Stepper.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { uid } from 'uid';\nimport {\n describe,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n} from '@elliemae/ds-legacy-props-helpers';\nimport type { DSStepperInternalsT } from './props.js';\nimport { dsStepperProps, defaultProps } from './props.js';\nimport { Step, StepperWrapper } from './styled.js';\nimport { DSStepperName } from './DSStepperDefinitions.js';\n\nconst DSStepper = (props: DSStepperInternalsT.StepperPropsT) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultProps) as DSStepperInternalsT.StepperPropsT;\n useValidateTypescriptPropTypes(propsWithDefaults, dsStepperProps, DSStepperName);\n\n const { steps, current, visited } = propsWithDefaults;\n const stepsArray = React.useMemo(() => new Array(steps).fill(1) as number[], [steps]);\n const globalAttributes = useGetGlobalAttributes(propsWithDefaults);\n\n return (\n <StepperWrapper steps={steps} current={current} visited={visited} {...globalAttributes}>\n {stepsArray.map((item, index) => (\n <Step\n // eslint-disable-next-line react/no-array-index-key\n key={`${uid(4)}step-key-${index}`}\n active={current === index}\n visited={visited.includes(index)}\n data-testid={props['data-testid'] ? `${props['data-testid'] as string}-step` : undefined}\n data-active={current === index}\n data-visited={visited.includes(index)}\n />\n ))}\n </StepperWrapper>\n );\n};\n\nDSStepper.propTypes = dsStepperProps;\nDSStepper.displayName = DSStepperName;\nconst StepperWithSchema = describe(DSStepper);\nStepperWithSchema.propTypes = dsStepperProps;\n\nexport { DSStepper, StepperWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACwBf;AAxBR,OAAOA,YAAW;AAClB,SAAS,WAAW;AACpB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,gBAAgB,oBAAoB;AAC7C,SAAS,MAAM,sBAAsB;AACrC,SAAS,qBAAqB;AAE9B,MAAM,YAAY,CAAC,UAA6C;AAC9D,QAAM,oBAAoB,6BAA6B,OAAO,YAAY;AAC1E,iCAA+B,mBAAmB,gBAAgB,aAAa;AAE/E,QAAM,EAAE,OAAO,SAAS,QAAQ,IAAI;AACpC,QAAM,aAAaA,OAAM,QAAQ,MAAM,IAAI,MAAM,KAAK,EAAE,KAAK,CAAC,GAAe,CAAC,KAAK,CAAC;AACpF,QAAM,mBAAmB,uBAAuB,iBAAiB;AAEjE,SACE,oBAAC,kBAAe,OAAc,SAAkB,SAAmB,GAAG,kBACnE,qBAAW,IAAI,CAAC,MAAM,UACrB;AAAA,IAAC;AAAA;AAAA,MAGC,QAAQ,YAAY;AAAA,MACpB,SAAS,QAAQ,SAAS,KAAK;AAAA,MAC/B,eAAa,MAAM,aAAa,IAAI,GAAG,MAAM,aAAa,WAAqB;AAAA,MAC/E,eAAa,YAAY;AAAA,MACzB,gBAAc,QAAQ,SAAS,KAAK;AAAA;AAAA,IAL/B,GAAG,IAAI,CAAC,aAAa;AAAA,EAM5B,CACD,GACH;AAEJ;AAEA,UAAU,YAAY;AACtB,UAAU,cAAc;AACxB,MAAM,oBAAoB,SAAS,SAAS;AAC5C,kBAAkB,YAAY;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
describe,
|
|
5
|
+
useMemoMergePropsWithDefault,
|
|
6
|
+
useValidateTypescriptPropTypes,
|
|
7
|
+
useGetGlobalAttributes
|
|
8
|
+
} from "@elliemae/ds-legacy-props-helpers";
|
|
9
|
+
import { BUTTON_TYPES } from "@elliemae/ds-legacy-button-v2";
|
|
10
|
+
import { ChevronLeft, ChevronRight } from "@elliemae/ds-legacy-icons";
|
|
11
|
+
import { dsStepperButtonProps, defaultButtonProps } from "./props.js";
|
|
12
|
+
import { StyledButton, Label } from "./styled.js";
|
|
13
|
+
import { DSStepperButtonName } from "./DSStepperDefinitions.js";
|
|
14
|
+
const DSStepperButton = (props) => {
|
|
15
|
+
const propsWithDefaults = useMemoMergePropsWithDefault(
|
|
16
|
+
props,
|
|
17
|
+
defaultButtonProps
|
|
18
|
+
);
|
|
19
|
+
useValidateTypescriptPropTypes(propsWithDefaults, dsStepperButtonProps, DSStepperButtonName);
|
|
20
|
+
const { chevron, fontSize, label, disabled, onClick, innerRef } = propsWithDefaults;
|
|
21
|
+
const globalAttributes = useGetGlobalAttributes(propsWithDefaults);
|
|
22
|
+
return /* @__PURE__ */ jsxs(
|
|
23
|
+
StyledButton,
|
|
24
|
+
{
|
|
25
|
+
disabled,
|
|
26
|
+
onClick,
|
|
27
|
+
innerRef,
|
|
28
|
+
buttonType: BUTTON_TYPES.TEXT,
|
|
29
|
+
fontSize,
|
|
30
|
+
"data-testid": "ds-stepper-btn",
|
|
31
|
+
...globalAttributes,
|
|
32
|
+
children: [
|
|
33
|
+
chevron === "left" ? /* @__PURE__ */ jsx(ChevronLeft, {}) : null,
|
|
34
|
+
/* @__PURE__ */ jsx(Label, { value: label }),
|
|
35
|
+
chevron === "right" ? /* @__PURE__ */ jsx(ChevronRight, {}) : null
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
DSStepperButton.propTypes = dsStepperButtonProps;
|
|
41
|
+
DSStepperButton.displayName = DSStepperButtonName;
|
|
42
|
+
const DSStepperButtonWithSchema = describe(DSStepperButton);
|
|
43
|
+
DSStepperButtonWithSchema.propTypes = dsStepperButtonProps;
|
|
44
|
+
export {
|
|
45
|
+
DSStepperButton,
|
|
46
|
+
DSStepperButtonWithSchema
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=StepperButton.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/StepperButton.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport {\n describe,\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n} from '@elliemae/ds-legacy-props-helpers';\nimport { BUTTON_TYPES } from '@elliemae/ds-legacy-button-v2';\nimport { ChevronLeft, ChevronRight } from '@elliemae/ds-legacy-icons';\nimport type { DSStepperInternalsT } from './props.js';\nimport { dsStepperButtonProps, defaultButtonProps } from './props.js';\nimport { StyledButton, Label } from './styled.js';\nimport { DSStepperButtonName } from './DSStepperDefinitions.js';\n\nconst DSStepperButton = (props: DSStepperInternalsT.StepperButtonPropsT) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(\n props,\n defaultButtonProps,\n ) as DSStepperInternalsT.StepperButtonPropsT;\n useValidateTypescriptPropTypes(propsWithDefaults, dsStepperButtonProps, DSStepperButtonName);\n\n const { chevron, fontSize, label, disabled, onClick, innerRef } = propsWithDefaults;\n const globalAttributes = useGetGlobalAttributes(propsWithDefaults);\n\n return (\n <StyledButton\n disabled={disabled}\n onClick={onClick}\n innerRef={innerRef}\n buttonType={BUTTON_TYPES.TEXT}\n fontSize={fontSize}\n data-testid=\"ds-stepper-btn\"\n {...globalAttributes}\n >\n {chevron === 'left' ? <ChevronLeft /> : null}\n <Label value={label} />\n {chevron === 'right' ? <ChevronRight /> : null}\n </StyledButton>\n );\n};\n\nDSStepperButton.propTypes = dsStepperButtonProps;\nDSStepperButton.displayName = DSStepperButtonName;\nconst DSStepperButtonWithSchema = describe(DSStepperButton);\nDSStepperButtonWithSchema.propTypes = dsStepperButtonProps;\n\nexport { DSStepperButton, DSStepperButtonWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACyBnB,SASwB,KATxB;AAxBJ;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,oBAAoB;AAC7B,SAAS,aAAa,oBAAoB;AAE1C,SAAS,sBAAsB,0BAA0B;AACzD,SAAS,cAAc,aAAa;AACpC,SAAS,2BAA2B;AAEpC,MAAM,kBAAkB,CAAC,UAAmD;AAC1E,QAAM,oBAAoB;AAAA,IACxB;AAAA,IACA;AAAA,EACF;AACA,iCAA+B,mBAAmB,sBAAsB,mBAAmB;AAE3F,QAAM,EAAE,SAAS,UAAU,OAAO,UAAU,SAAS,SAAS,IAAI;AAClE,QAAM,mBAAmB,uBAAuB,iBAAiB;AAEjE,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,YAAY,aAAa;AAAA,MACzB;AAAA,MACA,eAAY;AAAA,MACX,GAAG;AAAA,MAEH;AAAA,oBAAY,SAAS,oBAAC,eAAY,IAAK;AAAA,QACxC,oBAAC,SAAM,OAAO,OAAO;AAAA,QACpB,YAAY,UAAU,oBAAC,gBAAa,IAAK;AAAA;AAAA;AAAA,EAC5C;AAEJ;AAEA,gBAAgB,YAAY;AAC5B,gBAAgB,cAAc;AAC9B,MAAM,4BAA4B,SAAS,eAAe;AAC1D,0BAA0B,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './Stepper.js';\nexport * from './StepperButton.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PropTypes, globalAttributesPropTypes } from "@elliemae/ds-legacy-props-helpers";
|
|
3
|
+
const BUTTON_SIZES = {
|
|
4
|
+
normal: "normal",
|
|
5
|
+
large: "large"
|
|
6
|
+
};
|
|
7
|
+
const CHEVRON_TYPE = {
|
|
8
|
+
left: "left",
|
|
9
|
+
right: "right"
|
|
10
|
+
};
|
|
11
|
+
const defaultProps = {
|
|
12
|
+
steps: 5,
|
|
13
|
+
current: void 0,
|
|
14
|
+
visited: []
|
|
15
|
+
};
|
|
16
|
+
const dsStepperProps = {
|
|
17
|
+
...globalAttributesPropTypes,
|
|
18
|
+
steps: PropTypes.number.description("Number of steps").isRequired,
|
|
19
|
+
current: PropTypes.number.description("Index of active step"),
|
|
20
|
+
visited: PropTypes.arrayOf(PropTypes.number).description("Array of visited steps").isRequired
|
|
21
|
+
};
|
|
22
|
+
const defaultButtonProps = {
|
|
23
|
+
chevron: void 0,
|
|
24
|
+
fontSize: BUTTON_SIZES.normal,
|
|
25
|
+
disabled: false,
|
|
26
|
+
onClick: () => {
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const dsStepperButtonProps = {
|
|
30
|
+
...globalAttributesPropTypes,
|
|
31
|
+
chevron: PropTypes.oneOf(["left", "right", null]).description("Chevron icon position, if null/undefined no chevron will be shown").defaultValue(null),
|
|
32
|
+
fontSize: PropTypes.oneOf(["normal", "large"]).description("Label size, used for marking last step").defaultValue("normal"),
|
|
33
|
+
innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description("Inner ref to button component."),
|
|
34
|
+
disabled: PropTypes.bool.description("Adds disabled state."),
|
|
35
|
+
onClick: PropTypes.func.description("OnClick callback handler.").defaultValue("()=>{}"),
|
|
36
|
+
label: PropTypes.string.description("Text Label, this only accepts text, no custom JSX").isRequired
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
defaultButtonProps,
|
|
40
|
+
defaultProps,
|
|
41
|
+
dsStepperButtonProps,
|
|
42
|
+
dsStepperProps
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=props.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/props.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { WeakValidationMap } from 'react';\nimport { PropTypes, globalAttributesPropTypes } from '@elliemae/ds-legacy-props-helpers';\n\nconst BUTTON_SIZES = {\n normal: 'normal',\n large: 'large',\n} as const;\n\ntype ButtonSizesT = (typeof BUTTON_SIZES)[keyof typeof BUTTON_SIZES];\n\nconst CHEVRON_TYPE = {\n left: 'left',\n right: 'right',\n} as const;\n\ntype ChevronT = (typeof CHEVRON_TYPE)[keyof typeof CHEVRON_TYPE];\n\nexport declare namespace DSStepperInternalsT {\n export interface StepperPropsT {\n [property: string]: unknown;\n steps: number;\n current: number | null;\n visited: number[];\n }\n\n export interface StepperButtonPropsT {\n [property: string]: unknown;\n chevron?: ChevronT;\n fontSize?: ButtonSizesT;\n label: string;\n disabled?: boolean;\n onClick: VoidFunction;\n innerRef?: React.MutableRefObject<HTMLButtonElement> | ((_ref: HTMLButtonElement) => void);\n 'aria-label'?: string;\n 'aria-pressed'?: boolean;\n 'data-testid'?: string;\n }\n}\nexport const defaultProps = {\n steps: 5,\n current: undefined,\n visited: [],\n};\n\nexport const dsStepperProps = {\n ...globalAttributesPropTypes,\n steps: PropTypes.number.description('Number of steps').isRequired,\n current: PropTypes.number.description('Index of active step'),\n visited: PropTypes.arrayOf(PropTypes.number).description('Array of visited steps').isRequired,\n} as WeakValidationMap<unknown>;\n\nexport const defaultButtonProps = {\n chevron: undefined,\n fontSize: BUTTON_SIZES.normal,\n disabled: false,\n onClick: () => {},\n};\n\nexport const dsStepperButtonProps = {\n ...globalAttributesPropTypes,\n chevron: PropTypes.oneOf(['left', 'right', null])\n .description('Chevron icon position, if null/undefined no chevron will be shown')\n .defaultValue(null),\n fontSize: PropTypes.oneOf(['normal', 'large'])\n .description('Label size, used for marking last step')\n .defaultValue('normal'),\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description('Inner ref to button component.'),\n disabled: PropTypes.bool.description('Adds disabled state.'),\n onClick: PropTypes.func.description('OnClick callback handler.').defaultValue('()=>{}'),\n label: PropTypes.string.description('Text Label, this only accepts text, no custom JSX').isRequired,\n} as WeakValidationMap<unknown>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,WAAW,iCAAiC;AAErD,MAAM,eAAe;AAAA,EACnB,QAAQ;AAAA,EACR,OAAO;AACT;AAIA,MAAM,eAAe;AAAA,EACnB,MAAM;AAAA,EACN,OAAO;AACT;AAyBO,MAAM,eAAe;AAAA,EAC1B,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS,CAAC;AACZ;AAEO,MAAM,iBAAiB;AAAA,EAC5B,GAAG;AAAA,EACH,OAAO,UAAU,OAAO,YAAY,iBAAiB,EAAE;AAAA,EACvD,SAAS,UAAU,OAAO,YAAY,sBAAsB;AAAA,EAC5D,SAAS,UAAU,QAAQ,UAAU,MAAM,EAAE,YAAY,wBAAwB,EAAE;AACrF;AAEO,MAAM,qBAAqB;AAAA,EAChC,SAAS;AAAA,EACT,UAAU,aAAa;AAAA,EACvB,UAAU;AAAA,EACV,SAAS,MAAM;AAAA,EAAC;AAClB;AAEO,MAAM,uBAAuB;AAAA,EAClC,GAAG;AAAA,EACH,SAAS,UAAU,MAAM,CAAC,QAAQ,SAAS,IAAI,CAAC,EAC7C,YAAY,mEAAmE,EAC/E,aAAa,IAAI;AAAA,EACpB,UAAU,UAAU,MAAM,CAAC,UAAU,OAAO,CAAC,EAC1C,YAAY,wCAAwC,EACpD,aAAa,QAAQ;AAAA,EACxB,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,IAAI,CAAC,EAAE,YAAY,gCAAgC;AAAA,EAC9G,UAAU,UAAU,KAAK,YAAY,sBAAsB;AAAA,EAC3D,SAAS,UAAU,KAAK,YAAY,2BAA2B,EAAE,aAAa,QAAQ;AAAA,EACtF,OAAO,UAAU,OAAO,YAAY,mDAAmD,EAAE;AAC3F;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { styled } from "@elliemae/ds-legacy-system";
|
|
3
|
+
import { DSButtonV2 } from "@elliemae/ds-legacy-button-v2";
|
|
4
|
+
import { SimpleTruncatedTooltipText } from "@elliemae/ds-legacy-truncated-tooltip-text";
|
|
5
|
+
const StepperWrapper = styled.div`
|
|
6
|
+
display: grid;
|
|
7
|
+
align-items: center;
|
|
8
|
+
grid-template-columns repeat(${(props) => props.steps}, 1fr);
|
|
9
|
+
column-gap: ${(props) => props.steps >= 8 ? props.theme.space.xxxs : props.theme.space.xxs};
|
|
10
|
+
`;
|
|
11
|
+
const Step = styled.div`
|
|
12
|
+
display: grid;
|
|
13
|
+
border-radius: 1px;
|
|
14
|
+
height: ${(props) => props.active ? "5px" : "3px"};
|
|
15
|
+
background: ${(props) => props.active || props.visited ? props.theme.colors.brand[700] : "#A9B1BE"};
|
|
16
|
+
`;
|
|
17
|
+
const Label = styled(SimpleTruncatedTooltipText)`
|
|
18
|
+
position: relative;
|
|
19
|
+
top: 1px;
|
|
20
|
+
`;
|
|
21
|
+
const StyledButton = styled(DSButtonV2)`
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
max-width: 100%;
|
|
25
|
+
padding-left: ${(props) => props.theme.space.xxs};
|
|
26
|
+
padding-right: ${(props) => props.theme.space.xxs};
|
|
27
|
+
color: ${(props) => props.theme.colors.brand[600]};
|
|
28
|
+
& > span:not(.em-ds-icon) {
|
|
29
|
+
position: relative;
|
|
30
|
+
top: ${(props) => props.fontSize === "large" ? "2px" : "1px"};
|
|
31
|
+
font-size: ${(props) => props.fontSize === "large" ? "22px" : "18px"};
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
export {
|
|
35
|
+
Label,
|
|
36
|
+
Step,
|
|
37
|
+
StepperWrapper,
|
|
38
|
+
StyledButton
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/styled.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-legacy-system';\nimport { DSButtonV2 } from '@elliemae/ds-legacy-button-v2';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-legacy-truncated-tooltip-text';\nimport type { DSStepperInternalsT } from './props.js';\n\nexport const StepperWrapper = styled.div`\n display: grid;\n align-items: center;\n grid-template-columns repeat(${(props: DSStepperInternalsT.StepperPropsT) => props.steps}, 1fr);\n column-gap: ${(props) => (props.steps >= 8 ? props.theme.space.xxxs : props.theme.space.xxs)};\n`;\n\ninterface StepProps {\n active: boolean;\n visited: boolean;\n}\n\nexport const Step = styled.div<StepProps>`\n display: grid;\n border-radius: 1px;\n height: ${(props) => (props.active ? '5px' : '3px')};\n background: ${(props) => (props.active || props.visited ? props.theme.colors.brand[700] : '#A9B1BE')};\n`;\n\nexport const Label = styled(SimpleTruncatedTooltipText)`\n position: relative;\n top: 1px;\n`;\n\nexport const StyledButton = styled(DSButtonV2)`\n white-space: nowrap;\n overflow: hidden;\n max-width: 100%;\n padding-left: ${(props) => props.theme.space.xxs};\n padding-right: ${(props) => props.theme.space.xxs};\n color: ${(props) => props.theme.colors.brand[600]};\n & > span:not(.em-ds-icon) {\n position: relative;\n top: ${(props: DSStepperInternalsT.StepperButtonPropsT) => (props.fontSize === 'large' ? '2px' : '1px')};\n font-size: ${(props: DSStepperInternalsT.StepperButtonPropsT) => (props.fontSize === 'large' ? '22px' : '18px')};\n }\n`;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,kCAAkC;AAGpC,MAAM,iBAAiB,OAAO;AAAA;AAAA;AAAA,mCAGF,CAAC,UAA6C,MAAM;AAAA,kBACrE,CAAC,UAAW,MAAM,SAAS,IAAI,MAAM,MAAM,MAAM,OAAO,MAAM,MAAM,MAAM;AAAA;AAQrF,MAAM,OAAO,OAAO;AAAA;AAAA;AAAA,YAGf,CAAC,UAAW,MAAM,SAAS,QAAQ;AAAA,gBAC/B,CAAC,UAAW,MAAM,UAAU,MAAM,UAAU,MAAM,MAAM,OAAO,MAAM,GAAG,IAAI;AAAA;AAGrF,MAAM,QAAQ,OAAO,0BAA0B;AAAA;AAAA;AAAA;AAK/C,MAAM,eAAe,OAAO,UAAU;AAAA;AAAA;AAAA;AAAA,kBAI3B,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA,mBAC5B,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA,WACrC,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM,GAAG;AAAA;AAAA;AAAA,WAGvC,CAAC,UAAoD,MAAM,aAAa,UAAU,QAAQ;AAAA,iBACpF,CAAC,UAAoD,MAAM,aAAa,UAAU,SAAS;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DSStepperInternalsT } from './props.js';
|
|
3
|
+
declare const DSStepper: {
|
|
4
|
+
(props: DSStepperInternalsT.StepperPropsT): import("react/jsx-runtime.js").JSX.Element;
|
|
5
|
+
propTypes: React.WeakValidationMap<unknown>;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
8
|
+
declare const StepperWithSchema: import("@elliemae/ds-legacy-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSStepperInternalsT.StepperPropsT>;
|
|
9
|
+
export { DSStepper, StepperWithSchema };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DSStepperInternalsT } from './props.js';
|
|
3
|
+
declare const DSStepperButton: {
|
|
4
|
+
(props: DSStepperInternalsT.StepperButtonPropsT): import("react/jsx-runtime.js").JSX.Element;
|
|
5
|
+
propTypes: React.WeakValidationMap<unknown>;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
8
|
+
declare const DSStepperButtonWithSchema: import("@elliemae/ds-legacy-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSStepperInternalsT.StepperButtonPropsT>;
|
|
9
|
+
export { DSStepperButton, DSStepperButtonWithSchema };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { WeakValidationMap } from 'react';
|
|
2
|
+
declare const BUTTON_SIZES: {
|
|
3
|
+
readonly normal: "normal";
|
|
4
|
+
readonly large: "large";
|
|
5
|
+
};
|
|
6
|
+
type ButtonSizesT = (typeof BUTTON_SIZES)[keyof typeof BUTTON_SIZES];
|
|
7
|
+
declare const CHEVRON_TYPE: {
|
|
8
|
+
readonly left: "left";
|
|
9
|
+
readonly right: "right";
|
|
10
|
+
};
|
|
11
|
+
type ChevronT = (typeof CHEVRON_TYPE)[keyof typeof CHEVRON_TYPE];
|
|
12
|
+
export declare namespace DSStepperInternalsT {
|
|
13
|
+
interface StepperPropsT {
|
|
14
|
+
[property: string]: unknown;
|
|
15
|
+
steps: number;
|
|
16
|
+
current: number | null;
|
|
17
|
+
visited: number[];
|
|
18
|
+
}
|
|
19
|
+
interface StepperButtonPropsT {
|
|
20
|
+
[property: string]: unknown;
|
|
21
|
+
chevron?: ChevronT;
|
|
22
|
+
fontSize?: ButtonSizesT;
|
|
23
|
+
label: string;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
onClick: VoidFunction;
|
|
26
|
+
innerRef?: React.MutableRefObject<HTMLButtonElement> | ((_ref: HTMLButtonElement) => void);
|
|
27
|
+
'aria-label'?: string;
|
|
28
|
+
'aria-pressed'?: boolean;
|
|
29
|
+
'data-testid'?: string;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export declare const defaultProps: {
|
|
33
|
+
steps: number;
|
|
34
|
+
current: undefined;
|
|
35
|
+
visited: never[];
|
|
36
|
+
};
|
|
37
|
+
export declare const dsStepperProps: WeakValidationMap<unknown>;
|
|
38
|
+
export declare const defaultButtonProps: {
|
|
39
|
+
chevron: undefined;
|
|
40
|
+
fontSize: "normal";
|
|
41
|
+
disabled: boolean;
|
|
42
|
+
onClick: () => void;
|
|
43
|
+
};
|
|
44
|
+
export declare const dsStepperButtonProps: WeakValidationMap<unknown>;
|
|
45
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elliemae/ds-legacy-stepper",
|
|
3
|
+
"version": "1.0.0-rc.1",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "ICE MT - Dimsum - Stepper",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"module": "./dist/esm/index.js",
|
|
10
|
+
"main": "./dist/cjs/index.js",
|
|
11
|
+
"types": "./dist/types/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./dist/esm/index.js",
|
|
15
|
+
"require": "./dist/cjs/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./styled": {
|
|
18
|
+
"import": "./dist/esm/styled.js",
|
|
19
|
+
"require": "./dist/cjs/styled.js"
|
|
20
|
+
},
|
|
21
|
+
"./StepperButton": {
|
|
22
|
+
"import": "./dist/esm/StepperButton.js",
|
|
23
|
+
"require": "./dist/cjs/StepperButton.js"
|
|
24
|
+
},
|
|
25
|
+
"./Stepper": {
|
|
26
|
+
"import": "./dist/esm/Stepper.js",
|
|
27
|
+
"require": "./dist/cjs/Stepper.js"
|
|
28
|
+
},
|
|
29
|
+
"./props": {
|
|
30
|
+
"import": "./dist/esm/props.js",
|
|
31
|
+
"require": "./dist/cjs/props.js"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"sideEffects": [
|
|
35
|
+
"*.css",
|
|
36
|
+
"*.scss"
|
|
37
|
+
],
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "https://git.elliemae.io/platform-ui/dimsum-legacy.git"
|
|
41
|
+
},
|
|
42
|
+
"engines": {
|
|
43
|
+
"pnpm": ">=6",
|
|
44
|
+
"node": ">=16"
|
|
45
|
+
},
|
|
46
|
+
"author": "ICE MT",
|
|
47
|
+
"jestSonar": {
|
|
48
|
+
"sonar56x": true,
|
|
49
|
+
"reportPath": "reports",
|
|
50
|
+
"reportFile": "tests.xml",
|
|
51
|
+
"indent": 4
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"prop-types": "~15.8.1",
|
|
55
|
+
"uid": "~2.0.1",
|
|
56
|
+
"@elliemae/ds-legacy-button-v2": "1.0.0-rc.1",
|
|
57
|
+
"@elliemae/ds-legacy-props-helpers": "1.0.0-rc.1",
|
|
58
|
+
"@elliemae/ds-legacy-truncated-tooltip-text": "1.0.0-rc.1",
|
|
59
|
+
"@elliemae/ds-legacy-system": "1.0.0-rc.1",
|
|
60
|
+
"@elliemae/ds-legacy-icons": "1.0.0-rc.1"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@elliemae/pui-cli": "~9.0.0-next.31",
|
|
64
|
+
"styled-components": "~5.3.9",
|
|
65
|
+
"@elliemae/ds-legacy-monorepo-devops": "1.0.0-rc.1"
|
|
66
|
+
},
|
|
67
|
+
"peerDependencies": {
|
|
68
|
+
"react": "^17.0.2",
|
|
69
|
+
"react-dom": "^17.0.2",
|
|
70
|
+
"styled-components": "~5.3.9",
|
|
71
|
+
"styled-system": "^5.1.5"
|
|
72
|
+
},
|
|
73
|
+
"publishConfig": {
|
|
74
|
+
"access": "public",
|
|
75
|
+
"typeSafety": false
|
|
76
|
+
},
|
|
77
|
+
"scripts": {
|
|
78
|
+
"dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
|
|
79
|
+
"test": "pui-cli test --passWithNoTests",
|
|
80
|
+
"lint": "node ../../../scripts/lint.mjs",
|
|
81
|
+
"eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../../.eslintrc.js' src/",
|
|
82
|
+
"dts": "node ../../../scripts/dts.mjs",
|
|
83
|
+
"build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
|
|
84
|
+
"dev:build": "pnpm --filter {.}... build",
|
|
85
|
+
"dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
|
|
86
|
+
"checkDeps": "npm exec ../../util/ds-codemods -- check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
|
|
87
|
+
}
|
|
88
|
+
}
|