@mhmo91/schmancy 0.2.61 → 0.2.65

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 (54) hide show
  1. package/dist/card.cjs +1 -1
  2. package/dist/card.js +1 -1
  3. package/dist/content-drawer.cjs +1 -1
  4. package/dist/content-drawer.js +1 -1
  5. package/dist/form-C4cWM0em.cjs +8 -0
  6. package/dist/form-C4cWM0em.cjs.map +1 -0
  7. package/dist/{form-BphauHSv.js → form-k_nFgiSi.js} +11 -11
  8. package/dist/form-k_nFgiSi.js.map +1 -0
  9. package/dist/form.cjs +1 -1
  10. package/dist/form.js +1 -1
  11. package/dist/index.cjs +1 -1
  12. package/dist/index.js +5 -5
  13. package/dist/nav-drawer.cjs +1 -1
  14. package/dist/nav-drawer.js +1 -1
  15. package/dist/select-CENAt67G.cjs +55 -0
  16. package/dist/select-CENAt67G.cjs.map +1 -0
  17. package/dist/{select-D3PjbyfA.js → select-CmNozz2O.js} +45 -36
  18. package/dist/select-CmNozz2O.js.map +1 -0
  19. package/dist/select.cjs +1 -1
  20. package/dist/select.js +1 -1
  21. package/dist/sheet-CpxhwF3c.cjs +41 -0
  22. package/dist/sheet-CpxhwF3c.cjs.map +1 -0
  23. package/dist/{sheet-DqckAHq4.js → sheet-DEnU17L8.js} +6 -2
  24. package/dist/sheet-DEnU17L8.js.map +1 -0
  25. package/dist/sheet.cjs +1 -1
  26. package/dist/sheet.js +1 -1
  27. package/dist/surface-KPpEcbzd.cjs +20 -0
  28. package/dist/surface-KPpEcbzd.cjs.map +1 -0
  29. package/dist/surface-yaUvZzID.js +42 -0
  30. package/dist/surface-yaUvZzID.js.map +1 -0
  31. package/dist/surface.cjs +1 -1
  32. package/dist/surface.js +1 -1
  33. package/dist/teleport.cjs +1 -1
  34. package/dist/{teleport.component-BtFkJ2lv.cjs → teleport.component-Dj5lNIaQ.cjs} +2 -2
  35. package/dist/{teleport.component-BtFkJ2lv.cjs.map → teleport.component-Dj5lNIaQ.cjs.map} +1 -1
  36. package/dist/{teleport.component-C-DCNNPE.js → teleport.component-QBoSpyzC.js} +5 -5
  37. package/dist/{teleport.component-C-DCNNPE.js.map → teleport.component-QBoSpyzC.js.map} +1 -1
  38. package/dist/teleport.js +1 -1
  39. package/package.json +3 -3
  40. package/types/src/select/select.d.ts +14 -1
  41. package/types/src/surface/surface.d.ts +1 -1
  42. package/dist/form-BphauHSv.js.map +0 -1
  43. package/dist/form-C0uDoLE1.cjs +0 -8
  44. package/dist/form-C0uDoLE1.cjs.map +0 -1
  45. package/dist/select-BvlBg33k.cjs +0 -55
  46. package/dist/select-BvlBg33k.cjs.map +0 -1
  47. package/dist/select-D3PjbyfA.js.map +0 -1
  48. package/dist/sheet-Crzdg6fC.cjs +0 -41
  49. package/dist/sheet-Crzdg6fC.cjs.map +0 -1
  50. package/dist/sheet-DqckAHq4.js.map +0 -1
  51. package/dist/surface-Cryxe3jX.js +0 -44
  52. package/dist/surface-Cryxe3jX.js.map +0 -1
  53. package/dist/surface-qITC3jCV.cjs +0 -20
  54. package/dist/surface-qITC3jCV.cjs.map +0 -1
@@ -0,0 +1,41 @@
1
+ "use strict";const s=require("rxjs");require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const w=require("./tailwind.mixin-04vClyRW.cjs"),g=require("lit"),r=require("lit/decorators.js"),E=require("./litElement.mixin-AiJtwDLp.cjs");var S=Object.defineProperty,k=Object.getOwnPropertyDescriptor,b=(t,e,i,o)=>{for(var c,n=o>1?void 0:o?k(e,i):e,l=t.length-1;l>=0;l--)(c=t[l])&&(n=(o?c(e,i,n):c(n))||n);return o&&n&&S(e,i,n),n};let v=class extends w.TailwindElement(){render(){const t={absolute:this.title.length===0,relative:this.title.length>0};return g.html`
2
+ <schmancy-surface fill="width" elevation="1">
3
+ <schmancy-grid class="${this.classMap(t)}" align="center" justify="stretch" cols="auto 1fr auto">
4
+ <slot name="back">
5
+ <schmancy-button
6
+ @click=${()=>{this.dispatchEvent(new CustomEvent("dismiss",{bubbles:!0,composed:!0}))}}
7
+ >
8
+ <span class="text-[24px]">&#8592; </span>
9
+ </schmancy-button>
10
+ </slot>
11
+ <schmancy-typography transform="capitalize" type="headline" token="lg"> ${this.title} </schmancy-typography>
12
+ <slot name="actions">
13
+ <schmancy-icon-button
14
+ @click=${()=>{this.dispatchEvent(new CustomEvent("dismiss",{bubbles:!0,composed:!0}))}}
15
+ >
16
+ close
17
+ </schmancy-icon-button>
18
+ </slot>
19
+ </schmancy-grid>
20
+ </schmancy-surface>
21
+ `}};b([r.property()],v.prototype,"title",2),v=b([r.customElement("schmancy-sheet-header")],v);var f=(t=>(t.Side="side",t.Bottom="bottom",t.BottomCenter="bottom-center",t.TopRight="top-right",t.BottomRight="bottom-right",t))(f||{});const m="are-you-there-sheet",y="yes-here",u=new class{constructor(){this.bottomSheet=new s.Subject,this.$dismiss=new s.Subject,this.bottomSheet.pipe(s.switchMap(t=>s.forkJoin([s.fromEvent(window,y).pipe(s.takeUntil(s.timer(0)),s.map(e=>e.detail.sheet),s.defaultIfEmpty(void 0)),s.of(t).pipe(s.tap(()=>{window.dispatchEvent(new CustomEvent(m,{detail:{uid:t.uid??t.component.tagName}}))}))])),s.map(([t,e])=>{t||(t=document.createElement("schmancy-sheet"),document.body.appendChild(t)),t.setAttribute("uid",e.uid??e.component.tagName);const i=e.position||(window.innerWidth>=768?"side":"bottom");return t.setAttribute("position",i),t.setAttribute("allowOverlyDismiss",e.allowOverlyDismiss===!1?"false":"true"),e.title&&t.setAttribute("title",e.title),e.persist&&t.setAttribute("persist",e.persist??!1),e.header&&t.setAttribute("header",e.header),document.body.style.overflow="hidden",{target:e,sheet:t}}),s.delay(20),s.filter(({target:t,sheet:e})=>{var i,o;return!t.persist||!((o=(i=e==null?void 0:e.shadowRoot)==null?void 0:i.querySelector("slot"))!=null&&o.assignedElements().find(c=>c.tagName===t.component.tagName))||(e==null||e.setAttribute("open","true"),!1)}),s.tap(({target:t,sheet:e})=>{e==null||e.appendChild(t.component)}),s.delay(1),s.tap(({sheet:t})=>{t==null||t.setAttribute("open","true")}),s.tap(({sheet:t})=>{s.fromEvent(t,"close").pipe(s.take(1)).pipe(s.delay(300)).subscribe(e=>{const i=e.target;i!=null&&i.persist||(i==null||i.remove()),document.body.style.overflow="auto"})})).subscribe(),this.$dismiss.pipe(s.mergeMap(t=>s.forkJoin([s.fromEvent(window,y).pipe(s.takeUntil(s.timer(100)),s.map(e=>e.detail.sheet),s.defaultIfEmpty(void 0)),s.of(t).pipe(s.tap(()=>{window.dispatchEvent(new CustomEvent(m,{detail:{uid:t}}))}))])),s.tap(([t])=>{t==null||t.closeSheet()})).subscribe()}dismiss(t){this.$dismiss.next(t)}open(t){this.bottomSheet.next(t)}};var x=Object.defineProperty,C=Object.getOwnPropertyDescriptor,h=(t,e,i,o)=>{for(var c,n=o>1?void 0:o?C(e,i):e,l=t.length-1;l>=0;l--)(c=t[l])&&(n=(o?c(e,i,n):c(n))||n);return o&&n&&x(e,i,n),n};let a=class extends E.$LitElement(":host{--overlay-color: var(--schmancy-sys-color-surface-dim);--transition-duration: .2s;--sheet-radius: 0;--max-height: 100vh}.sheet{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;display:flex;visibility:visible;transition:visibility var(--transition-duration) ease-in-out}.sheet[aria-hidden=true]{visibility:hidden;pointer-events:none}.sheet[aria-hidden=true] .content{transform:translateY(100%)}.sheet[aria-hidden=true] .content[data-position=side]{transform:translate(100%)}.sheet[aria-hidden=true] .overlay{opacity:0}.overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:var(--overlay-color);opacity:.8;transition:opacity var(--transition-duration) ease-in-out}.content{z-index:1;transition:transform var(--transition-duration) ease-in-out;overflow:hidden}.content[data-position=side]{height:100%;min-width:320px;max-width:90vw;width:fit-content;margin-left:auto}.content[data-position=side] schmancy-surface{max-height:100vh}.content[data-position=bottom]{width:100%;margin-top:auto;border-radius:16px 16px 0 0;max-height:100vh}.content[data-position=bottom] schmancy-surface{max-height:90vh}"){constructor(){super(...arguments),this.open=!1,this.header="visible",this.position=f.Side,this.persist=!1,this.allowOverlayDismiss=!0,this.title="",this.focusAttribute="autofocus",this.lastFocusedElement=null,this.handleFocusIn=t=>{var e;(e=this.sheet)!=null&&e.contains(t.target)||this.focus()}}onOpenChange(t,e){var i;e?(this.lastFocusedElement=document.activeElement,this.addFocusTrap(),this.focus()):(this.removeFocusTrap(),(i=this.lastFocusedElement)==null||i.focus(),this.lastFocusedElement=null)}connectedCallback(){super.connectedCallback(),this.setupEventListeners()}disconnectedCallback(){super.disconnectedCallback(),this.disconnecting.next(!0)}setupEventListeners(){const t=s.fromEvent(window,"popstate").pipe(s.tap(o=>{o.preventDefault(),this.closeSheet()})),e=s.fromEvent(window,"keyup").pipe(s.tap(o=>{o.key!=="Escape"||this.sheetContainsFocus()||u.dismiss(this.uid)})),i=s.fromEvent(window,m).pipe(s.tap(o=>{o.detail.uid===this.uid&&this.announcePresence()}));s.merge(t,e,i).pipe(s.takeUntil(this.disconnecting)).subscribe()}sheetContainsFocus(){var t;return((t=this.sheet)==null?void 0:t.contains(document.activeElement))??!1}announcePresence(){this.dispatchEvent(new CustomEvent(y,{detail:{sheet:this},bubbles:!0,composed:!0}))}addFocusTrap(){document.addEventListener("focusin",this.handleFocusIn)}removeFocusTrap(){document.removeEventListener("focusin",this.handleFocusIn)}setIsSheetShown(t){var e,i;(e=this.sheet)==null||e.setAttribute("aria-hidden",String(!t)),(i=this.sheet)==null||i.setAttribute("aria-modal",String(t))}closeSheet(){this.open=!1,this.dispatchEvent(new CustomEvent("close"))}getFocusElement(){const t=`[${this.focusAttribute}]`;return this.assignedElements.find(e=>e.matches(t)||e.querySelector(t))??null}focus(){var t;(t=this.getFocusElement())==null||t.focus()}render(){return g.html`
22
+ <div class="sheet" role="dialog" aria-labelledby="sheet-title" aria-hidden=${!this.open} aria-modal=${this.open}>
23
+ <div
24
+ class="overlay"
25
+ @click=${t=>{t.stopPropagation(),this.allowOverlayDismiss&&u.dismiss(this.uid)}}
26
+ ></div>
27
+ <section class="content w-full" data-position=${this.position}>
28
+ <schmancy-sheet-header
29
+ class="sticky top-0 z-50 w-full"
30
+ @dismiss=${t=>{t.stopPropagation(),u.dismiss(this.uid)}}
31
+ id="sheet-title"
32
+ .hidden=${this.header==="hidden"}
33
+ title=${this.title}
34
+ ></schmancy-sheet-header>
35
+ <schmancy-surface class="overflow-auto" fill="all" type="surface">
36
+ <slot></slot>
37
+ </schmancy-surface>
38
+ </section>
39
+ </div>
40
+ `}};var d,p;h([r.property({type:String,reflect:!0})],a.prototype,"uid",2),h([r.property({type:Boolean,reflect:!0})],a.prototype,"open",2),h([r.property({type:String,reflect:!0})],a.prototype,"header",2),h([r.property({type:String,reflect:!0})],a.prototype,"position",2),h([r.property({type:Boolean,reflect:!0})],a.prototype,"persist",2),h([r.property({type:Boolean,reflect:!0})],a.prototype,"allowOverlayDismiss",2),h([r.property({type:String,reflect:!0})],a.prototype,"title",2),h([r.query(".sheet")],a.prototype,"sheet",2),h([r.queryAssignedElements({flatten:!0})],a.prototype,"assignedElements",2),h([r.property()],a.prototype,"focusAttribute",2),h([(d="open",(t,e)=>{const{willUpdate:i}=t;p=Object.assign({waitUntilFirstUpdate:!1},p),t.willUpdate=function(o){if(i.call(this,o),o.has(d)){const c=o.get(d),n=this[d];c!==n&&(p!=null&&p.waitUntilFirstUpdate&&!this.hasUpdated||this[e].call(this,c,n))}}})],a.prototype,"onOpenChange",1),a=h([r.customElement("schmancy-sheet")],a),exports.SchmancySheetPosition=f,exports.SheetHereMorty=y,exports.SheetWhereAreYouRicky=m,exports.sheet=u;
41
+ //# sourceMappingURL=sheet-CpxhwF3c.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sheet-CpxhwF3c.cjs","sources":["../src/sheet/header.ts","../src/sheet/sheet.service.ts","../src/sheet/sheet.ts","../src/sheet/hook.ts"],"sourcesContent":["import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\n@customElement('schmancy-sheet-header')\nexport default class SchmancySheetHeader extends TailwindElement() {\n\t@property() title: string\n\trender() {\n\t\tconst classes = {\n\t\t\tabsolute: this.title.length === 0,\n\t\t\trelative: this.title.length > 0,\n\t\t}\n\t\treturn html`\n\t\t\t<schmancy-surface fill=\"width\" elevation=\"1\">\n\t\t\t\t<schmancy-grid class=\"${this.classMap(classes)}\" align=\"center\" justify=\"stretch\" cols=\"auto 1fr auto\">\n\t\t\t\t\t<slot name=\"back\">\n\t\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent('dismiss', {\n\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span class=\"text-[24px]\">&#8592; </span>\n\t\t\t\t\t\t</schmancy-button>\n\t\t\t\t\t</slot>\n\t\t\t\t\t<schmancy-typography transform=\"capitalize\" type=\"headline\" token=\"lg\"> ${this.title} </schmancy-typography>\n\t\t\t\t\t<slot name=\"actions\">\n\t\t\t\t\t\t<schmancy-icon-button\n\t\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent('dismiss', {\n\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tclose\n\t\t\t\t\t\t</schmancy-icon-button>\n\t\t\t\t\t</slot>\n\t\t\t\t</schmancy-grid>\n\t\t\t</schmancy-surface>\n\t\t`\n\t}\n}\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet-header': SchmancySheetHeader\n\t}\n}\n","import {\n\tdefaultIfEmpty,\n\tdelay,\n\tfilter,\n\tforkJoin,\n\tfromEvent,\n\tmap,\n\tmergeMap,\n\tof,\n\tSubject,\n\tswitchMap,\n\ttake,\n\ttakeUntil,\n\ttap,\n\ttimer,\n} from 'rxjs'\nimport SchmancySheet from './sheet'\n\nexport enum SchmancySheetPosition {\n\tSide = 'side',\n\tBottom = 'bottom',\n\t/**\n\t * @deprecated use bottom instead\n\t */\n\tBottomCenter = 'bottom-center',\n\t/**\n\t * @deprecated use side instead\n\t */\n\tTopRight = 'top-right',\n\t/**\n\t * @deprecated use side instead\n\t */\n\tBottomRight = 'bottom-right',\n}\n\ntype BottomSheeetTarget = {\n\tcomponent: HTMLElement\n\tuid?: string\n\tposition?: SchmancySheetPosition\n\tpersist?: boolean\n\tclose?: () => void\n\tallowOverlyDismiss?: boolean\n\ttitle?: string\n\theader?: 'hidden' | 'visible'\n}\n\n// Events for communication between bottom-sheet component and bottom-sheet.service\nexport type SheetWhereAreYouRickyEvent = CustomEvent<{\n\tuid: string\n}>\nexport const SheetWhereAreYouRicky = 'are-you-there-sheet'\n\nexport type SheetHereMortyEvent = CustomEvent<{\n\tsheet: SchmancySheet\n}>\nexport const SheetHereMorty = 'yes-here'\n\n// Function to determine the position based on screen size\nconst getPosition = (): SchmancySheetPosition => {\n\treturn window.innerWidth >= 768 ? SchmancySheetPosition.Side : SchmancySheetPosition.Bottom // Adjust 768 as needed for your breakpoint\n}\n\nclass BottomSheetService {\n\tbottomSheet = new Subject<BottomSheeetTarget>()\n\t$dismiss = new Subject<string>()\n\tconstructor() {\n\t\tthis.bottomSheet\n\t\t\t.pipe(\n\t\t\t\tswitchMap(target =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<SheetHereMortyEvent>(window, SheetHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(0)),\n\t\t\t\t\t\t\tmap(e => e.detail.sheet),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(target).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(SheetWhereAreYouRicky, {\n\t\t\t\t\t\t\t\t\t\tdetail: { uid: target.uid ?? target.component.tagName },\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\tmap(([sheet, target]) => {\n\t\t\t\t\tconsole.log(sheet, target)\n\t\t\t\t\tif (!sheet) {\n\t\t\t\t\t\t// if sheet is not found, create it\n\t\t\t\t\t\tsheet = document.createElement('schmancy-sheet')\n\t\t\t\t\t\tdocument.body.appendChild(sheet)\n\t\t\t\t\t}\n\t\t\t\t\tsheet.setAttribute('uid', target.uid ?? target.component.tagName)\n\n\t\t\t\t\t// **Use the dynamic position function here**\n\t\t\t\t\tconst position = target.position || getPosition() // Use target.position if it's set, otherwise determine based on screen size\n\t\t\t\t\tsheet.setAttribute('position', position)\n\n\t\t\t\t\tsheet.setAttribute('allowOverlyDismiss', target.allowOverlyDismiss === false ? 'false' : 'true')\n\t\t\t\t\ttarget.title && sheet.setAttribute('title', target.title)\n\t\t\t\t\ttarget.persist && sheet.setAttribute('persist', target.persist ?? false)\n\t\t\t\t\ttarget.header && sheet.setAttribute('header', target.header)\n\t\t\t\t\tdocument.body.style.overflow = 'hidden' // lock the scroll of the host\n\t\t\t\t\treturn { target, sheet }\n\t\t\t\t}),\n\t\t\t\tdelay(20),\n\t\t\t\tfilter(({ target, sheet }) => {\n\t\t\t\t\t// if the sheet has already the component, just show it\n\t\t\t\t\tif (\n\t\t\t\t\t\ttarget.persist &&\n\t\t\t\t\t\tsheet?.shadowRoot\n\t\t\t\t\t\t\t?.querySelector('slot')\n\t\t\t\t\t\t\t?.assignedElements()\n\t\t\t\t\t\t\t.find(e => e.tagName === target.component.tagName)\n\t\t\t\t\t) {\n\t\t\t\t\t\tsheet?.setAttribute('open', 'true')\n\t\t\t\t\t\treturn false\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn true // if the sheet does not have the component, continue to the next step\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttap(({ target, sheet }) => {\n\t\t\t\t\tsheet?.appendChild(target.component)\n\t\t\t\t}),\n\t\t\t\tdelay(1),\n\t\t\t\ttap(({ sheet }) => {\n\t\t\t\t\tsheet?.setAttribute('open', 'true')\n\t\t\t\t}),\n\t\t\t\ttap(({ sheet }) => {\n\t\t\t\t\tfromEvent<CustomEvent>(sheet, 'close')\n\t\t\t\t\t\t.pipe(take(1))\n\t\t\t\t\t\t.pipe(delay(300))\n\t\t\t\t\t\t.subscribe(e => {\n\t\t\t\t\t\t\tconst target = e.target as SchmancySheet\n\t\t\t\t\t\t\tconsole.log(target)\n\n\t\t\t\t\t\t\tif (!target?.persist) target?.remove()\n\t\t\t\t\t\t\tdocument.body.style.overflow = 'auto' // unlock the scroll of the host\n\t\t\t\t\t\t})\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\n\t\tthis.$dismiss\n\t\t\t.pipe(\n\t\t\t\tmergeMap(uid =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<SheetHereMortyEvent>(window, SheetHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)), // Some people say why 10? I say why not?\n\t\t\t\t\t\t\tmap(e => e.detail.sheet),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(uid).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new CustomEvent(SheetWhereAreYouRicky, { detail: { uid } }))\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\ttap(([sheet]) => {\n\t\t\t\t\tsheet?.closeSheet()\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\tdismiss(uid: string) {\n\t\tthis.$dismiss.next(uid)\n\t}\n\n\topen(target: BottomSheeetTarget) {\n\t\tthis.bottomSheet.next(target)\n\t}\n}\nexport const sheet = new BottomSheetService()\n","import { $LitElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property, query, queryAssignedElements } from 'lit/decorators.js'\nimport { fromEvent, merge, takeUntil, tap } from 'rxjs'\nimport style from './sheet.scss?inline'\nimport {\n\tSchmancySheetPosition,\n\tSheetHereMorty,\n\tSheetWhereAreYouRicky,\n\tSheetWhereAreYouRickyEvent,\n\tsheet,\n} from './sheet.service'\nimport { on } from './hook'\n\n@customElement('schmancy-sheet')\nexport default class SchmancySheet extends $LitElement(style) {\n\t@property({ type: String, reflect: true }) uid!: string\n\t@property({ type: Boolean, reflect: true }) open = false\n\t@property({ type: String, reflect: true }) header: 'hidden' | 'visible' = 'visible'\n\t@property({ type: String, reflect: true }) position: SchmancySheetPosition = SchmancySheetPosition.Side\n\t@property({ type: Boolean, reflect: true }) persist = false\n\t@property({ type: Boolean, reflect: true }) allowOverlayDismiss = true\n\t@property({ type: String, reflect: true }) title = ''\n\n\t@query('.sheet') private sheet!: HTMLElement\n\t@queryAssignedElements({ flatten: true }) private assignedElements!: HTMLElement[]\n\n\t@property() focusAttribute = 'autofocus'\n\tprivate lastFocusedElement: HTMLElement | null = null\n\n\t@on('open')\n\tonOpenChange(_oldValue: boolean, newValue: boolean) {\n\t\tif (newValue) {\n\t\t\tthis.lastFocusedElement = document.activeElement as HTMLElement\n\t\t\tthis.addFocusTrap()\n\t\t\tthis.focus()\n\t\t} else {\n\t\t\tthis.removeFocusTrap()\n\t\t\tthis.lastFocusedElement?.focus()\n\t\t\tthis.lastFocusedElement = null\n\t\t}\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tthis.setupEventListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.disconnecting.next(true)\n\t}\n\n\tprivate setupEventListeners() {\n\t\t// Handle browser back button\n\t\tconst popState$ = fromEvent<PopStateEvent>(window, 'popstate').pipe(\n\t\t\ttap(e => {\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.closeSheet()\n\t\t\t}),\n\t\t)\n\n\t\t// Handle ESC key\n\t\tconst keyUp$ = fromEvent<KeyboardEvent>(window, 'keyup').pipe(\n\t\t\ttap(event => {\n\t\t\t\tif (event.key === 'Escape' && !this.sheetContainsFocus()) {\n\t\t\t\t\tsheet.dismiss(this.uid)\n\t\t\t\t}\n\t\t\t}),\n\t\t)\n\n\t\t// Handle inter-component communication\n\t\tconst rickyComm$ = fromEvent<SheetWhereAreYouRickyEvent>(window, SheetWhereAreYouRicky).pipe(\n\t\t\ttap(e => {\n\t\t\t\tif (e.detail.uid === this.uid) this.announcePresence()\n\t\t\t}),\n\t\t)\n\n\t\tmerge(popState$, keyUp$, rickyComm$).pipe(takeUntil(this.disconnecting)).subscribe()\n\t}\n\n\tprivate sheetContainsFocus(): boolean {\n\t\treturn this.sheet?.contains(document.activeElement) ?? false\n\t}\n\n\tprivate announcePresence() {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(SheetHereMorty, {\n\t\t\t\tdetail: { sheet: this },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\tprivate addFocusTrap() {\n\t\tdocument.addEventListener('focusin', this.handleFocusIn)\n\t}\n\n\tprivate removeFocusTrap() {\n\t\tdocument.removeEventListener('focusin', this.handleFocusIn)\n\t}\n\n\tprivate handleFocusIn = (e: Event) => {\n\t\tif (!this.sheet?.contains(e.target as Node)) {\n\t\t\tthis.focus()\n\t\t}\n\t}\n\n\tsetIsSheetShown(isShown: boolean) {\n\t\tthis.sheet?.setAttribute('aria-hidden', String(!isShown))\n\t\tthis.sheet?.setAttribute('aria-modal', String(isShown))\n\t}\n\n\tcloseSheet() {\n\t\tthis.open = false\n\t\tthis.dispatchEvent(new CustomEvent('close'))\n\t}\n\n\tprivate getFocusElement(): HTMLElement | null {\n\t\tconst selector = `[${this.focusAttribute}]`\n\t\treturn (this.assignedElements.find(el => el.matches(selector) || el.querySelector(selector)) as HTMLElement) ?? null\n\t}\n\n\toverride focus() {\n\t\tthis.getFocusElement()?.focus()\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<div class=\"sheet\" role=\"dialog\" aria-labelledby=\"sheet-title\" aria-hidden=${!this.open} aria-modal=${this.open}>\n\t\t\t\t<div\n\t\t\t\t\tclass=\"overlay\"\n\t\t\t\t\t@click=${(e: Event) => {\n\t\t\t\t\t\te.stopPropagation()\n\t\t\t\t\t\tif (this.allowOverlayDismiss) sheet.dismiss(this.uid)\n\t\t\t\t\t}}\n\t\t\t\t></div>\n\t\t\t\t<section class=\"content w-full\" data-position=${this.position}>\n\t\t\t\t\t<schmancy-sheet-header\n\t\t\t\t\t\tclass=\"sticky top-0 z-50 w-full\"\n\t\t\t\t\t\t@dismiss=${(e: CustomEvent) => {\n\t\t\t\t\t\t\te.stopPropagation()\n\t\t\t\t\t\t\tsheet.dismiss(this.uid)\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tid=\"sheet-title\"\n\t\t\t\t\t\t.hidden=${this.header === 'hidden'}\n\t\t\t\t\t\ttitle=${this.title}\n\t\t\t\t\t></schmancy-sheet-header>\n\t\t\t\t\t<schmancy-surface class=\"overflow-auto\" fill=\"all\" type=\"surface\">\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t</schmancy-surface>\n\t\t\t\t</section>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet': SchmancySheet\n\t}\n}\n","// @watch decorator\n//\n// Runs when an observed property changes, e.g. @property or @state, but before the component updates.\n//\n// To wait for an update to complete after a change occurs, use `await this.updateComplete` in the handler. To start\n// watching after the initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.\n//\n// Usage:\n//\n// @watch('propName')\n// handlePropChange(oldValue, newValue) {\n// ...\n// }\n//\ninterface WatchOptions {\n\twaitUntilFirstUpdate?: boolean\n}\n\nexport function on(propName: string, options?: WatchOptions) {\n\treturn (protoOrDescriptor: any, name: string): any => {\n\t\tconst { willUpdate } = protoOrDescriptor\n\n\t\toptions = Object.assign({ waitUntilFirstUpdate: false }, options) as WatchOptions\n\n\t\tprotoOrDescriptor.willUpdate = function (changedProps: Map<string, any>) {\n\t\t\twillUpdate.call(this, changedProps)\n\n\t\t\tif (changedProps.has(propName)) {\n\t\t\t\tconst oldValue = changedProps.get(propName)\n\t\t\t\tconst newValue = this[propName]\n\n\t\t\t\tif (oldValue !== newValue) {\n\t\t\t\t\tif (!options?.waitUntilFirstUpdate || this.hasUpdated) {\n\t\t\t\t\t\tthis[name].call(this, oldValue, newValue)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":["SchmancySheetHeader","TailwindElement","classes","absolute","this","title","length","relative","html","classMap","dispatchEvent","CustomEvent","bubbles","composed","__decorateClass","property","prototype","customElement","SchmancySheetPosition","SheetWhereAreYouRicky","SheetHereMorty","sheet","constructor","bottomSheet","Subject","$dismiss","pipe","switchMap","forkJoin","fromEvent","window","takeUntil","timer","map","e","detail","defaultIfEmpty","of","target","tap","uid","component","tagName","document","createElement","body","appendChild","setAttribute","position","innerWidth","allowOverlyDismiss","persist","header","style","overflow","delay","filter","shadowRoot","querySelector","assignedElements","find","take","subscribe","remove","mergeMap","closeSheet","next","SchmancySheet","$LitElement","super","arguments","open","Side","allowOverlayDismiss","focusAttribute","lastFocusedElement","handleFocusIn","contains","focus","_oldValue","newValue","activeElement","addFocusTrap","removeFocusTrap","connectedCallback","setupEventListeners","disconnectedCallback","disconnecting","popState$","preventDefault","keyUp$","event","key","sheetContainsFocus","dismiss","rickyComm$","announcePresence","merge","addEventListener","removeEventListener","isShown","String","selector","el","matches","getFocusElement","stopPropagation","propName","options","type","reflect","Boolean","query","queryAssignedElements","flatten","protoOrDescriptor","name","willUpdate","Object","assign","waitUntilFirstUpdate","changedProps","call","has","oldValue","get","hasUpdated"],"mappings":"icAKA,IAAqBA,EAArB,cAAiDC,EAAAA,gBAAAA,CAAAA,CAEhD,QACC,CAAA,MAAMC,EAAU,CACfC,SAAUC,KAAKC,MAAMC,SAAW,EAChCC,SAAUH,KAAKC,MAAMC,OAAS,CAAA,EAExB,OAAAE,EAAAA;AAAAA;AAAAA,4BAEmBJ,KAAKK,SAASP,CAAAA,CAAAA;AAAAA;AAAAA;AAAAA,gBAG1B,IACHE,CAAAA,KAAAM,cACJ,IAAIC,YAAY,UAAW,CAC1BC,QAAAA,GACAC,SAAAA,EAEF,CAAA,CAAA,CAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+EAMuET,KAAKC,KAAAA;AAAAA;AAAAA;AAAAA,gBAGpE,IACHD,CAAAA,KAAAM,cACJ,IAAIC,YAAY,UAAW,CAC1BC,QAAAA,GACAC,SAAAA,EAEF,CAAA,CAAA,CAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GACA,CAAA,EAjCKC,EAAA,CAAXC,EAASA,SADUf,CAAAA,EAAAA,EACRgB,UAAA,QAAA,CAAA,EADQhB,EAArBc,EAAA,CADCG,EAAAA,cAAc,uBACMjB,CAAAA,EAAAA,CAAAA,ECaT,IAAAkB,GAAAA,IACXA,EAAO,KAAA,OACPA,EAAS,OAAA,SAITA,EAAe,aAAA,gBAIfA,EAAW,SAAA,YAIXA,EAAc,YAAA,eAdHA,IAAAA,GAAA,CAAA,CAgCL,EAAA,MAAMC,EAAwB,sBAKxBC,EAAiB,WAwHjBC,EAAQ,IAjHrB,KAAA,CAGC,aAAAC,CAFAlB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,MAAM,WATa7C,EASKnD,UAAA,QAAA,CACyBF,EAAAA,EAAA,CAAjDmG,wBAAsB,CAAEC,QAAS,EAAA,CAAA,CAAA,EAVd/C,EAU8BnD,UAAA,mBAAA,GAEtCF,EAAA,CAAXC,EAASA,SAZUoD,CAAAA,EAAAA,EAYRnD,UAAA,iBAAA,CAIZF,EAAAA,EAAA,ECbkB6F,EDYd,OCXG,CAACQ,EAAwBC,IAAAA,CACzB,MAAAC,WAAEA,CAAAA,EAAeF,EAEvBP,EAAUU,OAAOC,OAAO,CAAEC,qBAAAA,IAA+BZ,CAEvCO,EAAAA,EAAAE,WAAa,SAAUI,EAAAA,CAGpC,GAFOJ,EAAAK,KAAKtH,KAAMqH,GAElBA,EAAaE,IAAIhB,GAAW,CACzB,MAAAiB,EAAWH,EAAaI,IAAIlB,GAC5B3B,EAAW5E,KAAKuG,GAElBiB,IAAa5C,IACX4B,GAAAA,MAAAA,EAASY,sBAAwBpH,CAAAA,KAAK0H,YAC1C1H,KAAKgH,CAAAA,EAAMM,KAAKtH,KAAMwH,EAAU5C,CAAAA,EAElC,CAEF,CAAA,EAAA,EDtBmBb,EAgBpBnD,UAAA,eAAA,GAhBoBmD,EAArBrD,EAAA,CADCG,EAAAA,cAAc,gBAAA,CAAA,EACMkD"}
@@ -45,7 +45,11 @@ const g = "are-you-there-sheet", w = "yes-here", v = new class {
45
45
  constructor() {
46
46
  this.bottomSheet = new E(), this.$dismiss = new E(), this.bottomSheet.pipe(D((t) => x([d(window, w).pipe(f(S(0)), m((e) => e.detail.sheet), C(void 0)), F(t).pipe(h(() => {
47
47
  window.dispatchEvent(new CustomEvent(g, { detail: { uid: t.uid ?? t.component.tagName } }));
48
- }))])), m(([t, e]) => (t || (t = document.createElement("schmancy-sheet"), document.body.appendChild(t)), t.setAttribute("uid", e.uid ?? e.component.tagName), t.setAttribute("position", e.position ?? "bottom"), t.setAttribute("allowOverlyDismiss", e.allowOverlyDismiss === !1 ? "false" : "true"), e.title && t.setAttribute("title", e.title), e.persist && t.setAttribute("persist", e.persist ?? !1), e.header && t.setAttribute("header", e.header), document.body.style.overflow = "hidden", { target: e, sheet: t })), y(20), U(({ target: t, sheet: e }) => {
48
+ }))])), m(([t, e]) => {
49
+ t || (t = document.createElement("schmancy-sheet"), document.body.appendChild(t)), t.setAttribute("uid", e.uid ?? e.component.tagName);
50
+ const s = e.position || (window.innerWidth >= 768 ? "side" : "bottom");
51
+ return t.setAttribute("position", s), t.setAttribute("allowOverlyDismiss", e.allowOverlyDismiss === !1 ? "false" : "true"), e.title && t.setAttribute("title", e.title), e.persist && t.setAttribute("persist", e.persist ?? !1), e.header && t.setAttribute("header", e.header), document.body.style.overflow = "hidden", { target: e, sheet: t };
52
+ }), y(20), U(({ target: t, sheet: e }) => {
49
53
  var s, i;
50
54
  return !t.persist || !((i = (s = e == null ? void 0 : e.shadowRoot) == null ? void 0 : s.querySelector("slot")) != null && i.assignedElements().find((a) => a.tagName === t.component.tagName)) || (e == null || e.setAttribute("open", "true"), !1);
51
55
  }), h(({ target: t, sheet: e }) => {
@@ -172,4 +176,4 @@ export {
172
176
  w as b,
173
177
  v as s
174
178
  };
175
- //# sourceMappingURL=sheet-DqckAHq4.js.map
179
+ //# sourceMappingURL=sheet-DEnU17L8.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sheet-DEnU17L8.js","sources":["../src/sheet/header.ts","../src/sheet/sheet.service.ts","../src/sheet/sheet.ts","../src/sheet/hook.ts"],"sourcesContent":["import { TailwindElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\n@customElement('schmancy-sheet-header')\nexport default class SchmancySheetHeader extends TailwindElement() {\n\t@property() title: string\n\trender() {\n\t\tconst classes = {\n\t\t\tabsolute: this.title.length === 0,\n\t\t\trelative: this.title.length > 0,\n\t\t}\n\t\treturn html`\n\t\t\t<schmancy-surface fill=\"width\" elevation=\"1\">\n\t\t\t\t<schmancy-grid class=\"${this.classMap(classes)}\" align=\"center\" justify=\"stretch\" cols=\"auto 1fr auto\">\n\t\t\t\t\t<slot name=\"back\">\n\t\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent('dismiss', {\n\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span class=\"text-[24px]\">&#8592; </span>\n\t\t\t\t\t\t</schmancy-button>\n\t\t\t\t\t</slot>\n\t\t\t\t\t<schmancy-typography transform=\"capitalize\" type=\"headline\" token=\"lg\"> ${this.title} </schmancy-typography>\n\t\t\t\t\t<slot name=\"actions\">\n\t\t\t\t\t\t<schmancy-icon-button\n\t\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent('dismiss', {\n\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tclose\n\t\t\t\t\t\t</schmancy-icon-button>\n\t\t\t\t\t</slot>\n\t\t\t\t</schmancy-grid>\n\t\t\t</schmancy-surface>\n\t\t`\n\t}\n}\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet-header': SchmancySheetHeader\n\t}\n}\n","import {\n\tdefaultIfEmpty,\n\tdelay,\n\tfilter,\n\tforkJoin,\n\tfromEvent,\n\tmap,\n\tmergeMap,\n\tof,\n\tSubject,\n\tswitchMap,\n\ttake,\n\ttakeUntil,\n\ttap,\n\ttimer,\n} from 'rxjs'\nimport SchmancySheet from './sheet'\n\nexport enum SchmancySheetPosition {\n\tSide = 'side',\n\tBottom = 'bottom',\n\t/**\n\t * @deprecated use bottom instead\n\t */\n\tBottomCenter = 'bottom-center',\n\t/**\n\t * @deprecated use side instead\n\t */\n\tTopRight = 'top-right',\n\t/**\n\t * @deprecated use side instead\n\t */\n\tBottomRight = 'bottom-right',\n}\n\ntype BottomSheeetTarget = {\n\tcomponent: HTMLElement\n\tuid?: string\n\tposition?: SchmancySheetPosition\n\tpersist?: boolean\n\tclose?: () => void\n\tallowOverlyDismiss?: boolean\n\ttitle?: string\n\theader?: 'hidden' | 'visible'\n}\n\n// Events for communication between bottom-sheet component and bottom-sheet.service\nexport type SheetWhereAreYouRickyEvent = CustomEvent<{\n\tuid: string\n}>\nexport const SheetWhereAreYouRicky = 'are-you-there-sheet'\n\nexport type SheetHereMortyEvent = CustomEvent<{\n\tsheet: SchmancySheet\n}>\nexport const SheetHereMorty = 'yes-here'\n\n// Function to determine the position based on screen size\nconst getPosition = (): SchmancySheetPosition => {\n\treturn window.innerWidth >= 768 ? SchmancySheetPosition.Side : SchmancySheetPosition.Bottom // Adjust 768 as needed for your breakpoint\n}\n\nclass BottomSheetService {\n\tbottomSheet = new Subject<BottomSheeetTarget>()\n\t$dismiss = new Subject<string>()\n\tconstructor() {\n\t\tthis.bottomSheet\n\t\t\t.pipe(\n\t\t\t\tswitchMap(target =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<SheetHereMortyEvent>(window, SheetHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(0)),\n\t\t\t\t\t\t\tmap(e => e.detail.sheet),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(target).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(SheetWhereAreYouRicky, {\n\t\t\t\t\t\t\t\t\t\tdetail: { uid: target.uid ?? target.component.tagName },\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\tmap(([sheet, target]) => {\n\t\t\t\t\tconsole.log(sheet, target)\n\t\t\t\t\tif (!sheet) {\n\t\t\t\t\t\t// if sheet is not found, create it\n\t\t\t\t\t\tsheet = document.createElement('schmancy-sheet')\n\t\t\t\t\t\tdocument.body.appendChild(sheet)\n\t\t\t\t\t}\n\t\t\t\t\tsheet.setAttribute('uid', target.uid ?? target.component.tagName)\n\n\t\t\t\t\t// **Use the dynamic position function here**\n\t\t\t\t\tconst position = target.position || getPosition() // Use target.position if it's set, otherwise determine based on screen size\n\t\t\t\t\tsheet.setAttribute('position', position)\n\n\t\t\t\t\tsheet.setAttribute('allowOverlyDismiss', target.allowOverlyDismiss === false ? 'false' : 'true')\n\t\t\t\t\ttarget.title && sheet.setAttribute('title', target.title)\n\t\t\t\t\ttarget.persist && sheet.setAttribute('persist', target.persist ?? false)\n\t\t\t\t\ttarget.header && sheet.setAttribute('header', target.header)\n\t\t\t\t\tdocument.body.style.overflow = 'hidden' // lock the scroll of the host\n\t\t\t\t\treturn { target, sheet }\n\t\t\t\t}),\n\t\t\t\tdelay(20),\n\t\t\t\tfilter(({ target, sheet }) => {\n\t\t\t\t\t// if the sheet has already the component, just show it\n\t\t\t\t\tif (\n\t\t\t\t\t\ttarget.persist &&\n\t\t\t\t\t\tsheet?.shadowRoot\n\t\t\t\t\t\t\t?.querySelector('slot')\n\t\t\t\t\t\t\t?.assignedElements()\n\t\t\t\t\t\t\t.find(e => e.tagName === target.component.tagName)\n\t\t\t\t\t) {\n\t\t\t\t\t\tsheet?.setAttribute('open', 'true')\n\t\t\t\t\t\treturn false\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn true // if the sheet does not have the component, continue to the next step\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttap(({ target, sheet }) => {\n\t\t\t\t\tsheet?.appendChild(target.component)\n\t\t\t\t}),\n\t\t\t\tdelay(1),\n\t\t\t\ttap(({ sheet }) => {\n\t\t\t\t\tsheet?.setAttribute('open', 'true')\n\t\t\t\t}),\n\t\t\t\ttap(({ sheet }) => {\n\t\t\t\t\tfromEvent<CustomEvent>(sheet, 'close')\n\t\t\t\t\t\t.pipe(take(1))\n\t\t\t\t\t\t.pipe(delay(300))\n\t\t\t\t\t\t.subscribe(e => {\n\t\t\t\t\t\t\tconst target = e.target as SchmancySheet\n\t\t\t\t\t\t\tconsole.log(target)\n\n\t\t\t\t\t\t\tif (!target?.persist) target?.remove()\n\t\t\t\t\t\t\tdocument.body.style.overflow = 'auto' // unlock the scroll of the host\n\t\t\t\t\t\t})\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\n\t\tthis.$dismiss\n\t\t\t.pipe(\n\t\t\t\tmergeMap(uid =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<SheetHereMortyEvent>(window, SheetHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)), // Some people say why 10? I say why not?\n\t\t\t\t\t\t\tmap(e => e.detail.sheet),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(uid).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(new CustomEvent(SheetWhereAreYouRicky, { detail: { uid } }))\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\ttap(([sheet]) => {\n\t\t\t\t\tsheet?.closeSheet()\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\tdismiss(uid: string) {\n\t\tthis.$dismiss.next(uid)\n\t}\n\n\topen(target: BottomSheeetTarget) {\n\t\tthis.bottomSheet.next(target)\n\t}\n}\nexport const sheet = new BottomSheetService()\n","import { $LitElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, property, query, queryAssignedElements } from 'lit/decorators.js'\nimport { fromEvent, merge, takeUntil, tap } from 'rxjs'\nimport style from './sheet.scss?inline'\nimport {\n\tSchmancySheetPosition,\n\tSheetHereMorty,\n\tSheetWhereAreYouRicky,\n\tSheetWhereAreYouRickyEvent,\n\tsheet,\n} from './sheet.service'\nimport { on } from './hook'\n\n@customElement('schmancy-sheet')\nexport default class SchmancySheet extends $LitElement(style) {\n\t@property({ type: String, reflect: true }) uid!: string\n\t@property({ type: Boolean, reflect: true }) open = false\n\t@property({ type: String, reflect: true }) header: 'hidden' | 'visible' = 'visible'\n\t@property({ type: String, reflect: true }) position: SchmancySheetPosition = SchmancySheetPosition.Side\n\t@property({ type: Boolean, reflect: true }) persist = false\n\t@property({ type: Boolean, reflect: true }) allowOverlayDismiss = true\n\t@property({ type: String, reflect: true }) title = ''\n\n\t@query('.sheet') private sheet!: HTMLElement\n\t@queryAssignedElements({ flatten: true }) private assignedElements!: HTMLElement[]\n\n\t@property() focusAttribute = 'autofocus'\n\tprivate lastFocusedElement: HTMLElement | null = null\n\n\t@on('open')\n\tonOpenChange(_oldValue: boolean, newValue: boolean) {\n\t\tif (newValue) {\n\t\t\tthis.lastFocusedElement = document.activeElement as HTMLElement\n\t\t\tthis.addFocusTrap()\n\t\t\tthis.focus()\n\t\t} else {\n\t\t\tthis.removeFocusTrap()\n\t\t\tthis.lastFocusedElement?.focus()\n\t\t\tthis.lastFocusedElement = null\n\t\t}\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tthis.setupEventListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.disconnecting.next(true)\n\t}\n\n\tprivate setupEventListeners() {\n\t\t// Handle browser back button\n\t\tconst popState$ = fromEvent<PopStateEvent>(window, 'popstate').pipe(\n\t\t\ttap(e => {\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.closeSheet()\n\t\t\t}),\n\t\t)\n\n\t\t// Handle ESC key\n\t\tconst keyUp$ = fromEvent<KeyboardEvent>(window, 'keyup').pipe(\n\t\t\ttap(event => {\n\t\t\t\tif (event.key === 'Escape' && !this.sheetContainsFocus()) {\n\t\t\t\t\tsheet.dismiss(this.uid)\n\t\t\t\t}\n\t\t\t}),\n\t\t)\n\n\t\t// Handle inter-component communication\n\t\tconst rickyComm$ = fromEvent<SheetWhereAreYouRickyEvent>(window, SheetWhereAreYouRicky).pipe(\n\t\t\ttap(e => {\n\t\t\t\tif (e.detail.uid === this.uid) this.announcePresence()\n\t\t\t}),\n\t\t)\n\n\t\tmerge(popState$, keyUp$, rickyComm$).pipe(takeUntil(this.disconnecting)).subscribe()\n\t}\n\n\tprivate sheetContainsFocus(): boolean {\n\t\treturn this.sheet?.contains(document.activeElement) ?? false\n\t}\n\n\tprivate announcePresence() {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent(SheetHereMorty, {\n\t\t\t\tdetail: { sheet: this },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\tprivate addFocusTrap() {\n\t\tdocument.addEventListener('focusin', this.handleFocusIn)\n\t}\n\n\tprivate removeFocusTrap() {\n\t\tdocument.removeEventListener('focusin', this.handleFocusIn)\n\t}\n\n\tprivate handleFocusIn = (e: Event) => {\n\t\tif (!this.sheet?.contains(e.target as Node)) {\n\t\t\tthis.focus()\n\t\t}\n\t}\n\n\tsetIsSheetShown(isShown: boolean) {\n\t\tthis.sheet?.setAttribute('aria-hidden', String(!isShown))\n\t\tthis.sheet?.setAttribute('aria-modal', String(isShown))\n\t}\n\n\tcloseSheet() {\n\t\tthis.open = false\n\t\tthis.dispatchEvent(new CustomEvent('close'))\n\t}\n\n\tprivate getFocusElement(): HTMLElement | null {\n\t\tconst selector = `[${this.focusAttribute}]`\n\t\treturn (this.assignedElements.find(el => el.matches(selector) || el.querySelector(selector)) as HTMLElement) ?? null\n\t}\n\n\toverride focus() {\n\t\tthis.getFocusElement()?.focus()\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<div class=\"sheet\" role=\"dialog\" aria-labelledby=\"sheet-title\" aria-hidden=${!this.open} aria-modal=${this.open}>\n\t\t\t\t<div\n\t\t\t\t\tclass=\"overlay\"\n\t\t\t\t\t@click=${(e: Event) => {\n\t\t\t\t\t\te.stopPropagation()\n\t\t\t\t\t\tif (this.allowOverlayDismiss) sheet.dismiss(this.uid)\n\t\t\t\t\t}}\n\t\t\t\t></div>\n\t\t\t\t<section class=\"content w-full\" data-position=${this.position}>\n\t\t\t\t\t<schmancy-sheet-header\n\t\t\t\t\t\tclass=\"sticky top-0 z-50 w-full\"\n\t\t\t\t\t\t@dismiss=${(e: CustomEvent) => {\n\t\t\t\t\t\t\te.stopPropagation()\n\t\t\t\t\t\t\tsheet.dismiss(this.uid)\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tid=\"sheet-title\"\n\t\t\t\t\t\t.hidden=${this.header === 'hidden'}\n\t\t\t\t\t\ttitle=${this.title}\n\t\t\t\t\t></schmancy-sheet-header>\n\t\t\t\t\t<schmancy-surface class=\"overflow-auto\" fill=\"all\" type=\"surface\">\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t</schmancy-surface>\n\t\t\t\t</section>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet': SchmancySheet\n\t}\n}\n","// @watch decorator\n//\n// Runs when an observed property changes, e.g. @property or @state, but before the component updates.\n//\n// To wait for an update to complete after a change occurs, use `await this.updateComplete` in the handler. To start\n// watching after the initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.\n//\n// Usage:\n//\n// @watch('propName')\n// handlePropChange(oldValue, newValue) {\n// ...\n// }\n//\ninterface WatchOptions {\n\twaitUntilFirstUpdate?: boolean\n}\n\nexport function on(propName: string, options?: WatchOptions) {\n\treturn (protoOrDescriptor: any, name: string): any => {\n\t\tconst { willUpdate } = protoOrDescriptor\n\n\t\toptions = Object.assign({ waitUntilFirstUpdate: false }, options) as WatchOptions\n\n\t\tprotoOrDescriptor.willUpdate = function (changedProps: Map<string, any>) {\n\t\t\twillUpdate.call(this, changedProps)\n\n\t\t\tif (changedProps.has(propName)) {\n\t\t\t\tconst oldValue = changedProps.get(propName)\n\t\t\t\tconst newValue = this[propName]\n\n\t\t\t\tif (oldValue !== newValue) {\n\t\t\t\t\tif (!options?.waitUntilFirstUpdate || this.hasUpdated) {\n\t\t\t\t\t\tthis[name].call(this, oldValue, newValue)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":["SchmancySheetHeader","TailwindElement","render","classes","absolute","this","title","length","relative","html","classMap","dispatchEvent","CustomEvent","bubbles","composed","__decorateClass","property","prototype","customElement","SchmancySheetPosition","SheetWhereAreYouRicky","SheetHereMorty","sheet","bottomSheet","Subject","$dismiss","pipe","switchMap","forkJoin","fromEvent","window","takeUntil","timer","map","e","detail","defaultIfEmpty","undefined","of","target","tap","uid","component","tagName","document","createElement","body","appendChild","setAttribute","position","innerWidth","allowOverlyDismiss","persist","header","style","overflow","delay","filter","shadowRoot","querySelector","assignedElements","find","take","subscribe","remove","mergeMap","closeSheet","next","SchmancySheet","$LitElement","super","arguments","open","Side","allowOverlayDismiss","focusAttribute","lastFocusedElement","handleFocusIn","contains","focus","_oldValue","newValue","activeElement","addFocusTrap","removeFocusTrap","connectedCallback","setupEventListeners","disconnectedCallback","disconnecting","popState$","preventDefault","keyUp$","event","key","sheetContainsFocus","dismiss","rickyComm$","announcePresence","merge","addEventListener","removeEventListener","isShown","String","getFocusElement","selector","el","matches","stopPropagation","propName","options","type","reflect","Boolean","query","queryAssignedElements","flatten","protoOrDescriptor","name","willUpdate","Object","assign","waitUntilFirstUpdate","changedProps","call","has","oldValue","get","hasUpdated"],"mappings":";;;;;;;;;;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,IACyBF,EAAA,CAAjDmG,EAAsB,EAAEC,SAAAA,GAVL/C,CAAAA,CAAAA,GAAAA,EAU8BnD,WAAA,oBAAA,CAAA,GAEtCF,EAAA,CAAXC,EAAAA,CAAAA,GAZmBoD,EAYRnD,WAAA,kBAAA,CAIZF,GAAAA,EAAA,ECbkB6F,IDYd,QCXG,CAACQ,GAAwBC,MAAAA;AACzB,UAAAC,YAAEA,EAAAA,IAAeF;AAEvBP,EAAAA,IAAUU,OAAOC,OAAO,EAAEC,sBAAAA,MAA+BZ,CAEvCO,GAAAA,EAAAE,aAAa,SAAUI,GAAAA;AAGpC,QAFOJ,EAAAK,KAAKtH,MAAMqH,CAAAA,GAElBA,EAAaE,IAAIhB,CAAAA,GAAW;AACzB,YAAAiB,IAAWH,EAAaI,IAAIlB,CAAAA,GAC5B3B,IAAW5E,KAAKuG,CAAAA;AAElBiB,MAAAA,MAAa5C,MACX4B,KAAAA,QAAAA,EAASY,yBAAwBpH,KAAK0H,cAC1C1H,KAAKgH,CAAAA,EAAMM,KAAKtH,MAAMwH,GAAU5C;IAElC;AAAA,EAEF;AAAA,KDtBmBb,EAgBpBnD,WAAA,gBAAA,CAhBoBmD,GAAAA,IAArBrD,EAAA,CADCG,EAAc,oBACMkD;"}
package/dist/sheet.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./sheet-Crzdg6fC.cjs");exports.SchmancySheetPosition=e.SchmancySheetPosition,exports.SheetHereMorty=e.SheetHereMorty,exports.SheetWhereAreYouRicky=e.SheetWhereAreYouRicky,exports.sheet=e.sheet;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./sheet-CpxhwF3c.cjs");exports.SchmancySheetPosition=e.SchmancySheetPosition,exports.SheetHereMorty=e.SheetHereMorty,exports.SheetWhereAreYouRicky=e.SheetWhereAreYouRicky,exports.sheet=e.sheet;
2
2
  //# sourceMappingURL=sheet.cjs.map
package/dist/sheet.js CHANGED
@@ -1,4 +1,4 @@
1
- import { S as t, b as a, a as h, s as o } from "./sheet-DqckAHq4.js";
1
+ import { S as t, b as a, a as h, s as o } from "./sheet-DEnU17L8.js";
2
2
  export {
3
3
  t as SchmancySheetPosition,
4
4
  a as SheetHereMorty,
@@ -0,0 +1,20 @@
1
+ "use strict";const l=require("./provide-_VUNOf1R.cjs"),u=require("./tailwind.mixin-04vClyRW.cjs"),a=require("lit"),t=require("lit/decorators.js"),p=require("lit/directives/class-map.js"),d=require("./context-BATZj31H.cjs");var f=Object.defineProperty,y=Object.getOwnPropertyDescriptor,r=(i,s,n,o)=>{for(var h,e=o>1?void 0:o?y(s,n):s,c=i.length-1;c>=0;c--)(h=i[c])&&(e=(o?h(s,n,e):h(e))||e);return o&&e&&f(s,n,e),e};exports.SchmancySurface=class extends u.TailwindElement(a.css`
2
+ :host([fill='all']) {
3
+ height: 100%;
4
+ width: 100%;
5
+ }
6
+ :host([fill='width']) {
7
+ width: 100%;
8
+ }
9
+ :host([fill='height']) {
10
+ height: 100%;
11
+ }
12
+ :host {
13
+ display: block;
14
+ }
15
+ `){constructor(){super(...arguments),this.fill="auto",this.rounded="none",this.type="surface",this.elevation=0}render(){const i={relative:!0,"inset-0":!0,block:!0,"box-border":!0,"rounded-none":this.rounded==="none","rounded-t-[8px]":this.rounded==="top","rounded-l-[8px]":this.rounded==="left","rounded-r-[8px]":this.rounded==="right","rounded-b-[8px]":this.rounded==="bottom","rounded-[8px]":this.rounded==="all","w-full":this.fill==="width"||this.fill==="all","h-full":this.fill==="height"||this.fill==="all","shadow-xs":this.elevation===1,"shadow-sm":this.elevation===2,"shadow-md":this.elevation===3,"shadow-lg":this.elevation===4,"text-surface-on":this.type==="surface"||this.type==="surfaceDim"||this.type==="surfaceBright"||this.type==="containerLowest"||this.type==="containerLow"||this.type==="container"||this.type==="containerHigh"||this.type==="containerHighest","bg-surface-default":this.type==="surface","bg-surface-dim":this.type==="surfaceDim","bg-surface-bright":this.type==="surfaceBright","bg-surface-lowest":this.type==="containerLowest","bg-surface-low":this.type==="containerLow","bg-surface-container":this.type==="container","bg-surface-high":this.type==="containerHigh","bg-surface-highest":this.type==="containerHighest"};return a.html`
16
+ <section class=${p.classMap(i)}>
17
+ <slot></slot>
18
+ </section>
19
+ `}},r([t.property({type:String,reflect:!0})],exports.SchmancySurface.prototype,"fill",2),r([t.property()],exports.SchmancySurface.prototype,"rounded",2),r([l.e({context:d.SchmancySurfaceTypeContext}),t.property()],exports.SchmancySurface.prototype,"type",2),r([t.property({type:Number})],exports.SchmancySurface.prototype,"elevation",2),exports.SchmancySurface=r([t.customElement("schmancy-surface")],exports.SchmancySurface);
20
+ //# sourceMappingURL=surface-KPpEcbzd.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surface-KPpEcbzd.cjs","sources":["../src/surface/surface.ts"],"sourcesContent":["import { provide } from '@lit/context';\nimport { TailwindElement } from '@mixins/tailwind.mixin';\nimport { css, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js'; // Import classMap\nimport { SchmancySurfaceTypeContext } from './context';\n\n/**\n * @element schmancy-surface\n * @slot - default content\n */\n@customElement('schmancy-surface')\nexport class SchmancySurface extends TailwindElement(css`\n :host([fill='all']) {\n height: 100%;\n width: 100%;\n }\n :host([fill='width']) {\n width: 100%;\n }\n :host([fill='height']) {\n height: 100%;\n }\n :host {\n display: block;\n }\n`) {\n /**\n * Fill the width and/or height of the parent container.\n * @default 'auto'\n *\n */\n @property({ type: String, reflect: true }) fill: 'all' | 'width' | 'height' | 'auto' = 'auto';\n @property() rounded: 'none' | 'top' | 'left' | 'right' | 'bottom' | 'all' = 'none';\n\n @provide({ context: SchmancySurfaceTypeContext })\n @property()\n type:\n | 'surface'\n | 'surfaceDim'\n | 'surfaceBright'\n | 'containerLowest'\n | 'containerLow'\n | 'container'\n | 'containerHigh'\n | 'containerHighest' = 'surface';\n\n @property({ type: Number }) elevation: 0 | 1 | 2 | 3 | 4 | 5 = 0;\n\n protected render(): unknown {\n const classes = {\n 'relative': true,\n 'inset-0': true,\n 'block': true,\n 'box-border': true,\n 'rounded-none': this.rounded === 'none',\n 'rounded-t-[8px]': this.rounded === 'top',\n 'rounded-l-[8px]': this.rounded === 'left',\n 'rounded-r-[8px]': this.rounded === 'right',\n 'rounded-b-[8px]': this.rounded === 'bottom',\n 'rounded-[8px]': this.rounded === 'all',\n\n 'w-full': this.fill === 'width' || this.fill === 'all',\n 'h-full': this.fill === 'height' || this.fill === 'all',\n 'shadow-xs': this.elevation === 1,\n 'shadow-sm': this.elevation === 2,\n 'shadow-md': this.elevation === 3,\n 'shadow-lg': this.elevation === 4,\n 'text-surface-on':\n this.type === 'surface' ||\n this.type === 'surfaceDim' ||\n this.type === 'surfaceBright' ||\n this.type === 'containerLowest' ||\n this.type === 'containerLow' ||\n this.type === 'container' ||\n this.type === 'containerHigh' ||\n this.type === 'containerHighest',\n 'bg-surface-default': this.type === 'surface',\n 'bg-surface-dim': this.type === 'surfaceDim',\n 'bg-surface-bright': this.type === 'surfaceBright',\n 'bg-surface-lowest': this.type === 'containerLowest',\n 'bg-surface-low': this.type === 'containerLow',\n 'bg-surface-container': this.type === 'container',\n 'bg-surface-high': this.type === 'containerHigh',\n 'bg-surface-highest': this.type === 'containerHighest',\n };\n\n return html`\n <section class=${classMap(classes)}>\n <slot></slot>\n </section>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'schmancy-surface': SchmancySurface;\n }\n}\n"],"names":["SchmancySurface","TailwindElement","css","super","arguments","this","fill","rounded","type","elevation","render","classes","relative","block","html","classMap","__decorateClass","property","String","reflect","prototype","provide","context","SchmancySurfaceTypeContext","Number","customElement"],"mappings":"+ZAYaA,QAAAA,gBAAN,cAA8BC,EAAAA,gBAAgBC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAA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AA,OAAA,GAC/BJ,EAAA,CAAXC,EAASA,SAAAA,CAAAA,EArBCjB,wBAqBCoB,UAAA,UAAA,CAIZJ,EAAAA,EAAA,CAFCK,IAAQ,CAAEC,QAASC,EAAAA,0BAAAA,CAAAA,EACnBN,EAASA,SAAAA,CAAAA,EAxBCjB,wBAyBXoB,UAAA,OAAA,CAU4BJ,EAAAA,EAAA,CAA3BC,WAAS,CAAET,KAAMgB,MAAAA,CAAAA,CAAAA,EAnCPxB,wBAmCiBoB,UAAA,YAAA,CAnCjBpB,EAAAA,QAANA,gBAAAgB,EAAA,CADNS,EAAAA,cAAc,kBAAA,CAAA,EACFzB"}
@@ -0,0 +1,42 @@
1
+ import { e as p } from "./provide-kj6-udep.js";
2
+ import { T as c } from "./tailwind.mixin-B1TvmOuJ.js";
3
+ import { css as d, html as u } from "lit";
4
+ import { property as h, customElement as f } from "lit/decorators.js";
5
+ import { classMap as y } from "lit/directives/class-map.js";
6
+ import { S as g } from "./context-5nmahssp.js";
7
+ var m = Object.defineProperty, b = Object.getOwnPropertyDescriptor, s = (i, r, n, o) => {
8
+ for (var a, t = o > 1 ? void 0 : o ? b(r, n) : r, l = i.length - 1; l >= 0; l--) (a = i[l]) && (t = (o ? a(r, n, t) : a(t)) || t);
9
+ return o && t && m(r, n, t), t;
10
+ };
11
+ let e = class extends c(d`
12
+ :host([fill='all']) {
13
+ height: 100%;
14
+ width: 100%;
15
+ }
16
+ :host([fill='width']) {
17
+ width: 100%;
18
+ }
19
+ :host([fill='height']) {
20
+ height: 100%;
21
+ }
22
+ :host {
23
+ display: block;
24
+ }
25
+ `) {
26
+ constructor() {
27
+ super(...arguments), this.fill = "auto", this.rounded = "none", this.type = "surface", this.elevation = 0;
28
+ }
29
+ render() {
30
+ const i = { relative: !0, "inset-0": !0, block: !0, "box-border": !0, "rounded-none": this.rounded === "none", "rounded-t-[8px]": this.rounded === "top", "rounded-l-[8px]": this.rounded === "left", "rounded-r-[8px]": this.rounded === "right", "rounded-b-[8px]": this.rounded === "bottom", "rounded-[8px]": this.rounded === "all", "w-full": this.fill === "width" || this.fill === "all", "h-full": this.fill === "height" || this.fill === "all", "shadow-xs": this.elevation === 1, "shadow-sm": this.elevation === 2, "shadow-md": this.elevation === 3, "shadow-lg": this.elevation === 4, "text-surface-on": this.type === "surface" || this.type === "surfaceDim" || this.type === "surfaceBright" || this.type === "containerLowest" || this.type === "containerLow" || this.type === "container" || this.type === "containerHigh" || this.type === "containerHighest", "bg-surface-default": this.type === "surface", "bg-surface-dim": this.type === "surfaceDim", "bg-surface-bright": this.type === "surfaceBright", "bg-surface-lowest": this.type === "containerLowest", "bg-surface-low": this.type === "containerLow", "bg-surface-container": this.type === "container", "bg-surface-high": this.type === "containerHigh", "bg-surface-highest": this.type === "containerHighest" };
31
+ return u`
32
+ <section class=${y(i)}>
33
+ <slot></slot>
34
+ </section>
35
+ `;
36
+ }
37
+ };
38
+ s([h({ type: String, reflect: !0 })], e.prototype, "fill", 2), s([h()], e.prototype, "rounded", 2), s([p({ context: g }), h()], e.prototype, "type", 2), s([h({ type: Number })], e.prototype, "elevation", 2), e = s([f("schmancy-surface")], e);
39
+ export {
40
+ e as S
41
+ };
42
+ //# sourceMappingURL=surface-yaUvZzID.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surface-yaUvZzID.js","sources":["../src/surface/surface.ts"],"sourcesContent":["import { provide } from '@lit/context';\nimport { TailwindElement } from '@mixins/tailwind.mixin';\nimport { css, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js'; // Import classMap\nimport { SchmancySurfaceTypeContext } from './context';\n\n/**\n * @element schmancy-surface\n * @slot - default content\n */\n@customElement('schmancy-surface')\nexport class SchmancySurface extends TailwindElement(css`\n :host([fill='all']) {\n height: 100%;\n width: 100%;\n }\n :host([fill='width']) {\n width: 100%;\n }\n :host([fill='height']) {\n height: 100%;\n }\n :host {\n display: block;\n }\n`) {\n /**\n * Fill the width and/or height of the parent container.\n * @default 'auto'\n *\n */\n @property({ type: String, reflect: true }) fill: 'all' | 'width' | 'height' | 'auto' = 'auto';\n @property() rounded: 'none' | 'top' | 'left' | 'right' | 'bottom' | 'all' = 'none';\n\n @provide({ context: SchmancySurfaceTypeContext })\n @property()\n type:\n | 'surface'\n | 'surfaceDim'\n | 'surfaceBright'\n | 'containerLowest'\n | 'containerLow'\n | 'container'\n | 'containerHigh'\n | 'containerHighest' = 'surface';\n\n @property({ type: Number }) elevation: 0 | 1 | 2 | 3 | 4 | 5 = 0;\n\n protected render(): unknown {\n const classes = {\n 'relative': true,\n 'inset-0': true,\n 'block': true,\n 'box-border': true,\n 'rounded-none': this.rounded === 'none',\n 'rounded-t-[8px]': this.rounded === 'top',\n 'rounded-l-[8px]': this.rounded === 'left',\n 'rounded-r-[8px]': this.rounded === 'right',\n 'rounded-b-[8px]': this.rounded === 'bottom',\n 'rounded-[8px]': this.rounded === 'all',\n\n 'w-full': this.fill === 'width' || this.fill === 'all',\n 'h-full': this.fill === 'height' || this.fill === 'all',\n 'shadow-xs': this.elevation === 1,\n 'shadow-sm': this.elevation === 2,\n 'shadow-md': this.elevation === 3,\n 'shadow-lg': this.elevation === 4,\n 'text-surface-on':\n this.type === 'surface' ||\n this.type === 'surfaceDim' ||\n this.type === 'surfaceBright' ||\n this.type === 'containerLowest' ||\n this.type === 'containerLow' ||\n this.type === 'container' ||\n this.type === 'containerHigh' ||\n this.type === 'containerHighest',\n 'bg-surface-default': this.type === 'surface',\n 'bg-surface-dim': this.type === 'surfaceDim',\n 'bg-surface-bright': this.type === 'surfaceBright',\n 'bg-surface-lowest': this.type === 'containerLowest',\n 'bg-surface-low': this.type === 'containerLow',\n 'bg-surface-container': this.type === 'container',\n 'bg-surface-high': this.type === 'containerHigh',\n 'bg-surface-highest': this.type === 'containerHighest',\n };\n\n return html`\n <section class=${classMap(classes)}>\n <slot></slot>\n </section>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'schmancy-surface': SchmancySurface;\n }\n}\n"],"names":["SchmancySurface","TailwindElement","css","super","arguments","this","fill","rounded","type","elevation","render","classes","relative","block","html","classMap","__decorateClass","property","String","reflect","prototype","provide","context","SchmancySurfaceTypeContext","Number","customElement"],"mappings":";;;;;;;;;;AAYa,IAAAA,IAAN,cAA8BC,EAAgBC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAA9C,EAAA;AAAA,EAAA,cAAAC;AAAAA,UAAAA,GAAAC,SAoBkFC,GAAAA,KAAAC,OAAA,QACXD,KAAAE,UAAA,QAYnDF,KAAAG,OAAA,WAEsCH,KAAAI,YAAA;AAAA,EAAA;AAAA,EAErD,SAAAC;AACR,UAAMC,IAAU,EACdC,UAAAA,IACA,WAAW,IACXC,OAAS,IACT,cAAc,IACd,gBAAgBR,KAAKE,YAAY,QACjC,mBAAmBF,KAAKE,YAAY,OACpC,mBAAmBF,KAAKE,YAAY,QACpC,mBAAmBF,KAAKE,YAAY,SACpC,mBAAmBF,KAAKE,YAAY,UACpC,iBAAiBF,KAAKE,YAAY,OAElC,UAAUF,KAAKC,SAAS,WAAWD,KAAKC,SAAS,OACjD,UAAUD,KAAKC,SAAS,YAAYD,KAAKC,SAAS,OAClD,aAAaD,KAAKI,cAAc,GAChC,aAAaJ,KAAKI,cAAc,GAChC,aAAaJ,KAAKI,cAAc,GAChC,aAAaJ,KAAKI,cAAc,GAChC,mBACEJ,KAAKG,SAAS,aACdH,KAAKG,SAAS,gBACdH,KAAKG,SAAS,mBACdH,KAAKG,SAAS,qBACdH,KAAKG,SAAS,kBACdH,KAAKG,SAAS,eACdH,KAAKG,SAAS,mBACdH,KAAKG,SAAS,oBAChB,sBAAsBH,KAAKG,SAAS,WACpC,kBAAkBH,KAAKG,SAAS,cAChC,qBAAqBH,KAAKG,SAAS,iBACnC,qBAAqBH,KAAKG,SAAS,mBACnC,kBAAkBH,KAAKG,SAAS,gBAChC,wBAAwBH,KAAKG,SAAS,aACtC,mBAAmBH,KAAKG,SAAS,iBACjC,sBAAsBH,KAAKG,SAAS,mBAATA;AAGtB,WAAAM;AAAAA,uBACYC,EAASJ,CAAAA,CAAAA;AAAAA;AAAAA;AAAAA;AAAAA,EAAQ;AAxDKK;AAAAA,EAAA,CAA1CC,EAAS,EAAET,MAAMU,QAAQC,SAAAA,QApBfnB,EAoBgCoB,WAAA,QAAA,CAC/BJ,GAAAA,EAAA,CAAXC,EArBUjB,CAAAA,GAAAA,EAqBCoB,WAAA,WAAA,CAAA,GAIZJ,EAAA,CAFCK,EAAQ,EAAEC,SAASC,EAAAA,CAAAA,GACnBN,MAxBUjB,EAyBXoB,WAAA,QAAA,CAU4BJ,GAAAA,EAAA,CAA3BC,EAAS,EAAET,MAAMgB,OAnCPxB,CAAAA,CAAAA,GAAAA,EAmCiBoB,WAAA,aAAA,CAAA,GAnCjBpB,IAANgB,EAAA,CADNS,EAAc,kBAAA,CAAA,GACFzB;"}
package/dist/surface.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./surface-qITC3jCV.cjs");Object.defineProperty(exports,"SchmancySurface",{enumerable:!0,get:()=>e.SchmancySurface});
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./surface-KPpEcbzd.cjs");Object.defineProperty(exports,"SchmancySurface",{enumerable:!0,get:()=>e.SchmancySurface});
2
2
  //# sourceMappingURL=surface.cjs.map
package/dist/surface.js CHANGED
@@ -1,4 +1,4 @@
1
- import { S as r } from "./surface-Cryxe3jX.js";
1
+ import { S as r } from "./surface-yaUvZzID.js";
2
2
  export {
3
3
  r as SchmancySurface
4
4
  };
package/dist/teleport.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./teleport.component-BtFkJ2lv.cjs");exports.HereMorty=e.HereMorty,Object.defineProperty(exports,"SchmancyTeleportation",{enumerable:!0,get:()=>e.SchmancyTeleportation}),exports.WhereAreYouRicky=e.WhereAreYouRicky,exports.teleport=e.teleport;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./teleport.component-Dj5lNIaQ.cjs");exports.HereMorty=e.HereMorty,Object.defineProperty(exports,"SchmancyTeleportation",{enumerable:!0,get:()=>e.SchmancyTeleportation}),exports.WhereAreYouRicky=e.WhereAreYouRicky,exports.teleport=e.teleport;
2
2
  //# sourceMappingURL=teleport.cjs.map
@@ -1,4 +1,4 @@
1
- "use strict";const h=require("lit"),c=require("lit/decorators.js"),n=require("rxjs");require("./animated-text-k30n5ffs.cjs");const O=require("./area.component-CDyk4TQX.cjs");require("./autocomplete-Cwn1Bwj7.cjs"),require("./spinner-Azsjno5r.cjs"),require("./icon-button-BkNubwVr.cjs"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const S=require("./tailwind.mixin-04vClyRW.cjs"),$=require("./theme.interface-Xg5Zi46a.cjs");require("./checkbox-g8T27Ih6.cjs"),require("./chips-8G-fC-BB.cjs"),require("./payment-card-form-V5STwP-8.cjs");const p=require("./types.cjs"),l=require("./provide-_VUNOf1R.cjs"),w=require("./litElement.mixin-AiJtwDLp.cjs"),d=require("./consume-Di0U0iBU.cjs");require("./date-range-DT5Gc-8v.cjs"),require("./delay-Dcxd6izx.cjs");const b=require("./ripple-C2BHbhcS.cjs");require("./divider-2FKklOvJ.cjs"),require("./form-C0uDoLE1.cjs"),require("./icon-CLgg4kma.cjs"),require("./input-BqSrvFYo.cjs"),require("./flex-wH1HLvFA.cjs"),require("./list-CkruFXk2.cjs"),require("./menu-TbqjiUg2.cjs");const I=require("lit/directives/when.js");require("./outlet-eGbH9Byt.cjs"),require("./option-J1ewccBk.cjs"),require("./radio-group-DPqaJa00.cjs"),require("./index-DyJ0oDpR.cjs"),require("./select-BvlBg33k.cjs");const U=require("./sheet-Crzdg6fC.cjs");require("./slider-0Uk2z9y_.cjs"),require("./surface-qITC3jCV.cjs"),require("./table-CBJ26MIg.cjs"),require("./tabs-group-CXTZCyMb.cjs"),require("./textarea-Ct0tCiZE.cjs"),require("./theme.component-DM774Lyr.cjs"),require("./theme-button-CZICh6mv.cjs"),require("./tree-DAEL96xl.cjs"),require("./typewriter-BBRroqBP.cjs"),require("./typography-_8EJsERF.cjs");const P=require("rxjs/operators");var Y=Object.defineProperty,V=Object.getOwnPropertyDescriptor;let H=class extends S.TailwindElement(h.css`
1
+ "use strict";const h=require("lit"),c=require("lit/decorators.js"),n=require("rxjs");require("./animated-text-k30n5ffs.cjs");const O=require("./area.component-CDyk4TQX.cjs");require("./autocomplete-Cwn1Bwj7.cjs"),require("./spinner-Azsjno5r.cjs"),require("./icon-button-BkNubwVr.cjs"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const S=require("./tailwind.mixin-04vClyRW.cjs"),$=require("./theme.interface-Xg5Zi46a.cjs");require("./checkbox-g8T27Ih6.cjs"),require("./chips-8G-fC-BB.cjs"),require("./payment-card-form-V5STwP-8.cjs");const p=require("./types.cjs"),l=require("./provide-_VUNOf1R.cjs"),w=require("./litElement.mixin-AiJtwDLp.cjs"),d=require("./consume-Di0U0iBU.cjs");require("./date-range-DT5Gc-8v.cjs"),require("./delay-Dcxd6izx.cjs");const b=require("./ripple-C2BHbhcS.cjs");require("./divider-2FKklOvJ.cjs"),require("./form-C4cWM0em.cjs"),require("./icon-CLgg4kma.cjs"),require("./input-BqSrvFYo.cjs"),require("./flex-wH1HLvFA.cjs"),require("./list-CkruFXk2.cjs"),require("./menu-TbqjiUg2.cjs");const I=require("lit/directives/when.js");require("./outlet-eGbH9Byt.cjs"),require("./option-J1ewccBk.cjs"),require("./radio-group-DPqaJa00.cjs"),require("./index-DyJ0oDpR.cjs"),require("./select-CENAt67G.cjs");const U=require("./sheet-CpxhwF3c.cjs");require("./slider-0Uk2z9y_.cjs"),require("./surface-KPpEcbzd.cjs"),require("./table-CBJ26MIg.cjs"),require("./tabs-group-CXTZCyMb.cjs"),require("./textarea-Ct0tCiZE.cjs"),require("./theme.component-DM774Lyr.cjs"),require("./theme-button-CZICh6mv.cjs"),require("./tree-DAEL96xl.cjs"),require("./typewriter-BBRroqBP.cjs"),require("./typography-_8EJsERF.cjs");const P=require("rxjs/operators");var Y=Object.defineProperty,V=Object.getOwnPropertyDescriptor;let H=class extends S.TailwindElement(h.css`
2
2
  :host {
3
3
  display: block;
4
4
  }
@@ -147,4 +147,4 @@
147
147
  class="${this.classMap({"fixed inset-0 z-49 hidden":!0})}"
148
148
  ></div>
149
149
  `}},u([d.c({context:W,subscribe:!0}),c.state()],exports.SchmancyNavigationDrawerSidebar.prototype,"mode",2),u([d.c({context:j,subscribe:!0}),c.state()],exports.SchmancyNavigationDrawerSidebar.prototype,"drawerState",2),u([c.query("#overlay")],exports.SchmancyNavigationDrawerSidebar.prototype,"overlay",2),u([c.query("nav")],exports.SchmancyNavigationDrawerSidebar.prototype,"nav",2),u([c.property({type:String})],exports.SchmancyNavigationDrawerSidebar.prototype,"width",2),u([c.state()],exports.SchmancyNavigationDrawerSidebar.prototype,"_initialized",2),exports.SchmancyNavigationDrawerSidebar=u([c.customElement("schmancy-nav-drawer-navbar")],exports.SchmancyNavigationDrawerSidebar);const _="whereAreYouRicky",A="hereMorty",f=new class{constructor(){this.activeTeleportations=new Map,this.flipRequests=new n.Subject,this.find=e=>n.zip([n.fromEvent(window,A).pipe(n.filter(t=>!!t.detail.component.uuid&&!!e.id&&t.detail.component.id===e.id&&t.detail.component.uuid!==e.uuid),n.map(t=>t.detail.component),n.take(1)),n.of(e).pipe(n.tap(()=>{window.dispatchEvent(new CustomEvent(_,{detail:{id:e.id,callerID:e.uuid}}))}))]).pipe(n.map(([t])=>t),n.timeout(0)),this.flip=e=>{const{from:t,to:i}=e,s=i.element.style.zIndex;i.element.style.transformOrigin="top left",i.element.style.setProperty("visibility","visible"),i.element.style.zIndex="1000";const a=[{transform:`translate(${t.rect.left-i.rect.left}px, ${t.rect.top-i.rect.top}px) scale(${t.rect.width/i.rect.width}, ${t.rect.height/i.rect.height})`},{transform:"translate(0, 0) scale(1, 1)"}];i.element.animate(a,{duration:250,delay:10,easing:"cubic-bezier(0.455, 0.03, 0.515, 0.955)"}).onfinish=()=>{i.element.style.zIndex=s,i.element.style.transformOrigin=""}},this.flipRequests.pipe(n.bufferTime(1),n.map(e=>e.map(({from:t,to:i,host:s},a)=>({from:t,to:i,host:s,i:a}))),n.concatMap(e=>n.zip(e.map(t=>n.of(this.flip(t)))))).subscribe()}};function B(e){return n.interval(50).pipe(P.map(()=>e.getBoundingClientRect()),P.distinctUntilChanged((t,i)=>t.width===i.width&&t.height===i.height&&t.top===i.top&&t.right===i.right&&t.bottom===i.bottom&&t.left===i.left),P.take(1))}var ve=Object.defineProperty,be=Object.getOwnPropertyDescriptor,q=(e,t,i,s)=>{for(var a,r=s>1?void 0:s?be(t,i):t,o=e.length-1;o>=0;o--)(a=e[o])&&(r=(s?a(t,i,r):a(r))||r);return s&&r&&ve(t,i,r),r};exports.SchmancyTeleportation=class extends w.$LitElement(h.css``){constructor(){super(...arguments),this.uuid=Math.floor(Math.random()*Date.now()),this.delay=0,this.debugging=!1}get _slottedChildren(){return this.shadowRoot.querySelector("slot").assignedElements({flatten:!0})}connectedCallback(){if(this.id===void 0)throw new Error("id is required");super.connectedCallback(),n.merge(n.fromEvent(window,O.FINDING_MORTIES).pipe(n.tap({next:()=>{this.dispatchEvent(new CustomEvent(O.HERE_RICKY,{detail:{component:this},bubbles:!0,composed:!0}))}})),n.fromEvent(window,_).pipe(n.tap({next:e=>{e.detail.id===this.id&&this.uuid&&e.detail.callerID!==this.uuid&&this.dispatchEvent(new CustomEvent(A,{detail:{component:this},bubbles:!0,composed:!0}))}}))).pipe(n.takeUntil(this.disconnecting)).subscribe()}async firstUpdated(){n.of(f.activeTeleportations.get(this.id)).pipe(n.filter(e=>!!e),n.takeUntil(this.disconnecting),n.throwIfEmpty()).subscribe({next:e=>{this.style.setProperty("visibility","hidden"),B(this).pipe(n.takeUntil(this.disconnecting)).subscribe({next:t=>{f.activeTeleportations.set(this.id,t),f.flipRequests.next({from:{rect:e},to:{rect:t,element:this._slottedChildren[0]},host:this})}})},error:()=>{this.style.setProperty("visibility","visible"),B(this).pipe(n.takeUntil(this.disconnecting)).subscribe({next:e=>{f.activeTeleportations.set(this.id,e)}})},complete:()=>{}})}render(){return h.html`<slot></slot>`}},q([c.property({type:Number,reflect:!0})],exports.SchmancyTeleportation.prototype,"uuid",2),q([c.property({type:String})],exports.SchmancyTeleportation.prototype,"id",2),q([c.property({type:Number})],exports.SchmancyTeleportation.prototype,"delay",2),exports.SchmancyTeleportation=q([c.customElement("schmancy-teleport")],exports.SchmancyTeleportation),exports.$drawer=ce,exports.HereMorty=A,exports.SchmancyContentDrawerID=X,exports.SchmancyContentDrawerMaxHeight=k,exports.SchmancyContentDrawerMinWidth=N,exports.SchmancyContentDrawerSheetMode=M,exports.SchmancyContentDrawerSheetState=R,exports.SchmancyDrawerNavbarMode=W,exports.SchmancyDrawerNavbarState=j,exports.WhereAreYouRicky=_,exports.schmancyContentDrawer=te,exports.schmancyNavDrawer=K,exports.teleport=f;
150
- //# sourceMappingURL=teleport.component-BtFkJ2lv.cjs.map
150
+ //# sourceMappingURL=teleport.component-Dj5lNIaQ.cjs.map