@aquera/nile-elements 1.7.3 → 1.7.5
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/README.md +7 -0
- package/dist/index-199b0eac.esm.js +1 -0
- package/dist/index-f5e587e2.cjs.js +2 -0
- package/dist/index-f5e587e2.cjs.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +994 -681
- package/dist/nile-combobox/index.cjs.js +1 -1
- package/dist/nile-combobox/index.esm.js +1 -1
- package/dist/nile-combobox/nile-combobox.cjs.js +1 -1
- package/dist/nile-combobox/nile-combobox.cjs.js.map +1 -1
- package/dist/nile-combobox/nile-combobox.esm.js +28 -28
- package/dist/nile-detail/index.cjs.js +1 -1
- package/dist/nile-detail/index.esm.js +1 -1
- package/dist/nile-detail/nile-detail.cjs.js +1 -1
- package/dist/nile-detail/nile-detail.cjs.js.map +1 -1
- package/dist/nile-detail/nile-detail.css.cjs.js +1 -1
- package/dist/nile-detail/nile-detail.css.cjs.js.map +1 -1
- package/dist/nile-detail/nile-detail.css.esm.js +230 -0
- package/dist/nile-detail/nile-detail.esm.js +89 -7
- package/dist/nile-floating-panel/index.cjs.js +1 -1
- package/dist/nile-floating-panel/nile-floating-panel.cjs.js +1 -1
- package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.cjs.js +1 -1
- package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.cjs.js.map +1 -1
- package/dist/nile-inline-sidebar-item/nile-inline-sidebar-item.esm.js +1 -1
- package/dist/nile-inline-sidebar-item-header/nile-inline-sidebar-item-header.css.cjs.js +1 -1
- package/dist/nile-inline-sidebar-item-header/nile-inline-sidebar-item-header.css.cjs.js.map +1 -1
- package/dist/nile-inline-sidebar-item-header/nile-inline-sidebar-item-header.css.esm.js +2 -1
- package/dist/nile-lite-tooltip/index.cjs.js +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.cjs.js +1 -1
- package/dist/nile-otp-input/nile-otp-input.css.cjs.js +1 -1
- package/dist/nile-otp-input/nile-otp-input.css.cjs.js.map +1 -1
- package/dist/nile-otp-input/nile-otp-input.css.esm.js +1 -1
- package/dist/src/nile-detail/nile-detail.css.js +230 -0
- package/dist/src/nile-detail/nile-detail.css.js.map +1 -1
- package/dist/src/nile-detail/nile-detail.d.ts +151 -0
- package/dist/src/nile-detail/nile-detail.js +829 -4
- package/dist/src/nile-detail/nile-detail.js.map +1 -1
- package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.js +1 -1
- package/dist/src/nile-inline-sidebar-item/nile-inline-sidebar-item.js.map +1 -1
- package/dist/src/nile-inline-sidebar-item-header/nile-inline-sidebar-item-header.css.js +2 -1
- package/dist/src/nile-inline-sidebar-item-header/nile-inline-sidebar-item-header.css.js.map +1 -1
- package/dist/src/nile-otp-input/nile-otp-input.css.js +1 -1
- package/dist/src/nile-otp-input/nile-otp-input.css.js.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-detail/nile-detail.css.ts +230 -0
- package/src/nile-detail/nile-detail.ts +876 -4
- package/src/nile-inline-sidebar-item/nile-inline-sidebar-item.ts +1 -1
- package/src/nile-inline-sidebar-item-header/nile-inline-sidebar-item-header.css.ts +2 -1
- package/src/nile-otp-input/nile-otp-input.css.ts +1 -1
- package/vscode-html-custom-data.json +120 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit/decorators.js","./nile-floating-panel.css.cjs.js","../internal/nile-element.cjs.js","../tippy.esm-78baa8f2.cjs.js","../nile-lite-tooltip/utils.cjs.js","../utilities/visibility-manager.cjs.js","lit","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js"],function(_export,_context){"use strict";var t,i,e,s,n,h,o,r,l,a,c,_d,p;function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_litDecoratorsJs){i=_litDecoratorsJs.property;e=_litDecoratorsJs.customElement;},function(_nileFloatingPanelCssCjsJs){s=_nileFloatingPanelCssCjsJs.s;},function(_internalNileElementCjsJs){n=_internalNileElementCjsJs.N;},function(_tippyEsm005CjsJs){h=_tippyEsm005CjsJs.R;o=_tippyEsm005CjsJs.f;r=_tippyEsm005CjsJs.t;},function(_nileLiteTooltipUtilsCjsJs){l=_nileLiteTooltipUtilsCjsJs.p;a=_nileLiteTooltipUtilsCjsJs.a;},function(_utilitiesVisibilityManagerCjsJs){c=_utilitiesVisibilityManagerCjsJs.V;},function(_lit){},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){}],execute:function execute(){_export("N",p=_d=/*#__PURE__*/function(_n){function d(){var _this;_classCallCheck(this,d);_this=_callSuper(this,d,arguments),_this.placement="bottom",_this.trigger="click",_this.distance=12,_this.skidding=0,_this.arrow="round",_this.animation="fade",_this.duration=200,_this.delay=0,_this.interactive=!0,_this.interactiveBorder=2,_this.maxWidth="none",_this.zIndex=9999,_this.followCursor=!1,_this.hideOnClick=!0,_this.inertia=!1,_this.allowHTML=!1,_this.flip=!0,_this["for"]=null,_this.open=!1,_this.preventOverlayClose=!1,_this.title="",_this.disabled=!1,_this.group=null,_this.closeOnEscape=!0,_this.panelClass="",_this.enableVisibilityEffect=!1,_this.enableTabClose=!1,_this.tippyInstance=null,_this.panelContainer=null,_this.anchorEl=null,_this._suppressOpenWatch=!1,_this._panelId="nile-fp-".concat(Math.random().toString(36).slice(2,9)),_this._boundEscHandler=_this._handleEscapeKey.bind(_assertThisInitialized(_this)),_this._pendingShowListener=null,_this._pendingHideListener=null;return _this;}_inherits(d,_n);return _createClass(d,[{key:"createRenderRoot",value:function createRenderRoot(){return this;}},{key:"firstUpdated",value:function firstUpdated(){var _this2=this;this._buildDOM(),this._attachTippy(),this._joinGroup(),this.visibilityManager=new c({host:this,target:this.anchorEl||null,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:function isOpen(){return _this2.open;},onAnchorOutOfView:function onAnchorOutOfView(){var _this2$tippyInstance;_this2._setOpen(!1),(_this2$tippyInstance=_this2.tippyInstance)!==null&&_this2$tippyInstance!==void 0&&_this2$tippyInstance.hide(),_this2.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"});},onDocumentHidden:function onDocumentHidden(){var _this2$tippyInstance2;_this2._setOpen(!1),(_this2$tippyInstance2=_this2.tippyInstance)!==null&&_this2$tippyInstance2!==void 0&&_this2$tippyInstance2.hide(),_this2.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"});},emit:function emit(t,i){return _this2.emit("nile-".concat(t),i);}}),this.emit("nile-init");}},{key:"disconnectedCallback",value:function disconnectedCallback(){var _this$visibilityManag;_superPropGet(d,"disconnectedCallback",this,3)([]),this._cleanupPendingShowListener(),this._cleanupPendingHideListener(),(_this$visibilityManag=this.visibilityManager)!==null&&_this$visibilityManag!==void 0&&_this$visibilityManag.cleanup(),this._leaveGroup(),this._removeEscListener(),this._destroyTippy(),this.emit("nile-destroy");}},{key:"updated",value:function updated(t){var _this$visibilityManag2,_this3=this,_this$visibilityManag3,_this$tippyInstance;if(_superPropGet(d,"updated",this,3)([t]),!this.panelContainer)return;t.has("open")&&!this._suppressOpenWatch&&(this.open?((_this$visibilityManag2=this.visibilityManager)!==null&&_this$visibilityManag2!==void 0&&_this$visibilityManag2.setup(),queueMicrotask(function(){var _this3$tippyInstance;return(_this3$tippyInstance=_this3.tippyInstance)===null||_this3$tippyInstance===void 0?void 0:_this3$tippyInstance.show();})):((_this$visibilityManag3=this.visibilityManager)!==null&&_this$visibilityManag3!==void 0&&_this$visibilityManag3.cleanup(),(_this$tippyInstance=this.tippyInstance)===null||_this$tippyInstance===void 0?void 0:_this$tippyInstance.hide())),t.has("group")&&(this._leaveGroup(t.get("group")),this._joinGroup());["placement","trigger","distance","skidding","arrow","animation","duration","delay","interactive","interactiveBorder","maxWidth","zIndex","followCursor","hideOnClick","inertia","allowHTML","flip","preventOverlayClose","disabled","width","height","panelClass"].some(function(i){return t.has(i);})&&this._attachTippy();}},{key:"show",value:function show(){var _this4=this;return this.open=!0,new Promise(function(t){_this4._cleanupPendingShowListener();var i=function i(){_this4._pendingShowListener=null,t();};_this4._pendingShowListener=i,_this4.addEventListener("nile-after-show",i,{once:!0});});}},{key:"hide",value:function hide(){var _this5=this;return this.open=!1,new Promise(function(t){_this5._cleanupPendingHideListener();var i=function i(){_this5._pendingHideListener=null,t();};_this5._pendingHideListener=i,_this5.addEventListener("nile-after-hide",i,{once:!0});});}},{key:"_cleanupPendingShowListener",value:function _cleanupPendingShowListener(){this._pendingShowListener&&(this.removeEventListener("nile-after-show",this._pendingShowListener),this._pendingShowListener=null);}},{key:"_cleanupPendingHideListener",value:function _cleanupPendingHideListener(){this._pendingHideListener&&(this.removeEventListener("nile-after-hide",this._pendingHideListener),this._pendingHideListener=null);}},{key:"toggle",value:function toggle(){this.open=!this.open;}},{key:"refresh",value:function refresh(){this._attachTippy();}},{key:"getCurrentPlacement",value:function getCurrentPlacement(){var _this$tippyInstance2,_i$dataset$placement;var t=(_this$tippyInstance2=this.tippyInstance)===null||_this$tippyInstance2===void 0?void 0:_this$tippyInstance2.popper,i=t===null||t===void 0?void 0:t.querySelector(".tippy-box");return(_i$dataset$placement=i===null||i===void 0?void 0:i.dataset.placement)!==null&&_i$dataset$placement!==void 0?_i$dataset$placement:this.placement;}},{key:"isPositioningOptimal",value:function isPositioningOptimal(){return this.getCurrentPlacement()===this.placement;}},{key:"_joinGroup",value:function _joinGroup(){if(!this.group)return;var t=_d._groups.get(this.group);t||(t=new Set(),_d._groups.set(this.group,t)),t.add(this);}},{key:"_leaveGroup",value:function _leaveGroup(t){var i=t!==null&&t!==void 0?t:this.group;if(!i)return;var e=_d._groups.get(i);e&&(e["delete"](this),0===e.size&&_d._groups["delete"](i));}},{key:"_hideGroupSiblings",value:function _hideGroupSiblings(){var _this6=this;if(!this.group)return;var t=_d._groups.get(this.group);t&&t.forEach(function(t){var _t$tippyInstance;t!==_this6&&t.open&&(t._setOpen(!1),(_t$tippyInstance=t.tippyInstance)===null||_t$tippyInstance===void 0?void 0:_t$tippyInstance.hide());});}},{key:"_addEscListener",value:function _addEscListener(){this.closeOnEscape&&document.addEventListener("keydown",this._boundEscHandler);}},{key:"_removeEscListener",value:function _removeEscListener(){document.removeEventListener("keydown",this._boundEscHandler);}},{key:"_handleEscapeKey",value:function _handleEscapeKey(t){var _this$tippyInstance3;"Escape"===t.key&&this.open&&(this._setOpen(!1),(_this$tippyInstance3=this.tippyInstance)===null||_this$tippyInstance3===void 0?void 0:_this$tippyInstance3.hide());}},{key:"_applyAria",value:function _applyAria(){this.anchorEl&&this.panelContainer&&(this.panelContainer.setAttribute("role","dialog"),this.panelContainer.id=this._panelId,this.anchorEl.setAttribute("aria-haspopup","dialog"),this._syncAriaExpanded());}},{key:"_syncAriaExpanded",value:function _syncAriaExpanded(){var _this$anchorEl,_this$anchorEl2,_this$anchorEl3;(_this$anchorEl=this.anchorEl)!==null&&_this$anchorEl!==void 0&&_this$anchorEl.setAttribute("aria-expanded",String(this.open)),this.open?(_this$anchorEl2=this.anchorEl)===null||_this$anchorEl2===void 0?void 0:_this$anchorEl2.setAttribute("aria-describedby",this._panelId):(_this$anchorEl3=this.anchorEl)===null||_this$anchorEl3===void 0?void 0:_this$anchorEl3.removeAttribute("aria-describedby");}},{key:"_buildDOM",value:function _buildDOM(){var t=Array.from(this.childNodes);this.anchorEl=null;var i=[],e=[],s=[];var n=!1;for(var _i=0,_t=t;_i<_t.length;_i++){var _h=_t[_i];if(_h instanceof HTMLElement){var _t2=_h.getAttribute("slot");if("title"===_t2){_h.removeAttribute("slot"),i.push(_h);continue;}if("action"===_t2){_h.removeAttribute("slot"),e.push(_h);continue;}if(!n&&!this["for"]){this.anchorEl=_h,n=!0;continue;}}s.push(_h);}if(this["for"]){var _t3=document.getElementById(this["for"]);_t3&&(this.anchorEl=_t3);}for(;this.firstChild;)this.removeChild(this.firstChild);this.anchorEl&&!this["for"]&&this.appendChild(this.anchorEl),this.panelContainer=document.createElement("div"),this.panelContainer.className="nile-floating-panel__content",this.panelContainer.style.display="none";var h=document.createElement("div");if(h.className="nile-floating-panel__body",i.length>0||this.title){var _t4=document.createElement("div");_t4.className="nile-floating-panel__title",this.title?_t4.textContent=this.title:i.forEach(function(i){return _t4.appendChild(i);}),h.appendChild(_t4);}if(s.length>0){var _t5=document.createElement("div");_t5.className="nile-floating-panel__main",s.forEach(function(i){return _t5.appendChild(i);}),h.appendChild(_t5);}if(e.length>0){var _t6=document.createElement("div");_t6.className="nile-floating-panel__action",e.forEach(function(i){return _t6.appendChild(i);}),h.appendChild(_t6);}this.panelContainer.appendChild(h),this.appendChild(this.panelContainer),this._applyAria();}},{key:"_resolveArrow",value:function _resolveArrow(){switch(this.arrow){case"round":return h;case"none":return!1;default:return!0;}}},{key:"_setOpen",value:function _setOpen(t){this._suppressOpenWatch=!0,this.open=t,this._syncAriaExpanded(),this._suppressOpenWatch=!1;}},{key:"_getEffectiveDuration",value:function _getEffectiveDuration(){return _d.prefersReducedMotion?0:l(this.duration);}},{key:"_getEffectiveAnimation",value:function _getEffectiveAnimation(){return!_d.prefersReducedMotion&&this.animation;}},{key:"_attachTippy",value:function _attachTippy(){var _this7=this;if(this._destroyTippy(),this.disabled||!this.anchorEl||!this.panelContainer)return;var t=a(this.followCursor),i=!this.preventOverlayClose&&this.hideOnClick,e={content:this.panelContainer,placement:this.placement,trigger:this.trigger,offset:[this.skidding,this.distance],theme:"floating-panel",animation:this._getEffectiveAnimation(),interactive:this.interactive,arrow:this._resolveArrow(),duration:this._getEffectiveDuration(),allowHTML:this.allowHTML,delay:this.delay,maxWidth:this.maxWidth,zIndex:this.zIndex,hideOnClick:i,inertia:!_d.prefersReducedMotion&&this.inertia,interactiveBorder:this.interactiveBorder,appendTo:document.body,followCursor:t,plugins:t?[o]:[],popperOptions:{modifiers:[{name:"flip",enabled:this.flip}]},onMount:function onMount(t){_this7.panelContainer&&(_this7.panelContainer.style.display=""),_this7.panelClass&&_this7.panelClass.split(/\s+/).filter(Boolean).forEach(function(i){t.popper.classList.add(i);});},onShow:function onShow(t){_this7.panelContainer&&(_this7.panelContainer.style.display="");var i=t.popper.querySelector(".tippy-content");i&&(_this7.width&&(i.style.width=_this7.width),_this7.height&&(i.style.height=_this7.height,i.style.overflow="auto")),_this7._hideGroupSiblings(),_this7._setOpen(!0),_this7._addEscListener(),_this7.dispatchEvent(new CustomEvent("nile-show",{detail:{instance:t,target:t.reference}})),_this7.dispatchEvent(new CustomEvent("nile-toggle",{detail:{open:!0,instance:t,target:t.reference}}));},onShown:function onShown(t){_this7.dispatchEvent(new CustomEvent("nile-after-show",{detail:{instance:t,target:t.reference}}));},onHide:function onHide(t){_this7._setOpen(!1),_this7._removeEscListener(),_this7.dispatchEvent(new CustomEvent("nile-hide",{detail:{instance:t,target:t.reference}})),_this7.dispatchEvent(new CustomEvent("nile-toggle",{detail:{open:!1,instance:t,target:t.reference}}));},onHidden:function onHidden(t){_this7.panelContainer&&(_this7.panelContainer.style.display="none"),_this7.dispatchEvent(new CustomEvent("nile-after-hide",{detail:{instance:t,target:t.reference}}));}};this.tippyInstance=r(this.anchorEl,e),this.open&&queueMicrotask(function(){var _this7$tippyInstance;return(_this7$tippyInstance=_this7.tippyInstance)===null||_this7$tippyInstance===void 0?void 0:_this7$tippyInstance.show();});}},{key:"_destroyTippy",value:function _destroyTippy(){this.tippyInstance&&(this.tippyInstance.destroy(),this.tippyInstance=null),this.panelContainer&&(this.panelContainer.style.display="none",this.panelContainer.parentElement!==this&&this.appendChild(this.panelContainer));}}],[{key:"prefersReducedMotion",get:function get(){return _d._reducedMotionQuery||(_d._reducedMotionQuery=window.matchMedia("(prefers-reduced-motion: reduce)")),_d._reducedMotionQuery.matches;}},{key:"styles",get:function get(){return[s];}}]);}(n));p._groups=new Map(),p._reducedMotionQuery=null,t([i({type:String})],p.prototype,"placement",void 0),t([i({type:String})],p.prototype,"trigger",void 0),t([i({type:Number})],p.prototype,"distance",void 0),t([i({type:Number})],p.prototype,"skidding",void 0),t([i({type:String,reflect:!0})],p.prototype,"arrow",void 0),t([i({type:String,reflect:!0})],p.prototype,"animation",void 0),t([i({type:String,reflect:!0})],p.prototype,"duration",void 0),t([i({type:String,reflect:!0})],p.prototype,"delay",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"interactive",void 0),t([i({type:Number,reflect:!0})],p.prototype,"interactiveBorder",void 0),t([i({type:String,reflect:!0})],p.prototype,"maxWidth",void 0),t([i({type:Number,reflect:!0})],p.prototype,"zIndex",void 0),t([i({type:String,reflect:!0})],p.prototype,"followCursor",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"hideOnClick",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"inertia",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"allowHTML",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"flip",void 0),t([i({type:String,attribute:"for"})],p.prototype,"for",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"open",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"preventOverlayClose",void 0),t([i({type:String,reflect:!0})],p.prototype,"title",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"disabled",void 0),t([i({type:String,reflect:!0})],p.prototype,"width",void 0),t([i({type:String,reflect:!0})],p.prototype,"height",void 0),t([i({type:String,reflect:!0})],p.prototype,"group",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"closeOnEscape",void 0),t([i({type:String,reflect:!0,attribute:!0})],p.prototype,"panelClass",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"enableVisibilityEffect",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"enableTabClose",void 0),_export("N",p=_d=t([e("nile-floating-panel")],p));}};});
|
|
1
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit/decorators.js","./nile-floating-panel.css.cjs.js","../internal/nile-element.cjs.js","../tippy.esm-78baa8f2.cjs.js","../nile-lite-tooltip/utils.cjs.js","../utilities/visibility-manager.cjs.js","lit","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js"],function(_export,_context){"use strict";var t,i,e,s,n,h,o,r,l,a,c,_d,p;function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_litDecoratorsJs){i=_litDecoratorsJs.property;e=_litDecoratorsJs.customElement;},function(_nileFloatingPanelCssCjsJs){s=_nileFloatingPanelCssCjsJs.s;},function(_internalNileElementCjsJs){n=_internalNileElementCjsJs.N;},function(_tippyEsm006CjsJs){h=_tippyEsm006CjsJs.R;o=_tippyEsm006CjsJs.f;r=_tippyEsm006CjsJs.t;},function(_nileLiteTooltipUtilsCjsJs){l=_nileLiteTooltipUtilsCjsJs.p;a=_nileLiteTooltipUtilsCjsJs.a;},function(_utilitiesVisibilityManagerCjsJs){c=_utilitiesVisibilityManagerCjsJs.V;},function(_lit){},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){}],execute:function execute(){_export("N",p=_d=/*#__PURE__*/function(_n){function d(){var _this;_classCallCheck(this,d);_this=_callSuper(this,d,arguments),_this.placement="bottom",_this.trigger="click",_this.distance=12,_this.skidding=0,_this.arrow="round",_this.animation="fade",_this.duration=200,_this.delay=0,_this.interactive=!0,_this.interactiveBorder=2,_this.maxWidth="none",_this.zIndex=9999,_this.followCursor=!1,_this.hideOnClick=!0,_this.inertia=!1,_this.allowHTML=!1,_this.flip=!0,_this["for"]=null,_this.open=!1,_this.preventOverlayClose=!1,_this.title="",_this.disabled=!1,_this.group=null,_this.closeOnEscape=!0,_this.panelClass="",_this.enableVisibilityEffect=!1,_this.enableTabClose=!1,_this.tippyInstance=null,_this.panelContainer=null,_this.anchorEl=null,_this._suppressOpenWatch=!1,_this._panelId="nile-fp-".concat(Math.random().toString(36).slice(2,9)),_this._boundEscHandler=_this._handleEscapeKey.bind(_assertThisInitialized(_this)),_this._pendingShowListener=null,_this._pendingHideListener=null;return _this;}_inherits(d,_n);return _createClass(d,[{key:"createRenderRoot",value:function createRenderRoot(){return this;}},{key:"firstUpdated",value:function firstUpdated(){var _this2=this;this._buildDOM(),this._attachTippy(),this._joinGroup(),this.visibilityManager=new c({host:this,target:this.anchorEl||null,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:function isOpen(){return _this2.open;},onAnchorOutOfView:function onAnchorOutOfView(){var _this2$tippyInstance;_this2._setOpen(!1),(_this2$tippyInstance=_this2.tippyInstance)!==null&&_this2$tippyInstance!==void 0&&_this2$tippyInstance.hide(),_this2.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"});},onDocumentHidden:function onDocumentHidden(){var _this2$tippyInstance2;_this2._setOpen(!1),(_this2$tippyInstance2=_this2.tippyInstance)!==null&&_this2$tippyInstance2!==void 0&&_this2$tippyInstance2.hide(),_this2.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"});},emit:function emit(t,i){return _this2.emit("nile-".concat(t),i);}}),this.emit("nile-init");}},{key:"disconnectedCallback",value:function disconnectedCallback(){var _this$visibilityManag;_superPropGet(d,"disconnectedCallback",this,3)([]),this._cleanupPendingShowListener(),this._cleanupPendingHideListener(),(_this$visibilityManag=this.visibilityManager)!==null&&_this$visibilityManag!==void 0&&_this$visibilityManag.cleanup(),this._leaveGroup(),this._removeEscListener(),this._destroyTippy(),this.emit("nile-destroy");}},{key:"updated",value:function updated(t){var _this$visibilityManag2,_this3=this,_this$visibilityManag3,_this$tippyInstance;if(_superPropGet(d,"updated",this,3)([t]),!this.panelContainer)return;t.has("open")&&!this._suppressOpenWatch&&(this.open?((_this$visibilityManag2=this.visibilityManager)!==null&&_this$visibilityManag2!==void 0&&_this$visibilityManag2.setup(),queueMicrotask(function(){var _this3$tippyInstance;return(_this3$tippyInstance=_this3.tippyInstance)===null||_this3$tippyInstance===void 0?void 0:_this3$tippyInstance.show();})):((_this$visibilityManag3=this.visibilityManager)!==null&&_this$visibilityManag3!==void 0&&_this$visibilityManag3.cleanup(),(_this$tippyInstance=this.tippyInstance)===null||_this$tippyInstance===void 0?void 0:_this$tippyInstance.hide())),t.has("group")&&(this._leaveGroup(t.get("group")),this._joinGroup());["placement","trigger","distance","skidding","arrow","animation","duration","delay","interactive","interactiveBorder","maxWidth","zIndex","followCursor","hideOnClick","inertia","allowHTML","flip","preventOverlayClose","disabled","width","height","panelClass"].some(function(i){return t.has(i);})&&this._attachTippy();}},{key:"show",value:function show(){var _this4=this;return this.open=!0,new Promise(function(t){_this4._cleanupPendingShowListener();var i=function i(){_this4._pendingShowListener=null,t();};_this4._pendingShowListener=i,_this4.addEventListener("nile-after-show",i,{once:!0});});}},{key:"hide",value:function hide(){var _this5=this;return this.open=!1,new Promise(function(t){_this5._cleanupPendingHideListener();var i=function i(){_this5._pendingHideListener=null,t();};_this5._pendingHideListener=i,_this5.addEventListener("nile-after-hide",i,{once:!0});});}},{key:"_cleanupPendingShowListener",value:function _cleanupPendingShowListener(){this._pendingShowListener&&(this.removeEventListener("nile-after-show",this._pendingShowListener),this._pendingShowListener=null);}},{key:"_cleanupPendingHideListener",value:function _cleanupPendingHideListener(){this._pendingHideListener&&(this.removeEventListener("nile-after-hide",this._pendingHideListener),this._pendingHideListener=null);}},{key:"toggle",value:function toggle(){this.open=!this.open;}},{key:"refresh",value:function refresh(){this._attachTippy();}},{key:"getCurrentPlacement",value:function getCurrentPlacement(){var _this$tippyInstance2,_i$dataset$placement;var t=(_this$tippyInstance2=this.tippyInstance)===null||_this$tippyInstance2===void 0?void 0:_this$tippyInstance2.popper,i=t===null||t===void 0?void 0:t.querySelector(".tippy-box");return(_i$dataset$placement=i===null||i===void 0?void 0:i.dataset.placement)!==null&&_i$dataset$placement!==void 0?_i$dataset$placement:this.placement;}},{key:"isPositioningOptimal",value:function isPositioningOptimal(){return this.getCurrentPlacement()===this.placement;}},{key:"_joinGroup",value:function _joinGroup(){if(!this.group)return;var t=_d._groups.get(this.group);t||(t=new Set(),_d._groups.set(this.group,t)),t.add(this);}},{key:"_leaveGroup",value:function _leaveGroup(t){var i=t!==null&&t!==void 0?t:this.group;if(!i)return;var e=_d._groups.get(i);e&&(e["delete"](this),0===e.size&&_d._groups["delete"](i));}},{key:"_hideGroupSiblings",value:function _hideGroupSiblings(){var _this6=this;if(!this.group)return;var t=_d._groups.get(this.group);t&&t.forEach(function(t){var _t$tippyInstance;t!==_this6&&t.open&&(t._setOpen(!1),(_t$tippyInstance=t.tippyInstance)===null||_t$tippyInstance===void 0?void 0:_t$tippyInstance.hide());});}},{key:"_addEscListener",value:function _addEscListener(){this.closeOnEscape&&document.addEventListener("keydown",this._boundEscHandler);}},{key:"_removeEscListener",value:function _removeEscListener(){document.removeEventListener("keydown",this._boundEscHandler);}},{key:"_handleEscapeKey",value:function _handleEscapeKey(t){var _this$tippyInstance3;"Escape"===t.key&&this.open&&(this._setOpen(!1),(_this$tippyInstance3=this.tippyInstance)===null||_this$tippyInstance3===void 0?void 0:_this$tippyInstance3.hide());}},{key:"_applyAria",value:function _applyAria(){this.anchorEl&&this.panelContainer&&(this.panelContainer.setAttribute("role","dialog"),this.panelContainer.id=this._panelId,this.anchorEl.setAttribute("aria-haspopup","dialog"),this._syncAriaExpanded());}},{key:"_syncAriaExpanded",value:function _syncAriaExpanded(){var _this$anchorEl,_this$anchorEl2,_this$anchorEl3;(_this$anchorEl=this.anchorEl)!==null&&_this$anchorEl!==void 0&&_this$anchorEl.setAttribute("aria-expanded",String(this.open)),this.open?(_this$anchorEl2=this.anchorEl)===null||_this$anchorEl2===void 0?void 0:_this$anchorEl2.setAttribute("aria-describedby",this._panelId):(_this$anchorEl3=this.anchorEl)===null||_this$anchorEl3===void 0?void 0:_this$anchorEl3.removeAttribute("aria-describedby");}},{key:"_buildDOM",value:function _buildDOM(){var t=Array.from(this.childNodes);this.anchorEl=null;var i=[],e=[],s=[];var n=!1;for(var _i=0,_t=t;_i<_t.length;_i++){var _h=_t[_i];if(_h instanceof HTMLElement){var _t2=_h.getAttribute("slot");if("title"===_t2){_h.removeAttribute("slot"),i.push(_h);continue;}if("action"===_t2){_h.removeAttribute("slot"),e.push(_h);continue;}if(!n&&!this["for"]){this.anchorEl=_h,n=!0;continue;}}s.push(_h);}if(this["for"]){var _t3=document.getElementById(this["for"]);_t3&&(this.anchorEl=_t3);}for(;this.firstChild;)this.removeChild(this.firstChild);this.anchorEl&&!this["for"]&&this.appendChild(this.anchorEl),this.panelContainer=document.createElement("div"),this.panelContainer.className="nile-floating-panel__content",this.panelContainer.style.display="none";var h=document.createElement("div");if(h.className="nile-floating-panel__body",i.length>0||this.title){var _t4=document.createElement("div");_t4.className="nile-floating-panel__title",this.title?_t4.textContent=this.title:i.forEach(function(i){return _t4.appendChild(i);}),h.appendChild(_t4);}if(s.length>0){var _t5=document.createElement("div");_t5.className="nile-floating-panel__main",s.forEach(function(i){return _t5.appendChild(i);}),h.appendChild(_t5);}if(e.length>0){var _t6=document.createElement("div");_t6.className="nile-floating-panel__action",e.forEach(function(i){return _t6.appendChild(i);}),h.appendChild(_t6);}this.panelContainer.appendChild(h),this.appendChild(this.panelContainer),this._applyAria();}},{key:"_resolveArrow",value:function _resolveArrow(){switch(this.arrow){case"round":return h;case"none":return!1;default:return!0;}}},{key:"_setOpen",value:function _setOpen(t){this._suppressOpenWatch=!0,this.open=t,this._syncAriaExpanded(),this._suppressOpenWatch=!1;}},{key:"_getEffectiveDuration",value:function _getEffectiveDuration(){return _d.prefersReducedMotion?0:l(this.duration);}},{key:"_getEffectiveAnimation",value:function _getEffectiveAnimation(){return!_d.prefersReducedMotion&&this.animation;}},{key:"_attachTippy",value:function _attachTippy(){var _this7=this;if(this._destroyTippy(),this.disabled||!this.anchorEl||!this.panelContainer)return;var t=a(this.followCursor),i=!this.preventOverlayClose&&this.hideOnClick,e={content:this.panelContainer,placement:this.placement,trigger:this.trigger,offset:[this.skidding,this.distance],theme:"floating-panel",animation:this._getEffectiveAnimation(),interactive:this.interactive,arrow:this._resolveArrow(),duration:this._getEffectiveDuration(),allowHTML:this.allowHTML,delay:this.delay,maxWidth:this.maxWidth,zIndex:this.zIndex,hideOnClick:i,inertia:!_d.prefersReducedMotion&&this.inertia,interactiveBorder:this.interactiveBorder,appendTo:document.body,followCursor:t,plugins:t?[o]:[],popperOptions:{modifiers:[{name:"flip",enabled:this.flip}]},onMount:function onMount(t){_this7.panelContainer&&(_this7.panelContainer.style.display=""),_this7.panelClass&&_this7.panelClass.split(/\s+/).filter(Boolean).forEach(function(i){t.popper.classList.add(i);});},onShow:function onShow(t){_this7.panelContainer&&(_this7.panelContainer.style.display="");var i=t.popper.querySelector(".tippy-content");i&&(_this7.width&&(i.style.width=_this7.width),_this7.height&&(i.style.height=_this7.height,i.style.overflow="auto")),_this7._hideGroupSiblings(),_this7._setOpen(!0),_this7._addEscListener(),_this7.dispatchEvent(new CustomEvent("nile-show",{detail:{instance:t,target:t.reference}})),_this7.dispatchEvent(new CustomEvent("nile-toggle",{detail:{open:!0,instance:t,target:t.reference}}));},onShown:function onShown(t){_this7.dispatchEvent(new CustomEvent("nile-after-show",{detail:{instance:t,target:t.reference}}));},onHide:function onHide(t){_this7._setOpen(!1),_this7._removeEscListener(),_this7.dispatchEvent(new CustomEvent("nile-hide",{detail:{instance:t,target:t.reference}})),_this7.dispatchEvent(new CustomEvent("nile-toggle",{detail:{open:!1,instance:t,target:t.reference}}));},onHidden:function onHidden(t){_this7.panelContainer&&(_this7.panelContainer.style.display="none"),_this7.dispatchEvent(new CustomEvent("nile-after-hide",{detail:{instance:t,target:t.reference}}));}};this.tippyInstance=r(this.anchorEl,e),this.open&&queueMicrotask(function(){var _this7$tippyInstance;return(_this7$tippyInstance=_this7.tippyInstance)===null||_this7$tippyInstance===void 0?void 0:_this7$tippyInstance.show();});}},{key:"_destroyTippy",value:function _destroyTippy(){this.tippyInstance&&(this.tippyInstance.destroy(),this.tippyInstance=null),this.panelContainer&&(this.panelContainer.style.display="none",this.panelContainer.parentElement!==this&&this.appendChild(this.panelContainer));}}],[{key:"prefersReducedMotion",get:function get(){return _d._reducedMotionQuery||(_d._reducedMotionQuery=window.matchMedia("(prefers-reduced-motion: reduce)")),_d._reducedMotionQuery.matches;}},{key:"styles",get:function get(){return[s];}}]);}(n));p._groups=new Map(),p._reducedMotionQuery=null,t([i({type:String})],p.prototype,"placement",void 0),t([i({type:String})],p.prototype,"trigger",void 0),t([i({type:Number})],p.prototype,"distance",void 0),t([i({type:Number})],p.prototype,"skidding",void 0),t([i({type:String,reflect:!0})],p.prototype,"arrow",void 0),t([i({type:String,reflect:!0})],p.prototype,"animation",void 0),t([i({type:String,reflect:!0})],p.prototype,"duration",void 0),t([i({type:String,reflect:!0})],p.prototype,"delay",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"interactive",void 0),t([i({type:Number,reflect:!0})],p.prototype,"interactiveBorder",void 0),t([i({type:String,reflect:!0})],p.prototype,"maxWidth",void 0),t([i({type:Number,reflect:!0})],p.prototype,"zIndex",void 0),t([i({type:String,reflect:!0})],p.prototype,"followCursor",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"hideOnClick",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"inertia",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"allowHTML",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"flip",void 0),t([i({type:String,attribute:"for"})],p.prototype,"for",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"open",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"preventOverlayClose",void 0),t([i({type:String,reflect:!0})],p.prototype,"title",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"disabled",void 0),t([i({type:String,reflect:!0})],p.prototype,"width",void 0),t([i({type:String,reflect:!0})],p.prototype,"height",void 0),t([i({type:String,reflect:!0})],p.prototype,"group",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"closeOnEscape",void 0),t([i({type:String,reflect:!0,attribute:!0})],p.prototype,"panelClass",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"enableVisibilityEffect",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"enableTabClose",void 0),_export("N",p=_d=t([e("nile-floating-panel")],p));}};});
|
|
2
2
|
//# sourceMappingURL=nile-floating-panel.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","./nile-inline-sidebar-item.css.cjs.js","../internal/nile-element.cjs.js","lit/directives/class-map.js","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js"],function(_export,_context){"use strict";var t,i,e,s,n,r,o,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,l;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){i=_lit.html;},function(_litDecoratorsJs){e=_litDecoratorsJs.property;s=_litDecoratorsJs.customElement;},function(_nileInlineSidebarItemCssCjsJs){n=_nileInlineSidebarItemCssCjsJs.s;},function(_internalNileElementCjsJs){r=_internalNileElementCjsJs.N;},function(_litDirectivesClassMapJs){o=_litDirectivesClassMapJs.classMap;},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){}],execute:function execute(){_export("N",l=/*#__PURE__*/function(_r){function l(){var _this;_classCallCheck(this,l);_this=_callSuper(this,l,arguments),_this.active=!1,_this.disabled=!1,_this.tooltip=!1,_this.variant="minimal",_this._handleHostKeyDown=function(t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),_this._select(t));};return _this;}_inherits(l,_r);return _createClass(l,[{key:"firstUpdated",value:function firstUpdated(t){_superPropGet(l,"firstUpdated",this,3)([t]),this.syncBodyAndHeaderStates();}},{key:"updated",value:function updated(t){_superPropGet(l,"updated",this,3)([t]),(t.has("disabled")||t.has("active"))&&this.syncBodyAndHeaderStates();}},{key:"syncBodyAndHeaderStates",value:function syncBodyAndHeaderStates(){var t=[this.querySelector('[slot="body"]'),this.querySelector('[slot="header"]')],i={disabled:this.disabled,active:this.active};t.forEach(function(t){t&&Object.entries(i).forEach(function(_ref){var _ref2=_slicedToArray(_ref,2),i=_ref2[0],e=_ref2[1];i in t&&(t[i]=e);});});}},{key:"connectedCallback",value:function connectedCallback(){_superPropGet(l,"connectedCallback",this,3)([]),this.hasAttribute("tabindex")||this.setAttribute("tabindex",this.disabled?"-1":"0"),this.hasAttribute("role")||this.setAttribute("role","menuitem"),this.addEventListener("keydown",this._handleHostKeyDown);}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(l,"disconnectedCallback",this,3)([]),this.removeEventListener("keydown",this._handleHostKeyDown);}},{key:"_select",value:function _select(t){var _this2=this,_this$textContent;if(this.disabled)return t.preventDefault(),void t.stopPropagation();var i=this.closest("nile-inline-sidebar");if(i){i.querySelectorAll("nile-inline-sidebar-item").forEach(function(t){return t.active=t===_this2;});}var e=((_this$textContent=this.textContent)===null||_this$textContent===void 0?void 0:_this$textContent.trim())||"";this.dispatchEvent(new CustomEvent("nile-click",{detail:{item:this,href:this.href,text:e},bubbles:!0,composed:!0})),this.href&&(window.location.href=this.href);}},{key:"handleClick",value:function handleClick(t){this._select(t);}},{key:"render",value:function render(){return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n class=","\n @click=","\n role=\"menuitem\"\n style=","\n aria-disabled=","\n >\n ","\n </div>\n "])),o({item:!0,"item--rich":"rich"===this.variant}),this.handleClick,"rich"===this.variant?"border-radius:
|
|
1
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","./nile-inline-sidebar-item.css.cjs.js","../internal/nile-element.cjs.js","lit/directives/class-map.js","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js"],function(_export,_context){"use strict";var t,i,e,s,n,r,o,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,l;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){i=_lit.html;},function(_litDecoratorsJs){e=_litDecoratorsJs.property;s=_litDecoratorsJs.customElement;},function(_nileInlineSidebarItemCssCjsJs){n=_nileInlineSidebarItemCssCjsJs.s;},function(_internalNileElementCjsJs){r=_internalNileElementCjsJs.N;},function(_litDirectivesClassMapJs){o=_litDirectivesClassMapJs.classMap;},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){}],execute:function execute(){_export("N",l=/*#__PURE__*/function(_r){function l(){var _this;_classCallCheck(this,l);_this=_callSuper(this,l,arguments),_this.active=!1,_this.disabled=!1,_this.tooltip=!1,_this.variant="minimal",_this._handleHostKeyDown=function(t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),_this._select(t));};return _this;}_inherits(l,_r);return _createClass(l,[{key:"firstUpdated",value:function firstUpdated(t){_superPropGet(l,"firstUpdated",this,3)([t]),this.syncBodyAndHeaderStates();}},{key:"updated",value:function updated(t){_superPropGet(l,"updated",this,3)([t]),(t.has("disabled")||t.has("active"))&&this.syncBodyAndHeaderStates();}},{key:"syncBodyAndHeaderStates",value:function syncBodyAndHeaderStates(){var t=[this.querySelector('[slot="body"]'),this.querySelector('[slot="header"]')],i={disabled:this.disabled,active:this.active};t.forEach(function(t){t&&Object.entries(i).forEach(function(_ref){var _ref2=_slicedToArray(_ref,2),i=_ref2[0],e=_ref2[1];i in t&&(t[i]=e);});});}},{key:"connectedCallback",value:function connectedCallback(){_superPropGet(l,"connectedCallback",this,3)([]),this.hasAttribute("tabindex")||this.setAttribute("tabindex",this.disabled?"-1":"0"),this.hasAttribute("role")||this.setAttribute("role","menuitem"),this.addEventListener("keydown",this._handleHostKeyDown);}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(l,"disconnectedCallback",this,3)([]),this.removeEventListener("keydown",this._handleHostKeyDown);}},{key:"_select",value:function _select(t){var _this2=this,_this$textContent;if(this.disabled)return t.preventDefault(),void t.stopPropagation();var i=this.closest("nile-inline-sidebar");if(i){i.querySelectorAll("nile-inline-sidebar-item").forEach(function(t){return t.active=t===_this2;});}var e=((_this$textContent=this.textContent)===null||_this$textContent===void 0?void 0:_this$textContent.trim())||"";this.dispatchEvent(new CustomEvent("nile-click",{detail:{item:this,href:this.href,text:e},bubbles:!0,composed:!0})),this.href&&(window.location.href=this.href);}},{key:"handleClick",value:function handleClick(t){this._select(t);}},{key:"render",value:function render(){return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div\n class=","\n @click=","\n role=\"menuitem\"\n style=","\n aria-disabled=","\n >\n ","\n </div>\n "])),o({item:!0,"item--rich":"rich"===this.variant}),this.handleClick,"rich"===this.variant?"border-radius: 4px 0 0 4px;":"",this.disabled,"minimal"===this.variant?this.href?i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<a href="," @click=","><slot></slot></a>"])),this.href,function(t){return t.preventDefault();}):i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<slot></slot>"]))):this.href?i(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<a\n href=","\n @click=","\n >\n <div class=\"header-content\" part=\"header-content\">\n <slot name=\"header\"></slot>\n </div>\n <div class=\"body-content\" part=\"body-content\">\n <slot name=\"body\"></slot>\n </div>\n </a>"])),this.href,function(t){return t.preventDefault();}):i(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n <div class=\"header-content\" part=\"header-content\">\n <slot name=\"header\"></slot>\n </div>\n <div class=\"body-content\" part=\"body-content\">\n <slot name=\"body\"></slot>\n </div>\n "]))));}}],[{key:"styles",get:function get(){return[n];}}]);}(r));t([e({type:Boolean,reflect:!0})],l.prototype,"active",void 0),t([e({type:Boolean,reflect:!0})],l.prototype,"disabled",void 0),t([e({type:String})],l.prototype,"href",void 0),t([e({type:Boolean,reflect:!0})],l.prototype,"tooltip",void 0),t([e({type:String,reflect:!0,attribute:!0})],l.prototype,"variant",void 0),t([e({type:String,reflect:!0})],l.prototype,"panel",void 0),_export("N",l=t([s("nile-inline-sidebar-item")],l));}};});
|
|
2
2
|
//# sourceMappingURL=nile-inline-sidebar-item.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-inline-sidebar-item.cjs.js","sources":["../../../src/nile-inline-sidebar-item/nile-inline-sidebar-item.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2025\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, CSSResultArray, TemplateResult, PropertyValues } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { styles } from './nile-inline-sidebar-item.css';\nimport NileElement from '../internal/nile-element';\nimport { classMap } from 'lit/directives/class-map.js';\n\n/**\n * Nile inline sidebar item.\n *\n * @tag nile-inlinesidebar-item\n *\n * @attr active - Marks the item as active (selected).\n * @attr disabled - Marks the item as disabled (non-interactive).\n * @attr href - Optional URL to navigate to when the item is clicked.\n *\n * @slot - Default slot for the item text or content.\n *\n * @fires nile-select - Emitted when the item is clicked (not disabled).\n * detail: { item: this, href?: string }\n */\n@customElement('nile-inline-sidebar-item')\nexport class NileInlineSidebarItem extends NileElement {\n @property({ type: Boolean, reflect: true }) active = false;\n @property({ type: Boolean, reflect: true }) disabled = false;\n @property({ type: String }) href?: string;\n @property({ type: Boolean, reflect: true }) tooltip = false;\n @property({ type: String, reflect: true, attribute: true }) variant?: 'minimal' | 'rich' = 'minimal';\n\n /** Links this item to a `nile-inline-sidebar-panel` by matching its `name` property. */\n @property({ type: String, reflect: true }) panel?: string;\n\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n\n firstUpdated(changedProperties: PropertyValues) {\n super.firstUpdated(changedProperties);\n this.syncBodyAndHeaderStates();\n }\n\n updated(changedProperties: PropertyValues) {\n super.updated(changedProperties);\n if (changedProperties.has('disabled') || changedProperties.has('active')) {\n this.syncBodyAndHeaderStates();\n }\n }\n\n private syncBodyAndHeaderStates() {\n const elements = [\n this.querySelector('[slot=\"body\"]'),\n this.querySelector('[slot=\"header\"]')\n ] as (HTMLElement | null)[];\n\n const props = {\n disabled: this.disabled,\n active: this.active\n };\n\n elements.forEach(el => {\n if (!el) return;\n\n Object.entries(props).forEach(([key, value]) => {\n if (key in el) {\n (el as any)[key] = value;\n }\n });\n });\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (!this.hasAttribute('tabindex')) {\n this.setAttribute('tabindex', this.disabled ? '-1' : '0');\n }\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'menuitem');\n }\n this.addEventListener('keydown', this._handleHostKeyDown);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('keydown', this._handleHostKeyDown);\n }\n\n private _handleHostKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n this._select(e);\n }\n };\n\n private _select(e: Event) {\n if (this.disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n\n const parent = this.closest('nile-inline-sidebar');\n if (parent) {\n const allItems = parent.querySelectorAll('nile-inline-sidebar-item');\n allItems.forEach((item) => (item as NileInlineSidebarItem).active = item === this);\n }\n\n const text = this.textContent?.trim() || '';\n\n this.dispatchEvent(\n new CustomEvent('nile-click', {\n detail: { item: this, href: this.href, text },\n bubbles: true,\n composed: true,\n }),\n );\n\n if (this.href) {\n window.location.href = this.href;\n }\n }\n\n private handleClick(e: Event) {\n this._select(e);\n }\n\n public render(): TemplateResult {\n return html`\n <div\n class=${classMap({ 'item': true, 'item--rich': this.variant === 'rich' })}\n @click=${this.handleClick}\n role=\"menuitem\"\n style=${this.variant === 'rich' ? 'border-radius: 0px;' : ''}\n aria-disabled=${this.disabled}\n >\n ${this.variant === 'minimal'\n ? this.href\n ? html`<a href=${this.href} @click=${(e: Event) => e.preventDefault()}><slot></slot></a>`\n : html`<slot></slot>`\n : this.href\n ? html`<a\n href=${this.href}\n @click=${(e: Event) => e.preventDefault()}\n >\n <div class=\"header-content\" part=\"header-content\">\n <slot name=\"header\"></slot>\n </div>\n <div class=\"body-content\" part=\"body-content\">\n <slot name=\"body\"></slot>\n </div>\n </a>`\n : html`\n <div class=\"header-content\" part=\"header-content\">\n <slot name=\"header\"></slot>\n </div>\n <div class=\"body-content\" part=\"body-content\">\n <slot name=\"body\"></slot>\n </div>\n `}\n </div>\n `;\n }\n\n\n \n}\n\nexport default NileInlineSidebarItem;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-inline-sidebar-item': NileInlineSidebarItem;\n }\n}\n"],"names":["NileInlineSidebarItem","l","this","active","disabled","tooltip","variant","_handleHostKeyDown","e","key","preventDefault","_select","_this","_inherits","_r","_createClass","value","firstUpdated","changedProperties","super","syncBodyAndHeaderStates","updated","has","elements","querySelector","props","forEach","el","Object","entries","_ref","connectedCallback","hasAttribute","setAttribute","addEventListener","disconnectedCallback","removeEventListener","stopPropagation","parent","closest","querySelectorAll","item","text","textContent","trim","dispatchEvent","CustomEvent","detail","href","bubbles","composed","window","location","handleClick","render","html","_templateObject","_taggedTemplateLiteral","classMap","_templateObject2","_templateObject3","_templateObject4","_templateObject5","get","styles","NileElement","__decorate","property","type","Boolean","reflect","prototype","String","attribute","customElement"],"mappings":"03KA4BaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,qEACuCC,EAAAA,KAAAA,CAAMC,MAAG,CAAA,CAAA,CAAA,CACTD,KAAAA,CAAQE,QAAG,CAAA,CAAA,CAAA,CAEXF,KAAAA,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AS,CAAA,CAAEC,KAAMI,MAAQF,CAAAA,OAAAA,CAAAA,CAAS,CAAMG,CAAAA,SAAAA,CAAAA,CAAW,KAAiDzE,CAAAuE,CAAAA,SAAAA,CAAA,SAAA,CAAA,IAAA,EAAA,CAAA,CAG1DL,EAAA,CAA1CC,CAAAA,CAAS,CAAEC,IAAAA,CAAMI,OAAQF,OAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuBtE,CAAAuE,CAAAA,SAAAA,CAAA,YAAA,EAR/CvE,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAqBkE,EAAA,CADjCQ,CAAAA,CAAc,6BACF1E"}
|
|
1
|
+
{"version":3,"file":"nile-inline-sidebar-item.cjs.js","sources":["../../../src/nile-inline-sidebar-item/nile-inline-sidebar-item.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2025\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, CSSResultArray, TemplateResult, PropertyValues } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { styles } from './nile-inline-sidebar-item.css';\nimport NileElement from '../internal/nile-element';\nimport { classMap } from 'lit/directives/class-map.js';\n\n/**\n * Nile inline sidebar item.\n *\n * @tag nile-inlinesidebar-item\n *\n * @attr active - Marks the item as active (selected).\n * @attr disabled - Marks the item as disabled (non-interactive).\n * @attr href - Optional URL to navigate to when the item is clicked.\n *\n * @slot - Default slot for the item text or content.\n *\n * @fires nile-select - Emitted when the item is clicked (not disabled).\n * detail: { item: this, href?: string }\n */\n@customElement('nile-inline-sidebar-item')\nexport class NileInlineSidebarItem extends NileElement {\n @property({ type: Boolean, reflect: true }) active = false;\n @property({ type: Boolean, reflect: true }) disabled = false;\n @property({ type: String }) href?: string;\n @property({ type: Boolean, reflect: true }) tooltip = false;\n @property({ type: String, reflect: true, attribute: true }) variant?: 'minimal' | 'rich' = 'minimal';\n\n /** Links this item to a `nile-inline-sidebar-panel` by matching its `name` property. */\n @property({ type: String, reflect: true }) panel?: string;\n\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n\n firstUpdated(changedProperties: PropertyValues) {\n super.firstUpdated(changedProperties);\n this.syncBodyAndHeaderStates();\n }\n\n updated(changedProperties: PropertyValues) {\n super.updated(changedProperties);\n if (changedProperties.has('disabled') || changedProperties.has('active')) {\n this.syncBodyAndHeaderStates();\n }\n }\n\n private syncBodyAndHeaderStates() {\n const elements = [\n this.querySelector('[slot=\"body\"]'),\n this.querySelector('[slot=\"header\"]')\n ] as (HTMLElement | null)[];\n\n const props = {\n disabled: this.disabled,\n active: this.active\n };\n\n elements.forEach(el => {\n if (!el) return;\n\n Object.entries(props).forEach(([key, value]) => {\n if (key in el) {\n (el as any)[key] = value;\n }\n });\n });\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (!this.hasAttribute('tabindex')) {\n this.setAttribute('tabindex', this.disabled ? '-1' : '0');\n }\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'menuitem');\n }\n this.addEventListener('keydown', this._handleHostKeyDown);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('keydown', this._handleHostKeyDown);\n }\n\n private _handleHostKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n this._select(e);\n }\n };\n\n private _select(e: Event) {\n if (this.disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n\n const parent = this.closest('nile-inline-sidebar');\n if (parent) {\n const allItems = parent.querySelectorAll('nile-inline-sidebar-item');\n allItems.forEach((item) => (item as NileInlineSidebarItem).active = item === this);\n }\n\n const text = this.textContent?.trim() || '';\n\n this.dispatchEvent(\n new CustomEvent('nile-click', {\n detail: { item: this, href: this.href, text },\n bubbles: true,\n composed: true,\n }),\n );\n\n if (this.href) {\n window.location.href = this.href;\n }\n }\n\n private handleClick(e: Event) {\n this._select(e);\n }\n\n public render(): TemplateResult {\n return html`\n <div\n class=${classMap({ 'item': true, 'item--rich': this.variant === 'rich' })}\n @click=${this.handleClick}\n role=\"menuitem\"\n style=${this.variant === 'rich' ? 'border-radius: 4px 0 0 4px;' : ''}\n aria-disabled=${this.disabled}\n >\n ${this.variant === 'minimal'\n ? this.href\n ? html`<a href=${this.href} @click=${(e: Event) => e.preventDefault()}><slot></slot></a>`\n : html`<slot></slot>`\n : this.href\n ? html`<a\n href=${this.href}\n @click=${(e: Event) => e.preventDefault()}\n >\n <div class=\"header-content\" part=\"header-content\">\n <slot name=\"header\"></slot>\n </div>\n <div class=\"body-content\" part=\"body-content\">\n <slot name=\"body\"></slot>\n </div>\n </a>`\n : html`\n <div class=\"header-content\" part=\"header-content\">\n <slot name=\"header\"></slot>\n </div>\n <div class=\"body-content\" part=\"body-content\">\n <slot name=\"body\"></slot>\n </div>\n `}\n </div>\n `;\n }\n\n\n \n}\n\nexport default NileInlineSidebarItem;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-inline-sidebar-item': NileInlineSidebarItem;\n }\n}\n"],"names":["NileInlineSidebarItem","l","this","active","disabled","tooltip","variant","_handleHostKeyDown","e","key","preventDefault","_select","_this","_inherits","_r","_createClass","value","firstUpdated","changedProperties","super","syncBodyAndHeaderStates","updated","has","elements","querySelector","props","forEach","el","Object","entries","_ref","connectedCallback","hasAttribute","setAttribute","addEventListener","disconnectedCallback","removeEventListener","stopPropagation","parent","closest","querySelectorAll","item","text","textContent","trim","dispatchEvent","CustomEvent","detail","href","bubbles","composed","window","location","handleClick","render","html","_templateObject","_taggedTemplateLiteral","classMap","_templateObject2","_templateObject3","_templateObject4","_templateObject5","get","styles","NileElement","__decorate","property","type","Boolean","reflect","prototype","String","attribute","customElement"],"mappings":"03KA4BaA,CAAAA,uBAAAA,EAAAA,EAAN,SAAAC,EAAA,qEACuCC,EAAAA,KAAAA,CAAMC,MAAG,CAAA,CAAA,CAAA,CACTD,KAAAA,CAAQE,QAAG,CAAA,CAAA,CAAA,CAEXF,KAAAA,CAAOG,OAAA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EC,KAAMI,MAAQF,CAAAA,OAAAA,CAAAA,CAAS,CAAMG,CAAAA,SAAAA,CAAAA,CAAW,KAAiDzE,CAAAuE,CAAAA,SAAAA,CAAA,SAAA,CAAA,IAAA,EAAA,CAAA,CAG1DL,EAAA,CAA1CC,CAAAA,CAAS,CAAEC,IAAAA,CAAMI,OAAQF,OAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuBtE,CAAAuE,CAAAA,SAAAA,CAAA,YAAA,EAR/CvE,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAqBkE,EAAA,CADjCQ,CAAAA,CAAc,6BACF1E"}
|
|
@@ -3,7 +3,7 @@ import{__decorate as t}from"tslib";import{html as e}from"lit";import{property as
|
|
|
3
3
|
class=${o({item:!0,"item--rich":"rich"===this.variant})}
|
|
4
4
|
@click=${this.handleClick}
|
|
5
5
|
role="menuitem"
|
|
6
|
-
style=${"rich"===this.variant?"border-radius:
|
|
6
|
+
style=${"rich"===this.variant?"border-radius: 4px 0 0 4px;":""}
|
|
7
7
|
aria-disabled=${this.disabled}
|
|
8
8
|
>
|
|
9
9
|
${"minimal"===this.variant?this.href?e`<a href=${this.href} @click=${t=>t.preventDefault()}><slot></slot></a>`:e`<slot></slot>`:this.href?e`<a
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["lit"],function(_export,_context){"use strict";var e,_templateObject,t;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){e=_lit.css;}],execute:function execute(){_export("s",t=e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n\t:host {\n\t\tfont-family: var(--nile-font-family-sans-serif, var(--ng-font-family-body));\n\t}\n\t.item-header {\n\t\tdisplay: flex;\n\t\tgap: var(--nile-spacing-xs, var(--ng-spacing-xs));\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\talign-items: center;\n\t}\n\t.item-header .body-content .header-text {\n\t\tdisplay: block;\n\t\tfont-weight: var(--nile-font-weight-semibold, var(--ng-font-weight-semibold));\n\t\tfont-size: var(--nile-type-scale-4, var(--ng-font-size-text-sm));\n\t\tline-height: var(--nile-line-height-medium, var(--ng-line-height-text-sm));\n\t\tcolor: var(--nile-colors-dark-
|
|
1
|
+
System.register(["lit"],function(_export,_context){"use strict";var e,_templateObject,t;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){e=_lit.css;}],execute:function execute(){_export("s",t=e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n\t:host {\n\t\tfont-family: var(--nile-font-family-sans-serif, var(--ng-font-family-body));\n\t}\n\t.item-header {\n\t\tdisplay: flex;\n\t\tgap: var(--nile-spacing-xs, var(--ng-spacing-xs));\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\talign-items: center;\n\t}\n\t.item-header .body-content .header-text {\n\t\tdisplay: block;\n\t\tfont-family: var(--nile-font-family-medium, var(--ng-font-family-body));\n\t\tfont-weight: var(--nile-font-weight-semibold, var(--ng-font-weight-semibold));\n\t\tfont-size: var(--nile-type-scale-4, var(--ng-font-size-text-sm));\n\t\tline-height: var(--nile-line-height-medium, var(--ng-line-height-text-sm));\n\t\tcolor: var(--nile-colors-dark-500, var(--ng-colors-text-primary-900));\n\t}\n\t:host([active]) .item-header .body-content .header-text {\n\t\tfont-weight: var(--nile-font-weight-medium, var(--ng-font-weight-medium));\n\t\tcolor: var(--nile-colors-primary-700, var(--ng-colors-text-brand-secondary-700));\n\t}\n\n\t:host([disabled]) .item-header .body-content .header-text {\n\t\tcolor: var(--nile-colors-neutral-500, var(--ng-colors-text-disabled));\n\t}\n"]))));}};});
|
|
2
2
|
//# sourceMappingURL=nile-inline-sidebar-item-header.css.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-inline-sidebar-item-header.css.cjs.js","sources":["../../../src/nile-inline-sidebar-item-header/nile-inline-sidebar-item-header.css.ts"],"sourcesContent":["/**\n* Copyright Aquera Inc 2026\n*\n* This source code is licensed under the BSD-3-Clause license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\nimport {css} from 'lit';\n\nexport const styles = css`\n\t:host {\n\t\tfont-family: var(--nile-font-family-sans-serif, var(--ng-font-family-body));\n\t}\n\t.item-header {\n\t\tdisplay: flex;\n\t\tgap: var(--nile-spacing-xs, var(--ng-spacing-xs));\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\talign-items: center;\n\t}\n\t.item-header .body-content .header-text {\n\t\tdisplay: block;\n\t\tfont-weight: var(--nile-font-weight-semibold, var(--ng-font-weight-semibold));\n\t\tfont-size: var(--nile-type-scale-4, var(--ng-font-size-text-sm));\n\t\tline-height: var(--nile-line-height-medium, var(--ng-line-height-text-sm));\n\t\tcolor: var(--nile-colors-dark-
|
|
1
|
+
{"version":3,"file":"nile-inline-sidebar-item-header.css.cjs.js","sources":["../../../src/nile-inline-sidebar-item-header/nile-inline-sidebar-item-header.css.ts"],"sourcesContent":["/**\n* Copyright Aquera Inc 2026\n*\n* This source code is licensed under the BSD-3-Clause license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\nimport {css} from 'lit';\n\nexport const styles = css`\n\t:host {\n\t\tfont-family: var(--nile-font-family-sans-serif, var(--ng-font-family-body));\n\t}\n\t.item-header {\n\t\tdisplay: flex;\n\t\tgap: var(--nile-spacing-xs, var(--ng-spacing-xs));\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\talign-items: center;\n\t}\n\t.item-header .body-content .header-text {\n\t\tdisplay: block;\n\t\tfont-family: var(--nile-font-family-medium, var(--ng-font-family-body));\n\t\tfont-weight: var(--nile-font-weight-semibold, var(--ng-font-weight-semibold));\n\t\tfont-size: var(--nile-type-scale-4, var(--ng-font-size-text-sm));\n\t\tline-height: var(--nile-line-height-medium, var(--ng-line-height-text-sm));\n\t\tcolor: var(--nile-colors-dark-500, var(--ng-colors-text-primary-900));\n\t}\n\t:host([active]) .item-header .body-content .header-text {\n\t\tfont-weight: var(--nile-font-weight-medium, var(--ng-font-weight-medium));\n\t\tcolor: var(--nile-colors-primary-700, var(--ng-colors-text-brand-secondary-700));\n\t}\n\n\t:host([disabled]) .item-header .body-content .header-text {\n\t\tcolor: var(--nile-colors-neutral-500, var(--ng-colors-text-disabled));\n\t}\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTASaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
|
|
@@ -11,10 +11,11 @@ import{css as e}from"lit";const t=e`
|
|
|
11
11
|
}
|
|
12
12
|
.item-header .body-content .header-text {
|
|
13
13
|
display: block;
|
|
14
|
+
font-family: var(--nile-font-family-medium, var(--ng-font-family-body));
|
|
14
15
|
font-weight: var(--nile-font-weight-semibold, var(--ng-font-weight-semibold));
|
|
15
16
|
font-size: var(--nile-type-scale-4, var(--ng-font-size-text-sm));
|
|
16
17
|
line-height: var(--nile-line-height-medium, var(--ng-line-height-text-sm));
|
|
17
|
-
color: var(--nile-colors-dark-
|
|
18
|
+
color: var(--nile-colors-dark-500, var(--ng-colors-text-primary-900));
|
|
18
19
|
}
|
|
19
20
|
:host([active]) .item-header .body-content .header-text {
|
|
20
21
|
font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-medium));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./nile-lite-tooltip.cjs.js","tslib","lit/decorators.js","./nile-lite-tooltip.css.cjs.js","lit","../internal/nile-element.cjs.js","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js","../tippy.esm-78baa8f2.cjs.js","./utils.cjs.js","../utilities/visibility-manager.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileLiteTooltipCjsJs){_export("NileliteTooltip",_nileLiteTooltipCjsJs.N);},function(_tslib){},function(_litDecoratorsJs){},function(_nileLiteTooltipCssCjsJs){},function(_lit){},function(_internalNileElementCjsJs){},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){},function(
|
|
1
|
+
System.register(["./nile-lite-tooltip.cjs.js","tslib","lit/decorators.js","./nile-lite-tooltip.css.cjs.js","lit","../internal/nile-element.cjs.js","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js","../tippy.esm-78baa8f2.cjs.js","./utils.cjs.js","../utilities/visibility-manager.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileLiteTooltipCjsJs){_export("NileliteTooltip",_nileLiteTooltipCjsJs.N);},function(_tslib){},function(_litDecoratorsJs){},function(_nileLiteTooltipCssCjsJs){},function(_lit){},function(_internalNileElementCjsJs){},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){},function(_tippyEsm006CjsJs){},function(_utilsCjsJs){},function(_utilitiesVisibilityManagerCjsJs){}],execute:function execute(){}};});
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit/decorators.js","./nile-lite-tooltip.css.cjs.js","../internal/nile-element.cjs.js","../tippy.esm-78baa8f2.cjs.js","./utils.cjs.js","../utilities/visibility-manager.cjs.js","lit","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js"],function(_export,_context){"use strict";var t,i,e,s,o,n,h,r,a,l,c,d,p;function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_litDecoratorsJs){i=_litDecoratorsJs.property;e=_litDecoratorsJs.customElement;},function(_nileLiteTooltipCssCjsJs){s=_nileLiteTooltipCssCjsJs.s;},function(_internalNileElementCjsJs){o=_internalNileElementCjsJs.N;},function(_tippyEsm005CjsJs){n=_tippyEsm005CjsJs.R;h=_tippyEsm005CjsJs.f;r=_tippyEsm005CjsJs.t;a=_tippyEsm005CjsJs.c;},function(_utilsCjsJs){l=_utilsCjsJs.p;c=_utilsCjsJs.a;},function(_utilitiesVisibilityManagerCjsJs){d=_utilitiesVisibilityManagerCjsJs.V;},function(_lit){},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){}],execute:function execute(){_export("N",p=/*#__PURE__*/function(_o){function p(){var _this;_classCallCheck(this,p);_this=_callSuper(this,p),_this["for"]=null,_this.content="",_this.size="small",_this.duration=200,_this.interactive=!1,_this.placement="top",_this.disabled=!1,_this.distance=8,_this.skidding=0,_this.open=!1,_this.trigger="mouseenter focus",_this.allowHTML=!1,_this.followCursor=!1,_this.arrow="default",_this.singleton=!1,_this.enableRecursiveMode=!1,_this.delay=0,_this.maxWidth="auto",_this.zIndex=9999,_this.hideOnClick=!0,_this.inertia=!1,_this.interactiveBorder=2,_this.enableVisibilityEffect=!1,_this.enableTabClose=!1;return _this;}_inherits(p,_o);return _createClass(p,[{key:"createRenderRoot",value:function createRenderRoot(){return this;}},{key:"firstUpdated",value:function firstUpdated(){var _this2=this;this.attachTooltip();var t=this["for"]&&document.getElementById(this["for"])||this.firstElementChild;this.visibilityManager=new d({host:this,target:t,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:function isOpen(){return _this2.open;},onAnchorOutOfView:function onAnchorOutOfView(){_this2.open=!1,_this2.hideAllTooltips(),_this2.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"});},onDocumentHidden:function onDocumentHidden(){_this2.open=!1,_this2.hideAllTooltips(),_this2.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"});},emit:function emit(t,i){return _this2.emit("nile-".concat(t),i);}});}},{key:"refresh",value:function refresh(){this.attachTooltip();}},{key:"hasValidContent",value:function hasValidContent(){var _ref,_this$content;var t=(_ref=(_this$content=this.content)!==null&&_this$content!==void 0?_this$content:this.getAttribute("data-tippy-content"))!==null&&_ref!==void 0?_ref:"";return"string"==typeof t&&t.trim().length>0;}},{key:"attachTooltip",value:function attachTooltip(){var _this3=this;if(this.destroyTooltips(),this.disabled||!this.enableRecursiveMode&&!this.singleton&&!this.hasValidContent())return;var t={content:this.content||this.getAttribute("data-tippy-content")||void 0,placement:this.placement,trigger:this.trigger,offset:[this.skidding,this.distance],theme:"lite",animation:"fade",interactive:this.interactive,arrow:n,duration:l(this.duration),allowHTML:this.allowHTML,delay:this.delay,maxWidth:this.maxWidth,zIndex:this.zIndex,hideOnClick:!1,inertia:this.inertia,interactiveBorder:this.interactiveBorder,appendTo:document.body,followCursor:c(this.followCursor),plugins:c(this.followCursor)?[h]:[],onShow:function onShow(t){_this3.open=!0;var i=t.popper.querySelector(".tippy-content");i&&(_this3.width&&(i.style.width=_this3.width),_this3.height&&(i.style.height=_this3.height,i.style.overflow="auto")),_this3.dispatchEvent(new CustomEvent("nile-show",{detail:{instance:t,target:t.reference}})),_this3.dispatchEvent(new CustomEvent("nile-toggle",{detail:{open:!0,instance:t,target:t.reference}}));},onHide:function onHide(t){_this3.open=!1,_this3.dispatchEvent(new CustomEvent("nile-hide",{detail:{instance:t,target:t.reference}})),_this3.dispatchEvent(new CustomEvent("nile-toggle",{detail:{open:!1,instance:t,target:t.reference}}));}};if(this["for"]){var _this$singleInstance$;if(this.singleton&&!this["for"].startsWith("#")&&!document.getElementById(this["for"])){var _i=Array.from(document.querySelectorAll(".".concat(this["for"])));if(_i.length>0)return this.tooltipInstances=_i.map(function(i){var _e$popper$querySelect;var e=r(i,_objectSpread(_objectSpread({},t),{},{content:i.getAttribute("content")||_this3.content}));return(_e$popper$querySelect=e.popper.querySelector(".tippy-box"))!==null&&_e$popper$querySelect!==void 0&&_e$popper$querySelect.classList.add(_this3.size),e;}),this.singletonInstance=a(this.tooltipInstances,{delay:[75,0],arrow:n,moveTransition:"transform 0.15s ease-out"}),void(this.open&&queueMicrotask(function(){var _this3$singletonInsta;return(_this3$singletonInsta=_this3.singletonInstance)===null||_this3$singletonInsta===void 0?void 0:_this3$singletonInsta.show();}));}var _i2=document.getElementById(this["for"]);if(this.singleton&&_i2){var _e=Array.from(_i2.querySelectorAll("[content]"));if(_e.length>0)return this.tooltipInstances=_e.map(function(i){var _e$popper$querySelect2;var e=r(i,_objectSpread(_objectSpread({},t),{},{content:i.getAttribute("content")||_this3.content}));return(_e$popper$querySelect2=e.popper.querySelector(".tippy-box"))!==null&&_e$popper$querySelect2!==void 0&&_e$popper$querySelect2.classList.add(_this3.size),e;}),this.singletonInstance=a(this.tooltipInstances,{delay:[75,0],arrow:n,moveTransition:"transform 0.15s ease-out"}),void(this.open&&queueMicrotask(function(){var _this3$singletonInsta2;return(_this3$singletonInsta2=_this3.singletonInstance)===null||_this3$singletonInsta2===void 0?void 0:_this3$singletonInsta2.show();}));}if(this.targetEl=document.getElementById(this["for"]),!this.targetEl)return;this.id||(this.generatedId="nile-tooltip-".concat(Math.random().toString(36).slice(2,9)),this.id=this.generatedId),this.prevDescribedby=this.targetEl.getAttribute("aria-describedby");var _e2=this.prevDescribedby?"".concat(this.prevDescribedby," ").concat(this.id):this.id;return this.targetEl.setAttribute("aria-describedby",_e2),this.singleInstance=r(this.targetEl,t),this.size&&(_this$singleInstance$=this.singleInstance.popper.querySelector(".tippy-box"))!==null&&_this$singleInstance$!==void 0&&_this$singleInstance$.classList.add(this.size),void(this.open&&queueMicrotask(function(){var _this3$singleInstance;return(_this3$singleInstance=_this3.singleInstance)===null||_this3$singleInstance===void 0?void 0:_this3$singleInstance.show();}));}if(this.enableRecursiveMode){var _i3=Array.from(this.querySelectorAll("[content]")).filter(function(t){var i=t.getAttribute("content");return null!==i&&i.trim().length>0;});_i3.length>0&&(this.tooltipInstances=_i3.map(function(i){var _o$popper$querySelect;var e=i,s=e.getAttribute("content")||_this3.content,o=r(e,_objectSpread(_objectSpread({},t),{},{content:s}));return(_o$popper$querySelect=o.popper.querySelector(".tippy-box"))!==null&&_o$popper$querySelect!==void 0&&_o$popper$querySelect.classList.add(_this3.size),o;}),this.singleton&&this.tooltipInstances.length>1&&(this.singletonInstance=a(this.tooltipInstances,{delay:[75,0],arrow:n,moveTransition:"transform 0.15s ease-out"})),this.open&&(this.singletonInstance?this.singletonInstance.show():this.tooltipInstances.forEach(function(t){return t.show();})));}else{var _i4=this.firstElementChild;if(_i4){var _s$popper$querySelect;var _e3=_i4.getAttribute("content")||this.content,_s=r(_i4,_objectSpread(_objectSpread({},t),{},{content:_e3}));(_s$popper$querySelect=_s.popper.querySelector(".tippy-box"))!==null&&_s$popper$querySelect!==void 0&&_s$popper$querySelect.classList.add(this.size),this.tooltipInstances=[_s],this.open&&_s.show();}}}},{key:"destroyTooltips",value:function destroyTooltips(){var _this$tooltipInstance,_this$singleInstance,_this$singletonInstan,_this4=this;if((_this$tooltipInstance=this.tooltipInstances)!==null&&_this$tooltipInstance!==void 0&&_this$tooltipInstance.forEach(function(t){return t.destroy();}),(_this$singleInstance=this.singleInstance)!==null&&_this$singleInstance!==void 0&&_this$singleInstance.destroy(),(_this$singletonInstan=this.singletonInstance)!==null&&_this$singletonInstan!==void 0&&_this$singletonInstan.destroy(),this.tooltipInstances=void 0,this.singleInstance=void 0,this.singletonInstance=void 0,this.targetEl&&this.id){var _this$targetEl$getAtt;var _t=(_this$targetEl$getAtt=this.targetEl.getAttribute("aria-describedby"))===null||_this$targetEl$getAtt===void 0?void 0:_this$targetEl$getAtt.split(" ").filter(function(t){return t!==_this4.id;}).join(" ").trim();_t?this.targetEl.setAttribute("aria-describedby",_t):this.targetEl.removeAttribute("aria-describedby");}}},{key:"hideAllTooltips",value:function hideAllTooltips(){var _this$singleInstance2,_this$singletonInstan2,_this$tooltipInstance2;(_this$singleInstance2=this.singleInstance)!==null&&_this$singleInstance2!==void 0&&_this$singleInstance2.hide(),(_this$singletonInstan2=this.singletonInstance)!==null&&_this$singletonInstan2!==void 0&&_this$singletonInstan2.hide(),(_this$tooltipInstance2=this.tooltipInstances)===null||_this$tooltipInstance2===void 0?void 0:_this$tooltipInstance2.forEach(function(t){return t.hide();});}},{key:"disconnectedCallback",value:function disconnectedCallback(){var _this$visibilityManag;_superPropGet(p,"disconnectedCallback",this,3)([]),(_this$visibilityManag=this.visibilityManager)!==null&&_this$visibilityManag!==void 0&&_this$visibilityManag.cleanup(),this.destroyTooltips();}},{key:"updated",value:function updated(t){var _this$visibilityManag2,_this$singleInstance3,_this$singletonInstan3,_this$tooltipInstance3,_this$visibilityManag3,_this$singleInstance4,_this$singletonInstan4,_this$tooltipInstance4;_superPropGet(p,"updated",this,3)([t]),["for","content","placement","distance","skidding","trigger","disabled","hoist","size","arrow","singleton"].some(function(i){return t.has(i);})&&this.attachTooltip(),t.has("open")&&(this.open?((_this$visibilityManag2=this.visibilityManager)!==null&&_this$visibilityManag2!==void 0&&_this$visibilityManag2.setup(),(_this$singleInstance3=this.singleInstance)!==null&&_this$singleInstance3!==void 0&&_this$singleInstance3.show(),(_this$singletonInstan3=this.singletonInstance)!==null&&_this$singletonInstan3!==void 0&&_this$singletonInstan3.show(),(_this$tooltipInstance3=this.tooltipInstances)===null||_this$tooltipInstance3===void 0?void 0:_this$tooltipInstance3.forEach(function(t){return t.show();})):((_this$visibilityManag3=this.visibilityManager)!==null&&_this$visibilityManag3!==void 0&&_this$visibilityManag3.cleanup(),(_this$singleInstance4=this.singleInstance)!==null&&_this$singleInstance4!==void 0&&_this$singleInstance4.hide(),(_this$singletonInstan4=this.singletonInstance)!==null&&_this$singletonInstan4!==void 0&&_this$singletonInstan4.hide(),(_this$tooltipInstance4=this.tooltipInstances)===null||_this$tooltipInstance4===void 0?void 0:_this$tooltipInstance4.forEach(function(t){return t.hide();})));}}],[{key:"styles",get:function get(){return[s];}}]);}(o));t([i({type:String,attribute:"for"})],p.prototype,"for",void 0),t([i({type:String,reflect:!0})],p.prototype,"content",void 0),t([i({type:String,reflect:!0})],p.prototype,"size",void 0),t([i({type:String,reflect:!0})],p.prototype,"duration",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"interactive",void 0),t([i({type:String})],p.prototype,"placement",void 0),t([i({type:Boolean})],p.prototype,"disabled",void 0),t([i({type:Number})],p.prototype,"distance",void 0),t([i({type:Number})],p.prototype,"skidding",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"open",void 0),t([i({type:String})],p.prototype,"trigger",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"allowHTML",void 0),t([i({type:String,reflect:!0,attribute:!0})],p.prototype,"followCursor",void 0),t([i({type:String,reflect:!0,attribute:!0})],p.prototype,"arrow",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"singleton",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"enableRecursiveMode",void 0),t([i({type:String,reflect:!0})],p.prototype,"delay",void 0),t([i({type:String,reflect:!0})],p.prototype,"maxWidth",void 0),t([i({type:Number})],p.prototype,"zIndex",void 0),t([i({type:[Boolean,String],reflect:!0})],p.prototype,"hideOnClick",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"inertia",void 0),t([i({type:Number})],p.prototype,"interactiveBorder",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"enableVisibilityEffect",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"enableTabClose",void 0),t([i({type:String,reflect:!0})],p.prototype,"width",void 0),t([i({type:String,reflect:!0})],p.prototype,"height",void 0),_export("N",p=t([e("nile-lite-tooltip")],p));}};});
|
|
1
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit/decorators.js","./nile-lite-tooltip.css.cjs.js","../internal/nile-element.cjs.js","../tippy.esm-78baa8f2.cjs.js","./utils.cjs.js","../utilities/visibility-manager.cjs.js","lit","../internal/accessibility/a11y.state.enum.cjs.js","../internal/accessibility/a11y.property.enum.cjs.js","../internal/accessibility/role.enum.cjs.js"],function(_export,_context){"use strict";var t,i,e,s,o,n,h,r,a,l,c,d,p;function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_litDecoratorsJs){i=_litDecoratorsJs.property;e=_litDecoratorsJs.customElement;},function(_nileLiteTooltipCssCjsJs){s=_nileLiteTooltipCssCjsJs.s;},function(_internalNileElementCjsJs){o=_internalNileElementCjsJs.N;},function(_tippyEsm006CjsJs){n=_tippyEsm006CjsJs.R;h=_tippyEsm006CjsJs.f;r=_tippyEsm006CjsJs.t;a=_tippyEsm006CjsJs.c;},function(_utilsCjsJs){l=_utilsCjsJs.p;c=_utilsCjsJs.a;},function(_utilitiesVisibilityManagerCjsJs){d=_utilitiesVisibilityManagerCjsJs.V;},function(_lit){},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){}],execute:function execute(){_export("N",p=/*#__PURE__*/function(_o){function p(){var _this;_classCallCheck(this,p);_this=_callSuper(this,p),_this["for"]=null,_this.content="",_this.size="small",_this.duration=200,_this.interactive=!1,_this.placement="top",_this.disabled=!1,_this.distance=8,_this.skidding=0,_this.open=!1,_this.trigger="mouseenter focus",_this.allowHTML=!1,_this.followCursor=!1,_this.arrow="default",_this.singleton=!1,_this.enableRecursiveMode=!1,_this.delay=0,_this.maxWidth="auto",_this.zIndex=9999,_this.hideOnClick=!0,_this.inertia=!1,_this.interactiveBorder=2,_this.enableVisibilityEffect=!1,_this.enableTabClose=!1;return _this;}_inherits(p,_o);return _createClass(p,[{key:"createRenderRoot",value:function createRenderRoot(){return this;}},{key:"firstUpdated",value:function firstUpdated(){var _this2=this;this.attachTooltip();var t=this["for"]&&document.getElementById(this["for"])||this.firstElementChild;this.visibilityManager=new d({host:this,target:t,enableVisibilityEffect:this.enableVisibilityEffect,enableTabClose:this.enableTabClose,isOpen:function isOpen(){return _this2.open;},onAnchorOutOfView:function onAnchorOutOfView(){_this2.open=!1,_this2.hideAllTooltips(),_this2.emit("nile-visibility-change",{visible:!1,reason:"anchor-out-of-view"});},onDocumentHidden:function onDocumentHidden(){_this2.open=!1,_this2.hideAllTooltips(),_this2.emit("nile-visibility-change",{visible:!1,reason:"document-hidden"});},emit:function emit(t,i){return _this2.emit("nile-".concat(t),i);}});}},{key:"refresh",value:function refresh(){this.attachTooltip();}},{key:"hasValidContent",value:function hasValidContent(){var _ref,_this$content;var t=(_ref=(_this$content=this.content)!==null&&_this$content!==void 0?_this$content:this.getAttribute("data-tippy-content"))!==null&&_ref!==void 0?_ref:"";return"string"==typeof t&&t.trim().length>0;}},{key:"attachTooltip",value:function attachTooltip(){var _this3=this;if(this.destroyTooltips(),this.disabled||!this.enableRecursiveMode&&!this.singleton&&!this.hasValidContent())return;var t={content:this.content||this.getAttribute("data-tippy-content")||void 0,placement:this.placement,trigger:this.trigger,offset:[this.skidding,this.distance],theme:"lite",animation:"fade",interactive:this.interactive,arrow:n,duration:l(this.duration),allowHTML:this.allowHTML,delay:this.delay,maxWidth:this.maxWidth,zIndex:this.zIndex,hideOnClick:!1,inertia:this.inertia,interactiveBorder:this.interactiveBorder,appendTo:document.body,followCursor:c(this.followCursor),plugins:c(this.followCursor)?[h]:[],onShow:function onShow(t){_this3.open=!0;var i=t.popper.querySelector(".tippy-content");i&&(_this3.width&&(i.style.width=_this3.width),_this3.height&&(i.style.height=_this3.height,i.style.overflow="auto")),_this3.dispatchEvent(new CustomEvent("nile-show",{detail:{instance:t,target:t.reference}})),_this3.dispatchEvent(new CustomEvent("nile-toggle",{detail:{open:!0,instance:t,target:t.reference}}));},onHide:function onHide(t){_this3.open=!1,_this3.dispatchEvent(new CustomEvent("nile-hide",{detail:{instance:t,target:t.reference}})),_this3.dispatchEvent(new CustomEvent("nile-toggle",{detail:{open:!1,instance:t,target:t.reference}}));}};if(this["for"]){var _this$singleInstance$;if(this.singleton&&!this["for"].startsWith("#")&&!document.getElementById(this["for"])){var _i=Array.from(document.querySelectorAll(".".concat(this["for"])));if(_i.length>0)return this.tooltipInstances=_i.map(function(i){var _e$popper$querySelect;var e=r(i,_objectSpread(_objectSpread({},t),{},{content:i.getAttribute("content")||_this3.content}));return(_e$popper$querySelect=e.popper.querySelector(".tippy-box"))!==null&&_e$popper$querySelect!==void 0&&_e$popper$querySelect.classList.add(_this3.size),e;}),this.singletonInstance=a(this.tooltipInstances,{delay:[75,0],arrow:n,moveTransition:"transform 0.15s ease-out"}),void(this.open&&queueMicrotask(function(){var _this3$singletonInsta;return(_this3$singletonInsta=_this3.singletonInstance)===null||_this3$singletonInsta===void 0?void 0:_this3$singletonInsta.show();}));}var _i2=document.getElementById(this["for"]);if(this.singleton&&_i2){var _e=Array.from(_i2.querySelectorAll("[content]"));if(_e.length>0)return this.tooltipInstances=_e.map(function(i){var _e$popper$querySelect2;var e=r(i,_objectSpread(_objectSpread({},t),{},{content:i.getAttribute("content")||_this3.content}));return(_e$popper$querySelect2=e.popper.querySelector(".tippy-box"))!==null&&_e$popper$querySelect2!==void 0&&_e$popper$querySelect2.classList.add(_this3.size),e;}),this.singletonInstance=a(this.tooltipInstances,{delay:[75,0],arrow:n,moveTransition:"transform 0.15s ease-out"}),void(this.open&&queueMicrotask(function(){var _this3$singletonInsta2;return(_this3$singletonInsta2=_this3.singletonInstance)===null||_this3$singletonInsta2===void 0?void 0:_this3$singletonInsta2.show();}));}if(this.targetEl=document.getElementById(this["for"]),!this.targetEl)return;this.id||(this.generatedId="nile-tooltip-".concat(Math.random().toString(36).slice(2,9)),this.id=this.generatedId),this.prevDescribedby=this.targetEl.getAttribute("aria-describedby");var _e2=this.prevDescribedby?"".concat(this.prevDescribedby," ").concat(this.id):this.id;return this.targetEl.setAttribute("aria-describedby",_e2),this.singleInstance=r(this.targetEl,t),this.size&&(_this$singleInstance$=this.singleInstance.popper.querySelector(".tippy-box"))!==null&&_this$singleInstance$!==void 0&&_this$singleInstance$.classList.add(this.size),void(this.open&&queueMicrotask(function(){var _this3$singleInstance;return(_this3$singleInstance=_this3.singleInstance)===null||_this3$singleInstance===void 0?void 0:_this3$singleInstance.show();}));}if(this.enableRecursiveMode){var _i3=Array.from(this.querySelectorAll("[content]")).filter(function(t){var i=t.getAttribute("content");return null!==i&&i.trim().length>0;});_i3.length>0&&(this.tooltipInstances=_i3.map(function(i){var _o$popper$querySelect;var e=i,s=e.getAttribute("content")||_this3.content,o=r(e,_objectSpread(_objectSpread({},t),{},{content:s}));return(_o$popper$querySelect=o.popper.querySelector(".tippy-box"))!==null&&_o$popper$querySelect!==void 0&&_o$popper$querySelect.classList.add(_this3.size),o;}),this.singleton&&this.tooltipInstances.length>1&&(this.singletonInstance=a(this.tooltipInstances,{delay:[75,0],arrow:n,moveTransition:"transform 0.15s ease-out"})),this.open&&(this.singletonInstance?this.singletonInstance.show():this.tooltipInstances.forEach(function(t){return t.show();})));}else{var _i4=this.firstElementChild;if(_i4){var _s$popper$querySelect;var _e3=_i4.getAttribute("content")||this.content,_s=r(_i4,_objectSpread(_objectSpread({},t),{},{content:_e3}));(_s$popper$querySelect=_s.popper.querySelector(".tippy-box"))!==null&&_s$popper$querySelect!==void 0&&_s$popper$querySelect.classList.add(this.size),this.tooltipInstances=[_s],this.open&&_s.show();}}}},{key:"destroyTooltips",value:function destroyTooltips(){var _this$tooltipInstance,_this$singleInstance,_this$singletonInstan,_this4=this;if((_this$tooltipInstance=this.tooltipInstances)!==null&&_this$tooltipInstance!==void 0&&_this$tooltipInstance.forEach(function(t){return t.destroy();}),(_this$singleInstance=this.singleInstance)!==null&&_this$singleInstance!==void 0&&_this$singleInstance.destroy(),(_this$singletonInstan=this.singletonInstance)!==null&&_this$singletonInstan!==void 0&&_this$singletonInstan.destroy(),this.tooltipInstances=void 0,this.singleInstance=void 0,this.singletonInstance=void 0,this.targetEl&&this.id){var _this$targetEl$getAtt;var _t=(_this$targetEl$getAtt=this.targetEl.getAttribute("aria-describedby"))===null||_this$targetEl$getAtt===void 0?void 0:_this$targetEl$getAtt.split(" ").filter(function(t){return t!==_this4.id;}).join(" ").trim();_t?this.targetEl.setAttribute("aria-describedby",_t):this.targetEl.removeAttribute("aria-describedby");}}},{key:"hideAllTooltips",value:function hideAllTooltips(){var _this$singleInstance2,_this$singletonInstan2,_this$tooltipInstance2;(_this$singleInstance2=this.singleInstance)!==null&&_this$singleInstance2!==void 0&&_this$singleInstance2.hide(),(_this$singletonInstan2=this.singletonInstance)!==null&&_this$singletonInstan2!==void 0&&_this$singletonInstan2.hide(),(_this$tooltipInstance2=this.tooltipInstances)===null||_this$tooltipInstance2===void 0?void 0:_this$tooltipInstance2.forEach(function(t){return t.hide();});}},{key:"disconnectedCallback",value:function disconnectedCallback(){var _this$visibilityManag;_superPropGet(p,"disconnectedCallback",this,3)([]),(_this$visibilityManag=this.visibilityManager)!==null&&_this$visibilityManag!==void 0&&_this$visibilityManag.cleanup(),this.destroyTooltips();}},{key:"updated",value:function updated(t){var _this$visibilityManag2,_this$singleInstance3,_this$singletonInstan3,_this$tooltipInstance3,_this$visibilityManag3,_this$singleInstance4,_this$singletonInstan4,_this$tooltipInstance4;_superPropGet(p,"updated",this,3)([t]),["for","content","placement","distance","skidding","trigger","disabled","hoist","size","arrow","singleton"].some(function(i){return t.has(i);})&&this.attachTooltip(),t.has("open")&&(this.open?((_this$visibilityManag2=this.visibilityManager)!==null&&_this$visibilityManag2!==void 0&&_this$visibilityManag2.setup(),(_this$singleInstance3=this.singleInstance)!==null&&_this$singleInstance3!==void 0&&_this$singleInstance3.show(),(_this$singletonInstan3=this.singletonInstance)!==null&&_this$singletonInstan3!==void 0&&_this$singletonInstan3.show(),(_this$tooltipInstance3=this.tooltipInstances)===null||_this$tooltipInstance3===void 0?void 0:_this$tooltipInstance3.forEach(function(t){return t.show();})):((_this$visibilityManag3=this.visibilityManager)!==null&&_this$visibilityManag3!==void 0&&_this$visibilityManag3.cleanup(),(_this$singleInstance4=this.singleInstance)!==null&&_this$singleInstance4!==void 0&&_this$singleInstance4.hide(),(_this$singletonInstan4=this.singletonInstance)!==null&&_this$singletonInstan4!==void 0&&_this$singletonInstan4.hide(),(_this$tooltipInstance4=this.tooltipInstances)===null||_this$tooltipInstance4===void 0?void 0:_this$tooltipInstance4.forEach(function(t){return t.hide();})));}}],[{key:"styles",get:function get(){return[s];}}]);}(o));t([i({type:String,attribute:"for"})],p.prototype,"for",void 0),t([i({type:String,reflect:!0})],p.prototype,"content",void 0),t([i({type:String,reflect:!0})],p.prototype,"size",void 0),t([i({type:String,reflect:!0})],p.prototype,"duration",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"interactive",void 0),t([i({type:String})],p.prototype,"placement",void 0),t([i({type:Boolean})],p.prototype,"disabled",void 0),t([i({type:Number})],p.prototype,"distance",void 0),t([i({type:Number})],p.prototype,"skidding",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"open",void 0),t([i({type:String})],p.prototype,"trigger",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"allowHTML",void 0),t([i({type:String,reflect:!0,attribute:!0})],p.prototype,"followCursor",void 0),t([i({type:String,reflect:!0,attribute:!0})],p.prototype,"arrow",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"singleton",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"enableRecursiveMode",void 0),t([i({type:String,reflect:!0})],p.prototype,"delay",void 0),t([i({type:String,reflect:!0})],p.prototype,"maxWidth",void 0),t([i({type:Number})],p.prototype,"zIndex",void 0),t([i({type:[Boolean,String],reflect:!0})],p.prototype,"hideOnClick",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"inertia",void 0),t([i({type:Number})],p.prototype,"interactiveBorder",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"enableVisibilityEffect",void 0),t([i({type:Boolean,reflect:!0})],p.prototype,"enableTabClose",void 0),t([i({type:String,reflect:!0})],p.prototype,"width",void 0),t([i({type:String,reflect:!0})],p.prototype,"height",void 0),_export("N",p=t([e("nile-lite-tooltip")],p));}};});
|
|
2
2
|
//# sourceMappingURL=nile-lite-tooltip.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["lit"],function(_export,_context){"use strict";var r,_templateObject,o;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){r=_lit.css;}],execute:function execute(){_export("s",o=r(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n display: block;\n --ng-private-outline-transparent: var(--ng-border-width-1) solid transparent;\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing, antialiased));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing, grayscale));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering, optimizeLegibility));\n }\n\n .form-control {\n display: flex;\n flex-direction: column;\n gap: var(--nile-spacing-sm, var(--ng-spacing-1-5));\n align-items: flex-start;\n }\n\n .form-control .form-control__label {\n display: none;\n }\n\n .form-control--has-label .form-control__label {\n display: inline-block;\n color: var(--nile-colors-dark-900, var(--ng-colors-text-secondary-700));\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body ));\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm ));\n font-style: normal;\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-500 ));\n line-height: var(--nile-type-scale-6, var(--ng-line-height-text-sm ));\n letter-spacing: 0.2px;\n }\n\n :host([required]) .form-control--has-label .form-control__label::after {\n content: '*';\n margin-inline-start: -2px;\n color: var(--nile-colors-red-700, var(--ng-colors-text-error-primary-600));\n }\n\n .otp {\n position: relative;\n display: flex;\n align-items: center;\n gap: var(--nile-spacing-md, var(--ng-spacing-2));\n width: fit-content;\n max-width: 100%;\n }\n\n /* ---- Base cell ---- */\n\n .otp__cell {\n box-sizing: border-box;\n width: var(--nile-spacing-5xl, var(--ng-spacing-10));\n height: var(--nile-spacing-5xl, var(--ng-spacing-10));\n min-height: var(--nile-spacing-5xl, var(--ng-spacing-10));\n padding: var(--nile-spacing-xxs, var(--ng-spacing-0-5)) var(--nile-spacing-md, var(--ng-spacing-2));\n border: 1px solid var(--nile-colors-border-field, var(--ng-colors-border-primary));\n border-radius: var(--nile-radius-radius-2xl, var(--ng-radius-lg));\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n box-shadow: var(--nile-box-shadow-1, var(--ng-shadow-xs));\n outline: var(--nile-outline-none, var(--ng-private-outline-transparent));\n color: var(--nile-colors-dark-500, var(--ng-colors-text-placeholder-subtle));\n text-align: center;\n font-family: var(--nile-font-family, var(--ng-font-family-display));\n font-size: var(--nile-type-scale-4, var(--ng-font-size-text-md));\n font-style: normal;\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-500));\n line-height: var(--nile-type-scale-4, var(--ng-line-height-text-md));\n letter-spacing: 0.2px;\n overflow: clip;\n caret-color: transparent;\n cursor: pointer;\n transition: 150ms color, 150ms border, 150ms box-shadow, 150ms background-color, 150ms outline;\n }\n\n .otp__cell[type='password'] {\n font-family: caption;\n letter-spacing: 0;\n }\n /* ---- Hover (mirrors .input--standard:hover) ---- */\n\n .otp:not(.otp--disabled):not(.otp--readonly) .otp__cell:hover {\n border-color: var(--nile-colors-dark-900, var(--ng-colors-border-neutral));\n }\n\n .otp--warning:not(.otp--disabled) .otp__cell:hover {\n border-color: var(--nile-colors-dark-900, var(--ng-colors-border-warning));\n }\n\n .otp--error:not(.otp--disabled) .otp__cell:hover {\n border-color: var(--nile-colors-dark-900, var(--ng-colors-border-error));\n }\n\n .otp--success:not(.otp--disabled) .otp__cell:hover {\n border-color: var(--nile-colors-dark-900, var(--ng-colors-border-success));\n }\n\n /* ---- Focus / active cell (mirrors .input--standard.input--focused) ---- */\n\n .otp__cell:focus {\n outline: none;\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n border-color: var(--nile-colors-primary-500, var(--ng-colors-border-brand ));\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));\n }\n\n .otp__cell--active {\n position: relative;\n cursor: text;\n caret-color: auto;\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary ));\n border-color: var(--nile-colors-primary-500, var(--ng-colors-border-brand ));\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));\n }\n\n .otp__cell--active::before {\n content: \"\";\n position: absolute;\n inset: 0;\n pointer-events: none;\n border-radius: inherit;\n box-shadow: inset 0 0 0 1px var(--nile-colors-primary-500, var(--ng-colors-border-brand));\n }\n\n .otp--warning .otp__cell:focus,\n .otp--warning .otp__cell--active {\n border-color: var(--nile-colors-primary-500, var(--ng-colors-border-warning));\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));\n outline: var(--nile-border-width-1, var(--ng-border-width-1)) solid var(--nile-outline-none, var(--ng-colors-border-warning));\n }\n\n .otp--warning .otp__cell--active::before {\n box-shadow: inset 0 0 0 1px var(--nile-colors-yellow-500, var(--ng-colors-border-warning));\n }\n\n .otp--success .otp__cell:focus,\n .otp--success .otp__cell--active {\n border-color: var(--nile-colors-primary-500, var(--ng-colors-border-success));\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));\n outline: var(--nile-border-width-1, var(--ng-border-width-1)) solid var(--nile-outline-none, var(--ng-colors-border-success));\n }\n\n .otp--success .otp__cell--active::before {\n box-shadow: inset 0 0 0 1px var(--nile-colors-green-500, var(--ng-colors-border-success));\n }\n\n .otp--error .otp__cell:focus,\n .otp--error .otp__cell--active {\n border-color: var(--nile-colors-primary-500, var(--ng-colors-border-error));\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));\n outline: var(--nile-border-width-1, var(--ng-border-width-1)) solid var(--nile-outline-none, var(--ng-colors-border-error));\n }\n\n .otp--error .otp__cell--active::before {\n box-shadow: inset 0 0 0 1px var(--nile-colors-red-500, var(--ng-colors-border-error));\n }\n\n .otp__cell::selection {\n background-color: var(--nile-colors-primary-600, var(--ng-colors-bg-brand-primary ));\n color: var(--nile-colors-white-base, var(--ng-colors-fg-white));\n }\n\n .otp__cell::placeholder {\n color: var(--nile-colors-dark-500, var(--ng-colors-text-placeholder-subtle));\n opacity: 0.9;\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-500));\n }\n\n /* ---- Separator ---- */\n\n .otp__separator {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n color: var(--nile-colors-dark-500, var(--ng-colors-text-placeholder-subtle));\n font-family: var(--nile-font-family, var(--ng-font-family-display ));\n font-size: var(--nile-type-scale-7, var(--ng-font-size-text-xl));\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-500));\n line-height: var(--nile-type-scale-7, var(--ng-line-height-text-xl));\n user-select: none;\n }\n\n /* ---- State: warning ---- */\n\n .otp--warning .otp__cell {\n border-color: var(--nile-colors-yellow-500, var(--ng-colors-border-warning-subtle ));\n }\n\n /* ---- State: error ---- */\n\n .otp--error .otp__cell {\n border-color: var(--nile-colors-red-500, var(--ng-colors-border-error-subtle ));\n }\n\n /* ---- State: success ---- */\n\n .otp--success .otp__cell {\n border-color: var(--nile-colors-green-500, var(--ng-colors-border-success-subtle));\n }\n\n /* ---- State: readonly ---- */\n\n .otp--readonly .otp__cell {\n cursor: default;\n }\n\n /* ---- State: disabled (mirrors .input--standard.input--disabled) ---- */\n\n .otp--disabled .otp__cell {\n cursor: not-allowed;\n color: var(--nile-colors-neutral-500, var(--ng-colors-text-disabled ));\n border-color: var(--nile-colors-neutral-500, var(--ng-colors-border-disabled ));\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-disabled-subtle ));\n }\n\n .otp--disabled .otp__cell::placeholder {\n color: var(--nile-input-standard-disabled-placeholder-font-color, var(--ng-colors-text-disabled ));\n }\n\n /* ---- Hidden value input ---- */\n\n .otp__value-input {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\n opacity: 0;\n z-index: -1;\n pointer-events: none;\n }\n\n /* ---- Help text ---- */\n\n .form-control__help-text {\n color: var(--nile-colors-dark-900, var(--ng-colors-text-tertiary-600));\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body ));\n font-size: var(--nile-type-scale-2, var(--ng-font-size-text-sm ));\n font-style: normal;\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-400 ));\n line-height: var(--nile-type-scale-2, var(--ng-line-height-text-sm ));\n letter-spacing: 0.2px;\n }\n\n /* ---- Error message ---- */\n\n .form-control__error-message {\n display: block;\n color: var(--nile-colors-red-700, var(--ng-colors-text-error-primary-600));\n margin-top: var(--nile-spacing-lg, var(--ng-spacing-1-5 ));\n font-size: var(--nile-type-scale-2, var(--ng-font-size-text-sm ));\n font-style: normal;\n line-height: var(--nile-form-error-text-line-height, var(--ng-line-height-text-sm));\n letter-spacing: 0.2px;\n }\n"]))));}};});
|
|
1
|
+
System.register(["lit"],function(_export,_context){"use strict";var r,_templateObject,o;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}return{setters:[function(_lit){r=_lit.css;}],execute:function execute(){_export("s",o=r(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n display: block;\n --ng-private-outline-transparent: var(--ng-border-width-1) solid transparent;\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing, antialiased));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing, grayscale));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering, optimizeLegibility));\n }\n\n .form-control {\n display: flex;\n flex-direction: column;\n gap: var(--nile-spacing-sm, var(--ng-spacing-1-5));\n align-items: flex-start;\n }\n\n .form-control .form-control__label {\n display: none;\n }\n\n .form-control--has-label .form-control__label {\n display: inline-block;\n color: var(--nile-colors-dark-900, var(--ng-colors-text-secondary-700));\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body ));\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm ));\n font-style: normal;\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-500 ));\n line-height: var(--nile-type-scale-6, var(--ng-line-height-text-sm ));\n letter-spacing: 0.2px;\n }\n\n :host([required]) .form-control--has-label .form-control__label::after {\n content: '*';\n margin-inline-start: -2px;\n color: var(--nile-colors-red-700, var(--ng-colors-text-error-primary-600));\n }\n\n .otp {\n position: relative;\n display: flex;\n align-items: center;\n gap: var(--nile-spacing-md, var(--ng-spacing-2));\n width: fit-content;\n max-width: 100%;\n }\n\n /* ---- Base cell ---- */\n\n .otp__cell {\n box-sizing: border-box;\n width: var(--nile-spacing-5xl, var(--ng-spacing-10));\n height: var(--nile-spacing-5xl, var(--ng-spacing-10));\n min-height: var(--nile-spacing-5xl, var(--ng-spacing-10));\n padding: var(--nile-spacing-xxs, var(--ng-spacing-0-5)) var(--nile-spacing-md, var(--ng-spacing-2));\n border: 1px solid var(--nile-colors-border-field, var(--ng-colors-border-primary));\n border-radius: var(--nile-radius-radius-2xl, var(--ng-radius-lg));\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n box-shadow: var(--nile-box-shadow-1, var(--ng-shadow-xs));\n outline: var(--nile-outline-none, var(--ng-private-outline-transparent));\n color: var(--nile-colors-dark-500, var(--ng-colors-text-placeholder));\n text-align: center;\n font-family: var(--nile-font-family, var(--ng-font-family-display));\n font-size: var(--nile-type-scale-4, var(--ng-font-size-text-md));\n font-style: normal;\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-500));\n line-height: var(--nile-type-scale-4, var(--ng-line-height-text-md));\n letter-spacing: 0.2px;\n overflow: clip;\n caret-color: transparent;\n cursor: pointer;\n transition: 150ms color, 150ms border, 150ms box-shadow, 150ms background-color, 150ms outline;\n }\n\n .otp__cell[type='password'] {\n font-family: caption;\n letter-spacing: 0;\n }\n /* ---- Hover (mirrors .input--standard:hover) ---- */\n\n .otp:not(.otp--disabled):not(.otp--readonly) .otp__cell:hover {\n border-color: var(--nile-colors-dark-900, var(--ng-colors-border-neutral));\n }\n\n .otp--warning:not(.otp--disabled) .otp__cell:hover {\n border-color: var(--nile-colors-dark-900, var(--ng-colors-border-warning));\n }\n\n .otp--error:not(.otp--disabled) .otp__cell:hover {\n border-color: var(--nile-colors-dark-900, var(--ng-colors-border-error));\n }\n\n .otp--success:not(.otp--disabled) .otp__cell:hover {\n border-color: var(--nile-colors-dark-900, var(--ng-colors-border-success));\n }\n\n /* ---- Focus / active cell (mirrors .input--standard.input--focused) ---- */\n\n .otp__cell:focus {\n outline: none;\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n border-color: var(--nile-colors-primary-500, var(--ng-colors-border-brand ));\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));\n }\n\n .otp__cell--active {\n position: relative;\n cursor: text;\n caret-color: auto;\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary ));\n border-color: var(--nile-colors-primary-500, var(--ng-colors-border-brand ));\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));\n }\n\n .otp__cell--active::before {\n content: \"\";\n position: absolute;\n inset: 0;\n pointer-events: none;\n border-radius: inherit;\n box-shadow: inset 0 0 0 1px var(--nile-colors-primary-500, var(--ng-colors-border-brand));\n }\n\n .otp--warning .otp__cell:focus,\n .otp--warning .otp__cell--active {\n border-color: var(--nile-colors-primary-500, var(--ng-colors-border-warning));\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));\n outline: var(--nile-border-width-1, var(--ng-border-width-1)) solid var(--nile-outline-none, var(--ng-colors-border-warning));\n }\n\n .otp--warning .otp__cell--active::before {\n box-shadow: inset 0 0 0 1px var(--nile-colors-yellow-500, var(--ng-colors-border-warning));\n }\n\n .otp--success .otp__cell:focus,\n .otp--success .otp__cell--active {\n border-color: var(--nile-colors-primary-500, var(--ng-colors-border-success));\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));\n outline: var(--nile-border-width-1, var(--ng-border-width-1)) solid var(--nile-outline-none, var(--ng-colors-border-success));\n }\n\n .otp--success .otp__cell--active::before {\n box-shadow: inset 0 0 0 1px var(--nile-colors-green-500, var(--ng-colors-border-success));\n }\n\n .otp--error .otp__cell:focus,\n .otp--error .otp__cell--active {\n border-color: var(--nile-colors-primary-500, var(--ng-colors-border-error));\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));\n outline: var(--nile-border-width-1, var(--ng-border-width-1)) solid var(--nile-outline-none, var(--ng-colors-border-error));\n }\n\n .otp--error .otp__cell--active::before {\n box-shadow: inset 0 0 0 1px var(--nile-colors-red-500, var(--ng-colors-border-error));\n }\n\n .otp__cell::selection {\n background-color: var(--nile-colors-primary-600, var(--ng-colors-bg-brand-primary ));\n color: var(--nile-colors-white-base, var(--ng-colors-fg-white));\n }\n\n .otp__cell::placeholder {\n color: var(--nile-colors-dark-500, var(--ng-colors-text-placeholder-subtle));\n opacity: 0.9;\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-500));\n }\n\n /* ---- Separator ---- */\n\n .otp__separator {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n color: var(--nile-colors-dark-500, var(--ng-colors-text-placeholder-subtle));\n font-family: var(--nile-font-family, var(--ng-font-family-display ));\n font-size: var(--nile-type-scale-7, var(--ng-font-size-text-xl));\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-500));\n line-height: var(--nile-type-scale-7, var(--ng-line-height-text-xl));\n user-select: none;\n }\n\n /* ---- State: warning ---- */\n\n .otp--warning .otp__cell {\n border-color: var(--nile-colors-yellow-500, var(--ng-colors-border-warning-subtle ));\n }\n\n /* ---- State: error ---- */\n\n .otp--error .otp__cell {\n border-color: var(--nile-colors-red-500, var(--ng-colors-border-error-subtle ));\n }\n\n /* ---- State: success ---- */\n\n .otp--success .otp__cell {\n border-color: var(--nile-colors-green-500, var(--ng-colors-border-success-subtle));\n }\n\n /* ---- State: readonly ---- */\n\n .otp--readonly .otp__cell {\n cursor: default;\n }\n\n /* ---- State: disabled (mirrors .input--standard.input--disabled) ---- */\n\n .otp--disabled .otp__cell {\n cursor: not-allowed;\n color: var(--nile-colors-neutral-500, var(--ng-colors-text-disabled ));\n border-color: var(--nile-colors-neutral-500, var(--ng-colors-border-disabled ));\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-disabled-subtle ));\n }\n\n .otp--disabled .otp__cell::placeholder {\n color: var(--nile-input-standard-disabled-placeholder-font-color, var(--ng-colors-text-disabled ));\n }\n\n /* ---- Hidden value input ---- */\n\n .otp__value-input {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\n opacity: 0;\n z-index: -1;\n pointer-events: none;\n }\n\n /* ---- Help text ---- */\n\n .form-control__help-text {\n color: var(--nile-colors-dark-900, var(--ng-colors-text-tertiary-600));\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body ));\n font-size: var(--nile-type-scale-2, var(--ng-font-size-text-sm ));\n font-style: normal;\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-400 ));\n line-height: var(--nile-type-scale-2, var(--ng-line-height-text-sm ));\n letter-spacing: 0.2px;\n }\n\n /* ---- Error message ---- */\n\n .form-control__error-message {\n display: block;\n color: var(--nile-colors-red-700, var(--ng-colors-text-error-primary-600));\n margin-top: var(--nile-spacing-lg, var(--ng-spacing-1-5 ));\n font-size: var(--nile-type-scale-2, var(--ng-font-size-text-sm ));\n font-style: normal;\n line-height: var(--nile-form-error-text-line-height, var(--ng-line-height-text-sm));\n letter-spacing: 0.2px;\n }\n"]))));}};});
|
|
2
2
|
//# sourceMappingURL=nile-otp-input.css.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-otp-input.css.cjs.js","sources":["../../../src/nile-otp-input/nile-otp-input.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2026\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\n\n/**\n * OTP input CSS\n */\nexport const styles = css`\n :host {\n display: block;\n --ng-private-outline-transparent: var(--ng-border-width-1) solid transparent;\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing, antialiased));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing, grayscale));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering, optimizeLegibility));\n }\n\n .form-control {\n display: flex;\n flex-direction: column;\n gap: var(--nile-spacing-sm, var(--ng-spacing-1-5));\n align-items: flex-start;\n }\n\n .form-control .form-control__label {\n display: none;\n }\n\n .form-control--has-label .form-control__label {\n display: inline-block;\n color: var(--nile-colors-dark-900, var(--ng-colors-text-secondary-700));\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body ));\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm ));\n font-style: normal;\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-500 ));\n line-height: var(--nile-type-scale-6, var(--ng-line-height-text-sm ));\n letter-spacing: 0.2px;\n }\n\n :host([required]) .form-control--has-label .form-control__label::after {\n content: '*';\n margin-inline-start: -2px;\n color: var(--nile-colors-red-700, var(--ng-colors-text-error-primary-600));\n }\n\n .otp {\n position: relative;\n display: flex;\n align-items: center;\n gap: var(--nile-spacing-md, var(--ng-spacing-2));\n width: fit-content;\n max-width: 100%;\n }\n\n /* ---- Base cell ---- */\n\n .otp__cell {\n box-sizing: border-box;\n width: var(--nile-spacing-5xl, var(--ng-spacing-10));\n height: var(--nile-spacing-5xl, var(--ng-spacing-10));\n min-height: var(--nile-spacing-5xl, var(--ng-spacing-10));\n padding: var(--nile-spacing-xxs, var(--ng-spacing-0-5)) var(--nile-spacing-md, var(--ng-spacing-2));\n border: 1px solid var(--nile-colors-border-field, var(--ng-colors-border-primary));\n border-radius: var(--nile-radius-radius-2xl, var(--ng-radius-lg));\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n box-shadow: var(--nile-box-shadow-1, var(--ng-shadow-xs));\n outline: var(--nile-outline-none, var(--ng-private-outline-transparent));\n color: var(--nile-colors-dark-500, var(--ng-colors-text-placeholder-subtle));\n text-align: center;\n font-family: var(--nile-font-family, var(--ng-font-family-display));\n font-size: var(--nile-type-scale-4, var(--ng-font-size-text-md));\n font-style: normal;\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-500));\n line-height: var(--nile-type-scale-4, var(--ng-line-height-text-md));\n letter-spacing: 0.2px;\n overflow: clip;\n caret-color: transparent;\n cursor: pointer;\n transition: 150ms color, 150ms border, 150ms box-shadow, 150ms background-color, 150ms outline;\n }\n\n .otp__cell[type='password'] {\n font-family: caption;\n letter-spacing: 0;\n }\n /* ---- Hover (mirrors .input--standard:hover) ---- */\n\n .otp:not(.otp--disabled):not(.otp--readonly) .otp__cell:hover {\n border-color: var(--nile-colors-dark-900, var(--ng-colors-border-neutral));\n }\n\n .otp--warning:not(.otp--disabled) .otp__cell:hover {\n border-color: var(--nile-colors-dark-900, var(--ng-colors-border-warning));\n }\n\n .otp--error:not(.otp--disabled) .otp__cell:hover {\n border-color: var(--nile-colors-dark-900, var(--ng-colors-border-error));\n }\n\n .otp--success:not(.otp--disabled) .otp__cell:hover {\n border-color: var(--nile-colors-dark-900, var(--ng-colors-border-success));\n }\n\n /* ---- Focus / active cell (mirrors .input--standard.input--focused) ---- */\n\n .otp__cell:focus {\n outline: none;\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n border-color: var(--nile-colors-primary-500, var(--ng-colors-border-brand ));\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));\n }\n\n .otp__cell--active {\n position: relative;\n cursor: text;\n caret-color: auto;\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary ));\n border-color: var(--nile-colors-primary-500, var(--ng-colors-border-brand ));\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));\n }\n\n .otp__cell--active::before {\n content: \"\";\n position: absolute;\n inset: 0;\n pointer-events: none;\n border-radius: inherit;\n box-shadow: inset 0 0 0 1px var(--nile-colors-primary-500, var(--ng-colors-border-brand));\n }\n\n .otp--warning .otp__cell:focus,\n .otp--warning .otp__cell--active {\n border-color: var(--nile-colors-primary-500, var(--ng-colors-border-warning));\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));\n outline: var(--nile-border-width-1, var(--ng-border-width-1)) solid var(--nile-outline-none, var(--ng-colors-border-warning));\n }\n\n .otp--warning .otp__cell--active::before {\n box-shadow: inset 0 0 0 1px var(--nile-colors-yellow-500, var(--ng-colors-border-warning));\n }\n\n .otp--success .otp__cell:focus,\n .otp--success .otp__cell--active {\n border-color: var(--nile-colors-primary-500, var(--ng-colors-border-success));\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));\n outline: var(--nile-border-width-1, var(--ng-border-width-1)) solid var(--nile-outline-none, var(--ng-colors-border-success));\n }\n\n .otp--success .otp__cell--active::before {\n box-shadow: inset 0 0 0 1px var(--nile-colors-green-500, var(--ng-colors-border-success));\n }\n\n .otp--error .otp__cell:focus,\n .otp--error .otp__cell--active {\n border-color: var(--nile-colors-primary-500, var(--ng-colors-border-error));\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));\n outline: var(--nile-border-width-1, var(--ng-border-width-1)) solid var(--nile-outline-none, var(--ng-colors-border-error));\n }\n\n .otp--error .otp__cell--active::before {\n box-shadow: inset 0 0 0 1px var(--nile-colors-red-500, var(--ng-colors-border-error));\n }\n\n .otp__cell::selection {\n background-color: var(--nile-colors-primary-600, var(--ng-colors-bg-brand-primary ));\n color: var(--nile-colors-white-base, var(--ng-colors-fg-white));\n }\n\n .otp__cell::placeholder {\n color: var(--nile-colors-dark-500, var(--ng-colors-text-placeholder-subtle));\n opacity: 0.9;\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-500));\n }\n\n /* ---- Separator ---- */\n\n .otp__separator {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n color: var(--nile-colors-dark-500, var(--ng-colors-text-placeholder-subtle));\n font-family: var(--nile-font-family, var(--ng-font-family-display ));\n font-size: var(--nile-type-scale-7, var(--ng-font-size-text-xl));\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-500));\n line-height: var(--nile-type-scale-7, var(--ng-line-height-text-xl));\n user-select: none;\n }\n\n /* ---- State: warning ---- */\n\n .otp--warning .otp__cell {\n border-color: var(--nile-colors-yellow-500, var(--ng-colors-border-warning-subtle ));\n }\n\n /* ---- State: error ---- */\n\n .otp--error .otp__cell {\n border-color: var(--nile-colors-red-500, var(--ng-colors-border-error-subtle ));\n }\n\n /* ---- State: success ---- */\n\n .otp--success .otp__cell {\n border-color: var(--nile-colors-green-500, var(--ng-colors-border-success-subtle));\n }\n\n /* ---- State: readonly ---- */\n\n .otp--readonly .otp__cell {\n cursor: default;\n }\n\n /* ---- State: disabled (mirrors .input--standard.input--disabled) ---- */\n\n .otp--disabled .otp__cell {\n cursor: not-allowed;\n color: var(--nile-colors-neutral-500, var(--ng-colors-text-disabled ));\n border-color: var(--nile-colors-neutral-500, var(--ng-colors-border-disabled ));\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-disabled-subtle ));\n }\n\n .otp--disabled .otp__cell::placeholder {\n color: var(--nile-input-standard-disabled-placeholder-font-color, var(--ng-colors-text-disabled ));\n }\n\n /* ---- Hidden value input ---- */\n\n .otp__value-input {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\n opacity: 0;\n z-index: -1;\n pointer-events: none;\n }\n\n /* ---- Help text ---- */\n\n .form-control__help-text {\n color: var(--nile-colors-dark-900, var(--ng-colors-text-tertiary-600));\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body ));\n font-size: var(--nile-type-scale-2, var(--ng-font-size-text-sm ));\n font-style: normal;\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-400 ));\n line-height: var(--nile-type-scale-2, var(--ng-line-height-text-sm ));\n letter-spacing: 0.2px;\n }\n\n /* ---- Error message ---- */\n\n .form-control__error-message {\n display: block;\n color: var(--nile-colors-red-700, var(--ng-colors-text-error-primary-600));\n margin-top: var(--nile-spacing-lg, var(--ng-spacing-1-5 ));\n font-size: var(--nile-type-scale-2, var(--ng-font-size-text-sm ));\n font-style: normal;\n line-height: var(--nile-form-error-text-line-height, var(--ng-line-height-text-sm));\n letter-spacing: 0.2px;\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
|
|
1
|
+
{"version":3,"file":"nile-otp-input.css.cjs.js","sources":["../../../src/nile-otp-input/nile-otp-input.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2026\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\n\n/**\n * OTP input CSS\n */\nexport const styles = css`\n :host {\n display: block;\n --ng-private-outline-transparent: var(--ng-border-width-1) solid transparent;\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing, antialiased));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing, grayscale));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering, optimizeLegibility));\n }\n\n .form-control {\n display: flex;\n flex-direction: column;\n gap: var(--nile-spacing-sm, var(--ng-spacing-1-5));\n align-items: flex-start;\n }\n\n .form-control .form-control__label {\n display: none;\n }\n\n .form-control--has-label .form-control__label {\n display: inline-block;\n color: var(--nile-colors-dark-900, var(--ng-colors-text-secondary-700));\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body ));\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm ));\n font-style: normal;\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-500 ));\n line-height: var(--nile-type-scale-6, var(--ng-line-height-text-sm ));\n letter-spacing: 0.2px;\n }\n\n :host([required]) .form-control--has-label .form-control__label::after {\n content: '*';\n margin-inline-start: -2px;\n color: var(--nile-colors-red-700, var(--ng-colors-text-error-primary-600));\n }\n\n .otp {\n position: relative;\n display: flex;\n align-items: center;\n gap: var(--nile-spacing-md, var(--ng-spacing-2));\n width: fit-content;\n max-width: 100%;\n }\n\n /* ---- Base cell ---- */\n\n .otp__cell {\n box-sizing: border-box;\n width: var(--nile-spacing-5xl, var(--ng-spacing-10));\n height: var(--nile-spacing-5xl, var(--ng-spacing-10));\n min-height: var(--nile-spacing-5xl, var(--ng-spacing-10));\n padding: var(--nile-spacing-xxs, var(--ng-spacing-0-5)) var(--nile-spacing-md, var(--ng-spacing-2));\n border: 1px solid var(--nile-colors-border-field, var(--ng-colors-border-primary));\n border-radius: var(--nile-radius-radius-2xl, var(--ng-radius-lg));\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n box-shadow: var(--nile-box-shadow-1, var(--ng-shadow-xs));\n outline: var(--nile-outline-none, var(--ng-private-outline-transparent));\n color: var(--nile-colors-dark-500, var(--ng-colors-text-placeholder));\n text-align: center;\n font-family: var(--nile-font-family, var(--ng-font-family-display));\n font-size: var(--nile-type-scale-4, var(--ng-font-size-text-md));\n font-style: normal;\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-500));\n line-height: var(--nile-type-scale-4, var(--ng-line-height-text-md));\n letter-spacing: 0.2px;\n overflow: clip;\n caret-color: transparent;\n cursor: pointer;\n transition: 150ms color, 150ms border, 150ms box-shadow, 150ms background-color, 150ms outline;\n }\n\n .otp__cell[type='password'] {\n font-family: caption;\n letter-spacing: 0;\n }\n /* ---- Hover (mirrors .input--standard:hover) ---- */\n\n .otp:not(.otp--disabled):not(.otp--readonly) .otp__cell:hover {\n border-color: var(--nile-colors-dark-900, var(--ng-colors-border-neutral));\n }\n\n .otp--warning:not(.otp--disabled) .otp__cell:hover {\n border-color: var(--nile-colors-dark-900, var(--ng-colors-border-warning));\n }\n\n .otp--error:not(.otp--disabled) .otp__cell:hover {\n border-color: var(--nile-colors-dark-900, var(--ng-colors-border-error));\n }\n\n .otp--success:not(.otp--disabled) .otp__cell:hover {\n border-color: var(--nile-colors-dark-900, var(--ng-colors-border-success));\n }\n\n /* ---- Focus / active cell (mirrors .input--standard.input--focused) ---- */\n\n .otp__cell:focus {\n outline: none;\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n border-color: var(--nile-colors-primary-500, var(--ng-colors-border-brand ));\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));\n }\n\n .otp__cell--active {\n position: relative;\n cursor: text;\n caret-color: auto;\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary ));\n border-color: var(--nile-colors-primary-500, var(--ng-colors-border-brand ));\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));\n }\n\n .otp__cell--active::before {\n content: \"\";\n position: absolute;\n inset: 0;\n pointer-events: none;\n border-radius: inherit;\n box-shadow: inset 0 0 0 1px var(--nile-colors-primary-500, var(--ng-colors-border-brand));\n }\n\n .otp--warning .otp__cell:focus,\n .otp--warning .otp__cell--active {\n border-color: var(--nile-colors-primary-500, var(--ng-colors-border-warning));\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));\n outline: var(--nile-border-width-1, var(--ng-border-width-1)) solid var(--nile-outline-none, var(--ng-colors-border-warning));\n }\n\n .otp--warning .otp__cell--active::before {\n box-shadow: inset 0 0 0 1px var(--nile-colors-yellow-500, var(--ng-colors-border-warning));\n }\n\n .otp--success .otp__cell:focus,\n .otp--success .otp__cell--active {\n border-color: var(--nile-colors-primary-500, var(--ng-colors-border-success));\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));\n outline: var(--nile-border-width-1, var(--ng-border-width-1)) solid var(--nile-outline-none, var(--ng-colors-border-success));\n }\n\n .otp--success .otp__cell--active::before {\n box-shadow: inset 0 0 0 1px var(--nile-colors-green-500, var(--ng-colors-border-success));\n }\n\n .otp--error .otp__cell:focus,\n .otp--error .otp__cell--active {\n border-color: var(--nile-colors-primary-500, var(--ng-colors-border-error));\n box-shadow: var(--nile-input-shadow-standard-focused-not-disabled, var(--ng-box-shadow-1));\n outline: var(--nile-border-width-1, var(--ng-border-width-1)) solid var(--nile-outline-none, var(--ng-colors-border-error));\n }\n\n .otp--error .otp__cell--active::before {\n box-shadow: inset 0 0 0 1px var(--nile-colors-red-500, var(--ng-colors-border-error));\n }\n\n .otp__cell::selection {\n background-color: var(--nile-colors-primary-600, var(--ng-colors-bg-brand-primary ));\n color: var(--nile-colors-white-base, var(--ng-colors-fg-white));\n }\n\n .otp__cell::placeholder {\n color: var(--nile-colors-dark-500, var(--ng-colors-text-placeholder-subtle));\n opacity: 0.9;\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-500));\n }\n\n /* ---- Separator ---- */\n\n .otp__separator {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n color: var(--nile-colors-dark-500, var(--ng-colors-text-placeholder-subtle));\n font-family: var(--nile-font-family, var(--ng-font-family-display ));\n font-size: var(--nile-type-scale-7, var(--ng-font-size-text-xl));\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-500));\n line-height: var(--nile-type-scale-7, var(--ng-line-height-text-xl));\n user-select: none;\n }\n\n /* ---- State: warning ---- */\n\n .otp--warning .otp__cell {\n border-color: var(--nile-colors-yellow-500, var(--ng-colors-border-warning-subtle ));\n }\n\n /* ---- State: error ---- */\n\n .otp--error .otp__cell {\n border-color: var(--nile-colors-red-500, var(--ng-colors-border-error-subtle ));\n }\n\n /* ---- State: success ---- */\n\n .otp--success .otp__cell {\n border-color: var(--nile-colors-green-500, var(--ng-colors-border-success-subtle));\n }\n\n /* ---- State: readonly ---- */\n\n .otp--readonly .otp__cell {\n cursor: default;\n }\n\n /* ---- State: disabled (mirrors .input--standard.input--disabled) ---- */\n\n .otp--disabled .otp__cell {\n cursor: not-allowed;\n color: var(--nile-colors-neutral-500, var(--ng-colors-text-disabled ));\n border-color: var(--nile-colors-neutral-500, var(--ng-colors-border-disabled ));\n background-color: var(--nile-colors-white-base, var(--ng-colors-bg-disabled-subtle ));\n }\n\n .otp--disabled .otp__cell::placeholder {\n color: var(--nile-input-standard-disabled-placeholder-font-color, var(--ng-colors-text-disabled ));\n }\n\n /* ---- Hidden value input ---- */\n\n .otp__value-input {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\n opacity: 0;\n z-index: -1;\n pointer-events: none;\n }\n\n /* ---- Help text ---- */\n\n .form-control__help-text {\n color: var(--nile-colors-dark-900, var(--ng-colors-text-tertiary-600));\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body ));\n font-size: var(--nile-type-scale-2, var(--ng-font-size-text-sm ));\n font-style: normal;\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-400 ));\n line-height: var(--nile-type-scale-2, var(--ng-line-height-text-sm ));\n letter-spacing: 0.2px;\n }\n\n /* ---- Error message ---- */\n\n .form-control__error-message {\n display: block;\n color: var(--nile-colors-red-700, var(--ng-colors-text-error-primary-600));\n margin-top: var(--nile-spacing-lg, var(--ng-spacing-1-5 ));\n font-size: var(--nile-type-scale-2, var(--ng-font-size-text-sm ));\n font-style: normal;\n line-height: var(--nile-form-error-text-line-height, var(--ng-line-height-text-sm));\n letter-spacing: 0.2px;\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
|
|
@@ -57,7 +57,7 @@ import{css as r}from"lit";const o=r`
|
|
|
57
57
|
background-color: var(--nile-colors-white-base, var(--ng-colors-bg-primary));
|
|
58
58
|
box-shadow: var(--nile-box-shadow-1, var(--ng-shadow-xs));
|
|
59
59
|
outline: var(--nile-outline-none, var(--ng-private-outline-transparent));
|
|
60
|
-
color: var(--nile-colors-dark-500, var(--ng-colors-text-placeholder
|
|
60
|
+
color: var(--nile-colors-dark-500, var(--ng-colors-text-placeholder));
|
|
61
61
|
text-align: center;
|
|
62
62
|
font-family: var(--nile-font-family, var(--ng-font-family-display));
|
|
63
63
|
font-size: var(--nile-type-scale-4, var(--ng-font-size-text-md));
|