@elliemae/ds-spinner 3.5.0-rc.6 → 3.5.0-rc.9

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.
@@ -38,53 +38,55 @@ const SpinnerContainer = (0, import_ds_classnames.aggregatedClasses)("div")(bloc
38
38
  const SpinnerMessage = (0, import_ds_classnames.aggregatedClasses)("span")(blockName, "message");
39
39
  const Spinner = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "spinner");
40
40
  const DSSpinner = ({ containerProps = {}, ariaLabel, spinner, innerRef, message, size, ...otherProps }) => {
41
- console.log(spinner, "CustomSpinner2");
41
+ const render = (0, import_react.useMemo)(
42
+ () => /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, spinner ?? /* @__PURE__ */ import_react.default.createElement(Spinner, {
43
+ classProps: { size }
44
+ }, /* @__PURE__ */ import_react.default.createElement("svg", {
45
+ className: `${blockName}-tl`,
46
+ viewBox: "0 0 16.6 16.6",
47
+ xmlns: "http://www.w3.org/2000/svg"
48
+ }, /* @__PURE__ */ import_react.default.createElement("path", {
49
+ d: "M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z",
50
+ fill: "#408a90",
51
+ stroke: "#fbfbfb"
52
+ })), /* @__PURE__ */ import_react.default.createElement("svg", {
53
+ className: `${blockName}-tr`,
54
+ viewBox: "0 0 16.6 16.6",
55
+ xmlns: "http://www.w3.org/2000/svg"
56
+ }, /* @__PURE__ */ import_react.default.createElement("path", {
57
+ d: "M16.1,16.1A15.6,15.6,0,0,0,.5.5,15.6,15.6,0,0,0,16.1,16.1Z",
58
+ fill: "#f7901e",
59
+ stroke: "#fbfbfb"
60
+ })), /* @__PURE__ */ import_react.default.createElement("svg", {
61
+ className: `${blockName}-br`,
62
+ viewBox: "0 0 16.6 16.6",
63
+ xmlns: "http://www.w3.org/2000/svg"
64
+ }, /* @__PURE__ */ import_react.default.createElement("path", {
65
+ d: "M.5.5A15.6,15.6,0,0,0,16.1,16.1,15.6,15.6,0,0,0,.5.5Z",
66
+ fill: "#0067ab",
67
+ stroke: "#fbfbfb"
68
+ })), /* @__PURE__ */ import_react.default.createElement("svg", {
69
+ className: `${blockName}-bl`,
70
+ viewBox: "0 0 16.6 16.6",
71
+ xmlns: "http://www.w3.org/2000/svg"
72
+ }, /* @__PURE__ */ import_react.default.createElement("path", {
73
+ d: "M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z",
74
+ fill: "#00acdc",
75
+ stroke: "#fbfbfb"
76
+ }))), message && /* @__PURE__ */ import_react.default.createElement(SpinnerMessage, {
77
+ ariaHidden: "true"
78
+ }, message), (ariaLabel || message) && /* @__PURE__ */ import_react.default.createElement("span", {
79
+ "aria-live": "polite",
80
+ "aria-label": ariaLabel || message
81
+ })),
82
+ [ariaLabel, message, size, spinner]
83
+ );
42
84
  return /* @__PURE__ */ import_react.default.createElement(SpinnerContainer, {
43
85
  ...containerProps,
44
86
  ref: innerRef,
45
87
  "aria-busy": "true",
46
88
  ...otherProps
47
- }, spinner && /* @__PURE__ */ import_react.default.createElement(Spinner, {
48
- classProps: { size }
49
- }, /* @__PURE__ */ import_react.default.createElement("svg", {
50
- className: `${blockName}-tl`,
51
- viewBox: "0 0 16.6 16.6",
52
- xmlns: "http://www.w3.org/2000/svg"
53
- }, /* @__PURE__ */ import_react.default.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: "#408a90",
56
- stroke: "#fbfbfb"
57
- })), /* @__PURE__ */ import_react.default.createElement("svg", {
58
- className: `${blockName}-tr`,
59
- viewBox: "0 0 16.6 16.6",
60
- xmlns: "http://www.w3.org/2000/svg"
61
- }, /* @__PURE__ */ import_react.default.createElement("path", {
62
- d: "M16.1,16.1A15.6,15.6,0,0,0,.5.5,15.6,15.6,0,0,0,16.1,16.1Z",
63
- fill: "#f7901e",
64
- stroke: "#fbfbfb"
65
- })), /* @__PURE__ */ import_react.default.createElement("svg", {
66
- className: `${blockName}-br`,
67
- viewBox: "0 0 16.6 16.6",
68
- xmlns: "http://www.w3.org/2000/svg"
69
- }, /* @__PURE__ */ import_react.default.createElement("path", {
70
- d: "M.5.5A15.6,15.6,0,0,0,16.1,16.1,15.6,15.6,0,0,0,.5.5Z",
71
- fill: "#0067ab",
72
- stroke: "#fbfbfb"
73
- })), /* @__PURE__ */ import_react.default.createElement("svg", {
74
- className: `${blockName}-bl`,
75
- viewBox: "0 0 16.6 16.6",
76
- xmlns: "http://www.w3.org/2000/svg"
77
- }, /* @__PURE__ */ import_react.default.createElement("path", {
78
- d: "M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z",
79
- fill: "#00acdc",
80
- stroke: "#fbfbfb"
81
- }))), message && /* @__PURE__ */ import_react.default.createElement(SpinnerMessage, {
82
- ariaHidden: "true"
83
- }, message), (ariaLabel || message) && /* @__PURE__ */ import_react.default.createElement(SpinnerMessage, {
84
- role: "alert",
85
- "aria-live": "polite",
86
- "aria-label": ariaLabel || message
87
- }));
89
+ }, render);
88
90
  };
89
91
  DSSpinner.defaultProps = {
90
92
  containerProps: {},
@@ -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)?\nconst DSSpinner = ({ containerProps = {}, ariaLabel, spinner, innerRef, message, size, ...otherProps }) => {\n console.log(spinner, 'CustomSpinner2');\n return (\n <SpinnerContainer {...containerProps} ref={innerRef} aria-busy=\"true\" {...otherProps}>\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) && <SpinnerMessage role=\"alert\" aria-live=\"polite\" aria-label={ariaLabel || message} />}\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;ADCvB,mBAAkB;AAClB,0BAAoC;AACpC,2BAAkC;AAElC,MAAM,YAAY;AAElB,MAAM,uBAAmB,wCAAkB,KAAK,EAAE,SAAS;AAC3D,MAAM,qBAAiB,wCAAkB,MAAM,EAAE,WAAW,SAAS;AACrE,MAAM,cAAU,wCAAkB,KAAK,EAAE,WAAW,SAAS;AAG7D,MAAM,YAAY,CAAC,EAAE,iBAAiB,CAAC,GAAG,WAAW,SAAS,UAAU,SAAS,SAAS,WAAW,MAAM;AACzG,UAAQ,IAAI,SAAS,gBAAgB;AACrC,SACE,6BAAAA,QAAA,cAAC;AAAA,IAAkB,GAAG;AAAA,IAAgB,KAAK;AAAA,IAAU,aAAU;AAAA,IAAQ,GAAG;AAAA,KACvE,WACC,6BAAAA,QAAA,cAAC;AAAA,IAAQ,YAAY,EAAE,KAAK;AAAA,KAC1B,6BAAAA,QAAA,cAAC;AAAA,IAAI,WAAW,GAAG;AAAA,IAAgB,SAAQ;AAAA,IAAgB,OAAM;AAAA,KAC/D,6BAAAA,QAAA,cAAC;AAAA,IAAK,GAAE;AAAA,IAA0D,MAAK;AAAA,IAAU,QAAO;AAAA,GAAU,CACpG,GACA,6BAAAA,QAAA,cAAC;AAAA,IAAI,WAAW,GAAG;AAAA,IAAgB,SAAQ;AAAA,IAAgB,OAAM;AAAA,KAC/D,6BAAAA,QAAA,cAAC;AAAA,IAAK,GAAE;AAAA,IAA6D,MAAK;AAAA,IAAU,QAAO;AAAA,GAAU,CACvG,GACA,6BAAAA,QAAA,cAAC;AAAA,IAAI,WAAW,GAAG;AAAA,IAAgB,SAAQ;AAAA,IAAgB,OAAM;AAAA,KAC/D,6BAAAA,QAAA,cAAC;AAAA,IAAK,GAAE;AAAA,IAAwD,MAAK;AAAA,IAAU,QAAO;AAAA,GAAU,CAClG,GACA,6BAAAA,QAAA,cAAC;AAAA,IAAI,WAAW,GAAG;AAAA,IAAgB,SAAQ;AAAA,IAAgB,OAAM;AAAA,KAC/D,6BAAAA,QAAA,cAAC;AAAA,IAAK,GAAE;AAAA,IAA0D,MAAK;AAAA,IAAU,QAAO;AAAA,GAAU,CACpG,CACF,GAED,WAAW,6BAAAA,QAAA,cAAC;AAAA,IAAe,YAAW;AAAA,KAAQ,OAAQ,IACrD,aAAa,YAAY,6BAAAA,QAAA,cAAC;AAAA,IAAe,MAAK;AAAA,IAAQ,aAAU;AAAA,IAAS,cAAY,aAAa;AAAA,GAAS,CAC/G;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;",
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;ADCvB,mBAA+B;AAC/B,0BAAoC;AACpC,2BAAkC;AAElC,MAAM,YAAY;AAElB,MAAM,uBAAmB,wCAAkB,KAAK,EAAE,SAAS;AAC3D,MAAM,qBAAiB,wCAAkB,MAAM,EAAE,WAAW,SAAS;AACrE,MAAM,cAAU,wCAAkB,KAAK,EAAE,WAAW,SAAS;AAG7D,MAAM,YAAY,CAAC,EAAE,iBAAiB,CAAC,GAAG,WAAW,SAAS,UAAU,SAAS,SAAS,WAAW,MAAM;AACzG,QAAM,aAAS;AAAA,IACb,MACE,6BAAAA,QAAA,2BAAAA,QAAA,gBACG,WACC,6BAAAA,QAAA,cAAC;AAAA,MAAQ,YAAY,EAAE,KAAK;AAAA,OAC1B,6BAAAA,QAAA,cAAC;AAAA,MAAI,WAAW,GAAG;AAAA,MAAgB,SAAQ;AAAA,MAAgB,OAAM;AAAA,OAC/D,6BAAAA,QAAA,cAAC;AAAA,MAAK,GAAE;AAAA,MAA0D,MAAK;AAAA,MAAU,QAAO;AAAA,KAAU,CACpG,GACA,6BAAAA,QAAA,cAAC;AAAA,MAAI,WAAW,GAAG;AAAA,MAAgB,SAAQ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AAa,GAAG;AAC/G;AAEA,UAAU,YAAY;AACtB,UAAU,cAAc;AACxB,MAAM,wBAAoB,8BAAS,SAAS;AAC5C,kBAAkB,YAAY;AAG9B,IAAO,oBAAQ;",
6
6
  "names": ["React"]
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import React2 from "react";
2
+ import React2, { useMemo } from "react";
3
3
  import { describe, PropTypes } from "@elliemae/ds-utilities";
4
4
  import { aggregatedClasses } from "@elliemae/ds-classnames";
5
5
  const blockName = "spinner";
@@ -7,53 +7,55 @@ const SpinnerContainer = aggregatedClasses("div")(blockName);
7
7
  const SpinnerMessage = aggregatedClasses("span")(blockName, "message");
8
8
  const Spinner = aggregatedClasses("div")(blockName, "spinner");
9
9
  const DSSpinner = ({ containerProps = {}, ariaLabel, spinner, innerRef, message, size, ...otherProps }) => {
10
- console.log(spinner, "CustomSpinner2");
10
+ const render = useMemo(
11
+ () => /* @__PURE__ */ React2.createElement(React2.Fragment, null, spinner ?? /* @__PURE__ */ React2.createElement(Spinner, {
12
+ classProps: { size }
13
+ }, /* @__PURE__ */ React2.createElement("svg", {
14
+ className: `${blockName}-tl`,
15
+ viewBox: "0 0 16.6 16.6",
16
+ xmlns: "http://www.w3.org/2000/svg"
17
+ }, /* @__PURE__ */ React2.createElement("path", {
18
+ d: "M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z",
19
+ fill: "#408a90",
20
+ stroke: "#fbfbfb"
21
+ })), /* @__PURE__ */ React2.createElement("svg", {
22
+ className: `${blockName}-tr`,
23
+ viewBox: "0 0 16.6 16.6",
24
+ xmlns: "http://www.w3.org/2000/svg"
25
+ }, /* @__PURE__ */ React2.createElement("path", {
26
+ d: "M16.1,16.1A15.6,15.6,0,0,0,.5.5,15.6,15.6,0,0,0,16.1,16.1Z",
27
+ fill: "#f7901e",
28
+ stroke: "#fbfbfb"
29
+ })), /* @__PURE__ */ React2.createElement("svg", {
30
+ className: `${blockName}-br`,
31
+ viewBox: "0 0 16.6 16.6",
32
+ xmlns: "http://www.w3.org/2000/svg"
33
+ }, /* @__PURE__ */ React2.createElement("path", {
34
+ d: "M.5.5A15.6,15.6,0,0,0,16.1,16.1,15.6,15.6,0,0,0,.5.5Z",
35
+ fill: "#0067ab",
36
+ stroke: "#fbfbfb"
37
+ })), /* @__PURE__ */ React2.createElement("svg", {
38
+ className: `${blockName}-bl`,
39
+ viewBox: "0 0 16.6 16.6",
40
+ xmlns: "http://www.w3.org/2000/svg"
41
+ }, /* @__PURE__ */ React2.createElement("path", {
42
+ d: "M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z",
43
+ fill: "#00acdc",
44
+ stroke: "#fbfbfb"
45
+ }))), message && /* @__PURE__ */ React2.createElement(SpinnerMessage, {
46
+ ariaHidden: "true"
47
+ }, message), (ariaLabel || message) && /* @__PURE__ */ React2.createElement("span", {
48
+ "aria-live": "polite",
49
+ "aria-label": ariaLabel || message
50
+ })),
51
+ [ariaLabel, message, size, spinner]
52
+ );
11
53
  return /* @__PURE__ */ React2.createElement(SpinnerContainer, {
12
54
  ...containerProps,
13
55
  ref: innerRef,
14
56
  "aria-busy": "true",
15
57
  ...otherProps
16
- }, spinner && /* @__PURE__ */ React2.createElement(Spinner, {
17
- classProps: { size }
18
- }, /* @__PURE__ */ React2.createElement("svg", {
19
- className: `${blockName}-tl`,
20
- viewBox: "0 0 16.6 16.6",
21
- xmlns: "http://www.w3.org/2000/svg"
22
- }, /* @__PURE__ */ React2.createElement("path", {
23
- d: "M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z",
24
- fill: "#408a90",
25
- stroke: "#fbfbfb"
26
- })), /* @__PURE__ */ React2.createElement("svg", {
27
- className: `${blockName}-tr`,
28
- viewBox: "0 0 16.6 16.6",
29
- xmlns: "http://www.w3.org/2000/svg"
30
- }, /* @__PURE__ */ React2.createElement("path", {
31
- d: "M16.1,16.1A15.6,15.6,0,0,0,.5.5,15.6,15.6,0,0,0,16.1,16.1Z",
32
- fill: "#f7901e",
33
- stroke: "#fbfbfb"
34
- })), /* @__PURE__ */ React2.createElement("svg", {
35
- className: `${blockName}-br`,
36
- viewBox: "0 0 16.6 16.6",
37
- xmlns: "http://www.w3.org/2000/svg"
38
- }, /* @__PURE__ */ React2.createElement("path", {
39
- d: "M.5.5A15.6,15.6,0,0,0,16.1,16.1,15.6,15.6,0,0,0,.5.5Z",
40
- fill: "#0067ab",
41
- stroke: "#fbfbfb"
42
- })), /* @__PURE__ */ React2.createElement("svg", {
43
- className: `${blockName}-bl`,
44
- viewBox: "0 0 16.6 16.6",
45
- xmlns: "http://www.w3.org/2000/svg"
46
- }, /* @__PURE__ */ React2.createElement("path", {
47
- d: "M16.1.5A15.6,15.6,0,0,0,.5,16.1,15.6,15.6,0,0,0,16.1.5Z",
48
- fill: "#00acdc",
49
- stroke: "#fbfbfb"
50
- }))), message && /* @__PURE__ */ React2.createElement(SpinnerMessage, {
51
- ariaHidden: "true"
52
- }, message), (ariaLabel || message) && /* @__PURE__ */ React2.createElement(SpinnerMessage, {
53
- role: "alert",
54
- "aria-live": "polite",
55
- "aria-label": ariaLabel || message
56
- }));
58
+ }, render);
57
59
  };
58
60
  DSSpinner.defaultProps = {
59
61
  containerProps: {},
@@ -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)?\nconst DSSpinner = ({ containerProps = {}, ariaLabel, spinner, innerRef, message, size, ...otherProps }) => {\n console.log(spinner, 'CustomSpinner2');\n return (\n <SpinnerContainer {...containerProps} ref={innerRef} aria-busy=\"true\" {...otherProps}>\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) && <SpinnerMessage role=\"alert\" aria-live=\"polite\" aria-label={ariaLabel || message} />}\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;ACCvB,OAAOA,YAAW;AAClB,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,UAAQ,IAAI,SAAS,gBAAgB;AACrC,SACE,gBAAAA,OAAA,cAAC;AAAA,IAAkB,GAAG;AAAA,IAAgB,KAAK;AAAA,IAAU,aAAU;AAAA,IAAQ,GAAG;AAAA,KACvE,WACC,gBAAAA,OAAA,cAAC;AAAA,IAAQ,YAAY,EAAE,KAAK;AAAA,KAC1B,gBAAAA,OAAA,cAAC;AAAA,IAAI,WAAW,GAAG;AAAA,IAAgB,SAAQ;AAAA,IAAgB,OAAM;AAAA,KAC/D,gBAAAA,OAAA,cAAC;AAAA,IAAK,GAAE;AAAA,IAA0D,MAAK;AAAA,IAAU,QAAO;AAAA,GAAU,CACpG,GACA,gBAAAA,OAAA,cAAC;AAAA,IAAI,WAAW,GAAG;AAAA,IAAgB,SAAQ;AAAA,IAAgB,OAAM;AAAA,KAC/D,gBAAAA,OAAA,cAAC;AAAA,IAAK,GAAE;AAAA,IAA6D,MAAK;AAAA,IAAU,QAAO;AAAA,GAAU,CACvG,GACA,gBAAAA,OAAA,cAAC;AAAA,IAAI,WAAW,GAAG;AAAA,IAAgB,SAAQ;AAAA,IAAgB,OAAM;AAAA,KAC/D,gBAAAA,OAAA,cAAC;AAAA,IAAK,GAAE;AAAA,IAAwD,MAAK;AAAA,IAAU,QAAO;AAAA,GAAU,CAClG,GACA,gBAAAA,OAAA,cAAC;AAAA,IAAI,WAAW,GAAG;AAAA,IAAgB,SAAQ;AAAA,IAAgB,OAAM;AAAA,KAC/D,gBAAAA,OAAA,cAAC;AAAA,IAAK,GAAE;AAAA,IAA0D,MAAK;AAAA,IAAU,QAAO;AAAA,GAAU,CACpG,CACF,GAED,WAAW,gBAAAA,OAAA,cAAC;AAAA,IAAe,YAAW;AAAA,KAAQ,OAAQ,IACrD,aAAa,YAAY,gBAAAA,OAAA,cAAC;AAAA,IAAe,MAAK;AAAA,IAAQ,aAAU;AAAA,IAAS,cAAY,aAAa;AAAA,GAAS,CAC/G;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;",
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;ACCvB,OAAOA,UAAS,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,gBAAAA,OAAA,cAAAA,OAAA,gBACG,WACC,gBAAAA,OAAA,cAAC;AAAA,MAAQ,YAAY,EAAE,KAAK;AAAA,OAC1B,gBAAAA,OAAA,cAAC;AAAA,MAAI,WAAW,GAAG;AAAA,MAAgB,SAAQ;AAAA,MAAgB,OAAM;AAAA,OAC/D,gBAAAA,OAAA,cAAC;AAAA,MAAK,GAAE;AAAA,MAA0D,MAAK;AAAA,MAAU,QAAO;AAAA,KAAU,CACpG,GACA,gBAAAA,OAAA,cAAC;AAAA,MAAI,WAAW,GAAG;AAAA,MAAgB,SAAQ;AAAA,MAAgB,OAAM;AAAA,OAC/D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ACtB,UAAU,cAAc;AACxB,MAAM,oBAAoB,SAAS,SAAS;AAC5C,kBAAkB,YAAY;AAG9B,IAAO,oBAAQ;",
6
6
  "names": ["React"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-spinner",
3
- "version": "3.5.0-rc.6",
3
+ "version": "3.5.0-rc.9",
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.5.0-rc.6",
43
- "@elliemae/ds-utilities": "3.5.0-rc.6"
42
+ "@elliemae/ds-classnames": "3.5.0-rc.9",
43
+ "@elliemae/ds-utilities": "3.5.0-rc.9"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "lodash": "^4.17.21",