@limetech/lime-elements 38.1.5 → 38.2.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 (31) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/limel-collapsible-section.cjs.entry.js +5 -2
  3. package/dist/cjs/limel-collapsible-section.cjs.entry.js.map +1 -1
  4. package/dist/cjs/limel-markdown.cjs.entry.js +1 -1
  5. package/dist/cjs/limel-markdown.cjs.entry.js.map +1 -1
  6. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
  7. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js.map +1 -1
  8. package/dist/collection/components/collapsible-section/collapsible-section.css +4 -0
  9. package/dist/collection/components/collapsible-section/collapsible-section.js +5 -1
  10. package/dist/collection/components/collapsible-section/collapsible-section.js.map +1 -1
  11. package/dist/collection/components/markdown/markdown.css +11 -0
  12. package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.css +11 -0
  13. package/dist/esm/limel-collapsible-section.entry.js +5 -2
  14. package/dist/esm/limel-collapsible-section.entry.js.map +1 -1
  15. package/dist/esm/limel-markdown.entry.js +1 -1
  16. package/dist/esm/limel-markdown.entry.js.map +1 -1
  17. package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
  18. package/dist/esm/limel-prosemirror-adapter.entry.js.map +1 -1
  19. package/dist/lime-elements/lime-elements.esm.js +1 -1
  20. package/dist/lime-elements/p-3ab8ab51.entry.js +2 -0
  21. package/dist/lime-elements/{p-261cc6f1.entry.js.map → p-3ab8ab51.entry.js.map} +1 -1
  22. package/dist/lime-elements/p-4f70c0aa.entry.js +2 -0
  23. package/dist/lime-elements/p-4f70c0aa.entry.js.map +1 -0
  24. package/dist/lime-elements/{p-fdfd3e5a.entry.js → p-e5545944.entry.js} +2 -2
  25. package/dist/lime-elements/{p-fdfd3e5a.entry.js.map → p-e5545944.entry.js.map} +1 -1
  26. package/dist/types/components/collapsible-section/collapsible-section.d.ts +2 -0
  27. package/dist/types/components.d.ts +4 -0
  28. package/package.json +3 -3
  29. package/dist/lime-elements/p-261cc6f1.entry.js +0 -2
  30. package/dist/lime-elements/p-d6eb9c6f.entry.js +0 -2
  31. package/dist/lime-elements/p-d6eb9c6f.entry.js.map +0 -1
@@ -3,6 +3,7 @@ import { Action } from './action';
3
3
  * @slot - Content to put inside the collapsible section
4
4
  * @exampleComponent limel-example-collapsible-section
5
5
  * @exampleComponent limel-example-collapsible-section-actions
6
+ * @exampleComponent limel-example-collapsible-section-with-custom-header-component
6
7
  * @exampleComponent limel-example-collapsible-section-css-props
7
8
  * @exampleComponent limel-example-collapsible-section-external-control
8
9
  * @exampleComponent limel-example-collapsible-section-with-slider
@@ -40,6 +41,7 @@ export declare class CollapsibleSection {
40
41
  private onClick;
41
42
  private handleInteraction;
42
43
  private renderActions;
44
+ private renderHeaderSlot;
43
45
  private renderActionButton;
44
46
  private handleActionClick;
45
47
  }
@@ -856,6 +856,7 @@ export namespace Components {
856
856
  /**
857
857
  * @exampleComponent limel-example-collapsible-section
858
858
  * @exampleComponent limel-example-collapsible-section-actions
859
+ * @exampleComponent limel-example-collapsible-section-with-custom-header-component
859
860
  * @exampleComponent limel-example-collapsible-section-css-props
860
861
  * @exampleComponent limel-example-collapsible-section-external-control
861
862
  * @exampleComponent limel-example-collapsible-section-with-slider
@@ -3466,6 +3467,7 @@ declare global {
3466
3467
  /**
3467
3468
  * @exampleComponent limel-example-collapsible-section
3468
3469
  * @exampleComponent limel-example-collapsible-section-actions
3470
+ * @exampleComponent limel-example-collapsible-section-with-custom-header-component
3469
3471
  * @exampleComponent limel-example-collapsible-section-css-props
3470
3472
  * @exampleComponent limel-example-collapsible-section-external-control
3471
3473
  * @exampleComponent limel-example-collapsible-section-with-slider
@@ -5383,6 +5385,7 @@ declare namespace LocalJSX {
5383
5385
  /**
5384
5386
  * @exampleComponent limel-example-collapsible-section
5385
5387
  * @exampleComponent limel-example-collapsible-section-actions
5388
+ * @exampleComponent limel-example-collapsible-section-with-custom-header-component
5386
5389
  * @exampleComponent limel-example-collapsible-section-css-props
5387
5390
  * @exampleComponent limel-example-collapsible-section-external-control
5388
5391
  * @exampleComponent limel-example-collapsible-section-with-slider
@@ -8056,6 +8059,7 @@ declare module "@stencil/core" {
8056
8059
  /**
8057
8060
  * @exampleComponent limel-example-collapsible-section
8058
8061
  * @exampleComponent limel-example-collapsible-section-actions
8062
+ * @exampleComponent limel-example-collapsible-section-with-custom-header-component
8059
8063
  * @exampleComponent limel-example-collapsible-section-css-props
8060
8064
  * @exampleComponent limel-example-collapsible-section-external-control
8061
8065
  * @exampleComponent limel-example-collapsible-section-with-slider
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-elements",
3
- "version": "38.1.5",
3
+ "version": "38.2.1",
4
4
  "description": "Lime Elements",
5
5
  "author": "Lime Technologies",
6
6
  "license": "Apache-2.0",
@@ -44,9 +44,9 @@
44
44
  },
45
45
  "devDependencies": {
46
46
  "@commitlint/config-conventional": "^19.7.1",
47
- "@eslint/eslintrc": "^3.2.0",
47
+ "@eslint/eslintrc": "^3.3.0",
48
48
  "@eslint/js": "^9.21.0",
49
- "@microsoft/api-extractor": "^7.50.0",
49
+ "@microsoft/api-extractor": "^7.51.0",
50
50
  "@popperjs/core": "^2.11.8",
51
51
  "@rjsf/core": "^2.4.2",
52
52
  "@rollup/plugin-node-resolve": "^13.3.0",
@@ -1,2 +0,0 @@
1
- import{r as e,h as r}from"./p-443111b3.js";import{m as o}from"./p-639f9320.js";import{g as t}from"./p-2c35fb9d.js";import"./p-eab67c09.js";const a='@charset "UTF-8";code{font-family:ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;font-size:0.8125rem;letter-spacing:-0.0125rem;color:rgb(var(--contrast-1300));-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;display:inline-block;border-radius:0.25rem;padding:0.03125rem 0.25rem;background-color:rgb(var(--contrast-600))}pre>code{display:block;margin:0.5rem 0;padding:0.5rem 0.75rem;overflow:auto;white-space:pre-wrap}h1{font-size:1.5rem}h2{font-size:1.25rem}h3{font-size:1.125rem}h4{font-size:1rem}h5{font-size:0.875rem}h6{font-size:0.75rem}h1,h2{margin-top:0.5rem;margin-bottom:0.5rem;letter-spacing:-0.03125rem;font-weight:500}h3,h4{margin-top:0.75rem;margin-bottom:0.25rem;font-weight:600}h5,h6{margin-top:0.5rem;margin-bottom:0.125rem;font-weight:600}h1,h2,h3,h4,h5,h6{word-break:break-word;hyphens:auto;-webkit-hyphens:auto}:not([contenteditable=true]) h1,:not([contenteditable=true]) h2,:not([contenteditable=true]) h3,:not([contenteditable=true]) h4,:not([contenteditable=true]) h5,:not([contenteditable=true]) h6{text-wrap:balance}[contenteditable=true] h1,[contenteditable=true] h2,[contenteditable=true] h3,[contenteditable=true] h4,[contenteditable=true] h5,[contenteditable=true] h6{text-wrap:initial}:host(limel-markdown.truncate-paragraphs) p{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}p,li{font-size:0.875rem;word-break:break-word;hyphens:auto;-webkit-hyphens:auto}a{word-break:break-all}p{margin-top:0;margin-bottom:0.5rem}p:only-child{margin-bottom:0}a{transition:color 0.2s ease;color:var(--markdown-hyperlink-color, rgb(var(--color-blue-dark)));text-decoration:none}a:hover{color:var(--markdown-hyperlink-color--hovered, rgb(var(--color-blue-default)))}hr{margin:1.75rem 0 2rem 0;border-width:0;border-top:1px solid rgb(var(--contrast-500))}ul{list-style:none}ul li{position:relative;margin-left:0.75rem}ul li:before{content:"";position:absolute;left:-0.5rem;top:0.5rem;width:0.25rem;height:0.25rem;border-radius:50%;background-color:rgb(var(--contrast-700));display:block}ol{margin-top:0.25rem;padding-left:1rem}ul{margin-top:0.25rem;padding-left:0}ul ul,ul ol,ol ol,ol ul{margin-left:0}li{margin-bottom:0.25rem}:host(limel-markdown:not(.no-table-styles)) table{table-layout:auto;min-width:100%;border-collapse:collapse;border-spacing:0;background:transparent;margin:0.75rem 0;border:1px solid rgb(var(--contrast-400))}:host(limel-markdown:not(.no-table-styles)) th,:host(limel-markdown:not(.no-table-styles)) td{text-align:left;vertical-align:top;transition:background-color 0.2s ease;font-size:0.875rem}:host(limel-markdown:not(.no-table-styles)) td{padding:0.5rem 0.375rem 0.75rem 0.375rem}:host(limel-markdown:not(.no-table-styles)) tr th{background-color:rgb(var(--contrast-400));padding:0.25rem 0.375rem;font-weight:normal}:host(limel-markdown:not(.no-table-styles)) tr th:only-child{text-align:center}:host(limel-markdown:not(.no-table-styles)) tbody tr:nth-child(odd) td{background-color:rgb(var(--contrast-200))}:host(limel-markdown:not(.no-table-styles)) tbody tr:hover td{background-color:rgb(var(--contrast-300))}blockquote{position:relative;font-weight:100;font-size:0.875rem;max-width:100%;line-height:1.4;margin:0;padding:0.5rem 1.25rem;border-radius:0.05rem 0.75rem;background-color:rgb(var(--contrast-300))}blockquote:before,blockquote:after{position:absolute;font-size:2.75rem;opacity:0.4}blockquote:before{content:"“";left:0;top:-0.75rem}blockquote:after{content:"”";right:0;bottom:-2rem}dl{display:grid;grid-template-columns:1fr 2fr;grid-template-rows:1fr;margin-bottom:2rem;border:1px solid rgb(var(--contrast-400));border-radius:0.375rem;background-color:rgb(var(--contrast-200))}dl dt,dl dd{padding:0.375rem 0.5rem;font-size:0.875rem;margin:0}dl dt:nth-of-type(even),dl dd:nth-of-type(even){background-color:rgb(var(--contrast-300))}dl dt:first-child{border-top-left-radius:0.375rem}dl dt:last-child{border-bottom-left-radius:0.375rem}dl dd:first-child{border-top-right-radius:0.375rem}dl dd:last-child{border-bottom-right-radius:0.375rem}img{max-width:100%;border-radius:0.25rem}kbd{font-family:ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;font-weight:600;color:rgb(var(--contrast-1100));background-color:rgb(var(--contrast-200));white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:normal;padding:0.125rem 0.5rem;margin:0 0.25rem;box-shadow:var(--button-shadow-normal), 0 0.03125rem 0.21875rem 0 rgba(var(--contrast-100), 0.5) inset;border-radius:0.125rem;border-style:solid;border-color:rgba(var(--contrast-600), 0.8);border-width:0 1px 0.125rem 1px}:host(limel-markdown.adjust-for-table-cell) img{max-height:1.25rem;vertical-align:middle}:host(limel-markdown.adjust-for-table-cell) p{display:inline}:host(limel-markdown.adjust-for-table-cell) h1,:host(limel-markdown.adjust-for-table-cell) h2,:host(limel-markdown.adjust-for-table-cell) h3,:host(limel-markdown.adjust-for-table-cell) h4,:host(limel-markdown.adjust-for-table-cell) h5,:host(limel-markdown.adjust-for-table-cell) h6{display:inline-block;vertical-align:bottom;font-size:0.875rem;margin:0 0.25rem 0 0;letter-spacing:normal;font-weight:500}:host(limel-markdown.adjust-for-table-cell) h1:before,:host(limel-markdown.adjust-for-table-cell) h2:before,:host(limel-markdown.adjust-for-table-cell) h3:before,:host(limel-markdown.adjust-for-table-cell) h4:before,:host(limel-markdown.adjust-for-table-cell) h5:before,:host(limel-markdown.adjust-for-table-cell) h6:before{opacity:0.6;vertical-align:middle;font-size:0.5rem;border-radius:0.25rem 0 0 0.25rem;padding:0.25rem;padding-right:2rem;margin-right:-1.75rem;background:linear-gradient(to right, rgb(var(--contrast-800), 0.6), rgb(var(--contrast-800), 0))}:host(limel-markdown.adjust-for-table-cell) h1:before{content:"H1"}:host(limel-markdown.adjust-for-table-cell) h2:before{content:"H2"}:host(limel-markdown.adjust-for-table-cell) h3:before{content:"H3"}:host(limel-markdown.adjust-for-table-cell) h4:before{content:"H4"}:host(limel-markdown.adjust-for-table-cell) h5:before{content:"H5"}:host(limel-markdown.adjust-for-table-cell) h6:before{content:"H6"}:host(limel-markdown.adjust-for-table-cell) pre{margin:0}:host(limel-markdown.adjust-for-table-cell) pre>code{padding:0.125rem;margin:0}:host(limel-markdown.adjust-for-table-cell) dl{margin:0}:host(limel-markdown.adjust-for-table-cell) dl dt,:host(limel-markdown.adjust-for-table-cell) dl dd{padding:0.00625rem 0.125rem}hr{border-top:1px solid rgb(var(--contrast-700))}.MsoNormal{margin:0}';const l=class{constructor(r){e(this,r);this.value=undefined;this.whitelist=t.markdownWhitelist}async textChanged(){var e;try{const r=await o(this.value,{forceHardLineBreaks:true,whitelist:(e=this.whitelist)!==null&&e!==void 0?e:[]});this.rootElement.innerHTML=r}catch(e){console.error(e)}}async componentDidLoad(){this.textChanged()}render(){return[r("div",{id:"markdown",ref:e=>this.rootElement=e})]}static get watchers(){return{value:["textChanged"]}}};l.style=a;export{l as limel_markdown};
2
- //# sourceMappingURL=p-261cc6f1.entry.js.map
@@ -1,2 +0,0 @@
1
- import{r as e,c as o,h as t,g as r}from"./p-443111b3.js";import{d as n}from"./p-c70b1ea3.js";import{m as i,r as s}from"./p-869d6d77.js";import{c as a}from"./p-96460db3.js";const l='@charset "UTF-8";:host{--mdc-theme-primary:var(\n --lime-primary-color,\n rgb(var(--color-teal-default))\n );--mdc-theme-secondary:var(\n --lime-secondary-color,\n rgb(var(--contrast-1100))\n );--mdc-theme-on-primary:var(\n --lime-on-primary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-secondary:var(\n --lime-on-secondary-color,\n rgb(var(--contrast-100))\n );--mdc-theme-text-disabled-on-background:var(\n --lime-text-disabled-on-background-color,\n rgba(var(--contrast-1700), 0.38)\n );--mdc-theme-text-primary-on-background:var(\n --lime-text-primary-on-background-color,\n rgba(var(--contrast-1700), 0.87)\n );--mdc-theme-text-secondary-on-background:var(\n --lime-text-secondary-on-background-color,\n rgba(var(--contrast-1700), 0.54)\n );--mdc-theme-error:var(\n --lime-error-background-color,\n rgb(var(--color-red-dark))\n );--lime-error-text-color:rgb(var(--color-red-darker));--mdc-theme-surface:var(\n --lime-surface-background-color,\n rgb(var(--contrast-100))\n );--mdc-theme-on-surface:var(\n --lime-on-surface-color,\n rgb(var(--contrast-1500))\n )}:host(limel-collapsible-section){--border-radius-of-header:0.75rem;display:block}:host([hidden]){display:none}.open-close-toggle{all:unset;position:absolute;inset:0;width:100%;transition:background-color 0.4s ease, border-radius 0.1s ease;cursor:pointer;z-index:-1;background-color:var(--closed-header-background-color, rgb(var(--contrast-200)));border-radius:var(--border-radius-of-header)}.open-close-toggle:focus{outline:none}.open-close-toggle:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.open-close-toggle:hover{background-color:var(--open-header-background-color, rgb(var(--contrast-300)))}section.open .open-close-toggle{background-color:var(--open-header-background-color, rgb(var(--contrast-100)));border-radius:var(--border-radius-of-header) var(--border-radius-of-header) 0 0}section.open .open-close-toggle:hover{background-color:var(--open-header-background-color, rgb(var(--contrast-300)))}.title,.divider-line,.expand-icon{pointer-events:none}header{isolation:isolate;position:relative;align-items:center;display:flex;justify-content:space-between;padding-left:0.5rem;height:2.5rem}.title{font-size:1rem;font-weight:300;color:var(--mdc-theme-on-surface);justify-self:flex-start;user-select:none;padding-right:0.5rem;height:auto;max-height:3rem;line-height:1.2rem;display:-webkit-box;overflow:hidden;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2}.divider-line{transition:opacity 0.3s ease 0.3s;flex-grow:1;height:0.125rem;border-radius:1rem;background-color:var(--header-stroke-color, rgb(var(--contrast-900)));margin-right:0.5rem;opacity:0}section.open .divider-line{opacity:0.16}.actions{justify-self:flex-end;flex-shrink:0}.body{background-color:var(--body-background-color, var(--contrast-100));padding-left:var(--body-padding, 1.25rem);padding-right:var(--body-padding, 1.25rem);border-radius:0 0 var(--border-radius-of-header) var(--border-radius-of-header)}.body{--limel-cs-opacity-transition-speed:0.1s;--limel-cs-opacity-transition-delay:0s;--limel-cs-grid-template-rows-transition-speed:0.3s;transition:grid-template-rows var(--limel-cs-grid-template-rows-transition-speed) cubic-bezier(1, 0.09, 0, 0.89);display:grid;grid-template-rows:0fr}.body slot{transition:opacity var(--limel-cs-opacity-transition-speed) ease var(--limel-cs-opacity-transition-delay);display:block;overflow:hidden;opacity:0}section.open .body{--limel-cs-opacity-transition-speed:0.4s;--limel-cs-opacity-transition-delay:0.3s;--limel-cs-grid-template-rows-transition-speed:0.46s;grid-template-rows:1fr}section.open .body slot{opacity:1}header:hover+.body{will-change:grid-template-rows}header:hover+.body slot{will-change:opacity}.expand-icon{position:relative;height:1.875rem;margin:0 1rem 0 0.5rem;width:0.75rem;flex-shrink:0}.line{position:absolute;top:0;right:0;bottom:0;left:0;margin:auto;width:100%;border-radius:1rem;height:0.125rem;background-color:var(--header-stroke-color, rgb(var(--contrast-900)))}.line:first-of-type,.line:last-of-type{transition:opacity 0.2s ease 0.1s, transform 0.4s ease 0.3s}.line:first-of-type{transform:rotate3d(0, 0, 1, 90deg)}.line:last-of-type{transform:rotate3d(0, 0, 1, -90deg)}.line:nth-of-type(2),.line:nth-of-type(3){transition:opacity 0.2s ease, transform 0.18s ease}section.open .line:first-of-type,section.open .line:last-of-type{transition:opacity 0.2s ease 0.1s, transform 0.4s ease 0.3s}section.open .line:first-of-type{transform:rotate3d(0, 0, 1, 0deg)}section.open .line:last-of-type{transform:rotate3d(0, 0, 1, 0deg)}section.open .line:nth-of-type(2),section.open .line:nth-of-type(3){transition:opacity 1s ease, transform 0.4s ease}section.open .line:nth-of-type(2){transform:translate3d(0, -1rem, 0);opacity:0}section.open .line:nth-of-type(3){transform:translate3d(0, 1rem, 0);opacity:0}.open-close-toggle:hover+.expand-icon .line:first-of-type{transform:rotate3d(0, 0, 1, 0deg)}.open-close-toggle:hover+.expand-icon .line:last-of-type{transform:rotate3d(0, 0, 1, 0deg)}.open-close-toggle:hover+.expand-icon .line:nth-of-type(2),.open-close-toggle:hover+.expand-icon .line:nth-of-type(3){transition:opacity 0.5s ease 0.4s, transform 0.7s cubic-bezier(0.85, 0.11, 0.14, 1.35) 0.2s}.open-close-toggle:hover+.expand-icon .line:nth-of-type(2){transform:translate3d(0, -0.5rem, 0);opacity:0.4}.open-close-toggle:hover+.expand-icon .line:nth-of-type(3){transform:translate3d(0, 0.5rem, 0);opacity:0.4}section.open .open-close-toggle:hover+.expand-icon .line:first-of-type,section.open .open-close-toggle:hover+.expand-icon .line:last-of-type{transition:opacity 0.2s ease 0.4s, transform 0.4s cubic-bezier(0.85, 0.11, 0.14, 1.35) 0.2s}section.open .open-close-toggle:hover+.expand-icon .line:first-of-type{transform:rotate3d(0, 0, 1, 45deg)}section.open .open-close-toggle:hover+.expand-icon .line:last-of-type{transform:rotate3d(0, 0, 1, -45deg)}section.open .open-close-toggle:hover+.expand-icon .line:nth-of-type(2){transform:translate3d(0, -1rem, 0);opacity:0}section.open .open-close-toggle:hover+.expand-icon .line:nth-of-type(3){transform:translate3d(0, 1rem, 0);opacity:0}';const c=class{constructor(r){e(this,r);this.open=o(this,"open",7);this.close=o(this,"close",7);this.action=o(this,"action",7);this.bodyId=a();this.onClick=()=>{this.handleInteraction()};this.handleInteraction=()=>{this.isOpen=!this.isOpen;if(this.isOpen){this.open.emit();const e=100;setTimeout(n,e)}else{this.close.emit()}};this.renderActions=()=>{if(!this.actions){return}return t("div",{class:"actions"},this.actions.map(this.renderActionButton))};this.renderActionButton=e=>t("limel-icon-button",{icon:e.icon,label:e.label,disabled:e.disabled,onClick:this.handleActionClick(e)});this.handleActionClick=e=>o=>{o.stopPropagation();this.action.emit(e)};this.isOpen=false;this.header=undefined;this.actions=undefined}componentDidRender(){const e=this.host.shadowRoot.querySelector(".open-close-toggle");i(e)}disconnectedCallback(){const e=this.host.shadowRoot.querySelector(".open-close-toggle");s(e)}render(){return t("section",{class:`${this.isOpen?"open":""}`},t("header",null,t("button",{class:"open-close-toggle",onClick:this.onClick,"aria-controls":this.bodyId}),t("div",{class:"expand-icon"},t("div",{class:"line"}),t("div",{class:"line"}),t("div",{class:"line"}),t("div",{class:"line"})),t("h2",{class:"title mdc-typography mdc-typography--headline2"},this.header),t("div",{class:"divider-line"}),this.renderActions()),t("div",{class:"body","aria-hidden":String(!this.isOpen),id:this.bodyId},t("slot",null)))}get host(){return r(this)}};c.style=l;export{c as limel_collapsible_section};
2
- //# sourceMappingURL=p-d6eb9c6f.entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["collapsibleSectionCss","CollapsibleSection","this","bodyId","createRandomString","onClick","handleInteraction","isOpen","open","emit","waitForUiToRender","setTimeout","dispatchResizeEvent","close","renderActions","actions","h","class","map","renderActionButton","action","icon","label","disabled","handleActionClick","event","stopPropagation","componentDidRender","button","host","shadowRoot","querySelector","makeEnterClickable","disconnectedCallback","removeEnterClickable","render","header","String","id"],"sources":["./src/components/collapsible-section/collapsible-section.scss?tag=limel-collapsible-section&encapsulation=shadow","./src/components/collapsible-section/collapsible-section.tsx"],"sourcesContent":["@use '../../style/internal/lime-theme';\n@use '../../style/mixins';\n@use '../../style/internal/shared_input-select-picker';\n\n/**\n * @prop --closed-header-background-color: background color for header when closed\n * @prop --open-header-background-color: background color for header when open\n * @prop --header-stroke-color: color of the animated icons that visualize collapsed or normal states of the headers, as well as the divider line on headers\n * @prop --body-background-color: background color for body\n * @prop --body-padding: space around content of the body\n */\n\n:host(limel-collapsible-section) {\n --border-radius-of-header: 0.75rem;\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.open-close-toggle {\n all: unset;\n position: absolute;\n inset: 0;\n width: 100%; // for Firefox\n @include mixins.visualize-keyboard-focus;\n transition:\n background-color 0.4s ease,\n border-radius 0.1s ease;\n cursor: pointer;\n z-index: -1;\n\n background-color: var(\n --closed-header-background-color,\n rgb(var(--contrast-200))\n );\n border-radius: var(--border-radius-of-header);\n\n &:hover {\n background-color: var(\n --open-header-background-color,\n rgb(var(--contrast-300))\n );\n }\n\n section.open & {\n background-color: var(\n --open-header-background-color,\n rgb(var(--contrast-100))\n );\n border-radius: var(--border-radius-of-header)\n var(--border-radius-of-header) 0 0;\n &:hover {\n background-color: var(\n --open-header-background-color,\n rgb(var(--contrast-300))\n );\n }\n }\n}\n\n.title,\n.divider-line,\n.expand-icon {\n pointer-events: none;\n}\n\nheader {\n isolation: isolate;\n position: relative;\n\n align-items: center;\n display: flex;\n justify-content: space-between;\n\n padding-left: 0.5rem;\n height: shared_input-select-picker.$height-of-mdc-text-field;\n}\n\n.title {\n font-size: 1rem;\n font-weight: 300;\n color: var(--mdc-theme-on-surface);\n\n justify-self: flex-start;\n\n user-select: none; // mostly to improve experience on Android, where tapping on sections selects the text too\n\n padding-right: 0.5rem;\n\n // Below tries to render text in two lines,\n // and then truncate if there is no more space\n height: auto;\n max-height: 3rem;\n line-height: 1.2rem;\n @include mixins.truncate-text-on-line(2);\n}\n\n.divider-line {\n transition: opacity 0.3s ease 0.3s;\n flex-grow: 1;\n height: 0.125rem;\n border-radius: 1rem;\n background-color: var(--header-stroke-color, rgb(var(--contrast-900)));\n margin-right: 0.5rem;\n\n opacity: 0;\n\n section.open & {\n opacity: 0.16;\n }\n}\n\n.actions {\n justify-self: flex-end;\n flex-shrink: 0;\n}\n\n.body {\n background-color: var(--body-background-color, var(--contrast-100));\n padding-left: var(--body-padding, 1.25rem);\n padding-right: var(--body-padding, 1.25rem);\n border-radius: 0 0 var(--border-radius-of-header)\n var(--border-radius-of-header);\n}\n\n// This animates height of the body,\n// from `0` to `auto`\n.body {\n // All below vars are for internal use only!\n --limel-cs-opacity-transition-speed: 0.1s;\n --limel-cs-opacity-transition-delay: 0s;\n --limel-cs-grid-template-rows-transition-speed: 0.3s;\n transition: grid-template-rows\n var(--limel-cs-grid-template-rows-transition-speed)\n cubic-bezier(1, 0.09, 0, 0.89);\n display: grid;\n grid-template-rows: 0fr;\n\n slot {\n transition: opacity var(--limel-cs-opacity-transition-speed) ease\n var(--limel-cs-opacity-transition-delay);\n display: block;\n overflow: hidden;\n opacity: 0;\n }\n}\n\nsection.open {\n .body {\n --limel-cs-opacity-transition-speed: 0.4s;\n --limel-cs-opacity-transition-delay: 0.3s;\n --limel-cs-grid-template-rows-transition-speed: 0.46s;\n grid-template-rows: 1fr;\n\n slot {\n opacity: 1;\n }\n }\n}\n\nheader:hover {\n + .body {\n will-change: grid-template-rows;\n\n slot {\n will-change: opacity;\n }\n }\n}\n\n// End: animating height\n\n@import './partial-styles/expand-icon.scss';\n","import {\n Component,\n Event,\n Element,\n EventEmitter,\n h,\n Prop,\n} from '@stencil/core';\nimport { dispatchResizeEvent } from '../../util/dispatch-resize-event';\nimport { Action } from './action';\nimport {\n makeEnterClickable,\n removeEnterClickable,\n} from '../../util/make-enter-clickable';\nimport { createRandomString } from '../../util/random-string';\n\n/**\n * @slot - Content to put inside the collapsible section\n * @exampleComponent limel-example-collapsible-section\n * @exampleComponent limel-example-collapsible-section-actions\n * @exampleComponent limel-example-collapsible-section-css-props\n * @exampleComponent limel-example-collapsible-section-external-control\n * @exampleComponent limel-example-collapsible-section-with-slider\n */\n@Component({\n tag: 'limel-collapsible-section',\n shadow: true,\n styleUrl: 'collapsible-section.scss',\n})\nexport class CollapsibleSection {\n /**\n * `true` if the section is expanded, `false` if collapsed.\n */\n @Prop({ mutable: true, reflect: true })\n public isOpen: boolean = false;\n\n /**\n * Text to display in the header of the section\n */\n @Prop({ reflect: true })\n public header: string;\n\n /**\n * Actions to place to the far right inside the header\n */\n @Prop()\n public actions: Action[];\n\n /**\n * Emitted when the section is expanded\n */\n @Event()\n private open: EventEmitter<void>;\n\n /**\n * Emitted when the section is collapsed\n */\n @Event()\n private close: EventEmitter<void>;\n\n /**\n * Emitted when an action is clicked inside the header\n */\n @Event()\n private action: EventEmitter<Action>;\n\n @Element()\n private host: HTMLElement;\n\n private bodyId = createRandomString();\n\n public componentDidRender() {\n const button = this.host.shadowRoot.querySelector(\n '.open-close-toggle',\n ) as HTMLElement;\n\n makeEnterClickable(button);\n }\n\n public disconnectedCallback() {\n const button = this.host.shadowRoot.querySelector(\n '.open-close-toggle',\n ) as HTMLElement;\n\n removeEnterClickable(button);\n }\n\n public render() {\n return (\n <section class={`${this.isOpen ? 'open' : ''}`}>\n <header>\n <button\n class=\"open-close-toggle\"\n onClick={this.onClick}\n aria-controls={this.bodyId}\n />\n <div class=\"expand-icon\">\n <div class=\"line\" />\n <div class=\"line\" />\n <div class=\"line\" />\n <div class=\"line\" />\n </div>\n <h2 class=\"title mdc-typography mdc-typography--headline2\">\n {this.header}\n </h2>\n <div class=\"divider-line\" />\n {this.renderActions()}\n </header>\n <div\n class=\"body\"\n aria-hidden={String(!this.isOpen)}\n id={this.bodyId}\n >\n <slot />\n </div>\n </section>\n );\n }\n\n private onClick = () => {\n this.handleInteraction();\n };\n\n private handleInteraction = () => {\n this.isOpen = !this.isOpen;\n\n if (this.isOpen) {\n this.open.emit();\n const waitForUiToRender = 100;\n setTimeout(dispatchResizeEvent, waitForUiToRender);\n } else {\n this.close.emit();\n }\n };\n\n private renderActions = () => {\n if (!this.actions) {\n return;\n }\n\n return (\n <div class=\"actions\">\n {this.actions.map(this.renderActionButton)}\n </div>\n );\n };\n\n private renderActionButton = (action: Action) => {\n return (\n <limel-icon-button\n icon={action.icon}\n label={action.label}\n disabled={action.disabled}\n onClick={this.handleActionClick(action)}\n />\n );\n };\n\n private handleActionClick = (action: Action) => (event: MouseEvent) => {\n event.stopPropagation();\n this.action.emit(action);\n };\n}\n"],"mappings":"4KAAA,MAAMA,EAAwB,mnM,MC6BjBC,EAAkB,M,gHAwCnBC,KAAAC,OAASC,IAkDTF,KAAAG,QAAU,KACdH,KAAKI,mBAAmB,EAGpBJ,KAAAI,kBAAoB,KACxBJ,KAAKK,QAAUL,KAAKK,OAEpB,GAAIL,KAAKK,OAAQ,CACbL,KAAKM,KAAKC,OACV,MAAMC,EAAoB,IAC1BC,WAAWC,EAAqBF,E,KAC7B,CACHR,KAAKW,MAAMJ,M,GAIXP,KAAAY,cAAgB,KACpB,IAAKZ,KAAKa,QAAS,CACf,M,CAGJ,OACIC,EAAA,OAAKC,MAAM,WACNf,KAAKa,QAAQG,IAAIhB,KAAKiB,oBACrB,EAINjB,KAAAiB,mBAAsBC,GAEtBJ,EAAA,qBACIK,KAAMD,EAAOC,KACbC,MAAOF,EAAOE,MACdC,SAAUH,EAAOG,SACjBlB,QAASH,KAAKsB,kBAAkBJ,KAKpClB,KAAAsB,kBAAqBJ,GAAoBK,IAC7CA,EAAMC,kBACNxB,KAAKkB,OAAOX,KAAKW,EAAO,E,YA9HH,M,6CAqClBO,qBACH,MAAMC,EAAS1B,KAAK2B,KAAKC,WAAWC,cAChC,sBAGJC,EAAmBJ,E,CAGhBK,uBACH,MAAML,EAAS1B,KAAK2B,KAAKC,WAAWC,cAChC,sBAGJG,EAAqBN,E,CAGlBO,SACH,OACInB,EAAA,WAASC,MAAO,GAAGf,KAAKK,OAAS,OAAS,MACtCS,EAAA,cACIA,EAAA,UACIC,MAAM,oBACNZ,QAASH,KAAKG,QAAO,gBACNH,KAAKC,SAExBa,EAAA,OAAKC,MAAM,eACPD,EAAA,OAAKC,MAAM,SACXD,EAAA,OAAKC,MAAM,SACXD,EAAA,OAAKC,MAAM,SACXD,EAAA,OAAKC,MAAM,UAEfD,EAAA,MAAIC,MAAM,kDACLf,KAAKkC,QAEVpB,EAAA,OAAKC,MAAM,iBACVf,KAAKY,iBAEVE,EAAA,OACIC,MAAM,OAAM,cACCoB,QAAQnC,KAAKK,QAC1B+B,GAAIpC,KAAKC,QAETa,EAAA,c"}