@elliemae/ds-indeterminate-progress-indicator 2.2.0-alpha.4 → 3.0.0-next.2

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.
@@ -1,117 +1,113 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
- }
18
- return target;
19
- };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var DSIndeterminateProgressIndicator_exports = {};
29
- __export(DSIndeterminateProgressIndicator_exports, {
30
- DSIndeterminateProgressIndicator: () => DSIndeterminateProgressIndicator,
31
- IndeterminateProgressIndicatorWithSchema: () => IndeterminateProgressIndicatorWithSchema,
32
- default: () => DSIndeterminateProgressIndicator_default
33
- });
34
- var React = __toESM(require("react"));
35
- var import_react = __toESM(require("react"));
36
- var import_react_desc = require("react-desc");
37
- var import_ds_classnames = require("@elliemae/ds-classnames");
38
- var import_ds_truncated_tooltip_text = __toESM(require("@elliemae/ds-truncated-tooltip-text"));
39
- const { cssClassName, classNameBlock, classNameElement } = (0, import_ds_classnames.convertPropToCssClassName)("indeterminate-progress-indicator");
40
- function DSIndeterminateProgressIndicator({
41
- containerProps,
42
- title,
43
- complete,
44
- failed,
45
- processing,
46
- processingComplete,
47
- processingCompleteTitle,
48
- processingFail,
49
- processingFailTitle,
50
- animated,
51
- percent,
52
- lineOnly
53
- }) {
54
- const [label, setLabel] = (0, import_react.useState)(title);
55
- (0, import_react.useEffect)(() => {
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
6
+ var _jsx = require('@babel/runtime/helpers/jsx');
7
+ require('core-js/modules/web.dom-collections.iterator.js');
8
+ require('core-js/modules/esnext.async-iterator.filter.js');
9
+ require('core-js/modules/esnext.iterator.constructor.js');
10
+ require('core-js/modules/esnext.iterator.filter.js');
11
+ require('core-js/modules/esnext.async-iterator.for-each.js');
12
+ require('core-js/modules/esnext.iterator.for-each.js');
13
+ var react = require('react');
14
+ var reactDesc = require('react-desc');
15
+ var dsClassnames = require('@elliemae/ds-classnames');
16
+ var DSTruncatedTooltipText = require('@elliemae/ds-truncated-tooltip-text');
17
+ var jsxRuntime = require('react/jsx-runtime');
18
+
19
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
20
+
21
+ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
22
+ var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
23
+ var DSTruncatedTooltipText__default = /*#__PURE__*/_interopDefaultLegacy(DSTruncatedTooltipText);
24
+
25
+ var _div;
26
+
27
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
28
+
29
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
30
+ const {
31
+ cssClassName,
32
+ classNameBlock,
33
+ classNameElement
34
+ } = dsClassnames.convertPropToCssClassName('indeterminate-progress-indicator');
35
+
36
+ function DSIndeterminateProgressIndicator(_ref) {
37
+ let {
38
+ containerProps,
39
+ title,
40
+ complete,
41
+ failed,
42
+ processing,
43
+ processingComplete,
44
+ processingCompleteTitle,
45
+ processingFail,
46
+ processingFailTitle,
47
+ animated,
48
+ percent,
49
+ lineOnly
50
+ } = _ref;
51
+ const [label, setLabel] = react.useState(title);
52
+ react.useEffect(() => {
56
53
  if ((processingComplete || processingFail || processing) && (complete || failed)) {
57
54
  setLabel(complete ? processingCompleteTitle : processingFailTitle);
58
55
  }
59
56
  }, [failed, complete, processingComplete, processingFail, processing]);
60
- return /* @__PURE__ */ import_react.default.createElement("div", {
57
+ return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread(_objectSpread({
61
58
  "aria-busy": processing,
62
59
  "aria-label": label,
63
60
  "aria-live": "polite",
64
- className: `${cssClassName} ${!complete && !failed && !processing ? classNameBlock("default") : ""} ${complete ? classNameBlock("complete") : ""} ${failed ? classNameBlock("failed") : ""} ${processing ? classNameBlock("processing") : ""} ${animated && processing ? "animated" : ""}
65
- ${processingComplete ? classNameBlock("processing-complete") : ""}
66
- ${processingFail ? classNameBlock("processing-fail") : ""}
67
- ${lineOnly ? "line-only" : null}
68
- `,
69
- role: "alert",
70
- ...containerProps
71
- }, !lineOnly ? /* @__PURE__ */ import_react.default.createElement(import_ds_truncated_tooltip_text.default, {
72
- className: classNameBlock("tooltip-text"),
73
- containerComponent: /* @__PURE__ */ import_react.default.createElement("div", null),
74
- value: label
75
- }) : null, /* @__PURE__ */ import_react.default.createElement("div", {
76
- className: `${classNameElement("bar")}`
77
- }, /* @__PURE__ */ import_react.default.createElement("div", {
78
- className: `${classNameElement("bar-indicator")}`,
79
- style: {
80
- width: `${!complete && !failed && !animated && processing ? percent : 100}%`
81
- }
82
- })));
61
+ className: "".concat(cssClassName, " ").concat(!complete && !failed && !processing ? classNameBlock('default') : '', " ").concat(complete ? classNameBlock('complete') : '', " ").concat( // eslint-disable-next-line max-len
62
+ failed ? classNameBlock('failed') : '', " ").concat(processing ? classNameBlock('processing') : '', " ").concat(animated && processing ? 'animated' : '', " \n ").concat(processingComplete ? classNameBlock('processing-complete') : '', " \n ").concat(processingFail ? classNameBlock('processing-fail') : '', " \n ").concat(lineOnly ? 'line-only' : null, "\n "),
63
+ role: "alert"
64
+ }, containerProps), {}, {
65
+ children: [!lineOnly ? /*#__PURE__*/_jsx__default["default"](DSTruncatedTooltipText__default["default"], {
66
+ className: classNameBlock('tooltip-text'),
67
+ containerComponent: _div || (_div = /*#__PURE__*/_jsx__default["default"]("div", {})),
68
+ value: label
69
+ }) : null, /*#__PURE__*/_jsx__default["default"]("div", {
70
+ className: "".concat(classNameElement('bar'))
71
+ }, void 0, /*#__PURE__*/_jsx__default["default"]("div", {
72
+ className: "".concat(classNameElement('bar-indicator')),
73
+ style: {
74
+ width: "".concat(!complete && !failed && !animated && processing ? percent : 100, "%")
75
+ }
76
+ }))]
77
+ }));
83
78
  }
79
+
84
80
  DSIndeterminateProgressIndicator.defaultProps = {
85
81
  containerProps: {},
86
- title: "",
82
+ title: '',
87
83
  complete: false,
88
84
  failed: false,
89
85
  processing: false,
90
86
  processingComplete: false,
91
- processingCompleteTitle: "Complete",
87
+ processingCompleteTitle: 'Complete',
92
88
  processingFail: false,
93
- processingFailTitle: "Fail",
89
+ processingFailTitle: 'Fail',
94
90
  animated: true,
95
91
  percent: 50,
96
92
  lineOnly: false
97
93
  };
98
94
  const indeterminateProgressIndicatorProps = {
99
- containerProps: import_react_desc.PropTypes.object.description("Set of Properties attached to the main container"),
100
- title: import_react_desc.PropTypes.string.description("component s label"),
101
- processingCompleteTitle: import_react_desc.PropTypes.string.description("label to display when the process is completed"),
102
- processingFailTitle: import_react_desc.PropTypes.string.description("label to display when the process has failed"),
103
- complete: import_react_desc.PropTypes.bool.description("Sets the process state to completed").defaultValue(false),
104
- failed: import_react_desc.PropTypes.bool.description("Sets the process state to failed").defaultValue(false),
105
- processing: import_react_desc.PropTypes.bool.description("Sets the process state to processing").defaultValue(false),
106
- processingComplete: import_react_desc.PropTypes.bool.description("Sets the process state to processing and then completed").defaultValue(false),
107
- processingFail: import_react_desc.PropTypes.bool.description("Sets the process state to processing and then failed").defaultValue(false),
108
- animated: import_react_desc.PropTypes.bool.description("animate or not").defaultValue(true),
109
- percent: import_react_desc.PropTypes.number.description("completion percentage").defaultValue(50),
110
- lineOnly: import_react_desc.PropTypes.bool.description("hide the label from rendering")
95
+ containerProps: reactDesc.PropTypes.object.description('Set of Properties attached to the main container'),
96
+ title: reactDesc.PropTypes.string.description('component s label'),
97
+ processingCompleteTitle: reactDesc.PropTypes.string.description('label to display when the process is completed'),
98
+ processingFailTitle: reactDesc.PropTypes.string.description('label to display when the process has failed'),
99
+ complete: reactDesc.PropTypes.bool.description('Sets the process state to completed').defaultValue(false),
100
+ failed: reactDesc.PropTypes.bool.description('Sets the process state to failed').defaultValue(false),
101
+ processing: reactDesc.PropTypes.bool.description('Sets the process state to processing').defaultValue(false),
102
+ processingComplete: reactDesc.PropTypes.bool.description('Sets the process state to processing and then completed').defaultValue(false),
103
+ processingFail: reactDesc.PropTypes.bool.description('Sets the process state to processing and then failed').defaultValue(false),
104
+ animated: reactDesc.PropTypes.bool.description('animate or not').defaultValue(true),
105
+ percent: reactDesc.PropTypes.number.description('completion percentage').defaultValue(50),
106
+ lineOnly: reactDesc.PropTypes.bool.description('hide the label from rendering')
111
107
  };
112
- DSIndeterminateProgressIndicator.propTypes = indeterminateProgressIndicatorProps;
113
- const IndeterminateProgressIndicatorWithSchema = (0, import_react_desc.describe)(DSIndeterminateProgressIndicator);
108
+ const IndeterminateProgressIndicatorWithSchema = reactDesc.describe(DSIndeterminateProgressIndicator);
114
109
  IndeterminateProgressIndicatorWithSchema.propTypes = indeterminateProgressIndicatorProps;
115
- var DSIndeterminateProgressIndicator_default = DSIndeterminateProgressIndicator;
116
- module.exports = __toCommonJS(DSIndeterminateProgressIndicator_exports);
117
- //# sourceMappingURL=DSIndeterminateProgressIndicator.js.map
110
+
111
+ exports.DSIndeterminateProgressIndicator = DSIndeterminateProgressIndicator;
112
+ exports.IndeterminateProgressIndicatorWithSchema = IndeterminateProgressIndicatorWithSchema;
113
+ exports["default"] = DSIndeterminateProgressIndicator;
package/cjs/index.js CHANGED
@@ -1,36 +1,11 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
- }
18
- return target;
19
- };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var src_exports = {};
29
- __export(src_exports, {
30
- default: () => import_DSIndeterminateProgressIndicator.default
31
- });
32
- var React = __toESM(require("react"));
33
- __reExport(src_exports, require("./DSIndeterminateProgressIndicator"));
34
- var import_DSIndeterminateProgressIndicator = require("./DSIndeterminateProgressIndicator");
35
- module.exports = __toCommonJS(src_exports);
36
- //# sourceMappingURL=index.js.map
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var DSIndeterminateProgressIndicator = require('./DSIndeterminateProgressIndicator.js');
6
+
7
+
8
+
9
+ exports.DSIndeterminateProgressIndicator = DSIndeterminateProgressIndicator.DSIndeterminateProgressIndicator;
10
+ exports.IndeterminateProgressIndicatorWithSchema = DSIndeterminateProgressIndicator.IndeterminateProgressIndicatorWithSchema;
11
+ exports["default"] = DSIndeterminateProgressIndicator.DSIndeterminateProgressIndicator;
@@ -1,88 +1,101 @@
1
- import * as React from "react";
2
- import React2, { useEffect, useState } from "react";
3
- import { describe, PropTypes } from "react-desc";
4
- import { convertPropToCssClassName } from "@elliemae/ds-classnames";
5
- import DSTruncatedTooltipText from "@elliemae/ds-truncated-tooltip-text";
6
- const { cssClassName, classNameBlock, classNameElement } = convertPropToCssClassName("indeterminate-progress-indicator");
7
- function DSIndeterminateProgressIndicator({
8
- containerProps,
9
- title,
10
- complete,
11
- failed,
12
- processing,
13
- processingComplete,
14
- processingCompleteTitle,
15
- processingFail,
16
- processingFailTitle,
17
- animated,
18
- percent,
19
- lineOnly
20
- }) {
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.filter.js';
4
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
5
+ import 'core-js/modules/esnext.iterator.for-each.js';
6
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
7
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
8
+ import 'core-js/modules/web.dom-collections.iterator.js';
9
+ import { useState, useEffect } from 'react';
10
+ import { PropTypes, describe } from 'react-desc';
11
+ import { convertPropToCssClassName } from '@elliemae/ds-classnames';
12
+ import DSTruncatedTooltipText from '@elliemae/ds-truncated-tooltip-text';
13
+ import { jsxs } from 'react/jsx-runtime';
14
+
15
+ var _div;
16
+
17
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
18
+
19
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
20
+ const {
21
+ cssClassName,
22
+ classNameBlock,
23
+ classNameElement
24
+ } = convertPropToCssClassName('indeterminate-progress-indicator');
25
+
26
+ function DSIndeterminateProgressIndicator(_ref) {
27
+ let {
28
+ containerProps,
29
+ title,
30
+ complete,
31
+ failed,
32
+ processing,
33
+ processingComplete,
34
+ processingCompleteTitle,
35
+ processingFail,
36
+ processingFailTitle,
37
+ animated,
38
+ percent,
39
+ lineOnly
40
+ } = _ref;
21
41
  const [label, setLabel] = useState(title);
22
42
  useEffect(() => {
23
43
  if ((processingComplete || processingFail || processing) && (complete || failed)) {
24
44
  setLabel(complete ? processingCompleteTitle : processingFailTitle);
25
45
  }
26
46
  }, [failed, complete, processingComplete, processingFail, processing]);
27
- return /* @__PURE__ */ React2.createElement("div", {
47
+ return /*#__PURE__*/jsxs("div", _objectSpread(_objectSpread({
28
48
  "aria-busy": processing,
29
49
  "aria-label": label,
30
50
  "aria-live": "polite",
31
- className: `${cssClassName} ${!complete && !failed && !processing ? classNameBlock("default") : ""} ${complete ? classNameBlock("complete") : ""} ${failed ? classNameBlock("failed") : ""} ${processing ? classNameBlock("processing") : ""} ${animated && processing ? "animated" : ""}
32
- ${processingComplete ? classNameBlock("processing-complete") : ""}
33
- ${processingFail ? classNameBlock("processing-fail") : ""}
34
- ${lineOnly ? "line-only" : null}
35
- `,
36
- role: "alert",
37
- ...containerProps
38
- }, !lineOnly ? /* @__PURE__ */ React2.createElement(DSTruncatedTooltipText, {
39
- className: classNameBlock("tooltip-text"),
40
- containerComponent: /* @__PURE__ */ React2.createElement("div", null),
41
- value: label
42
- }) : null, /* @__PURE__ */ React2.createElement("div", {
43
- className: `${classNameElement("bar")}`
44
- }, /* @__PURE__ */ React2.createElement("div", {
45
- className: `${classNameElement("bar-indicator")}`,
46
- style: {
47
- width: `${!complete && !failed && !animated && processing ? percent : 100}%`
48
- }
49
- })));
51
+ className: "".concat(cssClassName, " ").concat(!complete && !failed && !processing ? classNameBlock('default') : '', " ").concat(complete ? classNameBlock('complete') : '', " ").concat( // eslint-disable-next-line max-len
52
+ failed ? classNameBlock('failed') : '', " ").concat(processing ? classNameBlock('processing') : '', " ").concat(animated && processing ? 'animated' : '', " \n ").concat(processingComplete ? classNameBlock('processing-complete') : '', " \n ").concat(processingFail ? classNameBlock('processing-fail') : '', " \n ").concat(lineOnly ? 'line-only' : null, "\n "),
53
+ role: "alert"
54
+ }, containerProps), {}, {
55
+ children: [!lineOnly ? /*#__PURE__*/_jsx(DSTruncatedTooltipText, {
56
+ className: classNameBlock('tooltip-text'),
57
+ containerComponent: _div || (_div = /*#__PURE__*/_jsx("div", {})),
58
+ value: label
59
+ }) : null, /*#__PURE__*/_jsx("div", {
60
+ className: "".concat(classNameElement('bar'))
61
+ }, void 0, /*#__PURE__*/_jsx("div", {
62
+ className: "".concat(classNameElement('bar-indicator')),
63
+ style: {
64
+ width: "".concat(!complete && !failed && !animated && processing ? percent : 100, "%")
65
+ }
66
+ }))]
67
+ }));
50
68
  }
69
+
51
70
  DSIndeterminateProgressIndicator.defaultProps = {
52
71
  containerProps: {},
53
- title: "",
72
+ title: '',
54
73
  complete: false,
55
74
  failed: false,
56
75
  processing: false,
57
76
  processingComplete: false,
58
- processingCompleteTitle: "Complete",
77
+ processingCompleteTitle: 'Complete',
59
78
  processingFail: false,
60
- processingFailTitle: "Fail",
79
+ processingFailTitle: 'Fail',
61
80
  animated: true,
62
81
  percent: 50,
63
82
  lineOnly: false
64
83
  };
65
84
  const indeterminateProgressIndicatorProps = {
66
- containerProps: PropTypes.object.description("Set of Properties attached to the main container"),
67
- title: PropTypes.string.description("component s label"),
68
- processingCompleteTitle: PropTypes.string.description("label to display when the process is completed"),
69
- processingFailTitle: PropTypes.string.description("label to display when the process has failed"),
70
- complete: PropTypes.bool.description("Sets the process state to completed").defaultValue(false),
71
- failed: PropTypes.bool.description("Sets the process state to failed").defaultValue(false),
72
- processing: PropTypes.bool.description("Sets the process state to processing").defaultValue(false),
73
- processingComplete: PropTypes.bool.description("Sets the process state to processing and then completed").defaultValue(false),
74
- processingFail: PropTypes.bool.description("Sets the process state to processing and then failed").defaultValue(false),
75
- animated: PropTypes.bool.description("animate or not").defaultValue(true),
76
- percent: PropTypes.number.description("completion percentage").defaultValue(50),
77
- lineOnly: PropTypes.bool.description("hide the label from rendering")
85
+ containerProps: PropTypes.object.description('Set of Properties attached to the main container'),
86
+ title: PropTypes.string.description('component s label'),
87
+ processingCompleteTitle: PropTypes.string.description('label to display when the process is completed'),
88
+ processingFailTitle: PropTypes.string.description('label to display when the process has failed'),
89
+ complete: PropTypes.bool.description('Sets the process state to completed').defaultValue(false),
90
+ failed: PropTypes.bool.description('Sets the process state to failed').defaultValue(false),
91
+ processing: PropTypes.bool.description('Sets the process state to processing').defaultValue(false),
92
+ processingComplete: PropTypes.bool.description('Sets the process state to processing and then completed').defaultValue(false),
93
+ processingFail: PropTypes.bool.description('Sets the process state to processing and then failed').defaultValue(false),
94
+ animated: PropTypes.bool.description('animate or not').defaultValue(true),
95
+ percent: PropTypes.number.description('completion percentage').defaultValue(50),
96
+ lineOnly: PropTypes.bool.description('hide the label from rendering')
78
97
  };
79
- DSIndeterminateProgressIndicator.propTypes = indeterminateProgressIndicatorProps;
80
98
  const IndeterminateProgressIndicatorWithSchema = describe(DSIndeterminateProgressIndicator);
81
99
  IndeterminateProgressIndicatorWithSchema.propTypes = indeterminateProgressIndicatorProps;
82
- var DSIndeterminateProgressIndicator_default = DSIndeterminateProgressIndicator;
83
- export {
84
- DSIndeterminateProgressIndicator,
85
- IndeterminateProgressIndicatorWithSchema,
86
- DSIndeterminateProgressIndicator_default as default
87
- };
88
- //# sourceMappingURL=DSIndeterminateProgressIndicator.js.map
100
+
101
+ export { DSIndeterminateProgressIndicator, IndeterminateProgressIndicatorWithSchema, DSIndeterminateProgressIndicator as default };
package/esm/index.js CHANGED
@@ -1,7 +1 @@
1
- import * as React from "react";
2
- export * from "./DSIndeterminateProgressIndicator";
3
- import { default as default2 } from "./DSIndeterminateProgressIndicator";
4
- export {
5
- default2 as default
6
- };
7
- //# sourceMappingURL=index.js.map
1
+ export { DSIndeterminateProgressIndicator, IndeterminateProgressIndicatorWithSchema, DSIndeterminateProgressIndicator as default } from './DSIndeterminateProgressIndicator.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-indeterminate-progress-indicator",
3
- "version": "2.2.0-alpha.4",
3
+ "version": "3.0.0-next.2",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Indeterminate Progress Indicator",
6
6
  "module": "./esm/index.js",
@@ -36,8 +36,8 @@
36
36
  "build": "node ../../scripts/build/build.js"
37
37
  },
38
38
  "dependencies": {
39
- "@elliemae/ds-classnames": "2.2.0-alpha.4",
40
- "@elliemae/ds-truncated-tooltip-text": "2.2.0-alpha.4",
39
+ "@elliemae/ds-classnames": "3.0.0-next.2",
40
+ "@elliemae/ds-truncated-tooltip-text": "3.0.0-next.2",
41
41
  "react-desc": "~4.1.3"
42
42
  },
43
43
  "peerDependencies": {
@@ -1,7 +0,0 @@
1
- {
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 'react-desc';\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\nfunction 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;\n\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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,mBAA2C;AAC3C,wBAAoC;AACpC,2BAA0C;AAC1C,uCAAmC;AAEnC,MAAM,EAAE,cAAc,gBAAgB,qBAAqB,oDACzD;AAGF,0CAA0C;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,GACC;AACD,QAAM,CAAC,OAAO,YAAY,2BAAS;AACnC,8BAAU,MAAM;AACd,QAAK,uBAAsB,kBAAkB,eAAgB,aAAY,SAAS;AAChF,eAAS,WAAW,0BAA0B;AAAA;AAAA,KAE/C,CAAC,QAAQ,UAAU,oBAAoB,gBAAgB;AAC1D,SACE,mDAAC,OAAD;AAAA,IACE,aAAW;AAAA,IACX,cAAY;AAAA,IACZ,aAAU;AAAA,IACV,WAAW,GAAG,gBAAgB,CAAC,YAAY,CAAC,UAAU,CAAC,aAAa,eAAe,aAAa,MAC9F,WAAW,eAAe,cAAc,OAGxC,SAAS,eAAe,YAAY,MAClC,aAAa,eAAe,gBAAgB,MAAM,YAAY,aAAa,aAAa;AAAA,WACvF,qBAAqB,eAAe,yBAAyB;AAAA,WAC7D,iBAAiB,eAAe,qBAAqB;AAAA,WACrD,WAAW,cAAc;AAAA;AAAA,IAE9B,MAAK;AAAA,OACD;AAAA,KAEH,CAAC,WACA,mDAAC,0CAAD;AAAA,IAAwB,WAAW,eAAe;AAAA,IAAiB,oBAAoB,mDAAC,OAAD;AAAA,IAAS,OAAO;AAAA,OACrG,MACJ,mDAAC,OAAD;AAAA,IAAK,WAAW,GAAG,iBAAiB;AAAA,KAClC,mDAAC,OAAD;AAAA,IACE,WAAW,GAAG,iBAAiB;AAAA,IAC/B,OAAO;AAAA,MACL,OAAO,GAAG,CAAC,YAAY,CAAC,UAAU,CAAC,YAAY,aAAa,UAAU;AAAA;AAAA;AAAA;AAQlF,iCAAiC,eAAe;AAAA,EAC9C,gBAAgB;AAAA,EAChB,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;AAAA;AAGZ,MAAM,sCAAsC;AAAA,EAC1C,gBAAgB,4BAAU,OAAO,YAAY;AAAA,EAC7C,OAAO,4BAAU,OAAO,YAAY;AAAA,EACpC,yBAAyB,4BAAU,OAAO,YAAY;AAAA,EACtD,qBAAqB,4BAAU,OAAO,YAAY;AAAA,EAClD,UAAU,4BAAU,KAAK,YAAY,uCAAuC,aAAa;AAAA,EACzF,QAAQ,4BAAU,KAAK,YAAY,oCAAoC,aAAa;AAAA,EACpF,YAAY,4BAAU,KAAK,YAAY,wCAAwC,aAAa;AAAA,EAC5F,oBAAoB,4BAAU,KAC3B,YAAY,2DACZ,aAAa;AAAA,EAChB,gBAAgB,4BAAU,KACvB,YAAY,wDACZ,aAAa;AAAA,EAChB,UAAU,4BAAU,KAAK,YAAY,kBAAkB,aAAa;AAAA,EACpE,SAAS,4BAAU,OAAO,YAAY,yBAAyB,aAAa;AAAA,EAC5E,UAAU,4BAAU,KAAK,YAAY;AAAA;AAGvC,iCAAiC,YAAY;AAE7C,MAAM,2CAA2C,gCAAS;AAE1D,yCAAyC,YAAY;AAGrD,IAAO,2CAAQ;",
6
- "names": []
7
- }
package/cjs/index.js.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["export * from './DSIndeterminateProgressIndicator';\nexport { default } from './DSIndeterminateProgressIndicator';\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc;AACd,8CAAwB;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
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 'react-desc';\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\nfunction 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;\n\nconst IndeterminateProgressIndicatorWithSchema = describe(DSIndeterminateProgressIndicator);\n\nIndeterminateProgressIndicatorWithSchema.propTypes = indeterminateProgressIndicatorProps;\n\nexport { DSIndeterminateProgressIndicator, IndeterminateProgressIndicatorWithSchema };\nexport default DSIndeterminateProgressIndicator;\n"],
5
- "mappings": "AAAA;ACGA;AACA;AACA;AACA;AAEA,MAAM,EAAE,cAAc,gBAAgB,qBAAqB,0BACzD;AAGF,0CAA0C;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,GACC;AACD,QAAM,CAAC,OAAO,YAAY,SAAS;AACnC,YAAU,MAAM;AACd,QAAK,uBAAsB,kBAAkB,eAAgB,aAAY,SAAS;AAChF,eAAS,WAAW,0BAA0B;AAAA;AAAA,KAE/C,CAAC,QAAQ,UAAU,oBAAoB,gBAAgB;AAC1D,SACE,qCAAC,OAAD;AAAA,IACE,aAAW;AAAA,IACX,cAAY;AAAA,IACZ,aAAU;AAAA,IACV,WAAW,GAAG,gBAAgB,CAAC,YAAY,CAAC,UAAU,CAAC,aAAa,eAAe,aAAa,MAC9F,WAAW,eAAe,cAAc,OAGxC,SAAS,eAAe,YAAY,MAClC,aAAa,eAAe,gBAAgB,MAAM,YAAY,aAAa,aAAa;AAAA,WACvF,qBAAqB,eAAe,yBAAyB;AAAA,WAC7D,iBAAiB,eAAe,qBAAqB;AAAA,WACrD,WAAW,cAAc;AAAA;AAAA,IAE9B,MAAK;AAAA,OACD;AAAA,KAEH,CAAC,WACA,qCAAC,wBAAD;AAAA,IAAwB,WAAW,eAAe;AAAA,IAAiB,oBAAoB,qCAAC,OAAD;AAAA,IAAS,OAAO;AAAA,OACrG,MACJ,qCAAC,OAAD;AAAA,IAAK,WAAW,GAAG,iBAAiB;AAAA,KAClC,qCAAC,OAAD;AAAA,IACE,WAAW,GAAG,iBAAiB;AAAA,IAC/B,OAAO;AAAA,MACL,OAAO,GAAG,CAAC,YAAY,CAAC,UAAU,CAAC,YAAY,aAAa,UAAU;AAAA;AAAA;AAAA;AAQlF,iCAAiC,eAAe;AAAA,EAC9C,gBAAgB;AAAA,EAChB,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;AAAA;AAGZ,MAAM,sCAAsC;AAAA,EAC1C,gBAAgB,UAAU,OAAO,YAAY;AAAA,EAC7C,OAAO,UAAU,OAAO,YAAY;AAAA,EACpC,yBAAyB,UAAU,OAAO,YAAY;AAAA,EACtD,qBAAqB,UAAU,OAAO,YAAY;AAAA,EAClD,UAAU,UAAU,KAAK,YAAY,uCAAuC,aAAa;AAAA,EACzF,QAAQ,UAAU,KAAK,YAAY,oCAAoC,aAAa;AAAA,EACpF,YAAY,UAAU,KAAK,YAAY,wCAAwC,aAAa;AAAA,EAC5F,oBAAoB,UAAU,KAC3B,YAAY,2DACZ,aAAa;AAAA,EAChB,gBAAgB,UAAU,KACvB,YAAY,wDACZ,aAAa;AAAA,EAChB,UAAU,UAAU,KAAK,YAAY,kBAAkB,aAAa;AAAA,EACpE,SAAS,UAAU,OAAO,YAAY,yBAAyB,aAAa;AAAA,EAC5E,UAAU,UAAU,KAAK,YAAY;AAAA;AAGvC,iCAAiC,YAAY;AAE7C,MAAM,2CAA2C,SAAS;AAE1D,yCAAyC,YAAY;AAGrD,IAAO,2CAAQ;",
6
- "names": []
7
- }
package/esm/index.js.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './DSIndeterminateProgressIndicator';\nexport { default } from './DSIndeterminateProgressIndicator';\n"],
5
- "mappings": "AAAA;ACAA;AACA;",
6
- "names": []
7
- }