@editora/ui-core 0.1.20 → 0.1.22

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 (290) hide show
  1. package/dist/accordion.cjs.js +3 -3
  2. package/dist/accordion.esm.js +3 -3
  3. package/dist/alert-dialog.cjs.js +32 -32
  4. package/dist/alert-dialog.esm.js +95 -75
  5. package/dist/alert.cjs.js +6 -6
  6. package/dist/alert.esm.js +6 -6
  7. package/dist/animated-list.cjs.js +4 -4
  8. package/dist/animated-list.esm.js +4 -4
  9. package/dist/animated-text.cjs.js +4 -4
  10. package/dist/animated-text.esm.js +4 -4
  11. package/dist/app-header.cjs.js +3 -3
  12. package/dist/app-header.esm.js +3 -3
  13. package/dist/aspect-ratio.cjs.js +3 -3
  14. package/dist/aspect-ratio.esm.js +3 -3
  15. package/dist/avatar.cjs.js +14 -14
  16. package/dist/avatar.esm.js +31 -29
  17. package/dist/badge.cjs.js +4 -4
  18. package/dist/badge.esm.js +4 -4
  19. package/dist/block-controls.cjs.js +4 -4
  20. package/dist/block-controls.esm.js +4 -4
  21. package/dist/box.cjs.js +2 -2
  22. package/dist/box.esm.js +2 -2
  23. package/dist/breadcrumb.cjs.js +5 -5
  24. package/dist/breadcrumb.esm.js +5 -5
  25. package/dist/button.cjs.js +1 -1
  26. package/dist/button.esm.js +1 -1
  27. package/dist/{calendar-DLY4acgn.mjs → calendar-DbxYRdlv.mjs} +227 -183
  28. package/dist/{calendar-Dkof-FTK.js → calendar-Qa-cFOp3.js} +74 -35
  29. package/dist/calendar.cjs.js +1 -1
  30. package/dist/calendar.esm.js +1 -1
  31. package/dist/card.cjs.js +8 -8
  32. package/dist/card.esm.js +63 -20
  33. package/dist/chart.cjs.js +4 -4
  34. package/dist/chart.esm.js +6 -6
  35. package/dist/checkbox.cjs.js +2 -2
  36. package/dist/checkbox.esm.js +2 -2
  37. package/dist/collapsible.cjs.js +7 -7
  38. package/dist/collapsible.esm.js +7 -7
  39. package/dist/collection.cjs.js +1 -1
  40. package/dist/collection.esm.js +27 -23
  41. package/dist/color-picker.cjs.js +34 -14
  42. package/dist/color-picker.esm.js +89 -67
  43. package/dist/combobox.cjs.js +29 -27
  44. package/dist/combobox.esm.js +51 -45
  45. package/dist/command.cjs.js +2 -2
  46. package/dist/command.esm.js +2 -2
  47. package/dist/components/ui-alert-dialog.d.ts +1 -0
  48. package/dist/components/ui-alert-dialog.d.ts.map +1 -1
  49. package/dist/components/ui-avatar.d.ts +1 -0
  50. package/dist/components/ui-avatar.d.ts.map +1 -1
  51. package/dist/components/ui-button.d.ts +1 -0
  52. package/dist/components/ui-button.d.ts.map +1 -1
  53. package/dist/components/ui-calendar.d.ts.map +1 -1
  54. package/dist/components/ui-card.d.ts +3 -0
  55. package/dist/components/ui-card.d.ts.map +1 -1
  56. package/dist/components/ui-checkbox.d.ts.map +1 -1
  57. package/dist/components/ui-collection.d.ts.map +1 -1
  58. package/dist/components/ui-color-picker.d.ts.map +1 -1
  59. package/dist/components/ui-combobox.d.ts.map +1 -1
  60. package/dist/components/ui-data-table.d.ts.map +1 -1
  61. package/dist/components/ui-date-field.d.ts.map +1 -1
  62. package/dist/components/ui-date-picker.d.ts.map +1 -1
  63. package/dist/components/ui-date-range-picker.d.ts.map +1 -1
  64. package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
  65. package/dist/components/ui-date-time-picker.d.ts.map +1 -1
  66. package/dist/components/ui-dock.d.ts +1 -0
  67. package/dist/components/ui-dock.d.ts.map +1 -1
  68. package/dist/components/ui-drawer.d.ts.map +1 -1
  69. package/dist/components/ui-dropdown.d.ts.map +1 -1
  70. package/dist/components/ui-field.d.ts.map +1 -1
  71. package/dist/components/ui-file-upload.d.ts.map +1 -1
  72. package/dist/components/ui-gantt.d.ts.map +1 -1
  73. package/dist/components/ui-input.d.ts.map +1 -1
  74. package/dist/components/ui-menu.d.ts.map +1 -1
  75. package/dist/components/ui-multi-select.d.ts.map +1 -1
  76. package/dist/components/ui-number-field.d.ts.map +1 -1
  77. package/dist/components/ui-password-field.d.ts.map +1 -1
  78. package/dist/components/ui-pin-input.d.ts +1 -0
  79. package/dist/components/ui-pin-input.d.ts.map +1 -1
  80. package/dist/components/ui-placement-grid.d.ts.map +1 -1
  81. package/dist/components/ui-portal.d.ts.map +1 -1
  82. package/dist/components/ui-positioner.d.ts.map +1 -1
  83. package/dist/components/ui-progress.d.ts.map +1 -1
  84. package/dist/components/ui-radio.d.ts.map +1 -1
  85. package/dist/components/ui-rating.d.ts +1 -0
  86. package/dist/components/ui-rating.d.ts.map +1 -1
  87. package/dist/components/ui-select.d.ts.map +1 -1
  88. package/dist/components/ui-sortable.d.ts +8 -0
  89. package/dist/components/ui-sortable.d.ts.map +1 -1
  90. package/dist/components/ui-switch.d.ts.map +1 -1
  91. package/dist/components/ui-table.d.ts.map +1 -1
  92. package/dist/components/ui-tabs.d.ts +1 -0
  93. package/dist/components/ui-tabs.d.ts.map +1 -1
  94. package/dist/components/ui-tags-input.d.ts +1 -0
  95. package/dist/components/ui-tags-input.d.ts.map +1 -1
  96. package/dist/components/ui-textarea.d.ts.map +1 -1
  97. package/dist/components/ui-time-field.d.ts.map +1 -1
  98. package/dist/components/ui-toggle-group.d.ts.map +1 -1
  99. package/dist/components/ui-toggle.d.ts.map +1 -1
  100. package/dist/components/ui-tree.d.ts.map +1 -1
  101. package/dist/components/ui-wizard.d.ts.map +1 -1
  102. package/dist/context-menu.cjs.js +3 -3
  103. package/dist/context-menu.esm.js +4 -4
  104. package/dist/control-name-BmoI1m3a.js +1 -0
  105. package/dist/control-name-Bpj7F34X.mjs +48 -0
  106. package/dist/data-table.cjs.js +5 -2
  107. package/dist/data-table.esm.js +145 -142
  108. package/dist/date-field.cjs.js +5 -5
  109. package/dist/date-field.esm.js +34 -31
  110. package/dist/date-picker.cjs.js +16 -16
  111. package/dist/date-picker.esm.js +48 -44
  112. package/dist/date-range-picker.cjs.js +5 -5
  113. package/dist/date-range-picker.esm.js +120 -118
  114. package/dist/date-range-time-picker.cjs.js +22 -22
  115. package/dist/date-range-time-picker.esm.js +88 -84
  116. package/dist/date-time-picker.cjs.js +26 -26
  117. package/dist/date-time-picker.esm.js +105 -101
  118. package/dist/{date-time-utils-Dmost5Ee.js → date-time-utils-BzfTpeU-.js} +1 -1
  119. package/dist/{date-time-utils-y1N2gvG2.mjs → date-time-utils-Cps2aSu2.mjs} +1 -1
  120. package/dist/description.cjs.js +3 -3
  121. package/dist/description.esm.js +3 -3
  122. package/dist/dialog.cjs.js +2 -2
  123. package/dist/dialog.esm.js +2 -2
  124. package/dist/dock.cjs.js +12 -12
  125. package/dist/dock.esm.js +72 -74
  126. package/dist/drawer.cjs.js +19 -19
  127. package/dist/drawer.esm.js +58 -58
  128. package/dist/dropdown.cjs.js +13 -13
  129. package/dist/dropdown.esm.js +49 -48
  130. package/dist/empty-state.cjs.js +3 -3
  131. package/dist/empty-state.esm.js +3 -3
  132. package/dist/field-error.cjs.js +1 -1
  133. package/dist/field-error.esm.js +1 -1
  134. package/dist/field.cjs.js +12 -12
  135. package/dist/field.esm.js +84 -75
  136. package/dist/fieldset.cjs.js +4 -4
  137. package/dist/fieldset.esm.js +4 -4
  138. package/dist/file-upload.cjs.js +3 -3
  139. package/dist/file-upload.esm.js +5 -3
  140. package/dist/floating-toolbar.cjs.js +8 -8
  141. package/dist/floating-toolbar.esm.js +9 -9
  142. package/dist/form.cjs.js +11 -11
  143. package/dist/form.esm.js +11 -11
  144. package/dist/gantt.cjs.js +43 -32
  145. package/dist/gantt.esm.js +99 -88
  146. package/dist/icon-cloud.cjs.js +3 -3
  147. package/dist/icon-cloud.esm.js +3 -3
  148. package/dist/icon.cjs.js +1 -1
  149. package/dist/icon.esm.js +1 -1
  150. package/dist/index.cjs.js +1 -1
  151. package/dist/index.esm.js +121 -118
  152. package/dist/inline-edit.cjs.js +1 -1
  153. package/dist/inline-edit.esm.js +1 -1
  154. package/dist/input.cjs.js +14 -14
  155. package/dist/input.esm.js +39 -32
  156. package/dist/label.cjs.js +3 -3
  157. package/dist/label.esm.js +3 -3
  158. package/dist/{listbox-B6QgECax.js → listbox-CTpRpuF7.js} +1 -1
  159. package/dist/{listbox-DJamVeFj.mjs → listbox-hMVOhKHC.mjs} +1 -1
  160. package/dist/listbox.cjs.js +1 -1
  161. package/dist/listbox.esm.js +1 -1
  162. package/dist/marquee.cjs.js +3 -3
  163. package/dist/marquee.esm.js +3 -3
  164. package/dist/{menu-item-styles-CbNUEwP2.js → menu-item-styles-B4onAr4C.js} +3 -3
  165. package/dist/{menu-item-styles-CZiPwPwl.mjs → menu-item-styles-IGSFLAHu.mjs} +3 -3
  166. package/dist/menu.cjs.js +7 -7
  167. package/dist/menu.esm.js +29 -28
  168. package/dist/menubar.cjs.js +1 -1
  169. package/dist/menubar.esm.js +2 -2
  170. package/dist/meter.cjs.js +1 -1
  171. package/dist/meter.esm.js +1 -1
  172. package/dist/multi-select.cjs.js +18 -18
  173. package/dist/multi-select.esm.js +82 -66
  174. package/dist/navigation-menu.cjs.js +1 -1
  175. package/dist/navigation-menu.esm.js +1 -1
  176. package/dist/number-field.cjs.js +11 -13
  177. package/dist/number-field.esm.js +29 -27
  178. package/dist/number-ticker.cjs.js +4 -4
  179. package/dist/number-ticker.esm.js +4 -4
  180. package/dist/odometer.cjs.js +2 -2
  181. package/dist/odometer.esm.js +2 -2
  182. package/dist/orbiter.cjs.js +3 -3
  183. package/dist/orbiter.esm.js +3 -3
  184. package/dist/pagination.cjs.js +1 -1
  185. package/dist/pagination.esm.js +1 -1
  186. package/dist/password-field.cjs.js +23 -23
  187. package/dist/password-field.esm.js +48 -47
  188. package/dist/pin-input.cjs.js +8 -6
  189. package/dist/pin-input.esm.js +21 -15
  190. package/dist/placement-grid.cjs.js +4 -4
  191. package/dist/placement-grid.esm.js +58 -58
  192. package/dist/plugin-panel.cjs.js +1 -1
  193. package/dist/plugin-panel.esm.js +1 -1
  194. package/dist/popover.cjs.js +5 -5
  195. package/dist/popover.esm.js +4 -4
  196. package/dist/portal.cjs.js +3 -3
  197. package/dist/portal.esm.js +11 -10
  198. package/dist/positioner.cjs.js +2 -2
  199. package/dist/positioner.esm.js +15 -14
  200. package/dist/primitives/auto-scroll.d.ts +9 -0
  201. package/dist/primitives/auto-scroll.d.ts.map +1 -0
  202. package/dist/primitives/control-name.d.ts +30 -0
  203. package/dist/primitives/control-name.d.ts.map +1 -0
  204. package/dist/primitives/selector.d.ts +4 -0
  205. package/dist/primitives/selector.d.ts.map +1 -0
  206. package/dist/primitives/trigger.d.ts +2 -0
  207. package/dist/primitives/trigger.d.ts.map +1 -0
  208. package/dist/progress.cjs.js +4 -4
  209. package/dist/progress.esm.js +20 -18
  210. package/dist/quick-actions.cjs.js +3 -3
  211. package/dist/quick-actions.esm.js +3 -3
  212. package/dist/radio-group.cjs.js +1 -1
  213. package/dist/radio-group.esm.js +1 -1
  214. package/dist/radio.cjs.js +2 -2
  215. package/dist/radio.esm.js +2 -2
  216. package/dist/rating.cjs.js +17 -16
  217. package/dist/rating.esm.js +91 -92
  218. package/dist/{runtime-D1gFh1fS.mjs → runtime-CFnK53iC.mjs} +133 -94
  219. package/dist/runtime-DwE-tizc.js +1 -0
  220. package/dist/runtime.cjs.js +1 -1
  221. package/dist/runtime.d.ts +1 -1
  222. package/dist/runtime.d.ts.map +1 -1
  223. package/dist/runtime.esm.js +29 -26
  224. package/dist/select.cjs.js +20 -19
  225. package/dist/select.esm.js +36 -32
  226. package/dist/selection-popup.cjs.js +2 -2
  227. package/dist/selection-popup.esm.js +2 -2
  228. package/dist/selector-BvAh35ve.js +1 -0
  229. package/dist/selector-WI8pD7YO.mjs +18 -0
  230. package/dist/separator.cjs.js +7 -7
  231. package/dist/separator.esm.js +7 -7
  232. package/dist/sidebar.cjs.js +7 -7
  233. package/dist/sidebar.esm.js +7 -7
  234. package/dist/skeleton.cjs.js +7 -7
  235. package/dist/skeleton.esm.js +7 -7
  236. package/dist/slider.cjs.js +3 -3
  237. package/dist/slider.esm.js +3 -3
  238. package/dist/slot.cjs.js +3 -3
  239. package/dist/slot.esm.js +3 -3
  240. package/dist/sortable.cjs.js +61 -48
  241. package/dist/sortable.esm.js +636 -554
  242. package/dist/spinning-text.cjs.js +3 -3
  243. package/dist/spinning-text.esm.js +3 -3
  244. package/dist/split-button.cjs.js +1 -1
  245. package/dist/split-button.esm.js +1 -1
  246. package/dist/stepper.cjs.js +1 -1
  247. package/dist/stepper.esm.js +1 -1
  248. package/dist/switch.cjs.js +10 -12
  249. package/dist/switch.esm.js +10 -12
  250. package/dist/table.cjs.js +9 -6
  251. package/dist/table.esm.js +46 -43
  252. package/dist/tabs.cjs.js +22 -23
  253. package/dist/tabs.esm.js +116 -112
  254. package/dist/tags-input.cjs.js +9 -9
  255. package/dist/tags-input.esm.js +32 -25
  256. package/dist/textarea.cjs.js +13 -13
  257. package/dist/textarea.esm.js +46 -31
  258. package/dist/theme.d.ts +18 -0
  259. package/dist/theme.d.ts.map +1 -1
  260. package/dist/time-field.cjs.js +5 -5
  261. package/dist/time-field.esm.js +21 -18
  262. package/dist/time-picker.cjs.js +4 -4
  263. package/dist/time-picker.esm.js +5 -5
  264. package/dist/timeline.cjs.js +2 -2
  265. package/dist/timeline.esm.js +4 -4
  266. package/dist/toast.cjs.js +6 -6
  267. package/dist/toast.esm.js +13 -13
  268. package/dist/toggle-group.cjs.js +5 -6
  269. package/dist/toggle-group.esm.js +63 -60
  270. package/dist/toggle.cjs.js +18 -18
  271. package/dist/toggle.esm.js +32 -31
  272. package/dist/tooltip.cjs.js +4 -4
  273. package/dist/tooltip.esm.js +4 -4
  274. package/dist/transfer-list.cjs.js +32 -32
  275. package/dist/transfer-list.esm.js +57 -57
  276. package/dist/tree-7qbVnpGp.js +39 -0
  277. package/dist/{tree-B3kE8ESs.mjs → tree-Deoft-kO.mjs} +34 -33
  278. package/dist/tree.cjs.js +1 -1
  279. package/dist/tree.esm.js +1 -1
  280. package/dist/trigger-BjnxLCeQ.mjs +9 -0
  281. package/dist/trigger-DkPsKxsP.js +1 -0
  282. package/dist/{ui-button-rXQOS9QJ.js → ui-button-BInsgSbr.js} +27 -26
  283. package/dist/{ui-button-Q0GNNWKC.mjs → ui-button-rfiuUnUD.mjs} +65 -48
  284. package/dist/{ui-icon-YI6lyuqU.mjs → ui-icon-BSi_GtqO.mjs} +2 -2
  285. package/dist/{ui-icon-BzVNC_lr.js → ui-icon-Bvt9oIIR.js} +5 -5
  286. package/dist/wizard.cjs.js +12 -13
  287. package/dist/wizard.esm.js +17 -15
  288. package/package.json +1 -1
  289. package/dist/runtime-CTaOSmBj.js +0 -1
  290. package/dist/tree-Dx_kv_ih.js +0 -39
package/dist/tabs.cjs.js CHANGED
@@ -1,10 +1,10 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=require("./ElementBase-EV6mVBUV.js"),u=require("./roving-focus-group-BdJ_4Njm.js"),y=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=require("./ElementBase-EV6mVBUV.js"),d=require("./roving-focus-group-BdJ_4Njm.js"),_=`
2
2
  :host {
3
3
  --ui-tabs-nav-bg: var(--ui-color-surface, #ffffff);
4
4
  --ui-tabs-panel-bg: var(--ui-color-surface, #ffffff);
5
5
  --ui-tabs-border: var(--ui-color-border, #cbd5e1);
6
6
  --ui-tabs-text: var(--ui-color-text, #0f172a);
7
- --ui-tabs-muted: var(--ui-color-muted, #64748b);
7
+ --ui-tabs-muted: var(--ui-color-muted, #526175);
8
8
  --ui-tabs-accent: var(--ui-tabs-active-bg, var(--ui-color-primary, #2563eb));
9
9
  --ui-tabs-active-text: color-mix(in srgb, var(--ui-tabs-accent) 82%, #0f172a 18%);
10
10
  --ui-tabs-focus: var(--ui-color-focus-ring, #2563eb);
@@ -298,18 +298,18 @@
298
298
  --ui-tabs-nav-bg: var(--ui-tabs-accent);
299
299
  --ui-tabs-panel-bg: var(--ui-color-surface, #ffffff);
300
300
  --ui-tabs-border: color-mix(in srgb, var(--ui-tabs-accent) 76%, #0f172a 24%);
301
- --ui-tabs-muted: color-mix(in srgb, var(--ui-color-primary-foreground, #ffffff) 80%, transparent);
301
+ --ui-tabs-muted: color-mix(in srgb, var(--ui-color-primary-foreground, var(--ui-color-foreground-on-primary, #ffffff)) 94%, transparent);
302
302
  --ui-tabs-active-text: color-mix(in srgb, var(--ui-tabs-accent) 78%, #0f172a 22%);
303
- --ui-tabs-focus: color-mix(in srgb, var(--ui-color-primary-foreground, #ffffff) 72%, var(--ui-tabs-accent));
303
+ --ui-tabs-focus: color-mix(in srgb, var(--ui-color-primary-foreground, var(--ui-color-foreground-on-primary, #ffffff)) 72%, var(--ui-tabs-accent));
304
304
  }
305
305
 
306
306
  :host([variant="solid"]) .tab:hover {
307
- background: color-mix(in srgb, var(--ui-color-primary-foreground, #ffffff) 14%, transparent);
308
- color: var(--ui-color-primary-foreground, #ffffff);
307
+ background: color-mix(in srgb, var(--ui-color-primary-foreground, var(--ui-color-foreground-on-primary, #ffffff)) 14%, transparent);
308
+ color: var(--ui-color-primary-foreground, var(--ui-color-foreground-on-primary, #ffffff));
309
309
  }
310
310
 
311
311
  :host([variant="solid"]) .tab[aria-selected="true"] {
312
- background: var(--ui-color-primary-foreground, #ffffff);
312
+ background: var(--ui-color-primary-foreground, var(--ui-color-foreground-on-primary, #ffffff));
313
313
  border-color: color-mix(in srgb, var(--ui-tabs-accent) 44%, var(--ui-tabs-border));
314
314
  color: var(--ui-tabs-active-text);
315
315
  }
@@ -433,11 +433,11 @@
433
433
  }
434
434
 
435
435
  :host([tone="success"]) {
436
- --ui-tabs-accent: var(--ui-color-success, #16a34a);
436
+ --ui-tabs-accent: var(--ui-color-success, #15803d);
437
437
  }
438
438
 
439
439
  :host([tone="warning"]) {
440
- --ui-tabs-accent: var(--ui-color-warning, #d97706);
440
+ --ui-tabs-accent: var(--ui-color-warning, #b45309);
441
441
  }
442
442
 
443
443
  :host([tone="danger"]) {
@@ -483,33 +483,32 @@
483
483
  border-color: Highlight;
484
484
  }
485
485
  }
486
- `;function p(v){return String(v).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function f(v){if(v==null)return!1;const t=String(v).toLowerCase();return t!=="false"&&t!=="0"&&t!=="off"}const _=new Set(["orientation","activation","headless","variant","size","density","tone","stretched","shape","elevation","bare"]);class g extends m.ElementBase{constructor(){super(),this._uid=`ui-tabs-${Math.random().toString(36).slice(2,9)}`,this._observer=null,this._resizeObserver=null,this._isSyncing=!1,this._isSyncingSelectionAttributes=!1,this._focusIndex=-1,this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onWindowResize=this._onWindowResize.bind(this)}static get observedAttributes(){return["selected","value","orientation","activation","headless","variant","size","density","tone","stretched","shape","elevation","loop","bare"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onClick),this.root.addEventListener("keydown",this._onKeyDown),this._observer=new MutationObserver(()=>{this._isSyncing||this.requestRender()}),this._observer.observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["slot","data-label","data-value","data-icon","data-disabled","disabled","data-active"]}),typeof ResizeObserver<"u"?(this._resizeObserver=new ResizeObserver(()=>this._syncSelectionUi()),this._resizeObserver.observe(this)):window.addEventListener("resize",this._onWindowResize),this._syncSelectionUi()}disconnectedCallback(){this.root.removeEventListener("click",this._onClick),this.root.removeEventListener("keydown",this._onKeyDown),this._observer&&(this._observer.disconnect(),this._observer=null),this._resizeObserver?(this._resizeObserver.disconnect(),this._resizeObserver=null):window.removeEventListener("resize",this._onWindowResize),super.disconnectedCallback()}attributeChangedCallback(t,e,i){if(e!==i){if(t==="selected"||t==="value"){this._isSyncingSelectionAttributes||this._syncSelectionUi();return}_.has(t)&&this.isConnected&&this.requestRender()}}get selected(){return this.getAttribute("selected")||"0"}set selected(t){const e=String(t);e?this.setAttribute("selected",e):this.removeAttribute("selected")}_sourceTabs(){return Array.from(this.querySelectorAll('[slot="tab"]'))}_sourcePanels(){return Array.from(this.querySelectorAll('[slot="panel"]'))}_tabsModel(){return this._sourceTabs().map((t,e)=>{const i=t.getAttribute("data-value")||t.getAttribute("value")||String(e),a=t.getAttribute("data-label")||t.textContent?.trim()||`Tab ${e+1}`,r=t.getAttribute("data-icon")||"",s=t.hasAttribute("disabled")||f(t.getAttribute("data-disabled")),n=`${this._uid}-tab-${e}`,o=`${this._uid}-panel-${e}`;return{index:e,value:i,label:a,icon:r,disabled:s,tabId:n,panelId:o}})}_resolveSelectedIndex(t){if(!t.length)return-1;const e=this.getAttribute("selected"),i=this.getAttribute("value"),a=this._sourceTabs();let r=-1;if(e!=null&&e!==""){const s=Number(e);Number.isFinite(s)?r=Math.trunc(s):r=t.findIndex(n=>n.value===e)}return r<0&&i&&(r=t.findIndex(s=>s.value===i)),r<0&&(r=t.findIndex((s,n)=>!!a[n]?.hasAttribute("data-active")&&!s.disabled)),(r<0||!t[r]||t[r].disabled)&&(r=t.findIndex(s=>!s.disabled)),r}_syncSelectedAttributes(t,e){const i=t[e];this._isSyncingSelectionAttributes=!0;try{if(!i){this.removeAttribute("selected"),this.removeAttribute("value");return}this.getAttribute("selected")!==String(e)&&this.setAttribute("selected",String(e)),this.getAttribute("value")!==i.value&&this.setAttribute("value",i.value)}finally{this._isSyncingSelectionAttributes=!1}}_emit(t,e,i){const a=e[i];if(!a)return;const r={selected:i,index:i,value:a.value,label:a.label,tabId:a.tabId,panelId:a.panelId};this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0}))}_setSelectedByIndex(t,e,i){const a=t[e];if(!a||a.disabled)return;if(this._resolveSelectedIndex(t)===e){this._focusTab(e);return}this._focusIndex=e,this.setAttribute("selected",String(e)),this.setAttribute("value",a.value),i&&(this._emit("change",t,e),this._emit("select",t,e))}_syncSelectionUi(){if(!this.isConnected)return;if(!this.root.querySelector(".nav")){this.requestRender();return}const t=this._tabsModel();if(!t.length)return;const e=this._resolveSelectedIndex(t),i=this._resolveFocusIndex(t,e);this._syncSelectedAttributes(t,e);const a=Array.from(this.root.querySelectorAll(".tab"));a.forEach((s,n)=>{const o=t[n];if(!o)return;const l=n===e;s.setAttribute("aria-selected",l?"true":"false"),s.setAttribute("aria-controls",o.panelId),s.setAttribute("aria-disabled",o.disabled?"true":"false"),o.disabled?s.setAttribute("disabled",""):s.removeAttribute("disabled")}),u.syncRovingTabStops(a,a[i]||null,{activeAttribute:null});const r=t[e];this._syncIndicator(e),r?(this.setAttribute("aria-activedescendant",r.tabId),this.setAttribute("aria-controls",r.panelId),this._scrollSelectedTabIntoView(e)):(this.removeAttribute("aria-activedescendant"),this.removeAttribute("aria-controls")),this._syncPanels(t,e)}_syncIndicator(t){const e=this.root.querySelector(".nav");if(!e)return;const i=this.getAttribute("variant")||"default",a=i==="indicator";if(!a&&!(i==="indicator-line")){e.removeAttribute("data-indicator-ready"),e.style.removeProperty("--ui-tabs-indicator-x"),e.style.removeProperty("--ui-tabs-indicator-y"),e.style.removeProperty("--ui-tabs-indicator-w"),e.style.removeProperty("--ui-tabs-indicator-h");return}const s=this.root.querySelector(`.tab[data-index="${t}"]`);if(!s){e.removeAttribute("data-indicator-ready");return}const n=this.getAttribute("orientation")==="vertical"?"vertical":"horizontal",o=getComputedStyle(this).direction==="rtl";let l=s.offsetLeft,d=s.offsetTop,c=s.offsetWidth,b=s.offsetHeight;a?(l+=2,d+=2,c=Math.max(0,c-4),b=Math.max(0,b-4)):n==="vertical"?(d+=5,b=Math.max(8,b-10),c=3,l+=o?s.offsetWidth-3-2:2):(l+=8,c=Math.max(12,c-16),b=2,d+=s.offsetHeight-2-2),e.style.setProperty("--ui-tabs-indicator-x",`${l}px`),e.style.setProperty("--ui-tabs-indicator-y",`${d}px`),e.style.setProperty("--ui-tabs-indicator-w",`${c}px`),e.style.setProperty("--ui-tabs-indicator-h",`${b}px`),e.setAttribute("data-indicator-ready","true")}_syncPanels(t,e){const i=this._sourcePanels(),a=this.root.querySelector(".panel-wrap");a&&(i.length?a.removeAttribute("hidden"):a.setAttribute("hidden","")),this._isSyncing=!0;try{i.forEach((r,s)=>{const n=t[s],o=s===e;r.id=n?.panelId||`${this._uid}-panel-${s}`,r.setAttribute("role","tabpanel"),r.setAttribute("tabindex",o?"0":"-1"),r.setAttribute("aria-hidden",o?"false":"true"),n&&r.setAttribute("aria-labelledby",n.tabId),o?r.removeAttribute("hidden"):r.setAttribute("hidden","")})}finally{this._isSyncing=!1}}_enabledIndices(t){return t.filter(e=>!e.disabled).map(e=>e.index)}_resolveFocusIndex(t,e){const i=u.resolveRovingFocusIndex(t,{activeIndex:this._focusIndex,selectedIndex:e,getDisabled:a=>a.disabled});return this._focusIndex=i,i}_onWindowResize(){this._syncSelectionUi()}_focusTab(t){this._focusIndex=t;const e=this.root.querySelector(`.tab[data-index="${t}"]`),i=Array.from(this.root.querySelectorAll(".tab"));u.syncRovingTabStops(i,e,{activeAttribute:null}),u.focusRovingItem(e)}_scrollSelectedTabIntoView(t){const e=this.root.querySelector(".nav"),i=this.root.querySelector(`.tab[data-index="${t}"]`);if(!e||!i)return;const a=this.getAttribute("orientation")!=="vertical",r=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;typeof i.scrollIntoView=="function"&&i.scrollIntoView({behavior:r?"auto":"smooth",block:"nearest",inline:a?"center":"nearest"})}_onClick(t){const i=t.target?.closest(".tab");if(!i||i.disabled)return;const a=Number(i.getAttribute("data-index"));if(!Number.isFinite(a))return;const r=this._tabsModel();this._setSelectedByIndex(r,a,!0)}_onKeyDown(t){const i=t.target?.closest(".tab");if(!i)return;const a=this._tabsModel();if(!a.length)return;const r=this.getAttribute("orientation")==="vertical"?"vertical":"horizontal",s=this.getAttribute("activation")==="manual"?"manual":"auto",n=!this.hasAttribute("loop")||f(this.getAttribute("loop")),o=getComputedStyle(this).direction==="rtl",l=Number(i.getAttribute("data-index"));if(!Number.isFinite(l))return;const d=c=>{const b=u.moveRovingFocusIndex(a,l,c,{wrap:n,fallbackIndex:this._resolveFocusIndex(a,this._resolveSelectedIndex(a)),getDisabled:h=>h.disabled});b!=null&&(this._focusTab(b),s==="auto"?this._setSelectedByIndex(a,b,!0):this._emit("focus",a,b))};if(r==="horizontal"&&(t.key==="ArrowRight"&&!o||t.key==="ArrowLeft"&&o)||r==="vertical"&&t.key==="ArrowDown"){t.preventDefault(),d(1);return}if(r==="horizontal"&&(t.key==="ArrowLeft"&&!o||t.key==="ArrowRight"&&o)||r==="vertical"&&t.key==="ArrowUp"){t.preventDefault(),d(-1);return}if(t.key==="Home"){t.preventDefault();const c=u.getRovingFocusBoundaryIndex(a,"first",b=>b.disabled);if(c<0)return;this._focusTab(c),s==="auto"?this._setSelectedByIndex(a,c,!0):this._emit("focus",a,c);return}if(t.key==="End"){t.preventDefault();const c=u.getRovingFocusBoundaryIndex(a,"last",b=>b.disabled);if(c<0)return;this._focusTab(c),s==="auto"?this._setSelectedByIndex(a,c,!0):this._emit("focus",a,c);return}(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this._setSelectedByIndex(a,l,!0))}render(){const t=this._tabsModel(),e=this._resolveSelectedIndex(t),i=this._resolveFocusIndex(t,e);this._syncSelectedAttributes(t,e);const a=this.getAttribute("orientation")==="vertical"?"vertical":"horizontal",r=t.map(n=>{const o=n.index===e,l=n.icon?`<span class="tab-icon" aria-hidden="true">${p(n.icon)}</span>`:"";return`
486
+ `,f="data-ui-tabs-auto-label";function p(h){return String(h).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function g(h){if(h==null)return!1;const t=String(h).toLowerCase();return t!=="false"&&t!=="0"&&t!=="off"}const w=new Set(["aria-label","aria-labelledby","orientation","activation","headless","variant","size","density","tone","stretched","shape","elevation","bare"]);class x extends y.ElementBase{constructor(){super(),this._uid=`ui-tabs-${Math.random().toString(36).slice(2,9)}`,this._observer=null,this._resizeObserver=null,this._isSyncing=!1,this._isSyncingSelectionAttributes=!1,this._focusIndex=-1,this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onWindowResize=this._onWindowResize.bind(this)}static get observedAttributes(){return["selected","value","orientation","activation","headless","variant","size","density","tone","stretched","shape","elevation","loop","bare","aria-label","aria-labelledby"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onClick),this.root.addEventListener("keydown",this._onKeyDown),this._observer=new MutationObserver(()=>{this._isSyncing||this.requestRender()}),this._observer.observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["slot","data-label","data-value","data-icon","data-disabled","disabled","data-active"]}),typeof ResizeObserver<"u"?(this._resizeObserver=new ResizeObserver(()=>this._syncSelectionUi()),this._resizeObserver.observe(this)):window.addEventListener("resize",this._onWindowResize),this._syncSelectionUi()}disconnectedCallback(){this.root.removeEventListener("click",this._onClick),this.root.removeEventListener("keydown",this._onKeyDown),this._observer&&(this._observer.disconnect(),this._observer=null),this._resizeObserver?(this._resizeObserver.disconnect(),this._resizeObserver=null):window.removeEventListener("resize",this._onWindowResize),super.disconnectedCallback()}attributeChangedCallback(t,e,r){if(e!==r){if(t==="selected"||t==="value"){this._isSyncingSelectionAttributes||this._syncSelectionUi();return}w.has(t)&&this.isConnected&&this.requestRender()}}get selected(){return this.getAttribute("selected")||"0"}set selected(t){const e=String(t);e?this.setAttribute("selected",e):this.removeAttribute("selected")}_sourceTabs(){return Array.from(this.querySelectorAll('[slot="tab"]'))}_sourcePanels(){return Array.from(this.querySelectorAll('[slot="panel"]'))}_tabsModel(){return this._sourceTabs().map((t,e)=>{const r=t.getAttribute("data-value")||t.getAttribute("value")||String(e),a=t.getAttribute("data-label")||t.textContent?.trim()||`Tab ${e+1}`,i=t.getAttribute("data-icon")||"",s=t.hasAttribute("disabled")||g(t.getAttribute("data-disabled")),c=`${this._uid}-tab-${e}`,b=`${this._uid}-panel-${e}`;return{index:e,value:r,label:a,icon:i,disabled:s,tabId:c,panelId:b}})}_resolveSelectedIndex(t){if(!t.length)return-1;const e=this.getAttribute("selected"),r=this.getAttribute("value"),a=this._sourceTabs();let i=-1;if(e!=null&&e!==""){const s=Number(e);Number.isFinite(s)?i=Math.trunc(s):i=t.findIndex(c=>c.value===e)}return i<0&&r&&(i=t.findIndex(s=>s.value===r)),i<0&&(i=t.findIndex((s,c)=>!!a[c]?.hasAttribute("data-active")&&!s.disabled)),(i<0||!t[i]||t[i].disabled)&&(i=t.findIndex(s=>!s.disabled)),i}_syncSelectedAttributes(t,e){const r=t[e];this._isSyncingSelectionAttributes=!0;try{if(!r){this.removeAttribute("selected"),this.removeAttribute("value");return}this.getAttribute("selected")!==String(e)&&this.setAttribute("selected",String(e)),this.getAttribute("value")!==r.value&&this.setAttribute("value",r.value)}finally{this._isSyncingSelectionAttributes=!1}}_emit(t,e,r){const a=e[r];if(!a)return;const i={selected:r,index:r,value:a.value,label:a.label,tabId:a.tabId,panelId:a.panelId};this.dispatchEvent(new CustomEvent(t,{detail:i,bubbles:!0,composed:!0}))}_setSelectedByIndex(t,e,r){const a=t[e];if(!a||a.disabled)return;if(this._resolveSelectedIndex(t)===e){this._focusTab(e);return}this._focusIndex=e,this.setAttribute("selected",String(e)),this.setAttribute("value",a.value),r&&(this._emit("change",t,e),this._emit("select",t,e))}_syncSelectionUi(){if(!this.isConnected)return;if(!this.root.querySelector(".nav")){this.requestRender();return}const t=this._tabsModel();if(!t.length)return;const e=this._resolveSelectedIndex(t),r=this._resolveFocusIndex(t,e);this._syncSelectedAttributes(t,e);const a=Array.from(this.root.querySelectorAll(".tab"));a.forEach((s,c)=>{const b=t[c];if(!b)return;const o=c===e;s.setAttribute("aria-selected",o?"true":"false"),s.setAttribute("aria-disabled",b.disabled?"true":"false"),b.disabled?s.setAttribute("disabled",""):s.removeAttribute("disabled")}),d.syncRovingTabStops(a,a[r]||null,{activeAttribute:null});const i=t[e];this._syncIndicator(e),this._clearCrossRootReferences(),i&&this._scrollSelectedTabIntoView(e),this._syncPanels(t,e)}_syncIndicator(t){const e=this.root.querySelector(".nav");if(!e)return;const r=this.getAttribute("variant")||"default",a=r==="indicator";if(!a&&!(r==="indicator-line")){e.removeAttribute("data-indicator-ready"),e.style.removeProperty("--ui-tabs-indicator-x"),e.style.removeProperty("--ui-tabs-indicator-y"),e.style.removeProperty("--ui-tabs-indicator-w"),e.style.removeProperty("--ui-tabs-indicator-h");return}const s=this.root.querySelector(`.tab[data-index="${t}"]`);if(!s){e.removeAttribute("data-indicator-ready");return}const c=this.getAttribute("orientation")==="vertical"?"vertical":"horizontal",b=getComputedStyle(this).direction==="rtl";let o=s.offsetLeft,u=s.offsetTop,n=s.offsetWidth,l=s.offsetHeight;a?(o+=2,u+=2,n=Math.max(0,n-4),l=Math.max(0,l-4)):c==="vertical"?(u+=5,l=Math.max(8,l-10),n=3,o+=b?s.offsetWidth-3-2:2):(o+=8,n=Math.max(12,n-16),l=2,u+=s.offsetHeight-2-2),e.style.setProperty("--ui-tabs-indicator-x",`${o}px`),e.style.setProperty("--ui-tabs-indicator-y",`${u}px`),e.style.setProperty("--ui-tabs-indicator-w",`${n}px`),e.style.setProperty("--ui-tabs-indicator-h",`${l}px`),e.setAttribute("data-indicator-ready","true")}_clearCrossRootReferences(){this.removeAttribute("aria-activedescendant"),this.removeAttribute("aria-controls")}_syncPanels(t,e){const r=this._sourcePanels(),a=this.root.querySelector(".panel-wrap");a&&(r.length?a.removeAttribute("hidden"):a.setAttribute("hidden","")),this._isSyncing=!0;try{r.forEach((i,s)=>{const c=t[s],b=s===e;i.id=c?.panelId||`${this._uid}-panel-${s}`,i.setAttribute("role","tabpanel"),i.setAttribute("tabindex",b?"0":"-1"),i.setAttribute("aria-hidden",b?"false":"true"),c&&(i.getAttribute("aria-labelledby")===c.tabId&&i.removeAttribute("aria-labelledby"),i.hasAttribute("aria-labelledby")||i.hasAttribute("aria-label")&&!i.hasAttribute(f)||(i.setAttribute("aria-label",c.label),i.setAttribute(f,""))),b?i.removeAttribute("hidden"):i.setAttribute("hidden","")})}finally{this._isSyncing=!1}}_enabledIndices(t){return t.filter(e=>!e.disabled).map(e=>e.index)}_resolveFocusIndex(t,e){const r=d.resolveRovingFocusIndex(t,{activeIndex:this._focusIndex,selectedIndex:e,getDisabled:a=>a.disabled});return this._focusIndex=r,r}_onWindowResize(){this._syncSelectionUi()}_focusTab(t){this._focusIndex=t;const e=this.root.querySelector(`.tab[data-index="${t}"]`),r=Array.from(this.root.querySelectorAll(".tab"));d.syncRovingTabStops(r,e,{activeAttribute:null}),d.focusRovingItem(e)}_scrollSelectedTabIntoView(t){const e=this.root.querySelector(".nav"),r=this.root.querySelector(`.tab[data-index="${t}"]`);if(!e||!r)return;const a=this.getAttribute("orientation")!=="vertical",i=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;typeof r.scrollIntoView=="function"&&r.scrollIntoView({behavior:i?"auto":"smooth",block:"nearest",inline:a?"center":"nearest"})}_onClick(t){const r=t.target?.closest(".tab");if(!r||r.disabled)return;const a=Number(r.getAttribute("data-index"));if(!Number.isFinite(a))return;const i=this._tabsModel();this._setSelectedByIndex(i,a,!0)}_onKeyDown(t){const r=t.target?.closest(".tab");if(!r)return;const a=this._tabsModel();if(!a.length)return;const i=this.getAttribute("orientation")==="vertical"?"vertical":"horizontal",s=this.getAttribute("activation")==="manual"?"manual":"auto",c=!this.hasAttribute("loop")||g(this.getAttribute("loop")),b=getComputedStyle(this).direction==="rtl",o=Number(r.getAttribute("data-index"));if(!Number.isFinite(o))return;const u=n=>{const l=d.moveRovingFocusIndex(a,o,n,{wrap:c,fallbackIndex:this._resolveFocusIndex(a,this._resolveSelectedIndex(a)),getDisabled:v=>v.disabled});l!=null&&(this._focusTab(l),s==="auto"?this._setSelectedByIndex(a,l,!0):this._emit("focus",a,l))};if(i==="horizontal"&&(t.key==="ArrowRight"&&!b||t.key==="ArrowLeft"&&b)||i==="vertical"&&t.key==="ArrowDown"){t.preventDefault(),u(1);return}if(i==="horizontal"&&(t.key==="ArrowLeft"&&!b||t.key==="ArrowRight"&&b)||i==="vertical"&&t.key==="ArrowUp"){t.preventDefault(),u(-1);return}if(t.key==="Home"){t.preventDefault();const n=d.getRovingFocusBoundaryIndex(a,"first",l=>l.disabled);if(n<0)return;this._focusTab(n),s==="auto"?this._setSelectedByIndex(a,n,!0):this._emit("focus",a,n);return}if(t.key==="End"){t.preventDefault();const n=d.getRovingFocusBoundaryIndex(a,"last",l=>l.disabled);if(n<0)return;this._focusTab(n),s==="auto"?this._setSelectedByIndex(a,n,!0):this._emit("focus",a,n);return}(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this._setSelectedByIndex(a,o,!0))}render(){const t=this._tabsModel(),e=this._resolveSelectedIndex(t),r=this._resolveFocusIndex(t,e);this._syncSelectedAttributes(t,e);const a=this.getAttribute("orientation")==="vertical"?"vertical":"horizontal",i=(this.getAttribute("aria-label")||"").trim(),s=(this.getAttribute("aria-labelledby")||"").trim(),c=(i?` aria-label="${p(i)}"`:"")+(s?` aria-labelledby="${p(s)}"`:""),b=t.map(o=>{const u=o.index===e,n=o.icon?`<span class="tab-icon" aria-hidden="true">${p(o.icon)}</span>`:"";return`
487
487
  <button
488
488
  type="button"
489
489
  class="tab"
490
490
  part="tab"
491
- id="${n.tabId}"
491
+ id="${o.tabId}"
492
492
  role="tab"
493
- data-index="${n.index}"
494
- aria-selected="${o?"true":"false"}"
495
- aria-controls="${n.panelId}"
496
- aria-disabled="${n.disabled?"true":"false"}"
497
- tabindex="${n.index===i&&!n.disabled?"0":"-1"}"
498
- ${n.disabled?"disabled":""}
493
+ data-index="${o.index}"
494
+ aria-selected="${u?"true":"false"}"
495
+ aria-disabled="${o.disabled?"true":"false"}"
496
+ tabindex="${o.index===r&&!o.disabled?"0":"-1"}"
497
+ ${o.disabled?"disabled":""}
499
498
  >
500
- ${l}
501
- <span class="tab-label">${p(n.label)}</span>
499
+ ${n}
500
+ <span class="tab-label">${p(o.label)}</span>
502
501
  </button>
503
502
  `}).join("");this.setContent(`
504
- <style>${y}</style>
503
+ <style>${_}</style>
505
504
  <section class="shell" part="shell">
506
- <div class="nav" role="tablist" aria-orientation="${a}" part="nav">
505
+ <div class="nav" role="tablist" aria-orientation="${a}"${c} part="nav">
507
506
  <span class="indicator" part="indicator" aria-hidden="true"></span>
508
- ${r}
507
+ ${b}
509
508
  </div>
510
509
  <div class="panel-wrap" part="panel-wrap" aria-live="polite">
511
510
  <slot name="panel"></slot>
512
511
  </div>
513
512
  </section>
514
513
  <slot class="source-tabs" name="tab"></slot>
515
- `);const s=t[e];s?(this.setAttribute("aria-activedescendant",s.tabId),this.setAttribute("aria-controls",s.panelId)):(this.removeAttribute("aria-activedescendant"),this.removeAttribute("aria-controls")),this._syncIndicator(e),this._syncPanels(t,e)}}typeof customElements<"u"&&!customElements.get("ui-tabs")&&customElements.define("ui-tabs",g);exports.UITabs=g;
514
+ `),this._clearCrossRootReferences(),this._syncIndicator(e),this._syncPanels(t,e)}}typeof customElements<"u"&&!customElements.get("ui-tabs")&&customElements.define("ui-tabs",x);exports.UITabs=x;
package/dist/tabs.esm.js CHANGED
@@ -1,12 +1,12 @@
1
- import { E as m } from "./ElementBase-YlTLMsGk.mjs";
2
- import { s as v, r as y, f as _, g as p, m as w } from "./roving-focus-group-Dbm1Jko_.mjs";
3
- const A = `
1
+ import { E as y } from "./ElementBase-YlTLMsGk.mjs";
2
+ import { s as p, r as _, f as w, g as f, m as A } from "./roving-focus-group-Dbm1Jko_.mjs";
3
+ const k = `
4
4
  :host {
5
5
  --ui-tabs-nav-bg: var(--ui-color-surface, #ffffff);
6
6
  --ui-tabs-panel-bg: var(--ui-color-surface, #ffffff);
7
7
  --ui-tabs-border: var(--ui-color-border, #cbd5e1);
8
8
  --ui-tabs-text: var(--ui-color-text, #0f172a);
9
- --ui-tabs-muted: var(--ui-color-muted, #64748b);
9
+ --ui-tabs-muted: var(--ui-color-muted, #526175);
10
10
  --ui-tabs-accent: var(--ui-tabs-active-bg, var(--ui-color-primary, #2563eb));
11
11
  --ui-tabs-active-text: color-mix(in srgb, var(--ui-tabs-accent) 82%, #0f172a 18%);
12
12
  --ui-tabs-focus: var(--ui-color-focus-ring, #2563eb);
@@ -300,18 +300,18 @@ const A = `
300
300
  --ui-tabs-nav-bg: var(--ui-tabs-accent);
301
301
  --ui-tabs-panel-bg: var(--ui-color-surface, #ffffff);
302
302
  --ui-tabs-border: color-mix(in srgb, var(--ui-tabs-accent) 76%, #0f172a 24%);
303
- --ui-tabs-muted: color-mix(in srgb, var(--ui-color-primary-foreground, #ffffff) 80%, transparent);
303
+ --ui-tabs-muted: color-mix(in srgb, var(--ui-color-primary-foreground, var(--ui-color-foreground-on-primary, #ffffff)) 94%, transparent);
304
304
  --ui-tabs-active-text: color-mix(in srgb, var(--ui-tabs-accent) 78%, #0f172a 22%);
305
- --ui-tabs-focus: color-mix(in srgb, var(--ui-color-primary-foreground, #ffffff) 72%, var(--ui-tabs-accent));
305
+ --ui-tabs-focus: color-mix(in srgb, var(--ui-color-primary-foreground, var(--ui-color-foreground-on-primary, #ffffff)) 72%, var(--ui-tabs-accent));
306
306
  }
307
307
 
308
308
  :host([variant="solid"]) .tab:hover {
309
- background: color-mix(in srgb, var(--ui-color-primary-foreground, #ffffff) 14%, transparent);
310
- color: var(--ui-color-primary-foreground, #ffffff);
309
+ background: color-mix(in srgb, var(--ui-color-primary-foreground, var(--ui-color-foreground-on-primary, #ffffff)) 14%, transparent);
310
+ color: var(--ui-color-primary-foreground, var(--ui-color-foreground-on-primary, #ffffff));
311
311
  }
312
312
 
313
313
  :host([variant="solid"]) .tab[aria-selected="true"] {
314
- background: var(--ui-color-primary-foreground, #ffffff);
314
+ background: var(--ui-color-primary-foreground, var(--ui-color-foreground-on-primary, #ffffff));
315
315
  border-color: color-mix(in srgb, var(--ui-tabs-accent) 44%, var(--ui-tabs-border));
316
316
  color: var(--ui-tabs-active-text);
317
317
  }
@@ -435,11 +435,11 @@ const A = `
435
435
  }
436
436
 
437
437
  :host([tone="success"]) {
438
- --ui-tabs-accent: var(--ui-color-success, #16a34a);
438
+ --ui-tabs-accent: var(--ui-color-success, #15803d);
439
439
  }
440
440
 
441
441
  :host([tone="warning"]) {
442
- --ui-tabs-accent: var(--ui-color-warning, #d97706);
442
+ --ui-tabs-accent: var(--ui-color-warning, #b45309);
443
443
  }
444
444
 
445
445
  :host([tone="danger"]) {
@@ -485,16 +485,18 @@ const A = `
485
485
  border-color: Highlight;
486
486
  }
487
487
  }
488
- `;
489
- function f(u) {
490
- return String(u).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
488
+ `, g = "data-ui-tabs-auto-label";
489
+ function v(d) {
490
+ return String(d).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
491
491
  }
492
- function g(u) {
493
- if (u == null) return !1;
494
- const t = String(u).toLowerCase();
492
+ function x(d) {
493
+ if (d == null) return !1;
494
+ const t = String(d).toLowerCase();
495
495
  return t !== "false" && t !== "0" && t !== "off";
496
496
  }
497
- const k = /* @__PURE__ */ new Set([
497
+ const S = /* @__PURE__ */ new Set([
498
+ "aria-label",
499
+ "aria-labelledby",
498
500
  "orientation",
499
501
  "activation",
500
502
  "headless",
@@ -507,7 +509,7 @@ const k = /* @__PURE__ */ new Set([
507
509
  "elevation",
508
510
  "bare"
509
511
  ]);
510
- class S extends m {
512
+ class I extends y {
511
513
  constructor() {
512
514
  super(), this._uid = `ui-tabs-${Math.random().toString(36).slice(2, 9)}`, this._observer = null, this._resizeObserver = null, this._isSyncing = !1, this._isSyncingSelectionAttributes = !1, this._focusIndex = -1, this._onClick = this._onClick.bind(this), this._onKeyDown = this._onKeyDown.bind(this), this._onWindowResize = this._onWindowResize.bind(this);
513
515
  }
@@ -526,7 +528,9 @@ class S extends m {
526
528
  "shape",
527
529
  "elevation",
528
530
  "loop",
529
- "bare"
531
+ "bare",
532
+ "aria-label",
533
+ "aria-labelledby"
530
534
  ];
531
535
  }
532
536
  connectedCallback() {
@@ -543,13 +547,13 @@ class S extends m {
543
547
  disconnectedCallback() {
544
548
  this.root.removeEventListener("click", this._onClick), this.root.removeEventListener("keydown", this._onKeyDown), this._observer && (this._observer.disconnect(), this._observer = null), this._resizeObserver ? (this._resizeObserver.disconnect(), this._resizeObserver = null) : window.removeEventListener("resize", this._onWindowResize), super.disconnectedCallback();
545
549
  }
546
- attributeChangedCallback(t, e, i) {
547
- if (e !== i) {
550
+ attributeChangedCallback(t, e, r) {
551
+ if (e !== r) {
548
552
  if (t === "selected" || t === "value") {
549
553
  this._isSyncingSelectionAttributes || this._syncSelectionUi();
550
554
  return;
551
555
  }
552
- k.has(t) && this.isConnected && this.requestRender();
556
+ S.has(t) && this.isConnected && this.requestRender();
553
557
  }
554
558
  }
555
559
  get selected() {
@@ -567,54 +571,54 @@ class S extends m {
567
571
  }
568
572
  _tabsModel() {
569
573
  return this._sourceTabs().map((t, e) => {
570
- const i = t.getAttribute("data-value") || t.getAttribute("value") || String(e), a = t.getAttribute("data-label") || t.textContent?.trim() || `Tab ${e + 1}`, r = t.getAttribute("data-icon") || "", s = t.hasAttribute("disabled") || g(t.getAttribute("data-disabled")), n = `${this._uid}-tab-${e}`, o = `${this._uid}-panel-${e}`;
571
- return { index: e, value: i, label: a, icon: r, disabled: s, tabId: n, panelId: o };
574
+ const r = t.getAttribute("data-value") || t.getAttribute("value") || String(e), a = t.getAttribute("data-label") || t.textContent?.trim() || `Tab ${e + 1}`, i = t.getAttribute("data-icon") || "", s = t.hasAttribute("disabled") || x(t.getAttribute("data-disabled")), b = `${this._uid}-tab-${e}`, c = `${this._uid}-panel-${e}`;
575
+ return { index: e, value: r, label: a, icon: i, disabled: s, tabId: b, panelId: c };
572
576
  });
573
577
  }
574
578
  _resolveSelectedIndex(t) {
575
579
  if (!t.length) return -1;
576
- const e = this.getAttribute("selected"), i = this.getAttribute("value"), a = this._sourceTabs();
577
- let r = -1;
580
+ const e = this.getAttribute("selected"), r = this.getAttribute("value"), a = this._sourceTabs();
581
+ let i = -1;
578
582
  if (e != null && e !== "") {
579
583
  const s = Number(e);
580
- Number.isFinite(s) ? r = Math.trunc(s) : r = t.findIndex((n) => n.value === e);
584
+ Number.isFinite(s) ? i = Math.trunc(s) : i = t.findIndex((b) => b.value === e);
581
585
  }
582
- return r < 0 && i && (r = t.findIndex((s) => s.value === i)), r < 0 && (r = t.findIndex((s, n) => !!a[n]?.hasAttribute("data-active") && !s.disabled)), (r < 0 || !t[r] || t[r].disabled) && (r = t.findIndex((s) => !s.disabled)), r;
586
+ return i < 0 && r && (i = t.findIndex((s) => s.value === r)), i < 0 && (i = t.findIndex((s, b) => !!a[b]?.hasAttribute("data-active") && !s.disabled)), (i < 0 || !t[i] || t[i].disabled) && (i = t.findIndex((s) => !s.disabled)), i;
583
587
  }
584
588
  _syncSelectedAttributes(t, e) {
585
- const i = t[e];
589
+ const r = t[e];
586
590
  this._isSyncingSelectionAttributes = !0;
587
591
  try {
588
- if (!i) {
592
+ if (!r) {
589
593
  this.removeAttribute("selected"), this.removeAttribute("value");
590
594
  return;
591
595
  }
592
- this.getAttribute("selected") !== String(e) && this.setAttribute("selected", String(e)), this.getAttribute("value") !== i.value && this.setAttribute("value", i.value);
596
+ this.getAttribute("selected") !== String(e) && this.setAttribute("selected", String(e)), this.getAttribute("value") !== r.value && this.setAttribute("value", r.value);
593
597
  } finally {
594
598
  this._isSyncingSelectionAttributes = !1;
595
599
  }
596
600
  }
597
- _emit(t, e, i) {
598
- const a = e[i];
601
+ _emit(t, e, r) {
602
+ const a = e[r];
599
603
  if (!a) return;
600
- const r = {
601
- selected: i,
602
- index: i,
604
+ const i = {
605
+ selected: r,
606
+ index: r,
603
607
  value: a.value,
604
608
  label: a.label,
605
609
  tabId: a.tabId,
606
610
  panelId: a.panelId
607
611
  };
608
- this.dispatchEvent(new CustomEvent(t, { detail: r, bubbles: !0, composed: !0 }));
612
+ this.dispatchEvent(new CustomEvent(t, { detail: i, bubbles: !0, composed: !0 }));
609
613
  }
610
- _setSelectedByIndex(t, e, i) {
614
+ _setSelectedByIndex(t, e, r) {
611
615
  const a = t[e];
612
616
  if (!a || a.disabled) return;
613
617
  if (this._resolveSelectedIndex(t) === e) {
614
618
  this._focusTab(e);
615
619
  return;
616
620
  }
617
- this._focusIndex = e, this.setAttribute("selected", String(e)), this.setAttribute("value", a.value), i && (this._emit("change", t, e), this._emit("select", t, e));
621
+ this._focusIndex = e, this.setAttribute("selected", String(e)), this.setAttribute("value", a.value), r && (this._emit("change", t, e), this._emit("select", t, e));
618
622
  }
619
623
  _syncSelectionUi() {
620
624
  if (!this.isConnected) return;
@@ -624,23 +628,23 @@ class S extends m {
624
628
  }
625
629
  const t = this._tabsModel();
626
630
  if (!t.length) return;
627
- const e = this._resolveSelectedIndex(t), i = this._resolveFocusIndex(t, e);
631
+ const e = this._resolveSelectedIndex(t), r = this._resolveFocusIndex(t, e);
628
632
  this._syncSelectedAttributes(t, e);
629
633
  const a = Array.from(this.root.querySelectorAll(".tab"));
630
- a.forEach((s, n) => {
631
- const o = t[n];
632
- if (!o) return;
633
- const l = n === e;
634
- s.setAttribute("aria-selected", l ? "true" : "false"), s.setAttribute("aria-controls", o.panelId), s.setAttribute("aria-disabled", o.disabled ? "true" : "false"), o.disabled ? s.setAttribute("disabled", "") : s.removeAttribute("disabled");
635
- }), v(a, a[i] || null, { activeAttribute: null });
636
- const r = t[e];
637
- this._syncIndicator(e), r ? (this.setAttribute("aria-activedescendant", r.tabId), this.setAttribute("aria-controls", r.panelId), this._scrollSelectedTabIntoView(e)) : (this.removeAttribute("aria-activedescendant"), this.removeAttribute("aria-controls")), this._syncPanels(t, e);
634
+ a.forEach((s, b) => {
635
+ const c = t[b];
636
+ if (!c) return;
637
+ const o = b === e;
638
+ s.setAttribute("aria-selected", o ? "true" : "false"), s.setAttribute("aria-disabled", c.disabled ? "true" : "false"), c.disabled ? s.setAttribute("disabled", "") : s.removeAttribute("disabled");
639
+ }), p(a, a[r] || null, { activeAttribute: null });
640
+ const i = t[e];
641
+ this._syncIndicator(e), this._clearCrossRootReferences(), i && this._scrollSelectedTabIntoView(e), this._syncPanels(t, e);
638
642
  }
639
643
  _syncIndicator(t) {
640
644
  const e = this.root.querySelector(".nav");
641
645
  if (!e) return;
642
- const i = this.getAttribute("variant") || "default", a = i === "indicator";
643
- if (!a && !(i === "indicator-line")) {
646
+ const r = this.getAttribute("variant") || "default", a = r === "indicator";
647
+ if (!a && !(r === "indicator-line")) {
644
648
  e.removeAttribute("data-indicator-ready"), e.style.removeProperty("--ui-tabs-indicator-x"), e.style.removeProperty("--ui-tabs-indicator-y"), e.style.removeProperty("--ui-tabs-indicator-w"), e.style.removeProperty("--ui-tabs-indicator-h");
645
649
  return;
646
650
  }
@@ -649,17 +653,20 @@ class S extends m {
649
653
  e.removeAttribute("data-indicator-ready");
650
654
  return;
651
655
  }
652
- const n = this.getAttribute("orientation") === "vertical" ? "vertical" : "horizontal", o = getComputedStyle(this).direction === "rtl";
653
- let l = s.offsetLeft, d = s.offsetTop, c = s.offsetWidth, b = s.offsetHeight;
654
- a ? (l += 2, d += 2, c = Math.max(0, c - 4), b = Math.max(0, b - 4)) : n === "vertical" ? (d += 5, b = Math.max(8, b - 10), c = 3, l += o ? s.offsetWidth - 3 - 2 : 2) : (l += 8, c = Math.max(12, c - 16), b = 2, d += s.offsetHeight - 2 - 2), e.style.setProperty("--ui-tabs-indicator-x", `${l}px`), e.style.setProperty("--ui-tabs-indicator-y", `${d}px`), e.style.setProperty("--ui-tabs-indicator-w", `${c}px`), e.style.setProperty("--ui-tabs-indicator-h", `${b}px`), e.setAttribute("data-indicator-ready", "true");
656
+ const b = this.getAttribute("orientation") === "vertical" ? "vertical" : "horizontal", c = getComputedStyle(this).direction === "rtl";
657
+ let o = s.offsetLeft, u = s.offsetTop, n = s.offsetWidth, l = s.offsetHeight;
658
+ a ? (o += 2, u += 2, n = Math.max(0, n - 4), l = Math.max(0, l - 4)) : b === "vertical" ? (u += 5, l = Math.max(8, l - 10), n = 3, o += c ? s.offsetWidth - 3 - 2 : 2) : (o += 8, n = Math.max(12, n - 16), l = 2, u += s.offsetHeight - 2 - 2), e.style.setProperty("--ui-tabs-indicator-x", `${o}px`), e.style.setProperty("--ui-tabs-indicator-y", `${u}px`), e.style.setProperty("--ui-tabs-indicator-w", `${n}px`), e.style.setProperty("--ui-tabs-indicator-h", `${l}px`), e.setAttribute("data-indicator-ready", "true");
659
+ }
660
+ _clearCrossRootReferences() {
661
+ this.removeAttribute("aria-activedescendant"), this.removeAttribute("aria-controls");
655
662
  }
656
663
  _syncPanels(t, e) {
657
- const i = this._sourcePanels(), a = this.root.querySelector(".panel-wrap");
658
- a && (i.length ? a.removeAttribute("hidden") : a.setAttribute("hidden", "")), this._isSyncing = !0;
664
+ const r = this._sourcePanels(), a = this.root.querySelector(".panel-wrap");
665
+ a && (r.length ? a.removeAttribute("hidden") : a.setAttribute("hidden", "")), this._isSyncing = !0;
659
666
  try {
660
- i.forEach((r, s) => {
661
- const n = t[s], o = s === e;
662
- r.id = n?.panelId || `${this._uid}-panel-${s}`, r.setAttribute("role", "tabpanel"), r.setAttribute("tabindex", o ? "0" : "-1"), r.setAttribute("aria-hidden", o ? "false" : "true"), n && r.setAttribute("aria-labelledby", n.tabId), o ? r.removeAttribute("hidden") : r.setAttribute("hidden", "");
667
+ r.forEach((i, s) => {
668
+ const b = t[s], c = s === e;
669
+ i.id = b?.panelId || `${this._uid}-panel-${s}`, i.setAttribute("role", "tabpanel"), i.setAttribute("tabindex", c ? "0" : "-1"), i.setAttribute("aria-hidden", c ? "false" : "true"), b && (i.getAttribute("aria-labelledby") === b.tabId && i.removeAttribute("aria-labelledby"), i.hasAttribute("aria-labelledby") || i.hasAttribute("aria-label") && !i.hasAttribute(g) || (i.setAttribute("aria-label", b.label), i.setAttribute(g, ""))), c ? i.removeAttribute("hidden") : i.setAttribute("hidden", "");
663
670
  });
664
671
  } finally {
665
672
  this._isSyncing = !1;
@@ -669,120 +676,117 @@ class S extends m {
669
676
  return t.filter((e) => !e.disabled).map((e) => e.index);
670
677
  }
671
678
  _resolveFocusIndex(t, e) {
672
- const i = y(t, {
679
+ const r = _(t, {
673
680
  activeIndex: this._focusIndex,
674
681
  selectedIndex: e,
675
682
  getDisabled: (a) => a.disabled
676
683
  });
677
- return this._focusIndex = i, i;
684
+ return this._focusIndex = r, r;
678
685
  }
679
686
  _onWindowResize() {
680
687
  this._syncSelectionUi();
681
688
  }
682
689
  _focusTab(t) {
683
690
  this._focusIndex = t;
684
- const e = this.root.querySelector(`.tab[data-index="${t}"]`), i = Array.from(this.root.querySelectorAll(".tab"));
685
- v(i, e, { activeAttribute: null }), _(e);
691
+ const e = this.root.querySelector(`.tab[data-index="${t}"]`), r = Array.from(this.root.querySelectorAll(".tab"));
692
+ p(r, e, { activeAttribute: null }), w(e);
686
693
  }
687
694
  _scrollSelectedTabIntoView(t) {
688
- const e = this.root.querySelector(".nav"), i = this.root.querySelector(`.tab[data-index="${t}"]`);
689
- if (!e || !i) return;
690
- const a = this.getAttribute("orientation") !== "vertical", r = typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
691
- typeof i.scrollIntoView == "function" && i.scrollIntoView({
692
- behavior: r ? "auto" : "smooth",
695
+ const e = this.root.querySelector(".nav"), r = this.root.querySelector(`.tab[data-index="${t}"]`);
696
+ if (!e || !r) return;
697
+ const a = this.getAttribute("orientation") !== "vertical", i = typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
698
+ typeof r.scrollIntoView == "function" && r.scrollIntoView({
699
+ behavior: i ? "auto" : "smooth",
693
700
  block: "nearest",
694
701
  inline: a ? "center" : "nearest"
695
702
  });
696
703
  }
697
704
  _onClick(t) {
698
- const i = t.target?.closest(".tab");
699
- if (!i || i.disabled) return;
700
- const a = Number(i.getAttribute("data-index"));
705
+ const r = t.target?.closest(".tab");
706
+ if (!r || r.disabled) return;
707
+ const a = Number(r.getAttribute("data-index"));
701
708
  if (!Number.isFinite(a)) return;
702
- const r = this._tabsModel();
703
- this._setSelectedByIndex(r, a, !0);
709
+ const i = this._tabsModel();
710
+ this._setSelectedByIndex(i, a, !0);
704
711
  }
705
712
  _onKeyDown(t) {
706
- const i = t.target?.closest(".tab");
707
- if (!i) return;
713
+ const r = t.target?.closest(".tab");
714
+ if (!r) return;
708
715
  const a = this._tabsModel();
709
716
  if (!a.length) return;
710
- const r = this.getAttribute("orientation") === "vertical" ? "vertical" : "horizontal", s = this.getAttribute("activation") === "manual" ? "manual" : "auto", n = !this.hasAttribute("loop") || g(this.getAttribute("loop")), o = getComputedStyle(this).direction === "rtl", l = Number(i.getAttribute("data-index"));
711
- if (!Number.isFinite(l)) return;
712
- const d = (c) => {
713
- const b = w(a, l, c, {
714
- wrap: n,
717
+ const i = this.getAttribute("orientation") === "vertical" ? "vertical" : "horizontal", s = this.getAttribute("activation") === "manual" ? "manual" : "auto", b = !this.hasAttribute("loop") || x(this.getAttribute("loop")), c = getComputedStyle(this).direction === "rtl", o = Number(r.getAttribute("data-index"));
718
+ if (!Number.isFinite(o)) return;
719
+ const u = (n) => {
720
+ const l = A(a, o, n, {
721
+ wrap: b,
715
722
  fallbackIndex: this._resolveFocusIndex(a, this._resolveSelectedIndex(a)),
716
723
  getDisabled: (h) => h.disabled
717
724
  });
718
- b != null && (this._focusTab(b), s === "auto" ? this._setSelectedByIndex(a, b, !0) : this._emit("focus", a, b));
725
+ l != null && (this._focusTab(l), s === "auto" ? this._setSelectedByIndex(a, l, !0) : this._emit("focus", a, l));
719
726
  };
720
- if (r === "horizontal" && (t.key === "ArrowRight" && !o || t.key === "ArrowLeft" && o) || r === "vertical" && t.key === "ArrowDown") {
721
- t.preventDefault(), d(1);
727
+ if (i === "horizontal" && (t.key === "ArrowRight" && !c || t.key === "ArrowLeft" && c) || i === "vertical" && t.key === "ArrowDown") {
728
+ t.preventDefault(), u(1);
722
729
  return;
723
730
  }
724
- if (r === "horizontal" && (t.key === "ArrowLeft" && !o || t.key === "ArrowRight" && o) || r === "vertical" && t.key === "ArrowUp") {
725
- t.preventDefault(), d(-1);
731
+ if (i === "horizontal" && (t.key === "ArrowLeft" && !c || t.key === "ArrowRight" && c) || i === "vertical" && t.key === "ArrowUp") {
732
+ t.preventDefault(), u(-1);
726
733
  return;
727
734
  }
728
735
  if (t.key === "Home") {
729
736
  t.preventDefault();
730
- const c = p(a, "first", (b) => b.disabled);
731
- if (c < 0) return;
732
- this._focusTab(c), s === "auto" ? this._setSelectedByIndex(a, c, !0) : this._emit("focus", a, c);
737
+ const n = f(a, "first", (l) => l.disabled);
738
+ if (n < 0) return;
739
+ this._focusTab(n), s === "auto" ? this._setSelectedByIndex(a, n, !0) : this._emit("focus", a, n);
733
740
  return;
734
741
  }
735
742
  if (t.key === "End") {
736
743
  t.preventDefault();
737
- const c = p(a, "last", (b) => b.disabled);
738
- if (c < 0) return;
739
- this._focusTab(c), s === "auto" ? this._setSelectedByIndex(a, c, !0) : this._emit("focus", a, c);
744
+ const n = f(a, "last", (l) => l.disabled);
745
+ if (n < 0) return;
746
+ this._focusTab(n), s === "auto" ? this._setSelectedByIndex(a, n, !0) : this._emit("focus", a, n);
740
747
  return;
741
748
  }
742
- (t.key === "Enter" || t.key === " ") && (t.preventDefault(), this._setSelectedByIndex(a, l, !0));
749
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), this._setSelectedByIndex(a, o, !0));
743
750
  }
744
751
  render() {
745
- const t = this._tabsModel(), e = this._resolveSelectedIndex(t), i = this._resolveFocusIndex(t, e);
752
+ const t = this._tabsModel(), e = this._resolveSelectedIndex(t), r = this._resolveFocusIndex(t, e);
746
753
  this._syncSelectedAttributes(t, e);
747
- const a = this.getAttribute("orientation") === "vertical" ? "vertical" : "horizontal", r = t.map((n) => {
748
- const o = n.index === e, l = n.icon ? `<span class="tab-icon" aria-hidden="true">${f(n.icon)}</span>` : "";
754
+ const a = this.getAttribute("orientation") === "vertical" ? "vertical" : "horizontal", i = (this.getAttribute("aria-label") || "").trim(), s = (this.getAttribute("aria-labelledby") || "").trim(), b = (i ? ` aria-label="${v(i)}"` : "") + (s ? ` aria-labelledby="${v(s)}"` : ""), c = t.map((o) => {
755
+ const u = o.index === e, n = o.icon ? `<span class="tab-icon" aria-hidden="true">${v(o.icon)}</span>` : "";
749
756
  return `
750
757
  <button
751
758
  type="button"
752
759
  class="tab"
753
760
  part="tab"
754
- id="${n.tabId}"
761
+ id="${o.tabId}"
755
762
  role="tab"
756
- data-index="${n.index}"
757
- aria-selected="${o ? "true" : "false"}"
758
- aria-controls="${n.panelId}"
759
- aria-disabled="${n.disabled ? "true" : "false"}"
760
- tabindex="${n.index === i && !n.disabled ? "0" : "-1"}"
761
- ${n.disabled ? "disabled" : ""}
763
+ data-index="${o.index}"
764
+ aria-selected="${u ? "true" : "false"}"
765
+ aria-disabled="${o.disabled ? "true" : "false"}"
766
+ tabindex="${o.index === r && !o.disabled ? "0" : "-1"}"
767
+ ${o.disabled ? "disabled" : ""}
762
768
  >
763
- ${l}
764
- <span class="tab-label">${f(n.label)}</span>
769
+ ${n}
770
+ <span class="tab-label">${v(o.label)}</span>
765
771
  </button>
766
772
  `;
767
773
  }).join("");
768
774
  this.setContent(`
769
- <style>${A}</style>
775
+ <style>${k}</style>
770
776
  <section class="shell" part="shell">
771
- <div class="nav" role="tablist" aria-orientation="${a}" part="nav">
777
+ <div class="nav" role="tablist" aria-orientation="${a}"${b} part="nav">
772
778
  <span class="indicator" part="indicator" aria-hidden="true"></span>
773
- ${r}
779
+ ${c}
774
780
  </div>
775
781
  <div class="panel-wrap" part="panel-wrap" aria-live="polite">
776
782
  <slot name="panel"></slot>
777
783
  </div>
778
784
  </section>
779
785
  <slot class="source-tabs" name="tab"></slot>
780
- `);
781
- const s = t[e];
782
- s ? (this.setAttribute("aria-activedescendant", s.tabId), this.setAttribute("aria-controls", s.panelId)) : (this.removeAttribute("aria-activedescendant"), this.removeAttribute("aria-controls")), this._syncIndicator(e), this._syncPanels(t, e);
786
+ `), this._clearCrossRootReferences(), this._syncIndicator(e), this._syncPanels(t, e);
783
787
  }
784
788
  }
785
- typeof customElements < "u" && !customElements.get("ui-tabs") && customElements.define("ui-tabs", S);
789
+ typeof customElements < "u" && !customElements.get("ui-tabs") && customElements.define("ui-tabs", I);
786
790
  export {
787
- S as UITabs
791
+ I as UITabs
788
792
  };