@aquera/nile-elements 0.1.28-beta-1.4 → 0.1.28-beta-1.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/demo/index.html CHANGED
@@ -25,17 +25,76 @@
25
25
  </style>
26
26
 
27
27
  <body>
28
+ <nile-tooltip content="I am text area" placement="right">
29
+ <nile-textarea></nile-textarea>
30
+ </nile-tooltip>
28
31
 
29
- <!-- Add the tour component -->
30
- <nile-tour id="tour" .showBackdrop="false" ></nile-tour>
32
+ <nile-tooltip content="I am text area" >
33
+ <nile-textarea></nile-textarea>
34
+ </nile-tooltip>
35
+ <nile-tooltip content="I am text area" placement="left">
36
+ <nile-textarea></nile-textarea>
37
+ </nile-tooltip>
38
+ <nile-tab-panel name="design" id="nile-tab-panel-1" role="tabpanel" aria-hidden="false" aria-labelledby="nile-tab-1" active="">
39
+ <div class="tooltip-elements">
40
+ <span>
41
+ <nile-tooltip content="ToolTip Text" placement="left" size="small"> <nile-tag variant="error" removable="" size="medium">Left</nile-tag> </nile-tooltip>
42
+ </span>
43
+ <span>
44
+ <nile-tooltip content="ToolTip Text" placement="top" size="small"> <nile-tag variant="normal" removable="" size="medium">Top</nile-tag> </nile-tooltip>
45
+ </span>
46
+ <span>
47
+ <nile-tooltip content="ToolTip Text" placement="bottom" size="small"> <nile-tag variant="success" removable="" size="medium">Bottom</nile-tag> </nile-tooltip>
48
+ </span>
49
+ <span>
50
+ <nile-tooltip content="ToolTip Text" placement="right" size="small"> <nile-tag variant="warning" removable="" size="medium">Right</nile-tag> </nile-tooltip>
51
+ </span>
52
+ </div>
53
+ <h3>Usage</h3>
54
+ <p>We can use tool tip with different components of nile</p>
55
+ <h4>Text Area</h4>
56
+ <pre class="language-html"><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>nile-tooltip</span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>I am text area<span class="token punctuation">"</span></span> <span class="token punctuation">&gt;</span></span><br> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>nile-textarea</span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>nile-textarea</span><span class="token punctuation">&gt;</span></span><br><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>nile-tooltip</span><span class="token punctuation">&gt;</span></span></code></pre>
57
+ <nile-tooltip content="I am text area" size="small">
58
+ <nile-textarea size="medium" help-text="" error-message="" form=""></nile-textarea>
59
+ </nile-tooltip>
60
+ <hr>
61
+ <h4>Progress Bar</h4>
62
+ <pre class="language-html"><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>nile-tooltip</span> <span class="token attr-name">content</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>I am Progress Bar<span class="token punctuation">"</span></span> <span class="token punctuation">&gt;</span></span><br> <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>nile-progress-bar</span> <span class="token attr-name">value</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>80<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>nile-progress-bar</span><span class="token punctuation">&gt;</span></span><br><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>nile-tooltip</span><span class="token punctuation">&gt;</span></span></code></pre>
63
+ <nile-tooltip content="I am Progress Bar" size="small">
64
+ <nile-progress-bar value="80"></nile-progress-bar>
65
+ </nile-tooltip>
66
+ <hr>
67
+ <h2>Attributes &amp; Properties</h2>
68
+
69
+ <hr>
70
+ <h2>Events</h2>
71
+
72
+ <hr>
73
+ <h2>Slots</h2>
74
+ <table class="tg">
75
+ <thead>
76
+ <tr>
77
+ <th class="pl-3">Name</th>
78
+ <th class="pl-3">Description</th>
79
+ </tr>
80
+ </thead>
81
+ <tbody>
82
+ <tr>
83
+ <td class="pl-3">(default)</td>
84
+ <td class="pl-3">The toolkit main Content </td>
85
+ </tr>
86
+ <tr>
87
+ <td class="pl-3">content</td>
88
+ <td class="pl-3">Name of the toolkit </td>
89
+ </tr>
90
+ </tbody>
91
+ </table>
92
+ <hr>
93
+ <h2>Dependencies</h2>
94
+ <p><i>nile-popup</i></p>
95
+ <hr>
96
+ </nile-tab-panel>
31
97
 
32
- <div class="flex-container" id="button-container">
33
- <nile-button id="button1" data-tour="button1" variant="primary">Button 1</nile-button>
34
- <nile-button id="button2" data-tour="button2" variant="primary">Button 2</nile-button>
35
- </div>
36
-
37
- <script>
38
- </script>
39
98
 
40
99
  </body>
41
100
 
@@ -1,2 +1,2 @@
1
- System.register([],function(_export,_context){"use strict";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);}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 _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 e(e,n,o){return new Promise(function(t){if((o===null||o===void 0?void 0:o.duration)===1/0)throw new Error("Promise-based animations must be finite.");var i=e.animate(n,_objectSpread(_objectSpread({},o),{},{duration:r()?0:o.duration}));i.addEventListener("cancel",t,{once:!0}),i.addEventListener("finish",t,{once:!0});});}function n(e){return(e=e.toString().toLowerCase()).indexOf("ms")>-1?parseFloat(e):e.indexOf("s")>-1?1e3*parseFloat(e):parseFloat(e);}function r(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches;}function o(e){return Promise.all(e.getAnimations().map(function(e){return new Promise(function(n){var r=requestAnimationFrame(n);e.addEventListener("cancel",function(){return r;},{once:!0}),e.addEventListener("finish",function(){return r;},{once:!0}),e.cancel();});}));}function t(e,n){return e.map(function(e){return _objectSpread(_objectSpread({},e),{},{height:"auto"===e.height?"".concat(n,"px"):e.height});});}_export({a:e,b:t,p:n,s:o});return{setters:[],execute:function execute(){}};});
1
+ System.register([],function(_export,_context){"use strict";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);}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 _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 n(n,o,r){return new Promise(function(i){if((r===null||r===void 0?void 0:r.duration)===1/0)throw new Error("Promise-based animations must be finite.");var t=n.animate(o,_objectSpread(_objectSpread({},r),{},{duration:e()?0:r.duration}));t.addEventListener("cancel",i,{once:!0}),t.addEventListener("finish",i,{once:!0});});}function e(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches;}function o(n){return Promise.all(n.getAnimations().map(function(n){return new Promise(function(e){var o=requestAnimationFrame(e);n.addEventListener("cancel",function(){return o;},{once:!0}),n.addEventListener("finish",function(){return o;},{once:!0}),n.cancel();});}));}function r(n,e){return n.map(function(n){return _objectSpread(_objectSpread({},n),{},{height:"auto"===n.height?"".concat(e,"px"):n.height});});}_export({a:n,b:r,s:o});return{setters:[],execute:function execute(){}};});
2
2
  //# sourceMappingURL=animate.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"animate.cjs.js","sources":["../../../src/internal/animate.ts"],"sourcesContent":["/**\n * Animates an element using keyframes. Returns a promise that resolves after the animation completes or gets canceled.\n */\nexport function animateTo(el: HTMLElement, keyframes: Keyframe[], options?: KeyframeAnimationOptions) {\n return new Promise(resolve => {\n if (options?.duration === Infinity) {\n throw new Error('Promise-based animations must be finite.');\n }\n\n const animation = el.animate(keyframes, {\n ...options,\n duration: prefersReducedMotion() ? 0 : options!.duration\n });\n\n animation.addEventListener('cancel', resolve, { once: true });\n animation.addEventListener('finish', resolve, { once: true });\n });\n}\n\n/** Parses a CSS duration and returns the number of milliseconds. */\nexport function parseDuration(delay: number | string) {\n delay = delay.toString().toLowerCase();\n\n if (delay.indexOf('ms') > -1) {\n return parseFloat(delay);\n }\n\n if (delay.indexOf('s') > -1) {\n return parseFloat(delay) * 1000;\n }\n\n return parseFloat(delay);\n}\n\n/** Tells if the user has enabled the \"reduced motion\" setting in their browser or OS. */\nexport function prefersReducedMotion() {\n const query = window.matchMedia('(prefers-reduced-motion: reduce)');\n return query.matches;\n}\n\n/**\n * Stops all active animations on the target element. Returns a promise that resolves after all animations are canceled.\n */\nexport function stopAnimations(el: HTMLElement) {\n return Promise.all(\n el.getAnimations().map(animation => {\n return new Promise(resolve => {\n const handleAnimationEvent = requestAnimationFrame(resolve);\n\n animation.addEventListener('cancel', () => handleAnimationEvent, { once: true });\n animation.addEventListener('finish', () => handleAnimationEvent, { once: true });\n animation.cancel();\n });\n })\n );\n}\n\n/**\n * We can't animate `height: auto`, but we can calculate the height and shim keyframes by replacing it with the\n * element's scrollHeight before the animation.\n */\nexport function shimKeyframesHeightAuto(keyframes: Keyframe[], calculatedHeight: number) {\n return keyframes.map(keyframe => ({\n ...keyframe,\n height: keyframe.height === 'auto' ? `${calculatedHeight}px` : keyframe.height\n }));\n}\n"],"names":["animateTo","el","keyframes","options","Promise","resolve","duration","Infinity","Error","animation","animate","prefersReducedMotion","addEventListener","once","parseDuration","delay","toString","toLowerCase","indexOf","parseFloat","r","window","matchMedia","matches","stopAnimations","all","getAnimations","map","handleAnimationEvent","requestAnimationFrame","cancel","shimKeyframesHeightAuto","calculatedHeight","keyframe","_objectSpread","height"],"mappings":"+8CAGgBA,CAAAA,CAAUC,CAAAA,CAAAA,CAAiBC,CAAuBC,CAAAA,CAAAA,CAAAA,CAChE,MAAO,IAAIC,CAAAA,OAAQC,CAAAA,SAAAA,CAAAA,CAAAA,CACjB,GAAIF,CAAAA,CAAAA,SAAAA,CAAAA,iBAAAA,CAAAA,CAASG,QAAaC,IAAAA,CAAAA,CAAAA,CAAAA,CACxB,KAAM,IAA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B,CAEnDI,CAAAA,CAAAA,CAAAA,CAAUG,gBAAiB,CAAA,QAAA,CAAU,iBAAMgB,CAAAA,CAAAA,GAAsB,CAAEf,IAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CACzEJ,CAAUG,CAAAA,gBAAAA,CAAiB,QAAU,CAAA,iBAAMgB,CAAAA,CAAsB,GAAA,CAAEf,IAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CACzEJ,CAAUqB,CAAAA,MAAAA,CAAAA,CAAQ,EAI1B,CAAA,EAAA,CAAA,CAAA,EAMgB,QAAAC,CAAAA,CAAAA,CAAwB7B,EAAuB8B,CAC7D,CAAA,CAAA,MAAO9B,CAAAA,CAAUyB,CAAAA,GAAAA,CAAIM,SAAAA,CAAa,SAAAC,aAAA,CAAAA,aAAA,IAC7BD,CACHE,MAAAA,MAAAA,CAA4B,SAApBF,CAASE,CAAAA,MAAAA,IAAAA,MAAAA,CAAuBH,CAAAA,OAAuBC,CAASE,CAAAA,MAAAA,IAAAA,CAE5E"}
1
+ {"version":3,"file":"animate.cjs.js","sources":["../../../src/internal/animate.ts"],"sourcesContent":["/**\n * Animates an element using keyframes. Returns a promise that resolves after the animation completes or gets canceled.\n */\nexport function animateTo(el: HTMLElement, keyframes: Keyframe[], options?: KeyframeAnimationOptions) {\n return new Promise(resolve => {\n if (options?.duration === Infinity) {\n throw new Error('Promise-based animations must be finite.');\n }\n\n const animation = el.animate(keyframes, {\n ...options,\n duration: prefersReducedMotion() ? 0 : options!.duration\n });\n\n animation.addEventListener('cancel', resolve, { once: true });\n animation.addEventListener('finish', resolve, { once: true });\n });\n}\n\n/** Parses a CSS duration and returns the number of milliseconds. */\nexport function parseDuration(delay: number | string) {\n delay = delay.toString().toLowerCase();\n\n if (delay.indexOf('ms') > -1) {\n return parseFloat(delay);\n }\n\n if (delay.indexOf('s') > -1) {\n return parseFloat(delay) * 1000;\n }\n\n return parseFloat(delay);\n}\n\n/** Tells if the user has enabled the \"reduced motion\" setting in their browser or OS. */\nexport function prefersReducedMotion() {\n const query = window.matchMedia('(prefers-reduced-motion: reduce)');\n return query.matches;\n}\n\n/**\n * Stops all active animations on the target element. Returns a promise that resolves after all animations are canceled.\n */\nexport function stopAnimations(el: HTMLElement) {\n return Promise.all(\n el.getAnimations().map(animation => {\n return new Promise(resolve => {\n const handleAnimationEvent = requestAnimationFrame(resolve);\n\n animation.addEventListener('cancel', () => handleAnimationEvent, { once: true });\n animation.addEventListener('finish', () => handleAnimationEvent, { once: true });\n animation.cancel();\n });\n })\n );\n}\n\n/**\n * We can't animate `height: auto`, but we can calculate the height and shim keyframes by replacing it with the\n * element's scrollHeight before the animation.\n */\nexport function shimKeyframesHeightAuto(keyframes: Keyframe[], calculatedHeight: number) {\n return keyframes.map(keyframe => ({\n ...keyframe,\n height: keyframe.height === 'auto' ? `${calculatedHeight}px` : keyframe.height\n }));\n}\n"],"names":["animateTo","el","keyframes","options","Promise","resolve","duration","Infinity","Error","animation","animate","_objectSpread","prefersReducedMotion","addEventListener","once","e","window","matchMedia","matches","stopAnimations","all","getAnimations","map","handleAnimationEvent","requestAnimationFrame","cancel","shimKeyframesHeightAuto","calculatedHeight","keyframe","height"],"mappings":"+8CAGgBA,CAAAA,CAAAA,CAAUC,CAAiBC,CAAAA,CAAAA,CAAuBC,CAChE,CAAA,CAAA,MAAO,IAAIC,CAAAA,OAAQC,CAAAA,SAAAA,CAAAA,CAAAA,CACjB,GAAIF,CAAAA,CAAAA,SAAAA,CAAAA,iBAAAA,CAAAA,CAASG,QAAaC,IAAAA,CAAAA,CAAAA,CAAAA,CACxB,KAAM,IAAIC,CAAAA,KAAAA,CAAM,0CAGlB,CAAA,CAAA,GAAMC,CAAAA,CAAYR,CAAAA,CAAAA,CAAGS,QAAQR,CAAW,CAAAS,aAAA,CAAAA,aAAA,IACnCR,CACHG,MAAAA,QAAAA,CAAUM,CAAyB,CAAA,CAAA,CAAA,CAAA,CAAIT,EAASG,QAGlDG,EAAAA,CAAAA,CAAAA,CAAAA,CAAUI,gBAAiB,CAAA,QAAA,CAAUR,CAAS,CAAA,CAAES,MAAM,CACtDL,CAAAA,CAAAA,CAAAA,CAAAA,CAAUI,gBAAiB,CAAA,QAAA,CAAUR,CAAS,CAAA,CAAES,MAAM,CAAO,CAAA,CAAA,EAAA,CAEjE,UAkBgBF,CAAAA,CAEdG,CAAA,CAAA,CAAA,MADcC,CAAAA,OAAOC,UAAW,CAAA,kCAAA,CAAA,CACnBC,OACf,EAKM,QAAUC,CAAAA,CAAAA,CAAelB,GAC7B,MAAOG,CAAAA,OAAAA,CAAQgB,GACbnB,CAAAA,CAAAA,CAAGoB,aAAgBC,CAAAA,CAAAA,CAAAA,GAAAA,CAAIb,SAAAA,SACd,IAAIL,CAAAA,OAAAA,CAAQC,SAAAA,CACjB,CAAA,CAAA,GAAMkB,CAAAA,CAAuBC,CAAAA,qBAAAA,CAAsBnB,GAEnDI,CAAUI,CAAAA,gBAAAA,CAAiB,QAAU,CAAA,iBAAMU,CAAAA,CAAsB,GAAA,CAAET,MAAM,CACzEL,CAAAA,CAAAA,CAAAA,CAAAA,CAAUI,gBAAiB,CAAA,QAAA,CAAU,iBAAMU,CAAAA,CAAAA,GAAsB,CAAET,IAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CACzEL,CAAUgB,CAAAA,MAAAA,CAAAA,CAAQ,EAI1B,CAAA,EAAA,CAAA,CAAA,EAMgB,QAAAC,CAAAA,CAAwBxB,CAAAA,CAAAA,CAAuByB,CAC7D,CAAA,CAAA,MAAOzB,CAAAA,CAAUoB,CAAAA,GAAAA,CAAIM,SAAAA,yCAChBA,CAAAA,MACHC,MAA4B,CAAA,MAAA,GAApBD,CAASC,CAAAA,MAAAA,IAAAA,MAAAA,CAAuBF,CAAAA,OAAuBC,CAASC,CAAAA,MAAAA,IAAAA,CAE5E"}
@@ -1 +1 @@
1
- function e(e,n,o){return new Promise((t=>{if(o?.duration===1/0)throw new Error("Promise-based animations must be finite.");const i=e.animate(n,{...o,duration:r()?0:o.duration});i.addEventListener("cancel",t,{once:!0}),i.addEventListener("finish",t,{once:!0})}))}function n(e){return(e=e.toString().toLowerCase()).indexOf("ms")>-1?parseFloat(e):e.indexOf("s")>-1?1e3*parseFloat(e):parseFloat(e)}function r(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}function o(e){return Promise.all(e.getAnimations().map((e=>new Promise((n=>{const r=requestAnimationFrame(n);e.addEventListener("cancel",(()=>r),{once:!0}),e.addEventListener("finish",(()=>r),{once:!0}),e.cancel()})))))}function t(e,n){return e.map((e=>({...e,height:"auto"===e.height?`${n}px`:e.height})))}export{e as a,t as b,n as p,o as s};
1
+ function n(n,o,r){return new Promise((i=>{if(r?.duration===1/0)throw new Error("Promise-based animations must be finite.");const t=n.animate(o,{...r,duration:e()?0:r.duration});t.addEventListener("cancel",i,{once:!0}),t.addEventListener("finish",i,{once:!0})}))}function e(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}function o(n){return Promise.all(n.getAnimations().map((n=>new Promise((e=>{const o=requestAnimationFrame(e);n.addEventListener("cancel",(()=>o),{once:!0}),n.addEventListener("finish",(()=>o),{once:!0}),n.cancel()})))))}function r(n,e){return n.map((n=>({...n,height:"auto"===n.height?`${e}px`:n.height})))}export{n as a,r as b,o as s};
@@ -1,2 +1,2 @@
1
- System.register(["./nile-tooltip.cjs.js","tslib","./nile-tooltip.css.cjs.js","lit","../nile-popup/nile-popup.cjs.js","lit/directives/class-map.js","lit/decorators.js","../internal/nile-element.cjs.js","../nile-popup/nile-popup.css.cjs.js","../internal/animate.cjs.js","../utilities/animation-registry.cjs.js","../internal/event.cjs.js","../internal/watch.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileTooltipCjsJs){_export("NileTooltip",_nileTooltipCjsJs.N);},function(_tslib){},function(_nileTooltipCssCjsJs){},function(_lit){},function(_nilePopupNilePopupCjsJs){},function(_litDirectivesClassMapJs){},function(_litDecoratorsJs){},function(_internalNileElementCjsJs){},function(_nilePopupNilePopupCssCjsJs){},function(_internalAnimateCjsJs){},function(_utilitiesAnimationRegistryCjsJs){},function(_internalEventCjsJs){},function(_internalWatchCjsJs){}],execute:function execute(){}};});
1
+ System.register(["./nile-tooltip.cjs.js","tslib","lit","lit/decorators.js","lit/directives/class-map.js","./nile-tooltip.css.cjs.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_nileTooltipCjsJs){_export("NileTooltip",_nileTooltipCjsJs.N);},function(_tslib){},function(_lit){},function(_litDecoratorsJs){},function(_litDirectivesClassMapJs){},function(_nileTooltipCssCjsJs){},function(_internalNileElementCjsJs){}],execute:function execute(){}};});
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- export{N as NileTooltip}from"./nile-tooltip.esm.js";import"tslib";import"./nile-tooltip.css.esm.js";import"lit";import"../nile-popup/nile-popup.esm.js";import"lit/directives/class-map.js";import"lit/decorators.js";import"../internal/nile-element.esm.js";import"../nile-popup/nile-popup.css.esm.js";import"../internal/animate.esm.js";import"../utilities/animation-registry.esm.js";import"../internal/event.esm.js";import"../internal/watch.esm.js";
1
+ export{N as NileTooltip}from"./nile-tooltip.esm.js";import"tslib";import"lit";import"lit/decorators.js";import"lit/directives/class-map.js";import"./nile-tooltip.css.esm.js";import"../internal/nile-element.esm.js";
@@ -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","./nile-tooltip.css.cjs.js","../nile-popup/nile-popup.cjs.js","../internal/animate.cjs.js","lit/directives/class-map.js","lit/decorators.js","../utilities/animation-registry.cjs.js","lit","../internal/event.cjs.js","../internal/watch.cjs.js","../internal/nile-element.cjs.js","../nile-popup/nile-popup.css.cjs.js"],function(_export,_context){"use strict";var t,i,s,e,o,h,a,l,n,r,p,d,c,u,m,_templateObject,f;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},"");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,"_invoke",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)};}catch(t){return{type:"throw",arg:t};}}e.wrap=wrap;var h="suspendedStart",l="suspendedYield",f="executing",s="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==_typeof(h)&&n.call(h,"__await")?e.resolve(h.__await).then(function(t){invoke("next",t,i,a);},function(t){invoke("throw",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke("throw",t,i,a);});}a(c.arg);}var r;o(this,"_invoke",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw Error("Generator is already running");if(o===s){if("throw"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else"return"===n.method&&n.abrupt("return",n.arg);o=f;var p=tryCatch(e,r,n);if("normal"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}"throw"===p.type&&(o=s,n.method="throw",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator["return"]&&(r.method="return",r.arg=t,maybeInvokeDelegate(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=tryCatch(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o<e.length;)if(n.call(e,o))return next.value=e[o],next.done=!1,next;return next.value=t,next.done=!0,next;};return i.next=i;}}throw new TypeError(_typeof(e)+" is not iterable");}return GeneratorFunction.prototype=GeneratorFunctionPrototype,o(g,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),o(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name));},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,u,"GeneratorFunction")),t.prototype=Object.create(g),t;},e.awrap=function(t){return{__await:t};},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,c,function(){return this;}),e.AsyncIterator=AsyncIterator,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next();});},defineIteratorMethods(g),define(g,u,"Generator"),define(g,a,function(){return this;}),define(g,"toString",function(){return"[object Generator]";}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function next(){for(;r.length;){var t=r.pop();if(t in e)return next.value=t,next.done=!1,next;}return next.done=!0,next;};},e.values=values,Context.prototype={constructor:Context,reset:function reset(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(resetTryEntry),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t);},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval;},dispatchException:function dispatchException(e){if(this.done)throw e;var r=this;function handle(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o;}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc);}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break;}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a);},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y;},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},"catch":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw Error("illegal catch attempt");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y;}},e;}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value;}catch(n){return void e(n);}i.done?t(u):Promise.resolve(u).then(r,o);}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n);}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n);}_next(void 0);});};}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(_nileTooltipCssCjsJs){i=_nileTooltipCssCjsJs.s;},function(_nilePopupNilePopupCjsJs){},function(_internalAnimateCjsJs){s=_internalAnimateCjsJs.p;e=_internalAnimateCjsJs.s;o=_internalAnimateCjsJs.a;},function(_litDirectivesClassMapJs){h=_litDirectivesClassMapJs.classMap;},function(_litDecoratorsJs){a=_litDecoratorsJs.query;l=_litDecoratorsJs.property;n=_litDecoratorsJs.customElement;},function(_utilitiesAnimationRegistryCjsJs){r=_utilitiesAnimationRegistryCjsJs.s;p=_utilitiesAnimationRegistryCjsJs.g;},function(_lit){d=_lit.html;},function(_internalEventCjsJs){c=_internalEventCjsJs.w;},function(_internalWatchCjsJs){u=_internalWatchCjsJs.w;},function(_internalNileElementCjsJs){m=_internalNileElementCjsJs.N;},function(_nilePopupNilePopupCssCjsJs){}],execute:function execute(){_export("N",f=/*#__PURE__*/function(_m){function f(){var _this;_classCallCheck(this,f);_this=_callSuper(this,f,arguments),_this.content="",_this.size="small",_this.placement="top",_this.disabled=!1,_this.distance=8,_this.open=!1,_this.skidding=0,_this.trigger="hover focus",_this.hoist=!1;return _this;}_inherits(f,_m);return _createClass(f,[{key:"connectedCallback",value:function connectedCallback(){var _this2=this;_superPropGet(f,"connectedCallback",this,3)([]),this.handleBlur=this.handleBlur.bind(this),this.handleClick=this.handleClick.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleMouseOver=this.handleMouseOver.bind(this),this.handleMouseOut=this.handleMouseOut.bind(this),this.updateComplete.then(function(){_this2.addEventListener("blur",_this2.handleBlur,!0),_this2.addEventListener("focus",_this2.handleFocus,!0),_this2.addEventListener("click",_this2.handleClick),_this2.addEventListener("keydown",_this2.handleKeyDown),_this2.addEventListener("mouseover",_this2.handleMouseOver),_this2.addEventListener("mouseout",_this2.handleMouseOut);});}},{key:"firstUpdated",value:function firstUpdated(){this.body.hidden=!this.open,this.open&&(this.popup.active=!0,this.popup.reposition());}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(f,"disconnectedCallback",this,3)([]),this.removeEventListener("blur",this.handleBlur,!0),this.removeEventListener("focus",this.handleFocus,!0),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("mouseover",this.handleMouseOver),this.removeEventListener("mouseout",this.handleMouseOut);}},{key:"handleBlur",value:function handleBlur(){this.hasTrigger("focus")&&this.hide();}},{key:"handleClick",value:function handleClick(){this.hasTrigger("click")&&(this.open?this.hide():this.show());}},{key:"handleFocus",value:function handleFocus(){this.hasTrigger("focus")&&this.show();}},{key:"handleKeyDown",value:function handleKeyDown(t){this.open&&"Escape"===t.key&&(t.stopPropagation(),this.hide());}},{key:"handleMouseOver",value:function handleMouseOver(){var _this3=this;if(this.hasTrigger("hover")){var _t=s(getComputedStyle(this).getPropertyValue("--show-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(function(){return _this3.show();},_t);}}},{key:"handleMouseOut",value:function handleMouseOut(){var _this4=this;if(this.hasTrigger("hover")){var _t2=s(getComputedStyle(this).getPropertyValue("--hide-delay"));clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(function(){return _this4.hide();},_t2);}}},{key:"hasTrigger",value:function hasTrigger(t){return this.trigger.split(" ").includes(t);}},{key:"handleOpenChange",value:function(){var _handleOpenChange=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var _p,_t3,_i,_p2,_t4,_i2;return _regeneratorRuntime().wrap(function _callee$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:if(!this.open){_context2.next=14;break;}if(!this.disabled){_context2.next=3;break;}return _context2.abrupt("return");case 3:this.emit("nile-show");_context2.next=6;return e(this.body);case 6:this.body.hidden=!1;this.popup.active=!0;_p=p(this,"tooltip.show",{dir:""}),_t3=_p.keyframes,_i=_p.options;_context2.next=11;return o(this.popup.popup,_t3,_i);case 11:this.emit("nile-after-show");_context2.next=23;break;case 14:this.emit("nile-hide");_context2.next=17;return e(this.body);case 17:_p2=p(this,"tooltip.hide",{dir:""}),_t4=_p2.keyframes,_i2=_p2.options;_context2.next=20;return o(this.popup.popup,_t4,_i2);case 20:this.popup.active=!1;this.body.hidden=!0;this.emit("nile-after-hide");case 23:case"end":return _context2.stop();}},_callee,this);}));function handleOpenChange(){return _handleOpenChange.apply(this,arguments);}return handleOpenChange;}()},{key:"handleOptionsChange",value:function(){var _handleOptionsChange=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){return _regeneratorRuntime().wrap(function _callee2$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.t0=this.hasUpdated;if(!_context3.t0){_context3.next=5;break;}_context3.next=4;return this.updateComplete;case 4:this.popup.reposition();case 5:case"end":return _context3.stop();}},_callee2,this);}));function handleOptionsChange(){return _handleOptionsChange.apply(this,arguments);}return handleOptionsChange;}()},{key:"handleDisabledChange",value:function handleDisabledChange(){this.disabled&&this.open&&this.hide();}},{key:"show",value:function(){var _show=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _this$content;return _regeneratorRuntime().wrap(function _callee3$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:if(!(!this.open&&(_this$content=this.content)!==null&&_this$content!==void 0&&_this$content.trim().length)){_context4.next=2;break;}return _context4.abrupt("return",(this.open=!0,c(this,"nile-after-show")));case 2:case"end":return _context4.stop();}},_callee3,this);}));function show(){return _show.apply(this,arguments);}return show;}()},{key:"hide",value:function(){var _hide=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){return _regeneratorRuntime().wrap(function _callee4$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:if(!this.open){_context5.next=2;break;}return _context5.abrupt("return",(this.open=!1,c(this,"nile-after-hide")));case 2:case"end":return _context5.stop();}},_callee4,this);}));function hide(){return _hide.apply(this,arguments);}return hide;}()},{key:"render",value:function render(){return d(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <nile-popup\n part=\"base\"\n exportparts=\"\n popup:base__popup,\n arrow:base__arrow\n \"\n class=","\n placement=","\n distance=","\n skidding=","\n strategy=","\n flip\n shift\n arrow\n >\n <slot slot=\"anchor\" aria-describedby=\"tooltip\"></slot>\n\n <slot\n name=\"content\"\n part=\"body\"\n id=\"tooltip\"\n class=","\n role=\"tooltip\"\n aria-live=","\n >\n ","\n </slot>\n </nile-popup>\n "])),h({tooltip:!0,"tooltip--open":this.open}),this.placement,this.distance,this.skidding,this.hoist?"fixed":"absolute",h({tooltip__body:!0,"tooltip__body--large":"large"===this.size}),this.open?"polite":"off",this.content);}}],[{key:"styles",get:function get(){return[i];}}]);}(m));t([a("slot:not([name])")],f.prototype,"defaultSlot",void 0),t([a(".tooltip__body")],f.prototype,"body",void 0),t([a("nile-popup")],f.prototype,"popup",void 0),t([l({type:String,reflect:!0})],f.prototype,"content",void 0),t([l({reflect:!0})],f.prototype,"size",void 0),t([l()],f.prototype,"placement",void 0),t([l({type:Boolean,reflect:!0})],f.prototype,"disabled",void 0),t([l({type:Number})],f.prototype,"distance",void 0),t([l({type:Boolean,reflect:!0})],f.prototype,"open",void 0),t([l({type:Number})],f.prototype,"skidding",void 0),t([l()],f.prototype,"trigger",void 0),t([l({type:Boolean})],f.prototype,"hoist",void 0),t([u("open",{waitUntilFirstUpdate:!0})],f.prototype,"handleOpenChange",null),t([u(["content","distance","hoist","placement","skidding"])],f.prototype,"handleOptionsChange",null),t([u("disabled")],f.prototype,"handleDisabledChange",null),_export("N",f=t([n("nile-tooltip")],f)),r("tooltip.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:150,easing:"ease"}}),r("tooltip.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:150,easing:"ease"}});}};});
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","lit/directives/class-map.js","./nile-tooltip.css.cjs.js","../internal/nile-element.cjs.js"],function(_export,_context){"use strict";var t,i,s,e,o,h,r,l,_templateObject,n;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}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){s=_litDecoratorsJs.property;e=_litDecoratorsJs.query;o=_litDecoratorsJs.customElement;},function(_litDirectivesClassMapJs){h=_litDirectivesClassMapJs.classMap;},function(_nileTooltipCssCjsJs){r=_nileTooltipCssCjsJs.s;},function(_internalNileElementCjsJs){l=_internalNileElementCjsJs.N;}],execute:function execute(){_export("N",n=/*#__PURE__*/function(_l){function n(){var _this;_classCallCheck(this,n);_this=_callSuper(this,n,arguments),_this.content="",_this.size="small",_this.placement="top",_this.disabled=!1,_this.open=!1,_this.trigger="hover focus",_this.distance=8,_this.skidding=0,_this.hoist=!1,_this.updateTooltipPosition=function(){if(!_this.tooltip||!_this.open)return;var t=_this.slotElement.assignedElements()[0];if(!t)return;var i=t.getBoundingClientRect(),s=_this.tooltip.getBoundingClientRect(),e=window.innerWidth,o=window.innerHeight;var h=0,r=0,l=_this.placement;var _n=_this.getBasePlacement(_this.placement),c=_this.getAlignmentModifier(_this.placement),a=i.left-s.width-_this.distance>0,d=i.right+s.width+_this.distance<e,p=i.bottom+s.height+_this.distance<o,m=i.top-s.height-_this.distance>0;var u=_n;"left"===_n&&!a||"right"===_n&&!d?u=p?"bottom":m?"top":"bottom":"top"!==_n||m?"bottom"!==_n||p||(u=m?"top":a?"left":"right"):u=p?"bottom":a?"left":"right";var f=c;switch("left"!==_n&&"right"!==_n||"top"!==u&&"bottom"!==u||("start"===c?f="start":"end"===c&&(f="end")),u){case"left":h=i.top+(i.height-s.height)/2+_this.skidding,r=i.left-s.width-_this.distance;break;case"right":h=i.top+(i.height-s.height)/2+_this.skidding,r=i.right+_this.distance;break;case"top":h=i.top-s.height-_this.distance,r=i.left+(i.width-s.width)/2+_this.skidding;break;case"bottom":h=i.bottom+_this.distance,r=i.left+(i.width-s.width)/2+_this.skidding;}"top"!==u&&"bottom"!==u||!f||("start"===f?r=i.left+_this.skidding:"end"===f&&(r=i.right-s.width+_this.skidding)),"left"!==u&&"right"!==u||!f||("start"===f?h=i.top+_this.skidding:"end"===f&&(h=i.bottom-s.height+_this.skidding)),l=f?"".concat(u,"-").concat(f):u,r<0&&(r=5),r+s.width>e&&(r=e-s.width-5),h<0&&(h=5),h+s.height>o&&(h=o-s.height-5),_this.tooltip.style.top="".concat(h,"px"),_this.tooltip.style.left="".concat(r,"px"),_this.tooltip.setAttribute("data-placement",l);},_this.showTooltip=function(){_this.disabled||(_this.open=!0,_this.emit("nile-show"),_this.updateComplete.then(function(){_this.updateTooltipPosition(),_this.tooltip.addEventListener("transitionend",_this.handleAfterShow,{once:!0});}));},_this.handleAfterShow=function(){_this.emit("nile-after-show");},_this.hideTooltip=function(){_this.open&&(_this.emit("nile-hide"),_this.open=!1,_this.tooltip.addEventListener("transitionend",_this.handleAfterHide,{once:!0}));},_this.handleAfterHide=function(){_this.emit("nile-after-hide");},_this.handleMouseOver=function(){_this.trigger.includes("hover")&&(clearTimeout(_this.hoverTimeout),_this.hoverTimeout=window.setTimeout(function(){return _this.showTooltip();},150));},_this.handleMouseOut=function(){_this.trigger.includes("hover")&&(clearTimeout(_this.hoverTimeout),_this.hoverTimeout=window.setTimeout(function(){return _this.hideTooltip();},0));},_this.handleClick=function(){_this.trigger.includes("click")&&(_this.open=!_this.open,_this.emit("nile-show"),_this.updateComplete.then(function(){return _this.updateTooltipPosition();}));},_this.handleFocus=function(){_this.trigger.includes("focus")&&_this.showTooltip();},_this.handleBlur=function(){_this.trigger.includes("focus")&&_this.hideTooltip();};return _this;}_inherits(n,_l);return _createClass(n,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(n,"connectedCallback",this,3)([]),window.addEventListener("resize",this.updateTooltipPosition),window.addEventListener("scroll",this.updateTooltipPosition,!0);}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(n,"disconnectedCallback",this,3)([]),window.removeEventListener("resize",this.updateTooltipPosition),window.removeEventListener("scroll",this.updateTooltipPosition,!0);}},{key:"getBasePlacement",value:function getBasePlacement(t){return t.split("-")[0];}},{key:"getAlignmentModifier",value:function getAlignmentModifier(t){var i=t.split("-");return i.length>1?i[1]:null;}},{key:"updated",value:function updated(t){_superPropGet(n,"updated",this,3)([t]),(t.has("open")||t.has("hoist"))&&this.open&&this.hoist;}},{key:"render",value:function render(){return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div class=",">\n ","\n </div>\n <slot\n @mouseover=","\n @mouseout=","\n @click=","\n @focus=","\n @blur=","\n aria-describedby=\"tooltip\"\n ></slot>\n "])),h({tooltip:!0,"tooltip__body--large":"large"===this.size}),this.content,this.handleMouseOver,this.handleMouseOut,this.handleClick,this.handleFocus,this.handleBlur);}}],[{key:"styles",get:function get(){return[r];}}]);}(l));t([s({type:String})],n.prototype,"content",void 0),t([s({reflect:!0})],n.prototype,"size",void 0),t([s({type:String})],n.prototype,"placement",void 0),t([s({type:Boolean,reflect:!0})],n.prototype,"disabled",void 0),t([s({type:Boolean,reflect:!0})],n.prototype,"open",void 0),t([s()],n.prototype,"trigger",void 0),t([s({type:Number})],n.prototype,"distance",void 0),t([s({type:Number})],n.prototype,"skidding",void 0),t([s({type:Boolean})],n.prototype,"hoist",void 0),t([e(".tooltip")],n.prototype,"tooltip",void 0),t([e("slot")],n.prototype,"slotElement",void 0),_export("N",n=t([o("nile-tooltip")],n));}};});
2
2
  //# sourceMappingURL=nile-tooltip.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-tooltip.cjs.js","sources":["../../../src/nile-tooltip/nile-tooltip.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\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 { LitElement, CSSResultArray, TemplateResult } from 'lit';\nimport { styles } from './nile-tooltip.css';\nimport '../nile-popup/nile-popup';\nimport { animateTo, parseDuration, stopAnimations } from '../internal/animate';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport {\n getAnimation,\n setDefaultAnimation,\n} from '../utilities/animation-registry';\nimport { html } from 'lit';\n// import { LocalizeController } from '../utilities/localize';\nimport { waitForEvent } from '../internal/event';\nimport { watch } from '../internal/watch';\nimport NileElement from '../internal/nile-element';\nimport type { CSSResultGroup } from 'lit';\nimport type NilePopup from '../nile-popup/nile-popup';\n/**\n * Nile icon component.\n *\n * @tag nile-tooltip\n *\n */\n@customElement('nile-tooltip')\nexport class NileTooltip extends NileElement {\n /**\n * The styles for Tooltip\n * @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`\n */\n public static get styles(): CSSResultArray {\n return [styles];\n }\n\n private hoverTimeout: number;\n // private readonly localize = new LocalizeController(this);\n\n @query('slot:not([name])') defaultSlot: HTMLSlotElement;\n @query('.tooltip__body') body: HTMLElement;\n @query('nile-popup') popup: NilePopup;\n\n /** The tooltip's content. If you need to display HTML, use the `content` slot instead. */\n @property({ type: String, reflect: true }) content = '';\n\n /** Size Property to decide the tool tip size */\n @property({ reflect: true }) size: 'small' | 'large' = 'small';\n\n /**\n * The preferred placement of the tooltip. Note that the actual placement may vary as needed to keep the tooltip\n * inside of the viewport.\n */\n @property() placement:\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end' = 'top';\n\n /** Disables the tooltip so it won't show when triggered. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /** The distance in pixels from which to offset the tooltip away from its target. */\n @property({ type: Number }) distance = 8;\n\n /** Indicates whether or not the tooltip is open. You can use this in lieu of the show/hide methods. */\n @property({ type: Boolean, reflect: true }) open = false;\n\n /** The distance in pixels from which to offset the tooltip along its target. */\n @property({ type: Number }) skidding = 0;\n\n /**\n * Controls how the tooltip is activated. Possible options include `click`, `hover`, `focus`, and `manual`. Multiple\n * options can be passed by separating them with a space. When manual is used, the tooltip must be activated\n * programmatically.\n */\n @property() trigger = 'hover focus';\n\n /**\n * Enable this option to prevent the tooltip from being clipped when the component is placed inside a container with\n * `overflow: auto|hidden|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all,\n * scenarios.\n */\n @property({ type: Boolean }) hoist = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.handleBlur = this.handleBlur.bind(this);\n this.handleClick = this.handleClick.bind(this);\n this.handleFocus = this.handleFocus.bind(this);\n this.handleKeyDown = this.handleKeyDown.bind(this);\n this.handleMouseOver = this.handleMouseOver.bind(this);\n this.handleMouseOut = this.handleMouseOut.bind(this);\n\n this.updateComplete.then(() => {\n this.addEventListener('blur', this.handleBlur, true);\n this.addEventListener('focus', this.handleFocus, true);\n this.addEventListener('click', this.handleClick);\n this.addEventListener('keydown', this.handleKeyDown);\n this.addEventListener('mouseover', this.handleMouseOver);\n this.addEventListener('mouseout', this.handleMouseOut);\n });\n }\n\n firstUpdated() {\n this.body.hidden = !this.open;\n\n // If the tooltip is visible on init, update its position\n if (this.open) {\n this.popup.active = true;\n this.popup.reposition();\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('blur', this.handleBlur, true);\n this.removeEventListener('focus', this.handleFocus, true);\n this.removeEventListener('click', this.handleClick);\n this.removeEventListener('keydown', this.handleKeyDown);\n this.removeEventListener('mouseover', this.handleMouseOver);\n this.removeEventListener('mouseout', this.handleMouseOut);\n }\n\n private handleBlur() {\n if (this.hasTrigger('focus')) {\n this.hide();\n }\n }\n\n private handleClick() {\n if (this.hasTrigger('click')) {\n if (this.open) {\n this.hide();\n } else {\n this.show();\n }\n }\n }\n\n private handleFocus() {\n if (this.hasTrigger('focus')) {\n this.show();\n }\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n // Pressing escape when the target element has focus should dismiss the tooltip\n if (this.open && event.key === 'Escape') {\n event.stopPropagation();\n this.hide();\n }\n }\n\n private handleMouseOver() {\n if (this.hasTrigger('hover')) {\n const delay = parseDuration(\n getComputedStyle(this).getPropertyValue('--show-delay')\n );\n clearTimeout(this.hoverTimeout);\n this.hoverTimeout = window.setTimeout(() => this.show(), delay);\n }\n }\n\n private handleMouseOut() {\n if (this.hasTrigger('hover')) {\n const delay = parseDuration(\n getComputedStyle(this).getPropertyValue('--hide-delay')\n );\n clearTimeout(this.hoverTimeout);\n this.hoverTimeout = window.setTimeout(() => this.hide(), delay);\n }\n }\n\n private hasTrigger(triggerType: string) {\n const triggers = this.trigger.split(' ');\n return triggers.includes(triggerType);\n }\n\n @watch('open', { waitUntilFirstUpdate: true })\n async handleOpenChange() {\n if (this.open) {\n if (this.disabled) {\n return;\n }\n\n // Show\n this.emit('nile-show');\n\n await stopAnimations(this.body);\n this.body.hidden = false;\n this.popup.active = true;\n const { keyframes, options } = getAnimation(this, 'tooltip.show', {\n dir: '',\n });\n await animateTo(this.popup.popup, keyframes, options);\n\n this.emit('nile-after-show');\n } else {\n // Hide\n this.emit('nile-hide');\n\n await stopAnimations(this.body);\n const { keyframes, options } = getAnimation(this, 'tooltip.hide', {\n dir: '',\n });\n await animateTo(this.popup.popup, keyframes, options);\n this.popup.active = false;\n this.body.hidden = true;\n\n this.emit('nile-after-hide');\n }\n }\n\n @watch(['content', 'distance', 'hoist', 'placement', 'skidding'])\n async handleOptionsChange() {\n if (this.hasUpdated) {\n await this.updateComplete;\n this.popup.reposition();\n }\n }\n\n @watch('disabled')\n handleDisabledChange() {\n if (this.disabled && this.open) {\n this.hide();\n }\n }\n\n /** Shows the tooltip. */\n async show() {\n if (this.open || !this.content?.trim().length) {\n return undefined;\n }\n\n this.open = true;\n return waitForEvent(this, 'nile-after-show');\n }\n\n /** Hides the tooltip */\n async hide() {\n if (!this.open) {\n return undefined;\n }\n\n this.open = false;\n return waitForEvent(this, 'nile-after-hide');\n }\n\n render() {\n return html`\n <nile-popup\n part=\"base\"\n exportparts=\"\n popup:base__popup,\n arrow:base__arrow\n \"\n class=${classMap({\n tooltip: true,\n 'tooltip--open': this.open,\n })}\n placement=${this.placement}\n distance=${this.distance}\n skidding=${this.skidding}\n strategy=${this.hoist ? 'fixed' : 'absolute'}\n flip\n shift\n arrow\n >\n <slot slot=\"anchor\" aria-describedby=\"tooltip\"></slot>\n\n <slot\n name=\"content\"\n part=\"body\"\n id=\"tooltip\"\n class=${classMap({\n tooltip__body: true,\n 'tooltip__body--large': this.size === 'large',\n })}\n role=\"tooltip\"\n aria-live=${this.open ? 'polite' : 'off'}\n >\n ${this.content}\n </slot>\n </nile-popup>\n `;\n }\n}\n\nsetDefaultAnimation('tooltip.show', {\n keyframes: [\n { opacity: 0, scale: 0.8 },\n { opacity: 1, scale: 1 },\n ],\n options: { duration: 150, easing: 'ease' },\n});\n\nsetDefaultAnimation('tooltip.hide', {\n keyframes: [\n { opacity: 1, scale: 1 },\n { opacity: 0, scale: 0.8 },\n ],\n options: { duration: 150, easing: 'ease' },\n});\n\nexport default NileTooltip;\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-tooltip': NileTooltip;\n }\n}\n"],"names":["NileTooltip","f","constructor","this","content","size","placement","disabled","distance","open","skidding","trigger","hoist","_this","_inherits","_m","_createClass","key","value","connectedCallback","super","handleBlur","bind","handleClick","handleFocus","handleKeyDown","handleMouseOver","handleMouseOut","updateComplete","then","addEventListener","firstUpdated","body","hidden","popup","active","reposition","disconnectedCallback","removeEventListener","hasTrigger","hide","show","event","stopPropagation","delay","parseDuration","getComputedStyle","getPropertyValue","clearTimeout","hoverTimeout","window","setTimeout","_this4","triggerType","split","includes","_handleOpenChange","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_p","_t3","_i","_p2","_t4","_i2","wrap","_callee$","_context2","prev","next","emit","stopAnimations","getAnimation","dir","animateTo","keyframes","options","stop","handleOpenChange","_callee2","_callee2$","_context3","t0","hasUpdated","handleOptionsChange","handleDisabledChange","_show","_callee3","_this$content","_callee3$","_context4","trim","length","abrupt","waitForEvent","_callee4","_callee4$","_context5","render","html","_templateObject","_taggedTemplateLiteral","classMap","tooltip","tooltip__body","__decorate","get","styles","NileElement","query","prototype","property","type","String","reflect","Boolean","Number","watch","waitUntilFirstUpdate","customElement","setDefaultAnimation","opacity","scale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AA,CAAA,CAGpCJ,EAAoB,cAAgB,CAAA,CAClC7C,UAAW,CACT,CAAE8C,QAAS,CAAGC,CAAAA,KAAAA,CAAO,GACrB,CAAED,OAAAA,CAAS,EAAGC,KAAO,CAAA,EAAA,CAAA,CAAA,CAEvB9C,QAAS,CAAE+C,QAAAA,CAAU,GAAKC,CAAAA,MAAAA,CAAQ"}
1
+ {"version":3,"file":"nile-tooltip.cjs.js","sources":["../../../src/nile-tooltip/nile-tooltip.ts"],"sourcesContent":["import { LitElement, html, css, CSSResultArray } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styles } from './nile-tooltip.css';\nimport NileElement from '../internal/nile-element';\n\ntype TooltipPlacement = \n | 'top' | 'top-start' | 'top-end' \n | 'right' | 'right-start' | 'right-end' \n | 'bottom' | 'bottom-start' | 'bottom-end' \n | 'left' | 'left-start' | 'left-end';\n\n// CSS Anchor positiong\n@customElement('nile-tooltip')\nexport class NileTooltip extends NileElement {\n @property({ type: String }) content = '';\n @property({ reflect: true }) size: 'small' | 'large' = 'small';\n @property({ type: String }) placement: TooltipPlacement = 'top';\n @property({ type: Boolean, reflect: true }) disabled = false;\n @property({ type: Boolean, reflect: true }) open = false;\n @property() trigger = 'hover focus';\n @property({ type: Number }) distance = 8;\n @property({ type: Number }) skidding = 0;\n @property({ type: Boolean }) hoist = false;\n\n @query('.tooltip') tooltip!: HTMLElement;\n @query('slot') slotElement!: HTMLSlotElement;\n\n private hoverTimeout: number;\n\n public static get styles(): CSSResultArray {\n return [styles];\n }\n \n\n \n \n connectedCallback() {\n super.connectedCallback();\n window.addEventListener('resize', this.updateTooltipPosition);\n window.addEventListener('scroll', this.updateTooltipPosition, true);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n window.removeEventListener('resize', this.updateTooltipPosition);\n window.removeEventListener('scroll', this.updateTooltipPosition, true);\n }\n\n private getBasePlacement(placement: TooltipPlacement): 'top' | 'right' | 'bottom' | 'left' {\n return placement.split('-')[0] as 'top' | 'right' | 'bottom' | 'left';\n }\n\n private getAlignmentModifier(placement: TooltipPlacement): 'start' | 'end' | null {\n const parts = placement.split('-');\n return parts.length > 1 ? parts[1] as 'start' | 'end' : null;\n }\n\n private updateTooltipPosition = () => {\n if (!this.tooltip || !this.open) return;\n\n const triggerEl = this.slotElement.assignedElements()[0] as HTMLElement;\n if (!triggerEl) return;\n\n \n \n const triggerRect = triggerEl.getBoundingClientRect();\n const tooltipRect = this.tooltip.getBoundingClientRect();\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n \n let top = 0, left = 0;\n let finalPlacement = this.placement;\n const basePlacement = this.getBasePlacement(this.placement);\n const alignment = this.getAlignmentModifier(this.placement);\n\n \n const fitsLeft = triggerRect.left - tooltipRect.width - this.distance > 0;\n const fitsRight = triggerRect.right + tooltipRect.width + this.distance < viewportWidth;\n const fitsBottom = triggerRect.bottom + tooltipRect.height + this.distance < viewportHeight;\n const fitsTop = triggerRect.top - tooltipRect.height - this.distance > 0;\n\n \n let finalBasePlacement = basePlacement;\n \n \n if ((basePlacement === 'left' && !fitsLeft) || (basePlacement === 'right' && !fitsRight)) {\n finalBasePlacement = fitsBottom ? 'bottom' : (fitsTop ? 'top' : 'bottom');\n } \n \n else if (basePlacement === 'top' && !fitsTop) {\n finalBasePlacement = fitsBottom ? 'bottom' : (fitsLeft ? 'left' : 'right');\n } else if (basePlacement === 'bottom' && !fitsBottom) {\n finalBasePlacement = fitsTop ? 'top' : (fitsLeft ? 'left' : 'right');\n }\n\n \n let finalAlignment = alignment;\n \n \n if ((basePlacement === 'left' || basePlacement === 'right') && \n (finalBasePlacement === 'top' || finalBasePlacement === 'bottom')) {\n \n if (alignment === 'start') {\n finalAlignment = 'start';\n } else if (alignment === 'end') {\n finalAlignment = 'end';\n }\n }\n\n \n switch (finalBasePlacement) {\n case 'left':\n top = triggerRect.top + (triggerRect.height - tooltipRect.height) / 2 + this.skidding;\n left = triggerRect.left - tooltipRect.width - this.distance;\n break;\n case 'right':\n top = triggerRect.top + (triggerRect.height - tooltipRect.height) / 2 + this.skidding;\n left = triggerRect.right + this.distance;\n break;\n case 'top':\n top = triggerRect.top - tooltipRect.height - this.distance;\n left = triggerRect.left + (triggerRect.width - tooltipRect.width) / 2 + this.skidding;\n break;\n case 'bottom':\n top = triggerRect.bottom + this.distance;\n left = triggerRect.left + (triggerRect.width - tooltipRect.width) / 2 + this.skidding;\n break;\n }\n\n \n if ((finalBasePlacement === 'top' || finalBasePlacement === 'bottom') && finalAlignment) {\n if (finalAlignment === 'start') {\n left = triggerRect.left + this.skidding;\n } else if (finalAlignment === 'end') {\n left = triggerRect.right - tooltipRect.width + this.skidding;\n }\n }\n \n \n if ((finalBasePlacement === 'left' || finalBasePlacement === 'right') && finalAlignment) {\n if (finalAlignment === 'start') {\n top = triggerRect.top + this.skidding;\n } else if (finalAlignment === 'end') {\n top = triggerRect.bottom - tooltipRect.height + this.skidding;\n }\n }\n\n \n finalPlacement = finalAlignment ? `${finalBasePlacement}-${finalAlignment}` : finalBasePlacement;\n\n \n if (left < 0) left = 5;\n if (left + tooltipRect.width > viewportWidth) left = viewportWidth - tooltipRect.width - 5;\n if (top < 0) top = 5;\n if (top + tooltipRect.height > viewportHeight) top = viewportHeight - tooltipRect.height - 5;\n\n \n this.tooltip.style.top = `${top}px`;\n this.tooltip.style.left = `${left}px`;\n this.tooltip.setAttribute('data-placement', finalPlacement as string);\n };\n\n private showTooltip = () => {\n if (!this.disabled) {\n this.open = true;\n this.emit('nile-show');\n this.updateComplete.then(() => {\n this.updateTooltipPosition();\n \n \n this.tooltip.addEventListener('transitionend', this.handleAfterShow, { once: true });\n });\n }\n };\n \n private handleAfterShow = () => {\n this.emit('nile-after-show');\n };\n \n\n private hideTooltip = () => {\n if (!this.open) return;\n \n this.emit('nile-hide');\n this.open = false;\n \n this.tooltip.addEventListener('transitionend', this.handleAfterHide, { once: true });\n };\n \n private handleAfterHide = () => {\n this.emit('nile-after-hide');\n };\n \n private handleMouseOver = () => {\n if (this.trigger.includes('hover')) {\n clearTimeout(this.hoverTimeout);\n this.hoverTimeout = window.setTimeout(() => this.showTooltip(), 150);\n }\n };\n\n private handleMouseOut = () => {\n if (this.trigger.includes('hover')) {\n clearTimeout(this.hoverTimeout);\n this.hoverTimeout = window.setTimeout(() => this.hideTooltip(), 0);\n }\n };\n\n private handleClick = () => {\n if (this.trigger.includes('click')) {\n this.open = !this.open;\n this.emit('nile-show');\n this.updateComplete.then(() => this.updateTooltipPosition());\n }\n };\n\n updated(changedProperties: Map<string, any>) {\n super.updated(changedProperties);\n \n \n if (changedProperties.has('open') || changedProperties.has('hoist')) {\n if (this.open && this.hoist) {\n \n }\n }\n }\n\n private handleFocus = () => {\n if (this.trigger.includes('focus')) {\n this.showTooltip();\n }\n };\n\n private handleBlur = () => {\n if (this.trigger.includes('focus')) {\n this.hideTooltip();\n }\n };\n\n render() {\n return html`\n <div class=${classMap({ tooltip: true, 'tooltip__body--large': this.size === 'large' })}>\n ${this.content}\n </div>\n <slot\n @mouseover=${this.handleMouseOver}\n @mouseout=${this.handleMouseOut}\n @click=${this.handleClick}\n @focus=${this.handleFocus}\n @blur=${this.handleBlur}\n aria-describedby=\"tooltip\"\n ></slot>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-tooltip': NileTooltip;\n }\n}"],"names":["NileTooltip","_l","n","this","content","size","placement","disabled","open","trigger","distance","skidding","hoist","updateTooltipPosition","tooltip","triggerEl","slotElement","assignedElements","triggerRect","getBoundingClientRect","tooltipRect","viewportWidth","window","innerWidth","viewportHeight","innerHeight","top","left","finalPlacement","basePlacement","getBasePlacement","alignment","getAlignmentModifier","fitsLeft","width","fitsRight","right","fitsBottom","bottom","height","fitsTop","finalBasePlacement","finalAlignment","style","concat","setAttribute","showTooltip","emit","updateComplete","then","addEventListener","handleAfterShow","once","hideTooltip","handleAfterHide","handleMouseOver","includes","clearTimeout","hoverTimeout","setTimeout","handleMouseOut","handleClick","handleFocus","handleBlur","_this","_inherits","_createClass","key","value","connectedCallback","super","disconnectedCallback","removeEventListener","split","parts","length","updated","changedProperties","has","render","html","_templateObject","_taggedTemplateLiteral","classMap","__decorate","get","styles","NileElement","property","type","String","prototype","reflect","Boolean","Number","query","customElement"],"mappings":"+wHAcaA,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,qEACuBC,EAAAA,KAAAA,CAAOC,QAAG,EACTD,CAAAA,KAAAA,CAAIE,IAAsB,CAAA,OAAA,CAC3BF,KAAAA,CAASG,SAAAA,CAAqB,KACdH,CAAAA,KAAAA,CAAQI,UAAG,CACXJ,CAAAA,KAAAA,CAAIK,IAAG,CAAA,CAAA,CAAA,CACvCL,KAAAA,CAAOM,OAAAA,CAAG,aACMN,CAAAA,KAAAA,CAAQO,SAAG,CACXP,CAAAA,KAAAA,CAAQQ,QAAG,CAAA,CAAA,CACVR,KAAAA,CAAKS,KAAAA,CAAAA,CAAG,CAmC7BT,CAAAA,KAAAA,CAAqBU,sBAAG,UAC9B,CAAA,GAAA,CAAKV,KAAAA,CAAKW,OAAAA,EAAAA,CAAYX,KAAAA,CAAKK,IAAAA,CAAM,OAEjC,GAAMO,CAAAA,EAAYZ,KAAAA,CAAKa,WAAAA,CAAYC,gBAAmB,CAAA,CAAA,CAAA,CAAA,CAAA,CACtD,GAAKF,CAAAA,CAAAA,CAAW,OAIhB,GAAMG,CAAAA,EAAcH,CAAUI,CAAAA,qBAAAA,CAAAA,CAAAA,CACxBC,CAAcjB,CAAAA,KAAAA,CAAKW,OAAQK,CAAAA,qBAAAA,CAAAA,CAAAA,CAC3BE,CAAgBC,CAAAA,MAAAA,CAAOC,WACvBC,CAAiBF,CAAAA,MAAAA,CAAOG,WAE9B,CAAA,GAAIC,CAAAA,CAAM,CAAA,CAAA,CAAGC,CAAO,CAAA,CAAA,CAChBC,EAAiBzB,KAAAA,CAAKG,SAAAA,CAC1B,GAAMuB,CAAAA,EAAAA,CAAgB1B,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BI,EAAS,CAAEC,IAAAA,CAAMK,MAAuB9F,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA2F,SAAA,CAAA,UAAA,CAAA,IAAA,IACbP,CAAA,CAAA,CAA3BI,CAAS,CAAA,CAAEC,IAAMK,CAAAA,MAAAA,CAAAA,CAAAA,CAAAA,CAAuB9F,CAAA2F,CAAAA,SAAAA,CAAA,UAAA,CAAA,IAAA,EAAA,CAAA,CACZP,CAAA,CAAA,CAA5BI,CAAS,CAAA,CAAEC,KAAMI,OAAyB7F,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA2F,SAAA,CAAA,OAAA,CAAA,IAAA,EAExBP,CAAAA,CAAAA,CAAAA,CAAA,CAAlBW,CAAM,CAAA,UAAA,CAAA,CAAA,CAAkC/F,CAAA2F,CAAAA,SAAAA,CAAA,SAAA,CAAA,IAAA,EAAA,CAAA,CAC1BP,EAAA,CAAdW,CAAAA,CAAM,MAAsC/F,CAAAA,CAAAA,CAAAA,CAAAA,CAAA2F,SAAA,CAAA,aAAA,CAAA,IAAA,EAZlC3F,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAWoF,CAAA,CAAA,CADvBY,CAAc,CAAA,cAAA,CAAA,CAAA,CACFhG"}
@@ -1,2 +1,2 @@
1
- System.register(["lit"],function(_export,_context){"use strict";var o,_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){o=_lit.css;}],execute:function execute(){_export("s",t=o(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n :host {\n --max-width: 20rem;\n --hide-delay: 0ms;\n --show-delay: 150ms;\n\n display: contents;\n }\n\n .tooltip {\n --arrow-size: 6px;\n --arrow-color: var(--nile-tooltip-color-background);\n }\n\n .tooltip::part(popup) {\n pointer-events: none;\n z-index: 1000;\n }\n\n .tooltip[placement^='top']::part(popup) {\n transform-origin: bottom;\n }\n\n .tooltip[placement^='bottom']::part(popup) {\n transform-origin: top;\n }\n\n .tooltip[placement^='left']::part(popup) {\n transform-origin: right;\n }\n\n .tooltip[placement^='right']::part(popup) {\n transform-origin: left;\n }\n\n .tooltip__body {\n display: block;\n width: max-content;\n max-width: var(--max-width);\n border-radius: 4px;\n background-color: var(--nile-tooltip-color-background);\n font-size: var(--nile-tooltip-font-size-sm);\n font-weight: var(--nile-tooltip-font-weight-sm);\n line-height: var(--nile-tooltip-line-height-sm);\n padding: var(--nile-tooltip-padding-y) var(--nile-tooltip-padding-x);\n color: var(--nile-colors-white-base);\n pointer-events: none;\n word-break: break-word;\n }\n\n .tooltip__body--large {\n font-size: var(--nile-tooltip-font-size-lg);\n line-height: var(--nile-tooltip-line-height-lg);\n font-weight: var(--nile-tooltip-font-weight-lg);\n }\n"]))));}};});
1
+ System.register(["lit"],function(_export,_context){"use strict";var t,_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){t=_lit.css;}],execute:function execute(){_export("s",o=t(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n\n\n:host {\n position: relative;\n display: inline-block;\n }\n\n .tooltip {\n position: fixed;\n z-index: 1000;\n background-color: var(--nile-tooltip-color-background, #333);\n color: var(--nile-colors-white-base, #fff);\n padding: 6px 10px;\n border-radius: 4px;\n font-size: var(--nile-tooltip-font-size-sm, 14px);\n line-height: var(--nile-tooltip-line-height-sm, 1.5);\n opacity: 0;\n transition: opacity 0.2s, transform 0.2s;\n pointer-events: none;\n white-space: nowrap;\n visibility: hidden;\n transform: scale(0.95);\n transition: opacity 0.2s ease-out, transform 0.2s ease-out;\n }\n\n .tooltip[open] {\n opacity: 1;\n transform: scale(1);\n}\n\n :host([open]) .tooltip {\n opacity: 1;\n visibility: visible;\n pointer-events: auto;\n }\n\n .tooltip__body--large {\n font-size: var(--nile-type-scale-4, 16px);\n line-height: var(--nile-tooltip-line-height-lg, 1.75);\n }\n\n /* Tooltip Arrow */\n .tooltip::after {\n content: '';\n position: absolute;\n width: 0;\n height: 0;\n border-style: solid;\n }\n\n /* Basic Arrow Positions */\n .tooltip[data-placement^=\"top\"]::after {\n bottom: -6px;\n border-width: 6px 6px 0 6px;\n border-color: var(--nile-tooltip-color-background, #333) transparent transparent transparent;\n }\n\n .tooltip[data-placement^=\"bottom\"]::after {\n top: -6px;\n border-width: 0 6px 6px 6px;\n border-color: transparent transparent var(--nile-tooltip-color-background, #333) transparent;\n }\n\n .tooltip[data-placement^=\"left\"]::after {\n right: -6px;\n border-width: 6px 0 6px 6px;\n border-color: transparent transparent transparent var(--nile-tooltip-color-background, #333);\n }\n\n .tooltip[data-placement^=\"right\"]::after {\n left: -6px;\n border-width: 6px 6px 6px 0;\n border-color: transparent var(--nile-tooltip-color-background, #333) transparent transparent;\n }\n\n /* Arrow Horizontal Alignment for top/bottom placements */\n .tooltip[data-placement=\"top\"]::after,\n .tooltip[data-placement=\"bottom\"]::after {\n left: 50%;\n transform: translateX(-50%);\n }\n\n .tooltip[data-placement=\"top-start\"]::after,\n .tooltip[data-placement=\"bottom-start\"]::after {\n left: 12px;\n }\n\n .tooltip[data-placement=\"top-end\"]::after,\n .tooltip[data-placement=\"bottom-end\"]::after {\n right: 12px;\n left: auto;\n }\n\n /* Arrow Vertical Alignment for left/right placements */\n .tooltip[data-placement=\"left\"]::after,\n .tooltip[data-placement=\"right\"]::after {\n top: 50%;\n transform: translateY(-50%);\n }\n\n .tooltip[data-placement=\"left-start\"]::after,\n .tooltip[data-placement=\"right-start\"]::after {\n top: 12px;\n transform: none;\n }\n\n .tooltip[data-placement=\"left-end\"]::after,\n .tooltip[data-placement=\"right-end\"]::after {\n bottom: 12px;\n top: auto;\n transform: none;\n }\n \n"]))));}};});
2
2
  //# sourceMappingURL=nile-tooltip.css.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nile-tooltip.css.cjs.js","sources":["../../../src/nile-tooltip/nile-tooltip.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\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 * Tooltip CSS\n */\nexport const styles = css`\n :host {\n --max-width: 20rem;\n --hide-delay: 0ms;\n --show-delay: 150ms;\n\n display: contents;\n }\n\n .tooltip {\n --arrow-size: 6px;\n --arrow-color: var(--nile-tooltip-color-background);\n }\n\n .tooltip::part(popup) {\n pointer-events: none;\n z-index: 1000;\n }\n\n .tooltip[placement^='top']::part(popup) {\n transform-origin: bottom;\n }\n\n .tooltip[placement^='bottom']::part(popup) {\n transform-origin: top;\n }\n\n .tooltip[placement^='left']::part(popup) {\n transform-origin: right;\n }\n\n .tooltip[placement^='right']::part(popup) {\n transform-origin: left;\n }\n\n .tooltip__body {\n display: block;\n width: max-content;\n max-width: var(--max-width);\n border-radius: 4px;\n background-color: var(--nile-tooltip-color-background);\n font-size: var(--nile-tooltip-font-size-sm);\n font-weight: var(--nile-tooltip-font-weight-sm);\n line-height: var(--nile-tooltip-line-height-sm);\n padding: var(--nile-tooltip-padding-y) var(--nile-tooltip-padding-x);\n color: var(--nile-colors-white-base);\n pointer-events: none;\n word-break: break-word;\n }\n\n .tooltip__body--large {\n font-size: var(--nile-tooltip-font-size-lg);\n line-height: var(--nile-tooltip-line-height-lg);\n font-weight: var(--nile-tooltip-font-weight-lg);\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-tooltip.css.cjs.js","sources":["../../../src/nile-tooltip/nile-tooltip.css.ts"],"sourcesContent":["/**\n * Copyright Aquera Inc 2023\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 * Tooltip CSS\n */\nexport const styles = css`\n\n\n:host {\n position: relative;\n display: inline-block;\n }\n\n .tooltip {\n position: fixed;\n z-index: 1000;\n background-color: var(--nile-tooltip-color-background, #333);\n color: var(--nile-colors-white-base, #fff);\n padding: 6px 10px;\n border-radius: 4px;\n font-size: var(--nile-tooltip-font-size-sm, 14px);\n line-height: var(--nile-tooltip-line-height-sm, 1.5);\n opacity: 0;\n transition: opacity 0.2s, transform 0.2s;\n pointer-events: none;\n white-space: nowrap;\n visibility: hidden;\n transform: scale(0.95);\n transition: opacity 0.2s ease-out, transform 0.2s ease-out;\n }\n\n .tooltip[open] {\n opacity: 1;\n transform: scale(1);\n}\n\n :host([open]) .tooltip {\n opacity: 1;\n visibility: visible;\n pointer-events: auto;\n }\n\n .tooltip__body--large {\n font-size: var(--nile-type-scale-4, 16px);\n line-height: var(--nile-tooltip-line-height-lg, 1.75);\n }\n\n /* Tooltip Arrow */\n .tooltip::after {\n content: '';\n position: absolute;\n width: 0;\n height: 0;\n border-style: solid;\n }\n\n /* Basic Arrow Positions */\n .tooltip[data-placement^=\"top\"]::after {\n bottom: -6px;\n border-width: 6px 6px 0 6px;\n border-color: var(--nile-tooltip-color-background, #333) transparent transparent transparent;\n }\n\n .tooltip[data-placement^=\"bottom\"]::after {\n top: -6px;\n border-width: 0 6px 6px 6px;\n border-color: transparent transparent var(--nile-tooltip-color-background, #333) transparent;\n }\n\n .tooltip[data-placement^=\"left\"]::after {\n right: -6px;\n border-width: 6px 0 6px 6px;\n border-color: transparent transparent transparent var(--nile-tooltip-color-background, #333);\n }\n\n .tooltip[data-placement^=\"right\"]::after {\n left: -6px;\n border-width: 6px 6px 6px 0;\n border-color: transparent var(--nile-tooltip-color-background, #333) transparent transparent;\n }\n\n /* Arrow Horizontal Alignment for top/bottom placements */\n .tooltip[data-placement=\"top\"]::after,\n .tooltip[data-placement=\"bottom\"]::after {\n left: 50%;\n transform: translateX(-50%);\n }\n\n .tooltip[data-placement=\"top-start\"]::after,\n .tooltip[data-placement=\"bottom-start\"]::after {\n left: 12px;\n }\n\n .tooltip[data-placement=\"top-end\"]::after,\n .tooltip[data-placement=\"bottom-end\"]::after {\n right: 12px;\n left: auto;\n }\n\n /* Arrow Vertical Alignment for left/right placements */\n .tooltip[data-placement=\"left\"]::after,\n .tooltip[data-placement=\"right\"]::after {\n top: 50%;\n transform: translateY(-50%);\n }\n\n .tooltip[data-placement=\"left-start\"]::after,\n .tooltip[data-placement=\"right-start\"]::after {\n top: 12px;\n transform: none;\n }\n\n .tooltip[data-placement=\"left-end\"]::after,\n .tooltip[data-placement=\"right-end\"]::after {\n bottom: 12px;\n top: auto;\n transform: none;\n }\n \n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"oTAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
@@ -1,56 +1,115 @@
1
- import{css as o}from"lit";const t=o`
2
- :host {
3
- --max-width: 20rem;
4
- --hide-delay: 0ms;
5
- --show-delay: 150ms;
6
-
7
- display: contents;
8
- }
9
-
10
- .tooltip {
11
- --arrow-size: 6px;
12
- --arrow-color: var(--nile-tooltip-color-background);
13
- }
14
-
15
- .tooltip::part(popup) {
16
- pointer-events: none;
17
- z-index: 1000;
18
- }
19
-
20
- .tooltip[placement^='top']::part(popup) {
21
- transform-origin: bottom;
22
- }
23
-
24
- .tooltip[placement^='bottom']::part(popup) {
25
- transform-origin: top;
26
- }
27
-
28
- .tooltip[placement^='left']::part(popup) {
29
- transform-origin: right;
30
- }
31
-
32
- .tooltip[placement^='right']::part(popup) {
33
- transform-origin: left;
34
- }
35
-
36
- .tooltip__body {
37
- display: block;
38
- width: max-content;
39
- max-width: var(--max-width);
40
- border-radius: 4px;
41
- background-color: var(--nile-tooltip-color-background);
42
- font-size: var(--nile-tooltip-font-size-sm);
43
- font-weight: var(--nile-tooltip-font-weight-sm);
44
- line-height: var(--nile-tooltip-line-height-sm);
45
- padding: var(--nile-tooltip-padding-y) var(--nile-tooltip-padding-x);
46
- color: var(--nile-colors-white-base);
47
- pointer-events: none;
48
- word-break: break-word;
49
- }
50
-
51
- .tooltip__body--large {
52
- font-size: var(--nile-tooltip-font-size-lg);
53
- line-height: var(--nile-tooltip-line-height-lg);
54
- font-weight: var(--nile-tooltip-font-weight-lg);
55
- }
56
- `;export{t as s};
1
+ import{css as t}from"lit";const o=t`
2
+
3
+
4
+ :host {
5
+ position: relative;
6
+ display: inline-block;
7
+ }
8
+
9
+ .tooltip {
10
+ position: fixed;
11
+ z-index: 1000;
12
+ background-color: var(--nile-tooltip-color-background, #333);
13
+ color: var(--nile-colors-white-base, #fff);
14
+ padding: 6px 10px;
15
+ border-radius: 4px;
16
+ font-size: var(--nile-tooltip-font-size-sm, 14px);
17
+ line-height: var(--nile-tooltip-line-height-sm, 1.5);
18
+ opacity: 0;
19
+ transition: opacity 0.2s, transform 0.2s;
20
+ pointer-events: none;
21
+ white-space: nowrap;
22
+ visibility: hidden;
23
+ transform: scale(0.95);
24
+ transition: opacity 0.2s ease-out, transform 0.2s ease-out;
25
+ }
26
+
27
+ .tooltip[open] {
28
+ opacity: 1;
29
+ transform: scale(1);
30
+ }
31
+
32
+ :host([open]) .tooltip {
33
+ opacity: 1;
34
+ visibility: visible;
35
+ pointer-events: auto;
36
+ }
37
+
38
+ .tooltip__body--large {
39
+ font-size: var(--nile-type-scale-4, 16px);
40
+ line-height: var(--nile-tooltip-line-height-lg, 1.75);
41
+ }
42
+
43
+ /* Tooltip Arrow */
44
+ .tooltip::after {
45
+ content: '';
46
+ position: absolute;
47
+ width: 0;
48
+ height: 0;
49
+ border-style: solid;
50
+ }
51
+
52
+ /* Basic Arrow Positions */
53
+ .tooltip[data-placement^="top"]::after {
54
+ bottom: -6px;
55
+ border-width: 6px 6px 0 6px;
56
+ border-color: var(--nile-tooltip-color-background, #333) transparent transparent transparent;
57
+ }
58
+
59
+ .tooltip[data-placement^="bottom"]::after {
60
+ top: -6px;
61
+ border-width: 0 6px 6px 6px;
62
+ border-color: transparent transparent var(--nile-tooltip-color-background, #333) transparent;
63
+ }
64
+
65
+ .tooltip[data-placement^="left"]::after {
66
+ right: -6px;
67
+ border-width: 6px 0 6px 6px;
68
+ border-color: transparent transparent transparent var(--nile-tooltip-color-background, #333);
69
+ }
70
+
71
+ .tooltip[data-placement^="right"]::after {
72
+ left: -6px;
73
+ border-width: 6px 6px 6px 0;
74
+ border-color: transparent var(--nile-tooltip-color-background, #333) transparent transparent;
75
+ }
76
+
77
+ /* Arrow Horizontal Alignment for top/bottom placements */
78
+ .tooltip[data-placement="top"]::after,
79
+ .tooltip[data-placement="bottom"]::after {
80
+ left: 50%;
81
+ transform: translateX(-50%);
82
+ }
83
+
84
+ .tooltip[data-placement="top-start"]::after,
85
+ .tooltip[data-placement="bottom-start"]::after {
86
+ left: 12px;
87
+ }
88
+
89
+ .tooltip[data-placement="top-end"]::after,
90
+ .tooltip[data-placement="bottom-end"]::after {
91
+ right: 12px;
92
+ left: auto;
93
+ }
94
+
95
+ /* Arrow Vertical Alignment for left/right placements */
96
+ .tooltip[data-placement="left"]::after,
97
+ .tooltip[data-placement="right"]::after {
98
+ top: 50%;
99
+ transform: translateY(-50%);
100
+ }
101
+
102
+ .tooltip[data-placement="left-start"]::after,
103
+ .tooltip[data-placement="right-start"]::after {
104
+ top: 12px;
105
+ transform: none;
106
+ }
107
+
108
+ .tooltip[data-placement="left-end"]::after,
109
+ .tooltip[data-placement="right-end"]::after {
110
+ bottom: 12px;
111
+ top: auto;
112
+ transform: none;
113
+ }
114
+
115
+ `;export{o as s};