@elliemae/ds-spinner 2.2.0-next.4 → 2.3.0-alpha.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.
- package/cjs/DSSpinner.js +100 -101
- package/cjs/DSSpinner.js.map +7 -0
- package/cjs/index.js +37 -11
- package/cjs/index.js.map +7 -0
- package/esm/DSSpinner.js +71 -89
- package/esm/DSSpinner.js.map +7 -0
- package/esm/index.js +8 -1
- package/esm/index.js.map +7 -0
- package/package.json +2 -2
- package/types/DSSpinner.d.ts +1 -7
- package/types/index.d.ts +1 -2
package/cjs/DSSpinner.js
CHANGED
|
@@ -1,108 +1,107 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
12
|
-
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
13
|
-
require('react');
|
|
14
|
-
var reactDesc = require('react-desc');
|
|
15
|
-
var dsClassnames = require('@elliemae/ds-classnames');
|
|
16
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
17
|
-
|
|
18
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
|
-
|
|
20
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
21
|
-
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
22
|
-
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
23
|
-
|
|
24
|
-
var _svg, _svg2, _svg3, _svg4;
|
|
25
|
-
|
|
26
|
-
const _excluded = ["containerProps", "innerRef", "message", "size"];
|
|
27
|
-
|
|
28
|
-
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; }
|
|
29
|
-
|
|
30
|
-
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; }
|
|
31
|
-
const blockName = 'spinner';
|
|
32
|
-
const SpinnerContainer = dsClassnames.aggregatedClasses('div')(blockName);
|
|
33
|
-
const SpinnerMessage = dsClassnames.aggregatedClasses('span')(blockName, 'message');
|
|
34
|
-
const Spinner = dsClassnames.aggregatedClasses('div')(blockName, 'spinner'); // TODO: do we want dynamic position of the text (top, right, bottom, left)?
|
|
35
|
-
|
|
36
|
-
const DSSpinner = _ref => {
|
|
37
|
-
let {
|
|
38
|
-
containerProps = {},
|
|
39
|
-
innerRef,
|
|
40
|
-
message,
|
|
41
|
-
size
|
|
42
|
-
} = _ref,
|
|
43
|
-
otherProps = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
44
|
-
|
|
45
|
-
return /*#__PURE__*/jsxRuntime.jsxs(SpinnerContainer, _objectSpread(_objectSpread(_objectSpread({}, containerProps), {}, {
|
|
46
|
-
ref: innerRef,
|
|
47
|
-
"aria-busy": true,
|
|
48
|
-
"aria-label": message,
|
|
49
|
-
"aria-live": "polite",
|
|
50
|
-
role: "alert"
|
|
51
|
-
}, otherProps), {}, {
|
|
52
|
-
children: [/*#__PURE__*/_jsx__default["default"](Spinner, {
|
|
53
|
-
classProps: {
|
|
54
|
-
size
|
|
55
|
-
}
|
|
56
|
-
}, void 0, _svg || (_svg = /*#__PURE__*/_jsx__default["default"]("svg", {
|
|
57
|
-
className: "".concat(blockName, "-tl"),
|
|
58
|
-
viewBox: "0 0 16.6 16.6",
|
|
59
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
60
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"]("path", {
|
|
61
|
-
d: "M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z",
|
|
62
|
-
fill: "#408a90",
|
|
63
|
-
stroke: "#fbfbfb"
|
|
64
|
-
}))), _svg2 || (_svg2 = /*#__PURE__*/_jsx__default["default"]("svg", {
|
|
65
|
-
className: "".concat(blockName, "-tr"),
|
|
66
|
-
viewBox: "0 0 16.6 16.6",
|
|
67
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
68
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"]("path", {
|
|
69
|
-
d: "M16.1,16.1A15.6,15.6,0,0,0,.5.5,15.6,15.6,0,0,0,16.1,16.1Z",
|
|
70
|
-
fill: "#f7901e",
|
|
71
|
-
stroke: "#fbfbfb"
|
|
72
|
-
}))), _svg3 || (_svg3 = /*#__PURE__*/_jsx__default["default"]("svg", {
|
|
73
|
-
className: "".concat(blockName, "-br"),
|
|
74
|
-
viewBox: "0 0 16.6 16.6",
|
|
75
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
76
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"]("path", {
|
|
77
|
-
d: "M.5.5A15.6,15.6,0,0,0,16.1,16.1,15.6,15.6,0,0,0,.5.5Z",
|
|
78
|
-
fill: "#0067ab",
|
|
79
|
-
stroke: "#fbfbfb"
|
|
80
|
-
}))), _svg4 || (_svg4 = /*#__PURE__*/_jsx__default["default"]("svg", {
|
|
81
|
-
className: "".concat(blockName, "-bl"),
|
|
82
|
-
viewBox: "0 0 16.6 16.6",
|
|
83
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
84
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"]("path", {
|
|
85
|
-
d: "M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z",
|
|
86
|
-
fill: "#00acdc",
|
|
87
|
-
stroke: "#fbfbfb"
|
|
88
|
-
})))), message && /*#__PURE__*/_jsx__default["default"](SpinnerMessage, {}, void 0, message)]
|
|
89
|
-
}));
|
|
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 });
|
|
90
11
|
};
|
|
91
|
-
|
|
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 DSSpinner_exports = {};
|
|
29
|
+
__export(DSSpinner_exports, {
|
|
30
|
+
DSSpinner: () => DSSpinner,
|
|
31
|
+
SpinnerWithSchema: () => SpinnerWithSchema,
|
|
32
|
+
default: () => DSSpinner_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
|
+
const blockName = "spinner";
|
|
39
|
+
const SpinnerContainer = (0, import_ds_classnames.aggregatedClasses)("div")(blockName);
|
|
40
|
+
const SpinnerMessage = (0, import_ds_classnames.aggregatedClasses)("span")(blockName, "message");
|
|
41
|
+
const Spinner = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "spinner");
|
|
42
|
+
const DSSpinner = ({
|
|
43
|
+
containerProps = {},
|
|
44
|
+
innerRef,
|
|
45
|
+
message,
|
|
46
|
+
size,
|
|
47
|
+
...otherProps
|
|
48
|
+
}) => /* @__PURE__ */ import_react.default.createElement(SpinnerContainer, {
|
|
49
|
+
...containerProps,
|
|
50
|
+
ref: innerRef,
|
|
51
|
+
"aria-busy": true,
|
|
52
|
+
"aria-label": message,
|
|
53
|
+
"aria-live": "polite",
|
|
54
|
+
role: "alert",
|
|
55
|
+
...otherProps
|
|
56
|
+
}, /* @__PURE__ */ import_react.default.createElement(Spinner, {
|
|
57
|
+
classProps: { size }
|
|
58
|
+
}, /* @__PURE__ */ import_react.default.createElement("svg", {
|
|
59
|
+
className: `${blockName}-tl`,
|
|
60
|
+
viewBox: "0 0 16.6 16.6",
|
|
61
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
62
|
+
}, /* @__PURE__ */ import_react.default.createElement("path", {
|
|
63
|
+
d: "M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z",
|
|
64
|
+
fill: "#408a90",
|
|
65
|
+
stroke: "#fbfbfb"
|
|
66
|
+
})), /* @__PURE__ */ import_react.default.createElement("svg", {
|
|
67
|
+
className: `${blockName}-tr`,
|
|
68
|
+
viewBox: "0 0 16.6 16.6",
|
|
69
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
70
|
+
}, /* @__PURE__ */ import_react.default.createElement("path", {
|
|
71
|
+
d: "M16.1,16.1A15.6,15.6,0,0,0,.5.5,15.6,15.6,0,0,0,16.1,16.1Z",
|
|
72
|
+
fill: "#f7901e",
|
|
73
|
+
stroke: "#fbfbfb"
|
|
74
|
+
})), /* @__PURE__ */ import_react.default.createElement("svg", {
|
|
75
|
+
className: `${blockName}-br`,
|
|
76
|
+
viewBox: "0 0 16.6 16.6",
|
|
77
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
78
|
+
}, /* @__PURE__ */ import_react.default.createElement("path", {
|
|
79
|
+
d: "M.5.5A15.6,15.6,0,0,0,16.1,16.1,15.6,15.6,0,0,0,.5.5Z",
|
|
80
|
+
fill: "#0067ab",
|
|
81
|
+
stroke: "#fbfbfb"
|
|
82
|
+
})), /* @__PURE__ */ import_react.default.createElement("svg", {
|
|
83
|
+
className: `${blockName}-bl`,
|
|
84
|
+
viewBox: "0 0 16.6 16.6",
|
|
85
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
86
|
+
}, /* @__PURE__ */ import_react.default.createElement("path", {
|
|
87
|
+
d: "M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z",
|
|
88
|
+
fill: "#00acdc",
|
|
89
|
+
stroke: "#fbfbfb"
|
|
90
|
+
}))), message && /* @__PURE__ */ import_react.default.createElement(SpinnerMessage, null, message));
|
|
92
91
|
DSSpinner.defaultProps = {
|
|
93
92
|
containerProps: {},
|
|
94
|
-
message:
|
|
95
|
-
size:
|
|
93
|
+
message: "",
|
|
94
|
+
size: "m"
|
|
96
95
|
};
|
|
97
96
|
const spinnerProps = {
|
|
98
|
-
innerRef:
|
|
99
|
-
containerProps:
|
|
100
|
-
message:
|
|
101
|
-
size:
|
|
97
|
+
innerRef: import_react_desc.PropTypes.object.description("ref to the component s container"),
|
|
98
|
+
containerProps: import_react_desc.PropTypes.object.description("Set of Properties attached to the main container"),
|
|
99
|
+
message: import_react_desc.PropTypes.string.description("Text below the spinner"),
|
|
100
|
+
size: import_react_desc.PropTypes.oneOf(["s", "m", "l"]).description("Spinner size").defaultValue("m")
|
|
102
101
|
};
|
|
103
|
-
|
|
102
|
+
DSSpinner.propTypes = spinnerProps;
|
|
103
|
+
const SpinnerWithSchema = (0, import_react_desc.describe)(DSSpinner);
|
|
104
104
|
SpinnerWithSchema.propTypes = spinnerProps;
|
|
105
|
-
|
|
106
|
-
exports
|
|
107
|
-
|
|
108
|
-
exports["default"] = DSSpinner;
|
|
105
|
+
var DSSpinner_default = DSSpinner;
|
|
106
|
+
module.exports = __toCommonJS(DSSpinner_exports);
|
|
107
|
+
//# sourceMappingURL=DSSpinner.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/DSSpinner.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable import/no-unresolved */\nimport React from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\n\nconst blockName = 'spinner';\n\nconst SpinnerContainer = aggregatedClasses('div')(blockName);\nconst SpinnerMessage = aggregatedClasses('span')(blockName, 'message');\nconst Spinner = aggregatedClasses('div')(blockName, 'spinner');\n\n// TODO: do we want dynamic position of the text (top, right, bottom, left)?\n\nconst DSSpinner = ({\n containerProps = {},\n innerRef,\n message,\n size,\n ...otherProps\n}) => (\n <SpinnerContainer\n {...containerProps}\n ref={innerRef}\n aria-busy\n aria-label={message}\n aria-live=\"polite\"\n role=\"alert\"\n {...otherProps}\n >\n <Spinner classProps={{ size }}>\n <svg\n className={`${blockName}-tl`}\n viewBox=\"0 0 16.6 16.6\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z\"\n fill=\"#408a90\"\n stroke=\"#fbfbfb\"\n />\n </svg>\n <svg\n className={`${blockName}-tr`}\n viewBox=\"0 0 16.6 16.6\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M16.1,16.1A15.6,15.6,0,0,0,.5.5,15.6,15.6,0,0,0,16.1,16.1Z\"\n fill=\"#f7901e\"\n stroke=\"#fbfbfb\"\n />\n </svg>\n <svg\n className={`${blockName}-br`}\n viewBox=\"0 0 16.6 16.6\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M.5.5A15.6,15.6,0,0,0,16.1,16.1,15.6,15.6,0,0,0,.5.5Z\"\n fill=\"#0067ab\"\n stroke=\"#fbfbfb\"\n />\n </svg>\n <svg\n className={`${blockName}-bl`}\n viewBox=\"0 0 16.6 16.6\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z\"\n fill=\"#00acdc\"\n stroke=\"#fbfbfb\"\n />\n </svg>\n </Spinner>\n {message && <SpinnerMessage>{message}</SpinnerMessage>}\n </SpinnerContainer>\n);\n\nDSSpinner.defaultProps = {\n containerProps: {},\n message: '',\n size: 'm',\n};\n\nconst spinnerProps = {\n innerRef: PropTypes.object.description('ref to the component s container'),\n containerProps: PropTypes.object.description(\n 'Set of Properties attached to the main container',\n ),\n message: PropTypes.string.description('Text below the spinner'),\n size: PropTypes.oneOf(['s', 'm', 'l'])\n .description('Spinner size')\n .defaultValue('m'),\n};\n\nDSSpinner.propTypes = spinnerProps;\n\nconst SpinnerWithSchema = describe(DSSpinner);\nSpinnerWithSchema.propTypes = spinnerProps;\n\nexport { DSSpinner, SpinnerWithSchema };\nexport default DSSpinner;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAClB,wBAAoC;AACpC,2BAAkC;AAElC,MAAM,YAAY;AAElB,MAAM,mBAAmB,4CAAkB,OAAO;AAClD,MAAM,iBAAiB,4CAAkB,QAAQ,WAAW;AAC5D,MAAM,UAAU,4CAAkB,OAAO,WAAW;AAIpD,MAAM,YAAY,CAAC;AAAA,EACjB,iBAAiB;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,KACG;AAAA,MAEH,mDAAC,kBAAD;AAAA,KACM;AAAA,EACJ,KAAK;AAAA,EACL,aAAS;AAAA,EACT,cAAY;AAAA,EACZ,aAAU;AAAA,EACV,MAAK;AAAA,KACD;AAAA,GAEJ,mDAAC,SAAD;AAAA,EAAS,YAAY,EAAE;AAAA,GACrB,mDAAC,OAAD;AAAA,EACE,WAAW,GAAG;AAAA,EACd,SAAQ;AAAA,EACR,OAAM;AAAA,GAEN,mDAAC,QAAD;AAAA,EACE,GAAE;AAAA,EACF,MAAK;AAAA,EACL,QAAO;AAAA,KAGX,mDAAC,OAAD;AAAA,EACE,WAAW,GAAG;AAAA,EACd,SAAQ;AAAA,EACR,OAAM;AAAA,GAEN,mDAAC,QAAD;AAAA,EACE,GAAE;AAAA,EACF,MAAK;AAAA,EACL,QAAO;AAAA,KAGX,mDAAC,OAAD;AAAA,EACE,WAAW,GAAG;AAAA,EACd,SAAQ;AAAA,EACR,OAAM;AAAA,GAEN,mDAAC,QAAD;AAAA,EACE,GAAE;AAAA,EACF,MAAK;AAAA,EACL,QAAO;AAAA,KAGX,mDAAC,OAAD;AAAA,EACE,WAAW,GAAG;AAAA,EACd,SAAQ;AAAA,EACR,OAAM;AAAA,GAEN,mDAAC,QAAD;AAAA,EACE,GAAE;AAAA,EACF,MAAK;AAAA,EACL,QAAO;AAAA,MAIZ,WAAW,mDAAC,gBAAD,MAAiB;AAIjC,UAAU,eAAe;AAAA,EACvB,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,MAAM;AAAA;AAGR,MAAM,eAAe;AAAA,EACnB,UAAU,4BAAU,OAAO,YAAY;AAAA,EACvC,gBAAgB,4BAAU,OAAO,YAC/B;AAAA,EAEF,SAAS,4BAAU,OAAO,YAAY;AAAA,EACtC,MAAM,4BAAU,MAAM,CAAC,KAAK,KAAK,MAC9B,YAAY,gBACZ,aAAa;AAAA;AAGlB,UAAU,YAAY;AAEtB,MAAM,oBAAoB,gCAAS;AACnC,kBAAkB,YAAY;AAG9B,IAAO,oBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/cjs/index.js
CHANGED
|
@@ -1,11 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
+
DSSpinner: () => import_DSSpinner.DSSpinner,
|
|
31
|
+
SpinnerWithSchema: () => import_DSSpinner.SpinnerWithSchema,
|
|
32
|
+
default: () => import_DSSpinner.default
|
|
33
|
+
});
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_DSSpinner = __toESM(require("./DSSpinner"));
|
|
36
|
+
module.exports = __toCommonJS(src_exports);
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
package/cjs/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export { DSSpinner, SpinnerWithSchema, default } from './DSSpinner';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAsD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/esm/DSSpinner.js
CHANGED
|
@@ -1,96 +1,78 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}, void 0, /*#__PURE__*/_jsx("path", {
|
|
59
|
-
d: "M16.1,16.1A15.6,15.6,0,0,0,.5.5,15.6,15.6,0,0,0,16.1,16.1Z",
|
|
60
|
-
fill: "#f7901e",
|
|
61
|
-
stroke: "#fbfbfb"
|
|
62
|
-
}))), _svg3 || (_svg3 = /*#__PURE__*/_jsx("svg", {
|
|
63
|
-
className: "".concat(blockName, "-br"),
|
|
64
|
-
viewBox: "0 0 16.6 16.6",
|
|
65
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
66
|
-
}, void 0, /*#__PURE__*/_jsx("path", {
|
|
67
|
-
d: "M.5.5A15.6,15.6,0,0,0,16.1,16.1,15.6,15.6,0,0,0,.5.5Z",
|
|
68
|
-
fill: "#0067ab",
|
|
69
|
-
stroke: "#fbfbfb"
|
|
70
|
-
}))), _svg4 || (_svg4 = /*#__PURE__*/_jsx("svg", {
|
|
71
|
-
className: "".concat(blockName, "-bl"),
|
|
72
|
-
viewBox: "0 0 16.6 16.6",
|
|
73
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
74
|
-
}, void 0, /*#__PURE__*/_jsx("path", {
|
|
75
|
-
d: "M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z",
|
|
76
|
-
fill: "#00acdc",
|
|
77
|
-
stroke: "#fbfbfb"
|
|
78
|
-
})))), message && /*#__PURE__*/_jsx(SpinnerMessage, {}, void 0, message)]
|
|
79
|
-
}));
|
|
80
|
-
};
|
|
81
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { describe, PropTypes } from "react-desc";
|
|
4
|
+
import { aggregatedClasses } from "@elliemae/ds-classnames";
|
|
5
|
+
const blockName = "spinner";
|
|
6
|
+
const SpinnerContainer = aggregatedClasses("div")(blockName);
|
|
7
|
+
const SpinnerMessage = aggregatedClasses("span")(blockName, "message");
|
|
8
|
+
const Spinner = aggregatedClasses("div")(blockName, "spinner");
|
|
9
|
+
const DSSpinner = ({
|
|
10
|
+
containerProps = {},
|
|
11
|
+
innerRef,
|
|
12
|
+
message,
|
|
13
|
+
size,
|
|
14
|
+
...otherProps
|
|
15
|
+
}) => /* @__PURE__ */ React2.createElement(SpinnerContainer, {
|
|
16
|
+
...containerProps,
|
|
17
|
+
ref: innerRef,
|
|
18
|
+
"aria-busy": true,
|
|
19
|
+
"aria-label": message,
|
|
20
|
+
"aria-live": "polite",
|
|
21
|
+
role: "alert",
|
|
22
|
+
...otherProps
|
|
23
|
+
}, /* @__PURE__ */ React2.createElement(Spinner, {
|
|
24
|
+
classProps: { size }
|
|
25
|
+
}, /* @__PURE__ */ React2.createElement("svg", {
|
|
26
|
+
className: `${blockName}-tl`,
|
|
27
|
+
viewBox: "0 0 16.6 16.6",
|
|
28
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
29
|
+
}, /* @__PURE__ */ React2.createElement("path", {
|
|
30
|
+
d: "M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z",
|
|
31
|
+
fill: "#408a90",
|
|
32
|
+
stroke: "#fbfbfb"
|
|
33
|
+
})), /* @__PURE__ */ React2.createElement("svg", {
|
|
34
|
+
className: `${blockName}-tr`,
|
|
35
|
+
viewBox: "0 0 16.6 16.6",
|
|
36
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
37
|
+
}, /* @__PURE__ */ React2.createElement("path", {
|
|
38
|
+
d: "M16.1,16.1A15.6,15.6,0,0,0,.5.5,15.6,15.6,0,0,0,16.1,16.1Z",
|
|
39
|
+
fill: "#f7901e",
|
|
40
|
+
stroke: "#fbfbfb"
|
|
41
|
+
})), /* @__PURE__ */ React2.createElement("svg", {
|
|
42
|
+
className: `${blockName}-br`,
|
|
43
|
+
viewBox: "0 0 16.6 16.6",
|
|
44
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
45
|
+
}, /* @__PURE__ */ React2.createElement("path", {
|
|
46
|
+
d: "M.5.5A15.6,15.6,0,0,0,16.1,16.1,15.6,15.6,0,0,0,.5.5Z",
|
|
47
|
+
fill: "#0067ab",
|
|
48
|
+
stroke: "#fbfbfb"
|
|
49
|
+
})), /* @__PURE__ */ React2.createElement("svg", {
|
|
50
|
+
className: `${blockName}-bl`,
|
|
51
|
+
viewBox: "0 0 16.6 16.6",
|
|
52
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
53
|
+
}, /* @__PURE__ */ React2.createElement("path", {
|
|
54
|
+
d: "M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z",
|
|
55
|
+
fill: "#00acdc",
|
|
56
|
+
stroke: "#fbfbfb"
|
|
57
|
+
}))), message && /* @__PURE__ */ React2.createElement(SpinnerMessage, null, message));
|
|
82
58
|
DSSpinner.defaultProps = {
|
|
83
59
|
containerProps: {},
|
|
84
|
-
message:
|
|
85
|
-
size:
|
|
60
|
+
message: "",
|
|
61
|
+
size: "m"
|
|
86
62
|
};
|
|
87
63
|
const spinnerProps = {
|
|
88
|
-
innerRef: PropTypes.object.description(
|
|
89
|
-
containerProps: PropTypes.object.description(
|
|
90
|
-
message: PropTypes.string.description(
|
|
91
|
-
size: PropTypes.oneOf([
|
|
64
|
+
innerRef: PropTypes.object.description("ref to the component s container"),
|
|
65
|
+
containerProps: PropTypes.object.description("Set of Properties attached to the main container"),
|
|
66
|
+
message: PropTypes.string.description("Text below the spinner"),
|
|
67
|
+
size: PropTypes.oneOf(["s", "m", "l"]).description("Spinner size").defaultValue("m")
|
|
92
68
|
};
|
|
69
|
+
DSSpinner.propTypes = spinnerProps;
|
|
93
70
|
const SpinnerWithSchema = describe(DSSpinner);
|
|
94
71
|
SpinnerWithSchema.propTypes = spinnerProps;
|
|
95
|
-
|
|
96
|
-
export {
|
|
72
|
+
var DSSpinner_default = DSSpinner;
|
|
73
|
+
export {
|
|
74
|
+
DSSpinner,
|
|
75
|
+
SpinnerWithSchema,
|
|
76
|
+
DSSpinner_default as default
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=DSSpinner.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSSpinner.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable import/no-unresolved */\nimport React from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\n\nconst blockName = 'spinner';\n\nconst SpinnerContainer = aggregatedClasses('div')(blockName);\nconst SpinnerMessage = aggregatedClasses('span')(blockName, 'message');\nconst Spinner = aggregatedClasses('div')(blockName, 'spinner');\n\n// TODO: do we want dynamic position of the text (top, right, bottom, left)?\n\nconst DSSpinner = ({\n containerProps = {},\n innerRef,\n message,\n size,\n ...otherProps\n}) => (\n <SpinnerContainer\n {...containerProps}\n ref={innerRef}\n aria-busy\n aria-label={message}\n aria-live=\"polite\"\n role=\"alert\"\n {...otherProps}\n >\n <Spinner classProps={{ size }}>\n <svg\n className={`${blockName}-tl`}\n viewBox=\"0 0 16.6 16.6\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z\"\n fill=\"#408a90\"\n stroke=\"#fbfbfb\"\n />\n </svg>\n <svg\n className={`${blockName}-tr`}\n viewBox=\"0 0 16.6 16.6\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M16.1,16.1A15.6,15.6,0,0,0,.5.5,15.6,15.6,0,0,0,16.1,16.1Z\"\n fill=\"#f7901e\"\n stroke=\"#fbfbfb\"\n />\n </svg>\n <svg\n className={`${blockName}-br`}\n viewBox=\"0 0 16.6 16.6\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M.5.5A15.6,15.6,0,0,0,16.1,16.1,15.6,15.6,0,0,0,.5.5Z\"\n fill=\"#0067ab\"\n stroke=\"#fbfbfb\"\n />\n </svg>\n <svg\n className={`${blockName}-bl`}\n viewBox=\"0 0 16.6 16.6\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z\"\n fill=\"#00acdc\"\n stroke=\"#fbfbfb\"\n />\n </svg>\n </Spinner>\n {message && <SpinnerMessage>{message}</SpinnerMessage>}\n </SpinnerContainer>\n);\n\nDSSpinner.defaultProps = {\n containerProps: {},\n message: '',\n size: 'm',\n};\n\nconst spinnerProps = {\n innerRef: PropTypes.object.description('ref to the component s container'),\n containerProps: PropTypes.object.description(\n 'Set of Properties attached to the main container',\n ),\n message: PropTypes.string.description('Text below the spinner'),\n size: PropTypes.oneOf(['s', 'm', 'l'])\n .description('Spinner size')\n .defaultValue('m'),\n};\n\nDSSpinner.propTypes = spinnerProps;\n\nconst SpinnerWithSchema = describe(DSSpinner);\nSpinnerWithSchema.propTypes = spinnerProps;\n\nexport { DSSpinner, SpinnerWithSchema };\nexport default DSSpinner;\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AAEA,MAAM,YAAY;AAElB,MAAM,mBAAmB,kBAAkB,OAAO;AAClD,MAAM,iBAAiB,kBAAkB,QAAQ,WAAW;AAC5D,MAAM,UAAU,kBAAkB,OAAO,WAAW;AAIpD,MAAM,YAAY,CAAC;AAAA,EACjB,iBAAiB;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,KACG;AAAA,MAEH,qCAAC,kBAAD;AAAA,KACM;AAAA,EACJ,KAAK;AAAA,EACL,aAAS;AAAA,EACT,cAAY;AAAA,EACZ,aAAU;AAAA,EACV,MAAK;AAAA,KACD;AAAA,GAEJ,qCAAC,SAAD;AAAA,EAAS,YAAY,EAAE;AAAA,GACrB,qCAAC,OAAD;AAAA,EACE,WAAW,GAAG;AAAA,EACd,SAAQ;AAAA,EACR,OAAM;AAAA,GAEN,qCAAC,QAAD;AAAA,EACE,GAAE;AAAA,EACF,MAAK;AAAA,EACL,QAAO;AAAA,KAGX,qCAAC,OAAD;AAAA,EACE,WAAW,GAAG;AAAA,EACd,SAAQ;AAAA,EACR,OAAM;AAAA,GAEN,qCAAC,QAAD;AAAA,EACE,GAAE;AAAA,EACF,MAAK;AAAA,EACL,QAAO;AAAA,KAGX,qCAAC,OAAD;AAAA,EACE,WAAW,GAAG;AAAA,EACd,SAAQ;AAAA,EACR,OAAM;AAAA,GAEN,qCAAC,QAAD;AAAA,EACE,GAAE;AAAA,EACF,MAAK;AAAA,EACL,QAAO;AAAA,KAGX,qCAAC,OAAD;AAAA,EACE,WAAW,GAAG;AAAA,EACd,SAAQ;AAAA,EACR,OAAM;AAAA,GAEN,qCAAC,QAAD;AAAA,EACE,GAAE;AAAA,EACF,MAAK;AAAA,EACL,QAAO;AAAA,MAIZ,WAAW,qCAAC,gBAAD,MAAiB;AAIjC,UAAU,eAAe;AAAA,EACvB,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,MAAM;AAAA;AAGR,MAAM,eAAe;AAAA,EACnB,UAAU,UAAU,OAAO,YAAY;AAAA,EACvC,gBAAgB,UAAU,OAAO,YAC/B;AAAA,EAEF,SAAS,UAAU,OAAO,YAAY;AAAA,EACtC,MAAM,UAAU,MAAM,CAAC,KAAK,KAAK,MAC9B,YAAY,gBACZ,aAAa;AAAA;AAGlB,UAAU,YAAY;AAEtB,MAAM,oBAAoB,SAAS;AACnC,kBAAkB,YAAY;AAG9B,IAAO,oBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/esm/index.js
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { DSSpinner, SpinnerWithSchema, default as default2 } from "./DSSpinner";
|
|
3
|
+
export {
|
|
4
|
+
DSSpinner,
|
|
5
|
+
SpinnerWithSchema,
|
|
6
|
+
default2 as default
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DSSpinner, SpinnerWithSchema, default } from './DSSpinner';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-spinner",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0-alpha.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Spinner",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"build": "node ../../scripts/build/build.js"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@elliemae/ds-classnames": "2.
|
|
39
|
+
"@elliemae/ds-classnames": "2.3.0-alpha.2",
|
|
40
40
|
"react-desc": "~4.1.3"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
package/types/DSSpinner.d.ts
CHANGED
|
@@ -38,13 +38,7 @@ declare const DSSpinner: {
|
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
declare const SpinnerWithSchema: {
|
|
41
|
-
(props?:
|
|
42
|
-
[x: string]: any;
|
|
43
|
-
containerProps?: {} | undefined;
|
|
44
|
-
innerRef: any;
|
|
45
|
-
message: any;
|
|
46
|
-
size: any;
|
|
47
|
-
} | undefined): JSX.Element;
|
|
41
|
+
(props?: unknown): JSX.Element;
|
|
48
42
|
propTypes: unknown;
|
|
49
43
|
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
50
44
|
};
|
package/types/index.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { default } from './DSSpinner';
|
|
1
|
+
export { DSSpinner, SpinnerWithSchema, default } from './DSSpinner';
|