@elliemae/ds-circular-progress-indicator 2.2.0-next.2 → 2.2.0-next.6

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/index.js CHANGED
@@ -3,9 +3,12 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var DSCircularProgressIndicator = require('./DSCircularProgressIndicator.js');
6
+ var DSCircularProgressIndicatorV2 = require('./v2/DSCircularProgressIndicatorV2.js');
6
7
 
7
8
 
8
9
 
9
10
  exports.CircularProgressIndicatorWithSchema = DSCircularProgressIndicator.CircularProgressIndicatorWithSchema;
10
11
  exports.DSCircularProgressIndicator = DSCircularProgressIndicator["default"];
11
12
  exports["default"] = DSCircularProgressIndicator["default"];
13
+ exports.DSCircularIndeterminateIndicator = DSCircularProgressIndicatorV2.DSCircularIndeterminateIndicator;
14
+ exports.DSCircularIndeterminateIndicatorWithSchema = DSCircularProgressIndicatorV2.DSCircularIndeterminateIndicatorWithSchema;
@@ -0,0 +1,132 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _jsx = require('@babel/runtime/helpers/jsx');
6
+ var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
7
+ require('react');
8
+ var dsGrid = require('@elliemae/ds-grid');
9
+ var DSTooltip = require('@elliemae/ds-tooltip');
10
+ var reactDesc = require('react-desc');
11
+ var styled = require('styled-components');
12
+ var dsSystem = require('@elliemae/ds-system');
13
+ var uid = require('uid');
14
+ var reactDescPropTypes = require('./react-desc-prop-types.js');
15
+ var jsxRuntime = require('react/jsx-runtime');
16
+
17
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
18
+
19
+ var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
20
+ var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefaultLegacy(_taggedTemplateLiteral);
21
+ var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
22
+
23
+ var _templateObject, _templateObject2, _circle;
24
+ const r = dsSystem.kfrm(_templateObject || (_templateObject = _taggedTemplateLiteral__default["default"](["to { transform: rotate(2turn) }"])));
25
+ const s = dsSystem.kfrm(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral__default["default"](["0%, 39% { stroke-dasharray: 942px 2826px }"])));
26
+ const StyledSvg = /*#__PURE__*/styled__default["default"].svg.withConfig({
27
+ componentId: "sc-1x34z2a-0"
28
+ })(["#gg{transform:rotate(45deg);stroke:url(#", ");mask:url(#", ");}mask use{stroke:#fff;stroke-linecap:round;stroke-dasharray:942px 2826px;animation:", " 1.5s cubic-bezier(0.5,-0.43,0.5,1.43) infinite,", " 0.75s ease-in-out infinite alternate;}"], props => props.linearGradientUid, props => props.maskUid, r, s);
29
+ const sizeToPx = {
30
+ xs: '16px',
31
+ s: '24px',
32
+ m: '32px',
33
+ l: '48px',
34
+ xl: '56px',
35
+ xxl: '64px'
36
+ };
37
+ const sizeToWeight = {
38
+ xs: '10%',
39
+ s: '9%',
40
+ m: '8%',
41
+ l: '6%',
42
+ xl: '5%',
43
+ xxl: '4%'
44
+ };
45
+ const colorToHex = {
46
+ light: '#FFFFFF',
47
+ dark: '#0F364A'
48
+ };
49
+ const sizeToTextSize = {
50
+ xs: '12px',
51
+ s: '12px',
52
+ m: '12px',
53
+ l: '13px',
54
+ xl: '14px',
55
+ xxl: '16px'
56
+ };
57
+ const DSCircularIndeterminateIndicator = _ref => {
58
+ let {
59
+ size = 'm',
60
+ color = 'dark',
61
+ text = '',
62
+ showText = true,
63
+ withTooltip = false,
64
+ tooltipStartPlacementPreference = 'bottom'
65
+ } = _ref;
66
+ const Wrapper = withTooltip ? DSTooltip.DSTooltipV3 : _ref2 => {
67
+ let {
68
+ children
69
+ } = _ref2;
70
+ return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
71
+ children: children
72
+ });
73
+ };
74
+ const linearGradientUid = uid.uid(16);
75
+ const maskUid = uid.uid(16);
76
+ const circleUid = uid.uid(16);
77
+ return /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
78
+ gutter: "xs",
79
+ justifyContent: "center",
80
+ role: "status"
81
+ }, void 0, /*#__PURE__*/_jsx__default["default"](Wrapper, {
82
+ text: text,
83
+ textAlign: "center",
84
+ startPlacementPreference: tooltipStartPlacementPreference
85
+ }, void 0, /*#__PURE__*/_jsx__default["default"](StyledSvg, {
86
+ viewBox: "-1950 -975 3900 1950",
87
+ fill: "none",
88
+ stroke: "transparent",
89
+ strokeWidth: sizeToWeight[size],
90
+ width: sizeToPx[size],
91
+ height: sizeToPx[size],
92
+ style: {
93
+ display: 'block',
94
+ margin: 'auto'
95
+ },
96
+ linearGradientUid: linearGradientUid,
97
+ maskUid: maskUid
98
+ }, void 0, /*#__PURE__*/_jsx__default["default"]("g", {
99
+ transform: "scale(2.298)"
100
+ }, void 0, /*#__PURE__*/_jsx__default["default"]("linearGradient", {
101
+ id: linearGradientUid
102
+ }, void 0, /*#__PURE__*/_jsx__default["default"]("stop", {
103
+ stopColor: color === 'dark' ? '#48a3ff' : '#ccd6ff'
104
+ }), /*#__PURE__*/_jsx__default["default"]("stop", {
105
+ stopColor: color === 'dark' ? '#49d0ff' : '#ebf6ff',
106
+ offset: "1"
107
+ })), /*#__PURE__*/_jsx__default["default"]("mask", {
108
+ id: maskUid
109
+ }, void 0, _circle || (_circle = /*#__PURE__*/_jsx__default["default"]("circle", {
110
+ r: "1200",
111
+ fill: "#000"
112
+ })), /*#__PURE__*/_jsx__default["default"]("use", {
113
+ xlinkHref: "#".concat(circleUid)
114
+ })), /*#__PURE__*/_jsx__default["default"]("circle", {
115
+ id: circleUid,
116
+ r: "600"
117
+ }), /*#__PURE__*/_jsx__default["default"]("g", {
118
+ id: "gg"
119
+ }, void 0, /*#__PURE__*/_jsx__default["default"]("use", {
120
+ xlinkHref: "#".concat(circleUid)
121
+ })))), text !== '' && showText && /*#__PURE__*/_jsx__default["default"]("span", {
122
+ style: {
123
+ color: colorToHex[color],
124
+ fontSize: sizeToTextSize[size]
125
+ }
126
+ }, void 0, text)));
127
+ };
128
+ const DSCircularIndeterminateIndicatorWithSchema = reactDesc.describe(DSCircularIndeterminateIndicator);
129
+ DSCircularIndeterminateIndicatorWithSchema.propTypes = reactDescPropTypes.CircularIndeterminateIndicatorPropTypes;
130
+
131
+ exports.DSCircularIndeterminateIndicator = DSCircularIndeterminateIndicator;
132
+ exports.DSCircularIndeterminateIndicatorWithSchema = DSCircularIndeterminateIndicatorWithSchema;
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var DSCircularProgressIndicatorV2 = require('./DSCircularProgressIndicatorV2.js');
6
+
7
+
8
+
9
+ exports.DSCircularIndeterminateIndicator = DSCircularProgressIndicatorV2.DSCircularIndeterminateIndicator;
10
+ exports.DSCircularIndeterminateIndicatorWithSchema = DSCircularProgressIndicatorV2.DSCircularIndeterminateIndicatorWithSchema;
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var reactDesc = require('react-desc');
6
+
7
+ /* eslint-disable max-lines */
8
+ const CircularIndeterminateIndicatorPropTypes = {
9
+ size: reactDesc.PropTypes.oneOf(['xs', 's', 'm', 'l', 'xl', 'xxl']).description('Size of the indicator').defaultValue('m'),
10
+ color: reactDesc.PropTypes.oneOf(['light', 'dark']).description('Color mode for the indicator').defaultValue('dark'),
11
+ text: reactDesc.PropTypes.string.description('Optional text to show under the indicator').defaultValue(''),
12
+ showText: reactDesc.PropTypes.bool.description('Whether to show the optional text or not').defaultValue(true),
13
+ withTooltip: reactDesc.PropTypes.bool.description('Whether to include a tooltip that shows the optional text on hover').defaultValue(false),
14
+ tooltipStartPlacementPreference: reactDesc.PropTypes.oneOf(['top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']).description('start placement preference for the tooltip').defaultValue('center')
15
+ };
16
+
17
+ exports.CircularIndeterminateIndicatorPropTypes = CircularIndeterminateIndicatorPropTypes;
package/esm/index.js CHANGED
@@ -1 +1,2 @@
1
1
  export { CircularProgressIndicatorWithSchema, default as DSCircularProgressIndicator, default } from './DSCircularProgressIndicator.js';
2
+ export { DSCircularIndeterminateIndicator, DSCircularIndeterminateIndicatorWithSchema } from './v2/DSCircularProgressIndicatorV2.js';
@@ -0,0 +1,121 @@
1
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
2
+ import _taggedTemplateLiteral from '@babel/runtime/helpers/esm/taggedTemplateLiteral';
3
+ import 'react';
4
+ import { Grid } from '@elliemae/ds-grid';
5
+ import { DSTooltipV3 } from '@elliemae/ds-tooltip';
6
+ import { describe } from 'react-desc';
7
+ import styled from 'styled-components';
8
+ import { kfrm } from '@elliemae/ds-system';
9
+ import { uid } from 'uid';
10
+ import { CircularIndeterminateIndicatorPropTypes } from './react-desc-prop-types.js';
11
+ import { jsx, Fragment } from 'react/jsx-runtime';
12
+
13
+ var _templateObject, _templateObject2, _circle;
14
+ const r = kfrm(_templateObject || (_templateObject = _taggedTemplateLiteral(["to { transform: rotate(2turn) }"])));
15
+ const s = kfrm(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["0%, 39% { stroke-dasharray: 942px 2826px }"])));
16
+ const StyledSvg = /*#__PURE__*/styled.svg.withConfig({
17
+ componentId: "sc-1x34z2a-0"
18
+ })(["#gg{transform:rotate(45deg);stroke:url(#", ");mask:url(#", ");}mask use{stroke:#fff;stroke-linecap:round;stroke-dasharray:942px 2826px;animation:", " 1.5s cubic-bezier(0.5,-0.43,0.5,1.43) infinite,", " 0.75s ease-in-out infinite alternate;}"], props => props.linearGradientUid, props => props.maskUid, r, s);
19
+ const sizeToPx = {
20
+ xs: '16px',
21
+ s: '24px',
22
+ m: '32px',
23
+ l: '48px',
24
+ xl: '56px',
25
+ xxl: '64px'
26
+ };
27
+ const sizeToWeight = {
28
+ xs: '10%',
29
+ s: '9%',
30
+ m: '8%',
31
+ l: '6%',
32
+ xl: '5%',
33
+ xxl: '4%'
34
+ };
35
+ const colorToHex = {
36
+ light: '#FFFFFF',
37
+ dark: '#0F364A'
38
+ };
39
+ const sizeToTextSize = {
40
+ xs: '12px',
41
+ s: '12px',
42
+ m: '12px',
43
+ l: '13px',
44
+ xl: '14px',
45
+ xxl: '16px'
46
+ };
47
+ const DSCircularIndeterminateIndicator = _ref => {
48
+ let {
49
+ size = 'm',
50
+ color = 'dark',
51
+ text = '',
52
+ showText = true,
53
+ withTooltip = false,
54
+ tooltipStartPlacementPreference = 'bottom'
55
+ } = _ref;
56
+ const Wrapper = withTooltip ? DSTooltipV3 : _ref2 => {
57
+ let {
58
+ children
59
+ } = _ref2;
60
+ return /*#__PURE__*/jsx(Fragment, {
61
+ children: children
62
+ });
63
+ };
64
+ const linearGradientUid = uid(16);
65
+ const maskUid = uid(16);
66
+ const circleUid = uid(16);
67
+ return /*#__PURE__*/_jsx(Grid, {
68
+ gutter: "xs",
69
+ justifyContent: "center",
70
+ role: "status"
71
+ }, void 0, /*#__PURE__*/_jsx(Wrapper, {
72
+ text: text,
73
+ textAlign: "center",
74
+ startPlacementPreference: tooltipStartPlacementPreference
75
+ }, void 0, /*#__PURE__*/_jsx(StyledSvg, {
76
+ viewBox: "-1950 -975 3900 1950",
77
+ fill: "none",
78
+ stroke: "transparent",
79
+ strokeWidth: sizeToWeight[size],
80
+ width: sizeToPx[size],
81
+ height: sizeToPx[size],
82
+ style: {
83
+ display: 'block',
84
+ margin: 'auto'
85
+ },
86
+ linearGradientUid: linearGradientUid,
87
+ maskUid: maskUid
88
+ }, void 0, /*#__PURE__*/_jsx("g", {
89
+ transform: "scale(2.298)"
90
+ }, void 0, /*#__PURE__*/_jsx("linearGradient", {
91
+ id: linearGradientUid
92
+ }, void 0, /*#__PURE__*/_jsx("stop", {
93
+ stopColor: color === 'dark' ? '#48a3ff' : '#ccd6ff'
94
+ }), /*#__PURE__*/_jsx("stop", {
95
+ stopColor: color === 'dark' ? '#49d0ff' : '#ebf6ff',
96
+ offset: "1"
97
+ })), /*#__PURE__*/_jsx("mask", {
98
+ id: maskUid
99
+ }, void 0, _circle || (_circle = /*#__PURE__*/_jsx("circle", {
100
+ r: "1200",
101
+ fill: "#000"
102
+ })), /*#__PURE__*/_jsx("use", {
103
+ xlinkHref: "#".concat(circleUid)
104
+ })), /*#__PURE__*/_jsx("circle", {
105
+ id: circleUid,
106
+ r: "600"
107
+ }), /*#__PURE__*/_jsx("g", {
108
+ id: "gg"
109
+ }, void 0, /*#__PURE__*/_jsx("use", {
110
+ xlinkHref: "#".concat(circleUid)
111
+ })))), text !== '' && showText && /*#__PURE__*/_jsx("span", {
112
+ style: {
113
+ color: colorToHex[color],
114
+ fontSize: sizeToTextSize[size]
115
+ }
116
+ }, void 0, text)));
117
+ };
118
+ const DSCircularIndeterminateIndicatorWithSchema = describe(DSCircularIndeterminateIndicator);
119
+ DSCircularIndeterminateIndicatorWithSchema.propTypes = CircularIndeterminateIndicatorPropTypes;
120
+
121
+ export { DSCircularIndeterminateIndicator, DSCircularIndeterminateIndicatorWithSchema };
@@ -0,0 +1 @@
1
+ export { DSCircularIndeterminateIndicator, DSCircularIndeterminateIndicatorWithSchema } from './DSCircularProgressIndicatorV2.js';
@@ -0,0 +1,13 @@
1
+ import { PropTypes } from 'react-desc';
2
+
3
+ /* eslint-disable max-lines */
4
+ const CircularIndeterminateIndicatorPropTypes = {
5
+ size: PropTypes.oneOf(['xs', 's', 'm', 'l', 'xl', 'xxl']).description('Size of the indicator').defaultValue('m'),
6
+ color: PropTypes.oneOf(['light', 'dark']).description('Color mode for the indicator').defaultValue('dark'),
7
+ text: PropTypes.string.description('Optional text to show under the indicator').defaultValue(''),
8
+ showText: PropTypes.bool.description('Whether to show the optional text or not').defaultValue(true),
9
+ withTooltip: PropTypes.bool.description('Whether to include a tooltip that shows the optional text on hover').defaultValue(false),
10
+ tooltipStartPlacementPreference: PropTypes.oneOf(['top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']).description('start placement preference for the tooltip').defaultValue('center')
11
+ };
12
+
13
+ export { CircularIndeterminateIndicatorPropTypes };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-circular-progress-indicator",
3
- "version": "2.2.0-next.2",
3
+ "version": "2.2.0-next.6",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Circular progress indicator",
6
6
  "module": "./esm/index.js",
@@ -11,6 +11,18 @@
11
11
  "import": "./esm/index.js",
12
12
  "require": "./cjs/index.js"
13
13
  },
14
+ "./v2/react-desc-prop-types": {
15
+ "import": "./esm/v2/react-desc-prop-types.js",
16
+ "require": "./cjs/v2/react-desc-prop-types.js"
17
+ },
18
+ "./v2": {
19
+ "import": "./esm/v2/index.js",
20
+ "require": "./cjs/v2/index.js"
21
+ },
22
+ "./v2/DSCircularProgressIndicatorV2": {
23
+ "import": "./esm/v2/DSCircularProgressIndicatorV2.js",
24
+ "require": "./cjs/v2/DSCircularProgressIndicatorV2.js"
25
+ },
14
26
  "./DSCircularProgressIndicator": {
15
27
  "import": "./esm/DSCircularProgressIndicator.js",
16
28
  "require": "./cjs/DSCircularProgressIndicator.js"
@@ -36,8 +48,8 @@
36
48
  "build": "node ../../scripts/build/build.js"
37
49
  },
38
50
  "dependencies": {
39
- "@elliemae/ds-classnames": "2.2.0-next.2",
40
- "@elliemae/ds-tooltip": "2.2.0-next.2",
51
+ "@elliemae/ds-classnames": "2.2.0-next.6",
52
+ "@elliemae/ds-tooltip": "2.2.0-next.6",
41
53
  "react-desc": "~4.1.3"
42
54
  },
43
55
  "devDependencies": {
package/types/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export { default, default as DSCircularProgressIndicator, CircularProgressIndicatorWithSchema, } from './DSCircularProgressIndicator';
2
+ export * from './v2';
@@ -0,0 +1,9 @@
1
+ /// <reference path="../../../../../shared/typings/react-desc.d.ts" />
2
+ import React from 'react';
3
+ import { DSCircularIndeterminateIndicatorT } from './react-desc-prop-types';
4
+ export declare const DSCircularIndeterminateIndicator: React.ComponentType<DSCircularIndeterminateIndicatorT.Props>;
5
+ export declare const DSCircularIndeterminateIndicatorWithSchema: {
6
+ (props?: React.PropsWithChildren<DSCircularIndeterminateIndicatorT.Props> | undefined): JSX.Element;
7
+ propTypes: unknown;
8
+ toTypescript: () => import("react-desc").TypescriptSchema;
9
+ };
@@ -0,0 +1 @@
1
+ export * from './DSCircularProgressIndicatorV2';
@@ -0,0 +1,31 @@
1
+ /// <reference path="../../../../../shared/typings/react-desc.d.ts" />
2
+ export declare namespace DSCircularIndeterminateIndicatorT {
3
+ interface Props {
4
+ size?: 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';
5
+ color?: 'light' | 'dark';
6
+ text?: string;
7
+ showText?: boolean;
8
+ withTooltip: boolean;
9
+ tooltipStartPlacementPreference?: 'top-start' | 'top' | 'top-end' | 'right-start' | 'right' | 'right-end' | 'bottom-end' | 'bottom' | 'bottom-start' | 'left-end' | 'left' | 'left-start';
10
+ }
11
+ }
12
+ export declare const CircularIndeterminateIndicatorPropTypes: {
13
+ size: {
14
+ deprecated: import("react-desc").PropTypesDescValidator;
15
+ };
16
+ color: {
17
+ deprecated: import("react-desc").PropTypesDescValidator;
18
+ };
19
+ text: {
20
+ deprecated: import("react-desc").PropTypesDescValidator;
21
+ };
22
+ showText: {
23
+ deprecated: import("react-desc").PropTypesDescValidator;
24
+ };
25
+ withTooltip: {
26
+ deprecated: import("react-desc").PropTypesDescValidator;
27
+ };
28
+ tooltipStartPlacementPreference: {
29
+ deprecated: import("react-desc").PropTypesDescValidator;
30
+ };
31
+ };