@elliemae/ds-stepper 2.2.0-next.3 → 2.3.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/Stepper.js +61 -58
- package/cjs/Stepper.js.map +7 -0
- package/cjs/StepperButton.js +58 -57
- package/cjs/StepperButton.js.map +7 -0
- package/cjs/index.js +29 -13
- package/cjs/index.js.map +7 -0
- package/cjs/props.js +60 -29
- package/cjs/props.js.map +7 -0
- package/cjs/styled.js +69 -29
- package/cjs/styled.js.map +7 -0
- package/esm/Stepper.js +33 -43
- package/esm/Stepper.js.map +7 -0
- package/esm/StepperButton.js +29 -42
- package/esm/StepperButton.js.map +7 -0
- package/esm/index.js +4 -2
- package/esm/index.js.map +7 -0
- package/esm/props.js +29 -20
- package/esm/props.js.map +7 -0
- package/esm/styled.js +40 -18
- package/esm/styled.js.map +7 -0
- package/package.json +5 -5
- package/types/Stepper.d.ts +1 -1
- package/types/StepperButton.d.ts +1 -1
package/cjs/Stepper.js
CHANGED
|
@@ -1,61 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
+
return /* @__PURE__ */ import_react.default.createElement(import_styled.StepperWrapper, {
|
|
36
46
|
steps,
|
|
37
47
|
current,
|
|
38
|
-
visited
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
visited: visited
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
visited: visited.includes(index),
|
|
50
|
-
"data-testid": props$1['data-testid'] ? "".concat(props$1['data-testid'], "-step") : undefined,
|
|
51
|
-
"data-active": current === index,
|
|
52
|
-
"data-visited": visited.includes(index)
|
|
53
|
-
}, "".concat(uid.uid(4), "step-key-").concat(index)))
|
|
54
|
-
}));
|
|
48
|
+
visited,
|
|
49
|
+
...(0, import_ds_props_helpers.getAriaProps)(props),
|
|
50
|
+
...(0, import_ds_props_helpers.getDataProps)(props)
|
|
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
|
+
})));
|
|
55
59
|
};
|
|
56
|
-
|
|
57
|
-
const StepperWithSchema =
|
|
58
|
-
StepperWithSchema.propTypes =
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
exports.StepperWithSchema = StepperWithSchema;
|
|
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 getAriaProps,\n getDataProps,\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 return (\n <StepperWrapper steps={steps} current={current} visited={visited} {...getAriaProps(props)} {...getDataProps(props)}>\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,8BAKO;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,SACE,mDAAC,8BAAD;AAAA,IAAgB;AAAA,IAAc;AAAA,IAAkB;AAAA,OAAsB,0CAAa;AAAA,OAAY,0CAAa;AAAA,KACzG,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
|
+
}
|
package/cjs/StepperButton.js
CHANGED
|
@@ -1,60 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
+
return /* @__PURE__ */ import_react.default.createElement(import_styled.StyledButton, {
|
|
39
46
|
disabled,
|
|
40
47
|
onClick,
|
|
41
|
-
innerRef
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}, dsPropsHelpers.getAriaProps(props$1)), dsPropsHelpers.getDataProps(props$1)), {}, {
|
|
50
|
-
children: [chevron === 'left' ? _ChevronLeft || (_ChevronLeft = /*#__PURE__*/_jsx__default["default"](dsIcons.ChevronLeft, {})) : null, /*#__PURE__*/_jsx__default["default"](styled.Label, {
|
|
51
|
-
value: label
|
|
52
|
-
}), chevron === 'right' ? _ChevronRight || (_ChevronRight = /*#__PURE__*/_jsx__default["default"](dsIcons.ChevronRight, {})) : null]
|
|
53
|
-
}));
|
|
48
|
+
innerRef,
|
|
49
|
+
buttonType: import_ds_button.BUTTON_TYPES.TEXT,
|
|
50
|
+
fontSize,
|
|
51
|
+
...(0, import_ds_props_helpers.getAriaProps)(props),
|
|
52
|
+
...(0, import_ds_props_helpers.getDataProps)(props)
|
|
53
|
+
}, chevron === "left" ? /* @__PURE__ */ import_react.default.createElement(import_ds_icons.ChevronLeft, null) : null, /* @__PURE__ */ import_react.default.createElement(import_styled.Label, {
|
|
54
|
+
value: label
|
|
55
|
+
}), chevron === "right" ? /* @__PURE__ */ import_react.default.createElement(import_ds_icons.ChevronRight, null) : null);
|
|
54
56
|
};
|
|
55
|
-
|
|
56
|
-
const DSStepperButtonWithSchema =
|
|
57
|
-
DSStepperButtonWithSchema.propTypes =
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
exports.DSStepperButtonWithSchema = DSStepperButtonWithSchema;
|
|
57
|
+
DSStepperButton.propTypes = import_props.dsStepperButtonProps;
|
|
58
|
+
const DSStepperButtonWithSchema = (0, import_react_desc.describe)(DSStepperButton);
|
|
59
|
+
DSStepperButtonWithSchema.propTypes = import_props.dsStepperButtonProps;
|
|
60
|
+
module.exports = __toCommonJS(StepperButton_exports);
|
|
61
|
+
//# 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 getAriaProps,\n getDataProps,\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\n return (\n <StyledButton\n disabled={disabled}\n onClick={onClick}\n innerRef={innerRef}\n buttonType={BUTTON_TYPES.TEXT}\n fontSize={fontSize}\n {...getAriaProps(props)}\n {...getDataProps(props)}\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,8BAKO;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;AAElE,SACE,mDAAC,4BAAD;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY,8BAAa;AAAA,IACzB;AAAA,OACI,0CAAa;AAAA,OACb,0CAAa;AAAA,KAEhB,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
|
+
}
|
package/cjs/index.js
CHANGED
|
@@ -1,13 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
package/cjs/index.js.map
ADDED
|
@@ -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
|
+
}
|
package/cjs/props.js
CHANGED
|
@@ -1,42 +1,73 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
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");
|
|
8
38
|
const BUTTON_SIZES = {
|
|
9
|
-
normal:
|
|
10
|
-
large:
|
|
39
|
+
normal: "normal",
|
|
40
|
+
large: "large"
|
|
41
|
+
};
|
|
42
|
+
const CHEVRON_TYPE = {
|
|
43
|
+
left: "left",
|
|
44
|
+
right: "right"
|
|
11
45
|
};
|
|
12
46
|
const defaultProps = {
|
|
13
47
|
steps: 5,
|
|
14
|
-
current:
|
|
48
|
+
current: void 0,
|
|
15
49
|
visited: []
|
|
16
50
|
};
|
|
17
51
|
const dsStepperProps = {
|
|
18
|
-
steps:
|
|
19
|
-
current:
|
|
20
|
-
visited:
|
|
52
|
+
steps: import_react_desc.PropTypes.number.description("Number of steps").isRequired,
|
|
53
|
+
current: import_react_desc.PropTypes.number.description("Index of active step"),
|
|
54
|
+
visited: import_react_desc.PropTypes.arrayOf(import_react_desc.PropTypes.number).description("Array of visited steps").isRequired
|
|
21
55
|
};
|
|
22
56
|
const defaultButtonProps = {
|
|
23
|
-
chevron:
|
|
57
|
+
chevron: void 0,
|
|
24
58
|
fontSize: BUTTON_SIZES.normal,
|
|
25
59
|
disabled: false,
|
|
26
|
-
onClick:
|
|
60
|
+
onClick: import_lodash.noop
|
|
27
61
|
};
|
|
28
62
|
const dsStepperButtonProps = {
|
|
29
|
-
chevron:
|
|
30
|
-
fontSize:
|
|
31
|
-
label:
|
|
32
|
-
disabled:
|
|
33
|
-
onClick:
|
|
34
|
-
innerRef:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
exports.defaultProps = defaultProps;
|
|
41
|
-
exports.dsStepperButtonProps = dsStepperButtonProps;
|
|
42
|
-
exports.dsStepperProps = dsStepperProps;
|
|
63
|
+
chevron: import_react_desc.PropTypes.oneOf(["left", "right", null]).description("Chevron icon position, if null/undefined no chevron will be shown").defaultValue(null),
|
|
64
|
+
fontSize: import_react_desc.PropTypes.oneOf(["normal", "large"]).description("Label size, used for marking last step").defaultValue("normal"),
|
|
65
|
+
label: import_react_desc.PropTypes.string.description("Text Label, this only accepts text, no custom JSX").isRequired,
|
|
66
|
+
disabled: import_react_desc.PropTypes.bool.description("Adds disabled state."),
|
|
67
|
+
onClick: import_react_desc.PropTypes.func.description("OnClick callback handler.").defaultValue("()=>{}"),
|
|
68
|
+
innerRef: import_react_desc.PropTypes.oneOfType([import_react_desc.PropTypes.object, import_react_desc.PropTypes.func]).description("Inner ref to button component."),
|
|
69
|
+
"aria-": import_react_desc.PropTypes.oneOfType([import_react_desc.PropTypes.string, import_react_desc.PropTypes.bool]).description("accept all the aria-* props, MUST receive aria-label"),
|
|
70
|
+
"data-": import_react_desc.PropTypes.oneOfType([import_react_desc.PropTypes.string, import_react_desc.PropTypes.bool]).description("accept all the data-* props")
|
|
71
|
+
};
|
|
72
|
+
module.exports = __toCommonJS(props_exports);
|
|
73
|
+
//# sourceMappingURL=props.js.map
|
package/cjs/props.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/props.ts", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { noop } from 'lodash';\nimport { PropTypes } from 'react-desc';\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};\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 label: PropTypes.string.description('Text Label, this only accepts text, no custom JSX').isRequired,\n disabled: PropTypes.bool.description('Adds disabled state.'),\n onClick: PropTypes.func.description('OnClick callback handler.').defaultValue('()=>{}'),\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description('Inner ref to button component.'),\n 'aria-': PropTypes.oneOfType([PropTypes.string, PropTypes.bool]).description(\n 'accept all the aria-* props, MUST receive aria-label',\n ),\n 'data-': PropTypes.oneOfType([PropTypes.string, PropTypes.bool]).description('accept all the data-* props'),\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,oBAAqB;AACrB,wBAA0B;AAE1B,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;AAG9E,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,OAAO,4BAAU,OAAO,YAAY,qDAAqD;AAAA,EACzF,UAAU,4BAAU,KAAK,YAAY;AAAA,EACrC,SAAS,4BAAU,KAAK,YAAY,6BAA6B,aAAa;AAAA,EAC9E,UAAU,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU,OAAO,YAAY;AAAA,EAC9E,SAAS,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU,OAAO,YAC/D;AAAA,EAEF,SAAS,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU,OAAO,YAAY;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/cjs/styled.js
CHANGED
|
@@ -1,29 +1,69 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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 __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: flex-end;
|
|
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: flex-end;\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
|
+
}
|
package/esm/Stepper.js
CHANGED
|
@@ -1,50 +1,40 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
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 => {
|
|
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
|
+
getAriaProps,
|
|
9
|
+
getDataProps
|
|
10
|
+
} from "@elliemae/ds-props-helpers";
|
|
11
|
+
import { dsStepperProps, defaultProps } from "./props";
|
|
12
|
+
import { Step, StepperWrapper } from "./styled";
|
|
13
|
+
const DSStepper = (props) => {
|
|
23
14
|
const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultProps);
|
|
24
15
|
useValidateTypescriptPropTypes(propsWithDefaults, dsStepperProps);
|
|
25
|
-
const {
|
|
16
|
+
const { steps, current, visited } = propsWithDefaults;
|
|
17
|
+
const stepsArray = React2.useMemo(() => new Array(steps).fill(1), [steps]);
|
|
18
|
+
return /* @__PURE__ */ React2.createElement(StepperWrapper, {
|
|
26
19
|
steps,
|
|
27
20
|
current,
|
|
28
|
-
visited
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
visited: visited
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
visited: visited.includes(index),
|
|
40
|
-
"data-testid": props['data-testid'] ? "".concat(props['data-testid'], "-step") : undefined,
|
|
41
|
-
"data-active": current === index,
|
|
42
|
-
"data-visited": visited.includes(index)
|
|
43
|
-
}, "".concat(uid(4), "step-key-").concat(index)))
|
|
44
|
-
}));
|
|
21
|
+
visited,
|
|
22
|
+
...getAriaProps(props),
|
|
23
|
+
...getDataProps(props)
|
|
24
|
+
}, stepsArray.map((item, index) => /* @__PURE__ */ React2.createElement(Step, {
|
|
25
|
+
key: `${uid(4)}step-key-${index}`,
|
|
26
|
+
active: current === index,
|
|
27
|
+
visited: visited.includes(index),
|
|
28
|
+
"data-testid": props["data-testid"] ? `${props["data-testid"]}-step` : void 0,
|
|
29
|
+
"data-active": current === index,
|
|
30
|
+
"data-visited": visited.includes(index)
|
|
31
|
+
})));
|
|
45
32
|
};
|
|
46
|
-
|
|
33
|
+
DSStepper.propTypes = dsStepperProps;
|
|
47
34
|
const StepperWithSchema = describe(DSStepper);
|
|
48
35
|
StepperWithSchema.propTypes = dsStepperProps;
|
|
49
|
-
|
|
50
|
-
|
|
36
|
+
export {
|
|
37
|
+
DSStepper,
|
|
38
|
+
StepperWithSchema
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=Stepper.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/Stepper.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { uid } from 'uid';\nimport { describe } from 'react-desc';\nimport {\n useMemoMergePropsWithDefault,\n useValidateTypescriptPropTypes,\n getAriaProps,\n getDataProps,\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 return (\n <StepperWrapper steps={steps} current={current} visited={visited} {...getAriaProps(props)} {...getDataProps(props)}>\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;AAAA;AAMA;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,SACE,qCAAC,gBAAD;AAAA,IAAgB;AAAA,IAAc;AAAA,IAAkB;AAAA,OAAsB,aAAa;AAAA,OAAY,aAAa;AAAA,KACzG,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
|
+
}
|
package/esm/StepperButton.js
CHANGED
|
@@ -1,50 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
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 => {
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { describe } from "react-desc";
|
|
4
|
+
import {
|
|
5
|
+
useMemoMergePropsWithDefault,
|
|
6
|
+
useValidateTypescriptPropTypes,
|
|
7
|
+
getAriaProps,
|
|
8
|
+
getDataProps
|
|
9
|
+
} from "@elliemae/ds-props-helpers";
|
|
10
|
+
import { BUTTON_TYPES } from "@elliemae/ds-button";
|
|
11
|
+
import { ChevronLeft, ChevronRight } from "@elliemae/ds-icons";
|
|
12
|
+
import { dsStepperButtonProps, defaultButtonProps } from "./props";
|
|
13
|
+
import { StyledButton, Label } from "./styled";
|
|
14
|
+
const DSStepperButton = (props) => {
|
|
24
15
|
const propsWithDefaults = useMemoMergePropsWithDefault(props, defaultButtonProps);
|
|
25
16
|
useValidateTypescriptPropTypes(propsWithDefaults, dsStepperButtonProps);
|
|
26
|
-
const {
|
|
27
|
-
|
|
28
|
-
fontSize,
|
|
29
|
-
label,
|
|
17
|
+
const { chevron, fontSize, label, disabled, onClick, innerRef } = propsWithDefaults;
|
|
18
|
+
return /* @__PURE__ */ React2.createElement(StyledButton, {
|
|
30
19
|
disabled,
|
|
31
20
|
onClick,
|
|
32
|
-
innerRef
|
|
33
|
-
} = propsWithDefaults;
|
|
34
|
-
return /*#__PURE__*/jsxs(StyledButton, _objectSpread(_objectSpread(_objectSpread({
|
|
35
|
-
disabled: disabled,
|
|
36
|
-
onClick: onClick,
|
|
37
|
-
innerRef: innerRef,
|
|
21
|
+
innerRef,
|
|
38
22
|
buttonType: BUTTON_TYPES.TEXT,
|
|
39
|
-
fontSize
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}));
|
|
23
|
+
fontSize,
|
|
24
|
+
...getAriaProps(props),
|
|
25
|
+
...getDataProps(props)
|
|
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);
|
|
45
29
|
};
|
|
46
|
-
|
|
30
|
+
DSStepperButton.propTypes = dsStepperButtonProps;
|
|
47
31
|
const DSStepperButtonWithSchema = describe(DSStepperButton);
|
|
48
32
|
DSStepperButtonWithSchema.propTypes = dsStepperButtonProps;
|
|
49
|
-
|
|
50
|
-
|
|
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 getAriaProps,\n getDataProps,\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\n return (\n <StyledButton\n disabled={disabled}\n onClick={onClick}\n innerRef={innerRef}\n buttonType={BUTTON_TYPES.TEXT}\n fontSize={fontSize}\n {...getAriaProps(props)}\n {...getDataProps(props)}\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;AAAA;AAMA;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;AAElE,SACE,qCAAC,cAAD;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY,aAAa;AAAA,IACzB;AAAA,OACI,aAAa;AAAA,OACb,aAAa;AAAA,KAEhB,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
|
+
}
|
package/esm/index.js
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export * from "./Stepper";
|
|
3
|
+
export * from "./StepperButton";
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
ADDED
|
@@ -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
|
+
}
|
package/esm/props.js
CHANGED
|
@@ -1,35 +1,44 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { noop } from "lodash";
|
|
3
|
+
import { PropTypes } from "react-desc";
|
|
4
4
|
const BUTTON_SIZES = {
|
|
5
|
-
normal:
|
|
6
|
-
large:
|
|
5
|
+
normal: "normal",
|
|
6
|
+
large: "large"
|
|
7
|
+
};
|
|
8
|
+
const CHEVRON_TYPE = {
|
|
9
|
+
left: "left",
|
|
10
|
+
right: "right"
|
|
7
11
|
};
|
|
8
12
|
const defaultProps = {
|
|
9
13
|
steps: 5,
|
|
10
|
-
current:
|
|
14
|
+
current: void 0,
|
|
11
15
|
visited: []
|
|
12
16
|
};
|
|
13
17
|
const dsStepperProps = {
|
|
14
|
-
steps: PropTypes.number.description(
|
|
15
|
-
current: PropTypes.number.description(
|
|
16
|
-
visited: PropTypes.arrayOf(PropTypes.number).description(
|
|
18
|
+
steps: PropTypes.number.description("Number of steps").isRequired,
|
|
19
|
+
current: PropTypes.number.description("Index of active step"),
|
|
20
|
+
visited: PropTypes.arrayOf(PropTypes.number).description("Array of visited steps").isRequired
|
|
17
21
|
};
|
|
18
22
|
const defaultButtonProps = {
|
|
19
|
-
chevron:
|
|
23
|
+
chevron: void 0,
|
|
20
24
|
fontSize: BUTTON_SIZES.normal,
|
|
21
25
|
disabled: false,
|
|
22
26
|
onClick: noop
|
|
23
27
|
};
|
|
24
28
|
const dsStepperButtonProps = {
|
|
25
|
-
chevron: PropTypes.oneOf([
|
|
26
|
-
fontSize: PropTypes.oneOf([
|
|
27
|
-
label: PropTypes.string.description(
|
|
28
|
-
disabled: PropTypes.bool.description(
|
|
29
|
-
onClick: PropTypes.func.description(
|
|
30
|
-
innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description(
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
chevron: PropTypes.oneOf(["left", "right", null]).description("Chevron icon position, if null/undefined no chevron will be shown").defaultValue(null),
|
|
30
|
+
fontSize: PropTypes.oneOf(["normal", "large"]).description("Label size, used for marking last step").defaultValue("normal"),
|
|
31
|
+
label: PropTypes.string.description("Text Label, this only accepts text, no custom JSX").isRequired,
|
|
32
|
+
disabled: PropTypes.bool.description("Adds disabled state."),
|
|
33
|
+
onClick: PropTypes.func.description("OnClick callback handler.").defaultValue("()=>{}"),
|
|
34
|
+
innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description("Inner ref to button component."),
|
|
35
|
+
"aria-": PropTypes.oneOfType([PropTypes.string, PropTypes.bool]).description("accept all the aria-* props, MUST receive aria-label"),
|
|
36
|
+
"data-": PropTypes.oneOfType([PropTypes.string, PropTypes.bool]).description("accept all the data-* props")
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
defaultButtonProps,
|
|
40
|
+
defaultProps,
|
|
41
|
+
dsStepperButtonProps,
|
|
42
|
+
dsStepperProps
|
|
33
43
|
};
|
|
34
|
-
|
|
35
|
-
export { defaultButtonProps, defaultProps, dsStepperButtonProps, dsStepperProps };
|
|
44
|
+
//# sourceMappingURL=props.js.map
|
package/esm/props.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/props.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { noop } from 'lodash';\nimport { PropTypes } from 'react-desc';\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};\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 label: PropTypes.string.description('Text Label, this only accepts text, no custom JSX').isRequired,\n disabled: PropTypes.bool.description('Adds disabled state.'),\n onClick: PropTypes.func.description('OnClick callback handler.').defaultValue('()=>{}'),\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description('Inner ref to button component.'),\n 'aria-': PropTypes.oneOfType([PropTypes.string, PropTypes.bool]).description(\n 'accept all the aria-* props, MUST receive aria-label',\n ),\n 'data-': PropTypes.oneOfType([PropTypes.string, PropTypes.bool]).description('accept all the data-* props'),\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;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;AAG9E,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,OAAO,UAAU,OAAO,YAAY,qDAAqD;AAAA,EACzF,UAAU,UAAU,KAAK,YAAY;AAAA,EACrC,SAAS,UAAU,KAAK,YAAY,6BAA6B,aAAa;AAAA,EAC9E,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,OAAO,YAAY;AAAA,EAC9E,SAAS,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,OAAO,YAC/D;AAAA,EAEF,SAAS,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,OAAO,YAAY;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/esm/styled.js
CHANGED
|
@@ -1,18 +1,40 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const StepperWrapper =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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: flex-end;
|
|
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: flex-end;\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
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-stepper",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0-alpha.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Stepper",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"build": "node ../../scripts/build/build.js"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@elliemae/ds-button": "2.
|
|
52
|
-
"@elliemae/ds-icons": "2.
|
|
53
|
-
"@elliemae/ds-props-helpers": "2.
|
|
54
|
-
"@elliemae/ds-truncated-tooltip-text": "2.
|
|
51
|
+
"@elliemae/ds-button": "2.3.0-alpha.1",
|
|
52
|
+
"@elliemae/ds-icons": "2.3.0-alpha.1",
|
|
53
|
+
"@elliemae/ds-props-helpers": "2.3.0-alpha.1",
|
|
54
|
+
"@elliemae/ds-truncated-tooltip-text": "2.3.0-alpha.1",
|
|
55
55
|
"react-desc": "~4.1.3",
|
|
56
56
|
"uid": "~2.0.0"
|
|
57
57
|
},
|
package/types/Stepper.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ declare const DSStepper: {
|
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
17
|
declare const StepperWithSchema: {
|
|
18
|
-
(props?:
|
|
18
|
+
(props?: unknown): JSX.Element;
|
|
19
19
|
propTypes: unknown;
|
|
20
20
|
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
21
21
|
};
|
package/types/StepperButton.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ declare const DSStepperButton: {
|
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
43
|
declare const DSStepperButtonWithSchema: {
|
|
44
|
-
(props?:
|
|
44
|
+
(props?: unknown): JSX.Element;
|
|
45
45
|
propTypes: unknown;
|
|
46
46
|
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
47
47
|
};
|