@luzmo/lucero 1.0.1-alpha.17 → 1.0.1-alpha.19

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 (277) hide show
  1. package/components/NumberFormatter-DewVDY5w.cjs +18 -0
  2. package/components/NumberFormatter-DgOUVrge.js +136 -0
  3. package/components/NumberParser-Dik4a0h-.cjs +18 -0
  4. package/components/NumberParser-ci9J5EKv.js +173 -0
  5. package/components/accordion/index.cjs +6 -183
  6. package/components/accordion/index.js +88 -136
  7. package/components/action-bar/index.cjs +4 -85
  8. package/components/action-bar/index.js +50 -72
  9. package/components/action-button/index.cjs +3 -205
  10. package/components/action-button/index.js +93 -167
  11. package/components/action-group/index.cjs +1 -7
  12. package/components/action-group/index.js +8 -12
  13. package/components/action-group-C54IxNZk.cjs +20 -0
  14. package/components/action-group-C9dsPJg-.js +258 -0
  15. package/components/action-menu/index.cjs +11 -91
  16. package/components/action-menu/index.js +47 -66
  17. package/components/async-directive-BwIAw5tB.js +82 -0
  18. package/components/async-directive-DLz6JB0v.cjs +22 -0
  19. package/components/avatar/index.cjs +3 -63
  20. package/components/avatar/index.js +42 -54
  21. package/components/{focusable-selectors-D0t_5P7C.cjs → base-BjTwmyRF.cjs} +5 -16
  22. package/components/base-CFWO09N1.js +684 -0
  23. package/components/base-Cy0MQrPT.cjs +40 -0
  24. package/components/base-D76d76ww.js +26 -0
  25. package/components/button/index.cjs +2 -134
  26. package/components/button/index.js +72 -106
  27. package/components/button-base-B8bWcklV.js +144 -0
  28. package/components/button-base-tf95Lyl4.cjs +25 -0
  29. package/components/button-group/index.cjs +1 -45
  30. package/components/button-group/index.js +25 -37
  31. package/components/calendar/index.cjs +1 -632
  32. package/components/calendar/index.js +7 -637
  33. package/components/checkbox/index.cjs +4 -111
  34. package/components/checkbox/index.js +53 -98
  35. package/components/checkbox-mixin-BOTvuPEu.js +70 -0
  36. package/components/checkbox-mixin-BVPpXtsq.cjs +27 -0
  37. package/components/class-map-CGfNk3Ee.js +51 -0
  38. package/components/class-map-D-Y-hsN5.cjs +22 -0
  39. package/components/clear-button-CuPbWwZY.cjs +18 -0
  40. package/components/clear-button-DzZ5ulBW.js +53 -0
  41. package/components/close-button-BTo4yrFR.cjs +18 -0
  42. package/components/close-button-CuQdsez5.js +51 -0
  43. package/components/color-area/index.cjs +13 -440
  44. package/components/color-area/index.js +187 -322
  45. package/components/color-controller-B0uX6Zso.js +3230 -0
  46. package/components/color-controller-CoUL5f9K.cjs +18 -0
  47. package/components/color-field/index.cjs +2 -95
  48. package/components/color-field/index.js +41 -77
  49. package/components/color-handle/index.cjs +3 -64
  50. package/components/color-handle/index.js +37 -58
  51. package/components/color-loupe/index.cjs +1 -7
  52. package/components/color-loupe/index.js +8 -12
  53. package/components/color-loupe-CrM2DVY3.cjs +56 -0
  54. package/components/color-loupe-DmQe3SpP.js +81 -0
  55. package/components/color-menu/index.cjs +12 -217
  56. package/components/color-menu/index.js +93 -187
  57. package/components/color-palette/index.cjs +1 -89
  58. package/components/color-palette/index.js +51 -78
  59. package/components/color-palette-group/index.cjs +3 -259
  60. package/components/color-palette-group/index.js +105 -193
  61. package/components/color-picker/index.cjs +6 -114
  62. package/components/color-picker/index.js +72 -92
  63. package/components/color-slider/index.cjs +1 -585
  64. package/components/color-slider/index.js +7 -590
  65. package/components/condition-attribute-with-id-DrQYZzFS.cjs +18 -0
  66. package/components/condition-attribute-with-id-Dv4lSRbe.js +31 -0
  67. package/components/date-time-picker/index.cjs +31 -1357
  68. package/components/date-time-picker/index.js +637 -951
  69. package/components/{dependency-manger-XHpQjFgK.js → dependency-manger-CO-VPlqq.js} +14 -24
  70. package/components/dependency-manger-uthev62E.cjs +18 -0
  71. package/components/directive-C7oCP5Bh.cjs +22 -0
  72. package/components/directive-helpers-D4KMv2dC.js +62 -0
  73. package/components/directive-helpers-t-TVum7J.cjs +22 -0
  74. package/components/{slottable-request-event-CANixJnR.cjs → directive-oAbCiebi.js} +25 -14
  75. package/components/divider/index.cjs +1 -54
  76. package/components/divider/index.js +30 -49
  77. package/components/divider.module-DDvBo9zo.cjs +18 -0
  78. package/components/divider.module-DoQWQEIJ.js +21 -0
  79. package/components/element-resolution-BvRLGqIU.cjs +18 -0
  80. package/components/element-resolution-FCUT-wql.js +91 -0
  81. package/components/field-group/index.cjs +1 -7
  82. package/components/field-group/index.js +8 -12
  83. package/components/field-group-5WQMBOk4.cjs +23 -0
  84. package/components/field-group-D4B0IOdA.js +66 -0
  85. package/components/field-label/index.cjs +1 -7
  86. package/components/field-label/index.js +8 -12
  87. package/components/field-label-DxmPiC5p.js +106 -0
  88. package/components/field-label-Dz9kisdW.cjs +25 -0
  89. package/components/flow-D-0MTYCm.js +527 -0
  90. package/components/flow-DM3dNAKs.cjs +30 -0
  91. package/components/focus-group-DHeTq18L.js +218 -0
  92. package/components/focus-group-DnxZUBhQ.cjs +18 -0
  93. package/components/focus-visible-BvScGDCE.js +74 -0
  94. package/components/focus-visible-D4BXb5RB.cjs +18 -0
  95. package/components/focusable-B_KwfEec.cjs +18 -0
  96. package/components/focusable-C5JjRZmT.js +153 -0
  97. package/components/{focusable-selectors-IltOAOd9.js → focusable-selectors-B4YgbghQ.js} +4 -7
  98. package/components/focusable-selectors-BgFlyFcY.cjs +18 -0
  99. package/components/icon/index.cjs +1 -90
  100. package/components/icon/index.js +46 -74
  101. package/components/if-defined-DULpqYwi.js +27 -0
  102. package/components/if-defined-DaXWqfzc.cjs +22 -0
  103. package/components/index-CNK8wHXu.cjs +57 -0
  104. package/components/index-Cf6G4q52.js +1490 -0
  105. package/components/index-D3ICqC7S.js +1174 -0
  106. package/components/index-hqVbNKYy.cjs +113 -0
  107. package/components/index.cjs +1 -174
  108. package/components/index.js +172 -174
  109. package/components/infield-button/index.cjs +2 -46
  110. package/components/infield-button/index.js +30 -41
  111. package/components/label/index.cjs +1 -37
  112. package/components/label/index.js +24 -36
  113. package/components/{language-resolution-BSGJAWiQ.js → language-resolution-B-wjV5bb.js} +17 -21
  114. package/components/language-resolution-EUER43cg.cjs +18 -0
  115. package/components/like-anchor-Bu3pXbjT.cjs +32 -0
  116. package/components/like-anchor-DCFJN0LV.js +69 -0
  117. package/components/luzmo-icons-CiSek5iM.js +229 -0
  118. package/components/luzmo-icons-CtA-TJPd.cjs +29 -0
  119. package/components/manage-help-text-CHfMLzSa.js +92 -0
  120. package/components/manage-help-text-DNqdEkTA.cjs +30 -0
  121. package/components/menu/index.cjs +29 -1297
  122. package/components/menu/index.js +499 -954
  123. package/components/multi-language-field/index.cjs +2 -132
  124. package/components/multi-language-field/index.js +88 -118
  125. package/components/mutation-controller-DH7YOCyj.js +52 -0
  126. package/components/mutation-controller-DkOMCW-c.cjs +22 -0
  127. package/components/number-field/index.cjs +10 -613
  128. package/components/number-field/index.js +243 -442
  129. package/components/observe-slot-presence-CmVi0zTc.js +68 -0
  130. package/components/observe-slot-presence-bc9chhsi.cjs +18 -0
  131. package/components/observe-slot-text-C3moTjwy.js +87 -0
  132. package/components/observe-slot-text-D2VAEFSd.cjs +18 -0
  133. package/components/options/index.cjs +60 -693
  134. package/components/options/index.js +953 -519
  135. package/components/overlay/index.cjs +21 -367
  136. package/components/overlay/index.js +189 -273
  137. package/components/overlay-B3ajDLLq.cjs +47 -0
  138. package/components/overlay-CUKs69yr.js +2745 -0
  139. package/components/{pending-state-CXbe-Xul.js → pending-state-B2wWssTo.js} +13 -28
  140. package/components/pending-state-bJr-nEJl.cjs +26 -0
  141. package/components/picker/index.cjs +1 -9
  142. package/components/picker/index.js +11 -15
  143. package/components/picker-C0LvseZe.cjs +123 -0
  144. package/components/picker-W1qNmtsh.js +461 -0
  145. package/components/picker-button/index.cjs +4 -56
  146. package/components/picker-button/index.js +34 -45
  147. package/components/{condition-attribute-with-id-Cn815e9W.js → platform-BM-uMWpX.js} +49 -24
  148. package/components/platform-BiXhwqk3.cjs +18 -0
  149. package/components/popover/index.cjs +1 -7
  150. package/components/popover/index.js +8 -12
  151. package/components/popover-fwJeZHMQ.cjs +30 -0
  152. package/components/popover-iD8f5Jkp.js +67 -0
  153. package/components/progress-circle/index.cjs +1 -7
  154. package/components/progress-circle/index.js +8 -12
  155. package/components/progress-circle-DZxaMe8L.cjs +33 -0
  156. package/components/progress-circle-USIIU1up.js +97 -0
  157. package/components/query-BL-TJj7K.cjs +22 -0
  158. package/components/query-D_KR_GUc.js +51 -0
  159. package/components/query-assigned-elements-DjfhL1cl.js +36 -0
  160. package/components/query-assigned-elements-DsKsfk7G.cjs +22 -0
  161. package/components/query-assigned-nodes-BcKWmGzy.cjs +22 -0
  162. package/components/query-assigned-nodes-C76XVPWY.js +36 -0
  163. package/components/radio/index.cjs +2 -244
  164. package/components/radio/index.js +110 -192
  165. package/components/{random-id-BEc6QIUL.js → random-id-ByCz1xaq.js} +3 -3
  166. package/components/random-id-CqvckpWe.cjs +18 -0
  167. package/components/roving-tabindex-By_fCy_e.cjs +18 -0
  168. package/components/roving-tabindex-DOg4z6ZU.js +66 -0
  169. package/components/search/index.cjs +8 -115
  170. package/components/search/index.js +66 -96
  171. package/components/select/index.cjs +51 -720
  172. package/components/select/index.js +347 -563
  173. package/components/sized-mixin-CJbBHWRQ.js +63 -0
  174. package/components/sized-mixin-WPHH0a_D.cjs +18 -0
  175. package/components/slider/index.cjs +1 -119
  176. package/components/slider/index.js +1113 -100
  177. package/components/slottable-request-event-BfUUt1Mh.cjs +18 -0
  178. package/components/{slottable-request-event-D9WzrdWv.js → slottable-request-event-DggLA4Rx.js} +9 -12
  179. package/components/state-DwIwYPvt.js +29 -0
  180. package/components/state-vf0PJN3_.cjs +22 -0
  181. package/components/strategies-C6HsQpU2.cjs +18 -0
  182. package/components/strategies-CUMLHtQI.js +195 -0
  183. package/components/streaming-listener-BQ68fKMa.js +91 -0
  184. package/components/streaming-listener-DeGQYM-9.cjs +18 -0
  185. package/components/style-map-Bnhf_mVZ.js +53 -0
  186. package/components/style-map-DuMd5xlY.cjs +22 -0
  187. package/components/swatch/index.cjs +7 -436
  188. package/components/swatch/index.js +205 -350
  189. package/components/switch/index.cjs +2 -61
  190. package/components/switch/index.js +34 -51
  191. package/components/tabs/index.cjs +26 -693
  192. package/components/tabs/index.js +388 -521
  193. package/components/tags/index.cjs +4 -201
  194. package/components/tags/index.js +87 -152
  195. package/components/text-field/index.cjs +3 -49
  196. package/components/text-field/index.js +30 -44
  197. package/components/text-field-BkFPYo7S.cjs +85 -0
  198. package/components/text-field-C2n3rzCK.js +314 -0
  199. package/components/text-field.module-C2KVUJcX.js +21 -0
  200. package/components/text-field.module-DXhFA9G-.cjs +18 -0
  201. package/components/toast/index.cjs +12 -177
  202. package/components/toast/index.js +73 -145
  203. package/components/tooltip/index.cjs +6 -221
  204. package/components/tooltip/index.js +131 -155
  205. package/components/tooltip/tooltip.d.ts +12 -1
  206. package/components/unit-input/index.cjs +8 -232
  207. package/components/unit-input/index.js +108 -201
  208. package/components/utils.cjs +1 -25
  209. package/components/utils.js +22 -22
  210. package/components/{random-id-BE6HA503.cjs → when-CDK1Tt5Y.js} +10 -7
  211. package/components/when-CDZyJPvd.cjs +22 -0
  212. package/custom-elements.json +1 -1
  213. package/package.json +1 -1
  214. package/components/action-group-DHp8RHDf.js +0 -392
  215. package/components/action-group-MPf19RPV.cjs +0 -391
  216. package/components/base-COw9n7UR.cjs +0 -119
  217. package/components/base-DmeVy0cq.js +0 -120
  218. package/components/button-base-7Ak55xFd.cjs +0 -206
  219. package/components/button-base-C3kf6BTK.js +0 -207
  220. package/components/checkbox-mixin-8cL-vfDy.js +0 -84
  221. package/components/checkbox-mixin-CE7dJj3J.cjs +0 -83
  222. package/components/clear-button-Co6oKSgl.js +0 -59
  223. package/components/clear-button-X_HDY2eH.cjs +0 -58
  224. package/components/close-button-DPBK6Kpu.cjs +0 -59
  225. package/components/close-button-Miw9ZjoJ.js +0 -60
  226. package/components/color-controller-BjDZaxhX.js +0 -491
  227. package/components/color-controller-C3c_vb2P.cjs +0 -490
  228. package/components/color-loupe-BQqNR8YD.cjs +0 -88
  229. package/components/color-loupe-B_DDFv8l.js +0 -89
  230. package/components/condition-attribute-with-id-DEc2Yjne.cjs +0 -43
  231. package/components/dependency-manger-CcIE1uvQ.cjs +0 -63
  232. package/components/divider.module-Cm5LcDRV.cjs +0 -20
  233. package/components/divider.module-DauH6k2_.js +0 -21
  234. package/components/element-resolution-DCsrhGZO.cjs +0 -112
  235. package/components/element-resolution-nMlmW4Jy.js +0 -113
  236. package/components/field-group-DNmY8W9v.cjs +0 -86
  237. package/components/field-group-DVdAWCQF.js +0 -87
  238. package/components/field-label-CKH9EXpR.cjs +0 -156
  239. package/components/field-label-Dpsecoc6.js +0 -157
  240. package/components/focus-group-BqDAk9Is.js +0 -337
  241. package/components/focus-group-DFzOlalL.cjs +0 -336
  242. package/components/focus-visible-B-B8-P9R.cjs +0 -104
  243. package/components/focus-visible-BUPRWlsh.js +0 -105
  244. package/components/focusable-BPrTcZPd.cjs +0 -262
  245. package/components/focusable-ChCLg1k4.js +0 -263
  246. package/components/language-resolution-iN9EImbb.cjs +0 -57
  247. package/components/like-anchor-D62faRNG.cjs +0 -79
  248. package/components/like-anchor-v3cJ9RWM.js +0 -80
  249. package/components/manage-help-text-BYx84zZR.cjs +0 -125
  250. package/components/manage-help-text-DOuMTGht.js +0 -126
  251. package/components/observe-slot-presence-9AwLGUQ_.cjs +0 -78
  252. package/components/observe-slot-presence-DcMdoumP.js +0 -79
  253. package/components/observe-slot-text-CSofZeeF.cjs +0 -104
  254. package/components/observe-slot-text-CjnkkBPn.js +0 -105
  255. package/components/overlay-CN8ISP1F.js +0 -2485
  256. package/components/overlay-LViy9VWM.cjs +0 -2484
  257. package/components/pending-state-e4RbXe9u.cjs +0 -75
  258. package/components/picker-DNde3awt.cjs +0 -672
  259. package/components/picker-PfUAF05y.js +0 -673
  260. package/components/platform-CxDar3Dn.cjs +0 -68
  261. package/components/platform-Cxn0WbyT.js +0 -69
  262. package/components/popover-BkbYhl3i.js +0 -74
  263. package/components/popover-BkgUf0kL.cjs +0 -74
  264. package/components/progress-circle-Hu_ivPHf.js +0 -133
  265. package/components/progress-circle-_Etqsj9f.cjs +0 -132
  266. package/components/roving-tabindex-AsmAh2In.cjs +0 -95
  267. package/components/roving-tabindex-DPF9NmrH.js +0 -96
  268. package/components/sized-mixin-DmkrNdWB.js +0 -80
  269. package/components/sized-mixin-UaTVa-AE.cjs +0 -79
  270. package/components/strategies-DlMlaSJR.cjs +0 -317
  271. package/components/strategies-DlPQoTFE.js +0 -318
  272. package/components/streaming-listener-D4sHaMub.cjs +0 -145
  273. package/components/streaming-listener-cAz5zJyk.js +0 -146
  274. package/components/text-field-11tcnftU.cjs +0 -338
  275. package/components/text-field-Chi9J2Cz.js +0 -339
  276. package/components/text-field.module-CMBS0jSL.js +0 -21
  277. package/components/text-field.module-DIJdV_sA.cjs +0 -20
@@ -15,185 +15,26 @@
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";
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}
18
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../base-Cy0MQrPT.cjs"),L=require("../focus-visible-D4BXb5RB.cjs"),I=require("../observe-slot-presence-bc9chhsi.cjs"),E=require("../observe-slot-text-D2VAEFSd.cjs"),y=require("../random-id-CqvckpWe.cjs"),f=require("../query-BL-TJj7K.cjs"),m=require("../class-map-D-Y-hsN5.cjs"),x=require("../if-defined-DaXWqfzc.cjs"),S=require("../sized-mixin-WPHH0a_D.cjs"),$=require("../focusable-B_KwfEec.cjs"),q=require("../roving-tabindex-By_fCy_e.cjs"),w=require("../luzmo-icons-CtA-TJPd.cjs"),A=require("../state-vf0PJN3_.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}
71
20
  <label id="item-label" ?hidden=${!this.hasLabel}>
72
- ${this.slotHasContent ? lit.nothing : this.label}
21
+ ${this.slotHasContent?s.E:this.label}
73
22
  <slot>${this.label}</slot>
74
23
  </label>
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`
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`
141
25
  <slot
142
26
  @focusin=${this.handleFocusin}
143
27
  @focusout=${this.handleFocusout}
144
28
  ></slot>
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`
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`
197
38
  :host([direction='vertical-right']) #selection-indicator,
198
39
  :host([direction='vertical']) #selection-indicator {
199
40
  height: ${this.baseSize}px;
@@ -201,269 +42,10 @@ const ScaledIndicator = {
201
42
  :host([dir][direction='horizontal']) #selection-indicator {
202
43
  width: ${this.baseSize}px;
203
44
  }
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`
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`
464
46
  <div
465
- class=${classMap_js.classMap({ scroll: this.enableTabsScroll })}
466
- aria-label=${ifDefined_js.ifDefined(this.label ?? void 0)}
47
+ class=${m.e({scroll:this.enableTabsScroll})}
48
+ aria-label=${x.o(this.label??void 0)}
467
49
  @click=${this.onClick}
468
50
  @keydown=${this.onKeyDown}
469
51
  @scroll=${this.onTabsScroll}
@@ -474,287 +56,38 @@ class LuzmoTabs extends sizedMixin.SizedMixin(focusable.Focusable, { noDefaultSi
474
56
  <slot @slotchange=${this.onSlotChange}></slot>
475
57
  <div
476
58
  id="selection-indicator"
477
- class=${ifDefined_js.ifDefined(this.shouldAnimate ? void 0 : "first-position")}
59
+ class=${x.o(this.shouldAnimate?void 0:"first-position")}
478
60
  style=${this.selectionIndicatorStyle}
479
61
  role="presentation"
480
62
  ></div>
481
63
  </div>
482
64
  <slot name="tab-panel" @slotchange=${this.managePanels}></slot>
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`
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`
684
66
  <div
685
- class=${classMap_js.classMap({
686
- "tabs-overflow-container": true,
687
- "left-shadow": canScrollLeft,
688
- "right-shadow": canScrollRight
689
- })}
67
+ class=${m.e({"tabs-overflow-container":!0,"left-shadow":o,"right-shadow":t})}
690
68
  >
691
69
  <luzmo-action-button
692
- class=${classMap_js.classMap({
693
- "left-scroll": true,
694
- show: canScrollLeft
695
- })}
696
- aria-label=${ariaLabelPrevious}
70
+ class=${m.e({"left-scroll":!0,show:o})}
71
+ aria-label=${i}
697
72
  quiet
698
73
  dir="rtl"
699
74
  tabindex="-1"
700
75
  @click=${this._handleScrollClick}
701
76
  >
702
- <luzmo-icon slot="icon" .icon=${icons.luzmoAngleLeft}></luzmo-icon>
77
+ <luzmo-icon slot="icon" .icon=${w.k}></luzmo-icon>
703
78
  </luzmo-action-button>
704
79
  <luzmo-action-button
705
- class=${classMap_js.classMap({
706
- "right-scroll": true,
707
- show: canScrollRight
708
- })}
709
- aria-label=${ariaLabelNext}
80
+ class=${m.e({"right-scroll":!0,show:t})}
81
+ aria-label=${e}
710
82
  quiet
711
83
  tabindex="-1"
712
84
  @click=${this._handleScrollClick}
713
85
  >
714
- <luzmo-icon slot="icon" .icon=${icons.luzmoAngleRight}></luzmo-icon>
86
+ <luzmo-icon slot="icon" .icon=${w.S}></luzmo-icon>
715
87
  </luzmo-action-button>
716
88
  <slot
717
89
  @slotchange=${this._handleSlotChange}
718
90
  @luzmo-tabs-scroll=${this._updateScrollState}
719
91
  ></slot>
720
92
  </div>
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;
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;