@luzmo/lucero 1.0.1-alpha.14 → 1.0.1-alpha.16

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 (275) hide show
  1. package/components/accordion/index.cjs +183 -6
  2. package/components/accordion/index.js +136 -88
  3. package/components/action-bar/index.cjs +85 -4
  4. package/components/action-bar/index.js +72 -50
  5. package/components/action-button/index.cjs +205 -3
  6. package/components/action-button/index.js +167 -93
  7. package/components/action-group/index.cjs +7 -1
  8. package/components/action-group/index.js +12 -8
  9. package/components/action-group-DHp8RHDf.js +392 -0
  10. package/components/action-group-MPf19RPV.cjs +391 -0
  11. package/components/action-menu/index.cjs +91 -11
  12. package/components/action-menu/index.js +66 -47
  13. package/components/avatar/index.cjs +63 -3
  14. package/components/avatar/index.js +54 -42
  15. package/components/base-COw9n7UR.cjs +119 -0
  16. package/components/base-DmeVy0cq.js +120 -0
  17. package/components/button/index.cjs +134 -2
  18. package/components/button/index.js +106 -72
  19. package/components/button-base-7Ak55xFd.cjs +206 -0
  20. package/components/button-base-C3kf6BTK.js +207 -0
  21. package/components/button-group/index.cjs +45 -1
  22. package/components/button-group/index.js +37 -25
  23. package/components/calendar/index.cjs +632 -1
  24. package/components/calendar/index.js +637 -7
  25. package/components/checkbox/index.cjs +111 -4
  26. package/components/checkbox/index.js +98 -53
  27. package/components/checkbox-mixin-8cL-vfDy.js +84 -0
  28. package/components/checkbox-mixin-CE7dJj3J.cjs +83 -0
  29. package/components/clear-button-Co6oKSgl.js +59 -0
  30. package/components/clear-button-X_HDY2eH.cjs +58 -0
  31. package/components/close-button-DPBK6Kpu.cjs +59 -0
  32. package/components/close-button-Miw9ZjoJ.js +60 -0
  33. package/components/color-area/index.cjs +440 -13
  34. package/components/color-area/index.js +322 -187
  35. package/components/color-controller-BjDZaxhX.js +491 -0
  36. package/components/color-controller-C3c_vb2P.cjs +490 -0
  37. package/components/color-field/index.cjs +95 -2
  38. package/components/color-field/index.js +77 -41
  39. package/components/color-handle/index.cjs +64 -3
  40. package/components/color-handle/index.js +58 -37
  41. package/components/color-loupe/index.cjs +7 -1
  42. package/components/color-loupe/index.js +12 -8
  43. package/components/color-loupe-BQqNR8YD.cjs +88 -0
  44. package/components/color-loupe-B_DDFv8l.js +89 -0
  45. package/components/color-menu/index.cjs +217 -12
  46. package/components/color-menu/index.js +187 -93
  47. package/components/color-palette/index.cjs +89 -1
  48. package/components/color-palette/index.js +78 -51
  49. package/components/color-palette-group/index.cjs +259 -3
  50. package/components/color-palette-group/index.js +193 -105
  51. package/components/color-picker/index.cjs +114 -6
  52. package/components/color-picker/index.js +92 -72
  53. package/components/color-slider/index.cjs +585 -1
  54. package/components/color-slider/index.js +590 -7
  55. package/components/{directive-oAbCiebi.js → condition-attribute-with-id-Cn815e9W.js} +22 -22
  56. package/components/condition-attribute-with-id-DEc2Yjne.cjs +43 -0
  57. package/components/date-time-picker/index.cjs +1357 -31
  58. package/components/date-time-picker/index.js +951 -637
  59. package/components/dependency-manger-CcIE1uvQ.cjs +63 -0
  60. package/components/{dependency-manger-CEXvGQUV.js → dependency-manger-XHpQjFgK.js} +24 -14
  61. package/components/divider/index.cjs +54 -1
  62. package/components/divider/index.js +49 -30
  63. package/components/divider.module-Cm5LcDRV.cjs +20 -0
  64. package/components/divider.module-DauH6k2_.js +21 -0
  65. package/components/element-resolution-DCsrhGZO.cjs +112 -0
  66. package/components/element-resolution-nMlmW4Jy.js +113 -0
  67. package/components/field-group/index.cjs +7 -1
  68. package/components/field-group/index.js +12 -8
  69. package/components/field-group-DNmY8W9v.cjs +86 -0
  70. package/components/field-group-DVdAWCQF.js +87 -0
  71. package/components/field-label/index.cjs +7 -1
  72. package/components/field-label/index.js +12 -8
  73. package/components/field-label-CKH9EXpR.cjs +156 -0
  74. package/components/field-label-Dpsecoc6.js +157 -0
  75. package/components/focus-group-BqDAk9Is.js +337 -0
  76. package/components/focus-group-DFzOlalL.cjs +336 -0
  77. package/components/focus-visible-B-B8-P9R.cjs +104 -0
  78. package/components/focus-visible-BUPRWlsh.js +105 -0
  79. package/components/focusable-BPrTcZPd.cjs +262 -0
  80. package/components/focusable-ChCLg1k4.js +263 -0
  81. package/components/{directive-C7oCP5Bh.cjs → focusable-selectors-D0t_5P7C.cjs} +16 -5
  82. package/components/{focusable-selectors-B4YgbghQ.js → focusable-selectors-IltOAOd9.js} +7 -4
  83. package/components/icon/index.cjs +90 -1
  84. package/components/icon/index.js +74 -46
  85. package/components/index.cjs +174 -1
  86. package/components/index.js +174 -172
  87. package/components/infield-button/index.cjs +46 -2
  88. package/components/infield-button/index.js +41 -30
  89. package/components/label/index.cjs +37 -1
  90. package/components/label/index.js +36 -24
  91. package/components/{language-resolution-8yZa5r_P.js → language-resolution-BSGJAWiQ.js} +21 -16
  92. package/components/language-resolution-iN9EImbb.cjs +57 -0
  93. package/components/like-anchor-D62faRNG.cjs +79 -0
  94. package/components/like-anchor-v3cJ9RWM.js +80 -0
  95. package/components/manage-help-text-BYx84zZR.cjs +125 -0
  96. package/components/manage-help-text-DOuMTGht.js +126 -0
  97. package/components/menu/index.cjs +1297 -29
  98. package/components/menu/index.js +954 -499
  99. package/components/multi-language-field/index.cjs +132 -2
  100. package/components/multi-language-field/index.js +118 -88
  101. package/components/number-field/index.cjs +613 -10
  102. package/components/number-field/index.js +442 -243
  103. package/components/observe-slot-presence-9AwLGUQ_.cjs +78 -0
  104. package/components/observe-slot-presence-DcMdoumP.js +79 -0
  105. package/components/observe-slot-text-CSofZeeF.cjs +104 -0
  106. package/components/observe-slot-text-CjnkkBPn.js +105 -0
  107. package/components/options/index.cjs +693 -60
  108. package/components/options/index.js +519 -953
  109. package/components/overlay/index.cjs +367 -21
  110. package/components/overlay/index.js +273 -189
  111. package/components/overlay-CN8ISP1F.js +2485 -0
  112. package/components/overlay-LViy9VWM.cjs +2484 -0
  113. package/components/{pending-state-DTX7ggyF.js → pending-state-CXbe-Xul.js} +28 -13
  114. package/components/pending-state-e4RbXe9u.cjs +75 -0
  115. package/components/picker/index.cjs +9 -1
  116. package/components/picker/index.js +15 -11
  117. package/components/picker-DNde3awt.cjs +672 -0
  118. package/components/picker-PfUAF05y.js +673 -0
  119. package/components/picker-button/index.cjs +56 -4
  120. package/components/picker-button/index.js +45 -34
  121. package/components/platform-CxDar3Dn.cjs +68 -0
  122. package/components/platform-Cxn0WbyT.js +69 -0
  123. package/components/popover/index.cjs +7 -1
  124. package/components/popover/index.js +12 -8
  125. package/components/popover-BkbYhl3i.js +74 -0
  126. package/components/popover-BkgUf0kL.cjs +74 -0
  127. package/components/progress-circle/index.cjs +7 -1
  128. package/components/progress-circle/index.js +12 -8
  129. package/components/progress-circle-Hu_ivPHf.js +133 -0
  130. package/components/progress-circle-_Etqsj9f.cjs +132 -0
  131. package/components/radio/index.cjs +244 -2
  132. package/components/radio/index.js +192 -110
  133. package/components/{when-CDK1Tt5Y.js → random-id-BE6HA503.cjs} +7 -10
  134. package/components/{random-id-ByCz1xaq.js → random-id-BEc6QIUL.js} +3 -3
  135. package/components/roving-tabindex-AsmAh2In.cjs +95 -0
  136. package/components/roving-tabindex-DPF9NmrH.js +96 -0
  137. package/components/search/index.cjs +115 -8
  138. package/components/search/index.js +96 -66
  139. package/components/select/index.cjs +720 -51
  140. package/components/select/index.js +563 -347
  141. package/components/sized-mixin-DmkrNdWB.js +80 -0
  142. package/components/sized-mixin-UaTVa-AE.cjs +79 -0
  143. package/components/slider/index.cjs +119 -1
  144. package/components/slider/index.js +100 -1113
  145. package/components/{condition-attribute-with-id-Dv4lSRbe.js → slottable-request-event-CANixJnR.cjs} +15 -13
  146. package/components/{slottable-request-event-DggLA4Rx.js → slottable-request-event-D9WzrdWv.js} +12 -9
  147. package/components/strategies-DlMlaSJR.cjs +317 -0
  148. package/components/strategies-DlPQoTFE.js +318 -0
  149. package/components/streaming-listener-D4sHaMub.cjs +145 -0
  150. package/components/streaming-listener-cAz5zJyk.js +146 -0
  151. package/components/swatch/index.cjs +436 -7
  152. package/components/swatch/index.js +350 -205
  153. package/components/switch/index.cjs +61 -2
  154. package/components/switch/index.js +51 -34
  155. package/components/tabs/index.cjs +693 -26
  156. package/components/tabs/index.js +521 -388
  157. package/components/tags/index.cjs +201 -4
  158. package/components/tags/index.js +152 -87
  159. package/components/text-field/index.cjs +49 -3
  160. package/components/text-field/index.js +44 -30
  161. package/components/text-field-11tcnftU.cjs +338 -0
  162. package/components/text-field-Chi9J2Cz.js +339 -0
  163. package/components/text-field.module-CMBS0jSL.js +21 -0
  164. package/components/text-field.module-DIJdV_sA.cjs +20 -0
  165. package/components/toast/index.cjs +177 -12
  166. package/components/toast/index.js +145 -73
  167. package/components/tooltip/index.cjs +221 -6
  168. package/components/tooltip/index.js +156 -109
  169. package/components/unit-input/index.cjs +232 -8
  170. package/components/unit-input/index.js +201 -108
  171. package/components/utils.cjs +25 -1
  172. package/components/utils.js +22 -22
  173. package/package.json +1 -1
  174. package/components/NumberFormatter-DewVDY5w.cjs +0 -18
  175. package/components/NumberFormatter-DgOUVrge.js +0 -136
  176. package/components/NumberParser-Dik4a0h-.cjs +0 -18
  177. package/components/NumberParser-ci9J5EKv.js +0 -173
  178. package/components/action-group-DBImibFn.js +0 -258
  179. package/components/action-group-DJGMcRHb.cjs +0 -20
  180. package/components/async-directive-BX1T1e1_.cjs +0 -22
  181. package/components/async-directive-BfcqVjDp.js +0 -82
  182. package/components/base-BjTwmyRF.cjs +0 -22
  183. package/components/base-CBCg3yyw.cjs +0 -40
  184. package/components/base-D76d76ww.js +0 -26
  185. package/components/base-WsynuqaS.js +0 -677
  186. package/components/button-base-DbkDzb71.js +0 -144
  187. package/components/button-base-XgPLmwP-.cjs +0 -25
  188. package/components/checkbox-mixin-BDN0dBtS.cjs +0 -27
  189. package/components/checkbox-mixin-Do7EgtpQ.js +0 -70
  190. package/components/class-map-Di1D_rCm.cjs +0 -22
  191. package/components/class-map-NbVXqBU0.js +0 -51
  192. package/components/clear-button-DQcRdcUa.js +0 -53
  193. package/components/clear-button-OFUFFe7G.cjs +0 -18
  194. package/components/close-button-Cbnb7XXj.cjs +0 -18
  195. package/components/close-button-CqHYZhum.js +0 -51
  196. package/components/color-controller-B0uX6Zso.js +0 -3230
  197. package/components/color-controller-CoUL5f9K.cjs +0 -18
  198. package/components/color-loupe-CaA_Lfkk.cjs +0 -56
  199. package/components/color-loupe-CmMsXbjT.js +0 -81
  200. package/components/condition-attribute-with-id-DrQYZzFS.cjs +0 -18
  201. package/components/dependency-manger-C5HCkMMB.cjs +0 -18
  202. package/components/directive-helpers-Cm6gitnu.js +0 -62
  203. package/components/directive-helpers-DyIRTWwA.cjs +0 -22
  204. package/components/divider.module-DDvBo9zo.cjs +0 -18
  205. package/components/divider.module-DoQWQEIJ.js +0 -21
  206. package/components/element-resolution-BvRLGqIU.cjs +0 -18
  207. package/components/element-resolution-FCUT-wql.js +0 -91
  208. package/components/field-group-DXfBWrkO.js +0 -66
  209. package/components/field-group-DkGst3r5.cjs +0 -23
  210. package/components/field-label-CZ2zzChK.js +0 -106
  211. package/components/field-label-mO1AkUgR.cjs +0 -25
  212. package/components/flow-D-0MTYCm.js +0 -527
  213. package/components/flow-DM3dNAKs.cjs +0 -30
  214. package/components/focus-group-DHeTq18L.js +0 -218
  215. package/components/focus-group-DnxZUBhQ.cjs +0 -18
  216. package/components/focus-visible-B0P9aY_G.cjs +0 -18
  217. package/components/focus-visible-DBlJGoEW.js +0 -74
  218. package/components/focusable-BxtpnzWp.js +0 -153
  219. package/components/focusable-EbipgXRh.cjs +0 -18
  220. package/components/focusable-selectors-BgFlyFcY.cjs +0 -18
  221. package/components/if-defined-C9YGdo33.cjs +0 -22
  222. package/components/if-defined-DOaE2coe.js +0 -27
  223. package/components/index-BwxgAdzi.cjs +0 -57
  224. package/components/index-Cl54m8Yh.js +0 -1490
  225. package/components/index-HjQa8tew.js +0 -1174
  226. package/components/index-Wq3qZJGh.cjs +0 -113
  227. package/components/language-resolution-DJzmyzZq.cjs +0 -18
  228. package/components/like-anchor-Bvn_vLQ8.js +0 -69
  229. package/components/like-anchor-sod1C1fR.cjs +0 -32
  230. package/components/luzmo-icons-4nDFv1Lq.js +0 -229
  231. package/components/luzmo-icons-D4IvHgVd.cjs +0 -29
  232. package/components/manage-help-text-DhgARkZX.cjs +0 -30
  233. package/components/manage-help-text-syYnjKGL.js +0 -92
  234. package/components/mutation-controller-DH7YOCyj.js +0 -52
  235. package/components/mutation-controller-DkOMCW-c.cjs +0 -22
  236. package/components/observe-slot-presence-CmVi0zTc.js +0 -68
  237. package/components/observe-slot-presence-bc9chhsi.cjs +0 -18
  238. package/components/observe-slot-text-BPfIQQtz.js +0 -87
  239. package/components/observe-slot-text-Ceb7SvYT.cjs +0 -18
  240. package/components/overlay-Cig9r6uU.js +0 -2747
  241. package/components/overlay-KSKMzzkh.cjs +0 -47
  242. package/components/pending-state-CaH1si5b.cjs +0 -26
  243. package/components/picker-BfBP7XJN.js +0 -461
  244. package/components/picker-xIphqE6d.cjs +0 -123
  245. package/components/platform-BM-uMWpX.js +0 -69
  246. package/components/platform-BiXhwqk3.cjs +0 -18
  247. package/components/popover-DjX0aAnY.js +0 -67
  248. package/components/popover-KFfO0IYL.cjs +0 -30
  249. package/components/progress-circle-BvRJNuNo.cjs +0 -33
  250. package/components/progress-circle-DXH9z8-6.js +0 -97
  251. package/components/query-BL-TJj7K.cjs +0 -22
  252. package/components/query-D_KR_GUc.js +0 -51
  253. package/components/query-assigned-elements-DjfhL1cl.js +0 -36
  254. package/components/query-assigned-elements-DsKsfk7G.cjs +0 -22
  255. package/components/query-assigned-nodes-BcKWmGzy.cjs +0 -22
  256. package/components/query-assigned-nodes-C76XVPWY.js +0 -36
  257. package/components/random-id-CqvckpWe.cjs +0 -18
  258. package/components/roving-tabindex-By_fCy_e.cjs +0 -18
  259. package/components/roving-tabindex-DOg4z6ZU.js +0 -66
  260. package/components/sized-mixin-CPxE5C96.cjs +0 -18
  261. package/components/sized-mixin-D4ACoVUr.js +0 -63
  262. package/components/slottable-request-event-BfUUt1Mh.cjs +0 -18
  263. package/components/state-D8JEtYqe.cjs +0 -22
  264. package/components/state-Deh-vKYE.js +0 -29
  265. package/components/strategies-9indNIEb.js +0 -195
  266. package/components/strategies-BACP6MhR.cjs +0 -18
  267. package/components/streaming-listener-B00MvALi.cjs +0 -18
  268. package/components/streaming-listener-CP-JE6Fa.js +0 -91
  269. package/components/style-map-CeilmSgs.cjs +0 -22
  270. package/components/style-map-IgqIKvlE.js +0 -53
  271. package/components/text-field-CeG75PPO.cjs +0 -85
  272. package/components/text-field-DCl-AFM-.js +0 -314
  273. package/components/text-field.module-C2KVUJcX.js +0 -21
  274. package/components/text-field.module-DXhFA9G-.cjs +0 -18
  275. package/components/when-CDZyJPvd.cjs +0 -22
@@ -15,26 +15,185 @@
15
15
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16
16
  * SOFTWARE.
17
17
  * */
18
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../base-CBCg3yyw.cjs"),L=require("../focus-visible-B0P9aY_G.cjs"),I=require("../observe-slot-presence-bc9chhsi.cjs"),E=require("../observe-slot-text-Ceb7SvYT.cjs"),y=require("../random-id-CqvckpWe.cjs"),f=require("../query-BL-TJj7K.cjs"),m=require("../class-map-Di1D_rCm.cjs"),x=require("../if-defined-C9YGdo33.cjs"),S=require("../sized-mixin-CPxE5C96.cjs"),$=require("../focusable-EbipgXRh.cjs"),q=require("../roving-tabindex-By_fCy_e.cjs"),w=require("../luzmo-icons-D4IvHgVd.cjs"),A=require("../state-D8JEtYqe.cjs"),_=require("../query-assigned-elements-DsKsfk7G.cjs");require("../action-button/index.cjs");require("../icon/index.cjs");const P=':host{font-family:var(--luzmo-tab-font-family, var(--luzmo-font-family));box-sizing:border-box;block-size:calc(var(--luzmo-tabs-item-height, var(--tabs-item-height)) - var(--luzmo-tabs-divider-size, var(--tabs-divider-size)));z-index:1;white-space:nowrap;color:var(--highcontrast-tabs-color, var(--luzmo-tabs-color, var(--tabs-color)));transition:color var(--luzmo-tabs-animation-duration, var(--tabs-animation-duration)) ease-out;cursor:pointer;outline:none;-webkit-text-decoration:none;text-decoration:none;position:relative}::slotted([slot=icon]){block-size:var(--luzmo-tabs-icon-size, var(--tabs-icon-size));inline-size:var(--luzmo-tabs-icon-size, var(--tabs-icon-size));margin-block-start:var(--luzmo-tabs-top-to-icon, var(--tabs-top-to-icon))}[name=icon]+#item-label{margin-inline-start:var(--luzmo-tabs-icon-to-text, var(--tabs-icon-to-text))}:host:before{content:"";box-sizing:border-box;block-size:calc(100% - var(--luzmo-tabs-top-to-text, var(--tabs-top-to-text)));inline-size:calc(100% + var(--luzmo-tabs-focus-indicator-gap, var(--tabs-focus-indicator-gap)) * 2);border:var(--luzmo-tabs-focus-indicator-width, var(--tabs-focus-indicator-width)) solid transparent;border-radius:var(--luzmo-tabs-focus-indicator-border-radius, var(--tabs-focus-indicator-border-radius));pointer-events:none;position:absolute;inset-block-start:calc(var(--luzmo-tabs-top-to-text, var(--tabs-top-to-text)) / 2);inset-inline-start:calc(var(--luzmo-tabs-focus-indicator-gap, var(--tabs-focus-indicator-gap)) * -1);inset-inline-end:calc(var(--luzmo-tabs-focus-indicator-gap, var(--tabs-focus-indicator-gap)) * -1)}@media (hover: hover){:host(:hover){color:var(--highcontrast-tabs-color-hover, var(--luzmo-tabs-color-hover, var(--tabs-color-hover)))}}:host([selected]){color:var(--highcontrast-tabs-color-selected, var(--luzmo-tabs-color-selected, var(--tabs-color-selected)))}:host([disabled]){cursor:default;color:var(--highcontrast-tabs-color-disabled, var(--luzmo-tabs-color-disabled, var(--tabs-color-disabled)))}:host([disabled]) #item-label{cursor:default}:host(:focus-visible){color:var(--highcontrast-tabs-color-key-focus, var(--luzmo-tabs-color-key-focus, var(--tabs-color-key-focus)))}:host(:focus-visible):before{border-color:var(--highcontrast-tabs-focus-indicator-color, var(--luzmo-tabs-focus-indicator-color, var(--tabs-focus-indicator-color)))}#item-label{cursor:pointer;vertical-align:top;font-family:var(--luzmo-tabs-font-family, var(--tabs-font-family));font-style:var(--luzmo-tabs-font-style, var(--tabs-font-style));font-size:var(--luzmo-tabs-font-size, var(--tabs-font-size));font-weight:var(--luzmo-tabs-font-weight, var(--tabs-font-weight));line-height:var(--luzmo-tabs-line-height, var(--tabs-line-height));margin-block-start:var(--luzmo-tabs-top-to-text, var(--tabs-top-to-text));margin-block-end:var(--luzmo-tabs-bottom-to-text, var(--tabs-bottom-to-text));-webkit-text-decoration:none;text-decoration:none;display:inline-block}#item-label:empty{display:none}:host{scroll-margin-inline:var(--luzmo-tabs-item-horizontal-spacing, var(--tabs-item-horizontal-spacing))}:host([disabled]){pointer-events:none}#item-label[hidden]{display:none}@media (forced-colors: active){:host:before{background-color:ButtonFace}:host ::slotted([slot=icon]){z-index:1;position:relative;color:inherit}#item-label{position:relative;z-index:1}:host([selected]){color:HighlightText}:host([selected]) ::slotted([slot=icon]){color:HighlightText}:host([selected]) #item-label{color:HighlightText}}:host([vertical]){display:flex;flex-direction:column;justify-content:center;align-items:center;height:auto}:host([dir][vertical]) slot[name=icon]+#item-label{margin-inline-start:0;margin-block:calc(var(--luzmo-tabs-top-to-text, var(--tabs-top-to-text)) / 2) calc(var(--luzmo-tabs-bottom-to-text, var(--tabs-bottom-to-text)) / 2)}:host([vertical]) ::slotted([slot=icon]){margin-block-start:calc(var(--luzmo-tabs-top-to-icon, var(--tabs-top-to-icon)) / 2)}';var B=Object.defineProperty,v=(l,t,o,i)=>{for(var e=void 0,a=l.length-1,r;a>=0;a--)(r=l[a])&&(e=r(t,o,e)||e);return e&&B(t,o,e),e};class u extends L.FocusVisiblePolyfillMixin(E.ObserveSlotText(I.ObserveSlotPresence(s.LuzmoElement,'[slot="icon"]'),"")){constructor(){super(...arguments),this.disabled=!1,this.label="",this.selected=!1,this.vertical=!1,this.value=""}static get styles(){return[s.r(P)]}get hasIcon(){return this.slotContentIsPresent}get hasLabel(){return!!this.label||this.slotHasContent}render(){return s.x`
19
- ${this.hasIcon?s.x` <slot name="icon"></slot> `:s.E}
18
+ "use strict";
19
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
20
+ const lit = require("lit");
21
+ const property_js = require("lit/decorators/property.js");
22
+ const base = require("../base-COw9n7UR.cjs");
23
+ const focusVisible = require("../focus-visible-B-B8-P9R.cjs");
24
+ const observeSlotPresence = require("../observe-slot-presence-9AwLGUQ_.cjs");
25
+ const observeSlotText = require("../observe-slot-text-CSofZeeF.cjs");
26
+ const randomId = require("../random-id-BE6HA503.cjs");
27
+ const intersectionController_js = require("@lit-labs/observers/intersection-controller.js");
28
+ const resizeController_js = require("@lit-labs/observers/resize-controller.js");
29
+ const decorators_js = require("lit/decorators.js");
30
+ const classMap_js = require("lit/directives/class-map.js");
31
+ const ifDefined_js = require("lit/directives/if-defined.js");
32
+ const sizedMixin = require("../sized-mixin-UaTVa-AE.cjs");
33
+ const focusable = require("../focusable-BPrTcZPd.cjs");
34
+ const rovingTabindex = require("../roving-tabindex-AsmAh2In.cjs");
35
+ const icons = require("@luzmo/icons");
36
+ require("../action-button/index.cjs");
37
+ require("../icon/index.cjs");
38
+ const tabItemStyles = ':host{font-family:var(--luzmo-tab-font-family, var(--luzmo-font-family));box-sizing:border-box;block-size:calc(var(--luzmo-tabs-item-height, var(--tabs-item-height)) - var(--luzmo-tabs-divider-size, var(--tabs-divider-size)));z-index:1;white-space:nowrap;color:var(--highcontrast-tabs-color, var(--luzmo-tabs-color, var(--tabs-color)));transition:color var(--luzmo-tabs-animation-duration, var(--tabs-animation-duration)) ease-out;cursor:pointer;outline:none;-webkit-text-decoration:none;text-decoration:none;position:relative}::slotted([slot=icon]){block-size:var(--luzmo-tabs-icon-size, var(--tabs-icon-size));inline-size:var(--luzmo-tabs-icon-size, var(--tabs-icon-size));margin-block-start:var(--luzmo-tabs-top-to-icon, var(--tabs-top-to-icon))}[name=icon]+#item-label{margin-inline-start:var(--luzmo-tabs-icon-to-text, var(--tabs-icon-to-text))}:host:before{content:"";box-sizing:border-box;block-size:calc(100% - var(--luzmo-tabs-top-to-text, var(--tabs-top-to-text)));inline-size:calc(100% + var(--luzmo-tabs-focus-indicator-gap, var(--tabs-focus-indicator-gap)) * 2);border:var(--luzmo-tabs-focus-indicator-width, var(--tabs-focus-indicator-width)) solid transparent;border-radius:var(--luzmo-tabs-focus-indicator-border-radius, var(--tabs-focus-indicator-border-radius));pointer-events:none;position:absolute;inset-block-start:calc(var(--luzmo-tabs-top-to-text, var(--tabs-top-to-text)) / 2);inset-inline-start:calc(var(--luzmo-tabs-focus-indicator-gap, var(--tabs-focus-indicator-gap)) * -1);inset-inline-end:calc(var(--luzmo-tabs-focus-indicator-gap, var(--tabs-focus-indicator-gap)) * -1)}@media (hover: hover){:host(:hover){color:var(--highcontrast-tabs-color-hover, var(--luzmo-tabs-color-hover, var(--tabs-color-hover)))}}:host([selected]){color:var(--highcontrast-tabs-color-selected, var(--luzmo-tabs-color-selected, var(--tabs-color-selected)))}:host([disabled]){cursor:default;color:var(--highcontrast-tabs-color-disabled, var(--luzmo-tabs-color-disabled, var(--tabs-color-disabled)))}:host([disabled]) #item-label{cursor:default}:host(:focus-visible){color:var(--highcontrast-tabs-color-key-focus, var(--luzmo-tabs-color-key-focus, var(--tabs-color-key-focus)))}:host(:focus-visible):before{border-color:var(--highcontrast-tabs-focus-indicator-color, var(--luzmo-tabs-focus-indicator-color, var(--tabs-focus-indicator-color)))}#item-label{cursor:pointer;vertical-align:top;font-family:var(--luzmo-tabs-font-family, var(--tabs-font-family));font-style:var(--luzmo-tabs-font-style, var(--tabs-font-style));font-size:var(--luzmo-tabs-font-size, var(--tabs-font-size));font-weight:var(--luzmo-tabs-font-weight, var(--tabs-font-weight));line-height:var(--luzmo-tabs-line-height, var(--tabs-line-height));margin-block-start:var(--luzmo-tabs-top-to-text, var(--tabs-top-to-text));margin-block-end:var(--luzmo-tabs-bottom-to-text, var(--tabs-bottom-to-text));-webkit-text-decoration:none;text-decoration:none;display:inline-block}#item-label:empty{display:none}:host{scroll-margin-inline:var(--luzmo-tabs-item-horizontal-spacing, var(--tabs-item-horizontal-spacing))}:host([disabled]){pointer-events:none}#item-label[hidden]{display:none}@media (forced-colors: active){:host:before{background-color:ButtonFace}:host ::slotted([slot=icon]){z-index:1;position:relative;color:inherit}#item-label{position:relative;z-index:1}:host([selected]){color:HighlightText}:host([selected]) ::slotted([slot=icon]){color:HighlightText}:host([selected]) #item-label{color:HighlightText}}:host([vertical]){display:flex;flex-direction:column;justify-content:center;align-items:center;height:auto}:host([dir][vertical]) slot[name=icon]+#item-label{margin-inline-start:0;margin-block:calc(var(--luzmo-tabs-top-to-text, var(--tabs-top-to-text)) / 2) calc(var(--luzmo-tabs-bottom-to-text, var(--tabs-bottom-to-text)) / 2)}:host([vertical]) ::slotted([slot=icon]){margin-block-start:calc(var(--luzmo-tabs-top-to-icon, var(--tabs-top-to-icon)) / 2)}';
39
+ var __defProp$3 = Object.defineProperty;
40
+ var __decorateClass$3 = (decorators, target, key, kind) => {
41
+ var result = void 0;
42
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
43
+ if (decorator = decorators[i])
44
+ result = decorator(target, key, result) || result;
45
+ if (result) __defProp$3(target, key, result);
46
+ return result;
47
+ };
48
+ class LuzmoTab extends focusVisible.FocusVisiblePolyfillMixin(
49
+ observeSlotText.ObserveSlotText(observeSlotPresence.ObserveSlotPresence(base.LuzmoElement, '[slot="icon"]'), "")
50
+ ) {
51
+ constructor() {
52
+ super(...arguments);
53
+ this.disabled = false;
54
+ this.label = "";
55
+ this.selected = false;
56
+ this.vertical = false;
57
+ this.value = "";
58
+ }
59
+ static get styles() {
60
+ return [lit.unsafeCSS(tabItemStyles)];
61
+ }
62
+ get hasIcon() {
63
+ return this.slotContentIsPresent;
64
+ }
65
+ get hasLabel() {
66
+ return !!this.label || this.slotHasContent;
67
+ }
68
+ render() {
69
+ return lit.html`
70
+ ${this.hasIcon ? lit.html` <slot name="icon"></slot> ` : lit.nothing}
20
71
  <label id="item-label" ?hidden=${!this.hasLabel}>
21
- ${this.slotHasContent?s.E:this.label}
72
+ ${this.slotHasContent ? lit.nothing : this.label}
22
73
  <slot>${this.label}</slot>
23
74
  </label>
24
- `}firstUpdated(t){super.firstUpdated(t),this.setAttribute("role","tab"),this.hasAttribute("id")||(this.id=`luzmo-tab-${y.randomID()}`)}updated(t){super.updated(t),t.has("selected")&&(this.setAttribute("aria-selected",this.selected?"true":"false"),this.setAttribute("tabindex",this.selected?"0":"-1")),t.has("disabled")&&(this.disabled?this.setAttribute("aria-disabled","true"):this.removeAttribute("aria-disabled"))}}v([s.n({type:Boolean,reflect:!0})],u.prototype,"disabled");v([s.n({reflect:!0})],u.prototype,"label");v([s.n({type:Boolean,reflect:!0})],u.prototype,"selected");v([s.n({type:Boolean,reflect:!0})],u.prototype,"vertical");v([s.n({type:String,reflect:!0})],u.prototype,"value");const U=":host{display:inline-flex;font-family:var(--luzmo-tab-panel-font-family, var(--luzmo-font-family))}:host(:not([selected])){display:none}:host(:focus-visible){outline:var(--luzmo-tab-panel-indicator-color, var(--luzmo-indicator-color)) solid var(--luzmo-tab-panel-indicator-width, var(--luzmo-indicator-width))}";var D=Object.defineProperty,k=(l,t,o,i)=>{for(var e=void 0,a=l.length-1,r;a>=0;a--)(r=l[a])&&(e=r(t,o,e)||e);return e&&D(t,o,e),e};class p extends s.LuzmoElement{constructor(){super(...arguments),this.selected=!1,this.value=""}static get styles(){return[s.r(U)]}handleFocusin(){this.removeAttribute("tabindex")}handleFocusout(){this.tabIndex=this.selected?0:-1}render(){return s.x`
75
+ `;
76
+ }
77
+ firstUpdated(changes) {
78
+ super.firstUpdated(changes);
79
+ this.setAttribute("role", "tab");
80
+ if (!this.hasAttribute("id")) {
81
+ this.id = `luzmo-tab-${randomId.randomID()}`;
82
+ }
83
+ }
84
+ updated(changes) {
85
+ super.updated(changes);
86
+ if (changes.has("selected")) {
87
+ this.setAttribute("aria-selected", this.selected ? "true" : "false");
88
+ this.setAttribute("tabindex", this.selected ? "0" : "-1");
89
+ }
90
+ if (changes.has("disabled")) {
91
+ if (this.disabled) {
92
+ this.setAttribute("aria-disabled", "true");
93
+ } else {
94
+ this.removeAttribute("aria-disabled");
95
+ }
96
+ }
97
+ }
98
+ }
99
+ __decorateClass$3([
100
+ property_js.property({ type: Boolean, reflect: true })
101
+ ], LuzmoTab.prototype, "disabled");
102
+ __decorateClass$3([
103
+ property_js.property({ reflect: true })
104
+ ], LuzmoTab.prototype, "label");
105
+ __decorateClass$3([
106
+ property_js.property({ type: Boolean, reflect: true })
107
+ ], LuzmoTab.prototype, "selected");
108
+ __decorateClass$3([
109
+ property_js.property({ type: Boolean, reflect: true })
110
+ ], LuzmoTab.prototype, "vertical");
111
+ __decorateClass$3([
112
+ property_js.property({ type: String, reflect: true })
113
+ ], LuzmoTab.prototype, "value");
114
+ const panelStyles = ":host{display:inline-flex;font-family:var(--luzmo-tab-panel-font-family, var(--luzmo-font-family))}:host(:not([selected])){display:none}:host(:focus-visible){outline:var(--luzmo-tab-panel-indicator-color, var(--luzmo-indicator-color)) solid var(--luzmo-tab-panel-indicator-width, var(--luzmo-indicator-width))}";
115
+ var __defProp$2 = Object.defineProperty;
116
+ var __decorateClass$2 = (decorators, target, key, kind) => {
117
+ var result = void 0;
118
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
119
+ if (decorator = decorators[i])
120
+ result = decorator(target, key, result) || result;
121
+ if (result) __defProp$2(target, key, result);
122
+ return result;
123
+ };
124
+ class LuzmoTabPanel extends base.LuzmoElement {
125
+ constructor() {
126
+ super(...arguments);
127
+ this.selected = false;
128
+ this.value = "";
129
+ }
130
+ static get styles() {
131
+ return [lit.unsafeCSS(panelStyles)];
132
+ }
133
+ handleFocusin() {
134
+ this.removeAttribute("tabindex");
135
+ }
136
+ handleFocusout() {
137
+ this.tabIndex = this.selected ? 0 : -1;
138
+ }
139
+ render() {
140
+ return lit.html`
25
141
  <slot
26
142
  @focusin=${this.handleFocusin}
27
143
  @focusout=${this.handleFocusout}
28
144
  ></slot>
29
- `}firstUpdated(){this.slot="tab-panel",this.setAttribute("role","tabpanel"),this.tabIndex=0,this.hasAttribute("id")||(this.id=`luzmo-tab-panel-${y.randomID()}`)}updated(t){t.has("selected")&&(this.selected?(this.removeAttribute("aria-hidden"),this.tabIndex=0):(this.setAttribute("aria-hidden","true"),this.tabIndex=-1))}}k([s.n({type:Boolean,reflect:!0})],p.prototype,"selected");k([s.n({type:String,reflect:!0})],p.prototype,"value");/**
30
- * @license
31
- * Copyright 2021 Google LLC
32
- * SPDX-License-Identifier: BSD-3-Clause
33
- */class O{constructor(t,{target:o,config:i,callback:e,skipInitial:a}){this.t=new Set,this.o=!1,this.i=!1,this.h=t,o!==null&&this.t.add(o??t),this.o=a??this.o,this.callback=e,window.IntersectionObserver?(this.u=new IntersectionObserver(r=>{const z=this.i;this.i=!1,this.o&&z||(this.handleChanges(r),this.h.requestUpdate())},i),t.addController(this)):console.warn("IntersectionController error: browser does not support IntersectionObserver.")}handleChanges(t){var o;this.value=(o=this.callback)==null?void 0:o.call(this,t,this.u)}hostConnected(){for(const t of this.t)this.observe(t)}hostDisconnected(){this.disconnect()}async hostUpdated(){const t=this.u.takeRecords();t.length&&this.handleChanges(t)}observe(t){this.t.add(t),this.u.observe(t),this.i=!0}unobserve(t){this.t.delete(t),this.u.unobserve(t)}disconnect(){this.u.disconnect()}}/**
34
- * @license
35
- * Copyright 2021 Google LLC
36
- * SPDX-License-Identifier: BSD-3-Clause
37
- */class C{constructor(t,{target:o,config:i,callback:e,skipInitial:a}){this.t=new Set,this.o=!1,this.i=!1,this.h=t,o!==null&&this.t.add(o??t),this.l=i,this.o=a??this.o,this.callback=e,window.ResizeObserver?(this.u=new ResizeObserver(r=>{this.handleChanges(r),this.h.requestUpdate()}),t.addController(this)):console.warn("ResizeController error: browser does not support ResizeObserver.")}handleChanges(t){var o;this.value=(o=this.callback)==null?void 0:o.call(this,t,this.u)}hostConnected(){for(const t of this.t)this.observe(t)}hostDisconnected(){this.disconnect()}async hostUpdated(){!this.o&&this.i&&this.handleChanges([]),this.i=!1}observe(t){this.t.add(t),this.u.observe(t,this.l),this.i=!0,this.h.requestUpdate()}unobserve(t){this.t.delete(t),this.u.unobserve(t)}disconnect(){this.u.disconnect()}}const T="#list{--tabs-item-height: calc( var(--luzmo-component-height) + var(--luzmo-spacing-5) );--tabs-item-horizontal-spacing: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-3) );--tabs-item-vertical-spacing: var(--luzmo-spacing-2);--tabs-start-to-edge: var(--luzmo-spacing-4);--tabs-top-to-text: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--tabs-bottom-to-text: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--tabs-icon-size: var(--luzmo-icon-size-s);--tabs-icon-to-text: var(--luzmo-spacing-3);--tabs-top-to-icon: var(--luzmo-spacing-4);--tabs-focus-indicator-gap: var(--luzmo-spacing-3);--tabs-font-size: var(--luzmo-font-size)}:host([size=s]) #list{--tabs-item-height: calc( var(--luzmo-component-height-s) + var(--luzmo-spacing-4) );--tabs-item-horizontal-spacing: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-2) );--tabs-item-vertical-spacing: var(--luzmo-spacing-2);--tabs-start-to-edge: var(--luzmo-spacing-4);--tabs-top-to-text: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--tabs-bottom-to-text: var(--luzmo-spacing-4);--tabs-icon-size: var(--luzmo-icon-size-xs);--tabs-icon-to-text: var(--luzmo-spacing-3);--tabs-top-to-icon: var(--luzmo-spacing-4);--tabs-focus-indicator-gap: var(--luzmo-spacing-3);--tabs-font-size: var(--luzmo-font-size-s)}:host([size=l]) #list{--tabs-item-height: calc( var(--luzmo-component-height-l) + var(--luzmo-spacing-5) );--tabs-item-horizontal-spacing: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-4) );--tabs-item-vertical-spacing: var(--luzmo-spacing-2);--tabs-start-to-edge: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--tabs-top-to-text: calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--tabs-bottom-to-text: calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--tabs-icon-size: var(--luzmo-icon-size-m);--tabs-icon-to-text: calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--tabs-top-to-icon: var(--luzmo-spacing-5);--tabs-focus-indicator-gap: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--tabs-font-size: var(--luzmo-font-size-l)}:host([size=xl]) #list{--tabs-item-height: calc( var(--luzmo-component-height-xl) + var(--luzmo-spacing-5) );--tabs-item-horizontal-spacing: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-4) );--tabs-item-vertical-spacing: var(--luzmo-spacing-2);--tabs-start-to-edge: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--tabs-top-to-text: calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--tabs-bottom-to-text: calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--tabs-icon-size: var(--luzmo-icon-size-l);--tabs-icon-to-text: calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--tabs-top-to-icon: var(--luzmo-spacing-5);--tabs-focus-indicator-gap: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--tabs-font-size: var(--luzmo-font-size-xl)}:host([compact]) #list{--luzmo-tabs-item-height: var( --luzmo-tabs-item-height-compact, var(--luzmo-component-height) );--luzmo-tabs-top-to-text: var( --luzmo-tabs-top-to-text-compact, calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1)) );--luzmo-tabs-bottom-to-text: var( --luzmo-tabs-bottom-to-text-compact, calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1)) );--luzmo-tabs-top-to-icon: var( --luzmo-tabs-top-to-icon-compact, var(--luzmo-spacing-2) )}:host([size=s][compact]) #list{--luzmo-tabs-item-height: var( --luzmo-tabs-item-height-compact, var(--luzmo-component-height-s) );--luzmo-tabs-top-to-text: var( --luzmo-tabs-top-to-text-compact, var(--luzmo-spacing-2) );--luzmo-tabs-bottom-to-text: var( --luzmo-tabs-bottom-to-text-compact, var(--luzmo-spacing-2) );--luzmo-tabs-top-to-icon: var( --luzmo-tabs-top-to-icon-compact, var(--luzmo-spacing-1) )}:host([size=l][compact]) #list{--luzmo-tabs-item-height: var( --luzmo-tabs-item-height-compact, var(--luzmo-component-height-l) );--luzmo-tabs-top-to-text: var( --luzmo-tabs-top-to-text-compact, calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1)) );--luzmo-tabs-bottom-to-text: var( --luzmo-tabs-bottom-to-text-compact, calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1)) );--luzmo-tabs-top-to-icon: var( --luzmo-tabs-top-to-icon-compact, calc(var(--luzmo-spacing-3)) )}:host([size=xl][compact]) #list{--luzmo-tabs-item-height: var( --luzmo-tabs-item-height-compact, var(--luzmo-component-height-xl) );--luzmo-tabs-top-to-text: var( --luzmo-tabs-top-to-text-compact, var(--luzmo-spacing-4) );--luzmo-tabs-bottom-to-text: var( --luzmo-tabs-bottom-to-text-compact, var(--luzmo-spacing-4) );--luzmo-tabs-top-to-icon: var( --luzmo-tabs-top-to-icon-compact, calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1)) )}",F="#list{--tabs-color: var(--luzmo-font-color);--tabs-color-selected: var(--luzmo-font-color-down);--tabs-color-hover: var(--luzmo-font-color-hover);--tabs-color-key-focus: var(--luzmo-font-color-focus);--tabs-color-disabled: var(--luzmo-disabled-color);--tabs-font-family: var(--luzmo-font-family);--tabs-font-style: var(--luzmo-font-style);--tabs-font-size: var(--luzmo-font-size);--tabs-line-height: var(--luzmo-line-height);--tabs-focus-indicator-width: var(--luzmo-indicator-width);--tabs-focus-indicator-border-radius: var(--luzmo-border-radius);--tabs-focus-indicator-color: var(--luzmo-indicator-color);--tabs-selection-indicator-color: var(--luzmo-font-color-down);--tabs-list-background-direction: top;--tabs-divider-size: 2px;--tabs-divider-border-radius: 1px;--tabs-animation-duration: var(--luzmo-animation-duration);--tabs-animation-ease: ease-in-out}:host([emphasized]) #list{--luzmo-tabs-color-selected: var( --luzmo-tabs-color-selected-emphasized, var(--luzmo-primary) );--luzmo-tabs-color-hover: var( --luzmo-tabs-color-hover-emphasized, var(--luzmo-primary-hover) );--luzmo-tabs-color-key-focus: var( --luzmo-tabs-color-key-focus-emphasized, var(--luzmo-primary-focus) );--luzmo-tabs-selection-indicator-color: var( --luzmo-tabs-selection-indicator-color-emphasized, var(--luzmo-primary-down) )}:host([direction^=vertical]) #list{--luzmo-tabs-list-background-direction: var( --luzmo-tabs-list-background-direction-vertical, right )}:host([direction^=vertical-right]) #list{--luzmo-tabs-list-background-direction: var( --luzmo-tabs-list-background-direction-vertical-right, left )}:host([direction^=vertical]) #list:dir(rtl),:host([dir=rtl][direction^=vertical]) #list{--luzmo-tabs-list-background-direction: var( --luzmo-tabs-list-background-direction-vertical, left )}:host([direction^=vertical-right]) #list:dir(rtl),:host([dir=rtl][direction^=vertical-right]) #list{--luzmo-tabs-list-background-direction: var( --luzmo-tabs-list-background-direction-vertical, right )}#list{z-index:0;vertical-align:top;background:linear-gradient(to var(--luzmo-tabs-list-background-direction, var(--tabs-list-background-direction)),var(--highcontrast-tabs-divider-background-color, var(--luzmo-tabs-divider-background-color, var(--tabs-divider-background-color))) 0 var(--luzmo-tabs-divider-size, var(--tabs-divider-size)),transparent var(--luzmo-tabs-divider-size, var(--tabs-divider-size)));margin:0;padding-block:0;display:flex;position:relative}::slotted([selected]:not([slot])){color:var(--highcontrast-tabs-color-selected, var(--luzmo-tabs-color-selected, var(--tabs-color-selected)))}::slotted([disabled]:not([slot])){cursor:default;color:var(--highcontrast-tabs-color-disabled, var(--luzmo-tabs-color-disabled, var(--tabs-color-disabled)))}#selection-indicator{background-color:var(--highcontrast-tabs-selection-indicator-color, var(--luzmo-tabs-selection-indicator-color, var(--tabs-selection-indicator-color)));z-index:0;transition:transform var(--luzmo-tabs-animation-duration, var(--tabs-animation-duration)) var(--luzmo-tabs-animation-ease, var(--tabs-animation-ease));transform-origin:0 0;border-radius:var(--luzmo-tabs-divider-border-radius, var(--tabs-divider-border-radius));position:absolute;inset-inline-start:0}:host([direction^=horizontal]) #list{align-items:center}:host([direction^=horizontal]) #list ::slotted(:not([slot])){vertical-align:top}:host([direction^=horizontal]) ::slotted(:not(:first-child)){margin-inline-start:var(--luzmo-tabs-item-horizontal-spacing, var(--tabs-item-horizontal-spacing))}:host([direction^=horizontal]) #list #selection-indicator{block-size:var(--luzmo-tabs-divider-size, var(--tabs-divider-size));position:absolute;inset-block-end:0}:host([direction^=horizontal][compact]) #list{box-sizing:initial;align-items:end}:host([quiet]) #list{background:none;border-color:transparent;display:inline-flex}:host([quiet]) #selection-indicator{padding-inline-start:var(--luzmo-tabs-start-to-item-quiet)}:host([direction^=vertical]) #list,:host([direction^=vertical-right]) #list{flex-direction:column;padding:0;display:inline-flex}:host([direction^=vertical-right][quiet]) #list,:host([direction^=vertical][quiet]) #list{border-color:transparent}:host([direction^=vertical]) #list ::slotted(:not([slot])),:host([direction^=vertical-right]) #list ::slotted(:not([slot])){block-size:var(--luzmo-tabs-item-height, var(--tabs-item-height));line-height:var(--luzmo-tabs-item-height, var(--tabs-item-height));margin-block-end:var(--luzmo-tabs-item-vertical-spacing, var(--tabs-item-vertical-spacing));margin-inline-start:var(--luzmo-tabs-start-to-edge, var(--tabs-start-to-edge));margin-inline-end:var(--luzmo-tabs-start-to-edge, var(--tabs-start-to-edge));padding-block:0}:host([direction^=vertical]) #list ::slotted(:not([slot])):before,:host([direction^=vertical-right]) #list ::slotted(:not([slot])):before{inset-inline-start:calc(var(--luzmo-tabs-focus-indicator-gap, var(--tabs-focus-indicator-gap)) * -1)}:host([direction^=vertical]) #list #selection-indicator,:host([direction^=vertical-right]) #list #selection-indicator{inline-size:var(--luzmo-tabs-divider-size, var(--tabs-divider-size));position:absolute;inset-block-start:0;inset-inline-start:0}:host([direction^=vertical-right]) #list #selection-indicator{inset-inline:auto 0}@media (forced-colors: active){#list{--highcontrast-tabs-divider-background-color: var(--luzmo-border-color);--highcontrast-tabs-selection-indicator-color: Highlight;--highcontrast-tabs-focus-indicator-color: CanvasText;--highcontrast-tabs-focus-indicator-background-color: Highlight;--highcontrast-tabs-color: ButtonText;--highcontrast-tabs-color-hover: ButtonText;--highcontrast-tabs-color-selected: HighlightText;--highcontrast-tabs-color-key-focus: ButtonText;--highcontrast-tabs-color-disabled: GrayText;forced-color-adjust:none}#list ::slotted([selected]:not([slot])):before{background-color:var(--highcontrast-tabs-focus-indicator-background-color)}:host([direction^=vertical][compact]) #list #list ::slotted(:not([slot])):before{block-size:100%;inset-block-start:0}:host([quiet]) #list{background:linear-gradient(to var(--luzmo-tabs-list-background-direction, var(--tabs-list-background-direction)),var(--highcontrast-tabs-divider-background-color, var(--luzmo-tabs-divider-background-color, var(--tabs-divider-background-color))) 0 var(--luzmo-tabs-divider-size, var(--tabs-divider-size)),transparent var(--luzmo-tabs-divider-size, var(--tabs-divider-size)))}}#list{--tabs-font-weight: var(--luzmo-font-weight);--tabs-divider-background-color: var(--luzmo-border-color)}:host{display:grid;grid-template-columns:100%;position:relative}:host(:not([direction^=vertical])){grid-template-rows:auto 1fr}:host([direction^=vertical]){grid-template-columns:auto 1fr}:host([dir=rtl]) #selection-indicator{left:0;right:auto}:host([direction=vertical-right]) #list #selection-indicator{inset-inline:auto 0}#list{justify-content:var(--luzmo-tabs-list-justify-content)}:host([disabled]) #list{pointer-events:none}:host([disabled]) #list #selection-indicator{background-color:var(--luzmo-tabs-color-disabled, var(--tabs-color-disabled))}:host([disabled]) ::slotted(sp-tab){color:var(--luzmo-tabs-color-disabled, var(--tabs-color-disabled))}:host([direction=vertical-right]) #list #selection-indicator,:host([direction=vertical]) #list #selection-indicator{inset-block-start:0}#selection-indicator.first-position{transition:none}:host([dir][direction=horizontal]) #list.scroll{scrollbar-width:none;overflow:auto hidden}:host([dir][direction=horizontal]) #list.scroll::-webkit-scrollbar{display:none}";var R=Object.defineProperty,c=(l,t,o,i)=>{for(var e=void 0,a=l.length-1,r;a>=0;a--)(r=l[a])&&(e=r(t,o,e)||e);return e&&R(t,o,e),e};const h={baseSize:100,noSelectionStyle:"transform: translateX(0px) scaleX(0) scaleY(0)",transformX(l,t){const o=t/this.baseSize;return`transform: translateX(${l}px) scaleX(${o});`},transformY(l,t){const o=t/this.baseSize;return`transform: translateY(${l}px) scaleY(${o});`},baseStyles(){return s.i`
145
+ `;
146
+ }
147
+ firstUpdated() {
148
+ this.slot = "tab-panel";
149
+ this.setAttribute("role", "tabpanel");
150
+ this.tabIndex = 0;
151
+ if (!this.hasAttribute("id")) {
152
+ this.id = `luzmo-tab-panel-${randomId.randomID()}`;
153
+ }
154
+ }
155
+ updated(changes) {
156
+ if (changes.has("selected")) {
157
+ if (this.selected) {
158
+ this.removeAttribute("aria-hidden");
159
+ this.tabIndex = 0;
160
+ } else {
161
+ this.setAttribute("aria-hidden", "true");
162
+ this.tabIndex = -1;
163
+ }
164
+ }
165
+ }
166
+ }
167
+ __decorateClass$2([
168
+ property_js.property({ type: Boolean, reflect: true })
169
+ ], LuzmoTabPanel.prototype, "selected");
170
+ __decorateClass$2([
171
+ property_js.property({ type: String, reflect: true })
172
+ ], LuzmoTabPanel.prototype, "value");
173
+ const tabSizes = "#list{--tabs-item-height: calc( var(--luzmo-component-height) + var(--luzmo-spacing-5) );--tabs-item-horizontal-spacing: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-3) );--tabs-item-vertical-spacing: var(--luzmo-spacing-2);--tabs-start-to-edge: var(--luzmo-spacing-4);--tabs-top-to-text: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--tabs-bottom-to-text: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--tabs-icon-size: var(--luzmo-icon-size-s);--tabs-icon-to-text: var(--luzmo-spacing-3);--tabs-top-to-icon: var(--luzmo-spacing-4);--tabs-focus-indicator-gap: var(--luzmo-spacing-3);--tabs-font-size: var(--luzmo-font-size)}:host([size=s]) #list{--tabs-item-height: calc( var(--luzmo-component-height-s) + var(--luzmo-spacing-4) );--tabs-item-horizontal-spacing: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-2) );--tabs-item-vertical-spacing: var(--luzmo-spacing-2);--tabs-start-to-edge: var(--luzmo-spacing-4);--tabs-top-to-text: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--tabs-bottom-to-text: var(--luzmo-spacing-4);--tabs-icon-size: var(--luzmo-icon-size-xs);--tabs-icon-to-text: var(--luzmo-spacing-3);--tabs-top-to-icon: var(--luzmo-spacing-4);--tabs-focus-indicator-gap: var(--luzmo-spacing-3);--tabs-font-size: var(--luzmo-font-size-s)}:host([size=l]) #list{--tabs-item-height: calc( var(--luzmo-component-height-l) + var(--luzmo-spacing-5) );--tabs-item-horizontal-spacing: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-4) );--tabs-item-vertical-spacing: var(--luzmo-spacing-2);--tabs-start-to-edge: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--tabs-top-to-text: calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--tabs-bottom-to-text: calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--tabs-icon-size: var(--luzmo-icon-size-m);--tabs-icon-to-text: calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--tabs-top-to-icon: var(--luzmo-spacing-5);--tabs-focus-indicator-gap: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--tabs-font-size: var(--luzmo-font-size-l)}:host([size=xl]) #list{--tabs-item-height: calc( var(--luzmo-component-height-xl) + var(--luzmo-spacing-5) );--tabs-item-horizontal-spacing: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-4) );--tabs-item-vertical-spacing: var(--luzmo-spacing-2);--tabs-start-to-edge: calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1));--tabs-top-to-text: calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--tabs-bottom-to-text: calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--tabs-icon-size: var(--luzmo-icon-size-l);--tabs-icon-to-text: calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1));--tabs-top-to-icon: var(--luzmo-spacing-5);--tabs-focus-indicator-gap: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--tabs-font-size: var(--luzmo-font-size-xl)}:host([compact]) #list{--luzmo-tabs-item-height: var( --luzmo-tabs-item-height-compact, var(--luzmo-component-height) );--luzmo-tabs-top-to-text: var( --luzmo-tabs-top-to-text-compact, calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1)) );--luzmo-tabs-bottom-to-text: var( --luzmo-tabs-bottom-to-text-compact, calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1)) );--luzmo-tabs-top-to-icon: var( --luzmo-tabs-top-to-icon-compact, var(--luzmo-spacing-2) )}:host([size=s][compact]) #list{--luzmo-tabs-item-height: var( --luzmo-tabs-item-height-compact, var(--luzmo-component-height-s) );--luzmo-tabs-top-to-text: var( --luzmo-tabs-top-to-text-compact, var(--luzmo-spacing-2) );--luzmo-tabs-bottom-to-text: var( --luzmo-tabs-bottom-to-text-compact, var(--luzmo-spacing-2) );--luzmo-tabs-top-to-icon: var( --luzmo-tabs-top-to-icon-compact, var(--luzmo-spacing-1) )}:host([size=l][compact]) #list{--luzmo-tabs-item-height: var( --luzmo-tabs-item-height-compact, var(--luzmo-component-height-l) );--luzmo-tabs-top-to-text: var( --luzmo-tabs-top-to-text-compact, calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1)) );--luzmo-tabs-bottom-to-text: var( --luzmo-tabs-bottom-to-text-compact, calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1)) );--luzmo-tabs-top-to-icon: var( --luzmo-tabs-top-to-icon-compact, calc(var(--luzmo-spacing-3)) )}:host([size=xl][compact]) #list{--luzmo-tabs-item-height: var( --luzmo-tabs-item-height-compact, var(--luzmo-component-height-xl) );--luzmo-tabs-top-to-text: var( --luzmo-tabs-top-to-text-compact, var(--luzmo-spacing-4) );--luzmo-tabs-bottom-to-text: var( --luzmo-tabs-bottom-to-text-compact, var(--luzmo-spacing-4) );--luzmo-tabs-top-to-icon: var( --luzmo-tabs-top-to-icon-compact, calc(var(--luzmo-spacing-3) + var(--luzmo-spacing-1)) )}";
174
+ const tabStyles = "#list{--tabs-color: var(--luzmo-font-color);--tabs-color-selected: var(--luzmo-font-color-down);--tabs-color-hover: var(--luzmo-font-color-hover);--tabs-color-key-focus: var(--luzmo-font-color-focus);--tabs-color-disabled: var(--luzmo-disabled-color);--tabs-font-family: var(--luzmo-font-family);--tabs-font-style: var(--luzmo-font-style);--tabs-font-size: var(--luzmo-font-size);--tabs-line-height: var(--luzmo-line-height);--tabs-focus-indicator-width: var(--luzmo-indicator-width);--tabs-focus-indicator-border-radius: var(--luzmo-border-radius);--tabs-focus-indicator-color: var(--luzmo-indicator-color);--tabs-selection-indicator-color: var(--luzmo-font-color-down);--tabs-list-background-direction: top;--tabs-divider-size: 2px;--tabs-divider-border-radius: 1px;--tabs-animation-duration: var(--luzmo-animation-duration);--tabs-animation-ease: ease-in-out}:host([emphasized]) #list{--luzmo-tabs-color-selected: var( --luzmo-tabs-color-selected-emphasized, var(--luzmo-primary) );--luzmo-tabs-color-hover: var( --luzmo-tabs-color-hover-emphasized, var(--luzmo-primary-hover) );--luzmo-tabs-color-key-focus: var( --luzmo-tabs-color-key-focus-emphasized, var(--luzmo-primary-focus) );--luzmo-tabs-selection-indicator-color: var( --luzmo-tabs-selection-indicator-color-emphasized, var(--luzmo-primary-down) )}:host([direction^=vertical]) #list{--luzmo-tabs-list-background-direction: var( --luzmo-tabs-list-background-direction-vertical, right )}:host([direction^=vertical-right]) #list{--luzmo-tabs-list-background-direction: var( --luzmo-tabs-list-background-direction-vertical-right, left )}:host([direction^=vertical]) #list:dir(rtl),:host([dir=rtl][direction^=vertical]) #list{--luzmo-tabs-list-background-direction: var( --luzmo-tabs-list-background-direction-vertical, left )}:host([direction^=vertical-right]) #list:dir(rtl),:host([dir=rtl][direction^=vertical-right]) #list{--luzmo-tabs-list-background-direction: var( --luzmo-tabs-list-background-direction-vertical, right )}#list{z-index:0;vertical-align:top;background:linear-gradient(to var(--luzmo-tabs-list-background-direction, var(--tabs-list-background-direction)),var(--highcontrast-tabs-divider-background-color, var(--luzmo-tabs-divider-background-color, var(--tabs-divider-background-color))) 0 var(--luzmo-tabs-divider-size, var(--tabs-divider-size)),transparent var(--luzmo-tabs-divider-size, var(--tabs-divider-size)));margin:0;padding-block:0;display:flex;position:relative}::slotted([selected]:not([slot])){color:var(--highcontrast-tabs-color-selected, var(--luzmo-tabs-color-selected, var(--tabs-color-selected)))}::slotted([disabled]:not([slot])){cursor:default;color:var(--highcontrast-tabs-color-disabled, var(--luzmo-tabs-color-disabled, var(--tabs-color-disabled)))}#selection-indicator{background-color:var(--highcontrast-tabs-selection-indicator-color, var(--luzmo-tabs-selection-indicator-color, var(--tabs-selection-indicator-color)));z-index:0;transition:transform var(--luzmo-tabs-animation-duration, var(--tabs-animation-duration)) var(--luzmo-tabs-animation-ease, var(--tabs-animation-ease));transform-origin:0 0;border-radius:var(--luzmo-tabs-divider-border-radius, var(--tabs-divider-border-radius));position:absolute;inset-inline-start:0}:host([direction^=horizontal]) #list{align-items:center}:host([direction^=horizontal]) #list ::slotted(:not([slot])){vertical-align:top}:host([direction^=horizontal]) ::slotted(:not(:first-child)){margin-inline-start:var(--luzmo-tabs-item-horizontal-spacing, var(--tabs-item-horizontal-spacing))}:host([direction^=horizontal]) #list #selection-indicator{block-size:var(--luzmo-tabs-divider-size, var(--tabs-divider-size));position:absolute;inset-block-end:0}:host([direction^=horizontal][compact]) #list{box-sizing:initial;align-items:end}:host([quiet]) #list{background:none;border-color:transparent;display:inline-flex}:host([quiet]) #selection-indicator{padding-inline-start:var(--luzmo-tabs-start-to-item-quiet)}:host([direction^=vertical]) #list,:host([direction^=vertical-right]) #list{flex-direction:column;padding:0;display:inline-flex}:host([direction^=vertical-right][quiet]) #list,:host([direction^=vertical][quiet]) #list{border-color:transparent}:host([direction^=vertical]) #list ::slotted(:not([slot])),:host([direction^=vertical-right]) #list ::slotted(:not([slot])){block-size:var(--luzmo-tabs-item-height, var(--tabs-item-height));line-height:var(--luzmo-tabs-item-height, var(--tabs-item-height));margin-block-end:var(--luzmo-tabs-item-vertical-spacing, var(--tabs-item-vertical-spacing));margin-inline-start:var(--luzmo-tabs-start-to-edge, var(--tabs-start-to-edge));margin-inline-end:var(--luzmo-tabs-start-to-edge, var(--tabs-start-to-edge));padding-block:0}:host([direction^=vertical]) #list ::slotted(:not([slot])):before,:host([direction^=vertical-right]) #list ::slotted(:not([slot])):before{inset-inline-start:calc(var(--luzmo-tabs-focus-indicator-gap, var(--tabs-focus-indicator-gap)) * -1)}:host([direction^=vertical]) #list #selection-indicator,:host([direction^=vertical-right]) #list #selection-indicator{inline-size:var(--luzmo-tabs-divider-size, var(--tabs-divider-size));position:absolute;inset-block-start:0;inset-inline-start:0}:host([direction^=vertical-right]) #list #selection-indicator{inset-inline:auto 0}@media (forced-colors: active){#list{--highcontrast-tabs-divider-background-color: var(--luzmo-border-color);--highcontrast-tabs-selection-indicator-color: Highlight;--highcontrast-tabs-focus-indicator-color: CanvasText;--highcontrast-tabs-focus-indicator-background-color: Highlight;--highcontrast-tabs-color: ButtonText;--highcontrast-tabs-color-hover: ButtonText;--highcontrast-tabs-color-selected: HighlightText;--highcontrast-tabs-color-key-focus: ButtonText;--highcontrast-tabs-color-disabled: GrayText;forced-color-adjust:none}#list ::slotted([selected]:not([slot])):before{background-color:var(--highcontrast-tabs-focus-indicator-background-color)}:host([direction^=vertical][compact]) #list #list ::slotted(:not([slot])):before{block-size:100%;inset-block-start:0}:host([quiet]) #list{background:linear-gradient(to var(--luzmo-tabs-list-background-direction, var(--tabs-list-background-direction)),var(--highcontrast-tabs-divider-background-color, var(--luzmo-tabs-divider-background-color, var(--tabs-divider-background-color))) 0 var(--luzmo-tabs-divider-size, var(--tabs-divider-size)),transparent var(--luzmo-tabs-divider-size, var(--tabs-divider-size)))}}#list{--tabs-font-weight: var(--luzmo-font-weight);--tabs-divider-background-color: var(--luzmo-border-color)}:host{display:grid;grid-template-columns:100%;position:relative}:host(:not([direction^=vertical])){grid-template-rows:auto 1fr}:host([direction^=vertical]){grid-template-columns:auto 1fr}:host([dir=rtl]) #selection-indicator{left:0;right:auto}:host([direction=vertical-right]) #list #selection-indicator{inset-inline:auto 0}#list{justify-content:var(--luzmo-tabs-list-justify-content)}:host([disabled]) #list{pointer-events:none}:host([disabled]) #list #selection-indicator{background-color:var(--luzmo-tabs-color-disabled, var(--tabs-color-disabled))}:host([disabled]) ::slotted(sp-tab){color:var(--luzmo-tabs-color-disabled, var(--tabs-color-disabled))}:host([direction=vertical-right]) #list #selection-indicator,:host([direction=vertical]) #list #selection-indicator{inset-block-start:0}#selection-indicator.first-position{transition:none}:host([dir][direction=horizontal]) #list.scroll{scrollbar-width:none;overflow:auto hidden}:host([dir][direction=horizontal]) #list.scroll::-webkit-scrollbar{display:none}";
175
+ var __defProp$1 = Object.defineProperty;
176
+ var __decorateClass$1 = (decorators, target, key, kind) => {
177
+ var result = void 0;
178
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
179
+ if (decorator = decorators[i])
180
+ result = decorator(target, key, result) || result;
181
+ if (result) __defProp$1(target, key, result);
182
+ return result;
183
+ };
184
+ const ScaledIndicator = {
185
+ baseSize: 100,
186
+ noSelectionStyle: "transform: translateX(0px) scaleX(0) scaleY(0)",
187
+ transformX(left, width) {
188
+ const scale = width / this.baseSize;
189
+ return `transform: translateX(${left}px) scaleX(${scale});`;
190
+ },
191
+ transformY(top, height) {
192
+ const scale = height / this.baseSize;
193
+ return `transform: translateY(${top}px) scaleY(${scale});`;
194
+ },
195
+ baseStyles() {
196
+ return lit.css`
38
197
  :host([direction='vertical-right']) #selection-indicator,
39
198
  :host([direction='vertical']) #selection-indicator {
40
199
  height: ${this.baseSize}px;
@@ -42,10 +201,269 @@
42
201
  :host([dir][direction='horizontal']) #selection-indicator {
43
202
  width: ${this.baseSize}px;
44
203
  }
45
- `}};function M(l,t,o,i){const e=l+(t==="rtl"?-1:1),a=o[e],r=i.scrollLeft+i.offsetWidth;return a?a.offsetLeft-i.offsetWidth:r}function W(l,t,o,i){const e=l+(t==="rtl"?1:-1),a=o[e],r=t==="rtl"?-i.offsetWidth:0;return a?a.offsetLeft+a.offsetWidth:r}class n extends S.SizedMixin($.Focusable,{noDefaultSize:!0}){constructor(){super(),this.auto=!1,this.compact=!1,this.direction="horizontal",this.emphasized=!1,this.label="",this.enableTabsScroll=!1,this.quiet=!1,this.selectionIndicatorStyle=h.noSelectionStyle,this.shouldAnimate=!1,this.selected="",this._tabs=[],this.resizeController=new C(this,{callback:()=>{this.updateSelectionIndicator()}}),this.rovingTabindexController=new q.RovingTabindexController(this,{focusInIndex:t=>{let o=0;return t.find((e,a)=>{const r=this.selected?e.value===this.selected:!e.disabled;return o=a,r})?o:-1},direction:()=>"both",elementEnterAction:t=>{this.auto&&(this.shouldAnimate=!0,this.selectTarget(t))},elements:()=>this.tabs,isFocusableElement:t=>!this.disabled&&!t.disabled,listenerScope:()=>this.tabList}),this.onTabsScroll=()=>{this.dispatchEvent(new Event("luzmo-tabs-scroll",{bubbles:!0,composed:!0}))},this.onClick=t=>{if(this.disabled)return;const o=t.composedPath().find(i=>i.parentElement===this);!o||o.disabled||(this.shouldAnimate=!0,this.selectTarget(o))},this.onKeyDown=t=>{if(t.code==="Enter"||t.code==="Space"){t.preventDefault();const o=t.target;o&&this.selectTarget(o)}},this.updateCheckedState=()=>{if(this.tabs.forEach(t=>{t.removeAttribute("selected")}),this.selected){const t=this.tabs.find(o=>o.value===this.selected);t?t.selected=!0:this.selected=""}else{const t=this.tabs[0];t&&t.setAttribute("tabindex","0")}this.updateSelectionIndicator()},this.updateSelectionIndicator=async()=>{const t=this.tabs.find(e=>e.selected);if(!t){this.selectionIndicatorStyle=h.noSelectionStyle;return}await Promise.all([t.updateComplete,document.fonts?document.fonts.ready:Promise.resolve()]);const{width:o,height:i}=t.getBoundingClientRect();this.selectionIndicatorStyle=this.direction==="horizontal"?h.transformX(t.offsetLeft,o):h.transformY(t.offsetTop,i)},new O(this,{config:{root:null,rootMargin:"0px",threshold:[0,1]},callback:()=>{this.updateSelectionIndicator()}})}static get styles(){return[s.r(T),s.r(F),h.baseStyles()]}set tabs(t){t!==this.tabs&&(this._tabs.forEach(o=>{this.resizeController.unobserve(o)}),t.forEach(o=>{this.resizeController.observe(o)}),this._tabs=t,this.rovingTabindexController.clearElementCache())}get tabs(){return this._tabs}get focusElement(){return this.rovingTabindexController.focusInElement||this}limitDeltaToInterval(t,o){return i=>i<t?t:i>o?o:i}scrollTabs(t,o="smooth"){var g;if(t===0)return;const{scrollLeft:i,clientWidth:e,scrollWidth:a}=this.tabList,r=a-e-Math.abs(i),z=this.dir==="ltr"?this.limitDeltaToInterval(-i,r):this.limitDeltaToInterval(-r,Math.abs(i));(g=this.tabList)==null||g.scrollBy({left:z(t),top:0,behavior:o})}get scrollState(){if(this.tabList){const{scrollLeft:t,clientWidth:o,scrollWidth:i}=this.tabList,e=Math.abs(t)>0,a=Math.ceil(Math.abs(t))<i-o;return{canScrollLeft:this.dir==="ltr"?e:a,canScrollRight:this.dir==="ltr"?a:e}}return{}}async getUpdateComplete(){const t=await super.getUpdateComplete(),i=[...this.children].map(e=>e.updateComplete!==void 0?e.updateComplete:Promise.resolve(!0));return await Promise.all(i),t}getNecessaryAutoScroll(t){const o=this.tabs[t],i=o.offsetLeft+o.offsetWidth,e=this.tabList.scrollLeft+this.tabList.offsetWidth,a=o.offsetLeft,r=this.tabList.scrollLeft;return i>e?M(t,this.dir,this.tabs,this.tabList):a<r?W(t,this.dir,this.tabs,this.tabList):-1}async scrollToSelection(){if(!this.enableTabsScroll||!this.selected)return;await this.updateComplete;const t=this.tabs.findIndex(o=>o.value===this.selected);if(t!==-1&&this.tabList){const o=this.getNecessaryAutoScroll(t);o!==-1&&this.tabList.scrollTo({left:o})}}updated(t){super.updated(t),t.has("selected")&&this.scrollToSelection()}managePanels({target:t}){t.assignedElements().map(i=>{const{value:e,id:a}=i,r=this.querySelector(`[role="tab"][value="${e}"]`);r&&(r.setAttribute("aria-controls",a),i.setAttribute("aria-labelledby",r.id)),i.selected=e===this.selected})}render(){return s.x`
204
+ `;
205
+ }
206
+ };
207
+ function calculateScrollTargetForRightSide(index, direction, tabs, container) {
208
+ const nextIndex = index + (direction === "rtl" ? -1 : 1);
209
+ const nextTab = tabs[nextIndex];
210
+ const viewportEnd = container.scrollLeft + container.offsetWidth;
211
+ return nextTab ? nextTab.offsetLeft - container.offsetWidth : viewportEnd;
212
+ }
213
+ function calculateScrollTargetForLeftSide(index, direction, tabs, container) {
214
+ const prevIndex = index + (direction === "rtl" ? 1 : -1);
215
+ const prevTab = tabs[prevIndex];
216
+ const leftmostElement = direction === "rtl" ? -container.offsetWidth : 0;
217
+ return prevTab ? prevTab.offsetLeft + prevTab.offsetWidth : leftmostElement;
218
+ }
219
+ class LuzmoTabs extends sizedMixin.SizedMixin(focusable.Focusable, { noDefaultSize: true }) {
220
+ constructor() {
221
+ super();
222
+ this.auto = false;
223
+ this.compact = false;
224
+ this.direction = "horizontal";
225
+ this.emphasized = false;
226
+ this.label = "";
227
+ this.enableTabsScroll = false;
228
+ this.quiet = false;
229
+ this.selectionIndicatorStyle = ScaledIndicator.noSelectionStyle;
230
+ this.shouldAnimate = false;
231
+ this.selected = "";
232
+ this._tabs = [];
233
+ this.resizeController = new resizeController_js.ResizeController(this, {
234
+ callback: () => {
235
+ this.updateSelectionIndicator();
236
+ }
237
+ });
238
+ this.rovingTabindexController = new rovingTabindex.RovingTabindexController(this, {
239
+ focusInIndex: (elements) => {
240
+ let focusInIndex = 0;
241
+ const firstFocusableElement = elements.find((el, index) => {
242
+ const focusInElement = this.selected ? el.value === this.selected : !el.disabled;
243
+ focusInIndex = index;
244
+ return focusInElement;
245
+ });
246
+ return firstFocusableElement ? focusInIndex : -1;
247
+ },
248
+ direction: () => "both",
249
+ elementEnterAction: (el) => {
250
+ if (!this.auto) return;
251
+ this.shouldAnimate = true;
252
+ this.selectTarget(el);
253
+ },
254
+ elements: () => this.tabs,
255
+ isFocusableElement: (el) => !this.disabled && !el.disabled,
256
+ listenerScope: () => this.tabList
257
+ });
258
+ this.onTabsScroll = () => {
259
+ this.dispatchEvent(
260
+ new Event("luzmo-tabs-scroll", {
261
+ bubbles: true,
262
+ composed: true
263
+ })
264
+ );
265
+ };
266
+ this.onClick = (event) => {
267
+ if (this.disabled) {
268
+ return;
269
+ }
270
+ const target = event.composedPath().find((el) => el.parentElement === this);
271
+ if (!target || target.disabled) {
272
+ return;
273
+ }
274
+ this.shouldAnimate = true;
275
+ this.selectTarget(target);
276
+ };
277
+ this.onKeyDown = (event) => {
278
+ if (event.code === "Enter" || event.code === "Space") {
279
+ event.preventDefault();
280
+ const target = event.target;
281
+ if (target) {
282
+ this.selectTarget(target);
283
+ }
284
+ }
285
+ };
286
+ this.updateCheckedState = () => {
287
+ this.tabs.forEach((element) => {
288
+ element.removeAttribute("selected");
289
+ });
290
+ if (this.selected) {
291
+ const currentChecked = this.tabs.find((el) => el.value === this.selected);
292
+ if (currentChecked) {
293
+ currentChecked.selected = true;
294
+ } else {
295
+ this.selected = "";
296
+ }
297
+ } else {
298
+ const firstTab = this.tabs[0];
299
+ if (firstTab) {
300
+ firstTab.setAttribute("tabindex", "0");
301
+ }
302
+ }
303
+ this.updateSelectionIndicator();
304
+ };
305
+ this.updateSelectionIndicator = async () => {
306
+ const selectedElement = this.tabs.find((el) => el.selected);
307
+ if (!selectedElement) {
308
+ this.selectionIndicatorStyle = ScaledIndicator.noSelectionStyle;
309
+ return;
310
+ }
311
+ await Promise.all([
312
+ selectedElement.updateComplete,
313
+ document.fonts ? document.fonts.ready : Promise.resolve()
314
+ ]);
315
+ const { width, height } = selectedElement.getBoundingClientRect();
316
+ this.selectionIndicatorStyle = this.direction === "horizontal" ? ScaledIndicator.transformX(selectedElement.offsetLeft, width) : ScaledIndicator.transformY(selectedElement.offsetTop, height);
317
+ };
318
+ new intersectionController_js.IntersectionController(this, {
319
+ config: {
320
+ root: null,
321
+ rootMargin: "0px",
322
+ threshold: [0, 1]
323
+ },
324
+ callback: () => {
325
+ this.updateSelectionIndicator();
326
+ }
327
+ });
328
+ }
329
+ static get styles() {
330
+ return [
331
+ lit.unsafeCSS(tabSizes),
332
+ lit.unsafeCSS(tabStyles),
333
+ ScaledIndicator.baseStyles()
334
+ ];
335
+ }
336
+ set tabs(tabs) {
337
+ if (tabs === this.tabs) return;
338
+ this._tabs.forEach((tab) => {
339
+ this.resizeController.unobserve(tab);
340
+ });
341
+ tabs.forEach((tab) => {
342
+ this.resizeController.observe(tab);
343
+ });
344
+ this._tabs = tabs;
345
+ this.rovingTabindexController.clearElementCache();
346
+ }
347
+ get tabs() {
348
+ return this._tabs;
349
+ }
350
+ /**
351
+ * @internal
352
+ */
353
+ get focusElement() {
354
+ return this.rovingTabindexController.focusInElement || this;
355
+ }
356
+ limitDeltaToInterval(min, max) {
357
+ return (delta) => {
358
+ if (delta < min) return min;
359
+ if (delta > max) return max;
360
+ return delta;
361
+ };
362
+ }
363
+ /**
364
+ * Scrolls through the tabs component, on the X-axis, by a given ammount of pixels/ delta. The given delta is limited to the scrollable area of the tabs component.
365
+ * @param delta - The ammount of pixels to scroll by. If the value is positive, the tabs will scroll to the right. If the value is negative, the tabs will scroll to the left.
366
+ * @param behavior - The scroll behavior to use. Defaults to 'smooth'.
367
+ */
368
+ scrollTabs(delta, behavior = "smooth") {
369
+ var _a;
370
+ if (delta === 0) return;
371
+ const { scrollLeft, clientWidth, scrollWidth } = this.tabList;
372
+ const dirLimit = scrollWidth - clientWidth - Math.abs(scrollLeft);
373
+ const limitDelta = this.dir === "ltr" ? this.limitDeltaToInterval(-scrollLeft, dirLimit) : this.limitDeltaToInterval(-dirLimit, Math.abs(scrollLeft));
374
+ (_a = this.tabList) == null ? void 0 : _a.scrollBy({
375
+ left: limitDelta(delta),
376
+ top: 0,
377
+ behavior
378
+ });
379
+ }
380
+ get scrollState() {
381
+ if (this.tabList) {
382
+ const { scrollLeft, clientWidth, scrollWidth } = this.tabList;
383
+ const canScrollLeft = Math.abs(scrollLeft) > 0;
384
+ const canScrollRight = Math.ceil(Math.abs(scrollLeft)) < scrollWidth - clientWidth;
385
+ return {
386
+ canScrollLeft: this.dir === "ltr" ? canScrollLeft : canScrollRight,
387
+ canScrollRight: this.dir === "ltr" ? canScrollRight : canScrollLeft
388
+ };
389
+ }
390
+ return {};
391
+ }
392
+ async getUpdateComplete() {
393
+ const complete = await super.getUpdateComplete();
394
+ const tabs = [...this.children];
395
+ const tabUpdateCompletes = tabs.map((tab) => {
396
+ if (tab.updateComplete !== void 0) {
397
+ return tab.updateComplete;
398
+ }
399
+ return Promise.resolve(true);
400
+ });
401
+ await Promise.all(tabUpdateCompletes);
402
+ return complete;
403
+ }
404
+ getNecessaryAutoScroll(index) {
405
+ const selectedTab = this.tabs[index];
406
+ const selectionEnd = selectedTab.offsetLeft + selectedTab.offsetWidth;
407
+ const viewportEnd = this.tabList.scrollLeft + this.tabList.offsetWidth;
408
+ const selectionStart = selectedTab.offsetLeft;
409
+ const viewportStart = this.tabList.scrollLeft;
410
+ if (selectionEnd > viewportEnd) {
411
+ return calculateScrollTargetForRightSide(
412
+ index,
413
+ this.dir,
414
+ this.tabs,
415
+ this.tabList
416
+ );
417
+ } else if (selectionStart < viewportStart) {
418
+ return calculateScrollTargetForLeftSide(
419
+ index,
420
+ this.dir,
421
+ this.tabs,
422
+ this.tabList
423
+ );
424
+ }
425
+ return -1;
426
+ }
427
+ async scrollToSelection() {
428
+ if (!this.enableTabsScroll || !this.selected) {
429
+ return;
430
+ }
431
+ await this.updateComplete;
432
+ const selectedIndex = this.tabs.findIndex(
433
+ (tab) => tab.value === this.selected
434
+ );
435
+ if (selectedIndex !== -1 && this.tabList) {
436
+ const scrollTarget = this.getNecessaryAutoScroll(selectedIndex);
437
+ if (scrollTarget !== -1) {
438
+ this.tabList.scrollTo({ left: scrollTarget });
439
+ }
440
+ }
441
+ }
442
+ updated(changedProperties) {
443
+ super.updated(changedProperties);
444
+ if (changedProperties.has("selected")) {
445
+ this.scrollToSelection();
446
+ }
447
+ }
448
+ managePanels({
449
+ target
450
+ }) {
451
+ const panels = target.assignedElements();
452
+ panels.map((panel) => {
453
+ const { value, id } = panel;
454
+ const tab = this.querySelector(`[role="tab"][value="${value}"]`);
455
+ if (tab) {
456
+ tab.setAttribute("aria-controls", id);
457
+ panel.setAttribute("aria-labelledby", tab.id);
458
+ }
459
+ panel.selected = value === this.selected;
460
+ });
461
+ }
462
+ render() {
463
+ return lit.html`
46
464
  <div
47
- class=${m.e({scroll:this.enableTabsScroll})}
48
- aria-label=${x.o(this.label??void 0)}
465
+ class=${classMap_js.classMap({ scroll: this.enableTabsScroll })}
466
+ aria-label=${ifDefined_js.ifDefined(this.label ?? void 0)}
49
467
  @click=${this.onClick}
50
468
  @keydown=${this.onKeyDown}
51
469
  @scroll=${this.onTabsScroll}
@@ -56,38 +474,287 @@
56
474
  <slot @slotchange=${this.onSlotChange}></slot>
57
475
  <div
58
476
  id="selection-indicator"
59
- class=${x.o(this.shouldAnimate?void 0:"first-position")}
477
+ class=${ifDefined_js.ifDefined(this.shouldAnimate ? void 0 : "first-position")}
60
478
  style=${this.selectionIndicatorStyle}
61
479
  role="presentation"
62
480
  ></div>
63
481
  </div>
64
482
  <slot name="tab-panel" @slotchange=${this.managePanels}></slot>
65
- `}willUpdate(t){if(!this.hasUpdated){const o=this.querySelector(":scope > [selected]");o&&this.selectTarget(o)}if(super.willUpdate(t),t.has("selected")){if(this.tabs.length>0&&this.updateCheckedState(),t.get("selected")){const i=this.querySelector(`[role="tabpanel"][value="${t.get("selected")}"]`);i&&(i.selected=!1)}const o=this.querySelector(`[role="tabpanel"][value="${this.selected}"]`);o&&(o.selected=!0)}t.has("direction")&&(this.direction==="horizontal"?this.removeAttribute("aria-orientation"):this.setAttribute("aria-orientation","vertical")),t.has("dir")&&this.updateSelectionIndicator(),t.has("disabled")&&(this.disabled?this.setAttribute("aria-disabled","true"):this.removeAttribute("aria-disabled")),!this.shouldAnimate&&t.get("shouldAnimate")!==void 0&&(this.shouldAnimate=!0)}selectTarget(t){const o=t.getAttribute("value");if(o){const i=this.selected;this.selected=o,this.dispatchEvent(new Event("change",{cancelable:!0}))||(this.selected=i)}}onSlotChange(){this.tabs=this.slotEl.assignedElements().filter(t=>t.getAttribute("role")==="tab"),this.updateCheckedState()}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.updateSelectionIndicator),"fonts"in document&&document.fonts.addEventListener("loadingdone",this.updateSelectionIndicator)}disconnectedCallback(){window.removeEventListener("resize",this.updateSelectionIndicator),"fonts"in document&&document.fonts.removeEventListener("loadingdone",this.updateSelectionIndicator),super.disconnectedCallback()}}c([s.n({type:Boolean})],n.prototype,"auto");c([s.n({type:Boolean,reflect:!0})],n.prototype,"compact");c([s.n({reflect:!0})],n.prototype,"dir");c([s.n({reflect:!0})],n.prototype,"direction");c([s.n({type:Boolean,reflect:!0})],n.prototype,"emphasized");c([s.n()],n.prototype,"label");c([s.n({type:Boolean})],n.prototype,"enableTabsScroll");c([s.n({type:Boolean,reflect:!0})],n.prototype,"quiet");c([s.n({attribute:!1})],n.prototype,"selectionIndicatorStyle");c([s.n({attribute:!1})],n.prototype,"shouldAnimate");c([f.e("slot")],n.prototype,"slotEl");c([f.e("#list")],n.prototype,"tabList");c([s.n({reflect:!0})],n.prototype,"selected");const j=':host{top:0;right:0;bottom:0;left:0;width:100%;--tabs-divider-size: 2px;--tab-item-height-m: calc( var(--luzmo-component-height) + var(--luzmo-spacing-5) );--tabs-overflow-button-height: calc( var(--tab-item-height-m) - var( --luzmo-tabs-divider-size, var(--tabs-divider-size) ) );--tabs-overflow-button-size: var(--tab-item-height-m);--tabs-overflow-icon-color: var(--luzmo-font-color-focus);--tabs-overflow-shadow-color: var(--luzmo-background-color);--tabs-overflow-shadow-width: 50px;--luzmo-action-button-icon-size: var(--luzmo-font-size);--tabs-overflow-next-button-right: calc(-1 * var(--luzmo-spacing-4));--tabs-overflow-previous-button-left: calc(-1 * var(--luzmo-spacing-4))}:host([size=s]){--tab-item-height-s: calc( var(--luzmo-component-height-s) + var(--luzmo-spacing-4) );--tabs-overflow-button-height: calc( var(--tab-item-height-s) - var( --luzmo-tabs-divider-size, var(--tabs-divider-size) ) );--tabs-overflow-button-size: var(--tab-item-height-s);--luzmo-action-button-icon-size: var(--luzmo-font-size-s);--tabs-overflow-next-button-right: calc(-1 * var(--luzmo-spacing-3));--tabs-overflow-previous-button-left: calc(-1 * var(--luzmo-spacing-3))}:host([size=l]){--tab-item-height-l: calc( var(--luzmo-component-height-l) + var(--luzmo-spacing-5) );--tabs-overflow-button-height: calc( var(--tab-item-height-l) - var( --luzmo-tabs-divider-size, var(--tabs-divider-size) ) );--tabs-overflow-button-size: var(--tab-item-height-l);--luzmo-action-button-icon-size: var(--luzmo-font-size-l);--tabs-overflow-next-button-right: calc( -1 * calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1)) );--tabs-overflow-previous-button-left: calc( -1 * calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1)) )}:host([size=xl]){--tab-item-height-xl: calc( var(--luzmo-component-height-xl) + var(--luzmo-spacing-5) );--tabs-overflow-button-height: calc( var(--tab-item-height-xl) - var( --luzmo-tabs-divider-size, var(--tabs-divider-size) ) );--tabs-overflow-button-size: var(--tab-item-height-xl);--luzmo-action-button-icon-size: var(--luzmo-font-size-xl);--tabs-overflow-next-button-right: calc( -1 * calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-2)) );--tabs-overflow-previous-button-left: calc( -1 * calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-2)) )}:host([compact]){--tabs-overflow-button-height: calc( var(--tab-item-compact-height-m) - var( --luzmo-tabs-divider-size, var(--tabs-divider-size) ) );--luzmo-action-button-icon-size: var(--luzmo-font-size-s)}luzmo-action-button{width:var(--luzmo-tabs-overflow-button-size, var(--tabs-overflow-button-size));height:var(--luzmo-tabs-overflow-button-height, var(--tabs-overflow-button-height));position:absolute;z-index:2;border:none;text-align:center;box-shadow:none;background:transparent;color:var(--luzmo-tabs-overflow-icon-color, var(--tabs-overflow-icon-color))}luzmo-action-button.left-scroll{visibility:hidden;left:var(--luzmo-tabs-overflow-previous-button-left, var(--tabs-overflow-previous-button-left))}luzmo-action-button.right-scroll{visibility:hidden;right:var(--luzmo-tabs-overflow-next-button-right, var(--tabs-overflow-next-button-right))}luzmo-action-button.left-scroll.show,luzmo-action-button.right-scroll.show{visibility:visible}.tabs-overflow-container{position:relative}.tabs-overflow-container:before,.tabs-overflow-container:after{content:"";visibility:hidden;position:absolute;z-index:1;height:var(--luzmo-tabs-overflow-button-height, var(--tabs-overflow-button-height));width:var(--luzmo-tabs-overflow-shadow-width, var(--tabs-overflow-shadow-width));pointer-events:none;inset-block-start:0}.tabs-overflow-container:before{background:transparent linear-gradient(270deg,transparent,var(--luzmo-tabs-overflow-shadow-color, var(--tabs-overflow-shadow-color))) 0 0 no-repeat padding-box;left:0}.tabs-overflow-container:after{background:transparent linear-gradient(90deg,transparent,var(--luzmo-tabs-overflow-shadow-color, var(--tabs-overflow-shadow-color))) 0 0 no-repeat padding-box;right:0}.tabs-overflow-container.left-shadow:before,.tabs-overflow-container.right-shadow:after{visibility:visible}';var H=Object.defineProperty,b=(l,t,o,i)=>{for(var e=void 0,a=l.length-1,r;a>=0;a--)(r=l[a])&&(e=r(t,o,e)||e);return e&&H(t,o,e),e};class d extends S.SizedMixin(s.LuzmoElement){constructor(){super(),this.compact=!1,this.labelPrevious="Scroll to previous tabs",this.labelNext="Scroll to next tabs",this.overflowState={canScrollLeft:!1,canScrollRight:!1},this.scrollFactor=.5,this.resizeController=new C(this,{target:this,callback:()=>{this._updateScrollState()}})}static get styles(){return[s.r(j),s.r(T)]}get scrollContent(){return this.tabs}firstUpdated(t){super.firstUpdated(t);const[o]=this.scrollContent;o&&(o.enableTabsScroll=!0),this.resizeController.observe(this.overflowContainer)}async _handleSlotChange(){const[t]=this.scrollContent;await(t==null?void 0:t.updateComplete),this._updateScrollState()}_updateScrollState(){const{scrollContent:t,overflowState:o}=this;if(t){const[i]=this.scrollContent,{canScrollLeft:e,canScrollRight:a}=(i==null?void 0:i.scrollState)||{canScrollLeft:!1,canScrollRight:!1};this.overflowState={...o,canScrollLeft:e,canScrollRight:a}}}_handleScrollClick(t){const o=t.currentTarget,[i]=this.scrollContent,e=i.clientWidth*this.scrollFactor,a=o.classList.contains("left-scroll")?-e:e;i.scrollTabs(a,"smooth")}updated(t){super.updated(t),t.has("dir")&&this._updateScrollState()}render(){const{canScrollRight:t,canScrollLeft:o}=this.overflowState,i=this.labelPrevious,e=this.labelNext;return s.x`
483
+ `;
484
+ }
485
+ willUpdate(changes) {
486
+ if (!this.hasUpdated) {
487
+ const selectedChild = this.querySelector(
488
+ ":scope > [selected]"
489
+ );
490
+ if (selectedChild) {
491
+ this.selectTarget(selectedChild);
492
+ }
493
+ }
494
+ super.willUpdate(changes);
495
+ if (changes.has("selected")) {
496
+ if (this.tabs.length > 0) {
497
+ this.updateCheckedState();
498
+ }
499
+ if (changes.get("selected")) {
500
+ const previous = this.querySelector(
501
+ `[role="tabpanel"][value="${changes.get("selected")}"]`
502
+ );
503
+ if (previous) previous.selected = false;
504
+ }
505
+ const next = this.querySelector(
506
+ `[role="tabpanel"][value="${this.selected}"]`
507
+ );
508
+ if (next) next.selected = true;
509
+ }
510
+ if (changes.has("direction")) {
511
+ if (this.direction === "horizontal") {
512
+ this.removeAttribute("aria-orientation");
513
+ } else {
514
+ this.setAttribute("aria-orientation", "vertical");
515
+ }
516
+ }
517
+ if (changes.has("dir")) {
518
+ this.updateSelectionIndicator();
519
+ }
520
+ if (changes.has("disabled")) {
521
+ if (this.disabled) {
522
+ this.setAttribute("aria-disabled", "true");
523
+ } else {
524
+ this.removeAttribute("aria-disabled");
525
+ }
526
+ }
527
+ if (!this.shouldAnimate && changes.get("shouldAnimate") !== void 0) {
528
+ this.shouldAnimate = true;
529
+ }
530
+ }
531
+ selectTarget(target) {
532
+ const value = target.getAttribute("value");
533
+ if (value) {
534
+ const selected = this.selected;
535
+ this.selected = value;
536
+ const applyDefault = this.dispatchEvent(
537
+ new Event("change", {
538
+ cancelable: true
539
+ })
540
+ );
541
+ if (!applyDefault) {
542
+ this.selected = selected;
543
+ }
544
+ }
545
+ }
546
+ onSlotChange() {
547
+ this.tabs = this.slotEl.assignedElements().filter((el) => el.getAttribute("role") === "tab");
548
+ this.updateCheckedState();
549
+ }
550
+ connectedCallback() {
551
+ super.connectedCallback();
552
+ window.addEventListener("resize", this.updateSelectionIndicator);
553
+ if ("fonts" in document) {
554
+ document.fonts.addEventListener("loadingdone", this.updateSelectionIndicator);
555
+ }
556
+ }
557
+ disconnectedCallback() {
558
+ window.removeEventListener("resize", this.updateSelectionIndicator);
559
+ if ("fonts" in document) {
560
+ document.fonts.removeEventListener("loadingdone", this.updateSelectionIndicator);
561
+ }
562
+ super.disconnectedCallback();
563
+ }
564
+ }
565
+ __decorateClass$1([
566
+ decorators_js.property({ type: Boolean })
567
+ ], LuzmoTabs.prototype, "auto");
568
+ __decorateClass$1([
569
+ decorators_js.property({ type: Boolean, reflect: true })
570
+ ], LuzmoTabs.prototype, "compact");
571
+ __decorateClass$1([
572
+ decorators_js.property({ reflect: true })
573
+ ], LuzmoTabs.prototype, "dir");
574
+ __decorateClass$1([
575
+ decorators_js.property({ reflect: true })
576
+ ], LuzmoTabs.prototype, "direction");
577
+ __decorateClass$1([
578
+ decorators_js.property({ type: Boolean, reflect: true })
579
+ ], LuzmoTabs.prototype, "emphasized");
580
+ __decorateClass$1([
581
+ decorators_js.property()
582
+ ], LuzmoTabs.prototype, "label");
583
+ __decorateClass$1([
584
+ decorators_js.property({ type: Boolean })
585
+ ], LuzmoTabs.prototype, "enableTabsScroll");
586
+ __decorateClass$1([
587
+ decorators_js.property({ type: Boolean, reflect: true })
588
+ ], LuzmoTabs.prototype, "quiet");
589
+ __decorateClass$1([
590
+ decorators_js.property({ attribute: false })
591
+ ], LuzmoTabs.prototype, "selectionIndicatorStyle");
592
+ __decorateClass$1([
593
+ decorators_js.property({ attribute: false })
594
+ ], LuzmoTabs.prototype, "shouldAnimate");
595
+ __decorateClass$1([
596
+ decorators_js.query("slot")
597
+ ], LuzmoTabs.prototype, "slotEl");
598
+ __decorateClass$1([
599
+ decorators_js.query("#list")
600
+ ], LuzmoTabs.prototype, "tabList");
601
+ __decorateClass$1([
602
+ decorators_js.property({ reflect: true })
603
+ ], LuzmoTabs.prototype, "selected");
604
+ const styles = ':host{top:0;right:0;bottom:0;left:0;width:100%;--tabs-divider-size: 2px;--tab-item-height-m: calc( var(--luzmo-component-height) + var(--luzmo-spacing-5) );--tabs-overflow-button-height: calc( var(--tab-item-height-m) - var( --luzmo-tabs-divider-size, var(--tabs-divider-size) ) );--tabs-overflow-button-size: var(--tab-item-height-m);--tabs-overflow-icon-color: var(--luzmo-font-color-focus);--tabs-overflow-shadow-color: var(--luzmo-background-color);--tabs-overflow-shadow-width: 50px;--luzmo-action-button-icon-size: var(--luzmo-font-size);--tabs-overflow-next-button-right: calc(-1 * var(--luzmo-spacing-4));--tabs-overflow-previous-button-left: calc(-1 * var(--luzmo-spacing-4))}:host([size=s]){--tab-item-height-s: calc( var(--luzmo-component-height-s) + var(--luzmo-spacing-4) );--tabs-overflow-button-height: calc( var(--tab-item-height-s) - var( --luzmo-tabs-divider-size, var(--tabs-divider-size) ) );--tabs-overflow-button-size: var(--tab-item-height-s);--luzmo-action-button-icon-size: var(--luzmo-font-size-s);--tabs-overflow-next-button-right: calc(-1 * var(--luzmo-spacing-3));--tabs-overflow-previous-button-left: calc(-1 * var(--luzmo-spacing-3))}:host([size=l]){--tab-item-height-l: calc( var(--luzmo-component-height-l) + var(--luzmo-spacing-5) );--tabs-overflow-button-height: calc( var(--tab-item-height-l) - var( --luzmo-tabs-divider-size, var(--tabs-divider-size) ) );--tabs-overflow-button-size: var(--tab-item-height-l);--luzmo-action-button-icon-size: var(--luzmo-font-size-l);--tabs-overflow-next-button-right: calc( -1 * calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1)) );--tabs-overflow-previous-button-left: calc( -1 * calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-1)) )}:host([size=xl]){--tab-item-height-xl: calc( var(--luzmo-component-height-xl) + var(--luzmo-spacing-5) );--tabs-overflow-button-height: calc( var(--tab-item-height-xl) - var( --luzmo-tabs-divider-size, var(--tabs-divider-size) ) );--tabs-overflow-button-size: var(--tab-item-height-xl);--luzmo-action-button-icon-size: var(--luzmo-font-size-xl);--tabs-overflow-next-button-right: calc( -1 * calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-2)) );--tabs-overflow-previous-button-left: calc( -1 * calc(var(--luzmo-spacing-4) + var(--luzmo-spacing-2)) )}:host([compact]){--tabs-overflow-button-height: calc( var(--tab-item-compact-height-m) - var( --luzmo-tabs-divider-size, var(--tabs-divider-size) ) );--luzmo-action-button-icon-size: var(--luzmo-font-size-s)}luzmo-action-button{width:var(--luzmo-tabs-overflow-button-size, var(--tabs-overflow-button-size));height:var(--luzmo-tabs-overflow-button-height, var(--tabs-overflow-button-height));position:absolute;z-index:2;border:none;text-align:center;box-shadow:none;background:transparent;color:var(--luzmo-tabs-overflow-icon-color, var(--tabs-overflow-icon-color))}luzmo-action-button.left-scroll{visibility:hidden;left:var(--luzmo-tabs-overflow-previous-button-left, var(--tabs-overflow-previous-button-left))}luzmo-action-button.right-scroll{visibility:hidden;right:var(--luzmo-tabs-overflow-next-button-right, var(--tabs-overflow-next-button-right))}luzmo-action-button.left-scroll.show,luzmo-action-button.right-scroll.show{visibility:visible}.tabs-overflow-container{position:relative}.tabs-overflow-container:before,.tabs-overflow-container:after{content:"";visibility:hidden;position:absolute;z-index:1;height:var(--luzmo-tabs-overflow-button-height, var(--tabs-overflow-button-height));width:var(--luzmo-tabs-overflow-shadow-width, var(--tabs-overflow-shadow-width));pointer-events:none;inset-block-start:0}.tabs-overflow-container:before{background:transparent linear-gradient(270deg,transparent,var(--luzmo-tabs-overflow-shadow-color, var(--tabs-overflow-shadow-color))) 0 0 no-repeat padding-box;left:0}.tabs-overflow-container:after{background:transparent linear-gradient(90deg,transparent,var(--luzmo-tabs-overflow-shadow-color, var(--tabs-overflow-shadow-color))) 0 0 no-repeat padding-box;right:0}.tabs-overflow-container.left-shadow:before,.tabs-overflow-container.right-shadow:after{visibility:visible}';
605
+ var __defProp = Object.defineProperty;
606
+ var __decorateClass = (decorators, target, key, kind) => {
607
+ var result = void 0;
608
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
609
+ if (decorator = decorators[i])
610
+ result = decorator(target, key, result) || result;
611
+ if (result) __defProp(target, key, result);
612
+ return result;
613
+ };
614
+ class LuzmoTabsOverflow extends sizedMixin.SizedMixin(base.LuzmoElement) {
615
+ constructor() {
616
+ super();
617
+ this.compact = false;
618
+ this.labelPrevious = "Scroll to previous tabs";
619
+ this.labelNext = "Scroll to next tabs";
620
+ this.overflowState = {
621
+ canScrollLeft: false,
622
+ canScrollRight: false
623
+ };
624
+ this.scrollFactor = 0.5;
625
+ this.resizeController = new resizeController_js.ResizeController(this, {
626
+ target: this,
627
+ callback: () => {
628
+ this._updateScrollState();
629
+ }
630
+ });
631
+ }
632
+ static get styles() {
633
+ return [lit.unsafeCSS(styles), lit.unsafeCSS(tabSizes)];
634
+ }
635
+ get scrollContent() {
636
+ return this.tabs;
637
+ }
638
+ firstUpdated(changes) {
639
+ super.firstUpdated(changes);
640
+ const [tabs] = this.scrollContent;
641
+ if (tabs) {
642
+ tabs.enableTabsScroll = true;
643
+ }
644
+ this.resizeController.observe(this.overflowContainer);
645
+ }
646
+ async _handleSlotChange() {
647
+ const [tabsElement] = this.scrollContent;
648
+ await (tabsElement == null ? void 0 : tabsElement.updateComplete);
649
+ this._updateScrollState();
650
+ }
651
+ _updateScrollState() {
652
+ const { scrollContent, overflowState } = this;
653
+ if (scrollContent) {
654
+ const [tabsElement] = this.scrollContent;
655
+ const { canScrollLeft, canScrollRight } = (tabsElement == null ? void 0 : tabsElement.scrollState) || {
656
+ canScrollLeft: false,
657
+ canScrollRight: false
658
+ };
659
+ this.overflowState = {
660
+ ...overflowState,
661
+ canScrollLeft,
662
+ canScrollRight
663
+ };
664
+ }
665
+ }
666
+ _handleScrollClick(event) {
667
+ const currentTarget = event.currentTarget;
668
+ const [tabsElement] = this.scrollContent;
669
+ const dist = tabsElement.clientWidth * this.scrollFactor;
670
+ const left = currentTarget.classList.contains("left-scroll") ? -dist : dist;
671
+ tabsElement.scrollTabs(left, "smooth");
672
+ }
673
+ updated(changedProperties) {
674
+ super.updated(changedProperties);
675
+ if (changedProperties.has("dir")) {
676
+ this._updateScrollState();
677
+ }
678
+ }
679
+ render() {
680
+ const { canScrollRight, canScrollLeft } = this.overflowState;
681
+ const ariaLabelPrevious = this.labelPrevious;
682
+ const ariaLabelNext = this.labelNext;
683
+ return lit.html`
66
684
  <div
67
- class=${m.e({"tabs-overflow-container":!0,"left-shadow":o,"right-shadow":t})}
685
+ class=${classMap_js.classMap({
686
+ "tabs-overflow-container": true,
687
+ "left-shadow": canScrollLeft,
688
+ "right-shadow": canScrollRight
689
+ })}
68
690
  >
69
691
  <luzmo-action-button
70
- class=${m.e({"left-scroll":!0,show:o})}
71
- aria-label=${i}
692
+ class=${classMap_js.classMap({
693
+ "left-scroll": true,
694
+ show: canScrollLeft
695
+ })}
696
+ aria-label=${ariaLabelPrevious}
72
697
  quiet
73
698
  dir="rtl"
74
699
  tabindex="-1"
75
700
  @click=${this._handleScrollClick}
76
701
  >
77
- <luzmo-icon slot="icon" .icon=${w.k}></luzmo-icon>
702
+ <luzmo-icon slot="icon" .icon=${icons.luzmoAngleLeft}></luzmo-icon>
78
703
  </luzmo-action-button>
79
704
  <luzmo-action-button
80
- class=${m.e({"right-scroll":!0,show:t})}
81
- aria-label=${e}
705
+ class=${classMap_js.classMap({
706
+ "right-scroll": true,
707
+ show: canScrollRight
708
+ })}
709
+ aria-label=${ariaLabelNext}
82
710
  quiet
83
711
  tabindex="-1"
84
712
  @click=${this._handleScrollClick}
85
713
  >
86
- <luzmo-icon slot="icon" .icon=${w.S}></luzmo-icon>
714
+ <luzmo-icon slot="icon" .icon=${icons.luzmoAngleRight}></luzmo-icon>
87
715
  </luzmo-action-button>
88
716
  <slot
89
717
  @slotchange=${this._handleSlotChange}
90
718
  @luzmo-tabs-scroll=${this._updateScrollState}
91
719
  ></slot>
92
720
  </div>
93
- `}}b([s.n({type:Boolean,reflect:!0})],d.prototype,"compact");b([s.n({type:String,attribute:"label-previous"})],d.prototype,"labelPrevious");b([s.n({type:String,attribute:"label-next"})],d.prototype,"labelNext");b([s.n({reflect:!0})],d.prototype,"dir");b([A.r()],d.prototype,"overflowState");b([_.o({selector:"luzmo-tabs",flatten:!0})],d.prototype,"tabs");b([f.e(".tabs-overflow-container")],d.prototype,"overflowContainer");customElements.get("luzmo-tab")||customElements.define("luzmo-tab",u);customElements.get("luzmo-tabs")||customElements.define("luzmo-tabs",n);customElements.get("luzmo-tab-panel")||customElements.define("luzmo-tab-panel",p);customElements.get("luzmo-tabs-overflow")||customElements.define("luzmo-tabs-overflow",d);exports.LuzmoTab=u;exports.LuzmoTabPanel=p;exports.LuzmoTabs=n;exports.LuzmoTabsOverflow=d;
721
+ `;
722
+ }
723
+ }
724
+ __decorateClass([
725
+ decorators_js.property({ type: Boolean, reflect: true })
726
+ ], LuzmoTabsOverflow.prototype, "compact");
727
+ __decorateClass([
728
+ decorators_js.property({ type: String, attribute: "label-previous" })
729
+ ], LuzmoTabsOverflow.prototype, "labelPrevious");
730
+ __decorateClass([
731
+ decorators_js.property({ type: String, attribute: "label-next" })
732
+ ], LuzmoTabsOverflow.prototype, "labelNext");
733
+ __decorateClass([
734
+ decorators_js.property({ reflect: true })
735
+ ], LuzmoTabsOverflow.prototype, "dir");
736
+ __decorateClass([
737
+ decorators_js.state()
738
+ ], LuzmoTabsOverflow.prototype, "overflowState");
739
+ __decorateClass([
740
+ decorators_js.queryAssignedElements({ selector: "luzmo-tabs", flatten: true })
741
+ ], LuzmoTabsOverflow.prototype, "tabs");
742
+ __decorateClass([
743
+ decorators_js.query(".tabs-overflow-container")
744
+ ], LuzmoTabsOverflow.prototype, "overflowContainer");
745
+ if (!customElements.get("luzmo-tab")) {
746
+ customElements.define("luzmo-tab", LuzmoTab);
747
+ }
748
+ if (!customElements.get("luzmo-tabs")) {
749
+ customElements.define("luzmo-tabs", LuzmoTabs);
750
+ }
751
+ if (!customElements.get("luzmo-tab-panel")) {
752
+ customElements.define("luzmo-tab-panel", LuzmoTabPanel);
753
+ }
754
+ if (!customElements.get("luzmo-tabs-overflow")) {
755
+ customElements.define("luzmo-tabs-overflow", LuzmoTabsOverflow);
756
+ }
757
+ exports.LuzmoTab = LuzmoTab;
758
+ exports.LuzmoTabPanel = LuzmoTabPanel;
759
+ exports.LuzmoTabs = LuzmoTabs;
760
+ exports.LuzmoTabsOverflow = LuzmoTabsOverflow;