@smwb/ui-solid 1.0.0 → 2.1.0

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 (213) hide show
  1. package/README.md +115 -0
  2. package/dist/assets/styles/less/components/appBar/appBar.entry.css +1 -1
  3. package/dist/assets/styles/less/components/avatar/avatar.entry.css +1 -1
  4. package/dist/assets/styles/less/components/badge/badge.entry.css +1 -1
  5. package/dist/assets/styles/less/components/breadcrumbs/breadcrumbs.entry.css +1 -1
  6. package/dist/assets/styles/less/components/button/button.entry.css +1 -1
  7. package/dist/assets/styles/less/components/buttonGroup/buttonGroup.entry.css +1 -1
  8. package/dist/assets/styles/less/components/dagView/dagView.entry.css +1 -1
  9. package/dist/assets/styles/less/components/meter/meter.entry.css +1 -1
  10. package/dist/assets/styles/less/components/screenDivider/screenDivider.entry.css +1 -1
  11. package/dist/assets/styles/less/components/sheet/sheet.entry.css +1 -1
  12. package/dist/assets/styles/less/components/statusDot/statusDot.entry.css +1 -1
  13. package/dist/assets/styles/less/components/tabGroups/tabGroups.entry.css +1 -1
  14. package/dist/assets/styles/less/components/tabs/tab/tab.entry.css +1 -1
  15. package/dist/assets/styles/less/components/toggle/toggle.entry.css +1 -1
  16. package/dist/assets/styles/less/components/treeView/treeView.entry.css +1 -1
  17. package/dist/assets/styles/less/tokens.entry.css +1 -1
  18. package/dist/components/dataDisplay/avatar/avatar.d.ts +5 -2
  19. package/dist/components/dataDisplay/avatar/avatar.js +9 -9
  20. package/dist/components/dataDisplay/avatar/avatar.js.map +1 -1
  21. package/dist/components/dataDisplay/badge/badge.d.ts +2 -1
  22. package/dist/components/dataDisplay/badge/badge.js.map +1 -1
  23. package/dist/components/dataDisplay/chart/chart.d.ts +16 -8
  24. package/dist/components/dataDisplay/chart/chartFull.d.ts +14 -0
  25. package/dist/components/dataDisplay/chart/core.d.ts +19 -0
  26. package/dist/components/dataDisplay/chart/index.d.ts +1 -1
  27. package/dist/components/dataDisplay/dagView/dagView.d.ts +4 -0
  28. package/dist/components/dataDisplay/dagView/dagView.js +124 -123
  29. package/dist/components/dataDisplay/dagView/dagView.js.map +1 -1
  30. package/dist/components/dataDisplay/dagView/index.d.ts +1 -1
  31. package/dist/components/dataDisplay/meter/index.d.ts +1 -1
  32. package/dist/components/dataDisplay/meter/meter.d.ts +14 -0
  33. package/dist/components/dataDisplay/meter/meter.js +32 -30
  34. package/dist/components/dataDisplay/meter/meter.js.map +1 -1
  35. package/dist/components/dataDisplay/statusDot/index.d.ts +1 -1
  36. package/dist/components/dataDisplay/statusDot/statusDot.d.ts +10 -1
  37. package/dist/components/dataDisplay/statusDot/statusDot.js +20 -11
  38. package/dist/components/dataDisplay/statusDot/statusDot.js.map +1 -1
  39. package/dist/components/dataDisplay/treeView/treeView.d.ts +18 -2
  40. package/dist/components/dataDisplay/treeView/treeView.js +140 -121
  41. package/dist/components/dataDisplay/treeView/treeView.js.map +1 -1
  42. package/dist/components/inputs/button/button.d.ts +7 -0
  43. package/dist/components/inputs/button/button.js +57 -51
  44. package/dist/components/inputs/button/button.js.map +1 -1
  45. package/dist/components/inputs/toggle/toggle.d.ts +6 -0
  46. package/dist/components/inputs/toggle/toggle.js +23 -23
  47. package/dist/components/inputs/toggle/toggle.js.map +1 -1
  48. package/dist/components/layout/appLayout/appLayout.d.ts +6 -1
  49. package/dist/components/layout/appLayout/appLayout.js +49 -42
  50. package/dist/components/layout/appLayout/appLayout.js.map +1 -1
  51. package/dist/components/layout/screenDivider/screenDivider.d.ts +12 -0
  52. package/dist/components/layout/screenDivider/screenDivider.js +87 -46
  53. package/dist/components/layout/screenDivider/screenDivider.js.map +1 -1
  54. package/dist/components/layout/sheet/sheet.d.ts +11 -0
  55. package/dist/components/layout/sheet/sheet.js +122 -102
  56. package/dist/components/layout/sheet/sheet.js.map +1 -1
  57. package/dist/components/layout/tabGroups/index.d.ts +1 -1
  58. package/dist/components/layout/tabGroups/tabGroups.d.ts +44 -1
  59. package/dist/components/layout/tabGroups/tabGroups.js +500 -460
  60. package/dist/components/layout/tabGroups/tabGroups.js.map +1 -1
  61. package/dist/components/layout/tabGroups/tabGroupsFocus.d.ts +16 -0
  62. package/dist/components/layout/tabGroups/tabGroupsFocus.js +102 -70
  63. package/dist/components/layout/tabGroups/tabGroupsFocus.js.map +1 -1
  64. package/dist/components/navigation/appBar/appBar.d.ts +12 -0
  65. package/dist/components/navigation/appBar/appBar.js.map +1 -1
  66. package/dist/components/navigation/breadcrumbs/breadcrumbs.d.ts +9 -0
  67. package/dist/components/navigation/breadcrumbs/breadcrumbs.js +47 -31
  68. package/dist/components/navigation/breadcrumbs/breadcrumbs.js.map +1 -1
  69. package/dist/components/navigation/tabs/tab/tab.js +71 -68
  70. package/dist/components/navigation/tabs/tab/tab.js.map +1 -1
  71. package/dist/components/navigation/tabs/tabs.d.ts +15 -1
  72. package/dist/components/navigation/tabs/tabs.js +19 -16
  73. package/dist/components/navigation/tabs/tabs.js.map +1 -1
  74. package/dist/components/navigation/tabs/tabsContext.d.ts +2 -0
  75. package/dist/components/navigation/tabs/tabsContext.js.map +1 -1
  76. package/dist/headless/components/dataDisplay/avatar/avatar.js +9 -9
  77. package/dist/headless/components/dataDisplay/avatar/avatar.js.map +1 -1
  78. package/dist/headless/components/dataDisplay/badge/badge.js.map +1 -1
  79. package/dist/headless/components/dataDisplay/dagView/dagView.js +133 -132
  80. package/dist/headless/components/dataDisplay/dagView/dagView.js.map +1 -1
  81. package/dist/headless/components/dataDisplay/meter/meter.js +32 -30
  82. package/dist/headless/components/dataDisplay/meter/meter.js.map +1 -1
  83. package/dist/headless/components/dataDisplay/statusDot/statusDot.js +19 -10
  84. package/dist/headless/components/dataDisplay/statusDot/statusDot.js.map +1 -1
  85. package/dist/headless/components/dataDisplay/treeView/treeView.js +139 -120
  86. package/dist/headless/components/dataDisplay/treeView/treeView.js.map +1 -1
  87. package/dist/headless/components/inputs/button/button.js +57 -51
  88. package/dist/headless/components/inputs/button/button.js.map +1 -1
  89. package/dist/headless/components/inputs/toggle/toggle.js +23 -23
  90. package/dist/headless/components/inputs/toggle/toggle.js.map +1 -1
  91. package/dist/headless/components/layout/appLayout/appLayout.js +52 -45
  92. package/dist/headless/components/layout/appLayout/appLayout.js.map +1 -1
  93. package/dist/headless/components/layout/screenDivider/screenDivider.js +88 -47
  94. package/dist/headless/components/layout/screenDivider/screenDivider.js.map +1 -1
  95. package/dist/headless/components/layout/sheet/sheet.js +124 -104
  96. package/dist/headless/components/layout/sheet/sheet.js.map +1 -1
  97. package/dist/headless/components/layout/tabGroups/tabGroups.js +500 -460
  98. package/dist/headless/components/layout/tabGroups/tabGroups.js.map +1 -1
  99. package/dist/headless/components/layout/tabGroups/tabGroupsFocus.js +102 -70
  100. package/dist/headless/components/layout/tabGroups/tabGroupsFocus.js.map +1 -1
  101. package/dist/headless/components/navigation/appBar/appBar.js.map +1 -1
  102. package/dist/headless/components/navigation/breadcrumbs/breadcrumbs.js +46 -30
  103. package/dist/headless/components/navigation/breadcrumbs/breadcrumbs.js.map +1 -1
  104. package/dist/headless/components/navigation/tabs/tab/tab.js +70 -67
  105. package/dist/headless/components/navigation/tabs/tab/tab.js.map +1 -1
  106. package/dist/headless/components/navigation/tabs/tabs.js +19 -16
  107. package/dist/headless/components/navigation/tabs/tabs.js.map +1 -1
  108. package/dist/headless/components/navigation/tabs/tabsContext.js.map +1 -1
  109. package/dist/headless/primitives/publishHeaderOffset.js +19 -0
  110. package/dist/headless/primitives/publishHeaderOffset.js.map +1 -0
  111. package/dist/headless/source/components/dataDisplay/avatar/avatar.jsx +1 -0
  112. package/dist/headless/source/components/dataDisplay/avatar/avatar.jsx.map +1 -1
  113. package/dist/headless/source/components/dataDisplay/badge/badge.jsx.map +1 -1
  114. package/dist/headless/source/components/dataDisplay/chart/chart.jsx +14 -12
  115. package/dist/headless/source/components/dataDisplay/chart/chart.jsx.map +1 -1
  116. package/dist/headless/source/components/dataDisplay/chart/chartFull.js +12 -0
  117. package/dist/headless/source/components/dataDisplay/chart/chartFull.js.map +7 -0
  118. package/dist/headless/source/components/dataDisplay/chart/core.js +11 -0
  119. package/dist/headless/source/components/dataDisplay/chart/core.js.map +7 -0
  120. package/dist/headless/source/components/dataDisplay/chart/index.js +1 -1
  121. package/dist/headless/source/components/dataDisplay/chart/index.js.map +1 -1
  122. package/dist/headless/source/components/dataDisplay/dagView/dagView.jsx +2 -1
  123. package/dist/headless/source/components/dataDisplay/dagView/dagView.jsx.map +1 -1
  124. package/dist/headless/source/components/dataDisplay/dagView/index.js.map +2 -2
  125. package/dist/headless/source/components/dataDisplay/meter/index.js.map +1 -1
  126. package/dist/headless/source/components/dataDisplay/meter/meter.jsx +14 -2
  127. package/dist/headless/source/components/dataDisplay/meter/meter.jsx.map +1 -1
  128. package/dist/headless/source/components/dataDisplay/statusDot/index.js.map +1 -1
  129. package/dist/headless/source/components/dataDisplay/statusDot/statusDot.jsx +13 -1
  130. package/dist/headless/source/components/dataDisplay/statusDot/statusDot.jsx.map +1 -1
  131. package/dist/headless/source/components/dataDisplay/treeView/treeView.jsx +16 -3
  132. package/dist/headless/source/components/dataDisplay/treeView/treeView.jsx.map +1 -1
  133. package/dist/headless/source/components/inputs/button/button.jsx +26 -1
  134. package/dist/headless/source/components/inputs/button/button.jsx.map +1 -1
  135. package/dist/headless/source/components/inputs/toggle/toggle.jsx +9 -2
  136. package/dist/headless/source/components/inputs/toggle/toggle.jsx.map +1 -1
  137. package/dist/headless/source/components/layout/appLayout/appLayout.jsx +14 -2
  138. package/dist/headless/source/components/layout/appLayout/appLayout.jsx.map +1 -1
  139. package/dist/headless/source/components/layout/screenDivider/screenDivider.jsx +102 -18
  140. package/dist/headless/source/components/layout/screenDivider/screenDivider.jsx.map +1 -1
  141. package/dist/headless/source/components/layout/sheet/sheet.jsx +14 -1
  142. package/dist/headless/source/components/layout/sheet/sheet.jsx.map +1 -1
  143. package/dist/headless/source/components/layout/tabGroups/index.js.map +1 -1
  144. package/dist/headless/source/components/layout/tabGroups/tabGroups.jsx +55 -1
  145. package/dist/headless/source/components/layout/tabGroups/tabGroups.jsx.map +1 -1
  146. package/dist/headless/source/components/layout/tabGroups/tabGroupsFocus.js +42 -0
  147. package/dist/headless/source/components/layout/tabGroups/tabGroupsFocus.js.map +2 -2
  148. package/dist/headless/source/components/navigation/appBar/appBar.jsx.map +1 -1
  149. package/dist/headless/source/components/navigation/breadcrumbs/breadcrumbs.jsx +39 -4
  150. package/dist/headless/source/components/navigation/breadcrumbs/breadcrumbs.jsx.map +1 -1
  151. package/dist/headless/source/components/navigation/tabs/tab/tab.jsx +7 -1
  152. package/dist/headless/source/components/navigation/tabs/tab/tab.jsx.map +1 -1
  153. package/dist/headless/source/components/navigation/tabs/tabs.jsx +5 -1
  154. package/dist/headless/source/components/navigation/tabs/tabs.jsx.map +1 -1
  155. package/dist/headless/source/components/navigation/tabs/tabsContext.js.map +2 -2
  156. package/dist/headless/source/index.js +8 -1
  157. package/dist/headless/source/index.js.map +2 -2
  158. package/dist/headless/source/primitives/publishHeaderOffset.js +34 -0
  159. package/dist/headless/source/primitives/publishHeaderOffset.js.map +7 -0
  160. package/dist/index.d.ts +5 -5
  161. package/dist/primitives/publishHeaderOffset.d.ts +7 -0
  162. package/dist/primitives/publishHeaderOffset.js +19 -0
  163. package/dist/primitives/publishHeaderOffset.js.map +1 -0
  164. package/dist/source/components/dataDisplay/avatar/avatar.jsx +1 -0
  165. package/dist/source/components/dataDisplay/avatar/avatar.jsx.map +1 -1
  166. package/dist/source/components/dataDisplay/badge/badge.jsx.map +1 -1
  167. package/dist/source/components/dataDisplay/chart/chart.jsx +14 -12
  168. package/dist/source/components/dataDisplay/chart/chart.jsx.map +1 -1
  169. package/dist/source/components/dataDisplay/chart/chartFull.js +12 -0
  170. package/dist/source/components/dataDisplay/chart/chartFull.js.map +7 -0
  171. package/dist/source/components/dataDisplay/chart/core.js +11 -0
  172. package/dist/source/components/dataDisplay/chart/core.js.map +7 -0
  173. package/dist/source/components/dataDisplay/chart/index.js +1 -1
  174. package/dist/source/components/dataDisplay/chart/index.js.map +1 -1
  175. package/dist/source/components/dataDisplay/dagView/dagView.jsx +2 -1
  176. package/dist/source/components/dataDisplay/dagView/dagView.jsx.map +1 -1
  177. package/dist/source/components/dataDisplay/dagView/index.js.map +2 -2
  178. package/dist/source/components/dataDisplay/meter/index.js.map +1 -1
  179. package/dist/source/components/dataDisplay/meter/meter.jsx +14 -2
  180. package/dist/source/components/dataDisplay/meter/meter.jsx.map +1 -1
  181. package/dist/source/components/dataDisplay/statusDot/index.js.map +1 -1
  182. package/dist/source/components/dataDisplay/statusDot/statusDot.jsx +13 -1
  183. package/dist/source/components/dataDisplay/statusDot/statusDot.jsx.map +1 -1
  184. package/dist/source/components/dataDisplay/treeView/treeView.jsx +16 -3
  185. package/dist/source/components/dataDisplay/treeView/treeView.jsx.map +1 -1
  186. package/dist/source/components/inputs/button/button.jsx +26 -1
  187. package/dist/source/components/inputs/button/button.jsx.map +1 -1
  188. package/dist/source/components/inputs/toggle/toggle.jsx +9 -2
  189. package/dist/source/components/inputs/toggle/toggle.jsx.map +1 -1
  190. package/dist/source/components/layout/appLayout/appLayout.jsx +14 -2
  191. package/dist/source/components/layout/appLayout/appLayout.jsx.map +1 -1
  192. package/dist/source/components/layout/screenDivider/screenDivider.jsx +102 -18
  193. package/dist/source/components/layout/screenDivider/screenDivider.jsx.map +1 -1
  194. package/dist/source/components/layout/sheet/sheet.jsx +14 -1
  195. package/dist/source/components/layout/sheet/sheet.jsx.map +1 -1
  196. package/dist/source/components/layout/tabGroups/index.js.map +1 -1
  197. package/dist/source/components/layout/tabGroups/tabGroups.jsx +55 -1
  198. package/dist/source/components/layout/tabGroups/tabGroups.jsx.map +1 -1
  199. package/dist/source/components/layout/tabGroups/tabGroupsFocus.js +42 -0
  200. package/dist/source/components/layout/tabGroups/tabGroupsFocus.js.map +2 -2
  201. package/dist/source/components/navigation/appBar/appBar.jsx.map +1 -1
  202. package/dist/source/components/navigation/breadcrumbs/breadcrumbs.jsx +39 -4
  203. package/dist/source/components/navigation/breadcrumbs/breadcrumbs.jsx.map +1 -1
  204. package/dist/source/components/navigation/tabs/tab/tab.jsx +7 -1
  205. package/dist/source/components/navigation/tabs/tab/tab.jsx.map +1 -1
  206. package/dist/source/components/navigation/tabs/tabs.jsx +5 -1
  207. package/dist/source/components/navigation/tabs/tabs.jsx.map +1 -1
  208. package/dist/source/components/navigation/tabs/tabsContext.js.map +2 -2
  209. package/dist/source/index.js +8 -1
  210. package/dist/source/index.js.map +2 -2
  211. package/dist/source/primitives/publishHeaderOffset.js +34 -0
  212. package/dist/source/primitives/publishHeaderOffset.js.map +7 -0
  213. package/package.json +9 -3
@@ -1,7 +1,7 @@
1
1
  import { createComponent as u, use as R, spread as et, mergeProps as tt, insert as h, effect as T, setAttribute as C, setStyleProperty as pe, style as nt, memo as ye, template as L, isServer as rt, delegateEvents as ot } from "solid-js/web";
2
2
  import '../../../assets/styles/less/components/tabs/tabs.entry.css';import '../../../assets/styles/less/tokens.entry.css';/* empty css */
3
3
  /* empty css */
4
- import { mergeProps as st, splitProps as lt, createUniqueId as at, createSignal as f, onMount as Ie, createEffect as K, on as j, onCleanup as J, Show as O, For as it, createMemo as Le, children as xe, createComputed as Ce } from "solid-js";
4
+ import { mergeProps as st, splitProps as lt, createUniqueId as at, createSignal as b, onMount as Ie, createEffect as K, on as j, onCleanup as J, Show as O, For as it, createMemo as Le, children as xe, createComputed as Ce } from "solid-js";
5
5
  import ct from "clsx";
6
6
  import { debounce as dt } from "../../../utils/debounce.js";
7
7
  import { animate as ut } from "../../../utils/animate.js";
@@ -30,15 +30,16 @@ function Nt(w) {
30
30
  scrollButtons: !1,
31
31
  overflowMenu: !1,
32
32
  dense: !1,
33
+ fit: !1,
33
34
  orientation: "horizontal",
34
35
  scrollBackAriaLabel: "Scroll tabs back",
35
36
  scrollForwardAriaLabel: "Scroll tabs forward",
36
37
  overflowMenuAriaLabel: "More tabs"
37
- }, w), [l, Me] = lt(p, ["class", "children", "onChange", "value", "indicatorContent", "scrollable", "scrollButtons", "onReorder", "overflowMenu", "overflowMenuAriaLabel", "dense", "orientation", "panels", "id", "scrollBackAriaLabel", "scrollForwardAriaLabel", "aria-label", "ref"]), Ee = at(), Z = () => l.id ?? Ee, [M, ee] = f([]), Se = (e) => M().find((r) => r.index() === e)?.id() ?? `${Z()}-tab-${e}`, $e = (e) => `${Z()}-panel-${e}`, [Ae, De] = f(), [Re, Te] = f(!1), [te, B] = f(null), [Oe, Be] = f(!1), [_, ne] = f({
38
+ }, w), [l, Me] = lt(p, ["class", "children", "onChange", "value", "indicatorContent", "scrollable", "scrollButtons", "onReorder", "overflowMenu", "overflowMenuAriaLabel", "dense", "fit", "orientation", "panels", "id", "scrollBackAriaLabel", "scrollForwardAriaLabel", "aria-label", "ref"]), Ee = at(), Z = () => l.id ?? Ee, [M, ee] = b([]), Se = (e) => M().find((r) => r.index() === e)?.id() ?? `${Z()}-tab-${e}`, $e = (e) => `${Z()}-panel-${e}`, [Ae, De] = b(), [Re, Te] = b(!1), [te, B] = b(null), [Oe, Be] = b(!1), [_, ne] = b({
38
39
  root: {}
39
- }), [W, re] = f(!1), [F, oe] = f(!1), [se, le] = f([]), [ae, q] = f(!1);
40
- let ie, c, b, v = null;
41
- const [E, Pe] = f();
40
+ }), [W, re] = b(!1), [F, oe] = b(!1), [se, le] = b([]), [ae, q] = b(!1);
41
+ let ie, c, f, v = null;
42
+ const [E, Pe] = b();
42
43
  let ke = 0;
43
44
  const ze = () => {
44
45
  let e;
@@ -52,8 +53,8 @@ function Nt(w) {
52
53
  };
53
54
  }
54
55
  let r = null, t = null;
55
- if (c && b && b.children.length > 0) {
56
- const s = b.children[l.value];
56
+ if (c && f && f.children.length > 0) {
57
+ const s = f.children[l.value];
57
58
  r = s ? s.getBoundingClientRect() : null, l.indicatorContent && (t = s?.querySelector(".smwb-tab__content")?.getBoundingClientRect() ?? null);
58
59
  }
59
60
  return {
@@ -92,7 +93,7 @@ function Nt(w) {
92
93
  }
93
94
  const e = c.scrollWidth - c.clientWidth;
94
95
  re(c.scrollLeft > 1), oe(c.scrollLeft < e - 1);
95
- const r = l.overflowMenu ? bt(b ? Array.from(b.children).map((t) => {
96
+ const r = l.overflowMenu ? bt(f ? Array.from(f.children).map((t) => {
96
97
  const s = t;
97
98
  return {
98
99
  offsetLeft: s.offsetLeft,
@@ -107,8 +108,8 @@ function Nt(w) {
107
108
  }, de = (e) => {
108
109
  c && N(c.scrollLeft + e * c.clientWidth * Ct);
109
110
  }, ue = (e) => {
110
- if (!c || !b) return;
111
- const r = b.children[e];
111
+ if (!c || !f) return;
112
+ const r = f.children[e];
112
113
  if (!r) return;
113
114
  const t = c.getBoundingClientRect(), s = r.getBoundingClientRect();
114
115
  s.left < t.left ? N(c.scrollLeft + (s.left - t.left) - _e) : s.right > t.right && N(c.scrollLeft + (s.right - t.right) + _e);
@@ -125,13 +126,13 @@ function Nt(w) {
125
126
  passive: !0
126
127
  });
127
128
  let t;
128
- typeof ResizeObserver < "u" && b && (t = new ResizeObserver(e), c && t.observe(c), Array.from(b.children).forEach((s) => t?.observe(s))), S(), J(() => {
129
+ typeof ResizeObserver < "u" && f && (t = new ResizeObserver(e), c && t.observe(c), Array.from(f.children).forEach((s) => t?.observe(s))), S(), J(() => {
129
130
  e.cancel(), r?.removeEventListener("resize", e), c?.removeEventListener("scroll", S), t?.disconnect();
130
131
  });
131
132
  }), K(() => {
132
133
  _(), Ke();
133
134
  });
134
- const g = () => Array.from(b?.querySelectorAll('[role="tab"]') ?? []), y = (e) => e.closest(".smwb-tab-item") ?? e, I = (e) => e ? g().findIndex((r) => y(r).contains(e)) : -1, $ = (e) => !e || e.getAttribute("aria-disabled") === "true" || e.disabled === !0, We = () => {
135
+ const g = () => Array.from(f?.querySelectorAll('[role="tab"]') ?? []), y = (e) => e.closest(".smwb-tab-item") ?? e, I = (e) => e ? g().findIndex((r) => y(r).contains(e)) : -1, $ = (e) => !e || e.getAttribute("aria-disabled") === "true" || e.disabled === !0, We = () => {
135
136
  const e = E()?.length, r = e === void 0 || l.value >= 0 && l.value < e ? l.value : 0, t = M();
136
137
  if (!t.some((n) => n.index() === r && n.disabled())) return r;
137
138
  const s = t.filter((n) => !n.disabled()).map((n) => n.index()).filter((n) => n >= 0);
@@ -146,7 +147,7 @@ function Nt(w) {
146
147
  isDisabled: (e) => $(g()[e])
147
148
  });
148
149
  let x = null, P = null, A = null;
149
- const V = (e) => e instanceof Element ? y(e) : null, be = () => {
150
+ const V = (e) => e instanceof Element && e !== f ? y(e) : null, be = () => {
150
151
  P?.classList.remove("smwb-tab-item--dragging"), A?.classList.remove("smwb-tab-item--drop-target"), P = null, A = null;
151
152
  }, qe = (e) => {
152
153
  if (!l.onReorder) return;
@@ -200,7 +201,7 @@ function Nt(w) {
200
201
  }
201
202
  };
202
203
  K(j(E, () => {
203
- const e = b?.ownerDocument, r = v;
204
+ const e = f?.ownerDocument, r = v;
204
205
  if (e && r && !r.item.isConnected && (v = null, !e.activeElement || e.activeElement === e.body)) {
205
206
  const s = g(), n = Math.min(r.index, s.length - 1), o = [...s.keys()].filter((i) => !$(s[i])), a = o.find((i) => i >= n) ?? o[o.length - 1];
206
207
  if (a !== void 0) {
@@ -223,6 +224,7 @@ function Nt(w) {
223
224
  }));
224
225
  }, je = {
225
226
  value: () => l.value,
227
+ fit: () => l.fit,
226
228
  tabStop: (e) => fe() === e,
227
229
  tabId: Se,
228
230
  panelId: $e,
@@ -271,6 +273,7 @@ function Nt(w) {
271
273
  get class() {
272
274
  return ct("smwb-tabs", {
273
275
  "smwb-tabs--dense": l.dense,
276
+ "smwb-tabs--fit": l.fit,
274
277
  "smwb-tabs--overflow-start": W(),
275
278
  "smwb-tabs--overflow-end": F()
276
279
  }, l.class);
@@ -292,7 +295,7 @@ function Nt(w) {
292
295
  t: void 0
293
296
  }), n;
294
297
  }
295
- }), r), R((n) => c = n, r), t.addEventListener("dragend", He), t.addEventListener("drop", Ve), t.addEventListener("dragover", Ne), t.addEventListener("dragstart", qe), t.$$focusout = Ue, t.$$focusin = Ge, t.$$keydown = Xe, R((n) => b = n, t), h(t, u(Mt, {
298
+ }), r), R((n) => c = n, r), t.addEventListener("dragend", He), t.addEventListener("drop", Ve), t.addEventListener("dragover", Ne), t.addEventListener("dragstart", qe), t.$$focusout = Ue, t.$$focusin = Ge, t.$$keydown = Xe, R((n) => f = n, t), h(t, u(Mt, {
296
299
  onItems: Pe,
297
300
  get children() {
298
301
  return l.children;
@@ -361,7 +364,7 @@ function Nt(w) {
361
364
  return se();
362
365
  },
363
366
  children: (n) => {
364
- const o = () => g()[n], a = o(), [i, D] = f(H(a)), [X, Ye] = f(!!k(a)), Ze = Le(() => {
367
+ const o = () => g()[n], a = o(), [i, D] = b(H(a)), [X, Ye] = b(!!k(a)), Ze = Le(() => {
365
368
  const d = M().find((m) => m.index() === n);
366
369
  return d ? d.disabled() : $(o());
367
370
  });
@@ -1 +1 @@
1
- {"version":3,"file":"tabs.js","sources":["../../../../src/components/navigation/tabs/tabs.tsx"],"sourcesContent":["import {\n type Accessor,\n type JSX,\n type ParentProps,\n For,\n Show,\n children,\n createComputed,\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n mergeProps,\n on,\n onCleanup,\n onMount,\n splitProps,\n} from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport cn from \"clsx\";\nimport { debounce } from \"../../../utils/debounce\";\nimport { animate } from \"../../../utils/animate\";\nimport { matchesKeyboardShortcut } from \"../../../utils/keyboardShortcut\";\nimport { TabsContext, type TabInfo, type TabsContextValue } from \"./tabsContext\";\nimport { Tab } from \"./tab/tab\";\nimport { getHiddenIndexes } from \"./tabs.utils\";\nimport { Menu } from \"../menu\";\nimport { MenuItem } from \"../menu/menuItem\";\nimport { Icon } from \"../../base/icon\";\nimport { mergeRefs, type Ref } from \"../../../primitives/mergeRefs\";\nimport { createRovingTabIndex } from \"../../../primitives/createRovingTabIndex\";\n\n/**\n * Tabs follow the WAI-ARIA tabs pattern with manual activation. The selected tab is the row's one\n * tab stop (`tabindex` 0, the others -1). The arrow keys along the row's `orientation` move focus to\n * the next or the previous tab (wrapping at the ends), Home and End to the first and the last one;\n * disabled tabs are skipped. Enter or Space then selects the focused tab, as a click does:\n * `onChange` is called for it, with the key's click. Moving focus changes nothing by itself, so a\n * row of link tabs does not navigate as the arrows pass them. Tab leaves the row for what follows\n * it, the selected `TabPanel` first when `panels` are given.\n *\n * A `Tab` can be `closable` and take `actions`; they sit beside the tab and out of the Tab order.\n * Delete on the focused tab, its close button or its `actions` (through `close`) ask `onClose` to\n * close it, and when it goes, focus moves to the tab that takes its place instead of falling to the\n * page. A middle click on a closable tab closes it too.\n *\n * With `onReorder` the row's tabs drag onto one another to reorder: `onReorder(from, to)` reports\n * the drop and the owner moves the tabs; dropping the selected tab reports its new index through\n * `onChange` as well, so the selection follows the moved tab. With `overflowMenu` a scrollable\n * row that overflows gains\n * a trigger beside it listing the clipped tabs. The chords Mod+W (close the focused closable tab)\n * and Mod+Shift+[ / Mod+Shift+] (switch to the previous / next tab) are handled on the row, as\n * best-effort: a browser of its own tabs reserves them.\n */\nexport interface TabsProps {\n /**\n * Index of the selected tab: its position in the row. Tabs count in the order they\n * render, so a tab behind a `<Show>` that is off takes no index, and tabs added,\n * removed or reordered count by their new place.\n */\n value: number;\n /**\n * Called with the index of the clicked tab, counted as for `value`. A tab chosen from the keyboard\n * (Enter or Space on the focused tab) calls it with that click too. A modified or non-primary\n * click (Ctrl, Meta, Shift or Alt held, or a button other than the main one) on a link tab\n * (`Tab` with `href`) is the browser's, as \"open in a new tab\": it does not call `onChange`.\n */\n onChange: (event: MouseEvent & { currentTarget: HTMLElement; target: Element }, index: number) => void;\n /**\n * Which way the tabs run. It sets `aria-orientation` on the tab list and picks the arrow keys that\n * move between tabs: Left and Right when horizontal, Up and Down when vertical. The styles draw\n * a horizontal row; a vertical list is yours to lay out.\n */\n orientation?: \"horizontal\" | \"vertical\";\n /**\n * The content of the tabs: `TabPanel`s, rendered after the tab row. With them each tab gets\n * `aria-controls` its panel and each panel `aria-labelledby` its tab. Without them the tabs link\n * to nothing, as before. Give a panel to every tab: a tab whose panel is left out still names it.\n * A `TabPanel` placed anywhere else is not linked to the tabs and is always shown.\n */\n panels?: JSX.Element;\n /**\n * Base of the ids that link tabs and panels: tab `n` is `{id}-tab-{n}`, its panel `{id}-panel-{n}`.\n * It is also the id of the root element. A generated one by default.\n */\n id?: string;\n /** Draw the indicator as wide as the selected tab's label rather than the whole tab. */\n indicatorContent?: boolean;\n /**\n * Let the tab row scroll sideways instead of clipping it. The edge beyond which\n * more tabs are hidden fades out.\n */\n scrollable?: boolean;\n /**\n * With `scrollable`: buttons at both ends that scroll the row while it overflows. They are for\n * the pointer and stay out of the Tab order: the arrow keys reach every tab and scroll it into\n * view.\n */\n scrollButtons?: boolean;\n /**\n * Present ⇒ the row is reorderable by dragging a tab onto another (pointer-only; there is no\n * keyboard reorder). `Tabs` does not move the tabs itself: it reports the drag with\n * `onReorder(from, to)` — indexes counted as for `value` — and the owner reorders its state.\n * The tabs keep their focus through a reorder; when the moved tab is the selected one,\n * `onChange` reports its new index too, so a controlled owner keeps it selected. That `onChange`\n * carries the drop's own event standing in for the click's: the index argument is authoritative —\n * `currentTarget` is the scroll area the drop delegates to, not the tab.\n */\n onReorder?: (from: number, to: number) => void;\n /**\n * With `scrollable`: when the row overflows, a trigger button is rendered beside the scroller\n * (in the scroll buttons' spot) that opens a menu of the tabs the viewport clips — any clipped\n * part beyond a 1px tolerance counts. Each entry shows the tab's icon and label, the selected one is marked\n * `aria-current=\"true\"`, and choosing one calls `onChange` for it and scrolls it into view.\n * The trigger appears only after the browser has measured an overflow, so the server markup\n * shows none.\n */\n overflowMenu?: boolean;\n /** Accessible label of the overflow-menu trigger. English by default; set it to localise. */\n overflowMenuAriaLabel?: string;\n /** Compact tabs: labels as written (no capitals, no letter spacing) and less padding. */\n dense?: boolean;\n /** Accessible label of the button that scrolls back. */\n scrollBackAriaLabel?: string;\n /** Accessible label of the button that scrolls forward. */\n scrollForwardAriaLabel?: string;\n class?: string;\n children?: JSX.Element;\n \"aria-label\"?: string;\n ref?: Ref<HTMLDivElement>;\n}\n\ninterface IndicatorStyle {\n root: { left?: number; width?: number };\n content?: { width: number };\n}\n\nconst VIEW_NEXT_TAB_PX = 40;\n/** A scroll button moves the row by this share of its visible width. */\nconst SCROLL_PAGE = 0.8;\n\n/** What Tabs knows of each of its tabs. */\ninterface Registration extends TabInfo {\n index: Accessor<number>;\n}\n\n/**\n * The tab list's children, resolved once, with their elements reported in order\n * whenever they change. It renders inside the context provider, so the tabs it\n * creates find their Tabs.\n */\nfunction TabListItems(props: { children?: JSX.Element; onItems: (items: Element[]) => void }): JSX.Element {\n const resolved = children(() => props.children);\n if (!isServer) {\n createComputed(() => props.onItems(resolved.toArray().filter((node) => node instanceof Element)));\n }\n return <>{resolved()}</>;\n}\n\n/**\n * The `panels`, resolved once, inside the context provider so that the panels find their Tabs, and\n * before the tab row renders so that the tabs know whether they control anything. It draws\n * nothing itself: Tabs places what it reports after the row.\n */\nfunction PanelsResolver(props: {\n children?: JSX.Element;\n onPanels: (panels: JSX.Element, has: boolean) => void;\n}): null {\n const resolved = children(() => props.children);\n createComputed(() =>\n props.onPanels(\n resolved(),\n resolved.toArray().some((node) => node != null && node !== false && node !== \"\")\n )\n );\n return null;\n}\n\nexport function Tabs(props: ParentProps<TabsProps>): JSX.Element {\n const merged = mergeProps(\n {\n indicatorContent: false,\n scrollable: false,\n scrollButtons: false,\n overflowMenu: false,\n dense: false,\n orientation: \"horizontal\" as const,\n scrollBackAriaLabel: \"Scroll tabs back\",\n scrollForwardAriaLabel: \"Scroll tabs forward\",\n overflowMenuAriaLabel: \"More tabs\",\n },\n props\n );\n const [local, rest] = splitProps(merged, [\n \"class\",\n \"children\",\n \"onChange\",\n \"value\",\n \"indicatorContent\",\n \"scrollable\",\n \"scrollButtons\",\n \"onReorder\",\n \"overflowMenu\",\n \"overflowMenuAriaLabel\",\n \"dense\",\n \"orientation\",\n \"panels\",\n \"id\",\n \"scrollBackAriaLabel\",\n \"scrollForwardAriaLabel\",\n \"aria-label\",\n \"ref\",\n ]);\n\n const generatedId = createUniqueId();\n const baseId = (): string => local.id ?? generatedId;\n const [registrations, setRegistrations] = createSignal<Registration[]>([]);\n // A tab's own id is the one its panel is labelled by.\n const tabId = (index: number): string =>\n registrations()\n .find((registration) => registration.index() === index)\n ?.id() ?? `${baseId()}-tab-${index}`;\n const panelId = (index: number): string => `${baseId()}-panel-${index}`;\n const [panels, setPanels] = createSignal<JSX.Element>();\n const [hasPanels, setHasPanels] = createSignal(false);\n // The tab that has focus while focus is in the tab list: it is the row's tab stop then, so\n // Tab from there leaves the row instead of landing on the selected tab again.\n const [focusedIndex, setFocusedIndex] = createSignal<number | null>(null);\n\n const [mounted, setMounted] = createSignal(false);\n const [indicatorStyle, setIndicatorStyle] = createSignal<IndicatorStyle>({ root: {} });\n // Whether tabs are hidden past the start / the end of a scrollable row. Only\n // measured in the browser, so the server markup shows neither.\n const [overflowStart, setOverflowStart] = createSignal(false);\n const [overflowEnd, setOverflowEnd] = createSignal(false);\n // The indexes of the tabs the scroller's viewport clips: what the overflow menu lists.\n // Empty on the server and until the first measurement, like the overflow state.\n const [hiddenIndexes, setHiddenIndexes] = createSignal<number[]>([]);\n // The overflow-menu trigger and its menu, composed here when `overflowMenu` is on.\n const [overflowOpen, setOverflowOpen] = createSignal(false);\n let overflowTriggerEl: HTMLButtonElement | undefined;\n\n let tabsEl: HTMLDivElement | undefined;\n let tabListEl: HTMLDivElement | undefined;\n // The tab the user asked to close while it, or something beside it, had focus: its item, which\n // goes with it, and its place. If it goes while focus is lost with it, focus moves on to a neighbour.\n let closingTab: { item: Element; index: number } | null = null;\n // The tab list's elements in order, known once its children have resolved in\n // the browser. Before that, and on the server, a tab's index is the order it\n // was created in, which is its order in the markup.\n const [items, setItems] = createSignal<Element[]>();\n let created = 0;\n\n const getTabsMeta = () => {\n let tabsMeta: { clientWidth: number; scrollLeft: number; left: number; right: number } | undefined;\n if (tabsEl) {\n const rect = tabsEl.getBoundingClientRect();\n tabsMeta = { clientWidth: tabsEl.clientWidth, scrollLeft: tabsEl.scrollLeft, left: rect.left, right: rect.right };\n }\n let tabMeta: DOMRect | null = null;\n let tabContentMeta: DOMRect | null = null;\n if (tabsEl && tabListEl && tabListEl.children.length > 0) {\n const tab = tabListEl.children[local.value];\n tabMeta = tab ? tab.getBoundingClientRect() : null;\n if (local.indicatorContent) {\n tabContentMeta = tab?.querySelector(\".smwb-tab__content\")?.getBoundingClientRect() ?? null;\n }\n }\n return { tabsMeta, tabMeta, tabContentMeta };\n };\n\n const updateIndicatorState = (): void => {\n const { tabsMeta, tabMeta, tabContentMeta } = getTabsMeta();\n let startValue = 0;\n if (tabMeta && tabsMeta) {\n startValue = tabMeta.left - tabsMeta.left + tabsMeta.scrollLeft;\n }\n const next: IndicatorStyle = { root: { left: startValue, width: tabMeta ? tabMeta.width : 0 } };\n if (local.indicatorContent && tabContentMeta) {\n next.content = { width: tabContentMeta.width };\n }\n const prev = indicatorStyle();\n if (prev.root.left === undefined || prev.root.width === undefined) {\n setIndicatorStyle(next);\n return;\n }\n const dStart = Math.abs((prev.root.left ?? 0) - (next.root.left ?? 0));\n const dSize = Math.abs((prev.root.width ?? 0) - (next.root.width ?? 0));\n if (dStart >= 1 || dSize >= 1) {\n setIndicatorStyle(next);\n }\n };\n\n const updateOverflow = (): void => {\n if (!tabsEl || !local.scrollable) {\n setOverflowStart(false);\n setOverflowEnd(false);\n setHiddenIndexes((prev) => (prev.length === 0 ? prev : []));\n return;\n }\n const max = tabsEl.scrollWidth - tabsEl.clientWidth;\n setOverflowStart(tabsEl.scrollLeft > 1);\n setOverflowEnd(tabsEl.scrollLeft < max - 1);\n // Which tabs the viewport clips, measured the same way: the scroller is `position: relative`,\n // so a tab's `offsetLeft` is its place in the row's content. Only the menu needs the list,\n // so nothing is measured without it. Kept by identity when unchanged, because this runs on\n // every scroll tick.\n const hidden = local.overflowMenu\n ? getHiddenIndexes(\n tabListEl\n ? Array.from(tabListEl.children).map((child) => {\n const item = child as HTMLElement;\n return { offsetLeft: item.offsetLeft, offsetWidth: item.offsetWidth };\n })\n : [],\n tabsEl.scrollLeft,\n tabsEl.clientWidth\n )\n : [];\n setHiddenIndexes((prev) =>\n prev.length === hidden.length && prev.every((index, at) => index === hidden[at]) ? prev : hidden\n );\n };\n\n const scroll = (scrollValue: number): void => {\n if (!tabsEl) return;\n animate(tabsEl, \"scrollLeft\", scrollValue, { duration: 300 });\n };\n\n const scrollByPage = (direction: -1 | 1): void => {\n if (!tabsEl) return;\n scroll(tabsEl.scrollLeft + direction * tabsEl.clientWidth * SCROLL_PAGE);\n };\n\n const scrollIndexIntoView = (index: number): void => {\n if (!tabsEl || !tabListEl) return;\n const tab = tabListEl.children[index];\n if (!tab) return;\n const tabsRect = tabsEl.getBoundingClientRect();\n const tabRect = tab.getBoundingClientRect();\n if (tabRect.left < tabsRect.left) {\n scroll(tabsEl.scrollLeft + (tabRect.left - tabsRect.left) - VIEW_NEXT_TAB_PX);\n } else if (tabRect.right > tabsRect.right) {\n scroll(tabsEl.scrollLeft + (tabRect.right - tabsRect.right) + VIEW_NEXT_TAB_PX);\n }\n };\n\n const scrollSelectedIntoView = (): void => {\n scrollIndexIntoView(local.value);\n };\n\n onMount(() => setMounted(true));\n\n // Re-measure when the active value or the tabs change (and on mount).\n createEffect(\n on([() => local.value, items], () => {\n updateIndicatorState();\n updateOverflow();\n })\n );\n\n // Keep the indicator and the overflow state in sync with resizes: of the\n // window, of the row, and of each tab (a label can grow with its data).\n onMount(() => {\n const onResize = debounce(() => {\n updateIndicatorState();\n updateOverflow();\n }, 166);\n const view = tabsEl?.ownerDocument.defaultView;\n view?.addEventListener(\"resize\", onResize);\n tabsEl?.addEventListener(\"scroll\", updateOverflow, { passive: true });\n let resizeObserver: ResizeObserver | undefined;\n if (typeof ResizeObserver !== \"undefined\" && tabListEl) {\n resizeObserver = new ResizeObserver(onResize);\n if (tabsEl) resizeObserver.observe(tabsEl);\n Array.from(tabListEl.children).forEach((child) => resizeObserver?.observe(child));\n }\n updateOverflow();\n onCleanup(() => {\n onResize.cancel();\n view?.removeEventListener(\"resize\", onResize);\n tabsEl?.removeEventListener(\"scroll\", updateOverflow);\n resizeObserver?.disconnect();\n });\n });\n\n // Scroll the selected tab into view when the indicator moves.\n createEffect(() => {\n indicatorStyle();\n scrollSelectedIntoView();\n });\n\n // The tabs in the DOM, by what they are: their indexes are the ones `value` counts.\n const getTabNodes = (): HTMLElement[] => Array.from(tabListEl?.querySelectorAll<HTMLElement>('[role=\"tab\"]') ?? []);\n // A tab with a close button or actions sits in an item with them: focus on any of it is focus on the tab.\n const itemOf = (tab: HTMLElement): HTMLElement => tab.closest<HTMLElement>(\".smwb-tab-item\") ?? tab;\n const indexOfFocus = (target: Node | null | undefined): number =>\n target ? getTabNodes().findIndex((node) => itemOf(node).contains(target)) : -1;\n const isNodeDisabled = (node: HTMLElement | undefined): boolean =>\n !node || node.getAttribute(\"aria-disabled\") === \"true\" || (node as HTMLButtonElement).disabled === true;\n\n // The selected tab is the stop; a value that points at no tab leaves the first one, and a\n // disabled one, which cannot take focus, leaves the first tab that can.\n const selectedStop = (): number => {\n const count = items()?.length;\n const candidate = count === undefined || (local.value >= 0 && local.value < count) ? local.value : 0;\n const list = registrations();\n if (!list.some((registration) => registration.index() === candidate && registration.disabled())) return candidate;\n const enabled = list\n .filter((registration) => !registration.disabled())\n .map((registration) => registration.index())\n .filter((index) => index >= 0);\n return enabled.length > 0 ? Math.min(...enabled) : candidate;\n };\n const stopIndex = (): number => focusedIndex() ?? selectedStop();\n\n const onRovingKeyDown = createRovingTabIndex({\n count: () => getTabNodes().length,\n activeIndex: stopIndex,\n get orientation() {\n return local.orientation;\n },\n onMove: (next) => getTabNodes()[next]?.focus(),\n isDisabled: (index) => isNodeDisabled(getTabNodes()[index]),\n });\n\n // Drag-to-reorder (with `onReorder`): the drag's source and drop target are the tab items,\n // tracked here on the row; Tabs only reports `onReorder(from, to)` — and, when the moved tab\n // is the selected one, its new index through `onChange` — and keeps the tabs' focus alone;\n // the owner moves the tabs in its state.\n // Only while `onReorder` is given do the items carry `draggable`, and a disabled tab\n // never: the attribute is rendered declaratively by each `Tab` on its item (the wrapper,\n // or the bare tab when there is none), so it is part of the server markup — as in React.\n let dragSourceIndex: number | null = null;\n let draggingItem: HTMLElement | null = null;\n let dropTargetItem: HTMLElement | null = null;\n const dragItemOf = (target: EventTarget | null): HTMLElement | null =>\n target instanceof Element ? itemOf(target as HTMLElement) : null;\n const clearDragMarks = (): void => {\n draggingItem?.classList.remove(\"smwb-tab-item--dragging\");\n dropTargetItem?.classList.remove(\"smwb-tab-item--drop-target\");\n draggingItem = null;\n dropTargetItem = null;\n };\n\n const onItemDragStart: JSX.EventHandler<HTMLDivElement, DragEvent> = (event) => {\n if (!local.onReorder) return;\n const item = dragItemOf(event.target);\n if (!item) return;\n const index = indexOfFocus(item);\n if (index < 0 || isNodeDisabled(getTabNodes()[index])) return;\n dragSourceIndex = index;\n draggingItem = item;\n item.classList.add(\"smwb-tab-item--dragging\");\n // Firefox wants the drag given something to carry.\n event.dataTransfer?.setData(\"text/plain\", String(index));\n if (event.dataTransfer) {\n event.dataTransfer.effectAllowed = \"move\";\n }\n };\n\n const onItemDragOver: JSX.EventHandler<HTMLDivElement, DragEvent> = (event) => {\n if (dragSourceIndex === null || !local.onReorder) return;\n const item = dragItemOf(event.target);\n if (!item) return;\n // Without it the drop is not allowed here.\n event.preventDefault();\n if (item === dropTargetItem) return;\n dropTargetItem?.classList.remove(\"smwb-tab-item--drop-target\");\n dropTargetItem = item;\n item.classList.add(\"smwb-tab-item--drop-target\");\n };\n\n const onItemDrop: JSX.EventHandler<HTMLDivElement, DragEvent> = (event) => {\n if (dragSourceIndex === null) return;\n const from = dragSourceIndex;\n dragSourceIndex = null;\n const to = indexOfFocus(dragItemOf(event.target));\n // Read before the drop is reported: the owner may answer `onReorder` synchronously and move\n // `value` with the tab, and moving a node in the DOM loses the focus in some environments.\n const sourceItem = draggingItem;\n const wasSelected = from === local.value;\n const doc = sourceItem?.ownerDocument;\n const hadFocus = Boolean(sourceItem && doc?.activeElement && sourceItem.contains(doc.activeElement));\n clearDragMarks();\n event.preventDefault();\n if (to >= 0 && to !== from) {\n local.onReorder?.(from, to);\n // The selection belongs to the tab: when the moved tab is the selected one, report its\n // new index as a click would, so a controlled owner moves the value with the tab. The\n // drop's event stands in for the click's, as the overflow menu's choice does.\n if (wasSelected) {\n local.onChange(event as unknown as MouseEvent & { currentTarget: HTMLElement; target: Element }, to);\n }\n // The focus belongs to the tab too: put it back on the moved tab when it had it. The\n // check that the node landed at `to` keeps this honest when the owner reorders later.\n if (hadFocus) {\n const moved = getTabNodes()[to];\n if (moved && itemOf(moved) === sourceItem) moved.focus();\n }\n }\n };\n\n const onItemDragEnd: JSX.EventHandler<HTMLDivElement, DragEvent> = () => {\n dragSourceIndex = null;\n clearDragMarks();\n };\n\n // Select the enabled tab `delta` places from the focused one, wrapping at the ends and\n // skipping disabled tabs: as Enter or Space would, through a synthesized click on the tab.\n const switchByChord = (event: KeyboardEvent & { target: Element }, delta: -1 | 1): void => {\n const nodes = getTabNodes();\n const from = indexOfFocus(event.target);\n if (from < 0 || nodes.length === 0) return;\n for (let step = 1; step <= nodes.length; step += 1) {\n const next = (from + delta * step + nodes.length) % nodes.length;\n const node = nodes[next];\n if (node && !isNodeDisabled(node)) {\n node.focus();\n node.click();\n return;\n }\n }\n };\n\n const onTabListKeyDown = (event: KeyboardEvent & { currentTarget: HTMLElement; target: Element }): void => {\n if (event.defaultPrevented) return;\n // The tabs' chords, ahead of the \"chords belong to the browser\" guard below. They are\n // best-effort: a browser of its own tabs reserves Mod+W and Mod+Shift+[/], and they\n // bite only in an embedded webview.\n if ((event.ctrlKey || event.metaKey) && !event.altKey && indexOfFocus(event.target) >= 0) {\n const index = indexOfFocus(event.target);\n const registration = registrations().find((candidate) => candidate.index() === index);\n if (matchesKeyboardShortcut(event, [\"Mod\", \"W\"])) {\n if (registration && !registration.disabled() && registration.closable()) {\n event.preventDefault();\n registration.requestClose(event);\n }\n return;\n }\n if (matchesKeyboardShortcut(event, [\"Mod\", \"Shift\", \"[\"])) {\n event.preventDefault();\n switchByChord(event, -1);\n return;\n }\n if (matchesKeyboardShortcut(event, [\"Mod\", \"Shift\", \"]\"])) {\n event.preventDefault();\n switchByChord(event, 1);\n return;\n }\n }\n // Chords belong to the browser; a handler that took the key first keeps it.\n if (event.ctrlKey || event.metaKey || event.altKey || event.shiftKey) return;\n if (!event.target.closest('[role=\"tab\"]')) return;\n onRovingKeyDown(event);\n };\n\n // Focus can leave the row without a focusout: the focused tab is removed, and the browser moves\n // focus to the body. The row keeps the focused tab as its stop only while focus is in it, on\n // the tab that has it now (tabs before it may have come or gone).\n createEffect(\n on(\n items,\n () => {\n const doc = tabListEl?.ownerDocument;\n const closing = closingTab;\n if (doc && closing && !closing.item.isConnected) {\n closingTab = null;\n // A tab the user closed took the focus with it: the tab that takes its place gets it (the\n // previous one if it was last), the nearest that is not disabled. Focus that went anywhere\n // else meanwhile stays there.\n if (!doc.activeElement || doc.activeElement === doc.body) {\n const nodes = getTabNodes();\n const from = Math.min(closing.index, nodes.length - 1);\n const candidates = [...nodes.keys()].filter((index) => !isNodeDisabled(nodes[index]));\n const target = candidates.find((index) => index >= from) ?? candidates[candidates.length - 1];\n if (target !== undefined) {\n nodes[target]?.focus();\n setFocusedIndex(target);\n return;\n }\n }\n }\n if (focusedIndex() === null) return;\n const index = indexOfFocus(doc?.activeElement);\n setFocusedIndex(index >= 0 ? index : null);\n },\n { defer: true }\n )\n );\n\n const onTabListFocusIn = (event: FocusEvent): void => {\n const index = indexOfFocus(event.target as Node);\n if (index >= 0) setFocusedIndex(index);\n if (closingTab && !closingTab.item.contains(event.target as Node)) closingTab = null;\n };\n\n const onTabListFocusOut = (event: FocusEvent & { currentTarget: HTMLElement }): void => {\n if (!event.currentTarget.contains(event.relatedTarget as Node | null)) {\n setFocusedIndex(null);\n // Chromium fires this too as the focused tab is removed, just before it goes, and the removal\n // is what the marker is for: it stays until the effect that follows the removal has used it.\n // One still standing once the current task's microtasks run was a real blur: that close no\n // longer takes the focus anywhere.\n queueMicrotask(() => {\n if (closingTab?.item.isConnected) closingTab = null;\n });\n }\n };\n\n const contextValue: TabsContextValue = {\n value: () => local.value,\n tabStop: (index) => stopIndex() === index,\n tabId,\n panelId,\n hasPanels,\n reorderable: () => local.onReorder !== undefined,\n onChange: local.onChange,\n closing: (index, reason) => {\n const tab = getTabNodes()[index];\n const active = tab?.ownerDocument.activeElement;\n // Focus in the item is focus on the tab. A close from the tab's own `actions` is the user's\n // wherever focus is: it is in the menu then, which is drawn outside the row.\n const focused = reason === \"actions\" || Boolean(active && tab && itemOf(tab).contains(active));\n closingTab = tab && focused ? { item: itemOf(tab), index } : null;\n },\n registerTab: (element, info) => {\n const order = created++;\n const index = createMemo(() => {\n const list = items();\n if (!list) return order;\n const el = element();\n return el ? list.findIndex((item) => item.contains(el)) : -1;\n });\n const registration: Registration = { ...info, index };\n setRegistrations((list) => [...list, registration]);\n onCleanup(() => setRegistrations((list) => list.filter((item) => item !== registration)));\n return index;\n },\n };\n\n const showScrollButtons = (): boolean =>\n local.scrollable && local.scrollButtons && (overflowStart() || overflowEnd());\n\n // The overflow menu's trigger appears only once the browser has measured a clipped tab,\n // so the server markup — and the first client render — shows none.\n const showOverflowTrigger = (): boolean =>\n local.scrollable && local.overflowMenu && hiddenIndexes().length > 0;\n\n // The menu lists what the viewport clips; each entry shows a copy of the tab's icon and\n // label (the live nodes belong to the row, so they are cloned into the entry, not moved),\n // kept in step with the tab while the menu is open.\n const overflowItemIcon = (node: HTMLElement | undefined): Element | undefined =>\n node?.querySelector(\".smwb-tab__icon\") ?? undefined;\n const overflowItemLabel = (node: HTMLElement | undefined): string =>\n node?.querySelector(\".smwb-tab__text-label\")?.textContent ?? \"\";\n const cloneIconInto = (el: HTMLElement, node: HTMLElement | undefined): void => {\n const source = overflowItemIcon(node);\n if (!source) return;\n Array.from(source.childNodes).forEach((child) => el.appendChild(child.cloneNode(true)));\n };\n\n const chooseOverflowItem = (\n event: MouseEvent & { currentTarget: HTMLLIElement; target: Element },\n index: number\n ): void => {\n setOverflowOpen(false);\n local.onChange(event, index);\n scrollIndexIntoView(index);\n };\n\n return (\n <TabsContext.Provider value={contextValue}>\n <PanelsResolver onPanels={(resolved, has) => (setPanels(() => resolved), setHasPanels(has))}>\n {local.panels}\n </PanelsResolver>\n <div\n {...rest}\n id={local.id}\n class={cn(\n \"smwb-tabs\",\n {\n \"smwb-tabs--dense\": local.dense,\n \"smwb-tabs--overflow-start\": overflowStart(),\n \"smwb-tabs--overflow-end\": overflowEnd(),\n },\n local.class\n )}\n ref={mergeRefs(local.ref)}\n >\n <Show when={showScrollButtons()}>\n <button\n type=\"button\"\n class=\"smwb-tabs__scroll-button smwb-tabs__scroll-button--start\"\n aria-label={local.scrollBackAriaLabel}\n disabled={!overflowStart()}\n tabindex={-1}\n onClick={() => scrollByPage(-1)}\n >\n <Icon name=\"chevron_left\" size={20} />\n </button>\n </Show>\n {/* The scroller's class is static so it is on the element from the start:\n a ref on Tabs can find the row by class right away. */}\n <div\n class=\"smwb-tabs__scroller\"\n classList={{ \"smwb-tabs__scroller--scrollable\": local.scrollable }}\n ref={(el) => (tabsEl = el)}\n >\n <div\n class=\"smwb-tabs__scroll-area\"\n ref={(el) => (tabListEl = el)}\n role=\"tablist\"\n aria-label={local[\"aria-label\"]}\n aria-orientation={local.orientation}\n onKeyDown={onTabListKeyDown}\n onFocusIn={onTabListFocusIn}\n onFocusOut={onTabListFocusOut}\n onDragStart={onItemDragStart}\n onDragOver={onItemDragOver}\n onDrop={onItemDrop}\n onDragEnd={onItemDragEnd}\n >\n <TabListItems onItems={setItems}>{local.children}</TabListItems>\n </div>\n <Show when={mounted()}>\n <span\n class=\"smwb-tabs__indicator\"\n style={{\n left: `${indicatorStyle().root.left ?? 0}px`,\n width: `${indicatorStyle().root.width ?? 0}px`,\n }}\n >\n <span\n class=\"smwb-tabs__indicator-content\"\n style={indicatorStyle().content ? { width: `${indicatorStyle().content?.width ?? 0}px` } : {}}\n />\n </span>\n </Show>\n </div>\n <Show when={showScrollButtons()}>\n <button\n type=\"button\"\n class=\"smwb-tabs__scroll-button smwb-tabs__scroll-button--end\"\n aria-label={local.scrollForwardAriaLabel}\n disabled={!overflowEnd()}\n tabindex={-1}\n onClick={() => scrollByPage(1)}\n >\n <Icon name=\"chevron_right\" size={20} />\n </button>\n </Show>\n <Show when={showOverflowTrigger()}>\n <button\n type=\"button\"\n class=\"smwb-tabs__overflow-trigger\"\n aria-haspopup=\"menu\"\n aria-expanded={overflowOpen()}\n aria-label={local.overflowMenuAriaLabel}\n tabindex={-1}\n ref={(el) => (overflowTriggerEl = el)}\n onClick={() => setOverflowOpen((open) => !open)}\n >\n <Icon name=\"more_horiz\" size={20} />\n </button>\n <Menu\n anchorElement={overflowTriggerEl ?? null}\n isOpen={overflowOpen()}\n onClose={() => setOverflowOpen(false)}\n placement=\"bottom-end\"\n >\n <For each={hiddenIndexes()}>\n {(index) => {\n // The entry mirrors the tab it stands for. Solid children resolve to DOM, not to\n // prop objects, so the tab's own node is the source for the label and the icon;\n // a MutationObserver keeps the entry in step with renames and re-icons while the\n // menu is open. Disabled follows the tab's registration, as in the row's other\n // disabled bookkeeping, so a tab that flips `disabled` in place greys its entry out.\n //\n // Which node that is cannot be settled once, when the entry is drawn: an owner that\n // keys its list by value replaces the tab's node when its label changes, while the\n // clipped set — and so this entry — keeps its identity. `items` and `registrations`\n // are what announce the row moving, and the effect below reads the node from the row\n // when it runs, which is after Solid has landed that move in the DOM; a node sampled\n // earlier, into a memo or into a const, is the detached one by then.\n const nodeNow = (): HTMLElement | undefined => getTabNodes()[index];\n // What the row shows at this index as the entry is drawn, so its first paint is not\n // an empty entry; the effect below keeps it current from then on.\n const drawn = nodeNow();\n const [label, setLabel] = createSignal(overflowItemLabel(drawn));\n const [hasIcon, setHasIcon] = createSignal(Boolean(overflowItemIcon(drawn)));\n const disabled = createMemo(() => {\n const registration = registrations().find((candidate) => candidate.index() === index);\n return registration ? registration.disabled() : isNodeDisabled(nodeNow());\n });\n let iconEl: HTMLSpanElement | undefined;\n // The node the entry's content was last taken from: the icon span copies from it\n // when it is drawn, which is after the sync that asked for it.\n let shownNode = drawn;\n const syncIcon = (node: HTMLElement | undefined): void => {\n shownNode = node;\n const source = overflowItemIcon(node);\n setHasIcon(Boolean(source));\n if (iconEl && source) {\n iconEl.textContent = \"\";\n cloneIconInto(iconEl, node);\n }\n };\n createEffect(\n on([items, registrations], () => {\n const node = nodeNow();\n setLabel(overflowItemLabel(node));\n syncIcon(node);\n const item = node ? itemOf(node) : null;\n const view = item?.ownerDocument.defaultView;\n if (!item || !view || typeof view.MutationObserver === \"undefined\") return;\n const observer = new view.MutationObserver(() => {\n setLabel(overflowItemLabel(node));\n syncIcon(node);\n });\n observer.observe(item, { subtree: true, childList: true, characterData: true });\n onCleanup(() => observer.disconnect());\n })\n );\n return (\n <MenuItem\n disabled={disabled()}\n aria-current={index === local.value ? \"true\" : undefined}\n onClick={(event) => chooseOverflowItem(event, index)}\n >\n <Show when={hasIcon()}>\n <span\n class=\"smwb-tab__icon\"\n aria-hidden=\"true\"\n ref={(el) => {\n iconEl = el;\n // The span is drawn by the flag the sync above sets, so it is born after\n // that sync: it copies the icon of the node the entry last followed.\n if (overflowItemIcon(shownNode)) cloneIconInto(el, shownNode);\n }}\n />\n </Show>\n <span class=\"smwb-tab__text-label\">{label()}</span>\n </MenuItem>\n );\n }}\n </For>\n </Menu>\n </Show>\n </div>\n {panels()}\n </TabsContext.Provider>\n );\n}\n\nexport { Tab };\nexport type { TabProps, TabActionsApi, TabCloseReason } from \"./tab/tab\";\nexport default Tabs;\n"],"names":["VIEW_NEXT_TAB_PX","SCROLL_PAGE","TabListItems","props","resolved","children","isServer","createComputed","onItems","toArray","filter","node","Element","_$memo","PanelsResolver","onPanels","some","Tabs","merged","mergeProps","indicatorContent","scrollable","scrollButtons","overflowMenu","dense","orientation","scrollBackAriaLabel","scrollForwardAriaLabel","overflowMenuAriaLabel","local","rest","splitProps","generatedId","createUniqueId","baseId","id","registrations","setRegistrations","createSignal","tabId","index","find","registration","panelId","panels","setPanels","hasPanels","setHasPanels","focusedIndex","setFocusedIndex","mounted","setMounted","indicatorStyle","setIndicatorStyle","root","overflowStart","setOverflowStart","overflowEnd","setOverflowEnd","hiddenIndexes","setHiddenIndexes","overflowOpen","setOverflowOpen","overflowTriggerEl","tabsEl","tabListEl","closingTab","items","setItems","created","getTabsMeta","tabsMeta","rect","getBoundingClientRect","clientWidth","scrollLeft","left","right","tabMeta","tabContentMeta","length","tab","value","querySelector","updateIndicatorState","startValue","next","width","content","prev","undefined","dStart","Math","abs","dSize","updateOverflow","max","scrollWidth","hidden","getHiddenIndexes","Array","from","map","child","item","offsetLeft","offsetWidth","every","at","scroll","scrollValue","animate","duration","scrollByPage","direction","scrollIndexIntoView","tabsRect","tabRect","scrollSelectedIntoView","onMount","createEffect","on","onResize","debounce","view","ownerDocument","defaultView","addEventListener","passive","resizeObserver","ResizeObserver","observe","forEach","onCleanup","cancel","removeEventListener","disconnect","getTabNodes","querySelectorAll","itemOf","closest","indexOfFocus","target","findIndex","contains","isNodeDisabled","getAttribute","disabled","selectedStop","count","candidate","list","enabled","min","stopIndex","onRovingKeyDown","createRovingTabIndex","activeIndex","onMove","focus","isDisabled","dragSourceIndex","draggingItem","dropTargetItem","dragItemOf","clearDragMarks","classList","remove","onItemDragStart","event","onReorder","add","dataTransfer","setData","String","effectAllowed","onItemDragOver","preventDefault","onItemDrop","to","sourceItem","wasSelected","doc","hadFocus","Boolean","activeElement","onChange","moved","onItemDragEnd","switchByChord","delta","nodes","step","click","onTabListKeyDown","defaultPrevented","ctrlKey","metaKey","altKey","matchesKeyboardShortcut","closable","requestClose","shiftKey","closing","isConnected","body","candidates","keys","defer","onTabListFocusIn","onTabListFocusOut","currentTarget","relatedTarget","queueMicrotask","contextValue","tabStop","reorderable","reason","active","focused","registerTab","element","info","order","createMemo","el","showScrollButtons","showOverflowTrigger","overflowItemIcon","overflowItemLabel","textContent","cloneIconInto","source","childNodes","appendChild","cloneNode","chooseOverflowItem","_$createComponent","TabsContext","Provider","has","_el$","_tmpl$5","_el$3","firstChild","_el$4","_ref$","mergeRefs","ref","_$use","_$spread","_$mergeProps","cn","class","_$insert","Show","when","_el$2","_tmpl$","$$click","Icon","name","size","_$effect","_p$","_v$","_v$2","e","_$setAttribute","t","$$focusout","$$focusin","$$keydown","_el$5","_tmpl$2","_el$6","_v$3","_v$4","_v$5","_$setStyleProperty","a","_$style","_el$7","_tmpl$3","_v$6","_v$7","_el$8","_tmpl$4","open","_v$8","_v$9","Menu","anchorElement","isOpen","onClose","placement","For","each","nodeNow","drawn","label","setLabel","hasIcon","setHasIcon","iconEl","shownNode","syncIcon","MutationObserver","observer","subtree","childList","characterData","MenuItem","onClick","_el$9","_tmpl$6","_el$0","_tmpl$7","_v$0","_v$1","_v$10","toggle","_$delegateEvents"],"mappings":";;;;;;;;;;;;;;;;AA2IA,MAAMA,KAAmB,IAEnBC,KAAc;AAYpB,SAASC,GAAaC,GAAqF;AACzG,QAAMC,IAAWC,GAAS,MAAMF,EAAME,QAAQ;AAC9C,SAAKC,MACHC,GAAe,MAAMJ,EAAMK,QAAQJ,EAASK,QAAAA,EAAUC,OAAQC,CAAAA,MAASA,aAAgBC,OAAO,CAAC,CAAC,GAElGC,GAAUT,CAAQ;AACpB;AAOA,SAASU,GAAeX,GAGf;AACP,QAAMC,IAAWC,GAAS,MAAMF,EAAME,QAAQ;AAC9CE,SAAAA,GAAe,MACbJ,EAAMY,SACJX,EAAAA,GACAA,EAASK,UAAUO,KAAML,CAAAA,MAASA,KAAQ,QAAQA,MAAS,MAASA,MAAS,EAAE,CACjF,CACF,GACO;AACT;AAEO,SAASM,GAAKd,GAA4C;AAC/D,QAAMe,IAASC,GACb;AAAA,IACEC,kBAAkB;AAAA,IAClBC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AA,CAAA,GAAAuJ;AAAAA,MAAA,MAAApO,GAAA,MAwIxC+B,GAAAA,CAAQ,CAAA;AAAA,IAAA;AAAA,EAAA,CAAA;AAGf;AAIoBsR,GAAA,CAAA,SAAA,WAAA,WAAA,UAAA,CAAA;"}
1
+ {"version":3,"file":"tabs.js","sources":["../../../../src/components/navigation/tabs/tabs.tsx"],"sourcesContent":["import {\n type Accessor,\n type JSX,\n type ParentProps,\n For,\n Show,\n children,\n createComputed,\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n mergeProps,\n on,\n onCleanup,\n onMount,\n splitProps,\n} from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport cn from \"clsx\";\nimport { debounce } from \"../../../utils/debounce\";\nimport { animate } from \"../../../utils/animate\";\nimport { matchesKeyboardShortcut } from \"../../../utils/keyboardShortcut\";\nimport { TabsContext, type TabInfo, type TabsContextValue } from \"./tabsContext\";\nimport { Tab } from \"./tab/tab\";\nimport { getHiddenIndexes } from \"./tabs.utils\";\nimport { Menu } from \"../menu\";\nimport { MenuItem } from \"../menu/menuItem\";\nimport { Icon } from \"../../base/icon\";\nimport { mergeRefs, type Ref } from \"../../../primitives/mergeRefs\";\nimport { createRovingTabIndex } from \"../../../primitives/createRovingTabIndex\";\n\n/**\n * Tabs follow the WAI-ARIA tabs pattern with manual activation. The selected tab is the row's one\n * tab stop (`tabindex` 0, the others -1). The arrow keys along the row's `orientation` move focus to\n * the next or the previous tab (wrapping at the ends), Home and End to the first and the last one;\n * disabled tabs are skipped. Enter or Space then selects the focused tab, as a click does:\n * `onChange` is called for it, with the key's click. Moving focus changes nothing by itself, so a\n * row of link tabs does not navigate as the arrows pass them. Tab leaves the row for what follows\n * it, the selected `TabPanel` first when `panels` are given.\n *\n * A `Tab` can be `closable` and take `actions`; they sit beside the tab and out of the Tab order.\n * Delete on the focused tab, its close button or its `actions` (through `close`) ask `onClose` to\n * close it, and when it goes, focus moves to the tab that takes its place instead of falling to the\n * page. A middle click on a closable tab closes it too.\n *\n * With `onReorder` the row's tabs drag onto one another to reorder: `onReorder(from, to)` reports\n * the drop and the owner moves the tabs; dropping the selected tab reports its new index through\n * `onChange` as well, so the selection follows the moved tab. With `overflowMenu` a scrollable\n * row that overflows gains\n * a trigger beside it listing the clipped tabs. The chords Mod+W (close the focused closable tab)\n * and Mod+Shift+[ / Mod+Shift+] (switch to the previous / next tab) are handled on the row, as\n * best-effort: a browser of its own tabs reserves them.\n */\nexport interface TabsProps {\n /**\n * Index of the selected tab: its position in the row. Tabs count in the order they\n * render, so a tab behind a `<Show>` that is off takes no index, and tabs added,\n * removed or reordered count by their new place.\n */\n value: number;\n /**\n * Called with the index of the clicked tab, counted as for `value`. A tab chosen from the keyboard\n * (Enter or Space on the focused tab) calls it with that click too. A modified or non-primary\n * click (Ctrl, Meta, Shift or Alt held, or a button other than the main one) on a link tab\n * (`Tab` with `href`) is the browser's, as \"open in a new tab\": it does not call `onChange`.\n */\n onChange: (event: MouseEvent & { currentTarget: HTMLElement; target: Element }, index: number) => void;\n /**\n * Which way the tabs run. It sets `aria-orientation` on the tab list and picks the arrow keys that\n * move between tabs: Left and Right when horizontal, Up and Down when vertical. The styles draw\n * a horizontal row; a vertical list is yours to lay out.\n */\n orientation?: \"horizontal\" | \"vertical\";\n /**\n * The content of the tabs: `TabPanel`s, rendered after the tab row. With them each tab gets\n * `aria-controls` its panel and each panel `aria-labelledby` its tab. Without them the tabs link\n * to nothing, as before. Give a panel to every tab: a tab whose panel is left out still names it.\n * A `TabPanel` placed anywhere else is not linked to the tabs and is always shown.\n */\n panels?: JSX.Element;\n /**\n * Base of the ids that link tabs and panels: tab `n` is `{id}-tab-{n}`, its panel `{id}-panel-{n}`.\n * It is also the id of the root element. A generated one by default.\n */\n id?: string;\n /** Draw the indicator as wide as the selected tab's label rather than the whole tab. */\n indicatorContent?: boolean;\n /**\n * Let the tab row scroll sideways instead of clipping it. The edge beyond which\n * more tabs are hidden fades out.\n */\n scrollable?: boolean;\n /**\n * With `scrollable`: buttons at both ends that scroll the row while it overflows. They are for\n * the pointer and stay out of the Tab order: the arrow keys reach every tab and scroll it into\n * view.\n */\n scrollButtons?: boolean;\n /**\n * Present ⇒ the row is reorderable by dragging a tab onto another (pointer-only; there is no\n * keyboard reorder). `Tabs` does not move the tabs itself: it reports the drag with\n * `onReorder(from, to)` — indexes counted as for `value` — and the owner reorders its state.\n * The tabs keep their focus through a reorder; when the moved tab is the selected one,\n * `onChange` reports its new index too, so a controlled owner keeps it selected. That `onChange`\n * carries the drop's own event standing in for the click's: the index argument is authoritative —\n * `currentTarget` is the scroll area the drop delegates to, not the tab.\n */\n onReorder?: (from: number, to: number) => void;\n /**\n * With `scrollable`: when the row overflows, a trigger button is rendered beside the scroller\n * (in the scroll buttons' spot) that opens a menu of the tabs the viewport clips — any clipped\n * part beyond a 1px tolerance counts. Each entry shows the tab's icon and label, the selected one is marked\n * `aria-current=\"true\"`, and choosing one calls `onChange` for it and scrolls it into view.\n * The trigger appears only after the browser has measured an overflow, so the server markup\n * shows none.\n */\n overflowMenu?: boolean;\n /** Accessible label of the overflow-menu trigger. English by default; set it to localise. */\n overflowMenuAriaLabel?: string;\n /**\n * Compact tabs: a shorter row — `--smui-tabDenseHeight` (36px) — with labels as written (no\n * capitals, no letter spacing) and less padding.\n */\n dense?: boolean;\n /**\n * Content-width tabs: each tab is as wide as what it holds (marker, label, close button) and the\n * row does not stretch them, so what is left of the row stays empty; a plain row shares its whole\n * width between its tabs. A tab stays between `--smui-tabFitMinWidth` (80px) and\n * `--smui-tabFitMaxWidth` (256px), set in the theme; a longer label is cut with an ellipsis, and a\n * string `label` is also the label's `title`, so the full text shows on hover (a `Tab` whose label\n * is not a string takes a `title` of its own, which is the tooltip of the whole tab). The indicator, `scrollable`, `scrollButtons`, the\n * overflow menu and the close button need nothing more. Dropping a dragged tab on the row's empty\n * part does nothing.\n */\n fit?: boolean;\n /** Accessible label of the button that scrolls back. */\n scrollBackAriaLabel?: string;\n /** Accessible label of the button that scrolls forward. */\n scrollForwardAriaLabel?: string;\n class?: string;\n children?: JSX.Element;\n \"aria-label\"?: string;\n ref?: Ref<HTMLDivElement>;\n}\n\ninterface IndicatorStyle {\n root: { left?: number; width?: number };\n content?: { width: number };\n}\n\nconst VIEW_NEXT_TAB_PX = 40;\n/** A scroll button moves the row by this share of its visible width. */\nconst SCROLL_PAGE = 0.8;\n\n/** What Tabs knows of each of its tabs. */\ninterface Registration extends TabInfo {\n index: Accessor<number>;\n}\n\n/**\n * The tab list's children, resolved once, with their elements reported in order\n * whenever they change. It renders inside the context provider, so the tabs it\n * creates find their Tabs.\n */\nfunction TabListItems(props: { children?: JSX.Element; onItems: (items: Element[]) => void }): JSX.Element {\n const resolved = children(() => props.children);\n if (!isServer) {\n createComputed(() => props.onItems(resolved.toArray().filter((node) => node instanceof Element)));\n }\n return <>{resolved()}</>;\n}\n\n/**\n * The `panels`, resolved once, inside the context provider so that the panels find their Tabs, and\n * before the tab row renders so that the tabs know whether they control anything. It draws\n * nothing itself: Tabs places what it reports after the row.\n */\nfunction PanelsResolver(props: {\n children?: JSX.Element;\n onPanels: (panels: JSX.Element, has: boolean) => void;\n}): null {\n const resolved = children(() => props.children);\n createComputed(() =>\n props.onPanels(\n resolved(),\n resolved.toArray().some((node) => node != null && node !== false && node !== \"\")\n )\n );\n return null;\n}\n\nexport function Tabs(props: ParentProps<TabsProps>): JSX.Element {\n const merged = mergeProps(\n {\n indicatorContent: false,\n scrollable: false,\n scrollButtons: false,\n overflowMenu: false,\n dense: false,\n fit: false,\n orientation: \"horizontal\" as const,\n scrollBackAriaLabel: \"Scroll tabs back\",\n scrollForwardAriaLabel: \"Scroll tabs forward\",\n overflowMenuAriaLabel: \"More tabs\",\n },\n props\n );\n const [local, rest] = splitProps(merged, [\n \"class\",\n \"children\",\n \"onChange\",\n \"value\",\n \"indicatorContent\",\n \"scrollable\",\n \"scrollButtons\",\n \"onReorder\",\n \"overflowMenu\",\n \"overflowMenuAriaLabel\",\n \"dense\",\n \"fit\",\n \"orientation\",\n \"panels\",\n \"id\",\n \"scrollBackAriaLabel\",\n \"scrollForwardAriaLabel\",\n \"aria-label\",\n \"ref\",\n ]);\n\n const generatedId = createUniqueId();\n const baseId = (): string => local.id ?? generatedId;\n const [registrations, setRegistrations] = createSignal<Registration[]>([]);\n // A tab's own id is the one its panel is labelled by.\n const tabId = (index: number): string =>\n registrations()\n .find((registration) => registration.index() === index)\n ?.id() ?? `${baseId()}-tab-${index}`;\n const panelId = (index: number): string => `${baseId()}-panel-${index}`;\n const [panels, setPanels] = createSignal<JSX.Element>();\n const [hasPanels, setHasPanels] = createSignal(false);\n // The tab that has focus while focus is in the tab list: it is the row's tab stop then, so\n // Tab from there leaves the row instead of landing on the selected tab again.\n const [focusedIndex, setFocusedIndex] = createSignal<number | null>(null);\n\n const [mounted, setMounted] = createSignal(false);\n const [indicatorStyle, setIndicatorStyle] = createSignal<IndicatorStyle>({ root: {} });\n // Whether tabs are hidden past the start / the end of a scrollable row. Only\n // measured in the browser, so the server markup shows neither.\n const [overflowStart, setOverflowStart] = createSignal(false);\n const [overflowEnd, setOverflowEnd] = createSignal(false);\n // The indexes of the tabs the scroller's viewport clips: what the overflow menu lists.\n // Empty on the server and until the first measurement, like the overflow state.\n const [hiddenIndexes, setHiddenIndexes] = createSignal<number[]>([]);\n // The overflow-menu trigger and its menu, composed here when `overflowMenu` is on.\n const [overflowOpen, setOverflowOpen] = createSignal(false);\n let overflowTriggerEl: HTMLButtonElement | undefined;\n\n let tabsEl: HTMLDivElement | undefined;\n let tabListEl: HTMLDivElement | undefined;\n // The tab the user asked to close while it, or something beside it, had focus: its item, which\n // goes with it, and its place. If it goes while focus is lost with it, focus moves on to a neighbour.\n let closingTab: { item: Element; index: number } | null = null;\n // The tab list's elements in order, known once its children have resolved in\n // the browser. Before that, and on the server, a tab's index is the order it\n // was created in, which is its order in the markup.\n const [items, setItems] = createSignal<Element[]>();\n let created = 0;\n\n const getTabsMeta = () => {\n let tabsMeta: { clientWidth: number; scrollLeft: number; left: number; right: number } | undefined;\n if (tabsEl) {\n const rect = tabsEl.getBoundingClientRect();\n tabsMeta = { clientWidth: tabsEl.clientWidth, scrollLeft: tabsEl.scrollLeft, left: rect.left, right: rect.right };\n }\n let tabMeta: DOMRect | null = null;\n let tabContentMeta: DOMRect | null = null;\n if (tabsEl && tabListEl && tabListEl.children.length > 0) {\n const tab = tabListEl.children[local.value];\n tabMeta = tab ? tab.getBoundingClientRect() : null;\n if (local.indicatorContent) {\n tabContentMeta = tab?.querySelector(\".smwb-tab__content\")?.getBoundingClientRect() ?? null;\n }\n }\n return { tabsMeta, tabMeta, tabContentMeta };\n };\n\n const updateIndicatorState = (): void => {\n const { tabsMeta, tabMeta, tabContentMeta } = getTabsMeta();\n let startValue = 0;\n if (tabMeta && tabsMeta) {\n startValue = tabMeta.left - tabsMeta.left + tabsMeta.scrollLeft;\n }\n const next: IndicatorStyle = { root: { left: startValue, width: tabMeta ? tabMeta.width : 0 } };\n if (local.indicatorContent && tabContentMeta) {\n next.content = { width: tabContentMeta.width };\n }\n const prev = indicatorStyle();\n if (prev.root.left === undefined || prev.root.width === undefined) {\n setIndicatorStyle(next);\n return;\n }\n const dStart = Math.abs((prev.root.left ?? 0) - (next.root.left ?? 0));\n const dSize = Math.abs((prev.root.width ?? 0) - (next.root.width ?? 0));\n if (dStart >= 1 || dSize >= 1) {\n setIndicatorStyle(next);\n }\n };\n\n const updateOverflow = (): void => {\n if (!tabsEl || !local.scrollable) {\n setOverflowStart(false);\n setOverflowEnd(false);\n setHiddenIndexes((prev) => (prev.length === 0 ? prev : []));\n return;\n }\n const max = tabsEl.scrollWidth - tabsEl.clientWidth;\n setOverflowStart(tabsEl.scrollLeft > 1);\n setOverflowEnd(tabsEl.scrollLeft < max - 1);\n // Which tabs the viewport clips, measured the same way: the scroller is `position: relative`,\n // so a tab's `offsetLeft` is its place in the row's content. Only the menu needs the list,\n // so nothing is measured without it. Kept by identity when unchanged, because this runs on\n // every scroll tick.\n const hidden = local.overflowMenu\n ? getHiddenIndexes(\n tabListEl\n ? Array.from(tabListEl.children).map((child) => {\n const item = child as HTMLElement;\n return { offsetLeft: item.offsetLeft, offsetWidth: item.offsetWidth };\n })\n : [],\n tabsEl.scrollLeft,\n tabsEl.clientWidth\n )\n : [];\n setHiddenIndexes((prev) =>\n prev.length === hidden.length && prev.every((index, at) => index === hidden[at]) ? prev : hidden\n );\n };\n\n const scroll = (scrollValue: number): void => {\n if (!tabsEl) return;\n animate(tabsEl, \"scrollLeft\", scrollValue, { duration: 300 });\n };\n\n const scrollByPage = (direction: -1 | 1): void => {\n if (!tabsEl) return;\n scroll(tabsEl.scrollLeft + direction * tabsEl.clientWidth * SCROLL_PAGE);\n };\n\n const scrollIndexIntoView = (index: number): void => {\n if (!tabsEl || !tabListEl) return;\n const tab = tabListEl.children[index];\n if (!tab) return;\n const tabsRect = tabsEl.getBoundingClientRect();\n const tabRect = tab.getBoundingClientRect();\n if (tabRect.left < tabsRect.left) {\n scroll(tabsEl.scrollLeft + (tabRect.left - tabsRect.left) - VIEW_NEXT_TAB_PX);\n } else if (tabRect.right > tabsRect.right) {\n scroll(tabsEl.scrollLeft + (tabRect.right - tabsRect.right) + VIEW_NEXT_TAB_PX);\n }\n };\n\n const scrollSelectedIntoView = (): void => {\n scrollIndexIntoView(local.value);\n };\n\n onMount(() => setMounted(true));\n\n // Re-measure when the active value or the tabs change (and on mount).\n createEffect(\n on([() => local.value, items], () => {\n updateIndicatorState();\n updateOverflow();\n })\n );\n\n // Keep the indicator and the overflow state in sync with resizes: of the\n // window, of the row, and of each tab (a label can grow with its data).\n onMount(() => {\n const onResize = debounce(() => {\n updateIndicatorState();\n updateOverflow();\n }, 166);\n const view = tabsEl?.ownerDocument.defaultView;\n view?.addEventListener(\"resize\", onResize);\n tabsEl?.addEventListener(\"scroll\", updateOverflow, { passive: true });\n let resizeObserver: ResizeObserver | undefined;\n if (typeof ResizeObserver !== \"undefined\" && tabListEl) {\n resizeObserver = new ResizeObserver(onResize);\n if (tabsEl) resizeObserver.observe(tabsEl);\n Array.from(tabListEl.children).forEach((child) => resizeObserver?.observe(child));\n }\n updateOverflow();\n onCleanup(() => {\n onResize.cancel();\n view?.removeEventListener(\"resize\", onResize);\n tabsEl?.removeEventListener(\"scroll\", updateOverflow);\n resizeObserver?.disconnect();\n });\n });\n\n // Scroll the selected tab into view when the indicator moves.\n createEffect(() => {\n indicatorStyle();\n scrollSelectedIntoView();\n });\n\n // The tabs in the DOM, by what they are: their indexes are the ones `value` counts.\n const getTabNodes = (): HTMLElement[] => Array.from(tabListEl?.querySelectorAll<HTMLElement>('[role=\"tab\"]') ?? []);\n // A tab with a close button or actions sits in an item with them: focus on any of it is focus on the tab.\n const itemOf = (tab: HTMLElement): HTMLElement => tab.closest<HTMLElement>(\".smwb-tab-item\") ?? tab;\n const indexOfFocus = (target: Node | null | undefined): number =>\n target ? getTabNodes().findIndex((node) => itemOf(node).contains(target)) : -1;\n const isNodeDisabled = (node: HTMLElement | undefined): boolean =>\n !node || node.getAttribute(\"aria-disabled\") === \"true\" || (node as HTMLButtonElement).disabled === true;\n\n // The selected tab is the stop; a value that points at no tab leaves the first one, and a\n // disabled one, which cannot take focus, leaves the first tab that can.\n const selectedStop = (): number => {\n const count = items()?.length;\n const candidate = count === undefined || (local.value >= 0 && local.value < count) ? local.value : 0;\n const list = registrations();\n if (!list.some((registration) => registration.index() === candidate && registration.disabled())) return candidate;\n const enabled = list\n .filter((registration) => !registration.disabled())\n .map((registration) => registration.index())\n .filter((index) => index >= 0);\n return enabled.length > 0 ? Math.min(...enabled) : candidate;\n };\n const stopIndex = (): number => focusedIndex() ?? selectedStop();\n\n const onRovingKeyDown = createRovingTabIndex({\n count: () => getTabNodes().length,\n activeIndex: stopIndex,\n get orientation() {\n return local.orientation;\n },\n onMove: (next) => getTabNodes()[next]?.focus(),\n isDisabled: (index) => isNodeDisabled(getTabNodes()[index]),\n });\n\n // Drag-to-reorder (with `onReorder`): the drag's source and drop target are the tab items,\n // tracked here on the row; Tabs only reports `onReorder(from, to)` — and, when the moved tab\n // is the selected one, its new index through `onChange` — and keeps the tabs' focus alone;\n // the owner moves the tabs in its state.\n // Only while `onReorder` is given do the items carry `draggable`, and a disabled tab\n // never: the attribute is rendered declaratively by each `Tab` on its item (the wrapper,\n // or the bare tab when there is none), so it is part of the server markup — as in React.\n let dragSourceIndex: number | null = null;\n let draggingItem: HTMLElement | null = null;\n let dropTargetItem: HTMLElement | null = null;\n // The tab list itself is no item: a content-width row leaves an empty part past its last tab, and\n // the drag marks nothing there and drops nothing.\n const dragItemOf = (target: EventTarget | null): HTMLElement | null =>\n target instanceof Element && target !== tabListEl ? itemOf(target as HTMLElement) : null;\n const clearDragMarks = (): void => {\n draggingItem?.classList.remove(\"smwb-tab-item--dragging\");\n dropTargetItem?.classList.remove(\"smwb-tab-item--drop-target\");\n draggingItem = null;\n dropTargetItem = null;\n };\n\n const onItemDragStart: JSX.EventHandler<HTMLDivElement, DragEvent> = (event) => {\n if (!local.onReorder) return;\n const item = dragItemOf(event.target);\n if (!item) return;\n const index = indexOfFocus(item);\n if (index < 0 || isNodeDisabled(getTabNodes()[index])) return;\n dragSourceIndex = index;\n draggingItem = item;\n item.classList.add(\"smwb-tab-item--dragging\");\n // Firefox wants the drag given something to carry.\n event.dataTransfer?.setData(\"text/plain\", String(index));\n if (event.dataTransfer) {\n event.dataTransfer.effectAllowed = \"move\";\n }\n };\n\n const onItemDragOver: JSX.EventHandler<HTMLDivElement, DragEvent> = (event) => {\n if (dragSourceIndex === null || !local.onReorder) return;\n const item = dragItemOf(event.target);\n if (!item) return;\n // Without it the drop is not allowed here.\n event.preventDefault();\n if (item === dropTargetItem) return;\n dropTargetItem?.classList.remove(\"smwb-tab-item--drop-target\");\n dropTargetItem = item;\n item.classList.add(\"smwb-tab-item--drop-target\");\n };\n\n const onItemDrop: JSX.EventHandler<HTMLDivElement, DragEvent> = (event) => {\n if (dragSourceIndex === null) return;\n const from = dragSourceIndex;\n dragSourceIndex = null;\n const to = indexOfFocus(dragItemOf(event.target));\n // Read before the drop is reported: the owner may answer `onReorder` synchronously and move\n // `value` with the tab, and moving a node in the DOM loses the focus in some environments.\n const sourceItem = draggingItem;\n const wasSelected = from === local.value;\n const doc = sourceItem?.ownerDocument;\n const hadFocus = Boolean(sourceItem && doc?.activeElement && sourceItem.contains(doc.activeElement));\n clearDragMarks();\n event.preventDefault();\n if (to >= 0 && to !== from) {\n local.onReorder?.(from, to);\n // The selection belongs to the tab: when the moved tab is the selected one, report its\n // new index as a click would, so a controlled owner moves the value with the tab. The\n // drop's event stands in for the click's, as the overflow menu's choice does.\n if (wasSelected) {\n local.onChange(event as unknown as MouseEvent & { currentTarget: HTMLElement; target: Element }, to);\n }\n // The focus belongs to the tab too: put it back on the moved tab when it had it. The\n // check that the node landed at `to` keeps this honest when the owner reorders later.\n if (hadFocus) {\n const moved = getTabNodes()[to];\n if (moved && itemOf(moved) === sourceItem) moved.focus();\n }\n }\n };\n\n const onItemDragEnd: JSX.EventHandler<HTMLDivElement, DragEvent> = () => {\n dragSourceIndex = null;\n clearDragMarks();\n };\n\n // Select the enabled tab `delta` places from the focused one, wrapping at the ends and\n // skipping disabled tabs: as Enter or Space would, through a synthesized click on the tab.\n const switchByChord = (event: KeyboardEvent & { target: Element }, delta: -1 | 1): void => {\n const nodes = getTabNodes();\n const from = indexOfFocus(event.target);\n if (from < 0 || nodes.length === 0) return;\n for (let step = 1; step <= nodes.length; step += 1) {\n const next = (from + delta * step + nodes.length) % nodes.length;\n const node = nodes[next];\n if (node && !isNodeDisabled(node)) {\n node.focus();\n node.click();\n return;\n }\n }\n };\n\n const onTabListKeyDown = (event: KeyboardEvent & { currentTarget: HTMLElement; target: Element }): void => {\n if (event.defaultPrevented) return;\n // The tabs' chords, ahead of the \"chords belong to the browser\" guard below. They are\n // best-effort: a browser of its own tabs reserves Mod+W and Mod+Shift+[/], and they\n // bite only in an embedded webview.\n if ((event.ctrlKey || event.metaKey) && !event.altKey && indexOfFocus(event.target) >= 0) {\n const index = indexOfFocus(event.target);\n const registration = registrations().find((candidate) => candidate.index() === index);\n if (matchesKeyboardShortcut(event, [\"Mod\", \"W\"])) {\n if (registration && !registration.disabled() && registration.closable()) {\n event.preventDefault();\n registration.requestClose(event);\n }\n return;\n }\n if (matchesKeyboardShortcut(event, [\"Mod\", \"Shift\", \"[\"])) {\n event.preventDefault();\n switchByChord(event, -1);\n return;\n }\n if (matchesKeyboardShortcut(event, [\"Mod\", \"Shift\", \"]\"])) {\n event.preventDefault();\n switchByChord(event, 1);\n return;\n }\n }\n // Chords belong to the browser; a handler that took the key first keeps it.\n if (event.ctrlKey || event.metaKey || event.altKey || event.shiftKey) return;\n if (!event.target.closest('[role=\"tab\"]')) return;\n onRovingKeyDown(event);\n };\n\n // Focus can leave the row without a focusout: the focused tab is removed, and the browser moves\n // focus to the body. The row keeps the focused tab as its stop only while focus is in it, on\n // the tab that has it now (tabs before it may have come or gone).\n createEffect(\n on(\n items,\n () => {\n const doc = tabListEl?.ownerDocument;\n const closing = closingTab;\n if (doc && closing && !closing.item.isConnected) {\n closingTab = null;\n // A tab the user closed took the focus with it: the tab that takes its place gets it (the\n // previous one if it was last), the nearest that is not disabled. Focus that went anywhere\n // else meanwhile stays there.\n if (!doc.activeElement || doc.activeElement === doc.body) {\n const nodes = getTabNodes();\n const from = Math.min(closing.index, nodes.length - 1);\n const candidates = [...nodes.keys()].filter((index) => !isNodeDisabled(nodes[index]));\n const target = candidates.find((index) => index >= from) ?? candidates[candidates.length - 1];\n if (target !== undefined) {\n nodes[target]?.focus();\n setFocusedIndex(target);\n return;\n }\n }\n }\n if (focusedIndex() === null) return;\n const index = indexOfFocus(doc?.activeElement);\n setFocusedIndex(index >= 0 ? index : null);\n },\n { defer: true }\n )\n );\n\n const onTabListFocusIn = (event: FocusEvent): void => {\n const index = indexOfFocus(event.target as Node);\n if (index >= 0) setFocusedIndex(index);\n if (closingTab && !closingTab.item.contains(event.target as Node)) closingTab = null;\n };\n\n const onTabListFocusOut = (event: FocusEvent & { currentTarget: HTMLElement }): void => {\n if (!event.currentTarget.contains(event.relatedTarget as Node | null)) {\n setFocusedIndex(null);\n // Chromium fires this too as the focused tab is removed, just before it goes, and the removal\n // is what the marker is for: it stays until the effect that follows the removal has used it.\n // One still standing once the current task's microtasks run was a real blur: that close no\n // longer takes the focus anywhere.\n queueMicrotask(() => {\n if (closingTab?.item.isConnected) closingTab = null;\n });\n }\n };\n\n const contextValue: TabsContextValue = {\n value: () => local.value,\n fit: () => local.fit,\n tabStop: (index) => stopIndex() === index,\n tabId,\n panelId,\n hasPanels,\n reorderable: () => local.onReorder !== undefined,\n onChange: local.onChange,\n closing: (index, reason) => {\n const tab = getTabNodes()[index];\n const active = tab?.ownerDocument.activeElement;\n // Focus in the item is focus on the tab. A close from the tab's own `actions` is the user's\n // wherever focus is: it is in the menu then, which is drawn outside the row.\n const focused = reason === \"actions\" || Boolean(active && tab && itemOf(tab).contains(active));\n closingTab = tab && focused ? { item: itemOf(tab), index } : null;\n },\n registerTab: (element, info) => {\n const order = created++;\n const index = createMemo(() => {\n const list = items();\n if (!list) return order;\n const el = element();\n return el ? list.findIndex((item) => item.contains(el)) : -1;\n });\n const registration: Registration = { ...info, index };\n setRegistrations((list) => [...list, registration]);\n onCleanup(() => setRegistrations((list) => list.filter((item) => item !== registration)));\n return index;\n },\n };\n\n const showScrollButtons = (): boolean =>\n local.scrollable && local.scrollButtons && (overflowStart() || overflowEnd());\n\n // The overflow menu's trigger appears only once the browser has measured a clipped tab,\n // so the server markup — and the first client render — shows none.\n const showOverflowTrigger = (): boolean =>\n local.scrollable && local.overflowMenu && hiddenIndexes().length > 0;\n\n // The menu lists what the viewport clips; each entry shows a copy of the tab's icon and\n // label (the live nodes belong to the row, so they are cloned into the entry, not moved),\n // kept in step with the tab while the menu is open.\n const overflowItemIcon = (node: HTMLElement | undefined): Element | undefined =>\n node?.querySelector(\".smwb-tab__icon\") ?? undefined;\n const overflowItemLabel = (node: HTMLElement | undefined): string =>\n node?.querySelector(\".smwb-tab__text-label\")?.textContent ?? \"\";\n const cloneIconInto = (el: HTMLElement, node: HTMLElement | undefined): void => {\n const source = overflowItemIcon(node);\n if (!source) return;\n Array.from(source.childNodes).forEach((child) => el.appendChild(child.cloneNode(true)));\n };\n\n const chooseOverflowItem = (\n event: MouseEvent & { currentTarget: HTMLLIElement; target: Element },\n index: number\n ): void => {\n setOverflowOpen(false);\n local.onChange(event, index);\n scrollIndexIntoView(index);\n };\n\n return (\n <TabsContext.Provider value={contextValue}>\n <PanelsResolver onPanels={(resolved, has) => (setPanels(() => resolved), setHasPanels(has))}>\n {local.panels}\n </PanelsResolver>\n <div\n {...rest}\n id={local.id}\n class={cn(\n \"smwb-tabs\",\n {\n \"smwb-tabs--dense\": local.dense,\n \"smwb-tabs--fit\": local.fit,\n \"smwb-tabs--overflow-start\": overflowStart(),\n \"smwb-tabs--overflow-end\": overflowEnd(),\n },\n local.class\n )}\n ref={mergeRefs(local.ref)}\n >\n <Show when={showScrollButtons()}>\n <button\n type=\"button\"\n class=\"smwb-tabs__scroll-button smwb-tabs__scroll-button--start\"\n aria-label={local.scrollBackAriaLabel}\n disabled={!overflowStart()}\n tabindex={-1}\n onClick={() => scrollByPage(-1)}\n >\n <Icon name=\"chevron_left\" size={20} />\n </button>\n </Show>\n {/* The scroller's class is static so it is on the element from the start:\n a ref on Tabs can find the row by class right away. */}\n <div\n class=\"smwb-tabs__scroller\"\n classList={{ \"smwb-tabs__scroller--scrollable\": local.scrollable }}\n ref={(el) => (tabsEl = el)}\n >\n <div\n class=\"smwb-tabs__scroll-area\"\n ref={(el) => (tabListEl = el)}\n role=\"tablist\"\n aria-label={local[\"aria-label\"]}\n aria-orientation={local.orientation}\n onKeyDown={onTabListKeyDown}\n onFocusIn={onTabListFocusIn}\n onFocusOut={onTabListFocusOut}\n onDragStart={onItemDragStart}\n onDragOver={onItemDragOver}\n onDrop={onItemDrop}\n onDragEnd={onItemDragEnd}\n >\n <TabListItems onItems={setItems}>{local.children}</TabListItems>\n </div>\n <Show when={mounted()}>\n <span\n class=\"smwb-tabs__indicator\"\n style={{\n left: `${indicatorStyle().root.left ?? 0}px`,\n width: `${indicatorStyle().root.width ?? 0}px`,\n }}\n >\n <span\n class=\"smwb-tabs__indicator-content\"\n style={indicatorStyle().content ? { width: `${indicatorStyle().content?.width ?? 0}px` } : {}}\n />\n </span>\n </Show>\n </div>\n <Show when={showScrollButtons()}>\n <button\n type=\"button\"\n class=\"smwb-tabs__scroll-button smwb-tabs__scroll-button--end\"\n aria-label={local.scrollForwardAriaLabel}\n disabled={!overflowEnd()}\n tabindex={-1}\n onClick={() => scrollByPage(1)}\n >\n <Icon name=\"chevron_right\" size={20} />\n </button>\n </Show>\n <Show when={showOverflowTrigger()}>\n <button\n type=\"button\"\n class=\"smwb-tabs__overflow-trigger\"\n aria-haspopup=\"menu\"\n aria-expanded={overflowOpen()}\n aria-label={local.overflowMenuAriaLabel}\n tabindex={-1}\n ref={(el) => (overflowTriggerEl = el)}\n onClick={() => setOverflowOpen((open) => !open)}\n >\n <Icon name=\"more_horiz\" size={20} />\n </button>\n <Menu\n anchorElement={overflowTriggerEl ?? null}\n isOpen={overflowOpen()}\n onClose={() => setOverflowOpen(false)}\n placement=\"bottom-end\"\n >\n <For each={hiddenIndexes()}>\n {(index) => {\n // The entry mirrors the tab it stands for. Solid children resolve to DOM, not to\n // prop objects, so the tab's own node is the source for the label and the icon;\n // a MutationObserver keeps the entry in step with renames and re-icons while the\n // menu is open. Disabled follows the tab's registration, as in the row's other\n // disabled bookkeeping, so a tab that flips `disabled` in place greys its entry out.\n //\n // Which node that is cannot be settled once, when the entry is drawn: an owner that\n // keys its list by value replaces the tab's node when its label changes, while the\n // clipped set — and so this entry — keeps its identity. `items` and `registrations`\n // are what announce the row moving, and the effect below reads the node from the row\n // when it runs, which is after Solid has landed that move in the DOM; a node sampled\n // earlier, into a memo or into a const, is the detached one by then.\n const nodeNow = (): HTMLElement | undefined => getTabNodes()[index];\n // What the row shows at this index as the entry is drawn, so its first paint is not\n // an empty entry; the effect below keeps it current from then on.\n const drawn = nodeNow();\n const [label, setLabel] = createSignal(overflowItemLabel(drawn));\n const [hasIcon, setHasIcon] = createSignal(Boolean(overflowItemIcon(drawn)));\n const disabled = createMemo(() => {\n const registration = registrations().find((candidate) => candidate.index() === index);\n return registration ? registration.disabled() : isNodeDisabled(nodeNow());\n });\n let iconEl: HTMLSpanElement | undefined;\n // The node the entry's content was last taken from: the icon span copies from it\n // when it is drawn, which is after the sync that asked for it.\n let shownNode = drawn;\n const syncIcon = (node: HTMLElement | undefined): void => {\n shownNode = node;\n const source = overflowItemIcon(node);\n setHasIcon(Boolean(source));\n if (iconEl && source) {\n iconEl.textContent = \"\";\n cloneIconInto(iconEl, node);\n }\n };\n createEffect(\n on([items, registrations], () => {\n const node = nodeNow();\n setLabel(overflowItemLabel(node));\n syncIcon(node);\n const item = node ? itemOf(node) : null;\n const view = item?.ownerDocument.defaultView;\n if (!item || !view || typeof view.MutationObserver === \"undefined\") return;\n const observer = new view.MutationObserver(() => {\n setLabel(overflowItemLabel(node));\n syncIcon(node);\n });\n observer.observe(item, { subtree: true, childList: true, characterData: true });\n onCleanup(() => observer.disconnect());\n })\n );\n return (\n <MenuItem\n disabled={disabled()}\n aria-current={index === local.value ? \"true\" : undefined}\n onClick={(event) => chooseOverflowItem(event, index)}\n >\n <Show when={hasIcon()}>\n <span\n class=\"smwb-tab__icon\"\n aria-hidden=\"true\"\n ref={(el) => {\n iconEl = el;\n // The span is drawn by the flag the sync above sets, so it is born after\n // that sync: it copies the icon of the node the entry last followed.\n if (overflowItemIcon(shownNode)) cloneIconInto(el, shownNode);\n }}\n />\n </Show>\n <span class=\"smwb-tab__text-label\">{label()}</span>\n </MenuItem>\n );\n }}\n </For>\n </Menu>\n </Show>\n </div>\n {panels()}\n </TabsContext.Provider>\n );\n}\n\nexport { Tab };\nexport type { TabProps, TabActionsApi, TabCloseReason } from \"./tab/tab\";\nexport default Tabs;\n"],"names":["VIEW_NEXT_TAB_PX","SCROLL_PAGE","TabListItems","props","resolved","children","isServer","createComputed","onItems","toArray","filter","node","Element","_$memo","PanelsResolver","onPanels","some","Tabs","merged","mergeProps","indicatorContent","scrollable","scrollButtons","overflowMenu","dense","fit","orientation","scrollBackAriaLabel","scrollForwardAriaLabel","overflowMenuAriaLabel","local","rest","splitProps","generatedId","createUniqueId","baseId","id","registrations","setRegistrations","createSignal","tabId","index","find","registration","panelId","panels","setPanels","hasPanels","setHasPanels","focusedIndex","setFocusedIndex","mounted","setMounted","indicatorStyle","setIndicatorStyle","root","overflowStart","setOverflowStart","overflowEnd","setOverflowEnd","hiddenIndexes","setHiddenIndexes","overflowOpen","setOverflowOpen","overflowTriggerEl","tabsEl","tabListEl","closingTab","items","setItems","created","getTabsMeta","tabsMeta","rect","getBoundingClientRect","clientWidth","scrollLeft","left","right","tabMeta","tabContentMeta","length","tab","value","querySelector","updateIndicatorState","startValue","next","width","content","prev","undefined","dStart","Math","abs","dSize","updateOverflow","max","scrollWidth","hidden","getHiddenIndexes","Array","from","map","child","item","offsetLeft","offsetWidth","every","at","scroll","scrollValue","animate","duration","scrollByPage","direction","scrollIndexIntoView","tabsRect","tabRect","scrollSelectedIntoView","onMount","createEffect","on","onResize","debounce","view","ownerDocument","defaultView","addEventListener","passive","resizeObserver","ResizeObserver","observe","forEach","onCleanup","cancel","removeEventListener","disconnect","getTabNodes","querySelectorAll","itemOf","closest","indexOfFocus","target","findIndex","contains","isNodeDisabled","getAttribute","disabled","selectedStop","count","candidate","list","enabled","min","stopIndex","onRovingKeyDown","createRovingTabIndex","activeIndex","onMove","focus","isDisabled","dragSourceIndex","draggingItem","dropTargetItem","dragItemOf","clearDragMarks","classList","remove","onItemDragStart","event","onReorder","add","dataTransfer","setData","String","effectAllowed","onItemDragOver","preventDefault","onItemDrop","to","sourceItem","wasSelected","doc","hadFocus","Boolean","activeElement","onChange","moved","onItemDragEnd","switchByChord","delta","nodes","step","click","onTabListKeyDown","defaultPrevented","ctrlKey","metaKey","altKey","matchesKeyboardShortcut","closable","requestClose","shiftKey","closing","isConnected","body","candidates","keys","defer","onTabListFocusIn","onTabListFocusOut","currentTarget","relatedTarget","queueMicrotask","contextValue","tabStop","reorderable","reason","active","focused","registerTab","element","info","order","createMemo","el","showScrollButtons","showOverflowTrigger","overflowItemIcon","overflowItemLabel","textContent","cloneIconInto","source","childNodes","appendChild","cloneNode","chooseOverflowItem","_$createComponent","TabsContext","Provider","has","_el$","_tmpl$5","_el$3","firstChild","_el$4","_ref$","mergeRefs","ref","_$use","_$spread","_$mergeProps","cn","class","_$insert","Show","when","_el$2","_tmpl$","$$click","Icon","name","size","_$effect","_p$","_v$","_v$2","e","_$setAttribute","t","$$focusout","$$focusin","$$keydown","_el$5","_tmpl$2","_el$6","_v$3","_v$4","_v$5","_$setStyleProperty","a","_$style","_el$7","_tmpl$3","_v$6","_v$7","_el$8","_tmpl$4","open","_v$8","_v$9","Menu","anchorElement","isOpen","onClose","placement","For","each","nodeNow","drawn","label","setLabel","hasIcon","setHasIcon","iconEl","shownNode","syncIcon","MutationObserver","observer","subtree","childList","characterData","MenuItem","onClick","_el$9","_tmpl$6","_el$0","_tmpl$7","_v$0","_v$1","_v$10","toggle","_$delegateEvents"],"mappings":";;;;;;;;;;;;;;;;AAyJA,MAAMA,KAAmB,IAEnBC,KAAc;AAYpB,SAASC,GAAaC,GAAqF;AACzG,QAAMC,IAAWC,GAAS,MAAMF,EAAME,QAAQ;AAC9C,SAAKC,MACHC,GAAe,MAAMJ,EAAMK,QAAQJ,EAASK,QAAAA,EAAUC,OAAQC,CAAAA,MAASA,aAAgBC,OAAO,CAAC,CAAC,GAElGC,GAAUT,CAAQ;AACpB;AAOA,SAASU,GAAeX,GAGf;AACP,QAAMC,IAAWC,GAAS,MAAMF,EAAME,QAAQ;AAC9CE,SAAAA,GAAe,MACbJ,EAAMY,SACJX,EAAAA,GACAA,EAASK,UAAUO,KAAML,CAAAA,MAASA,K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,EAAAK,KAAAD,EAAAvB,GAAA,cAAAmB,EAAAK,IAAAkD,CAAA,GAAAC,MAAAxD,EAAAgB,KAAAZ,EAAAvB,GAAA,oBAAAmB,EAAAgB,IAAAwC,CAAA,GAAAxD;AAAAA,QAAA,GAAA;AAAA,UAAAG,GAAAjL;AAAAA,UAAAmL,GAAAnL;AAAAA,UAAA8L,GAAA9L;AAAAA,QAAAA,CAAA,GAAAuJ;AAAAA,MAAA,MAAArO,GAAA,MAwIxCgC,GAAAA,CAAQ,CAAA;AAAA,IAAA;AAAA,EAAA,CAAA;AAGf;AAIoBsR,GAAA,CAAA,SAAA,WAAA,WAAA,UAAA,CAAA;"}
@@ -14,6 +14,8 @@ export interface TabInfo {
14
14
  }
15
15
  export interface TabsContextValue {
16
16
  value: Accessor<number>;
17
+ /** Whether the row is content-width (`fit`): a tab's label may be cut, so its text is the tab's title. */
18
+ fit?: Accessor<boolean>;
17
19
  onChange: (event: MouseEvent & {
18
20
  currentTarget: HTMLElement;
19
21
  target: Element;
@@ -1 +1 @@
1
- {"version":3,"file":"tabsContext.js","sources":["../../../../src/components/navigation/tabs/tabsContext.ts"],"sourcesContent":["import { type Accessor, createContext, useContext } from \"solid-js\";\n\n/** What asked for a tab to close: its close button, Delete or Backspace on it, its `actions`, or a middle click. */\nexport type TabCloseReason = \"button\" | \"key\" | \"actions\" | \"middleClick\";\n\n/** What a Tab tells its Tabs about itself, read when the Tabs needs it. */\nexport interface TabInfo {\n /** The tab's own `id`, if the caller gave one: the panel is labelled by it. */\n id: Accessor<string | undefined>;\n /** Whether the tab is disabled, so it cannot be the row's tab stop. */\n disabled: Accessor<boolean>;\n /** Whether the tab is `closable`: Mod+W on the focused tab asks to close it. */\n closable: Accessor<boolean>;\n /** Ask the tab to close with this event and the reason \"key\", as its own Delete handling would. */\n requestClose: (event: Event) => void;\n}\n\nexport interface TabsContextValue {\n value: Accessor<number>;\n onChange: (event: MouseEvent & { currentTarget: HTMLElement; target: Element }, index: number) => void;\n /**\n * Each Tab registers on setup with its root element (set once it renders) and\n * gets back its index: its position in the tab list, which follows the tab when\n * tabs are added, removed or reordered.\n */\n /** Whether the tab at `index` is the row's tab stop: the focused tab while focus is in the row, else the selected one. */\n tabStop: (index: number) => boolean;\n /** The id of the tab at `index`, its own if it has one: the one the panel at that index is labelled by. */\n tabId: (index: number) => string;\n /** The id of the panel at `index`: the one the tab at that index controls. */\n panelId: (index: number) => string;\n /** Whether the Tabs were given `panels`, so that its tabs control something. */\n hasPanels: Accessor<boolean>;\n /** Whether the row is reorderable (`onReorder` given): a tab's item is the drag surface then. */\n reorderable: Accessor<boolean>;\n registerTab: (element: Accessor<Element | undefined>, info: TabInfo) => Accessor<number>;\n /**\n * The tab at `index` is being closed by the user (its Delete key, its close button, its\n * `actions` or a middle click):\n * if focus is in it, or the close came from its actions, whose menu is drawn elsewhere, focus moves\n * to a neighbour when it goes, instead of falling to the page.\n */\n closing: (index: number, reason: TabCloseReason) => void;\n}\n\nexport const TabsContext = createContext<TabsContextValue>();\n\nexport const useTabsContext = (): TabsContextValue | undefined => useContext(TabsContext);\n"],"names":["TabsContext","createContext","useTabsContext","useContext"],"mappings":";AA6CO,MAAMA,IAAcC,EAAA,GAEdC,IAAiB,MAAoCC,EAAWH,CAAW;"}
1
+ {"version":3,"file":"tabsContext.js","sources":["../../../../src/components/navigation/tabs/tabsContext.ts"],"sourcesContent":["import { type Accessor, createContext, useContext } from \"solid-js\";\n\n/** What asked for a tab to close: its close button, Delete or Backspace on it, its `actions`, or a middle click. */\nexport type TabCloseReason = \"button\" | \"key\" | \"actions\" | \"middleClick\";\n\n/** What a Tab tells its Tabs about itself, read when the Tabs needs it. */\nexport interface TabInfo {\n /** The tab's own `id`, if the caller gave one: the panel is labelled by it. */\n id: Accessor<string | undefined>;\n /** Whether the tab is disabled, so it cannot be the row's tab stop. */\n disabled: Accessor<boolean>;\n /** Whether the tab is `closable`: Mod+W on the focused tab asks to close it. */\n closable: Accessor<boolean>;\n /** Ask the tab to close with this event and the reason \"key\", as its own Delete handling would. */\n requestClose: (event: Event) => void;\n}\n\nexport interface TabsContextValue {\n value: Accessor<number>;\n /** Whether the row is content-width (`fit`): a tab's label may be cut, so its text is the tab's title. */\n fit?: Accessor<boolean>;\n onChange: (event: MouseEvent & { currentTarget: HTMLElement; target: Element }, index: number) => void;\n /**\n * Each Tab registers on setup with its root element (set once it renders) and\n * gets back its index: its position in the tab list, which follows the tab when\n * tabs are added, removed or reordered.\n */\n /** Whether the tab at `index` is the row's tab stop: the focused tab while focus is in the row, else the selected one. */\n tabStop: (index: number) => boolean;\n /** The id of the tab at `index`, its own if it has one: the one the panel at that index is labelled by. */\n tabId: (index: number) => string;\n /** The id of the panel at `index`: the one the tab at that index controls. */\n panelId: (index: number) => string;\n /** Whether the Tabs were given `panels`, so that its tabs control something. */\n hasPanels: Accessor<boolean>;\n /** Whether the row is reorderable (`onReorder` given): a tab's item is the drag surface then. */\n reorderable: Accessor<boolean>;\n registerTab: (element: Accessor<Element | undefined>, info: TabInfo) => Accessor<number>;\n /**\n * The tab at `index` is being closed by the user (its Delete key, its close button, its\n * `actions` or a middle click):\n * if focus is in it, or the close came from its actions, whose menu is drawn elsewhere, focus moves\n * to a neighbour when it goes, instead of falling to the page.\n */\n closing: (index: number, reason: TabCloseReason) => void;\n}\n\nexport const TabsContext = createContext<TabsContextValue>();\n\nexport const useTabsContext = (): TabsContextValue | undefined => useContext(TabsContext);\n"],"names":["TabsContext","createContext","useTabsContext","useContext"],"mappings":";AA+CO,MAAMA,IAAcC,EAAA,GAEdC,IAAiB,MAAoCC,EAAWH,CAAW;"}
@@ -10,7 +10,7 @@ function G(l) {
10
10
  const g = y({
11
11
  size: "medium",
12
12
  variant: "circular"
13
- }, l), [r, p] = x(g, ["class", "src", "alt", "size", "variant", "color", "style", "imgProps", "children", "ref", "data-testid"]), [d, n] = C(!1), i = () => !!r.src && !d(), c = () => {
13
+ }, l), [r, p] = x(g, ["class", "src", "alt", "size", "variant", "color", "style", "imgProps", "children", "ref", "data-testid"]), [d, n] = C(!1), o = () => !!r.src && !d(), c = () => {
14
14
  const e = r.size;
15
15
  return F(r.style, {
16
16
  ...w(e) ? {} : {
@@ -18,26 +18,26 @@ function G(l) {
18
18
  height: `${e}px`,
19
19
  "font-size": `${e / 2.5}px`
20
20
  },
21
- ...r.color && !i() ? {
21
+ ...r.color && !o() ? {
22
22
  "background-color": r.color
23
23
  } : {}
24
24
  });
25
25
  };
26
26
  return (() => {
27
- var e = S(), o = P(r.ref);
28
- return typeof o == "function" && z(o, e), f(e, v(p, {
27
+ var e = S(), i = P(r.ref);
28
+ return typeof i == "function" && z(i, e), f(e, v(p, {
29
29
  get "data-testid"() {
30
30
  return r["data-testid"] ?? "avatar";
31
31
  },
32
32
  get class() {
33
- return _("smwb-avatar", `smwb-avatar_${r.variant}`, w(r.size) ? `smwb-avatar_${r.size}` : void 0, r.class);
33
+ return _("smwb-avatar", `smwb-avatar_${r.variant}`, w(r.size) ? `smwb-avatar_${r.size}` : void 0, o() ? "smwb-avatar_image" : void 0, r.class);
34
34
  },
35
35
  get style() {
36
36
  return c();
37
37
  }
38
38
  }), !1, !0), s(e, u(h, {
39
39
  get when() {
40
- return i();
40
+ return o();
41
41
  },
42
42
  get fallback() {
43
43
  return (() => {
@@ -69,7 +69,7 @@ function K(l) {
69
69
  const g = y({
70
70
  max: 5,
71
71
  surplusAriaLabel: (a) => `${a} more`
72
- }, l), [r, p] = x(g, ["class", "max", "total", "onSurplusClick", "surplusAriaLabel", "size", "children", "ref", "data-testid"]), d = L(() => r.children), n = () => d.toArray(), i = () => r.total ?? n().length, c = () => Math.max(r.max, 1), e = () => n().slice(0, c()), o = () => n().slice(c()), t = () => i() - e().length;
72
+ }, l), [r, p] = x(g, ["class", "max", "total", "onSurplusClick", "surplusAriaLabel", "size", "children", "ref", "data-testid"]), d = L(() => r.children), n = () => d.toArray(), o = () => r.total ?? n().length, c = () => Math.max(r.max, 1), e = () => n().slice(0, c()), i = () => n().slice(c()), t = () => o() - e().length;
73
73
  return (() => {
74
74
  var a = S(), $ = P(r.ref);
75
75
  return typeof $ == "function" && z($, a), f(a, v(p, {
@@ -107,11 +107,11 @@ function K(l) {
107
107
  }
108
108
  }), null), s(a, u(h, {
109
109
  get when() {
110
- return o().length > 0;
110
+ return i().length > 0;
111
111
  },
112
112
  get children() {
113
113
  var b = B();
114
- return s(b, () => o()), b;
114
+ return s(b, () => i()), b;
115
115
  }
116
116
  }), null), a;
117
117
  })();
@@ -1 +1 @@
1
- {"version":3,"file":"avatar.js","sources":["../../../../../src/components/dataDisplay/avatar/avatar.tsx"],"sourcesContent":["import {\n type JSX,\n type ParentProps,\n Show,\n children as resolveChildren,\n createSignal,\n mergeProps,\n splitProps,\n} from \"solid-js\";\nimport cn from \"clsx\";\nimport { mergeRefs, type Ref } from \"../../../primitives/mergeRefs\";\nimport { callHandler } from \"../../../primitives/callHandler\";\nimport { mergeStyle } from \"../../../primitives/mergeStyle\";\n\nexport type AvatarSize = \"small\" | \"medium\" | \"large\";\n\nexport interface AvatarProps extends JSX.HTMLAttributes<HTMLDivElement> {\n /** Image source. Falls back to children (initials / icon) on error or when absent. */\n src?: string | undefined;\n alt?: string | undefined;\n /** Preset size or an explicit pixel value. */\n size?: AvatarSize | number;\n variant?: \"circular\" | \"rounded\" | \"square\";\n /** Background color for the fallback (initials / icon). */\n color?: string;\n /** Extra attributes forwarded to the underlying <img> (srcSet, loading…). */\n imgProps?: JSX.ImgHTMLAttributes<HTMLImageElement>;\n /** Test id of the root `<div>`; `avatar` unless given. */\n \"data-testid\"?: string | undefined;\n ref?: Ref<HTMLDivElement>;\n}\n\nconst isPresetSize = (size: AvatarSize | number): size is AvatarSize => typeof size === \"string\";\n\nexport function Avatar(props: ParentProps<AvatarProps>): JSX.Element {\n const merged = mergeProps({ size: \"medium\" as AvatarSize | number, variant: \"circular\" as const }, props);\n const [local, rest] = splitProps(merged, [\n \"class\",\n \"src\",\n \"alt\",\n \"size\",\n \"variant\",\n \"color\",\n \"style\",\n \"imgProps\",\n \"children\",\n \"ref\",\n \"data-testid\",\n ]);\n\n const [imgFailed, setImgFailed] = createSignal(false);\n const showImage = (): boolean => Boolean(local.src) && !imgFailed();\n\n const inlineStyle = (): JSX.CSSProperties | string | undefined => {\n const size = local.size;\n return mergeStyle(local.style, {\n ...(isPresetSize(size) ? {} : { width: `${size}px`, height: `${size}px`, \"font-size\": `${size / 2.5}px` }),\n ...(local.color && !showImage() ? { \"background-color\": local.color } : {}),\n });\n };\n\n return (\n <div\n {...rest}\n ref={mergeRefs(local.ref)}\n data-testid={local[\"data-testid\"] ?? \"avatar\"}\n class={cn(\n \"smwb-avatar\",\n `smwb-avatar_${local.variant}`,\n isPresetSize(local.size) ? `smwb-avatar_${local.size}` : undefined,\n local.class\n )}\n style={inlineStyle()}\n >\n <Show\n when={showImage()}\n fallback={\n <span class=\"smwb-avatar__fallback\" role=\"img\" aria-label={local.alt}>\n {local.children}\n </span>\n }\n >\n <img\n {...(local.imgProps ?? {})}\n class={cn(\"smwb-avatar__img\", local.imgProps?.class)}\n src={local.src}\n alt={local.alt}\n onError={(event) => {\n setImgFailed(true);\n callHandler(local.imgProps?.onError, event);\n }}\n />\n </Show>\n </div>\n );\n}\n\nexport interface AvatarGroupProps extends JSX.HTMLAttributes<HTMLDivElement> {\n /** Maximum avatars to show before collapsing the rest into a \"+N\" surplus. */\n max?: number;\n /** Override the total count used for the surplus label (defaults to children count). */\n total?: number;\n /** Click handler for the \"+N\" surplus chip. */\n onSurplusClick?: () => void;\n /** Accessible name of the \"+N\" surplus chip. */\n surplusAriaLabel?: (count: number) => string;\n /** Size of the \"+N\" surplus chip: match the avatars in the group. */\n size?: AvatarSize | number;\n /** Test id of the root `<div>`; `avatar-group` unless given. */\n \"data-testid\"?: string | undefined;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport function AvatarGroup(props: ParentProps<AvatarGroupProps>): JSX.Element {\n const merged = mergeProps(\n { max: 5, surplusAriaLabel: (count: number) => `${count} more` },\n props\n );\n const [local, rest] = splitProps(merged, [\n \"class\",\n \"max\",\n \"total\",\n \"onSurplusClick\",\n \"surplusAriaLabel\",\n \"size\",\n \"children\",\n \"ref\",\n \"data-testid\",\n ]);\n\n const resolved = resolveChildren(() => local.children);\n const items = (): unknown[] => resolved.toArray();\n const totalCount = (): number => local.total ?? items().length;\n const clampedMax = (): number => Math.max(local.max, 1);\n const visible = (): unknown[] => items().slice(0, clampedMax());\n const hidden = (): unknown[] => items().slice(clampedMax());\n const surplus = (): number => totalCount() - visible().length;\n\n // In order, the first avatar first; the \"+N\" chip ends the row.\n return (\n <div\n {...rest}\n ref={mergeRefs(local.ref)}\n data-testid={local[\"data-testid\"] ?? \"avatar-group\"}\n class={cn(\"smwb-avatar-group\", local.class)}\n >\n {visible() as JSX.Element}\n <Show when={surplus() > 0}>\n <Avatar\n class=\"smwb-avatar-group__surplus\"\n size={local.size ?? \"medium\"}\n alt={local.surplusAriaLabel(surplus())}\n onClick={local.onSurplusClick}\n style={local.onSurplusClick ? { cursor: \"pointer\" } : undefined}\n >\n {`+${surplus()}`}\n </Avatar>\n </Show>\n {/* Avatars past max are created with the rest (the children resolve at\n once), so they are rendered, hidden: a server that left them out would\n leave the browser without nodes to hydrate them from. */}\n <Show when={hidden().length > 0}>\n <span class=\"smwb-avatar-group__hidden\" hidden>\n {hidden() as JSX.Element}\n </span>\n </Show>\n </div>\n );\n}\n\nexport default Avatar;\n"],"names":["isPresetSize","size","Avatar","props","merged","mergeProps","variant","local","rest","splitProps","imgFailed","setImgFailed","createSignal","showImage","Boolean","src","inlineStyle","mergeStyle","style","width","height","color","_el$","_tmpl$2","_ref$","mergeRefs","ref","_$use","_$spread","_$mergeProps","cn","undefined","class","_$insert","_$createComponent","Show","when","fallback","_el$3","_tmpl$3","children","_$effect","_$setAttribute","alt","_el$2","_tmpl$","imgProps","event","callHandler","onError","AvatarGroup","max","surplusAriaLabel","count","resolved","resolveChildren","items","toArray","totalCount","total","length","clampedMax","Math","visible","sl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,YAAA,IAAcxC;AAAAA,UAAS;AAAA,UAAA,IAAAS,WAAA;AAAA,mBAE9D,IAAI0B,GAAS;AAAA,UAAE;AAAA,QAAA,CAAA;AAAA,MAAA;AAAA,IAAA,CAAA,GAAA,IAAA,GAAAjC,EAAAkC,GAAAjC,EAMnBC,GAAI;AAAA,MAAA,IAACC,OAAI;AAAA,eAAE6B,EAAAA,EAASL,SAAS;AAAA,MAAC;AAAA,MAAA,IAAApB,WAAA;AAAA,YAAAgC,IAAAC,EAAAA;AAAAxC,eAAAA,EAAAuC,GAAA,MAE1BP,GAAuB,GAAAO;AAAAA,MAAA;AAAA,IAAA,CAAA,GAAA,IAAA,GAAAL;AAAAA,EAAA,GAAA;AAKlC;"}
1
+ {"version":3,"file":"avatar.js","sources":["../../../../../src/components/dataDisplay/avatar/avatar.tsx"],"sourcesContent":["import {\n type JSX,\n type ParentProps,\n Show,\n children as resolveChildren,\n createSignal,\n mergeProps,\n splitProps,\n} from \"solid-js\";\nimport cn from \"clsx\";\nimport { mergeRefs, type Ref } from \"../../../primitives/mergeRefs\";\nimport { callHandler } from \"../../../primitives/callHandler\";\nimport { mergeStyle } from \"../../../primitives/mergeStyle\";\n\nexport type AvatarSize = \"small\" | \"medium\" | \"large\";\n\nexport interface AvatarProps extends JSX.HTMLAttributes<HTMLDivElement> {\n /**\n * Image source. Falls back to children (initials / icon) on error or when absent. While the image is shown the\n * avatar paints no background under it, so a transparent PNG/SVG shows what is behind the avatar.\n */\n src?: string | undefined;\n alt?: string | undefined;\n /** Preset size or an explicit pixel value. */\n size?: AvatarSize | number;\n variant?: \"circular\" | \"rounded\" | \"square\";\n /** Background color for the fallback (initials / icon); not painted under an image. */\n color?: string;\n /** Extra attributes forwarded to the underlying <img> (srcSet, loading…). */\n imgProps?: JSX.ImgHTMLAttributes<HTMLImageElement>;\n /** Test id of the root `<div>`; `avatar` unless given. */\n \"data-testid\"?: string | undefined;\n ref?: Ref<HTMLDivElement>;\n}\n\nconst isPresetSize = (size: AvatarSize | number): size is AvatarSize => typeof size === \"string\";\n\nexport function Avatar(props: ParentProps<AvatarProps>): JSX.Element {\n const merged = mergeProps({ size: \"medium\" as AvatarSize | number, variant: \"circular\" as const }, props);\n const [local, rest] = splitProps(merged, [\n \"class\",\n \"src\",\n \"alt\",\n \"size\",\n \"variant\",\n \"color\",\n \"style\",\n \"imgProps\",\n \"children\",\n \"ref\",\n \"data-testid\",\n ]);\n\n const [imgFailed, setImgFailed] = createSignal(false);\n const showImage = (): boolean => Boolean(local.src) && !imgFailed();\n\n const inlineStyle = (): JSX.CSSProperties | string | undefined => {\n const size = local.size;\n return mergeStyle(local.style, {\n ...(isPresetSize(size) ? {} : { width: `${size}px`, height: `${size}px`, \"font-size\": `${size / 2.5}px` }),\n ...(local.color && !showImage() ? { \"background-color\": local.color } : {}),\n });\n };\n\n return (\n <div\n {...rest}\n ref={mergeRefs(local.ref)}\n data-testid={local[\"data-testid\"] ?? \"avatar\"}\n class={cn(\n \"smwb-avatar\",\n `smwb-avatar_${local.variant}`,\n isPresetSize(local.size) ? `smwb-avatar_${local.size}` : undefined,\n showImage() ? \"smwb-avatar_image\" : undefined,\n local.class\n )}\n style={inlineStyle()}\n >\n <Show\n when={showImage()}\n fallback={\n <span class=\"smwb-avatar__fallback\" role=\"img\" aria-label={local.alt}>\n {local.children}\n </span>\n }\n >\n <img\n {...(local.imgProps ?? {})}\n class={cn(\"smwb-avatar__img\", local.imgProps?.class)}\n src={local.src}\n alt={local.alt}\n onError={(event) => {\n setImgFailed(true);\n callHandler(local.imgProps?.onError, event);\n }}\n />\n </Show>\n </div>\n );\n}\n\nexport interface AvatarGroupProps extends JSX.HTMLAttributes<HTMLDivElement> {\n /** Maximum avatars to show before collapsing the rest into a \"+N\" surplus. */\n max?: number;\n /** Override the total count used for the surplus label (defaults to children count). */\n total?: number;\n /** Click handler for the \"+N\" surplus chip. */\n onSurplusClick?: () => void;\n /** Accessible name of the \"+N\" surplus chip. */\n surplusAriaLabel?: (count: number) => string;\n /** Size of the \"+N\" surplus chip: match the avatars in the group. */\n size?: AvatarSize | number;\n /** Test id of the root `<div>`; `avatar-group` unless given. */\n \"data-testid\"?: string | undefined;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport function AvatarGroup(props: ParentProps<AvatarGroupProps>): JSX.Element {\n const merged = mergeProps(\n { max: 5, surplusAriaLabel: (count: number) => `${count} more` },\n props\n );\n const [local, rest] = splitProps(merged, [\n \"class\",\n \"max\",\n \"total\",\n \"onSurplusClick\",\n \"surplusAriaLabel\",\n \"size\",\n \"children\",\n \"ref\",\n \"data-testid\",\n ]);\n\n const resolved = resolveChildren(() => local.children);\n const items = (): unknown[] => resolved.toArray();\n const totalCount = (): number => local.total ?? items().length;\n const clampedMax = (): number => Math.max(local.max, 1);\n const visible = (): unknown[] => items().slice(0, clampedMax());\n const hidden = (): unknown[] => items().slice(clampedMax());\n const surplus = (): number => totalCount() - visible().length;\n\n // In order, the first avatar first; the \"+N\" chip ends the row.\n return (\n <div\n {...rest}\n ref={mergeRefs(local.ref)}\n data-testid={local[\"data-testid\"] ?? \"avatar-group\"}\n class={cn(\"smwb-avatar-group\", local.class)}\n >\n {visible() as JSX.Element}\n <Show when={surplus() > 0}>\n <Avatar\n class=\"smwb-avatar-group__surplus\"\n size={local.size ?? \"medium\"}\n alt={local.surplusAriaLabel(surplus())}\n onClick={local.onSurplusClick}\n style={local.onSurplusClick ? { cursor: \"pointer\" } : undefined}\n >\n {`+${surplus()}`}\n </Avatar>\n </Show>\n {/* Avatars past max are created with the rest (the children resolve at\n once), so they are rendered, hidden: a server that left them out would\n leave the browser without nodes to hydrate them from. */}\n <Show when={hidden().length > 0}>\n <span class=\"smwb-avatar-group__hidden\" hidden>\n {hidden() as JSX.Element}\n </span>\n </Show>\n </div>\n );\n}\n\nexport default Avatar;\n"],"names":["isPresetSize","size","Avatar","props","merged","mergeProps","variant","local","rest","splitProps","imgFailed","setImgFailed","createSignal","showImage","Boolean","src","inlineStyle","mergeStyle","style","width","height","color","_el$","_tmpl$2","_ref$","mergeRefs","ref","_$use","_$spread","_$mergeProps","cn","undefined","class","_$insert","_$createComponent","Show","when","fallback","_el$3","_tmpl$3","children","_$effect","_$setAttribute","alt","_el$2","_tmpl$","imgProps","event","callHandler","onError","AvatarGroup","max","surplusAriaLabel","count","resolved","resolveChildren","items","toArray","totalCount","total","length","clampedMax","Math","visible","slice","hidden","surplus","_el$4","_ref$2","onClick","onSurplusClick","cursor","_el$5","_tmpl$4"],"mappings":";;;;;;;AAmCA,MAAMA,IAAeA,CAACC,MAAkD,OAAOA,KAAS;AAEjF,SAASC,EAAOC,GAA8C;AACnE,QAAMC,IAASC,EAAW;AAAA,IAAEJ,MAAM;AAAA,IAAiCK,SAAS;AAAA,EAAA,GAAuBH,CAAK,GAClG,CAACI,GAAOC,CAAI,IAAIC,EAAWL,GAAQ,CACvC,SACA,OACA,OACA,QACA,WACA,SACA,SACA,YACA,YACA,OACA,aAAa,CACd,GAEK,CAACM,GAAWC,CAAY,IAAIC,EAAa,EAAK,GAC9CC,IAAYA,MAAeC,EAAQP,EAAMQ,OAAQ,CAACL,EAAAA,GAElDM,IAAcA,MAA8C;AAChE,UAAMf,IAAOM,EAAMN;AACnB,WAAOgB,EAAWV,EAAMW,OAAO;AAAA,MAC7B,GAAIlB,EAAaC,CAAI,IAAI,KAAK;AAAA,QAAEkB,OAAO,GAAGlB,CAAI;AAAA,QAAMmB,QAAQ,GAAGnB,CAAI;AAAA,QAAM,aAAa,GAAGA,IAAO,GAAG;AAAA,MAAA;AAAA,MACnG,GAAIM,EAAMc,SAAS,CAACR,MAAc;AAAA,QAAE,oBAAoBN,EAAMc;AAAAA,MAAAA,IAAU,CAAA;AAAA,IAAC,CAC1E;AAAA,EACH;AAEA,UAAA,MAAA;AAAA,QAAAC,IAAAC,EAAAA,GAAAC,IAGSC,EAAUlB,EAAMmB,GAAG;AAAC,kBAAAF,KAAA,cAAAG,EAAAH,GAAAF,CAAA,GAAAM,EAAAN,GAAAO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