@kyndryl-design-system/shidoka-applications 2.8.0 → 2.8.1

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.
@@ -29,7 +29,7 @@ export declare class AILaunchButton extends LitElement {
29
29
  }
30
30
  declare global {
31
31
  interface HTMLElementTagNameMap {
32
- 'kyn-ai-assist': AILaunchButton;
32
+ 'kyn-ai-launch-btn': AILaunchButton;
33
33
  }
34
34
  }
35
35
  //# sourceMappingURL=aiLaunchButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"aiLaunchButton.d.ts","sourceRoot":"","sources":["../../../../src/components/ai/aiLaunchButton/aiLaunchButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAQvC;;;GAGG;AACH,qBACa,cAAe,SAAQ,UAAU;IAC5C,OAAgB,MAAM,MAAU;IAEhC,sCAAsC;IAEtC,QAAQ,UAAS;IAEjB;;OAEG;IAEH,OAAO,CAAC,YAAY,CAAO;IAE3B;;OAEG;IAEH,OAAO,CAAC,UAAU,CAAO;IAEzB;;OAEG;IAEH,OAAO,CAAC,WAAW,CAAS;IAEnB,MAAM;IAqBN,YAAY;IAKrB,OAAO,CAAC,cAAc;IAmBtB,OAAO,CAAC,oBAAoB;IAS5B,OAAO,CAAC,mBAAmB;IAMlB,OAAO,CAAC,YAAY,EAAE,GAAG;IAOlC,OAAO,CAAC,UAAU;CAMnB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,cAAc,CAAC;KACjC;CACF"}
1
+ {"version":3,"file":"aiLaunchButton.d.ts","sourceRoot":"","sources":["../../../../src/components/ai/aiLaunchButton/aiLaunchButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAQvC;;;GAGG;AACH,qBACa,cAAe,SAAQ,UAAU;IAC5C,OAAgB,MAAM,MAAU;IAEhC,sCAAsC;IAEtC,QAAQ,UAAS;IAEjB;;OAEG;IAEH,OAAO,CAAC,YAAY,CAAO;IAE3B;;OAEG;IAEH,OAAO,CAAC,UAAU,CAAO;IAEzB;;OAEG;IAEH,OAAO,CAAC,WAAW,CAAS;IAEnB,MAAM;IAqBN,YAAY;IAKrB,OAAO,CAAC,cAAc;IAmBtB,OAAO,CAAC,oBAAoB;IAS5B,OAAO,CAAC,mBAAmB;IAMlB,OAAO,CAAC,YAAY,EAAE,GAAG;IAOlC,OAAO,CAAC,UAAU;CAMnB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,mBAAmB,EAAE,cAAc,CAAC;KACrC;CACF"}
@@ -69,5 +69,5 @@ svg {
69
69
  >
70
70
  <div class="container"></div>
71
71
  </button>
72
- `}firstUpdated(){this._initAnimation()}_initAnimation(){this._animation=d.loadAnimation({container:this._containerEl,renderer:"svg",loop:!0,autoplay:!1,animationData:this.disabled?p:k}),this._animation.setSpeed(2),this._animation.goToAndStop(0,!0),this._animation.addEventListener("loopComplete",(()=>{this._shouldStop&&(this._animation.goToAndStop(0,!0),this._shouldStop=!1)}))}_startHoverAnimation(){this.disabled||(this._shouldStop=!1,this._animation.goToAndStop(0,!0),this._animation.setDirection(1),this._animation.play())}_stopHoverAnimation(){this.disabled||(this._shouldStop=!0)}updated(i){i.has("disabled")&&(this._animation.destroy(),this._initAnimation())}_emitClick(){if(!this.disabled){const i=new CustomEvent("on-click");this.dispatchEvent(i)}}};m.styles=l,i([t({type:Boolean})],m.prototype,"disabled",void 0),i([a(".container")],m.prototype,"_containerEl",void 0),i([o()],m.prototype,"_animation",void 0),i([o()],m.prototype,"_shouldStop",void 0),m=i([r("kyn-ai-assist")],m);export{m as AILaunchButton};
72
+ `}firstUpdated(){this._initAnimation()}_initAnimation(){this._animation=d.loadAnimation({container:this._containerEl,renderer:"svg",loop:!0,autoplay:!1,animationData:this.disabled?p:k}),this._animation.setSpeed(2),this._animation.goToAndStop(0,!0),this._animation.addEventListener("loopComplete",(()=>{this._shouldStop&&(this._animation.goToAndStop(0,!0),this._shouldStop=!1)}))}_startHoverAnimation(){this.disabled||(this._shouldStop=!1,this._animation.goToAndStop(0,!0),this._animation.setDirection(1),this._animation.play())}_stopHoverAnimation(){this.disabled||(this._shouldStop=!0)}updated(i){i.has("disabled")&&(this._animation.destroy(),this._initAnimation())}_emitClick(){if(!this.disabled){const i=new CustomEvent("on-click");this.dispatchEvent(i)}}};m.styles=l,i([t({type:Boolean})],m.prototype,"disabled",void 0),i([a(".container")],m.prototype,"_containerEl",void 0),i([o()],m.prototype,"_animation",void 0),i([o()],m.prototype,"_shouldStop",void 0),m=i([r("kyn-ai-launch-btn")],m);export{m as AILaunchButton};
73
73
  //# sourceMappingURL=aiLaunchButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"aiLaunchButton.js","sources":["../../../../src/components/ai/aiLaunchButton/aiLaunchButton.ts"],"sourcesContent":["import { LitElement, html } from 'lit';\nimport { customElement, property, state, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport lottie from 'lottie-web';\nimport animationData from './json/ai_assist.json';\nimport aiLaunchButtonDisabled from './json/ai_assist_disabled.json';\nimport Styles from './aiLaunchButton.scss';\n\n/**\n * AI Assistant Launch Button.\n * @fires on-click - Emits when the button is clicked.\n */\n@customElement('kyn-ai-assist')\nexport class AILaunchButton extends LitElement {\n static override styles = Styles;\n\n /** Whether the button is disabled. */\n @property({ type: Boolean })\n disabled = false;\n\n /** Animation container element.\n * @internal\n */\n @query('.container')\n private _containerEl!: any;\n\n /** Instance of animation.\n * @internal\n */\n @state()\n private _animation!: any;\n\n /** Whether to stop at next loop completion\n * @internal\n */\n @state()\n private _shouldStop = false;\n\n override render() {\n const Classes = {\n 'ai-launch-button': true,\n disabled: this.disabled,\n };\n\n return html`\n <button\n type=\"button\"\n class=\"${classMap(Classes)}\"\n aria-label=\"AI Assistant\"\n ?disabled=\"${this.disabled}\"\n @click=${() => this._emitClick()}\n @mouseenter=${() => this._startHoverAnimation()}\n @mouseleave=${() => this._stopHoverAnimation()}\n >\n <div class=\"container\"></div>\n </button>\n `;\n }\n\n override firstUpdated() {\n this._initAnimation();\n }\n\n /// loop the animation on mouseenter. on mouseleave, complete the current loop and then stop.\n private _initAnimation() {\n this._animation = lottie.loadAnimation({\n container: this._containerEl,\n renderer: 'svg',\n loop: true,\n autoplay: false,\n animationData: this.disabled ? aiLaunchButtonDisabled : animationData,\n });\n this._animation.setSpeed(2);\n this._animation.goToAndStop(0, true);\n\n this._animation.addEventListener('loopComplete', () => {\n if (this._shouldStop) {\n this._animation.goToAndStop(0, true);\n this._shouldStop = false;\n }\n });\n }\n\n private _startHoverAnimation() {\n if (!this.disabled) {\n this._shouldStop = false;\n this._animation.goToAndStop(0, true);\n this._animation.setDirection(1);\n this._animation.play();\n }\n }\n\n private _stopHoverAnimation() {\n if (!this.disabled) {\n this._shouldStop = true;\n }\n }\n\n override updated(changedProps: any) {\n if (changedProps.has('disabled')) {\n this._animation.destroy();\n this._initAnimation();\n }\n }\n\n private _emitClick() {\n if (!this.disabled) {\n const event = new CustomEvent('on-click');\n this.dispatchEvent(event);\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kyn-ai-assist': AILaunchButton;\n }\n}\n"],"names":["AILaunchButton","LitElement","constructor","this","disabled","_shouldStop","render","Classes","html","classMap","_emitClick","_startHoverAnimation","_stopHoverAnimation","firstUpdated","_initAnimation","_animation","lottie","loadAnimation","container","_containerEl","renderer","loop","autoplay","animationData","aiLaunchButtonDisabled","setSpeed","goToAndStop","addEventListener","setDirection","play","updated","changedProps","has","destroy","event","CustomEvent","dispatchEvent","styles","Styles","__decorate","property","type","Boolean","prototype","query","state","customElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAaO,IAAMA,EAAN,cAA6BC,EAA7B,WAAAC,uBAKLC,KAAQ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,EAAA2C,UAAA,mBAAA,GAvBjB3C,EAAcuC,EAAA,CAD1BO,EAAc,kBACF9C"}
1
+ {"version":3,"file":"aiLaunchButton.js","sources":["../../../../src/components/ai/aiLaunchButton/aiLaunchButton.ts"],"sourcesContent":["import { LitElement, html } from 'lit';\nimport { customElement, property, state, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport lottie from 'lottie-web';\nimport animationData from './json/ai_assist.json';\nimport aiLaunchButtonDisabled from './json/ai_assist_disabled.json';\nimport Styles from './aiLaunchButton.scss';\n\n/**\n * AI Assistant Launch Button.\n * @fires on-click - Emits when the button is clicked.\n */\n@customElement('kyn-ai-launch-btn')\nexport class AILaunchButton extends LitElement {\n static override styles = Styles;\n\n /** Whether the button is disabled. */\n @property({ type: Boolean })\n disabled = false;\n\n /** Animation container element.\n * @internal\n */\n @query('.container')\n private _containerEl!: any;\n\n /** Instance of animation.\n * @internal\n */\n @state()\n private _animation!: any;\n\n /** Whether to stop at next loop completion\n * @internal\n */\n @state()\n private _shouldStop = false;\n\n override render() {\n const Classes = {\n 'ai-launch-button': true,\n disabled: this.disabled,\n };\n\n return html`\n <button\n type=\"button\"\n class=\"${classMap(Classes)}\"\n aria-label=\"AI Assistant\"\n ?disabled=\"${this.disabled}\"\n @click=${() => this._emitClick()}\n @mouseenter=${() => this._startHoverAnimation()}\n @mouseleave=${() => this._stopHoverAnimation()}\n >\n <div class=\"container\"></div>\n </button>\n `;\n }\n\n override firstUpdated() {\n this._initAnimation();\n }\n\n /// loop the animation on mouseenter. on mouseleave, complete the current loop and then stop.\n private _initAnimation() {\n this._animation = lottie.loadAnimation({\n container: this._containerEl,\n renderer: 'svg',\n loop: true,\n autoplay: false,\n animationData: this.disabled ? aiLaunchButtonDisabled : animationData,\n });\n this._animation.setSpeed(2);\n this._animation.goToAndStop(0, true);\n\n this._animation.addEventListener('loopComplete', () => {\n if (this._shouldStop) {\n this._animation.goToAndStop(0, true);\n this._shouldStop = false;\n }\n });\n }\n\n private _startHoverAnimation() {\n if (!this.disabled) {\n this._shouldStop = false;\n this._animation.goToAndStop(0, true);\n this._animation.setDirection(1);\n this._animation.play();\n }\n }\n\n private _stopHoverAnimation() {\n if (!this.disabled) {\n this._shouldStop = true;\n }\n }\n\n override updated(changedProps: any) {\n if (changedProps.has('disabled')) {\n this._animation.destroy();\n this._initAnimation();\n }\n }\n\n private _emitClick() {\n if (!this.disabled) {\n const event = new CustomEvent('on-click');\n this.dispatchEvent(event);\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'kyn-ai-launch-btn': AILaunchButton;\n }\n}\n"],"names":["AILaunchButton","LitElement","constructor","this","disabled","_shouldStop","render","Classes","html","classMap","_emitClick","_startHoverAnimation","_stopHoverAnimation","firstUpdated","_initAnimation","_animation","lottie","loadAnimation","container","_containerEl","renderer","loop","autoplay","animationData","aiLaunchButtonDisabled","setSpeed","goToAndStop","addEventListener","setDirection","play","updated","changedProps","has","destroy","event","CustomEvent","dispatchEvent","styles","Styles","__decorate","property","type","Boolean","prototype","query","state","customElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAaO,IAAMA,EAAN,cAA6BC,EAA7B,WAAAC,uBAKLC,KAAQC,UAAG,EAkBHD,KAAWE,aAAG,CA2EvB,CAzEU,MAAAC,GACP,MAAMC,EAAU,CACd,oBAAoB,EACpBH,SAAUD,KAAKC,UAGjB,OAAOI,CAAI;;;iBAGEC,EAASF;;qBAELJ,KAAKC;iBACT,IAAMD,KAAKO;sBACN,IAAMP,KAAKQ;sBACX,IAAMR,KAAKS;;;;KAK9B,CAEQ,YAAAC,GACPV,KAAKW,gBACN,CAGO,cAAAA,GACNX,KAAKY,WAAaC,EAAOC,cAAc,CACrCC,UAAWf,KAAKgB,aAChBC,SAAU,MACVC,MAAM,EACNC,UAAU,EACVC,cAAepB,KAAKC,SAAWoB,EAAyBD,IAE1DpB,KAAKY,WAAWU,SAAS,GACzBtB,KAAKY,WAAWW,YAAY,GAAG,GAE/BvB,KAAKY,WAAWY,iBAAiB,gBAAgB,KAC3CxB,KAAKE,cACPF,KAAKY,WAAWW,YAAY,GAAG,GAC/BvB,KAAKE,aAAc,EACpB,GAEJ,CAEO,oBAAAM,GACDR,KAAKC,WACRD,KAAKE,aAAc,EACnBF,KAAKY,WAAWW,YAAY,GAAG,GAC/BvB,KAAKY,WAAWa,aAAa,GAC7BzB,KAAKY,WAAWc,OAEnB,CAEO,mBAAAjB,GACDT,KAAKC,WACRD,KAAKE,aAAc,EAEtB,CAEQ,OAAAyB,CAAQC,GACXA,EAAaC,IAAI,cACnB7B,KAAKY,WAAWkB,UAChB9B,KAAKW,iBAER,CAEO,UAAAJ,GACN,IAAKP,KAAKC,SAAU,CAClB,MAAM8B,EAAQ,IAAIC,YAAY,YAC9BhC,KAAKiC,cAAcF,EACpB,CACF,GAhGelC,EAAMqC,OAAGC,EAIzBC,EAAA,CADCC,EAAS,CAAEC,KAAMC,WACD1C,EAAA2C,UAAA,gBAAA,GAMjBJ,EAAA,CADCK,EAAM,eACoB5C,EAAA2C,UAAA,oBAAA,GAM3BJ,EAAA,CADCM,KACwB7C,EAAA2C,UAAA,kBAAA,GAMzBJ,EAAA,CADCM,KAC2B7C,EAAA2C,UAAA,mBAAA,GAvBjB3C,EAAcuC,EAAA,CAD1BO,EAAc,sBACF9C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kyndryl-design-system/shidoka-applications",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
4
4
  "description": "Shidoka Web Components for Applications",
5
5
  "main": "index.js",
6
6
  "type": "module",