@elliemae/ds-indeterminate-progress-indicator 3.22.0-next.3 → 3.22.0-next.30

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.
Files changed (28) hide show
  1. package/dist/cjs/DSIndeterminateProgressIndicator.js +20 -53
  2. package/dist/cjs/DSIndeterminateProgressIndicator.js.map +3 -3
  3. package/dist/cjs/config/useIndeterminateProgressIndicator.js +78 -0
  4. package/dist/cjs/config/useIndeterminateProgressIndicator.js.map +7 -0
  5. package/dist/cjs/config/useValidateProps.js +40 -0
  6. package/dist/cjs/config/useValidateProps.js.map +7 -0
  7. package/dist/cjs/constants/index.js +36 -0
  8. package/dist/cjs/constants/index.js.map +7 -0
  9. package/dist/cjs/index.js.map +1 -1
  10. package/dist/cjs/react-desc-prop-types.js +65 -0
  11. package/dist/cjs/react-desc-prop-types.js.map +7 -0
  12. package/dist/esm/DSIndeterminateProgressIndicator.js +23 -54
  13. package/dist/esm/DSIndeterminateProgressIndicator.js.map +3 -3
  14. package/dist/esm/config/useIndeterminateProgressIndicator.js +51 -0
  15. package/dist/esm/config/useIndeterminateProgressIndicator.js.map +7 -0
  16. package/dist/esm/config/useValidateProps.js +10 -0
  17. package/dist/esm/config/useValidateProps.js.map +7 -0
  18. package/dist/esm/constants/index.js +6 -0
  19. package/dist/esm/constants/index.js.map +7 -0
  20. package/dist/esm/index.js.map +1 -1
  21. package/dist/esm/react-desc-prop-types.js +35 -0
  22. package/dist/esm/react-desc-prop-types.js.map +7 -0
  23. package/dist/types/DSIndeterminateProgressIndicator.d.ts +4 -59
  24. package/dist/types/config/useIndeterminateProgressIndicator.d.ts +8 -0
  25. package/dist/types/config/useValidateProps.d.ts +3 -0
  26. package/dist/types/constants/index.d.ts +1 -0
  27. package/dist/types/react-desc-prop-types.d.ts +27 -0
  28. package/package.json +12 -12
@@ -35,33 +35,28 @@ __export(DSIndeterminateProgressIndicator_exports, {
35
35
  module.exports = __toCommonJS(DSIndeterminateProgressIndicator_exports);
36
36
  var React = __toESM(require("react"));
37
37
  var import_jsx_runtime = require("react/jsx-runtime");
38
- var import_react = require("react");
39
38
  var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
39
+ var import_react_desc_prop_types = require("./react-desc-prop-types.js");
40
+ var import_useIndeterminateProgressIndicator = require("./config/useIndeterminateProgressIndicator.js");
41
+ var import_constants = require("./constants/index.js");
40
42
  var import_ds_classnames = require("@elliemae/ds-classnames");
41
43
  var import_ds_truncated_tooltip_text = __toESM(require("@elliemae/ds-truncated-tooltip-text"));
42
44
  const { cssClassName, classNameBlock, classNameElement } = (0, import_ds_classnames.convertPropToCssClassName)(
43
45
  "indeterminate-progress-indicator"
44
46
  );
45
- const DSIndeterminateProgressIndicator = ({
46
- containerProps,
47
- title,
48
- complete,
49
- failed,
50
- processing,
51
- processingComplete,
52
- processingCompleteTitle,
53
- processingFail,
54
- processingFailTitle,
55
- animated,
56
- percent,
57
- lineOnly
58
- }) => {
59
- const [label, setLabel] = (0, import_react.useState)(title);
60
- (0, import_react.useEffect)(() => {
61
- if ((processingComplete || processingFail || processing) && (complete || failed)) {
62
- setLabel(complete ? processingCompleteTitle : processingFailTitle);
63
- }
64
- }, [failed, complete, processingComplete, processingFail, processing]);
47
+ const DSIndeterminateProgressIndicator = (props) => {
48
+ const { propsWithDefault, label } = (0, import_useIndeterminateProgressIndicator.useIndeterminateProgressIndicator)(props);
49
+ const {
50
+ containerProps,
51
+ complete,
52
+ failed,
53
+ processing,
54
+ processingComplete,
55
+ processingFail,
56
+ animated,
57
+ percent,
58
+ lineOnly
59
+ } = propsWithDefault;
65
60
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
66
61
  "div",
67
62
  {
@@ -72,7 +67,7 @@ const DSIndeterminateProgressIndicator = ({
72
67
  failed ? classNameBlock("failed") : ""} ${processing ? classNameBlock("processing") : ""} ${animated && processing ? "animated" : ""}
73
68
  ${processingComplete ? classNameBlock("processing-complete") : ""}
74
69
  ${processingFail ? classNameBlock("processing-fail") : ""}
75
- ${lineOnly ? "line-only" : null}
70
+ ${lineOnly ? "line-only" : ""}
76
71
  `,
77
72
  role: "alert",
78
73
  ...containerProps,
@@ -91,37 +86,9 @@ const DSIndeterminateProgressIndicator = ({
91
86
  }
92
87
  );
93
88
  };
94
- DSIndeterminateProgressIndicator.defaultProps = {
95
- containerProps: {},
96
- title: "",
97
- complete: false,
98
- failed: false,
99
- processing: false,
100
- processingComplete: false,
101
- processingCompleteTitle: "Complete",
102
- processingFail: false,
103
- processingFailTitle: "Fail",
104
- animated: true,
105
- percent: 50,
106
- lineOnly: false
107
- };
108
- const indeterminateProgressIndicatorProps = {
109
- containerProps: import_ds_props_helpers.PropTypes.object.description("Set of Properties attached to the main container"),
110
- title: import_ds_props_helpers.PropTypes.string.description("component s label"),
111
- processingCompleteTitle: import_ds_props_helpers.PropTypes.string.description("label to display when the process is completed"),
112
- processingFailTitle: import_ds_props_helpers.PropTypes.string.description("label to display when the process has failed"),
113
- complete: import_ds_props_helpers.PropTypes.bool.description("Sets the process state to completed").defaultValue(false),
114
- failed: import_ds_props_helpers.PropTypes.bool.description("Sets the process state to failed").defaultValue(false),
115
- processing: import_ds_props_helpers.PropTypes.bool.description("Sets the process state to processing").defaultValue(false),
116
- processingComplete: import_ds_props_helpers.PropTypes.bool.description("Sets the process state to processing and then completed").defaultValue(false),
117
- processingFail: import_ds_props_helpers.PropTypes.bool.description("Sets the process state to processing and then failed").defaultValue(false),
118
- animated: import_ds_props_helpers.PropTypes.bool.description("animate or not").defaultValue(true),
119
- percent: import_ds_props_helpers.PropTypes.number.description("completion percentage").defaultValue(50),
120
- lineOnly: import_ds_props_helpers.PropTypes.bool.description("hide the label from rendering")
121
- };
122
- DSIndeterminateProgressIndicator.propTypes = indeterminateProgressIndicatorProps;
123
- DSIndeterminateProgressIndicator.displayName = "DSIndeterminateProgressIndicator";
89
+ DSIndeterminateProgressIndicator.propTypes = import_react_desc_prop_types.DSIndeterminateProgressIndicatorPropTypes;
90
+ DSIndeterminateProgressIndicator.displayName = import_constants.DSIndeterminateProgressIndicatorName;
124
91
  const IndeterminateProgressIndicatorWithSchema = (0, import_ds_props_helpers.describe)(DSIndeterminateProgressIndicator);
125
- IndeterminateProgressIndicatorWithSchema.propTypes = indeterminateProgressIndicatorProps;
92
+ IndeterminateProgressIndicatorWithSchema.propTypes = import_react_desc_prop_types.DSIndeterminateProgressIndicatorPropTypes;
126
93
  var DSIndeterminateProgressIndicator_default = DSIndeterminateProgressIndicator;
127
94
  //# sourceMappingURL=DSIndeterminateProgressIndicator.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/DSIndeterminateProgressIndicator.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable complexity */\n/* eslint-disable react/require-default-props */\nimport React, { useEffect, useState } from 'react';\nimport { describe, PropTypes } from '@elliemae/ds-props-helpers';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport DSTruncatedTooltipText from '@elliemae/ds-truncated-tooltip-text';\n\nconst { cssClassName, classNameBlock, classNameElement } = convertPropToCssClassName(\n 'indeterminate-progress-indicator',\n);\n\nconst DSIndeterminateProgressIndicator = ({\n containerProps,\n title,\n complete,\n failed,\n processing,\n processingComplete,\n processingCompleteTitle,\n processingFail,\n processingFailTitle,\n animated,\n percent,\n lineOnly,\n}) => {\n const [label, setLabel] = useState(title);\n useEffect(() => {\n if ((processingComplete || processingFail || processing) && (complete || failed)) {\n setLabel(complete ? processingCompleteTitle : processingFailTitle);\n }\n }, [failed, complete, processingComplete, processingFail, processing]);\n return (\n <div\n aria-busy={processing}\n aria-label={label}\n aria-live=\"polite\"\n className={`${cssClassName} ${!complete && !failed && !processing ? classNameBlock('default') : ''} ${\n complete ? classNameBlock('complete') : ''\n } ${\n // eslint-disable-next-line max-len\n failed ? classNameBlock('failed') : ''\n } ${processing ? classNameBlock('processing') : ''} ${animated && processing ? 'animated' : ''} \n ${processingComplete ? classNameBlock('processing-complete') : ''} \n ${processingFail ? classNameBlock('processing-fail') : ''} \n ${lineOnly ? 'line-only' : null}\n `}\n role=\"alert\"\n {...containerProps}\n >\n {!lineOnly ? (\n <DSTruncatedTooltipText className={classNameBlock('tooltip-text')} containerComponent={<div />} value={label} />\n ) : null}\n <div className={`${classNameElement('bar')}`}>\n <div\n className={`${classNameElement('bar-indicator')}`}\n style={{\n width: `${!complete && !failed && !animated && processing ? percent : 100}%`,\n }}\n />\n </div>\n </div>\n );\n};\n\nDSIndeterminateProgressIndicator.defaultProps = {\n containerProps: {},\n title: '',\n complete: false,\n failed: false,\n processing: false,\n processingComplete: false,\n processingCompleteTitle: 'Complete',\n processingFail: false,\n processingFailTitle: 'Fail',\n animated: true,\n percent: 50,\n lineOnly: false,\n};\n\nconst indeterminateProgressIndicatorProps = {\n containerProps: PropTypes.object.description('Set of Properties attached to the main container'),\n title: PropTypes.string.description('component s label'),\n processingCompleteTitle: PropTypes.string.description('label to display when the process is completed'),\n processingFailTitle: PropTypes.string.description('label to display when the process has failed'),\n complete: PropTypes.bool.description('Sets the process state to completed').defaultValue(false),\n failed: PropTypes.bool.description('Sets the process state to failed').defaultValue(false),\n processing: PropTypes.bool.description('Sets the process state to processing').defaultValue(false),\n processingComplete: PropTypes.bool\n .description('Sets the process state to processing and then completed')\n .defaultValue(false),\n processingFail: PropTypes.bool\n .description('Sets the process state to processing and then failed')\n .defaultValue(false),\n animated: PropTypes.bool.description('animate or not').defaultValue(true),\n percent: PropTypes.number.description('completion percentage').defaultValue(50),\n lineOnly: PropTypes.bool.description('hide the label from rendering'),\n};\n\nDSIndeterminateProgressIndicator.propTypes = indeterminateProgressIndicatorProps;\nDSIndeterminateProgressIndicator.displayName = 'DSIndeterminateProgressIndicator';\nconst IndeterminateProgressIndicatorWithSchema = describe(DSIndeterminateProgressIndicator);\n\nIndeterminateProgressIndicatorWithSchema.propTypes = indeterminateProgressIndicatorProps;\n\nexport { DSIndeterminateProgressIndicator, IndeterminateProgressIndicatorWithSchema };\nexport default DSIndeterminateProgressIndicator;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": "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",
3
+ "sources": ["../../src/DSIndeterminateProgressIndicator.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable @typescript-eslint/unbound-method */\nimport React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport {\n DSIndeterminateProgressIndicatorPropTypes,\n type DSIndeterminateProgressIndicatorT,\n} from './react-desc-prop-types.js';\nimport { useIndeterminateProgressIndicator } from './config/useIndeterminateProgressIndicator.js';\nimport { DSIndeterminateProgressIndicatorName } from './constants/index.js';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport DSTruncatedTooltipText from '@elliemae/ds-truncated-tooltip-text';\n\nconst { cssClassName, classNameBlock, classNameElement } = convertPropToCssClassName(\n 'indeterminate-progress-indicator',\n);\n\nconst DSIndeterminateProgressIndicator: React.ComponentType<DSIndeterminateProgressIndicatorT.Props> = (props) => {\n const { propsWithDefault, label } = useIndeterminateProgressIndicator(props);\n const {\n containerProps,\n complete,\n failed,\n processing,\n processingComplete,\n processingFail,\n animated,\n percent,\n lineOnly,\n } = propsWithDefault;\n\n return (\n <div\n aria-busy={processing}\n aria-label={label}\n aria-live=\"polite\"\n className={`${cssClassName} ${!complete && !failed && !processing ? classNameBlock('default') : ''} ${\n complete ? classNameBlock('complete') : ''\n } ${\n // eslint-disable-next-line max-len\n failed ? classNameBlock('failed') : ''\n } ${processing ? classNameBlock('processing') : ''} ${animated && processing ? 'animated' : ''} \n ${processingComplete ? classNameBlock('processing-complete') : ''} \n ${processingFail ? classNameBlock('processing-fail') : ''} \n ${lineOnly ? 'line-only' : ''}\n `}\n role=\"alert\"\n {...containerProps}\n >\n {!lineOnly ? (\n <DSTruncatedTooltipText className={classNameBlock('tooltip-text')} containerComponent={<div />} value={label} />\n ) : null}\n <div className={`${classNameElement('bar')}`}>\n <div\n className={`${classNameElement('bar-indicator')}`}\n style={{\n width: `${!complete && !failed && !animated && processing ? percent : 100}%`,\n }}\n />\n </div>\n </div>\n );\n};\n\nDSIndeterminateProgressIndicator.propTypes = DSIndeterminateProgressIndicatorPropTypes;\nDSIndeterminateProgressIndicator.displayName = DSIndeterminateProgressIndicatorName;\nconst IndeterminateProgressIndicatorWithSchema = describe(DSIndeterminateProgressIndicator);\nIndeterminateProgressIndicatorWithSchema.propTypes = DSIndeterminateProgressIndicatorPropTypes;\n\nexport { DSIndeterminateProgressIndicator, IndeterminateProgressIndicatorWithSchema };\nexport default DSIndeterminateProgressIndicator;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADgCnB;AA7BJ,8BAAyB;AACzB,mCAGO;AACP,+CAAkD;AAClD,uBAAqD;AACrD,2BAA0C;AAC1C,uCAAmC;AAEnC,MAAM,EAAE,cAAc,gBAAgB,iBAAiB,QAAI;AAAA,EACzD;AACF;AAEA,MAAM,mCAAiG,CAAC,UAAU;AAChH,QAAM,EAAE,kBAAkB,MAAM,QAAI,4EAAkC,KAAK;AAC3E,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAW;AAAA,MACX,cAAY;AAAA,MACZ,aAAU;AAAA,MACV,WAAW,GAAG,gBAAgB,CAAC,YAAY,CAAC,UAAU,CAAC,aAAa,eAAe,SAAS,IAAI,MAC9F,WAAW,eAAe,UAAU,IAAI;AAAA,MAGxC,SAAS,eAAe,QAAQ,IAAI,MAClC,aAAa,eAAe,YAAY,IAAI,MAAM,YAAY,aAAa,aAAa;AAAA,WACvF,qBAAqB,eAAe,qBAAqB,IAAI;AAAA,WAC7D,iBAAiB,eAAe,iBAAiB,IAAI;AAAA,WACrD,WAAW,cAAc;AAAA;AAAA,MAE9B,MAAK;AAAA,MACJ,GAAG;AAAA,MAEH;AAAA,SAAC,WACA,4CAAC,iCAAAA,SAAA,EAAuB,WAAW,eAAe,cAAc,GAAG,oBAAoB,4CAAC,SAAI,GAAI,OAAO,OAAO,IAC5G;AAAA,QACJ,4CAAC,SAAI,WAAW,GAAG,iBAAiB,KAAK,KACvC;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,GAAG,iBAAiB,eAAe;AAAA,YAC9C,OAAO;AAAA,cACL,OAAO,GAAG,CAAC,YAAY,CAAC,UAAU,CAAC,YAAY,aAAa,UAAU;AAAA,YACxE;AAAA;AAAA,QACF,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,iCAAiC,YAAY;AAC7C,iCAAiC,cAAc;AAC/C,MAAM,+CAA2C,kCAAS,gCAAgC;AAC1F,yCAAyC,YAAY;AAGrD,IAAO,2CAAQ;",
6
6
  "names": ["DSTruncatedTooltipText"]
7
7
  }
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var useIndeterminateProgressIndicator_exports = {};
30
+ __export(useIndeterminateProgressIndicator_exports, {
31
+ useIndeterminateProgressIndicator: () => useIndeterminateProgressIndicator
32
+ });
33
+ module.exports = __toCommonJS(useIndeterminateProgressIndicator_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_react = __toESM(require("react"));
36
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
37
+ var import_react_desc_prop_types = require("../react-desc-prop-types.js");
38
+ var import_useValidateProps = require("./useValidateProps.js");
39
+ const useIndeterminateProgressIndicator = (propsFromUser) => {
40
+ const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(
41
+ propsFromUser,
42
+ import_react_desc_prop_types.defaultProps
43
+ );
44
+ (0, import_useValidateProps.useValidateProps)(propsWithDefault, import_react_desc_prop_types.DSIndeterminateProgressIndicatorPropTypes);
45
+ const {
46
+ title,
47
+ complete,
48
+ failed,
49
+ processing,
50
+ processingComplete,
51
+ processingCompleteTitle,
52
+ processingFail,
53
+ processingFailTitle
54
+ } = propsWithDefault;
55
+ const label = (0, import_react.useMemo)(() => {
56
+ if ((processingComplete || processingFail || processing) && (complete || failed)) {
57
+ return complete ? processingCompleteTitle : processingFailTitle;
58
+ }
59
+ return title;
60
+ }, [
61
+ processingComplete,
62
+ processingFail,
63
+ processing,
64
+ complete,
65
+ failed,
66
+ title,
67
+ processingCompleteTitle,
68
+ processingFailTitle
69
+ ]);
70
+ return import_react.default.useMemo(
71
+ () => ({
72
+ propsWithDefault,
73
+ label
74
+ }),
75
+ [propsWithDefault, label]
76
+ );
77
+ };
78
+ //# sourceMappingURL=useIndeterminateProgressIndicator.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/config/useIndeterminateProgressIndicator.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React, { useMemo } from 'react';\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport {\n type DSIndeterminateProgressIndicatorT,\n DSIndeterminateProgressIndicatorPropTypes,\n defaultProps,\n} from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface IndeterminateProgressIndicatorCTX {\n propsWithDefault: DSIndeterminateProgressIndicatorT.InternalProps;\n}\n\nexport const useIndeterminateProgressIndicator = (propsFromUser: DSIndeterminateProgressIndicatorT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSIndeterminateProgressIndicatorT.InternalProps>(\n propsFromUser,\n defaultProps,\n );\n useValidateProps(propsWithDefault, DSIndeterminateProgressIndicatorPropTypes);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n const {\n title,\n complete,\n failed,\n processing,\n processingComplete,\n processingCompleteTitle,\n processingFail,\n processingFailTitle,\n } = propsWithDefault;\n\n const label = useMemo(() => {\n if ((processingComplete || processingFail || processing) && (complete || failed)) {\n return complete ? processingCompleteTitle : processingFailTitle;\n }\n return title;\n }, [\n processingComplete,\n processingFail,\n processing,\n complete,\n failed,\n title,\n processingCompleteTitle,\n processingFailTitle,\n ]);\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n label,\n }),\n [propsWithDefault, label],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA+B;AAC/B,8BAA6C;AAC7C,mCAIO;AACP,8BAAiC;AAM1B,MAAM,oCAAoC,CAAC,kBAA2D;AAI3G,QAAM,uBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,gDAAiB,kBAAkB,sEAAyC;AAI5E,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,YAAQ,sBAAQ,MAAM;AAC1B,SAAK,sBAAsB,kBAAkB,gBAAgB,YAAY,SAAS;AAChF,aAAO,WAAW,0BAA0B;AAAA,IAC9C;AACA,WAAO;AAAA,EACT,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,kBAAkB,KAAK;AAAA,EAC1B;AACF;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var useValidateProps_exports = {};
30
+ __export(useValidateProps_exports, {
31
+ useValidateProps: () => useValidateProps
32
+ });
33
+ module.exports = __toCommonJS(useValidateProps_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
36
+ var import_constants = require("../constants/index.js");
37
+ const useValidateProps = (props, propTypes) => {
38
+ (0, import_ds_props_helpers.useValidateTypescriptPropTypes)(props, propTypes, import_constants.DSIndeterminateProgressIndicatorName);
39
+ };
40
+ //# sourceMappingURL=useValidateProps.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/config/useValidateProps.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport { type DSIndeterminateProgressIndicatorT } from '../react-desc-prop-types.js';\nimport { DSIndeterminateProgressIndicatorName } from '../constants/index.js';\n\nexport const useValidateProps = (\n props: DSIndeterminateProgressIndicatorT.InternalProps,\n propTypes: WeakValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSIndeterminateProgressIndicatorName);\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA+C;AAG/C,uBAAqD;AAE9C,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,8DAA+B,OAAO,WAAW,qDAAoC;AACvF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var constants_exports = {};
30
+ __export(constants_exports, {
31
+ DSIndeterminateProgressIndicatorName: () => DSIndeterminateProgressIndicatorName
32
+ });
33
+ module.exports = __toCommonJS(constants_exports);
34
+ var React = __toESM(require("react"));
35
+ const DSIndeterminateProgressIndicatorName = "DSIndeterminateProgressIndicator";
36
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/constants/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["export const DSIndeterminateProgressIndicatorName = 'DSIndeterminateProgressIndicator';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,uCAAuC;",
6
+ "names": []
7
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
3
+ "sources": ["../../src/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["export * from './DSIndeterminateProgressIndicator.js';\nexport { default } from './DSIndeterminateProgressIndicator.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc,kDAAd;AACA,8CAAwB;",
6
6
  "names": []
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var react_desc_prop_types_exports = {};
30
+ __export(react_desc_prop_types_exports, {
31
+ DSIndeterminateProgressIndicatorPropTypes: () => DSIndeterminateProgressIndicatorPropTypes,
32
+ defaultProps: () => defaultProps
33
+ });
34
+ module.exports = __toCommonJS(react_desc_prop_types_exports);
35
+ var React = __toESM(require("react"));
36
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
37
+ const defaultProps = {
38
+ containerProps: {},
39
+ title: "",
40
+ complete: false,
41
+ failed: false,
42
+ processing: false,
43
+ processingComplete: false,
44
+ processingCompleteTitle: "Complete",
45
+ processingFail: false,
46
+ processingFailTitle: "Fail",
47
+ animated: true,
48
+ percent: 50,
49
+ lineOnly: false
50
+ };
51
+ const DSIndeterminateProgressIndicatorPropTypes = {
52
+ containerProps: import_ds_props_helpers.PropTypes.object.description("Set of Properties attached to the main container"),
53
+ title: import_ds_props_helpers.PropTypes.string.description("component s label"),
54
+ complete: import_ds_props_helpers.PropTypes.bool.description("Sets the process state to completed").defaultValue(false),
55
+ failed: import_ds_props_helpers.PropTypes.bool.description("Sets the process state to failed").defaultValue(false),
56
+ processing: import_ds_props_helpers.PropTypes.bool.description("Sets the process state to processing").defaultValue(false),
57
+ processingComplete: import_ds_props_helpers.PropTypes.bool.description("Sets the process state to processing and then completed").defaultValue(false),
58
+ processingCompleteTitle: import_ds_props_helpers.PropTypes.string.description("label to display when the process is completed"),
59
+ processingFail: import_ds_props_helpers.PropTypes.bool.description("Sets the process state to processing and then failed").defaultValue(false),
60
+ processingFailTitle: import_ds_props_helpers.PropTypes.string.description("label to display when the process has failed"),
61
+ animated: import_ds_props_helpers.PropTypes.bool.description("animate or not").defaultValue(true),
62
+ percent: import_ds_props_helpers.PropTypes.number.description("completion percentage").defaultValue(50),
63
+ lineOnly: import_ds_props_helpers.PropTypes.bool.description("hide the label from rendering")
64
+ };
65
+ //# sourceMappingURL=react-desc-prop-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable @typescript-eslint/no-empty-interface */\nimport { PropTypes } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSIndeterminateProgressIndicatorT {\n export interface RequiredProps {}\n\n export interface DefaultProps {\n containerProps: object;\n title: string;\n complete: boolean;\n failed: boolean;\n processing: boolean;\n processingComplete: boolean;\n processingCompleteTitle: string;\n processingFail: boolean;\n processingFailTitle: string;\n animated: boolean;\n percent: number;\n lineOnly: boolean;\n }\n\n export interface OptionalProps {}\n\n export interface Props extends Partial<DefaultProps>, OptionalProps, RequiredProps {}\n\n export interface InternalProps extends DefaultProps, OptionalProps, RequiredProps {}\n}\n\nexport const defaultProps: DSIndeterminateProgressIndicatorT.DefaultProps = {\n containerProps: {},\n title: '',\n complete: false,\n failed: false,\n processing: false,\n processingComplete: false,\n processingCompleteTitle: 'Complete',\n processingFail: false,\n processingFailTitle: 'Fail',\n animated: true,\n percent: 50,\n lineOnly: false,\n};\n\nexport const DSIndeterminateProgressIndicatorPropTypes = {\n containerProps: PropTypes.object.description('Set of Properties attached to the main container'),\n title: PropTypes.string.description('component s label'),\n complete: PropTypes.bool.description('Sets the process state to completed').defaultValue(false),\n failed: PropTypes.bool.description('Sets the process state to failed').defaultValue(false),\n processing: PropTypes.bool.description('Sets the process state to processing').defaultValue(false),\n processingComplete: PropTypes.bool\n .description('Sets the process state to processing and then completed')\n .defaultValue(false),\n processingCompleteTitle: PropTypes.string.description('label to display when the process is completed'),\n processingFail: PropTypes.bool\n .description('Sets the process state to processing and then failed')\n .defaultValue(false),\n processingFailTitle: PropTypes.string.description('label to display when the process has failed'),\n animated: PropTypes.bool.description('animate or not').defaultValue(true),\n percent: PropTypes.number.description('completion percentage').defaultValue(50),\n lineOnly: PropTypes.bool.description('hide the label from rendering'),\n} as React.WeakValidationMap<unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,8BAA0B;AA2BnB,MAAM,eAA+D;AAAA,EAC1E,gBAAgB,CAAC;AAAA,EACjB,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,oBAAoB;AAAA,EACpB,yBAAyB;AAAA,EACzB,gBAAgB;AAAA,EAChB,qBAAqB;AAAA,EACrB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AACZ;AAEO,MAAM,4CAA4C;AAAA,EACvD,gBAAgB,kCAAU,OAAO,YAAY,kDAAkD;AAAA,EAC/F,OAAO,kCAAU,OAAO,YAAY,mBAAmB;AAAA,EACvD,UAAU,kCAAU,KAAK,YAAY,qCAAqC,EAAE,aAAa,KAAK;AAAA,EAC9F,QAAQ,kCAAU,KAAK,YAAY,kCAAkC,EAAE,aAAa,KAAK;AAAA,EACzF,YAAY,kCAAU,KAAK,YAAY,sCAAsC,EAAE,aAAa,KAAK;AAAA,EACjG,oBAAoB,kCAAU,KAC3B,YAAY,yDAAyD,EACrE,aAAa,KAAK;AAAA,EACrB,yBAAyB,kCAAU,OAAO,YAAY,gDAAgD;AAAA,EACtG,gBAAgB,kCAAU,KACvB,YAAY,sDAAsD,EAClE,aAAa,KAAK;AAAA,EACrB,qBAAqB,kCAAU,OAAO,YAAY,8CAA8C;AAAA,EAChG,UAAU,kCAAU,KAAK,YAAY,gBAAgB,EAAE,aAAa,IAAI;AAAA,EACxE,SAAS,kCAAU,OAAO,YAAY,uBAAuB,EAAE,aAAa,EAAE;AAAA,EAC9E,UAAU,kCAAU,KAAK,YAAY,+BAA+B;AACtE;",
6
+ "names": []
7
+ }
@@ -1,32 +1,29 @@
1
1
  import * as React from "react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { useEffect, useState } from "react";
4
- import { describe, PropTypes } from "@elliemae/ds-props-helpers";
3
+ import { describe } from "@elliemae/ds-props-helpers";
4
+ import {
5
+ DSIndeterminateProgressIndicatorPropTypes
6
+ } from "./react-desc-prop-types.js";
7
+ import { useIndeterminateProgressIndicator } from "./config/useIndeterminateProgressIndicator.js";
8
+ import { DSIndeterminateProgressIndicatorName } from "./constants/index.js";
5
9
  import { convertPropToCssClassName } from "@elliemae/ds-classnames";
6
10
  import DSTruncatedTooltipText from "@elliemae/ds-truncated-tooltip-text";
7
11
  const { cssClassName, classNameBlock, classNameElement } = convertPropToCssClassName(
8
12
  "indeterminate-progress-indicator"
9
13
  );
10
- const DSIndeterminateProgressIndicator = ({
11
- containerProps,
12
- title,
13
- complete,
14
- failed,
15
- processing,
16
- processingComplete,
17
- processingCompleteTitle,
18
- processingFail,
19
- processingFailTitle,
20
- animated,
21
- percent,
22
- lineOnly
23
- }) => {
24
- const [label, setLabel] = useState(title);
25
- useEffect(() => {
26
- if ((processingComplete || processingFail || processing) && (complete || failed)) {
27
- setLabel(complete ? processingCompleteTitle : processingFailTitle);
28
- }
29
- }, [failed, complete, processingComplete, processingFail, processing]);
14
+ const DSIndeterminateProgressIndicator = (props) => {
15
+ const { propsWithDefault, label } = useIndeterminateProgressIndicator(props);
16
+ const {
17
+ containerProps,
18
+ complete,
19
+ failed,
20
+ processing,
21
+ processingComplete,
22
+ processingFail,
23
+ animated,
24
+ percent,
25
+ lineOnly
26
+ } = propsWithDefault;
30
27
  return /* @__PURE__ */ jsxs(
31
28
  "div",
32
29
  {
@@ -37,7 +34,7 @@ const DSIndeterminateProgressIndicator = ({
37
34
  failed ? classNameBlock("failed") : ""} ${processing ? classNameBlock("processing") : ""} ${animated && processing ? "animated" : ""}
38
35
  ${processingComplete ? classNameBlock("processing-complete") : ""}
39
36
  ${processingFail ? classNameBlock("processing-fail") : ""}
40
- ${lineOnly ? "line-only" : null}
37
+ ${lineOnly ? "line-only" : ""}
41
38
  `,
42
39
  role: "alert",
43
40
  ...containerProps,
@@ -56,38 +53,10 @@ const DSIndeterminateProgressIndicator = ({
56
53
  }
57
54
  );
58
55
  };
59
- DSIndeterminateProgressIndicator.defaultProps = {
60
- containerProps: {},
61
- title: "",
62
- complete: false,
63
- failed: false,
64
- processing: false,
65
- processingComplete: false,
66
- processingCompleteTitle: "Complete",
67
- processingFail: false,
68
- processingFailTitle: "Fail",
69
- animated: true,
70
- percent: 50,
71
- lineOnly: false
72
- };
73
- const indeterminateProgressIndicatorProps = {
74
- containerProps: PropTypes.object.description("Set of Properties attached to the main container"),
75
- title: PropTypes.string.description("component s label"),
76
- processingCompleteTitle: PropTypes.string.description("label to display when the process is completed"),
77
- processingFailTitle: PropTypes.string.description("label to display when the process has failed"),
78
- complete: PropTypes.bool.description("Sets the process state to completed").defaultValue(false),
79
- failed: PropTypes.bool.description("Sets the process state to failed").defaultValue(false),
80
- processing: PropTypes.bool.description("Sets the process state to processing").defaultValue(false),
81
- processingComplete: PropTypes.bool.description("Sets the process state to processing and then completed").defaultValue(false),
82
- processingFail: PropTypes.bool.description("Sets the process state to processing and then failed").defaultValue(false),
83
- animated: PropTypes.bool.description("animate or not").defaultValue(true),
84
- percent: PropTypes.number.description("completion percentage").defaultValue(50),
85
- lineOnly: PropTypes.bool.description("hide the label from rendering")
86
- };
87
- DSIndeterminateProgressIndicator.propTypes = indeterminateProgressIndicatorProps;
88
- DSIndeterminateProgressIndicator.displayName = "DSIndeterminateProgressIndicator";
56
+ DSIndeterminateProgressIndicator.propTypes = DSIndeterminateProgressIndicatorPropTypes;
57
+ DSIndeterminateProgressIndicator.displayName = DSIndeterminateProgressIndicatorName;
89
58
  const IndeterminateProgressIndicatorWithSchema = describe(DSIndeterminateProgressIndicator);
90
- IndeterminateProgressIndicatorWithSchema.propTypes = indeterminateProgressIndicatorProps;
59
+ IndeterminateProgressIndicatorWithSchema.propTypes = DSIndeterminateProgressIndicatorPropTypes;
91
60
  var DSIndeterminateProgressIndicator_default = DSIndeterminateProgressIndicator;
92
61
  export {
93
62
  DSIndeterminateProgressIndicator,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSIndeterminateProgressIndicator.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable complexity */\n/* eslint-disable react/require-default-props */\nimport React, { useEffect, useState } from 'react';\nimport { describe, PropTypes } from '@elliemae/ds-props-helpers';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport DSTruncatedTooltipText from '@elliemae/ds-truncated-tooltip-text';\n\nconst { cssClassName, classNameBlock, classNameElement } = convertPropToCssClassName(\n 'indeterminate-progress-indicator',\n);\n\nconst DSIndeterminateProgressIndicator = ({\n containerProps,\n title,\n complete,\n failed,\n processing,\n processingComplete,\n processingCompleteTitle,\n processingFail,\n processingFailTitle,\n animated,\n percent,\n lineOnly,\n}) => {\n const [label, setLabel] = useState(title);\n useEffect(() => {\n if ((processingComplete || processingFail || processing) && (complete || failed)) {\n setLabel(complete ? processingCompleteTitle : processingFailTitle);\n }\n }, [failed, complete, processingComplete, processingFail, processing]);\n return (\n <div\n aria-busy={processing}\n aria-label={label}\n aria-live=\"polite\"\n className={`${cssClassName} ${!complete && !failed && !processing ? classNameBlock('default') : ''} ${\n complete ? classNameBlock('complete') : ''\n } ${\n // eslint-disable-next-line max-len\n failed ? classNameBlock('failed') : ''\n } ${processing ? classNameBlock('processing') : ''} ${animated && processing ? 'animated' : ''} \n ${processingComplete ? classNameBlock('processing-complete') : ''} \n ${processingFail ? classNameBlock('processing-fail') : ''} \n ${lineOnly ? 'line-only' : null}\n `}\n role=\"alert\"\n {...containerProps}\n >\n {!lineOnly ? (\n <DSTruncatedTooltipText className={classNameBlock('tooltip-text')} containerComponent={<div />} value={label} />\n ) : null}\n <div className={`${classNameElement('bar')}`}>\n <div\n className={`${classNameElement('bar-indicator')}`}\n style={{\n width: `${!complete && !failed && !animated && processing ? percent : 100}%`,\n }}\n />\n </div>\n </div>\n );\n};\n\nDSIndeterminateProgressIndicator.defaultProps = {\n containerProps: {},\n title: '',\n complete: false,\n failed: false,\n processing: false,\n processingComplete: false,\n processingCompleteTitle: 'Complete',\n processingFail: false,\n processingFailTitle: 'Fail',\n animated: true,\n percent: 50,\n lineOnly: false,\n};\n\nconst indeterminateProgressIndicatorProps = {\n containerProps: PropTypes.object.description('Set of Properties attached to the main container'),\n title: PropTypes.string.description('component s label'),\n processingCompleteTitle: PropTypes.string.description('label to display when the process is completed'),\n processingFailTitle: PropTypes.string.description('label to display when the process has failed'),\n complete: PropTypes.bool.description('Sets the process state to completed').defaultValue(false),\n failed: PropTypes.bool.description('Sets the process state to failed').defaultValue(false),\n processing: PropTypes.bool.description('Sets the process state to processing').defaultValue(false),\n processingComplete: PropTypes.bool\n .description('Sets the process state to processing and then completed')\n .defaultValue(false),\n processingFail: PropTypes.bool\n .description('Sets the process state to processing and then failed')\n .defaultValue(false),\n animated: PropTypes.bool.description('animate or not').defaultValue(true),\n percent: PropTypes.number.description('completion percentage').defaultValue(50),\n lineOnly: PropTypes.bool.description('hide the label from rendering'),\n};\n\nDSIndeterminateProgressIndicator.propTypes = indeterminateProgressIndicatorProps;\nDSIndeterminateProgressIndicator.displayName = 'DSIndeterminateProgressIndicator';\nconst IndeterminateProgressIndicatorWithSchema = describe(DSIndeterminateProgressIndicator);\n\nIndeterminateProgressIndicatorWithSchema.propTypes = indeterminateProgressIndicatorProps;\n\nexport { DSIndeterminateProgressIndicator, IndeterminateProgressIndicatorWithSchema };\nexport default DSIndeterminateProgressIndicator;\n"],
5
- "mappings": "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",
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSIndeterminateProgressIndicator.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable @typescript-eslint/unbound-method */\nimport React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport {\n DSIndeterminateProgressIndicatorPropTypes,\n type DSIndeterminateProgressIndicatorT,\n} from './react-desc-prop-types.js';\nimport { useIndeterminateProgressIndicator } from './config/useIndeterminateProgressIndicator.js';\nimport { DSIndeterminateProgressIndicatorName } from './constants/index.js';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport DSTruncatedTooltipText from '@elliemae/ds-truncated-tooltip-text';\n\nconst { cssClassName, classNameBlock, classNameElement } = convertPropToCssClassName(\n 'indeterminate-progress-indicator',\n);\n\nconst DSIndeterminateProgressIndicator: React.ComponentType<DSIndeterminateProgressIndicatorT.Props> = (props) => {\n const { propsWithDefault, label } = useIndeterminateProgressIndicator(props);\n const {\n containerProps,\n complete,\n failed,\n processing,\n processingComplete,\n processingFail,\n animated,\n percent,\n lineOnly,\n } = propsWithDefault;\n\n return (\n <div\n aria-busy={processing}\n aria-label={label}\n aria-live=\"polite\"\n className={`${cssClassName} ${!complete && !failed && !processing ? classNameBlock('default') : ''} ${\n complete ? classNameBlock('complete') : ''\n } ${\n // eslint-disable-next-line max-len\n failed ? classNameBlock('failed') : ''\n } ${processing ? classNameBlock('processing') : ''} ${animated && processing ? 'animated' : ''} \n ${processingComplete ? classNameBlock('processing-complete') : ''} \n ${processingFail ? classNameBlock('processing-fail') : ''} \n ${lineOnly ? 'line-only' : ''}\n `}\n role=\"alert\"\n {...containerProps}\n >\n {!lineOnly ? (\n <DSTruncatedTooltipText className={classNameBlock('tooltip-text')} containerComponent={<div />} value={label} />\n ) : null}\n <div className={`${classNameElement('bar')}`}>\n <div\n className={`${classNameElement('bar-indicator')}`}\n style={{\n width: `${!complete && !failed && !animated && processing ? percent : 100}%`,\n }}\n />\n </div>\n </div>\n );\n};\n\nDSIndeterminateProgressIndicator.propTypes = DSIndeterminateProgressIndicatorPropTypes;\nDSIndeterminateProgressIndicator.displayName = DSIndeterminateProgressIndicatorName;\nconst IndeterminateProgressIndicatorWithSchema = describe(DSIndeterminateProgressIndicator);\nIndeterminateProgressIndicatorWithSchema.propTypes = DSIndeterminateProgressIndicatorPropTypes;\n\nexport { DSIndeterminateProgressIndicator, IndeterminateProgressIndicatorWithSchema };\nexport default DSIndeterminateProgressIndicator;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACgCnB,SAkB2F,KAlB3F;AA7BJ,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,OAEK;AACP,SAAS,yCAAyC;AAClD,SAAS,4CAA4C;AACrD,SAAS,iCAAiC;AAC1C,OAAO,4BAA4B;AAEnC,MAAM,EAAE,cAAc,gBAAgB,iBAAiB,IAAI;AAAA,EACzD;AACF;AAEA,MAAM,mCAAiG,CAAC,UAAU;AAChH,QAAM,EAAE,kBAAkB,MAAM,IAAI,kCAAkC,KAAK;AAC3E,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAW;AAAA,MACX,cAAY;AAAA,MACZ,aAAU;AAAA,MACV,WAAW,GAAG,gBAAgB,CAAC,YAAY,CAAC,UAAU,CAAC,aAAa,eAAe,SAAS,IAAI,MAC9F,WAAW,eAAe,UAAU,IAAI;AAAA,MAGxC,SAAS,eAAe,QAAQ,IAAI,MAClC,aAAa,eAAe,YAAY,IAAI,MAAM,YAAY,aAAa,aAAa;AAAA,WACvF,qBAAqB,eAAe,qBAAqB,IAAI;AAAA,WAC7D,iBAAiB,eAAe,iBAAiB,IAAI;AAAA,WACrD,WAAW,cAAc;AAAA;AAAA,MAE9B,MAAK;AAAA,MACJ,GAAG;AAAA,MAEH;AAAA,SAAC,WACA,oBAAC,0BAAuB,WAAW,eAAe,cAAc,GAAG,oBAAoB,oBAAC,SAAI,GAAI,OAAO,OAAO,IAC5G;AAAA,QACJ,oBAAC,SAAI,WAAW,GAAG,iBAAiB,KAAK,KACvC;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,GAAG,iBAAiB,eAAe;AAAA,YAC9C,OAAO;AAAA,cACL,OAAO,GAAG,CAAC,YAAY,CAAC,UAAU,CAAC,YAAY,aAAa,UAAU;AAAA,YACxE;AAAA;AAAA,QACF,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,iCAAiC,YAAY;AAC7C,iCAAiC,cAAc;AAC/C,MAAM,2CAA2C,SAAS,gCAAgC;AAC1F,yCAAyC,YAAY;AAGrD,IAAO,2CAAQ;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,51 @@
1
+ import * as React from "react";
2
+ import React2, { useMemo } from "react";
3
+ import { useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
4
+ import {
5
+ DSIndeterminateProgressIndicatorPropTypes,
6
+ defaultProps
7
+ } from "../react-desc-prop-types.js";
8
+ import { useValidateProps } from "./useValidateProps.js";
9
+ const useIndeterminateProgressIndicator = (propsFromUser) => {
10
+ const propsWithDefault = useMemoMergePropsWithDefault(
11
+ propsFromUser,
12
+ defaultProps
13
+ );
14
+ useValidateProps(propsWithDefault, DSIndeterminateProgressIndicatorPropTypes);
15
+ const {
16
+ title,
17
+ complete,
18
+ failed,
19
+ processing,
20
+ processingComplete,
21
+ processingCompleteTitle,
22
+ processingFail,
23
+ processingFailTitle
24
+ } = propsWithDefault;
25
+ const label = useMemo(() => {
26
+ if ((processingComplete || processingFail || processing) && (complete || failed)) {
27
+ return complete ? processingCompleteTitle : processingFailTitle;
28
+ }
29
+ return title;
30
+ }, [
31
+ processingComplete,
32
+ processingFail,
33
+ processing,
34
+ complete,
35
+ failed,
36
+ title,
37
+ processingCompleteTitle,
38
+ processingFailTitle
39
+ ]);
40
+ return React2.useMemo(
41
+ () => ({
42
+ propsWithDefault,
43
+ label
44
+ }),
45
+ [propsWithDefault, label]
46
+ );
47
+ };
48
+ export {
49
+ useIndeterminateProgressIndicator
50
+ };
51
+ //# sourceMappingURL=useIndeterminateProgressIndicator.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useIndeterminateProgressIndicator.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useMemo } from 'react';\nimport { useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport {\n type DSIndeterminateProgressIndicatorT,\n DSIndeterminateProgressIndicatorPropTypes,\n defaultProps,\n} from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface IndeterminateProgressIndicatorCTX {\n propsWithDefault: DSIndeterminateProgressIndicatorT.InternalProps;\n}\n\nexport const useIndeterminateProgressIndicator = (propsFromUser: DSIndeterminateProgressIndicatorT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSIndeterminateProgressIndicatorT.InternalProps>(\n propsFromUser,\n defaultProps,\n );\n useValidateProps(propsWithDefault, DSIndeterminateProgressIndicatorPropTypes);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n const {\n title,\n complete,\n failed,\n processing,\n processingComplete,\n processingCompleteTitle,\n processingFail,\n processingFailTitle,\n } = propsWithDefault;\n\n const label = useMemo(() => {\n if ((processingComplete || processingFail || processing) && (complete || failed)) {\n return complete ? processingCompleteTitle : processingFailTitle;\n }\n return title;\n }, [\n processingComplete,\n processingFail,\n processing,\n complete,\n failed,\n title,\n processingCompleteTitle,\n processingFailTitle,\n ]);\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n label,\n }),\n [propsWithDefault, label],\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,UAAS,eAAe;AAC/B,SAAS,oCAAoC;AAC7C;AAAA,EAEE;AAAA,EACA;AAAA,OACK;AACP,SAAS,wBAAwB;AAM1B,MAAM,oCAAoC,CAAC,kBAA2D;AAI3G,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,mBAAiB,kBAAkB,yCAAyC;AAI5E,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,QAAQ,QAAQ,MAAM;AAC1B,SAAK,sBAAsB,kBAAkB,gBAAgB,YAAY,SAAS;AAChF,aAAO,WAAW,0BAA0B;AAAA,IAC9C;AACA,WAAO;AAAA,EACT,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,kBAAkB,KAAK;AAAA,EAC1B;AACF;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import { useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
3
+ import { DSIndeterminateProgressIndicatorName } from "../constants/index.js";
4
+ const useValidateProps = (props, propTypes) => {
5
+ useValidateTypescriptPropTypes(props, propTypes, DSIndeterminateProgressIndicatorName);
6
+ };
7
+ export {
8
+ useValidateProps
9
+ };
10
+ //# sourceMappingURL=useValidateProps.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useValidateProps.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport { type DSIndeterminateProgressIndicatorT } from '../react-desc-prop-types.js';\nimport { DSIndeterminateProgressIndicatorName } from '../constants/index.js';\n\nexport const useValidateProps = (\n props: DSIndeterminateProgressIndicatorT.InternalProps,\n propTypes: WeakValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSIndeterminateProgressIndicatorName);\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAG/C,SAAS,4CAA4C;AAE9C,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,iCAA+B,OAAO,WAAW,oCAAoC;AACvF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ const DSIndeterminateProgressIndicatorName = "DSIndeterminateProgressIndicator";
3
+ export {
4
+ DSIndeterminateProgressIndicatorName
5
+ };
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/constants/index.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const DSIndeterminateProgressIndicatorName = 'DSIndeterminateProgressIndicator';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAhB,MAAM,uCAAuC;",
6
+ "names": []
7
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSIndeterminateProgressIndicator.js';\nexport { default } from './DSIndeterminateProgressIndicator.js';\n"],
5
5
  "mappings": "AAAA,YAAY,WAAW;ACAvB,cAAc;AACd,SAAS,WAAAA,gBAAe;",
6
6
  "names": ["default"]
@@ -0,0 +1,35 @@
1
+ import * as React from "react";
2
+ import { PropTypes } from "@elliemae/ds-props-helpers";
3
+ const defaultProps = {
4
+ containerProps: {},
5
+ title: "",
6
+ complete: false,
7
+ failed: false,
8
+ processing: false,
9
+ processingComplete: false,
10
+ processingCompleteTitle: "Complete",
11
+ processingFail: false,
12
+ processingFailTitle: "Fail",
13
+ animated: true,
14
+ percent: 50,
15
+ lineOnly: false
16
+ };
17
+ const DSIndeterminateProgressIndicatorPropTypes = {
18
+ containerProps: PropTypes.object.description("Set of Properties attached to the main container"),
19
+ title: PropTypes.string.description("component s label"),
20
+ complete: PropTypes.bool.description("Sets the process state to completed").defaultValue(false),
21
+ failed: PropTypes.bool.description("Sets the process state to failed").defaultValue(false),
22
+ processing: PropTypes.bool.description("Sets the process state to processing").defaultValue(false),
23
+ processingComplete: PropTypes.bool.description("Sets the process state to processing and then completed").defaultValue(false),
24
+ processingCompleteTitle: PropTypes.string.description("label to display when the process is completed"),
25
+ processingFail: PropTypes.bool.description("Sets the process state to processing and then failed").defaultValue(false),
26
+ processingFailTitle: PropTypes.string.description("label to display when the process has failed"),
27
+ animated: PropTypes.bool.description("animate or not").defaultValue(true),
28
+ percent: PropTypes.number.description("completion percentage").defaultValue(50),
29
+ lineOnly: PropTypes.bool.description("hide the label from rendering")
30
+ };
31
+ export {
32
+ DSIndeterminateProgressIndicatorPropTypes,
33
+ defaultProps
34
+ };
35
+ //# sourceMappingURL=react-desc-prop-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-empty-interface */\nimport { PropTypes } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSIndeterminateProgressIndicatorT {\n export interface RequiredProps {}\n\n export interface DefaultProps {\n containerProps: object;\n title: string;\n complete: boolean;\n failed: boolean;\n processing: boolean;\n processingComplete: boolean;\n processingCompleteTitle: string;\n processingFail: boolean;\n processingFailTitle: string;\n animated: boolean;\n percent: number;\n lineOnly: boolean;\n }\n\n export interface OptionalProps {}\n\n export interface Props extends Partial<DefaultProps>, OptionalProps, RequiredProps {}\n\n export interface InternalProps extends DefaultProps, OptionalProps, RequiredProps {}\n}\n\nexport const defaultProps: DSIndeterminateProgressIndicatorT.DefaultProps = {\n containerProps: {},\n title: '',\n complete: false,\n failed: false,\n processing: false,\n processingComplete: false,\n processingCompleteTitle: 'Complete',\n processingFail: false,\n processingFailTitle: 'Fail',\n animated: true,\n percent: 50,\n lineOnly: false,\n};\n\nexport const DSIndeterminateProgressIndicatorPropTypes = {\n containerProps: PropTypes.object.description('Set of Properties attached to the main container'),\n title: PropTypes.string.description('component s label'),\n complete: PropTypes.bool.description('Sets the process state to completed').defaultValue(false),\n failed: PropTypes.bool.description('Sets the process state to failed').defaultValue(false),\n processing: PropTypes.bool.description('Sets the process state to processing').defaultValue(false),\n processingComplete: PropTypes.bool\n .description('Sets the process state to processing and then completed')\n .defaultValue(false),\n processingCompleteTitle: PropTypes.string.description('label to display when the process is completed'),\n processingFail: PropTypes.bool\n .description('Sets the process state to processing and then failed')\n .defaultValue(false),\n processingFailTitle: PropTypes.string.description('label to display when the process has failed'),\n animated: PropTypes.bool.description('animate or not').defaultValue(true),\n percent: PropTypes.number.description('completion percentage').defaultValue(50),\n lineOnly: PropTypes.bool.description('hide the label from rendering'),\n} as React.WeakValidationMap<unknown>;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,iBAAiB;AA2BnB,MAAM,eAA+D;AAAA,EAC1E,gBAAgB,CAAC;AAAA,EACjB,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,oBAAoB;AAAA,EACpB,yBAAyB;AAAA,EACzB,gBAAgB;AAAA,EAChB,qBAAqB;AAAA,EACrB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AACZ;AAEO,MAAM,4CAA4C;AAAA,EACvD,gBAAgB,UAAU,OAAO,YAAY,kDAAkD;AAAA,EAC/F,OAAO,UAAU,OAAO,YAAY,mBAAmB;AAAA,EACvD,UAAU,UAAU,KAAK,YAAY,qCAAqC,EAAE,aAAa,KAAK;AAAA,EAC9F,QAAQ,UAAU,KAAK,YAAY,kCAAkC,EAAE,aAAa,KAAK;AAAA,EACzF,YAAY,UAAU,KAAK,YAAY,sCAAsC,EAAE,aAAa,KAAK;AAAA,EACjG,oBAAoB,UAAU,KAC3B,YAAY,yDAAyD,EACrE,aAAa,KAAK;AAAA,EACrB,yBAAyB,UAAU,OAAO,YAAY,gDAAgD;AAAA,EACtG,gBAAgB,UAAU,KACvB,YAAY,sDAAsD,EAClE,aAAa,KAAK;AAAA,EACrB,qBAAqB,UAAU,OAAO,YAAY,8CAA8C;AAAA,EAChG,UAAU,UAAU,KAAK,YAAY,gBAAgB,EAAE,aAAa,IAAI;AAAA,EACxE,SAAS,UAAU,OAAO,YAAY,uBAAuB,EAAE,aAAa,EAAE;AAAA,EAC9E,UAAU,UAAU,KAAK,YAAY,+BAA+B;AACtE;",
6
+ "names": []
7
+ }
@@ -1,61 +1,6 @@
1
- declare const DSIndeterminateProgressIndicator: {
2
- ({ containerProps, title, complete, failed, processing, processingComplete, processingCompleteTitle, processingFail, processingFailTitle, animated, percent, lineOnly, }: {
3
- containerProps: any;
4
- title: any;
5
- complete: any;
6
- failed: any;
7
- processing: any;
8
- processingComplete: any;
9
- processingCompleteTitle: any;
10
- processingFail: any;
11
- processingFailTitle: any;
12
- animated: any;
13
- percent: any;
14
- lineOnly: any;
15
- }): import("react/jsx-runtime").JSX.Element;
16
- defaultProps: {
17
- containerProps: {};
18
- title: string;
19
- complete: boolean;
20
- failed: boolean;
21
- processing: boolean;
22
- processingComplete: boolean;
23
- processingCompleteTitle: string;
24
- processingFail: boolean;
25
- processingFailTitle: string;
26
- animated: boolean;
27
- percent: number;
28
- lineOnly: boolean;
29
- };
30
- propTypes: {
31
- containerProps: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
32
- title: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
33
- processingCompleteTitle: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
34
- processingFailTitle: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
35
- complete: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
36
- failed: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
37
- processing: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
38
- processingComplete: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
39
- processingFail: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
40
- animated: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
41
- percent: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
42
- lineOnly: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
43
- };
44
- displayName: string;
45
- };
46
- declare const IndeterminateProgressIndicatorWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").DocumentedReactComponent<{
47
- containerProps: any;
48
- title: any;
49
- complete: any;
50
- failed: any;
51
- processing: any;
52
- processingComplete: any;
53
- processingCompleteTitle: any;
54
- processingFail: any;
55
- processingFailTitle: any;
56
- animated: any;
57
- percent: any;
58
- lineOnly: any;
59
- }>;
1
+ import React from 'react';
2
+ import { type DSIndeterminateProgressIndicatorT } from './react-desc-prop-types.js';
3
+ declare const DSIndeterminateProgressIndicator: React.ComponentType<DSIndeterminateProgressIndicatorT.Props>;
4
+ declare const IndeterminateProgressIndicatorWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSIndeterminateProgressIndicatorT.Props>;
60
5
  export { DSIndeterminateProgressIndicator, IndeterminateProgressIndicatorWithSchema };
61
6
  export default DSIndeterminateProgressIndicator;
@@ -0,0 +1,8 @@
1
+ import { type DSIndeterminateProgressIndicatorT } from '../react-desc-prop-types.js';
2
+ export interface IndeterminateProgressIndicatorCTX {
3
+ propsWithDefault: DSIndeterminateProgressIndicatorT.InternalProps;
4
+ }
5
+ export declare const useIndeterminateProgressIndicator: (propsFromUser: DSIndeterminateProgressIndicatorT.Props) => {
6
+ propsWithDefault: DSIndeterminateProgressIndicatorT.InternalProps;
7
+ label: string;
8
+ };
@@ -0,0 +1,3 @@
1
+ import type { WeakValidationMap } from 'react';
2
+ import { type DSIndeterminateProgressIndicatorT } from '../react-desc-prop-types.js';
3
+ export declare const useValidateProps: (props: DSIndeterminateProgressIndicatorT.InternalProps, propTypes: WeakValidationMap<unknown>) => void;
@@ -0,0 +1 @@
1
+ export declare const DSIndeterminateProgressIndicatorName = "DSIndeterminateProgressIndicator";
@@ -0,0 +1,27 @@
1
+ /// <reference types="react" />
2
+ export declare namespace DSIndeterminateProgressIndicatorT {
3
+ interface RequiredProps {
4
+ }
5
+ interface DefaultProps {
6
+ containerProps: object;
7
+ title: string;
8
+ complete: boolean;
9
+ failed: boolean;
10
+ processing: boolean;
11
+ processingComplete: boolean;
12
+ processingCompleteTitle: string;
13
+ processingFail: boolean;
14
+ processingFailTitle: string;
15
+ animated: boolean;
16
+ percent: number;
17
+ lineOnly: boolean;
18
+ }
19
+ interface OptionalProps {
20
+ }
21
+ interface Props extends Partial<DefaultProps>, OptionalProps, RequiredProps {
22
+ }
23
+ interface InternalProps extends DefaultProps, OptionalProps, RequiredProps {
24
+ }
25
+ }
26
+ export declare const defaultProps: DSIndeterminateProgressIndicatorT.DefaultProps;
27
+ export declare const DSIndeterminateProgressIndicatorPropTypes: import("react").WeakValidationMap<unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-indeterminate-progress-indicator",
3
- "version": "3.22.0-next.3",
3
+ "version": "3.22.0-next.30",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Indeterminate Progress Indicator",
6
6
  "files": [
@@ -39,13 +39,13 @@
39
39
  "indent": 4
40
40
  },
41
41
  "dependencies": {
42
- "@elliemae/ds-classnames": "3.22.0-next.3",
43
- "@elliemae/ds-props-helpers": "3.22.0-next.3",
44
- "@elliemae/ds-truncated-tooltip-text": "3.22.0-next.3"
42
+ "@elliemae/ds-classnames": "3.22.0-next.30",
43
+ "@elliemae/ds-props-helpers": "3.22.0-next.30",
44
+ "@elliemae/ds-truncated-tooltip-text": "3.22.0-next.30"
45
45
  },
46
46
  "devDependencies": {
47
- "@elliemae/pui-cli": "~9.0.0-next.17",
48
- "@elliemae/ds-monorepo-devops": "3.22.0-next.3"
47
+ "@elliemae/pui-cli": "~9.0.0-next.22",
48
+ "@elliemae/ds-monorepo-devops": "3.22.0-next.30"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "react": "^17.0.2",
@@ -56,14 +56,14 @@
56
56
  "typeSafety": false
57
57
  },
58
58
  "scripts": {
59
- "dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
59
+ "dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
60
60
  "test": "pui-cli test --passWithNoTests",
61
- "lint": "node ../../scripts/lint.mjs",
62
- "eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../.eslintrc.js' src/",
63
- "dts": "node ../../scripts/dts.mjs",
64
- "build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs",
61
+ "lint": "node ../../../scripts/lint.mjs",
62
+ "eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../../.eslintrc.js' src/",
63
+ "dts": "node ../../../scripts/dts.mjs",
64
+ "build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
65
65
  "dev:build": "pnpm --filter {.}... build",
66
66
  "dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
67
- "checkDeps": "npm exec ../ds-codemods -- check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
67
+ "checkDeps": "npm exec ../../util/ds-codemods -- check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
68
68
  }
69
69
  }