se-design 1.1.0 → 1.1.1-dev-01
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/components/GetStartedWidget/index.d.ts +6 -0
- package/dist/index225.js.map +1 -1
- package/dist/index229.js +3 -3
- package/dist/index229.js.map +1 -1
- package/dist/index33.js +12 -11
- package/dist/index33.js.map +1 -1
- package/dist/index43.js +57 -49
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +31 -30
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +2 -1
- package/dist/index61.js +17 -16
- package/dist/index7.js +8 -7
- package/dist/index71.js +2 -1
- 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 ? 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,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,IAAO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cAAciD,GAAU,IAAI,CAAC;AAAA,EAClL,GACOrC;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 ? 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,IAA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AAA,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]}
|
package/dist/index229.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const f = /* @__PURE__ */
|
|
1
|
+
import { createContext as u, useRef as o, useCallback as s, useContext as c, useEffect as a } from "react";
|
|
2
|
+
const f = /* @__PURE__ */ u(null);
|
|
3
3
|
function l() {
|
|
4
4
|
const r = o(/* @__PURE__ */ new Set()), t = o([]);
|
|
5
5
|
return {
|
|
6
|
-
register:
|
|
6
|
+
register: s((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":["createContext","useRef","useCallback","useContext","useEffect","FocusTrapPortalContext","useFocusTrapPortalRegistry","portalRefsSet","Set","portalContainerRefs","register","ref","current","add","Array","from","delete","useRegisterPortalWithFocusTrap","portalRef","isActive"],"mappings":"AAUO,SAAA,iBAAAA,GAAA,UAAAC,GAAA,eAAAC,GAAA,cAAAC,GAAA,aAAAC,SAAA;AAAA,MAAMC,sBAA8D,IAAI;AAaxE,SAASC,IAA6B;AAC3C,QAAMC,IAAgBN,EAAiD,oBAAIO,KAAK,GAC1EC,IAAsBR,EAA8C,EAAE;AAW5E,SAAO;AAAA,IAAES,UATwBR,EAAaS,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 d } 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: g = "",
|
|
25
25
|
widgetType: a = "general",
|
|
26
26
|
widgetTitle: r = "",
|
|
27
27
|
widgetDescription: l = "",
|
|
28
28
|
widgetImage: p,
|
|
29
|
-
hasImage:
|
|
29
|
+
hasImage: f = !1,
|
|
30
30
|
hasButtonCta: n = !1,
|
|
31
31
|
hasLinkCta: i = !1,
|
|
32
32
|
ctaText: o = "",
|
|
33
|
-
hasBadge:
|
|
33
|
+
hasBadge: x = !1,
|
|
34
34
|
badgeText: w = "",
|
|
35
35
|
buttonBgColor: u = "secondary",
|
|
36
36
|
onCtaClick: b,
|
|
@@ -38,11 +38,11 @@ const t = {
|
|
|
38
38
|
webinarDateInfo: c,
|
|
39
39
|
webinarSpeaker: s
|
|
40
40
|
}) => {
|
|
41
|
-
const E =
|
|
41
|
+
const E = x && /* @__PURE__ */ e.createElement(I, {
|
|
42
42
|
label: w,
|
|
43
43
|
className: t.widgetBadge,
|
|
44
44
|
bgColor: "var(--color-yellow-50)",
|
|
45
|
-
textColor: "var(--color-yellow-
|
|
45
|
+
textColor: "var(--color-yellow-800)",
|
|
46
46
|
fontWeight: "normal"
|
|
47
47
|
}), m = (i || n) && /* @__PURE__ */ e.createElement(e.Fragment, null, i && /* @__PURE__ */ e.createElement("span", {
|
|
48
48
|
className: t.widgetLinkCta
|
|
@@ -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 = f && /* @__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} ${g} 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(d, {
|
|
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(d, {
|
|
82
82
|
name: "clock",
|
|
83
83
|
className: "relative top-[2px]"
|
|
84
84
|
}), /* @__PURE__ */ e.createElement("span", {
|
|
@@ -96,6 +96,7 @@ const t = {
|
|
|
96
96
|
}, l), m)) : m));
|
|
97
97
|
};
|
|
98
98
|
export {
|
|
99
|
-
B as Widget
|
|
99
|
+
B as Widget,
|
|
100
|
+
B as default
|
|
100
101
|
};
|
|
101
102
|
//# sourceMappingURL=index33.js.map
|
package/dist/index33.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index33.js","sources":["../src/components/Widget/index.tsx"],"sourcesContent":["import React, { FC } from \"react\";\nimport { Map } from \"../../utils/common.types\";\nimport { Button } from \"../Button\";\nimport { Badge } from \"../Badge\";\nimport { Icon } from \"../Icon\";\nimport \"./style.scss\";\n\nexport interface WidgetProps {\n widgetClassName?: string;\n widgetType?: \"promotion\" | \"webinar\" | \"request-feature\" | \"general\";\n widgetTitle?: string;\n hasBadge?: boolean;\n webinarSpeaker?: string;\n badgeText?: string;\n widgetDescription?: string;\n webinarDateInfo?: string;\n hasImage?: boolean;\n widgetImage?: string;\n hasButtonCta?: boolean;\n buttonBgColor?: 'primary' | 'secondary';\n hasLinkCta?: boolean;\n ctaText?: string;\n onCtaClick?: () => void;\n onWidgetClick?: () => void;\n}\n\nconst className: Map = {\n widgetCtn: 'flex flex-col gap-[2px] align-center border border-[var(--color-gray-200)] rounded-[12px] w-[385px]',\n widgetImageCtn: 'cursor-pointer',\n descriptionCtn: 'p-4 flex flex-col',\n widgetTitle: 'text-[var(--color-gray-900)] mt-[4px] mb-[8px]',\n widgetDescription: 'text-[var(--color-gray-700)] mb-[4px]',\n widgetLinkCta: 'text-[var(--color-blue-500)] cursor-pointer hover:text-[var(--color-blue-600)]',\n widgetButtonCta: 'self-start',\n widgetBadge: 'w-fit',\n webinarInfoCtn: 'flex flex-col gap-2',\n webinarSpeaker: 'text-[var(--color-gray-700)]',\n webinarDate: 'text-[var(--color-gray-700)]',\n webinarDescriptionInfo: 'flex gap-2',\n webinarTimeInfo: 'flex gap-2',\n requestFeatureCtn: 'flex gap-[12px]',\n requestFeatureImageCtn: 'w-[48px] h-[48px] border border-[var(--color-gray-200)] rounded-[50%] flex items-center flex-shrink-0 bg-[var(--color-red-50)]',\n requestFeatureDescriptionCtn: 'flex flex-col',\n};\n\nexport const Widget: FC<WidgetProps> = ({\n widgetClassName = \"\",\n widgetType = 'general',\n widgetTitle = \"\",\n widgetDescription = \"\",\n widgetImage,\n hasImage = false,\n hasButtonCta = false,\n hasLinkCta = false,\n ctaText = \"\",\n hasBadge = false,\n badgeText = \"\",\n buttonBgColor = 'secondary',\n onCtaClick,\n onWidgetClick,\n webinarDateInfo,\n webinarSpeaker,\n}) => {\n\n const renderBadge = hasBadge && (\n <Badge\n label={badgeText}\n className={className.widgetBadge}\n bgColor=\"var(--color-yellow-50)\"\n textColor=\"var(--color-yellow-
|
|
1
|
+
{"version":3,"file":"index33.js","sources":["../src/components/Widget/index.tsx"],"sourcesContent":["import React, { FC } from \"react\";\nimport { Map } from \"../../utils/common.types\";\nimport { Button } from \"../Button\";\nimport { Badge } from \"../Badge\";\nimport { Icon } from \"../Icon\";\nimport \"./style.scss\";\n\nexport interface WidgetProps {\n widgetClassName?: string;\n widgetType?: \"promotion\" | \"webinar\" | \"request-feature\" | \"general\";\n widgetTitle?: string;\n hasBadge?: boolean;\n webinarSpeaker?: string;\n badgeText?: string;\n widgetDescription?: string;\n webinarDateInfo?: string;\n hasImage?: boolean;\n widgetImage?: string;\n hasButtonCta?: boolean;\n buttonBgColor?: 'primary' | 'secondary';\n hasLinkCta?: boolean;\n ctaText?: string;\n onCtaClick?: () => void;\n onWidgetClick?: () => void;\n}\n\nconst className: Map = {\n widgetCtn: 'flex flex-col gap-[2px] align-center border border-[var(--color-gray-200)] rounded-[12px] w-[385px]',\n widgetImageCtn: 'cursor-pointer',\n descriptionCtn: 'p-4 flex flex-col',\n widgetTitle: 'text-[var(--color-gray-900)] mt-[4px] mb-[8px]',\n widgetDescription: 'text-[var(--color-gray-700)] mb-[4px]',\n widgetLinkCta: 'text-[var(--color-blue-500)] cursor-pointer hover:text-[var(--color-blue-600)]',\n widgetButtonCta: 'self-start',\n widgetBadge: 'w-fit',\n webinarInfoCtn: 'flex flex-col gap-2',\n webinarSpeaker: 'text-[var(--color-gray-700)]',\n webinarDate: 'text-[var(--color-gray-700)]',\n webinarDescriptionInfo: 'flex gap-2',\n webinarTimeInfo: 'flex gap-2',\n requestFeatureCtn: 'flex gap-[12px]',\n requestFeatureImageCtn: 'w-[48px] h-[48px] border border-[var(--color-gray-200)] rounded-[50%] flex items-center flex-shrink-0 bg-[var(--color-red-50)]',\n requestFeatureDescriptionCtn: 'flex flex-col',\n};\n\nexport const Widget: FC<WidgetProps> = ({\n widgetClassName = \"\",\n widgetType = 'general',\n widgetTitle = \"\",\n widgetDescription = \"\",\n widgetImage,\n hasImage = false,\n hasButtonCta = false,\n hasLinkCta = false,\n ctaText = \"\",\n hasBadge = false,\n badgeText = \"\",\n buttonBgColor = 'secondary',\n onCtaClick,\n onWidgetClick,\n webinarDateInfo,\n webinarSpeaker,\n}) => {\n\n const renderBadge = hasBadge && (\n <Badge\n label={badgeText}\n className={className.widgetBadge}\n bgColor=\"var(--color-yellow-50)\"\n textColor=\"var(--color-yellow-800)\"\n fontWeight=\"normal\"\n />\n );\n\n const renderCTA = (hasLinkCta || hasButtonCta) && (\n <React.Fragment>\n {hasLinkCta && <span className={className.widgetLinkCta}>{ctaText}</span>}\n {hasButtonCta && <Button type={buttonBgColor} size=\"md\" label={ctaText} className={`${className.widgetButtonCta} mt-[4px]`} onClick={onCtaClick} />}\n </React.Fragment>\n );\n\n const renderImage = hasImage && (\n <div className={`${className.widgetImageCtn} widget-image-ctn`}>\n <img src={widgetImage} alt=\"widget-image\"/>\n </div>\n );\n\n return (\n <div className={`${className.widgetCtn} ${widgetClassName} widget-ctn`} onClick={onWidgetClick}>\n {widgetType !== \"general\" && renderImage}\n <div className={className.descriptionCtn}>\n {widgetType !== \"general\" && renderBadge}\n {widgetType !== \"request-feature\" && <span className={`${className.widgetTitle} widget-title`}>{widgetTitle}</span>}\n\n {([\"promotion\", \"general\"].includes(widgetType)) && (\n <span className={`${className.widgetDescription} widget-description`}>{widgetDescription}</span>\n )}\n\n {widgetType === \"webinar\" && (\n <div className={className.webinarInfoCtn}>\n {webinarSpeaker && (\n <div className={`${className.webinarDescriptionInfo} align-baseline`}>\n <Icon name=\"people\" className=\"relative top-[2px]\" />\n <span className={className.webinarSpeaker}>{webinarSpeaker}</span>\n </div>\n )}\n {webinarDateInfo && (\n <div className={`${className.webinarTimeInfo} align-baseline mb-[4px]`}>\n <Icon name=\"clock\" className=\"relative top-[2px]\" />\n <span className={className.webinarDate}>{webinarDateInfo}</span>\n </div>\n )}\n </div>\n )}\n\n {widgetType === \"request-feature\" ? (\n <div className={className.requestFeatureCtn}>\n <div className={className.requestFeatureImageCtn} />\n <div className={className.requestFeatureDescriptionCtn}>\n <span className={`${className.widgetTitle} widget-title`}>{widgetTitle}</span>\n <span className={`${className.widgetDescription} widget-description`}>{widgetDescription}</span>\n {renderCTA}\n </div>\n </div>\n ) : (\n renderCTA\n )}\n </div>\n </div>\n );\n};\n\nexport default Widget;"],"names":["React__default","Button","Badge","Icon","className","widgetCtn","widgetImageCtn","descriptionCtn","widgetTitle","widgetDescription","widgetLinkCta","widgetButtonCta","widgetBadge","webinarInfoCtn","webinarSpeaker","webinarDate","webinarDescriptionInfo","webinarTimeInfo","requestFeatureCtn","requestFeatureImageCtn","requestFeatureDescriptionCtn","Widget","widgetClassName","widgetType","widgetImage","hasImage","hasButtonCta","hasLinkCta","ctaText","hasBadge","badgeText","buttonBgColor","onCtaClick","onWidgetClick","webinarDateInfo","renderBadge","React","createElement","label","bgColor","textColor","fontWeight","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A,IAAS/C,WAAU;AAAA,EAAA,CAAsB,GACpDgC,gBAAAA,EAAAC,cAAA,QAAA;AAAA,IAAMjC,WAAWA,EAAUU;AAAAA,EAAAA,GAAiBA,CAAqB,CAC9D,GAEJoB,KACEE,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKjC,WAAW,GAAGA,EAAUa,eAAe;AAAA,EAAA,GAC3CmB,gBAAAA,EAAAC,cAAClC,GAAI;AAAA,IAACgD,MAAK;AAAA,IAAQ/C,WAAU;AAAA,EAAA,CAAsB,GACnDgC,gBAAAA,EAAAC,cAAA,QAAA;AAAA,IAAMjC,WAAWA,EAAUW;AAAAA,EAAAA,GAAcmB,CAAsB,CAC5D,CAEJ,GAGNX,MAAe,oBACda,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKjC,WAAWA,EAAUc;AAAAA,EAAAA,GACxBkB,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKjC,WAAWA,EAAUe;AAAAA,EAAAA,CAAyB,GACnDiB,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKjC,WAAWA,EAAUgB;AAAAA,EAAAA,GACxBgB,gBAAAA,EAAAC,cAAA,QAAA;AAAA,IAAMjC,WAAW,GAAGA,EAAUI,WAAW;AAAA,EAAA,GAAkBA,CAAkB,GAC7E4B,gBAAAA,EAAAC,cAAA,QAAA;AAAA,IAAMjC,WAAW,GAAGA,EAAUK,iBAAiB;AAAA,EAAA,GAAwBA,CAAwB,GAC9FiC,CACE,CACF,IAELA,CAEC,CACF;AAET;"}
|
package/dist/index43.js
CHANGED
|
@@ -1,68 +1,73 @@
|
|
|
1
|
-
import e, { useState as
|
|
2
|
-
import { Icon as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { getRegionAttributes as
|
|
5
|
-
import { useAccessiblePress as
|
|
1
|
+
import e, { useState as I } from "react";
|
|
2
|
+
import { Icon as x } from "./index6.js";
|
|
3
|
+
import { Button as S } from "./index4.js";
|
|
4
|
+
import { getRegionAttributes as k } from "./index72.js";
|
|
5
|
+
import { useAccessiblePress as L } from "./index73.js";
|
|
6
6
|
import "./index78.js";
|
|
7
7
|
import { useStableId as $ } from "./index227.js";
|
|
8
8
|
/* empty css */
|
|
9
|
-
function
|
|
10
|
-
return
|
|
9
|
+
function o() {
|
|
10
|
+
return o = Object.assign ? Object.assign.bind() : function(c) {
|
|
11
11
|
for (var r = 1; r < arguments.length; r++) {
|
|
12
12
|
var n = arguments[r];
|
|
13
13
|
for (var s in n) ({}).hasOwnProperty.call(n, s) && (c[s] = n[s]);
|
|
14
14
|
}
|
|
15
15
|
return c;
|
|
16
|
-
},
|
|
16
|
+
}, o.apply(null, arguments);
|
|
17
17
|
}
|
|
18
18
|
const t = {
|
|
19
|
-
gettingStartedWidgetCtn: "border border-[var(--color-gray-200)] rounded-[8px] w-full bg-[var(--color-white)]",
|
|
19
|
+
gettingStartedWidgetCtn: "border border-[var(--color-gray-200)] rounded-[8px] w-full bg-[var(--color-white)] flex flex-col gap-[12px] py-[16px]",
|
|
20
20
|
header: "relative flex items-center justify-between gap-[24px] px-[16px]",
|
|
21
21
|
headerButton: "absolute inset-0 w-full h-full bg-transparent border-none cursor-pointer focus-outline",
|
|
22
22
|
headerLeft: "m-0 font-normal min-w-0 flex-1 flex items-center gap-[16px] pointer-events-none",
|
|
23
23
|
headerIconCtn: "relative shrink-0 size-[48px] rounded-full flex items-center justify-center",
|
|
24
24
|
headerTextCtn: "flex flex-col gap-[4px] items-start min-w-0",
|
|
25
25
|
headerRight: "flex items-center gap-[24px] shrink-0 pointer-events-none",
|
|
26
|
-
progressCtn: "flex flex-col gap-[8px] items-end justify-center",
|
|
26
|
+
progressCtn: "flex flex-col gap-[8px] items-end justify-center py-[8px]",
|
|
27
27
|
progressSegmentsCtn: "flex gap-[6px] items-start w-[100px]",
|
|
28
28
|
progressSegment: "flex-1 h-[4px] rounded-[10px] bg-[var(--color-gray-600)]",
|
|
29
29
|
progressSegmentComplete: "flex-1 h-[4px] rounded-[10px] bg-[var(--color-green-500)]",
|
|
30
30
|
chevronIcon: "transition-transform duration-300",
|
|
31
31
|
divider: "h-px w-full bg-[var(--color-gray-200)]",
|
|
32
|
-
|
|
32
|
+
content: "flex flex-col gap-[12px]",
|
|
33
|
+
actionItemCtn: "flex items-center justify-between px-[16px]",
|
|
33
34
|
actionItemLeft: "flex items-center gap-[12px]",
|
|
34
35
|
actionItemTextCtn: "flex flex-col gap-[2px] items-start"
|
|
35
|
-
},
|
|
36
|
+
}, _ = ({
|
|
36
37
|
widgetClassName: c = "",
|
|
37
38
|
title: r = "Get started",
|
|
38
39
|
description: n = "Master the basics of Signeasy. This section goes away on its own once you're done.",
|
|
39
40
|
headerIconProps: s = {
|
|
40
41
|
name: "magicpen"
|
|
41
42
|
},
|
|
42
|
-
defaultExpanded:
|
|
43
|
-
isExpanded:
|
|
44
|
-
onToggle:
|
|
45
|
-
|
|
43
|
+
defaultExpanded: h = !0,
|
|
44
|
+
isExpanded: f,
|
|
45
|
+
onToggle: b,
|
|
46
|
+
isAccordion: d = !0,
|
|
47
|
+
actionItems: l = []
|
|
46
48
|
}) => {
|
|
47
|
-
const [
|
|
48
|
-
|
|
49
|
+
const [E, y] = I(h), u = f !== void 0;
|
|
50
|
+
let i = u ? f : E;
|
|
51
|
+
d || (i = !0);
|
|
52
|
+
const m = $(void 0, "get-started-widget"), v = `${m}-content`, C = () => {
|
|
53
|
+
u || y((a) => !a), b?.();
|
|
49
54
|
}, {
|
|
50
|
-
pressProps:
|
|
51
|
-
} =
|
|
55
|
+
pressProps: N
|
|
56
|
+
} = L({
|
|
52
57
|
isNative: !0,
|
|
53
|
-
onClick:
|
|
54
|
-
}),
|
|
58
|
+
onClick: C
|
|
59
|
+
}), p = l.filter((a) => a.isComplete).length, g = `${p} of ${l.length} done`;
|
|
55
60
|
return /* @__PURE__ */ e.createElement("div", {
|
|
56
61
|
className: `${t.gettingStartedWidgetCtn} ${c} getting-started-widget-ctn`
|
|
57
62
|
}, /* @__PURE__ */ e.createElement("div", {
|
|
58
|
-
className:
|
|
59
|
-
}, /* @__PURE__ */ e.createElement("button",
|
|
63
|
+
className: t.header
|
|
64
|
+
}, d && /* @__PURE__ */ e.createElement("button", o({
|
|
60
65
|
type: "button",
|
|
61
66
|
className: t.headerButton,
|
|
62
|
-
"aria-expanded":
|
|
63
|
-
"aria-controls":
|
|
64
|
-
"aria-labelledby":
|
|
65
|
-
},
|
|
67
|
+
"aria-expanded": i,
|
|
68
|
+
"aria-controls": v,
|
|
69
|
+
"aria-labelledby": m
|
|
70
|
+
}, N)), /* @__PURE__ */ e.createElement("h3", {
|
|
66
71
|
className: t.headerLeft
|
|
67
72
|
}, /* @__PURE__ */ e.createElement("span", {
|
|
68
73
|
className: t.headerIconCtn,
|
|
@@ -70,12 +75,12 @@ const t = {
|
|
|
70
75
|
backgroundColor: "#ffdcda"
|
|
71
76
|
},
|
|
72
77
|
"aria-hidden": "true"
|
|
73
|
-
}, /* @__PURE__ */ e.createElement(
|
|
78
|
+
}, /* @__PURE__ */ e.createElement(x, o({}, s, {
|
|
74
79
|
stroke: "#7d4644"
|
|
75
80
|
}))), /* @__PURE__ */ e.createElement("span", {
|
|
76
81
|
className: t.headerTextCtn
|
|
77
82
|
}, /* @__PURE__ */ e.createElement("span", {
|
|
78
|
-
id:
|
|
83
|
+
id: m,
|
|
79
84
|
className: "title text-[var(--color-gray-900)]"
|
|
80
85
|
}, r), /* @__PURE__ */ e.createElement("span", {
|
|
81
86
|
className: "description text-[var(--color-gray-700)]"
|
|
@@ -83,27 +88,29 @@ const t = {
|
|
|
83
88
|
className: t.headerRight
|
|
84
89
|
}, /* @__PURE__ */ e.createElement("div", {
|
|
85
90
|
className: t.progressCtn
|
|
86
|
-
}, /* @__PURE__ */ e.createElement("
|
|
91
|
+
}, /* @__PURE__ */ e.createElement("progress", {
|
|
92
|
+
className: "sr-only",
|
|
93
|
+
value: p,
|
|
94
|
+
max: l.length,
|
|
95
|
+
"aria-valuetext": g
|
|
96
|
+
}, g), /* @__PURE__ */ e.createElement("span", {
|
|
87
97
|
className: "steps-count text-[var(--color-gray-700)]",
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
"aria-valuemin": 0,
|
|
91
|
-
"aria-valuemax": o.length,
|
|
92
|
-
"aria-valuetext": f
|
|
93
|
-
}, f), /* @__PURE__ */ e.createElement("div", {
|
|
98
|
+
"aria-hidden": "true"
|
|
99
|
+
}, g), /* @__PURE__ */ e.createElement("div", {
|
|
94
100
|
className: t.progressSegmentsCtn,
|
|
95
101
|
"aria-hidden": "true"
|
|
96
|
-
},
|
|
102
|
+
}, l.map((a, w) => /* @__PURE__ */ e.createElement("div", {
|
|
97
103
|
key: a.label,
|
|
98
|
-
className:
|
|
99
|
-
})))), /* @__PURE__ */ e.createElement(
|
|
104
|
+
className: w < p ? t.progressSegmentComplete : t.progressSegment
|
|
105
|
+
})))), d && /* @__PURE__ */ e.createElement(x, {
|
|
100
106
|
name: "chevron",
|
|
101
|
-
className: `${t.chevronIcon} ${
|
|
102
|
-
}))),
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
+
className: `${t.chevronIcon} ${i ? "rotate-180" : ""}`
|
|
108
|
+
}))), i && /* @__PURE__ */ e.createElement("div", o({
|
|
109
|
+
className: t.content,
|
|
110
|
+
id: v
|
|
111
|
+
}, k({
|
|
112
|
+
titleId: m
|
|
113
|
+
})), l.map((a) => /* @__PURE__ */ e.createElement(e.Fragment, {
|
|
107
114
|
key: a.label
|
|
108
115
|
}, /* @__PURE__ */ e.createElement("div", {
|
|
109
116
|
className: t.divider
|
|
@@ -111,7 +118,7 @@ const t = {
|
|
|
111
118
|
className: t.actionItemCtn
|
|
112
119
|
}, /* @__PURE__ */ e.createElement("div", {
|
|
113
120
|
className: t.actionItemLeft
|
|
114
|
-
}, /* @__PURE__ */ e.createElement(
|
|
121
|
+
}, /* @__PURE__ */ e.createElement(x, {
|
|
115
122
|
name: "checked-circle",
|
|
116
123
|
size: 18,
|
|
117
124
|
stroke: a.isComplete ? "var(--color-green-500)" : "var(--color-gray-600)"
|
|
@@ -121,7 +128,7 @@ const t = {
|
|
|
121
128
|
className: "action-item-label text-[var(--color-gray-900)]"
|
|
122
129
|
}, a.label), a.description && /* @__PURE__ */ e.createElement("span", {
|
|
123
130
|
className: "action-item-description text-[var(--color-gray-700)]"
|
|
124
|
-
}, a.description))), a.buttonLabel && /* @__PURE__ */ e.createElement(
|
|
131
|
+
}, a.description))), a.buttonLabel && /* @__PURE__ */ e.createElement(S, {
|
|
125
132
|
type: "secondary",
|
|
126
133
|
theme: "blue",
|
|
127
134
|
size: "sm",
|
|
@@ -131,6 +138,7 @@ const t = {
|
|
|
131
138
|
}))))));
|
|
132
139
|
};
|
|
133
140
|
export {
|
|
134
|
-
|
|
141
|
+
_ as GetStartedWidget,
|
|
142
|
+
_ as default
|
|
135
143
|
};
|
|
136
144
|
//# sourceMappingURL=index43.js.map
|
package/dist/index43.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index43.js","sources":["../src/components/GetStartedWidget/index.tsx"],"sourcesContent":["import React, { FC, useState } from \"react\";\nimport { Icon, IconProps } from \"../Icon\";\nimport { Button } from \"../Button\";\nimport { Map } from \"../../utils/common.types\";\nimport { useAccessiblePress, getRegionAttributes } from \"../../utils/a11y\";\nimport { useStableId } from \"../../utils/useStableId\";\nimport \"./style.scss\";\n\nexport interface GetStartedWidgetActionItem {\n label: string;\n description?: string;\n isComplete?: boolean;\n buttonLabel?: string;\n buttonIconProps?: IconProps;\n handleActionItemClick: () => void;\n}\n\nexport interface GetStartedWidgetProps {\n widgetClassName?: string;\n title?: string;\n description?: string;\n headerIconProps?: IconProps;\n /**\n * Initial expanded state when the widget is uncontrolled (default behavior).\n * Ignored once `isExpanded` is provided.\n */\n defaultExpanded?: boolean;\n /**\n * Controls expanded state externally. When provided, the widget becomes\n * controlled — you must also provide `onToggle` to update it.\n */\n isExpanded?: boolean;\n /**\n * Called when the toggle chevron is activated. Required to update state\n * when `isExpanded` is controlled; optional otherwise (e.g. for analytics).\n */\n onToggle?: () => void;\n actionItems: GetStartedWidgetActionItem[];\n}\n\nconst className: Map = {\n gettingStartedWidgetCtn: \"border border-[var(--color-gray-200)] rounded-[8px] w-full bg-[var(--color-white)]\",\n header: \"relative flex items-center justify-between gap-[24px] px-[16px]\",\n headerButton: \"absolute inset-0 w-full h-full bg-transparent border-none cursor-pointer focus-outline\",\n headerLeft: \"m-0 font-normal min-w-0 flex-1 flex items-center gap-[16px] pointer-events-none\",\n headerIconCtn: \"relative shrink-0 size-[48px] rounded-full flex items-center justify-center\",\n headerTextCtn: \"flex flex-col gap-[4px] items-start min-w-0\",\n headerRight: \"flex items-center gap-[24px] shrink-0 pointer-events-none\",\n progressCtn: \"flex flex-col gap-[8px] items-end justify-center\",\n progressSegmentsCtn: \"flex gap-[6px] items-start w-[100px]\",\n progressSegment: \"flex-1 h-[4px] rounded-[10px] bg-[var(--color-gray-600)]\",\n progressSegmentComplete: \"flex-1 h-[4px] rounded-[10px] bg-[var(--color-green-500)]\",\n chevronIcon: \"transition-transform duration-300\",\n divider: \"h-px w-full bg-[var(--color-gray-200)]\",\n actionItemCtn: \"flex items-center justify-between px-[16px] py-[16px]\",\n actionItemLeft: \"flex items-center gap-[12px]\",\n actionItemTextCtn: \"flex flex-col gap-[2px] items-start\"\n};\n\nexport const GetStartedWidget: FC<GetStartedWidgetProps> = ({\n widgetClassName = \"\",\n title = \"Get started\",\n description = \"Master the basics of Signeasy. This section goes away on its own once you're done.\",\n headerIconProps = { name: \"magicpen\" },\n defaultExpanded = true,\n isExpanded: isExpandedProp,\n onToggle,\n actionItems = []\n}) => {\n const [internalExpanded, setInternalExpanded] = useState(defaultExpanded);\n const isControlled = isExpandedProp !== undefined;\n const isExpanded = isControlled ? isExpandedProp : internalExpanded;\n\n const titleId = useStableId(undefined, \"get-started-widget\");\n const contentId = `${titleId}-content`;\n\n const handleToggle = () => {\n if (!isControlled) {\n setInternalExpanded((prev) => !prev);\n }\n onToggle?.();\n };\n\n const { pressProps } = useAccessiblePress({\n isNative: true,\n onClick: handleToggle\n });\n\n const completedCount = actionItems.filter((item) => item.isComplete).length;\n const progressLabel = `${completedCount} of ${actionItems.length} done`;\n\n return (\n <div className={`${className.gettingStartedWidgetCtn} ${widgetClassName} getting-started-widget-ctn`}>\n <div className={`${className.header} py-[16px]`}>\n <button\n type=\"button\"\n className={className.headerButton}\n aria-expanded={isExpanded}\n aria-controls={contentId}\n aria-labelledby={titleId}\n {...pressProps}\n />\n <h3 className={className.headerLeft}>\n <span className={className.headerIconCtn} style={{ backgroundColor: \"#ffdcda\" }} aria-hidden=\"true\">\n <Icon {...headerIconProps} stroke=\"#7d4644\" />\n </span>\n <span className={className.headerTextCtn}>\n <span id={titleId} className=\"title text-[var(--color-gray-900)]\">\n {title}\n </span>\n <span className=\"description text-[var(--color-gray-700)]\">{description}</span>\n </span>\n </h3>\n <div className={className.headerRight}>\n <div className={className.progressCtn}>\n <span\n className=\"steps-count text-[var(--color-gray-700)]\"\n role=\"progressbar\"\n aria-valuenow={completedCount}\n aria-valuemin={0}\n aria-valuemax={actionItems.length}\n aria-valuetext={progressLabel}\n >\n {progressLabel}\n </span>\n <div className={className.progressSegmentsCtn} aria-hidden=\"true\">\n {actionItems.map((item, index) => (\n <div\n key={item.label}\n className={index < completedCount ? className.progressSegmentComplete : className.progressSegment}\n />\n ))}\n </div>\n </div>\n <Icon name=\"chevron\" className={`${className.chevronIcon} ${isExpanded ? \"rotate-180\" : \"\"}`} />\n </div>\n </div>\n {isExpanded && (\n <div id={contentId} {...getRegionAttributes({ titleId })}>\n {actionItems.map((item) => (\n <React.Fragment key={item.label}>\n <div className={className.divider} />\n <div className={className.actionItemCtn}>\n <div className={className.actionItemLeft}>\n <Icon\n name=\"checked-circle\"\n size={18}\n stroke={item.isComplete ? \"var(--color-green-500)\" : \"var(--color-gray-600)\"}\n />\n <div className={className.actionItemTextCtn}>\n <span className=\"action-item-label text-[var(--color-gray-900)]\">{item.label}</span>\n {item.description && (\n <span className=\"action-item-description text-[var(--color-gray-700)]\">\n {item.description}\n </span>\n )}\n </div>\n </div>\n {item.buttonLabel && (\n <Button\n type=\"secondary\"\n theme=\"blue\"\n size=\"sm\"\n label={item.buttonLabel}\n iconProps={item.buttonIconProps}\n onClick={item.handleActionItemClick}\n />\n )}\n </div>\n </React.Fragment>\n ))}\n </div>\n )}\n </div>\n );\n};\n\nexport default GetStartedWidget;\n"],"names":["className","gettingStartedWidgetCtn","header","headerButton","headerLeft","headerIconCtn","headerTextCtn","headerRight","progressCtn","progressSegmentsCtn","progressSegment","progressSegmentComplete","chevronIcon","divider","actionItemCtn","actionItemLeft","actionItemTextCtn","GetStartedWidget","widgetClassName","title","description","headerIconProps","name","defaultExpanded","isExpanded","isExpandedProp","onToggle","actionItems","internalExpanded","setInternalExpanded","useState","isControlled","undefined","titleId","useStableId","contentId","handleToggle","prev","pressProps","useAccessiblePress","isNative","onClick","completedCount","filter","item","isComplete","length","progressLabel","React","createElement","_extends","type","style","backgroundColor","Icon","stroke","id","role","map","index","key","label","getRegionAttributes","Fragment","size","buttonLabel","Button","theme","iconProps","buttonIconProps","handleActionItemClick"],"mappings":";;;;;;;;;;;;;;;;;AAwCA,MAAMA,IAAiB;AAAA,EACrBC,yBAAyB;AAAA,EACzBC,QAAQ;AAAA,EACRC,cAAc;AAAA,EACdC,YAAY;AAAA,EACZC,eAAe;AAAA,EACfC,eAAe;AAAA,EACfC,aAAa;AAAA,EACbC,aAAa;AAAA,EACbC,qBAAqB;AAAA,EACrBC,iBAAiB;AAAA,EACjBC,yBAAyB;AAAA,EACzBC,aAAa;AAAA,EACbC,SAAS;AAAA,EACTC,eAAe;AAAA,EACfC,gBAAgB;AAAA,EAChBC,mBAAmB;AACrB,GAEaC,IAA8CA,CAAC;AAAA,EAC1DC,iBAAAA,IAAkB;AAAA,EAClBC,OAAAA,IAAQ;AAAA,EACRC,aAAAA,IAAc;AAAA,EACd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sourcesContent":["import React, { FC, useState } from \"react\";\nimport { Icon, IconProps } from \"../Icon\";\nimport { Button } from \"../Button\";\nimport { Map } from \"../../utils/common.types\";\nimport { useAccessiblePress, getRegionAttributes } from \"../../utils/a11y\";\nimport { useStableId } from \"../../utils/useStableId\";\nimport \"./style.scss\";\n\nexport interface GetStartedWidgetActionItem {\n label: string;\n description?: string;\n isComplete?: boolean;\n buttonLabel?: string;\n buttonIconProps?: IconProps;\n handleActionItemClick: () => void;\n}\n\nexport interface GetStartedWidgetProps {\n widgetClassName?: string;\n title?: string;\n description?: string;\n headerIconProps?: IconProps;\n /**\n * Initial expanded state when the widget is uncontrolled (default behavior).\n * Ignored once `isExpanded` is provided.\n */\n defaultExpanded?: boolean;\n /**\n * Controls expanded state externally. When provided, the widget becomes\n * controlled — you must also provide `onToggle` to update it.\n */\n isExpanded?: boolean;\n /**\n * Called when the toggle chevron is activated. Required to update state\n * when `isExpanded` is controlled; optional otherwise (e.g. for analytics).\n */\n onToggle?: () => void;\n /**\n * When true (default), the widget is collapsible — the header toggles\n * `isExpanded` and the chevron is shown. When false, the widget is always\n * expanded: the header is not clickable and the chevron is hidden.\n */\n isAccordion?: boolean;\n actionItems: GetStartedWidgetActionItem[];\n}\n\nconst className: Map = {\n gettingStartedWidgetCtn:\n \"border border-[var(--color-gray-200)] rounded-[8px] w-full bg-[var(--color-white)] flex flex-col gap-[12px] py-[16px]\",\n header: \"relative flex items-center justify-between gap-[24px] px-[16px]\",\n headerButton: \"absolute inset-0 w-full h-full bg-transparent border-none cursor-pointer focus-outline\",\n headerLeft: \"m-0 font-normal min-w-0 flex-1 flex items-center gap-[16px] pointer-events-none\",\n headerIconCtn: \"relative shrink-0 size-[48px] rounded-full flex items-center justify-center\",\n headerTextCtn: \"flex flex-col gap-[4px] items-start min-w-0\",\n headerRight: \"flex items-center gap-[24px] shrink-0 pointer-events-none\",\n progressCtn: \"flex flex-col gap-[8px] items-end justify-center py-[8px]\",\n progressSegmentsCtn: \"flex gap-[6px] items-start w-[100px]\",\n progressSegment: \"flex-1 h-[4px] rounded-[10px] bg-[var(--color-gray-600)]\",\n progressSegmentComplete: \"flex-1 h-[4px] rounded-[10px] bg-[var(--color-green-500)]\",\n chevronIcon: \"transition-transform duration-300\",\n divider: \"h-px w-full bg-[var(--color-gray-200)]\",\n content: \"flex flex-col gap-[12px]\",\n actionItemCtn: \"flex items-center justify-between px-[16px]\",\n actionItemLeft: \"flex items-center gap-[12px]\",\n actionItemTextCtn: \"flex flex-col gap-[2px] items-start\"\n};\n\nexport const GetStartedWidget: FC<GetStartedWidgetProps> = ({\n widgetClassName = \"\",\n title = \"Get started\",\n description = \"Master the basics of Signeasy. This section goes away on its own once you're done.\",\n headerIconProps = { name: \"magicpen\" },\n defaultExpanded = true,\n isExpanded: isExpandedProp,\n onToggle,\n isAccordion = true,\n actionItems = []\n}) => {\n const [internalExpanded, setInternalExpanded] = useState(defaultExpanded);\n const isControlled = isExpandedProp !== undefined;\n let isExpanded = isControlled ? isExpandedProp : internalExpanded;\n if (!isAccordion) isExpanded = true;\n\n const titleId = useStableId(undefined, \"get-started-widget\");\n const contentId = `${titleId}-content`;\n\n const handleToggle = () => {\n if (!isControlled) {\n setInternalExpanded((prev) => !prev);\n }\n onToggle?.();\n };\n\n const { pressProps } = useAccessiblePress({\n isNative: true,\n onClick: handleToggle\n });\n\n const completedCount = actionItems.filter((item) => item.isComplete).length;\n const progressLabel = `${completedCount} of ${actionItems.length} done`;\n\n return (\n <div className={`${className.gettingStartedWidgetCtn} ${widgetClassName} getting-started-widget-ctn`}>\n <div className={className.header}>\n {isAccordion && (\n <button\n type=\"button\"\n className={className.headerButton}\n aria-expanded={isExpanded}\n aria-controls={contentId}\n aria-labelledby={titleId}\n {...pressProps}\n />\n )}\n <h3 className={className.headerLeft}>\n <span className={className.headerIconCtn} style={{ backgroundColor: \"#ffdcda\" }} aria-hidden=\"true\">\n <Icon {...headerIconProps} stroke=\"#7d4644\" />\n </span>\n <span className={className.headerTextCtn}>\n <span id={titleId} className=\"title text-[var(--color-gray-900)]\">\n {title}\n </span>\n <span className=\"description text-[var(--color-gray-700)]\">{description}</span>\n </span>\n </h3>\n <div className={className.headerRight}>\n <div className={className.progressCtn}>\n <progress\n className=\"sr-only\"\n value={completedCount}\n max={actionItems.length}\n aria-valuetext={progressLabel}\n >\n {progressLabel}\n </progress>\n <span className=\"steps-count text-[var(--color-gray-700)]\" aria-hidden=\"true\">\n {progressLabel}\n </span>\n <div className={className.progressSegmentsCtn} aria-hidden=\"true\">\n {actionItems.map((item, index) => (\n <div\n key={item.label}\n className={index < completedCount ? className.progressSegmentComplete : className.progressSegment}\n />\n ))}\n </div>\n </div>\n {isAccordion && (\n <Icon name=\"chevron\" className={`${className.chevronIcon} ${isExpanded ? \"rotate-180\" : \"\"}`} />\n )}\n </div>\n </div>\n {isExpanded && (\n <div className={className.content} id={contentId} {...getRegionAttributes({ titleId })}>\n {actionItems.map((item) => (\n <React.Fragment key={item.label}>\n <div className={className.divider} />\n <div className={className.actionItemCtn}>\n <div className={className.actionItemLeft}>\n <Icon\n name=\"checked-circle\"\n size={18}\n stroke={item.isComplete ? \"var(--color-green-500)\" : \"var(--color-gray-600)\"}\n />\n <div className={className.actionItemTextCtn}>\n <span className=\"action-item-label text-[var(--color-gray-900)]\">{item.label}</span>\n {item.description && (\n <span className=\"action-item-description text-[var(--color-gray-700)]\">\n {item.description}\n </span>\n )}\n </div>\n </div>\n {item.buttonLabel && (\n <Button\n type=\"secondary\"\n theme=\"blue\"\n size=\"sm\"\n label={item.buttonLabel}\n iconProps={item.buttonIconProps}\n onClick={item.handleActionItemClick}\n />\n )}\n </div>\n </React.Fragment>\n ))}\n </div>\n )}\n </div>\n );\n};\n\nexport default GetStartedWidget;\n"],"names":["className","gettingStartedWidgetCtn","header","headerButton","headerLeft","headerIconCtn","headerTextCtn","headerRight","progressCtn","progressSegmentsCtn","progressSegment","progressSegmentComplete","chevronIcon","divider","content","actionItemCtn","actionItemLeft","actionItemTextCtn","GetStartedWidget","widgetClassName","title","description","headerIconProps","name","defaultExpanded","isExpanded","isExpandedProp","onToggle","isAccordion","actionItems","internalExpanded","setInternalExpanded","useState","isControlled","undefined","titleId","useStableId","contentId","handleToggle","prev","pressProps","useAccessiblePress","isNative","onClick","completedCount","filter","item","isComplete","length","progressLabel","React","createElement","_extends","type","style","backgroundColor","Icon","stroke","id","value","max","map","index","key","label","getRegionAttributes","Fragment","size","buttonLabel","Button","theme","iconProps","buttonIconProps","handleActionItemClick"],"mappings":";;;;;;;;;;;;;;;;;AA8CA,MAAMA,IAAiB;AAAA,EACrBC,yBACE;AAAA,EACFC,QAAQ;AAAA,EACRC,cAAc;AAAA,EACdC,YAAY;AAAA,EACZC,eAAe;AAAA,EACfC,eAAe;AAAA,EACfC,aAAa;AAAA,EACbC,aAAa;AAAA,EACbC,qBAAqB;AAAA,EACrBC,iBAAiB;AAAA,EACjBC,yBAAyB;AAAA,EACzBC,aAAa;AAAA,EACbC,SAAS;AAAA,EACTC,SAAS;AAAA,EACTC,eAAe;AAAA,EACfC,gBAAgB;AAAA,EAChBC,mBAAmB;AACrB,GAEaC,IAA8CA,CAAC;AAAA,EAC1DC,iBAAAA,IAAkB;AAAA,EAClBC,OAAAA,IAAQ;AAAA,EACRC,aAAAA,IAAc;AAAA,EACdC,iBAAAA,IAAkB;AAAA,IAAEC,MAAM;AAAA,EAAA;AAAA,EAC1BC,iBAAAA,IAAkB;AAAA,EAClBC,YAAYC;AAAAA,EACZC,UAAAA;AAAAA,EACAC,aAAAA,IAAc;AAAA,EACdC,aAAAA,IAAc,CAAA;AAChB,MAAM;AACJ,QAAM,CAACC,GAAkBC,CAAmB,IAAIC,EAASR,CAAe,GAClES,IAAeP,MAAmBQ;AACxC,MAAIT,IAAaQ,IAAeP,IAAiBI;AACjD,EAAKF,MAAaH,IAAa;AAE/B,QAAMU,IAAUC,EAAYF,QAAW,oBAAoB,GACrDG,IAAY,GAAGF,CAAO,YAEtBG,IAAeA,MAAM;AACz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