se-design 1.0.87 → 1.0.88-dev
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/InputWithTags/index.d.ts +1 -2
- package/dist/components/SidebarOverlay/index.d.ts +41 -0
- package/dist/index203.js.map +1 -1
- package/dist/index208.js +3 -3
- package/dist/index208.js.map +1 -1
- package/dist/index28.js +149 -88
- package/dist/index28.js.map +1 -1
- package/dist/index32.js +10 -11
- package/dist/index37.js +25 -30
- package/dist/index37.js.map +1 -1
- package/dist/index42.js +7 -8
- package/dist/index43.js +1 -2
- package/dist/index55.js +16 -17
- package/dist/index65.js +1 -2
- package/dist/index7.js +7 -8
- package/package.json +1 -1
package/dist/index203.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index203.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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YD,KAAyB,gBAAAjD,EAAM,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":"index203.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,SAAq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oB,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]}
|
package/dist/index208.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/index208.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index208.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":"index208.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/index28.js
CHANGED
|
@@ -1,114 +1,175 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Icon as
|
|
3
|
-
import { getA11yNameAttributes as
|
|
4
|
-
import { useFocusTrap as
|
|
5
|
-
import { useDismissOnEscape as
|
|
6
|
-
import { useFocusSentinel as
|
|
1
|
+
import m, { useMemo as ue, useRef as h, useEffect as f, useCallback as me, useState as $ } from "react";
|
|
2
|
+
import { Icon as fe } from "./index6.js";
|
|
3
|
+
import { getA11yNameAttributes as ye } from "./index81.js";
|
|
4
|
+
import { useFocusTrap as be } from "./index72.js";
|
|
5
|
+
import { useDismissOnEscape as pe } from "./index215.js";
|
|
6
|
+
import { useFocusSentinel as he } from "./index216.js";
|
|
7
7
|
/* empty css */
|
|
8
|
-
function
|
|
9
|
-
return
|
|
10
|
-
for (var
|
|
11
|
-
var
|
|
12
|
-
for (var r in
|
|
8
|
+
function E() {
|
|
9
|
+
return E = Object.assign ? Object.assign.bind() : function(g) {
|
|
10
|
+
for (var y = 1; y < arguments.length; y++) {
|
|
11
|
+
var a = arguments[y];
|
|
12
|
+
for (var r in a) ({}).hasOwnProperty.call(a, r) && (g[r] = a[r]);
|
|
13
13
|
}
|
|
14
|
-
return
|
|
15
|
-
},
|
|
14
|
+
return g;
|
|
15
|
+
}, E.apply(null, arguments);
|
|
16
16
|
}
|
|
17
|
-
const
|
|
17
|
+
const X = 16, Ie = (g) => {
|
|
18
18
|
const {
|
|
19
|
-
content:
|
|
20
|
-
className:
|
|
19
|
+
content: y,
|
|
20
|
+
className: a = "",
|
|
21
21
|
alignment: r,
|
|
22
|
-
noShadow:
|
|
23
|
-
position:
|
|
24
|
-
isOpen:
|
|
25
|
-
displayCloseSidebar:
|
|
26
|
-
onClose:
|
|
27
|
-
onSidebarUnmount:
|
|
28
|
-
onPathChange:
|
|
29
|
-
style:
|
|
30
|
-
automationId:
|
|
22
|
+
noShadow: j,
|
|
23
|
+
position: D = "fixed",
|
|
24
|
+
isOpen: t,
|
|
25
|
+
displayCloseSidebar: H,
|
|
26
|
+
onClose: v,
|
|
27
|
+
onSidebarUnmount: x,
|
|
28
|
+
onPathChange: A,
|
|
29
|
+
style: R,
|
|
30
|
+
automationId: Y,
|
|
31
31
|
id: N,
|
|
32
|
-
currentPath:
|
|
33
|
-
closeSidebarIcon:
|
|
34
|
-
closeAriaLabel:
|
|
35
|
-
animateSidebar:
|
|
36
|
-
a11yRole:
|
|
37
|
-
ariaLabel:
|
|
38
|
-
ariaLabelledBy:
|
|
39
|
-
ariaDescribedBy:
|
|
40
|
-
returnFocusRef:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
32
|
+
currentPath: W = "",
|
|
33
|
+
closeSidebarIcon: V = "close",
|
|
34
|
+
closeAriaLabel: Z = "Close sidebar",
|
|
35
|
+
animateSidebar: q = !0,
|
|
36
|
+
a11yRole: G,
|
|
37
|
+
ariaLabel: k,
|
|
38
|
+
ariaLabelledBy: K,
|
|
39
|
+
ariaDescribedBy: O,
|
|
40
|
+
returnFocusRef: _,
|
|
41
|
+
resizable: b = !1,
|
|
42
|
+
minWidth: s,
|
|
43
|
+
maxWidth: z,
|
|
44
|
+
defaultWidth: J,
|
|
45
|
+
onResize: L,
|
|
46
|
+
onResizeEnd: l,
|
|
47
|
+
resizeHandleAriaLabel: Q = "Resize panel",
|
|
48
|
+
resizeAutomationId: ee
|
|
49
|
+
} = g, T = G ?? "complementary", o = T === "dialog", te = ue(() => ye({
|
|
50
|
+
ariaLabel: k,
|
|
51
|
+
ariaLabelledBy: K,
|
|
52
|
+
ariaDescribedBy: O
|
|
53
|
+
}), [k, K, O]), I = h(null);
|
|
54
|
+
f(() => () => {
|
|
55
|
+
x && x();
|
|
56
|
+
}, []), f(() => {
|
|
57
|
+
if (o)
|
|
58
|
+
return document.body.style.overflow = t ? "hidden" : "", () => {
|
|
51
59
|
document.body.style.overflow = "";
|
|
52
60
|
};
|
|
53
|
-
}, [
|
|
54
|
-
|
|
55
|
-
}, [
|
|
61
|
+
}, [t, o]), f(() => {
|
|
62
|
+
A && A(W);
|
|
63
|
+
}, [W]);
|
|
56
64
|
const {
|
|
57
|
-
onKeyDown:
|
|
58
|
-
} =
|
|
59
|
-
onDismiss:
|
|
60
|
-
enabled:
|
|
65
|
+
onKeyDown: re
|
|
66
|
+
} = pe({
|
|
67
|
+
onDismiss: v,
|
|
68
|
+
enabled: t
|
|
61
69
|
});
|
|
62
|
-
|
|
63
|
-
enabled: !!(
|
|
64
|
-
containerRef:
|
|
70
|
+
be({
|
|
71
|
+
enabled: !!(o && t && v),
|
|
72
|
+
containerRef: I,
|
|
65
73
|
restoreFocus: !0,
|
|
66
74
|
initialFocus: "first",
|
|
67
|
-
returnFocusRef:
|
|
75
|
+
returnFocusRef: _
|
|
68
76
|
});
|
|
69
77
|
const {
|
|
70
|
-
startSentinelProps:
|
|
71
|
-
endSentinelProps:
|
|
72
|
-
} =
|
|
73
|
-
isOpen:
|
|
74
|
-
isModal:
|
|
75
|
-
containerRef:
|
|
76
|
-
returnFocusRef:
|
|
77
|
-
}),
|
|
78
|
-
|
|
79
|
-
return
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
startSentinelProps: ne,
|
|
79
|
+
endSentinelProps: oe
|
|
80
|
+
} = he({
|
|
81
|
+
isOpen: t,
|
|
82
|
+
isModal: o,
|
|
83
|
+
containerRef: I,
|
|
84
|
+
returnFocusRef: _
|
|
85
|
+
}), c = me((e) => {
|
|
86
|
+
const i = s ?? 0, d = z ?? Number.POSITIVE_INFINITY;
|
|
87
|
+
return Math.min(Math.max(e, i), d);
|
|
88
|
+
}, [s, z]), [p, w] = $(() => c(J ?? s ?? 0)), [S, F] = $(!1), C = h(0), M = h(0), n = h(p), P = h(!1);
|
|
89
|
+
f(() => {
|
|
90
|
+
n.current = p;
|
|
91
|
+
}, [p]), f(() => {
|
|
92
|
+
b && w((e) => c(e));
|
|
93
|
+
}, [b, c]), f(() => {
|
|
94
|
+
if (!S) return;
|
|
95
|
+
const e = document.body.style.userSelect, i = document.body.style.cursor;
|
|
96
|
+
return document.body.style.userSelect = "none", document.body.style.cursor = "col-resize", () => {
|
|
97
|
+
document.body.style.userSelect = e, document.body.style.cursor = i;
|
|
98
|
+
};
|
|
99
|
+
}, [S]);
|
|
100
|
+
const ie = (e) => {
|
|
101
|
+
e.preventDefault(), e.stopPropagation(), e.currentTarget.setPointerCapture(e.pointerId), C.current = e.clientX, M.current = n.current, P.current = !0, F(!0);
|
|
102
|
+
}, ae = (e) => {
|
|
103
|
+
if (!P.current) return;
|
|
104
|
+
const i = r === "left" ? e.clientX - C.current : C.current - e.clientX, d = c(M.current + i);
|
|
105
|
+
w(d), L && L(d);
|
|
106
|
+
}, B = (e) => {
|
|
107
|
+
P.current && (P.current = !1, e.currentTarget.hasPointerCapture(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId), F(!1), l && l(n.current));
|
|
108
|
+
}, se = (e) => {
|
|
109
|
+
const i = r === "left" ? "ArrowRight" : "ArrowLeft", d = r === "left" ? "ArrowLeft" : "ArrowRight";
|
|
110
|
+
let u = null;
|
|
111
|
+
if (e.key === i ? u = n.current + X : e.key === d ? u = n.current - X : e.key === "Home" ? u = s ?? n.current : e.key === "End" && (u = z ?? n.current), u === null) return;
|
|
112
|
+
e.preventDefault();
|
|
113
|
+
const U = c(u);
|
|
114
|
+
w(U), l && l(U);
|
|
115
|
+
}, le = () => {
|
|
116
|
+
const e = c(s ?? n.current);
|
|
117
|
+
w(e), l && l(e);
|
|
118
|
+
}, ce = () => {
|
|
119
|
+
let e = "se-design-sidebar-overlay-container z-[1000]";
|
|
120
|
+
return e += a.length > 0 ? ` ${a}` : "", e += r === "left" ? " left-aligned" : " right-aligned", e += j ? " no-shadow" : "", e += D.length > 0 ? ` ${D}` : "", e += t ? " open-sidebar" : " closed-sidebar", e += b ? " resizable" : "", e += S ? " is-resizing" : "", q || (e += t ? "" : " hidden"), e;
|
|
121
|
+
}, de = () => b ? {
|
|
122
|
+
...R,
|
|
123
|
+
width: t ? `${p}px` : "0px"
|
|
124
|
+
} : {
|
|
125
|
+
...R,
|
|
126
|
+
...t && R?.width ? {
|
|
127
|
+
width: R?.width
|
|
84
128
|
} : {
|
|
85
129
|
width: "0px"
|
|
86
130
|
}
|
|
87
|
-
}
|
|
88
|
-
return /* @__PURE__ */
|
|
89
|
-
ref:
|
|
131
|
+
};
|
|
132
|
+
return /* @__PURE__ */ m.createElement("div", E({
|
|
133
|
+
ref: I,
|
|
90
134
|
id: N,
|
|
91
|
-
className:
|
|
92
|
-
style:
|
|
93
|
-
"data-automation-id":
|
|
135
|
+
className: ce(),
|
|
136
|
+
style: de(),
|
|
137
|
+
"data-automation-id": Y,
|
|
94
138
|
tabIndex: -1,
|
|
95
|
-
role:
|
|
96
|
-
"aria-modal":
|
|
97
|
-
"aria-hidden":
|
|
98
|
-
},
|
|
99
|
-
onKeyDown:
|
|
100
|
-
inert:
|
|
101
|
-
}), /* @__PURE__ */
|
|
139
|
+
role: T,
|
|
140
|
+
"aria-modal": o ? "true" : void 0,
|
|
141
|
+
"aria-hidden": t ? void 0 : "true"
|
|
142
|
+
}, te, {
|
|
143
|
+
onKeyDown: re,
|
|
144
|
+
inert: t ? void 0 : ""
|
|
145
|
+
}), b && t && /* @__PURE__ */ m.createElement("div", {
|
|
146
|
+
className: `se-design-sidebar-overlay-resize-handle${S ? " is-resizing" : ""}`,
|
|
147
|
+
role: "separator",
|
|
148
|
+
"aria-orientation": "vertical",
|
|
149
|
+
"aria-label": Q,
|
|
150
|
+
"aria-controls": N,
|
|
151
|
+
"aria-valuenow": p,
|
|
152
|
+
"aria-valuemin": s,
|
|
153
|
+
"aria-valuemax": z,
|
|
154
|
+
tabIndex: 0,
|
|
155
|
+
onPointerDown: ie,
|
|
156
|
+
onPointerMove: ae,
|
|
157
|
+
onPointerUp: B,
|
|
158
|
+
onPointerCancel: B,
|
|
159
|
+
onKeyDown: se,
|
|
160
|
+
onDoubleClick: le,
|
|
161
|
+
"data-automation-id": ee
|
|
162
|
+
}), /* @__PURE__ */ m.createElement("div", {
|
|
102
163
|
className: "overlay-content"
|
|
103
|
-
}, !
|
|
104
|
-
name:
|
|
105
|
-
onClick:
|
|
164
|
+
}, !o && /* @__PURE__ */ m.createElement("div", ne), H && /* @__PURE__ */ m.createElement(fe, {
|
|
165
|
+
name: V,
|
|
166
|
+
onClick: v,
|
|
106
167
|
className: "overlay-close",
|
|
107
|
-
ariaLabel:
|
|
168
|
+
ariaLabel: Z,
|
|
108
169
|
automationId: "sidebar_overlay_close"
|
|
109
|
-
}),
|
|
170
|
+
}), y, !o && /* @__PURE__ */ m.createElement("div", oe)));
|
|
110
171
|
};
|
|
111
172
|
export {
|
|
112
|
-
|
|
173
|
+
Ie as SidebarOverlay
|
|
113
174
|
};
|
|
114
175
|
//# sourceMappingURL=index28.js.map
|
package/dist/index28.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index28.js","sources":["../src/components/SidebarOverlay/index.tsx"],"sourcesContent":["import React, { FC, useEffect, useMemo, useRef } from 'react';\nimport { Icon } from 'components/Icon';\nimport { getA11yNameAttributes, useFocusTrap, useDismissOnEscape } from '../../utils/a11y';\nimport { useFocusSentinel } from '../../utils/a11y/useFocusSentinel';\n\nimport './style.scss';\n\ntype SidebarOverlayA11yRole = 'dialog' | 'complementary';\n\nexport interface SidebarOverlayProps {\n content: React.ReactNode;\n className?: string;\n alignment?: 'left' | 'right';\n style?: React.CSSProperties;\n noShadow?: boolean;\n automationId?: string;\n id?: string;\n position?: 'absolute' | 'fixed' | 'relative' | 'static' | '';\n isOpen?: boolean;\n displayCloseSidebar?: boolean;\n closeSidebarIcon?: string;\n /**\n * Accessible label for the close button. Defaults to 'Close sidebar'.\n */\n closeAriaLabel?: string;\n onClose?: () => void;\n onSidebarUnmount?: () => void;\n onPathChange?: (route: string) => void;\n currentPath?: string;\n animateSidebar?: boolean;\n /**\n * Accessibility role that determines the full behavior bundle.\n * - 'dialog': modal drawer (focus trap, scroll lock, aria-modal, Escape closes)\n * - 'complementary': persistent side panel (no trap, no forced focus, no scroll lock)\n * If not provided, derives from position: fixed|absolute → 'dialog', static|relative|'' → 'complementary'\n */\n a11yRole?: SidebarOverlayA11yRole;\n /**\n * Accessible name when no visible label exists.\n * Prefer ariaLabelledBy when a visible title exists inside the sidebar.\n */\n ariaLabel?: string;\n /**\n * ID(s) of visible element(s) that label this sidebar.\n * Preferred over ariaLabel when a visible title exists (keeps SR and visual text in sync).\n */\n ariaLabelledBy?: string;\n /**\n * ID(s) of element(s) that describe this sidebar (additional context).\n */\n ariaDescribedBy?: string;\n /**\n * Explicit element to restore focus to when the sidebar closes.\n * Overrides automatic trigger capture from document.activeElement.\n * Use when the opener element is known (e.g. a ref on the toggle button).\n * In complementary mode: seeds the trigger ref directly.\n * In dialog mode: passed through to useFocusTrap.\n */\n returnFocusRef?: React.RefObject<HTMLElement | null>;\n}\n\nexport const SidebarOverlay: FC<SidebarOverlayProps> = (props) => {\n const {\n content,\n className = '',\n alignment,\n noShadow,\n position = 'fixed',\n isOpen,\n displayCloseSidebar,\n onClose,\n onSidebarUnmount,\n onPathChange,\n style,\n automationId,\n id,\n currentPath = '',\n closeSidebarIcon = 'close',\n closeAriaLabel = 'Close sidebar',\n animateSidebar = true,\n a11yRole,\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy,\n returnFocusRef,\n } = props;\n\n // Default to complementary — consumers opt into dialog (focus trap + scroll lock)\n // by passing a11yRole=\"dialog\" explicitly.\n const effectiveA11yRole: SidebarOverlayA11yRole = a11yRole ?? 'complementary';\n\n const isModal = effectiveA11yRole === 'dialog';\n\n // Get accessible name attributes\n const accessibleNameProps = useMemo(\n () => getA11yNameAttributes({ ariaLabel, ariaLabelledBy, ariaDescribedBy }),\n [ariaLabel, ariaLabelledBy, ariaDescribedBy]\n );\n\n const sidebarRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n return () => {\n onSidebarUnmount && onSidebarUnmount();\n };\n }, []);\n\n // Scroll lock — modal only.\n useEffect(() => {\n if (!isModal) return;\n document.body.style.overflow = isOpen ? 'hidden' : '';\n return () => {\n document.body.style.overflow = '';\n };\n }, [isOpen, isModal]);\n\n useEffect(() => {\n onPathChange && onPathChange(currentPath);\n }, [currentPath]);\n\n const { onKeyDown: onEscapeKeyDown } = useDismissOnEscape({\n onDismiss: onClose,\n enabled: isOpen\n });\n\n // Focus trap: modal mode only, guarded by onClose as a WCAG safety net —\n // trapping focus without a dismiss path is a keyboard trap (WCAG 2.1.2).\n useFocusTrap({\n enabled: Boolean(isModal && isOpen && !!onClose),\n containerRef: sidebarRef,\n restoreFocus: true,\n initialFocus: 'first',\n returnFocusRef,\n });\n\n // Complementary (non-modal) focus management: move focus in on open,\n // restore to trigger on close, wrap Tab/Shift+Tab at panel boundaries.\n const { startSentinelProps, endSentinelProps } = useFocusSentinel({\n isOpen,\n isModal,\n containerRef: sidebarRef,\n returnFocusRef,\n });\n\n const getSidebarClassName = () => {\n let defaultClass = `se-design-sidebar-overlay-container z-[1000]`;\n\n defaultClass += className.length > 0 ? ` ${className}` : '';\n defaultClass += alignment === 'left' ? ' left-aligned' : ' right-aligned';\n defaultClass += noShadow ? ' no-shadow' : '';\n defaultClass += position.length > 0 ? ` ${position}` : '';\n defaultClass += isOpen ? ' open-sidebar' : ' closed-sidebar';\n if(!animateSidebar) {\n defaultClass += isOpen ? '' : ' hidden';\n }\n return defaultClass;\n };\n\n const getSidebarStyle = () => {\n return {\n ...style,\n ...(isOpen && style?.width ? { width: style?.width } : { width: '0px' })\n };\n };\n\n return (\n <div\n ref={sidebarRef}\n id={id}\n className={getSidebarClassName()}\n style={getSidebarStyle()}\n data-automation-id={automationId}\n tabIndex={-1}\n role={effectiveA11yRole}\n aria-modal={isModal ? 'true' : undefined}\n aria-hidden={!isOpen ? 'true' : undefined}\n {...accessibleNameProps}\n onKeyDown={onEscapeKeyDown}\n inert={!isOpen ? ('' as unknown as boolean) : undefined}\n >\n <div className=\"overlay-content\">\n {!isModal && <div {...startSentinelProps} />}\n {displayCloseSidebar && (\n <Icon\n name={closeSidebarIcon}\n onClick={onClose}\n className=\"overlay-close\"\n ariaLabel={closeAriaLabel}\n automationId=\"sidebar_overlay_close\"\n />\n )}\n {content}\n {!isModal && <div {...endSentinelProps} />}\n </div>\n </div>\n );\n};\n"],"names":["SidebarOverlay","props","content","className","alignment","noShadow","position","isOpen","displayCloseSidebar","onClose","onSidebarUnmount","onPathChange","style","automationId","id","currentPath","closeSidebarIcon","closeAriaLabel","animateSidebar","a11yRole","ariaLabel","ariaLabelledBy","ariaDescribedBy","returnFocusRef","effectiveA11yRole","isModal","accessibleNameProps","useMemo","getA11yNameAttributes","sidebarRef","useRef","useEffect","document","body","overflow","onKeyDown","onEscapeKeyDown","useDismissOnEscape","onDismiss","enabled","useFocusTrap","Boolean","containerRef","restoreFocus","initialFocus","startSentinelProps","endSentinelProps","useFocusSentinel","getSidebarClassName","defaultClass","length","getSidebarStyle","width","React","createElement","_extends","ref","tabIndex","role","undefined","inert","Icon","name","onClick"],"mappings":";;;;;;;;;;;;;;;;AA6DO,MAAMA,IAA2CC,CAAAA,MAAU;AAChE,QAAM;AAAA,IACJC,SAAAA;AAAAA,IACAC,WAAAA,IAAY;AAAA,IACZC,WAAAA;AAAAA,IACAC,UAAAA;AAAAA,IACAC,UAAAA,IAAW;AAAA,IACXC,QAAAA;AAAAA,IACAC,qBAAAA;AAAAA,IACAC,SAAAA;AAAAA,IAC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1CrC,KACC6C,gBAAAA,EAAAC,cAACO,GAAI;AAAA,IACHC,MAAM9C;AAAAA,IACN+C,SAAStD;AAAAA,IACTN,WAAU;AAAA,IACViB,WAAWH;AAAAA,IACXJ,cAAa;AAAA,EAAA,CACd,GAEFX,GACA,CAACuB,uBAAW6B,cAAA,OAASR,CAAmB,CACtC,CACF;AAET;"}
|
|
1
|
+
{"version":3,"file":"index28.js","sources":["../src/components/SidebarOverlay/index.tsx"],"sourcesContent":["import React, { FC, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { Icon } from 'components/Icon';\nimport { getA11yNameAttributes, useFocusTrap, useDismissOnEscape } from '../../utils/a11y';\nimport { useFocusSentinel } from '../../utils/a11y/useFocusSentinel';\n\nimport './style.scss';\n\ntype SidebarOverlayA11yRole = 'dialog' | 'complementary';\n\nconst RESIZE_KEYBOARD_STEP = 16;\n\nexport interface SidebarOverlayProps {\n content: React.ReactNode;\n className?: string;\n alignment?: 'left' | 'right';\n style?: React.CSSProperties;\n noShadow?: boolean;\n automationId?: string;\n id?: string;\n position?: 'absolute' | 'fixed' | 'relative' | 'static' | '';\n isOpen?: boolean;\n displayCloseSidebar?: boolean;\n closeSidebarIcon?: string;\n /**\n * Accessible label for the close button. Defaults to 'Close sidebar'.\n */\n closeAriaLabel?: string;\n onClose?: () => void;\n onSidebarUnmount?: () => void;\n onPathChange?: (route: string) => void;\n currentPath?: string;\n animateSidebar?: boolean;\n /**\n * Accessibility role that determines the full behavior bundle.\n * - 'dialog': modal drawer (focus trap, scroll lock, aria-modal, Escape closes)\n * - 'complementary': persistent side panel (no trap, no forced focus, no scroll lock)\n * If not provided, derives from position: fixed|absolute → 'dialog', static|relative|'' → 'complementary'\n */\n a11yRole?: SidebarOverlayA11yRole;\n /**\n * Accessible name when no visible label exists.\n * Prefer ariaLabelledBy when a visible title exists inside the sidebar.\n */\n ariaLabel?: string;\n /**\n * ID(s) of visible element(s) that label this sidebar.\n * Preferred over ariaLabel when a visible title exists (keeps SR and visual text in sync).\n */\n ariaLabelledBy?: string;\n /**\n * ID(s) of element(s) that describe this sidebar (additional context).\n */\n ariaDescribedBy?: string;\n /**\n * Explicit element to restore focus to when the sidebar closes.\n * Overrides automatic trigger capture from document.activeElement.\n * Use when the opener element is known (e.g. a ref on the toggle button).\n * In complementary mode: seeds the trigger ref directly.\n * In dialog mode: passed through to useFocusTrap.\n */\n returnFocusRef?: React.RefObject<HTMLElement | null>;\n /**\n * Enables drag-to-resize via a handle on the panel's inner edge\n * (left edge when alignment=\"right\", right edge when \"left\"). Default false.\n * Requires a positioned container — the default position=\"fixed\" satisfies this.\n */\n resizable?: boolean;\n /**\n * Minimum width in px the panel can be resized to. Also the initial width\n * when `defaultWidth` is omitted. Recommended whenever `resizable` is set.\n */\n minWidth?: number;\n /**\n * Maximum width in px the panel can be resized to. Consumers typically derive\n * this from the viewport (e.g. half the screen) and update it on window\n * resize; the panel re-clamps its width when this changes.\n */\n maxWidth?: number;\n /**\n * Uncontrolled initial width in px (e.g. restored from storage). Falls back to\n * `minWidth`, and is clamped to [minWidth, maxWidth].\n */\n defaultWidth?: number;\n /**\n * Called continuously while dragging, with the live width in px. Use for live\n * layout updates (e.g. pushing adjacent content). For persistence, prefer\n * onResizeEnd.\n */\n onResize?: (width: number) => void;\n /**\n * Called when a resize gesture commits (mouse-up, keyboard, or double-click\n * reset) with the new width in px. Use to persist the chosen width.\n */\n onResizeEnd?: (width: number) => void;\n /**\n * Accessible label for the resize handle. Defaults to 'Resize panel'.\n */\n resizeHandleAriaLabel?: string;\n /**\n * Automation id applied to the resize handle element.\n */\n resizeAutomationId?: string;\n}\n\nexport const SidebarOverlay: FC<SidebarOverlayProps> = (props) => {\n const {\n content,\n className = '',\n alignment,\n noShadow,\n position = 'fixed',\n isOpen,\n displayCloseSidebar,\n onClose,\n onSidebarUnmount,\n onPathChange,\n style,\n automationId,\n id,\n currentPath = '',\n closeSidebarIcon = 'close',\n closeAriaLabel = 'Close sidebar',\n animateSidebar = true,\n a11yRole,\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy,\n returnFocusRef,\n resizable = false,\n minWidth,\n maxWidth,\n defaultWidth,\n onResize,\n onResizeEnd,\n resizeHandleAriaLabel = 'Resize panel',\n resizeAutomationId,\n } = props;\n\n // Default to complementary — consumers opt into dialog (focus trap + scroll lock)\n // by passing a11yRole=\"dialog\" explicitly.\n const effectiveA11yRole: SidebarOverlayA11yRole = a11yRole ?? 'complementary';\n\n const isModal = effectiveA11yRole === 'dialog';\n\n // Get accessible name attributes\n const accessibleNameProps = useMemo(\n () => getA11yNameAttributes({ ariaLabel, ariaLabelledBy, ariaDescribedBy }),\n [ariaLabel, ariaLabelledBy, ariaDescribedBy]\n );\n\n const sidebarRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n return () => {\n onSidebarUnmount && onSidebarUnmount();\n };\n }, []);\n\n // Scroll lock — modal only.\n useEffect(() => {\n if (!isModal) return;\n document.body.style.overflow = isOpen ? 'hidden' : '';\n return () => {\n document.body.style.overflow = '';\n };\n }, [isOpen, isModal]);\n\n useEffect(() => {\n onPathChange && onPathChange(currentPath);\n }, [currentPath]);\n\n const { onKeyDown: onEscapeKeyDown } = useDismissOnEscape({\n onDismiss: onClose,\n enabled: isOpen\n });\n\n // Focus trap: modal mode only, guarded by onClose as a WCAG safety net —\n // trapping focus without a dismiss path is a keyboard trap (WCAG 2.1.2).\n useFocusTrap({\n enabled: Boolean(isModal && isOpen && !!onClose),\n containerRef: sidebarRef,\n restoreFocus: true,\n initialFocus: 'first',\n returnFocusRef,\n });\n\n // Complementary (non-modal) focus management: move focus in on open,\n // restore to trigger on close, wrap Tab/Shift+Tab at panel boundaries.\n const { startSentinelProps, endSentinelProps } = useFocusSentinel({\n isOpen,\n isModal,\n containerRef: sidebarRef,\n returnFocusRef,\n });\n\n // --- Drag-to-resize (opt-in via `resizable`) -------------------------------\n const clampWidth = useCallback(\n (value: number) => {\n const min = minWidth ?? 0;\n const max = maxWidth ?? Number.POSITIVE_INFINITY;\n return Math.min(Math.max(value, min), max);\n },\n [minWidth, maxWidth]\n );\n\n const [resizeWidth, setResizeWidth] = useState<number>(() => clampWidth(defaultWidth ?? minWidth ?? 0));\n const [isResizing, setIsResizing] = useState(false);\n const resizeStartCoordRef = useRef(0);\n const resizeStartWidthRef = useRef(0);\n const resizeWidthRef = useRef(resizeWidth);\n const isResizingRef = useRef(false);\n\n useEffect(() => {\n resizeWidthRef.current = resizeWidth;\n }, [resizeWidth]);\n\n // Re-clamp when the bounds change (e.g. maxWidth shrinks on window resize).\n useEffect(() => {\n if (!resizable) return;\n setResizeWidth((current) => clampWidth(current));\n }, [resizable, clampWidth]);\n\n // While resizing, suppress text selection and show the resize cursor\n // everywhere; restore on release or unmount.\n useEffect(() => {\n if (!isResizing) return;\n const previousUserSelect = document.body.style.userSelect;\n const previousCursor = document.body.style.cursor;\n document.body.style.userSelect = 'none';\n document.body.style.cursor = 'col-resize';\n return () => {\n document.body.style.userSelect = previousUserSelect;\n document.body.style.cursor = previousCursor;\n };\n }, [isResizing]);\n\n const handleResizePointerDown = (event: React.PointerEvent) => {\n event.preventDefault();\n event.stopPropagation();\n // Capture the pointer so move/up events keep firing on the handle even when\n // the cursor passes over an iframe (e.g. a PDF viewer) — no overlay needed,\n // and the gesture always ends (even if released off-screen).\n event.currentTarget.setPointerCapture(event.pointerId);\n resizeStartCoordRef.current = event.clientX;\n resizeStartWidthRef.current = resizeWidthRef.current;\n isResizingRef.current = true;\n setIsResizing(true);\n };\n\n const handleResizePointerMove = (event: React.PointerEvent) => {\n if (!isResizingRef.current) return;\n const delta =\n alignment === 'left'\n ? event.clientX - resizeStartCoordRef.current\n : resizeStartCoordRef.current - event.clientX;\n const nextWidth = clampWidth(resizeStartWidthRef.current + delta);\n setResizeWidth(nextWidth);\n onResize && onResize(nextWidth);\n };\n\n const handleResizePointerUp = (event: React.PointerEvent) => {\n if (!isResizingRef.current) return;\n isResizingRef.current = false;\n if (event.currentTarget.hasPointerCapture(event.pointerId)) {\n event.currentTarget.releasePointerCapture(event.pointerId);\n }\n setIsResizing(false);\n onResizeEnd && onResizeEnd(resizeWidthRef.current);\n };\n\n const handleResizeKeyDown = (event: React.KeyboardEvent) => {\n const growKey = alignment === 'left' ? 'ArrowRight' : 'ArrowLeft';\n const shrinkKey = alignment === 'left' ? 'ArrowLeft' : 'ArrowRight';\n let nextWidth: number | null = null;\n\n if (event.key === growKey) nextWidth = resizeWidthRef.current + RESIZE_KEYBOARD_STEP;\n else if (event.key === shrinkKey) nextWidth = resizeWidthRef.current - RESIZE_KEYBOARD_STEP;\n else if (event.key === 'Home') nextWidth = minWidth ?? resizeWidthRef.current;\n else if (event.key === 'End') nextWidth = maxWidth ?? resizeWidthRef.current;\n\n if (nextWidth === null) return;\n event.preventDefault();\n const clamped = clampWidth(nextWidth);\n setResizeWidth(clamped);\n onResizeEnd && onResizeEnd(clamped);\n };\n\n const handleResizeDoubleClick = () => {\n const reset = clampWidth(minWidth ?? resizeWidthRef.current);\n setResizeWidth(reset);\n onResizeEnd && onResizeEnd(reset);\n };\n\n const getSidebarClassName = () => {\n let defaultClass = `se-design-sidebar-overlay-container z-[1000]`;\n\n defaultClass += className.length > 0 ? ` ${className}` : '';\n defaultClass += alignment === 'left' ? ' left-aligned' : ' right-aligned';\n defaultClass += noShadow ? ' no-shadow' : '';\n defaultClass += position.length > 0 ? ` ${position}` : '';\n defaultClass += isOpen ? ' open-sidebar' : ' closed-sidebar';\n defaultClass += resizable ? ' resizable' : '';\n defaultClass += isResizing ? ' is-resizing' : '';\n if(!animateSidebar) {\n defaultClass += isOpen ? '' : ' hidden';\n }\n return defaultClass;\n };\n\n const getSidebarStyle = () => {\n if (resizable) {\n return {\n ...style,\n width: isOpen ? `${resizeWidth}px` : '0px'\n };\n }\n return {\n ...style,\n ...(isOpen && style?.width ? { width: style?.width } : { width: '0px' })\n };\n };\n\n return (\n <div\n ref={sidebarRef}\n id={id}\n className={getSidebarClassName()}\n style={getSidebarStyle()}\n data-automation-id={automationId}\n tabIndex={-1}\n role={effectiveA11yRole}\n aria-modal={isModal ? 'true' : undefined}\n aria-hidden={!isOpen ? 'true' : undefined}\n {...accessibleNameProps}\n onKeyDown={onEscapeKeyDown}\n inert={!isOpen ? ('' as unknown as boolean) : undefined}\n >\n {resizable && isOpen && (\n <div\n className={`se-design-sidebar-overlay-resize-handle${isResizing ? ' is-resizing' : ''}`}\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label={resizeHandleAriaLabel}\n aria-controls={id}\n aria-valuenow={resizeWidth}\n aria-valuemin={minWidth}\n aria-valuemax={maxWidth}\n tabIndex={0}\n onPointerDown={handleResizePointerDown}\n onPointerMove={handleResizePointerMove}\n onPointerUp={handleResizePointerUp}\n onPointerCancel={handleResizePointerUp}\n onKeyDown={handleResizeKeyDown}\n onDoubleClick={handleResizeDoubleClick}\n data-automation-id={resizeAutomationId}\n />\n )}\n <div className=\"overlay-content\">\n {!isModal && <div {...startSentinelProps} />}\n {displayCloseSidebar && (\n <Icon\n name={closeSidebarIcon}\n onClick={onClose}\n className=\"overlay-close\"\n ariaLabel={closeAriaLabel}\n automationId=\"sidebar_overlay_close\"\n />\n )}\n {content}\n {!isModal && <div {...endSentinelProps} />}\n </div>\n </div>\n );\n};\n"],"names":["RESIZE_KEYBOARD_STEP","SidebarOverlay","props","content","className","alignment","noShadow","position","isOpen","displayCloseSidebar","onClose","onSidebarUnmount","onPathChange","style","automationId","id","currentPath","closeSidebarIcon","closeAriaLabel","animateSidebar","a11yRole","ariaLabel","ariaLabelledBy","ariaDescribedBy","returnFocusRef","resizable","minWidth","maxWidth","defaultWidth","onResize","onResizeEnd","resizeHandleAriaLabel","resizeAutomationId","effectiveA11yRole","isModal","accessibleNameProps","useMemo","getA11yNameAttributes","sidebarRef","useRef","useEffect","document","body","overflow","onKeyDown","onEscapeKeyDown","useDismissOnEscape","onDismiss","enabled","useFocusTrap","Boolean","containerRef","restoreFocus","initialFocus","startSentinelProps","endSentinelProps","useFocusSentinel","clampWidth","useCallback","value","min","max","Number","POSITIVE_INFINITY","Math","resizeWidth","setResizeWidth","useState","isResizing","setIsResizing","resizeStartCoordRef","resizeStartWidthRef","resizeWidthRef","isResizingRef","current","previousUserSelect","userSelect","previousCursor","cursor","handleResizePointerDown","event","preventDefault","stopPropagation","currentTarget","setPointerCapture","pointerId","clientX","handleResizePointerMove","delta","nextWidth","handleResizePointerUp","hasPointerCapture","releasePointerCapture","handleResizeKeyDown","growKey","shrinkKey","key","clamped","handleResizeDoubleClick","reset","getSidebarClassName","defaultClass","length","getSidebarStyle","width","React","createElement","_extends","ref","tabIndex","role","undefined","inert","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onDoubleClick","Icon","name","onClick"],"mappings":";;;;;;;;;;;;;;;;AASA,MAAMA,IAAuB,IA+FhBC,KAA2CC,CAAAA,MAAU;AAChE,QAAM;AAAA,IACJC,SAAAA;AAAAA,IACAC,WAAAA,IAAY;AAAA,IACZC,WAAAA;AAAAA,IACAC,UAAAA;AAAAA,IACAC,UAAAA,IAAW;AAAA,IACXC,QAAAA;AAAAA,IACAC,qBAAAA;AAAAA,IACAC,SAAAA;AAAAA,IACAC,kBAAAA;AAAAA,IACAC,cAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,cAAAA;AAAAA,IACAC,IAAAA;AAAAA,IACAC,aAAAA,IAAc;AAAA,IACdC,kBAAAA,IAAmB;AAAA,IACnBC,gBAAAA,IAAiB;AAAA,IACjBC,gBAAAA,IAAiB;AAAA,IACjBC,UAAAA;AAAAA,IACAC,WAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,iBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,WAAAA,IAAY;AAAA,IACZC,UAAAA;AAAAA,IACAC,UAAAA;AAAAA,IACAC,cAAAA;AAAAA,IACAC,UAAAA;AAAAA,IACAC,aAAAA;AAAAA,IACAC,uBAAAA,IAAwB;AAAA,IACxBC,oBAAAA;AAAAA,EAAAA,IACE9B,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ACf4B,aAAazB;AAAAA,IACb0B,iBAAiB1B;AAAAA,IACjB9C,WAAWiD;AAAAA,IACXwB,eAAenB;AAAAA,IACf,sBAAoBlE;AAAAA,EAAAA,CACrB,GAEHyE,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKtG,WAAU;AAAA,EAAA,GACZ,CAAC8B,KAAWuE,gBAAAA,EAAAC,cAAA,OAASpD,EAAqB,GAC1C7C,KACCgG,gBAAAA,EAAAC,cAACY,IAAI;AAAA,IACHC,MAAMtG;AAAAA,IACNuG,SAAS9G;AAAAA,IACTN,WAAU;AAAA,IACViB,WAAWH;AAAAA,IACXJ,cAAa;AAAA,EAAA,CACd,GAEFX,GACA,CAAC+B,uBAAWwE,cAAA,OAASnD,EAAmB,CACtC,CACF;AAET;"}
|
package/dist/index32.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=index32.js.map
|
package/dist/index37.js
CHANGED
|
@@ -1,43 +1,39 @@
|
|
|
1
|
-
import a, { useState as
|
|
1
|
+
import a, { useState as p, useRef as N } from "react";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import { Icon as
|
|
4
|
-
function
|
|
5
|
-
value:
|
|
3
|
+
import { Icon as k } from "./index6.js";
|
|
4
|
+
function D({
|
|
5
|
+
value: g,
|
|
6
6
|
onChange: s,
|
|
7
|
-
placeholder:
|
|
8
|
-
className:
|
|
7
|
+
placeholder: f,
|
|
8
|
+
className: d,
|
|
9
9
|
error: o,
|
|
10
|
-
errorMessage:
|
|
10
|
+
errorMessage: h,
|
|
11
11
|
label: c,
|
|
12
|
-
automationId:
|
|
13
|
-
commitOnBlur: E = !1
|
|
12
|
+
automationId: w = ""
|
|
14
13
|
}) {
|
|
15
|
-
const [n,
|
|
16
|
-
const e = n.filter((
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
t.key === "Enter" && i.trim() ? (t.preventDefault(), p()) : t.key === "Backspace" && i === "" && n.length > 0 && m(n.length - 1);
|
|
25
|
-
}, k = () => {
|
|
26
|
-
E && p();
|
|
14
|
+
const [n, l] = p([...g]), [i, r] = p(""), u = N(null), m = (t) => {
|
|
15
|
+
const e = n.filter((y, E) => E !== t);
|
|
16
|
+
l(e), s?.(e);
|
|
17
|
+
}, v = (t) => {
|
|
18
|
+
if (t.key === "Enter" && i.trim()) {
|
|
19
|
+
t.preventDefault();
|
|
20
|
+
const e = [...n, i.trim()];
|
|
21
|
+
l(e), r(""), s?.(e);
|
|
22
|
+
} else t.key === "Backspace" && i === "" && n.length > 0 && m(n.length - 1);
|
|
27
23
|
};
|
|
28
24
|
return /* @__PURE__ */ a.createElement("div", {
|
|
29
25
|
className: "input-with-tags-main-container",
|
|
30
|
-
"data-automation-id":
|
|
26
|
+
"data-automation-id": w
|
|
31
27
|
}, c && /* @__PURE__ */ a.createElement("div", {
|
|
32
28
|
className: "label-container"
|
|
33
29
|
}, c), /* @__PURE__ */ a.createElement("div", {
|
|
34
|
-
className: `input-with-tags-container ${o ? "input-with-tags-error" : ""} ${
|
|
30
|
+
className: `input-with-tags-container ${o ? "input-with-tags-error" : ""} ${d}`,
|
|
35
31
|
onClick: () => u.current?.focus()
|
|
36
32
|
}, n.map((t, e) => /* @__PURE__ */ a.createElement("span", {
|
|
37
33
|
key: e,
|
|
38
34
|
className: "tag-in-inputwithtags",
|
|
39
35
|
"data-automation-id": `input-tag-${e}`
|
|
40
|
-
}, t, /* @__PURE__ */ a.createElement(
|
|
36
|
+
}, t, /* @__PURE__ */ a.createElement(k, {
|
|
41
37
|
name: "close",
|
|
42
38
|
className: "close-icon-in-inputwithtags",
|
|
43
39
|
ariaLabel: `Remove tag ${t}`,
|
|
@@ -48,16 +44,15 @@ function _({
|
|
|
48
44
|
ref: u,
|
|
49
45
|
type: "text",
|
|
50
46
|
value: i,
|
|
51
|
-
onChange: (t) =>
|
|
52
|
-
onKeyDown:
|
|
53
|
-
|
|
54
|
-
placeholder: d,
|
|
47
|
+
onChange: (t) => r(t.target.value),
|
|
48
|
+
onKeyDown: v,
|
|
49
|
+
placeholder: f,
|
|
55
50
|
"data-automation-id": "input-with-tags-input-field"
|
|
56
51
|
})), o && /* @__PURE__ */ a.createElement("div", {
|
|
57
52
|
className: "error-message"
|
|
58
|
-
},
|
|
53
|
+
}, h));
|
|
59
54
|
}
|
|
60
55
|
export {
|
|
61
|
-
|
|
56
|
+
D as InputWithTags
|
|
62
57
|
};
|
|
63
58
|
//# sourceMappingURL=index37.js.map
|