@elliemae/ds-stepper 3.0.0-next.9 → 3.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Stepper.js +14 -20
- package/dist/cjs/Stepper.js.map +2 -2
- package/dist/cjs/StepperButton.js +14 -20
- package/dist/cjs/StepperButton.js.map +2 -2
- package/dist/cjs/index.js +12 -18
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/props.js +12 -19
- package/dist/cjs/props.js.map +2 -2
- package/dist/cjs/styled.js +9 -16
- package/dist/cjs/styled.js.map +1 -1
- package/dist/esm/Stepper.js +2 -1
- package/dist/esm/Stepper.js.map +2 -2
- package/dist/esm/StepperButton.js +2 -1
- package/dist/esm/StepperButton.js.map +2 -2
- package/dist/esm/props.js +1 -1
- package/dist/esm/props.js.map +2 -2
- package/dist/esm/styled.js.map +1 -1
- package/package.json +13 -13
package/dist/cjs/Stepper.js
CHANGED
|
@@ -18,45 +18,39 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
}
|
|
19
19
|
return a;
|
|
20
20
|
};
|
|
21
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
22
21
|
var __export = (target, all) => {
|
|
23
22
|
for (var name in all)
|
|
24
23
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
25
24
|
};
|
|
26
|
-
var
|
|
27
|
-
if (
|
|
28
|
-
for (let key of __getOwnPropNames(
|
|
29
|
-
if (!__hasOwnProp.call(
|
|
30
|
-
__defProp(
|
|
25
|
+
var __copyProps = (to, from, except, desc) => {
|
|
26
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
27
|
+
for (let key of __getOwnPropNames(from))
|
|
28
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
29
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
31
30
|
}
|
|
32
|
-
return
|
|
31
|
+
return to;
|
|
33
32
|
};
|
|
34
|
-
var __toESM = (
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
38
|
-
return (module2, temp) => {
|
|
39
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
40
|
-
};
|
|
41
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
33
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
34
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
42
35
|
var Stepper_exports = {};
|
|
43
36
|
__export(Stepper_exports, {
|
|
44
37
|
DSStepper: () => DSStepper,
|
|
45
38
|
StepperWithSchema: () => StepperWithSchema
|
|
46
39
|
});
|
|
40
|
+
module.exports = __toCommonJS(Stepper_exports);
|
|
47
41
|
var React = __toESM(require("react"));
|
|
48
42
|
var import_react = __toESM(require("react"));
|
|
49
43
|
var import_uid = require("uid");
|
|
50
44
|
var import_react_desc = require("react-desc");
|
|
51
|
-
var
|
|
45
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
52
46
|
var import_props = require("./props");
|
|
53
47
|
var import_styled = require("./styled");
|
|
54
48
|
const DSStepper = (props) => {
|
|
55
|
-
const propsWithDefaults = (0,
|
|
56
|
-
(0,
|
|
49
|
+
const propsWithDefaults = (0, import_ds_utilities.useMemoMergePropsWithDefault)(props, import_props.defaultProps);
|
|
50
|
+
(0, import_ds_utilities.useValidateTypescriptPropTypes)(propsWithDefaults, import_props.dsStepperProps);
|
|
57
51
|
const { steps, current, visited } = propsWithDefaults;
|
|
58
52
|
const stepsArray = import_react.default.useMemo(() => new Array(steps).fill(1), [steps]);
|
|
59
|
-
const globalAttributes = (0,
|
|
53
|
+
const globalAttributes = (0, import_ds_utilities.useGetGlobalAttributes)(propsWithDefaults);
|
|
60
54
|
return /* @__PURE__ */ import_react.default.createElement(import_styled.StepperWrapper, __spreadValues({
|
|
61
55
|
steps,
|
|
62
56
|
current,
|
|
@@ -71,7 +65,7 @@ const DSStepper = (props) => {
|
|
|
71
65
|
})));
|
|
72
66
|
};
|
|
73
67
|
DSStepper.propTypes = import_props.dsStepperProps;
|
|
68
|
+
DSStepper.displayName = "DSStepper";
|
|
74
69
|
const StepperWithSchema = (0, import_react_desc.describe)(DSStepper);
|
|
75
70
|
StepperWithSchema.propTypes = import_props.dsStepperProps;
|
|
76
|
-
module.exports = __toCommonJS(Stepper_exports);
|
|
77
71
|
//# sourceMappingURL=Stepper.js.map
|
package/dist/cjs/Stepper.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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-
|
|
5
|
-
"mappings": "
|
|
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-utilities';\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;\nDSStepper.displayName = 'DSStepper';\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;ADAvB,mBAAkB;AAClB,iBAAoB;AACpB,wBAAyB;AACzB,0BAIO;AACP,mBAAkE;AAClE,oBAAqC;AAErC,MAAM,YAAY,CAAC,UAA6C;AAC9D,QAAM,oBAAoB,sDAA6B,OAAO,yBAAY;AAC1E,0DAA+B,mBAAmB,2BAAc;AAEhE,QAAM,EAAE,OAAO,SAAS,YAAY;AACpC,QAAM,aAAa,qBAAM,QAAQ,MAAM,IAAI,MAAM,KAAK,EAAE,KAAK,CAAC,GAAe,CAAC,KAAK,CAAC;AACpF,QAAM,mBAAmB,gDAAuB,iBAAiB;AAEjE,SACE,mDAAC;AAAA,IAAe;AAAA,IAAc;AAAA,IAAkB;AAAA,KAAsB,mBACnE,WAAW,IAAI,CAAC,MAAM,UACrB,mDAAC;AAAA,IAEC,KAAK,GAAG,oBAAI,CAAC,aAAa;AAAA,IAC1B,QAAQ,YAAY;AAAA,IACpB,SAAS,QAAQ,SAAS,KAAK;AAAA,IAC/B,eAAa,MAAM,iBAAiB,GAAG,MAAM,wBAAkC;AAAA,IAC/E,eAAa,YAAY;AAAA,IACzB,gBAAc,QAAQ,SAAS,KAAK;AAAA,GACtC,CACD,CACH;AAEJ;AAEA,UAAU,YAAY;AACtB,UAAU,cAAc;AACxB,MAAM,oBAAoB,gCAAS,SAAS;AAC5C,kBAAkB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,45 +18,39 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
}
|
|
19
19
|
return a;
|
|
20
20
|
};
|
|
21
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
22
21
|
var __export = (target, all) => {
|
|
23
22
|
for (var name in all)
|
|
24
23
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
25
24
|
};
|
|
26
|
-
var
|
|
27
|
-
if (
|
|
28
|
-
for (let key of __getOwnPropNames(
|
|
29
|
-
if (!__hasOwnProp.call(
|
|
30
|
-
__defProp(
|
|
25
|
+
var __copyProps = (to, from, except, desc) => {
|
|
26
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
27
|
+
for (let key of __getOwnPropNames(from))
|
|
28
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
29
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
31
30
|
}
|
|
32
|
-
return
|
|
31
|
+
return to;
|
|
33
32
|
};
|
|
34
|
-
var __toESM = (
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
38
|
-
return (module2, temp) => {
|
|
39
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
40
|
-
};
|
|
41
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
33
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
34
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
42
35
|
var StepperButton_exports = {};
|
|
43
36
|
__export(StepperButton_exports, {
|
|
44
37
|
DSStepperButton: () => DSStepperButton,
|
|
45
38
|
DSStepperButtonWithSchema: () => DSStepperButtonWithSchema
|
|
46
39
|
});
|
|
40
|
+
module.exports = __toCommonJS(StepperButton_exports);
|
|
47
41
|
var React = __toESM(require("react"));
|
|
48
42
|
var import_react = __toESM(require("react"));
|
|
49
43
|
var import_react_desc = require("react-desc");
|
|
50
|
-
var
|
|
44
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
51
45
|
var import_ds_button = require("@elliemae/ds-button");
|
|
52
46
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
53
47
|
var import_props = require("./props");
|
|
54
48
|
var import_styled = require("./styled");
|
|
55
49
|
const DSStepperButton = (props) => {
|
|
56
|
-
const propsWithDefaults = (0,
|
|
57
|
-
(0,
|
|
50
|
+
const propsWithDefaults = (0, import_ds_utilities.useMemoMergePropsWithDefault)(props, import_props.defaultButtonProps);
|
|
51
|
+
(0, import_ds_utilities.useValidateTypescriptPropTypes)(propsWithDefaults, import_props.dsStepperButtonProps);
|
|
58
52
|
const { chevron, fontSize, label, disabled, onClick, innerRef } = propsWithDefaults;
|
|
59
|
-
const globalAttributes = (0,
|
|
53
|
+
const globalAttributes = (0, import_ds_utilities.useGetGlobalAttributes)(propsWithDefaults);
|
|
60
54
|
return /* @__PURE__ */ import_react.default.createElement(import_styled.StyledButton, __spreadValues({
|
|
61
55
|
disabled,
|
|
62
56
|
onClick,
|
|
@@ -69,7 +63,7 @@ const DSStepperButton = (props) => {
|
|
|
69
63
|
}), chevron === "right" ? /* @__PURE__ */ import_react.default.createElement(import_ds_icons.ChevronRight, null) : null);
|
|
70
64
|
};
|
|
71
65
|
DSStepperButton.propTypes = import_props.dsStepperButtonProps;
|
|
66
|
+
DSStepperButton.displayName = "DSStepperButton";
|
|
72
67
|
const DSStepperButtonWithSchema = (0, import_react_desc.describe)(DSStepperButton);
|
|
73
68
|
DSStepperButtonWithSchema.propTypes = import_props.dsStepperButtonProps;
|
|
74
|
-
module.exports = __toCommonJS(StepperButton_exports);
|
|
75
69
|
//# sourceMappingURL=StepperButton.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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-
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe } from 'react-desc';\nimport {\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n useGetGlobalAttributes,\n} from '@elliemae/ds-utilities';\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;\nDSStepperButton.displayName = 'DSStepperButton';\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;ADAvB,mBAAkB;AAClB,wBAAyB;AACzB,0BAIO;AACP,uBAA6B;AAC7B,sBAA0C;AAC1C,mBAA8E;AAC9E,oBAAoC;AAEpC,MAAM,kBAAkB,CAAC,UAAmD;AAC1E,QAAM,oBAAoB,sDACxB,OACA,+BACF;AACA,0DAA+B,mBAAmB,iCAAoB;AAEtE,QAAM,EAAE,SAAS,UAAU,OAAO,UAAU,SAAS,aAAa;AAClE,QAAM,mBAAmB,gDAAuB,iBAAiB;AAEjE,SACE,mDAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY,8BAAa;AAAA,IACzB;AAAA,IACA,eAAY;AAAA,KACR,mBAEH,YAAY,SAAS,mDAAC,iCAAY,IAAK,MACxC,mDAAC;AAAA,IAAM,OAAO;AAAA,GAAO,GACpB,YAAY,UAAU,mDAAC,kCAAa,IAAK,IAC5C;AAEJ;AAEA,gBAAgB,YAAY;AAC5B,gBAAgB,cAAc;AAC9B,MAAM,4BAA4B,gCAAS,eAAe;AAC1D,0BAA0B,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -4,26 +4,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from))
|
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
12
|
}
|
|
14
|
-
return
|
|
13
|
+
return to;
|
|
15
14
|
};
|
|
16
|
-
var
|
|
17
|
-
|
|
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);
|
|
15
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
18
|
var src_exports = {};
|
|
25
|
-
var React = __toESM(require("react"));
|
|
26
|
-
__reExport(src_exports, require("./Stepper"));
|
|
27
|
-
__reExport(src_exports, require("./StepperButton"));
|
|
28
19
|
module.exports = __toCommonJS(src_exports);
|
|
20
|
+
var React = __toESM(require("react"));
|
|
21
|
+
__reExport(src_exports, require("./Stepper"), module.exports);
|
|
22
|
+
__reExport(src_exports, require("./StepperButton"), module.exports);
|
|
29
23
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export * from './Stepper';\nexport * from './StepperButton';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc,sBAAd;AACA,wBAAc,4BADd;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/props.js
CHANGED
|
@@ -21,27 +21,20 @@ var __spreadValues = (a, b) => {
|
|
|
21
21
|
return a;
|
|
22
22
|
};
|
|
23
23
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
25
24
|
var __export = (target, all) => {
|
|
26
25
|
for (var name in all)
|
|
27
26
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
28
27
|
};
|
|
29
|
-
var
|
|
30
|
-
if (
|
|
31
|
-
for (let key of __getOwnPropNames(
|
|
32
|
-
if (!__hasOwnProp.call(
|
|
33
|
-
__defProp(
|
|
28
|
+
var __copyProps = (to, from, except, desc) => {
|
|
29
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
30
|
+
for (let key of __getOwnPropNames(from))
|
|
31
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
32
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
34
33
|
}
|
|
35
|
-
return
|
|
34
|
+
return to;
|
|
36
35
|
};
|
|
37
|
-
var __toESM = (
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
41
|
-
return (module2, temp) => {
|
|
42
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
43
|
-
};
|
|
44
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
36
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
37
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
45
38
|
var props_exports = {};
|
|
46
39
|
__export(props_exports, {
|
|
47
40
|
defaultButtonProps: () => defaultButtonProps,
|
|
@@ -49,10 +42,11 @@ __export(props_exports, {
|
|
|
49
42
|
dsStepperButtonProps: () => dsStepperButtonProps,
|
|
50
43
|
dsStepperProps: () => dsStepperProps
|
|
51
44
|
});
|
|
45
|
+
module.exports = __toCommonJS(props_exports);
|
|
52
46
|
var React = __toESM(require("react"));
|
|
53
47
|
var import_lodash = require("lodash");
|
|
54
48
|
var import_react_desc = require("react-desc");
|
|
55
|
-
var
|
|
49
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
56
50
|
const BUTTON_SIZES = {
|
|
57
51
|
normal: "normal",
|
|
58
52
|
large: "large"
|
|
@@ -70,7 +64,7 @@ const dsStepperProps = __spreadValues({
|
|
|
70
64
|
steps: import_react_desc.PropTypes.number.description("Number of steps").isRequired,
|
|
71
65
|
current: import_react_desc.PropTypes.number.description("Index of active step"),
|
|
72
66
|
visited: import_react_desc.PropTypes.arrayOf(import_react_desc.PropTypes.number).description("Array of visited steps").isRequired
|
|
73
|
-
},
|
|
67
|
+
}, import_ds_utilities.globalAttributesPropTypes);
|
|
74
68
|
const defaultButtonProps = {
|
|
75
69
|
chevron: void 0,
|
|
76
70
|
fontSize: BUTTON_SIZES.normal,
|
|
@@ -81,10 +75,9 @@ const dsStepperButtonProps = __spreadProps(__spreadValues({
|
|
|
81
75
|
chevron: import_react_desc.PropTypes.oneOf(["left", "right", null]).description("Chevron icon position, if null/undefined no chevron will be shown").defaultValue(null),
|
|
82
76
|
fontSize: import_react_desc.PropTypes.oneOf(["normal", "large"]).description("Label size, used for marking last step").defaultValue("normal"),
|
|
83
77
|
innerRef: import_react_desc.PropTypes.oneOfType([import_react_desc.PropTypes.object, import_react_desc.PropTypes.func]).description("Inner ref to button component.")
|
|
84
|
-
},
|
|
78
|
+
}, import_ds_utilities.globalAttributesPropTypes), {
|
|
85
79
|
disabled: import_react_desc.PropTypes.bool.description("Adds disabled state."),
|
|
86
80
|
onClick: import_react_desc.PropTypes.func.description("OnClick callback handler.").defaultValue("()=>{}"),
|
|
87
81
|
label: import_react_desc.PropTypes.string.description("Text Label, this only accepts text, no custom JSX").isRequired
|
|
88
82
|
});
|
|
89
|
-
module.exports = __toCommonJS(props_exports);
|
|
90
83
|
//# sourceMappingURL=props.js.map
|
package/dist/cjs/props.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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-
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-unsafe-assignment */\nimport { noop } from 'lodash';\nimport { PropTypes } from 'react-desc';\nimport { globalAttributesPropTypes } from '@elliemae/ds-utilities';\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;AAAA;ACAA,YAAuB;ADCvB,oBAAqB;AACrB,wBAA0B;AAC1B,0BAA0C;AAE1C,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,OAAO,4BAAU,OAAO,YAAY,iBAAiB,EAAE;AAAA,EACvD,SAAS,4BAAU,OAAO,YAAY,sBAAsB;AAAA,EAC5D,SAAS,4BAAU,QAAQ,4BAAU,MAAM,EAAE,YAAY,wBAAwB,EAAE;AAAA,GAChF;AAGE,MAAM,qBAAqB;AAAA,EAChC,SAAS;AAAA,EACT,UAAU,aAAa;AAAA,EACvB,UAAU;AAAA,EACV,SAAS;AACX;AAEO,MAAM,uBAAuB;AAAA,EAClC,SAAS,4BAAU,MAAM,CAAC,QAAQ,SAAS,IAAI,CAAC,EAC7C,YAAY,mEAAmE,EAC/E,aAAa,IAAI;AAAA,EACpB,UAAU,4BAAU,MAAM,CAAC,UAAU,OAAO,CAAC,EAC1C,YAAY,wCAAwC,EACpD,aAAa,QAAQ;AAAA,EACxB,UAAU,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU,IAAI,CAAC,EAAE,YAAY,gCAAgC;AAAA,GAC3G,gDAR+B;AAAA,EASlC,UAAU,4BAAU,KAAK,YAAY,sBAAsB;AAAA,EAC3D,SAAS,4BAAU,KAAK,YAAY,2BAA2B,EAAE,aAAa,QAAQ;AAAA,EACtF,OAAO,4BAAU,OAAO,YAAY,mDAAmD,EAAE;AAC3F;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/styled.js
CHANGED
|
@@ -4,27 +4,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
7
|
var __export = (target, all) => {
|
|
9
8
|
for (var name in all)
|
|
10
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
10
|
};
|
|
12
|
-
var
|
|
13
|
-
if (
|
|
14
|
-
for (let key of __getOwnPropNames(
|
|
15
|
-
if (!__hasOwnProp.call(
|
|
16
|
-
__defProp(
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
16
|
}
|
|
18
|
-
return
|
|
17
|
+
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (
|
|
21
|
-
|
|
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);
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
21
|
var styled_exports = {};
|
|
29
22
|
__export(styled_exports, {
|
|
30
23
|
Label: () => Label,
|
|
@@ -32,6 +25,7 @@ __export(styled_exports, {
|
|
|
32
25
|
StepperWrapper: () => StepperWrapper,
|
|
33
26
|
StyledButton: () => StyledButton
|
|
34
27
|
});
|
|
28
|
+
module.exports = __toCommonJS(styled_exports);
|
|
35
29
|
var React = __toESM(require("react"));
|
|
36
30
|
var import_styled_components = __toESM(require("styled-components"));
|
|
37
31
|
var import_ds_button = require("@elliemae/ds-button");
|
|
@@ -65,5 +59,4 @@ const StyledButton = (0, import_styled_components.default)(import_ds_button.DSBu
|
|
|
65
59
|
font-size: ${(props) => props.fontSize === "large" ? "22px" : "18px"};
|
|
66
60
|
}
|
|
67
61
|
`;
|
|
68
|
-
module.exports = __toCommonJS(styled_exports);
|
|
69
62
|
//# sourceMappingURL=styled.js.map
|
package/dist/cjs/styled.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/styled.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
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": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;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,2DAA0B;AAAA;AAAA;AAAA;AAK/C,MAAM,eAAe,sCAAO,2BAAU;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;AAAA;AAAA;AAAA,WAGpC,CAAC,UAAoD,MAAM,aAAa,UAAU,QAAQ;AAAA,iBACpF,CAAC,UAAoD,MAAM,aAAa,UAAU,SAAS;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/Stepper.js
CHANGED
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
useMemoMergePropsWithDefault,
|
|
23
23
|
useValidateTypescriptPropTypes,
|
|
24
24
|
useGetGlobalAttributes
|
|
25
|
-
} from "@elliemae/ds-
|
|
25
|
+
} from "@elliemae/ds-utilities";
|
|
26
26
|
import { dsStepperProps, defaultProps } from "./props";
|
|
27
27
|
import { Step, StepperWrapper } from "./styled";
|
|
28
28
|
const DSStepper = (props) => {
|
|
@@ -45,6 +45,7 @@ const DSStepper = (props) => {
|
|
|
45
45
|
})));
|
|
46
46
|
};
|
|
47
47
|
DSStepper.propTypes = dsStepperProps;
|
|
48
|
+
DSStepper.displayName = "DSStepper";
|
|
48
49
|
const StepperWithSchema = describe(DSStepper);
|
|
49
50
|
StepperWithSchema.propTypes = dsStepperProps;
|
|
50
51
|
export {
|
package/dist/esm/Stepper.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAKA;AACA;AAEA,MAAM,YAAY,CAAC,UAA6C;AAC9D,QAAM,oBAAoB,6BAA6B,OAAO;
|
|
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-utilities';\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;\nDSStepper.displayName = 'DSStepper';\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,YAAY;AAC1E,iCAA+B,mBAAmB,cAAc;AAEhE,QAAM,EAAE,OAAO,SAAS,YAAY;AACpC,QAAM,aAAa,OAAM,QAAQ,MAAM,IAAI,MAAM,KAAK,EAAE,KAAK,CAAC,GAAe,CAAC,KAAK,CAAC;AACpF,QAAM,mBAAmB,uBAAuB,iBAAiB;AAEjE,SACE,qCAAC;AAAA,IAAe;AAAA,IAAc;AAAA,IAAkB;AAAA,KAAsB,mBACnE,WAAW,IAAI,CAAC,MAAM,UACrB,qCAAC;AAAA,IAEC,KAAK,GAAG,IAAI,CAAC,aAAa;AAAA,IAC1B,QAAQ,YAAY;AAAA,IACpB,SAAS,QAAQ,SAAS,KAAK;AAAA,IAC/B,eAAa,MAAM,iBAAiB,GAAG,MAAM,wBAAkC;AAAA,IAC/E,eAAa,YAAY;AAAA,IACzB,gBAAc,QAAQ,SAAS,KAAK;AAAA,GACtC,CACD,CACH;AAEJ;AAEA,UAAU,YAAY;AACtB,UAAU,cAAc;AACxB,MAAM,oBAAoB,SAAS,SAAS;AAC5C,kBAAkB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
useMemoMergePropsWithDefault,
|
|
22
22
|
useValidateTypescriptPropTypes,
|
|
23
23
|
useGetGlobalAttributes
|
|
24
|
-
} from "@elliemae/ds-
|
|
24
|
+
} from "@elliemae/ds-utilities";
|
|
25
25
|
import { BUTTON_TYPES } from "@elliemae/ds-button";
|
|
26
26
|
import { ChevronLeft, ChevronRight } from "@elliemae/ds-icons";
|
|
27
27
|
import { dsStepperButtonProps, defaultButtonProps } from "./props";
|
|
@@ -43,6 +43,7 @@ const DSStepperButton = (props) => {
|
|
|
43
43
|
}), chevron === "right" ? /* @__PURE__ */ React2.createElement(ChevronRight, null) : null);
|
|
44
44
|
};
|
|
45
45
|
DSStepperButton.propTypes = dsStepperButtonProps;
|
|
46
|
+
DSStepperButton.displayName = "DSStepperButton";
|
|
46
47
|
const DSStepperButtonWithSchema = describe(DSStepperButton);
|
|
47
48
|
DSStepperButtonWithSchema.propTypes = dsStepperButtonProps;
|
|
48
49
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAKA;AACA;AACA;AACA;AAEA,MAAM,kBAAkB,CAAC,UAAmD;AAC1E,QAAM,oBAAoB,6BACxB,OACA;
|
|
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-utilities';\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;\nDSStepperButton.displayName = 'DSStepperButton';\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,kBACF;AACA,iCAA+B,mBAAmB,oBAAoB;AAEtE,QAAM,EAAE,SAAS,UAAU,OAAO,UAAU,SAAS,aAAa;AAClE,QAAM,mBAAmB,uBAAuB,iBAAiB;AAEjE,SACE,qCAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY,aAAa;AAAA,IACzB;AAAA,IACA,eAAY;AAAA,KACR,mBAEH,YAAY,SAAS,qCAAC,iBAAY,IAAK,MACxC,qCAAC;AAAA,IAAM,OAAO;AAAA,GAAO,GACpB,YAAY,UAAU,qCAAC,kBAAa,IAAK,IAC5C;AAEJ;AAEA,gBAAgB,YAAY;AAC5B,gBAAgB,cAAc;AAC9B,MAAM,4BAA4B,SAAS,eAAe;AAC1D,0BAA0B,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/props.js
CHANGED
|
@@ -20,7 +20,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
20
20
|
import * as React from "react";
|
|
21
21
|
import { noop } from "lodash";
|
|
22
22
|
import { PropTypes } from "react-desc";
|
|
23
|
-
import { globalAttributesPropTypes } from "@elliemae/ds-
|
|
23
|
+
import { globalAttributesPropTypes } from "@elliemae/ds-utilities";
|
|
24
24
|
const BUTTON_SIZES = {
|
|
25
25
|
normal: "normal",
|
|
26
26
|
large: "large"
|
package/dist/esm/props.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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-
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AACA;AAEA,MAAM,eAAe;AAAA,EACnB,QAAQ;AAAA,EACR,OAAO;
|
|
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-utilities';\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;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,OAAO,UAAU,OAAO,YAAY,iBAAiB,EAAE;AAAA,EACvD,SAAS,UAAU,OAAO,YAAY,sBAAsB;AAAA,EAC5D,SAAS,UAAU,QAAQ,UAAU,MAAM,EAAE,YAAY,wBAAwB,EAAE;AAAA,GAChF;AAGE,MAAM,qBAAqB;AAAA,EAChC,SAAS;AAAA,EACT,UAAU,aAAa;AAAA,EACvB,UAAU;AAAA,EACV,SAAS;AACX;AAEO,MAAM,uBAAuB;AAAA,EAClC,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,GAC3G,4BAR+B;AAAA,EASlC,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
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/styled.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/styled.tsx"],
|
|
4
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;
|
|
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,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;AAAA;AAAA;AAAA,WAGpC,CAAC,UAAoD,MAAM,aAAa,UAAU,QAAQ;AAAA,iBACpF,CAAC,UAAoD,MAAM,aAAa,UAAU,SAAS;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-stepper",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-rc.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Stepper",
|
|
6
6
|
"files": [
|
|
@@ -50,11 +50,18 @@
|
|
|
50
50
|
"reportFile": "tests.xml",
|
|
51
51
|
"indent": 4
|
|
52
52
|
},
|
|
53
|
+
"scripts": {
|
|
54
|
+
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
|
55
|
+
"test": "node ../../scripts/testing/test.mjs",
|
|
56
|
+
"lint": "node ../../scripts/lint.mjs",
|
|
57
|
+
"dts": "node ../../scripts/dts.mjs",
|
|
58
|
+
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
|
|
59
|
+
},
|
|
53
60
|
"dependencies": {
|
|
54
|
-
"@elliemae/ds-button": "
|
|
55
|
-
"@elliemae/ds-icons": "
|
|
56
|
-
"@elliemae/ds-
|
|
57
|
-
"@elliemae/ds-
|
|
61
|
+
"@elliemae/ds-button": "workspace:*",
|
|
62
|
+
"@elliemae/ds-icons": "workspace:*",
|
|
63
|
+
"@elliemae/ds-truncated-tooltip-text": "workspace:*",
|
|
64
|
+
"@elliemae/ds-utilities": "workspace:*",
|
|
58
65
|
"react-desc": "~4.1.3",
|
|
59
66
|
"uid": "~2.0.0"
|
|
60
67
|
},
|
|
@@ -71,12 +78,5 @@
|
|
|
71
78
|
"publishConfig": {
|
|
72
79
|
"access": "public",
|
|
73
80
|
"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
|
-
"dts": "node ../../scripts/dts.mjs",
|
|
80
|
-
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
|
|
81
81
|
}
|
|
82
|
-
}
|
|
82
|
+
}
|