@limetech/lime-elements 37.71.0 → 37.72.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.
Files changed (66) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/3d-tilt-hover-effect-f64da0a8.js +162 -0
  3. package/dist/cjs/3d-tilt-hover-effect-f64da0a8.js.map +1 -0
  4. package/dist/cjs/limel-card.cjs.entry.js +9 -2
  5. package/dist/cjs/limel-card.cjs.entry.js.map +1 -1
  6. package/dist/cjs/limel-info-tile.cjs.entry.js +13 -8
  7. package/dist/cjs/limel-info-tile.cjs.entry.js.map +1 -1
  8. package/dist/cjs/limel-markdown.cjs.entry.js +1 -1
  9. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +2 -2
  10. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js.map +1 -1
  11. package/dist/cjs/{markdown-parser-ba7cc71e.js → markdown-parser-d1887ec8.js} +12466 -421
  12. package/dist/cjs/markdown-parser-d1887ec8.js.map +1 -0
  13. package/dist/collection/components/card/card.css +76 -37
  14. package/dist/collection/components/card/card.js +9 -2
  15. package/dist/collection/components/card/card.js.map +1 -1
  16. package/dist/collection/components/info-tile/info-tile.css +73 -38
  17. package/dist/collection/components/info-tile/info-tile.js +13 -8
  18. package/dist/collection/components/info-tile/info-tile.js.map +1 -1
  19. package/dist/collection/components/markdown/markdown-parser.js +23 -0
  20. package/dist/collection/components/markdown/markdown-parser.js.map +1 -1
  21. package/dist/collection/components/text-editor/utils/html-converter.js +2 -2
  22. package/dist/collection/components/text-editor/utils/html-converter.js.map +1 -1
  23. package/dist/collection/style/mixins.scss +114 -0
  24. package/dist/collection/util/3d-tilt-hover-effect.js +157 -0
  25. package/dist/collection/util/3d-tilt-hover-effect.js.map +1 -0
  26. package/dist/esm/3d-tilt-hover-effect-a76fcd43.js +160 -0
  27. package/dist/esm/3d-tilt-hover-effect-a76fcd43.js.map +1 -0
  28. package/dist/esm/limel-card.entry.js +10 -3
  29. package/dist/esm/limel-card.entry.js.map +1 -1
  30. package/dist/esm/limel-info-tile.entry.js +14 -9
  31. package/dist/esm/limel-info-tile.entry.js.map +1 -1
  32. package/dist/esm/limel-markdown.entry.js +1 -1
  33. package/dist/esm/limel-prosemirror-adapter.entry.js +2 -2
  34. package/dist/esm/limel-prosemirror-adapter.entry.js.map +1 -1
  35. package/dist/esm/{markdown-parser-3c0af898.js → markdown-parser-90f72b15.js} +12466 -422
  36. package/dist/esm/markdown-parser-90f72b15.js.map +1 -0
  37. package/dist/lime-elements/lime-elements.esm.js +1 -1
  38. package/dist/lime-elements/p-05c10bed.entry.js +2 -0
  39. package/dist/lime-elements/p-05c10bed.entry.js.map +1 -0
  40. package/dist/lime-elements/p-23bc6de0.js +2 -0
  41. package/dist/lime-elements/p-23bc6de0.js.map +1 -0
  42. package/dist/lime-elements/p-3e8afa19.js +8 -0
  43. package/dist/lime-elements/p-3e8afa19.js.map +1 -0
  44. package/dist/lime-elements/{p-da20ff72.entry.js → p-4bfcb8c7.entry.js} +2 -2
  45. package/dist/lime-elements/p-6de2f65c.entry.js +2 -0
  46. package/dist/lime-elements/p-6de2f65c.entry.js.map +1 -0
  47. package/dist/lime-elements/p-a0944503.entry.js +2 -0
  48. package/dist/lime-elements/p-a0944503.entry.js.map +1 -0
  49. package/dist/lime-elements/style/mixins.scss +114 -0
  50. package/dist/scss/mixins.scss +114 -0
  51. package/dist/types/components/card/card.d.ts +4 -0
  52. package/dist/types/components/info-tile/info-tile.d.ts +5 -1
  53. package/dist/types/components/markdown/markdown-parser.d.ts +8 -0
  54. package/dist/types/util/3d-tilt-hover-effect.d.ts +118 -0
  55. package/package.json +3 -2
  56. package/dist/cjs/markdown-parser-ba7cc71e.js.map +0 -1
  57. package/dist/esm/markdown-parser-3c0af898.js.map +0 -1
  58. package/dist/lime-elements/p-060bbefe.entry.js +0 -2
  59. package/dist/lime-elements/p-060bbefe.entry.js.map +0 -1
  60. package/dist/lime-elements/p-086509a5.js +0 -8
  61. package/dist/lime-elements/p-086509a5.js.map +0 -1
  62. package/dist/lime-elements/p-32844d2b.entry.js +0 -2
  63. package/dist/lime-elements/p-32844d2b.entry.js.map +0 -1
  64. package/dist/lime-elements/p-ca929a0e.entry.js +0 -2
  65. package/dist/lime-elements/p-ca929a0e.entry.js.map +0 -1
  66. /package/dist/lime-elements/{p-da20ff72.entry.js.map → p-4bfcb8c7.entry.js.map} +0 -0
@@ -0,0 +1,2 @@
1
+ import{r as e,c as r,h as o,H as i,g as t}from"./p-443111b3.js";import{i as s}from"./p-91741e79.js";import{g as a}from"./p-2f777fdb.js";import{g as n}from"./p-23bc6de0.js";const d='@charset "UTF-8";*{box-sizing:border-box;min-width:0;min-height:0}:host(limel-card){display:flex;border-radius:var(--card-border-radius, 0.95rem)}section{box-sizing:border-box;display:flex;gap:0.5rem;flex-direction:column;border-radius:var(--card-border-radius, 0.95rem);border:1px solid rgb(var(--contrast-500));padding:0.25rem;background-color:var(--card-background-color, rgb(var(--contrast-300)))}:host(limel-card[orientation=landscape]) section{flex-direction:row}section:hover{border-color:transparent;background-color:var(--card-background-color--hovered, var(--card-background-color, rgb(var(--contrast-200))))}.body{flex-grow:1;display:flex;flex-direction:column;gap:0.5rem}img{transition:filter 0.6s ease;object-fit:cover;border-radius:calc(var(--card-border-radius, 0.95rem) / 1.4)}:host(limel-card[orientation=portrait]) img{width:100%}:host(limel-card[orientation=landscape]) img{max-width:40%;height:100%}section:hover img,section:focus-visible img{transition-duration:0.2s;filter:saturate(1.3)}limel-markdown{padding:0.5rem 0.75rem}header{display:flex;justify-content:center;gap:0.5rem;padding:0.25rem 0.75rem}:host(limel-card[orientation=landscape]) header{padding-top:0.5rem}header:has(limel-icon){padding-left:0.25rem}header .headings{flex-grow:1;display:flex;flex-direction:column;gap:0.125rem}header limel-icon{flex-shrink:0;width:2rem}header h1{font-size:1.125rem;font-weight:500;color:var(--card-heading-color, rgb(var(--contrast-1100)));letter-spacing:-0.03125rem}header h2{font-size:0.875rem;font-weight:400;color:var(--card-subheading-color, rgb(var(--contrast-1000)))}header h1,header h2{word-break:break-word;hyphens:auto;-webkit-hyphens:auto;margin:0}limel-action-bar{--action-bar-background-color:transparent;padding:0.5rem;margin-left:auto}.limel-3d-hover-effect-glow{transition:background 0.4s ease, opacity 0.4s ease;pointer-events:none;position:absolute;inset:0;border-radius:var(--card-border-radius, 0.95rem);opacity:0.1;background-image:radial-gradient(circle at var(--limel-3d-hover-effect-glow-position, 50% -20%), rgb(var(--color-white), 0.3), rgb(var(--color-white), 0));mix-blend-mode:plus-lighter}section:hover .limel-3d-hover-effect-glow{opacity:0.5}@media (prefers-reduced-motion){section:hover .limel-3d-hover-effect-glow{opacity:0.2}}:host(limel-card){isolation:isolate;transform-style:preserve-3d;perspective:1000px}@media (prefers-reduced-motion){:host(limel-card){perspective:2000px}}section{position:relative;transition-duration:0.8s;transition-property:transform, box-shadow, background-color;transition-timing-function:ease-out;transform:scale3d(1, 1, 1) rotate3d(0, 0, 0, 0deg)}section:focus{outline:none}section:hover,section:focus,section:focus-visible,section:focus-within{will-change:background-color, box-shadow, transform}section:hover,section:focus,section:focus-visible,section:active{transition-duration:0.2s}section:hover,section:focus-visible{box-shadow:var(--button-shadow-hovered), var(--shadow-depth-16)}section:hover{transform:scale3d(1.01, 1.01, 1.01) rotate3d(var(--limel-3d-hover-effect-rotate3d))}section:focus-visible{outline:none;transform:scale3d(1.01, 1.01, 1.01)}:host(limel-card[clickable]) section{cursor:pointer;box-shadow:var(--button-shadow-normal)}:host(limel-card[clickable]) section:hover,:host(limel-card[clickable]) section:focus-visible{box-shadow:var(--button-shadow-hovered), var(--shadow-depth-16)}:host(limel-card[clickable]) section:active{transform:scale3d(1, 1, 1) rotate3d(0, 0, 0, 0deg);box-shadow:var(--button-shadow-pressed)}:host(limel-card[clickable]) section:focus-visible{box-shadow:var(--shadow-depth-8-focused), var(--button-shadow-hovered)}:host(limel-card[clickable]) section:focus-visible:active{box-shadow:var(--shadow-depth-8-focused), var(--button-shadow-pressed)}';const c=class{constructor(o){e(this,o);this.actionSelected=r(this,"actionSelected",7);this.handleActionSelect=e=>{e.stopPropagation();if(s(e.detail)){this.actionSelected.emit(e.detail)}};this.heading=undefined;this.subheading=undefined;this.image=undefined;this.icon=undefined;this.value=undefined;this.actions=[];this.clickable=false;this.orientation="portrait"}componentWillLoad(){const{handleMouseEnter:e,handleMouseLeave:r}=n(this.host);this.handleMouseEnter=e;this.handleMouseLeave=r}render(){return o(i,{onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},o("section",{tabindex:this.clickable?0:""},this.renderImage(),o("div",{class:"body"},this.renderHeader(),this.renderSlot(),this.renderValue(),this.renderActionBar()),o("div",{class:"limel-3d-hover-effect-glow"})))}renderImage(){if(!this.image){return}return o("img",{src:this.image.src,alt:this.image.alt,loading:"lazy"})}renderHeader(){if(!this.heading&&!this.subheading&&!this.icon){return}return o("header",null,this.renderIcon(),o("div",{class:"headings"},this.renderHeading(),this.renderSubheading()))}renderIcon(){var e;const r=a(this.icon);const i=typeof this.icon!=="string"?(e=this.icon)===null||e===void 0?void 0:e.color:undefined;if(!r){return}return o("limel-icon",{style:{color:`${i}`},badge:true,name:r})}renderHeading(){if(!this.heading){return}return o("h1",null,this.heading)}renderSubheading(){if(!this.subheading){return}return o("h2",null,this.subheading)}renderSlot(){return o("slot",{name:"component"})}renderValue(){return o("limel-markdown",{value:this.value})}renderActionBar(){if(!this.actions.length){return}return o("limel-action-bar",{actions:this.actions,onItemSelected:this.handleActionSelect})}get host(){return t(this)}};c.style=d;export{c as limel_card};
2
+ //# sourceMappingURL=p-a0944503.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["cardCss","Card","this","handleActionSelect","event","stopPropagation","isItem","detail","actionSelected","emit","componentWillLoad","handleMouseEnter","handleMouseLeave","getMouseEventHandlers","host","render","h","Host","onMouseEnter","onMouseLeave","tabindex","clickable","renderImage","class","renderHeader","renderSlot","renderValue","renderActionBar","image","src","alt","loading","heading","subheading","icon","renderIcon","renderHeading","renderSubheading","getIconName","color","_a","undefined","style","badge","name","value","actions","length","onItemSelected"],"sources":["./src/components/card/card.scss?tag=limel-card&encapsulation=shadow","./src/components/card/card.tsx"],"sourcesContent":["/**\n* @prop --card-heading-color: color of the heading. Defaults to `--contrast-1100`;\n* @prop --card-subheading-color: color of the sub heading. Defaults to `--contrast-1000`;\n* @prop --card-border-radius: border radius of the card. Defaults to `0.95rem`;\n* @prop --card-background-color: background color of the card.\n* @prop --card-background-color--hovered: background color of the card, when hovered.\n*/\n\n@use '../../style/mixins';\n\n$default-border-radius: 0.95rem;\n\n* {\n box-sizing: border-box;\n min-width: 0;\n min-height: 0;\n}\n\n:host(limel-card) {\n display: flex;\n border-radius: var(--card-border-radius, $default-border-radius);\n}\n\nsection {\n box-sizing: border-box;\n\n display: flex;\n gap: 0.5rem;\n\n flex-direction: column;\n :host(limel-card[orientation='landscape']) & {\n flex-direction: row;\n }\n\n border-radius: var(--card-border-radius, $default-border-radius);\n border: 1px solid rgb(var(--contrast-500));\n\n padding: 0.25rem;\n background-color: var(--card-background-color, rgb(var(--contrast-300)));\n\n &:hover {\n border-color: transparent;\n background-color: var(\n --card-background-color--hovered,\n var(--card-background-color, rgb(var(--contrast-200)))\n );\n }\n}\n\n.body {\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n}\n\nimg {\n transition: filter 0.6s ease;\n object-fit: cover;\n border-radius: calc(\n var(--card-border-radius, $default-border-radius) / 1.4\n );\n :host(limel-card[orientation='portrait']) & {\n width: 100%;\n }\n\n :host(limel-card[orientation='landscape']) & {\n max-width: 40%;\n height: 100%;\n }\n\n section:hover &,\n section:focus-visible & {\n transition-duration: 0.2s;\n filter: saturate(1.3);\n }\n}\n\nlimel-markdown {\n padding: 0.5rem 0.75rem;\n}\n\nheader {\n display: flex;\n justify-content: center;\n\n gap: 0.5rem;\n\n padding: 0.25rem 0.75rem;\n :host(limel-card[orientation='landscape']) & {\n padding-top: 0.5rem;\n }\n\n &:has(limel-icon) {\n padding-left: 0.25rem;\n }\n\n .headings {\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n gap: 0.125rem;\n }\n\n limel-icon {\n flex-shrink: 0;\n width: 2rem;\n }\n\n h1 {\n font-size: 1.125rem;\n font-weight: 500;\n color: var(--card-heading-color, rgb(var(--contrast-1100)));\n letter-spacing: -0.03125rem; // 0.5px\n }\n\n h2 {\n font-size: 0.875rem;\n font-weight: 400;\n color: var(--card-subheading-color, rgb(var(--contrast-1000)));\n }\n\n h1,\n h2 {\n word-break: break-word;\n hyphens: auto;\n -webkit-hyphens: auto;\n margin: 0;\n }\n}\n\nlimel-action-bar {\n --action-bar-background-color: transparent;\n padding: 0.5rem;\n margin-left: auto;\n}\n\n// The 3D effect\n@include mixins.limel-3d-hover-effect-glow(\n section,\n var(--card-border-radius, $default-border-radius)\n);\n\n:host(limel-card) {\n @include mixins.parent-of-the-3d-element;\n}\n\nsection {\n @include mixins.the-3d-element;\n\n :host(limel-card[clickable]) & {\n @include mixins.the-3d-element--clickable;\n }\n}\n","import {\n Component,\n h,\n Prop,\n Event,\n EventEmitter,\n Element,\n Host,\n} from '@stencil/core';\nimport { Image } from '../../global/shared-types/image.types';\nimport { Icon } from '../../global/shared-types/icon.types';\nimport { isItem } from '../action-bar/isItem';\nimport { getIconName } from '../icon/get-icon-props';\nimport { ListSeparator } from '../../global/shared-types/separator.types';\nimport { ActionBarItem } from '../action-bar/action-bar.types';\nimport { getMouseEventHandlers } from '../../util/3d-tilt-hover-effect';\n\n/**\n * Card is a component that displays content about a single topic,\n * in a structured way. It can contain a header, and some supporting media such\n * as an image or an icon, a body of text, or optional actions.\n *\n * @exampleComponent limel-example-card-basic\n * @exampleComponent limel-example-card-image\n * @exampleComponent limel-example-card-actions\n * @exampleComponent limel-example-card-clickable\n * @exampleComponent limel-example-card-orientation\n * @exampleComponent limel-example-card-slot\n * @exampleComponent limel-example-card-styling\n * @beta\n */\n@Component({\n tag: 'limel-card',\n shadow: true,\n styleUrl: 'card.scss',\n})\nexport class Card {\n /**\n * Heading of the card,\n * to provide a short title about the context.\n */\n @Prop({ reflect: true })\n public heading?: string;\n\n /**\n * Subheading of the card\n * to provide a short description of the context.\n */\n @Prop({ reflect: true })\n public subheading?: string;\n\n /**\n * A hero image to display in the card,\n * to enrich the content with visual information.\n */\n @Prop()\n public image?: Image;\n\n /**\n * An icon, to display along with the heading and subheading.\n */\n @Prop({ reflect: true })\n public icon?: string | Icon;\n\n /**\n * The content of the card.\n * Supports markdown, to provide a rich text experience.\n */\n @Prop()\n public value?: string;\n\n /**\n * Actions to display in the card,\n * to provide the user with options to interact with the content.\n */\n @Prop()\n public actions?: Array<ActionBarItem | ListSeparator> = [];\n\n /**\n * When true, improve the accessibility of the component and hints the user\n * that the card can be interacted width.\n */\n @Prop({ reflect: true })\n public clickable: boolean = false;\n\n /**\n * The orientation of the card,\n * specially useful when the card has an image.\n */\n @Prop({ reflect: true })\n public orientation: 'landscape' | 'portrait' = 'portrait';\n\n /**\n * Fired when a action bar item has been clicked.\n */\n @Event()\n public actionSelected: EventEmitter<ActionBarItem>;\n\n @Element()\n private host: HTMLElement;\n\n private handleMouseEnter: () => void;\n private handleMouseLeave: () => void;\n\n public componentWillLoad() {\n const { handleMouseEnter, handleMouseLeave } = getMouseEventHandlers(\n this.host,\n );\n this.handleMouseEnter = handleMouseEnter;\n this.handleMouseLeave = handleMouseLeave;\n }\n\n public render() {\n return (\n <Host\n onMouseEnter={this.handleMouseEnter}\n onMouseLeave={this.handleMouseLeave}\n >\n <section tabindex={this.clickable ? 0 : ''}>\n {this.renderImage()}\n <div class=\"body\">\n {this.renderHeader()}\n {this.renderSlot()}\n {this.renderValue()}\n {this.renderActionBar()}\n </div>\n <div class=\"limel-3d-hover-effect-glow\" />\n </section>\n </Host>\n );\n }\n\n private renderImage() {\n if (!this.image) {\n return;\n }\n\n return <img src={this.image.src} alt={this.image.alt} loading=\"lazy\" />;\n }\n\n private renderHeader() {\n if (!this.heading && !this.subheading && !this.icon) {\n return;\n }\n\n return (\n <header>\n {this.renderIcon()}\n <div class=\"headings\">\n {this.renderHeading()}\n {this.renderSubheading()}\n </div>\n </header>\n );\n }\n\n private renderIcon() {\n const icon = getIconName(this.icon);\n const color =\n typeof this.icon !== 'string' ? this.icon?.color : undefined;\n\n if (!icon) {\n return;\n }\n\n return (\n <limel-icon\n style={{\n color: `${color}`,\n }}\n badge={true}\n name={icon}\n />\n );\n }\n\n private renderHeading() {\n if (!this.heading) {\n return;\n }\n\n return <h1>{this.heading}</h1>;\n }\n\n private renderSubheading() {\n if (!this.subheading) {\n return;\n }\n\n return <h2>{this.subheading}</h2>;\n }\n\n private renderSlot() {\n return <slot name=\"component\" />;\n }\n\n private renderValue() {\n return <limel-markdown value={this.value} />;\n }\n\n private handleActionSelect = (\n event: CustomEvent<ActionBarItem | ListSeparator>,\n ) => {\n event.stopPropagation();\n if (isItem(event.detail)) {\n this.actionSelected.emit(event.detail);\n }\n };\n\n private renderActionBar() {\n if (!this.actions.length) {\n return;\n }\n\n return (\n <limel-action-bar\n actions={this.actions}\n onItemSelected={this.handleActionSelect}\n />\n );\n }\n}\n"],"mappings":"4KAAA,MAAMA,EAAU,ksH,MCoCHC,EAAI,M,wEAoKLC,KAAAC,mBACJC,IAEAA,EAAMC,kBACN,GAAIC,EAAOF,EAAMG,QAAS,CACtBL,KAAKM,eAAeC,KAAKL,EAAMG,O,+HAjIiB,G,eAO5B,M,iBAOmB,U,CAcxCG,oBACH,MAAMC,iBAAEA,EAAgBC,iBAAEA,GAAqBC,EAC3CX,KAAKY,MAETZ,KAAKS,iBAAmBA,EACxBT,KAAKU,iBAAmBA,C,CAGrBG,SACH,OACIC,EAACC,EAAI,CACDC,aAAchB,KAAKS,iBACnBQ,aAAcjB,KAAKU,kBAEnBI,EAAA,WAASI,SAAUlB,KAAKmB,UAAY,EAAI,IACnCnB,KAAKoB,cACNN,EAAA,OAAKO,MAAM,QACNrB,KAAKsB,eACLtB,KAAKuB,aACLvB,KAAKwB,cACLxB,KAAKyB,mBAEVX,EAAA,OAAKO,MAAM,gC,CAMnBD,cACJ,IAAKpB,KAAK0B,MAAO,CACb,M,CAGJ,OAAOZ,EAAA,OAAKa,IAAK3B,KAAK0B,MAAMC,IAAKC,IAAK5B,KAAK0B,MAAME,IAAKC,QAAQ,Q,CAG1DP,eACJ,IAAKtB,KAAK8B,UAAY9B,KAAK+B,aAAe/B,KAAKgC,KAAM,CACjD,M,CAGJ,OACIlB,EAAA,cACKd,KAAKiC,aACNnB,EAAA,OAAKO,MAAM,YACNrB,KAAKkC,gBACLlC,KAAKmC,oB,CAMdF,a,MACJ,MAAMD,EAAOI,EAAYpC,KAAKgC,MAC9B,MAAMK,SACKrC,KAAKgC,OAAS,UAAWM,EAAAtC,KAAKgC,QAAI,MAAAM,SAAA,SAAAA,EAAED,MAAQE,UAEvD,IAAKP,EAAM,CACP,M,CAGJ,OACIlB,EAAA,cACI0B,MAAO,CACHH,MAAO,GAAGA,KAEdI,MAAO,KACPC,KAAMV,G,CAKVE,gBACJ,IAAKlC,KAAK8B,QAAS,CACf,M,CAGJ,OAAOhB,EAAA,UAAKd,KAAK8B,Q,CAGbK,mBACJ,IAAKnC,KAAK+B,WAAY,CAClB,M,CAGJ,OAAOjB,EAAA,UAAKd,KAAK+B,W,CAGbR,aACJ,OAAOT,EAAA,QAAM4B,KAAK,a,CAGdlB,cACJ,OAAOV,EAAA,kBAAgB6B,MAAO3C,KAAK2C,O,CAY/BlB,kBACJ,IAAKzB,KAAK4C,QAAQC,OAAQ,CACtB,M,CAGJ,OACI/B,EAAA,oBACI8B,QAAS5C,KAAK4C,QACdE,eAAgB9C,KAAKC,oB"}
@@ -456,3 +456,117 @@ $clickable-normal-state-transitions: (
456
456
  clip-path: inset(50%);
457
457
  white-space: nowrap;
458
458
  }
459
+
460
+ // This mixin designed to enhance the visual effects,
461
+ // when the `tiltFollowingTheCursor` utility function from `3d-tilt-hover-effect.ts`
462
+ // is implemented in a component.
463
+ // This adds styles to a `<div class"limel-3d-hover-effect-glow" />`, needed to create
464
+ // a glow effect on a 3D element when the parent element is hovered.
465
+ // when the `tiltFollowingTheCursor` utility function from `3d-tilt-hover-effect.ts`
466
+ // Parts of these styles are controlled by the `titleFollowingTheCursor` function.
467
+ @mixin limel-3d-hover-effect-glow($the3dElement, $border-radius) {
468
+ .limel-3d-hover-effect-glow {
469
+ transition:
470
+ background 0.4s ease,
471
+ opacity 0.4s ease;
472
+ pointer-events: none;
473
+
474
+ position: absolute;
475
+ inset: 0;
476
+ border-radius: $border-radius;
477
+
478
+ opacity: 0.1;
479
+ #{$the3dElement}:hover & {
480
+ opacity: 0.5;
481
+ @media (prefers-reduced-motion) {
482
+ opacity: 0.2;
483
+ }
484
+ }
485
+
486
+ background-image: radial-gradient(
487
+ circle at var(--limel-3d-hover-effect-glow-position, 50% -20%),
488
+ rgb(var(--color-white), 0.3),
489
+ rgb(var(--color-white), 0)
490
+ );
491
+
492
+ mix-blend-mode: plus-lighter;
493
+ }
494
+ }
495
+
496
+ // These mixins below are designed to apply the necessary visual effects,
497
+ // when the `tiltFollowingTheCursor` utility function from `3d-tilt-hover-effect.ts`
498
+ // is implemented in a component.
499
+ @mixin parent-of-the-3d-element {
500
+ isolation: isolate;
501
+ transform-style: preserve-3d;
502
+
503
+ perspective: 1000px;
504
+ @media (prefers-reduced-motion) {
505
+ perspective: 2000px;
506
+ }
507
+ }
508
+
509
+ @mixin the-3d-element {
510
+ position: relative;
511
+
512
+ transition-duration: 0.8s;
513
+ transition-property: transform, box-shadow, background-color;
514
+ transition-timing-function: ease-out;
515
+ transform: scale3d(1, 1, 1) rotate3d(0, 0, 0, 0deg);
516
+
517
+ &:focus {
518
+ outline: none;
519
+ }
520
+
521
+ &:hover,
522
+ &:focus,
523
+ &:focus-visible,
524
+ &:focus-within {
525
+ will-change: background-color, box-shadow, transform;
526
+ }
527
+
528
+ &:hover,
529
+ &:focus,
530
+ &:focus-visible,
531
+ &:active {
532
+ transition-duration: 0.2s;
533
+ }
534
+
535
+ &:hover,
536
+ &:focus-visible {
537
+ box-shadow: var(--button-shadow-hovered), var(--shadow-depth-16);
538
+ }
539
+
540
+ &:hover {
541
+ transform: scale3d(1.01, 1.01, 1.01)
542
+ rotate3d(var(--limel-3d-hover-effect-rotate3d));
543
+ }
544
+ &:focus-visible {
545
+ outline: none;
546
+ transform: scale3d(1.01, 1.01, 1.01);
547
+ }
548
+ }
549
+
550
+ @mixin the-3d-element--clickable {
551
+ cursor: pointer;
552
+ box-shadow: var(--button-shadow-normal);
553
+
554
+ &:hover,
555
+ &:focus-visible {
556
+ // seems repetitive. But it's required for some scenarios, like for info tiles.
557
+ box-shadow: var(--button-shadow-hovered), var(--shadow-depth-16);
558
+ }
559
+
560
+ &:active {
561
+ transform: scale3d(1, 1, 1) rotate3d(0, 0, 0, 0deg);
562
+ box-shadow: var(--button-shadow-pressed);
563
+ }
564
+
565
+ &:focus-visible {
566
+ box-shadow: var(--shadow-depth-8-focused), var(--button-shadow-hovered);
567
+ }
568
+
569
+ &:focus-visible:active {
570
+ box-shadow: var(--shadow-depth-8-focused), var(--button-shadow-pressed);
571
+ }
572
+ }
@@ -456,3 +456,117 @@ $clickable-normal-state-transitions: (
456
456
  clip-path: inset(50%);
457
457
  white-space: nowrap;
458
458
  }
459
+
460
+ // This mixin designed to enhance the visual effects,
461
+ // when the `tiltFollowingTheCursor` utility function from `3d-tilt-hover-effect.ts`
462
+ // is implemented in a component.
463
+ // This adds styles to a `<div class"limel-3d-hover-effect-glow" />`, needed to create
464
+ // a glow effect on a 3D element when the parent element is hovered.
465
+ // when the `tiltFollowingTheCursor` utility function from `3d-tilt-hover-effect.ts`
466
+ // Parts of these styles are controlled by the `titleFollowingTheCursor` function.
467
+ @mixin limel-3d-hover-effect-glow($the3dElement, $border-radius) {
468
+ .limel-3d-hover-effect-glow {
469
+ transition:
470
+ background 0.4s ease,
471
+ opacity 0.4s ease;
472
+ pointer-events: none;
473
+
474
+ position: absolute;
475
+ inset: 0;
476
+ border-radius: $border-radius;
477
+
478
+ opacity: 0.1;
479
+ #{$the3dElement}:hover & {
480
+ opacity: 0.5;
481
+ @media (prefers-reduced-motion) {
482
+ opacity: 0.2;
483
+ }
484
+ }
485
+
486
+ background-image: radial-gradient(
487
+ circle at var(--limel-3d-hover-effect-glow-position, 50% -20%),
488
+ rgb(var(--color-white), 0.3),
489
+ rgb(var(--color-white), 0)
490
+ );
491
+
492
+ mix-blend-mode: plus-lighter;
493
+ }
494
+ }
495
+
496
+ // These mixins below are designed to apply the necessary visual effects,
497
+ // when the `tiltFollowingTheCursor` utility function from `3d-tilt-hover-effect.ts`
498
+ // is implemented in a component.
499
+ @mixin parent-of-the-3d-element {
500
+ isolation: isolate;
501
+ transform-style: preserve-3d;
502
+
503
+ perspective: 1000px;
504
+ @media (prefers-reduced-motion) {
505
+ perspective: 2000px;
506
+ }
507
+ }
508
+
509
+ @mixin the-3d-element {
510
+ position: relative;
511
+
512
+ transition-duration: 0.8s;
513
+ transition-property: transform, box-shadow, background-color;
514
+ transition-timing-function: ease-out;
515
+ transform: scale3d(1, 1, 1) rotate3d(0, 0, 0, 0deg);
516
+
517
+ &:focus {
518
+ outline: none;
519
+ }
520
+
521
+ &:hover,
522
+ &:focus,
523
+ &:focus-visible,
524
+ &:focus-within {
525
+ will-change: background-color, box-shadow, transform;
526
+ }
527
+
528
+ &:hover,
529
+ &:focus,
530
+ &:focus-visible,
531
+ &:active {
532
+ transition-duration: 0.2s;
533
+ }
534
+
535
+ &:hover,
536
+ &:focus-visible {
537
+ box-shadow: var(--button-shadow-hovered), var(--shadow-depth-16);
538
+ }
539
+
540
+ &:hover {
541
+ transform: scale3d(1.01, 1.01, 1.01)
542
+ rotate3d(var(--limel-3d-hover-effect-rotate3d));
543
+ }
544
+ &:focus-visible {
545
+ outline: none;
546
+ transform: scale3d(1.01, 1.01, 1.01);
547
+ }
548
+ }
549
+
550
+ @mixin the-3d-element--clickable {
551
+ cursor: pointer;
552
+ box-shadow: var(--button-shadow-normal);
553
+
554
+ &:hover,
555
+ &:focus-visible {
556
+ // seems repetitive. But it's required for some scenarios, like for info tiles.
557
+ box-shadow: var(--button-shadow-hovered), var(--shadow-depth-16);
558
+ }
559
+
560
+ &:active {
561
+ transform: scale3d(1, 1, 1) rotate3d(0, 0, 0, 0deg);
562
+ box-shadow: var(--button-shadow-pressed);
563
+ }
564
+
565
+ &:focus-visible {
566
+ box-shadow: var(--shadow-depth-8-focused), var(--button-shadow-hovered);
567
+ }
568
+
569
+ &:focus-visible:active {
570
+ box-shadow: var(--shadow-depth-8-focused), var(--button-shadow-pressed);
571
+ }
572
+ }
@@ -61,6 +61,10 @@ export declare class Card {
61
61
  * Fired when a action bar item has been clicked.
62
62
  */
63
63
  actionSelected: EventEmitter<ActionBarItem>;
64
+ private host;
65
+ private handleMouseEnter;
66
+ private handleMouseLeave;
67
+ componentWillLoad(): void;
64
68
  render(): any;
65
69
  private renderImage;
66
70
  private renderHeader;
@@ -74,7 +74,11 @@ export declare class InfoTile {
74
74
  * Colors change with intervals of 10 %.
75
75
  */
76
76
  progress?: InfoTileProgress;
77
- render(): any[];
77
+ private host;
78
+ private handleMouseEnter;
79
+ private handleMouseLeave;
80
+ componentWillLoad(): void;
81
+ render(): any;
78
82
  private checkProps;
79
83
  private renderPrefix;
80
84
  private renderValue;
@@ -14,6 +14,14 @@ import { CustomElementDefinition } from '../../global/shared-types/custom-elemen
14
14
  * @returns The resulting HTML.
15
15
  */
16
16
  export declare function markdownToHTML(text: string, options?: markdownToHTMLOptions): Promise<string>;
17
+ /**
18
+ * Sanitizes a given HTML string by removing dangerous tags and attributes.
19
+ *
20
+ * @param html - The string containing HTML to sanitize.
21
+ * @param whitelist - Optional whitelist of custom components.
22
+ * @returns The sanitized HTML string.
23
+ */
24
+ export declare function sanitizeHTML(html: string, whitelist?: CustomElementDefinition[]): Promise<string>;
17
25
  /**
18
26
  * Options for markdownToHTML.
19
27
  */
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Utility functions for creating a 3D tilt hover effect.
3
+ *
4
+ * This module provides functions to enable a 3D tilt effect for consumer components,
5
+ * allowing elements to visually follow the cursor's position and tilt towards it.
6
+ * It also includes a glow effect for added interactivity.
7
+ *
8
+ * ## Usage
9
+ *
10
+ * 1. **Import the utility**:
11
+ *
12
+ * ```tsx
13
+ * import { getMouseEventHandlers } from './path/to/3d-tilt-hover-effect';
14
+ * ```
15
+ *
16
+ * 2. **Define the structure of your component**:
17
+ *
18
+ * To enable the 3D tilt effect, the host element of your component should act as
19
+ * the "parent-of-the-3d-element", and a nested child element should act as
20
+ * "the-3d-element" (the interactive element). This structure is necessary
21
+ * to properly isolate the 3D transformations and maintain visual fidelity.
22
+ *
23
+ * For example:
24
+ *
25
+ * ```tsx
26
+ * <Host>
27
+ * <section class="the-3d-element">
28
+ * <!-- Your component content -->
29
+ * </section>
30
+ * </Host>
31
+ * ```
32
+ *
33
+ * Apply the required SCSS mixins to these elements:
34
+ *
35
+ * - **On the host element**:
36
+ * ```scss
37
+ * @include parent-of-the-3d-element;
38
+ * ```
39
+ * - **On the nested "interactive" element**:
40
+ * ```scss
41
+ * @include the-3d-element;
42
+ * ```
43
+ * - **For clickable interactive elements**:
44
+ * ```scss
45
+ * @include the-3d-element--clickable;
46
+ * ```
47
+ * - **For the glow effect**:
48
+ * Add a `<div class="limel-3d-hover-effect-glow" />` inside "the-3d-element",
49
+ * and use the following SCSS mixin:
50
+ * ```scss
51
+ * @include limel-3d-hover-effect-glow($selector, $border-radius);
52
+ * ```
53
+ *
54
+ * 3. **Initialize in your component**:
55
+ *
56
+ * Use `getMouseEventHandlers()` to attach the required mouse event listeners
57
+ * to the "interactive element" (`the-3d-element`). For example:
58
+ *
59
+ * ```tsx
60
+ * @Element()
61
+ * private host: HTMLElement;
62
+ *
63
+ * private handleMouseEnter: () => void;
64
+ * private handleMouseLeave: () => void;
65
+ *
66
+ * public componentWillLoad() {
67
+ * const { handleMouseEnter, handleMouseLeave } = getMouseEventHandlers(
68
+ * this.host.querySelector('.the-3d-element'),
69
+ * );
70
+ * this.handleMouseEnter = handleMouseEnter;
71
+ * this.handleMouseLeave = handleMouseLeave;
72
+ * }
73
+ * ```
74
+ *
75
+ * 4. **Attach event handlers in your render method**:
76
+ *
77
+ * ```tsx
78
+ * public render() {
79
+ * return (
80
+ * <Host>
81
+ * <section
82
+ * class="the-3d-element"
83
+ * onMouseEnter={this.handleMouseEnter}
84
+ * onMouseLeave={this.handleMouseLeave}
85
+ * >
86
+ * <!-- Your component content -->
87
+ * <div class="limel-3d-hover-effect-glow" />
88
+ * </section>
89
+ * </Host>
90
+ * );
91
+ * }
92
+ * ```
93
+ *
94
+ * ## Styling Notes
95
+ *
96
+ * - The host element (`parent-of-the-3d-element`) must have these styles:
97
+ * ```scss
98
+ * @include parent-of-the-3d-element;
99
+ * ```
100
+ * - The nested "interactive element" (`the-3d-element`) should have:
101
+ * ```scss
102
+ * @include the-3d-element;
103
+ * ```
104
+ * - For components like Card or Info Tile, using a nested "interactive element"
105
+ * is the only way to achieve the 3D effect, as the host serves as the parent
106
+ * and must maintain proper isolation for the effect.
107
+ */
108
+ export declare const MOUSE_SCALE_FACTOR = 100;
109
+ export declare const SCALING_BASE = 50;
110
+ export declare const ROTATION_DEGREE_MULTIPLIER = 1.6;
111
+ export declare const GLOW_POSITION_MULTIPLIER = 2;
112
+ export declare const CENTER_DIVISOR = 2;
113
+ export declare const tiltFollowingTheCursor: (the3dElementBounds: DOMRect, element: HTMLElement) => (e: MouseEvent) => void;
114
+ export declare const getMouseEventHandlers: (element: HTMLElement) => {
115
+ handleMouseEnter: () => void;
116
+ handleMouseLeave: () => void;
117
+ };
118
+ //# sourceMappingURL=3d-tilt-hover-effect.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-elements",
3
- "version": "37.71.0",
3
+ "version": "37.72.1",
4
4
  "description": "Lime Elements",
5
5
  "author": "Lime Technologies",
6
6
  "license": "Apache-2.0",
@@ -88,14 +88,15 @@
88
88
  "prettier": "^3.3.3",
89
89
  "prosemirror-example-setup": "^1.2.3",
90
90
  "prosemirror-markdown": "^1.13.1",
91
- "prosemirror-schema-basic": "^1.2.3",
92
91
  "prosemirror-model": ">=1.22.1",
92
+ "prosemirror-schema-basic": "^1.2.3",
93
93
  "prosemirror-tables": "^1.5.0",
94
94
  "puppeteer": "^19.11.1",
95
95
  "react": "^18.3.1",
96
96
  "react-dom": "^18.3.1",
97
97
  "react-shadow-dom-retarget-events": "^1.1.0",
98
98
  "rehype-external-links": "^3.0.0",
99
+ "rehype-parse": "^9.0.1",
99
100
  "rehype-raw": "^7.0.0",
100
101
  "rehype-sanitize": "^6.0.0",
101
102
  "rehype-stringify": "^10.0.1",