se-design 1.1.1-dev-01 → 1.1.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/dist/assets/style.css +1 -1
- package/dist/index225.js.map +1 -1
- package/dist/index229.js +3 -3
- package/dist/index229.js.map +1 -1
- package/dist/index33.js +10 -11
- package/dist/index43.js +8 -9
- package/dist/index44.js +17 -18
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +1 -2
- package/dist/index61.js +16 -17
- package/dist/index65.js +76 -65
- package/dist/index65.js.map +1 -1
- package/dist/index7.js +7 -8
- package/dist/index71.js +1 -2
- package/package.json +1 -1
package/dist/index225.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index225.js","sources":["../node_modules/react-svg/dist/react-svg.esm.js"],"sourcesContent":["import _objectWithoutPropertiesLoose from '@babel/runtime/helpers/objectWithoutPropertiesLoose';\nimport _extends from '@babel/runtime/helpers/extends';\nimport _inheritsLoose from '@babel/runtime/helpers/inheritsLoose';\nimport { SVGInjector } from '@tanem/svg-injector';\nimport * as PropTypes from 'prop-types';\nimport * as React from 'react';\n\n// Hat-tip: https://github.com/mui/material-ui/tree/master/packages/mui-utils/src.\nvar ownerWindow = function ownerWindow(node) {\n var doc = (node == null ? undefined : node.ownerDocument) || document;\n return doc.defaultView || window;\n};\n\n// Hat-tip: https://github.com/developit/preact-compat/blob/master/src/index.js#L402.\nvar shallowDiffers = function shallowDiffers(a, b) {\n for (var i in a) {\n if (!(i in b)) {\n return true;\n }\n }\n for (var _i in b) {\n if (a[_i] !== b[_i]) {\n return true;\n }\n }\n return false;\n};\n\nvar _excluded = [\"afterInjection\", \"beforeInjection\", \"desc\", \"evalScripts\", \"fallback\", \"httpRequestWithCredentials\", \"loading\", \"renumerateIRIElements\", \"src\", \"title\", \"useRequestCache\", \"wrapper\"];\nvar svgNamespace = 'http://www.w3.org/2000/svg';\nvar xlinkNamespace = 'http://www.w3.org/1999/xlink';\nvar ReactSVG = /*#__PURE__*/function (_React$Component) {\n function ReactSVG() {\n var _this;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.initialState = {\n hasError: false,\n isLoading: true\n };\n _this.state = _this.initialState;\n _this._isMounted = false;\n _this.reactWrapper = undefined;\n _this.nonReactWrapper = undefined;\n _this.refCallback = function (reactWrapper) {\n _this.reactWrapper = reactWrapper;\n };\n return _this;\n }\n _inheritsLoose(ReactSVG, _React$Component);\n var _proto = ReactSVG.prototype;\n _proto.renderSVG = function renderSVG() {\n var _this2 = this;\n /* istanbul ignore else */\n if (this.reactWrapper instanceof ownerWindow(this.reactWrapper).Node) {\n var _this$props = this.props,\n desc = _this$props.desc,\n evalScripts = _this$props.evalScripts,\n httpRequestWithCredentials = _this$props.httpRequestWithCredentials,\n renumerateIRIElements = _this$props.renumerateIRIElements,\n src = _this$props.src,\n title = _this$props.title,\n useRequestCache = _this$props.useRequestCache;\n /* eslint-disable @typescript-eslint/no-non-null-assertion */\n var onError = this.props.onError;\n var beforeInjection = this.props.beforeInjection;\n var afterInjection = this.props.afterInjection;\n var wrapper = this.props.wrapper;\n var nonReactWrapper;\n var nonReactTarget;\n if (wrapper === 'svg') {\n nonReactWrapper = document.createElementNS(svgNamespace, wrapper);\n nonReactWrapper.setAttribute('xmlns', svgNamespace);\n nonReactWrapper.setAttribute('xmlns:xlink', xlinkNamespace);\n nonReactTarget = document.createElementNS(svgNamespace, wrapper);\n } else {\n nonReactWrapper = document.createElement(wrapper);\n nonReactTarget = document.createElement(wrapper);\n }\n nonReactWrapper.appendChild(nonReactTarget);\n nonReactTarget.dataset.src = src;\n this.nonReactWrapper = this.reactWrapper.appendChild(nonReactWrapper);\n var handleError = function handleError(error) {\n _this2.removeSVG();\n if (!_this2._isMounted) {\n onError(error);\n return;\n }\n _this2.setState(function () {\n return {\n hasError: true,\n isLoading: false\n };\n }, function () {\n onError(error);\n });\n };\n var afterEach = function afterEach(error, svg) {\n if (error) {\n handleError(error);\n return;\n }\n // TODO (Tane): It'd be better to cleanly unsubscribe from SVGInjector\n // callbacks instead of tracking a property like this.\n if (_this2._isMounted) {\n _this2.setState(function () {\n return {\n isLoading: false\n };\n }, function () {\n try {\n afterInjection(svg);\n } catch (afterInjectionError) {\n handleError(afterInjectionError);\n }\n });\n }\n };\n var beforeEach = function beforeEach(svg) {\n svg.setAttribute('role', 'img');\n if (desc) {\n var originalDesc = svg.querySelector(':scope > desc');\n if (originalDesc) {\n svg.removeChild(originalDesc);\n }\n var newDesc = document.createElement('desc');\n newDesc.innerHTML = desc;\n svg.prepend(newDesc);\n }\n if (title) {\n var originalTitle = svg.querySelector(':scope > title');\n if (originalTitle) {\n svg.removeChild(originalTitle);\n }\n var newTitle = document.createElement('title');\n newTitle.innerHTML = title;\n svg.prepend(newTitle);\n }\n try {\n beforeInjection(svg);\n } catch (error) {\n handleError(error);\n }\n };\n SVGInjector(nonReactTarget, {\n afterEach: afterEach,\n beforeEach: beforeEach,\n cacheRequests: useRequestCache,\n evalScripts: evalScripts,\n httpRequestWithCredentials: httpRequestWithCredentials,\n renumerateIRIElements: renumerateIRIElements\n });\n }\n };\n _proto.removeSVG = function removeSVG() {\n var _this$nonReactWrapper;\n if ((_this$nonReactWrapper = this.nonReactWrapper) != null && _this$nonReactWrapper.parentNode) {\n this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper);\n this.nonReactWrapper = null;\n }\n };\n _proto.componentDidMount = function componentDidMount() {\n this._isMounted = true;\n this.renderSVG();\n };\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var _this3 = this;\n if (shallowDiffers(_extends({}, prevProps), this.props)) {\n this.setState(function () {\n return _this3.initialState;\n }, function () {\n _this3.removeSVG();\n _this3.renderSVG();\n });\n }\n };\n _proto.componentWillUnmount = function componentWillUnmount() {\n this._isMounted = false;\n this.removeSVG();\n };\n _proto.render = function render() {\n /* eslint-disable @typescript-eslint/no-unused-vars */\n var _this$props2 = this.props;\n _this$props2.afterInjection;\n _this$props2.beforeInjection;\n _this$props2.desc;\n _this$props2.evalScripts;\n var Fallback = _this$props2.fallback;\n _this$props2.httpRequestWithCredentials;\n var Loading = _this$props2.loading;\n _this$props2.renumerateIRIElements;\n _this$props2.src;\n _this$props2.title;\n _this$props2.useRequestCache;\n var wrapper = _this$props2.wrapper,\n rest = _objectWithoutPropertiesLoose(_this$props2, _excluded);\n /* eslint-enable @typescript-eslint/no-unused-vars */\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n var Wrapper = wrapper;\n return /*#__PURE__*/React.createElement(Wrapper, _extends({}, rest, {\n ref: this.refCallback\n }, wrapper === 'svg' ? {\n xmlns: svgNamespace,\n xmlnsXlink: xlinkNamespace\n } : {}), this.state.isLoading && Loading && /*#__PURE__*/React.createElement(Loading, null), this.state.hasError && Fallback && /*#__PURE__*/React.createElement(Fallback, null));\n };\n return ReactSVG;\n}(React.Component);\nReactSVG.defaultProps = {\n afterInjection: function afterInjection() {\n return undefined;\n },\n beforeInjection: function beforeInjection() {\n return undefined;\n },\n desc: '',\n evalScripts: 'never',\n fallback: null,\n httpRequestWithCredentials: false,\n loading: null,\n onError: function onError() {\n return undefined;\n },\n renumerateIRIElements: true,\n title: '',\n useRequestCache: true,\n wrapper: 'div'\n};\nReactSVG.propTypes = {\n afterInjection: PropTypes.func,\n beforeInjection: PropTypes.func,\n desc: PropTypes.string,\n evalScripts: PropTypes.oneOf(['always', 'once', 'never']),\n fallback: PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.string]),\n httpRequestWithCredentials: PropTypes.bool,\n loading: PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.string]),\n onError: PropTypes.func,\n renumerateIRIElements: PropTypes.bool,\n src: PropTypes.string.isRequired,\n title: PropTypes.string,\n useRequestCache: PropTypes.bool,\n wrapper: PropTypes.oneOf(['div', 'span', 'svg'])\n} ;\n\nexport { ReactSVG };\n//# sourceMappingURL=react-svg.esm.js.map\n"],"names":["_objectWithoutPropertiesLoose","_extends","_inheritsLoose","SVGInjector","propTypesExports","React","ownerWindow","node","doc","shallowDiffers","a","b","i","_i","_excluded","svgNamespace","xlinkNamespace","ReactSVG","_React$Component","_this","_len","args","_key","reactWrapper","_proto","_this2","_this$props","desc","evalScripts","httpRequestWithCredentials","renumerateIRIElements","src","title","useRequestCache","onError","beforeInjection","afterInjection","wrapper","nonReactWrapper","nonReactTarget","handleError","error","afterEach","svg","afterInjectionError","beforeEach","originalDesc","newDesc","originalTitle","newTitle","_this$nonReactWrapper","prevProps","_this3","_this$props2","Fallback","Loading","rest","Wrapper","PropTypes.func","PropTypes.string","PropTypes.oneOf","PropTypes.oneOfType","PropTypes.object","PropTypes.bool"],"mappings":"AAOA,OAAAA,OAAA;AAAA,OAAAC,OAAA;AAAA,OAAAC,OAAA;AAAA,SAAA,eAAAC,SAAA;AAAA,SAAA,KAAAC,SAAA;AAAA,YAAAC,OAAA;AACA,IAAIC,IAAc,SAAqBC,GAAM;AAC3C,MAAIC,IAAkCD,GAAK,iBAAkB;AAC7D,SAAOC,EAAI,eAAe;AAC5B,GAGIC,IAAiB,SAAwBC,GAAGC,GAAG;AACjD,WAASC,KAAKF;AACZ,QAAI,EAAEE,KAAKD;AACT,aAAO;AAGX,WAASE,KAAMF;AACb,QAAID,EAAEG,CAAE,MAAMF,EAAEE,CAAE;AAChB,aAAO;AAGX,SAAO;AACT,GAEIC,IAAY,CAAC,kBAAkB,mBAAmB,QAAQ,eAAe,YAAY,8BAA8B,WAAW,yBAAyB,OAAO,SAAS,mBAAmB,SAAS,GACnMC,IAAe,8BACfC,IAAiB,gCACjBC,IAAwB,yBAAUC,GAAkB;AACtD,WAASD,IAAW;AAElB,aADIE,GACKC,IAAO,UAAU,QAAQC,IAAO,IAAI,MAAMD,CAAI,GAAGE,IAAO,GAAGA,IAAOF,GAAME;AAC/E,MAAAD,EAAKC,CAAI,IA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ACOrC;AACT,EAAEZ,EAAM,SAAS;AACjBY,EAAS,eAAe;AAAA,EACtB,gBAAgB,WAA0B;AAAA,EAE1C;AAAA,EACA,iBAAiB,WAA2B;AAAA,EAE5C;AAAA,EACA,MAAM;AAAA,EACN,aAAa;AAAA,EACb,UAAU;AAAA,EACV,4BAA4B;AAAA,EAC5B,SAAS;AAAA,EACT,SAAS,WAAmB;AAAA,EAE5B;AAAA,EACA,uBAAuB;AAAA,EACvB,OAAO;AAAA,EACP,iBAAiB;AAAA,EACjB,SAAS;AACX;AACAA,EAAS,YAAY;AAAA,EACnB,gBAAgByC,EAAAA;AAAAA,EAChB,iBAAiBA,EAAAA;AAAAA,EACjB,MAAMC,EAAAA;AAAAA,EACN,aAAaC,EAAAA,MAAgB,CAAC,UAAU,QAAQ,OAAO,CAAC;AAAA,EACxD,UAAUC,EAAAA,UAAoB,CAACH,EAAAA,MAAgBI,EAAAA,QAAkBH,EAAAA,MAAgB,CAAC;AAAA,EAClF,4BAA4BI,EAAAA;AAAAA,EAC5B,SAASF,EAAAA,UAAoB,CAACH,EAAAA,MAAgBI,EAAAA,QAAkBH,EAAAA,MAAgB,CAAC;AAAA,EACjF,SAASD,EAAAA;AAAAA,EACT,uBAAuBK,EAAAA;AAAAA,EACvB,KAAKJ,EAAAA,OAAiB;AAAA,EACtB,OAAOA,EAAAA;AAAAA,EACP,iBAAiBI,EAAAA;AAAAA,EACjB,SAASH,EAAAA,MAAgB,CAAC,OAAO,QAAQ,KAAK,CAAC;AACjD;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index225.js","sources":["../node_modules/react-svg/dist/react-svg.esm.js"],"sourcesContent":["import _objectWithoutPropertiesLoose from '@babel/runtime/helpers/objectWithoutPropertiesLoose';\nimport _extends from '@babel/runtime/helpers/extends';\nimport _inheritsLoose from '@babel/runtime/helpers/inheritsLoose';\nimport { SVGInjector } from '@tanem/svg-injector';\nimport * as PropTypes from 'prop-types';\nimport * as React from 'react';\n\n// Hat-tip: https://github.com/mui/material-ui/tree/master/packages/mui-utils/src.\nvar ownerWindow = function ownerWindow(node) {\n var doc = (node == null ? void 0 : node.ownerDocument) || document;\n return doc.defaultView || window;\n};\n\n// Hat-tip: https://github.com/developit/preact-compat/blob/master/src/index.js#L402.\nvar shallowDiffers = function shallowDiffers(a, b) {\n for (var i in a) {\n if (!(i in b)) {\n return true;\n }\n }\n for (var _i in b) {\n if (a[_i] !== b[_i]) {\n return true;\n }\n }\n return false;\n};\n\nvar _excluded = [\"afterInjection\", \"beforeInjection\", \"desc\", \"evalScripts\", \"fallback\", \"httpRequestWithCredentials\", \"loading\", \"renumerateIRIElements\", \"src\", \"title\", \"useRequestCache\", \"wrapper\"];\nvar svgNamespace = 'http://www.w3.org/2000/svg';\nvar xlinkNamespace = 'http://www.w3.org/1999/xlink';\nvar ReactSVG = /*#__PURE__*/function (_React$Component) {\n function ReactSVG() {\n var _this;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.initialState = {\n hasError: false,\n isLoading: true\n };\n _this.state = _this.initialState;\n _this._isMounted = false;\n _this.reactWrapper = void 0;\n _this.nonReactWrapper = void 0;\n _this.refCallback = function (reactWrapper) {\n _this.reactWrapper = reactWrapper;\n };\n return _this;\n }\n _inheritsLoose(ReactSVG, _React$Component);\n var _proto = ReactSVG.prototype;\n _proto.renderSVG = function renderSVG() {\n var _this2 = this;\n /* istanbul ignore else */\n if (this.reactWrapper instanceof ownerWindow(this.reactWrapper).Node) {\n var _this$props = this.props,\n desc = _this$props.desc,\n evalScripts = _this$props.evalScripts,\n httpRequestWithCredentials = _this$props.httpRequestWithCredentials,\n renumerateIRIElements = _this$props.renumerateIRIElements,\n src = _this$props.src,\n title = _this$props.title,\n useRequestCache = _this$props.useRequestCache;\n /* eslint-disable @typescript-eslint/no-non-null-assertion */\n var onError = this.props.onError;\n var beforeInjection = this.props.beforeInjection;\n var afterInjection = this.props.afterInjection;\n var wrapper = this.props.wrapper;\n var nonReactWrapper;\n var nonReactTarget;\n if (wrapper === 'svg') {\n nonReactWrapper = document.createElementNS(svgNamespace, wrapper);\n nonReactWrapper.setAttribute('xmlns', svgNamespace);\n nonReactWrapper.setAttribute('xmlns:xlink', xlinkNamespace);\n nonReactTarget = document.createElementNS(svgNamespace, wrapper);\n } else {\n nonReactWrapper = document.createElement(wrapper);\n nonReactTarget = document.createElement(wrapper);\n }\n nonReactWrapper.appendChild(nonReactTarget);\n nonReactTarget.dataset.src = src;\n this.nonReactWrapper = this.reactWrapper.appendChild(nonReactWrapper);\n var handleError = function handleError(error) {\n _this2.removeSVG();\n if (!_this2._isMounted) {\n onError(error);\n return;\n }\n _this2.setState(function () {\n return {\n hasError: true,\n isLoading: false\n };\n }, function () {\n onError(error);\n });\n };\n var afterEach = function afterEach(error, svg) {\n if (error) {\n handleError(error);\n return;\n }\n // TODO (Tane): It'd be better to cleanly unsubscribe from SVGInjector\n // callbacks instead of tracking a property like this.\n if (_this2._isMounted) {\n _this2.setState(function () {\n return {\n isLoading: false\n };\n }, function () {\n try {\n afterInjection(svg);\n } catch (afterInjectionError) {\n handleError(afterInjectionError);\n }\n });\n }\n };\n var beforeEach = function beforeEach(svg) {\n svg.setAttribute('role', 'img');\n if (desc) {\n var originalDesc = svg.querySelector(':scope > desc');\n if (originalDesc) {\n svg.removeChild(originalDesc);\n }\n var newDesc = document.createElement('desc');\n newDesc.innerHTML = desc;\n svg.prepend(newDesc);\n }\n if (title) {\n var originalTitle = svg.querySelector(':scope > title');\n if (originalTitle) {\n svg.removeChild(originalTitle);\n }\n var newTitle = document.createElement('title');\n newTitle.innerHTML = title;\n svg.prepend(newTitle);\n }\n try {\n beforeInjection(svg);\n } catch (error) {\n handleError(error);\n }\n };\n SVGInjector(nonReactTarget, {\n afterEach: afterEach,\n beforeEach: beforeEach,\n cacheRequests: useRequestCache,\n evalScripts: evalScripts,\n httpRequestWithCredentials: httpRequestWithCredentials,\n renumerateIRIElements: renumerateIRIElements\n });\n }\n };\n _proto.removeSVG = function removeSVG() {\n var _this$nonReactWrapper;\n if ((_this$nonReactWrapper = this.nonReactWrapper) != null && _this$nonReactWrapper.parentNode) {\n this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper);\n this.nonReactWrapper = null;\n }\n };\n _proto.componentDidMount = function componentDidMount() {\n this._isMounted = true;\n this.renderSVG();\n };\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var _this3 = this;\n if (shallowDiffers(_extends({}, prevProps), this.props)) {\n this.setState(function () {\n return _this3.initialState;\n }, function () {\n _this3.removeSVG();\n _this3.renderSVG();\n });\n }\n };\n _proto.componentWillUnmount = function componentWillUnmount() {\n this._isMounted = false;\n this.removeSVG();\n };\n _proto.render = function render() {\n /* eslint-disable @typescript-eslint/no-unused-vars */\n var _this$props2 = this.props;\n _this$props2.afterInjection;\n _this$props2.beforeInjection;\n _this$props2.desc;\n _this$props2.evalScripts;\n var Fallback = _this$props2.fallback;\n _this$props2.httpRequestWithCredentials;\n var Loading = _this$props2.loading;\n _this$props2.renumerateIRIElements;\n _this$props2.src;\n _this$props2.title;\n _this$props2.useRequestCache;\n var wrapper = _this$props2.wrapper,\n rest = _objectWithoutPropertiesLoose(_this$props2, _excluded);\n /* eslint-enable @typescript-eslint/no-unused-vars */\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n var Wrapper = wrapper;\n return /*#__PURE__*/React.createElement(Wrapper, _extends({}, rest, {\n ref: this.refCallback\n }, wrapper === 'svg' ? {\n xmlns: svgNamespace,\n xmlnsXlink: xlinkNamespace\n } : {}), this.state.isLoading && Loading && /*#__PURE__*/React.createElement(Loading, null), this.state.hasError && Fallback && /*#__PURE__*/React.createElement(Fallback, null));\n };\n return ReactSVG;\n}(React.Component);\nReactSVG.defaultProps = {\n afterInjection: function afterInjection() {\n return undefined;\n },\n beforeInjection: function beforeInjection() {\n return undefined;\n },\n desc: '',\n evalScripts: 'never',\n fallback: null,\n httpRequestWithCredentials: false,\n loading: null,\n onError: function onError() {\n return undefined;\n },\n renumerateIRIElements: true,\n title: '',\n useRequestCache: true,\n wrapper: 'div'\n};\nReactSVG.propTypes = {\n afterInjection: PropTypes.func,\n beforeInjection: PropTypes.func,\n desc: PropTypes.string,\n evalScripts: PropTypes.oneOf(['always', 'once', 'never']),\n fallback: PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.string]),\n httpRequestWithCredentials: PropTypes.bool,\n loading: PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.string]),\n onError: PropTypes.func,\n renumerateIRIElements: PropTypes.bool,\n src: PropTypes.string.isRequired,\n title: PropTypes.string,\n useRequestCache: PropTypes.bool,\n wrapper: PropTypes.oneOf(['div', 'span', 'svg'])\n} ;\n\nexport { ReactSVG };\n//# sourceMappingURL=react-svg.esm.js.map\n"],"names":["_objectWithoutPropertiesLoose","_extends","_inheritsLoose","SVGInjector","propTypesExports","React","ownerWindow","node","doc","shallowDiffers","a","b","i","_i","_excluded","svgNamespace","xlinkNamespace","ReactSVG","_React$Component","_this","_len","args","_key","reactWrapper","_proto","_this2","_this$props","desc","evalScripts","httpRequestWithCredentials","renumerateIRIElements","src","title","useRequestCache","onError","beforeInjection","afterInjection","wrapper","nonReactWrapper","nonReactTarget","handleError","error","afterEach","svg","afterInjectionError","beforeEach","originalDesc","newDesc","originalTitle","newTitle","_this$nonReactWrapper","prevProps","_this3","_this$props2","Fallback","Loading","rest","Wrapper","PropTypes.func","PropTypes.string","PropTypes.oneOf","PropTypes.oneOfType","PropTypes.object","PropTypes.bool"],"mappings":"AAOA,OAAAA,OAAA;AAAA,OAAAC,OAAA;AAAA,OAAAC,OAAA;AAAA,SAAA,eAAAC,SAAA;AAAA,SAAA,KAAAC,SAAA;AAAA,YAAAC,OAAA;AACA,IAAIC,IAAc,SAAqBC,GAAM;AAC3C,MAAIC,IAA+BD,GAAK,iBAAkB;AAC1D,SAAOC,EAA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A,EACjF,SAASD,EAAAA;AAAAA,EACT,uBAAuBK,EAAAA;AAAAA,EACvB,KAAKJ,EAAAA,OAAiB;AAAA,EACtB,OAAOA,EAAAA;AAAAA,EACP,iBAAiBI,EAAAA;AAAAA,EACjB,SAASH,EAAAA,MAAgB,CAAC,OAAO,QAAQ,KAAK,CAAC;AACjD;","x_google_ignoreList":[0]}
|
package/dist/index229.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const f = /* @__PURE__ */
|
|
1
|
+
import { useRef as o, useCallback as u, createContext as s, useContext as c, useEffect as a } from "react";
|
|
2
|
+
const f = /* @__PURE__ */ s(null);
|
|
3
3
|
function l() {
|
|
4
4
|
const r = o(/* @__PURE__ */ new Set()), t = o([]);
|
|
5
5
|
return {
|
|
6
|
-
register:
|
|
6
|
+
register: u((n) => (r.current.add(n), t.current = Array.from(r.current), () => {
|
|
7
7
|
r.current.delete(n), t.current = Array.from(r.current);
|
|
8
8
|
}), []),
|
|
9
9
|
portalContainerRefs: t
|
package/dist/index229.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index229.js","sources":["../src/utils/a11y/FocusTrapPortalContext.tsx"],"sourcesContent":["import { createContext, useCallback, useContext, useEffect, useRef } from 'react';\n\ntype RegisterPortal = (ref: React.RefObject<HTMLElement | null>) => () => void;\n\n/**\n * Context for portal content to register with the nearest focus trap.\n * When a Modal (or any focus trap owner) provides this context, portal-rendered\n * content (e.g., Popover with isWithPortal) can register its container ref so\n * the focus trap's safety net allows focus to move into it.\n */\nexport const FocusTrapPortalContext = createContext<RegisterPortal | null>(null);\n\n/**\n * Hook for the focus trap owner (Modal) to create a portal registration function\n * and a stable ref to the current list of portal container refs.\n *\n * Usage in Modal:\n * ```tsx\n * const { register, portalContainerRefs } = useFocusTrapPortalRegistry();\n * // Pass portalContainerRefs.current to useModalA11y\n * // Wrap children with <FocusTrapPortalContext.Provider value={register}>\n * ```\n */\nexport function useFocusTrapPortalRegistry() {\n const portalRefsSet = useRef<Set<React.RefObject<HTMLElement | null>>>(new Set());\n const portalContainerRefs = useRef<React.RefObject<HTMLElement | null>[]>([]);\n\n const register: RegisterPortal = useCallback((ref) => {\n portalRefsSet.current.add(ref);\n portalContainerRefs.current = Array.from(portalRefsSet.current);\n return () => {\n portalRefsSet.current.delete(ref);\n portalContainerRefs.current = Array.from(portalRefsSet.current);\n };\n }, []);\n\n return { register, portalContainerRefs };\n}\n\n/**\n * Hook for portal content (Popover) to register its container ref with the\n * nearest ancestor focus trap. No-op if there is no focus trap ancestor.\n *\n * @param portalRef - Ref to the portal's root DOM element\n * @param isActive - Whether the portal is currently mounted and should be registered\n */\nexport function useRegisterPortalWithFocusTrap(\n portalRef: React.RefObject<HTMLElement | null>,\n isActive: boolean\n) {\n const register = useContext(FocusTrapPortalContext);\n\n useEffect(() => {\n if (!register || !isActive) return;\n return register(portalRef);\n }, [register, isActive, portalRef]);\n}\n"],"names":["
|
|
1
|
+
{"version":3,"file":"index229.js","sources":["../src/utils/a11y/FocusTrapPortalContext.tsx"],"sourcesContent":["import { createContext, useCallback, useContext, useEffect, useRef } from 'react';\n\ntype RegisterPortal = (ref: React.RefObject<HTMLElement | null>) => () => void;\n\n/**\n * Context for portal content to register with the nearest focus trap.\n * When a Modal (or any focus trap owner) provides this context, portal-rendered\n * content (e.g., Popover with isWithPortal) can register its container ref so\n * the focus trap's safety net allows focus to move into it.\n */\nexport const FocusTrapPortalContext = createContext<RegisterPortal | null>(null);\n\n/**\n * Hook for the focus trap owner (Modal) to create a portal registration function\n * and a stable ref to the current list of portal container refs.\n *\n * Usage in Modal:\n * ```tsx\n * const { register, portalContainerRefs } = useFocusTrapPortalRegistry();\n * // Pass portalContainerRefs.current to useModalA11y\n * // Wrap children with <FocusTrapPortalContext.Provider value={register}>\n * ```\n */\nexport function useFocusTrapPortalRegistry() {\n const portalRefsSet = useRef<Set<React.RefObject<HTMLElement | null>>>(new Set());\n const portalContainerRefs = useRef<React.RefObject<HTMLElement | null>[]>([]);\n\n const register: RegisterPortal = useCallback((ref) => {\n portalRefsSet.current.add(ref);\n portalContainerRefs.current = Array.from(portalRefsSet.current);\n return () => {\n portalRefsSet.current.delete(ref);\n portalContainerRefs.current = Array.from(portalRefsSet.current);\n };\n }, []);\n\n return { register, portalContainerRefs };\n}\n\n/**\n * Hook for portal content (Popover) to register its container ref with the\n * nearest ancestor focus trap. No-op if there is no focus trap ancestor.\n *\n * @param portalRef - Ref to the portal's root DOM element\n * @param isActive - Whether the portal is currently mounted and should be registered\n */\nexport function useRegisterPortalWithFocusTrap(\n portalRef: React.RefObject<HTMLElement | null>,\n isActive: boolean\n) {\n const register = useContext(FocusTrapPortalContext);\n\n useEffect(() => {\n if (!register || !isActive) return;\n return register(portalRef);\n }, [register, isActive, portalRef]);\n}\n"],"names":["useRef","useCallback","createContext","useContext","useEffect","FocusTrapPortalContext","useFocusTrapPortalRegistry","portalRefsSet","Set","portalContainerRefs","register","ref","current","add","Array","from","delete","useRegisterPortalWithFocusTrap","portalRef","isActive"],"mappings":"AAUO,SAAA,UAAAA,GAAA,eAAAC,GAAA,iBAAAC,GAAA,cAAAC,GAAA,aAAAC,SAAA;AAAA,MAAMC,sBAA8D,IAAI;AAaxE,SAASC,IAA6B;AAC3C,QAAMC,IAAgBP,EAAiD,oBAAIQ,KAAK,GAC1EC,IAAsBT,EAA8C,EAAE;AAW5E,SAAO;AAAA,IAAEU,UATwBT,EAAaU,CAAAA,OAC5CJ,EAAcK,QAAQC,IAAIF,CAAG,GAC7BF,EAAoBG,UAAUE,MAAMC,KAAKR,EAAcK,OAAO,GACvD,MAAM;AACXL,MAAAA,EAAcK,QAAQI,OAAOL,CAAG,GAChCF,EAAoBG,UAAUE,MAAMC,KAAKR,EAAcK,OAAO;AAAA,IAChE,IACC,CAAA,CAAE;AAAA,IAEcH,qBAAAA;AAAAA,EAAAA;AACrB;AASO,SAASQ,EACdC,GACAC,GACA;AACA,QAAMT,IAAWP,EAAWE,CAAsB;AAElDD,EAAAA,EAAU,MAAM;AACd,QAAI,GAACM,KAAY,CAACS;AAClB,aAAOT,EAASQ,CAAS;AAAA,EAC3B,GAAG,CAACR,GAAUS,GAAUD,CAAS,CAAC;AACpC;"}
|
package/dist/index33.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "react";
|
|
2
2
|
import { Button as N } from "./index4.js";
|
|
3
3
|
import { Badge as I } from "./index10.js";
|
|
4
|
-
import { Icon as
|
|
4
|
+
import { Icon as g } from "./index6.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
const t = {
|
|
7
7
|
widgetCtn: "flex flex-col gap-[2px] align-center border border-[var(--color-gray-200)] rounded-[12px] w-[385px]",
|
|
@@ -21,16 +21,16 @@ const t = {
|
|
|
21
21
|
requestFeatureImageCtn: "w-[48px] h-[48px] border border-[var(--color-gray-200)] rounded-[50%] flex items-center flex-shrink-0 bg-[var(--color-red-50)]",
|
|
22
22
|
requestFeatureDescriptionCtn: "flex flex-col"
|
|
23
23
|
}, B = ({
|
|
24
|
-
widgetClassName:
|
|
24
|
+
widgetClassName: d = "",
|
|
25
25
|
widgetType: a = "general",
|
|
26
26
|
widgetTitle: r = "",
|
|
27
27
|
widgetDescription: l = "",
|
|
28
28
|
widgetImage: p,
|
|
29
|
-
hasImage:
|
|
29
|
+
hasImage: x = !1,
|
|
30
30
|
hasButtonCta: n = !1,
|
|
31
31
|
hasLinkCta: i = !1,
|
|
32
32
|
ctaText: o = "",
|
|
33
|
-
hasBadge:
|
|
33
|
+
hasBadge: f = !1,
|
|
34
34
|
badgeText: w = "",
|
|
35
35
|
buttonBgColor: u = "secondary",
|
|
36
36
|
onCtaClick: b,
|
|
@@ -38,7 +38,7 @@ const t = {
|
|
|
38
38
|
webinarDateInfo: c,
|
|
39
39
|
webinarSpeaker: s
|
|
40
40
|
}) => {
|
|
41
|
-
const E =
|
|
41
|
+
const E = f && /* @__PURE__ */ e.createElement(I, {
|
|
42
42
|
label: w,
|
|
43
43
|
className: t.widgetBadge,
|
|
44
44
|
bgColor: "var(--color-yellow-50)",
|
|
@@ -52,14 +52,14 @@ const t = {
|
|
|
52
52
|
label: o,
|
|
53
53
|
className: `${t.widgetButtonCta} mt-[4px]`,
|
|
54
54
|
onClick: b
|
|
55
|
-
})), C =
|
|
55
|
+
})), C = x && /* @__PURE__ */ e.createElement("div", {
|
|
56
56
|
className: `${t.widgetImageCtn} widget-image-ctn`
|
|
57
57
|
}, /* @__PURE__ */ e.createElement("img", {
|
|
58
58
|
src: p,
|
|
59
59
|
alt: "widget-image"
|
|
60
60
|
}));
|
|
61
61
|
return /* @__PURE__ */ e.createElement("div", {
|
|
62
|
-
className: `${t.widgetCtn} ${
|
|
62
|
+
className: `${t.widgetCtn} ${d} widget-ctn`,
|
|
63
63
|
onClick: v
|
|
64
64
|
}, a !== "general" && C, /* @__PURE__ */ e.createElement("div", {
|
|
65
65
|
className: t.descriptionCtn
|
|
@@ -71,14 +71,14 @@ const t = {
|
|
|
71
71
|
className: t.webinarInfoCtn
|
|
72
72
|
}, s && /* @__PURE__ */ e.createElement("div", {
|
|
73
73
|
className: `${t.webinarDescriptionInfo} align-baseline`
|
|
74
|
-
}, /* @__PURE__ */ e.createElement(
|
|
74
|
+
}, /* @__PURE__ */ e.createElement(g, {
|
|
75
75
|
name: "people",
|
|
76
76
|
className: "relative top-[2px]"
|
|
77
77
|
}), /* @__PURE__ */ e.createElement("span", {
|
|
78
78
|
className: t.webinarSpeaker
|
|
79
79
|
}, s)), c && /* @__PURE__ */ e.createElement("div", {
|
|
80
80
|
className: `${t.webinarTimeInfo} align-baseline mb-[4px]`
|
|
81
|
-
}, /* @__PURE__ */ e.createElement(
|
|
81
|
+
}, /* @__PURE__ */ e.createElement(g, {
|
|
82
82
|
name: "clock",
|
|
83
83
|
className: "relative top-[2px]"
|
|
84
84
|
}), /* @__PURE__ */ e.createElement("span", {
|
|
@@ -96,7 +96,6 @@ const t = {
|
|
|
96
96
|
}, l), m)) : m));
|
|
97
97
|
};
|
|
98
98
|
export {
|
|
99
|
-
B as Widget
|
|
100
|
-
B as default
|
|
99
|
+
B as Widget
|
|
101
100
|
};
|
|
102
101
|
//# sourceMappingURL=index33.js.map
|
package/dist/index43.js
CHANGED
|
@@ -43,12 +43,12 @@ const t = {
|
|
|
43
43
|
defaultExpanded: h = !0,
|
|
44
44
|
isExpanded: f,
|
|
45
45
|
onToggle: b,
|
|
46
|
-
isAccordion:
|
|
46
|
+
isAccordion: p = !0,
|
|
47
47
|
actionItems: l = []
|
|
48
48
|
}) => {
|
|
49
49
|
const [E, y] = I(h), u = f !== void 0;
|
|
50
50
|
let i = u ? f : E;
|
|
51
|
-
|
|
51
|
+
p || (i = !0);
|
|
52
52
|
const m = $(void 0, "get-started-widget"), v = `${m}-content`, C = () => {
|
|
53
53
|
u || y((a) => !a), b?.();
|
|
54
54
|
}, {
|
|
@@ -56,12 +56,12 @@ const t = {
|
|
|
56
56
|
} = L({
|
|
57
57
|
isNative: !0,
|
|
58
58
|
onClick: C
|
|
59
|
-
}),
|
|
59
|
+
}), d = l.filter((a) => a.isComplete).length, g = `${d} of ${l.length} done`;
|
|
60
60
|
return /* @__PURE__ */ e.createElement("div", {
|
|
61
61
|
className: `${t.gettingStartedWidgetCtn} ${c} getting-started-widget-ctn`
|
|
62
62
|
}, /* @__PURE__ */ e.createElement("div", {
|
|
63
63
|
className: t.header
|
|
64
|
-
},
|
|
64
|
+
}, p && /* @__PURE__ */ e.createElement("button", o({
|
|
65
65
|
type: "button",
|
|
66
66
|
className: t.headerButton,
|
|
67
67
|
"aria-expanded": i,
|
|
@@ -90,7 +90,7 @@ const t = {
|
|
|
90
90
|
className: t.progressCtn
|
|
91
91
|
}, /* @__PURE__ */ e.createElement("progress", {
|
|
92
92
|
className: "sr-only",
|
|
93
|
-
value:
|
|
93
|
+
value: d,
|
|
94
94
|
max: l.length,
|
|
95
95
|
"aria-valuetext": g
|
|
96
96
|
}, g), /* @__PURE__ */ e.createElement("span", {
|
|
@@ -101,8 +101,8 @@ const t = {
|
|
|
101
101
|
"aria-hidden": "true"
|
|
102
102
|
}, l.map((a, w) => /* @__PURE__ */ e.createElement("div", {
|
|
103
103
|
key: a.label,
|
|
104
|
-
className: w <
|
|
105
|
-
})))),
|
|
104
|
+
className: w < d ? t.progressSegmentComplete : t.progressSegment
|
|
105
|
+
})))), p && /* @__PURE__ */ e.createElement(x, {
|
|
106
106
|
name: "chevron",
|
|
107
107
|
className: `${t.chevronIcon} ${i ? "rotate-180" : ""}`
|
|
108
108
|
}))), i && /* @__PURE__ */ e.createElement("div", o({
|
|
@@ -138,7 +138,6 @@ const t = {
|
|
|
138
138
|
}))))));
|
|
139
139
|
};
|
|
140
140
|
export {
|
|
141
|
-
_ as GetStartedWidget
|
|
142
|
-
_ as default
|
|
141
|
+
_ as GetStartedWidget
|
|
143
142
|
};
|
|
144
143
|
//# sourceMappingURL=index43.js.map
|
package/dist/index44.js
CHANGED
|
@@ -7,9 +7,9 @@ import { useStableId as w } from "./index227.js";
|
|
|
7
7
|
/* empty css */
|
|
8
8
|
function f() {
|
|
9
9
|
return f = Object.assign ? Object.assign.bind() : function(i) {
|
|
10
|
-
for (var
|
|
11
|
-
var
|
|
12
|
-
for (var s in
|
|
10
|
+
for (var n = 1; n < arguments.length; n++) {
|
|
11
|
+
var a = arguments[n];
|
|
12
|
+
for (var s in a) ({}).hasOwnProperty.call(a, s) && (i[s] = a[s]);
|
|
13
13
|
}
|
|
14
14
|
return i;
|
|
15
15
|
}, f.apply(null, arguments);
|
|
@@ -36,8 +36,8 @@ const l = {
|
|
|
36
36
|
opacity: 1
|
|
37
37
|
}], I = 1600, O = 952, x = O * 0.6, T = 1550, X = ({
|
|
38
38
|
bannerClassName: i = "",
|
|
39
|
-
title:
|
|
40
|
-
description:
|
|
39
|
+
title: n = "Nicely done, you're a Pro now!",
|
|
40
|
+
description: a = "Get Business Plan which adds unlimited signatures, AI insights and bulk signing.",
|
|
41
41
|
buttonLabel: s = "Upgrade to Business",
|
|
42
42
|
buttonIconProps: k = {
|
|
43
43
|
name: "upload"
|
|
@@ -60,9 +60,9 @@ const l = {
|
|
|
60
60
|
}, []), g(() => {
|
|
61
61
|
u && M((e) => e + 1);
|
|
62
62
|
}, [u]);
|
|
63
|
-
const
|
|
63
|
+
const r = !u || L;
|
|
64
64
|
return g(() => {
|
|
65
|
-
if (
|
|
65
|
+
if (r) {
|
|
66
66
|
p(!0);
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
@@ -71,8 +71,8 @@ const l = {
|
|
|
71
71
|
p(!0), _?.();
|
|
72
72
|
}, T);
|
|
73
73
|
return () => clearTimeout(e);
|
|
74
|
-
}, [E,
|
|
75
|
-
className: `${l.bannerCtn} ${i} upgrade-banner-ctn ${
|
|
74
|
+
}, [E, r]), /* @__PURE__ */ t.createElement("div", f({
|
|
75
|
+
className: `${l.bannerCtn} ${i} upgrade-banner-ctn ${r ? "upgrade-banner-ctn--static" : ""}`,
|
|
76
76
|
"data-automation-id": B
|
|
77
77
|
}, C), /* @__PURE__ */ t.createElement("svg", {
|
|
78
78
|
key: E,
|
|
@@ -85,12 +85,12 @@ const l = {
|
|
|
85
85
|
return /* @__PURE__ */ t.createElement("ellipse", {
|
|
86
86
|
key: e.key,
|
|
87
87
|
className: `upgrade-banner-ring upgrade-banner-ring--${e.key}`,
|
|
88
|
-
cx:
|
|
88
|
+
cx: r ? c : N,
|
|
89
89
|
cy: "42",
|
|
90
90
|
rx: e.rx,
|
|
91
91
|
ry: e.ry,
|
|
92
92
|
opacity: e.opacity
|
|
93
|
-
}, !
|
|
93
|
+
}, !r && /* @__PURE__ */ t.createElement("animate", {
|
|
94
94
|
attributeName: "cx",
|
|
95
95
|
from: N,
|
|
96
96
|
to: c,
|
|
@@ -101,12 +101,12 @@ const l = {
|
|
|
101
101
|
}));
|
|
102
102
|
}), /* @__PURE__ */ t.createElement("ellipse", {
|
|
103
103
|
className: "upgrade-banner-ring upgrade-banner-ring--fill",
|
|
104
|
-
cx:
|
|
104
|
+
cx: r ? x : -1640,
|
|
105
105
|
cy: "42",
|
|
106
106
|
rx: I,
|
|
107
107
|
ry: I,
|
|
108
108
|
opacity: "1"
|
|
109
|
-
}, !
|
|
109
|
+
}, !r && /* @__PURE__ */ t.createElement("animate", {
|
|
110
110
|
attributeName: "cx",
|
|
111
111
|
from: -1640,
|
|
112
112
|
to: x,
|
|
@@ -121,17 +121,17 @@ const l = {
|
|
|
121
121
|
}, /* @__PURE__ */ t.createElement("span", {
|
|
122
122
|
id: b,
|
|
123
123
|
className: "upgrade-banner-title text-[var(--color-white)]"
|
|
124
|
-
},
|
|
124
|
+
}, n), /* @__PURE__ */ t.createElement("span", {
|
|
125
125
|
id: y,
|
|
126
126
|
className: "upgrade-banner-description text-[var(--color-white)]"
|
|
127
|
-
},
|
|
127
|
+
}, a)), /* @__PURE__ */ t.createElement(A, {
|
|
128
128
|
type: "secondary",
|
|
129
129
|
theme: "blue",
|
|
130
130
|
size: "sm",
|
|
131
131
|
label: s,
|
|
132
132
|
iconProps: k,
|
|
133
133
|
onClick: R,
|
|
134
|
-
className: "shrink-0 !gap-[6px] !py-[10px] !px-[20px]"
|
|
134
|
+
className: "shrink-0 !gap-[6px] !py-[10px] !px-[20px] !font-medium"
|
|
135
135
|
})), m && v && /* @__PURE__ */ t.createElement("div", {
|
|
136
136
|
className: l.closeBtn
|
|
137
137
|
}, /* @__PURE__ */ t.createElement(S, {
|
|
@@ -147,7 +147,6 @@ const l = {
|
|
|
147
147
|
}, v ? "Dismiss button available." : ""));
|
|
148
148
|
};
|
|
149
149
|
export {
|
|
150
|
-
X as UpgradeBanner
|
|
151
|
-
X as default
|
|
150
|
+
X as UpgradeBanner
|
|
152
151
|
};
|
|
153
152
|
//# sourceMappingURL=index44.js.map
|
package/dist/index44.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index44.js","sources":["../src/components/UpgradeBanner/index.tsx"],"sourcesContent":["import React, { FC, useState, useEffect } from \"react\";\nimport { Icon, IconProps } from \"../Icon\";\nimport { Button } from \"../Button\";\nimport { Map } from \"../../utils/common.types\";\nimport { getRegionAttributes } from \"../../utils/a11y\";\nimport { useStableId } from \"../../utils/useStableId\";\nimport \"./style.scss\";\n\nexport interface UpgradeBannerProps {\n /** Additional class name applied to the banner container. */\n bannerClassName?: string;\n /** Headline text. */\n title?: string;\n /** Supporting description text below the title. */\n description?: string;\n /** Label for the call-to-action button. */\n buttonLabel?: string;\n /** Icon props for the call-to-action button. */\n buttonIconProps?: IconProps;\n /** Called when the call-to-action button is activated. */\n onButtonClick?: () => void;\n /** Called when the dismiss (close) icon is activated. When omitted, no close icon is rendered. */\n onClose?: () => void;\n /**\n * Pass `true` at the moment the banner should animate in (e.g. when a\n * preceding task list completes) — the animation runs once per\n * `false` -> `true` transition, not on mount. When `false` (default), the\n * banner renders in its fully-settled solid state with no animation.\n */\n playAnimation?: boolean;\n /** Called once the fill animation finishes. */\n onAnimationComplete?: () => void;\n /** Automation ID for testing, applied as data-automation-id on the root element. */\n automationId?: string;\n}\n\nconst className: Map = {\n bannerCtn:\n \"relative overflow-hidden rounded-[8px] bg-[var(--color-white)] flex items-center py-[18px] pl-[20px] pr-[64px] w-full\",\n content: \"relative flex items-center justify-between w-full gap-[24px]\",\n textCtn: \"flex flex-col gap-[4px] items-start\",\n closeBtn: \"absolute top-[12px] right-[12px]\"\n};\n\nconst RING_LAYERS = [\n { key: \"ring-3\", rx: 357, ry: 185.5, opacity: 0.3 },\n { key: \"ring-2\", rx: 306, ry: 159, opacity: 0.5 },\n { key: \"ring-1\", rx: 255, ry: 132.5, opacity: 1 }\n];\n\nconst FILL_RADIUS = 1600;\nconst VIEWBOX_WIDTH = 952;\nconst RIPPLE_REST_CX = VIEWBOX_WIDTH * 0.6;\nconst FILL_ANIMATION_END_MS = 1550;\n\nexport const UpgradeBanner: FC<UpgradeBannerProps> = ({\n bannerClassName = \"\",\n title = \"Nicely done, you're a Pro now!\",\n description = \"Get Business Plan which adds unlimited signatures, AI insights and bulk signing.\",\n buttonLabel = \"Upgrade to Business\",\n buttonIconProps = { name: \"upload\" },\n onButtonClick,\n onClose,\n playAnimation = false,\n onAnimationComplete,\n automationId\n}) => {\n const titleId = useStableId();\n const descriptionId = useStableId();\n const regionAttributes = getRegionAttributes({ titleId, descriptionId });\n\n const [reduceMotion, setReduceMotion] = useState(false);\n const [showCloseButton, setShowCloseButton] = useState(false);\n const [animationRunId, setAnimationRunId] = useState(0);\n\n useEffect(() => {\n const query = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n setReduceMotion(query.matches);\n\n const handleChange = (event: MediaQueryListEvent) => setReduceMotion(event.matches);\n query.addEventListener(\"change\", handleChange);\n return () => query.removeEventListener(\"change\", handleChange);\n }, []);\n\n useEffect(() => {\n if (!playAnimation) {\n return;\n }\n setAnimationRunId((id) => id + 1);\n }, [playAnimation]);\n\n const showStatic = !playAnimation || reduceMotion;\n\n useEffect(() => {\n if (showStatic) {\n setShowCloseButton(true);\n return;\n }\n\n setShowCloseButton(false);\n const timer = setTimeout(() => {\n setShowCloseButton(true);\n onAnimationComplete?.();\n }, FILL_ANIMATION_END_MS);\n return () => clearTimeout(timer);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [animationRunId, showStatic]);\n\n return (\n <div\n className={`${className.bannerCtn} ${bannerClassName} upgrade-banner-ctn ${\n showStatic ? \"upgrade-banner-ctn--static\" : \"\"\n }`}\n data-automation-id={automationId}\n {...regionAttributes}\n >\n <svg\n key={animationRunId}\n className=\"upgrade-banner-rings\"\n viewBox=\"0 0 952 84\"\n preserveAspectRatio=\"xMidYMid slice\"\n aria-hidden=\"true\"\n >\n {RING_LAYERS.map((ring, index) => {\n const restCx = RIPPLE_REST_CX;\n const fromCx = -ring.rx * 0.6;\n return (\n <ellipse\n key={ring.key}\n className={`upgrade-banner-ring upgrade-banner-ring--${ring.key}`}\n cx={showStatic ? restCx : fromCx}\n cy=\"42\"\n rx={ring.rx}\n ry={ring.ry}\n opacity={ring.opacity}\n >\n {!showStatic && (\n <animate\n attributeName=\"cx\"\n from={fromCx}\n to={restCx}\n dur=\"1.1s\"\n begin={`${index * 0.12}s`}\n calcMode=\"linear\"\n fill=\"freeze\"\n />\n )}\n </ellipse>\n );\n })}\n <ellipse\n className=\"upgrade-banner-ring upgrade-banner-ring--fill\"\n cx={showStatic ? RIPPLE_REST_CX : -(FILL_RADIUS + 40)}\n cy=\"42\"\n rx={FILL_RADIUS}\n ry={FILL_RADIUS}\n opacity=\"1\"\n >\n {!showStatic && (\n <animate\n attributeName=\"cx\"\n from={-(FILL_RADIUS + 40)}\n to={RIPPLE_REST_CX}\n dur=\"1.2s\"\n begin=\"0.35s\"\n calcMode=\"linear\"\n fill=\"freeze\"\n />\n )}\n </ellipse>\n </svg>\n\n <div className={className.content}>\n <div className={className.textCtn}>\n <span id={titleId} className=\"upgrade-banner-title text-[var(--color-white)]\">\n {title}\n </span>\n <span id={descriptionId} className=\"upgrade-banner-description text-[var(--color-white)]\">\n {description}\n </span>\n </div>\n <Button\n type=\"secondary\"\n theme=\"blue\"\n size=\"sm\"\n label={buttonLabel}\n iconProps={buttonIconProps}\n onClick={onButtonClick}\n className=\"shrink-0 !gap-[6px] !py-[10px] !px-[20px]\"\n />\n </div>\n\n {onClose && showCloseButton && (\n <div className={className.closeBtn}>\n <Icon name=\"close\" size={16} stroke=\"var(--color-white)\" onClick={onClose} ariaLabel=\"Dismiss\" />\n </div>\n )}\n\n {onClose && (\n <span className=\"sr-only\" role=\"status\" aria-live=\"polite\">\n {showCloseButton ? \"Dismiss button available.\" : \"\"}\n </span>\n )}\n </div>\n );\n};\n\nexport default UpgradeBanner;\n"],"names":["className","bannerCtn","content","textCtn","closeBtn","RING_LAYERS","key","rx","ry","opacity","FILL_RADIUS","VIEWBOX_WIDTH","RIPPLE_REST_CX","FILL_ANIMATION_END_MS","UpgradeBanner","bannerClassName","title","description","buttonLabel","buttonIconProps","name","onButtonClick","onClose","playAnimation","onAnimationComplete","automationId","titleId","useStableId","descriptionId","regionAttributes","getRegionAttributes","reduceMotion","setReduceMotion","useState","showCloseButton","setShowCloseButton","animationRunId","setAnimationRunId","useEffect","query","window","matchMedia","matches","handleChange","event","addEventListener","removeEventListener","id","showStatic","timer","setTimeout","clearTimeout","React","createElement","_extends","viewBox","preserveAspectRatio","map","ring","index","restCx","fromCx","cx","cy","attributeName","from","to","dur","begin","calcMode","fill","Button","type","theme","size","label","iconProps","onClick","Icon","stroke","ariaLabel","role"],"mappings":";;;;;;;;;;;;;;;;AAoCA,MAAMA,IAAiB;AAAA,EACrBC,WACE;AAAA,EACFC,SAAS;AAAA,EACTC,SAAS;AAAA,EACTC,UAAU;AACZ,GAEMC,IAAc,CAClB;AAAA,EAAEC,KAAK;AAAA,EAAUC,IAAI;AAAA,EAAKC,IAAI;AAAA,EAAOC,SAAS;AAAI,GAClD;AAAA,EAAEH,KAAK;AAAA,EAAUC,IAAI;AAAA,EAAKC,IAAI;AAAA,EAAKC,SAAS;AAAI,GAChD;AAAA,EAAEH,KAAK;AAAA,EAAUC,IAAI;AAAA,EAAKC,IAAI;AAAA,EAAOC,SAAS;AAAE,CAAC,GAG7CC,IAAc,MACdC,IAAgB,KAChBC,IAAiBD,IAAgB,KACjCE,IAAwB,MAEjBC,IAAwCA,CAAC;AAAA,EACpDC,iBAAAA,IAAkB;AAAA,EAClBC,OAAAA,IAAQ;AAAA,EACRC,aAAAA,IAAc;AAAA,EACdC,aAAAA,IAAc;AAAA,EACdC,iBAAAA,IAAkB;AAAA,IAAEC,MAAM;AAAA,EAAA;AAAA,EAC1BC,eAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,eAAAA,IAAgB;AAAA,EAChBC,qBAAAA;AAAAA,EACAC,cAAAA;AACF,MAAM;AACJ,QAAMC,IAAUC,EAAAA,GACVC,IAAgBD,EAAAA,GAChBE,IAAmBC,EAAoB;AAAA,IAAEJ,SAAAA;AAAAA,IAASE,eAAAA;AAAAA,EAAA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G,GACNoC,gBAAAA,EAAAC,cAAA,QAAA;AAAA,IAAMN,IAAInB;AAAAA,IAAe5B,WAAU;AAAA,EAAA,GAChCiB,CACG,CACH,GACLmC,gBAAAA,EAAAC,cAACkB,GAAM;AAAA,IACLC,MAAK;AAAA,IACLC,OAAM;AAAA,IACNC,MAAK;AAAA,IACLC,OAAOzD;AAAAA,IACP0D,WAAWzD;AAAAA,IACX0D,SAASxD;AAAAA,IACTrB,WAAU;AAAA,EAAA,CACX,CACE,GAEJsB,KAAWY,KACVkB,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKrD,WAAWA,EAAUI;AAAAA,EAAAA,GACxBgD,gBAAAA,EAAAC,cAACyB,GAAI;AAAA,IAAC1D,MAAK;AAAA,IAAQsD,MAAM;AAAA,IAAIK,QAAO;AAAA,IAAqBF,SAASvD;AAAAA,IAAS0D,WAAU;AAAA,EAAA,CAAW,CAC7F,GAGN1D,KACC8B,gBAAAA,EAAAC,cAAA,QAAA;AAAA,IAAMrD,WAAU;AAAA,IAAUiF,MAAK;AAAA,IAAS,aAAU;AAAA,EAAA,GAC/C/C,IAAkB,8BAA8B,EAC7C,CAEL;AAET;"}
|
|
1
|
+
{"version":3,"file":"index44.js","sources":["../src/components/UpgradeBanner/index.tsx"],"sourcesContent":["import React, { FC, useState, useEffect } from \"react\";\nimport { Icon, IconProps } from \"../Icon\";\nimport { Button } from \"../Button\";\nimport { Map } from \"../../utils/common.types\";\nimport { getRegionAttributes } from \"../../utils/a11y\";\nimport { useStableId } from \"../../utils/useStableId\";\nimport \"./style.scss\";\n\nexport interface UpgradeBannerProps {\n /** Additional class name applied to the banner container. */\n bannerClassName?: string;\n /** Headline text. */\n title?: string;\n /** Supporting description text below the title. */\n description?: string;\n /** Label for the call-to-action button. */\n buttonLabel?: string;\n /** Icon props for the call-to-action button. */\n buttonIconProps?: IconProps;\n /** Called when the call-to-action button is activated. */\n onButtonClick?: () => void;\n /** Called when the dismiss (close) icon is activated. When omitted, no close icon is rendered. */\n onClose?: () => void;\n /**\n * Pass `true` at the moment the banner should animate in (e.g. when a\n * preceding task list completes) — the animation runs once per\n * `false` -> `true` transition, not on mount. When `false` (default), the\n * banner renders in its fully-settled solid state with no animation.\n */\n playAnimation?: boolean;\n /** Called once the fill animation finishes. */\n onAnimationComplete?: () => void;\n /** Automation ID for testing, applied as data-automation-id on the root element. */\n automationId?: string;\n}\n\nconst className: Map = {\n bannerCtn:\n \"relative overflow-hidden rounded-[8px] bg-[var(--color-white)] flex items-center py-[18px] pl-[20px] pr-[64px] w-full\",\n content: \"relative flex items-center justify-between w-full gap-[24px]\",\n textCtn: \"flex flex-col gap-[4px] items-start\",\n closeBtn: \"absolute top-[12px] right-[12px]\"\n};\n\nconst RING_LAYERS = [\n { key: \"ring-3\", rx: 357, ry: 185.5, opacity: 0.3 },\n { key: \"ring-2\", rx: 306, ry: 159, opacity: 0.5 },\n { key: \"ring-1\", rx: 255, ry: 132.5, opacity: 1 }\n];\n\nconst FILL_RADIUS = 1600;\nconst VIEWBOX_WIDTH = 952;\nconst RIPPLE_REST_CX = VIEWBOX_WIDTH * 0.6;\nconst FILL_ANIMATION_END_MS = 1550;\n\nexport const UpgradeBanner: FC<UpgradeBannerProps> = ({\n bannerClassName = \"\",\n title = \"Nicely done, you're a Pro now!\",\n description = \"Get Business Plan which adds unlimited signatures, AI insights and bulk signing.\",\n buttonLabel = \"Upgrade to Business\",\n buttonIconProps = { name: \"upload\" },\n onButtonClick,\n onClose,\n playAnimation = false,\n onAnimationComplete,\n automationId\n}) => {\n const titleId = useStableId();\n const descriptionId = useStableId();\n const regionAttributes = getRegionAttributes({ titleId, descriptionId });\n\n const [reduceMotion, setReduceMotion] = useState(false);\n const [showCloseButton, setShowCloseButton] = useState(false);\n const [animationRunId, setAnimationRunId] = useState(0);\n\n useEffect(() => {\n const query = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n setReduceMotion(query.matches);\n\n const handleChange = (event: MediaQueryListEvent) => setReduceMotion(event.matches);\n query.addEventListener(\"change\", handleChange);\n return () => query.removeEventListener(\"change\", handleChange);\n }, []);\n\n useEffect(() => {\n if (!playAnimation) {\n return;\n }\n setAnimationRunId((id) => id + 1);\n }, [playAnimation]);\n\n const showStatic = !playAnimation || reduceMotion;\n\n useEffect(() => {\n if (showStatic) {\n setShowCloseButton(true);\n return;\n }\n\n setShowCloseButton(false);\n const timer = setTimeout(() => {\n setShowCloseButton(true);\n onAnimationComplete?.();\n }, FILL_ANIMATION_END_MS);\n return () => clearTimeout(timer);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [animationRunId, showStatic]);\n\n return (\n <div\n className={`${className.bannerCtn} ${bannerClassName} upgrade-banner-ctn ${\n showStatic ? \"upgrade-banner-ctn--static\" : \"\"\n }`}\n data-automation-id={automationId}\n {...regionAttributes}\n >\n <svg\n key={animationRunId}\n className=\"upgrade-banner-rings\"\n viewBox=\"0 0 952 84\"\n preserveAspectRatio=\"xMidYMid slice\"\n aria-hidden=\"true\"\n >\n {RING_LAYERS.map((ring, index) => {\n const restCx = RIPPLE_REST_CX;\n const fromCx = -ring.rx * 0.6;\n return (\n <ellipse\n key={ring.key}\n className={`upgrade-banner-ring upgrade-banner-ring--${ring.key}`}\n cx={showStatic ? restCx : fromCx}\n cy=\"42\"\n rx={ring.rx}\n ry={ring.ry}\n opacity={ring.opacity}\n >\n {!showStatic && (\n <animate\n attributeName=\"cx\"\n from={fromCx}\n to={restCx}\n dur=\"1.1s\"\n begin={`${index * 0.12}s`}\n calcMode=\"linear\"\n fill=\"freeze\"\n />\n )}\n </ellipse>\n );\n })}\n <ellipse\n className=\"upgrade-banner-ring upgrade-banner-ring--fill\"\n cx={showStatic ? RIPPLE_REST_CX : -(FILL_RADIUS + 40)}\n cy=\"42\"\n rx={FILL_RADIUS}\n ry={FILL_RADIUS}\n opacity=\"1\"\n >\n {!showStatic && (\n <animate\n attributeName=\"cx\"\n from={-(FILL_RADIUS + 40)}\n to={RIPPLE_REST_CX}\n dur=\"1.2s\"\n begin=\"0.35s\"\n calcMode=\"linear\"\n fill=\"freeze\"\n />\n )}\n </ellipse>\n </svg>\n\n <div className={className.content}>\n <div className={className.textCtn}>\n <span id={titleId} className=\"upgrade-banner-title text-[var(--color-white)]\">\n {title}\n </span>\n <span id={descriptionId} className=\"upgrade-banner-description text-[var(--color-white)]\">\n {description}\n </span>\n </div>\n <Button\n type=\"secondary\"\n theme=\"blue\"\n size=\"sm\"\n label={buttonLabel}\n iconProps={buttonIconProps}\n onClick={onButtonClick}\n className=\"shrink-0 !gap-[6px] !py-[10px] !px-[20px] !font-medium\"\n />\n </div>\n\n {onClose && showCloseButton && (\n <div className={className.closeBtn}>\n <Icon name=\"close\" size={16} stroke=\"var(--color-white)\" onClick={onClose} ariaLabel=\"Dismiss\" />\n </div>\n )}\n\n {onClose && (\n <span className=\"sr-only\" role=\"status\" aria-live=\"polite\">\n {showCloseButton ? \"Dismiss button available.\" : \"\"}\n </span>\n )}\n </div>\n );\n};\n\nexport default UpgradeBanner;\n"],"names":["className","bannerCtn","content","textCtn","closeBtn","RING_LAYERS","key","rx","ry","opacity","FILL_RADIUS","VIEWBOX_WIDTH","RIPPLE_REST_CX","FILL_ANIMATION_END_MS","UpgradeBanner","bannerClassName","title","description","buttonLabel","buttonIconProps","name","onButtonClick","onClose","playAnimation","onAnimationComplete","automationId","titleId","useStableId","descriptionId","regionAttributes","getRegionAttributes","reduceMotion","setReduceMotion","useState","showCloseButton","setShowCloseButton","animationRunId","setAnimationRunId","useEffect","query","window","matchMedia","matches","handleChange","event","addEventListener","removeEventListener","id","showStatic","timer","setTimeout","clearTimeout","React","createElement","_extends","viewBox","preserveAspectRatio","map","ring","index","restCx","fromCx","cx","cy","attributeName","from","to","dur","begin","calcMode","fill","Button","type","theme","size","label","iconProps","onClick","Icon","stroke","ariaLabel","role"],"mappings":";;;;;;;;;;;;;;;;AAoCA,MAAMA,IAAiB;AAAA,EACrBC,WACE;AAAA,EACFC,SAAS;AAAA,EACTC,SAA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,EAAAC,cAACyB,GAAI;AAAA,IAAC1D,MAAK;AAAA,IAAQsD,MAAM;AAAA,IAAIK,QAAO;AAAA,IAAqBF,SAASvD;AAAAA,IAAS0D,WAAU;AAAA,EAAA,CAAW,CAC7F,GAGN1D,KACC8B,gBAAAA,EAAAC,cAAA,QAAA;AAAA,IAAMrD,WAAU;AAAA,IAAUiF,MAAK;AAAA,IAAS,aAAU;AAAA,EAAA,GAC/C/C,IAAkB,8BAA8B,EAC7C,CAEL;AAET;"}
|
package/dist/index45.js
CHANGED
package/dist/index61.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from "react";
|
|
2
2
|
/* empty css */
|
|
3
3
|
const n = ({
|
|
4
4
|
element: e,
|
|
@@ -15,12 +15,12 @@ const n = ({
|
|
|
15
15
|
"--shimmer-base-color": s,
|
|
16
16
|
"--shimmer-highlight-color": m
|
|
17
17
|
}, r = `se-design-shimmer-element se-design-shimmer-${e.type}`;
|
|
18
|
-
return /* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ a.createElement("div", {
|
|
19
19
|
className: r,
|
|
20
20
|
style: i
|
|
21
|
-
}, e.children && e.children.map((
|
|
21
|
+
}, e.children && e.children.map((t, p) => /* @__PURE__ */ a.createElement(n, {
|
|
22
22
|
key: p,
|
|
23
|
-
element:
|
|
23
|
+
element: t,
|
|
24
24
|
animationDuration: d,
|
|
25
25
|
baseColor: s,
|
|
26
26
|
highlightColor: m
|
|
@@ -40,48 +40,48 @@ const n = ({
|
|
|
40
40
|
alignItems: e.alignItems,
|
|
41
41
|
flex: e.flex
|
|
42
42
|
};
|
|
43
|
-
return /* @__PURE__ */
|
|
43
|
+
return /* @__PURE__ */ a.createElement("div", {
|
|
44
44
|
className: `se-design-shimmer-container ${e.className || ""}`,
|
|
45
45
|
style: i
|
|
46
|
-
}, e.children.map((r,
|
|
47
|
-
key:
|
|
46
|
+
}, e.children.map((r, t) => r.type === "container" ? /* @__PURE__ */ a.createElement(y, {
|
|
47
|
+
key: t,
|
|
48
48
|
container: r,
|
|
49
49
|
animationDuration: d,
|
|
50
50
|
baseColor: s,
|
|
51
51
|
highlightColor: m
|
|
52
|
-
}) : /* @__PURE__ */
|
|
53
|
-
key:
|
|
52
|
+
}) : /* @__PURE__ */ a.createElement(n, {
|
|
53
|
+
key: t,
|
|
54
54
|
element: r,
|
|
55
55
|
animationDuration: d,
|
|
56
56
|
baseColor: s,
|
|
57
57
|
highlightColor: m
|
|
58
58
|
})));
|
|
59
|
-
},
|
|
59
|
+
}, g = ({
|
|
60
60
|
structure: e,
|
|
61
61
|
className: d = "",
|
|
62
62
|
animationDuration: s = 3,
|
|
63
63
|
baseColor: m = "var(--color-gray-700)",
|
|
64
64
|
highlightColor: i = "var(--color-gray-600)",
|
|
65
65
|
width: r,
|
|
66
|
-
height:
|
|
66
|
+
height: t
|
|
67
67
|
}) => {
|
|
68
68
|
const p = {
|
|
69
69
|
width: r ? typeof r == "number" ? `${r}px` : r : "100%",
|
|
70
|
-
height:
|
|
70
|
+
height: t ? typeof t == "number" ? `${t}px` : t : "auto",
|
|
71
71
|
"--shimmer-duration": `${s}s`,
|
|
72
72
|
"--shimmer-base-color": m,
|
|
73
73
|
"--shimmer-highlight-color": i
|
|
74
74
|
};
|
|
75
|
-
return /* @__PURE__ */
|
|
75
|
+
return /* @__PURE__ */ a.createElement("div", {
|
|
76
76
|
className: `se-design-shimmer-loader ${d}`,
|
|
77
77
|
style: p
|
|
78
|
-
}, e.map((c, o) => c.type === "container" ? /* @__PURE__ */
|
|
78
|
+
}, e.map((c, o) => c.type === "container" ? /* @__PURE__ */ a.createElement(y, {
|
|
79
79
|
key: o,
|
|
80
80
|
container: c,
|
|
81
81
|
animationDuration: s,
|
|
82
82
|
baseColor: m,
|
|
83
83
|
highlightColor: i
|
|
84
|
-
}) : /* @__PURE__ */
|
|
84
|
+
}) : /* @__PURE__ */ a.createElement(n, {
|
|
85
85
|
key: o,
|
|
86
86
|
element: c,
|
|
87
87
|
animationDuration: s,
|
|
@@ -90,7 +90,6 @@ const n = ({
|
|
|
90
90
|
})));
|
|
91
91
|
};
|
|
92
92
|
export {
|
|
93
|
-
|
|
94
|
-
l as default
|
|
93
|
+
g as ShimmerLoader
|
|
95
94
|
};
|
|
96
95
|
//# sourceMappingURL=index61.js.map
|