@elliemae/ds-stepper 2.3.0-next.3 → 3.0.0-alpha.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/Stepper.js +64 -0
- package/dist/cjs/Stepper.js.map +7 -0
- package/dist/cjs/StepperButton.js +62 -0
- package/dist/cjs/StepperButton.js.map +7 -0
- package/dist/cjs/index.js +29 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/props.js +74 -0
- package/dist/cjs/props.js.map +7 -0
- package/dist/cjs/styled.js +69 -0
- package/dist/cjs/styled.js.map +7 -0
- package/dist/esm/Stepper.js +39 -0
- package/dist/esm/Stepper.js.map +7 -0
- package/dist/esm/StepperButton.js +37 -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/props.js +45 -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/{types → dist/types}/Stepper.d.ts +0 -0
- package/{types → dist/types}/StepperButton.d.ts +0 -0
- package/{types → dist/types}/index.d.ts +0 -0
- package/{types → dist/types}/props.d.ts +0 -0
- package/{types → dist/types}/styled.d.ts +1 -1
- package/{types → dist/types}/tests/Stepper.global-attributes.test.d.ts +0 -0
- package/{types → dist/types}/tests/Stepper.test.d.ts +0 -0
- package/{types → dist/types}/tests/StepperButton.global-attributes.test.d.ts +0 -0
- package/package.json +35 -27
- package/cjs/Stepper.js +0 -62
- package/cjs/StepperButton.js +0 -62
- package/cjs/index.js +0 -13
- package/cjs/props.js +0 -55
- package/cjs/styled.js +0 -29
- package/esm/Stepper.js +0 -51
- package/esm/StepperButton.js +0 -52
- package/esm/index.js +0 -2
- package/esm/props.js +0 -44
- package/esm/styled.js +0 -18
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var Stepper_exports = {};
|
|
29
|
+
__export(Stepper_exports, {
|
|
30
|
+
DSStepper: () => DSStepper,
|
|
31
|
+
StepperWithSchema: () => StepperWithSchema
|
|
32
|
+
});
|
|
33
|
+
var React = __toESM(require("react"));
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
var import_uid = require("uid");
|
|
36
|
+
var import_react_desc = require("react-desc");
|
|
37
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
38
|
+
var import_props = require("./props");
|
|
39
|
+
var import_styled = require("./styled");
|
|
40
|
+
const DSStepper = (props) => {
|
|
41
|
+
const propsWithDefaults = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, import_props.defaultProps);
|
|
42
|
+
(0, import_ds_props_helpers.useValidateTypescriptPropTypes)(propsWithDefaults, import_props.dsStepperProps);
|
|
43
|
+
const { steps, current, visited } = propsWithDefaults;
|
|
44
|
+
const stepsArray = import_react.default.useMemo(() => new Array(steps).fill(1), [steps]);
|
|
45
|
+
const globalAttributes = (0, import_ds_props_helpers.useGetGlobalAttributes)(propsWithDefaults);
|
|
46
|
+
return /* @__PURE__ */ import_react.default.createElement(import_styled.StepperWrapper, {
|
|
47
|
+
steps,
|
|
48
|
+
current,
|
|
49
|
+
visited,
|
|
50
|
+
...globalAttributes
|
|
51
|
+
}, stepsArray.map((item, index) => /* @__PURE__ */ import_react.default.createElement(import_styled.Step, {
|
|
52
|
+
key: `${(0, import_uid.uid)(4)}step-key-${index}`,
|
|
53
|
+
active: current === index,
|
|
54
|
+
visited: visited.includes(index),
|
|
55
|
+
"data-testid": props["data-testid"] ? `${props["data-testid"]}-step` : void 0,
|
|
56
|
+
"data-active": current === index,
|
|
57
|
+
"data-visited": visited.includes(index)
|
|
58
|
+
})));
|
|
59
|
+
};
|
|
60
|
+
DSStepper.propTypes = import_props.dsStepperProps;
|
|
61
|
+
const StepperWithSchema = (0, import_react_desc.describe)(DSStepper);
|
|
62
|
+
StepperWithSchema.propTypes = import_props.dsStepperProps;
|
|
63
|
+
module.exports = __toCommonJS(Stepper_exports);
|
|
64
|
+
//# 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 { describe } from 'react-desc';\nimport {\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n} from '@elliemae/ds-props-helpers';\nimport { dsStepperProps, defaultProps, DSStepperInternalsT } from './props';\nimport { Step, StepperWrapper } from './styled';\n\nconst DSStepper = (props: DSStepperInternalsT.StepperPropsT) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultProps) as DSStepperInternalsT.StepperPropsT;\n useValidateTypescriptPropTypes(propsWithDefaults, dsStepperProps);\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;\n\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;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,iBAAoB;AACpB,wBAAyB;AACzB,8BAIO;AACP,mBAAkE;AAClE,oBAAqC;AAErC,MAAM,YAAY,CAAC,UAA6C;AAC9D,QAAM,oBAAoB,0DAA6B,OAAO;AAC9D,8DAA+B,mBAAmB;AAElD,QAAM,EAAE,OAAO,SAAS,YAAY;AACpC,QAAM,aAAa,qBAAM,QAAQ,MAAM,IAAI,MAAM,OAAO,KAAK,IAAgB,CAAC;AAC9E,QAAM,mBAAmB,oDAAuB;AAEhD,SACE,mDAAC,8BAAD;AAAA,IAAgB;AAAA,IAAc;AAAA,IAAkB;AAAA,OAAsB;AAAA,KACnE,WAAW,IAAI,CAAC,MAAM,UACrB,mDAAC,oBAAD;AAAA,IAEE,KAAK,GAAG,oBAAI,cAAc;AAAA,IAC1B,QAAQ,YAAY;AAAA,IACpB,SAAS,QAAQ,SAAS;AAAA,IAC1B,eAAa,MAAM,iBAAiB,GAAG,MAAM,wBAAkC;AAAA,IAC/E,eAAa,YAAY;AAAA,IACzB,gBAAc,QAAQ,SAAS;AAAA;AAAA;AAOzC,UAAU,YAAY;AAEtB,MAAM,oBAAoB,gCAAS;AACnC,kBAAkB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var StepperButton_exports = {};
|
|
29
|
+
__export(StepperButton_exports, {
|
|
30
|
+
DSStepperButton: () => DSStepperButton,
|
|
31
|
+
DSStepperButtonWithSchema: () => DSStepperButtonWithSchema
|
|
32
|
+
});
|
|
33
|
+
var React = __toESM(require("react"));
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
var import_react_desc = require("react-desc");
|
|
36
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
37
|
+
var import_ds_button = require("@elliemae/ds-button");
|
|
38
|
+
var import_ds_icons = require("@elliemae/ds-icons");
|
|
39
|
+
var import_props = require("./props");
|
|
40
|
+
var import_styled = require("./styled");
|
|
41
|
+
const DSStepperButton = (props) => {
|
|
42
|
+
const propsWithDefaults = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(props, import_props.defaultButtonProps);
|
|
43
|
+
(0, import_ds_props_helpers.useValidateTypescriptPropTypes)(propsWithDefaults, import_props.dsStepperButtonProps);
|
|
44
|
+
const { chevron, fontSize, label, disabled, onClick, innerRef } = propsWithDefaults;
|
|
45
|
+
const globalAttributes = (0, import_ds_props_helpers.useGetGlobalAttributes)(propsWithDefaults);
|
|
46
|
+
return /* @__PURE__ */ import_react.default.createElement(import_styled.StyledButton, {
|
|
47
|
+
disabled,
|
|
48
|
+
onClick,
|
|
49
|
+
innerRef,
|
|
50
|
+
buttonType: import_ds_button.BUTTON_TYPES.TEXT,
|
|
51
|
+
fontSize,
|
|
52
|
+
"data-testid": "ds-stepper-btn",
|
|
53
|
+
...globalAttributes
|
|
54
|
+
}, chevron === "left" ? /* @__PURE__ */ import_react.default.createElement(import_ds_icons.ChevronLeft, null) : null, /* @__PURE__ */ import_react.default.createElement(import_styled.Label, {
|
|
55
|
+
value: label
|
|
56
|
+
}), chevron === "right" ? /* @__PURE__ */ import_react.default.createElement(import_ds_icons.ChevronRight, null) : null);
|
|
57
|
+
};
|
|
58
|
+
DSStepperButton.propTypes = import_props.dsStepperButtonProps;
|
|
59
|
+
const DSStepperButtonWithSchema = (0, import_react_desc.describe)(DSStepperButton);
|
|
60
|
+
DSStepperButtonWithSchema.propTypes = import_props.dsStepperButtonProps;
|
|
61
|
+
module.exports = __toCommonJS(StepperButton_exports);
|
|
62
|
+
//# 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 { describe } from 'react-desc';\nimport {\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n} from '@elliemae/ds-props-helpers';\nimport { BUTTON_TYPES } from '@elliemae/ds-button';\nimport { ChevronLeft, ChevronRight } from '@elliemae/ds-icons';\nimport { dsStepperButtonProps, defaultButtonProps, DSStepperInternalsT } from './props';\nimport { StyledButton, Label } from './styled';\n\nconst DSStepperButton = (props: DSStepperInternalsT.StepperButtonPropsT) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(\n props,\n defaultButtonProps,\n ) as DSStepperInternalsT.StepperButtonPropsT;\n useValidateTypescriptPropTypes(propsWithDefaults, dsStepperButtonProps);\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;\n\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;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,wBAAyB;AACzB,8BAIO;AACP,uBAA6B;AAC7B,sBAA0C;AAC1C,mBAA8E;AAC9E,oBAAoC;AAEpC,MAAM,kBAAkB,CAAC,UAAmD;AAC1E,QAAM,oBAAoB,0DACxB,OACA;AAEF,8DAA+B,mBAAmB;AAElD,QAAM,EAAE,SAAS,UAAU,OAAO,UAAU,SAAS,aAAa;AAClE,QAAM,mBAAmB,oDAAuB;AAEhD,SACE,mDAAC,4BAAD;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY,8BAAa;AAAA,IACzB;AAAA,IACA,eAAY;AAAA,OACR;AAAA,KAEH,YAAY,SAAS,mDAAC,6BAAD,QAAkB,MACxC,mDAAC,qBAAD;AAAA,IAAO,OAAO;AAAA,MACb,YAAY,UAAU,mDAAC,8BAAD,QAAmB;AAAA;AAKhD,gBAAgB,YAAY;AAE5B,MAAM,4BAA4B,gCAAS;AAC3C,0BAA0B,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
9
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
10
|
+
for (let key of __getOwnPropNames(module2))
|
|
11
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
12
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
13
|
+
}
|
|
14
|
+
return target;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (module2, isNodeMode) => {
|
|
17
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
20
|
+
return (module2, temp) => {
|
|
21
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
22
|
+
};
|
|
23
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
24
|
+
var src_exports = {};
|
|
25
|
+
var React = __toESM(require("react"));
|
|
26
|
+
__reExport(src_exports, require("./Stepper"));
|
|
27
|
+
__reExport(src_exports, require("./StepperButton"));
|
|
28
|
+
module.exports = __toCommonJS(src_exports);
|
|
29
|
+
//# 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';\nexport * from './StepperButton';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA,YAAuB;ADAvB,wBAAc;AACd,wBAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var props_exports = {};
|
|
29
|
+
__export(props_exports, {
|
|
30
|
+
defaultButtonProps: () => defaultButtonProps,
|
|
31
|
+
defaultProps: () => defaultProps,
|
|
32
|
+
dsStepperButtonProps: () => dsStepperButtonProps,
|
|
33
|
+
dsStepperProps: () => dsStepperProps
|
|
34
|
+
});
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_lodash = require("lodash");
|
|
37
|
+
var import_react_desc = require("react-desc");
|
|
38
|
+
var import_ds_props_helpers = require("@elliemae/ds-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
|
+
steps: import_react_desc.PropTypes.number.description("Number of steps").isRequired,
|
|
54
|
+
current: import_react_desc.PropTypes.number.description("Index of active step"),
|
|
55
|
+
visited: import_react_desc.PropTypes.arrayOf(import_react_desc.PropTypes.number).description("Array of visited steps").isRequired,
|
|
56
|
+
...import_ds_props_helpers.globalAttributesPropTypes
|
|
57
|
+
};
|
|
58
|
+
const defaultButtonProps = {
|
|
59
|
+
chevron: void 0,
|
|
60
|
+
fontSize: BUTTON_SIZES.normal,
|
|
61
|
+
disabled: false,
|
|
62
|
+
onClick: import_lodash.noop
|
|
63
|
+
};
|
|
64
|
+
const dsStepperButtonProps = {
|
|
65
|
+
chevron: import_react_desc.PropTypes.oneOf(["left", "right", null]).description("Chevron icon position, if null/undefined no chevron will be shown").defaultValue(null),
|
|
66
|
+
fontSize: import_react_desc.PropTypes.oneOf(["normal", "large"]).description("Label size, used for marking last step").defaultValue("normal"),
|
|
67
|
+
innerRef: import_react_desc.PropTypes.oneOfType([import_react_desc.PropTypes.object, import_react_desc.PropTypes.func]).description("Inner ref to button component."),
|
|
68
|
+
...import_ds_props_helpers.globalAttributesPropTypes,
|
|
69
|
+
disabled: import_react_desc.PropTypes.bool.description("Adds disabled state."),
|
|
70
|
+
onClick: import_react_desc.PropTypes.func.description("OnClick callback handler.").defaultValue("()=>{}"),
|
|
71
|
+
label: import_react_desc.PropTypes.string.description("Text Label, this only accepts text, no custom JSX").isRequired
|
|
72
|
+
};
|
|
73
|
+
module.exports = __toCommonJS(props_exports);
|
|
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": ["/* eslint-disable @typescript-eslint/no-unsafe-assignment */\nimport { noop } from 'lodash';\nimport { PropTypes } from 'react-desc';\nimport { globalAttributesPropTypes } from '@elliemae/ds-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 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 ...globalAttributesPropTypes,\n};\n\nexport const defaultButtonProps = {\n chevron: undefined,\n fontSize: BUTTON_SIZES.normal,\n disabled: false,\n onClick: noop,\n};\n\nexport const dsStepperButtonProps = {\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 ...globalAttributesPropTypes,\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};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,oBAAqB;AACrB,wBAA0B;AAC1B,8BAA0C;AAE1C,MAAM,eAAe;AAAA,EACnB,QAAQ;AAAA,EACR,OAAO;AAAA;AAKT,MAAM,eAAe;AAAA,EACnB,MAAM;AAAA,EACN,OAAO;AAAA;AA0BF,MAAM,eAAe;AAAA,EAC1B,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AAAA;AAGJ,MAAM,iBAAiB;AAAA,EAC5B,OAAO,4BAAU,OAAO,YAAY,mBAAmB;AAAA,EACvD,SAAS,4BAAU,OAAO,YAAY;AAAA,EACtC,SAAS,4BAAU,QAAQ,4BAAU,QAAQ,YAAY,0BAA0B;AAAA,KAChF;AAAA;AAGE,MAAM,qBAAqB;AAAA,EAChC,SAAS;AAAA,EACT,UAAU,aAAa;AAAA,EACvB,UAAU;AAAA,EACV,SAAS;AAAA;AAGJ,MAAM,uBAAuB;AAAA,EAClC,SAAS,4BAAU,MAAM,CAAC,QAAQ,SAAS,OACxC,YAAY,qEACZ,aAAa;AAAA,EAChB,UAAU,4BAAU,MAAM,CAAC,UAAU,UAClC,YAAY,0CACZ,aAAa;AAAA,EAChB,UAAU,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU,OAAO,YAAY;AAAA,KAC3E;AAAA,EACH,UAAU,4BAAU,KAAK,YAAY;AAAA,EACrC,SAAS,4BAAU,KAAK,YAAY,6BAA6B,aAAa;AAAA,EAC9E,OAAO,4BAAU,OAAO,YAAY,qDAAqD;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var styled_exports = {};
|
|
29
|
+
__export(styled_exports, {
|
|
30
|
+
Label: () => Label,
|
|
31
|
+
Step: () => Step,
|
|
32
|
+
StepperWrapper: () => StepperWrapper,
|
|
33
|
+
StyledButton: () => StyledButton
|
|
34
|
+
});
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
37
|
+
var import_ds_button = require("@elliemae/ds-button");
|
|
38
|
+
var import_ds_truncated_tooltip_text = require("@elliemae/ds-truncated-tooltip-text");
|
|
39
|
+
const StepperWrapper = import_styled_components.default.div`
|
|
40
|
+
display: grid;
|
|
41
|
+
align-items: center;
|
|
42
|
+
grid-template-columns repeat(${(props) => props.steps}, 1fr);
|
|
43
|
+
column-gap: ${(props) => props.steps >= 8 ? props.theme.space.xxxs : props.theme.space.xxs};
|
|
44
|
+
`;
|
|
45
|
+
const Step = import_styled_components.default.div`
|
|
46
|
+
display: grid;
|
|
47
|
+
border-radius: 1px;
|
|
48
|
+
height: ${(props) => props.active ? "5px" : "3px"};
|
|
49
|
+
background: ${(props) => props.active || props.visited ? props.theme.colors.brand[700] : "#A9B1BE"};
|
|
50
|
+
`;
|
|
51
|
+
const Label = (0, import_styled_components.default)(import_ds_truncated_tooltip_text.SimpleTruncatedTooltipText)`
|
|
52
|
+
position: relative;
|
|
53
|
+
top: 1px;
|
|
54
|
+
`;
|
|
55
|
+
const StyledButton = (0, import_styled_components.default)(import_ds_button.DSButtonV2)`
|
|
56
|
+
white-space: nowrap;
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
max-width: 100%;
|
|
59
|
+
padding-left: ${(props) => props.theme.space.xxs};
|
|
60
|
+
padding-right: ${(props) => props.theme.space.xxs};
|
|
61
|
+
color: ${(props) => props.theme.colors.brand[600]};
|
|
62
|
+
& > span:not(.em-ds-icon) {
|
|
63
|
+
position: relative;
|
|
64
|
+
top: ${(props) => props.fontSize === "large" ? "2px" : "1px"};
|
|
65
|
+
font-size: ${(props) => props.fontSize === "large" ? "22px" : "18px"};
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
68
|
+
module.exports = __toCommonJS(styled_exports);
|
|
69
|
+
//# 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 'styled-components';\nimport { DSButtonV2 } from '@elliemae/ds-button';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { DSStepperInternalsT } from './props';\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;ACAA,YAAuB;ADAvB,+BAAmB;AACnB,uBAA2B;AAC3B,uCAA2C;AAGpC,MAAM,iBAAiB,iCAAO;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,iCAAO;AAAA;AAAA;AAAA,YAGf,CAAC,UAAW,MAAM,SAAS,QAAQ;AAAA,gBAC/B,CAAC,UAAW,MAAM,UAAU,MAAM,UAAU,MAAM,MAAM,OAAO,MAAM,OAAO;AAAA;AAGrF,MAAM,QAAQ,sCAAO;AAAA;AAAA;AAAA;AAKrB,MAAM,eAAe,sCAAO;AAAA;AAAA;AAAA;AAAA,kBAIjB,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA,mBAC5B,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA,WACrC,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA,WAGpC,CAAC,UAAoD,MAAM,aAAa,UAAU,QAAQ;AAAA,iBACpF,CAAC,UAAoD,MAAM,aAAa,UAAU,SAAS;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { uid } from "uid";
|
|
4
|
+
import { describe } from "react-desc";
|
|
5
|
+
import {
|
|
6
|
+
useMemoMergePropsWithDefault,
|
|
7
|
+
useValidateTypescriptPropTypes,
|
|
8
|
+
useGetGlobalAttributes
|
|
9
|
+
} from "@elliemae/ds-props-helpers";
|
|
10
|
+
import { dsStepperProps, defaultProps } from "./props";
|
|
11
|
+
import { Step, StepperWrapper } from "./styled";
|
|
12
|
+
const DSStepper = (props) => {
|
|
13
|
+
const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultProps);
|
|
14
|
+
useValidateTypescriptPropTypes(propsWithDefaults, dsStepperProps);
|
|
15
|
+
const { steps, current, visited } = propsWithDefaults;
|
|
16
|
+
const stepsArray = React2.useMemo(() => new Array(steps).fill(1), [steps]);
|
|
17
|
+
const globalAttributes = useGetGlobalAttributes(propsWithDefaults);
|
|
18
|
+
return /* @__PURE__ */ React2.createElement(StepperWrapper, {
|
|
19
|
+
steps,
|
|
20
|
+
current,
|
|
21
|
+
visited,
|
|
22
|
+
...globalAttributes
|
|
23
|
+
}, stepsArray.map((item, index) => /* @__PURE__ */ React2.createElement(Step, {
|
|
24
|
+
key: `${uid(4)}step-key-${index}`,
|
|
25
|
+
active: current === index,
|
|
26
|
+
visited: visited.includes(index),
|
|
27
|
+
"data-testid": props["data-testid"] ? `${props["data-testid"]}-step` : void 0,
|
|
28
|
+
"data-active": current === index,
|
|
29
|
+
"data-visited": visited.includes(index)
|
|
30
|
+
})));
|
|
31
|
+
};
|
|
32
|
+
DSStepper.propTypes = dsStepperProps;
|
|
33
|
+
const StepperWithSchema = describe(DSStepper);
|
|
34
|
+
StepperWithSchema.propTypes = dsStepperProps;
|
|
35
|
+
export {
|
|
36
|
+
DSStepper,
|
|
37
|
+
StepperWithSchema
|
|
38
|
+
};
|
|
39
|
+
//# 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 { describe } from 'react-desc';\nimport {\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n} from '@elliemae/ds-props-helpers';\nimport { dsStepperProps, defaultProps, DSStepperInternalsT } from './props';\nimport { Step, StepperWrapper } from './styled';\n\nconst DSStepper = (props: DSStepperInternalsT.StepperPropsT) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultProps) as DSStepperInternalsT.StepperPropsT;\n useValidateTypescriptPropTypes(propsWithDefaults, dsStepperProps);\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;\n\nconst StepperWithSchema = describe(DSStepper);\nStepperWithSchema.propTypes = dsStepperProps;\n\nexport { DSStepper, StepperWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAKA;AACA;AAEA,MAAM,YAAY,CAAC,UAA6C;AAC9D,QAAM,oBAAoB,6BAA6B,OAAO;AAC9D,iCAA+B,mBAAmB;AAElD,QAAM,EAAE,OAAO,SAAS,YAAY;AACpC,QAAM,aAAa,OAAM,QAAQ,MAAM,IAAI,MAAM,OAAO,KAAK,IAAgB,CAAC;AAC9E,QAAM,mBAAmB,uBAAuB;AAEhD,SACE,qCAAC,gBAAD;AAAA,IAAgB;AAAA,IAAc;AAAA,IAAkB;AAAA,OAAsB;AAAA,KACnE,WAAW,IAAI,CAAC,MAAM,UACrB,qCAAC,MAAD;AAAA,IAEE,KAAK,GAAG,IAAI,cAAc;AAAA,IAC1B,QAAQ,YAAY;AAAA,IACpB,SAAS,QAAQ,SAAS;AAAA,IAC1B,eAAa,MAAM,iBAAiB,GAAG,MAAM,wBAAkC;AAAA,IAC/E,eAAa,YAAY;AAAA,IACzB,gBAAc,QAAQ,SAAS;AAAA;AAAA;AAOzC,UAAU,YAAY;AAEtB,MAAM,oBAAoB,SAAS;AACnC,kBAAkB,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { describe } from "react-desc";
|
|
4
|
+
import {
|
|
5
|
+
useMemoMergePropsWithDefault,
|
|
6
|
+
useValidateTypescriptPropTypes,
|
|
7
|
+
useGetGlobalAttributes
|
|
8
|
+
} from "@elliemae/ds-props-helpers";
|
|
9
|
+
import { BUTTON_TYPES } from "@elliemae/ds-button";
|
|
10
|
+
import { ChevronLeft, ChevronRight } from "@elliemae/ds-icons";
|
|
11
|
+
import { dsStepperButtonProps, defaultButtonProps } from "./props";
|
|
12
|
+
import { StyledButton, Label } from "./styled";
|
|
13
|
+
const DSStepperButton = (props) => {
|
|
14
|
+
const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultButtonProps);
|
|
15
|
+
useValidateTypescriptPropTypes(propsWithDefaults, dsStepperButtonProps);
|
|
16
|
+
const { chevron, fontSize, label, disabled, onClick, innerRef } = propsWithDefaults;
|
|
17
|
+
const globalAttributes = useGetGlobalAttributes(propsWithDefaults);
|
|
18
|
+
return /* @__PURE__ */ React2.createElement(StyledButton, {
|
|
19
|
+
disabled,
|
|
20
|
+
onClick,
|
|
21
|
+
innerRef,
|
|
22
|
+
buttonType: BUTTON_TYPES.TEXT,
|
|
23
|
+
fontSize,
|
|
24
|
+
"data-testid": "ds-stepper-btn",
|
|
25
|
+
...globalAttributes
|
|
26
|
+
}, chevron === "left" ? /* @__PURE__ */ React2.createElement(ChevronLeft, null) : null, /* @__PURE__ */ React2.createElement(Label, {
|
|
27
|
+
value: label
|
|
28
|
+
}), chevron === "right" ? /* @__PURE__ */ React2.createElement(ChevronRight, null) : null);
|
|
29
|
+
};
|
|
30
|
+
DSStepperButton.propTypes = dsStepperButtonProps;
|
|
31
|
+
const DSStepperButtonWithSchema = describe(DSStepperButton);
|
|
32
|
+
DSStepperButtonWithSchema.propTypes = dsStepperButtonProps;
|
|
33
|
+
export {
|
|
34
|
+
DSStepperButton,
|
|
35
|
+
DSStepperButtonWithSchema
|
|
36
|
+
};
|
|
37
|
+
//# 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 { describe } from 'react-desc';\nimport {\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n} from '@elliemae/ds-props-helpers';\nimport { BUTTON_TYPES } from '@elliemae/ds-button';\nimport { ChevronLeft, ChevronRight } from '@elliemae/ds-icons';\nimport { dsStepperButtonProps, defaultButtonProps, DSStepperInternalsT } from './props';\nimport { StyledButton, Label } from './styled';\n\nconst DSStepperButton = (props: DSStepperInternalsT.StepperButtonPropsT) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(\n props,\n defaultButtonProps,\n ) as DSStepperInternalsT.StepperButtonPropsT;\n useValidateTypescriptPropTypes(propsWithDefaults, dsStepperButtonProps);\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;\n\nconst DSStepperButtonWithSchema = describe(DSStepperButton);\nDSStepperButtonWithSchema.propTypes = dsStepperButtonProps;\n\nexport { DSStepperButton, DSStepperButtonWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAKA;AACA;AACA;AACA;AAEA,MAAM,kBAAkB,CAAC,UAAmD;AAC1E,QAAM,oBAAoB,6BACxB,OACA;AAEF,iCAA+B,mBAAmB;AAElD,QAAM,EAAE,SAAS,UAAU,OAAO,UAAU,SAAS,aAAa;AAClE,QAAM,mBAAmB,uBAAuB;AAEhD,SACE,qCAAC,cAAD;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY,aAAa;AAAA,IACzB;AAAA,IACA,eAAY;AAAA,OACR;AAAA,KAEH,YAAY,SAAS,qCAAC,aAAD,QAAkB,MACxC,qCAAC,OAAD;AAAA,IAAO,OAAO;AAAA,MACb,YAAY,UAAU,qCAAC,cAAD,QAAmB;AAAA;AAKhD,gBAAgB,YAAY;AAE5B,MAAM,4BAA4B,SAAS;AAC3C,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';\nexport * from './StepperButton';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { noop } from "lodash";
|
|
3
|
+
import { PropTypes } from "react-desc";
|
|
4
|
+
import { globalAttributesPropTypes } from "@elliemae/ds-props-helpers";
|
|
5
|
+
const BUTTON_SIZES = {
|
|
6
|
+
normal: "normal",
|
|
7
|
+
large: "large"
|
|
8
|
+
};
|
|
9
|
+
const CHEVRON_TYPE = {
|
|
10
|
+
left: "left",
|
|
11
|
+
right: "right"
|
|
12
|
+
};
|
|
13
|
+
const defaultProps = {
|
|
14
|
+
steps: 5,
|
|
15
|
+
current: void 0,
|
|
16
|
+
visited: []
|
|
17
|
+
};
|
|
18
|
+
const dsStepperProps = {
|
|
19
|
+
steps: PropTypes.number.description("Number of steps").isRequired,
|
|
20
|
+
current: PropTypes.number.description("Index of active step"),
|
|
21
|
+
visited: PropTypes.arrayOf(PropTypes.number).description("Array of visited steps").isRequired,
|
|
22
|
+
...globalAttributesPropTypes
|
|
23
|
+
};
|
|
24
|
+
const defaultButtonProps = {
|
|
25
|
+
chevron: void 0,
|
|
26
|
+
fontSize: BUTTON_SIZES.normal,
|
|
27
|
+
disabled: false,
|
|
28
|
+
onClick: noop
|
|
29
|
+
};
|
|
30
|
+
const dsStepperButtonProps = {
|
|
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
|
+
...globalAttributesPropTypes,
|
|
35
|
+
disabled: PropTypes.bool.description("Adds disabled state."),
|
|
36
|
+
onClick: PropTypes.func.description("OnClick callback handler.").defaultValue("()=>{}"),
|
|
37
|
+
label: PropTypes.string.description("Text Label, this only accepts text, no custom JSX").isRequired
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
defaultButtonProps,
|
|
41
|
+
defaultProps,
|
|
42
|
+
dsStepperButtonProps,
|
|
43
|
+
dsStepperProps
|
|
44
|
+
};
|
|
45
|
+
//# 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", "/* eslint-disable @typescript-eslint/no-unsafe-assignment */\nimport { noop } from 'lodash';\nimport { PropTypes } from 'react-desc';\nimport { globalAttributesPropTypes } from '@elliemae/ds-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 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 ...globalAttributesPropTypes,\n};\n\nexport const defaultButtonProps = {\n chevron: undefined,\n fontSize: BUTTON_SIZES.normal,\n disabled: false,\n onClick: noop,\n};\n\nexport const dsStepperButtonProps = {\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 ...globalAttributesPropTypes,\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};\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AAEA,MAAM,eAAe;AAAA,EACnB,QAAQ;AAAA,EACR,OAAO;AAAA;AAKT,MAAM,eAAe;AAAA,EACnB,MAAM;AAAA,EACN,OAAO;AAAA;AA0BF,MAAM,eAAe;AAAA,EAC1B,OAAO;AAAA,EACP,SAAS;AAAA,EACT,SAAS;AAAA;AAGJ,MAAM,iBAAiB;AAAA,EAC5B,OAAO,UAAU,OAAO,YAAY,mBAAmB;AAAA,EACvD,SAAS,UAAU,OAAO,YAAY;AAAA,EACtC,SAAS,UAAU,QAAQ,UAAU,QAAQ,YAAY,0BAA0B;AAAA,KAChF;AAAA;AAGE,MAAM,qBAAqB;AAAA,EAChC,SAAS;AAAA,EACT,UAAU,aAAa;AAAA,EACvB,UAAU;AAAA,EACV,SAAS;AAAA;AAGJ,MAAM,uBAAuB;AAAA,EAClC,SAAS,UAAU,MAAM,CAAC,QAAQ,SAAS,OACxC,YAAY,qEACZ,aAAa;AAAA,EAChB,UAAU,UAAU,MAAM,CAAC,UAAU,UAClC,YAAY,0CACZ,aAAa;AAAA,EAChB,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,OAAO,YAAY;AAAA,KAC3E;AAAA,EACH,UAAU,UAAU,KAAK,YAAY;AAAA,EACrC,SAAS,UAAU,KAAK,YAAY,6BAA6B,aAAa;AAAA,EAC9E,OAAO,UAAU,OAAO,YAAY,qDAAqD;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { DSButtonV2 } from "@elliemae/ds-button";
|
|
4
|
+
import { SimpleTruncatedTooltipText } from "@elliemae/ds-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 'styled-components';\nimport { DSButtonV2 } from '@elliemae/ds-button';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { DSStepperInternalsT } from './props';\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;ACAA;AACA;AACA;AAGO,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,OAAO;AAAA;AAGrF,MAAM,QAAQ,OAAO;AAAA;AAAA;AAAA;AAKrB,MAAM,eAAe,OAAO;AAAA;AAAA;AAAA;AAAA,kBAIjB,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA,mBAC5B,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA,WACrC,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA,WAGpC,CAAC,UAAoD,MAAM,aAAa,UAAU,QAAQ;AAAA,iBACpF,CAAC,UAAoD,MAAM,aAAa,UAAU,SAAS;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -28,7 +28,7 @@ export declare const Label: import("styled-components").StyledComponent<{
|
|
|
28
28
|
};
|
|
29
29
|
}, import("styled-components").DefaultTheme, {}, never>;
|
|
30
30
|
export declare const StyledButton: import("styled-components").StyledComponent<{
|
|
31
|
-
(props: import("@elliemae/ds-button/types/v2/propTypes").DSButtonPropsT): JSX.Element;
|
|
31
|
+
(props: import("@elliemae/ds-button/dist/types/v2/propTypes").DSButtonPropsT): JSX.Element;
|
|
32
32
|
propTypes: import("react").WeakValidationMap<unknown>;
|
|
33
33
|
}, import("styled-components").DefaultTheme, DSStepperInternalsT.StepperButtonPropsT, never>;
|
|
34
34
|
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-stepper",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-alpha.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Stepper",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"module": "./dist/esm/index.js",
|
|
10
|
+
"main": "./dist/cjs/index.js",
|
|
11
|
+
"types": "./dist/types/index.d.ts",
|
|
9
12
|
"exports": {
|
|
10
13
|
".": {
|
|
11
|
-
"import": "./esm/index.js",
|
|
12
|
-
"require": "./cjs/index.js"
|
|
14
|
+
"import": "./dist/esm/index.js",
|
|
15
|
+
"require": "./dist/cjs/index.js"
|
|
13
16
|
},
|
|
14
17
|
"./styled": {
|
|
15
|
-
"import": "./esm/styled.js",
|
|
16
|
-
"require": "./cjs/styled.js"
|
|
18
|
+
"import": "./dist/esm/styled.js",
|
|
19
|
+
"require": "./dist/cjs/styled.js"
|
|
17
20
|
},
|
|
18
21
|
"./StepperButton": {
|
|
19
|
-
"import": "./esm/StepperButton.js",
|
|
20
|
-
"require": "./cjs/StepperButton.js"
|
|
22
|
+
"import": "./dist/esm/StepperButton.js",
|
|
23
|
+
"require": "./dist/cjs/StepperButton.js"
|
|
21
24
|
},
|
|
22
25
|
"./Stepper": {
|
|
23
|
-
"import": "./esm/Stepper.js",
|
|
24
|
-
"require": "./cjs/Stepper.js"
|
|
26
|
+
"import": "./dist/esm/Stepper.js",
|
|
27
|
+
"require": "./dist/cjs/Stepper.js"
|
|
25
28
|
},
|
|
26
29
|
"./props": {
|
|
27
|
-
"import": "./esm/props.js",
|
|
28
|
-
"require": "./cjs/props.js"
|
|
30
|
+
"import": "./dist/esm/props.js",
|
|
31
|
+
"require": "./dist/cjs/props.js"
|
|
29
32
|
}
|
|
30
33
|
},
|
|
31
34
|
"sideEffects": [
|
|
@@ -37,21 +40,21 @@
|
|
|
37
40
|
"url": "https://git.elliemae.io/platform-ui/dimsum.git"
|
|
38
41
|
},
|
|
39
42
|
"engines": {
|
|
40
|
-
"
|
|
41
|
-
"node": ">=
|
|
43
|
+
"pnpm": ">=6",
|
|
44
|
+
"node": ">=16"
|
|
42
45
|
},
|
|
43
46
|
"author": "ICE MT",
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
47
|
+
"jestSonar": {
|
|
48
|
+
"sonar56x": true,
|
|
49
|
+
"reportPath": "reports",
|
|
50
|
+
"reportFile": "tests.xml",
|
|
51
|
+
"indent": 4
|
|
49
52
|
},
|
|
50
53
|
"dependencies": {
|
|
51
|
-
"@elliemae/ds-button": "
|
|
52
|
-
"@elliemae/ds-icons": "
|
|
53
|
-
"@elliemae/ds-props-helpers": "
|
|
54
|
-
"@elliemae/ds-truncated-tooltip-text": "
|
|
54
|
+
"@elliemae/ds-button": "3.0.0-alpha.0",
|
|
55
|
+
"@elliemae/ds-icons": "3.0.0-alpha.0",
|
|
56
|
+
"@elliemae/ds-props-helpers": "3.0.0-alpha.0",
|
|
57
|
+
"@elliemae/ds-truncated-tooltip-text": "3.0.0-alpha.0",
|
|
55
58
|
"react-desc": "~4.1.3",
|
|
56
59
|
"uid": "~2.0.0"
|
|
57
60
|
},
|
|
@@ -67,7 +70,12 @@
|
|
|
67
70
|
},
|
|
68
71
|
"publishConfig": {
|
|
69
72
|
"access": "public",
|
|
70
|
-
"
|
|
71
|
-
|
|
73
|
+
"typeSafety": false
|
|
74
|
+
},
|
|
75
|
+
"scripts": {
|
|
76
|
+
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
|
77
|
+
"test": "node ../../scripts/testing/test.mjs",
|
|
78
|
+
"lint": "node ../../scripts/lint.mjs",
|
|
79
|
+
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
|
|
72
80
|
}
|
|
73
81
|
}
|
package/cjs/Stepper.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
-
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
7
|
-
require('core-js/modules/esnext.async-iterator.map.js');
|
|
8
|
-
require('core-js/modules/esnext.iterator.map.js');
|
|
9
|
-
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
10
|
-
require('core-js/modules/esnext.iterator.constructor.js');
|
|
11
|
-
require('core-js/modules/esnext.iterator.filter.js');
|
|
12
|
-
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
13
|
-
require('core-js/modules/esnext.iterator.for-each.js');
|
|
14
|
-
var React = require('react');
|
|
15
|
-
var uid = require('uid');
|
|
16
|
-
var reactDesc = require('react-desc');
|
|
17
|
-
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
18
|
-
var props = require('./props.js');
|
|
19
|
-
var styled = require('./styled.js');
|
|
20
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
21
|
-
|
|
22
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
23
|
-
|
|
24
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
25
|
-
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
26
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
27
|
-
|
|
28
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
29
|
-
|
|
30
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
31
|
-
|
|
32
|
-
const DSStepper = props$1 => {
|
|
33
|
-
const propsWithDefaults = dsPropsHelpers.useMemoMergePropsWithDefault(props$1, props.defaultProps);
|
|
34
|
-
dsPropsHelpers.useValidateTypescriptPropTypes(propsWithDefaults, props.dsStepperProps);
|
|
35
|
-
const {
|
|
36
|
-
steps,
|
|
37
|
-
current,
|
|
38
|
-
visited
|
|
39
|
-
} = propsWithDefaults;
|
|
40
|
-
const stepsArray = React__default["default"].useMemo(() => new Array(steps).fill(1), [steps]);
|
|
41
|
-
const globalAttributes = dsPropsHelpers.useGetGlobalAttributes(propsWithDefaults);
|
|
42
|
-
return /*#__PURE__*/jsxRuntime.jsx(styled.StepperWrapper, _objectSpread(_objectSpread({
|
|
43
|
-
steps: steps,
|
|
44
|
-
current: current,
|
|
45
|
-
visited: visited
|
|
46
|
-
}, globalAttributes), {}, {
|
|
47
|
-
children: stepsArray.map((item, index) => /*#__PURE__*/_jsx__default["default"](styled.Step // eslint-disable-next-line react/no-array-index-key
|
|
48
|
-
, {
|
|
49
|
-
active: current === index,
|
|
50
|
-
visited: visited.includes(index),
|
|
51
|
-
"data-testid": props$1['data-testid'] ? "".concat(props$1['data-testid'], "-step") : undefined,
|
|
52
|
-
"data-active": current === index,
|
|
53
|
-
"data-visited": visited.includes(index)
|
|
54
|
-
}, "".concat(uid.uid(4), "step-key-").concat(index)))
|
|
55
|
-
}));
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const StepperWithSchema = reactDesc.describe(DSStepper);
|
|
59
|
-
StepperWithSchema.propTypes = props.dsStepperProps;
|
|
60
|
-
|
|
61
|
-
exports.DSStepper = DSStepper;
|
|
62
|
-
exports.StepperWithSchema = StepperWithSchema;
|
package/cjs/StepperButton.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
-
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
-
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
-
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
-
require('core-js/modules/esnext.iterator.for-each.js');
|
|
10
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
11
|
-
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
12
|
-
require('react');
|
|
13
|
-
var reactDesc = require('react-desc');
|
|
14
|
-
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
15
|
-
var dsButton = require('@elliemae/ds-button');
|
|
16
|
-
var dsIcons = require('@elliemae/ds-icons');
|
|
17
|
-
var props = require('./props.js');
|
|
18
|
-
var styled = require('./styled.js');
|
|
19
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
20
|
-
|
|
21
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
22
|
-
|
|
23
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
24
|
-
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
25
|
-
|
|
26
|
-
var _ChevronLeft, _ChevronRight;
|
|
27
|
-
|
|
28
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
29
|
-
|
|
30
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
31
|
-
|
|
32
|
-
const DSStepperButton = props$1 => {
|
|
33
|
-
const propsWithDefaults = dsPropsHelpers.useMemoMergePropsWithDefault(props$1, props.defaultButtonProps);
|
|
34
|
-
dsPropsHelpers.useValidateTypescriptPropTypes(propsWithDefaults, props.dsStepperButtonProps);
|
|
35
|
-
const {
|
|
36
|
-
chevron,
|
|
37
|
-
fontSize,
|
|
38
|
-
label,
|
|
39
|
-
disabled,
|
|
40
|
-
onClick,
|
|
41
|
-
innerRef
|
|
42
|
-
} = propsWithDefaults;
|
|
43
|
-
const globalAttributes = dsPropsHelpers.useGetGlobalAttributes(propsWithDefaults);
|
|
44
|
-
return /*#__PURE__*/jsxRuntime.jsxs(styled.StyledButton, _objectSpread(_objectSpread({
|
|
45
|
-
disabled: disabled,
|
|
46
|
-
onClick: onClick,
|
|
47
|
-
innerRef: innerRef,
|
|
48
|
-
buttonType: dsButton.BUTTON_TYPES.TEXT,
|
|
49
|
-
fontSize: fontSize,
|
|
50
|
-
"data-testid": "ds-stepper-btn"
|
|
51
|
-
}, globalAttributes), {}, {
|
|
52
|
-
children: [chevron === 'left' ? _ChevronLeft || (_ChevronLeft = /*#__PURE__*/_jsx__default["default"](dsIcons.ChevronLeft, {})) : null, /*#__PURE__*/_jsx__default["default"](styled.Label, {
|
|
53
|
-
value: label
|
|
54
|
-
}), chevron === 'right' ? _ChevronRight || (_ChevronRight = /*#__PURE__*/_jsx__default["default"](dsIcons.ChevronRight, {})) : null]
|
|
55
|
-
}));
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const DSStepperButtonWithSchema = reactDesc.describe(DSStepperButton);
|
|
59
|
-
DSStepperButtonWithSchema.propTypes = props.dsStepperButtonProps;
|
|
60
|
-
|
|
61
|
-
exports.DSStepperButton = DSStepperButton;
|
|
62
|
-
exports.DSStepperButtonWithSchema = DSStepperButtonWithSchema;
|
package/cjs/index.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var Stepper = require('./Stepper.js');
|
|
6
|
-
var StepperButton = require('./StepperButton.js');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
exports.DSStepper = Stepper.DSStepper;
|
|
11
|
-
exports.StepperWithSchema = Stepper.StepperWithSchema;
|
|
12
|
-
exports.DSStepperButton = StepperButton.DSStepperButton;
|
|
13
|
-
exports.DSStepperButtonWithSchema = StepperButton.DSStepperButtonWithSchema;
|
package/cjs/props.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
-
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
-
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
-
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
-
require('core-js/modules/esnext.iterator.for-each.js');
|
|
10
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
11
|
-
var lodash = require('lodash');
|
|
12
|
-
var reactDesc = require('react-desc');
|
|
13
|
-
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
14
|
-
|
|
15
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
|
-
|
|
17
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
18
|
-
|
|
19
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20
|
-
|
|
21
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
22
|
-
const BUTTON_SIZES = {
|
|
23
|
-
normal: 'normal',
|
|
24
|
-
large: 'large'
|
|
25
|
-
};
|
|
26
|
-
const defaultProps = {
|
|
27
|
-
steps: 5,
|
|
28
|
-
current: undefined,
|
|
29
|
-
visited: []
|
|
30
|
-
};
|
|
31
|
-
const dsStepperProps = _objectSpread({
|
|
32
|
-
steps: reactDesc.PropTypes.number.description('Number of steps').isRequired,
|
|
33
|
-
current: reactDesc.PropTypes.number.description('Index of active step'),
|
|
34
|
-
visited: reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.number).description('Array of visited steps').isRequired
|
|
35
|
-
}, dsPropsHelpers.globalAttributesPropTypes);
|
|
36
|
-
const defaultButtonProps = {
|
|
37
|
-
chevron: undefined,
|
|
38
|
-
fontSize: BUTTON_SIZES.normal,
|
|
39
|
-
disabled: false,
|
|
40
|
-
onClick: lodash.noop
|
|
41
|
-
};
|
|
42
|
-
const dsStepperButtonProps = _objectSpread(_objectSpread({
|
|
43
|
-
chevron: reactDesc.PropTypes.oneOf(['left', 'right', null]).description('Chevron icon position, if null/undefined no chevron will be shown').defaultValue(null),
|
|
44
|
-
fontSize: reactDesc.PropTypes.oneOf(['normal', 'large']).description('Label size, used for marking last step').defaultValue('normal'),
|
|
45
|
-
innerRef: reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.object, reactDesc.PropTypes.func]).description('Inner ref to button component.')
|
|
46
|
-
}, dsPropsHelpers.globalAttributesPropTypes), {}, {
|
|
47
|
-
disabled: reactDesc.PropTypes.bool.description('Adds disabled state.'),
|
|
48
|
-
onClick: reactDesc.PropTypes.func.description('OnClick callback handler.').defaultValue('()=>{}'),
|
|
49
|
-
label: reactDesc.PropTypes.string.description('Text Label, this only accepts text, no custom JSX').isRequired
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
exports.defaultButtonProps = defaultButtonProps;
|
|
53
|
-
exports.defaultProps = defaultProps;
|
|
54
|
-
exports.dsStepperButtonProps = dsStepperButtonProps;
|
|
55
|
-
exports.dsStepperProps = dsStepperProps;
|
package/cjs/styled.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var styled = require('styled-components');
|
|
6
|
-
var dsButton = require('@elliemae/ds-button');
|
|
7
|
-
var dsTruncatedTooltipText = require('@elliemae/ds-truncated-tooltip-text');
|
|
8
|
-
|
|
9
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
-
|
|
11
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
12
|
-
|
|
13
|
-
const StepperWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
14
|
-
componentId: "sc-fgtqnq-0"
|
|
15
|
-
})(["display:grid;align-items:center;grid-template-columns repeat(", ",1fr);column-gap:", ";"], props => props.steps, props => props.steps >= 8 ? props.theme.space.xxxs : props.theme.space.xxs);
|
|
16
|
-
const Step = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
17
|
-
componentId: "sc-fgtqnq-1"
|
|
18
|
-
})(["display:grid;border-radius:1px;height:", ";background:", ";"], props => props.active ? '5px' : '3px', props => props.active || props.visited ? props.theme.colors.brand[700] : '#A9B1BE');
|
|
19
|
-
const Label = /*#__PURE__*/styled__default["default"](dsTruncatedTooltipText.SimpleTruncatedTooltipText).withConfig({
|
|
20
|
-
componentId: "sc-fgtqnq-2"
|
|
21
|
-
})(["position:relative;top:1px;"]);
|
|
22
|
-
const StyledButton = /*#__PURE__*/styled__default["default"](dsButton.DSButtonV2).withConfig({
|
|
23
|
-
componentId: "sc-fgtqnq-3"
|
|
24
|
-
})(["white-space:nowrap;overflow:hidden;max-width:100%;padding-left:", ";padding-right:", ";color:", ";& > span:not(.em-ds-icon){position:relative;top:", ";font-size:", ";}"], props => props.theme.space.xxs, props => props.theme.space.xxs, props => props.theme.colors.brand[600], props => props.fontSize === 'large' ? '2px' : '1px', props => props.fontSize === 'large' ? '22px' : '18px');
|
|
25
|
-
|
|
26
|
-
exports.Label = Label;
|
|
27
|
-
exports.Step = Step;
|
|
28
|
-
exports.StepperWrapper = StepperWrapper;
|
|
29
|
-
exports.StyledButton = StyledButton;
|
package/esm/Stepper.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
|
-
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
4
|
-
import 'core-js/modules/esnext.iterator.map.js';
|
|
5
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
6
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
7
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
8
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
9
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
10
|
-
import React from 'react';
|
|
11
|
-
import { uid } from 'uid';
|
|
12
|
-
import { describe } from 'react-desc';
|
|
13
|
-
import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes, useGetGlobalAttributes } from '@elliemae/ds-props-helpers';
|
|
14
|
-
import { dsStepperProps, defaultProps } from './props.js';
|
|
15
|
-
import { StepperWrapper, Step } from './styled.js';
|
|
16
|
-
import { jsx } from 'react/jsx-runtime';
|
|
17
|
-
|
|
18
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
-
|
|
20
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
|
-
|
|
22
|
-
const DSStepper = props => {
|
|
23
|
-
const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultProps);
|
|
24
|
-
useValidateTypescriptPropTypes(propsWithDefaults, dsStepperProps);
|
|
25
|
-
const {
|
|
26
|
-
steps,
|
|
27
|
-
current,
|
|
28
|
-
visited
|
|
29
|
-
} = propsWithDefaults;
|
|
30
|
-
const stepsArray = React.useMemo(() => new Array(steps).fill(1), [steps]);
|
|
31
|
-
const globalAttributes = useGetGlobalAttributes(propsWithDefaults);
|
|
32
|
-
return /*#__PURE__*/jsx(StepperWrapper, _objectSpread(_objectSpread({
|
|
33
|
-
steps: steps,
|
|
34
|
-
current: current,
|
|
35
|
-
visited: visited
|
|
36
|
-
}, globalAttributes), {}, {
|
|
37
|
-
children: stepsArray.map((item, index) => /*#__PURE__*/_jsx(Step // eslint-disable-next-line react/no-array-index-key
|
|
38
|
-
, {
|
|
39
|
-
active: current === index,
|
|
40
|
-
visited: visited.includes(index),
|
|
41
|
-
"data-testid": props['data-testid'] ? "".concat(props['data-testid'], "-step") : undefined,
|
|
42
|
-
"data-active": current === index,
|
|
43
|
-
"data-visited": visited.includes(index)
|
|
44
|
-
}, "".concat(uid(4), "step-key-").concat(index)))
|
|
45
|
-
}));
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const StepperWithSchema = describe(DSStepper);
|
|
49
|
-
StepperWithSchema.propTypes = dsStepperProps;
|
|
50
|
-
|
|
51
|
-
export { DSStepper, StepperWithSchema };
|
package/esm/StepperButton.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
8
|
-
import 'react';
|
|
9
|
-
import { describe } from 'react-desc';
|
|
10
|
-
import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes, useGetGlobalAttributes } from '@elliemae/ds-props-helpers';
|
|
11
|
-
import { BUTTON_TYPES } from '@elliemae/ds-button';
|
|
12
|
-
import { ChevronLeft, ChevronRight } from '@elliemae/ds-icons';
|
|
13
|
-
import { dsStepperButtonProps, defaultButtonProps } from './props.js';
|
|
14
|
-
import { StyledButton, Label } from './styled.js';
|
|
15
|
-
import { jsxs } from 'react/jsx-runtime';
|
|
16
|
-
|
|
17
|
-
var _ChevronLeft, _ChevronRight;
|
|
18
|
-
|
|
19
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20
|
-
|
|
21
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
22
|
-
|
|
23
|
-
const DSStepperButton = props => {
|
|
24
|
-
const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultButtonProps);
|
|
25
|
-
useValidateTypescriptPropTypes(propsWithDefaults, dsStepperButtonProps);
|
|
26
|
-
const {
|
|
27
|
-
chevron,
|
|
28
|
-
fontSize,
|
|
29
|
-
label,
|
|
30
|
-
disabled,
|
|
31
|
-
onClick,
|
|
32
|
-
innerRef
|
|
33
|
-
} = propsWithDefaults;
|
|
34
|
-
const globalAttributes = useGetGlobalAttributes(propsWithDefaults);
|
|
35
|
-
return /*#__PURE__*/jsxs(StyledButton, _objectSpread(_objectSpread({
|
|
36
|
-
disabled: disabled,
|
|
37
|
-
onClick: onClick,
|
|
38
|
-
innerRef: innerRef,
|
|
39
|
-
buttonType: BUTTON_TYPES.TEXT,
|
|
40
|
-
fontSize: fontSize,
|
|
41
|
-
"data-testid": "ds-stepper-btn"
|
|
42
|
-
}, globalAttributes), {}, {
|
|
43
|
-
children: [chevron === 'left' ? _ChevronLeft || (_ChevronLeft = /*#__PURE__*/_jsx(ChevronLeft, {})) : null, /*#__PURE__*/_jsx(Label, {
|
|
44
|
-
value: label
|
|
45
|
-
}), chevron === 'right' ? _ChevronRight || (_ChevronRight = /*#__PURE__*/_jsx(ChevronRight, {})) : null]
|
|
46
|
-
}));
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const DSStepperButtonWithSchema = describe(DSStepperButton);
|
|
50
|
-
DSStepperButtonWithSchema.propTypes = dsStepperButtonProps;
|
|
51
|
-
|
|
52
|
-
export { DSStepperButton, DSStepperButtonWithSchema };
|
package/esm/index.js
DELETED
package/esm/props.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
-
import { noop } from 'lodash';
|
|
8
|
-
import { PropTypes } from 'react-desc';
|
|
9
|
-
import { globalAttributesPropTypes } from '@elliemae/ds-props-helpers';
|
|
10
|
-
|
|
11
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12
|
-
|
|
13
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
14
|
-
const BUTTON_SIZES = {
|
|
15
|
-
normal: 'normal',
|
|
16
|
-
large: 'large'
|
|
17
|
-
};
|
|
18
|
-
const defaultProps = {
|
|
19
|
-
steps: 5,
|
|
20
|
-
current: undefined,
|
|
21
|
-
visited: []
|
|
22
|
-
};
|
|
23
|
-
const dsStepperProps = _objectSpread({
|
|
24
|
-
steps: PropTypes.number.description('Number of steps').isRequired,
|
|
25
|
-
current: PropTypes.number.description('Index of active step'),
|
|
26
|
-
visited: PropTypes.arrayOf(PropTypes.number).description('Array of visited steps').isRequired
|
|
27
|
-
}, globalAttributesPropTypes);
|
|
28
|
-
const defaultButtonProps = {
|
|
29
|
-
chevron: undefined,
|
|
30
|
-
fontSize: BUTTON_SIZES.normal,
|
|
31
|
-
disabled: false,
|
|
32
|
-
onClick: noop
|
|
33
|
-
};
|
|
34
|
-
const dsStepperButtonProps = _objectSpread(_objectSpread({
|
|
35
|
-
chevron: PropTypes.oneOf(['left', 'right', null]).description('Chevron icon position, if null/undefined no chevron will be shown').defaultValue(null),
|
|
36
|
-
fontSize: PropTypes.oneOf(['normal', 'large']).description('Label size, used for marking last step').defaultValue('normal'),
|
|
37
|
-
innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description('Inner ref to button component.')
|
|
38
|
-
}, globalAttributesPropTypes), {}, {
|
|
39
|
-
disabled: PropTypes.bool.description('Adds disabled state.'),
|
|
40
|
-
onClick: PropTypes.func.description('OnClick callback handler.').defaultValue('()=>{}'),
|
|
41
|
-
label: PropTypes.string.description('Text Label, this only accepts text, no custom JSX').isRequired
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
export { defaultButtonProps, defaultProps, dsStepperButtonProps, dsStepperProps };
|
package/esm/styled.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
import { DSButtonV2 } from '@elliemae/ds-button';
|
|
3
|
-
import { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';
|
|
4
|
-
|
|
5
|
-
const StepperWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
6
|
-
componentId: "sc-fgtqnq-0"
|
|
7
|
-
})(["display:grid;align-items:center;grid-template-columns repeat(", ",1fr);column-gap:", ";"], props => props.steps, props => props.steps >= 8 ? props.theme.space.xxxs : props.theme.space.xxs);
|
|
8
|
-
const Step = /*#__PURE__*/styled.div.withConfig({
|
|
9
|
-
componentId: "sc-fgtqnq-1"
|
|
10
|
-
})(["display:grid;border-radius:1px;height:", ";background:", ";"], props => props.active ? '5px' : '3px', props => props.active || props.visited ? props.theme.colors.brand[700] : '#A9B1BE');
|
|
11
|
-
const Label = /*#__PURE__*/styled(SimpleTruncatedTooltipText).withConfig({
|
|
12
|
-
componentId: "sc-fgtqnq-2"
|
|
13
|
-
})(["position:relative;top:1px;"]);
|
|
14
|
-
const StyledButton = /*#__PURE__*/styled(DSButtonV2).withConfig({
|
|
15
|
-
componentId: "sc-fgtqnq-3"
|
|
16
|
-
})(["white-space:nowrap;overflow:hidden;max-width:100%;padding-left:", ";padding-right:", ";color:", ";& > span:not(.em-ds-icon){position:relative;top:", ";font-size:", ";}"], props => props.theme.space.xxs, props => props.theme.space.xxs, props => props.theme.colors.brand[600], props => props.fontSize === 'large' ? '2px' : '1px', props => props.fontSize === 'large' ? '22px' : '18px');
|
|
17
|
-
|
|
18
|
-
export { Label, Step, StepperWrapper, StyledButton };
|