@mhmo91/schmancy 0.2.57 → 0.2.59

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 (33) 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/index.cjs +1 -1
  6. package/dist/index.js +3 -3
  7. package/dist/{input-DoURQ3xM.cjs → input-BrLbi5wu.cjs} +2 -2
  8. package/dist/input-BrLbi5wu.cjs.map +1 -0
  9. package/dist/{input-BAg8B5xw.js → input-D_30_4Cf.js} +2 -2
  10. package/dist/input-D_30_4Cf.js.map +1 -0
  11. package/dist/input.cjs +1 -1
  12. package/dist/input.js +1 -1
  13. package/dist/nav-drawer.cjs +1 -1
  14. package/dist/nav-drawer.js +1 -1
  15. package/dist/{select-DLZUW_cj.cjs → select-B_G2xt3n.cjs} +3 -2
  16. package/dist/select-B_G2xt3n.cjs.map +1 -0
  17. package/dist/{select-Dlyf_fVO.js → select-Dn-WETnI.js} +7 -6
  18. package/dist/select-Dn-WETnI.js.map +1 -0
  19. package/dist/select.cjs +1 -1
  20. package/dist/select.js +1 -1
  21. package/dist/teleport.cjs +1 -1
  22. package/dist/{teleport.component-CxVVjMy6.cjs → teleport.component-BU8VUQ9X.cjs} +2 -2
  23. package/dist/{teleport.component-CxVVjMy6.cjs.map → teleport.component-BU8VUQ9X.cjs.map} +1 -1
  24. package/dist/{teleport.component-DOIs9diZ.js → teleport.component-CQ-n025U.js} +3 -3
  25. package/dist/{teleport.component-DOIs9diZ.js.map → teleport.component-CQ-n025U.js.map} +1 -1
  26. package/dist/teleport.js +1 -1
  27. package/package.json +1 -1
  28. package/types/src/directives/visibility.d.ts +11 -0
  29. package/types/src/select/select.d.ts +1 -0
  30. package/dist/input-BAg8B5xw.js.map +0 -1
  31. package/dist/input-DoURQ3xM.cjs.map +0 -1
  32. package/dist/select-DLZUW_cj.cjs.map +0 -1
  33. package/dist/select-Dlyf_fVO.js.map +0 -1
package/dist/card.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";require("./teleport.component-CxVVjMy6.cjs");
1
+ "use strict";require("./teleport.component-BU8VUQ9X.cjs");
2
2
  //# sourceMappingURL=card.cjs.map
package/dist/card.js CHANGED
@@ -1,2 +1,2 @@
1
- import "./teleport.component-DOIs9diZ.js";
1
+ import "./teleport.component-CQ-n025U.js";
2
2
  //# sourceMappingURL=card.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./teleport.component-CxVVjMy6.cjs");Object.defineProperty(exports,"SchmancyContentDrawer",{enumerable:!0,get:()=>e.SchmancyContentDrawer}),exports.SchmancyContentDrawerID=e.SchmancyContentDrawerID,Object.defineProperty(exports,"SchmancyContentDrawerMain",{enumerable:!0,get:()=>e.SchmancyContentDrawerMain}),exports.SchmancyContentDrawerMaxHeight=e.SchmancyContentDrawerMaxHeight,exports.SchmancyContentDrawerMinWidth=e.SchmancyContentDrawerMinWidth,Object.defineProperty(exports,"SchmancyContentDrawerSheet",{enumerable:!0,get:()=>e.SchmancyContentDrawerSheet}),exports.SchmancyContentDrawerSheetMode=e.SchmancyContentDrawerSheetMode,exports.SchmancyContentDrawerSheetState=e.SchmancyContentDrawerSheetState,exports.schmancyContentDrawer=e.schmancyContentDrawer;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./teleport.component-BU8VUQ9X.cjs");Object.defineProperty(exports,"SchmancyContentDrawer",{enumerable:!0,get:()=>e.SchmancyContentDrawer}),exports.SchmancyContentDrawerID=e.SchmancyContentDrawerID,Object.defineProperty(exports,"SchmancyContentDrawerMain",{enumerable:!0,get:()=>e.SchmancyContentDrawerMain}),exports.SchmancyContentDrawerMaxHeight=e.SchmancyContentDrawerMaxHeight,exports.SchmancyContentDrawerMinWidth=e.SchmancyContentDrawerMinWidth,Object.defineProperty(exports,"SchmancyContentDrawerSheet",{enumerable:!0,get:()=>e.SchmancyContentDrawerSheet}),exports.SchmancyContentDrawerSheetMode=e.SchmancyContentDrawerSheetMode,exports.SchmancyContentDrawerSheetState=e.SchmancyContentDrawerSheetState,exports.schmancyContentDrawer=e.schmancyContentDrawer;
2
2
  //# sourceMappingURL=content-drawer.cjs.map
@@ -1,4 +1,4 @@
1
- import { e as n, b as t, f as r, c, d as h, g as S, S as o, a as s, s as m } from "./teleport.component-DOIs9diZ.js";
1
+ import { e as n, b as t, f as r, c, d as h, g as S, S as o, a as s, s as m } from "./teleport.component-CQ-n025U.js";
2
2
  export {
3
3
  n as SchmancyContentDrawer,
4
4
  t as SchmancyContentDrawerID,
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("./animated-text-CvQB_OPX.cjs");const r=require("./area.component-CWwc52Uy.cjs");require("./autocomplete-B29VQiPY.cjs"),require("./spinner-CBX7eCsA.cjs");const o=require("./icon-button-CaEPMYHW.cjs"),e=require("./teleport.component-CxVVjMy6.cjs"),S=require("./checkbox-BNi0XYlX.cjs");require("./chips-BbMv4qYo.cjs");const u=require("./payment-card-form-BwzL71bJ.cjs");require("./date-range-3yVvaRLG.cjs");const y=require("./delay-CbylHdl-.cjs"),c=require("./ripple-C2BHbhcS.cjs");require("./divider-BPWZZ0t2.cjs"),require("./form-BeLadN-A.cjs"),require("./icon-BOUn9Lbw.cjs"),require("./input-DoURQ3xM.cjs");const t=require("./flex-DICGGeg0.cjs"),m=require("./list-CQJYVqBV.cjs");require("./menu-BKUoQyCS.cjs");const a=require("./outlet-D_JSZeRn.cjs");require("./option-GQjTaa4v.cjs");const b=require("./radio-group-DSob8tt0.cjs"),l=require("./rxjs-utils.cjs");require("rxjs"),require("./index-DyJ0oDpR.cjs");const d=require("./select-DLZUW_cj.cjs"),n=require("./sheet-BoPm_Ysx.cjs"),h=require("./slider-DFSq11C6.cjs"),p=require("./surface-BCP4Nk6f.cjs");require("./table-MEstD23V.cjs"),require("./tabs-group-DyNlrJrc.cjs"),require("./textarea-DgjTD3MS.cjs");const i=require("./theme.component-BpS8ehqb.cjs"),g=require("./theme.interface-Xg5Zi46a.cjs");require("./theme-button-DmdmN56f.cjs");const f=require("./tree-DzG0MTVn.cjs"),q=require("./types.cjs"),O=require("./typewriter-DNihFwgs.cjs"),w=require("./typography-Di2lcsba.cjs"),D=require("./intersection-CVvaDv96.cjs");exports.FINDING_MORTIES=r.FINDING_MORTIES,exports.HERE_RICKY=r.HERE_RICKY,exports.HISTORY_STRATEGY=r.HISTORY_STRATEGY,Object.defineProperty(exports,"SchmancyArea",{enumerable:!0,get:()=>r.SchmancyArea}),exports.area=r.area,exports.routerHistory=r.routerHistory,Object.defineProperty(exports,"SchmancyButton",{enumerable:!0,get:()=>o.SchmancyButton}),Object.defineProperty(exports,"SchmnacyIconButton",{enumerable:!0,get:()=>o.SchmnacyIconButton}),exports.$drawer=e.$drawer,exports.HereMorty=e.HereMorty,Object.defineProperty(exports,"SchmancyContentDrawer",{enumerable:!0,get:()=>e.SchmancyContentDrawer}),exports.SchmancyContentDrawerID=e.SchmancyContentDrawerID,Object.defineProperty(exports,"SchmancyContentDrawerMain",{enumerable:!0,get:()=>e.SchmancyContentDrawerMain}),exports.SchmancyContentDrawerMaxHeight=e.SchmancyContentDrawerMaxHeight,exports.SchmancyContentDrawerMinWidth=e.SchmancyContentDrawerMinWidth,Object.defineProperty(exports,"SchmancyContentDrawerSheet",{enumerable:!0,get:()=>e.SchmancyContentDrawerSheet}),exports.SchmancyContentDrawerSheetMode=e.SchmancyContentDrawerSheetMode,exports.SchmancyContentDrawerSheetState=e.SchmancyContentDrawerSheetState,Object.defineProperty(exports,"SchmancyDrawerAppbar",{enumerable:!0,get:()=>e.SchmancyDrawerAppbar}),exports.SchmancyDrawerNavbarMode=e.SchmancyDrawerNavbarMode,exports.SchmancyDrawerNavbarState=e.SchmancyDrawerNavbarState,Object.defineProperty(exports,"SchmancyNavigationDrawer",{enumerable:!0,get:()=>e.SchmancyNavigationDrawer}),Object.defineProperty(exports,"SchmancyNavigationDrawerContent",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerContent}),Object.defineProperty(exports,"SchmancyNavigationDrawerSidebar",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerSidebar}),Object.defineProperty(exports,"SchmancyTeleportation",{enumerable:!0,get:()=>e.SchmancyTeleportation}),exports.WhereAreYouRicky=e.WhereAreYouRicky,exports.schmancyContentDrawer=e.schmancyContentDrawer,exports.schmancyNavDrawer=e.schmancyNavDrawer,exports.teleport=e.teleport,Object.defineProperty(exports,"SchmancyCheckbox",{enumerable:!0,get:()=>S.SchmancyCheckbox}),Object.defineProperty(exports,"SchmancyPaymentCardForm",{enumerable:!0,get:()=>u.SchmancyPaymentCardForm}),Object.defineProperty(exports,"SchmancyDelay",{enumerable:!0,get:()=>y.SchmancyDelay}),exports.delayContext=y.delayContext,exports.color=c.color,exports.fullHeight=c.fullHeight,exports.ripple=c.ripple,Object.defineProperty(exports,"SchmancyFlex",{enumerable:!0,get:()=>t.SchmancyFlex}),Object.defineProperty(exports,"SchmancyFlexV2",{enumerable:!0,get:()=>t.SchmancyFlexV2}),Object.defineProperty(exports,"SchmancyGrid",{enumerable:!0,get:()=>t.SchmancyGrid}),Object.defineProperty(exports,"SchmancyScroll",{enumerable:!0,get:()=>t.SchmancyScroll}),Object.defineProperty(exports,"List",{enumerable:!0,get:()=>m.List}),Object.defineProperty(exports,"SchmancyListItem",{enumerable:!0,get:()=>m.SchmancyListItem}),exports.$notify=a.$notify,Object.defineProperty(exports,"SchmancyNotification",{enumerable:!0,get:()=>a.SchmancyNotification}),Object.defineProperty(exports,"SchmancyNotificationOutlet",{enumerable:!0,get:()=>a.SchmancyNotificationOutlet}),Object.defineProperty(exports,"RadioGroup",{enumerable:!0,get:()=>b.RadioGroup}),exports.mutationObserver=l.mutationObserver,Object.defineProperty(exports,"SchmancySelect",{enumerable:!0,get:()=>d.SchmancySelect}),exports.SchmancySheetPosition=n.SchmancySheetPosition,exports.SheetHereMorty=n.SheetHereMorty,exports.SheetWhereAreYouRicky=n.SheetWhereAreYouRicky,exports.sheet=n.sheet,Object.defineProperty(exports,"SchmancySlide",{enumerable:!0,get:()=>h.SchmancySlide}),Object.defineProperty(exports,"SchmancySlider",{enumerable:!0,get:()=>h.SchmancySlider}),Object.defineProperty(exports,"SchmancySurface",{enumerable:!0,get:()=>p.SchmancySurface}),Object.defineProperty(exports,"SchmancyThemeComponent",{enumerable:!0,get:()=>i.SchmancyThemeComponent}),exports.formateTheme=i.formateTheme,exports.tailwindStyles=i.tailwindStyles,exports.SchmancyTheme=g.SchmancyTheme,Object.defineProperty(exports,"SchmancyTree",{enumerable:!0,get:()=>f.SchmancyTree}),exports.SchmancyEvents=q.SchmancyEvents,Object.defineProperty(exports,"TypewriterElement",{enumerable:!0,get:()=>O.TypewriterElement}),Object.defineProperty(exports,"SchmancyTypography",{enumerable:!0,get:()=>w.SchmancyTypography}),exports.intersection$=D.intersection$;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("./animated-text-CvQB_OPX.cjs");const r=require("./area.component-CWwc52Uy.cjs");require("./autocomplete-B29VQiPY.cjs"),require("./spinner-CBX7eCsA.cjs");const o=require("./icon-button-CaEPMYHW.cjs"),e=require("./teleport.component-BU8VUQ9X.cjs"),S=require("./checkbox-BNi0XYlX.cjs");require("./chips-BbMv4qYo.cjs");const u=require("./payment-card-form-BwzL71bJ.cjs");require("./date-range-3yVvaRLG.cjs");const y=require("./delay-CbylHdl-.cjs"),c=require("./ripple-C2BHbhcS.cjs");require("./divider-BPWZZ0t2.cjs"),require("./form-BeLadN-A.cjs"),require("./icon-BOUn9Lbw.cjs"),require("./input-BrLbi5wu.cjs");const t=require("./flex-DICGGeg0.cjs"),m=require("./list-CQJYVqBV.cjs");require("./menu-BKUoQyCS.cjs");const a=require("./outlet-D_JSZeRn.cjs");require("./option-GQjTaa4v.cjs");const b=require("./radio-group-DSob8tt0.cjs"),l=require("./rxjs-utils.cjs");require("rxjs"),require("./index-DyJ0oDpR.cjs");const d=require("./select-B_G2xt3n.cjs"),n=require("./sheet-BoPm_Ysx.cjs"),h=require("./slider-DFSq11C6.cjs"),p=require("./surface-BCP4Nk6f.cjs");require("./table-MEstD23V.cjs"),require("./tabs-group-DyNlrJrc.cjs"),require("./textarea-DgjTD3MS.cjs");const i=require("./theme.component-BpS8ehqb.cjs"),g=require("./theme.interface-Xg5Zi46a.cjs");require("./theme-button-DmdmN56f.cjs");const f=require("./tree-DzG0MTVn.cjs"),q=require("./types.cjs"),O=require("./typewriter-DNihFwgs.cjs"),w=require("./typography-Di2lcsba.cjs"),D=require("./intersection-CVvaDv96.cjs");exports.FINDING_MORTIES=r.FINDING_MORTIES,exports.HERE_RICKY=r.HERE_RICKY,exports.HISTORY_STRATEGY=r.HISTORY_STRATEGY,Object.defineProperty(exports,"SchmancyArea",{enumerable:!0,get:()=>r.SchmancyArea}),exports.area=r.area,exports.routerHistory=r.routerHistory,Object.defineProperty(exports,"SchmancyButton",{enumerable:!0,get:()=>o.SchmancyButton}),Object.defineProperty(exports,"SchmnacyIconButton",{enumerable:!0,get:()=>o.SchmnacyIconButton}),exports.$drawer=e.$drawer,exports.HereMorty=e.HereMorty,Object.defineProperty(exports,"SchmancyContentDrawer",{enumerable:!0,get:()=>e.SchmancyContentDrawer}),exports.SchmancyContentDrawerID=e.SchmancyContentDrawerID,Object.defineProperty(exports,"SchmancyContentDrawerMain",{enumerable:!0,get:()=>e.SchmancyContentDrawerMain}),exports.SchmancyContentDrawerMaxHeight=e.SchmancyContentDrawerMaxHeight,exports.SchmancyContentDrawerMinWidth=e.SchmancyContentDrawerMinWidth,Object.defineProperty(exports,"SchmancyContentDrawerSheet",{enumerable:!0,get:()=>e.SchmancyContentDrawerSheet}),exports.SchmancyContentDrawerSheetMode=e.SchmancyContentDrawerSheetMode,exports.SchmancyContentDrawerSheetState=e.SchmancyContentDrawerSheetState,Object.defineProperty(exports,"SchmancyDrawerAppbar",{enumerable:!0,get:()=>e.SchmancyDrawerAppbar}),exports.SchmancyDrawerNavbarMode=e.SchmancyDrawerNavbarMode,exports.SchmancyDrawerNavbarState=e.SchmancyDrawerNavbarState,Object.defineProperty(exports,"SchmancyNavigationDrawer",{enumerable:!0,get:()=>e.SchmancyNavigationDrawer}),Object.defineProperty(exports,"SchmancyNavigationDrawerContent",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerContent}),Object.defineProperty(exports,"SchmancyNavigationDrawerSidebar",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerSidebar}),Object.defineProperty(exports,"SchmancyTeleportation",{enumerable:!0,get:()=>e.SchmancyTeleportation}),exports.WhereAreYouRicky=e.WhereAreYouRicky,exports.schmancyContentDrawer=e.schmancyContentDrawer,exports.schmancyNavDrawer=e.schmancyNavDrawer,exports.teleport=e.teleport,Object.defineProperty(exports,"SchmancyCheckbox",{enumerable:!0,get:()=>S.SchmancyCheckbox}),Object.defineProperty(exports,"SchmancyPaymentCardForm",{enumerable:!0,get:()=>u.SchmancyPaymentCardForm}),Object.defineProperty(exports,"SchmancyDelay",{enumerable:!0,get:()=>y.SchmancyDelay}),exports.delayContext=y.delayContext,exports.color=c.color,exports.fullHeight=c.fullHeight,exports.ripple=c.ripple,Object.defineProperty(exports,"SchmancyFlex",{enumerable:!0,get:()=>t.SchmancyFlex}),Object.defineProperty(exports,"SchmancyFlexV2",{enumerable:!0,get:()=>t.SchmancyFlexV2}),Object.defineProperty(exports,"SchmancyGrid",{enumerable:!0,get:()=>t.SchmancyGrid}),Object.defineProperty(exports,"SchmancyScroll",{enumerable:!0,get:()=>t.SchmancyScroll}),Object.defineProperty(exports,"List",{enumerable:!0,get:()=>m.List}),Object.defineProperty(exports,"SchmancyListItem",{enumerable:!0,get:()=>m.SchmancyListItem}),exports.$notify=a.$notify,Object.defineProperty(exports,"SchmancyNotification",{enumerable:!0,get:()=>a.SchmancyNotification}),Object.defineProperty(exports,"SchmancyNotificationOutlet",{enumerable:!0,get:()=>a.SchmancyNotificationOutlet}),Object.defineProperty(exports,"RadioGroup",{enumerable:!0,get:()=>b.RadioGroup}),exports.mutationObserver=l.mutationObserver,Object.defineProperty(exports,"SchmancySelect",{enumerable:!0,get:()=>d.SchmancySelect}),exports.SchmancySheetPosition=n.SchmancySheetPosition,exports.SheetHereMorty=n.SheetHereMorty,exports.SheetWhereAreYouRicky=n.SheetWhereAreYouRicky,exports.sheet=n.sheet,Object.defineProperty(exports,"SchmancySlide",{enumerable:!0,get:()=>h.SchmancySlide}),Object.defineProperty(exports,"SchmancySlider",{enumerable:!0,get:()=>h.SchmancySlider}),Object.defineProperty(exports,"SchmancySurface",{enumerable:!0,get:()=>p.SchmancySurface}),Object.defineProperty(exports,"SchmancyThemeComponent",{enumerable:!0,get:()=>i.SchmancyThemeComponent}),exports.formateTheme=i.formateTheme,exports.tailwindStyles=i.tailwindStyles,exports.SchmancyTheme=g.SchmancyTheme,Object.defineProperty(exports,"SchmancyTree",{enumerable:!0,get:()=>f.SchmancyTree}),exports.SchmancyEvents=q.SchmancyEvents,Object.defineProperty(exports,"TypewriterElement",{enumerable:!0,get:()=>O.TypewriterElement}),Object.defineProperty(exports,"SchmancyTypography",{enumerable:!0,get:()=>w.SchmancyTypography}),exports.intersection$=D.intersection$;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { F as C, H as d, b as T, S as b, a as u, r as N } from "./area.component
3
3
  import "./autocomplete-BYaStWXT.js";
4
4
  import "./spinner-DxDUWBpa.js";
5
5
  import { S as R, a as v } from "./icon-button-DIGpWi22.js";
6
- import { $ as M, H as g, e as E, b as A, f as F, c as Y, d as $, g as k, S as G, a as O, i as W, k as L, l as _, m as B, j as P, n as j, o as K, W as V, s as q, h as z, t as J } from "./teleport.component-DOIs9diZ.js";
6
+ import { $ as M, H as g, e as E, b as A, f as F, c as Y, d as $, g as k, S as G, a as O, i as W, k as L, l as _, m as B, j as P, n as j, o as K, W as V, s as q, h as z, t as J } from "./teleport.component-CQ-n025U.js";
7
7
  import { S as U } from "./checkbox-BDRhgA8Q.js";
8
8
  import "./chips-DLKWllS2.js";
9
9
  import { S as Z } from "./payment-card-form-CIWTaRBz.js";
@@ -13,7 +13,7 @@ import { c as oa, f as ca, r as ma } from "./ripple-BumgqsDT.js";
13
13
  import "./divider-D2GJitrx.js";
14
14
  import "./form-BA83AMjT.js";
15
15
  import "./icon-BVEUJQHT.js";
16
- import "./input-BAg8B5xw.js";
16
+ import "./input-D_30_4Cf.js";
17
17
  import { S as sa, c as Sa, a as ha, b as ia } from "./flex-DL52jmYy.js";
18
18
  import { L as pa, S as fa } from "./list-DjB7q6Qk.js";
19
19
  import "./menu-BNZPGmxK.js";
@@ -23,7 +23,7 @@ import { R as da } from "./radio-group-BAixca90.js";
23
23
  import { mutationObserver as ba } from "./rxjs-utils.js";
24
24
  import "rxjs";
25
25
  import "./index-CuY8m6ta.js";
26
- import { S as Na } from "./select-Dlyf_fVO.js";
26
+ import { S as Na } from "./select-Dn-WETnI.js";
27
27
  import { S as Ra, b as va, a as Ia, s as Ma } from "./sheet-BcYEDp9D.js";
28
28
  import { S as Ea, a as Aa } from "./slider-BTIT0zsN.js";
29
29
  import { S as Ya } from "./surface-AcsAPEQK.js";
@@ -1,4 +1,4 @@
1
- "use strict";const c=require("lit"),i=require("lit/decorators.js"),m=require("lit/directives/class-map.js"),l=require("lit/directives/if-defined.js"),f=require("lit/directives/ref.js"),b=require("lit/directives/when.js"),s=require("rxjs");require("lit/directives/style-map.js");const v=require("./tailwind.mixin-Bkx1Uuxe.cjs"),y=require("./ripple-C2BHbhcS.cjs"),h=require("./theme.interface-Xg5Zi46a.cjs");var g=Object.defineProperty,$=Object.getOwnPropertyDescriptor,r=(e,o,n,p)=>{for(var u,a=p>1?void 0:p?$(o,n):o,d=e.length-1;d>=0;d--)(u=e[d])&&(a=(p?u(o,n,a):u(a))||a);return p&&a&&g(o,n,a),a};let t=class extends v.TailwindElement(){constructor(){if(super(),this.id="",this.label="",this.type="text",this.name=`name_${Date.now()}`,this.placeholder="",this.value="",this.required=!1,this.disabled=!1,this.readonly=!1,this.clickable=!1,this.spellcheck=!1,this.align="left",this.autofocus=!1,this.autocomplete="off",this.tabIndex=0,this.error=!1,this.inputRef=f.createRef(),"attachInternals"in this)try{this.internals=this.attachInternals()}catch{this.internals=void 0}}willUpdate(e){this.id||(this.id="schmancy-input-"+t._idCounter++),super.willUpdate(e)}get form(){var e;return((e=this.internals)==null?void 0:e.form)??null}updated(e){var o,n,p;super.updated(e),e.has("value")&&((o=this.internals)==null||o.setFormValue(this.value)),e.has("error")&&(this.error?(n=this.internals)==null||n.setValidity({customError:!0},"Invalid input",this.inputElement):(p=this.internals)==null||p.setValidity({}))}checkValidity(){var e;return((e=this.inputRef.value)==null?void 0:e.checkValidity())??!0}reportValidity(){var e;return((e=this.inputRef.value)==null?void 0:e.reportValidity())??!0}setCustomValidity(e){var o;(o=this.inputRef.value)==null||o.setCustomValidity(e)}firstUpdated(){this.autofocus&&this.focus(),s.fromEvent(this.inputElement,"input").pipe(s.map(e=>e.target.value),s.distinctUntilChanged(),s.takeUntil(this.disconnecting)).subscribe(e=>{this.value=e,this.dispatchEvent(new CustomEvent("input",{detail:{value:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0}))}),s.fromEvent(this.inputElement,"change").pipe(s.map(e=>e.target.value),s.distinctUntilChanged(),s.takeUntil(this.disconnecting)).subscribe(e=>{this.value=e,this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0}))}),s.fromEvent(this.inputElement,"keyup").pipe(s.filter(e=>e.key==="Enter"),s.takeUntil(this.disconnecting)).subscribe(e=>{const{value:o}=e.target;this.value=o,this.dispatchEvent(new CustomEvent("enter",{detail:{value:o},bubbles:!0,composed:!0}))}),s.fromEvent(this.inputElement,"animationstart").pipe(s.filter(e=>e.animationName==="onAutoFillStart"),s.takeUntil(this.disconnecting)).subscribe(e=>{const{value:o}=e.target;this.value=o,this.dispatchEvent(new CustomEvent("change",{detail:{value:o},bubbles:!0,composed:!0}))})}select(){var e;return(e=this.inputRef.value)==null?void 0:e.select()}getValidity(){var e;return(e=this.inputRef.value)==null?void 0:e.validity}focus(e){var o;(o=this.inputRef.value)==null||o.focus(e),this.dispatchEvent(new Event("focus"))}click(){var e;(e=this.inputRef.value)==null||e.click(),this.dispatchEvent(new Event("click"))}blur(){var e;(e=this.inputRef.value)==null||e.blur(),this.dispatchEvent(new Event("blur"))}render(){const e={"w-full flex-1 h-[50px] rounded-[8px] border-0 px-[8px] sm:px-[12px] md:px-[16px]":!0,"outline-secondary-default focus:outline-1 ":!0,"disabled:opacity-40 disabled:cursor-not-allowed":!0,"placeholder:text-muted":!0,"ring-0 ring-inset focus:ring-1 focus:ring-inset":!0,"ring-secondary-default ring-outline focus:ring-secondary-default":!this.error,"ring-error-default focus:ring-error-default":this.error,"caret-transparent focus:outline-hidden cursor-pointer text-select-none":this.readonly,"cursor-pointer":this.clickable,"text-center":this.align==="center","text-right":this.align==="right"},o={"opacity-40":this.disabled,"block mb-[4px]":!0};return c.html`
1
+ "use strict";const c=require("lit"),i=require("lit/decorators.js"),m=require("lit/directives/class-map.js"),l=require("lit/directives/if-defined.js"),f=require("lit/directives/ref.js"),b=require("lit/directives/when.js"),s=require("rxjs");require("lit/directives/style-map.js");const v=require("./tailwind.mixin-Bkx1Uuxe.cjs"),y=require("./ripple-C2BHbhcS.cjs"),h=require("./theme.interface-Xg5Zi46a.cjs");var g=Object.defineProperty,$=Object.getOwnPropertyDescriptor,r=(e,o,n,p)=>{for(var u,a=p>1?void 0:p?$(o,n):o,d=e.length-1;d>=0;d--)(u=e[d])&&(a=(p?u(o,n,a):u(a))||a);return p&&a&&g(o,n,a),a};let t=class extends v.TailwindElement(){constructor(){if(super(),this.id="",this.label="",this.type="text",this.name=`name_${Date.now()}`,this.placeholder="",this.value="",this.required=!1,this.disabled=!1,this.readonly=!1,this.clickable=!1,this.spellcheck=!1,this.align="left",this.autofocus=!1,this.autocomplete="on",this.tabIndex=0,this.error=!1,this.inputRef=f.createRef(),"attachInternals"in this)try{this.internals=this.attachInternals()}catch{this.internals=void 0}}willUpdate(e){this.id||(this.id="schmancy-input-"+t._idCounter++),super.willUpdate(e)}get form(){var e;return((e=this.internals)==null?void 0:e.form)??null}updated(e){var o,n,p;super.updated(e),e.has("value")&&((o=this.internals)==null||o.setFormValue(this.value)),e.has("error")&&(this.error?(n=this.internals)==null||n.setValidity({customError:!0},"Invalid input",this.inputElement):(p=this.internals)==null||p.setValidity({}))}checkValidity(){var e;return((e=this.inputRef.value)==null?void 0:e.checkValidity())??!0}reportValidity(){var e;return((e=this.inputRef.value)==null?void 0:e.reportValidity())??!0}setCustomValidity(e){var o;(o=this.inputRef.value)==null||o.setCustomValidity(e)}firstUpdated(){this.autofocus&&this.focus(),s.fromEvent(this.inputElement,"input").pipe(s.map(e=>e.target.value),s.distinctUntilChanged(),s.takeUntil(this.disconnecting)).subscribe(e=>{this.value=e,this.dispatchEvent(new CustomEvent("input",{detail:{value:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0}))}),s.fromEvent(this.inputElement,"change").pipe(s.map(e=>e.target.value),s.distinctUntilChanged(),s.takeUntil(this.disconnecting)).subscribe(e=>{this.value=e,this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0}))}),s.fromEvent(this.inputElement,"keyup").pipe(s.filter(e=>e.key==="Enter"),s.takeUntil(this.disconnecting)).subscribe(e=>{const{value:o}=e.target;this.value=o,this.dispatchEvent(new CustomEvent("enter",{detail:{value:o},bubbles:!0,composed:!0}))}),s.fromEvent(this.inputElement,"animationstart").pipe(s.filter(e=>e.animationName==="onAutoFillStart"),s.takeUntil(this.disconnecting)).subscribe(e=>{const{value:o}=e.target;this.value=o,this.dispatchEvent(new CustomEvent("change",{detail:{value:o},bubbles:!0,composed:!0}))})}select(){var e;return(e=this.inputRef.value)==null?void 0:e.select()}getValidity(){var e;return(e=this.inputRef.value)==null?void 0:e.validity}focus(e){var o;(o=this.inputRef.value)==null||o.focus(e),this.dispatchEvent(new Event("focus"))}click(){var e;(e=this.inputRef.value)==null||e.click(),this.dispatchEvent(new Event("click"))}blur(){var e;(e=this.inputRef.value)==null||e.blur(),this.dispatchEvent(new Event("blur"))}render(){const e={"w-full flex-1 h-[50px] rounded-[8px] border-0 px-[8px] sm:px-[12px] md:px-[16px]":!0,"outline-secondary-default focus:outline-1 ":!0,"disabled:opacity-40 disabled:cursor-not-allowed":!0,"placeholder:text-muted":!0,"ring-0 ring-inset focus:ring-1 focus:ring-inset":!0,"ring-secondary-default ring-outline focus:ring-secondary-default":!this.error,"ring-error-default focus:ring-error-default":this.error,"caret-transparent focus:outline-hidden cursor-pointer text-select-none":this.readonly,"cursor-pointer":this.clickable,"text-center":this.align==="center","text-right":this.align==="right"},o={"opacity-40":this.disabled,"block mb-[4px]":!0};return c.html`
2
2
  ${b.when(this.label,()=>c.html`
3
3
  <label
4
4
  for=${this.id}
@@ -50,4 +50,4 @@
50
50
  </div>
51
51
  `)}
52
52
  `}};t._idCounter=0,t.formAssociated=!0,t.shadowRootOptions={...c.LitElement.shadowRootOptions,delegatesFocus:!0},r([i.property({reflect:!0})],t.prototype,"id",2),r([i.property({type:String})],t.prototype,"label",2),r([i.property({reflect:!0})],t.prototype,"type",2),r([i.property()],t.prototype,"name",2),r([i.property()],t.prototype,"placeholder",2),r([i.property({type:String,reflect:!0})],t.prototype,"value",2),r([i.property({type:String,reflect:!0})],t.prototype,"pattern",2),r([i.property({type:Boolean,reflect:!0})],t.prototype,"required",2),r([i.property({type:Boolean,reflect:!0})],t.prototype,"disabled",2),r([i.property({type:Boolean,reflect:!0})],t.prototype,"readonly",2),r([i.property({type:Boolean,reflect:!0})],t.prototype,"clickable",2),r([i.property({type:Boolean,reflect:!0})],t.prototype,"spellcheck",2),r([i.property({type:String,reflect:!0})],t.prototype,"align",2),r([i.property()],t.prototype,"inputmode",2),r([i.property({type:Number})],t.prototype,"minlength",2),r([i.property({type:Number})],t.prototype,"maxlength",2),r([i.property()],t.prototype,"min",2),r([i.property()],t.prototype,"max",2),r([i.property({type:Number,reflect:!0})],t.prototype,"step",2),r([i.property({type:Boolean})],t.prototype,"autofocus",2),r([i.property({type:String})],t.prototype,"autocomplete",2),r([i.property({type:Number,reflect:!0})],t.prototype,"tabIndex",2),r([i.property()],t.prototype,"hint",2),r([i.property({type:Boolean,reflect:!0})],t.prototype,"error",2),r([i.query("input")],t.prototype,"inputElement",2),t=r([i.customElement("schmancy-input")],t);
53
- //# sourceMappingURL=input-DoURQ3xM.cjs.map
53
+ //# sourceMappingURL=input-BrLbi5wu.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-BrLbi5wu.cjs","sources":["../src/input/input.ts"],"sourcesContent":["import { html, LitElement, nothing, PropertyValueMap } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { createRef, ref } from 'lit/directives/ref.js'\nimport { when } from 'lit/directives/when.js'\nimport { distinctUntilChanged, filter, fromEvent, map, takeUntil } from 'rxjs'\n\nimport { TailwindElement } from '@mixins/index'\n\n// color directive + theme interface\nimport { color } from '@schmancy/directives'\nimport { SchmancyTheme } from '@schmancy/theme/theme.interface'\n\n// If you want to be form-associated, define the type on `ElementInternals`.\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-input': SchmancyInput\n\t}\n}\n\ntype EventDetails = {\n\tvalue: string\n}\n\n/**\n * Custom events the component may emit:\n * - 'input': on every keystroke\n * - 'change': on native blur/change\n * - 'enter': specifically when user presses Enter\n */\nexport type SchmancyInputInputEvent = CustomEvent<EventDetails>\nexport type SchmancyInputChangeEvent = CustomEvent<EventDetails>\nexport type SchmancyInputEnterEvent = CustomEvent<EventDetails>\n\n@customElement('schmancy-input')\nexport default class SchmancyInput extends TailwindElement() {\n\t// ----------------------------\n\t// A) Public properties\n\t// ----------------------------\n\n\t/** If user does NOT set `id`, we'll autogenerate one. */\n\tstatic _idCounter = 0\n\n\t@property({ reflect: true })\n\tpublic override id = ''\n\n\t/**\n\t * The label for the control. If populated, we render a `<label for=\"...\">`.\n\t * If empty, we add an `aria-label` to the <input> for better screenreader support.\n\t */\n\t@property({ type: String }) label = ''\n\n\t/**\n\t * The type of input. (e.g. 'text', 'password', 'email', etc.)\n\t */\n\t@property({ reflect: true })\n\tpublic type: HTMLInputElement['type'] = 'text'\n\n\t/**\n\t * Name attribute (for form submissions). By default, a unique fallback.\n\t */\n\t@property()\n\tpublic name = `name_${Date.now()}`\n\n\t@property()\n\tpublic placeholder = ''\n\n\t/** Current value of the input. */\n\t@property({ type: String, reflect: true })\n\tpublic value = ''\n\n\t/** Pattern validation attribute. */\n\t@property({ type: String, reflect: true })\n\tpublic pattern?: string\n\n\t/** Whether the control is required for form validation. */\n\t@property({ type: Boolean, reflect: true })\n\tpublic required = false\n\n\t/** Whether the control is disabled. */\n\t@property({ type: Boolean, reflect: true })\n\tpublic disabled = false\n\n\t/** Whether the input is read-only. */\n\t@property({ type: Boolean, reflect: true })\n\tpublic readonly = false\n\n\t/** If true, we visually show a pointer cursor even if readOnly. */\n\t@property({ type: Boolean, reflect: true }) public clickable = false\n\n\t/** Whether browser spellcheck is enabled. */\n\t@property({ type: Boolean, reflect: true })\n\tpublic spellcheck = false\n\n\t/**\n\t * Text alignment within the input.\n\t * - 'left' | 'center' | 'right'\n\t */\n\t@property({ type: String, reflect: true })\n\tpublic align: 'left' | 'center' | 'right' = 'left'\n\n\t/** inputmode attribute (affects on-screen keyboards in mobile). */\n\t@property()\n\tpublic inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'\n\n\t@property({ type: Number })\n\tpublic minlength?: number\n\n\t@property({ type: Number })\n\tpublic maxlength?: number\n\n\t@property()\n\tpublic min?: string\n\n\t@property()\n\tpublic max?: string\n\n\t@property({ type: Number, reflect: true })\n\tpublic step?: number\n\n\t/** If true, auto-focus this input on first render. */\n\t@property({ type: Boolean })\n\tpublic autofocus = false\n\n\t/** Autocomplete/autofill hints. */\n\t@property({ type: String })\n\tpublic autocomplete: AutoFill = 'on'\n\n\t/**\n\t * tabIndex for focusing by tab key. Typically 0 or -1.\n\t */\n\t@property({ type: Number, reflect: true })\n\tpublic tabIndex = 0\n\n\t/**\n\t * A small hint text or error message to display under the input.\n\t */\n\t@property()\n\tpublic hint?: string\n\n\t/**\n\t * If true, we style the input as an error state, and possibly display\n\t * the hint as an error message.\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic error = false\n\n\t// ----------------------------\n\t// B) Queries & Refs\n\t// ----------------------------\n\t@query('input') private inputElement!: HTMLInputElement\n\tprivate inputRef = createRef<HTMLInputElement>()\n\n\t// ----------------------------\n\t// C) Form-associated logic\n\t// ----------------------------\n\tstatic formAssociated = true\n\tprotected static shadowRootOptions = {\n\t\t...LitElement.shadowRootOptions,\n\t\tdelegatesFocus: true, // so focus() goes to <input>\n\t}\n\n\tprivate internals?: ElementInternals\n\n\tconstructor() {\n\t\tsuper()\n\t\tif ('attachInternals' in this) {\n\t\t\ttry {\n\t\t\t\tthis.internals = this.attachInternals()\n\t\t\t} catch {\n\t\t\t\t// no-op for older browsers / polyfills\n\t\t\t\tthis.internals = undefined\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * If user did not provide an ID, auto-generate one so <label for=\"...\">\n\t * and various aria-* attributes can reference it.\n\t */\n\tprotected override willUpdate(changedProps: PropertyValueMap<any> | Map<PropertyKey, unknown>) {\n\t\tif (!this.id) {\n\t\t\tthis.id = `schmancy-input-${SchmancyInput._idCounter++}`\n\t\t}\n\t\tsuper.willUpdate(changedProps)\n\t}\n\n\t/** The form this element is associated with, if any. */\n\tget form() {\n\t\treturn this.internals?.form ?? null\n\t}\n\n\tprotected override updated(changedProps: Map<string, unknown>) {\n\t\tsuper.updated(changedProps)\n\t\tif (changedProps.has('value')) {\n\t\t\t// Reflect the current value to the form internals, so it’s submitted.\n\t\t\tthis.internals?.setFormValue(this.value)\n\t\t}\n\n\t\tif (changedProps.has('error')) {\n\t\t\t// If we have an error state, we can set custom error validity, or none if resolved.\n\t\t\tif (this.error) {\n\t\t\t\tthis.internals?.setValidity({ customError: true }, 'Invalid input', this.inputElement)\n\t\t\t} else {\n\t\t\t\tthis.internals?.setValidity({})\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Native form methods:\n\t * - checkValidity()\n\t * - reportValidity()\n\t * - setCustomValidity()\n\t */\n\tpublic checkValidity() {\n\t\treturn this.inputRef.value?.checkValidity() ?? true\n\t}\n\tpublic reportValidity() {\n\t\treturn this.inputRef.value?.reportValidity() ?? true\n\t}\n\tpublic setCustomValidity(message: string) {\n\t\tthis.inputRef.value?.setCustomValidity(message)\n\t}\n\n\t// ----------------------------\n\t// D) Lifecycle Hooks\n\t// ----------------------------\n\tfirstUpdated() {\n\t\t// Autofocus if desired\n\t\tif (this.autofocus) {\n\t\t\tthis.focus()\n\t\t}\n\n\t\t// 1) Subscribe to 'input' events (every keystroke)\n\t\tfromEvent<InputEvent>(this.inputElement, 'input')\n\t\t\t.pipe(\n\t\t\t\tmap(ev => (ev.target as HTMLInputElement).value),\n\t\t\t\tdistinctUntilChanged(),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(value => {\n\t\t\t\tthis.value = value\n\t\t\t\t// Fire custom 'input' event with details\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('input', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t\t// dispatch change event\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('change', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\n\t\t// 2) Subscribe to 'change' events (native behavior, usually on blur)\n\t\tfromEvent<Event>(this.inputElement, 'change')\n\t\t\t.pipe(\n\t\t\t\tmap(ev => (ev.target as HTMLInputElement).value),\n\t\t\t\tdistinctUntilChanged(),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(value => {\n\t\t\t\tthis.value = value\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('change', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\n\t\t// 3) Emit a custom 'enter' event when user presses Enter\n\t\tfromEvent<KeyboardEvent>(this.inputElement, 'keyup')\n\t\t\t.pipe(\n\t\t\t\tfilter(ev => ev.key === 'Enter'),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(ev => {\n\t\t\t\tconst { value } = ev.target as HTMLInputElement\n\t\t\t\tthis.value = value\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('enter', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\n\t\t// 4) Detect autofill animation (Chrome, etc.)\n\t\tfromEvent<AnimationEvent>(this.inputElement, 'animationstart')\n\t\t\t.pipe(\n\t\t\t\tfilter(ev => ev.animationName === 'onAutoFillStart'),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(ev => {\n\t\t\t\tconst { value } = ev.target as HTMLInputElement\n\t\t\t\tthis.value = value\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('change', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\t}\n\n\t// ----------------------------\n\t// E) Utility Methods\n\t// ----------------------------\n\t/** Selects all text within the input. */\n\tpublic select() {\n\t\treturn this.inputRef.value?.select()\n\t}\n\n\t/** Returns the native validity state of the inner <input>. */\n\tpublic getValidity(): ValidityState | undefined {\n\t\treturn this.inputRef.value?.validity\n\t}\n\n\t/**\n\t * Override to forward focus to the internal <input>.\n\t * Also dispatch a 'focus' event for external listeners.\n\t */\n\tpublic override focus(options?: FocusOptions) {\n\t\tthis.inputRef.value?.focus(options)\n\t\tthis.dispatchEvent(new Event('focus'))\n\t}\n\n\t/**\n\t * Override to forward clicks to the internal <input>.\n\t * Also dispatch a 'click' event for external listeners.\n\t */\n\tpublic override click() {\n\t\tthis.inputRef.value?.click()\n\t\tthis.dispatchEvent(new Event('click'))\n\t}\n\n\t/** Forward blur to the internal <input>. */\n\tpublic override blur() {\n\t\tthis.inputRef.value?.blur()\n\t\tthis.dispatchEvent(new Event('blur'))\n\t}\n\n\t// ----------------------------\n\t// F) Rendering\n\t// ----------------------------\n\tprotected override render() {\n\t\tconst inputClasses = {\n\t\t\t'w-full flex-1 h-[50px] rounded-[8px] border-0 px-[8px] sm:px-[12px] md:px-[16px]': true,\n\t\t\t'outline-secondary-default focus:outline-1 ': true,\n\t\t\t'disabled:opacity-40 disabled:cursor-not-allowed': true,\n\t\t\t'placeholder:text-muted': true,\n\t\t\t'ring-0 ring-inset focus:ring-1 focus:ring-inset': true,\n\t\t\t// If not in error state, use standard ring color:\n\t\t\t'ring-secondary-default ring-outline focus:ring-secondary-default': !this.error,\n\t\t\t// Error ring override:\n\t\t\t'ring-error-default focus:ring-error-default': this.error,\n\t\t\t// If read-only but \"clickable\" is true, show pointer. Otherwise normal text cursor.\n\t\t\t'caret-transparent focus:outline-hidden cursor-pointer text-select-none': this.readonly,\n\t\t\t'cursor-pointer': this.clickable,\n\t\t\t// Alignment classes:\n\t\t\t'text-center': this.align === 'center',\n\t\t\t'text-right': this.align === 'right',\n\t\t}\n\n\t\tconst labelClasses = {\n\t\t\t'opacity-40': this.disabled,\n\t\t\t'block mb-[4px]': true,\n\t\t}\n\n\t\t/**\n\t\t * - If `this.label` is present, we render a proper `<label for=\"${this.id}\">`.\n\t\t * - If not, we add an aria-label to the <input> for better accessibility.\n\t\t * - If there's a `hint`, we reference it via aria-describedby.\n\t\t * - If there's an error, we set aria-invalid and could set aria-errormessage.\n\t\t */\n\t\treturn html`\n\t\t\t${when(\n\t\t\t\tthis.label,\n\t\t\t\t() => html`\n\t\t\t\t\t<label\n\t\t\t\t\t\tfor=${this.id}\n\t\t\t\t\t\tid=\"label-${this.id}\"\n\t\t\t\t\t\tclass=${classMap(labelClasses)}\n\t\t\t\t\t\t${color({\n\t\t\t\t\t\t\tcolor: this.error ? SchmancyTheme.sys.color.error.default : SchmancyTheme.sys.color.primary.default,\n\t\t\t\t\t\t})}\n\t\t\t\t\t>\n\t\t\t\t\t\t<schmancy-typography type=\"label\" token=\"lg\">${this.label}</schmancy-typography>\n\t\t\t\t\t</label>\n\t\t\t\t`,\n\t\t\t)}\n\n\t\t\t<form @submit=${(e: Event) => e.preventDefault()} .autocomplete=${this.autocomplete === 'off' ? 'off' : 'on'}>\n\t\t\t\t<input\n\t\t\t\t\t${color({\n\t\t\t\t\t\tbgColor: SchmancyTheme.sys.color.surface.highest,\n\t\t\t\t\t\tcolor: SchmancyTheme.sys.color.surface.on,\n\t\t\t\t\t})}\n\t\t\t\t\t${ref(this.inputRef)}\n\t\t\t\t\tid=${this.id}\n\t\t\t\t\tname=${this.name}\n\t\t\t\t\tclass=${classMap(inputClasses)}\n\t\t\t\t\t.value=${this.value}\n\t\t\t\t\t.type=${this.type}\n\t\t\t\t\t.autocomplete=${this.autocomplete}\n\t\t\t\t\t.spellcheck=${this.spellcheck}\n\t\t\t\t\tplaceholder=${this.placeholder}\n\t\t\t\t\tinputmode=${ifDefined(this.inputmode)}\n\t\t\t\t\tpattern=${ifDefined(this.pattern)}\n\t\t\t\t\tstep=${ifDefined(this.step)}\n\t\t\t\t\tminlength=${ifDefined(this.minlength)}\n\t\t\t\t\tmaxlength=${ifDefined(this.maxlength)}\n\t\t\t\t\tmin=${ifDefined(this.min)}\n\t\t\t\t\tmax=${ifDefined(this.max)}\n\t\t\t\t\t?required=${this.required}\n\t\t\t\t\t?disabled=${this.disabled}\n\t\t\t\t\t?readonly=${this.readonly}\n\t\t\t\t\taria-invalid=${this.error ? 'true' : 'false'}\n\t\t\t\t\taria-required=${this.required ? 'true' : 'false'}\n\t\t\t\t\taria-labelledby=${this.label ? `label-${this.id}` : nothing}\n\t\t\t\t\taria-describedby=${this.hint ? `hint-${this.id}` : nothing}\n\t\t\t\t\taria-label=${ifDefined(!this.label ? this.placeholder || 'Input' : undefined)}\n\t\t\t\t/>\n\t\t\t</form>\n\n\t\t\t${when(\n\t\t\t\tthis.hint,\n\t\t\t\t() => html`\n\t\t\t\t\t<div\n\t\t\t\t\t\tid=\"hint-${this.id}\"\n\t\t\t\t\t\tclass=\"pt-[4px]\"\n\t\t\t\t\t\t${color({\n\t\t\t\t\t\t\tcolor: this.error ? SchmancyTheme.sys.color.error.default : SchmancyTheme.sys.color.primary.default,\n\t\t\t\t\t\t})}\n\t\t\t\t\t>\n\t\t\t\t\t\t<schmancy-typography align=\"left\" type=\"body\" token=\"sm\"> ${this.hint} </schmancy-typography>\n\t\t\t\t\t</div>\n\t\t\t\t`,\n\t\t\t)}\n\t\t`\n\t}\n}\n"],"names":["SchmancyInput","TailwindElement","super","this","id","label","type","name","Date","now","placeholder","value","required","disabled","readonly","clickable","spellcheck","align","autofocus","autocomplete","tabIndex","error","inputRef","createRef","internals","attachInternals","undefined","changedProps","_idCounter","willUpdate","form","updated","has","setFormValue","setValidity","customError","inputElement","checkValidity","reportValidity","message","setCustomValidity","focus","fromEvent","pipe","map","ev","target","distinctUntilChanged","takeUntil","disconnecting","subscribe","dispatchEvent","CustomEvent","detail","bubbles","composed","filter","key","animationName","select","validity","options","Event","click","blur","render","inputClasses","labelClasses","html","when","classMap","color","SchmancyTheme","sys","default","primary","e","preventDefault","bgColor","surface","highest","on","ref","ifDefined","inputmode","pattern","step","minlength","maxlength","min","max","nothing","hint","formAssociated","shadowRootOptions","LitElement","delegatesFocus","__decorateClass","property","reflect","prototype","String","Boolean","Number","query","customElement"],"mappings":"slBAoCA,IAAqBA,EAArB,cAA2CC,EAAAA,gBAiI1C,CAAA,CAAA,aAEC,CAAA,GADMC,MAzHPC,EAAAA,KAAgBC,GAAK,GAMeD,KAAAE,MAAA,GAMpCF,KAAOG,KAAiC,OAMxCH,KAAOI,KAAO,QAAQC,KAAKC,IAG3BN,CAAAA,GAAAA,KAAOO,YAAc,GAIrBP,KAAOQ,MAAQ,GAQfR,KAAOS,SAAW,GAIlBT,KAAOU,SAAAA,GAIPV,KAAOW,SAAW,GAG0BX,KAAOY,UAAY,GAI/DZ,KAAOa,WAAAA,GAOPb,KAAOc,MAAqC,OAuB5Cd,KAAOe,UAAAA,GAIPf,KAAOgB,aAAyB,KAMhChB,KAAOiB,SAAW,EAalBjB,KAAOkB,MAAQ,GAMflB,KAAQmB,SAAWC,cAed,oBAAqBpB,KACpB,GACEA,CAAAA,KAAAqB,UAAYrB,KAAKsB,gBAAgB,CAAA,MAGtCtB,CAAAA,KAAKqB,UAAYE,MAAA,CAEnB,CAOkB,WAAWC,EACxBxB,CAAAA,KAAKC,KACJD,KAAAC,GAAK,kBAAkBJ,EAAc4B,cAE3C1B,MAAM2B,WAAWF,CAAY,CAAA,CAI9B,IAAIG,MAAAA,OACI,QAAA3B,EAAAA,KAAKqB,YAALrB,YAAAA,EAAgB2B,OAAQ,IAAA,CAGb,QAA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AQJ,QAAS,EAAA,CAAA,CAAA,EAhGfnG,EAiGboG,UAAA,WAAA,CAMAH,EAAAA,EAAA,CADNC,EAASA,SAtGUlG,CAAAA,EAAAA,EAuGboG,UAAA,OAAA,CAAA,EAOAH,EAAA,CADNC,EAAAA,SAAS,CAAE5F,KAAMgG,QAASH,UA7GPnG,CAAAA,CAAAA,EAAAA,EA8GboG,UAAA,QAAA,CAKiBH,EAAAA,EAAA,CAAvBO,EAAAA,MAAM,OAnHaxG,CAAAA,EAAAA,EAmHIoG,UAAA,eAAA,GAnHJpG,EAArBiG,EAAA,CADCQ,EAAAA,cAAc,gBACMzG,CAAAA,EAAAA,CAAAA"}
@@ -15,7 +15,7 @@ var q = Object.defineProperty, B = Object.getOwnPropertyDescriptor, i = (t, r, o
15
15
  };
16
16
  let e = class extends V() {
17
17
  constructor() {
18
- if (super(), this.id = "", this.label = "", this.type = "text", this.name = `name_${Date.now()}`, this.placeholder = "", this.value = "", this.required = !1, this.disabled = !1, this.readonly = !1, this.clickable = !1, this.spellcheck = !1, this.align = "left", this.autofocus = !1, this.autocomplete = "off", this.tabIndex = 0, this.error = !1, this.inputRef = R(), "attachInternals" in this) try {
18
+ if (super(), this.id = "", this.label = "", this.type = "text", this.name = `name_${Date.now()}`, this.placeholder = "", this.value = "", this.required = !1, this.disabled = !1, this.readonly = !1, this.clickable = !1, this.spellcheck = !1, this.align = "left", this.autofocus = !1, this.autocomplete = "on", this.tabIndex = 0, this.error = !1, this.inputRef = R(), "attachInternals" in this) try {
19
19
  this.internals = this.attachInternals();
20
20
  } catch {
21
21
  this.internals = void 0;
@@ -134,4 +134,4 @@ let e = class extends V() {
134
134
  }
135
135
  };
136
136
  e._idCounter = 0, e.formAssociated = !0, e.shadowRootOptions = { ...x.shadowRootOptions, delegatesFocus: !0 }, i([s({ reflect: !0 })], e.prototype, "id", 2), i([s({ type: String })], e.prototype, "label", 2), i([s({ reflect: !0 })], e.prototype, "type", 2), i([s()], e.prototype, "name", 2), i([s()], e.prototype, "placeholder", 2), i([s({ type: String, reflect: !0 })], e.prototype, "value", 2), i([s({ type: String, reflect: !0 })], e.prototype, "pattern", 2), i([s({ type: Boolean, reflect: !0 })], e.prototype, "required", 2), i([s({ type: Boolean, reflect: !0 })], e.prototype, "disabled", 2), i([s({ type: Boolean, reflect: !0 })], e.prototype, "readonly", 2), i([s({ type: Boolean, reflect: !0 })], e.prototype, "clickable", 2), i([s({ type: Boolean, reflect: !0 })], e.prototype, "spellcheck", 2), i([s({ type: String, reflect: !0 })], e.prototype, "align", 2), i([s()], e.prototype, "inputmode", 2), i([s({ type: Number })], e.prototype, "minlength", 2), i([s({ type: Number })], e.prototype, "maxlength", 2), i([s()], e.prototype, "min", 2), i([s()], e.prototype, "max", 2), i([s({ type: Number, reflect: !0 })], e.prototype, "step", 2), i([s({ type: Boolean })], e.prototype, "autofocus", 2), i([s({ type: String })], e.prototype, "autocomplete", 2), i([s({ type: Number, reflect: !0 })], e.prototype, "tabIndex", 2), i([s()], e.prototype, "hint", 2), i([s({ type: Boolean, reflect: !0 })], e.prototype, "error", 2), i([k("input")], e.prototype, "inputElement", 2), e = i([w("schmancy-input")], e);
137
- //# sourceMappingURL=input-BAg8B5xw.js.map
137
+ //# sourceMappingURL=input-D_30_4Cf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-D_30_4Cf.js","sources":["../src/input/input.ts"],"sourcesContent":["import { html, LitElement, nothing, PropertyValueMap } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { createRef, ref } from 'lit/directives/ref.js'\nimport { when } from 'lit/directives/when.js'\nimport { distinctUntilChanged, filter, fromEvent, map, takeUntil } from 'rxjs'\n\nimport { TailwindElement } from '@mixins/index'\n\n// color directive + theme interface\nimport { color } from '@schmancy/directives'\nimport { SchmancyTheme } from '@schmancy/theme/theme.interface'\n\n// If you want to be form-associated, define the type on `ElementInternals`.\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-input': SchmancyInput\n\t}\n}\n\ntype EventDetails = {\n\tvalue: string\n}\n\n/**\n * Custom events the component may emit:\n * - 'input': on every keystroke\n * - 'change': on native blur/change\n * - 'enter': specifically when user presses Enter\n */\nexport type SchmancyInputInputEvent = CustomEvent<EventDetails>\nexport type SchmancyInputChangeEvent = CustomEvent<EventDetails>\nexport type SchmancyInputEnterEvent = CustomEvent<EventDetails>\n\n@customElement('schmancy-input')\nexport default class SchmancyInput extends TailwindElement() {\n\t// ----------------------------\n\t// A) Public properties\n\t// ----------------------------\n\n\t/** If user does NOT set `id`, we'll autogenerate one. */\n\tstatic _idCounter = 0\n\n\t@property({ reflect: true })\n\tpublic override id = ''\n\n\t/**\n\t * The label for the control. If populated, we render a `<label for=\"...\">`.\n\t * If empty, we add an `aria-label` to the <input> for better screenreader support.\n\t */\n\t@property({ type: String }) label = ''\n\n\t/**\n\t * The type of input. (e.g. 'text', 'password', 'email', etc.)\n\t */\n\t@property({ reflect: true })\n\tpublic type: HTMLInputElement['type'] = 'text'\n\n\t/**\n\t * Name attribute (for form submissions). By default, a unique fallback.\n\t */\n\t@property()\n\tpublic name = `name_${Date.now()}`\n\n\t@property()\n\tpublic placeholder = ''\n\n\t/** Current value of the input. */\n\t@property({ type: String, reflect: true })\n\tpublic value = ''\n\n\t/** Pattern validation attribute. */\n\t@property({ type: String, reflect: true })\n\tpublic pattern?: string\n\n\t/** Whether the control is required for form validation. */\n\t@property({ type: Boolean, reflect: true })\n\tpublic required = false\n\n\t/** Whether the control is disabled. */\n\t@property({ type: Boolean, reflect: true })\n\tpublic disabled = false\n\n\t/** Whether the input is read-only. */\n\t@property({ type: Boolean, reflect: true })\n\tpublic readonly = false\n\n\t/** If true, we visually show a pointer cursor even if readOnly. */\n\t@property({ type: Boolean, reflect: true }) public clickable = false\n\n\t/** Whether browser spellcheck is enabled. */\n\t@property({ type: Boolean, reflect: true })\n\tpublic spellcheck = false\n\n\t/**\n\t * Text alignment within the input.\n\t * - 'left' | 'center' | 'right'\n\t */\n\t@property({ type: String, reflect: true })\n\tpublic align: 'left' | 'center' | 'right' = 'left'\n\n\t/** inputmode attribute (affects on-screen keyboards in mobile). */\n\t@property()\n\tpublic inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'\n\n\t@property({ type: Number })\n\tpublic minlength?: number\n\n\t@property({ type: Number })\n\tpublic maxlength?: number\n\n\t@property()\n\tpublic min?: string\n\n\t@property()\n\tpublic max?: string\n\n\t@property({ type: Number, reflect: true })\n\tpublic step?: number\n\n\t/** If true, auto-focus this input on first render. */\n\t@property({ type: Boolean })\n\tpublic autofocus = false\n\n\t/** Autocomplete/autofill hints. */\n\t@property({ type: String })\n\tpublic autocomplete: AutoFill = 'on'\n\n\t/**\n\t * tabIndex for focusing by tab key. Typically 0 or -1.\n\t */\n\t@property({ type: Number, reflect: true })\n\tpublic tabIndex = 0\n\n\t/**\n\t * A small hint text or error message to display under the input.\n\t */\n\t@property()\n\tpublic hint?: string\n\n\t/**\n\t * If true, we style the input as an error state, and possibly display\n\t * the hint as an error message.\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic error = false\n\n\t// ----------------------------\n\t// B) Queries & Refs\n\t// ----------------------------\n\t@query('input') private inputElement!: HTMLInputElement\n\tprivate inputRef = createRef<HTMLInputElement>()\n\n\t// ----------------------------\n\t// C) Form-associated logic\n\t// ----------------------------\n\tstatic formAssociated = true\n\tprotected static shadowRootOptions = {\n\t\t...LitElement.shadowRootOptions,\n\t\tdelegatesFocus: true, // so focus() goes to <input>\n\t}\n\n\tprivate internals?: ElementInternals\n\n\tconstructor() {\n\t\tsuper()\n\t\tif ('attachInternals' in this) {\n\t\t\ttry {\n\t\t\t\tthis.internals = this.attachInternals()\n\t\t\t} catch {\n\t\t\t\t// no-op for older browsers / polyfills\n\t\t\t\tthis.internals = undefined\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * If user did not provide an ID, auto-generate one so <label for=\"...\">\n\t * and various aria-* attributes can reference it.\n\t */\n\tprotected override willUpdate(changedProps: PropertyValueMap<any> | Map<PropertyKey, unknown>) {\n\t\tif (!this.id) {\n\t\t\tthis.id = `schmancy-input-${SchmancyInput._idCounter++}`\n\t\t}\n\t\tsuper.willUpdate(changedProps)\n\t}\n\n\t/** The form this element is associated with, if any. */\n\tget form() {\n\t\treturn this.internals?.form ?? null\n\t}\n\n\tprotected override updated(changedProps: Map<string, unknown>) {\n\t\tsuper.updated(changedProps)\n\t\tif (changedProps.has('value')) {\n\t\t\t// Reflect the current value to the form internals, so it’s submitted.\n\t\t\tthis.internals?.setFormValue(this.value)\n\t\t}\n\n\t\tif (changedProps.has('error')) {\n\t\t\t// If we have an error state, we can set custom error validity, or none if resolved.\n\t\t\tif (this.error) {\n\t\t\t\tthis.internals?.setValidity({ customError: true }, 'Invalid input', this.inputElement)\n\t\t\t} else {\n\t\t\t\tthis.internals?.setValidity({})\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Native form methods:\n\t * - checkValidity()\n\t * - reportValidity()\n\t * - setCustomValidity()\n\t */\n\tpublic checkValidity() {\n\t\treturn this.inputRef.value?.checkValidity() ?? true\n\t}\n\tpublic reportValidity() {\n\t\treturn this.inputRef.value?.reportValidity() ?? true\n\t}\n\tpublic setCustomValidity(message: string) {\n\t\tthis.inputRef.value?.setCustomValidity(message)\n\t}\n\n\t// ----------------------------\n\t// D) Lifecycle Hooks\n\t// ----------------------------\n\tfirstUpdated() {\n\t\t// Autofocus if desired\n\t\tif (this.autofocus) {\n\t\t\tthis.focus()\n\t\t}\n\n\t\t// 1) Subscribe to 'input' events (every keystroke)\n\t\tfromEvent<InputEvent>(this.inputElement, 'input')\n\t\t\t.pipe(\n\t\t\t\tmap(ev => (ev.target as HTMLInputElement).value),\n\t\t\t\tdistinctUntilChanged(),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(value => {\n\t\t\t\tthis.value = value\n\t\t\t\t// Fire custom 'input' event with details\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('input', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t\t// dispatch change event\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('change', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\n\t\t// 2) Subscribe to 'change' events (native behavior, usually on blur)\n\t\tfromEvent<Event>(this.inputElement, 'change')\n\t\t\t.pipe(\n\t\t\t\tmap(ev => (ev.target as HTMLInputElement).value),\n\t\t\t\tdistinctUntilChanged(),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(value => {\n\t\t\t\tthis.value = value\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('change', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\n\t\t// 3) Emit a custom 'enter' event when user presses Enter\n\t\tfromEvent<KeyboardEvent>(this.inputElement, 'keyup')\n\t\t\t.pipe(\n\t\t\t\tfilter(ev => ev.key === 'Enter'),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(ev => {\n\t\t\t\tconst { value } = ev.target as HTMLInputElement\n\t\t\t\tthis.value = value\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('enter', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\n\t\t// 4) Detect autofill animation (Chrome, etc.)\n\t\tfromEvent<AnimationEvent>(this.inputElement, 'animationstart')\n\t\t\t.pipe(\n\t\t\t\tfilter(ev => ev.animationName === 'onAutoFillStart'),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(ev => {\n\t\t\t\tconst { value } = ev.target as HTMLInputElement\n\t\t\t\tthis.value = value\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent<EventDetails>('change', {\n\t\t\t\t\t\tdetail: { value },\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t})\n\t}\n\n\t// ----------------------------\n\t// E) Utility Methods\n\t// ----------------------------\n\t/** Selects all text within the input. */\n\tpublic select() {\n\t\treturn this.inputRef.value?.select()\n\t}\n\n\t/** Returns the native validity state of the inner <input>. */\n\tpublic getValidity(): ValidityState | undefined {\n\t\treturn this.inputRef.value?.validity\n\t}\n\n\t/**\n\t * Override to forward focus to the internal <input>.\n\t * Also dispatch a 'focus' event for external listeners.\n\t */\n\tpublic override focus(options?: FocusOptions) {\n\t\tthis.inputRef.value?.focus(options)\n\t\tthis.dispatchEvent(new Event('focus'))\n\t}\n\n\t/**\n\t * Override to forward clicks to the internal <input>.\n\t * Also dispatch a 'click' event for external listeners.\n\t */\n\tpublic override click() {\n\t\tthis.inputRef.value?.click()\n\t\tthis.dispatchEvent(new Event('click'))\n\t}\n\n\t/** Forward blur to the internal <input>. */\n\tpublic override blur() {\n\t\tthis.inputRef.value?.blur()\n\t\tthis.dispatchEvent(new Event('blur'))\n\t}\n\n\t// ----------------------------\n\t// F) Rendering\n\t// ----------------------------\n\tprotected override render() {\n\t\tconst inputClasses = {\n\t\t\t'w-full flex-1 h-[50px] rounded-[8px] border-0 px-[8px] sm:px-[12px] md:px-[16px]': true,\n\t\t\t'outline-secondary-default focus:outline-1 ': true,\n\t\t\t'disabled:opacity-40 disabled:cursor-not-allowed': true,\n\t\t\t'placeholder:text-muted': true,\n\t\t\t'ring-0 ring-inset focus:ring-1 focus:ring-inset': true,\n\t\t\t// If not in error state, use standard ring color:\n\t\t\t'ring-secondary-default ring-outline focus:ring-secondary-default': !this.error,\n\t\t\t// Error ring override:\n\t\t\t'ring-error-default focus:ring-error-default': this.error,\n\t\t\t// If read-only but \"clickable\" is true, show pointer. Otherwise normal text cursor.\n\t\t\t'caret-transparent focus:outline-hidden cursor-pointer text-select-none': this.readonly,\n\t\t\t'cursor-pointer': this.clickable,\n\t\t\t// Alignment classes:\n\t\t\t'text-center': this.align === 'center',\n\t\t\t'text-right': this.align === 'right',\n\t\t}\n\n\t\tconst labelClasses = {\n\t\t\t'opacity-40': this.disabled,\n\t\t\t'block mb-[4px]': true,\n\t\t}\n\n\t\t/**\n\t\t * - If `this.label` is present, we render a proper `<label for=\"${this.id}\">`.\n\t\t * - If not, we add an aria-label to the <input> for better accessibility.\n\t\t * - If there's a `hint`, we reference it via aria-describedby.\n\t\t * - If there's an error, we set aria-invalid and could set aria-errormessage.\n\t\t */\n\t\treturn html`\n\t\t\t${when(\n\t\t\t\tthis.label,\n\t\t\t\t() => html`\n\t\t\t\t\t<label\n\t\t\t\t\t\tfor=${this.id}\n\t\t\t\t\t\tid=\"label-${this.id}\"\n\t\t\t\t\t\tclass=${classMap(labelClasses)}\n\t\t\t\t\t\t${color({\n\t\t\t\t\t\t\tcolor: this.error ? SchmancyTheme.sys.color.error.default : SchmancyTheme.sys.color.primary.default,\n\t\t\t\t\t\t})}\n\t\t\t\t\t>\n\t\t\t\t\t\t<schmancy-typography type=\"label\" token=\"lg\">${this.label}</schmancy-typography>\n\t\t\t\t\t</label>\n\t\t\t\t`,\n\t\t\t)}\n\n\t\t\t<form @submit=${(e: Event) => e.preventDefault()} .autocomplete=${this.autocomplete === 'off' ? 'off' : 'on'}>\n\t\t\t\t<input\n\t\t\t\t\t${color({\n\t\t\t\t\t\tbgColor: SchmancyTheme.sys.color.surface.highest,\n\t\t\t\t\t\tcolor: SchmancyTheme.sys.color.surface.on,\n\t\t\t\t\t})}\n\t\t\t\t\t${ref(this.inputRef)}\n\t\t\t\t\tid=${this.id}\n\t\t\t\t\tname=${this.name}\n\t\t\t\t\tclass=${classMap(inputClasses)}\n\t\t\t\t\t.value=${this.value}\n\t\t\t\t\t.type=${this.type}\n\t\t\t\t\t.autocomplete=${this.autocomplete}\n\t\t\t\t\t.spellcheck=${this.spellcheck}\n\t\t\t\t\tplaceholder=${this.placeholder}\n\t\t\t\t\tinputmode=${ifDefined(this.inputmode)}\n\t\t\t\t\tpattern=${ifDefined(this.pattern)}\n\t\t\t\t\tstep=${ifDefined(this.step)}\n\t\t\t\t\tminlength=${ifDefined(this.minlength)}\n\t\t\t\t\tmaxlength=${ifDefined(this.maxlength)}\n\t\t\t\t\tmin=${ifDefined(this.min)}\n\t\t\t\t\tmax=${ifDefined(this.max)}\n\t\t\t\t\t?required=${this.required}\n\t\t\t\t\t?disabled=${this.disabled}\n\t\t\t\t\t?readonly=${this.readonly}\n\t\t\t\t\taria-invalid=${this.error ? 'true' : 'false'}\n\t\t\t\t\taria-required=${this.required ? 'true' : 'false'}\n\t\t\t\t\taria-labelledby=${this.label ? `label-${this.id}` : nothing}\n\t\t\t\t\taria-describedby=${this.hint ? `hint-${this.id}` : nothing}\n\t\t\t\t\taria-label=${ifDefined(!this.label ? this.placeholder || 'Input' : undefined)}\n\t\t\t\t/>\n\t\t\t</form>\n\n\t\t\t${when(\n\t\t\t\tthis.hint,\n\t\t\t\t() => html`\n\t\t\t\t\t<div\n\t\t\t\t\t\tid=\"hint-${this.id}\"\n\t\t\t\t\t\tclass=\"pt-[4px]\"\n\t\t\t\t\t\t${color({\n\t\t\t\t\t\t\tcolor: this.error ? SchmancyTheme.sys.color.error.default : SchmancyTheme.sys.color.primary.default,\n\t\t\t\t\t\t})}\n\t\t\t\t\t>\n\t\t\t\t\t\t<schmancy-typography align=\"left\" type=\"body\" token=\"sm\"> ${this.hint} </schmancy-typography>\n\t\t\t\t\t</div>\n\t\t\t\t`,\n\t\t\t)}\n\t\t`\n\t}\n}\n"],"names":["SchmancyInput","TailwindElement","super","this","id","label","type","name","Date","now","placeholder","value","required","disabled","readonly","clickable","spellcheck","align","autofocus","autocomplete","tabIndex","error","inputRef","createRef","internals","attachInternals","changedProps","_idCounter","willUpdate","form","updated","has","setFormValue","setValidity","customError","inputElement","checkValidity","reportValidity","message","setCustomValidity","firstUpdated","focus","fromEvent","pipe","map","ev","target","distinctUntilChanged","takeUntil","disconnecting","subscribe","dispatchEvent","CustomEvent","detail","bubbles","composed","filter","key","animationName","select","getValidity","validity","options","Event","click","blur","inputClasses","labelClasses","html","when","classMap","color","SchmancyTheme","sys","default","primary","e","preventDefault","bgColor","surface","highest","on","ref","ifDefined","inputmode","pattern","step","minlength","maxlength","min","max","nothing","hint","formAssociated","shadowRootOptions","LitElement","delegatesFocus","__decorateClass","property","reflect","prototype","String","Boolean","Number","query","customElement"],"mappings":";;;;;;;;;;;;;;;AAoCA,IAAqBA,IAArB,cAA2CC,EAiI1C,EAAA;AAAA,EAAA,cAEC;AAAA,QADMC,MAzHPC,GAAAA,KAAgBC,KAAK,IAMeD,KAAAE,QAAA,IAMpCF,KAAOG,OAAiC,QAMxCH,KAAOI,OAAO,QAAQC,KAAKC,IAG3BN,CAAAA,IAAAA,KAAOO,cAAc,IAIrBP,KAAOQ,QAAQ,IAQfR,KAAOS,WAAW,IAIlBT,KAAOU,WAAAA,IAIPV,KAAOW,WAAW,IAG0BX,KAAOY,YAAAA,IAInDZ,KAAOa,iBAOPb,KAAOc,QAAqC,QAuB5Cd,KAAOe,YAAAA,IAIPf,KAAOgB,eAAyB,MAMhChB,KAAOiB,WAAW,GAalBjB,KAAOkB,QAAQ,IAMflB,KAAQmB,WAAWC,EAed,GAAA,qBAAqBpB,KACpB,KAAA;AACEA,WAAAqB,YAAYrB,KAAKsB,gBAAA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A,CAAAA,CAAAA,GAtFEtG,EAuFboG,WAAA,aAAA,CAAA,GAIAH,EAAA,CADNC,EAAS,EAAE5F,MAAM+F,OA1FErG,CAAAA,CAAAA,GAAAA,EA2FboG,WAAA,gBAAA,CAMAH,GAAAA,EAAA,CADNC,EAAS,EAAE5F,MAAMiG,QAAQJ,SAAAA,QAhGNnG,EAiGboG,WAAA,YAAA,CAAA,GAMAH,EAAA,CADNC,EAtGmBlG,CAAAA,GAAAA,EAuGboG,WAAA,QAAA,CAOAH,GAAAA,EAAA,CADNC,EAAS,EAAE5F,MAAMgG,SAASH,SAAS,GAAA,CAAA,CAAA,GA7GhBnG,EA8GboG,WAAA,SAAA,CAAA,GAKiBH,EAAA,CAAvBO,EAAM,OAnHaxG,CAAAA,GAAAA,EAmHIoG,WAAA,gBAAA,CAnHJpG,GAAAA,IAArBiG,EAAA,CADCQ,EAAc,gBACMzG,CAAAA,GAAAA,CAAAA;"}
package/dist/input.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";require("./input-DoURQ3xM.cjs");
1
+ "use strict";require("./input-BrLbi5wu.cjs");
2
2
  //# sourceMappingURL=input.cjs.map
package/dist/input.js CHANGED
@@ -1,2 +1,2 @@
1
- import "./input-BAg8B5xw.js";
1
+ import "./input-D_30_4Cf.js";
2
2
  //# sourceMappingURL=input.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./teleport.component-CxVVjMy6.cjs");exports.$drawer=e.$drawer,Object.defineProperty(exports,"SchmancyDrawerAppbar",{enumerable:!0,get:()=>e.SchmancyDrawerAppbar}),exports.SchmancyDrawerNavbarMode=e.SchmancyDrawerNavbarMode,exports.SchmancyDrawerNavbarState=e.SchmancyDrawerNavbarState,Object.defineProperty(exports,"SchmancyNavigationDrawer",{enumerable:!0,get:()=>e.SchmancyNavigationDrawer}),Object.defineProperty(exports,"SchmancyNavigationDrawerContent",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerContent}),Object.defineProperty(exports,"SchmancyNavigationDrawerSidebar",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerSidebar}),exports.schmancyNavDrawer=e.schmancyNavDrawer;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./teleport.component-BU8VUQ9X.cjs");exports.$drawer=e.$drawer,Object.defineProperty(exports,"SchmancyDrawerAppbar",{enumerable:!0,get:()=>e.SchmancyDrawerAppbar}),exports.SchmancyDrawerNavbarMode=e.SchmancyDrawerNavbarMode,exports.SchmancyDrawerNavbarState=e.SchmancyDrawerNavbarState,Object.defineProperty(exports,"SchmancyNavigationDrawer",{enumerable:!0,get:()=>e.SchmancyNavigationDrawer}),Object.defineProperty(exports,"SchmancyNavigationDrawerContent",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerContent}),Object.defineProperty(exports,"SchmancyNavigationDrawerSidebar",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerSidebar}),exports.schmancyNavDrawer=e.schmancyNavDrawer;
2
2
  //# sourceMappingURL=nav-drawer.cjs.map
@@ -1,4 +1,4 @@
1
- import { $ as c, i as e, k as n, l as m, m as s, j as h, n as i, h as t } from "./teleport.component-DOIs9diZ.js";
1
+ import { $ as c, i as e, k as n, l as m, m as s, j as h, n as i, h as t } from "./teleport.component-CQ-n025U.js";
2
2
  export {
3
3
  c as $drawer,
4
4
  e as SchmancyDrawerAppbar,
@@ -12,6 +12,7 @@
12
12
  `){constructor(){super(...arguments),this.required=!1,this.placeholder="",this.value="",this.selectedValues=[],this.multi=!1,this.label="",this.isOpen=!1,this.valueLabel=""}connectedCallback(){super.connectedCallback(),this.id||(this.id=`schmancy-select-${Math.random().toString(36).substr(2,9)}`),this.addEventListener("keydown",this.handleKeyDown)}disconnectedCallback(){var e;super.disconnectedCallback(),this.removeEventListener("keydown",this.handleKeyDown),(e=this.cleanupPositioner)==null||e.call(this)}firstUpdated(){this.syncSelection(),this.setupOptionsAccessibility()}syncSelection(){if(this.multi)this.selectedValues=this.options.filter(e=>e.selected).map(e=>e.value),this.valueLabel=this.selectedValues.length>0?this.options.filter(e=>this.selectedValues.includes(e.value)).map(e=>e.label).join(", "):this.placeholder;else{const e=this.options.find(t=>t.value===this.value);this.valueLabel=(e==null?void 0:e.label)||this.placeholder}}setupOptionsAccessibility(){this.options.forEach((e,t)=>{e.setAttribute("role","option"),e.id||(e.id=`${this.id}-option-${t}`),e.tabIndex=-1,e.setAttribute("aria-selected",String(this.multi?this.selectedValues.includes(e.value):e.value===this.value))})}async positionDropdown(){const e=this.renderRoot.querySelector(".trigger");e&&this.ul&&(this.cleanupPositioner=a.autoUpdate(e,this.ul,async()=>{const{x:t,y:s}=await a.computePosition(e,this.ul,{placement:"bottom-start",middleware:[a.offset(5),a.flip(),a.shift({padding:5})]});Object.assign(this.ul.style,{left:`${t}px`,top:`${s}px`,position:"absolute"})}))}handleKeyDown(e){if(!this.isOpen)return void(["Enter"," ","ArrowDown"].includes(e.key)&&(e.preventDefault(),this.openDropdown()));const t=this.options.findIndex(s=>s.matches(":focus"))??-1;switch(e.key){case"Escape":case"Tab":this.closeDropdown();break;case"ArrowDown":e.preventDefault(),this.focusOption(this.options,Math.min(t+1,this.options.length-1));break;case"ArrowUp":e.preventDefault(),this.focusOption(this.options,Math.max(t-1,0));break;case"Enter":case" ":e.preventDefault(),t>=0&&this.handleOptionSelect(this.options[t].value)}}focusOption(e,t){const s=e[t];if(s){s.focus();const i=this.renderRoot.querySelector(".trigger");i==null||i.setAttribute("aria-activedescendant",s.id)}}async openDropdown(){this.isOpen=!0,await this.updateComplete,this.positionDropdown(),this.setupOptionsAccessibility();const e=Array.from(this.ul.querySelectorAll('[role="option"]')),t=this.multi?0:e.findIndex(s=>s.getAttribute("value")===this.value);this.focusOption(e,Math.max(t,0))}closeDropdown(){var t;this.isOpen=!1,(t=this.cleanupPositioner)==null||t.call(this);const e=this.renderRoot.querySelector(".trigger");e==null||e.removeAttribute("aria-activedescendant"),e==null||e.focus()}handleOptionSelect(e){var t;if(this.multi){const s=this.options.find(i=>i.value===e);if(!s)return;s.selected=!s.selected,s.selected?this.selectedValues=[...this.selectedValues,e]:this.selectedValues=this.selectedValues.filter(i=>i!==e),this.valueLabel=this.selectedValues.length>0?this.options.filter(i=>this.selectedValues.includes(i.value)).map(i=>i.label).join(", "):this.placeholder,this.dispatchChange(this.selectedValues)}else this.options.forEach(s=>s.selected=s.value===e),this.value=e,this.valueLabel=((t=this.options.find(s=>s.value===e))==null?void 0:t.label)||this.placeholder,this.dispatchChange(e),this.closeDropdown();this.setupOptionsAccessibility()}dispatchChange(e){this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0}))}render(){return h.html`
13
13
  <div class="relative">
14
14
  <schmancy-input
15
+ .name=${this.name}
15
16
  tabIndex="0"
16
17
  class="trigger"
17
18
  role="combobox"
@@ -50,5 +51,5 @@
50
51
  ></slot>
51
52
  </ul>
52
53
  </div>
53
- `}},l([o.property({type:Boolean})],exports.SchmancySelect.prototype,"required",2),l([o.property({type:String})],exports.SchmancySelect.prototype,"placeholder",2),l([o.property({type:String})],exports.SchmancySelect.prototype,"value",2),l([o.property({type:Array})],exports.SchmancySelect.prototype,"selectedValues",2),l([o.property({type:Boolean})],exports.SchmancySelect.prototype,"multi",2),l([o.property({type:String})],exports.SchmancySelect.prototype,"label",2),l([o.state()],exports.SchmancySelect.prototype,"isOpen",2),l([o.state()],exports.SchmancySelect.prototype,"valueLabel",2),l([o.query("ul")],exports.SchmancySelect.prototype,"ul",2),l([o.queryAssignedElements({flatten:!0})],exports.SchmancySelect.prototype,"options",2),exports.SchmancySelect=l([o.customElement("schmancy-select")],exports.SchmancySelect);
54
- //# sourceMappingURL=select-DLZUW_cj.cjs.map
54
+ `}},l([o.property({type:String})],exports.SchmancySelect.prototype,"name",2),l([o.property({type:Boolean})],exports.SchmancySelect.prototype,"required",2),l([o.property({type:String})],exports.SchmancySelect.prototype,"placeholder",2),l([o.property({type:String})],exports.SchmancySelect.prototype,"value",2),l([o.property({type:Array})],exports.SchmancySelect.prototype,"selectedValues",2),l([o.property({type:Boolean})],exports.SchmancySelect.prototype,"multi",2),l([o.property({type:String})],exports.SchmancySelect.prototype,"label",2),l([o.state()],exports.SchmancySelect.prototype,"isOpen",2),l([o.state()],exports.SchmancySelect.prototype,"valueLabel",2),l([o.query("ul")],exports.SchmancySelect.prototype,"ul",2),l([o.queryAssignedElements({flatten:!0})],exports.SchmancySelect.prototype,"options",2),exports.SchmancySelect=l([o.customElement("schmancy-select")],exports.SchmancySelect);
55
+ //# sourceMappingURL=select-B_G2xt3n.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select-B_G2xt3n.cjs","sources":["../src/select/select.ts"],"sourcesContent":["import { autoUpdate, computePosition, flip, offset, shift } from '@floating-ui/dom'\nimport { $LitElement } from '@mixins/index'\nimport { color } from '@schmancy/directives'\nimport SchmancyOption from '@schmancy/option/option'\nimport { SchmancyTheme } from '@schmancy/theme/theme.interface'\nimport { css, html } from 'lit'\nimport { customElement, property, query, queryAssignedElements, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\n\nexport type SchmancySelectChangeEvent = CustomEvent<{\n\tvalue: string | string[]\n}>\n\n@customElement('schmancy-select')\nexport class SchmancySelect extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t\tposition: relative;\n\t}\n\n\t[role='listbox'] {\n\t\tmax-height: 25vh;\n\t\toverflow-y: auto;\n\t\toutline: none;\n\t}\n`) {\n\t// API\n\t@property({ type: String }) name: string | undefined\n\t@property({ type: Boolean }) required = false\n\t@property({ type: String }) placeholder = ''\n\t@property({ type: String }) value = '' // for single-select\n\t@property({ type: Array }) selectedValues: string[] = [] // for multi-select\n\t@property({ type: Boolean }) multi = false\n\t@property({ type: String }) label = ''\n\n\t// Internal states\n\t@state() private isOpen = false\n\t@state() private valueLabel = ''\n\n\t@query('ul') private ul!: HTMLUListElement\n\t@queryAssignedElements({ flatten: true }) private options!: SchmancyOption[]\n\tprivate cleanupPositioner?: () => void\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tif (!this.id) {\n\t\t\tthis.id = `schmancy-select-${Math.random().toString(36).substr(2, 9)}`\n\t\t}\n\t\tthis.addEventListener('keydown', this.handleKeyDown)\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.removeEventListener('keydown', this.handleKeyDown)\n\t\tthis.cleanupPositioner?.()\n\t}\n\n\tfirstUpdated() {\n\t\tthis.syncSelection()\n\t\tthis.setupOptionsAccessibility()\n\t}\n\n\tprivate syncSelection() {\n\t\tif (this.multi) {\n\t\t\tthis.selectedValues = this.options.filter(o => o.selected).map(o => o.value)\n\t\t\tthis.valueLabel =\n\t\t\t\tthis.selectedValues.length > 0\n\t\t\t\t\t? this.options\n\t\t\t\t\t\t\t.filter(o => this.selectedValues.includes(o.value))\n\t\t\t\t\t\t\t.map(o => o.label)\n\t\t\t\t\t\t\t.join(', ')\n\t\t\t\t\t: this.placeholder\n\t\t} else {\n\t\t\tconst selectedOption = this.options.find(o => o.value === this.value)\n\t\t\tthis.valueLabel = selectedOption?.label || this.placeholder\n\t\t}\n\t}\n\n\tprivate setupOptionsAccessibility() {\n\t\tthis.options.forEach((option, index) => {\n\t\t\toption.setAttribute('role', 'option')\n\t\t\tif (!option.id) {\n\t\t\t\toption.id = `${this.id}-option-${index}`\n\t\t\t}\n\t\t\toption.tabIndex = -1\n\t\t\toption.setAttribute(\n\t\t\t\t'aria-selected',\n\t\t\t\tString(this.multi ? this.selectedValues.includes(option.value) : option.value === this.value),\n\t\t\t)\n\t\t})\n\t}\n\n\tprivate async positionDropdown() {\n\t\tconst reference = this.renderRoot.querySelector('.trigger') as HTMLElement\n\t\tif (!reference || !this.ul) return\n\n\t\tthis.cleanupPositioner = autoUpdate(reference, this.ul, async () => {\n\t\t\tconst { x, y } = await computePosition(reference, this.ul, {\n\t\t\t\tplacement: 'bottom-start',\n\t\t\t\tmiddleware: [offset(5), flip(), shift({ padding: 5 })],\n\t\t\t})\n\n\t\t\tObject.assign(this.ul.style, {\n\t\t\t\tleft: `${x}px`,\n\t\t\t\ttop: `${y}px`,\n\t\t\t\tposition: 'absolute',\n\t\t\t})\n\t\t})\n\t}\n\n\tprivate handleKeyDown(e: KeyboardEvent) {\n\t\tif (!this.isOpen) {\n\t\t\tif (['Enter', ' ', 'ArrowDown'].includes(e.key)) {\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.openDropdown()\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tconst current = this.options.findIndex(o => o.matches(':focus')) ?? -1\n\n\t\tswitch (e.key) {\n\t\t\tcase 'Escape':\n\t\t\t\tthis.closeDropdown()\n\t\t\t\tbreak\n\t\t\tcase 'ArrowDown':\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.focusOption(this.options, Math.min(current + 1, this.options.length - 1))\n\t\t\t\tbreak\n\t\t\tcase 'ArrowUp':\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.focusOption(this.options, Math.max(current - 1, 0))\n\t\t\t\tbreak\n\t\t\tcase 'Enter':\n\t\t\tcase ' ':\n\t\t\t\te.preventDefault()\n\t\t\t\tif (current >= 0) this.handleOptionSelect(this.options[current].value)\n\t\t\t\tbreak\n\t\t\tcase 'Tab':\n\t\t\t\tthis.closeDropdown()\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\tprivate focusOption(options: HTMLElement[], index: number) {\n\t\tconst option = options[index]\n\t\tif (option) {\n\t\t\toption.focus()\n\t\t\tconst combobox = this.renderRoot.querySelector('.trigger')\n\t\t\tcombobox?.setAttribute('aria-activedescendant', option.id)\n\t\t}\n\t}\n\n\tprivate async openDropdown() {\n\t\tthis.isOpen = true\n\t\tawait this.updateComplete\n\n\t\tthis.positionDropdown()\n\t\tthis.setupOptionsAccessibility()\n\n\t\tconst options = Array.from(this.ul.querySelectorAll('[role=\"option\"]')) as HTMLElement[]\n\t\tconst selectedIndex = this.multi ? 0 : options.findIndex(o => o.getAttribute('value') === this.value)\n\t\tthis.focusOption(options, Math.max(selectedIndex, 0))\n\t}\n\n\tprivate closeDropdown() {\n\t\tthis.isOpen = false\n\t\tthis.cleanupPositioner?.()\n\t\tconst combobox = this.renderRoot.querySelector<HTMLElement>('.trigger')\n\t\tcombobox?.removeAttribute('aria-activedescendant')\n\t\tcombobox?.focus()\n\t}\n\n\tprivate handleOptionSelect(value: string) {\n\t\tif (this.multi) {\n\t\t\tconst option = this.options.find(o => o.value === value)\n\t\t\tif (!option) return\n\n\t\t\toption.selected = !option.selected\n\t\t\tif (option.selected) {\n\t\t\t\tthis.selectedValues = [...this.selectedValues, value]\n\t\t\t} else {\n\t\t\t\tthis.selectedValues = this.selectedValues.filter(v => v !== value)\n\t\t\t}\n\n\t\t\tthis.valueLabel =\n\t\t\t\tthis.selectedValues.length > 0\n\t\t\t\t\t? this.options\n\t\t\t\t\t\t\t.filter(o => this.selectedValues.includes(o.value))\n\t\t\t\t\t\t\t.map(o => o.label)\n\t\t\t\t\t\t\t.join(', ')\n\t\t\t\t\t: this.placeholder\n\n\t\t\tthis.dispatchChange(this.selectedValues)\n\t\t} else {\n\t\t\tthis.options.forEach(o => (o.selected = o.value === value))\n\t\t\tthis.value = value\n\t\t\tthis.valueLabel = this.options.find(o => o.value === value)?.label || this.placeholder\n\t\t\tthis.dispatchChange(value)\n\t\t\tthis.closeDropdown()\n\t\t}\n\n\t\tthis.setupOptionsAccessibility()\n\t}\n\n\tprivate dispatchChange(value: string | string[]) {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent<SchmancySelectChangeEvent['detail']>('change', {\n\t\t\t\tdetail: { value },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<div class=\"relative\">\n\t\t\t\t<schmancy-input\n\t\t\t\t\t.name=${this.name}\n\t\t\t\t\ttabIndex=\"0\"\n\t\t\t\t\tclass=\"trigger\"\n\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\taria-haspopup=\"listbox\"\n\t\t\t\t\taria-expanded=${this.isOpen}\n\t\t\t\t\taria-controls=\"options\"\n\t\t\t\t\taria-autocomplete=\"none\"\n\t\t\t\t\taria-required=${this.required}\n\t\t\t\t\t.label=${this.label}\n\t\t\t\t\t.placeholder=${this.placeholder}\n\t\t\t\t\t.value=${this.valueLabel}\n\t\t\t\t\t.required=${this.required}\n\t\t\t\t\treadonly\n\t\t\t\t\t@click=${() => (this.isOpen ? this.closeDropdown() : this.openDropdown())}\n\t\t\t\t></schmancy-input>\n\n\t\t\t\t<div\n\t\t\t\t\tid=\"overlay\"\n\t\t\t\t\tclass=\"fixed inset-0\"\n\t\t\t\t\t?hidden=${!this.isOpen}\n\t\t\t\t\t@click=${this.closeDropdown}\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t></div>\n\n\t\t\t\t<ul\n\t\t\t\t\tid=\"options\"\n\t\t\t\t\trole=\"listbox\"\n\t\t\t\t\taria-multiselectable=${this.multi}\n\t\t\t\t\tclass=${classMap({\n\t\t\t\t\t\t'absolute z-30 mt-1 w-full rounded-md shadow-sm': true,\n\t\t\t\t\t\thidden: !this.isOpen,\n\t\t\t\t\t})}\n\t\t\t\t\t${color({ bgColor: SchmancyTheme.sys.color.surface.container })}\n\t\t\t\t\t@click=${(e: Event) => {\n\t\t\t\t\t\tconst customEvt = e as CustomEvent\n\t\t\t\t\t\tconst detailVal = customEvt.detail?.value\n\t\t\t\t\t\tif (detailVal) {\n\t\t\t\t\t\t\tthis.handleOptionSelect(detailVal)\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<slot\n\t\t\t\t\t\t@slotchange=${() => {\n\t\t\t\t\t\t\tthis.syncSelection()\n\t\t\t\t\t\t\tthis.setupOptionsAccessibility()\n\t\t\t\t\t\t}}\n\t\t\t\t\t></slot>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-select': SchmancySelect\n\t}\n}\n"],"names":["SchmancySelect","$LitElement","css","super","arguments","this","required","placeholder","value","selectedValues","multi","label","isOpen","valueLabel","connectedCallback","id","Math","random","toString","substr","addEventListener","handleKeyDown","disconnectedCallback","removeEventListener","cleanupPositioner","syncSelection","setupOptionsAccessibility","options","filter","o","selected","map","length","includes","join","selectedOption","find","forEach","option","index","setAttribute","tabIndex","String","positionDropdown","reference","renderRoot","querySelector","ul","autoUpdate","async","x","y","computePosition","placement","middleware","offset","flip","shift","padding","Object","assign","style","left","top","position","e","key","preventDefault","openDropdown","current","findIndex","matches","closeDropdown","focusOption","min","max","handleOptionSelect","focus","combobox","updateComplete","Array","from","querySelectorAll","selectedIndex","getAttribute","removeAttribute","v","dispatchChange","dispatchEvent","CustomEvent","detail","bubbles","composed","html","name","classMap","hidden","color","bgColor","SchmancyTheme","sys","surface","container","customEvt","detailVal","__decorateClass","property","type","prototype","Boolean","state","query","queryAssignedElements","flatten","customElement"],"mappings":"wjBAcaA,QAAAA,eAAN,cAA6BC,EAAAA,YAAYC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAAzC,CAAA,CAAA,aAAAC,CAAAA,MAAAA,GAAAC,SAckCC,EAAAA,KAAAC,SAAA,GACED,KAAAE,YAAA,GACNF,KAAAG,MAAA,GACTH,KAAAI,eAA2B,CACjBJ,EAAAA,KAAAK,MAAA,GACDL,KAAAM,MAAA,GAG3BN,KAAQO,OAAS,GACjBP,KAAQQ,WAAa,EAAA,CAM9B,mBAAAC,CACCX,MAAMW,kBAAAA,EACDT,KAAKU,KACJV,KAAAU,GAAK,mBAAmBC,KAAKC,OAASC,EAAAA,SAAS,EAAIC,EAAAA,OAAO,EAAG,CAAA,CAAA,IAE9Dd,KAAAe,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CAAEC,QAAAA,EA1BbjH,CAAAA,CAAAA,EAAAA,uBA0BsC4G,UAAA,UAAA,CAAA,EA1BtC5G,QAANA,eAAAyG,EAAA,CADNS,EAAAA,cAAc,oBACFlH"}
@@ -7,10 +7,10 @@ import "./tailwind.mixin-BNM2vRly.js";
7
7
  import { c as f } from "./ripple-BumgqsDT.js";
8
8
  import { S as g } from "./theme.interface-C5Kj6WjD.js";
9
9
  import { css as w, html as O } from "lit";
10
- import { property as n, state as p, query as D, queryAssignedElements as $, customElement as x } from "lit/decorators.js";
11
- var A = Object.defineProperty, S = Object.getOwnPropertyDescriptor, l = (e, t, s, i) => {
12
- for (var r, a = i > 1 ? void 0 : i ? S(t, s) : t, c = e.length - 1; c >= 0; c--) (r = e[c]) && (a = (i ? r(t, s, a) : r(a)) || a);
13
- return i && a && A(t, s, a), a;
10
+ import { property as n, state as p, query as $, queryAssignedElements as D, customElement as x } from "lit/decorators.js";
11
+ var S = Object.defineProperty, A = Object.getOwnPropertyDescriptor, l = (e, t, s, i) => {
12
+ for (var r, a = i > 1 ? void 0 : i ? A(t, s) : t, c = e.length - 1; c >= 0; c--) (r = e[c]) && (a = (i ? r(t, s, a) : r(a)) || a);
13
+ return i && a && S(t, s, a), a;
14
14
  };
15
15
  let o = class extends v(w`
16
16
  :host {
@@ -110,6 +110,7 @@ let o = class extends v(w`
110
110
  return O`
111
111
  <div class="relative">
112
112
  <schmancy-input
113
+ .name=${this.name}
113
114
  tabIndex="0"
114
115
  class="trigger"
115
116
  role="combobox"
@@ -157,8 +158,8 @@ let o = class extends v(w`
157
158
  `;
158
159
  }
159
160
  };
160
- l([n({ type: Boolean })], o.prototype, "required", 2), l([n({ type: String })], o.prototype, "placeholder", 2), l([n({ type: String })], o.prototype, "value", 2), l([n({ type: Array })], o.prototype, "selectedValues", 2), l([n({ type: Boolean })], o.prototype, "multi", 2), l([n({ type: String })], o.prototype, "label", 2), l([p()], o.prototype, "isOpen", 2), l([p()], o.prototype, "valueLabel", 2), l([D("ul")], o.prototype, "ul", 2), l([$({ flatten: !0 })], o.prototype, "options", 2), o = l([x("schmancy-select")], o);
161
+ l([n({ type: String })], o.prototype, "name", 2), l([n({ type: Boolean })], o.prototype, "required", 2), l([n({ type: String })], o.prototype, "placeholder", 2), l([n({ type: String })], o.prototype, "value", 2), l([n({ type: Array })], o.prototype, "selectedValues", 2), l([n({ type: Boolean })], o.prototype, "multi", 2), l([n({ type: String })], o.prototype, "label", 2), l([p()], o.prototype, "isOpen", 2), l([p()], o.prototype, "valueLabel", 2), l([$("ul")], o.prototype, "ul", 2), l([D({ flatten: !0 })], o.prototype, "options", 2), o = l([x("schmancy-select")], o);
161
162
  export {
162
163
  o as S
163
164
  };
164
- //# sourceMappingURL=select-Dlyf_fVO.js.map
165
+ //# sourceMappingURL=select-Dn-WETnI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select-Dn-WETnI.js","sources":["../src/select/select.ts"],"sourcesContent":["import { autoUpdate, computePosition, flip, offset, shift } from '@floating-ui/dom'\nimport { $LitElement } from '@mixins/index'\nimport { color } from '@schmancy/directives'\nimport SchmancyOption from '@schmancy/option/option'\nimport { SchmancyTheme } from '@schmancy/theme/theme.interface'\nimport { css, html } from 'lit'\nimport { customElement, property, query, queryAssignedElements, state } from 'lit/decorators.js'\nimport { classMap } from 'lit/directives/class-map.js'\n\nexport type SchmancySelectChangeEvent = CustomEvent<{\n\tvalue: string | string[]\n}>\n\n@customElement('schmancy-select')\nexport class SchmancySelect extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t\tposition: relative;\n\t}\n\n\t[role='listbox'] {\n\t\tmax-height: 25vh;\n\t\toverflow-y: auto;\n\t\toutline: none;\n\t}\n`) {\n\t// API\n\t@property({ type: String }) name: string | undefined\n\t@property({ type: Boolean }) required = false\n\t@property({ type: String }) placeholder = ''\n\t@property({ type: String }) value = '' // for single-select\n\t@property({ type: Array }) selectedValues: string[] = [] // for multi-select\n\t@property({ type: Boolean }) multi = false\n\t@property({ type: String }) label = ''\n\n\t// Internal states\n\t@state() private isOpen = false\n\t@state() private valueLabel = ''\n\n\t@query('ul') private ul!: HTMLUListElement\n\t@queryAssignedElements({ flatten: true }) private options!: SchmancyOption[]\n\tprivate cleanupPositioner?: () => void\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tif (!this.id) {\n\t\t\tthis.id = `schmancy-select-${Math.random().toString(36).substr(2, 9)}`\n\t\t}\n\t\tthis.addEventListener('keydown', this.handleKeyDown)\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.removeEventListener('keydown', this.handleKeyDown)\n\t\tthis.cleanupPositioner?.()\n\t}\n\n\tfirstUpdated() {\n\t\tthis.syncSelection()\n\t\tthis.setupOptionsAccessibility()\n\t}\n\n\tprivate syncSelection() {\n\t\tif (this.multi) {\n\t\t\tthis.selectedValues = this.options.filter(o => o.selected).map(o => o.value)\n\t\t\tthis.valueLabel =\n\t\t\t\tthis.selectedValues.length > 0\n\t\t\t\t\t? this.options\n\t\t\t\t\t\t\t.filter(o => this.selectedValues.includes(o.value))\n\t\t\t\t\t\t\t.map(o => o.label)\n\t\t\t\t\t\t\t.join(', ')\n\t\t\t\t\t: this.placeholder\n\t\t} else {\n\t\t\tconst selectedOption = this.options.find(o => o.value === this.value)\n\t\t\tthis.valueLabel = selectedOption?.label || this.placeholder\n\t\t}\n\t}\n\n\tprivate setupOptionsAccessibility() {\n\t\tthis.options.forEach((option, index) => {\n\t\t\toption.setAttribute('role', 'option')\n\t\t\tif (!option.id) {\n\t\t\t\toption.id = `${this.id}-option-${index}`\n\t\t\t}\n\t\t\toption.tabIndex = -1\n\t\t\toption.setAttribute(\n\t\t\t\t'aria-selected',\n\t\t\t\tString(this.multi ? this.selectedValues.includes(option.value) : option.value === this.value),\n\t\t\t)\n\t\t})\n\t}\n\n\tprivate async positionDropdown() {\n\t\tconst reference = this.renderRoot.querySelector('.trigger') as HTMLElement\n\t\tif (!reference || !this.ul) return\n\n\t\tthis.cleanupPositioner = autoUpdate(reference, this.ul, async () => {\n\t\t\tconst { x, y } = await computePosition(reference, this.ul, {\n\t\t\t\tplacement: 'bottom-start',\n\t\t\t\tmiddleware: [offset(5), flip(), shift({ padding: 5 })],\n\t\t\t})\n\n\t\t\tObject.assign(this.ul.style, {\n\t\t\t\tleft: `${x}px`,\n\t\t\t\ttop: `${y}px`,\n\t\t\t\tposition: 'absolute',\n\t\t\t})\n\t\t})\n\t}\n\n\tprivate handleKeyDown(e: KeyboardEvent) {\n\t\tif (!this.isOpen) {\n\t\t\tif (['Enter', ' ', 'ArrowDown'].includes(e.key)) {\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.openDropdown()\n\t\t\t}\n\t\t\treturn\n\t\t}\n\n\t\tconst current = this.options.findIndex(o => o.matches(':focus')) ?? -1\n\n\t\tswitch (e.key) {\n\t\t\tcase 'Escape':\n\t\t\t\tthis.closeDropdown()\n\t\t\t\tbreak\n\t\t\tcase 'ArrowDown':\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.focusOption(this.options, Math.min(current + 1, this.options.length - 1))\n\t\t\t\tbreak\n\t\t\tcase 'ArrowUp':\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.focusOption(this.options, Math.max(current - 1, 0))\n\t\t\t\tbreak\n\t\t\tcase 'Enter':\n\t\t\tcase ' ':\n\t\t\t\te.preventDefault()\n\t\t\t\tif (current >= 0) this.handleOptionSelect(this.options[current].value)\n\t\t\t\tbreak\n\t\t\tcase 'Tab':\n\t\t\t\tthis.closeDropdown()\n\t\t\t\tbreak\n\t\t}\n\t}\n\n\tprivate focusOption(options: HTMLElement[], index: number) {\n\t\tconst option = options[index]\n\t\tif (option) {\n\t\t\toption.focus()\n\t\t\tconst combobox = this.renderRoot.querySelector('.trigger')\n\t\t\tcombobox?.setAttribute('aria-activedescendant', option.id)\n\t\t}\n\t}\n\n\tprivate async openDropdown() {\n\t\tthis.isOpen = true\n\t\tawait this.updateComplete\n\n\t\tthis.positionDropdown()\n\t\tthis.setupOptionsAccessibility()\n\n\t\tconst options = Array.from(this.ul.querySelectorAll('[role=\"option\"]')) as HTMLElement[]\n\t\tconst selectedIndex = this.multi ? 0 : options.findIndex(o => o.getAttribute('value') === this.value)\n\t\tthis.focusOption(options, Math.max(selectedIndex, 0))\n\t}\n\n\tprivate closeDropdown() {\n\t\tthis.isOpen = false\n\t\tthis.cleanupPositioner?.()\n\t\tconst combobox = this.renderRoot.querySelector<HTMLElement>('.trigger')\n\t\tcombobox?.removeAttribute('aria-activedescendant')\n\t\tcombobox?.focus()\n\t}\n\n\tprivate handleOptionSelect(value: string) {\n\t\tif (this.multi) {\n\t\t\tconst option = this.options.find(o => o.value === value)\n\t\t\tif (!option) return\n\n\t\t\toption.selected = !option.selected\n\t\t\tif (option.selected) {\n\t\t\t\tthis.selectedValues = [...this.selectedValues, value]\n\t\t\t} else {\n\t\t\t\tthis.selectedValues = this.selectedValues.filter(v => v !== value)\n\t\t\t}\n\n\t\t\tthis.valueLabel =\n\t\t\t\tthis.selectedValues.length > 0\n\t\t\t\t\t? this.options\n\t\t\t\t\t\t\t.filter(o => this.selectedValues.includes(o.value))\n\t\t\t\t\t\t\t.map(o => o.label)\n\t\t\t\t\t\t\t.join(', ')\n\t\t\t\t\t: this.placeholder\n\n\t\t\tthis.dispatchChange(this.selectedValues)\n\t\t} else {\n\t\t\tthis.options.forEach(o => (o.selected = o.value === value))\n\t\t\tthis.value = value\n\t\t\tthis.valueLabel = this.options.find(o => o.value === value)?.label || this.placeholder\n\t\t\tthis.dispatchChange(value)\n\t\t\tthis.closeDropdown()\n\t\t}\n\n\t\tthis.setupOptionsAccessibility()\n\t}\n\n\tprivate dispatchChange(value: string | string[]) {\n\t\tthis.dispatchEvent(\n\t\t\tnew CustomEvent<SchmancySelectChangeEvent['detail']>('change', {\n\t\t\t\tdetail: { value },\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t}),\n\t\t)\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<div class=\"relative\">\n\t\t\t\t<schmancy-input\n\t\t\t\t\t.name=${this.name}\n\t\t\t\t\ttabIndex=\"0\"\n\t\t\t\t\tclass=\"trigger\"\n\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\taria-haspopup=\"listbox\"\n\t\t\t\t\taria-expanded=${this.isOpen}\n\t\t\t\t\taria-controls=\"options\"\n\t\t\t\t\taria-autocomplete=\"none\"\n\t\t\t\t\taria-required=${this.required}\n\t\t\t\t\t.label=${this.label}\n\t\t\t\t\t.placeholder=${this.placeholder}\n\t\t\t\t\t.value=${this.valueLabel}\n\t\t\t\t\t.required=${this.required}\n\t\t\t\t\treadonly\n\t\t\t\t\t@click=${() => (this.isOpen ? this.closeDropdown() : this.openDropdown())}\n\t\t\t\t></schmancy-input>\n\n\t\t\t\t<div\n\t\t\t\t\tid=\"overlay\"\n\t\t\t\t\tclass=\"fixed inset-0\"\n\t\t\t\t\t?hidden=${!this.isOpen}\n\t\t\t\t\t@click=${this.closeDropdown}\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t></div>\n\n\t\t\t\t<ul\n\t\t\t\t\tid=\"options\"\n\t\t\t\t\trole=\"listbox\"\n\t\t\t\t\taria-multiselectable=${this.multi}\n\t\t\t\t\tclass=${classMap({\n\t\t\t\t\t\t'absolute z-30 mt-1 w-full rounded-md shadow-sm': true,\n\t\t\t\t\t\thidden: !this.isOpen,\n\t\t\t\t\t})}\n\t\t\t\t\t${color({ bgColor: SchmancyTheme.sys.color.surface.container })}\n\t\t\t\t\t@click=${(e: Event) => {\n\t\t\t\t\t\tconst customEvt = e as CustomEvent\n\t\t\t\t\t\tconst detailVal = customEvt.detail?.value\n\t\t\t\t\t\tif (detailVal) {\n\t\t\t\t\t\t\tthis.handleOptionSelect(detailVal)\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<slot\n\t\t\t\t\t\t@slotchange=${() => {\n\t\t\t\t\t\t\tthis.syncSelection()\n\t\t\t\t\t\t\tthis.setupOptionsAccessibility()\n\t\t\t\t\t\t}}\n\t\t\t\t\t></slot>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-select': SchmancySelect\n\t}\n}\n"],"names":["SchmancySelect","$LitElement","css","super","arguments","this","required","placeholder","value","selectedValues","multi","label","isOpen","valueLabel","connectedCallback","id","Math","random","toString","substr","addEventListener","handleKeyDown","disconnectedCallback","removeEventListener","cleanupPositioner","firstUpdated","syncSelection","setupOptionsAccessibility","options","filter","o","selected","map","length","includes","join","selectedOption","find","forEach","option","index","setAttribute","tabIndex","String","positionDropdown","reference","renderRoot","querySelector","ul","autoUpdate","async","x","y","computePosition","placement","middleware","offset","flip","shift","padding","Object","assign","style","left","top","position","e","key","preventDefault","openDropdown","current","findIndex","matches","closeDropdown","focusOption","min","max","handleOptionSelect","focus","combobox","updateComplete","Array","from","querySelectorAll","selectedIndex","getAttribute","removeAttribute","v","dispatchChange","dispatchEvent","CustomEvent","detail","bubbles","composed","render","html","name","classMap","hidden","color","bgColor","SchmancyTheme","sys","surface","container","customEvt","detailVal","__decorateClass","property","type","prototype","Boolean","state","query","queryAssignedElements","flatten","customElement"],"mappings":";;;;;;;;;;;;;;AAca,IAAAA,IAAN,cAA6BC,EAAYC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,CAAzC,EAAA;AAAA,EAAA,cAAAC;AAAAA,UAAAA,GAAAC,SAckCC,GAAAA,KAAAC,WAAA,IACED,KAAAE,cAAA,IACNF,KAAAG,QAAA,IACTH,KAAAI,iBAA2B,CACjBJ,GAAAA,KAAAK,QAAA,IACDL,KAAAM,QAAA,IAG3BN,KAAQO,SAAS,IACjBP,KAAQQ,aAAa;AAAA,EAAA;AAAA,EAM9B,oBAA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NjF,EAiBe8G,WAAA,kBAAA,CACEH,GAAAA,EAAA,CAA5BC,EAAS,EAAEC,MAAME,QAAAA,CAAAA,CAAAA,GAlBN/G,EAkBiB8G,WAAA,SAAA,CAAA,GACDH,EAAA,CAA3BC,EAAS,EAAEC,MAAMlE,OAnBN3C,CAAAA,CAAAA,GAAAA,EAmBgB8G,WAAA,SAAA,CAAA,GAGXH,EAAA,CAAhBK,EAtBWhH,CAAAA,GAAAA,EAsBK8G,WAAA,UAAA,CAAA,GACAH,EAAA,CAAhBK,EAvBWhH,CAAAA,GAAAA,EAuBK8G,WAAA,cAAA,CAAA,GAEIH,EAAA,CAApBM,EAAM,IAAA,CAAA,GAzBKjH,EAyBS8G,WAAA,MAAA,CAC6BH,GAAAA,EAAA,CAAjDO,EAAsB,EAAEC,SAAS,GAAA,CAAA,CAAA,GA1BtBnH,EA0BsC8G,WAAA,WAAA,CAAA,GA1BtC9G,IAAN2G,EAAA,CADNS,EAAc,iBAAA,CAAA,GACFpH;"}
package/dist/select.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./select-DLZUW_cj.cjs");Object.defineProperty(exports,"SchmancySelect",{enumerable:!0,get:()=>e.SchmancySelect});
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./select-B_G2xt3n.cjs");Object.defineProperty(exports,"SchmancySelect",{enumerable:!0,get:()=>e.SchmancySelect});
2
2
  //# sourceMappingURL=select.cjs.map
package/dist/select.js CHANGED
@@ -1,4 +1,4 @@
1
- import { S } from "./select-Dlyf_fVO.js";
1
+ import { S } from "./select-Dn-WETnI.js";
2
2
  export {
3
3
  S as SchmancySelect
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-CxVVjMy6.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-BU8VUQ9X.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-CvQB_OPX.cjs");const O=require("./area.component-CWwc52Uy.cjs");require("./autocomplete-B29VQiPY.cjs"),require("./spinner-CBX7eCsA.cjs"),require("./icon-button-CaEPMYHW.cjs"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const S=require("./tailwind.mixin-Bkx1Uuxe.cjs"),$=require("./theme.interface-Xg5Zi46a.cjs");require("./checkbox-BNi0XYlX.cjs"),require("./chips-BbMv4qYo.cjs"),require("./payment-card-form-BwzL71bJ.cjs");const p=require("./types.cjs"),l=require("./provide-_VUNOf1R.cjs"),w=require("./litElement.mixin-UoPWmzJY.cjs"),d=require("./consume-Di0U0iBU.cjs");require("./date-range-3yVvaRLG.cjs"),require("./delay-CbylHdl-.cjs");const b=require("./ripple-C2BHbhcS.cjs");require("./divider-BPWZZ0t2.cjs"),require("./form-BeLadN-A.cjs"),require("./icon-BOUn9Lbw.cjs"),require("./input-DoURQ3xM.cjs"),require("./flex-DICGGeg0.cjs"),require("./list-CQJYVqBV.cjs"),require("./menu-BKUoQyCS.cjs");const I=require("lit/directives/when.js");require("./outlet-D_JSZeRn.cjs"),require("./option-GQjTaa4v.cjs"),require("./radio-group-DSob8tt0.cjs"),require("./index-DyJ0oDpR.cjs"),require("./select-DLZUW_cj.cjs");const U=require("./sheet-BoPm_Ysx.cjs");require("./slider-DFSq11C6.cjs"),require("./surface-BCP4Nk6f.cjs"),require("./table-MEstD23V.cjs"),require("./tabs-group-DyNlrJrc.cjs"),require("./textarea-DgjTD3MS.cjs"),require("./theme.component-BpS8ehqb.cjs"),require("./theme-button-DmdmN56f.cjs"),require("./tree-DzG0MTVn.cjs"),require("./typewriter-DNihFwgs.cjs"),require("./typography-Di2lcsba.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-CvQB_OPX.cjs");const O=require("./area.component-CWwc52Uy.cjs");require("./autocomplete-B29VQiPY.cjs"),require("./spinner-CBX7eCsA.cjs"),require("./icon-button-CaEPMYHW.cjs"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const S=require("./tailwind.mixin-Bkx1Uuxe.cjs"),$=require("./theme.interface-Xg5Zi46a.cjs");require("./checkbox-BNi0XYlX.cjs"),require("./chips-BbMv4qYo.cjs"),require("./payment-card-form-BwzL71bJ.cjs");const p=require("./types.cjs"),l=require("./provide-_VUNOf1R.cjs"),w=require("./litElement.mixin-UoPWmzJY.cjs"),d=require("./consume-Di0U0iBU.cjs");require("./date-range-3yVvaRLG.cjs"),require("./delay-CbylHdl-.cjs");const b=require("./ripple-C2BHbhcS.cjs");require("./divider-BPWZZ0t2.cjs"),require("./form-BeLadN-A.cjs"),require("./icon-BOUn9Lbw.cjs"),require("./input-BrLbi5wu.cjs"),require("./flex-DICGGeg0.cjs"),require("./list-CQJYVqBV.cjs"),require("./menu-BKUoQyCS.cjs");const I=require("lit/directives/when.js");require("./outlet-D_JSZeRn.cjs"),require("./option-GQjTaa4v.cjs"),require("./radio-group-DSob8tt0.cjs"),require("./index-DyJ0oDpR.cjs"),require("./select-B_G2xt3n.cjs");const U=require("./sheet-BoPm_Ysx.cjs");require("./slider-DFSq11C6.cjs"),require("./surface-BCP4Nk6f.cjs"),require("./table-MEstD23V.cjs"),require("./tabs-group-DyNlrJrc.cjs"),require("./textarea-DgjTD3MS.cjs"),require("./theme.component-BpS8ehqb.cjs"),require("./theme-button-DmdmN56f.cjs"),require("./tree-DzG0MTVn.cjs"),require("./typewriter-DNihFwgs.cjs"),require("./typography-Di2lcsba.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-CxVVjMy6.cjs.map
150
+ //# sourceMappingURL=teleport.component-BU8VUQ9X.cjs.map