@elliemae/ds-progress-indicator 3.4.3-rc.1 → 3.4.3
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/DSProgressIndicator.js +42 -23
- package/dist/cjs/DSProgressIndicator.js.map +2 -2
- package/dist/cjs/ProgressBar.js +14 -9
- package/dist/cjs/ProgressBar.js.map +2 -2
- package/dist/cjs/ProgressCounter.js +8 -3
- package/dist/cjs/ProgressCounter.js.map +1 -1
- package/dist/cjs/classedComponents.js +18 -4
- package/dist/cjs/classedComponents.js.map +1 -1
- package/dist/cjs/index.js +4 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils.js +4 -1
- package/dist/cjs/utils.js.map +1 -1
- package/dist/esm/DSProgressIndicator.js +38 -22
- package/dist/esm/DSProgressIndicator.js.map +1 -1
- package/dist/esm/ProgressBar.js +10 -8
- package/dist/esm/ProgressBar.js.map +1 -1
- package/dist/esm/ProgressCounter.js +4 -2
- package/dist/esm/ProgressCounter.js.map +1 -1
- package/dist/esm/classedComponents.js +14 -3
- package/dist/esm/classedComponents.js.map +1 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/utils.js.map +1 -1
- package/package.json +4 -4
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var DSProgressIndicator_exports = {};
|
|
23
26
|
__export(DSProgressIndicator_exports, {
|
|
@@ -27,7 +30,8 @@ __export(DSProgressIndicator_exports, {
|
|
|
27
30
|
});
|
|
28
31
|
module.exports = __toCommonJS(DSProgressIndicator_exports);
|
|
29
32
|
var React = __toESM(require("react"));
|
|
30
|
-
var
|
|
33
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
34
|
+
var import_react = require("react");
|
|
31
35
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
32
36
|
var import_ds_truncated_tooltip_text = __toESM(require("@elliemae/ds-truncated-tooltip-text"));
|
|
33
37
|
var import_ProgressCounter = __toESM(require("./ProgressCounter"));
|
|
@@ -45,33 +49,46 @@ const DSProgressIndicator = ({
|
|
|
45
49
|
segments = [],
|
|
46
50
|
style = {}
|
|
47
51
|
}) => {
|
|
48
|
-
const renderProgressBar = (0, import_react.useMemo)(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
const renderProgressBar = (0, import_react.useMemo)(
|
|
53
|
+
() => segments.length ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ProgressBar.default, {
|
|
54
|
+
children: segments.map(
|
|
55
|
+
(segmentProps, i) => !(segmentProps.now < segmentProps.min) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ProgressBar.default.Segment, {
|
|
56
|
+
...segmentProps
|
|
57
|
+
}, i)
|
|
58
|
+
)
|
|
59
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ProgressBar.default, {
|
|
60
|
+
max,
|
|
61
|
+
min,
|
|
62
|
+
now
|
|
63
|
+
}),
|
|
64
|
+
[segments, min, max, now]
|
|
65
|
+
);
|
|
66
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_classedComponents.Wrapper, {
|
|
57
67
|
ref: innerRef,
|
|
58
68
|
"aria-disabled": disabled,
|
|
59
69
|
classProps: { disabled },
|
|
60
70
|
...containerProps,
|
|
61
|
-
style
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
+
style,
|
|
72
|
+
children: [
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_truncated_tooltip_text.default, {
|
|
74
|
+
containerComponent: import_classedComponents.Title,
|
|
75
|
+
value: title
|
|
76
|
+
}),
|
|
77
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ProgressCounter.default, {
|
|
78
|
+
max,
|
|
79
|
+
min,
|
|
80
|
+
now,
|
|
81
|
+
renderer: counterRenderer
|
|
82
|
+
}),
|
|
83
|
+
renderProgressBar
|
|
84
|
+
]
|
|
85
|
+
});
|
|
71
86
|
};
|
|
72
87
|
const variants = ["default", "success", "warning", "info", "error"];
|
|
73
88
|
const progressIndicatorProps = {
|
|
74
|
-
containerProps: import_ds_utilities.PropTypes.object.description(
|
|
89
|
+
containerProps: import_ds_utilities.PropTypes.object.description(
|
|
90
|
+
"Set of Properties attached to the main container"
|
|
91
|
+
),
|
|
75
92
|
innerRef: import_ds_utilities.PropTypes.object.description("ref to the components container"),
|
|
76
93
|
title: import_ds_utilities.PropTypes.string.description("components title"),
|
|
77
94
|
variant: import_ds_utilities.PropTypes.oneOf(variants).description("Progress intent variation"),
|
|
@@ -80,7 +97,9 @@ const progressIndicatorProps = {
|
|
|
80
97
|
max: import_ds_utilities.PropTypes.number.description("max value"),
|
|
81
98
|
disabled: import_ds_utilities.PropTypes.bool.description("Whether the progress indicator disabled or not").defaultValue(false),
|
|
82
99
|
counterRenderer: import_ds_utilities.PropTypes.func.description("Render a custom counter"),
|
|
83
|
-
segments: import_ds_utilities.PropTypes.array.description(
|
|
100
|
+
segments: import_ds_utilities.PropTypes.array.description(
|
|
101
|
+
"An array of multiple progress objects"
|
|
102
|
+
),
|
|
84
103
|
style: import_ds_utilities.PropTypes.object.description("css inline style")
|
|
85
104
|
};
|
|
86
105
|
DSProgressIndicator.propTypes = progressIndicatorProps;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSProgressIndicator.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable react/no-array-index-key */\nimport React, { useMemo } from 'react';\nimport { describe, PropTypes } from '@elliemae/ds-utilities';\nimport DSTruncatedTooltipText from '@elliemae/ds-truncated-tooltip-text';\nimport Counter from './ProgressCounter';\nimport ProgressBar from './ProgressBar';\nimport { Title, Wrapper } from './classedComponents';\n\nconst DSProgressIndicator = ({\n containerProps = {},\n innerRef = () => null,\n title = '',\n counterRenderer = undefined,\n now = undefined,\n min = 0,\n max = undefined,\n disabled = false,\n segments = [],\n style = {},\n}) => {\n const renderProgressBar = useMemo(\n () =>\n segments.length ? (\n <ProgressBar>\n {segments.map(\n (segmentProps, i) =>\n !(segmentProps.now < segmentProps.min) && (\n <ProgressBar.Segment key={i} {...segmentProps} />\n ),\n )}\n </ProgressBar>\n ) : (\n <ProgressBar max={max} min={min} now={now} />\n ),\n [segments, min, max, now],\n );\n\n return (\n <Wrapper\n ref={innerRef}\n aria-disabled={disabled}\n classProps={{ disabled }}\n {...containerProps}\n style={style}\n >\n <DSTruncatedTooltipText containerComponent={Title} value={title} />\n <Counter max={max} min={min} now={now} renderer={counterRenderer} />\n {renderProgressBar}\n </Wrapper>\n );\n};\n\nconst variants = ['default', 'success', 'warning', 'info', 'error'];\n\nconst progressIndicatorProps = {\n containerProps: PropTypes.object.description(\n 'Set of Properties attached to the main container',\n ),\n innerRef: PropTypes.object.description('ref to the components container'),\n title: PropTypes.string.description('components title'),\n variant: PropTypes.oneOf(variants).description('Progress intent variation'),\n now: PropTypes.number.description('Total current value'),\n min: PropTypes.number.description('min value'),\n max: PropTypes.number.description('max value'),\n disabled: PropTypes.bool\n .description('Whether the progress indicator disabled or not')\n .defaultValue(false),\n counterRenderer: PropTypes.func.description('Render a custom counter'),\n segments: PropTypes.array.description(\n 'An array of multiple progress objects',\n ),\n style: PropTypes.object.description('css inline style'),\n};\n\nDSProgressIndicator.propTypes = progressIndicatorProps;\nDSProgressIndicator.displayName = 'DSProgressIndicator';\nconst ProgressIndicatorWithSchema = describe(DSProgressIndicator);\nProgressIndicatorWithSchema.propTypes = progressIndicatorProps;\n\nDSProgressIndicator.ProgressBar = ProgressBar;\n\nexport { DSProgressIndicator, ProgressIndicatorWithSchema };\nexport default DSProgressIndicator;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AACA,mBAA+B;AAC/B,0BAAoC;AACpC,uCAAmC;AACnC,6BAAoB;AACpB,yBAAwB;AACxB,+BAA+B;AAE/B,MAAM,sBAAsB,CAAC;AAAA,EAC3B,iBAAiB,CAAC;AAAA,EAClB,WAAW,MAAM;AAAA,EACjB,QAAQ;AAAA,EACR,kBAAkB;AAAA,EAClB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,WAAW;AAAA,EACX,WAAW,CAAC;AAAA,EACZ,QAAQ,CAAC;AACX,MAAM;AACJ,QAAM,wBAAoB;AAAA,IACxB,MACE,SAAS,SACP,4CAAC,mBAAAA,SAAA;AAAA,MACE,mBAAS;AAAA,QACR,CAAC,cAAc,MACb,EAAE,aAAa,MAAM,aAAa,QAChC,4CAAC,mBAAAA,QAAY,SAAZ;AAAA,UAA6B,GAAG;AAAA,WAAP,CAAqB;AAAA,MAErD;AAAA,KACF,IAEA,4CAAC,mBAAAA,SAAA;AAAA,MAAY;AAAA,MAAU;AAAA,MAAU;AAAA,KAAU;AAAA,IAE/C,CAAC,UAAU,KAAK,KAAK,GAAG;AAAA,EAC1B;A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-17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var ProgressBar_exports = {};
|
|
23
26
|
__export(ProgressBar_exports, {
|
|
@@ -25,7 +28,7 @@ __export(ProgressBar_exports, {
|
|
|
25
28
|
});
|
|
26
29
|
module.exports = __toCommonJS(ProgressBar_exports);
|
|
27
30
|
var React = __toESM(require("react"));
|
|
28
|
-
var
|
|
31
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
32
|
var import_prop_types = __toESM(require("prop-types"));
|
|
30
33
|
var import_utils = require("./utils");
|
|
31
34
|
var import_classedComponents = require("./classedComponents");
|
|
@@ -50,7 +53,7 @@ function useProgressTrait({
|
|
|
50
53
|
function Progress(props) {
|
|
51
54
|
const { variant = "default" } = props;
|
|
52
55
|
const progressTraitProps = useProgressTrait(props);
|
|
53
|
-
return /* @__PURE__ */
|
|
56
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_classedComponents.ProgressBarProgress, {
|
|
54
57
|
classProps: { variant },
|
|
55
58
|
...progressTraitProps
|
|
56
59
|
});
|
|
@@ -62,12 +65,14 @@ function ProgressBar({
|
|
|
62
65
|
max = void 0,
|
|
63
66
|
children: progressSegments
|
|
64
67
|
}) {
|
|
65
|
-
return /* @__PURE__ */
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_classedComponents.ProgressBarStatusBar, {
|
|
69
|
+
children: progressSegments || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Progress, {
|
|
70
|
+
max,
|
|
71
|
+
min,
|
|
72
|
+
now,
|
|
73
|
+
variant
|
|
74
|
+
})
|
|
75
|
+
});
|
|
71
76
|
}
|
|
72
77
|
ProgressBar.Segment = Progress;
|
|
73
78
|
ProgressBar.propTypes = {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ProgressBar.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { getPercentage } from './utils';\nimport { ProgressBarProgress, ProgressBarStatusBar } from './classedComponents';\n\nfunction useProgressTrait({\n now = undefined,\n min = undefined,\n max = undefined,\n text = '',\n}) {\n const percentage = getPercentage(now, min, max);\n return {\n role: 'progressbar',\n 'aria-valuenow': now,\n 'aria-valuemin': min,\n 'aria-valuemax': max,\n 'aria-valuetext': text,\n style: {\n width: `${percentage}%`,\n },\n };\n}\n\nfunction Progress(props) {\n const { variant = 'default' } = props;\n\n const progressTraitProps = useProgressTrait(props);\n\n return (\n <ProgressBarProgress classProps={{ variant }} {...progressTraitProps} />\n );\n}\n\nfunction ProgressBar({\n variant = 'default',\n now = undefined,\n min = undefined,\n max = undefined,\n children: progressSegments,\n}) {\n return (\n <ProgressBarStatusBar>\n {progressSegments || (\n <Progress max={max} min={min} now={now} variant={variant} />\n )}\n </ProgressBarStatusBar>\n );\n}\n\nProgressBar.Segment = Progress;\n\nProgressBar.propTypes = {\n /** Progress intent variation */\n variant: PropTypes.oneOf(['default', 'success', 'warning', 'info', 'error']),\n /** Total current value */\n now: PropTypes.number,\n /** Min value */\n min: PropTypes.number,\n /** Total max */\n max: PropTypes.number,\n};\n\nexport default ProgressBar;\n", "import * as React from 'react';\nexport { React };\n"],
|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+17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var ProgressCounter_exports = {};
|
|
23
26
|
__export(ProgressCounter_exports, {
|
|
@@ -25,7 +28,7 @@ __export(ProgressCounter_exports, {
|
|
|
25
28
|
});
|
|
26
29
|
module.exports = __toCommonJS(ProgressCounter_exports);
|
|
27
30
|
var React = __toESM(require("react"));
|
|
28
|
-
var
|
|
31
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
29
32
|
var import_utils = require("./utils");
|
|
30
33
|
var import_classedComponents = require("./classedComponents");
|
|
31
34
|
const defaultRenderer = ({ now, max, min }) => `${min || now} of ${max}`;
|
|
@@ -38,7 +41,9 @@ const renderers = {
|
|
|
38
41
|
percentage: percentageRenderer
|
|
39
42
|
};
|
|
40
43
|
function ProgressCounter({ now, max, min, renderer = renderers.default }) {
|
|
41
|
-
return /* @__PURE__ */
|
|
44
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_classedComponents.ProgressIndicatorCounter, {
|
|
45
|
+
children: renderer({ now, max, min })
|
|
46
|
+
});
|
|
42
47
|
}
|
|
43
48
|
var ProgressCounter_default = ProgressCounter;
|
|
44
49
|
//# sourceMappingURL=ProgressCounter.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ProgressCounter.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport { getPercentage } from './utils';\nimport { ProgressIndicatorCounter } from './classedComponents';\n\nconst defaultRenderer = ({ now, max, min }) => `${min || now} of ${max}`;\nconst percentageRenderer = ({ now, max, min }) => {\n const percentage = getPercentage(now, min, max);\n return `${percentage}%`;\n};\n\nconst renderers = {\n default: defaultRenderer,\n percentage: percentageRenderer,\n};\n\nfunction ProgressCounter({ now, max, min, renderer = renderers.default }) {\n return (\n <ProgressIndicatorCounter>\n {renderer({ now, max, min })}\n </ProgressIndicatorCounter>\n );\n}\n\nexport default ProgressCounter;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB;AACA,mBAA8B;AAC9B,+BAAyC;AAEzC,MAAM,kBAAkB,CAAC,EAAE,KAAK,KAAK,IAAI,MAAM,GAAG,OAAO,UAAU;AACnE,MAAM,qBAAqB,CAAC,EAAE,KAAK,KAAK,IAAI,MAAM;AAChD,QAAM,iBAAa,4BAAc,KAAK,KAAK,GAAG;AAC9C,SAAO,GAAG;AACZ;AAEA,MAAM,YAAY;AAAA,EAChB,SAAS;AAAA,EACT,YAAY;AACd;AAEA,SAAS,gBAAgB,EAAE,KAAK,KAAK,KAAK,WAAW,UAAU,QAAQ,GAAG;AACxE,SACE,4CAAC;AAAA,IACE,mBAAS,EAAE,KAAK,KAAK,IAAI,CAAC;AAAA,GAC7B;AAEJ;AAEA,IAAO,0BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var classedComponents_exports = {};
|
|
23
26
|
__export(classedComponents_exports, {
|
|
@@ -33,9 +36,20 @@ var React = __toESM(require("react"));
|
|
|
33
36
|
var import_ds_classnames = require("@elliemae/ds-classnames");
|
|
34
37
|
const blockName = "determinate-progress-indicator";
|
|
35
38
|
const progressBlockName = "progress-bar";
|
|
36
|
-
const Wrapper = (0, import_ds_classnames.aggregatedClasses)("div")(
|
|
39
|
+
const Wrapper = (0, import_ds_classnames.aggregatedClasses)("div")(
|
|
40
|
+
blockName,
|
|
41
|
+
null,
|
|
42
|
+
({ disabled }) => ({ disabled })
|
|
43
|
+
);
|
|
37
44
|
const Title = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "title");
|
|
38
|
-
const ProgressIndicatorCounter = (0, import_ds_classnames.aggregatedClasses)("span")(
|
|
45
|
+
const ProgressIndicatorCounter = (0, import_ds_classnames.aggregatedClasses)("span")(
|
|
46
|
+
blockName,
|
|
47
|
+
"counter"
|
|
48
|
+
);
|
|
39
49
|
const ProgressBarStatusBar = (0, import_ds_classnames.aggregatedClasses)("div")(progressBlockName);
|
|
40
|
-
const ProgressBarProgress = (0, import_ds_classnames.aggregatedClasses)("div")(
|
|
50
|
+
const ProgressBarProgress = (0, import_ds_classnames.aggregatedClasses)("div")(
|
|
51
|
+
progressBlockName,
|
|
52
|
+
"progress",
|
|
53
|
+
({ variant }) => ({ [variant]: true })
|
|
54
|
+
);
|
|
41
55
|
//# sourceMappingURL=classedComponents.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/classedComponents.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import { aggregatedClasses } from '@elliemae/ds-classnames';\n\nexport const blockName = 'determinate-progress-indicator';\nconst progressBlockName = 'progress-bar';\n\nexport const Wrapper = aggregatedClasses('div')(\n blockName,\n null,\n ({ disabled }) => ({ disabled }),\n);\nexport const Title = aggregatedClasses('div')(blockName, 'title');\nexport const ProgressIndicatorCounter = aggregatedClasses('span')(\n blockName,\n 'counter',\n);\nexport const ProgressBarStatusBar = aggregatedClasses('div')(progressBlockName);\nexport const ProgressBarProgress = aggregatedClasses('div')(\n progressBlockName,\n 'progress',\n ({ variant }) => ({ [variant]: true }),\n);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,2BAAkC;AAE3B,MAAM,YAAY;AACzB,MAAM,oBAAoB;AAEnB,MAAM,cAAU,wCAAkB,KAAK;AAAA,EAC5C;AAAA,EACA;AAAA,EACA,CAAC,EAAE,SAAS,OAAO,EAAE,SAAS;AAChC;AACO,MAAM,YAAQ,wCAAkB,KAAK,EAAE,WAAW,OAAO;AACzD,MAAM,+BAA2B,wCAAkB,MAAM;AAAA,EAC9D;AAAA,EACA;AACF;AACO,MAAM,2BAAuB,wCAAkB,KAAK,EAAE,iBAAiB;AACvE,MAAM,0BAAsB,wCAAkB,KAAK;AAAA,EACxD;AAAA,EACA;AAAA,EACA,CAAC,EAAE,QAAQ,OAAO,EAAE,CAAC,UAAU,KAAK;AACtC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -18,7 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
23
|
+
mod
|
|
24
|
+
));
|
|
22
25
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
26
|
var src_exports = {};
|
|
24
27
|
__export(src_exports, {
|
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 './DSProgressIndicator';\nexport { default } from './DSProgressIndicator';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc,kCAAd;AACA,iCAAwB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/utils.js
CHANGED
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
var utils_exports = {};
|
|
23
26
|
__export(utils_exports, {
|
package/dist/cjs/utils.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export function getPercentage(now, min, max) {\n return ((now || min) / max) * 100;\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,SAAS,cAAc,KAAK,KAAK,KAAK;AAC3C,UAAS,OAAO,OAAO,MAAO;AAChC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo } from "react";
|
|
3
4
|
import { describe, PropTypes } from "@elliemae/ds-utilities";
|
|
4
5
|
import DSTruncatedTooltipText from "@elliemae/ds-truncated-tooltip-text";
|
|
5
6
|
import Counter from "./ProgressCounter";
|
|
@@ -17,33 +18,46 @@ const DSProgressIndicator = ({
|
|
|
17
18
|
segments = [],
|
|
18
19
|
style = {}
|
|
19
20
|
}) => {
|
|
20
|
-
const renderProgressBar = useMemo(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
const renderProgressBar = useMemo(
|
|
22
|
+
() => segments.length ? /* @__PURE__ */ jsx(ProgressBar, {
|
|
23
|
+
children: segments.map(
|
|
24
|
+
(segmentProps, i) => !(segmentProps.now < segmentProps.min) && /* @__PURE__ */ jsx(ProgressBar.Segment, {
|
|
25
|
+
...segmentProps
|
|
26
|
+
}, i)
|
|
27
|
+
)
|
|
28
|
+
}) : /* @__PURE__ */ jsx(ProgressBar, {
|
|
29
|
+
max,
|
|
30
|
+
min,
|
|
31
|
+
now
|
|
32
|
+
}),
|
|
33
|
+
[segments, min, max, now]
|
|
34
|
+
);
|
|
35
|
+
return /* @__PURE__ */ jsxs(Wrapper, {
|
|
29
36
|
ref: innerRef,
|
|
30
37
|
"aria-disabled": disabled,
|
|
31
38
|
classProps: { disabled },
|
|
32
39
|
...containerProps,
|
|
33
|
-
style
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
style,
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ jsx(DSTruncatedTooltipText, {
|
|
43
|
+
containerComponent: Title,
|
|
44
|
+
value: title
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ jsx(Counter, {
|
|
47
|
+
max,
|
|
48
|
+
min,
|
|
49
|
+
now,
|
|
50
|
+
renderer: counterRenderer
|
|
51
|
+
}),
|
|
52
|
+
renderProgressBar
|
|
53
|
+
]
|
|
54
|
+
});
|
|
43
55
|
};
|
|
44
56
|
const variants = ["default", "success", "warning", "info", "error"];
|
|
45
57
|
const progressIndicatorProps = {
|
|
46
|
-
containerProps: PropTypes.object.description(
|
|
58
|
+
containerProps: PropTypes.object.description(
|
|
59
|
+
"Set of Properties attached to the main container"
|
|
60
|
+
),
|
|
47
61
|
innerRef: PropTypes.object.description("ref to the components container"),
|
|
48
62
|
title: PropTypes.string.description("components title"),
|
|
49
63
|
variant: PropTypes.oneOf(variants).description("Progress intent variation"),
|
|
@@ -52,7 +66,9 @@ const progressIndicatorProps = {
|
|
|
52
66
|
max: PropTypes.number.description("max value"),
|
|
53
67
|
disabled: PropTypes.bool.description("Whether the progress indicator disabled or not").defaultValue(false),
|
|
54
68
|
counterRenderer: PropTypes.func.description("Render a custom counter"),
|
|
55
|
-
segments: PropTypes.array.description(
|
|
69
|
+
segments: PropTypes.array.description(
|
|
70
|
+
"An array of multiple progress objects"
|
|
71
|
+
),
|
|
56
72
|
style: PropTypes.object.description("css inline style")
|
|
57
73
|
};
|
|
58
74
|
DSProgressIndicator.propTypes = progressIndicatorProps;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSProgressIndicator.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/no-array-index-key */\nimport React, { useMemo } from 'react';\nimport { describe, PropTypes } from '@elliemae/ds-utilities';\nimport DSTruncatedTooltipText from '@elliemae/ds-truncated-tooltip-text';\nimport Counter from './ProgressCounter';\nimport ProgressBar from './ProgressBar';\nimport { Title, Wrapper } from './classedComponents';\n\nconst DSProgressIndicator = ({\n containerProps = {},\n innerRef = () => null,\n title = '',\n counterRenderer = undefined,\n now = undefined,\n min = 0,\n max = undefined,\n disabled = false,\n segments = [],\n style = {},\n}) => {\n const renderProgressBar = useMemo(\n () =>\n segments.length ? (\n <ProgressBar>\n {segments.map(\n (segmentProps, i) =>\n !(segmentProps.now < segmentProps.min) && (\n <ProgressBar.Segment key={i} {...segmentProps} />\n ),\n )}\n </ProgressBar>\n ) : (\n <ProgressBar max={max} min={min} now={now} />\n ),\n [segments, min, max, now],\n );\n\n return (\n <Wrapper\n ref={innerRef}\n aria-disabled={disabled}\n classProps={{ disabled }}\n {...containerProps}\n style={style}\n >\n <DSTruncatedTooltipText containerComponent={Title} value={title} />\n <Counter max={max} min={min} now={now} renderer={counterRenderer} />\n {renderProgressBar}\n </Wrapper>\n );\n};\n\nconst variants = ['default', 'success', 'warning', 'info', 'error'];\n\nconst progressIndicatorProps = {\n containerProps: PropTypes.object.description(\n 'Set of Properties attached to the main container',\n ),\n innerRef: PropTypes.object.description('ref to the components container'),\n title: PropTypes.string.description('components title'),\n variant: PropTypes.oneOf(variants).description('Progress intent variation'),\n now: PropTypes.number.description('Total current value'),\n min: PropTypes.number.description('min value'),\n max: PropTypes.number.description('max value'),\n disabled: PropTypes.bool\n .description('Whether the progress indicator disabled or not')\n .defaultValue(false),\n counterRenderer: PropTypes.func.description('Render a custom counter'),\n segments: PropTypes.array.description(\n 'An array of multiple progress objects',\n ),\n style: PropTypes.object.description('css inline style'),\n};\n\nDSProgressIndicator.propTypes = progressIndicatorProps;\nDSProgressIndicator.displayName = 'DSProgressIndicator';\nconst ProgressIndicatorWithSchema = describe(DSProgressIndicator);\nProgressIndicatorWithSchema.propTypes = progressIndicatorProps;\n\nDSProgressIndicator.ProgressBar = ProgressBar;\n\nexport { DSProgressIndicator, ProgressIndicatorWithSchema };\nexport default DSProgressIndicator;\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AACA,SAAgB,eAAe;AAC/B,SAAS,UAAU,iBAAiB;AACpC,OAAO,4BAA4B;AACnC,OAAO,aAAa;AACpB,OAAO,iBAAiB;AACxB,SAAS,OAAO,eAAe;AAE/B,MAAM,sBAAsB,CAAC;AAAA,EAC3B,iBAAiB,CAAC;AAAA,EAClB,WAAW,MAAM;AAAA,EACjB,QAAQ;AAAA,EACR,kBAAkB;AAAA,EAClB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,WAAW;AAAA,EACX,WAAW,CAAC;AAAA,EACZ,QAAQ,CAAC;AACX,MAAM;AACJ,QAAM,oBAAoB;AAAA,IACxB,MACE,SAAS,SACP,oBAAC;AAAA,MACE,mBAAS;AAAA,QACR,CAAC,cAAc,MACb,EAAE,aAAa,MAAM,aAAa,QAChC,oBAAC,YAAY,SAAZ;AAAA,UAA6B,GAAG;AAAA,WAAP,CAAqB;AAAA,MAErD;AAAA,KACF,IAEA,oBAAC;AAAA,MAAY;AAAA,MAAU;AAAA,MAAU;AAAA,KAAU;AAAA,IAE/C,CAAC,UAAU,KAAK,KAAK,GA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{ jsx } from "react/jsx-runtime";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { getPercentage } from "./utils";
|
|
5
5
|
import { ProgressBarProgress, ProgressBarStatusBar } from "./classedComponents";
|
|
@@ -24,7 +24,7 @@ function useProgressTrait({
|
|
|
24
24
|
function Progress(props) {
|
|
25
25
|
const { variant = "default" } = props;
|
|
26
26
|
const progressTraitProps = useProgressTrait(props);
|
|
27
|
-
return /* @__PURE__ */
|
|
27
|
+
return /* @__PURE__ */ jsx(ProgressBarProgress, {
|
|
28
28
|
classProps: { variant },
|
|
29
29
|
...progressTraitProps
|
|
30
30
|
});
|
|
@@ -36,12 +36,14 @@ function ProgressBar({
|
|
|
36
36
|
max = void 0,
|
|
37
37
|
children: progressSegments
|
|
38
38
|
}) {
|
|
39
|
-
return /* @__PURE__ */
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
return /* @__PURE__ */ jsx(ProgressBarStatusBar, {
|
|
40
|
+
children: progressSegments || /* @__PURE__ */ jsx(Progress, {
|
|
41
|
+
max,
|
|
42
|
+
min,
|
|
43
|
+
now,
|
|
44
|
+
variant
|
|
45
|
+
})
|
|
46
|
+
});
|
|
45
47
|
}
|
|
46
48
|
ProgressBar.Segment = Progress;
|
|
47
49
|
ProgressBar.propTypes = {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/ProgressBar.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport PropTypes from 'prop-types';\nimport { getPercentage } from './utils';\nimport { ProgressBarProgress, ProgressBarStatusBar } from './classedComponents';\n\nfunction useProgressTrait({\n now = undefined,\n min = undefined,\n max = undefined,\n text = '',\n}) {\n const percentage = getPercentage(now, min, max);\n return {\n role: 'progressbar',\n 'aria-valuenow': now,\n 'aria-valuemin': min,\n 'aria-valuemax': max,\n 'aria-valuetext': text,\n style: {\n width: `${percentage}%`,\n },\n };\n}\n\nfunction Progress(props) {\n const { variant = 'default' } = props;\n\n const progressTraitProps = useProgressTrait(props);\n\n return (\n <ProgressBarProgress classProps={{ variant }} {...progressTraitProps} />\n );\n}\n\nfunction ProgressBar({\n variant = 'default',\n now = undefined,\n min = undefined,\n max = undefined,\n children: progressSegments,\n}) {\n return (\n <ProgressBarStatusBar>\n {progressSegments || (\n <Progress max={max} min={min} now={now} variant={variant} />\n )}\n </ProgressBarStatusBar>\n );\n}\n\nProgressBar.Segment = Progress;\n\nProgressBar.propTypes = {\n /** Progress intent variation */\n variant: PropTypes.oneOf(['default', 'success', 'warning', 'info', 'error']),\n /** Total current value */\n now: PropTypes.number,\n /** Min value */\n min: PropTypes.number,\n /** Total max */\n max: PropTypes.number,\n};\n\nexport default ProgressBar;\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AACA,OAAO,eAAe;AACtB,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB,4BAA4B;AAE1D,SAAS,iBAAiB;AAAA,EACxB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AACT,GAAG;AACD,QAAM,aAAa,cAAc,KAAK,KAAK,GAAG;AAC9C,SAAO;AAAA,IACL,MAAM;AAAA,IACN,iBAAiB;AAAA,IACjB,iBAAiB;AAAA,IACjB,iBAAiB;AAAA,IACjB,kBAAkB;AAAA,IAClB,OAAO;AAAA,MACL,OAAO,GAAG;AAAA,IACZ;AAAA,EACF;AACF;AAEA,SAAS,SAAS,OAAO;AACvB,QAAM,EAAE,UAAU,UAAU,IAAI;AAEhC,QAAM,qBAAqB,iBAAiB,KAAK;AAEjD,SACE,oBAAC;AAAA,IAAoB,YAAY,EAAE,QAAQ;AAAA,IAAI,GAAG;AAAA,GAAoB;AAE1E;AAEA,SAAS,YAAY;AAAA,EACnB,UAAU;AAAA,EACV,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,UAAU;AACZ,GAAG;AACD,SACE,oBAAC;AAAA,IACE,8BACC,oBAAC;AAAA,MAAS;AAAA,MAAU;AAAA,MAAU;AAAA,MAAU;AAAA,KAAkB;AAAA,GAE9D;AAEJ;AAEA,YAAY,UAAU;AAEtB,YAAY,YAAY;AAAA,EAEtB,SAAS,UAAU,MAAM,CAAC,WAAW,WAAW,WAAW,QAAQ,OAAO,CAAC;AAAA,EAE3E,KAAK,UAAU;AAAA,EAEf,KAAK,UAAU;AAAA,EAEf,KAAK,UAAU;AACjB;AAEA,IAAO,sBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { getPercentage } from "./utils";
|
|
4
4
|
import { ProgressIndicatorCounter } from "./classedComponents";
|
|
5
5
|
const defaultRenderer = ({ now, max, min }) => `${min || now} of ${max}`;
|
|
@@ -12,7 +12,9 @@ const renderers = {
|
|
|
12
12
|
percentage: percentageRenderer
|
|
13
13
|
};
|
|
14
14
|
function ProgressCounter({ now, max, min, renderer = renderers.default }) {
|
|
15
|
-
return /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ jsx(ProgressIndicatorCounter, {
|
|
16
|
+
children: renderer({ now, max, min })
|
|
17
|
+
});
|
|
16
18
|
}
|
|
17
19
|
var ProgressCounter_default = ProgressCounter;
|
|
18
20
|
export {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/ProgressCounter.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { getPercentage } from './utils';\nimport { ProgressIndicatorCounter } from './classedComponents';\n\nconst defaultRenderer = ({ now, max, min }) => `${min || now} of ${max}`;\nconst percentageRenderer = ({ now, max, min }) => {\n const percentage = getPercentage(now, min, max);\n return `${percentage}%`;\n};\n\nconst renderers = {\n default: defaultRenderer,\n percentage: percentageRenderer,\n};\n\nfunction ProgressCounter({ now, max, min, renderer = renderers.default }) {\n return (\n <ProgressIndicatorCounter>\n {renderer({ now, max, min })}\n </ProgressIndicatorCounter>\n );\n}\n\nexport default ProgressCounter;\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB;AACA,SAAS,qBAAqB;AAC9B,SAAS,gCAAgC;AAEzC,MAAM,kBAAkB,CAAC,EAAE,KAAK,KAAK,IAAI,MAAM,GAAG,OAAO,UAAU;AACnE,MAAM,qBAAqB,CAAC,EAAE,KAAK,KAAK,IAAI,MAAM;AAChD,QAAM,aAAa,cAAc,KAAK,KAAK,GAAG;AAC9C,SAAO,GAAG;AACZ;AAEA,MAAM,YAAY;AAAA,EAChB,SAAS;AAAA,EACT,YAAY;AACd;AAEA,SAAS,gBAAgB,EAAE,KAAK,KAAK,KAAK,WAAW,UAAU,QAAQ,GAAG;AACxE,SACE,oBAAC;AAAA,IACE,mBAAS,EAAE,KAAK,KAAK,IAAI,CAAC;AAAA,GAC7B;AAEJ;AAEA,IAAO,0BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,11 +2,22 @@ import * as React from "react";
|
|
|
2
2
|
import { aggregatedClasses } from "@elliemae/ds-classnames";
|
|
3
3
|
const blockName = "determinate-progress-indicator";
|
|
4
4
|
const progressBlockName = "progress-bar";
|
|
5
|
-
const Wrapper = aggregatedClasses("div")(
|
|
5
|
+
const Wrapper = aggregatedClasses("div")(
|
|
6
|
+
blockName,
|
|
7
|
+
null,
|
|
8
|
+
({ disabled }) => ({ disabled })
|
|
9
|
+
);
|
|
6
10
|
const Title = aggregatedClasses("div")(blockName, "title");
|
|
7
|
-
const ProgressIndicatorCounter = aggregatedClasses("span")(
|
|
11
|
+
const ProgressIndicatorCounter = aggregatedClasses("span")(
|
|
12
|
+
blockName,
|
|
13
|
+
"counter"
|
|
14
|
+
);
|
|
8
15
|
const ProgressBarStatusBar = aggregatedClasses("div")(progressBlockName);
|
|
9
|
-
const ProgressBarProgress = aggregatedClasses("div")(
|
|
16
|
+
const ProgressBarProgress = aggregatedClasses("div")(
|
|
17
|
+
progressBlockName,
|
|
18
|
+
"progress",
|
|
19
|
+
({ variant }) => ({ [variant]: true })
|
|
20
|
+
);
|
|
10
21
|
export {
|
|
11
22
|
ProgressBarProgress,
|
|
12
23
|
ProgressBarStatusBar,
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/classedComponents.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { aggregatedClasses } from '@elliemae/ds-classnames';\n\nexport const blockName = 'determinate-progress-indicator';\nconst progressBlockName = 'progress-bar';\n\nexport const Wrapper = aggregatedClasses('div')(\n blockName,\n null,\n ({ disabled }) => ({ disabled }),\n);\nexport const Title = aggregatedClasses('div')(blockName, 'title');\nexport const ProgressIndicatorCounter = aggregatedClasses('span')(\n blockName,\n 'counter',\n);\nexport const ProgressBarStatusBar = aggregatedClasses('div')(progressBlockName);\nexport const ProgressBarProgress = aggregatedClasses('div')(\n progressBlockName,\n 'progress',\n ({ variant }) => ({ [variant]: true }),\n);\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,yBAAyB;AAE3B,MAAM,YAAY;AACzB,MAAM,oBAAoB;AAEnB,MAAM,UAAU,kBAAkB,KAAK;AAAA,EAC5C;AAAA,EACA;AAAA,EACA,CAAC,EAAE,SAAS,OAAO,EAAE,SAAS;AAChC;AACO,MAAM,QAAQ,kBAAkB,KAAK,EAAE,WAAW,OAAO;AACzD,MAAM,2BAA2B,kBAAkB,MAAM;AAAA,EAC9D;AAAA,EACA;AACF;AACO,MAAM,uBAAuB,kBAAkB,KAAK,EAAE,iBAAiB;AACvE,MAAM,sBAAsB,kBAAkB,KAAK;AAAA,EACxD;AAAA,EACA;AAAA,EACA,CAAC,EAAE,QAAQ,OAAO,EAAE,CAAC,UAAU,KAAK;AACtC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSProgressIndicator';\nexport { default } from './DSProgressIndicator';\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,SAAS,WAAAA,gBAAe;",
|
|
6
|
+
"names": ["default"]
|
|
7
7
|
}
|
package/dist/esm/utils.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/utils.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export function getPercentage(now, min, max) {\n return ((now || min) / max) * 100;\n}\n"],
|
|
5
|
-
"mappings": "AAAA;
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAhB,SAAS,cAAc,KAAK,KAAK,KAAK;AAC3C,UAAS,OAAO,OAAO,MAAO;AAChC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-progress-indicator",
|
|
3
|
-
"version": "3.4.3
|
|
3
|
+
"version": "3.4.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Progress Indicator",
|
|
6
6
|
"files": [
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"indent": 4
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@elliemae/ds-classnames": "3.4.3
|
|
59
|
-
"@elliemae/ds-truncated-tooltip-text": "3.4.3
|
|
60
|
-
"@elliemae/ds-utilities": "3.4.3
|
|
58
|
+
"@elliemae/ds-classnames": "3.4.3",
|
|
59
|
+
"@elliemae/ds-truncated-tooltip-text": "3.4.3",
|
|
60
|
+
"@elliemae/ds-utilities": "3.4.3",
|
|
61
61
|
"prop-types": "~15.8.1"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|