@elliemae/ds-spinner 3.4.3-rc.1 → 3.5.0-rc.10

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.
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  }
18
18
  return to;
19
19
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
21
24
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
25
  var DSSpinner_exports = {};
23
26
  __export(DSSpinner_exports, {
@@ -27,56 +30,83 @@ __export(DSSpinner_exports, {
27
30
  });
28
31
  module.exports = __toCommonJS(DSSpinner_exports);
29
32
  var React = __toESM(require("react"));
30
- var import_react = __toESM(require("react"));
33
+ var import_jsx_runtime = require("react/jsx-runtime");
34
+ var import_react = require("react");
31
35
  var import_ds_utilities = require("@elliemae/ds-utilities");
32
36
  var import_ds_classnames = require("@elliemae/ds-classnames");
33
37
  const blockName = "spinner";
34
38
  const SpinnerContainer = (0, import_ds_classnames.aggregatedClasses)("div")(blockName);
35
39
  const SpinnerMessage = (0, import_ds_classnames.aggregatedClasses)("span")(blockName, "message");
36
40
  const Spinner = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "spinner");
37
- const DSSpinner = ({ containerProps = {}, innerRef, message, size, ...otherProps }) => /* @__PURE__ */ import_react.default.createElement(SpinnerContainer, {
38
- ...containerProps,
39
- ref: innerRef,
40
- "aria-busy": true,
41
- "aria-label": message,
42
- "aria-live": "polite",
43
- role: "alert",
44
- ...otherProps
45
- }, /* @__PURE__ */ import_react.default.createElement(Spinner, {
46
- classProps: { size }
47
- }, /* @__PURE__ */ import_react.default.createElement("svg", {
48
- className: `${blockName}-tl`,
49
- viewBox: "0 0 16.6 16.6",
50
- xmlns: "http://www.w3.org/2000/svg"
51
- }, /* @__PURE__ */ import_react.default.createElement("path", {
52
- d: "M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z",
53
- fill: "#408a90",
54
- stroke: "#fbfbfb"
55
- })), /* @__PURE__ */ import_react.default.createElement("svg", {
56
- className: `${blockName}-tr`,
57
- viewBox: "0 0 16.6 16.6",
58
- xmlns: "http://www.w3.org/2000/svg"
59
- }, /* @__PURE__ */ import_react.default.createElement("path", {
60
- d: "M16.1,16.1A15.6,15.6,0,0,0,.5.5,15.6,15.6,0,0,0,16.1,16.1Z",
61
- fill: "#f7901e",
62
- stroke: "#fbfbfb"
63
- })), /* @__PURE__ */ import_react.default.createElement("svg", {
64
- className: `${blockName}-br`,
65
- viewBox: "0 0 16.6 16.6",
66
- xmlns: "http://www.w3.org/2000/svg"
67
- }, /* @__PURE__ */ import_react.default.createElement("path", {
68
- d: "M.5.5A15.6,15.6,0,0,0,16.1,16.1,15.6,15.6,0,0,0,.5.5Z",
69
- fill: "#0067ab",
70
- stroke: "#fbfbfb"
71
- })), /* @__PURE__ */ import_react.default.createElement("svg", {
72
- className: `${blockName}-bl`,
73
- viewBox: "0 0 16.6 16.6",
74
- xmlns: "http://www.w3.org/2000/svg"
75
- }, /* @__PURE__ */ import_react.default.createElement("path", {
76
- d: "M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z",
77
- fill: "#00acdc",
78
- stroke: "#fbfbfb"
79
- }))), message && /* @__PURE__ */ import_react.default.createElement(SpinnerMessage, null, message));
41
+ const DSSpinner = ({ containerProps = {}, ariaLabel, spinner, innerRef, message, size, ...otherProps }) => {
42
+ const render = (0, import_react.useMemo)(
43
+ () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
44
+ children: [
45
+ spinner ?? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Spinner, {
46
+ classProps: { size },
47
+ children: [
48
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
49
+ className: `${blockName}-tl`,
50
+ viewBox: "0 0 16.6 16.6",
51
+ xmlns: "http://www.w3.org/2000/svg",
52
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
53
+ d: "M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z",
54
+ fill: "#408a90",
55
+ stroke: "#fbfbfb"
56
+ })
57
+ }),
58
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
59
+ className: `${blockName}-tr`,
60
+ viewBox: "0 0 16.6 16.6",
61
+ xmlns: "http://www.w3.org/2000/svg",
62
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
63
+ d: "M16.1,16.1A15.6,15.6,0,0,0,.5.5,15.6,15.6,0,0,0,16.1,16.1Z",
64
+ fill: "#f7901e",
65
+ stroke: "#fbfbfb"
66
+ })
67
+ }),
68
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
69
+ className: `${blockName}-br`,
70
+ viewBox: "0 0 16.6 16.6",
71
+ xmlns: "http://www.w3.org/2000/svg",
72
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
73
+ d: "M.5.5A15.6,15.6,0,0,0,16.1,16.1,15.6,15.6,0,0,0,.5.5Z",
74
+ fill: "#0067ab",
75
+ stroke: "#fbfbfb"
76
+ })
77
+ }),
78
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
79
+ className: `${blockName}-bl`,
80
+ viewBox: "0 0 16.6 16.6",
81
+ xmlns: "http://www.w3.org/2000/svg",
82
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
83
+ d: "M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z",
84
+ fill: "#00acdc",
85
+ stroke: "#fbfbfb"
86
+ })
87
+ })
88
+ ]
89
+ }),
90
+ message && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SpinnerMessage, {
91
+ ariaHidden: "true",
92
+ children: message
93
+ }),
94
+ (ariaLabel || message) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
95
+ "aria-live": "polite",
96
+ "aria-label": ariaLabel || message
97
+ })
98
+ ]
99
+ }),
100
+ [ariaLabel, message, size, spinner]
101
+ );
102
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SpinnerContainer, {
103
+ ...containerProps,
104
+ ref: innerRef,
105
+ "aria-busy": "true",
106
+ ...otherProps,
107
+ children: render
108
+ });
109
+ };
80
110
  DSSpinner.defaultProps = {
81
111
  containerProps: {},
82
112
  message: "",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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 '@elliemae/ds-utilities';\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 = ({ containerProps = {}, innerRef, message, size, ...otherProps }) => (\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 className={`${blockName}-tl`} viewBox=\"0 0 16.6 16.6\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z\" fill=\"#408a90\" stroke=\"#fbfbfb\" />\n </svg>\n <svg className={`${blockName}-tr`} viewBox=\"0 0 16.6 16.6\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M16.1,16.1A15.6,15.6,0,0,0,.5.5,15.6,15.6,0,0,0,16.1,16.1Z\" fill=\"#f7901e\" stroke=\"#fbfbfb\" />\n </svg>\n <svg className={`${blockName}-br`} viewBox=\"0 0 16.6 16.6\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M.5.5A15.6,15.6,0,0,0,16.1,16.1,15.6,15.6,0,0,0,.5.5Z\" fill=\"#0067ab\" stroke=\"#fbfbfb\" />\n </svg>\n <svg className={`${blockName}-bl`} viewBox=\"0 0 16.6 16.6\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z\" fill=\"#00acdc\" stroke=\"#fbfbfb\" />\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('Set of Properties attached to the main container'),\n message: PropTypes.string.description('Text below the spinner'),\n size: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('Spinner size').defaultValue('m'),\n};\n\nDSSpinner.propTypes = spinnerProps;\nDSSpinner.displayName = 'DSSpinner';\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;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAClB,0BAAoC;AACpC,2B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,EACT,MAAM;AACR;AAEA,MAAM,eAAe;AAAA,EACnB,UAAU,8BAAU,OAAO,YAAY,kCAAkC;AAAA,EACzE,gBAAgB,8BAAU,OAAO,YAAY,kDAAkD;AAAA,EAC/F,SAAS,8BAAU,OAAO,YAAY,wBAAwB;AAAA,EAC9D,MAAM,8BAAU,MAAM,CAAC,OAAO,MAAM,KAAK,KAAK,KAAK,MAAM,KAAK,CAAC,EAAE,YAAY,cAAc,EAAE,aAAa,GAAG;AAC/G;AAEA,UAAU,YAAY;AACtB,UAAU,cAAc;AACxB,MAAM,oBAAoB,kCAAS,SAAS;AAC5C,kBAAkB,YAAY;AAG9B,IAAO,oBAAQ;",
4
+ "sourcesContent": ["/* eslint-disable import/no-unresolved */\nimport React, { useMemo } from 'react';\nimport { describe, PropTypes } from '@elliemae/ds-utilities';\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)?\nconst DSSpinner = ({ containerProps = {}, ariaLabel, spinner, innerRef, message, size, ...otherProps }) => {\n const render = useMemo(\n () => (\n <>\n {spinner ?? (\n <Spinner classProps={{ size }}>\n <svg className={`${blockName}-tl`} viewBox=\"0 0 16.6 16.6\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z\" fill=\"#408a90\" stroke=\"#fbfbfb\" />\n </svg>\n <svg className={`${blockName}-tr`} viewBox=\"0 0 16.6 16.6\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M16.1,16.1A15.6,15.6,0,0,0,.5.5,15.6,15.6,0,0,0,16.1,16.1Z\" fill=\"#f7901e\" stroke=\"#fbfbfb\" />\n </svg>\n <svg className={`${blockName}-br`} viewBox=\"0 0 16.6 16.6\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M.5.5A15.6,15.6,0,0,0,16.1,16.1,15.6,15.6,0,0,0,.5.5Z\" fill=\"#0067ab\" stroke=\"#fbfbfb\" />\n </svg>\n <svg className={`${blockName}-bl`} viewBox=\"0 0 16.6 16.6\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z\" fill=\"#00acdc\" stroke=\"#fbfbfb\" />\n </svg>\n </Spinner>\n )}\n {message && <SpinnerMessage ariaHidden=\"true\">{message}</SpinnerMessage>}\n {(ariaLabel || message) && <span aria-live=\"polite\" aria-label={ariaLabel || message} />}\n </>\n ),\n [ariaLabel, message, size, spinner],\n );\n return (\n <SpinnerContainer {...containerProps} ref={innerRef} aria-busy=\"true\" {...otherProps}>\n {render}\n </SpinnerContainer>\n );\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('Set of Properties attached to the main container'),\n message: PropTypes.string.description('Text below the spinner'),\n size: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('Spinner size').defaultValue('m'),\n};\n\nDSSpinner.propTypes = spinnerProps;\nDSSpinner.displayName = 'DSSpinner';\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;AAAA;ACAA,YAAuB;ADAvB;AACA,mBAA+B;AAC/B,0BAAoC;AACpC,2BAAkC;AAElC,MAAM,YAAY;AAElB,MAAM,uBAAmB,wCAAkB,KAAK,EAAE,SAAS;A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AAA,IAEF,CAAC,WAAW,SAAS,MAAM,OAAO;AAAA,EACpC;AACA,SACE,4CAAC;AAAA,IAAkB,GAAG;AAAA,IAAgB,KAAK;AAAA,IAAU,aAAU;AAAA,IAAQ,GAAG;AAAA,IACvE;AAAA,GACH;AAEJ;AAEA,UAAU,eAAe;AAAA,EACvB,gBAAgB,CAAC;AAAA,EACjB,SAAS;AAAA,EACT,MAAM;AACR;AAEA,MAAM,eAAe;AAAA,EACnB,UAAU,8BAAU,OAAO,YAAY,kCAAkC;AAAA,EACzE,gBAAgB,8BAAU,OAAO,YAAY,kDAAkD;AAAA,EAC/F,SAAS,8BAAU,OAAO,YAAY,wBAAwB;AAAA,EAC9D,MAAM,8BAAU,MAAM,CAAC,OAAO,MAAM,KAAK,KAAK,KAAK,MAAM,KAAK,CAAC,EAAE,YAAY,cAAc,EAAE,aAAa,GAAG;AAC/G;AAEA,UAAU,YAAY;AACtB,UAAU,cAAc;AACxB,MAAM,wBAAoB,8BAAS,SAAS;AAC5C,kBAAkB,YAAY;AAG9B,IAAO,oBAAQ;",
6
6
  "names": []
7
7
  }
package/dist/cjs/index.js CHANGED
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  }
18
18
  return to;
19
19
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
21
24
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
22
25
  var src_exports = {};
23
26
  __export(src_exports, {
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
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;AAAA;ACAA,YAAuB;ADAvB,uBAAsD;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAsD;",
6
6
  "names": []
7
7
  }
@@ -1,54 +1,81 @@
1
1
  import * as React from "react";
2
- import React2 from "react";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { useMemo } from "react";
3
4
  import { describe, PropTypes } from "@elliemae/ds-utilities";
4
5
  import { aggregatedClasses } from "@elliemae/ds-classnames";
5
6
  const blockName = "spinner";
6
7
  const SpinnerContainer = aggregatedClasses("div")(blockName);
7
8
  const SpinnerMessage = aggregatedClasses("span")(blockName, "message");
8
9
  const Spinner = aggregatedClasses("div")(blockName, "spinner");
9
- const DSSpinner = ({ containerProps = {}, innerRef, message, size, ...otherProps }) => /* @__PURE__ */ React2.createElement(SpinnerContainer, {
10
- ...containerProps,
11
- ref: innerRef,
12
- "aria-busy": true,
13
- "aria-label": message,
14
- "aria-live": "polite",
15
- role: "alert",
16
- ...otherProps
17
- }, /* @__PURE__ */ React2.createElement(Spinner, {
18
- classProps: { size }
19
- }, /* @__PURE__ */ React2.createElement("svg", {
20
- className: `${blockName}-tl`,
21
- viewBox: "0 0 16.6 16.6",
22
- xmlns: "http://www.w3.org/2000/svg"
23
- }, /* @__PURE__ */ React2.createElement("path", {
24
- d: "M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z",
25
- fill: "#408a90",
26
- stroke: "#fbfbfb"
27
- })), /* @__PURE__ */ React2.createElement("svg", {
28
- className: `${blockName}-tr`,
29
- viewBox: "0 0 16.6 16.6",
30
- xmlns: "http://www.w3.org/2000/svg"
31
- }, /* @__PURE__ */ React2.createElement("path", {
32
- d: "M16.1,16.1A15.6,15.6,0,0,0,.5.5,15.6,15.6,0,0,0,16.1,16.1Z",
33
- fill: "#f7901e",
34
- stroke: "#fbfbfb"
35
- })), /* @__PURE__ */ React2.createElement("svg", {
36
- className: `${blockName}-br`,
37
- viewBox: "0 0 16.6 16.6",
38
- xmlns: "http://www.w3.org/2000/svg"
39
- }, /* @__PURE__ */ React2.createElement("path", {
40
- d: "M.5.5A15.6,15.6,0,0,0,16.1,16.1,15.6,15.6,0,0,0,.5.5Z",
41
- fill: "#0067ab",
42
- stroke: "#fbfbfb"
43
- })), /* @__PURE__ */ React2.createElement("svg", {
44
- className: `${blockName}-bl`,
45
- viewBox: "0 0 16.6 16.6",
46
- xmlns: "http://www.w3.org/2000/svg"
47
- }, /* @__PURE__ */ React2.createElement("path", {
48
- d: "M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z",
49
- fill: "#00acdc",
50
- stroke: "#fbfbfb"
51
- }))), message && /* @__PURE__ */ React2.createElement(SpinnerMessage, null, message));
10
+ const DSSpinner = ({ containerProps = {}, ariaLabel, spinner, innerRef, message, size, ...otherProps }) => {
11
+ const render = useMemo(
12
+ () => /* @__PURE__ */ jsxs(Fragment, {
13
+ children: [
14
+ spinner ?? /* @__PURE__ */ jsxs(Spinner, {
15
+ classProps: { size },
16
+ children: [
17
+ /* @__PURE__ */ jsx("svg", {
18
+ className: `${blockName}-tl`,
19
+ viewBox: "0 0 16.6 16.6",
20
+ xmlns: "http://www.w3.org/2000/svg",
21
+ children: /* @__PURE__ */ jsx("path", {
22
+ d: "M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z",
23
+ fill: "#408a90",
24
+ stroke: "#fbfbfb"
25
+ })
26
+ }),
27
+ /* @__PURE__ */ jsx("svg", {
28
+ className: `${blockName}-tr`,
29
+ viewBox: "0 0 16.6 16.6",
30
+ xmlns: "http://www.w3.org/2000/svg",
31
+ children: /* @__PURE__ */ jsx("path", {
32
+ d: "M16.1,16.1A15.6,15.6,0,0,0,.5.5,15.6,15.6,0,0,0,16.1,16.1Z",
33
+ fill: "#f7901e",
34
+ stroke: "#fbfbfb"
35
+ })
36
+ }),
37
+ /* @__PURE__ */ jsx("svg", {
38
+ className: `${blockName}-br`,
39
+ viewBox: "0 0 16.6 16.6",
40
+ xmlns: "http://www.w3.org/2000/svg",
41
+ children: /* @__PURE__ */ jsx("path", {
42
+ d: "M.5.5A15.6,15.6,0,0,0,16.1,16.1,15.6,15.6,0,0,0,.5.5Z",
43
+ fill: "#0067ab",
44
+ stroke: "#fbfbfb"
45
+ })
46
+ }),
47
+ /* @__PURE__ */ jsx("svg", {
48
+ className: `${blockName}-bl`,
49
+ viewBox: "0 0 16.6 16.6",
50
+ xmlns: "http://www.w3.org/2000/svg",
51
+ children: /* @__PURE__ */ jsx("path", {
52
+ d: "M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z",
53
+ fill: "#00acdc",
54
+ stroke: "#fbfbfb"
55
+ })
56
+ })
57
+ ]
58
+ }),
59
+ message && /* @__PURE__ */ jsx(SpinnerMessage, {
60
+ ariaHidden: "true",
61
+ children: message
62
+ }),
63
+ (ariaLabel || message) && /* @__PURE__ */ jsx("span", {
64
+ "aria-live": "polite",
65
+ "aria-label": ariaLabel || message
66
+ })
67
+ ]
68
+ }),
69
+ [ariaLabel, message, size, spinner]
70
+ );
71
+ return /* @__PURE__ */ jsx(SpinnerContainer, {
72
+ ...containerProps,
73
+ ref: innerRef,
74
+ "aria-busy": "true",
75
+ ...otherProps,
76
+ children: render
77
+ });
78
+ };
52
79
  DSSpinner.defaultProps = {
53
80
  containerProps: {},
54
81
  message: "",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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 '@elliemae/ds-utilities';\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 = ({ containerProps = {}, innerRef, message, size, ...otherProps }) => (\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 className={`${blockName}-tl`} viewBox=\"0 0 16.6 16.6\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z\" fill=\"#408a90\" stroke=\"#fbfbfb\" />\n </svg>\n <svg className={`${blockName}-tr`} viewBox=\"0 0 16.6 16.6\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M16.1,16.1A15.6,15.6,0,0,0,.5.5,15.6,15.6,0,0,0,16.1,16.1Z\" fill=\"#f7901e\" stroke=\"#fbfbfb\" />\n </svg>\n <svg className={`${blockName}-br`} viewBox=\"0 0 16.6 16.6\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M.5.5A15.6,15.6,0,0,0,16.1,16.1,15.6,15.6,0,0,0,.5.5Z\" fill=\"#0067ab\" stroke=\"#fbfbfb\" />\n </svg>\n <svg className={`${blockName}-bl`} viewBox=\"0 0 16.6 16.6\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z\" fill=\"#00acdc\" stroke=\"#fbfbfb\" />\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('Set of Properties attached to the main container'),\n message: PropTypes.string.description('Text below the spinner'),\n size: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('Spinner size').defaultValue('m'),\n};\n\nDSSpinner.propTypes = spinnerProps;\nDSSpinner.displayName = 'DSSpinner';\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,KAAK,EAAE,SAAS;AAC3D,MAAM,iBAAiB,kBAAkB,MAAM,EAAE,WAAW,SAAS;AACrE,MAAM,UAAU,kBAAkB,KAAK,EAAE,WAAW,SAAS;AAI7D,MAAM,YAAY,CAAC,EAAE,iBAAiB,CAAC,GAAG,UAAU,SAAS,SAAS,iBACpE,qCAAC;AAAA,EACE,GAAG;AAAA,EACJ,KAAK;AAAA,EACL,aAAS;AAAA,EACT,cAAY;AAAA,EACZ,aAAU;AAAA,EACV,MAAK;AAAA,EACJ,GAAG;AAAA,GAEJ,qCAAC;AAAA,EAAQ,YAAY,EAAE,KAAK;AAAA,GAC1B,qCAAC;AAAA,EAAI,WAAW,GAAG;AAAA,EAAgB,SAAQ;AAAA,EAAgB,OAAM;AAAA,GAC/D,qCAAC;AAAA,EAAK,GAAE;AAAA,EAA0D,MAAK;AAAA,EAAU,QAAO;AAAA,CAAU,CACpG,GACA,qCAAC;AAAA,EAAI,WAAW,GAAG;AAAA,EAAgB,SAAQ;AAAA,EAAgB,OAAM;AAAA,GAC/D,qCAAC;AAAA,EAAK,GAAE;AAAA,EAA6D,MAAK;AAAA,EAAU,QAAO;AAAA,CAAU,CACvG,GACA,qCAAC;AAAA,EAAI,WAAW,GAAG;AAAA,EAAgB,SAAQ;AAAA,EAAgB,OAAM;AAAA,GAC/D,qCAAC;AAAA,EAAK,GAAE;AAAA,EAAwD,MAAK;AAAA,EAAU,QAAO;AAAA,CAAU,CAClG,GACA,qCAAC;AAAA,EAAI,WAAW,GAAG;AAAA,EAAgB,SAAQ;AAAA,EAAgB,OAAM;AAAA,GAC/D,qCAAC;AAAA,EAAK,GAAE;AAAA,EAA0D,MAAK;AAAA,EAAU,QAAO;AAAA,CAAU,CACpG,CACF,GACC,WAAW,qCAAC,sBAAgB,OAAQ,CACvC;AAGF,UAAU,eAAe;AAAA,EACvB,gBAAgB,CAAC;AAAA,EACjB,SAAS;AAAA,EACT,MAAM;AACR;AAEA,MAAM,eAAe;AAAA,EACnB,UAAU,UAAU,OAAO,YAAY,kCAAkC;AAAA,EACzE,gBAAgB,UAAU,OAAO,YAAY,kDAAkD;AAAA,EAC/F,SAAS,UAAU,OAAO,YAAY,wBAAwB;AAAA,EAC9D,MAAM,UAAU,MAAM,CAAC,OAAO,MAAM,KAAK,KAAK,KAAK,MAAM,KAAK,CAAC,EAAE,YAAY,cAAc,EAAE,aAAa,GAAG;AAC/G;AAEA,UAAU,YAAY;AACtB,UAAU,cAAc;AACxB,MAAM,oBAAoB,SAAS,SAAS;AAC5C,kBAAkB,YAAY;AAG9B,IAAO,oBAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable import/no-unresolved */\nimport React, { useMemo } from 'react';\nimport { describe, PropTypes } from '@elliemae/ds-utilities';\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)?\nconst DSSpinner = ({ containerProps = {}, ariaLabel, spinner, innerRef, message, size, ...otherProps }) => {\n const render = useMemo(\n () => (\n <>\n {spinner ?? (\n <Spinner classProps={{ size }}>\n <svg className={`${blockName}-tl`} viewBox=\"0 0 16.6 16.6\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z\" fill=\"#408a90\" stroke=\"#fbfbfb\" />\n </svg>\n <svg className={`${blockName}-tr`} viewBox=\"0 0 16.6 16.6\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M16.1,16.1A15.6,15.6,0,0,0,.5.5,15.6,15.6,0,0,0,16.1,16.1Z\" fill=\"#f7901e\" stroke=\"#fbfbfb\" />\n </svg>\n <svg className={`${blockName}-br`} viewBox=\"0 0 16.6 16.6\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M.5.5A15.6,15.6,0,0,0,16.1,16.1,15.6,15.6,0,0,0,.5.5Z\" fill=\"#0067ab\" stroke=\"#fbfbfb\" />\n </svg>\n <svg className={`${blockName}-bl`} viewBox=\"0 0 16.6 16.6\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z\" fill=\"#00acdc\" stroke=\"#fbfbfb\" />\n </svg>\n </Spinner>\n )}\n {message && <SpinnerMessage ariaHidden=\"true\">{message}</SpinnerMessage>}\n {(ariaLabel || message) && <span aria-live=\"polite\" aria-label={ariaLabel || message} />}\n </>\n ),\n [ariaLabel, message, size, spinner],\n );\n return (\n <SpinnerContainer {...containerProps} ref={innerRef} aria-busy=\"true\" {...otherProps}>\n {render}\n </SpinnerContainer>\n );\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('Set of Properties attached to the main container'),\n message: PropTypes.string.description('Text below the spinner'),\n size: PropTypes.oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl']).description('Spinner size').defaultValue('m'),\n};\n\nDSSpinner.propTypes = spinnerProps;\nDSSpinner.displayName = 'DSSpinner';\nconst SpinnerWithSchema = describe(DSSpinner);\nSpinnerWithSchema.propTypes = spinnerProps;\n\nexport { DSSpinner, SpinnerWithSchema };\nexport default DSSpinner;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB;AACA,SAAgB,eAAe;AAC/B,SAAS,UAAU,iBAAiB;AACpC,SAAS,yBAAyB;AAElC,MAAM,YAAY;AAElB,MAAM,mBAAmB,kBAAkB,KAAK,EAAE,SAAS;AAC3D,MAAM,iBAAiB,kBAAkB,MAAM,EAAE,WAAW,SAAS;AACrE,MAAM,UAAU,kBAAkB,KAAK,EAAE,WAAW,SAAS;AAG7D,MAAM,YAAY,CAAC,EAAE,iBAAiB,CAAC,GAAG,WAAW,SAAS,UAAU,SAAS,SAAS,WAAW,MAAM;AACzG,QAAM,SAAS;AAAA,IACb,MACE;AAAA,MACG;AAAA,mBACC,qBAAC;AAAA,UAAQ,YAAY,EAAE,KAAK;AAAA,UAC1B;AAAA,gCAAC;AAAA,cAAI,WAAW,GAAG;AAAA,cAAgB,SAAQ;AAAA,cAAgB,OAAM;AAAA,cAC/D,8BAAC;AAAA,gBAAK,GAAE;AAAA,gBAA0D,MAAK;AAAA,gBAAU,QAAO;AAAA,eAAU;AAAA,aACpG;AAAA,YACA,oBAAC;AAAA,cAAI,WAAW,GAAG;AAAA,cAAgB,SAAQ;AAAA,cAAgB,OAAM;AAAA,cAC/D,8BAAC;AAAA,gBAAK,GAAE;AAAA,gBAA6D,MAAK;AAAA,gBAAU,QAAO;AAAA,eAAU;AAAA,aACvG;AAAA,YACA,oBAAC;AAAA,cAAI,WAAW,GAAG;AAAA,cAAgB,SAAQ;AAAA,cAAgB,OAAM;AAAA,cAC/D,8BAAC;AAAA,gBAAK,GAAE;AAAA,gBAAwD,MAAK;AAAA,gBAAU,QAAO;AAAA,eAAU;AAAA,aAClG;AAAA,YACA,oBAAC;AAAA,cAAI,WAAW,GAAG;AAAA,cAAgB,SAAQ;AAAA,cAAgB,OAAM;AAAA,cAC/D,8BAAC;AAAA,gBAAK,GAAE;AAAA,gBAA0D,MAAK;AAAA,gBAAU,QAAO;AAAA,eAAU;AAAA,aACpG;AAAA;AAAA,SACF;AAAA,QAED,WAAW,oBAAC;AAAA,UAAe,YAAW;AAAA,UAAQ;AAAA,SAAQ;AAAA,SACrD,aAAa,YAAY,oBAAC;AAAA,UAAK,aAAU;AAAA,UAAS,cAAY,aAAa;AAAA,SAAS;AAAA;AAAA,KACxF;AAAA,IAEF,CAAC,WAAW,SAAS,MAAM,OAAO;AAAA,EACpC;AACA,SACE,oBAAC;AAAA,IAAkB,GAAG;AAAA,IAAgB,KAAK;AAAA,IAAU,aAAU;AAAA,IAAQ,GAAG;AAAA,IACvE;AAAA,GACH;AAEJ;AAEA,UAAU,eAAe;AAAA,EACvB,gBAAgB,CAAC;AAAA,EACjB,SAAS;AAAA,EACT,MAAM;AACR;AAEA,MAAM,eAAe;AAAA,EACnB,UAAU,UAAU,OAAO,YAAY,kCAAkC;AAAA,EACzE,gBAAgB,UAAU,OAAO,YAAY,kDAAkD;AAAA,EAC/F,SAAS,UAAU,OAAO,YAAY,wBAAwB;AAAA,EAC9D,MAAM,UAAU,MAAM,CAAC,OAAO,MAAM,KAAK,KAAK,KAAK,MAAM,KAAK,CAAC,EAAE,YAAY,cAAc,EAAE,aAAa,GAAG;AAC/G;AAEA,UAAU,YAAY;AACtB,UAAU,cAAc;AACxB,MAAM,oBAAoB,SAAS,SAAS;AAC5C,kBAAkB,YAAY;AAG9B,IAAO,oBAAQ;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DSSpinner, SpinnerWithSchema, default } from './DSSpinner';\n"],
5
- "mappings": "AAAA;ACAA;",
6
- "names": []
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,WAAW,mBAAmB,WAAAA,gBAAe;",
6
+ "names": ["default"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-spinner",
3
- "version": "3.4.3-rc.1",
3
+ "version": "3.5.0-rc.10",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Spinner",
6
6
  "files": [
@@ -39,8 +39,8 @@
39
39
  "indent": 4
40
40
  },
41
41
  "dependencies": {
42
- "@elliemae/ds-classnames": "3.4.3-rc.1",
43
- "@elliemae/ds-utilities": "3.4.3-rc.1"
42
+ "@elliemae/ds-classnames": "3.5.0-rc.10",
43
+ "@elliemae/ds-utilities": "3.5.0-rc.10"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "lodash": "^4.17.21",